@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/docs/sdk.md CHANGED
@@ -16,7 +16,7 @@ See [examples/sdk/](../examples/sdk/) for working examples from minimal to full
16
16
  ## Quick Start
17
17
 
18
18
  ```typescript
19
- import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@earendil-works/pi-coding-agent";
19
+ import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@bastani/atomic";
20
20
 
21
21
  // Set up credential storage and model registry
22
22
  const authStorage = AuthStorage.create();
@@ -40,7 +40,7 @@ await session.prompt("What files are in the current directory?");
40
40
  ## Installation
41
41
 
42
42
  ```bash
43
- npm install @earendil-works/pi-coding-agent
43
+ npm install @bastani/atomic
44
44
  ```
45
45
 
46
46
  The SDK is included in the main package. No separate installation needed.
@@ -54,7 +54,7 @@ The main factory function for a single `AgentSession`.
54
54
  `createAgentSession()` uses a `ResourceLoader` to supply extensions, skills, prompt templates, themes, and context files. If you do not provide one, it uses `DefaultResourceLoader` with standard discovery.
55
55
 
56
56
  ```typescript
57
- import { createAgentSession, SessionManager } from "@earendil-works/pi-coding-agent";
57
+ import { createAgentSession, SessionManager } from "@bastani/atomic";
58
58
 
59
59
  // Minimal: defaults with DefaultResourceLoader
60
60
  const { session } = await createAgentSession();
@@ -132,7 +132,7 @@ import {
132
132
  createAgentSessionServices,
133
133
  getAgentDir,
134
134
  SessionManager,
135
- } from "@earendil-works/pi-coding-agent";
135
+ } from "@bastani/atomic";
136
136
 
