webfox 0.0.0-test.0 → 4.0.1
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/LICENSE +21 -0
- package/README.md +256 -3
- package/assets/webfox-lockup-dark.png +0 -0
- package/assets/webfox-lockup.png +0 -0
- package/dist/adapter-2YBFCBCZ.js +161 -0
- package/dist/adapter-67TIISDW.js +753 -0
- package/dist/adapter-AB7LKV7N.js +324 -0
- package/dist/adapter-AUYLTDPM.js +73 -0
- package/dist/adapter-HITGYUXN.js +494 -0
- package/dist/adapter-HPTMLH75.js +334 -0
- package/dist/adapter-I6OUKBZQ.js +492 -0
- package/dist/adapter-ISZQTZDP.js +166 -0
- package/dist/adapter-MAG7X663.js +230 -0
- package/dist/adapter-NEXSOHGT.js +232 -0
- package/dist/adapter-PADXKW43.js +162 -0
- package/dist/adapter-SDQX2533.js +123 -0
- package/dist/adapter-UAZNLDSS.js +237 -0
- package/dist/adapter-XBAQSK7I.js +282 -0
- package/dist/application-types.d.ts +34 -0
- package/dist/application.d.ts +2 -0
- package/dist/chunk-EF4VMDZL.js +85 -0
- package/dist/chunk-G2YAQEET.js +38 -0
- package/dist/chunk-GAWPRXAU.js +3051 -0
- package/dist/chunk-I2UIACY3.js +12 -0
- package/dist/chunk-MVCCEPDF.js +762 -0
- package/dist/chunk-QRHDXM2L.js +31 -0
- package/dist/chunk-U4BLULLV.js +52 -0
- package/dist/chunk-WCTOYZVB.js +85 -0
- package/dist/chunk-X6ZBIHZC.js +21 -0
- package/dist/chunk-YZXM4U2C.js +21 -0
- package/dist/chunk-ZVTVERW5.js +20 -0
- package/dist/cli.js +641 -0
- package/dist/config.schema.json +4270 -0
- package/dist/configuration/defaults.d.ts +3 -0
- package/dist/configuration/file.d.ts +17 -0
- package/dist/configuration/options-schema.d.ts +2 -0
- package/dist/configuration/planning.d.ts +10 -0
- package/dist/configuration/schema.d.ts +9 -0
- package/dist/configuration/types.d.ts +37 -0
- package/dist/contents.d.ts +19 -0
- package/dist/domain.d.ts +89 -0
- package/dist/errors.d.ts +17 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +38 -0
- package/dist/package-metadata.d.ts +3 -0
- package/dist/pi-keybindings.d.ts +1 -0
- package/dist/pi-params.d.ts +3 -0
- package/dist/pi-render.d.ts +50 -0
- package/dist/pi-search-render.d.ts +4 -0
- package/dist/pi-text.d.ts +4 -0
- package/dist/pi-validation.d.ts +4 -0
- package/dist/pi.d.ts +2 -0
- package/dist/pi.js +563 -0
- package/dist/providers/brave/adapter.d.ts +7 -0
- package/dist/providers/brave/definition.d.ts +1 -0
- package/dist/providers/brave/types.d.ts +4 -0
- package/dist/providers/cli-json.d.ts +9 -0
- package/dist/providers/cloudflare/adapter.d.ts +5 -0
- package/dist/providers/cloudflare/definition.d.ts +1 -0
- package/dist/providers/cloudflare/types.d.ts +4 -0
- package/dist/providers/contract.d.ts +88 -0
- package/dist/providers/custom/adapter.d.ts +9 -0
- package/dist/providers/custom/definition.d.ts +1 -0
- package/dist/providers/custom/types.d.ts +9 -0
- package/dist/providers/definition.d.ts +32 -0
- package/dist/providers/exa/adapter.d.ts +8 -0
- package/dist/providers/exa/definition.d.ts +1 -0
- package/dist/providers/exa/types.d.ts +4 -0
- package/dist/providers/firecrawl/adapter.d.ts +7 -0
- package/dist/providers/firecrawl/definition.d.ts +1 -0
- package/dist/providers/firecrawl/types.d.ts +4 -0
- package/dist/providers/gemini/adapter.d.ts +14 -0
- package/dist/providers/gemini/definition.d.ts +1 -0
- package/dist/providers/gemini/types.d.ts +3 -0
- package/dist/providers/linkup/adapter.d.ts +7 -0
- package/dist/providers/linkup/definition.d.ts +1 -0
- package/dist/providers/linkup/types.d.ts +4 -0
- package/dist/providers/metadata.d.ts +15 -0
- package/dist/providers/ollama/adapter.d.ts +6 -0
- package/dist/providers/ollama/definition.d.ts +1 -0
- package/dist/providers/ollama/types.d.ts +4 -0
- package/dist/providers/openai/adapter.d.ts +7 -0
- package/dist/providers/openai/definition.d.ts +1 -0
- package/dist/providers/openai/types.d.ts +28 -0
- package/dist/providers/parallel/adapter.d.ts +6 -0
- package/dist/providers/parallel/definition.d.ts +1 -0
- package/dist/providers/parallel/types.d.ts +4 -0
- package/dist/providers/perplexity/adapter.d.ts +7 -0
- package/dist/providers/perplexity/definition.d.ts +1 -0
- package/dist/providers/perplexity/types.d.ts +4 -0
- package/dist/providers/registry.d.ts +16 -0
- package/dist/providers/serper/adapter.d.ts +5 -0
- package/dist/providers/serper/definition.d.ts +1 -0
- package/dist/providers/serper/types.d.ts +21 -0
- package/dist/providers/shared.d.ts +4 -0
- package/dist/providers/tavily/adapter.d.ts +6 -0
- package/dist/providers/tavily/definition.d.ts +1 -0
- package/dist/providers/tavily/types.d.ts +4 -0
- package/dist/providers/valyu/adapter.d.ts +8 -0
- package/dist/providers/valyu/definition.d.ts +1 -0
- package/dist/providers/valyu/types.d.ts +4 -0
- package/dist/render.d.ts +5 -0
- package/dist/runtime/credentials.d.ts +15 -0
- package/dist/runtime/duration.d.ts +2 -0
- package/dist/runtime/execute.d.ts +20 -0
- package/dist/runtime/lifecycle.d.ts +8 -0
- package/dist/runtime/outward.d.ts +11 -0
- package/dist/runtime/polling.d.ts +13 -0
- package/dist/runtime/process.d.ts +4 -0
- package/docs/cli-experience.md +177 -0
- package/docs/provider.md +177 -0
- package/docs/reference.md +181 -0
- package/example-config.yaml +36 -0
- package/examples/custom/README.md +57 -0
- package/examples/custom/provider.mjs +54 -0
- package/examples/custom/webfox.json +18 -0
- package/package.json +122 -8
- package/index.js +0 -2
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Capability as Tool, ProviderId, SearchResult } from "../domain.js";
|
|
2
|
+
import type { IndexedContentsResponse } from "../contents.js";
|
|
3
|
+
export interface SearchResponse {
|
|
4
|
+
provider: ProviderId;
|
|
5
|
+
results: SearchResult[];
|
|
6
|
+
}
|
|
7
|
+
export interface ToolOutput {
|
|
8
|
+
provider: ProviderId;
|
|
9
|
+
text: string;
|
|
10
|
+
itemCount?: number;
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface ResearchJob {
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ResearchPollResult {
|
|
17
|
+
status: "in_progress" | "completed" | "failed" | "cancelled";
|
|
18
|
+
statusText?: string;
|
|
19
|
+
output?: ToolOutput;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ProviderContext {
|
|
23
|
+
cwd: string;
|
|
24
|
+
env?: Record<string, string | undefined>;
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
onProgress?: (message: string) => void;
|
|
27
|
+
idempotencyKey?: string;
|
|
28
|
+
retryPolicy?: {
|
|
29
|
+
retries: number;
|
|
30
|
+
delayMs: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface SearchRequest {
|
|
34
|
+
capability: "search";
|
|
35
|
+
query: string;
|
|
36
|
+
maxResults: number;
|
|
37
|
+
options?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
export interface ContentsRequest {
|
|
40
|
+
capability: "contents";
|
|
41
|
+
urls: string[];
|
|
42
|
+
options?: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
export interface AnswerRequest {
|
|
45
|
+
capability: "answer";
|
|
46
|
+
query: string;
|
|
47
|
+
options?: Record<string, unknown>;
|
|
48
|
+
}
|
|
49
|
+
export interface ResearchRequest {
|
|
50
|
+
capability: "research";
|
|
51
|
+
input: string;
|
|
52
|
+
options?: Record<string, unknown>;
|
|
53
|
+
}
|
|
54
|
+
export interface ProviderRequestMap {
|
|
55
|
+
search: SearchRequest;
|
|
56
|
+
contents: ContentsRequest;
|
|
57
|
+
answer: AnswerRequest;
|
|
58
|
+
research: ResearchRequest;
|
|
59
|
+
}
|
|
60
|
+
export type ProviderRequest<TTool extends Tool = Tool> = ProviderRequestMap[TTool];
|
|
61
|
+
export interface ProviderResultMap {
|
|
62
|
+
search: SearchResponse;
|
|
63
|
+
contents: IndexedContentsResponse;
|
|
64
|
+
answer: ToolOutput;
|
|
65
|
+
research: ToolOutput;
|
|
66
|
+
}
|
|
67
|
+
export type ProviderResult<TTool extends Tool = Tool> = ProviderResultMap[TTool];
|
|
68
|
+
export interface Provider {
|
|
69
|
+
credentials?: Record<string, string>;
|
|
70
|
+
}
|
|
71
|
+
export type { Capability as Tool, ProviderId, SearchResult, } from "../domain.js";
|
|
72
|
+
export interface ProviderConfigMap {
|
|
73
|
+
brave: import("./brave/types.js").Brave;
|
|
74
|
+
cloudflare: import("./cloudflare/types.js").Cloudflare;
|
|
75
|
+
custom: import("./custom/types.js").Custom;
|
|
76
|
+
exa: import("./exa/types.js").Exa;
|
|
77
|
+
firecrawl: import("./firecrawl/types.js").Firecrawl;
|
|
78
|
+
gemini: import("./gemini/types.js").Gemini;
|
|
79
|
+
linkup: import("./linkup/types.js").Linkup;
|
|
80
|
+
ollama: import("./ollama/types.js").Ollama;
|
|
81
|
+
openai: import("./openai/types.js").OpenAI;
|
|
82
|
+
parallel: import("./parallel/types.js").Parallel;
|
|
83
|
+
perplexity: import("./perplexity/types.js").Perplexity;
|
|
84
|
+
serper: import("./serper/types.js").Serper;
|
|
85
|
+
tavily: import("./tavily/types.js").Tavily;
|
|
86
|
+
valyu: import("./valyu/types.js").Valyu;
|
|
87
|
+
}
|
|
88
|
+
export type ProviderConfig<T extends ProviderId = ProviderId> = ProviderConfigMap[T];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IndexedContentsResponse } from "../../contents.js";
|
|
2
|
+
import type { Custom } from "./types.js";
|
|
3
|
+
import type { ProviderContext, ProviderRequest, SearchResponse, ToolOutput } from "../contract.js";
|
|
4
|
+
export declare const adapter: {
|
|
5
|
+
search(request: ProviderRequest<"search">, config: Custom, context: ProviderContext): Promise<SearchResponse>;
|
|
6
|
+
contents(request: ProviderRequest<"contents">, config: Custom, context: ProviderContext): Promise<IndexedContentsResponse>;
|
|
7
|
+
answer(request: ProviderRequest<"answer">, config: Custom, context: ProviderContext): Promise<ToolOutput>;
|
|
8
|
+
research(request: ProviderRequest<"research">, config: Custom, context: ProviderContext): Promise<ToolOutput>;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const customProvider: import("../definition.js").ProviderDefinitionFor<"custom">;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Capability, ProviderId } from "../domain.js";
|
|
2
|
+
import type { CredentialSource, ProviderConfiguration } from "../configuration/types.js";
|
|
3
|
+
import type { ProviderConfigMap, ProviderContext, ProviderRequest, ProviderResult } from "./contract.js";
|
|
4
|
+
import type { ProviderCredentialMetadata } from "./metadata.js";
|
|
5
|
+
export interface CapabilityDefinition {
|
|
6
|
+
options?: Record<string, unknown>;
|
|
7
|
+
limits?: {
|
|
8
|
+
maxResults?: number;
|
|
9
|
+
};
|
|
10
|
+
promptGuidelines?: readonly string[];
|
|
11
|
+
/** Whether the entire operation may be repeated after a transient failure. */
|
|
12
|
+
retrySafe: boolean;
|
|
13
|
+
}
|
|
14
|
+
export type ProviderAdapter<I extends ProviderId> = {
|
|
15
|
+
[C in Capability]?: (request: ProviderRequest<C>, config: ProviderConfigMap[I], context: ProviderContext) => Promise<ProviderResult<C>>;
|
|
16
|
+
};
|
|
17
|
+
export interface ProviderDefinitionFor<I extends ProviderId> {
|
|
18
|
+
id: I;
|
|
19
|
+
label: string;
|
|
20
|
+
docsUrl: string;
|
|
21
|
+
local: boolean;
|
|
22
|
+
credentials: readonly ProviderCredentialMetadata[];
|
|
23
|
+
fields: readonly (keyof ProviderConfiguration)[];
|
|
24
|
+
credentialDefaults: Record<string, CredentialSource>;
|
|
25
|
+
defaults: Partial<Record<Capability, Record<string, unknown>>>;
|
|
26
|
+
capabilities: Partial<Record<Capability, CapabilityDefinition>>;
|
|
27
|
+
load(): Promise<ProviderAdapter<I>>;
|
|
28
|
+
}
|
|
29
|
+
export type ProviderDefinition = {
|
|
30
|
+
[I in ProviderId]: ProviderDefinitionFor<I>;
|
|
31
|
+
}[ProviderId];
|
|
32
|
+
export declare function defineProvider<I extends ProviderId>(definition: ProviderDefinitionFor<I>): ProviderDefinitionFor<I>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProviderContext, SearchResponse, ToolOutput } from "../contract.js";
|
|
2
|
+
import type { Exa } from "./types.js";
|
|
3
|
+
export declare const adapter: {
|
|
4
|
+
search(input: import("../contract.js").ProviderRequest<"search">, config: Exa, context: ProviderContext): Promise<SearchResponse>;
|
|
5
|
+
contents(input: import("../contract.js").ProviderRequest<"contents">, config: Exa, context: ProviderContext): Promise<import("../../contents.js").IndexedContentsResponse>;
|
|
6
|
+
answer(input: import("../contract.js").ProviderRequest<"answer">, config: Exa, context: ProviderContext): Promise<ToolOutput>;
|
|
7
|
+
research(input: import("../contract.js").ProviderRequest<"research">, config: Exa, context: ProviderContext): Promise<ToolOutput>;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const exaProvider: import("../definition.js").ProviderDefinitionFor<"exa">;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProviderContext, SearchResponse, ToolOutput } from "../contract.js";
|
|
2
|
+
import type { Firecrawl } from "./types.js";
|
|
3
|
+
export declare const adapter: {
|
|
4
|
+
search(input: import("../contract.js").ProviderRequest<"search">, config: Firecrawl, context: ProviderContext): Promise<SearchResponse>;
|
|
5
|
+
contents(input: import("../contract.js").ProviderRequest<"contents">, config: Firecrawl, context: ProviderContext): Promise<import("../../contents.js").IndexedContentsResponse>;
|
|
6
|
+
answer(input: import("../contract.js").ProviderRequest<"answer">, config: Firecrawl, context: ProviderContext): Promise<ToolOutput>;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const firecrawlProvider: import("../definition.js").ProviderDefinitionFor<"firecrawl">;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GoogleGenAI } from "@google/genai";
|
|
2
|
+
import type { ProviderContext, ResearchJob, ResearchPollResult, ToolOutput } from "../contract.js";
|
|
3
|
+
import type { Gemini } from "./types.js";
|
|
4
|
+
export declare const geminiImplementation: {
|
|
5
|
+
answer(query: string, config: Gemini, context: ProviderContext, options?: Record<string, unknown>): Promise<ToolOutput>;
|
|
6
|
+
research(input: string, config: Gemini, context: ProviderContext, options?: Record<string, unknown>): Promise<ToolOutput>;
|
|
7
|
+
startResearch(input: string, config: Gemini, context: ProviderContext, options?: Record<string, unknown>): Promise<ResearchJob>;
|
|
8
|
+
pollResearch(id: string, config: Gemini, context: ProviderContext, _options?: Record<string, unknown>): Promise<ResearchPollResult>;
|
|
9
|
+
createClient(config: Gemini): GoogleGenAI;
|
|
10
|
+
};
|
|
11
|
+
export declare const adapter: {
|
|
12
|
+
answer(input: import("../contract.js").ProviderRequest<"answer">, config: Gemini, context: ProviderContext): Promise<ToolOutput>;
|
|
13
|
+
research(input: import("../contract.js").ProviderRequest<"research">, config: Gemini, context: ProviderContext): Promise<ToolOutput>;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const geminiProvider: import("../definition.js").ProviderDefinitionFor<"gemini">;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProviderContext, SearchResponse, ToolOutput } from "../contract.js";
|
|
2
|
+
import type { Linkup } from "./types.js";
|
|
3
|
+
export declare const adapter: {
|
|
4
|
+
search(input: import("../contract.js").ProviderRequest<"search">, config: Linkup, context: ProviderContext): Promise<SearchResponse>;
|
|
5
|
+
contents(input: import("../contract.js").ProviderRequest<"contents">, config: Linkup, context: ProviderContext): Promise<import("../../contents.js").IndexedContentsResponse>;
|
|
6
|
+
research(input: import("../contract.js").ProviderRequest<"research">, config: Linkup, context: ProviderContext): Promise<ToolOutput>;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const linkupProvider: import("../definition.js").ProviderDefinitionFor<"linkup">;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Capability, ProviderId } from "../domain.js";
|
|
2
|
+
export interface ProviderCredentialMetadata {
|
|
3
|
+
name: string;
|
|
4
|
+
environmentVariable: string;
|
|
5
|
+
capabilities?: readonly Capability[];
|
|
6
|
+
optional?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ProviderMetadata {
|
|
9
|
+
id: ProviderId;
|
|
10
|
+
label: string;
|
|
11
|
+
docsUrl: string;
|
|
12
|
+
capabilities: readonly Capability[];
|
|
13
|
+
credentials: readonly ProviderCredentialMetadata[];
|
|
14
|
+
local: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ProviderContext, SearchResponse } from "../contract.js";
|
|
2
|
+
import type { Ollama } from "./types.js";
|
|
3
|
+
export declare const adapter: {
|
|
4
|
+
search(input: import("../contract.js").ProviderRequest<"search">, config: Ollama, context: ProviderContext): Promise<SearchResponse>;
|
|
5
|
+
contents(input: import("../contract.js").ProviderRequest<"contents">, config: Ollama, context: ProviderContext): Promise<import("../../contents.js").IndexedContentsResponse>;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ollamaProvider: import("../definition.js").ProviderDefinitionFor<"ollama">;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProviderContext, SearchResponse, ToolOutput } from "../contract.js";
|
|
2
|
+
import type { OpenAI as OpenAIConfig } from "./types.js";
|
|
3
|
+
export declare const adapter: {
|
|
4
|
+
search(input: import("../contract.js").ProviderRequest<"search">, config: OpenAIConfig, context: ProviderContext): Promise<SearchResponse>;
|
|
5
|
+
answer(input: import("../contract.js").ProviderRequest<"answer">, config: OpenAIConfig, context: ProviderContext): Promise<ToolOutput>;
|
|
6
|
+
research(input: import("../contract.js").ProviderRequest<"research">, config: OpenAIConfig, context: ProviderContext): Promise<ToolOutput>;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const openaiProvider: import("../definition.js").ProviderDefinitionFor<"openai">;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Provider } from "../contract.js";
|
|
2
|
+
export interface OpenAIWebSearchToolOptions {
|
|
3
|
+
externalWebAccess?: boolean;
|
|
4
|
+
searchContextSize?: "low" | "medium" | "high";
|
|
5
|
+
allowedDomains?: string[];
|
|
6
|
+
userLocation?: {
|
|
7
|
+
city?: string;
|
|
8
|
+
country?: string;
|
|
9
|
+
region?: string;
|
|
10
|
+
timezone?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface OpenAISearchOptions extends OpenAIWebSearchToolOptions {
|
|
14
|
+
model?: string;
|
|
15
|
+
instructions?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface OpenAIAnswerOptions extends OpenAIWebSearchToolOptions {
|
|
18
|
+
model?: string;
|
|
19
|
+
instructions?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface OpenAIResearchOptions extends OpenAIWebSearchToolOptions {
|
|
22
|
+
model?: string;
|
|
23
|
+
instructions?: string;
|
|
24
|
+
max_tool_calls?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface OpenAI extends Provider {
|
|
27
|
+
baseUrl?: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ProviderContext, SearchResponse } from "../contract.js";
|
|
2
|
+
import type { Parallel } from "./types.js";
|
|
3
|
+
export declare const adapter: {
|
|
4
|
+
search(input: import("../contract.js").ProviderRequest<"search">, config: Parallel, context: ProviderContext): Promise<SearchResponse>;
|
|
5
|
+
contents(input: import("../contract.js").ProviderRequest<"contents">, config: Parallel, context: ProviderContext): Promise<import("../../contents.js").IndexedContentsResponse>;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parallelProvider: import("../definition.js").ProviderDefinitionFor<"parallel">;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProviderContext, SearchResponse, ToolOutput } from "../contract.js";
|
|
2
|
+
import type { Perplexity } from "./types.js";
|
|
3
|
+
export declare const adapter: {
|
|
4
|
+
search(input: import("../contract.js").ProviderRequest<"search">, config: Perplexity, context: ProviderContext): Promise<SearchResponse>;
|
|
5
|
+
answer(input: import("../contract.js").ProviderRequest<"answer">, config: Perplexity, context: ProviderContext): Promise<ToolOutput>;
|
|
6
|
+
research(input: import("../contract.js").ProviderRequest<"research">, config: Perplexity, context: ProviderContext): Promise<ToolOutput>;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const perplexityProvider: import("../definition.js").ProviderDefinitionFor<"perplexity">;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const providers: {
|
|
2
|
+
readonly brave: import("./definition.js").ProviderDefinitionFor<"brave">;
|
|
3
|
+
readonly cloudflare: import("./definition.js").ProviderDefinitionFor<"cloudflare">;
|
|
4
|
+
readonly custom: import("./definition.js").ProviderDefinitionFor<"custom">;
|
|
5
|
+
readonly exa: import("./definition.js").ProviderDefinitionFor<"exa">;
|
|
6
|
+
readonly firecrawl: import("./definition.js").ProviderDefinitionFor<"firecrawl">;
|
|
7
|
+
readonly gemini: import("./definition.js").ProviderDefinitionFor<"gemini">;
|
|
8
|
+
readonly linkup: import("./definition.js").ProviderDefinitionFor<"linkup">;
|
|
9
|
+
readonly ollama: import("./definition.js").ProviderDefinitionFor<"ollama">;
|
|
10
|
+
readonly openai: import("./definition.js").ProviderDefinitionFor<"openai">;
|
|
11
|
+
readonly parallel: import("./definition.js").ProviderDefinitionFor<"parallel">;
|
|
12
|
+
readonly perplexity: import("./definition.js").ProviderDefinitionFor<"perplexity">;
|
|
13
|
+
readonly serper: import("./definition.js").ProviderDefinitionFor<"serper">;
|
|
14
|
+
readonly tavily: import("./definition.js").ProviderDefinitionFor<"tavily">;
|
|
15
|
+
readonly valyu: import("./definition.js").ProviderDefinitionFor<"valyu">;
|
|
16
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ProviderContext, SearchResponse } from "../contract.js";
|
|
2
|
+
import type { Serper } from "./types.js";
|
|
3
|
+
export declare const adapter: {
|
|
4
|
+
search(input: import("../contract.js").ProviderRequest<"search">, config: Serper, context: ProviderContext): Promise<SearchResponse>;
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const serperProvider: import("../definition.js").ProviderDefinitionFor<"serper">;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Provider } from "../contract.js";
|
|
2
|
+
export declare const SERPER_SEARCH_MODE_VALUES: {
|
|
3
|
+
readonly search: "search";
|
|
4
|
+
readonly images: "images";
|
|
5
|
+
readonly videos: "videos";
|
|
6
|
+
readonly places: "places";
|
|
7
|
+
readonly maps: "maps";
|
|
8
|
+
readonly reviews: "reviews";
|
|
9
|
+
readonly news: "news";
|
|
10
|
+
readonly shopping: "shopping";
|
|
11
|
+
readonly productReviews: "product-reviews";
|
|
12
|
+
readonly lens: "lens";
|
|
13
|
+
readonly scholar: "scholar";
|
|
14
|
+
readonly patents: "patents";
|
|
15
|
+
readonly autocomplete: "autocomplete";
|
|
16
|
+
readonly webpage: "webpage";
|
|
17
|
+
};
|
|
18
|
+
export type SerperSearchMode = (typeof SERPER_SEARCH_MODE_VALUES)[keyof typeof SERPER_SEARCH_MODE_VALUES];
|
|
19
|
+
export interface Serper extends Provider {
|
|
20
|
+
baseUrl?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function trimSnippet(input: string | undefined, maxLength?: number): string;
|
|
2
|
+
export declare function normalizeContentText(input: string | undefined): string;
|
|
3
|
+
export declare function asJsonObject(value: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
4
|
+
export declare function formatJson(value: unknown): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ProviderContext, SearchResponse } from "../contract.js";
|
|
2
|
+
import type { Tavily } from "./types.js";
|
|
3
|
+
export declare const adapter: {
|
|
4
|
+
search(input: import("../contract.js").ProviderRequest<"search">, config: Tavily, context: ProviderContext): Promise<SearchResponse>;
|
|
5
|
+
contents(input: import("../contract.js").ProviderRequest<"contents">, config: Tavily, context: ProviderContext): Promise<import("../../contents.js").IndexedContentsResponse>;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tavilyProvider: import("../definition.js").ProviderDefinitionFor<"tavily">;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProviderContext, SearchResponse, ToolOutput } from "../contract.js";
|
|
2
|
+
import type { Valyu } from "./types.js";
|
|
3
|
+
export declare const adapter: {
|
|
4
|
+
search(input: import("../contract.js").ProviderRequest<"search">, config: Valyu, context: ProviderContext): Promise<SearchResponse>;
|
|
5
|
+
contents(input: import("../contract.js").ProviderRequest<"contents">, config: Valyu, context: ProviderContext): Promise<import("../../contents.js").IndexedContentsResponse>;
|
|
6
|
+
answer(input: import("../contract.js").ProviderRequest<"answer">, config: Valyu, context: ProviderContext): Promise<ToolOutput>;
|
|
7
|
+
research(input: import("../contract.js").ProviderRequest<"research">, config: Valyu, context: ProviderContext): Promise<ToolOutput>;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const valyuProvider: import("../definition.js").ProviderDefinitionFor<"valyu">;
|
package/dist/render.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Capability, ProviderId } from "../domain.js";
|
|
2
|
+
import type { ProviderConfiguration } from "../configuration/types.js";
|
|
3
|
+
import type { ProviderDefinition } from "../providers/definition.js";
|
|
4
|
+
import type { ProviderConfigMap } from "../providers/contract.js";
|
|
5
|
+
import { OutwardBoundary } from "./outward.js";
|
|
6
|
+
/** Client-scoped environment and cache. Inspection never uses this resolver. */
|
|
7
|
+
export declare class CredentialResolver {
|
|
8
|
+
private readonly cwd;
|
|
9
|
+
private readonly env;
|
|
10
|
+
private readonly cache;
|
|
11
|
+
constructor(cwd: string, env: Record<string, string | undefined>);
|
|
12
|
+
prepare(definition: ProviderDefinition, stored: ProviderConfiguration | undefined, capability: Capability, signal: AbortSignal, outward: OutwardBoundary): Promise<ProviderConfigMap[ProviderId]>;
|
|
13
|
+
private resolveMap;
|
|
14
|
+
private resolve;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Capability, CapabilityDocument, CapabilityValues, RequestOptions } from "../domain.js";
|
|
2
|
+
import type { ExecutionConfig, ProviderConfiguration } from "../configuration/types.js";
|
|
3
|
+
import type { ProviderDefinition } from "../providers/definition.js";
|
|
4
|
+
export interface ExecutionPlan<C extends Capability> {
|
|
5
|
+
capability: C;
|
|
6
|
+
definition: ProviderDefinition;
|
|
7
|
+
stored?: ProviderConfiguration;
|
|
8
|
+
inputs: string[];
|
|
9
|
+
options: Record<string, unknown>;
|
|
10
|
+
maxResults?: number;
|
|
11
|
+
policy: ExecutionConfig;
|
|
12
|
+
}
|
|
13
|
+
export declare class ExecutionRuntime {
|
|
14
|
+
private readonly cwd;
|
|
15
|
+
private readonly env;
|
|
16
|
+
private readonly credentials;
|
|
17
|
+
constructor(cwd: string, env: Record<string, string | undefined>);
|
|
18
|
+
execute<C extends Capability>(plan: ExecutionPlan<C>, request: RequestOptions): Promise<CapabilityDocument<CapabilityValues[C], C>>;
|
|
19
|
+
private run;
|
|
20
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function deadline(timeoutMs: number, parent?: AbortSignal): {
|
|
2
|
+
signal: AbortSignal;
|
|
3
|
+
dispose(): void;
|
|
4
|
+
};
|
|
5
|
+
export declare function formatDuration(ms: number): string;
|
|
6
|
+
export declare function withSignal<T>(promise: Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
7
|
+
export declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
8
|
+
export declare function orderedMap<T, R>(items: T[], concurrency: number, work: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WebfoxError } from "../errors.js";
|
|
2
|
+
import type { SerializedError } from "../domain.js";
|
|
3
|
+
/** The only boundary through which internal provider data reaches a caller. */
|
|
4
|
+
export declare class OutwardBoundary {
|
|
5
|
+
private readonly secrets;
|
|
6
|
+
addSecret(secret: string): void;
|
|
7
|
+
text(value: string): string;
|
|
8
|
+
value<T>(value: T): T;
|
|
9
|
+
error(error: unknown): SerializedError;
|
|
10
|
+
exception(error: unknown): WebfoxError;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ProviderContext, ProviderId, ResearchJob, ResearchPollResult, ToolOutput } from "../providers/contract.js";
|
|
2
|
+
export { sleep } from "./lifecycle.js";
|
|
3
|
+
/** Shared provider polling mechanics. The runtime supplies the overall signal.
|
|
4
|
+
* Job creation is performed exactly once; only transient polling is repeated.
|
|
5
|
+
*/
|
|
6
|
+
export declare function executeAsyncResearch({ providerLabel, providerId, context, pollIntervalMs, start, poll, }: {
|
|
7
|
+
providerLabel: string;
|
|
8
|
+
providerId: ProviderId;
|
|
9
|
+
context: ProviderContext;
|
|
10
|
+
pollIntervalMs?: number;
|
|
11
|
+
start: (context: ProviderContext) => Promise<ResearchJob>;
|
|
12
|
+
poll: (id: string, context: ProviderContext) => Promise<ResearchPollResult>;
|
|
13
|
+
}): Promise<ToolOutput>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ChildProcess } from "node:child_process";
|
|
2
|
+
/** Call only for children spawned with detached: true on POSIX. */
|
|
3
|
+
export declare function killProcessGroup(child: ChildProcess, signal: NodeJS.Signals): void;
|
|
4
|
+
export declare function cancelProcessGroup(child: ChildProcess): void;
|