@bastani/atomic 0.8.28 → 0.8.29-alpha.2

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 (134) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/builtin/cursor/CHANGELOG.md +27 -0
  3. package/dist/builtin/cursor/LICENSE +26 -0
  4. package/dist/builtin/cursor/README.md +22 -0
  5. package/dist/builtin/cursor/index.ts +9 -0
  6. package/dist/builtin/cursor/package.json +46 -0
  7. package/dist/builtin/cursor/src/auth.ts +352 -0
  8. package/dist/builtin/cursor/src/catalog-cache.ts +155 -0
  9. package/dist/builtin/cursor/src/config.ts +123 -0
  10. package/dist/builtin/cursor/src/conversation-state.ts +135 -0
  11. package/dist/builtin/cursor/src/cursor-models-raw.json +583 -0
  12. package/dist/builtin/cursor/src/model-mapper.ts +270 -0
  13. package/dist/builtin/cursor/src/models.ts +54 -0
  14. package/dist/builtin/cursor/src/native-loader.ts +71 -0
  15. package/dist/builtin/cursor/src/proto/README.md +34 -0
  16. package/dist/builtin/cursor/src/proto/agent_pb.ts +15294 -0
  17. package/dist/builtin/cursor/src/proto/protobuf-codec.ts +717 -0
  18. package/dist/builtin/cursor/src/provider.ts +301 -0
  19. package/dist/builtin/cursor/src/stream.ts +564 -0
  20. package/dist/builtin/cursor/src/transport.ts +791 -0
  21. package/dist/builtin/intercom/CHANGELOG.md +4 -0
  22. package/dist/builtin/intercom/package.json +2 -2
  23. package/dist/builtin/intercom/skills/intercom/SKILL.md +5 -5
  24. package/dist/builtin/mcp/CHANGELOG.md +4 -0
  25. package/dist/builtin/mcp/package.json +3 -3
  26. package/dist/builtin/subagents/CHANGELOG.md +12 -0
  27. package/dist/builtin/subagents/README.md +7 -3
  28. package/dist/builtin/subagents/agents/codebase-online-researcher.md +9 -24
  29. package/dist/builtin/subagents/agents/debugger.md +3 -5
  30. package/dist/builtin/subagents/package.json +4 -4
  31. package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +2 -1
  32. package/dist/builtin/subagents/src/runs/foreground/execution.ts +2 -1
  33. package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +1 -0
  34. package/dist/builtin/subagents/src/runs/shared/pi-args.ts +19 -2
  35. package/dist/builtin/subagents/src/runs/shared/structured-output.ts +271 -10
  36. package/dist/builtin/subagents/src/runs/shared/subagent-prompt-runtime.ts +12 -39
  37. package/dist/builtin/subagents/src/shared/types.ts +1 -0
  38. package/dist/builtin/subagents/src/shared/utils.ts +50 -10
  39. package/dist/builtin/subagents/src/slash/saved-chain-mapping.ts +77 -0
  40. package/dist/builtin/subagents/src/slash/slash-commands.ts +1 -55
  41. package/dist/builtin/web-access/CHANGELOG.md +5 -1
  42. package/dist/builtin/web-access/README.md +1 -1
  43. package/dist/builtin/web-access/github-extract.ts +1 -1
  44. package/dist/builtin/web-access/package.json +3 -3
  45. package/dist/builtin/workflows/CHANGELOG.md +18 -0
  46. package/dist/builtin/workflows/README.md +19 -1
  47. package/dist/builtin/workflows/package.json +2 -2
  48. package/dist/builtin/workflows/skills/research-codebase/SKILL.md +17 -3
  49. package/dist/builtin/workflows/src/extension/wiring.ts +17 -1
  50. package/dist/builtin/workflows/src/extension/workflow-schema.ts +34 -0
  51. package/dist/builtin/workflows/src/runs/foreground/executor.ts +13 -2
  52. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +86 -14
  53. package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +11 -3
  54. package/dist/builtin/workflows/src/shared/types.ts +8 -4
  55. package/dist/builtin/workflows/src/tui/overlay-adapter.ts +64 -2
  56. package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +8 -8
  57. package/dist/builtin/workflows/src/tui/workflow-status.ts +2 -0
  58. package/dist/core/builtin-packages.d.ts.map +1 -1
  59. package/dist/core/builtin-packages.js +6 -0
  60. package/dist/core/builtin-packages.js.map +1 -1
  61. package/dist/core/extensions/index.d.ts +1 -1
  62. package/dist/core/extensions/index.d.ts.map +1 -1
  63. package/dist/core/extensions/index.js.map +1 -1
  64. package/dist/core/extensions/types.d.ts +20 -0
  65. package/dist/core/extensions/types.d.ts.map +1 -1
  66. package/dist/core/extensions/types.js.map +1 -1
  67. package/dist/core/model-resolver.d.ts +1 -0
  68. package/dist/core/model-resolver.d.ts.map +1 -1
  69. package/dist/core/model-resolver.js +17 -8
  70. package/dist/core/model-resolver.js.map +1 -1
  71. package/dist/core/package-manager.d.ts +11 -9
  72. package/dist/core/package-manager.d.ts.map +1 -1
  73. package/dist/core/package-manager.js +55 -10
  74. package/dist/core/package-manager.js.map +1 -1
  75. package/dist/core/project-trust.d.ts +1 -0
  76. package/dist/core/project-trust.d.ts.map +1 -1
  77. package/dist/core/project-trust.js +3 -3
  78. package/dist/core/project-trust.js.map +1 -1
  79. package/dist/core/resource-loader.d.ts +9 -0
  80. package/dist/core/resource-loader.d.ts.map +1 -1
  81. package/dist/core/resource-loader.js +72 -9
  82. package/dist/core/resource-loader.js.map +1 -1
  83. package/dist/core/sdk.d.ts +3 -3
  84. package/dist/core/sdk.d.ts.map +1 -1
  85. package/dist/core/sdk.js +5 -5
  86. package/dist/core/sdk.js.map +1 -1
  87. package/dist/core/tools/index.d.ts +1 -0
  88. package/dist/core/tools/index.d.ts.map +1 -1
  89. package/dist/core/tools/index.js +1 -0
  90. package/dist/core/tools/index.js.map +1 -1
  91. package/dist/core/tools/structured-output.d.ts +39 -0
  92. package/dist/core/tools/structured-output.d.ts.map +1 -0
  93. package/dist/core/tools/structured-output.js +141 -0
  94. package/dist/core/tools/structured-output.js.map +1 -0
  95. package/dist/index.d.ts +1 -1
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +1 -1
  98. package/dist/index.js.map +1 -1
  99. package/dist/main.d.ts.map +1 -1
  100. package/dist/main.js +36 -14
  101. package/dist/main.js.map +1 -1
  102. package/dist/modes/interactive/components/login-dialog.d.ts +3 -0
  103. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  104. package/dist/modes/interactive/components/login-dialog.js +16 -0
  105. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  106. package/dist/modes/interactive/interactive-mode.d.ts +11 -0
  107. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  108. package/dist/modes/interactive/interactive-mode.js +158 -11
  109. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  110. package/dist/modes/print-mode.d.ts.map +1 -1
  111. package/dist/modes/print-mode.js +39 -0
  112. package/dist/modes/print-mode.js.map +1 -1
  113. package/docs/custom-provider.md +1 -0
  114. package/docs/extensions.md +2 -2
  115. package/docs/models.md +2 -0
  116. package/docs/packages.md +3 -1
  117. package/docs/providers.md +15 -0
  118. package/docs/sdk.md +61 -0
  119. package/docs/security.md +1 -1
  120. package/docs/subagents.md +21 -0
  121. package/docs/usage.md +2 -0
  122. package/docs/workflows.md +10 -7
  123. package/examples/extensions/README.md +1 -1
  124. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  125. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  126. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  127. package/examples/extensions/gondolin/package-lock.json +2 -2
  128. package/examples/extensions/gondolin/package.json +1 -1
  129. package/examples/extensions/sandbox/package-lock.json +2 -2
  130. package/examples/extensions/sandbox/package.json +1 -1
  131. package/examples/extensions/structured-output.ts +22 -53
  132. package/examples/extensions/with-deps/package-lock.json +2 -2
  133. package/examples/extensions/with-deps/package.json +1 -1
  134. package/package.json +12 -9
