@runweave/server-linux-x64 0.1.7 → 0.1.8

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 (81) hide show
  1. package/manifest.json +146 -146
  2. package/native.tar.gz +0 -0
  3. package/package.json +1 -1
  4. package/payload/app-server/build-info.json +3 -3
  5. package/payload/app-server/index.cjs +1 -1
  6. package/payload/backend/build-info.json +4 -4
  7. package/payload/backend/index.cjs +2380 -1684
  8. package/payload/backend/scheduled-tasks-sqlite-worker.cjs +224 -171
  9. package/payload/frontend/dist/assets/{_baseUniq-i1Ki3twP.js → _baseUniq-vo4uuhMd.js} +1 -1
  10. package/payload/frontend/dist/assets/{access-DK9V0f3W.js → access-_jCu7Rgu.js} +1 -1
  11. package/payload/frontend/dist/assets/{advanced-B13lWv1d.js → advanced-CqOhObYj.js} +1 -1
  12. package/payload/frontend/dist/assets/{appearance-DumRYmkD.js → appearance-CrrD5gzC.js} +1 -1
  13. package/payload/frontend/dist/assets/{arc-HKn3_xyV.js → arc-dbfyHSF0.js} +1 -1
  14. package/payload/frontend/dist/assets/{architectureDiagram-Q4EWVU46-C09x7b94.js → architectureDiagram-Q4EWVU46-CntSCAsO.js} +1 -1
  15. package/payload/frontend/dist/assets/{blockDiagram-DXYQGD6D-CFLFTR6d.js → blockDiagram-DXYQGD6D-Chp0D4qy.js} +1 -1
  16. package/payload/frontend/dist/assets/{c4Diagram-AHTNJAMY-8P8Q-xqC.js → c4Diagram-AHTNJAMY-CF91pOuW.js} +1 -1
  17. package/payload/frontend/dist/assets/channel-Bf3IeONI.js +1 -0
  18. package/payload/frontend/dist/assets/{chunk-4BX2VUAB-B1KEkTal.js → chunk-4BX2VUAB-B1gxlVu2.js} +1 -1
  19. package/payload/frontend/dist/assets/{chunk-4TB4RGXK-Bu_Z47kJ.js → chunk-4TB4RGXK-Cxt3mj9b.js} +1 -1
  20. package/payload/frontend/dist/assets/{chunk-55IACEB6-xzHVCHyi.js → chunk-55IACEB6-BJT6qNik.js} +1 -1
  21. package/payload/frontend/dist/assets/{chunk-EDXVE4YY-h3HAW06h.js → chunk-EDXVE4YY-yI59bCa0.js} +1 -1
  22. package/payload/frontend/dist/assets/{chunk-FMBD7UC4-CQ4faPSh.js → chunk-FMBD7UC4-CDvncKKJ.js} +1 -1
  23. package/payload/frontend/dist/assets/{chunk-OYMX7WX6-CubmLoGT.js → chunk-OYMX7WX6-BblOIU57.js} +1 -1
  24. package/payload/frontend/dist/assets/{chunk-QZHKN3VN-xk0zKNja.js → chunk-QZHKN3VN-rODzNdO0.js} +1 -1
  25. package/payload/frontend/dist/assets/{chunk-YZCP3GAM-CHpTv8sd.js → chunk-YZCP3GAM-B6D4wQwk.js} +1 -1
  26. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-CFsG2SvG.js +1 -0
  27. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-CFsG2SvG.js +1 -0
  28. package/payload/frontend/dist/assets/clone-CeQXm2YN.js +1 -0
  29. package/payload/frontend/dist/assets/{connection-BhcgnOMb.js → connection-XriXysSc.js} +1 -1
  30. package/payload/frontend/dist/assets/{connections-A7InZw2T.js → connections-DqDmxS-O.js} +1 -1
  31. package/payload/frontend/dist/assets/{cose-bilkent-S5V4N54A-CQn27vi_.js → cose-bilkent-S5V4N54A-BvwVWp29.js} +1 -1
  32. package/payload/frontend/dist/assets/{dagre-KV5264BT-CClOwB9v.js → dagre-KV5264BT-h_K1TH11.js} +1 -1
  33. package/payload/frontend/dist/assets/{desktop-BgryfXXM.js → desktop-BQ3kGtKG.js} +1 -1
  34. package/payload/frontend/dist/assets/{diagram-5BDNPKRD-DcUJOAmV.js → diagram-5BDNPKRD-B8g2SV6L.js} +1 -1
  35. package/payload/frontend/dist/assets/{diagram-G4DWMVQ6-DdabmTwk.js → diagram-G4DWMVQ6-BOEnrqYm.js} +1 -1
  36. package/payload/frontend/dist/assets/{diagram-MMDJMWI5-DmcxjBIk.js → diagram-MMDJMWI5-DlaN_z71.js} +1 -1
  37. package/payload/frontend/dist/assets/{diagram-TYMM5635-BUSpXaiN.js → diagram-TYMM5635-C_pSKftn.js} +1 -1
  38. package/payload/frontend/dist/assets/{erDiagram-SMLLAGMA-vkAXcv5_.js → erDiagram-SMLLAGMA-C2dL-h3I.js} +1 -1
  39. package/payload/frontend/dist/assets/{flowDiagram-DWJPFMVM-BHDU7BUJ.js → flowDiagram-DWJPFMVM-BmXhKWFj.js} +1 -1
  40. package/payload/frontend/dist/assets/{ganttDiagram-T4ZO3ILL-C3lAG7_6.js → ganttDiagram-T4ZO3ILL-D_Odnssf.js} +1 -1
  41. package/payload/frontend/dist/assets/{gitGraphDiagram-UUTBAWPF-DHLyYJf7.js → gitGraphDiagram-UUTBAWPF-DcQdcwKZ.js} +1 -1
  42. package/payload/frontend/dist/assets/{graph-Bp5bIzXM.js → graph-C_XsxefA.js} +1 -1
  43. package/payload/frontend/dist/assets/{image-DkcKNLTV.js → image-D3hgVr8O.js} +1 -1
  44. package/payload/frontend/dist/assets/{index-BUS7FSlk.js → index-CEUsFFQq.js} +5 -5
  45. package/payload/frontend/dist/assets/{infoDiagram-42DDH7IO-CVp9zvmA.js → infoDiagram-42DDH7IO-C6TnRyMi.js} +1 -1
  46. package/payload/frontend/dist/assets/{ishikawaDiagram-UXIWVN3A-D07QPX3O.js → ishikawaDiagram-UXIWVN3A-BL7rfALJ.js} +1 -1
  47. package/payload/frontend/dist/assets/{journeyDiagram-VCZTEJTY-D-iZPDHM.js → journeyDiagram-VCZTEJTY-C_6407GW.js} +1 -1
  48. package/payload/frontend/dist/assets/{kanban-definition-6JOO6SKY-BR4eWb08.js → kanban-definition-6JOO6SKY-CK61Fd0p.js} +1 -1
  49. package/payload/frontend/dist/assets/{layout-Cyv0DyJm.js → layout-DVn6JKbl.js} +1 -1
  50. package/payload/frontend/dist/assets/{linear-D5M7Pvj1.js → linear-DyWskq8H.js} +1 -1
  51. package/payload/frontend/dist/assets/{main-BDBhLSX2.js → main-H5R-3_w1.js} +164 -164
  52. package/payload/frontend/dist/assets/{min-BFlloFGg.js → min-apbLpSJ3.js} +1 -1
  53. package/payload/frontend/dist/assets/{mindmap-definition-QFDTVHPH-AKUF178o.js → mindmap-definition-QFDTVHPH-MVHZZbma.js} +1 -1
  54. package/payload/frontend/dist/assets/{monitoring-B2okceCB.js → monitoring-BApsVez_.js} +1 -1
  55. package/payload/frontend/dist/assets/{notifications-0lql4_qJ.js → notifications-CjxSNLU1.js} +1 -1
  56. package/payload/frontend/dist/assets/{pieDiagram-DEJITSTG-CRiHmwn7.js → pieDiagram-DEJITSTG-Dhbb0AYU.js} +1 -1
  57. package/payload/frontend/dist/assets/{quadrantDiagram-34T5L4WZ-CzXrq7IJ.js → quadrantDiagram-34T5L4WZ-Yk6LOF0S.js} +1 -1
  58. package/payload/frontend/dist/assets/{record-content-DTCQKbEj.js → record-content-BCJ80KS5.js} +1 -1
  59. package/payload/frontend/dist/assets/{requirementDiagram-MS252O5E-Bbn5ulLV.js → requirementDiagram-MS252O5E-BUhS0PEq.js} +1 -1
  60. package/payload/frontend/dist/assets/{sankeyDiagram-XADWPNL6-D9ZZ46pQ.js → sankeyDiagram-XADWPNL6-D2sdxz14.js} +1 -1
  61. package/payload/frontend/dist/assets/{sequenceDiagram-FGHM5R23-DxOP2gDa.js → sequenceDiagram-FGHM5R23-CRere4Fy.js} +1 -1
  62. package/payload/frontend/dist/assets/{stateDiagram-FHFEXIEX-NF_Qq5Cq.js → stateDiagram-FHFEXIEX-_pk-OMlm.js} +1 -1
  63. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-CzpdUl_0.js +1 -0
  64. package/payload/frontend/dist/assets/{status-2U71YpVe.js → status-Dk5rRVQF.js} +1 -1
  65. package/payload/frontend/dist/assets/suiji-CO_L5W1X.js +1 -0
  66. package/payload/frontend/dist/assets/{svg-DpI3GSCw.js → svg-X7YkMMvx.js} +1 -1
  67. package/payload/frontend/dist/assets/{tabs-CYKuiiHg.js → tabs-BmKbcPVh.js} +1 -1
  68. package/payload/frontend/dist/assets/{timeline-definition-GMOUNBTQ-ChEZSNF_.js → timeline-definition-GMOUNBTQ-BPsI2pMC.js} +1 -1
  69. package/payload/frontend/dist/assets/{vennDiagram-DHZGUBPP-Ch26SNbB.js → vennDiagram-DHZGUBPP-BNJkZ1Az.js} +1 -1
  70. package/payload/frontend/dist/assets/{wardley-RL74JXVD-D0ap5vv0.js → wardley-RL74JXVD-CVcYeATS.js} +1 -1
  71. package/payload/frontend/dist/assets/{wardleyDiagram-NUSXRM2D-btdjsmHO.js → wardleyDiagram-NUSXRM2D-BpLJ0alk.js} +1 -1
  72. package/payload/frontend/dist/assets/{xychartDiagram-5P7HB3ND-CklPtFGT.js → xychartDiagram-5P7HB3ND-BdsYYk4M.js} +1 -1
  73. package/payload/frontend/dist/build-info.json +4 -4
  74. package/payload/frontend/dist/companion.html +1 -1
  75. package/payload/frontend/dist/index.html +2 -2
  76. package/payload/frontend/dist/assets/channel-CuSisha8.js +0 -1
  77. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-ClJkT7PY.js +0 -1
  78. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-ClJkT7PY.js +0 -1
  79. package/payload/frontend/dist/assets/clone-CPcyXi9g.js +0 -1
  80. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-DhdOfEAv.js +0 -1
  81. package/payload/frontend/dist/assets/suiji-DXtfgwxj.js +0 -1
@@ -107,17 +107,17 @@ var require_visit = __commonJS({
107
107
  visit.BREAK = BREAK;
108
108
  visit.SKIP = SKIP;
109
109
  visit.REMOVE = REMOVE;
110
- function visit_(key, node, visitor, path2) {
111
- const ctrl = callVisitor(key, node, visitor, path2);
110
+ function visit_(key, node, visitor, path3) {
111
+ const ctrl = callVisitor(key, node, visitor, path3);
112
112
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
113
- replaceNode(key, path2, ctrl);
114
- return visit_(key, ctrl, visitor, path2);
113
+ replaceNode(key, path3, ctrl);
114
+ return visit_(key, ctrl, visitor, path3);
115
115
  }
116
116
  if (typeof ctrl !== "symbol") {
117
117
  if (identity.isCollection(node)) {
118
- path2 = Object.freeze(path2.concat(node));
118
+ path3 = Object.freeze(path3.concat(node));
119
119
  for (let i = 0; i < node.items.length; ++i) {
120
- const ci = visit_(i, node.items[i], visitor, path2);
120
+ const ci = visit_(i, node.items[i], visitor, path3);
121
121
  if (typeof ci === "number")
122
122
  i = ci - 1;
123
123
  else if (ci === BREAK)
@@ -128,13 +128,13 @@ var require_visit = __commonJS({
128
128
  }
129
129
  }
130
130
  } else if (identity.isPair(node)) {
131
- path2 = Object.freeze(path2.concat(node));
132
- const ck = visit_("key", node.key, visitor, path2);
131
+ path3 = Object.freeze(path3.concat(node));
132
+ const ck = visit_("key", node.key, visitor, path3);
133
133
  if (ck === BREAK)
134
134
  return BREAK;
135
135
  else if (ck === REMOVE)
136
136
  node.key = null;
137
- const cv = visit_("value", node.value, visitor, path2);
137
+ const cv = visit_("value", node.value, visitor, path3);
138
138
  if (cv === BREAK)
139
139
  return BREAK;
140
140
  else if (cv === REMOVE)
@@ -155,17 +155,17 @@ var require_visit = __commonJS({
155
155
  visitAsync.BREAK = BREAK;
156
156
  visitAsync.SKIP = SKIP;
157
157
  visitAsync.REMOVE = REMOVE;
158
- async function visitAsync_(key, node, visitor, path2) {
159
- const ctrl = await callVisitor(key, node, visitor, path2);
158
+ async function visitAsync_(key, node, visitor, path3) {
159
+ const ctrl = await callVisitor(key, node, visitor, path3);
160
160
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
161
- replaceNode(key, path2, ctrl);
162
- return visitAsync_(key, ctrl, visitor, path2);
161
+ replaceNode(key, path3, ctrl);
162
+ return visitAsync_(key, ctrl, visitor, path3);
163
163
  }
164
164
  if (typeof ctrl !== "symbol") {
165
165
  if (identity.isCollection(node)) {
166
- path2 = Object.freeze(path2.concat(node));
166
+ path3 = Object.freeze(path3.concat(node));
167
167
  for (let i = 0; i < node.items.length; ++i) {
168
- const ci = await visitAsync_(i, node.items[i], visitor, path2);
168
+ const ci = await visitAsync_(i, node.items[i], visitor, path3);
169
169
  if (typeof ci === "number")
170
170
  i = ci - 1;
171
171
  else if (ci === BREAK)
@@ -176,13 +176,13 @@ var require_visit = __commonJS({
176
176
  }
177
177
  }
178
178
  } else if (identity.isPair(node)) {
179
- path2 = Object.freeze(path2.concat(node));
180
- const ck = await visitAsync_("key", node.key, visitor, path2);
179
+ path3 = Object.freeze(path3.concat(node));
180
+ const ck = await visitAsync_("key", node.key, visitor, path3);
181
181
  if (ck === BREAK)
182
182
  return BREAK;
183
183
  else if (ck === REMOVE)
184
184
  node.key = null;
185
- const cv = await visitAsync_("value", node.value, visitor, path2);
185
+ const cv = await visitAsync_("value", node.value, visitor, path3);
186
186
  if (cv === BREAK)
187
187
  return BREAK;
188
188
  else if (cv === REMOVE)
@@ -209,23 +209,23 @@ var require_visit = __commonJS({
209
209
  }
210
210
  return visitor;
211
211
  }
212
- function callVisitor(key, node, visitor, path2) {
212
+ function callVisitor(key, node, visitor, path3) {
213
213
  if (typeof visitor === "function")
214
- return visitor(key, node, path2);
214
+ return visitor(key, node, path3);
215
215
  if (identity.isMap(node))
216
- return visitor.Map?.(key, node, path2);
216
+ return visitor.Map?.(key, node, path3);
217
217
  if (identity.isSeq(node))
218
- return visitor.Seq?.(key, node, path2);
218
+ return visitor.Seq?.(key, node, path3);
219
219
  if (identity.isPair(node))
220
- return visitor.Pair?.(key, node, path2);
220
+ return visitor.Pair?.(key, node, path3);
221
221
  if (identity.isScalar(node))
222
- return visitor.Scalar?.(key, node, path2);
222
+ return visitor.Scalar?.(key, node, path3);
223
223
  if (identity.isAlias(node))
224
- return visitor.Alias?.(key, node, path2);
224
+ return visitor.Alias?.(key, node, path3);
225
225
  return void 0;
226
226
  }
227
- function replaceNode(key, path2, node) {
228
- const parent = path2[path2.length - 1];
227
+ function replaceNode(key, path3, node) {
228
+ const parent = path3[path3.length - 1];
229
229
  if (identity.isCollection(parent)) {
230
230
  parent.items[key] = node;
231
231
  } else if (identity.isPair(parent)) {
@@ -833,10 +833,10 @@ var require_Collection = __commonJS({
833
833
  var createNode = require_createNode();
834
834
  var identity = require_identity();
835
835
  var Node = require_Node();
836
- function collectionFromPath(schema, path2, value) {
836
+ function collectionFromPath(schema, path3, value) {
837
837
  let v = value;
838
- for (let i = path2.length - 1; i >= 0; --i) {
839
- const k = path2[i];
838
+ for (let i = path3.length - 1; i >= 0; --i) {
839
+ const k = path3[i];
840
840
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
841
841
  const a = [];
842
842
  a[k] = v;
@@ -855,7 +855,7 @@ var require_Collection = __commonJS({
855
855
  sourceObjects: /* @__PURE__ */ new Map()
856
856
  });
857
857
  }
858
- var isEmptyPath = (path2) => path2 == null || typeof path2 === "object" && !!path2[Symbol.iterator]().next().done;
858
+ var isEmptyPath = (path3) => path3 == null || typeof path3 === "object" && !!path3[Symbol.iterator]().next().done;
859
859
  var Collection = class extends Node.NodeBase {
860
860
  constructor(type, schema) {
861
861
  super(type);
@@ -885,11 +885,11 @@ var require_Collection = __commonJS({
885
885
  * be a Pair instance or a `{ key, value }` object, which may not have a key
886
886
  * that already exists in the map.
887
887
  */
888
- addIn(path2, value) {
889
- if (isEmptyPath(path2))
888
+ addIn(path3, value) {
889
+ if (isEmptyPath(path3))
890
890
  this.add(value);
891
891
  else {
892
- const [key, ...rest] = path2;
892
+ const [key, ...rest] = path3;
893
893
  const node = this.get(key, true);
894
894
  if (identity.isCollection(node))
895
895
  node.addIn(rest, value);
@@ -903,8 +903,8 @@ var require_Collection = __commonJS({
903
903
  * Removes a value from the collection.
904
904
  * @returns `true` if the item was found and removed.
905
905
  */
906
- deleteIn(path2) {
907
- const [key, ...rest] = path2;
906
+ deleteIn(path3) {
907
+ const [key, ...rest] = path3;
908
908
  if (rest.length === 0)
909
909
  return this.delete(key);
910
910
  const node = this.get(key, true);
@@ -918,8 +918,8 @@ var require_Collection = __commonJS({
918
918
  * scalar values from their surrounding node; to disable set `keepScalar` to
919
919
  * `true` (collections are always returned intact).
920
920
  */
921
- getIn(path2, keepScalar) {
922
- const [key, ...rest] = path2;
921
+ getIn(path3, keepScalar) {
922
+ const [key, ...rest] = path3;
923
923
  const node = this.get(key, true);
924
924
  if (rest.length === 0)
925
925
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -937,8 +937,8 @@ var require_Collection = __commonJS({
937
937
  /**
938
938
  * Checks if the collection includes a value with the key `key`.
939
939
  */
940
- hasIn(path2) {
941
- const [key, ...rest] = path2;
940
+ hasIn(path3) {
941
+ const [key, ...rest] = path3;
942
942
  if (rest.length === 0)
943
943
  return this.has(key);
944
944
  const node = this.get(key, true);
@@ -948,8 +948,8 @@ var require_Collection = __commonJS({
948
948
  * Sets a value in this collection. For `!!set`, `value` needs to be a
949
949
  * boolean to add/remove the item from the set.
950
950
  */
951
- setIn(path2, value) {
952
- const [key, ...rest] = path2;
951
+ setIn(path3, value) {
952
+ const [key, ...rest] = path3;
953
953
  if (rest.length === 0) {
954
954
  this.set(key, value);
955
955
  } else {
@@ -3453,9 +3453,9 @@ var require_Document = __commonJS({
3453
3453
  this.contents.add(value);
3454
3454
  }
3455
3455
  /** Adds a value to the document. */
3456
- addIn(path2, value) {
3456
+ addIn(path3, value) {
3457
3457
  if (assertCollection(this.contents))
3458
- this.contents.addIn(path2, value);
3458
+ this.contents.addIn(path3, value);
3459
3459
  }
3460
3460
  /**
3461
3461
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -3530,14 +3530,14 @@ var require_Document = __commonJS({
3530
3530
  * Removes a value from the document.
3531
3531
  * @returns `true` if the item was found and removed.
3532
3532
  */
3533
- deleteIn(path2) {
3534
- if (Collection.isEmptyPath(path2)) {
3533
+ deleteIn(path3) {
3534
+ if (Collection.isEmptyPath(path3)) {
3535
3535
  if (this.contents == null)
3536
3536
  return false;
3537
3537
  this.contents = null;
3538
3538
  return true;
3539
3539
  }
3540
- return assertCollection(this.contents) ? this.contents.deleteIn(path2) : false;
3540
+ return assertCollection(this.contents) ? this.contents.deleteIn(path3) : false;
3541
3541
  }
3542
3542
  /**
3543
3543
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -3552,10 +3552,10 @@ var require_Document = __commonJS({
3552
3552
  * scalar values from their surrounding node; to disable set `keepScalar` to
3553
3553
  * `true` (collections are always returned intact).
3554
3554
  */
3555
- getIn(path2, keepScalar) {
3556
- if (Collection.isEmptyPath(path2))
3555
+ getIn(path3, keepScalar) {
3556
+ if (Collection.isEmptyPath(path3))
3557
3557
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
3558
- return identity.isCollection(this.contents) ? this.contents.getIn(path2, keepScalar) : void 0;
3558
+ return identity.isCollection(this.contents) ? this.contents.getIn(path3, keepScalar) : void 0;
3559
3559
  }
3560
3560
  /**
3561
3561
  * Checks if the document includes a value with the key `key`.
@@ -3566,10 +3566,10 @@ var require_Document = __commonJS({
3566
3566
  /**
3567
3567
  * Checks if the document includes a value at `path`.
3568
3568
  */
3569
- hasIn(path2) {
3570
- if (Collection.isEmptyPath(path2))
3569
+ hasIn(path3) {
3570
+ if (Collection.isEmptyPath(path3))
3571
3571
  return this.contents !== void 0;
3572
- return identity.isCollection(this.contents) ? this.contents.hasIn(path2) : false;
3572
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path3) : false;
3573
3573
  }
3574
3574
  /**
3575
3575
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -3586,13 +3586,13 @@ var require_Document = __commonJS({
3586
3586
  * Sets a value in this document. For `!!set`, `value` needs to be a
3587
3587
  * boolean to add/remove the item from the set.
3588
3588
  */
3589
- setIn(path2, value) {
3590
- if (Collection.isEmptyPath(path2)) {
3589
+ setIn(path3, value) {
3590
+ if (Collection.isEmptyPath(path3)) {
3591
3591
  this.contents = value;
3592
3592
  } else if (this.contents == null) {
3593
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path2), value);
3593
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path3), value);
3594
3594
  } else if (assertCollection(this.contents)) {
3595
- this.contents.setIn(path2, value);
3595
+ this.contents.setIn(path3, value);
3596
3596
  }
3597
3597
  }
3598
3598
  /**
@@ -5544,9 +5544,9 @@ var require_cst_visit = __commonJS({
5544
5544
  visit.BREAK = BREAK;
5545
5545
  visit.SKIP = SKIP;
5546
5546
  visit.REMOVE = REMOVE;
5547
- visit.itemAtPath = (cst, path2) => {
5547
+ visit.itemAtPath = (cst, path3) => {
5548
5548
  let item = cst;
5549
- for (const [field, index] of path2) {
5549
+ for (const [field, index] of path3) {
5550
5550
  const tok = item?.[field];
5551
5551
  if (tok && "items" in tok) {
5552
5552
  item = tok.items[index];
@@ -5555,23 +5555,23 @@ var require_cst_visit = __commonJS({
5555
5555
  }
5556
5556
  return item;
5557
5557
  };
5558
- visit.parentCollection = (cst, path2) => {
5559
- const parent = visit.itemAtPath(cst, path2.slice(0, -1));
5560
- const field = path2[path2.length - 1][0];
5558
+ visit.parentCollection = (cst, path3) => {
5559
+ const parent = visit.itemAtPath(cst, path3.slice(0, -1));
5560
+ const field = path3[path3.length - 1][0];
5561
5561
  const coll = parent?.[field];
5562
5562
  if (coll && "items" in coll)
5563
5563
  return coll;
5564
5564
  throw new Error("Parent collection not found");
5565
5565
  };
5566
- function _visit(path2, item, visitor) {
5567
- let ctrl = visitor(item, path2);
5566
+ function _visit(path3, item, visitor) {
5567
+ let ctrl = visitor(item, path3);
5568
5568
  if (typeof ctrl === "symbol")
5569
5569
  return ctrl;
5570
5570
  for (const field of ["key", "value"]) {
5571
5571
  const token = item[field];
5572
5572
  if (token && "items" in token) {
5573
5573
  for (let i = 0; i < token.items.length; ++i) {
5574
- const ci = _visit(Object.freeze(path2.concat([[field, i]])), token.items[i], visitor);
5574
+ const ci = _visit(Object.freeze(path3.concat([[field, i]])), token.items[i], visitor);
5575
5575
  if (typeof ci === "number")
5576
5576
  i = ci - 1;
5577
5577
  else if (ci === BREAK)
@@ -5582,10 +5582,10 @@ var require_cst_visit = __commonJS({
5582
5582
  }
5583
5583
  }
5584
5584
  if (typeof ctrl === "function" && field === "key")
5585
- ctrl = ctrl(item, path2);
5585
+ ctrl = ctrl(item, path3);
5586
5586
  }
5587
5587
  }
5588
- return typeof ctrl === "function" ? ctrl(item, path2) : ctrl;
5588
+ return typeof ctrl === "function" ? ctrl(item, path3) : ctrl;
5589
5589
  }
5590
5590
  exports2.visit = visit;
5591
5591
  }
@@ -14791,15 +14791,15 @@ var require_index_cjs = __commonJS({
14791
14791
  };
14792
14792
  }
14793
14793
  function wrapConversion(toModel, graph) {
14794
- const path2 = [graph[toModel].parent, toModel];
14794
+ const path3 = [graph[toModel].parent, toModel];
14795
14795
  let fn = convert$1[graph[toModel].parent][toModel];
14796
14796
  let cur = graph[toModel].parent;
14797
14797
  while (graph[cur].parent) {
14798
- path2.unshift(graph[cur].parent);
14798
+ path3.unshift(graph[cur].parent);
14799
14799
  fn = link(convert$1[graph[cur].parent][cur], fn);
14800
14800
  cur = graph[cur].parent;
14801
14801
  }
14802
- fn.conversion = path2;
14802
+ fn.conversion = path3;
14803
14803
  return fn;
14804
14804
  }
14805
14805
  function route(fromModel) {
@@ -15525,7 +15525,7 @@ var require_file = __commonJS({
15525
15525
  "node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/transports/file.js"(exports2, module2) {
15526
15526
  "use strict";
15527
15527
  var fs = require("fs");
15528
- var path2 = require("path");
15528
+ var path3 = require("path");
15529
15529
  var asyncSeries = require_series();
15530
15530
  var zlib = require("zlib");
15531
15531
  var { MESSAGE } = require_triple_beam();
@@ -15555,14 +15555,14 @@ var require_file = __commonJS({
15555
15555
  this._onError = this._onError.bind(this);
15556
15556
  if (options.filename || options.dirname) {
15557
15557
  throwIf("filename or dirname", "stream");
15558
- this._basename = this.filename = options.filename ? path2.basename(options.filename) : "winston.log";
15559
- this.dirname = options.dirname || path2.dirname(options.filename);
15558
+ this._basename = this.filename = options.filename ? path3.basename(options.filename) : "winston.log";
15559
+ this.dirname = options.dirname || path3.dirname(options.filename);
15560
15560
  this.options = options.options || { flags: "a" };
15561
15561
  } else if (options.stream) {
15562
15562
  console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream");
15563
15563
  throwIf("stream", "filename", "maxsize");
15564
15564
  this._dest = this._stream.pipe(this._setupStream(options.stream));
15565
- this.dirname = path2.dirname(this._dest.path);
15565
+ this.dirname = path3.dirname(this._dest.path);
15566
15566
  } else {
15567
15567
  throw new Error("Cannot log to file without filename or stream.");
15568
15568
  }
@@ -15725,7 +15725,7 @@ var require_file = __commonJS({
15725
15725
  options = {};
15726
15726
  }
15727
15727
  options = normalizeQuery(options);
15728
- const file = path2.join(this.dirname, this.filename);
15728
+ const file = path3.join(this.dirname, this.filename);
15729
15729
  let buff = "";
15730
15730
  let results = [];
15731
15731
  let row = 0;
@@ -15830,7 +15830,7 @@ var require_file = __commonJS({
15830
15830
  * TODO: Refactor me.
15831
15831
  */
15832
15832
  stream(options = {}) {
15833
- const file = path2.join(this.dirname, this.filename);
15833
+ const file = path3.join(this.dirname, this.filename);
15834
15834
  const stream = new Stream();
15835
15835
  const tail = {
15836
15836
  file,
@@ -15880,7 +15880,7 @@ var require_file = __commonJS({
15880
15880
  */
15881
15881
  stat(callback) {
15882
15882
  const target = this._getFile();
15883
- const fullpath = path2.join(this.dirname, target);
15883
+ const fullpath = path3.join(this.dirname, target);
15884
15884
  fs.stat(fullpath, (err, stat) => {
15885
15885
  if (err && err.code === "ENOENT") {
15886
15886
  debug("ENOENT\xA0ok", fullpath);
@@ -15984,7 +15984,7 @@ var require_file = __commonJS({
15984
15984
  * @returns {WritableStream} Stream that writes to disk for the active file.
15985
15985
  */
15986
15986
  _createStream(source) {
15987
- const fullpath = path2.join(this.dirname, this.filename);
15987
+ const fullpath = path3.join(this.dirname, this.filename);
15988
15988
  debug("create stream start", fullpath, this.options);
15989
15989
  const dest = fs.createWriteStream(fullpath, this.options).on("error", (err) => debug(err)).on("close", () => debug("close", dest.path, dest.bytesWritten)).on("open", () => {
15990
15990
  debug("file open ok", fullpath);
@@ -16009,16 +16009,16 @@ var require_file = __commonJS({
16009
16009
  */
16010
16010
  _incFile(callback) {
16011
16011
  debug("_incFile", this.filename);
16012
- const ext = path2.extname(this._basename);
16013
- const basename = path2.basename(this._basename, ext);
16012
+ const ext = path3.extname(this._basename);
16013
+ const basename = path3.basename(this._basename, ext);
16014
16014
  const tasks = [];
16015
16015
  if (this.zippedArchive) {
16016
16016
  tasks.push(
16017
16017
  function(cb) {
16018
16018
  const num = this._created > 0 && !this.tailable ? this._created : "";
16019
16019
  this._compressFile(
16020
- path2.join(this.dirname, `${basename}${num}${ext}`),
16021
- path2.join(this.dirname, `${basename}${num}${ext}.gz`),
16020
+ path3.join(this.dirname, `${basename}${num}${ext}`),
16021
+ path3.join(this.dirname, `${basename}${num}${ext}.gz`),
16022
16022
  cb
16023
16023
  );
16024
16024
  }.bind(this)
@@ -16043,8 +16043,8 @@ var require_file = __commonJS({
16043
16043
  * @private
16044
16044
  */
16045
16045
  _getFile() {
16046
- const ext = path2.extname(this._basename);
16047
- const basename = path2.basename(this._basename, ext);
16046
+ const ext = path3.extname(this._basename);
16047
+ const basename = path3.basename(this._basename, ext);
16048
16048
  const isRotation = this.rotationFormat ? this.rotationFormat() : this._created;
16049
16049
  return !this.tailable && this._created ? `${basename}${isRotation}${ext}` : `${basename}${ext}`;
16050
16050
  }
@@ -16064,7 +16064,7 @@ var require_file = __commonJS({
16064
16064
  const isOldest = oldest !== 0 ? oldest : "";
16065
16065
  const isZipped = this.zippedArchive ? ".gz" : "";
16066
16066
  const filePath = `${basename}${isOldest}${ext}${isZipped}`;
16067
- const target = path2.join(this.dirname, filePath);
16067
+ const target = path3.join(this.dirname, filePath);
16068
16068
  fs.unlink(target, callback);
16069
16069
  }
16070
16070
  /**
@@ -16087,20 +16087,20 @@ var require_file = __commonJS({
16087
16087
  for (let x = this.maxFiles - 1; x > 1; x--) {
16088
16088
  tasks.push(function(i, cb) {
16089
16089
  let fileName = `${basename}${i - 1}${ext}${isZipped}`;
16090
- const tmppath = path2.join(this.dirname, fileName);
16090
+ const tmppath = path3.join(this.dirname, fileName);
16091
16091
  fs.exists(tmppath, (exists) => {
16092
16092
  if (!exists) {
16093
16093
  return cb(null);
16094
16094
  }
16095
16095
  fileName = `${basename}${i}${ext}${isZipped}`;
16096
- fs.rename(tmppath, path2.join(this.dirname, fileName), cb);
16096
+ fs.rename(tmppath, path3.join(this.dirname, fileName), cb);
16097
16097
  });
16098
16098
  }.bind(this, x));
16099
16099
  }
16100
16100
  asyncSeries(tasks, () => {
16101
16101
  fs.rename(
16102
- path2.join(this.dirname, `${basename}${ext}${isZipped}`),
16103
- path2.join(this.dirname, `${basename}1${ext}${isZipped}`),
16102
+ path3.join(this.dirname, `${basename}${ext}${isZipped}`),
16103
+ path3.join(this.dirname, `${basename}1${ext}${isZipped}`),
16104
16104
  callback
16105
16105
  );
16106
16106
  });
@@ -16213,9 +16213,9 @@ var require_http = __commonJS({
16213
16213
  };
16214
16214
  const auth = options.params.auth || null;
16215
16215
  delete options.params.auth;
16216
- const path2 = options.params.path || null;
16216
+ const path3 = options.params.path || null;
16217
16217
  delete options.params.path;
16218
- this._request(options, auth, path2, (err, res, body) => {
16218
+ this._request(options, auth, path3, (err, res, body) => {
16219
16219
  if (res && res.statusCode !== 200) {
16220
16220
  err = new Error(`Invalid HTTP Status Code: ${res.statusCode}`);
16221
16221
  }
@@ -16243,12 +16243,12 @@ var require_http = __commonJS({
16243
16243
  method: "stream",
16244
16244
  params: options
16245
16245
  };
16246
- const path2 = options.params.path || null;
16246
+ const path3 = options.params.path || null;
16247
16247
  delete options.params.path;
16248
16248
  const auth = options.params.auth || null;
16249
16249
  delete options.params.auth;
16250
16250
  let buff = "";
16251
- const req = this._request(options, auth, path2);
16251
+ const req = this._request(options, auth, path3);
16252
16252
  stream.destroy = () => req.destroy();
16253
16253
  req.on("data", (data) => {
16254
16254
  data = (buff + data).split(/\n+/);
@@ -16274,14 +16274,14 @@ var require_http = __commonJS({
16274
16274
  * @param {string} path - request path
16275
16275
  * @param {function} callback - Continuation to respond to when complete.
16276
16276
  */
16277
- _request(options, auth, path2, callback) {
16277
+ _request(options, auth, path3, callback) {
16278
16278
  options = options || {};
16279
16279
  auth = auth || this.auth;
16280
- path2 = path2 || this.path || "";
16280
+ path3 = path3 || this.path || "";
16281
16281
  if (this.batch) {
16282
- this._doBatch(options, callback, auth, path2);
16282
+ this._doBatch(options, callback, auth, path3);
16283
16283
  } else {
16284
- this._doRequest(options, callback, auth, path2);
16284
+ this._doRequest(options, callback, auth, path3);
16285
16285
  }
16286
16286
  }
16287
16287
  /**
@@ -16291,18 +16291,18 @@ var require_http = __commonJS({
16291
16291
  * @param {Object?} auth - authentication options
16292
16292
  * @param {string} path - request path
16293
16293
  */
16294
- _doBatch(options, callback, auth, path2) {
16294
+ _doBatch(options, callback, auth, path3) {
16295
16295
  this.batchOptions.push(options);
16296
16296
  if (this.batchOptions.length === 1) {
16297
16297
  const me = this;
16298
16298
  this.batchCallback = callback;
16299
16299
  this.batchTimeoutID = setTimeout(function() {
16300
16300
  me.batchTimeoutID = -1;
16301
- me._doBatchRequest(me.batchCallback, auth, path2);
16301
+ me._doBatchRequest(me.batchCallback, auth, path3);
16302
16302
  }, this.batchInterval);
16303
16303
  }
16304
16304
  if (this.batchOptions.length === this.batchCount) {
16305
- this._doBatchRequest(this.batchCallback, auth, path2);
16305
+ this._doBatchRequest(this.batchCallback, auth, path3);
16306
16306
  }
16307
16307
  }
16308
16308
  /**
@@ -16311,14 +16311,14 @@ var require_http = __commonJS({
16311
16311
  * @param {Object?} auth - authentication options
16312
16312
  * @param {string} path - request path
16313
16313
  */
16314
- _doBatchRequest(callback, auth, path2) {
16314
+ _doBatchRequest(callback, auth, path3) {
16315
16315
  if (this.batchTimeoutID > 0) {
16316
16316
  clearTimeout(this.batchTimeoutID);
16317
16317
  this.batchTimeoutID = -1;
16318
16318
  }
16319
16319
  const batchOptionsCopy = this.batchOptions.slice();
16320
16320
  this.batchOptions = [];
16321
- this._doRequest(batchOptionsCopy, callback, auth, path2);
16321
+ this._doRequest(batchOptionsCopy, callback, auth, path3);
16322
16322
  }
16323
16323
  /**
16324
16324
  * Make a request to a winstond server or any http server which can
@@ -16328,7 +16328,7 @@ var require_http = __commonJS({
16328
16328
  * @param {Object?} auth - authentication options
16329
16329
  * @param {string} path - request path
16330
16330
  */
16331
- _doRequest(options, callback, auth, path2) {
16331
+ _doRequest(options, callback, auth, path3) {
16332
16332
  const headers = Object.assign({}, this.headers);
16333
16333
  if (auth && auth.bearer) {
16334
16334
  headers.Authorization = `Bearer ${auth.bearer}`;
@@ -16338,7 +16338,7 @@ var require_http = __commonJS({
16338
16338
  method: "POST",
16339
16339
  host: this.host,
16340
16340
  port: this.port,
16341
- path: `/${path2.replace(/^\//, "")}`,
16341
+ path: `/${path3.replace(/^\//, "")}`,
16342
16342
  headers,
16343
16343
  auth: auth && auth.username && auth.password ? `${auth.username}:${auth.password}` : "",
16344
16344
  agent: this.agent
@@ -22412,7 +22412,7 @@ var require_FileStreamRotator = __commonJS({
22412
22412
  "node_modules/.pnpm/file-stream-rotator@0.6.1/node_modules/file-stream-rotator/FileStreamRotator.js"(exports2, module2) {
22413
22413
  "use strict";
22414
22414
  var fs = require("fs");
22415
- var path2 = require("path");
22415
+ var path3 = require("path");
22416
22416
  var moment = require_moment();
22417
22417
  var crypto = require("crypto");
22418
22418
  var EventEmitter = require("events");
@@ -22502,13 +22502,13 @@ var require_FileStreamRotator = __commonJS({
22502
22502
  var use_days = max_logs.toString().substr(-1);
22503
22503
  var _num = max_logs.toString().match(/^(\d+)/);
22504
22504
  if (Number(_num[1]) > 0) {
22505
- var baseLog = path2.dirname(log_file.replace(/%DATE%.+/, "_filename"));
22505
+ var baseLog = path3.dirname(log_file.replace(/%DATE%.+/, "_filename"));
22506
22506
  try {
22507
22507
  if (audit_file) {
22508
- var full_path = path2.resolve(audit_file);
22508
+ var full_path = path3.resolve(audit_file);
22509
22509
  _rtn = JSON.parse(fs.readFileSync(full_path, { encoding: "utf-8" }));
22510
22510
  } else {
22511
- var full_path = path2.resolve(baseLog + "/.audit.json");
22511
+ var full_path = path3.resolve(baseLog + "/.audit.json");
22512
22512
  _rtn = JSON.parse(fs.readFileSync(full_path, { encoding: "utf-8" }));
22513
22513
  }
22514
22514
  } catch (e) {
@@ -22557,8 +22557,8 @@ var require_FileStreamRotator = __commonJS({
22557
22557
  }
22558
22558
  function createCurrentSymLink(logfile, name, verbose) {
22559
22559
  let symLinkName = name || "current.log";
22560
- let logPath = path2.dirname(logfile);
22561
- let logfileName = path2.basename(logfile);
22560
+ let logPath = path3.dirname(logfile);
22561
+ let logfileName = path3.basename(logfile);
22562
22562
  let current = logPath + "/" + symLinkName;
22563
22563
  try {
22564
22564
  let stats = fs.lstatSync(current);
@@ -22823,10 +22823,10 @@ var require_FileStreamRotator = __commonJS({
22823
22823
  }
22824
22824
  };
22825
22825
  var mkDirForFile = function(pathWithFile) {
22826
- var _path = path2.dirname(pathWithFile);
22827
- _path.split(path2.sep).reduce(
22826
+ var _path = path3.dirname(pathWithFile);
22827
+ _path.split(path3.sep).reduce(
22828
22828
  function(fullPath, folder) {
22829
- fullPath += folder + path2.sep;
22829
+ fullPath += folder + path3.sep;
22830
22830
  if (!fs.existsSync(fullPath)) {
22831
22831
  try {
22832
22832
  fs.mkdirSync(fullPath);
@@ -22863,7 +22863,7 @@ var require_daily_rotate_file = __commonJS({
22863
22863
  "node_modules/.pnpm/winston-daily-rotate-file@5.0.0_winston@3.19.0/node_modules/winston-daily-rotate-file/daily-rotate-file.js"(exports2, module2) {
22864
22864
  var fs = require("fs");
22865
22865
  var os = require("os");
22866
- var path2 = require("path");
22866
+ var path3 = require("path");
22867
22867
  var util2 = require("util");
22868
22868
  var zlib = require("zlib");
22869
22869
  var hash = require_object_hash();
@@ -22921,20 +22921,20 @@ var require_daily_rotate_file = __commonJS({
22921
22921
  this.logStream = new PassThrough();
22922
22922
  this.logStream.pipe(options.stream);
22923
22923
  } else {
22924
- this.filename = options.filename ? path2.basename(options.filename) : "winston.log";
22925
- this.dirname = options.dirname || path2.dirname(options.filename);
22924
+ this.filename = options.filename ? path3.basename(options.filename) : "winston.log";
22925
+ this.dirname = options.dirname || path3.dirname(options.filename);
22926
22926
  if (!isValidFileName(this.filename) || !isValidDirName(this.dirname)) {
22927
22927
  throw new Error("Your path or filename contain an invalid character.");
22928
22928
  }
22929
22929
  this.logStream = require_FileStreamRotator().getStream({
22930
- filename: path2.join(this.dirname, this.filename),
22930
+ filename: path3.join(this.dirname, this.filename),
22931
22931
  frequency: options.frequency ? options.frequency : "custom",
22932
22932
  date_format: options.datePattern ? options.datePattern : "YYYY-MM-DD",
22933
22933
  verbose: false,
22934
22934
  size: getMaxSize(options.maxSize),
22935
22935
  max_logs: options.maxFiles,
22936
22936
  end_stream: true,
22937
- audit_file: options.auditFile ? options.auditFile : path2.join(this.dirname, "." + hash(options) + "-audit.json"),
22937
+ audit_file: options.auditFile ? options.auditFile : path3.join(this.dirname, "." + hash(options) + "-audit.json"),
22938
22938
  file_options: options.options ? options.options : { flags: "a" },
22939
22939
  utc: options.utc ? options.utc : false,
22940
22940
  extension: options.extension ? options.extension : "",
@@ -23064,7 +23064,7 @@ var require_daily_rotate_file = __commonJS({
23064
23064
  options.order = options.order || "desc";
23065
23065
  const logFiles = (() => {
23066
23066
  const fileRegex = new RegExp(this.filename.replace("%DATE%", ".*"), "i");
23067
- return fs.readdirSync(this.dirname).filter((file) => path2.basename(file).match(fileRegex));
23067
+ return fs.readdirSync(this.dirname).filter((file) => path3.basename(file).match(fileRegex));
23068
23068
  })();
23069
23069
  if (logFiles.length === 0 && callback) {
23070
23070
  callback(null, results);
@@ -23073,7 +23073,7 @@ var require_daily_rotate_file = __commonJS({
23073
23073
  if (!file) {
23074
23074
  return;
23075
23075
  }
23076
- const logFile = path2.join(this.dirname, file);
23076
+ const logFile = path3.join(this.dirname, file);
23077
23077
  let buff = "";
23078
23078
  let stream;
23079
23079
  if (file.endsWith(".gz")) {
@@ -23549,7 +23549,7 @@ function processIsAlive(pid) {
23549
23549
 
23550
23550
  // backend/src/scheduled-tasks/storage/database.ts
23551
23551
  var import_node_fs = require("node:fs");
23552
- var import_node_path = __toESM(require("node:path"), 1);
23552
+ var import_node_path2 = __toESM(require("node:path"), 1);
23553
23553
  var import_better_sqlite32 = __toESM(require("better-sqlite3"), 1);
23554
23554
 
23555
23555
  // packages/config-node/src/context.ts
@@ -23911,9 +23911,10 @@ var logger = createDynamicLogger();
23911
23911
 
23912
23912
  // backend/src/scheduled-tasks/run-record.ts
23913
23913
  var import_node_crypto2 = require("node:crypto");
23914
- function createScheduledRunRecord(task, trigger, scheduledFor, cwd) {
23914
+ function createScheduledRunRecord(task, trigger, scheduledFor, context) {
23915
+ const id = (0, import_node_crypto2.randomUUID)();
23915
23916
  return {
23916
- id: (0, import_node_crypto2.randomUUID)(),
23917
+ id,
23917
23918
  revision: 1,
23918
23919
  resultRevision: 0,
23919
23920
  activeAttemptId: null,
@@ -23922,7 +23923,6 @@ function createScheduledRunRecord(task, trigger, scheduledFor, cwd) {
23922
23923
  taskRevision: task.revision,
23923
23924
  snapshot: {
23924
23925
  name: task.name,
23925
- projectId: task.projectId,
23926
23926
  provider: task.provider,
23927
23927
  prompt: task.prompt,
23928
23928
  executionPolicy: task.executionPolicy ?? "sandbox",
@@ -23943,8 +23943,7 @@ function createScheduledRunRecord(task, trigger, scheduledFor, cwd) {
23943
23943
  error: null,
23944
23944
  artifacts: [],
23945
23945
  outputCursor: "0",
23946
- executionProjectId: task.projectId,
23947
- cwd,
23946
+ executionContext: context(id),
23948
23947
  threadRef: null,
23949
23948
  recoverable: false,
23950
23949
  terminalBinding: null
@@ -24429,8 +24428,8 @@ function getErrorMap() {
24429
24428
 
24430
24429
  // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
24431
24430
  var makeIssue = (params) => {
24432
- const { data, path: path2, errorMaps, issueData } = params;
24433
- const fullPath = [...path2, ...issueData.path || []];
24431
+ const { data, path: path3, errorMaps, issueData } = params;
24432
+ const fullPath = [...path3, ...issueData.path || []];
24434
24433
  const fullIssue = {
24435
24434
  ...issueData,
24436
24435
  path: fullPath
@@ -24546,11 +24545,11 @@ var errorUtil;
24546
24545
 
24547
24546
  // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
24548
24547
  var ParseInputLazyPath = class {
24549
- constructor(parent, value, path2, key) {
24548
+ constructor(parent, value, path3, key) {
24550
24549
  this._cachedPath = [];
24551
24550
  this.parent = parent;
24552
24551
  this.data = value;
24553
- this._path = path2;
24552
+ this._path = path3;
24554
24553
  this._key = key;
24555
24554
  }
24556
24555
  get path() {
@@ -28148,7 +28147,6 @@ var schedule = external_exports.discriminatedUnion("kind", [
28148
28147
  });
28149
28148
  var config = external_exports.object({
28150
28149
  name: text,
28151
- projectId: text,
28152
28150
  provider,
28153
28151
  prompt: text,
28154
28152
  model: text.optional(),
@@ -28166,6 +28164,7 @@ var config = external_exports.object({
28166
28164
  origin: external_exports.object({
28167
28165
  kind: external_exports.literal("quick-input"),
28168
28166
  quickInputId: text,
28167
+ projectId: text,
28169
28168
  projectName: text,
28170
28169
  worktreeName: text.nullable()
28171
28170
  }).optional()
@@ -28241,8 +28240,11 @@ var runSchema = external_exports.object({
28241
28240
  })
28242
28241
  ),
28243
28242
  outputCursor: external_exports.string().nullable(),
28244
- executionProjectId: text,
28245
- cwd: external_exports.string(),
28243
+ executionContext: external_exports.discriminatedUnion("kind", [
28244
+ external_exports.object({ kind: external_exports.literal("task-workspace"), cwd: text }).strict(),
28245
+ external_exports.object({ kind: external_exports.literal("project"), cwd: text, projectId: text }).strict(),
28246
+ external_exports.object({ kind: external_exports.literal("unavailable"), cwd: external_exports.null(), reason: external_exports.literal("legacy-context-unavailable"), originalProjectId: text.nullable() }).strict()
28247
+ ]),
28246
28248
  threadRef: external_exports.object({ provider, threadId: text, sessionFile: external_exports.string().optional() }).nullable(),
28247
28249
  recoverable: external_exports.boolean(),
28248
28250
  terminalBinding: external_exports.object({
@@ -28287,7 +28289,6 @@ function parseTask(row) {
28287
28289
  return parse(row, "task", taskSchema, {
28288
28290
  id: "id",
28289
28291
  revision: "revision",
28290
- project_id: "projectId",
28291
28292
  name: "name",
28292
28293
  enabled: "enabled",
28293
28294
  next_run_at: "nextRunAt",
@@ -28400,21 +28401,77 @@ INSERT INTO scheduled_run_output_chunks(run_id, end_byte, content)
28400
28401
  DROP TABLE scheduled_run_output;
28401
28402
  `;
28402
28403
 
28404
+ // backend/src/scheduled-tasks/storage/migrations/005-project-independent.ts
28405
+ var import_node_path = __toESM(require("node:path"), 1);
28406
+ var projectIndependentSql = `
28407
+ DROP INDEX scheduled_tasks_parent;
28408
+ ALTER TABLE scheduled_tasks DROP COLUMN parent_project_id;
28409
+ ALTER TABLE scheduled_tasks DROP COLUMN project_id;
28410
+ CREATE INDEX scheduled_tasks_quick_origin ON scheduled_tasks(
28411
+ json_extract(payload_json, '$.origin.projectId'), json_extract(payload_json, '$.origin.quickInputId')
28412
+ ) WHERE deleted_at IS NULL AND json_extract(payload_json, '$.origin.kind') = 'quick-input';
28413
+ CREATE TABLE scheduled_context_migration_receipts (
28414
+ idempotency_key TEXT PRIMARY KEY, request_hash TEXT NOT NULL, payload_json TEXT NOT NULL
28415
+ );
28416
+ `;
28417
+ function convertProjectRecords(database2, prompts) {
28418
+ const now = (/* @__PURE__ */ new Date()).toISOString();
28419
+ for (const row of database2.prepare("SELECT * FROM scheduled_tasks").all()) {
28420
+ const task = JSON.parse(row.payload_json);
28421
+ moveQuickOrigin(task);
28422
+ if (!task.origin?.kind) {
28423
+ const prompt = prompts.get(row.id);
28424
+ if (prompt === void 0) throw new Error("missing reviewed task");
28425
+ task.prompt = prompt;
28426
+ task.revision = Number(task.revision) + 1;
28427
+ task.updatedAt = now;
28428
+ }
28429
+ delete task.projectId;
28430
+ task.enabled = false;
28431
+ task.nextRunAt = null;
28432
+ database2.prepare("UPDATE scheduled_tasks SET revision = ?, enabled = 0, next_run_at = NULL, payload_json = ? WHERE id = ?").run(task.revision, JSON.stringify(task), row.id);
28433
+ }
28434
+ for (const row of database2.prepare("SELECT * FROM scheduled_runs").all()) {
28435
+ const run = JSON.parse(row.payload_json);
28436
+ const snapshot = run.snapshot;
28437
+ moveQuickOrigin(snapshot);
28438
+ const projectId = typeof run.executionProjectId === "string" ? run.executionProjectId : null;
28439
+ run.executionContext = typeof run.cwd === "string" && import_node_path.default.isAbsolute(run.cwd) && projectId ? { kind: "project", cwd: run.cwd, projectId } : { kind: "unavailable", cwd: null, reason: "legacy-context-unavailable", originalProjectId: projectId };
28440
+ delete snapshot.projectId;
28441
+ delete run.executionProjectId;
28442
+ delete run.cwd;
28443
+ database2.prepare("UPDATE scheduled_runs SET payload_json = ? WHERE id = ?").run(JSON.stringify(run), row.id);
28444
+ }
28445
+ }
28446
+ function validateConvertedRecords(database2) {
28447
+ for (const row of database2.prepare("SELECT * FROM scheduled_tasks").all()) parseTask(row);
28448
+ for (const row of database2.prepare("SELECT * FROM scheduled_runs").all()) parseRun(row);
28449
+ }
28450
+ function moveQuickOrigin(config2) {
28451
+ const origin = config2.origin;
28452
+ if (origin?.kind === "quick-input") {
28453
+ if (typeof config2.projectId !== "string" || !config2.projectId) throw new Error("invalid quick origin");
28454
+ origin.projectId = config2.projectId;
28455
+ }
28456
+ }
28457
+
28403
28458
  // backend/src/scheduled-tasks/storage/migrations.ts
28404
28459
  var migrations = [
28405
28460
  { version: 1, name: "initial-schema", sql: initialSchemaSql },
28406
28461
  { version: 2, name: "catch-up-data", sql: catchUpDataSql },
28407
28462
  { version: 3, name: "continuation", sql: continuationSql },
28408
- { version: 4, name: "output-chunks", sql: outputChunksSql }
28463
+ { version: 4, name: "output-chunks", sql: outputChunksSql },
28464
+ { version: 5, name: "project-independent", sql: projectIndependentSql }
28409
28465
  ];
28410
- var SCHEDULED_TASK_SCHEMA_VERSION = 4;
28411
- function migrateScheduledTasks(database2) {
28466
+ var SCHEDULED_TASK_SCHEMA_VERSION = 5;
28467
+ function migrateScheduledTasks(database2, reviewedPrompts) {
28412
28468
  database2.transaction(() => {
28413
28469
  const version = database2.pragma("user_version", {
28414
28470
  simple: true
28415
28471
  });
28416
28472
  if (version > SCHEDULED_TASK_SCHEMA_VERSION)
28417
28473
  throw new Error("scheduled_tasks_schema_too_new");
28474
+ if (version < 5 && !reviewedPrompts && database2.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='scheduled_tasks'").get() && database2.prepare("SELECT 1 FROM scheduled_tasks LIMIT 1").get()) throw new Error("scheduled_tasks_migration_required");
28418
28475
  database2.exec(`CREATE TABLE IF NOT EXISTS scheduled_schema_migrations (
28419
28476
  version INTEGER PRIMARY KEY, name TEXT NOT NULL, checksum TEXT NOT NULL,
28420
28477
  applied_at TEXT NOT NULL
@@ -28432,7 +28489,9 @@ function migrateScheduledTasks(database2) {
28432
28489
  if (migration.version === 1) assertLegacySchema(database2);
28433
28490
  try {
28434
28491
  if (migration.version === 2) assertMigrationInput(database2);
28492
+ if (migration.version === 5) convertProjectRecords(database2, reviewedPrompts ?? /* @__PURE__ */ new Map());
28435
28493
  database2.exec(migration.sql);
28494
+ if (migration.version === 5) validateConvertedRecords(database2);
28436
28495
  if (migration.version === 2) assertCurrentData(database2);
28437
28496
  } catch {
28438
28497
  throw new Error("scheduled_tasks_schema_migration_failed");
@@ -28609,7 +28668,7 @@ function listQuickInputRuns(database2, projectId, finishedSince, parse2) {
28609
28668
  const rows = database2.prepare(
28610
28669
  `SELECT * FROM scheduled_runs WHERE json_valid(payload_json)
28611
28670
  AND json_extract(payload_json, '$.snapshot.origin.kind') = 'quick-input'
28612
- AND (? IS NULL OR json_extract(payload_json, '$.snapshot.projectId') = ?)
28671
+ AND (? IS NULL OR json_extract(payload_json, '$.snapshot.origin.projectId') = ?)
28613
28672
  AND (? IS NULL OR json_extract(payload_json, '$.finishedAt') >= ?)
28614
28673
  ORDER BY CASE WHEN ? IS NULL THEN scheduled_for END DESC,
28615
28674
  CASE WHEN ? IS NOT NULL THEN json_extract(payload_json, '$.finishedAt') END ASC,
@@ -28635,7 +28694,7 @@ var ScheduledTaskDatabase = class {
28635
28694
  executions;
28636
28695
  invalidRecords = /* @__PURE__ */ new Set();
28637
28696
  constructor(databasePath) {
28638
- (0, import_node_fs.mkdirSync)(import_node_path.default.dirname(databasePath), { recursive: true, mode: 448 });
28697
+ (0, import_node_fs.mkdirSync)(import_node_path2.default.dirname(databasePath), { recursive: true, mode: 448 });
28639
28698
  this.database = new import_better_sqlite32.default(databasePath);
28640
28699
  this.executions = new ScheduledExecutions(
28641
28700
  this.database,
@@ -28659,7 +28718,7 @@ var ScheduledTaskDatabase = class {
28659
28718
  close() {
28660
28719
  this.database.close();
28661
28720
  }
28662
- createTask(task, parentProjectId, idempotencyKey, requestHash) {
28721
+ createTask(task, idempotencyKey, requestHash) {
28663
28722
  return this.database.transaction(() => {
28664
28723
  const existing = this.readIdempotency("create-task", idempotencyKey);
28665
28724
  if (existing) {
@@ -28667,7 +28726,7 @@ var ScheduledTaskDatabase = class {
28667
28726
  throw new Error("idempotency_conflict");
28668
28727
  return this.requireTask(existing.resourceId);
28669
28728
  }
28670
- this.insertTask(task, parentProjectId);
28729
+ this.insertTask(task);
28671
28730
  this.insertIdempotency(
28672
28731
  "create-task",
28673
28732
  idempotencyKey,
@@ -28678,6 +28737,12 @@ var ScheduledTaskDatabase = class {
28678
28737
  return task;
28679
28738
  })();
28680
28739
  }
28740
+ replayCreate(requestHash, key) {
28741
+ const existing = this.readIdempotency("create-task", key);
28742
+ if (!existing) return null;
28743
+ if (existing.requestHash !== requestHash) throw new Error("idempotency_conflict");
28744
+ return this.requireTask(existing.resourceId);
28745
+ }
28681
28746
  getTask(taskId) {
28682
28747
  const row = this.database.prepare("SELECT * FROM scheduled_tasks WHERE id = ?").get(taskId);
28683
28748
  return row ? parseTask(row) : null;
@@ -28685,13 +28750,11 @@ var ScheduledTaskDatabase = class {
28685
28750
  listTasks() {
28686
28751
  return this.database.prepare("SELECT * FROM scheduled_tasks ORDER BY rowid DESC").all().map((row) => parseTask(row));
28687
28752
  }
28688
- updateTask(task, expectedRevision, parentProjectId) {
28753
+ updateTask(task, expectedRevision) {
28689
28754
  const result = this.database.prepare(
28690
- `UPDATE scheduled_tasks SET revision = ?, parent_project_id = ?, project_id = ?, name = ?, enabled = ?, next_run_at = ?, deleted_at = ?, payload_json = ? WHERE id = ? AND revision = ?`
28755
+ `UPDATE scheduled_tasks SET revision = ?, name = ?, enabled = ?, next_run_at = ?, deleted_at = ?, payload_json = ? WHERE id = ? AND revision = ?`
28691
28756
  ).run(
28692
28757
  task.revision,
28693
- parentProjectId,
28694
- task.projectId,
28695
28758
  task.name,
28696
28759
  task.enabled ? 1 : 0,
28697
28760
  task.nextRunAt,
@@ -28735,7 +28798,7 @@ var ScheduledTaskDatabase = class {
28735
28798
  nextRunAt,
28736
28799
  enabled: task.schedule.kind === "once" ? false : task.enabled
28737
28800
  };
28738
- this.updateTaskRow(updated, this.parentProjectId(run.taskId));
28801
+ this.updateTaskRow(updated);
28739
28802
  return stored;
28740
28803
  })();
28741
28804
  }
@@ -28771,24 +28834,24 @@ var ScheduledTaskDatabase = class {
28771
28834
  throw new Error("idempotency_conflict");
28772
28835
  return this.requireRun(existing.resourceId);
28773
28836
  }
28774
- createQuickInputRun(candidate, parentProjectId, cwd, idempotencyKey, requestHash) {
28837
+ createQuickInputRun(candidate, cwd, idempotencyKey, requestHash) {
28775
28838
  return this.database.transaction(() => {
28776
28839
  const quickInputId = candidate.origin?.quickInputId;
28777
28840
  if (!quickInputId || candidate.origin?.kind !== "quick-input")
28778
28841
  throw new Error("invalid_quick_input_task");
28779
28842
  const prior = this.findQuickInputRun(
28780
28843
  quickInputId,
28781
- candidate.projectId,
28844
+ candidate.origin.projectId,
28782
28845
  idempotencyKey,
28783
28846
  requestHash
28784
28847
  );
28785
28848
  if (prior) return prior;
28786
28849
  const row = this.database.prepare(
28787
- `SELECT * FROM scheduled_tasks WHERE project_id = ? AND deleted_at IS NULL
28850
+ `SELECT * FROM scheduled_tasks WHERE json_extract(payload_json, '$.origin.projectId') = ? AND deleted_at IS NULL
28788
28851
  AND json_valid(payload_json)
28789
28852
  AND json_extract(payload_json, '$.origin.kind') = 'quick-input'
28790
28853
  AND json_extract(payload_json, '$.origin.quickInputId') = ? LIMIT 1`
28791
- ).get(candidate.projectId, quickInputId);
28854
+ ).get(candidate.origin.projectId, quickInputId);
28792
28855
  const previous = row ? parseTask(row) : null;
28793
28856
  if (previous) {
28794
28857
  const busy = this.findUnfinished(previous.id);
@@ -28800,12 +28863,12 @@ var ScheduledTaskDatabase = class {
28800
28863
  revision: previous.revision + 1,
28801
28864
  createdAt: previous.createdAt
28802
28865
  } : candidate;
28803
- if (previous) this.updateTaskRow(task, parentProjectId);
28804
- else this.insertTask(task, parentProjectId);
28805
- const run = createScheduledRunRecord(task, "manual", task.updatedAt, cwd);
28866
+ if (previous) this.updateTaskRow(task);
28867
+ else this.insertTask(task);
28868
+ const run = createScheduledRunRecord(task, "manual", task.updatedAt, () => ({ kind: "project", projectId: task.origin.projectId, cwd }));
28806
28869
  this.insertRun(run, `manual:${run.id}`);
28807
28870
  this.insertIdempotency(
28808
- `quick-input-run:${quickInputId}:${task.projectId}`,
28871
+ `quick-input-run:${quickInputId}:${task.origin.projectId}`,
28809
28872
  idempotencyKey,
28810
28873
  requestHash,
28811
28874
  run.id,
@@ -28957,14 +29020,12 @@ var ScheduledTaskDatabase = class {
28957
29020
  return null;
28958
29021
  }
28959
29022
  }
28960
- insertTask(task, parentProjectId) {
29023
+ insertTask(task) {
28961
29024
  this.database.prepare(
28962
- `INSERT INTO scheduled_tasks(id, revision, parent_project_id, project_id, name, enabled, next_run_at, deleted_at, payload_json) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`
29025
+ `INSERT INTO scheduled_tasks(id, revision, name, enabled, next_run_at, deleted_at, payload_json) VALUES (?, ?, ?, ?, ?, ?, ?)`
28963
29026
  ).run(
28964
29027
  task.id,
28965
29028
  task.revision,
28966
- parentProjectId,
28967
- task.projectId,
28968
29029
  task.name,
28969
29030
  task.enabled ? 1 : 0,
28970
29031
  task.nextRunAt,
@@ -28972,13 +29033,11 @@ var ScheduledTaskDatabase = class {
28972
29033
  JSON.stringify(task)
28973
29034
  );
28974
29035
  }
28975
- updateTaskRow(task, parentProjectId) {
29036
+ updateTaskRow(task) {
28976
29037
  this.database.prepare(
28977
- `UPDATE scheduled_tasks SET revision = ?, parent_project_id = ?, project_id = ?, name = ?, enabled = ?, next_run_at = ?, deleted_at = ?, payload_json = ? WHERE id = ?`
29038
+ `UPDATE scheduled_tasks SET revision = ?, name = ?, enabled = ?, next_run_at = ?, deleted_at = ?, payload_json = ? WHERE id = ?`
28978
29039
  ).run(
28979
29040
  task.revision,
28980
- parentProjectId,
28981
- task.projectId,
28982
29041
  task.name,
28983
29042
  task.enabled ? 1 : 0,
28984
29043
  task.nextRunAt,
@@ -29018,11 +29077,6 @@ var ScheduledTaskDatabase = class {
29018
29077
  if (!run) throw new Error("scheduled_run_not_found");
29019
29078
  return run;
29020
29079
  }
29021
- parentProjectId(taskId) {
29022
- const row = this.database.prepare("SELECT parent_project_id FROM scheduled_tasks WHERE id = ?").get(taskId);
29023
- if (!row) throw new Error("scheduled_task_not_found");
29024
- return row.parent_project_id;
29025
- }
29026
29080
  readIdempotency(scope, key) {
29027
29081
  const row = this.database.prepare(
29028
29082
  "SELECT request_hash, resource_id FROM scheduled_idempotency WHERE scope = ? AND idempotency_key = ?"
@@ -29044,6 +29098,8 @@ var database = new ScheduledTaskDatabase(
29044
29098
  );
29045
29099
  function execute(command) {
29046
29100
  switch (command.op) {
29101
+ case "replay-create":
29102
+ return database.replayCreate(command.requestHash, command.key);
29047
29103
  case "list-attempts":
29048
29104
  return database.listAttempts(command.runId);
29049
29105
  case "set-run-thread":
@@ -29076,7 +29132,6 @@ function execute(command) {
29076
29132
  case "create-task":
29077
29133
  return database.createTask(
29078
29134
  command.task,
29079
- command.parentProjectId,
29080
29135
  command.idempotencyKey,
29081
29136
  command.requestHash
29082
29137
  );
@@ -29087,8 +29142,7 @@ function execute(command) {
29087
29142
  case "update-task":
29088
29143
  return database.updateTask(
29089
29144
  command.task,
29090
- command.expectedRevision,
29091
- command.parentProjectId
29145
+ command.expectedRevision
29092
29146
  );
29093
29147
  case "list-due-tasks":
29094
29148
  return database.listDueTasks(command.through);
@@ -29116,7 +29170,6 @@ function execute(command) {
29116
29170
  case "create-quick-input-run":
29117
29171
  return database.createQuickInputRun(
29118
29172
  command.task,
29119
- command.parentProjectId,
29120
29173
  command.cwd,
29121
29174
  command.idempotencyKey,
29122
29175
  command.requestHash