@oh-my-pi/pi-coding-agent 8.0.2 → 8.0.3

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 (216) hide show
  1. package/package.json +5 -1
  2. package/src/cli/args.ts +2 -2
  3. package/src/cli/config-cli.ts +4 -4
  4. package/src/cli/file-processor.ts +3 -3
  5. package/src/cli/list-models.ts +2 -2
  6. package/src/cli/plugin-cli.ts +7 -3
  7. package/src/cli/session-picker.ts +2 -2
  8. package/src/cli/setup-cli.ts +2 -2
  9. package/src/cli/stats-cli.ts +1 -1
  10. package/src/cli/update-cli.ts +2 -2
  11. package/src/config/keybindings.ts +1 -1
  12. package/src/config/model-registry.ts +1 -1
  13. package/src/config/model-resolver.ts +1 -1
  14. package/src/config/prompt-templates.ts +2 -2
  15. package/src/config/settings-manager.ts +5 -5
  16. package/src/cursor.ts +1 -1
  17. package/src/discovery/agents-md.ts +4 -4
  18. package/src/discovery/builtin.ts +21 -17
  19. package/src/discovery/claude.ts +12 -12
  20. package/src/discovery/cline.ts +6 -6
  21. package/src/discovery/codex.ts +21 -21
  22. package/src/discovery/cursor.ts +9 -9
  23. package/src/discovery/gemini.ts +13 -9
  24. package/src/discovery/github.ts +6 -6
  25. package/src/discovery/helpers.ts +4 -4
  26. package/src/discovery/index.ts +16 -16
  27. package/src/discovery/mcp-json.ts +4 -4
  28. package/src/discovery/ssh.ts +4 -4
  29. package/src/discovery/vscode.ts +4 -4
  30. package/src/discovery/windsurf.ts +6 -6
  31. package/src/exa/company.ts +1 -1
  32. package/src/exa/index.ts +2 -2
  33. package/src/exa/linkedin.ts +1 -1
  34. package/src/exa/mcp-client.ts +2 -2
  35. package/src/exa/render.ts +6 -6
  36. package/src/exa/researcher.ts +1 -1
  37. package/src/exa/search.ts +1 -1
  38. package/src/exa/websets.ts +1 -1
  39. package/src/exec/bash-executor.ts +3 -3
  40. package/src/export/custom-share.ts +1 -1
  41. package/src/export/html/index.ts +3 -3
  42. package/src/export/ttsr.ts +2 -2
  43. package/src/extensibility/custom-commands/bundled/review/index.ts +4 -4
  44. package/src/extensibility/custom-commands/loader.ts +3 -3
  45. package/src/extensibility/custom-commands/types.ts +1 -1
  46. package/src/extensibility/custom-tools/loader.ts +9 -9
  47. package/src/extensibility/custom-tools/types.ts +6 -6
  48. package/src/extensibility/custom-tools/wrapper.ts +1 -1
  49. package/src/extensibility/extensions/loader.ts +8 -8
  50. package/src/extensibility/extensions/runner.ts +3 -3
  51. package/src/extensibility/extensions/types.ts +23 -17
  52. package/src/extensibility/extensions/wrapper.ts +1 -1
  53. package/src/extensibility/hooks/index.ts +1 -1
  54. package/src/extensibility/hooks/loader.ts +7 -7
  55. package/src/extensibility/hooks/runner.ts +4 -4
  56. package/src/extensibility/hooks/types.ts +16 -10
  57. package/src/extensibility/plugins/doctor.ts +1 -1
  58. package/src/extensibility/plugins/installer.ts +1 -1
  59. package/src/extensibility/plugins/paths.ts +1 -1
  60. package/src/extensibility/skills.ts +9 -6
  61. package/src/extensibility/slash-commands.ts +6 -6
  62. package/src/index.ts +7 -7
  63. package/src/internal-urls/rule-protocol.ts +1 -1
  64. package/src/internal-urls/skill-protocol.ts +1 -1
  65. package/src/ipy/executor.ts +3 -3
  66. package/src/ipy/gateway-coordinator.ts +3 -3
  67. package/src/ipy/kernel.ts +3 -3
  68. package/src/lsp/client.ts +1 -1
  69. package/src/lsp/clients/biome-client.ts +1 -1
  70. package/src/lsp/clients/index.ts +1 -1
  71. package/src/lsp/clients/lsp-linter-client.ts +4 -4
  72. package/src/lsp/config.ts +1 -1
  73. package/src/lsp/index.ts +6 -6
  74. package/src/lsp/render.ts +7 -2
  75. package/src/lsp/utils.ts +1 -1
  76. package/src/main.ts +1 -1
  77. package/src/mcp/config.ts +3 -3
  78. package/src/mcp/loader.ts +2 -2
  79. package/src/mcp/manager.ts +1 -1
  80. package/src/mcp/tool-bridge.ts +6 -2
  81. package/src/mcp/tool-cache.ts +1 -1
  82. package/src/mcp/transports/http.ts +1 -1
  83. package/src/mcp/transports/stdio.ts +1 -1
  84. package/src/migrations.ts +2 -2
  85. package/src/modes/components/armin.ts +1 -1
  86. package/src/modes/components/assistant-message.ts +1 -1
  87. package/src/modes/components/bash-execution.ts +3 -3
  88. package/src/modes/components/bordered-loader.ts +1 -1
  89. package/src/modes/components/branch-summary-message.ts +2 -2
  90. package/src/modes/components/compaction-summary-message.ts +2 -2
  91. package/src/modes/components/custom-message.ts +3 -3
  92. package/src/modes/components/diff.ts +1 -1
  93. package/src/modes/components/dynamic-border.ts +1 -1
  94. package/src/modes/components/extensions/extension-dashboard.ts +3 -3
  95. package/src/modes/components/extensions/extension-list.ts +2 -2
  96. package/src/modes/components/extensions/inspector-panel.ts +1 -1
  97. package/src/modes/components/extensions/state-manager.ts +17 -11
  98. package/src/modes/components/extensions/types.ts +1 -1
  99. package/src/modes/components/footer.ts +3 -3
  100. package/src/modes/components/history-search.ts +2 -2
  101. package/src/modes/components/hook-editor.ts +1 -1
  102. package/src/modes/components/hook-input.ts +1 -1
  103. package/src/modes/components/hook-message.ts +3 -3
  104. package/src/modes/components/hook-selector.ts +1 -1
  105. package/src/modes/components/keybinding-hints.ts +2 -2
  106. package/src/modes/components/login-dialog.ts +1 -1
  107. package/src/modes/components/model-selector.ts +5 -5
  108. package/src/modes/components/oauth-selector.ts +2 -2
  109. package/src/modes/components/plugin-settings.ts +3 -3
  110. package/src/modes/components/python-execution.ts +3 -3
  111. package/src/modes/components/queue-mode-selector.ts +1 -1
  112. package/src/modes/components/read-tool-group.ts +2 -2
  113. package/src/modes/components/session-selector.ts +3 -3
  114. package/src/modes/components/settings-defs.ts +2 -2
  115. package/src/modes/components/settings-selector.ts +2 -2
  116. package/src/modes/components/show-images-selector.ts +1 -1
  117. package/src/modes/components/status-line/segments.ts +2 -2
  118. package/src/modes/components/status-line/separators.ts +1 -1
  119. package/src/modes/components/status-line/types.ts +2 -2
  120. package/src/modes/components/status-line-segment-editor.ts +2 -2
  121. package/src/modes/components/status-line.ts +3 -3
  122. package/src/modes/components/theme-selector.ts +1 -1
  123. package/src/modes/components/thinking-selector.ts +1 -1
  124. package/src/modes/components/todo-display.ts +2 -2
  125. package/src/modes/components/todo-reminder.ts +2 -2
  126. package/src/modes/components/tool-execution.ts +11 -6
  127. package/src/modes/components/tree-selector.ts +3 -3
  128. package/src/modes/components/ttsr-notification.ts +2 -2
  129. package/src/modes/components/user-message-selector.ts +1 -1
  130. package/src/modes/components/user-message.ts +1 -1
  131. package/src/modes/components/welcome.ts +2 -2
  132. package/src/modes/controllers/command-controller.ts +15 -15
  133. package/src/modes/controllers/event-controller.ts +13 -9
  134. package/src/modes/controllers/extension-ui-controller.ts +17 -11
  135. package/src/modes/controllers/input-controller.ts +6 -6
  136. package/src/modes/controllers/selector-controller.ts +22 -16
  137. package/src/modes/interactive-mode.ts +12 -12
  138. package/src/modes/print-mode.ts +1 -1
  139. package/src/modes/rpc/rpc-client.ts +3 -3
  140. package/src/modes/rpc/rpc-mode.ts +6 -3
  141. package/src/modes/rpc/rpc-types.ts +3 -3
  142. package/src/modes/theme/theme.ts +1 -1
  143. package/src/modes/types.ts +8 -8
  144. package/src/modes/utils/ui-helpers.ts +14 -14
  145. package/src/patch/applicator.ts +1 -1
  146. package/src/patch/diff.ts +1 -1
  147. package/src/patch/index.ts +8 -8
  148. package/src/patch/shared.ts +9 -9
  149. package/src/sdk.ts +19 -16
  150. package/src/session/agent-session.ts +27 -27
  151. package/src/session/agent-storage.ts +2 -2
  152. package/src/session/auth-storage.ts +1 -1
  153. package/src/session/compaction/branch-summarization.ts +7 -5
  154. package/src/session/compaction/compaction.ts +16 -6
  155. package/src/session/compaction/utils.ts +5 -3
  156. package/src/session/history-storage.ts +1 -1
  157. package/src/session/messages.ts +2 -2
  158. package/src/session/session-manager.ts +2 -2
  159. package/src/session/storage-migration.ts +2 -2
  160. package/src/session/streaming-output.ts +1 -1
  161. package/src/ssh/connection-manager.ts +1 -1
  162. package/src/ssh/ssh-executor.ts +1 -1
  163. package/src/ssh/sshfs-mount.ts +1 -1
  164. package/src/system-prompt.ts +14 -8
  165. package/src/task/agents.ts +8 -8
  166. package/src/task/commands.ts +5 -5
  167. package/src/task/discovery.ts +3 -3
  168. package/src/task/executor.ts +11 -11
  169. package/src/task/index.ts +4 -4
  170. package/src/task/render.ts +6 -6
  171. package/src/task/subprocess-tool-registry.ts +1 -1
  172. package/src/task/worker-protocol.ts +3 -3
  173. package/src/task/worker.ts +18 -13
  174. package/src/tools/ask.ts +4 -4
  175. package/src/tools/bash-interceptor.ts +4 -1
  176. package/src/tools/bash.ts +8 -8
  177. package/src/tools/calculator.ts +4 -4
  178. package/src/tools/complete.ts +1 -1
  179. package/src/tools/context.ts +2 -2
  180. package/src/tools/fetch.ts +11 -11
  181. package/src/tools/find.ts +7 -7
  182. package/src/tools/gemini-image.ts +6 -6
  183. package/src/tools/grep.ts +8 -8
  184. package/src/tools/index.ts +19 -19
  185. package/src/tools/list-limit.ts +1 -1
  186. package/src/tools/ls.ts +4 -4
  187. package/src/tools/notebook.ts +3 -3
  188. package/src/tools/output-meta.ts +3 -3
  189. package/src/tools/output-utils.ts +1 -1
  190. package/src/tools/python.ts +10 -10
  191. package/src/tools/read.ts +11 -11
  192. package/src/tools/render-utils.ts +1 -1
  193. package/src/tools/renderers.ts +6 -6
  194. package/src/tools/review.ts +2 -2
  195. package/src/tools/ssh.ts +12 -12
  196. package/src/tools/todo-write.ts +5 -5
  197. package/src/tools/tool-result.ts +3 -3
  198. package/src/tools/write.ts +11 -11
  199. package/src/utils/changelog.ts +1 -1
  200. package/src/utils/file-mentions.ts +9 -4
  201. package/src/utils/image-convert.ts +1 -1
  202. package/src/utils/image-resize.ts +1 -1
  203. package/src/utils/shell.ts +1 -1
  204. package/src/utils/title-generator.ts +4 -4
  205. package/src/utils/tools-manager.ts +1 -1
  206. package/src/web/scrapers/choosealicense.ts +1 -1
  207. package/src/web/scrapers/twitter.ts +1 -1
  208. package/src/web/scrapers/types.ts +1 -1
  209. package/src/web/scrapers/utils.ts +1 -1
  210. package/src/web/scrapers/youtube.ts +2 -2
  211. package/src/web/search/auth.ts +8 -4
  212. package/src/web/search/index.ts +19 -10
  213. package/src/web/search/providers/anthropic.ts +8 -3
  214. package/src/web/search/providers/exa.ts +2 -2
  215. package/src/web/search/providers/perplexity.ts +2 -2
  216. package/src/web/search/render.ts +5 -5
