@oh-my-pi/pi-coding-agent 15.10.7 → 15.10.9
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 +27 -0
- package/dist/types/config/model-registry.d.ts +4 -2
- package/dist/types/config/model-resolver.d.ts +2 -0
- package/dist/types/config/settings-schema.d.ts +9 -0
- package/dist/types/extensibility/custom-tools/loader.d.ts +22 -3
- package/dist/types/extensibility/custom-tools/types.d.ts +3 -1
- package/dist/types/extensibility/extensions/index.d.ts +1 -1
- package/dist/types/extensibility/extensions/loader.d.ts +17 -1
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +8 -0
- package/dist/types/mcp/oauth-discovery.d.ts +4 -1
- package/dist/types/mcp/oauth-flow.d.ts +6 -1
- package/dist/types/mcp/transports/stdio.d.ts +12 -0
- package/dist/types/modes/components/custom-editor.d.ts +3 -2
- package/dist/types/sdk.d.ts +42 -2
- package/dist/types/task/executor.d.ts +16 -0
- package/dist/types/tools/fetch.d.ts +2 -1
- package/dist/types/tools/index.d.ts +20 -1
- package/dist/types/tools/report-tool-issue.d.ts +5 -0
- package/dist/types/tui/hyperlink.d.ts +8 -0
- package/dist/types/web/kagi.d.ts +2 -1
- package/dist/types/web/parallel.d.ts +3 -0
- package/dist/types/web/search/providers/anthropic.d.ts +2 -1
- package/dist/types/web/search/providers/base.d.ts +2 -1
- package/dist/types/web/search/providers/brave.d.ts +2 -1
- package/dist/types/web/search/providers/codex.d.ts +2 -1
- package/dist/types/web/search/providers/exa.d.ts +2 -1
- package/dist/types/web/search/providers/gemini.d.ts +2 -1
- package/dist/types/web/search/providers/jina.d.ts +7 -2
- package/dist/types/web/search/providers/kagi.d.ts +7 -2
- package/dist/types/web/search/providers/kimi.d.ts +7 -2
- package/dist/types/web/search/providers/parallel.d.ts +2 -1
- package/dist/types/web/search/providers/perplexity.d.ts +2 -1
- package/dist/types/web/search/providers/searxng.d.ts +2 -1
- package/dist/types/web/search/providers/synthetic.d.ts +7 -3
- package/dist/types/web/search/providers/tavily.d.ts +2 -1
- package/dist/types/web/search/providers/zai.d.ts +2 -1
- package/package.json +9 -9
- package/src/config/model-registry.ts +13 -7
- package/src/config/model-resolver.ts +57 -2
- package/src/config/settings-schema.ts +6 -0
- package/src/extensibility/custom-tools/loader.ts +43 -19
- package/src/extensibility/custom-tools/types.ts +3 -1
- package/src/extensibility/extensions/index.ts +1 -0
- package/src/extensibility/extensions/loader.ts +29 -6
- package/src/extensibility/plugins/legacy-pi-compat.ts +30 -6
- package/src/internal-urls/docs-index.generated.ts +1 -1
- package/src/mcp/oauth-discovery.ts +8 -3
- package/src/mcp/oauth-flow.ts +12 -5
- package/src/mcp/transports/stdio.ts +139 -3
- package/src/modes/components/assistant-message.ts +28 -6
- package/src/modes/components/custom-editor.ts +69 -9
- package/src/modes/components/transcript-container.ts +77 -25
- package/src/modes/controllers/input-controller.ts +1 -1
- package/src/modes/controllers/mcp-command-controller.ts +2 -2
- package/src/sdk.ts +138 -56
- package/src/ssh/ssh-executor.ts +60 -4
- package/src/task/executor.ts +19 -0
- package/src/task/index.ts +4 -0
- package/src/tools/fetch.ts +22 -5
- package/src/tools/image-gen.ts +33 -11
- package/src/tools/index.ts +21 -2
- package/src/tools/report-tool-issue.ts +7 -1
- package/src/tui/hyperlink.ts +27 -3
- package/src/web/kagi.ts +5 -2
- package/src/web/parallel.ts +7 -3
- package/src/web/search/providers/anthropic.ts +5 -1
- package/src/web/search/providers/base.ts +2 -1
- package/src/web/search/providers/brave.ts +5 -2
- package/src/web/search/providers/codex.ts +6 -2
- package/src/web/search/providers/exa.ts +91 -8
- package/src/web/search/providers/gemini.ts +6 -0
- package/src/web/search/providers/jina.ts +15 -5
- package/src/web/search/providers/kagi.ts +9 -2
- package/src/web/search/providers/kimi.ts +18 -4
- package/src/web/search/providers/parallel.ts +6 -2
- package/src/web/search/providers/perplexity.ts +7 -4
- package/src/web/search/providers/searxng.ts +6 -2
- package/src/web/search/providers/synthetic.ts +9 -5
- package/src/web/search/providers/tavily.ts +4 -2
- package/src/web/search/providers/zai.ts +15 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [15.10.9] - 2026-06-09
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed streaming thinking (and other styled assistant content) vanishing from native scrollback once it scrolled past the viewport top during a foreground turn. The transcript's append-only commit detector compared raw row bytes, so a styled paragraph wrapping onto a new row (the span-closing SGR and width padding move while the visible cells stay identical) or a streamed token pushing the last word down a line flagged the block as permanently volatile — the commit boundary froze and every later row that crossed the viewport top was committed nowhere. Rows are now compared by visible content, a wrap-shrink of the in-flight bottom line counts as append-only, and a genuine one-off interior rewrite only suspends commits until the block re-earns append-only (30 clean frames), after which the pinned emitter backfills the stalled gap contiguously. Periodically rewriting blocks (spinners, collapsing tool previews) never re-earn and stay deferred.
|
|
10
|
+
|
|
11
|
+
- Fixed bracketed pastes containing multiple image file paths so each image is attached in order instead of treating the whole paste as one unreadable path.
|
|
12
|
+
|
|
13
|
+
- Fixed MCP OAuth fallback prompts so the "Click here to authorize" label emits an auth-safe terminal hyperlink even when hyperlink auto-detection is unavailable, keeping non-browser MCP setup usable ([#2196](https://github.com/can1357/oh-my-pi/issues/2196)).
|
|
14
|
+
- Fixed `task`-spawned subagents repeating filesystem scans the parent had already completed. `ExecutorOptions` and the `createAgentSession()` call inside `runSubprocess()` did not forward `rules`, the discovered extension paths, or the discovered `.omp/tools/` paths, so each subagent re-ran `loadCapability<Rule>()`, `discoverAndLoadExtensions()`, and the full `.omp/tools/` walk. The toolsession now caches `session.rules`, `session.extensionPaths`, and `session.customToolPaths`; `runSubprocess()` threads them through; and `createAgentSession()` accepts new `preloadedExtensionPaths` and `preloadedCustomToolPaths` options backed by new exported `discoverExtensionPaths()` and `discoverCustomToolPaths()` helpers. Crucially, only path lists are forwarded — never loaded instances. Each session rebuilds its own `Extension` and `LoadedCustomTool` objects so the per-session `ExtensionAPI`/`CustomToolAPI` (cwd, eventBus, runtime, exec, pushPendingAction, UI) targets the right session; forwarding loaded instances would have routed extension handlers and custom-tool execution back through the parent. The CLI's `preloadedExtensions` short-circuit is preserved for same-process reuse and now shallow-clones the caller's `extensions` array so inline-extension augmentation (autoresearch + custom-tools wrapper) cannot bleed back into it ([#2190](https://github.com/can1357/oh-my-pi/issues/2190)).
|
|
15
|
+
- Fixed SSH tool cancellation hanging behind OpenSSH ControlMaster streams that stayed open after an Esc/user interrupt ([#2180](https://github.com/can1357/oh-my-pi/issues/2180)).
|
|
16
|
+
- Fixed Windows stdio MCP servers launched through PATH shims such as `codegraph.cmd` so bare commands like `codegraph` resolve via `PATHEXT` before spawn ([#2174](https://github.com/can1357/oh-my-pi/issues/2174)).
|
|
17
|
+
- Fixed compiled-binary extensions failing to load `@oh-my-pi/pi-*` packages when `bun --compile` quietly dropped one of the extra entrypoints (observed on macOS arm64 release builds): the legacy-pi compat shim's package-root override branch returned the bunfs path without checking the target was present, so the rewrite emitted a `file://` URL to a missing module and the #1216 fallback (scoped to the throwing `getResolvedSpecifier` path) never ran. Override targets are now validated against the on-disk filesystem at module init, missing entries are dropped, and resolution falls through to canonical lookup so Bun resolves the import from the extension's own `node_modules` ([#2168](https://github.com/can1357/oh-my-pi/issues/2168)).
|
|
18
|
+
|
|
19
|
+
## [15.10.8] - 2026-06-09
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- Added an optional `fetch` option to `CustomToolContext` so custom tools can use a caller-provided HTTP implementation
|
|
24
|
+
- Added optional `fetch` overrides to `ModelRegistry` construction and MCP/web search/tool network calls, enabling callers to inject custom HTTP clients instead of relying on global `fetch`
|
|
25
|
+
- Added a `bash.enabled` setting to disable the model-facing bash tool while leaving user-initiated bang/RPC bash commands available.
|
|
26
|
+
- Added an `@<upstream>` model-selector suffix to pin an aggregator model to a single upstream provider per invocation, e.g. `--model openrouter/z-ai/glm-4.7@cerebras` (sets OpenRouter `provider.only`; Vercel AI Gateway models map to `vercelGatewayRouting.only`). Resolved through `parseModelPattern`, so it works for `--model`/`--smol`, model roles, and the SDK, and composes with a trailing thinking level (`...@cerebras:high`). The base must resolve to an aggregator (`openrouter.ai` / `ai-gateway.vercel.sh`); otherwise the `@` stays part of the id, so ids that legitimately contain `@` (`claude-opus-4-8@default`, `workers-ai/@cf/...`) are unaffected.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Fixed a turn-ending provider error (e.g. a 502 whose body is the proxy's full HTML page) flooding the transcript: `AnthropicApiError` folds the entire response body into `errorMessage`, and the inline transcript render reprinted it verbatim — every embedded blank line included — leaving a tall mostly-empty block ending in `</html>`. The inline error now drops blank lines, clamps to 8 lines, and width-truncates each line via `getPreviewLines`, matching the pinned error banner.
|
|
31
|
+
|
|
5
32
|
## [15.10.7] - 2026-06-08
|
|
6
33
|
|
|
7
34
|
### Fixed
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ModelRefreshStrategy } from "@oh-my-pi/pi-ai/model-manager";
|
|
2
2
|
import type { Api, Context, Model, SimpleStreamOptions, ThinkingConfig } from "@oh-my-pi/pi-ai/types";
|
|
3
3
|
import type { AssistantMessageEventStream } from "@oh-my-pi/pi-ai/utils/event-stream";
|
|
4
|
-
import type { ApiKeyResolver } from "@oh-my-pi/pi-ai";
|
|
4
|
+
import type { ApiKeyResolver, FetchImpl } from "@oh-my-pi/pi-ai";
|
|
5
5
|
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/oauth/types";
|
|
6
6
|
import { type ThemeColor } from "../modes/theme/theme";
|
|
7
7
|
import type { AuthStorage } from "../session/auth-storage";
|
|
@@ -277,7 +277,9 @@ export declare class ModelRegistry {
|
|
|
277
277
|
* migration step lands off the event loop's hot path before the first
|
|
278
278
|
* `tryLoad()` runs.
|
|
279
279
|
*/
|
|
280
|
-
constructor(authStorage: AuthStorage, modelsPath?: string
|
|
280
|
+
constructor(authStorage: AuthStorage, modelsPath?: string, options?: {
|
|
281
|
+
fetch?: FetchImpl;
|
|
282
|
+
});
|
|
281
283
|
/**
|
|
282
284
|
* Reload models from disk (built-in + custom from models.json).
|
|
283
285
|
*/
|
|
@@ -50,6 +50,8 @@ export interface ParsedModelResult {
|
|
|
50
50
|
model: Model<Api> | undefined;
|
|
51
51
|
/** Thinking level if explicitly specified in pattern, undefined otherwise */
|
|
52
52
|
thinkingLevel?: ThinkingLevel;
|
|
53
|
+
/** Upstream provider slug from an `@upstream` routing selector, if present. */
|
|
54
|
+
upstream?: string;
|
|
53
55
|
warning: string | undefined;
|
|
54
56
|
explicitThinkingLevel: boolean;
|
|
55
57
|
}
|
|
@@ -2505,6 +2505,15 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2505
2505
|
readonly description: "Automatically create a comprehensive todo list after the first message";
|
|
2506
2506
|
};
|
|
2507
2507
|
};
|
|
2508
|
+
readonly "bash.enabled": {
|
|
2509
|
+
readonly type: "boolean";
|
|
2510
|
+
readonly default: true;
|
|
2511
|
+
readonly ui: {
|
|
2512
|
+
readonly tab: "tools";
|
|
2513
|
+
readonly label: "Bash";
|
|
2514
|
+
readonly description: "Enable the bash tool for shell command execution";
|
|
2515
|
+
};
|
|
2516
|
+
};
|
|
2508
2517
|
readonly "find.enabled": {
|
|
2509
2518
|
readonly type: "boolean";
|
|
2510
2519
|
readonly default: true;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { HookUIContext } from "../../extensibility/hooks/types";
|
|
3
3
|
import type { LoadedCustomTool, ToolLoadError } from "./types";
|
|
4
|
-
/** Tool path with optional source metadata
|
|
5
|
-
|
|
4
|
+
/** Tool path with optional source metadata, suitable for forwarding from a
|
|
5
|
+
* parent session to a subagent so the subagent can re-bind tools to its own
|
|
6
|
+
* `CustomToolAPI` without redoing the filesystem scan. */
|
|
7
|
+
export interface ToolPathWithSource {
|
|
6
8
|
path: string;
|
|
7
9
|
source?: {
|
|
8
10
|
provider: string;
|
|
@@ -46,12 +48,30 @@ export declare function loadCustomTools(pathsWithSources: ToolPathWithSource[],
|
|
|
46
48
|
errors: ToolLoadError[];
|
|
47
49
|
setUIContext: (uiContext: HookUIContext, hasUI: boolean) => void;
|
|
48
50
|
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Collect the absolute tool-source paths to load, without importing or
|
|
53
|
+
* binding factories. Hot path on session startup — the scan walks
|
|
54
|
+
* `.omp/tools/`, `.claude/tools/`, the plugin tree, and any configured paths.
|
|
55
|
+
*
|
|
56
|
+
* Subagents reuse the parent's collected paths via the SDK's
|
|
57
|
+
* `preloadedCustomToolPaths` option, then call `loadCustomTools` themselves
|
|
58
|
+
* so each session re-binds factories with its own session-scoped
|
|
59
|
+
* `CustomToolAPI` (cwd, exec, pushPendingAction, UI).
|
|
60
|
+
*
|
|
61
|
+
* @param configuredPaths - Explicit paths from settings.json and CLI --tool flags
|
|
62
|
+
* @param cwd - Current working directory
|
|
63
|
+
*/
|
|
64
|
+
export declare function discoverCustomToolPaths(configuredPaths: string[], cwd: string): Promise<ToolPathWithSource[]>;
|
|
49
65
|
/**
|
|
50
66
|
* Discover and load tools from standard locations via capability system:
|
|
51
67
|
* 1. User and project tools discovered by capability providers
|
|
52
68
|
* 2. Installed plugins (~/.omp/plugins/node_modules/*)
|
|
53
69
|
* 3. Explicitly configured paths from settings or CLI
|
|
54
70
|
*
|
|
71
|
+
* Composed of {@link discoverCustomToolPaths} (FS scan) + {@link loadCustomTools}
|
|
72
|
+
* (per-session binding). Subagents skip the first step and just call
|
|
73
|
+
* `loadCustomTools` against the parent's collected paths.
|
|
74
|
+
*
|
|
55
75
|
* @param configuredPaths - Explicit paths from settings.json and CLI --tool flags
|
|
56
76
|
* @param cwd - Current working directory
|
|
57
77
|
* @param builtInToolNames - Names of built-in tools to check for conflicts
|
|
@@ -66,4 +86,3 @@ export declare function discoverAndLoadCustomTools(configuredPaths: string[], cw
|
|
|
66
86
|
errors: ToolLoadError[];
|
|
67
87
|
setUIContext: (uiContext: HookUIContext, hasUI: boolean) => void;
|
|
68
88
|
}>;
|
|
69
|
-
export {};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentToolResult, AgentToolUpdateCallback, ToolApproval, ToolApprovalDecision, ToolTier } from "@oh-my-pi/pi-agent-core";
|
|
8
8
|
import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
|
|
9
|
-
import type { Model, Static, TSchema } from "@oh-my-pi/pi-ai";
|
|
9
|
+
import type { FetchImpl, Model, Static, TSchema } from "@oh-my-pi/pi-ai";
|
|
10
10
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
11
11
|
import type { Rule } from "../../capability/rule";
|
|
12
12
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
@@ -74,6 +74,8 @@ export interface CustomToolContext {
|
|
|
74
74
|
abort(): void;
|
|
75
75
|
/** Settings instance for the current session. Prefer over the global singleton. */
|
|
76
76
|
settings?: Settings;
|
|
77
|
+
/** Fetch implementation for outbound HTTP; defaults to global fetch when omitted. */
|
|
78
|
+
fetch?: FetchImpl;
|
|
77
79
|
/** Whether to auto-approve all destructive tool operations (--auto-approve CLI flag) */
|
|
78
80
|
autoApprove?: boolean;
|
|
79
81
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Extension system for lifecycle events and custom tools.
|
|
3
3
|
*/
|
|
4
4
|
export type { SlashCommandInfo, SlashCommandLocation, SlashCommandSource } from "../slash-commands";
|
|
5
|
-
export { discoverAndLoadExtensions, ExtensionRuntimeNotInitializedError, loadExtensionFromFactory, loadExtensions, } from "./loader";
|
|
5
|
+
export { discoverAndLoadExtensions, discoverExtensionPaths, ExtensionRuntimeNotInitializedError, loadExtensionFromFactory, loadExtensions, } from "./loader";
|
|
6
6
|
export * from "./runner";
|
|
7
7
|
export * from "./types";
|
|
8
8
|
export * from "./wrapper";
|
|
@@ -38,6 +38,22 @@ export declare function loadExtensionFromFactory(factory: ExtensionFactory, cwd:
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function loadExtensions(paths: string[], cwd: string, eventBus?: EventBus): Promise<LoadExtensionsResult>;
|
|
40
40
|
/**
|
|
41
|
-
* Discover
|
|
41
|
+
* Discover absolute paths of extensions to load, without importing or
|
|
42
|
+
* binding factories. Hot path on session startup — the scan walks native
|
|
43
|
+
* `.omp`/`.pi` extension capabilities, the installed-plugin tree, and any
|
|
44
|
+
* configured paths.
|
|
45
|
+
*
|
|
46
|
+
* Subagents reuse the parent's collected paths via the SDK's
|
|
47
|
+
* `preloadedExtensionPaths` option, then call {@link loadExtensions} themselves
|
|
48
|
+
* so each session rebuilds Extension instances bound to its OWN
|
|
49
|
+
* `ExtensionAPI` (cwd, eventBus, runtime). Forwarding the parent's
|
|
50
|
+
* `LoadExtensionsResult` directly would reuse handlers/tools/commands that
|
|
51
|
+
* closed over the parent's `cwd` and event bus.
|
|
52
|
+
*/
|
|
53
|
+
export declare function discoverExtensionPaths(configuredPaths: string[], cwd: string, disabledExtensionIds?: string[]): Promise<string[]>;
|
|
54
|
+
/**
|
|
55
|
+
* Discover and load extensions from standard locations. Composed of
|
|
56
|
+
* {@link discoverExtensionPaths} (FS scan) + {@link loadExtensions}
|
|
57
|
+
* (per-session binding).
|
|
42
58
|
*/
|
|
43
59
|
export declare function discoverAndLoadExtensions(configuredPaths: string[], cwd: string, eventBus?: EventBus, disabledExtensionIds?: string[]): Promise<LoadExtensionsResult>;
|
|
@@ -13,6 +13,14 @@ import * as path from "node:path";
|
|
|
13
13
|
* Exported for tests; production callers use `BUNFS_PACKAGE_ROOT` below.
|
|
14
14
|
*/
|
|
15
15
|
export declare function __computeBunfsPackageRoot(metaDir: string, pathImpl?: typeof path): string;
|
|
16
|
+
/**
|
|
17
|
+
* Drop overrides whose targets are missing on disk so they can fall through to
|
|
18
|
+
* the canonical-resolution path. Exported for the test seam in #2168.
|
|
19
|
+
*
|
|
20
|
+
* `pathExistsSync` defaults to `fs.existsSync`; the tests inject a stub to
|
|
21
|
+
* simulate the missing-entrypoint failure mode without touching the real FS.
|
|
22
|
+
*/
|
|
23
|
+
export declare function __validateLegacyPiPackageRootOverrides(candidates: Record<string, string>, pathExistsSync?: (p: string) => boolean): Record<string, string>;
|
|
16
24
|
/**
|
|
17
25
|
* Load a legacy Pi extension module from its real on-disk location.
|
|
18
26
|
*
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Automatically detects OAuth requirements from MCP server responses
|
|
5
5
|
* and extracts authentication endpoints.
|
|
6
6
|
*/
|
|
7
|
+
import type { FetchImpl } from "@oh-my-pi/pi-ai/types";
|
|
7
8
|
export interface OAuthEndpoints {
|
|
8
9
|
authorizationUrl: string;
|
|
9
10
|
tokenUrl: string;
|
|
@@ -38,4 +39,6 @@ export declare function analyzeAuthError(error: Error, serverUrl?: string): Auth
|
|
|
38
39
|
* Try to discover OAuth endpoints by querying the server's well-known endpoints.
|
|
39
40
|
* This is a fallback when error responses don't include OAuth metadata.
|
|
40
41
|
*/
|
|
41
|
-
export declare function discoverOAuthEndpoints(serverUrl: string, authServerUrl?: string, resourceMetadataUrl?: string
|
|
42
|
+
export declare function discoverOAuthEndpoints(serverUrl: string, authServerUrl?: string, resourceMetadataUrl?: string, opts?: {
|
|
43
|
+
fetch?: FetchImpl;
|
|
44
|
+
}): Promise<OAuthEndpoints | null>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { OAuthCallbackFlow } from "@oh-my-pi/pi-ai/oauth/callback-server";
|
|
8
8
|
import type { OAuthController, OAuthCredentials } from "@oh-my-pi/pi-ai/oauth/types";
|
|
9
|
+
import type { FetchImpl } from "@oh-my-pi/pi-ai/types";
|
|
9
10
|
export interface MCPOAuthConfig {
|
|
10
11
|
/** Authorization endpoint URL */
|
|
11
12
|
authorizationUrl: string;
|
|
@@ -23,6 +24,8 @@ export interface MCPOAuthConfig {
|
|
|
23
24
|
callbackPort?: number;
|
|
24
25
|
/** Custom callback path (default: /callback or redirectUri pathname) */
|
|
25
26
|
callbackPath?: string;
|
|
27
|
+
/** Fetch implementation for token exchange and discovery requests. */
|
|
28
|
+
fetch?: FetchImpl;
|
|
26
29
|
}
|
|
27
30
|
/**
|
|
28
31
|
* Generic OAuth flow for MCP servers.
|
|
@@ -56,4 +59,6 @@ export declare class MCPOAuthFlow extends OAuthCallbackFlow {
|
|
|
56
59
|
* Refresh an MCP OAuth token using the standard refresh_token grant.
|
|
57
60
|
* Returns updated credentials; preserves the old refresh token if the server doesn't rotate it.
|
|
58
61
|
*/
|
|
59
|
-
export declare function refreshMCPOAuthToken(tokenUrl: string, refreshToken: string, clientId?: string, clientSecret?: string
|
|
62
|
+
export declare function refreshMCPOAuthToken(tokenUrl: string, refreshToken: string, clientId?: string, clientSecret?: string, opts?: {
|
|
63
|
+
fetch?: FetchImpl;
|
|
64
|
+
}): Promise<OAuthCredentials>;
|
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
* Messages are newline-delimited JSON.
|
|
6
6
|
*/
|
|
7
7
|
import type { MCPRequestOptions, MCPStdioServerConfig, MCPTransport } from "../../mcp/types";
|
|
8
|
+
/** Subprocess argv for launching an MCP stdio server. */
|
|
9
|
+
export interface StdioSpawnCommand {
|
|
10
|
+
cmd: string[];
|
|
11
|
+
}
|
|
12
|
+
/** Inputs used to resolve platform-specific stdio spawn behavior. */
|
|
13
|
+
export interface ResolveStdioSpawnOptions {
|
|
14
|
+
cwd: string;
|
|
15
|
+
env: Record<string, string | undefined>;
|
|
16
|
+
platform?: NodeJS.Platform;
|
|
17
|
+
}
|
|
18
|
+
/** Resolve the subprocess argv used to launch an MCP stdio server. */
|
|
19
|
+
export declare function resolveStdioSpawnCommand(config: MCPStdioServerConfig, options: ResolveStdioSpawnOptions): Promise<StdioSpawnCommand>;
|
|
8
20
|
/** Minimal write surface of `Subprocess.stdin` we need for framed sends. */
|
|
9
21
|
interface FrameSink {
|
|
10
22
|
write(chunk: string): unknown;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Editor, type KeyId } from "@oh-my-pi/pi-tui";
|
|
2
2
|
import type { AppKeybinding } from "../../config/keybindings";
|
|
3
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">;
|
|
4
|
+
export declare function extractBracketedImagePastePaths(data: string): string[] | undefined;
|
|
4
5
|
export declare function extractBracketedImagePastePath(data: string): string | undefined;
|
|
5
6
|
/**
|
|
6
7
|
* Custom editor that handles configurable app-level shortcuts for coding-agent.
|
|
@@ -33,8 +34,8 @@ export declare class CustomEditor extends Editor {
|
|
|
33
34
|
onCopyPrompt?: () => void;
|
|
34
35
|
/** Called when the configured image-paste shortcut is pressed. */
|
|
35
36
|
onPasteImage?: () => Promise<boolean>;
|
|
36
|
-
/** Called when a bracketed paste contains
|
|
37
|
-
onPasteImagePath?: (path: string) => void
|
|
37
|
+
/** Called when a bracketed paste contains one or more image-file paths. */
|
|
38
|
+
onPasteImagePath?: (path: string) => void | Promise<void>;
|
|
38
39
|
/** Called when the configured raw text-paste shortcut is pressed. */
|
|
39
40
|
onPasteTextRaw?: () => void;
|
|
40
41
|
/** Called when the configured dequeue shortcut is pressed. */
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type PromptTemplate } from "./config/prompt-templates";
|
|
|
6
6
|
import { Settings, type SkillsSettings } from "./config/settings";
|
|
7
7
|
import "./discovery";
|
|
8
8
|
import { type CustomCommandsLoadResult } from "./extensibility/custom-commands";
|
|
9
|
+
import { type ToolPathWithSource } from "./extensibility/custom-tools";
|
|
9
10
|
import type { CustomTool } from "./extensibility/custom-tools/types";
|
|
10
11
|
import { type ExtensionFactory, type ExtensionUIContext, type LoadExtensionsResult, type ToolDefinition } from "./extensibility/extensions";
|
|
11
12
|
import { type Skill, type SkillWarning } from "./extensibility/skills";
|
|
@@ -62,10 +63,41 @@ export interface CreateAgentSessionOptions {
|
|
|
62
63
|
/** Disable extension discovery (explicit paths still load). */
|
|
63
64
|
disableExtensionDiscovery?: boolean;
|
|
64
65
|
/**
|
|
65
|
-
* Pre-loaded extensions (skips file discovery
|
|
66
|
-
*
|
|
66
|
+
* Pre-loaded extensions (skips file discovery and the per-session factory
|
|
67
|
+
* call). Used by the CLI when extensions are loaded early to parse custom
|
|
68
|
+
* flags — the same process owns the returned instances, so reusing them is
|
|
69
|
+
* safe.
|
|
70
|
+
*
|
|
71
|
+
* NEVER pass this across session boundaries (e.g. parent → subagent).
|
|
72
|
+
* `Extension` instances close over a parent-bound `ExtensionAPI` (cwd,
|
|
73
|
+
* eventBus, runtime), and reusing them would route tools/handlers/commands
|
|
74
|
+
* back through the parent. For subagents, forward
|
|
75
|
+
* {@link preloadedExtensionPaths} instead.
|
|
76
|
+
*
|
|
77
|
+
* @internal
|
|
67
78
|
*/
|
|
68
79
|
preloadedExtensions?: LoadExtensionsResult;
|
|
80
|
+
/**
|
|
81
|
+
* Pre-discovered extension source paths. When provided, the filesystem-scan
|
|
82
|
+
* inside `discoverExtensionPaths()` is skipped — the session still calls
|
|
83
|
+
* `loadExtensions()` itself so each `Extension` is bound to THIS session's
|
|
84
|
+
* `ExtensionAPI` (cwd, eventBus, runtime).
|
|
85
|
+
*
|
|
86
|
+
* This is the safe pass-through for parent → subagent forwarding.
|
|
87
|
+
*/
|
|
88
|
+
preloadedExtensionPaths?: string[];
|
|
89
|
+
/**
|
|
90
|
+
* Pre-discovered custom-tool source paths from `.omp/tools/`, `.claude/tools/`,
|
|
91
|
+
* plugins, etc. When provided, the filesystem-scan inside
|
|
92
|
+
* `discoverCustomToolPaths()` is skipped — subagents inherit the parent's
|
|
93
|
+
* scan result and call `loadCustomTools()` themselves so each session binds
|
|
94
|
+
* tools to its OWN `CustomToolAPI` (cwd, exec, pushPendingAction, UI).
|
|
95
|
+
*
|
|
96
|
+
* Forwarding the loaded `LoadedCustomTool[]` instances directly would reuse
|
|
97
|
+
* the parent's session-bound API and route tool execution back through the
|
|
98
|
+
* parent — wrong for isolated tasks and for pending-action routing.
|
|
99
|
+
*/
|
|
100
|
+
preloadedCustomToolPaths?: ToolPathWithSource[];
|
|
69
101
|
/** Shared event bus for tool/extension communication. Default: creates new bus. */
|
|
70
102
|
eventBus?: EventBus;
|
|
71
103
|
/** Skills. Default: discovered from multiple locations */
|
|
@@ -178,6 +210,14 @@ export declare function discoverAuthStorage(agentDir?: string): Promise<AuthStor
|
|
|
178
210
|
* Discover extensions from cwd.
|
|
179
211
|
*/
|
|
180
212
|
export declare function discoverExtensions(cwd?: string): Promise<LoadExtensionsResult>;
|
|
213
|
+
/**
|
|
214
|
+
* Path-only counterpart of {@link loadSessionExtensions}: the FS-heavy scan
|
|
215
|
+
* without the per-session module load. Subagents reuse the parent's path list
|
|
216
|
+
* (cached on {@link ToolSession.extensionPaths}) and rebuild Extension
|
|
217
|
+
* instances themselves so each session's `ExtensionAPI` (cwd, eventBus,
|
|
218
|
+
* runtime) is its own.
|
|
219
|
+
*/
|
|
220
|
+
export declare function discoverSessionExtensionPaths(options: Pick<CreateAgentSessionOptions, "disableExtensionDiscovery" | "additionalExtensionPaths">, cwd: string, settings: Settings): Promise<string[]>;
|
|
181
221
|
/**
|
|
182
222
|
* Load the discovered/configured extensions for a session — everything {@link
|
|
183
223
|
* createAgentSession} would load except the inline factory extensions it appends
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* Runs each subagent on the main thread and forwards AgentEvents for progress tracking.
|
|
5
5
|
*/
|
|
6
6
|
import type { AgentTelemetryConfig, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
7
|
+
import type { Rule } from "../capability/rule";
|
|
7
8
|
import { ModelRegistry } from "../config/model-registry";
|
|
8
9
|
import type { PromptTemplate } from "../config/prompt-templates";
|
|
9
10
|
import { Settings } from "../config/settings";
|
|
10
11
|
import { type SettingPath } from "../config/settings-schema";
|
|
12
|
+
import type { ToolPathWithSource } from "../extensibility/custom-tools";
|
|
11
13
|
import type { CustomTool } from "../extensibility/custom-tools/types";
|
|
12
14
|
import { type Skill } from "../extensibility/skills";
|
|
13
15
|
import type { HindsightSessionState } from "../hindsight/state";
|
|
@@ -70,6 +72,20 @@ export interface ExecutorOptions {
|
|
|
70
72
|
skills?: Skill[];
|
|
71
73
|
promptTemplates?: PromptTemplate[];
|
|
72
74
|
workspaceTree?: WorkspaceTree;
|
|
75
|
+
/** Parent-discovered rules, forwarded to skip rule discovery in the subagent. */
|
|
76
|
+
rules?: Rule[];
|
|
77
|
+
/**
|
|
78
|
+
* Parent's discovered extension source paths. Forwarded to skip the
|
|
79
|
+
* extension FS scan in the subagent; the subagent then re-binds each
|
|
80
|
+
* extension against its own `ExtensionAPI` (cwd, eventBus, runtime).
|
|
81
|
+
*/
|
|
82
|
+
preloadedExtensionPaths?: string[];
|
|
83
|
+
/**
|
|
84
|
+
* Parent's discovered custom-tool source paths. Forwarded to skip the
|
|
85
|
+
* `.omp/tools/` FS scan in the subagent; the subagent then re-binds each
|
|
86
|
+
* tool against its own `CustomToolAPI` (cwd, exec, pushPendingAction, UI).
|
|
87
|
+
*/
|
|
88
|
+
preloadedCustomToolPaths?: ToolPathWithSource[];
|
|
73
89
|
mcpManager?: MCPManager;
|
|
74
90
|
authStorage?: AuthStorage;
|
|
75
91
|
modelRegistry?: ModelRegistry;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { FetchImpl } from "@oh-my-pi/pi-ai";
|
|
2
3
|
import { type Component } from "@oh-my-pi/pi-tui";
|
|
3
4
|
import type { Settings } from "../config/settings";
|
|
4
5
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
@@ -34,7 +35,7 @@ export type FetchProvider = "native" | "trafilatura" | "lynx" | "parallel" | "ji
|
|
|
34
35
|
* which always works on already-loaded HTML. Only a real `userSignal`
|
|
35
36
|
* cancellation aborts the chain (#1449).
|
|
36
37
|
*/
|
|
37
|
-
export declare function renderHtmlToText(url: string, html: string, timeout: number, settings: Settings, userSignal: AbortSignal | undefined, storage: AgentStorage | null): Promise<{
|
|
38
|
+
export declare function renderHtmlToText(url: string, html: string, timeout: number, settings: Settings, userSignal: AbortSignal | undefined, storage: AgentStorage | null, fetchOverride?: FetchImpl): Promise<{
|
|
38
39
|
content: string;
|
|
39
40
|
ok: boolean;
|
|
40
41
|
method: string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { InMemorySnapshotStore } from "@oh-my-pi/hashline";
|
|
2
2
|
import type { AgentTelemetryConfig, AgentTool } from "@oh-my-pi/pi-agent-core";
|
|
3
|
-
import type { ToolChoice } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import type { FetchImpl, ToolChoice } from "@oh-my-pi/pi-ai";
|
|
4
4
|
import type { AsyncJobManager } from "../async/job-manager";
|
|
5
|
+
import type { Rule } from "../capability/rule";
|
|
5
6
|
import type { PromptTemplate } from "../config/prompt-templates";
|
|
6
7
|
import type { Settings } from "../config/settings";
|
|
8
|
+
import type { ToolPathWithSource } from "../extensibility/custom-tools";
|
|
7
9
|
import type { Skill } from "../extensibility/skills";
|
|
8
10
|
import type { GoalModeState, GoalRuntime } from "../goals";
|
|
9
11
|
import type { HindsightSessionState } from "../hindsight/state";
|
|
@@ -95,6 +97,8 @@ export interface ToolSession {
|
|
|
95
97
|
cwd: string;
|
|
96
98
|
/** Whether UI is available */
|
|
97
99
|
hasUI: boolean;
|
|
100
|
+
/** Optional fetch implementation injected into the URL read pipeline (tests, proxies). Defaults to global fetch. */
|
|
101
|
+
fetch?: FetchImpl;
|
|
98
102
|
/** Skip Python kernel availability check and warmup */
|
|
99
103
|
skipPythonPreflight?: boolean;
|
|
100
104
|
/** Pre-loaded context files (AGENTS.md, etc) */
|
|
@@ -105,6 +109,21 @@ export interface ToolSession {
|
|
|
105
109
|
skills?: Skill[];
|
|
106
110
|
/** Pre-loaded prompt templates */
|
|
107
111
|
promptTemplates?: PromptTemplate[];
|
|
112
|
+
/** Pre-loaded rules (forwarded to subagents to skip re-discovery). */
|
|
113
|
+
rules?: Rule[];
|
|
114
|
+
/**
|
|
115
|
+
* Pre-discovered extension source paths. Forwarded to subagents so they
|
|
116
|
+
* skip the FS scan but still re-bind extensions to their own session-scoped
|
|
117
|
+
* `ExtensionAPI` (cwd, eventBus, runtime). Inline extension factories
|
|
118
|
+
* (`<inline-N>`) are NOT included — those are session-local.
|
|
119
|
+
*/
|
|
120
|
+
extensionPaths?: string[];
|
|
121
|
+
/**
|
|
122
|
+
* Pre-discovered custom-tool source paths from `.omp/tools/`, `.claude/tools/`,
|
|
123
|
+
* plugins, etc. Forwarded to subagents so they skip the FS scan but still
|
|
124
|
+
* re-bind tools to their own session-scoped `CustomToolAPI`.
|
|
125
|
+
*/
|
|
126
|
+
customToolPaths?: ToolPathWithSource[];
|
|
108
127
|
/** Whether LSP integrations are enabled */
|
|
109
128
|
enableLsp?: boolean;
|
|
110
129
|
/** Whether an edit-capable tool is available in this session (controls hashline output) */
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { Database } from "bun:sqlite";
|
|
23
23
|
import type { AgentTool } from "@oh-my-pi/pi-agent-core";
|
|
24
|
+
import type { FetchImpl } from "@oh-my-pi/pi-ai";
|
|
24
25
|
import type { Settings } from "..";
|
|
25
26
|
import type { ToolSession } from "./index";
|
|
26
27
|
export declare function isAutoQaEnabled(settings?: Settings): boolean;
|
|
@@ -97,6 +98,10 @@ export interface FlushOptions {
|
|
|
97
98
|
* future debug recipes); never set from the tool's auto-flush path.
|
|
98
99
|
*/
|
|
99
100
|
bypassConsent?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Fetch implementation for the push POST. Defaults to global fetch.
|
|
103
|
+
*/
|
|
104
|
+
fetch?: FetchImpl;
|
|
100
105
|
/**
|
|
101
106
|
* Fires once at the start of the loop with the snapshot count of
|
|
102
107
|
* unpushed rows. Subsequent inserts won't be reflected (the count is
|
|
@@ -19,6 +19,14 @@ export declare function uriHyperlink(uri: string, displayText: string): string;
|
|
|
19
19
|
* `www.example.com` inputs are linked as `https://www.example.com`.
|
|
20
20
|
*/
|
|
21
21
|
export declare function urlHyperlink(url: string, displayText: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Wrap `displayText` in an OSC 8 hyperlink pointing at an HTTP(S) URL,
|
|
24
|
+
* bypassing terminal capability auto-detection. Used for auth prompts where
|
|
25
|
+
* an inert "click" label blocks login on terminals whose capabilities are
|
|
26
|
+
* not advertised. Still returns plain text when the user has explicitly
|
|
27
|
+
* opted out via `tui.hyperlinks=off`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function urlHyperlinkAlways(url: string, displayText: string): string;
|
|
22
30
|
/**
|
|
23
31
|
* Wrap `displayText` in an OSC 8 hyperlink pointing at a filesystem path.
|
|
24
32
|
*
|
package/dist/types/web/kagi.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* through the shared {@link AuthStorage} broker (Bearer token), and responses
|
|
7
7
|
* are categorized result buckets rather than the legacy flat object array.
|
|
8
8
|
*/
|
|
9
|
-
import type { AuthStorage } from "@oh-my-pi/pi-ai";
|
|
9
|
+
import type { AuthStorage, FetchImpl } from "@oh-my-pi/pi-ai";
|
|
10
10
|
/** V1 search request body. */
|
|
11
11
|
export interface KagiSearchRequest {
|
|
12
12
|
query: string;
|
|
@@ -82,6 +82,7 @@ export interface KagiSearchOptions {
|
|
|
82
82
|
recency?: "day" | "week" | "month" | "year";
|
|
83
83
|
sessionId?: string;
|
|
84
84
|
signal?: AbortSignal;
|
|
85
|
+
fetch?: FetchImpl;
|
|
85
86
|
}
|
|
86
87
|
export interface KagiSearchSource {
|
|
87
88
|
title: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type FetchImpl } from "@oh-my-pi/pi-ai";
|
|
1
2
|
import type { AgentStorage } from "../session/agent-storage";
|
|
2
3
|
export interface ParallelUsageItem {
|
|
3
4
|
name?: string;
|
|
@@ -40,6 +41,7 @@ export interface ParallelSearchOptions {
|
|
|
40
41
|
mode?: "fast" | "research";
|
|
41
42
|
maxCharsPerResult?: number;
|
|
42
43
|
signal?: AbortSignal;
|
|
44
|
+
fetch?: FetchImpl;
|
|
43
45
|
}
|
|
44
46
|
export interface ParallelExtractOptions {
|
|
45
47
|
objective?: string;
|
|
@@ -47,6 +49,7 @@ export interface ParallelExtractOptions {
|
|
|
47
49
|
excerpts?: boolean;
|
|
48
50
|
fullContent?: boolean;
|
|
49
51
|
signal?: AbortSignal;
|
|
52
|
+
fetch?: FetchImpl;
|
|
50
53
|
}
|
|
51
54
|
export declare class ParallelApiError extends Error {
|
|
52
55
|
readonly statusCode?: number;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Uses Claude's built-in web_search_20250305 tool to search the web.
|
|
5
5
|
* Returns synthesized answers with citations and source metadata.
|
|
6
6
|
*/
|
|
7
|
-
import { type AuthStorage } from "@oh-my-pi/pi-ai";
|
|
7
|
+
import { type AuthStorage, type FetchImpl } from "@oh-my-pi/pi-ai";
|
|
8
8
|
import type { SearchResponse } from "../../../web/search/types";
|
|
9
9
|
import type { SearchParams } from "./base";
|
|
10
10
|
import { SearchProvider } from "./base";
|
|
@@ -15,6 +15,7 @@ export interface AnthropicSearchParams {
|
|
|
15
15
|
max_tokens?: number;
|
|
16
16
|
temperature?: number;
|
|
17
17
|
signal?: AbortSignal;
|
|
18
|
+
fetch?: FetchImpl;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Executes a web search using Anthropic's Claude with built-in web search tool.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthStorage } from "@oh-my-pi/pi-ai";
|
|
1
|
+
import type { AuthStorage, FetchImpl } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import type { SearchProviderId, SearchResponse } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Shared web search parameters passed to providers.
|
|
@@ -29,6 +29,7 @@ export interface SearchParams {
|
|
|
29
29
|
recency?: "day" | "week" | "month" | "year";
|
|
30
30
|
systemPrompt: string;
|
|
31
31
|
signal?: AbortSignal;
|
|
32
|
+
fetch?: FetchImpl;
|
|
32
33
|
maxOutputTokens?: number;
|
|
33
34
|
numSearchResults?: number;
|
|
34
35
|
temperature?: number;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Calls Brave's web search REST API and maps results into the unified
|
|
5
5
|
* SearchResponse shape used by the web search tool.
|
|
6
6
|
*/
|
|
7
|
-
import { type AuthStorage } from "@oh-my-pi/pi-ai";
|
|
7
|
+
import { type AuthStorage, type FetchImpl } from "@oh-my-pi/pi-ai";
|
|
8
8
|
import type { SearchResponse } from "../../../web/search/types";
|
|
9
9
|
import type { SearchParams } from "./base";
|
|
10
10
|
import { SearchProvider } from "./base";
|
|
@@ -13,6 +13,7 @@ export interface BraveSearchParams {
|
|
|
13
13
|
num_results?: number;
|
|
14
14
|
recency?: "day" | "week" | "month" | "year";
|
|
15
15
|
signal?: AbortSignal;
|
|
16
|
+
fetch?: FetchImpl;
|
|
16
17
|
}
|
|
17
18
|
/** Find BRAVE_API_KEY from environment or .env files. */
|
|
18
19
|
export declare function findApiKey(): string | null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type AuthStorage } from "@oh-my-pi/pi-ai";
|
|
1
|
+
import { type AuthStorage, type FetchImpl } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import type { SearchResponse } from "../../../web/search/types";
|
|
3
3
|
import type { SearchParams } from "./base";
|
|
4
4
|
import { SearchProvider } from "./base";
|
|
5
5
|
export interface CodexSearchParams {
|
|
6
6
|
signal?: AbortSignal;
|
|
7
|
+
fetch?: FetchImpl;
|
|
7
8
|
query: string;
|
|
8
9
|
system_prompt?: string;
|
|
9
10
|
num_results?: number;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Requests per-result summaries via `contents.summary` and synthesizes
|
|
7
7
|
* them into a combined `answer` string on the SearchResponse.
|
|
8
8
|
*/
|
|
9
|
-
import { type AuthStorage } from "@oh-my-pi/pi-ai";
|
|
9
|
+
import { type AuthStorage, type FetchImpl } from "@oh-my-pi/pi-ai";
|
|
10
10
|
import type { SearchResponse } from "../../../web/search/types";
|
|
11
11
|
import type { SearchParams } from "./base";
|
|
12
12
|
import { SearchProvider } from "./base";
|
|
@@ -21,6 +21,7 @@ export interface ExaSearchParams {
|
|
|
21
21
|
start_published_date?: string;
|
|
22
22
|
end_published_date?: string;
|
|
23
23
|
signal?: AbortSignal;
|
|
24
|
+
fetch?: FetchImpl;
|
|
24
25
|
/**
|
|
25
26
|
* Credential source. Resolved before falling back to `EXA_API_KEY` so
|
|
26
27
|
* Exa works when the key is stored via the broker/auth pipeline.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* sibling SQLite store and never POSTs the broker sentinel to a Google token
|
|
9
9
|
* endpoint.
|
|
10
10
|
*/
|
|
11
|
-
import { type AuthStorage } from "@oh-my-pi/pi-ai";
|
|
11
|
+
import { type AuthStorage, type FetchImpl } from "@oh-my-pi/pi-ai";
|
|
12
12
|
import type { SearchResponse } from "../../../web/search/types";
|
|
13
13
|
import type { SearchParams } from "./base";
|
|
14
14
|
import { SearchProvider } from "./base";
|
|
@@ -28,6 +28,7 @@ export interface GeminiSearchParams extends GeminiToolParams {
|
|
|
28
28
|
signal?: AbortSignal;
|
|
29
29
|
authStorage: AuthStorage;
|
|
30
30
|
sessionId?: string;
|
|
31
|
+
fetch?: FetchImpl;
|
|
31
32
|
}
|
|
32
33
|
export declare function buildGeminiRequestTools(params: GeminiToolParams): Array<Record<string, Record<string, unknown>>>;
|
|
33
34
|
/** Resolved auth for a Gemini API request. */
|