@oh-my-pi/pi-coding-agent 16.0.5 → 16.0.7
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.
- package/CHANGELOG.md +60 -0
- package/dist/cli.js +1945 -1386
- package/dist/types/advisor/advise-tool.d.ts +22 -19
- package/dist/types/autoresearch/tools/init-experiment.d.ts +13 -17
- package/dist/types/autoresearch/tools/log-experiment.d.ts +17 -19
- package/dist/types/autoresearch/tools/run-experiment.d.ts +3 -4
- package/dist/types/autoresearch/tools/update-notes.d.ts +4 -5
- package/dist/types/cli/ttsr-cli.d.ts +39 -0
- package/dist/types/commands/ttsr.d.ts +57 -0
- package/dist/types/commit/agentic/tools/analyze-file.d.ts +4 -5
- package/dist/types/commit/agentic/tools/git-file-diff.d.ts +4 -5
- package/dist/types/commit/agentic/tools/git-hunk.d.ts +5 -6
- package/dist/types/commit/agentic/tools/git-overview.d.ts +4 -5
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +23 -24
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +11 -32
- package/dist/types/commit/agentic/tools/recent-commits.d.ts +3 -4
- package/dist/types/commit/agentic/tools/schemas.d.ts +6 -27
- package/dist/types/commit/agentic/tools/split-commit.d.ts +28 -49
- package/dist/types/commit/changelog/generate.d.ts +12 -13
- package/dist/types/commit/shared-llm.d.ts +10 -37
- package/dist/types/config/config-file.d.ts +4 -4
- package/dist/types/config/keybindings.d.ts +5 -0
- package/dist/types/config/models-config-schema.d.ts +625 -990
- package/dist/types/config/models-config.d.ts +229 -217
- package/dist/types/config/settings-schema.d.ts +53 -23
- package/dist/types/edit/hashline/params.d.ts +7 -11
- package/dist/types/edit/index.d.ts +2 -1
- package/dist/types/edit/modes/apply-patch.d.ts +4 -5
- package/dist/types/edit/modes/patch.d.ts +15 -24
- package/dist/types/edit/modes/replace.d.ts +16 -17
- package/dist/types/eval/js/index.d.ts +1 -0
- package/dist/types/extensibility/custom-commands/types.d.ts +6 -3
- package/dist/types/extensibility/custom-tools/types.d.ts +8 -5
- package/dist/types/extensibility/extensions/types.d.ts +6 -3
- package/dist/types/extensibility/hooks/types.d.ts +7 -4
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +13 -5
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +17 -0
- package/dist/types/extensibility/typebox.d.ts +80 -58
- package/dist/types/goals/tools/goal-tool.d.ts +11 -24
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lsp/index.d.ts +11 -26
- package/dist/types/lsp/types.d.ts +12 -28
- package/dist/types/mcp/client.d.ts +8 -0
- package/dist/types/modes/components/btw-panel.d.ts +1 -0
- package/dist/types/modes/components/custom-editor.d.ts +3 -1
- package/dist/types/modes/controllers/btw-controller.d.ts +2 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +3 -0
- package/dist/types/modes/setup-wizard/index.d.ts +1 -0
- package/dist/types/modes/setup-wizard/startup-splash.d.ts +7 -0
- package/dist/types/modes/theme/theme.d.ts +1 -1
- package/dist/types/modes/types.d.ts +3 -0
- package/dist/types/sdk.d.ts +5 -0
- package/dist/types/session/agent-session.d.ts +4 -0
- package/dist/types/startup-splash.d.ts +12 -0
- package/dist/types/task/types.d.ts +47 -48
- package/dist/types/tools/ask.d.ts +26 -27
- package/dist/types/tools/ast-edit.d.ts +17 -17
- package/dist/types/tools/ast-grep.d.ts +12 -13
- package/dist/types/tools/bash.d.ts +20 -17
- package/dist/types/tools/browser.d.ts +46 -71
- package/dist/types/tools/checkpoint.d.ts +14 -15
- package/dist/types/tools/debug.d.ts +82 -145
- package/dist/types/tools/eval.d.ts +30 -40
- package/dist/types/tools/find.d.ts +17 -18
- package/dist/types/tools/gh.d.ts +49 -78
- package/dist/types/tools/image-gen.d.ts +20 -36
- package/dist/types/tools/inspect-image.d.ts +10 -11
- package/dist/types/tools/irc.d.ts +22 -33
- package/dist/types/tools/job.d.ts +11 -12
- package/dist/types/tools/learn.d.ts +21 -28
- package/dist/types/tools/manage-skill.d.ts +13 -22
- package/dist/types/tools/memory-edit.d.ts +15 -24
- package/dist/types/tools/memory-recall.d.ts +7 -8
- package/dist/types/tools/memory-reflect.d.ts +9 -10
- package/dist/types/tools/memory-retain.d.ts +13 -14
- package/dist/types/tools/read.d.ts +7 -8
- package/dist/types/tools/resolve.d.ts +11 -18
- package/dist/types/tools/review.d.ts +9 -15
- package/dist/types/tools/search-tool-bm25.d.ts +9 -10
- package/dist/types/tools/search.d.ts +16 -17
- package/dist/types/tools/ssh.d.ts +14 -15
- package/dist/types/tools/todo.d.ts +27 -43
- package/dist/types/tools/tts.d.ts +8 -9
- package/dist/types/tools/write.d.ts +9 -10
- package/dist/types/tui/index.d.ts +1 -0
- package/dist/types/tui/width-aware-text.d.ts +23 -0
- package/dist/types/utils/markit.d.ts +10 -1
- package/dist/types/web/search/index.d.ts +17 -28
- package/dist/types/web/search/providers/perplexity.d.ts +0 -2
- package/dist/types/web/search/types.d.ts +32 -26
- package/package.json +14 -13
- package/scripts/omp +1 -1
- package/src/advisor/__tests__/advisor.test.ts +44 -1
- package/src/advisor/advise-tool.ts +34 -11
- package/src/autoresearch/tools/init-experiment.ts +13 -16
- package/src/autoresearch/tools/log-experiment.ts +15 -18
- package/src/autoresearch/tools/run-experiment.ts +3 -3
- package/src/autoresearch/tools/update-notes.ts +4 -4
- package/src/cli/ttsr-cli.ts +995 -0
- package/src/cli-commands.ts +1 -0
- package/src/cli.ts +7 -1
- package/src/commands/ttsr.ts +125 -0
- package/src/commit/agentic/tools/analyze-file.ts +4 -4
- package/src/commit/agentic/tools/git-file-diff.ts +4 -4
- package/src/commit/agentic/tools/git-hunk.ts +7 -5
- package/src/commit/agentic/tools/git-overview.ts +4 -4
- package/src/commit/agentic/tools/propose-changelog.ts +18 -15
- package/src/commit/agentic/tools/propose-commit.ts +6 -6
- package/src/commit/agentic/tools/recent-commits.ts +3 -3
- package/src/commit/agentic/tools/schemas.ts +8 -20
- package/src/commit/agentic/tools/split-commit.ts +19 -23
- package/src/commit/analysis/summary.ts +7 -5
- package/src/commit/changelog/generate.ts +15 -11
- package/src/commit/shared-llm.ts +17 -24
- package/src/config/config-file.ts +13 -15
- package/src/config/keybindings.ts +6 -0
- package/src/config/models-config-schema.ts +206 -179
- package/src/config/settings-schema.ts +34 -0
- package/src/discovery/builtin-rules/index.ts +2 -0
- package/src/discovery/builtin-rules/ts-import-type.md +2 -2
- package/src/discovery/builtin-rules/ts-no-any.md +11 -2
- package/src/discovery/builtin-rules/ts-no-inline-cast-access.md +55 -0
- package/src/edit/hashline/params.ts +12 -11
- package/src/edit/index.ts +5 -4
- package/src/edit/modes/apply-patch.ts +4 -4
- package/src/edit/modes/patch.ts +15 -18
- package/src/edit/modes/replace.ts +13 -17
- package/src/edit/renderer.ts +0 -1
- package/src/eval/agent-bridge.ts +11 -13
- package/src/eval/completion-bridge.ts +25 -17
- package/src/eval/js/context-manager.ts +17 -2
- package/src/eval/js/index.ts +1 -1
- package/src/eval/py/executor.ts +2 -2
- package/src/extensibility/custom-commands/loader.ts +5 -3
- package/src/extensibility/custom-commands/types.ts +6 -3
- package/src/extensibility/custom-tools/loader.ts +4 -2
- package/src/extensibility/custom-tools/types.ts +8 -5
- package/src/extensibility/extensions/loader.ts +4 -2
- package/src/extensibility/extensions/types.ts +6 -3
- package/src/extensibility/hooks/loader.ts +5 -2
- package/src/extensibility/hooks/types.ts +7 -4
- package/src/extensibility/legacy-pi-ai-shim.ts +42 -5
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +113 -0
- package/src/extensibility/plugins/legacy-pi-compat.ts +13 -13
- package/src/extensibility/tool-proxy.ts +4 -1
- package/src/extensibility/typebox.ts +778 -251
- package/src/goals/guided-setup.ts +12 -3
- package/src/goals/tools/goal-tool.ts +6 -6
- package/src/index.ts +2 -0
- package/src/internal-urls/docs-index.generated.ts +11 -9
- package/src/lsp/types.ts +13 -27
- package/src/main.ts +19 -18
- package/src/mcp/client.ts +38 -13
- package/src/mcp/render.ts +102 -89
- package/src/modes/components/agent-hub.ts +11 -4
- package/src/modes/components/btw-panel.ts +5 -1
- package/src/modes/components/custom-editor.ts +18 -0
- package/src/modes/components/status-line/component.ts +8 -1
- package/src/modes/components/tool-execution.ts +17 -10
- package/src/modes/controllers/btw-controller.ts +69 -1
- package/src/modes/controllers/input-controller.ts +29 -0
- package/src/modes/interactive-mode.ts +38 -8
- package/src/modes/setup-wizard/index.ts +1 -0
- package/src/modes/setup-wizard/scenes/sign-in.ts +77 -5
- package/src/modes/setup-wizard/startup-splash.ts +107 -0
- package/src/modes/theme/theme.ts +133 -143
- package/src/modes/types.ts +3 -0
- package/src/modes/utils/context-usage.ts +9 -5
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/prompts/system/system-prompt.md +1 -0
- package/src/sdk.ts +21 -4
- package/src/session/agent-session.ts +173 -33
- package/src/session/session-history-format.ts +11 -2
- package/src/session/snapcompact-inline.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +3 -10
- package/src/startup-splash.ts +19 -0
- package/src/task/executor.ts +11 -6
- package/src/task/types.ts +44 -41
- package/src/tool-discovery/tool-index.ts +17 -4
- package/src/tools/ask.ts +14 -14
- package/src/tools/ast-edit.ts +17 -14
- package/src/tools/ast-grep.ts +10 -9
- package/src/tools/bash.ts +15 -10
- package/src/tools/browser/launch.ts +13 -0
- package/src/tools/browser.ts +26 -32
- package/src/tools/checkpoint.ts +7 -7
- package/src/tools/debug.ts +72 -69
- package/src/tools/eval.ts +18 -19
- package/src/tools/find.ts +20 -13
- package/src/tools/gh.ts +29 -49
- package/src/tools/image-gen.ts +27 -32
- package/src/tools/inspect-image.ts +8 -9
- package/src/tools/irc.ts +12 -12
- package/src/tools/job.ts +6 -6
- package/src/tools/learn.ts +11 -14
- package/src/tools/manage-skill.ts +19 -23
- package/src/tools/memory-edit.ts +8 -8
- package/src/tools/memory-recall.ts +4 -4
- package/src/tools/memory-reflect.ts +5 -5
- package/src/tools/memory-retain.ts +9 -11
- package/src/tools/puppeteer/02_stealth_hairline.txt +1 -1
- package/src/tools/puppeteer/04_stealth_iframe.txt +4 -4
- package/src/tools/puppeteer/05_stealth_webgl.txt +1 -1
- package/src/tools/puppeteer/10_stealth_plugins.txt +6 -4
- package/src/tools/puppeteer/12_stealth_codecs.txt +2 -2
- package/src/tools/puppeteer/13_stealth_worker.txt +1 -1
- package/src/tools/read.ts +169 -13
- package/src/tools/report-tool-issue.ts +6 -6
- package/src/tools/resolve.ts +6 -6
- package/src/tools/review.ts +10 -12
- package/src/tools/search-tool-bm25.ts +5 -5
- package/src/tools/search.ts +20 -29
- package/src/tools/ssh.ts +8 -8
- package/src/tools/todo.ts +16 -19
- package/src/tools/tts.ts +16 -15
- package/src/tools/write.ts +5 -5
- package/src/tui/index.ts +1 -0
- package/src/tui/width-aware-text.ts +58 -0
- package/src/utils/markit.ts +17 -2
- package/src/web/search/index.ts +9 -9
- package/src/web/search/providers/perplexity.ts +373 -126
- package/src/web/search/types.ts +28 -48
|
@@ -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;
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -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:
|
|
59
|
-
id
|
|
60
|
-
description
|
|
61
|
-
role
|
|
62
|
-
assignment:
|
|
63
|
-
},
|
|
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:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
declare const ALL_TASK_SCHEMAS: readonly [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
agent:
|
|
100
|
-
context:
|
|
101
|
-
tasks:
|
|
102
|
-
id
|
|
103
|
-
description
|
|
104
|
-
role
|
|
105
|
-
assignment:
|
|
106
|
-
isolated
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
agent:
|
|
110
|
-
context:
|
|
111
|
-
tasks:
|
|
112
|
-
id
|
|
113
|
-
description
|
|
114
|
-
role
|
|
115
|
-
assignment:
|
|
116
|
-
}
|
|
117
|
-
},
|
|
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:
|
|
25
|
-
questions:
|
|
26
|
-
id:
|
|
27
|
-
question:
|
|
28
|
-
options:
|
|
29
|
-
label:
|
|
30
|
-
description
|
|
31
|
-
}
|
|
32
|
-
multi
|
|
33
|
-
recommended
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
export type AskToolInput =
|
|
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:
|
|
75
|
-
questions:
|
|
76
|
-
id:
|
|
77
|
-
question:
|
|
78
|
-
options:
|
|
79
|
-
label:
|
|
80
|
-
description
|
|
81
|
-
}
|
|
82
|
-
multi
|
|
83
|
-
recommended
|
|
84
|
-
}
|
|
85
|
-
},
|
|
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<
|
|
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:
|
|
10
|
-
ops:
|
|
11
|
-
pat:
|
|
12
|
-
out:
|
|
13
|
-
}
|
|
14
|
-
paths:
|
|
15
|
-
},
|
|
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:
|
|
51
|
-
ops:
|
|
52
|
-
pat:
|
|
53
|
-
out:
|
|
54
|
-
}
|
|
55
|
-
paths:
|
|
56
|
-
},
|
|
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<
|
|
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:
|
|
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:
|
|
10
|
-
pat:
|
|
11
|
-
paths:
|
|
12
|
-
skip
|
|
13
|
-
},
|
|
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:
|
|
47
|
-
pat:
|
|
48
|
-
paths:
|
|
49
|
-
skip
|
|
50
|
-
},
|
|
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<
|
|
51
|
+
readonly examples: readonly ToolExample<typeof astGrepSchema.inferIn>[];
|
|
53
52
|
readonly loadMode = "discoverable";
|
|
54
53
|
constructor(session: ToolSession);
|
|
55
|
-
execute(_toolCallId: string, params:
|
|
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:
|
|
18
|
-
command:
|
|
19
|
-
env
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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<
|
|
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:
|
|
13
|
-
action:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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 =
|
|
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:
|
|
80
|
-
action:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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<
|
|
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. */
|