@autorag/librarian 2.5.1 → 2.5.3
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/NOTICE +3 -0
- package/README.md +230 -490
- package/dist/agent/agent.d.ts +40 -3
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/search-single-datasource-tool.d.ts +63 -0
- package/dist/agent/web-fetch-tool.d.ts +32 -0
- package/dist/agent/web-search-tool.d.ts +48 -0
- package/dist/cli/commands/lite-retrieve.d.ts +15 -0
- package/dist/cli/commands/search.d.ts +6 -0
- package/dist/cli/config.d.ts +20 -0
- package/dist/cli/index.js +17643 -10464
- package/dist/core.d.ts +3 -1
- package/dist/core.js +11081 -3945
- package/dist/datasource/connector-skill.d.ts +6 -0
- package/dist/datasource/crawler-skill.d.ts +2 -0
- package/dist/datasource/errors.d.ts +26 -0
- package/dist/datasource/index.d.ts +3 -2
- package/dist/datasource/skills/discrawl/skill.d.ts +1 -1
- package/dist/datasource/skills/discrawl/types.d.ts +2 -2
- package/dist/datasource/skills/github-gist/connector.d.ts +38 -0
- package/dist/datasource/skills/github-gist/index.d.ts +3 -0
- package/dist/datasource/skills/github-gist/semantic.d.ts +102 -0
- package/dist/datasource/skills/github-gist/skill.d.ts +39 -0
- package/dist/datasource/skills/lark/client.d.ts +23 -0
- package/dist/datasource/skills/lark/index.d.ts +2 -0
- package/dist/datasource/skills/lark/skill.d.ts +36 -0
- package/dist/datasource/skills/lazykatok/client.d.ts +28 -0
- package/dist/datasource/skills/lazykatok/index.d.ts +12 -0
- package/dist/datasource/skills/{katok → lazykatok}/methods.d.ts +12 -12
- package/dist/datasource/skills/lazykatok/paths.d.ts +40 -0
- package/dist/datasource/skills/{katok → lazykatok}/skill.d.ts +10 -10
- package/dist/datasource/skills/lazykatok/types.d.ts +134 -0
- package/dist/datasource/skills/mailcrawl/client.d.ts +2 -0
- package/dist/datasource/skills/mailcrawl/types.d.ts +12 -0
- package/dist/datasource/skills/slack/index.d.ts +8 -0
- package/dist/datasource/tool-naming.d.ts +11 -0
- package/dist/datasource/types.d.ts +4 -4
- package/dist/embedding-runtime/manifest.d.ts +8 -0
- package/dist/embedding-runtime/types.d.ts +4 -0
- package/dist/index.js +11598 -4461
- package/dist/minsync/types.d.ts +7 -0
- package/dist/process/terminate-tree.d.ts +2 -0
- package/dist/retrieval/engine.d.ts +14 -5
- package/dist/retrieval/index.d.ts +2 -1
- package/dist/retrieval/merger.d.ts +30 -5
- package/dist/retrieval/skip.d.ts +41 -0
- package/dist/retrieval/types.d.ts +24 -3
- package/dist/web/entities.d.ts +10 -0
- package/dist/web/fetch/convert.d.ts +35 -0
- package/dist/web/fetch/feeds.d.ts +37 -0
- package/dist/web/fetch/html-renderer.d.ts +54 -0
- package/dist/web/fetch/index.d.ts +12 -0
- package/dist/web/fetch/negotiate.d.ts +27 -0
- package/dist/web/fetch/page-loader.d.ts +60 -0
- package/dist/web/fetch/render.d.ts +23 -0
- package/dist/web/fetch/turndown/gfm.d.ts +11 -0
- package/dist/web/fetch/turndown/html.d.ts +5 -0
- package/dist/web/fetch/turndown/index.d.ts +10 -0
- package/dist/web/fetch/turndown/service.d.ts +21 -0
- package/dist/web/fetch/turndown/types.d.ts +73 -0
- package/dist/web/fetch/url-target.d.ts +29 -0
- package/dist/web/search/browser-headers.d.ts +17 -0
- package/dist/web/search/browser-loader.d.ts +56 -0
- package/dist/web/search/browser-page.d.ts +41 -0
- package/dist/web/search/credentials.d.ts +10 -0
- package/dist/web/search/format.d.ts +30 -0
- package/dist/web/search/index.d.ts +46 -0
- package/dist/web/search/model-auth.d.ts +36 -0
- package/dist/web/search/provider.d.ts +62 -0
- package/dist/web/search/providers/anthropic.d.ts +9 -0
- package/dist/web/search/providers/base.d.ts +106 -0
- package/dist/web/search/providers/codex.d.ts +9 -0
- package/dist/web/search/providers/duckduckgo.d.ts +22 -0
- package/dist/web/search/providers/ecosia.d.ts +29 -0
- package/dist/web/search/providers/gemini.d.ts +9 -0
- package/dist/web/search/providers/google.d.ts +22 -0
- package/dist/web/search/providers/mojeek.d.ts +24 -0
- package/dist/web/search/providers/parallel.d.ts +10 -0
- package/dist/web/search/providers/perplexity.d.ts +10 -0
- package/dist/web/search/providers/public.d.ts +15 -0
- package/dist/web/search/providers/responses-api.d.ts +26 -0
- package/dist/web/search/providers/searxng.d.ts +19 -0
- package/dist/web/search/providers/startpage.d.ts +25 -0
- package/dist/web/search/providers/utils.d.ts +39 -0
- package/dist/web/search/providers/xai.d.ts +9 -0
- package/dist/web/search/query.d.ts +193 -0
- package/dist/web/search/types.d.ts +198 -0
- package/dist/web/search/utils.d.ts +8 -0
- package/licenses/embedding-assets.json +20 -4
- package/package.json +2 -1
- package/skills/autorag/SKILL.md +2 -1
- package/skills/autorag-doctor/SKILL.md +238 -0
- package/skills/autorag-lite-search/SKILL.md +29 -7
- package/skills/autorag-lite-setup/SKILL.md +22 -15
- package/skills/autorag-setup/SKILL.md +40 -19
- package/dist/agent/search-datasource-tool.d.ts +0 -29
- package/dist/datasource/skills/katok/client.d.ts +0 -21
- package/dist/datasource/skills/katok/index.d.ts +0 -12
- package/dist/datasource/skills/katok/paths.d.ts +0 -40
- package/dist/datasource/skills/katok/types.d.ts +0 -123
package/dist/agent/agent.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ import { type ScanDuplicateDocumentsDetails } from "./dupey-tool.js";
|
|
|
16
16
|
import { type JikjiFindProviderResult } from "./jikji-find-tool.js";
|
|
17
17
|
import { type SearchDocumentDiagnostic, type SearchDocumentsResponse, type SearchDocumentsStreamEvent } from "./search-documents.js";
|
|
18
18
|
import { type WatcherFactory, type WatchRefreshHandle } from "./watch-refresh.js";
|
|
19
|
+
import { type WebFetchToolOptions } from "./web-fetch-tool.js";
|
|
20
|
+
import { type WebSearchToolOptions } from "./web-search-tool.js";
|
|
19
21
|
export interface AutoRefreshOptions {
|
|
20
22
|
readonly intervalMs: number;
|
|
21
23
|
readonly immediate?: boolean;
|
|
@@ -114,6 +116,21 @@ export interface AutoRAGAgentOptions {
|
|
|
114
116
|
tools?: AgentTool[];
|
|
115
117
|
minSync?: Omit<MinSyncVectorMethodOptions, "root"> | false;
|
|
116
118
|
jikji?: JikjiOptions | false;
|
|
119
|
+
/**
|
|
120
|
+
* Internet web tools (`web_search` + `web_fetch`), ported from oh-my-pi's
|
|
121
|
+
* provider-chain web module. Default enabled and credential-free: the
|
|
122
|
+
* chain leads with providers that need no user-issued key — model-native
|
|
123
|
+
* search reusing the agent's own model credentials (Gemini grounding,
|
|
124
|
+
* Anthropic/OpenAI/xAI web_search), the anonymous Perplexity ask
|
|
125
|
+
* endpoint, and Parallel's keyless MCP — then scraped engines with
|
|
126
|
+
* headless-browser escalation for bot challenges. A self-hosted
|
|
127
|
+
* SEARXNG_ENDPOINT is the only env-gated option. `false` disables both
|
|
128
|
+
* tools. The `fetch` sub-option tunes or disables `web_fetch` alone.
|
|
129
|
+
* Web tools are always omitted for remote P2P sessions.
|
|
130
|
+
*/
|
|
131
|
+
webSearch?: (WebSearchToolOptions & {
|
|
132
|
+
fetch?: WebFetchToolOptions | false;
|
|
133
|
+
}) | false;
|
|
117
134
|
autoRefresh?: AutoRefreshOptions;
|
|
118
135
|
parserOptions?: DefaultParserRegistryOptions;
|
|
119
136
|
dupey?: DupeyCliOptions | false;
|
|
@@ -150,6 +167,8 @@ export type AutoRAGJikjiPrepareResult = {
|
|
|
150
167
|
export declare class AutoRAGAgent {
|
|
151
168
|
private readonly innerAgent;
|
|
152
169
|
private readonly tools;
|
|
170
|
+
/** Static SEARCH_TOOLS plus the generated per-datasource tool names. */
|
|
171
|
+
private readonly searchToolNames;
|
|
153
172
|
private readonly configuredModel;
|
|
154
173
|
private readonly apiKey;
|
|
155
174
|
private readonly providerApiKeys;
|
|
@@ -162,6 +181,8 @@ export declare class AutoRAGAgent {
|
|
|
162
181
|
private readonly sessions;
|
|
163
182
|
private activeRun;
|
|
164
183
|
private resultCapture;
|
|
184
|
+
/** This agent's model credential for model-native web search (per instance, never shared). */
|
|
185
|
+
private modelNativeSearchAuth;
|
|
165
186
|
private retrievalTrace;
|
|
166
187
|
private preliminaryCallback;
|
|
167
188
|
/** Per-phase thinking levels; undefined marks the legacy single-phase flow. */
|
|
@@ -200,14 +221,12 @@ export declare class AutoRAGAgent {
|
|
|
200
221
|
readonly remoteSession: boolean;
|
|
201
222
|
private activeRetrievalOptions;
|
|
202
223
|
private searchToolCallCount;
|
|
203
|
-
private readonly sourceSearchCallCounts;
|
|
204
224
|
constructor(options: AutoRAGAgentOptions);
|
|
205
225
|
scanDuplicateDocuments(): Promise<ScanDuplicateDocumentsDetails>;
|
|
206
226
|
private withMemoryContext;
|
|
207
227
|
private resolveSessionModel;
|
|
208
228
|
private createSearchSession;
|
|
209
229
|
private configureSearchSession;
|
|
210
|
-
private withPerSourceSearchLimit;
|
|
211
230
|
private recordSearchToolEvent;
|
|
212
231
|
private currentSystemPromptConfig;
|
|
213
232
|
subscribe(listener: Parameters<Agent["subscribe"]>[0]): () => void;
|
|
@@ -242,6 +261,13 @@ export declare class AutoRAGAgent {
|
|
|
242
261
|
* model-visible; unauthorized skills are omitted entirely (default-deny).
|
|
243
262
|
*/
|
|
244
263
|
private buildAuthorizedDatasourceSkills;
|
|
264
|
+
/**
|
|
265
|
+
* Per-connection tool specs for the generated `search_datasource_<id>`
|
|
266
|
+
* tools, built from the same trusted config and access context as
|
|
267
|
+
* {@link buildAuthorizedDatasourceSkills}. One spec per authorized
|
|
268
|
+
* datasource skill; duplicate ids collapse to the first registration.
|
|
269
|
+
*/
|
|
270
|
+
private singleDatasourceToolSpecs;
|
|
245
271
|
/**
|
|
246
272
|
* Resolve an authorized datasource agent skill by model-visible name for the
|
|
247
273
|
* `load_datasource_skill` tool. Returns `undefined` for unknown or
|
|
@@ -368,7 +394,18 @@ export declare class AutoRAGAgent {
|
|
|
368
394
|
results: RetrievalResult[];
|
|
369
395
|
diagnostics: RetrievalDiagnostic[];
|
|
370
396
|
}>;
|
|
371
|
-
|
|
397
|
+
/**
|
|
398
|
+
* Search one datasource connection only. Only the target connection's
|
|
399
|
+
* retrieval methods are registered with the retriever, so no other
|
|
400
|
+
* datasource CLI is spawned at all and only that connection's hits are
|
|
401
|
+
* returned. Access is still gated by the trusted datasource context: an
|
|
402
|
+
* unknown or unauthorized `datasourceId` yields an empty result set.
|
|
403
|
+
*
|
|
404
|
+
* This backs the generated `search_datasource_<id>` tools; every authorized
|
|
405
|
+
* connection has one. Cross-datasource fan-out is
|
|
406
|
+
* {@link searchAllDocuments}, which spans every retrieval method.
|
|
407
|
+
*/
|
|
408
|
+
searchSingleDatasourceDocuments(datasourceId: string, query: string, options?: {
|
|
372
409
|
readonly topK?: number;
|
|
373
410
|
readonly scope?: string;
|
|
374
411
|
}): Promise<{
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type { AutoRAGEmittedResult, AutoRAGMappingEntry, AutoRAGResultsDetails,
|
|
|
6
6
|
export { createEmitResultsTool, EMIT_AUTORAG_RESULTS_TOOL_NAME, emitResultsSchema, } from "./emit-results-tool.js";
|
|
7
7
|
export { createJikjiFindTool, JIKJI_FIND_TOOL_NAME, type JikjiFindDetails, type JikjiFindPerRootPolicy, type JikjiFindProvider, type JikjiFindProviderResult, type MergedJikjiPolicy, } from "./jikji-find-tool.js";
|
|
8
8
|
export { createSearchAllDocumentsTool, SEARCH_ALL_DOCUMENTS_TOOL_NAME, type SearchAllDocumentsDetails, type SearchAllDocumentsProvider, type SearchAllDocumentsResult, } from "./search-all-tool.js";
|
|
9
|
-
export { createSearchDatasourceDocumentsTool, type DatasourceSearchProvider, SEARCH_DATASOURCE_DOCUMENTS_TOOL_NAME, type SearchDatasourceDocumentsDetails, } from "./search-datasource-tool.js";
|
|
10
9
|
export type { SearchDocumentDiagnostic, SearchDocumentDiagnosticCode, SearchDocumentDiagnosticSeverity, SearchDocumentEvidence, SearchDocumentResult, SearchDocumentsResponse, SearchDocumentsStreamEvent, SearchDocumentWarning, } from "./search-documents.js";
|
|
11
10
|
export { createSearchMinSyncDocumentsTool, SEARCH_MINSYNC_DOCUMENTS_TOOL_NAME, type SearchMinSyncDocumentsDetails, } from "./search-minsync-tool.js";
|
|
11
|
+
export { createSingleDatasourceSearchTools, formatDatasourceResults, SEARCH_SINGLE_DATASOURCE_TOOL_PREFIX, type SearchSingleDatasourceDetails, type SingleDatasourceSearchProvider, type SingleDatasourceToolSpec, singleDatasourceToolName, } from "./search-single-datasource-tool.js";
|
|
12
12
|
export { buildSystemPrompt, type SystemPromptConfig } from "./system-prompt.js";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
2
|
+
import { Type } from "typebox";
|
|
3
|
+
import type { RetrievalDiagnostic, RetrievalResult } from "../retrieval/types.js";
|
|
4
|
+
import { type SearchDocumentRetrievalTraceResult } from "./search-documents.js";
|
|
5
|
+
/**
|
|
6
|
+
* Per-datasource search tools.
|
|
7
|
+
*
|
|
8
|
+
* One tool is generated per authorized datasource connection (e.g.
|
|
9
|
+
* `search_datasource_discord`, or `search_datasource_kakao_work` for a
|
|
10
|
+
* `kakao-work` account alias). Its execution registers only that connection's
|
|
11
|
+
* retrieval methods with the retriever, so no other datasource CLI is spawned
|
|
12
|
+
* and the result set carries only that connection's hits.
|
|
13
|
+
*
|
|
14
|
+
* These generated tools are the only model-facing datasource retrieval
|
|
15
|
+
* surface. Cross-datasource fan-out belongs to `search_all_documents`, which
|
|
16
|
+
* already spans every configured retrieval method — including datasources — so
|
|
17
|
+
* a datasource-only fan-out tool would be redundant. Every authorized
|
|
18
|
+
* connection must therefore appear here; a datasource with no generated tool
|
|
19
|
+
* would become unreachable except through the full fan-out.
|
|
20
|
+
*
|
|
21
|
+
* Tools are generated from the configured, access-authorized datasource skills
|
|
22
|
+
* at agent construction, so a datasource that is disabled in config or denied
|
|
23
|
+
* by the trusted access context never appears in the tool list.
|
|
24
|
+
*/
|
|
25
|
+
export declare const SEARCH_SINGLE_DATASOURCE_TOOL_PREFIX = "search_datasource_";
|
|
26
|
+
/** Model-visible tool name for one datasource connection. */
|
|
27
|
+
export declare const singleDatasourceToolName: (datasourceId: string) => string;
|
|
28
|
+
/** Static per-connection descriptor used to generate one tool each. */
|
|
29
|
+
export interface SingleDatasourceToolSpec {
|
|
30
|
+
/** Trusted datasource id (alias-aware, e.g. `kakao-work`). */
|
|
31
|
+
readonly datasourceId: string;
|
|
32
|
+
/** Operator/descriptor-authored context shown in the tool description. */
|
|
33
|
+
readonly description: string;
|
|
34
|
+
/** Authorized instance roots (e.g. `/kakao/personal`) for the description. */
|
|
35
|
+
readonly instanceScopes: readonly string[];
|
|
36
|
+
}
|
|
37
|
+
export interface SingleDatasourceSearchProvider {
|
|
38
|
+
searchSingleDatasourceDocuments(datasourceId: string, query: string, options?: {
|
|
39
|
+
readonly topK?: number;
|
|
40
|
+
readonly scope?: string;
|
|
41
|
+
}): Promise<{
|
|
42
|
+
readonly results: readonly RetrievalResult[];
|
|
43
|
+
readonly diagnostics: readonly RetrievalDiagnostic[];
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
export interface SearchSingleDatasourceDetails {
|
|
47
|
+
readonly method: "datasource";
|
|
48
|
+
readonly datasource: string;
|
|
49
|
+
readonly resultCount: number;
|
|
50
|
+
readonly sources: readonly string[];
|
|
51
|
+
readonly diagnostics: readonly RetrievalDiagnostic[];
|
|
52
|
+
/** Top candidates in traceable shape (additive; used for the run's retrieval trace). */
|
|
53
|
+
readonly results?: readonly SearchDocumentRetrievalTraceResult[];
|
|
54
|
+
}
|
|
55
|
+
export declare function createSingleDatasourceSearchTools(provider: SingleDatasourceSearchProvider, specs: readonly SingleDatasourceToolSpec[]): AgentTool<typeof searchSingleDatasourceSchema, SearchSingleDatasourceDetails>[];
|
|
56
|
+
declare const searchSingleDatasourceSchema: Type.TObject<{
|
|
57
|
+
query: Type.TString;
|
|
58
|
+
topK: Type.TOptional<Type.TInteger>;
|
|
59
|
+
scope: Type.TOptional<Type.TString>;
|
|
60
|
+
}>;
|
|
61
|
+
/** Shared rendering for datasource search tool results (fan-out removed). */
|
|
62
|
+
export declare function formatDatasourceResults(results: readonly RetrievalResult[], diagnostics: readonly RetrievalDiagnostic[]): string;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `web_fetch` agent tool — read a public web page as text/markdown.
|
|
3
|
+
*
|
|
4
|
+
* LLM-facing wrapper around the oh-my-pi-style render pipeline in
|
|
5
|
+
* `src/web/fetch/`: content-negotiation (markdown alternates, `.md` suffix,
|
|
6
|
+
* llms.txt), feed/JSON/text handling, and HTML rendered to markdown through
|
|
7
|
+
* the reader-backend chain. Output is head-truncated like oh-my-pi's
|
|
8
|
+
* read-url integration so one page cannot flood the context.
|
|
9
|
+
*/
|
|
10
|
+
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
11
|
+
import { Type } from "typebox";
|
|
12
|
+
export declare const WEB_FETCH_TOOL_NAME = "web_fetch";
|
|
13
|
+
declare const webFetchSchema: Type.TObject<{
|
|
14
|
+
url: Type.TString;
|
|
15
|
+
raw: Type.TOptional<Type.TBoolean>;
|
|
16
|
+
}>;
|
|
17
|
+
export interface WebFetchToolOptions {
|
|
18
|
+
/** Total fetch/render timeout in seconds (default 30). */
|
|
19
|
+
readonly timeoutSeconds?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface WebFetchToolDetails {
|
|
22
|
+
readonly method: "web_fetch";
|
|
23
|
+
readonly url: string;
|
|
24
|
+
readonly finalUrl: string;
|
|
25
|
+
readonly contentType: string;
|
|
26
|
+
readonly fetchMethod: string;
|
|
27
|
+
readonly truncated: boolean;
|
|
28
|
+
readonly available: boolean;
|
|
29
|
+
readonly error?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function createWebFetchTool(options?: WebFetchToolOptions): AgentTool<typeof webFetchSchema, WebFetchToolDetails>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `web_search` agent tool — internet web search for the librarian agent.
|
|
3
|
+
*
|
|
4
|
+
* LLM-facing wrapper around the oh-my-pi-style provider chain in
|
|
5
|
+
* `src/web/search/`: credential-free end to end (model-native search on the
|
|
6
|
+
* agent's own model credential, the anonymous Perplexity ask endpoint,
|
|
7
|
+
* Parallel's keyless MCP, then the scraped engines), where quota/auth/bot
|
|
8
|
+
* failures automatically fall back down the chain. The model only supplies
|
|
9
|
+
* `query` plus optional hints; provider selection and credentials are never
|
|
10
|
+
* exposed through tool arguments.
|
|
11
|
+
*/
|
|
12
|
+
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
13
|
+
import { Type } from "typebox";
|
|
14
|
+
import type { ModelNativeSearchAuth } from "../web/search/model-auth.js";
|
|
15
|
+
import type { SearchProviderId } from "../web/search/types.js";
|
|
16
|
+
export declare const WEB_SEARCH_TOOL_NAME = "web_search";
|
|
17
|
+
declare const webSearchSchema: Type.TObject<{
|
|
18
|
+
query: Type.TString;
|
|
19
|
+
recency: Type.TOptional<Type.TUnion<[Type.TLiteral<"day">, Type.TLiteral<"week">, Type.TLiteral<"month">, Type.TLiteral<"year">]>>;
|
|
20
|
+
limit: Type.TOptional<Type.TInteger>;
|
|
21
|
+
num_search_results: Type.TOptional<Type.TInteger>;
|
|
22
|
+
}>;
|
|
23
|
+
export interface WebSearchToolOptions {
|
|
24
|
+
/** Force one provider (default: walk the configured chain). */
|
|
25
|
+
readonly provider?: SearchProviderId;
|
|
26
|
+
/** Prioritize these providers; unlisted providers keep their built-in relative order. */
|
|
27
|
+
readonly order?: readonly SearchProviderId[];
|
|
28
|
+
/** Providers never used by web search, including fallbacks. */
|
|
29
|
+
readonly exclude?: readonly SearchProviderId[];
|
|
30
|
+
/** Per-provider transport hard timeout in seconds (default 60, max 300). */
|
|
31
|
+
readonly timeoutSeconds?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Agent model credential for the model-native providers, read per call so
|
|
34
|
+
* the tool follows its own agent's session model and never another
|
|
35
|
+
* agent's. Returning undefined leaves the env-key fallback in charge.
|
|
36
|
+
*/
|
|
37
|
+
readonly modelAuth?: () => ModelNativeSearchAuth | undefined;
|
|
38
|
+
}
|
|
39
|
+
export interface WebSearchToolDetails {
|
|
40
|
+
readonly method: "web_search";
|
|
41
|
+
readonly provider: string;
|
|
42
|
+
readonly resultCount: number;
|
|
43
|
+
readonly sources: readonly string[];
|
|
44
|
+
readonly available: boolean;
|
|
45
|
+
readonly error?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function createWebSearchTool(options?: WebSearchToolOptions): AgentTool<typeof webSearchSchema, WebSearchToolDetails>;
|
|
48
|
+
export {};
|
|
@@ -8,8 +8,23 @@ export interface LiteRetrieveEnvelope {
|
|
|
8
8
|
*/
|
|
9
9
|
readonly stale: boolean;
|
|
10
10
|
readonly results: readonly LiteRetrieveResultItem[];
|
|
11
|
+
/**
|
|
12
|
+
* Retrieval surfaces that did not run for this query. A consumer that only
|
|
13
|
+
* reads `results` can check `unsearched.length > 0` to learn the answer is
|
|
14
|
+
* partial — for example local MinSync files skipped while an index sync holds
|
|
15
|
+
* the workspace lock, leaving only datasource hits.
|
|
16
|
+
*/
|
|
17
|
+
readonly unsearched: readonly LiteRetrieveUnsearched[];
|
|
11
18
|
readonly diagnostics: readonly LiteRetrieveDiagnostic[];
|
|
12
19
|
}
|
|
20
|
+
export interface LiteRetrieveUnsearched {
|
|
21
|
+
/** Surface label: "minsync" for local files, or the datasource id. */
|
|
22
|
+
readonly surface: string;
|
|
23
|
+
/** Retrieval method names on this surface that did not run. */
|
|
24
|
+
readonly methods: readonly string[];
|
|
25
|
+
/** The underlying failure verbatim, including CLI stderr and exit status. */
|
|
26
|
+
readonly reason: string;
|
|
27
|
+
}
|
|
13
28
|
export interface LiteRetrieveResultItem {
|
|
14
29
|
readonly number: number;
|
|
15
30
|
readonly source: string;
|
|
@@ -26,6 +26,12 @@ export declare function classifySearchHealthHint(error: unknown): SearchHealthHi
|
|
|
26
26
|
export interface SearchDeps {
|
|
27
27
|
agentFactory?: (opts: AutoRAGAgentOptions) => Pick<AutoRAGAgent, "searchDocumentsStream">;
|
|
28
28
|
modelResolver?: (config: CliConfig) => ResolvedAgentModel;
|
|
29
|
+
/**
|
|
30
|
+
* Stops the on-demand embedding gateway so the process can exit. Without
|
|
31
|
+
* this the semantic MinSync path's loopback gateway keeps the event loop
|
|
32
|
+
* alive after the search completes and the CLI never exits.
|
|
33
|
+
*/
|
|
34
|
+
stopRuntime?: () => Promise<void>;
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
31
37
|
* Run the `autorag search` command. Returns exit code 0 on success, 2 for
|
package/dist/cli/config.d.ts
CHANGED
|
@@ -31,6 +31,25 @@ export interface RawIndexingMethods {
|
|
|
31
31
|
export interface NormalizedIndexingConfig {
|
|
32
32
|
minSync: MinSyncMethodConfig;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Web tools (`web_search` + `web_fetch`) config. Secrets never appear here:
|
|
36
|
+
* the shipped chain is credential-free (model-native providers reuse the
|
|
37
|
+
* agent's resolved model credentials; perplexity/parallel need nothing), and
|
|
38
|
+
* the only env-gated option is a self-hosted SEARXNG_ENDPOINT.
|
|
39
|
+
*/
|
|
40
|
+
export interface WebSearchCliConfig {
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
provider?: string;
|
|
43
|
+
order?: string[];
|
|
44
|
+
exclude?: string[];
|
|
45
|
+
/** Per-provider transport hard timeout in seconds (1-300). */
|
|
46
|
+
timeoutSeconds?: number;
|
|
47
|
+
fetch?: {
|
|
48
|
+
enabled?: boolean;
|
|
49
|
+
/** Total page fetch/render timeout in seconds (1-300). */
|
|
50
|
+
timeoutSeconds?: number;
|
|
51
|
+
} | false;
|
|
52
|
+
}
|
|
34
53
|
export interface P2pConfig {
|
|
35
54
|
enabled?: boolean;
|
|
36
55
|
port?: number;
|
|
@@ -91,6 +110,7 @@ export interface CliConfig {
|
|
|
91
110
|
model?: AgentModelConfig;
|
|
92
111
|
minSync?: MinSyncMethodConfig;
|
|
93
112
|
jikji?: Record<string, unknown> | false;
|
|
113
|
+
webSearch?: WebSearchCliConfig;
|
|
94
114
|
parserOptions?: Record<string, unknown>;
|
|
95
115
|
dupey?: {
|
|
96
116
|
enabled?: boolean;
|