Commit graph

5 commits

Author SHA1 Message Date
a4415ada7e feat(sdk)!: drop the #[fai_module] alias — #[chain_module] only
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 1s
No module outside this workspace was ever published against the
alias (the system has no external users yet), so the pre-rename
name goes away instead of being maintained: one attribute, no
legacy surface. All internal doc references swept; echo example
description moves to the product name. 0.3.0.

Signed-off-by: flemming-it <sf@flemming.it>
2026-07-11 19:47:34 +02:00
4b4de3374c feat(sdk): rename attribute to #[chain_module], keep #[fai_module] alias
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 2s
The public macro name was the last product-scoped 'fai' identifier
in the SDK surface. #[chain_module] is now the primary attribute
(README + examples updated); #[fai_module] stays as a delegating
alias so modules written before the rename keep compiling. 0.2.1.

Signed-off-by: flemming-it <sf@flemming.it>
2026-07-11 19:02:40 +02:00
5cbdb5324e chore: finish fai->chain naming in README, repository URL, macro internals
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 1s
README still documented the crate as fai-module-sdk with a
fai_module_sdk::prelude import; the workspace repository field
pointed at the pre-rename module-sdk-rust URL; the #[fai_module]
expansion used a __fai_module_sdk_internal hygiene module. All
three now carry the chain-module-sdk name. Also note the WIT
contract is chain:platform@1.1 (additive emit-event on the
frozen 1.0 base) and document ctx.emit in the surface table.

Signed-off-by: flemming-it <sf@flemming.it>
2026-07-07 13:43:09 +02:00
f32dc820b9 feat(sdk): Context::emit for WIT 1.1 host.emit-event (T1)
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 1s
Brings the module SDK to WIT 1.1 in lockstep with the platform and
exposes the new host.emit-event as an ergonomic ctx.emit(name,
payload). Modules emit ephemeral progress/stream events (progress,
token streaming) delivered live to a following client and never
persisted.

- wit/world.wit → 1.1.0 (host.emit-event + use types.{payload}).
- host.rs: an emit hook (thread-local fn pointer; guest is
  single-threaded). The #[fai_module] expansion installs a closure
  reaching the real WIT emit-event import at the start of each
  invocation; Context::emit calls through it. Outside a hub (unit
  tests) it is a silent no-op.
- examples/progress: reference module emitting progress + token events;
  builds clean for wasm32-wasip2, proving the ergonomics end-to-end.

The SDK keeps shielding module authors: emit is the whole surface, no
wit_bindgen in sight.

Signed-off-by: flemming-it <sf@flemming.it>
2026-07-05 19:24:02 +02:00
98e98e9371 refactor: rename crate fai-module-sdk -> chain-module-sdk
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 2s
The SDK is product-scoped (Ch∆In's module SDK), not a generic vendor
crate — a future Brain SDK would collide. Crate + macros renamed to
chain-module-sdk[-macros]; repo + dir follow.

Signed-off-by: flemming-it <sf@flemming.it>
2026-06-16 11:26:37 +02:00