@bastani/atomic 0.8.3-0 → 0.8.4-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 (174) hide show
  1. package/CHANGELOG.md +33 -17
  2. package/README.md +3 -3
  3. package/dist/builtin/intercom/index.ts +1 -1
  4. package/dist/builtin/intercom/package.json +1 -5
  5. package/dist/builtin/intercom/ui/compose.ts +1 -1
  6. package/dist/builtin/intercom/ui/inline-message.ts +1 -1
  7. package/dist/builtin/intercom/ui/session-list.ts +1 -1
  8. package/dist/builtin/mcp/commands.ts +1 -1
  9. package/dist/builtin/mcp/direct-tools.ts +1 -1
  10. package/dist/builtin/mcp/index.ts +1 -1
  11. package/dist/builtin/mcp/init.ts +1 -1
  12. package/dist/builtin/mcp/package.json +1 -5
  13. package/dist/builtin/mcp/proxy-modes.ts +1 -1
  14. package/dist/builtin/mcp/sampling-handler.ts +1 -1
  15. package/dist/builtin/mcp/state.ts +1 -1
  16. package/dist/builtin/mcp/tool-result-renderer.ts +1 -1
  17. package/dist/builtin/mcp/utils.ts +1 -1
  18. package/dist/builtin/subagents/CHANGELOG.md +3 -3
  19. package/dist/builtin/subagents/package.json +1 -5
  20. package/dist/builtin/subagents/src/agents/agent-management.ts +1 -1
  21. package/dist/builtin/subagents/src/extension/control-notices.ts +1 -1
  22. package/dist/builtin/subagents/src/extension/index.ts +1 -1
  23. package/dist/builtin/subagents/src/runs/background/async-execution.ts +1 -1
  24. package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +1 -1
  25. package/dist/builtin/subagents/src/runs/background/notify.ts +1 -1
  26. package/dist/builtin/subagents/src/runs/foreground/chain-clarify.ts +1 -1
  27. package/dist/builtin/subagents/src/runs/foreground/chain-execution.ts +1 -1
  28. package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +1 -1
  29. package/dist/builtin/subagents/src/runs/shared/pi-spawn.ts +20 -17
  30. package/dist/builtin/subagents/src/runs/shared/subagent-prompt-runtime.ts +1 -1
  31. package/dist/builtin/subagents/src/shared/fork-context.ts +1 -1
  32. package/dist/builtin/subagents/src/shared/types.ts +1 -1
  33. package/dist/builtin/subagents/src/slash/slash-bridge.ts +1 -1
  34. package/dist/builtin/subagents/src/slash/slash-commands.ts +1 -1
  35. package/dist/builtin/subagents/src/tui/render-helpers.ts +1 -1
  36. package/dist/builtin/subagents/src/tui/render.ts +1 -1
  37. package/dist/builtin/web-access/index.ts +1 -1
  38. package/dist/builtin/web-access/package.json +1 -5
  39. package/dist/builtin/web-access/storage.ts +1 -1
  40. package/dist/builtin/web-access/summary-review.ts +1 -1
  41. package/dist/builtin/workflows/package.json +1 -5
  42. package/dist/builtin/workflows/src/extension/index.ts +1 -1
  43. package/dist/builtin/workflows/src/extension/wiring.ts +10 -10
  44. package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +1 -1
  45. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +1 -1
  46. package/dist/builtin/workflows/src/runs/shared/model-fallback.ts +1 -1
  47. package/dist/builtin/workflows/src/runs/shared/workflow-runner.ts +1 -1
  48. package/dist/builtin/workflows/src/shared/types.ts +1 -1
  49. package/dist/builtin/workflows/src/tui/graph-theme.ts +2 -2
  50. package/dist/builtin/workflows/src/tui/overlay-adapter.ts +1 -1
  51. package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +1 -1
  52. package/dist/core/agent-session.d.ts +1 -0
  53. package/dist/core/agent-session.d.ts.map +1 -1
  54. package/dist/core/agent-session.js +9 -0
  55. package/dist/core/agent-session.js.map +1 -1
  56. package/dist/core/extensions/loader.d.ts.map +1 -1
  57. package/dist/core/extensions/loader.js +0 -4
  58. package/dist/core/extensions/loader.js.map +1 -1
  59. package/dist/core/extensions/types.d.ts +2 -2
  60. package/dist/core/extensions/types.d.ts.map +1 -1
  61. package/dist/core/extensions/types.js.map +1 -1
  62. package/dist/core/sdk.d.ts.map +1 -1
  63. package/dist/core/sdk.js +29 -12
  64. package/dist/core/sdk.js.map +1 -1
  65. package/dist/core/system-prompt.d.ts +10 -0
  66. package/dist/core/system-prompt.d.ts.map +1 -1
  67. package/dist/core/system-prompt.js +80 -8
  68. package/dist/core/system-prompt.js.map +1 -1
  69. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  70. package/dist/modes/interactive/theme/theme.js +2 -2
  71. package/dist/modes/interactive/theme/theme.js.map +1 -1
  72. package/dist/utils/tools-manager.d.ts.map +1 -1
  73. package/dist/utils/tools-manager.js +35 -9
  74. package/dist/utils/tools-manager.js.map +1 -1
  75. package/docs/compaction.md +2 -2
  76. package/docs/custom-provider.md +2 -2
  77. package/docs/extensions.md +17 -17
  78. package/docs/index.md +1 -1
  79. package/docs/packages.md +1 -1
  80. package/docs/quickstart.md +1 -1
  81. package/docs/rpc.md +1 -1
  82. package/docs/sdk.md +22 -22
  83. package/docs/session-format.md +1 -1
  84. package/docs/termux.md +1 -1
  85. package/docs/tui.md +6 -6
  86. package/examples/extensions/README.md +1 -1
  87. package/examples/extensions/auto-commit-on-exit.ts +1 -1
  88. package/examples/extensions/bash-spawn-hook.ts +2 -2
  89. package/examples/extensions/bookmark.ts +1 -1
  90. package/examples/extensions/border-status-editor.ts +1 -1
  91. package/examples/extensions/built-in-tool-renderer.ts +2 -2
  92. package/examples/extensions/claude-rules.ts +1 -1
  93. package/examples/extensions/commands.ts +1 -1
  94. package/examples/extensions/confirm-destructive.ts +1 -1
  95. package/examples/extensions/custom-compaction.ts +2 -2
  96. package/examples/extensions/custom-footer.ts +1 -1
  97. package/examples/extensions/custom-header.ts +2 -2
  98. package/examples/extensions/custom-provider-anthropic/index.ts +1 -1
  99. package/examples/extensions/custom-provider-gitlab-duo/index.ts +1 -1
  100. package/examples/extensions/dirty-repo-guard.ts +1 -1
  101. package/examples/extensions/doom-overlay/index.ts +1 -1
  102. package/examples/extensions/dynamic-resources/index.ts +1 -1
  103. package/examples/extensions/dynamic-tools.ts +1 -1
  104. package/examples/extensions/event-bus.ts +1 -1
  105. package/examples/extensions/file-trigger.ts +1 -1
  106. package/examples/extensions/git-checkpoint.ts +1 -1
  107. package/examples/extensions/github-issue-autocomplete.ts +1 -1
  108. package/examples/extensions/handoff.ts +2 -2
  109. package/examples/extensions/hello.ts +1 -1
  110. package/examples/extensions/hidden-thinking-label.ts +1 -1
  111. package/examples/extensions/inline-bash.ts +1 -1
  112. package/examples/extensions/input-transform.ts +1 -1
  113. package/examples/extensions/interactive-shell.ts +1 -1
  114. package/examples/extensions/mac-system-theme.ts +1 -1
  115. package/examples/extensions/message-renderer.ts +1 -1
  116. package/examples/extensions/minimal-mode.ts +2 -2
  117. package/examples/extensions/modal-editor.ts +1 -1
  118. package/examples/extensions/model-status.ts +1 -1
  119. package/examples/extensions/notify.ts +1 -1
  120. package/examples/extensions/overlay-qa-tests.ts +1 -1
  121. package/examples/extensions/overlay-test.ts +1 -1
  122. package/examples/extensions/permission-gate.ts +1 -1
  123. package/examples/extensions/pirate.ts +1 -1
  124. package/examples/extensions/plan-mode/index.ts +1 -1
  125. package/examples/extensions/preset.ts +2 -2
  126. package/examples/extensions/prompt-customizer.ts +1 -1
  127. package/examples/extensions/protected-paths.ts +1 -1
  128. package/examples/extensions/provider-payload.ts +1 -1
  129. package/examples/extensions/qna.ts +2 -2
  130. package/examples/extensions/question.ts +1 -1
  131. package/examples/extensions/questionnaire.ts +1 -1
  132. package/examples/extensions/rainbow-editor.ts +1 -1
  133. package/examples/extensions/reload-runtime.ts +1 -1
  134. package/examples/extensions/rpc-demo.ts +1 -1
  135. package/examples/extensions/sandbox/index.ts +2 -2
  136. package/examples/extensions/send-user-message.ts +1 -1
  137. package/examples/extensions/session-name.ts +1 -1
  138. package/examples/extensions/shutdown-command.ts +1 -1
  139. package/examples/extensions/snake.ts +1 -1
  140. package/examples/extensions/space-invaders.ts +1 -1
  141. package/examples/extensions/ssh.ts +2 -2
  142. package/examples/extensions/status-line.ts +1 -1
  143. package/examples/extensions/structured-output.ts +1 -1
  144. package/examples/extensions/subagent/agents.ts +1 -1
  145. package/examples/extensions/subagent/index.ts +1 -1
  146. package/examples/extensions/summarize.ts +2 -2
  147. package/examples/extensions/system-prompt-header.ts +1 -1
  148. package/examples/extensions/tic-tac-toe.ts +1 -1
  149. package/examples/extensions/timed-confirm.ts +1 -1
  150. package/examples/extensions/titlebar-spinner.ts +1 -1
  151. package/examples/extensions/todo.ts +1 -1
  152. package/examples/extensions/tool-override.ts +1 -1
  153. package/examples/extensions/tools.ts +2 -2
  154. package/examples/extensions/trigger-compact.ts +1 -1
  155. package/examples/extensions/truncated-tool.ts +2 -2
  156. package/examples/extensions/widget-placement.ts +1 -1
  157. package/examples/extensions/with-deps/index.ts +1 -1
  158. package/examples/extensions/working-indicator.ts +1 -1
  159. package/examples/extensions/working-message-test.ts +1 -1
  160. package/examples/sdk/01-minimal.ts +1 -1
  161. package/examples/sdk/02-custom-model.ts +1 -1
  162. package/examples/sdk/03-custom-prompt.ts +1 -1
  163. package/examples/sdk/04-skills.ts +1 -1
  164. package/examples/sdk/05-tools.ts +1 -1
  165. package/examples/sdk/06-extensions.ts +2 -2
  166. package/examples/sdk/07-context-files.ts +1 -1
  167. package/examples/sdk/08-prompt-templates.ts +1 -1
  168. package/examples/sdk/09-api-keys-and-oauth.ts +1 -1
  169. package/examples/sdk/10-settings.ts +1 -1
  170. package/examples/sdk/11-sessions.ts +1 -1
  171. package/examples/sdk/12-full-control.ts +1 -1
  172. package/examples/sdk/13-session-runtime.ts +1 -1
  173. package/examples/sdk/README.md +1 -1
  174. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.8.4-0] - 2026-05-17