@@ -12,11 +12,11 @@ import {
12
12
  } from "node:fs";
13
13
  import { createServer } from "node:net";
14
14
  import { delimiter, join } from "node:path";
15
+ import { getAgentDir } from "@oh-my-pi/pi-coding-agent/config";
16
+ import { getShellConfig, killProcessTree } from "@oh-my-pi/pi-coding-agent/utils/shell";
17
+ import { getOrCreateSnapshot } from "@oh-my-pi/pi-coding-agent/utils/shell-snapshot";
15
18
  import { logger } from "@oh-my-pi/pi-utils";
16
19
  import type { Subprocess } from "bun";
17
- import { getAgentDir } from "$c/config";
18
- import { getShellConfig, killProcessTree } from "$c/utils/shell";
19
- import { getOrCreateSnapshot } from "$c/utils/shell-snapshot";
20
20
 
21
21
  const GATEWAY_DIR_NAME = "python-gateway";
22
22
  const GATEWAY_INFO_FILE = "gateway.json";
package/src/ipy/kernel.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { createServer } from "node:net";
2
2
  import { delimiter, join } from "node:path";
3
+ import { getShellConfig, killProcessTree } from "@oh-my-pi/pi-coding-agent/utils/shell";
4
+ import { getOrCreateSnapshot } from "@oh-my-pi/pi-coding-agent/utils/shell-snapshot";
5
+ import { htmlToBasicMarkdown } from "@oh-my-pi/pi-coding-agent/web/scrapers/types";
3
6
  import { logger } from "@oh-my-pi/pi-utils";
