@bastani/atomic 0.9.73-alpha.1 → 0.9.74-alpha.1

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 (194) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +10 -0
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/package.json +1 -1
  5. package/dist/builtin/subagents/package.json +1 -1
  6. package/dist/builtin/web-access/package.json +1 -1
  7. package/dist/builtin/workflows/CHANGELOG.md +16 -0
  8. package/dist/builtin/workflows/README.md +2 -2
  9. package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
  10. package/dist/builtin/workflows/builtin/{chunk-2377r57g.js → chunk-8kdrnrpa.js} +1 -1
  11. package/dist/builtin/workflows/builtin/{chunk-t8y25z1j.js → chunk-8ycbc76t.js} +1 -1
  12. package/dist/builtin/workflows/builtin/{chunk-vbrmytm5.js → chunk-a4fdm2cw.js} +1 -1
  13. package/dist/builtin/workflows/builtin/{chunk-9pjdp2td.js → chunk-d5cxskkp.js} +3 -3
  14. package/dist/builtin/workflows/builtin/{chunk-tpsw128z.js → chunk-d9pz64yp.js} +3 -3
  15. package/dist/builtin/workflows/builtin/{chunk-z0d03ktm.js → chunk-gp0s6m45.js} +1 -1
  16. package/dist/builtin/workflows/builtin/{chunk-4kygv34g.js → chunk-m8eg152f.js} +1 -1
  17. package/dist/builtin/workflows/builtin/{chunk-mswg7kc7.js → chunk-r39ypw6b.js} +1 -1
  18. package/dist/builtin/workflows/builtin/{chunk-q7dry6km.js → chunk-va2h64a6.js} +3 -3
  19. package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
  20. package/dist/builtin/workflows/builtin/goal.js +4 -4
  21. package/dist/builtin/workflows/builtin/index.js +9 -9
  22. package/dist/builtin/workflows/builtin/loop-until-done.js +2 -2
  23. package/dist/builtin/workflows/builtin/ralph.js +4 -4
  24. package/dist/builtin/workflows/builtin/tournament.js +2 -2
  25. package/dist/builtin/workflows/package.json +1 -1
  26. package/dist/builtin/workflows/src/authoring.d.ts +2 -0
  27. package/dist/builtin/workflows/src/extension/index.bundle.mjs +403 -76
  28. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +387 -60
  29. package/dist/builtin/workflows/src/index.js +393 -62
  30. package/dist/builtin/workflows/src/local-worker-entry.mjs +387 -60
  31. package/dist/builtin/workflows/src/shared/serializable-error-families.d.ts +1 -0
  32. package/dist/builtin/workflows/src/shared/structured-output-errors.d.ts +50 -0
  33. package/dist/config.d.ts +2 -0
  34. package/dist/config.d.ts.map +1 -1
  35. package/dist/config.js +4 -0
  36. package/dist/config.js.map +1 -1
  37. package/dist/core/agent-session-background-compaction.d.ts.map +1 -1
  38. package/dist/core/agent-session-background-compaction.js +2 -1
  39. package/dist/core/agent-session-background-compaction.js.map +1 -1
  40. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  41. package/dist/core/agent-session-compaction.js +98 -4
  42. package/dist/core/agent-session-compaction.js.map +1 -1
  43. package/dist/core/agent-session-detached-tools.d.ts +20 -5
  44. package/dist/core/agent-session-detached-tools.d.ts.map +1 -1
  45. package/dist/core/agent-session-detached-tools.js +97 -21
  46. package/dist/core/agent-session-detached-tools.js.map +1 -1
  47. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  48. package/dist/core/agent-session-message-queue.js +2 -1
  49. package/dist/core/agent-session-message-queue.js.map +1 -1
  50. package/dist/core/agent-session-methods.d.ts +3 -1
  51. package/dist/core/agent-session-methods.d.ts.map +1 -1
  52. package/dist/core/agent-session-methods.js.map +1 -1
  53. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
  54. package/dist/core/agent-session-persistent-custom-messages.js +12 -4
  55. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
  56. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  57. package/dist/core/agent-session-prompt.js +33 -0
  58. package/dist/core/agent-session-prompt.js.map +1 -1
  59. package/dist/core/compaction/background-compaction.d.ts +11 -5
  60. package/dist/core/compaction/background-compaction.d.ts.map +1 -1
  61. package/dist/core/compaction/background-compaction.js +19 -10
  62. package/dist/core/compaction/background-compaction.js.map +1 -1
  63. package/dist/core/compaction/compaction-boundary.d.ts +10 -0
  64. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  65. package/dist/core/compaction/compaction-boundary.js +30 -2
  66. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  67. package/dist/core/compaction/compaction-runner.d.ts +7 -0
  68. package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
  69. package/dist/core/compaction/compaction-runner.js +13 -5
  70. package/dist/core/compaction/compaction-runner.js.map +1 -1
  71. package/dist/core/compaction/compaction-types.d.ts +1 -1
  72. package/dist/core/compaction/compaction-types.js +1 -1
  73. package/dist/core/compaction/compaction-types.js.map +1 -1
  74. package/dist/core/compaction/deleted-ranges.d.ts +17 -2
  75. package/dist/core/compaction/deleted-ranges.d.ts.map +1 -1
  76. package/dist/core/compaction/deleted-ranges.js +44 -5
  77. package/dist/core/compaction/deleted-ranges.js.map +1 -1
  78. package/dist/core/compaction/history-recall.d.ts +32 -0
  79. package/dist/core/compaction/history-recall.d.ts.map +1 -0
  80. package/dist/core/compaction/history-recall.js +275 -0
  81. package/dist/core/compaction/history-recall.js.map +1 -0
  82. package/dist/core/compaction/index.d.ts +2 -0
  83. package/dist/core/compaction/index.d.ts.map +1 -1
  84. package/dist/core/compaction/index.js +2 -0
  85. package/dist/core/compaction/index.js.map +1 -1
  86. package/dist/core/compaction/pi-summary-fallback.d.ts.map +1 -1
  87. package/dist/core/compaction/pi-summary-fallback.js +1 -0
  88. package/dist/core/compaction/pi-summary-fallback.js.map +1 -1
  89. package/dist/core/compaction/planner-outcome.d.ts +14 -0
  90. package/dist/core/compaction/planner-outcome.d.ts.map +1 -1
  91. package/dist/core/compaction/planner-outcome.js +8 -0
  92. package/dist/core/compaction/planner-outcome.js.map +1 -1
  93. package/dist/core/compaction/range-planner-diagnostics.d.ts +35 -10
  94. package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -1
  95. package/dist/core/compaction/range-planner-diagnostics.js +67 -24
  96. package/dist/core/compaction/range-planner-diagnostics.js.map +1 -1
  97. package/dist/core/compaction/range-planner.d.ts +7 -4
  98. package/dist/core/compaction/range-planner.d.ts.map +1 -1
  99. package/dist/core/compaction/range-planner.js +43 -19
  100. package/dist/core/compaction/range-planner.js.map +1 -1
  101. package/dist/core/compaction/refusal-recovery.d.ts +27 -0
  102. package/dist/core/compaction/refusal-recovery.d.ts.map +1 -0
  103. package/dist/core/compaction/refusal-recovery.js +65 -0
  104. package/dist/core/compaction/refusal-recovery.js.map +1 -0
  105. package/dist/core/compaction/region-trimming.d.ts +23 -0
  106. package/dist/core/compaction/region-trimming.d.ts.map +1 -1
  107. package/dist/core/compaction/region-trimming.js +59 -15
  108. package/dist/core/compaction/region-trimming.js.map +1 -1
  109. package/dist/core/compaction/structured-compaction-input.d.ts +19 -1
  110. package/dist/core/compaction/structured-compaction-input.d.ts.map +1 -1
  111. package/dist/core/compaction/structured-compaction-input.js +30 -17
  112. package/dist/core/compaction/structured-compaction-input.js.map +1 -1
  113. package/dist/core/compaction/transcript-serialization.d.ts +9 -3
  114. package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
  115. package/dist/core/compaction/transcript-serialization.js +18 -10
  116. package/dist/core/compaction/transcript-serialization.js.map +1 -1
  117. package/dist/core/messages.d.ts +5 -1
  118. package/dist/core/messages.d.ts.map +1 -1
  119. package/dist/core/messages.js +21 -3
  120. package/dist/core/messages.js.map +1 -1
  121. package/dist/core/session-manager-core.js +1 -1
  122. package/dist/core/session-manager-core.js.map +1 -1
  123. package/dist/core/session-manager-history.d.ts +1 -1
  124. package/dist/core/session-manager-history.d.ts.map +1 -1
  125. package/dist/core/session-manager-history.js +2 -5
  126. package/dist/core/session-manager-history.js.map +1 -1
  127. package/dist/core/settings-defaults.d.ts +2 -0
  128. package/dist/core/settings-defaults.d.ts.map +1 -1
  129. package/dist/core/settings-defaults.js +2 -0
  130. package/dist/core/settings-defaults.js.map +1 -1
  131. package/dist/core/settings-manager-basic-accessors.d.ts +2 -0
  132. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  133. package/dist/core/settings-manager-basic-accessors.js +3 -0
  134. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  135. package/dist/core/settings-schema.d.ts +2 -0
  136. package/dist/core/settings-schema.d.ts.map +1 -1
  137. package/dist/core/settings-schema.js +4 -0
  138. package/dist/core/settings-schema.js.map +1 -1
  139. package/dist/core/storage/session/conformance.d.ts.map +1 -1
  140. package/dist/core/storage/session/conformance.js +12 -0
  141. package/dist/core/storage/session/conformance.js.map +1 -1
  142. package/dist/core/storage/session/jsonl-session-store.d.ts.map +1 -1
  143. package/dist/core/storage/session/jsonl-session-store.js +3 -0
  144. package/dist/core/storage/session/jsonl-session-store.js.map +1 -1
  145. package/dist/core/storage/session/legacy-session-store.d.ts.map +1 -1
  146. package/dist/core/storage/session/legacy-session-store.js +3 -0
  147. package/dist/core/storage/session/legacy-session-store.js.map +1 -1
  148. package/dist/core/storage/session/memory-session-store.d.ts.map +1 -1
  149. package/dist/core/storage/session/memory-session-store.js +3 -0
  150. package/dist/core/storage/session/memory-session-store.js.map +1 -1
  151. package/dist/core/storage/session/sql-session-store.d.ts.map +1 -1
  152. package/dist/core/storage/session/sql-session-store.js +12 -3
  153. package/dist/core/storage/session/sql-session-store.js.map +1 -1
  154. package/dist/core/storage/session/types.d.ts +3 -0
  155. package/dist/core/storage/session/types.d.ts.map +1 -1
  156. package/dist/core/storage/session/types.js +3 -0
  157. package/dist/core/storage/session/types.js.map +1 -1
  158. package/dist/core/tools/history-protocol.d.ts +3 -0
  159. package/dist/core/tools/history-protocol.d.ts.map +1 -1
  160. package/dist/core/tools/history-protocol.js +7 -87
  161. package/dist/core/tools/history-protocol.js.map +1 -1
  162. package/dist/core/tools/history-transcript.d.ts +24 -0
  163. package/dist/core/tools/history-transcript.d.ts.map +1 -0
  164. package/dist/core/tools/history-transcript.js +110 -0
  165. package/dist/core/tools/history-transcript.js.map +1 -0
  166. package/dist/index.d.ts +1 -1
  167. package/dist/index.d.ts.map +1 -1
  168. package/dist/index.js.map +1 -1
  169. package/dist/main-session.d.ts.map +1 -1
  170. package/dist/main-session.js +21 -5
  171. package/dist/main-session.js.map +1 -1
  172. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  173. package/dist/modes/interactive/components/compaction-boundary-message.js +7 -3
  174. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  175. package/dist/modes/interactive/interactive-render-chat.js +2 -2
  176. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  177. package/dist/session-id-target.d.ts +1 -0
  178. package/dist/session-id-target.d.ts.map +1 -1
  179. package/dist/session-id-target.js +3 -0
  180. package/dist/session-id-target.js.map +1 -1
  181. package/docs/compaction/reference.md +3 -2
  182. package/docs/compaction.md +35 -7
  183. package/docs/development.md +1 -1
  184. package/docs/sdk/reference.md +6 -5
  185. package/docs/sessions.md +3 -3
  186. package/docs/settings.md +3 -0
  187. package/docs/storage.md +2 -0
  188. package/docs/workflows/api-reference.md +15 -3
  189. package/docs/workflows/authoring.md +2 -2
  190. package/docs/workflows/operations.md +1 -0
  191. package/docs/workflows/reliable-design.md +1 -1
  192. package/npm-shrinkwrap.json +32 -32
  193. package/package.json +3 -3
  194. package/schemas/settings.schema.json +5 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,42 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.9.74-alpha.1] - 2026-11-09