@@ -4,6 +4,10 @@ All notable changes to the `pi-intercom` extension will be documented in this fi
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ### Changed
8
+
9
+ - Published a synchronized Atomic 0.8.29-alpha.1 prerelease with the upstream pi TUI dependency aligned to `^0.79.3`; no functional changes were made in the intercom extension.
10
+
7
11
  ## [0.8.28] - 2026-06-11
8
12
 
9
13
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.8.28",
3
+ "version": "0.8.29-alpha.2",
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": [
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@bastani/atomic": "*",
42
- "@earendil-works/pi-tui": "^0.78.1"
42
+ "@earendil-works/pi-tui": "^0.79.3"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "@bastani/atomic": {
@@ -2,15 +2,15 @@
2
2
  name: intercom
3
3
  description: |
4
4
  Streamline session-to-session coordination with the intercom extension. Send
5
- messages, delegate tasks, and coordinate work across multiple pi sessions on
5
+ messages, delegate tasks, and coordinate work across multiple atomic sessions on
6
6
  the same machine. Use for planner-worker workflows, cross-session context
7
7
  sharing, and real-time collaboration between sessions.
8
8
  ---
9
9
 
10
10
  # Intercom Skill
11
11
 
12
- Use this skill when you need to coordinate work across multiple pi sessions
13
- running on the same machine. Pi-intercom enables direct 1:1 messaging between
12
+ Use this skill when you need to coordinate work across multiple atomic sessions
13
+ running on the same machine. Intercom enables direct 1:1 messaging between
14
14
  sessions for delegation, context sharing, and collaborative workflows.
15
15
 
16
16
  When you are supervising with the `subagent` skill, delegated child agents can
@@ -204,9 +204,9 @@ message, treat it as a `contact_supervisor` escalation.
204
204
  | `list` | Returns all sessions with live status | You need to discover targets or choose an idle peer |
205
205
  | `status` | Returns your connection state | Troubleshooting |
206
206
 
207
- ## Optional: Visible Peer Sessions via cmux or tmux
207
+ ## Optional: Visible Peer Sessions via cmux, tmux, or psmux (Windows rewrite of tmux that has fully parity with tmux)
208
208
 
209
- If no suitable intercom-connected peer session already exists and the task benefits from a long-lived visible conversation, you may spawn a new `pi` session.
209
+ If no suitable intercom-connected peer session already exists and the task benefits from a long-lived visible conversation, you may spawn a new `atomic` session.
210
210
 
211
211
  Prefer `cmux new-split right` over new surfaces or workspaces so both sessions are visible side by side.
212
212
 
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Changed
11
+
12
+ - Published a synchronized Atomic 0.8.29-alpha.1 prerelease with upstream pi AI/TUI dependencies aligned to `^0.79.3`; no functional changes were made in the MCP extension.
13
+
10
14
  ## [0.8.28] - 2026-06-11
11
15
 
12
16
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.8.28",
3
+ "version": "0.8.29-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension that adapts MCP (Model Context Protocol) servers into the coding agent. Fork of: https://github.com/nicobailon/pi-mcp-adapter",
6
6
  "contributors": [
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@bastani/atomic": "*",
35
- "@earendil-works/pi-ai": "^0.78.1",
36
- "@earendil-works/pi-tui": "^0.78.1",
35
+ "@earendil-works/pi-ai": "^0.79.3",
36
+ "@earendil-works/pi-tui": "^0.79.3",
37
37
  "zod": "^3.25.0 || ^4.0.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ### Changed
6
+
7
+ - Aligned the subagents extension with upstream pi `^0.79.3` runtime packages (`@earendil-works/pi-agent-core`, `@earendil-works/pi-ai`, and `@earendil-works/pi-tui`) so child sessions inherit the latest shared agent, provider, and TUI compatibility fixes.
8
+ - Changed `outputSchema` child runs to use Atomic's shared `structured_output` factory with flat schema parameters, preserving parent-side `structuredOutput` capture while removing the old child-facing `{ value: ... }` envelope, auto-allowing the required tool for explicit child tool allowlists, and documenting that the prompt-runtime extension is loaded before user/tool extensions so the allowlist sees the runtime-registered tool ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
9
+ - Enforced parent-side fail-fast validation that subagent child `outputSchema` roots are top-level object tool-argument schemas; array or primitive handoff values must now be wrapped in object fields such as `{ items: [...] }` or `{ value: ... }` ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
10
+ - Kept dynamic fanout `collect.outputSchema` as a general JSON Schema validator so saved chains and direct runs can validate aggregate arrays with array-root schemas while child `outputSchema` tool contracts remain object-rooted ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
11
+
12
+ ### Fixed
13
+
14
+ - Fixed subagent `outputSchema` readback to accept cross-process captures only when flat `output.json` params validate against the schema and `output.meta.json` sidecar metadata matches the final successful terminating `structured_output` transcript action, rejecting missing metadata, stale captures with later assistant/tool-result messages, sibling tool calls, duplicate structured-output calls, mismatched call IDs/names, and error tool results while ignoring benign `custom` host annotations around the final tool result ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
15
+ - Fixed explicit empty child `tools: []` allowlists with `outputSchema` to pass only `--tools structured_output`, keeping the restricted child from regaining default tools while still enabling the required final-answer channel ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
16
+
5
17
  ## [0.8.28] - 2026-06-11
6
18
 
7
19
  ### Changed
@@ -468,7 +468,7 @@ Important fields:
468
468
 
469
469
  ### Tool and extension selection
470
470
 
471
- If `tools` is omitted, `pi-subagents` does not pass `--tools`, so the child gets Pi’s normal builtin tools. If `tools` is present, regular tool names become an explicit allowlist. `mcp:` entries are split out and forwarded as direct MCP selections. Path-like `tools` entries, such as extension paths or `.ts`/`.js` files, are treated as tool-extension paths rather than builtin tool names.
471
+ If `tools` is omitted, `pi-subagents` does not pass `--tools`, so the child gets Pi’s normal builtin tools. If `tools` is present, regular tool names become an explicit allowlist. `mcp:` entries are split out and forwarded as direct MCP selections. Path-like `tools` entries, such as extension paths or `.ts`/`.js` files, are treated as tool-extension paths rather than builtin tool names. When an explicit empty `tools: []` allowlist is combined with `outputSchema`, Atomic passes only `--tools structured_output` so the required final-answer tool is available without restoring default tools; path-only extension entries remain extensions and do not trigger a builtin allowlist by themselves. The child prompt-runtime extension is always listed before user/tool extensions so its schema-backed `structured_output` registration is present when Atomic applies explicit tool allowlists.
472
472
 
473
473
  Examples:
474
474
 
@@ -531,11 +531,15 @@ Create an implementation plan based on {outputs.context}
531
531
 
532
532
  Each `.chain.md` `## agent-name` section is a step. Config lines such as `phase`, `label`, `as`, `outputSchema`, `output`, `outputMode`, `reads`, `model`, `skills`, and `progress` go immediately after the header. A blank line separates config from task text. In saved `.chain.md` files, `outputSchema` is a path to a JSON Schema file; direct tool calls and `.chain.json` files can pass the schema object inline.
533
533
 
534
+ When `outputSchema` is present, the child receives a schema-specific `structured_output` tool backed by Atomic's shared factory. The schema must be a top-level object tool-argument schema; wrap array or primitive handoff values in explicit object fields such as `{ items: [...] }` or `{ value: ... }`. The child must call `structured_output` exactly once with the schema fields directly, for example `structured_output({ files: [...], risks: [...] })`; do not use the old `structured_output({ value: ... })` wrapper unless your schema explicitly defines a top-level `value` property. The child writes flat params to `output.json` and call metadata (`toolName`, `toolCallId`, `success`, `terminate`) to the `output.meta.json` sidecar. Missing calls, missing sidecar metadata, invalid values, duplicate calls, stale output-file captures, sibling tool calls in the same assistant batch, and later assistant/custom/tool-result messages after the successful tool result fail the step. The parent accepts the cross-process capture only when the flat `output.json` validates and sidecar metadata plus transcript finality prove the same `structured_output` call was the final successful terminating action, then exposes the validated flat value as `structuredOutput`.
535
+
536
+ Children without `outputSchema` do not receive `structured_output` from Atomic's default tool registry. They can still use a custom extension-provided terminating tool if you explicitly add one, but validated `result.structuredOutput` remains reserved for schema-backed captures.
537
+
534
538
  For `output`, `reads`, `skills`, and `progress`, chain behavior is three-state: omitted inherits from the agent, a value overrides, and `false` disables.
535
539
 
536
540
  Use `phase` to group related work in status output, `label` for a readable step name, and `as` to store a successful step or parallel task result for later `{outputs.name}` references. Duplicate `as` names, invalid identifiers, and unknown output references fail before child execution.
537
541
 
538
- Dynamic fanout is available only through direct `subagent({ chain: [...] })` JSON or saved `.chain.json` files. It expands an array from a prior structured named output, runs one child template per item, and stores the ordered collection under `collect.as`. The source must be structured output; prose is never parsed. `expand.maxItems` is required, over-limit arrays fail, nested fanout and arbitrary expressions are not supported, and `.chain.md` has no dynamic syntax in this release.
542
+ Dynamic fanout is available only through direct `subagent({ chain: [...] })` JSON or saved `.chain.json` files. It expands an array from a prior structured named output, runs one child template per item, and stores the ordered collection under `collect.as`. The source must be structured output; prose is never parsed. `expand.maxItems` is required, over-limit arrays fail, nested fanout and arbitrary expressions are not supported, and `.chain.md` has no dynamic syntax in this release. `collect.outputSchema` validates the collected array after child execution and remains a general JSON Schema, so array-root schemas such as `{ "type": "array", "minItems": 1 }` are allowed there even though child `outputSchema` tool schemas must be top-level objects.
539
543
 
540
544
  ```json
541
545
  {
@@ -816,7 +820,7 @@ Agent definitions are not loaded into context by default. Management actions let
816
820
 
817
821
  Use `outputMode: "file-only"` when a saved output may be large and the parent only needs a pointer. The returned text is a compact reference like `Output saved to: /abs/report.md (48.2 KB, 2847 lines). Read this file if needed.` Failed runs and save errors still return normal inline output for debugging. In chains, later `{previous}` steps receive the same compact reference when the prior step used file-only mode.
818
822
 
819
- Sequential and parallel chain tasks accept `agent`, `task`, `phase`, `label`, `as`, `outputSchema`, `cwd`, `output`, `outputMode`, `reads`, `progress`, `skill`, and `model`. Parallel tasks also accept `count`. Parallel step groups accept `parallel`, `concurrency`, `failFast`, and `worktree`. If `outputSchema` is present, the child must call `structured_output` with schema-valid JSON; prose-only completion or invalid JSON fails the step. Validated structured values are preserved on the step result, and `as` also exposes a compact text representation through `{outputs.name}`.
823
+ Sequential and parallel chain tasks accept `agent`, `task`, `phase`, `label`, `as`, `outputSchema`, `cwd`, `output`, `outputMode`, `reads`, `progress`, `skill`, and `model`. Parallel tasks also accept `count`. Parallel step groups accept `parallel`, `concurrency`, `failFast`, and `worktree`. If child `outputSchema` is present, it must be a top-level object schema and the child must call `structured_output` with schema-valid flat JSON arguments; prose-only completion, missing `output.meta.json` sidecar metadata, invalid JSON, top-level arrays/primitives, or an obsolete `{ value: ... }` envelope fails unless the schema itself allows that shape. Validated structured values are preserved on the step result, and `as` also exposes a compact text representation through `{outputs.name}`. Without `outputSchema`, Atomic does not inject `structured_output` into the child. Dynamic fanout `collect.outputSchema` is looser because it validates the aggregate collection rather than a tool call; array-root collection schemas remain valid.
820
824
 
821
825
  Status and control actions:
822
826
 
@@ -1,16 +1,16 @@
1
1
  ---
2
2
  name: codebase-online-researcher
3
3
  description: Online research for up-to-date documentation and library-source knowledge. Use when you need authoritative external information — official docs, ecosystem context, version-specific behavior, GitHub permalinks into open-source libraries, or video tutorials.
4
- tools: read, grep, find, ls, bash, write, web_search, fetch_content, get_search_content
4
+ tools: read, grep, find, ls, bash, web_search, fetch_content, get_search_content
5
5
  model: openai/gpt-5.5:low
6
6
  fallbackModels: openai-codex/gpt-5.5:low, github-copilot/gpt-5.5:low, anthropic/claude-opus-4-8:low, github-copilot/claude-opus-4.7:low
7
7
  skills: browser
8
8
  ---
9
9
 
10
- You are an expert research specialist focused on finding accurate, relevant information from authoritative sources — including open-source library internals with GitHub permalinks. You have three web tools available from the `pi-web-access` extension:
10
+ You are an expert research specialist focused on finding accurate, relevant information from authoritative sources — including open-source library internals with GitHub permalinks. You have three web tools available:
11
11
 
12
12
  - `web_search` — issue one or more queries and get a ranked list of candidate URLs/snippets.
13
- - `fetch_content` — fetch a specific URL and return clean reader-mode text/markdown (HTML pages, GitHub issues/PRs, Stack Overflow, npm, arXiv, Reddit, Wikipedia, JSON endpoints, PDFs, RSS/Atom, YouTube). `fetch_content` on a GitHub repo URL also clones the repo locally under `/tmp/pi-github-repos/<owner>/<repo>` and returns the file tree. Prefer this over a raw HTTP fetch.
13
+ - `fetch_content` — fetch a specific URL and return clean reader-mode text/markdown (HTML pages, GitHub issues/PRs, Stack Overflow, npm, arXiv, Reddit, Wikipedia, JSON endpoints, PDFs, RSS/Atom, YouTube). `fetch_content` on a GitHub repo URL also clones the repo locally under `/tmp/atomic-github-repos/<owner>/<repo>` and returns the file tree. Prefer this over a raw HTTP fetch.
14
14
  - `get_search_content` — fetch the underlying content for the most promising results of a previous `web_search` in one call.
15
15
 
16
16
  For JS-heavy or auth-gated pages, load the `browser` skill and invoke its `browse` CLI through `bash`.
@@ -41,21 +41,6 @@ When fetching any external page, apply these techniques in order. They produce p
41
41
  3. **Request Markdown via `Accept: text/markdown`.** Sites behind Cloudflare with [Markdown for Agents](https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/) return pre-converted Markdown when you set the header. Use `bash` with `curl <url> -H "Accept: text/markdown"` (look for `content-type: text/markdown` and the `x-markdown-tokens` header).
42
42
  4. **Fall back to a real browser.** Load the `browser` skill and drive its `browse` CLI through `bash` to render and interact with JS-heavy or auth-gated pages.
43
43
 
44
- ## Persisting Findings — Store useful documents in `research/web/`
45
-
46
- When you fetch a document that is worth keeping for future sessions (reference docs, API schemas, SDK guides, release notes, troubleshooting writeups, architecture articles), `write` it to `research/web/<YYYY-MM-DD>-<kebab-case-topic>.md` with frontmatter capturing:
47
-
48
- ```markdown
49
- ---
50
- source_url: <original URL>
51
- fetched_at: <YYYY-MM-DD>
52
- fetch_method: read | llms.txt | markdown-accept-header | browser | browse
53
- topic: <short description>
54
- ---
55
- ```
56
-
57
- Followed by the extracted content (trimmed of nav chrome, ads, and irrelevant boilerplate). This lets future work reuse the lookup without re-fetching. Before fetching anything, quickly `find research/web/` for an existing, recent copy.
58
-
59
44
  ## Library Source Research with Permalinks
60
45
 
61
46
  When the question is about an open-source library — its internals, why something was changed, or how a behavior is implemented — every code-related claim needs a GitHub permalink pinned to a full commit SHA. Branch links rot; permalinks don't.
@@ -75,10 +60,10 @@ When the question is about an open-source library — its internals, why somethi
75
60
 
76
61
  **Implementation.** The core workflow is clone → find → permalink:
77
62
 
78
- 1. `fetch_content` the GitHub repo URL — this clones it locally to `/tmp/pi-github-repos/<owner>/<repo>` and returns the file tree.
63
+ 1. `fetch_content` the GitHub repo URL — this clones it locally to `/tmp/atomic-github-repos/<owner>/<repo>` and returns the file tree.
79
64
  2. `grep -rn "function_name"` and `find . -name "*.ts"` inside the clone via `bash`.
80
65
  3. `read` the specific files once you've located them.
81
- 4. Get the commit SHA: `cd /tmp/pi-github-repos/<owner>/<repo> && git rev-parse HEAD`.
66
+ 4. Get the commit SHA: `cd /tmp/atomic-github-repos/<owner>/<repo> && git rev-parse HEAD`.
82
67
  5. Construct the permalink: `https://github.com/<owner>/<repo>/blob/<sha>/<path>#L<start>-L<end>`.
83
68
 
84
69
  Batch the initial calls (`fetch_content` to clone + `web_search` for recent discussions) in one turn, then dig into the clone with `grep`/`read` once it's available.
@@ -86,7 +71,7 @@ Batch the initial calls (`fetch_content` to clone + `web_search` for recent disc
86
71
  **Context / History.** Use git on the cloned repo and `gh` for issues/PRs:
87
72
 
88
73
  ```bash
89
- cd /tmp/pi-github-repos/<owner>/<repo>
74
+ cd /tmp/atomic-github-repos/<owner>/<repo>
90
75
 
91
76
  # Recent changes to a specific file
92
77
  git log --oneline -n 20 -- path/to/file.ts
@@ -131,7 +116,7 @@ https://github.com/<owner>/<repo>/blob/<commit-sha>/<filepath>#L<start>-L<end>
131
116
  Get the SHA from a cloned repo:
132
117
 
133
118
  ```bash
134
- cd /tmp/pi-github-repos/<owner>/<repo> && git rev-parse HEAD
119
+ cd /tmp/atomic-github-repos/<owner>/<repo> && git rev-parse HEAD
135
120
  ```
136
121
 
137
122
  Get the SHA from a tag when answering version-specific questions:
@@ -292,7 +277,7 @@ For library-source answers, every code claim should look like the citation examp
292
277
  - Check `research/web/` for an existing copy before fetching anything new.
293
278
  - Start by fetching the authoritative source (`fetch_content <url>` → `/llms.txt` → `Accept: text/markdown` → `browser`) rather than search-engine-style exploration.
294
279
  - Use `fetch_content` (or `get_search_content` after a `web_search`) to pull full content from the most promising 3-5 web pages.
295
- - Reuse already-cloned repos under `/tmp/pi-github-repos/` instead of re-cloning.
280
+ - Reuse already-cloned repos under `/tmp/atomic-github-repos/` instead of re-cloning.
296
281
  - If initial results are insufficient, refine search terms and try again.
297
282
  - Use exact error messages and function names when available for higher precision.
298
283
  - Compare guidance across at least two sources when possible.
@@ -305,7 +290,7 @@ For library-source answers, every code claim should look like the citation examp
305
290
  | Failure | Recovery |
306
291
  | ------------------------------ | -------------------------------------------------------------------------------------------------------------- |
307
292
  | `grep` finds nothing | Broaden the query; try concept names instead of exact function names. |
308
- | `gh` CLI rate limited | Use the already-cloned repo under `/tmp/pi-github-repos/` for git operations instead. |
293
+ | `gh` CLI rate limited | Use the already-cloned repo under `/tmp/atomic-github-repos/` for git operations instead. |
309
294
  | Repo too large to clone | `fetch_content` returns an API-only view automatically; use that, or add `forceClone: true` if you must clone. |
310
295
  | File not found in the clone | A branch name with slashes may have misresolved; list the repo tree and navigate manually. |
311
296
  | Uncertain about implementation | State your uncertainty explicitly, propose a hypothesis, and show what evidence you did find. |
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: debugger
3
3
  description: Debug errors, test failures, and unexpected behavior. Use PROACTIVELY when encountering issues, analyzing stack traces, or investigating system problems.
4
- tools: read, edit, write, grep, find, ls, bash, web_search, fetch_content, get_search_content
4
+ tools: read, grep, find, ls, bash, web_search, fetch_content, get_search_content
5
5
  model: openai/gpt-5.5:xhigh
6
6
  fallbackModels: openai-codex/gpt-5.5:xhigh, github-copilot/gpt-5.5:xhigh, anthropic/claude-opus-4-8:xhigh, github-copilot/claude-opus-4.7:xhigh
7
7
  skills: tdd, browser, tmux
8
8
  ---
9
9
 
10
- You are tasked with debugging and identifying errors, test failures, and unexpected behavior in the codebase. Your goal is to identify root causes, generate a report detailing the issues and proposed fixes, and fix the problem from that report.
10
+ You are tasked with debugging and identifying errors, test failures, and unexpected behavior in the codebase. Your goal is to identify root causes and generate a report detailing the issues and proposed fixes, so another agent can implement the solutions you suggest.
11
11
 
12
12
  ## Available helpers
13
13
 
@@ -42,13 +42,11 @@ You are tasked with debugging and identifying errors, test failures, and unexpec
42
42
 
43
43
  When you need to consult docs, forums, or issue trackers, apply these techniques in order for the cleanest, most token-efficient content:
44
44
 
45
- 1. **`fetch_content <url>` first.** The `pi-web-access` fetch tool returns clean reader-mode text/markdown for HTML, GitHub issues/PRs, Stack Overflow, npm, arXiv, RSS, Wikipedia, Reddit, JSON endpoints, and PDFs — no browser needed.
45
+ 1. **`fetch_content <url>` first.** The fetch tool returns clean reader-mode text/markdown for HTML, GitHub issues/PRs, Stack Overflow, npm, arXiv, RSS, Wikipedia, Reddit, JSON endpoints, and PDFs — no browser needed.
46
46
  2. **Check `/llms.txt`.** Many modern docs sites publish an AI-friendly index at `/llms.txt` (spec: [llmstxt.org](https://llmstxt.org/llms.txt)). Try `fetch_content https://<site>/llms.txt` before anything else; it often links directly to the most relevant pages in plain text.
47
47
  3. **`Accept: text/markdown` header.** Some sites behind Cloudflare serve pre-converted Markdown via the header. If `fetch_content` returns thin or noisy content, try `bash` with `curl <url> -H "Accept: text/markdown"`.
48
48
  4. **Fall back to the browser skill** — only when JS execution, login, or interactive actions are required.
49
49
 
50
- **Persist useful findings to `research/web/`:** When you fetch a document worth keeping for future sessions (error-message writeups, API schemas, troubleshooting guides, release notes), save it to `research/web/<YYYY-MM-DD>-<kebab-case-topic>.md` with a short header noting the source URL and fetch date. Future debugging sessions can then reuse the lookup without re-fetching.
51
-
52
50
  ## Workflow
53
51
 
54
52
  1a. If the user doesn't provide specific error details, output:
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.8.28",
3
+ "version": "0.8.29-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with chains, parallel execution, and TUI clarification. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -38,9 +38,9 @@
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@bastani/atomic": "*",
41
- "@earendil-works/pi-agent-core": "^0.78.1",
42
- "@earendil-works/pi-ai": "^0.78.1",
43
- "@earendil-works/pi-tui": "^0.78.1"
41
+ "@earendil-works/pi-agent-core": "^0.79.3",
42
+ "@earendil-works/pi-ai": "^0.79.3",
43
+ "@earendil-works/pi-tui": "^0.79.3"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "@bastani/atomic": {
@@ -752,7 +752,8 @@ async function runSingleStep(
752
752
  schema: effectiveStructuredOutput.schema,
753
753
  schemaPath: effectiveStructuredOutput.schemaPath,
754
754
  outputPath: effectiveStructuredOutput.outputPath,
755
- });
755
+ metadataPath: effectiveStructuredOutput.metadataPath,
756
+ }, { messages: run.messages });
756
757
  if (structured.error) structuredError = structured.error;
757
758
  else structuredOutput = structured.value;
758
759
  }