137
137
  const createRuntime: CreateAgentSessionRuntimeFactory = async ({ cwd, sessionManager, sessionStartEvent }) => {
138
138
  const services = await createAgentSessionServices({ cwd });
@@ -369,7 +369,7 @@ When you pass a custom `ResourceLoader`, `cwd` and `agentDir` no longer control
369
369
 
370
370
  ```typescript
371
371
  import { getModel } from "@earendil-works/pi-ai";
372
- import { AuthStorage, ModelRegistry } from "@earendil-works/pi-coding-agent";
372
+ import { AuthStorage, ModelRegistry } from "@bastani/atomic";
373
373
 
374
374
  const authStorage = AuthStorage.create();
375
375
  const modelRegistry = ModelRegistry.create(authStorage);
@@ -416,7 +416,7 @@ API key resolution priority (handled by AuthStorage):
416
416
  4. Fallback resolver (for custom provider keys from `models.json`)
417
417
 
418
418
  ```typescript
419
- import { AuthStorage, ModelRegistry } from "@earendil-works/pi-coding-agent";
419
+ import { AuthStorage, ModelRegistry } from "@bastani/atomic";
420
420
 
421
421
  // Default: uses ~/.pi/agent/auth.json and ~/.pi/agent/models.json
422
422
  const authStorage = AuthStorage.create();
@@ -452,7 +452,7 @@ const simpleRegistry = ModelRegistry.inMemory(authStorage);
452
452
  Use a `ResourceLoader` to override the system prompt:
453
453
 
454
454
  ```typescript
455
- import { createAgentSession, DefaultResourceLoader } from "@earendil-works/pi-coding-agent";
455
+ import { createAgentSession, DefaultResourceLoader } from "@bastani/atomic";
456
456
 
457
457
  const loader = new DefaultResourceLoader({
458
458
  systemPromptOverride: () => "You are a helpful assistant.",
@@ -474,7 +474,7 @@ Specify which built-in tools to enable:
474
474
  - `noTools: "builtin"` disables default built-ins while keeping extension and custom tools enabled
475
475
 
476
476
  ```typescript
477
- import { createAgentSession } from "@earendil-works/pi-coding-agent";
477
+ import { createAgentSession } from "@bastani/atomic";
478
478
 
479
479
  // Read-only mode
480
480
  const { session } = await createAgentSession({
@@ -492,7 +492,7 @@ const { session } = await createAgentSession({
492
492
  When you pass a custom `cwd`, `createAgentSession()` builds selected built-in tools for that cwd.
493
493
 
494
494
  ```typescript
495
- import { createAgentSession, SessionManager } from "@earendil-works/pi-coding-agent";
495
+ import { createAgentSession, SessionManager } from "@bastani/atomic";
496
496
 
497
497
  const cwd = "/path/to/project";
498
498
 
@@ -516,7 +516,7 @@ const { session } = await createAgentSession({
516
516
 
517
517
  ```typescript
518
518
  import { Type } from "typebox";
519
- import { createAgentSession, defineTool } from "@earendil-works/pi-coding-agent";
519
+ import { createAgentSession, defineTool } from "@bastani/atomic";
520
520
 
521
521
  // Inline custom tool
522
522
  const myTool = defineTool({
@@ -551,7 +551,7 @@ If you pass `tools`, include each custom or extension tool name you want enabled
551
551
  Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.pi/agent/extensions/`, `.pi/extensions/`, and settings.json extension sources.
552
552
 
553
553
  ```typescript
554
- import { createAgentSession, DefaultResourceLoader } from "@earendil-works/pi-coding-agent";
554
+ import { createAgentSession, DefaultResourceLoader } from "@bastani/atomic";
555
555
 
556
556
  const loader = new DefaultResourceLoader({
557
557
  additionalExtensionPaths: ["/path/to/my-extension.ts"],
@@ -573,7 +573,7 @@ Extensions can register tools, subscribe to events, add commands, and more. See
573
573
  **Event Bus:** Extensions can communicate via `pi.events`. Pass a shared `eventBus` to `DefaultResourceLoader` if you need to emit or listen from outside:
574
574
 
575
575
  ```typescript
576
- import { createEventBus, DefaultResourceLoader } from "@earendil-works/pi-coding-agent";
576
+ import { createEventBus, DefaultResourceLoader } from "@bastani/atomic";
577
577
 
578
578
  const eventBus = createEventBus();
579
579
  const loader = new DefaultResourceLoader({
@@ -593,7 +593,7 @@ import {
593
593
  createAgentSession,
594
594
  DefaultResourceLoader,
595
595
  type Skill,
596
- } from "@earendil-works/pi-coding-agent";
596
+ } from "@bastani/atomic";
597
597
 
598
598
  const customSkill: Skill = {
599
599
  name: "my-skill",
@@ -619,7 +619,7 @@ const { session } = await createAgentSession({ resourceLoader: loader });
619
619
  ### Context Files
620
620
 
621
621
  ```typescript
622
- import { createAgentSession, DefaultResourceLoader } from "@earendil-works/pi-coding-agent";
622
+ import { createAgentSession, DefaultResourceLoader } from "@bastani/atomic";
623
623
 
624
624
  const loader = new DefaultResourceLoader({
625
625
  agentsFilesOverride: (current) => ({
@@ -643,7 +643,7 @@ import {
643
643
  createAgentSession,
644
644
  DefaultResourceLoader,
645
645
  type PromptTemplate,
646
- } from "@earendil-works/pi-coding-agent";
646
+ } from "@bastani/atomic";
647
647
 
648
648
  const customCommand: PromptTemplate = {
649
649
  name: "deploy",
@@ -678,7 +678,7 @@ import {
678
678
  createAgentSessionServices,
679
679
  getAgentDir,
680
680
  SessionManager,
681
- } from "@earendil-works/pi-coding-agent";
681
+ } from "@bastani/atomic";
682
682
 
683
683
  // In-memory (no persistence)
684
684
  const { session } = await createAgentSession({
@@ -772,7 +772,7 @@ sm.createBranchedSession(leafId); // Extract path to new file
772
772
  ### Settings Management
773
773
 
774
774
  ```typescript
775
- import { createAgentSession, SettingsManager, SessionManager } from "@earendil-works/pi-coding-agent";
775
+ import { createAgentSession, SettingsManager, SessionManager } from "@bastani/atomic";
776
776
 
777
777
  // Default: loads from files (global + project merged)
778
778
  const { session } = await createAgentSession({
@@ -828,7 +828,7 @@ Use `DefaultResourceLoader` to discover extensions, skills, prompts, themes, and
828
828
  import {
829
829
  DefaultResourceLoader,
830
830
  getAgentDir,
831
- } from "@earendil-works/pi-coding-agent";
831
+ } from "@bastani/atomic";
832
832
 
833
833
  const loader = new DefaultResourceLoader({
834
834
  cwd,
@@ -879,7 +879,7 @@ import {
879
879
  ModelRegistry,
880
880
  SessionManager,
881
881
  SettingsManager,
882
- } from "@earendil-works/pi-coding-agent";
882
+ } from "@bastani/atomic";
883
883
 
884
884
  // Set up auth storage (custom location)
885
885
  const authStorage = AuthStorage.create("/custom/agent/auth.json");
@@ -964,7 +964,7 @@ import {
964
964
  getAgentDir,
965
965
  InteractiveMode,
966
966
  SessionManager,
967
- } from "@earendil-works/pi-coding-agent";
967
+ } from "@bastani/atomic";
968
968
 
969
969
  const createRuntime: CreateAgentSessionRuntimeFactory = async ({ cwd, sessionManager, sessionStartEvent }) => {
970
970
  const services = await createAgentSessionServices({ cwd });
@@ -1004,7 +1004,7 @@ import {
1004
1004
  getAgentDir,
1005
1005
  runPrintMode,
1006
1006
  SessionManager,
1007
- } from "@earendil-works/pi-coding-agent";
1007
+ } from "@bastani/atomic";
1008
1008
 
1009
1009
  const createRuntime: CreateAgentSessionRuntimeFactory = async ({ cwd, sessionManager, sessionStartEvent }) => {
1010
1010
  const services = await createAgentSessionServices({ cwd });
@@ -1041,7 +1041,7 @@ import {
1041
1041
  getAgentDir,
1042
1042
  runRpcMode,
1043
1043
  SessionManager,
1044
- } from "@earendil-works/pi-coding-agent";
1044
+ } from "@bastani/atomic";
1045
1045
 
1046
1046
  const createRuntime: CreateAgentSessionRuntimeFactory = async ({ cwd, sessionManager, sessionStartEvent }) => {
1047
1047
  const services = await createAgentSessionServices({ cwd });
@@ -34,7 +34,7 @@ Source on GitHub ([pi-mono](https://github.com/earendil-works/pi-mono)):
34
34
  - [`packages/ai/src/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
35
35
  - [`packages/agent/src/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/agent/src/types.ts) - AgentMessage union type
36
36
 
37
- For TypeScript definitions in your project, inspect `node_modules/@earendil-works/pi-coding-agent/dist/` and `node_modules/@earendil-works/pi-ai/dist/`.
37
+ For TypeScript definitions in your project, inspect `node_modules/@bastani/atomic/dist/` and `node_modules/@earendil-works/pi-ai/dist/`.
38
38
 
39
39
  ## Message Types
40
40
 
package/docs/termux.md CHANGED
@@ -17,7 +17,7 @@ pkg update && pkg upgrade
17
17
  pkg install nodejs termux-api git
18
18
 
19
19
  # Install pi
20
- npm install -g @earendil-works/pi-coding-agent
20
+ npm install -g @bastani/atomic
21
21
 
22
22
  # Create config directory
23
23
  mkdir -p ~/.pi/agent
package/docs/tui.md CHANGED
@@ -425,7 +425,7 @@ renderResult(result, options, theme, context) {
425
425
  **For Markdown**, use `getMarkdownTheme()`:
426
426
 
427
427
  ```typescript
428
- import { getMarkdownTheme } from "@earendil-works/pi-coding-agent";
428
+ import { getMarkdownTheme } from "@bastani/atomic";
429
429
  import { Markdown } from "@earendil-works/pi-tui";
430
430
 
431
431
  renderResult(result, options, theme, context) {
@@ -590,8 +590,8 @@ These patterns cover the most common UI needs in extensions. **Copy these patter
590
590
  For letting users pick from a list of options. Use `SelectList` from `@earendil-works/pi-tui` with `DynamicBorder` for framing.
591
591
 
592
592
  ```typescript
593
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
594
- import { DynamicBorder } from "@earendil-works/pi-coding-agent";
593
+ import type { ExtensionAPI } from "@bastani/atomic";
594
+ import { DynamicBorder } from "@bastani/atomic";
595
595
  import { Container, type SelectItem, SelectList, Text } from "@earendil-works/pi-tui";
596
596
 
597
597
  pi.registerCommand("pick", {
@@ -650,7 +650,7 @@ pi.registerCommand("pick", {
650
650
  For operations that take time and should be cancellable. `BorderedLoader` shows a spinner and handles escape to cancel.
651
651
 
652
652
  ```typescript
653
- import { BorderedLoader } from "@earendil-works/pi-coding-agent";
653
+ import { BorderedLoader } from "@bastani/atomic";
654
654
 
655
655
  pi.registerCommand("fetch", {
656
656
  handler: async (_args, ctx) => {
@@ -682,7 +682,7 @@ pi.registerCommand("fetch", {
682
682
  For toggling multiple settings. Use `SettingsList` from `@earendil-works/pi-tui` with `getSettingsListTheme()`.
683
683
 
684
684
  ```typescript
685
- import { getSettingsListTheme } from "@earendil-works/pi-coding-agent";
685
+ import { getSettingsListTheme } from "@bastani/atomic";
686
686
  import { Container, type SettingItem, SettingsList, Text } from "@earendil-works/pi-tui";
687
687
 
688
688
  pi.registerCommand("settings", {
@@ -822,7 +822,7 @@ Token stats available via `ctx.sessionManager.getBranch()` and `ctx.model`.
822
822
  Replace the main input editor with a custom implementation. Useful for modal editing (vim), different keybindings (emacs), or specialized input handling.
823
823
 
824
824
  ```typescript
825
- import { CustomEditor, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
825
+ import { CustomEditor, type ExtensionAPI } from "@bastani/atomic";
826
826
  import { matchesKey, truncateToWidth } from "@earendil-works/pi-tui";
827
827
 
828
828
  type Mode = "normal" | "insert";
@@ -137,7 +137,7 @@ cp permission-gate.ts ~/.pi/agent/extensions/
137
137
  See [docs/extensions.md](../../docs/extensions.md) for full documentation.
138
138
 
139
139
  ```typescript
140
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
140
+ import type { ExtensionAPI } from "@bastani/atomic";
141
141
  import { Type } from "typebox";
142
142
 
143
143
  export default function (pi: ExtensionAPI) {
@@ -5,7 +5,7 @@
5
5
  * Uses the last assistant message to generate a commit message.
6
6
  */
7
7
 
8
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
8
+ import type { ExtensionAPI } from "@bastani/atomic";
9
9
 
10
10
  export default function (pi: ExtensionAPI) {
11
11
  pi.on("session_shutdown", async (_event, ctx) => {
@@ -7,8 +7,8 @@
7
7
  * pi -e ./bash-spawn-hook.ts
8
8
  */
9
9
 
10
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
11
- import { createBashTool } from "@earendil-works/pi-coding-agent";
10
+ import type { ExtensionAPI } from "@bastani/atomic";
11
+ import { createBashTool } from "@bastani/atomic";
12
12
 
13
13
  export default function (pi: ExtensionAPI) {
14
14
  const cwd = process.cwd();
@@ -7,7 +7,7 @@
7
7
  * Usage: /bookmark [label] - bookmark the last assistant message
8
8
  */
9
9
 
10
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
10
+ import type { ExtensionAPI } from "@bastani/atomic";
11
11
 
12
12
  export default function (pi: ExtensionAPI) {
13
13
  pi.registerCommand("bookmark", {
@@ -3,7 +3,7 @@ import {
3
3
  type ExtensionAPI,
4
4
  type ExtensionContext,
5
5
  type KeybindingsManager,
6
- } from "@earendil-works/pi-coding-agent";
6
+ } from "@bastani/atomic";
7
7
  import type { Component, EditorTheme, TUI } from "@earendil-works/pi-tui";
8
8
  import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
9
9
 
@@ -25,8 +25,8 @@
25
25
  * pi -e ./built-in-tool-renderer.ts
26
26
  */
27
27
 
28
- import type { BashToolDetails, EditToolDetails, ExtensionAPI, ReadToolDetails } from "@earendil-works/pi-coding-agent";
29
- import { createBashTool, createEditTool, createReadTool, createWriteTool } from "@earendil-works/pi-coding-agent";
28
+ import type { BashToolDetails, EditToolDetails, ExtensionAPI, ReadToolDetails } from "@bastani/atomic";
29
+ import { createBashTool, createEditTool, createReadTool, createWriteTool } from "@bastani/atomic";
30
30
  import { Text } from "@earendil-works/pi-tui";
31
31
 
32
32
  export default function (pi: ExtensionAPI) {
@@ -19,7 +19,7 @@
19
19
 
20
20
  import * as fs from "node:fs";
21
21
  import * as path from "node:path";
22
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
22
+ import type { ExtensionAPI } from "@bastani/atomic";
23
23
 
24
24
  /**
25
25
  * Recursively find all .md files in a directory
@@ -10,7 +10,7 @@
10
10
  * 3. Use /commands extensions to filter by source
11
11
  */
12
12
 
13
- import type { ExtensionAPI, SlashCommandInfo } from "@earendil-works/pi-coding-agent";
13
+ import type { ExtensionAPI, SlashCommandInfo } from "@bastani/atomic";
14
14
 
15
15
  export default function commandsExtension(pi: ExtensionAPI) {
16
16
  pi.registerCommand("commands", {
@@ -5,7 +5,7 @@
5
5
  * Demonstrates how to cancel session events using the before_* events.
6
6
  */
7
7
 
8
- import type { ExtensionAPI, SessionBeforeSwitchEvent, SessionMessageEntry } from "@earendil-works/pi-coding-agent";
8
+ import type { ExtensionAPI, SessionBeforeSwitchEvent, SessionMessageEntry } from "@bastani/atomic";
9
9
 
10
10
  export default function (pi: ExtensionAPI) {
11
11
  pi.on("session_before_switch", async (event: SessionBeforeSwitchEvent, ctx) => {
@@ -14,8 +14,8 @@
14
14
  */
15
15
 
16
16
  import { complete } from "@earendil-works/pi-ai";
17
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
18
- import { convertToLlm, serializeConversation } from "@earendil-works/pi-coding-agent";
17
+ import type { ExtensionAPI } from "@bastani/atomic";
18
+ import { convertToLlm, serializeConversation } from "@bastani/atomic";
19
19
 
20
20
  export default function (pi: ExtensionAPI) {
21
21
  pi.on("session_before_compact", async (event, ctx) => {
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import type { AssistantMessage } from "@earendil-works/pi-ai";
12
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
12
+ import type { ExtensionAPI } from "@bastani/atomic";
13
13
  import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
14
14
 
15
15
  export default function (pi: ExtensionAPI) {
@@ -5,8 +5,8 @@
5
5
  * (logo + keybinding hints) with a custom component showing the pi mascot.
6
6
  */
7
7
 
8
- import type { ExtensionAPI, Theme } from "@earendil-works/pi-coding-agent";
9
- import { VERSION } from "@earendil-works/pi-coding-agent";
8
+ import type { ExtensionAPI, Theme } from "@bastani/atomic";
9
+ import { VERSION } from "@bastani/atomic";
10
10
 
11
11
  // --- PI MASCOT ---
12
12
  // Based on pi_mascot.ts - the pi agent character
@@ -43,7 +43,7 @@ import {
43
43
  type ToolCall,
44
44
  type ToolResultMessage,
45
45
  } from "@earendil-works/pi-ai";
46
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
46
+ import type { ExtensionAPI } from "@bastani/atomic";
47
47
 
48
48
  // =============================================================================
49
49
  // OAuth Implementation (copied from packages/ai/src/utils/oauth/anthropic.ts)
@@ -21,7 +21,7 @@ import {
21
21
  streamSimpleAnthropic,
22
22
  streamSimpleOpenAIResponses,
23
23
  } from "@earendil-works/pi-ai";
24
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
24
+ import type { ExtensionAPI } from "@bastani/atomic";
25
25
 
26
26
  // =============================================================================
27
27
  // Constants
@@ -5,7 +5,7 @@
5
5
  * Useful to ensure work is committed before switching context.
6
6
  */
7
7
 
8
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
8
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
9
9
 
10
10
  async function checkDirtyRepo(
11
11
  pi: ExtensionAPI,
@@ -9,7 +9,7 @@
9
9
  * This demonstrates that overlays can handle real-time game rendering at 35 FPS.
10
10
  */
11
11
 
12
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
12
+ import type { ExtensionAPI } from "@bastani/atomic";
13
13
  import { DoomOverlayComponent } from "./doom-component.js";
14
14
  import { DoomEngine } from "./doom-engine.js";
15
15
  import { ensureWadFile } from "./wad-finder.js";
@@ -1,6 +1,6 @@
1
1
  import { dirname, join } from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
3
+ import type { ExtensionAPI } from "@bastani/atomic";
4
4
 
5
5
  const baseDir = dirname(fileURLToPath(import.meta.url));
6
6
 
@@ -7,7 +7,7 @@
7
7
  * - Registers additional tools at runtime via /add-echo-tool <name>
8
8
  */
9
9
 
10
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
10
+ import type { ExtensionAPI } from "@bastani/atomic";
11
11
  import { Type } from "typebox";
12
12
 
13
13
  const ECHO_PARAMS = Type.Object({
@@ -7,7 +7,7 @@
7
7
  * Usage: /emit [event-name] [data] - emit an event on the bus
8
8
  */
9
9
 
10
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
10
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
11
11
 
12
12
  export default function (pi: ExtensionAPI) {
13
13
  // Store ctx for use in event handler
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import * as fs from "node:fs";
12
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
12
+ import type { ExtensionAPI } from "@bastani/atomic";
13
13
 
14
14
  export default function (pi: ExtensionAPI) {
15
15
  pi.on("session_start", async (_event, ctx) => {
@@ -5,7 +5,7 @@
5
5
  * When forking, offers to restore code to that point in history.
6
6
  */
7
7
 
8
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
8
+ import type { ExtensionAPI } from "@bastani/atomic";
9
9
 
10
10
  export default function (pi: ExtensionAPI) {
11
11
  const checkpoints = new Map<string, string>();
@@ -1,7 +1,7 @@
1
1
  // Requires GitHub CLI (`gh`) and a GitHub repository checkout.
2
2
  // Preloads the latest open issues once per session, then filters them locally for fast `#...` completion.
3
3
 
4
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
4
+ import type { ExtensionAPI } from "@bastani/atomic";
5
5
  import {
6
6
  type AutocompleteItem,
7
7
  type AutocompleteProvider,
@@ -14,8 +14,8 @@
14
14
 
15
15
  import type { AgentMessage } from "@earendil-works/pi-agent-core";
16
16
  import { complete, type Message } from "@earendil-works/pi-ai";
17
- import type { ExtensionAPI, SessionEntry } from "@earendil-works/pi-coding-agent";
18
- import { BorderedLoader, convertToLlm, serializeConversation } from "@earendil-works/pi-coding-agent";
17
+ import type { ExtensionAPI, SessionEntry } from "@bastani/atomic";
18
+ import { BorderedLoader, convertToLlm, serializeConversation } from "@bastani/atomic";
19
19
 
20
20
  const SYSTEM_PROMPT = `You are a context transfer assistant. Given a conversation history and the user's goal for a new thread, generate a focused prompt that:
21
21
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { Type } from "@earendil-works/pi-ai";
6
- import { defineTool, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
6
+ import { defineTool, type ExtensionAPI } from "@bastani/atomic";
7
7
 
8
8
  const helloTool = defineTool({
9
9
  name: "hello",
@@ -18,7 +18,7 @@
18
18
  * /thinking-label Reset to the default label
19
19
  */
20
20
 
21
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
21
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
22
22
 
23
23
  const DEFAULT_LABEL = "Pondering...";
24
24
 
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * Note: Regular !command syntax (whole-line bash) is preserved and works as before.
16
16
  */
17
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
17
+ import type { ExtensionAPI } from "@bastani/atomic";
18
18
 
19
19
  export default function (pi: ExtensionAPI) {
20
20
  const PATTERN = /!\{([^}]+)\}/g;
@@ -9,7 +9,7 @@
9
9
  * ping → "pong" (instant, no LLM)
10
10
  * time → current time (instant, no LLM)
11
11
  */
12
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
12
+ import type { ExtensionAPI } from "@bastani/atomic";
13
13
 
14
14
  export default function (pi: ExtensionAPI) {
15
15
  pi.on("input", async (event, ctx) => {
@@ -21,7 +21,7 @@
21
21
  */
22
22
 
23
23
  import { spawnSync } from "node:child_process";
24
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
24
+ import type { ExtensionAPI } from "@bastani/atomic";
25
25
 
26
26
  // Default interactive commands - editors, pagers, git ops, TUIs
27
27
  const DEFAULT_INTERACTIVE_COMMANDS = [
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { exec } from "node:child_process";
9
9
  import { promisify } from "node:util";
10
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
10
+ import type { ExtensionAPI } from "@bastani/atomic";
11
11
 
12
12
  const execAsync = promisify(exec);
13
13
 
@@ -7,7 +7,7 @@
7
7
  * Usage: /status [message] - sends a status message with custom rendering
8
8
  */
9
9
 
10
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
10
+ import type { ExtensionAPI } from "@bastani/atomic";
11
11
  import { Box, Text } from "@earendil-works/pi-tui";
12
12
 
13
13
  export default function (pi: ExtensionAPI) {
@@ -16,7 +16,7 @@
16
16
  * Then use ctrl+o to toggle between minimal (collapsed) and full (expanded) views.
17
17
  */
18
18
 
19
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
19
+ import type { ExtensionAPI } from "@bastani/atomic";
20
20
  import {
21
21
  createBashTool,
22
22
  createEditTool,
@@ -25,7 +25,7 @@ import {
25
25
  createLsTool,
26
26
  createReadTool,
27
27
  createWriteTool,
28
- } from "@earendil-works/pi-coding-agent";
28
+ } from "@bastani/atomic";
29
29
  import { Text } from "@earendil-works/pi-tui";
30
30
  import { homedir } from "os";
31
31
 
@@ -9,7 +9,7 @@
9
9
  * - ctrl+c, ctrl+d, etc. work in both modes
10
10
  */
11
11
 
12
- import { CustomEditor, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
12
+ import { CustomEditor, type ExtensionAPI } from "@bastani/atomic";
13
13
  import { matchesKey, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
14
14
 
15
15
  // Normal mode key mappings: key -> escape sequence (or null for mode switch)
@@ -7,7 +7,7 @@
7
7
  * Usage: pi -e ./model-status.ts
8
8
  */
9
9
 
10
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
10
+ import type { ExtensionAPI } from "@bastani/atomic";
11
11
 
12
12
  export default function (pi: ExtensionAPI) {
13
13
  pi.on("model_select", async (event, ctx) => {
@@ -8,7 +8,7 @@
8
8
  * - Windows toast: Windows Terminal (WSL)
9
9
  */
10
10
 
11
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
11
+ import type { ExtensionAPI } from "@bastani/atomic";
12
12
 
13
13
  function windowsToastScript(title: string, body: string): string {
14
14
  const type = "Windows.UI.Notifications";
@@ -19,7 +19,7 @@
19
19
  * /overlay-streaming - Multiple input panels with simulated streaming (Tab to cycle focus)
20
20
  */
21
21
 
22
- import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@earendil-works/pi-coding-agent";
22
+ import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@bastani/atomic";
23
23
  import type { Component, OverlayAnchor, OverlayHandle, OverlayOptions, TUI } from "@earendil-works/pi-tui";
24
24
  import { matchesKey, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
25
25
  import { spawn } from "child_process";