@opentiny/next-sdk 0.2.4 → 0.2.5
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 +858 -252
- package/dist/index.es.js +11148 -10578
- package/dist/index.umd.dev.js +858 -252
- 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/webagent.dev.js +858 -252
- package/dist/webagent.es.dev.js +858 -252
- package/dist/webagent.es.js +10766 -10196
- package/dist/webagent.js +56 -56
- 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/dist/webagent.dev.js
CHANGED
|
@@ -11325,17 +11325,14 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
11325
11325
|
var _a92;
|
|
11326
11326
|
const resolvedHeaders = await resolve$1(this.config.headers());
|
|
11327
11327
|
try {
|
|
11328
|
-
const {
|
|
11329
|
-
responseHeaders,
|
|
11330
|
-
value: responseBody,
|
|
11331
|
-
rawValue
|
|
11332
|
-
} = await postJsonToApi$1({
|
|
11328
|
+
const { responseHeaders, value: responseBody } = await postJsonToApi$1({
|
|
11333
11329
|
url: this.getUrl(),
|
|
11334
11330
|
headers: combineHeaders$1(
|
|
11335
11331
|
resolvedHeaders,
|
|
11336
11332
|
headers != null ? headers : {},
|
|
11337
11333
|
this.getModelConfigHeaders(),
|
|
11338
|
-
await resolve$1(this.config.o11yHeaders)
|
|
11334
|
+
await resolve$1(this.config.o11yHeaders),
|
|
11335
|
+
{ accept: "text/event-stream" }
|
|
11339
11336
|
),
|
|
11340
11337
|
body: {
|
|
11341
11338
|
prompt,
|
|
@@ -11348,9 +11345,70 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
11348
11345
|
...providerOptions && { providerOptions },
|
|
11349
11346
|
...image && { image: maybeEncodeVideoFile(image) }
|
|
11350
11347
|
},
|
|
11351
|
-
successfulResponseHandler:
|
|
11352
|
-
|
|
11353
|
-
|
|
11348
|
+
successfulResponseHandler: async ({
|
|
11349
|
+
response,
|
|
11350
|
+
url: url2,
|
|
11351
|
+
requestBodyValues
|
|
11352
|
+
}) => {
|
|
11353
|
+
if (response.body == null) {
|
|
11354
|
+
throw new APICallError$1({
|
|
11355
|
+
message: "SSE response body is empty",
|
|
11356
|
+
url: url2,
|
|
11357
|
+
requestBodyValues,
|
|
11358
|
+
statusCode: response.status
|
|
11359
|
+
});
|
|
11360
|
+
}
|
|
11361
|
+
const eventStream = parseJsonEventStream$1({
|
|
11362
|
+
stream: response.body,
|
|
11363
|
+
schema: gatewayVideoEventSchema
|
|
11364
|
+
});
|
|
11365
|
+
const reader = eventStream.getReader();
|
|
11366
|
+
const { done, value: parseResult } = await reader.read();
|
|
11367
|
+
reader.releaseLock();
|
|
11368
|
+
if (done || !parseResult) {
|
|
11369
|
+
throw new APICallError$1({
|
|
11370
|
+
message: "SSE stream ended without a data event",
|
|
11371
|
+
url: url2,
|
|
11372
|
+
requestBodyValues,
|
|
11373
|
+
statusCode: response.status
|
|
11374
|
+
});
|
|
11375
|
+
}
|
|
11376
|
+
if (!parseResult.success) {
|
|
11377
|
+
throw new APICallError$1({
|
|
11378
|
+
message: "Failed to parse video SSE event",
|
|
11379
|
+
cause: parseResult.error,
|
|
11380
|
+
url: url2,
|
|
11381
|
+
requestBodyValues,
|
|
11382
|
+
statusCode: response.status
|
|
11383
|
+
});
|
|
11384
|
+
}
|
|
11385
|
+
const event = parseResult.value;
|
|
11386
|
+
if (event.type === "error") {
|
|
11387
|
+
throw new APICallError$1({
|
|
11388
|
+
message: event.message,
|
|
11389
|
+
statusCode: event.statusCode,
|
|
11390
|
+
url: url2,
|
|
11391
|
+
requestBodyValues,
|
|
11392
|
+
responseHeaders: Object.fromEntries([...response.headers]),
|
|
11393
|
+
responseBody: JSON.stringify(event),
|
|
11394
|
+
data: {
|
|
11395
|
+
error: {
|
|
11396
|
+
message: event.message,
|
|
11397
|
+
type: event.errorType,
|
|
11398
|
+
param: event.param
|
|
11399
|
+
}
|
|
11400
|
+
}
|
|
11401
|
+
});
|
|
11402
|
+
}
|
|
11403
|
+
return {
|
|
11404
|
+
value: {
|
|
11405
|
+
videos: event.videos,
|
|
11406
|
+
warnings: event.warnings,
|
|
11407
|
+
providerMetadata: event.providerMetadata
|
|
11408
|
+
},
|
|
11409
|
+
responseHeaders: Object.fromEntries([...response.headers])
|
|
11410
|
+
};
|
|
11411
|
+
},
|
|
11354
11412
|
failedResponseHandler: createJsonErrorResponseHandler$1({
|
|
11355
11413
|
errorSchema: any(),
|
|
11356
11414
|
errorToMessage: (data) => data
|
|
@@ -11422,11 +11480,21 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
11422
11480
|
message: string()
|
|
11423
11481
|
})
|
|
11424
11482
|
]);
|
|
11425
|
-
var
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11483
|
+
var gatewayVideoEventSchema = discriminatedUnion("type", [
|
|
11484
|
+
object$1({
|
|
11485
|
+
type: literal("result"),
|
|
11486
|
+
videos: array$1(gatewayVideoDataSchema),
|
|
11487
|
+
warnings: array$1(gatewayVideoWarningSchema).optional(),
|
|
11488
|
+
providerMetadata: record(string(), providerMetadataEntrySchema2).optional()
|
|
11489
|
+
}),
|
|
11490
|
+
object$1({
|
|
11491
|
+
type: literal("error"),
|
|
11492
|
+
message: string(),
|
|
11493
|
+
errorType: string(),
|
|
11494
|
+
statusCode: number$1(),
|
|
11495
|
+
param: unknown().nullable()
|
|
11496
|
+
})
|
|
11497
|
+
]);
|
|
11430
11498
|
var parallelSearchInputSchema = lazySchema(
|
|
11431
11499
|
() => zodSchema(
|
|
11432
11500
|
objectType({
|
|
@@ -11603,7 +11671,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
11603
11671
|
var _a92;
|
|
11604
11672
|
return (_a92 = indexBrowserExports.getContext().headers) == null ? void 0 : _a92["x-vercel-id"];
|
|
11605
11673
|
}
|
|
11606
|
-
var VERSION$6 = "3.0.
|
|
11674
|
+
var VERSION$6 = "3.0.55";
|
|
11607
11675
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
11608
11676
|
function createGatewayProvider(options = {}) {
|
|
11609
11677
|
var _a92, _b9;
|
|
@@ -11646,13 +11714,18 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
11646
11714
|
settingValue: void 0,
|
|
11647
11715
|
environmentVariableName: "VERCEL_REGION"
|
|
11648
11716
|
});
|
|
11717
|
+
const projectId = loadOptionalSetting({
|
|
11718
|
+
settingValue: void 0,
|
|
11719
|
+
environmentVariableName: "VERCEL_PROJECT_ID"
|
|
11720
|
+
});
|
|
11649
11721
|
return async () => {
|
|
11650
11722
|
const requestId = await getVercelRequestId();
|
|
11651
11723
|
return {
|
|
11652
11724
|
...deploymentId && { "ai-o11y-deployment-id": deploymentId },
|
|
11653
11725
|
...environment && { "ai-o11y-environment": environment },
|
|
11654
11726
|
...region && { "ai-o11y-region": region },
|
|
11655
|
-
...requestId && { "ai-o11y-request-id": requestId }
|
|
11727
|
+
...requestId && { "ai-o11y-request-id": requestId },
|
|
11728
|
+
...projectId && { "ai-o11y-project-id": projectId }
|
|
11656
11729
|
};
|
|
11657
11730
|
};
|
|
11658
11731
|
};
|
|
@@ -13420,7 +13493,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
13420
13493
|
}
|
|
13421
13494
|
return void 0;
|
|
13422
13495
|
}
|
|
13423
|
-
var VERSION$4 = "6.0.
|
|
13496
|
+
var VERSION$4 = "6.0.99";
|
|
13424
13497
|
var download = async ({
|
|
13425
13498
|
url: url2,
|
|
13426
13499
|
maxBytes,
|
|
@@ -14845,6 +14918,10 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
14845
14918
|
}
|
|
14846
14919
|
return { approvedToolApprovals, deniedToolApprovals };
|
|
14847
14920
|
}
|
|
14921
|
+
function now() {
|
|
14922
|
+
var _a21, _b9;
|
|
14923
|
+
return (_b9 = (_a21 = globalThis == null ? void 0 : globalThis.performance) == null ? void 0 : _a21.now()) != null ? _b9 : Date.now();
|
|
14924
|
+
}
|
|
14848
14925
|
async function executeToolCall({
|
|
14849
14926
|
toolCall,
|
|
14850
14927
|
tools,
|
|
@@ -14853,13 +14930,27 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
14853
14930
|
messages,
|
|
14854
14931
|
abortSignal,
|
|
14855
14932
|
experimental_context,
|
|
14856
|
-
|
|
14933
|
+
stepNumber,
|
|
14934
|
+
model,
|
|
14935
|
+
onPreliminaryToolResult,
|
|
14936
|
+
onToolCallStart,
|
|
14937
|
+
onToolCallFinish
|
|
14857
14938
|
}) {
|
|
14858
14939
|
const { toolName, toolCallId, input } = toolCall;
|
|
14859
14940
|
const tool2 = tools == null ? void 0 : tools[toolName];
|
|
14860
14941
|
if ((tool2 == null ? void 0 : tool2.execute) == null) {
|
|
14861
14942
|
return void 0;
|
|
14862
14943
|
}
|
|
14944
|
+
const baseCallbackEvent = {
|
|
14945
|
+
stepNumber,
|
|
14946
|
+
model,
|
|
14947
|
+
toolCall,
|
|
14948
|
+
messages,
|
|
14949
|
+
abortSignal,
|
|
14950
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
14951
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
14952
|
+
experimental_context
|
|
14953
|
+
};
|
|
14863
14954
|
return recordSpan({
|
|
14864
14955
|
name: "ai.toolCall",
|
|
14865
14956
|
attributes: selectTelemetryAttributes({
|
|
@@ -14879,6 +14970,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
14879
14970
|
tracer,
|
|
14880
14971
|
fn: async (span) => {
|
|
14881
14972
|
let output;
|
|
14973
|
+
try {
|
|
14974
|
+
await (onToolCallStart == null ? void 0 : onToolCallStart(baseCallbackEvent));
|
|
14975
|
+
} catch (_ignored) {
|
|
14976
|
+
}
|
|
14977
|
+
const startTime = now();
|
|
14882
14978
|
try {
|
|
14883
14979
|
const stream = executeTool({
|
|
14884
14980
|
execute: tool2.execute.bind(tool2),
|
|
@@ -14903,6 +14999,16 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
14903
14999
|
}
|
|
14904
15000
|
}
|
|
14905
15001
|
} catch (error) {
|
|
15002
|
+
const durationMs2 = now() - startTime;
|
|
15003
|
+
try {
|
|
15004
|
+
await (onToolCallFinish == null ? void 0 : onToolCallFinish({
|
|
15005
|
+
...baseCallbackEvent,
|
|
15006
|
+
success: false,
|
|
15007
|
+
error,
|
|
15008
|
+
durationMs: durationMs2
|
|
15009
|
+
}));
|
|
15010
|
+
} catch (_ignored) {
|
|
15011
|
+
}
|
|
14906
15012
|
recordErrorOnSpan(span, error);
|
|
14907
15013
|
return {
|
|
14908
15014
|
type: "tool-error",
|
|
@@ -14914,6 +15020,16 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
14914
15020
|
...toolCall.providerMetadata != null ? { providerMetadata: toolCall.providerMetadata } : {}
|
|
14915
15021
|
};
|
|
14916
15022
|
}
|
|
15023
|
+
const durationMs = now() - startTime;
|
|
15024
|
+
try {
|
|
15025
|
+
await (onToolCallFinish == null ? void 0 : onToolCallFinish({
|
|
15026
|
+
...baseCallbackEvent,
|
|
15027
|
+
success: true,
|
|
15028
|
+
output,
|
|
15029
|
+
durationMs
|
|
15030
|
+
}));
|
|
15031
|
+
} catch (_ignored) {
|
|
15032
|
+
}
|
|
14917
15033
|
try {
|
|
14918
15034
|
span.setAttributes(
|
|
14919
15035
|
await selectTelemetryAttributes({
|
|
@@ -15777,6 +15893,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
15777
15893
|
}
|
|
15778
15894
|
var DefaultStepResult = class {
|
|
15779
15895
|
constructor({
|
|
15896
|
+
stepNumber,
|
|
15897
|
+
model,
|
|
15898
|
+
functionId,
|
|
15899
|
+
metadata: metadata2,
|
|
15900
|
+
experimental_context,
|
|
15780
15901
|
content,
|
|
15781
15902
|
finishReason,
|
|
15782
15903
|
rawFinishReason,
|
|
@@ -15786,6 +15907,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
15786
15907
|
response,
|
|
15787
15908
|
providerMetadata
|
|
15788
15909
|
}) {
|
|
15910
|
+
this.stepNumber = stepNumber;
|
|
15911
|
+
this.model = model;
|
|
15912
|
+
this.functionId = functionId;
|
|
15913
|
+
this.metadata = metadata2;
|
|
15914
|
+
this.experimental_context = experimental_context;
|
|
15789
15915
|
this.content = content;
|
|
15790
15916
|
this.finishReason = finishReason;
|
|
15791
15917
|
this.rawFinishReason = rawFinishReason;
|
|
@@ -16027,6 +16153,10 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16027
16153
|
experimental_context,
|
|
16028
16154
|
experimental_include: include,
|
|
16029
16155
|
_internal: { generateId: generateId2 = originalGenerateId } = {},
|
|
16156
|
+
experimental_onStart: onStart,
|
|
16157
|
+
experimental_onStepStart: onStepStart,
|
|
16158
|
+
experimental_onToolCallStart: onToolCallStart,
|
|
16159
|
+
experimental_onToolCallFinish: onToolCallFinish,
|
|
16030
16160
|
onStepFinish,
|
|
16031
16161
|
onFinish,
|
|
16032
16162
|
...settings
|
|
@@ -16056,11 +16186,43 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16056
16186
|
headers: headersWithUserAgent,
|
|
16057
16187
|
settings: { ...callSettings, maxRetries }
|
|
16058
16188
|
});
|
|
16189
|
+
const modelInfo = { provider: model.provider, modelId: model.modelId };
|
|
16059
16190
|
const initialPrompt = await standardizePrompt({
|
|
16060
16191
|
system,
|
|
16061
16192
|
prompt,
|
|
16062
16193
|
messages
|
|
16063
16194
|
});
|
|
16195
|
+
try {
|
|
16196
|
+
await (onStart == null ? void 0 : onStart({
|
|
16197
|
+
model: modelInfo,
|
|
16198
|
+
system,
|
|
16199
|
+
prompt,
|
|
16200
|
+
messages,
|
|
16201
|
+
tools,
|
|
16202
|
+
toolChoice,
|
|
16203
|
+
activeTools,
|
|
16204
|
+
maxOutputTokens: callSettings.maxOutputTokens,
|
|
16205
|
+
temperature: callSettings.temperature,
|
|
16206
|
+
topP: callSettings.topP,
|
|
16207
|
+
topK: callSettings.topK,
|
|
16208
|
+
presencePenalty: callSettings.presencePenalty,
|
|
16209
|
+
frequencyPenalty: callSettings.frequencyPenalty,
|
|
16210
|
+
stopSequences: callSettings.stopSequences,
|
|
16211
|
+
seed: callSettings.seed,
|
|
16212
|
+
maxRetries,
|
|
16213
|
+
timeout,
|
|
16214
|
+
headers,
|
|
16215
|
+
providerOptions,
|
|
16216
|
+
stopWhen,
|
|
16217
|
+
output,
|
|
16218
|
+
abortSignal,
|
|
16219
|
+
include,
|
|
16220
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
16221
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
16222
|
+
experimental_context
|
|
16223
|
+
}));
|
|
16224
|
+
} catch (_ignored) {
|
|
16225
|
+
}
|
|
16064
16226
|
const tracer = getTracer(telemetry);
|
|
16065
16227
|
try {
|
|
16066
16228
|
return await recordSpan({
|
|
@@ -16084,7 +16246,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16084
16246
|
}),
|
|
16085
16247
|
tracer,
|
|
16086
16248
|
fn: async (span) => {
|
|
16087
|
-
var _a21, _b9, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
16249
|
+
var _a21, _b9, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
16088
16250
|
const initialMessages = initialPrompt.messages;
|
|
16089
16251
|
const responseMessages = [];
|
|
16090
16252
|
const { approvedToolApprovals, deniedToolApprovals } = collectToolApprovals({ messages: initialMessages });
|
|
@@ -16101,7 +16263,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16101
16263
|
telemetry,
|
|
16102
16264
|
messages: initialMessages,
|
|
16103
16265
|
abortSignal: mergedAbortSignal,
|
|
16104
|
-
experimental_context
|
|
16266
|
+
experimental_context,
|
|
16267
|
+
stepNumber: 0,
|
|
16268
|
+
model: modelInfo,
|
|
16269
|
+
onToolCallStart,
|
|
16270
|
+
onToolCallFinish
|
|
16105
16271
|
});
|
|
16106
16272
|
const toolContent = [];
|
|
16107
16273
|
for (const output2 of toolOutputs) {
|
|
@@ -16181,6 +16347,10 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16181
16347
|
const stepModel = resolveLanguageModel(
|
|
16182
16348
|
(_a21 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a21 : model
|
|
16183
16349
|
);
|
|
16350
|
+
const stepModelInfo = {
|
|
16351
|
+
provider: stepModel.provider,
|
|
16352
|
+
modelId: stepModel.modelId
|
|
16353
|
+
};
|
|
16184
16354
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
16185
16355
|
prompt: {
|
|
16186
16356
|
system: (_b9 = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b9 : initialPrompt.system,
|
|
@@ -16190,11 +16360,41 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16190
16360
|
download: download2
|
|
16191
16361
|
});
|
|
16192
16362
|
experimental_context = (_d = prepareStepResult == null ? void 0 : prepareStepResult.experimental_context) != null ? _d : experimental_context;
|
|
16363
|
+
const stepActiveTools = (_e = prepareStepResult == null ? void 0 : prepareStepResult.activeTools) != null ? _e : activeTools;
|
|
16193
16364
|
const { toolChoice: stepToolChoice, tools: stepTools } = await prepareToolsAndToolChoice({
|
|
16194
16365
|
tools,
|
|
16195
|
-
toolChoice: (
|
|
16196
|
-
activeTools:
|
|
16366
|
+
toolChoice: (_f = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _f : toolChoice,
|
|
16367
|
+
activeTools: stepActiveTools
|
|
16197
16368
|
});
|
|
16369
|
+
const stepMessages = (_g = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _g : stepInputMessages;
|
|
16370
|
+
const stepSystem = (_h = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _h : initialPrompt.system;
|
|
16371
|
+
const stepProviderOptions = mergeObjects(
|
|
16372
|
+
providerOptions,
|
|
16373
|
+
prepareStepResult == null ? void 0 : prepareStepResult.providerOptions
|
|
16374
|
+
);
|
|
16375
|
+
try {
|
|
16376
|
+
await (onStepStart == null ? void 0 : onStepStart({
|
|
16377
|
+
stepNumber: steps.length,
|
|
16378
|
+
model: stepModelInfo,
|
|
16379
|
+
system: stepSystem,
|
|
16380
|
+
messages: stepMessages,
|
|
16381
|
+
tools,
|
|
16382
|
+
toolChoice: stepToolChoice,
|
|
16383
|
+
activeTools: stepActiveTools,
|
|
16384
|
+
steps: [...steps],
|
|
16385
|
+
providerOptions: stepProviderOptions,
|
|
16386
|
+
timeout,
|
|
16387
|
+
headers,
|
|
16388
|
+
stopWhen,
|
|
16389
|
+
output,
|
|
16390
|
+
abortSignal,
|
|
16391
|
+
include,
|
|
16392
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
16393
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
16394
|
+
experimental_context
|
|
16395
|
+
}));
|
|
16396
|
+
} catch (_ignored) {
|
|
16397
|
+
}
|
|
16198
16398
|
currentModelResponse = await retry(
|
|
16199
16399
|
() => {
|
|
16200
16400
|
var _a22;
|
|
@@ -16237,10 +16437,6 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16237
16437
|
tracer,
|
|
16238
16438
|
fn: async (span2) => {
|
|
16239
16439
|
var _a23, _b22, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
16240
|
-
const stepProviderOptions = mergeObjects(
|
|
16241
|
-
providerOptions,
|
|
16242
|
-
prepareStepResult == null ? void 0 : prepareStepResult.providerOptions
|
|
16243
|
-
);
|
|
16244
16440
|
const result = await stepModel.doGenerate({
|
|
16245
16441
|
...callSettings2,
|
|
16246
16442
|
tools: stepTools,
|
|
@@ -16372,7 +16568,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16372
16568
|
telemetry,
|
|
16373
16569
|
messages: stepInputMessages,
|
|
16374
16570
|
abortSignal: mergedAbortSignal,
|
|
16375
|
-
experimental_context
|
|
16571
|
+
experimental_context,
|
|
16572
|
+
stepNumber: steps.length,
|
|
16573
|
+
model: stepModelInfo,
|
|
16574
|
+
onToolCallStart,
|
|
16575
|
+
onToolCallFinish
|
|
16376
16576
|
})
|
|
16377
16577
|
);
|
|
16378
16578
|
}
|
|
@@ -16409,15 +16609,21 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16409
16609
|
tools
|
|
16410
16610
|
})
|
|
16411
16611
|
);
|
|
16412
|
-
const stepRequest = ((
|
|
16612
|
+
const stepRequest = ((_i = include == null ? void 0 : include.requestBody) != null ? _i : true) ? (_j = currentModelResponse.request) != null ? _j : {} : { ...currentModelResponse.request, body: void 0 };
|
|
16413
16613
|
const stepResponse = {
|
|
16414
16614
|
...currentModelResponse.response,
|
|
16415
16615
|
// deep clone msgs to avoid mutating past messages in multi-step:
|
|
16416
16616
|
messages: structuredClone(responseMessages),
|
|
16417
16617
|
// Conditionally include response body:
|
|
16418
|
-
body: ((
|
|
16618
|
+
body: ((_k = include == null ? void 0 : include.responseBody) != null ? _k : true) ? (_l = currentModelResponse.response) == null ? void 0 : _l.body : void 0
|
|
16419
16619
|
};
|
|
16620
|
+
const stepNumber = steps.length;
|
|
16420
16621
|
const currentStepResult = new DefaultStepResult({
|
|
16622
|
+
stepNumber,
|
|
16623
|
+
model: stepModelInfo,
|
|
16624
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
16625
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
16626
|
+
experimental_context,
|
|
16421
16627
|
content: stepContent,
|
|
16422
16628
|
finishReason: currentModelResponse.finishReason.unified,
|
|
16423
16629
|
rawFinishReason: currentModelResponse.finishReason.raw,
|
|
@@ -16428,9 +16634,9 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16428
16634
|
response: stepResponse
|
|
16429
16635
|
});
|
|
16430
16636
|
logWarnings({
|
|
16431
|
-
warnings: (
|
|
16432
|
-
provider:
|
|
16433
|
-
model:
|
|
16637
|
+
warnings: (_m = currentModelResponse.warnings) != null ? _m : [],
|
|
16638
|
+
provider: stepModelInfo.provider,
|
|
16639
|
+
model: stepModelInfo.modelId
|
|
16434
16640
|
});
|
|
16435
16641
|
steps.push(currentStepResult);
|
|
16436
16642
|
await (onStepFinish == null ? void 0 : onStepFinish(currentStepResult));
|
|
@@ -16486,6 +16692,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16486
16692
|
}
|
|
16487
16693
|
);
|
|
16488
16694
|
await (onFinish == null ? void 0 : onFinish({
|
|
16695
|
+
stepNumber: lastStep.stepNumber,
|
|
16696
|
+
model: lastStep.model,
|
|
16697
|
+
functionId: lastStep.functionId,
|
|
16698
|
+
metadata: lastStep.metadata,
|
|
16699
|
+
experimental_context: lastStep.experimental_context,
|
|
16489
16700
|
finishReason: lastStep.finishReason,
|
|
16490
16701
|
rawFinishReason: lastStep.rawFinishReason,
|
|
16491
16702
|
usage: lastStep.usage,
|
|
@@ -16506,8 +16717,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16506
16717
|
warnings: lastStep.warnings,
|
|
16507
16718
|
providerMetadata: lastStep.providerMetadata,
|
|
16508
16719
|
steps,
|
|
16509
|
-
totalUsage
|
|
16510
|
-
experimental_context
|
|
16720
|
+
totalUsage
|
|
16511
16721
|
}));
|
|
16512
16722
|
let resolvedOutput;
|
|
16513
16723
|
if (lastStep.finishReason === "stop") {
|
|
@@ -16539,7 +16749,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16539
16749
|
telemetry,
|
|
16540
16750
|
messages,
|
|
16541
16751
|
abortSignal,
|
|
16542
|
-
experimental_context
|
|
16752
|
+
experimental_context,
|
|
16753
|
+
stepNumber,
|
|
16754
|
+
model,
|
|
16755
|
+
onToolCallStart,
|
|
16756
|
+
onToolCallFinish
|
|
16543
16757
|
}) {
|
|
16544
16758
|
const toolOutputs = await Promise.all(
|
|
16545
16759
|
toolCalls.map(
|
|
@@ -16550,7 +16764,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
16550
16764
|
telemetry,
|
|
16551
16765
|
messages,
|
|
16552
16766
|
abortSignal,
|
|
16553
|
-
experimental_context
|
|
16767
|
+
experimental_context,
|
|
16768
|
+
stepNumber,
|
|
16769
|
+
model,
|
|
16770
|
+
onToolCallStart,
|
|
16771
|
+
onToolCallFinish
|
|
16554
16772
|
})
|
|
16555
16773
|
)
|
|
16556
16774
|
);
|
|
@@ -17711,10 +17929,6 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
17711
17929
|
terminate
|
|
17712
17930
|
};
|
|
17713
17931
|
}
|
|
17714
|
-
function now() {
|
|
17715
|
-
var _a21, _b9;
|
|
17716
|
-
return (_b9 = (_a21 = globalThis == null ? void 0 : globalThis.performance) == null ? void 0 : _a21.now()) != null ? _b9 : Date.now();
|
|
17717
|
-
}
|
|
17718
17932
|
function runToolsTransformation({
|
|
17719
17933
|
tools,
|
|
17720
17934
|
generatorStream,
|
|
@@ -17725,7 +17939,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
17725
17939
|
abortSignal,
|
|
17726
17940
|
repairToolCall,
|
|
17727
17941
|
experimental_context,
|
|
17728
|
-
generateId: generateId2
|
|
17942
|
+
generateId: generateId2,
|
|
17943
|
+
stepNumber,
|
|
17944
|
+
model,
|
|
17945
|
+
onToolCallStart,
|
|
17946
|
+
onToolCallFinish
|
|
17729
17947
|
}) {
|
|
17730
17948
|
let toolResultsStreamController = null;
|
|
17731
17949
|
const toolResultsStream = new ReadableStream({
|
|
@@ -17867,6 +18085,10 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
17867
18085
|
messages,
|
|
17868
18086
|
abortSignal,
|
|
17869
18087
|
experimental_context,
|
|
18088
|
+
stepNumber,
|
|
18089
|
+
model,
|
|
18090
|
+
onToolCallStart,
|
|
18091
|
+
onToolCallFinish,
|
|
17870
18092
|
onPreliminaryToolResult: (result) => {
|
|
17871
18093
|
toolResultsStreamController.enqueue(result);
|
|
17872
18094
|
}
|
|
@@ -17983,6 +18205,10 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
17983
18205
|
onFinish,
|
|
17984
18206
|
onAbort,
|
|
17985
18207
|
onStepFinish,
|
|
18208
|
+
experimental_onStart: onStart,
|
|
18209
|
+
experimental_onStepStart: onStepStart,
|
|
18210
|
+
experimental_onToolCallStart: onToolCallStart,
|
|
18211
|
+
experimental_onToolCallFinish: onToolCallFinish,
|
|
17986
18212
|
experimental_context,
|
|
17987
18213
|
experimental_include: include,
|
|
17988
18214
|
_internal: { now: now2 = now, generateId: generateId2 = originalGenerateId2 } = {},
|
|
@@ -18022,11 +18248,18 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18022
18248
|
providerOptions,
|
|
18023
18249
|
prepareStep,
|
|
18024
18250
|
includeRawChunks,
|
|
18251
|
+
timeout,
|
|
18252
|
+
stopWhen,
|
|
18253
|
+
originalAbortSignal: abortSignal,
|
|
18025
18254
|
onChunk,
|
|
18026
18255
|
onError,
|
|
18027
18256
|
onFinish,
|
|
18028
18257
|
onAbort,
|
|
18029
18258
|
onStepFinish,
|
|
18259
|
+
onStart,
|
|
18260
|
+
onStepStart,
|
|
18261
|
+
onToolCallStart,
|
|
18262
|
+
onToolCallFinish,
|
|
18030
18263
|
now: now2,
|
|
18031
18264
|
generateId: generateId2,
|
|
18032
18265
|
experimental_context,
|
|
@@ -18123,11 +18356,18 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18123
18356
|
includeRawChunks,
|
|
18124
18357
|
now: now2,
|
|
18125
18358
|
generateId: generateId2,
|
|
18359
|
+
timeout,
|
|
18360
|
+
stopWhen,
|
|
18361
|
+
originalAbortSignal,
|
|
18126
18362
|
onChunk,
|
|
18127
18363
|
onError,
|
|
18128
18364
|
onFinish,
|
|
18129
18365
|
onAbort,
|
|
18130
18366
|
onStepFinish,
|
|
18367
|
+
onStart,
|
|
18368
|
+
onStepStart,
|
|
18369
|
+
onToolCallStart,
|
|
18370
|
+
onToolCallFinish,
|
|
18131
18371
|
experimental_context,
|
|
18132
18372
|
download: download2,
|
|
18133
18373
|
include
|
|
@@ -18270,6 +18510,10 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18270
18510
|
tools
|
|
18271
18511
|
});
|
|
18272
18512
|
const currentStepResult = new DefaultStepResult({
|
|
18513
|
+
stepNumber: recordedSteps.length,
|
|
18514
|
+
model: modelInfo,
|
|
18515
|
+
...callbackTelemetryProps,
|
|
18516
|
+
experimental_context,
|
|
18273
18517
|
content: recordedContent,
|
|
18274
18518
|
finishReason: part.finishReason,
|
|
18275
18519
|
rawFinishReason: part.rawFinishReason,
|
|
@@ -18285,8 +18529,8 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18285
18529
|
await (onStepFinish == null ? void 0 : onStepFinish(currentStepResult));
|
|
18286
18530
|
logWarnings({
|
|
18287
18531
|
warnings: recordedWarnings,
|
|
18288
|
-
provider:
|
|
18289
|
-
model:
|
|
18532
|
+
provider: modelInfo.provider,
|
|
18533
|
+
model: modelInfo.modelId
|
|
18290
18534
|
});
|
|
18291
18535
|
recordedSteps.push(currentStepResult);
|
|
18292
18536
|
recordedResponseMessages.push(...stepMessages);
|
|
@@ -18318,6 +18562,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18318
18562
|
self2._steps.resolve(recordedSteps);
|
|
18319
18563
|
const finalStep = recordedSteps[recordedSteps.length - 1];
|
|
18320
18564
|
await (onFinish == null ? void 0 : onFinish({
|
|
18565
|
+
stepNumber: finalStep.stepNumber,
|
|
18566
|
+
model: finalStep.model,
|
|
18567
|
+
functionId: finalStep.functionId,
|
|
18568
|
+
metadata: finalStep.metadata,
|
|
18569
|
+
experimental_context: finalStep.experimental_context,
|
|
18321
18570
|
finishReason: finalStep.finishReason,
|
|
18322
18571
|
rawFinishReason: finalStep.rawFinishReason,
|
|
18323
18572
|
totalUsage,
|
|
@@ -18338,8 +18587,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18338
18587
|
response: finalStep.response,
|
|
18339
18588
|
warnings: finalStep.warnings,
|
|
18340
18589
|
providerMetadata: finalStep.providerMetadata,
|
|
18341
|
-
steps: recordedSteps
|
|
18342
|
-
experimental_context
|
|
18590
|
+
steps: recordedSteps
|
|
18343
18591
|
}));
|
|
18344
18592
|
rootSpan.setAttributes(
|
|
18345
18593
|
await selectTelemetryAttributes({
|
|
@@ -18441,6 +18689,11 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18441
18689
|
settings: { ...callSettings, maxRetries }
|
|
18442
18690
|
});
|
|
18443
18691
|
const self2 = this;
|
|
18692
|
+
const modelInfo = { provider: model.provider, modelId: model.modelId };
|
|
18693
|
+
const callbackTelemetryProps = {
|
|
18694
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
18695
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
18696
|
+
};
|
|
18444
18697
|
recordSpan({
|
|
18445
18698
|
name: "ai.streamText",
|
|
18446
18699
|
attributes: selectTelemetryAttributes({
|
|
@@ -18463,6 +18716,36 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18463
18716
|
prompt,
|
|
18464
18717
|
messages
|
|
18465
18718
|
});
|
|
18719
|
+
try {
|
|
18720
|
+
await (onStart == null ? void 0 : onStart({
|
|
18721
|
+
model: modelInfo,
|
|
18722
|
+
system,
|
|
18723
|
+
prompt,
|
|
18724
|
+
messages,
|
|
18725
|
+
tools,
|
|
18726
|
+
toolChoice,
|
|
18727
|
+
activeTools,
|
|
18728
|
+
maxOutputTokens: callSettings.maxOutputTokens,
|
|
18729
|
+
temperature: callSettings.temperature,
|
|
18730
|
+
topP: callSettings.topP,
|
|
18731
|
+
topK: callSettings.topK,
|
|
18732
|
+
presencePenalty: callSettings.presencePenalty,
|
|
18733
|
+
frequencyPenalty: callSettings.frequencyPenalty,
|
|
18734
|
+
stopSequences: callSettings.stopSequences,
|
|
18735
|
+
seed: callSettings.seed,
|
|
18736
|
+
maxRetries,
|
|
18737
|
+
timeout,
|
|
18738
|
+
headers,
|
|
18739
|
+
providerOptions,
|
|
18740
|
+
stopWhen,
|
|
18741
|
+
output,
|
|
18742
|
+
abortSignal: originalAbortSignal,
|
|
18743
|
+
include,
|
|
18744
|
+
...callbackTelemetryProps,
|
|
18745
|
+
experimental_context
|
|
18746
|
+
}));
|
|
18747
|
+
} catch (_ignored) {
|
|
18748
|
+
}
|
|
18466
18749
|
const initialMessages = initialPrompt.messages;
|
|
18467
18750
|
const initialResponseMessages = [];
|
|
18468
18751
|
const { approvedToolApprovals, deniedToolApprovals } = collectToolApprovals({ messages: initialMessages });
|
|
@@ -18509,6 +18792,10 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18509
18792
|
messages: initialMessages,
|
|
18510
18793
|
abortSignal,
|
|
18511
18794
|
experimental_context,
|
|
18795
|
+
stepNumber: recordedSteps.length,
|
|
18796
|
+
model: modelInfo,
|
|
18797
|
+
onToolCallStart,
|
|
18798
|
+
onToolCallFinish,
|
|
18512
18799
|
onPreliminaryToolResult: (result2) => {
|
|
18513
18800
|
toolExecutionStepStreamController == null ? void 0 : toolExecutionStepStreamController.enqueue(result2);
|
|
18514
18801
|
}
|
|
@@ -18575,7 +18862,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18575
18862
|
responseMessages,
|
|
18576
18863
|
usage
|
|
18577
18864
|
}) {
|
|
18578
|
-
var _a21, _b9, _c, _d, _e, _f, _g;
|
|
18865
|
+
var _a21, _b9, _c, _d, _e, _f, _g, _h, _i;
|
|
18579
18866
|
const includeRawChunks2 = self2.includeRawChunks;
|
|
18580
18867
|
const stepTimeoutId = stepTimeoutMs != null ? setTimeout(() => stepAbortController.abort(), stepTimeoutMs) : void 0;
|
|
18581
18868
|
let chunkTimeoutId = void 0;
|
|
@@ -18614,6 +18901,10 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18614
18901
|
const stepModel = resolveLanguageModel(
|
|
18615
18902
|
(_a21 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a21 : model
|
|
18616
18903
|
);
|
|
18904
|
+
const stepModelInfo = {
|
|
18905
|
+
provider: stepModel.provider,
|
|
18906
|
+
modelId: stepModel.modelId
|
|
18907
|
+
};
|
|
18617
18908
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
18618
18909
|
prompt: {
|
|
18619
18910
|
system: (_b9 = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b9 : initialPrompt.system,
|
|
@@ -18622,16 +18913,41 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18622
18913
|
supportedUrls: await stepModel.supportedUrls,
|
|
18623
18914
|
download: download2
|
|
18624
18915
|
});
|
|
18916
|
+
const stepActiveTools = (_d = prepareStepResult == null ? void 0 : prepareStepResult.activeTools) != null ? _d : activeTools;
|
|
18625
18917
|
const { toolChoice: stepToolChoice, tools: stepTools } = await prepareToolsAndToolChoice({
|
|
18626
18918
|
tools,
|
|
18627
|
-
toolChoice: (
|
|
18628
|
-
activeTools:
|
|
18919
|
+
toolChoice: (_e = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _e : toolChoice,
|
|
18920
|
+
activeTools: stepActiveTools
|
|
18629
18921
|
});
|
|
18630
18922
|
experimental_context = (_f = prepareStepResult == null ? void 0 : prepareStepResult.experimental_context) != null ? _f : experimental_context;
|
|
18923
|
+
const stepMessages = (_g = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _g : stepInputMessages;
|
|
18924
|
+
const stepSystem = (_h = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _h : initialPrompt.system;
|
|
18631
18925
|
const stepProviderOptions = mergeObjects(
|
|
18632
18926
|
providerOptions,
|
|
18633
18927
|
prepareStepResult == null ? void 0 : prepareStepResult.providerOptions
|
|
18634
18928
|
);
|
|
18929
|
+
try {
|
|
18930
|
+
await (onStepStart == null ? void 0 : onStepStart({
|
|
18931
|
+
stepNumber: recordedSteps.length,
|
|
18932
|
+
model: stepModelInfo,
|
|
18933
|
+
system: stepSystem,
|
|
18934
|
+
messages: stepMessages,
|
|
18935
|
+
tools,
|
|
18936
|
+
toolChoice: stepToolChoice,
|
|
18937
|
+
activeTools: stepActiveTools,
|
|
18938
|
+
steps: [...recordedSteps],
|
|
18939
|
+
providerOptions: stepProviderOptions,
|
|
18940
|
+
timeout,
|
|
18941
|
+
headers,
|
|
18942
|
+
stopWhen,
|
|
18943
|
+
output,
|
|
18944
|
+
abortSignal: originalAbortSignal,
|
|
18945
|
+
include,
|
|
18946
|
+
...callbackTelemetryProps,
|
|
18947
|
+
experimental_context
|
|
18948
|
+
}));
|
|
18949
|
+
} catch (_ignored) {
|
|
18950
|
+
}
|
|
18635
18951
|
const {
|
|
18636
18952
|
result: { stream: stream2, response, request },
|
|
18637
18953
|
doStreamSpan,
|
|
@@ -18703,9 +19019,13 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18703
19019
|
repairToolCall,
|
|
18704
19020
|
abortSignal,
|
|
18705
19021
|
experimental_context,
|
|
18706
|
-
generateId: generateId2
|
|
19022
|
+
generateId: generateId2,
|
|
19023
|
+
stepNumber: recordedSteps.length,
|
|
19024
|
+
model: stepModelInfo,
|
|
19025
|
+
onToolCallStart,
|
|
19026
|
+
onToolCallFinish
|
|
18707
19027
|
});
|
|
18708
|
-
const stepRequest = ((
|
|
19028
|
+
const stepRequest = ((_i = include == null ? void 0 : include.requestBody) != null ? _i : true) ? request != null ? request : {} : { ...request, body: void 0 };
|
|
18709
19029
|
const stepToolCalls = [];
|
|
18710
19030
|
const stepToolOutputs = [];
|
|
18711
19031
|
let warnings;
|
|
@@ -18718,7 +19038,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
18718
19038
|
let stepResponse = {
|
|
18719
19039
|
id: generateId2(),
|
|
18720
19040
|
timestamp: /* @__PURE__ */ new Date(),
|
|
18721
|
-
modelId:
|
|
19041
|
+
modelId: modelInfo.modelId
|
|
18722
19042
|
};
|
|
18723
19043
|
let activeText = "";
|
|
18724
19044
|
self2.addStream(
|
|
@@ -25980,7 +26300,8 @@ ${user}:`]
|
|
|
25980
26300
|
"dall-e-2": 10,
|
|
25981
26301
|
"gpt-image-1": 10,
|
|
25982
26302
|
"gpt-image-1-mini": 10,
|
|
25983
|
-
"gpt-image-1.5": 10
|
|
26303
|
+
"gpt-image-1.5": 10,
|
|
26304
|
+
"chatgpt-image-latest": 10
|
|
25984
26305
|
};
|
|
25985
26306
|
var defaultResponseFormatPrefixes = [
|
|
25986
26307
|
"gpt-image-1-mini",
|
|
@@ -26081,15 +26402,20 @@ ${user}:`]
|
|
|
26081
26402
|
},
|
|
26082
26403
|
providerMetadata: {
|
|
26083
26404
|
openai: {
|
|
26084
|
-
images: response2.data.map((item) => {
|
|
26085
|
-
var _a22, _b22, _c2, _d2, _e2;
|
|
26405
|
+
images: response2.data.map((item, index) => {
|
|
26406
|
+
var _a22, _b22, _c2, _d2, _e2, _f2;
|
|
26086
26407
|
return {
|
|
26087
26408
|
...item.revised_prompt ? { revisedPrompt: item.revised_prompt } : {},
|
|
26088
26409
|
created: (_a22 = response2.created) != null ? _a22 : void 0,
|
|
26089
26410
|
size: (_b22 = response2.size) != null ? _b22 : void 0,
|
|
26090
26411
|
quality: (_c2 = response2.quality) != null ? _c2 : void 0,
|
|
26091
26412
|
background: (_d2 = response2.background) != null ? _d2 : void 0,
|
|
26092
|
-
outputFormat: (_e2 = response2.output_format) != null ? _e2 : void 0
|
|
26413
|
+
outputFormat: (_e2 = response2.output_format) != null ? _e2 : void 0,
|
|
26414
|
+
...distributeTokenDetails(
|
|
26415
|
+
(_f2 = response2.usage) == null ? void 0 : _f2.input_tokens_details,
|
|
26416
|
+
index,
|
|
26417
|
+
response2.data.length
|
|
26418
|
+
)
|
|
26093
26419
|
};
|
|
26094
26420
|
})
|
|
26095
26421
|
}
|
|
@@ -26132,15 +26458,20 @@ ${user}:`]
|
|
|
26132
26458
|
},
|
|
26133
26459
|
providerMetadata: {
|
|
26134
26460
|
openai: {
|
|
26135
|
-
images: response.data.map((item) => {
|
|
26136
|
-
var _a22, _b22, _c2, _d2, _e2;
|
|
26461
|
+
images: response.data.map((item, index) => {
|
|
26462
|
+
var _a22, _b22, _c2, _d2, _e2, _f2;
|
|
26137
26463
|
return {
|
|
26138
26464
|
...item.revised_prompt ? { revisedPrompt: item.revised_prompt } : {},
|
|
26139
26465
|
created: (_a22 = response.created) != null ? _a22 : void 0,
|
|
26140
26466
|
size: (_b22 = response.size) != null ? _b22 : void 0,
|
|
26141
26467
|
quality: (_c2 = response.quality) != null ? _c2 : void 0,
|
|
26142
26468
|
background: (_d2 = response.background) != null ? _d2 : void 0,
|
|
26143
|
-
outputFormat: (_e2 = response.output_format) != null ? _e2 : void 0
|
|
26469
|
+
outputFormat: (_e2 = response.output_format) != null ? _e2 : void 0,
|
|
26470
|
+
...distributeTokenDetails(
|
|
26471
|
+
(_f2 = response.usage) == null ? void 0 : _f2.input_tokens_details,
|
|
26472
|
+
index,
|
|
26473
|
+
response.data.length
|
|
26474
|
+
)
|
|
26144
26475
|
};
|
|
26145
26476
|
})
|
|
26146
26477
|
}
|
|
@@ -26148,6 +26479,23 @@ ${user}:`]
|
|
|
26148
26479
|
};
|
|
26149
26480
|
}
|
|
26150
26481
|
};
|
|
26482
|
+
function distributeTokenDetails(details, index, total) {
|
|
26483
|
+
if (details == null) {
|
|
26484
|
+
return {};
|
|
26485
|
+
}
|
|
26486
|
+
const result = {};
|
|
26487
|
+
if (details.image_tokens != null) {
|
|
26488
|
+
const base = Math.floor(details.image_tokens / total);
|
|
26489
|
+
const remainder = details.image_tokens - base * (total - 1);
|
|
26490
|
+
result.imageTokens = index === total - 1 ? remainder : base;
|
|
26491
|
+
}
|
|
26492
|
+
if (details.text_tokens != null) {
|
|
26493
|
+
const base = Math.floor(details.text_tokens / total);
|
|
26494
|
+
const remainder = details.text_tokens - base * (total - 1);
|
|
26495
|
+
result.textTokens = index === total - 1 ? remainder : base;
|
|
26496
|
+
}
|
|
26497
|
+
return result;
|
|
26498
|
+
}
|
|
26151
26499
|
async function fileToBlob(file) {
|
|
26152
26500
|
if (!file) return void 0;
|
|
26153
26501
|
if (file.type === "url") {
|
|
@@ -26358,6 +26706,67 @@ ${user}:`]
|
|
|
26358
26706
|
})
|
|
26359
26707
|
)
|
|
26360
26708
|
);
|
|
26709
|
+
var shellSkillsSchema = array$1(
|
|
26710
|
+
discriminatedUnion("type", [
|
|
26711
|
+
object$1({
|
|
26712
|
+
type: literal("skillReference"),
|
|
26713
|
+
skillId: string(),
|
|
26714
|
+
version: string().optional()
|
|
26715
|
+
}),
|
|
26716
|
+
object$1({
|
|
26717
|
+
type: literal("inline"),
|
|
26718
|
+
name: string(),
|
|
26719
|
+
description: string(),
|
|
26720
|
+
source: object$1({
|
|
26721
|
+
type: literal("base64"),
|
|
26722
|
+
mediaType: literal("application/zip"),
|
|
26723
|
+
data: string()
|
|
26724
|
+
})
|
|
26725
|
+
})
|
|
26726
|
+
])
|
|
26727
|
+
).optional();
|
|
26728
|
+
var shellArgsSchema = lazySchema(
|
|
26729
|
+
() => zodSchema(
|
|
26730
|
+
object$1({
|
|
26731
|
+
environment: union([
|
|
26732
|
+
object$1({
|
|
26733
|
+
type: literal("containerAuto"),
|
|
26734
|
+
fileIds: array$1(string()).optional(),
|
|
26735
|
+
memoryLimit: _enum$1(["1g", "4g", "16g", "64g"]).optional(),
|
|
26736
|
+
networkPolicy: discriminatedUnion("type", [
|
|
26737
|
+
object$1({ type: literal("disabled") }),
|
|
26738
|
+
object$1({
|
|
26739
|
+
type: literal("allowlist"),
|
|
26740
|
+
allowedDomains: array$1(string()),
|
|
26741
|
+
domainSecrets: array$1(
|
|
26742
|
+
object$1({
|
|
26743
|
+
domain: string(),
|
|
26744
|
+
name: string(),
|
|
26745
|
+
value: string()
|
|
26746
|
+
})
|
|
26747
|
+
).optional()
|
|
26748
|
+
})
|
|
26749
|
+
]).optional(),
|
|
26750
|
+
skills: shellSkillsSchema
|
|
26751
|
+
}),
|
|
26752
|
+
object$1({
|
|
26753
|
+
type: literal("containerReference"),
|
|
26754
|
+
containerId: string()
|
|
26755
|
+
}),
|
|
26756
|
+
object$1({
|
|
26757
|
+
type: literal("local").optional(),
|
|
26758
|
+
skills: array$1(
|
|
26759
|
+
object$1({
|
|
26760
|
+
name: string(),
|
|
26761
|
+
description: string(),
|
|
26762
|
+
path: string()
|
|
26763
|
+
})
|
|
26764
|
+
).optional()
|
|
26765
|
+
})
|
|
26766
|
+
]).optional()
|
|
26767
|
+
})
|
|
26768
|
+
)
|
|
26769
|
+
);
|
|
26361
26770
|
var shell = createProviderToolFactoryWithOutputSchema({
|
|
26362
26771
|
id: "openai.shell",
|
|
26363
26772
|
inputSchema: shellInputSchema,
|
|
@@ -26397,7 +26806,7 @@ ${user}:`]
|
|
|
26397
26806
|
url: string().nullish(),
|
|
26398
26807
|
pattern: string().nullish()
|
|
26399
26808
|
})
|
|
26400
|
-
]),
|
|
26809
|
+
]).optional(),
|
|
26401
26810
|
sources: array$1(
|
|
26402
26811
|
discriminatedUnion("type", [
|
|
26403
26812
|
object$1({ type: literal("url"), url: string() }),
|
|
@@ -26447,7 +26856,7 @@ ${user}:`]
|
|
|
26447
26856
|
url: string().nullish(),
|
|
26448
26857
|
pattern: string().nullish()
|
|
26449
26858
|
})
|
|
26450
|
-
])
|
|
26859
|
+
]).optional()
|
|
26451
26860
|
})
|
|
26452
26861
|
)
|
|
26453
26862
|
);
|
|
@@ -26847,8 +27256,32 @@ ${user}:`]
|
|
|
26847
27256
|
if (hasConversation) {
|
|
26848
27257
|
break;
|
|
26849
27258
|
}
|
|
27259
|
+
const resolvedResultToolName = toolNameMapping.toProviderToolName(
|
|
27260
|
+
part.toolName
|
|
27261
|
+
);
|
|
27262
|
+
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
27263
|
+
if (part.output.type === "json") {
|
|
27264
|
+
const parsedOutput = await validateTypes$1({
|
|
27265
|
+
value: part.output.value,
|
|
27266
|
+
schema: shellOutputSchema
|
|
27267
|
+
});
|
|
27268
|
+
input.push({
|
|
27269
|
+
type: "shell_call_output",
|
|
27270
|
+
call_id: part.toolCallId,
|
|
27271
|
+
output: parsedOutput.output.map((item) => ({
|
|
27272
|
+
stdout: item.stdout,
|
|
27273
|
+
stderr: item.stderr,
|
|
27274
|
+
outcome: item.outcome.type === "timeout" ? { type: "timeout" } : {
|
|
27275
|
+
type: "exit",
|
|
27276
|
+
exit_code: item.outcome.exitCode
|
|
27277
|
+
}
|
|
27278
|
+
}))
|
|
27279
|
+
});
|
|
27280
|
+
}
|
|
27281
|
+
break;
|
|
27282
|
+
}
|
|
26850
27283
|
if (store) {
|
|
26851
|
-
const itemId = (_j = (_i = (_h = part.
|
|
27284
|
+
const itemId = (_j = (_i = (_h = part.providerOptions) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.itemId) != null ? _j : part.toolCallId;
|
|
26852
27285
|
input.push({ type: "item_reference", id: itemId });
|
|
26853
27286
|
} else {
|
|
26854
27287
|
warnings.push({
|
|
@@ -27217,6 +27650,25 @@ ${user}:`]
|
|
|
27217
27650
|
action: object$1({
|
|
27218
27651
|
commands: array$1(string())
|
|
27219
27652
|
})
|
|
27653
|
+
}),
|
|
27654
|
+
object$1({
|
|
27655
|
+
type: literal("shell_call_output"),
|
|
27656
|
+
id: string(),
|
|
27657
|
+
call_id: string(),
|
|
27658
|
+
status: _enum$1(["in_progress", "completed", "incomplete"]),
|
|
27659
|
+
output: array$1(
|
|
27660
|
+
object$1({
|
|
27661
|
+
stdout: string(),
|
|
27662
|
+
stderr: string(),
|
|
27663
|
+
outcome: discriminatedUnion("type", [
|
|
27664
|
+
object$1({ type: literal("timeout") }),
|
|
27665
|
+
object$1({
|
|
27666
|
+
type: literal("exit"),
|
|
27667
|
+
exit_code: number$1()
|
|
27668
|
+
})
|
|
27669
|
+
])
|
|
27670
|
+
})
|
|
27671
|
+
)
|
|
27220
27672
|
})
|
|
27221
27673
|
])
|
|
27222
27674
|
}),
|
|
@@ -27282,7 +27734,7 @@ ${user}:`]
|
|
|
27282
27734
|
url: string().nullish(),
|
|
27283
27735
|
pattern: string().nullish()
|
|
27284
27736
|
})
|
|
27285
|
-
])
|
|
27737
|
+
]).nullish()
|
|
27286
27738
|
}),
|
|
27287
27739
|
object$1({
|
|
27288
27740
|
type: literal("file_search_call"),
|
|
@@ -27396,6 +27848,25 @@ ${user}:`]
|
|
|
27396
27848
|
action: object$1({
|
|
27397
27849
|
commands: array$1(string())
|
|
27398
27850
|
})
|
|
27851
|
+
}),
|
|
27852
|
+
object$1({
|
|
27853
|
+
type: literal("shell_call_output"),
|
|
27854
|
+
id: string(),
|
|
27855
|
+
call_id: string(),
|
|
27856
|
+
status: _enum$1(["in_progress", "completed", "incomplete"]),
|
|
27857
|
+
output: array$1(
|
|
27858
|
+
object$1({
|
|
27859
|
+
stdout: string(),
|
|
27860
|
+
stderr: string(),
|
|
27861
|
+
outcome: discriminatedUnion("type", [
|
|
27862
|
+
object$1({ type: literal("timeout") }),
|
|
27863
|
+
object$1({
|
|
27864
|
+
type: literal("exit"),
|
|
27865
|
+
exit_code: number$1()
|
|
27866
|
+
})
|
|
27867
|
+
])
|
|
27868
|
+
})
|
|
27869
|
+
)
|
|
27399
27870
|
})
|
|
27400
27871
|
])
|
|
27401
27872
|
}),
|
|
@@ -27579,7 +28050,10 @@ ${user}:`]
|
|
|
27579
28050
|
sources: array$1(
|
|
27580
28051
|
discriminatedUnion("type", [
|
|
27581
28052
|
object$1({ type: literal("url"), url: string() }),
|
|
27582
|
-
object$1({
|
|
28053
|
+
object$1({
|
|
28054
|
+
type: literal("api"),
|
|
28055
|
+
name: string()
|
|
28056
|
+
})
|
|
27583
28057
|
])
|
|
27584
28058
|
).nullish()
|
|
27585
28059
|
}),
|
|
@@ -27592,7 +28066,7 @@ ${user}:`]
|
|
|
27592
28066
|
url: string().nullish(),
|
|
27593
28067
|
pattern: string().nullish()
|
|
27594
28068
|
})
|
|
27595
|
-
])
|
|
28069
|
+
]).nullish()
|
|
27596
28070
|
}),
|
|
27597
28071
|
object$1({
|
|
27598
28072
|
type: literal("file_search_call"),
|
|
@@ -27741,6 +28215,25 @@ ${user}:`]
|
|
|
27741
28215
|
action: object$1({
|
|
27742
28216
|
commands: array$1(string())
|
|
27743
28217
|
})
|
|
28218
|
+
}),
|
|
28219
|
+
object$1({
|
|
28220
|
+
type: literal("shell_call_output"),
|
|
28221
|
+
id: string(),
|
|
28222
|
+
call_id: string(),
|
|
28223
|
+
status: _enum$1(["in_progress", "completed", "incomplete"]),
|
|
28224
|
+
output: array$1(
|
|
28225
|
+
object$1({
|
|
28226
|
+
stdout: string(),
|
|
28227
|
+
stderr: string(),
|
|
28228
|
+
outcome: discriminatedUnion("type", [
|
|
28229
|
+
object$1({ type: literal("timeout") }),
|
|
28230
|
+
object$1({
|
|
28231
|
+
type: literal("exit"),
|
|
28232
|
+
exit_code: number$1()
|
|
28233
|
+
})
|
|
28234
|
+
])
|
|
28235
|
+
})
|
|
28236
|
+
)
|
|
27744
28237
|
})
|
|
27745
28238
|
])
|
|
27746
28239
|
).optional(),
|
|
@@ -27957,8 +28450,15 @@ ${user}:`]
|
|
|
27957
28450
|
break;
|
|
27958
28451
|
}
|
|
27959
28452
|
case "openai.shell": {
|
|
28453
|
+
const args = await validateTypes$1({
|
|
28454
|
+
value: tool2.args,
|
|
28455
|
+
schema: shellArgsSchema
|
|
28456
|
+
});
|
|
27960
28457
|
openaiTools2.push({
|
|
27961
|
-
type: "shell"
|
|
28458
|
+
type: "shell",
|
|
28459
|
+
...args.environment && {
|
|
28460
|
+
environment: mapShellEnvironment(args.environment)
|
|
28461
|
+
}
|
|
27962
28462
|
});
|
|
27963
28463
|
break;
|
|
27964
28464
|
}
|
|
@@ -28088,6 +28588,52 @@ ${user}:`]
|
|
|
28088
28588
|
}
|
|
28089
28589
|
}
|
|
28090
28590
|
}
|
|
28591
|
+
function mapShellEnvironment(environment) {
|
|
28592
|
+
if (environment.type === "containerReference") {
|
|
28593
|
+
const env2 = environment;
|
|
28594
|
+
return {
|
|
28595
|
+
type: "container_reference",
|
|
28596
|
+
container_id: env2.containerId
|
|
28597
|
+
};
|
|
28598
|
+
}
|
|
28599
|
+
if (environment.type === "containerAuto") {
|
|
28600
|
+
const env2 = environment;
|
|
28601
|
+
return {
|
|
28602
|
+
type: "container_auto",
|
|
28603
|
+
file_ids: env2.fileIds,
|
|
28604
|
+
memory_limit: env2.memoryLimit,
|
|
28605
|
+
network_policy: env2.networkPolicy == null ? void 0 : env2.networkPolicy.type === "disabled" ? { type: "disabled" } : {
|
|
28606
|
+
type: "allowlist",
|
|
28607
|
+
allowed_domains: env2.networkPolicy.allowedDomains,
|
|
28608
|
+
domain_secrets: env2.networkPolicy.domainSecrets
|
|
28609
|
+
},
|
|
28610
|
+
skills: mapShellSkills(env2.skills)
|
|
28611
|
+
};
|
|
28612
|
+
}
|
|
28613
|
+
const env = environment;
|
|
28614
|
+
return {
|
|
28615
|
+
type: "local",
|
|
28616
|
+
skills: env.skills
|
|
28617
|
+
};
|
|
28618
|
+
}
|
|
28619
|
+
function mapShellSkills(skills) {
|
|
28620
|
+
return skills == null ? void 0 : skills.map(
|
|
28621
|
+
(skill) => skill.type === "skillReference" ? {
|
|
28622
|
+
type: "skill_reference",
|
|
28623
|
+
skill_id: skill.skillId,
|
|
28624
|
+
version: skill.version
|
|
28625
|
+
} : {
|
|
28626
|
+
type: "inline",
|
|
28627
|
+
name: skill.name,
|
|
28628
|
+
description: skill.description,
|
|
28629
|
+
source: {
|
|
28630
|
+
type: "base64",
|
|
28631
|
+
media_type: skill.source.mediaType,
|
|
28632
|
+
data: skill.source.data
|
|
28633
|
+
}
|
|
28634
|
+
}
|
|
28635
|
+
);
|
|
28636
|
+
}
|
|
28091
28637
|
function extractApprovalRequestIdToToolCallIdMapping(prompt) {
|
|
28092
28638
|
var _a10, _b9;
|
|
28093
28639
|
const mapping = {};
|
|
@@ -28131,7 +28677,7 @@ ${user}:`]
|
|
|
28131
28677
|
toolChoice,
|
|
28132
28678
|
responseFormat
|
|
28133
28679
|
}) {
|
|
28134
|
-
var _a10, _b9, _c, _d, _e, _f;
|
|
28680
|
+
var _a10, _b9, _c, _d, _e, _f, _g, _h, _i;
|
|
28135
28681
|
const warnings = [];
|
|
28136
28682
|
const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);
|
|
28137
28683
|
if (topK != null) {
|
|
@@ -28335,6 +28881,10 @@ ${user}:`]
|
|
|
28335
28881
|
tools,
|
|
28336
28882
|
toolChoice
|
|
28337
28883
|
});
|
|
28884
|
+
const shellToolEnvType = (_i = (_h = (_g = tools == null ? void 0 : tools.find(
|
|
28885
|
+
(tool2) => tool2.type === "provider" && tool2.id === "openai.shell"
|
|
28886
|
+
)) == null ? void 0 : _g.args) == null ? void 0 : _h.environment) == null ? void 0 : _i.type;
|
|
28887
|
+
const isShellProviderExecuted = shellToolEnvType === "containerAuto" || shellToolEnvType === "containerReference";
|
|
28338
28888
|
return {
|
|
28339
28889
|
webSearchToolName,
|
|
28340
28890
|
args: {
|
|
@@ -28345,7 +28895,8 @@ ${user}:`]
|
|
|
28345
28895
|
warnings: [...warnings, ...toolWarnings],
|
|
28346
28896
|
store,
|
|
28347
28897
|
toolNameMapping,
|
|
28348
|
-
providerOptionsName
|
|
28898
|
+
providerOptionsName,
|
|
28899
|
+
isShellProviderExecuted
|
|
28349
28900
|
};
|
|
28350
28901
|
}
|
|
28351
28902
|
async doGenerate(options) {
|
|
@@ -28355,7 +28906,8 @@ ${user}:`]
|
|
|
28355
28906
|
warnings,
|
|
28356
28907
|
webSearchToolName,
|
|
28357
28908
|
toolNameMapping,
|
|
28358
|
-
providerOptionsName
|
|
28909
|
+
providerOptionsName,
|
|
28910
|
+
isShellProviderExecuted
|
|
28359
28911
|
} = await this.getArgs(options);
|
|
28360
28912
|
const url2 = this.config.url({
|
|
28361
28913
|
path: "/responses",
|
|
@@ -28455,6 +29007,7 @@ ${user}:`]
|
|
|
28455
29007
|
commands: part.action.commands
|
|
28456
29008
|
}
|
|
28457
29009
|
}),
|
|
29010
|
+
...isShellProviderExecuted && { providerExecuted: true },
|
|
28458
29011
|
providerMetadata: {
|
|
28459
29012
|
[providerOptionsName]: {
|
|
28460
29013
|
itemId: part.id
|
|
@@ -28463,6 +29016,24 @@ ${user}:`]
|
|
|
28463
29016
|
});
|
|
28464
29017
|
break;
|
|
28465
29018
|
}
|
|
29019
|
+
case "shell_call_output": {
|
|
29020
|
+
content.push({
|
|
29021
|
+
type: "tool-result",
|
|
29022
|
+
toolCallId: part.call_id,
|
|
29023
|
+
toolName: toolNameMapping.toCustomToolName("shell"),
|
|
29024
|
+
result: {
|
|
29025
|
+
output: part.output.map((item) => ({
|
|
29026
|
+
stdout: item.stdout,
|
|
29027
|
+
stderr: item.stderr,
|
|
29028
|
+
outcome: item.outcome.type === "exit" ? {
|
|
29029
|
+
type: "exit",
|
|
29030
|
+
exitCode: item.outcome.exit_code
|
|
29031
|
+
} : { type: "timeout" }
|
|
29032
|
+
}))
|
|
29033
|
+
}
|
|
29034
|
+
});
|
|
29035
|
+
break;
|
|
29036
|
+
}
|
|
28466
29037
|
case "message": {
|
|
28467
29038
|
for (const contentPart of part.content) {
|
|
28468
29039
|
if (((_c = (_b9 = options.providerOptions) == null ? void 0 : _b9[providerOptionsName]) == null ? void 0 : _c.logprobs) && contentPart.logprobs) {
|
|
@@ -28752,7 +29323,8 @@ ${user}:`]
|
|
|
28752
29323
|
webSearchToolName,
|
|
28753
29324
|
toolNameMapping,
|
|
28754
29325
|
store,
|
|
28755
|
-
providerOptionsName
|
|
29326
|
+
providerOptionsName,
|
|
29327
|
+
isShellProviderExecuted
|
|
28756
29328
|
} = await this.getArgs(options);
|
|
28757
29329
|
const { responseHeaders, value: response } = await postJsonToApi$1({
|
|
28758
29330
|
url: this.config.url({
|
|
@@ -28931,7 +29503,8 @@ ${user}:`]
|
|
|
28931
29503
|
toolName: toolNameMapping.toCustomToolName("shell"),
|
|
28932
29504
|
toolCallId: value.item.call_id
|
|
28933
29505
|
};
|
|
28934
|
-
} else if (value.item.type === "
|
|
29506
|
+
} else if (value.item.type === "shell_call_output") ;
|
|
29507
|
+
else if (value.item.type === "message") {
|
|
28935
29508
|
ongoingAnnotations.splice(0, ongoingAnnotations.length);
|
|
28936
29509
|
controller.enqueue({
|
|
28937
29510
|
type: "text-start",
|
|
@@ -29184,10 +29757,31 @@ ${user}:`]
|
|
|
29184
29757
|
commands: value.item.action.commands
|
|
29185
29758
|
}
|
|
29186
29759
|
}),
|
|
29760
|
+
...isShellProviderExecuted && {
|
|
29761
|
+
providerExecuted: true
|
|
29762
|
+
},
|
|
29187
29763
|
providerMetadata: {
|
|
29188
29764
|
[providerOptionsName]: { itemId: value.item.id }
|
|
29189
29765
|
}
|
|
29190
29766
|
});
|
|
29767
|
+
} else if (value.item.type === "shell_call_output") {
|
|
29768
|
+
controller.enqueue({
|
|
29769
|
+
type: "tool-result",
|
|
29770
|
+
toolCallId: value.item.call_id,
|
|
29771
|
+
toolName: toolNameMapping.toCustomToolName("shell"),
|
|
29772
|
+
result: {
|
|
29773
|
+
output: value.item.output.map(
|
|
29774
|
+
(item) => ({
|
|
29775
|
+
stdout: item.stdout,
|
|
29776
|
+
stderr: item.stderr,
|
|
29777
|
+
outcome: item.outcome.type === "exit" ? {
|
|
29778
|
+
type: "exit",
|
|
29779
|
+
exitCode: item.outcome.exit_code
|
|
29780
|
+
} : { type: "timeout" }
|
|
29781
|
+
})
|
|
29782
|
+
)
|
|
29783
|
+
}
|
|
29784
|
+
});
|
|
29191
29785
|
} else if (value.item.type === "reasoning") {
|
|
29192
29786
|
const activeReasoningPart = activeReasoning[value.item.id];
|
|
29193
29787
|
const summaryPartIndices = Object.entries(
|
|
@@ -29504,6 +30098,9 @@ ${user}:`]
|
|
|
29504
30098
|
}
|
|
29505
30099
|
function mapWebSearchOutput(action) {
|
|
29506
30100
|
var _a10;
|
|
30101
|
+
if (action == null) {
|
|
30102
|
+
return {};
|
|
30103
|
+
}
|
|
29507
30104
|
switch (action.type) {
|
|
29508
30105
|
case "search":
|
|
29509
30106
|
return {
|
|
@@ -29856,7 +30453,7 @@ ${user}:`]
|
|
|
29856
30453
|
};
|
|
29857
30454
|
}
|
|
29858
30455
|
};
|
|
29859
|
-
var VERSION$2 = "3.0.
|
|
30456
|
+
var VERSION$2 = "3.0.33";
|
|
29860
30457
|
function createOpenAI(options = {}) {
|
|
29861
30458
|
var _a10, _b9;
|
|
29862
30459
|
const baseURL = (_a10 = withoutTrailingSlash$1(
|
|
@@ -32921,7 +33518,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
32921
33518
|
(function(exports3) {
|
|
32922
33519
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
32923
33520
|
exports3.ValueScope = exports3.ValueScopeName = exports3.Scope = exports3.varKinds = exports3.UsedValueState = void 0;
|
|
32924
|
-
const code_1 = requireCode$1();
|
|
33521
|
+
const code_1 = /* @__PURE__ */ requireCode$1();
|
|
32925
33522
|
class ValueError extends Error {
|
|
32926
33523
|
constructor(name16) {
|
|
32927
33524
|
super(`CodeGen: "code" for ${name16} not defined`);
|
|
@@ -33067,9 +33664,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
33067
33664
|
(function(exports3) {
|
|
33068
33665
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
33069
33666
|
exports3.or = exports3.and = exports3.not = exports3.CodeGen = exports3.operators = exports3.varKinds = exports3.ValueScopeName = exports3.ValueScope = exports3.Scope = exports3.Name = exports3.regexpCode = exports3.stringify = exports3.getProperty = exports3.nil = exports3.strConcat = exports3.str = exports3._ = void 0;
|
|
33070
|
-
const code_1 = requireCode$1();
|
|
33071
|
-
const scope_1 = requireScope();
|
|
33072
|
-
var code_2 = requireCode$1();
|
|
33667
|
+
const code_1 = /* @__PURE__ */ requireCode$1();
|
|
33668
|
+
const scope_1 = /* @__PURE__ */ requireScope();
|
|
33669
|
+
var code_2 = /* @__PURE__ */ requireCode$1();
|
|
33073
33670
|
Object.defineProperty(exports3, "_", { enumerable: true, get: function() {
|
|
33074
33671
|
return code_2._;
|
|
33075
33672
|
} });
|
|
@@ -33094,7 +33691,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
33094
33691
|
Object.defineProperty(exports3, "Name", { enumerable: true, get: function() {
|
|
33095
33692
|
return code_2.Name;
|
|
33096
33693
|
} });
|
|
33097
|
-
var scope_2 = requireScope();
|
|
33694
|
+
var scope_2 = /* @__PURE__ */ requireScope();
|
|
33098
33695
|
Object.defineProperty(exports3, "Scope", { enumerable: true, get: function() {
|
|
33099
33696
|
return scope_2.Scope;
|
|
33100
33697
|
} });
|
|
@@ -33788,8 +34385,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
33788
34385
|
hasRequiredUtil = 1;
|
|
33789
34386
|
Object.defineProperty(util, "__esModule", { value: true });
|
|
33790
34387
|
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;
|
|
33791
|
-
const codegen_1 = requireCodegen();
|
|
33792
|
-
const code_1 = requireCode$1();
|
|
34388
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34389
|
+
const code_1 = /* @__PURE__ */ requireCode$1();
|
|
33793
34390
|
function toHash(arr) {
|
|
33794
34391
|
const hash = {};
|
|
33795
34392
|
for (const item of arr)
|
|
@@ -33954,7 +34551,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
33954
34551
|
if (hasRequiredNames) return names;
|
|
33955
34552
|
hasRequiredNames = 1;
|
|
33956
34553
|
Object.defineProperty(names, "__esModule", { value: true });
|
|
33957
|
-
const codegen_1 = requireCodegen();
|
|
34554
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
33958
34555
|
const names$1 = {
|
|
33959
34556
|
// validation function arguments
|
|
33960
34557
|
data: new codegen_1.Name("data"),
|
|
@@ -33994,9 +34591,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
33994
34591
|
(function(exports3) {
|
|
33995
34592
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
33996
34593
|
exports3.extendErrors = exports3.resetErrorsCount = exports3.reportExtraError = exports3.reportError = exports3.keyword$DataError = exports3.keywordError = void 0;
|
|
33997
|
-
const codegen_1 = requireCodegen();
|
|
33998
|
-
const util_1 = requireUtil();
|
|
33999
|
-
const names_1 = requireNames();
|
|
34594
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34595
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
34596
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
34000
34597
|
exports3.keywordError = {
|
|
34001
34598
|
message: ({ keyword: keyword2 }) => (0, codegen_1.str)`must pass "${keyword2}" keyword validation`
|
|
34002
34599
|
};
|
|
@@ -34116,9 +34713,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
34116
34713
|
hasRequiredBoolSchema = 1;
|
|
34117
34714
|
Object.defineProperty(boolSchema, "__esModule", { value: true });
|
|
34118
34715
|
boolSchema.boolOrEmptySchema = boolSchema.topBoolOrEmptySchema = void 0;
|
|
34119
|
-
const errors_1 = requireErrors();
|
|
34120
|
-
const codegen_1 = requireCodegen();
|
|
34121
|
-
const names_1 = requireNames();
|
|
34716
|
+
const errors_1 = /* @__PURE__ */ requireErrors();
|
|
34717
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34718
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
34122
34719
|
const boolError = {
|
|
34123
34720
|
message: "boolean schema is false"
|
|
34124
34721
|
};
|
|
@@ -34221,11 +34818,11 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
34221
34818
|
hasRequiredDataType = 1;
|
|
34222
34819
|
Object.defineProperty(dataType, "__esModule", { value: true });
|
|
34223
34820
|
dataType.reportTypeError = dataType.checkDataTypes = dataType.checkDataType = dataType.coerceAndCheckDataType = dataType.getJSONTypes = dataType.getSchemaTypes = dataType.DataType = void 0;
|
|
34224
|
-
const rules_1 = requireRules();
|
|
34225
|
-
const applicability_1 = requireApplicability();
|
|
34226
|
-
const errors_1 = requireErrors();
|
|
34227
|
-
const codegen_1 = requireCodegen();
|
|
34228
|
-
const util_1 = requireUtil();
|
|
34821
|
+
const rules_1 = /* @__PURE__ */ requireRules();
|
|
34822
|
+
const applicability_1 = /* @__PURE__ */ requireApplicability();
|
|
34823
|
+
const errors_1 = /* @__PURE__ */ requireErrors();
|
|
34824
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
34825
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
34229
34826
|
var DataType;
|
|
34230
34827
|
(function(DataType2) {
|
|
34231
34828
|
DataType2[DataType2["Correct"] = 0] = "Correct";
|
|
@@ -34405,8 +35002,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
34405
35002
|
hasRequiredDefaults = 1;
|
|
34406
35003
|
Object.defineProperty(defaults, "__esModule", { value: true });
|
|
34407
35004
|
defaults.assignDefaults = void 0;
|
|
34408
|
-
const codegen_1 = requireCodegen();
|
|
34409
|
-
const util_1 = requireUtil();
|
|
35005
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
35006
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
34410
35007
|
function assignDefaults(it, ty) {
|
|
34411
35008
|
const { properties: properties2, items: items2 } = it.schema;
|
|
34412
35009
|
if (ty === "object" && properties2) {
|
|
@@ -34443,10 +35040,10 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
34443
35040
|
hasRequiredCode = 1;
|
|
34444
35041
|
Object.defineProperty(code, "__esModule", { value: true });
|
|
34445
35042
|
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;
|
|
34446
|
-
const codegen_1 = requireCodegen();
|
|
34447
|
-
const util_1 = requireUtil();
|
|
34448
|
-
const names_1 = requireNames();
|
|
34449
|
-
const util_2 = requireUtil();
|
|
35043
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
35044
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
35045
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
35046
|
+
const util_2 = /* @__PURE__ */ requireUtil();
|
|
34450
35047
|
function checkReportMissingProp(cxt, prop) {
|
|
34451
35048
|
const { gen, data, it } = cxt;
|
|
34452
35049
|
gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
|
|
@@ -34575,10 +35172,10 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
34575
35172
|
hasRequiredKeyword = 1;
|
|
34576
35173
|
Object.defineProperty(keyword, "__esModule", { value: true });
|
|
34577
35174
|
keyword.validateKeywordUsage = keyword.validSchemaType = keyword.funcKeywordCode = keyword.macroKeywordCode = void 0;
|
|
34578
|
-
const codegen_1 = requireCodegen();
|
|
34579
|
-
const names_1 = requireNames();
|
|
34580
|
-
const code_1 = requireCode();
|
|
34581
|
-
const errors_1 = requireErrors();
|
|
35175
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
35176
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
35177
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
35178
|
+
const errors_1 = /* @__PURE__ */ requireErrors();
|
|
34582
35179
|
function macroKeywordCode(cxt, def) {
|
|
34583
35180
|
const { gen, keyword: keyword2, schema, parentSchema, it } = cxt;
|
|
34584
35181
|
const macroSchema = def.macro.call(it.self, schema, parentSchema, it);
|
|
@@ -34693,8 +35290,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
34693
35290
|
hasRequiredSubschema = 1;
|
|
34694
35291
|
Object.defineProperty(subschema, "__esModule", { value: true });
|
|
34695
35292
|
subschema.extendSubschemaMode = subschema.extendSubschemaData = subschema.getSubschema = void 0;
|
|
34696
|
-
const codegen_1 = requireCodegen();
|
|
34697
|
-
const util_1 = requireUtil();
|
|
35293
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
35294
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
34698
35295
|
function getSubschema(it, { keyword: keyword2, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {
|
|
34699
35296
|
if (keyword2 !== void 0 && schema !== void 0) {
|
|
34700
35297
|
throw new Error('both "keyword" and "schema" passed, only one allowed');
|
|
@@ -34899,7 +35496,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
34899
35496
|
hasRequiredResolve = 1;
|
|
34900
35497
|
Object.defineProperty(resolve, "__esModule", { value: true });
|
|
34901
35498
|
resolve.getSchemaRefs = resolve.resolveUrl = resolve.normalizeId = resolve._getFullPath = resolve.getFullPath = resolve.inlineRef = void 0;
|
|
34902
|
-
const util_1 = requireUtil();
|
|
35499
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
34903
35500
|
const equal2 = requireFastDeepEqual();
|
|
34904
35501
|
const traverse = requireJsonSchemaTraverse();
|
|
34905
35502
|
const SIMPLE_INLINED = /* @__PURE__ */ new Set([
|
|
@@ -35054,18 +35651,18 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
35054
35651
|
hasRequiredValidate = 1;
|
|
35055
35652
|
Object.defineProperty(validate, "__esModule", { value: true });
|
|
35056
35653
|
validate.getData = validate.KeywordCxt = validate.validateFunctionCode = void 0;
|
|
35057
|
-
const boolSchema_1 = requireBoolSchema();
|
|
35058
|
-
const dataType_1 = requireDataType();
|
|
35059
|
-
const applicability_1 = requireApplicability();
|
|
35060
|
-
const dataType_2 = requireDataType();
|
|
35061
|
-
const defaults_1 = requireDefaults();
|
|
35062
|
-
const keyword_1 = requireKeyword();
|
|
35063
|
-
const subschema_1 = requireSubschema();
|
|
35064
|
-
const codegen_1 = requireCodegen();
|
|
35065
|
-
const names_1 = requireNames();
|
|
35066
|
-
const resolve_1 = requireResolve();
|
|
35067
|
-
const util_1 = requireUtil();
|
|
35068
|
-
const errors_1 = requireErrors();
|
|
35654
|
+
const boolSchema_1 = /* @__PURE__ */ requireBoolSchema();
|
|
35655
|
+
const dataType_1 = /* @__PURE__ */ requireDataType();
|
|
35656
|
+
const applicability_1 = /* @__PURE__ */ requireApplicability();
|
|
35657
|
+
const dataType_2 = /* @__PURE__ */ requireDataType();
|
|
35658
|
+
const defaults_1 = /* @__PURE__ */ requireDefaults();
|
|
35659
|
+
const keyword_1 = /* @__PURE__ */ requireKeyword();
|
|
35660
|
+
const subschema_1 = /* @__PURE__ */ requireSubschema();
|
|
35661
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
35662
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
35663
|
+
const resolve_1 = /* @__PURE__ */ requireResolve();
|
|
35664
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
35665
|
+
const errors_1 = /* @__PURE__ */ requireErrors();
|
|
35069
35666
|
function validateFunctionCode(it) {
|
|
35070
35667
|
if (isSchemaObj(it)) {
|
|
35071
35668
|
checkKeywords(it);
|
|
@@ -35576,7 +36173,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
35576
36173
|
if (hasRequiredRef_error) return ref_error;
|
|
35577
36174
|
hasRequiredRef_error = 1;
|
|
35578
36175
|
Object.defineProperty(ref_error, "__esModule", { value: true });
|
|
35579
|
-
const resolve_1 = requireResolve();
|
|
36176
|
+
const resolve_1 = /* @__PURE__ */ requireResolve();
|
|
35580
36177
|
class MissingRefError extends Error {
|
|
35581
36178
|
constructor(resolver, baseId, ref2, msg) {
|
|
35582
36179
|
super(msg || `can't resolve reference ${ref2} from id ${baseId}`);
|
|
@@ -35594,12 +36191,12 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
35594
36191
|
hasRequiredCompile = 1;
|
|
35595
36192
|
Object.defineProperty(compile, "__esModule", { value: true });
|
|
35596
36193
|
compile.resolveSchema = compile.getCompilingSchema = compile.resolveRef = compile.compileSchema = compile.SchemaEnv = void 0;
|
|
35597
|
-
const codegen_1 = requireCodegen();
|
|
35598
|
-
const validation_error_1 = requireValidation_error();
|
|
35599
|
-
const names_1 = requireNames();
|
|
35600
|
-
const resolve_1 = requireResolve();
|
|
35601
|
-
const util_1 = requireUtil();
|
|
35602
|
-
const validate_1 = requireValidate();
|
|
36194
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
36195
|
+
const validation_error_1 = /* @__PURE__ */ requireValidation_error();
|
|
36196
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
36197
|
+
const resolve_1 = /* @__PURE__ */ requireResolve();
|
|
36198
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
36199
|
+
const validate_1 = /* @__PURE__ */ requireValidate();
|
|
35603
36200
|
class SchemaEnv {
|
|
35604
36201
|
constructor(env) {
|
|
35605
36202
|
var _a10;
|
|
@@ -36565,11 +37162,11 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
36565
37162
|
(function(exports3) {
|
|
36566
37163
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
36567
37164
|
exports3.CodeGen = exports3.Name = exports3.nil = exports3.stringify = exports3.str = exports3._ = exports3.KeywordCxt = void 0;
|
|
36568
|
-
var validate_1 = requireValidate();
|
|
37165
|
+
var validate_1 = /* @__PURE__ */ requireValidate();
|
|
36569
37166
|
Object.defineProperty(exports3, "KeywordCxt", { enumerable: true, get: function() {
|
|
36570
37167
|
return validate_1.KeywordCxt;
|
|
36571
37168
|
} });
|
|
36572
|
-
var codegen_1 = requireCodegen();
|
|
37169
|
+
var codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
36573
37170
|
Object.defineProperty(exports3, "_", { enumerable: true, get: function() {
|
|
36574
37171
|
return codegen_1._;
|
|
36575
37172
|
} });
|
|
@@ -36588,16 +37185,16 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
36588
37185
|
Object.defineProperty(exports3, "CodeGen", { enumerable: true, get: function() {
|
|
36589
37186
|
return codegen_1.CodeGen;
|
|
36590
37187
|
} });
|
|
36591
|
-
const validation_error_1 = requireValidation_error();
|
|
36592
|
-
const ref_error_1 = requireRef_error();
|
|
36593
|
-
const rules_1 = requireRules();
|
|
36594
|
-
const compile_1 = requireCompile();
|
|
36595
|
-
const codegen_2 = requireCodegen();
|
|
36596
|
-
const resolve_1 = requireResolve();
|
|
36597
|
-
const dataType_1 = requireDataType();
|
|
36598
|
-
const util_1 = requireUtil();
|
|
37188
|
+
const validation_error_1 = /* @__PURE__ */ requireValidation_error();
|
|
37189
|
+
const ref_error_1 = /* @__PURE__ */ requireRef_error();
|
|
37190
|
+
const rules_1 = /* @__PURE__ */ requireRules();
|
|
37191
|
+
const compile_1 = /* @__PURE__ */ requireCompile();
|
|
37192
|
+
const codegen_2 = /* @__PURE__ */ requireCodegen();
|
|
37193
|
+
const resolve_1 = /* @__PURE__ */ requireResolve();
|
|
37194
|
+
const dataType_1 = /* @__PURE__ */ requireDataType();
|
|
37195
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
36599
37196
|
const $dataRefSchema = require$$9;
|
|
36600
|
-
const uri_1 = requireUri();
|
|
37197
|
+
const uri_1 = /* @__PURE__ */ requireUri();
|
|
36601
37198
|
const defaultRegExp = (str, flags) => new RegExp(str, flags);
|
|
36602
37199
|
defaultRegExp.code = "new RegExp";
|
|
36603
37200
|
const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
|
|
@@ -37194,12 +37791,12 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37194
37791
|
hasRequiredRef = 1;
|
|
37195
37792
|
Object.defineProperty(ref, "__esModule", { value: true });
|
|
37196
37793
|
ref.callRef = ref.getValidate = void 0;
|
|
37197
|
-
const ref_error_1 = requireRef_error();
|
|
37198
|
-
const code_1 = requireCode();
|
|
37199
|
-
const codegen_1 = requireCodegen();
|
|
37200
|
-
const names_1 = requireNames();
|
|
37201
|
-
const compile_1 = requireCompile();
|
|
37202
|
-
const util_1 = requireUtil();
|
|
37794
|
+
const ref_error_1 = /* @__PURE__ */ requireRef_error();
|
|
37795
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
37796
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37797
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
37798
|
+
const compile_1 = /* @__PURE__ */ requireCompile();
|
|
37799
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37203
37800
|
const def = {
|
|
37204
37801
|
keyword: "$ref",
|
|
37205
37802
|
schemaType: "string",
|
|
@@ -37314,8 +37911,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37314
37911
|
if (hasRequiredCore) return core;
|
|
37315
37912
|
hasRequiredCore = 1;
|
|
37316
37913
|
Object.defineProperty(core, "__esModule", { value: true });
|
|
37317
|
-
const id_1 = requireId();
|
|
37318
|
-
const ref_1 = requireRef();
|
|
37914
|
+
const id_1 = /* @__PURE__ */ requireId();
|
|
37915
|
+
const ref_1 = /* @__PURE__ */ requireRef();
|
|
37319
37916
|
const core$12 = [
|
|
37320
37917
|
"$schema",
|
|
37321
37918
|
"$id",
|
|
@@ -37336,7 +37933,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37336
37933
|
if (hasRequiredLimitNumber) return limitNumber;
|
|
37337
37934
|
hasRequiredLimitNumber = 1;
|
|
37338
37935
|
Object.defineProperty(limitNumber, "__esModule", { value: true });
|
|
37339
|
-
const codegen_1 = requireCodegen();
|
|
37936
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37340
37937
|
const ops = codegen_1.operators;
|
|
37341
37938
|
const KWDs = {
|
|
37342
37939
|
maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
|
|
@@ -37368,7 +37965,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37368
37965
|
if (hasRequiredMultipleOf) return multipleOf;
|
|
37369
37966
|
hasRequiredMultipleOf = 1;
|
|
37370
37967
|
Object.defineProperty(multipleOf, "__esModule", { value: true });
|
|
37371
|
-
const codegen_1 = requireCodegen();
|
|
37968
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37372
37969
|
const error = {
|
|
37373
37970
|
message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
|
|
37374
37971
|
params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`
|
|
@@ -37422,9 +38019,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37422
38019
|
if (hasRequiredLimitLength) return limitLength;
|
|
37423
38020
|
hasRequiredLimitLength = 1;
|
|
37424
38021
|
Object.defineProperty(limitLength, "__esModule", { value: true });
|
|
37425
|
-
const codegen_1 = requireCodegen();
|
|
37426
|
-
const util_1 = requireUtil();
|
|
37427
|
-
const ucs2length_1 = requireUcs2length();
|
|
38022
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38023
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38024
|
+
const ucs2length_1 = /* @__PURE__ */ requireUcs2length();
|
|
37428
38025
|
const error = {
|
|
37429
38026
|
message({ keyword: keyword2, schemaCode }) {
|
|
37430
38027
|
const comp = keyword2 === "maxLength" ? "more" : "fewer";
|
|
@@ -37454,8 +38051,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37454
38051
|
if (hasRequiredPattern) return pattern;
|
|
37455
38052
|
hasRequiredPattern = 1;
|
|
37456
38053
|
Object.defineProperty(pattern, "__esModule", { value: true });
|
|
37457
|
-
const code_1 = requireCode();
|
|
37458
|
-
const
|
|
38054
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38055
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38056
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37459
38057
|
const error = {
|
|
37460
38058
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
37461
38059
|
params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`
|
|
@@ -37467,10 +38065,18 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37467
38065
|
$data: true,
|
|
37468
38066
|
error,
|
|
37469
38067
|
code(cxt) {
|
|
37470
|
-
const { data, $data, schema, schemaCode, it } = cxt;
|
|
38068
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
37471
38069
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
37472
|
-
|
|
37473
|
-
|
|
38070
|
+
if ($data) {
|
|
38071
|
+
const { regExp } = it.opts.code;
|
|
38072
|
+
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
38073
|
+
const valid = gen.let("valid");
|
|
38074
|
+
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
38075
|
+
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
38076
|
+
} else {
|
|
38077
|
+
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
38078
|
+
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
38079
|
+
}
|
|
37474
38080
|
}
|
|
37475
38081
|
};
|
|
37476
38082
|
pattern.default = def;
|
|
@@ -37482,7 +38088,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37482
38088
|
if (hasRequiredLimitProperties) return limitProperties;
|
|
37483
38089
|
hasRequiredLimitProperties = 1;
|
|
37484
38090
|
Object.defineProperty(limitProperties, "__esModule", { value: true });
|
|
37485
|
-
const codegen_1 = requireCodegen();
|
|
38091
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37486
38092
|
const error = {
|
|
37487
38093
|
message({ keyword: keyword2, schemaCode }) {
|
|
37488
38094
|
const comp = keyword2 === "maxProperties" ? "more" : "fewer";
|
|
@@ -37511,9 +38117,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37511
38117
|
if (hasRequiredRequired) return required;
|
|
37512
38118
|
hasRequiredRequired = 1;
|
|
37513
38119
|
Object.defineProperty(required, "__esModule", { value: true });
|
|
37514
|
-
const code_1 = requireCode();
|
|
37515
|
-
const codegen_1 = requireCodegen();
|
|
37516
|
-
const util_1 = requireUtil();
|
|
38120
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38121
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38122
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37517
38123
|
const error = {
|
|
37518
38124
|
message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
|
|
37519
38125
|
params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`
|
|
@@ -37593,7 +38199,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37593
38199
|
if (hasRequiredLimitItems) return limitItems;
|
|
37594
38200
|
hasRequiredLimitItems = 1;
|
|
37595
38201
|
Object.defineProperty(limitItems, "__esModule", { value: true });
|
|
37596
|
-
const codegen_1 = requireCodegen();
|
|
38202
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
37597
38203
|
const error = {
|
|
37598
38204
|
message({ keyword: keyword2, schemaCode }) {
|
|
37599
38205
|
const comp = keyword2 === "maxItems" ? "more" : "fewer";
|
|
@@ -37633,10 +38239,10 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37633
38239
|
if (hasRequiredUniqueItems) return uniqueItems;
|
|
37634
38240
|
hasRequiredUniqueItems = 1;
|
|
37635
38241
|
Object.defineProperty(uniqueItems, "__esModule", { value: true });
|
|
37636
|
-
const dataType_1 = requireDataType();
|
|
37637
|
-
const codegen_1 = requireCodegen();
|
|
37638
|
-
const util_1 = requireUtil();
|
|
37639
|
-
const equal_1 = requireEqual();
|
|
38242
|
+
const dataType_1 = /* @__PURE__ */ requireDataType();
|
|
38243
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38244
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38245
|
+
const equal_1 = /* @__PURE__ */ requireEqual();
|
|
37640
38246
|
const error = {
|
|
37641
38247
|
message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
|
|
37642
38248
|
params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
|
|
@@ -37700,9 +38306,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37700
38306
|
if (hasRequired_const) return _const;
|
|
37701
38307
|
hasRequired_const = 1;
|
|
37702
38308
|
Object.defineProperty(_const, "__esModule", { value: true });
|
|
37703
|
-
const codegen_1 = requireCodegen();
|
|
37704
|
-
const util_1 = requireUtil();
|
|
37705
|
-
const equal_1 = requireEqual();
|
|
38309
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38310
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38311
|
+
const equal_1 = /* @__PURE__ */ requireEqual();
|
|
37706
38312
|
const error = {
|
|
37707
38313
|
message: "must be equal to constant",
|
|
37708
38314
|
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`
|
|
@@ -37729,9 +38335,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37729
38335
|
if (hasRequired_enum) return _enum;
|
|
37730
38336
|
hasRequired_enum = 1;
|
|
37731
38337
|
Object.defineProperty(_enum, "__esModule", { value: true });
|
|
37732
|
-
const codegen_1 = requireCodegen();
|
|
37733
|
-
const util_1 = requireUtil();
|
|
37734
|
-
const equal_1 = requireEqual();
|
|
38338
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38339
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38340
|
+
const equal_1 = /* @__PURE__ */ requireEqual();
|
|
37735
38341
|
const error = {
|
|
37736
38342
|
message: "must be equal to one of the allowed values",
|
|
37737
38343
|
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`
|
|
@@ -37777,16 +38383,16 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37777
38383
|
if (hasRequiredValidation) return validation;
|
|
37778
38384
|
hasRequiredValidation = 1;
|
|
37779
38385
|
Object.defineProperty(validation, "__esModule", { value: true });
|
|
37780
|
-
const limitNumber_1 = requireLimitNumber();
|
|
37781
|
-
const multipleOf_1 = requireMultipleOf();
|
|
37782
|
-
const limitLength_1 = requireLimitLength();
|
|
37783
|
-
const pattern_1 = requirePattern();
|
|
37784
|
-
const limitProperties_1 = requireLimitProperties();
|
|
37785
|
-
const required_1 = requireRequired();
|
|
37786
|
-
const limitItems_1 = requireLimitItems();
|
|
37787
|
-
const uniqueItems_1 = requireUniqueItems();
|
|
37788
|
-
const const_1 = require_const();
|
|
37789
|
-
const enum_1 = require_enum();
|
|
38386
|
+
const limitNumber_1 = /* @__PURE__ */ requireLimitNumber();
|
|
38387
|
+
const multipleOf_1 = /* @__PURE__ */ requireMultipleOf();
|
|
38388
|
+
const limitLength_1 = /* @__PURE__ */ requireLimitLength();
|
|
38389
|
+
const pattern_1 = /* @__PURE__ */ requirePattern();
|
|
38390
|
+
const limitProperties_1 = /* @__PURE__ */ requireLimitProperties();
|
|
38391
|
+
const required_1 = /* @__PURE__ */ requireRequired();
|
|
38392
|
+
const limitItems_1 = /* @__PURE__ */ requireLimitItems();
|
|
38393
|
+
const uniqueItems_1 = /* @__PURE__ */ requireUniqueItems();
|
|
38394
|
+
const const_1 = /* @__PURE__ */ require_const();
|
|
38395
|
+
const enum_1 = /* @__PURE__ */ require_enum();
|
|
37790
38396
|
const validation$1 = [
|
|
37791
38397
|
// number
|
|
37792
38398
|
limitNumber_1.default,
|
|
@@ -37817,8 +38423,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37817
38423
|
hasRequiredAdditionalItems = 1;
|
|
37818
38424
|
Object.defineProperty(additionalItems, "__esModule", { value: true });
|
|
37819
38425
|
additionalItems.validateAdditionalItems = void 0;
|
|
37820
|
-
const codegen_1 = requireCodegen();
|
|
37821
|
-
const util_1 = requireUtil();
|
|
38426
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38427
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37822
38428
|
const error = {
|
|
37823
38429
|
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
37824
38430
|
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
@@ -37871,9 +38477,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37871
38477
|
hasRequiredItems = 1;
|
|
37872
38478
|
Object.defineProperty(items, "__esModule", { value: true });
|
|
37873
38479
|
items.validateTuple = void 0;
|
|
37874
|
-
const codegen_1 = requireCodegen();
|
|
37875
|
-
const util_1 = requireUtil();
|
|
37876
|
-
const code_1 = requireCode();
|
|
38480
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38481
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38482
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
37877
38483
|
const def = {
|
|
37878
38484
|
keyword: "items",
|
|
37879
38485
|
type: "array",
|
|
@@ -37926,7 +38532,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37926
38532
|
if (hasRequiredPrefixItems) return prefixItems;
|
|
37927
38533
|
hasRequiredPrefixItems = 1;
|
|
37928
38534
|
Object.defineProperty(prefixItems, "__esModule", { value: true });
|
|
37929
|
-
const items_1 = requireItems();
|
|
38535
|
+
const items_1 = /* @__PURE__ */ requireItems();
|
|
37930
38536
|
const def = {
|
|
37931
38537
|
keyword: "prefixItems",
|
|
37932
38538
|
type: "array",
|
|
@@ -37943,10 +38549,10 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37943
38549
|
if (hasRequiredItems2020) return items2020;
|
|
37944
38550
|
hasRequiredItems2020 = 1;
|
|
37945
38551
|
Object.defineProperty(items2020, "__esModule", { value: true });
|
|
37946
|
-
const codegen_1 = requireCodegen();
|
|
37947
|
-
const util_1 = requireUtil();
|
|
37948
|
-
const code_1 = requireCode();
|
|
37949
|
-
const additionalItems_1 = requireAdditionalItems();
|
|
38552
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38553
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38554
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38555
|
+
const additionalItems_1 = /* @__PURE__ */ requireAdditionalItems();
|
|
37950
38556
|
const error = {
|
|
37951
38557
|
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
37952
38558
|
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
@@ -37978,8 +38584,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
37978
38584
|
if (hasRequiredContains) return contains;
|
|
37979
38585
|
hasRequiredContains = 1;
|
|
37980
38586
|
Object.defineProperty(contains, "__esModule", { value: true });
|
|
37981
|
-
const codegen_1 = requireCodegen();
|
|
37982
|
-
const util_1 = requireUtil();
|
|
38587
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38588
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
37983
38589
|
const error = {
|
|
37984
38590
|
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)`,
|
|
37985
38591
|
params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`
|
|
@@ -38074,9 +38680,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38074
38680
|
(function(exports3) {
|
|
38075
38681
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
38076
38682
|
exports3.validateSchemaDeps = exports3.validatePropertyDeps = exports3.error = void 0;
|
|
38077
|
-
const codegen_1 = requireCodegen();
|
|
38078
|
-
const util_1 = requireUtil();
|
|
38079
|
-
const code_1 = requireCode();
|
|
38683
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38684
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38685
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38080
38686
|
exports3.error = {
|
|
38081
38687
|
message: ({ params: { property, depsCount, deps } }) => {
|
|
38082
38688
|
const property_ies = depsCount === 1 ? "property" : "properties";
|
|
@@ -38168,8 +38774,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38168
38774
|
if (hasRequiredPropertyNames) return propertyNames;
|
|
38169
38775
|
hasRequiredPropertyNames = 1;
|
|
38170
38776
|
Object.defineProperty(propertyNames, "__esModule", { value: true });
|
|
38171
|
-
const codegen_1 = requireCodegen();
|
|
38172
|
-
const util_1 = requireUtil();
|
|
38777
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38778
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38173
38779
|
const error = {
|
|
38174
38780
|
message: "property name must be valid",
|
|
38175
38781
|
params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`
|
|
@@ -38211,10 +38817,10 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38211
38817
|
if (hasRequiredAdditionalProperties) return additionalProperties;
|
|
38212
38818
|
hasRequiredAdditionalProperties = 1;
|
|
38213
38819
|
Object.defineProperty(additionalProperties, "__esModule", { value: true });
|
|
38214
|
-
const code_1 = requireCode();
|
|
38215
|
-
const codegen_1 = requireCodegen();
|
|
38216
|
-
const names_1 = requireNames();
|
|
38217
|
-
const util_1 = requireUtil();
|
|
38820
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38821
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38822
|
+
const names_1 = /* @__PURE__ */ requireNames();
|
|
38823
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38218
38824
|
const error = {
|
|
38219
38825
|
message: "must NOT have additional properties",
|
|
38220
38826
|
params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`
|
|
@@ -38317,10 +38923,10 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38317
38923
|
if (hasRequiredProperties) return properties$1;
|
|
38318
38924
|
hasRequiredProperties = 1;
|
|
38319
38925
|
Object.defineProperty(properties$1, "__esModule", { value: true });
|
|
38320
|
-
const validate_1 = requireValidate();
|
|
38321
|
-
const code_1 = requireCode();
|
|
38322
|
-
const util_1 = requireUtil();
|
|
38323
|
-
const additionalProperties_1 = requireAdditionalProperties();
|
|
38926
|
+
const validate_1 = /* @__PURE__ */ requireValidate();
|
|
38927
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38928
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38929
|
+
const additionalProperties_1 = /* @__PURE__ */ requireAdditionalProperties();
|
|
38324
38930
|
const def = {
|
|
38325
38931
|
keyword: "properties",
|
|
38326
38932
|
type: "object",
|
|
@@ -38375,10 +38981,10 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38375
38981
|
if (hasRequiredPatternProperties) return patternProperties;
|
|
38376
38982
|
hasRequiredPatternProperties = 1;
|
|
38377
38983
|
Object.defineProperty(patternProperties, "__esModule", { value: true });
|
|
38378
|
-
const code_1 = requireCode();
|
|
38379
|
-
const codegen_1 = requireCodegen();
|
|
38380
|
-
const util_1 = requireUtil();
|
|
38381
|
-
const util_2 = requireUtil();
|
|
38984
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38985
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38986
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38987
|
+
const util_2 = /* @__PURE__ */ requireUtil();
|
|
38382
38988
|
const def = {
|
|
38383
38989
|
keyword: "patternProperties",
|
|
38384
38990
|
type: "object",
|
|
@@ -38449,7 +39055,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38449
39055
|
if (hasRequiredNot) return not;
|
|
38450
39056
|
hasRequiredNot = 1;
|
|
38451
39057
|
Object.defineProperty(not, "__esModule", { value: true });
|
|
38452
|
-
const util_1 = requireUtil();
|
|
39058
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38453
39059
|
const def = {
|
|
38454
39060
|
keyword: "not",
|
|
38455
39061
|
schemaType: ["object", "boolean"],
|
|
@@ -38480,7 +39086,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38480
39086
|
if (hasRequiredAnyOf) return anyOf;
|
|
38481
39087
|
hasRequiredAnyOf = 1;
|
|
38482
39088
|
Object.defineProperty(anyOf, "__esModule", { value: true });
|
|
38483
|
-
const code_1 = requireCode();
|
|
39089
|
+
const code_1 = /* @__PURE__ */ requireCode();
|
|
38484
39090
|
const def = {
|
|
38485
39091
|
keyword: "anyOf",
|
|
38486
39092
|
schemaType: "array",
|
|
@@ -38497,8 +39103,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38497
39103
|
if (hasRequiredOneOf) return oneOf;
|
|
38498
39104
|
hasRequiredOneOf = 1;
|
|
38499
39105
|
Object.defineProperty(oneOf, "__esModule", { value: true });
|
|
38500
|
-
const codegen_1 = requireCodegen();
|
|
38501
|
-
const util_1 = requireUtil();
|
|
39106
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
39107
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38502
39108
|
const error = {
|
|
38503
39109
|
message: "must match exactly one schema in oneOf",
|
|
38504
39110
|
params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`
|
|
@@ -38555,7 +39161,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38555
39161
|
if (hasRequiredAllOf) return allOf;
|
|
38556
39162
|
hasRequiredAllOf = 1;
|
|
38557
39163
|
Object.defineProperty(allOf, "__esModule", { value: true });
|
|
38558
|
-
const util_1 = requireUtil();
|
|
39164
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38559
39165
|
const def = {
|
|
38560
39166
|
keyword: "allOf",
|
|
38561
39167
|
schemaType: "array",
|
|
@@ -38582,8 +39188,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38582
39188
|
if (hasRequired_if) return _if;
|
|
38583
39189
|
hasRequired_if = 1;
|
|
38584
39190
|
Object.defineProperty(_if, "__esModule", { value: true });
|
|
38585
|
-
const codegen_1 = requireCodegen();
|
|
38586
|
-
const util_1 = requireUtil();
|
|
39191
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
39192
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38587
39193
|
const error = {
|
|
38588
39194
|
message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`,
|
|
38589
39195
|
params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`
|
|
@@ -38651,7 +39257,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38651
39257
|
if (hasRequiredThenElse) return thenElse;
|
|
38652
39258
|
hasRequiredThenElse = 1;
|
|
38653
39259
|
Object.defineProperty(thenElse, "__esModule", { value: true });
|
|
38654
|
-
const util_1 = requireUtil();
|
|
39260
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38655
39261
|
const def = {
|
|
38656
39262
|
keyword: ["then", "else"],
|
|
38657
39263
|
schemaType: ["object", "boolean"],
|
|
@@ -38668,22 +39274,22 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38668
39274
|
if (hasRequiredApplicator) return applicator;
|
|
38669
39275
|
hasRequiredApplicator = 1;
|
|
38670
39276
|
Object.defineProperty(applicator, "__esModule", { value: true });
|
|
38671
|
-
const additionalItems_1 = requireAdditionalItems();
|
|
38672
|
-
const prefixItems_1 = requirePrefixItems();
|
|
38673
|
-
const items_1 = requireItems();
|
|
38674
|
-
const items2020_1 = requireItems2020();
|
|
38675
|
-
const contains_1 = requireContains();
|
|
38676
|
-
const dependencies_1 = requireDependencies();
|
|
38677
|
-
const propertyNames_1 = requirePropertyNames();
|
|
38678
|
-
const additionalProperties_1 = requireAdditionalProperties();
|
|
38679
|
-
const properties_1 = requireProperties();
|
|
38680
|
-
const patternProperties_1 = requirePatternProperties();
|
|
38681
|
-
const not_1 = requireNot();
|
|
38682
|
-
const anyOf_1 = requireAnyOf();
|
|
38683
|
-
const oneOf_1 = requireOneOf();
|
|
38684
|
-
const allOf_1 = requireAllOf();
|
|
38685
|
-
const if_1 = require_if();
|
|
38686
|
-
const thenElse_1 = requireThenElse();
|
|
39277
|
+
const additionalItems_1 = /* @__PURE__ */ requireAdditionalItems();
|
|
39278
|
+
const prefixItems_1 = /* @__PURE__ */ requirePrefixItems();
|
|
39279
|
+
const items_1 = /* @__PURE__ */ requireItems();
|
|
39280
|
+
const items2020_1 = /* @__PURE__ */ requireItems2020();
|
|
39281
|
+
const contains_1 = /* @__PURE__ */ requireContains();
|
|
39282
|
+
const dependencies_1 = /* @__PURE__ */ requireDependencies();
|
|
39283
|
+
const propertyNames_1 = /* @__PURE__ */ requirePropertyNames();
|
|
39284
|
+
const additionalProperties_1 = /* @__PURE__ */ requireAdditionalProperties();
|
|
39285
|
+
const properties_1 = /* @__PURE__ */ requireProperties();
|
|
39286
|
+
const patternProperties_1 = /* @__PURE__ */ requirePatternProperties();
|
|
39287
|
+
const not_1 = /* @__PURE__ */ requireNot();
|
|
39288
|
+
const anyOf_1 = /* @__PURE__ */ requireAnyOf();
|
|
39289
|
+
const oneOf_1 = /* @__PURE__ */ requireOneOf();
|
|
39290
|
+
const allOf_1 = /* @__PURE__ */ requireAllOf();
|
|
39291
|
+
const if_1 = /* @__PURE__ */ require_if();
|
|
39292
|
+
const thenElse_1 = /* @__PURE__ */ requireThenElse();
|
|
38687
39293
|
function getApplicator(draft2020 = false) {
|
|
38688
39294
|
const applicator2 = [
|
|
38689
39295
|
// any
|
|
@@ -38717,7 +39323,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38717
39323
|
if (hasRequiredFormat$1) return format;
|
|
38718
39324
|
hasRequiredFormat$1 = 1;
|
|
38719
39325
|
Object.defineProperty(format, "__esModule", { value: true });
|
|
38720
|
-
const codegen_1 = requireCodegen();
|
|
39326
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
38721
39327
|
const error = {
|
|
38722
39328
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
|
|
38723
39329
|
params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
|
|
@@ -38806,7 +39412,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38806
39412
|
if (hasRequiredFormat) return format$1;
|
|
38807
39413
|
hasRequiredFormat = 1;
|
|
38808
39414
|
Object.defineProperty(format$1, "__esModule", { value: true });
|
|
38809
|
-
const format_1 = requireFormat$1();
|
|
39415
|
+
const format_1 = /* @__PURE__ */ requireFormat$1();
|
|
38810
39416
|
const format2 = [format_1.default];
|
|
38811
39417
|
format$1.default = format2;
|
|
38812
39418
|
return format$1;
|
|
@@ -38839,11 +39445,11 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38839
39445
|
if (hasRequiredDraft7) return draft7;
|
|
38840
39446
|
hasRequiredDraft7 = 1;
|
|
38841
39447
|
Object.defineProperty(draft7, "__esModule", { value: true });
|
|
38842
|
-
const core_1 = requireCore();
|
|
38843
|
-
const validation_1 = requireValidation();
|
|
38844
|
-
const applicator_1 = requireApplicator();
|
|
38845
|
-
const format_1 = requireFormat();
|
|
38846
|
-
const metadata_1 = requireMetadata();
|
|
39448
|
+
const core_1 = /* @__PURE__ */ requireCore();
|
|
39449
|
+
const validation_1 = /* @__PURE__ */ requireValidation();
|
|
39450
|
+
const applicator_1 = /* @__PURE__ */ requireApplicator();
|
|
39451
|
+
const format_1 = /* @__PURE__ */ requireFormat();
|
|
39452
|
+
const metadata_1 = /* @__PURE__ */ requireMetadata();
|
|
38847
39453
|
const draft7Vocabularies = [
|
|
38848
39454
|
core_1.default,
|
|
38849
39455
|
validation_1.default,
|
|
@@ -38875,11 +39481,11 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38875
39481
|
if (hasRequiredDiscriminator) return discriminator;
|
|
38876
39482
|
hasRequiredDiscriminator = 1;
|
|
38877
39483
|
Object.defineProperty(discriminator, "__esModule", { value: true });
|
|
38878
|
-
const codegen_1 = requireCodegen();
|
|
38879
|
-
const types_1 = requireTypes();
|
|
38880
|
-
const compile_1 = requireCompile();
|
|
38881
|
-
const ref_error_1 = requireRef_error();
|
|
38882
|
-
const util_1 = requireUtil();
|
|
39484
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
39485
|
+
const types_1 = /* @__PURE__ */ requireTypes();
|
|
39486
|
+
const compile_1 = /* @__PURE__ */ requireCompile();
|
|
39487
|
+
const ref_error_1 = /* @__PURE__ */ requireRef_error();
|
|
39488
|
+
const util_1 = /* @__PURE__ */ requireUtil();
|
|
38883
39489
|
const error = {
|
|
38884
39490
|
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
|
|
38885
39491
|
params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
|
|
@@ -38996,9 +39602,9 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
38996
39602
|
(function(module2, exports3) {
|
|
38997
39603
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
38998
39604
|
exports3.MissingRefError = exports3.ValidationError = exports3.CodeGen = exports3.Name = exports3.nil = exports3.stringify = exports3.str = exports3._ = exports3.KeywordCxt = exports3.Ajv = void 0;
|
|
38999
|
-
const core_1 = requireCore$1();
|
|
39000
|
-
const draft7_1 = requireDraft7();
|
|
39001
|
-
const discriminator_1 = requireDiscriminator();
|
|
39605
|
+
const core_1 = /* @__PURE__ */ requireCore$1();
|
|
39606
|
+
const draft7_1 = /* @__PURE__ */ requireDraft7();
|
|
39607
|
+
const discriminator_1 = /* @__PURE__ */ requireDiscriminator();
|
|
39002
39608
|
const draft7MetaSchema = require$$3;
|
|
39003
39609
|
const META_SUPPORT_DATA = ["/properties"];
|
|
39004
39610
|
const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
|
|
@@ -39026,11 +39632,11 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
39026
39632
|
module2.exports.Ajv = Ajv2;
|
|
39027
39633
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
39028
39634
|
exports3.default = Ajv2;
|
|
39029
|
-
var validate_1 = requireValidate();
|
|
39635
|
+
var validate_1 = /* @__PURE__ */ requireValidate();
|
|
39030
39636
|
Object.defineProperty(exports3, "KeywordCxt", { enumerable: true, get: function() {
|
|
39031
39637
|
return validate_1.KeywordCxt;
|
|
39032
39638
|
} });
|
|
39033
|
-
var codegen_1 = requireCodegen();
|
|
39639
|
+
var codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
39034
39640
|
Object.defineProperty(exports3, "_", { enumerable: true, get: function() {
|
|
39035
39641
|
return codegen_1._;
|
|
39036
39642
|
} });
|
|
@@ -39049,18 +39655,18 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
39049
39655
|
Object.defineProperty(exports3, "CodeGen", { enumerable: true, get: function() {
|
|
39050
39656
|
return codegen_1.CodeGen;
|
|
39051
39657
|
} });
|
|
39052
|
-
var validation_error_1 = requireValidation_error();
|
|
39658
|
+
var validation_error_1 = /* @__PURE__ */ requireValidation_error();
|
|
39053
39659
|
Object.defineProperty(exports3, "ValidationError", { enumerable: true, get: function() {
|
|
39054
39660
|
return validation_error_1.default;
|
|
39055
39661
|
} });
|
|
39056
|
-
var ref_error_1 = requireRef_error();
|
|
39662
|
+
var ref_error_1 = /* @__PURE__ */ requireRef_error();
|
|
39057
39663
|
Object.defineProperty(exports3, "MissingRefError", { enumerable: true, get: function() {
|
|
39058
39664
|
return ref_error_1.default;
|
|
39059
39665
|
} });
|
|
39060
39666
|
})(ajv, ajv.exports);
|
|
39061
39667
|
return ajv.exports;
|
|
39062
39668
|
}
|
|
39063
|
-
var ajvExports = requireAjv();
|
|
39669
|
+
var ajvExports = /* @__PURE__ */ requireAjv();
|
|
39064
39670
|
const Ajv = /* @__PURE__ */ getDefaultExportFromCjs(ajvExports);
|
|
39065
39671
|
var dist = { exports: {} };
|
|
39066
39672
|
var formats = {};
|
|
@@ -39276,8 +39882,8 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
39276
39882
|
(function(exports3) {
|
|
39277
39883
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
39278
39884
|
exports3.formatLimitDefinition = void 0;
|
|
39279
|
-
const ajv_1 = requireAjv();
|
|
39280
|
-
const codegen_1 = requireCodegen();
|
|
39885
|
+
const ajv_1 = /* @__PURE__ */ requireAjv();
|
|
39886
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
39281
39887
|
const ops = codegen_1.operators;
|
|
39282
39888
|
const KWDs = {
|
|
39283
39889
|
formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
|
|
@@ -39350,7 +39956,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
39350
39956
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
39351
39957
|
const formats_1 = requireFormats();
|
|
39352
39958
|
const limit_1 = requireLimit();
|
|
39353
|
-
const codegen_1 = requireCodegen();
|
|
39959
|
+
const codegen_1 = /* @__PURE__ */ requireCodegen();
|
|
39354
39960
|
const fullName = new codegen_1.Name("fullFormats");
|
|
39355
39961
|
const fastName = new codegen_1.Name("fastFormats");
|
|
39356
39962
|
const formatsPlugin = (ajv2, opts = { keywords: true }) => {
|