@oh-my-pi/pi-coding-agent 17.2.4 → 17.2.5
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 +51 -0
- package/dist/{CHANGELOG-bpmhv26t.md → CHANGELOG-q2w43aw3.md} +51 -0
- package/dist/cli.js +4148 -3717
- package/dist/{template-8vdv6xb4.js → template-c2hyaytt.js} +8 -26
- package/dist/types/cli/args.d.ts +4 -1
- package/dist/types/cli/browser-relay-cli.d.ts +15 -0
- package/dist/types/cli/command-help.d.ts +99 -0
- package/dist/types/cli/help-extra.d.ts +2 -0
- package/dist/types/cli/thinking-levels.d.ts +5 -0
- package/dist/types/cli/update-cli.d.ts +13 -0
- package/dist/types/commands/browser-relay.d.ts +38 -0
- package/dist/types/commands/commit.d.ts +3 -0
- package/dist/types/commands/complete.d.ts +1 -1
- package/dist/types/commands/completions.d.ts +6 -0
- package/dist/types/commands/grep.d.ts +3 -0
- package/dist/types/commands/join.d.ts +4 -0
- package/dist/types/commands/launch-help.d.ts +171 -0
- package/dist/types/commands/launch.d.ts +5 -1
- package/dist/types/commands/models.d.ts +3 -0
- package/dist/types/commands/say.d.ts +10 -0
- package/dist/types/commands/worktree.d.ts +3 -0
- package/dist/types/config/keybindings.d.ts +5 -0
- package/dist/types/config/model-discovery.d.ts +2 -2
- package/dist/types/config/models-config-schema-bundle.d.ts +3 -0
- package/dist/types/config/models-config-schema.d.ts +2 -0
- package/dist/types/config/models-config.d.ts +1 -0
- package/dist/types/config/service-tier.d.ts +2 -0
- package/dist/types/config/settings-schema.d.ts +69 -21
- package/dist/types/cursor-bridge-tools.d.ts +1 -1
- package/dist/types/cursor.d.ts +7 -4
- package/dist/types/edit/index.d.ts +3 -3
- package/dist/types/edit/modes/replace.d.ts +22 -15
- package/dist/types/edit/renderer.d.ts +1 -1
- package/dist/types/eval/py/kernel.d.ts +3 -1
- package/dist/types/eval/py/spawn-options.d.ts +12 -16
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +8 -1
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +1 -1
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +2 -0
- package/dist/types/launch/broker.d.ts +1 -1
- package/dist/types/launch/client.d.ts +6 -3
- package/dist/types/launch/ensure.d.ts +8 -0
- package/dist/types/launch/paths.d.ts +1 -1
- package/dist/types/launch/protocol.d.ts +2 -2
- package/dist/types/lsp/client.d.ts +2 -0
- package/dist/types/lsp/mux/daemon.d.ts +15 -0
- package/dist/types/lsp/mux/protocol.d.ts +57 -0
- package/dist/types/lsp/mux/server.d.ts +18 -0
- package/dist/types/lsp/types.d.ts +22 -2
- package/dist/types/main.d.ts +2 -0
- package/dist/types/mnemopi/embed-client.d.ts +1 -1
- package/dist/types/mnemopi/state.d.ts +0 -23
- package/dist/types/modes/components/assistant-message.d.ts +2 -0
- package/dist/types/modes/components/custom-editor.d.ts +2 -1
- package/dist/types/modes/components/read-tool-group.d.ts +2 -0
- package/dist/types/modes/components/stripped-tool-calls-placeholder.d.ts +12 -0
- package/dist/types/modes/components/tool-execution.d.ts +2 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/types.d.ts +1 -0
- package/dist/types/modes/workflow.d.ts +2 -1
- package/dist/types/sdk.d.ts +3 -1
- package/dist/types/secrets/index.d.ts +1 -1
- package/dist/types/session/agent-session-types.d.ts +3 -1
- package/dist/types/session/indexed-session-storage.d.ts +1 -0
- package/dist/types/session/session-advisors.d.ts +1 -1
- package/dist/types/session/session-context.d.ts +2 -1
- package/dist/types/session/session-maintenance.d.ts +1 -0
- package/dist/types/session/session-manager.d.ts +16 -11
- package/dist/types/session/session-stats.d.ts +10 -0
- package/dist/types/session/session-storage.d.ts +15 -3
- package/dist/types/system-prompt.d.ts +4 -1
- package/dist/types/task/index.d.ts +2 -1
- package/dist/types/task/spawn-policy.d.ts +5 -0
- package/dist/types/thinking.d.ts +1 -7
- package/dist/types/tools/ast-grep.d.ts +1 -1
- package/dist/types/tools/browser/registry.d.ts +2 -1
- package/dist/types/tools/browser/relay/bridge.d.ts +35 -0
- package/dist/types/tools/browser/relay/daemon.d.ts +16 -0
- package/dist/types/tools/browser/relay/kind.d.ts +19 -0
- package/dist/types/tools/browser/relay/protocol.d.ts +97 -0
- package/dist/types/tools/browser/relay/server.d.ts +35 -0
- package/dist/types/tools/browser/render.d.ts +1 -0
- package/dist/types/tools/browser.d.ts +3 -0
- package/dist/types/tools/computer/exposure.d.ts +9 -7
- package/dist/types/tools/computer/protocol.d.ts +70 -17
- package/dist/types/tools/computer/supervisor.d.ts +23 -10
- package/dist/types/tools/computer/worker-entry.d.ts +1 -0
- package/dist/types/tools/computer/worker.d.ts +42 -7
- package/dist/types/tools/computer-renderer.d.ts +7 -5
- package/dist/types/tools/computer.d.ts +25 -44
- package/dist/types/tools/context.d.ts +3 -0
- package/dist/types/tools/glob.d.ts +1 -1
- package/dist/types/tools/grep.d.ts +1 -1
- package/dist/types/tools/render-utils.d.ts +2 -0
- package/dist/types/tools/{browser/run-cancellation.d.ts → run-scope.d.ts} +8 -8
- package/dist/types/tools/tool-timeouts.d.ts +5 -0
- package/dist/types/tools/xdev.d.ts +8 -0
- package/dist/types/utils/clipboard.d.ts +2 -2
- package/dist/types/web/kagi.d.ts +1 -0
- package/dist/types/web/search/index.d.ts +1 -1
- package/dist/types/web/search/providers/anthropic.d.ts +1 -0
- package/dist/types/web/search/providers/base.d.ts +2 -0
- package/dist/types/web/search/providers/brave.d.ts +1 -0
- package/dist/types/web/search/providers/browser-page.d.ts +1 -0
- package/dist/types/web/search/providers/codex.d.ts +1 -0
- package/dist/types/web/search/providers/exa.d.ts +1 -0
- package/dist/types/web/search/providers/firecrawl.d.ts +1 -0
- package/dist/types/web/search/providers/gemini.d.ts +1 -0
- package/dist/types/web/search/providers/jina.d.ts +1 -0
- package/dist/types/web/search/providers/kagi.d.ts +1 -0
- package/dist/types/web/search/providers/kimi.d.ts +1 -0
- package/dist/types/web/search/providers/parallel.d.ts +1 -0
- package/dist/types/web/search/providers/perplexity.d.ts +1 -0
- package/dist/types/web/search/providers/searxng.d.ts +1 -0
- package/dist/types/web/search/providers/tavily.d.ts +1 -0
- package/dist/types/web/search/providers/tinyfish.d.ts +1 -0
- package/dist/types/web/search/providers/utils.d.ts +6 -9
- package/dist/types/web/search/providers/zai.d.ts +1 -0
- package/dist/types/web/search/types.d.ts +4 -0
- package/package.json +12 -12
- package/src/cli/args.ts +7 -87
- package/src/cli/browser-relay-cli.ts +119 -0
- package/src/cli/command-help.ts +103 -0
- package/src/cli/completion-gen.ts +5 -5
- package/src/cli/flag-tables.ts +9 -0
- package/src/cli/help-extra.ts +89 -0
- package/src/cli/setup-cli.ts +13 -21
- package/src/cli/thinking-levels.ts +7 -0
- package/src/cli/update-cli.ts +26 -7
- package/src/cli-commands.ts +170 -33
- package/src/cli.ts +17 -5
- package/src/commands/acp.ts +3 -1
- package/src/commands/agents.ts +3 -2
- package/src/commands/auth-broker.ts +3 -2
- package/src/commands/auth-gateway.ts +3 -2
- package/src/commands/bench.ts +2 -3
- package/src/commands/browser-relay.ts +53 -0
- package/src/commands/cleanse.ts +2 -2
- package/src/commands/commit.ts +3 -2
- package/src/commands/complete.ts +2 -1
- package/src/commands/completions.ts +3 -2
- package/src/commands/config.ts +3 -2
- package/src/commands/dry-balance.ts +2 -2
- package/src/commands/gallery.ts +3 -2
- package/src/commands/gc.ts +3 -2
- package/src/commands/grep.ts +3 -2
- package/src/commands/grievances.ts +3 -2
- package/src/commands/install.ts +2 -2
- package/src/commands/join.ts +3 -2
- package/src/commands/launch-help.ts +116 -0
- package/src/commands/launch.ts +7 -191
- package/src/commands/models.ts +3 -2
- package/src/commands/plugin.ts +3 -2
- package/src/commands/read.ts +3 -2
- package/src/commands/say.ts +3 -2
- package/src/commands/setup.ts +3 -2
- package/src/commands/shell.ts +3 -2
- package/src/commands/ssh.ts +3 -2
- package/src/commands/stats.ts +3 -2
- package/src/commands/tiny-models.ts +2 -2
- package/src/commands/token.ts +2 -2
- package/src/commands/ttsr.ts +2 -2
- package/src/commands/update.ts +3 -2
- package/src/commands/usage.ts +3 -2
- package/src/commands/web-search.ts +3 -2
- package/src/commands/worktree.ts +3 -2
- package/src/config/keybindings.ts +5 -0
- package/src/config/model-discovery.ts +30 -13
- package/src/config/model-registry.ts +9 -5
- package/src/config/models-config-schema-bundle.ts +9 -0
- package/src/config/resolve-config-value.ts +2 -1
- package/src/config/service-tier.ts +5 -0
- package/src/config/settings-schema.ts +72 -20
- package/src/cursor-bridge-tools.ts +1 -1
- package/src/cursor.ts +10 -14
- package/src/edit/diff.ts +17 -8
- package/src/edit/index.ts +20 -7
- package/src/edit/modes/replace.ts +93 -40
- package/src/edit/renderer.ts +1 -1
- package/src/edit/streaming.ts +14 -17
- package/src/eval/py/kernel.ts +2 -1
- package/src/eval/py/spawn-options.ts +24 -29
- package/src/export/html/template.js +8 -26
- package/src/extensibility/extensions/wrapper.ts +1 -0
- package/src/extensibility/legacy-pi-ai-shim.ts +22 -1
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +7 -6
- package/src/extensibility/plugins/legacy-pi-compat.ts +124 -57
- package/src/extensibility/skills.ts +11 -0
- package/src/extensibility/utils.ts +10 -2
- package/src/launch/broker.ts +1 -1
- package/src/launch/client.ts +32 -13
- package/src/launch/ensure.ts +73 -0
- package/src/launch/paths.ts +1 -1
- package/src/launch/protocol.ts +2 -2
- package/src/lsp/client.ts +23 -2
- package/src/lsp/index.ts +8 -0
- package/src/lsp/mux/daemon.ts +348 -0
- package/src/lsp/mux/protocol.ts +96 -0
- package/src/lsp/mux/server.ts +797 -0
- package/src/lsp/types.ts +28 -2
- package/src/main.ts +7 -2
- package/src/mcp/oauth-flow.ts +11 -1
- package/src/mnemopi/embed-client.ts +49 -2
- package/src/mnemopi/state.ts +57 -23
- package/src/modes/components/assistant-message.ts +11 -0
- package/src/modes/components/chat-transcript-builder.ts +4 -0
- package/src/modes/components/custom-editor.ts +9 -0
- package/src/modes/components/read-tool-group.ts +10 -0
- package/src/modes/components/status-line/component.ts +1 -1
- package/src/modes/components/stripped-tool-calls-placeholder.ts +35 -0
- package/src/modes/components/tool-execution.ts +8 -0
- package/src/modes/components/tree-selector.ts +46 -48
- package/src/modes/controllers/event-controller.ts +17 -0
- package/src/modes/controllers/input-controller.ts +39 -1
- package/src/modes/controllers/mcp-command-controller.ts +11 -5
- package/src/modes/controllers/selector-controller.ts +20 -0
- package/src/modes/interactive-mode.ts +2 -0
- package/src/modes/types.ts +1 -0
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/modes/utils/interactive-context-helpers.ts +1 -0
- package/src/modes/utils/ui-helpers.ts +6 -10
- package/src/modes/workflow.ts +8 -2
- package/src/prompts/agents/init.md +1 -1
- package/src/prompts/system/plan-mode-active.md +2 -2
- package/src/prompts/system/system-prompt.md +26 -52
- package/src/prompts/system/workflow-notice.md +3 -3
- package/src/prompts/tools/ast-grep.md +1 -1
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/browser.md +1 -0
- package/src/prompts/tools/computer.md +21 -21
- package/src/prompts/tools/glob.md +1 -1
- package/src/prompts/tools/grep.md +1 -1
- package/src/prompts/tools/replace.md +5 -4
- package/src/prompts/tools/task.md +4 -4
- package/src/sdk.ts +34 -6
- package/src/secrets/index.ts +1 -1
- package/src/session/agent-session-types.ts +3 -1
- package/src/session/agent-session.ts +13 -1
- package/src/session/indexed-session-storage.ts +9 -0
- package/src/session/prewalk.ts +24 -2
- package/src/session/session-advisors.ts +2 -2
- package/src/session/session-context.ts +16 -12
- package/src/session/session-dump-format.ts +1 -1
- package/src/session/session-maintenance.ts +38 -4
- package/src/session/session-manager.ts +102 -67
- package/src/session/session-paths.ts +118 -55
- package/src/session/session-stats.ts +48 -3
- package/src/session/session-storage.ts +30 -22
- package/src/session/stream-guards.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +27 -24
- package/src/system-prompt.ts +8 -3
- package/src/task/index.ts +23 -8
- package/src/task/spawn-policy.ts +14 -0
- package/src/thinking.ts +2 -8
- package/src/tools/ast-grep.ts +10 -4
- package/src/tools/browser/cmux/cmux-tab.ts +5 -10
- package/src/tools/browser/cmux/rpc.ts +2 -8
- package/src/tools/browser/registry.ts +53 -2
- package/src/tools/browser/relay/bridge.ts +945 -0
- package/src/tools/browser/relay/daemon.ts +117 -0
- package/src/tools/browser/relay/extension-assets/background.js.txt +242 -0
- package/src/tools/browser/relay/extension-assets/manifest.json.txt +14 -0
- package/src/tools/browser/relay/extension-assets/options.html.txt +53 -0
- package/src/tools/browser/relay/extension-assets/options.js.txt +23 -0
- package/src/tools/browser/relay/kind.ts +41 -0
- package/src/tools/browser/relay/protocol.ts +54 -0
- package/src/tools/browser/relay/server.ts +141 -0
- package/src/tools/browser/render.ts +4 -1
- package/src/tools/browser/shared-daemon.ts +7 -58
- package/src/tools/browser/tab-supervisor.ts +5 -4
- package/src/tools/browser/tab-worker.ts +33 -12
- package/src/tools/browser.ts +26 -1
- package/src/tools/computer/exposure.ts +11 -35
- package/src/tools/computer/protocol.ts +51 -10
- package/src/tools/computer/supervisor.ts +227 -124
- package/src/tools/computer/worker-entry.ts +11 -6
- package/src/tools/computer/worker.ts +695 -81
- package/src/tools/computer-renderer.ts +104 -65
- package/src/tools/computer.ts +134 -428
- package/src/tools/context.ts +3 -0
- package/src/tools/glob.ts +9 -2
- package/src/tools/grep.ts +12 -6
- package/src/tools/inspect-image.ts +32 -6
- package/src/tools/render-utils.ts +2 -0
- package/src/tools/{browser/run-cancellation.ts → run-scope.ts} +11 -11
- package/src/tools/tool-timeouts.ts +1 -0
- package/src/tools/xdev.ts +29 -2
- package/src/utils/clipboard.ts +40 -14
- package/src/utils/command-args.ts +26 -28
- package/src/utils/tool-choice.ts +0 -13
- package/src/web/kagi.ts +2 -1
- package/src/web/search/index.ts +18 -2
- package/src/web/search/providers/anthropic.ts +4 -1
- package/src/web/search/providers/base.ts +2 -0
- package/src/web/search/providers/brave.ts +3 -1
- package/src/web/search/providers/browser-page.ts +6 -4
- package/src/web/search/providers/codex.ts +4 -1
- package/src/web/search/providers/duckduckgo.ts +2 -1
- package/src/web/search/providers/ecosia.ts +2 -1
- package/src/web/search/providers/exa.ts +4 -2
- package/src/web/search/providers/firecrawl.ts +3 -1
- package/src/web/search/providers/gemini.ts +8 -2
- package/src/web/search/providers/google.ts +2 -1
- package/src/web/search/providers/jina.ts +12 -2
- package/src/web/search/providers/kagi.ts +3 -0
- package/src/web/search/providers/kimi.ts +5 -1
- package/src/web/search/providers/mojeek.ts +2 -1
- package/src/web/search/providers/parallel.ts +5 -1
- package/src/web/search/providers/perplexity.ts +6 -3
- package/src/web/search/providers/public.ts +1 -1
- package/src/web/search/providers/searxng.ts +11 -5
- package/src/web/search/providers/startpage.ts +10 -4
- package/src/web/search/providers/synthetic.ts +11 -5
- package/src/web/search/providers/tavily.ts +3 -1
- package/src/web/search/providers/tinyfish.ts +3 -1
- package/src/web/search/providers/utils.ts +12 -10
- package/src/web/search/providers/xai.ts +2 -2
- package/src/web/search/providers/zai.ts +18 -3
- package/src/web/search/types.ts +6 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Model } from "@oh-my-pi/pi-ai";
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
/** How the computer tool is represented to the active model. */
|
|
3
|
+
export type ComputerExposureMode = "function" | "unavailable";
|
|
4
|
+
/**
|
|
5
|
+
* Report the computer tool's callable representation.
|
|
6
|
+
*
|
|
7
|
+
* Window selection is part of the tool's JSON schema, so even models with
|
|
8
|
+
* provider-native Computer Use support receive it as a function.
|
|
9
|
+
*/
|
|
10
|
+
export declare function computerExposureMode(model: Model | undefined): ComputerExposureMode;
|
|
@@ -1,41 +1,94 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ImageContent, TextContent } from "@oh-my-pi/pi-ai";
|
|
2
|
+
import type { DesktopCapabilities } from "@oh-my-pi/pi-natives";
|
|
3
|
+
/** Hidden CLI selector that re-enters the computer worker host. */
|
|
2
4
|
export declare const COMPUTER_WORKER_ARG = "__omp_worker_computer";
|
|
5
|
+
/** Frozen run settings transferred from the tool session to the worker. */
|
|
6
|
+
export interface ComputerSessionSnapshot {
|
|
7
|
+
cwd: string;
|
|
8
|
+
sessionId: string;
|
|
9
|
+
captureMaxWidth: number;
|
|
10
|
+
captureMaxHeight: number;
|
|
11
|
+
display: string;
|
|
12
|
+
readOnly: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Reply envelope for a session tool invoked by desktop JavaScript. */
|
|
15
|
+
export type ToolReply = {
|
|
16
|
+
ok: true;
|
|
17
|
+
value: unknown;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
error: RunErrorPayload;
|
|
21
|
+
};
|
|
22
|
+
/** Commands accepted by the persistent computer worker. */
|
|
3
23
|
export type ComputerWorkerInbound = {
|
|
4
24
|
type: "ping";
|
|
5
25
|
id: string;
|
|
6
26
|
} | {
|
|
7
|
-
type: "
|
|
8
|
-
|
|
27
|
+
type: "run";
|
|
28
|
+
id: string;
|
|
29
|
+
code: string;
|
|
30
|
+
timeoutMs: number;
|
|
31
|
+
session: ComputerSessionSnapshot;
|
|
32
|
+
} | {
|
|
33
|
+
type: "abort";
|
|
34
|
+
id: string;
|
|
9
35
|
} | {
|
|
10
|
-
type: "
|
|
36
|
+
type: "tool-reply";
|
|
11
37
|
id: string;
|
|
12
|
-
|
|
38
|
+
reply: ToolReply;
|
|
13
39
|
} | {
|
|
14
40
|
type: "close";
|
|
15
41
|
};
|
|
42
|
+
/** Successful computer run output returned to the tool supervisor. */
|
|
43
|
+
export interface ComputerRunOk {
|
|
44
|
+
displays: Array<TextContent | ImageContent>;
|
|
45
|
+
returnValue: unknown;
|
|
46
|
+
screenshots: ComputerScreenshot[];
|
|
47
|
+
capabilities?: DesktopCapabilities;
|
|
48
|
+
}
|
|
49
|
+
/** Full-resolution screenshot emitted during one computer run. */
|
|
50
|
+
export interface ComputerScreenshot {
|
|
51
|
+
path: string;
|
|
52
|
+
width: number;
|
|
53
|
+
height: number;
|
|
54
|
+
sourceWidth?: number;
|
|
55
|
+
sourceHeight?: number;
|
|
56
|
+
target: string;
|
|
57
|
+
}
|
|
58
|
+
/** Clone-safe error metadata returned across the worker boundary. */
|
|
59
|
+
export interface RunErrorPayload {
|
|
60
|
+
name: string;
|
|
61
|
+
message: string;
|
|
62
|
+
stack?: string;
|
|
63
|
+
isToolError: boolean;
|
|
64
|
+
isAbort: boolean;
|
|
65
|
+
}
|
|
66
|
+
/** Events emitted by the persistent computer worker. */
|
|
16
67
|
export type ComputerWorkerOutbound = {
|
|
68
|
+
type: "ready";
|
|
69
|
+
} | {
|
|
17
70
|
type: "pong";
|
|
18
71
|
id: string;
|
|
19
72
|
} | {
|
|
20
|
-
type: "
|
|
21
|
-
|
|
73
|
+
type: "result";
|
|
74
|
+
id: string;
|
|
75
|
+
ok: true;
|
|
76
|
+
payload: ComputerRunOk;
|
|
22
77
|
} | {
|
|
23
78
|
type: "result";
|
|
24
79
|
id: string;
|
|
25
|
-
|
|
26
|
-
|
|
80
|
+
ok: false;
|
|
81
|
+
error: RunErrorPayload;
|
|
27
82
|
} | {
|
|
28
|
-
type: "
|
|
29
|
-
id
|
|
30
|
-
|
|
83
|
+
type: "tool-call";
|
|
84
|
+
id: string;
|
|
85
|
+
runId: string;
|
|
86
|
+
name: string;
|
|
87
|
+
args: unknown;
|
|
31
88
|
} | {
|
|
32
89
|
type: "closed";
|
|
33
90
|
};
|
|
34
|
-
|
|
35
|
-
name: string;
|
|
36
|
-
message: string;
|
|
37
|
-
stack?: string;
|
|
38
|
-
}
|
|
91
|
+
/** Transport used by the worker core in Bun workers and tests. */
|
|
39
92
|
export interface ComputerWorkerTransport {
|
|
40
93
|
send(message: ComputerWorkerOutbound, transfer?: Bun.Transferable[]): void;
|
|
41
94
|
onMessage(handler: (message: ComputerWorkerInbound) => void): () => void;
|
|
@@ -1,32 +1,45 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { DesktopCapabilities } from "@oh-my-pi/pi-natives";
|
|
2
|
+
import type { ToolSession } from "../index.js";
|
|
3
|
+
import { type ComputerRunOk, type ComputerSessionSnapshot, type ComputerWorkerInbound, type ComputerWorkerOutbound } from "./protocol.js";
|
|
4
|
+
/** Runs desktop scripts and owns their persistent worker session. */
|
|
3
5
|
export interface ComputerController {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
run(code: string, timeoutMs: number, snapshot: ComputerSessionSnapshot, signal?: AbortSignal): Promise<ComputerRunOk>;
|
|
7
|
+
capabilities(): Promise<DesktopCapabilities | undefined>;
|
|
6
8
|
close(): Promise<void>;
|
|
7
9
|
}
|
|
10
|
+
/** Minimal Bun worker lifecycle surface used by the supervisor. */
|
|
8
11
|
export interface ComputerWorkerHandle {
|
|
9
12
|
send(message: ComputerWorkerInbound): void;
|
|
10
13
|
onMessage(handler: (message: ComputerWorkerOutbound) => void): () => void;
|
|
11
14
|
onError(handler: (error: Error) => void): () => void;
|
|
12
15
|
terminate(): Promise<void>;
|
|
13
16
|
}
|
|
17
|
+
/** Startup and shutdown deadlines for a computer worker. */
|
|
14
18
|
export interface ComputerSupervisorTimeouts {
|
|
15
19
|
startMs: number;
|
|
16
20
|
closeMs: number;
|
|
17
21
|
}
|
|
22
|
+
/** Dispatches a tool call requested from desktop JavaScript. */
|
|
23
|
+
export type ComputerSessionToolCaller = (name: string, args: unknown, options: {
|
|
24
|
+
session: ToolSession;
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
emitStatus?: () => void;
|
|
27
|
+
}) => Promise<unknown>;
|
|
28
|
+
/** Creates an isolated computer worker handle. */
|
|
18
29
|
export type ComputerWorkerFactory = () => ComputerWorkerHandle;
|
|
30
|
+
/** Spawns the computer worker through the active CLI host when available. */
|
|
19
31
|
export declare function spawnComputerWorker(): ComputerWorkerHandle;
|
|
32
|
+
/** Supervises one lazy, crash-isolated computer worker per agent session. */
|
|
20
33
|
export declare class ComputerSupervisor implements ComputerController {
|
|
21
34
|
#private;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
constructor(options: DesktopSessionOptions, createWorker?: ComputerWorkerFactory, timeouts?: ComputerSupervisorTimeouts);
|
|
26
|
-
get capabilities(): DesktopCapabilities | undefined;
|
|
27
|
-
execute(actions: DesktopAction[], signal?: AbortSignal): Promise<DesktopCapture>;
|
|
35
|
+
constructor(session: ToolSession, createWorker?: ComputerWorkerFactory, timeouts?: ComputerSupervisorTimeouts, callSessionTool?: ComputerSessionToolCaller);
|
|
36
|
+
capabilities(): Promise<DesktopCapabilities | undefined>;
|
|
37
|
+
run(code: string, timeoutMs: number, snapshot: ComputerSessionSnapshot, signal?: AbortSignal): Promise<ComputerRunOk>;
|
|
28
38
|
close(): Promise<void>;
|
|
29
39
|
}
|
|
40
|
+
/** Registers a controller for owner-scoped session cleanup. */
|
|
30
41
|
export declare function registerComputerController(ownerId: string | undefined, controller: ComputerController): () => void;
|
|
42
|
+
/** Closes every computer session owned by an agent session. */
|
|
31
43
|
export declare function releaseComputerSessionsForOwner(ownerId: string | undefined): Promise<void>;
|
|
44
|
+
/** Verifies computer worker startup, messaging, and bounded shutdown. */
|
|
32
45
|
export declare function smokeTestComputerWorker(timeoutMs?: number, createWorker?: ComputerWorkerFactory): Promise<void>;
|
|
@@ -1,15 +1,50 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ComputerWorkerTransport } from "./protocol.js";
|
|
1
|
+
import type { AxNode, AxQuery, AxSnapshotOptions, DesktopCapabilities, DesktopDisplay, DesktopPoint, DesktopSessionOptions, DesktopWindow, PointerOptions } from "@oh-my-pi/pi-natives";
|
|
2
|
+
import type { ComputerWorkerInbound, ComputerWorkerTransport } from "./protocol.js";
|
|
3
|
+
/** Native desktop operations consumed by the script runtime. */
|
|
3
4
|
export interface NativeDesktopSession {
|
|
4
|
-
readonly capabilities:
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
readonly capabilities: DesktopCapabilities;
|
|
6
|
+
listDisplays(): Promise<DesktopDisplay[]>;
|
|
7
|
+
listWindows(): Promise<DesktopWindow[]>;
|
|
8
|
+
capture(target: string, caps?: {
|
|
9
|
+
maxWidth?: number;
|
|
10
|
+
maxHeight?: number;
|
|
11
|
+
} | null): Promise<{
|
|
12
|
+
data: Uint8Array;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
sourceWidth: number;
|
|
16
|
+
sourceHeight: number;
|
|
17
|
+
target: string;
|
|
18
|
+
}>;
|
|
19
|
+
click(target: string, x: number, y: number, opts?: PointerOptions | null): Promise<void>;
|
|
20
|
+
moveMouse(target: string, x: number, y: number, opts?: PointerOptions | null): Promise<void>;
|
|
21
|
+
drag(target: string, points: DesktopPoint[], opts?: PointerOptions | null): Promise<void>;
|
|
22
|
+
scroll(target: string, x: number, y: number, dx: number, dy: number, opts?: PointerOptions | null): Promise<void>;
|
|
23
|
+
typeText(target: string, text: string, opts?: PointerOptions | null): Promise<void>;
|
|
24
|
+
keyChord(target: string, keys: string[], opts?: PointerOptions | null): Promise<void>;
|
|
25
|
+
raiseWindow(windowId: string): Promise<void>;
|
|
26
|
+
axSnapshot(target: string, opts?: AxSnapshotOptions | null): Promise<{
|
|
27
|
+
text: string;
|
|
28
|
+
}>;
|
|
29
|
+
axQuery(target: string, query: AxQuery): Promise<AxNode[]>;
|
|
30
|
+
axElementAt(target: string, x: number, y: number): Promise<AxNode | null | undefined>;
|
|
31
|
+
axFocused(): Promise<AxNode | null | undefined>;
|
|
32
|
+
axNode(ref: string): Promise<AxNode>;
|
|
33
|
+
axAttributes(ref: string): Promise<Array<[string, string]>>;
|
|
34
|
+
axChildren(ref: string): Promise<AxNode[]>;
|
|
35
|
+
axParent(ref: string): Promise<AxNode | null | undefined>;
|
|
36
|
+
axPerform(ref: string, action: string): Promise<void>;
|
|
37
|
+
axSetValue(ref: string, value: string): Promise<void>;
|
|
38
|
+
axFocus(ref: string): Promise<void>;
|
|
39
|
+
axClick(ref: string, opts?: PointerOptions | null): Promise<void>;
|
|
7
40
|
close(): Promise<void>;
|
|
8
41
|
}
|
|
42
|
+
/** Creates the native session co-located with the computer worker runtime. */
|
|
9
43
|
export type NativeDesktopSessionFactory = (options: DesktopSessionOptions) => NativeDesktopSession;
|
|
44
|
+
/** Hosts the persistent JavaScript runtime and native desktop session. */
|
|
10
45
|
export declare class ComputerWorkerCore {
|
|
11
46
|
#private;
|
|
12
|
-
private readonly transport;
|
|
13
|
-
private readonly createSession;
|
|
14
47
|
constructor(transport: ComputerWorkerTransport, createSession?: NativeDesktopSessionFactory);
|
|
48
|
+
/** Routes one supervisor command into the persistent worker state. */
|
|
49
|
+
handle(message: ComputerWorkerInbound): void;
|
|
15
50
|
}
|
|
@@ -2,21 +2,23 @@ import type { Component } from "@oh-my-pi/pi-tui";
|
|
|
2
2
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types.js";
|
|
3
3
|
import type { Theme } from "../modes/theme/theme.js";
|
|
4
4
|
interface ComputerRenderArgs {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
code?: unknown;
|
|
6
|
+
read_only?: unknown;
|
|
7
|
+
window?: unknown;
|
|
8
|
+
actions?: unknown;
|
|
8
9
|
}
|
|
9
10
|
interface ComputerRenderResult {
|
|
10
|
-
content
|
|
11
|
+
content?: Array<{
|
|
11
12
|
type: string;
|
|
12
13
|
text?: string;
|
|
13
14
|
}>;
|
|
14
15
|
details?: unknown;
|
|
15
16
|
isError?: boolean;
|
|
16
17
|
}
|
|
18
|
+
/** Renders computer scripts, run state, screenshots, and failures in the TUI. */
|
|
17
19
|
export declare const computerToolRenderer: {
|
|
18
20
|
mergeCallAndResult: boolean;
|
|
19
|
-
renderCall(args: ComputerRenderArgs,
|
|
21
|
+
renderCall(args: ComputerRenderArgs, options: RenderResultOptions, theme: Theme): Component;
|
|
20
22
|
renderResult(result: ComputerRenderResult, options: RenderResultOptions, theme: Theme, args?: ComputerRenderArgs): Component;
|
|
21
23
|
};
|
|
22
24
|
export {};
|
|
@@ -1,66 +1,47 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolApprovalDecision } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import type {
|
|
3
|
-
import type { DesktopCapabilities, DesktopCapture, DesktopDisplay, DesktopSessionOptions } from "@oh-my-pi/pi-natives";
|
|
2
|
+
import type { DesktopCapabilities } from "@oh-my-pi/pi-natives";
|
|
4
3
|
import { type Type } from "arktype";
|
|
4
|
+
import type { ComputerScreenshot } from "./computer/protocol.js";
|
|
5
5
|
import { type ComputerController } from "./computer/supervisor.js";
|
|
6
6
|
import type { ToolSession } from "./index.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
y?: number;
|
|
15
|
-
button?: "left" | "right" | "wheel" | "back" | "forward";
|
|
16
|
-
path?: ComputerSchemaPoint[];
|
|
17
|
-
keys?: string[] | null;
|
|
18
|
-
scroll_x?: number;
|
|
19
|
-
scroll_y?: number;
|
|
20
|
-
text?: string;
|
|
21
|
-
};
|
|
22
|
-
export type ComputerParams = {
|
|
23
|
-
actions?: ComputerSchemaAction[];
|
|
24
|
-
};
|
|
25
|
-
type IsSameType<Left, Right> = [Left] extends [Right] ? ([Right] extends [Left] ? true : false) : false;
|
|
26
|
-
type ComputerSchema<Schema extends Type = Type<ComputerParams>> = IsSameType<ComputerParams, Schema["infer"]> extends true ? Schema : never;
|
|
7
|
+
interface ComputerToolInput {
|
|
8
|
+
code: string;
|
|
9
|
+
read_only?: boolean;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
}
|
|
12
|
+
type ComputerSchema = Type<ComputerToolInput>;
|
|
13
|
+
/** Renderer and artifact metadata produced by a computer tool run. */
|
|
27
14
|
export interface ComputerToolDetails {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
actions: ComputerAction["type"][];
|
|
15
|
+
code?: string;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
screenshots: ComputerScreenshot[];
|
|
18
|
+
returnValue?: string;
|
|
19
|
+
backend?: string;
|
|
20
|
+
capturePermission?: string;
|
|
21
|
+
inputPermission?: string;
|
|
22
|
+
axPermission?: string;
|
|
37
23
|
}
|
|
38
|
-
|
|
24
|
+
/** Creates the session-scoped controller used by the computer tool. */
|
|
25
|
+
export type ComputerControllerFactory = (session: ToolSession) => ComputerController;
|
|
26
|
+
/** Maps inspection-only runs to read approval and all other runs to execution approval. */
|
|
39
27
|
export declare function computerApproval(args: unknown): ToolApprovalDecision;
|
|
28
|
+
/** Executes persistent desktop JavaScript through one lazy worker session. */
|
|
40
29
|
export declare class ComputerTool implements AgentTool<ComputerSchema, ComputerToolDetails> {
|
|
41
30
|
#private;
|
|
42
31
|
readonly session: ToolSession;
|
|
43
32
|
readonly name = "computer";
|
|
44
|
-
readonly native: {
|
|
45
|
-
readonly type: "computer";
|
|
46
|
-
};
|
|
47
33
|
readonly label = "Computer";
|
|
48
34
|
readonly loadMode: "essential";
|
|
49
35
|
readonly concurrency: "exclusive";
|
|
50
|
-
readonly summary = "
|
|
51
|
-
get parameters(): ComputerSchema;
|
|
36
|
+
readonly summary = "Control the host desktop with persistent JavaScript and OS accessibility APIs";
|
|
52
37
|
readonly strict = false;
|
|
53
38
|
readonly approval: typeof computerApproval;
|
|
54
39
|
readonly formatApprovalDetails: (args: unknown) => string[];
|
|
55
|
-
/**
|
|
56
|
-
* Settings snapshot used to create the tool's current controller; refreshed
|
|
57
|
-
* when a model switch crosses the coordinate-safe sizing boundary. Surfaced
|
|
58
|
-
* by `/computer status`.
|
|
59
|
-
*/
|
|
60
|
-
effectiveConfiguration: Readonly<DesktopSessionOptions>;
|
|
61
40
|
constructor(session: ToolSession, createController?: ComputerControllerFactory);
|
|
41
|
+
get parameters(): ComputerSchema;
|
|
62
42
|
get description(): string;
|
|
63
|
-
execute(_toolCallId: string, params:
|
|
43
|
+
execute(_toolCallId: string, params: ComputerToolInput, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<ComputerToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<ComputerToolDetails>>;
|
|
44
|
+
capabilities(): Promise<DesktopCapabilities | undefined>;
|
|
64
45
|
close(): Promise<void>;
|
|
65
46
|
}
|
|
66
47
|
export {};
|
|
@@ -12,6 +12,9 @@ declare module "@oh-my-pi/pi-agent-core" {
|
|
|
12
12
|
* wrapper must not re-prompt for the same action (explicit per-tool
|
|
13
13
|
* policies and overrides still apply). */
|
|
14
14
|
xdevApproved?: boolean;
|
|
15
|
+
/** Reports the approval tier resolved after an extension rewrites an
|
|
16
|
+
* xd:// device call, so dispatch metadata describes the input that ran. */
|
|
17
|
+
xdevTierResolved?(tier: "read" | "write" | "exec"): void;
|
|
15
18
|
/** Set only after an interactive prompt approves provider computer safety checks. */
|
|
16
19
|
providerSafetyApproved?: boolean;
|
|
17
20
|
}
|
|
@@ -64,7 +64,7 @@ export declare class GlobTool implements AgentTool<typeof findSchema, GlobToolDe
|
|
|
64
64
|
readonly approval: "read";
|
|
65
65
|
readonly loadMode = "essential";
|
|
66
66
|
readonly label = "Glob";
|
|
67
|
-
|
|
67
|
+
get description(): string;
|
|
68
68
|
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
69
69
|
path?: string | undefined;
|
|
70
70
|
hidden?: boolean | undefined;
|
|
@@ -78,7 +78,7 @@ export declare class GrepTool implements AgentTool<typeof searchSchema, GrepTool
|
|
|
78
78
|
readonly label = "Grep";
|
|
79
79
|
readonly loadMode = "discoverable";
|
|
80
80
|
readonly summary = "Grep file contents using ripgrep (fast regex search)";
|
|
81
|
-
|
|
81
|
+
get description(): string;
|
|
82
82
|
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
83
83
|
pattern: string;
|
|
84
84
|
path?: string | undefined;
|
|
@@ -28,6 +28,8 @@ export declare const PREVIEW_LIMITS: {
|
|
|
28
28
|
readonly OUTPUT_COLLAPSED: 3;
|
|
29
29
|
/** Output preview lines in expanded view */
|
|
30
30
|
readonly OUTPUT_EXPANDED: 10;
|
|
31
|
+
/** Computer script lines shown in collapsed view */
|
|
32
|
+
readonly COMPUTER_CODE_COLLAPSED: 10;
|
|
31
33
|
/** Max hunks shown when collapsed (edit tool) */
|
|
32
34
|
readonly DIFF_COLLAPSED_HUNKS: 8;
|
|
33
35
|
/** Max diff lines shown when collapsed (edit tool) */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Marks a run-scoped promise as observed without changing its behavior for awaited callers.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Run teardown aborts can reject promises created for evaluated code after user code
|
|
5
5
|
* has stopped observing them (for example fire-and-forget `wait()`/facade calls). In 16.3.0
|
|
6
6
|
* those zero-consumer rejections reached the process-level `unhandledRejection` handler and
|
|
7
7
|
* killed every subagent sharing the process (issues #4499/#4672). Attaching a no-op rejection
|
|
@@ -23,19 +23,19 @@ export interface WaitPredicateOptions {
|
|
|
23
23
|
/**
|
|
24
24
|
* Effective `wait(predicate)` deadline for a given cell budget. Always strictly below
|
|
25
25
|
* the cell budget so the named `wait(predicate) timed out` error wins the race against
|
|
26
|
-
* the opaque whole-cell
|
|
27
|
-
*
|
|
26
|
+
* the opaque whole-cell execution timeout. `0`/`Infinity` ("disable") map to the largest
|
|
27
|
+
* bounded deadline; negative/NaN garbage falls back to the default.
|
|
28
28
|
*/
|
|
29
29
|
export declare function resolvePredicateTimeout(cellTimeoutMs: number, explicit?: number): number;
|
|
30
30
|
/**
|
|
31
|
-
* Run-scoped `wait()` helper for evaluated browser
|
|
32
|
-
* cancellation signal.
|
|
31
|
+
* Run-scoped `wait()` helper for evaluated code (browser and computer workers), honoring
|
|
32
|
+
* the owning run's cancellation signal.
|
|
33
33
|
*
|
|
34
34
|
* - `wait(ms)` sleeps for `ms` milliseconds.
|
|
35
35
|
* - `wait(fn, { timeout?, interval? })` polls `fn` (sync or async) until it returns a
|
|
36
36
|
* truthy value and resolves with that value; throws a named `ToolError` on timeout
|
|
37
37
|
* instead of stalling into the whole-cell deadline. Predicate errors propagate.
|
|
38
38
|
*/
|
|
39
|
-
export declare function
|
|
40
|
-
/** Binds a long-lived
|
|
41
|
-
export declare function
|
|
39
|
+
export declare function waitForRun(msOrPredicate: number | (() => unknown), signal: AbortSignal, opts?: WaitPredicateOptions): Promise<unknown>;
|
|
40
|
+
/** Binds a long-lived scope facade (page/tab/desktop objects) to one evaluated run's abort signal. */
|
|
41
|
+
export declare function bindRunFacade<T extends object>(target: T, signal: AbortSignal): T;
|
|
@@ -32,6 +32,7 @@ import type { AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolLo
|
|
|
32
32
|
import { type Component } from "@oh-my-pi/pi-tui";
|
|
33
33
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types.js";
|
|
34
34
|
import type { Theme } from "../modes/theme/theme.js";
|
|
35
|
+
import { type ToolTier } from "./approval.js";
|
|
35
36
|
import type { Tool } from "./index.js";
|
|
36
37
|
import type { ToolRenderer } from "./renderers.js";
|
|
37
38
|
/**
|
|
@@ -71,6 +72,13 @@ export interface XdevDispatch {
|
|
|
71
72
|
mode: "help" | "execute";
|
|
72
73
|
/** Validated inner args, kept for renderer delegation on result rebuilds. */
|
|
73
74
|
args?: Record<string, unknown>;
|
|
75
|
+
/**
|
|
76
|
+
* Approval tier of the wrapped tool for {@link args} (`read` = no workspace
|
|
77
|
+
* mutation). Absent for `help` dispatches and calls whose tier could not be
|
|
78
|
+
* resolved. Consumed by the prewalk coordinator to skip read-only device
|
|
79
|
+
* calls when deciding the model hand-off (issue #7312).
|
|
80
|
+
*/
|
|
81
|
+
tier?: ToolTier;
|
|
74
82
|
/** Details object returned by the wrapped tool, when executed. */
|
|
75
83
|
inner?: unknown;
|
|
76
84
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ClipboardImage } from "@oh-my-pi/pi-natives/clipboard";
|
|
2
2
|
/**
|
|
3
3
|
* Read file paths from the macOS pasteboard's `public.file-url` representation.
|
|
4
4
|
*
|
|
@@ -28,7 +28,7 @@ export declare function copyToClipboard(text: string): Promise<void>;
|
|
|
28
28
|
* because terminal clipboard paths can leave image payloads invisible to the
|
|
29
29
|
* native bridge.
|
|
30
30
|
*
|
|
31
|
-
* @returns
|
|
31
|
+
* @returns A supported image payload or null when no image is available.
|
|
32
32
|
*/
|
|
33
33
|
export declare function readImageFromClipboard(): Promise<ClipboardImage | null>;
|
|
34
34
|
/**
|
package/dist/types/web/kagi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ModelRegistry } from "../../config/model-registry.js";
|
|
|
10
10
|
import type { CustomTool } from "../../extensibility/custom-tools/types.js";
|
|
11
11
|
import type { ToolSession } from "../../tools/index.js";
|
|
12
12
|
import { type SearchRenderDetails } from "./render.js";
|
|
13
|
-
import type
|
|
13
|
+
import { type SearchProviderId } from "./types.js";
|
|
14
14
|
/** Web search tool parameters schema */
|
|
15
15
|
export declare const webSearchSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
16
16
|
query: string;
|
|
@@ -46,6 +46,8 @@ export interface SearchParams {
|
|
|
46
46
|
recency?: "day" | "week" | "month" | "year";
|
|
47
47
|
systemPrompt: string;
|
|
48
48
|
signal?: AbortSignal;
|
|
49
|
+
/** Hard timeout for this provider's search transport, in milliseconds. */
|
|
50
|
+
timeoutMs?: number;
|
|
49
51
|
fetch?: FetchImpl;
|
|
50
52
|
maxOutputTokens?: number;
|
|
51
53
|
numSearchResults?: number;
|
|
@@ -15,6 +15,7 @@ export interface FirecrawlSearchParams {
|
|
|
15
15
|
/** Explicit `tbs` (custom date range); takes precedence over `recency`. */
|
|
16
16
|
tbs?: string;
|
|
17
17
|
signal?: AbortSignal;
|
|
18
|
+
timeoutMs?: number;
|
|
18
19
|
fetch?: FetchImpl;
|
|
19
20
|
}
|
|
20
21
|
/** Resolve Firecrawl API key through the shared auth storage pipeline. */
|
|
@@ -31,6 +31,7 @@ export interface GeminiSearchParams extends GeminiToolParams {
|
|
|
31
31
|
/** Sampling temperature (0–1). Lower = more focused/factual. */
|
|
32
32
|
temperature?: number;
|
|
33
33
|
signal?: AbortSignal;
|
|
34
|
+
timeoutMs?: number;
|
|
34
35
|
authStorage: AuthStorage;
|
|
35
36
|
sessionId?: string;
|
|
36
37
|
fetch?: FetchImpl;
|
|
@@ -7,6 +7,7 @@ export declare function searchParallel(params: {
|
|
|
7
7
|
query: string;
|
|
8
8
|
num_results?: number;
|
|
9
9
|
signal?: AbortSignal;
|
|
10
|
+
timeoutMs?: number;
|
|
10
11
|
fetch?: FetchImpl;
|
|
11
12
|
parsedQuery?: StructuredQuery;
|
|
12
13
|
}, authStorage: AuthStorage, sessionId?: string): Promise<SearchResponse>;
|
|
@@ -14,6 +14,7 @@ import type { SearchParams } from "./base.js";
|
|
|
14
14
|
import { SearchProvider } from "./base.js";
|
|
15
15
|
export interface PerplexitySearchParams {
|
|
16
16
|
signal?: AbortSignal;
|
|
17
|
+
timeoutMs?: number;
|
|
17
18
|
query: string;
|
|
18
19
|
system_prompt?: string;
|
|
19
20
|
/** Pre-parsed view of `query` from the search pipeline; parsed locally when absent. */
|