@eminent337/aery 0.1.114 → 0.1.116

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 (270) hide show
  1. package/CHANGELOG.md +4172 -16
  2. package/README.md +621 -34
  3. package/dist/bun/cli.d.ts.map +1 -1
  4. package/dist/bun/cli.js +2 -1
  5. package/dist/bun/cli.js.map +1 -1
  6. package/dist/cli/args.d.ts.map +1 -1
  7. package/dist/cli/args.js +3 -0
  8. package/dist/cli/args.js.map +1 -1
  9. package/dist/cli/config-selector.d.ts +1 -1
  10. package/dist/cli/config-selector.d.ts.map +1 -1
  11. package/dist/cli/config-selector.js +1 -1
  12. package/dist/cli/config-selector.js.map +1 -1
  13. package/dist/cli.d.ts.map +1 -1
  14. package/dist/cli.js +4 -3
  15. package/dist/cli.js.map +1 -1
  16. package/dist/config.d.ts +11 -7
  17. package/dist/config.d.ts.map +1 -1
  18. package/dist/config.js +66 -46
  19. package/dist/config.js.map +1 -1
  20. package/dist/core/agent-session.d.ts +5 -5
  21. package/dist/core/agent-session.d.ts.map +1 -1
  22. package/dist/core/agent-session.js +37 -36
  23. package/dist/core/agent-session.js.map +1 -1
  24. package/dist/core/bash-executor.d.ts.map +1 -1
  25. package/dist/core/bash-executor.js +2 -2
  26. package/dist/core/bash-executor.js.map +1 -1
  27. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  28. package/dist/core/compaction/branch-summarization.js +1 -1
  29. package/dist/core/compaction/branch-summarization.js.map +1 -1
  30. package/dist/core/compaction/compaction.d.ts.map +1 -1
  31. package/dist/core/compaction/compaction.js +3 -3
  32. package/dist/core/compaction/compaction.js.map +1 -1
  33. package/dist/core/custom-openai-compatible.d.ts +1 -0
  34. package/dist/core/custom-openai-compatible.d.ts.map +1 -1
  35. package/dist/core/custom-openai-compatible.js +30 -4
  36. package/dist/core/custom-openai-compatible.js.map +1 -1
  37. package/dist/core/export-html/template.css +45 -1
  38. package/dist/core/export-html/template.js +68 -4
  39. package/dist/core/extensions/index.d.ts +1 -1
  40. package/dist/core/extensions/index.d.ts.map +1 -1
  41. package/dist/core/extensions/index.js.map +1 -1
  42. package/dist/core/extensions/runner.d.ts +3 -2
  43. package/dist/core/extensions/runner.d.ts.map +1 -1
  44. package/dist/core/extensions/runner.js +40 -0
  45. package/dist/core/extensions/runner.js.map +1 -1
  46. package/dist/core/extensions/types.d.ts +17 -3
  47. package/dist/core/extensions/types.d.ts.map +1 -1
  48. package/dist/core/extensions/types.js.map +1 -1
  49. package/dist/core/model-registry.d.ts +6 -0
  50. package/dist/core/model-registry.d.ts.map +1 -1
  51. package/dist/core/model-registry.js +59 -2
  52. package/dist/core/model-registry.js.map +1 -1
  53. package/dist/core/model-resolver.d.ts.map +1 -1
  54. package/dist/core/model-resolver.js +9 -1
  55. package/dist/core/model-resolver.js.map +1 -1
  56. package/dist/core/provider-display-names.d.ts +2 -0
  57. package/dist/core/provider-display-names.d.ts.map +1 -0
  58. package/dist/core/provider-display-names.js +35 -0
  59. package/dist/core/provider-display-names.js.map +1 -0
  60. package/dist/core/resource-loader.d.ts.map +1 -1
  61. package/dist/core/resource-loader.js +1 -1
  62. package/dist/core/resource-loader.js.map +1 -1
  63. package/dist/core/sdk.d.ts +3 -3
  64. package/dist/core/sdk.d.ts.map +1 -1
  65. package/dist/core/sdk.js +18 -10
  66. package/dist/core/sdk.js.map +1 -1
  67. package/dist/core/session-manager.d.ts +3 -3
  68. package/dist/core/session-manager.d.ts.map +1 -1
  69. package/dist/core/session-manager.js +1 -1
  70. package/dist/core/session-manager.js.map +1 -1
  71. package/dist/core/settings-manager.d.ts.map +1 -1
  72. package/dist/core/settings-manager.js +2 -2
  73. package/dist/core/settings-manager.js.map +1 -1
  74. package/dist/core/system-prompt.d.ts.map +1 -1
  75. package/dist/core/system-prompt.js +5 -5
  76. package/dist/core/system-prompt.js.map +1 -1
  77. package/dist/core/tools/bash.d.ts +2 -2
  78. package/dist/core/tools/bash.d.ts.map +1 -1
  79. package/dist/core/tools/bash.js +105 -125
  80. package/dist/core/tools/bash.js.map +1 -1
  81. package/dist/core/tools/find.d.ts.map +1 -1
  82. package/dist/core/tools/find.js +1 -1
  83. package/dist/core/tools/find.js.map +1 -1
  84. package/dist/core/tools/grep.d.ts.map +1 -1
  85. package/dist/core/tools/grep.js +1 -1
  86. package/dist/core/tools/grep.js.map +1 -1
  87. package/dist/core/tools/output-accumulator.d.ts +50 -0
  88. package/dist/core/tools/output-accumulator.d.ts.map +1 -0
  89. package/dist/core/tools/output-accumulator.js +178 -0
  90. package/dist/core/tools/output-accumulator.js.map +1 -0
  91. package/dist/core/tools/read.d.ts.map +1 -1
  92. package/dist/core/tools/read.js +70 -13
  93. package/dist/core/tools/read.js.map +1 -1
  94. package/dist/core/tools/render-utils.d.ts.map +1 -1
  95. package/dist/core/tools/render-utils.js +2 -2
  96. package/dist/core/tools/render-utils.js.map +1 -1
  97. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  98. package/dist/modes/interactive/components/bash-execution.js +1 -1
  99. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  100. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  101. package/dist/modes/interactive/components/config-selector.js +23 -1
  102. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  103. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  104. package/dist/modes/interactive/components/earendil-announcement.js +2 -2
  105. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  106. package/dist/modes/interactive/components/extension-selector.d.ts +2 -0
  107. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  108. package/dist/modes/interactive/components/extension-selector.js +6 -1
  109. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  110. package/dist/modes/interactive/components/keybinding-hints.d.ts +5 -0
  111. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  112. package/dist/modes/interactive/components/keybinding-hints.js +19 -5
  113. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  114. package/dist/modes/interactive/components/login-dialog.d.ts +1 -3
  115. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  116. package/dist/modes/interactive/components/login-dialog.js +9 -17
  117. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  118. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  119. package/dist/modes/interactive/components/oauth-selector.js +24 -27
  120. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  121. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  122. package/dist/modes/interactive/components/settings-selector.js +4 -2
  123. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  124. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  125. package/dist/modes/interactive/components/tree-selector.js +2 -1
  126. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  127. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  128. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  129. package/dist/modes/interactive/interactive-mode.js +10 -2
  130. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  131. package/dist/modes/interactive/theme/dark.json +1 -1
  132. package/dist/modes/interactive/theme/light.json +1 -1
  133. package/dist/modes/interactive/theme/theme-schema.json +1 -1
  134. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  135. package/dist/modes/interactive/theme/theme.js +8 -10
  136. package/dist/modes/interactive/theme/theme.js.map +1 -1
  137. package/dist/modes/print-mode.d.ts +2 -2
  138. package/dist/modes/print-mode.d.ts.map +1 -1
  139. package/dist/modes/print-mode.js +2 -2
  140. package/dist/modes/print-mode.js.map +1 -1
  141. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  142. package/dist/modes/rpc/rpc-mode.js +4 -0
  143. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  144. package/dist/utils/ansi.d.ts +2 -0
  145. package/dist/utils/ansi.d.ts.map +1 -0
  146. package/dist/utils/ansi.js +52 -0
  147. package/dist/utils/ansi.js.map +1 -0
  148. package/dist/utils/clipboard-image.d.ts.map +1 -1
  149. package/dist/utils/clipboard-image.js +3 -3
  150. package/dist/utils/clipboard-image.js.map +1 -1
  151. package/dist/utils/clipboard.d.ts.map +1 -1
  152. package/dist/utils/clipboard.js +9 -2
  153. package/dist/utils/clipboard.js.map +1 -1
  154. package/dist/utils/html.d.ts +7 -0
  155. package/dist/utils/html.d.ts.map +1 -0
  156. package/dist/utils/html.js +40 -0
  157. package/dist/utils/html.js.map +1 -0
  158. package/dist/utils/mime.d.ts +1 -0
  159. package/dist/utils/mime.d.ts.map +1 -1
  160. package/dist/utils/mime.js +59 -16
  161. package/dist/utils/mime.js.map +1 -1
  162. package/dist/utils/paths.d.ts +2 -0
  163. package/dist/utils/paths.d.ts.map +1 -1
  164. package/dist/utils/paths.js +16 -0
  165. package/dist/utils/paths.js.map +1 -1
  166. package/dist/utils/pi-user-agent.d.ts +2 -0
  167. package/dist/utils/pi-user-agent.d.ts.map +1 -0
  168. package/dist/utils/pi-user-agent.js +5 -0
  169. package/dist/utils/pi-user-agent.js.map +1 -0
  170. package/dist/utils/syntax-highlight.d.ts +12 -0
  171. package/dist/utils/syntax-highlight.d.ts.map +1 -0
  172. package/dist/utils/syntax-highlight.js +118 -0
  173. package/dist/utils/syntax-highlight.js.map +1 -0
  174. package/dist/utils/tools-manager.d.ts.map +1 -1
  175. package/dist/utils/tools-manager.js +76 -7
  176. package/dist/utils/tools-manager.js.map +1 -1
  177. package/dist/utils/uuid.d.ts +2 -0
  178. package/dist/utils/uuid.d.ts.map +1 -0
  179. package/dist/utils/uuid.js +40 -0
  180. package/dist/utils/uuid.js.map +1 -0
  181. package/dist/utils/version-check.d.ts +7 -0
  182. package/dist/utils/version-check.d.ts.map +1 -1
  183. package/dist/utils/version-check.js +12 -5
  184. package/dist/utils/version-check.js.map +1 -1
  185. package/docs/compaction.md +16 -16
  186. package/docs/custom-provider.md +40 -32
  187. package/docs/development.md +4 -4
  188. package/docs/docs.json +20 -5
  189. package/docs/extensions.md +152 -102
  190. package/docs/index.md +16 -7
  191. package/docs/json.md +7 -7
  192. package/docs/keybindings.md +3 -3
  193. package/docs/models.md +48 -8
  194. package/docs/packages.md +41 -36
  195. package/docs/prompt-templates.md +2 -2
  196. package/docs/providers.md +52 -36
  197. package/docs/quickstart.md +20 -20
  198. package/docs/rpc.md +9 -9
  199. package/docs/sdk.md +31 -53
  200. package/docs/session-format.md +10 -10
  201. package/docs/sessions.md +9 -9
  202. package/docs/settings.md +12 -6
  203. package/docs/skills.md +4 -4
  204. package/docs/terminal-setup.md +6 -6
  205. package/docs/termux.md +6 -6
  206. package/docs/themes.md +7 -7
  207. package/docs/tmux.md +1 -1
  208. package/docs/tui.md +8 -8
  209. package/docs/usage.md +41 -39
  210. package/examples/extensions/README.md +3 -5
  211. package/examples/extensions/antigravity-image-gen.ts +9 -9
  212. package/examples/extensions/auto-commit-on-exit.ts +1 -1
  213. package/examples/extensions/bash-spawn-hook.ts +2 -2
  214. package/examples/extensions/built-in-tool-renderer.ts +1 -1
  215. package/examples/extensions/custom-compaction.ts +1 -1
  216. package/examples/extensions/custom-header.ts +2 -2
  217. package/examples/extensions/custom-provider-anthropic/index.ts +2 -2
  218. package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
  219. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  220. package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
  221. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  222. package/examples/extensions/doom-overlay/README.md +2 -2
  223. package/examples/extensions/doom-overlay/doom/build.sh +2 -2
  224. package/examples/extensions/doom-overlay/index.ts +1 -1
  225. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  226. package/examples/extensions/handoff.ts +42 -5
  227. package/examples/extensions/hidden-thinking-label.ts +1 -1
  228. package/examples/extensions/inline-bash.ts +2 -2
  229. package/examples/extensions/input-transform.ts +3 -3
  230. package/examples/extensions/interactive-shell.ts +1 -1
  231. package/examples/extensions/mac-system-theme.ts +2 -2
  232. package/examples/extensions/minimal-mode.ts +1 -1
  233. package/examples/extensions/modal-editor.ts +1 -1
  234. package/examples/extensions/model-status.ts +1 -1
  235. package/examples/extensions/overlay-qa-tests.ts +6 -6
  236. package/examples/extensions/overlay-test.ts +1 -1
  237. package/examples/extensions/preset.ts +2 -2
  238. package/examples/extensions/provider-payload.ts +1 -1
  239. package/examples/extensions/rainbow-editor.ts +1 -1
  240. package/examples/extensions/rpc-demo.ts +1 -1
  241. package/examples/extensions/sandbox/index.ts +3 -3
  242. package/examples/extensions/sandbox/package-lock.json +7 -7
  243. package/examples/extensions/sandbox/package.json +1 -1
  244. package/examples/extensions/shutdown-command.ts +5 -5
  245. package/examples/extensions/ssh.ts +2 -2
  246. package/examples/extensions/subagent/README.md +2 -2
  247. package/examples/extensions/subagent/agents/aery-pods.md +1 -1
  248. package/examples/extensions/subagent/agents.ts +1 -1
  249. package/examples/extensions/subagent/index.ts +2 -2
  250. package/examples/extensions/titlebar-spinner.ts +1 -1
  251. package/examples/extensions/tool-override.ts +2 -2
  252. package/examples/extensions/truncated-tool.ts +1 -1
  253. package/examples/extensions/with-deps/package-lock.json +4 -4
  254. package/examples/extensions/with-deps/package.json +1 -1
  255. package/examples/extensions/working-indicator.ts +4 -4
  256. package/examples/extensions/working-message-test.ts +1 -1
  257. package/examples/sdk/01-minimal.ts +14 -10
  258. package/examples/sdk/02-custom-model.ts +12 -8
  259. package/examples/sdk/03-custom-prompt.ts +24 -16
  260. package/examples/sdk/04-skills.ts +2 -2
  261. package/examples/sdk/05-tools.ts +8 -4
  262. package/examples/sdk/06-extensions.ts +11 -7
  263. package/examples/sdk/07-context-files.ts +2 -2
  264. package/examples/sdk/08-prompt-templates.ts +2 -2
  265. package/examples/sdk/09-api-keys-and-oauth.ts +8 -4
  266. package/examples/sdk/10-settings.ts +4 -4
  267. package/examples/sdk/11-sessions.ts +4 -0
  268. package/examples/sdk/12-full-control.ts +11 -7
  269. package/examples/sdk/README.md +5 -8
  270. package/package.json +8 -14
