@critical-path/svelte 0.18.20 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/index.js +1124 -635
- package/dist/webmcp-state.svelte.d.ts +8 -0
- package/dist/webmcp-state.svelte.d.ts.map +1 -1
- package/package.json +9 -9
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
|
-
|
|
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
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
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
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
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
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
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
|
|
1382
|
+
return new M({
|
|
1389
1383
|
schema: this,
|
|
1390
|
-
typeName:
|
|
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
|
|
1402
|
+
return N.create(this, this._def);
|
|
1409
1403
|
}
|
|
1410
1404
|
nullable() {
|
|
1411
|
-
return
|
|
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
|
|
1411
|
+
return E.create(this);
|
|
1418
1412
|
}
|
|
1419
1413
|
promise() {
|
|
1420
|
-
return
|
|
1414
|
+
return j.create(this, this._def);
|
|
1421
1415
|
}
|
|
1422
1416
|
or(e) {
|
|
1423
|
-
return
|
|
1417
|
+
return ot.create([this, e], this._def);
|
|
1424
1418
|
}
|
|
1425
1419
|
and(e) {
|
|
1426
|
-
return
|
|
1420
|
+
return lt.create(this, e, this._def);
|
|
1427
1421
|
}
|
|
1428
1422
|
transform(e) {
|
|
1429
|
-
return new
|
|
1423
|
+
return new M({
|
|
1430
1424
|
...S(this._def),
|
|
1431
1425
|
schema: this,
|
|
1432
|
-
typeName:
|
|
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
|
|
1435
|
+
return new yt({
|
|
1442
1436
|
...S(this._def),
|
|
1443
1437
|
innerType: this,
|
|
1444
1438
|
defaultValue: t,
|
|
1445
|
-
typeName:
|
|
1439
|
+
typeName: F.ZodDefault
|
|
1446
1440
|
});
|
|
1447
1441
|
}
|
|
1448
1442
|
brand() {
|
|
1449
|
-
return new
|
|
1450
|
-
typeName:
|
|
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
|
|
1451
|
+
return new bt({
|
|
1458
1452
|
...S(this._def),
|
|
1459
1453
|
innerType: this,
|
|
1460
1454
|
catchValue: t,
|
|
1461
|
-
typeName:
|
|
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
|
|
1466
|
+
return Ct.create(this, e);
|
|
1473
1467
|
}
|
|
1474
1468
|
readonly() {
|
|
1475
|
-
return
|
|
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
|
|
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
|
|
1506
|
+
return !((t !== "v4" && t || !Ie.test(e)) && (t !== "v6" && t || !Re.test(e)));
|
|
1513
1507
|
}
|
|
1514
|
-
var
|
|
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
|
-
|
|
1916
|
+
Ye.create = (e) => new Ye({
|
|
1923
1917
|
checks: [],
|
|
1924
|
-
typeName:
|
|
1918
|
+
typeName: F.ZodString,
|
|
1925
1919
|
coerce: e?.coerce ?? !1,
|
|
1926
1920
|
...S(e)
|
|
1927
1921
|
});
|
|
1928
|
-
function
|
|
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
|
|
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" ?
|
|
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
|
-
|
|
2085
|
+
Ze.create = (e) => new Ze({
|
|
2092
2086
|
checks: [],
|
|
2093
|
-
typeName:
|
|
2087
|
+
typeName: F.ZodNumber,
|
|
2094
2088
|
coerce: e?.coerce || !1,
|
|
2095
2089
|
...S(e)
|
|
2096
2090
|
});
|
|
2097
|
-
var
|
|
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
|
-
|
|
2212
|
+
Qe.create = (e) => new Qe({
|
|
2219
2213
|
checks: [],
|
|
2220
|
-
typeName:
|
|
2214
|
+
typeName: F.ZodBigInt,
|
|
2221
2215
|
coerce: e?.coerce ?? !1,
|
|
2222
2216
|
...S(e)
|
|
2223
2217
|
});
|
|
2224
|
-
var
|
|
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
|
-
|
|
2238
|
-
typeName:
|
|
2231
|
+
$e.create = (e) => new $e({
|
|
2232
|
+
typeName: F.ZodBoolean,
|
|
2239
2233
|
coerce: e?.coerce || !1,
|
|
2240
2234
|
...S(e)
|
|
2241
2235
|
});
|
|
2242
|
-
var
|
|
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
|
-
|
|
2299
|
+
et.create = (e) => new et({
|
|
2306
2300
|
checks: [],
|
|
2307
2301
|
coerce: e?.coerce || !1,
|
|
2308
|
-
typeName:
|
|
2302
|
+
typeName: F.ZodDate,
|
|
2309
2303
|
...S(e)
|
|
2310
2304
|
});
|
|
2311
|
-
var
|
|
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
|
-
|
|
2325
|
-
typeName:
|
|
2318
|
+
tt.create = (e) => new tt({
|
|
2319
|
+
typeName: F.ZodSymbol,
|
|
2326
2320
|
...S(e)
|
|
2327
2321
|
});
|
|
2328
|
-
var
|
|
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
|
-
|
|
2342
|
-
typeName:
|
|
2335
|
+
nt.create = (e) => new nt({
|
|
2336
|
+
typeName: F.ZodUndefined,
|
|
2343
2337
|
...S(e)
|
|
2344
2338
|
});
|
|
2345
|
-
var
|
|
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
|
-
|
|
2359
|
-
typeName:
|
|
2352
|
+
rt.create = (e) => new rt({
|
|
2353
|
+
typeName: F.ZodNull,
|
|
2360
2354
|
...S(e)
|
|
2361
2355
|
});
|
|
2362
|
-
var
|
|
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
|
-
|
|
2371
|
-
typeName:
|
|
2364
|
+
it.create = (e) => new it({
|
|
2365
|
+
typeName: F.ZodAny,
|
|
2372
2366
|
...S(e)
|
|
2373
2367
|
});
|
|
2374
|
-
var
|
|
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
|
-
|
|
2383
|
-
typeName:
|
|
2376
|
+
w.create = (e) => new w({
|
|
2377
|
+
typeName: F.ZodUnknown,
|
|
2384
2378
|
...S(e)
|
|
2385
2379
|
});
|
|
2386
|
-
var
|
|
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
|
-
|
|
2397
|
-
typeName:
|
|
2390
|
+
T.create = (e) => new T({
|
|
2391
|
+
typeName: F.ZodNever,
|
|
2398
2392
|
...S(e)
|
|
2399
2393
|
});
|
|
2400
|
-
var
|
|
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
|
-
|
|
2414
|
-
typeName:
|
|
2407
|
+
at.create = (e) => new at({
|
|
2408
|
+
typeName: F.ZodVoid,
|
|
2415
2409
|
...S(e)
|
|
2416
2410
|
});
|
|
2417
|
-
var
|
|
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
|
-
|
|
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:
|
|
2488
|
+
typeName: F.ZodArray,
|
|
2495
2489
|
...S(t)
|
|
2496
2490
|
});
|
|
2497
|
-
function
|
|
2498
|
-
if (e instanceof
|
|
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] =
|
|
2496
|
+
t[n] = N.create(D(r));
|
|
2503
2497
|
}
|
|
2504
|
-
return new
|
|
2498
|
+
return new O({
|
|
2505
2499
|
...e._def,
|
|
2506
2500
|
shape: () => t
|
|
2507
2501
|
});
|
|
2508
2502
|
}
|
|
2509
|
-
return e instanceof
|
|
2503
|
+
return e instanceof E ? new E({
|
|
2510
2504
|
...e._def,
|
|
2511
|
-
type:
|
|
2512
|
-
}) : e instanceof
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
2685
|
+
return gt(l.objectKeys(this.shape));
|
|
2692
2686
|
}
|
|
2693
2687
|
};
|
|
2694
|
-
|
|
2688
|
+
O.create = (e, t) => new O({
|
|
2695
2689
|
shape: () => e,
|
|
2696
2690
|
unknownKeys: "strip",
|
|
2697
|
-
catchall:
|
|
2698
|
-
typeName:
|
|
2691
|
+
catchall: T.create(),
|
|
2692
|
+
typeName: F.ZodObject,
|
|
2699
2693
|
...S(t)
|
|
2700
|
-
}),
|
|
2694
|
+
}), O.strictCreate = (e, t) => new O({
|
|
2701
2695
|
shape: () => e,
|
|
2702
2696
|
unknownKeys: "strict",
|
|
2703
|
-
catchall:
|
|
2704
|
-
typeName:
|
|
2697
|
+
catchall: T.create(),
|
|
2698
|
+
typeName: F.ZodObject,
|
|
2705
2699
|
...S(t)
|
|
2706
|
-
}),
|
|
2700
|
+
}), O.lazycreate = (e, t) => new O({
|
|
2707
2701
|
shape: e,
|
|
2708
2702
|
unknownKeys: "strip",
|
|
2709
|
-
catchall:
|
|
2710
|
-
typeName:
|
|
2703
|
+
catchall: T.create(),
|
|
2704
|
+
typeName: F.ZodObject,
|
|
2711
2705
|
...S(t)
|
|
2712
2706
|
});
|
|
2713
|
-
var
|
|
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
|
-
|
|
2770
|
+
ot.create = (e, t) => new ot({
|
|
2777
2771
|
options: e,
|
|
2778
|
-
typeName:
|
|
2772
|
+
typeName: F.ZodUnion,
|
|
2779
2773
|
...S(t)
|
|
2780
2774
|
});
|
|
2781
|
-
var
|
|
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 =
|
|
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:
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
-
|
|
2894
|
+
lt.create = (e, t, n) => new lt({
|
|
2901
2895
|
left: e,
|
|
2902
2896
|
right: t,
|
|
2903
|
-
typeName:
|
|
2897
|
+
typeName: F.ZodIntersection,
|
|
2904
2898
|
...S(n)
|
|
2905
2899
|
});
|
|
2906
|
-
var
|
|
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
|
-
|
|
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
|
|
2940
|
+
return new A({
|
|
2947
2941
|
items: e,
|
|
2948
|
-
typeName:
|
|
2942
|
+
typeName: F.ZodTuple,
|
|
2949
2943
|
rest: null,
|
|
2950
2944
|
...S(t)
|
|
2951
2945
|
});
|
|
2952
2946
|
};
|
|
2953
|
-
var
|
|
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:
|
|
2976
|
+
typeName: F.ZodRecord,
|
|
2983
2977
|
...S(r)
|
|
2984
2978
|
}) : new e({
|
|
2985
|
-
keyType:
|
|
2979
|
+
keyType: Ye.create(),
|
|
2986
2980
|
valueType: t,
|
|
2987
|
-
typeName:
|
|
2981
|
+
typeName: F.ZodRecord,
|
|
2988
2982
|
...S(n)
|
|
2989
2983
|
});
|
|
2990
2984
|
}
|
|
2991
|
-
},
|
|
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
|
-
|
|
3031
|
+
dt.create = (e, t, n) => new dt({
|
|
3038
3032
|
valueType: t,
|
|
3039
3033
|
keyType: e,
|
|
3040
|
-
typeName:
|
|
3034
|
+
typeName: F.ZodMap,
|
|
3041
3035
|
...S(n)
|
|
3042
3036
|
});
|
|
3043
|
-
var
|
|
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
|
-
|
|
3101
|
+
ft.create = (e, t) => new ft({
|
|
3108
3102
|
valueType: e,
|
|
3109
3103
|
minSize: null,
|
|
3110
3104
|
maxSize: null,
|
|
3111
|
-
typeName:
|
|
3105
|
+
typeName: F.ZodSet,
|
|
3112
3106
|
...S(t)
|
|
3113
3107
|
});
|
|
3114
|
-
var
|
|
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
|
|
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:
|
|
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 ||
|
|
3207
|
-
returns: n ||
|
|
3208
|
-
typeName:
|
|
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
|
-
},
|
|
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
|
-
|
|
3219
|
+
mt.create = (e, t) => new mt({
|
|
3226
3220
|
getter: e,
|
|
3227
|
-
typeName:
|
|
3221
|
+
typeName: F.ZodLazy,
|
|
3228
3222
|
...S(t)
|
|
3229
3223
|
});
|
|
3230
|
-
var
|
|
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
|
-
|
|
3243
|
+
ht.create = (e, t) => new ht({
|
|
3250
3244
|
value: e,
|
|
3251
|
-
typeName:
|
|
3245
|
+
typeName: F.ZodLiteral,
|
|
3252
3246
|
...S(t)
|
|
3253
3247
|
});
|
|
3254
|
-
function
|
|
3255
|
-
return new
|
|
3248
|
+
function gt(e, t) {
|
|
3249
|
+
return new _t({
|
|
3256
3250
|
values: e,
|
|
3257
|
-
typeName:
|
|
3251
|
+
typeName: F.ZodEnum,
|
|
3258
3252
|
...S(t)
|
|
3259
3253
|
});
|
|
3260
3254
|
}
|
|
3261
|
-
var
|
|
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
|
-
|
|
3313
|
-
var
|
|
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
|
-
|
|
3332
|
+
vt.create = (e, t) => new vt({
|
|
3339
3333
|
values: e,
|
|
3340
|
-
typeName:
|
|
3334
|
+
typeName: F.ZodNativeEnum,
|
|
3341
3335
|
...S(t)
|
|
3342
3336
|
});
|
|
3343
|
-
var
|
|
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
|
-
|
|
3353
|
+
j.create = (e, t) => new j({
|
|
3360
3354
|
type: e,
|
|
3361
|
-
typeName:
|
|
3355
|
+
typeName: F.ZodPromise,
|
|
3362
3356
|
...S(t)
|
|
3363
3357
|
});
|
|
3364
|
-
var
|
|
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 ===
|
|
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
|
-
|
|
3449
|
+
M.create = (e, t, n) => new M({
|
|
3456
3450
|
schema: e,
|
|
3457
|
-
typeName:
|
|
3451
|
+
typeName: F.ZodEffects,
|
|
3458
3452
|
effect: t,
|
|
3459
3453
|
...S(n)
|
|
3460
|
-
}),
|
|
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:
|
|
3460
|
+
typeName: F.ZodEffects,
|
|
3467
3461
|
...S(n)
|
|
3468
3462
|
});
|
|
3469
|
-
var
|
|
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
|
-
|
|
3471
|
+
N.create = (e, t) => new N({
|
|
3478
3472
|
innerType: e,
|
|
3479
|
-
typeName:
|
|
3473
|
+
typeName: F.ZodOptional,
|
|
3480
3474
|
...S(t)
|
|
3481
3475
|
});
|
|
3482
|
-
var
|
|
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
|
-
|
|
3484
|
+
P.create = (e, t) => new P({
|
|
3491
3485
|
innerType: e,
|
|
3492
|
-
typeName:
|
|
3486
|
+
typeName: F.ZodNullable,
|
|
3493
3487
|
...S(t)
|
|
3494
3488
|
});
|
|
3495
|
-
var
|
|
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
|
-
|
|
3502
|
+
yt.create = (e, t) => new yt({
|
|
3509
3503
|
innerType: e,
|
|
3510
|
-
typeName:
|
|
3504
|
+
typeName: F.ZodDefault,
|
|
3511
3505
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
3512
3506
|
...S(t)
|
|
3513
3507
|
});
|
|
3514
|
-
var
|
|
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
|
-
|
|
3543
|
+
bt.create = (e, t) => new bt({
|
|
3550
3544
|
innerType: e,
|
|
3551
|
-
typeName:
|
|
3545
|
+
typeName: F.ZodCatch,
|
|
3552
3546
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
3553
3547
|
...S(t)
|
|
3554
3548
|
});
|
|
3555
|
-
var
|
|
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
|
-
|
|
3572
|
-
typeName:
|
|
3565
|
+
xt.create = (e) => new xt({
|
|
3566
|
+
typeName: F.ZodNaN,
|
|
3573
3567
|
...S(e)
|
|
3574
3568
|
});
|
|
3575
|
-
var
|
|
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
|
-
},
|
|
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:
|
|
3616
|
+
typeName: F.ZodPipeline
|
|
3623
3617
|
});
|
|
3624
3618
|
}
|
|
3625
|
-
},
|
|
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
|
-
|
|
3628
|
+
wt.create = (e, t) => new wt({
|
|
3635
3629
|
innerType: e,
|
|
3636
|
-
typeName:
|
|
3630
|
+
typeName: F.ZodReadonly,
|
|
3637
3631
|
...S(t)
|
|
3638
|
-
}),
|
|
3639
|
-
var
|
|
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
|
-
})(
|
|
3643
|
-
var
|
|
3644
|
-
|
|
3645
|
-
var
|
|
3646
|
-
|
|
3647
|
-
var
|
|
3648
|
-
|
|
3649
|
-
var
|
|
3650
|
-
|
|
3651
|
-
var
|
|
3652
|
-
|
|
3653
|
-
var
|
|
3654
|
-
|
|
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
|
|
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
|
-
},
|
|
3681
|
-
...
|
|
3674
|
+
}, Ot = (e) => typeof e == "string" ? {
|
|
3675
|
+
...Dt,
|
|
3682
3676
|
name: e
|
|
3683
3677
|
} : {
|
|
3684
|
-
...
|
|
3678
|
+
...Dt,
|
|
3685
3679
|
...e
|
|
3686
|
-
},
|
|
3687
|
-
let t =
|
|
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
|
|
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
|
|
3717
|
-
e[t] = n,
|
|
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
|
|
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
|
|
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" ?
|
|
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
|
|
3733
|
+
function Mt(e, t) {
|
|
3740
3734
|
let n = { type: "array" };
|
|
3741
|
-
return e.type?._def && e.type?._def?.typeName !==
|
|
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 &&
|
|
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
|
|
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 ?
|
|
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 ?
|
|
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":
|
|
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
|
|
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
|
|
3773
|
-
return
|
|
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
|
|
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
|
|
3774
|
+
function Lt(e, t, n) {
|
|
3781
3775
|
let r = n ?? t.dateStrategy;
|
|
3782
|
-
if (Array.isArray(r)) return { anyOf: r.map((n, r) =>
|
|
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
|
|
3787
|
+
case "integer": return Rt(e, t);
|
|
3794
3788
|
}
|
|
3795
3789
|
}
|
|
3796
|
-
var
|
|
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
|
-
|
|
3798
|
+
U(n, "minimum", r.value, r.message, t);
|
|
3805
3799
|
break;
|
|
3806
|
-
case "max":
|
|
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
|
|
3806
|
+
function zt(e, t) {
|
|
3813
3807
|
return {
|
|
3814
|
-
...
|
|
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
|
|
3821
|
-
return t.effectStrategy === "input" ?
|
|
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
|
|
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
|
|
3834
|
-
function
|
|
3835
|
-
let n = [
|
|
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
|
-
}),
|
|
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 (
|
|
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
|
|
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
|
|
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: () => (
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3901
|
+
K(n, "email", r.message, t);
|
|
3908
3902
|
break;
|
|
3909
3903
|
case "format:idn-email":
|
|
3910
|
-
|
|
3904
|
+
K(n, "idn-email", r.message, t);
|
|
3911
3905
|
break;
|
|
3912
|
-
case "pattern:zod":
|
|
3906
|
+
case "pattern:zod": q(n, G.email, r.message, t);
|
|
3913
3907
|
}
|
|
3914
3908
|
break;
|
|
3915
3909
|
case "url":
|
|
3916
|
-
|
|
3910
|
+
K(n, "uri", r.message, t);
|
|
3917
3911
|
break;
|
|
3918
3912
|
case "uuid":
|
|
3919
|
-
|
|
3913
|
+
K(n, "uuid", r.message, t);
|
|
3920
3914
|
break;
|
|
3921
3915
|
case "regex":
|
|
3922
|
-
|
|
3916
|
+
q(n, r.regex, r.message, t);
|
|
3923
3917
|
break;
|
|
3924
3918
|
case "cuid":
|
|
3925
|
-
|
|
3919
|
+
q(n, G.cuid, r.message, t);
|
|
3926
3920
|
break;
|
|
3927
3921
|
case "cuid2":
|
|
3928
|
-
|
|
3922
|
+
q(n, G.cuid2, r.message, t);
|
|
3929
3923
|
break;
|
|
3930
3924
|
case "startsWith":
|
|
3931
|
-
|
|
3925
|
+
q(n, RegExp(`^${qt(r.value, t)}`), r.message, t);
|
|
3932
3926
|
break;
|
|
3933
3927
|
case "endsWith":
|
|
3934
|
-
|
|
3928
|
+
q(n, RegExp(`${qt(r.value, t)}$`), r.message, t);
|
|
3935
3929
|
break;
|
|
3936
3930
|
case "datetime":
|
|
3937
|
-
|
|
3931
|
+
K(n, "date-time", r.message, t);
|
|
3938
3932
|
break;
|
|
3939
3933
|
case "date":
|
|
3940
|
-
|
|
3934
|
+
K(n, "date", r.message, t);
|
|
3941
3935
|
break;
|
|
3942
3936
|
case "time":
|
|
3943
|
-
|
|
3937
|
+
K(n, "time", r.message, t);
|
|
3944
3938
|
break;
|
|
3945
3939
|
case "duration":
|
|
3946
|
-
|
|
3940
|
+
K(n, "duration", r.message, t);
|
|
3947
3941
|
break;
|
|
3948
3942
|
case "length":
|
|
3949
|
-
|
|
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
|
-
|
|
3946
|
+
q(n, RegExp(qt(r.value, t)), r.message, t);
|
|
3953
3947
|
break;
|
|
3954
3948
|
case "ip":
|
|
3955
|
-
r.version !== "v6" &&
|
|
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
|
-
|
|
3952
|
+
q(n, G.base64url, r.message, t);
|
|
3959
3953
|
break;
|
|
3960
3954
|
case "jwt":
|
|
3961
|
-
|
|
3955
|
+
q(n, G.jwt, r.message, t);
|
|
3962
3956
|
break;
|
|
3963
3957
|
case "cidr":
|
|
3964
|
-
r.version !== "v6" &&
|
|
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
|
-
|
|
3961
|
+
q(n, G.emoji(), r.message, t);
|
|
3968
3962
|
break;
|
|
3969
3963
|
case "ulid":
|
|
3970
|
-
|
|
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
|
-
|
|
3969
|
+
K(n, "binary", r.message, t);
|
|
3976
3970
|
break;
|
|
3977
3971
|
case "contentEncoding:base64":
|
|
3978
|
-
|
|
3972
|
+
U(n, "contentEncoding", "base64", r.message, t);
|
|
3979
3973
|
break;
|
|
3980
|
-
case "pattern:zod":
|
|
3974
|
+
case "pattern:zod": q(n, G.base64, r.message, t);
|
|
3981
3975
|
}
|
|
3982
3976
|
break;
|
|
3983
|
-
case "nanoid":
|
|
3977
|
+
case "nanoid": q(n, G.nanoid, r.message, t);
|
|
3984
3978
|
}
|
|
3985
3979
|
return n;
|
|
3986
3980
|
}
|
|
3987
|
-
function
|
|
3988
|
-
return t.patternStrategy === "escape" ?
|
|
3981
|
+
function qt(e, t) {
|
|
3982
|
+
return t.patternStrategy === "escape" ? Yt(e) : e;
|
|
3989
3983
|
}
|
|
3990
|
-
var
|
|
3991
|
-
function
|
|
3984
|
+
var Jt = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
3985
|
+
function Yt(e) {
|
|
3992
3986
|
let t = "";
|
|
3993
|
-
for (let n = 0; n < e.length; 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
|
|
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
|
-
})) :
|
|
3997
|
+
})) : U(e, "format", t, n, r);
|
|
4004
3998
|
}
|
|
4005
|
-
function
|
|
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:
|
|
4004
|
+
pattern: Xt(t, r),
|
|
4011
4005
|
...n && r.errorMessages && { errorMessage: { pattern: n } }
|
|
4012
|
-
})) :
|
|
4006
|
+
})) : U(e, "pattern", Xt(t, r), n, r);
|
|
4013
4007
|
}
|
|
4014
|
-
function
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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 ===
|
|
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]:
|
|
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
|
-
}) ??
|
|
4062
|
+
}) ?? W(t)
|
|
4076
4063
|
}), {}),
|
|
4077
4064
|
additionalProperties: t.rejectedAdditionalProperties
|
|
4078
4065
|
};
|
|
4079
4066
|
let n = {
|
|
4080
4067
|
type: "object",
|
|
4081
|
-
additionalProperties:
|
|
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 ===
|
|
4088
|
-
let { type: r, ...i } =
|
|
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 ===
|
|
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 ===
|
|
4099
|
-
let { type: r, ...i } =
|
|
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
|
|
4110
|
-
return t.mapStrategy === "record" ?
|
|
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: [
|
|
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
|
-
}) ||
|
|
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
|
-
}) ||
|
|
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
|
|
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
|
|
4149
|
-
return e.target === "openAi" ? void 0 : { not:
|
|
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
|
|
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
|
|
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
|
|
4172
|
-
if (t.target === "openApi3") return
|
|
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
|
|
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 =
|
|
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
|
|
4191
|
+
return an(e, t);
|
|
4205
4192
|
}
|
|
4206
|
-
var
|
|
4207
|
-
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) =>
|
|
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
|
|
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:
|
|
4214
|
+
type: nn[e.innerType._def.typeName],
|
|
4228
4215
|
nullable: !0
|
|
4229
|
-
} : { type: [
|
|
4216
|
+
} : { type: [nn[e.innerType._def.typeName], "null"] };
|
|
4230
4217
|
if (t.target === "openApi3") {
|
|
4231
|
-
let n =
|
|
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 =
|
|
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
|
|
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",
|
|
4247
|
+
n.type = "integer", At(n, "type", r.message, t);
|
|
4261
4248
|
break;
|
|
4262
4249
|
case "min":
|
|
4263
|
-
t.target === "jsonSchema7" ? r.inclusive ?
|
|
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 ?
|
|
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":
|
|
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
|
|
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 =
|
|
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 =
|
|
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 =
|
|
4287
|
+
let o = ln(e, t);
|
|
4301
4288
|
return o !== void 0 && (r.additionalProperties = o), r;
|
|
4302
4289
|
}
|
|
4303
|
-
function
|
|
4304
|
-
if (e.catchall._def.typeName !== "ZodNever") return
|
|
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
|
|
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
|
|
4324
|
-
if (t.currentPath.toString() === t.propertyPath?.toString()) return
|
|
4325
|
-
let n =
|
|
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:
|
|
4334
|
-
},
|
|
4335
|
-
if (t.pipeStrategy === "input") return
|
|
4336
|
-
if (t.pipeStrategy === "output") return
|
|
4337
|
-
let n =
|
|
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,
|
|
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
|
|
4357
|
-
return
|
|
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
|
|
4348
|
+
function mn(e, t) {
|
|
4362
4349
|
let n = {
|
|
4363
4350
|
type: "array",
|
|
4364
4351
|
uniqueItems: !0,
|
|
4365
|
-
items:
|
|
4352
|
+
items: J(e.valueType._def, {
|
|
4366
4353
|
...t,
|
|
4367
4354
|
currentPath: [...t.currentPath, "items"]
|
|
4368
4355
|
})
|
|
4369
4356
|
};
|
|
4370
|
-
return e.minSize &&
|
|
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
|
|
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) =>
|
|
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:
|
|
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) =>
|
|
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
|
|
4407
|
-
return { not:
|
|
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
|
|
4412
|
-
return
|
|
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
|
|
4403
|
+
var vn = (e, t) => J(e.innerType._def, t), yn = (e, t, n) => {
|
|
4417
4404
|
switch (t) {
|
|
4418
|
-
case
|
|
4419
|
-
case
|
|
4420
|
-
case
|
|
4421
|
-
case
|
|
4422
|
-
case
|
|
4423
|
-
case
|
|
4424
|
-
case
|
|
4425
|
-
case
|
|
4426
|
-
case
|
|
4427
|
-
case
|
|
4428
|
-
case
|
|
4429
|
-
case
|
|
4430
|
-
case
|
|
4431
|
-
case
|
|
4432
|
-
case
|
|
4433
|
-
case
|
|
4434
|
-
case
|
|
4435
|
-
case
|
|
4436
|
-
case
|
|
4437
|
-
case
|
|
4438
|
-
case
|
|
4439
|
-
case
|
|
4440
|
-
case
|
|
4441
|
-
case
|
|
4442
|
-
case
|
|
4443
|
-
case
|
|
4444
|
-
case
|
|
4445
|
-
case
|
|
4446
|
-
case
|
|
4447
|
-
case
|
|
4448
|
-
case
|
|
4449
|
-
case
|
|
4450
|
-
case
|
|
4451
|
-
case
|
|
4452
|
-
case
|
|
4453
|
-
case
|
|
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
|
|
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 !==
|
|
4450
|
+
if (i !== Et) return i;
|
|
4464
4451
|
}
|
|
4465
4452
|
if (r && !n) {
|
|
4466
|
-
let e =
|
|
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 =
|
|
4476
|
-
if (o &&
|
|
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
|
|
4469
|
+
var bn = (e, t) => {
|
|
4483
4470
|
switch (t.$refStrategy) {
|
|
4484
4471
|
case "root": return { $ref: e.path.join("/") };
|
|
4485
|
-
case "relative": return { $ref:
|
|
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`),
|
|
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
|
-
},
|
|
4490
|
-
let n =
|
|
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]:
|
|
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) ??
|
|
4500
|
-
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a =
|
|
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) ??
|
|
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,307 @@ 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
|
+
deadline: X(I()).describe("Latest acceptable finish, enforced by critical path analysis"),
|
|
4539
|
+
isMilestone: X(R()).describe("A zero-duration checkpoint"),
|
|
4540
|
+
estimatedHours: X(L()),
|
|
4541
|
+
loggedHours: X(L()),
|
|
4542
|
+
isBlocked: X(R())
|
|
4543
|
+
}).describe("A task"), Tn = Y({
|
|
4544
|
+
dependencyId: I().describe("Id of the dependency record"),
|
|
4545
|
+
taskId: I().describe("The other task"),
|
|
4546
|
+
title: I(),
|
|
4547
|
+
status: I(),
|
|
4548
|
+
type: I().describe("'blocking' (the waiting task cannot start until the other finishes) or 'relates_to' (informational)")
|
|
4549
|
+
}), En = wn.extend({ dependencies: X(Y({
|
|
4550
|
+
dependsOn: z(Tn).describe("Tasks this task waits for (upstream)"),
|
|
4551
|
+
dependents: z(Tn).describe("Tasks waiting for this task (downstream)")
|
|
4552
|
+
})).describe("Present when includeDependencies is true") }).describe("A task"), Dn = Y({
|
|
4553
|
+
id: I(),
|
|
4554
|
+
taskId: I().describe("The task that waits"),
|
|
4555
|
+
dependsOnTaskId: I().describe("The task it waits for"),
|
|
4556
|
+
type: I().describe("blocking or relates_to")
|
|
4557
|
+
}).describe("A dependency between two tasks"), On = Y({
|
|
4558
|
+
id: I(),
|
|
4559
|
+
projectId: I(),
|
|
4560
|
+
title: I(),
|
|
4561
|
+
dueDate: X(I())
|
|
4562
|
+
}).describe("A deliverable"), kn = Y({
|
|
4563
|
+
id: I(),
|
|
4564
|
+
taskId: I(),
|
|
4565
|
+
content: I(),
|
|
4566
|
+
authorId: X(I())
|
|
4567
|
+
}).describe("A task comment"), An = Y({
|
|
4568
|
+
assigneeId: X(I()),
|
|
4569
|
+
teamId: X(I()),
|
|
4570
|
+
capacity: L().describe("1 for a person, headcount for a team pool"),
|
|
4571
|
+
allocation: L().describe("Total booked in the period, e.g. 1.5 for 150%"),
|
|
4572
|
+
start: I(),
|
|
4573
|
+
end: I(),
|
|
4574
|
+
taskIds: z(I())
|
|
4575
|
+
}), jn = Y({
|
|
4576
|
+
taskId: I(),
|
|
4577
|
+
isCritical: R().describe("True when any delay to this task delays the project end"),
|
|
4578
|
+
totalSlack: L().describe("Slack in hours; 0 means critical, negative means a deadline is missed by that much"),
|
|
4579
|
+
slackWorkingHours: X(L()).describe("Slack in working hours on the task calendar"),
|
|
4580
|
+
earlyStartDate: X(I()),
|
|
4581
|
+
earlyFinishDate: X(I()),
|
|
4582
|
+
lateStartDate: X(I()),
|
|
4583
|
+
lateFinishDate: X(I()),
|
|
4584
|
+
levelingDelayHours: X(L()).describe("With levelling: hours spent waiting for the assignee"),
|
|
4585
|
+
waitingOn: X(I()).describe("With levelling: the task this one waited for"),
|
|
4586
|
+
isMilestone: X(R()).describe("True for a milestone"),
|
|
4587
|
+
deadlineDate: X(I()).describe("The task's deadline as an instant"),
|
|
4588
|
+
deadlineVarianceHours: X(L()).describe("Working hours from forecast finish to deadline; negative means it will be missed")
|
|
4589
|
+
}), Mn = Y({
|
|
4590
|
+
projectId: I(),
|
|
4591
|
+
projectStartDate: X(I()),
|
|
4592
|
+
projectEndDate: X(I()).describe("Forecast finish date"),
|
|
4593
|
+
totalDurationHours: L(),
|
|
4594
|
+
criticalTaskIds: z(I()).describe("Tasks with zero or negative slack, in schedule order"),
|
|
4595
|
+
missedDeadlineTaskIds: X(z(I())).describe("Tasks forecast to finish after their deadline"),
|
|
4596
|
+
tasks: z(jn),
|
|
4597
|
+
leveled: X(R()),
|
|
4598
|
+
unleveledProjectEndDate: X(I()).describe("With levelling: the end date before levelling"),
|
|
4599
|
+
overallocations: X(z(An)).describe("Assignee mode: periods where someone is booked above capacity")
|
|
4600
|
+
}), Nn = Y({
|
|
4601
|
+
projects: z(Mn).describe("One analysis per project"),
|
|
4602
|
+
projectEndDate: X(I()).describe("The latest project end"),
|
|
4603
|
+
leveled: X(R()),
|
|
4604
|
+
overallocations: z(An)
|
|
4605
|
+
}), Pn = Y({
|
|
4606
|
+
id: I(),
|
|
4607
|
+
type: I().describe("container, iteration, deliverable or phase"),
|
|
4608
|
+
name: I(),
|
|
4609
|
+
health: I().describe("on_track, at_risk, blocked, overdue or completed"),
|
|
4610
|
+
progressPercentage: L().describe("0-100"),
|
|
4611
|
+
isCritical: R(),
|
|
4612
|
+
blockedTasks: L(),
|
|
4613
|
+
taskIds: z(I())
|
|
4614
|
+
}), Fn = Y({
|
|
4615
|
+
projectId: I(),
|
|
4616
|
+
level: I(),
|
|
4617
|
+
macro: X(Y({
|
|
4618
|
+
health: I().describe("on_track, at_risk, blocked, overdue or completed"),
|
|
4619
|
+
overallProgressPercentage: L().describe("0-100"),
|
|
4620
|
+
projectedFinishDate: X(I()),
|
|
4621
|
+
totalTasks: L(),
|
|
4622
|
+
completedTasks: L(),
|
|
4623
|
+
blockedTasks: L(),
|
|
4624
|
+
phases: z(Pn)
|
|
4625
|
+
})).describe("Phase-level summary"),
|
|
4626
|
+
standard: X(Z).describe("Task timeline: { tasks, criticalPathTaskIds, dependencies, totalDurationHours }"),
|
|
4627
|
+
concrete: X(V(Z)).describe("Work evidence (time entries, attachments) by task id")
|
|
4628
|
+
}), In = Y({
|
|
4629
|
+
taskId: I(),
|
|
4630
|
+
macroPhase: X(Pn).describe("The phase this task belongs to"),
|
|
4631
|
+
standard: Z.describe("The task with cpm (isCritical, slackWorkingHours, dates), blockingTaskIds and dependentTaskIds"),
|
|
4632
|
+
concrete: Z.describe("Evidence of work on the task"),
|
|
4633
|
+
metrics: X(Z).describe("Same as get_task_metrics")
|
|
4634
|
+
}), Ln = Y({
|
|
4635
|
+
taskId: I(),
|
|
4636
|
+
points: z(Y({
|
|
4637
|
+
timestamp: I(),
|
|
4638
|
+
progress: L().describe("0-100"),
|
|
4639
|
+
status: I()
|
|
4640
|
+
})),
|
|
4641
|
+
curveProfile: I().describe("linear, s_curve, early_surge, late_rush, stalled or insufficient_data")
|
|
4642
|
+
}), Rn = Y({
|
|
4643
|
+
taskId: I(),
|
|
4644
|
+
progress: Y({
|
|
4645
|
+
progressPercentage: L().describe("0-100"),
|
|
4646
|
+
source: I().describe("Where the figure comes from: explicit, todos, time_effort, schedule_elapsed or blended")
|
|
4647
|
+
}),
|
|
4648
|
+
realityDelta: Y({
|
|
4649
|
+
estimatedHours: L(),
|
|
4650
|
+
loggedHours: L(),
|
|
4651
|
+
varianceHours: L().describe("logged minus estimated"),
|
|
4652
|
+
isOverdue: R(),
|
|
4653
|
+
isOverEstimate: R(),
|
|
4654
|
+
scheduleVarianceWorkingDays: X(L()).describe("Working days late (positive) or early (negative)")
|
|
4655
|
+
}),
|
|
4656
|
+
evm: Y({
|
|
4657
|
+
plannedValue: L(),
|
|
4658
|
+
earnedValue: L(),
|
|
4659
|
+
actualCost: L(),
|
|
4660
|
+
costPerformanceIndex: L().describe("CPI = EV / AC; below 1 is over budget"),
|
|
4661
|
+
schedulePerformanceIndex: L().describe("SPI = EV / PV; below 1 is behind schedule")
|
|
4662
|
+
}),
|
|
4663
|
+
inferredActuals: Z.describe("Actual start/end dates and active working time"),
|
|
4664
|
+
progressHistory: Ln
|
|
4665
|
+
}), zn = Y({
|
|
4666
|
+
startDate: I(),
|
|
4667
|
+
endDate: I(),
|
|
4668
|
+
interval: I(),
|
|
4669
|
+
groupBy: I(),
|
|
4670
|
+
metric: I(),
|
|
4671
|
+
seriesKeys: z(I()).describe("Ids of the people, teams, etc. in the series"),
|
|
4672
|
+
seriesLabels: V(I()).describe("Display name for each series key"),
|
|
4673
|
+
buckets: z(Y({
|
|
4674
|
+
date: I().describe("Start of the bucket (YYYY-MM-DD)"),
|
|
4675
|
+
totalHours: L(),
|
|
4676
|
+
values: V(L()).describe("Hours per series key"),
|
|
4677
|
+
capacity: X(V(L())).describe("Capacity hours per series key"),
|
|
4678
|
+
utilizationRatio: X(L()).describe("totalHours / totalCapacity; above 1 is overloaded")
|
|
4679
|
+
})),
|
|
4680
|
+
totalHours: L(),
|
|
4681
|
+
totalCapacity: X(L()),
|
|
4682
|
+
averageUtilization: X(L())
|
|
4683
|
+
}), Bn = Y({
|
|
4684
|
+
skills: X(z(Y({
|
|
4685
|
+
name: I(),
|
|
4686
|
+
description: I()
|
|
4687
|
+
}))).describe("Present when no name was given"),
|
|
4688
|
+
name: X(I()),
|
|
4689
|
+
description: X(I()),
|
|
4690
|
+
content: X(I()).describe("The playbook (markdown); follow its steps")
|
|
4691
|
+
}), Q = [
|
|
4692
|
+
{
|
|
4693
|
+
name: "analyze-schedule",
|
|
4694
|
+
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.",
|
|
4695
|
+
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 or negative slack. Any delay to one of them moves the end date or misses a deadline.\n- `missedDeadlineTaskIds` lists tasks forecast to finish after their `deadline`. Their `deadlineVarianceHours` says by how much (negative working hours), and the negative `totalSlack` on the tasks before them shows which work drives the miss. Entries with `isMilestone: true` are checkpoints such as releases or sign-offs.\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. If the user gives a date that is not yet on a task, offer to record it as a `deadline` (on a milestone task with `isMilestone: true` if it is a checkpoint) so later runs track it.\n- Each milestone: forecast date against its deadline.\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"
|
|
4696
|
+
},
|
|
4697
|
+
{
|
|
4698
|
+
name: "investigate-task",
|
|
4699
|
+
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.",
|
|
4700
|
+
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"
|
|
4701
|
+
},
|
|
4702
|
+
{
|
|
4703
|
+
name: "plan-capacity",
|
|
4704
|
+
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.",
|
|
4705
|
+
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"
|
|
4706
|
+
},
|
|
4707
|
+
{
|
|
4708
|
+
name: "plan-project",
|
|
4709
|
+
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.",
|
|
4710
|
+
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- **Milestones** for dated checkpoints (a release, a sign-off, a review): a task with `isMilestone: true`, a `deadline` if the date is fixed, and dependencies on the tasks that must finish first. The schedule then reports whether each date will be met.\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, or `missedDeadlineTaskIds` is not empty, 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"
|
|
4711
|
+
},
|
|
4712
|
+
{
|
|
4713
|
+
name: "report-status",
|
|
4714
|
+
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.",
|
|
4715
|
+
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"
|
|
4716
|
+
},
|
|
4717
|
+
{
|
|
4718
|
+
name: "triage-tasks",
|
|
4719
|
+
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.",
|
|
4720
|
+
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"
|
|
4721
|
+
}
|
|
4722
|
+
];
|
|
4723
|
+
function Vn(e) {
|
|
4724
|
+
return Q.find((t) => t.name === e);
|
|
4725
|
+
}
|
|
4539
4726
|
//#endregion
|
|
4540
4727
|
//#region ../mcp/dist/tools/definitions.js
|
|
4728
|
+
var Hn = {
|
|
4729
|
+
core: "Projects, tasks and task dependencies: find, read, create, update and delete",
|
|
4730
|
+
collaboration: "Deliverables and task comments",
|
|
4731
|
+
scheduling: "Critical path, portfolio scheduling and workload/capacity",
|
|
4732
|
+
analytics: "Project status ladder, task metrics, earned value and progress history",
|
|
4733
|
+
guidance: "Skills: step-by-step playbooks for multi-step jobs"
|
|
4734
|
+
};
|
|
4735
|
+
function Un(e) {
|
|
4736
|
+
let { $schema: t, ...n } = Sn(e, { $refStrategy: "none" });
|
|
4737
|
+
return n;
|
|
4738
|
+
}
|
|
4541
4739
|
function $(e) {
|
|
4542
|
-
let
|
|
4740
|
+
let t = e.annotations?.readOnlyHint ?? !1;
|
|
4543
4741
|
return {
|
|
4544
4742
|
...e,
|
|
4545
|
-
inputSchema:
|
|
4743
|
+
inputSchema: Un(e.zodSchema),
|
|
4744
|
+
outputSchema: Un(e.outputZodSchema),
|
|
4745
|
+
annotations: {
|
|
4746
|
+
readOnlyHint: t,
|
|
4747
|
+
destructiveHint: e.annotations?.destructiveHint ?? !1,
|
|
4748
|
+
idempotentHint: e.annotations?.idempotentHint ?? t,
|
|
4749
|
+
openWorldHint: e.annotations?.openWorldHint ?? !1
|
|
4750
|
+
}
|
|
4546
4751
|
};
|
|
4547
4752
|
}
|
|
4548
|
-
var
|
|
4753
|
+
var Wn = class extends Error {
|
|
4549
4754
|
constructor(e, t) {
|
|
4550
4755
|
super(`Invalid arguments for tool "${e}": ${t}`), this.name = "ToolArgumentError";
|
|
4551
4756
|
}
|
|
4552
4757
|
};
|
|
4553
|
-
function
|
|
4758
|
+
function Gn(e, t) {
|
|
4554
4759
|
let n = e.zodSchema.strict().safeParse(t ?? {});
|
|
4555
4760
|
if (!n.success) {
|
|
4556
4761
|
let t = n.error.issues.map((e) => `${e.path.join(".") || "(root)"}: ${e.message}`).join("; ");
|
|
4557
|
-
throw new
|
|
4762
|
+
throw new Wn(e.name, t);
|
|
4558
4763
|
}
|
|
4559
4764
|
return n.data;
|
|
4560
4765
|
}
|
|
4561
|
-
|
|
4766
|
+
async function Kn(e) {
|
|
4767
|
+
return { isEngine: "store" in e && typeof e.store == "object" };
|
|
4768
|
+
}
|
|
4769
|
+
var qn = $({
|
|
4562
4770
|
name: "list_projects",
|
|
4563
4771
|
title: "List Projects",
|
|
4564
|
-
description: "
|
|
4565
|
-
|
|
4772
|
+
description: "List every project you can read, with its id, name and key. Start here to find a projectId; never guess ids. Returns { projects }.",
|
|
4773
|
+
toolset: "core",
|
|
4774
|
+
outputZodSchema: B({ projects: z(Cn) }),
|
|
4775
|
+
zodSchema: B({}),
|
|
4566
4776
|
annotations: { readOnlyHint: !0 },
|
|
4567
|
-
execute: async (e, t) => t.getProjects()
|
|
4568
|
-
}),
|
|
4777
|
+
execute: async (e, t) => ({ projects: await t.getProjects() })
|
|
4778
|
+
}), Jn = $({
|
|
4569
4779
|
name: "get_project",
|
|
4570
4780
|
title: "Get Project",
|
|
4571
|
-
description: "Get
|
|
4572
|
-
|
|
4781
|
+
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`.",
|
|
4782
|
+
toolset: "core",
|
|
4783
|
+
outputZodSchema: Cn,
|
|
4784
|
+
zodSchema: B({ id: I().describe("The project ID") }),
|
|
4573
4785
|
annotations: { readOnlyHint: !0 },
|
|
4574
4786
|
execute: async (e, t) => t.getProject(e.id)
|
|
4575
|
-
}),
|
|
4787
|
+
}), Yn = $({
|
|
4576
4788
|
name: "create_project",
|
|
4577
4789
|
title: "Create Project",
|
|
4578
|
-
description: "Create a new project
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4790
|
+
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.",
|
|
4791
|
+
toolset: "core",
|
|
4792
|
+
outputZodSchema: Cn,
|
|
4793
|
+
zodSchema: B({
|
|
4794
|
+
name: I().describe("Name of the project"),
|
|
4795
|
+
description: I().optional().describe("Description of the project"),
|
|
4796
|
+
key: I().optional().describe("Short project key/prefix (e.g. \"PROJ\")"),
|
|
4797
|
+
customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
4584
4798
|
}),
|
|
4585
4799
|
execute: async (e, t) => t.createProject(e)
|
|
4586
|
-
}),
|
|
4800
|
+
}), Xn = $({
|
|
4587
4801
|
name: "list_tasks",
|
|
4588
4802
|
title: "List Tasks",
|
|
4589
|
-
description: "
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4803
|
+
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`.",
|
|
4804
|
+
toolset: "core",
|
|
4805
|
+
outputZodSchema: B({
|
|
4806
|
+
tasks: z(wn),
|
|
4807
|
+
nextCursor: I().nullable().optional()
|
|
4808
|
+
}),
|
|
4809
|
+
zodSchema: B({
|
|
4810
|
+
projectId: I().optional().describe("Filter by project ID"),
|
|
4811
|
+
status: I().optional().describe("Filter by task status key"),
|
|
4812
|
+
priority: H([
|
|
4594
4813
|
"urgent",
|
|
4595
4814
|
"high",
|
|
4596
4815
|
"medium",
|
|
4597
4816
|
"low",
|
|
4598
4817
|
"none"
|
|
4599
4818
|
]).optional().describe("Filter by priority"),
|
|
4600
|
-
assigneeId:
|
|
4601
|
-
iterationId:
|
|
4602
|
-
deliverableId:
|
|
4603
|
-
containerId:
|
|
4604
|
-
parentId:
|
|
4605
|
-
limit:
|
|
4606
|
-
cursor:
|
|
4819
|
+
assigneeId: I().optional().describe("Filter by assignee ID"),
|
|
4820
|
+
iterationId: I().optional().describe("Filter by iteration (sprint) ID"),
|
|
4821
|
+
deliverableId: I().optional().describe("Filter by deliverable ID"),
|
|
4822
|
+
containerId: I().optional().describe("Filter by container (e.g. epic) ID"),
|
|
4823
|
+
parentId: I().optional().describe("Subtasks of this task ID, or 'none' for top-level tasks only"),
|
|
4824
|
+
limit: L().int().min(1).max(500).optional().describe("Page size (default 100)"),
|
|
4825
|
+
cursor: I().optional().describe("nextCursor from a previous call")
|
|
4607
4826
|
}),
|
|
4608
4827
|
annotations: { readOnlyHint: !0 },
|
|
4609
4828
|
execute: async (e, t, n) => {
|
|
@@ -4624,41 +4843,88 @@ var xn = $({
|
|
|
4624
4843
|
nextCursor: r.nextCursor
|
|
4625
4844
|
};
|
|
4626
4845
|
}
|
|
4627
|
-
}),
|
|
4846
|
+
}), Zn = $({
|
|
4628
4847
|
name: "get_task",
|
|
4629
4848
|
title: "Get Task",
|
|
4630
|
-
description: "Get task
|
|
4631
|
-
|
|
4849
|
+
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`.",
|
|
4850
|
+
toolset: "core",
|
|
4851
|
+
outputZodSchema: En,
|
|
4852
|
+
zodSchema: B({
|
|
4853
|
+
id: I().describe("The task ID"),
|
|
4854
|
+
includeDependencies: R().optional().describe("Also return the tasks this one waits for (dependsOn) and the tasks waiting for it (dependents)")
|
|
4855
|
+
}),
|
|
4632
4856
|
annotations: { readOnlyHint: !0 },
|
|
4633
|
-
execute: async (e, t) =>
|
|
4634
|
-
|
|
4857
|
+
execute: async (e, t) => {
|
|
4858
|
+
let n = await t.getTask(e.id);
|
|
4859
|
+
if (!n || !e.includeDependencies) return n;
|
|
4860
|
+
let r = await er(t, e.id), i = new Map([...r.upstreamTasks, ...r.downstreamTasks].map((e) => [e.id, e])), a = [], o = [];
|
|
4861
|
+
for (let t of r.dependencies) {
|
|
4862
|
+
let { waiting: n, waitedFor: r } = Qn(t), s = n === e.id ? r : n, c = i.get(s);
|
|
4863
|
+
if (!c || s === e.id) continue;
|
|
4864
|
+
let ee = {
|
|
4865
|
+
dependencyId: t.id,
|
|
4866
|
+
taskId: c.id,
|
|
4867
|
+
title: c.title,
|
|
4868
|
+
status: c.status,
|
|
4869
|
+
type: $n(t)
|
|
4870
|
+
};
|
|
4871
|
+
(n === e.id ? a : o).push(ee);
|
|
4872
|
+
}
|
|
4873
|
+
return {
|
|
4874
|
+
...n,
|
|
4875
|
+
dependencies: {
|
|
4876
|
+
dependsOn: a,
|
|
4877
|
+
dependents: o
|
|
4878
|
+
}
|
|
4879
|
+
};
|
|
4880
|
+
}
|
|
4881
|
+
});
|
|
4882
|
+
function Qn(e) {
|
|
4883
|
+
return e.type === "blocked_by" ? {
|
|
4884
|
+
waiting: e.dependsOnTaskId,
|
|
4885
|
+
waitedFor: e.taskId
|
|
4886
|
+
} : {
|
|
4887
|
+
waiting: e.taskId,
|
|
4888
|
+
waitedFor: e.dependsOnTaskId
|
|
4889
|
+
};
|
|
4890
|
+
}
|
|
4891
|
+
var $n = (e) => e.type === "relates_to" ? "relates_to" : "blocking";
|
|
4892
|
+
async function er(e, t) {
|
|
4893
|
+
let { isEngine: n } = await Kn(e);
|
|
4894
|
+
return n ? e.getTaskDependencyGraph(t) : e.getTaskDependencies(t);
|
|
4895
|
+
}
|
|
4896
|
+
var tr = $({
|
|
4635
4897
|
name: "create_task",
|
|
4636
4898
|
title: "Create Task",
|
|
4637
|
-
description: "Create a
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4899
|
+
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.",
|
|
4900
|
+
toolset: "core",
|
|
4901
|
+
outputZodSchema: wn,
|
|
4902
|
+
zodSchema: B({
|
|
4903
|
+
projectId: I().optional().describe("Project ID (inferred from active view in browser if omitted)"),
|
|
4904
|
+
title: I().describe("Title of the task"),
|
|
4905
|
+
description: I().optional().describe("Detailed description / markdown"),
|
|
4906
|
+
status: I().optional().describe("Status key (defaults to the project workflow's default status)"),
|
|
4907
|
+
priority: H([
|
|
4644
4908
|
"urgent",
|
|
4645
4909
|
"high",
|
|
4646
4910
|
"medium",
|
|
4647
4911
|
"low",
|
|
4648
4912
|
"none"
|
|
4649
4913
|
]).optional().default("none").describe("Task priority"),
|
|
4650
|
-
assigneeId:
|
|
4651
|
-
dueDate:
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4914
|
+
assigneeId: I().optional().describe("User ID to assign task to"),
|
|
4915
|
+
dueDate: I().optional().describe("Due date (ISO string)"),
|
|
4916
|
+
deadline: I().optional().describe("Latest acceptable finish (YYYY-MM-DD for the end of that working day, or an ISO date-time). Critical path analysis reports a miss as negative slack"),
|
|
4917
|
+
isMilestone: R().optional().describe("Mark the task as a milestone: a zero-duration checkpoint (release, sign-off) fed by dependencies; its estimate is ignored"),
|
|
4918
|
+
tags: z(I()).optional().describe("Tags for categorization"),
|
|
4919
|
+
estimatedHours: L().optional().describe("Estimated hours to complete"),
|
|
4920
|
+
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"),
|
|
4921
|
+
isBlocked: R().optional().describe("Whether the task is blocked"),
|
|
4922
|
+
blockedReason: I().optional().describe("Reason why the task is blocked"),
|
|
4923
|
+
customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
4658
4924
|
}),
|
|
4659
4925
|
execute: async (e, t, n) => {
|
|
4660
4926
|
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.");
|
|
4927
|
+
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
4928
|
let i = {
|
|
4663
4929
|
projectId: r,
|
|
4664
4930
|
title: e.title,
|
|
@@ -4667,6 +4933,8 @@ var xn = $({
|
|
|
4667
4933
|
priority: e.priority || "none",
|
|
4668
4934
|
assigneeId: e.assigneeId,
|
|
4669
4935
|
dueDate: e.dueDate,
|
|
4936
|
+
deadline: e.deadline,
|
|
4937
|
+
isMilestone: e.isMilestone,
|
|
4670
4938
|
tags: e.tags || [],
|
|
4671
4939
|
estimatedHours: e.estimatedHours,
|
|
4672
4940
|
customFields: e.customFields,
|
|
@@ -4676,149 +4944,222 @@ var xn = $({
|
|
|
4676
4944
|
};
|
|
4677
4945
|
return t.createTask(i);
|
|
4678
4946
|
}
|
|
4679
|
-
}),
|
|
4947
|
+
}), nr = $({
|
|
4680
4948
|
name: "update_task",
|
|
4681
4949
|
title: "Update Task",
|
|
4682
|
-
description: "
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4950
|
+
description: "Change an existing task: title, description, status, priority, assignee, due date, deadline, milestone flag, 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.",
|
|
4951
|
+
toolset: "core",
|
|
4952
|
+
outputZodSchema: wn,
|
|
4953
|
+
zodSchema: B({
|
|
4954
|
+
id: I().describe("The task ID"),
|
|
4955
|
+
title: I().optional().describe("New title"),
|
|
4956
|
+
description: I().optional().describe("New description (markdown)"),
|
|
4957
|
+
status: I().optional().describe("Status key from the project's workflow (see `get_project`)"),
|
|
4958
|
+
priority: H([
|
|
4689
4959
|
"urgent",
|
|
4690
4960
|
"high",
|
|
4691
4961
|
"medium",
|
|
4692
4962
|
"low",
|
|
4693
4963
|
"none"
|
|
4694
|
-
]).optional(),
|
|
4695
|
-
assigneeId:
|
|
4696
|
-
dueDate:
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4964
|
+
]).optional().describe("New priority"),
|
|
4965
|
+
assigneeId: I().optional().describe("User ID to assign the task to"),
|
|
4966
|
+
dueDate: I().optional().describe("Due date (ISO string)"),
|
|
4967
|
+
deadline: I().optional().describe("Latest acceptable finish (YYYY-MM-DD for the end of that working day, or an ISO date-time). Critical path analysis reports a miss as negative slack"),
|
|
4968
|
+
isMilestone: R().optional().describe("Mark the task as a milestone: a zero-duration checkpoint (release, sign-off) fed by dependencies; its estimate is ignored"),
|
|
4969
|
+
tags: z(I()).optional().describe("Replaces all tags"),
|
|
4970
|
+
estimatedHours: L().optional().describe("Estimated effort in hours"),
|
|
4971
|
+
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"),
|
|
4972
|
+
loggedHours: L().optional().describe("Total hours worked so far"),
|
|
4973
|
+
isBlocked: R().optional().describe("Whether the task is blocked"),
|
|
4974
|
+
blockedReason: I().optional().describe("Reason why the task is blocked"),
|
|
4975
|
+
customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
4704
4976
|
}),
|
|
4977
|
+
annotations: { idempotentHint: !0 },
|
|
4705
4978
|
execute: async (e, t) => {
|
|
4706
4979
|
let { id: n, ...r } = e;
|
|
4707
4980
|
return t.updateTask(n, r);
|
|
4708
4981
|
}
|
|
4709
|
-
}),
|
|
4982
|
+
}), rr = $({
|
|
4710
4983
|
name: "delete_task",
|
|
4711
4984
|
title: "Delete Task",
|
|
4712
|
-
description: "
|
|
4713
|
-
|
|
4714
|
-
|
|
4985
|
+
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 }.",
|
|
4986
|
+
toolset: "core",
|
|
4987
|
+
outputZodSchema: B({ success: R() }),
|
|
4988
|
+
zodSchema: B({ id: I().describe("The task ID to delete") }),
|
|
4989
|
+
annotations: {
|
|
4990
|
+
destructiveHint: !0,
|
|
4991
|
+
idempotentHint: !0
|
|
4992
|
+
},
|
|
4715
4993
|
execute: async (e, t) => ({ success: await t.deleteTask(e.id) })
|
|
4716
|
-
}),
|
|
4994
|
+
}), ir = $({
|
|
4995
|
+
name: "add_dependency",
|
|
4996
|
+
title: "Add Dependency",
|
|
4997
|
+
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`.",
|
|
4998
|
+
toolset: "core",
|
|
4999
|
+
outputZodSchema: Dn,
|
|
5000
|
+
zodSchema: B({
|
|
5001
|
+
taskId: I().describe("The task that waits"),
|
|
5002
|
+
dependsOnTaskId: I().describe("The task that must finish first"),
|
|
5003
|
+
type: H(["blocking", "relates_to"]).optional().describe("'blocking' (default) affects the schedule; 'relates_to' only links the tasks for reference")
|
|
5004
|
+
}),
|
|
5005
|
+
annotations: { idempotentHint: !0 },
|
|
5006
|
+
execute: async (e, t) => {
|
|
5007
|
+
let n = e.type ?? "blocking", { isEngine: r } = await Kn(t);
|
|
5008
|
+
return r ? t.addDependency({
|
|
5009
|
+
taskId: e.taskId,
|
|
5010
|
+
dependsOnTaskId: e.dependsOnTaskId,
|
|
5011
|
+
type: n
|
|
5012
|
+
}) : t.addDependency(e.taskId, {
|
|
5013
|
+
dependsOnTaskId: e.dependsOnTaskId,
|
|
5014
|
+
type: n
|
|
5015
|
+
});
|
|
5016
|
+
}
|
|
5017
|
+
}), ar = $({
|
|
5018
|
+
name: "remove_dependency",
|
|
5019
|
+
title: "Remove Dependency",
|
|
5020
|
+
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.",
|
|
5021
|
+
toolset: "core",
|
|
5022
|
+
outputZodSchema: B({
|
|
5023
|
+
removed: L().describe("How many dependency records were removed (0 if none matched)"),
|
|
5024
|
+
dependencyIds: z(I()).describe("Ids of the removed records")
|
|
5025
|
+
}),
|
|
5026
|
+
zodSchema: B({
|
|
5027
|
+
taskId: I().describe("The task that waits"),
|
|
5028
|
+
dependsOnTaskId: I().describe("The task it waits for"),
|
|
5029
|
+
type: H(["blocking", "relates_to"]).optional().describe("Remove only links of this type (default: both)")
|
|
5030
|
+
}),
|
|
5031
|
+
annotations: { idempotentHint: !0 },
|
|
5032
|
+
execute: async (e, t) => {
|
|
5033
|
+
let n = (await er(t, e.taskId)).dependencies.filter((t) => {
|
|
5034
|
+
let { waiting: n, waitedFor: r } = Qn(t);
|
|
5035
|
+
return n === e.taskId && r === e.dependsOnTaskId && (!e.type || $n(t) === e.type);
|
|
5036
|
+
}), { isEngine: r } = await Kn(t), i = [];
|
|
5037
|
+
for (let e of n) (r ? await t.removeDependency(e.id) : await t.removeDependency(e.taskId, e.id)) && i.push(e.id);
|
|
5038
|
+
return {
|
|
5039
|
+
removed: i.length,
|
|
5040
|
+
dependencyIds: i
|
|
5041
|
+
};
|
|
5042
|
+
}
|
|
5043
|
+
}), or = $({
|
|
4717
5044
|
name: "list_deliverables",
|
|
4718
5045
|
title: "List Deliverables",
|
|
4719
|
-
description: "List deliverables
|
|
4720
|
-
|
|
5046
|
+
description: "List a project's deliverables: outputs that group the tasks producing them. Use it to see what is due and which tasks feed each deliverable. For dated checkpoints, look for milestone tasks (`isMilestone`). Returns { deliverables }.",
|
|
5047
|
+
toolset: "collaboration",
|
|
5048
|
+
outputZodSchema: B({ deliverables: z(On) }),
|
|
5049
|
+
zodSchema: B({ projectId: I().optional().describe("Project ID (falls back to ambient context if omitted)") }),
|
|
4721
5050
|
annotations: { readOnlyHint: !0 },
|
|
4722
5051
|
execute: async (e, t, n) => {
|
|
4723
5052
|
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) : [];
|
|
5053
|
+
if (!r) throw Error("projectId is required to list deliverables. Find one with `list_projects`.");
|
|
5054
|
+
return "getDeliverables" in t && typeof t.getDeliverables == "function" ? { deliverables: await t.getDeliverables(r) } : { deliverables: [] };
|
|
4726
5055
|
}
|
|
4727
|
-
}),
|
|
5056
|
+
}), sr = $({
|
|
4728
5057
|
name: "create_deliverable",
|
|
4729
5058
|
title: "Create Deliverable",
|
|
4730
|
-
description: "Create a
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
5059
|
+
description: "Create a deliverable in a project, optionally linking existing tasks by id. Use it for an output (a document, a build, an asset) that several tasks produce. For a dated checkpoint the schedule should enforce, create a task with `isMilestone: true` and a `deadline` instead. Returns the created deliverable.",
|
|
5060
|
+
toolset: "collaboration",
|
|
5061
|
+
outputZodSchema: On,
|
|
5062
|
+
zodSchema: B({
|
|
5063
|
+
projectId: I().optional().describe("Project ID (falls back to ambient context if omitted)"),
|
|
5064
|
+
title: I().describe("Name of the deliverable"),
|
|
5065
|
+
description: I().optional().describe("What the deliverable is and how it is accepted"),
|
|
5066
|
+
dueDate: I().optional().describe("Due date (ISO string)"),
|
|
5067
|
+
taskIds: z(I()).optional().describe("IDs of existing tasks that feed this deliverable"),
|
|
5068
|
+
customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
4738
5069
|
}),
|
|
4739
5070
|
execute: async (e, t, n) => {
|
|
4740
5071
|
let r = e.projectId || n?.projectId;
|
|
4741
|
-
if (!r) throw Error("projectId is required to create a deliverable.");
|
|
5072
|
+
if (!r) throw Error("projectId is required to create a deliverable. Find one with `list_projects`.");
|
|
4742
5073
|
if ("createDeliverable" in t && typeof t.createDeliverable == "function") return t.createDeliverable({
|
|
4743
5074
|
...e,
|
|
4744
5075
|
projectId: r
|
|
4745
5076
|
});
|
|
4746
5077
|
throw Error("createDeliverable is not supported by this backend target.");
|
|
4747
5078
|
}
|
|
4748
|
-
}),
|
|
5079
|
+
}), cr = $({
|
|
4749
5080
|
name: "list_comments",
|
|
4750
5081
|
title: "List Comments",
|
|
4751
|
-
description: "List comments
|
|
4752
|
-
|
|
5082
|
+
description: "List the comments on a task. Use it to read the discussion, decisions or blockers recorded there. Returns { comments }.",
|
|
5083
|
+
toolset: "collaboration",
|
|
5084
|
+
outputZodSchema: B({ comments: z(kn) }),
|
|
5085
|
+
zodSchema: B({ taskId: I().describe("The task ID") }),
|
|
4753
5086
|
annotations: { readOnlyHint: !0 },
|
|
4754
|
-
execute: async (e, t) => "getComments" in t && typeof t.getComments == "function" ? t.getComments(e.taskId) : []
|
|
4755
|
-
}),
|
|
5087
|
+
execute: async (e, t) => "getComments" in t && typeof t.getComments == "function" ? { comments: await t.getComments(e.taskId) } : { comments: [] }
|
|
5088
|
+
}), lr = $({
|
|
4756
5089
|
name: "add_comment",
|
|
4757
5090
|
title: "Add Comment",
|
|
4758
|
-
description: "
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
5091
|
+
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.",
|
|
5092
|
+
toolset: "collaboration",
|
|
5093
|
+
outputZodSchema: kn,
|
|
5094
|
+
zodSchema: B({
|
|
5095
|
+
taskId: I().describe("The task ID"),
|
|
5096
|
+
content: I().describe("Comment body/markdown"),
|
|
5097
|
+
customFields: V(Tt()).optional().describe("Custom field values as a JSON object (validated against the project's field definitions for tasks)")
|
|
4763
5098
|
}),
|
|
4764
5099
|
execute: async (e, t) => t.addComment({
|
|
4765
5100
|
taskId: e.taskId,
|
|
4766
5101
|
content: e.content,
|
|
4767
5102
|
customFields: e.customFields
|
|
4768
5103
|
})
|
|
4769
|
-
}),
|
|
5104
|
+
}), ur = $({
|
|
4770
5105
|
name: "calculate_portfolio_critical_path",
|
|
4771
5106
|
title: "Calculate Portfolio Critical Path",
|
|
4772
|
-
description: "
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
5107
|
+
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`.",
|
|
5108
|
+
toolset: "scheduling",
|
|
5109
|
+
outputZodSchema: Nn,
|
|
5110
|
+
zodSchema: B({
|
|
5111
|
+
projectIds: z(I()).optional().describe("Projects to include (default: every project you can read)"),
|
|
5112
|
+
projectOrder: z(I()).optional().describe("Project ids in priority order for levelling; unlisted projects come last"),
|
|
5113
|
+
includeHiddenWork: R().optional().describe("Also count other projects' work (even unreadable ones, shown only as 'hidden') toward people's capacity. Requires workspace.manage"),
|
|
5114
|
+
calendars: H(["project", "assignee"]).optional().describe("'assignee' schedules each task on its assignee's or team's calendar"),
|
|
5115
|
+
levelResources: R().optional().describe("With calendars 'assignee': share people and team pools across the projects"),
|
|
5116
|
+
levelingPriority: H([
|
|
4780
5117
|
"slack",
|
|
4781
5118
|
"priority",
|
|
4782
5119
|
"dueDate",
|
|
4783
5120
|
"order"
|
|
4784
5121
|
]).optional().describe("Which ready task gets an assignee first when levelling (default: least slack, then task priority)"),
|
|
4785
|
-
effort:
|
|
5122
|
+
effort: H(["estimate", "remaining"]).optional().describe("'remaining' schedules only estimate minus logged hours for in-progress tasks (default: full estimates)")
|
|
4786
5123
|
}),
|
|
4787
5124
|
annotations: { readOnlyHint: !0 },
|
|
4788
5125
|
execute: async (e, t) => t.calculatePortfolioCriticalPath(e)
|
|
4789
|
-
}),
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
5126
|
+
}), dr = [
|
|
5127
|
+
qn,
|
|
5128
|
+
Jn,
|
|
5129
|
+
Yn,
|
|
5130
|
+
Xn,
|
|
5131
|
+
Zn,
|
|
5132
|
+
tr,
|
|
5133
|
+
nr,
|
|
5134
|
+
rr,
|
|
5135
|
+
ir,
|
|
5136
|
+
ar,
|
|
5137
|
+
or,
|
|
5138
|
+
sr,
|
|
5139
|
+
cr,
|
|
5140
|
+
lr,
|
|
4802
5141
|
$({
|
|
4803
5142
|
name: "calculate_critical_path",
|
|
4804
5143
|
title: "Calculate Critical Path",
|
|
4805
|
-
description: "
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
5144
|
+
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`.",
|
|
5145
|
+
toolset: "scheduling",
|
|
5146
|
+
outputZodSchema: Mn,
|
|
5147
|
+
zodSchema: B({
|
|
5148
|
+
projectId: I().optional().describe("Project ID (falls back to ambient context if omitted)"),
|
|
5149
|
+
calendars: H(["project", "assignee"]).optional().describe("'assignee' schedules each task on its assignee's or team's working calendar; default uses the project calendar"),
|
|
5150
|
+
levelResources: R().optional().describe("With calendars 'assignee': delay tasks so each assignee works on one task at a time"),
|
|
5151
|
+
levelingPriority: H([
|
|
4811
5152
|
"slack",
|
|
4812
5153
|
"priority",
|
|
4813
5154
|
"dueDate",
|
|
4814
5155
|
"order"
|
|
4815
5156
|
]).optional().describe("Which ready task gets an assignee first when levelling (default: least slack, then task priority)"),
|
|
4816
|
-
effort:
|
|
5157
|
+
effort: H(["estimate", "remaining"]).optional().describe("'remaining' schedules only estimate minus logged hours for in-progress tasks (default: full estimates)")
|
|
4817
5158
|
}),
|
|
4818
5159
|
annotations: { readOnlyHint: !0 },
|
|
4819
5160
|
execute: async (e, t, n) => {
|
|
4820
5161
|
let r = e.projectId || n?.projectId;
|
|
4821
|
-
if (!r) throw Error("projectId is required to calculate critical path.");
|
|
5162
|
+
if (!r) throw Error("projectId is required to calculate the critical path. Find one with `list_projects`.");
|
|
4822
5163
|
let { calendars: i, levelResources: a, levelingPriority: o, effort: s } = e;
|
|
4823
5164
|
return t.calculateCriticalPath(r, {
|
|
4824
5165
|
calendars: i,
|
|
@@ -4828,26 +5169,28 @@ var xn = $({
|
|
|
4828
5169
|
});
|
|
4829
5170
|
}
|
|
4830
5171
|
}),
|
|
4831
|
-
|
|
5172
|
+
ur,
|
|
4832
5173
|
$({
|
|
4833
5174
|
name: "get_timeline_ladder",
|
|
4834
5175
|
title: "Get Timeline Ladder of Abstraction",
|
|
4835
|
-
description: "
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
5176
|
+
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`.",
|
|
5177
|
+
toolset: "analytics",
|
|
5178
|
+
outputZodSchema: Fn,
|
|
5179
|
+
zodSchema: B({
|
|
5180
|
+
projectId: I().optional().describe("Project ID (falls back to ambient context if omitted)"),
|
|
5181
|
+
level: H([
|
|
4839
5182
|
"macro",
|
|
4840
5183
|
"standard",
|
|
4841
5184
|
"concrete",
|
|
4842
5185
|
"all"
|
|
4843
5186
|
]).optional().describe("Abstraction level (macro, standard, concrete, or all)"),
|
|
4844
|
-
containerId:
|
|
4845
|
-
iterationId:
|
|
5187
|
+
containerId: I().optional().describe("Optional container ID filter"),
|
|
5188
|
+
iterationId: I().optional().describe("Optional iteration/sprint ID filter")
|
|
4846
5189
|
}),
|
|
4847
5190
|
annotations: { readOnlyHint: !0 },
|
|
4848
5191
|
execute: async (e, t, n) => {
|
|
4849
5192
|
let r = e.projectId || n?.projectId;
|
|
4850
|
-
if (!r) throw Error("projectId is required to get timeline ladder.");
|
|
5193
|
+
if (!r) throw Error("projectId is required to get the timeline ladder. Find one with `list_projects`.");
|
|
4851
5194
|
return t.getTimelineLadder(r, {
|
|
4852
5195
|
level: e.level,
|
|
4853
5196
|
containerId: e.containerId,
|
|
@@ -4858,54 +5201,62 @@ var xn = $({
|
|
|
4858
5201
|
$({
|
|
4859
5202
|
name: "get_task_ladder",
|
|
4860
5203
|
title: "Get Task Ladder View",
|
|
4861
|
-
description: "
|
|
4862
|
-
|
|
5204
|
+
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`.",
|
|
5205
|
+
toolset: "analytics",
|
|
5206
|
+
outputZodSchema: In,
|
|
5207
|
+
zodSchema: B({ taskId: I().describe("The task ID") }),
|
|
4863
5208
|
annotations: { readOnlyHint: !0 },
|
|
4864
5209
|
execute: async (e, t) => t.getTaskLadder(e.taskId)
|
|
4865
5210
|
}),
|
|
4866
5211
|
$({
|
|
4867
5212
|
name: "get_task_metrics",
|
|
4868
5213
|
title: "Get Task Metrics",
|
|
4869
|
-
description: "
|
|
4870
|
-
|
|
5214
|
+
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 }.",
|
|
5215
|
+
toolset: "analytics",
|
|
5216
|
+
outputZodSchema: Rn,
|
|
5217
|
+
zodSchema: B({ taskId: I().describe("The task ID") }),
|
|
4871
5218
|
annotations: { readOnlyHint: !0 },
|
|
4872
5219
|
execute: async (e, t) => t.getTaskMetrics(e.taskId)
|
|
4873
5220
|
}),
|
|
4874
5221
|
$({
|
|
4875
5222
|
name: "get_task_progress_history",
|
|
4876
5223
|
title: "Get Task Progress History",
|
|
4877
|
-
description: "
|
|
4878
|
-
|
|
5224
|
+
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.",
|
|
5225
|
+
toolset: "analytics",
|
|
5226
|
+
outputZodSchema: Ln,
|
|
5227
|
+
zodSchema: B({ taskId: I().describe("The task ID") }),
|
|
4879
5228
|
annotations: { readOnlyHint: !0 },
|
|
4880
5229
|
execute: async (e, t) => t.getTaskProgressHistory(e.taskId)
|
|
4881
5230
|
}),
|
|
4882
5231
|
$({
|
|
4883
5232
|
name: "get_workload_distribution",
|
|
4884
5233
|
title: "Get Workload Distribution",
|
|
4885
|
-
description: "
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
5234
|
+
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 }.",
|
|
5235
|
+
toolset: "scheduling",
|
|
5236
|
+
outputZodSchema: zn,
|
|
5237
|
+
zodSchema: B({
|
|
5238
|
+
projectId: I().optional().describe("Project ID (optional, defaults to workspace-wide or ambient project)"),
|
|
5239
|
+
startDate: I().optional().describe("Start date ISO (YYYY-MM-DD)"),
|
|
5240
|
+
endDate: I().optional().describe("End date ISO (YYYY-MM-DD)"),
|
|
5241
|
+
interval: H([
|
|
4891
5242
|
"day",
|
|
4892
5243
|
"week",
|
|
4893
5244
|
"month"
|
|
4894
5245
|
]).optional().describe("Bucket interval (day, week, month)"),
|
|
4895
|
-
groupBy:
|
|
5246
|
+
groupBy: H([
|
|
4896
5247
|
"assignee",
|
|
4897
5248
|
"team",
|
|
4898
5249
|
"taskType",
|
|
4899
5250
|
"priority",
|
|
4900
5251
|
"status"
|
|
4901
5252
|
]).optional().describe("Dimension to segment by"),
|
|
4902
|
-
metric:
|
|
5253
|
+
metric: H([
|
|
4903
5254
|
"scheduled",
|
|
4904
5255
|
"logged",
|
|
4905
5256
|
"remaining",
|
|
4906
5257
|
"blended"
|
|
4907
5258
|
]).optional().describe("Effort metric mode"),
|
|
4908
|
-
defaultWeeklyCapacityHours:
|
|
5259
|
+
defaultWeeklyCapacityHours: L().optional().describe("Default weekly capacity hours per person (default 40)")
|
|
4909
5260
|
}),
|
|
4910
5261
|
annotations: { readOnlyHint: !0 },
|
|
4911
5262
|
execute: async (e, t, n) => {
|
|
@@ -4919,12 +5270,136 @@ var xn = $({
|
|
|
4919
5270
|
defaultWeeklyCapacityHours: e.defaultWeeklyCapacityHours
|
|
4920
5271
|
});
|
|
4921
5272
|
}
|
|
5273
|
+
}),
|
|
5274
|
+
$({
|
|
5275
|
+
name: "get_skill",
|
|
5276
|
+
title: "Get Skill",
|
|
5277
|
+
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.",
|
|
5278
|
+
toolset: "guidance",
|
|
5279
|
+
outputZodSchema: Bn,
|
|
5280
|
+
zodSchema: B({ name: I().optional().describe("Skill name, e.g. \"plan-project\"; omit to list all skills") }),
|
|
5281
|
+
annotations: { readOnlyHint: !0 },
|
|
5282
|
+
execute: async (e) => {
|
|
5283
|
+
if (!e.name) return { skills: Q.map(({ name: e, description: t }) => ({
|
|
5284
|
+
name: e,
|
|
5285
|
+
description: t
|
|
5286
|
+
})) };
|
|
5287
|
+
let t = Vn(e.name);
|
|
5288
|
+
if (!t) throw Error(`Skill "${e.name}" not found. Available skills: ${Q.map((e) => e.name).join(", ")}.`);
|
|
5289
|
+
return t;
|
|
5290
|
+
}
|
|
4922
5291
|
})
|
|
5292
|
+
], fr = new Map(dr.map((e) => [e.name, e]));
|
|
5293
|
+
function pr(e = {}) {
|
|
5294
|
+
let { tools: t, toolsets: n, readOnly: r } = e, i = (t ?? []).filter((e) => !fr.has(e));
|
|
5295
|
+
if (i.length > 0) throw Error(`Unknown Critical Path tool(s): ${i.join(", ")}. Known tools: ${dr.map((e) => e.name).join(", ")}.`);
|
|
5296
|
+
let a = (n ?? []).filter((e) => !(e in Hn));
|
|
5297
|
+
if (a.length > 0) throw Error(`Unknown Critical Path toolset(s): ${a.join(", ")}. Known toolsets: ${Object.keys(Hn).join(", ")}.`);
|
|
5298
|
+
let o = !t && !n;
|
|
5299
|
+
return dr.filter((e) => (o || t?.includes(e.name) || n?.includes(e.toolset)) && (!r || e.annotations.readOnlyHint));
|
|
5300
|
+
}
|
|
5301
|
+
var mr = class extends Error {
|
|
5302
|
+
constructor(e) {
|
|
5303
|
+
super(e), this.name = "ToolNotFoundError";
|
|
5304
|
+
}
|
|
5305
|
+
}, 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.";
|
|
5306
|
+
async function gr(e, t, n, r) {
|
|
5307
|
+
try {
|
|
5308
|
+
let i = await e.execute(Gn(e, t), n, r);
|
|
5309
|
+
if (i == null) throw new mr(`Nothing found for ${JSON.stringify(t ?? {})}.`);
|
|
5310
|
+
return JSON.parse(JSON.stringify(i));
|
|
5311
|
+
} catch (t) {
|
|
5312
|
+
throw Error(_r(e, t));
|
|
5313
|
+
}
|
|
5314
|
+
}
|
|
5315
|
+
function _r(e, t) {
|
|
5316
|
+
let n = t?.message || String(t);
|
|
5317
|
+
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;
|
|
5318
|
+
}
|
|
5319
|
+
//#endregion
|
|
5320
|
+
//#region ../mcp/dist/tools/instructions.js
|
|
5321
|
+
var vr = [
|
|
5322
|
+
{
|
|
5323
|
+
when: "Find a project or task id",
|
|
5324
|
+
tools: ["list_projects", "list_tasks"]
|
|
5325
|
+
},
|
|
5326
|
+
{
|
|
5327
|
+
when: "Read one task, then its discussion",
|
|
5328
|
+
tools: ["get_task", "list_comments"]
|
|
5329
|
+
},
|
|
5330
|
+
{
|
|
5331
|
+
when: "Add or change work",
|
|
5332
|
+
tools: [
|
|
5333
|
+
"create_task",
|
|
5334
|
+
"update_task",
|
|
5335
|
+
"create_deliverable"
|
|
5336
|
+
]
|
|
5337
|
+
},
|
|
5338
|
+
{
|
|
5339
|
+
when: "Order work: task B cannot start until task A finishes",
|
|
5340
|
+
tools: ["add_dependency", "remove_dependency"]
|
|
5341
|
+
},
|
|
5342
|
+
{
|
|
5343
|
+
when: "What a task waits for and what waits for it",
|
|
5344
|
+
tools: ["get_task"]
|
|
5345
|
+
},
|
|
5346
|
+
{
|
|
5347
|
+
when: "Record a decision or note on a task",
|
|
5348
|
+
tools: ["add_comment"]
|
|
5349
|
+
},
|
|
5350
|
+
{
|
|
5351
|
+
when: "\"When will it finish?\" / \"What is critical?\"",
|
|
5352
|
+
tools: ["calculate_critical_path"]
|
|
5353
|
+
},
|
|
5354
|
+
{
|
|
5355
|
+
when: "Dates and conflicts across several projects",
|
|
5356
|
+
tools: ["calculate_portfolio_critical_path"]
|
|
5357
|
+
},
|
|
5358
|
+
{
|
|
5359
|
+
when: "Project status and phase health",
|
|
5360
|
+
tools: ["get_timeline_ladder"]
|
|
5361
|
+
},
|
|
5362
|
+
{
|
|
5363
|
+
when: "\"Is this task on track?\" / why is it late",
|
|
5364
|
+
tools: [
|
|
5365
|
+
"get_task_metrics",
|
|
5366
|
+
"get_task_ladder",
|
|
5367
|
+
"get_task_progress_history"
|
|
5368
|
+
]
|
|
5369
|
+
},
|
|
5370
|
+
{
|
|
5371
|
+
when: "\"Who is overloaded?\" / capacity",
|
|
5372
|
+
tools: ["get_workload_distribution"]
|
|
5373
|
+
}
|
|
4923
5374
|
];
|
|
4924
|
-
|
|
5375
|
+
function yr(e, t = {}) {
|
|
5376
|
+
let n = new Set(e.map((e) => e.name)), r = [
|
|
5377
|
+
"Critical Path is a project management backend. A project holds tasks and deliverables (outputs that group the tasks producing them). Tasks have a workflow status, priority, assignee, effort estimate, logged hours, optional subtasks (parentId) and dependencies, and comments. A task with `isMilestone: true` is a zero-duration checkpoint, and a `deadline` on any task is enforced by critical path analysis.",
|
|
5378
|
+
"",
|
|
5379
|
+
"Working rules:",
|
|
5380
|
+
"- Never guess ids. Get them from list or create results.",
|
|
5381
|
+
"- Results are JSON objects. List results are paged where they return nextCursor; pass it back as cursor.",
|
|
5382
|
+
"- Status values are keys from the project's workflow; read them from get_project before setting one.",
|
|
5383
|
+
"- Confirm with the user before any tool marked destructive."
|
|
5384
|
+
];
|
|
5385
|
+
t.projectId && r.push(`- The user is viewing project "${t.projectId}"; tools use it when you omit projectId.`);
|
|
5386
|
+
let i = vr.map((e) => ({
|
|
5387
|
+
...e,
|
|
5388
|
+
tools: e.tools.filter((e) => n.has(e))
|
|
5389
|
+
})).filter((e) => e.tools.length > 0);
|
|
5390
|
+
if (i.length > 0) {
|
|
5391
|
+
r.push("", "Which tool to use:");
|
|
5392
|
+
for (let e of i) r.push(`- ${e.when}: ${e.tools.join(", ")}`);
|
|
5393
|
+
}
|
|
5394
|
+
if (n.has("get_skill") && Q.length > 0) {
|
|
5395
|
+
r.push("", "For multi-step jobs, load the matching skill with get_skill { name } before you start, and follow it:");
|
|
5396
|
+
for (let e of Q) r.push(`- ${e.name}: ${e.description}`);
|
|
5397
|
+
}
|
|
5398
|
+
return r.join("\n");
|
|
5399
|
+
}
|
|
4925
5400
|
//#endregion
|
|
4926
5401
|
//#region ../mcp/dist/web/index.js
|
|
4927
|
-
function
|
|
5402
|
+
function br(e = typeof document < "u" ? document : null) {
|
|
4928
5403
|
if (!e) return null;
|
|
4929
5404
|
if (!e.modelContext) {
|
|
4930
5405
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -4949,55 +5424,60 @@ function Fn(e = typeof document < "u" ? document : null) {
|
|
|
4949
5424
|
}
|
|
4950
5425
|
return e.modelContext;
|
|
4951
5426
|
}
|
|
4952
|
-
function
|
|
5427
|
+
function xr(e) {
|
|
4953
5428
|
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 =
|
|
4955
|
-
let a =
|
|
5429
|
+
t?.modelContext ? i = t.modelContext : n?.modelContext ? i = n.modelContext : t && (i = br(t) ?? void 0);
|
|
5430
|
+
let a = pr({
|
|
5431
|
+
tools: e.tools,
|
|
5432
|
+
toolsets: e.toolsets,
|
|
5433
|
+
readOnly: e.readOnly
|
|
5434
|
+
}), o = yr(a, { projectId: e.projectId }), s = [], c = new AbortController();
|
|
4956
5435
|
if (e.signal?.aborted) return {
|
|
4957
5436
|
unregister: () => {},
|
|
4958
|
-
getRegisteredTools: () => []
|
|
5437
|
+
getRegisteredTools: () => [],
|
|
5438
|
+
instructions: o
|
|
4959
5439
|
};
|
|
4960
|
-
e.signal && e.signal.addEventListener("abort", () =>
|
|
5440
|
+
e.signal && e.signal.addEventListener("abort", () => c.abort(), { once: !0 });
|
|
4961
5441
|
for (let t of a) {
|
|
4962
5442
|
let n = {
|
|
4963
5443
|
name: t.name,
|
|
4964
5444
|
title: t.title,
|
|
4965
5445
|
description: t.description,
|
|
4966
5446
|
inputSchema: t.inputSchema,
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
destructiveHint: t.annotations?.requiresConfirmation ?? !1
|
|
4970
|
-
},
|
|
5447
|
+
outputSchema: t.outputSchema,
|
|
5448
|
+
annotations: { ...t.annotations },
|
|
4971
5449
|
execute: async (n) => {
|
|
4972
|
-
let r = e.projectId ? { projectId: e.projectId } : void 0, i = await
|
|
5450
|
+
let r = e.projectId ? { projectId: e.projectId } : void 0, i = await gr(t, n, e.client, r);
|
|
4973
5451
|
return e.onToolExecuted?.(t.name, n, i), i;
|
|
4974
5452
|
}
|
|
4975
5453
|
};
|
|
4976
|
-
if (
|
|
4977
|
-
i.registerTool(n, { signal:
|
|
5454
|
+
if (s.push(n), i?.registerTool) try {
|
|
5455
|
+
i.registerTool(n, { signal: c.signal });
|
|
4978
5456
|
} catch (e) {
|
|
4979
5457
|
console.warn(`[Critical Path WebMCP] Failed to register tool "${n.name}":`, e);
|
|
4980
5458
|
}
|
|
4981
5459
|
}
|
|
4982
5460
|
return r && (r.__CRITICAL_PATH_WEBMCP__ = {
|
|
4983
5461
|
projectId: e.projectId,
|
|
4984
|
-
|
|
5462
|
+
instructions: o,
|
|
5463
|
+
tools: s,
|
|
4985
5464
|
execute: async (e, t) => {
|
|
4986
|
-
let n =
|
|
5465
|
+
let n = s.find((t) => t.name === e);
|
|
4987
5466
|
if (!n) throw Error(`WebMCP tool "${e}" not found in Critical Path registry.`);
|
|
4988
5467
|
return n.execute(t);
|
|
4989
5468
|
}
|
|
4990
5469
|
}), {
|
|
4991
5470
|
unregister: () => {
|
|
4992
|
-
if (
|
|
4993
|
-
r && r.__CRITICAL_PATH_WEBMCP__?.tools ===
|
|
5471
|
+
if (c.abort(), i?.unregisterTool) for (let e of s) i.unregisterTool(e.name);
|
|
5472
|
+
r && r.__CRITICAL_PATH_WEBMCP__?.tools === s && delete r.__CRITICAL_PATH_WEBMCP__;
|
|
4994
5473
|
},
|
|
4995
|
-
getRegisteredTools: () =>
|
|
5474
|
+
getRegisteredTools: () => s,
|
|
5475
|
+
instructions: o
|
|
4996
5476
|
};
|
|
4997
5477
|
}
|
|
4998
5478
|
//#endregion
|
|
4999
5479
|
//#region src/webmcp-state.svelte.ts
|
|
5000
|
-
var
|
|
5480
|
+
var Sr = class {
|
|
5001
5481
|
client;
|
|
5002
5482
|
options;
|
|
5003
5483
|
#e = t.state(!1);
|
|
@@ -5021,13 +5501,20 @@ var Ln = class {
|
|
|
5021
5501
|
set tools(e) {
|
|
5022
5502
|
t.set(this.#n, e, !0);
|
|
5023
5503
|
}
|
|
5024
|
-
#r = t.state(
|
|
5025
|
-
get
|
|
5504
|
+
#r = t.state("");
|
|
5505
|
+
get instructions() {
|
|
5026
5506
|
return t.get(this.#r);
|
|
5027
5507
|
}
|
|
5028
|
-
set
|
|
5508
|
+
set instructions(e) {
|
|
5029
5509
|
t.set(this.#r, e, !0);
|
|
5030
5510
|
}
|
|
5511
|
+
#i = t.state(null);
|
|
5512
|
+
get error() {
|
|
5513
|
+
return t.get(this.#i);
|
|
5514
|
+
}
|
|
5515
|
+
set error(e) {
|
|
5516
|
+
t.set(this.#i, e, !0);
|
|
5517
|
+
}
|
|
5031
5518
|
handle = null;
|
|
5032
5519
|
abortController = null;
|
|
5033
5520
|
constructor(e, t = {}) {
|
|
@@ -5037,10 +5524,12 @@ var Ln = class {
|
|
|
5037
5524
|
if (!this.registered) {
|
|
5038
5525
|
this.error = null;
|
|
5039
5526
|
try {
|
|
5040
|
-
this.abortController = new AbortController(), this.handle =
|
|
5527
|
+
this.abortController = new AbortController(), this.handle = xr({
|
|
5041
5528
|
client: this.client,
|
|
5042
5529
|
projectId: this.activeProjectId,
|
|
5043
5530
|
tools: this.options.tools,
|
|
5531
|
+
toolsets: this.options.toolsets,
|
|
5532
|
+
readOnly: this.options.readOnly,
|
|
5044
5533
|
signal: this.abortController.signal,
|
|
5045
5534
|
document: this.options.document,
|
|
5046
5535
|
navigator: this.options.navigator,
|
|
@@ -5048,25 +5537,25 @@ var Ln = class {
|
|
|
5048
5537
|
onToolExecuted: (e, t, n) => {
|
|
5049
5538
|
this.options.onToolExecuted?.(e, t, n);
|
|
5050
5539
|
}
|
|
5051
|
-
}), this.tools = this.handle.getRegisteredTools().map((e) => e.name), this.registered = !0;
|
|
5540
|
+
}), this.tools = this.handle.getRegisteredTools().map((e) => e.name), this.instructions = this.handle.instructions, this.registered = !0;
|
|
5052
5541
|
} catch (e) {
|
|
5053
5542
|
this.error = e instanceof Error ? e : Error(String(e)), this.registered = !1;
|
|
5054
5543
|
}
|
|
5055
5544
|
}
|
|
5056
5545
|
}
|
|
5057
5546
|
unregister() {
|
|
5058
|
-
this.registered && (this.abortController?.abort(), this.handle?.unregister(), this.handle = null, this.abortController = null, this.registered = !1, this.tools = []);
|
|
5547
|
+
this.registered && (this.abortController?.abort(), this.handle?.unregister(), this.handle = null, this.abortController = null, this.registered = !1, this.tools = [], this.instructions = "");
|
|
5059
5548
|
}
|
|
5060
5549
|
setProjectId(e) {
|
|
5061
5550
|
this.activeProjectId !== e && (this.activeProjectId = e, this.registered && (this.unregister(), this.register()));
|
|
5062
5551
|
}
|
|
5063
5552
|
};
|
|
5064
|
-
function
|
|
5065
|
-
return new
|
|
5553
|
+
function Cr(e, t) {
|
|
5554
|
+
return new Sr(e, t);
|
|
5066
5555
|
}
|
|
5067
5556
|
//#endregion
|
|
5068
5557
|
//#region src/critical-path-state.svelte.ts
|
|
5069
|
-
var
|
|
5558
|
+
var wr = class {
|
|
5070
5559
|
client;
|
|
5071
5560
|
projectId;
|
|
5072
5561
|
#e = new i();
|
|
@@ -5110,12 +5599,12 @@ var zn = class {
|
|
|
5110
5599
|
this.#e.cancel();
|
|
5111
5600
|
}
|
|
5112
5601
|
};
|
|
5113
|
-
function
|
|
5114
|
-
return new
|
|
5602
|
+
function Tr(e, t) {
|
|
5603
|
+
return new wr(e, t);
|
|
5115
5604
|
}
|
|
5116
5605
|
//#endregion
|
|
5117
5606
|
//#region src/timeline-ladder-state.svelte.ts
|
|
5118
|
-
var
|
|
5607
|
+
var Er = class {
|
|
5119
5608
|
client;
|
|
5120
5609
|
projectId;
|
|
5121
5610
|
#e = new i();
|
|
@@ -5193,12 +5682,12 @@ var Vn = class {
|
|
|
5193
5682
|
this.#e.cancel();
|
|
5194
5683
|
}
|
|
5195
5684
|
};
|
|
5196
|
-
function
|
|
5197
|
-
return new
|
|
5685
|
+
function Dr(e, t, n) {
|
|
5686
|
+
return new Er(e, t, n);
|
|
5198
5687
|
}
|
|
5199
5688
|
//#endregion
|
|
5200
5689
|
//#region src/task-metrics-state.svelte.ts
|
|
5201
|
-
var
|
|
5690
|
+
var Or = class {
|
|
5202
5691
|
client;
|
|
5203
5692
|
taskId;
|
|
5204
5693
|
#e = new i();
|
|
@@ -5317,12 +5806,12 @@ var Un = class {
|
|
|
5317
5806
|
this.#e.cancel(), this.#t.cancel(), this.#n.cancel();
|
|
5318
5807
|
}
|
|
5319
5808
|
};
|
|
5320
|
-
function
|
|
5321
|
-
return new
|
|
5809
|
+
function kr(e, t) {
|
|
5810
|
+
return new Or(e, t);
|
|
5322
5811
|
}
|
|
5323
5812
|
//#endregion
|
|
5324
5813
|
//#region src/workload-state.svelte.ts
|
|
5325
|
-
var
|
|
5814
|
+
var Ar = class {
|
|
5326
5815
|
client;
|
|
5327
5816
|
projectId;
|
|
5328
5817
|
initialOptions;
|
|
@@ -5445,13 +5934,13 @@ var Gn = class {
|
|
|
5445
5934
|
this.#e.cancel();
|
|
5446
5935
|
}
|
|
5447
5936
|
};
|
|
5448
|
-
function
|
|
5449
|
-
return new
|
|
5937
|
+
function jr(e, t, n) {
|
|
5938
|
+
return new Ar(e, t, n);
|
|
5450
5939
|
}
|
|
5451
5940
|
//#endregion
|
|
5452
5941
|
//#region src/index.ts
|
|
5453
|
-
function
|
|
5942
|
+
function Mr(t) {
|
|
5454
5943
|
return new e(t);
|
|
5455
5944
|
}
|
|
5456
5945
|
//#endregion
|
|
5457
|
-
export { ie as AttachmentState, ne as CommentState,
|
|
5946
|
+
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 };
|