@oh-my-pi/pi-coding-agent 15.10.6 → 15.10.8
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 +21 -1
- 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/types.d.ts +3 -1
- package/dist/types/mcp/oauth-discovery.d.ts +4 -1
- package/dist/types/mcp/oauth-flow.d.ts +6 -1
- package/dist/types/tools/fetch.d.ts +2 -1
- package/dist/types/tools/index.d.ts +3 -1
- package/dist/types/tools/report-tool-issue.d.ts +5 -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/types.ts +3 -1
- package/src/internal-urls/docs-index.generated.ts +1 -1
- package/src/mcp/manager.ts +17 -16
- package/src/mcp/oauth-discovery.ts +8 -3
- package/src/mcp/oauth-flow.ts +12 -5
- package/src/modes/components/assistant-message.ts +28 -6
- package/src/prompts/tools/read.md +0 -1
- package/src/tools/fetch.ts +22 -5
- package/src/tools/image-gen.ts +33 -11
- package/src/tools/index.ts +4 -2
- package/src/tools/report-tool-issue.ts +7 -1
- 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,26 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [15.10.8] - 2026-06-09
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added an optional `fetch` option to `CustomToolContext` so custom tools can use a caller-provided HTTP implementation
|
|
10
|
+
- 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`
|
|
11
|
+
- Added a `bash.enabled` setting to disable the model-facing bash tool while leaving user-initiated bang/RPC bash commands available.
|
|
12
|
+
- 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.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- 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.
|
|
17
|
+
|
|
18
|
+
## [15.10.7] - 2026-06-08
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Fixed MCP OAuth fallback rendering to show a short terminal hyperlink and keep the raw authorization URL on one unwrapped copy line ([#2121](https://github.com/can1357/oh-my-pi/issues/2121)).
|
|
23
|
+
- Fixed `omp` startup blocking 25–30 s on a single unresponsive MCP server when no cached tools were available for it. `MCPManager.connectServers` used to fall through to an unbounded `Promise.allSettled` over every still-pending server without a cached tool list, so one server stuck waiting on the per-request MCP timeout (`OMP_MCP_TIMEOUT_MS`, default 30 000 ms) gated the entire UI ready signal. Pending-without-cache servers are now left in flight: their tools surface via the existing background `#onToolsChanged` → `refreshMCPTools` path the moment the connect completes, and failures continue to log through the background catch handler ([#2100](https://github.com/can1357/oh-my-pi/issues/2100)).
|
|
24
|
+
|
|
5
25
|
## [15.10.6] - 2026-06-08
|
|
6
26
|
|
|
7
27
|
### Added
|
|
@@ -9776,4 +9796,4 @@ Initial public release.
|
|
|
9776
9796
|
- Git branch display in footer
|
|
9777
9797
|
- Message queueing during streaming responses
|
|
9778
9798
|
- OAuth integration for Gmail and Google Calendar access
|
|
9779
|
-
- HTML export with syntax highlighting and collapsible sections
|
|
9799
|
+
- HTML export with syntax highlighting and collapsible sections
|
|
@@ -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;
|
|
@@ -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
|
}
|
|
@@ -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>;
|
|
@@ -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,6 +1,6 @@
|
|
|
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
5
|
import type { PromptTemplate } from "../config/prompt-templates";
|
|
6
6
|
import type { Settings } from "../config/settings";
|
|
@@ -95,6 +95,8 @@ export interface ToolSession {
|
|
|
95
95
|
cwd: string;
|
|
96
96
|
/** Whether UI is available */
|
|
97
97
|
hasUI: boolean;
|
|
98
|
+
/** Optional fetch implementation injected into the URL read pipeline (tests, proxies). Defaults to global fetch. */
|
|
99
|
+
fetch?: FetchImpl;
|
|
98
100
|
/** Skip Python kernel availability check and warmup */
|
|
99
101
|
skipPythonPreflight?: boolean;
|
|
100
102
|
/** Pre-loaded context files (AGENTS.md, etc) */
|
|
@@ -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
|
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. */
|
|
@@ -4,14 +4,18 @@
|
|
|
4
4
|
* Uses the Jina Reader `s.jina.ai` endpoint to fetch search results with
|
|
5
5
|
* cleaned content.
|
|
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";
|
|
11
|
+
type SearchParamsWithFetch = SearchParams & {
|
|
12
|
+
fetch?: FetchImpl;
|
|
13
|
+
};
|
|
11
14
|
export interface JinaSearchParams {
|
|
12
15
|
query: string;
|
|
13
16
|
num_results?: number;
|
|
14
17
|
signal?: AbortSignal;
|
|
18
|
+
fetch?: FetchImpl;
|
|
15
19
|
}
|
|
16
20
|
/** Find JINA_API_KEY from environment or .env files. */
|
|
17
21
|
export declare function findApiKey(): string | null;
|
|
@@ -22,5 +26,6 @@ export declare class JinaProvider extends SearchProvider {
|
|
|
22
26
|
readonly id = "jina";
|
|
23
27
|
readonly label = "Jina";
|
|
24
28
|
isAvailable(_authStorage: AuthStorage): boolean;
|
|
25
|
-
search(params:
|
|
29
|
+
search(params: SearchParamsWithFetch): Promise<SearchResponse>;
|
|
26
30
|
}
|
|
31
|
+
export {};
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Thin wrapper that adapts shared Kagi API utilities to SearchResponse shape.
|
|
5
5
|
*/
|
|
6
|
-
import type { AuthStorage } from "@oh-my-pi/pi-ai";
|
|
6
|
+
import type { AuthStorage, FetchImpl } from "@oh-my-pi/pi-ai";
|
|
7
7
|
import type { SearchResponse } from "../../../web/search/types";
|
|
8
8
|
import type { SearchParams } from "./base";
|
|
9
9
|
import { SearchProvider } from "./base";
|
|
10
|
+
type SearchParamsWithFetch = SearchParams & {
|
|
11
|
+
fetch?: FetchImpl;
|
|
12
|
+
};
|
|
10
13
|
/** Execute Kagi web search. */
|
|
11
14
|
export declare function searchKagi(params: {
|
|
12
15
|
query: string;
|
|
@@ -15,11 +18,13 @@ export declare function searchKagi(params: {
|
|
|
15
18
|
signal?: AbortSignal;
|
|
16
19
|
authStorage: AuthStorage;
|
|
17
20
|
sessionId?: string;
|
|
21
|
+
fetch?: FetchImpl;
|
|
18
22
|
}): Promise<SearchResponse>;
|
|
19
23
|
/** Search provider for Kagi web search. */
|
|
20
24
|
export declare class KagiProvider extends SearchProvider {
|
|
21
25
|
readonly id = "kagi";
|
|
22
26
|
readonly label = "Kagi";
|
|
23
27
|
isAvailable(authStorage: AuthStorage): boolean;
|
|
24
|
-
search(params:
|
|
28
|
+
search(params: SearchParamsWithFetch): Promise<SearchResponse>;
|
|
25
29
|
}
|
|
30
|
+
export {};
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
* Uses Moonshot Kimi Code search API to retrieve web results.
|
|
5
5
|
* Endpoint: POST https://api.kimi.com/coding/v1/search
|
|
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";
|
|
11
|
+
type SearchParamsWithFetch = SearchParams & {
|
|
12
|
+
fetch?: FetchImpl;
|
|
13
|
+
};
|
|
11
14
|
export interface KimiSearchParams {
|
|
12
15
|
query: string;
|
|
13
16
|
num_results?: number;
|
|
@@ -15,6 +18,7 @@ export interface KimiSearchParams {
|
|
|
15
18
|
signal?: AbortSignal;
|
|
16
19
|
authStorage: AuthStorage;
|
|
17
20
|
sessionId?: string;
|
|
21
|
+
fetch?: FetchImpl;
|
|
18
22
|
}
|
|
19
23
|
/** Execute Kimi web search. */
|
|
20
24
|
export declare function searchKimi(params: KimiSearchParams): Promise<SearchResponse>;
|
|
@@ -23,5 +27,6 @@ export declare class KimiProvider extends SearchProvider {
|
|
|
23
27
|
readonly id = "kimi";
|
|
24
28
|
readonly label = "Kimi";
|
|
25
29
|
isAvailable(authStorage: AuthStorage): boolean;
|
|
26
|
-
search(params:
|
|
30
|
+
search(params: SearchParamsWithFetch): Promise<SearchResponse>;
|
|
27
31
|
}
|
|
32
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
@@ -6,6 +6,7 @@ export declare function searchParallel(params: {
|
|
|
6
6
|
query: string;
|
|
7
7
|
num_results?: number;
|
|
8
8
|
signal?: AbortSignal;
|
|
9
|
+
fetch?: FetchImpl;
|
|
9
10
|
}, authStorage: AuthStorage, sessionId?: string): Promise<SearchResponse>;
|
|
10
11
|
export declare class ParallelProvider extends SearchProvider {
|
|
11
12
|
readonly id = "parallel";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - API key (`PERPLEXITY_API_KEY`) via `api.perplexity.ai/chat/completions`
|
|
8
8
|
* - Anonymous via `www.perplexity.ai/rest/sse/perplexity_ask`
|
|
9
9
|
*/
|
|
10
|
-
import { type AuthStorage } from "@oh-my-pi/pi-ai";
|
|
10
|
+
import { type AuthStorage, type FetchImpl } from "@oh-my-pi/pi-ai";
|
|
11
11
|
import type { SearchResponse } from "../../../web/search/types";
|
|
12
12
|
import type { SearchParams } from "./base";
|
|
13
13
|
import { SearchProvider } from "./base";
|
|
@@ -25,6 +25,7 @@ export interface PerplexitySearchParams {
|
|
|
25
25
|
num_search_results?: number;
|
|
26
26
|
authStorage: AuthStorage;
|
|
27
27
|
sessionId?: string;
|
|
28
|
+
fetch?: FetchImpl;
|
|
28
29
|
}
|
|
29
30
|
/** Find PERPLEXITY_API_KEY from environment or .env files (also checks PPLX_API_KEY) */
|
|
30
31
|
export declare function findApiKey(): string | null;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*
|
|
25
25
|
* Reference: https://docs.searxng.org/dev/search_api.html
|
|
26
26
|
*/
|
|
27
|
-
import type { AuthStorage } from "@oh-my-pi/pi-ai";
|
|
27
|
+
import type { AuthStorage, FetchImpl } from "@oh-my-pi/pi-ai";
|
|
28
28
|
import type { SearchResponse } from "../../../web/search/types";
|
|
29
29
|
import type { SearchParams } from "./base";
|
|
30
30
|
import { SearchProvider } from "./base";
|
|
@@ -34,6 +34,7 @@ export declare function searchSearXNG(params: {
|
|
|
34
34
|
num_results?: number;
|
|
35
35
|
recency?: "day" | "week" | "month" | "year";
|
|
36
36
|
signal?: AbortSignal;
|
|
37
|
+
fetch?: FetchImpl;
|
|
37
38
|
}): Promise<SearchResponse>;
|
|
38
39
|
/** Search provider for SearXNG web search. */
|
|
39
40
|
export declare class SearXNGProvider extends SearchProvider {
|
|
@@ -4,18 +4,22 @@
|
|
|
4
4
|
* Uses Synthetic's zero-data-retention web search API for coding agents.
|
|
5
5
|
* Endpoint: POST https://api.synthetic.new/v2/search
|
|
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";
|
|
11
|
+
type SearchParamsWithFetch = SearchParams & {
|
|
12
|
+
fetch?: FetchImpl;
|
|
13
|
+
};
|
|
11
14
|
/** Resolve Synthetic API key through the shared auth storage pipeline. */
|
|
12
15
|
export declare function findApiKey(authStorage: AuthStorage, sessionId?: string, signal?: AbortSignal): Promise<string | undefined>;
|
|
13
16
|
/** Execute Synthetic web search. */
|
|
14
|
-
export declare function searchSynthetic(params:
|
|
17
|
+
export declare function searchSynthetic(params: SearchParamsWithFetch): Promise<SearchResponse>;
|
|
15
18
|
/** Search provider for Synthetic. */
|
|
16
19
|
export declare class SyntheticProvider extends SearchProvider {
|
|
17
20
|
readonly id = "synthetic";
|
|
18
21
|
readonly label = "Synthetic";
|
|
19
22
|
isAvailable(authStorage: AuthStorage): boolean;
|
|
20
|
-
search(params:
|
|
23
|
+
search(params: SearchParamsWithFetch): Promise<SearchResponse>;
|
|
21
24
|
}
|
|
25
|
+
export {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Uses Tavily's agent-focused search API to return structured results with an
|
|
5
5
|
* optional synthesized answer.
|
|
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 TavilySearchParams {
|
|
|
13
13
|
num_results?: number;
|
|
14
14
|
recency?: "day" | "week" | "month" | "year";
|
|
15
15
|
signal?: AbortSignal;
|
|
16
|
+
fetch?: FetchImpl;
|
|
16
17
|
}
|
|
17
18
|
/** Find Tavily API key through AuthStorage's unified refresh pipeline. */
|
|
18
19
|
export declare function findApiKey(authStorage: AuthStorage, sessionId: string | undefined, signal: AbortSignal | undefined): Promise<string | null>;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Calls Z.AI's remote MCP server (`webSearchPrime`) and adapts results into
|
|
5
5
|
* the unified 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";
|
|
@@ -12,6 +12,7 @@ export interface ZaiSearchParams {
|
|
|
12
12
|
query: string;
|
|
13
13
|
num_results?: number;
|
|
14
14
|
signal?: AbortSignal;
|
|
15
|
+
fetch?: FetchImpl;
|
|
15
16
|
authStorage: AuthStorage;
|
|
16
17
|
sessionId?: string;
|
|
17
18
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
4
|
-
"version": "15.10.
|
|
4
|
+
"version": "15.10.8",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"@agentclientprotocol/sdk": "0.22.1",
|
|
48
48
|
"@babel/parser": "^7.29.7",
|
|
49
49
|
"@mozilla/readability": "^0.6.0",
|
|
50
|
-
"@oh-my-pi/hashline": "15.10.
|
|
51
|
-
"@oh-my-pi/omp-stats": "15.10.
|
|
52
|
-
"@oh-my-pi/pi-agent-core": "15.10.
|
|
53
|
-
"@oh-my-pi/pi-ai": "15.10.
|
|
54
|
-
"@oh-my-pi/pi-mnemopi": "15.10.
|
|
55
|
-
"@oh-my-pi/pi-natives": "15.10.
|
|
56
|
-
"@oh-my-pi/pi-tui": "15.10.
|
|
57
|
-
"@oh-my-pi/pi-utils": "15.10.
|
|
50
|
+
"@oh-my-pi/hashline": "15.10.8",
|
|
51
|
+
"@oh-my-pi/omp-stats": "15.10.8",
|
|
52
|
+
"@oh-my-pi/pi-agent-core": "15.10.8",
|
|
53
|
+
"@oh-my-pi/pi-ai": "15.10.8",
|
|
54
|
+
"@oh-my-pi/pi-mnemopi": "15.10.8",
|
|
55
|
+
"@oh-my-pi/pi-natives": "15.10.8",
|
|
56
|
+
"@oh-my-pi/pi-tui": "15.10.8",
|
|
57
|
+
"@oh-my-pi/pi-utils": "15.10.8",
|
|
58
58
|
"@opentelemetry/api": "^1.9.1",
|
|
59
59
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
60
60
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
|