@oh-my-pi/pi-coding-agent 17.2.9 → 17.2.11

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 (281) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/dist/{CHANGELOG-8yy8h3bc.md → CHANGELOG-d9xenpn9.md} +83 -0
  3. package/dist/cli.js +10208 -12596
  4. package/dist/types/capability/mcp.d.ts +11 -0
  5. package/dist/types/capability/skill.d.ts +6 -0
  6. package/dist/types/cli/args.d.ts +1 -0
  7. package/dist/types/cli/command-help.d.ts +3 -0
  8. package/dist/types/commands/share.d.ts +25 -0
  9. package/dist/types/commit/agentic/index.d.ts +3 -1
  10. package/dist/types/commit/execute.d.ts +32 -0
  11. package/dist/types/commit/index.d.ts +2 -1
  12. package/dist/types/commit/pipeline.d.ts +7 -1
  13. package/dist/types/config/model-registry.d.ts +4 -0
  14. package/dist/types/config/model-resolver.d.ts +13 -0
  15. package/dist/types/config/settings-schema.d.ts +1 -34
  16. package/dist/types/discovery/agent-plugin-format.d.ts +143 -0
  17. package/dist/types/discovery/agent-plugins.d.ts +1 -0
  18. package/dist/types/discovery/contained-path.d.ts +34 -0
  19. package/dist/types/discovery/index.d.ts +1 -0
  20. package/dist/types/extensibility/custom-commands/types.d.ts +5 -5
  21. package/dist/types/extensibility/custom-tools/types.d.ts +3 -3
  22. package/dist/types/extensibility/extensions/loader.d.ts +9 -2
  23. package/dist/types/extensibility/extensions/types.d.ts +45 -8
  24. package/dist/types/extensibility/hooks/types.d.ts +5 -5
  25. package/dist/types/extensibility/shared-events.d.ts +3 -2
  26. package/dist/types/extensibility/skills.d.ts +5 -0
  27. package/dist/types/index.d.ts +2 -2
  28. package/dist/types/main.d.ts +1 -1
  29. package/dist/types/mcp/transports/header-policy.d.ts +45 -0
  30. package/dist/types/mcp/types.d.ts +15 -0
  31. package/dist/types/modes/acp/acp-agent.d.ts +1 -1
  32. package/dist/types/modes/acp/acp-client-bridge.d.ts +1 -1
  33. package/dist/types/modes/acp/acp-event-mapper.d.ts +1 -1
  34. package/dist/types/modes/acp/acp-mode.d.ts +1 -1
  35. package/dist/types/modes/components/agent-hub-projection.d.ts +38 -0
  36. package/dist/types/modes/components/agent-hub-renderer.d.ts +41 -0
  37. package/dist/types/modes/components/agent-hub.d.ts +14 -5
  38. package/dist/types/modes/components/agent-transcript-viewer.d.ts +2 -0
  39. package/dist/types/modes/components/chat-transcript-builder.d.ts +2 -0
  40. package/dist/types/modes/components/custom-editor.d.ts +1 -2
  41. package/dist/types/modes/components/model-browser.d.ts +9 -1
  42. package/dist/types/modes/components/status-line/types.d.ts +2 -0
  43. package/dist/types/modes/components/tool-execution.d.ts +2 -0
  44. package/dist/types/modes/interactive-mode.d.ts +8 -1
  45. package/dist/types/modes/utils/transcript-render-helpers.d.ts +3 -2
  46. package/dist/types/registry/agent-registry.d.ts +47 -0
  47. package/dist/types/registry/persisted-agents.d.ts +3 -1
  48. package/dist/types/secrets/index.d.ts +23 -1
  49. package/dist/types/session/agent-session-events.d.ts +2 -2
  50. package/dist/types/session/agent-session.d.ts +4 -2
  51. package/dist/types/session/messages.d.ts +1 -0
  52. package/dist/types/session/prewalk.d.ts +3 -1
  53. package/dist/types/session/session-entries.d.ts +10 -0
  54. package/dist/types/session/session-loader.d.ts +11 -1
  55. package/dist/types/session/session-manager.d.ts +9 -1
  56. package/dist/types/session/session-tools.d.ts +18 -1
  57. package/dist/types/session/turn-recovery.d.ts +7 -2
  58. package/dist/types/slash-commands/acp-builtins.d.ts +1 -1
  59. package/dist/types/slash-commands/available-commands.d.ts +1 -1
  60. package/dist/types/task/executor.d.ts +6 -0
  61. package/dist/types/task/index.d.ts +4 -3
  62. package/dist/types/task/read-only-policy.d.ts +3 -0
  63. package/dist/types/task/structured-subagent.d.ts +2 -0
  64. package/dist/types/task/types.d.ts +4 -0
  65. package/dist/types/tools/bash.d.ts +3 -3
  66. package/dist/types/tools/browser/launch.d.ts +2 -1
  67. package/dist/types/tools/browser/tab-worker.d.ts +2 -2
  68. package/dist/types/tools/path-utils.d.ts +1 -0
  69. package/dist/types/tools/read.d.ts +1 -5
  70. package/dist/types/tools/run-scope.d.ts +27 -1
  71. package/dist/types/tools/shell-tokenize.d.ts +16 -0
  72. package/dist/types/tools/terminal-output.d.ts +1 -1
  73. package/dist/types/utils/turndown.d.ts +1 -1
  74. package/dist/types/vibe/runtime.d.ts +2 -3
  75. package/dist/types/web/scrapers/readthedocs.d.ts +0 -3
  76. package/dist/types/web/search/providers/browser-headers.d.ts +2 -3
  77. package/examples/custom-tools/README.md +1 -1
  78. package/examples/extensions/README.md +1 -1
  79. package/examples/extensions/api-demo.ts +5 -6
  80. package/examples/extensions/chalk-logger.ts +1 -1
  81. package/examples/extensions/hello.ts +2 -2
  82. package/examples/extensions/reload-runtime.ts +1 -1
  83. package/examples/extensions/tools.ts +2 -2
  84. package/examples/extensions/with-deps/index.ts +1 -1
  85. package/examples/sdk/06-extensions.ts +1 -1
  86. package/package.json +15 -31
  87. package/scripts/bundle-dist.ts +1 -11
  88. package/scripts/legacy-pi-virtual-module.ts +4 -1
  89. package/src/advisor/runtime.ts +54 -0
  90. package/src/capability/mcp.ts +11 -0
  91. package/src/capability/skill.ts +6 -0
  92. package/src/cli/agents-cli.ts +1 -1
  93. package/src/cli/args.ts +24 -2
  94. package/src/cli/auth-broker-cli.ts +1 -1
  95. package/src/cli/auth-gateway-cli.ts +1 -1
  96. package/src/cli/bench-cli.ts +1 -1
  97. package/src/cli/claude-trace-cli.ts +1 -1
  98. package/src/cli/command-help.ts +4 -0
  99. package/src/cli/config-cli.ts +1 -1
  100. package/src/cli/dry-balance-cli.ts +1 -1
  101. package/src/cli/file-processor.ts +1 -1
  102. package/src/cli/flag-tables.ts +4 -0
  103. package/src/cli/gallery-cli.ts +1 -1
  104. package/src/cli/grep-cli.ts +1 -1
  105. package/src/cli/grievances-cli.ts +1 -1
  106. package/src/cli/help-extra.ts +1 -1
  107. package/src/cli/models-cli.ts +1 -1
  108. package/src/cli/plugin-cli.ts +1 -1
  109. package/src/cli/read-cli.ts +1 -1
  110. package/src/cli/setup-cli.ts +1 -1
  111. package/src/cli/shell-cli.ts +1 -1
  112. package/src/cli/ssh-cli.ts +1 -1
  113. package/src/cli/stats-cli.ts +1 -1
  114. package/src/cli/tiny-models-cli.ts +1 -1
  115. package/src/cli/ttsr-cli.ts +1 -1
  116. package/src/cli/update-cli.ts +1 -1
  117. package/src/cli/usage-cli.ts +1 -1
  118. package/src/cli/web-search-cli.ts +1 -1
  119. package/src/cli/worktree-cli.ts +1 -1
  120. package/src/cli-commands.ts +5 -0
  121. package/src/commands/commit.ts +16 -3
  122. package/src/commands/say.ts +1 -1
  123. package/src/commands/share.ts +71 -0
  124. package/src/commands/token.ts +1 -1
  125. package/src/commit/agentic/agent.ts +1 -1
  126. package/src/commit/agentic/index.ts +39 -21
  127. package/src/commit/cli.ts +1 -1
  128. package/src/commit/execute.ts +56 -0
  129. package/src/commit/index.ts +2 -1
  130. package/src/commit/pipeline.ts +20 -7
  131. package/src/config/model-discovery.ts +1 -1
  132. package/src/config/model-registry.ts +21 -1
  133. package/src/config/model-resolver.ts +54 -7
  134. package/src/config/settings-schema.ts +2 -33
  135. package/src/config/settings.ts +46 -0
  136. package/src/discovery/agent-plugin-format.ts +551 -0
  137. package/src/discovery/agent-plugins.ts +341 -0
  138. package/src/discovery/agents.ts +4 -2
  139. package/src/discovery/builtin-rules/ts-no-inline-cast-access.md +5 -4
  140. package/src/discovery/builtin-rules/ts-no-tiny-functions.md +1 -1
  141. package/src/discovery/claude-plugins.ts +21 -5
  142. package/src/discovery/contained-path.ts +78 -0
  143. package/src/discovery/helpers.ts +23 -9
  144. package/src/discovery/index.ts +1 -0
  145. package/src/discovery/omp-plugins.ts +20 -7
  146. package/src/eval/py/runner.py +38 -1
  147. package/src/exec/non-interactive-env.ts +1 -0
  148. package/src/extensibility/custom-commands/loader.ts +4 -4
  149. package/src/extensibility/custom-commands/types.ts +5 -5
  150. package/src/extensibility/custom-tools/loader.ts +4 -4
  151. package/src/extensibility/custom-tools/types.ts +3 -3
  152. package/src/extensibility/extensions/loader.ts +85 -20
  153. package/src/extensibility/extensions/runner.ts +6 -0
  154. package/src/extensibility/extensions/types.ts +51 -8
  155. package/src/extensibility/hooks/loader.ts +4 -5
  156. package/src/extensibility/hooks/types.ts +5 -5
  157. package/src/extensibility/plugins/legacy-pi-compat.ts +53 -0
  158. package/src/extensibility/plugins/marketplace/manager.ts +2 -1
  159. package/src/extensibility/shared-events.ts +3 -2
  160. package/src/extensibility/skills.ts +9 -0
  161. package/src/index.ts +2 -2
  162. package/src/internal-urls/memory-protocol.ts +5 -1
  163. package/src/internal-urls/skill-protocol.ts +14 -0
  164. package/src/internal-urls/vault-protocol.ts +2 -2
  165. package/src/launch/client.ts +11 -1
  166. package/src/launch/protocol.ts +7 -2
  167. package/src/launch/terminal-output.ts +1 -1
  168. package/src/main.ts +88 -23
  169. package/src/markit/converters/docx.ts +1 -1
  170. package/src/markit/converters/epub.ts +1 -1
  171. package/src/markit/converters/pptx.ts +1 -1
  172. package/src/markit/converters/xlsx.ts +1 -1
  173. package/src/mcp/config.ts +3 -0
  174. package/src/mcp/manager.ts +12 -9
  175. package/src/mcp/transports/header-policy.ts +95 -0
  176. package/src/mcp/transports/http.ts +35 -52
  177. package/src/mcp/transports/sse.ts +20 -27
  178. package/src/mcp/types.ts +15 -0
  179. package/src/modes/acp/acp-agent.ts +20 -9
  180. package/src/modes/acp/acp-client-bridge.ts +1 -1
  181. package/src/modes/acp/acp-event-mapper.ts +1 -1
  182. package/src/modes/acp/acp-mode.ts +1 -1
  183. package/src/modes/components/agent-dashboard.ts +2 -0
  184. package/src/modes/components/agent-hub-projection.ts +248 -0
  185. package/src/modes/components/agent-hub-renderer.ts +194 -0
  186. package/src/modes/components/agent-hub.ts +674 -207
  187. package/src/modes/components/agent-transcript-viewer.ts +3 -0
  188. package/src/modes/components/assistant-message.ts +1 -1
  189. package/src/modes/components/chat-transcript-builder.ts +3 -0
  190. package/src/modes/components/custom-editor.ts +0 -9
  191. package/src/modes/components/extensions/inspector-panel.ts +11 -6
  192. package/src/modes/components/footer.ts +1 -3
  193. package/src/modes/components/model-browser.ts +11 -3
  194. package/src/modes/components/model-hub.ts +4 -1
  195. package/src/modes/components/status-line/component.ts +1 -0
  196. package/src/modes/components/status-line/segments.ts +10 -7
  197. package/src/modes/components/status-line/types.ts +2 -0
  198. package/src/modes/components/tool-execution.ts +13 -16
  199. package/src/modes/components/tree-selector.ts +62 -3
  200. package/src/modes/controllers/command-controller.ts +4 -1
  201. package/src/modes/controllers/event-controller.ts +44 -20
  202. package/src/modes/controllers/extension-ui-controller.ts +2 -2
  203. package/src/modes/controllers/input-controller.ts +20 -2
  204. package/src/modes/controllers/mcp-command-controller.ts +81 -20
  205. package/src/modes/controllers/selector-controller.ts +41 -49
  206. package/src/modes/controllers/streaming-reveal.ts +1 -1
  207. package/src/modes/interactive-mode.ts +13 -2
  208. package/src/modes/rpc/rpc-mode.ts +2 -2
  209. package/src/modes/runtime-init.ts +1 -1
  210. package/src/modes/theme/theme.ts +2 -2
  211. package/src/modes/utils/transcript-render-helpers.ts +4 -2
  212. package/src/modes/utils/ui-helpers.ts +1 -0
  213. package/src/prompts/tools/computer.md +1 -1
  214. package/src/registry/agent-lifecycle.ts +14 -7
  215. package/src/registry/agent-registry.ts +65 -2
  216. package/src/registry/persisted-agents.ts +341 -16
  217. package/src/sdk.ts +6 -49
  218. package/src/secrets/index.ts +52 -1
  219. package/src/session/agent-session-events.ts +2 -2
  220. package/src/session/agent-session.ts +54 -16
  221. package/src/session/messages.ts +1 -0
  222. package/src/session/prewalk.ts +57 -17
  223. package/src/session/session-context.ts +3 -5
  224. package/src/session/session-entries.ts +10 -0
  225. package/src/session/session-handoff.ts +5 -1
  226. package/src/session/session-listing.ts +1 -1
  227. package/src/session/session-loader.ts +74 -8
  228. package/src/session/session-manager.ts +22 -2
  229. package/src/session/session-paths.ts +57 -9
  230. package/src/session/session-tools.ts +65 -4
  231. package/src/session/todo-tracker.ts +11 -1
  232. package/src/session/turn-recovery.ts +96 -74
  233. package/src/slash-commands/acp-builtins.ts +1 -1
  234. package/src/slash-commands/available-commands.ts +1 -1
  235. package/src/slash-commands/builtin-registry.ts +12 -8
  236. package/src/task/executor.ts +70 -20
  237. package/src/task/index.ts +30 -34
  238. package/src/task/isolation-runner.ts +24 -11
  239. package/src/task/persisted-revive.ts +12 -5
  240. package/src/task/read-only-policy.ts +27 -0
  241. package/src/task/structured-subagent.ts +14 -4
  242. package/src/task/types.ts +4 -0
  243. package/src/tools/auto-generated-guard.ts +1 -1
  244. package/src/tools/bash-interactive.ts +4 -4
  245. package/src/tools/bash-skill-urls.ts +15 -0
  246. package/src/tools/bash.ts +16 -17
  247. package/src/tools/browser/cmux/cmux-tab.ts +66 -18
  248. package/src/tools/browser/launch.ts +41 -12
  249. package/src/tools/browser/readable.ts +9 -9
  250. package/src/tools/browser/tab-supervisor.ts +12 -3
  251. package/src/tools/browser/tab-worker-entry.ts +1 -1
  252. package/src/tools/browser/tab-worker.ts +101 -12
  253. package/src/tools/debug.ts +1 -1
  254. package/src/tools/fetch.ts +1 -1
  255. package/src/tools/jtd-to-json-schema.ts +123 -21
  256. package/src/tools/path-utils.ts +9 -2
  257. package/src/tools/read.ts +21 -9
  258. package/src/tools/run-scope.ts +290 -4
  259. package/src/tools/shell-tokenize.ts +98 -0
  260. package/src/tools/terminal-output.ts +1 -1
  261. package/src/tools/todo.ts +1 -1
  262. package/src/utils/clipboard.ts +10 -2
  263. package/src/utils/external-editor.ts +4 -2
  264. package/src/utils/jj.ts +1 -1
  265. package/src/utils/turndown.ts +1 -2
  266. package/src/vibe/runtime.ts +5 -5
  267. package/src/web/scrapers/arxiv.ts +1 -1
  268. package/src/web/scrapers/go-pkg.ts +1 -1
  269. package/src/web/scrapers/iacr.ts +1 -1
  270. package/src/web/scrapers/readthedocs.ts +2 -1
  271. package/src/web/scrapers/twitter.ts +2 -2
  272. package/src/web/scrapers/types.ts +1 -1
  273. package/src/web/scrapers/wikipedia.ts +1 -1
  274. package/src/web/search/providers/browser-headers.ts +12 -39
  275. package/src/web/search/providers/codex.ts +3 -26
  276. package/src/web/search/providers/ecosia.ts +1 -1
  277. package/src/web/search/providers/exa.ts +1 -1
  278. package/src/web/search/providers/google.ts +1 -1
  279. package/src/web/search/providers/mojeek.ts +1 -1
  280. package/src/web/search/providers/startpage.ts +1 -1
  281. package/src/markit/converters/mammoth.d.ts +0 -24
