@stackbone/cli 0.6.2 → 0.7.0

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +163 -0
  2. package/main.js +20538 -8590
  3. package/migrations/0094_rag_document_versions.sql +61 -0
  4. package/migrations/0095_rag_document_version_counters.sql +22 -0
  5. package/migrations/0096_trigger_subscriptions_target_kind.sql +29 -0
  6. package/migrations/0097_voice_settings.sql +34 -0
  7. package/migrations/0098_model_selections_provider_id.sql +23 -0
  8. package/migrations/0099_memory.sql +35 -0
  9. package/migrations/0100_memory_call_run.sql +9 -0
  10. package/migrations/0101_memory_call_run_no_fk.sql +5 -0
  11. package/migrations/0102_voice_recordings.sql +31 -0
  12. package/migrations/0103_rag_collection_embeddings.sql +21 -0
  13. package/migrations/0104_rag_collection_rebuilds.sql +33 -0
  14. package/migrations/0105_rag_rebuild_manifest_size.sql +15 -0
  15. package/migrations/0106_memory_agent_scope.sql +16 -0
  16. package/migrations/0107_memory_settings.sql +7 -0
  17. package/migrations/0108_memory_identity_bindings.sql +13 -0
  18. package/migrations/0109_trigger_subscriptions_conversation_key.sql +17 -0
  19. package/migrations/0110_concurrency_limits.sql +52 -0
  20. package/migrations/0111_concurrency_slots_now_idx.sql +21 -0
  21. package/migrations/0112_concurrency_max_hold_override.sql +15 -0
  22. package/migrations/0113_trigger_subscriptions_debounce_ms.sql +13 -0
  23. package/package.json +2 -1
  24. package/runtime-deps/@stackbone/workflow-world/index.js +223 -85
  25. package/stackbone-cli-0.7.0.tgz +0 -0
  26. package/voice-worker/main.js +2150 -0
  27. package/voice-worker/main.js.map +7 -0
  28. package/voice-worker/package.json +18 -0
  29. package/stackbone-cli-0.6.2.tgz +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,169 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.7.0] - 2026-10-30