@@ -752,7 +752,8 @@ async function runSingleAttempt(
752
752
  schema: options.structuredOutput.schema,
753
753
  schemaPath: options.structuredOutput.schemaPath,
754
754
  outputPath: options.structuredOutput.outputPath,
755
- });
755
+ metadataPath: options.structuredOutput.metadataPath,
756
+ }, { messages: result.messages ?? [] });
756
757
  result.structuredOutputSchemaPath = options.structuredOutput.schemaPath;
757
758
  result.structuredOutputPath = options.structuredOutput.outputPath;
758
759
  if (structured.error) {
@@ -33,6 +33,7 @@ export interface RunnerSubagentStep {
33
33
  schema: import("../../shared/types.ts").JsonSchemaObject;
34
34
  schemaPath: string;
35
35
  outputPath: string;
36
+ metadataPath: string;
36
37
  };
37
38
  structuredOutputSchema?: import("../../shared/types.ts").JsonSchemaObject;
38
39
  effectiveAcceptance?: import("../../shared/types.ts").ResolvedAcceptanceConfig;
@@ -37,6 +37,7 @@ export const SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV = `${ENV_PREFIX}_SUBAGENT_PARE
37
37
  export const SUBAGENT_INHERIT_PROJECT_CONTEXT_ENV = `${ENV_PREFIX}_SUBAGENT_INHERIT_PROJECT_CONTEXT`;
38
38
  export const SUBAGENT_INHERIT_SKILLS_ENV = `${ENV_PREFIX}_SUBAGENT_INHERIT_SKILLS`;
39
39
  export const SUBAGENT_INTERCOM_SESSION_NAME_ENV = `${ENV_PREFIX}_SUBAGENT_INTERCOM_SESSION_NAME`;
40
+ const STRUCTURED_OUTPUT_TOOL_NAME = "structured_output";
40
41
 
41
42
  interface BuildPiArgsInput {
42
43
  baseArgs: string[];
@@ -74,6 +75,7 @@ interface BuildPiArgsInput {
74
75
  schema: JsonSchemaObject;
75
76
  schemaPath: string;
76
77
  outputPath: string;
78
+ metadataPath: string;
77
79
  };
78
80
  }
79
81
 
@@ -128,8 +130,17 @@ export function buildPiArgs(input: BuildPiArgsInput): BuildPiArgsResult {
128
130
  const declaredBuiltinTools = input.tools?.filter((tool) => !(tool.includes("/") || tool.endsWith(".ts") || tool.endsWith(".js"))) ?? [];
129
131
  const fanoutAuthorized = declaredBuiltinTools.includes("subagent");
130
132
  const toolExtensionPaths: string[] = [];
131
- if (input.tools?.length) {
133
+ if (input.tools !== undefined) {
132
134
  const builtinTools = [...declaredBuiltinTools];
135
+ // Path-only extension entries are passed via --extension, not --tools. An
136
+ // extension-only list intentionally emits no --tools flag, so default built-ins
137
+ // remain available; do not synthesize a built-in allowlist just to add
138
+ // structured_output and accidentally make that case restrictive.
139
+ const shouldAutoAllowStructuredOutput = input.structuredOutput
140
+ && (declaredBuiltinTools.length > 0 || input.tools.length === 0);
141
+ if (shouldAutoAllowStructuredOutput && !builtinTools.includes(STRUCTURED_OUTPUT_TOOL_NAME)) {
142
+ builtinTools.push(STRUCTURED_OUTPUT_TOOL_NAME);
143
+ }
133
144
  for (const tool of input.tools) {
134
145
  if (!declaredBuiltinTools.includes(tool) && (tool.includes("/") || tool.endsWith(".ts") || tool.endsWith(".js"))) {
135
146
  toolExtensionPaths.push(tool);
@@ -137,12 +148,18 @@ export function buildPiArgs(input: BuildPiArgsInput): BuildPiArgsResult {
137
148
  }
138
149
  if (builtinTools.length > 0) {
139
150
  if (input.mcpDirectTools?.length) {
140
- builtinTools.push(...resolveMcpDirectToolNames(input.mcpDirectTools, input.cwd));
151
+ for (const resolvedTool of resolveMcpDirectToolNames(input.mcpDirectTools, input.cwd)) {
152
+ if (!builtinTools.includes(resolvedTool)) {
153
+ builtinTools.push(resolvedTool);
154
+ }
155
+ }
141
156
  }
142
157
  args.push("--tools", builtinTools.join(","));
143
158
  }
144
159
  }
145
160
 
161
+ // Keep the prompt runtime first: schema-backed children get structured_output
162
+ // from this extension before the child session refreshes explicit --tools allowlists.
146
163
  const runtimeExtensions = fanoutAuthorized
147
164
  ? [PROMPT_RUNTIME_EXTENSION_PATH, FANOUT_CHILD_EXTENSION_PATH]
148
165
  : [PROMPT_RUNTIME_EXTENSION_PATH];