6
+
7
+ Compaction keeps more of your session verbatim and can recall what it removed.
8
+
9
+ - **Verbatim compaction that holds up.** A planner refusal partway through its answer is retried and then planned in smaller pieces instead of falling back to a lossy summary, deletions stop at the keep target instead of removing most of the session, and stray prose around the planner's ranges no longer discards its whole answer ([#4543](https://github.com/bastani-inc/atomic/issues/4543), [#4576](https://github.com/bastani-inc/atomic/pull/4576), [#4568](https://github.com/bastani-inc/atomic/issues/4568), [#4578](https://github.com/bastani-inc/atomic/pull/4578)).
10
+ - **Removed context stays reachable.** The compacted context tells the agent where removed lines live in `history://`, cut tool output names the exact range to read, and a short `Recalled context` section brings back relevant lines from earlier history; turn it off with `compaction.historyRecall: false` ([#4568](https://github.com/bastani-inc/atomic/issues/4568), [#4578](https://github.com/bastani-inc/atomic/pull/4578)).
11
+ - **Diagnostics for every session store.** Compaction failures in SQLite and other non-JSONL stores now leave a redacted diagnostic in `compaction-diagnostics/` ([#4543](https://github.com/bastani-inc/atomic/issues/4543), [#4576](https://github.com/bastani-inc/atomic/pull/4576)).
12
+ - **Resuming sessions on large stores.** `--session <id>` and `--fork <id>` no longer run out of memory when the session belongs to another directory ([#4566](https://github.com/bastani-inc/atomic/issues/4566), [#4567](https://github.com/bastani-inc/atomic/pull/4567)).
13
+ - **Workflow stages survive detached `bash` waits.** Notifications, steering, follow-ups and compactions no longer push a session past a call whose result it still waits on, so the stage no longer fails with `ToolDetachmentError` ([#4580](https://github.com/bastani-inc/atomic/issues/4580), [#4581](https://github.com/bastani-inc/atomic/pull/4581)).
14
+
15
+ ### Added
16
+
17
+ - `AgentSession.isWaitingOnDetachedResults()` tells whether the transcript still waits on the result of a detached tool call; while it does and a detachment policy is set, nothing starts a turn on the session ([#4580](https://github.com/bastani-inc/atomic/issues/4580))
18
+ - `SessionListQuery.idPrefix` lists only the sessions whose id starts with the given text (case-insensitive); custom session stores should honor it ([#4566](https://github.com/bastani-inc/atomic/issues/4566))
19
+ - The planner's `policyRefusal` outcome now reports `phase` (`"input"` or `"midstream"`, exported as `PolicyRefusalPhase`), and `CompactionPlanOptions` and `CompactionRunRequest` accept `sidecarDirectory` (`SidecarDirectory`), where diagnostics go for a persisted session that has no session file ([#4543](https://github.com/bastani-inc/atomic/issues/4543))
20
+ - After a verbatim compaction, the compacted context now tells the agent that removed `(filtered N lines)` stay in the session's history and names its `history://sessions/<sessionId>` URL, so the agent can `search` it for removed text and `read` it with `:N-M`; a workflow stage session reaches its own history the same way, even when it runs in another directory. The planner is told that removed lines stay retrievable and removes bulky re-readable output before unique requirements, decisions and conclusions. Tool results in the compacted transcript the planner sees are now cut to 2,000 characters (previously 16,000), and the truncation marker names the exact `history://sessions/<sessionId>:N-M` range to `read` for the full output (or, when that range is unknown, says the full output is in this session's history); the kept recent tail still carries full tool output. The note also points the agent at `search history://sessions` (the project's other sessions), `search history://workflows` (workflow runs) and `search history://` (both), tells it to use them before redoing an investigation or when a removed decision, error message, file path or result matters, and says that a multi-record search covers the newest records and pages on with `?offset=`. Compaction now also adds a short `Recalled context` section after the planner picks the lines to keep: matching lines from this session's earlier history (including earlier compactions), the project's other sessions and workflow runs, found with the same `history://` search from your latest request and the compaction `query`, each with a `history://…:N-M` source to `read`. It adds at most 10% of the kept context and never more than 1,500 tokens, never repeats a kept line, searches for at most 3 seconds, and is skipped on any failure, timeout, cancellation or lack of matches, so compaction never waits on it or fails because of it. Set `compaction.historyRecall` to `false` to turn it off ([#4568](https://github.com/bastani-inc/atomic/issues/4568))
21
+
22
+ ### Fixed
23
+
24
+ - Fixed `--session <id>` and `--fork <id>` running out of memory on a large session store when the session belongs to another directory: a full id is now read directly and an 8-character prefix lists only matching sessions, instead of loading every session's search text ([#4566](https://github.com/bastani-inc/atomic/issues/4566))
25
+ - Fixed compaction replacing a large session with a lossy summary when the provider refused the planner partway through its output: a refusal that arrives after the model generated tokens is now retried once and then planned in halves, and in quarters of a refused half, at message boundaries, keeping the result verbatim; the summary runs only if that fails, and an immediate refusal still goes to the summary at once ([#4543](https://github.com/bastani-inc/atomic/issues/4543))
26
+ - Fixed compaction failures such as "no usable deleted ranges" leaving no diagnostic for sessions kept in SQLite or another non-JSONL store: the planner's answer is now written to `compaction-diagnostics/` in the agent directory, and every diagnostic sidecar, JSONL sessions included, redacts credential-shaped text and cuts the stored answer to 65,536 characters ([#4543](https://github.com/bastani-inc/atomic/issues/4543))
27
+ - Fixed verbatim compaction deleting far more than the keep ratio asks for: the planner's deletions are now applied in the priority order it lists them and stop once the keep target plus a small tolerance is reached, instead of all being applied (a 50% target could delete 87% of lines). Removed lines stay retrievable through the session's history ([#4568](https://github.com/bastani-inc/atomic/issues/4568))
28
+ - Fixed verbatim compaction discarding a whole planner answer because of one stray line: prose, headers, blank lines, Markdown fences and surrounding whitespace around the `id:start,end` records are now skipped instead of making the answer malformed, and the records keep the order the planner listed them. An answer is still malformed when it has no valid record or more than half of its non-blank lines are not records. The number of skipped lines is recorded on the planner outcome and in the length-recovery diagnostic ([#4568](https://github.com/bastani-inc/atomic/issues/4568))
29
+ - Fixed a workflow stage failing with `ToolDetachmentError` (`unknown-tool-call`, or `session-busy` on a sibling) when its conversation moved past a long-running `bash` wait that had detached: while a session with a detachment policy waits on a detached call's result, a finished subagent's notification, steering, follow-ups and the continuation after a compaction no longer start a turn (they join the turn that `resumeDetachedTurn()` continues), a compaction keeps the waiting call's turn in the conversation (also when a notification was added after it), a session disposed while it waits no longer fails on a held notification, which the reopened session delivers after the result, and a result for a call whose turn the conversation already moved past is dropped and recorded in the debug log (`stale-detached-call`) instead of failing the host ([#4580](https://github.com/bastani-inc/atomic/issues/4580))
30
+
31
+ ## [0.9.73] - 2026-11-08
32
+
33
+ Intercom connects in every session of a multi-directory process.
34
+
35
+ - **Intercom per agent directory.** A process that starts a second session with a different `ATOMIC_CODING_AGENT_DIR` now connects that session to its own directory's broker, so messaging works in both sessions instead of never connecting ([#4561](https://github.com/bastani-inc/atomic/issues/4561), [#4562](https://github.com/bastani-inc/atomic/pull/4562)).
36
+
37
+ ### Fixed
38
+
39
+ - Fixed Intercom never connecting when one process starts a second session with a different agent directory (`ATOMIC_CODING_AGENT_DIR`): the session now starts and connects to the broker for its own directory instead of finding the first directory's broker and then querying a directory with none ([#4561](https://github.com/bastani-inc/atomic/issues/4561))
40
+
5
41
  ## [0.9.73-alpha.1] - 2026-11-08
6
42
 
7
43
  Intercom connects in every session of a multi-directory process.
@@ -4,6 +4,16 @@ All notable changes to the `pi-intercom` extension will be documented in this fi
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.9.73] - 2026-11-08
8
+
9
+ Intercom connects in every session of a multi-directory process.
10
+
11
+ - **Intercom per agent directory.** A process that starts a second session with a different `ATOMIC_CODING_AGENT_DIR` now connects that session to its own directory's broker, so messaging works in both sessions instead of never connecting ([#4561](https://github.com/bastani-inc/atomic/issues/4561), [#4562](https://github.com/bastani-inc/atomic/pull/4562)).
12
+
13
+ ### Fixed
14
+
15
+ - Fixed Intercom never connecting when one process starts a second session with a different agent directory (`ATOMIC_CODING_AGENT_DIR`): the session now starts and connects to the broker for its own directory instead of finding the first directory's broker and then querying a directory with none ([#4561](https://github.com/bastani-inc/atomic/issues/4561))
16
+
7
17
  ## [0.9.73-alpha.1] - 2026-11-08
8
18
 
9
19
  Intercom connects in every session of a multi-directory process.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.9.73-alpha.1",
3
+ "version": "0.9.74-alpha.1",
4
4
  "private": true,
5
5
  "description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.9.73-alpha.1",
3
+ "version": "0.9.74-alpha.1",
4
4
  "private": true,
5
5
  "description": "Atomic's pi-compatible MCP integration for server connections, OAuth, tools, resources, and terminal management.",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.9.73-alpha.1",
3
+ "version": "0.9.74-alpha.1",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with parallel execution. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.9.73-alpha.1",
3
+ "version": "0.9.74-alpha.1",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.9.74-alpha.1] - 2026-11-09
10
+
11
+ Schema-backed workflow stages finish reliably.
12
+
13
+ - **Structured output without prompt boilerplate.** Atomic now tells every schema-backed stage to finish with `structured_output` and infers the result from the final answer when the model skips the call, so stages no longer fail their first attempt and prompts need not mention the tool ([#4565](https://github.com/bastani-inc/atomic/issues/4565), [#4577](https://github.com/bastani-inc/atomic/pull/4577)).
14
+ - **Stages survive detached `bash` waits.** A stage whose conversation moves past a detached call, through a compaction, a resumed pause or a late result, now keeps its finished result instead of failing the run ([#4580](https://github.com/bastani-inc/atomic/issues/4580), [#4581](https://github.com/bastani-inc/atomic/pull/4581)).
15
+
16
+ ### Added
17
+
18
+ - Added `WorkflowStructuredOutputInferenceError`, with `isWorkflowStructuredOutputInferenceError`, `findWorkflowStructuredOutputInferenceError` and `deserializeWorkflowStructuredOutputInferenceError`: the typed `cause` a schema-backed stage's failure carries when Atomic's own `structured_output` inference produced no result ([#4565](https://github.com/bastani-inc/atomic/issues/4565))
19
+
20
+ ### Fixed
21
+
22
+ - Fixed schema-backed workflow stages that failed their first attempt with the 1/3 structured-output corrective error because the stage prompt never said to finish with `structured_output`, and the model ended its turn without calling it. Atomic now closes every schema-backed prompt with that instruction, and when a turn still ends without a successful call it runs the same inference itself from the stage's final answer, so prompts no longer need to mention the tool; corrective follow-ups and `fallbackModels` apply only when that inference fails too ([#4565](https://github.com/bastani-inc/atomic/issues/4565))
23
+ - Fixed a workflow stage, and the run with it, failing when its conversation moved past a detached `bash` wait: a stage no longer prompts a session that still waits on a detached call's result (a retry after a compaction re-sent the continuation prompt and let the model carry on past the call), a compaction during a prompt no longer counts as an empty completion, a result handed back while the session is still running now waits for the run to settle instead of failing the stage, a message the operator resumes a paused stage with joins the turn the result continues instead of being dropped, and a stale call's late result is dropped so the stage keeps its finished result, including its `structured_output` ([#4580](https://github.com/bastani-inc/atomic/issues/4580))
24
+
9
25
  ## [0.9.72] - 2026-11-08
10
26
 
11
27
  Waiting stages free their resources, and pooled work runs across machines.
@@ -449,11 +449,11 @@ const decision = await ctx.stage("review-gate", { schema: Decision }).prompt(
449
449
  // decision.approved is typed from the schema.
450
450
  ```
451
451
 
452
- Atomic registers the canonical `structured_output` tool only for schema-enabled items and automatically adds it to explicit `tools` allowlists. The schema is used directly as the tool argument contract. A schema-backed `StageContext` supports one `prompt()` call because the final-answer tool is a single result contract; create another `ctx.stage(..., { schema })` for another structured prompt. If a turn completes without calling `structured_output`, or the tool call fails schema validation, Atomic sends up to three corrective follow-up prompts that include the exact contract/validation error before failing the item. `ctx.task`/`ctx.chain`/`ctx.parallel` results expose the captured value as `result.structured` and keep `result.text` as formatted JSON for handoffs.
452
+ Atomic registers the canonical `structured_output` tool only for schema-enabled items and automatically adds it to explicit `tools` allowlists. The schema is used directly as the tool argument contract. A schema-backed `StageContext` supports one `prompt()` call because the final-answer tool is a single result contract; create another `ctx.stage(..., { schema })` for another structured prompt. Atomic closes every schema-backed prompt with an instruction to finish by calling `structured_output` exactly once, so the prompt only has to state the task. If a turn still completes without a successful `structured_output` call, Atomic runs the same inference itself from the stage's final assistant text and recent exchange, and the item completes with that result. When that inference fails, or the tool call fails schema validation, Atomic sends up to three corrective follow-up prompts that include the exact contract/validation error before failing the item; the failed inference stays as the `cause` of that failure. `ctx.task`/`ctx.chain`/`ctx.parallel` results expose the captured value as `result.structured` and keep `result.text` as formatted JSON for handoffs.
453
453
 
454
454
  Each `structured_output` decision has a wall-clock limit that covers its repair attempts, retries, and model fallbacks together. It defaults to the session's `httpIdleTimeoutMs` setting (10 minutes unless changed); set `schemaTimeoutMs` (a positive integer in milliseconds) beside `schema` to change it for one item. An overrun stops the in-flight generation and fails the call with `Structured output decision exceeded its <n>ms deadline; no decision was accepted.` plus how long each attempt took. That is an execution failure, not a structured-output contract failure, and the error text reaches the model unchanged.
455
455
 
456
- When an item configures both `schema` and `output`, its successful `structured_output` turn has two separate channels: all ordinary assistant text blocks from that exact message, in order, form the human-readable artifact written to `output`, while the successful tool arguments remain the typed machine-readable workflow result. Atomic never serializes those arguments into the artifact. The runner snapshots the result together with the exact successful tool-call id, so corrective attempts, another call with the same tool name, and later admitted turns cannot replace either side of the pairing. When the successful message has no ordinary text — including after a model-fallback session recreation that leaves the live session without that message — Atomic falls back to the most recent earlier assistant text that made no `structured_output` call; only when no such text exists is the artifact written empty, with the standard empty-artifact warning in the receipt. Items with `schema` but no `output` keep their existing result-text behavior.
456
+ When an item configures both `schema` and `output`, its successful `structured_output` turn has two separate channels: all ordinary assistant text blocks from that exact message, in order, form the human-readable artifact written to `output`, while the successful tool arguments remain the typed machine-readable workflow result. Atomic never serializes those arguments into the artifact. The runner snapshots the result together with the exact successful tool-call id, so corrective attempts, another call with the same tool name, and later admitted turns cannot replace either side of the pairing. When the successful message has no ordinary text — including after a model-fallback session recreation that leaves the live session without that message, or when Atomic ran the inference because the model never called the tool — Atomic falls back to the most recent earlier assistant text that made no `structured_output` call; only when no such text exists is the artifact written empty, with the standard empty-artifact warning in the receipt. Items with `schema` but no `output` keep their existing result-text behavior.
457
457
 
458
458
  `subagent` is available as a default workflow-stage tool on the same terms as main chat: a stage is a top-level session, so it can delegate once, and the children it launches cannot delegate further. Delegation is one level deep and nothing configures it. `tools` allowlists apply to bundled extension tools as well as built-ins; if a stage sets `tools`, list every non-mandatory tool it should see. Ordinary `intercom` remains registered and active in every workflow model stage even under `noTools: "all"`, restrictive allowlists, or exclusions. Restrictions on `subagent`, `web_search`, `fetch_content`, and every other tool are unchanged. Bundled `@bastani/subagents` agent definitions are available to the `subagent` tool in workflow stages, including workflows launched from a subagent child process.
459
459
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  adversarial_verification_default
3
- } from "./chunk-tpsw128z.js";
4
- import"./chunk-2377r57g.js";
3
+ } from "./chunk-d9pz64yp.js";
4
+ import"./chunk-8kdrnrpa.js";
5
5
  import"./chunk-n1910xc4.js";
6
6
  import"./chunk-rqbmeg5x.js";
7
7
  import"./chunk-8dpt3b1c.js";
@@ -5,7 +5,7 @@ import {
5
5
  // dist/builtin/workflows/builtin/verification-prompts.ts
6
6
  var MAX_INLINE_CANDIDATE_BYTES = 32 * 1024;
7
7
  var DEFAULT_WARM_CONCURRENCY = 4;
8
- var DEFAULT_OUTPUT_FORMAT = "Call structured_output with criterion_id, score (1–20), evidence, and findings containing finding and severity.";
8
+ var DEFAULT_OUTPUT_FORMAT = "Report criterion_id, score (1–20), evidence, and findings containing finding and severity.";
9
9
  function inlineCandidates(head) {
10
10
  return head.candidates.every((candidate) => Buffer.byteLength(candidate.body, "utf8") <= MAX_INLINE_CANDIDATE_BYTES);
11
11
  }
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  score_progress,
7
7
  classify_trend
8
- } from "./chunk-z0d03ktm.js";
8
+ } from "./chunk-gp0s6m45.js";
9
9
  import {
10
10
  stableArtifactRoot
11
11
  } from "./chunk-rc5ec5xx.js";
@@ -39,7 +39,7 @@ import {
39
39
  reviewerFailureText,
40
40
  summarizeReviewConvergence,
41
41
  reverify_consolidated_batch
42
- } from "./chunk-9pjdp2td.js";
42
+ } from "./chunk-d5cxskkp.js";
43
43
  import {
44
44
  fold_usage
45
45
  } from "./chunk-tgt0s5e5.js";
@@ -5,11 +5,11 @@ import {
5
5
  DEFAULT_RISE_DELTA,
6
6
  DEFAULT_FALL_DELTA,
7
7
  classify_trend
8
- } from "./chunk-z0d03ktm.js";
8
+ } from "./chunk-gp0s6m45.js";
9
9
  import {
10
10
  scoring_prompt_reads,
11
11
  build_scoring_prompt
12
- } from "./chunk-2377r57g.js";
12
+ } from "./chunk-8kdrnrpa.js";
13
13
 
14
14
  // dist/builtin/workflows/src/shared/workflow-artifacts.ts
15
15
  import { randomUUID as randomUUID2 } from "node:crypto";
@@ -3775,7 +3775,7 @@ Objective:
3775
3775
  ${context.objective}`,
3776
3776
  groundTruthNote: `The objective is the contract. Verify the finding against observed code, not reviewer narration.`,
3777
3777
  candidates: [candidate],
3778
- outputFormat: "Call structured_output with score (an integer from 1 to 20) and evidence (an array of observed, concise reasons)."
3778
+ outputFormat: "Report score (an integer from 1 to 20) and evidence (an array of observed, concise reasons)."
3779
3779
  };
3780
3780
  const prompt = build_scoring_prompt(head, {
3781
3781
  id: "finding_reverification",
@@ -12,7 +12,7 @@ import {
12
12
  scoring_prompt_reads,
13
13
  build_scoring_prompt,
14
14
  warm_first_fan_out
15
- } from "./chunk-2377r57g.js";
15
+ } from "./chunk-8kdrnrpa.js";
16
16
  import {
17
17
  fold_usage
18
18
  } from "./chunk-tgt0s5e5.js";
@@ -68,7 +68,7 @@ Preserve every confirmed veto or blocking finding in remaining_work verbatim. Ex
68
68
  </decision_rules>
69
69
 
70
70
  <output_format>
71
- Call structured_output with repair_guidance (a concise actionable repair plan) and remaining_work (the unresolved findings as strings). Never emit an approval or rejection decision. ${READABLE_REPORT}
71
+ Report repair_guidance (a concise actionable repair plan) and remaining_work (the unresolved findings as strings). Never emit an approval or rejection decision. ${READABLE_REPORT}
72
72
  ${GROUNDED_REPORTING}
73
73
  </output_format>
74
74
 
@@ -197,7 +197,7 @@ function stageName(cell, reaskWave) {
197
197
  return reaskWave === 0 ? cell.name : `${cell.name}-reask-${reaskWave}`;
198
198
  }
199
199
  function verifierOutputFormat(criterionId) {
200
- return `Call structured_output with criterion_id (set to ${criterionId}), score (1–20), evidence (string array), and findings containing finding and severity (veto, blocking, or note).`;
200
+ return `Report criterion_id (set to ${criterionId}), score (1–20), evidence (string array), and findings containing finding and severity (veto, blocking, or note).`;
201
201
  }
202
202
  function scoreStep(cell, reaskWave, head, criteriaPath) {
203
203
  const promptHead = {
@@ -122,7 +122,7 @@ function build_progress_prompt(input) {
122
122
  ...input.checkpoints.map((checkpoint) => `- ${checkpoint}`),
123
123
  "</checkpoints>",
124
124
  "<output_format>",
125
- `Return structured_output with scores: [{ checkpoint, score }], using integer scores from ${VERIFICATION_SCALE.min} through ${VERIFICATION_SCALE.max}.`,
125
+ `Report scores: [{ checkpoint, score }], using integer scores from ${VERIFICATION_SCALE.min} through ${VERIFICATION_SCALE.max}.`,
126
126
  "</output_format>"
127
127
  ].join(`
128
128
  `);
@@ -37,7 +37,7 @@ import {
37
37
  parseFailureDiagnostics,
38
38
  summarizeReviewConvergence,
39
39
  reverify_consolidated_batch
40
- } from "./chunk-9pjdp2td.js";
40
+ } from "./chunk-d5cxskkp.js";
41
41
  import {
42
42
  VERIFICATION_SCALE
43
43
  } from "./chunk-n1910xc4.js";
@@ -11,7 +11,7 @@ import {
11
11
  scoring_prompt_reads,
12
12
  build_scoring_prompt,
13
13
  warm_first_fan_out
14
- } from "./chunk-2377r57g.js";
14
+ } from "./chunk-8kdrnrpa.js";
15
15
  import {
16
16
  fold_usage
17
17
  } from "./chunk-tgt0s5e5.js";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  scoring_prompt_reads,
7
7
  build_scoring_prompt
8
- } from "./chunk-2377r57g.js";
8
+ } from "./chunk-8kdrnrpa.js";
9
9
  import {
10
10
  stableArtifactRoot
11
11
  } from "./chunk-rc5ec5xx.js";
@@ -65,7 +65,7 @@ Stop after every candidate is shortlisted once or recorded as discarded.
65
65
  </stop_rules>
66
66
 
67
67
  <output_format>
68
- Call structured_output with shortlist (candidate artifact paths in ranked order) and discarded entries containing path and a concise, criteria-based reason.
68
+ Report shortlist (candidate artifact paths in ranked order) and discarded entries containing path and a concise, criteria-based reason.
69
69
  </output_format>
70
70
 
71
71
  <objective>
@@ -77,7 +77,7 @@ function renderJudgePrompt(task, filterPath, shortlistSize, candidates = []) {
77
77
  task: `Rank at most ${shortlistSize} distinct candidate paths for: ${task}.`,
78
78
  groundTruthNote: `Read the filter report at ${filterPath} and every candidate path it references before judging.`,
79
79
  candidates,
80
- outputFormat: "Call structured_output with shortlist (candidate paths in ranked order) and rationale (a concise, criteria-based explanation)."
80
+ outputFormat: "Report shortlist (candidate paths in ranked order) and rationale (a concise, criteria-based explanation)."
81
81
  };
82
82
  const prompt = build_scoring_prompt(head, {
83
83
  id: "filtered_shortlist",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generate_and_filter_default
3
- } from "./chunk-q7dry6km.js";
4
- import"./chunk-2377r57g.js";
3
+ } from "./chunk-va2h64a6.js";
4
+ import"./chunk-8kdrnrpa.js";
5
5
  import"./chunk-n1910xc4.js";
6
6
  import"./chunk-rqbmeg5x.js";
7
7
  import"./chunk-8dpt3b1c.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  goal_default
3
- } from "./chunk-4kygv34g.js";
4
- import"./chunk-9pjdp2td.js";
5
- import"./chunk-2377r57g.js";
6
- import"./chunk-z0d03ktm.js";
3
+ } from "./chunk-m8eg152f.js";
4
+ import"./chunk-d5cxskkp.js";
5
+ import"./chunk-8kdrnrpa.js";
6
+ import"./chunk-gp0s6m45.js";
7
7
  import"./chunk-n1910xc4.js";
8
8
  import"./chunk-rqbmeg5x.js";
9
9
  import"./chunk-8dpt3b1c.js";
@@ -1,10 +1,10 @@
1
1
  import"./chunk-rqbmeg5x.js";
2
2
  import"./chunk-8dpt3b1c.js";
3
3
  import"./chunk-n1910xc4.js";
4
- import"./chunk-2377r57g.js";
4
+ import"./chunk-8kdrnrpa.js";
5
5
  import {
6
6
  adversarial_verification_default
7
- } from "./chunk-tpsw128z.js";
7
+ } from "./chunk-d9pz64yp.js";
8
8
  import {
9
9
  classify_and_act_default
10
10
  } from "./chunk-rysytmz1.js";
@@ -13,24 +13,24 @@ import {
13
13
  } from "./chunk-gvse3naa.js";
14
14
  import {
15
15
  generate_and_filter_default
16
- } from "./chunk-q7dry6km.js";
16
+ } from "./chunk-va2h64a6.js";
17
17
  import {
18
18
  goal_default
19
- } from "./chunk-4kygv34g.js";
20
- import"./chunk-9pjdp2td.js";
21
- import"./chunk-z0d03ktm.js";
19
+ } from "./chunk-m8eg152f.js";
20
+ import"./chunk-d5cxskkp.js";
21
+ import"./chunk-gp0s6m45.js";
22
22
  import {
23
23
  open_claude_design_default
24
24
  } from "./chunk-774myqzs.js";
25
25
  import {
26
26
  loop_until_done_default
27
- } from "./chunk-t8y25z1j.js";
27
+ } from "./chunk-8ycbc76t.js";
28
28
  import {
29
29
  ralph_default
30
- } from "./chunk-vbrmytm5.js";
30
+ } from "./chunk-a4fdm2cw.js";
31
31
  import {
32
32
  tournament_default
33
- } from "./chunk-mswg7kc7.js";
33
+ } from "./chunk-r39ypw6b.js";
34
34
  export {
35
35
  adversarial_verification_default as adversarialVerification,
36
36
  classify_and_act_default as classifyAndAct,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  loop_until_done_default
3
- } from "./chunk-t8y25z1j.js";
4
- import"./chunk-z0d03ktm.js";
3
+ } from "./chunk-8ycbc76t.js";
4
+ import"./chunk-gp0s6m45.js";
5
5
  import"./chunk-n1910xc4.js";
6
6
  import"./chunk-rqbmeg5x.js";
7
7
  import"./chunk-8dpt3b1c.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ralph_default
3
- } from "./chunk-vbrmytm5.js";
4
- import"./chunk-9pjdp2td.js";
5
- import"./chunk-2377r57g.js";
6
- import"./chunk-z0d03ktm.js";
3
+ } from "./chunk-a4fdm2cw.js";
4
+ import"./chunk-d5cxskkp.js";
5
+ import"./chunk-8kdrnrpa.js";
6
+ import"./chunk-gp0s6m45.js";
7
7
  import"./chunk-n1910xc4.js";
8
8
  import"./chunk-rqbmeg5x.js";
9
9
  import"./chunk-8dpt3b1c.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  tournament_default
3
- } from "./chunk-mswg7kc7.js";
4
- import"./chunk-2377r57g.js";
3
+ } from "./chunk-r39ypw6b.js";
4
+ import"./chunk-8kdrnrpa.js";
5
5
  import"./chunk-n1910xc4.js";
6
6
  import"./chunk-rqbmeg5x.js";
7
7
  import"./chunk-8dpt3b1c.js";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/workflows",
3
- "version": "0.9.73-alpha.1",
3
+ "version": "0.9.74-alpha.1",
4
4
  "private": true,
5
5
  "description": "Atomic extension for multi-stage workflow authoring and execution.",
6
6
  "contributors": [
@@ -65,6 +65,8 @@ export type { SerializedErrorCause, SerializedStageWaitError, StageRehydrationEr
65
65
  export { deserializeStageWaitError, findStageWaitError, isStageRehydrationError, isStageReleasedError, isStageReleaseError, isStageWaitConfigError, isStageWaitError, isStageWaitRecordError, isStageWakeError, StageRehydrationError, StageReleasedError, StageReleaseError, StageWaitConfigError, StageWaitError, StageWaitRecordError, StageWakeError, } from "./shared/stage-wait-errors.js";
66
66
  export type { BuiltinStageWakeKind, StageWake, StageWakeDelivery, StageWakeHandler, StageWakeHandlerContext, StageWakeKinds, } from "./shared/stage-wake.js";
67
67
  export { registerStageWakeKind } from "./shared/stage-wake.js";
68
+ export type { SerializedWorkflowStructuredOutputInferenceError, WorkflowStructuredOutputInferenceErrorCode, WorkflowStructuredOutputInferenceErrorFields, } from "./shared/structured-output-errors.js";
69
+ export { deserializeWorkflowStructuredOutputInferenceError, findWorkflowStructuredOutputInferenceError, isWorkflowStructuredOutputInferenceError, WorkflowStructuredOutputInferenceError, } from "./shared/structured-output-errors.js";
68
70
  /**
69
71
  * Send a message to a stage of a live run in this process. Throws `StageWakeError` (`unknown-wake-kind`) when no
70
72
  * module registered the message's kind; otherwise returns what became of it.