@oh-my-pi/pi-coding-agent 16.0.5 → 16.0.6

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 (223) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/cli.js +1927 -1376
  3. package/dist/types/advisor/advise-tool.d.ts +22 -19
  4. package/dist/types/autoresearch/tools/init-experiment.d.ts +13 -17
  5. package/dist/types/autoresearch/tools/log-experiment.d.ts +17 -19
  6. package/dist/types/autoresearch/tools/run-experiment.d.ts +3 -4
  7. package/dist/types/autoresearch/tools/update-notes.d.ts +4 -5
  8. package/dist/types/cli/ttsr-cli.d.ts +39 -0
  9. package/dist/types/commands/ttsr.d.ts +57 -0
  10. package/dist/types/commit/agentic/tools/analyze-file.d.ts +4 -5
  11. package/dist/types/commit/agentic/tools/git-file-diff.d.ts +4 -5
  12. package/dist/types/commit/agentic/tools/git-hunk.d.ts +5 -6
  13. package/dist/types/commit/agentic/tools/git-overview.d.ts +4 -5
  14. package/dist/types/commit/agentic/tools/propose-changelog.d.ts +23 -24
  15. package/dist/types/commit/agentic/tools/propose-commit.d.ts +11 -32
  16. package/dist/types/commit/agentic/tools/recent-commits.d.ts +3 -4
  17. package/dist/types/commit/agentic/tools/schemas.d.ts +6 -27
  18. package/dist/types/commit/agentic/tools/split-commit.d.ts +28 -49
  19. package/dist/types/commit/changelog/generate.d.ts +12 -13
  20. package/dist/types/commit/shared-llm.d.ts +10 -37
  21. package/dist/types/config/config-file.d.ts +4 -4
  22. package/dist/types/config/keybindings.d.ts +5 -0
  23. package/dist/types/config/models-config-schema.d.ts +625 -990
  24. package/dist/types/config/models-config.d.ts +229 -217
  25. package/dist/types/config/settings-schema.d.ts +53 -23
  26. package/dist/types/edit/hashline/params.d.ts +7 -11
  27. package/dist/types/edit/index.d.ts +2 -1
  28. package/dist/types/edit/modes/apply-patch.d.ts +4 -5
  29. package/dist/types/edit/modes/patch.d.ts +15 -24
  30. package/dist/types/edit/modes/replace.d.ts +16 -17
  31. package/dist/types/eval/js/index.d.ts +1 -0
  32. package/dist/types/extensibility/custom-commands/types.d.ts +6 -3
  33. package/dist/types/extensibility/custom-tools/types.d.ts +8 -5
  34. package/dist/types/extensibility/extensions/types.d.ts +6 -3
  35. package/dist/types/extensibility/hooks/types.d.ts +7 -4
  36. package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +13 -5
  37. package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +17 -0
  38. package/dist/types/extensibility/typebox.d.ts +80 -58
  39. package/dist/types/goals/tools/goal-tool.d.ts +11 -24
  40. package/dist/types/index.d.ts +2 -0
  41. package/dist/types/lsp/index.d.ts +11 -26
  42. package/dist/types/lsp/types.d.ts +12 -28
  43. package/dist/types/mcp/client.d.ts +8 -0
  44. package/dist/types/modes/components/btw-panel.d.ts +1 -0
  45. package/dist/types/modes/components/custom-editor.d.ts +3 -1
  46. package/dist/types/modes/controllers/btw-controller.d.ts +2 -0
  47. package/dist/types/modes/controllers/input-controller.d.ts +1 -0
  48. package/dist/types/modes/interactive-mode.d.ts +3 -0
  49. package/dist/types/modes/setup-wizard/index.d.ts +1 -0
  50. package/dist/types/modes/setup-wizard/startup-splash.d.ts +7 -0
  51. package/dist/types/modes/theme/theme.d.ts +1 -1
  52. package/dist/types/modes/types.d.ts +3 -0
  53. package/dist/types/sdk.d.ts +5 -0
  54. package/dist/types/session/agent-session.d.ts +4 -0
  55. package/dist/types/startup-splash.d.ts +12 -0
  56. package/dist/types/task/types.d.ts +47 -48
  57. package/dist/types/tools/ask.d.ts +26 -27
  58. package/dist/types/tools/ast-edit.d.ts +17 -17
  59. package/dist/types/tools/ast-grep.d.ts +12 -13
  60. package/dist/types/tools/bash.d.ts +20 -17
  61. package/dist/types/tools/browser.d.ts +46 -71
  62. package/dist/types/tools/checkpoint.d.ts +14 -15
  63. package/dist/types/tools/debug.d.ts +82 -145
  64. package/dist/types/tools/eval.d.ts +30 -40
  65. package/dist/types/tools/find.d.ts +17 -18
  66. package/dist/types/tools/gh.d.ts +49 -78
  67. package/dist/types/tools/image-gen.d.ts +20 -36
  68. package/dist/types/tools/inspect-image.d.ts +10 -11
  69. package/dist/types/tools/irc.d.ts +22 -33
  70. package/dist/types/tools/job.d.ts +11 -12
  71. package/dist/types/tools/learn.d.ts +21 -28
  72. package/dist/types/tools/manage-skill.d.ts +13 -22
  73. package/dist/types/tools/memory-edit.d.ts +15 -24
  74. package/dist/types/tools/memory-recall.d.ts +7 -8
  75. package/dist/types/tools/memory-reflect.d.ts +9 -10
  76. package/dist/types/tools/memory-retain.d.ts +13 -14
  77. package/dist/types/tools/read.d.ts +7 -8
  78. package/dist/types/tools/resolve.d.ts +11 -18
  79. package/dist/types/tools/review.d.ts +9 -15
  80. package/dist/types/tools/search-tool-bm25.d.ts +9 -10
  81. package/dist/types/tools/search.d.ts +16 -17
  82. package/dist/types/tools/ssh.d.ts +14 -15
  83. package/dist/types/tools/todo.d.ts +27 -43
  84. package/dist/types/tools/tts.d.ts +8 -9
  85. package/dist/types/tools/write.d.ts +9 -10
  86. package/dist/types/tui/index.d.ts +1 -0
  87. package/dist/types/tui/width-aware-text.d.ts +23 -0
  88. package/dist/types/utils/markit.d.ts +10 -1
  89. package/dist/types/web/search/index.d.ts +17 -28
  90. package/dist/types/web/search/providers/perplexity.d.ts +0 -2
  91. package/dist/types/web/search/types.d.ts +32 -26
  92. package/package.json +14 -13
  93. package/scripts/omp +1 -1
  94. package/src/advisor/__tests__/advisor.test.ts +44 -1
  95. package/src/advisor/advise-tool.ts +34 -11
  96. package/src/autoresearch/tools/init-experiment.ts +13 -16
  97. package/src/autoresearch/tools/log-experiment.ts +15 -18
  98. package/src/autoresearch/tools/run-experiment.ts +3 -3
  99. package/src/autoresearch/tools/update-notes.ts +4 -4
  100. package/src/cli/ttsr-cli.ts +995 -0
  101. package/src/cli-commands.ts +1 -0
  102. package/src/cli.ts +7 -1
  103. package/src/commands/ttsr.ts +125 -0
  104. package/src/commit/agentic/tools/analyze-file.ts +4 -4
  105. package/src/commit/agentic/tools/git-file-diff.ts +4 -4
  106. package/src/commit/agentic/tools/git-hunk.ts +7 -5
  107. package/src/commit/agentic/tools/git-overview.ts +4 -4
  108. package/src/commit/agentic/tools/propose-changelog.ts +18 -15
  109. package/src/commit/agentic/tools/propose-commit.ts +6 -6
  110. package/src/commit/agentic/tools/recent-commits.ts +3 -3
  111. package/src/commit/agentic/tools/schemas.ts +8 -20
  112. package/src/commit/agentic/tools/split-commit.ts +19 -23
  113. package/src/commit/analysis/summary.ts +7 -5
  114. package/src/commit/changelog/generate.ts +15 -11
  115. package/src/commit/shared-llm.ts +17 -24
  116. package/src/config/config-file.ts +13 -15
  117. package/src/config/keybindings.ts +6 -0
  118. package/src/config/models-config-schema.ts +206 -179
  119. package/src/config/settings-schema.ts +34 -0
  120. package/src/discovery/builtin-rules/index.ts +2 -0
  121. package/src/discovery/builtin-rules/ts-import-type.md +2 -2
  122. package/src/discovery/builtin-rules/ts-no-any.md +11 -2
  123. package/src/discovery/builtin-rules/ts-no-inline-cast-access.md +55 -0
  124. package/src/edit/hashline/params.ts +12 -11
  125. package/src/edit/index.ts +5 -4
  126. package/src/edit/modes/apply-patch.ts +4 -4
  127. package/src/edit/modes/patch.ts +15 -18
  128. package/src/edit/modes/replace.ts +13 -17
  129. package/src/edit/renderer.ts +0 -1
  130. package/src/eval/agent-bridge.ts +11 -13
  131. package/src/eval/completion-bridge.ts +25 -17
  132. package/src/eval/js/context-manager.ts +17 -2
  133. package/src/eval/js/index.ts +1 -1
  134. package/src/eval/py/executor.ts +2 -2
  135. package/src/extensibility/custom-commands/loader.ts +5 -3
  136. package/src/extensibility/custom-commands/types.ts +6 -3
  137. package/src/extensibility/custom-tools/loader.ts +4 -2
  138. package/src/extensibility/custom-tools/types.ts +8 -5
  139. package/src/extensibility/extensions/loader.ts +4 -2
  140. package/src/extensibility/extensions/types.ts +6 -3
  141. package/src/extensibility/hooks/loader.ts +5 -2
  142. package/src/extensibility/hooks/types.ts +7 -4
  143. package/src/extensibility/legacy-pi-ai-shim.ts +42 -5
  144. package/src/extensibility/legacy-pi-coding-agent-shim.ts +113 -0
  145. package/src/extensibility/plugins/legacy-pi-compat.ts +13 -13
  146. package/src/extensibility/tool-proxy.ts +4 -1
  147. package/src/extensibility/typebox.ts +778 -251
  148. package/src/goals/guided-setup.ts +12 -3
  149. package/src/goals/tools/goal-tool.ts +6 -6
  150. package/src/index.ts +2 -0
  151. package/src/internal-urls/docs-index.generated.ts +11 -9
  152. package/src/lsp/types.ts +13 -27
  153. package/src/main.ts +19 -18
  154. package/src/mcp/client.ts +38 -13
  155. package/src/mcp/render.ts +102 -89
  156. package/src/modes/components/agent-hub.ts +11 -4
  157. package/src/modes/components/btw-panel.ts +5 -1
  158. package/src/modes/components/custom-editor.ts +18 -0
  159. package/src/modes/components/status-line/component.ts +8 -1
  160. package/src/modes/components/tool-execution.ts +17 -10
  161. package/src/modes/controllers/btw-controller.ts +69 -1
  162. package/src/modes/controllers/input-controller.ts +29 -0
  163. package/src/modes/interactive-mode.ts +38 -8
  164. package/src/modes/setup-wizard/index.ts +1 -0
  165. package/src/modes/setup-wizard/scenes/sign-in.ts +77 -5
  166. package/src/modes/setup-wizard/startup-splash.ts +107 -0
  167. package/src/modes/theme/theme.ts +133 -143
  168. package/src/modes/types.ts +3 -0
  169. package/src/modes/utils/context-usage.ts +9 -5
  170. package/src/modes/utils/hotkeys-markdown.ts +1 -0
  171. package/src/prompts/system/system-prompt.md +1 -0
  172. package/src/sdk.ts +21 -4
  173. package/src/session/agent-session.ts +160 -33
  174. package/src/session/session-history-format.ts +11 -2
  175. package/src/session/snapcompact-inline.ts +1 -1
  176. package/src/slash-commands/builtin-registry.ts +4 -11
  177. package/src/startup-splash.ts +19 -0
  178. package/src/task/executor.ts +11 -6
  179. package/src/task/types.ts +44 -41
  180. package/src/tool-discovery/tool-index.ts +17 -4
  181. package/src/tools/ask.ts +14 -14
  182. package/src/tools/ast-edit.ts +17 -14
  183. package/src/tools/ast-grep.ts +10 -9
  184. package/src/tools/bash.ts +15 -10
  185. package/src/tools/browser/launch.ts +13 -0
  186. package/src/tools/browser.ts +26 -32
  187. package/src/tools/checkpoint.ts +7 -7
  188. package/src/tools/debug.ts +72 -69
  189. package/src/tools/eval.ts +18 -19
  190. package/src/tools/find.ts +20 -13
  191. package/src/tools/gh.ts +29 -49
  192. package/src/tools/image-gen.ts +27 -32
  193. package/src/tools/inspect-image.ts +8 -9
  194. package/src/tools/irc.ts +12 -12
  195. package/src/tools/job.ts +6 -6
  196. package/src/tools/learn.ts +11 -14
  197. package/src/tools/manage-skill.ts +19 -23
  198. package/src/tools/memory-edit.ts +8 -8
  199. package/src/tools/memory-recall.ts +4 -4
  200. package/src/tools/memory-reflect.ts +5 -5
  201. package/src/tools/memory-retain.ts +9 -11
  202. package/src/tools/puppeteer/02_stealth_hairline.txt +1 -1
  203. package/src/tools/puppeteer/04_stealth_iframe.txt +4 -4
  204. package/src/tools/puppeteer/05_stealth_webgl.txt +1 -1
  205. package/src/tools/puppeteer/10_stealth_plugins.txt +6 -4
  206. package/src/tools/puppeteer/12_stealth_codecs.txt +2 -2
  207. package/src/tools/puppeteer/13_stealth_worker.txt +1 -1
  208. package/src/tools/read.ts +169 -13
  209. package/src/tools/report-tool-issue.ts +6 -6
  210. package/src/tools/resolve.ts +6 -6
  211. package/src/tools/review.ts +10 -12
  212. package/src/tools/search-tool-bm25.ts +5 -5
  213. package/src/tools/search.ts +20 -29
  214. package/src/tools/ssh.ts +8 -8
  215. package/src/tools/todo.ts +16 -19
  216. package/src/tools/tts.ts +16 -15
  217. package/src/tools/write.ts +5 -5
  218. package/src/tui/index.ts +1 -0
  219. package/src/tui/width-aware-text.ts +58 -0
  220. package/src/utils/markit.ts +17 -2
  221. package/src/web/search/index.ts +9 -9
  222. package/src/web/search/providers/perplexity.ts +373 -126
  223. package/src/web/search/types.ts +28 -48
