@stackbone/sdk 0.1.0-alpha.6 → 0.1.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,102 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.0-alpha.8] - 2026-07-01
11
+
12
+ ### Added
13
+
14
+ - **`stackbone.workflows` — namespaced workflow trigger + schedule surface on the
15
+ ambient client.** `stackbone.workflows.start(name, input)` (fire-and-forget),
16
+ `.startAndWait<T>(name, input)` (durable sub-routine), `.schedule(name, input,
17
+ cron)` / `.unschedule(name)` / `.listSchedules()` (dynamic cron). These are the
18
+ peer-free shims over the runtime-injected `WorkflowStarter` / `WorkflowScheduler`
19
+ seams, now exposed under one unified `stackbone.*` namespace alongside
20
+ `stackbone.connection` / `stackbone.agent`. The main barrel stays peer-free.
21
+
22
+ ### Deprecated
23
+
24
+ - The loose `startWorkflow` / `startWorkflowAndWait` / `scheduleWorkflow` /
25
+ `unschedule` / `listSchedules` exports on the `@stackbone/sdk/workflow` subpath
26
+ are now `@deprecated` aliases that delegate to the identical implementation —
27
+ prefer the namespaced `stackbone.workflows.*` members. The peer-bound authoring
28
+ API (`requestApproval` / `defineHook` / `sleep`) stays on the subpath because it
29
+ eager-loads the `workflow` peer.
30
+
31
+ ## [0.1.0-alpha.7] - 2026-06-25
32
+
33
+ ### Added
34
+
35
+ - **Workflow-level Human-in-the-Loop (HITL) on the new `@stackbone/sdk/workflow`
36
+ subpath.** `requestApproval({ token, topic, payload, title, timeout, fallback })`
37
+ pauses a durable workflow on a Workflow SDK hook, records the pause in the
38
+ agent's `approvals` table (joined to the run so it shows in the inbox), and
39
+ races the human decision against the `timeout` — applying the `fallback`
40
+ (`'reject' | 'approve'`) if nobody decides. The caller gates the side-effect on
41
+ `decision.status === 'approved'`. The raw `defineHook` + `sleep` primitives are
42
+ re-exported from the same subpath as the escape hatch. Neither may run inside a
43
+ `"use step"` block (`.create()` is a workflow primitive that suspends the run).
44
+ The subpath statically imports the new OPTIONAL `workflow` peer dependency
45
+ (kept external by the build), so the main `@stackbone/sdk` barrel stays free of
46
+ it — a tool-only agent never eager-loads `workflow`.
47
+ - **`ApprovalRequestOptions.runId`** — `client.approval.request(...)` now accepts
48
+ a `runId` that is written to `approvals.run_id` (FK to `runs.id`), so an
49
+ approval can be tied to the projected run that requested it.
50
+ - **`eveAgent(name)` on the `@stackbone/sdk/workflow` subpath.** Addresses a
51
+ sibling eve agent BY NAME from a workflow `"use step"` and returns eve's `Client`
52
+ as-is (a thin wrapper — drive it with eve's own `.session()` / `.send()` API).
53
+ The name resolves to a URL through the emulator-injected `AGENT_URLS` map; each
54
+ request is signed with the shared `HMAC_SECRET` (timestamp-bound bearer under
55
+ `x-stackbone-timestamp` / `x-stackbone-workflow-signature`, verified inside a
56
+ 5-minute drift window) so the agent's channel auth accepts the co-located hop.
57
+ The helper statically imports the new OPTIONAL `eve` peer dependency (kept
58
+ external by the build), so the main `@stackbone/sdk` barrel stays free of it.
59
+ - **`stackbone.agent(id)` — the namespaced sibling-agent member on the ambient
60
+ client.** `stackbone.agent('support').session().send({ ... })` produces the same
61
+ signed workflow→agent call and the same eve `Client` API as the now-`@deprecated`
62
+ top-level `eveAgent('support')` on the `/workflow` subpath, narrowed by the same
63
+ augmentable `AgentRegistry` (declared names autocomplete, a typo is a compile
64
+ error). The crux is peer isolation: unlike `eveAgent`, the member imports NO `eve`
65
+ peer at module load — selecting the agent and opening a session are synchronous,
66
+ and only the session's already-async leaves (`send` / `stream`) resolve
67
+ `eve/client` via dynamic import on first use, then memoise it so conversation
68
+ state carries across turns. A tool-only agent that imports `@stackbone/sdk` and
69
+ only touches `stackbone.config` never loads `eve`. Verified by a no-peer import
70
+ regression test (the main barrel `index.js` statically imports neither `eve` nor
71
+ `workflow`).
72
+ - **`stackbone.agent(id).session()` is now a DROP-IN twin of eve's native
73
+ `ClientSession`.** A workflow written against the eager `eveAgent(...)` path keeps
74
+ compiling verbatim when it swaps to `stackbone.agent(...)`: `session.send<T>(...)`
75
+ returns eve's `MessageResponse<T>` (so both `.result()` — typed `.data` — and
76
+ `for await...of` work), `session.session(state)` accepts eve's nominal
77
+ `SessionState` (`{ continuationToken?, sessionId?, streamIndex }`), and
78
+ `session.state` exposes the advanced cursor to persist between turns. These
79
+ peer-free structural mirrors are exported from the main barrel as
80
+ `EveMessageResponse` / `EveMessageResult` / `EveSessionState` / `EveStreamEvent` /
81
+ `SendTurnInput` (plus `AgentAccessor` / `LazyAgentClient` / `LazyAgentSession` /
82
+ `AgentRegistry`) so a workflow can name the handle, the response, the cursor and
83
+ the forwarded stream frame without reaching for the optional `eve` peer.
84
+ Previously the lazy session typed `send` as `Promise<unknown>` and omitted
85
+ `state`, so those usages did not type-check — only the eager path did.
86
+
87
+ ### Deprecated
88
+
89
+ - **`eveAgent(name)`** (on the `@stackbone/sdk/workflow` subpath) in favour of the
90
+ namespaced `stackbone.agent(id)` from the main barrel. The old export still works
91
+ and is byte-identical on the wire; it just resolves the `eve` peer eagerly (the
92
+ subpath already imports it) instead of lazily.
93
+
94
+ ### Documentation
95
+
96
+ - **Public docs + starter templates moved to the namespaced reach-by-id surface.**
97
+ The developer wiki gains a dedicated `stackbone.agent` page, documents
98
+ `stackbone.connection(id)` alongside the workspace-broker `client.legacyConnections`,
99
+ and shows the ambient `stackbone` handle with both reach-by-id members in the SDK
100
+ overview — each with a note that the top-level `eveAgent(...)` / bare
101
+ `connection(...)` forms are deprecated aliases. The starter's `AGENTS.md` now
102
+ models `stackbone.agent(...)` / `stackbone.connection(...)` for agent-to-agent and
103
+ connector calls. The CLI's inline `stackbone docs` bundle is regenerated from the
104
+ wiki so the new surface ships with the next CLI release.
105
+
10
106
  ## [0.1.0-alpha.6] - 2026-06-17
11
107
 
12
108
  ### Added