11
+
12
+ ### Added
13
+
14
+ - **`stackbone runs list --tag <key:value>` — the runs a caller labelled.** A
15
+ chat caller can label the run its turn opens with the `x-stackbone-run-tags`
16
+ header (every turn of a voice call carries `channel:voice` and its `room`), and
17
+ `--tag` lists only the runs carrying that tag: split on the first colon, exact
18
+ and case-sensitive. A malformed tag is refused before any request (FDE-62).
19
+ - **`stackbone package` documents the voice recording key pair.** The `.env`
20
+ carries `STACKBONE_VOICE_RECORDING_S3_ACCESS_KEY` and
21
+ `STACKBONE_VOICE_RECORDING_S3_SECRET_KEY`, commented out: the key LiveKit Cloud
22
+ uploads call recordings with, in place of the box's own. The README says that a
23
+ folder left on the bundled MinIO records no call, since LiveKit Cloud cannot
24
+ reach it (FDE-62).
25
+ - **`stackbone dev` starts the voice worker.** When the workspace has a deep
26
+ agent with `voice: true` and the box has LiveKit credentials saved in Studio
27
+ (Settings › Voice settings), `dev` runs the LiveKit voice worker on your
28
+ machine and prints `Voice worker ready (stackbone-voice-dev-<8 hex>)` once
29
+ LiveKit registers it. It stops the worker when either goes away and restarts
30
+ it when the credentials change, with no restart of `dev`. Each session
31
+ registers under its own name and its box dispatches calls to that name only,
32
+ so a worker deployed to LiveKit Cloud on the same project takes none of them.
33
+ The worker ships inside the CLI. The first session installs its dependencies
34
+ once, about 350 MB, into `~/.cache/stackbone/voice-worker/<version>/`, and
35
+ later sessions reuse them. A worker that fails is started once more, then
36
+ `dev` warns and keeps running. `STACKBONE_VOICE_WORKER_BIN` points it at
37
+ another worker `main.js` (FDE-62).
38
+ - **`stackbone limits` — operate a workspace's concurrency limits.** `list`
39
+ shows each limit with its capacity and its busy and waiting counts.
40
+ `slots <name>` lists the held and granted slots, then the queue in order.
41
+ `release <slotId> --yes` gives back a slot whose release was lost and grants
42
+ the next run in the queue. `capacity <name> <n|reset>` and
43
+ `max-hold <name> <duration|reset>` override the declared values; a new
44
+ max hold applies only to slots granted after the change. Each verb targets
45
+ the local-dev installation unless `--agent <id>` names another.
46
+ - **Concurrency limits in the box.** The box enforces the `limits` declared in
47
+ `stackbone.config.ts` for the SDK's `acquireSlot`, `releaseSlot` and
48
+ `withLimit`, takes back a slot held past `maxHold`, and frees a run's slots
49
+ when the run ends. It serves `GET /api/limits`,
50
+ `GET /api/limits/{name}/slots`, `POST /api/limits/slots/{id}/release` and
51
+ `PATCH /api/limits/{name}`, records a manual release or override in the
52
+ activity log, and Studio gets a limits screen to change capacity and max
53
+ hold and release a slot. A build fails on a limit the box would refuse.
54
+ - **Trigger links can start an agent.** A trigger link can target a deep agent
55
+ instead of a workflow. The event maps onto the agent's `message` field, and
56
+ Test, Auto-map and arming validate it. Each delivery is acknowledged once
57
+ queued and then runs as one agent turn with its own session; guardrails and
58
+ approvals use the existing inbox. Workflow links behave as before (PLA-968,
59
+ PLA-969).
60
+ - **A conversation key groups an agent link's events into one session.** The
61
+ key is a JSONata expression on the raw event, such as a Gmail thread id or a
62
+ WhatsApp sender. Events that yield the same value continue one session of
63
+ the agent, scoped to that link; anything unusable opens a fresh one. Turns
64
+ of one conversation never overlap: a new event waits for the running turn,
65
+ gives up after 10 minutes, and waits for the decision when an approval is
66
+ pending. Studio authors the key on the link's Correlation card, and Test
67
+ shows the key it would extract (PLA-971, PLA-972).
68
+ - **An agent answers a burst of chat messages once.** An agent link with a
69
+ conversation key can carry a wait, `debounceMs` (1 to 10000 ms). The box
70
+ holds one customer's messages until they have been quiet for the wait, or
71
+ 10 s have passed since the first, and answers them in one turn. Two
72
+ customers are never merged, and a link without a wait behaves as before.
73
+ Studio sets the wait on the link (STA3-25, STA3-27).
74
+ - **Agent memory is isolated per agent and configurable.** Each agent keeps
75
+ its own facts and call records per customer. Read and save are separate
76
+ settings, off by default, and Studio edits them per agent. A text agent gets
77
+ only the memory tools that are on; a voice agent recalls before it answers
78
+ and saves the heard transcript once after the call. Studio's System screen
79
+ edits the memory extractor's model and its published guidance (FDE-87).
80
+ - **"Delete all" on a person's memory also erases their run history on that
81
+ agent.** The runs, their steps and the deep agent's checkpoints for those
82
+ sessions go with the memory, after a confirmation that lists every run. Runs
83
+ are matched on the identity stored on each run, never on transcript text.
84
+ While one of the person's runs is open, the box refuses with a 409 and
85
+ deletes nothing (STA3-21).
86
+ - **Per-collection embeddings and rebuilds.** Studio creates a RAG collection
87
+ with its own provider and model and probes its dimension. Changing the model
88
+ later rebuilds every stored version through a durable workflow the CLI
89
+ seeds; queries and conflicting writes on the collection wait until the
90
+ rebuild commits, and a failed rebuild keeps its progress for a retry. Managed
91
+ uploads and Studio searches use the collection's saved model, and
92
+ `stackbone rag` reads a collection's saved provider, model, dimension and
93
+ `exact` search mode (STA3-18).
94
+ - **Voice agents search their knowledge.** When the caller finishes a
95
+ sentence, the box searches the agent's RAG collection and hands the passages
96
+ above the score threshold (default 0.2) to the model for that turn, with no
97
+ tool call. The collection is set in code (`voiceSettings.rag`) or on a new
98
+ Knowledge tab in Studio. Short utterances skip the search, and a failed or
99
+ slow search logs one warning and the agent answers without passages
100
+ (FDE-67).
101
+ - **Voice agents in the box.** A `voice: true` agent shows a Voice tab on its
102
+ Catalog entry. The box stores LiveKit credentials saved in Studio (Settings ›
103
+ Voice settings) and checks it can reach LiveKit with them. Studio places a
104
+ test call to the agent, edits its voice settings field by field over the
105
+ ones in code, and plays back a call's recording from its session when the
106
+ agent turns `recording` on (STA3-2, FDE-62).
107
+
108
+ ### Changed
109
+
110
+ - **`stackbone init` and `stackbone add deep-agent` pin `langchain`.** A deep
111
+ agent declared with `harness: 'minimal'` builds with it, so the workspace root
112
+ now pins it exactly at `1.5.2`, a version inside the `^1.5.0` range
113
+ `deepagents` declares whose `@langchain/core` peer range the pinned core meets,
114
+ and the box image bakes the same version (FDE-62).
115
+
116
+ ### Fixed
117
+
118
+ - **`stackbone package` includes workflow npm dependencies.** A creator
119
+ dependency such as `pdf-lib` could stay a bare import, so the packaged box
120
+ passed `/health` and every workflow failed on load. Creator dependencies are
121
+ now bundled with the workflow steps, and a loader that needs package-local
122
+ code or assets the bundle lacks is refused before the manifest is written,
123
+ with `build.external` guidance. Optional `require` calls whose fallback is
124
+ `undefined` are accepted (PLA-2353).
125
+ - **Approval decisions keep the reviewer.** Studio records the verified
126
+ reviewer's email, and the decision, approver and decision time reach
127
+ `requestApproval()`, `approval.get()` and `approval.list()` (PLA-2360).
128
+ - **A long workflow step no longer runs twice.** A step callback longer than
129
+ 300 s hit the HTTP client's own transport deadline and was retried next to
130
+ the original, duplicating side effects. The configured
131
+ `WORKFLOW_HTTP_TIMEOUT_MS` now governs it (PLA-2363).
132
+ - **A failed workflow run and its error event are written together**, so the
133
+ run is never marked failed without the event that carries its error.
134
+ - **`stackbone.memory.add` from a workflow step no longer fails** when the
135
+ run's row lands after the call; the run link stays and opens a not-found
136
+ state if the run never lands (STA3-20).
137
+ - **Insights queries on the box are bounded.** One query never holds a
138
+ connection more than 8 s, and a breakdown by an id reads only its
139
+ top groups instead of every group (STA3-6).
140
+ - **`stackbone db migrate create` works on Windows.** The schema and output
141
+ paths passed to drizzle-kit use `/`, which its glob reads on every OS.
142
+
143
+ ## [0.6.3] - 2026-10-26
144
+
145
+ ### Added
146
+
147
+ - **Per-person long-term memory in the box**, with a Studio screen to find a
148
+ person by phone and erase what the box remembers of them (FDE-68, STA3-20).
149
+ - **Several model providers per box.** Each model selector picks a provider and
150
+ a model (STA3-17).
151
+ - **RAG document versions** with rollback to an earlier one, a reranking step
152
+ before results reach the agent, and a reviewer role that only uploads new
153
+ versions (STA3-8, STA3-4, STA3-5).
154
+ - **Triggers:** the webhook address is shown, provider-filled fields are
155
+ dropdowns, Meta can verify the box webhook URL, and Studio says when the last
156
+ event arrived and why a link fails, in plain language (FDE-77, FDE-75,
157
+ PLA-2352, FDE-79, FDE-80).
158
+ - **Connectors:** a WhatsApp message to the business number can start a run,
159
+ and three WhatsApp faults no longer drop messages silently (FDE-74, FDE-78).
160
+ Zoho CRM works with records in any module.
161
+ - **`stackbone login` without a browser** (PLA-1965).
162
+
163
+ ### Fixed
164
+
165
+ - **An Outlook trigger link polls its own mailbox**, not `/me`, and links
166
+ created before this release get their mailbox back when the box boots
167
+ (FDE-85).
168
+ - A box boots on a workspace with no workflows (PLA-1578).
169
+ - `stackbone dev` reports a box port already in use, and no longer requires
170
+ connect secrets it does not use (PLA-2057, PLA-2018).
171
+ - RAG: the SDK filter, an atomic re-ingest and a cancel guard (PLA-2327).
172
+
10
173
  ## [0.6.2] - 2026-10-09
11
174
 
12
175
  ### Added