6
+
7
+ ### Added
8
+
9
+ - Added selected model details to the system prompt for assistant model attribution.
10
+
11
+ ### Changed
12
+
13
+ - Aligned package references with Atomic branding.
14
+
15
+ ## [0.8.3] - 2026-05-17
16
+
17
+ ### Changed
18
+
19
+ - Pinned `@j178/prek` to 0.3.13 to keep hook installation stable.
20
+
5
21
  ## [0.8.3-0] - 2026-05-17
6
22
 
7
23
  ### Changed
@@ -83,7 +99,7 @@
83
99
 
84
100
  ### New Features
85
101
 
86
- - **Self-update support for the npm scope migration**: `pi update --self` now supports the upcoming package rename from `@mariozechner/pi-coding-agent` to `@earendil-works/pi-coding-agent`. After the new package is published, existing global installs can update through the normal self-update flow; pi will uninstall the old global package and install the package name returned by the version check endpoint.
102
+ - **Self-update support for the npm scope migration**: `pi update --self` now supports the upcoming package rename from `@bastani/atomic` to `@bastani/atomic`. After the new package is published, existing global installs can update through the normal self-update flow; pi will uninstall the old global package and install the package name returned by the version check endpoint.
87
103
  - **Interactive OAuth login selection**: OAuth providers can now present multiple login choices in `/login`, enabling provider-specific interactive authentication flows. See [Providers](docs/providers.md).
