@puddle-code/cli 0.3.8 → 0.3.10
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 +7 -5
- package/dist/host-control.mjs +288 -171
- package/dist/index.js +319 -200
- package/dist/public/assets/App-CNB4a07v.js +2 -0
- package/dist/public/assets/Dashboard-v3OproVW.js +1 -0
- package/dist/public/assets/EditorTabClose-DwhahpvS.js +1 -0
- package/dist/public/assets/FindWidget-CVH9U-_P.js +1 -0
- package/dist/public/assets/{LazyTerminal-CdXNqTZt.js → LazyTerminal-CgQryH0p.js} +2 -2
- package/dist/public/assets/{ModelRefcount-HPszadg6.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-CMOPxTVY.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-Da5Z0NEV.js → buffer-store-eMnMxbpI.js} +1 -1
- package/dist/public/assets/{button-Chvl9hcE.js → button-BgeBH2Uc.js} +1 -1
- package/dist/public/assets/command-D7m0dmA-.js +1 -0
- package/dist/public/assets/context-DW21k43a.js +1 -0
- package/dist/public/assets/{context-menu-CnmULRW3.js → context-menu-CMWkmDu6.js} +1 -1
- package/dist/public/assets/copy-CGsu8426.js +1 -0
- 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-C_x5-hi8.js +1 -0
- package/dist/public/assets/{dist-BCwJL3w9.js → dist-Cde1E3eV.js} +1 -1
- package/dist/public/assets/{dist-DmyIHyF9.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-BfBbMcnA.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-CltyCx0-.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-CTPDNtFu.js → popover-CCHRaCvX.js} +1 -1
- package/dist/public/assets/preview-kind-DiWpvEc0.js +1 -0
- 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-hslkZdX5.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-B9wDgtkQ.js → session-order-f7QxTbVD.js} +1 -1
- package/dist/public/assets/{switch-CeNFnG6w.js → switch-DhNyUV8C.js} +1 -1
- package/dist/public/assets/use-ui-state-CHqXhyx4.js +1 -0
- package/dist/public/assets/{ws-CT7jDKHs.js → ws-CMPCIzY4.js} +1 -1
- package/dist/public/index.html +5 -4
- package/dist/pudl.js +305 -188
- package/package.json +1 -1
- package/dist/public/assets/App-DldUYF2U.js +0 -2
- package/dist/public/assets/Dashboard-Bjrw6phb.js +0 -1
- package/dist/public/assets/EditorTabClose-BunNsUEz.js +0 -1
- package/dist/public/assets/FindWidget-BSK2PIfO.js +0 -1
- package/dist/public/assets/NewProjectDialog-BCtrjbMj.js +0 -1
- package/dist/public/assets/PaneEditorBody-KksboOhO.js +0 -302
- package/dist/public/assets/PdfViewer-CfWAV5F2.js +0 -2
- package/dist/public/assets/SettingsDialog-LIv4FuS1.js +0 -8
- package/dist/public/assets/Workspace-GWsJrLJW.js +0 -20
- package/dist/public/assets/auth-B4b-NPwe.js +0 -64
- package/dist/public/assets/copy-DD43yC2P.js +0 -1
- package/dist/public/assets/dialog-Bnex_wlx.js +0 -1
- package/dist/public/assets/disclosure-BQ-uiP85.js +0 -1
- package/dist/public/assets/dist-Cg-J2BAP.js +0 -1
- package/dist/public/assets/dist-Rswij5M_.js +0 -1
- package/dist/public/assets/errors-C-GJcBJ-.js +0 -1
- package/dist/public/assets/es2015-CrC2hHeB.js +0 -41
- package/dist/public/assets/index-BxtQ6WUO.css +0 -2
- package/dist/public/assets/input-Dx89yXF4.js +0 -1
- package/dist/public/assets/media-refresh-store-WCjZVi4Y.js +0 -1
- package/dist/public/assets/notification-delivery-vK2Y-rON.js +0 -1
- package/dist/public/assets/preview-kind-CJ9RTgbs.js +0 -1
- package/dist/public/assets/protocol-support-Q_1mBit9.js +0 -1
- package/dist/public/assets/select-iSqC2X51.js +0 -1
- package/dist/public/assets/selection-actions-Cith0Z9x.js +0 -1
- package/dist/public/assets/use-ui-state-xScqhALU.js +0 -1
package/dist/index.js
CHANGED
|
@@ -3925,7 +3925,7 @@ import { createInterface } from "node:readline";
|
|
|
3925
3925
|
import { Writable } from "node:stream";
|
|
3926
3926
|
|
|
3927
3927
|
// ../shared/src/protocol.ts
|
|
3928
|
-
var PROTOCOL_VERSION = { major: 25, minor:
|
|
3928
|
+
var PROTOCOL_VERSION = { major: 25, minor: 4 };
|
|
3929
3929
|
|
|
3930
3930
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
3931
3931
|
var external_exports = {};
|
|
@@ -7019,42 +7019,42 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
7019
7019
|
}
|
|
7020
7020
|
doc.write(`const newResult = {};`);
|
|
7021
7021
|
for (const key of normalized.keys) {
|
|
7022
|
-
const
|
|
7022
|
+
const id2 = ids[key];
|
|
7023
7023
|
const k = esc(key);
|
|
7024
7024
|
const schema = shape[key];
|
|
7025
7025
|
const isOptionalIn = schema?._zod?.optin === "optional";
|
|
7026
7026
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
7027
|
-
doc.write(`const ${
|
|
7027
|
+
doc.write(`const ${id2} = ${parseStr(key)};`);
|
|
7028
7028
|
if (isOptionalIn && isOptionalOut) {
|
|
7029
7029
|
doc.write(`
|
|
7030
|
-
if (${
|
|
7030
|
+
if (${id2}.issues.length) {
|
|
7031
7031
|
if (${k} in input) {
|
|
7032
|
-
payload.issues = payload.issues.concat(${
|
|
7032
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
7033
7033
|
...iss,
|
|
7034
7034
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
7035
7035
|
})));
|
|
7036
7036
|
}
|
|
7037
7037
|
}
|
|
7038
7038
|
|
|
7039
|
-
if (${
|
|
7039
|
+
if (${id2}.value === undefined) {
|
|
7040
7040
|
if (${k} in input) {
|
|
7041
7041
|
newResult[${k}] = undefined;
|
|
7042
7042
|
}
|
|
7043
7043
|
} else {
|
|
7044
|
-
newResult[${k}] = ${
|
|
7044
|
+
newResult[${k}] = ${id2}.value;
|
|
7045
7045
|
}
|
|
7046
7046
|
|
|
7047
7047
|
`);
|
|
7048
7048
|
} else if (!isOptionalIn) {
|
|
7049
7049
|
doc.write(`
|
|
7050
|
-
const ${
|
|
7051
|
-
if (${
|
|
7052
|
-
payload.issues = payload.issues.concat(${
|
|
7050
|
+
const ${id2}_present = ${k} in input;
|
|
7051
|
+
if (${id2}.issues.length) {
|
|
7052
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
7053
7053
|
...iss,
|
|
7054
7054
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
7055
7055
|
})));
|
|
7056
7056
|
}
|
|
7057
|
-
if (!${
|
|
7057
|
+
if (!${id2}_present && !${id2}.issues.length) {
|
|
7058
7058
|
payload.issues.push({
|
|
7059
7059
|
code: "invalid_type",
|
|
7060
7060
|
expected: "nonoptional",
|
|
@@ -7063,30 +7063,30 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
7063
7063
|
});
|
|
7064
7064
|
}
|
|
7065
7065
|
|
|
7066
|
-
if (${
|
|
7067
|
-
if (${
|
|
7066
|
+
if (${id2}_present) {
|
|
7067
|
+
if (${id2}.value === undefined) {
|
|
7068
7068
|
newResult[${k}] = undefined;
|
|
7069
7069
|
} else {
|
|
7070
|
-
newResult[${k}] = ${
|
|
7070
|
+
newResult[${k}] = ${id2}.value;
|
|
7071
7071
|
}
|
|
7072
7072
|
}
|
|
7073
7073
|
|
|
7074
7074
|
`);
|
|
7075
7075
|
} else {
|
|
7076
7076
|
doc.write(`
|
|
7077
|
-
if (${
|
|
7078
|
-
payload.issues = payload.issues.concat(${
|
|
7077
|
+
if (${id2}.issues.length) {
|
|
7078
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
7079
7079
|
...iss,
|
|
7080
7080
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
7081
7081
|
})));
|
|
7082
7082
|
}
|
|
7083
7083
|
|
|
7084
|
-
if (${
|
|
7084
|
+
if (${id2}.value === undefined) {
|
|
7085
7085
|
if (${k} in input) {
|
|
7086
7086
|
newResult[${k}] = undefined;
|
|
7087
7087
|
}
|
|
7088
7088
|
} else {
|
|
7089
|
-
newResult[${k}] = ${
|
|
7089
|
+
newResult[${k}] = ${id2}.value;
|
|
7090
7090
|
}
|
|
7091
7091
|
|
|
7092
7092
|
`);
|
|
@@ -15418,26 +15418,26 @@ function extractDefs(ctx, schema) {
|
|
|
15418
15418
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
15419
15419
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
15420
15420
|
for (const entry of ctx.seen.entries()) {
|
|
15421
|
-
const
|
|
15422
|
-
if (
|
|
15423
|
-
const existing = idToSchema.get(
|
|
15421
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
15422
|
+
if (id2) {
|
|
15423
|
+
const existing = idToSchema.get(id2);
|
|
15424
15424
|
if (existing && existing !== entry[0]) {
|
|
15425
|
-
throw new Error(`Duplicate schema id "${
|
|
15425
|
+
throw new Error(`Duplicate schema id "${id2}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
15426
15426
|
}
|
|
15427
|
-
idToSchema.set(
|
|
15427
|
+
idToSchema.set(id2, entry[0]);
|
|
15428
15428
|
}
|
|
15429
15429
|
}
|
|
15430
15430
|
const makeURI = (entry) => {
|
|
15431
15431
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
15432
15432
|
if (ctx.external) {
|
|
15433
15433
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
15434
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
15434
|
+
const uriGenerator = ctx.external.uri ?? ((id3) => id3);
|
|
15435
15435
|
if (externalId) {
|
|
15436
15436
|
return { ref: uriGenerator(externalId) };
|
|
15437
15437
|
}
|
|
15438
|
-
const
|
|
15439
|
-
entry[1].defId =
|
|
15440
|
-
return { defId:
|
|
15438
|
+
const id2 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
15439
|
+
entry[1].defId = id2;
|
|
15440
|
+
return { defId: id2, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id2}` };
|
|
15441
15441
|
}
|
|
15442
15442
|
if (entry[1] === root) {
|
|
15443
15443
|
return { ref: "#" };
|
|
@@ -15485,8 +15485,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15485
15485
|
continue;
|
|
15486
15486
|
}
|
|
15487
15487
|
}
|
|
15488
|
-
const
|
|
15489
|
-
if (
|
|
15488
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
15489
|
+
if (id2) {
|
|
15490
15490
|
extractToDef(entry);
|
|
15491
15491
|
continue;
|
|
15492
15492
|
}
|
|
@@ -15582,10 +15582,10 @@ function finalize(ctx, schema) {
|
|
|
15582
15582
|
} else {
|
|
15583
15583
|
}
|
|
15584
15584
|
if (ctx.external?.uri) {
|
|
15585
|
-
const
|
|
15586
|
-
if (!
|
|
15585
|
+
const id2 = ctx.external.registry.get(schema)?.id;
|
|
15586
|
+
if (!id2)
|
|
15587
15587
|
throw new Error("Schema is missing an `id` property");
|
|
15588
|
-
result.$id = ctx.external.uri(
|
|
15588
|
+
result.$id = ctx.external.uri(id2);
|
|
15589
15589
|
}
|
|
15590
15590
|
Object.assign(result, root.def ?? root.schema);
|
|
15591
15591
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
@@ -15705,29 +15705,29 @@ var formatMap = {
|
|
|
15705
15705
|
// do not set
|
|
15706
15706
|
};
|
|
15707
15707
|
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
15708
|
-
const
|
|
15709
|
-
|
|
15708
|
+
const json4 = _json;
|
|
15709
|
+
json4.type = "string";
|
|
15710
15710
|
const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
|
|
15711
15711
|
if (typeof minimum === "number")
|
|
15712
|
-
|
|
15712
|
+
json4.minLength = minimum;
|
|
15713
15713
|
if (typeof maximum === "number")
|
|
15714
|
-
|
|
15714
|
+
json4.maxLength = maximum;
|
|
15715
15715
|
if (format) {
|
|
15716
|
-
|
|
15717
|
-
if (
|
|
15718
|
-
delete
|
|
15716
|
+
json4.format = formatMap[format] ?? format;
|
|
15717
|
+
if (json4.format === "")
|
|
15718
|
+
delete json4.format;
|
|
15719
15719
|
if (format === "time") {
|
|
15720
|
-
delete
|
|
15720
|
+
delete json4.format;
|
|
15721
15721
|
}
|
|
15722
15722
|
}
|
|
15723
15723
|
if (contentEncoding)
|
|
15724
|
-
|
|
15724
|
+
json4.contentEncoding = contentEncoding;
|
|
15725
15725
|
if (patterns && patterns.size > 0) {
|
|
15726
15726
|
const regexes = [...patterns];
|
|
15727
15727
|
if (regexes.length === 1)
|
|
15728
|
-
|
|
15728
|
+
json4.pattern = regexes[0].source;
|
|
15729
15729
|
else if (regexes.length > 1) {
|
|
15730
|
-
|
|
15730
|
+
json4.allOf = [
|
|
15731
15731
|
...regexes.map((regex) => ({
|
|
15732
15732
|
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
15733
15733
|
pattern: regex.source
|
|
@@ -15737,40 +15737,40 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
15737
15737
|
}
|
|
15738
15738
|
};
|
|
15739
15739
|
var numberProcessor = (schema, ctx, _json, _params) => {
|
|
15740
|
-
const
|
|
15740
|
+
const json4 = _json;
|
|
15741
15741
|
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
15742
15742
|
if (typeof format === "string" && format.includes("int"))
|
|
15743
|
-
|
|
15743
|
+
json4.type = "integer";
|
|
15744
15744
|
else
|
|
15745
|
-
|
|
15745
|
+
json4.type = "number";
|
|
15746
15746
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
15747
15747
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
15748
15748
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
15749
15749
|
if (exMin) {
|
|
15750
15750
|
if (legacy) {
|
|
15751
|
-
|
|
15752
|
-
|
|
15751
|
+
json4.minimum = exclusiveMinimum;
|
|
15752
|
+
json4.exclusiveMinimum = true;
|
|
15753
15753
|
} else {
|
|
15754
|
-
|
|
15754
|
+
json4.exclusiveMinimum = exclusiveMinimum;
|
|
15755
15755
|
}
|
|
15756
15756
|
} else if (typeof minimum === "number") {
|
|
15757
|
-
|
|
15757
|
+
json4.minimum = minimum;
|
|
15758
15758
|
}
|
|
15759
15759
|
if (exMax) {
|
|
15760
15760
|
if (legacy) {
|
|
15761
|
-
|
|
15762
|
-
|
|
15761
|
+
json4.maximum = exclusiveMaximum;
|
|
15762
|
+
json4.exclusiveMaximum = true;
|
|
15763
15763
|
} else {
|
|
15764
|
-
|
|
15764
|
+
json4.exclusiveMaximum = exclusiveMaximum;
|
|
15765
15765
|
}
|
|
15766
15766
|
} else if (typeof maximum === "number") {
|
|
15767
|
-
|
|
15767
|
+
json4.maximum = maximum;
|
|
15768
15768
|
}
|
|
15769
15769
|
if (typeof multipleOf === "number")
|
|
15770
|
-
|
|
15770
|
+
json4.multipleOf = multipleOf;
|
|
15771
15771
|
};
|
|
15772
|
-
var booleanProcessor = (_schema, _ctx,
|
|
15773
|
-
|
|
15772
|
+
var booleanProcessor = (_schema, _ctx, json4, _params) => {
|
|
15773
|
+
json4.type = "boolean";
|
|
15774
15774
|
};
|
|
15775
15775
|
var bigintProcessor = (_schema, ctx, _json, _params) => {
|
|
15776
15776
|
if (ctx.unrepresentable === "throw") {
|
|
@@ -15782,13 +15782,13 @@ var symbolProcessor = (_schema, ctx, _json, _params) => {
|
|
|
15782
15782
|
throw new Error("Symbols cannot be represented in JSON Schema");
|
|
15783
15783
|
}
|
|
15784
15784
|
};
|
|
15785
|
-
var nullProcessor = (_schema, ctx,
|
|
15785
|
+
var nullProcessor = (_schema, ctx, json4, _params) => {
|
|
15786
15786
|
if (ctx.target === "openapi-3.0") {
|
|
15787
|
-
|
|
15788
|
-
|
|
15789
|
-
|
|
15787
|
+
json4.type = "string";
|
|
15788
|
+
json4.nullable = true;
|
|
15789
|
+
json4.enum = [null];
|
|
15790
15790
|
} else {
|
|
15791
|
-
|
|
15791
|
+
json4.type = "null";
|
|
15792
15792
|
}
|
|
15793
15793
|
};
|
|
15794
15794
|
var undefinedProcessor = (_schema, ctx, _json, _params) => {
|
|
@@ -15801,8 +15801,8 @@ var voidProcessor = (_schema, ctx, _json, _params) => {
|
|
|
15801
15801
|
throw new Error("Void cannot be represented in JSON Schema");
|
|
15802
15802
|
}
|
|
15803
15803
|
};
|
|
15804
|
-
var neverProcessor = (_schema, _ctx,
|
|
15805
|
-
|
|
15804
|
+
var neverProcessor = (_schema, _ctx, json4, _params) => {
|
|
15805
|
+
json4.not = {};
|
|
15806
15806
|
};
|
|
15807
15807
|
var anyProcessor = (_schema, _ctx, _json, _params) => {
|
|
15808
15808
|
};
|
|
@@ -15813,16 +15813,16 @@ var dateProcessor = (_schema, ctx, _json, _params) => {
|
|
|
15813
15813
|
throw new Error("Date cannot be represented in JSON Schema");
|
|
15814
15814
|
}
|
|
15815
15815
|
};
|
|
15816
|
-
var enumProcessor = (schema, _ctx,
|
|
15816
|
+
var enumProcessor = (schema, _ctx, json4, _params) => {
|
|
15817
15817
|
const def = schema._zod.def;
|
|
15818
15818
|
const values = getEnumValues(def.entries);
|
|
15819
15819
|
if (values.every((v) => typeof v === "number"))
|
|
15820
|
-
|
|
15820
|
+
json4.type = "number";
|
|
15821
15821
|
if (values.every((v) => typeof v === "string"))
|
|
15822
|
-
|
|
15823
|
-
|
|
15822
|
+
json4.type = "string";
|
|
15823
|
+
json4.enum = values;
|
|
15824
15824
|
};
|
|
15825
|
-
var literalProcessor = (schema, ctx,
|
|
15825
|
+
var literalProcessor = (schema, ctx, json4, _params) => {
|
|
15826
15826
|
const def = schema._zod.def;
|
|
15827
15827
|
const vals = [];
|
|
15828
15828
|
for (const val of def.values) {
|
|
@@ -15844,22 +15844,22 @@ var literalProcessor = (schema, ctx, json3, _params) => {
|
|
|
15844
15844
|
if (vals.length === 0) {
|
|
15845
15845
|
} else if (vals.length === 1) {
|
|
15846
15846
|
const val = vals[0];
|
|
15847
|
-
|
|
15847
|
+
json4.type = val === null ? "null" : typeof val;
|
|
15848
15848
|
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
15849
|
-
|
|
15849
|
+
json4.enum = [val];
|
|
15850
15850
|
} else {
|
|
15851
|
-
|
|
15851
|
+
json4.const = val;
|
|
15852
15852
|
}
|
|
15853
15853
|
} else {
|
|
15854
15854
|
if (vals.every((v) => typeof v === "number"))
|
|
15855
|
-
|
|
15855
|
+
json4.type = "number";
|
|
15856
15856
|
if (vals.every((v) => typeof v === "string"))
|
|
15857
|
-
|
|
15857
|
+
json4.type = "string";
|
|
15858
15858
|
if (vals.every((v) => typeof v === "boolean"))
|
|
15859
|
-
|
|
15859
|
+
json4.type = "boolean";
|
|
15860
15860
|
if (vals.every((v) => v === null))
|
|
15861
|
-
|
|
15862
|
-
|
|
15861
|
+
json4.type = "null";
|
|
15862
|
+
json4.enum = vals;
|
|
15863
15863
|
}
|
|
15864
15864
|
};
|
|
15865
15865
|
var nanProcessor = (_schema, ctx, _json, _params) => {
|
|
@@ -15867,16 +15867,16 @@ var nanProcessor = (_schema, ctx, _json, _params) => {
|
|
|
15867
15867
|
throw new Error("NaN cannot be represented in JSON Schema");
|
|
15868
15868
|
}
|
|
15869
15869
|
};
|
|
15870
|
-
var templateLiteralProcessor = (schema, _ctx,
|
|
15871
|
-
const _json =
|
|
15870
|
+
var templateLiteralProcessor = (schema, _ctx, json4, _params) => {
|
|
15871
|
+
const _json = json4;
|
|
15872
15872
|
const pattern = schema._zod.pattern;
|
|
15873
15873
|
if (!pattern)
|
|
15874
15874
|
throw new Error("Pattern not found in template literal");
|
|
15875
15875
|
_json.type = "string";
|
|
15876
15876
|
_json.pattern = pattern.source;
|
|
15877
15877
|
};
|
|
15878
|
-
var fileProcessor = (schema, _ctx,
|
|
15879
|
-
const _json =
|
|
15878
|
+
var fileProcessor = (schema, _ctx, json4, _params) => {
|
|
15879
|
+
const _json = json4;
|
|
15880
15880
|
const file2 = {
|
|
15881
15881
|
type: "string",
|
|
15882
15882
|
format: "binary",
|
|
@@ -15899,8 +15899,8 @@ var fileProcessor = (schema, _ctx, json3, _params) => {
|
|
|
15899
15899
|
Object.assign(_json, file2);
|
|
15900
15900
|
}
|
|
15901
15901
|
};
|
|
15902
|
-
var successProcessor = (_schema, _ctx,
|
|
15903
|
-
|
|
15902
|
+
var successProcessor = (_schema, _ctx, json4, _params) => {
|
|
15903
|
+
json4.type = "boolean";
|
|
15904
15904
|
};
|
|
15905
15905
|
var customProcessor = (_schema, ctx, _json, _params) => {
|
|
15906
15906
|
if (ctx.unrepresentable === "throw") {
|
|
@@ -15928,27 +15928,27 @@ var setProcessor = (_schema, ctx, _json, _params) => {
|
|
|
15928
15928
|
}
|
|
15929
15929
|
};
|
|
15930
15930
|
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
15931
|
-
const
|
|
15931
|
+
const json4 = _json;
|
|
15932
15932
|
const def = schema._zod.def;
|
|
15933
15933
|
const { minimum, maximum } = schema._zod.bag;
|
|
15934
15934
|
if (typeof minimum === "number")
|
|
15935
|
-
|
|
15935
|
+
json4.minItems = minimum;
|
|
15936
15936
|
if (typeof maximum === "number")
|
|
15937
|
-
|
|
15938
|
-
|
|
15939
|
-
|
|
15937
|
+
json4.maxItems = maximum;
|
|
15938
|
+
json4.type = "array";
|
|
15939
|
+
json4.items = process2(def.element, ctx, {
|
|
15940
15940
|
...params,
|
|
15941
15941
|
path: [...params.path, "items"]
|
|
15942
15942
|
});
|
|
15943
15943
|
};
|
|
15944
15944
|
var objectProcessor = (schema, ctx, _json, params) => {
|
|
15945
|
-
const
|
|
15945
|
+
const json4 = _json;
|
|
15946
15946
|
const def = schema._zod.def;
|
|
15947
|
-
|
|
15948
|
-
|
|
15947
|
+
json4.type = "object";
|
|
15948
|
+
json4.properties = {};
|
|
15949
15949
|
const shape = def.shape;
|
|
15950
15950
|
for (const key in shape) {
|
|
15951
|
-
|
|
15951
|
+
json4.properties[key] = process2(shape[key], ctx, {
|
|
15952
15952
|
...params,
|
|
15953
15953
|
path: [...params.path, "properties", key]
|
|
15954
15954
|
});
|
|
@@ -15963,21 +15963,21 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
15963
15963
|
}
|
|
15964
15964
|
}));
|
|
15965
15965
|
if (requiredKeys.size > 0) {
|
|
15966
|
-
|
|
15966
|
+
json4.required = Array.from(requiredKeys);
|
|
15967
15967
|
}
|
|
15968
15968
|
if (def.catchall?._zod.def.type === "never") {
|
|
15969
|
-
|
|
15969
|
+
json4.additionalProperties = false;
|
|
15970
15970
|
} else if (!def.catchall) {
|
|
15971
15971
|
if (ctx.io === "output")
|
|
15972
|
-
|
|
15972
|
+
json4.additionalProperties = false;
|
|
15973
15973
|
} else if (def.catchall) {
|
|
15974
|
-
|
|
15974
|
+
json4.additionalProperties = process2(def.catchall, ctx, {
|
|
15975
15975
|
...params,
|
|
15976
15976
|
path: [...params.path, "additionalProperties"]
|
|
15977
15977
|
});
|
|
15978
15978
|
}
|
|
15979
15979
|
};
|
|
15980
|
-
var unionProcessor = (schema, ctx,
|
|
15980
|
+
var unionProcessor = (schema, ctx, json4, params) => {
|
|
15981
15981
|
const def = schema._zod.def;
|
|
15982
15982
|
const isExclusive = def.inclusive === false;
|
|
15983
15983
|
const options = def.options.map((x, i) => process2(x, ctx, {
|
|
@@ -15985,12 +15985,12 @@ var unionProcessor = (schema, ctx, json3, params) => {
|
|
|
15985
15985
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
15986
15986
|
}));
|
|
15987
15987
|
if (isExclusive) {
|
|
15988
|
-
|
|
15988
|
+
json4.oneOf = options;
|
|
15989
15989
|
} else {
|
|
15990
|
-
|
|
15990
|
+
json4.anyOf = options;
|
|
15991
15991
|
}
|
|
15992
15992
|
};
|
|
15993
|
-
var intersectionProcessor = (schema, ctx,
|
|
15993
|
+
var intersectionProcessor = (schema, ctx, json4, params) => {
|
|
15994
15994
|
const def = schema._zod.def;
|
|
15995
15995
|
const a = process2(def.left, ctx, {
|
|
15996
15996
|
...params,
|
|
@@ -16005,12 +16005,12 @@ var intersectionProcessor = (schema, ctx, json3, params) => {
|
|
|
16005
16005
|
...isSimpleIntersection(a) ? a.allOf : [a],
|
|
16006
16006
|
...isSimpleIntersection(b) ? b.allOf : [b]
|
|
16007
16007
|
];
|
|
16008
|
-
|
|
16008
|
+
json4.allOf = allOf;
|
|
16009
16009
|
};
|
|
16010
16010
|
var tupleProcessor = (schema, ctx, _json, params) => {
|
|
16011
|
-
const
|
|
16011
|
+
const json4 = _json;
|
|
16012
16012
|
const def = schema._zod.def;
|
|
16013
|
-
|
|
16013
|
+
json4.type = "array";
|
|
16014
16014
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
16015
16015
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
16016
16016
|
const prefixItems = def.items.map((x, i) => process2(x, ctx, {
|
|
@@ -16022,37 +16022,37 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
16022
16022
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
16023
16023
|
}) : null;
|
|
16024
16024
|
if (ctx.target === "draft-2020-12") {
|
|
16025
|
-
|
|
16025
|
+
json4.prefixItems = prefixItems;
|
|
16026
16026
|
if (rest) {
|
|
16027
|
-
|
|
16027
|
+
json4.items = rest;
|
|
16028
16028
|
}
|
|
16029
16029
|
} else if (ctx.target === "openapi-3.0") {
|
|
16030
|
-
|
|
16030
|
+
json4.items = {
|
|
16031
16031
|
anyOf: prefixItems
|
|
16032
16032
|
};
|
|
16033
16033
|
if (rest) {
|
|
16034
|
-
|
|
16034
|
+
json4.items.anyOf.push(rest);
|
|
16035
16035
|
}
|
|
16036
|
-
|
|
16036
|
+
json4.minItems = prefixItems.length;
|
|
16037
16037
|
if (!rest) {
|
|
16038
|
-
|
|
16038
|
+
json4.maxItems = prefixItems.length;
|
|
16039
16039
|
}
|
|
16040
16040
|
} else {
|
|
16041
|
-
|
|
16041
|
+
json4.items = prefixItems;
|
|
16042
16042
|
if (rest) {
|
|
16043
|
-
|
|
16043
|
+
json4.additionalItems = rest;
|
|
16044
16044
|
}
|
|
16045
16045
|
}
|
|
16046
16046
|
const { minimum, maximum } = schema._zod.bag;
|
|
16047
16047
|
if (typeof minimum === "number")
|
|
16048
|
-
|
|
16048
|
+
json4.minItems = minimum;
|
|
16049
16049
|
if (typeof maximum === "number")
|
|
16050
|
-
|
|
16050
|
+
json4.maxItems = maximum;
|
|
16051
16051
|
};
|
|
16052
16052
|
var recordProcessor = (schema, ctx, _json, params) => {
|
|
16053
|
-
const
|
|
16053
|
+
const json4 = _json;
|
|
16054
16054
|
const def = schema._zod.def;
|
|
16055
|
-
|
|
16055
|
+
json4.type = "object";
|
|
16056
16056
|
const keyType = def.keyType;
|
|
16057
16057
|
const keyBag = keyType._zod.bag;
|
|
16058
16058
|
const patterns = keyBag?.patterns;
|
|
@@ -16061,18 +16061,18 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16061
16061
|
...params,
|
|
16062
16062
|
path: [...params.path, "patternProperties", "*"]
|
|
16063
16063
|
});
|
|
16064
|
-
|
|
16064
|
+
json4.patternProperties = {};
|
|
16065
16065
|
for (const pattern of patterns) {
|
|
16066
|
-
|
|
16066
|
+
json4.patternProperties[pattern.source] = valueSchema;
|
|
16067
16067
|
}
|
|
16068
16068
|
} else {
|
|
16069
16069
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
16070
|
-
|
|
16070
|
+
json4.propertyNames = process2(def.keyType, ctx, {
|
|
16071
16071
|
...params,
|
|
16072
16072
|
path: [...params.path, "propertyNames"]
|
|
16073
16073
|
});
|
|
16074
16074
|
}
|
|
16075
|
-
|
|
16075
|
+
json4.additionalProperties = process2(def.valueType, ctx, {
|
|
16076
16076
|
...params,
|
|
16077
16077
|
path: [...params.path, "additionalProperties"]
|
|
16078
16078
|
});
|
|
@@ -16081,19 +16081,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16081
16081
|
if (keyValues) {
|
|
16082
16082
|
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
16083
16083
|
if (validKeyValues.length > 0) {
|
|
16084
|
-
|
|
16084
|
+
json4.required = validKeyValues;
|
|
16085
16085
|
}
|
|
16086
16086
|
}
|
|
16087
16087
|
};
|
|
16088
|
-
var nullableProcessor = (schema, ctx,
|
|
16088
|
+
var nullableProcessor = (schema, ctx, json4, params) => {
|
|
16089
16089
|
const def = schema._zod.def;
|
|
16090
16090
|
const inner = process2(def.innerType, ctx, params);
|
|
16091
16091
|
const seen = ctx.seen.get(schema);
|
|
16092
16092
|
if (ctx.target === "openapi-3.0") {
|
|
16093
16093
|
seen.ref = def.innerType;
|
|
16094
|
-
|
|
16094
|
+
json4.nullable = true;
|
|
16095
16095
|
} else {
|
|
16096
|
-
|
|
16096
|
+
json4.anyOf = [inner, { type: "null" }];
|
|
16097
16097
|
}
|
|
16098
16098
|
};
|
|
16099
16099
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
@@ -16102,22 +16102,22 @@ var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
|
16102
16102
|
const seen = ctx.seen.get(schema);
|
|
16103
16103
|
seen.ref = def.innerType;
|
|
16104
16104
|
};
|
|
16105
|
-
var defaultProcessor = (schema, ctx,
|
|
16105
|
+
var defaultProcessor = (schema, ctx, json4, params) => {
|
|
16106
16106
|
const def = schema._zod.def;
|
|
16107
16107
|
process2(def.innerType, ctx, params);
|
|
16108
16108
|
const seen = ctx.seen.get(schema);
|
|
16109
16109
|
seen.ref = def.innerType;
|
|
16110
|
-
|
|
16110
|
+
json4.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
16111
16111
|
};
|
|
16112
|
-
var prefaultProcessor = (schema, ctx,
|
|
16112
|
+
var prefaultProcessor = (schema, ctx, json4, params) => {
|
|
16113
16113
|
const def = schema._zod.def;
|
|
16114
16114
|
process2(def.innerType, ctx, params);
|
|
16115
16115
|
const seen = ctx.seen.get(schema);
|
|
16116
16116
|
seen.ref = def.innerType;
|
|
16117
16117
|
if (ctx.io === "input")
|
|
16118
|
-
|
|
16118
|
+
json4._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
16119
16119
|
};
|
|
16120
|
-
var catchProcessor = (schema, ctx,
|
|
16120
|
+
var catchProcessor = (schema, ctx, json4, params) => {
|
|
16121
16121
|
const def = schema._zod.def;
|
|
16122
16122
|
process2(def.innerType, ctx, params);
|
|
16123
16123
|
const seen = ctx.seen.get(schema);
|
|
@@ -16128,7 +16128,7 @@ var catchProcessor = (schema, ctx, json3, params) => {
|
|
|
16128
16128
|
} catch {
|
|
16129
16129
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
16130
16130
|
}
|
|
16131
|
-
|
|
16131
|
+
json4.default = catchValue;
|
|
16132
16132
|
};
|
|
16133
16133
|
var pipeProcessor = (schema, ctx, _json, params) => {
|
|
16134
16134
|
const def = schema._zod.def;
|
|
@@ -16138,12 +16138,12 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
16138
16138
|
const seen = ctx.seen.get(schema);
|
|
16139
16139
|
seen.ref = innerType;
|
|
16140
16140
|
};
|
|
16141
|
-
var readonlyProcessor = (schema, ctx,
|
|
16141
|
+
var readonlyProcessor = (schema, ctx, json4, params) => {
|
|
16142
16142
|
const def = schema._zod.def;
|
|
16143
16143
|
process2(def.innerType, ctx, params);
|
|
16144
16144
|
const seen = ctx.seen.get(schema);
|
|
16145
16145
|
seen.ref = def.innerType;
|
|
16146
|
-
|
|
16146
|
+
json4.readOnly = true;
|
|
16147
16147
|
};
|
|
16148
16148
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
16149
16149
|
const def = schema._zod.def;
|
|
@@ -16787,7 +16787,7 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
16787
16787
|
var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
16788
16788
|
$ZodString.init(inst, def);
|
|
16789
16789
|
ZodType.init(inst, def);
|
|
16790
|
-
inst._zod.processJSONSchema = (ctx,
|
|
16790
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => stringProcessor(inst, ctx, json4, params);
|
|
16791
16791
|
const bag = inst._zod.bag;
|
|
16792
16792
|
inst.format = bag.format ?? null;
|
|
16793
16793
|
inst.minLength = bag.minimum ?? null;
|
|
@@ -17058,7 +17058,7 @@ function hash(alg, params) {
|
|
|
17058
17058
|
var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
17059
17059
|
$ZodNumber.init(inst, def);
|
|
17060
17060
|
ZodType.init(inst, def);
|
|
17061
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17061
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => numberProcessor(inst, ctx, json4, params);
|
|
17062
17062
|
_installLazyMethods(inst, "ZodNumber", {
|
|
17063
17063
|
gt(value, params) {
|
|
17064
17064
|
return this.check(_gt(value, params));
|
|
@@ -17138,7 +17138,7 @@ function uint32(params) {
|
|
|
17138
17138
|
var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
17139
17139
|
$ZodBoolean.init(inst, def);
|
|
17140
17140
|
ZodType.init(inst, def);
|
|
17141
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17141
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => booleanProcessor(inst, ctx, json4, params);
|
|
17142
17142
|
});
|
|
17143
17143
|
function boolean2(params) {
|
|
17144
17144
|
return _boolean(ZodBoolean, params);
|
|
@@ -17146,7 +17146,7 @@ function boolean2(params) {
|
|
|
17146
17146
|
var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
|
|
17147
17147
|
$ZodBigInt.init(inst, def);
|
|
17148
17148
|
ZodType.init(inst, def);
|
|
17149
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17149
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => bigintProcessor(inst, ctx, json4, params);
|
|
17150
17150
|
inst.gte = (value, params) => inst.check(_gte(value, params));
|
|
17151
17151
|
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
17152
17152
|
inst.gt = (value, params) => inst.check(_gt(value, params));
|
|
@@ -17181,7 +17181,7 @@ function uint64(params) {
|
|
|
17181
17181
|
var ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => {
|
|
17182
17182
|
$ZodSymbol.init(inst, def);
|
|
17183
17183
|
ZodType.init(inst, def);
|
|
17184
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17184
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => symbolProcessor(inst, ctx, json4, params);
|
|
17185
17185
|
});
|
|
17186
17186
|
function symbol(params) {
|
|
17187
17187
|
return _symbol(ZodSymbol, params);
|
|
@@ -17189,7 +17189,7 @@ function symbol(params) {
|
|
|
17189
17189
|
var ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => {
|
|
17190
17190
|
$ZodUndefined.init(inst, def);
|
|
17191
17191
|
ZodType.init(inst, def);
|
|
17192
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17192
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => undefinedProcessor(inst, ctx, json4, params);
|
|
17193
17193
|
});
|
|
17194
17194
|
function _undefined3(params) {
|
|
17195
17195
|
return _undefined2(ZodUndefined, params);
|
|
@@ -17197,7 +17197,7 @@ function _undefined3(params) {
|
|
|
17197
17197
|
var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
17198
17198
|
$ZodNull.init(inst, def);
|
|
17199
17199
|
ZodType.init(inst, def);
|
|
17200
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17200
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => nullProcessor(inst, ctx, json4, params);
|
|
17201
17201
|
});
|
|
17202
17202
|
function _null3(params) {
|
|
17203
17203
|
return _null2(ZodNull, params);
|
|
@@ -17205,7 +17205,7 @@ function _null3(params) {
|
|
|
17205
17205
|
var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
|
|
17206
17206
|
$ZodAny.init(inst, def);
|
|
17207
17207
|
ZodType.init(inst, def);
|
|
17208
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17208
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => anyProcessor(inst, ctx, json4, params);
|
|
17209
17209
|
});
|
|
17210
17210
|
function any() {
|
|
17211
17211
|
return _any(ZodAny);
|
|
@@ -17213,7 +17213,7 @@ function any() {
|
|
|
17213
17213
|
var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
17214
17214
|
$ZodUnknown.init(inst, def);
|
|
17215
17215
|
ZodType.init(inst, def);
|
|
17216
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17216
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => unknownProcessor(inst, ctx, json4, params);
|
|
17217
17217
|
});
|
|
17218
17218
|
function unknown() {
|
|
17219
17219
|
return _unknown(ZodUnknown);
|
|
@@ -17221,7 +17221,7 @@ function unknown() {
|
|
|
17221
17221
|
var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
17222
17222
|
$ZodNever.init(inst, def);
|
|
17223
17223
|
ZodType.init(inst, def);
|
|
17224
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17224
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => neverProcessor(inst, ctx, json4, params);
|
|
17225
17225
|
});
|
|
17226
17226
|
function never(params) {
|
|
17227
17227
|
return _never(ZodNever, params);
|
|
@@ -17229,7 +17229,7 @@ function never(params) {
|
|
|
17229
17229
|
var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
|
|
17230
17230
|
$ZodVoid.init(inst, def);
|
|
17231
17231
|
ZodType.init(inst, def);
|
|
17232
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17232
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => voidProcessor(inst, ctx, json4, params);
|
|
17233
17233
|
});
|
|
17234
17234
|
function _void2(params) {
|
|
17235
17235
|
return _void(ZodVoid, params);
|
|
@@ -17237,7 +17237,7 @@ function _void2(params) {
|
|
|
17237
17237
|
var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
|
|
17238
17238
|
$ZodDate.init(inst, def);
|
|
17239
17239
|
ZodType.init(inst, def);
|
|
17240
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17240
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => dateProcessor(inst, ctx, json4, params);
|
|
17241
17241
|
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
17242
17242
|
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
17243
17243
|
const c = inst._zod.bag;
|
|
@@ -17250,7 +17250,7 @@ function date3(params) {
|
|
|
17250
17250
|
var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
17251
17251
|
$ZodArray.init(inst, def);
|
|
17252
17252
|
ZodType.init(inst, def);
|
|
17253
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17253
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => arrayProcessor(inst, ctx, json4, params);
|
|
17254
17254
|
inst.element = def.element;
|
|
17255
17255
|
_installLazyMethods(inst, "ZodArray", {
|
|
17256
17256
|
min(n, params) {
|
|
@@ -17280,7 +17280,7 @@ function keyof(schema) {
|
|
|
17280
17280
|
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
17281
17281
|
$ZodObjectJIT.init(inst, def);
|
|
17282
17282
|
ZodType.init(inst, def);
|
|
17283
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17283
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => objectProcessor(inst, ctx, json4, params);
|
|
17284
17284
|
util_exports.defineLazy(inst, "shape", () => {
|
|
17285
17285
|
return def.shape;
|
|
17286
17286
|
});
|
|
@@ -17353,7 +17353,7 @@ function looseObject(shape, params) {
|
|
|
17353
17353
|
var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
17354
17354
|
$ZodUnion.init(inst, def);
|
|
17355
17355
|
ZodType.init(inst, def);
|
|
17356
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17356
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => unionProcessor(inst, ctx, json4, params);
|
|
17357
17357
|
inst.options = def.options;
|
|
17358
17358
|
});
|
|
17359
17359
|
function union(options, params) {
|
|
@@ -17366,7 +17366,7 @@ function union(options, params) {
|
|
|
17366
17366
|
var ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => {
|
|
17367
17367
|
ZodUnion.init(inst, def);
|
|
17368
17368
|
$ZodXor.init(inst, def);
|
|
17369
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17369
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => unionProcessor(inst, ctx, json4, params);
|
|
17370
17370
|
inst.options = def.options;
|
|
17371
17371
|
});
|
|
17372
17372
|
function xor(options, params) {
|
|
@@ -17392,7 +17392,7 @@ function discriminatedUnion(discriminator, options, params) {
|
|
|
17392
17392
|
var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
17393
17393
|
$ZodIntersection.init(inst, def);
|
|
17394
17394
|
ZodType.init(inst, def);
|
|
17395
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17395
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => intersectionProcessor(inst, ctx, json4, params);
|
|
17396
17396
|
});
|
|
17397
17397
|
function intersection(left, right) {
|
|
17398
17398
|
return new ZodIntersection({
|
|
@@ -17404,7 +17404,7 @@ function intersection(left, right) {
|
|
|
17404
17404
|
var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
|
|
17405
17405
|
$ZodTuple.init(inst, def);
|
|
17406
17406
|
ZodType.init(inst, def);
|
|
17407
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17407
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => tupleProcessor(inst, ctx, json4, params);
|
|
17408
17408
|
inst.rest = (rest) => inst.clone({
|
|
17409
17409
|
...inst._zod.def,
|
|
17410
17410
|
rest
|
|
@@ -17424,7 +17424,7 @@ function tuple(items, _paramsOrRest, _params) {
|
|
|
17424
17424
|
var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
17425
17425
|
$ZodRecord.init(inst, def);
|
|
17426
17426
|
ZodType.init(inst, def);
|
|
17427
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17427
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => recordProcessor(inst, ctx, json4, params);
|
|
17428
17428
|
inst.keyType = def.keyType;
|
|
17429
17429
|
inst.valueType = def.valueType;
|
|
17430
17430
|
});
|
|
@@ -17466,7 +17466,7 @@ function looseRecord(keyType, valueType, params) {
|
|
|
17466
17466
|
var ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => {
|
|
17467
17467
|
$ZodMap.init(inst, def);
|
|
17468
17468
|
ZodType.init(inst, def);
|
|
17469
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17469
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => mapProcessor(inst, ctx, json4, params);
|
|
17470
17470
|
inst.keyType = def.keyType;
|
|
17471
17471
|
inst.valueType = def.valueType;
|
|
17472
17472
|
inst.min = (...args) => inst.check(_minSize(...args));
|
|
@@ -17485,7 +17485,7 @@ function map(keyType, valueType, params) {
|
|
|
17485
17485
|
var ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
|
|
17486
17486
|
$ZodSet.init(inst, def);
|
|
17487
17487
|
ZodType.init(inst, def);
|
|
17488
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17488
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => setProcessor(inst, ctx, json4, params);
|
|
17489
17489
|
inst.min = (...args) => inst.check(_minSize(...args));
|
|
17490
17490
|
inst.nonempty = (params) => inst.check(_minSize(1, params));
|
|
17491
17491
|
inst.max = (...args) => inst.check(_maxSize(...args));
|
|
@@ -17501,7 +17501,7 @@ function set(valueType, params) {
|
|
|
17501
17501
|
var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
17502
17502
|
$ZodEnum.init(inst, def);
|
|
17503
17503
|
ZodType.init(inst, def);
|
|
17504
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17504
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => enumProcessor(inst, ctx, json4, params);
|
|
17505
17505
|
inst.enum = def.entries;
|
|
17506
17506
|
inst.options = Object.values(def.entries);
|
|
17507
17507
|
const keys = new Set(Object.keys(def.entries));
|
|
@@ -17554,7 +17554,7 @@ function nativeEnum(entries, params) {
|
|
|
17554
17554
|
var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
|
|
17555
17555
|
$ZodLiteral.init(inst, def);
|
|
17556
17556
|
ZodType.init(inst, def);
|
|
17557
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17557
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => literalProcessor(inst, ctx, json4, params);
|
|
17558
17558
|
inst.values = new Set(def.values);
|
|
17559
17559
|
Object.defineProperty(inst, "value", {
|
|
17560
17560
|
get() {
|
|
@@ -17575,7 +17575,7 @@ function literal(value, params) {
|
|
|
17575
17575
|
var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
|
|
17576
17576
|
$ZodFile.init(inst, def);
|
|
17577
17577
|
ZodType.init(inst, def);
|
|
17578
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17578
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => fileProcessor(inst, ctx, json4, params);
|
|
17579
17579
|
inst.min = (size, params) => inst.check(_minSize(size, params));
|
|
17580
17580
|
inst.max = (size, params) => inst.check(_maxSize(size, params));
|
|
17581
17581
|
inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params));
|
|
@@ -17586,7 +17586,7 @@ function file(params) {
|
|
|
17586
17586
|
var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
17587
17587
|
$ZodTransform.init(inst, def);
|
|
17588
17588
|
ZodType.init(inst, def);
|
|
17589
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17589
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => transformProcessor(inst, ctx, json4, params);
|
|
17590
17590
|
inst._zod.parse = (payload, _ctx) => {
|
|
17591
17591
|
if (_ctx.direction === "backward") {
|
|
17592
17592
|
throw new $ZodEncodeError(inst.constructor.name);
|
|
@@ -17626,7 +17626,7 @@ function transform(fn) {
|
|
|
17626
17626
|
var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
17627
17627
|
$ZodOptional.init(inst, def);
|
|
17628
17628
|
ZodType.init(inst, def);
|
|
17629
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17629
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => optionalProcessor(inst, ctx, json4, params);
|
|
17630
17630
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
17631
17631
|
});
|
|
17632
17632
|
function optional(innerType) {
|
|
@@ -17638,7 +17638,7 @@ function optional(innerType) {
|
|
|
17638
17638
|
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
17639
17639
|
$ZodExactOptional.init(inst, def);
|
|
17640
17640
|
ZodType.init(inst, def);
|
|
17641
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17641
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => optionalProcessor(inst, ctx, json4, params);
|
|
17642
17642
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
17643
17643
|
});
|
|
17644
17644
|
function exactOptional(innerType) {
|
|
@@ -17650,7 +17650,7 @@ function exactOptional(innerType) {
|
|
|
17650
17650
|
var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
17651
17651
|
$ZodNullable.init(inst, def);
|
|
17652
17652
|
ZodType.init(inst, def);
|
|
17653
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17653
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => nullableProcessor(inst, ctx, json4, params);
|
|
17654
17654
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
17655
17655
|
});
|
|
17656
17656
|
function nullable(innerType) {
|
|
@@ -17665,7 +17665,7 @@ function nullish2(innerType) {
|
|
|
17665
17665
|
var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
17666
17666
|
$ZodDefault.init(inst, def);
|
|
17667
17667
|
ZodType.init(inst, def);
|
|
17668
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17668
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => defaultProcessor(inst, ctx, json4, params);
|
|
17669
17669
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
17670
17670
|
inst.removeDefault = inst.unwrap;
|
|
17671
17671
|
});
|
|
@@ -17681,7 +17681,7 @@ function _default2(innerType, defaultValue) {
|
|
|
17681
17681
|
var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
17682
17682
|
$ZodPrefault.init(inst, def);
|
|
17683
17683
|
ZodType.init(inst, def);
|
|
17684
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17684
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => prefaultProcessor(inst, ctx, json4, params);
|
|
17685
17685
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
17686
17686
|
});
|
|
17687
17687
|
function prefault(innerType, defaultValue) {
|
|
@@ -17696,7 +17696,7 @@ function prefault(innerType, defaultValue) {
|
|
|
17696
17696
|
var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
17697
17697
|
$ZodNonOptional.init(inst, def);
|
|
17698
17698
|
ZodType.init(inst, def);
|
|
17699
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17699
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => nonoptionalProcessor(inst, ctx, json4, params);
|
|
17700
17700
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
17701
17701
|
});
|
|
17702
17702
|
function nonoptional(innerType, params) {
|
|
@@ -17709,7 +17709,7 @@ function nonoptional(innerType, params) {
|
|
|
17709
17709
|
var ZodSuccess = /* @__PURE__ */ $constructor("ZodSuccess", (inst, def) => {
|
|
17710
17710
|
$ZodSuccess.init(inst, def);
|
|
17711
17711
|
ZodType.init(inst, def);
|
|
17712
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17712
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => successProcessor(inst, ctx, json4, params);
|
|
17713
17713
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
17714
17714
|
});
|
|
17715
17715
|
function success(innerType) {
|
|
@@ -17721,7 +17721,7 @@ function success(innerType) {
|
|
|
17721
17721
|
var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
17722
17722
|
$ZodCatch.init(inst, def);
|
|
17723
17723
|
ZodType.init(inst, def);
|
|
17724
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17724
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => catchProcessor(inst, ctx, json4, params);
|
|
17725
17725
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
17726
17726
|
inst.removeCatch = inst.unwrap;
|
|
17727
17727
|
});
|
|
@@ -17735,7 +17735,7 @@ function _catch2(innerType, catchValue) {
|
|
|
17735
17735
|
var ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => {
|
|
17736
17736
|
$ZodNaN.init(inst, def);
|
|
17737
17737
|
ZodType.init(inst, def);
|
|
17738
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17738
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => nanProcessor(inst, ctx, json4, params);
|
|
17739
17739
|
});
|
|
17740
17740
|
function nan(params) {
|
|
17741
17741
|
return _nan(ZodNaN, params);
|
|
@@ -17743,7 +17743,7 @@ function nan(params) {
|
|
|
17743
17743
|
var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
17744
17744
|
$ZodPipe.init(inst, def);
|
|
17745
17745
|
ZodType.init(inst, def);
|
|
17746
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17746
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => pipeProcessor(inst, ctx, json4, params);
|
|
17747
17747
|
inst.in = def.in;
|
|
17748
17748
|
inst.out = def.out;
|
|
17749
17749
|
});
|
|
@@ -17785,7 +17785,7 @@ var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) =>
|
|
|
17785
17785
|
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
17786
17786
|
$ZodReadonly.init(inst, def);
|
|
17787
17787
|
ZodType.init(inst, def);
|
|
17788
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17788
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => readonlyProcessor(inst, ctx, json4, params);
|
|
17789
17789
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
17790
17790
|
});
|
|
17791
17791
|
function readonly(innerType) {
|
|
@@ -17797,7 +17797,7 @@ function readonly(innerType) {
|
|
|
17797
17797
|
var ZodTemplateLiteral = /* @__PURE__ */ $constructor("ZodTemplateLiteral", (inst, def) => {
|
|
17798
17798
|
$ZodTemplateLiteral.init(inst, def);
|
|
17799
17799
|
ZodType.init(inst, def);
|
|
17800
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17800
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => templateLiteralProcessor(inst, ctx, json4, params);
|
|
17801
17801
|
});
|
|
17802
17802
|
function templateLiteral(parts, params) {
|
|
17803
17803
|
return new ZodTemplateLiteral({
|
|
@@ -17809,7 +17809,7 @@ function templateLiteral(parts, params) {
|
|
|
17809
17809
|
var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
|
|
17810
17810
|
$ZodLazy.init(inst, def);
|
|
17811
17811
|
ZodType.init(inst, def);
|
|
17812
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17812
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => lazyProcessor(inst, ctx, json4, params);
|
|
17813
17813
|
inst.unwrap = () => inst._zod.def.getter();
|
|
17814
17814
|
});
|
|
17815
17815
|
function lazy(getter) {
|
|
@@ -17821,7 +17821,7 @@ function lazy(getter) {
|
|
|
17821
17821
|
var ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => {
|
|
17822
17822
|
$ZodPromise.init(inst, def);
|
|
17823
17823
|
ZodType.init(inst, def);
|
|
17824
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17824
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => promiseProcessor(inst, ctx, json4, params);
|
|
17825
17825
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
17826
17826
|
});
|
|
17827
17827
|
function promise(innerType) {
|
|
@@ -17833,7 +17833,7 @@ function promise(innerType) {
|
|
|
17833
17833
|
var ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => {
|
|
17834
17834
|
$ZodFunction.init(inst, def);
|
|
17835
17835
|
ZodType.init(inst, def);
|
|
17836
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17836
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => functionProcessor(inst, ctx, json4, params);
|
|
17837
17837
|
});
|
|
17838
17838
|
function _function(params) {
|
|
17839
17839
|
return new ZodFunction({
|
|
@@ -17845,7 +17845,7 @@ function _function(params) {
|
|
|
17845
17845
|
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
17846
17846
|
$ZodCustom.init(inst, def);
|
|
17847
17847
|
ZodType.init(inst, def);
|
|
17848
|
-
inst._zod.processJSONSchema = (ctx,
|
|
17848
|
+
inst._zod.processJSONSchema = (ctx, json4, params) => customProcessor(inst, ctx, json4, params);
|
|
17849
17849
|
});
|
|
17850
17850
|
function check(fn) {
|
|
17851
17851
|
const ch = new $ZodCheck({
|
|
@@ -20355,6 +20355,123 @@ var puddlangMcpTools = definitions.map(([name, description, schema, readOnlyHint
|
|
|
20355
20355
|
}
|
|
20356
20356
|
}));
|
|
20357
20357
|
|
|
20358
|
+
// ../shared/src/api/notebook-execution.ts
|
|
20359
|
+
var cellId = external_exports.string().min(1).max(128);
|
|
20360
|
+
var cellSource = external_exports.object({ id: cellId, source: external_exports.string().max(1024 * 1024) });
|
|
20361
|
+
var notebookExecuteSchema = external_exports.object({
|
|
20362
|
+
source: compilationFileTargetSchema,
|
|
20363
|
+
cells: external_exports.array(cellSource).min(1).max(2e3),
|
|
20364
|
+
kernel: external_exports.string().min(1).max(256).optional()
|
|
20365
|
+
}).refine(
|
|
20366
|
+
(request) => new Set(request.cells.map((cell) => cell.id)).size === request.cells.length,
|
|
20367
|
+
"Cell ids must be unique"
|
|
20368
|
+
).refine(
|
|
20369
|
+
(request) => request.cells.reduce((length, cell) => length + cell.source.length, 0) <= 1024 * 1024,
|
|
20370
|
+
"Cell sources exceed 1 MiB"
|
|
20371
|
+
);
|
|
20372
|
+
var notebookExecutionCellSchema = cellSource.extend({
|
|
20373
|
+
revision: external_exports.number().int().nonnegative().default(0),
|
|
20374
|
+
state: external_exports.enum(["queued", "running", "succeeded", "failed", "cancelled"]),
|
|
20375
|
+
execution_count: external_exports.number().int().nullable(),
|
|
20376
|
+
outputs: external_exports.array(external_exports.looseObject({ output_type: external_exports.string() })),
|
|
20377
|
+
elapsed_ms: external_exports.number().nonnegative().optional()
|
|
20378
|
+
});
|
|
20379
|
+
var notebookInputSchema = external_exports.object({
|
|
20380
|
+
id: external_exports.string().uuid(),
|
|
20381
|
+
prompt: external_exports.string().max(4096),
|
|
20382
|
+
password: external_exports.boolean()
|
|
20383
|
+
});
|
|
20384
|
+
var notebookExecutionSchema = external_exports.object({
|
|
20385
|
+
id: external_exports.string().uuid(),
|
|
20386
|
+
revision: external_exports.number().int().nonnegative(),
|
|
20387
|
+
state: external_exports.enum(["running", "succeeded", "failed", "cancelled"]),
|
|
20388
|
+
cells: external_exports.array(notebookExecutionCellSchema).max(2e3),
|
|
20389
|
+
input: notebookInputSchema.optional(),
|
|
20390
|
+
error: external_exports.string().max(32768).optional()
|
|
20391
|
+
});
|
|
20392
|
+
var notebookExecutionRequestSchema = external_exports.object({ source: compilationFileTargetSchema });
|
|
20393
|
+
var notebookExecutionResponseSchema = external_exports.object({
|
|
20394
|
+
execution: notebookExecutionSchema.nullable()
|
|
20395
|
+
});
|
|
20396
|
+
var notebookInputReplySchema = external_exports.object({
|
|
20397
|
+
source: compilationFileTargetSchema,
|
|
20398
|
+
run_id: external_exports.string().uuid(),
|
|
20399
|
+
input_id: external_exports.string().uuid(),
|
|
20400
|
+
value: external_exports.string().max(65536)
|
|
20401
|
+
});
|
|
20402
|
+
|
|
20403
|
+
// ../shared/src/api/notebook-intelligence.ts
|
|
20404
|
+
var notebookIntelligenceRequestSchema = external_exports.object({
|
|
20405
|
+
source: compilationFileTargetSchema,
|
|
20406
|
+
kind: external_exports.enum(["complete", "inspect"]),
|
|
20407
|
+
code: external_exports.string().max(65536),
|
|
20408
|
+
/** Jupyter positions count Unicode codepoints, not UTF-16 units. */
|
|
20409
|
+
cursor: external_exports.number().int().nonnegative().max(65536)
|
|
20410
|
+
}).refine((value) => value.cursor <= [...value.code].length, "Cursor is outside the cell");
|
|
20411
|
+
var notebookIntelligenceResponseSchema = external_exports.object({
|
|
20412
|
+
matches: external_exports.array(external_exports.string().max(512)).max(200),
|
|
20413
|
+
start: external_exports.number().int().nonnegative(),
|
|
20414
|
+
end: external_exports.number().int().nonnegative(),
|
|
20415
|
+
documentation: external_exports.string().max(32768)
|
|
20416
|
+
});
|
|
20417
|
+
|
|
20418
|
+
// ../shared/src/api/notebook-widgets.ts
|
|
20419
|
+
var id = external_exports.string().min(1).max(128);
|
|
20420
|
+
var json2 = external_exports.record(external_exports.string(), external_exports.unknown());
|
|
20421
|
+
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}=)?$/);
|
|
20422
|
+
var notebookWidgetMessageSchema = external_exports.object({
|
|
20423
|
+
msg_id: id,
|
|
20424
|
+
parent_id: external_exports.string().max(128).default(""),
|
|
20425
|
+
msg_type: external_exports.enum(["comm_open", "comm_msg", "comm_close", "status"]),
|
|
20426
|
+
content: json2,
|
|
20427
|
+
metadata: json2.default({}),
|
|
20428
|
+
buffers: external_exports.array(binary).max(128).default([])
|
|
20429
|
+
});
|
|
20430
|
+
var notebookWidgetStateSchema = external_exports.object({
|
|
20431
|
+
version_major: external_exports.literal(2),
|
|
20432
|
+
version_minor: external_exports.literal(0),
|
|
20433
|
+
state: external_exports.record(
|
|
20434
|
+
id,
|
|
20435
|
+
external_exports.object({
|
|
20436
|
+
model_name: external_exports.string().max(256),
|
|
20437
|
+
model_module: external_exports.string().max(256),
|
|
20438
|
+
model_module_version: external_exports.string().max(128),
|
|
20439
|
+
state: json2,
|
|
20440
|
+
buffers: external_exports.array(
|
|
20441
|
+
external_exports.object({
|
|
20442
|
+
encoding: external_exports.literal("base64"),
|
|
20443
|
+
path: external_exports.array(external_exports.union([external_exports.string().max(256), external_exports.number().int().nonnegative()])).max(64),
|
|
20444
|
+
data: binary
|
|
20445
|
+
})
|
|
20446
|
+
).max(128).optional()
|
|
20447
|
+
})
|
|
20448
|
+
).refine((state) => Object.keys(state).length <= 1024, "Too many widget models")
|
|
20449
|
+
});
|
|
20450
|
+
var notebookWidgetsRequestSchema = external_exports.object({
|
|
20451
|
+
source: compilationFileTargetSchema,
|
|
20452
|
+
generation: external_exports.string().uuid().optional(),
|
|
20453
|
+
after: external_exports.number().int().nonnegative().optional()
|
|
20454
|
+
});
|
|
20455
|
+
var notebookWidgetsResponseSchema = external_exports.object({
|
|
20456
|
+
generation: external_exports.string().uuid().nullable(),
|
|
20457
|
+
revision: external_exports.number().int().nonnegative(),
|
|
20458
|
+
snapshot: notebookWidgetStateSchema.optional(),
|
|
20459
|
+
events: external_exports.array(notebookWidgetMessageSchema).max(256),
|
|
20460
|
+
error: external_exports.string().max(1024).optional()
|
|
20461
|
+
});
|
|
20462
|
+
var notebookWidgetCommSchema = external_exports.object({
|
|
20463
|
+
source: compilationFileTargetSchema,
|
|
20464
|
+
generation: external_exports.string().uuid(),
|
|
20465
|
+
message: notebookWidgetMessageSchema.extend({
|
|
20466
|
+
msg_type: external_exports.enum(["comm_open", "comm_msg", "comm_close"]),
|
|
20467
|
+
content: external_exports.object({
|
|
20468
|
+
comm_id: id,
|
|
20469
|
+
target_name: external_exports.literal("jupyter.widget").optional(),
|
|
20470
|
+
data: json2
|
|
20471
|
+
})
|
|
20472
|
+
})
|
|
20473
|
+
});
|
|
20474
|
+
|
|
20358
20475
|
// src/lib/transport/local.ts
|
|
20359
20476
|
import { spawn } from "node:child_process";
|
|
20360
20477
|
import { copyFileSync, mkdirSync, readFileSync } from "node:fs";
|
|
@@ -21280,7 +21397,7 @@ var confirmDaemonUpgrade = async (request) => {
|
|
|
21280
21397
|
};
|
|
21281
21398
|
function requestDaemonUpgradeApproval(message, channel) {
|
|
21282
21399
|
if (!channel.send || !channel.connected) return Promise.resolve(false);
|
|
21283
|
-
const
|
|
21400
|
+
const id2 = randomUUID();
|
|
21284
21401
|
return new Promise((resolve6) => {
|
|
21285
21402
|
const finish = (approved) => {
|
|
21286
21403
|
channel.off("message", answered);
|
|
@@ -21290,13 +21407,13 @@ function requestDaemonUpgradeApproval(message, channel) {
|
|
|
21290
21407
|
const answered = (value) => {
|
|
21291
21408
|
if (!value || typeof value !== "object") return;
|
|
21292
21409
|
const response = value;
|
|
21293
|
-
if (response.t === RESPONSE && response.id ===
|
|
21410
|
+
if (response.t === RESPONSE && response.id === id2 && typeof response.approved === "boolean")
|
|
21294
21411
|
finish(response.approved);
|
|
21295
21412
|
};
|
|
21296
21413
|
const disconnected = () => finish(false);
|
|
21297
21414
|
channel.on("message", answered);
|
|
21298
21415
|
channel.once("disconnect", disconnected);
|
|
21299
|
-
channel.send({ t: REQUEST, id, message }, (err) => {
|
|
21416
|
+
channel.send({ t: REQUEST, id: id2, message }, (err) => {
|
|
21300
21417
|
if (err) finish(false);
|
|
21301
21418
|
});
|
|
21302
21419
|
});
|
|
@@ -21522,15 +21639,15 @@ var HostControlClient = class {
|
|
|
21522
21639
|
resource(close) {
|
|
21523
21640
|
this.credential();
|
|
21524
21641
|
const generation = this.generation;
|
|
21525
|
-
const
|
|
21526
|
-
this.resources.set(
|
|
21642
|
+
const id2 = secret();
|
|
21643
|
+
this.resources.set(id2, close);
|
|
21527
21644
|
return {
|
|
21528
|
-
id,
|
|
21645
|
+
id: id2,
|
|
21529
21646
|
release: () => {
|
|
21530
|
-
this.resources.delete(
|
|
21647
|
+
this.resources.delete(id2);
|
|
21531
21648
|
},
|
|
21532
21649
|
valid: () => {
|
|
21533
|
-
const valid = this.generation === generation && this.resources.has(
|
|
21650
|
+
const valid = this.generation === generation && this.resources.has(id2) && performance.now() < this.until;
|
|
21534
21651
|
if (!valid) close();
|
|
21535
21652
|
return valid;
|
|
21536
21653
|
}
|
|
@@ -21561,7 +21678,7 @@ var HostControlClient = class {
|
|
|
21561
21678
|
this.renewControl = (resources, sentAt) => {
|
|
21562
21679
|
if (pendingAt !== null || this.channel !== channel || this.state !== "ready")
|
|
21563
21680
|
return false;
|
|
21564
|
-
if (resources.some((
|
|
21681
|
+
if (resources.some((id2) => !this.resources.has(id2))) return false;
|
|
21565
21682
|
send({ t: "renew", resources }, sentAt);
|
|
21566
21683
|
return true;
|
|
21567
21684
|
};
|
|
@@ -21893,7 +22010,7 @@ import { readFileSync as readFileSync4 } from "node:fs";
|
|
|
21893
22010
|
import { dirname as dirname4, join as join5 } from "node:path";
|
|
21894
22011
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
21895
22012
|
function cliVersion() {
|
|
21896
|
-
if (true) return "0.3.
|
|
22013
|
+
if (true) return "0.3.10";
|
|
21897
22014
|
const here = dirname4(fileURLToPath2(import.meta.url));
|
|
21898
22015
|
for (const candidate of [
|
|
21899
22016
|
join5(here, "..", "..", "package.json"),
|
|
@@ -22299,7 +22416,9 @@ var RELEASE_PROTOCOLS = {
|
|
|
22299
22416
|
"0.3.5": { major: 25, minor: 0 },
|
|
22300
22417
|
"0.3.6": { major: 25, minor: 0 },
|
|
22301
22418
|
"0.3.7": { major: 25, minor: 1 },
|
|
22302
|
-
"0.3.8": { major: 25, minor: 1 }
|
|
22419
|
+
"0.3.8": { major: 25, minor: 1 },
|
|
22420
|
+
"0.3.9": { major: 25, minor: 3 },
|
|
22421
|
+
"0.3.10": { major: 25, minor: 4 }
|
|
22303
22422
|
};
|
|
22304
22423
|
function validProtocol(value) {
|
|
22305
22424
|
if (typeof value !== "object" || value === null) return false;
|
|
@@ -22771,11 +22890,11 @@ var AttachedDaemon = class {
|
|
|
22771
22890
|
await this.ssh.exec(`printf '%s\\n' '${this.pid}' > ${hostPaths.pid}`, { timeoutMs: 5e3 });
|
|
22772
22891
|
return outcome.started;
|
|
22773
22892
|
}
|
|
22774
|
-
async readPidFile(path,
|
|
22893
|
+
async readPidFile(path, json4 = false) {
|
|
22775
22894
|
const raw = await this.ssh.readFile(path);
|
|
22776
22895
|
if (raw === null) return null;
|
|
22777
22896
|
try {
|
|
22778
|
-
const value =
|
|
22897
|
+
const value = json4 ? JSON.parse(raw).pid : Number(raw.trim());
|
|
22779
22898
|
return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : null;
|
|
22780
22899
|
} catch {
|
|
22781
22900
|
return null;
|
|
@@ -23104,12 +23223,12 @@ var BrowserAuthority = class {
|
|
|
23104
23223
|
};
|
|
23105
23224
|
|
|
23106
23225
|
// src/lib/serve/http-auth.ts
|
|
23107
|
-
function
|
|
23226
|
+
function json3(res, status, body) {
|
|
23108
23227
|
res.writeHead(status, { "content-type": "application/json", "cache-control": "no-store" });
|
|
23109
23228
|
res.end(JSON.stringify(body));
|
|
23110
23229
|
}
|
|
23111
23230
|
function fail(res, status, code, message = code) {
|
|
23112
|
-
|
|
23231
|
+
json3(res, status, { error: { code, message } });
|
|
23113
23232
|
}
|
|
23114
23233
|
async function readJson(req) {
|
|
23115
23234
|
const chunks = [];
|
|
@@ -23547,7 +23666,7 @@ fetch('./exchange', {method:'POST',headers:{'content-type':'application/json'},b
|
|
|
23547
23666
|
const grant = browsers.exchangeProxy(body.invitation, prefix);
|
|
23548
23667
|
if (!grant) return fail(res, 401, "browser_rejected");
|
|
23549
23668
|
res.setHeader("set-cookie", grant.cookie);
|
|
23550
|
-
|
|
23669
|
+
json3(res, 200, { url: origin + grant.path });
|
|
23551
23670
|
return;
|
|
23552
23671
|
}
|
|
23553
23672
|
const browser = browsers.proxyBrowser(req.headers.cookie, prefix);
|
|
@@ -23696,7 +23815,7 @@ function remoteAccessHandler(control) {
|
|
|
23696
23815
|
try {
|
|
23697
23816
|
const response = request ? await control.request(request, authorised, profile) : await control.status(profile);
|
|
23698
23817
|
if (!authorised()) return fail(res, 401, "browser_rejected");
|
|
23699
|
-
|
|
23818
|
+
json3(res, 200, response);
|
|
23700
23819
|
} catch (error51) {
|
|
23701
23820
|
fail(
|
|
23702
23821
|
res,
|
|
@@ -23734,7 +23853,7 @@ async function checkRemoteRegistration(req, res, authorised) {
|
|
|
23734
23853
|
}
|
|
23735
23854
|
const status = registrationStatusSchema.parse(JSON.parse(body));
|
|
23736
23855
|
if (!authorised()) return fail(res, 401, "browser_rejected");
|
|
23737
|
-
|
|
23856
|
+
json3(res, 200, status);
|
|
23738
23857
|
} catch {
|
|
23739
23858
|
fail(
|
|
23740
23859
|
res,
|
|
@@ -23749,7 +23868,7 @@ async function checkRemoteRegistration(req, res, authorised) {
|
|
|
23749
23868
|
function fileManagerHandler(manager) {
|
|
23750
23869
|
let busy = false;
|
|
23751
23870
|
return async (req, res, authorised) => {
|
|
23752
|
-
if (req.method === "GET") return
|
|
23871
|
+
if (req.method === "GET") return json3(res, 200, { name: manager?.name ?? null });
|
|
23753
23872
|
if (req.method !== "POST") return fail(res, 405, "method_not_allowed");
|
|
23754
23873
|
if (!manager) return fail(res, 404, "file_manager_unavailable");
|
|
23755
23874
|
const request = cockpitRevealRequestSchema.parse(await readJson(req));
|
|
@@ -23804,7 +23923,7 @@ async function startUiServer(opts) {
|
|
|
23804
23923
|
if (!exactOrigin(req, origin, true)) return fail(res, 403, "forbidden_origin");
|
|
23805
23924
|
const body = browserBootstrapSchema.parse(await readJson(req));
|
|
23806
23925
|
const credential = browsers.exchange(body.invitation);
|
|
23807
|
-
return credential ?
|
|
23926
|
+
return credential ? json3(res, 200, { credential }) : fail(res, 401, "browser_rejected");
|
|
23808
23927
|
}
|
|
23809
23928
|
if (url2.pathname.startsWith("/proxy")) return fail(res, 404, "not_found");
|
|
23810
23929
|
const protectedPath = url2.pathname === "/api" || url2.pathname.startsWith("/api/") || url2.pathname.startsWith("/cockpit/");
|
|
@@ -23822,10 +23941,10 @@ async function startUiServer(opts) {
|
|
|
23822
23941
|
if (url2.pathname === "/cockpit/logout" && req.method === "POST") {
|
|
23823
23942
|
unbind();
|
|
23824
23943
|
browsers.revoke(browser);
|
|
23825
|
-
return
|
|
23944
|
+
return json3(res, 200, { status: "revoked" });
|
|
23826
23945
|
}
|
|
23827
23946
|
if (url2.pathname === "/cockpit/status" && req.method === "GET") {
|
|
23828
|
-
return
|
|
23947
|
+
return json3(res, 200, {
|
|
23829
23948
|
instance: nonce,
|
|
23830
23949
|
refreshId: opts.refreshId ?? null,
|
|
23831
23950
|
upstream: authority.state
|
|
@@ -23848,7 +23967,7 @@ async function startUiServer(opts) {
|
|
|
23848
23967
|
const first = refreshing === null;
|
|
23849
23968
|
refreshing ??= body.refreshId;
|
|
23850
23969
|
browsers.persist();
|
|
23851
|
-
|
|
23970
|
+
json3(res, 202, { status: "refreshing", refreshId: refreshing, instance: nonce });
|
|
23852
23971
|
if (first) setImmediate(() => opts.control?.onRefresh(refreshing));
|
|
23853
23972
|
return;
|
|
23854
23973
|
}
|
|
@@ -23863,7 +23982,7 @@ async function startUiServer(opts) {
|
|
|
23863
23982
|
if (!new URL(path, proxyOrigin).pathname.startsWith(prefix))
|
|
23864
23983
|
return fail(res, 400, "bad_request");
|
|
23865
23984
|
const invitation = browsers.proxyInvite(browser, prefix, path);
|
|
23866
|
-
return
|
|
23985
|
+
return json3(res, 200, { url: `${proxyOrigin}${prefix}_puddle/enter#invite=${invitation}` });
|
|
23867
23986
|
}
|
|
23868
23987
|
if (!url2.pathname.startsWith("/api/")) return fail(res, 404, "not_found");
|
|
23869
23988
|
if (authority.state !== "ready") return fail(res, 503, authority.state);
|
|
@@ -23966,14 +24085,14 @@ async function listen(server, startPort, strict, avoidPort) {
|
|
|
23966
24085
|
}
|
|
23967
24086
|
|
|
23968
24087
|
// src/lib/remote-access.ts
|
|
23969
|
-
var
|
|
24088
|
+
var binary2 = `${hostPaths.current}/bin/node ${hostPaths.current}/daemon/connector.mjs`;
|
|
23970
24089
|
var RemoteAccessControl = class {
|
|
23971
24090
|
constructor(transport) {
|
|
23972
24091
|
this.transport = transport;
|
|
23973
24092
|
}
|
|
23974
24093
|
async capabilities() {
|
|
23975
24094
|
const result = await this.transport.exec(
|
|
23976
|
-
`if test -f ${hostPaths.current}/daemon/connector.mjs; then ${
|
|
24095
|
+
`if test -f ${hostPaths.current}/daemon/connector.mjs; then ${binary2} --version; else exit 44; fi`,
|
|
23977
24096
|
{ timeoutMs: 1e4 }
|
|
23978
24097
|
);
|
|
23979
24098
|
if (result.code === 44) return { availability: "not_installed", canDeleteRegistration: false };
|
|
@@ -23996,7 +24115,7 @@ var RemoteAccessControl = class {
|
|
|
23996
24115
|
supervisor: null,
|
|
23997
24116
|
devices: []
|
|
23998
24117
|
};
|
|
23999
|
-
const result = await this.transport.exec(`${
|
|
24118
|
+
const result = await this.transport.exec(`${binary2} --inspect`, {
|
|
24000
24119
|
timeoutMs: 1e4,
|
|
24001
24120
|
stdin: JSON.stringify({ profile }) + "\n"
|
|
24002
24121
|
});
|
|
@@ -24014,7 +24133,7 @@ var RemoteAccessControl = class {
|
|
|
24014
24133
|
if (!authorised()) throw new Error("Browser authorisation expired before dispatch.");
|
|
24015
24134
|
const flag = request.t === "enable" ? "--configure" : request.t === "reset" ? "--reset" : "--admin";
|
|
24016
24135
|
const payload = request.t === "enable" ? { profile, setup: { ...request.registration, managed: true } } : request.t === "reset" ? { profile } : { profile, request };
|
|
24017
|
-
const result = await this.transport.exec(`${
|
|
24136
|
+
const result = await this.transport.exec(`${binary2} ${flag}`, {
|
|
24018
24137
|
stdin: JSON.stringify(payload) + "\n",
|
|
24019
24138
|
timeoutMs: 3e4
|
|
24020
24139
|
});
|