@opentiny/next-sdk 0.2.4 → 0.2.6
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/dist/index.es.dev.js +987 -336
- package/dist/index.es.js +11753 -11150
- package/dist/index.js +2 -2
- package/dist/index.umd.dev.js +987 -336
- package/dist/index.umd.js +55 -55
- package/dist/mcpsdk@1.25.3.dev.js +190 -181
- package/dist/mcpsdk@1.25.3.es.dev.js +190 -181
- package/dist/mcpsdk@1.25.3.es.js +1111 -1105
- package/dist/mcpsdk@1.25.3.js +14 -14
- package/dist/skills/index.d.ts +2 -2
- package/dist/webagent.dev.js +985 -334
- package/dist/webagent.es.dev.js +985 -334
- package/dist/webagent.es.js +11294 -10691
- package/dist/webagent.js +58 -58
- package/dist/webmcp-full.dev.js +190 -181
- package/dist/webmcp-full.es.dev.js +190 -181
- package/dist/webmcp-full.es.js +74 -68
- package/dist/webmcp-full.js +1 -1
- package/package.json +1 -1
- package/skills/index.ts +4 -4
package/dist/webagent.es.dev.js
CHANGED
|
@@ -11321,17 +11321,14 @@ var GatewayVideoModel = class {
|
|
|
11321
11321
|
var _a92;
|
|
11322
11322
|
const resolvedHeaders = await resolve$1(this.config.headers());
|
|
11323
11323
|
try {
|
|
11324
|
-
const {
|
|
11325
|
-
responseHeaders,
|
|
11326
|
-
value: responseBody,
|
|
11327
|
-
rawValue
|
|
11328
|
-
} = await postJsonToApi$1({
|
|
11324
|
+
const { responseHeaders, value: responseBody } = await postJsonToApi$1({
|
|
11329
11325
|
url: this.getUrl(),
|
|
11330
11326
|
headers: combineHeaders$1(
|
|
11331
11327
|
resolvedHeaders,
|
|
11332
11328
|
headers != null ? headers : {},
|
|
11333
11329
|
this.getModelConfigHeaders(),
|
|
11334
|
-
await resolve$1(this.config.o11yHeaders)
|
|
11330
|
+
await resolve$1(this.config.o11yHeaders),
|
|
11331
|
+
{ accept: "text/event-stream" }
|
|
11335
11332
|
),
|
|
11336
11333
|
body: {
|
|
11337
11334
|
prompt,
|
|
@@ -11344,9 +11341,70 @@ var GatewayVideoModel = class {
|
|
|
11344
11341
|
...providerOptions && { providerOptions },
|
|
11345
11342
|
...image && { image: maybeEncodeVideoFile(image) }
|
|
11346
11343
|
},
|
|
11347
|
-
successfulResponseHandler:
|
|
11348
|
-
|
|
11349
|
-
|
|
11344
|
+
successfulResponseHandler: async ({
|
|
11345
|
+
response,
|
|
11346
|
+
url: url2,
|
|
11347
|
+
requestBodyValues
|
|
11348
|
+
}) => {
|
|
11349
|
+
if (response.body == null) {
|
|
11350
|
+
throw new APICallError$1({
|
|
11351
|
+
message: "SSE response body is empty",
|
|
11352
|
+
url: url2,
|
|
11353
|
+
requestBodyValues,
|
|
11354
|
+
statusCode: response.status
|
|
11355
|
+
});
|
|
11356
|
+
}
|
|
11357
|
+
const eventStream = parseJsonEventStream$1({
|
|
11358
|
+
stream: response.body,
|
|
11359
|
+
schema: gatewayVideoEventSchema
|
|
11360
|
+
});
|
|
11361
|
+
const reader = eventStream.getReader();
|
|
11362
|
+
const { done, value: parseResult } = await reader.read();
|
|
11363
|
+
reader.releaseLock();
|
|
11364
|
+
if (done || !parseResult) {
|
|
11365
|
+
throw new APICallError$1({
|
|
11366
|
+
message: "SSE stream ended without a data event",
|
|
11367
|
+
url: url2,
|
|
11368
|
+
requestBodyValues,
|
|
11369
|
+
statusCode: response.status
|
|
11370
|
+
});
|
|
11371
|
+
}
|
|
11372
|
+
if (!parseResult.success) {
|
|
11373
|
+
throw new APICallError$1({
|
|
11374
|
+
message: "Failed to parse video SSE event",
|
|
11375
|
+
cause: parseResult.error,
|
|
11376
|
+
url: url2,
|
|
11377
|
+
requestBodyValues,
|
|
11378
|
+
statusCode: response.status
|
|
11379
|
+
});
|
|
11380
|
+
}
|
|
11381
|
+
const event = parseResult.value;
|
|
11382
|
+
if (event.type === "error") {
|
|
11383
|
+
throw new APICallError$1({
|
|
11384
|
+
message: event.message,
|
|
11385
|
+
statusCode: event.statusCode,
|
|
11386
|
+
url: url2,
|
|
11387
|
+
requestBodyValues,
|
|
11388
|
+
responseHeaders: Object.fromEntries([...response.headers]),
|
|
11389
|
+
responseBody: JSON.stringify(event),
|
|
11390
|
+
data: {
|
|
11391
|
+
error: {
|
|
11392
|
+
message: event.message,
|
|
11393
|
+
type: event.errorType,
|
|
11394
|
+
param: event.param
|
|
11395
|
+
}
|
|
11396
|
+
}
|
|
11397
|
+
});
|
|
11398
|
+
}
|
|
11399
|
+
return {
|
|
11400
|
+
value: {
|
|
11401
|
+
videos: event.videos,
|
|
11402
|
+
warnings: event.warnings,
|
|
11403
|
+
providerMetadata: event.providerMetadata
|
|
11404
|
+
},
|
|
11405
|
+
responseHeaders: Object.fromEntries([...response.headers])
|
|
11406
|
+
};
|
|
11407
|
+
},
|
|
11350
11408
|
failedResponseHandler: createJsonErrorResponseHandler$1({
|
|
11351
11409
|
errorSchema: any(),
|
|
11352
11410
|
errorToMessage: (data) => data
|
|
@@ -11418,11 +11476,21 @@ var gatewayVideoWarningSchema = discriminatedUnion("type", [
|
|
|
11418
11476
|
message: string()
|
|
11419
11477
|
})
|
|
11420
11478
|
]);
|
|
11421
|
-
var
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11479
|
+
var gatewayVideoEventSchema = discriminatedUnion("type", [
|
|
11480
|
+
object$1({
|
|
11481
|
+
type: literal("result"),
|
|
11482
|
+
videos: array$1(gatewayVideoDataSchema),
|
|
11483
|
+
warnings: array$1(gatewayVideoWarningSchema).optional(),
|
|
11484
|
+
providerMetadata: record(string(), providerMetadataEntrySchema2).optional()
|
|
11485
|
+
}),
|
|
11486
|
+
object$1({
|
|
11487
|
+
type: literal("error"),
|
|
11488
|
+
message: string(),
|
|
11489
|
+
errorType: string(),
|
|
11490
|
+
statusCode: number$1(),
|
|
11491
|
+
param: unknown().nullable()
|
|
11492
|
+
})
|
|
11493
|
+
]);
|
|
11426
11494
|
var parallelSearchInputSchema = lazySchema(
|
|
11427
11495
|
() => zodSchema(
|
|
11428
11496
|
objectType({
|
|
@@ -11599,7 +11667,7 @@ async function getVercelRequestId() {
|
|
|
11599
11667
|
var _a92;
|
|
11600
11668
|
return (_a92 = indexBrowserExports.getContext().headers) == null ? void 0 : _a92["x-vercel-id"];
|
|
11601
11669
|
}
|
|
11602
|
-
var VERSION$6 = "3.0.
|
|
11670
|
+
var VERSION$6 = "3.0.58";
|
|
11603
11671
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
11604
11672
|
function createGatewayProvider(options = {}) {
|
|
11605
11673
|
var _a92, _b9;
|
|
@@ -11642,13 +11710,18 @@ function createGatewayProvider(options = {}) {
|
|
|
11642
11710
|
settingValue: void 0,
|
|
11643
11711
|
environmentVariableName: "VERCEL_REGION"
|
|
11644
11712
|
});
|
|
11713
|
+
const projectId = loadOptionalSetting({
|
|
11714
|
+
settingValue: void 0,
|
|
11715
|
+
environmentVariableName: "VERCEL_PROJECT_ID"
|
|
11716
|
+
});
|
|
11645
11717
|
return async () => {
|
|
11646
11718
|
const requestId = await getVercelRequestId();
|
|
11647
11719
|
return {
|
|
11648
11720
|
...deploymentId && { "ai-o11y-deployment-id": deploymentId },
|
|
11649
11721
|
...environment && { "ai-o11y-environment": environment },
|
|
11650
11722
|
...region && { "ai-o11y-region": region },
|
|
11651
|
-
...requestId && { "ai-o11y-request-id": requestId }
|
|
11723
|
+
...requestId && { "ai-o11y-request-id": requestId },
|
|
11724
|
+
...projectId && { "ai-o11y-project-id": projectId }
|
|
11652
11725
|
};
|
|
11653
11726
|
};
|
|
11654
11727
|
};
|
|
@@ -12727,6 +12800,17 @@ var RetryError = class extends AISDKError$1 {
|
|
|
12727
12800
|
}
|
|
12728
12801
|
};
|
|
12729
12802
|
_a19 = symbol19;
|
|
12803
|
+
function asArray(value) {
|
|
12804
|
+
return value === void 0 ? [] : Array.isArray(value) ? value : [value];
|
|
12805
|
+
}
|
|
12806
|
+
async function notify(options) {
|
|
12807
|
+
for (const callback of asArray(options.callbacks)) {
|
|
12808
|
+
try {
|
|
12809
|
+
await callback(options.event);
|
|
12810
|
+
} catch (_ignored) {
|
|
12811
|
+
}
|
|
12812
|
+
}
|
|
12813
|
+
}
|
|
12730
12814
|
function formatWarning({
|
|
12731
12815
|
warning,
|
|
12732
12816
|
provider,
|
|
@@ -13027,7 +13111,7 @@ function detectMediaType({
|
|
|
13027
13111
|
}
|
|
13028
13112
|
return void 0;
|
|
13029
13113
|
}
|
|
13030
|
-
var VERSION$4 = "6.0.
|
|
13114
|
+
var VERSION$4 = "6.0.104";
|
|
13031
13115
|
var download = async ({
|
|
13032
13116
|
url: url2,
|
|
13033
13117
|
maxBytes,
|
|
@@ -13135,9 +13219,6 @@ function convertDataContentToBase64String(content) {
|
|
|
13135
13219
|
}
|
|
13136
13220
|
return convertUint8ArrayToBase64$1(content);
|
|
13137
13221
|
}
|
|
13138
|
-
function asArray(value) {
|
|
13139
|
-
return value === void 0 ? [] : Array.isArray(value) ? value : [value];
|
|
13140
|
-
}
|
|
13141
13222
|
async function convertToLanguageModelPrompt({
|
|
13142
13223
|
prompt,
|
|
13143
13224
|
supportedUrls,
|
|
@@ -14452,6 +14533,10 @@ function collectToolApprovals({
|
|
|
14452
14533
|
}
|
|
14453
14534
|
return { approvedToolApprovals, deniedToolApprovals };
|
|
14454
14535
|
}
|
|
14536
|
+
function now() {
|
|
14537
|
+
var _a21, _b9;
|
|
14538
|
+
return (_b9 = (_a21 = globalThis == null ? void 0 : globalThis.performance) == null ? void 0 : _a21.now()) != null ? _b9 : Date.now();
|
|
14539
|
+
}
|
|
14455
14540
|
async function executeToolCall({
|
|
14456
14541
|
toolCall,
|
|
14457
14542
|
tools,
|
|
@@ -14460,13 +14545,27 @@ async function executeToolCall({
|
|
|
14460
14545
|
messages,
|
|
14461
14546
|
abortSignal,
|
|
14462
14547
|
experimental_context,
|
|
14463
|
-
|
|
14548
|
+
stepNumber,
|
|
14549
|
+
model,
|
|
14550
|
+
onPreliminaryToolResult,
|
|
14551
|
+
onToolCallStart,
|
|
14552
|
+
onToolCallFinish
|
|
14464
14553
|
}) {
|
|
14465
14554
|
const { toolName, toolCallId, input } = toolCall;
|
|
14466
14555
|
const tool2 = tools == null ? void 0 : tools[toolName];
|
|
14467
14556
|
if ((tool2 == null ? void 0 : tool2.execute) == null) {
|
|
14468
14557
|
return void 0;
|
|
14469
14558
|
}
|
|
14559
|
+
const baseCallbackEvent = {
|
|
14560
|
+
stepNumber,
|
|
14561
|
+
model,
|
|
14562
|
+
toolCall,
|
|
14563
|
+
messages,
|
|
14564
|
+
abortSignal,
|
|
14565
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
14566
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
14567
|
+
experimental_context
|
|
14568
|
+
};
|
|
14470
14569
|
return recordSpan({
|
|
14471
14570
|
name: "ai.toolCall",
|
|
14472
14571
|
attributes: selectTelemetryAttributes({
|
|
@@ -14486,6 +14585,8 @@ async function executeToolCall({
|
|
|
14486
14585
|
tracer,
|
|
14487
14586
|
fn: async (span) => {
|
|
14488
14587
|
let output;
|
|
14588
|
+
await notify({ event: baseCallbackEvent, callbacks: onToolCallStart });
|
|
14589
|
+
const startTime = now();
|
|
14489
14590
|
try {
|
|
14490
14591
|
const stream = executeTool({
|
|
14491
14592
|
execute: tool2.execute.bind(tool2),
|
|
@@ -14510,6 +14611,16 @@ async function executeToolCall({
|
|
|
14510
14611
|
}
|
|
14511
14612
|
}
|
|
14512
14613
|
} catch (error) {
|
|
14614
|
+
const durationMs2 = now() - startTime;
|
|
14615
|
+
await notify({
|
|
14616
|
+
event: {
|
|
14617
|
+
...baseCallbackEvent,
|
|
14618
|
+
success: false,
|
|
14619
|
+
error,
|
|
14620
|
+
durationMs: durationMs2
|
|
14621
|
+
},
|
|
14622
|
+
callbacks: onToolCallFinish
|
|
14623
|
+
});
|
|
14513
14624
|
recordErrorOnSpan(span, error);
|
|
14514
14625
|
return {
|
|
14515
14626
|
type: "tool-error",
|
|
@@ -14521,6 +14632,16 @@ async function executeToolCall({
|
|
|
14521
14632
|
...toolCall.providerMetadata != null ? { providerMetadata: toolCall.providerMetadata } : {}
|
|
14522
14633
|
};
|
|
14523
14634
|
}
|
|
14635
|
+
const durationMs = now() - startTime;
|
|
14636
|
+
await notify({
|
|
14637
|
+
event: {
|
|
14638
|
+
...baseCallbackEvent,
|
|
14639
|
+
success: true,
|
|
14640
|
+
output,
|
|
14641
|
+
durationMs
|
|
14642
|
+
},
|
|
14643
|
+
callbacks: onToolCallFinish
|
|
14644
|
+
});
|
|
14524
14645
|
try {
|
|
14525
14646
|
span.setAttributes(
|
|
14526
14647
|
await selectTelemetryAttributes({
|
|
@@ -15384,6 +15505,11 @@ async function doParseToolCall({
|
|
|
15384
15505
|
}
|
|
15385
15506
|
var DefaultStepResult = class {
|
|
15386
15507
|
constructor({
|
|
15508
|
+
stepNumber,
|
|
15509
|
+
model,
|
|
15510
|
+
functionId,
|
|
15511
|
+
metadata: metadata2,
|
|
15512
|
+
experimental_context,
|
|
15387
15513
|
content,
|
|
15388
15514
|
finishReason,
|
|
15389
15515
|
rawFinishReason,
|
|
@@ -15393,6 +15519,11 @@ var DefaultStepResult = class {
|
|
|
15393
15519
|
response,
|
|
15394
15520
|
providerMetadata
|
|
15395
15521
|
}) {
|
|
15522
|
+
this.stepNumber = stepNumber;
|
|
15523
|
+
this.model = model;
|
|
15524
|
+
this.functionId = functionId;
|
|
15525
|
+
this.metadata = metadata2;
|
|
15526
|
+
this.experimental_context = experimental_context;
|
|
15396
15527
|
this.content = content;
|
|
15397
15528
|
this.finishReason = finishReason;
|
|
15398
15529
|
this.rawFinishReason = rawFinishReason;
|
|
@@ -15634,6 +15765,10 @@ async function generateText({
|
|
|
15634
15765
|
experimental_context,
|
|
15635
15766
|
experimental_include: include,
|
|
15636
15767
|
_internal: { generateId: generateId2 = originalGenerateId } = {},
|
|
15768
|
+
experimental_onStart: onStart,
|
|
15769
|
+
experimental_onStepStart: onStepStart,
|
|
15770
|
+
experimental_onToolCallStart: onToolCallStart,
|
|
15771
|
+
experimental_onToolCallFinish: onToolCallFinish,
|
|
15637
15772
|
onStepFinish,
|
|
15638
15773
|
onFinish,
|
|
15639
15774
|
...settings
|
|
@@ -15663,11 +15798,43 @@ async function generateText({
|
|
|
15663
15798
|
headers: headersWithUserAgent,
|
|
15664
15799
|
settings: { ...callSettings, maxRetries }
|
|
15665
15800
|
});
|
|
15801
|
+
const modelInfo = { provider: model.provider, modelId: model.modelId };
|
|
15666
15802
|
const initialPrompt = await standardizePrompt({
|
|
15667
15803
|
system,
|
|
15668
15804
|
prompt,
|
|
15669
15805
|
messages
|
|
15670
15806
|
});
|
|
15807
|
+
await notify({
|
|
15808
|
+
event: {
|
|
15809
|
+
model: modelInfo,
|
|
15810
|
+
system,
|
|
15811
|
+
prompt,
|
|
15812
|
+
messages,
|
|
15813
|
+
tools,
|
|
15814
|
+
toolChoice,
|
|
15815
|
+
activeTools,
|
|
15816
|
+
maxOutputTokens: callSettings.maxOutputTokens,
|
|
15817
|
+
temperature: callSettings.temperature,
|
|
15818
|
+
topP: callSettings.topP,
|
|
15819
|
+
topK: callSettings.topK,
|
|
15820
|
+
presencePenalty: callSettings.presencePenalty,
|
|
15821
|
+
frequencyPenalty: callSettings.frequencyPenalty,
|
|
15822
|
+
stopSequences: callSettings.stopSequences,
|
|
15823
|
+
seed: callSettings.seed,
|
|
15824
|
+
maxRetries,
|
|
15825
|
+
timeout,
|
|
15826
|
+
headers,
|
|
15827
|
+
providerOptions,
|
|
15828
|
+
stopWhen,
|
|
15829
|
+
output,
|
|
15830
|
+
abortSignal,
|
|
15831
|
+
include,
|
|
15832
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
15833
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
15834
|
+
experimental_context
|
|
15835
|
+
},
|
|
15836
|
+
callbacks: onStart
|
|
15837
|
+
});
|
|
15671
15838
|
const tracer = getTracer(telemetry);
|
|
15672
15839
|
try {
|
|
15673
15840
|
return await recordSpan({
|
|
@@ -15691,7 +15858,7 @@ async function generateText({
|
|
|
15691
15858
|
}),
|
|
15692
15859
|
tracer,
|
|
15693
15860
|
fn: async (span) => {
|
|
15694
|
-
var _a21, _b9, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
15861
|
+
var _a21, _b9, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
15695
15862
|
const initialMessages = initialPrompt.messages;
|
|
15696
15863
|
const responseMessages = [];
|
|
15697
15864
|
const { approvedToolApprovals, deniedToolApprovals } = collectToolApprovals({ messages: initialMessages });
|
|
@@ -15708,7 +15875,11 @@ async function generateText({
|
|
|
15708
15875
|
telemetry,
|
|
15709
15876
|
messages: initialMessages,
|
|
15710
15877
|
abortSignal: mergedAbortSignal,
|
|
15711
|
-
experimental_context
|
|
15878
|
+
experimental_context,
|
|
15879
|
+
stepNumber: 0,
|
|
15880
|
+
model: modelInfo,
|
|
15881
|
+
onToolCallStart,
|
|
15882
|
+
onToolCallFinish
|
|
15712
15883
|
});
|
|
15713
15884
|
const toolContent = [];
|
|
15714
15885
|
for (const output2 of toolOutputs) {
|
|
@@ -15788,6 +15959,10 @@ async function generateText({
|
|
|
15788
15959
|
const stepModel = resolveLanguageModel(
|
|
15789
15960
|
(_a21 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a21 : model
|
|
15790
15961
|
);
|
|
15962
|
+
const stepModelInfo = {
|
|
15963
|
+
provider: stepModel.provider,
|
|
15964
|
+
modelId: stepModel.modelId
|
|
15965
|
+
};
|
|
15791
15966
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
15792
15967
|
prompt: {
|
|
15793
15968
|
system: (_b9 = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b9 : initialPrompt.system,
|
|
@@ -15797,10 +15972,40 @@ async function generateText({
|
|
|
15797
15972
|
download: download2
|
|
15798
15973
|
});
|
|
15799
15974
|
experimental_context = (_d = prepareStepResult == null ? void 0 : prepareStepResult.experimental_context) != null ? _d : experimental_context;
|
|
15975
|
+
const stepActiveTools = (_e = prepareStepResult == null ? void 0 : prepareStepResult.activeTools) != null ? _e : activeTools;
|
|
15800
15976
|
const { toolChoice: stepToolChoice, tools: stepTools } = await prepareToolsAndToolChoice({
|
|
15801
15977
|
tools,
|
|
15802
|
-
toolChoice: (
|
|
15803
|
-
activeTools:
|
|
15978
|
+
toolChoice: (_f = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _f : toolChoice,
|
|
15979
|
+
activeTools: stepActiveTools
|
|
15980
|
+
});
|
|
15981
|
+
const stepMessages = (_g = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _g : stepInputMessages;
|
|
15982
|
+
const stepSystem = (_h = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _h : initialPrompt.system;
|
|
15983
|
+
const stepProviderOptions = mergeObjects(
|
|
15984
|
+
providerOptions,
|
|
15985
|
+
prepareStepResult == null ? void 0 : prepareStepResult.providerOptions
|
|
15986
|
+
);
|
|
15987
|
+
await notify({
|
|
15988
|
+
event: {
|
|
15989
|
+
stepNumber: steps.length,
|
|
15990
|
+
model: stepModelInfo,
|
|
15991
|
+
system: stepSystem,
|
|
15992
|
+
messages: stepMessages,
|
|
15993
|
+
tools,
|
|
15994
|
+
toolChoice: stepToolChoice,
|
|
15995
|
+
activeTools: stepActiveTools,
|
|
15996
|
+
steps: [...steps],
|
|
15997
|
+
providerOptions: stepProviderOptions,
|
|
15998
|
+
timeout,
|
|
15999
|
+
headers,
|
|
16000
|
+
stopWhen,
|
|
16001
|
+
output,
|
|
16002
|
+
abortSignal,
|
|
16003
|
+
include,
|
|
16004
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
16005
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
16006
|
+
experimental_context
|
|
16007
|
+
},
|
|
16008
|
+
callbacks: onStepStart
|
|
15804
16009
|
});
|
|
15805
16010
|
currentModelResponse = await retry(
|
|
15806
16011
|
() => {
|
|
@@ -15844,10 +16049,6 @@ async function generateText({
|
|
|
15844
16049
|
tracer,
|
|
15845
16050
|
fn: async (span2) => {
|
|
15846
16051
|
var _a23, _b22, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
15847
|
-
const stepProviderOptions = mergeObjects(
|
|
15848
|
-
providerOptions,
|
|
15849
|
-
prepareStepResult == null ? void 0 : prepareStepResult.providerOptions
|
|
15850
|
-
);
|
|
15851
16052
|
const result = await stepModel.doGenerate({
|
|
15852
16053
|
...callSettings2,
|
|
15853
16054
|
tools: stepTools,
|
|
@@ -15979,7 +16180,11 @@ async function generateText({
|
|
|
15979
16180
|
telemetry,
|
|
15980
16181
|
messages: stepInputMessages,
|
|
15981
16182
|
abortSignal: mergedAbortSignal,
|
|
15982
|
-
experimental_context
|
|
16183
|
+
experimental_context,
|
|
16184
|
+
stepNumber: steps.length,
|
|
16185
|
+
model: stepModelInfo,
|
|
16186
|
+
onToolCallStart,
|
|
16187
|
+
onToolCallFinish
|
|
15983
16188
|
})
|
|
15984
16189
|
);
|
|
15985
16190
|
}
|
|
@@ -16016,15 +16221,21 @@ async function generateText({
|
|
|
16016
16221
|
tools
|
|
16017
16222
|
})
|
|
16018
16223
|
);
|
|
16019
|
-
const stepRequest = ((
|
|
16224
|
+
const stepRequest = ((_i = include == null ? void 0 : include.requestBody) != null ? _i : true) ? (_j = currentModelResponse.request) != null ? _j : {} : { ...currentModelResponse.request, body: void 0 };
|
|
16020
16225
|
const stepResponse = {
|
|
16021
16226
|
...currentModelResponse.response,
|
|
16022
16227
|
// deep clone msgs to avoid mutating past messages in multi-step:
|
|
16023
16228
|
messages: structuredClone(responseMessages),
|
|
16024
16229
|
// Conditionally include response body:
|
|
16025
|
-
body: ((
|
|
16230
|
+
body: ((_k = include == null ? void 0 : include.responseBody) != null ? _k : true) ? (_l = currentModelResponse.response) == null ? void 0 : _l.body : void 0
|
|
16026
16231
|
};
|
|
16232
|
+
const stepNumber = steps.length;
|
|
16027
16233
|
const currentStepResult = new DefaultStepResult({
|
|
16234
|
+
stepNumber,
|
|
16235
|
+
model: stepModelInfo,
|
|
16236
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
16237
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
16238
|
+
experimental_context,
|
|
16028
16239
|
content: stepContent,
|
|
16029
16240
|
finishReason: currentModelResponse.finishReason.unified,
|
|
16030
16241
|
rawFinishReason: currentModelResponse.finishReason.raw,
|
|
@@ -16035,12 +16246,12 @@ async function generateText({
|
|
|
16035
16246
|
response: stepResponse
|
|
16036
16247
|
});
|
|
16037
16248
|
logWarnings({
|
|
16038
|
-
warnings: (
|
|
16039
|
-
provider:
|
|
16040
|
-
model:
|
|
16249
|
+
warnings: (_m = currentModelResponse.warnings) != null ? _m : [],
|
|
16250
|
+
provider: stepModelInfo.provider,
|
|
16251
|
+
model: stepModelInfo.modelId
|
|
16041
16252
|
});
|
|
16042
16253
|
steps.push(currentStepResult);
|
|
16043
|
-
await (
|
|
16254
|
+
await notify({ event: currentStepResult, callbacks: onStepFinish });
|
|
16044
16255
|
} finally {
|
|
16045
16256
|
if (stepTimeoutId != null) {
|
|
16046
16257
|
clearTimeout(stepTimeoutId);
|
|
@@ -16092,30 +16303,37 @@ async function generateText({
|
|
|
16092
16303
|
cachedInputTokens: void 0
|
|
16093
16304
|
}
|
|
16094
16305
|
);
|
|
16095
|
-
await (
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16108
|
-
|
|
16109
|
-
|
|
16110
|
-
|
|
16111
|
-
|
|
16112
|
-
|
|
16113
|
-
|
|
16114
|
-
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16306
|
+
await notify({
|
|
16307
|
+
event: {
|
|
16308
|
+
stepNumber: lastStep.stepNumber,
|
|
16309
|
+
model: lastStep.model,
|
|
16310
|
+
functionId: lastStep.functionId,
|
|
16311
|
+
metadata: lastStep.metadata,
|
|
16312
|
+
experimental_context: lastStep.experimental_context,
|
|
16313
|
+
finishReason: lastStep.finishReason,
|
|
16314
|
+
rawFinishReason: lastStep.rawFinishReason,
|
|
16315
|
+
usage: lastStep.usage,
|
|
16316
|
+
content: lastStep.content,
|
|
16317
|
+
text: lastStep.text,
|
|
16318
|
+
reasoningText: lastStep.reasoningText,
|
|
16319
|
+
reasoning: lastStep.reasoning,
|
|
16320
|
+
files: lastStep.files,
|
|
16321
|
+
sources: lastStep.sources,
|
|
16322
|
+
toolCalls: lastStep.toolCalls,
|
|
16323
|
+
staticToolCalls: lastStep.staticToolCalls,
|
|
16324
|
+
dynamicToolCalls: lastStep.dynamicToolCalls,
|
|
16325
|
+
toolResults: lastStep.toolResults,
|
|
16326
|
+
staticToolResults: lastStep.staticToolResults,
|
|
16327
|
+
dynamicToolResults: lastStep.dynamicToolResults,
|
|
16328
|
+
request: lastStep.request,
|
|
16329
|
+
response: lastStep.response,
|
|
16330
|
+
warnings: lastStep.warnings,
|
|
16331
|
+
providerMetadata: lastStep.providerMetadata,
|
|
16332
|
+
steps,
|
|
16333
|
+
totalUsage
|
|
16334
|
+
},
|
|
16335
|
+
callbacks: onFinish
|
|
16336
|
+
});
|
|
16119
16337
|
let resolvedOutput;
|
|
16120
16338
|
if (lastStep.finishReason === "stop") {
|
|
16121
16339
|
const outputSpecification = output != null ? output : text();
|
|
@@ -16146,7 +16364,11 @@ async function executeTools({
|
|
|
16146
16364
|
telemetry,
|
|
16147
16365
|
messages,
|
|
16148
16366
|
abortSignal,
|
|
16149
|
-
experimental_context
|
|
16367
|
+
experimental_context,
|
|
16368
|
+
stepNumber,
|
|
16369
|
+
model,
|
|
16370
|
+
onToolCallStart,
|
|
16371
|
+
onToolCallFinish
|
|
16150
16372
|
}) {
|
|
16151
16373
|
const toolOutputs = await Promise.all(
|
|
16152
16374
|
toolCalls.map(
|
|
@@ -16157,7 +16379,11 @@ async function executeTools({
|
|
|
16157
16379
|
telemetry,
|
|
16158
16380
|
messages,
|
|
16159
16381
|
abortSignal,
|
|
16160
|
-
experimental_context
|
|
16382
|
+
experimental_context,
|
|
16383
|
+
stepNumber,
|
|
16384
|
+
model,
|
|
16385
|
+
onToolCallStart,
|
|
16386
|
+
onToolCallFinish
|
|
16161
16387
|
})
|
|
16162
16388
|
)
|
|
16163
16389
|
);
|
|
@@ -16850,7 +17076,9 @@ function processUIMessageStream({
|
|
|
16850
17076
|
break;
|
|
16851
17077
|
}
|
|
16852
17078
|
case "tool-input-error": {
|
|
16853
|
-
|
|
17079
|
+
const existingPart = state.message.parts.filter(isToolUIPart).find((p) => p.toolCallId === chunk.toolCallId);
|
|
17080
|
+
const isDynamic = existingPart != null ? existingPart.type === "dynamic-tool" : !!chunk.dynamic;
|
|
17081
|
+
if (isDynamic) {
|
|
16854
17082
|
updateDynamicToolPart({
|
|
16855
17083
|
toolCallId: chunk.toolCallId,
|
|
16856
17084
|
toolName: chunk.toolName,
|
|
@@ -17318,10 +17546,6 @@ function createStitchableStream() {
|
|
|
17318
17546
|
terminate
|
|
17319
17547
|
};
|
|
17320
17548
|
}
|
|
17321
|
-
function now() {
|
|
17322
|
-
var _a21, _b9;
|
|
17323
|
-
return (_b9 = (_a21 = globalThis == null ? void 0 : globalThis.performance) == null ? void 0 : _a21.now()) != null ? _b9 : Date.now();
|
|
17324
|
-
}
|
|
17325
17549
|
function runToolsTransformation({
|
|
17326
17550
|
tools,
|
|
17327
17551
|
generatorStream,
|
|
@@ -17332,7 +17556,11 @@ function runToolsTransformation({
|
|
|
17332
17556
|
abortSignal,
|
|
17333
17557
|
repairToolCall,
|
|
17334
17558
|
experimental_context,
|
|
17335
|
-
generateId: generateId2
|
|
17559
|
+
generateId: generateId2,
|
|
17560
|
+
stepNumber,
|
|
17561
|
+
model,
|
|
17562
|
+
onToolCallStart,
|
|
17563
|
+
onToolCallFinish
|
|
17336
17564
|
}) {
|
|
17337
17565
|
let toolResultsStreamController = null;
|
|
17338
17566
|
const toolResultsStream = new ReadableStream({
|
|
@@ -17474,6 +17702,10 @@ function runToolsTransformation({
|
|
|
17474
17702
|
messages,
|
|
17475
17703
|
abortSignal,
|
|
17476
17704
|
experimental_context,
|
|
17705
|
+
stepNumber,
|
|
17706
|
+
model,
|
|
17707
|
+
onToolCallStart,
|
|
17708
|
+
onToolCallFinish,
|
|
17477
17709
|
onPreliminaryToolResult: (result) => {
|
|
17478
17710
|
toolResultsStreamController.enqueue(result);
|
|
17479
17711
|
}
|
|
@@ -17590,6 +17822,10 @@ function streamText({
|
|
|
17590
17822
|
onFinish,
|
|
17591
17823
|
onAbort,
|
|
17592
17824
|
onStepFinish,
|
|
17825
|
+
experimental_onStart: onStart,
|
|
17826
|
+
experimental_onStepStart: onStepStart,
|
|
17827
|
+
experimental_onToolCallStart: onToolCallStart,
|
|
17828
|
+
experimental_onToolCallFinish: onToolCallFinish,
|
|
17593
17829
|
experimental_context,
|
|
17594
17830
|
experimental_include: include,
|
|
17595
17831
|
_internal: { now: now2 = now, generateId: generateId2 = originalGenerateId2 } = {},
|
|
@@ -17629,11 +17865,18 @@ function streamText({
|
|
|
17629
17865
|
providerOptions,
|
|
17630
17866
|
prepareStep,
|
|
17631
17867
|
includeRawChunks,
|
|
17868
|
+
timeout,
|
|
17869
|
+
stopWhen,
|
|
17870
|
+
originalAbortSignal: abortSignal,
|
|
17632
17871
|
onChunk,
|
|
17633
17872
|
onError,
|
|
17634
17873
|
onFinish,
|
|
17635
17874
|
onAbort,
|
|
17636
17875
|
onStepFinish,
|
|
17876
|
+
onStart,
|
|
17877
|
+
onStepStart,
|
|
17878
|
+
onToolCallStart,
|
|
17879
|
+
onToolCallFinish,
|
|
17637
17880
|
now: now2,
|
|
17638
17881
|
generateId: generateId2,
|
|
17639
17882
|
experimental_context,
|
|
@@ -17730,11 +17973,18 @@ var DefaultStreamTextResult = class {
|
|
|
17730
17973
|
includeRawChunks,
|
|
17731
17974
|
now: now2,
|
|
17732
17975
|
generateId: generateId2,
|
|
17976
|
+
timeout,
|
|
17977
|
+
stopWhen,
|
|
17978
|
+
originalAbortSignal,
|
|
17733
17979
|
onChunk,
|
|
17734
17980
|
onError,
|
|
17735
17981
|
onFinish,
|
|
17736
17982
|
onAbort,
|
|
17737
17983
|
onStepFinish,
|
|
17984
|
+
onStart,
|
|
17985
|
+
onStepStart,
|
|
17986
|
+
onToolCallStart,
|
|
17987
|
+
onToolCallFinish,
|
|
17738
17988
|
experimental_context,
|
|
17739
17989
|
download: download2,
|
|
17740
17990
|
include
|
|
@@ -17877,6 +18127,10 @@ var DefaultStreamTextResult = class {
|
|
|
17877
18127
|
tools
|
|
17878
18128
|
});
|
|
17879
18129
|
const currentStepResult = new DefaultStepResult({
|
|
18130
|
+
stepNumber: recordedSteps.length,
|
|
18131
|
+
model: modelInfo,
|
|
18132
|
+
...callbackTelemetryProps,
|
|
18133
|
+
experimental_context,
|
|
17880
18134
|
content: recordedContent,
|
|
17881
18135
|
finishReason: part.finishReason,
|
|
17882
18136
|
rawFinishReason: part.rawFinishReason,
|
|
@@ -17889,11 +18143,11 @@ var DefaultStreamTextResult = class {
|
|
|
17889
18143
|
},
|
|
17890
18144
|
providerMetadata: part.providerMetadata
|
|
17891
18145
|
});
|
|
17892
|
-
await (
|
|
18146
|
+
await notify({ event: currentStepResult, callbacks: onStepFinish });
|
|
17893
18147
|
logWarnings({
|
|
17894
18148
|
warnings: recordedWarnings,
|
|
17895
|
-
provider:
|
|
17896
|
-
model:
|
|
18149
|
+
provider: modelInfo.provider,
|
|
18150
|
+
model: modelInfo.modelId
|
|
17897
18151
|
});
|
|
17898
18152
|
recordedSteps.push(currentStepResult);
|
|
17899
18153
|
recordedResponseMessages.push(...stepMessages);
|
|
@@ -17924,30 +18178,37 @@ var DefaultStreamTextResult = class {
|
|
|
17924
18178
|
self2._totalUsage.resolve(totalUsage);
|
|
17925
18179
|
self2._steps.resolve(recordedSteps);
|
|
17926
18180
|
const finalStep = recordedSteps[recordedSteps.length - 1];
|
|
17927
|
-
await (
|
|
17928
|
-
|
|
17929
|
-
|
|
17930
|
-
|
|
17931
|
-
|
|
17932
|
-
|
|
17933
|
-
|
|
17934
|
-
|
|
17935
|
-
|
|
17936
|
-
|
|
17937
|
-
|
|
17938
|
-
|
|
17939
|
-
|
|
17940
|
-
|
|
17941
|
-
|
|
17942
|
-
|
|
17943
|
-
|
|
17944
|
-
|
|
17945
|
-
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
18181
|
+
await notify({
|
|
18182
|
+
event: {
|
|
18183
|
+
stepNumber: finalStep.stepNumber,
|
|
18184
|
+
model: finalStep.model,
|
|
18185
|
+
functionId: finalStep.functionId,
|
|
18186
|
+
metadata: finalStep.metadata,
|
|
18187
|
+
experimental_context: finalStep.experimental_context,
|
|
18188
|
+
finishReason: finalStep.finishReason,
|
|
18189
|
+
rawFinishReason: finalStep.rawFinishReason,
|
|
18190
|
+
totalUsage,
|
|
18191
|
+
usage: finalStep.usage,
|
|
18192
|
+
content: finalStep.content,
|
|
18193
|
+
text: finalStep.text,
|
|
18194
|
+
reasoningText: finalStep.reasoningText,
|
|
18195
|
+
reasoning: finalStep.reasoning,
|
|
18196
|
+
files: finalStep.files,
|
|
18197
|
+
sources: finalStep.sources,
|
|
18198
|
+
toolCalls: finalStep.toolCalls,
|
|
18199
|
+
staticToolCalls: finalStep.staticToolCalls,
|
|
18200
|
+
dynamicToolCalls: finalStep.dynamicToolCalls,
|
|
18201
|
+
toolResults: finalStep.toolResults,
|
|
18202
|
+
staticToolResults: finalStep.staticToolResults,
|
|
18203
|
+
dynamicToolResults: finalStep.dynamicToolResults,
|
|
18204
|
+
request: finalStep.request,
|
|
18205
|
+
response: finalStep.response,
|
|
18206
|
+
warnings: finalStep.warnings,
|
|
18207
|
+
providerMetadata: finalStep.providerMetadata,
|
|
18208
|
+
steps: recordedSteps
|
|
18209
|
+
},
|
|
18210
|
+
callbacks: onFinish
|
|
18211
|
+
});
|
|
17951
18212
|
rootSpan.setAttributes(
|
|
17952
18213
|
await selectTelemetryAttributes({
|
|
17953
18214
|
telemetry,
|
|
@@ -18048,6 +18309,11 @@ var DefaultStreamTextResult = class {
|
|
|
18048
18309
|
settings: { ...callSettings, maxRetries }
|
|
18049
18310
|
});
|
|
18050
18311
|
const self2 = this;
|
|
18312
|
+
const modelInfo = { provider: model.provider, modelId: model.modelId };
|
|
18313
|
+
const callbackTelemetryProps = {
|
|
18314
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
18315
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
18316
|
+
};
|
|
18051
18317
|
recordSpan({
|
|
18052
18318
|
name: "ai.streamText",
|
|
18053
18319
|
attributes: selectTelemetryAttributes({
|
|
@@ -18070,6 +18336,36 @@ var DefaultStreamTextResult = class {
|
|
|
18070
18336
|
prompt,
|
|
18071
18337
|
messages
|
|
18072
18338
|
});
|
|
18339
|
+
await notify({
|
|
18340
|
+
event: {
|
|
18341
|
+
model: modelInfo,
|
|
18342
|
+
system,
|
|
18343
|
+
prompt,
|
|
18344
|
+
messages,
|
|
18345
|
+
tools,
|
|
18346
|
+
toolChoice,
|
|
18347
|
+
activeTools,
|
|
18348
|
+
maxOutputTokens: callSettings.maxOutputTokens,
|
|
18349
|
+
temperature: callSettings.temperature,
|
|
18350
|
+
topP: callSettings.topP,
|
|
18351
|
+
topK: callSettings.topK,
|
|
18352
|
+
presencePenalty: callSettings.presencePenalty,
|
|
18353
|
+
frequencyPenalty: callSettings.frequencyPenalty,
|
|
18354
|
+
stopSequences: callSettings.stopSequences,
|
|
18355
|
+
seed: callSettings.seed,
|
|
18356
|
+
maxRetries,
|
|
18357
|
+
timeout,
|
|
18358
|
+
headers,
|
|
18359
|
+
providerOptions,
|
|
18360
|
+
stopWhen,
|
|
18361
|
+
output,
|
|
18362
|
+
abortSignal: originalAbortSignal,
|
|
18363
|
+
include,
|
|
18364
|
+
...callbackTelemetryProps,
|
|
18365
|
+
experimental_context
|
|
18366
|
+
},
|
|
18367
|
+
callbacks: onStart
|
|
18368
|
+
});
|
|
18073
18369
|
const initialMessages = initialPrompt.messages;
|
|
18074
18370
|
const initialResponseMessages = [];
|
|
18075
18371
|
const { approvedToolApprovals, deniedToolApprovals } = collectToolApprovals({ messages: initialMessages });
|
|
@@ -18116,6 +18412,10 @@ var DefaultStreamTextResult = class {
|
|
|
18116
18412
|
messages: initialMessages,
|
|
18117
18413
|
abortSignal,
|
|
18118
18414
|
experimental_context,
|
|
18415
|
+
stepNumber: recordedSteps.length,
|
|
18416
|
+
model: modelInfo,
|
|
18417
|
+
onToolCallStart,
|
|
18418
|
+
onToolCallFinish,
|
|
18119
18419
|
onPreliminaryToolResult: (result2) => {
|
|
18120
18420
|
toolExecutionStepStreamController == null ? void 0 : toolExecutionStepStreamController.enqueue(result2);
|
|
18121
18421
|
}
|
|
@@ -18182,7 +18482,7 @@ var DefaultStreamTextResult = class {
|
|
|
18182
18482
|
responseMessages,
|
|
18183
18483
|
usage
|
|
18184
18484
|
}) {
|
|
18185
|
-
var _a21, _b9, _c, _d, _e, _f, _g;
|
|
18485
|
+
var _a21, _b9, _c, _d, _e, _f, _g, _h, _i;
|
|
18186
18486
|
const includeRawChunks2 = self2.includeRawChunks;
|
|
18187
18487
|
const stepTimeoutId = stepTimeoutMs != null ? setTimeout(() => stepAbortController.abort(), stepTimeoutMs) : void 0;
|
|
18188
18488
|
let chunkTimeoutId = void 0;
|
|
@@ -18221,6 +18521,10 @@ var DefaultStreamTextResult = class {
|
|
|
18221
18521
|
const stepModel = resolveLanguageModel(
|
|
18222
18522
|
(_a21 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a21 : model
|
|
18223
18523
|
);
|
|
18524
|
+
const stepModelInfo = {
|
|
18525
|
+
provider: stepModel.provider,
|
|
18526
|
+
modelId: stepModel.modelId
|
|
18527
|
+
};
|
|
18224
18528
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
18225
18529
|
prompt: {
|
|
18226
18530
|
system: (_b9 = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b9 : initialPrompt.system,
|
|
@@ -18229,16 +18533,41 @@ var DefaultStreamTextResult = class {
|
|
|
18229
18533
|
supportedUrls: await stepModel.supportedUrls,
|
|
18230
18534
|
download: download2
|
|
18231
18535
|
});
|
|
18536
|
+
const stepActiveTools = (_d = prepareStepResult == null ? void 0 : prepareStepResult.activeTools) != null ? _d : activeTools;
|
|
18232
18537
|
const { toolChoice: stepToolChoice, tools: stepTools } = await prepareToolsAndToolChoice({
|
|
18233
18538
|
tools,
|
|
18234
|
-
toolChoice: (
|
|
18235
|
-
activeTools:
|
|
18539
|
+
toolChoice: (_e = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _e : toolChoice,
|
|
18540
|
+
activeTools: stepActiveTools
|
|
18236
18541
|
});
|
|
18237
18542
|
experimental_context = (_f = prepareStepResult == null ? void 0 : prepareStepResult.experimental_context) != null ? _f : experimental_context;
|
|
18543
|
+
const stepMessages = (_g = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _g : stepInputMessages;
|
|
18544
|
+
const stepSystem = (_h = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _h : initialPrompt.system;
|
|
18238
18545
|
const stepProviderOptions = mergeObjects(
|
|
18239
18546
|
providerOptions,
|
|
18240
18547
|
prepareStepResult == null ? void 0 : prepareStepResult.providerOptions
|
|
18241
18548
|
);
|
|
18549
|
+
await notify({
|
|
18550
|
+
event: {
|
|
18551
|
+
stepNumber: recordedSteps.length,
|
|
18552
|
+
model: stepModelInfo,
|
|
18553
|
+
system: stepSystem,
|
|
18554
|
+
messages: stepMessages,
|
|
18555
|
+
tools,
|
|
18556
|
+
toolChoice: stepToolChoice,
|
|
18557
|
+
activeTools: stepActiveTools,
|
|
18558
|
+
steps: [...recordedSteps],
|
|
18559
|
+
providerOptions: stepProviderOptions,
|
|
18560
|
+
timeout,
|
|
18561
|
+
headers,
|
|
18562
|
+
stopWhen,
|
|
18563
|
+
output,
|
|
18564
|
+
abortSignal: originalAbortSignal,
|
|
18565
|
+
include,
|
|
18566
|
+
...callbackTelemetryProps,
|
|
18567
|
+
experimental_context
|
|
18568
|
+
},
|
|
18569
|
+
callbacks: onStepStart
|
|
18570
|
+
});
|
|
18242
18571
|
const {
|
|
18243
18572
|
result: { stream: stream2, response, request },
|
|
18244
18573
|
doStreamSpan,
|
|
@@ -18310,9 +18639,13 @@ var DefaultStreamTextResult = class {
|
|
|
18310
18639
|
repairToolCall,
|
|
18311
18640
|
abortSignal,
|
|
18312
18641
|
experimental_context,
|
|
18313
|
-
generateId: generateId2
|
|
18642
|
+
generateId: generateId2,
|
|
18643
|
+
stepNumber: recordedSteps.length,
|
|
18644
|
+
model: stepModelInfo,
|
|
18645
|
+
onToolCallStart,
|
|
18646
|
+
onToolCallFinish
|
|
18314
18647
|
});
|
|
18315
|
-
const stepRequest = ((
|
|
18648
|
+
const stepRequest = ((_i = include == null ? void 0 : include.requestBody) != null ? _i : true) ? request != null ? request : {} : { ...request, body: void 0 };
|
|
18316
18649
|
const stepToolCalls = [];
|
|
18317
18650
|
const stepToolOutputs = [];
|
|
18318
18651
|
let warnings;
|
|
@@ -18325,7 +18658,7 @@ var DefaultStreamTextResult = class {
|
|
|
18325
18658
|
let stepResponse = {
|
|
18326
18659
|
id: generateId2(),
|
|
18327
18660
|
timestamp: /* @__PURE__ */ new Date(),
|
|
18328
|
-
modelId:
|
|
18661
|
+
modelId: modelInfo.modelId
|
|
18329
18662
|
};
|
|
18330
18663
|
let activeText = "";
|
|
18331
18664
|
self2.addStream(
|
|
@@ -24897,7 +25230,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
24897
25230
|
for (const toolCallDelta of delta.tool_calls) {
|
|
24898
25231
|
const index = toolCallDelta.index;
|
|
24899
25232
|
if (toolCalls[index] == null) {
|
|
24900
|
-
if (toolCallDelta.type !== "function") {
|
|
25233
|
+
if (toolCallDelta.type != null && toolCallDelta.type !== "function") {
|
|
24901
25234
|
throw new InvalidResponseDataError$1({
|
|
24902
25235
|
data: toolCallDelta,
|
|
24903
25236
|
message: `Expected 'function' type.`
|
|
@@ -25587,9 +25920,11 @@ var modelMaxImagesPerCall = {
|
|
|
25587
25920
|
"dall-e-2": 10,
|
|
25588
25921
|
"gpt-image-1": 10,
|
|
25589
25922
|
"gpt-image-1-mini": 10,
|
|
25590
|
-
"gpt-image-1.5": 10
|
|
25923
|
+
"gpt-image-1.5": 10,
|
|
25924
|
+
"chatgpt-image-latest": 10
|
|
25591
25925
|
};
|
|
25592
25926
|
var defaultResponseFormatPrefixes = [
|
|
25927
|
+
"chatgpt-image-",
|
|
25593
25928
|
"gpt-image-1-mini",
|
|
25594
25929
|
"gpt-image-1.5",
|
|
25595
25930
|
"gpt-image-1"
|
|
@@ -25688,15 +26023,20 @@ var OpenAIImageModel = class {
|
|
|
25688
26023
|
},
|
|
25689
26024
|
providerMetadata: {
|
|
25690
26025
|
openai: {
|
|
25691
|
-
images: response2.data.map((item) => {
|
|
25692
|
-
var _a22, _b22, _c2, _d2, _e2;
|
|
26026
|
+
images: response2.data.map((item, index) => {
|
|
26027
|
+
var _a22, _b22, _c2, _d2, _e2, _f2;
|
|
25693
26028
|
return {
|
|
25694
26029
|
...item.revised_prompt ? { revisedPrompt: item.revised_prompt } : {},
|
|
25695
26030
|
created: (_a22 = response2.created) != null ? _a22 : void 0,
|
|
25696
26031
|
size: (_b22 = response2.size) != null ? _b22 : void 0,
|
|
25697
26032
|
quality: (_c2 = response2.quality) != null ? _c2 : void 0,
|
|
25698
26033
|
background: (_d2 = response2.background) != null ? _d2 : void 0,
|
|
25699
|
-
outputFormat: (_e2 = response2.output_format) != null ? _e2 : void 0
|
|
26034
|
+
outputFormat: (_e2 = response2.output_format) != null ? _e2 : void 0,
|
|
26035
|
+
...distributeTokenDetails(
|
|
26036
|
+
(_f2 = response2.usage) == null ? void 0 : _f2.input_tokens_details,
|
|
26037
|
+
index,
|
|
26038
|
+
response2.data.length
|
|
26039
|
+
)
|
|
25700
26040
|
};
|
|
25701
26041
|
})
|
|
25702
26042
|
}
|
|
@@ -25739,15 +26079,20 @@ var OpenAIImageModel = class {
|
|
|
25739
26079
|
},
|
|
25740
26080
|
providerMetadata: {
|
|
25741
26081
|
openai: {
|
|
25742
|
-
images: response.data.map((item) => {
|
|
25743
|
-
var _a22, _b22, _c2, _d2, _e2;
|
|
26082
|
+
images: response.data.map((item, index) => {
|
|
26083
|
+
var _a22, _b22, _c2, _d2, _e2, _f2;
|
|
25744
26084
|
return {
|
|
25745
26085
|
...item.revised_prompt ? { revisedPrompt: item.revised_prompt } : {},
|
|
25746
26086
|
created: (_a22 = response.created) != null ? _a22 : void 0,
|
|
25747
26087
|
size: (_b22 = response.size) != null ? _b22 : void 0,
|
|
25748
26088
|
quality: (_c2 = response.quality) != null ? _c2 : void 0,
|
|
25749
26089
|
background: (_d2 = response.background) != null ? _d2 : void 0,
|
|
25750
|
-
outputFormat: (_e2 = response.output_format) != null ? _e2 : void 0
|
|
26090
|
+
outputFormat: (_e2 = response.output_format) != null ? _e2 : void 0,
|
|
26091
|
+
...distributeTokenDetails(
|
|
26092
|
+
(_f2 = response.usage) == null ? void 0 : _f2.input_tokens_details,
|
|
26093
|
+
index,
|
|
26094
|
+
response.data.length
|
|
26095
|
+
)
|
|
25751
26096
|
};
|
|
25752
26097
|
})
|
|
25753
26098
|
}
|
|
@@ -25755,6 +26100,23 @@ var OpenAIImageModel = class {
|
|
|
25755
26100
|
};
|
|
25756
26101
|
}
|
|
25757
26102
|
};
|
|
26103
|
+
function distributeTokenDetails(details, index, total) {
|
|
26104
|
+
if (details == null) {
|
|
26105
|
+
return {};
|
|
26106
|
+
}
|
|
26107
|
+
const result = {};
|
|
26108
|
+
if (details.image_tokens != null) {
|
|
26109
|
+
const base = Math.floor(details.image_tokens / total);
|
|
26110
|
+
const remainder = details.image_tokens - base * (total - 1);
|
|
26111
|
+
result.imageTokens = index === total - 1 ? remainder : base;
|
|
26112
|
+
}
|
|
26113
|
+
if (details.text_tokens != null) {
|
|
26114
|
+
const base = Math.floor(details.text_tokens / total);
|
|
26115
|
+
const remainder = details.text_tokens - base * (total - 1);
|
|
26116
|
+
result.textTokens = index === total - 1 ? remainder : base;
|
|
26117
|
+
}
|
|
26118
|
+
return result;
|
|
26119
|
+
}
|
|
25758
26120
|
async function fileToBlob(file) {
|
|
25759
26121
|
if (!file) return void 0;
|
|
25760
26122
|
if (file.type === "url") {
|
|
@@ -25965,6 +26327,67 @@ var shellOutputSchema = lazySchema(
|
|
|
25965
26327
|
})
|
|
25966
26328
|
)
|
|
25967
26329
|
);
|
|
26330
|
+
var shellSkillsSchema = array$1(
|
|
26331
|
+
discriminatedUnion("type", [
|
|
26332
|
+
object$1({
|
|
26333
|
+
type: literal("skillReference"),
|
|
26334
|
+
skillId: string(),
|
|
26335
|
+
version: string().optional()
|
|
26336
|
+
}),
|
|
26337
|
+
object$1({
|
|
26338
|
+
type: literal("inline"),
|
|
26339
|
+
name: string(),
|
|
26340
|
+
description: string(),
|
|
26341
|
+
source: object$1({
|
|
26342
|
+
type: literal("base64"),
|
|
26343
|
+
mediaType: literal("application/zip"),
|
|
26344
|
+
data: string()
|
|
26345
|
+
})
|
|
26346
|
+
})
|
|
26347
|
+
])
|
|
26348
|
+
).optional();
|
|
26349
|
+
var shellArgsSchema = lazySchema(
|
|
26350
|
+
() => zodSchema(
|
|
26351
|
+
object$1({
|
|
26352
|
+
environment: union([
|
|
26353
|
+
object$1({
|
|
26354
|
+
type: literal("containerAuto"),
|
|
26355
|
+
fileIds: array$1(string()).optional(),
|
|
26356
|
+
memoryLimit: _enum$1(["1g", "4g", "16g", "64g"]).optional(),
|
|
26357
|
+
networkPolicy: discriminatedUnion("type", [
|
|
26358
|
+
object$1({ type: literal("disabled") }),
|
|
26359
|
+
object$1({
|
|
26360
|
+
type: literal("allowlist"),
|
|
26361
|
+
allowedDomains: array$1(string()),
|
|
26362
|
+
domainSecrets: array$1(
|
|
26363
|
+
object$1({
|
|
26364
|
+
domain: string(),
|
|
26365
|
+
name: string(),
|
|
26366
|
+
value: string()
|
|
26367
|
+
})
|
|
26368
|
+
).optional()
|
|
26369
|
+
})
|
|
26370
|
+
]).optional(),
|
|
26371
|
+
skills: shellSkillsSchema
|
|
26372
|
+
}),
|
|
26373
|
+
object$1({
|
|
26374
|
+
type: literal("containerReference"),
|
|
26375
|
+
containerId: string()
|
|
26376
|
+
}),
|
|
26377
|
+
object$1({
|
|
26378
|
+
type: literal("local").optional(),
|
|
26379
|
+
skills: array$1(
|
|
26380
|
+
object$1({
|
|
26381
|
+
name: string(),
|
|
26382
|
+
description: string(),
|
|
26383
|
+
path: string()
|
|
26384
|
+
})
|
|
26385
|
+
).optional()
|
|
26386
|
+
})
|
|
26387
|
+
]).optional()
|
|
26388
|
+
})
|
|
26389
|
+
)
|
|
26390
|
+
);
|
|
25968
26391
|
var shell = createProviderToolFactoryWithOutputSchema({
|
|
25969
26392
|
id: "openai.shell",
|
|
25970
26393
|
inputSchema: shellInputSchema,
|
|
@@ -26004,7 +26427,7 @@ var webSearchOutputSchema = lazySchema(
|
|
|
26004
26427
|
url: string().nullish(),
|
|
26005
26428
|
pattern: string().nullish()
|
|
26006
26429
|
})
|
|
26007
|
-
]),
|
|
26430
|
+
]).optional(),
|
|
26008
26431
|
sources: array$1(
|
|
26009
26432
|
discriminatedUnion("type", [
|
|
26010
26433
|
object$1({ type: literal("url"), url: string() }),
|
|
@@ -26054,7 +26477,7 @@ var webSearchPreviewOutputSchema = lazySchema(
|
|
|
26054
26477
|
url: string().nullish(),
|
|
26055
26478
|
pattern: string().nullish()
|
|
26056
26479
|
})
|
|
26057
|
-
])
|
|
26480
|
+
]).optional()
|
|
26058
26481
|
})
|
|
26059
26482
|
)
|
|
26060
26483
|
);
|
|
@@ -26271,7 +26694,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
26271
26694
|
hasShellTool = false,
|
|
26272
26695
|
hasApplyPatchTool = false
|
|
26273
26696
|
}) {
|
|
26274
|
-
var _a10, _b9, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l
|
|
26697
|
+
var _a10, _b9, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
26275
26698
|
const input = [];
|
|
26276
26699
|
const warnings = [];
|
|
26277
26700
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -26352,7 +26775,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
26352
26775
|
for (const part of content) {
|
|
26353
26776
|
switch (part.type) {
|
|
26354
26777
|
case "text": {
|
|
26355
|
-
const
|
|
26778
|
+
const providerOpts = (_a10 = part.providerOptions) == null ? void 0 : _a10[providerOptionsName];
|
|
26779
|
+
const id2 = providerOpts == null ? void 0 : providerOpts.itemId;
|
|
26780
|
+
const phase = providerOpts == null ? void 0 : providerOpts.phase;
|
|
26356
26781
|
if (hasConversation && id2 != null) {
|
|
26357
26782
|
break;
|
|
26358
26783
|
}
|
|
@@ -26363,12 +26788,13 @@ async function convertToOpenAIResponsesInput({
|
|
|
26363
26788
|
input.push({
|
|
26364
26789
|
role: "assistant",
|
|
26365
26790
|
content: [{ type: "output_text", text: part.text }],
|
|
26366
|
-
id: id2
|
|
26791
|
+
id: id2,
|
|
26792
|
+
...phase != null && { phase }
|
|
26367
26793
|
});
|
|
26368
26794
|
break;
|
|
26369
26795
|
}
|
|
26370
26796
|
case "tool-call": {
|
|
26371
|
-
const id2 = (
|
|
26797
|
+
const id2 = (_f = (_c = (_b9 = part.providerOptions) == null ? void 0 : _b9[providerOptionsName]) == null ? void 0 : _c.itemId) != null ? _f : (_e = (_d = part.providerMetadata) == null ? void 0 : _d[providerOptionsName]) == null ? void 0 : _e.itemId;
|
|
26372
26798
|
if (hasConversation && id2 != null) {
|
|
26373
26799
|
break;
|
|
26374
26800
|
}
|
|
@@ -26454,8 +26880,32 @@ async function convertToOpenAIResponsesInput({
|
|
|
26454
26880
|
if (hasConversation) {
|
|
26455
26881
|
break;
|
|
26456
26882
|
}
|
|
26883
|
+
const resolvedResultToolName = toolNameMapping.toProviderToolName(
|
|
26884
|
+
part.toolName
|
|
26885
|
+
);
|
|
26886
|
+
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
26887
|
+
if (part.output.type === "json") {
|
|
26888
|
+
const parsedOutput = await validateTypes$1({
|
|
26889
|
+
value: part.output.value,
|
|
26890
|
+
schema: shellOutputSchema
|
|
26891
|
+
});
|
|
26892
|
+
input.push({
|
|
26893
|
+
type: "shell_call_output",
|
|
26894
|
+
call_id: part.toolCallId,
|
|
26895
|
+
output: parsedOutput.output.map((item) => ({
|
|
26896
|
+
stdout: item.stdout,
|
|
26897
|
+
stderr: item.stderr,
|
|
26898
|
+
outcome: item.outcome.type === "timeout" ? { type: "timeout" } : {
|
|
26899
|
+
type: "exit",
|
|
26900
|
+
exit_code: item.outcome.exitCode
|
|
26901
|
+
}
|
|
26902
|
+
}))
|
|
26903
|
+
});
|
|
26904
|
+
}
|
|
26905
|
+
break;
|
|
26906
|
+
}
|
|
26457
26907
|
if (store) {
|
|
26458
|
-
const itemId = (
|
|
26908
|
+
const itemId = (_i = (_h = (_g = part.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.itemId) != null ? _i : part.toolCallId;
|
|
26459
26909
|
input.push({ type: "item_reference", id: itemId });
|
|
26460
26910
|
} else {
|
|
26461
26911
|
warnings.push({
|
|
@@ -26515,10 +26965,26 @@ async function convertToOpenAIResponsesInput({
|
|
|
26515
26965
|
}
|
|
26516
26966
|
}
|
|
26517
26967
|
} else {
|
|
26518
|
-
|
|
26519
|
-
|
|
26520
|
-
|
|
26521
|
-
|
|
26968
|
+
const encryptedContent = providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent;
|
|
26969
|
+
if (encryptedContent != null) {
|
|
26970
|
+
const summaryParts = [];
|
|
26971
|
+
if (part.text.length > 0) {
|
|
26972
|
+
summaryParts.push({
|
|
26973
|
+
type: "summary_text",
|
|
26974
|
+
text: part.text
|
|
26975
|
+
});
|
|
26976
|
+
}
|
|
26977
|
+
input.push({
|
|
26978
|
+
type: "reasoning",
|
|
26979
|
+
encrypted_content: encryptedContent,
|
|
26980
|
+
summary: summaryParts
|
|
26981
|
+
});
|
|
26982
|
+
} else {
|
|
26983
|
+
warnings.push({
|
|
26984
|
+
type: "other",
|
|
26985
|
+
message: `Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(part)}.`
|
|
26986
|
+
});
|
|
26987
|
+
}
|
|
26522
26988
|
}
|
|
26523
26989
|
break;
|
|
26524
26990
|
}
|
|
@@ -26549,7 +27015,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
26549
27015
|
}
|
|
26550
27016
|
const output = part.output;
|
|
26551
27017
|
if (output.type === "execution-denied") {
|
|
26552
|
-
const approvalId = (
|
|
27018
|
+
const approvalId = (_k = (_j = output.providerOptions) == null ? void 0 : _j.openai) == null ? void 0 : _k.approvalId;
|
|
26553
27019
|
if (approvalId) {
|
|
26554
27020
|
continue;
|
|
26555
27021
|
}
|
|
@@ -26608,7 +27074,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
26608
27074
|
contentValue = output.value;
|
|
26609
27075
|
break;
|
|
26610
27076
|
case "execution-denied":
|
|
26611
|
-
contentValue = (
|
|
27077
|
+
contentValue = (_l = output.reason) != null ? _l : "Tool execution denied.";
|
|
26612
27078
|
break;
|
|
26613
27079
|
case "json":
|
|
26614
27080
|
case "error-json":
|
|
@@ -26735,7 +27201,8 @@ var openaiResponsesChunkSchema = lazySchema(
|
|
|
26735
27201
|
item: discriminatedUnion("type", [
|
|
26736
27202
|
object$1({
|
|
26737
27203
|
type: literal("message"),
|
|
26738
|
-
id: string()
|
|
27204
|
+
id: string(),
|
|
27205
|
+
phase: _enum$1(["commentary", "final_answer"]).nullish()
|
|
26739
27206
|
}),
|
|
26740
27207
|
object$1({
|
|
26741
27208
|
type: literal("reasoning"),
|
|
@@ -26824,6 +27291,25 @@ var openaiResponsesChunkSchema = lazySchema(
|
|
|
26824
27291
|
action: object$1({
|
|
26825
27292
|
commands: array$1(string())
|
|
26826
27293
|
})
|
|
27294
|
+
}),
|
|
27295
|
+
object$1({
|
|
27296
|
+
type: literal("shell_call_output"),
|
|
27297
|
+
id: string(),
|
|
27298
|
+
call_id: string(),
|
|
27299
|
+
status: _enum$1(["in_progress", "completed", "incomplete"]),
|
|
27300
|
+
output: array$1(
|
|
27301
|
+
object$1({
|
|
27302
|
+
stdout: string(),
|
|
27303
|
+
stderr: string(),
|
|
27304
|
+
outcome: discriminatedUnion("type", [
|
|
27305
|
+
object$1({ type: literal("timeout") }),
|
|
27306
|
+
object$1({
|
|
27307
|
+
type: literal("exit"),
|
|
27308
|
+
exit_code: number$1()
|
|
27309
|
+
})
|
|
27310
|
+
])
|
|
27311
|
+
})
|
|
27312
|
+
)
|
|
26827
27313
|
})
|
|
26828
27314
|
])
|
|
26829
27315
|
}),
|
|
@@ -26833,7 +27319,8 @@ var openaiResponsesChunkSchema = lazySchema(
|
|
|
26833
27319
|
item: discriminatedUnion("type", [
|
|
26834
27320
|
object$1({
|
|
26835
27321
|
type: literal("message"),
|
|
26836
|
-
id: string()
|
|
27322
|
+
id: string(),
|
|
27323
|
+
phase: _enum$1(["commentary", "final_answer"]).nullish()
|
|
26837
27324
|
}),
|
|
26838
27325
|
object$1({
|
|
26839
27326
|
type: literal("reasoning"),
|
|
@@ -26889,7 +27376,7 @@ var openaiResponsesChunkSchema = lazySchema(
|
|
|
26889
27376
|
url: string().nullish(),
|
|
26890
27377
|
pattern: string().nullish()
|
|
26891
27378
|
})
|
|
26892
|
-
])
|
|
27379
|
+
]).nullish()
|
|
26893
27380
|
}),
|
|
26894
27381
|
object$1({
|
|
26895
27382
|
type: literal("file_search_call"),
|
|
@@ -27003,6 +27490,25 @@ var openaiResponsesChunkSchema = lazySchema(
|
|
|
27003
27490
|
action: object$1({
|
|
27004
27491
|
commands: array$1(string())
|
|
27005
27492
|
})
|
|
27493
|
+
}),
|
|
27494
|
+
object$1({
|
|
27495
|
+
type: literal("shell_call_output"),
|
|
27496
|
+
id: string(),
|
|
27497
|
+
call_id: string(),
|
|
27498
|
+
status: _enum$1(["in_progress", "completed", "incomplete"]),
|
|
27499
|
+
output: array$1(
|
|
27500
|
+
object$1({
|
|
27501
|
+
stdout: string(),
|
|
27502
|
+
stderr: string(),
|
|
27503
|
+
outcome: discriminatedUnion("type", [
|
|
27504
|
+
object$1({ type: literal("timeout") }),
|
|
27505
|
+
object$1({
|
|
27506
|
+
type: literal("exit"),
|
|
27507
|
+
exit_code: number$1()
|
|
27508
|
+
})
|
|
27509
|
+
])
|
|
27510
|
+
})
|
|
27511
|
+
)
|
|
27006
27512
|
})
|
|
27007
27513
|
])
|
|
27008
27514
|
}),
|
|
@@ -27126,6 +27632,7 @@ var openaiResponsesResponseSchema = lazySchema(
|
|
|
27126
27632
|
type: literal("message"),
|
|
27127
27633
|
role: literal("assistant"),
|
|
27128
27634
|
id: string(),
|
|
27635
|
+
phase: _enum$1(["commentary", "final_answer"]).nullish(),
|
|
27129
27636
|
content: array$1(
|
|
27130
27637
|
object$1({
|
|
27131
27638
|
type: literal("output_text"),
|
|
@@ -27186,7 +27693,10 @@ var openaiResponsesResponseSchema = lazySchema(
|
|
|
27186
27693
|
sources: array$1(
|
|
27187
27694
|
discriminatedUnion("type", [
|
|
27188
27695
|
object$1({ type: literal("url"), url: string() }),
|
|
27189
|
-
object$1({
|
|
27696
|
+
object$1({
|
|
27697
|
+
type: literal("api"),
|
|
27698
|
+
name: string()
|
|
27699
|
+
})
|
|
27190
27700
|
])
|
|
27191
27701
|
).nullish()
|
|
27192
27702
|
}),
|
|
@@ -27199,7 +27709,7 @@ var openaiResponsesResponseSchema = lazySchema(
|
|
|
27199
27709
|
url: string().nullish(),
|
|
27200
27710
|
pattern: string().nullish()
|
|
27201
27711
|
})
|
|
27202
|
-
])
|
|
27712
|
+
]).nullish()
|
|
27203
27713
|
}),
|
|
27204
27714
|
object$1({
|
|
27205
27715
|
type: literal("file_search_call"),
|
|
@@ -27348,6 +27858,25 @@ var openaiResponsesResponseSchema = lazySchema(
|
|
|
27348
27858
|
action: object$1({
|
|
27349
27859
|
commands: array$1(string())
|
|
27350
27860
|
})
|
|
27861
|
+
}),
|
|
27862
|
+
object$1({
|
|
27863
|
+
type: literal("shell_call_output"),
|
|
27864
|
+
id: string(),
|
|
27865
|
+
call_id: string(),
|
|
27866
|
+
status: _enum$1(["in_progress", "completed", "incomplete"]),
|
|
27867
|
+
output: array$1(
|
|
27868
|
+
object$1({
|
|
27869
|
+
stdout: string(),
|
|
27870
|
+
stderr: string(),
|
|
27871
|
+
outcome: discriminatedUnion("type", [
|
|
27872
|
+
object$1({ type: literal("timeout") }),
|
|
27873
|
+
object$1({
|
|
27874
|
+
type: literal("exit"),
|
|
27875
|
+
exit_code: number$1()
|
|
27876
|
+
})
|
|
27877
|
+
])
|
|
27878
|
+
})
|
|
27879
|
+
)
|
|
27351
27880
|
})
|
|
27352
27881
|
])
|
|
27353
27882
|
).optional(),
|
|
@@ -27564,8 +28093,15 @@ async function prepareResponsesTools({
|
|
|
27564
28093
|
break;
|
|
27565
28094
|
}
|
|
27566
28095
|
case "openai.shell": {
|
|
28096
|
+
const args = await validateTypes$1({
|
|
28097
|
+
value: tool2.args,
|
|
28098
|
+
schema: shellArgsSchema
|
|
28099
|
+
});
|
|
27567
28100
|
openaiTools2.push({
|
|
27568
|
-
type: "shell"
|
|
28101
|
+
type: "shell",
|
|
28102
|
+
...args.environment && {
|
|
28103
|
+
environment: mapShellEnvironment(args.environment)
|
|
28104
|
+
}
|
|
27569
28105
|
});
|
|
27570
28106
|
break;
|
|
27571
28107
|
}
|
|
@@ -27695,6 +28231,52 @@ async function prepareResponsesTools({
|
|
|
27695
28231
|
}
|
|
27696
28232
|
}
|
|
27697
28233
|
}
|
|
28234
|
+
function mapShellEnvironment(environment) {
|
|
28235
|
+
if (environment.type === "containerReference") {
|
|
28236
|
+
const env2 = environment;
|
|
28237
|
+
return {
|
|
28238
|
+
type: "container_reference",
|
|
28239
|
+
container_id: env2.containerId
|
|
28240
|
+
};
|
|
28241
|
+
}
|
|
28242
|
+
if (environment.type === "containerAuto") {
|
|
28243
|
+
const env2 = environment;
|
|
28244
|
+
return {
|
|
28245
|
+
type: "container_auto",
|
|
28246
|
+
file_ids: env2.fileIds,
|
|
28247
|
+
memory_limit: env2.memoryLimit,
|
|
28248
|
+
network_policy: env2.networkPolicy == null ? void 0 : env2.networkPolicy.type === "disabled" ? { type: "disabled" } : {
|
|
28249
|
+
type: "allowlist",
|
|
28250
|
+
allowed_domains: env2.networkPolicy.allowedDomains,
|
|
28251
|
+
domain_secrets: env2.networkPolicy.domainSecrets
|
|
28252
|
+
},
|
|
28253
|
+
skills: mapShellSkills(env2.skills)
|
|
28254
|
+
};
|
|
28255
|
+
}
|
|
28256
|
+
const env = environment;
|
|
28257
|
+
return {
|
|
28258
|
+
type: "local",
|
|
28259
|
+
skills: env.skills
|
|
28260
|
+
};
|
|
28261
|
+
}
|
|
28262
|
+
function mapShellSkills(skills) {
|
|
28263
|
+
return skills == null ? void 0 : skills.map(
|
|
28264
|
+
(skill) => skill.type === "skillReference" ? {
|
|
28265
|
+
type: "skill_reference",
|
|
28266
|
+
skill_id: skill.skillId,
|
|
28267
|
+
version: skill.version
|
|
28268
|
+
} : {
|
|
28269
|
+
type: "inline",
|
|
28270
|
+
name: skill.name,
|
|
28271
|
+
description: skill.description,
|
|
28272
|
+
source: {
|
|
28273
|
+
type: "base64",
|
|
28274
|
+
media_type: skill.source.mediaType,
|
|
28275
|
+
data: skill.source.data
|
|
28276
|
+
}
|
|
28277
|
+
}
|
|
28278
|
+
);
|
|
28279
|
+
}
|
|
27698
28280
|
function extractApprovalRequestIdToToolCallIdMapping(prompt) {
|
|
27699
28281
|
var _a10, _b9;
|
|
27700
28282
|
const mapping = {};
|
|
@@ -27738,7 +28320,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
27738
28320
|
toolChoice,
|
|
27739
28321
|
responseFormat
|
|
27740
28322
|
}) {
|
|
27741
|
-
var _a10, _b9, _c, _d, _e, _f;
|
|
28323
|
+
var _a10, _b9, _c, _d, _e, _f, _g, _h, _i;
|
|
27742
28324
|
const warnings = [];
|
|
27743
28325
|
const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);
|
|
27744
28326
|
if (topK != null) {
|
|
@@ -27942,6 +28524,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
27942
28524
|
tools,
|
|
27943
28525
|
toolChoice
|
|
27944
28526
|
});
|
|
28527
|
+
const shellToolEnvType = (_i = (_h = (_g = tools == null ? void 0 : tools.find(
|
|
28528
|
+
(tool2) => tool2.type === "provider" && tool2.id === "openai.shell"
|
|
28529
|
+
)) == null ? void 0 : _g.args) == null ? void 0 : _h.environment) == null ? void 0 : _i.type;
|
|
28530
|
+
const isShellProviderExecuted = shellToolEnvType === "containerAuto" || shellToolEnvType === "containerReference";
|
|
27945
28531
|
return {
|
|
27946
28532
|
webSearchToolName,
|
|
27947
28533
|
args: {
|
|
@@ -27952,7 +28538,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
27952
28538
|
warnings: [...warnings, ...toolWarnings],
|
|
27953
28539
|
store,
|
|
27954
28540
|
toolNameMapping,
|
|
27955
|
-
providerOptionsName
|
|
28541
|
+
providerOptionsName,
|
|
28542
|
+
isShellProviderExecuted
|
|
27956
28543
|
};
|
|
27957
28544
|
}
|
|
27958
28545
|
async doGenerate(options) {
|
|
@@ -27962,7 +28549,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
27962
28549
|
warnings,
|
|
27963
28550
|
webSearchToolName,
|
|
27964
28551
|
toolNameMapping,
|
|
27965
|
-
providerOptionsName
|
|
28552
|
+
providerOptionsName,
|
|
28553
|
+
isShellProviderExecuted
|
|
27966
28554
|
} = await this.getArgs(options);
|
|
27967
28555
|
const url2 = this.config.url({
|
|
27968
28556
|
path: "/responses",
|
|
@@ -28062,6 +28650,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28062
28650
|
commands: part.action.commands
|
|
28063
28651
|
}
|
|
28064
28652
|
}),
|
|
28653
|
+
...isShellProviderExecuted && { providerExecuted: true },
|
|
28065
28654
|
providerMetadata: {
|
|
28066
28655
|
[providerOptionsName]: {
|
|
28067
28656
|
itemId: part.id
|
|
@@ -28070,6 +28659,24 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28070
28659
|
});
|
|
28071
28660
|
break;
|
|
28072
28661
|
}
|
|
28662
|
+
case "shell_call_output": {
|
|
28663
|
+
content.push({
|
|
28664
|
+
type: "tool-result",
|
|
28665
|
+
toolCallId: part.call_id,
|
|
28666
|
+
toolName: toolNameMapping.toCustomToolName("shell"),
|
|
28667
|
+
result: {
|
|
28668
|
+
output: part.output.map((item) => ({
|
|
28669
|
+
stdout: item.stdout,
|
|
28670
|
+
stderr: item.stderr,
|
|
28671
|
+
outcome: item.outcome.type === "exit" ? {
|
|
28672
|
+
type: "exit",
|
|
28673
|
+
exitCode: item.outcome.exit_code
|
|
28674
|
+
} : { type: "timeout" }
|
|
28675
|
+
}))
|
|
28676
|
+
}
|
|
28677
|
+
});
|
|
28678
|
+
break;
|
|
28679
|
+
}
|
|
28073
28680
|
case "message": {
|
|
28074
28681
|
for (const contentPart of part.content) {
|
|
28075
28682
|
if (((_c = (_b9 = options.providerOptions) == null ? void 0 : _b9[providerOptionsName]) == null ? void 0 : _c.logprobs) && contentPart.logprobs) {
|
|
@@ -28077,6 +28684,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28077
28684
|
}
|
|
28078
28685
|
const providerMetadata2 = {
|
|
28079
28686
|
itemId: part.id,
|
|
28687
|
+
...part.phase != null && { phase: part.phase },
|
|
28080
28688
|
...contentPart.annotations.length > 0 && {
|
|
28081
28689
|
annotations: contentPart.annotations
|
|
28082
28690
|
}
|
|
@@ -28359,7 +28967,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28359
28967
|
webSearchToolName,
|
|
28360
28968
|
toolNameMapping,
|
|
28361
28969
|
store,
|
|
28362
|
-
providerOptionsName
|
|
28970
|
+
providerOptionsName,
|
|
28971
|
+
isShellProviderExecuted
|
|
28363
28972
|
} = await this.getArgs(options);
|
|
28364
28973
|
const { responseHeaders, value: response } = await postJsonToApi$1({
|
|
28365
28974
|
url: this.config.url({
|
|
@@ -28390,6 +28999,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28390
28999
|
let responseId = null;
|
|
28391
29000
|
const ongoingToolCalls = {};
|
|
28392
29001
|
const ongoingAnnotations = [];
|
|
29002
|
+
let activeMessagePhase;
|
|
28393
29003
|
let hasFunctionCall = false;
|
|
28394
29004
|
const activeReasoning = {};
|
|
28395
29005
|
let serviceTier;
|
|
@@ -28400,7 +29010,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28400
29010
|
controller.enqueue({ type: "stream-start", warnings });
|
|
28401
29011
|
},
|
|
28402
29012
|
transform(chunk, controller) {
|
|
28403
|
-
var _a10, _b9, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
|
|
29013
|
+
var _a10, _b9, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
|
|
28404
29014
|
if (options.includeRawChunks) {
|
|
28405
29015
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
28406
29016
|
}
|
|
@@ -28538,14 +29148,19 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28538
29148
|
toolName: toolNameMapping.toCustomToolName("shell"),
|
|
28539
29149
|
toolCallId: value.item.call_id
|
|
28540
29150
|
};
|
|
28541
|
-
} else if (value.item.type === "
|
|
29151
|
+
} else if (value.item.type === "shell_call_output") ;
|
|
29152
|
+
else if (value.item.type === "message") {
|
|
28542
29153
|
ongoingAnnotations.splice(0, ongoingAnnotations.length);
|
|
29154
|
+
activeMessagePhase = (_a10 = value.item.phase) != null ? _a10 : void 0;
|
|
28543
29155
|
controller.enqueue({
|
|
28544
29156
|
type: "text-start",
|
|
28545
29157
|
id: value.item.id,
|
|
28546
29158
|
providerMetadata: {
|
|
28547
29159
|
[providerOptionsName]: {
|
|
28548
|
-
itemId: value.item.id
|
|
29160
|
+
itemId: value.item.id,
|
|
29161
|
+
...value.item.phase != null && {
|
|
29162
|
+
phase: value.item.phase
|
|
29163
|
+
}
|
|
28549
29164
|
}
|
|
28550
29165
|
}
|
|
28551
29166
|
});
|
|
@@ -28560,19 +29175,22 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28560
29175
|
providerMetadata: {
|
|
28561
29176
|
[providerOptionsName]: {
|
|
28562
29177
|
itemId: value.item.id,
|
|
28563
|
-
reasoningEncryptedContent: (
|
|
29178
|
+
reasoningEncryptedContent: (_b9 = value.item.encrypted_content) != null ? _b9 : null
|
|
28564
29179
|
}
|
|
28565
29180
|
}
|
|
28566
29181
|
});
|
|
28567
29182
|
}
|
|
28568
29183
|
} else if (isResponseOutputItemDoneChunk(value)) {
|
|
28569
29184
|
if (value.item.type === "message") {
|
|
29185
|
+
const phase = (_c = value.item.phase) != null ? _c : activeMessagePhase;
|
|
29186
|
+
activeMessagePhase = void 0;
|
|
28570
29187
|
controller.enqueue({
|
|
28571
29188
|
type: "text-end",
|
|
28572
29189
|
id: value.item.id,
|
|
28573
29190
|
providerMetadata: {
|
|
28574
29191
|
[providerOptionsName]: {
|
|
28575
29192
|
itemId: value.item.id,
|
|
29193
|
+
...phase != null && { phase },
|
|
28576
29194
|
...ongoingAnnotations.length > 0 && {
|
|
28577
29195
|
annotations: ongoingAnnotations
|
|
28578
29196
|
}
|
|
@@ -28637,13 +29255,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28637
29255
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
28638
29256
|
result: {
|
|
28639
29257
|
queries: value.item.queries,
|
|
28640
|
-
results: (
|
|
29258
|
+
results: (_e = (_d = value.item.results) == null ? void 0 : _d.map((result) => ({
|
|
28641
29259
|
attributes: result.attributes,
|
|
28642
29260
|
fileId: result.file_id,
|
|
28643
29261
|
filename: result.filename,
|
|
28644
29262
|
score: result.score,
|
|
28645
29263
|
text: result.text
|
|
28646
|
-
}))) != null ?
|
|
29264
|
+
}))) != null ? _e : null
|
|
28647
29265
|
}
|
|
28648
29266
|
});
|
|
28649
29267
|
} else if (value.item.type === "code_interpreter_call") {
|
|
@@ -28667,10 +29285,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28667
29285
|
});
|
|
28668
29286
|
} else if (value.item.type === "mcp_call") {
|
|
28669
29287
|
ongoingToolCalls[value.output_index] = void 0;
|
|
28670
|
-
const approvalRequestId = (
|
|
28671
|
-
const aliasedToolCallId = approvalRequestId != null ? (
|
|
29288
|
+
const approvalRequestId = (_f = value.item.approval_request_id) != null ? _f : void 0;
|
|
29289
|
+
const aliasedToolCallId = approvalRequestId != null ? (_h = (_g = approvalRequestIdToDummyToolCallIdFromStream.get(
|
|
28672
29290
|
approvalRequestId
|
|
28673
|
-
)) != null ?
|
|
29291
|
+
)) != null ? _g : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _h : value.item.id : value.item.id;
|
|
28674
29292
|
const toolName = `mcp.${value.item.name}`;
|
|
28675
29293
|
controller.enqueue({
|
|
28676
29294
|
type: "tool-call",
|
|
@@ -28740,8 +29358,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28740
29358
|
ongoingToolCalls[value.output_index] = void 0;
|
|
28741
29359
|
} else if (value.item.type === "mcp_approval_request") {
|
|
28742
29360
|
ongoingToolCalls[value.output_index] = void 0;
|
|
28743
|
-
const dummyToolCallId = (
|
|
28744
|
-
const approvalRequestId = (
|
|
29361
|
+
const dummyToolCallId = (_k = (_j = (_i = self2.config).generateId) == null ? void 0 : _j.call(_i)) != null ? _k : generateId$1();
|
|
29362
|
+
const approvalRequestId = (_l = value.item.approval_request_id) != null ? _l : value.item.id;
|
|
28745
29363
|
approvalRequestIdToDummyToolCallIdFromStream.set(
|
|
28746
29364
|
approvalRequestId,
|
|
28747
29365
|
dummyToolCallId
|
|
@@ -28791,10 +29409,31 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28791
29409
|
commands: value.item.action.commands
|
|
28792
29410
|
}
|
|
28793
29411
|
}),
|
|
29412
|
+
...isShellProviderExecuted && {
|
|
29413
|
+
providerExecuted: true
|
|
29414
|
+
},
|
|
28794
29415
|
providerMetadata: {
|
|
28795
29416
|
[providerOptionsName]: { itemId: value.item.id }
|
|
28796
29417
|
}
|
|
28797
29418
|
});
|
|
29419
|
+
} else if (value.item.type === "shell_call_output") {
|
|
29420
|
+
controller.enqueue({
|
|
29421
|
+
type: "tool-result",
|
|
29422
|
+
toolCallId: value.item.call_id,
|
|
29423
|
+
toolName: toolNameMapping.toCustomToolName("shell"),
|
|
29424
|
+
result: {
|
|
29425
|
+
output: value.item.output.map(
|
|
29426
|
+
(item) => ({
|
|
29427
|
+
stdout: item.stdout,
|
|
29428
|
+
stderr: item.stderr,
|
|
29429
|
+
outcome: item.outcome.type === "exit" ? {
|
|
29430
|
+
type: "exit",
|
|
29431
|
+
exitCode: item.outcome.exit_code
|
|
29432
|
+
} : { type: "timeout" }
|
|
29433
|
+
})
|
|
29434
|
+
)
|
|
29435
|
+
}
|
|
29436
|
+
});
|
|
28798
29437
|
} else if (value.item.type === "reasoning") {
|
|
28799
29438
|
const activeReasoningPart = activeReasoning[value.item.id];
|
|
28800
29439
|
const summaryPartIndices = Object.entries(
|
|
@@ -28809,7 +29448,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28809
29448
|
providerMetadata: {
|
|
28810
29449
|
[providerOptionsName]: {
|
|
28811
29450
|
itemId: value.item.id,
|
|
28812
|
-
reasoningEncryptedContent: (
|
|
29451
|
+
reasoningEncryptedContent: (_m = value.item.encrypted_content) != null ? _m : null
|
|
28813
29452
|
}
|
|
28814
29453
|
}
|
|
28815
29454
|
});
|
|
@@ -28913,7 +29552,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28913
29552
|
id: value.item_id,
|
|
28914
29553
|
delta: value.delta
|
|
28915
29554
|
});
|
|
28916
|
-
if (((
|
|
29555
|
+
if (((_o = (_n = options.providerOptions) == null ? void 0 : _n[providerOptionsName]) == null ? void 0 : _o.logprobs) && value.logprobs) {
|
|
28917
29556
|
logprobs.push(value.logprobs);
|
|
28918
29557
|
}
|
|
28919
29558
|
} else if (value.type === "response.reasoning_summary_part.added") {
|
|
@@ -28942,7 +29581,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28942
29581
|
providerMetadata: {
|
|
28943
29582
|
[providerOptionsName]: {
|
|
28944
29583
|
itemId: value.item_id,
|
|
28945
|
-
reasoningEncryptedContent: (
|
|
29584
|
+
reasoningEncryptedContent: (_q = (_p = activeReasoning[value.item_id]) == null ? void 0 : _p.encryptedContent) != null ? _q : null
|
|
28946
29585
|
}
|
|
28947
29586
|
}
|
|
28948
29587
|
});
|
|
@@ -28976,10 +29615,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28976
29615
|
} else if (isResponseFinishedChunk(value)) {
|
|
28977
29616
|
finishReason = {
|
|
28978
29617
|
unified: mapOpenAIResponseFinishReason({
|
|
28979
|
-
finishReason: (
|
|
29618
|
+
finishReason: (_r = value.response.incomplete_details) == null ? void 0 : _r.reason,
|
|
28980
29619
|
hasFunctionCall
|
|
28981
29620
|
}),
|
|
28982
|
-
raw: (
|
|
29621
|
+
raw: (_t = (_s = value.response.incomplete_details) == null ? void 0 : _s.reason) != null ? _t : void 0
|
|
28983
29622
|
};
|
|
28984
29623
|
usage = value.response.usage;
|
|
28985
29624
|
if (typeof value.response.service_tier === "string") {
|
|
@@ -28991,7 +29630,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28991
29630
|
controller.enqueue({
|
|
28992
29631
|
type: "source",
|
|
28993
29632
|
sourceType: "url",
|
|
28994
|
-
id: (
|
|
29633
|
+
id: (_w = (_v = (_u = self2.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : generateId$1(),
|
|
28995
29634
|
url: value.annotation.url,
|
|
28996
29635
|
title: value.annotation.title
|
|
28997
29636
|
});
|
|
@@ -28999,7 +29638,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
28999
29638
|
controller.enqueue({
|
|
29000
29639
|
type: "source",
|
|
29001
29640
|
sourceType: "document",
|
|
29002
|
-
id: (
|
|
29641
|
+
id: (_z = (_y = (_x = self2.config).generateId) == null ? void 0 : _y.call(_x)) != null ? _z : generateId$1(),
|
|
29003
29642
|
mediaType: "text/plain",
|
|
29004
29643
|
title: value.annotation.filename,
|
|
29005
29644
|
filename: value.annotation.filename,
|
|
@@ -29015,7 +29654,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
29015
29654
|
controller.enqueue({
|
|
29016
29655
|
type: "source",
|
|
29017
29656
|
sourceType: "document",
|
|
29018
|
-
id: (
|
|
29657
|
+
id: (_C = (_B = (_A = self2.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : generateId$1(),
|
|
29019
29658
|
mediaType: "text/plain",
|
|
29020
29659
|
title: value.annotation.filename,
|
|
29021
29660
|
filename: value.annotation.filename,
|
|
@@ -29031,7 +29670,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
29031
29670
|
controller.enqueue({
|
|
29032
29671
|
type: "source",
|
|
29033
29672
|
sourceType: "document",
|
|
29034
|
-
id: (
|
|
29673
|
+
id: (_F = (_E = (_D = self2.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : generateId$1(),
|
|
29035
29674
|
mediaType: "application/octet-stream",
|
|
29036
29675
|
title: value.annotation.file_id,
|
|
29037
29676
|
filename: value.annotation.file_id,
|
|
@@ -29111,6 +29750,9 @@ function isErrorChunk(chunk) {
|
|
|
29111
29750
|
}
|
|
29112
29751
|
function mapWebSearchOutput(action) {
|
|
29113
29752
|
var _a10;
|
|
29753
|
+
if (action == null) {
|
|
29754
|
+
return {};
|
|
29755
|
+
}
|
|
29114
29756
|
switch (action.type) {
|
|
29115
29757
|
case "search":
|
|
29116
29758
|
return {
|
|
@@ -29463,7 +30105,7 @@ var OpenAITranscriptionModel = class {
|
|
|
29463
30105
|
};
|
|
29464
30106
|
}
|
|
29465
30107
|
};
|
|
29466
|
-
var VERSION$2 = "3.0.
|
|
30108
|
+
var VERSION$2 = "3.0.36";
|
|
29467
30109
|
function createOpenAI(options = {}) {
|
|
29468
30110
|
var _a10, _b9;
|
|
29469
30111
|
const baseURL = (_a10 = withoutTrailingSlash$1(
|
|
@@ -32528,7 +33170,7 @@ function requireScope() {
|
|
|
32528
33170
|
(function(exports) {
|
|
32529
33171
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32530
33172
|
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
|
|
32531
|
-
const code_1 = requireCode$1();
|
|
33173
|
+
const code_1 = /* @__PURE__ */ requireCode$1();
|
|
32532
33174
|
class ValueError extends Error {
|
|
32533
33175
|
constructor(name16) {
|
|
32534
33176
|
super(`CodeGen: "code" for ${name16} not defined`);
|
|
@@ -32674,9 +33316,9 @@ function requireCodegen() {
|
|
|
32674
33316
|
(function(exports) {
|
|
32675
33317
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32676
33318
|
exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;
|
|
32677
|
-
const code_1 = requireCode$1();
|
|
32678
|
-
const scope_1 = requireScope();
|
|
32679
|
-
var code_2 = requireCode$1();
|
|
33319
|
+
const code_1 = /* @__PURE__ */ requireCode$1();
|
|
33320
|
+
const scope_1 = /* @__PURE__ */ requireScope();
|
|
33321
|
+
var code_2 = /* @__PURE__ */ requireCode$1();
|
|
32680
33322
|
Object.defineProperty(exports, "_", { enumerable: true, get: function() {
|
|
32681
33323
|
return code_2._;
|
|
32682
33324
|
} });
|
|
@@ -32701,7 +33343,7 @@ function requireCodegen() {
|
|
|
32701
33343
|
Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
|
|
32702
33344
|
return code_2.Name;
|
|
32703
33345
|
} });
|
|
32704
|
-
var scope_2 = requireScope();
|
|
33346
|
+
var scope_2 = /* @__PURE__ */ requireScope();
|
|
32705
33347
|
Object.defineProperty(exports, "Scope", { enumerable: true, get: function() {
|
|
32706
33348
|
return scope_2.Scope;
|
|
32707
33349
|
} });
|
|
@@ -33395,8 +34037,8 @@ function requireUtil() {
|
|
|
33395
34037
|
hasRequiredUtil = 1;
|
|
33396
34038
|
Object.defineProperty(util, "__esModule", { value: true });
|
|
33397
34039
|
util.checkStrictMode = util.getErrorPath = util.Type = util.useFunc = util.setEvaluated = util.evaluatedPropsToName = util.mergeEvaluated = util.eachItem = util.unescapeJsonPointer = util.escapeJsonPointer = util.escapeFragment = util.unescapeFragment = util.schemaRefOrVal = util.schemaHasRulesButRef = util.schemaHasRules = util.checkUnknownRules = util.alwaysValidSchema = util.toHash = void 0;
|
|
33398
|
-
const codegen_1 = requireCodegen();
|
|
33399
|
-
const code_1 = requireCode$1();
|
|
34040
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34041
|
+
const code_1 = /* @__PURE__ */ requireCode$1();
|
|
33400
34042
|
function toHash(arr) {
|
|
33401
34043
|
const hash = {};
|
|
33402
34044
|
for (const item of arr)
|
|
@@ -33561,7 +34203,7 @@ function requireNames() {
|
|
|
33561
34203
|
if (hasRequiredNames) return names;
|
|
33562
34204
|
hasRequiredNames = 1;
|
|
33563
34205
|
Object.defineProperty(names, "__esModule", { value: true });
|
|
33564
|
-
const codegen_1 = requireCodegen();
|
|
34206
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
33565
34207
|
const names$1 = {
|
|
33566
34208
|
// validation function arguments
|
|
33567
34209
|
data: new codegen_1.Name("data"),
|
|
@@ -33601,9 +34243,9 @@ function requireErrors() {
|
|
|
33601
34243
|
(function(exports) {
|
|
33602
34244
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33603
34245
|
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
|
|
33604
|
-
const codegen_1 = requireCodegen();
|
|
33605
|
-
const util_1 = requireUtil();
|
|
33606
|
-
const names_1 = requireNames();
|
|
34246
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34247
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
34248
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
33607
34249
|
exports.keywordError = {
|
|
33608
34250
|
message: ({ keyword: keyword2 }) => (0, codegen_1.str)`must pass "${keyword2}" keyword validation`
|
|
33609
34251
|
};
|
|
@@ -33723,9 +34365,9 @@ function requireBoolSchema() {
|
|
|
33723
34365
|
hasRequiredBoolSchema = 1;
|
|
33724
34366
|
Object.defineProperty(boolSchema, "__esModule", { value: true });
|
|
33725
34367
|
boolSchema.boolOrEmptySchema = boolSchema.topBoolOrEmptySchema = void 0;
|
|
33726
|
-
const errors_1 = requireErrors();
|
|
33727
|
-
const codegen_1 = requireCodegen();
|
|
33728
|
-
const names_1 = requireNames();
|
|
34368
|
+
const errors_1 = /* @__PURE__ */ requireErrors();
|
|
34369
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34370
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
33729
34371
|
const boolError = {
|
|
33730
34372
|
message: "boolean schema is false"
|
|
33731
34373
|
};
|
|
@@ -33828,11 +34470,11 @@ function requireDataType() {
|
|
|
33828
34470
|
hasRequiredDataType = 1;
|
|
33829
34471
|
Object.defineProperty(dataType, "__esModule", { value: true });
|
|
33830
34472
|
dataType.reportTypeError = dataType.checkDataTypes = dataType.checkDataType = dataType.coerceAndCheckDataType = dataType.getJSONTypes = dataType.getSchemaTypes = dataType.DataType = void 0;
|
|
33831
|
-
const rules_1 = requireRules();
|
|
33832
|
-
const applicability_1 = requireApplicability();
|
|
33833
|
-
const errors_1 = requireErrors();
|
|
33834
|
-
const codegen_1 = requireCodegen();
|
|
33835
|
-
const util_1 = requireUtil();
|
|
34473
|
+
const rules_1 = /* @__PURE__ */ requireRules();
|
|
34474
|
+
const applicability_1 = /* @__PURE__ */ requireApplicability();
|
|
34475
|
+
const errors_1 = /* @__PURE__ */ requireErrors();
|
|
34476
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34477
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
33836
34478
|
var DataType;
|
|
33837
34479
|
(function(DataType2) {
|
|
33838
34480
|
DataType2[DataType2["Correct"] = 0] = "Correct";
|
|
@@ -34012,8 +34654,8 @@ function requireDefaults() {
|
|
|
34012
34654
|
hasRequiredDefaults = 1;
|
|
34013
34655
|
Object.defineProperty(defaults, "__esModule", { value: true });
|
|
34014
34656
|
defaults.assignDefaults = void 0;
|
|
34015
|
-
const codegen_1 = requireCodegen();
|
|
34016
|
-
const util_1 = requireUtil();
|
|
34657
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34658
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
34017
34659
|
function assignDefaults(it, ty) {
|
|
34018
34660
|
const { properties: properties2, items: items2 } = it.schema;
|
|
34019
34661
|
if (ty === "object" && properties2) {
|
|
@@ -34050,10 +34692,10 @@ function requireCode() {
|
|
|
34050
34692
|
hasRequiredCode = 1;
|
|
34051
34693
|
Object.defineProperty(code, "__esModule", { value: true });
|
|
34052
34694
|
code.validateUnion = code.validateArray = code.usePattern = code.callValidateCode = code.schemaProperties = code.allSchemaProperties = code.noPropertyInData = code.propertyInData = code.isOwnProperty = code.hasPropFunc = code.reportMissingProp = code.checkMissingProp = code.checkReportMissingProp = void 0;
|
|
34053
|
-
const codegen_1 = requireCodegen();
|
|
34054
|
-
const util_1 = requireUtil();
|
|
34055
|
-
const names_1 = requireNames();
|
|
34056
|
-
const util_2 = requireUtil();
|
|
34695
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34696
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
34697
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
34698
|
+
const util_2 = /* @__PURE__ */ requireUtil();
|
|
34057
34699
|
function checkReportMissingProp(cxt, prop) {
|
|
34058
34700
|
const { gen, data, it } = cxt;
|
|
34059
34701
|
gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
|
|
@@ -34182,10 +34824,10 @@ function requireKeyword() {
|
|
|
34182
34824
|
hasRequiredKeyword = 1;
|
|
34183
34825
|
Object.defineProperty(keyword, "__esModule", { value: true });
|
|
34184
34826
|
keyword.validateKeywordUsage = keyword.validSchemaType = keyword.funcKeywordCode = keyword.macroKeywordCode = void 0;
|
|
34185
|
-
const codegen_1 = requireCodegen();
|
|
34186
|
-
const names_1 = requireNames();
|
|
34187
|
-
const code_1 = requireCode();
|
|
34188
|
-
const errors_1 = requireErrors();
|
|
34827
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34828
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
34829
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
34830
|
+
const errors_1 = /* @__PURE__ */ requireErrors();
|
|
34189
34831
|
function macroKeywordCode(cxt, def) {
|
|
34190
34832
|
const { gen, keyword: keyword2, schema, parentSchema, it } = cxt;
|
|
34191
34833
|
const macroSchema = def.macro.call(it.self, schema, parentSchema, it);
|
|
@@ -34300,8 +34942,8 @@ function requireSubschema() {
|
|
|
34300
34942
|
hasRequiredSubschema = 1;
|
|
34301
34943
|
Object.defineProperty(subschema, "__esModule", { value: true });
|
|
34302
34944
|
subschema.extendSubschemaMode = subschema.extendSubschemaData = subschema.getSubschema = void 0;
|
|
34303
|
-
const codegen_1 = requireCodegen();
|
|
34304
|
-
const util_1 = requireUtil();
|
|
34945
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34946
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
34305
34947
|
function getSubschema(it, { keyword: keyword2, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {
|
|
34306
34948
|
if (keyword2 !== void 0 && schema !== void 0) {
|
|
34307
34949
|
throw new Error('both "keyword" and "schema" passed, only one allowed');
|
|
@@ -34506,7 +35148,7 @@ function requireResolve() {
|
|
|
34506
35148
|
hasRequiredResolve = 1;
|
|
34507
35149
|
Object.defineProperty(resolve, "__esModule", { value: true });
|
|
34508
35150
|
resolve.getSchemaRefs = resolve.resolveUrl = resolve.normalizeId = resolve._getFullPath = resolve.getFullPath = resolve.inlineRef = void 0;
|
|
34509
|
-
const util_1 = requireUtil();
|
|
35151
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
34510
35152
|
const equal2 = requireFastDeepEqual();
|
|
34511
35153
|
const traverse = requireJsonSchemaTraverse();
|
|
34512
35154
|
const SIMPLE_INLINED = /* @__PURE__ */ new Set([
|
|
@@ -34661,18 +35303,18 @@ function requireValidate() {
|
|
|
34661
35303
|
hasRequiredValidate = 1;
|
|
34662
35304
|
Object.defineProperty(validate, "__esModule", { value: true });
|
|
34663
35305
|
validate.getData = validate.KeywordCxt = validate.validateFunctionCode = void 0;
|
|
34664
|
-
const boolSchema_1 = requireBoolSchema();
|
|
34665
|
-
const dataType_1 = requireDataType();
|
|
34666
|
-
const applicability_1 = requireApplicability();
|
|
34667
|
-
const dataType_2 = requireDataType();
|
|
34668
|
-
const defaults_1 = requireDefaults();
|
|
34669
|
-
const keyword_1 = requireKeyword();
|
|
34670
|
-
const subschema_1 = requireSubschema();
|
|
34671
|
-
const codegen_1 = requireCodegen();
|
|
34672
|
-
const names_1 = requireNames();
|
|
34673
|
-
const resolve_1 = requireResolve();
|
|
34674
|
-
const util_1 = requireUtil();
|
|
34675
|
-
const errors_1 = requireErrors();
|
|
35306
|
+
const boolSchema_1 = /* @__PURE__ */ requireBoolSchema();
|
|
35307
|
+
const dataType_1 = /* @__PURE__ */ requireDataType();
|
|
35308
|
+
const applicability_1 = /* @__PURE__ */ requireApplicability();
|
|
35309
|
+
const dataType_2 = /* @__PURE__ */ requireDataType();
|
|
35310
|
+
const defaults_1 = /* @__PURE__ */ requireDefaults();
|
|
35311
|
+
const keyword_1 = /* @__PURE__ */ requireKeyword();
|
|
35312
|
+
const subschema_1 = /* @__PURE__ */ requireSubschema();
|
|
35313
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
35314
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
35315
|
+
const resolve_1 = /* @__PURE__ */ requireResolve();
|
|
35316
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
35317
|
+
const errors_1 = /* @__PURE__ */ requireErrors();
|
|
34676
35318
|
function validateFunctionCode(it) {
|
|
34677
35319
|
if (isSchemaObj(it)) {
|
|
34678
35320
|
checkKeywords(it);
|
|
@@ -35183,7 +35825,7 @@ function requireRef_error() {
|
|
|
35183
35825
|
if (hasRequiredRef_error) return ref_error;
|
|
35184
35826
|
hasRequiredRef_error = 1;
|
|
35185
35827
|
Object.defineProperty(ref_error, "__esModule", { value: true });
|
|
35186
|
-
const resolve_1 = requireResolve();
|
|
35828
|
+
const resolve_1 = /* @__PURE__ */ requireResolve();
|
|
35187
35829
|
class MissingRefError extends Error {
|
|
35188
35830
|
constructor(resolver, baseId, ref2, msg) {
|
|
35189
35831
|
super(msg || `can't resolve reference ${ref2} from id ${baseId}`);
|
|
@@ -35201,12 +35843,12 @@ function requireCompile() {
|
|
|
35201
35843
|
hasRequiredCompile = 1;
|
|
35202
35844
|
Object.defineProperty(compile, "__esModule", { value: true });
|
|
35203
35845
|
compile.resolveSchema = compile.getCompilingSchema = compile.resolveRef = compile.compileSchema = compile.SchemaEnv = void 0;
|
|
35204
|
-
const codegen_1 = requireCodegen();
|
|
35205
|
-
const validation_error_1 = requireValidation_error();
|
|
35206
|
-
const names_1 = requireNames();
|
|
35207
|
-
const resolve_1 = requireResolve();
|
|
35208
|
-
const util_1 = requireUtil();
|
|
35209
|
-
const validate_1 = requireValidate();
|
|
35846
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
35847
|
+
const validation_error_1 = /* @__PURE__ */ requireValidation_error();
|
|
35848
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
35849
|
+
const resolve_1 = /* @__PURE__ */ requireResolve();
|
|
35850
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
35851
|
+
const validate_1 = /* @__PURE__ */ requireValidate();
|
|
35210
35852
|
class SchemaEnv {
|
|
35211
35853
|
constructor(env) {
|
|
35212
35854
|
var _a10;
|
|
@@ -36172,11 +36814,11 @@ function requireCore$1() {
|
|
|
36172
36814
|
(function(exports) {
|
|
36173
36815
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36174
36816
|
exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
|
|
36175
|
-
var validate_1 = requireValidate();
|
|
36817
|
+
var validate_1 = /* @__PURE__ */ requireValidate();
|
|
36176
36818
|
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
|
|
36177
36819
|
return validate_1.KeywordCxt;
|
|
36178
36820
|
} });
|
|
36179
|
-
var codegen_1 = requireCodegen();
|
|
36821
|
+
var codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
36180
36822
|
Object.defineProperty(exports, "_", { enumerable: true, get: function() {
|
|
36181
36823
|
return codegen_1._;
|
|
36182
36824
|
} });
|
|
@@ -36195,16 +36837,16 @@ function requireCore$1() {
|
|
|
36195
36837
|
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() {
|
|
36196
36838
|
return codegen_1.CodeGen;
|
|
36197
36839
|
} });
|
|
36198
|
-
const validation_error_1 = requireValidation_error();
|
|
36199
|
-
const ref_error_1 = requireRef_error();
|
|
36200
|
-
const rules_1 = requireRules();
|
|
36201
|
-
const compile_1 = requireCompile();
|
|
36202
|
-
const codegen_2 = requireCodegen();
|
|
36203
|
-
const resolve_1 = requireResolve();
|
|
36204
|
-
const dataType_1 = requireDataType();
|
|
36205
|
-
const util_1 = requireUtil();
|
|
36840
|
+
const validation_error_1 = /* @__PURE__ */ requireValidation_error();
|
|
36841
|
+
const ref_error_1 = /* @__PURE__ */ requireRef_error();
|
|
36842
|
+
const rules_1 = /* @__PURE__ */ requireRules();
|
|
36843
|
+
const compile_1 = /* @__PURE__ */ requireCompile();
|
|
36844
|
+
const codegen_2 = /* @__PURE__ */ requireCodegen();
|
|
36845
|
+
const resolve_1 = /* @__PURE__ */ requireResolve();
|
|
36846
|
+
const dataType_1 = /* @__PURE__ */ requireDataType();
|
|
36847
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
36206
36848
|
const $dataRefSchema = require$$9;
|
|
36207
|
-
const uri_1 = requireUri();
|
|
36849
|
+
const uri_1 = /* @__PURE__ */ requireUri();
|
|
36208
36850
|
const defaultRegExp = (str, flags) => new RegExp(str, flags);
|
|
36209
36851
|
defaultRegExp.code = "new RegExp";
|
|
36210
36852
|
const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
|
|
@@ -36801,12 +37443,12 @@ function requireRef() {
|
|
|
36801
37443
|
hasRequiredRef = 1;
|
|
36802
37444
|
Object.defineProperty(ref, "__esModule", { value: true });
|
|
36803
37445
|
ref.callRef = ref.getValidate = void 0;
|
|
36804
|
-
const ref_error_1 = requireRef_error();
|
|
36805
|
-
const code_1 = requireCode();
|
|
36806
|
-
const codegen_1 = requireCodegen();
|
|
36807
|
-
const names_1 = requireNames();
|
|
36808
|
-
const compile_1 = requireCompile();
|
|
36809
|
-
const util_1 = requireUtil();
|
|
37446
|
+
const ref_error_1 = /* @__PURE__ */ requireRef_error();
|
|
37447
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
37448
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37449
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
37450
|
+
const compile_1 = /* @__PURE__ */ requireCompile();
|
|
37451
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
36810
37452
|
const def = {
|
|
36811
37453
|
keyword: "$ref",
|
|
36812
37454
|
schemaType: "string",
|
|
@@ -36921,8 +37563,8 @@ function requireCore() {
|
|
|
36921
37563
|
if (hasRequiredCore) return core;
|
|
36922
37564
|
hasRequiredCore = 1;
|
|
36923
37565
|
Object.defineProperty(core, "__esModule", { value: true });
|
|
36924
|
-
const id_1 = requireId();
|
|
36925
|
-
const ref_1 = requireRef();
|
|
37566
|
+
const id_1 = /* @__PURE__ */ requireId();
|
|
37567
|
+
const ref_1 = /* @__PURE__ */ requireRef();
|
|
36926
37568
|
const core$12 = [
|
|
36927
37569
|
"$schema",
|
|
36928
37570
|
"$id",
|
|
@@ -36943,7 +37585,7 @@ function requireLimitNumber() {
|
|
|
36943
37585
|
if (hasRequiredLimitNumber) return limitNumber;
|
|
36944
37586
|
hasRequiredLimitNumber = 1;
|
|
36945
37587
|
Object.defineProperty(limitNumber, "__esModule", { value: true });
|
|
36946
|
-
const codegen_1 = requireCodegen();
|
|
37588
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
36947
37589
|
const ops = codegen_1.operators;
|
|
36948
37590
|
const KWDs = {
|
|
36949
37591
|
maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
|
|
@@ -36975,7 +37617,7 @@ function requireMultipleOf() {
|
|
|
36975
37617
|
if (hasRequiredMultipleOf) return multipleOf;
|
|
36976
37618
|
hasRequiredMultipleOf = 1;
|
|
36977
37619
|
Object.defineProperty(multipleOf, "__esModule", { value: true });
|
|
36978
|
-
const codegen_1 = requireCodegen();
|
|
37620
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
36979
37621
|
const error = {
|
|
36980
37622
|
message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
|
|
36981
37623
|
params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`
|
|
@@ -37029,9 +37671,9 @@ function requireLimitLength() {
|
|
|
37029
37671
|
if (hasRequiredLimitLength) return limitLength;
|
|
37030
37672
|
hasRequiredLimitLength = 1;
|
|
37031
37673
|
Object.defineProperty(limitLength, "__esModule", { value: true });
|
|
37032
|
-
const codegen_1 = requireCodegen();
|
|
37033
|
-
const util_1 = requireUtil();
|
|
37034
|
-
const ucs2length_1 = requireUcs2length();
|
|
37674
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37675
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37676
|
+
const ucs2length_1 = /* @__PURE__ */ requireUcs2length();
|
|
37035
37677
|
const error = {
|
|
37036
37678
|
message({ keyword: keyword2, schemaCode }) {
|
|
37037
37679
|
const comp = keyword2 === "maxLength" ? "more" : "fewer";
|
|
@@ -37061,8 +37703,9 @@ function requirePattern() {
|
|
|
37061
37703
|
if (hasRequiredPattern) return pattern;
|
|
37062
37704
|
hasRequiredPattern = 1;
|
|
37063
37705
|
Object.defineProperty(pattern, "__esModule", { value: true });
|
|
37064
|
-
const code_1 = requireCode();
|
|
37065
|
-
const
|
|
37706
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
37707
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37708
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37066
37709
|
const error = {
|
|
37067
37710
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
37068
37711
|
params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`
|
|
@@ -37074,10 +37717,18 @@ function requirePattern() {
|
|
|
37074
37717
|
$data: true,
|
|
37075
37718
|
error,
|
|
37076
37719
|
code(cxt) {
|
|
37077
|
-
const { data, $data, schema, schemaCode, it } = cxt;
|
|
37720
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
37078
37721
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
37079
|
-
|
|
37080
|
-
|
|
37722
|
+
if ($data) {
|
|
37723
|
+
const { regExp } = it.opts.code;
|
|
37724
|
+
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
37725
|
+
const valid = gen.let("valid");
|
|
37726
|
+
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
37727
|
+
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
37728
|
+
} else {
|
|
37729
|
+
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
37730
|
+
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
37731
|
+
}
|
|
37081
37732
|
}
|
|
37082
37733
|
};
|
|
37083
37734
|
pattern.default = def;
|
|
@@ -37089,7 +37740,7 @@ function requireLimitProperties() {
|
|
|
37089
37740
|
if (hasRequiredLimitProperties) return limitProperties;
|
|
37090
37741
|
hasRequiredLimitProperties = 1;
|
|
37091
37742
|
Object.defineProperty(limitProperties, "__esModule", { value: true });
|
|
37092
|
-
const codegen_1 = requireCodegen();
|
|
37743
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37093
37744
|
const error = {
|
|
37094
37745
|
message({ keyword: keyword2, schemaCode }) {
|
|
37095
37746
|
const comp = keyword2 === "maxProperties" ? "more" : "fewer";
|
|
@@ -37118,9 +37769,9 @@ function requireRequired() {
|
|
|
37118
37769
|
if (hasRequiredRequired) return required;
|
|
37119
37770
|
hasRequiredRequired = 1;
|
|
37120
37771
|
Object.defineProperty(required, "__esModule", { value: true });
|
|
37121
|
-
const code_1 = requireCode();
|
|
37122
|
-
const codegen_1 = requireCodegen();
|
|
37123
|
-
const util_1 = requireUtil();
|
|
37772
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
37773
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37774
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37124
37775
|
const error = {
|
|
37125
37776
|
message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
|
|
37126
37777
|
params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`
|
|
@@ -37200,7 +37851,7 @@ function requireLimitItems() {
|
|
|
37200
37851
|
if (hasRequiredLimitItems) return limitItems;
|
|
37201
37852
|
hasRequiredLimitItems = 1;
|
|
37202
37853
|
Object.defineProperty(limitItems, "__esModule", { value: true });
|
|
37203
|
-
const codegen_1 = requireCodegen();
|
|
37854
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37204
37855
|
const error = {
|
|
37205
37856
|
message({ keyword: keyword2, schemaCode }) {
|
|
37206
37857
|
const comp = keyword2 === "maxItems" ? "more" : "fewer";
|
|
@@ -37240,10 +37891,10 @@ function requireUniqueItems() {
|
|
|
37240
37891
|
if (hasRequiredUniqueItems) return uniqueItems;
|
|
37241
37892
|
hasRequiredUniqueItems = 1;
|
|
37242
37893
|
Object.defineProperty(uniqueItems, "__esModule", { value: true });
|
|
37243
|
-
const dataType_1 = requireDataType();
|
|
37244
|
-
const codegen_1 = requireCodegen();
|
|
37245
|
-
const util_1 = requireUtil();
|
|
37246
|
-
const equal_1 = requireEqual();
|
|
37894
|
+
const dataType_1 = /* @__PURE__ */ requireDataType();
|
|
37895
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37896
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37897
|
+
const equal_1 = /* @__PURE__ */ requireEqual();
|
|
37247
37898
|
const error = {
|
|
37248
37899
|
message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
|
|
37249
37900
|
params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
|
|
@@ -37307,9 +37958,9 @@ function require_const() {
|
|
|
37307
37958
|
if (hasRequired_const) return _const;
|
|
37308
37959
|
hasRequired_const = 1;
|
|
37309
37960
|
Object.defineProperty(_const, "__esModule", { value: true });
|
|
37310
|
-
const codegen_1 = requireCodegen();
|
|
37311
|
-
const util_1 = requireUtil();
|
|
37312
|
-
const equal_1 = requireEqual();
|
|
37961
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37962
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37963
|
+
const equal_1 = /* @__PURE__ */ requireEqual();
|
|
37313
37964
|
const error = {
|
|
37314
37965
|
message: "must be equal to constant",
|
|
37315
37966
|
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`
|
|
@@ -37336,9 +37987,9 @@ function require_enum() {
|
|
|
37336
37987
|
if (hasRequired_enum) return _enum;
|
|
37337
37988
|
hasRequired_enum = 1;
|
|
37338
37989
|
Object.defineProperty(_enum, "__esModule", { value: true });
|
|
37339
|
-
const codegen_1 = requireCodegen();
|
|
37340
|
-
const util_1 = requireUtil();
|
|
37341
|
-
const equal_1 = requireEqual();
|
|
37990
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37991
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37992
|
+
const equal_1 = /* @__PURE__ */ requireEqual();
|
|
37342
37993
|
const error = {
|
|
37343
37994
|
message: "must be equal to one of the allowed values",
|
|
37344
37995
|
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`
|
|
@@ -37384,16 +38035,16 @@ function requireValidation() {
|
|
|
37384
38035
|
if (hasRequiredValidation) return validation;
|
|
37385
38036
|
hasRequiredValidation = 1;
|
|
37386
38037
|
Object.defineProperty(validation, "__esModule", { value: true });
|
|
37387
|
-
const limitNumber_1 = requireLimitNumber();
|
|
37388
|
-
const multipleOf_1 = requireMultipleOf();
|
|
37389
|
-
const limitLength_1 = requireLimitLength();
|
|
37390
|
-
const pattern_1 = requirePattern();
|
|
37391
|
-
const limitProperties_1 = requireLimitProperties();
|
|
37392
|
-
const required_1 = requireRequired();
|
|
37393
|
-
const limitItems_1 = requireLimitItems();
|
|
37394
|
-
const uniqueItems_1 = requireUniqueItems();
|
|
37395
|
-
const const_1 = require_const();
|
|
37396
|
-
const enum_1 = require_enum();
|
|
38038
|
+
const limitNumber_1 = /* @__PURE__ */ requireLimitNumber();
|
|
38039
|
+
const multipleOf_1 = /* @__PURE__ */ requireMultipleOf();
|
|
38040
|
+
const limitLength_1 = /* @__PURE__ */ requireLimitLength();
|
|
38041
|
+
const pattern_1 = /* @__PURE__ */ requirePattern();
|
|
38042
|
+
const limitProperties_1 = /* @__PURE__ */ requireLimitProperties();
|
|
38043
|
+
const required_1 = /* @__PURE__ */ requireRequired();
|
|
38044
|
+
const limitItems_1 = /* @__PURE__ */ requireLimitItems();
|
|
38045
|
+
const uniqueItems_1 = /* @__PURE__ */ requireUniqueItems();
|
|
38046
|
+
const const_1 = /* @__PURE__ */ require_const();
|
|
38047
|
+
const enum_1 = /* @__PURE__ */ require_enum();
|
|
37397
38048
|
const validation$1 = [
|
|
37398
38049
|
// number
|
|
37399
38050
|
limitNumber_1.default,
|
|
@@ -37424,8 +38075,8 @@ function requireAdditionalItems() {
|
|
|
37424
38075
|
hasRequiredAdditionalItems = 1;
|
|
37425
38076
|
Object.defineProperty(additionalItems, "__esModule", { value: true });
|
|
37426
38077
|
additionalItems.validateAdditionalItems = void 0;
|
|
37427
|
-
const codegen_1 = requireCodegen();
|
|
37428
|
-
const util_1 = requireUtil();
|
|
38078
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38079
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37429
38080
|
const error = {
|
|
37430
38081
|
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
37431
38082
|
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
@@ -37478,9 +38129,9 @@ function requireItems() {
|
|
|
37478
38129
|
hasRequiredItems = 1;
|
|
37479
38130
|
Object.defineProperty(items, "__esModule", { value: true });
|
|
37480
38131
|
items.validateTuple = void 0;
|
|
37481
|
-
const codegen_1 = requireCodegen();
|
|
37482
|
-
const util_1 = requireUtil();
|
|
37483
|
-
const code_1 = requireCode();
|
|
38132
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38133
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38134
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
37484
38135
|
const def = {
|
|
37485
38136
|
keyword: "items",
|
|
37486
38137
|
type: "array",
|
|
@@ -37533,7 +38184,7 @@ function requirePrefixItems() {
|
|
|
37533
38184
|
if (hasRequiredPrefixItems) return prefixItems;
|
|
37534
38185
|
hasRequiredPrefixItems = 1;
|
|
37535
38186
|
Object.defineProperty(prefixItems, "__esModule", { value: true });
|
|
37536
|
-
const items_1 = requireItems();
|
|
38187
|
+
const items_1 = /* @__PURE__ */ requireItems();
|
|
37537
38188
|
const def = {
|
|
37538
38189
|
keyword: "prefixItems",
|
|
37539
38190
|
type: "array",
|
|
@@ -37550,10 +38201,10 @@ function requireItems2020() {
|
|
|
37550
38201
|
if (hasRequiredItems2020) return items2020;
|
|
37551
38202
|
hasRequiredItems2020 = 1;
|
|
37552
38203
|
Object.defineProperty(items2020, "__esModule", { value: true });
|
|
37553
|
-
const codegen_1 = requireCodegen();
|
|
37554
|
-
const util_1 = requireUtil();
|
|
37555
|
-
const code_1 = requireCode();
|
|
37556
|
-
const additionalItems_1 = requireAdditionalItems();
|
|
38204
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38205
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38206
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38207
|
+
const additionalItems_1 = /* @__PURE__ */ requireAdditionalItems();
|
|
37557
38208
|
const error = {
|
|
37558
38209
|
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
37559
38210
|
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
@@ -37585,8 +38236,8 @@ function requireContains() {
|
|
|
37585
38236
|
if (hasRequiredContains) return contains;
|
|
37586
38237
|
hasRequiredContains = 1;
|
|
37587
38238
|
Object.defineProperty(contains, "__esModule", { value: true });
|
|
37588
|
-
const codegen_1 = requireCodegen();
|
|
37589
|
-
const util_1 = requireUtil();
|
|
38239
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38240
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37590
38241
|
const error = {
|
|
37591
38242
|
message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`,
|
|
37592
38243
|
params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`
|
|
@@ -37681,9 +38332,9 @@ function requireDependencies() {
|
|
|
37681
38332
|
(function(exports) {
|
|
37682
38333
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37683
38334
|
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
|
|
37684
|
-
const codegen_1 = requireCodegen();
|
|
37685
|
-
const util_1 = requireUtil();
|
|
37686
|
-
const code_1 = requireCode();
|
|
38335
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38336
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38337
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
37687
38338
|
exports.error = {
|
|
37688
38339
|
message: ({ params: { property, depsCount, deps } }) => {
|
|
37689
38340
|
const property_ies = depsCount === 1 ? "property" : "properties";
|
|
@@ -37775,8 +38426,8 @@ function requirePropertyNames() {
|
|
|
37775
38426
|
if (hasRequiredPropertyNames) return propertyNames;
|
|
37776
38427
|
hasRequiredPropertyNames = 1;
|
|
37777
38428
|
Object.defineProperty(propertyNames, "__esModule", { value: true });
|
|
37778
|
-
const codegen_1 = requireCodegen();
|
|
37779
|
-
const util_1 = requireUtil();
|
|
38429
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38430
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37780
38431
|
const error = {
|
|
37781
38432
|
message: "property name must be valid",
|
|
37782
38433
|
params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`
|
|
@@ -37818,10 +38469,10 @@ function requireAdditionalProperties() {
|
|
|
37818
38469
|
if (hasRequiredAdditionalProperties) return additionalProperties;
|
|
37819
38470
|
hasRequiredAdditionalProperties = 1;
|
|
37820
38471
|
Object.defineProperty(additionalProperties, "__esModule", { value: true });
|
|
37821
|
-
const code_1 = requireCode();
|
|
37822
|
-
const codegen_1 = requireCodegen();
|
|
37823
|
-
const names_1 = requireNames();
|
|
37824
|
-
const util_1 = requireUtil();
|
|
38472
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38473
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38474
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
38475
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37825
38476
|
const error = {
|
|
37826
38477
|
message: "must NOT have additional properties",
|
|
37827
38478
|
params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`
|
|
@@ -37924,10 +38575,10 @@ function requireProperties() {
|
|
|
37924
38575
|
if (hasRequiredProperties) return properties$1;
|
|
37925
38576
|
hasRequiredProperties = 1;
|
|
37926
38577
|
Object.defineProperty(properties$1, "__esModule", { value: true });
|
|
37927
|
-
const validate_1 = requireValidate();
|
|
37928
|
-
const code_1 = requireCode();
|
|
37929
|
-
const util_1 = requireUtil();
|
|
37930
|
-
const additionalProperties_1 = requireAdditionalProperties();
|
|
38578
|
+
const validate_1 = /* @__PURE__ */ requireValidate();
|
|
38579
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38580
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38581
|
+
const additionalProperties_1 = /* @__PURE__ */ requireAdditionalProperties();
|
|
37931
38582
|
const def = {
|
|
37932
38583
|
keyword: "properties",
|
|
37933
38584
|
type: "object",
|
|
@@ -37982,10 +38633,10 @@ function requirePatternProperties() {
|
|
|
37982
38633
|
if (hasRequiredPatternProperties) return patternProperties;
|
|
37983
38634
|
hasRequiredPatternProperties = 1;
|
|
37984
38635
|
Object.defineProperty(patternProperties, "__esModule", { value: true });
|
|
37985
|
-
const code_1 = requireCode();
|
|
37986
|
-
const codegen_1 = requireCodegen();
|
|
37987
|
-
const util_1 = requireUtil();
|
|
37988
|
-
const util_2 = requireUtil();
|
|
38636
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38637
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38638
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38639
|
+
const util_2 = /* @__PURE__ */ requireUtil();
|
|
37989
38640
|
const def = {
|
|
37990
38641
|
keyword: "patternProperties",
|
|
37991
38642
|
type: "object",
|
|
@@ -38056,7 +38707,7 @@ function requireNot() {
|
|
|
38056
38707
|
if (hasRequiredNot) return not;
|
|
38057
38708
|
hasRequiredNot = 1;
|
|
38058
38709
|
Object.defineProperty(not, "__esModule", { value: true });
|
|
38059
|
-
const util_1 = requireUtil();
|
|
38710
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38060
38711
|
const def = {
|
|
38061
38712
|
keyword: "not",
|
|
38062
38713
|
schemaType: ["object", "boolean"],
|
|
@@ -38087,7 +38738,7 @@ function requireAnyOf() {
|
|
|
38087
38738
|
if (hasRequiredAnyOf) return anyOf;
|
|
38088
38739
|
hasRequiredAnyOf = 1;
|
|
38089
38740
|
Object.defineProperty(anyOf, "__esModule", { value: true });
|
|
38090
|
-
const code_1 = requireCode();
|
|
38741
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38091
38742
|
const def = {
|
|
38092
38743
|
keyword: "anyOf",
|
|
38093
38744
|
schemaType: "array",
|
|
@@ -38104,8 +38755,8 @@ function requireOneOf() {
|
|
|
38104
38755
|
if (hasRequiredOneOf) return oneOf;
|
|
38105
38756
|
hasRequiredOneOf = 1;
|
|
38106
38757
|
Object.defineProperty(oneOf, "__esModule", { value: true });
|
|
38107
|
-
const codegen_1 = requireCodegen();
|
|
38108
|
-
const util_1 = requireUtil();
|
|
38758
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38759
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38109
38760
|
const error = {
|
|
38110
38761
|
message: "must match exactly one schema in oneOf",
|
|
38111
38762
|
params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`
|
|
@@ -38162,7 +38813,7 @@ function requireAllOf() {
|
|
|
38162
38813
|
if (hasRequiredAllOf) return allOf;
|
|
38163
38814
|
hasRequiredAllOf = 1;
|
|
38164
38815
|
Object.defineProperty(allOf, "__esModule", { value: true });
|
|
38165
|
-
const util_1 = requireUtil();
|
|
38816
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38166
38817
|
const def = {
|
|
38167
38818
|
keyword: "allOf",
|
|
38168
38819
|
schemaType: "array",
|
|
@@ -38189,8 +38840,8 @@ function require_if() {
|
|
|
38189
38840
|
if (hasRequired_if) return _if;
|
|
38190
38841
|
hasRequired_if = 1;
|
|
38191
38842
|
Object.defineProperty(_if, "__esModule", { value: true });
|
|
38192
|
-
const codegen_1 = requireCodegen();
|
|
38193
|
-
const util_1 = requireUtil();
|
|
38843
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38844
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38194
38845
|
const error = {
|
|
38195
38846
|
message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`,
|
|
38196
38847
|
params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`
|
|
@@ -38258,7 +38909,7 @@ function requireThenElse() {
|
|
|
38258
38909
|
if (hasRequiredThenElse) return thenElse;
|
|
38259
38910
|
hasRequiredThenElse = 1;
|
|
38260
38911
|
Object.defineProperty(thenElse, "__esModule", { value: true });
|
|
38261
|
-
const util_1 = requireUtil();
|
|
38912
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38262
38913
|
const def = {
|
|
38263
38914
|
keyword: ["then", "else"],
|
|
38264
38915
|
schemaType: ["object", "boolean"],
|
|
@@ -38275,22 +38926,22 @@ function requireApplicator() {
|
|
|
38275
38926
|
if (hasRequiredApplicator) return applicator;
|
|
38276
38927
|
hasRequiredApplicator = 1;
|
|
38277
38928
|
Object.defineProperty(applicator, "__esModule", { value: true });
|
|
38278
|
-
const additionalItems_1 = requireAdditionalItems();
|
|
38279
|
-
const prefixItems_1 = requirePrefixItems();
|
|
38280
|
-
const items_1 = requireItems();
|
|
38281
|
-
const items2020_1 = requireItems2020();
|
|
38282
|
-
const contains_1 = requireContains();
|
|
38283
|
-
const dependencies_1 = requireDependencies();
|
|
38284
|
-
const propertyNames_1 = requirePropertyNames();
|
|
38285
|
-
const additionalProperties_1 = requireAdditionalProperties();
|
|
38286
|
-
const properties_1 = requireProperties();
|
|
38287
|
-
const patternProperties_1 = requirePatternProperties();
|
|
38288
|
-
const not_1 = requireNot();
|
|
38289
|
-
const anyOf_1 = requireAnyOf();
|
|
38290
|
-
const oneOf_1 = requireOneOf();
|
|
38291
|
-
const allOf_1 = requireAllOf();
|
|
38292
|
-
const if_1 = require_if();
|
|
38293
|
-
const thenElse_1 = requireThenElse();
|
|
38929
|
+
const additionalItems_1 = /* @__PURE__ */ requireAdditionalItems();
|
|
38930
|
+
const prefixItems_1 = /* @__PURE__ */ requirePrefixItems();
|
|
38931
|
+
const items_1 = /* @__PURE__ */ requireItems();
|
|
38932
|
+
const items2020_1 = /* @__PURE__ */ requireItems2020();
|
|
38933
|
+
const contains_1 = /* @__PURE__ */ requireContains();
|
|
38934
|
+
const dependencies_1 = /* @__PURE__ */ requireDependencies();
|
|
38935
|
+
const propertyNames_1 = /* @__PURE__ */ requirePropertyNames();
|
|
38936
|
+
const additionalProperties_1 = /* @__PURE__ */ requireAdditionalProperties();
|
|
38937
|
+
const properties_1 = /* @__PURE__ */ requireProperties();
|
|
38938
|
+
const patternProperties_1 = /* @__PURE__ */ requirePatternProperties();
|
|
38939
|
+
const not_1 = /* @__PURE__ */ requireNot();
|
|
38940
|
+
const anyOf_1 = /* @__PURE__ */ requireAnyOf();
|
|
38941
|
+
const oneOf_1 = /* @__PURE__ */ requireOneOf();
|
|
38942
|
+
const allOf_1 = /* @__PURE__ */ requireAllOf();
|
|
38943
|
+
const if_1 = /* @__PURE__ */ require_if();
|
|
38944
|
+
const thenElse_1 = /* @__PURE__ */ requireThenElse();
|
|
38294
38945
|
function getApplicator(draft2020 = false) {
|
|
38295
38946
|
const applicator2 = [
|
|
38296
38947
|
// any
|
|
@@ -38324,7 +38975,7 @@ function requireFormat$1() {
|
|
|
38324
38975
|
if (hasRequiredFormat$1) return format;
|
|
38325
38976
|
hasRequiredFormat$1 = 1;
|
|
38326
38977
|
Object.defineProperty(format, "__esModule", { value: true });
|
|
38327
|
-
const codegen_1 = requireCodegen();
|
|
38978
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38328
38979
|
const error = {
|
|
38329
38980
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
|
|
38330
38981
|
params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
|
|
@@ -38413,7 +39064,7 @@ function requireFormat() {
|
|
|
38413
39064
|
if (hasRequiredFormat) return format$1;
|
|
38414
39065
|
hasRequiredFormat = 1;
|
|
38415
39066
|
Object.defineProperty(format$1, "__esModule", { value: true });
|
|
38416
|
-
const format_1 = requireFormat$1();
|
|
39067
|
+
const format_1 = /* @__PURE__ */ requireFormat$1();
|
|
38417
39068
|
const format2 = [format_1.default];
|
|
38418
39069
|
format$1.default = format2;
|
|
38419
39070
|
return format$1;
|
|
@@ -38446,11 +39097,11 @@ function requireDraft7() {
|
|
|
38446
39097
|
if (hasRequiredDraft7) return draft7;
|
|
38447
39098
|
hasRequiredDraft7 = 1;
|
|
38448
39099
|
Object.defineProperty(draft7, "__esModule", { value: true });
|
|
38449
|
-
const core_1 = requireCore();
|
|
38450
|
-
const validation_1 = requireValidation();
|
|
38451
|
-
const applicator_1 = requireApplicator();
|
|
38452
|
-
const format_1 = requireFormat();
|
|
38453
|
-
const metadata_1 = requireMetadata();
|
|
39100
|
+
const core_1 = /* @__PURE__ */ requireCore();
|
|
39101
|
+
const validation_1 = /* @__PURE__ */ requireValidation();
|
|
39102
|
+
const applicator_1 = /* @__PURE__ */ requireApplicator();
|
|
39103
|
+
const format_1 = /* @__PURE__ */ requireFormat();
|
|
39104
|
+
const metadata_1 = /* @__PURE__ */ requireMetadata();
|
|
38454
39105
|
const draft7Vocabularies = [
|
|
38455
39106
|
core_1.default,
|
|
38456
39107
|
validation_1.default,
|
|
@@ -38482,11 +39133,11 @@ function requireDiscriminator() {
|
|
|
38482
39133
|
if (hasRequiredDiscriminator) return discriminator;
|
|
38483
39134
|
hasRequiredDiscriminator = 1;
|
|
38484
39135
|
Object.defineProperty(discriminator, "__esModule", { value: true });
|
|
38485
|
-
const codegen_1 = requireCodegen();
|
|
38486
|
-
const types_1 = requireTypes();
|
|
38487
|
-
const compile_1 = requireCompile();
|
|
38488
|
-
const ref_error_1 = requireRef_error();
|
|
38489
|
-
const util_1 = requireUtil();
|
|
39136
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
39137
|
+
const types_1 = /* @__PURE__ */ requireTypes();
|
|
39138
|
+
const compile_1 = /* @__PURE__ */ requireCompile();
|
|
39139
|
+
const ref_error_1 = /* @__PURE__ */ requireRef_error();
|
|
39140
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38490
39141
|
const error = {
|
|
38491
39142
|
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
|
|
38492
39143
|
params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
|
|
@@ -38603,9 +39254,9 @@ function requireAjv() {
|
|
|
38603
39254
|
(function(module, exports) {
|
|
38604
39255
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38605
39256
|
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;
|
|
38606
|
-
const core_1 = requireCore$1();
|
|
38607
|
-
const draft7_1 = requireDraft7();
|
|
38608
|
-
const discriminator_1 = requireDiscriminator();
|
|
39257
|
+
const core_1 = /* @__PURE__ */ requireCore$1();
|
|
39258
|
+
const draft7_1 = /* @__PURE__ */ requireDraft7();
|
|
39259
|
+
const discriminator_1 = /* @__PURE__ */ requireDiscriminator();
|
|
38609
39260
|
const draft7MetaSchema = require$$3;
|
|
38610
39261
|
const META_SUPPORT_DATA = ["/properties"];
|
|
38611
39262
|
const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
|
|
@@ -38633,11 +39284,11 @@ function requireAjv() {
|
|
|
38633
39284
|
module.exports.Ajv = Ajv2;
|
|
38634
39285
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38635
39286
|
exports.default = Ajv2;
|
|
38636
|
-
var validate_1 = requireValidate();
|
|
39287
|
+
var validate_1 = /* @__PURE__ */ requireValidate();
|
|
38637
39288
|
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
|
|
38638
39289
|
return validate_1.KeywordCxt;
|
|
38639
39290
|
} });
|
|
38640
|
-
var codegen_1 = requireCodegen();
|
|
39291
|
+
var codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38641
39292
|
Object.defineProperty(exports, "_", { enumerable: true, get: function() {
|
|
38642
39293
|
return codegen_1._;
|
|
38643
39294
|
} });
|
|
@@ -38656,18 +39307,18 @@ function requireAjv() {
|
|
|
38656
39307
|
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() {
|
|
38657
39308
|
return codegen_1.CodeGen;
|
|
38658
39309
|
} });
|
|
38659
|
-
var validation_error_1 = requireValidation_error();
|
|
39310
|
+
var validation_error_1 = /* @__PURE__ */ requireValidation_error();
|
|
38660
39311
|
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function() {
|
|
38661
39312
|
return validation_error_1.default;
|
|
38662
39313
|
} });
|
|
38663
|
-
var ref_error_1 = requireRef_error();
|
|
39314
|
+
var ref_error_1 = /* @__PURE__ */ requireRef_error();
|
|
38664
39315
|
Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function() {
|
|
38665
39316
|
return ref_error_1.default;
|
|
38666
39317
|
} });
|
|
38667
39318
|
})(ajv, ajv.exports);
|
|
38668
39319
|
return ajv.exports;
|
|
38669
39320
|
}
|
|
38670
|
-
var ajvExports = requireAjv();
|
|
39321
|
+
var ajvExports = /* @__PURE__ */ requireAjv();
|
|
38671
39322
|
const Ajv = /* @__PURE__ */ getDefaultExportFromCjs(ajvExports);
|
|
38672
39323
|
var dist = { exports: {} };
|
|
38673
39324
|
var formats = {};
|
|
@@ -38883,8 +39534,8 @@ function requireLimit() {
|
|
|
38883
39534
|
(function(exports) {
|
|
38884
39535
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38885
39536
|
exports.formatLimitDefinition = void 0;
|
|
38886
|
-
const ajv_1 = requireAjv();
|
|
38887
|
-
const codegen_1 = requireCodegen();
|
|
39537
|
+
const ajv_1 = /* @__PURE__ */ requireAjv();
|
|
39538
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38888
39539
|
const ops = codegen_1.operators;
|
|
38889
39540
|
const KWDs = {
|
|
38890
39541
|
formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
|
|
@@ -38957,7 +39608,7 @@ function requireDist() {
|
|
|
38957
39608
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38958
39609
|
const formats_1 = requireFormats();
|
|
38959
39610
|
const limit_1 = requireLimit();
|
|
38960
|
-
const codegen_1 = requireCodegen();
|
|
39611
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38961
39612
|
const fullName = new codegen_1.Name("fullFormats");
|
|
38962
39613
|
const fastName = new codegen_1.Name("fastFormats");
|
|
38963
39614
|
const formatsPlugin = (ajv2, opts = { keywords: true }) => {
|