4
7
  import { $, type Subprocess } from "bun";
5
8
  import { nanoid } from "nanoid";
6
- import { getShellConfig, killProcessTree } from "$c/utils/shell";
7
- import { getOrCreateSnapshot } from "$c/utils/shell-snapshot";
8
- import { htmlToBasicMarkdown } from "$c/web/scrapers/types";
9
9
  import { acquireSharedGateway, releaseSharedGateway } from "./gateway-coordinator";
10
10
  import { loadPythonModules } from "./modules";
11
11
  import { PYTHON_PRELUDE } from "./prelude";
package/src/lsp/client.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as fs from "node:fs";
2
+ import { ToolAbortError, throwIfAborted } from "@oh-my-pi/pi-coding-agent/tools/tool-errors";
2
3
  import { logger } from "@oh-my-pi/pi-utils";
3
- import { ToolAbortError, throwIfAborted } from "$c/tools/tool-errors";
4
4
  import { applyWorkspaceEdit } from "./edits";
5
5
  import { getLspmuxCommand, isLspmuxSupported } from "./lspmux";
6
6
  import type {
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import path from "node:path";
7
- import type { Diagnostic, DiagnosticSeverity, LinterClient, ServerConfig } from "$c/lsp/types";
7
+ import type { Diagnostic, DiagnosticSeverity, LinterClient, ServerConfig } from "@oh-my-pi/pi-coding-agent/lsp/types";
8
8
 
9
9
  // =============================================================================
10
10
  // Biome JSON Output Types
@@ -8,7 +8,7 @@
8
8
  export { BiomeClient } from "./biome-client";
9
9
  export { LspLinterClient } from "./lsp-linter-client";
10
10
 
11
- import type { LinterClient, ServerConfig } from "$c/lsp/types";
11
+ import type { LinterClient, ServerConfig } from "@oh-my-pi/pi-coding-agent/lsp/types";
12
12
  import { LspLinterClient } from "./lsp-linter-client";
13
13
 
14
14
  // Cache of linter clients by server name + cwd
@@ -3,10 +3,10 @@
3
3
  * Uses the Language Server Protocol for formatting and diagnostics.
4
4
  */
5
5
 
6
- import { getOrCreateClient, notifySaved, sendRequest, syncContent } from "$c/lsp/client";
7
- import { applyTextEditsToString } from "$c/lsp/edits";
8
- import type { Diagnostic, LinterClient, LspClient, ServerConfig, TextEdit } from "$c/lsp/types";
9
- import { fileToUri } from "$c/lsp/utils";
6
+ import { getOrCreateClient, notifySaved, sendRequest, syncContent } from "@oh-my-pi/pi-coding-agent/lsp/client";
7
+ import { applyTextEditsToString } from "@oh-my-pi/pi-coding-agent/lsp/edits";
8
+ import type { Diagnostic, LinterClient, LspClient, ServerConfig, TextEdit } from "@oh-my-pi/pi-coding-agent/lsp/types";
9
+ import { fileToUri } from "@oh-my-pi/pi-coding-agent/lsp/utils";
10
10
 
11
11
  /** Default formatting options for LSP */
12
12
  const DEFAULT_FORMAT_OPTIONS = {
package/src/lsp/config.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { homedir } from "node:os";
2
2
  import { basename, extname, join } from "node:path";
3
+ import { getConfigDirPaths } from "@oh-my-pi/pi-coding-agent/config";
3
4
  import { logger } from "@oh-my-pi/pi-utils";
4
5
  import { YAML } from "bun";
5
6
  import { globSync } from "glob";
6
- import { getConfigDirPaths } from "$c/config";
7
7
  import { BiomeClient } from "./clients/biome-client";
8
8
  import DEFAULTS from "./defaults.json" with { type: "json" };
9
9
  import type { ServerConfig } from "./types";
package/src/lsp/index.ts CHANGED
@@ -2,14 +2,14 @@ import type { Dirent } from "node:fs";
2
2
  import { existsSync, statSync } from "node:fs";
3
3
  import path from "node:path";
4
4
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
5
+ import { renderPromptTemplate } from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
6
+ import { type Theme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
7
+ import lspDescription from "@oh-my-pi/pi-coding-agent/prompts/tools/lsp.md" with { type: "text" };
8
+ import type { ToolSession } from "@oh-my-pi/pi-coding-agent/tools/index";
9
+ import { resolveToCwd } from "@oh-my-pi/pi-coding-agent/tools/path-utils";
10
+ import { throwIfAborted } from "@oh-my-pi/pi-coding-agent/tools/tool-errors";
5
11
  import { logger, once, untilAborted } from "@oh-my-pi/pi-utils";
6
12
  import type { BunFile } from "bun";
7
- import { renderPromptTemplate } from "$c/config/prompt-templates";
8
- import { type Theme, theme } from "$c/modes/theme/theme";
9
- import lspDescription from "$c/prompts/tools/lsp.md" with { type: "text" };
10
- import type { ToolSession } from "$c/tools/index";
11
- import { resolveToCwd } from "$c/tools/path-utils";
12
- import { throwIfAborted } from "$c/tools/tool-errors";
13
13
  import {
14
14
  ensureFileOpen,
15
15
  getActiveClients,
package/src/lsp/render.ts CHANGED
@@ -9,10 +9,15 @@
9
9
  */
10
10
 
11
11
  import type { AgentToolResult, RenderResultOptions } from "@oh-my-pi/pi-agent-core";
12
+ import { getLanguageFromPath, type Theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
13
+ import {
14
+ formatExpandHint,
15
+ formatMoreItems,
16
+ TRUNCATE_LENGTHS,
17
+ truncate,
18
+ } from "@oh-my-pi/pi-coding-agent/tools/render-utils";
12
19
  import { Text } from "@oh-my-pi/pi-tui";
13
20
  import { highlight, supportsLanguage } from "cli-highlight";
14
- import { getLanguageFromPath, type Theme } from "$c/modes/theme/theme";
15
- import { formatExpandHint, formatMoreItems, TRUNCATE_LENGTHS, truncate } from "$c/tools/render-utils";
16
21
  import type { LspParams, LspToolDetails } from "./types";
17
22
 
18
23
  // =============================================================================
package/src/lsp/utils.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- import { type Theme, theme } from "$c/modes/theme/theme";
2
+ import { type Theme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
3
3
  import type {
4
4
  Diagnostic,
5
5
  DiagnosticSeverity,
package/src/main.ts CHANGED
@@ -9,9 +9,9 @@ import { homedir, tmpdir } from "node:os";
9
9
  import { join, resolve } from "node:path";
10
10
  import { createInterface } from "node:readline/promises";
11
11
  import { type ImageContent, supportsXhigh } from "@oh-my-pi/pi-ai";
12
+ import { initTheme, stopThemeWatcher } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
12
13
  import { postmortem } from "@oh-my-pi/pi-utils";
13
14
  import chalk from "chalk";
14
- import { initTheme, stopThemeWatcher } from "$c/modes/theme/theme";
15
15
  import { type Args, parseArgs, printHelp } from "./cli/args";
16
16
  import { parseConfigArgs, printConfigHelp, runConfigCommand } from "./cli/config-cli";
17
17
  import { processFileArguments } from "./cli/file-processor";
package/src/mcp/config.ts CHANGED
@@ -4,9 +4,9 @@
4
4
  * Uses the capability system to load MCP servers from multiple sources.
5
5
  */
6
6
 
7
- import { mcpCapability } from "$c/capability/mcp";
8
- import type { MCPServer } from "$c/discovery";
9
- import { loadCapability } from "$c/discovery";
7
+ import { mcpCapability } from "@oh-my-pi/pi-coding-agent/capability/mcp";
8
+ import type { MCPServer } from "@oh-my-pi/pi-coding-agent/discovery";
9
+ import { loadCapability } from "@oh-my-pi/pi-coding-agent/discovery";
10
10
  import type { MCPServerConfig } from "./types";
11
11
 
12
12
  /** Options for loading MCP configs */
package/src/mcp/loader.ts CHANGED
@@ -4,9 +4,9 @@
4
4
  * Integrates MCP tool discovery with the custom tools system.
5
5
  */
6
6
 
7
+ import type { LoadedCustomTool } from "@oh-my-pi/pi-coding-agent/extensibility/custom-tools/types";
8
+ import { AgentStorage } from "@oh-my-pi/pi-coding-agent/session/agent-storage";
7
9
  import { logger } from "@oh-my-pi/pi-utils";
8
- import type { LoadedCustomTool } from "$c/extensibility/custom-tools/types";
9
- import { AgentStorage } from "$c/session/agent-storage";
10
10
  import { type MCPLoadResult, MCPManager } from "./manager";
11
11
  import { MCPToolCache } from "./tool-cache";
12
12
 
@@ -5,9 +5,9 @@
5
5
  * Handles tool loading and lifecycle.
6
6
  */
7
7
 
8
+ import type { CustomTool } from "@oh-my-pi/pi-coding-agent/extensibility/custom-tools/types";
8
9
  import { logger } from "@oh-my-pi/pi-utils";
9
10
  import type { TSchema } from "@sinclair/typebox";
10
- import type { CustomTool } from "$c/extensibility/custom-tools/types";
11
11
  import { connectToServer, disconnectServer, listTools } from "./client";
12
12
  import { loadAllMCPConfigs, validateServerConfig } from "./config";
13
13
  import type { MCPToolDetails } from "./tool-bridge";
@@ -5,9 +5,13 @@
5
5
  */
6
6
 
7
7
  import type { AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
8
+ import type { SourceMeta } from "@oh-my-pi/pi-coding-agent/capability/types";
9
+ import type {
10
+ CustomTool,
11
+ CustomToolContext,
12
+ CustomToolResult,
13
+ } from "@oh-my-pi/pi-coding-agent/extensibility/custom-tools/types";
8
14
  import type { TSchema } from "@sinclair/typebox";
9
- import type { SourceMeta } from "$c/capability/types";
10
- import type { CustomTool, CustomToolContext, CustomToolResult } from "$c/extensibility/custom-tools/types";
11
15
  import { callTool } from "./client";
12
16
  import type { MCPContent, MCPServerConnection, MCPToolDefinition } from "./types";
13
17
 
@@ -4,8 +4,8 @@
4
4
  * Stores tool definitions per server in agent.db for fast startup.
5
5
  */
6
6
 
7
+ import type { AgentStorage } from "@oh-my-pi/pi-coding-agent/session/agent-storage";
7
8
  import { logger } from "@oh-my-pi/pi-utils";
8
- import type { AgentStorage } from "$c/session/agent-storage";
9
9
  import type { MCPServerConfig, MCPToolDefinition } from "./types";
10
10
 
11
11
  const CACHE_VERSION = 1;
@@ -11,7 +11,7 @@ import type {
11
11
  MCPHttpServerConfig,
12
12
  MCPSseServerConfig,
13
13
  MCPTransport,
14
- } from "$c/mcp/types";
14
+ } from "@oh-my-pi/pi-coding-agent/mcp/types";
15
15
 
16
16
  /** Generate unique request ID */
17
17
  function generateId(): string {
@@ -5,8 +5,8 @@
5
5
  * Messages are newline-delimited JSON.
6
6
  */
7
7
 
8
+ import type { JsonRpcResponse, MCPStdioServerConfig, MCPTransport } from "@oh-my-pi/pi-coding-agent/mcp/types";
8
9
  import { type Subprocess, spawn } from "bun";
9
- import type { JsonRpcResponse, MCPStdioServerConfig, MCPTransport } from "$c/mcp/types";
10
10
 
11
11
  /** Generate unique request ID */
12
12
  function generateId(): string {
package/src/migrations.ts CHANGED
@@ -4,10 +4,10 @@
4
4
 
5
5
  import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
6
6
  import { join } from "node:path";
7
+ import { AgentStorage } from "@oh-my-pi/pi-coding-agent/session/agent-storage";
8
+ import type { AuthCredential } from "@oh-my-pi/pi-coding-agent/session/auth-storage";
7
9
  import { logger } from "@oh-my-pi/pi-utils";
8
10
  import chalk from "chalk";
9
- import { AgentStorage } from "$c/session/agent-storage";
10
- import type { AuthCredential } from "$c/session/auth-storage";
11
11
  import { getAgentDbPath, getAgentDir, getBinDir } from "./config";
12
12
 
13
13
  /**
@@ -2,8 +2,8 @@
2
2
  * Armin says hi! A fun easter egg with animated XBM art.
3
3
  */
4
4
 
5
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
5
6
  import type { Component, TUI } from "@oh-my-pi/pi-tui";
6
- import { theme } from "$c/modes/theme/theme";
7
7
 
8
8
  // XBM image: 31x36 pixels, LSB first, 1=background, 0=foreground
9
9
  const WIDTH = 31;
@@ -1,6 +1,6 @@
1
1
  import type { AssistantMessage } from "@oh-my-pi/pi-ai";
2
+ import { getMarkdownTheme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
3
  import { Container, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui";
3
- import { getMarkdownTheme, theme } from "$c/modes/theme/theme";
4
4
 
5
5
  /**
6
6
  * Component that renders a complete assistant message
@@ -2,11 +2,11 @@
2
2
  * Component for displaying bash command execution with streaming output.
3
3
  */
4
4
 
5
+ import { getSymbolTheme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
6
+ import type { TruncationMeta } from "@oh-my-pi/pi-coding-agent/tools/output-meta";
7
+ import { formatSize } from "@oh-my-pi/pi-coding-agent/tools/truncate";
5
8
  import { Container, Loader, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui";
6
9
  import stripAnsi from "strip-ansi";
7
- import { getSymbolTheme, theme } from "$c/modes/theme/theme";
8
- import type { TruncationMeta } from "$c/tools/output-meta";
9
- import { formatSize } from "$c/tools/truncate";
10
10
  import { DynamicBorder } from "./dynamic-border";
11
11
  import { truncateToVisualLines } from "./visual-truncate";
12
12
 
@@ -1,5 +1,5 @@
1
+ import type { Theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
1
2
  import { CancellableLoader, Container, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui";
2
- import type { Theme } from "$c/modes/theme/theme";
3
3
  import { DynamicBorder } from "./dynamic-border";
4
4
 
5
5
  /** Loader wrapped with borders for hook UI */
@@ -1,6 +1,6 @@
1
+ import { getMarkdownTheme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
+ import type { BranchSummaryMessage } from "@oh-my-pi/pi-coding-agent/session/messages";
1
3
  import { Box, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui";
2
- import { getMarkdownTheme, theme } from "$c/modes/theme/theme";
3
- import type { BranchSummaryMessage } from "$c/session/messages";
4
4
 
5
5
  /**
6
6
  * Component that renders a branch summary message with collapsed/expanded state.
@@ -1,6 +1,6 @@
1
+ import { getMarkdownTheme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
+ import type { CompactionSummaryMessage } from "@oh-my-pi/pi-coding-agent/session/messages";
1
3
  import { Box, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui";
2
- import { getMarkdownTheme, theme } from "$c/modes/theme/theme";
3
- import type { CompactionSummaryMessage } from "$c/session/messages";
4
4
 
5
5
  /**
6
6
  * Component that renders a compaction message with collapsed/expanded state.
@@ -1,9 +1,9 @@
1
1
  import type { TextContent } from "@oh-my-pi/pi-ai";
2
+ import type { MessageRenderer } from "@oh-my-pi/pi-coding-agent/extensibility/extensions/types";
3
+ import { getMarkdownTheme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
4
+ import type { CustomMessage } from "@oh-my-pi/pi-coding-agent/session/messages";
2
5
  import type { Component } from "@oh-my-pi/pi-tui";
3
6
  import { Box, Container, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui";
4
- import type { MessageRenderer } from "$c/extensibility/extensions/types";
5
- import { getMarkdownTheme, theme } from "$c/modes/theme/theme";
6
- import type { CustomMessage } from "$c/session/messages";
7
7
 
8
8
  /**
9
9
  * Component that renders a custom message entry from extensions.
@@ -1,5 +1,5 @@
1
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
1
2
  import * as Diff from "diff";
2
- import { theme } from "$c/modes/theme/theme";
3
3
 
4
4
  /**
5
5
  * Parse diff line to extract prefix, line number, and content.
@@ -1,5 +1,5 @@
1
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
1
2
  import type { Component } from "@oh-my-pi/pi-tui";
2
- import { theme } from "$c/modes/theme/theme";
3
3
 
4
4
  /**
5
5
  * Dynamic border component that adjusts to viewport width.
@@ -12,10 +12,10 @@
12
12
  * - Esc: Close dashboard (clears search first if active)
13
13
  */
14
14
 
15
+ import type { SettingsManager } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
16
+ import { DynamicBorder } from "@oh-my-pi/pi-coding-agent/modes/components/dynamic-border";
17
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
15
18
  import { type Component, Container, matchesKey, Spacer, Text, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui";
16
- import type { SettingsManager } from "$c/config/settings-manager";
17
- import { DynamicBorder } from "$c/modes/components/dynamic-border";
18
- import { theme } from "$c/modes/theme/theme";
19
19
  import { ExtensionList } from "./extension-list";
20
20
  import { InspectorPanel } from "./inspector-panel";
21
21
  import { applyFilter, createInitialState, filterByProvider, refreshState, toggleProvider } from "./state-manager";
@@ -6,9 +6,9 @@
6
6
  * master switch is off.
7
7
  */
8
8
 
9
+ import { isProviderEnabled } from "@oh-my-pi/pi-coding-agent/discovery";
10
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
9
11
  import { type Component, matchesKey, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui";
10
- import { isProviderEnabled } from "$c/discovery";
11
- import { theme } from "$c/modes/theme/theme";
12
12
  import { applyFilter } from "./state-manager";
13
13
  import type { Extension, ExtensionKind, ExtensionState } from "./types";
14
14
 
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import { homedir } from "node:os";
8
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
8
9
  import { type Component, truncateToWidth, wrapTextWithAnsi } from "@oh-my-pi/pi-tui";
9
- import { theme } from "$c/modes/theme/theme";
10
10
  import type { Extension, ExtensionState } from "./types";
11
11
 
12
12
  export class InspectorPanel implements Component {
@@ -3,18 +3,24 @@
3
3
  * Handles data loading, tree building, filtering, and toggle persistence.
4
4
  */
5
5
 
6
+ import type { ContextFile } from "@oh-my-pi/pi-coding-agent/capability/context-file";
7
+ import type { ExtensionModule } from "@oh-my-pi/pi-coding-agent/capability/extension-module";
8
+ import type { Hook } from "@oh-my-pi/pi-coding-agent/capability/hook";
9
+ import type { MCPServer } from "@oh-my-pi/pi-coding-agent/capability/mcp";
10
+ import type { Prompt } from "@oh-my-pi/pi-coding-agent/capability/prompt";
11
+ import type { Rule } from "@oh-my-pi/pi-coding-agent/capability/rule";
12
+ import type { Skill } from "@oh-my-pi/pi-coding-agent/capability/skill";
13
+ import type { SlashCommand } from "@oh-my-pi/pi-coding-agent/capability/slash-command";
14
+ import type { CustomTool } from "@oh-my-pi/pi-coding-agent/capability/tool";
15
+ import type { SourceMeta } from "@oh-my-pi/pi-coding-agent/capability/types";
16
+ import {
17
+ disableProvider,
18
+ enableProvider,
19
+ getAllProvidersInfo,
20
+ isProviderEnabled,
21
+ loadCapability,
22
+ } from "@oh-my-pi/pi-coding-agent/discovery";
6
23
  import { logger } from "@oh-my-pi/pi-utils";
7
- import type { ContextFile } from "$c/capability/context-file";
8
- import type { ExtensionModule } from "$c/capability/extension-module";
9
- import type { Hook } from "$c/capability/hook";
10
- import type { MCPServer } from "$c/capability/mcp";
11
- import type { Prompt } from "$c/capability/prompt";
12
- import type { Rule } from "$c/capability/rule";
13
- import type { Skill } from "$c/capability/skill";
14
- import type { SlashCommand } from "$c/capability/slash-command";
15
- import type { CustomTool } from "$c/capability/tool";
16
- import type { SourceMeta } from "$c/capability/types";
17
- import { disableProvider, enableProvider, getAllProvidersInfo, isProviderEnabled, loadCapability } from "$c/discovery";
18
24
  import type {
19
25
  DashboardState,
20
26
  Extension,
@@ -2,7 +2,7 @@
2
2
  * Types for the Extension Control Center dashboard.
3
3
  */
4
4
 
5
- import type { SourceMeta } from "$c/capability/types";
5
+ import type { SourceMeta } from "@oh-my-pi/pi-coding-agent/capability/types";
6
6
 
7
7
  /**
8
8
  * Extension kinds matching capability types.
@@ -1,10 +1,10 @@
1
1
  import { existsSync, type FSWatcher, readFileSync, watch } from "node:fs";
2
2
  import type { AssistantMessage } from "@oh-my-pi/pi-ai";
3
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
4
+ import type { AgentSession } from "@oh-my-pi/pi-coding-agent/session/agent-session";
5
+ import { shortenPath } from "@oh-my-pi/pi-coding-agent/tools/render-utils";
3
6
  import { type Component, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui";
4
7
  import { dirname, join } from "path";
5
- import { theme } from "$c/modes/theme/theme";
6
- import type { AgentSession } from "$c/session/agent-session";
7
- import { shortenPath } from "$c/tools/render-utils";
8
8
 
9
9
  /**
10
10
  * Sanitize text for display in a single-line status.
@@ -1,3 +1,5 @@
1
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
+ import type { HistoryEntry, HistoryStorage } from "@oh-my-pi/pi-coding-agent/session/history-storage";
1
3
  import {
2
4
  type Component,
3
5
  Container,
@@ -8,8 +10,6 @@ import {
8
10
  truncateToWidth,
9
11
  visibleWidth,
10
12
  } from "@oh-my-pi/pi-tui";
11
- import { theme } from "$c/modes/theme/theme";
12
- import type { HistoryEntry, HistoryStorage } from "$c/session/history-storage";
13
13
  import { DynamicBorder } from "./dynamic-border";
14
14
 
15
15
  class HistoryResultsList implements Component {
@@ -6,9 +6,9 @@
6
6
  import { rm } from "node:fs/promises";
7
7
  import * as os from "node:os";
8
8
  import * as path from "node:path";
9
+ import { getEditorTheme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
9
10
  import { Container, Editor, matchesKey, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui";
10
11
  import { nanoid } from "nanoid";
11
- import { getEditorTheme, theme } from "$c/modes/theme/theme";
12
12
  import { DynamicBorder } from "./dynamic-border";
13
13
 
14
14
  export class HookEditorComponent extends Container {
@@ -2,8 +2,8 @@
2
2
  * Simple text input component for hooks.
3
3
  */
4
4
 
5
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
5
6
  import { Container, Input, matchesKey, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui";
6
- import { theme } from "$c/modes/theme/theme";
7
7
  import { CountdownTimer } from "./countdown-timer";
8
8
  import { DynamicBorder } from "./dynamic-border";
9
9
 
@@ -1,9 +1,9 @@
1
1
  import type { TextContent } from "@oh-my-pi/pi-ai";
2
+ import type { HookMessageRenderer } from "@oh-my-pi/pi-coding-agent/extensibility/hooks/types";
3
+ import { getMarkdownTheme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
4
+ import type { HookMessage } from "@oh-my-pi/pi-coding-agent/session/messages";
2
5
  import type { Component } from "@oh-my-pi/pi-tui";
3
6
  import { Box, Container, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui";
4
- import type { HookMessageRenderer } from "$c/extensibility/hooks/types";
5
- import { getMarkdownTheme, theme } from "$c/modes/theme/theme";
6
- import type { HookMessage } from "$c/session/messages";
7
7
 
8
8
  /**
9
9
  * Component that renders a custom message entry from hooks.
@@ -3,8 +3,8 @@
3
3
  * Displays a list of string options with keyboard navigation.
4
4
  */
5
5
 
6
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
6
7
  import { Container, matchesKey, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui";
7
- import { theme } from "$c/modes/theme/theme";
8
8
  import { CountdownTimer } from "./countdown-timer";
9
9
  import { DynamicBorder } from "./dynamic-border";
10
10
 
@@ -2,9 +2,9 @@
2
2
  * Utilities for formatting keybinding hints in the UI.
3
3
  */
4
4
 
5
+ import type { AppAction, KeybindingsManager } from "@oh-my-pi/pi-coding-agent/config/keybindings";
6
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
5
7
  import { type EditorAction, getEditorKeybindings, type KeyId } from "@oh-my-pi/pi-tui";
6
- import type { AppAction, KeybindingsManager } from "$c/config/keybindings";
7
- import { theme } from "$c/modes/theme/theme";
8
8
 
9
9
  /**
10
10
  * Format keys array as display string (e.g., ["ctrl+c", "escape"] -> "ctrl+c/escape").
@@ -1,7 +1,7 @@
1
1
  import { getOAuthProviders } from "@oh-my-pi/pi-ai";
2
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
3
  import { Container, getEditorKeybindings, Input, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui";
3
4
  import { $ } from "bun";
4
- import { theme } from "$c/modes/theme/theme";
5
5
  import { DynamicBorder } from "./dynamic-border";
6
6
 
7
7
  /**
@@ -1,4 +1,9 @@
1
1
  import { type Model, modelsAreEqual } from "@oh-my-pi/pi-ai";
2
+ import type { ModelRegistry } from "@oh-my-pi/pi-coding-agent/config/model-registry";
3
+ import { parseModelString } from "@oh-my-pi/pi-coding-agent/config/model-resolver";
4
+ import type { SettingsManager } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
5
+ import { type ThemeColor, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
6
+ import { fuzzyFilter } from "@oh-my-pi/pi-coding-agent/utils/fuzzy";
2
7
  import {
3
8
  Container,
4
9
  Input,
@@ -11,11 +16,6 @@ import {
11
16
  type TUI,
12
17
  visibleWidth,
13
18
  } from "@oh-my-pi/pi-tui";
14
- import type { ModelRegistry } from "$c/config/model-registry";
15
- import { parseModelString } from "$c/config/model-resolver";
16
- import type { SettingsManager } from "$c/config/settings-manager";
17
- import { type ThemeColor, theme } from "$c/modes/theme/theme";
18
- import { fuzzyFilter } from "$c/utils/fuzzy";
19
19
  import { DynamicBorder } from "./dynamic-border";
20
20
 
21
21
  function makeInvertedBadge(label: string, color: ThemeColor): string {
@@ -1,7 +1,7 @@
1
1
  import { getOAuthProviders, type OAuthProviderInfo } from "@oh-my-pi/pi-ai";
2
+ import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
3
+ import type { AuthStorage } from "@oh-my-pi/pi-coding-agent/session/auth-storage";
2
4
  import { Container, matchesKey, Spacer, TruncatedText } from "@oh-my-pi/pi-tui";
3
- import { theme } from "$c/modes/theme/theme";
4
- import type { AuthStorage } from "$c/session/auth-storage";
5
5
  import { DynamicBorder } from "./dynamic-border";
6
6
 
7
7
  /**
@@ -8,6 +8,9 @@
8
8
  * - Config value editor
9
9
  */
10
10
 
11
+ import { PluginManager } from "@oh-my-pi/pi-coding-agent/extensibility/plugins/manager";
12
+ import type { InstalledPlugin, PluginSettingSchema } from "@oh-my-pi/pi-coding-agent/extensibility/plugins/types";
13
+ import { getSelectListTheme, getSettingsListTheme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
11
14
  import {
12
15
  Container,
13
16
  Input,
@@ -18,9 +21,6 @@ import {
18
21
  Spacer,
19
22
  Text,
20
23
  } from "@oh-my-pi/pi-tui";
21
- import { PluginManager } from "$c/extensibility/plugins/manager";
22
- import type { InstalledPlugin, PluginSettingSchema } from "$c/extensibility/plugins/types";
23
- import { getSelectListTheme, getSettingsListTheme, theme } from "$c/modes/theme/theme";
24
24
  import { DynamicBorder } from "./dynamic-border";
25
25
 
26
26
  // =============================================================================
@@ -3,11 +3,11 @@
3
3
  * Shares the same kernel session as the agent's Python tool.
4
4
  */
5
5
 
6
+ import { getSymbolTheme, highlightCode, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
7
+ import type { TruncationMeta } from "@oh-my-pi/pi-coding-agent/tools/output-meta";
8
+ import { formatSize } from "@oh-my-pi/pi-coding-agent/tools/truncate";
6
9
  import { Container, Loader, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui";
7
10
  import stripAnsi from "strip-ansi";
8
- import { getSymbolTheme, highlightCode, theme } from "$c/modes/theme/theme";
9
- import type { TruncationMeta } from "$c/tools/output-meta";
10
- import { formatSize } from "$c/tools/truncate";
11
11
  import { DynamicBorder } from "./dynamic-border";
12
12
  import { truncateToVisualLines } from "./visual-truncate";
13
13
 
@@ -1,5 +1,5 @@
1
+ import { getSelectListTheme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
1
2
  import { Container, type SelectItem, SelectList } from "@oh-my-pi/pi-tui";
2
- import { getSelectListTheme } from "$c/modes/theme/theme";
3
3
  import { DynamicBorder } from "./dynamic-border";
4
4
 
5
5
  /**