@puddle-code/cli 0.3.9 → 0.3.11
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/CHANGELOG.md +3 -14
- package/dist/host-control.mjs +228 -171
- package/dist/index.js +259 -200
- package/dist/public/assets/App-CNB4a07v.js +2 -0
- package/dist/public/assets/Dashboard-v3OproVW.js +1 -0
- package/dist/public/assets/{EditorTabClose-BolUnwz9.js → EditorTabClose-DwhahpvS.js} +1 -1
- package/dist/public/assets/{FindWidget-BUmuGtbd.js → FindWidget-CVH9U-_P.js} +1 -1
- package/dist/public/assets/{LazyTerminal-BRPy9Nm5.js → LazyTerminal-CgQryH0p.js} +2 -2
- package/dist/public/assets/{ModelRefcount-DdSmsCyg.js → ModelRefcount-njA_f4bS.js} +1 -1
- package/dist/public/assets/NewProjectDialog-BT8rR4yn.js +1 -0
- package/dist/public/assets/NotebookWidget-Cwd77EGL.js +7 -0
- package/dist/public/assets/PaneEditorBody-RaUBrZPu.js +303 -0
- package/dist/public/assets/PdfViewer-Bppu4-0-.js +2 -0
- package/dist/public/assets/SettingsDialog-CaHklYzG.js +8 -0
- package/dist/public/assets/{Terminal-WzMZyNl-.js → Terminal-_10Xyj1h.js} +5 -5
- package/dist/public/assets/Workspace-GgVr1uYN.js +20 -0
- package/dist/public/assets/_virtual_notebook-widget-runtime-Dro422xS.js +6966 -0
- package/dist/public/assets/api-i6xNY3bF.js +1 -0
- package/dist/public/assets/auth-GfOuXpIe.js +64 -0
- package/dist/public/assets/{buffer-store-BcKRO2bQ.js → buffer-store-eMnMxbpI.js} +1 -1
- package/dist/public/assets/{button-Chvl9hcE.js → button-BgeBH2Uc.js} +1 -1
- package/dist/public/assets/{command-CaE1P1RF.js → command-D7m0dmA-.js} +1 -1
- package/dist/public/assets/context-DW21k43a.js +1 -0
- package/dist/public/assets/{context-menu-BTe3xVbd.js → context-menu-CMWkmDu6.js} +1 -1
- package/dist/public/assets/dialog-BMWRC2HO.js +41 -0
- package/dist/public/assets/disclosure-CHXbNzgZ.js +1 -0
- package/dist/public/assets/dist-BOS6OKSE.js +1 -0
- package/dist/public/assets/{dist-BYGE8AQe.js → dist-C_x5-hi8.js} +1 -1
- package/dist/public/assets/{dist-CYLjuW55.js → dist-Cde1E3eV.js} +1 -1
- package/dist/public/assets/{dist-gLP0NXk8.js → dist-Ds3438NL.js} +1 -1
- package/dist/public/assets/errors-O9DWXa3f.js +1 -0
- package/dist/public/assets/forward-link-RM7_5Shu.js +1 -0
- package/dist/public/assets/hotkeys-1uTWFYAL.js +1 -0
- package/dist/public/assets/index-CPHfr3MU.css +2 -0
- package/dist/public/assets/{index-Dp8dqiUy.js → index-np8JXeG6.js} +3 -3
- package/dist/public/assets/input-CxgRsoVg.js +1 -0
- package/dist/public/assets/jsx-runtime-By8HlURe.js +1 -0
- package/dist/public/assets/{markdown-mermaid-BX4brFyy.js → markdown-mermaid-CNYDlgGt.js} +1 -1
- package/dist/public/assets/media-refresh-store-Bu4kWCGq.js +1 -0
- package/dist/public/assets/notification-delivery-Dfvdt_1U.js +1 -0
- package/dist/public/assets/{popover-C20E0SGw.js → popover-CCHRaCvX.js} +1 -1
- package/dist/public/assets/protocol-support-BGmIChNK.js +1 -0
- package/dist/public/assets/{jsx-runtime-ffCh33zF.js → react-dom-cJyBB_A4.js} +1 -1
- package/dist/public/assets/{scroll-restoration-DTBzWrDT.js → scroll-restoration-OVgiE4G9.js} +1 -1
- package/dist/public/assets/select-Bg0rWqco.js +1 -0
- package/dist/public/assets/selection-actions-D875GPFU.js +1 -0
- package/dist/public/assets/{session-order-iDEtZwje.js → session-order-f7QxTbVD.js} +1 -1
- package/dist/public/assets/{switch-B1uGC2PW.js → switch-DhNyUV8C.js} +1 -1
- package/dist/public/assets/use-ui-state-CHqXhyx4.js +1 -0
- package/dist/public/assets/{ws-DfRorDqa.js → ws-CMPCIzY4.js} +1 -1
- package/dist/public/index.html +5 -4
- package/dist/pudl.js +245 -188
- package/package.json +1 -1
- package/dist/public/assets/App-BaLhdtWg.js +0 -2
- package/dist/public/assets/Dashboard-LVU8bCcQ.js +0 -1
- package/dist/public/assets/NewProjectDialog-BFguzZCI.js +0 -1
- package/dist/public/assets/PaneEditorBody-DBW-O4q7.js +0 -303
- package/dist/public/assets/PdfViewer-Q6yROHsM.js +0 -2
- package/dist/public/assets/SettingsDialog-DoVdLwtQ.js +0 -8
- package/dist/public/assets/Workspace-BxGgvBCU.js +0 -20
- package/dist/public/assets/auth-ngM0Ffss.js +0 -64
- package/dist/public/assets/dialog-yvLGI8FJ.js +0 -41
- package/dist/public/assets/disclosure-0ZiECVHr.js +0 -1
- package/dist/public/assets/dist-CwwiP1WN.js +0 -1
- package/dist/public/assets/errors-yaab6YK_.js +0 -1
- package/dist/public/assets/forward-link-kfVuUsZP.js +0 -1
- package/dist/public/assets/index-CItoWyyj.css +0 -2
- package/dist/public/assets/input-DDhYsCUG.js +0 -1
- package/dist/public/assets/media-refresh-store-D3rBSq4q.js +0 -1
- package/dist/public/assets/notification-delivery-B__ASJZR.js +0 -1
- package/dist/public/assets/protocol-support-BNUfFPAF.js +0 -1
- package/dist/public/assets/select-DQmSVYUL.js +0 -1
- package/dist/public/assets/selection-actions-JLWPcaUH.js +0 -1
- package/dist/public/assets/use-ui-state-jAfsiEpt.js +0 -1
package/dist/pudl.js
CHANGED
|
@@ -14,7 +14,7 @@ import { parseArgs } from "node:util";
|
|
|
14
14
|
import { setTimeout as delay } from "node:timers/promises";
|
|
15
15
|
|
|
16
16
|
// ../shared/src/protocol.ts
|
|
17
|
-
var PROTOCOL_VERSION = { major: 25, minor:
|
|
17
|
+
var PROTOCOL_VERSION = { major: 25, minor: 4 };
|
|
18
18
|
|
|
19
19
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
20
20
|
var external_exports = {};
|
|
@@ -3108,42 +3108,42 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3108
3108
|
}
|
|
3109
3109
|
doc.write(`const newResult = {};`);
|
|
3110
3110
|
for (const key of normalized.keys) {
|
|
3111
|
-
const
|
|
3111
|
+
const id2 = ids[key];
|
|
3112
3112
|
const k = esc(key);
|
|
3113
3113
|
const schema = shape[key];
|
|
3114
3114
|
const isOptionalIn = schema?._zod?.optin === "optional";
|
|
3115
3115
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
3116
|
-
doc.write(`const ${
|
|
3116
|
+
doc.write(`const ${id2} = ${parseStr(key)};`);
|
|
3117
3117
|
if (isOptionalIn && isOptionalOut) {
|
|
3118
3118
|
doc.write(`
|
|
3119
|
-
if (${
|
|
3119
|
+
if (${id2}.issues.length) {
|
|
3120
3120
|
if (${k} in input) {
|
|
3121
|
-
payload.issues = payload.issues.concat(${
|
|
3121
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
3122
3122
|
...iss,
|
|
3123
3123
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
3124
3124
|
})));
|
|
3125
3125
|
}
|
|
3126
3126
|
}
|
|
3127
3127
|
|
|
3128
|
-
if (${
|
|
3128
|
+
if (${id2}.value === undefined) {
|
|
3129
3129
|
if (${k} in input) {
|
|
3130
3130
|
newResult[${k}] = undefined;
|
|
3131
3131
|
}
|
|
3132
3132
|
} else {
|
|
3133
|
-
newResult[${k}] = ${
|
|
3133
|
+
newResult[${k}] = ${id2}.value;
|
|
3134
3134
|
}
|
|
3135
3135
|
|
|
3136
3136
|
`);
|
|
3137
3137
|
} else if (!isOptionalIn) {
|
|
3138
3138
|
doc.write(`
|
|
3139
|
-
const ${
|
|
3140
|
-
if (${
|
|
3141
|
-
payload.issues = payload.issues.concat(${
|
|
3139
|
+
const ${id2}_present = ${k} in input;
|
|
3140
|
+
if (${id2}.issues.length) {
|
|
3141
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
3142
3142
|
...iss,
|
|
3143
3143
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
3144
3144
|
})));
|
|
3145
3145
|
}
|
|
3146
|
-
if (!${
|
|
3146
|
+
if (!${id2}_present && !${id2}.issues.length) {
|
|
3147
3147
|
payload.issues.push({
|
|
3148
3148
|
code: "invalid_type",
|
|
3149
3149
|
expected: "nonoptional",
|
|
@@ -3152,30 +3152,30 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3152
3152
|
});
|
|
3153
3153
|
}
|
|
3154
3154
|
|
|
3155
|
-
if (${
|
|
3156
|
-
if (${
|
|
3155
|
+
if (${id2}_present) {
|
|
3156
|
+
if (${id2}.value === undefined) {
|
|
3157
3157
|
newResult[${k}] = undefined;
|
|
3158
3158
|
} else {
|
|
3159
|
-
newResult[${k}] = ${
|
|
3159
|
+
newResult[${k}] = ${id2}.value;
|
|
3160
3160
|
}
|
|
3161
3161
|
}
|
|
3162
3162
|
|
|
3163
3163
|
`);
|
|
3164
3164
|
} else {
|
|
3165
3165
|
doc.write(`
|
|
3166
|
-
if (${
|
|
3167
|
-
payload.issues = payload.issues.concat(${
|
|
3166
|
+
if (${id2}.issues.length) {
|
|
3167
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
3168
3168
|
...iss,
|
|
3169
3169
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
3170
3170
|
})));
|
|
3171
3171
|
}
|
|
3172
3172
|
|
|
3173
|
-
if (${
|
|
3173
|
+
if (${id2}.value === undefined) {
|
|
3174
3174
|
if (${k} in input) {
|
|
3175
3175
|
newResult[${k}] = undefined;
|
|
3176
3176
|
}
|
|
3177
3177
|
} else {
|
|
3178
|
-
newResult[${k}] = ${
|
|
3178
|
+
newResult[${k}] = ${id2}.value;
|
|
3179
3179
|
}
|
|
3180
3180
|
|
|
3181
3181
|
`);
|
|
@@ -11507,26 +11507,26 @@ function extractDefs(ctx, schema) {
|
|
|
11507
11507
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
11508
11508
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
11509
11509
|
for (const entry of ctx.seen.entries()) {
|
|
11510
|
-
const
|
|
11511
|
-
if (
|
|
11512
|
-
const existing = idToSchema.get(
|
|
11510
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
11511
|
+
if (id2) {
|
|
11512
|
+
const existing = idToSchema.get(id2);
|
|
11513
11513
|
if (existing && existing !== entry[0]) {
|
|
11514
|
-
throw new Error(`Duplicate schema id "${
|
|
11514
|
+
throw new Error(`Duplicate schema id "${id2}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
11515
11515
|
}
|
|
11516
|
-
idToSchema.set(
|
|
11516
|
+
idToSchema.set(id2, entry[0]);
|
|
11517
11517
|
}
|
|
11518
11518
|
}
|
|
11519
11519
|
const makeURI = (entry) => {
|
|
11520
11520
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
11521
11521
|
if (ctx.external) {
|
|
11522
11522
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
11523
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
11523
|
+
const uriGenerator = ctx.external.uri ?? ((id3) => id3);
|
|
11524
11524
|
if (externalId) {
|
|
11525
11525
|
return { ref: uriGenerator(externalId) };
|
|
11526
11526
|
}
|
|
11527
|
-
const
|
|
11528
|
-
entry[1].defId =
|
|
11529
|
-
return { defId:
|
|
11527
|
+
const id2 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
11528
|
+
entry[1].defId = id2;
|
|
11529
|
+
return { defId: id2, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id2}` };
|
|
11530
11530
|
}
|
|
11531
11531
|
if (entry[1] === root) {
|
|
11532
11532
|
return { ref: "#" };
|
|
@@ -11574,8 +11574,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11574
11574
|
continue;
|
|
11575
11575
|
}
|
|
11576
11576
|
}
|
|
11577
|
-
const
|
|
11578
|
-
if (
|
|
11577
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
11578
|
+
if (id2) {
|
|
11579
11579
|
extractToDef(entry);
|
|
11580
11580
|
continue;
|
|
11581
11581
|
}
|
|
@@ -11671,10 +11671,10 @@ function finalize(ctx, schema) {
|
|
|
11671
11671
|
} else {
|
|
11672
11672
|
}
|
|
11673
11673
|
if (ctx.external?.uri) {
|
|
11674
|
-
const
|
|
11675
|
-
if (!
|
|
11674
|
+
const id2 = ctx.external.registry.get(schema)?.id;
|
|
11675
|
+
if (!id2)
|
|
11676
11676
|
throw new Error("Schema is missing an `id` property");
|
|
11677
|
-
result.$id = ctx.external.uri(
|
|
11677
|
+
result.$id = ctx.external.uri(id2);
|
|
11678
11678
|
}
|
|
11679
11679
|
Object.assign(result, root.def ?? root.schema);
|
|
11680
11680
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
@@ -11794,29 +11794,29 @@ var formatMap = {
|
|
|
11794
11794
|
// do not set
|
|
11795
11795
|
};
|
|
11796
11796
|
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
11797
|
-
const
|
|
11798
|
-
|
|
11797
|
+
const json3 = _json;
|
|
11798
|
+
json3.type = "string";
|
|
11799
11799
|
const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
|
|
11800
11800
|
if (typeof minimum === "number")
|
|
11801
|
-
|
|
11801
|
+
json3.minLength = minimum;
|
|
11802
11802
|
if (typeof maximum === "number")
|
|
11803
|
-
|
|
11803
|
+
json3.maxLength = maximum;
|
|
11804
11804
|
if (format) {
|
|
11805
|
-
|
|
11806
|
-
if (
|
|
11807
|
-
delete
|
|
11805
|
+
json3.format = formatMap[format] ?? format;
|
|
11806
|
+
if (json3.format === "")
|
|
11807
|
+
delete json3.format;
|
|
11808
11808
|
if (format === "time") {
|
|
11809
|
-
delete
|
|
11809
|
+
delete json3.format;
|
|
11810
11810
|
}
|
|
11811
11811
|
}
|
|
11812
11812
|
if (contentEncoding)
|
|
11813
|
-
|
|
11813
|
+
json3.contentEncoding = contentEncoding;
|
|
11814
11814
|
if (patterns && patterns.size > 0) {
|
|
11815
11815
|
const regexes = [...patterns];
|
|
11816
11816
|
if (regexes.length === 1)
|
|
11817
|
-
|
|
11817
|
+
json3.pattern = regexes[0].source;
|
|
11818
11818
|
else if (regexes.length > 1) {
|
|
11819
|
-
|
|
11819
|
+
json3.allOf = [
|
|
11820
11820
|
...regexes.map((regex) => ({
|
|
11821
11821
|
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
11822
11822
|
pattern: regex.source
|
|
@@ -11826,40 +11826,40 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
11826
11826
|
}
|
|
11827
11827
|
};
|
|
11828
11828
|
var numberProcessor = (schema, ctx, _json, _params) => {
|
|
11829
|
-
const
|
|
11829
|
+
const json3 = _json;
|
|
11830
11830
|
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
11831
11831
|
if (typeof format === "string" && format.includes("int"))
|
|
11832
|
-
|
|
11832
|
+
json3.type = "integer";
|
|
11833
11833
|
else
|
|
11834
|
-
|
|
11834
|
+
json3.type = "number";
|
|
11835
11835
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
11836
11836
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
11837
11837
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
11838
11838
|
if (exMin) {
|
|
11839
11839
|
if (legacy) {
|
|
11840
|
-
|
|
11841
|
-
|
|
11840
|
+
json3.minimum = exclusiveMinimum;
|
|
11841
|
+
json3.exclusiveMinimum = true;
|
|
11842
11842
|
} else {
|
|
11843
|
-
|
|
11843
|
+
json3.exclusiveMinimum = exclusiveMinimum;
|
|
11844
11844
|
}
|
|
11845
11845
|
} else if (typeof minimum === "number") {
|
|
11846
|
-
|
|
11846
|
+
json3.minimum = minimum;
|
|
11847
11847
|
}
|
|
11848
11848
|
if (exMax) {
|
|
11849
11849
|
if (legacy) {
|
|
11850
|
-
|
|
11851
|
-
|
|
11850
|
+
json3.maximum = exclusiveMaximum;
|
|
11851
|
+
json3.exclusiveMaximum = true;
|
|
11852
11852
|
} else {
|
|
11853
|
-
|
|
11853
|
+
json3.exclusiveMaximum = exclusiveMaximum;
|
|
11854
11854
|
}
|
|
11855
11855
|
} else if (typeof maximum === "number") {
|
|
11856
|
-
|
|
11856
|
+
json3.maximum = maximum;
|
|
11857
11857
|
}
|
|
11858
11858
|
if (typeof multipleOf === "number")
|
|
11859
|
-
|
|
11859
|
+
json3.multipleOf = multipleOf;
|
|
11860
11860
|
};
|
|
11861
|
-
var booleanProcessor = (_schema, _ctx,
|
|
11862
|
-
|
|
11861
|
+
var booleanProcessor = (_schema, _ctx, json3, _params) => {
|
|
11862
|
+
json3.type = "boolean";
|
|
11863
11863
|
};
|
|
11864
11864
|
var bigintProcessor = (_schema, ctx, _json, _params) => {
|
|
11865
11865
|
if (ctx.unrepresentable === "throw") {
|
|
@@ -11871,13 +11871,13 @@ var symbolProcessor = (_schema, ctx, _json, _params) => {
|
|
|
11871
11871
|
throw new Error("Symbols cannot be represented in JSON Schema");
|
|
11872
11872
|
}
|
|
11873
11873
|
};
|
|
11874
|
-
var nullProcessor = (_schema, ctx,
|
|
11874
|
+
var nullProcessor = (_schema, ctx, json3, _params) => {
|
|
11875
11875
|
if (ctx.target === "openapi-3.0") {
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11876
|
+
json3.type = "string";
|
|
11877
|
+
json3.nullable = true;
|
|
11878
|
+
json3.enum = [null];
|
|
11879
11879
|
} else {
|
|
11880
|
-
|
|
11880
|
+
json3.type = "null";
|
|
11881
11881
|
}
|
|
11882
11882
|
};
|
|
11883
11883
|
var undefinedProcessor = (_schema, ctx, _json, _params) => {
|
|
@@ -11890,8 +11890,8 @@ var voidProcessor = (_schema, ctx, _json, _params) => {
|
|
|
11890
11890
|
throw new Error("Void cannot be represented in JSON Schema");
|
|
11891
11891
|
}
|
|
11892
11892
|
};
|
|
11893
|
-
var neverProcessor = (_schema, _ctx,
|
|
11894
|
-
|
|
11893
|
+
var neverProcessor = (_schema, _ctx, json3, _params) => {
|
|
11894
|
+
json3.not = {};
|
|
11895
11895
|
};
|
|
11896
11896
|
var anyProcessor = (_schema, _ctx, _json, _params) => {
|
|
11897
11897
|
};
|
|
@@ -11902,16 +11902,16 @@ var dateProcessor = (_schema, ctx, _json, _params) => {
|
|
|
11902
11902
|
throw new Error("Date cannot be represented in JSON Schema");
|
|
11903
11903
|
}
|
|
11904
11904
|
};
|
|
11905
|
-
var enumProcessor = (schema, _ctx,
|
|
11905
|
+
var enumProcessor = (schema, _ctx, json3, _params) => {
|
|
11906
11906
|
const def = schema._zod.def;
|
|
11907
11907
|
const values = getEnumValues(def.entries);
|
|
11908
11908
|
if (values.every((v) => typeof v === "number"))
|
|
11909
|
-
|
|
11909
|
+
json3.type = "number";
|
|
11910
11910
|
if (values.every((v) => typeof v === "string"))
|
|
11911
|
-
|
|
11912
|
-
|
|
11911
|
+
json3.type = "string";
|
|
11912
|
+
json3.enum = values;
|
|
11913
11913
|
};
|
|
11914
|
-
var literalProcessor = (schema, ctx,
|
|
11914
|
+
var literalProcessor = (schema, ctx, json3, _params) => {
|
|
11915
11915
|
const def = schema._zod.def;
|
|
11916
11916
|
const vals = [];
|
|
11917
11917
|
for (const val of def.values) {
|
|
@@ -11933,22 +11933,22 @@ var literalProcessor = (schema, ctx, json2, _params) => {
|
|
|
11933
11933
|
if (vals.length === 0) {
|
|
11934
11934
|
} else if (vals.length === 1) {
|
|
11935
11935
|
const val = vals[0];
|
|
11936
|
-
|
|
11936
|
+
json3.type = val === null ? "null" : typeof val;
|
|
11937
11937
|
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
11938
|
-
|
|
11938
|
+
json3.enum = [val];
|
|
11939
11939
|
} else {
|
|
11940
|
-
|
|
11940
|
+
json3.const = val;
|
|
11941
11941
|
}
|
|
11942
11942
|
} else {
|
|
11943
11943
|
if (vals.every((v) => typeof v === "number"))
|
|
11944
|
-
|
|
11944
|
+
json3.type = "number";
|
|
11945
11945
|
if (vals.every((v) => typeof v === "string"))
|
|
11946
|
-
|
|
11946
|
+
json3.type = "string";
|
|
11947
11947
|
if (vals.every((v) => typeof v === "boolean"))
|
|
11948
|
-
|
|
11948
|
+
json3.type = "boolean";
|
|
11949
11949
|
if (vals.every((v) => v === null))
|
|
11950
|
-
|
|
11951
|
-
|
|
11950
|
+
json3.type = "null";
|
|
11951
|
+
json3.enum = vals;
|
|
11952
11952
|
}
|
|
11953
11953
|
};
|
|
11954
11954
|
var nanProcessor = (_schema, ctx, _json, _params) => {
|
|
@@ -11956,16 +11956,16 @@ var nanProcessor = (_schema, ctx, _json, _params) => {
|
|
|
11956
11956
|
throw new Error("NaN cannot be represented in JSON Schema");
|
|
11957
11957
|
}
|
|
11958
11958
|
};
|
|
11959
|
-
var templateLiteralProcessor = (schema, _ctx,
|
|
11960
|
-
const _json =
|
|
11959
|
+
var templateLiteralProcessor = (schema, _ctx, json3, _params) => {
|
|
11960
|
+
const _json = json3;
|
|
11961
11961
|
const pattern = schema._zod.pattern;
|
|
11962
11962
|
if (!pattern)
|
|
11963
11963
|
throw new Error("Pattern not found in template literal");
|
|
11964
11964
|
_json.type = "string";
|
|
11965
11965
|
_json.pattern = pattern.source;
|
|
11966
11966
|
};
|
|
11967
|
-
var fileProcessor = (schema, _ctx,
|
|
11968
|
-
const _json =
|
|
11967
|
+
var fileProcessor = (schema, _ctx, json3, _params) => {
|
|
11968
|
+
const _json = json3;
|
|
11969
11969
|
const file2 = {
|
|
11970
11970
|
type: "string",
|
|
11971
11971
|
format: "binary",
|
|
@@ -11988,8 +11988,8 @@ var fileProcessor = (schema, _ctx, json2, _params) => {
|
|
|
11988
11988
|
Object.assign(_json, file2);
|
|
11989
11989
|
}
|
|
11990
11990
|
};
|
|
11991
|
-
var successProcessor = (_schema, _ctx,
|
|
11992
|
-
|
|
11991
|
+
var successProcessor = (_schema, _ctx, json3, _params) => {
|
|
11992
|
+
json3.type = "boolean";
|
|
11993
11993
|
};
|
|
11994
11994
|
var customProcessor = (_schema, ctx, _json, _params) => {
|
|
11995
11995
|
if (ctx.unrepresentable === "throw") {
|
|
@@ -12017,27 +12017,27 @@ var setProcessor = (_schema, ctx, _json, _params) => {
|
|
|
12017
12017
|
}
|
|
12018
12018
|
};
|
|
12019
12019
|
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
12020
|
-
const
|
|
12020
|
+
const json3 = _json;
|
|
12021
12021
|
const def = schema._zod.def;
|
|
12022
12022
|
const { minimum, maximum } = schema._zod.bag;
|
|
12023
12023
|
if (typeof minimum === "number")
|
|
12024
|
-
|
|
12024
|
+
json3.minItems = minimum;
|
|
12025
12025
|
if (typeof maximum === "number")
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12026
|
+
json3.maxItems = maximum;
|
|
12027
|
+
json3.type = "array";
|
|
12028
|
+
json3.items = process2(def.element, ctx, {
|
|
12029
12029
|
...params,
|
|
12030
12030
|
path: [...params.path, "items"]
|
|
12031
12031
|
});
|
|
12032
12032
|
};
|
|
12033
12033
|
var objectProcessor = (schema, ctx, _json, params) => {
|
|
12034
|
-
const
|
|
12034
|
+
const json3 = _json;
|
|
12035
12035
|
const def = schema._zod.def;
|
|
12036
|
-
|
|
12037
|
-
|
|
12036
|
+
json3.type = "object";
|
|
12037
|
+
json3.properties = {};
|
|
12038
12038
|
const shape = def.shape;
|
|
12039
12039
|
for (const key in shape) {
|
|
12040
|
-
|
|
12040
|
+
json3.properties[key] = process2(shape[key], ctx, {
|
|
12041
12041
|
...params,
|
|
12042
12042
|
path: [...params.path, "properties", key]
|
|
12043
12043
|
});
|
|
@@ -12052,21 +12052,21 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
12052
12052
|
}
|
|
12053
12053
|
}));
|
|
12054
12054
|
if (requiredKeys.size > 0) {
|
|
12055
|
-
|
|
12055
|
+
json3.required = Array.from(requiredKeys);
|
|
12056
12056
|
}
|
|
12057
12057
|
if (def.catchall?._zod.def.type === "never") {
|
|
12058
|
-
|
|
12058
|
+
json3.additionalProperties = false;
|
|
12059
12059
|
} else if (!def.catchall) {
|
|
12060
12060
|
if (ctx.io === "output")
|
|
12061
|
-
|
|
12061
|
+
json3.additionalProperties = false;
|
|
12062
12062
|
} else if (def.catchall) {
|
|
12063
|
-
|
|
12063
|
+
json3.additionalProperties = process2(def.catchall, ctx, {
|
|
12064
12064
|
...params,
|
|
12065
12065
|
path: [...params.path, "additionalProperties"]
|
|
12066
12066
|
});
|
|
12067
12067
|
}
|
|
12068
12068
|
};
|
|
12069
|
-
var unionProcessor = (schema, ctx,
|
|
12069
|
+
var unionProcessor = (schema, ctx, json3, params) => {
|
|
12070
12070
|
const def = schema._zod.def;
|
|
12071
12071
|
const isExclusive = def.inclusive === false;
|
|
12072
12072
|
const options = def.options.map((x, i) => process2(x, ctx, {
|
|
@@ -12074,12 +12074,12 @@ var unionProcessor = (schema, ctx, json2, params) => {
|
|
|
12074
12074
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
12075
12075
|
}));
|
|
12076
12076
|
if (isExclusive) {
|
|
12077
|
-
|
|
12077
|
+
json3.oneOf = options;
|
|
12078
12078
|
} else {
|
|
12079
|
-
|
|
12079
|
+
json3.anyOf = options;
|
|
12080
12080
|
}
|
|
12081
12081
|
};
|
|
12082
|
-
var intersectionProcessor = (schema, ctx,
|
|
12082
|
+
var intersectionProcessor = (schema, ctx, json3, params) => {
|
|
12083
12083
|
const def = schema._zod.def;
|
|
12084
12084
|
const a = process2(def.left, ctx, {
|
|
12085
12085
|
...params,
|
|
@@ -12094,12 +12094,12 @@ var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
|
12094
12094
|
...isSimpleIntersection(a) ? a.allOf : [a],
|
|
12095
12095
|
...isSimpleIntersection(b) ? b.allOf : [b]
|
|
12096
12096
|
];
|
|
12097
|
-
|
|
12097
|
+
json3.allOf = allOf;
|
|
12098
12098
|
};
|
|
12099
12099
|
var tupleProcessor = (schema, ctx, _json, params) => {
|
|
12100
|
-
const
|
|
12100
|
+
const json3 = _json;
|
|
12101
12101
|
const def = schema._zod.def;
|
|
12102
|
-
|
|
12102
|
+
json3.type = "array";
|
|
12103
12103
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
12104
12104
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
12105
12105
|
const prefixItems = def.items.map((x, i) => process2(x, ctx, {
|
|
@@ -12111,37 +12111,37 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
12111
12111
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
12112
12112
|
}) : null;
|
|
12113
12113
|
if (ctx.target === "draft-2020-12") {
|
|
12114
|
-
|
|
12114
|
+
json3.prefixItems = prefixItems;
|
|
12115
12115
|
if (rest) {
|
|
12116
|
-
|
|
12116
|
+
json3.items = rest;
|
|
12117
12117
|
}
|
|
12118
12118
|
} else if (ctx.target === "openapi-3.0") {
|
|
12119
|
-
|
|
12119
|
+
json3.items = {
|
|
12120
12120
|
anyOf: prefixItems
|
|
12121
12121
|
};
|
|
12122
12122
|
if (rest) {
|
|
12123
|
-
|
|
12123
|
+
json3.items.anyOf.push(rest);
|
|
12124
12124
|
}
|
|
12125
|
-
|
|
12125
|
+
json3.minItems = prefixItems.length;
|
|
12126
12126
|
if (!rest) {
|
|
12127
|
-
|
|
12127
|
+
json3.maxItems = prefixItems.length;
|
|
12128
12128
|
}
|
|
12129
12129
|
} else {
|
|
12130
|
-
|
|
12130
|
+
json3.items = prefixItems;
|
|
12131
12131
|
if (rest) {
|
|
12132
|
-
|
|
12132
|
+
json3.additionalItems = rest;
|
|
12133
12133
|
}
|
|
12134
12134
|
}
|
|
12135
12135
|
const { minimum, maximum } = schema._zod.bag;
|
|
12136
12136
|
if (typeof minimum === "number")
|
|
12137
|
-
|
|
12137
|
+
json3.minItems = minimum;
|
|
12138
12138
|
if (typeof maximum === "number")
|
|
12139
|
-
|
|
12139
|
+
json3.maxItems = maximum;
|
|
12140
12140
|
};
|
|
12141
12141
|
var recordProcessor = (schema, ctx, _json, params) => {
|
|
12142
|
-
const
|
|
12142
|
+
const json3 = _json;
|
|
12143
12143
|
const def = schema._zod.def;
|
|
12144
|
-
|
|
12144
|
+
json3.type = "object";
|
|
12145
12145
|
const keyType = def.keyType;
|
|
12146
12146
|
const keyBag = keyType._zod.bag;
|
|
12147
12147
|
const patterns = keyBag?.patterns;
|
|
@@ -12150,18 +12150,18 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
12150
12150
|
...params,
|
|
12151
12151
|
path: [...params.path, "patternProperties", "*"]
|
|
12152
12152
|
});
|
|
12153
|
-
|
|
12153
|
+
json3.patternProperties = {};
|
|
12154
12154
|
for (const pattern of patterns) {
|
|
12155
|
-
|
|
12155
|
+
json3.patternProperties[pattern.source] = valueSchema;
|
|
12156
12156
|
}
|
|
12157
12157
|
} else {
|
|
12158
12158
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
12159
|
-
|
|
12159
|
+
json3.propertyNames = process2(def.keyType, ctx, {
|
|
12160
12160
|
...params,
|
|
12161
12161
|
path: [...params.path, "propertyNames"]
|
|
12162
12162
|
});
|
|
12163
12163
|
}
|
|
12164
|
-
|
|
12164
|
+
json3.additionalProperties = process2(def.valueType, ctx, {
|
|
12165
12165
|
...params,
|
|
12166
12166
|
path: [...params.path, "additionalProperties"]
|
|
12167
12167
|
});
|
|
@@ -12170,19 +12170,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
12170
12170
|
if (keyValues) {
|
|
12171
12171
|
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
12172
12172
|
if (validKeyValues.length > 0) {
|
|
12173
|
-
|
|
12173
|
+
json3.required = validKeyValues;
|
|
12174
12174
|
}
|
|
12175
12175
|
}
|
|
12176
12176
|
};
|
|
12177
|
-
var nullableProcessor = (schema, ctx,
|
|
12177
|
+
var nullableProcessor = (schema, ctx, json3, params) => {
|
|
12178
12178
|
const def = schema._zod.def;
|
|
12179
12179
|
const inner = process2(def.innerType, ctx, params);
|
|
12180
12180
|
const seen = ctx.seen.get(schema);
|
|
12181
12181
|
if (ctx.target === "openapi-3.0") {
|
|
12182
12182
|
seen.ref = def.innerType;
|
|
12183
|
-
|
|
12183
|
+
json3.nullable = true;
|
|
12184
12184
|
} else {
|
|
12185
|
-
|
|
12185
|
+
json3.anyOf = [inner, { type: "null" }];
|
|
12186
12186
|
}
|
|
12187
12187
|
};
|
|
12188
12188
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
@@ -12191,22 +12191,22 @@ var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
|
12191
12191
|
const seen = ctx.seen.get(schema);
|
|
12192
12192
|
seen.ref = def.innerType;
|
|
12193
12193
|
};
|
|
12194
|
-
var defaultProcessor = (schema, ctx,
|
|
12194
|
+
var defaultProcessor = (schema, ctx, json3, params) => {
|
|
12195
12195
|
const def = schema._zod.def;
|
|
12196
12196
|
process2(def.innerType, ctx, params);
|
|
12197
12197
|
const seen = ctx.seen.get(schema);
|
|
12198
12198
|
seen.ref = def.innerType;
|
|
12199
|
-
|
|
12199
|
+
json3.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
12200
12200
|
};
|
|
12201
|
-
var prefaultProcessor = (schema, ctx,
|
|
12201
|
+
var prefaultProcessor = (schema, ctx, json3, params) => {
|
|
12202
12202
|
const def = schema._zod.def;
|
|
12203
12203
|
process2(def.innerType, ctx, params);
|
|
12204
12204
|
const seen = ctx.seen.get(schema);
|
|
12205
12205
|
seen.ref = def.innerType;
|
|
12206
12206
|
if (ctx.io === "input")
|
|
12207
|
-
|
|
12207
|
+
json3._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
12208
12208
|
};
|
|
12209
|
-
var catchProcessor = (schema, ctx,
|
|
12209
|
+
var catchProcessor = (schema, ctx, json3, params) => {
|
|
12210
12210
|
const def = schema._zod.def;
|
|
12211
12211
|
process2(def.innerType, ctx, params);
|
|
12212
12212
|
const seen = ctx.seen.get(schema);
|
|
@@ -12217,7 +12217,7 @@ var catchProcessor = (schema, ctx, json2, params) => {
|
|
|
12217
12217
|
} catch {
|
|
12218
12218
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
12219
12219
|
}
|
|
12220
|
-
|
|
12220
|
+
json3.default = catchValue;
|
|
12221
12221
|
};
|
|
12222
12222
|
var pipeProcessor = (schema, ctx, _json, params) => {
|
|
12223
12223
|
const def = schema._zod.def;
|
|
@@ -12227,12 +12227,12 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
12227
12227
|
const seen = ctx.seen.get(schema);
|
|
12228
12228
|
seen.ref = innerType;
|
|
12229
12229
|
};
|
|
12230
|
-
var readonlyProcessor = (schema, ctx,
|
|
12230
|
+
var readonlyProcessor = (schema, ctx, json3, params) => {
|
|
12231
12231
|
const def = schema._zod.def;
|
|
12232
12232
|
process2(def.innerType, ctx, params);
|
|
12233
12233
|
const seen = ctx.seen.get(schema);
|
|
12234
12234
|
seen.ref = def.innerType;
|
|
12235
|
-
|
|
12235
|
+
json3.readOnly = true;
|
|
12236
12236
|
};
|
|
12237
12237
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
12238
12238
|
const def = schema._zod.def;
|
|
@@ -12876,7 +12876,7 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
12876
12876
|
var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
12877
12877
|
$ZodString.init(inst, def);
|
|
12878
12878
|
ZodType.init(inst, def);
|
|
12879
|
-
inst._zod.processJSONSchema = (ctx,
|
|
12879
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => stringProcessor(inst, ctx, json3, params);
|
|
12880
12880
|
const bag = inst._zod.bag;
|
|
12881
12881
|
inst.format = bag.format ?? null;
|
|
12882
12882
|
inst.minLength = bag.minimum ?? null;
|
|
@@ -13147,7 +13147,7 @@ function hash(alg, params) {
|
|
|
13147
13147
|
var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
13148
13148
|
$ZodNumber.init(inst, def);
|
|
13149
13149
|
ZodType.init(inst, def);
|
|
13150
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13150
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => numberProcessor(inst, ctx, json3, params);
|
|
13151
13151
|
_installLazyMethods(inst, "ZodNumber", {
|
|
13152
13152
|
gt(value, params) {
|
|
13153
13153
|
return this.check(_gt(value, params));
|
|
@@ -13227,7 +13227,7 @@ function uint32(params) {
|
|
|
13227
13227
|
var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
13228
13228
|
$ZodBoolean.init(inst, def);
|
|
13229
13229
|
ZodType.init(inst, def);
|
|
13230
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13230
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => booleanProcessor(inst, ctx, json3, params);
|
|
13231
13231
|
});
|
|
13232
13232
|
function boolean2(params) {
|
|
13233
13233
|
return _boolean(ZodBoolean, params);
|
|
@@ -13235,7 +13235,7 @@ function boolean2(params) {
|
|
|
13235
13235
|
var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
|
|
13236
13236
|
$ZodBigInt.init(inst, def);
|
|
13237
13237
|
ZodType.init(inst, def);
|
|
13238
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13238
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => bigintProcessor(inst, ctx, json3, params);
|
|
13239
13239
|
inst.gte = (value, params) => inst.check(_gte(value, params));
|
|
13240
13240
|
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
13241
13241
|
inst.gt = (value, params) => inst.check(_gt(value, params));
|
|
@@ -13270,7 +13270,7 @@ function uint64(params) {
|
|
|
13270
13270
|
var ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => {
|
|
13271
13271
|
$ZodSymbol.init(inst, def);
|
|
13272
13272
|
ZodType.init(inst, def);
|
|
13273
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13273
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => symbolProcessor(inst, ctx, json3, params);
|
|
13274
13274
|
});
|
|
13275
13275
|
function symbol(params) {
|
|
13276
13276
|
return _symbol(ZodSymbol, params);
|
|
@@ -13278,7 +13278,7 @@ function symbol(params) {
|
|
|
13278
13278
|
var ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => {
|
|
13279
13279
|
$ZodUndefined.init(inst, def);
|
|
13280
13280
|
ZodType.init(inst, def);
|
|
13281
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13281
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => undefinedProcessor(inst, ctx, json3, params);
|
|
13282
13282
|
});
|
|
13283
13283
|
function _undefined3(params) {
|
|
13284
13284
|
return _undefined2(ZodUndefined, params);
|
|
@@ -13286,7 +13286,7 @@ function _undefined3(params) {
|
|
|
13286
13286
|
var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
13287
13287
|
$ZodNull.init(inst, def);
|
|
13288
13288
|
ZodType.init(inst, def);
|
|
13289
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13289
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => nullProcessor(inst, ctx, json3, params);
|
|
13290
13290
|
});
|
|
13291
13291
|
function _null3(params) {
|
|
13292
13292
|
return _null2(ZodNull, params);
|
|
@@ -13294,7 +13294,7 @@ function _null3(params) {
|
|
|
13294
13294
|
var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
|
|
13295
13295
|
$ZodAny.init(inst, def);
|
|
13296
13296
|
ZodType.init(inst, def);
|
|
13297
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13297
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => anyProcessor(inst, ctx, json3, params);
|
|
13298
13298
|
});
|
|
13299
13299
|
function any() {
|
|
13300
13300
|
return _any(ZodAny);
|
|
@@ -13302,7 +13302,7 @@ function any() {
|
|
|
13302
13302
|
var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
13303
13303
|
$ZodUnknown.init(inst, def);
|
|
13304
13304
|
ZodType.init(inst, def);
|
|
13305
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13305
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => unknownProcessor(inst, ctx, json3, params);
|
|
13306
13306
|
});
|
|
13307
13307
|
function unknown() {
|
|
13308
13308
|
return _unknown(ZodUnknown);
|
|
@@ -13310,7 +13310,7 @@ function unknown() {
|
|
|
13310
13310
|
var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
13311
13311
|
$ZodNever.init(inst, def);
|
|
13312
13312
|
ZodType.init(inst, def);
|
|
13313
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13313
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => neverProcessor(inst, ctx, json3, params);
|
|
13314
13314
|
});
|
|
13315
13315
|
function never(params) {
|
|
13316
13316
|
return _never(ZodNever, params);
|
|
@@ -13318,7 +13318,7 @@ function never(params) {
|
|
|
13318
13318
|
var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
|
|
13319
13319
|
$ZodVoid.init(inst, def);
|
|
13320
13320
|
ZodType.init(inst, def);
|
|
13321
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13321
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => voidProcessor(inst, ctx, json3, params);
|
|
13322
13322
|
});
|
|
13323
13323
|
function _void2(params) {
|
|
13324
13324
|
return _void(ZodVoid, params);
|
|
@@ -13326,7 +13326,7 @@ function _void2(params) {
|
|
|
13326
13326
|
var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
|
|
13327
13327
|
$ZodDate.init(inst, def);
|
|
13328
13328
|
ZodType.init(inst, def);
|
|
13329
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13329
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => dateProcessor(inst, ctx, json3, params);
|
|
13330
13330
|
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
13331
13331
|
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
13332
13332
|
const c = inst._zod.bag;
|
|
@@ -13339,7 +13339,7 @@ function date3(params) {
|
|
|
13339
13339
|
var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
13340
13340
|
$ZodArray.init(inst, def);
|
|
13341
13341
|
ZodType.init(inst, def);
|
|
13342
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13342
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => arrayProcessor(inst, ctx, json3, params);
|
|
13343
13343
|
inst.element = def.element;
|
|
13344
13344
|
_installLazyMethods(inst, "ZodArray", {
|
|
13345
13345
|
min(n, params) {
|
|
@@ -13369,7 +13369,7 @@ function keyof(schema) {
|
|
|
13369
13369
|
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
13370
13370
|
$ZodObjectJIT.init(inst, def);
|
|
13371
13371
|
ZodType.init(inst, def);
|
|
13372
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13372
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => objectProcessor(inst, ctx, json3, params);
|
|
13373
13373
|
util_exports.defineLazy(inst, "shape", () => {
|
|
13374
13374
|
return def.shape;
|
|
13375
13375
|
});
|
|
@@ -13442,7 +13442,7 @@ function looseObject(shape, params) {
|
|
|
13442
13442
|
var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
13443
13443
|
$ZodUnion.init(inst, def);
|
|
13444
13444
|
ZodType.init(inst, def);
|
|
13445
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13445
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => unionProcessor(inst, ctx, json3, params);
|
|
13446
13446
|
inst.options = def.options;
|
|
13447
13447
|
});
|
|
13448
13448
|
function union(options, params) {
|
|
@@ -13455,7 +13455,7 @@ function union(options, params) {
|
|
|
13455
13455
|
var ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => {
|
|
13456
13456
|
ZodUnion.init(inst, def);
|
|
13457
13457
|
$ZodXor.init(inst, def);
|
|
13458
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13458
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => unionProcessor(inst, ctx, json3, params);
|
|
13459
13459
|
inst.options = def.options;
|
|
13460
13460
|
});
|
|
13461
13461
|
function xor(options, params) {
|
|
@@ -13481,7 +13481,7 @@ function discriminatedUnion(discriminator, options, params) {
|
|
|
13481
13481
|
var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
13482
13482
|
$ZodIntersection.init(inst, def);
|
|
13483
13483
|
ZodType.init(inst, def);
|
|
13484
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13484
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => intersectionProcessor(inst, ctx, json3, params);
|
|
13485
13485
|
});
|
|
13486
13486
|
function intersection(left, right) {
|
|
13487
13487
|
return new ZodIntersection({
|
|
@@ -13493,7 +13493,7 @@ function intersection(left, right) {
|
|
|
13493
13493
|
var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
|
|
13494
13494
|
$ZodTuple.init(inst, def);
|
|
13495
13495
|
ZodType.init(inst, def);
|
|
13496
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13496
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => tupleProcessor(inst, ctx, json3, params);
|
|
13497
13497
|
inst.rest = (rest) => inst.clone({
|
|
13498
13498
|
...inst._zod.def,
|
|
13499
13499
|
rest
|
|
@@ -13513,7 +13513,7 @@ function tuple(items, _paramsOrRest, _params) {
|
|
|
13513
13513
|
var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
13514
13514
|
$ZodRecord.init(inst, def);
|
|
13515
13515
|
ZodType.init(inst, def);
|
|
13516
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13516
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => recordProcessor(inst, ctx, json3, params);
|
|
13517
13517
|
inst.keyType = def.keyType;
|
|
13518
13518
|
inst.valueType = def.valueType;
|
|
13519
13519
|
});
|
|
@@ -13555,7 +13555,7 @@ function looseRecord(keyType, valueType, params) {
|
|
|
13555
13555
|
var ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => {
|
|
13556
13556
|
$ZodMap.init(inst, def);
|
|
13557
13557
|
ZodType.init(inst, def);
|
|
13558
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13558
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => mapProcessor(inst, ctx, json3, params);
|
|
13559
13559
|
inst.keyType = def.keyType;
|
|
13560
13560
|
inst.valueType = def.valueType;
|
|
13561
13561
|
inst.min = (...args) => inst.check(_minSize(...args));
|
|
@@ -13574,7 +13574,7 @@ function map(keyType, valueType, params) {
|
|
|
13574
13574
|
var ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
|
|
13575
13575
|
$ZodSet.init(inst, def);
|
|
13576
13576
|
ZodType.init(inst, def);
|
|
13577
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13577
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => setProcessor(inst, ctx, json3, params);
|
|
13578
13578
|
inst.min = (...args) => inst.check(_minSize(...args));
|
|
13579
13579
|
inst.nonempty = (params) => inst.check(_minSize(1, params));
|
|
13580
13580
|
inst.max = (...args) => inst.check(_maxSize(...args));
|
|
@@ -13590,7 +13590,7 @@ function set(valueType, params) {
|
|
|
13590
13590
|
var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
13591
13591
|
$ZodEnum.init(inst, def);
|
|
13592
13592
|
ZodType.init(inst, def);
|
|
13593
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13593
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => enumProcessor(inst, ctx, json3, params);
|
|
13594
13594
|
inst.enum = def.entries;
|
|
13595
13595
|
inst.options = Object.values(def.entries);
|
|
13596
13596
|
const keys = new Set(Object.keys(def.entries));
|
|
@@ -13643,7 +13643,7 @@ function nativeEnum(entries, params) {
|
|
|
13643
13643
|
var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
|
|
13644
13644
|
$ZodLiteral.init(inst, def);
|
|
13645
13645
|
ZodType.init(inst, def);
|
|
13646
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13646
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => literalProcessor(inst, ctx, json3, params);
|
|
13647
13647
|
inst.values = new Set(def.values);
|
|
13648
13648
|
Object.defineProperty(inst, "value", {
|
|
13649
13649
|
get() {
|
|
@@ -13664,7 +13664,7 @@ function literal(value, params) {
|
|
|
13664
13664
|
var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
|
|
13665
13665
|
$ZodFile.init(inst, def);
|
|
13666
13666
|
ZodType.init(inst, def);
|
|
13667
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13667
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => fileProcessor(inst, ctx, json3, params);
|
|
13668
13668
|
inst.min = (size, params) => inst.check(_minSize(size, params));
|
|
13669
13669
|
inst.max = (size, params) => inst.check(_maxSize(size, params));
|
|
13670
13670
|
inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params));
|
|
@@ -13675,7 +13675,7 @@ function file(params) {
|
|
|
13675
13675
|
var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
13676
13676
|
$ZodTransform.init(inst, def);
|
|
13677
13677
|
ZodType.init(inst, def);
|
|
13678
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13678
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => transformProcessor(inst, ctx, json3, params);
|
|
13679
13679
|
inst._zod.parse = (payload, _ctx) => {
|
|
13680
13680
|
if (_ctx.direction === "backward") {
|
|
13681
13681
|
throw new $ZodEncodeError(inst.constructor.name);
|
|
@@ -13715,7 +13715,7 @@ function transform(fn) {
|
|
|
13715
13715
|
var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
13716
13716
|
$ZodOptional.init(inst, def);
|
|
13717
13717
|
ZodType.init(inst, def);
|
|
13718
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13718
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => optionalProcessor(inst, ctx, json3, params);
|
|
13719
13719
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
13720
13720
|
});
|
|
13721
13721
|
function optional(innerType) {
|
|
@@ -13727,7 +13727,7 @@ function optional(innerType) {
|
|
|
13727
13727
|
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
13728
13728
|
$ZodExactOptional.init(inst, def);
|
|
13729
13729
|
ZodType.init(inst, def);
|
|
13730
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13730
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => optionalProcessor(inst, ctx, json3, params);
|
|
13731
13731
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
13732
13732
|
});
|
|
13733
13733
|
function exactOptional(innerType) {
|
|
@@ -13739,7 +13739,7 @@ function exactOptional(innerType) {
|
|
|
13739
13739
|
var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
13740
13740
|
$ZodNullable.init(inst, def);
|
|
13741
13741
|
ZodType.init(inst, def);
|
|
13742
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13742
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => nullableProcessor(inst, ctx, json3, params);
|
|
13743
13743
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
13744
13744
|
});
|
|
13745
13745
|
function nullable(innerType) {
|
|
@@ -13754,7 +13754,7 @@ function nullish2(innerType) {
|
|
|
13754
13754
|
var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
13755
13755
|
$ZodDefault.init(inst, def);
|
|
13756
13756
|
ZodType.init(inst, def);
|
|
13757
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13757
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => defaultProcessor(inst, ctx, json3, params);
|
|
13758
13758
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
13759
13759
|
inst.removeDefault = inst.unwrap;
|
|
13760
13760
|
});
|
|
@@ -13770,7 +13770,7 @@ function _default2(innerType, defaultValue) {
|
|
|
13770
13770
|
var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
13771
13771
|
$ZodPrefault.init(inst, def);
|
|
13772
13772
|
ZodType.init(inst, def);
|
|
13773
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13773
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => prefaultProcessor(inst, ctx, json3, params);
|
|
13774
13774
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
13775
13775
|
});
|
|
13776
13776
|
function prefault(innerType, defaultValue) {
|
|
@@ -13785,7 +13785,7 @@ function prefault(innerType, defaultValue) {
|
|
|
13785
13785
|
var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
13786
13786
|
$ZodNonOptional.init(inst, def);
|
|
13787
13787
|
ZodType.init(inst, def);
|
|
13788
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13788
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => nonoptionalProcessor(inst, ctx, json3, params);
|
|
13789
13789
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
13790
13790
|
});
|
|
13791
13791
|
function nonoptional(innerType, params) {
|
|
@@ -13798,7 +13798,7 @@ function nonoptional(innerType, params) {
|
|
|
13798
13798
|
var ZodSuccess = /* @__PURE__ */ $constructor("ZodSuccess", (inst, def) => {
|
|
13799
13799
|
$ZodSuccess.init(inst, def);
|
|
13800
13800
|
ZodType.init(inst, def);
|
|
13801
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13801
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => successProcessor(inst, ctx, json3, params);
|
|
13802
13802
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
13803
13803
|
});
|
|
13804
13804
|
function success(innerType) {
|
|
@@ -13810,7 +13810,7 @@ function success(innerType) {
|
|
|
13810
13810
|
var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
13811
13811
|
$ZodCatch.init(inst, def);
|
|
13812
13812
|
ZodType.init(inst, def);
|
|
13813
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13813
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => catchProcessor(inst, ctx, json3, params);
|
|
13814
13814
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
13815
13815
|
inst.removeCatch = inst.unwrap;
|
|
13816
13816
|
});
|
|
@@ -13824,7 +13824,7 @@ function _catch2(innerType, catchValue) {
|
|
|
13824
13824
|
var ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => {
|
|
13825
13825
|
$ZodNaN.init(inst, def);
|
|
13826
13826
|
ZodType.init(inst, def);
|
|
13827
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13827
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => nanProcessor(inst, ctx, json3, params);
|
|
13828
13828
|
});
|
|
13829
13829
|
function nan(params) {
|
|
13830
13830
|
return _nan(ZodNaN, params);
|
|
@@ -13832,7 +13832,7 @@ function nan(params) {
|
|
|
13832
13832
|
var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
13833
13833
|
$ZodPipe.init(inst, def);
|
|
13834
13834
|
ZodType.init(inst, def);
|
|
13835
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13835
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => pipeProcessor(inst, ctx, json3, params);
|
|
13836
13836
|
inst.in = def.in;
|
|
13837
13837
|
inst.out = def.out;
|
|
13838
13838
|
});
|
|
@@ -13874,7 +13874,7 @@ var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) =>
|
|
|
13874
13874
|
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
13875
13875
|
$ZodReadonly.init(inst, def);
|
|
13876
13876
|
ZodType.init(inst, def);
|
|
13877
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13877
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => readonlyProcessor(inst, ctx, json3, params);
|
|
13878
13878
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
13879
13879
|
});
|
|
13880
13880
|
function readonly(innerType) {
|
|
@@ -13886,7 +13886,7 @@ function readonly(innerType) {
|
|
|
13886
13886
|
var ZodTemplateLiteral = /* @__PURE__ */ $constructor("ZodTemplateLiteral", (inst, def) => {
|
|
13887
13887
|
$ZodTemplateLiteral.init(inst, def);
|
|
13888
13888
|
ZodType.init(inst, def);
|
|
13889
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13889
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => templateLiteralProcessor(inst, ctx, json3, params);
|
|
13890
13890
|
});
|
|
13891
13891
|
function templateLiteral(parts, params) {
|
|
13892
13892
|
return new ZodTemplateLiteral({
|
|
@@ -13898,7 +13898,7 @@ function templateLiteral(parts, params) {
|
|
|
13898
13898
|
var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
|
|
13899
13899
|
$ZodLazy.init(inst, def);
|
|
13900
13900
|
ZodType.init(inst, def);
|
|
13901
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13901
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => lazyProcessor(inst, ctx, json3, params);
|
|
13902
13902
|
inst.unwrap = () => inst._zod.def.getter();
|
|
13903
13903
|
});
|
|
13904
13904
|
function lazy(getter) {
|
|
@@ -13910,7 +13910,7 @@ function lazy(getter) {
|
|
|
13910
13910
|
var ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => {
|
|
13911
13911
|
$ZodPromise.init(inst, def);
|
|
13912
13912
|
ZodType.init(inst, def);
|
|
13913
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13913
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => promiseProcessor(inst, ctx, json3, params);
|
|
13914
13914
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
13915
13915
|
});
|
|
13916
13916
|
function promise(innerType) {
|
|
@@ -13922,7 +13922,7 @@ function promise(innerType) {
|
|
|
13922
13922
|
var ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => {
|
|
13923
13923
|
$ZodFunction.init(inst, def);
|
|
13924
13924
|
ZodType.init(inst, def);
|
|
13925
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13925
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => functionProcessor(inst, ctx, json3, params);
|
|
13926
13926
|
});
|
|
13927
13927
|
function _function(params) {
|
|
13928
13928
|
return new ZodFunction({
|
|
@@ -13934,7 +13934,7 @@ function _function(params) {
|
|
|
13934
13934
|
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
13935
13935
|
$ZodCustom.init(inst, def);
|
|
13936
13936
|
ZodType.init(inst, def);
|
|
13937
|
-
inst._zod.processJSONSchema = (ctx,
|
|
13937
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => customProcessor(inst, ctx, json3, params);
|
|
13938
13938
|
});
|
|
13939
13939
|
function check(fn) {
|
|
13940
13940
|
const ch = new $ZodCheck({
|
|
@@ -16504,6 +16504,63 @@ var notebookIntelligenceResponseSchema = external_exports.object({
|
|
|
16504
16504
|
documentation: external_exports.string().max(32768)
|
|
16505
16505
|
});
|
|
16506
16506
|
|
|
16507
|
+
// ../shared/src/api/notebook-widgets.ts
|
|
16508
|
+
var id = external_exports.string().min(1).max(128);
|
|
16509
|
+
var json2 = external_exports.record(external_exports.string(), external_exports.unknown());
|
|
16510
|
+
var binary = external_exports.string().max(2 * 1024 * 1024).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
16511
|
+
var notebookWidgetMessageSchema = external_exports.object({
|
|
16512
|
+
msg_id: id,
|
|
16513
|
+
parent_id: external_exports.string().max(128).default(""),
|
|
16514
|
+
msg_type: external_exports.enum(["comm_open", "comm_msg", "comm_close", "status"]),
|
|
16515
|
+
content: json2,
|
|
16516
|
+
metadata: json2.default({}),
|
|
16517
|
+
buffers: external_exports.array(binary).max(128).default([])
|
|
16518
|
+
});
|
|
16519
|
+
var notebookWidgetStateSchema = external_exports.object({
|
|
16520
|
+
version_major: external_exports.literal(2),
|
|
16521
|
+
version_minor: external_exports.literal(0),
|
|
16522
|
+
state: external_exports.record(
|
|
16523
|
+
id,
|
|
16524
|
+
external_exports.object({
|
|
16525
|
+
model_name: external_exports.string().max(256),
|
|
16526
|
+
model_module: external_exports.string().max(256),
|
|
16527
|
+
model_module_version: external_exports.string().max(128),
|
|
16528
|
+
state: json2,
|
|
16529
|
+
buffers: external_exports.array(
|
|
16530
|
+
external_exports.object({
|
|
16531
|
+
encoding: external_exports.literal("base64"),
|
|
16532
|
+
path: external_exports.array(external_exports.union([external_exports.string().max(256), external_exports.number().int().nonnegative()])).max(64),
|
|
16533
|
+
data: binary
|
|
16534
|
+
})
|
|
16535
|
+
).max(128).optional()
|
|
16536
|
+
})
|
|
16537
|
+
).refine((state) => Object.keys(state).length <= 1024, "Too many widget models")
|
|
16538
|
+
});
|
|
16539
|
+
var notebookWidgetsRequestSchema = external_exports.object({
|
|
16540
|
+
source: compilationFileTargetSchema,
|
|
16541
|
+
generation: external_exports.string().uuid().optional(),
|
|
16542
|
+
after: external_exports.number().int().nonnegative().optional()
|
|
16543
|
+
});
|
|
16544
|
+
var notebookWidgetsResponseSchema = external_exports.object({
|
|
16545
|
+
generation: external_exports.string().uuid().nullable(),
|
|
16546
|
+
revision: external_exports.number().int().nonnegative(),
|
|
16547
|
+
snapshot: notebookWidgetStateSchema.optional(),
|
|
16548
|
+
events: external_exports.array(notebookWidgetMessageSchema).max(256),
|
|
16549
|
+
error: external_exports.string().max(1024).optional()
|
|
16550
|
+
});
|
|
16551
|
+
var notebookWidgetCommSchema = external_exports.object({
|
|
16552
|
+
source: compilationFileTargetSchema,
|
|
16553
|
+
generation: external_exports.string().uuid(),
|
|
16554
|
+
message: notebookWidgetMessageSchema.extend({
|
|
16555
|
+
msg_type: external_exports.enum(["comm_open", "comm_msg", "comm_close"]),
|
|
16556
|
+
content: external_exports.object({
|
|
16557
|
+
comm_id: id,
|
|
16558
|
+
target_name: external_exports.literal("jupyter.widget").optional(),
|
|
16559
|
+
data: json2
|
|
16560
|
+
})
|
|
16561
|
+
})
|
|
16562
|
+
});
|
|
16563
|
+
|
|
16507
16564
|
// ../shared/src/node/security.ts
|
|
16508
16565
|
import { createHash, randomBytes } from "node:crypto";
|
|
16509
16566
|
import {
|
|
@@ -16644,15 +16701,15 @@ var HostControlClient = class {
|
|
|
16644
16701
|
resource(close) {
|
|
16645
16702
|
this.credential();
|
|
16646
16703
|
const generation = this.generation;
|
|
16647
|
-
const
|
|
16648
|
-
this.resources.set(
|
|
16704
|
+
const id2 = secret();
|
|
16705
|
+
this.resources.set(id2, close);
|
|
16649
16706
|
return {
|
|
16650
|
-
id,
|
|
16707
|
+
id: id2,
|
|
16651
16708
|
release: () => {
|
|
16652
|
-
this.resources.delete(
|
|
16709
|
+
this.resources.delete(id2);
|
|
16653
16710
|
},
|
|
16654
16711
|
valid: () => {
|
|
16655
|
-
const valid = this.generation === generation && this.resources.has(
|
|
16712
|
+
const valid = this.generation === generation && this.resources.has(id2) && performance.now() < this.until;
|
|
16656
16713
|
if (!valid) close();
|
|
16657
16714
|
return valid;
|
|
16658
16715
|
}
|
|
@@ -16683,7 +16740,7 @@ var HostControlClient = class {
|
|
|
16683
16740
|
this.renewControl = (resources, sentAt) => {
|
|
16684
16741
|
if (pendingAt !== null || this.channel !== channel || this.state !== "ready")
|
|
16685
16742
|
return false;
|
|
16686
|
-
if (resources.some((
|
|
16743
|
+
if (resources.some((id2) => !this.resources.has(id2))) return false;
|
|
16687
16744
|
send({ t: "renew", resources }, sentAt);
|
|
16688
16745
|
return true;
|
|
16689
16746
|
};
|
|
@@ -17437,17 +17494,17 @@ var PuddlangClient = class {
|
|
|
17437
17494
|
async start(input) {
|
|
17438
17495
|
return puddlangRunSchema.parse(await this.request("/runs", input));
|
|
17439
17496
|
}
|
|
17440
|
-
async status(
|
|
17441
|
-
return puddlangRunSchema.parse(await this.request(`/runs/${encodeURIComponent(
|
|
17497
|
+
async status(id2) {
|
|
17498
|
+
return puddlangRunSchema.parse(await this.request(`/runs/${encodeURIComponent(id2)}`));
|
|
17442
17499
|
}
|
|
17443
|
-
async events(
|
|
17500
|
+
async events(id2, after = 0) {
|
|
17444
17501
|
return puddlangEventsSchema.parse(
|
|
17445
|
-
await this.request(`/runs/${encodeURIComponent(
|
|
17502
|
+
await this.request(`/runs/${encodeURIComponent(id2)}/events?after=${after}`)
|
|
17446
17503
|
);
|
|
17447
17504
|
}
|
|
17448
|
-
async cancel(
|
|
17505
|
+
async cancel(id2) {
|
|
17449
17506
|
return puddlangRunSchema.parse(
|
|
17450
|
-
await this.request(`/runs/${encodeURIComponent(
|
|
17507
|
+
await this.request(`/runs/${encodeURIComponent(id2)}/cancel`, {})
|
|
17451
17508
|
);
|
|
17452
17509
|
}
|
|
17453
17510
|
};
|
|
@@ -17499,13 +17556,13 @@ async function serveMcp(client, input, output) {
|
|
|
17499
17556
|
write({ jsonrpc: "2.0", id: null, error: { code: -32600, message: "Invalid request" } });
|
|
17500
17557
|
return;
|
|
17501
17558
|
}
|
|
17502
|
-
const { id, method, params } = parsed.data;
|
|
17503
|
-
if (
|
|
17559
|
+
const { id: id2, method, params } = parsed.data;
|
|
17560
|
+
if (id2 === void 0) {
|
|
17504
17561
|
if (method === "notifications/initialized" && initialised) ready = true;
|
|
17505
17562
|
return;
|
|
17506
17563
|
}
|
|
17507
|
-
const reply = (result) => write({ jsonrpc: "2.0", id, result });
|
|
17508
|
-
const fail = (code, message) => write({ jsonrpc: "2.0", id, error: { code, message } });
|
|
17564
|
+
const reply = (result) => write({ jsonrpc: "2.0", id: id2, result });
|
|
17565
|
+
const fail = (code, message) => write({ jsonrpc: "2.0", id: id2, error: { code, message } });
|
|
17509
17566
|
if (method === "initialize") {
|
|
17510
17567
|
if (initialised) {
|
|
17511
17568
|
fail(-32600, "Already initialised");
|