dsh-lcx-codex 0.4.3-pre.3 → 0.4.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/README.md +68 -99
- package/THIRD_PARTY_NOTICES.md +64 -0
- package/lib/auxiliary-usage.js +63 -0
- package/lib/client.js +1363 -295
- package/lib/dsh-compat.js +80 -18
- package/lib/dsh-responses.js +75 -8
- package/lib/grok-native-search.js +153 -79
- package/lib/index.js +159 -101
- package/lib/invocation-policy-scope.js +261 -0
- package/lib/json-store.js +11 -4
- package/lib/pi-responses-runtime.js +1571 -0
- package/lib/responses-request.js +1 -1
- package/lib/responses-stream.js +163 -92
- package/lib/route.js +17 -3
- package/lib/search-accounting.js +86 -0
- package/lib/search-usage.js +86 -0
- package/lib/transport.js +38 -10
- package/lib/types/client/index.d.ts +12 -0
- package/lib/types/client/search-media.d.ts +16 -0
- package/lib/web-run-output.js +22 -0
- package/lib/web-search-alpha.js +230 -28
- package/lib/web-search-capability.js +26 -1
- package/lib/web-search-hosted.js +119 -9
- package/lib/web-search-ref-store.js +88 -7
- package/package.json +50 -26
- package/lib/types/compact-v2.d.ts +0 -104
- package/lib/types/dsh-compat.d.ts +0 -78
- package/lib/types/dsh-responses.d.ts +0 -82
- package/lib/types/grok-native-search.d.ts +0 -39
- package/lib/types/json-store.d.ts +0 -10
- package/lib/types/native-checkpoint.d.ts +0 -213
- package/lib/types/responses-request.d.ts +0 -59
- package/lib/types/responses-stream.d.ts +0 -64
- package/lib/types/route.d.ts +0 -153
- package/lib/types/service-mutex.d.ts +0 -14
- package/lib/types/token-budget.d.ts +0 -50
- package/lib/types/transport.d.ts +0 -21
- package/lib/types/web-run-output.d.ts +0 -29
- package/lib/types/web-search-alpha.d.ts +0 -286
- package/lib/types/web-search-capability.d.ts +0 -26
- package/lib/types/web-search-hosted.d.ts +0 -246
- package/lib/types/web-search-ref-store.d.ts +0 -22
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export declare const PORTABLE_BUDGET_ERROR_CODE = "LCX_PORTABLE_BUDGET_EXCEEDED";
|
|
2
|
-
/**
|
|
3
|
-
* A small conservative fallback, deliberately not a tokenizer. The baseline
|
|
4
|
-
* preserves legacy /4 while CJK and structural characters cost more.
|
|
5
|
-
* @param {unknown} value
|
|
6
|
-
* @returns {number | undefined}
|
|
7
|
-
*/
|
|
8
|
-
export declare function estimateTextTokens(value: unknown): number | undefined;
|
|
9
|
-
/**
|
|
10
|
-
* Project an item to model-visible fields only. Opaque provider state, raw
|
|
11
|
-
* binary, and replay/session metadata are intentionally excluded.
|
|
12
|
-
* @param {unknown} item
|
|
13
|
-
* @returns {unknown | undefined}
|
|
14
|
-
*/
|
|
15
|
-
export declare function modelVisibleBudgetView(item: unknown): {
|
|
16
|
-
type: string;
|
|
17
|
-
call_id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
arguments: string;
|
|
20
|
-
output?: undefined;
|
|
21
|
-
role?: undefined;
|
|
22
|
-
content?: undefined;
|
|
23
|
-
} | {
|
|
24
|
-
name?: undefined;
|
|
25
|
-
arguments?: undefined;
|
|
26
|
-
type: string;
|
|
27
|
-
call_id: string;
|
|
28
|
-
output: string;
|
|
29
|
-
role?: undefined;
|
|
30
|
-
content?: undefined;
|
|
31
|
-
} | {
|
|
32
|
-
name?: undefined;
|
|
33
|
-
arguments?: undefined;
|
|
34
|
-
type?: undefined;
|
|
35
|
-
call_id?: undefined;
|
|
36
|
-
output?: undefined;
|
|
37
|
-
role: string;
|
|
38
|
-
content: unknown[];
|
|
39
|
-
} | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* @param {unknown} item
|
|
42
|
-
* @returns {number | undefined}
|
|
43
|
-
*/
|
|
44
|
-
export declare function estimateBudgetItem(item: unknown): number | undefined;
|
|
45
|
-
/** @param {unknown} maxChars */
|
|
46
|
-
export declare function portableTokenCeiling(maxChars: unknown): number | undefined;
|
|
47
|
-
/** @param {string} message */
|
|
48
|
-
export declare function portableBudgetError(message: string): Error & {
|
|
49
|
-
code: string;
|
|
50
|
-
};
|
package/lib/types/transport.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
type AbortLike = Pick<AbortSignal, "aborted" | "reason" | "addEventListener">;
|
|
2
|
-
type RetryOptions = {
|
|
3
|
-
maxAttempts?: number;
|
|
4
|
-
maxResponseBytes?: number;
|
|
5
|
-
};
|
|
6
|
-
type SseRetryOptions<T = Response> = RetryOptions & {
|
|
7
|
-
consume?: (response: Response, options: {
|
|
8
|
-
requestSignal?: AbortSignal;
|
|
9
|
-
}) => Promise<T>;
|
|
10
|
-
applyDefaultTimeout?: boolean;
|
|
11
|
-
};
|
|
12
|
-
type JsonRequestBody = Record<string, unknown>;
|
|
13
|
-
type SseRequestBody = Record<string, unknown>;
|
|
14
|
-
export declare function abortIfNeeded(signal: AbortLike | undefined): void;
|
|
15
|
-
export declare function fetchJsonWithRetry(url: string | URL | Request, body: JsonRequestBody, headers: HeadersInit | undefined, signal: AbortSignal | undefined, timeoutMs?: number | undefined, options?: RetryOptions): Promise<any>;
|
|
16
|
-
export declare function fetchSseWithRetry<T = Response>(url: string | URL | Request, body: SseRequestBody, headers: HeadersInit | undefined, signal: AbortSignal | undefined, timeoutMs: number | undefined, options?: SseRetryOptions<T>): Promise<T>;
|
|
17
|
-
export declare function consumeSse(response: Response, onEvent: (event: unknown) => void, options?: {
|
|
18
|
-
signal?: AbortSignal;
|
|
19
|
-
maxResponseBytes?: number;
|
|
20
|
-
}): Promise<void>;
|
|
21
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface WebRunLink {
|
|
2
|
-
id: number;
|
|
3
|
-
label: string;
|
|
4
|
-
domain?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface WebRunLine {
|
|
7
|
-
text: string;
|
|
8
|
-
heading?: number;
|
|
9
|
-
line?: number;
|
|
10
|
-
page?: number;
|
|
11
|
-
pageEnd?: number;
|
|
12
|
-
}
|
|
13
|
-
export interface WebRunBlock {
|
|
14
|
-
title?: string;
|
|
15
|
-
url?: string;
|
|
16
|
-
references: string[];
|
|
17
|
-
links: WebRunLink[];
|
|
18
|
-
metadata: string[];
|
|
19
|
-
lines: WebRunLine[];
|
|
20
|
-
}
|
|
21
|
-
export declare function parseWebRunOutput(output: string): WebRunBlock[];
|
|
22
|
-
export declare function outputLineRange(blocks: WebRunBlock[]): {
|
|
23
|
-
first: number;
|
|
24
|
-
last: number;
|
|
25
|
-
} | undefined;
|
|
26
|
-
export declare function outputDomains(blocks: WebRunBlock[]): string[];
|
|
27
|
-
export declare function outputLinks(blocks: WebRunBlock[]): WebRunLink[];
|
|
28
|
-
export declare function outputPdfRefs(blocks: WebRunBlock[]): string[];
|
|
29
|
-
export declare function blockPlainText(block: Pick<WebRunBlock, "lines">): string;
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import type { ContentBlock } from "@deepseek-ai/dsh-llm";
|
|
2
|
-
export declare const ALPHA_ACTIONS: string[];
|
|
3
|
-
export declare const ALPHA_SEARCH_PARAMETERS: {
|
|
4
|
-
type: "object";
|
|
5
|
-
properties: {
|
|
6
|
-
action: {
|
|
7
|
-
type: "string";
|
|
8
|
-
enum: string[];
|
|
9
|
-
};
|
|
10
|
-
query: {
|
|
11
|
-
type: "string";
|
|
12
|
-
};
|
|
13
|
-
domains: {
|
|
14
|
-
type: "array";
|
|
15
|
-
items: {
|
|
16
|
-
type: "string";
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
recency: {
|
|
20
|
-
type: "integer";
|
|
21
|
-
};
|
|
22
|
-
refId: {
|
|
23
|
-
type: "string";
|
|
24
|
-
};
|
|
25
|
-
lineNumber: {
|
|
26
|
-
type: "integer";
|
|
27
|
-
};
|
|
28
|
-
linkId: {
|
|
29
|
-
type: "integer";
|
|
30
|
-
};
|
|
31
|
-
pattern: {
|
|
32
|
-
type: "string";
|
|
33
|
-
};
|
|
34
|
-
pageNumber: {
|
|
35
|
-
type: "integer";
|
|
36
|
-
};
|
|
37
|
-
ticker: {
|
|
38
|
-
type: "string";
|
|
39
|
-
};
|
|
40
|
-
assetType: {
|
|
41
|
-
type: "string";
|
|
42
|
-
enum: string[];
|
|
43
|
-
};
|
|
44
|
-
market: {
|
|
45
|
-
type: "string";
|
|
46
|
-
};
|
|
47
|
-
location: {
|
|
48
|
-
type: "string";
|
|
49
|
-
};
|
|
50
|
-
start: {
|
|
51
|
-
type: "string";
|
|
52
|
-
};
|
|
53
|
-
duration: {
|
|
54
|
-
type: "integer";
|
|
55
|
-
};
|
|
56
|
-
fn: {
|
|
57
|
-
type: "string";
|
|
58
|
-
enum: string[];
|
|
59
|
-
};
|
|
60
|
-
league: {
|
|
61
|
-
type: "string";
|
|
62
|
-
enum: string[];
|
|
63
|
-
};
|
|
64
|
-
team: {
|
|
65
|
-
type: "string";
|
|
66
|
-
};
|
|
67
|
-
opponent: {
|
|
68
|
-
type: "string";
|
|
69
|
-
};
|
|
70
|
-
dateFrom: {
|
|
71
|
-
type: "string";
|
|
72
|
-
};
|
|
73
|
-
dateTo: {
|
|
74
|
-
type: "string";
|
|
75
|
-
};
|
|
76
|
-
numberOfGames: {
|
|
77
|
-
type: "integer";
|
|
78
|
-
};
|
|
79
|
-
locale: {
|
|
80
|
-
type: "string";
|
|
81
|
-
};
|
|
82
|
-
utcOffset: {
|
|
83
|
-
type: "string";
|
|
84
|
-
};
|
|
85
|
-
responseLength: {
|
|
86
|
-
type: "string";
|
|
87
|
-
enum: string[];
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
required: string[];
|
|
91
|
-
additionalProperties: false;
|
|
92
|
-
};
|
|
93
|
-
export declare const ALPHA_SEARCH_OUTPUT: {
|
|
94
|
-
type: "object";
|
|
95
|
-
properties: {
|
|
96
|
-
mode: {
|
|
97
|
-
type: "string";
|
|
98
|
-
};
|
|
99
|
-
action: {
|
|
100
|
-
type: "string";
|
|
101
|
-
};
|
|
102
|
-
capability: {
|
|
103
|
-
type: "string";
|
|
104
|
-
};
|
|
105
|
-
emulation: {
|
|
106
|
-
type: "string";
|
|
107
|
-
};
|
|
108
|
-
content: {
|
|
109
|
-
type: "string";
|
|
110
|
-
};
|
|
111
|
-
results: {
|
|
112
|
-
type: "array";
|
|
113
|
-
items: {
|
|
114
|
-
type: "object";
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
refs: {
|
|
118
|
-
type: "array";
|
|
119
|
-
items: {
|
|
120
|
-
type: "string";
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
sources: {
|
|
124
|
-
type: "array";
|
|
125
|
-
items: {
|
|
126
|
-
type: "object";
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
citations: {
|
|
130
|
-
type: "array";
|
|
131
|
-
items: {
|
|
132
|
-
type: "object";
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
outputBlocks: {
|
|
136
|
-
type: "array";
|
|
137
|
-
items: {
|
|
138
|
-
type: "object";
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
links: {
|
|
142
|
-
type: "array";
|
|
143
|
-
items: {
|
|
144
|
-
type: "object";
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
pdfRefs: {
|
|
148
|
-
type: "array";
|
|
149
|
-
items: {
|
|
150
|
-
type: "string";
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
domains: {
|
|
154
|
-
type: "array";
|
|
155
|
-
items: {
|
|
156
|
-
type: "string";
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
lineRange: {
|
|
160
|
-
type: "object";
|
|
161
|
-
};
|
|
162
|
-
requestId: {
|
|
163
|
-
type: "string";
|
|
164
|
-
};
|
|
165
|
-
responseId: {
|
|
166
|
-
type: "string";
|
|
167
|
-
};
|
|
168
|
-
retrievedAt: {
|
|
169
|
-
type: "string";
|
|
170
|
-
};
|
|
171
|
-
warnings: {
|
|
172
|
-
type: "array";
|
|
173
|
-
items: {
|
|
174
|
-
type: "string";
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
required: string[];
|
|
179
|
-
additionalProperties: false;
|
|
180
|
-
};
|
|
181
|
-
export declare const ALPHA_SCHEMA_FINGERPRINT: string;
|
|
182
|
-
export declare const ALPHA_PROBE_VERSION = 12;
|
|
183
|
-
type RecordValue = Record<string, unknown>;
|
|
184
|
-
type AlphaAction = (typeof ALPHA_ACTIONS)[number];
|
|
185
|
-
type NormalizedAlphaArgs = RecordValue & {
|
|
186
|
-
action: AlphaAction;
|
|
187
|
-
};
|
|
188
|
-
type AlphaResponse = {
|
|
189
|
-
output: string;
|
|
190
|
-
results?: unknown[];
|
|
191
|
-
id?: unknown;
|
|
192
|
-
};
|
|
193
|
-
type AlphaProbeValue = RecordValue & {
|
|
194
|
-
content?: unknown;
|
|
195
|
-
results?: unknown;
|
|
196
|
-
refs?: unknown;
|
|
197
|
-
links?: unknown;
|
|
198
|
-
pdfRefs?: unknown;
|
|
199
|
-
outputBlocks?: unknown;
|
|
200
|
-
sources?: unknown;
|
|
201
|
-
};
|
|
202
|
-
type AlphaInvoke = (args: RecordValue) => Promise<AlphaProbeValue>;
|
|
203
|
-
export declare function normalizeAlphaSearchArgs(args: unknown): NormalizedAlphaArgs;
|
|
204
|
-
export declare function alphaActionCommand(args: NormalizedAlphaArgs): Record<string, unknown>;
|
|
205
|
-
export declare function buildAlphaSearchBody(args: NormalizedAlphaArgs, model: unknown, sessionId: string, externalWebAccess?: boolean, maxOutputTokens?: number): {
|
|
206
|
-
id: string;
|
|
207
|
-
model: unknown;
|
|
208
|
-
input: {
|
|
209
|
-
role: string;
|
|
210
|
-
content: {
|
|
211
|
-
type: string;
|
|
212
|
-
text: string;
|
|
213
|
-
}[];
|
|
214
|
-
}[];
|
|
215
|
-
commands: Record<string, unknown>;
|
|
216
|
-
settings: {
|
|
217
|
-
allowed_callers: string[];
|
|
218
|
-
external_web_access: boolean;
|
|
219
|
-
};
|
|
220
|
-
max_output_tokens: number;
|
|
221
|
-
};
|
|
222
|
-
export declare function isPublicAlphaTarget(url: URL): boolean;
|
|
223
|
-
export declare function isAlphaHttpUrl(value: unknown): value is string;
|
|
224
|
-
export declare function isAlphaContinuationUrl(value: unknown): value is string;
|
|
225
|
-
export declare function alphaRefRequiresStore(action: string, refId: unknown): boolean;
|
|
226
|
-
export declare function parseAlphaSearchResponse(response: AlphaResponse, options: {
|
|
227
|
-
action: unknown;
|
|
228
|
-
capability: unknown;
|
|
229
|
-
requestId: unknown;
|
|
230
|
-
retrievedAt?: unknown;
|
|
231
|
-
}): {
|
|
232
|
-
mode: string;
|
|
233
|
-
action: unknown;
|
|
234
|
-
capability: unknown;
|
|
235
|
-
emulation: string;
|
|
236
|
-
content: string;
|
|
237
|
-
results: unknown;
|
|
238
|
-
refs: string[];
|
|
239
|
-
sources: {
|
|
240
|
-
refId?: string;
|
|
241
|
-
snippet?: string;
|
|
242
|
-
title?: string;
|
|
243
|
-
url: string;
|
|
244
|
-
}[];
|
|
245
|
-
citations: {
|
|
246
|
-
refId?: string;
|
|
247
|
-
snippet?: string;
|
|
248
|
-
title?: string;
|
|
249
|
-
url: string;
|
|
250
|
-
}[];
|
|
251
|
-
outputBlocks: import("./web-run-output.js").WebRunBlock[];
|
|
252
|
-
links: import("./web-run-output.js").WebRunLink[];
|
|
253
|
-
pdfRefs: string[];
|
|
254
|
-
domains: string[];
|
|
255
|
-
lineRange?: {
|
|
256
|
-
first: number;
|
|
257
|
-
last: number;
|
|
258
|
-
} | undefined;
|
|
259
|
-
requestId: unknown;
|
|
260
|
-
responseId?: string | undefined;
|
|
261
|
-
retrievedAt: {};
|
|
262
|
-
warnings: string[];
|
|
263
|
-
refRecords: {
|
|
264
|
-
url?: string;
|
|
265
|
-
refId: string;
|
|
266
|
-
}[];
|
|
267
|
-
};
|
|
268
|
-
export declare function renderAlphaSearchResult(value: unknown): ContentBlock[];
|
|
269
|
-
export declare function probeAlphaCapabilities({ invoke, schemaFingerprint, trustedNativeProvenance, actionProbes, clickProbeRef, screenshotProbeRef, }: {
|
|
270
|
-
invoke: AlphaInvoke;
|
|
271
|
-
schemaFingerprint: unknown;
|
|
272
|
-
trustedNativeProvenance?: boolean;
|
|
273
|
-
actionProbes?: Record<string, RecordValue>;
|
|
274
|
-
clickProbeRef?: unknown;
|
|
275
|
-
screenshotProbeRef?: unknown;
|
|
276
|
-
}): Promise<{
|
|
277
|
-
classification: string;
|
|
278
|
-
actions: {
|
|
279
|
-
[k: string]: string;
|
|
280
|
-
};
|
|
281
|
-
probedAt: string;
|
|
282
|
-
schemaFingerprint: unknown;
|
|
283
|
-
probeVersion: number;
|
|
284
|
-
provenance: string;
|
|
285
|
-
}>;
|
|
286
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { JsonStore } from "./json-store.js";
|
|
2
|
-
declare const VERSION = 1;
|
|
3
|
-
type Classification = "native" | "command-capable" | "emulated-search-only" | "unsupported" | "unknown";
|
|
4
|
-
type ActionState = "supported" | "unsupported" | "unknown";
|
|
5
|
-
type Provenance = "trusted-native" | "unavailable";
|
|
6
|
-
export interface AlphaCapabilityRecord {
|
|
7
|
-
classification: Classification;
|
|
8
|
-
actions: Record<string, ActionState>;
|
|
9
|
-
probedAt: string;
|
|
10
|
-
schemaFingerprint: string;
|
|
11
|
-
probeVersion?: number;
|
|
12
|
-
provenance?: Provenance;
|
|
13
|
-
}
|
|
14
|
-
interface CapabilityData {
|
|
15
|
-
version: typeof VERSION;
|
|
16
|
-
capabilities: Record<string, AlphaCapabilityRecord>;
|
|
17
|
-
}
|
|
18
|
-
export declare function alphaCapabilityFingerprint(config: Record<string, unknown>): string;
|
|
19
|
-
export declare function alphaCapabilityUsable(record: unknown): boolean;
|
|
20
|
-
export declare class AlphaCapabilityStore {
|
|
21
|
-
readonly store: JsonStore<CapabilityData>;
|
|
22
|
-
constructor(file: string);
|
|
23
|
-
get(fingerprint: string): AlphaCapabilityRecord | undefined;
|
|
24
|
-
put(fingerprint: unknown, record: unknown): void;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import type { ContentBlock } from "@deepseek-ai/dsh-llm";
|
|
2
|
-
type SearchContextSize = "low" | "medium" | "high";
|
|
3
|
-
type ReturnTokenBudget = "default" | "unlimited";
|
|
4
|
-
type SearchContentType = "text" | "image";
|
|
5
|
-
interface UserLocation {
|
|
6
|
-
country?: string;
|
|
7
|
-
city?: string;
|
|
8
|
-
region?: string;
|
|
9
|
-
timezone?: string;
|
|
10
|
-
}
|
|
11
|
-
interface ImageSettings {
|
|
12
|
-
maxResults?: number;
|
|
13
|
-
caption?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface HostedSearchArgs {
|
|
16
|
-
query: string;
|
|
17
|
-
searchContextSize?: SearchContextSize;
|
|
18
|
-
allowedDomains?: string[];
|
|
19
|
-
blockedDomains?: string[];
|
|
20
|
-
userLocation?: UserLocation;
|
|
21
|
-
externalWebAccess?: boolean;
|
|
22
|
-
returnTokenBudget?: ReturnTokenBudget;
|
|
23
|
-
searchContentTypes?: SearchContentType[];
|
|
24
|
-
imageSettings?: ImageSettings;
|
|
25
|
-
}
|
|
26
|
-
interface Source {
|
|
27
|
-
url: string;
|
|
28
|
-
title?: string;
|
|
29
|
-
snippet?: string;
|
|
30
|
-
publishedAt?: string;
|
|
31
|
-
refId?: string;
|
|
32
|
-
}
|
|
33
|
-
interface ImageResult {
|
|
34
|
-
imageUrl: string;
|
|
35
|
-
thumbnailUrl?: string;
|
|
36
|
-
sourceWebsiteUrl?: string;
|
|
37
|
-
caption?: string;
|
|
38
|
-
}
|
|
39
|
-
export declare const HOSTED_SEARCH_PARAMETERS: {
|
|
40
|
-
type: "object";
|
|
41
|
-
properties: {
|
|
42
|
-
query: {
|
|
43
|
-
type: "string";
|
|
44
|
-
description: string;
|
|
45
|
-
};
|
|
46
|
-
searchContextSize: {
|
|
47
|
-
type: "string";
|
|
48
|
-
enum: string[];
|
|
49
|
-
};
|
|
50
|
-
allowedDomains: {
|
|
51
|
-
type: "array";
|
|
52
|
-
items: {
|
|
53
|
-
type: "string";
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
blockedDomains: {
|
|
57
|
-
type: "array";
|
|
58
|
-
items: {
|
|
59
|
-
type: "string";
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
userLocation: {
|
|
63
|
-
type: "object";
|
|
64
|
-
properties: {
|
|
65
|
-
country: {
|
|
66
|
-
type: "string";
|
|
67
|
-
};
|
|
68
|
-
city: {
|
|
69
|
-
type: "string";
|
|
70
|
-
};
|
|
71
|
-
region: {
|
|
72
|
-
type: "string";
|
|
73
|
-
};
|
|
74
|
-
timezone: {
|
|
75
|
-
type: "string";
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
additionalProperties: false;
|
|
79
|
-
};
|
|
80
|
-
externalWebAccess: {
|
|
81
|
-
type: "boolean";
|
|
82
|
-
};
|
|
83
|
-
returnTokenBudget: {
|
|
84
|
-
type: "string";
|
|
85
|
-
enum: string[];
|
|
86
|
-
};
|
|
87
|
-
searchContentTypes: {
|
|
88
|
-
type: "array";
|
|
89
|
-
items: {
|
|
90
|
-
type: "string";
|
|
91
|
-
enum: string[];
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
imageSettings: {
|
|
95
|
-
type: "object";
|
|
96
|
-
properties: {
|
|
97
|
-
maxResults: {
|
|
98
|
-
type: "integer";
|
|
99
|
-
};
|
|
100
|
-
caption: {
|
|
101
|
-
type: "boolean";
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
additionalProperties: false;
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
required: string[];
|
|
108
|
-
additionalProperties: false;
|
|
109
|
-
};
|
|
110
|
-
export declare const HOSTED_SEARCH_OUTPUT: {
|
|
111
|
-
type: "object";
|
|
112
|
-
properties: {
|
|
113
|
-
mode: {
|
|
114
|
-
type: "string";
|
|
115
|
-
enum: string[];
|
|
116
|
-
};
|
|
117
|
-
action: {
|
|
118
|
-
type: "string";
|
|
119
|
-
};
|
|
120
|
-
emulation: {
|
|
121
|
-
type: "string";
|
|
122
|
-
enum: string[];
|
|
123
|
-
};
|
|
124
|
-
content: {
|
|
125
|
-
type: "string";
|
|
126
|
-
};
|
|
127
|
-
sources: {
|
|
128
|
-
type: "array";
|
|
129
|
-
items: {
|
|
130
|
-
type: "object";
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
citations: {
|
|
134
|
-
type: "array";
|
|
135
|
-
items: {
|
|
136
|
-
type: "object";
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
images: {
|
|
140
|
-
type: "array";
|
|
141
|
-
items: {
|
|
142
|
-
type: "object";
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
warnings: {
|
|
146
|
-
type: "array";
|
|
147
|
-
items: {
|
|
148
|
-
type: "string";
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
outputBlocks: {
|
|
152
|
-
type: "array";
|
|
153
|
-
items: {
|
|
154
|
-
type: "object";
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
domains: {
|
|
158
|
-
type: "array";
|
|
159
|
-
items: {
|
|
160
|
-
type: "string";
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
lineRange: {
|
|
164
|
-
type: "object";
|
|
165
|
-
};
|
|
166
|
-
requestId: {
|
|
167
|
-
type: "string";
|
|
168
|
-
};
|
|
169
|
-
responseId: {
|
|
170
|
-
type: "string";
|
|
171
|
-
};
|
|
172
|
-
retrievedAt: {
|
|
173
|
-
type: "string";
|
|
174
|
-
};
|
|
175
|
-
truncated: {
|
|
176
|
-
type: "boolean";
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
required: string[];
|
|
180
|
-
additionalProperties: false;
|
|
181
|
-
};
|
|
182
|
-
export declare function normalizeHostedSearchArgs(args: unknown): HostedSearchArgs;
|
|
183
|
-
export declare function buildHostedSearchBody(args: HostedSearchArgs, model: unknown, options?: {
|
|
184
|
-
promptCacheKey?: string;
|
|
185
|
-
}): {
|
|
186
|
-
model: unknown;
|
|
187
|
-
input: {
|
|
188
|
-
role: string;
|
|
189
|
-
content: {
|
|
190
|
-
type: string;
|
|
191
|
-
text: string;
|
|
192
|
-
}[];
|
|
193
|
-
}[];
|
|
194
|
-
tools: {
|
|
195
|
-
type: string;
|
|
196
|
-
search_context_size?: SearchContextSize | undefined;
|
|
197
|
-
filters?: {
|
|
198
|
-
allowed_domains?: string[] | undefined;
|
|
199
|
-
blocked_domains?: string[] | undefined;
|
|
200
|
-
} | undefined;
|
|
201
|
-
user_location?: {
|
|
202
|
-
country?: string;
|
|
203
|
-
city?: string;
|
|
204
|
-
region?: string;
|
|
205
|
-
timezone?: string;
|
|
206
|
-
type: string;
|
|
207
|
-
} | undefined;
|
|
208
|
-
external_web_access?: boolean | undefined;
|
|
209
|
-
return_token_budget?: ReturnTokenBudget | undefined;
|
|
210
|
-
search_content_types?: SearchContentType[] | undefined;
|
|
211
|
-
image_settings?: {
|
|
212
|
-
max_results?: number | undefined;
|
|
213
|
-
caption?: boolean | undefined;
|
|
214
|
-
} | undefined;
|
|
215
|
-
}[];
|
|
216
|
-
tool_choice: string;
|
|
217
|
-
include: string[];
|
|
218
|
-
stream: boolean;
|
|
219
|
-
store: boolean;
|
|
220
|
-
prompt_cache_key?: string | undefined;
|
|
221
|
-
};
|
|
222
|
-
export declare function parseHostedSearchResponse(response: unknown, requestId: string, maxResults?: number, retrievedAt?: string): {
|
|
223
|
-
mode: string;
|
|
224
|
-
action: string;
|
|
225
|
-
emulation: string;
|
|
226
|
-
content: string;
|
|
227
|
-
sources: {
|
|
228
|
-
url: string;
|
|
229
|
-
title?: string | undefined;
|
|
230
|
-
}[];
|
|
231
|
-
citations: Source[];
|
|
232
|
-
images: ImageResult[];
|
|
233
|
-
warnings: string[];
|
|
234
|
-
outputBlocks: import("./web-run-output.js").WebRunBlock[];
|
|
235
|
-
domains: string[];
|
|
236
|
-
lineRange?: {
|
|
237
|
-
first: number;
|
|
238
|
-
last: number;
|
|
239
|
-
} | undefined;
|
|
240
|
-
requestId: string;
|
|
241
|
-
responseId?: string | undefined;
|
|
242
|
-
retrievedAt: string;
|
|
243
|
-
truncated: boolean;
|
|
244
|
-
};
|
|
245
|
-
export declare function renderHostedSearchResult(value: unknown): ContentBlock[];
|
|
246
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { JsonStore } from "./json-store.js";
|
|
2
|
-
declare const VERSION = 1;
|
|
3
|
-
interface RefRecord {
|
|
4
|
-
refId: string;
|
|
5
|
-
url?: string;
|
|
6
|
-
}
|
|
7
|
-
interface SessionRecord {
|
|
8
|
-
routeFingerprint: string;
|
|
9
|
-
updatedAt: string;
|
|
10
|
-
refs: Record<string, RefRecord>;
|
|
11
|
-
}
|
|
12
|
-
interface RefStoreData {
|
|
13
|
-
version: typeof VERSION;
|
|
14
|
-
sessions: Record<string, SessionRecord>;
|
|
15
|
-
}
|
|
16
|
-
export declare class AlphaRefStore {
|
|
17
|
-
readonly store: JsonStore<RefStoreData>;
|
|
18
|
-
constructor(file: string);
|
|
19
|
-
record(sessionId: unknown, routeFingerprint: unknown, refs: unknown): void;
|
|
20
|
-
assertUsable(sessionId: unknown, routeFingerprint: unknown, refId: unknown): RefRecord;
|
|
21
|
-
}
|
|
22
|
-
export {};
|