@@ -15,6 +15,7 @@
15
15
  import type { ExtensionAPI, SessionEntry } from "@eminent337/aery";
16
16
  import { BorderedLoader, convertToLlm, serializeConversation } from "@eminent337/aery";
17
17
  import { complete, type Message } from "@eminent337/aery-ai";
18
+ import type { AgentMessage } from "@eminent337/aery-core";
18
19
 
19
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:
20
21
 
@@ -38,6 +39,44 @@ Files involved:
38
39
  ## Task
39
40
  [Clear description of what to do next based on user's goal]`;
40
41
 
42
+ function entryToMessage(entry: SessionEntry): AgentMessage | undefined {
43
+ if (entry.type === "message") {
44
+ return entry.message;
45
+ }
46
+ if (entry.type === "compaction") {
47
+ return {
48
+ role: "compactionSummary",
49
+ summary: entry.summary,
50
+ tokensBefore: entry.tokensBefore,
51
+ timestamp: new Date(entry.timestamp).getTime(),
52
+ };
53
+ }
54
+ return undefined;
55
+ }
56
+
57
+ function getHandoffMessages(branch: SessionEntry[]): AgentMessage[] {
58
+ let compactionIndex = -1;
59
+ for (let i = branch.length - 1; i >= 0; i--) {
60
+ if (branch[i].type === "compaction") {
61
+ compactionIndex = i;
62
+ break;
63
+ }
64
+ }
65
+ if (compactionIndex < 0) {
66
+ return branch.map(entryToMessage).filter((message) => message !== undefined);
67
+ }
68
+
69
+ const compaction = branch[compactionIndex];
70
+ const firstKeptIndex =
71
+ compaction.type === "compaction" ? branch.findIndex((entry) => entry.id === compaction.firstKeptEntryId) : -1;
72
+ const compactedBranch = [
73
+ compaction,
74
+ ...(firstKeptIndex >= 0 ? branch.slice(firstKeptIndex, compactionIndex) : []),
75
+ ...branch.slice(compactionIndex + 1),
76
+ ];
77
+ return compactedBranch.map(entryToMessage).filter((message) => message !== undefined);
78
+ }
79
+
41
80
  export default function (pi: ExtensionAPI) {
42
81
  pi.registerCommand("handoff", {
43
82
  description: "Transfer context to a new focused session",
@@ -58,11 +97,9 @@ export default function (pi: ExtensionAPI) {
58
97
  return;
59
98
  }
60
99
 
61
- // Gather conversation context from current branch
62
- const branch = ctx.sessionManager.getBranch();
63
- const messages = branch
64
- .filter((entry): entry is SessionEntry & { type: "message" } => entry.type === "message")
65
- .map((entry) => entry.message);
100
+ // Gather conversation context from current branch. If the branch was compacted,
101
+ // include the compaction summary plus entries from firstKeptEntryId onward.
102
+ const messages = getHandoffMessages(ctx.sessionManager.getBranch());
66
103
 
67
104
  if (messages.length === 0) {
68
105
  ctx.ui.notify("No conversation to hand off", "error");
@@ -5,7 +5,7 @@
5
5
  * when thinking blocks are hidden.
6
6
  *
7
7
  * Usage:
8
- * aery --extension examples/extensions/hidden-thinking-label.ts
8
+ * pi --extension examples/extensions/hidden-thinking-label.ts
9
9
  *
10
10
  * Test:
11
11
  * 1. Load this extension
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Inline Bash Extension - expands inline bash commands in user prompts.
3
3
  *
4
- * Start aery with this extension:
5
- * aery -e ./examples/extensions/inline-bash.ts
4
+ * Start pi with this extension:
5
+ * pi -e ./examples/extensions/inline-bash.ts
6
6
  *
7
7
  * Then type prompts with inline bash:
8
8
  * What's in !{pwd}?
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Input Transform Example - demonstrates the `input` event for intercepting user input.
3
3
  *
4
- * Start aery with this extension:
5
- * aery -e ./examples/extensions/input-transform.ts
4
+ * Start pi with this extension:
5
+ * pi -e ./examples/extensions/input-transform.ts
6
6
  *
7
- * Then type these inside aery:
7
+ * Then type these inside pi:
8
8
  * ?quick What is TypeScript? → "Respond briefly: What is TypeScript?"
9
9
  * ping → "pong" (instant, no LLM)
10
10
  * time → current time (instant, no LLM)
@@ -5,7 +5,7 @@
5
5
  * with full terminal access. The TUI suspends while they run.
6
6
  *
7
7
  * Usage:
8
- * aery -e examples/extensions/interactive-shell.ts
8
+ * pi -e examples/extensions/interactive-shell.ts
9
9
  *
10
10
  * !vim file.txt # Auto-detected as interactive
11
11
  * !i any-command # Force interactive mode with !i prefix
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Syncs aery theme with macOS system appearance (dark/light mode).
2
+ * Syncs pi theme with macOS system appearance (dark/light mode).
3
3
  *
4
4
  * Usage:
5
- * aery -e examples/extensions/mac-system-theme.ts
5
+ * pi -e examples/extensions/mac-system-theme.ts
6
6
  */
7
7
 
8
8
  import { exec } from "node:child_process";
@@ -11,7 +11,7 @@
11
11
  * - Minimal: Shows only tool call, no output (this extension's collapsed mode)
12
12
  *
13
13
  * Usage:
14
- * aery -e ./minimal-mode.ts
14
+ * pi -e ./minimal-mode.ts
15
15
  *
16
16
  * Then use ctrl+o to toggle between minimal (collapsed) and full (expanded) views.
17
17
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Modal Editor - vim-like modal editing example
3
3
  *
4
- * Usage: aery --extension ./examples/extensions/modal-editor.ts
4
+ * Usage: pi --extension ./examples/extensions/modal-editor.ts
5
5
  *
6
6
  * - Escape: insert → normal mode (in normal mode, aborts agent)
7
7
  * - i: normal → insert mode
@@ -4,7 +4,7 @@
4
4
  * Demonstrates the `model_select` hook which fires when the model changes
5
5
  * via /model command, Ctrl+P cycling, or session restore.
6
6
  *
7
- * Usage: aery -e ./model-status.ts
7
+ * Usage: pi -e ./model-status.ts
8
8
  */
9
9
 
10
10
  import type { ExtensionAPI } from "@eminent337/aery";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Overlay QA Tests - comprehensive overlay positioning and edge case tests
3
3
  *
4
- * Usage: aery --extension ./examples/extensions/overlay-qa-tests.ts
4
+ * Usage: pi --extension ./examples/extensions/overlay-qa-tests.ts
5
5
  *
6
6
  * Commands:
7
7
  * /overlay-animation - Real-time animation demo (~30 FPS, proves DOOM-like rendering works)
@@ -28,7 +28,7 @@ import { spawn } from "child_process";
28
28
  let globalToggleHandle: OverlayHandle | null = null;
29
29
 
30
30
  export default function (pi: ExtensionAPI) {
31
- // Animation demo - proves overlays can handle real-time updates (like aery-doom would need)
31
+ // Animation demo - proves overlays can handle real-time updates (like pi-doom would need)
32
32
  pi.registerCommand("overlay-animation", {
33
33
  description: "Test real-time animation in overlay (~30 FPS)",
34
34
  handler: async (_args: string, ctx: ExtensionCommandContext) => {
@@ -473,13 +473,13 @@ class StreamingOverflowComponent extends BaseOverlay {
473
473
  echo ""
474
474
  for i in $(seq 1 100); do
475
475
  # Simulate long file paths with OSC 8 hyperlinks (clickable) - tests width overflow
476
- DIR="/Users/nicobailon/Documents/development/aery/packages/coding-agent/src/modes/interactive"
476
+ DIR="/Users/nicobailon/Documents/development/pi-mono/packages/coding-agent/src/modes/interactive"
477
477
  FILE="\${DIR}/components/very-long-component-name-that-exceeds-width-\${i}.ts"
478
478
  echo -e "\\033]8;;file://\${FILE}\\007▶ read: \${FILE}\\033]8;;\\007"
479
479
 
480
480
  # Add some colored status messages with long text
481
481
  if [ $((i % 5)) -eq 0 ]; then
482
- echo -e " \\033[32m✓ Successfully processed \${i} files in /Users/nicobailon/Documents/development/aery\\033[0m"
482
+ echo -e " \\033[32m✓ Successfully processed \${i} files in /Users/nicobailon/Documents/development/pi-mono\\033[0m"
483
483
  fi
484
484
  if [ $((i % 7)) -eq 0 ]; then
485
485
  echo -e " \\033[33m⚠ Warning: potential issue detected at line \${i} in very-long-component-name-that-exceeds-width.ts\\033[0m"
@@ -743,7 +743,7 @@ class SidepanelComponent extends BaseOverlay {
743
743
  }
744
744
  }
745
745
 
746
- // Animation demo - proves overlays can handle real-time updates like aery-doom
746
+ // Animation demo - proves overlays can handle real-time updates like pi-doom
747
747
  class AnimationDemoComponent extends BaseOverlay {
748
748
  private frame = 0;
749
749
  private interval: ReturnType<typeof setInterval> | null = null;
@@ -819,7 +819,7 @@ class AnimationDemoComponent extends BaseOverlay {
819
819
  lines.push(border("│") + padLine(``) + border("│"));
820
820
  lines.push(border("│") + padLine(th.fg("dim", " This proves overlays can handle")) + border("│"));
821
821
  lines.push(border("│") + padLine(th.fg("dim", " real-time game-like rendering.")) + border("│"));
822
- lines.push(border("│") + padLine(th.fg("dim", " (aery-doom uses same approach)")) + border("│"));
822
+ lines.push(border("│") + padLine(th.fg("dim", " (pi-doom uses same approach)")) + border("│"));
823
823
  lines.push(border("│") + padLine(``) + border("│"));
824
824
  lines.push(border("│") + padLine(th.fg("dim", " Press Esc to close")) + border("│"));
825
825
  lines.push(border(`╰${"─".repeat(innerW)}╯`));
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Overlay Test - validates overlay compositing with inline text inputs
3
3
  *
4
- * Usage: aery --extension ./examples/extensions/overlay-test.ts
4
+ * Usage: pi --extension ./examples/extensions/overlay-test.ts
5
5
  *
6
6
  * Run /overlay-test to show a floating overlay with:
7
7
  * - Inline text inputs within menu items
@@ -30,7 +30,7 @@
30
30
  * ```
31
31
  *
32
32
  * Usage:
33
- * - `aery --preset plan` - start with plan preset
33
+ * - `pi --preset plan` - start with plan preset
34
34
  * - `/preset` - show selector to switch presets mid-session
35
35
  * - `/preset implement` - switch to implement preset directly
36
36
  * - `Ctrl+Shift+U` - cycle through presets
@@ -69,7 +69,7 @@ interface PresetsConfig {
69
69
  */
70
70
  function loadPresets(cwd: string): PresetsConfig {
71
71
  const globalPath = join(getAgentDir(), "presets.json");
72
- const projectPath = join(cwd, ".aery", "presets.json");
72
+ const projectPath = join(cwd, ".pi", "presets.json");
73
73
 
74
74
  let globalPresets: PresetsConfig = {};
75
75
  let projectPresets: PresetsConfig = {};
@@ -3,7 +3,7 @@ import { join } from "node:path";
3
3
  import type { ExtensionAPI } from "@eminent337/aery";
4
4
 
5
5
  export default function (pi: ExtensionAPI) {
6
- const logFile = join(process.cwd(), ".aery", "provider-payload.log");
6
+ const logFile = join(process.cwd(), ".pi", "provider-payload.log");
7
7
 
8
8
  pi.on("before_provider_request", (event) => {
9
9
  appendFileSync(logFile, `${JSON.stringify(event.payload, null, 2)}\n\n`, "utf8");
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Rainbow Editor - highlights "ultrathink" with animated shine effect
3
3
  *
4
- * Usage: aery --extension ./examples/extensions/rainbow-editor.ts
4
+ * Usage: pi --extension ./examples/extensions/rainbow-editor.ts
5
5
  */
6
6
 
7
7
  import { CustomEditor, type ExtensionAPI } from "@eminent337/aery";
@@ -25,7 +25,7 @@ export default function (pi: ExtensionAPI) {
25
25
  // -- setTitle, setWidget, setStatus on session lifecycle --
26
26
 
27
27
  pi.on("session_start", async (event, ctx) => {
28
- ctx.ui.setTitle(event.reason === "new" ? "aery RPC Demo (new session)" : "aery RPC Demo");
28
+ ctx.ui.setTitle(event.reason === "new" ? "pi RPC Demo (new session)" : "pi RPC Demo");
29
29
  ctx.ui.setWidget("rpc-demo", ["--- RPC Extension UI Demo ---", "Loaded and ready."]);
30
30
  ctx.ui.setStatus("rpc-demo", `Turns: ${turnCount}`);
31
31
  });
@@ -30,8 +30,8 @@
30
30
  * ```
31
31
  *
32
32
  * Usage:
33
- * - `aery -e ./sandbox` - sandbox enabled with default/config settings
34
- * - `aery -e ./sandbox --no-sandbox` - disable sandboxing
33
+ * - `pi -e ./sandbox` - sandbox enabled with default/config settings
34
+ * - `pi -e ./sandbox --no-sandbox` - disable sandboxing
35
35
  * - `/sandbox` - show current sandbox configuration
36
36
  *
37
37
  * Setup:
@@ -77,7 +77,7 @@ const DEFAULT_CONFIG: SandboxConfig = {
77
77
  };
78
78
 
79
79
  function loadConfig(cwd: string): SandboxConfig {
80
- const projectConfigPath = join(cwd, ".aery", "sandbox.json");
80
+ const projectConfigPath = join(cwd, ".pi", "sandbox.json");
81
81
  const globalConfigPath = join(getAgentDir(), "extensions", "sandbox.json");
82
82
 
83
83
  let globalConfig: Partial<SandboxConfig> = {};
@@ -1,12 +1,12 @@
1
1
  {
2
- "name": "pi-extension-sandbox",
3
- "version": "1.0.0",
2
+ "name": "aery-extension-sandbox",
3
+ "version": "1.4.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
- "name": "pi-extension-sandbox",
9
- "version": "1.0.0",
8
+ "name": "aery-extension-sandbox",
9
+ "version": "1.4.0",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sandbox-runtime": "^0.0.26"
12
12
  }
@@ -62,9 +62,9 @@
62
62
  }
63
63
  },
64
64
  "node_modules/lodash-es": {
65
- "version": "4.17.22",
66
- "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.22.tgz",
67
- "integrity": "sha512-XEawp1t0gxSi9x01glktRZ5HDy0HXqrM0x5pXQM98EaI0NxO6jVM7omDOxsuEo5UIASAnm2bRp1Jt/e0a2XU8Q==",
65
+ "version": "4.18.1",
66
+ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz",
67
+ "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==",
68
68
  "license": "MIT"
69
69
  },
70
70
  "node_modules/shell-quote": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aery-extension-sandbox",
3
3
  "private": true,
4
- "version": "1.0.0",
4
+ "version": "1.4.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -2,16 +2,16 @@
2
2
  * Shutdown Command Extension
3
3
  *
4
4
  * Adds a /quit command that allows extensions to trigger clean shutdown.
5
- * Demonstrates how extensions can use ctx.shutdown() to exit aery cleanly.
5
+ * Demonstrates how extensions can use ctx.shutdown() to exit pi cleanly.
6
6
  */
7
7
 
8
8
  import type { ExtensionAPI } from "@eminent337/aery";
9
9
  import { Type } from "typebox";
10
10
 
11
11
  export default function (pi: ExtensionAPI) {
12
- // Register a /quit command that cleanly exits aery
12
+ // Register a /quit command that cleanly exits pi
13
13
  pi.registerCommand("quit", {
14
- description: "Exit aery cleanly",
14
+ description: "Exit pi cleanly",
15
15
  handler: async (_args, ctx) => {
16
16
  ctx.shutdown();
17
17
  },
@@ -21,7 +21,7 @@ export default function (pi: ExtensionAPI) {
21
21
  pi.registerTool({
22
22
  name: "finish_and_exit",
23
23
  label: "Finish and Exit",
24
- description: "Complete a task and exit aery",
24
+ description: "Complete a task and exit pi",
25
25
  parameters: Type.Object({}),
26
26
  async execute(_toolCallId, _params, _signal, _onUpdate, ctx) {
27
27
  // Do any final work here...
@@ -40,7 +40,7 @@ export default function (pi: ExtensionAPI) {
40
40
  pi.registerTool({
41
41
  name: "deploy_and_exit",
42
42
  label: "Deploy and Exit",
43
- description: "Deploy the application and exit aery",
43
+ description: "Deploy the application and exit pi",
44
44
  parameters: Type.Object({
45
45
  environment: Type.String({ description: "Target environment (e.g., production, staging)" }),
46
46
  }),
@@ -5,8 +5,8 @@
5
5
  * When --ssh is provided, read/write/edit/bash run on the remote.
6
6
  *
7
7
  * Usage:
8
- * aery -e ./ssh.ts --ssh user@host
9
- * aery -e ./ssh.ts --ssh user@host:/remote/path
8
+ * pi -e ./ssh.ts --ssh user@host
9
+ * pi -e ./ssh.ts --ssh user@host:/remote/path
10
10
  *
11
11
  * Requirements:
12
12
  * - SSH key-based auth (no password prompts)
@@ -4,7 +4,7 @@ Delegate tasks to specialized subagents with isolated context windows.
4
4
 
5
5
  ## Features
6
6
 
7
- - **Isolated context**: Each subagent runs in a separate `aery` process
7
+ - **Isolated context**: Each subagent runs in a separate `pi` process
8
8
  - **Streaming output**: See tool calls and progress as they happen
9
9
  - **Parallel streaming**: All parallel tasks stream updates simultaneously
10
10
  - **Markdown rendering**: Final output rendered with proper formatting (expanded view)
@@ -54,7 +54,7 @@ done
54
54
 
55
55
  ## Security Model
56
56
 
57
- This tool executes a separate `aery` subprocess with a delegated system prompt and tool/model configuration.
57
+ This tool executes a separate `pi` subprocess with a delegated system prompt and tool/model configuration.
58
58
 
59
59
  **Project-local agents** (`.aery/agents/*.md`) are repo-controlled prompts that can instruct the model to read files, run bash commands, etc.
60
60
 
@@ -15,7 +15,7 @@ Pods handles:
15
15
  - OpenAI-compatible API endpoints per model
16
16
  - Interactive agent with file system tools for testing
17
17
 
18
- Key env vars: HF_TOKEN (HuggingFace), PI_API_KEY (API auth).
18
+ Key env vars: HF_TOKEN (HuggingFace), AERY_API_KEY (API auth).
19
19
  Primary provider: DataCrunch (NFS volumes for shared model storage).
20
20
 
21
21
  Rules:
@@ -85,7 +85,7 @@ function isDirectory(p: string): boolean {
85
85
  function findNearestProjectAgentsDir(cwd: string): string | null {
86
86
  let currentDir = cwd;
87
87
  while (true) {
88
- const candidate = path.join(currentDir, ".aery", "agents");
88
+ const candidate = path.join(currentDir, ".pi", "agents");
89
89
  if (isDirectory(candidate)) return candidate;
90
90
 
91
91
  const parentDir = path.dirname(currentDir);
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Subagent Tool - Delegate tasks to specialized agents
3
3
  *
4
- * Spawns a separate `aery` process for each subagent invocation,
4
+ * Spawns a separate `pi` process for each subagent invocation,
5
5
  * giving it an isolated context window.
6
6
  *
7
7
  * Supports three modes:
@@ -208,7 +208,7 @@ async function mapWithConcurrencyLimit<TIn, TOut>(
208
208
  }
209
209
 
210
210
  async function writePromptToTempFile(agentName: string, prompt: string): Promise<{ dir: string; filePath: string }> {
211
- const tmpDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "aery-subagent-"));
211
+ const tmpDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "pi-subagent-"));
212
212
  const safeName = agentName.replace(/[^\w.-]+/g, "_");
213
213
  const filePath = path.join(tmpDir, `prompt-${safeName}.md`);
214
214
  await withFileMutationQueue(filePath, async () => {
@@ -5,7 +5,7 @@
5
5
  * Uses `ctx.ui.setTitle()` to update the terminal title via the extension API.
6
6
  *
7
7
  * Usage:
8
- * aery --extension examples/extensions/titlebar-spinner.ts
8
+ * pi --extension examples/extensions/titlebar-spinner.ts
9
9
  */
10
10
 
11
11
  import path from "node:path";
@@ -5,7 +5,7 @@
5
5
  * This is useful for:
6
6
  * - Adding logging or auditing to tool calls
7
7
  * - Implementing access control or sandboxing
8
- * - Routing tool calls to remote systems (e.g., aery-ssh-remote)
8
+ * - Routing tool calls to remote systems (e.g., pi-ssh-remote)
9
9
  * - Modifying tool behavior for specific workflows
10
10
  *
11
11
  * This example overrides the `read` tool to:
@@ -17,7 +17,7 @@
17
17
  * is used automatically (syntax highlighting, line numbers, truncation warnings).
18
18
  *
19
19
  * Usage:
20
- * aery -e ./tool-override.ts
20
+ * pi -e ./tool-override.ts
21
21
  */
22
22
 
23
23
  import { type ExtensionAPI, getAgentDir, withFileMutationQueue } from "@eminent337/aery";
@@ -109,7 +109,7 @@ export default function (pi: ExtensionAPI) {
109
109
 
110
110
  if (truncation.truncated) {
111
111
  // Save full output to a temp file so LLM can access it if needed
112
- const tempDir = await mkdtemp(join(tmpdir(), "aery-rg-"));
112
+ const tempDir = await mkdtemp(join(tmpdir(), "pi-rg-"));
113
113
  const tempFile = join(tempDir, "output.txt");
114
114
  await withFileMutationQueue(tempFile, async () => {
115
115
  await writeFile(tempFile, output, "utf8");
@@ -1,12 +1,12 @@
1
1
  {
2
- "name": "pi-extension-with-deps",
3
- "version": "0.70.6",
2
+ "name": "aery-extension-with-deps",
3
+ "version": "0.74.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
- "name": "pi-extension-with-deps",
9
- "version": "0.70.6",
8
+ "name": "aery-extension-with-deps",
9
+ "version": "0.74.0",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aery-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.70.6",
4
+ "version": "0.74.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -2,10 +2,10 @@
2
2
  * Working Indicator Extension
3
3
  *
4
4
  * Demonstrates `ctx.ui.setWorkingIndicator()` for customizing the inline
5
- * working indicator shown while aery is streaming a response.
5
+ * working indicator shown while pi is streaming a response.
6
6
  *
7
7
  * Usage:
8
- * aery --extension examples/extensions/working-indicator.ts
8
+ * pi --extension examples/extensions/working-indicator.ts
9
9
  *
10
10
  * Commands:
11
11
  * /working-indicator Show current mode
@@ -13,7 +13,7 @@
13
13
  * /working-indicator pulse Use a custom animated indicator
14
14
  * /working-indicator none Hide the indicator entirely
15
15
  * /working-indicator spinner Restore an animated spinner
16
- * /working-indicator reset Restore aery's default spinner
16
+ * /working-indicator reset Restore pi's default spinner
17
17
  */
18
18
 
19
19
  import type { ExtensionAPI, ExtensionContext, WorkingIndicatorOptions } from "@eminent337/aery";
@@ -79,7 +79,7 @@ function describeMode(mode: WorkingIndicatorMode): string {
79
79
  case "spinner":
80
80
  return "custom spinner";
81
81
  case "default":
82
- return "aery default spinner";
82
+ return "pi default spinner";
83
83
  }
84
84
  }
85
85
 
@@ -5,7 +5,7 @@
5
5
  * verify they survive across loader recreations (e.g. between agent turns).
6
6
  *
7
7
  * Usage:
8
- * aery --extension examples/extensions/working-message-test.ts
8
+ * pi --extension examples/extensions/working-message-test.ts
9
9
  *
10
10
  * Then send a few messages in interactive mode. The working message should
11
11
  * stay "Working... (custom)" with a brown dot indicator every time the
@@ -9,14 +9,18 @@ import { createAgentSession } from "@eminent337/aery";
9
9
 
10
10
  const { session } = await createAgentSession();
11
11
 
12
- session.subscribe((event) => {
13
- if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
14
- process.stdout.write(event.assistantMessageEvent.delta);
15
- }
16
- });
12
+ try {
13
+ session.subscribe((event) => {
14
+ if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
15
+ process.stdout.write(event.assistantMessageEvent.delta);
16
+ }
17
+ });
17
18
 
18
- await session.prompt("What files are in the current directory?");
19
- session.state.messages.forEach((msg) => {
20
- console.log(msg);
21
- });
22
- console.log();
19
+ await session.prompt("What files are in the current directory?");
20
+ session.state.messages.forEach((msg) => {
21
+ console.log(msg);
22
+ });
23
+ console.log();
24
+ } finally {
25
+ session.dispose();
26
+ }
@@ -38,12 +38,16 @@ if (available.length > 0) {
38
38
  modelRegistry,
39
39
  });
40
40
 
41
- session.subscribe((event) => {
42
- if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
43
- process.stdout.write(event.assistantMessageEvent.delta);
44
- }
45
- });
46
-
47
- await session.prompt("Say hello in one sentence.");
48
- console.log();
41
+ try {
42
+ session.subscribe((event) => {
43
+ if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
44
+ process.stdout.write(event.assistantMessageEvent.delta);
45
+ }
46
+ });
47
+
48
+ await session.prompt("Say hello in one sentence.");
49
+ console.log();
50
+ } finally {
51
+ session.dispose();
52
+ }
49
53
  }