@bastani/atomic 0.8.3 → 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 +27 -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
@@ -8,7 +8,7 @@
8
8
  * - Edge case tests (wide chars, styled text, emoji)
9
9
  */
10
10
 
11
- import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@earendil-works/pi-coding-agent";
11
+ import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@bastani/atomic";
12
12
  import { CURSOR_MARKER, type Focusable, matchesKey, visibleWidth } from "@earendil-works/pi-tui";
13
13
 
14
14
  export default function (pi: ExtensionAPI) {
@@ -5,7 +5,7 @@
5
5
  * Patterns checked: rm -rf, sudo, chmod/chown 777
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 dangerousPatterns = [/\brm\s+(-rf?|--recursive)/i, /\bsudo\b/i, /\b(chmod|chown)\b.*777/i];
@@ -10,7 +10,7 @@
10
10
  * 3. When enabled, the agent will respond like a pirate
11
11
  */
12
12
 
13
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
13
+ import type { ExtensionAPI } from "@bastani/atomic";
14
14
 
15
15
  export default function pirateExtension(pi: ExtensionAPI) {
16
16
  let pirateMode = false;
@@ -14,7 +14,7 @@
14
14
 
15
15
  import type { AgentMessage } from "@earendil-works/pi-agent-core";
16
16
  import type { AssistantMessage, TextContent } from "@earendil-works/pi-ai";
17
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
17
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
18
18
  import { Key } from "@earendil-works/pi-tui";
19
19
  import { extractTodoItems, isSafeCommand, markCompletedSteps, type TodoItem } from "./utils.js";
20
20
 
@@ -41,8 +41,8 @@
41
41
  import { existsSync, readFileSync } from "node:fs";
42
42
  import { join } from "node:path";
43
43
  import type { Api, Model } from "@earendil-works/pi-ai";
44
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
45
- import { DynamicBorder, getAgentDir } from "@earendil-works/pi-coding-agent";
44
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
45
+ import { DynamicBorder, getAgentDir } from "@bastani/atomic";
46
46
  import { Container, Key, type SelectItem, SelectList, Text } from "@earendil-works/pi-tui";
47
47
 
48
48
  // Preset configuration
@@ -12,7 +12,7 @@
12
12
  * 2. Use the extension — it automatically adapts to your active tools and skills
13
13
  */
14
14
 
15
- import type { BuildSystemPromptOptions, ExtensionAPI } from "@earendil-works/pi-coding-agent";
15
+ import type { BuildSystemPromptOptions, ExtensionAPI } from "@bastani/atomic";
16
16
 
17
17
  /**
18
18
  * Adds tool-specific guidance that adapts to the active tool set.
@@ -5,7 +5,7 @@
5
5
  * Useful for preventing accidental modifications to sensitive files.
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 protectedPaths = [".env", ".git/", "node_modules/"];
@@ -1,6 +1,6 @@
1
1
  import { appendFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
3
+ import type { ExtensionAPI } from "@bastani/atomic";
4
4
 
5
5
  export default function (pi: ExtensionAPI) {
6
6
  const logFile = join(process.cwd(), ".pi", "provider-payload.log");
@@ -8,8 +8,8 @@
8
8
  */
9
9
 
10
10
  import { complete, type UserMessage } from "@earendil-works/pi-ai";
11
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
12
- import { BorderedLoader } from "@earendil-works/pi-coding-agent";
11
+ import type { ExtensionAPI } from "@bastani/atomic";
12
+ import { BorderedLoader } from "@bastani/atomic";
13
13
 
14
14
  const SYSTEM_PROMPT = `You are a question extractor. Given text from a conversation, extract any questions that need answering and format them for the user to fill in.
15
15
 
@@ -4,7 +4,7 @@
4
4
  * Escape in editor returns to options, Escape in options cancels
5
5
  */
6
6
 
7
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
7
+ import type { ExtensionAPI } from "@bastani/atomic";
8
8
  import { Editor, type EditorTheme, Key, matchesKey, Text, truncateToWidth } from "@earendil-works/pi-tui";
9
9
  import { Type } from "typebox";
10
10
 
@@ -5,7 +5,7 @@
5
5
  * Multiple questions: tab bar navigation between questions
6
6
  */
7
7
 
8
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
8
+ import type { ExtensionAPI } from "@bastani/atomic";
9
9
  import { Editor, type EditorTheme, Key, matchesKey, Text, truncateToWidth } from "@earendil-works/pi-tui";
10
10
  import { Type } from "typebox";
11
11
 
@@ -4,7 +4,7 @@
4
4
  * Usage: pi --extension ./examples/extensions/rainbow-editor.ts
5
5
  */
6
6
 
7
- import { CustomEditor, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
7
+ import { CustomEditor, type ExtensionAPI } from "@bastani/atomic";
8
8
 
9
9
  // Base colors (coral → yellow → green → teal → blue → purple → pink)
10
10
  const COLORS: [number, number, number][] = [
@@ -5,7 +5,7 @@
5
5
  * tool that queues a follow-up command to trigger reload.
6
6
  */
7
7
 
8
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
8
+ import type { ExtensionAPI } from "@bastani/atomic";
9
9
  import { Type } from "typebox";
10
10
 
11
11
  export default function (pi: ExtensionAPI) {
@@ -17,7 +17,7 @@
17
17
  * - setEditorText() - via /rpc-prefill command
18
18
  */
19
19
 
20
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
20
+ import type { ExtensionAPI } from "@bastani/atomic";
21
21
 
22
22
  export default function (pi: ExtensionAPI) {
23
23
  let turnCount = 0;
@@ -45,8 +45,8 @@ import { spawn } from "node:child_process";
45
45
  import { existsSync, readFileSync } from "node:fs";
46
46
  import { join } from "node:path";
47
47
  import { SandboxManager, type SandboxRuntimeConfig } from "@anthropic-ai/sandbox-runtime";
48
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
49
- import { type BashOperations, createBashTool, getAgentDir } from "@earendil-works/pi-coding-agent";
48
+ import type { ExtensionAPI } from "@bastani/atomic";
49
+ import { type BashOperations, createBashTool, getAgentDir } from "@bastani/atomic";
50
50
 
51
51
  interface SandboxConfig extends SandboxRuntimeConfig {
52
52
  enabled?: boolean;
@@ -11,7 +11,7 @@
11
11
  * /followup And then? - Sends while streaming with followUp delivery
12
12
  */
13
13
 
14
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
14
+ import type { ExtensionAPI } from "@bastani/atomic";
15
15
 
16
16
  export default function (pi: ExtensionAPI) {
17
17
  // Simple command that sends a user message
@@ -7,7 +7,7 @@
7
7
  * Usage: /session-name [name] - set or show session name
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("session-name", {
@@ -5,7 +5,7 @@
5
5
  * Demonstrates how extensions can use ctx.shutdown() to exit pi cleanly.
6
6
  */
7
7
 
8
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
8
+ import type { ExtensionAPI } from "@bastani/atomic";
9
9
  import { Type } from "typebox";
10
10
 
11
11
  export default function (pi: ExtensionAPI) {
@@ -2,7 +2,7 @@
2
2
  * Snake game extension - play snake with /snake command
3
3
  */
4
4
 
5
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
5
+ import type { ExtensionAPI } from "@bastani/atomic";
6
6
  import { matchesKey, visibleWidth } from "@earendil-works/pi-tui";
7
7
 
8
8
  const GAME_WIDTH = 40;
@@ -3,7 +3,7 @@
3
3
  * Uses Kitty keyboard protocol for smooth movement (press/release detection)
4
4
  */
5
5
 
6
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
6
+ import type { ExtensionAPI } from "@bastani/atomic";
7
7
  import { isKeyRelease, Key, matchesKey, visibleWidth } from "@earendil-works/pi-tui";
8
8
 
9
9
  const GAME_WIDTH = 60;
@@ -14,7 +14,7 @@
14
14
  */
15
15
 
16
16
  import { spawn } from "node:child_process";
17
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
17
+ import type { ExtensionAPI } from "@bastani/atomic";
18
18
  import {
19
19
  type BashOperations,
20
20
  createBashTool,
@@ -24,7 +24,7 @@ import {
24
24
  type EditOperations,
25
25
  type ReadOperations,
26
26
  type WriteOperations,
27
- } from "@earendil-works/pi-coding-agent";
27
+ } from "@bastani/atomic";
28
28
 
29
29
  function sshExec(remote: string, command: string): Promise<Buffer> {
30
30
  return new Promise((resolve, reject) => {
@@ -5,7 +5,7 @@
5
5
  * Shows turn progress with themed colors.
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
  let turnCount = 0;
@@ -5,7 +5,7 @@
5
5
  * without paying for an extra follow-up LLM turn.
6
6
  */
7
7
 
8
- import { defineTool, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
8
+ import { defineTool, type ExtensionAPI } from "@bastani/atomic";
9
9
  import { Text } from "@earendil-works/pi-tui";
10
10
  import { Type } from "typebox";
11
11
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as fs from "node:fs";
6
6
  import * as path from "node:path";
7
- import { getAgentDir, parseFrontmatter } from "@earendil-works/pi-coding-agent";
7
+ import { getAgentDir, parseFrontmatter } from "@bastani/atomic";
8
8
 
9
9
  export type AgentScope = "user" | "project" | "both";
10
10
 
@@ -19,7 +19,7 @@ import * as path from "node:path";
19
19
  import type { AgentToolResult } from "@earendil-works/pi-agent-core";
20
20
  import type { Message } from "@earendil-works/pi-ai";
21
21
  import { StringEnum } from "@earendil-works/pi-ai";
22
- import { type ExtensionAPI, getMarkdownTheme, withFileMutationQueue } from "@earendil-works/pi-coding-agent";
22
+ import { type ExtensionAPI, getMarkdownTheme, withFileMutationQueue } from "@bastani/atomic";
23
23
  import { Container, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
24
24
  import { Type } from "typebox";
25
25
  import { type AgentConfig, type AgentScope, discoverAgents } from "./agents.js";
@@ -1,6 +1,6 @@
1
1
  import { complete, getModel } from "@earendil-works/pi-ai";
2
- import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
3
- import { DynamicBorder, getMarkdownTheme } from "@earendil-works/pi-coding-agent";
2
+ import type { ExtensionAPI, ExtensionCommandContext } from "@bastani/atomic";
3
+ import { DynamicBorder, getMarkdownTheme } from "@bastani/atomic";
4
4
  import { Container, Markdown, matchesKey, Text } from "@earendil-works/pi-tui";
5
5
 
6
6
  type ContentBlock = {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Demonstrates ctx.getSystemPrompt() for accessing the effective system prompt.
5
5
  */
6
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
6
+ import type { ExtensionAPI } from "@bastani/atomic";
7
7
 
8
8
  export default function (pi: ExtensionAPI) {
9
9
  pi.on("agent_start", (_event, ctx) => {
@@ -18,7 +18,7 @@
18
18
  */
19
19
 
20
20
  import { StringEnum } from "@earendil-works/pi-ai";
21
- import type { ExtensionAPI, ExtensionContext, Theme, ToolExecutionMode } from "@earendil-works/pi-coding-agent";
21
+ import type { ExtensionAPI, ExtensionContext, Theme, ToolExecutionMode } from "@bastani/atomic";
22
22
  import { type Component, matchesKey, Text, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
23
23
  import { Type } from "typebox";
24
24
 
@@ -7,7 +7,7 @@
7
7
  * - /timed-signal - Shows confirm using AbortSignal (manual approach)
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
  // Simple approach: use timeout option (recommended)
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import path from "node:path";
12
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
12
+ import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
13
13
 
14
14
  const BRAILLE_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
15
15
 
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  import { StringEnum } from "@earendil-works/pi-ai";
14
- import type { ExtensionAPI, ExtensionContext, Theme } from "@earendil-works/pi-coding-agent";
14
+ import type { ExtensionAPI, ExtensionContext, Theme } from "@bastani/atomic";
15
15
  import { matchesKey, Text, truncateToWidth } from "@earendil-works/pi-tui";
16
16
  import { Type } from "typebox";
17
17
 
@@ -21,7 +21,7 @@
21
21
  */
22
22
 
23
23
  import type { TextContent } from "@earendil-works/pi-ai";
24
- import { type ExtensionAPI, getAgentDir, withFileMutationQueue } from "@earendil-works/pi-coding-agent";
24
+ import { type ExtensionAPI, getAgentDir, withFileMutationQueue } from "@bastani/atomic";
25
25
  import { constants, readFileSync } from "fs";
26
26
  import { access, appendFile, readFile } from "fs/promises";
27
27
  import { join, resolve } from "path";
@@ -9,8 +9,8 @@
9
9
  * 2. Use /tools to open the tool selector
10
10
  */
11
11
 
12
- import type { ExtensionAPI, ExtensionContext, ToolInfo } from "@earendil-works/pi-coding-agent";
13
- import { getSettingsListTheme } from "@earendil-works/pi-coding-agent";
12
+ import type { ExtensionAPI, ExtensionContext, ToolInfo } from "@bastani/atomic";
13
+ import { getSettingsListTheme } from "@bastani/atomic";
14
14
  import { Container, type SettingItem, SettingsList } from "@earendil-works/pi-tui";
15
15
 
16
16
  // State persisted to session
@@ -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
 
3
3
  const COMPACT_THRESHOLD_TOKENS = 100_000;
4
4
 
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { mkdtemp, writeFile } from "node:fs/promises";
18
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
18
+ import type { ExtensionAPI } from "@bastani/atomic";
19
19
  import {
20
20
  DEFAULT_MAX_BYTES,
21
21
  DEFAULT_MAX_LINES,
@@ -23,7 +23,7 @@ import {
23
23
  type TruncationResult,
24
24
  truncateHead,
25
25
  withFileMutationQueue,
26
- } from "@earendil-works/pi-coding-agent";
26
+ } from "@bastani/atomic";
27
27
  import { Text } from "@earendil-works/pi-tui";
28
28
  import { execSync } from "child_process";
29
29
  import { tmpdir } from "os";
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
1
+ import type { ExtensionAPI } from "@bastani/atomic";
2
2
 
3
3
  export default function widgetPlacementExtension(pi: ExtensionAPI) {
4
4
  pi.on("session_start", (_event, ctx) => {
@@ -5,7 +5,7 @@
5
5
  * Requires: npm install in this directory
6
6
  */
7
7
 
8
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
8
+ import type { ExtensionAPI } from "@bastani/atomic";
9
9
  import ms from "ms";
10
10
  import { Type } from "typebox";
11
11
 
@@ -16,7 +16,7 @@
16
16
  * /working-indicator reset Restore pi's default spinner
17
17
  */
18
18
 
19
- import type { ExtensionAPI, ExtensionContext, WorkingIndicatorOptions } from "@earendil-works/pi-coding-agent";
19
+ import type { ExtensionAPI, ExtensionContext, WorkingIndicatorOptions } from "@bastani/atomic";
20
20
 
21
21
  type WorkingIndicatorMode = "dot" | "none" | "pulse" | "spinner" | "default";
22
22
 
@@ -12,7 +12,7 @@
12
12
  * loader appears, not revert to the default gray "Working...".
13
13
  */
14
14
 
15
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
15
+ import type { ExtensionAPI } from "@bastani/atomic";
16
16
 
17
17
  const CUSTOM_MESSAGE = "\x1b[38;2;155;86;63mWorking... (custom)\x1b[39m";
18
18
  const CUSTOM_INDICATOR = { frames: ["\x1b[38;2;155;86;63m●\x1b[39m"] };
@@ -5,7 +5,7 @@
5
5
  * from cwd and ~/.pi/agent. Model chosen from settings or first available.
6
6
  */
7
7
 
8
- import { createAgentSession } from "@earendil-works/pi-coding-agent";
8
+ import { createAgentSession } from "@bastani/atomic";
9
9
 
10
10
  const { session } = await createAgentSession();
11
11
 
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { getModel } from "@earendil-works/pi-ai";
8
- import { AuthStorage, createAgentSession, ModelRegistry } from "@earendil-works/pi-coding-agent";
8
+ import { AuthStorage, createAgentSession, ModelRegistry } from "@bastani/atomic";
9
9
 
10
10
  // Set up auth storage and model registry
11
11
  const authStorage = AuthStorage.create();
@@ -9,7 +9,7 @@ import {
9
9
  DefaultResourceLoader,
10
10
  getAgentDir,
11
11
  SessionManager,
12
- } from "@earendil-works/pi-coding-agent";
12
+ } from "@bastani/atomic";
13
13
 
14
14
  const cwd = process.cwd();
15
15
  const agentDir = getAgentDir();
@@ -12,7 +12,7 @@ import {
12
12
  getAgentDir,
13
13
  SessionManager,
14
14
  type Skill,
15
- } from "@earendil-works/pi-coding-agent";
15
+ } from "@bastani/atomic";
16
16
 
17
17
  // Or define custom skills inline
18
18
  const customSkill: Skill = {
@@ -10,7 +10,7 @@
10
10
  * extensions system using pi.registerTool().
11
11
  */
12
12
 
13
- import { createAgentSession, SessionManager } from "@earendil-works/pi-coding-agent";
13
+ import { createAgentSession, SessionManager } from "@bastani/atomic";
14
14
 
15
15
  // Read-only mode (no edit/write)
16
16
  const { session: readOnlySession } = await createAgentSession({
@@ -18,7 +18,7 @@ import {
18
18
  DefaultResourceLoader,
19
19
  getAgentDir,
20
20
  SessionManager,
21
- } from "@earendil-works/pi-coding-agent";
21
+ } from "@bastani/atomic";
22
22
 
23
23
  // Extensions are discovered automatically from standard locations.
24
24
  // You can also add paths via settings.json or DefaultResourceLoader options.
@@ -57,7 +57,7 @@ try {
57
57
 
58
58
  // Example extension file (./my-logging-extension.ts):
59
59
  /*
60
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
60
+ import type { ExtensionAPI } from "@bastani/atomic";
61
61
 
62
62
  export default function (pi: ExtensionAPI) {
63
63
  pi.on("agent_start", async () => {
@@ -9,7 +9,7 @@ import {
9
9
  DefaultResourceLoader,
10
10
  getAgentDir,
11
11
  SessionManager,
12
- } from "@earendil-works/pi-coding-agent";
12
+ } from "@bastani/atomic";
13
13
 
14
14
  // Disable context files entirely by returning an empty list in agentsFilesOverride.
15
15
  const loader = new DefaultResourceLoader({
@@ -11,7 +11,7 @@ import {
11
11
  getAgentDir,
12
12
  type PromptTemplate,
13
13
  SessionManager,
14
- } from "@earendil-works/pi-coding-agent";
14
+ } from "@bastani/atomic";
15
15
 
16
16
  // Define custom templates
17
17
  const deployTemplate: PromptTemplate = {
@@ -4,7 +4,7 @@
4
4
  * Configure API key resolution via AuthStorage and ModelRegistry.
5
5
  */
6
6
 
7
- import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@earendil-works/pi-coding-agent";
7
+ import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@bastani/atomic";
8
8
 
9
9
  // Default: AuthStorage uses ~/.pi/agent/auth.json
10
10
  // ModelRegistry loads built-in + custom models from ~/.pi/agent/models.json
@@ -4,7 +4,7 @@
4
4
  * Override settings using SettingsManager.
5
5
  */
6
6
 
7
- import { createAgentSession, SessionManager, SettingsManager } from "@earendil-works/pi-coding-agent";
7
+ import { createAgentSession, SessionManager, SettingsManager } from "@bastani/atomic";
8
8
 
9
9
  const cwd = process.cwd();
10
10
 
@@ -4,7 +4,7 @@
4
4
  * Control session persistence: in-memory, new file, continue, or open specific.
5
5
  */
6
6
 
7
- import { createAgentSession, SessionManager } from "@earendil-works/pi-coding-agent";
7
+ import { createAgentSession, SessionManager } from "@bastani/atomic";
8
8
 
9
9
  // In-memory (no persistence)
10
10
  const { session: inMemory } = await createAgentSession({
@@ -13,7 +13,7 @@ import {
13
13
  type ResourceLoader,
14
14
  SessionManager,
15
15
  SettingsManager,
16
- } from "@earendil-works/pi-coding-agent";
16
+ } from "@bastani/atomic";
17
17
 
18
18
  // Custom auth storage location
19
19
  const authStorage = AuthStorage.create("/tmp/my-agent/auth.json");
@@ -15,7 +15,7 @@ import {
15
15
  createAgentSessionServices,
16
16
  getAgentDir,
17
17
  SessionManager,
18
- } from "@earendil-works/pi-coding-agent";
18
+ } from "@bastani/atomic";
19
19
 
20
20
  const createRuntime: CreateAgentSessionRuntimeFactory = async ({ cwd, sessionManager, sessionStartEvent }) => {
21
21
  const services = await createAgentSessionServices({ cwd });
@@ -40,7 +40,7 @@ import {
40
40
  ModelRegistry,
41
41
  SessionManager,
42
42
  SettingsManager,
43
- } from "@earendil-works/pi-coding-agent";
43
+ } from "@bastani/atomic";
44
44
 
45
45
  // Auth and models setup
46
46
  const authStorage = AuthStorage.create();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.8.3",
3
+ "version": "0.8.4-0",
4
4
  "description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {