@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.
Files changed (74) hide show
  1. package/CHANGELOG.md +3 -14
  2. package/dist/host-control.mjs +228 -171
  3. package/dist/index.js +259 -200
  4. package/dist/public/assets/App-CNB4a07v.js +2 -0
  5. package/dist/public/assets/Dashboard-v3OproVW.js +1 -0
  6. package/dist/public/assets/{EditorTabClose-BolUnwz9.js → EditorTabClose-DwhahpvS.js} +1 -1
  7. package/dist/public/assets/{FindWidget-BUmuGtbd.js → FindWidget-CVH9U-_P.js} +1 -1
  8. package/dist/public/assets/{LazyTerminal-BRPy9Nm5.js → LazyTerminal-CgQryH0p.js} +2 -2
  9. package/dist/public/assets/{ModelRefcount-DdSmsCyg.js → ModelRefcount-njA_f4bS.js} +1 -1
  10. package/dist/public/assets/NewProjectDialog-BT8rR4yn.js +1 -0
  11. package/dist/public/assets/NotebookWidget-Cwd77EGL.js +7 -0
  12. package/dist/public/assets/PaneEditorBody-RaUBrZPu.js +303 -0
  13. package/dist/public/assets/PdfViewer-Bppu4-0-.js +2 -0
  14. package/dist/public/assets/SettingsDialog-CaHklYzG.js +8 -0
  15. package/dist/public/assets/{Terminal-WzMZyNl-.js → Terminal-_10Xyj1h.js} +5 -5
  16. package/dist/public/assets/Workspace-GgVr1uYN.js +20 -0
  17. package/dist/public/assets/_virtual_notebook-widget-runtime-Dro422xS.js +6966 -0
  18. package/dist/public/assets/api-i6xNY3bF.js +1 -0
  19. package/dist/public/assets/auth-GfOuXpIe.js +64 -0
  20. package/dist/public/assets/{buffer-store-BcKRO2bQ.js → buffer-store-eMnMxbpI.js} +1 -1
  21. package/dist/public/assets/{button-Chvl9hcE.js → button-BgeBH2Uc.js} +1 -1
  22. package/dist/public/assets/{command-CaE1P1RF.js → command-D7m0dmA-.js} +1 -1
  23. package/dist/public/assets/context-DW21k43a.js +1 -0
  24. package/dist/public/assets/{context-menu-BTe3xVbd.js → context-menu-CMWkmDu6.js} +1 -1
  25. package/dist/public/assets/dialog-BMWRC2HO.js +41 -0
  26. package/dist/public/assets/disclosure-CHXbNzgZ.js +1 -0
  27. package/dist/public/assets/dist-BOS6OKSE.js +1 -0
  28. package/dist/public/assets/{dist-BYGE8AQe.js → dist-C_x5-hi8.js} +1 -1
  29. package/dist/public/assets/{dist-CYLjuW55.js → dist-Cde1E3eV.js} +1 -1
  30. package/dist/public/assets/{dist-gLP0NXk8.js → dist-Ds3438NL.js} +1 -1
  31. package/dist/public/assets/errors-O9DWXa3f.js +1 -0
  32. package/dist/public/assets/forward-link-RM7_5Shu.js +1 -0
  33. package/dist/public/assets/hotkeys-1uTWFYAL.js +1 -0
  34. package/dist/public/assets/index-CPHfr3MU.css +2 -0
  35. package/dist/public/assets/{index-Dp8dqiUy.js → index-np8JXeG6.js} +3 -3
  36. package/dist/public/assets/input-CxgRsoVg.js +1 -0
  37. package/dist/public/assets/jsx-runtime-By8HlURe.js +1 -0
  38. package/dist/public/assets/{markdown-mermaid-BX4brFyy.js → markdown-mermaid-CNYDlgGt.js} +1 -1
  39. package/dist/public/assets/media-refresh-store-Bu4kWCGq.js +1 -0
  40. package/dist/public/assets/notification-delivery-Dfvdt_1U.js +1 -0
  41. package/dist/public/assets/{popover-C20E0SGw.js → popover-CCHRaCvX.js} +1 -1
  42. package/dist/public/assets/protocol-support-BGmIChNK.js +1 -0
  43. package/dist/public/assets/{jsx-runtime-ffCh33zF.js → react-dom-cJyBB_A4.js} +1 -1
  44. package/dist/public/assets/{scroll-restoration-DTBzWrDT.js → scroll-restoration-OVgiE4G9.js} +1 -1
  45. package/dist/public/assets/select-Bg0rWqco.js +1 -0
  46. package/dist/public/assets/selection-actions-D875GPFU.js +1 -0
  47. package/dist/public/assets/{session-order-iDEtZwje.js → session-order-f7QxTbVD.js} +1 -1
  48. package/dist/public/assets/{switch-B1uGC2PW.js → switch-DhNyUV8C.js} +1 -1
  49. package/dist/public/assets/use-ui-state-CHqXhyx4.js +1 -0
  50. package/dist/public/assets/{ws-DfRorDqa.js → ws-CMPCIzY4.js} +1 -1
  51. package/dist/public/index.html +5 -4
  52. package/dist/pudl.js +245 -188
  53. package/package.json +1 -1
  54. package/dist/public/assets/App-BaLhdtWg.js +0 -2
  55. package/dist/public/assets/Dashboard-LVU8bCcQ.js +0 -1
  56. package/dist/public/assets/NewProjectDialog-BFguzZCI.js +0 -1
  57. package/dist/public/assets/PaneEditorBody-DBW-O4q7.js +0 -303
  58. package/dist/public/assets/PdfViewer-Q6yROHsM.js +0 -2
  59. package/dist/public/assets/SettingsDialog-DoVdLwtQ.js +0 -8
  60. package/dist/public/assets/Workspace-BxGgvBCU.js +0 -20
  61. package/dist/public/assets/auth-ngM0Ffss.js +0 -64
  62. package/dist/public/assets/dialog-yvLGI8FJ.js +0 -41
  63. package/dist/public/assets/disclosure-0ZiECVHr.js +0 -1
  64. package/dist/public/assets/dist-CwwiP1WN.js +0 -1
  65. package/dist/public/assets/errors-yaab6YK_.js +0 -1
  66. package/dist/public/assets/forward-link-kfVuUsZP.js +0 -1
  67. package/dist/public/assets/index-CItoWyyj.css +0 -2
  68. package/dist/public/assets/input-DDhYsCUG.js +0 -1
  69. package/dist/public/assets/media-refresh-store-D3rBSq4q.js +0 -1
  70. package/dist/public/assets/notification-delivery-B__ASJZR.js +0 -1
  71. package/dist/public/assets/protocol-support-BNUfFPAF.js +0 -1
  72. package/dist/public/assets/select-DQmSVYUL.js +0 -1
  73. package/dist/public/assets/selection-actions-JLWPcaUH.js +0 -1
  74. package/dist/public/assets/use-ui-state-jAfsiEpt.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: 3 };
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 id = ids[key];
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 ${id} = ${parseStr(key)};`);
7027
+ doc.write(`const ${id2} = ${parseStr(key)};`);
7028
7028
  if (isOptionalIn && isOptionalOut) {
7029
7029
  doc.write(`
7030
- if (${id}.issues.length) {
7030
+ if (${id2}.issues.length) {
7031
7031
  if (${k} in input) {
7032
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
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 (${id}.value === undefined) {
7039
+ if (${id2}.value === undefined) {
7040
7040
  if (${k} in input) {
7041
7041
  newResult[${k}] = undefined;
7042
7042
  }
7043
7043
  } else {
7044
- newResult[${k}] = ${id}.value;
7044
+ newResult[${k}] = ${id2}.value;
7045
7045
  }
7046
7046
 
7047
7047
  `);
7048
7048
  } else if (!isOptionalIn) {
7049
7049
  doc.write(`
7050
- const ${id}_present = ${k} in input;
7051
- if (${id}.issues.length) {
7052
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
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 (!${id}_present && !${id}.issues.length) {
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 (${id}_present) {
7067
- if (${id}.value === undefined) {
7066
+ if (${id2}_present) {
7067
+ if (${id2}.value === undefined) {
7068
7068
  newResult[${k}] = undefined;
7069
7069
  } else {
7070
- newResult[${k}] = ${id}.value;
7070
+ newResult[${k}] = ${id2}.value;
7071
7071
  }
7072
7072
  }
7073
7073
 
7074
7074
  `);
7075
7075
  } else {
7076
7076
  doc.write(`
7077
- if (${id}.issues.length) {
7078
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
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 (${id}.value === undefined) {
7084
+ if (${id2}.value === undefined) {
7085
7085
  if (${k} in input) {
7086
7086
  newResult[${k}] = undefined;
7087
7087
  }
7088
7088
  } else {
7089
- newResult[${k}] = ${id}.value;
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 id = ctx.metadataRegistry.get(entry[0])?.id;
15422
- if (id) {
15423
- const existing = idToSchema.get(id);
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 "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
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(id, entry[0]);
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 ?? ((id2) => id2);
15434
+ const uriGenerator = ctx.external.uri ?? ((id3) => id3);
15435
15435
  if (externalId) {
15436
15436
  return { ref: uriGenerator(externalId) };
15437
15437
  }
15438
- const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
15439
- entry[1].defId = id;
15440
- return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
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 id = ctx.metadataRegistry.get(entry[0])?.id;
15489
- if (id) {
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 id = ctx.external.registry.get(schema)?.id;
15586
- if (!id)
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(id);
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 json3 = _json;
15709
- json3.type = "string";
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
- json3.minLength = minimum;
15712
+ json4.minLength = minimum;
15713
15713
  if (typeof maximum === "number")
15714
- json3.maxLength = maximum;
15714
+ json4.maxLength = maximum;
15715
15715
  if (format) {
15716
- json3.format = formatMap[format] ?? format;
15717
- if (json3.format === "")
15718
- delete json3.format;
15716
+ json4.format = formatMap[format] ?? format;
15717
+ if (json4.format === "")
15718
+ delete json4.format;
15719
15719
  if (format === "time") {
15720
- delete json3.format;
15720
+ delete json4.format;
15721
15721
  }
15722
15722
  }
15723
15723
  if (contentEncoding)
15724
- json3.contentEncoding = contentEncoding;
15724
+ json4.contentEncoding = contentEncoding;
15725
15725
  if (patterns && patterns.size > 0) {
15726
15726
  const regexes = [...patterns];
15727
15727
  if (regexes.length === 1)
15728
- json3.pattern = regexes[0].source;
15728
+ json4.pattern = regexes[0].source;
15729
15729
  else if (regexes.length > 1) {
15730
- json3.allOf = [
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 json3 = _json;
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
- json3.type = "integer";
15743
+ json4.type = "integer";
15744
15744
  else
15745
- json3.type = "number";
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
- json3.minimum = exclusiveMinimum;
15752
- json3.exclusiveMinimum = true;
15751
+ json4.minimum = exclusiveMinimum;
15752
+ json4.exclusiveMinimum = true;
15753
15753
  } else {
15754
- json3.exclusiveMinimum = exclusiveMinimum;
15754
+ json4.exclusiveMinimum = exclusiveMinimum;
15755
15755
  }
15756
15756
  } else if (typeof minimum === "number") {
15757
- json3.minimum = minimum;
15757
+ json4.minimum = minimum;
15758
15758
  }
15759
15759
  if (exMax) {
15760
15760
  if (legacy) {
15761
- json3.maximum = exclusiveMaximum;
15762
- json3.exclusiveMaximum = true;
15761
+ json4.maximum = exclusiveMaximum;
15762
+ json4.exclusiveMaximum = true;
15763
15763
  } else {
15764
- json3.exclusiveMaximum = exclusiveMaximum;
15764
+ json4.exclusiveMaximum = exclusiveMaximum;
15765
15765
  }
15766
15766
  } else if (typeof maximum === "number") {
15767
- json3.maximum = maximum;
15767
+ json4.maximum = maximum;
15768
15768
  }
15769
15769
  if (typeof multipleOf === "number")
15770
- json3.multipleOf = multipleOf;
15770
+ json4.multipleOf = multipleOf;
15771
15771
  };
15772
- var booleanProcessor = (_schema, _ctx, json3, _params) => {
15773
- json3.type = "boolean";
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, json3, _params) => {
15785
+ var nullProcessor = (_schema, ctx, json4, _params) => {
15786
15786
  if (ctx.target === "openapi-3.0") {
15787
- json3.type = "string";
15788
- json3.nullable = true;
15789
- json3.enum = [null];
15787
+ json4.type = "string";
15788
+ json4.nullable = true;
15789
+ json4.enum = [null];
15790
15790
  } else {
15791
- json3.type = "null";
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, json3, _params) => {
15805
- json3.not = {};
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, json3, _params) => {
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
- json3.type = "number";
15820
+ json4.type = "number";
15821
15821
  if (values.every((v) => typeof v === "string"))
15822
- json3.type = "string";
15823
- json3.enum = values;
15822
+ json4.type = "string";
15823
+ json4.enum = values;
15824
15824
  };
15825
- var literalProcessor = (schema, ctx, json3, _params) => {
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
- json3.type = val === null ? "null" : typeof val;
15847
+ json4.type = val === null ? "null" : typeof val;
15848
15848
  if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
15849
- json3.enum = [val];
15849
+ json4.enum = [val];
15850
15850
  } else {
15851
- json3.const = val;
15851
+ json4.const = val;
15852
15852
  }
15853
15853
  } else {
15854
15854
  if (vals.every((v) => typeof v === "number"))
15855
- json3.type = "number";
15855
+ json4.type = "number";
15856
15856
  if (vals.every((v) => typeof v === "string"))
15857
- json3.type = "string";
15857
+ json4.type = "string";
15858
15858
  if (vals.every((v) => typeof v === "boolean"))
15859
- json3.type = "boolean";
15859
+ json4.type = "boolean";
15860
15860
  if (vals.every((v) => v === null))
15861
- json3.type = "null";
15862
- json3.enum = vals;
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, json3, _params) => {
15871
- const _json = json3;
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, json3, _params) => {
15879
- const _json = json3;
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, json3, _params) => {
15903
- json3.type = "boolean";
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 json3 = _json;
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
- json3.minItems = minimum;
15935
+ json4.minItems = minimum;
15936
15936
  if (typeof maximum === "number")
15937
- json3.maxItems = maximum;
15938
- json3.type = "array";
15939
- json3.items = process2(def.element, ctx, {
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 json3 = _json;
15945
+ const json4 = _json;
15946
15946
  const def = schema._zod.def;
15947
- json3.type = "object";
15948
- json3.properties = {};
15947
+ json4.type = "object";
15948
+ json4.properties = {};
15949
15949
  const shape = def.shape;
15950
15950
  for (const key in shape) {
15951
- json3.properties[key] = process2(shape[key], ctx, {
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
- json3.required = Array.from(requiredKeys);
15966
+ json4.required = Array.from(requiredKeys);
15967
15967
  }
15968
15968
  if (def.catchall?._zod.def.type === "never") {
15969
- json3.additionalProperties = false;
15969
+ json4.additionalProperties = false;
15970
15970
  } else if (!def.catchall) {
15971
15971
  if (ctx.io === "output")
15972
- json3.additionalProperties = false;
15972
+ json4.additionalProperties = false;
15973
15973
  } else if (def.catchall) {
15974
- json3.additionalProperties = process2(def.catchall, ctx, {
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, json3, params) => {
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
- json3.oneOf = options;
15988
+ json4.oneOf = options;
15989
15989
  } else {
15990
- json3.anyOf = options;
15990
+ json4.anyOf = options;
15991
15991
  }
15992
15992
  };
15993
- var intersectionProcessor = (schema, ctx, json3, params) => {
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
- json3.allOf = allOf;
16008
+ json4.allOf = allOf;
16009
16009
  };
16010
16010
  var tupleProcessor = (schema, ctx, _json, params) => {
16011
- const json3 = _json;
16011
+ const json4 = _json;
16012
16012
  const def = schema._zod.def;
16013
- json3.type = "array";
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
- json3.prefixItems = prefixItems;
16025
+ json4.prefixItems = prefixItems;
16026
16026
  if (rest) {
16027
- json3.items = rest;
16027
+ json4.items = rest;
16028
16028
  }
16029
16029
  } else if (ctx.target === "openapi-3.0") {
16030
- json3.items = {
16030
+ json4.items = {
16031
16031
  anyOf: prefixItems
16032
16032
  };
16033
16033
  if (rest) {
16034
- json3.items.anyOf.push(rest);
16034
+ json4.items.anyOf.push(rest);
16035
16035
  }
16036
- json3.minItems = prefixItems.length;
16036
+ json4.minItems = prefixItems.length;
16037
16037
  if (!rest) {
16038
- json3.maxItems = prefixItems.length;
16038
+ json4.maxItems = prefixItems.length;
16039
16039
  }
16040
16040
  } else {
16041
- json3.items = prefixItems;
16041
+ json4.items = prefixItems;
16042
16042
  if (rest) {
16043
- json3.additionalItems = rest;
16043
+ json4.additionalItems = rest;
16044
16044
  }
16045
16045
  }
16046
16046
  const { minimum, maximum } = schema._zod.bag;
16047
16047
  if (typeof minimum === "number")
16048
- json3.minItems = minimum;
16048
+ json4.minItems = minimum;
16049
16049
  if (typeof maximum === "number")
16050
- json3.maxItems = maximum;
16050
+ json4.maxItems = maximum;
16051
16051
  };
16052
16052
  var recordProcessor = (schema, ctx, _json, params) => {
16053
- const json3 = _json;
16053
+ const json4 = _json;
16054
16054
  const def = schema._zod.def;
16055
- json3.type = "object";
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
- json3.patternProperties = {};
16064
+ json4.patternProperties = {};
16065
16065
  for (const pattern of patterns) {
16066
- json3.patternProperties[pattern.source] = valueSchema;
16066
+ json4.patternProperties[pattern.source] = valueSchema;
16067
16067
  }
16068
16068
  } else {
16069
16069
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
16070
- json3.propertyNames = process2(def.keyType, ctx, {
16070
+ json4.propertyNames = process2(def.keyType, ctx, {
16071
16071
  ...params,
16072
16072
  path: [...params.path, "propertyNames"]
16073
16073
  });
16074
16074
  }
16075
- json3.additionalProperties = process2(def.valueType, ctx, {
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
- json3.required = validKeyValues;
16084
+ json4.required = validKeyValues;
16085
16085
  }
16086
16086
  }
16087
16087
  };
16088
- var nullableProcessor = (schema, ctx, json3, params) => {
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
- json3.nullable = true;
16094
+ json4.nullable = true;
16095
16095
  } else {
16096
- json3.anyOf = [inner, { type: "null" }];
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, json3, params) => {
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
- json3.default = JSON.parse(JSON.stringify(def.defaultValue));
16110
+ json4.default = JSON.parse(JSON.stringify(def.defaultValue));
16111
16111
  };
16112
- var prefaultProcessor = (schema, ctx, json3, params) => {
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
- json3._prefault = JSON.parse(JSON.stringify(def.defaultValue));
16118
+ json4._prefault = JSON.parse(JSON.stringify(def.defaultValue));
16119
16119
  };
16120
- var catchProcessor = (schema, ctx, json3, params) => {
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
- json3.default = catchValue;
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, json3, params) => {
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
- json3.readOnly = true;
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, json3, params) => stringProcessor(inst, ctx, json3, params);
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, json3, params) => numberProcessor(inst, ctx, json3, params);
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, json3, params) => booleanProcessor(inst, ctx, json3, params);
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, json3, params) => bigintProcessor(inst, ctx, json3, params);
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, json3, params) => symbolProcessor(inst, ctx, json3, params);
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, json3, params) => undefinedProcessor(inst, ctx, json3, params);
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, json3, params) => nullProcessor(inst, ctx, json3, params);
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, json3, params) => anyProcessor(inst, ctx, json3, params);
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, json3, params) => unknownProcessor(inst, ctx, json3, params);
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, json3, params) => neverProcessor(inst, ctx, json3, params);
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, json3, params) => voidProcessor(inst, ctx, json3, params);
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, json3, params) => dateProcessor(inst, ctx, json3, params);
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, json3, params) => arrayProcessor(inst, ctx, json3, params);
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, json3, params) => objectProcessor(inst, ctx, json3, params);
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, json3, params) => unionProcessor(inst, ctx, json3, params);
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, json3, params) => unionProcessor(inst, ctx, json3, params);
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, json3, params) => intersectionProcessor(inst, ctx, json3, params);
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, json3, params) => tupleProcessor(inst, ctx, json3, params);
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, json3, params) => recordProcessor(inst, ctx, json3, params);
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, json3, params) => mapProcessor(inst, ctx, json3, params);
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, json3, params) => setProcessor(inst, ctx, json3, params);
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, json3, params) => enumProcessor(inst, ctx, json3, params);
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, json3, params) => literalProcessor(inst, ctx, json3, params);
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, json3, params) => fileProcessor(inst, ctx, json3, params);
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, json3, params) => transformProcessor(inst, ctx, json3, params);
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, json3, params) => optionalProcessor(inst, ctx, json3, params);
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, json3, params) => optionalProcessor(inst, ctx, json3, params);
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, json3, params) => nullableProcessor(inst, ctx, json3, params);
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, json3, params) => defaultProcessor(inst, ctx, json3, params);
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, json3, params) => prefaultProcessor(inst, ctx, json3, params);
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, json3, params) => nonoptionalProcessor(inst, ctx, json3, params);
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, json3, params) => successProcessor(inst, ctx, json3, params);
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, json3, params) => catchProcessor(inst, ctx, json3, params);
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, json3, params) => nanProcessor(inst, ctx, json3, params);
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, json3, params) => pipeProcessor(inst, ctx, json3, params);
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, json3, params) => readonlyProcessor(inst, ctx, json3, params);
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, json3, params) => templateLiteralProcessor(inst, ctx, json3, params);
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, json3, params) => lazyProcessor(inst, ctx, json3, params);
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, json3, params) => promiseProcessor(inst, ctx, json3, params);
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, json3, params) => functionProcessor(inst, ctx, json3, params);
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, json3, params) => customProcessor(inst, ctx, json3, params);
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({
@@ -20415,6 +20415,63 @@ var notebookIntelligenceResponseSchema = external_exports.object({
20415
20415
  documentation: external_exports.string().max(32768)
20416
20416
  });
20417
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
+
20418
20475
  // src/lib/transport/local.ts
20419
20476
  import { spawn } from "node:child_process";
20420
20477
  import { copyFileSync, mkdirSync, readFileSync } from "node:fs";
@@ -21340,7 +21397,7 @@ var confirmDaemonUpgrade = async (request) => {
21340
21397
  };
21341
21398
  function requestDaemonUpgradeApproval(message, channel) {
21342
21399
  if (!channel.send || !channel.connected) return Promise.resolve(false);
21343
- const id = randomUUID();
21400
+ const id2 = randomUUID();
21344
21401
  return new Promise((resolve6) => {
21345
21402
  const finish = (approved) => {
21346
21403
  channel.off("message", answered);
@@ -21350,13 +21407,13 @@ function requestDaemonUpgradeApproval(message, channel) {
21350
21407
  const answered = (value) => {
21351
21408
  if (!value || typeof value !== "object") return;
21352
21409
  const response = value;
21353
- if (response.t === RESPONSE && response.id === id && typeof response.approved === "boolean")
21410
+ if (response.t === RESPONSE && response.id === id2 && typeof response.approved === "boolean")
21354
21411
  finish(response.approved);
21355
21412
  };
21356
21413
  const disconnected = () => finish(false);
21357
21414
  channel.on("message", answered);
21358
21415
  channel.once("disconnect", disconnected);
21359
- channel.send({ t: REQUEST, id, message }, (err) => {
21416
+ channel.send({ t: REQUEST, id: id2, message }, (err) => {
21360
21417
  if (err) finish(false);
21361
21418
  });
21362
21419
  });
@@ -21582,15 +21639,15 @@ var HostControlClient = class {
21582
21639
  resource(close) {
21583
21640
  this.credential();
21584
21641
  const generation = this.generation;
21585
- const id = secret();
21586
- this.resources.set(id, close);
21642
+ const id2 = secret();
21643
+ this.resources.set(id2, close);
21587
21644
  return {
21588
- id,
21645
+ id: id2,
21589
21646
  release: () => {
21590
- this.resources.delete(id);
21647
+ this.resources.delete(id2);
21591
21648
  },
21592
21649
  valid: () => {
21593
- const valid = this.generation === generation && this.resources.has(id) && performance.now() < this.until;
21650
+ const valid = this.generation === generation && this.resources.has(id2) && performance.now() < this.until;
21594
21651
  if (!valid) close();
21595
21652
  return valid;
21596
21653
  }
@@ -21621,7 +21678,7 @@ var HostControlClient = class {
21621
21678
  this.renewControl = (resources, sentAt) => {
21622
21679
  if (pendingAt !== null || this.channel !== channel || this.state !== "ready")
21623
21680
  return false;
21624
- if (resources.some((id) => !this.resources.has(id))) return false;
21681
+ if (resources.some((id2) => !this.resources.has(id2))) return false;
21625
21682
  send({ t: "renew", resources }, sentAt);
21626
21683
  return true;
21627
21684
  };
@@ -21953,7 +22010,7 @@ import { readFileSync as readFileSync4 } from "node:fs";
21953
22010
  import { dirname as dirname4, join as join5 } from "node:path";
21954
22011
  import { fileURLToPath as fileURLToPath2 } from "node:url";
21955
22012
  function cliVersion() {
21956
- if (true) return "0.3.9";
22013
+ if (true) return "0.3.11";
21957
22014
  const here = dirname4(fileURLToPath2(import.meta.url));
21958
22015
  for (const candidate of [
21959
22016
  join5(here, "..", "..", "package.json"),
@@ -22360,7 +22417,9 @@ var RELEASE_PROTOCOLS = {
22360
22417
  "0.3.6": { major: 25, minor: 0 },
22361
22418
  "0.3.7": { major: 25, minor: 1 },
22362
22419
  "0.3.8": { major: 25, minor: 1 },
22363
- "0.3.9": { major: 25, minor: 3 }
22420
+ "0.3.9": { major: 25, minor: 3 },
22421
+ "0.3.10": { major: 25, minor: 4 },
22422
+ "0.3.11": { major: 25, minor: 4 }
22364
22423
  };
22365
22424
  function validProtocol(value) {
22366
22425
  if (typeof value !== "object" || value === null) return false;
@@ -22832,11 +22891,11 @@ var AttachedDaemon = class {
22832
22891
  await this.ssh.exec(`printf '%s\\n' '${this.pid}' > ${hostPaths.pid}`, { timeoutMs: 5e3 });
22833
22892
  return outcome.started;
22834
22893
  }
22835
- async readPidFile(path, json3 = false) {
22894
+ async readPidFile(path, json4 = false) {
22836
22895
  const raw = await this.ssh.readFile(path);
22837
22896
  if (raw === null) return null;
22838
22897
  try {
22839
- const value = json3 ? JSON.parse(raw).pid : Number(raw.trim());
22898
+ const value = json4 ? JSON.parse(raw).pid : Number(raw.trim());
22840
22899
  return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : null;
22841
22900
  } catch {
22842
22901
  return null;
@@ -23165,12 +23224,12 @@ var BrowserAuthority = class {
23165
23224
  };
23166
23225
 
23167
23226
  // src/lib/serve/http-auth.ts
23168
- function json2(res, status, body) {
23227
+ function json3(res, status, body) {
23169
23228
  res.writeHead(status, { "content-type": "application/json", "cache-control": "no-store" });
23170
23229
  res.end(JSON.stringify(body));
23171
23230
  }
23172
23231
  function fail(res, status, code, message = code) {
23173
- json2(res, status, { error: { code, message } });
23232
+ json3(res, status, { error: { code, message } });
23174
23233
  }
23175
23234
  async function readJson(req) {
23176
23235
  const chunks = [];
@@ -23608,7 +23667,7 @@ fetch('./exchange', {method:'POST',headers:{'content-type':'application/json'},b
23608
23667
  const grant = browsers.exchangeProxy(body.invitation, prefix);
23609
23668
  if (!grant) return fail(res, 401, "browser_rejected");
23610
23669
  res.setHeader("set-cookie", grant.cookie);
23611
- json2(res, 200, { url: origin + grant.path });
23670
+ json3(res, 200, { url: origin + grant.path });
23612
23671
  return;
23613
23672
  }
23614
23673
  const browser = browsers.proxyBrowser(req.headers.cookie, prefix);
@@ -23757,7 +23816,7 @@ function remoteAccessHandler(control) {
23757
23816
  try {
23758
23817
  const response = request ? await control.request(request, authorised, profile) : await control.status(profile);
23759
23818
  if (!authorised()) return fail(res, 401, "browser_rejected");
23760
- json2(res, 200, response);
23819
+ json3(res, 200, response);
23761
23820
  } catch (error51) {
23762
23821
  fail(
23763
23822
  res,
@@ -23795,7 +23854,7 @@ async function checkRemoteRegistration(req, res, authorised) {
23795
23854
  }
23796
23855
  const status = registrationStatusSchema.parse(JSON.parse(body));
23797
23856
  if (!authorised()) return fail(res, 401, "browser_rejected");
23798
- json2(res, 200, status);
23857
+ json3(res, 200, status);
23799
23858
  } catch {
23800
23859
  fail(
23801
23860
  res,
@@ -23810,7 +23869,7 @@ async function checkRemoteRegistration(req, res, authorised) {
23810
23869
  function fileManagerHandler(manager) {
23811
23870
  let busy = false;
23812
23871
  return async (req, res, authorised) => {
23813
- if (req.method === "GET") return json2(res, 200, { name: manager?.name ?? null });
23872
+ if (req.method === "GET") return json3(res, 200, { name: manager?.name ?? null });
23814
23873
  if (req.method !== "POST") return fail(res, 405, "method_not_allowed");
23815
23874
  if (!manager) return fail(res, 404, "file_manager_unavailable");
23816
23875
  const request = cockpitRevealRequestSchema.parse(await readJson(req));
@@ -23865,7 +23924,7 @@ async function startUiServer(opts) {
23865
23924
  if (!exactOrigin(req, origin, true)) return fail(res, 403, "forbidden_origin");
23866
23925
  const body = browserBootstrapSchema.parse(await readJson(req));
23867
23926
  const credential = browsers.exchange(body.invitation);
23868
- return credential ? json2(res, 200, { credential }) : fail(res, 401, "browser_rejected");
23927
+ return credential ? json3(res, 200, { credential }) : fail(res, 401, "browser_rejected");
23869
23928
  }
23870
23929
  if (url2.pathname.startsWith("/proxy")) return fail(res, 404, "not_found");
23871
23930
  const protectedPath = url2.pathname === "/api" || url2.pathname.startsWith("/api/") || url2.pathname.startsWith("/cockpit/");
@@ -23883,10 +23942,10 @@ async function startUiServer(opts) {
23883
23942
  if (url2.pathname === "/cockpit/logout" && req.method === "POST") {
23884
23943
  unbind();
23885
23944
  browsers.revoke(browser);
23886
- return json2(res, 200, { status: "revoked" });
23945
+ return json3(res, 200, { status: "revoked" });
23887
23946
  }
23888
23947
  if (url2.pathname === "/cockpit/status" && req.method === "GET") {
23889
- return json2(res, 200, {
23948
+ return json3(res, 200, {
23890
23949
  instance: nonce,
23891
23950
  refreshId: opts.refreshId ?? null,
23892
23951
  upstream: authority.state
@@ -23909,7 +23968,7 @@ async function startUiServer(opts) {
23909
23968
  const first = refreshing === null;
23910
23969
  refreshing ??= body.refreshId;
23911
23970
  browsers.persist();
23912
- json2(res, 202, { status: "refreshing", refreshId: refreshing, instance: nonce });
23971
+ json3(res, 202, { status: "refreshing", refreshId: refreshing, instance: nonce });
23913
23972
  if (first) setImmediate(() => opts.control?.onRefresh(refreshing));
23914
23973
  return;
23915
23974
  }
@@ -23924,7 +23983,7 @@ async function startUiServer(opts) {
23924
23983
  if (!new URL(path, proxyOrigin).pathname.startsWith(prefix))
23925
23984
  return fail(res, 400, "bad_request");
23926
23985
  const invitation = browsers.proxyInvite(browser, prefix, path);
23927
- return json2(res, 200, { url: `${proxyOrigin}${prefix}_puddle/enter#invite=${invitation}` });
23986
+ return json3(res, 200, { url: `${proxyOrigin}${prefix}_puddle/enter#invite=${invitation}` });
23928
23987
  }
23929
23988
  if (!url2.pathname.startsWith("/api/")) return fail(res, 404, "not_found");
23930
23989
  if (authority.state !== "ready") return fail(res, 503, authority.state);
@@ -24027,14 +24086,14 @@ async function listen(server, startPort, strict, avoidPort) {
24027
24086
  }
24028
24087
 
24029
24088
  // src/lib/remote-access.ts
24030
- var binary = `${hostPaths.current}/bin/node ${hostPaths.current}/daemon/connector.mjs`;
24089
+ var binary2 = `${hostPaths.current}/bin/node ${hostPaths.current}/daemon/connector.mjs`;
24031
24090
  var RemoteAccessControl = class {
24032
24091
  constructor(transport) {
24033
24092
  this.transport = transport;
24034
24093
  }
24035
24094
  async capabilities() {
24036
24095
  const result = await this.transport.exec(
24037
- `if test -f ${hostPaths.current}/daemon/connector.mjs; then ${binary} --version; else exit 44; fi`,
24096
+ `if test -f ${hostPaths.current}/daemon/connector.mjs; then ${binary2} --version; else exit 44; fi`,
24038
24097
  { timeoutMs: 1e4 }
24039
24098
  );
24040
24099
  if (result.code === 44) return { availability: "not_installed", canDeleteRegistration: false };
@@ -24057,7 +24116,7 @@ var RemoteAccessControl = class {
24057
24116
  supervisor: null,
24058
24117
  devices: []
24059
24118
  };
24060
- const result = await this.transport.exec(`${binary} --inspect`, {
24119
+ const result = await this.transport.exec(`${binary2} --inspect`, {
24061
24120
  timeoutMs: 1e4,
24062
24121
  stdin: JSON.stringify({ profile }) + "\n"
24063
24122
  });
@@ -24075,7 +24134,7 @@ var RemoteAccessControl = class {
24075
24134
  if (!authorised()) throw new Error("Browser authorisation expired before dispatch.");
24076
24135
  const flag = request.t === "enable" ? "--configure" : request.t === "reset" ? "--reset" : "--admin";
24077
24136
  const payload = request.t === "enable" ? { profile, setup: { ...request.registration, managed: true } } : request.t === "reset" ? { profile } : { profile, request };
24078
- const result = await this.transport.exec(`${binary} ${flag}`, {
24137
+ const result = await this.transport.exec(`${binary2} ${flag}`, {
24079
24138
  stdin: JSON.stringify(payload) + "\n",
24080
24139
  timeoutMs: 3e4
24081
24140
  });