@omnicross/core 0.2.1 → 0.3.0
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 -21
- package/NOTICE +57 -57
- package/README.md +22 -22
- package/dist/{chunk-MPXOKQJP.cjs → chunk-2RCCLQYV.cjs} +1 -1
- package/dist/{chunk-Y4CRNHJO.js → chunk-4PFWFODB.js} +1 -1
- package/dist/{chunk-HL2YSPL7.cjs → chunk-BTBEJRGL.cjs} +140 -32
- package/dist/{chunk-NLUOTJWB.js → chunk-DXWFBBSK.js} +125 -17
- package/dist/{chunk-LFPQ2OVH.js → chunk-L7O2YQ5O.js} +1 -1
- package/dist/{chunk-D4WNI6BR.cjs → chunk-PTU7SXM3.cjs} +2 -2
- package/dist/completion/BuiltinToolExecutor.cjs +2 -2
- package/dist/completion/BuiltinToolExecutor.js +1 -1
- package/dist/completion/CompletionService.cjs +1 -1
- package/dist/completion/CompletionService.js +1 -1
- package/dist/completion.cjs +2 -2
- package/dist/completion.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/outbound-api.cjs +1 -1
- package/dist/outbound-api.js +1 -1
- package/dist/provider-proxy/ProviderProxy.cjs +1 -1
- package/dist/provider-proxy/ProviderProxy.js +1 -1
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +1 -1
- package/dist/provider-proxy/ingress/providerProxyShared.js +1 -1
- package/dist/provider-proxy.cjs +1 -1
- package/dist/provider-proxy.js +1 -1
- package/dist/runtime-5NCT3J3T.cjs +8 -0
- package/dist/{runtime-M5WXLD2R.js → runtime-JTHUWCBM.js} +2 -2
- package/dist/search/api.cjs +13 -8
- package/dist/search/api.d.cts +16 -1
- package/dist/search/api.d.ts +16 -1
- package/dist/search/api.js +10 -5
- package/dist/search/http.cjs +2 -2
- package/dist/search/http.d.cts +63 -9
- package/dist/search/http.d.ts +63 -9
- package/dist/search/http.js +1 -1
- package/dist/search.cjs +3 -3
- package/dist/search.js +2 -2
- package/package.json +3 -2
- package/dist/runtime-6QXNU526.cjs +0 -8
|
@@ -20,7 +20,11 @@ function searchHttpError(code, message, init) {
|
|
|
20
20
|
retryable: init.retryable,
|
|
21
21
|
cause: init.cause,
|
|
22
22
|
// transport/stage last so a caller-supplied `details` can never shadow them.
|
|
23
|
-
details: {
|
|
23
|
+
details: {
|
|
24
|
+
...init.details,
|
|
25
|
+
transport: init.transport ?? SEARCH_HTTP_TRANSPORT_ID,
|
|
26
|
+
stage: init.stage
|
|
27
|
+
}
|
|
24
28
|
});
|
|
25
29
|
}
|
|
26
30
|
function asSearchProviderError(value, providerId, fallbackStage) {
|
|
@@ -223,18 +227,25 @@ function bingTrustError(query, html) {
|
|
|
223
227
|
if (links.length === 0) return null;
|
|
224
228
|
const terms = meaningfulQueryTerms(query);
|
|
225
229
|
if (terms.length === 0) return null;
|
|
226
|
-
const titleSearchable =
|
|
230
|
+
const titleSearchable = separatorFree(
|
|
231
|
+
links.map((link) => link.textContent ?? "").join(" ").normalize("NFKC").toLocaleLowerCase()
|
|
232
|
+
);
|
|
227
233
|
if (!terms.some((term) => titleSearchable.includes(term))) {
|
|
228
234
|
return "Bing returned an untrusted search result page with zero query-term hits in result titles; refusing to return possible bot-decoy content.";
|
|
229
235
|
}
|
|
230
|
-
const searchable =
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
236
|
+
const searchable = separatorFree(
|
|
237
|
+
links.map((link) => {
|
|
238
|
+
const container = link.closest("li.b_algo, .b_algo");
|
|
239
|
+
return `${link.textContent ?? ""} ${link.getAttribute("href") ?? ""} ${container?.querySelector(".b_caption p, .b_algoSlug, p")?.textContent ?? ""}`;
|
|
240
|
+
}).join(" ").normalize("NFKC").toLocaleLowerCase()
|
|
241
|
+
);
|
|
234
242
|
const coveredTerms = terms.filter((term) => searchable.includes(term));
|
|
235
243
|
const requiredCoverage = terms.length === 1 ? 1 : 2;
|
|
236
244
|
return new Set(coveredTerms).size >= requiredCoverage ? null : "Bing returned an untrusted search result page; refusing to return possible bot-decoy content.";
|
|
237
245
|
}
|
|
246
|
+
function separatorFree(text) {
|
|
247
|
+
return text.replace(/[^\p{L}\p{N}\s]/gu, "");
|
|
248
|
+
}
|
|
238
249
|
function meaningfulQueryTerms(query) {
|
|
239
250
|
const terms = query.normalize("NFKC").toLocaleLowerCase().match(/[\p{L}\p{N}]{2,}/gu) ?? [];
|
|
240
251
|
const expanded = terms.flatMap((term) => {
|
|
@@ -285,8 +296,8 @@ function decoderFor(label) {
|
|
|
285
296
|
}
|
|
286
297
|
|
|
287
298
|
// src/search/http/headers.ts
|
|
288
|
-
var CHROME_VERSION = "
|
|
289
|
-
var CHROME_MAJOR = CHROME_VERSION.split(".")[0];
|
|
299
|
+
var CHROME_VERSION = process.versions.chrome ?? "152.0.7977.65";
|
|
300
|
+
var CHROME_MAJOR = CHROME_VERSION.split(".")[0] || "152";
|
|
290
301
|
var SEARCH_BROWSER_HEADERS = Object.freeze({
|
|
291
302
|
"User-Agent": `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${CHROME_VERSION} Safari/537.36`,
|
|
292
303
|
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
|
|
@@ -306,13 +317,82 @@ function searchBrowserHeaders() {
|
|
|
306
317
|
return { ...SEARCH_BROWSER_HEADERS };
|
|
307
318
|
}
|
|
308
319
|
|
|
320
|
+
// src/search/http/impit.ts
|
|
321
|
+
var IMPIT_BROWSER = "chrome151";
|
|
322
|
+
var IMPERSONATED_HEADERS = [
|
|
323
|
+
"sec-ch-ua",
|
|
324
|
+
"sec-ch-ua-mobile",
|
|
325
|
+
"sec-ch-ua-platform",
|
|
326
|
+
"user-agent"
|
|
327
|
+
];
|
|
328
|
+
var TRANSPORT_KIND = /* @__PURE__ */ Symbol("searchFetchKind");
|
|
329
|
+
function tagFetchKind(error, kind) {
|
|
330
|
+
if (error instanceof Error) {
|
|
331
|
+
error[TRANSPORT_KIND] = kind;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function fetchKindOf(error) {
|
|
335
|
+
return error?.[TRANSPORT_KIND];
|
|
336
|
+
}
|
|
337
|
+
var impitConstructorPromise;
|
|
338
|
+
var impitClients = /* @__PURE__ */ new Map();
|
|
339
|
+
function loadImpitConstructor() {
|
|
340
|
+
impitConstructorPromise ??= import("impit").then((module) => module.Impit).catch(() => void 0);
|
|
341
|
+
return impitConstructorPromise;
|
|
342
|
+
}
|
|
343
|
+
async function getImpitClient(proxyUrl, load = loadImpitConstructor) {
|
|
344
|
+
const ImpitClient = await load();
|
|
345
|
+
if (!ImpitClient) return void 0;
|
|
346
|
+
const key = proxyUrl ?? "<direct>";
|
|
347
|
+
const cached = impitClients.get(key);
|
|
348
|
+
if (cached) return cached;
|
|
349
|
+
const client = new ImpitClient({
|
|
350
|
+
browser: IMPIT_BROWSER,
|
|
351
|
+
followRedirects: false,
|
|
352
|
+
vanillaFallback: false,
|
|
353
|
+
...proxyUrl ? { proxyUrl } : {}
|
|
354
|
+
});
|
|
355
|
+
impitClients.set(key, client);
|
|
356
|
+
return client;
|
|
357
|
+
}
|
|
358
|
+
function withImpersonatedHeaders(init) {
|
|
359
|
+
const headers = new Headers(init.headers);
|
|
360
|
+
for (const name of IMPERSONATED_HEADERS) headers.delete(name);
|
|
361
|
+
return { ...init, headers };
|
|
362
|
+
}
|
|
363
|
+
function proxyConfigToUrl(config) {
|
|
364
|
+
if ("url" in config) {
|
|
365
|
+
try {
|
|
366
|
+
const protocol = new URL(config.url).protocol;
|
|
367
|
+
if (protocol === "http:" || protocol === "https:") return config.url;
|
|
368
|
+
if (protocol === "socks5:" || protocol === "socks5h:") {
|
|
369
|
+
return `socks5h://${config.url.slice(protocol.length + 2)}`;
|
|
370
|
+
}
|
|
371
|
+
return void 0;
|
|
372
|
+
} catch {
|
|
373
|
+
return void 0;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (!config.host || !Number.isFinite(config.port)) return void 0;
|
|
377
|
+
const auth = config.username ? `${encodeURIComponent(config.username)}:${encodeURIComponent(config.password ?? "")}@` : "";
|
|
378
|
+
if (config.type !== "http" && config.type !== "https" && config.type !== "socks5") {
|
|
379
|
+
return void 0;
|
|
380
|
+
}
|
|
381
|
+
const scheme = config.type === "socks5" ? "socks5h" : config.type;
|
|
382
|
+
return `${scheme}://${auth}${config.host}:${config.port}`;
|
|
383
|
+
}
|
|
384
|
+
function impitProxyUrlFrom(resolve, url) {
|
|
385
|
+
const config = resolve?.(url);
|
|
386
|
+
return config ? proxyConfigToUrl(config) : void 0;
|
|
387
|
+
}
|
|
388
|
+
|
|
309
389
|
// src/search/http/transport.ts
|
|
310
390
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
311
391
|
var DEFAULT_MAX_RESPONSE_BYTES = 5 * 1024 * 1024;
|
|
312
392
|
var MAX_REDIRECTS = 5;
|
|
313
393
|
var REFUSED_STATUSES = /* @__PURE__ */ new Set([401, 403, 407, 429]);
|
|
314
394
|
function createSearchHttpTransport(options = {}) {
|
|
315
|
-
const fetchImpl = options.fetch ??
|
|
395
|
+
const fetchImpl = options.fetch ?? createProductionSearchFetch(options);
|
|
316
396
|
const maxRedirects = options.maxRedirects ?? MAX_REDIRECTS;
|
|
317
397
|
const egressPolicy = options.egressPolicy;
|
|
318
398
|
return async (url, request) => {
|
|
@@ -365,6 +445,7 @@ function createSearchHttpTransport(options = {}) {
|
|
|
365
445
|
providerId: context.providerId,
|
|
366
446
|
retryable: true,
|
|
367
447
|
cause: error,
|
|
448
|
+
transport: fetchKindOf(error),
|
|
368
449
|
details: { host: context.host }
|
|
369
450
|
});
|
|
370
451
|
}
|
|
@@ -376,17 +457,43 @@ function createSearchHttpTransport(options = {}) {
|
|
|
376
457
|
};
|
|
377
458
|
}
|
|
378
459
|
var defaultSearchHttpTransport = createSearchHttpTransport();
|
|
379
|
-
function
|
|
460
|
+
function createProductionSearchFetch(options) {
|
|
380
461
|
return async (url, init) => {
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
462
|
+
const client = await getImpitClient(
|
|
463
|
+
impitProxyUrlFrom(options.resolveProxyConfig, url),
|
|
464
|
+
options.loadImpit
|
|
465
|
+
).catch(() => void 0);
|
|
466
|
+
if (client) {
|
|
467
|
+
try {
|
|
468
|
+
return await client.fetch(
|
|
469
|
+
url,
|
|
470
|
+
withImpersonatedHeaders(init)
|
|
471
|
+
);
|
|
472
|
+
} catch (error) {
|
|
473
|
+
tagFetchKind(error, "impit");
|
|
474
|
+
throw error;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
try {
|
|
478
|
+
const dispatcher = selectHttpDispatcher(options.env, url, options.resolveProxyDispatcher);
|
|
479
|
+
const requestInit = dispatcher ? { ...init, dispatcher } : init;
|
|
480
|
+
return await undiciFetch(
|
|
481
|
+
url,
|
|
482
|
+
requestInit
|
|
483
|
+
);
|
|
484
|
+
} catch (error) {
|
|
485
|
+
tagFetchKind(error, "undici");
|
|
486
|
+
throw error;
|
|
487
|
+
}
|
|
388
488
|
};
|
|
389
489
|
}
|
|
490
|
+
function selectHttpDispatcher(env, url, resolveProxyDispatcher) {
|
|
491
|
+
return resolveProxyDispatcher?.(url) ?? envProxyDispatcher(env);
|
|
492
|
+
}
|
|
493
|
+
function envProxyDispatcher(env) {
|
|
494
|
+
const proxy = resolveSearchProxySettings(env);
|
|
495
|
+
return proxy ? getSearchProxyDispatcher(proxy) : void 0;
|
|
496
|
+
}
|
|
390
497
|
async function fetchWithRedirectLimit(fetchImpl, url, signal, maxRedirects, context, egressPolicy) {
|
|
391
498
|
let currentUrl = url;
|
|
392
499
|
assertEgressAllowed(currentUrl, egressPolicy, "connect", context);
|
|
@@ -406,6 +513,7 @@ async function fetchWithRedirectLimit(fetchImpl, url, signal, maxRedirects, cont
|
|
|
406
513
|
providerId: context.providerId,
|
|
407
514
|
retryable: true,
|
|
408
515
|
cause: error,
|
|
516
|
+
transport: fetchKindOf(error),
|
|
409
517
|
details: { host: context.host }
|
|
410
518
|
});
|
|
411
519
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBTBEJRGLcjs = require('./chunk-BTBEJRGL.cjs');
|
|
4
4
|
|
|
5
5
|
// src/search/orchestrator.ts
|
|
6
6
|
var _searchtypes = require('@omnicross/contracts/search-types');
|
|
@@ -345,7 +345,7 @@ function createSearchRuntime(options = {}) {
|
|
|
345
345
|
const registry = new SearchProviderRegistry({
|
|
346
346
|
allowBuiltinOverride: options.allowBuiltinOverride === true
|
|
347
347
|
});
|
|
348
|
-
for (const contribution of _nullishCoalesce(options.contributions, () => (
|
|
348
|
+
for (const contribution of _nullishCoalesce(options.contributions, () => ( _chunkBTBEJRGLcjs.builtinHttpSearchContributions.call(void 0, )))) {
|
|
349
349
|
registry.register(contribution);
|
|
350
350
|
}
|
|
351
351
|
const orchestrator = new SearchOrchestrator(registry, {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk2RCCLQYVcjs = require('../chunk-2RCCLQYV.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.BuiltinToolExecutor =
|
|
12
|
+
exports.BuiltinToolExecutor = _chunk2RCCLQYVcjs.BuiltinToolExecutor; exports.convertBuiltinToolsToAnthropic = _chunk2RCCLQYVcjs.convertBuiltinToolsToAnthropic; exports.convertBuiltinToolsToOpenAI = _chunk2RCCLQYVcjs.convertBuiltinToolsToOpenAI; exports.getBuiltinSearchTools = _chunk2RCCLQYVcjs.getBuiltinSearchTools;
|
|
@@ -58,7 +58,7 @@ require('../chunk-HVBBDBS3.cjs');
|
|
|
58
58
|
require('../chunk-NKVZ6Z3Y.cjs');
|
|
59
59
|
require('../chunk-UPQIWJIE.cjs');
|
|
60
60
|
require('../chunk-G4CZIUIB.cjs');
|
|
61
|
-
require('../chunk-
|
|
61
|
+
require('../chunk-2RCCLQYV.cjs');
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
exports.CompletionService = _chunkVSYQ6XYNcjs.CompletionService;
|
package/dist/completion.cjs
CHANGED
|
@@ -88,7 +88,7 @@ require('./chunk-G4CZIUIB.cjs');
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
var
|
|
91
|
+
var _chunk2RCCLQYVcjs = require('./chunk-2RCCLQYV.cjs');
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
|
|
@@ -116,4 +116,4 @@ var _chunkMPXOKQJPcjs = require('./chunk-MPXOKQJP.cjs');
|
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
exports.BuiltinToolExecutor =
|
|
119
|
+
exports.BuiltinToolExecutor = _chunk2RCCLQYVcjs.BuiltinToolExecutor; exports.CompletionService = _chunkVSYQ6XYNcjs.CompletionService; exports.NATIVE_SEARCH_TOOL_NAMES = _chunkGMMT7RVNcjs.NATIVE_SEARCH_TOOL_NAMES; exports.addOpenRouterProviderToRequest = _chunkVSYQ6XYNcjs.addOpenRouterProviderToRequest; exports.applyAugmentation = _chunkJMJBSACDcjs.applyAugmentation; exports.attachStreamEventBuffer = _chunkVSYQ6XYNcjs.attach; exports.buildAnthropicApiUrl = _chunkA2YMUCBTcjs.buildAnthropicApiUrl; exports.buildAzureOpenAIApiUrl = _chunkA2YMUCBTcjs.buildAzureOpenAIApiUrl; exports.buildGeminiApiUrl = _chunkA2YMUCBTcjs.buildGeminiApiUrl; exports.buildNativeSearchAugmentation = _chunkJMJBSACDcjs.buildNativeSearchAugmentation; exports.buildOpenAIApiUrl = _chunkA2YMUCBTcjs.buildOpenAIApiUrl; exports.buildOpenAIResponseApiUrl = _chunkA2YMUCBTcjs.buildOpenAIResponseApiUrl; exports.buildProviderApiUrl = _chunkA2YMUCBTcjs.buildProviderApiUrl; exports.convertMessageToAnthropic = _chunkVSYQ6XYNcjs.convertMessageToAnthropic; exports.convertMessageToGemini = _chunkVSYQ6XYNcjs.convertMessageToGemini; exports.convertMessageToOpenAI = _chunkVSYQ6XYNcjs.convertMessageToOpenAI; exports.detectNativeSearch = _chunkJMJBSACDcjs.detectNativeSearch; exports.emitStreamEvent = _chunkVSYQ6XYNcjs.emit; exports.getBuiltinSearchTools = _chunk2RCCLQYVcjs.getBuiltinSearchTools; exports.getOpenRouterProviderConfig = _chunkVSYQ6XYNcjs.getOpenRouterProviderConfig; exports.getProviderHeaders = _chunkOIKREZVQcjs.getProviderHeaders; exports.normalizeAzureEndpoint = _chunkA2YMUCBTcjs.normalizeAzureEndpoint; exports.registerStreamEventBuffer = _chunkVSYQ6XYNcjs.register; exports.releaseStreamEventBuffer = _chunkVSYQ6XYNcjs.release; exports.resolveApiFormat = _chunkA2YMUCBTcjs.resolveApiFormat; exports.resolveProviderEndpoint = _chunkA2YMUCBTcjs.resolveProviderEndpoint;
|
package/dist/completion.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -299,7 +299,7 @@ var _chunkG4CZIUIBcjs = require('./chunk-G4CZIUIB.cjs');
|
|
|
299
299
|
|
|
300
300
|
|
|
301
301
|
|
|
302
|
-
var
|
|
302
|
+
var _chunk2RCCLQYVcjs = require('./chunk-2RCCLQYV.cjs');
|
|
303
303
|
|
|
304
304
|
|
|
305
305
|
|
|
@@ -521,4 +521,4 @@ var _chunkMPXOKQJPcjs = require('./chunk-MPXOKQJP.cjs');
|
|
|
521
521
|
|
|
522
522
|
|
|
523
523
|
|
|
524
|
-
exports.AUDIT_REDACTED = _chunkHCOQQAZEcjs.AUDIT_REDACTED; exports.BoundAccountSelectionError = _chunk25GXJCEZcjs.BoundAccountSelectionError; exports.BuiltinToolExecutor = _chunkMPXOKQJPcjs.BuiltinToolExecutor; exports.CompletionService = _chunkVSYQ6XYNcjs.CompletionService; exports.ConcurrencyQueueFullError = _chunkVSYQ6XYNcjs.ConcurrencyQueueFullError; exports.ConcurrencyWaitCancelledError = _chunkVSYQ6XYNcjs.ConcurrencyWaitCancelledError; exports.ConcurrencyWaitTimeoutError = _chunkVSYQ6XYNcjs.ConcurrencyWaitTimeoutError; exports.DEFAULT_ACCOUNT_PROBE = _chunkVSYQ6XYNcjs.DEFAULT_ACCOUNT_PROBE; exports.DEFAULT_ALLOWANCE_SCHEDULING = _chunkVSYQ6XYNcjs.DEFAULT_ALLOWANCE_SCHEDULING; exports.DEFAULT_CONCURRENCY_QUEUE = _chunkVSYQ6XYNcjs.DEFAULT_CONCURRENCY_QUEUE; exports.DEFAULT_FINGERPRINT = _chunkVSYQ6XYNcjs.DEFAULT_FINGERPRINT; exports.DEFAULT_IMAGES_SERVER_CONFIG = _chunkVSYQ6XYNcjs.DEFAULT_IMAGES_SERVER_CONFIG; exports.DEFAULT_IMAGE_API_LIMITS = _chunkUPQIWJIEcjs.DEFAULT_IMAGE_API_LIMITS; exports.DEFAULT_OUTBOUND_PORT = _chunkVSYQ6XYNcjs.DEFAULT_OUTBOUND_PORT; exports.DEFAULT_ROUTE_IDLE_MS = _chunkVSYQ6XYNcjs.DEFAULT_ROUTE_IDLE_MS; exports.DEFAULT_SEARCH_SERVER_CONFIG = _chunkVSYQ6XYNcjs.DEFAULT_SEARCH_SERVER_CONFIG; exports.DEFAULT_USER_MESSAGE_QUEUE = _chunkVSYQ6XYNcjs.DEFAULT_USER_MESSAGE_QUEUE; exports.ENDPOINT_MODEL_KINDS = _chunk4IH4EL7Mcjs.ENDPOINT_MODEL_KINDS; exports.IMAGE_REQUEST_DIRECTORY_MARKER_CONTENT = _chunkUPQIWJIEcjs.IMAGE_REQUEST_DIRECTORY_MARKER_CONTENT; exports.IMAGE_REQUEST_DIRECTORY_MARKER_NAME = _chunkUPQIWJIEcjs.IMAGE_REQUEST_DIRECTORY_MARKER_NAME; exports.IMAGE_SERVER_HARD_CEILINGS = _chunkVSYQ6XYNcjs.IMAGE_SERVER_HARD_CEILINGS; exports.ImageGenerationError = _chunkUPQIWJIEcjs.ImageGenerationError; exports.ImageOrchestrator = _chunkUPQIWJIEcjs.ImageOrchestrator; exports.ImageProviderRegistry = _chunkUPQIWJIEcjs.ImageProviderRegistry; exports.ImageRequestResourceScope = _chunkUPQIWJIEcjs.ImageRequestResourceScope; exports.InMemoryImageAsset = _chunkUPQIWJIEcjs.InMemoryImageAsset; exports.InMemoryImageReferenceStore = _chunkUPQIWJIEcjs.InMemoryImageReferenceStore; exports.InMemoryResponsesImageStateStore = _chunkUPQIWJIEcjs.InMemoryResponsesImageStateStore; exports.KeySpendTracker = _chunkVSYQ6XYNcjs.KeySpendTracker; exports.KeyedMutex = _chunkVSYQ6XYNcjs.KeyedMutex; exports.LEGACY_OUTBOUND_PERMISSIONS = _chunkVSYQ6XYNcjs.LEGACY_OUTBOUND_PERMISSIONS; exports.NATIVE_SEARCH_TOOL_NAMES = _chunkGMMT7RVNcjs.NATIVE_SEARCH_TOOL_NAMES; exports.OPENROUTER_APP_HEADERS = _chunkUNEFIWXIcjs.OPENROUTER_APP_HEADERS; exports.OUTBOUND_API_SERVER_CONFIG_KEY = _chunkVSYQ6XYNcjs.OUTBOUND_API_SERVER_CONFIG_KEY; exports.OpenAIOperationError = _chunkG4CZIUIBcjs.OpenAIOperationError; exports.OpenAIOperationRegistrationError = _chunkG4CZIUIBcjs.OpenAIOperationRegistrationError; exports.OpenAIOperationRegistry = _chunkG4CZIUIBcjs.OpenAIOperationRegistry; exports.OutboundApiServer = _chunkVSYQ6XYNcjs.OutboundApiServer; exports.OutboundConcurrencyGate = _chunkVSYQ6XYNcjs.OutboundConcurrencyGate; exports.OutboundRateLimiter = _chunkVSYQ6XYNcjs.OutboundRateLimiter; exports.PricingEngine = _chunk2E42SAW3cjs.PricingEngine; exports.ProviderProxy = _chunkVSYQ6XYNcjs.ProviderProxy; exports.ProviderProxyRouteMap = _chunkVSYQ6XYNcjs.ProviderProxyRouteMap; exports.ROUTE_LEASE_API_VERSION = _chunkVSYQ6XYNcjs.ROUTE_LEASE_API_VERSION; exports.ROUTE_LEASE_CAPABILITIES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_CAPABILITIES; exports.ROUTE_LEASE_CAPABILITIES_SCHEMA = _chunkVSYQ6XYNcjs.ROUTE_LEASE_CAPABILITIES_SCHEMA; exports.ROUTE_LEASE_CODEX_TOKEN_ENV = _chunkVSYQ6XYNcjs.ROUTE_LEASE_CODEX_TOKEN_ENV; exports.ROUTE_LEASE_DEFAULT_TTL_SECONDS = _chunkVSYQ6XYNcjs.ROUTE_LEASE_DEFAULT_TTL_SECONDS; exports.ROUTE_LEASE_MAX_CONSUMER_BYTES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_CONSUMER_BYTES; exports.ROUTE_LEASE_MAX_EXECUTION_ID_BYTES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_EXECUTION_ID_BYTES; exports.ROUTE_LEASE_MAX_IDEMPOTENCY_BYTES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_IDEMPOTENCY_BYTES; exports.ROUTE_LEASE_MAX_MODEL_BYTES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_MODEL_BYTES; exports.ROUTE_LEASE_MAX_SESSION_ID_BYTES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_SESSION_ID_BYTES; exports.ROUTE_LEASE_MAX_TTL_SECONDS = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_TTL_SECONDS; exports.ROUTE_LEASE_REQUEST_SCHEMA = _chunkVSYQ6XYNcjs.ROUTE_LEASE_REQUEST_SCHEMA; exports.ROUTE_LEASE_RESULT_SCHEMA = _chunkVSYQ6XYNcjs.ROUTE_LEASE_RESULT_SCHEMA; exports.ROUTE_LEASE_RUNTIMES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_RUNTIMES; exports.ROUTE_LEASE_RUNTIME_TABLE = _chunkVSYQ6XYNcjs.ROUTE_LEASE_RUNTIME_TABLE; exports.ROUTE_LEASE_SESSION_HASH_DOMAIN = _chunkVSYQ6XYNcjs.ROUTE_LEASE_SESSION_HASH_DOMAIN; exports.ResponsesAffinityStore = _chunkVSYQ6XYNcjs.ResponsesAffinityStore; exports.RouteLeaseError = _chunkVSYQ6XYNcjs.RouteLeaseError; exports.RouteLeaseManager = _chunkVSYQ6XYNcjs.RouteLeaseManager; exports.RouteLeaseTargetResolver = _chunkVSYQ6XYNcjs.RouteLeaseTargetResolver; exports.SUBSCRIPTION_PROVIDER_IDS = _chunkT6NWPIYZcjs.SUBSCRIPTION_PROVIDER_IDS; exports.SYSTEM_ROUTE_LEASE_CLOCK = _chunkVSYQ6XYNcjs.SYSTEM_ROUTE_LEASE_CLOCK; exports.SerialQueueTimeoutError = _chunkVSYQ6XYNcjs.SerialQueueTimeoutError; exports.TransformerChainExecutor = _chunk7ZHBN75Ncjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.UsageRecorder = _chunk5UK3KLE2cjs.UsageRecorder; exports.UserMessageSerialQueue = _chunkVSYQ6XYNcjs.UserMessageSerialQueue; exports.__resetOutboundApiServerForTests = _chunkVSYQ6XYNcjs.__resetOutboundApiServerForTests; exports.__resetProviderProxyForTests = _chunkVSYQ6XYNcjs.__resetProviderProxyForTests; exports.addOpenRouterProviderToRequest = _chunkVSYQ6XYNcjs.addOpenRouterProviderToRequest; exports.applyAugmentation = _chunkJMJBSACDcjs.applyAugmentation; exports.assertFiniteImageApiLimits = _chunkUPQIWJIEcjs.assertFiniteImageApiLimits; exports.attachStreamEventBuffer = _chunkVSYQ6XYNcjs.attach; exports.beginAuditCapture = _chunkFX325I5Qcjs.beginAuditCapture; exports.beginBillingCapture = _chunkAPYG5QD7cjs.beginBillingCapture; exports.boundAccountSelectionMessage = _chunk25GXJCEZcjs.boundAccountSelectionMessage; exports.buildAnthropicApiUrl = _chunkA2YMUCBTcjs.buildAnthropicApiUrl; exports.buildAzureOpenAIApiUrl = _chunkA2YMUCBTcjs.buildAzureOpenAIApiUrl; exports.buildGeminiApiUrl = _chunkA2YMUCBTcjs.buildGeminiApiUrl; exports.buildNativeSearchAugmentation = _chunkJMJBSACDcjs.buildNativeSearchAugmentation; exports.buildOpenAIApiUrl = _chunkA2YMUCBTcjs.buildOpenAIApiUrl; exports.buildOpenAIResponseApiUrl = _chunkA2YMUCBTcjs.buildOpenAIResponseApiUrl; exports.buildProviderApiUrl = _chunkA2YMUCBTcjs.buildProviderApiUrl; exports.candidateBackgroundModelIds = _chunkVSYQ6XYNcjs.candidateBackgroundModelIds; exports.candidateGatewayBindings = _chunkVSYQ6XYNcjs.candidateGatewayBindings; exports.canonicalizeRouteLeasePayload = _chunkVSYQ6XYNcjs.canonicalizeRouteLeasePayload; exports.checkKeyQuota = _chunkVSYQ6XYNcjs.checkKeyQuota; exports.classifyModelPrefix = _chunkT6NWPIYZcjs.classifyModelPrefix; exports.classifyOpenAIOperation = _chunkG4CZIUIBcjs.classifyOpenAIOperation; exports.classifyResponsesProfile = _chunkVSYQ6XYNcjs.classifyResponsesProfile; exports.codexSearchRoutePath = _chunkVSYQ6XYNcjs.codexSearchRoutePath; exports.computeKeyExpiry = _chunkVSYQ6XYNcjs.computeKeyExpiry; exports.computeVoucherGrant = _chunkVSYQ6XYNcjs.computeVoucherGrant; exports.convertAnthropicRequestToOpenAI = _chunkGDIXXKF2cjs.convertAnthropicRequestToOpenAI; exports.convertAnthropicStreamToOpenAI = _chunkGDIXXKF2cjs.convertAnthropicStreamToOpenAI; exports.convertAnthropicToOpenAI = _chunkGDIXXKF2cjs.convertAnthropicToOpenAI; exports.convertAnthropicToOpenAIWithThinking = _chunkGDIXXKF2cjs.convertAnthropicToOpenAIWithThinking; exports.convertMessageToAnthropic = _chunkVSYQ6XYNcjs.convertMessageToAnthropic; exports.convertMessageToGemini = _chunkVSYQ6XYNcjs.convertMessageToGemini; exports.convertMessageToOpenAI = _chunkVSYQ6XYNcjs.convertMessageToOpenAI; exports.convertOpenAIResponseToAnthropic = _chunkGDIXXKF2cjs.convertOpenAIResponseToAnthropic; exports.convertOpenAIStreamToAnthropic = _chunkGDIXXKF2cjs.convertOpenAIStreamToAnthropic; exports.convertOpenAIToAnthropic = _chunkGDIXXKF2cjs.convertOpenAIToAnthropic; exports.convertOpenAIToAnthropicWithThinking = _chunkGDIXXKF2cjs.convertOpenAIToAnthropicWithThinking; exports.createImageApiContributions = _chunkUPQIWJIEcjs.createImageApiContributions; exports.createImageRequestResourceScope = _chunkUPQIWJIEcjs.createImageRequestResourceScope; exports.createIntegrationKey = _chunkVSYQ6XYNcjs.createIntegrationKey; exports.createNamedKey = _chunkVSYQ6XYNcjs.createNamedKey; exports.createNativeResponsesHostedImageIngress = _chunkVSYQ6XYNcjs.createNativeResponsesHostedImageIngress; exports.createResponsesCompactHandler = _chunkVSYQ6XYNcjs.createResponsesCompactHandler; exports.createResponsesImageGenerationContribution = _chunkUPQIWJIEcjs.createResponsesImageGenerationContribution; exports.createSSEParser = _chunkHQP3K7PUcjs.createSSEParser; exports.createSafeRemoteImageResolver = _chunkUPQIWJIEcjs.createSafeRemoteImageResolver; exports.defaultServerConfig = _chunkVSYQ6XYNcjs.defaultServerConfig; exports.detectModelKind = _chunkT6NWPIYZcjs.detectModelKind; exports.detectNativeSearch = _chunkJMJBSACDcjs.detectNativeSearch; exports.detectRequestRole = _chunkT6NWPIYZcjs.detectRequestRole; exports.effectiveOutboundPermissions = _chunkVSYQ6XYNcjs.effectiveOutboundPermissions; exports.emitImageTelemetry = _chunkUPQIWJIEcjs.emitImageTelemetry; exports.emitStreamEvent = _chunkVSYQ6XYNcjs.emit; exports.endpointSupportsSubscription = _chunkT6NWPIYZcjs.endpointSupportsSubscription; exports.endpointToIngressFormat = _chunkT6NWPIYZcjs.endpointToIngressFormat; exports.extractRouteToken = _chunkVSYQ6XYNcjs.extractRouteToken; exports.formatUrls = _chunkVSYQ6XYNcjs.formatUrls; exports.gatewayBindingToEndpointConfig = _chunkVSYQ6XYNcjs.gatewayBindingToEndpointConfig; exports.generateVoucherCode = _chunkVSYQ6XYNcjs.generateVoucherCode; exports.getBuiltinSearchTools = _chunkMPXOKQJPcjs.getBuiltinSearchTools; exports.getOpenAIOperation = _chunkG4CZIUIBcjs.getOpenAIOperation; exports.getOpenRouterAppIdentity = _chunkUNEFIWXIcjs.getOpenRouterAppIdentity; exports.getOpenRouterProviderConfig = _chunkVSYQ6XYNcjs.getOpenRouterProviderConfig; exports.getOutboundApiServer = _chunkVSYQ6XYNcjs.getOutboundApiServer; exports.getProviderHeaders = _chunkOIKREZVQcjs.getProviderHeaders; exports.getProviderProxy = _chunkVSYQ6XYNcjs.getProviderProxy; exports.getResponsesAffinityStore = _chunkVSYQ6XYNcjs.getResponsesAffinityStore; exports.handleCodexSearchRequest = _chunkVSYQ6XYNcjs.handleCodexSearchRequest; exports.handleVoucherRedeem = _chunkVSYQ6XYNcjs.handleVoucherRedeem; exports.hasImageContent = _chunkGDIXXKF2cjs.hasImageContent; exports.hasThinkingEnabled = _chunkGDIXXKF2cjs.hasThinkingEnabled; exports.hashKey = _chunkVSYQ6XYNcjs.hashKey; exports.hashRouteLeasePayload = _chunkVSYQ6XYNcjs.hashRouteLeasePayload; exports.hashRouteLeaseSessionId = _chunkVSYQ6XYNcjs.hashRouteLeaseSessionId; exports.hashVoucherCode = _chunkVSYQ6XYNcjs.hashVoucherCode; exports.imageGenerationErrorFromPublic = _chunkUPQIWJIEcjs.imageGenerationErrorFromPublic; exports.inspectResponsesImageRequest = _chunkUPQIWJIEcjs.inspectResponsesImageRequest; exports.isBoundAccountSelectionError = _chunk25GXJCEZcjs.isBoundAccountSelectionError; exports.isCodexSearchRequest = _chunkVSYQ6XYNcjs.isCodexSearchRequest; exports.isConcurrencyRejection = _chunkVSYQ6XYNcjs.isConcurrencyRejection; exports.isImageGenerationError = _chunkUPQIWJIEcjs.isImageGenerationError; exports.isKindMappedEndpoint = _chunkT6NWPIYZcjs.isKindMappedEndpoint; exports.isLoopbackAddress = _chunkVSYQ6XYNcjs.isLoopbackAddress; exports.isOpenRouterProvider = _chunkUNEFIWXIcjs.isOpenRouterProvider; exports.isRedeemRequest = _chunkVSYQ6XYNcjs.isRedeemRequest; exports.isSerialQueueTimeout = _chunkVSYQ6XYNcjs.isSerialQueueTimeout; exports.isSubscriptionProviderId = _chunkT6NWPIYZcjs.isSubscriptionProviderId; exports.isUserMessageRequest = _chunkVSYQ6XYNcjs.isUserMessageRequest; exports.legacyEndpointsToBindings = _chunkVSYQ6XYNcjs.legacyEndpointsToBindings; exports.loadServerConfig = _chunkVSYQ6XYNcjs.loadServerConfig; exports.mergeServerConfig = _chunkVSYQ6XYNcjs.mergeServerConfig; exports.modelKindsForEndpoint = _chunkT6NWPIYZcjs.modelKindsForEndpoint; exports.newVoucherId = _chunkVSYQ6XYNcjs.newVoucherId; exports.normalizeAccountProbe = _chunkVSYQ6XYNcjs.normalizeAccountProbe; exports.normalizeAllowanceScheduling = _chunkVSYQ6XYNcjs.normalizeAllowanceScheduling; exports.normalizeAudit = _chunkVSYQ6XYNcjs.normalizeAudit; exports.normalizeAzureEndpoint = _chunkA2YMUCBTcjs.normalizeAzureEndpoint; exports.normalizeBilling = _chunkVSYQ6XYNcjs.normalizeBilling; exports.normalizeFingerprint = _chunkVSYQ6XYNcjs.normalizeFingerprint; exports.normalizeGatewayBindings = _chunkVSYQ6XYNcjs.normalizeGatewayBindings; exports.normalizeImageGenerationError = _chunkUPQIWJIEcjs.normalizeImageGenerationError; exports.normalizeImagesServerConfig = _chunkVSYQ6XYNcjs.normalizeImagesServerConfig; exports.normalizePrefixTargets = _chunkVSYQ6XYNcjs.normalizePrefixTargets; exports.normalizeProxyConfig = _chunkVSYQ6XYNcjs.normalizeProxyConfig; exports.normalizeProxySegment = _chunkVSYQ6XYNcjs.normalizeProxySegment; exports.normalizeQueueSegments = _chunkVSYQ6XYNcjs.normalizeQueueSegments; exports.normalizeRouteLeaseIdempotencyKey = _chunkVSYQ6XYNcjs.normalizeRouteLeaseIdempotencyKey; exports.normalizeRouteLeaseTtl = _chunkVSYQ6XYNcjs.normalizeRouteLeaseTtl; exports.normalizeSearchApiProviderConfigs = _chunkVSYQ6XYNcjs.normalizeSearchApiProviderConfigs; exports.normalizeSearchServerConfig = _chunkVSYQ6XYNcjs.normalizeSearchServerConfig; exports.normalizeServerConfig = _chunkVSYQ6XYNcjs.normalizeServerConfig; exports.normalizeVoucher = _chunkVSYQ6XYNcjs.normalizeVoucher; exports.normalizeWebhookDestination = _chunkVSYQ6XYNcjs.normalizeWebhookDestination; exports.normalizeWebhookSegment = _chunkVSYQ6XYNcjs.normalizeWebhookSegment; exports.parseModelRef = _chunkT6NWPIYZcjs.parseModelRef; exports.parseRouteLeaseCreate = _chunkVSYQ6XYNcjs.parseRouteLeaseCreate; exports.pickModelRefFromList = _chunkT6NWPIYZcjs.pickModelRefFromList; exports.previousResponseNotFound = _chunkVSYQ6XYNcjs.previousResponseNotFound; exports.randomBase62 = _chunkVSYQ6XYNcjs.randomBase62; exports.readImageAssetBytes = _chunkUPQIWJIEcjs.readImageAssetBytes; exports.redactAuditText = _chunkHCOQQAZEcjs.redactAuditText; exports.registerBuiltinTransformers = _chunkZAPN7XA6cjs.registerBuiltinTransformers; exports.registerResponsesCompactOperation = _chunkVSYQ6XYNcjs.registerResponsesCompactOperation; exports.registerStreamEventBuffer = _chunkVSYQ6XYNcjs.register; exports.releaseStreamEventBuffer = _chunkVSYQ6XYNcjs.release; exports.resolveApiFormat = _chunkA2YMUCBTcjs.resolveApiFormat; exports.resolveGatewayBinding = _chunkVSYQ6XYNcjs.resolveGatewayBinding; exports.resolveImageCapabilities = _chunkUPQIWJIEcjs.resolveImageCapabilities; exports.resolvePrefixTarget = _chunkT6NWPIYZcjs.resolvePrefixTarget; exports.resolveProviderEndpoint = _chunkA2YMUCBTcjs.resolveProviderEndpoint; exports.resolveRoute = _chunkT6NWPIYZcjs.resolveRoute; exports.routeLeaseRuntime = _chunkVSYQ6XYNcjs.routeLeaseRuntime; exports.saveServerConfig = _chunkVSYQ6XYNcjs.saveServerConfig; exports.serializeError = _chunkSVNDB62Dcjs.serializeError; exports.serializeImageGenerationError = _chunkUPQIWJIEcjs.serializeImageGenerationError; exports.setOpenRouterAppIdentity = _chunkUNEFIWXIcjs.setOpenRouterAppIdentity; exports.startOfLocalDay = _chunkVSYQ6XYNcjs.startOfLocalDay; exports.startOfLocalWeek = _chunkVSYQ6XYNcjs.startOfLocalWeek; exports.streamSSEResponse = _chunkHQP3K7PUcjs.streamSSEResponse; exports.toVoucherInfo = _chunkVSYQ6XYNcjs.toVoucherInfo; exports.unsupportedOpenAIOperation = _chunkG4CZIUIBcjs.unsupportedOpenAIOperation; exports.validateEndpointModelConfig = _chunkT6NWPIYZcjs.validateEndpointModelConfig; exports.validateImagesServerConfig = _chunkVSYQ6XYNcjs.validateImagesServerConfig; exports.validateOutboundPermissions = _chunkVSYQ6XYNcjs.validateOutboundPermissions; exports.validateResponsesImageSelection = _chunkUPQIWJIEcjs.validateResponsesImageSelection; exports.validateSearchServerConfig = _chunkVSYQ6XYNcjs.validateSearchServerConfig; exports.verifyKey = _chunkVSYQ6XYNcjs.verifyKey; exports.verifyPresentedKey = _chunkVSYQ6XYNcjs.verifyPresentedKey; exports.voucherCodePrefix = _chunkVSYQ6XYNcjs.voucherCodePrefix; exports.writeOpenAIOperationError = _chunkG4CZIUIBcjs.writeOpenAIOperationError;
|
|
524
|
+
exports.AUDIT_REDACTED = _chunkHCOQQAZEcjs.AUDIT_REDACTED; exports.BoundAccountSelectionError = _chunk25GXJCEZcjs.BoundAccountSelectionError; exports.BuiltinToolExecutor = _chunk2RCCLQYVcjs.BuiltinToolExecutor; exports.CompletionService = _chunkVSYQ6XYNcjs.CompletionService; exports.ConcurrencyQueueFullError = _chunkVSYQ6XYNcjs.ConcurrencyQueueFullError; exports.ConcurrencyWaitCancelledError = _chunkVSYQ6XYNcjs.ConcurrencyWaitCancelledError; exports.ConcurrencyWaitTimeoutError = _chunkVSYQ6XYNcjs.ConcurrencyWaitTimeoutError; exports.DEFAULT_ACCOUNT_PROBE = _chunkVSYQ6XYNcjs.DEFAULT_ACCOUNT_PROBE; exports.DEFAULT_ALLOWANCE_SCHEDULING = _chunkVSYQ6XYNcjs.DEFAULT_ALLOWANCE_SCHEDULING; exports.DEFAULT_CONCURRENCY_QUEUE = _chunkVSYQ6XYNcjs.DEFAULT_CONCURRENCY_QUEUE; exports.DEFAULT_FINGERPRINT = _chunkVSYQ6XYNcjs.DEFAULT_FINGERPRINT; exports.DEFAULT_IMAGES_SERVER_CONFIG = _chunkVSYQ6XYNcjs.DEFAULT_IMAGES_SERVER_CONFIG; exports.DEFAULT_IMAGE_API_LIMITS = _chunkUPQIWJIEcjs.DEFAULT_IMAGE_API_LIMITS; exports.DEFAULT_OUTBOUND_PORT = _chunkVSYQ6XYNcjs.DEFAULT_OUTBOUND_PORT; exports.DEFAULT_ROUTE_IDLE_MS = _chunkVSYQ6XYNcjs.DEFAULT_ROUTE_IDLE_MS; exports.DEFAULT_SEARCH_SERVER_CONFIG = _chunkVSYQ6XYNcjs.DEFAULT_SEARCH_SERVER_CONFIG; exports.DEFAULT_USER_MESSAGE_QUEUE = _chunkVSYQ6XYNcjs.DEFAULT_USER_MESSAGE_QUEUE; exports.ENDPOINT_MODEL_KINDS = _chunk4IH4EL7Mcjs.ENDPOINT_MODEL_KINDS; exports.IMAGE_REQUEST_DIRECTORY_MARKER_CONTENT = _chunkUPQIWJIEcjs.IMAGE_REQUEST_DIRECTORY_MARKER_CONTENT; exports.IMAGE_REQUEST_DIRECTORY_MARKER_NAME = _chunkUPQIWJIEcjs.IMAGE_REQUEST_DIRECTORY_MARKER_NAME; exports.IMAGE_SERVER_HARD_CEILINGS = _chunkVSYQ6XYNcjs.IMAGE_SERVER_HARD_CEILINGS; exports.ImageGenerationError = _chunkUPQIWJIEcjs.ImageGenerationError; exports.ImageOrchestrator = _chunkUPQIWJIEcjs.ImageOrchestrator; exports.ImageProviderRegistry = _chunkUPQIWJIEcjs.ImageProviderRegistry; exports.ImageRequestResourceScope = _chunkUPQIWJIEcjs.ImageRequestResourceScope; exports.InMemoryImageAsset = _chunkUPQIWJIEcjs.InMemoryImageAsset; exports.InMemoryImageReferenceStore = _chunkUPQIWJIEcjs.InMemoryImageReferenceStore; exports.InMemoryResponsesImageStateStore = _chunkUPQIWJIEcjs.InMemoryResponsesImageStateStore; exports.KeySpendTracker = _chunkVSYQ6XYNcjs.KeySpendTracker; exports.KeyedMutex = _chunkVSYQ6XYNcjs.KeyedMutex; exports.LEGACY_OUTBOUND_PERMISSIONS = _chunkVSYQ6XYNcjs.LEGACY_OUTBOUND_PERMISSIONS; exports.NATIVE_SEARCH_TOOL_NAMES = _chunkGMMT7RVNcjs.NATIVE_SEARCH_TOOL_NAMES; exports.OPENROUTER_APP_HEADERS = _chunkUNEFIWXIcjs.OPENROUTER_APP_HEADERS; exports.OUTBOUND_API_SERVER_CONFIG_KEY = _chunkVSYQ6XYNcjs.OUTBOUND_API_SERVER_CONFIG_KEY; exports.OpenAIOperationError = _chunkG4CZIUIBcjs.OpenAIOperationError; exports.OpenAIOperationRegistrationError = _chunkG4CZIUIBcjs.OpenAIOperationRegistrationError; exports.OpenAIOperationRegistry = _chunkG4CZIUIBcjs.OpenAIOperationRegistry; exports.OutboundApiServer = _chunkVSYQ6XYNcjs.OutboundApiServer; exports.OutboundConcurrencyGate = _chunkVSYQ6XYNcjs.OutboundConcurrencyGate; exports.OutboundRateLimiter = _chunkVSYQ6XYNcjs.OutboundRateLimiter; exports.PricingEngine = _chunk2E42SAW3cjs.PricingEngine; exports.ProviderProxy = _chunkVSYQ6XYNcjs.ProviderProxy; exports.ProviderProxyRouteMap = _chunkVSYQ6XYNcjs.ProviderProxyRouteMap; exports.ROUTE_LEASE_API_VERSION = _chunkVSYQ6XYNcjs.ROUTE_LEASE_API_VERSION; exports.ROUTE_LEASE_CAPABILITIES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_CAPABILITIES; exports.ROUTE_LEASE_CAPABILITIES_SCHEMA = _chunkVSYQ6XYNcjs.ROUTE_LEASE_CAPABILITIES_SCHEMA; exports.ROUTE_LEASE_CODEX_TOKEN_ENV = _chunkVSYQ6XYNcjs.ROUTE_LEASE_CODEX_TOKEN_ENV; exports.ROUTE_LEASE_DEFAULT_TTL_SECONDS = _chunkVSYQ6XYNcjs.ROUTE_LEASE_DEFAULT_TTL_SECONDS; exports.ROUTE_LEASE_MAX_CONSUMER_BYTES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_CONSUMER_BYTES; exports.ROUTE_LEASE_MAX_EXECUTION_ID_BYTES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_EXECUTION_ID_BYTES; exports.ROUTE_LEASE_MAX_IDEMPOTENCY_BYTES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_IDEMPOTENCY_BYTES; exports.ROUTE_LEASE_MAX_MODEL_BYTES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_MODEL_BYTES; exports.ROUTE_LEASE_MAX_SESSION_ID_BYTES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_SESSION_ID_BYTES; exports.ROUTE_LEASE_MAX_TTL_SECONDS = _chunkVSYQ6XYNcjs.ROUTE_LEASE_MAX_TTL_SECONDS; exports.ROUTE_LEASE_REQUEST_SCHEMA = _chunkVSYQ6XYNcjs.ROUTE_LEASE_REQUEST_SCHEMA; exports.ROUTE_LEASE_RESULT_SCHEMA = _chunkVSYQ6XYNcjs.ROUTE_LEASE_RESULT_SCHEMA; exports.ROUTE_LEASE_RUNTIMES = _chunkVSYQ6XYNcjs.ROUTE_LEASE_RUNTIMES; exports.ROUTE_LEASE_RUNTIME_TABLE = _chunkVSYQ6XYNcjs.ROUTE_LEASE_RUNTIME_TABLE; exports.ROUTE_LEASE_SESSION_HASH_DOMAIN = _chunkVSYQ6XYNcjs.ROUTE_LEASE_SESSION_HASH_DOMAIN; exports.ResponsesAffinityStore = _chunkVSYQ6XYNcjs.ResponsesAffinityStore; exports.RouteLeaseError = _chunkVSYQ6XYNcjs.RouteLeaseError; exports.RouteLeaseManager = _chunkVSYQ6XYNcjs.RouteLeaseManager; exports.RouteLeaseTargetResolver = _chunkVSYQ6XYNcjs.RouteLeaseTargetResolver; exports.SUBSCRIPTION_PROVIDER_IDS = _chunkT6NWPIYZcjs.SUBSCRIPTION_PROVIDER_IDS; exports.SYSTEM_ROUTE_LEASE_CLOCK = _chunkVSYQ6XYNcjs.SYSTEM_ROUTE_LEASE_CLOCK; exports.SerialQueueTimeoutError = _chunkVSYQ6XYNcjs.SerialQueueTimeoutError; exports.TransformerChainExecutor = _chunk7ZHBN75Ncjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.UsageRecorder = _chunk5UK3KLE2cjs.UsageRecorder; exports.UserMessageSerialQueue = _chunkVSYQ6XYNcjs.UserMessageSerialQueue; exports.__resetOutboundApiServerForTests = _chunkVSYQ6XYNcjs.__resetOutboundApiServerForTests; exports.__resetProviderProxyForTests = _chunkVSYQ6XYNcjs.__resetProviderProxyForTests; exports.addOpenRouterProviderToRequest = _chunkVSYQ6XYNcjs.addOpenRouterProviderToRequest; exports.applyAugmentation = _chunkJMJBSACDcjs.applyAugmentation; exports.assertFiniteImageApiLimits = _chunkUPQIWJIEcjs.assertFiniteImageApiLimits; exports.attachStreamEventBuffer = _chunkVSYQ6XYNcjs.attach; exports.beginAuditCapture = _chunkFX325I5Qcjs.beginAuditCapture; exports.beginBillingCapture = _chunkAPYG5QD7cjs.beginBillingCapture; exports.boundAccountSelectionMessage = _chunk25GXJCEZcjs.boundAccountSelectionMessage; exports.buildAnthropicApiUrl = _chunkA2YMUCBTcjs.buildAnthropicApiUrl; exports.buildAzureOpenAIApiUrl = _chunkA2YMUCBTcjs.buildAzureOpenAIApiUrl; exports.buildGeminiApiUrl = _chunkA2YMUCBTcjs.buildGeminiApiUrl; exports.buildNativeSearchAugmentation = _chunkJMJBSACDcjs.buildNativeSearchAugmentation; exports.buildOpenAIApiUrl = _chunkA2YMUCBTcjs.buildOpenAIApiUrl; exports.buildOpenAIResponseApiUrl = _chunkA2YMUCBTcjs.buildOpenAIResponseApiUrl; exports.buildProviderApiUrl = _chunkA2YMUCBTcjs.buildProviderApiUrl; exports.candidateBackgroundModelIds = _chunkVSYQ6XYNcjs.candidateBackgroundModelIds; exports.candidateGatewayBindings = _chunkVSYQ6XYNcjs.candidateGatewayBindings; exports.canonicalizeRouteLeasePayload = _chunkVSYQ6XYNcjs.canonicalizeRouteLeasePayload; exports.checkKeyQuota = _chunkVSYQ6XYNcjs.checkKeyQuota; exports.classifyModelPrefix = _chunkT6NWPIYZcjs.classifyModelPrefix; exports.classifyOpenAIOperation = _chunkG4CZIUIBcjs.classifyOpenAIOperation; exports.classifyResponsesProfile = _chunkVSYQ6XYNcjs.classifyResponsesProfile; exports.codexSearchRoutePath = _chunkVSYQ6XYNcjs.codexSearchRoutePath; exports.computeKeyExpiry = _chunkVSYQ6XYNcjs.computeKeyExpiry; exports.computeVoucherGrant = _chunkVSYQ6XYNcjs.computeVoucherGrant; exports.convertAnthropicRequestToOpenAI = _chunkGDIXXKF2cjs.convertAnthropicRequestToOpenAI; exports.convertAnthropicStreamToOpenAI = _chunkGDIXXKF2cjs.convertAnthropicStreamToOpenAI; exports.convertAnthropicToOpenAI = _chunkGDIXXKF2cjs.convertAnthropicToOpenAI; exports.convertAnthropicToOpenAIWithThinking = _chunkGDIXXKF2cjs.convertAnthropicToOpenAIWithThinking; exports.convertMessageToAnthropic = _chunkVSYQ6XYNcjs.convertMessageToAnthropic; exports.convertMessageToGemini = _chunkVSYQ6XYNcjs.convertMessageToGemini; exports.convertMessageToOpenAI = _chunkVSYQ6XYNcjs.convertMessageToOpenAI; exports.convertOpenAIResponseToAnthropic = _chunkGDIXXKF2cjs.convertOpenAIResponseToAnthropic; exports.convertOpenAIStreamToAnthropic = _chunkGDIXXKF2cjs.convertOpenAIStreamToAnthropic; exports.convertOpenAIToAnthropic = _chunkGDIXXKF2cjs.convertOpenAIToAnthropic; exports.convertOpenAIToAnthropicWithThinking = _chunkGDIXXKF2cjs.convertOpenAIToAnthropicWithThinking; exports.createImageApiContributions = _chunkUPQIWJIEcjs.createImageApiContributions; exports.createImageRequestResourceScope = _chunkUPQIWJIEcjs.createImageRequestResourceScope; exports.createIntegrationKey = _chunkVSYQ6XYNcjs.createIntegrationKey; exports.createNamedKey = _chunkVSYQ6XYNcjs.createNamedKey; exports.createNativeResponsesHostedImageIngress = _chunkVSYQ6XYNcjs.createNativeResponsesHostedImageIngress; exports.createResponsesCompactHandler = _chunkVSYQ6XYNcjs.createResponsesCompactHandler; exports.createResponsesImageGenerationContribution = _chunkUPQIWJIEcjs.createResponsesImageGenerationContribution; exports.createSSEParser = _chunkHQP3K7PUcjs.createSSEParser; exports.createSafeRemoteImageResolver = _chunkUPQIWJIEcjs.createSafeRemoteImageResolver; exports.defaultServerConfig = _chunkVSYQ6XYNcjs.defaultServerConfig; exports.detectModelKind = _chunkT6NWPIYZcjs.detectModelKind; exports.detectNativeSearch = _chunkJMJBSACDcjs.detectNativeSearch; exports.detectRequestRole = _chunkT6NWPIYZcjs.detectRequestRole; exports.effectiveOutboundPermissions = _chunkVSYQ6XYNcjs.effectiveOutboundPermissions; exports.emitImageTelemetry = _chunkUPQIWJIEcjs.emitImageTelemetry; exports.emitStreamEvent = _chunkVSYQ6XYNcjs.emit; exports.endpointSupportsSubscription = _chunkT6NWPIYZcjs.endpointSupportsSubscription; exports.endpointToIngressFormat = _chunkT6NWPIYZcjs.endpointToIngressFormat; exports.extractRouteToken = _chunkVSYQ6XYNcjs.extractRouteToken; exports.formatUrls = _chunkVSYQ6XYNcjs.formatUrls; exports.gatewayBindingToEndpointConfig = _chunkVSYQ6XYNcjs.gatewayBindingToEndpointConfig; exports.generateVoucherCode = _chunkVSYQ6XYNcjs.generateVoucherCode; exports.getBuiltinSearchTools = _chunk2RCCLQYVcjs.getBuiltinSearchTools; exports.getOpenAIOperation = _chunkG4CZIUIBcjs.getOpenAIOperation; exports.getOpenRouterAppIdentity = _chunkUNEFIWXIcjs.getOpenRouterAppIdentity; exports.getOpenRouterProviderConfig = _chunkVSYQ6XYNcjs.getOpenRouterProviderConfig; exports.getOutboundApiServer = _chunkVSYQ6XYNcjs.getOutboundApiServer; exports.getProviderHeaders = _chunkOIKREZVQcjs.getProviderHeaders; exports.getProviderProxy = _chunkVSYQ6XYNcjs.getProviderProxy; exports.getResponsesAffinityStore = _chunkVSYQ6XYNcjs.getResponsesAffinityStore; exports.handleCodexSearchRequest = _chunkVSYQ6XYNcjs.handleCodexSearchRequest; exports.handleVoucherRedeem = _chunkVSYQ6XYNcjs.handleVoucherRedeem; exports.hasImageContent = _chunkGDIXXKF2cjs.hasImageContent; exports.hasThinkingEnabled = _chunkGDIXXKF2cjs.hasThinkingEnabled; exports.hashKey = _chunkVSYQ6XYNcjs.hashKey; exports.hashRouteLeasePayload = _chunkVSYQ6XYNcjs.hashRouteLeasePayload; exports.hashRouteLeaseSessionId = _chunkVSYQ6XYNcjs.hashRouteLeaseSessionId; exports.hashVoucherCode = _chunkVSYQ6XYNcjs.hashVoucherCode; exports.imageGenerationErrorFromPublic = _chunkUPQIWJIEcjs.imageGenerationErrorFromPublic; exports.inspectResponsesImageRequest = _chunkUPQIWJIEcjs.inspectResponsesImageRequest; exports.isBoundAccountSelectionError = _chunk25GXJCEZcjs.isBoundAccountSelectionError; exports.isCodexSearchRequest = _chunkVSYQ6XYNcjs.isCodexSearchRequest; exports.isConcurrencyRejection = _chunkVSYQ6XYNcjs.isConcurrencyRejection; exports.isImageGenerationError = _chunkUPQIWJIEcjs.isImageGenerationError; exports.isKindMappedEndpoint = _chunkT6NWPIYZcjs.isKindMappedEndpoint; exports.isLoopbackAddress = _chunkVSYQ6XYNcjs.isLoopbackAddress; exports.isOpenRouterProvider = _chunkUNEFIWXIcjs.isOpenRouterProvider; exports.isRedeemRequest = _chunkVSYQ6XYNcjs.isRedeemRequest; exports.isSerialQueueTimeout = _chunkVSYQ6XYNcjs.isSerialQueueTimeout; exports.isSubscriptionProviderId = _chunkT6NWPIYZcjs.isSubscriptionProviderId; exports.isUserMessageRequest = _chunkVSYQ6XYNcjs.isUserMessageRequest; exports.legacyEndpointsToBindings = _chunkVSYQ6XYNcjs.legacyEndpointsToBindings; exports.loadServerConfig = _chunkVSYQ6XYNcjs.loadServerConfig; exports.mergeServerConfig = _chunkVSYQ6XYNcjs.mergeServerConfig; exports.modelKindsForEndpoint = _chunkT6NWPIYZcjs.modelKindsForEndpoint; exports.newVoucherId = _chunkVSYQ6XYNcjs.newVoucherId; exports.normalizeAccountProbe = _chunkVSYQ6XYNcjs.normalizeAccountProbe; exports.normalizeAllowanceScheduling = _chunkVSYQ6XYNcjs.normalizeAllowanceScheduling; exports.normalizeAudit = _chunkVSYQ6XYNcjs.normalizeAudit; exports.normalizeAzureEndpoint = _chunkA2YMUCBTcjs.normalizeAzureEndpoint; exports.normalizeBilling = _chunkVSYQ6XYNcjs.normalizeBilling; exports.normalizeFingerprint = _chunkVSYQ6XYNcjs.normalizeFingerprint; exports.normalizeGatewayBindings = _chunkVSYQ6XYNcjs.normalizeGatewayBindings; exports.normalizeImageGenerationError = _chunkUPQIWJIEcjs.normalizeImageGenerationError; exports.normalizeImagesServerConfig = _chunkVSYQ6XYNcjs.normalizeImagesServerConfig; exports.normalizePrefixTargets = _chunkVSYQ6XYNcjs.normalizePrefixTargets; exports.normalizeProxyConfig = _chunkVSYQ6XYNcjs.normalizeProxyConfig; exports.normalizeProxySegment = _chunkVSYQ6XYNcjs.normalizeProxySegment; exports.normalizeQueueSegments = _chunkVSYQ6XYNcjs.normalizeQueueSegments; exports.normalizeRouteLeaseIdempotencyKey = _chunkVSYQ6XYNcjs.normalizeRouteLeaseIdempotencyKey; exports.normalizeRouteLeaseTtl = _chunkVSYQ6XYNcjs.normalizeRouteLeaseTtl; exports.normalizeSearchApiProviderConfigs = _chunkVSYQ6XYNcjs.normalizeSearchApiProviderConfigs; exports.normalizeSearchServerConfig = _chunkVSYQ6XYNcjs.normalizeSearchServerConfig; exports.normalizeServerConfig = _chunkVSYQ6XYNcjs.normalizeServerConfig; exports.normalizeVoucher = _chunkVSYQ6XYNcjs.normalizeVoucher; exports.normalizeWebhookDestination = _chunkVSYQ6XYNcjs.normalizeWebhookDestination; exports.normalizeWebhookSegment = _chunkVSYQ6XYNcjs.normalizeWebhookSegment; exports.parseModelRef = _chunkT6NWPIYZcjs.parseModelRef; exports.parseRouteLeaseCreate = _chunkVSYQ6XYNcjs.parseRouteLeaseCreate; exports.pickModelRefFromList = _chunkT6NWPIYZcjs.pickModelRefFromList; exports.previousResponseNotFound = _chunkVSYQ6XYNcjs.previousResponseNotFound; exports.randomBase62 = _chunkVSYQ6XYNcjs.randomBase62; exports.readImageAssetBytes = _chunkUPQIWJIEcjs.readImageAssetBytes; exports.redactAuditText = _chunkHCOQQAZEcjs.redactAuditText; exports.registerBuiltinTransformers = _chunkZAPN7XA6cjs.registerBuiltinTransformers; exports.registerResponsesCompactOperation = _chunkVSYQ6XYNcjs.registerResponsesCompactOperation; exports.registerStreamEventBuffer = _chunkVSYQ6XYNcjs.register; exports.releaseStreamEventBuffer = _chunkVSYQ6XYNcjs.release; exports.resolveApiFormat = _chunkA2YMUCBTcjs.resolveApiFormat; exports.resolveGatewayBinding = _chunkVSYQ6XYNcjs.resolveGatewayBinding; exports.resolveImageCapabilities = _chunkUPQIWJIEcjs.resolveImageCapabilities; exports.resolvePrefixTarget = _chunkT6NWPIYZcjs.resolvePrefixTarget; exports.resolveProviderEndpoint = _chunkA2YMUCBTcjs.resolveProviderEndpoint; exports.resolveRoute = _chunkT6NWPIYZcjs.resolveRoute; exports.routeLeaseRuntime = _chunkVSYQ6XYNcjs.routeLeaseRuntime; exports.saveServerConfig = _chunkVSYQ6XYNcjs.saveServerConfig; exports.serializeError = _chunkSVNDB62Dcjs.serializeError; exports.serializeImageGenerationError = _chunkUPQIWJIEcjs.serializeImageGenerationError; exports.setOpenRouterAppIdentity = _chunkUNEFIWXIcjs.setOpenRouterAppIdentity; exports.startOfLocalDay = _chunkVSYQ6XYNcjs.startOfLocalDay; exports.startOfLocalWeek = _chunkVSYQ6XYNcjs.startOfLocalWeek; exports.streamSSEResponse = _chunkHQP3K7PUcjs.streamSSEResponse; exports.toVoucherInfo = _chunkVSYQ6XYNcjs.toVoucherInfo; exports.unsupportedOpenAIOperation = _chunkG4CZIUIBcjs.unsupportedOpenAIOperation; exports.validateEndpointModelConfig = _chunkT6NWPIYZcjs.validateEndpointModelConfig; exports.validateImagesServerConfig = _chunkVSYQ6XYNcjs.validateImagesServerConfig; exports.validateOutboundPermissions = _chunkVSYQ6XYNcjs.validateOutboundPermissions; exports.validateResponsesImageSelection = _chunkUPQIWJIEcjs.validateResponsesImageSelection; exports.validateSearchServerConfig = _chunkVSYQ6XYNcjs.validateSearchServerConfig; exports.verifyKey = _chunkVSYQ6XYNcjs.verifyKey; exports.verifyPresentedKey = _chunkVSYQ6XYNcjs.verifyPresentedKey; exports.voucherCodePrefix = _chunkVSYQ6XYNcjs.voucherCodePrefix; exports.writeOpenAIOperationError = _chunkG4CZIUIBcjs.writeOpenAIOperationError;
|
package/dist/index.js
CHANGED
package/dist/outbound-api.cjs
CHANGED
package/dist/outbound-api.js
CHANGED
|
@@ -163,7 +163,7 @@ import "./chunk-MKF46GNZ.js";
|
|
|
163
163
|
import "./chunk-GL6XM527.js";
|
|
164
164
|
import "./chunk-LQYS2N47.js";
|
|
165
165
|
import "./chunk-4JOU54M5.js";
|
|
166
|
-
import "./chunk-
|
|
166
|
+
import "./chunk-4PFWFODB.js";
|
|
167
167
|
export {
|
|
168
168
|
AUDIT_REDACTED,
|
|
169
169
|
BoundAccountSelectionError,
|
|
@@ -69,7 +69,7 @@ import "../../chunk-MKF46GNZ.js";
|
|
|
69
69
|
import "../../chunk-GL6XM527.js";
|
|
70
70
|
import "../../chunk-LQYS2N47.js";
|
|
71
71
|
import "../../chunk-4JOU54M5.js";
|
|
72
|
-
import "../../chunk-
|
|
72
|
+
import "../../chunk-4PFWFODB.js";
|
|
73
73
|
export {
|
|
74
74
|
aggregateAnthropicSseToJsonBody,
|
|
75
75
|
cancelDiscardedResponse,
|
package/dist/provider-proxy.cjs
CHANGED
package/dist/provider-proxy.js
CHANGED
|
@@ -98,7 +98,7 @@ import "./chunk-MKF46GNZ.js";
|
|
|
98
98
|
import "./chunk-GL6XM527.js";
|
|
99
99
|
import "./chunk-LQYS2N47.js";
|
|
100
100
|
import "./chunk-4JOU54M5.js";
|
|
101
|
-
import "./chunk-
|
|
101
|
+
import "./chunk-4PFWFODB.js";
|
|
102
102
|
export {
|
|
103
103
|
DEFAULT_ROUTE_IDLE_MS,
|
|
104
104
|
ProviderProxy,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkPTU7SXM3cjs = require('./chunk-PTU7SXM3.cjs');
|
|
4
|
+
require('./chunk-BTBEJRGL.cjs');
|
|
5
|
+
require('./chunk-7RJI3NDI.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.createSearchRuntime = _chunkPTU7SXM3cjs.createSearchRuntime;
|
package/dist/search/api.cjs
CHANGED
|
@@ -62,7 +62,7 @@ var API_RESPONSE_BYTES = 2 * 1024 * 1024;
|
|
|
62
62
|
var MAX_UPSTREAM_TEXT = 300;
|
|
63
63
|
function createSearchApiTransport(options = {}) {
|
|
64
64
|
const policy = options.egressPolicy;
|
|
65
|
-
const fetchImpl = _nullishCoalesce(options.fetch, () => ( createUndiciApiFetch(options.env, policy)));
|
|
65
|
+
const fetchImpl = _nullishCoalesce(options.fetch, () => ( createUndiciApiFetch(options.env, policy, options.resolveProxyDispatcher)));
|
|
66
66
|
const maxRedirects = _nullishCoalesce(options.maxRedirects, () => ( API_MAX_REDIRECTS));
|
|
67
67
|
return async (request) => {
|
|
68
68
|
const context = {
|
|
@@ -122,14 +122,18 @@ function createSearchApiTransport(options = {}) {
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
var defaultSearchApiTransport = createSearchApiTransport();
|
|
125
|
-
function selectApiDispatcher(env, policy) {
|
|
125
|
+
function selectApiDispatcher(env, policy, override) {
|
|
126
|
+
if (_optionalChain([override, 'optionalAccess', _13 => _13.resolveProxyDispatcher])) {
|
|
127
|
+
const dispatcher = override.resolveProxyDispatcher(override.url);
|
|
128
|
+
if (dispatcher) return { dispatcher, proxied: true };
|
|
129
|
+
}
|
|
126
130
|
const proxy = _chunk7RJI3NDIcjs.resolveSearchProxySettings.call(void 0, env);
|
|
127
131
|
if (proxy) return { dispatcher: _chunk7RJI3NDIcjs.getSearchProxyDispatcher.call(void 0, proxy), proxied: true };
|
|
128
132
|
return { dispatcher: _chunk7RJI3NDIcjs.createEgressGuardedDispatcher.call(void 0, policy), proxied: false };
|
|
129
133
|
}
|
|
130
|
-
function createUndiciApiFetch(env, policy) {
|
|
134
|
+
function createUndiciApiFetch(env, policy, resolveProxyDispatcher) {
|
|
131
135
|
return async (url, init) => {
|
|
132
|
-
const { dispatcher } = selectApiDispatcher(env, policy);
|
|
136
|
+
const { dispatcher } = selectApiDispatcher(env, policy, { url, resolveProxyDispatcher });
|
|
133
137
|
return await _undici.fetch.call(void 0,
|
|
134
138
|
url,
|
|
135
139
|
{ ...init, dispatcher }
|
|
@@ -168,7 +172,7 @@ async function fetchWithValidatedRedirects(fetchImpl, initialUrl, request, signa
|
|
|
168
172
|
if (response.status < 300 || response.status >= 400) return response;
|
|
169
173
|
const location = response.headers.get("location");
|
|
170
174
|
if (!location) return response;
|
|
171
|
-
void _optionalChain([response, 'access',
|
|
175
|
+
void _optionalChain([response, 'access', _14 => _14.body, 'optionalAccess', _15 => _15.cancel, 'call', _16 => _16(), 'access', _17 => _17.catch, 'call', _18 => _18(() => void 0)]);
|
|
172
176
|
if (redirects === maxRedirects) throw tooManyRedirects(maxRedirects, context);
|
|
173
177
|
let nextUrl;
|
|
174
178
|
try {
|
|
@@ -208,7 +212,7 @@ function assertEgressAllowed(url, policy, context) {
|
|
|
208
212
|
const denial = error;
|
|
209
213
|
throw apiError(denial.code, denial.message, {
|
|
210
214
|
stage: "egress",
|
|
211
|
-
context: { ...context, host: _nullishCoalesce(_optionalChain([denial, 'access',
|
|
215
|
+
context: { ...context, host: _nullishCoalesce(_optionalChain([denial, 'access', _19 => _19.details, 'optionalAccess', _20 => _20.host]), () => ( context.host)) },
|
|
212
216
|
retryable: false,
|
|
213
217
|
cause: denial,
|
|
214
218
|
details: denial.details
|
|
@@ -224,7 +228,7 @@ function tooManyRedirects(maxRedirects, context) {
|
|
|
224
228
|
});
|
|
225
229
|
}
|
|
226
230
|
async function readJsonBodyWithLimit(response, context) {
|
|
227
|
-
const reader = _optionalChain([response, 'access',
|
|
231
|
+
const reader = _optionalChain([response, 'access', _21 => _21.body, 'optionalAccess', _22 => _22.getReader, 'call', _23 => _23()]);
|
|
228
232
|
if (!reader) return "";
|
|
229
233
|
const chunks = [];
|
|
230
234
|
let totalBytes = 0;
|
|
@@ -673,7 +677,8 @@ var ZHIPU_CAPABILITIES = Object.freeze({
|
|
|
673
677
|
function apiSearchContributions(configs, options = {}) {
|
|
674
678
|
const transport = createSearchApiTransport({
|
|
675
679
|
fetch: options.fetchImpl,
|
|
676
|
-
egressPolicy: options.egressPolicy
|
|
680
|
+
egressPolicy: options.egressPolicy,
|
|
681
|
+
resolveProxyDispatcher: options.resolveProxyDispatcher
|
|
677
682
|
});
|
|
678
683
|
const contributions = [];
|
|
679
684
|
if (configs.tavily) {
|
package/dist/search/api.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SearchProviderCapabilities, SearchProviderContribution, SearchProviderId, SearchOptions, SearchUrlReadResult, SearchProvider, SearchResult, SearchProviderError } from '@omnicross/contracts/search-types';
|
|
2
|
+
import { Dispatcher } from 'undici';
|
|
2
3
|
import { S as SearchEgressPolicy } from '../egress-I46O_p5L.cjs';
|
|
3
4
|
import { a as SearchApiFetch, S as SearchApiProviderConfigs, J as JinaProviderConfig, b as SearchApiTransport, c as SearxngProviderConfig, T as TavilyProviderConfig, Z as ZhipuProviderConfig } from '../types-CbCZqLGg.cjs';
|
|
4
5
|
export { d as SEARCH_API_TRANSPORT_ID, e as SearchApiRequest, f as SearchApiStage } from '../types-CbCZqLGg.cjs';
|
|
5
6
|
import { P as ProxyEnvironment } from '../proxy-UZTtjPZx.cjs';
|
|
6
7
|
import 'node:dns';
|
|
7
|
-
import 'undici';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* The API search contributions.
|
|
@@ -44,6 +44,11 @@ interface ApiSearchContributionOptions {
|
|
|
44
44
|
egressPolicy?: SearchEgressPolicy;
|
|
45
45
|
/** Fetch primitive seam. Omit for the production undici transport. */
|
|
46
46
|
fetchImpl?: SearchApiFetch;
|
|
47
|
+
/**
|
|
48
|
+
* Layered proxy-dispatcher override handed to the shared transport (the
|
|
49
|
+
* daemon's `fetchUpstream` resolver). Only meaningful without `fetchImpl`.
|
|
50
|
+
*/
|
|
51
|
+
resolveProxyDispatcher?: (url: string) => Dispatcher | undefined;
|
|
47
52
|
}
|
|
48
53
|
/**
|
|
49
54
|
* Build contributions for exactly the providers `configs` names.
|
|
@@ -286,6 +291,16 @@ interface SearchApiTransportOptions {
|
|
|
286
291
|
fetch?: SearchApiFetch;
|
|
287
292
|
/** Environment to read proxy variables from. Defaults to `process.env`. */
|
|
288
293
|
env?: ProxyEnvironment;
|
|
294
|
+
/**
|
|
295
|
+
* Layered proxy-dispatcher override for one request URL, AHEAD of the env
|
|
296
|
+
* layer (the daemon's `fetchUpstream` resolver, so search follows
|
|
297
|
+
* `server.proxy`). When it yields a dispatcher the connection is proxied —
|
|
298
|
+
* URL and per-hop egress validation still apply, address-level validation
|
|
299
|
+
* does not, the same documented limitation as the env proxy. When it yields
|
|
300
|
+
* `undefined` the env layer and then the egress-guarded dispatcher apply,
|
|
301
|
+
* exactly as before.
|
|
302
|
+
*/
|
|
303
|
+
resolveProxyDispatcher?: (url: string) => Dispatcher | undefined;
|
|
289
304
|
/** Egress policy. Defaults to public-only. */
|
|
290
305
|
egressPolicy?: SearchEgressPolicy;
|
|
291
306
|
/** Redirect hop cap. Defaults to {@link API_MAX_REDIRECTS}. */
|