@@ -11,6 +11,7 @@ export declare class BtwPanelComponent extends Container {
11
11
  markComplete(): void;
12
12
  markAborted(): void;
13
13
  markError(message: string): void;
14
+ isBranchable(): boolean;
14
15
  close(): void;
15
16
  }
16
17
  export {};
@@ -1,6 +1,6 @@
1
1
  import { Editor, type KeyId } from "@oh-my-pi/pi-tui";
2
2
  import type { AppKeybinding } from "../../config/keybindings";
3
- 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.thinking.toggle" | "app.editor.external" | "app.history.search" | "app.message.dequeue" | "app.clipboard.pasteImage" | "app.clipboard.pasteTextRaw" | "app.clipboard.copyPrompt">;
3
+ 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.thinking.toggle" | "app.editor.external" | "app.history.search" | "app.message.dequeue" | "app.retry" | "app.clipboard.pasteImage" | "app.clipboard.pasteTextRaw" | "app.clipboard.copyPrompt">;
4
4
  /** Max gap (ms) between two spaces for the later one to count as OS key auto-repeat rather than a
5
5
  * deliberate press. OS auto-repeat is fast; a deliberate tap (even a fast one) is slower. */
6
6
  export declare const SPACE_REPEAT_MAX_GAP_MS = 120;