88
104
  - **JSONC-style `models.json` parsing**: `models.json` now allows comments and trailing commas, making custom provider and model configuration easier to maintain. See [Providers](docs/providers.md) and [Custom Providers](docs/custom-provider.md).
89
105
 
@@ -451,7 +467,7 @@
451
467
  ### Breaking Changes
452
468
 
453
469
  - Changed SDK and CLI tool selection from cwd-bound built-in tool instances to tool-name allowlists. `createAgentSession({ tools })` now expects `string[]` names such as `"read"` and `"bash"` instead of `Tool[]`, `--tools` now allowlists built-in, extension, and custom tools by name, and `--no-tools` now disables all tools by default rather than only built-ins. Migrate SDK code from `tools: [readTool, bashTool]` to `tools: ["read", "bash"]` ([#2835](https://github.com/badlogic/pi-mono/issues/2835), [#3452](https://github.com/badlogic/pi-mono/issues/3452))
454
- - Removed prebuilt cwd-bound tool and tool-definition exports from `@mariozechner/pi-coding-agent`, including `readTool`, `bashTool`, `editTool`, `writeTool`, `grepTool`, `findTool`, `lsTool`, `readOnlyTools`, `codingTools`, and the corresponding `*ToolDefinition` values. Use the explicit factory exports instead, for example `createReadTool(cwd)`, `createBashTool(cwd)`, `createCodingTools(cwd)`, and `createReadToolDefinition(cwd)` ([#3452](https://github.com/badlogic/pi-mono/issues/3452))
470
+ - Removed prebuilt cwd-bound tool and tool-definition exports from `@bastani/atomic`, including `readTool`, `bashTool`, `editTool`, `writeTool`, `grepTool`, `findTool`, `lsTool`, `readOnlyTools`, `codingTools`, and the corresponding `*ToolDefinition` values. Use the explicit factory exports instead, for example `createReadTool(cwd)`, `createBashTool(cwd)`, `createCodingTools(cwd)`, and `createReadToolDefinition(cwd)` ([#3452](https://github.com/badlogic/pi-mono/issues/3452))
455
471
  - Removed ambient `process.cwd()` / default agent-dir fallback behavior from public resource helpers. `DefaultResourceLoader`, `loadProjectContextFiles()`, and `loadSkills()` now require explicit cwd/agent-dir style inputs, and exported system-prompt option types now require an explicit `cwd`. Pass the session or project cwd explicitly instead of relying on process-global defaults ([#3452](https://github.com/badlogic/pi-mono/issues/3452))
456
472
 
457
473
  ### Added
@@ -482,8 +498,8 @@
482
498
  - Fixed OpenAI-compatible Chat Completions sessions to optionally send aligned `session_id`, `x-client-request-id`, and `x-session-affinity` headers from `sessionId` via `compat.sendSessionAffinityHeaders`, improving cache-affinity routing for backends such as Fireworks ([#3430](https://github.com/badlogic/pi-mono/issues/3430))
483
499
  - Fixed threaded `/resume` session relationships and current-session detection to canonicalize symlinked session paths during selector comparisons, so shared session directories no longer break parent-child matching or active-session delete protection ([#3364](https://github.com/badlogic/pi-mono/issues/3364))
484
500
  - Fixed `/session`, Sessions docs, and CLI help to consistently document that session reuse supports both file paths and session IDs, and that `/session` shows the current session ID ([#3390](https://github.com/badlogic/pi-mono/issues/3390))
485
- - Fixed Windows pnpm global install detection to recognize `\\.pnpm\\` store paths, so update notices now suggest `pnpm install -g @mariozechner/pi-coding-agent` instead of falling back to npm ([#3378](https://github.com/badlogic/pi-mono/issues/3378))
486
- - Fixed missing `@sinclair/typebox` runtime dependency in `@mariozechner/pi-coding-agent`, so strict pnpm installs no longer fail with `ERR_MODULE_NOT_FOUND` when starting `pi` ([#3434](https://github.com/badlogic/pi-mono/issues/3434))
501
+ - Fixed Windows pnpm global install detection to recognize `\\.pnpm\\` store paths, so update notices now suggest `pnpm install -g @bastani/atomic` instead of falling back to npm ([#3378](https://github.com/badlogic/pi-mono/issues/3378))
502
+ - Fixed missing `@sinclair/typebox` runtime dependency in `@bastani/atomic`, so strict pnpm installs no longer fail with `ERR_MODULE_NOT_FOUND` when starting `pi` ([#3434](https://github.com/badlogic/pi-mono/issues/3434))
487
503
  - Fixed xterm uppercase typing in the interactive editor by decoding printable `modifyOtherKeys` input and normalizing shifted letter matching, so `Shift+letter` no longer disappears in `pi` ([#3436](https://github.com/badlogic/pi-mono/issues/3436))
488
504
  - Fixed `/compact` to reuse the session thinking level for compaction summaries instead of forcing `high`, avoiding invalid reasoning-effort errors on `github-copilot/claude-opus-4.7` sessions configured for `medium` thinking ([#3438](https://github.com/badlogic/pi-mono/issues/3438))
489
505
  - Fixed shared/exported plain-text tool output to preserve indentation instead of collapsing leading whitespace in the web share page ([#3440](https://github.com/badlogic/pi-mono/issues/3440))
@@ -520,7 +536,7 @@
520
536
  - Fixed compact interactive extension startup summaries to disambiguate package extensions and repeated local `index.ts` entries by using package-aware labels and the minimal parent path needed to make local entries unique ([#3308](https://github.com/badlogic/pi-mono/issues/3308))
521
537
  - Fixed git package dependency installation to use production installs (`npm install --omit=dev`) during both install and update flows, so extension runtime dependencies must come from `dependencies` and not `devDependencies` ([#3009](https://github.com/badlogic/pi-mono/issues/3009))
522
538
  - Fixed `tool_result` / `afterToolCall` extension handling for error results by forwarding `details` and `isError` overrides through `AgentSession` instead of dropping them when `isError` was already true ([#3051](https://github.com/badlogic/pi-mono/issues/3051))
523
- - Fixed missing root exports for `RpcClient` and RPC protocol types from `@mariozechner/pi-coding-agent`, so ESM consumers can import them from the main package entrypoint ([#3275](https://github.com/badlogic/pi-mono/issues/3275))
539
+ - Fixed missing root exports for `RpcClient` and RPC protocol types from `@bastani/atomic`, so ESM consumers can import them from the main package entrypoint ([#3275](https://github.com/badlogic/pi-mono/issues/3275))
524
540
  - Fixed OpenAI Codex service-tier cost accounting to trust the explicitly requested tier when the API echoes the default tier in responses, keeping session cost displays aligned with the selected tier ([#3307](https://github.com/badlogic/pi-mono/pull/3307) by [@markusylisiurunen](https://github.com/markusylisiurunen))
525
541
  - Fixed parallel tool-call finalization to convert `afterToolCall` hook throws into error tool results instead of aborting the remaining tool batch ([#3084](https://github.com/badlogic/pi-mono/issues/3084))
526
542
  - Fixed Bun binary asset path resolution to honor `PI_PACKAGE_DIR` for built-in themes, HTML export templates, and interactive bundled assets ([#3074](https://github.com/badlogic/pi-mono/issues/3074))
@@ -784,7 +800,7 @@ import {
784
800
  createAgentSessionServices,
785
801
  getAgentDir,
786
802
  SessionManager,
787
- } from "@mariozechner/pi-coding-agent";
803
+ } from "@bastani/atomic";
788
804
 
789
805
  const createRuntime: CreateAgentSessionRuntimeFactory = async ({ cwd, sessionManager, sessionStartEvent }) => {
790
806
  const services = await createAgentSessionServices({ cwd });
@@ -974,7 +990,7 @@ Examples:
974
990
 
975
991
  ### Changed
976
992
 
977
- - Built-in tools now work like custom tools in extensions. To get built-in tool definitions, import `readToolDefinition` / `createReadToolDefinition()` and the equivalent `bash`, `edit`, `write`, `grep`, `find`, and `ls` exports from `@mariozechner/pi-coding-agent`.
993
+ - Built-in tools now work like custom tools in extensions. To get built-in tool definitions, import `readToolDefinition` / `createReadToolDefinition()` and the equivalent `bash`, `edit`, `write`, `grep`, `find`, and `ls` exports from `@bastani/atomic`.
978
994
  - Cleaned up `buildSystemPrompt()` so built-in tool snippets and tool-local guidelines come from built-in `ToolDefinition` metadata, while cross-tool and global prompt rules stay in system prompt construction.
979
995
  - Added structured `sourceInfo` to `pi.getAllTools()` results for built-in, SDK, and extension tools ([#1734](https://github.com/badlogic/pi-mono/issues/1734))
980
996
 
@@ -1002,7 +1018,7 @@ Examples:
1002
1018
 
1003
1019
  ### Added
1004
1020
 
1005
- - Added `ToolCallEventResult` to the `@mariozechner/pi-coding-agent` top-level and core extension exports so extension authors can type explicit `tool_call` handler return values ([#2458](https://github.com/badlogic/pi-mono/issues/2458))
1021
+ - Added `ToolCallEventResult` to the `@bastani/atomic` top-level and core extension exports so extension authors can type explicit `tool_call` handler return values ([#2458](https://github.com/badlogic/pi-mono/issues/2458))
1006
1022
 
1007
1023
  ### Changed
1008
1024
 
@@ -1809,7 +1825,7 @@ Examples:
1809
1825
  - **Android/Termux support**: Pi now runs on Android via Termux. Install with:
1810
1826
  ```bash
1811
1827
  pkg install nodejs termux-api git
1812
- npm install -g @mariozechner/pi-coding-agent
1828
+ npm install -g @bastani/atomic
1813
1829
  mkdir -p ~/.pi/agent
1814
1830
  echo "You are running on Android in Termux." > ~/.pi/agent/AGENTS.md
1815
1831
  ```
@@ -2325,7 +2341,7 @@ There are multiple SDK breaking changes since v0.49.3. For the quickest migratio
2325
2341
 
2326
2342
  ### Fixed
2327
2343
 
2328
- - Extensions now load correctly in compiled Bun binary using `@mariozechner/jiti` fork with `virtualModules` support. Bundled packages (`@sinclair/typebox`, `@mariozechner/pi-tui`, `@mariozechner/pi-ai`, `@mariozechner/pi-coding-agent`) are accessible to extensions without filesystem node_modules.
2344
+ - Extensions now load correctly in compiled Bun binary using `@mariozechner/jiti` fork with `virtualModules` support. Bundled packages (`@sinclair/typebox`, `@mariozechner/pi-tui`, `@mariozechner/pi-ai`, `@bastani/atomic`) are accessible to extensions without filesystem node_modules.
2329
2345
 
2330
2346
  ## [0.45.1] - 2026-01-13
2331
2347
 
@@ -2706,16 +2722,16 @@ No recursion beyond one level. Complex packages must use the `package.json` mani
2706
2722
 
2707
2723
  ```typescript
2708
2724
  // Before (hook)
2709
- import type { HookAPI, HookContext } from "@mariozechner/pi-coding-agent";
2725
+ import type { HookAPI, HookContext } from "@bastani/atomic";
2710
2726
  export default function (pi: HookAPI) { ... }
2711
2727
 
2712
2728
  // Before (custom tool)
2713
- import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
2729
+ import type { CustomToolFactory } from "@bastani/atomic";
2714
2730
  const factory: CustomToolFactory = (pi) => ({ name: "my_tool", ... });
2715
2731
  export default factory;
2716
2732
 
2717
2733
  // After (both are now extensions)
2718
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
2734
+ import type { ExtensionAPI } from "@bastani/atomic";
2719
2735
  export default function (pi: ExtensionAPI) {
2720
2736
  pi.on("tool_call", async (event, ctx) => { ... });
2721
2737
  pi.registerTool({ name: "my_tool", ... });
@@ -3158,7 +3174,7 @@ See [docs/custom-tools.md](docs/custom-tools.md) and [examples/custom-tools/](ex
3158
3174
  import {
3159
3175
  discoverAuthStorage,
3160
3176
  discoverModels,
3161
- } from "@mariozechner/pi-coding-agent";
3177
+ } from "@bastani/atomic";
3162
3178
 
3163
3179
  const authStorage = discoverAuthStorage(); // ~/.pi/agent/auth.json
3164
3180
  const modelRegistry = discoverModels(authStorage); // + ~/.pi/agent/models.json
@@ -3556,7 +3572,7 @@ Total color count increased from 46 to 50. See [docs/themes.md](docs/themes.md)
3556
3572
 
3557
3573
  ### Added
3558
3574
 
3559
- - **OAuth and model config exports**: Scripts using `AgentSession` directly can now import `getAvailableModels`, `getApiKeyForModel`, `findModel`, `login`, `logout`, and `getOAuthProviders` from `@mariozechner/pi-coding-agent` to reuse OAuth token storage and model resolution. ([#245](https://github.com/badlogic/pi-mono/issues/245))
3575
+ - **OAuth and model config exports**: Scripts using `AgentSession` directly can now import `getAvailableModels`, `getApiKeyForModel`, `findModel`, `login`, `logout`, and `getOAuthProviders` from `@bastani/atomic` to reuse OAuth token storage and model resolution. ([#245](https://github.com/badlogic/pi-mono/issues/245))
3560
3576
 
3561
3577
  - **xhigh thinking level for gpt-5.2 models**: The thinking level selector and shift+tab cycling now show xhigh option for gpt-5.2 and gpt-5.2-codex models (in addition to gpt-5.1-codex-max). ([#236](https://github.com/badlogic/pi-mono/pull/236) by [@theBucky](https://github.com/theBucky))
3562
3578
 
@@ -3582,7 +3598,7 @@ Total color count increased from 46 to 50. See [docs/themes.md](docs/themes.md)
3582
3598
 
3583
3599
  - **Subagent orchestration example**: Added comprehensive custom tool example for spawning and orchestrating sub-agents with isolated context windows. Includes scout/planner/reviewer/worker agents and workflow commands for multi-agent pipelines. ([#215](https://github.com/badlogic/pi-mono/pull/215) by [@nicobailon](https://github.com/nicobailon))
3584
3600
 
3585
- - **`getMarkdownTheme()` export**: Custom tools can now import `getMarkdownTheme()` from `@mariozechner/pi-coding-agent` to use the same markdown styling as the main UI.
3601
+ - **`getMarkdownTheme()` export**: Custom tools can now import `getMarkdownTheme()` from `@bastani/atomic` to use the same markdown styling as the main UI.
3586
3602
 
3587
3603
  - **`pi.exec()` signal and timeout support**: Custom tools and hooks can now pass `{ signal, timeout }` options to `pi.exec()` for cancellation and timeout handling. The result includes a `killed` flag when the process was terminated.
3588
3604
 
@@ -3654,7 +3670,7 @@ Total color count increased from 46 to 50. See [docs/themes.md](docs/themes.md)
3654
3670
  - `rpc.md`: Added missing `hook_error` event documentation
3655
3671
  - `README.md`: Complete settings table, condensed philosophy section, standardized OAuth docs
3656
3672
 
3657
- - Hooks loader now supports same import aliases as custom tools (`@sinclair/typebox`, `@mariozechner/pi-ai`, `@mariozechner/pi-tui`, `@mariozechner/pi-coding-agent`).
3673
+ - Hooks loader now supports same import aliases as custom tools (`@sinclair/typebox`, `@mariozechner/pi-ai`, `@mariozechner/pi-tui`, `@bastani/atomic`).
3658
3674
 
3659
3675
  ### Breaking Changes
3660
3676
 
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  </p>
8
8
  <p align="center">
9
9
  <a href="https://discord.com/invite/3cU7Bz4UPx"><img alt="Discord" src="https://img.shields.io/badge/discord-community-5865F2?style=flat-square&logo=discord&logoColor=white" /></a>
10
- <a href="https://www.npmjs.com/package/@earendil-works/pi-coding-agent"><img alt="npm" src="https://img.shields.io/npm/v/@earendil-works/pi-coding-agent?style=flat-square" /></a>
10
+ <a href="https://www.npmjs.com/package/@bastani/atomic"><img alt="npm" src="https://img.shields.io/npm/v/@bastani/atomic?style=flat-square" /></a>
11
11
  </p>
12
12
  <p align="center">
13
13
  <a href="https://pi.dev">pi.dev</a> domain graciously donated by
@@ -76,7 +76,7 @@ curl -fsSL https://pi.dev/install.sh | sh
76
76
  Or with npm:
77
77
 
78
78
  ```bash
79
- npm install -g @earendil-works/pi-coding-agent
79
+ npm install -g @bastani/atomic
80
80
  ```
81
81
 
82
82
  Authenticate with an API key:
@@ -436,7 +436,7 @@ See [docs/packages.md](docs/packages.md).
436
436
  ### SDK
437
437
 
438
438
  ```typescript
439
- import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@earendil-works/pi-coding-agent";
439
+ import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@bastani/atomic";
440
440
 
441
441
  const authStorage = AuthStorage.create();
442
442
  const modelRegistry = ModelRegistry.create(authStorage);
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
1
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
2
2
  import { randomUUID } from "crypto";
3
3
  import { Type } from "typebox";
4
4
  import { Text } from "@mariozechner/pi-tui";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.8.3-0",
3
+ "version": "0.8.4-0",
4
4
  "private": true,
5
5
  "description": "Atomic extension providing a private coordination channel between parent and child agent sessions.",
6
6
  "contributors": [
@@ -39,16 +39,12 @@
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@bastani/atomic": "*",
42
- "@earendil-works/pi-coding-agent": "*",
43
42
  "@earendil-works/pi-tui": "*"
44
43
  },
45
44
  "peerDependenciesMeta": {
46
45
  "@bastani/atomic": {
47
46
  "optional": true
48
47
  },
49
- "@earendil-works/pi-coding-agent": {
50
- "optional": true
51
- },
52
48
  "@earendil-works/pi-tui": {
53
49
  "optional": true
54
50
  }
@@ -1,6 +1,6 @@
1
1
  import type { Component, TUI } from "@mariozechner/pi-tui";
2
2
  import { truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
3
- import type { KeybindingsManager, Theme } from "@mariozechner/pi-coding-agent";
3
+ import type { KeybindingsManager, Theme } from "@bastani/atomic";
4
4
  import type { IntercomClient } from "../broker/client.js";
5
5
  import type { SessionInfo } from "../types.js";
6
6
 
@@ -1,6 +1,6 @@
1
1
  import type { Component } from "@mariozechner/pi-tui";
2
2
  import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@mariozechner/pi-tui";
3
- import type { Theme } from "@mariozechner/pi-coding-agent";
3
+ import type { Theme } from "@bastani/atomic";
4
4
  import type { SessionInfo, Message } from "../types.js";
5
5
 
6
6
  export class InlineMessageComponent implements Component {
@@ -1,6 +1,6 @@
1
1
  import type { Component } from "@mariozechner/pi-tui";
2
2
  import { truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
3
- import type { KeybindingsManager, Theme } from "@mariozechner/pi-coding-agent";
3
+ import type { KeybindingsManager, Theme } from "@bastani/atomic";
4
4
  import type { SessionInfo } from "../types.js";
5
5
 
6
6
  function middleTruncate(text: string, maxWidth: number): string {
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
1
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
2
2
  import type { McpExtensionState } from "./state.ts";
3
3
  import type { McpAuthResult, McpConfig, ServerEntry, McpPanelCallbacks, McpPanelResult, ImportKind } from "./types.ts";
4
4
  import {
@@ -1,4 +1,4 @@
1
- import type { AgentToolResult, AgentToolUpdateCallback, ExtensionContext } from "@earendil-works/pi-coding-agent";
1
+ import type { AgentToolResult, AgentToolUpdateCallback, ExtensionContext } from "@bastani/atomic";
2
2
  import type { McpExtensionState } from "./state.ts";
3
3
  import type { DirectToolSpec, McpConfig, McpContent } from "./types.ts";
4
4
  import type { MetadataCache } from "./metadata-cache.ts";
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI, ToolInfo } from "@earendil-works/pi-coding-agent";
1
+ import type { ExtensionAPI, ToolInfo } from "@bastani/atomic";
2
2
  import type { McpExtensionState } from "./state.ts";
3
3
  import { Type } from "typebox";
4
4
  import { showStatus, showTools, reconnectServers, authenticateServer, logoutServer, openMcpAuthPanel, openMcpPanel, openMcpSetup } from "./commands.ts";
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
1
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
2
2
  import type { McpExtensionState } from "./state.ts";
3
3
  import type { ToolMetadata } from "./types.ts";
4
4
  import { existsSync } from "node:fs";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.8.3-0",
3
+ "version": "0.8.4-0",
4
4
  "private": true,
5
5
  "description": "Atomic extension that adapts MCP (Model Context Protocol) servers into the coding agent.",
6
6
  "contributors": [
@@ -33,7 +33,6 @@
33
33
  "peerDependencies": {
34
34
  "@bastani/atomic": "*",
35
35
  "@earendil-works/pi-ai": "*",
36
- "@earendil-works/pi-coding-agent": "*",
37
36
  "@earendil-works/pi-tui": "*",
38
37
  "zod": "^3.25.0 || ^4.0.0"
39
38
  },
@@ -44,9 +43,6 @@
44
43
  "@earendil-works/pi-ai": {
45
44
  "optional": true
46
45
  },
47
- "@earendil-works/pi-coding-agent": {
48
- "optional": true
49
- },
50
46
  "@earendil-works/pi-tui": {
51
47
  "optional": true
52
48
  }
@@ -1,4 +1,4 @@
1
- import type { AgentToolResult, ToolInfo } from "@earendil-works/pi-coding-agent";
1
+ import type { AgentToolResult, ToolInfo } from "@bastani/atomic";
2
2
  import type { McpExtensionState } from "./state.ts";
3
3
  import type { ToolMetadata, McpContent } from "./types.ts";
4
4
  import { getServerPrefix, parseUiPromptHandoff } from "./types.ts";
@@ -1,6 +1,6 @@
1
1
  import { complete, type Api, type AssistantMessage, type Message, type Model, type TextContent } from "@earendil-works/pi-ai";
2
2
  import { truncateAtWord } from "./utils.ts";
3
- import type { ExtensionUIContext, ModelRegistry } from "@earendil-works/pi-coding-agent";
3
+ import type { ExtensionUIContext, ModelRegistry } from "@bastani/atomic";
4
4
  import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
5
5
  import {
6
6
  CreateMessageRequestSchema,
@@ -1,4 +1,4 @@
1
- import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
1
+ import type { ExtensionContext } from "@bastani/atomic";
2
2
  import type { ConsentManager } from "./consent-manager.ts";
3
3
  import type { McpLifecycleManager } from "./lifecycle.ts";
4
4
  import type { McpServerManager } from "./server-manager.ts";
@@ -1,4 +1,4 @@
1
- import type { AgentToolResult, ToolRenderResultOptions } from "@earendil-works/pi-coding-agent";
1
+ import type { AgentToolResult, ToolRenderResultOptions } from "@bastani/atomic";
2
2
  import { Text } from "@earendil-works/pi-tui";
3
3
 
4
4
  type McpToolResultDetails = Record<string, unknown> & { error?: unknown };
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
1
+ import type { ExtensionAPI } from "@bastani/atomic";
2
2
  import { homedir, platform } from "node:os";
3
3
  import { join } from "node:path";
4
4
  import type { McpConfig, ServerEntry } from "./types.ts";
@@ -370,7 +370,7 @@
370
370
  - Worktree cwd mapping now derives repo-relative prefixes from `git rev-parse --show-prefix` instead of `path.relative(realpath, realpath)`, fixing Windows 8.3/canonical-path mismatches that could map `agentCwd` back to the source repo instead of the created worktree.
371
371
  - Async background runs now pass the parent process `argv[1]` through to the detached runner, so Windows child spawning keeps targeting the intended `pi` CLI entry point instead of accidentally treating the runner's `jiti` bootstrap script as `pi`.
372
372
  - Intercom detach listeners now guard optional event-bus subscriptions with optional-call semantics, so delegated runs no longer fail when host event buses expose `emit` without `on`.
373
- - Skill discovery no longer depends on runtime imports from `@mariozechner/pi-coding-agent`; it now resolves skills directly from configured filesystem paths, preventing `ERR_MODULE_NOT_FOUND` crashes in local/integration test environments.
373
+ - Skill discovery no longer depends on runtime imports from `@bastani/atomic`; it now resolves skills directly from configured filesystem paths, preventing `ERR_MODULE_NOT_FOUND` crashes in local/integration test environments.
374
374
 
375
375
  ## [0.13.3] - 2026-04-13
376
376
 
@@ -434,7 +434,7 @@
434
434
  ## [0.12.2] - 2026-04-04
435
435
 
436
436
  ### Changed
437
- - Bumped pi package devDependencies to `^0.65.0` (`@mariozechner/pi-agent-core`, `@mariozechner/pi-ai`, `@mariozechner/pi-coding-agent`) to stay aligned with current pi SDK/runtime.
437
+ - Bumped pi package devDependencies to `^0.65.0` (`@mariozechner/pi-agent-core`, `@mariozechner/pi-ai`, `@bastani/atomic`) to stay aligned with current pi SDK/runtime.
438
438
 
439
439
  ## [0.12.1] - 2026-04-03
440
440
 
@@ -638,7 +638,7 @@
638
638
  - **`"builtin"` agent source** — new third tier in agent discovery. Priority: builtin < user < project. Builtin agents appear in listings with a `[builtin]` badge and cannot be modified or deleted through management actions (create a same-named user agent to override instead).
639
639
 
640
640
  ### Fixed
641
- - Async subagent session sharing no longer fails with `ERR_PACKAGE_PATH_NOT_EXPORTED`. The runner tried `require.resolve("@mariozechner/pi-coding-agent/package.json")` to find pi's HTML export module, but pi's `exports` map doesn't include that subpath. The fix resolves the package root in the main pi process by walking up from `process.argv[1]` and passes it to the spawned runner through the config, bypassing `require.resolve` entirely. The Windows CLI resolution fallback in `getPiSpawnCommand` benefits from the same walk-up function.
641
+ - Async subagent session sharing no longer fails with `ERR_PACKAGE_PATH_NOT_EXPORTED`. The runner tried `require.resolve("@bastani/atomic/package.json")` to find pi's HTML export module, but pi's `exports` map doesn't include that subpath. The fix resolves the package root in the main pi process by walking up from `process.argv[1]` and passes it to the spawned runner through the config, bypassing `require.resolve` entirely. The Windows CLI resolution fallback in `getPiSpawnCommand` benefits from the same walk-up function.
642
642
 
643
643
  ## [0.8.5] - 2026-02-16
644
644
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.8.3-0",
3
+ "version": "0.8.4-0",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with chains, parallel execution, and TUI clarification.",
6
6
  "contributors": [
@@ -40,7 +40,6 @@
40
40
  "@bastani/atomic": "*",
41
41
  "@earendil-works/pi-agent-core": "*",
42
42
  "@earendil-works/pi-ai": "*",
43
- "@earendil-works/pi-coding-agent": "*",
44
43
  "@earendil-works/pi-tui": "*"
45
44
  },
46
45
  "peerDependenciesMeta": {
@@ -53,9 +52,6 @@
53
52
  "@earendil-works/pi-ai": {
54
53
  "optional": true
55
54
  },
56
- "@earendil-works/pi-coding-agent": {
57
- "optional": true
58
- },
59
55
  "@earendil-works/pi-tui": {
60
56
  "optional": true
61
57
  }
@@ -2,7 +2,7 @@ import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
  import { CONFIG_DIR_NAME } from "@bastani/atomic";
4
4
  import type { AgentToolResult } from "@earendil-works/pi-agent-core";
5
- import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
5
+ import type { ExtensionContext } from "@bastani/atomic";
6
6
  import {
7
7
  type AgentConfig,
8
8
  type AgentScope,
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
1
+ import type { ExtensionAPI } from "@bastani/atomic";
2
2
  import { controlNotificationKey, formatControlNoticeMessage } from "../runs/shared/subagent-control.ts";
3
3
  import type { ControlEvent, SubagentState } from "../shared/types.ts";
4
4
 
@@ -17,7 +17,7 @@ import * as os from "node:os";
17
17
  import * as path from "node:path";
18
18
  import { getAgentConfigPaths, getEnvValue } from "@bastani/atomic";
19
19
  import type { AgentToolResult } from "@earendil-works/pi-agent-core";
20
- import { type ExtensionAPI, type ExtensionContext, type ToolDefinition } from "@earendil-works/pi-coding-agent";
20
+ import { type ExtensionAPI, type ExtensionContext, type ToolDefinition } from "@bastani/atomic";
21
21
  import { Box, Container, Spacer, Text, truncateToWidth, visibleWidth, wrapTextWithAnsi, type Component } from "@earendil-works/pi-tui";
22
22
  import { discoverAgents } from "../agents/agents.ts";
23
23
  import { cleanupAllArtifactDirs, cleanupOldArtifacts, getArtifactsDir } from "../shared/artifacts.ts";
@@ -8,7 +8,7 @@ import * as os from "node:os";
8
8
  import * as path from "node:path";
9
9
  import { fileURLToPath } from "node:url";
10
10
  import { createRequire } from "node:module";
11
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
11
+ import type { ExtensionAPI } from "@bastani/atomic";
12
12
  import type { AgentConfig } from "../../agents/agents.ts";
13
13
  import { applyThinkingSuffix } from "../shared/pi-args.ts";
14
14
  import { injectSingleOutputInstruction, resolveSingleOutputPath, validateFileOnlyOutputMode } from "../shared/single-output.ts";
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
1
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
2
2
  import * as fs from "node:fs";
3
3
  import * as path from "node:path";
4
4
  import { renderWidget } from "../../tui/render.ts";
@@ -2,7 +2,7 @@
2
2
  * Subagent completion notifications.
3
3
  */
4
4
 
5
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
5
+ import type { ExtensionAPI } from "@bastani/atomic";
6
6
  import { buildCompletionKey, getGlobalSeenMap, markSeenWithTtl } from "./completion-dedupe.ts";
7
7
  import { SUBAGENT_ASYNC_COMPLETE_EVENT } from "../../shared/types.ts";
8
8
 
@@ -5,7 +5,7 @@
5
5
  * Supports runtime editing of templates, output paths, reads lists, and progress toggle.
6
6
  */
7
7
 
8
- import type { Theme } from "@earendil-works/pi-coding-agent";
8
+ import type { Theme } from "@bastani/atomic";
9
9
  import type { Component, TUI } from "@earendil-works/pi-tui";
10
10
  import { matchesKey, visibleWidth, truncateToWidth } from "@earendil-works/pi-tui";
11
11
  import type { AgentConfig } from "../../agents/agents.ts";
@@ -5,7 +5,7 @@
5
5
  import * as fs from "node:fs";
6
6
  import * as path from "node:path";
7
7
  import type { AgentToolResult } from "@earendil-works/pi-agent-core";
8
- import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
8
+ import type { ExtensionContext } from "@bastani/atomic";
9
9
  import type { AgentConfig } from "../../agents/agents.ts";
10
10
  import { ChainClarifyComponent, type ChainClarifyResult, type BehaviorOverride } from "./chain-clarify.ts";
11
11
  import { toModelInfo, type ModelInfo } from "../../shared/model-info.ts";
@@ -2,7 +2,7 @@ import { randomUUID } from "node:crypto";
2
2
  import * as fs from "node:fs";
3
3
  import * as path from "node:path";
4
4
  import type { AgentToolResult } from "@earendil-works/pi-agent-core";
5
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
5
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
6
6
  import { type AgentConfig, type AgentScope } from "../../agents/agents.ts";
7
7
  import { getArtifactsDir } from "../../shared/artifacts.ts";
8
8
  import { ChainClarifyComponent, type ChainClarifyResult } from "./chain-clarify.ts";
@@ -1,8 +1,10 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
+ import { APP_NAME, PACKAGE_NAME } from "@bastani/atomic";
4
5
 
5
- export const PI_CODING_AGENT_PACKAGE = "@earendil-works/pi-coding-agent";
6
+ export const CODING_AGENT_PACKAGE = PACKAGE_NAME;
7
+ export const PI_CODING_AGENT_PACKAGE = CODING_AGENT_PACKAGE;
6
8
 
7
9
  export function findPiPackageRootFromEntry(entryPoint: string): string | undefined {
8
10
  let dir = path.dirname(entryPoint);
@@ -10,7 +12,7 @@ export function findPiPackageRootFromEntry(entryPoint: string): string | undefin
10
12
  const packageJsonPath = path.join(dir, "package.json");
11
13
  if (fs.existsSync(packageJsonPath)) {
12
14
  const pkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8")) as { name?: unknown };
13
- if (pkg.name === PI_CODING_AGENT_PACKAGE) return dir;
15
+ if (pkg.name === CODING_AGENT_PACKAGE) return dir;
14
16
  }
15
17
  dir = path.dirname(dir);
16
18
  }
@@ -18,7 +20,7 @@ export function findPiPackageRootFromEntry(entryPoint: string): string | undefin
18
20
  }
19
21
 
20
22
  export function resolveInstalledPiPackageRoot(): string | undefined {
21
- return findPiPackageRootFromEntry(fileURLToPath(import.meta.resolve(PI_CODING_AGENT_PACKAGE)));
23
+ return findPiPackageRootFromEntry(fileURLToPath(import.meta.resolve(CODING_AGENT_PACKAGE)));
22
24
  }
23
25
 
24
26
  export function resolvePiPackageRoot(): string | undefined {
@@ -56,7 +58,7 @@ function normalizePath(filePath: string): string {
56
58
  return path.isAbsolute(filePath) ? filePath : path.resolve(filePath);
57
59
  }
58
60
 
59
- export function resolveWindowsPiCliScript(deps: PiSpawnDeps = {}): string | undefined {
61
+ export function resolvePiCliScript(deps: PiSpawnDeps = {}): string | undefined {
60
62
  const existsSync = deps.existsSync ?? fs.existsSync;
61
63
  const readFileSync = deps.readFileSync ?? ((filePath, encoding) => fs.readFileSync(filePath, encoding));
62
64
  const argv1 = deps.argv1 ?? process.argv[1];
@@ -75,7 +77,7 @@ export function resolveWindowsPiCliScript(deps: PiSpawnDeps = {}): string | unde
75
77
  const packageRoot = deps.resolvePackageEntry
76
78
  ? findPiPackageRootFromEntry(deps.resolvePackageEntry())
77
79
  : resolveInstalledPiPackageRoot();
78
- if (!packageRoot) throw new Error(`Could not resolve ${PI_CODING_AGENT_PACKAGE} package root`);
80
+ if (!packageRoot) throw new Error(`Could not resolve ${CODING_AGENT_PACKAGE} package root`);
79
81
  return path.join(packageRoot, "package.json");
80
82
  });
81
83
  const packageJsonPath = resolvePackageJson();
@@ -85,31 +87,32 @@ export function resolveWindowsPiCliScript(deps: PiSpawnDeps = {}): string | unde
85
87
  const binField = packageJson.bin;
86
88
  const binPath = typeof binField === "string"
87
89
  ? binField
88
- : binField?.pi ?? Object.values(binField ?? {})[0];
90
+ : binField?.[APP_NAME] ?? binField?.pi ?? Object.values(binField ?? {})[0];
89
91
  if (!binPath) return undefined;
90
92
  const candidate = path.resolve(path.dirname(packageJsonPath), binPath);
91
93
  if (isRunnableNodeScript(candidate, existsSync)) {
92
94
  return candidate;
93
95
  }
94
96
  } catch {
95
- // Windows CLI resolution is optional; falling back to `pi` lets PATH handle execution.
97
+ // CLI script resolution is optional; falling back to the app command lets PATH handle execution.
96
98
  return undefined;
97
99
  }
98
100
 
99
101
  return undefined;
100
102
  }
101
103
 
104
+ export function resolveWindowsPiCliScript(deps: PiSpawnDeps = {}): string | undefined {
105
+ return resolvePiCliScript(deps);
106
+ }
107
+
102
108
  export function getPiSpawnCommand(args: string[], deps: PiSpawnDeps = {}): PiSpawnCommand {
103
- const platform = deps.platform ?? process.platform;
104
- if (platform === "win32") {
105
- const piCliPath = resolveWindowsPiCliScript(deps);
106
- if (piCliPath) {
107
- return {
108
- command: deps.execPath ?? process.execPath,
109
- args: [piCliPath, ...args],
110
- };
111
- }
109
+ const cliPath = resolvePiCliScript(deps);
110
+ if (cliPath) {
111
+ return {
112
+ command: deps.execPath ?? process.execPath,
113
+ args: [cliPath, ...args],
114
+ };
112
115
  }
113
116
 
114
- return { command: "pi", args };
117
+ return { command: APP_NAME, args };
115
118
  }
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
1
+ import type { ExtensionAPI } from "@bastani/atomic";
2
2
  import { APP_NAME, getEnvValue } from "@bastani/atomic";
3
3
 
4
4
  const ENV_PREFIX = APP_NAME.toUpperCase();
@@ -1,5 +1,5 @@
1
1
  import * as fs from "node:fs";
2
- import { SessionManager } from "@earendil-works/pi-coding-agent";
2
+ import { SessionManager } from "@bastani/atomic";
3
3
 
4
4
  type SubagentExecutionContext = "fresh" | "fork";
5
5
 
@@ -6,7 +6,7 @@ import * as os from "node:os";
6
6
  import * as path from "node:path";
7
7
  import type { Message } from "@earendil-works/pi-ai";
8
8
  import type { FSWatcher } from "node:fs";
9
- import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
9
+ import type { ExtensionContext } from "@bastani/atomic";
10
10
  import { APP_NAME, getEnvValue } from "@bastani/atomic";
11
11
 
12
12
  const ENV_PREFIX = APP_NAME.toUpperCase();
@@ -1,5 +1,5 @@
1
1
  import type { AgentToolResult } from "@earendil-works/pi-agent-core";
2
- import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
+ import type { ExtensionContext } from "@bastani/atomic";
3
3
  import type { SubagentParamsLike } from "../runs/foreground/subagent-executor.ts";
4
4
  import {
5
5
  SLASH_SUBAGENT_CANCEL_EVENT,