@critical-path/svelte 0.18.19 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -203,9 +203,7 @@ var s = class {
203
203
  let t = await e;
204
204
  t && t.id && await this.client.deleteTask(t.id);
205
205
  } catch {}
206
- return;
207
- }
208
- try {
206
+ } else try {
209
207
  await this.client.deleteTask(t);
210
208
  } catch (e) {
211
209
  if (i && r !== -1) {
@@ -347,18 +345,17 @@ var ne = class {
347
345
  }
348
346
  async fetch(e) {
349
347
  let { api: t, signal: n } = this.#e.begin(this.client), r = e || this.taskId;
350
- if (!r) {
351
- this.data = [];
352
- return;
353
- }
354
- this.taskId = r, this.loading = !0, this.error = null;
355
- try {
356
- if (this.data = await t.getComments(r), n.aborted) return;
357
- } catch (e) {
358
- if (n.aborted) return;
359
- this.error = e instanceof Error ? e : Error(String(e));
360
- } finally {
361
- n.aborted || (this.loading = !1);
348
+ if (!r) this.data = [];
349
+ else {
350
+ this.taskId = r, this.loading = !0, this.error = null;
351
+ try {
352
+ if (this.data = await t.getComments(r), n.aborted) return;
353
+ } catch (e) {
354
+ if (n.aborted) return;
355
+ this.error = e instanceof Error ? e : Error(String(e));
356
+ } finally {
357
+ n.aborted || (this.loading = !1);
358
+ }
362
359
  }
363
360
  }
364
361
  async addComment(e) {
@@ -554,20 +551,19 @@ var oe = class {
554
551
  }
555
552
  async fetch(e) {
556
553
  let { api: t, signal: n } = this.#e.begin(this.client), r = e || this.taskId;
557
- if (!r) {
558
- this.comments = [], this.attachments = [];
559
- return;
560
- }
561
- this.taskId = r, this.loading = !0, this.error = null;
562
- try {
563
- let [e, i] = await Promise.all([t.getComments(r), t.getAttachments({ taskId: r })]);
564
- if (n.aborted) return;
565
- this.comments = e, this.attachments = i;
566
- } catch (e) {
567
- if (n.aborted) return;
568
- this.error = e instanceof Error ? e : Error(String(e));
569
- } finally {
570
- n.aborted || (this.loading = !1);
554
+ if (!r) this.comments = [], this.attachments = [];
555
+ else {
556
+ this.taskId = r, this.loading = !0, this.error = null;
557
+ try {
558
+ let [e, i] = await Promise.all([t.getComments(r), t.getAttachments({ taskId: r })]);
559
+ if (n.aborted) return;
560
+ this.comments = e, this.attachments = i;
561
+ } catch (e) {
562
+ if (n.aborted) return;
563
+ this.error = e instanceof Error ? e : Error(String(e));
564
+ } finally {
565
+ n.aborted || (this.loading = !1);
566
+ }
571
567
  }
572
568
  }
573
569
  async addComment(e, t) {
@@ -774,18 +770,17 @@ var ue = class {
774
770
  }
775
771
  async fetch(e) {
776
772
  let { api: t, signal: n } = this.#e.begin(this.client), r = e || this.deliverableId;
777
- if (!r) {
778
- this.summary = null, this.loading = !1;
779
- return;
780
- }
781
- this.deliverableId = r, this.loading = !0, this.error = null;
782
- try {
783
- if (this.summary = await t.getDeliverableSummary(r), n.aborted) return;
784
- } catch (e) {
785
- if (n.aborted) return;
786
- this.error = e instanceof Error ? e : Error(String(e));
787
- } finally {
788
- n.aborted || (this.loading = !1);
773
+ if (!r) this.summary = null, this.loading = !1;
774
+ else {
775
+ this.deliverableId = r, this.loading = !0, this.error = null;
776
+ try {
777
+ if (this.summary = await t.getDeliverableSummary(r), n.aborted) return;
778
+ } catch (e) {
779
+ if (n.aborted) return;
780
+ this.error = e instanceof Error ? e : Error(String(e));
781
+ } finally {
782
+ n.aborted || (this.loading = !1);
783
+ }
789
784
  }
790
785
  }
791
786
  destroy() {
@@ -894,18 +889,17 @@ var me = class {
894
889
  }
895
890
  async fetch(e) {
896
891
  let { api: t, signal: n } = this.#e.begin(this.client), r = e || this.taskId;
897
- if (!r) {
898
- this.allowedTransitions = [], this.loading = !1;
899
- return;
900
- }
901
- this.taskId = r, this.loading = !0, this.error = null;
902
- try {
903
- if (this.allowedTransitions = await t.getAllowedTaskTransitions(r), n.aborted) return;
904
- } catch (e) {
905
- if (n.aborted) return;
906
- this.error = e instanceof Error ? e : Error(String(e));
907
- } finally {
908
- n.aborted || (this.loading = !1);
892
+ if (!r) this.allowedTransitions = [], this.loading = !1;
893
+ else {
894
+ this.taskId = r, this.loading = !0, this.error = null;
895
+ try {
896
+ if (this.allowedTransitions = await t.getAllowedTaskTransitions(r), n.aborted) return;
897
+ } catch (e) {
898
+ if (n.aborted) return;
899
+ this.error = e instanceof Error ? e : Error(String(e));
900
+ } finally {
901
+ n.aborted || (this.loading = !1);
902
+ }
909
903
  }
910
904
  }
911
905
  destroy() {
@@ -1385,9 +1379,9 @@ var C = class {
1385
1379
  return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
1386
1380
  }
1387
1381
  _refinement(e) {
1388
- return new N({
1382
+ return new M({
1389
1383
  schema: this,
1390
- typeName: R.ZodEffects,
1384
+ typeName: F.ZodEffects,
1391
1385
  effect: {
1392
1386
  type: "refinement",
1393
1387
  refinement: e
@@ -1405,31 +1399,31 @@ var C = class {
1405
1399
  };
1406
1400
  }
1407
1401
  optional() {
1408
- return P.create(this, this._def);
1402
+ return N.create(this, this._def);
1409
1403
  }
1410
1404
  nullable() {
1411
- return F.create(this, this._def);
1405
+ return P.create(this, this._def);
1412
1406
  }
1413
1407
  nullish() {
1414
1408
  return this.nullable().optional();
1415
1409
  }
1416
1410
  array() {
1417
- return D.create(this);
1411
+ return E.create(this);
1418
1412
  }
1419
1413
  promise() {
1420
- return M.create(this, this._def);
1414
+ return j.create(this, this._def);
1421
1415
  }
1422
1416
  or(e) {
1423
- return at.create([this, e], this._def);
1417
+ return ot.create([this, e], this._def);
1424
1418
  }
1425
1419
  and(e) {
1426
- return ct.create(this, e, this._def);
1420
+ return lt.create(this, e, this._def);
1427
1421
  }
1428
1422
  transform(e) {
1429
- return new N({
1423
+ return new M({
1430
1424
  ...S(this._def),
1431
1425
  schema: this,
1432
- typeName: R.ZodEffects,
1426
+ typeName: F.ZodEffects,
1433
1427
  effect: {
1434
1428
  type: "transform",
1435
1429
  transform: e
@@ -1438,27 +1432,27 @@ var C = class {
1438
1432
  }
1439
1433
  default(e) {
1440
1434
  let t = typeof e == "function" ? e : () => e;
1441
- return new I({
1435
+ return new yt({
1442
1436
  ...S(this._def),
1443
1437
  innerType: this,
1444
1438
  defaultValue: t,
1445
- typeName: R.ZodDefault
1439
+ typeName: F.ZodDefault
1446
1440
  });
1447
1441
  }
1448
1442
  brand() {
1449
- return new yt({
1450
- typeName: R.ZodBranded,
1443
+ return new St({
1444
+ typeName: F.ZodBranded,
1451
1445
  type: this,
1452
1446
  ...S(this._def)
1453
1447
  });
1454
1448
  }
1455
1449
  catch(e) {
1456
1450
  let t = typeof e == "function" ? e : () => e;
1457
- return new L({
1451
+ return new bt({
1458
1452
  ...S(this._def),
1459
1453
  innerType: this,
1460
1454
  catchValue: t,
1461
- typeName: R.ZodCatch
1455
+ typeName: F.ZodCatch
1462
1456
  });
1463
1457
  }
1464
1458
  describe(e) {
@@ -1469,10 +1463,10 @@ var C = class {
1469
1463
  });
1470
1464
  }
1471
1465
  pipe(e) {
1472
- return bt.create(this, e);
1466
+ return Ct.create(this, e);
1473
1467
  }
1474
1468
  readonly() {
1475
- return xt.create(this);
1469
+ return wt.create(this);
1476
1470
  }
1477
1471
  isOptional() {
1478
1472
  return this.safeParse(void 0).success;
@@ -1495,7 +1489,7 @@ function Ge(e) {
1495
1489
  return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
1496
1490
  }
1497
1491
  function Ke(e, t) {
1498
- return !!((t === "v4" || !t) && Fe.test(e) || (t === "v6" || !t) && Le.test(e));
1492
+ return !((t !== "v4" && t || !Fe.test(e)) && (t !== "v6" && t || !Le.test(e)));
1499
1493
  }
1500
1494
  function qe(e, t) {
1501
1495
  if (!Ae.test(e)) return !1;
@@ -1509,9 +1503,9 @@ function qe(e, t) {
1509
1503
  }
1510
1504
  }
1511
1505
  function Je(e, t) {
1512
- return !!((t === "v4" || !t) && Ie.test(e) || (t === "v6" || !t) && Re.test(e));
1506
+ return !((t !== "v4" && t || !Ie.test(e)) && (t !== "v6" && t || !Re.test(e)));
1513
1507
  }
1514
- var w = class e extends C {
1508
+ var Ye = class e extends C {
1515
1509
  _parse(e) {
1516
1510
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== u.string) {
1517
1511
  let t = this._getOrReturnCtx(e);
@@ -1919,17 +1913,17 @@ var w = class e extends C {
1919
1913
  return e;
1920
1914
  }
1921
1915
  };
1922
- w.create = (e) => new w({
1916
+ Ye.create = (e) => new Ye({
1923
1917
  checks: [],
1924
- typeName: R.ZodString,
1918
+ typeName: F.ZodString,
1925
1919
  coerce: e?.coerce ?? !1,
1926
1920
  ...S(e)
1927
1921
  });
1928
- function Ye(e, t) {
1922
+ function Xe(e, t) {
1929
1923
  let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
1930
1924
  return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
1931
1925
  }
1932
- var Xe = class e extends C {
1926
+ var Ze = class e extends C {
1933
1927
  constructor() {
1934
1928
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1935
1929
  }
@@ -1962,7 +1956,7 @@ var Xe = class e extends C {
1962
1956
  inclusive: r.inclusive,
1963
1957
  exact: !1,
1964
1958
  message: r.message
1965
- }), n.dirty()) : r.kind === "multipleOf" ? Ye(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), h(t, {
1959
+ }), n.dirty()) : r.kind === "multipleOf" ? Xe(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), h(t, {
1966
1960
  code: f.not_multiple_of,
1967
1961
  multipleOf: r.value,
1968
1962
  message: r.message
@@ -2088,13 +2082,13 @@ var Xe = class e extends C {
2088
2082
  return Number.isFinite(t) && Number.isFinite(e);
2089
2083
  }
2090
2084
  };
2091
- Xe.create = (e) => new Xe({
2085
+ Ze.create = (e) => new Ze({
2092
2086
  checks: [],
2093
- typeName: R.ZodNumber,
2087
+ typeName: F.ZodNumber,
2094
2088
  coerce: e?.coerce || !1,
2095
2089
  ...S(e)
2096
2090
  });
2097
- var Ze = class e extends C {
2091
+ var Qe = class e extends C {
2098
2092
  constructor() {
2099
2093
  super(...arguments), this.min = this.gte, this.max = this.lte;
2100
2094
  }
@@ -2215,13 +2209,13 @@ var Ze = class e extends C {
2215
2209
  return e;
2216
2210
  }
2217
2211
  };
2218
- Ze.create = (e) => new Ze({
2212
+ Qe.create = (e) => new Qe({
2219
2213
  checks: [],
2220
- typeName: R.ZodBigInt,
2214
+ typeName: F.ZodBigInt,
2221
2215
  coerce: e?.coerce ?? !1,
2222
2216
  ...S(e)
2223
2217
  });
2224
- var Qe = class extends C {
2218
+ var $e = class extends C {
2225
2219
  _parse(e) {
2226
2220
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
2227
2221
  let t = this._getOrReturnCtx(e);
@@ -2234,12 +2228,12 @@ var Qe = class extends C {
2234
2228
  return v(e.data);
2235
2229
  }
2236
2230
  };
2237
- Qe.create = (e) => new Qe({
2238
- typeName: R.ZodBoolean,
2231
+ $e.create = (e) => new $e({
2232
+ typeName: F.ZodBoolean,
2239
2233
  coerce: e?.coerce || !1,
2240
2234
  ...S(e)
2241
2235
  });
2242
- var $e = class e extends C {
2236
+ var et = class e extends C {
2243
2237
  _parse(e) {
2244
2238
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== u.date) {
2245
2239
  let t = this._getOrReturnCtx(e);
@@ -2302,13 +2296,13 @@ var $e = class e extends C {
2302
2296
  return e == null ? null : new Date(e);
2303
2297
  }
2304
2298
  };
2305
- $e.create = (e) => new $e({
2299
+ et.create = (e) => new et({
2306
2300
  checks: [],
2307
2301
  coerce: e?.coerce || !1,
2308
- typeName: R.ZodDate,
2302
+ typeName: F.ZodDate,
2309
2303
  ...S(e)
2310
2304
  });
2311
- var et = class extends C {
2305
+ var tt = class extends C {
2312
2306
  _parse(e) {
2313
2307
  if (this._getType(e) !== u.symbol) {
2314
2308
  let t = this._getOrReturnCtx(e);
@@ -2321,11 +2315,11 @@ var et = class extends C {
2321
2315
  return v(e.data);
2322
2316
  }
2323
2317
  };
2324
- et.create = (e) => new et({
2325
- typeName: R.ZodSymbol,
2318
+ tt.create = (e) => new tt({
2319
+ typeName: F.ZodSymbol,
2326
2320
  ...S(e)
2327
2321
  });
2328
- var tt = class extends C {
2322
+ var nt = class extends C {
2329
2323
  _parse(e) {
2330
2324
  if (this._getType(e) !== u.undefined) {
2331
2325
  let t = this._getOrReturnCtx(e);
@@ -2338,11 +2332,11 @@ var tt = class extends C {
2338
2332
  return v(e.data);
2339
2333
  }
2340
2334
  };
2341
- tt.create = (e) => new tt({
2342
- typeName: R.ZodUndefined,
2335
+ nt.create = (e) => new nt({
2336
+ typeName: F.ZodUndefined,
2343
2337
  ...S(e)
2344
2338
  });
2345
- var nt = class extends C {
2339
+ var rt = class extends C {
2346
2340
  _parse(e) {
2347
2341
  if (this._getType(e) !== u.null) {
2348
2342
  let t = this._getOrReturnCtx(e);
@@ -2355,11 +2349,11 @@ var nt = class extends C {
2355
2349
  return v(e.data);
2356
2350
  }
2357
2351
  };
2358
- nt.create = (e) => new nt({
2359
- typeName: R.ZodNull,
2352
+ rt.create = (e) => new rt({
2353
+ typeName: F.ZodNull,
2360
2354
  ...S(e)
2361
2355
  });
2362
- var rt = class extends C {
2356
+ var it = class extends C {
2363
2357
  constructor() {
2364
2358
  super(...arguments), this._any = !0;
2365
2359
  }
@@ -2367,11 +2361,11 @@ var rt = class extends C {
2367
2361
  return v(e.data);
2368
2362
  }
2369
2363
  };
2370
- rt.create = (e) => new rt({
2371
- typeName: R.ZodAny,
2364
+ it.create = (e) => new it({
2365
+ typeName: F.ZodAny,
2372
2366
  ...S(e)
2373
2367
  });
2374
- var T = class extends C {
2368
+ var w = class extends C {
2375
2369
  constructor() {
2376
2370
  super(...arguments), this._unknown = !0;
2377
2371
  }
@@ -2379,11 +2373,11 @@ var T = class extends C {
2379
2373
  return v(e.data);
2380
2374
  }
2381
2375
  };
2382
- T.create = (e) => new T({
2383
- typeName: R.ZodUnknown,
2376
+ w.create = (e) => new w({
2377
+ typeName: F.ZodUnknown,
2384
2378
  ...S(e)
2385
2379
  });
2386
- var E = class extends C {
2380
+ var T = class extends C {
2387
2381
  _parse(e) {
2388
2382
  let t = this._getOrReturnCtx(e);
2389
2383
  return h(t, {
@@ -2393,11 +2387,11 @@ var E = class extends C {
2393
2387
  }), _;
2394
2388
  }
2395
2389
  };
2396
- E.create = (e) => new E({
2397
- typeName: R.ZodNever,
2390
+ T.create = (e) => new T({
2391
+ typeName: F.ZodNever,
2398
2392
  ...S(e)
2399
2393
  });
2400
- var it = class extends C {
2394
+ var at = class extends C {
2401
2395
  _parse(e) {
2402
2396
  if (this._getType(e) !== u.undefined) {
2403
2397
  let t = this._getOrReturnCtx(e);
@@ -2410,11 +2404,11 @@ var it = class extends C {
2410
2404
  return v(e.data);
2411
2405
  }
2412
2406
  };
2413
- it.create = (e) => new it({
2414
- typeName: R.ZodVoid,
2407
+ at.create = (e) => new at({
2408
+ typeName: F.ZodVoid,
2415
2409
  ...S(e)
2416
2410
  });
2417
- var D = class e extends C {
2411
+ var E = class e extends C {
2418
2412
  _parse(e) {
2419
2413
  let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
2420
2414
  if (t.parsedType !== u.array) return h(t, {
@@ -2486,32 +2480,32 @@ var D = class e extends C {
2486
2480
  return this.min(1, e);
2487
2481
  }
2488
2482
  };
2489
- D.create = (e, t) => new D({
2483
+ E.create = (e, t) => new E({
2490
2484
  type: e,
2491
2485
  minLength: null,
2492
2486
  maxLength: null,
2493
2487
  exactLength: null,
2494
- typeName: R.ZodArray,
2488
+ typeName: F.ZodArray,
2495
2489
  ...S(t)
2496
2490
  });
2497
- function O(e) {
2498
- if (e instanceof k) {
2491
+ function D(e) {
2492
+ if (e instanceof O) {
2499
2493
  let t = {};
2500
2494
  for (let n in e.shape) {
2501
2495
  let r = e.shape[n];
2502
- t[n] = P.create(O(r));
2496
+ t[n] = N.create(D(r));
2503
2497
  }
2504
- return new k({
2498
+ return new O({
2505
2499
  ...e._def,
2506
2500
  shape: () => t
2507
2501
  });
2508
2502
  }
2509
- return e instanceof D ? new D({
2503
+ return e instanceof E ? new E({
2510
2504
  ...e._def,
2511
- type: O(e.element)
2512
- }) : e instanceof P ? P.create(O(e.unwrap())) : e instanceof F ? F.create(O(e.unwrap())) : e instanceof j ? j.create(e.items.map((e) => O(e))) : e;
2505
+ type: D(e.element)
2506
+ }) : e instanceof N ? N.create(D(e.unwrap())) : e instanceof P ? P.create(D(e.unwrap())) : e instanceof A ? A.create(e.items.map((e) => D(e))) : e;
2513
2507
  }
2514
- var k = class e extends C {
2508
+ var O = class e extends C {
2515
2509
  constructor() {
2516
2510
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
2517
2511
  }
@@ -2533,7 +2527,7 @@ var k = class e extends C {
2533
2527
  }), _;
2534
2528
  }
2535
2529
  let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
2536
- if (!(this._def.catchall instanceof E && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
2530
+ if (!(this._def.catchall instanceof T && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
2537
2531
  let o = [];
2538
2532
  for (let e of i) {
2539
2533
  let t = r[e], i = n.data[e];
@@ -2546,7 +2540,7 @@ var k = class e extends C {
2546
2540
  alwaysSet: e in n.data
2547
2541
  });
2548
2542
  }
2549
- if (this._def.catchall instanceof E) {
2543
+ if (this._def.catchall instanceof T) {
2550
2544
  let e = this._def.unknownKeys;
2551
2545
  if (e === "passthrough") for (let e of a) o.push({
2552
2546
  key: {
@@ -2632,7 +2626,7 @@ var k = class e extends C {
2632
2626
  ...this._def.shape(),
2633
2627
  ...t._def.shape()
2634
2628
  }),
2635
- typeName: R.ZodObject
2629
+ typeName: F.ZodObject
2636
2630
  });
2637
2631
  }
2638
2632
  setKey(e, t) {
@@ -2661,7 +2655,7 @@ var k = class e extends C {
2661
2655
  });
2662
2656
  }
2663
2657
  deepPartial() {
2664
- return O(this);
2658
+ return D(this);
2665
2659
  }
2666
2660
  partial(t) {
2667
2661
  let n = {};
@@ -2679,7 +2673,7 @@ var k = class e extends C {
2679
2673
  for (let e of l.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e];
2680
2674
  else {
2681
2675
  let t = this.shape[e];
2682
- for (; t instanceof P;) t = t._def.innerType;
2676
+ for (; t instanceof N;) t = t._def.innerType;
2683
2677
  n[e] = t;
2684
2678
  }
2685
2679
  return new e({
@@ -2688,29 +2682,29 @@ var k = class e extends C {
2688
2682
  });
2689
2683
  }
2690
2684
  keyof() {
2691
- return ht(l.objectKeys(this.shape));
2685
+ return gt(l.objectKeys(this.shape));
2692
2686
  }
2693
2687
  };
2694
- k.create = (e, t) => new k({
2688
+ O.create = (e, t) => new O({
2695
2689
  shape: () => e,
2696
2690
  unknownKeys: "strip",
2697
- catchall: E.create(),
2698
- typeName: R.ZodObject,
2691
+ catchall: T.create(),
2692
+ typeName: F.ZodObject,
2699
2693
  ...S(t)
2700
- }), k.strictCreate = (e, t) => new k({
2694
+ }), O.strictCreate = (e, t) => new O({
2701
2695
  shape: () => e,
2702
2696
  unknownKeys: "strict",
2703
- catchall: E.create(),
2704
- typeName: R.ZodObject,
2697
+ catchall: T.create(),
2698
+ typeName: F.ZodObject,
2705
2699
  ...S(t)
2706
- }), k.lazycreate = (e, t) => new k({
2700
+ }), O.lazycreate = (e, t) => new O({
2707
2701
  shape: e,
2708
2702
  unknownKeys: "strip",
2709
- catchall: E.create(),
2710
- typeName: R.ZodObject,
2703
+ catchall: T.create(),
2704
+ typeName: F.ZodObject,
2711
2705
  ...S(t)
2712
2706
  });
2713
- var at = class extends C {
2707
+ var ot = class extends C {
2714
2708
  _parse(e) {
2715
2709
  let { ctx: t } = this._processInputParams(e), n = this._def.options;
2716
2710
  function r(e) {
@@ -2773,12 +2767,12 @@ var at = class extends C {
2773
2767
  return this._def.options;
2774
2768
  }
2775
2769
  };
2776
- at.create = (e, t) => new at({
2770
+ ot.create = (e, t) => new ot({
2777
2771
  options: e,
2778
- typeName: R.ZodUnion,
2772
+ typeName: F.ZodUnion,
2779
2773
  ...S(t)
2780
2774
  });
2781
- var A = (e) => e instanceof pt ? A(e.schema) : e instanceof N ? A(e.innerType()) : e instanceof mt ? [e.value] : e instanceof gt ? e.options : e instanceof _t ? l.objectValues(e.enum) : e instanceof I ? A(e._def.innerType) : e instanceof tt ? [void 0] : e instanceof nt ? [null] : e instanceof P ? [void 0, ...A(e.unwrap())] : e instanceof F ? [null, ...A(e.unwrap())] : e instanceof yt || e instanceof xt ? A(e.unwrap()) : e instanceof L ? A(e._def.innerType) : [], ot = class e extends C {
2775
+ var k = (e) => e instanceof mt ? k(e.schema) : e instanceof M ? k(e.innerType()) : e instanceof ht ? [e.value] : e instanceof _t ? e.options : e instanceof vt ? l.objectValues(e.enum) : e instanceof yt ? k(e._def.innerType) : e instanceof nt ? [void 0] : e instanceof rt ? [null] : e instanceof N ? [void 0, ...k(e.unwrap())] : e instanceof P ? [null, ...k(e.unwrap())] : e instanceof St || e instanceof wt ? k(e.unwrap()) : e instanceof bt ? k(e._def.innerType) : [], st = class e extends C {
2782
2776
  _parse(e) {
2783
2777
  let { ctx: t } = this._processInputParams(e);
2784
2778
  if (t.parsedType !== u.object) return h(t, {
@@ -2813,7 +2807,7 @@ var A = (e) => e instanceof pt ? A(e.schema) : e instanceof N ? A(e.innerType())
2813
2807
  static create(t, n, r) {
2814
2808
  let i = /* @__PURE__ */ new Map();
2815
2809
  for (let e of n) {
2816
- let n = A(e.shape[t]);
2810
+ let n = k(e.shape[t]);
2817
2811
  if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
2818
2812
  for (let r of n) {
2819
2813
  if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
@@ -2821,7 +2815,7 @@ var A = (e) => e instanceof pt ? A(e.schema) : e instanceof N ? A(e.innerType())
2821
2815
  }
2822
2816
  }
2823
2817
  return new e({
2824
- typeName: R.ZodDiscriminatedUnion,
2818
+ typeName: F.ZodDiscriminatedUnion,
2825
2819
  discriminator: t,
2826
2820
  options: n,
2827
2821
  optionsMap: i,
@@ -2829,7 +2823,7 @@ var A = (e) => e instanceof pt ? A(e.schema) : e instanceof N ? A(e.innerType())
2829
2823
  });
2830
2824
  }
2831
2825
  };
2832
- function st(e, t) {
2826
+ function ct(e, t) {
2833
2827
  let n = d(e), r = d(t);
2834
2828
  if (e === t) return {
2835
2829
  valid: !0,
@@ -2841,7 +2835,7 @@ function st(e, t) {
2841
2835
  ...t
2842
2836
  };
2843
2837
  for (let n of r) {
2844
- let r = st(e[n], t[n]);
2838
+ let r = ct(e[n], t[n]);
2845
2839
  if (!r.valid) return { valid: !1 };
2846
2840
  i[n] = r.data;
2847
2841
  }
@@ -2854,7 +2848,7 @@ function st(e, t) {
2854
2848
  if (e.length !== t.length) return { valid: !1 };
2855
2849
  let n = [];
2856
2850
  for (let r = 0; r < e.length; r++) {
2857
- let i = e[r], a = t[r], o = st(i, a);
2851
+ let i = e[r], a = t[r], o = ct(i, a);
2858
2852
  if (!o.valid) return { valid: !1 };
2859
2853
  n.push(o.data);
2860
2854
  }
@@ -2868,11 +2862,11 @@ function st(e, t) {
2868
2862
  data: e
2869
2863
  } : { valid: !1 };
2870
2864
  }
2871
- var ct = class extends C {
2865
+ var lt = class extends C {
2872
2866
  _parse(e) {
2873
2867
  let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
2874
2868
  if (xe(e) || xe(r)) return _;
2875
- let i = st(e.value, r.value);
2869
+ let i = ct(e.value, r.value);
2876
2870
  return i.valid ? ((Se(e) || Se(r)) && t.dirty(), {
2877
2871
  status: t.value,
2878
2872
  value: i.data
@@ -2897,13 +2891,13 @@ var ct = class extends C {
2897
2891
  }));
2898
2892
  }
2899
2893
  };
2900
- ct.create = (e, t, n) => new ct({
2894
+ lt.create = (e, t, n) => new lt({
2901
2895
  left: e,
2902
2896
  right: t,
2903
- typeName: R.ZodIntersection,
2897
+ typeName: F.ZodIntersection,
2904
2898
  ...S(n)
2905
2899
  });
2906
- var j = class e extends C {
2900
+ var A = class e extends C {
2907
2901
  _parse(e) {
2908
2902
  let { status: t, ctx: n } = this._processInputParams(e);
2909
2903
  if (n.parsedType !== u.array) return h(n, {
@@ -2941,16 +2935,16 @@ var j = class e extends C {
2941
2935
  });
2942
2936
  }
2943
2937
  };
2944
- j.create = (e, t) => {
2938
+ A.create = (e, t) => {
2945
2939
  if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
2946
- return new j({
2940
+ return new A({
2947
2941
  items: e,
2948
- typeName: R.ZodTuple,
2942
+ typeName: F.ZodTuple,
2949
2943
  rest: null,
2950
2944
  ...S(t)
2951
2945
  });
2952
2946
  };
2953
- var lt = class e extends C {
2947
+ var ut = class e extends C {
2954
2948
  get keySchema() {
2955
2949
  return this._def.keyType;
2956
2950
  }
@@ -2979,16 +2973,16 @@ var lt = class e extends C {
2979
2973
  return n instanceof C ? new e({
2980
2974
  keyType: t,
2981
2975
  valueType: n,
2982
- typeName: R.ZodRecord,
2976
+ typeName: F.ZodRecord,
2983
2977
  ...S(r)
2984
2978
  }) : new e({
2985
- keyType: w.create(),
2979
+ keyType: Ye.create(),
2986
2980
  valueType: t,
2987
- typeName: R.ZodRecord,
2981
+ typeName: F.ZodRecord,
2988
2982
  ...S(n)
2989
2983
  });
2990
2984
  }
2991
- }, ut = class extends C {
2985
+ }, dt = class extends C {
2992
2986
  get keySchema() {
2993
2987
  return this._def.keyType;
2994
2988
  }
@@ -3034,13 +3028,13 @@ var lt = class e extends C {
3034
3028
  }
3035
3029
  }
3036
3030
  };
3037
- ut.create = (e, t, n) => new ut({
3031
+ dt.create = (e, t, n) => new dt({
3038
3032
  valueType: t,
3039
3033
  keyType: e,
3040
- typeName: R.ZodMap,
3034
+ typeName: F.ZodMap,
3041
3035
  ...S(n)
3042
3036
  });
3043
- var dt = class e extends C {
3037
+ var ft = class e extends C {
3044
3038
  _parse(e) {
3045
3039
  let { status: t, ctx: n } = this._processInputParams(e);
3046
3040
  if (n.parsedType !== u.set) return h(n, {
@@ -3104,14 +3098,14 @@ var dt = class e extends C {
3104
3098
  return this.min(1, e);
3105
3099
  }
3106
3100
  };
3107
- dt.create = (e, t) => new dt({
3101
+ ft.create = (e, t) => new ft({
3108
3102
  valueType: e,
3109
3103
  minSize: null,
3110
3104
  maxSize: null,
3111
- typeName: R.ZodSet,
3105
+ typeName: F.ZodSet,
3112
3106
  ...S(t)
3113
3107
  });
3114
- var ft = class e extends C {
3108
+ var pt = class e extends C {
3115
3109
  constructor() {
3116
3110
  super(...arguments), this.validate = this.implement;
3117
3111
  }
@@ -3155,7 +3149,7 @@ var ft = class e extends C {
3155
3149
  });
3156
3150
  }
3157
3151
  let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
3158
- if (this._def.returns instanceof M) {
3152
+ if (this._def.returns instanceof j) {
3159
3153
  let e = this;
3160
3154
  return v(async function(...t) {
3161
3155
  let o = new p([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
@@ -3186,7 +3180,7 @@ var ft = class e extends C {
3186
3180
  args(...t) {
3187
3181
  return new e({
3188
3182
  ...this._def,
3189
- args: j.create(t).rest(T.create())
3183
+ args: A.create(t).rest(w.create())
3190
3184
  });
3191
3185
  }
3192
3186
  returns(t) {
@@ -3203,13 +3197,13 @@ var ft = class e extends C {
3203
3197
  }
3204
3198
  static create(t, n, r) {
3205
3199
  return new e({
3206
- args: t || j.create([]).rest(T.create()),
3207
- returns: n || T.create(),
3208
- typeName: R.ZodFunction,
3200
+ args: t || A.create([]).rest(w.create()),
3201
+ returns: n || w.create(),
3202
+ typeName: F.ZodFunction,
3209
3203
  ...S(r)
3210
3204
  });
3211
3205
  }
3212
- }, pt = class extends C {
3206
+ }, mt = class extends C {
3213
3207
  get schema() {
3214
3208
  return this._def.getter();
3215
3209
  }
@@ -3222,12 +3216,12 @@ var ft = class e extends C {
3222
3216
  });
3223
3217
  }
3224
3218
  };
3225
- pt.create = (e, t) => new pt({
3219
+ mt.create = (e, t) => new mt({
3226
3220
  getter: e,
3227
- typeName: R.ZodLazy,
3221
+ typeName: F.ZodLazy,
3228
3222
  ...S(t)
3229
3223
  });
3230
- var mt = class extends C {
3224
+ var ht = class extends C {
3231
3225
  _parse(e) {
3232
3226
  if (e.data !== this._def.value) {
3233
3227
  let t = this._getOrReturnCtx(e);
@@ -3246,19 +3240,19 @@ var mt = class extends C {
3246
3240
  return this._def.value;
3247
3241
  }
3248
3242
  };
3249
- mt.create = (e, t) => new mt({
3243
+ ht.create = (e, t) => new ht({
3250
3244
  value: e,
3251
- typeName: R.ZodLiteral,
3245
+ typeName: F.ZodLiteral,
3252
3246
  ...S(t)
3253
3247
  });
3254
- function ht(e, t) {
3255
- return new gt({
3248
+ function gt(e, t) {
3249
+ return new _t({
3256
3250
  values: e,
3257
- typeName: R.ZodEnum,
3251
+ typeName: F.ZodEnum,
3258
3252
  ...S(t)
3259
3253
  });
3260
3254
  }
3261
- var gt = class e extends C {
3255
+ var _t = class e extends C {
3262
3256
  _parse(e) {
3263
3257
  if (typeof e.data != "string") {
3264
3258
  let t = this._getOrReturnCtx(e), n = this._def.values;
@@ -3309,8 +3303,8 @@ var gt = class e extends C {
3309
3303
  });
3310
3304
  }
3311
3305
  };
3312
- gt.create = ht;
3313
- var _t = class extends C {
3306
+ _t.create = gt;
3307
+ var vt = class extends C {
3314
3308
  _parse(e) {
3315
3309
  let t = l.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
3316
3310
  if (n.parsedType !== u.string && n.parsedType !== u.number) {
@@ -3335,12 +3329,12 @@ var _t = class extends C {
3335
3329
  return this._def.values;
3336
3330
  }
3337
3331
  };
3338
- _t.create = (e, t) => new _t({
3332
+ vt.create = (e, t) => new vt({
3339
3333
  values: e,
3340
- typeName: R.ZodNativeEnum,
3334
+ typeName: F.ZodNativeEnum,
3341
3335
  ...S(t)
3342
3336
  });
3343
- var M = class extends C {
3337
+ var j = class extends C {
3344
3338
  unwrap() {
3345
3339
  return this._def.type;
3346
3340
  }
@@ -3356,17 +3350,17 @@ var M = class extends C {
3356
3350
  })));
3357
3351
  }
3358
3352
  };
3359
- M.create = (e, t) => new M({
3353
+ j.create = (e, t) => new j({
3360
3354
  type: e,
3361
- typeName: R.ZodPromise,
3355
+ typeName: F.ZodPromise,
3362
3356
  ...S(t)
3363
3357
  });
3364
- var N = class extends C {
3358
+ var M = class extends C {
3365
3359
  innerType() {
3366
3360
  return this._def.schema;
3367
3361
  }
3368
3362
  sourceType() {
3369
- return this._def.schema._def.typeName === R.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3363
+ return this._def.schema._def.typeName === F.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3370
3364
  }
3371
3365
  _parse(e) {
3372
3366
  let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
@@ -3452,21 +3446,21 @@ var N = class extends C {
3452
3446
  l.assertNever(r);
3453
3447
  }
3454
3448
  };
3455
- N.create = (e, t, n) => new N({
3449
+ M.create = (e, t, n) => new M({
3456
3450
  schema: e,
3457
- typeName: R.ZodEffects,
3451
+ typeName: F.ZodEffects,
3458
3452
  effect: t,
3459
3453
  ...S(n)
3460
- }), N.createWithPreprocess = (e, t, n) => new N({
3454
+ }), M.createWithPreprocess = (e, t, n) => new M({
3461
3455
  schema: t,
3462
3456
  effect: {
3463
3457
  type: "preprocess",
3464
3458
  transform: e
3465
3459
  },
3466
- typeName: R.ZodEffects,
3460
+ typeName: F.ZodEffects,
3467
3461
  ...S(n)
3468
3462
  });
3469
- var P = class extends C {
3463
+ var N = class extends C {
3470
3464
  _parse(e) {
3471
3465
  return this._getType(e) === u.undefined ? v(void 0) : this._def.innerType._parse(e);
3472
3466
  }
@@ -3474,12 +3468,12 @@ var P = class extends C {
3474
3468
  return this._def.innerType;
3475
3469
  }
3476
3470
  };
3477
- P.create = (e, t) => new P({
3471
+ N.create = (e, t) => new N({
3478
3472
  innerType: e,
3479
- typeName: R.ZodOptional,
3473
+ typeName: F.ZodOptional,
3480
3474
  ...S(t)
3481
3475
  });
3482
- var F = class extends C {
3476
+ var P = class extends C {
3483
3477
  _parse(e) {
3484
3478
  return this._getType(e) === u.null ? v(null) : this._def.innerType._parse(e);
3485
3479
  }
@@ -3487,12 +3481,12 @@ var F = class extends C {
3487
3481
  return this._def.innerType;
3488
3482
  }
3489
3483
  };
3490
- F.create = (e, t) => new F({
3484
+ P.create = (e, t) => new P({
3491
3485
  innerType: e,
3492
- typeName: R.ZodNullable,
3486
+ typeName: F.ZodNullable,
3493
3487
  ...S(t)
3494
3488
  });
3495
- var I = class extends C {
3489
+ var yt = class extends C {
3496
3490
  _parse(e) {
3497
3491
  let { ctx: t } = this._processInputParams(e), n = t.data;
3498
3492
  return t.parsedType === u.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
@@ -3505,13 +3499,13 @@ var I = class extends C {
3505
3499
  return this._def.innerType;
3506
3500
  }
3507
3501
  };
3508
- I.create = (e, t) => new I({
3502
+ yt.create = (e, t) => new yt({
3509
3503
  innerType: e,
3510
- typeName: R.ZodDefault,
3504
+ typeName: F.ZodDefault,
3511
3505
  defaultValue: typeof t.default == "function" ? t.default : () => t.default,
3512
3506
  ...S(t)
3513
3507
  });
3514
- var L = class extends C {
3508
+ var bt = class extends C {
3515
3509
  _parse(e) {
3516
3510
  let { ctx: t } = this._processInputParams(e), n = {
3517
3511
  ...t,
@@ -3546,13 +3540,13 @@ var L = class extends C {
3546
3540
  return this._def.innerType;
3547
3541
  }
3548
3542
  };
3549
- L.create = (e, t) => new L({
3543
+ bt.create = (e, t) => new bt({
3550
3544
  innerType: e,
3551
- typeName: R.ZodCatch,
3545
+ typeName: F.ZodCatch,
3552
3546
  catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
3553
3547
  ...S(t)
3554
3548
  });
3555
- var vt = class extends C {
3549
+ var xt = class extends C {
3556
3550
  _parse(e) {
3557
3551
  if (this._getType(e) !== u.nan) {
3558
3552
  let t = this._getOrReturnCtx(e);
@@ -3568,11 +3562,11 @@ var vt = class extends C {
3568
3562
  };
3569
3563
  }
3570
3564
  };
3571
- vt.create = (e) => new vt({
3572
- typeName: R.ZodNaN,
3565
+ xt.create = (e) => new xt({
3566
+ typeName: F.ZodNaN,
3573
3567
  ...S(e)
3574
3568
  });
3575
- var yt = class extends C {
3569
+ var St = class extends C {
3576
3570
  _parse(e) {
3577
3571
  let { ctx: t } = this._processInputParams(e), n = t.data;
3578
3572
  return this._def.type._parse({
@@ -3584,7 +3578,7 @@ var yt = class extends C {
3584
3578
  unwrap() {
3585
3579
  return this._def.type;
3586
3580
  }
3587
- }, bt = class e extends C {
3581
+ }, Ct = class e extends C {
3588
3582
  _parse(e) {
3589
3583
  let { status: t, ctx: n } = this._processInputParams(e);
3590
3584
  if (n.common.async) return (async () => {
@@ -3619,10 +3613,10 @@ var yt = class extends C {
3619
3613
  return new e({
3620
3614
  in: t,
3621
3615
  out: n,
3622
- typeName: R.ZodPipeline
3616
+ typeName: F.ZodPipeline
3623
3617
  });
3624
3618
  }
3625
- }, xt = class extends C {
3619
+ }, wt = class extends C {
3626
3620
  _parse(e) {
3627
3621
  let t = this._def.innerType._parse(e), n = (e) => (y(e) && (e.value = Object.freeze(e.value)), e);
3628
3622
  return Ce(t) ? t.then((e) => n(e)) : n(t);
@@ -3631,30 +3625,30 @@ var yt = class extends C {
3631
3625
  return this._def.innerType;
3632
3626
  }
3633
3627
  };
3634
- xt.create = (e, t) => new xt({
3628
+ wt.create = (e, t) => new wt({
3635
3629
  innerType: e,
3636
- typeName: R.ZodReadonly,
3630
+ typeName: F.ZodReadonly,
3637
3631
  ...S(t)
3638
- }), k.lazycreate;
3639
- var R;
3632
+ }), O.lazycreate;
3633
+ var F;
3640
3634
  (function(e) {
3641
3635
  e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
3642
- })(R ||= {});
3643
- var z = w.create, B = Xe.create;
3644
- vt.create, Ze.create;
3645
- var V = Qe.create;
3646
- $e.create, et.create, tt.create, nt.create, rt.create;
3647
- var H = T.create;
3648
- E.create, it.create;
3649
- var U = D.create, W = k.create;
3650
- k.strictCreate, at.create, ot.create, ct.create, j.create;
3651
- var G = lt.create;
3652
- ut.create, dt.create, ft.create, pt.create, mt.create;
3653
- var K = gt.create;
3654
- _t.create, M.create, N.create, P.create, F.create, N.createWithPreprocess, bt.create;
3636
+ })(F ||= {});
3637
+ var I = Ye.create, L = Ze.create;
3638
+ xt.create, Qe.create;
3639
+ var R = $e.create;
3640
+ et.create, tt.create, nt.create, rt.create, it.create;
3641
+ var Tt = w.create;
3642
+ T.create, at.create;
3643
+ var z = E.create, B = O.create;
3644
+ O.strictCreate, ot.create, st.create, lt.create, A.create;
3645
+ var V = ut.create;
3646
+ dt.create, ft.create, pt.create, mt.create, ht.create;
3647
+ var H = _t.create;
3648
+ vt.create, j.create, M.create, N.create, P.create, M.createWithPreprocess, Ct.create;
3655
3649
  //#endregion
3656
3650
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
3657
- var St = Symbol("Let zodToJsonSchema decide on which parser to use"), Ct = {
3651
+ var Et = Symbol("Let zodToJsonSchema decide on which parser to use"), Dt = {
3658
3652
  name: void 0,
3659
3653
  $refStrategy: "root",
3660
3654
  basePath: ["#"],
@@ -3677,14 +3671,14 @@ var St = Symbol("Let zodToJsonSchema decide on which parser to use"), Ct = {
3677
3671
  base64Strategy: "contentEncoding:base64",
3678
3672
  nameStrategy: "ref",
3679
3673
  openAiAnyTypeName: "OpenAiAnyType"
3680
- }, wt = (e) => typeof e == "string" ? {
3681
- ...Ct,
3674
+ }, Ot = (e) => typeof e == "string" ? {
3675
+ ...Dt,
3682
3676
  name: e
3683
3677
  } : {
3684
- ...Ct,
3678
+ ...Dt,
3685
3679
  ...e
3686
- }, Tt = (e) => {
3687
- let t = wt(e), n = t.name === void 0 ? t.basePath : [
3680
+ }, kt = (e) => {
3681
+ let t = Ot(e), n = t.name === void 0 ? t.basePath : [
3688
3682
  ...t.basePath,
3689
3683
  t.definitionPath,
3690
3684
  t.name
@@ -3707,45 +3701,45 @@ var St = Symbol("Let zodToJsonSchema decide on which parser to use"), Ct = {
3707
3701
  };
3708
3702
  //#endregion
3709
3703
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
3710
- function Et(e, t, n, r) {
3704
+ function At(e, t, n, r) {
3711
3705
  r?.errorMessages && n && (e.errorMessage = {
3712
3706
  ...e.errorMessage,
3713
3707
  [t]: n
3714
3708
  });
3715
3709
  }
3716
- function q(e, t, n, r, i) {
3717
- e[t] = n, Et(e, t, r, i);
3710
+ function U(e, t, n, r, i) {
3711
+ e[t] = n, At(e, t, r, i);
3718
3712
  }
3719
3713
  //#endregion
3720
3714
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
3721
- var Dt = (e, t) => {
3715
+ var jt = (e, t) => {
3722
3716
  let n = 0;
3723
3717
  for (; n < e.length && n < t.length && e[n] === t[n]; n++);
3724
3718
  return [(e.length - n).toString(), ...t.slice(n)].join("/");
3725
3719
  };
3726
3720
  //#endregion
3727
3721
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
3728
- function J(e) {
3722
+ function W(e) {
3729
3723
  if (e.target !== "openAi") return {};
3730
3724
  let t = [
3731
3725
  ...e.basePath,
3732
3726
  e.definitionPath,
3733
3727
  e.openAiAnyTypeName
3734
3728
  ];
3735
- return e.flags.hasReferencedOpenAiAnyType = !0, { $ref: e.$refStrategy === "relative" ? Dt(t, e.currentPath) : t.join("/") };
3729
+ return e.flags.hasReferencedOpenAiAnyType = !0, { $ref: e.$refStrategy === "relative" ? jt(t, e.currentPath) : t.join("/") };
3736
3730
  }
3737
3731
  //#endregion
3738
3732
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
3739
- function Ot(e, t) {
3733
+ function Mt(e, t) {
3740
3734
  let n = { type: "array" };
3741
- return e.type?._def && e.type?._def?.typeName !== R.ZodAny && (n.items = Q(e.type._def, {
3735
+ return e.type?._def && e.type?._def?.typeName !== F.ZodAny && (n.items = J(e.type._def, {
3742
3736
  ...t,
3743
3737
  currentPath: [...t.currentPath, "items"]
3744
- })), e.minLength && q(n, "minItems", e.minLength.value, e.minLength.message, t), e.maxLength && q(n, "maxItems", e.maxLength.value, e.maxLength.message, t), e.exactLength && (q(n, "minItems", e.exactLength.value, e.exactLength.message, t), q(n, "maxItems", e.exactLength.value, e.exactLength.message, t)), n;
3738
+ })), e.minLength && U(n, "minItems", e.minLength.value, e.minLength.message, t), e.maxLength && U(n, "maxItems", e.maxLength.value, e.maxLength.message, t), e.exactLength && (U(n, "minItems", e.exactLength.value, e.exactLength.message, t), U(n, "maxItems", e.exactLength.value, e.exactLength.message, t)), n;
3745
3739
  }
3746
3740
  //#endregion
3747
3741
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
3748
- function kt(e, t) {
3742
+ function Nt(e, t) {
3749
3743
  let n = {
3750
3744
  type: "integer",
3751
3745
  format: "int64"
@@ -3753,33 +3747,33 @@ function kt(e, t) {
3753
3747
  if (!e.checks) return n;
3754
3748
  for (let r of e.checks) switch (r.kind) {
3755
3749
  case "min":
3756
- t.target === "jsonSchema7" ? r.inclusive ? q(n, "minimum", r.value, r.message, t) : q(n, "exclusiveMinimum", r.value, r.message, t) : (r.inclusive || (n.exclusiveMinimum = !0), q(n, "minimum", r.value, r.message, t));
3750
+ t.target === "jsonSchema7" ? r.inclusive ? U(n, "minimum", r.value, r.message, t) : U(n, "exclusiveMinimum", r.value, r.message, t) : (r.inclusive || (n.exclusiveMinimum = !0), U(n, "minimum", r.value, r.message, t));
3757
3751
  break;
3758
3752
  case "max":
3759
- t.target === "jsonSchema7" ? r.inclusive ? q(n, "maximum", r.value, r.message, t) : q(n, "exclusiveMaximum", r.value, r.message, t) : (r.inclusive || (n.exclusiveMaximum = !0), q(n, "maximum", r.value, r.message, t));
3753
+ t.target === "jsonSchema7" ? r.inclusive ? U(n, "maximum", r.value, r.message, t) : U(n, "exclusiveMaximum", r.value, r.message, t) : (r.inclusive || (n.exclusiveMaximum = !0), U(n, "maximum", r.value, r.message, t));
3760
3754
  break;
3761
- case "multipleOf": q(n, "multipleOf", r.value, r.message, t);
3755
+ case "multipleOf": U(n, "multipleOf", r.value, r.message, t);
3762
3756
  }
3763
3757
  return n;
3764
3758
  }
3765
3759
  //#endregion
3766
3760
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
3767
- function At() {
3761
+ function Pt() {
3768
3762
  return { type: "boolean" };
3769
3763
  }
3770
3764
  //#endregion
3771
3765
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
3772
- function jt(e, t) {
3773
- return Q(e.type._def, t);
3766
+ function Ft(e, t) {
3767
+ return J(e.type._def, t);
3774
3768
  }
3775
3769
  //#endregion
3776
3770
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
3777
- var Mt = (e, t) => Q(e.innerType._def, t);
3771
+ var It = (e, t) => J(e.innerType._def, t);
3778
3772
  //#endregion
3779
3773
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
3780
- function Nt(e, t, n) {
3774
+ function Lt(e, t, n) {
3781
3775
  let r = n ?? t.dateStrategy;
3782
- if (Array.isArray(r)) return { anyOf: r.map((n, r) => Nt(e, t, n)) };
3776
+ if (Array.isArray(r)) return { anyOf: r.map((n, r) => Lt(e, t, n)) };
3783
3777
  switch (r) {
3784
3778
  case "string":
3785
3779
  case "format:date-time": return {
@@ -3790,10 +3784,10 @@ function Nt(e, t, n) {
3790
3784
  type: "string",
3791
3785
  format: "date"
3792
3786
  };
3793
- case "integer": return Pt(e, t);
3787
+ case "integer": return Rt(e, t);
3794
3788
  }
3795
3789
  }
3796
- var Pt = (e, t) => {
3790
+ var Rt = (e, t) => {
3797
3791
  let n = {
3798
3792
  type: "integer",
3799
3793
  format: "unix-time"
@@ -3801,28 +3795,28 @@ var Pt = (e, t) => {
3801
3795
  if (t.target === "openApi3") return n;
3802
3796
  for (let r of e.checks) switch (r.kind) {
3803
3797
  case "min":
3804
- q(n, "minimum", r.value, r.message, t);
3798
+ U(n, "minimum", r.value, r.message, t);
3805
3799
  break;
3806
- case "max": q(n, "maximum", r.value, r.message, t);
3800
+ case "max": U(n, "maximum", r.value, r.message, t);
3807
3801
  }
3808
3802
  return n;
3809
3803
  };
3810
3804
  //#endregion
3811
3805
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
3812
- function Ft(e, t) {
3806
+ function zt(e, t) {
3813
3807
  return {
3814
- ...Q(e.innerType._def, t),
3808
+ ...J(e.innerType._def, t),
3815
3809
  default: e.defaultValue()
3816
3810
  };
3817
3811
  }
3818
3812
  //#endregion
3819
3813
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
3820
- function It(e, t) {
3821
- return t.effectStrategy === "input" ? Q(e.schema._def, t) : J(t);
3814
+ function Bt(e, t) {
3815
+ return t.effectStrategy === "input" ? J(e.schema._def, t) : W(t);
3822
3816
  }
3823
3817
  //#endregion
3824
3818
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
3825
- function Lt(e) {
3819
+ function Vt(e) {
3826
3820
  return {
3827
3821
  type: "string",
3828
3822
  enum: Array.from(e.values)
@@ -3830,16 +3824,16 @@ function Lt(e) {
3830
3824
  }
3831
3825
  //#endregion
3832
3826
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
3833
- var Rt = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
3834
- function zt(e, t) {
3835
- let n = [Q(e.left._def, {
3827
+ var Ht = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
3828
+ function Ut(e, t) {
3829
+ let n = [J(e.left._def, {
3836
3830
  ...t,
3837
3831
  currentPath: [
3838
3832
  ...t.currentPath,
3839
3833
  "allOf",
3840
3834
  "0"
3841
3835
  ]
3842
- }), Q(e.right._def, {
3836
+ }), J(e.right._def, {
3843
3837
  ...t,
3844
3838
  currentPath: [
3845
3839
  ...t.currentPath,
@@ -3848,7 +3842,7 @@ function zt(e, t) {
3848
3842
  ]
3849
3843
  })].filter((e) => !!e), r = t.target === "jsonSchema2019-09" ? { unevaluatedProperties: !1 } : void 0, i = [];
3850
3844
  return n.forEach((e) => {
3851
- if (Rt(e)) i.push(...e.allOf), e.unevaluatedProperties === void 0 && (r = void 0);
3845
+ if (Ht(e)) i.push(...e.allOf), e.unevaluatedProperties === void 0 && (r = void 0);
3852
3846
  else {
3853
3847
  let t = e;
3854
3848
  if ("additionalProperties" in e && e.additionalProperties === !1) {
@@ -3864,7 +3858,7 @@ function zt(e, t) {
3864
3858
  }
3865
3859
  //#endregion
3866
3860
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
3867
- function Bt(e, t) {
3861
+ function Wt(e, t) {
3868
3862
  let n = typeof e.value;
3869
3863
  return n !== "bigint" && n !== "number" && n !== "boolean" && n !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : t.target === "openApi3" ? {
3870
3864
  type: n === "bigint" ? "integer" : n,
@@ -3876,12 +3870,12 @@ function Bt(e, t) {
3876
3870
  }
3877
3871
  //#endregion
3878
3872
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
3879
- var Vt = void 0, Y = {
3873
+ var Gt = void 0, G = {
3880
3874
  cuid: /^[cC][^\s-]{8,}$/,
3881
3875
  cuid2: /^[0-9a-z]+$/,
3882
3876
  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
3883
3877
  email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
3884
- emoji: () => (Vt === void 0 && (Vt = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), Vt),
3878
+ emoji: () => (Gt === void 0 && (Gt = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), Gt),
3885
3879
  uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
3886
3880
  ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
3887
3881
  ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
@@ -3892,137 +3886,134 @@ var Vt = void 0, Y = {
3892
3886
  nanoid: /^[a-zA-Z0-9_-]{21}$/,
3893
3887
  jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
3894
3888
  };
3895
- function Ht(e, t) {
3889
+ function Kt(e, t) {
3896
3890
  let n = { type: "string" };
3897
3891
  if (e.checks) for (let r of e.checks) switch (r.kind) {
3898
3892
  case "min":
3899
- q(n, "minLength", typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, r.message, t);
3893
+ U(n, "minLength", typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, r.message, t);
3900
3894
  break;
3901
3895
  case "max":
3902
- q(n, "maxLength", typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value, r.message, t);
3896
+ U(n, "maxLength", typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value, r.message, t);
3903
3897
  break;
3904
3898
  case "email":
3905
3899
  switch (t.emailStrategy) {
3906
3900
  case "format:email":
3907
- X(n, "email", r.message, t);
3901
+ K(n, "email", r.message, t);
3908
3902
  break;
3909
3903
  case "format:idn-email":
3910
- X(n, "idn-email", r.message, t);
3904
+ K(n, "idn-email", r.message, t);
3911
3905
  break;
3912
- case "pattern:zod": Z(n, Y.email, r.message, t);
3906
+ case "pattern:zod": q(n, G.email, r.message, t);
3913
3907
  }
3914
3908
  break;
3915
3909
  case "url":
3916
- X(n, "uri", r.message, t);
3910
+ K(n, "uri", r.message, t);
3917
3911
  break;
3918
3912
  case "uuid":
3919
- X(n, "uuid", r.message, t);
3913
+ K(n, "uuid", r.message, t);
3920
3914
  break;
3921
3915
  case "regex":
3922
- Z(n, r.regex, r.message, t);
3916
+ q(n, r.regex, r.message, t);
3923
3917
  break;
3924
3918
  case "cuid":
3925
- Z(n, Y.cuid, r.message, t);
3919
+ q(n, G.cuid, r.message, t);
3926
3920
  break;
3927
3921
  case "cuid2":
3928
- Z(n, Y.cuid2, r.message, t);
3922
+ q(n, G.cuid2, r.message, t);
3929
3923
  break;
3930
3924
  case "startsWith":
3931
- Z(n, RegExp(`^${Ut(r.value, t)}`), r.message, t);
3925
+ q(n, RegExp(`^${qt(r.value, t)}`), r.message, t);
3932
3926
  break;
3933
3927
  case "endsWith":
3934
- Z(n, RegExp(`${Ut(r.value, t)}$`), r.message, t);
3928
+ q(n, RegExp(`${qt(r.value, t)}$`), r.message, t);
3935
3929
  break;
3936
3930
  case "datetime":
3937
- X(n, "date-time", r.message, t);
3931
+ K(n, "date-time", r.message, t);
3938
3932
  break;
3939
3933
  case "date":
3940
- X(n, "date", r.message, t);
3934
+ K(n, "date", r.message, t);
3941
3935
  break;
3942
3936
  case "time":
3943
- X(n, "time", r.message, t);
3937
+ K(n, "time", r.message, t);
3944
3938
  break;
3945
3939
  case "duration":
3946
- X(n, "duration", r.message, t);
3940
+ K(n, "duration", r.message, t);
3947
3941
  break;
3948
3942
  case "length":
3949
- q(n, "minLength", typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, r.message, t), q(n, "maxLength", typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value, r.message, t);
3943
+ U(n, "minLength", typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, r.message, t), U(n, "maxLength", typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value, r.message, t);
3950
3944
  break;
3951
3945
  case "includes":
3952
- Z(n, RegExp(Ut(r.value, t)), r.message, t);
3946
+ q(n, RegExp(qt(r.value, t)), r.message, t);
3953
3947
  break;
3954
3948
  case "ip":
3955
- r.version !== "v6" && X(n, "ipv4", r.message, t), r.version !== "v4" && X(n, "ipv6", r.message, t);
3949
+ r.version !== "v6" && K(n, "ipv4", r.message, t), r.version !== "v4" && K(n, "ipv6", r.message, t);
3956
3950
  break;
3957
3951
  case "base64url":
3958
- Z(n, Y.base64url, r.message, t);
3952
+ q(n, G.base64url, r.message, t);
3959
3953
  break;
3960
3954
  case "jwt":
3961
- Z(n, Y.jwt, r.message, t);
3955
+ q(n, G.jwt, r.message, t);
3962
3956
  break;
3963
3957
  case "cidr":
3964
- r.version !== "v6" && Z(n, Y.ipv4Cidr, r.message, t), r.version !== "v4" && Z(n, Y.ipv6Cidr, r.message, t);
3958
+ r.version !== "v6" && q(n, G.ipv4Cidr, r.message, t), r.version !== "v4" && q(n, G.ipv6Cidr, r.message, t);
3965
3959
  break;
3966
3960
  case "emoji":
3967
- Z(n, Y.emoji(), r.message, t);
3961
+ q(n, G.emoji(), r.message, t);
3968
3962
  break;
3969
3963
  case "ulid":
3970
- Z(n, Y.ulid, r.message, t);
3964
+ q(n, G.ulid, r.message, t);
3971
3965
  break;
3972
3966
  case "base64":
3973
3967
  switch (t.base64Strategy) {
3974
3968
  case "format:binary":
3975
- X(n, "binary", r.message, t);
3969
+ K(n, "binary", r.message, t);
3976
3970
  break;
3977
3971
  case "contentEncoding:base64":
3978
- q(n, "contentEncoding", "base64", r.message, t);
3972
+ U(n, "contentEncoding", "base64", r.message, t);
3979
3973
  break;
3980
- case "pattern:zod": Z(n, Y.base64, r.message, t);
3974
+ case "pattern:zod": q(n, G.base64, r.message, t);
3981
3975
  }
3982
3976
  break;
3983
- case "nanoid": Z(n, Y.nanoid, r.message, t);
3977
+ case "nanoid": q(n, G.nanoid, r.message, t);
3984
3978
  }
3985
3979
  return n;
3986
3980
  }
3987
- function Ut(e, t) {
3988
- return t.patternStrategy === "escape" ? Gt(e) : e;
3981
+ function qt(e, t) {
3982
+ return t.patternStrategy === "escape" ? Yt(e) : e;
3989
3983
  }
3990
- var Wt = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
3991
- function Gt(e) {
3984
+ var Jt = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
3985
+ function Yt(e) {
3992
3986
  let t = "";
3993
- for (let n = 0; n < e.length; n++) Wt.has(e[n]) || (t += "\\"), t += e[n];
3987
+ for (let n = 0; n < e.length; n++) Jt.has(e[n]) || (t += "\\"), t += e[n];
3994
3988
  return t;
3995
3989
  }
3996
- function X(e, t, n, r) {
3990
+ function K(e, t, n, r) {
3997
3991
  e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({
3998
3992
  format: e.format,
3999
3993
  ...e.errorMessage && r.errorMessages && { errorMessage: { format: e.errorMessage.format } }
4000
3994
  }), delete e.format, e.errorMessage && (delete e.errorMessage.format, Object.keys(e.errorMessage).length === 0 && delete e.errorMessage)), e.anyOf.push({
4001
3995
  format: t,
4002
3996
  ...n && r.errorMessages && { errorMessage: { format: n } }
4003
- })) : q(e, "format", t, n, r);
3997
+ })) : U(e, "format", t, n, r);
4004
3998
  }
4005
- function Z(e, t, n, r) {
3999
+ function q(e, t, n, r) {
4006
4000
  e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({
4007
4001
  pattern: e.pattern,
4008
4002
  ...e.errorMessage && r.errorMessages && { errorMessage: { pattern: e.errorMessage.pattern } }
4009
4003
  }), delete e.pattern, e.errorMessage && (delete e.errorMessage.pattern, Object.keys(e.errorMessage).length === 0 && delete e.errorMessage)), e.allOf.push({
4010
- pattern: Kt(t, r),
4004
+ pattern: Xt(t, r),
4011
4005
  ...n && r.errorMessages && { errorMessage: { pattern: n } }
4012
- })) : q(e, "pattern", Kt(t, r), n, r);
4006
+ })) : U(e, "pattern", Xt(t, r), n, r);
4013
4007
  }
4014
- function Kt(e, t) {
4008
+ function Xt(e, t) {
4015
4009
  if (!t.applyRegexFlags || !e.flags) return e.source;
4016
4010
  let n = {
4017
4011
  i: e.flags.includes("i"),
4018
4012
  m: e.flags.includes("m"),
4019
4013
  s: e.flags.includes("s")
4020
4014
  }, r = n.i ? e.source.toLowerCase() : e.source, i = "", a = !1, o = !1, s = !1;
4021
- for (let e = 0; e < r.length; e++) {
4022
- if (a) {
4023
- i += r[e], a = !1;
4024
- continue;
4025
- }
4015
+ for (let e = 0; e < r.length; e++) if (a) i += r[e], a = !1;
4016
+ else {
4026
4017
  if (n.i) {
4027
4018
  if (o) {
4028
4019
  if (r[e].match(/[a-z]/)) {
@@ -4044,11 +4035,7 @@ function Kt(e, t) {
4044
4035
  continue;
4045
4036
  }
4046
4037
  }
4047
- if (n.s && r[e] === ".") {
4048
- i += o ? `${r[e]}\r\n` : `[${r[e]}\r\n]`;
4049
- continue;
4050
- }
4051
- i += r[e], r[e] === "\\" ? a = !0 : o && r[e] === "]" ? o = !1 : !o && r[e] === "[" && (o = !0);
4038
+ n.s && r[e] === "." ? i += o ? `${r[e]}\r\n` : `[${r[e]}\r\n]` : (i += r[e], r[e] === "\\" ? a = !0 : o && r[e] === "]" ? o = !1 : !o && r[e] === "[" && (o = !0));
4052
4039
  }
4053
4040
  try {
4054
4041
  new RegExp(i);
@@ -4059,44 +4046,44 @@ function Kt(e, t) {
4059
4046
  }
4060
4047
  //#endregion
4061
4048
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
4062
- function qt(e, t) {
4063
- if (t.target === "openAi" && console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."), t.target === "openApi3" && e.keyType?._def.typeName === R.ZodEnum) return {
4049
+ function Zt(e, t) {
4050
+ if (t.target === "openAi" && console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."), t.target === "openApi3" && e.keyType?._def.typeName === F.ZodEnum) return {
4064
4051
  type: "object",
4065
4052
  required: e.keyType._def.values,
4066
4053
  properties: e.keyType._def.values.reduce((n, r) => ({
4067
4054
  ...n,
4068
- [r]: Q(e.valueType._def, {
4055
+ [r]: J(e.valueType._def, {
4069
4056
  ...t,
4070
4057
  currentPath: [
4071
4058
  ...t.currentPath,
4072
4059
  "properties",
4073
4060
  r
4074
4061
  ]
4075
- }) ?? J(t)
4062
+ }) ?? W(t)
4076
4063
  }), {}),
4077
4064
  additionalProperties: t.rejectedAdditionalProperties
4078
4065
  };
4079
4066
  let n = {
4080
4067
  type: "object",
4081
- additionalProperties: Q(e.valueType._def, {
4068
+ additionalProperties: J(e.valueType._def, {
4082
4069
  ...t,
4083
4070
  currentPath: [...t.currentPath, "additionalProperties"]
4084
4071
  }) ?? t.allowedAdditionalProperties
4085
4072
  };
4086
4073
  if (t.target === "openApi3") return n;
4087
- if (e.keyType?._def.typeName === R.ZodString && e.keyType._def.checks?.length) {
4088
- let { type: r, ...i } = Ht(e.keyType._def, t);
4074
+ if (e.keyType?._def.typeName === F.ZodString && e.keyType._def.checks?.length) {
4075
+ let { type: r, ...i } = Kt(e.keyType._def, t);
4089
4076
  return {
4090
4077
  ...n,
4091
4078
  propertyNames: i
4092
4079
  };
4093
4080
  }
4094
- if (e.keyType?._def.typeName === R.ZodEnum) return {
4081
+ if (e.keyType?._def.typeName === F.ZodEnum) return {
4095
4082
  ...n,
4096
4083
  propertyNames: { enum: e.keyType._def.values }
4097
4084
  };
4098
- if (e.keyType?._def.typeName === R.ZodBranded && e.keyType._def.type._def.typeName === R.ZodString && e.keyType._def.type._def.checks?.length) {
4099
- let { type: r, ...i } = jt(e.keyType._def, t);
4085
+ if (e.keyType?._def.typeName === F.ZodBranded && e.keyType._def.type._def.typeName === F.ZodString && e.keyType._def.type._def.checks?.length) {
4086
+ let { type: r, ...i } = Ft(e.keyType._def, t);
4100
4087
  return {
4101
4088
  ...n,
4102
4089
  propertyNames: i
@@ -4106,13 +4093,13 @@ function qt(e, t) {
4106
4093
  }
4107
4094
  //#endregion
4108
4095
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
4109
- function Jt(e, t) {
4110
- return t.mapStrategy === "record" ? qt(e, t) : {
4096
+ function Qt(e, t) {
4097
+ return t.mapStrategy === "record" ? Zt(e, t) : {
4111
4098
  type: "array",
4112
4099
  maxItems: 125,
4113
4100
  items: {
4114
4101
  type: "array",
4115
- items: [Q(e.keyType._def, {
4102
+ items: [J(e.keyType._def, {
4116
4103
  ...t,
4117
4104
  currentPath: [
4118
4105
  ...t.currentPath,
@@ -4120,7 +4107,7 @@ function Jt(e, t) {
4120
4107
  "items",
4121
4108
  "0"
4122
4109
  ]
4123
- }) || J(t), Q(e.valueType._def, {
4110
+ }) || W(t), J(e.valueType._def, {
4124
4111
  ...t,
4125
4112
  currentPath: [
4126
4113
  ...t.currentPath,
@@ -4128,7 +4115,7 @@ function Jt(e, t) {
4128
4115
  "items",
4129
4116
  "1"
4130
4117
  ]
4131
- }) || J(t)],
4118
+ }) || W(t)],
4132
4119
  minItems: 2,
4133
4120
  maxItems: 2
4134
4121
  }
@@ -4136,7 +4123,7 @@ function Jt(e, t) {
4136
4123
  }
4137
4124
  //#endregion
4138
4125
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
4139
- function Yt(e) {
4126
+ function $t(e) {
4140
4127
  let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
4141
4128
  return {
4142
4129
  type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
@@ -4145,15 +4132,15 @@ function Yt(e) {
4145
4132
  }
4146
4133
  //#endregion
4147
4134
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
4148
- function Xt(e) {
4149
- return e.target === "openAi" ? void 0 : { not: J({
4135
+ function en(e) {
4136
+ return e.target === "openAi" ? void 0 : { not: W({
4150
4137
  ...e,
4151
4138
  currentPath: [...e.currentPath, "not"]
4152
4139
  }) };
4153
4140
  }
4154
4141
  //#endregion
4155
4142
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
4156
- function Zt(e) {
4143
+ function tn(e) {
4157
4144
  return e.target === "openApi3" ? {
4158
4145
  enum: ["null"],
4159
4146
  nullable: !0
@@ -4161,19 +4148,19 @@ function Zt(e) {
4161
4148
  }
4162
4149
  //#endregion
4163
4150
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
4164
- var Qt = {
4151
+ var nn = {
4165
4152
  ZodString: "string",
4166
4153
  ZodNumber: "number",
4167
4154
  ZodBigInt: "integer",
4168
4155
  ZodBoolean: "boolean",
4169
4156
  ZodNull: "null"
4170
4157
  };
4171
- function $t(e, t) {
4172
- if (t.target === "openApi3") return en(e, t);
4158
+ function rn(e, t) {
4159
+ if (t.target === "openApi3") return an(e, t);
4173
4160
  let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
4174
- if (n.every((e) => e._def.typeName in Qt && (!e._def.checks || !e._def.checks.length))) {
4161
+ if (n.every((e) => e._def.typeName in nn && (!e._def.checks || !e._def.checks.length))) {
4175
4162
  let e = n.reduce((e, t) => {
4176
- let n = Qt[t._def.typeName];
4163
+ let n = nn[t._def.typeName];
4177
4164
  return n && !e.includes(n) ? [...e, n] : e;
4178
4165
  }, []);
4179
4166
  return { type: e.length > 1 ? e : e[0] };
@@ -4201,10 +4188,10 @@ function $t(e, t) {
4201
4188
  type: "string",
4202
4189
  enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
4203
4190
  };
4204
- return en(e, t);
4191
+ return an(e, t);
4205
4192
  }
4206
- var en = (e, t) => {
4207
- let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => Q(e._def, {
4193
+ var an = (e, t) => {
4194
+ let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => J(e._def, {
4208
4195
  ...t,
4209
4196
  currentPath: [
4210
4197
  ...t.currentPath,
@@ -4216,7 +4203,7 @@ var en = (e, t) => {
4216
4203
  };
4217
4204
  //#endregion
4218
4205
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
4219
- function tn(e, t) {
4206
+ function on(e, t) {
4220
4207
  if ([
4221
4208
  "ZodString",
4222
4209
  "ZodNumber",
@@ -4224,11 +4211,11 @@ function tn(e, t) {
4224
4211
  "ZodBoolean",
4225
4212
  "ZodNull"
4226
4213
  ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return t.target === "openApi3" ? {
4227
- type: Qt[e.innerType._def.typeName],
4214
+ type: nn[e.innerType._def.typeName],
4228
4215
  nullable: !0
4229
- } : { type: [Qt[e.innerType._def.typeName], "null"] };
4216
+ } : { type: [nn[e.innerType._def.typeName], "null"] };
4230
4217
  if (t.target === "openApi3") {
4231
- let n = Q(e.innerType._def, {
4218
+ let n = J(e.innerType._def, {
4232
4219
  ...t,
4233
4220
  currentPath: [...t.currentPath]
4234
4221
  });
@@ -4240,7 +4227,7 @@ function tn(e, t) {
4240
4227
  nullable: !0
4241
4228
  };
4242
4229
  }
4243
- let n = Q(e.innerType._def, {
4230
+ let n = J(e.innerType._def, {
4244
4231
  ...t,
4245
4232
  currentPath: [
4246
4233
  ...t.currentPath,
@@ -4252,26 +4239,26 @@ function tn(e, t) {
4252
4239
  }
4253
4240
  //#endregion
4254
4241
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
4255
- function nn(e, t) {
4242
+ function sn(e, t) {
4256
4243
  let n = { type: "number" };
4257
4244
  if (!e.checks) return n;
4258
4245
  for (let r of e.checks) switch (r.kind) {
4259
4246
  case "int":
4260
- n.type = "integer", Et(n, "type", r.message, t);
4247
+ n.type = "integer", At(n, "type", r.message, t);
4261
4248
  break;
4262
4249
  case "min":
4263
- t.target === "jsonSchema7" ? r.inclusive ? q(n, "minimum", r.value, r.message, t) : q(n, "exclusiveMinimum", r.value, r.message, t) : (r.inclusive || (n.exclusiveMinimum = !0), q(n, "minimum", r.value, r.message, t));
4250
+ t.target === "jsonSchema7" ? r.inclusive ? U(n, "minimum", r.value, r.message, t) : U(n, "exclusiveMinimum", r.value, r.message, t) : (r.inclusive || (n.exclusiveMinimum = !0), U(n, "minimum", r.value, r.message, t));
4264
4251
  break;
4265
4252
  case "max":
4266
- t.target === "jsonSchema7" ? r.inclusive ? q(n, "maximum", r.value, r.message, t) : q(n, "exclusiveMaximum", r.value, r.message, t) : (r.inclusive || (n.exclusiveMaximum = !0), q(n, "maximum", r.value, r.message, t));
4253
+ t.target === "jsonSchema7" ? r.inclusive ? U(n, "maximum", r.value, r.message, t) : U(n, "exclusiveMaximum", r.value, r.message, t) : (r.inclusive || (n.exclusiveMaximum = !0), U(n, "maximum", r.value, r.message, t));
4267
4254
  break;
4268
- case "multipleOf": q(n, "multipleOf", r.value, r.message, t);
4255
+ case "multipleOf": U(n, "multipleOf", r.value, r.message, t);
4269
4256
  }
4270
4257
  return n;
4271
4258
  }
4272
4259
  //#endregion
4273
4260
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
4274
- function rn(e, t) {
4261
+ function cn(e, t) {
4275
4262
  let n = t.target === "openAi", r = {
4276
4263
  type: "object",
4277
4264
  properties: {}
@@ -4279,9 +4266,9 @@ function rn(e, t) {
4279
4266
  for (let e in a) {
4280
4267
  let o = a[e];
4281
4268
  if (o === void 0 || o._def === void 0) continue;
4282
- let s = on(o);
4269
+ let s = un(o);
4283
4270
  s && n && (o._def.typeName === "ZodOptional" && (o = o._def.innerType), o.isNullable() || (o = o.nullable()), s = !1);
4284
- let c = Q(o._def, {
4271
+ let c = J(o._def, {
4285
4272
  ...t,
4286
4273
  currentPath: [
4287
4274
  ...t.currentPath,
@@ -4297,11 +4284,11 @@ function rn(e, t) {
4297
4284
  c !== void 0 && (r.properties[e] = c, s || i.push(e));
4298
4285
  }
4299
4286
  i.length && (r.required = i);
4300
- let o = an(e, t);
4287
+ let o = ln(e, t);
4301
4288
  return o !== void 0 && (r.additionalProperties = o), r;
4302
4289
  }
4303
- function an(e, t) {
4304
- if (e.catchall._def.typeName !== "ZodNever") return Q(e.catchall._def, {
4290
+ function ln(e, t) {
4291
+ if (e.catchall._def.typeName !== "ZodNever") return J(e.catchall._def, {
4305
4292
  ...t,
4306
4293
  currentPath: [...t.currentPath, "additionalProperties"]
4307
4294
  });
@@ -4311,7 +4298,7 @@ function an(e, t) {
4311
4298
  case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
4312
4299
  }
4313
4300
  }
4314
- function on(e) {
4301
+ function un(e) {
4315
4302
  try {
4316
4303
  return e.isOptional();
4317
4304
  } catch {
@@ -4320,9 +4307,9 @@ function on(e) {
4320
4307
  }
4321
4308
  //#endregion
4322
4309
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
4323
- var sn = (e, t) => {
4324
- if (t.currentPath.toString() === t.propertyPath?.toString()) return Q(e.innerType._def, t);
4325
- let n = Q(e.innerType._def, {
4310
+ var dn = (e, t) => {
4311
+ if (t.currentPath.toString() === t.propertyPath?.toString()) return J(e.innerType._def, t);
4312
+ let n = J(e.innerType._def, {
4326
4313
  ...t,
4327
4314
  currentPath: [
4328
4315
  ...t.currentPath,
@@ -4330,11 +4317,11 @@ var sn = (e, t) => {
4330
4317
  "1"
4331
4318
  ]
4332
4319
  });
4333
- return n ? { anyOf: [{ not: J(t) }, n] } : J(t);
4334
- }, cn = (e, t) => {
4335
- if (t.pipeStrategy === "input") return Q(e.in._def, t);
4336
- if (t.pipeStrategy === "output") return Q(e.out._def, t);
4337
- let n = Q(e.in._def, {
4320
+ return n ? { anyOf: [{ not: W(t) }, n] } : W(t);
4321
+ }, fn = (e, t) => {
4322
+ if (t.pipeStrategy === "input") return J(e.in._def, t);
4323
+ if (t.pipeStrategy === "output") return J(e.out._def, t);
4324
+ let n = J(e.in._def, {
4338
4325
  ...t,
4339
4326
  currentPath: [
4340
4327
  ...t.currentPath,
@@ -4342,7 +4329,7 @@ var sn = (e, t) => {
4342
4329
  "0"
4343
4330
  ]
4344
4331
  });
4345
- return { allOf: [n, Q(e.out._def, {
4332
+ return { allOf: [n, J(e.out._def, {
4346
4333
  ...t,
4347
4334
  currentPath: [
4348
4335
  ...t.currentPath,
@@ -4353,29 +4340,29 @@ var sn = (e, t) => {
4353
4340
  };
4354
4341
  //#endregion
4355
4342
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
4356
- function ln(e, t) {
4357
- return Q(e.type._def, t);
4343
+ function pn(e, t) {
4344
+ return J(e.type._def, t);
4358
4345
  }
4359
4346
  //#endregion
4360
4347
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
4361
- function un(e, t) {
4348
+ function mn(e, t) {
4362
4349
  let n = {
4363
4350
  type: "array",
4364
4351
  uniqueItems: !0,
4365
- items: Q(e.valueType._def, {
4352
+ items: J(e.valueType._def, {
4366
4353
  ...t,
4367
4354
  currentPath: [...t.currentPath, "items"]
4368
4355
  })
4369
4356
  };
4370
- return e.minSize && q(n, "minItems", e.minSize.value, e.minSize.message, t), e.maxSize && q(n, "maxItems", e.maxSize.value, e.maxSize.message, t), n;
4357
+ return e.minSize && U(n, "minItems", e.minSize.value, e.minSize.message, t), e.maxSize && U(n, "maxItems", e.maxSize.value, e.maxSize.message, t), n;
4371
4358
  }
4372
4359
  //#endregion
4373
4360
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
4374
- function dn(e, t) {
4361
+ function hn(e, t) {
4375
4362
  return e.rest ? {
4376
4363
  type: "array",
4377
4364
  minItems: e.items.length,
4378
- items: e.items.map((e, n) => Q(e._def, {
4365
+ items: e.items.map((e, n) => J(e._def, {
4379
4366
  ...t,
4380
4367
  currentPath: [
4381
4368
  ...t.currentPath,
@@ -4383,7 +4370,7 @@ function dn(e, t) {
4383
4370
  `${n}`
4384
4371
  ]
4385
4372
  })).reduce((e, t) => t === void 0 ? e : [...e, t], []),
4386
- additionalItems: Q(e.rest._def, {
4373
+ additionalItems: J(e.rest._def, {
4387
4374
  ...t,
4388
4375
  currentPath: [...t.currentPath, "additionalItems"]
4389
4376
  })
@@ -4391,7 +4378,7 @@ function dn(e, t) {
4391
4378
  type: "array",
4392
4379
  minItems: e.items.length,
4393
4380
  maxItems: e.items.length,
4394
- items: e.items.map((e, n) => Q(e._def, {
4381
+ items: e.items.map((e, n) => J(e._def, {
4395
4382
  ...t,
4396
4383
  currentPath: [
4397
4384
  ...t.currentPath,
@@ -4403,67 +4390,67 @@ function dn(e, t) {
4403
4390
  }
4404
4391
  //#endregion
4405
4392
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
4406
- function fn(e) {
4407
- return { not: J(e) };
4393
+ function gn(e) {
4394
+ return { not: W(e) };
4408
4395
  }
4409
4396
  //#endregion
4410
4397
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
4411
- function pn(e) {
4412
- return J(e);
4398
+ function _n(e) {
4399
+ return W(e);
4413
4400
  }
4414
4401
  //#endregion
4415
4402
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
4416
- var mn = (e, t) => Q(e.innerType._def, t), hn = (e, t, n) => {
4403
+ var vn = (e, t) => J(e.innerType._def, t), yn = (e, t, n) => {
4417
4404
  switch (t) {
4418
- case R.ZodString: return Ht(e, n);
4419
- case R.ZodNumber: return nn(e, n);
4420
- case R.ZodObject: return rn(e, n);
4421
- case R.ZodBigInt: return kt(e, n);
4422
- case R.ZodBoolean: return At();
4423
- case R.ZodDate: return Nt(e, n);
4424
- case R.ZodUndefined: return fn(n);
4425
- case R.ZodNull: return Zt(n);
4426
- case R.ZodArray: return Ot(e, n);
4427
- case R.ZodUnion:
4428
- case R.ZodDiscriminatedUnion: return $t(e, n);
4429
- case R.ZodIntersection: return zt(e, n);
4430
- case R.ZodTuple: return dn(e, n);
4431
- case R.ZodRecord: return qt(e, n);
4432
- case R.ZodLiteral: return Bt(e, n);
4433
- case R.ZodEnum: return Lt(e);
4434
- case R.ZodNativeEnum: return Yt(e);
4435
- case R.ZodNullable: return tn(e, n);
4436
- case R.ZodOptional: return sn(e, n);
4437
- case R.ZodMap: return Jt(e, n);
4438
- case R.ZodSet: return un(e, n);
4439
- case R.ZodLazy: return () => e.getter()._def;
4440
- case R.ZodPromise: return ln(e, n);
4441
- case R.ZodNaN:
4442
- case R.ZodNever: return Xt(n);
4443
- case R.ZodEffects: return It(e, n);
4444
- case R.ZodAny: return J(n);
4445
- case R.ZodUnknown: return pn(n);
4446
- case R.ZodDefault: return Ft(e, n);
4447
- case R.ZodBranded: return jt(e, n);
4448
- case R.ZodReadonly: return mn(e, n);
4449
- case R.ZodCatch: return Mt(e, n);
4450
- case R.ZodPipeline: return cn(e, n);
4451
- case R.ZodFunction:
4452
- case R.ZodVoid:
4453
- case R.ZodSymbol: return;
4405
+ case F.ZodString: return Kt(e, n);
4406
+ case F.ZodNumber: return sn(e, n);
4407
+ case F.ZodObject: return cn(e, n);
4408
+ case F.ZodBigInt: return Nt(e, n);
4409
+ case F.ZodBoolean: return Pt();
4410
+ case F.ZodDate: return Lt(e, n);
4411
+ case F.ZodUndefined: return gn(n);
4412
+ case F.ZodNull: return tn(n);
4413
+ case F.ZodArray: return Mt(e, n);
4414
+ case F.ZodUnion:
4415
+ case F.ZodDiscriminatedUnion: return rn(e, n);
4416
+ case F.ZodIntersection: return Ut(e, n);
4417
+ case F.ZodTuple: return hn(e, n);
4418
+ case F.ZodRecord: return Zt(e, n);
4419
+ case F.ZodLiteral: return Wt(e, n);
4420
+ case F.ZodEnum: return Vt(e);
4421
+ case F.ZodNativeEnum: return $t(e);
4422
+ case F.ZodNullable: return on(e, n);
4423
+ case F.ZodOptional: return dn(e, n);
4424
+ case F.ZodMap: return Qt(e, n);
4425
+ case F.ZodSet: return mn(e, n);
4426
+ case F.ZodLazy: return () => e.getter()._def;
4427
+ case F.ZodPromise: return pn(e, n);
4428
+ case F.ZodNaN:
4429
+ case F.ZodNever: return en(n);
4430
+ case F.ZodEffects: return Bt(e, n);
4431
+ case F.ZodAny: return W(n);
4432
+ case F.ZodUnknown: return _n(n);
4433
+ case F.ZodDefault: return zt(e, n);
4434
+ case F.ZodBranded: return Ft(e, n);
4435
+ case F.ZodReadonly: return vn(e, n);
4436
+ case F.ZodCatch: return It(e, n);
4437
+ case F.ZodPipeline: return fn(e, n);
4438
+ case F.ZodFunction:
4439
+ case F.ZodVoid:
4440
+ case F.ZodSymbol: return;
4454
4441
  default: return ((e) => void 0)(t);
4455
4442
  }
4456
4443
  };
4457
4444
  //#endregion
4458
4445
  //#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js
4459
- function Q(e, t, n = !1) {
4446
+ function J(e, t, n = !1) {
4460
4447
  let r = t.seen.get(e);
4461
4448
  if (t.override) {
4462
4449
  let i = t.override?.(e, t, r, n);
4463
- if (i !== St) return i;
4450
+ if (i !== Et) return i;
4464
4451
  }
4465
4452
  if (r && !n) {
4466
- let e = gn(r, t);
4453
+ let e = bn(r, t);
4467
4454
  if (e !== void 0) return e;
4468
4455
  }
4469
4456
  let i = {
@@ -4472,39 +4459,39 @@ function Q(e, t, n = !1) {
4472
4459
  jsonSchema: void 0
4473
4460
  };
4474
4461
  t.seen.set(e, i);
4475
- let a = hn(e, e.typeName, t), o = typeof a == "function" ? Q(a(), t) : a;
4476
- if (o && _n(e, t, o), t.postProcess) {
4462
+ let a = yn(e, e.typeName, t), o = typeof a == "function" ? J(a(), t) : a;
4463
+ if (o && xn(e, t, o), t.postProcess) {
4477
4464
  let n = t.postProcess(o, e, t);
4478
4465
  return i.jsonSchema = o, n;
4479
4466
  }
4480
4467
  return i.jsonSchema = o, o;
4481
4468
  }
4482
- var gn = (e, t) => {
4469
+ var bn = (e, t) => {
4483
4470
  switch (t.$refStrategy) {
4484
4471
  case "root": return { $ref: e.path.join("/") };
4485
- case "relative": return { $ref: Dt(t.currentPath, e.path) };
4472
+ case "relative": return { $ref: jt(t.currentPath, e.path) };
4486
4473
  case "none":
4487
- case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), J(t)) : t.$refStrategy === "seen" ? J(t) : void 0;
4474
+ case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), W(t)) : t.$refStrategy === "seen" ? W(t) : void 0;
4488
4475
  }
4489
- }, _n = (e, t, n) => (e.description && (n.description = e.description, t.markdownDescription && (n.markdownDescription = e.description)), n), vn = (e, t) => {
4490
- let n = Tt(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
4476
+ }, xn = (e, t, n) => (e.description && (n.description = e.description, t.markdownDescription && (n.markdownDescription = e.description)), n), Sn = (e, t) => {
4477
+ let n = kt(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
4491
4478
  ...e,
4492
- [t]: Q(r._def, {
4479
+ [t]: J(r._def, {
4493
4480
  ...n,
4494
4481
  currentPath: [
4495
4482
  ...n.basePath,
4496
4483
  n.definitionPath,
4497
4484
  t
4498
4485
  ]
4499
- }, !0) ?? J(n)
4500
- }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = Q(e._def, i === void 0 ? n : {
4486
+ }, !0) ?? W(n)
4487
+ }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = J(e._def, i === void 0 ? n : {
4501
4488
  ...n,
4502
4489
  currentPath: [
4503
4490
  ...n.basePath,
4504
4491
  n.definitionPath,
4505
4492
  i
4506
4493
  ]
4507
- }, !1) ?? J(n), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
4494
+ }, !1) ?? W(n), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
4508
4495
  o !== void 0 && (a.title = o), n.flags.hasReferencedOpenAiAnyType && (r ||= {}, r[n.openAiAnyTypeName] || (r[n.openAiAnyTypeName] = {
4509
4496
  type: [
4510
4497
  "string",
@@ -4535,75 +4522,301 @@ var gn = (e, t) => {
4535
4522
  }
4536
4523
  };
4537
4524
  return n.target === "jsonSchema7" ? s.$schema = "http://json-schema.org/draft-07/schema#" : (n.target === "jsonSchema2019-09" || n.target === "openAi") && (s.$schema = "https://json-schema.org/draft/2019-09/schema#"), n.target === "openAi" && ("anyOf" in s || "oneOf" in s || "allOf" in s || "type" in s && Array.isArray(s.type)) && console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."), s;
4538
- };
4525
+ }, Y = (e) => B(e).passthrough(), X = (e) => e.nullable().optional(), Z = B({}).passthrough(), Cn = Y({
4526
+ id: I().describe("Project id; pass as projectId to other tools"),
4527
+ name: I(),
4528
+ key: X(I()).describe("Short prefix, e.g. \"PROJ\""),
4529
+ description: X(I())
4530
+ }).describe("A project"), wn = Y({
4531
+ id: I().describe("Task id; pass as id or taskId to other tools"),
4532
+ projectId: I(),
4533
+ title: I(),
4534
+ status: I().describe("Workflow status key"),
4535
+ priority: I().describe("urgent, high, medium, low or none"),
4536
+ assigneeId: X(I()),
4537
+ dueDate: X(I()),
4538
+ estimatedHours: X(L()),
4539
+ loggedHours: X(L()),
4540
+ isBlocked: X(R())
4541
+ }).describe("A task"), Tn = Y({
4542
+ dependencyId: I().describe("Id of the dependency record"),
4543
+ taskId: I().describe("The other task"),
4544
+ title: I(),
4545
+ status: I(),
4546
+ type: I().describe("'blocking' (the waiting task cannot start until the other finishes) or 'relates_to' (informational)")
4547
+ }), En = wn.extend({ dependencies: X(Y({
4548
+ dependsOn: z(Tn).describe("Tasks this task waits for (upstream)"),
4549
+ dependents: z(Tn).describe("Tasks waiting for this task (downstream)")
4550
+ })).describe("Present when includeDependencies is true") }).describe("A task"), Dn = Y({
4551
+ id: I(),
4552
+ taskId: I().describe("The task that waits"),
4553
+ dependsOnTaskId: I().describe("The task it waits for"),
4554
+ type: I().describe("blocking or relates_to")
4555
+ }).describe("A dependency between two tasks"), On = Y({
4556
+ id: I(),
4557
+ projectId: I(),
4558
+ title: I(),
4559
+ dueDate: X(I())
4560
+ }).describe("A deliverable (milestone)"), kn = Y({
4561
+ id: I(),
4562
+ taskId: I(),
4563
+ content: I(),
4564
+ authorId: X(I())
4565
+ }).describe("A task comment"), An = Y({
4566
+ assigneeId: X(I()),
4567
+ teamId: X(I()),
4568
+ capacity: L().describe("1 for a person, headcount for a team pool"),
4569
+ allocation: L().describe("Total booked in the period, e.g. 1.5 for 150%"),
4570
+ start: I(),
4571
+ end: I(),
4572
+ taskIds: z(I())
4573
+ }), jn = Y({
4574
+ taskId: I(),
4575
+ isCritical: R().describe("True when any delay to this task delays the project end"),
4576
+ totalSlack: L().describe("Slack in hours; 0 means critical"),
4577
+ slackWorkingHours: X(L()).describe("Slack in working hours on the task calendar"),
4578
+ earlyStartDate: X(I()),
4579
+ earlyFinishDate: X(I()),
4580
+ lateStartDate: X(I()),
4581
+ lateFinishDate: X(I()),
4582
+ levelingDelayHours: X(L()).describe("With levelling: hours spent waiting for the assignee"),
4583
+ waitingOn: X(I()).describe("With levelling: the task this one waited for")
4584
+ }), Mn = Y({
4585
+ projectId: I(),
4586
+ projectStartDate: X(I()),
4587
+ projectEndDate: X(I()).describe("Forecast finish date"),
4588
+ totalDurationHours: L(),
4589
+ criticalTaskIds: z(I()).describe("Tasks with zero slack, in schedule order"),
4590
+ tasks: z(jn),
4591
+ leveled: X(R()),
4592
+ unleveledProjectEndDate: X(I()).describe("With levelling: the end date before levelling"),
4593
+ overallocations: X(z(An)).describe("Assignee mode: periods where someone is booked above capacity")
4594
+ }), Nn = Y({
4595
+ projects: z(Mn).describe("One analysis per project"),
4596
+ projectEndDate: X(I()).describe("The latest project end"),
4597
+ leveled: X(R()),
4598
+ overallocations: z(An)
4599
+ }), Pn = Y({
4600
+ id: I(),
4601
+ type: I().describe("container, iteration, deliverable or phase"),
4602
+ name: I(),
4603
+ health: I().describe("on_track, at_risk, blocked, overdue or completed"),
4604
+ progressPercentage: L().describe("0-100"),
4605
+ isCritical: R(),
4606
+ blockedTasks: L(),
4607
+ taskIds: z(I())
4608
+ }), Fn = Y({
4609
+ projectId: I(),
4610
+ level: I(),
4611
+ macro: X(Y({
4612
+ health: I().describe("on_track, at_risk, blocked, overdue or completed"),
4613
+ overallProgressPercentage: L().describe("0-100"),
4614
+ projectedFinishDate: X(I()),
4615
+ totalTasks: L(),
4616
+ completedTasks: L(),
4617
+ blockedTasks: L(),
4618
+ phases: z(Pn)
4619
+ })).describe("Phase-level summary"),
4620
+ standard: X(Z).describe("Task timeline: { tasks, criticalPathTaskIds, dependencies, totalDurationHours }"),
4621
+ concrete: X(V(Z)).describe("Work evidence (time entries, attachments) by task id")
4622
+ }), In = Y({
4623
+ taskId: I(),
4624
+ macroPhase: X(Pn).describe("The phase this task belongs to"),
4625
+ standard: Z.describe("The task with cpm (isCritical, slackWorkingHours, dates), blockingTaskIds and dependentTaskIds"),
4626
+ concrete: Z.describe("Evidence of work on the task"),
4627
+ metrics: X(Z).describe("Same as get_task_metrics")
4628
+ }), Ln = Y({
4629
+ taskId: I(),
4630
+ points: z(Y({
4631
+ timestamp: I(),
4632
+ progress: L().describe("0-100"),
4633
+ status: I()
4634
+ })),
4635
+ curveProfile: I().describe("linear, s_curve, early_surge, late_rush, stalled or insufficient_data")
4636
+ }), Rn = Y({
4637
+ taskId: I(),
4638
+ progress: Y({
4639
+ progressPercentage: L().describe("0-100"),
4640
+ source: I().describe("Where the figure comes from: explicit, todos, time_effort, schedule_elapsed or blended")
4641
+ }),
4642
+ realityDelta: Y({
4643
+ estimatedHours: L(),
4644
+ loggedHours: L(),
4645
+ varianceHours: L().describe("logged minus estimated"),
4646
+ isOverdue: R(),
4647
+ isOverEstimate: R(),
4648
+ scheduleVarianceWorkingDays: X(L()).describe("Working days late (positive) or early (negative)")
4649
+ }),
4650
+ evm: Y({
4651
+ plannedValue: L(),
4652
+ earnedValue: L(),
4653
+ actualCost: L(),
4654
+ costPerformanceIndex: L().describe("CPI = EV / AC; below 1 is over budget"),
4655
+ schedulePerformanceIndex: L().describe("SPI = EV / PV; below 1 is behind schedule")
4656
+ }),
4657
+ inferredActuals: Z.describe("Actual start/end dates and active working time"),
4658
+ progressHistory: Ln
4659
+ }), zn = Y({
4660
+ startDate: I(),
4661
+ endDate: I(),
4662
+ interval: I(),
4663
+ groupBy: I(),
4664
+ metric: I(),
4665
+ seriesKeys: z(I()).describe("Ids of the people, teams, etc. in the series"),
4666
+ seriesLabels: V(I()).describe("Display name for each series key"),
4667
+ buckets: z(Y({
4668
+ date: I().describe("Start of the bucket (YYYY-MM-DD)"),
4669
+ totalHours: L(),
4670
+ values: V(L()).describe("Hours per series key"),
4671
+ capacity: X(V(L())).describe("Capacity hours per series key"),
4672
+ utilizationRatio: X(L()).describe("totalHours / totalCapacity; above 1 is overloaded")
4673
+ })),
4674
+ totalHours: L(),
4675
+ totalCapacity: X(L()),
4676
+ averageUtilization: X(L())
4677
+ }), Bn = Y({
4678
+ skills: X(z(Y({
4679
+ name: I(),
4680
+ description: I()
4681
+ }))).describe("Present when no name was given"),
4682
+ name: X(I()),
4683
+ description: X(I()),
4684
+ content: X(I()).describe("The playbook (markdown); follow its steps")
4685
+ }), Q = [
4686
+ {
4687
+ name: "analyze-schedule",
4688
+ description: "Find what drives a project's end date, how much each task can slip and where people are double-booked, then recommend fixes. Use for \"when will we finish?\", \"what is critical?\" or deadline-risk questions.",
4689
+ content: "---\nname: analyze-schedule\ndescription: Find what drives a project's end date, how much each task can slip and where people are double-booked, then recommend fixes. Use for \"when will we finish?\", \"what is critical?\" or deadline-risk questions.\n---\n\n# Analyze the schedule\n\n## 1. Run the schedule\n\n1. Get the `projectId` (`list_projects`).\n2. Call `calculate_critical_path` with `calendars: \"assignee\"` and `levelResources: true`, so each person works on one task at a time on their own calendar. If the user wants the ideal schedule with unlimited people, call it with no options instead.\n3. If the question spans projects that share people, call `calculate_portfolio_critical_path` with their `projectIds` (and `projectOrder` if the user ranked them) instead.\n4. For in-flight projects, pass `effort: \"remaining\"` so finished hours are not scheduled again.\n\n## 2. Read the result\n\n- `projectEndDate` is the forecast finish. With levelling, compare it with `unleveledProjectEndDate`: the gap is time lost waiting for busy people.\n- `criticalTaskIds` are the tasks with zero slack. Any delay to one of them moves the end date.\n- Each entry in `tasks` has `slackWorkingHours`: how many working hours the task can slip without moving the end. Under about 8 hours is near-critical.\n- `levelingDelayHours` and `waitingOn` show a task that waited for its assignee to finish another task.\n- `overallocations` lists periods where a person (`assigneeId`) or team (`teamId`) is booked above `capacity`; `allocation` 1.5 means 150%.\n\nLook up titles for the task ids you mention with `get_task` or `list_tasks`; report titles, not ids. To see why a critical task cannot start earlier, call `get_task` with `includeDependencies: true`: `dependencies.dependsOn` lists what it waits for and `dependencies.dependents` what waits for it.\n\n## 3. Recommend\n\nRank fixes by how much they pull the end date in:\n\n1. **Unblock critical tasks.** A critical task with `isBlocked: true` delays everything; say what it waits for.\n2. **Move work off the bottleneck person.** If critical tasks wait on one assignee (`waitingOn`), suggest reassigning a non-critical task of theirs.\n3. **Remove false dependencies.** A critical task waiting on work it does not really need (`dependencies.dependsOn`) can start earlier once the link is removed.\n4. **Split long critical tasks** so parts can run in parallel.\n5. **Cut or defer** tasks feeding late deliverables, if dates are fixed.\n\nShow the recommendation to the user. Change tasks (`update_task`) or dependencies (`add_dependency`, `remove_dependency`) only when they ask, then run the schedule again to show the effect.\n\n## Report format\n\n- Forecast finish date, and against any deadline the user gave.\n- Critical path: task titles in order, with assignee.\n- Top risks: near-critical tasks, blocked critical tasks, over-allocations.\n- Recommended actions, each with its expected effect.\n"
4690
+ },
4691
+ {
4692
+ name: "investigate-task",
4693
+ description: "Work out why a specific task is late, stalled or over budget and what it puts at risk. Use when the user asks about one task's status, delay or overrun.",
4694
+ content: "---\nname: investigate-task\ndescription: Work out why a specific task is late, stalled or over budget and what it puts at risk. Use when the user asks about one task's status, delay or overrun.\n---\n\n# Investigate a task\n\n## 1. Identify the task\n\nIf the user named the task rather than giving its id, find it with `list_tasks` (filter by project, assignee or status) and confirm which one they mean if several match.\n\n## 2. Gather evidence\n\n1. `get_task` with `includeDependencies: true`: status, assignee, estimate, logged hours, due date, `isBlocked` and `blockedReason`, plus the tasks it waits for (`dependencies.dependsOn`, with their status) and the tasks waiting on it (`dependencies.dependents`).\n2. `get_task_metrics`: progress and variance.\n3. `get_task_ladder`: its phase (`macroPhase`) and that phase's health, and its schedule in `standard.cpm` (`isCritical`, `slackWorkingHours`).\n4. `list_comments`: what people said about it, especially recent blockers or decisions.\n\n## 3. Diagnose\n\nCheck these in order and stop at the ones that explain the problem:\n\n| Signal | Meaning |\n| --- | --- |\n| `isBlocked` true, an unfinished task in `dependencies.dependsOn`, or comments mention waiting | Blocked. Name what it waits for and its status; investigate that task the same way if it is late too. |\n| `progressHistory.curveProfile` is `stalled` | No progress recently. Check whether the assignee moved to other work. |\n| `realityDelta.isOverEstimate` true or `evm.costPerformanceIndex` below 0.9 | Taking more effort than estimated. The estimate was too low or scope grew. |\n| `evm.schedulePerformanceIndex` below 0.9 or `realityDelta.isOverdue` | Behind schedule. Give `scheduleVarianceWorkingDays`. |\n| No `estimatedHours` | Metrics cannot be trusted; say so and suggest adding an estimate. |\n| `curveProfile` is `late_rush` | Most progress lands near the deadline; the remaining work may be underestimated. |\n\n## 4. Assess the impact\n\n- If the task is critical (`standard.cpm.isCritical`), every day it slips moves the project end. Say so plainly.\n- List the tasks waiting on it (`dependencies.dependents`, by title); they slip with it.\n- Otherwise, report how much slack it has left before it becomes critical.\n- Name the phase or deliverable it endangers.\n\n## 5. Answer\n\nLead with a one-sentence diagnosis, then the evidence (with numbers), the impact, and one to three concrete next steps (unblock, re-estimate, reassign, split). Change the task with `update_task` or record the finding with `add_comment` only if the user asks.\n"
4695
+ },
4696
+ {
4697
+ name: "plan-capacity",
4698
+ description: "Check who is overloaded or idle over a time window and rebalance assignments. Use for capacity planning, workload balancing or \"can we take on more work?\" questions.",
4699
+ content: "---\nname: plan-capacity\ndescription: Check who is overloaded or idle over a time window and rebalance assignments. Use for capacity planning, workload balancing or \"can we take on more work?\" questions.\n---\n\n# Plan capacity\n\n## 1. Measure the load\n\n1. Decide the window and grain with the user, defaulting to the next 8 weeks by `interval: \"week\"`.\n2. Call `get_workload_distribution` with `groupBy: \"assignee\"`, `metric: \"remaining\"`, `startDate` and `endDate` (YYYY-MM-DD). Pass `projectId` for one project, or omit it for the whole workspace (people usually work across projects). Use `groupBy: \"team\"` for team-level questions.\n3. If people do not work 40-hour weeks, pass `defaultWeeklyCapacityHours`.\n\n## 2. Read it\n\n- `seriesKeys` are the people (or teams); `seriesLabels` maps each to a display name.\n- In each bucket, `values[key]` is booked hours and `capacity[key]` is available hours. Load = values / capacity.\n- `utilizationRatio` above 1 is overloaded for the bucket as a whole; check each person too, since one overloaded person hides inside a team average.\n- Treat above 1.0 as overloaded, 0.8-1.0 as full, below 0.5 as spare capacity.\n- Work with no assignee (or team) appears under the key `unassigned`; it is demand nobody has picked up.\n\n## 3. Find what to move\n\n1. For each overloaded person and week, call `list_tasks` with their `assigneeId` to see the tasks behind it.\n2. Call `calculate_critical_path` (with `calendars: \"assignee\"`) for the affected project to learn which of those tasks are critical. Move non-critical tasks first; they have slack.\n3. Match each task with a person who has spare capacity in that window.\n\n## 4. Propose\n\nGive a table: task, from, to, hours moved, effect on both people's load. Note the remaining overload if it cannot be fully resolved, and the options (push dates, add people, cut scope).\n\nApply reassignments with `update_task` (`assigneeId`) only after the user approves, and record each one with `add_comment`.\n"
4700
+ },
4701
+ {
4702
+ name: "plan-project",
4703
+ description: "Turn a goal, brief or feature list into a Critical Path project with deliverables, estimated and prioritized tasks, and the dependencies between them. Use when the user asks to plan, scope or break down work.",
4704
+ content: "---\nname: plan-project\ndescription: Turn a goal, brief or feature list into a Critical Path project with deliverables, estimated and prioritized tasks, and the dependencies between them. Use when the user asks to plan, scope or break down work.\n---\n\n# Plan a project\n\nTurn a goal into deliverables (dated outcomes), tasks (estimated units of work) and dependencies (which task waits for which) the scheduler can use.\n\n## 1. Find or create the project\n\n1. Call `list_projects`. If a project already matches the goal, use it and read it with `get_project` to learn its workflow status keys and custom fields.\n2. Only if none fits, and the user wants a new one, call `create_project` with a `name` and a short `key`.\n3. Call `list_tasks` with the `projectId` and `list_deliverables` to see what already exists. Do not recreate it.\n\n## 2. Draft the plan before writing anything\n\nBreak the goal down in your reply first and show it to the user:\n\n- **Deliverables**: 2-6 outcomes someone could accept or reject, each with a due date if the user gave one.\n- **Tasks** under each deliverable. Each task:\n - starts with a verb and is small enough for one person (about 2-24 hours);\n - has `estimatedHours` (effort, not elapsed time);\n - has a `priority`: `urgent` only for work that blocks others now, `high` for the critical outcome, `medium` by default, `low` for nice-to-haves;\n - lists the tasks it must wait for (its dependencies). Only add a dependency when the work truly cannot start earlier; every extra one lengthens the schedule.\n- Note anything you assumed (team size, dates, scope) as a question.\n\nAsk the user to confirm or adjust before creating anything. A plan is cheap to change in chat and tedious to change once created.\n\n## 3. Create it\n\n1. Create tasks with `create_task` (`projectId`, `title`, `description` with acceptance criteria, `estimatedHours`, `priority`, `assigneeId` if known). Leave `status` out so tasks start in the workflow's default status.\n2. Create each deliverable with `create_deliverable`, passing the ids of its tasks in `taskIds`.\n3. Add each dependency from your plan with `add_dependency`: `taskId` is the task that waits, `dependsOnTaskId` the task that must finish first. Use the ids `create_task` returned. If one is refused as circular, your plan has a loop: fix the order with the user instead of retrying.\n4. If the project already had tasks, check what they wait for with `get_task` and `includeDependencies: true` before linking new work to them.\n\n## 4. Check the result\n\n1. Call `calculate_critical_path` for the project and report the forecast `projectEndDate` and the `criticalTaskIds` (by title). If every task is critical or the end date looks too early, a dependency is probably missing or reversed.\n2. If the end date misses a deliverable's due date, say so and suggest what to cut, split or reassign. The `analyze-schedule` skill covers this in depth.\n\n## Guardrails\n\n- Never invent user ids for `assigneeId`. Leave tasks unassigned unless the user named the person and you have their id.\n- Keep the plan to what the user asked for; propose extra work as suggestions, not tasks.\n"
4705
+ },
4706
+ {
4707
+ name: "report-status",
4708
+ description: "Write a project status report covering progress, phase health, forecast finish, risks and blockers, backed by the schedule and metrics. Use when the user asks how a project is going or wants a status update.",
4709
+ content: "---\nname: report-status\ndescription: Write a project status report covering progress, phase health, forecast finish, risks and blockers, backed by the schedule and metrics. Use when the user asks how a project is going or wants a status update.\n---\n\n# Report project status\n\n## 1. Collect the facts\n\n1. Get the `projectId` (`list_projects`).\n2. Call `get_timeline_ladder` with `level: \"macro\"`. It gives overall `health`, `overallProgressPercentage`, `projectedFinishDate`, task counts and `phases`, each with its own `health`, `progressPercentage` and `isCritical`.\n3. Call `calculate_critical_path` (with `effort: \"remaining\"`) for the forecast `projectEndDate` and the `criticalTaskIds`.\n4. Call `list_tasks` for blocked and urgent work: once with `priority: \"urgent\"` and scan the results (and the project's tasks) for `isBlocked: true`.\n5. For each phase that is `at_risk`, `blocked` or `overdue`, pick its most important open tasks (critical ones first) and call `get_task_metrics` on up to 5 of them.\n6. Call `list_deliverables` and compare each due date with the forecast.\n\n## 2. Interpret\n\n- Phase `health`: `on_track`, `at_risk`, `blocked`, `overdue` or `completed`.\n- Task `evm`: `schedulePerformanceIndex` (SPI) below 0.9 means behind schedule; `costPerformanceIndex` (CPI) below 0.9 means more hours than the progress justifies.\n- `realityDelta.isOverdue` and `scheduleVarianceWorkingDays` give lateness in working days.\n- `progressHistory.curveProfile`: `stalled` needs attention now; `late_rush` suggests hidden risk near the due date.\n\n## 3. Write the report\n\nKeep it short and lead with the answer.\n\n```\n**Status: <On track | At risk | Off track>**, <progress>% done, forecast finish <date> (<deadline comparison>).\n\n**Phases**\n- <phase>: <health>, <progress>% <one-line reason if not on track>\n\n**Risks and blockers**\n- <task title> (<assignee>): <what is wrong, with the number>, <what would fix it>\n\n**Deliverables**\n- <title>: due <date>, forecast <on time | late by N days>\n\n**Next steps**\n- <owner>: <action>\n```\n\nUse task titles, not ids. Name a number for every claim (dates, percentages, hours). If data is missing (no estimates, no logged hours), say so: metrics without estimates are not meaningful.\n\nOnly post the report with `add_comment` if the user asks.\n"
4710
+ },
4711
+ {
4712
+ name: "triage-tasks",
4713
+ description: "Review new, unprioritized or stale tasks and set priority, estimate, tags and blocked state consistently. Use when the user asks to triage, groom or clean up a backlog.",
4714
+ content: "---\nname: triage-tasks\ndescription: Review new, unprioritized or stale tasks and set priority, estimate, tags and blocked state consistently. Use when the user asks to triage, groom or clean up a backlog.\n---\n\n# Triage tasks\n\nMake every task in scope actionable: a clear title, a priority, an estimate and an honest blocked state.\n\n## 1. Gather the tasks\n\n1. Get the `projectId` with `list_projects` if you do not have it, then `get_project` to learn the workflow status keys.\n2. Call `list_tasks` with filters that match the request, for example:\n - untriaged: `priority: \"none\"`;\n - a backlog: `status` set to the backlog key from the workflow;\n - one person's work: `assigneeId`.\n Page with `nextCursor` until it is empty, or stop at a sensible batch (about 25) and say how many remain.\n3. For tasks whose description is thin or which look blocked, read the discussion with `list_comments`.\n\n## 2. Decide, task by task\n\n| Field | Rule |\n| --- | --- |\n| `priority` | `urgent`: blocks other people now or a live problem. `high`: needed for the next deliverable. `medium`: planned work. `low`: nice to have. Reserve `urgent` for a handful of tasks. |\n| `estimatedHours` | Effort in hours. If a task is over about 24 hours, propose splitting it instead of estimating it. |\n| `tags` | Reuse tags already used in the project; do not invent a new scheme. |\n| `isBlocked` / `blockedReason` | Blocked only when work cannot continue; the reason names what it waits for. |\n| title | Starts with a verb and says the outcome. Rewrite only when it is unclear. |\n\nFlag likely duplicates (same outcome, different words) instead of deleting them.\n\n## 3. Propose, then apply\n\n1. Show the user a table: task title, current values, proposed values, one-line reason.\n2. After the user approves (all or some), apply each change with `update_task`, passing only the fields that change.\n3. For any non-obvious change, record why with `add_comment` on the task.\n\n## Guardrails\n\n- Do not change `status` or `assigneeId` during triage unless the user asked for it.\n- Never call `delete_task` during triage. Suggest canceling duplicates and let the user decide.\n"
4715
+ }
4716
+ ];
4717
+ function Vn(e) {
4718
+ return Q.find((t) => t.name === e);
4719
+ }
4539
4720
  //#endregion
4540
4721
  //#region ../mcp/dist/tools/definitions.js
4722
+ var Hn = {
4723
+ core: "Projects, tasks and task dependencies: find, read, create, update and delete",
4724
+ collaboration: "Deliverables (milestones) and task comments",
4725
+ scheduling: "Critical path, portfolio scheduling and workload/capacity",
4726
+ analytics: "Project status ladder, task metrics, earned value and progress history",
4727
+ guidance: "Skills: step-by-step playbooks for multi-step jobs"
4728
+ };
4729
+ function Un(e) {
4730
+ let { $schema: t, ...n } = Sn(e, { $refStrategy: "none" });
4731
+ return n;
4732
+ }
4541
4733
  function $(e) {
4542
- let { $schema: t, ...n } = vn(e.zodSchema, { $refStrategy: "none" });
4734
+ let t = e.annotations?.readOnlyHint ?? !1;
4543
4735
  return {
4544
4736
  ...e,
4545
- inputSchema: n
4737
+ inputSchema: Un(e.zodSchema),
4738
+ outputSchema: Un(e.outputZodSchema),
4739
+ annotations: {
4740
+ readOnlyHint: t,
4741
+ destructiveHint: e.annotations?.destructiveHint ?? !1,
4742
+ idempotentHint: e.annotations?.idempotentHint ?? t,
4743
+ openWorldHint: e.annotations?.openWorldHint ?? !1
4744
+ }
4546
4745
  };
4547
4746
  }
4548
- var yn = class extends Error {
4747
+ var Wn = class extends Error {
4549
4748
  constructor(e, t) {
4550
4749
  super(`Invalid arguments for tool "${e}": ${t}`), this.name = "ToolArgumentError";
4551
4750
  }
4552
4751
  };
4553
- function bn(e, t) {
4752
+ function Gn(e, t) {
4554
4753
  let n = e.zodSchema.strict().safeParse(t ?? {});
4555
4754
  if (!n.success) {
4556
4755
  let t = n.error.issues.map((e) => `${e.path.join(".") || "(root)"}: ${e.message}`).join("; ");
4557
- throw new yn(e.name, t);
4756
+ throw new Wn(e.name, t);
4558
4757
  }
4559
4758
  return n.data;
4560
4759
  }
4561
- var xn = $({
4760
+ async function Kn(e) {
4761
+ return { isEngine: "store" in e && typeof e.store == "object" };
4762
+ }
4763
+ var qn = $({
4562
4764
  name: "list_projects",
4563
4765
  title: "List Projects",
4564
- description: "Retrieve all projects in the workspace.",
4565
- zodSchema: W({}),
4766
+ description: "List every project you can read, with its id, name and key. Start here to find a projectId; never guess ids. Returns { projects }.",
4767
+ toolset: "core",
4768
+ outputZodSchema: B({ projects: z(Cn) }),
4769
+ zodSchema: B({}),
4566
4770
  annotations: { readOnlyHint: !0 },
4567
- execute: async (e, t) => t.getProjects()
4568
- }), Sn = $({
4771
+ execute: async (e, t) => ({ projects: await t.getProjects() })
4772
+ }), Jn = $({
4569
4773
  name: "get_project",
4570
4774
  title: "Get Project",
4571
- description: "Get details of a specific project by its ID.",
4572
- zodSchema: W({ id: z().describe("The project ID") }),
4775
+ description: "Get one project by id: name, key, workflow statuses, custom field definitions and calendar. Use it before creating or moving tasks to learn the valid status keys and custom fields. Returns the project. For its tasks use `list_tasks`.",
4776
+ toolset: "core",
4777
+ outputZodSchema: Cn,
4778
+ zodSchema: B({ id: I().describe("The project ID") }),
4573
4779
  annotations: { readOnlyHint: !0 },
4574
4780
  execute: async (e, t) => t.getProject(e.id)
4575
- }), Cn = $({
4781
+ }), Yn = $({
4576
4782
  name: "create_project",
4577
4783
  title: "Create Project",
4578
- description: "Create a new project workspace.",
4579
- zodSchema: W({
4580
- name: z().describe("Name of the project"),
4581
- description: z().optional().describe("Description of the project"),
4582
- key: z().optional().describe("Short project key/prefix (e.g. \"PROJ\")"),
4583
- customFields: G(H()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
4784
+ description: "Create a new, empty project. Use only when the user wants a new project; to add work to an existing one use `create_task`. Returns the created project with its id.",
4785
+ toolset: "core",
4786
+ outputZodSchema: Cn,
4787
+ zodSchema: B({
4788
+ name: I().describe("Name of the project"),
4789
+ description: I().optional().describe("Description of the project"),
4790
+ key: I().optional().describe("Short project key/prefix (e.g. \"PROJ\")"),
4791
+ customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
4584
4792
  }),
4585
4793
  execute: async (e, t) => t.createProject(e)
4586
- }), wn = $({
4794
+ }), Xn = $({
4587
4795
  name: "list_tasks",
4588
4796
  title: "List Tasks",
4589
- description: "List tasks (oldest first), optionally filtered by project, status, priority, assignee, iteration, deliverable, container or parent task ('none' for top-level tasks). Returns { tasks, nextCursor }; pass nextCursor back as cursor to get the next page.",
4590
- zodSchema: W({
4591
- projectId: z().optional().describe("Filter by project ID"),
4592
- status: z().optional().describe("Filter by task status key"),
4593
- priority: K([
4797
+ description: "Find tasks, oldest first, filtered by project, status, priority, assignee, iteration, deliverable, container or parent task ('none' for top-level tasks only). Use it for questions like \"what is blocked / assigned to X / in progress\" and to look up task ids. Returns { tasks, nextCursor }; pass nextCursor back as cursor for the next page. For one task's full record use `get_task`.",
4798
+ toolset: "core",
4799
+ outputZodSchema: B({
4800
+ tasks: z(wn),
4801
+ nextCursor: I().nullable().optional()
4802
+ }),
4803
+ zodSchema: B({
4804
+ projectId: I().optional().describe("Filter by project ID"),
4805
+ status: I().optional().describe("Filter by task status key"),
4806
+ priority: H([
4594
4807
  "urgent",
4595
4808
  "high",
4596
4809
  "medium",
4597
4810
  "low",
4598
4811
  "none"
4599
4812
  ]).optional().describe("Filter by priority"),
4600
- assigneeId: z().optional().describe("Filter by assignee ID"),
4601
- iterationId: z().optional().describe("Filter by iteration (sprint) ID"),
4602
- deliverableId: z().optional().describe("Filter by deliverable ID"),
4603
- containerId: z().optional().describe("Filter by container (e.g. epic) ID"),
4604
- parentId: z().optional().describe("Subtasks of this task ID, or 'none' for top-level tasks only"),
4605
- limit: B().int().min(1).max(500).optional().describe("Page size (default 100)"),
4606
- cursor: z().optional().describe("nextCursor from a previous call")
4813
+ assigneeId: I().optional().describe("Filter by assignee ID"),
4814
+ iterationId: I().optional().describe("Filter by iteration (sprint) ID"),
4815
+ deliverableId: I().optional().describe("Filter by deliverable ID"),
4816
+ containerId: I().optional().describe("Filter by container (e.g. epic) ID"),
4817
+ parentId: I().optional().describe("Subtasks of this task ID, or 'none' for top-level tasks only"),
4818
+ limit: L().int().min(1).max(500).optional().describe("Page size (default 100)"),
4819
+ cursor: I().optional().describe("nextCursor from a previous call")
4607
4820
  }),
4608
4821
  annotations: { readOnlyHint: !0 },
4609
4822
  execute: async (e, t, n) => {
@@ -4624,41 +4837,86 @@ var xn = $({
4624
4837
  nextCursor: r.nextCursor
4625
4838
  };
4626
4839
  }
4627
- }), Tn = $({
4840
+ }), Zn = $({
4628
4841
  name: "get_task",
4629
4842
  title: "Get Task",
4630
- description: "Get task details by ID.",
4631
- zodSchema: W({ id: z().describe("The task ID") }),
4843
+ description: "Get one task by id: status, priority, assignee, estimate, logged hours, dates, blocked state and custom fields. Set includeDependencies to also see which tasks it waits for and which wait for it. Returns the task, with { dependencies: { dependsOn, dependents } } when asked. For its discussion use `list_comments`; for progress and variance use `get_task_metrics`.",
4844
+ toolset: "core",
4845
+ outputZodSchema: En,
4846
+ zodSchema: B({
4847
+ id: I().describe("The task ID"),
4848
+ includeDependencies: R().optional().describe("Also return the tasks this one waits for (dependsOn) and the tasks waiting for it (dependents)")
4849
+ }),
4632
4850
  annotations: { readOnlyHint: !0 },
4633
- execute: async (e, t) => t.getTask(e.id)
4634
- }), En = $({
4851
+ execute: async (e, t) => {
4852
+ let n = await t.getTask(e.id);
4853
+ if (!n || !e.includeDependencies) return n;
4854
+ let r = await er(t, e.id), i = new Map([...r.upstreamTasks, ...r.downstreamTasks].map((e) => [e.id, e])), a = [], o = [];
4855
+ for (let t of r.dependencies) {
4856
+ let { waiting: n, waitedFor: r } = Qn(t), s = n === e.id ? r : n, c = i.get(s);
4857
+ if (!c || s === e.id) continue;
4858
+ let ee = {
4859
+ dependencyId: t.id,
4860
+ taskId: c.id,
4861
+ title: c.title,
4862
+ status: c.status,
4863
+ type: $n(t)
4864
+ };
4865
+ (n === e.id ? a : o).push(ee);
4866
+ }
4867
+ return {
4868
+ ...n,
4869
+ dependencies: {
4870
+ dependsOn: a,
4871
+ dependents: o
4872
+ }
4873
+ };
4874
+ }
4875
+ });
4876
+ function Qn(e) {
4877
+ return e.type === "blocked_by" ? {
4878
+ waiting: e.dependsOnTaskId,
4879
+ waitedFor: e.taskId
4880
+ } : {
4881
+ waiting: e.taskId,
4882
+ waitedFor: e.dependsOnTaskId
4883
+ };
4884
+ }
4885
+ var $n = (e) => e.type === "relates_to" ? "relates_to" : "blocking";
4886
+ async function er(e, t) {
4887
+ let { isEngine: n } = await Kn(e);
4888
+ return n ? e.getTaskDependencyGraph(t) : e.getTaskDependencies(t);
4889
+ }
4890
+ var tr = $({
4635
4891
  name: "create_task",
4636
4892
  title: "Create Task",
4637
- description: "Create a new task within a project.",
4638
- zodSchema: W({
4639
- projectId: z().optional().describe("Project ID (inferred from active view in browser if omitted)"),
4640
- title: z().describe("Title of the task"),
4641
- description: z().optional().describe("Detailed description / markdown"),
4642
- status: z().optional().describe("Status key (defaults to the project workflow's default status)"),
4643
- priority: K([
4893
+ description: "Create a task in a project. Check with `list_tasks` first so you do not add a duplicate. Without a status the task starts in the project's default workflow status. Returns the created task with its id.",
4894
+ toolset: "core",
4895
+ outputZodSchema: wn,
4896
+ zodSchema: B({
4897
+ projectId: I().optional().describe("Project ID (inferred from active view in browser if omitted)"),
4898
+ title: I().describe("Title of the task"),
4899
+ description: I().optional().describe("Detailed description / markdown"),
4900
+ status: I().optional().describe("Status key (defaults to the project workflow's default status)"),
4901
+ priority: H([
4644
4902
  "urgent",
4645
4903
  "high",
4646
4904
  "medium",
4647
4905
  "low",
4648
4906
  "none"
4649
4907
  ]).optional().default("none").describe("Task priority"),
4650
- assigneeId: z().optional().describe("User ID to assign task to"),
4651
- dueDate: z().optional().describe("Due date (ISO string)"),
4652
- tags: U(z()).optional().describe("Tags for categorization"),
4653
- estimatedHours: B().optional().describe("Estimated hours to complete"),
4654
- allocation: B().gt(0).max(1).optional().describe("Share of the assignee's time the task takes, in (0, 1]; e.g. 0.5 for half-time. Estimates are effort, so a 0.5 task takes twice as long"),
4655
- isBlocked: V().optional().describe("Whether the task is blocked"),
4656
- blockedReason: z().optional().describe("Reason why the task is blocked"),
4657
- customFields: G(H()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
4908
+ assigneeId: I().optional().describe("User ID to assign task to"),
4909
+ dueDate: I().optional().describe("Due date (ISO string)"),
4910
+ tags: z(I()).optional().describe("Tags for categorization"),
4911
+ estimatedHours: L().optional().describe("Estimated hours to complete"),
4912
+ allocation: L().gt(0).max(1).optional().describe("Share of the assignee's time the task takes, in (0, 1]; e.g. 0.5 for half-time. Estimates are effort, so a 0.5 task takes twice as long"),
4913
+ isBlocked: R().optional().describe("Whether the task is blocked"),
4914
+ blockedReason: I().optional().describe("Reason why the task is blocked"),
4915
+ customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
4658
4916
  }),
4659
4917
  execute: async (e, t, n) => {
4660
4918
  let r = e.projectId || n?.projectId;
4661
- if (!r) throw Error("projectId is required to create a task, but none was provided or active in context.");
4919
+ if (!r) throw Error("projectId is required to create a task, but none was provided or active in context. Find one with `list_projects`.");
4662
4920
  let i = {
4663
4921
  projectId: r,
4664
4922
  title: e.title,
@@ -4676,149 +4934,220 @@ var xn = $({
4676
4934
  };
4677
4935
  return t.createTask(i);
4678
4936
  }
4679
- }), Dn = $({
4937
+ }), nr = $({
4680
4938
  name: "update_task",
4681
4939
  title: "Update Task",
4682
- description: "Update fields of an existing task (e.g. title, status, priority, assignee).",
4683
- zodSchema: W({
4684
- id: z().describe("The task ID"),
4685
- title: z().optional(),
4686
- description: z().optional(),
4687
- status: z().optional(),
4688
- priority: K([
4940
+ description: "Change an existing task: title, description, status, priority, assignee, due date, estimate, logged hours, allocation, blocked state, tags or custom fields. Only the fields you pass change. Use it to move a task through its workflow or re-plan it. Returns the updated task.",
4941
+ toolset: "core",
4942
+ outputZodSchema: wn,
4943
+ zodSchema: B({
4944
+ id: I().describe("The task ID"),
4945
+ title: I().optional().describe("New title"),
4946
+ description: I().optional().describe("New description (markdown)"),
4947
+ status: I().optional().describe("Status key from the project's workflow (see `get_project`)"),
4948
+ priority: H([
4689
4949
  "urgent",
4690
4950
  "high",
4691
4951
  "medium",
4692
4952
  "low",
4693
4953
  "none"
4694
- ]).optional(),
4695
- assigneeId: z().optional(),
4696
- dueDate: z().optional(),
4697
- tags: U(z()).optional(),
4698
- estimatedHours: B().optional(),
4699
- allocation: B().gt(0).max(1).optional().describe("Share of the assignee's time the task takes, in (0, 1]; e.g. 0.5 for half-time. Estimates are effort, so a 0.5 task takes twice as long"),
4700
- loggedHours: B().optional(),
4701
- isBlocked: V().optional().describe("Whether the task is blocked"),
4702
- blockedReason: z().optional().describe("Reason why the task is blocked"),
4703
- customFields: G(H()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
4954
+ ]).optional().describe("New priority"),
4955
+ assigneeId: I().optional().describe("User ID to assign the task to"),
4956
+ dueDate: I().optional().describe("Due date (ISO string)"),
4957
+ tags: z(I()).optional().describe("Replaces all tags"),
4958
+ estimatedHours: L().optional().describe("Estimated effort in hours"),
4959
+ allocation: L().gt(0).max(1).optional().describe("Share of the assignee's time the task takes, in (0, 1]; e.g. 0.5 for half-time. Estimates are effort, so a 0.5 task takes twice as long"),
4960
+ loggedHours: L().optional().describe("Total hours worked so far"),
4961
+ isBlocked: R().optional().describe("Whether the task is blocked"),
4962
+ blockedReason: I().optional().describe("Reason why the task is blocked"),
4963
+ customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
4704
4964
  }),
4965
+ annotations: { idempotentHint: !0 },
4705
4966
  execute: async (e, t) => {
4706
4967
  let { id: n, ...r } = e;
4707
4968
  return t.updateTask(n, r);
4708
4969
  }
4709
- }), On = $({
4970
+ }), rr = $({
4710
4971
  name: "delete_task",
4711
4972
  title: "Delete Task",
4712
- description: "Delete a task by ID.",
4713
- zodSchema: W({ id: z().describe("The task ID to delete") }),
4714
- annotations: { requiresConfirmation: !0 },
4973
+ description: "Permanently delete a task by id. This cannot be undone: confirm with the user first, and prefer `update_task` with a canceled status when the history should be kept. Returns { success }.",
4974
+ toolset: "core",
4975
+ outputZodSchema: B({ success: R() }),
4976
+ zodSchema: B({ id: I().describe("The task ID to delete") }),
4977
+ annotations: {
4978
+ destructiveHint: !0,
4979
+ idempotentHint: !0
4980
+ },
4715
4981
  execute: async (e, t) => ({ success: await t.deleteTask(e.id) })
4716
- }), kn = $({
4982
+ }), ir = $({
4983
+ name: "add_dependency",
4984
+ title: "Add Dependency",
4985
+ description: "Record that a task cannot start until another task finishes, so the critical path schedules them in order. Use it when planning or re-sequencing work. Adding a link that already exists returns it; a link that would make a loop is refused. Returns the dependency { id, taskId, dependsOnTaskId, type }. To undo use `remove_dependency`.",
4986
+ toolset: "core",
4987
+ outputZodSchema: Dn,
4988
+ zodSchema: B({
4989
+ taskId: I().describe("The task that waits"),
4990
+ dependsOnTaskId: I().describe("The task that must finish first"),
4991
+ type: H(["blocking", "relates_to"]).optional().describe("'blocking' (default) affects the schedule; 'relates_to' only links the tasks for reference")
4992
+ }),
4993
+ annotations: { idempotentHint: !0 },
4994
+ execute: async (e, t) => {
4995
+ let n = e.type ?? "blocking", { isEngine: r } = await Kn(t);
4996
+ return r ? t.addDependency({
4997
+ taskId: e.taskId,
4998
+ dependsOnTaskId: e.dependsOnTaskId,
4999
+ type: n
5000
+ }) : t.addDependency(e.taskId, {
5001
+ dependsOnTaskId: e.dependsOnTaskId,
5002
+ type: n
5003
+ });
5004
+ }
5005
+ }), ar = $({
5006
+ name: "remove_dependency",
5007
+ title: "Remove Dependency",
5008
+ description: "Stop a task waiting for another task, for example when the order was wrong or the work no longer depends on it. Identify the link by its two task ids, as given to `add_dependency`. Removing a link that does not exist is not an error. Returns { removed, dependencyIds } with the number of links removed.",
5009
+ toolset: "core",
5010
+ outputZodSchema: B({
5011
+ removed: L().describe("How many dependency records were removed (0 if none matched)"),
5012
+ dependencyIds: z(I()).describe("Ids of the removed records")
5013
+ }),
5014
+ zodSchema: B({
5015
+ taskId: I().describe("The task that waits"),
5016
+ dependsOnTaskId: I().describe("The task it waits for"),
5017
+ type: H(["blocking", "relates_to"]).optional().describe("Remove only links of this type (default: both)")
5018
+ }),
5019
+ annotations: { idempotentHint: !0 },
5020
+ execute: async (e, t) => {
5021
+ let n = (await er(t, e.taskId)).dependencies.filter((t) => {
5022
+ let { waiting: n, waitedFor: r } = Qn(t);
5023
+ return n === e.taskId && r === e.dependsOnTaskId && (!e.type || $n(t) === e.type);
5024
+ }), { isEngine: r } = await Kn(t), i = [];
5025
+ for (let e of n) (r ? await t.removeDependency(e.id) : await t.removeDependency(e.taskId, e.id)) && i.push(e.id);
5026
+ return {
5027
+ removed: i.length,
5028
+ dependencyIds: i
5029
+ };
5030
+ }
5031
+ }), or = $({
4717
5032
  name: "list_deliverables",
4718
5033
  title: "List Deliverables",
4719
- description: "List deliverables/milestones for a project.",
4720
- zodSchema: W({ projectId: z().optional().describe("Project ID") }),
5034
+ description: "List a project's deliverables: milestones that group tasks toward a dated outcome. Use it to see what is due and which tasks feed each milestone. Returns { deliverables }.",
5035
+ toolset: "collaboration",
5036
+ outputZodSchema: B({ deliverables: z(On) }),
5037
+ zodSchema: B({ projectId: I().optional().describe("Project ID (falls back to ambient context if omitted)") }),
4721
5038
  annotations: { readOnlyHint: !0 },
4722
5039
  execute: async (e, t, n) => {
4723
5040
  let r = e.projectId || n?.projectId;
4724
- if (!r) throw Error("projectId is required to list deliverables.");
4725
- return "getDeliverables" in t && typeof t.getDeliverables == "function" ? t.getDeliverables(r) : [];
5041
+ if (!r) throw Error("projectId is required to list deliverables. Find one with `list_projects`.");
5042
+ return "getDeliverables" in t && typeof t.getDeliverables == "function" ? { deliverables: await t.getDeliverables(r) } : { deliverables: [] };
4726
5043
  }
4727
- }), An = $({
5044
+ }), sr = $({
4728
5045
  name: "create_deliverable",
4729
5046
  title: "Create Deliverable",
4730
- description: "Create a milestone deliverable within a project.",
4731
- zodSchema: W({
4732
- projectId: z().optional(),
4733
- title: z(),
4734
- description: z().optional(),
4735
- dueDate: z().optional(),
4736
- taskIds: U(z()).optional(),
4737
- customFields: G(H()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
5047
+ description: "Create a deliverable (milestone) in a project, optionally linking existing tasks by id. Use it when planning a dated outcome that several tasks build toward. Returns the created deliverable.",
5048
+ toolset: "collaboration",
5049
+ outputZodSchema: On,
5050
+ zodSchema: B({
5051
+ projectId: I().optional().describe("Project ID (falls back to ambient context if omitted)"),
5052
+ title: I().describe("Name of the deliverable"),
5053
+ description: I().optional().describe("What the deliverable is and how it is accepted"),
5054
+ dueDate: I().optional().describe("Due date (ISO string)"),
5055
+ taskIds: z(I()).optional().describe("IDs of existing tasks that feed this deliverable"),
5056
+ customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
4738
5057
  }),
4739
5058
  execute: async (e, t, n) => {
4740
5059
  let r = e.projectId || n?.projectId;
4741
- if (!r) throw Error("projectId is required to create a deliverable.");
5060
+ if (!r) throw Error("projectId is required to create a deliverable. Find one with `list_projects`.");
4742
5061
  if ("createDeliverable" in t && typeof t.createDeliverable == "function") return t.createDeliverable({
4743
5062
  ...e,
4744
5063
  projectId: r
4745
5064
  });
4746
5065
  throw Error("createDeliverable is not supported by this backend target.");
4747
5066
  }
4748
- }), jn = $({
5067
+ }), cr = $({
4749
5068
  name: "list_comments",
4750
5069
  title: "List Comments",
4751
- description: "List comments associated with a task.",
4752
- zodSchema: W({ taskId: z().describe("The task ID") }),
5070
+ description: "List the comments on a task. Use it to read the discussion, decisions or blockers recorded there. Returns { comments }.",
5071
+ toolset: "collaboration",
5072
+ outputZodSchema: B({ comments: z(kn) }),
5073
+ zodSchema: B({ taskId: I().describe("The task ID") }),
4753
5074
  annotations: { readOnlyHint: !0 },
4754
- execute: async (e, t) => "getComments" in t && typeof t.getComments == "function" ? t.getComments(e.taskId) : []
4755
- }), Mn = $({
5075
+ execute: async (e, t) => "getComments" in t && typeof t.getComments == "function" ? { comments: await t.getComments(e.taskId) } : { comments: [] }
5076
+ }), lr = $({
4756
5077
  name: "add_comment",
4757
5078
  title: "Add Comment",
4758
- description: "Add a comment to a task. The comment is attributed to the identity this MCP server runs as.",
4759
- zodSchema: W({
4760
- taskId: z().describe("The task ID"),
4761
- content: z().describe("Comment body/markdown"),
4762
- customFields: G(H()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
5079
+ description: "Post a comment on a task, attributed to the identity this server runs as. Use it to record a decision, status note, question or the reasoning behind a change you made. Returns the created comment.",
5080
+ toolset: "collaboration",
5081
+ outputZodSchema: kn,
5082
+ zodSchema: B({
5083
+ taskId: I().describe("The task ID"),
5084
+ content: I().describe("Comment body/markdown"),
5085
+ customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
4763
5086
  }),
4764
5087
  execute: async (e, t) => t.addComment({
4765
5088
  taskId: e.taskId,
4766
5089
  content: e.content,
4767
5090
  customFields: e.customFields
4768
5091
  })
4769
- }), Nn = $({
5092
+ }), ur = $({
4770
5093
  name: "calculate_portfolio_critical_path",
4771
5094
  title: "Calculate Portfolio Critical Path",
4772
- description: "Critical path analysis across several projects at once (or every readable project). With calendars \"assignee\" and levelResources, people and teams are shared across projects, so nobody is double-booked between them.",
4773
- zodSchema: W({
4774
- projectIds: U(z()).optional().describe("Projects to include (default: every project you can read)"),
4775
- projectOrder: U(z()).optional().describe("Project ids in priority order for levelling; unlisted projects come last"),
4776
- includeHiddenWork: V().optional().describe("Also count other projects' work (even unreadable ones, shown only as 'hidden') toward people's capacity. Requires workspace.manage"),
4777
- calendars: K(["project", "assignee"]).optional().describe("'assignee' schedules each task on its assignee's or team's calendar"),
4778
- levelResources: V().optional().describe("With calendars 'assignee': share people and team pools across the projects"),
4779
- levelingPriority: K([
5095
+ description: "Schedule several projects together (default: every project you can read) so people and teams shared between them are not double-booked. Use it for cross-project delivery dates and resource conflicts. Returns { projects, projectEndDate, overallocations } with one analysis per project. For a single project use `calculate_critical_path`.",
5096
+ toolset: "scheduling",
5097
+ outputZodSchema: Nn,
5098
+ zodSchema: B({
5099
+ projectIds: z(I()).optional().describe("Projects to include (default: every project you can read)"),
5100
+ projectOrder: z(I()).optional().describe("Project ids in priority order for levelling; unlisted projects come last"),
5101
+ includeHiddenWork: R().optional().describe("Also count other projects' work (even unreadable ones, shown only as 'hidden') toward people's capacity. Requires workspace.manage"),
5102
+ calendars: H(["project", "assignee"]).optional().describe("'assignee' schedules each task on its assignee's or team's calendar"),
5103
+ levelResources: R().optional().describe("With calendars 'assignee': share people and team pools across the projects"),
5104
+ levelingPriority: H([
4780
5105
  "slack",
4781
5106
  "priority",
4782
5107
  "dueDate",
4783
5108
  "order"
4784
5109
  ]).optional().describe("Which ready task gets an assignee first when levelling (default: least slack, then task priority)"),
4785
- effort: K(["estimate", "remaining"]).optional().describe("'remaining' schedules only estimate minus logged hours for in-progress tasks (default: full estimates)")
5110
+ effort: H(["estimate", "remaining"]).optional().describe("'remaining' schedules only estimate minus logged hours for in-progress tasks (default: full estimates)")
4786
5111
  }),
4787
5112
  annotations: { readOnlyHint: !0 },
4788
5113
  execute: async (e, t) => t.calculatePortfolioCriticalPath(e)
4789
- }), Pn = [
4790
- xn,
4791
- Sn,
4792
- Cn,
4793
- wn,
4794
- Tn,
4795
- En,
4796
- Dn,
4797
- On,
4798
- kn,
4799
- An,
4800
- jn,
4801
- Mn,
5114
+ }), dr = [
5115
+ qn,
5116
+ Jn,
5117
+ Yn,
5118
+ Xn,
5119
+ Zn,
5120
+ tr,
5121
+ nr,
5122
+ rr,
5123
+ ir,
5124
+ ar,
5125
+ or,
5126
+ sr,
5127
+ cr,
5128
+ lr,
4802
5129
  $({
4803
5130
  name: "calculate_critical_path",
4804
5131
  title: "Calculate Critical Path",
4805
- description: "Calculate Critical Path Method (CPM) schedule, early/late start and finish, total slack, and critical bottlenecks for a project.",
4806
- zodSchema: W({
4807
- projectId: z().optional().describe("Project ID (falls back to ambient context if omitted)"),
4808
- calendars: K(["project", "assignee"]).optional().describe("'assignee' schedules each task on its assignee's or team's working calendar; default uses the project calendar"),
4809
- levelResources: V().optional().describe("With calendars 'assignee': delay tasks so each assignee works on one task at a time"),
4810
- levelingPriority: K([
5132
+ description: "Schedule one project with the Critical Path Method: which tasks drive the end date, each task's early and late start and finish, and how much it can slip (slack). Use it for \"when will this finish?\", \"what is on the critical path?\" or \"can this task slip?\". Set calendars 'assignee' with levelResources so each person works on one task at a time. Returns { projectEndDate, criticalTaskIds, tasks, overallocations }. For several projects that share people use `calculate_portfolio_critical_path`.",
5133
+ toolset: "scheduling",
5134
+ outputZodSchema: Mn,
5135
+ zodSchema: B({
5136
+ projectId: I().optional().describe("Project ID (falls back to ambient context if omitted)"),
5137
+ calendars: H(["project", "assignee"]).optional().describe("'assignee' schedules each task on its assignee's or team's working calendar; default uses the project calendar"),
5138
+ levelResources: R().optional().describe("With calendars 'assignee': delay tasks so each assignee works on one task at a time"),
5139
+ levelingPriority: H([
4811
5140
  "slack",
4812
5141
  "priority",
4813
5142
  "dueDate",
4814
5143
  "order"
4815
5144
  ]).optional().describe("Which ready task gets an assignee first when levelling (default: least slack, then task priority)"),
4816
- effort: K(["estimate", "remaining"]).optional().describe("'remaining' schedules only estimate minus logged hours for in-progress tasks (default: full estimates)")
5145
+ effort: H(["estimate", "remaining"]).optional().describe("'remaining' schedules only estimate minus logged hours for in-progress tasks (default: full estimates)")
4817
5146
  }),
4818
5147
  annotations: { readOnlyHint: !0 },
4819
5148
  execute: async (e, t, n) => {
4820
5149
  let r = e.projectId || n?.projectId;
4821
- if (!r) throw Error("projectId is required to calculate critical path.");
5150
+ if (!r) throw Error("projectId is required to calculate the critical path. Find one with `list_projects`.");
4822
5151
  let { calendars: i, levelResources: a, levelingPriority: o, effort: s } = e;
4823
5152
  return t.calculateCriticalPath(r, {
4824
5153
  calendars: i,
@@ -4828,26 +5157,28 @@ var xn = $({
4828
5157
  });
4829
5158
  }
4830
5159
  }),
4831
- Nn,
5160
+ ur,
4832
5161
  $({
4833
5162
  name: "get_timeline_ladder",
4834
5163
  title: "Get Timeline Ladder of Abstraction",
4835
- description: "Retrieve Ladder of Abstraction for a project timeline across macro phase envelopes, standard Gantt tasks & CPM, and concrete deliverables/time/attachments.",
4836
- zodSchema: W({
4837
- projectId: z().optional().describe("Project ID (falls back to ambient context if omitted)"),
4838
- level: K([
5164
+ description: "Project status at three zoom levels: 'macro' phases with health (on_track, at_risk, blocked, overdue) and progress, 'standard' task timeline with the critical path and dependencies, and 'concrete' evidence of work (time logged, attachments) per task. Use it for project status reports; level 'macro' gives a compact summary. Returns { macro, standard, concrete }. For a single task use `get_task_ladder`.",
5165
+ toolset: "analytics",
5166
+ outputZodSchema: Fn,
5167
+ zodSchema: B({
5168
+ projectId: I().optional().describe("Project ID (falls back to ambient context if omitted)"),
5169
+ level: H([
4839
5170
  "macro",
4840
5171
  "standard",
4841
5172
  "concrete",
4842
5173
  "all"
4843
5174
  ]).optional().describe("Abstraction level (macro, standard, concrete, or all)"),
4844
- containerId: z().optional().describe("Optional container ID filter"),
4845
- iterationId: z().optional().describe("Optional iteration/sprint ID filter")
5175
+ containerId: I().optional().describe("Optional container ID filter"),
5176
+ iterationId: I().optional().describe("Optional iteration/sprint ID filter")
4846
5177
  }),
4847
5178
  annotations: { readOnlyHint: !0 },
4848
5179
  execute: async (e, t, n) => {
4849
5180
  let r = e.projectId || n?.projectId;
4850
- if (!r) throw Error("projectId is required to get timeline ladder.");
5181
+ if (!r) throw Error("projectId is required to get the timeline ladder. Find one with `list_projects`.");
4851
5182
  return t.getTimelineLadder(r, {
4852
5183
  level: e.level,
4853
5184
  containerId: e.containerId,
@@ -4858,54 +5189,62 @@ var xn = $({
4858
5189
  $({
4859
5190
  name: "get_task_ladder",
4860
5191
  title: "Get Task Ladder View",
4861
- description: "Retrieve multi-scale ladder view for a single task, connecting its macro phase, standard CPM timeline position, and concrete work evidence.",
4862
- zodSchema: W({ taskId: z().describe("The task ID") }),
5192
+ description: "One task in context: the phase it belongs to and that phase's health, its place in the schedule (dates, slack, critical or not) and evidence of work done. Use it to explain where a task fits and whether it puts its phase at risk. Returns { macroPhase, standard, concrete, metrics }. For the numbers alone use `get_task_metrics`.",
5193
+ toolset: "analytics",
5194
+ outputZodSchema: In,
5195
+ zodSchema: B({ taskId: I().describe("The task ID") }),
4863
5196
  annotations: { readOnlyHint: !0 },
4864
5197
  execute: async (e, t) => t.getTaskLadder(e.taskId)
4865
5198
  }),
4866
5199
  $({
4867
5200
  name: "get_task_metrics",
4868
5201
  title: "Get Task Metrics",
4869
- description: "Retrieve multi-dimensional task metrics including inferred actuals, active working duration, effort/duration/schedule variances, progress inference, and Earned Value Management (EVM) metrics.",
4870
- zodSchema: W({ taskId: z().describe("The task ID") }),
5202
+ description: "Is a task on track? Progress percentage, actual against estimated hours, schedule variance, overdue flags and earned value (CPI, SPI). Use it to diagnose a late or over-budget task. Returns { progress, realityDelta, evm, inferredActuals, progressHistory }.",
5203
+ toolset: "analytics",
5204
+ outputZodSchema: Rn,
5205
+ zodSchema: B({ taskId: I().describe("The task ID") }),
4871
5206
  annotations: { readOnlyHint: !0 },
4872
5207
  execute: async (e, t) => t.getTaskMetrics(e.taskId)
4873
5208
  }),
4874
5209
  $({
4875
5210
  name: "get_task_progress_history",
4876
5211
  title: "Get Task Progress History",
4877
- description: "Retrieve time-series progress data points and curve shape classification (linear, s_curve, early_surge, late_rush, stalled) for a task.",
4878
- zodSchema: W({ taskId: z().describe("The task ID") }),
5212
+ description: "How a task's progress has moved over time: dated progress points and a curve shape (linear, s_curve, early_surge, late_rush, stalled). Use it to tell whether work is stalling or being rushed at the end. Returns { points, curveProfile }. `get_task_metrics` includes the same history alongside variance and earned value.",
5213
+ toolset: "analytics",
5214
+ outputZodSchema: Ln,
5215
+ zodSchema: B({ taskId: I().describe("The task ID") }),
4879
5216
  annotations: { readOnlyHint: !0 },
4880
5217
  execute: async (e, t) => t.getTaskProgressHistory(e.taskId)
4881
5218
  }),
4882
5219
  $({
4883
5220
  name: "get_workload_distribution",
4884
5221
  title: "Get Workload Distribution",
4885
- description: "Retrieve time-series workload and capacity distribution suitable for streamgraphs, stacked charts, and team capacity planning.",
4886
- zodSchema: W({
4887
- projectId: z().optional().describe("Project ID (optional, defaults to workspace-wide or ambient project)"),
4888
- startDate: z().optional().describe("Start date ISO (YYYY-MM-DD)"),
4889
- endDate: z().optional().describe("End date ISO (YYYY-MM-DD)"),
4890
- interval: K([
5222
+ description: "Hours of work per person, team, task type, priority or status in each day, week or month, with capacity and utilization. Use it for \"who is overloaded?\" and capacity planning; a utilizationRatio above 1 means more work than capacity. Omit projectId for the whole workspace. Returns { buckets, seriesKeys, seriesLabels, totalHours, averageUtilization }.",
5223
+ toolset: "scheduling",
5224
+ outputZodSchema: zn,
5225
+ zodSchema: B({
5226
+ projectId: I().optional().describe("Project ID (optional, defaults to workspace-wide or ambient project)"),
5227
+ startDate: I().optional().describe("Start date ISO (YYYY-MM-DD)"),
5228
+ endDate: I().optional().describe("End date ISO (YYYY-MM-DD)"),
5229
+ interval: H([
4891
5230
  "day",
4892
5231
  "week",
4893
5232
  "month"
4894
5233
  ]).optional().describe("Bucket interval (day, week, month)"),
4895
- groupBy: K([
5234
+ groupBy: H([
4896
5235
  "assignee",
4897
5236
  "team",
4898
5237
  "taskType",
4899
5238
  "priority",
4900
5239
  "status"
4901
5240
  ]).optional().describe("Dimension to segment by"),
4902
- metric: K([
5241
+ metric: H([
4903
5242
  "scheduled",
4904
5243
  "logged",
4905
5244
  "remaining",
4906
5245
  "blended"
4907
5246
  ]).optional().describe("Effort metric mode"),
4908
- defaultWeeklyCapacityHours: B().optional().describe("Default weekly capacity hours per person (default 40)")
5247
+ defaultWeeklyCapacityHours: L().optional().describe("Default weekly capacity hours per person (default 40)")
4909
5248
  }),
4910
5249
  annotations: { readOnlyHint: !0 },
4911
5250
  execute: async (e, t, n) => {
@@ -4919,12 +5258,136 @@ var xn = $({
4919
5258
  defaultWeeklyCapacityHours: e.defaultWeeklyCapacityHours
4920
5259
  });
4921
5260
  }
5261
+ }),
5262
+ $({
5263
+ name: "get_skill",
5264
+ title: "Get Skill",
5265
+ description: "Load a step-by-step playbook for a multi-step project management job, such as planning a project, triaging tasks, finding schedule risk, writing a status report, checking capacity or investigating a late task. Call it before starting such a job and follow its steps. Omit name to list the skills. Returns { name, description, content }, or { skills } without a name.",
5266
+ toolset: "guidance",
5267
+ outputZodSchema: Bn,
5268
+ zodSchema: B({ name: I().optional().describe("Skill name, e.g. \"plan-project\"; omit to list all skills") }),
5269
+ annotations: { readOnlyHint: !0 },
5270
+ execute: async (e) => {
5271
+ if (!e.name) return { skills: Q.map(({ name: e, description: t }) => ({
5272
+ name: e,
5273
+ description: t
5274
+ })) };
5275
+ let t = Vn(e.name);
5276
+ if (!t) throw Error(`Skill "${e.name}" not found. Available skills: ${Q.map((e) => e.name).join(", ")}.`);
5277
+ return t;
5278
+ }
4922
5279
  })
5280
+ ], fr = new Map(dr.map((e) => [e.name, e]));
5281
+ function pr(e = {}) {
5282
+ let { tools: t, toolsets: n, readOnly: r } = e, i = (t ?? []).filter((e) => !fr.has(e));
5283
+ if (i.length > 0) throw Error(`Unknown Critical Path tool(s): ${i.join(", ")}. Known tools: ${dr.map((e) => e.name).join(", ")}.`);
5284
+ let a = (n ?? []).filter((e) => !(e in Hn));
5285
+ if (a.length > 0) throw Error(`Unknown Critical Path toolset(s): ${a.join(", ")}. Known toolsets: ${Object.keys(Hn).join(", ")}.`);
5286
+ let o = !t && !n;
5287
+ return dr.filter((e) => (o || t?.includes(e.name) || n?.includes(e.toolset)) && (!r || e.annotations.readOnlyHint));
5288
+ }
5289
+ var mr = class extends Error {
5290
+ constructor(e) {
5291
+ super(e), this.name = "ToolNotFoundError";
5292
+ }
5293
+ }, hr = "Check the id: find valid project ids with `list_projects` and task ids with `list_tasks`. Ids are never guessable, and items you cannot read are reported as not found.";
5294
+ async function gr(e, t, n, r) {
5295
+ try {
5296
+ let i = await e.execute(Gn(e, t), n, r);
5297
+ if (i == null) throw new mr(`Nothing found for ${JSON.stringify(t ?? {})}.`);
5298
+ return JSON.parse(JSON.stringify(i));
5299
+ } catch (t) {
5300
+ throw Error(_r(e, t));
5301
+ }
5302
+ }
5303
+ function _r(e, t) {
5304
+ let n = t?.message || String(t);
5305
+ return t instanceof Wn ? `${n}. Fix the arguments to match the input schema of "${e.name}" and call it again.` : t instanceof mr || t?.name === "NotFoundError" || t?.status === 404 || /not found/i.test(n) ? `${n} ${hr}` : t?.name === "CircularDependencyError" || /circular/i.test(n) ? `${n} The tasks are already ordered the other way round. Check with \`get_task\` and includeDependencies, and ask the user which order is right rather than retrying.` : t?.name === "ForbiddenError" || t?.status === 403 ? `${n} You do not have permission for this; tell the user rather than retrying.` : n;
5306
+ }
5307
+ //#endregion
5308
+ //#region ../mcp/dist/tools/instructions.js
5309
+ var vr = [
5310
+ {
5311
+ when: "Find a project or task id",
5312
+ tools: ["list_projects", "list_tasks"]
5313
+ },
5314
+ {
5315
+ when: "Read one task, then its discussion",
5316
+ tools: ["get_task", "list_comments"]
5317
+ },
5318
+ {
5319
+ when: "Add or change work",
5320
+ tools: [
5321
+ "create_task",
5322
+ "update_task",
5323
+ "create_deliverable"
5324
+ ]
5325
+ },
5326
+ {
5327
+ when: "Order work: task B cannot start until task A finishes",
5328
+ tools: ["add_dependency", "remove_dependency"]
5329
+ },
5330
+ {
5331
+ when: "What a task waits for and what waits for it",
5332
+ tools: ["get_task"]
5333
+ },
5334
+ {
5335
+ when: "Record a decision or note on a task",
5336
+ tools: ["add_comment"]
5337
+ },
5338
+ {
5339
+ when: "\"When will it finish?\" / \"What is critical?\"",
5340
+ tools: ["calculate_critical_path"]
5341
+ },
5342
+ {
5343
+ when: "Dates and conflicts across several projects",
5344
+ tools: ["calculate_portfolio_critical_path"]
5345
+ },
5346
+ {
5347
+ when: "Project status and phase health",
5348
+ tools: ["get_timeline_ladder"]
5349
+ },
5350
+ {
5351
+ when: "\"Is this task on track?\" / why is it late",
5352
+ tools: [
5353
+ "get_task_metrics",
5354
+ "get_task_ladder",
5355
+ "get_task_progress_history"
5356
+ ]
5357
+ },
5358
+ {
5359
+ when: "\"Who is overloaded?\" / capacity",
5360
+ tools: ["get_workload_distribution"]
5361
+ }
4923
5362
  ];
4924
- new Map(Pn.map((e) => [e.name, e]));
5363
+ function yr(e, t = {}) {
5364
+ let n = new Set(e.map((e) => e.name)), r = [
5365
+ "Critical Path is a project management backend. A project holds tasks and deliverables (milestones that group tasks). Tasks have a workflow status, priority, assignee, effort estimate, logged hours, optional subtasks (parentId) and dependencies, and comments.",
5366
+ "",
5367
+ "Working rules:",
5368
+ "- Never guess ids. Get them from list or create results.",
5369
+ "- Results are JSON objects. List results are paged where they return nextCursor; pass it back as cursor.",
5370
+ "- Status values are keys from the project's workflow; read them from get_project before setting one.",
5371
+ "- Confirm with the user before any tool marked destructive."
5372
+ ];
5373
+ t.projectId && r.push(`- The user is viewing project "${t.projectId}"; tools use it when you omit projectId.`);
5374
+ let i = vr.map((e) => ({
5375
+ ...e,
5376
+ tools: e.tools.filter((e) => n.has(e))
5377
+ })).filter((e) => e.tools.length > 0);
5378
+ if (i.length > 0) {
5379
+ r.push("", "Which tool to use:");
5380
+ for (let e of i) r.push(`- ${e.when}: ${e.tools.join(", ")}`);
5381
+ }
5382
+ if (n.has("get_skill") && Q.length > 0) {
5383
+ r.push("", "For multi-step jobs, load the matching skill with get_skill { name } before you start, and follow it:");
5384
+ for (let e of Q) r.push(`- ${e.name}: ${e.description}`);
5385
+ }
5386
+ return r.join("\n");
5387
+ }
4925
5388
  //#endregion
4926
5389
  //#region ../mcp/dist/web/index.js
4927
- function Fn(e = typeof document < "u" ? document : null) {
5390
+ function br(e = typeof document < "u" ? document : null) {
4928
5391
  if (!e) return null;
4929
5392
  if (!e.modelContext) {
4930
5393
  let t = /* @__PURE__ */ new Map();
@@ -4949,55 +5412,60 @@ function Fn(e = typeof document < "u" ? document : null) {
4949
5412
  }
4950
5413
  return e.modelContext;
4951
5414
  }
4952
- function In(e) {
5415
+ function xr(e) {
4953
5416
  let t = e.document ?? (typeof document < "u" ? document : null), n = e.navigator ?? (typeof navigator < "u" ? navigator : null), r = e.window ?? (typeof window < "u" ? window : null), i;
4954
- t?.modelContext ? i = t.modelContext : n?.modelContext ? i = n.modelContext : t && (i = Fn(t) ?? void 0);
4955
- let a = e.tools ? Pn.filter((t) => e.tools.includes(t.name)) : Pn, o = [], s = new AbortController();
5417
+ t?.modelContext ? i = t.modelContext : n?.modelContext ? i = n.modelContext : t && (i = br(t) ?? void 0);
5418
+ let a = pr({
5419
+ tools: e.tools,
5420
+ toolsets: e.toolsets,
5421
+ readOnly: e.readOnly
5422
+ }), o = yr(a, { projectId: e.projectId }), s = [], c = new AbortController();
4956
5423
  if (e.signal?.aborted) return {
4957
5424
  unregister: () => {},
4958
- getRegisteredTools: () => []
5425
+ getRegisteredTools: () => [],
5426
+ instructions: o
4959
5427
  };
4960
- e.signal && e.signal.addEventListener("abort", () => s.abort(), { once: !0 });
5428
+ e.signal && e.signal.addEventListener("abort", () => c.abort(), { once: !0 });
4961
5429
  for (let t of a) {
4962
5430
  let n = {
4963
5431
  name: t.name,
4964
5432
  title: t.title,
4965
5433
  description: t.description,
4966
5434
  inputSchema: t.inputSchema,
4967
- annotations: {
4968
- readOnlyHint: t.annotations?.readOnlyHint ?? !1,
4969
- destructiveHint: t.annotations?.requiresConfirmation ?? !1
4970
- },
5435
+ outputSchema: t.outputSchema,
5436
+ annotations: { ...t.annotations },
4971
5437
  execute: async (n) => {
4972
- let r = e.projectId ? { projectId: e.projectId } : void 0, i = await t.execute(bn(t, n), e.client, r);
5438
+ let r = e.projectId ? { projectId: e.projectId } : void 0, i = await gr(t, n, e.client, r);
4973
5439
  return e.onToolExecuted?.(t.name, n, i), i;
4974
5440
  }
4975
5441
  };
4976
- if (o.push(n), i?.registerTool) try {
4977
- i.registerTool(n, { signal: s.signal });
5442
+ if (s.push(n), i?.registerTool) try {
5443
+ i.registerTool(n, { signal: c.signal });
4978
5444
  } catch (e) {
4979
5445
  console.warn(`[Critical Path WebMCP] Failed to register tool "${n.name}":`, e);
4980
5446
  }
4981
5447
  }
4982
5448
  return r && (r.__CRITICAL_PATH_WEBMCP__ = {
4983
5449
  projectId: e.projectId,
4984
- tools: o,
5450
+ instructions: o,
5451
+ tools: s,
4985
5452
  execute: async (e, t) => {
4986
- let n = o.find((t) => t.name === e);
5453
+ let n = s.find((t) => t.name === e);
4987
5454
  if (!n) throw Error(`WebMCP tool "${e}" not found in Critical Path registry.`);
4988
5455
  return n.execute(t);
4989
5456
  }
4990
5457
  }), {
4991
5458
  unregister: () => {
4992
- if (s.abort(), i?.unregisterTool) for (let e of o) i.unregisterTool(e.name);
4993
- r && r.__CRITICAL_PATH_WEBMCP__?.tools === o && delete r.__CRITICAL_PATH_WEBMCP__;
5459
+ if (c.abort(), i?.unregisterTool) for (let e of s) i.unregisterTool(e.name);
5460
+ r && r.__CRITICAL_PATH_WEBMCP__?.tools === s && delete r.__CRITICAL_PATH_WEBMCP__;
4994
5461
  },
4995
- getRegisteredTools: () => o
5462
+ getRegisteredTools: () => s,
5463
+ instructions: o
4996
5464
  };
4997
5465
  }
4998
5466
  //#endregion
4999
5467
  //#region src/webmcp-state.svelte.ts
5000
- var Ln = class {
5468
+ var Sr = class {
5001
5469
  client;
5002
5470
  options;
5003
5471
  #e = t.state(!1);
@@ -5021,13 +5489,20 @@ var Ln = class {
5021
5489
  set tools(e) {
5022
5490
  t.set(this.#n, e, !0);
5023
5491
  }
5024
- #r = t.state(null);
5025
- get error() {
5492
+ #r = t.state("");
5493
+ get instructions() {
5026
5494
  return t.get(this.#r);
5027
5495
  }
5028
- set error(e) {
5496
+ set instructions(e) {
5029
5497
  t.set(this.#r, e, !0);
5030
5498
  }
5499
+ #i = t.state(null);
5500
+ get error() {
5501
+ return t.get(this.#i);
5502
+ }
5503
+ set error(e) {
5504
+ t.set(this.#i, e, !0);
5505
+ }
5031
5506
  handle = null;
5032
5507
  abortController = null;
5033
5508
  constructor(e, t = {}) {
@@ -5037,10 +5512,12 @@ var Ln = class {
5037
5512
  if (!this.registered) {
5038
5513
  this.error = null;
5039
5514
  try {
5040
- this.abortController = new AbortController(), this.handle = In({
5515
+ this.abortController = new AbortController(), this.handle = xr({
5041
5516
  client: this.client,
5042
5517
  projectId: this.activeProjectId,
5043
5518
  tools: this.options.tools,
5519
+ toolsets: this.options.toolsets,
5520
+ readOnly: this.options.readOnly,
5044
5521
  signal: this.abortController.signal,
5045
5522
  document: this.options.document,
5046
5523
  navigator: this.options.navigator,
@@ -5048,25 +5525,25 @@ var Ln = class {
5048
5525
  onToolExecuted: (e, t, n) => {
5049
5526
  this.options.onToolExecuted?.(e, t, n);
5050
5527
  }
5051
- }), this.tools = this.handle.getRegisteredTools().map((e) => e.name), this.registered = !0;
5528
+ }), this.tools = this.handle.getRegisteredTools().map((e) => e.name), this.instructions = this.handle.instructions, this.registered = !0;
5052
5529
  } catch (e) {
5053
5530
  this.error = e instanceof Error ? e : Error(String(e)), this.registered = !1;
5054
5531
  }
5055
5532
  }
5056
5533
  }
5057
5534
  unregister() {
5058
- this.registered && (this.abortController?.abort(), this.handle?.unregister(), this.handle = null, this.abortController = null, this.registered = !1, this.tools = []);
5535
+ this.registered && (this.abortController?.abort(), this.handle?.unregister(), this.handle = null, this.abortController = null, this.registered = !1, this.tools = [], this.instructions = "");
5059
5536
  }
5060
5537
  setProjectId(e) {
5061
5538
  this.activeProjectId !== e && (this.activeProjectId = e, this.registered && (this.unregister(), this.register()));
5062
5539
  }
5063
5540
  };
5064
- function Rn(e, t) {
5065
- return new Ln(e, t);
5541
+ function Cr(e, t) {
5542
+ return new Sr(e, t);
5066
5543
  }
5067
5544
  //#endregion
5068
5545
  //#region src/critical-path-state.svelte.ts
5069
- var zn = class {
5546
+ var wr = class {
5070
5547
  client;
5071
5548
  projectId;
5072
5549
  #e = new i();
@@ -5110,12 +5587,12 @@ var zn = class {
5110
5587
  this.#e.cancel();
5111
5588
  }
5112
5589
  };
5113
- function Bn(e, t) {
5114
- return new zn(e, t);
5590
+ function Tr(e, t) {
5591
+ return new wr(e, t);
5115
5592
  }
5116
5593
  //#endregion
5117
5594
  //#region src/timeline-ladder-state.svelte.ts
5118
- var Vn = class {
5595
+ var Er = class {
5119
5596
  client;
5120
5597
  projectId;
5121
5598
  #e = new i();
@@ -5193,12 +5670,12 @@ var Vn = class {
5193
5670
  this.#e.cancel();
5194
5671
  }
5195
5672
  };
5196
- function Hn(e, t, n) {
5197
- return new Vn(e, t, n);
5673
+ function Dr(e, t, n) {
5674
+ return new Er(e, t, n);
5198
5675
  }
5199
5676
  //#endregion
5200
5677
  //#region src/task-metrics-state.svelte.ts
5201
- var Un = class {
5678
+ var Or = class {
5202
5679
  client;
5203
5680
  taskId;
5204
5681
  #e = new i();
@@ -5317,12 +5794,12 @@ var Un = class {
5317
5794
  this.#e.cancel(), this.#t.cancel(), this.#n.cancel();
5318
5795
  }
5319
5796
  };
5320
- function Wn(e, t) {
5321
- return new Un(e, t);
5797
+ function kr(e, t) {
5798
+ return new Or(e, t);
5322
5799
  }
5323
5800
  //#endregion
5324
5801
  //#region src/workload-state.svelte.ts
5325
- var Gn = class {
5802
+ var Ar = class {
5326
5803
  client;
5327
5804
  projectId;
5328
5805
  initialOptions;
@@ -5445,13 +5922,13 @@ var Gn = class {
5445
5922
  this.#e.cancel();
5446
5923
  }
5447
5924
  };
5448
- function Kn(e, t, n) {
5449
- return new Gn(e, t, n);
5925
+ function jr(e, t, n) {
5926
+ return new Ar(e, t, n);
5450
5927
  }
5451
5928
  //#endregion
5452
5929
  //#region src/index.ts
5453
- function qn(t) {
5930
+ function Mr(t) {
5454
5931
  return new e(t);
5455
5932
  }
5456
5933
  //#endregion
5457
- export { ie as AttachmentState, ne as CommentState, zn as CriticalPathState, ce as DeliverableState, ue as DeliverableSummaryState, fe as KanbanState, a as ProjectState, oe as TaskActivityState, Un as TaskMetricsState, s as TaskState, me as TaskTransitionsState, Vn as TimelineLadderState, Ln as WebMcpState, ee as WorkflowState, Gn as WorkloadState, ae as createAttachmentState, re as createCommentState, qn as createCriticalPathClient, Bn as createCriticalPathState, le as createDeliverableState, de as createDeliverableSummaryState, pe as createKanbanState, o as createProjectState, se as createTaskActivityState, Wn as createTaskMetricsState, c as createTaskState, he as createTaskTransitionsState, Hn as createTimelineLadderState, Rn as createWebMcpState, te as createWorkflowState, Kn as createWorkloadState };
5934
+ export { ie as AttachmentState, ne as CommentState, wr as CriticalPathState, ce as DeliverableState, ue as DeliverableSummaryState, fe as KanbanState, a as ProjectState, oe as TaskActivityState, Or as TaskMetricsState, s as TaskState, me as TaskTransitionsState, Er as TimelineLadderState, Sr as WebMcpState, ee as WorkflowState, Ar as WorkloadState, ae as createAttachmentState, re as createCommentState, Mr as createCriticalPathClient, Tr as createCriticalPathState, le as createDeliverableState, de as createDeliverableSummaryState, pe as createKanbanState, o as createProjectState, se as createTaskActivityState, kr as createTaskMetricsState, c as createTaskState, he as createTaskTransitionsState, Dr as createTimelineLadderState, Cr as createWebMcpState, te as createWorkflowState, jr as createWorkloadState };