@@ -79,6 +79,8 @@ export declare class CustomEditor extends Editor {
79
79
  onPasteTextRaw?: () => void;
80
80
  /** Called when the configured dequeue shortcut is pressed. */
81
81
  onDequeue?: () => void;
82
+ /** Called when the configured retry shortcut is pressed. */
83
+ onRetry?: () => void;
82
84
  /** Called when Caps Lock is pressed. */
83
85
  onCapsLock?: () => void;
84
86
  /** Called when left-arrow is pressed while the editor is empty (cursor necessarily at start). */
@@ -4,6 +4,8 @@ export declare class BtwController {
4
4
  private readonly ctx;
5
5
  constructor(ctx: InteractiveModeContext);
6
6
  hasActiveRequest(): boolean;
7
+ canBranch(): boolean;
8
+ handleBranch(): Promise<boolean>;
7
9
  handleEscape(): boolean;
8
10
  dispose(): void;
9
11
  start(question: string): Promise<void>;
@@ -18,6 +18,7 @@ export declare class InputController {
18
18
  handleCtrlD(): void;
19
19
  handleCtrlZ(): void;
20
20
  handleDequeue(): void;
21
+ handleRetry(): Promise<void>;
21
22
  /** Send editor text as a follow-up message (queued behind current stream). */
22
23
  handleFollowUp(): Promise<void>;
23
24
  restoreQueuedMessagesToEditor(options?: {
@@ -330,6 +330,9 @@ export declare class InteractiveMode implements InteractiveModeContext {
330
330
  handleTanCommand(work: string): Promise<void>;
331
331
  hasActiveBtw(): boolean;
332
332
  handleBtwEscape(): boolean;
333
+ canBranchBtw(): boolean;
334
+ handleBtwBranchKey(): Promise<boolean>;
335
+ handleBtwBranch(question: string, assistantMessage: AssistantMessage): Promise<void>;
333
336
  handleOmfgCommand(complaint: string): Promise<void>;
334
337
  hasActiveOmfg(): boolean;
335
338
  handleOmfgEscape(): boolean;
@@ -3,6 +3,7 @@ import { CURRENT_SETUP_VERSION } from "../setup-version";
3
3
  import type { InteractiveModeContext } from "../types";
4
4
  import type { SetupScene } from "./scenes/types";
5
5
  export type { SetupScene, SetupSceneController, SetupSceneHost, SetupSceneResult } from "./scenes/types";
6
+ export { runStartupSplash } from "./startup-splash";
6
7
  export { CURRENT_SETUP_VERSION };
7
8
  export declare const ALL_SCENES: readonly [SetupScene, SetupScene, SetupScene];
8
9
  export interface SetupSceneSelectionOptions {
@@ -0,0 +1,7 @@
1
+ import type { InteractiveModeContext } from "../types";
2
+ export interface RunStartupSplashOptions {
3
+ readonly durationMs?: number;
4
+ readonly tickMs?: number;
5
+ readonly now?: () => number;
6
+ }
7
+ export declare function runStartupSplash(ctx: InteractiveModeContext, options?: RunStartupSplashOptions): Promise<void>;
@@ -290,7 +290,7 @@ export declare function setColorBlindMode(enabled: boolean): Promise<void>;
290
290
  * Get the current color blind mode setting.
291
291
  */
292
292
  export declare function getColorBlindMode(): boolean;
293
- export declare function onThemeChange(callback: () => void): void;
293
+ export declare function onThemeChange(callback: () => void): () => void;
294
294
  /**
295
295
  * Monotonic counter bumped on any theme-affecting change that should invalidate
296
296
  * cached renders: theme swaps and reloads (including the invalid-theme dark
@@ -316,6 +316,9 @@ export interface InteractiveModeContext {
316
316
  handleTanCommand(work: string): Promise<void>;
317
317
  hasActiveBtw(): boolean;
318
318
  handleBtwEscape(): boolean;
319
+ handleBtwBranchKey(): Promise<boolean>;
320
+ canBranchBtw(): boolean;
321
+ handleBtwBranch(question: string, assistantMessage: AssistantMessage): Promise<void>;
319
322
  handleOmfgCommand(complaint: string): Promise<void>;
320
323
  hasActiveOmfg(): boolean;
321
324
  handleOmfgEscape(): boolean;
@@ -162,6 +162,11 @@ export interface CreateAgentSessionOptions {
162
162
  localProtocolOptions?: LocalProtocolOptions;
163
163
  /** Settings instance. Default: Settings.init({ cwd, agentDir }) */
164
164
  settings?: Settings;
165
+ /**
166
+ * Legacy alias for `settings`. Older Pi extensions pass SettingsManager.create(...)
167
+ * through this field; accept it so their SDK calls keep the configured settings.
168
+ */
169
+ settingsManager?: Settings | Promise<Settings>;
165
170
  /** Whether UI is available (enables interactive tools like ask). Default: false */
166
171
  hasUI?: boolean;
167
172
  /**
@@ -1076,6 +1076,10 @@ export declare class AgentSession {
1076
1076
  selectedText: string;
1077
1077
  cancelled: boolean;
1078
1078
  }>;
1079
+ branchFromBtw(question: string, assistantMessage: AssistantMessage): Promise<{
1080
+ cancelled: boolean;
1081
+ sessionFile: string | undefined;
1082
+ }>;
1079
1083
  /**
1080
1084
  * Navigate to a different node in the session tree.
1081
1085
  * Unlike branch() which creates a new session file, this stays in the same file.
@@ -0,0 +1,12 @@
1
+ /** Inputs used to decide whether the optional startup splash may run for this process. */
2
+ export interface StartupSplashDecisionOptions {
3
+ readonly configured: boolean;
4
+ readonly isInteractive: boolean;
5
+ readonly resuming: boolean;
6
+ readonly quiet: boolean;
7
+ readonly timing: boolean;
8
+ readonly stdinIsTTY: boolean | undefined;
9
+ readonly stdoutIsTTY: boolean | undefined;
10
+ }
11
+ /** Returns true only for explicitly enabled, normal interactive TTY startup. */
12
+ export declare function shouldShowStartupSplash(options: StartupSplashDecisionOptions): boolean;
@@ -1,6 +1,5 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
2
  import type { Usage } from "@oh-my-pi/pi-ai";
3
- import { z } from "zod/v4";
4
3
  import type { AgentSessionEvent } from "../session/agent-session";
5
4
  import type { NestedRepoPatch } from "./worktree";
6
5
  /** Source of an agent definition */
@@ -55,12 +54,12 @@ export interface SubagentLifecyclePayload {
55
54
  export declare const ROLE_LABEL_MAX = 80;
56
55
  /** Schema bound on the raw `role` input, before it is label-normalized at every use site. */
57
56
  export declare const ROLE_INPUT_MAX = 256;
58
- export declare const taskItemSchema: z.ZodObject<{
59
- id: z.ZodOptional<z.ZodString>;
60
- description: z.ZodOptional<z.ZodString>;
61
- role: z.ZodOptional<z.ZodString>;
62
- assignment: z.ZodString;
63
- }, z.core.$strip>;
57
+ export declare const taskItemSchema: import("arktype/internal/variants/object.ts").ObjectType<{
58
+ id?: string | undefined;
59
+ description?: string | undefined;
60
+ role?: string | undefined;
61
+ assignment: string;
62
+ }, {}>;
64
63
  /** Single task item. Fields are optional defensively: args stream in token by token. */
65
64
  export interface TaskItem {
66
65
  /** Stable agent id; default = generated AdjectiveNoun. */
@@ -74,47 +73,47 @@ export interface TaskItem {
74
73
  /** Run this spawn in an isolated worktree (batch form; flat form carries it top-level). */
75
74
  isolated?: boolean;
76
75
  }
77
- export declare const taskSchema: z.ZodObject<{
78
- id: z.ZodOptional<z.ZodString>;
79
- description: z.ZodOptional<z.ZodString>;
80
- role: z.ZodOptional<z.ZodString>;
81
- assignment: z.ZodString;
82
- isolated: z.ZodOptional<z.ZodBoolean>;
83
- agent: z.ZodString;
84
- }, z.core.$strip>;
85
- declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
86
- id: z.ZodOptional<z.ZodString>;
87
- description: z.ZodOptional<z.ZodString>;
88
- role: z.ZodOptional<z.ZodString>;
89
- assignment: z.ZodString;
90
- isolated: z.ZodOptional<z.ZodBoolean>;
91
- agent: z.ZodString;
92
- }, z.core.$strip>, z.ZodObject<{
93
- id: z.ZodOptional<z.ZodString>;
94
- description: z.ZodOptional<z.ZodString>;
95
- role: z.ZodOptional<z.ZodString>;
96
- assignment: z.ZodString;
97
- agent: z.ZodString;
98
- }, z.core.$strip>, z.ZodObject<{
99
- agent: z.ZodString;
100
- context: z.ZodString;
101
- tasks: z.ZodArray<z.ZodObject<{
102
- id: z.ZodOptional<z.ZodString>;
103
- description: z.ZodOptional<z.ZodString>;
104
- role: z.ZodOptional<z.ZodString>;
105
- assignment: z.ZodString;
106
- isolated: z.ZodOptional<z.ZodBoolean>;
107
- }, z.core.$strip>>;
108
- }, z.core.$strip>, z.ZodObject<{
109
- agent: z.ZodString;
110
- context: z.ZodString;
111
- tasks: z.ZodArray<z.ZodObject<{
112
- id: z.ZodOptional<z.ZodString>;
113
- description: z.ZodOptional<z.ZodString>;
114
- role: z.ZodOptional<z.ZodString>;
115
- assignment: z.ZodString;
116
- }, z.core.$strip>>;
117
- }, z.core.$strip>];
76
+ export declare const taskSchema: import("arktype/internal/variants/object.ts").ObjectType<{
77
+ agent: string;
78
+ id?: string | undefined;
79
+ description?: string | undefined;
80
+ role?: string | undefined;
81
+ assignment: string;
82
+ isolated?: boolean | undefined;
83
+ }, {}>;
84
+ declare const ALL_TASK_SCHEMAS: readonly [import("arktype/internal/variants/object.ts").ObjectType<{
85
+ agent: string;
86
+ id?: string | undefined;
87
+ description?: string | undefined;
88
+ role?: string | undefined;
89
+ assignment: string;
90
+ isolated?: boolean | undefined;
91
+ }, {}>, import("arktype/internal/variants/object.ts").ObjectType<{
92
+ agent: string;
93
+ id?: string | undefined;
94
+ description?: string | undefined;
95
+ role?: string | undefined;
96
+ assignment: string;
97
+ }, {}>, import("arktype/internal/variants/object.ts").ObjectType<{
98
+ agent: string;
99
+ context: string;
100
+ tasks: {
101
+ id?: string | undefined;
102
+ description?: string | undefined;
103
+ role?: string | undefined;
104
+ assignment: string;
105
+ isolated?: boolean | undefined;
106
+ }[];
107
+ }, {}>, import("arktype/internal/variants/object.ts").ObjectType<{
108
+ agent: string;
109
+ context: string;
110
+ tasks: {
111
+ id?: string | undefined;
112
+ description?: string | undefined;
113
+ role?: string | undefined;
114
+ assignment: string;
115
+ }[];
116
+ }, {}>];
118
117
  type DynamicTaskSchema = (typeof ALL_TASK_SCHEMAS)[number];
119
118
  export type TaskSchema = typeof taskSchema;
120
119
  /** Active task tool parameter schema for the current isolation / batch flags */
@@ -17,23 +17,22 @@
17
17
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
18
18
  import type { ToolExample } from "@oh-my-pi/pi-ai";
19
19
  import { type Component } from "@oh-my-pi/pi-tui";
20
- import { z } from "zod/v4";
21
20
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
22
21
  import { type Theme } from "../modes/theme/theme";
23
22
  import type { ToolSession } from ".";
24
- declare const askSchema: z.ZodObject<{
25
- questions: z.ZodArray<z.ZodObject<{
26
- id: z.ZodString;
27
- question: z.ZodString;
28
- options: z.ZodArray<z.ZodObject<{
29
- label: z.ZodString;
30
- description: z.ZodOptional<z.ZodString>;
31
- }, z.core.$strip>>;
32
- multi: z.ZodOptional<z.ZodBoolean>;
33
- recommended: z.ZodOptional<z.ZodNumber>;
34
- }, z.core.$strip>>;
35
- }, z.core.$strip>;
36
- export type AskToolInput = z.infer<typeof askSchema>;
23
+ declare const askSchema: import("arktype/internal/variants/object.ts").ObjectType<{
24
+ questions: {
25
+ id: string;
26
+ question: string;
27
+ options: {
28
+ label: string;
29
+ description?: string | undefined;
30
+ }[];
31
+ multi?: boolean | undefined;
32
+ recommended?: number | undefined;
33
+ }[];
34
+ }, {}>;
35
+ export type AskToolInput = typeof askSchema.infer;
37
36
  /** Result for a single question */
38
37
  export interface QuestionResult {
39
38
  id: string;
@@ -71,20 +70,20 @@ export declare class AskTool implements AgentTool<typeof askSchema, AskToolDetai
71
70
  readonly label = "Ask";
72
71
  readonly summary = "Ask the user a clarifying question";
73
72
  readonly description: string;
74
- readonly parameters: z.ZodObject<{
75
- questions: z.ZodArray<z.ZodObject<{
76
- id: z.ZodString;
77
- question: z.ZodString;
78
- options: z.ZodArray<z.ZodObject<{
79
- label: z.ZodString;
80
- description: z.ZodOptional<z.ZodString>;
81
- }, z.core.$strip>>;
82
- multi: z.ZodOptional<z.ZodBoolean>;
83
- recommended: z.ZodOptional<z.ZodNumber>;
84
- }, z.core.$strip>>;
85
- }, z.core.$strip>;
73
+ readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
74
+ questions: {
75
+ id: string;
76
+ question: string;
77
+ options: {
78
+ label: string;
79
+ description?: string | undefined;
80
+ }[];
81
+ multi?: boolean | undefined;
82
+ recommended?: number | undefined;
83
+ }[];
84
+ }, {}>;
86
85
  readonly strict = true;
87
- readonly examples: readonly ToolExample<z.input<typeof askSchema>>[];
86
+ readonly examples: readonly ToolExample<typeof askSchema.infer>[];
88
87
  readonly concurrency = "exclusive";
89
88
  readonly loadMode = "discoverable";
90
89
  constructor(session: ToolSession);
@@ -1,18 +1,17 @@
1
1
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
2
2
  import type { ToolExample } from "@oh-my-pi/pi-ai";
3
3
  import type { Component } from "@oh-my-pi/pi-tui";
4
- import { z } from "zod/v4";
5
4
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
6
5
  import type { Theme } from "../modes/theme/theme";
7
6
  import type { ToolSession } from ".";
8
7
  import type { OutputMeta } from "./output-meta";
9
- declare const astEditSchema: z.ZodObject<{
10
- ops: z.ZodArray<z.ZodObject<{
11
- pat: z.ZodString;
12
- out: z.ZodString;
13
- }, z.core.$strip>>;
14
- paths: z.ZodArray<z.ZodString>;
15
- }, z.core.$strip>;
8
+ declare const astEditSchema: import("arktype/internal/variants/object.ts").ObjectType<{
9
+ ops: {
10
+ pat: string;
11
+ out: string;
12
+ }[];
13
+ paths: string[];
14
+ }, {}>;
16
15
  export interface AstEditToolDetails {
17
16
  totalReplacements: number;
18
17
  filesTouched: number;
@@ -39,6 +38,7 @@ export interface AstEditToolDetails {
39
38
  * renderer resolves them against this; `searchPath` is the scope target. */
40
39
  cwd?: string;
41
40
  }
41
+ type AstEditSchemaInfer = typeof astEditSchema.infer;
42
42
  export declare class AstEditTool implements AgentTool<typeof astEditSchema, AstEditToolDetails> {
43
43
  private readonly session;
44
44
  readonly name = "ast_edit";
@@ -47,19 +47,19 @@ export declare class AstEditTool implements AgentTool<typeof astEditSchema, AstE
47
47
  readonly label = "AST Edit";
48
48
  readonly summary = "Perform AST-aware code edits (structural refactoring)";
49
49
  readonly description: string;
50
- readonly parameters: z.ZodObject<{
51
- ops: z.ZodArray<z.ZodObject<{
52
- pat: z.ZodString;
53
- out: z.ZodString;
54
- }, z.core.$strip>>;
55
- paths: z.ZodArray<z.ZodString>;
56
- }, z.core.$strip>;
50
+ readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
51
+ ops: {
52
+ pat: string;
53
+ out: string;
54
+ }[];
55
+ paths: string[];
56
+ }, {}>;
57
57
  readonly strict = true;
58
- readonly examples: readonly ToolExample<z.input<typeof astEditSchema>>[];
58
+ readonly examples: readonly ToolExample<AstEditSchemaInfer>[];
59
59
  readonly deferrable = true;
60
60
  readonly loadMode = "discoverable";
61
61
  constructor(session: ToolSession);
62
- execute(_toolCallId: string, params: z.infer<typeof astEditSchema>, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<AstEditToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<AstEditToolDetails>>;
62
+ execute(_toolCallId: string, params: AstEditSchemaInfer, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<AstEditToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<AstEditToolDetails>>;
63
63
  }
64
64
  interface AstEditRenderArgs {
65
65
  ops?: Array<{
@@ -1,16 +1,15 @@
1
1
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
2
2
  import type { ToolExample } from "@oh-my-pi/pi-ai";
3
3
  import type { Component } from "@oh-my-pi/pi-tui";
4
- import { z } from "zod/v4";
5
4
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
6
5
  import type { Theme } from "../modes/theme/theme";
7
6
  import type { ToolSession } from ".";
8
7
  import type { OutputMeta } from "./output-meta";
9
- declare const astGrepSchema: z.ZodObject<{
10
- pat: z.ZodString;
11
- paths: z.ZodArray<z.ZodString>;
12
- skip: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
13
- }, z.core.$strip>;
8
+ declare const astGrepSchema: import("arktype/internal/variants/object.ts").ObjectType<{
9
+ pat: string;
10
+ paths: string[];
11
+ skip?: number | undefined;
12
+ }, {}>;
14
13
  export interface AstGrepToolDetails {
15
14
  matchCount: number;
16
15
  fileCount: number;
@@ -43,16 +42,16 @@ export declare class AstGrepTool implements AgentTool<typeof astGrepSchema, AstG
43
42
  readonly label = "AST Grep";
44
43
  readonly summary = "Search code with AST patterns (structural grep)";
45
44
  readonly description: string;
46
- readonly parameters: z.ZodObject<{
47
- pat: z.ZodString;
48
- paths: z.ZodArray<z.ZodString>;
49
- skip: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
50
- }, z.core.$strip>;
45
+ readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
46
+ pat: string;
47
+ paths: string[];
48
+ skip?: number | undefined;
49
+ }, {}>;
51
50
  readonly strict = true;
52
- readonly examples: readonly ToolExample<z.input<typeof astGrepSchema>>[];
51
+ readonly examples: readonly ToolExample<typeof astGrepSchema.inferIn>[];
53
52
  readonly loadMode = "discoverable";
54
53
  constructor(session: ToolSession);
55
- execute(_toolCallId: string, params: z.infer<typeof astGrepSchema>, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<AstGrepToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<AstGrepToolDetails>>;
54
+ execute(_toolCallId: string, params: typeof astGrepSchema.infer, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<AstGrepToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<AstGrepToolDetails>>;
56
55
  }
57
56
  interface AstGrepRenderArgs {
58
57
  pat?: string;
@@ -1,6 +1,5 @@
1
1
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolApprovalDecision } from "@oh-my-pi/pi-agent-core";
2
2
  import type { Component } from "@oh-my-pi/pi-tui";
3
- import { z } from "zod/v4";
4
3
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
5
4
  import { type Theme } from "../modes/theme/theme";
6
5
  import type { ToolSession } from ".";
@@ -14,21 +13,25 @@ export declare const BASH_DEFAULT_PREVIEW_LINES = 10;
14
13
  * New patterns should target shapes that are virtually never legitimate in automation.
15
14
  */
16
15
  export declare const CRITICAL_BASH_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
17
- declare const bashSchemaBase: z.ZodObject<{
18
- command: z.ZodString;
19
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
20
- timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
21
- cwd: z.ZodOptional<z.ZodString>;
22
- pty: z.ZodOptional<z.ZodBoolean>;
23
- }, z.core.$strip>;
24
- declare const bashSchemaWithAsync: z.ZodObject<{
25
- command: z.ZodString;
26
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
27
- timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
28
- cwd: z.ZodOptional<z.ZodString>;
29
- pty: z.ZodOptional<z.ZodBoolean>;
30
- async: z.ZodOptional<z.ZodBoolean>;
31
- }, z.core.$strip>;
16
+ declare const bashSchemaBase: import("arktype/internal/variants/object.ts").ObjectType<{
17
+ command: string;
18
+ env?: {
19
+ [x: string]: string;
20
+ } | undefined;
21
+ timeout?: number | undefined;
22
+ cwd?: string | undefined;
23
+ pty?: boolean | undefined;
24
+ }, {}>;
25
+ declare const bashSchemaWithAsync: import("arktype/internal/variants/object.ts").ObjectType<{
26
+ command: string;
27
+ env?: {
28
+ [x: string]: string;
29
+ } | undefined;
30
+ timeout?: number | undefined;
31
+ cwd?: string | undefined;
32
+ pty?: boolean | undefined;
33
+ async?: boolean | undefined;
34
+ }, {}>;
32
35
  type BashToolSchema = typeof bashSchemaBase | typeof bashSchemaWithAsync;
33
36
  export interface BashToolInput {
34
37
  command: string;
@@ -59,7 +62,7 @@ export interface BashToolOptions {
59
62
  *
60
63
  * Executes bash commands with optional timeout and working directory.
61
64
  */
62
- export declare class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
65
+ export declare class BashTool implements AgentTool<typeof bashSchemaBase | typeof bashSchemaWithAsync, BashToolDetails> {
63
66
  #private;
64
67
  private readonly session;
65
68
  readonly name = "bash";
@@ -1,6 +1,5 @@
1
1
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
2
2
  import type { ToolExample } from "@oh-my-pi/pi-ai";
3
- import { z } from "zod/v4";
4
3
  import type { ToolSession } from "../sdk";
5
4
  import { type BrowserKindTag } from "./browser/registry";
6
5
  import type { Observation, ScreenshotResult } from "./browser/tab-protocol";
@@ -9,42 +8,30 @@ export { cmuxSnapshotToObservation, mapWaitUntil, resolveCmuxKind, serializeEval
9
8
  export { CmuxSocketClient } from "./browser/cmux/socket-client";
10
9
  export { extractReadableFromHtml, type ReadableFormat, type ReadableResult } from "./browser/readable";
11
10
  export type { Observation, ObservationEntry } from "./browser/tab-protocol";
12
- declare const browserSchema: z.ZodObject<{
13
- action: z.ZodEnum<{
14
- close: "close";
15
- open: "open";
16
- run: "run";
17
- }>;
18
- name: z.ZodOptional<z.ZodString>;
19
- url: z.ZodOptional<z.ZodString>;
20
- app: z.ZodOptional<z.ZodObject<{
21
- path: z.ZodOptional<z.ZodString>;
22
- cdp_url: z.ZodOptional<z.ZodString>;
23
- args: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
- target: z.ZodOptional<z.ZodString>;
25
- }, z.core.$strip>>;
26
- viewport: z.ZodOptional<z.ZodObject<{
27
- width: z.ZodNumber;
28
- height: z.ZodNumber;
29
- scale: z.ZodOptional<z.ZodNumber>;
30
- }, z.core.$strip>>;
31
- wait_until: z.ZodOptional<z.ZodEnum<{
32
- domcontentloaded: "domcontentloaded";
33
- load: "load";
34
- networkidle0: "networkidle0";
35
- networkidle2: "networkidle2";
36
- }>>;
37
- dialogs: z.ZodOptional<z.ZodEnum<{
38
- accept: "accept";
39
- dismiss: "dismiss";
40
- }>>;
41
- code: z.ZodOptional<z.ZodString>;
42
- timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
43
- all: z.ZodOptional<z.ZodBoolean>;
44
- kill: z.ZodOptional<z.ZodBoolean>;
45
- }, z.core.$strip>;
11
+ declare const browserSchema: import("arktype/internal/variants/object.ts").ObjectType<{
12
+ action: "close" | "open" | "run";
13
+ name?: string | undefined;
14
+ url?: string | undefined;
15
+ app?: {
16
+ path?: string | undefined;
17
+ cdp_url?: string | undefined;
18
+ args?: string[] | undefined;
19
+ target?: string | undefined;
20
+ } | undefined;
21
+ viewport?: {
22
+ width: number;
23
+ height: number;
24
+ scale?: number | undefined;
25
+ } | undefined;
26
+ wait_until?: "domcontentloaded" | "load" | "networkidle0" | "networkidle2" | undefined;
27
+ dialogs?: "accept" | "dismiss" | undefined;
28
+ code?: string | undefined;
29
+ timeout?: number | undefined;
30
+ all?: boolean | undefined;
31
+ kill?: boolean | undefined;
32
+ }, {}>;
46
33
  /** Input schema for the browser tool. */
47
- export type BrowserParams = z.infer<typeof browserSchema>;
34
+ export type BrowserParams = typeof browserSchema.infer;
48
35
  /** Details describing a browser tool execution result (for renderers + transcript). */
49
36
  export interface BrowserToolDetails {
50
37
  action: BrowserParams["action"];
@@ -76,42 +63,30 @@ export declare class BrowserTool implements AgentTool<typeof browserSchema, Brow
76
63
  readonly label = "Browser";
77
64
  readonly loadMode = "discoverable";
78
65
  readonly summary = "Control a headless browser to navigate and interact with web pages";
79
- readonly parameters: z.ZodObject<{
80
- action: z.ZodEnum<{
81
- close: "close";
82
- open: "open";
83
- run: "run";
84
- }>;
85
- name: z.ZodOptional<z.ZodString>;
86
- url: z.ZodOptional<z.ZodString>;
87
- app: z.ZodOptional<z.ZodObject<{
88
- path: z.ZodOptional<z.ZodString>;
89
- cdp_url: z.ZodOptional<z.ZodString>;
90
- args: z.ZodOptional<z.ZodArray<z.ZodString>>;
91
- target: z.ZodOptional<z.ZodString>;
92
- }, z.core.$strip>>;
93
- viewport: z.ZodOptional<z.ZodObject<{
94
- width: z.ZodNumber;
95
- height: z.ZodNumber;
96
- scale: z.ZodOptional<z.ZodNumber>;
97
- }, z.core.$strip>>;
98
- wait_until: z.ZodOptional<z.ZodEnum<{
99
- domcontentloaded: "domcontentloaded";
100
- load: "load";
101
- networkidle0: "networkidle0";
102
- networkidle2: "networkidle2";
103
- }>>;
104
- dialogs: z.ZodOptional<z.ZodEnum<{
105
- accept: "accept";
106
- dismiss: "dismiss";
107
- }>>;
108
- code: z.ZodOptional<z.ZodString>;
109
- timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
110
- all: z.ZodOptional<z.ZodBoolean>;
111
- kill: z.ZodOptional<z.ZodBoolean>;
112
- }, z.core.$strip>;
66
+ readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
67
+ action: "close" | "open" | "run";
68
+ name?: string | undefined;
69
+ url?: string | undefined;
70
+ app?: {
71
+ path?: string | undefined;
72
+ cdp_url?: string | undefined;
73
+ args?: string[] | undefined;
74
+ target?: string | undefined;
75
+ } | undefined;
76
+ viewport?: {
77
+ width: number;
78
+ height: number;
79
+ scale?: number | undefined;
80
+ } | undefined;
81
+ wait_until?: "domcontentloaded" | "load" | "networkidle0" | "networkidle2" | undefined;
82
+ dialogs?: "accept" | "dismiss" | undefined;
83
+ code?: string | undefined;
84
+ timeout?: number | undefined;
85
+ all?: boolean | undefined;
86
+ kill?: boolean | undefined;
87
+ }, {}>;
113
88
  readonly strict = true;
114
- readonly examples: readonly ToolExample<z.input<typeof browserSchema>>[];
89
+ readonly examples: readonly ToolExample<typeof browserSchema.infer>[];
115
90
  constructor(session: ToolSession);
116
91
  get description(): string;
117
92
  /** Restart browser to apply mode changes (e.g. headless toggle). Drops only headless browsers. */