@@ -200,7 +200,8 @@ export interface AutoRetryStartEvent {
200
200
  errorMessage: string;
201
201
  errorId?: number;
202
202
  }
203
- export interface RecoveredRetryError {
203
+ /** Persisted retry error whose transcript presentation changed when the retry saga settled. */
204
+ export interface RetryErrorUpdate {
204
205
  entryId: string;
205
206
  persistenceKey?: string;
206
207
  note: string;
@@ -212,7 +213,7 @@ export interface AutoRetryEndEvent {
212
213
  success: boolean;
213
214
  attempt: number;
214
215
  finalError?: string;
215
- recoveredErrors?: RecoveredRetryError[];
216
+ retryErrors?: RetryErrorUpdate[];
216
217
  }
217
218
  /** Fired when TTSR rule matching interrupts generation */
218
219
  export interface TtsrTriggeredEvent {
@@ -13,6 +13,11 @@ export interface Skill {
13
13
  * prompt's `<skills>` listing.
14
14
  */
15
15
  hide?: boolean;
16
+ /**
17
+ * Filesystem-resolved plugin root for Agent Plugin skills (spec §4.1):
18
+ * every `skill://` resource access must realpath-resolve within it.
19
+ */
20
+ containRoot?: string;
16
21
  /** Source metadata for display */
17
22
  _source?: SourceMeta;
18
23
  }
@@ -1,8 +1,8 @@
1
1
  import { HookEditorComponent, HookInputComponent, HookSelectorComponent } from "./modes/components/index.js";
2
+ export * as zod from "@oh-my-pi/omptype/zod";
3
+ export { z } from "@oh-my-pi/omptype/zod";
2
4
  export { Container, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui";
3
5
  export { getAgentDir, logger, VERSION } from "@oh-my-pi/pi-utils";
4
- export * as zod from "zod/v4";
5
- export { z } from "zod/v4";
6
6
  export * from "./config/keybindings.js";
7
7
  export * from "./config/model-registry.js";
8
8
  export type * from "./config/prompt-templates.js";
@@ -28,7 +28,7 @@ export interface AcpSessionFactoryOptions {
28
28
  sessionDir?: string;
29
29
  authStorage: AuthStorage;
30
30
  modelRegistry: ModelRegistry;
31
- parsedArgs: Pick<Args, "apiKey">;
31
+ parsedArgs: Pick<Args, "apiKey" | "trustedExtensions">;
32
32
  rawArgs: string[];
33
33
  createSession: (options: CreateAgentSessionOptions) => Promise<CreateAgentSessionResult>;
34
34
  }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * HTTP header precedence and redirect-origin policy for remote MCP transports.
3
+ *
4
+ * Two invariants, applied at every transport fetch:
5
+ *
6
+ * 1. Client-generated headers (protocol headers like `Content-Type`, `Accept`,
7
+ * `Mcp-Session-Id`, and authorization) take precedence over configured
8
+ * headers with the same case-insensitive name. Configured headers can never
9
+ * corrupt the MCP wire protocol via casing tricks.
10
+ * 2. Origin-locked servers (Agent Plugins §7.2.1) never forward configured
11
+ * headers to a different origin: redirects are followed manually and
12
+ * configured headers are attached only when the hop targets the configured
13
+ * origin. Method-changing redirects of non-GET requests are refused.
14
+ */
15
+ /** Header buckets for one MCP HTTP request. */
16
+ export interface MCPHeaderSources {
17
+ /** Client-generated HTTP/MCP/authorization headers; win case-insensitively. */
18
+ generated: Record<string, string>;
19
+ /** Configured headers from the server entry (package or user config). */
20
+ configured?: Record<string, string>;
21
+ }
22
+ /**
23
+ * Merge configured headers under client-generated ones: a configured entry is
24
+ * dropped when a generated header with the same case-insensitive name exists.
25
+ */
26
+ export declare function mergeMCPHeaders({ generated, configured }: MCPHeaderSources): Record<string, string>;
27
+ /**
28
+ * Set a client-generated header, removing any existing entry with the same
29
+ * case-insensitive name so the generated value is the only one sent.
30
+ */
31
+ export declare function setGeneratedHeader(headers: Record<string, string>, name: string, value: string): void;
32
+ export interface MCPFetchInit {
33
+ method: "GET" | "POST" | "DELETE";
34
+ body?: string;
35
+ signal?: AbortSignal;
36
+ }
37
+ /**
38
+ * Fetch an MCP endpoint with header precedence and, for origin-locked servers,
39
+ * manual redirect handling that strips configured headers on cross-origin hops.
40
+ *
41
+ * Non-locked servers keep the platform default redirect behavior. Locked
42
+ * non-GET requests only follow 307/308 (method-preserving); a 301/302/303
43
+ * redirect of a JSON-RPC POST is a connection error, never a silent GET.
44
+ */
45
+ export declare function mcpFetch(url: string, init: MCPFetchInit, sources: MCPHeaderSources, originLocked: boolean): Promise<Response>;
@@ -82,6 +82,13 @@ export interface MCPStdioServerConfig extends MCPServerConfigBase {
82
82
  command: string;
83
83
  args?: string[];
84
84
  env?: Record<string, string>;
85
+ /**
86
+ * `literal`: env values are opaque plugin package data (Agent Plugins
87
+ * §§4.1/9.2) — no env-name lookup, no `!command` execution, no dropping of
88
+ * empty values. The provider already applied the only permitted expansion
89
+ * (`${PLUGIN_ROOT}`/`${PLUGIN_DATA}`).
90
+ */
91
+ envPolicy?: "literal";
85
92
  cwd?: string;
86
93
  }
87
94
  /** HTTP server configuration (Streamable HTTP transport) */
@@ -89,12 +96,20 @@ export interface MCPHttpServerConfig extends MCPServerConfigBase {
89
96
  type: "http";
90
97
  url: string;
91
98
  headers?: Record<string, string>;
99
+ /**
100
+ * `origin-locked`: configured headers are literal package data pinned to the
101
+ * configured URL's origin (Agent Plugins §7.2.1) — never expanded, never
102
+ * forwarded cross-origin, and client-generated headers win case-insensitively.
103
+ */
104
+ headerPolicy?: "origin-locked";
92
105
  }
93
106
  /** SSE server configuration (deprecated, use HTTP) */
94
107
  export interface MCPSseServerConfig extends MCPServerConfigBase {
95
108
  type: "sse";
96
109
  url: string;
97
110
  headers?: Record<string, string>;
111
+ /** See {@link MCPHttpServerConfig.headerPolicy}. */
112
+ headerPolicy?: "origin-locked";
98
113
  }
99
114
  export type MCPServerConfig = MCPStdioServerConfig | MCPHttpServerConfig | MCPSseServerConfig;
100
115
  export declare const MCP_CONFIG_SCHEMA_URL = "https://raw.githubusercontent.com/can1357/oh-my-pi/main/packages/coding-agent/src/config/mcp-schema.json";
@@ -1,5 +1,5 @@
1
- import { type Agent, type AgentSideConnection, type AuthenticateRequest, type AuthenticateResponse, type ClientCapabilities, type CloseSessionRequest, type CloseSessionResponse, type ForkSessionRequest, type ForkSessionResponse, type InitializeRequest, type InitializeResponse, type ListSessionsRequest, type ListSessionsResponse, type LoadSessionRequest, type LoadSessionResponse, type NewSessionRequest, type NewSessionResponse, type PromptRequest, type PromptResponse, type ResumeSessionRequest, type ResumeSessionResponse, type SetSessionConfigOptionRequest, type SetSessionConfigOptionResponse, type SetSessionModeRequest, type SetSessionModeResponse } from "@agentclientprotocol/sdk";
2
1
  import { type postmortem } from "@oh-my-pi/pi-utils";
2
+ import { type Agent, type AgentSideConnection, type AuthenticateRequest, type AuthenticateResponse, type ClientCapabilities, type CloseSessionRequest, type CloseSessionResponse, type ForkSessionRequest, type ForkSessionResponse, type InitializeRequest, type InitializeResponse, type ListSessionsRequest, type ListSessionsResponse, type LoadSessionRequest, type LoadSessionResponse, type NewSessionRequest, type NewSessionResponse, type PromptRequest, type PromptResponse, type ResumeSessionRequest, type ResumeSessionResponse, type SetSessionConfigOptionRequest, type SetSessionConfigOptionResponse, type SetSessionModeRequest, type SetSessionModeResponse } from "@oh-my-pi/pi-utils/acp";
3
3
  import { type ExtensionUIContext } from "../../extensibility/extensions/index.js";
4
4
  import type { AgentSession } from "../../session/agent-session.js";
5
5
  /**
@@ -4,6 +4,6 @@
4
4
  * `AgentSession`) can route through the client when it advertises the
5
5
  * relevant capabilities at `initialize` time.
6
6
  */
7
- import type { AgentSideConnection, ClientCapabilities } from "@agentclientprotocol/sdk";
7
+ import type { AgentSideConnection, ClientCapabilities } from "@oh-my-pi/pi-utils/acp";
8
8
  import type { ClientBridge } from "../../session/client-bridge.js";
9
9
  export declare function createAcpClientBridge(connection: AgentSideConnection, sessionId: string, clientCapabilities: ClientCapabilities | undefined): ClientBridge;
@@ -1,4 +1,4 @@
1
- import type { SessionNotification, SessionUpdate, ToolKind } from "@agentclientprotocol/sdk";
1
+ import type { SessionNotification, SessionUpdate, ToolKind } from "@oh-my-pi/pi-utils/acp";
2
2
  import type { AgentSessionEvent } from "../../session/agent-session.js";
3
3
  interface MessageProgress {
4
4
  textEmitted: boolean;
@@ -1,4 +1,4 @@
1
- import { AgentSideConnection, type Stream } from "@agentclientprotocol/sdk";
1
+ import { AgentSideConnection, type Stream } from "@oh-my-pi/pi-utils/acp";
2
2
  import type { AgentSession } from "../../session/agent-session.js";
3
3
  import { AcpAgent } from "./acp-agent.js";
4
4
  /** Creates sessions requested by an ACP client. */
@@ -0,0 +1,38 @@
1
+ import type { AgentMetricsSummary, AgentRef, AgentStatus } from "../../registry/agent-registry.js";
2
+ import type { ObservableSession } from "../session-observer-registry.js";
3
+ export type AgentMetrics = AgentMetricsSummary;
4
+ export interface AggregateMetrics extends AgentMetrics {
5
+ reportedAgents: number;
6
+ /** Rows whose duration is an observer-measured active runtime. */
7
+ activeDurationAgents: number;
8
+ }
9
+ export interface AgentTreeProjection {
10
+ rows: AgentRef[];
11
+ depthById: Map<string, number>;
12
+ parentById: Map<string, string>;
13
+ lastSiblingById: Map<string, boolean>;
14
+ }
15
+ export declare const STATUS_ORDER: Record<AgentStatus, number>;
16
+ /** Exact observer usage for one roster entry. */
17
+ export declare function progressMetrics(observed: ObservableSession | undefined): AgentMetrics | undefined;
18
+ /**
19
+ * Read direct assistant usage from a live session. SessionStats also includes
20
+ * usage embedded in completed `task` tool results, so using it for a parent
21
+ * row would double-count child rows in the aggregate.
22
+ */
23
+ export declare function readSessionMetrics(session: NonNullable<AgentRef["session"]>): AgentMetrics | undefined;
24
+ export declare function aggregateMetrics(args: {
25
+ rows: readonly AgentRef[];
26
+ observedById: ReadonlyMap<string, ObservableSession>;
27
+ metricsFor: (ref: AgentRef, observed: ObservableSession | undefined) => AgentMetrics | undefined;
28
+ fallbackStatsSession: (ref: AgentRef, observed: ObservableSession | undefined) => NonNullable<AgentRef["session"]> | undefined;
29
+ sessionMetrics: WeakMap<object, {
30
+ metrics: AgentMetrics | undefined;
31
+ }>;
32
+ refreshFallback: boolean;
33
+ }): {
34
+ metrics: AggregateMetrics;
35
+ hasFallbackLiveSessions: boolean;
36
+ };
37
+ /** Parent-before-child projection preserving the roster's stable sibling order. */
38
+ export declare function projectAgentTree(refs: readonly AgentRef[]): AgentTreeProjection;
@@ -0,0 +1,41 @@
1
+ import { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
+ import type { Settings } from "../../config/settings.js";
3
+ import { type AgentRef } from "../../registry/agent-registry.js";
4
+ import type { ObservableSession } from "../session-observer-registry.js";
5
+ import type { AgentMetrics } from "./agent-hub-projection.js";
6
+ export interface RosterRender {
7
+ lines: string[];
8
+ hitRows: Array<number | undefined>;
9
+ }
10
+ /** Legacy progress snapshots may omit counters; snapshot absence remains distinct. */
11
+ export declare function metricNumber(value: number | undefined): number;
12
+ /** Compute the max content width for the current terminal, accounting for chrome. */
13
+ export declare function contentWidth(): number;
14
+ /** Remove terminal controls and normalize a value before it reaches the TUI. */
15
+ export declare function sanitizeDisplayText(text: string): string;
16
+ /** Sanitize a line for TUI display and truncate it to the viewport width. */
17
+ export declare function sanitizeLine(text: string, maxWidth?: number): string;
18
+ export declare function clampHubLine(line: string, width: number): string;
19
+ /** Status glyph, colored per theme status conventions. The title-line counts spell out the words. */
20
+ export declare function statusGlyph(status: AgentRef["status"]): string;
21
+ export declare function statusText(status: AgentRef["status"], text: string): string;
22
+ /** Model id + thinking level (`sonnet-4-6 ◒ high`), level colored per theme. */
23
+ export declare function formatModelBadge(modelId: string, level: ThinkingLevel | undefined): string;
24
+ /** Textual model-role tag; color reinforces (but never replaces) the label. */
25
+ export declare function formatRoleBadge(role: string, settings: Settings): string;
26
+ /** Format a resolved selector, preserving provider identity when requested. */
27
+ export declare function formatResolvedModelBadge(resolved: string, preserveProvider?: boolean, fallbackLevel?: ThinkingLevel): string;
28
+ /**
29
+ * Resolved model + reasoning level for a hub row. Exact executor progress is
30
+ * authoritative (and survives completion); direct live sessions are the
31
+ * fallback for agents without an observer snapshot.
32
+ */
33
+ export declare function modelBadge(ref: AgentRef, observed: ObservableSession | undefined): string | undefined;
34
+ export declare function formatMetricDuration(metrics: AgentMetrics): string | undefined;
35
+ export declare function formatCost(cost: number): string;
36
+ export declare function formatMetrics(metrics: AgentMetrics): string;
37
+ export declare function contextGauge(tokens: number, window: number): string;
38
+ /** Fit a child-id preview without joining an arbitrarily large child set. */
39
+ export declare function formatChildIds(children: readonly AgentRef[], width: number): string;
40
+ /** Bash `tree`-style ancestry prefix, clipped from the left on pathological depth. */
41
+ export declare function treeBranch(ref: AgentRef, maxWidth: number, depthById: ReadonlyMap<string, number>, parentById: ReadonlyMap<string, string>, lastSiblingById: ReadonlyMap<string, boolean>): string;
@@ -4,8 +4,8 @@
4
4
  * One overlay, two views:
5
5
  * - Table view: every registered agent except Main (Main IS the ambient
6
6
  * chat), live from the global AgentRegistry — status, unread irc count,
7
- * current/last task, last activity. Select with j/k, Enter opens a chat,
8
- * `r` revives a parked agent, `x` aborts + releases one.
7
+ * current/last task, last activity. Navigate with keys, wheel, hover, and
8
+ * click; `r` revives a parked agent, `x` aborts + releases one.
9
9
  * - Chat view: per-agent transcript (incremental session-file tail, absorbed
10
10
  * from the old session observer overlay) plus an input line. Submitting
11
11
  * revives a parked agent, then prompts/steers it; the message lands in the
@@ -13,9 +13,10 @@
13
13
  *
14
14
  * Replaces the old SessionObserverOverlayComponent (ctrl+s observer).
15
15
  */
16
- import { type AgentTool } from "@oh-my-pi/pi-agent-core";
17
- import { Container, type TUI } from "@oh-my-pi/pi-tui";
16
+ import type { AgentTool } from "@oh-my-pi/pi-agent-core";
17
+ import { Container, type SelectListMouseTarget, type TUI } from "@oh-my-pi/pi-tui";
18
18
  import type { KeyId } from "../../config/keybindings.js";
19
+ import type { Settings } from "../../config/settings.js";
19
20
  import type { MessageRenderer } from "../../extensibility/extensions/types.js";
20
21
  import { IrcBus } from "../../irc/bus.js";
21
22
  import { AgentLifecycleManager } from "../../registry/agent-lifecycle.js";
@@ -39,6 +40,8 @@ export interface AgentHubRemote {
39
40
  export interface AgentHubDeps {
40
41
  /** Progress/status snapshot source (task lifecycle + progress channels). */
41
42
  observers: SessionObserverRegistry;
43
+ /** Production settings used to resolve textual model-role tags. */
44
+ settings?: Settings;
42
45
  /** Keys that toggle the hub closed from inside (app.agents.hub + app.session.observe). */
43
46
  hubKeys: KeyId[];
44
47
  onDone: () => void;
@@ -53,6 +56,8 @@ export interface AgentHubDeps {
53
56
  ui?: TUI;
54
57
  /** Tool lookup for transcript renderers (labels, custom render functions). */
55
58
  getTool?: (name: string) => AgentTool | undefined;
59
+ /** Whether the active registry entry came from a built-in factory. */
60
+ isBuiltInTool?: (name: string) => boolean;
56
61
  /** Extension message renderers for custom messages in the transcript. */
57
62
  getMessageRenderer?: (customType: string) => MessageRenderer | undefined;
58
63
  /** Cwd used by tool renderers for path shortening; defaults to the project dir. */
@@ -69,7 +74,7 @@ export interface AgentHubDeps {
69
74
  /** Collab guest: route actions/transcripts to the host instead of local sessions. */
70
75
  remote?: AgentHubRemote;
71
76
  }
72
- export declare class AgentHubOverlayComponent extends Container {
77
+ export declare class AgentHubOverlayComponent extends Container implements SelectListMouseTarget {
73
78
  #private;
74
79
  /** Resolves after persisted historical subagents have been registered and rows refreshed. */
75
80
  readonly persistedSubagentsReady: Promise<void>;
@@ -101,4 +106,8 @@ export declare class AgentHubOverlayComponent extends Container {
101
106
  * restored when the viewer closes. No-op without a real TUI (render-only test stub).
102
107
  */
103
108
  openChat(id: string): void;
109
+ handleWheel(delta: -1 | 1): void;
110
+ hitTest(line: number): number | undefined;
111
+ setHoverIndex(index: number | null): void;
112
+ clickItem(index: number): void;
104
113
  }
@@ -17,6 +17,8 @@ export interface AgentTranscriptViewerDeps {
17
17
  lifecycle?: () => AgentLifecycleManager;
18
18
  ui: TUI;
19
19
  getTool?: (name: string) => AgentTool | undefined;
20
+ /** Whether the active registry entry came from a built-in factory. */
21
+ isBuiltInTool?: (name: string) => boolean;
20
22
  getMessageRenderer?: (customType: string) => MessageRenderer | undefined;
21
23
  cwd: string;
22
24
  hideThinkingBlock?: () => boolean;
@@ -19,6 +19,8 @@ import { TranscriptContainer } from "./transcript-container.js";
19
19
  export interface ChatTranscriptBuilderDeps {
20
20
  ui: TUI;
21
21
  getTool?: (name: string) => AgentTool | undefined;
22
+ /** Whether the active registry entry came from a built-in factory. */
23
+ isBuiltInTool?: (name: string) => boolean;
22
24
  getMessageRenderer?: (customType: string) => MessageRenderer | undefined;
23
25
  cwd: string;
24
26
  hideThinkingBlock?: () => boolean;
@@ -1,7 +1,7 @@
1
1
  import type { ImageContent } from "@oh-my-pi/pi-ai";
2
2
  import { Editor, type KeyId, TUI } from "@oh-my-pi/pi-tui";
3
3
  import type { AppKeybinding } from "../../config/keybindings.js";
4
- type ConfigurableEditorAction = Extract<AppKeybinding, "app.interrupt" | "app.clear" | "app.exit" | "app.suspend" | "app.display.reset" | "app.thinking.cycle" | "app.model.cycleForward" | "app.model.cycleBackward" | "app.model.select" | "app.model.selectTemporary" | "app.tools.expand" | "app.tools.toggleVisibility" | "app.thinking.toggle" | "app.editor.external" | "app.history.search" | "app.message.dequeue" | "app.retry" | "app.clipboard.pasteImage" | "app.clipboard.pasteTextRaw" | "app.clipboard.copyPrompt">;
4
+ type ConfigurableEditorAction = Extract<AppKeybinding, "app.interrupt" | "app.clear" | "app.exit" | "app.suspend" | "app.display.reset" | "app.thinking.cycle" | "app.model.cycleForward" | "app.model.cycleBackward" | "app.model.select" | "app.model.selectTemporary" | "app.tools.toggleVisibility" | "app.thinking.toggle" | "app.editor.external" | "app.history.search" | "app.message.dequeue" | "app.retry" | "app.clipboard.pasteImage" | "app.clipboard.pasteTextRaw" | "app.clipboard.copyPrompt">;
5
5
  /** Max gap (ms) between two spaces for the later one to count as OS key auto-repeat rather than a
6
6
  * deliberate press. OS auto-repeat is fast; a deliberate tap (even a fast one) is slower. */
7
7
  export declare const SPACE_REPEAT_MAX_GAP_MS = 120;
@@ -140,7 +140,6 @@ export declare class CustomEditor extends Editor {
140
140
  onCycleModelForward?: () => void;
141
141
  onCycleModelBackward?: () => void;
142
142
  onSelectModel?: () => void;
143
- onExpandTools?: () => void;
144
143
  onToggleToolActivity?: () => void;
145
144
  onToggleThinking?: () => void;
146
145
  onExternalEditor?: () => void;
@@ -50,8 +50,16 @@ export declare function sortModelItems(items: ModelBrowserItem[], options?: Sort
50
50
  /** Compact glyph for a configured thinking level; empty for `inherit` (nothing to show). */
51
51
  export declare function thinkingLevelGlyph(level: ConfiguredThinkingLevel): string;
52
52
  /**
53
- * A slim role chip: `●default ◉` — solid dot for configured assignments,
53
+ * A slim role chip: `● default ◉` — solid dot for configured assignments,
54
54
  * hollow for auto-selected fallbacks, thinking glyph attached when set.
55
+ *
56
+ * The space after the status glyph is load-bearing. Under the `nerd` preset
57
+ * these are Nerd Font private-use icons (U+F111 / U+F10C) whose glyphs are
58
+ * drawn two cells wide, while `visibleWidth` counts them as one
59
+ * (`ambiguousIsNarrow: true` in tui/utils.ts — the PUA block is
60
+ * East_Asian_Width=Ambiguous). Without a separator the icon overhangs and
61
+ * eats the label's first character (`● default` renders as `●efault`).
62
+ * Mirrors the spacing already used for `status.success` in model-hub.
55
63
  */
56
64
  export declare function formatRoleChip(role: string, assignment: RoleAssignment, settings: Settings): string;
57
65
  /** Behavior switches for {@link ModelBrowser}. */
@@ -52,6 +52,8 @@ export interface SegmentContext {
52
52
  session: AgentSession;
53
53
  /** Focused subagent id while the view is proxied at its session, undefined otherwise. */
54
54
  focusedAgentId?: string | undefined;
55
+ /** Effective `statusLine.sessionAccent`; `false` disables hash-derived accent colors, while `true` or omission enables them. */
56
+ sessionAccent?: boolean;
55
57
  activeRepo: ActiveRepoContext | null;
56
58
  width: number;
57
59
  options: StatusLineSegmentOptions;
@@ -28,6 +28,8 @@ export interface ToolExecutionOptions {
28
28
  /** Session-persistent edit clipboard register, forked per preview frame. */
29
29
  clipboard?: Clipboard;
30
30
  showImages?: boolean;
31
+ /** Allow the name-keyed renderer registry only when the active tool is the built-in implementation. */
32
+ useBuiltInRenderer?: boolean;
31
33
  editFuzzyThreshold?: number;
32
34
  editAllowFuzzy?: boolean;
33
35
  /** Live-region probe used to settle detached task progress once the block
@@ -284,7 +284,14 @@ export declare class InteractiveMode implements InteractiveModeContext {
284
284
  initializeHookRunner(uiContext: ExtensionUIContext, hasUI: boolean): void;
285
285
  setEditorComponent(factory: ((tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => CustomEditor) | undefined): void;
286
286
  present(content: Component | readonly Component[]): void;
287
- /** Defer transcript command panels until the active turn can no longer grow above them. */
287
+ /**
288
+ * Defer transcript command panels while the agent is streaming, then mount
289
+ * them at the next settle, terminal or not. A non-terminal settle is only a
290
+ * scheduling pause, so resumed streaming can still land below a panel
291
+ * flushed there. That is preferred over leaving it queued behind a command
292
+ * the user runs during the pause, which mounts immediately and would put the
293
+ * older panel out of order.
294
+ */
288
295
  presentCommandOutput(content: Component | readonly Component[]): void;
289
296
  /** Mount every command panel queued for the current session while the agent was streaming. */
290
297
  flushPendingCommandOutput(): void;
@@ -68,8 +68,9 @@ export type AssistantErrorPresentation = {
68
68
  };
69
69
  /**
70
70
  * Resolve the turn-ending assistant error presentation, if any.
71
- * Silent and user-interrupt aborts yield no label. Recovered auto-retry errors
72
- * collapse to a single non-error note; terminal errors keep the full red presentation.
71
+ * Silent and user-interrupt aborts yield no label. Recovered retry attempts
72
+ * render a compact note; attempts superseded by an exhausted budget are hidden
73
+ * while the final terminal error keeps its full presentation.
73
74
  */
74
75
  export declare function resolveAssistantErrorPresentation(message: AssistantAgentMessage, retryAttempt?: number): AssistantErrorPresentation;
75
76
  /**
@@ -10,6 +10,9 @@
10
10
  */
11
11
  import type { AgentSession } from "../session/agent-session.js";
12
12
  export declare const MAIN_AGENT_ID = "Main";
13
+ /** Sidecar marker retained beside a child transcript after an explicit kill. */
14
+ export declare const AGENT_TOMBSTONE_SUFFIX = ".tombstone";
15
+ export declare function getAgentTombstonePath(sessionFile: string): string;
13
16
  /**
14
17
  * - `running`: a turn is in flight.
15
18
  * - `idle`: live AgentSession in memory, awaiting work. Finished agents are
@@ -18,6 +21,8 @@ export declare const MAIN_AGENT_ID = "Main";
18
21
  * - `aborted`: hard-killed, terminal.
19
22
  */
20
23
  export type AgentStatus = "running" | "idle" | "parked" | "aborted";
24
+ /** Provenance of a displayed duration: active runtime, transcript span, or unavailable. */
25
+ export type AgentDurationKind = "active" | "span" | "unknown";
21
26
  /**
22
27
  * - `main`/`sub`: the user-facing agent tree (driving agent + task subagents).
23
28
  * - `advisor`: a passive review transcript persisted like a subagent for usage
@@ -25,6 +30,33 @@ export type AgentStatus = "running" | "idle" | "parked" | "aborted";
25
30
  * agent-facing rosters (`hub`, `history://`) and not messageable/revivable.
26
31
  */
27
32
  export type AgentKind = "main" | "sub" | "advisor";
33
+ /** Persisted per-agent totals reconstructed from the child session transcript. */
34
+ export interface AgentMetricsSummary {
35
+ tokens: number;
36
+ requests: number;
37
+ tools: number;
38
+ cost: number;
39
+ durationMs: number;
40
+ durationKind?: AgentDurationKind;
41
+ contextTokens?: number;
42
+ contextWindow?: number;
43
+ }
44
+ /** Historical identity and telemetry that remain available after the live session is disposed. */
45
+ export interface AgentHistorySummary {
46
+ agent?: string;
47
+ modelRole?: string;
48
+ resolvedModel?: string;
49
+ /** Whether the last resolved model was selected by retry fallback routing. */
50
+ resolvedModelIsFallback?: boolean;
51
+ metrics?: AgentMetricsSummary;
52
+ readOnly?: boolean;
53
+ /** Durable task output artifact, when the executor wrote one. */
54
+ outputPath?: string;
55
+ /** Captured isolated-worktree patch, when patch capture succeeded. */
56
+ patchPath?: string;
57
+ /** Isolated branch identity, when branch-mode capture succeeded. */
58
+ branchName?: string;
59
+ }
28
60
  export interface AgentRef {
29
61
  id: string;
30
62
  displayName: string;
@@ -38,6 +70,8 @@ export interface AgentRef {
38
70
  lastActivity: number;
39
71
  /** Short gist of what the agent is currently doing (latest intent or tool), for the work-aware roster. Display-only. */
40
72
  activity?: string;
73
+ /** Persisted identity and telemetry restored after the live observer is gone. */
74
+ history?: AgentHistorySummary;
41
75
  }
42
76
  export type AgentRefExpectation = AgentRef | AgentSession;
43
77
  export type RegistryEvent = {
@@ -46,6 +80,9 @@ export type RegistryEvent = {
46
80
  } | {
47
81
  type: "status_changed";
48
82
  ref: AgentRef;
83
+ } | {
84
+ type: "metadata_changed";
85
+ ref: AgentRef;
49
86
  } | {
50
87
  type: "removed";
51
88
  ref: AgentRef;
@@ -59,6 +96,14 @@ export interface RegisterInput {
59
96
  session: AgentSession | null;
60
97
  sessionFile?: string | null;
61
98
  status?: AgentStatus;
99
+ /** Last persisted task summary, when restoring a historical agent. */
100
+ activity?: string;
101
+ /** Original registration timestamp, when known from persisted history. */
102
+ createdAt?: number;
103
+ /** Last transcript activity timestamp, when known from persisted history. */
104
+ lastActivity?: number;
105
+ /** Persisted identity and telemetry restored after the live observer is gone. */
106
+ history?: AgentHistorySummary;
62
107
  }
63
108
  export declare class AgentRegistry {
64
109
  #private;
@@ -73,6 +118,8 @@ export declare class AgentRegistry {
73
118
  * id after its prior generation disappeared or was hard-killed.
74
119
  */
75
120
  registerIfAvailable(input: RegisterInput, expected: AgentRef | null): AgentRef | undefined;
121
+ /** Attach transcript-derived identity and telemetry without changing lifecycle state. */
122
+ setHistory(id: string, history: AgentHistorySummary, expectedSessionFile?: string): boolean;
76
123
  setStatus(id: string, status: AgentStatus, expected?: AgentRefExpectation): boolean;
77
124
  /**
78
125
  * Record a short activity gist for the work-aware roster. Display-only and
@@ -1,3 +1,5 @@
1
1
  import { type AgentRegistry } from "./agent-registry.js";
2
2
  /** Register persisted subagent and advisor transcripts as parked registry refs. */
3
- export declare function registerPersistedSubagents(registry: AgentRegistry, sessionFile: string | null | undefined): Promise<void>;
3
+ export declare function registerPersistedSubagents(registry: AgentRegistry, sessionFile: string | null | undefined, options?: {
4
+ shouldContinue?: () => boolean;
5
+ }): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { type SecretEntry } from "./obfuscator.js";
1
+ import { type SecretEntry, SecretObfuscator } from "./obfuscator.js";
2
2
  /**
3
3
  * Per-install secret key for the placeholder digest. Persisted under XDG state
4
4
  * and never sent to a provider, so model-visible placeholders cannot be reversed
@@ -40,3 +40,25 @@ export declare function collectEnvSecrets(): SecretEntry[];
40
40
  * transparent because the round trip is lossless.
41
41
  */
42
42
  export declare function builtinCredentialSecretEntries(): SecretEntry[];
43
+ /**
44
+ * Build the session secret obfuscator from every configured source: secrets.yml
45
+ * (project + global), secret-shaped environment variables, and the built-in
46
+ * credential patterns. Callers gate on `secrets.enabled`.
47
+ *
48
+ * Only CONFIGURED entries force startup key creation: a configured
49
+ * obfuscate-mode secret — or a default (no custom `replacement`) replace-mode
50
+ * regex whose key-derived idempotent fallback marker needs a stable key across
51
+ * restarts (see `secretEntryNeedsPlaceholderKey`) — mints placeholders as soon
52
+ * as the obfuscator is built. The built-in credential-pattern entry matches
53
+ * dynamically, so it resolves the persisted key lazily on first match instead
54
+ * of creating the key file for every secrets-enabled session.
55
+ *
56
+ * When no configured entry produced an active secret but a persisted key
57
+ * exists, returns a redaction-only obfuscator so a tool read of the key file
58
+ * does not ship the reusable HMAC key to the provider. Returns undefined when
59
+ * there is nothing to protect.
60
+ *
61
+ * `keyDir` is the explicit agent dir override for the placeholder-key file
62
+ * (default XDG/agent location when omitted).
63
+ */
64
+ export declare function buildSecretObfuscator(cwd: string, agentDir: string, keyDir?: string): Promise<SecretObfuscator | undefined>;
@@ -2,7 +2,7 @@ import type { AgentEvent, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
2
  import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
3
3
  import type { Effort } from "@oh-my-pi/pi-ai";
4
4
  import type { Rule } from "../capability/rule.js";
5
- import type { RecoveredRetryError } from "../extensibility/shared-events.js";
5
+ import type { RetryErrorUpdate } from "../extensibility/shared-events.js";
6
6
  import type { Goal, GoalModeState } from "../goals/state.js";
7
7
  import type { ConfiguredThinkingLevel } from "../thinking.js";
8
8
  import type { TodoItem } from "../tools/todo.js";
@@ -40,7 +40,7 @@ export type AgentSessionEvent = Exclude<AgentEvent, {
40
40
  success: boolean;
41
41
  attempt: number;
42
42
  finalError?: string;
43
- recoveredErrors?: RecoveredRetryError[];
43
+ retryErrors?: RetryErrorUpdate[];
44
44
  } | {
45
45
  type: "retry_fallback_applied";
46
46
  from: string;
@@ -29,7 +29,7 @@ import type { BashResult } from "../exec/bash-executor.js";
29
29
  import type { TtsrManager } from "../export/ttsr.js";
30
30
  import type { LoadedCustomCommand } from "../extensibility/custom-commands/index.js";
31
31
  import type { CustomTool } from "../extensibility/custom-tools/types.js";
32
- import type { ExtensionRunner, ExtensionUIContext } from "../extensibility/extensions/index.js";
32
+ import type { ExtensionRunner, ExtensionUIContext, ToolInfo } from "../extensibility/extensions/index.js";
33
33
  import type { CompactOptions, ContextUsage } from "../extensibility/extensions/types.js";
34
34
  import type { Skill, SkillWarning } from "../extensibility/skills.js";
35
35
  import { type FileSlashCommand } from "../extensibility/slash-commands.js";
@@ -83,7 +83,7 @@ export declare class AgentSession {
83
83
  /**
84
84
  * Arm prewalk outside the normal startup path so an explicit slash command starts immediately.
85
85
  */
86
- armPrewalk(target: Model, thinkingLevel?: ConfiguredThinkingLevel): void;
86
+ armPrewalk(target: Model, thinkingLevel?: ConfiguredThinkingLevel): boolean;
87
87
  /** Validate the active plan artifact and shape an `xd://propose` result for review-mode hosts. */
88
88
  preparePlanForReview(title: string): Promise<AgentToolResult<PlanApprovalDetails>>;
89
89
  constructor(config: AgentSessionConfig);
@@ -285,6 +285,8 @@ export declare class AgentSession {
285
285
  hasBuiltInTool(name: string): boolean;
286
286
  /** Names of every registered tool. */
287
287
  getAllToolNames(): string[];
288
+ /** Full metadata for every registered tool, including source provenance (backs `getAllTools()`). */
289
+ getAllToolInfos(): ToolInfo[];
288
290
  /** Installs and activates the ephemeral vibe tool set. */
289
291
  activateVibeTools(baseToolNames: string[]): Promise<void>;
290
292
  /** Uninstalls vibe tools and activates the replacement set. */
@@ -12,6 +12,7 @@ import type { OutputMeta } from "../tools/output-meta.js";
12
12
  export declare const SKILL_PROMPT_MESSAGE_TYPE = "skill-prompt";
13
13
  export declare const LSP_LATE_DIAGNOSTIC_MESSAGE_TYPE = "lsp-late-diagnostic";
14
14
  export declare const BACKGROUND_TAN_DISPATCH_MESSAGE_TYPE = "background-tan-dispatch";
15
+ export declare const PREWALK_PLAN_MESSAGE_TYPE = "prewalk-plan";
15
16
  /**
16
17
  * Logs provider-error turns so their actual cause is available outside the
17
18
  * session transcript. No-op for non-error stop reasons.
@@ -6,6 +6,8 @@ import { type ConfiguredThinkingLevel } from "../thinking.js";
6
6
  import type { PlanProposalHandler } from "../tools/resolve.js";
7
7
  import type { PlanYolo, Prewalk } from "./agent-session-types.js";
8
8
  import type { SessionManager } from "./session-manager.js";
9
+ /** Hidden plan steering is consumed within the live run and must not reappear after a context rebuild. */
10
+ export declare function isPrewalkPlanNudge(message: AgentMessage): boolean;
9
11
  /** Capabilities the prewalk coordinator borrows from its owning session. */
10
12
  export interface PrewalkCoordinatorHost {
11
13
  agent: Agent;
@@ -41,7 +43,7 @@ export declare class PrewalkCoordinator {
41
43
  /** Advances the one-way prewalk switch at a completed assistant-turn boundary. */
42
44
  advanceAtTurnEnd(liveMessages: AgentMessage[], context: AgentTurnEndContext | undefined): Promise<void>;
43
45
  /** Arms a prewalk immediately for an explicit slash-command request. */
44
- arm(target: Model, thinkingLevel?: ConfiguredThinkingLevel): void;
46
+ arm(target: Model, thinkingLevel?: ConfiguredThinkingLevel): boolean;
45
47
  /** Lazily enables plan-yolo's plan phase before the first prompt is built. */
46
48
  armPlanYoloIfNeeded(): Promise<void>;
47
49
  }