@workit-dev/mcp 2.23.0 → 2.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1105 -837
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7434,6 +7434,7 @@ var _parse = (_Err) => {
|
|
|
7434
7434
|
};
|
|
7435
7435
|
return fn;
|
|
7436
7436
|
};
|
|
7437
|
+
var parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
7437
7438
|
var _parseAsync = (_Err) => {
|
|
7438
7439
|
const fn = async (schema, value, _ctx, params) => {
|
|
7439
7440
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
@@ -7449,6 +7450,7 @@ var _parseAsync = (_Err) => {
|
|
|
7449
7450
|
};
|
|
7450
7451
|
return fn;
|
|
7451
7452
|
};
|
|
7453
|
+
var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
7452
7454
|
var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
7453
7455
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
7454
7456
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -7484,6 +7486,7 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
7484
7486
|
result = await result;
|
|
7485
7487
|
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
7486
7488
|
};
|
|
7489
|
+
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
7487
7490
|
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
7488
7491
|
var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
7489
7492
|
var validate = (schema, value, _ctx) => {
|
|
@@ -10393,6 +10396,9 @@ function _gte(value, params) {
|
|
|
10393
10396
|
inclusive: true
|
|
10394
10397
|
});
|
|
10395
10398
|
}
|
|
10399
|
+
function _nonnegative(params) {
|
|
10400
|
+
return _gte(0, params);
|
|
10401
|
+
}
|
|
10396
10402
|
function _multipleOf(value, params) {
|
|
10397
10403
|
return new $ZodCheckMultipleOf({
|
|
10398
10404
|
check: "multiple_of",
|
|
@@ -11602,6 +11608,250 @@ var optionalProcessor = (schema, ctx, _json, params) => {
|
|
|
11602
11608
|
const seen = ctx.seen.get(schema);
|
|
11603
11609
|
seen.ref = def.innerType;
|
|
11604
11610
|
};
|
|
11611
|
+
// node_modules/zod/v4/mini/schemas.js
|
|
11612
|
+
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
11613
|
+
if (!inst._zod)
|
|
11614
|
+
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
11615
|
+
$ZodType.init(inst, def);
|
|
11616
|
+
inst.def = def;
|
|
11617
|
+
inst.type = def.type;
|
|
11618
|
+
}, {
|
|
11619
|
+
get with() {
|
|
11620
|
+
return this.check;
|
|
11621
|
+
},
|
|
11622
|
+
set with(value) {
|
|
11623
|
+
own(this, "with", value);
|
|
11624
|
+
},
|
|
11625
|
+
parse(data, params) {
|
|
11626
|
+
return parse(this, data, params, { callee: this.parse });
|
|
11627
|
+
},
|
|
11628
|
+
parseAsync(data, params) {
|
|
11629
|
+
return parseAsync(this, data, params, { callee: this.parseAsync });
|
|
11630
|
+
},
|
|
11631
|
+
safeParse(data, params) {
|
|
11632
|
+
return safeParse(this, data, params);
|
|
11633
|
+
},
|
|
11634
|
+
safeParseAsync(data, params) {
|
|
11635
|
+
return safeParseAsync(this, data, params);
|
|
11636
|
+
},
|
|
11637
|
+
check(...checks) {
|
|
11638
|
+
const def = this.def;
|
|
11639
|
+
return this.clone({
|
|
11640
|
+
...def,
|
|
11641
|
+
checks: [
|
|
11642
|
+
...def.checks ?? [],
|
|
11643
|
+
...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
11644
|
+
]
|
|
11645
|
+
}, { parent: true });
|
|
11646
|
+
},
|
|
11647
|
+
clone(_def, params) {
|
|
11648
|
+
return clone(this, _def, params);
|
|
11649
|
+
},
|
|
11650
|
+
brand() {
|
|
11651
|
+
return this;
|
|
11652
|
+
},
|
|
11653
|
+
register(reg, meta) {
|
|
11654
|
+
reg.add(this, meta);
|
|
11655
|
+
return this;
|
|
11656
|
+
},
|
|
11657
|
+
apply(fn, ...args) {
|
|
11658
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
11659
|
+
}
|
|
11660
|
+
});
|
|
11661
|
+
var ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
|
|
11662
|
+
$ZodString.init(inst, def);
|
|
11663
|
+
ZodMiniType.init(inst, def);
|
|
11664
|
+
});
|
|
11665
|
+
function string2(params) {
|
|
11666
|
+
return _string(ZodMiniString, params);
|
|
11667
|
+
}
|
|
11668
|
+
var ZodMiniStringFormat = /* @__PURE__ */ $constructor("ZodMiniStringFormat", (inst, def) => {
|
|
11669
|
+
$ZodStringFormat.init(inst, def);
|
|
11670
|
+
ZodMiniString.init(inst, def);
|
|
11671
|
+
});
|
|
11672
|
+
var ZodMiniURL = /* @__PURE__ */ $constructor("ZodMiniURL", (inst, def) => {
|
|
11673
|
+
$ZodURL.init(inst, def);
|
|
11674
|
+
ZodMiniStringFormat.init(inst, def);
|
|
11675
|
+
});
|
|
11676
|
+
function url(params) {
|
|
11677
|
+
return _url(ZodMiniURL, params);
|
|
11678
|
+
}
|
|
11679
|
+
var ZodMiniNumber = /* @__PURE__ */ $constructor("ZodMiniNumber", (inst, def) => {
|
|
11680
|
+
$ZodNumber.init(inst, def);
|
|
11681
|
+
ZodMiniType.init(inst, def);
|
|
11682
|
+
});
|
|
11683
|
+
function number2(params) {
|
|
11684
|
+
return _number(ZodMiniNumber, params);
|
|
11685
|
+
}
|
|
11686
|
+
var ZodMiniNumberFormat = /* @__PURE__ */ $constructor("ZodMiniNumberFormat", (inst, def) => {
|
|
11687
|
+
$ZodNumberFormat.init(inst, def);
|
|
11688
|
+
ZodMiniNumber.init(inst, def);
|
|
11689
|
+
});
|
|
11690
|
+
function int(params) {
|
|
11691
|
+
return _int(ZodMiniNumberFormat, params);
|
|
11692
|
+
}
|
|
11693
|
+
var ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
|
|
11694
|
+
$ZodBoolean.init(inst, def);
|
|
11695
|
+
ZodMiniType.init(inst, def);
|
|
11696
|
+
});
|
|
11697
|
+
function boolean2(params) {
|
|
11698
|
+
return _boolean(ZodMiniBoolean, params);
|
|
11699
|
+
}
|
|
11700
|
+
var ZodMiniUnknown = /* @__PURE__ */ $constructor("ZodMiniUnknown", (inst, def) => {
|
|
11701
|
+
$ZodUnknown.init(inst, def);
|
|
11702
|
+
ZodMiniType.init(inst, def);
|
|
11703
|
+
});
|
|
11704
|
+
function unknown() {
|
|
11705
|
+
return _unknown(ZodMiniUnknown);
|
|
11706
|
+
}
|
|
11707
|
+
var ZodMiniNever = /* @__PURE__ */ $constructor("ZodMiniNever", (inst, def) => {
|
|
11708
|
+
$ZodNever.init(inst, def);
|
|
11709
|
+
ZodMiniType.init(inst, def);
|
|
11710
|
+
});
|
|
11711
|
+
function never(params) {
|
|
11712
|
+
return _never(ZodMiniNever, params);
|
|
11713
|
+
}
|
|
11714
|
+
var ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
|
|
11715
|
+
$ZodArray.init(inst, def);
|
|
11716
|
+
ZodMiniType.init(inst, def);
|
|
11717
|
+
});
|
|
11718
|
+
function array(element, params) {
|
|
11719
|
+
return new ZodMiniArray({
|
|
11720
|
+
type: "array",
|
|
11721
|
+
element,
|
|
11722
|
+
...normalizeParams(params)
|
|
11723
|
+
});
|
|
11724
|
+
}
|
|
11725
|
+
var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
11726
|
+
$ZodObject.init(inst, def);
|
|
11727
|
+
ZodMiniType.init(inst, def);
|
|
11728
|
+
installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
11729
|
+
});
|
|
11730
|
+
function strictObject(shape, params) {
|
|
11731
|
+
return new ZodMiniObject({
|
|
11732
|
+
type: "object",
|
|
11733
|
+
shape,
|
|
11734
|
+
catchall: never(),
|
|
11735
|
+
...normalizeParams(params)
|
|
11736
|
+
});
|
|
11737
|
+
}
|
|
11738
|
+
function looseObject(shape, params) {
|
|
11739
|
+
return new ZodMiniObject({
|
|
11740
|
+
type: "object",
|
|
11741
|
+
shape,
|
|
11742
|
+
catchall: unknown(),
|
|
11743
|
+
...normalizeParams(params)
|
|
11744
|
+
});
|
|
11745
|
+
}
|
|
11746
|
+
function extend2(schema, shape) {
|
|
11747
|
+
return extend(schema, shape);
|
|
11748
|
+
}
|
|
11749
|
+
function pick2(schema, mask) {
|
|
11750
|
+
return pick(schema, mask);
|
|
11751
|
+
}
|
|
11752
|
+
function omit2(schema, mask) {
|
|
11753
|
+
return omit(schema, mask);
|
|
11754
|
+
}
|
|
11755
|
+
var ZodMiniUnion = /* @__PURE__ */ $constructor("ZodMiniUnion", (inst, def) => {
|
|
11756
|
+
$ZodUnion.init(inst, def);
|
|
11757
|
+
ZodMiniType.init(inst, def);
|
|
11758
|
+
});
|
|
11759
|
+
function union(options, params) {
|
|
11760
|
+
return new ZodMiniUnion({
|
|
11761
|
+
type: "union",
|
|
11762
|
+
options,
|
|
11763
|
+
...normalizeParams(params)
|
|
11764
|
+
});
|
|
11765
|
+
}
|
|
11766
|
+
var ZodMiniDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
|
|
11767
|
+
$ZodDiscriminatedUnion.init(inst, def);
|
|
11768
|
+
ZodMiniType.init(inst, def);
|
|
11769
|
+
});
|
|
11770
|
+
function discriminatedUnion(discriminator, options, params) {
|
|
11771
|
+
return new ZodMiniDiscriminatedUnion({
|
|
11772
|
+
type: "union",
|
|
11773
|
+
options,
|
|
11774
|
+
discriminator,
|
|
11775
|
+
...normalizeParams(params)
|
|
11776
|
+
});
|
|
11777
|
+
}
|
|
11778
|
+
var ZodMiniRecord = /* @__PURE__ */ $constructor("ZodMiniRecord", (inst, def) => {
|
|
11779
|
+
$ZodRecord.init(inst, def);
|
|
11780
|
+
ZodMiniType.init(inst, def);
|
|
11781
|
+
});
|
|
11782
|
+
function record(keyType, valueType, params) {
|
|
11783
|
+
if (!valueType || !valueType._zod) {
|
|
11784
|
+
return new ZodMiniRecord({
|
|
11785
|
+
type: "record",
|
|
11786
|
+
keyType: string2(),
|
|
11787
|
+
valueType: keyType,
|
|
11788
|
+
...normalizeParams(valueType)
|
|
11789
|
+
});
|
|
11790
|
+
}
|
|
11791
|
+
return new ZodMiniRecord({
|
|
11792
|
+
type: "record",
|
|
11793
|
+
keyType,
|
|
11794
|
+
valueType,
|
|
11795
|
+
...normalizeParams(params)
|
|
11796
|
+
});
|
|
11797
|
+
}
|
|
11798
|
+
var ZodMiniEnum = /* @__PURE__ */ $constructor("ZodMiniEnum", (inst, def) => {
|
|
11799
|
+
$ZodEnum.init(inst, def);
|
|
11800
|
+
ZodMiniType.init(inst, def);
|
|
11801
|
+
inst.options = [...inst._zod.values];
|
|
11802
|
+
});
|
|
11803
|
+
function _enum(values, params) {
|
|
11804
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
11805
|
+
return new ZodMiniEnum({
|
|
11806
|
+
type: "enum",
|
|
11807
|
+
entries,
|
|
11808
|
+
...normalizeParams(params)
|
|
11809
|
+
});
|
|
11810
|
+
}
|
|
11811
|
+
var ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
|
|
11812
|
+
$ZodLiteral.init(inst, def);
|
|
11813
|
+
ZodMiniType.init(inst, def);
|
|
11814
|
+
});
|
|
11815
|
+
function literal(value, params) {
|
|
11816
|
+
return new ZodMiniLiteral({
|
|
11817
|
+
type: "literal",
|
|
11818
|
+
values: Array.isArray(value) ? value : [value],
|
|
11819
|
+
...normalizeParams(params)
|
|
11820
|
+
});
|
|
11821
|
+
}
|
|
11822
|
+
var ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
|
|
11823
|
+
$ZodOptional.init(inst, def);
|
|
11824
|
+
ZodMiniType.init(inst, def);
|
|
11825
|
+
});
|
|
11826
|
+
function optional(innerType) {
|
|
11827
|
+
return new ZodMiniOptional({
|
|
11828
|
+
type: "optional",
|
|
11829
|
+
innerType
|
|
11830
|
+
});
|
|
11831
|
+
}
|
|
11832
|
+
var ZodMiniNullable = /* @__PURE__ */ $constructor("ZodMiniNullable", (inst, def) => {
|
|
11833
|
+
$ZodNullable.init(inst, def);
|
|
11834
|
+
ZodMiniType.init(inst, def);
|
|
11835
|
+
});
|
|
11836
|
+
function nullable(innerType) {
|
|
11837
|
+
return new ZodMiniNullable({
|
|
11838
|
+
type: "nullable",
|
|
11839
|
+
innerType
|
|
11840
|
+
});
|
|
11841
|
+
}
|
|
11842
|
+
var ZodMiniCustom = /* @__PURE__ */ $constructor("ZodMiniCustom", (inst, def) => {
|
|
11843
|
+
$ZodCustom.init(inst, def);
|
|
11844
|
+
ZodMiniType.init(inst, def);
|
|
11845
|
+
});
|
|
11846
|
+
function custom(fn, _params) {
|
|
11847
|
+
return _custom(ZodMiniCustom, fn ?? (() => true), _params);
|
|
11848
|
+
}
|
|
11849
|
+
function refine(fn, _params = {}) {
|
|
11850
|
+
return _refine(ZodMiniCustom, fn, _params);
|
|
11851
|
+
}
|
|
11852
|
+
function superRefine(fn, params) {
|
|
11853
|
+
return _superRefine(fn, params);
|
|
11854
|
+
}
|
|
11605
11855
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
11606
11856
|
function isZ4Schema(s) {
|
|
11607
11857
|
const schema = s;
|
|
@@ -11710,7 +11960,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, undefi
|
|
|
11710
11960
|
});
|
|
11711
11961
|
|
|
11712
11962
|
// node_modules/zod/v4/classic/parse.js
|
|
11713
|
-
var
|
|
11963
|
+
var parse4 = /* @__PURE__ */ _parse(ZodRealError);
|
|
11714
11964
|
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
11715
11965
|
var safeParse3 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
11716
11966
|
var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
@@ -11762,34 +12012,34 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
11762
12012
|
return this;
|
|
11763
12013
|
},
|
|
11764
12014
|
refine(check, params) {
|
|
11765
|
-
return this.check(
|
|
12015
|
+
return this.check(refine2(check, params));
|
|
11766
12016
|
},
|
|
11767
12017
|
superRefine(refinement, params) {
|
|
11768
|
-
return this.check(
|
|
12018
|
+
return this.check(superRefine2(refinement, params));
|
|
11769
12019
|
},
|
|
11770
12020
|
overwrite(fn) {
|
|
11771
12021
|
return this.check(_overwrite(fn));
|
|
11772
12022
|
},
|
|
11773
12023
|
optional() {
|
|
11774
|
-
return
|
|
12024
|
+
return optional2(this);
|
|
11775
12025
|
},
|
|
11776
12026
|
exactOptional() {
|
|
11777
12027
|
return exactOptional(this);
|
|
11778
12028
|
},
|
|
11779
12029
|
nullable() {
|
|
11780
|
-
return
|
|
12030
|
+
return nullable2(this);
|
|
11781
12031
|
},
|
|
11782
12032
|
nullish() {
|
|
11783
|
-
return
|
|
12033
|
+
return optional2(nullable2(this));
|
|
11784
12034
|
},
|
|
11785
12035
|
nonoptional(params) {
|
|
11786
12036
|
return nonoptional(this, params);
|
|
11787
12037
|
},
|
|
11788
12038
|
array() {
|
|
11789
|
-
return
|
|
12039
|
+
return array2(this);
|
|
11790
12040
|
},
|
|
11791
12041
|
or(arg) {
|
|
11792
|
-
return
|
|
12042
|
+
return union2([this, arg]);
|
|
11793
12043
|
},
|
|
11794
12044
|
and(arg) {
|
|
11795
12045
|
return intersection(this, arg);
|
|
@@ -11846,7 +12096,7 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
11846
12096
|
own(this, "~standard", value);
|
|
11847
12097
|
},
|
|
11848
12098
|
parse: function _parse(data, params) {
|
|
11849
|
-
return
|
|
12099
|
+
return parse4(this, data, params, { callee: _parse });
|
|
11850
12100
|
},
|
|
11851
12101
|
parseAsync: async function _parseAsync(data, params) {
|
|
11852
12102
|
return await parseAsync2(this, data, params, { callee: _parseAsync });
|
|
@@ -12041,7 +12291,7 @@ var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
|
12041
12291
|
return this.check(_isoDuration(ZodISODuration, params));
|
|
12042
12292
|
}
|
|
12043
12293
|
});
|
|
12044
|
-
function
|
|
12294
|
+
function string3(params) {
|
|
12045
12295
|
return _string(ZodString, params);
|
|
12046
12296
|
}
|
|
12047
12297
|
var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
|
|
@@ -12179,10 +12429,10 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
12179
12429
|
return this.check(_lte(value, params));
|
|
12180
12430
|
},
|
|
12181
12431
|
int(params) {
|
|
12182
|
-
return this.check(
|
|
12432
|
+
return this.check(int2(params));
|
|
12183
12433
|
},
|
|
12184
12434
|
safe(params) {
|
|
12185
|
-
return this.check(
|
|
12435
|
+
return this.check(int2(params));
|
|
12186
12436
|
},
|
|
12187
12437
|
positive(params) {
|
|
12188
12438
|
return this.check(_gt(0, params));
|
|
@@ -12206,14 +12456,14 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
12206
12456
|
return this;
|
|
12207
12457
|
}
|
|
12208
12458
|
}));
|
|
12209
|
-
function
|
|
12459
|
+
function number3(params) {
|
|
12210
12460
|
return _number(ZodNumber, params);
|
|
12211
12461
|
}
|
|
12212
12462
|
var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
|
|
12213
12463
|
$ZodNumberFormat.init(inst, def);
|
|
12214
12464
|
ZodNumber.init(inst, def);
|
|
12215
12465
|
});
|
|
12216
|
-
function
|
|
12466
|
+
function int2(params) {
|
|
12217
12467
|
return _int(ZodNumberFormat, params);
|
|
12218
12468
|
}
|
|
12219
12469
|
var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
@@ -12221,7 +12471,7 @@ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
|
12221
12471
|
ZodType.init(inst, def);
|
|
12222
12472
|
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
|
|
12223
12473
|
});
|
|
12224
|
-
function
|
|
12474
|
+
function boolean3(params) {
|
|
12225
12475
|
return _boolean(ZodBoolean, params);
|
|
12226
12476
|
}
|
|
12227
12477
|
var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
@@ -12237,7 +12487,7 @@ var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
|
12237
12487
|
ZodType.init(inst, def);
|
|
12238
12488
|
inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
|
|
12239
12489
|
});
|
|
12240
|
-
function
|
|
12490
|
+
function unknown2() {
|
|
12241
12491
|
return _unknown(ZodUnknown);
|
|
12242
12492
|
}
|
|
12243
12493
|
var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
@@ -12245,7 +12495,7 @@ var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
|
12245
12495
|
ZodType.init(inst, def);
|
|
12246
12496
|
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
|
|
12247
12497
|
});
|
|
12248
|
-
function
|
|
12498
|
+
function never2(params) {
|
|
12249
12499
|
return _never(ZodNever, params);
|
|
12250
12500
|
}
|
|
12251
12501
|
var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
@@ -12271,7 +12521,7 @@ var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
|
12271
12521
|
return this.element;
|
|
12272
12522
|
}
|
|
12273
12523
|
});
|
|
12274
|
-
function
|
|
12524
|
+
function array2(element, params) {
|
|
12275
12525
|
return _array(ZodArray, element, params);
|
|
12276
12526
|
}
|
|
12277
12527
|
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
@@ -12282,19 +12532,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
12282
12532
|
installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
12283
12533
|
}, {
|
|
12284
12534
|
keyof() {
|
|
12285
|
-
return
|
|
12535
|
+
return _enum2(Object.keys(this._zod.def.shape));
|
|
12286
12536
|
},
|
|
12287
12537
|
catchall(catchall) {
|
|
12288
12538
|
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
12289
12539
|
},
|
|
12290
12540
|
passthrough() {
|
|
12291
|
-
return this.clone(mergeDefs(this._zod.def, { catchall:
|
|
12541
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown2() }));
|
|
12292
12542
|
},
|
|
12293
12543
|
loose() {
|
|
12294
|
-
return this.clone(mergeDefs(this._zod.def, { catchall:
|
|
12544
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown2() }));
|
|
12295
12545
|
},
|
|
12296
12546
|
strict() {
|
|
12297
|
-
return this.clone(mergeDefs(this._zod.def, { catchall:
|
|
12547
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: never2() }));
|
|
12298
12548
|
},
|
|
12299
12549
|
strip() {
|
|
12300
12550
|
return this.clone(mergeDefs(this._zod.def, { catchall: undefined }));
|
|
@@ -12324,7 +12574,7 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
12324
12574
|
return required(ZodNonOptional, this, args[0]);
|
|
12325
12575
|
}
|
|
12326
12576
|
});
|
|
12327
|
-
function
|
|
12577
|
+
function object2(shape, params) {
|
|
12328
12578
|
const def = {
|
|
12329
12579
|
type: "object",
|
|
12330
12580
|
shape: shape ?? {},
|
|
@@ -12332,11 +12582,11 @@ function object(shape, params) {
|
|
|
12332
12582
|
};
|
|
12333
12583
|
return new ZodObject(def);
|
|
12334
12584
|
}
|
|
12335
|
-
function
|
|
12585
|
+
function looseObject2(shape, params) {
|
|
12336
12586
|
return new ZodObject({
|
|
12337
12587
|
type: "object",
|
|
12338
12588
|
shape,
|
|
12339
|
-
catchall:
|
|
12589
|
+
catchall: unknown2(),
|
|
12340
12590
|
...normalizeParams(params)
|
|
12341
12591
|
});
|
|
12342
12592
|
}
|
|
@@ -12346,7 +12596,7 @@ var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
|
12346
12596
|
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
12347
12597
|
inst.options = def.options;
|
|
12348
12598
|
});
|
|
12349
|
-
function
|
|
12599
|
+
function union2(options, params) {
|
|
12350
12600
|
return new ZodUnion({
|
|
12351
12601
|
type: "union",
|
|
12352
12602
|
options,
|
|
@@ -12357,7 +12607,7 @@ var ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion"
|
|
|
12357
12607
|
ZodUnion.init(inst, def);
|
|
12358
12608
|
$ZodDiscriminatedUnion.init(inst, def);
|
|
12359
12609
|
});
|
|
12360
|
-
function
|
|
12610
|
+
function discriminatedUnion2(discriminator, options, params) {
|
|
12361
12611
|
return new ZodDiscriminatedUnion({
|
|
12362
12612
|
type: "union",
|
|
12363
12613
|
options,
|
|
@@ -12385,11 +12635,11 @@ var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
|
12385
12635
|
inst.keyType = def.keyType;
|
|
12386
12636
|
inst.valueType = def.valueType;
|
|
12387
12637
|
});
|
|
12388
|
-
function
|
|
12638
|
+
function record2(keyType, valueType, params) {
|
|
12389
12639
|
if (!valueType || !valueType._zod) {
|
|
12390
12640
|
return new ZodRecord({
|
|
12391
12641
|
type: "record",
|
|
12392
|
-
keyType:
|
|
12642
|
+
keyType: string3(),
|
|
12393
12643
|
valueType: keyType,
|
|
12394
12644
|
...normalizeParams(valueType)
|
|
12395
12645
|
});
|
|
@@ -12439,7 +12689,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
12439
12689
|
});
|
|
12440
12690
|
};
|
|
12441
12691
|
});
|
|
12442
|
-
function
|
|
12692
|
+
function _enum2(values, params) {
|
|
12443
12693
|
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
12444
12694
|
return new ZodEnum({
|
|
12445
12695
|
type: "enum",
|
|
@@ -12461,7 +12711,7 @@ var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
|
|
|
12461
12711
|
}
|
|
12462
12712
|
});
|
|
12463
12713
|
});
|
|
12464
|
-
function
|
|
12714
|
+
function literal2(value, params) {
|
|
12465
12715
|
return new ZodLiteral({
|
|
12466
12716
|
type: "literal",
|
|
12467
12717
|
values: Array.isArray(value) ? value : [value],
|
|
@@ -12514,7 +12764,7 @@ var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
|
12514
12764
|
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
12515
12765
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
12516
12766
|
});
|
|
12517
|
-
function
|
|
12767
|
+
function optional2(innerType) {
|
|
12518
12768
|
return new ZodOptional({
|
|
12519
12769
|
type: "optional",
|
|
12520
12770
|
innerType
|
|
@@ -12538,7 +12788,7 @@ var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
|
12538
12788
|
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
12539
12789
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
12540
12790
|
});
|
|
12541
|
-
function
|
|
12791
|
+
function nullable2(innerType) {
|
|
12542
12792
|
return new ZodNullable({
|
|
12543
12793
|
type: "nullable",
|
|
12544
12794
|
innerType
|
|
@@ -12637,13 +12887,13 @@ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
|
12637
12887
|
ZodType.init(inst, def);
|
|
12638
12888
|
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
12639
12889
|
});
|
|
12640
|
-
function
|
|
12890
|
+
function custom2(fn, _params) {
|
|
12641
12891
|
return _custom(ZodCustom, fn ?? (() => true), _params);
|
|
12642
12892
|
}
|
|
12643
|
-
function
|
|
12893
|
+
function refine2(fn, _params = {}) {
|
|
12644
12894
|
return _refine(ZodCustom, fn, _params);
|
|
12645
12895
|
}
|
|
12646
|
-
function
|
|
12896
|
+
function superRefine2(fn, params) {
|
|
12647
12897
|
return _superRefine(fn, params);
|
|
12648
12898
|
}
|
|
12649
12899
|
function preprocess(fn, schema) {
|
|
@@ -12662,58 +12912,58 @@ var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
|
12662
12912
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
12663
12913
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
12664
12914
|
var JSONRPC_VERSION = "2.0";
|
|
12665
|
-
var AssertObjectSchema =
|
|
12666
|
-
var ProgressTokenSchema =
|
|
12667
|
-
var CursorSchema =
|
|
12668
|
-
var TaskCreationParamsSchema =
|
|
12669
|
-
ttl:
|
|
12670
|
-
pollInterval:
|
|
12915
|
+
var AssertObjectSchema = custom2((v) => v !== null && (typeof v === "object" || typeof v === "function"));
|
|
12916
|
+
var ProgressTokenSchema = union2([string3(), number3().int()]);
|
|
12917
|
+
var CursorSchema = string3();
|
|
12918
|
+
var TaskCreationParamsSchema = looseObject2({
|
|
12919
|
+
ttl: number3().optional(),
|
|
12920
|
+
pollInterval: number3().optional()
|
|
12671
12921
|
});
|
|
12672
|
-
var TaskMetadataSchema =
|
|
12673
|
-
ttl:
|
|
12922
|
+
var TaskMetadataSchema = object2({
|
|
12923
|
+
ttl: number3().optional()
|
|
12674
12924
|
});
|
|
12675
|
-
var RelatedTaskMetadataSchema =
|
|
12676
|
-
taskId:
|
|
12925
|
+
var RelatedTaskMetadataSchema = object2({
|
|
12926
|
+
taskId: string3()
|
|
12677
12927
|
});
|
|
12678
|
-
var RequestMetaSchema =
|
|
12928
|
+
var RequestMetaSchema = looseObject2({
|
|
12679
12929
|
progressToken: ProgressTokenSchema.optional(),
|
|
12680
12930
|
[RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
|
|
12681
12931
|
});
|
|
12682
|
-
var BaseRequestParamsSchema =
|
|
12932
|
+
var BaseRequestParamsSchema = object2({
|
|
12683
12933
|
_meta: RequestMetaSchema.optional()
|
|
12684
12934
|
});
|
|
12685
12935
|
var TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
12686
12936
|
task: TaskMetadataSchema.optional()
|
|
12687
12937
|
});
|
|
12688
12938
|
var isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
|
|
12689
|
-
var RequestSchema =
|
|
12690
|
-
method:
|
|
12939
|
+
var RequestSchema = object2({
|
|
12940
|
+
method: string3(),
|
|
12691
12941
|
params: BaseRequestParamsSchema.loose().optional()
|
|
12692
12942
|
});
|
|
12693
|
-
var NotificationsParamsSchema =
|
|
12943
|
+
var NotificationsParamsSchema = object2({
|
|
12694
12944
|
_meta: RequestMetaSchema.optional()
|
|
12695
12945
|
});
|
|
12696
|
-
var NotificationSchema =
|
|
12697
|
-
method:
|
|
12946
|
+
var NotificationSchema = object2({
|
|
12947
|
+
method: string3(),
|
|
12698
12948
|
params: NotificationsParamsSchema.loose().optional()
|
|
12699
12949
|
});
|
|
12700
|
-
var ResultSchema =
|
|
12950
|
+
var ResultSchema = looseObject2({
|
|
12701
12951
|
_meta: RequestMetaSchema.optional()
|
|
12702
12952
|
});
|
|
12703
|
-
var RequestIdSchema =
|
|
12704
|
-
var JSONRPCRequestSchema =
|
|
12705
|
-
jsonrpc:
|
|
12953
|
+
var RequestIdSchema = union2([string3(), number3().int()]);
|
|
12954
|
+
var JSONRPCRequestSchema = object2({
|
|
12955
|
+
jsonrpc: literal2(JSONRPC_VERSION),
|
|
12706
12956
|
id: RequestIdSchema,
|
|
12707
12957
|
...RequestSchema.shape
|
|
12708
12958
|
}).strict();
|
|
12709
12959
|
var isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
|
|
12710
|
-
var JSONRPCNotificationSchema =
|
|
12711
|
-
jsonrpc:
|
|
12960
|
+
var JSONRPCNotificationSchema = object2({
|
|
12961
|
+
jsonrpc: literal2(JSONRPC_VERSION),
|
|
12712
12962
|
...NotificationSchema.shape
|
|
12713
12963
|
}).strict();
|
|
12714
12964
|
var isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
|
|
12715
|
-
var JSONRPCResultResponseSchema =
|
|
12716
|
-
jsonrpc:
|
|
12965
|
+
var JSONRPCResultResponseSchema = object2({
|
|
12966
|
+
jsonrpc: literal2(JSONRPC_VERSION),
|
|
12717
12967
|
id: RequestIdSchema,
|
|
12718
12968
|
result: ResultSchema
|
|
12719
12969
|
}).strict();
|
|
@@ -12729,55 +12979,55 @@ var ErrorCode;
|
|
|
12729
12979
|
ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError";
|
|
12730
12980
|
ErrorCode[ErrorCode["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
|
|
12731
12981
|
})(ErrorCode || (ErrorCode = {}));
|
|
12732
|
-
var JSONRPCErrorResponseSchema =
|
|
12733
|
-
jsonrpc:
|
|
12982
|
+
var JSONRPCErrorResponseSchema = object2({
|
|
12983
|
+
jsonrpc: literal2(JSONRPC_VERSION),
|
|
12734
12984
|
id: RequestIdSchema.optional(),
|
|
12735
|
-
error:
|
|
12736
|
-
code:
|
|
12737
|
-
message:
|
|
12738
|
-
data:
|
|
12985
|
+
error: object2({
|
|
12986
|
+
code: number3().int(),
|
|
12987
|
+
message: string3(),
|
|
12988
|
+
data: unknown2().optional()
|
|
12739
12989
|
})
|
|
12740
12990
|
}).strict();
|
|
12741
12991
|
var isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
|
|
12742
|
-
var JSONRPCMessageSchema =
|
|
12992
|
+
var JSONRPCMessageSchema = union2([
|
|
12743
12993
|
JSONRPCRequestSchema,
|
|
12744
12994
|
JSONRPCNotificationSchema,
|
|
12745
12995
|
JSONRPCResultResponseSchema,
|
|
12746
12996
|
JSONRPCErrorResponseSchema
|
|
12747
12997
|
]);
|
|
12748
|
-
var JSONRPCResponseSchema =
|
|
12998
|
+
var JSONRPCResponseSchema = union2([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
|
|
12749
12999
|
var EmptyResultSchema = ResultSchema.strict();
|
|
12750
13000
|
var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
12751
13001
|
requestId: RequestIdSchema.optional(),
|
|
12752
|
-
reason:
|
|
13002
|
+
reason: string3().optional()
|
|
12753
13003
|
});
|
|
12754
13004
|
var CancelledNotificationSchema = NotificationSchema.extend({
|
|
12755
|
-
method:
|
|
13005
|
+
method: literal2("notifications/cancelled"),
|
|
12756
13006
|
params: CancelledNotificationParamsSchema
|
|
12757
13007
|
});
|
|
12758
|
-
var IconSchema =
|
|
12759
|
-
src:
|
|
12760
|
-
mimeType:
|
|
12761
|
-
sizes:
|
|
12762
|
-
theme:
|
|
13008
|
+
var IconSchema = object2({
|
|
13009
|
+
src: string3(),
|
|
13010
|
+
mimeType: string3().optional(),
|
|
13011
|
+
sizes: array2(string3()).optional(),
|
|
13012
|
+
theme: _enum2(["light", "dark"]).optional()
|
|
12763
13013
|
});
|
|
12764
|
-
var IconsSchema =
|
|
12765
|
-
icons:
|
|
13014
|
+
var IconsSchema = object2({
|
|
13015
|
+
icons: array2(IconSchema).optional()
|
|
12766
13016
|
});
|
|
12767
|
-
var BaseMetadataSchema =
|
|
12768
|
-
name:
|
|
12769
|
-
title:
|
|
13017
|
+
var BaseMetadataSchema = object2({
|
|
13018
|
+
name: string3(),
|
|
13019
|
+
title: string3().optional()
|
|
12770
13020
|
});
|
|
12771
13021
|
var ImplementationSchema = BaseMetadataSchema.extend({
|
|
12772
13022
|
...BaseMetadataSchema.shape,
|
|
12773
13023
|
...IconsSchema.shape,
|
|
12774
|
-
version:
|
|
12775
|
-
websiteUrl:
|
|
12776
|
-
description:
|
|
13024
|
+
version: string3(),
|
|
13025
|
+
websiteUrl: string3().optional(),
|
|
13026
|
+
description: string3().optional()
|
|
12777
13027
|
});
|
|
12778
|
-
var FormElicitationCapabilitySchema = intersection(
|
|
12779
|
-
applyDefaults:
|
|
12780
|
-
}),
|
|
13028
|
+
var FormElicitationCapabilitySchema = intersection(object2({
|
|
13029
|
+
applyDefaults: boolean3().optional()
|
|
13030
|
+
}), record2(string3(), unknown2()));
|
|
12781
13031
|
var ElicitationCapabilitySchema = preprocess((value) => {
|
|
12782
13032
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
12783
13033
|
if (Object.keys(value).length === 0) {
|
|
@@ -12785,96 +13035,96 @@ var ElicitationCapabilitySchema = preprocess((value) => {
|
|
|
12785
13035
|
}
|
|
12786
13036
|
}
|
|
12787
13037
|
return value;
|
|
12788
|
-
}, intersection(
|
|
13038
|
+
}, intersection(object2({
|
|
12789
13039
|
form: FormElicitationCapabilitySchema.optional(),
|
|
12790
13040
|
url: AssertObjectSchema.optional()
|
|
12791
|
-
}),
|
|
12792
|
-
var ClientTasksCapabilitySchema =
|
|
13041
|
+
}), record2(string3(), unknown2()).optional()));
|
|
13042
|
+
var ClientTasksCapabilitySchema = looseObject2({
|
|
12793
13043
|
list: AssertObjectSchema.optional(),
|
|
12794
13044
|
cancel: AssertObjectSchema.optional(),
|
|
12795
|
-
requests:
|
|
12796
|
-
sampling:
|
|
13045
|
+
requests: looseObject2({
|
|
13046
|
+
sampling: looseObject2({
|
|
12797
13047
|
createMessage: AssertObjectSchema.optional()
|
|
12798
13048
|
}).optional(),
|
|
12799
|
-
elicitation:
|
|
13049
|
+
elicitation: looseObject2({
|
|
12800
13050
|
create: AssertObjectSchema.optional()
|
|
12801
13051
|
}).optional()
|
|
12802
13052
|
}).optional()
|
|
12803
13053
|
});
|
|
12804
|
-
var ServerTasksCapabilitySchema =
|
|
13054
|
+
var ServerTasksCapabilitySchema = looseObject2({
|
|
12805
13055
|
list: AssertObjectSchema.optional(),
|
|
12806
13056
|
cancel: AssertObjectSchema.optional(),
|
|
12807
|
-
requests:
|
|
12808
|
-
tools:
|
|
13057
|
+
requests: looseObject2({
|
|
13058
|
+
tools: looseObject2({
|
|
12809
13059
|
call: AssertObjectSchema.optional()
|
|
12810
13060
|
}).optional()
|
|
12811
13061
|
}).optional()
|
|
12812
13062
|
});
|
|
12813
|
-
var ClientCapabilitiesSchema =
|
|
12814
|
-
experimental:
|
|
12815
|
-
sampling:
|
|
13063
|
+
var ClientCapabilitiesSchema = object2({
|
|
13064
|
+
experimental: record2(string3(), AssertObjectSchema).optional(),
|
|
13065
|
+
sampling: object2({
|
|
12816
13066
|
context: AssertObjectSchema.optional(),
|
|
12817
13067
|
tools: AssertObjectSchema.optional()
|
|
12818
13068
|
}).optional(),
|
|
12819
13069
|
elicitation: ElicitationCapabilitySchema.optional(),
|
|
12820
|
-
roots:
|
|
12821
|
-
listChanged:
|
|
13070
|
+
roots: object2({
|
|
13071
|
+
listChanged: boolean3().optional()
|
|
12822
13072
|
}).optional(),
|
|
12823
13073
|
tasks: ClientTasksCapabilitySchema.optional(),
|
|
12824
|
-
extensions:
|
|
13074
|
+
extensions: record2(string3(), AssertObjectSchema).optional()
|
|
12825
13075
|
});
|
|
12826
13076
|
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
12827
|
-
protocolVersion:
|
|
13077
|
+
protocolVersion: string3(),
|
|
12828
13078
|
capabilities: ClientCapabilitiesSchema,
|
|
12829
13079
|
clientInfo: ImplementationSchema
|
|
12830
13080
|
});
|
|
12831
13081
|
var InitializeRequestSchema = RequestSchema.extend({
|
|
12832
|
-
method:
|
|
13082
|
+
method: literal2("initialize"),
|
|
12833
13083
|
params: InitializeRequestParamsSchema
|
|
12834
13084
|
});
|
|
12835
|
-
var ServerCapabilitiesSchema =
|
|
12836
|
-
experimental:
|
|
13085
|
+
var ServerCapabilitiesSchema = object2({
|
|
13086
|
+
experimental: record2(string3(), AssertObjectSchema).optional(),
|
|
12837
13087
|
logging: AssertObjectSchema.optional(),
|
|
12838
13088
|
completions: AssertObjectSchema.optional(),
|
|
12839
|
-
prompts:
|
|
12840
|
-
listChanged:
|
|
13089
|
+
prompts: object2({
|
|
13090
|
+
listChanged: boolean3().optional()
|
|
12841
13091
|
}).optional(),
|
|
12842
|
-
resources:
|
|
12843
|
-
subscribe:
|
|
12844
|
-
listChanged:
|
|
13092
|
+
resources: object2({
|
|
13093
|
+
subscribe: boolean3().optional(),
|
|
13094
|
+
listChanged: boolean3().optional()
|
|
12845
13095
|
}).optional(),
|
|
12846
|
-
tools:
|
|
12847
|
-
listChanged:
|
|
13096
|
+
tools: object2({
|
|
13097
|
+
listChanged: boolean3().optional()
|
|
12848
13098
|
}).optional(),
|
|
12849
13099
|
tasks: ServerTasksCapabilitySchema.optional(),
|
|
12850
|
-
extensions:
|
|
13100
|
+
extensions: record2(string3(), AssertObjectSchema).optional()
|
|
12851
13101
|
});
|
|
12852
13102
|
var InitializeResultSchema = ResultSchema.extend({
|
|
12853
|
-
protocolVersion:
|
|
13103
|
+
protocolVersion: string3(),
|
|
12854
13104
|
capabilities: ServerCapabilitiesSchema,
|
|
12855
13105
|
serverInfo: ImplementationSchema,
|
|
12856
|
-
instructions:
|
|
13106
|
+
instructions: string3().optional()
|
|
12857
13107
|
});
|
|
12858
13108
|
var InitializedNotificationSchema = NotificationSchema.extend({
|
|
12859
|
-
method:
|
|
13109
|
+
method: literal2("notifications/initialized"),
|
|
12860
13110
|
params: NotificationsParamsSchema.optional()
|
|
12861
13111
|
});
|
|
12862
13112
|
var PingRequestSchema = RequestSchema.extend({
|
|
12863
|
-
method:
|
|
13113
|
+
method: literal2("ping"),
|
|
12864
13114
|
params: BaseRequestParamsSchema.optional()
|
|
12865
13115
|
});
|
|
12866
|
-
var ProgressSchema =
|
|
12867
|
-
progress:
|
|
12868
|
-
total:
|
|
12869
|
-
message:
|
|
13116
|
+
var ProgressSchema = object2({
|
|
13117
|
+
progress: number3(),
|
|
13118
|
+
total: optional2(number3()),
|
|
13119
|
+
message: optional2(string3())
|
|
12870
13120
|
});
|
|
12871
|
-
var ProgressNotificationParamsSchema =
|
|
13121
|
+
var ProgressNotificationParamsSchema = object2({
|
|
12872
13122
|
...NotificationsParamsSchema.shape,
|
|
12873
13123
|
...ProgressSchema.shape,
|
|
12874
13124
|
progressToken: ProgressTokenSchema
|
|
12875
13125
|
});
|
|
12876
13126
|
var ProgressNotificationSchema = NotificationSchema.extend({
|
|
12877
|
-
method:
|
|
13127
|
+
method: literal2("notifications/progress"),
|
|
12878
13128
|
params: ProgressNotificationParamsSchema
|
|
12879
13129
|
});
|
|
12880
13130
|
var PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
@@ -12886,60 +13136,60 @@ var PaginatedRequestSchema = RequestSchema.extend({
|
|
|
12886
13136
|
var PaginatedResultSchema = ResultSchema.extend({
|
|
12887
13137
|
nextCursor: CursorSchema.optional()
|
|
12888
13138
|
});
|
|
12889
|
-
var TaskStatusSchema =
|
|
12890
|
-
var TaskSchema =
|
|
12891
|
-
taskId:
|
|
13139
|
+
var TaskStatusSchema = _enum2(["working", "input_required", "completed", "failed", "cancelled"]);
|
|
13140
|
+
var TaskSchema = object2({
|
|
13141
|
+
taskId: string3(),
|
|
12892
13142
|
status: TaskStatusSchema,
|
|
12893
|
-
ttl:
|
|
12894
|
-
createdAt:
|
|
12895
|
-
lastUpdatedAt:
|
|
12896
|
-
pollInterval:
|
|
12897
|
-
statusMessage:
|
|
13143
|
+
ttl: union2([number3(), _null3()]),
|
|
13144
|
+
createdAt: string3(),
|
|
13145
|
+
lastUpdatedAt: string3(),
|
|
13146
|
+
pollInterval: optional2(number3()),
|
|
13147
|
+
statusMessage: optional2(string3())
|
|
12898
13148
|
});
|
|
12899
13149
|
var CreateTaskResultSchema = ResultSchema.extend({
|
|
12900
13150
|
task: TaskSchema
|
|
12901
13151
|
});
|
|
12902
13152
|
var TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
|
|
12903
13153
|
var TaskStatusNotificationSchema = NotificationSchema.extend({
|
|
12904
|
-
method:
|
|
13154
|
+
method: literal2("notifications/tasks/status"),
|
|
12905
13155
|
params: TaskStatusNotificationParamsSchema
|
|
12906
13156
|
});
|
|
12907
13157
|
var GetTaskRequestSchema = RequestSchema.extend({
|
|
12908
|
-
method:
|
|
13158
|
+
method: literal2("tasks/get"),
|
|
12909
13159
|
params: BaseRequestParamsSchema.extend({
|
|
12910
|
-
taskId:
|
|
13160
|
+
taskId: string3()
|
|
12911
13161
|
})
|
|
12912
13162
|
});
|
|
12913
13163
|
var GetTaskResultSchema = ResultSchema.merge(TaskSchema);
|
|
12914
13164
|
var GetTaskPayloadRequestSchema = RequestSchema.extend({
|
|
12915
|
-
method:
|
|
13165
|
+
method: literal2("tasks/result"),
|
|
12916
13166
|
params: BaseRequestParamsSchema.extend({
|
|
12917
|
-
taskId:
|
|
13167
|
+
taskId: string3()
|
|
12918
13168
|
})
|
|
12919
13169
|
});
|
|
12920
13170
|
var GetTaskPayloadResultSchema = ResultSchema.loose();
|
|
12921
13171
|
var ListTasksRequestSchema = PaginatedRequestSchema.extend({
|
|
12922
|
-
method:
|
|
13172
|
+
method: literal2("tasks/list")
|
|
12923
13173
|
});
|
|
12924
13174
|
var ListTasksResultSchema = PaginatedResultSchema.extend({
|
|
12925
|
-
tasks:
|
|
13175
|
+
tasks: array2(TaskSchema)
|
|
12926
13176
|
});
|
|
12927
13177
|
var CancelTaskRequestSchema = RequestSchema.extend({
|
|
12928
|
-
method:
|
|
13178
|
+
method: literal2("tasks/cancel"),
|
|
12929
13179
|
params: BaseRequestParamsSchema.extend({
|
|
12930
|
-
taskId:
|
|
13180
|
+
taskId: string3()
|
|
12931
13181
|
})
|
|
12932
13182
|
});
|
|
12933
13183
|
var CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
|
|
12934
|
-
var ResourceContentsSchema =
|
|
12935
|
-
uri:
|
|
12936
|
-
mimeType:
|
|
12937
|
-
_meta:
|
|
13184
|
+
var ResourceContentsSchema = object2({
|
|
13185
|
+
uri: string3(),
|
|
13186
|
+
mimeType: optional2(string3()),
|
|
13187
|
+
_meta: record2(string3(), unknown2()).optional()
|
|
12938
13188
|
});
|
|
12939
13189
|
var TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
12940
|
-
text:
|
|
13190
|
+
text: string3()
|
|
12941
13191
|
});
|
|
12942
|
-
var Base64Schema =
|
|
13192
|
+
var Base64Schema = string3().refine((val) => {
|
|
12943
13193
|
try {
|
|
12944
13194
|
atob(val);
|
|
12945
13195
|
return true;
|
|
@@ -12950,447 +13200,447 @@ var Base64Schema = string2().refine((val) => {
|
|
|
12950
13200
|
var BlobResourceContentsSchema = ResourceContentsSchema.extend({
|
|
12951
13201
|
blob: Base64Schema
|
|
12952
13202
|
});
|
|
12953
|
-
var RoleSchema =
|
|
12954
|
-
var AnnotationsSchema =
|
|
12955
|
-
audience:
|
|
12956
|
-
priority:
|
|
13203
|
+
var RoleSchema = _enum2(["user", "assistant"]);
|
|
13204
|
+
var AnnotationsSchema = object2({
|
|
13205
|
+
audience: array2(RoleSchema).optional(),
|
|
13206
|
+
priority: number3().min(0).max(1).optional(),
|
|
12957
13207
|
lastModified: datetime2({ offset: true }).optional()
|
|
12958
13208
|
});
|
|
12959
|
-
var ResourceSchema =
|
|
13209
|
+
var ResourceSchema = object2({
|
|
12960
13210
|
...BaseMetadataSchema.shape,
|
|
12961
13211
|
...IconsSchema.shape,
|
|
12962
|
-
uri:
|
|
12963
|
-
description:
|
|
12964
|
-
mimeType:
|
|
12965
|
-
size:
|
|
13212
|
+
uri: string3(),
|
|
13213
|
+
description: optional2(string3()),
|
|
13214
|
+
mimeType: optional2(string3()),
|
|
13215
|
+
size: optional2(number3()),
|
|
12966
13216
|
annotations: AnnotationsSchema.optional(),
|
|
12967
|
-
_meta:
|
|
13217
|
+
_meta: optional2(looseObject2({}))
|
|
12968
13218
|
});
|
|
12969
|
-
var ResourceTemplateSchema =
|
|
13219
|
+
var ResourceTemplateSchema = object2({
|
|
12970
13220
|
...BaseMetadataSchema.shape,
|
|
12971
13221
|
...IconsSchema.shape,
|
|
12972
|
-
uriTemplate:
|
|
12973
|
-
description:
|
|
12974
|
-
mimeType:
|
|
13222
|
+
uriTemplate: string3(),
|
|
13223
|
+
description: optional2(string3()),
|
|
13224
|
+
mimeType: optional2(string3()),
|
|
12975
13225
|
annotations: AnnotationsSchema.optional(),
|
|
12976
|
-
_meta:
|
|
13226
|
+
_meta: optional2(looseObject2({}))
|
|
12977
13227
|
});
|
|
12978
13228
|
var ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
12979
|
-
method:
|
|
13229
|
+
method: literal2("resources/list")
|
|
12980
13230
|
});
|
|
12981
13231
|
var ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
12982
|
-
resources:
|
|
13232
|
+
resources: array2(ResourceSchema)
|
|
12983
13233
|
});
|
|
12984
13234
|
var ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
12985
|
-
method:
|
|
13235
|
+
method: literal2("resources/templates/list")
|
|
12986
13236
|
});
|
|
12987
13237
|
var ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
12988
|
-
resourceTemplates:
|
|
13238
|
+
resourceTemplates: array2(ResourceTemplateSchema)
|
|
12989
13239
|
});
|
|
12990
13240
|
var ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
12991
|
-
uri:
|
|
13241
|
+
uri: string3()
|
|
12992
13242
|
});
|
|
12993
13243
|
var ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
|
|
12994
13244
|
var ReadResourceRequestSchema = RequestSchema.extend({
|
|
12995
|
-
method:
|
|
13245
|
+
method: literal2("resources/read"),
|
|
12996
13246
|
params: ReadResourceRequestParamsSchema
|
|
12997
13247
|
});
|
|
12998
13248
|
var ReadResourceResultSchema = ResultSchema.extend({
|
|
12999
|
-
contents:
|
|
13249
|
+
contents: array2(union2([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
13000
13250
|
});
|
|
13001
13251
|
var ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
13002
|
-
method:
|
|
13252
|
+
method: literal2("notifications/resources/list_changed"),
|
|
13003
13253
|
params: NotificationsParamsSchema.optional()
|
|
13004
13254
|
});
|
|
13005
13255
|
var SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
13006
13256
|
var SubscribeRequestSchema = RequestSchema.extend({
|
|
13007
|
-
method:
|
|
13257
|
+
method: literal2("resources/subscribe"),
|
|
13008
13258
|
params: SubscribeRequestParamsSchema
|
|
13009
13259
|
});
|
|
13010
13260
|
var UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
13011
13261
|
var UnsubscribeRequestSchema = RequestSchema.extend({
|
|
13012
|
-
method:
|
|
13262
|
+
method: literal2("resources/unsubscribe"),
|
|
13013
13263
|
params: UnsubscribeRequestParamsSchema
|
|
13014
13264
|
});
|
|
13015
13265
|
var ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
13016
|
-
uri:
|
|
13266
|
+
uri: string3()
|
|
13017
13267
|
});
|
|
13018
13268
|
var ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
13019
|
-
method:
|
|
13269
|
+
method: literal2("notifications/resources/updated"),
|
|
13020
13270
|
params: ResourceUpdatedNotificationParamsSchema
|
|
13021
13271
|
});
|
|
13022
|
-
var PromptArgumentSchema =
|
|
13023
|
-
name:
|
|
13024
|
-
description:
|
|
13025
|
-
required:
|
|
13272
|
+
var PromptArgumentSchema = object2({
|
|
13273
|
+
name: string3(),
|
|
13274
|
+
description: optional2(string3()),
|
|
13275
|
+
required: optional2(boolean3())
|
|
13026
13276
|
});
|
|
13027
|
-
var PromptSchema =
|
|
13277
|
+
var PromptSchema = object2({
|
|
13028
13278
|
...BaseMetadataSchema.shape,
|
|
13029
13279
|
...IconsSchema.shape,
|
|
13030
|
-
description:
|
|
13031
|
-
arguments:
|
|
13032
|
-
_meta:
|
|
13280
|
+
description: optional2(string3()),
|
|
13281
|
+
arguments: optional2(array2(PromptArgumentSchema)),
|
|
13282
|
+
_meta: optional2(looseObject2({}))
|
|
13033
13283
|
});
|
|
13034
13284
|
var ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
13035
|
-
method:
|
|
13285
|
+
method: literal2("prompts/list")
|
|
13036
13286
|
});
|
|
13037
13287
|
var ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
13038
|
-
prompts:
|
|
13288
|
+
prompts: array2(PromptSchema)
|
|
13039
13289
|
});
|
|
13040
13290
|
var GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
13041
|
-
name:
|
|
13042
|
-
arguments:
|
|
13291
|
+
name: string3(),
|
|
13292
|
+
arguments: record2(string3(), string3()).optional()
|
|
13043
13293
|
});
|
|
13044
13294
|
var GetPromptRequestSchema = RequestSchema.extend({
|
|
13045
|
-
method:
|
|
13295
|
+
method: literal2("prompts/get"),
|
|
13046
13296
|
params: GetPromptRequestParamsSchema
|
|
13047
13297
|
});
|
|
13048
|
-
var TextContentSchema =
|
|
13049
|
-
type:
|
|
13050
|
-
text:
|
|
13298
|
+
var TextContentSchema = object2({
|
|
13299
|
+
type: literal2("text"),
|
|
13300
|
+
text: string3(),
|
|
13051
13301
|
annotations: AnnotationsSchema.optional(),
|
|
13052
|
-
_meta:
|
|
13302
|
+
_meta: record2(string3(), unknown2()).optional()
|
|
13053
13303
|
});
|
|
13054
|
-
var ImageContentSchema =
|
|
13055
|
-
type:
|
|
13304
|
+
var ImageContentSchema = object2({
|
|
13305
|
+
type: literal2("image"),
|
|
13056
13306
|
data: Base64Schema,
|
|
13057
|
-
mimeType:
|
|
13307
|
+
mimeType: string3(),
|
|
13058
13308
|
annotations: AnnotationsSchema.optional(),
|
|
13059
|
-
_meta:
|
|
13309
|
+
_meta: record2(string3(), unknown2()).optional()
|
|
13060
13310
|
});
|
|
13061
|
-
var AudioContentSchema =
|
|
13062
|
-
type:
|
|
13311
|
+
var AudioContentSchema = object2({
|
|
13312
|
+
type: literal2("audio"),
|
|
13063
13313
|
data: Base64Schema,
|
|
13064
|
-
mimeType:
|
|
13314
|
+
mimeType: string3(),
|
|
13065
13315
|
annotations: AnnotationsSchema.optional(),
|
|
13066
|
-
_meta:
|
|
13067
|
-
});
|
|
13068
|
-
var ToolUseContentSchema =
|
|
13069
|
-
type:
|
|
13070
|
-
name:
|
|
13071
|
-
id:
|
|
13072
|
-
input:
|
|
13073
|
-
_meta:
|
|
13074
|
-
});
|
|
13075
|
-
var EmbeddedResourceSchema =
|
|
13076
|
-
type:
|
|
13077
|
-
resource:
|
|
13316
|
+
_meta: record2(string3(), unknown2()).optional()
|
|
13317
|
+
});
|
|
13318
|
+
var ToolUseContentSchema = object2({
|
|
13319
|
+
type: literal2("tool_use"),
|
|
13320
|
+
name: string3(),
|
|
13321
|
+
id: string3(),
|
|
13322
|
+
input: record2(string3(), unknown2()),
|
|
13323
|
+
_meta: record2(string3(), unknown2()).optional()
|
|
13324
|
+
});
|
|
13325
|
+
var EmbeddedResourceSchema = object2({
|
|
13326
|
+
type: literal2("resource"),
|
|
13327
|
+
resource: union2([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
13078
13328
|
annotations: AnnotationsSchema.optional(),
|
|
13079
|
-
_meta:
|
|
13329
|
+
_meta: record2(string3(), unknown2()).optional()
|
|
13080
13330
|
});
|
|
13081
13331
|
var ResourceLinkSchema = ResourceSchema.extend({
|
|
13082
|
-
type:
|
|
13332
|
+
type: literal2("resource_link")
|
|
13083
13333
|
});
|
|
13084
|
-
var ContentBlockSchema =
|
|
13334
|
+
var ContentBlockSchema = union2([
|
|
13085
13335
|
TextContentSchema,
|
|
13086
13336
|
ImageContentSchema,
|
|
13087
13337
|
AudioContentSchema,
|
|
13088
13338
|
ResourceLinkSchema,
|
|
13089
13339
|
EmbeddedResourceSchema
|
|
13090
13340
|
]);
|
|
13091
|
-
var PromptMessageSchema =
|
|
13341
|
+
var PromptMessageSchema = object2({
|
|
13092
13342
|
role: RoleSchema,
|
|
13093
13343
|
content: ContentBlockSchema
|
|
13094
13344
|
});
|
|
13095
13345
|
var GetPromptResultSchema = ResultSchema.extend({
|
|
13096
|
-
description:
|
|
13097
|
-
messages:
|
|
13346
|
+
description: string3().optional(),
|
|
13347
|
+
messages: array2(PromptMessageSchema)
|
|
13098
13348
|
});
|
|
13099
13349
|
var PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
13100
|
-
method:
|
|
13350
|
+
method: literal2("notifications/prompts/list_changed"),
|
|
13101
13351
|
params: NotificationsParamsSchema.optional()
|
|
13102
13352
|
});
|
|
13103
|
-
var ToolAnnotationsSchema =
|
|
13104
|
-
title:
|
|
13105
|
-
readOnlyHint:
|
|
13106
|
-
destructiveHint:
|
|
13107
|
-
idempotentHint:
|
|
13108
|
-
openWorldHint:
|
|
13353
|
+
var ToolAnnotationsSchema = object2({
|
|
13354
|
+
title: string3().optional(),
|
|
13355
|
+
readOnlyHint: boolean3().optional(),
|
|
13356
|
+
destructiveHint: boolean3().optional(),
|
|
13357
|
+
idempotentHint: boolean3().optional(),
|
|
13358
|
+
openWorldHint: boolean3().optional()
|
|
13109
13359
|
});
|
|
13110
|
-
var ToolExecutionSchema =
|
|
13111
|
-
taskSupport:
|
|
13360
|
+
var ToolExecutionSchema = object2({
|
|
13361
|
+
taskSupport: _enum2(["required", "optional", "forbidden"]).optional()
|
|
13112
13362
|
});
|
|
13113
|
-
var ToolSchema =
|
|
13363
|
+
var ToolSchema = object2({
|
|
13114
13364
|
...BaseMetadataSchema.shape,
|
|
13115
13365
|
...IconsSchema.shape,
|
|
13116
|
-
description:
|
|
13117
|
-
inputSchema:
|
|
13118
|
-
type:
|
|
13119
|
-
properties:
|
|
13120
|
-
required:
|
|
13121
|
-
}).catchall(
|
|
13122
|
-
outputSchema:
|
|
13123
|
-
type:
|
|
13124
|
-
properties:
|
|
13125
|
-
required:
|
|
13126
|
-
}).catchall(
|
|
13366
|
+
description: string3().optional(),
|
|
13367
|
+
inputSchema: object2({
|
|
13368
|
+
type: literal2("object"),
|
|
13369
|
+
properties: record2(string3(), AssertObjectSchema).optional(),
|
|
13370
|
+
required: array2(string3()).optional()
|
|
13371
|
+
}).catchall(unknown2()),
|
|
13372
|
+
outputSchema: object2({
|
|
13373
|
+
type: literal2("object"),
|
|
13374
|
+
properties: record2(string3(), AssertObjectSchema).optional(),
|
|
13375
|
+
required: array2(string3()).optional()
|
|
13376
|
+
}).catchall(unknown2()).optional(),
|
|
13127
13377
|
annotations: ToolAnnotationsSchema.optional(),
|
|
13128
13378
|
execution: ToolExecutionSchema.optional(),
|
|
13129
|
-
_meta:
|
|
13379
|
+
_meta: record2(string3(), unknown2()).optional()
|
|
13130
13380
|
});
|
|
13131
13381
|
var ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
13132
|
-
method:
|
|
13382
|
+
method: literal2("tools/list")
|
|
13133
13383
|
});
|
|
13134
13384
|
var ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
13135
|
-
tools:
|
|
13385
|
+
tools: array2(ToolSchema)
|
|
13136
13386
|
});
|
|
13137
13387
|
var CallToolResultSchema = ResultSchema.extend({
|
|
13138
|
-
content:
|
|
13139
|
-
structuredContent:
|
|
13140
|
-
isError:
|
|
13388
|
+
content: array2(ContentBlockSchema).default([]),
|
|
13389
|
+
structuredContent: record2(string3(), unknown2()).optional(),
|
|
13390
|
+
isError: boolean3().optional()
|
|
13141
13391
|
});
|
|
13142
13392
|
var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
13143
|
-
toolResult:
|
|
13393
|
+
toolResult: unknown2()
|
|
13144
13394
|
}));
|
|
13145
13395
|
var CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
13146
|
-
name:
|
|
13147
|
-
arguments:
|
|
13396
|
+
name: string3(),
|
|
13397
|
+
arguments: record2(string3(), unknown2()).optional()
|
|
13148
13398
|
});
|
|
13149
13399
|
var CallToolRequestSchema = RequestSchema.extend({
|
|
13150
|
-
method:
|
|
13400
|
+
method: literal2("tools/call"),
|
|
13151
13401
|
params: CallToolRequestParamsSchema
|
|
13152
13402
|
});
|
|
13153
13403
|
var ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
13154
|
-
method:
|
|
13404
|
+
method: literal2("notifications/tools/list_changed"),
|
|
13155
13405
|
params: NotificationsParamsSchema.optional()
|
|
13156
13406
|
});
|
|
13157
|
-
var ListChangedOptionsBaseSchema =
|
|
13158
|
-
autoRefresh:
|
|
13159
|
-
debounceMs:
|
|
13407
|
+
var ListChangedOptionsBaseSchema = object2({
|
|
13408
|
+
autoRefresh: boolean3().default(true),
|
|
13409
|
+
debounceMs: number3().int().nonnegative().default(300)
|
|
13160
13410
|
});
|
|
13161
|
-
var LoggingLevelSchema =
|
|
13411
|
+
var LoggingLevelSchema = _enum2(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
13162
13412
|
var SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
13163
13413
|
level: LoggingLevelSchema
|
|
13164
13414
|
});
|
|
13165
13415
|
var SetLevelRequestSchema = RequestSchema.extend({
|
|
13166
|
-
method:
|
|
13416
|
+
method: literal2("logging/setLevel"),
|
|
13167
13417
|
params: SetLevelRequestParamsSchema
|
|
13168
13418
|
});
|
|
13169
13419
|
var LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
13170
13420
|
level: LoggingLevelSchema,
|
|
13171
|
-
logger:
|
|
13172
|
-
data:
|
|
13421
|
+
logger: string3().optional(),
|
|
13422
|
+
data: unknown2()
|
|
13173
13423
|
});
|
|
13174
13424
|
var LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
13175
|
-
method:
|
|
13425
|
+
method: literal2("notifications/message"),
|
|
13176
13426
|
params: LoggingMessageNotificationParamsSchema
|
|
13177
13427
|
});
|
|
13178
|
-
var ModelHintSchema =
|
|
13179
|
-
name:
|
|
13428
|
+
var ModelHintSchema = object2({
|
|
13429
|
+
name: string3().optional()
|
|
13180
13430
|
});
|
|
13181
|
-
var ModelPreferencesSchema =
|
|
13182
|
-
hints:
|
|
13183
|
-
costPriority:
|
|
13184
|
-
speedPriority:
|
|
13185
|
-
intelligencePriority:
|
|
13431
|
+
var ModelPreferencesSchema = object2({
|
|
13432
|
+
hints: array2(ModelHintSchema).optional(),
|
|
13433
|
+
costPriority: number3().min(0).max(1).optional(),
|
|
13434
|
+
speedPriority: number3().min(0).max(1).optional(),
|
|
13435
|
+
intelligencePriority: number3().min(0).max(1).optional()
|
|
13186
13436
|
});
|
|
13187
|
-
var ToolChoiceSchema =
|
|
13188
|
-
mode:
|
|
13437
|
+
var ToolChoiceSchema = object2({
|
|
13438
|
+
mode: _enum2(["auto", "required", "none"]).optional()
|
|
13189
13439
|
});
|
|
13190
|
-
var ToolResultContentSchema =
|
|
13191
|
-
type:
|
|
13192
|
-
toolUseId:
|
|
13193
|
-
content:
|
|
13194
|
-
structuredContent:
|
|
13195
|
-
isError:
|
|
13196
|
-
_meta:
|
|
13440
|
+
var ToolResultContentSchema = object2({
|
|
13441
|
+
type: literal2("tool_result"),
|
|
13442
|
+
toolUseId: string3().describe("The unique identifier for the corresponding tool call."),
|
|
13443
|
+
content: array2(ContentBlockSchema).default([]),
|
|
13444
|
+
structuredContent: object2({}).loose().optional(),
|
|
13445
|
+
isError: boolean3().optional(),
|
|
13446
|
+
_meta: record2(string3(), unknown2()).optional()
|
|
13197
13447
|
});
|
|
13198
|
-
var SamplingContentSchema =
|
|
13199
|
-
var SamplingMessageContentBlockSchema =
|
|
13448
|
+
var SamplingContentSchema = discriminatedUnion2("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
|
|
13449
|
+
var SamplingMessageContentBlockSchema = discriminatedUnion2("type", [
|
|
13200
13450
|
TextContentSchema,
|
|
13201
13451
|
ImageContentSchema,
|
|
13202
13452
|
AudioContentSchema,
|
|
13203
13453
|
ToolUseContentSchema,
|
|
13204
13454
|
ToolResultContentSchema
|
|
13205
13455
|
]);
|
|
13206
|
-
var SamplingMessageSchema =
|
|
13456
|
+
var SamplingMessageSchema = object2({
|
|
13207
13457
|
role: RoleSchema,
|
|
13208
|
-
content:
|
|
13209
|
-
_meta:
|
|
13458
|
+
content: union2([SamplingMessageContentBlockSchema, array2(SamplingMessageContentBlockSchema)]),
|
|
13459
|
+
_meta: record2(string3(), unknown2()).optional()
|
|
13210
13460
|
});
|
|
13211
13461
|
var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
13212
|
-
messages:
|
|
13462
|
+
messages: array2(SamplingMessageSchema),
|
|
13213
13463
|
modelPreferences: ModelPreferencesSchema.optional(),
|
|
13214
|
-
systemPrompt:
|
|
13215
|
-
includeContext:
|
|
13216
|
-
temperature:
|
|
13217
|
-
maxTokens:
|
|
13218
|
-
stopSequences:
|
|
13464
|
+
systemPrompt: string3().optional(),
|
|
13465
|
+
includeContext: _enum2(["none", "thisServer", "allServers"]).optional(),
|
|
13466
|
+
temperature: number3().optional(),
|
|
13467
|
+
maxTokens: number3().int(),
|
|
13468
|
+
stopSequences: array2(string3()).optional(),
|
|
13219
13469
|
metadata: AssertObjectSchema.optional(),
|
|
13220
|
-
tools:
|
|
13470
|
+
tools: array2(ToolSchema).optional(),
|
|
13221
13471
|
toolChoice: ToolChoiceSchema.optional()
|
|
13222
13472
|
});
|
|
13223
13473
|
var CreateMessageRequestSchema = RequestSchema.extend({
|
|
13224
|
-
method:
|
|
13474
|
+
method: literal2("sampling/createMessage"),
|
|
13225
13475
|
params: CreateMessageRequestParamsSchema
|
|
13226
13476
|
});
|
|
13227
13477
|
var CreateMessageResultSchema = ResultSchema.extend({
|
|
13228
|
-
model:
|
|
13229
|
-
stopReason:
|
|
13478
|
+
model: string3(),
|
|
13479
|
+
stopReason: optional2(_enum2(["endTurn", "stopSequence", "maxTokens"]).or(string3())),
|
|
13230
13480
|
role: RoleSchema,
|
|
13231
13481
|
content: SamplingContentSchema
|
|
13232
13482
|
});
|
|
13233
13483
|
var CreateMessageResultWithToolsSchema = ResultSchema.extend({
|
|
13234
|
-
model:
|
|
13235
|
-
stopReason:
|
|
13484
|
+
model: string3(),
|
|
13485
|
+
stopReason: optional2(_enum2(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(string3())),
|
|
13236
13486
|
role: RoleSchema,
|
|
13237
|
-
content:
|
|
13238
|
-
});
|
|
13239
|
-
var BooleanSchemaSchema =
|
|
13240
|
-
type:
|
|
13241
|
-
title:
|
|
13242
|
-
description:
|
|
13243
|
-
default:
|
|
13244
|
-
});
|
|
13245
|
-
var StringSchemaSchema =
|
|
13246
|
-
type:
|
|
13247
|
-
title:
|
|
13248
|
-
description:
|
|
13249
|
-
minLength:
|
|
13250
|
-
maxLength:
|
|
13251
|
-
format:
|
|
13252
|
-
default:
|
|
13253
|
-
});
|
|
13254
|
-
var NumberSchemaSchema =
|
|
13255
|
-
type:
|
|
13256
|
-
title:
|
|
13257
|
-
description:
|
|
13258
|
-
minimum:
|
|
13259
|
-
maximum:
|
|
13260
|
-
default:
|
|
13261
|
-
});
|
|
13262
|
-
var UntitledSingleSelectEnumSchemaSchema =
|
|
13263
|
-
type:
|
|
13264
|
-
title:
|
|
13265
|
-
description:
|
|
13266
|
-
enum:
|
|
13267
|
-
default:
|
|
13268
|
-
});
|
|
13269
|
-
var TitledSingleSelectEnumSchemaSchema =
|
|
13270
|
-
type:
|
|
13271
|
-
title:
|
|
13272
|
-
description:
|
|
13273
|
-
oneOf:
|
|
13274
|
-
const:
|
|
13275
|
-
title:
|
|
13487
|
+
content: union2([SamplingMessageContentBlockSchema, array2(SamplingMessageContentBlockSchema)])
|
|
13488
|
+
});
|
|
13489
|
+
var BooleanSchemaSchema = object2({
|
|
13490
|
+
type: literal2("boolean"),
|
|
13491
|
+
title: string3().optional(),
|
|
13492
|
+
description: string3().optional(),
|
|
13493
|
+
default: boolean3().optional()
|
|
13494
|
+
});
|
|
13495
|
+
var StringSchemaSchema = object2({
|
|
13496
|
+
type: literal2("string"),
|
|
13497
|
+
title: string3().optional(),
|
|
13498
|
+
description: string3().optional(),
|
|
13499
|
+
minLength: number3().optional(),
|
|
13500
|
+
maxLength: number3().optional(),
|
|
13501
|
+
format: _enum2(["email", "uri", "date", "date-time"]).optional(),
|
|
13502
|
+
default: string3().optional()
|
|
13503
|
+
});
|
|
13504
|
+
var NumberSchemaSchema = object2({
|
|
13505
|
+
type: _enum2(["number", "integer"]),
|
|
13506
|
+
title: string3().optional(),
|
|
13507
|
+
description: string3().optional(),
|
|
13508
|
+
minimum: number3().optional(),
|
|
13509
|
+
maximum: number3().optional(),
|
|
13510
|
+
default: number3().optional()
|
|
13511
|
+
});
|
|
13512
|
+
var UntitledSingleSelectEnumSchemaSchema = object2({
|
|
13513
|
+
type: literal2("string"),
|
|
13514
|
+
title: string3().optional(),
|
|
13515
|
+
description: string3().optional(),
|
|
13516
|
+
enum: array2(string3()),
|
|
13517
|
+
default: string3().optional()
|
|
13518
|
+
});
|
|
13519
|
+
var TitledSingleSelectEnumSchemaSchema = object2({
|
|
13520
|
+
type: literal2("string"),
|
|
13521
|
+
title: string3().optional(),
|
|
13522
|
+
description: string3().optional(),
|
|
13523
|
+
oneOf: array2(object2({
|
|
13524
|
+
const: string3(),
|
|
13525
|
+
title: string3()
|
|
13276
13526
|
})),
|
|
13277
|
-
default:
|
|
13278
|
-
});
|
|
13279
|
-
var LegacyTitledEnumSchemaSchema =
|
|
13280
|
-
type:
|
|
13281
|
-
title:
|
|
13282
|
-
description:
|
|
13283
|
-
enum:
|
|
13284
|
-
enumNames:
|
|
13285
|
-
default:
|
|
13286
|
-
});
|
|
13287
|
-
var SingleSelectEnumSchemaSchema =
|
|
13288
|
-
var UntitledMultiSelectEnumSchemaSchema =
|
|
13289
|
-
type:
|
|
13290
|
-
title:
|
|
13291
|
-
description:
|
|
13292
|
-
minItems:
|
|
13293
|
-
maxItems:
|
|
13294
|
-
items:
|
|
13295
|
-
type:
|
|
13296
|
-
enum:
|
|
13527
|
+
default: string3().optional()
|
|
13528
|
+
});
|
|
13529
|
+
var LegacyTitledEnumSchemaSchema = object2({
|
|
13530
|
+
type: literal2("string"),
|
|
13531
|
+
title: string3().optional(),
|
|
13532
|
+
description: string3().optional(),
|
|
13533
|
+
enum: array2(string3()),
|
|
13534
|
+
enumNames: array2(string3()).optional(),
|
|
13535
|
+
default: string3().optional()
|
|
13536
|
+
});
|
|
13537
|
+
var SingleSelectEnumSchemaSchema = union2([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
|
|
13538
|
+
var UntitledMultiSelectEnumSchemaSchema = object2({
|
|
13539
|
+
type: literal2("array"),
|
|
13540
|
+
title: string3().optional(),
|
|
13541
|
+
description: string3().optional(),
|
|
13542
|
+
minItems: number3().optional(),
|
|
13543
|
+
maxItems: number3().optional(),
|
|
13544
|
+
items: object2({
|
|
13545
|
+
type: literal2("string"),
|
|
13546
|
+
enum: array2(string3())
|
|
13297
13547
|
}),
|
|
13298
|
-
default:
|
|
13299
|
-
});
|
|
13300
|
-
var TitledMultiSelectEnumSchemaSchema =
|
|
13301
|
-
type:
|
|
13302
|
-
title:
|
|
13303
|
-
description:
|
|
13304
|
-
minItems:
|
|
13305
|
-
maxItems:
|
|
13306
|
-
items:
|
|
13307
|
-
anyOf:
|
|
13308
|
-
const:
|
|
13309
|
-
title:
|
|
13548
|
+
default: array2(string3()).optional()
|
|
13549
|
+
});
|
|
13550
|
+
var TitledMultiSelectEnumSchemaSchema = object2({
|
|
13551
|
+
type: literal2("array"),
|
|
13552
|
+
title: string3().optional(),
|
|
13553
|
+
description: string3().optional(),
|
|
13554
|
+
minItems: number3().optional(),
|
|
13555
|
+
maxItems: number3().optional(),
|
|
13556
|
+
items: object2({
|
|
13557
|
+
anyOf: array2(object2({
|
|
13558
|
+
const: string3(),
|
|
13559
|
+
title: string3()
|
|
13310
13560
|
}))
|
|
13311
13561
|
}),
|
|
13312
|
-
default:
|
|
13562
|
+
default: array2(string3()).optional()
|
|
13313
13563
|
});
|
|
13314
|
-
var MultiSelectEnumSchemaSchema =
|
|
13315
|
-
var EnumSchemaSchema =
|
|
13316
|
-
var PrimitiveSchemaDefinitionSchema =
|
|
13564
|
+
var MultiSelectEnumSchemaSchema = union2([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
|
|
13565
|
+
var EnumSchemaSchema = union2([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
|
|
13566
|
+
var PrimitiveSchemaDefinitionSchema = union2([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
|
|
13317
13567
|
var ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
13318
|
-
mode:
|
|
13319
|
-
message:
|
|
13320
|
-
requestedSchema:
|
|
13321
|
-
type:
|
|
13322
|
-
properties:
|
|
13323
|
-
required:
|
|
13568
|
+
mode: literal2("form").optional(),
|
|
13569
|
+
message: string3(),
|
|
13570
|
+
requestedSchema: object2({
|
|
13571
|
+
type: literal2("object"),
|
|
13572
|
+
properties: record2(string3(), PrimitiveSchemaDefinitionSchema),
|
|
13573
|
+
required: array2(string3()).optional()
|
|
13324
13574
|
})
|
|
13325
13575
|
});
|
|
13326
13576
|
var ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
13327
|
-
mode:
|
|
13328
|
-
message:
|
|
13329
|
-
elicitationId:
|
|
13330
|
-
url:
|
|
13577
|
+
mode: literal2("url"),
|
|
13578
|
+
message: string3(),
|
|
13579
|
+
elicitationId: string3(),
|
|
13580
|
+
url: string3().url()
|
|
13331
13581
|
});
|
|
13332
|
-
var ElicitRequestParamsSchema =
|
|
13582
|
+
var ElicitRequestParamsSchema = union2([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
|
|
13333
13583
|
var ElicitRequestSchema = RequestSchema.extend({
|
|
13334
|
-
method:
|
|
13584
|
+
method: literal2("elicitation/create"),
|
|
13335
13585
|
params: ElicitRequestParamsSchema
|
|
13336
13586
|
});
|
|
13337
13587
|
var ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
13338
|
-
elicitationId:
|
|
13588
|
+
elicitationId: string3()
|
|
13339
13589
|
});
|
|
13340
13590
|
var ElicitationCompleteNotificationSchema = NotificationSchema.extend({
|
|
13341
|
-
method:
|
|
13591
|
+
method: literal2("notifications/elicitation/complete"),
|
|
13342
13592
|
params: ElicitationCompleteNotificationParamsSchema
|
|
13343
13593
|
});
|
|
13344
13594
|
var ElicitResultSchema = ResultSchema.extend({
|
|
13345
|
-
action:
|
|
13346
|
-
content: preprocess((val) => val === null ? undefined : val,
|
|
13595
|
+
action: _enum2(["accept", "decline", "cancel"]),
|
|
13596
|
+
content: preprocess((val) => val === null ? undefined : val, record2(string3(), union2([string3(), number3(), boolean3(), array2(string3())])).optional())
|
|
13347
13597
|
});
|
|
13348
|
-
var ResourceTemplateReferenceSchema =
|
|
13349
|
-
type:
|
|
13350
|
-
uri:
|
|
13598
|
+
var ResourceTemplateReferenceSchema = object2({
|
|
13599
|
+
type: literal2("ref/resource"),
|
|
13600
|
+
uri: string3()
|
|
13351
13601
|
});
|
|
13352
|
-
var PromptReferenceSchema =
|
|
13353
|
-
type:
|
|
13354
|
-
name:
|
|
13602
|
+
var PromptReferenceSchema = object2({
|
|
13603
|
+
type: literal2("ref/prompt"),
|
|
13604
|
+
name: string3()
|
|
13355
13605
|
});
|
|
13356
13606
|
var CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
13357
|
-
ref:
|
|
13358
|
-
argument:
|
|
13359
|
-
name:
|
|
13360
|
-
value:
|
|
13607
|
+
ref: union2([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
13608
|
+
argument: object2({
|
|
13609
|
+
name: string3(),
|
|
13610
|
+
value: string3()
|
|
13361
13611
|
}),
|
|
13362
|
-
context:
|
|
13363
|
-
arguments:
|
|
13612
|
+
context: object2({
|
|
13613
|
+
arguments: record2(string3(), string3()).optional()
|
|
13364
13614
|
}).optional()
|
|
13365
13615
|
});
|
|
13366
13616
|
var CompleteRequestSchema = RequestSchema.extend({
|
|
13367
|
-
method:
|
|
13617
|
+
method: literal2("completion/complete"),
|
|
13368
13618
|
params: CompleteRequestParamsSchema
|
|
13369
13619
|
});
|
|
13370
13620
|
var CompleteResultSchema = ResultSchema.extend({
|
|
13371
|
-
completion:
|
|
13372
|
-
values:
|
|
13373
|
-
total:
|
|
13374
|
-
hasMore:
|
|
13621
|
+
completion: looseObject2({
|
|
13622
|
+
values: array2(string3()).max(100),
|
|
13623
|
+
total: optional2(number3().int()),
|
|
13624
|
+
hasMore: optional2(boolean3())
|
|
13375
13625
|
})
|
|
13376
13626
|
});
|
|
13377
|
-
var RootSchema =
|
|
13378
|
-
uri:
|
|
13379
|
-
name:
|
|
13380
|
-
_meta:
|
|
13627
|
+
var RootSchema = object2({
|
|
13628
|
+
uri: string3().startsWith("file://"),
|
|
13629
|
+
name: string3().optional(),
|
|
13630
|
+
_meta: record2(string3(), unknown2()).optional()
|
|
13381
13631
|
});
|
|
13382
13632
|
var ListRootsRequestSchema = RequestSchema.extend({
|
|
13383
|
-
method:
|
|
13633
|
+
method: literal2("roots/list"),
|
|
13384
13634
|
params: BaseRequestParamsSchema.optional()
|
|
13385
13635
|
});
|
|
13386
13636
|
var ListRootsResultSchema = ResultSchema.extend({
|
|
13387
|
-
roots:
|
|
13637
|
+
roots: array2(RootSchema)
|
|
13388
13638
|
});
|
|
13389
13639
|
var RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
13390
|
-
method:
|
|
13640
|
+
method: literal2("notifications/roots/list_changed"),
|
|
13391
13641
|
params: NotificationsParamsSchema.optional()
|
|
13392
13642
|
});
|
|
13393
|
-
var ClientRequestSchema =
|
|
13643
|
+
var ClientRequestSchema = union2([
|
|
13394
13644
|
PingRequestSchema,
|
|
13395
13645
|
InitializeRequestSchema,
|
|
13396
13646
|
CompleteRequestSchema,
|
|
@@ -13409,14 +13659,14 @@ var ClientRequestSchema = union([
|
|
|
13409
13659
|
ListTasksRequestSchema,
|
|
13410
13660
|
CancelTaskRequestSchema
|
|
13411
13661
|
]);
|
|
13412
|
-
var ClientNotificationSchema =
|
|
13662
|
+
var ClientNotificationSchema = union2([
|
|
13413
13663
|
CancelledNotificationSchema,
|
|
13414
13664
|
ProgressNotificationSchema,
|
|
13415
13665
|
InitializedNotificationSchema,
|
|
13416
13666
|
RootsListChangedNotificationSchema,
|
|
13417
13667
|
TaskStatusNotificationSchema
|
|
13418
13668
|
]);
|
|
13419
|
-
var ClientResultSchema =
|
|
13669
|
+
var ClientResultSchema = union2([
|
|
13420
13670
|
EmptyResultSchema,
|
|
13421
13671
|
CreateMessageResultSchema,
|
|
13422
13672
|
CreateMessageResultWithToolsSchema,
|
|
@@ -13426,7 +13676,7 @@ var ClientResultSchema = union([
|
|
|
13426
13676
|
ListTasksResultSchema,
|
|
13427
13677
|
CreateTaskResultSchema
|
|
13428
13678
|
]);
|
|
13429
|
-
var ServerRequestSchema =
|
|
13679
|
+
var ServerRequestSchema = union2([
|
|
13430
13680
|
PingRequestSchema,
|
|
13431
13681
|
CreateMessageRequestSchema,
|
|
13432
13682
|
ElicitRequestSchema,
|
|
@@ -13436,7 +13686,7 @@ var ServerRequestSchema = union([
|
|
|
13436
13686
|
ListTasksRequestSchema,
|
|
13437
13687
|
CancelTaskRequestSchema
|
|
13438
13688
|
]);
|
|
13439
|
-
var ServerNotificationSchema =
|
|
13689
|
+
var ServerNotificationSchema = union2([
|
|
13440
13690
|
CancelledNotificationSchema,
|
|
13441
13691
|
ProgressNotificationSchema,
|
|
13442
13692
|
LoggingMessageNotificationSchema,
|
|
@@ -13447,7 +13697,7 @@ var ServerNotificationSchema = union([
|
|
|
13447
13697
|
TaskStatusNotificationSchema,
|
|
13448
13698
|
ElicitationCompleteNotificationSchema
|
|
13449
13699
|
]);
|
|
13450
|
-
var ServerResultSchema =
|
|
13700
|
+
var ServerResultSchema = union2([
|
|
13451
13701
|
EmptyResultSchema,
|
|
13452
13702
|
InitializeResultSchema,
|
|
13453
13703
|
CompleteResultSchema,
|
|
@@ -14978,6 +15228,18 @@ import path30 from "node:path";
|
|
|
14978
15228
|
|
|
14979
15229
|
// packages/workit-core/src/core/task-contract.ts
|
|
14980
15230
|
import { createHash, randomUUID } from "node:crypto";
|
|
15231
|
+
|
|
15232
|
+
// packages/workit-core/src/core/zod-mini.ts
|
|
15233
|
+
if (!globalConfig.localeError)
|
|
15234
|
+
config(en_default());
|
|
15235
|
+
if (!globalConfig.memoizer)
|
|
15236
|
+
config({ memoizer: memoizer() });
|
|
15237
|
+
var described = (schema, description) => {
|
|
15238
|
+
const copy = schema.clone();
|
|
15239
|
+
globalRegistry.add(copy, { description });
|
|
15240
|
+
return copy;
|
|
15241
|
+
};
|
|
15242
|
+
|
|
14981
15243
|
// packages/workit-core/src/core/scope-glob.ts
|
|
14982
15244
|
var GLOB = /[*?[\]{}]/u;
|
|
14983
15245
|
var segmentRegex = (pattern) => {
|
|
@@ -15065,11 +15327,11 @@ var text = string2().check((ctx) => {
|
|
|
15065
15327
|
if (invalidUnicode(ctx.value))
|
|
15066
15328
|
ctx.issues.push({ code: "custom", input: ctx.value, message: "invalid Unicode", path: [] });
|
|
15067
15329
|
});
|
|
15068
|
-
var id = text.
|
|
15330
|
+
var id = text.check(_regex(uuidPattern, "expected lowercase UUID"));
|
|
15069
15331
|
var idRefPattern = /^[0-9a-f][0-9a-f-]{7,35}$/;
|
|
15070
|
-
var idRef = text.
|
|
15071
|
-
var digest = text.
|
|
15072
|
-
var revision = text.
|
|
15332
|
+
var idRef = text.check(_regex(idRefPattern, "expected a UUID or an id prefix of 8+ characters"));
|
|
15333
|
+
var digest = text.check(_regex(digestPattern, "expected lowercase SHA-256 digest"));
|
|
15334
|
+
var revision = text.check(_regex(uuidPattern, "expected UUID revision"));
|
|
15073
15335
|
var validUtc = (value) => {
|
|
15074
15336
|
const match = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,9}))?Z$/.exec(value);
|
|
15075
15337
|
if (!match)
|
|
@@ -15090,8 +15352,8 @@ var utcSchema = text.check((ctx) => {
|
|
|
15090
15352
|
});
|
|
15091
15353
|
});
|
|
15092
15354
|
var utc = utcSchema;
|
|
15093
|
-
var safeInteger = number2().int().
|
|
15094
|
-
var nonEmpty = text.
|
|
15355
|
+
var safeInteger = number2().check(int()).check(int());
|
|
15356
|
+
var nonEmpty = text.check(_minLength(1));
|
|
15095
15357
|
var pathValue = nonEmpty.check((ctx) => {
|
|
15096
15358
|
if (ctx.value !== "." && (ctx.value.includes("\\") || ctx.value.split("/").includes(".."))) {
|
|
15097
15359
|
ctx.issues.push({
|
|
@@ -15102,8 +15364,8 @@ var pathValue = nonEmpty.check((ctx) => {
|
|
|
15102
15364
|
});
|
|
15103
15365
|
}
|
|
15104
15366
|
});
|
|
15105
|
-
var nullableDigest =
|
|
15106
|
-
var nullableId =
|
|
15367
|
+
var nullableDigest = nullable(digest);
|
|
15368
|
+
var nullableId = nullable(id);
|
|
15107
15369
|
var hostSchema = _enum([
|
|
15108
15370
|
"opencode",
|
|
15109
15371
|
"cursor",
|
|
@@ -15115,11 +15377,11 @@ var hostSchema = _enum([
|
|
|
15115
15377
|
]);
|
|
15116
15378
|
var assuranceSchema = _enum(["enforced", "agent_guided", "unavailable"]);
|
|
15117
15379
|
var outcomeSchema = _enum(["verified", "accepted_limitations", "stopped"]);
|
|
15118
|
-
var scopeSchema =
|
|
15380
|
+
var scopeSchema = strictObject({
|
|
15119
15381
|
description: text,
|
|
15120
15382
|
paths: array(pathValue),
|
|
15121
15383
|
exclusions: array(pathValue)
|
|
15122
|
-
})
|
|
15384
|
+
});
|
|
15123
15385
|
var scopeGap = (outer, inner) => {
|
|
15124
15386
|
const strip = (value) => value.length > 1 ? value.replace(/\/+$/, "") : value;
|
|
15125
15387
|
const normOuter = {
|
|
@@ -15144,14 +15406,14 @@ var scopeGap = (outer, inner) => {
|
|
|
15144
15406
|
};
|
|
15145
15407
|
var scopeCovers = (outer, inner) => scopeGap(outer, inner) === null;
|
|
15146
15408
|
var refSchema = discriminatedUnion("kind", [
|
|
15147
|
-
|
|
15148
|
-
|
|
15409
|
+
strictObject({ kind: literal("file"), path: pathValue, digest: nullableDigest }),
|
|
15410
|
+
strictObject({
|
|
15149
15411
|
kind: literal("record"),
|
|
15150
15412
|
collection: _enum(["evidence", "decisions", "findings", "workers"]),
|
|
15151
15413
|
id
|
|
15152
|
-
})
|
|
15153
|
-
|
|
15154
|
-
|
|
15414
|
+
}),
|
|
15415
|
+
strictObject({ kind: literal("host"), host: hostSchema, handle: nonEmpty }),
|
|
15416
|
+
strictObject({ kind: literal("external"), url: text.check(url()) })
|
|
15155
15417
|
]);
|
|
15156
15418
|
var rewriteUnknown = (value, map) => {
|
|
15157
15419
|
if (Array.isArray(value)) {
|
|
@@ -15183,8 +15445,8 @@ var rewriteNode = (value, schema, map) => {
|
|
|
15183
15445
|
return mapped === null ? { drop: true } : { drop: false, value: mapped };
|
|
15184
15446
|
}
|
|
15185
15447
|
let node = schema;
|
|
15186
|
-
while (node instanceof ZodNullable || node instanceof ZodOptional || node instanceof ZodDefault) {
|
|
15187
|
-
node = node.
|
|
15448
|
+
while (node instanceof $ZodNullable || node instanceof $ZodOptional || node instanceof $ZodDefault) {
|
|
15449
|
+
node = node._zod.def.innerType;
|
|
15188
15450
|
}
|
|
15189
15451
|
if (node === refSchema) {
|
|
15190
15452
|
if (!refSchema.safeParse(value).success)
|
|
@@ -15192,21 +15454,21 @@ var rewriteNode = (value, schema, map) => {
|
|
|
15192
15454
|
const mapped = map(value);
|
|
15193
15455
|
return mapped === null ? { drop: true } : { drop: false, value: mapped };
|
|
15194
15456
|
}
|
|
15195
|
-
if (node instanceof ZodArray) {
|
|
15457
|
+
if (node instanceof $ZodArray) {
|
|
15196
15458
|
if (!Array.isArray(value))
|
|
15197
15459
|
return { drop: false, value };
|
|
15198
15460
|
const out = [];
|
|
15199
15461
|
for (const item of value) {
|
|
15200
|
-
const rewritten = rewriteNode(item, node.element, map);
|
|
15462
|
+
const rewritten = rewriteNode(item, node._zod.def.element, map);
|
|
15201
15463
|
if (!rewritten.drop)
|
|
15202
15464
|
out.push(rewritten.value);
|
|
15203
15465
|
}
|
|
15204
15466
|
return { drop: false, value: out };
|
|
15205
15467
|
}
|
|
15206
|
-
if (node instanceof ZodObject) {
|
|
15468
|
+
if (node instanceof $ZodObject) {
|
|
15207
15469
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
15208
15470
|
return { drop: false, value };
|
|
15209
|
-
const shape = node.shape;
|
|
15471
|
+
const shape = node._zod.def.shape;
|
|
15210
15472
|
const record = value;
|
|
15211
15473
|
const out = {};
|
|
15212
15474
|
for (const [key, item] of Object.entries(record)) {
|
|
@@ -15218,9 +15480,9 @@ var rewriteNode = (value, schema, map) => {
|
|
|
15218
15480
|
const child = shape[key];
|
|
15219
15481
|
const rewritten = rewriteNode(item, child, map);
|
|
15220
15482
|
if (rewritten.drop) {
|
|
15221
|
-
if (child instanceof ZodOptional || child instanceof ZodDefault)
|
|
15483
|
+
if (child instanceof $ZodOptional || child instanceof $ZodDefault)
|
|
15222
15484
|
continue;
|
|
15223
|
-
if (child instanceof ZodNullable) {
|
|
15485
|
+
if (child instanceof $ZodNullable) {
|
|
15224
15486
|
out[key] = null;
|
|
15225
15487
|
continue;
|
|
15226
15488
|
}
|
|
@@ -15236,34 +15498,34 @@ var rewriteRecordRefs = (value, schema, map) => {
|
|
|
15236
15498
|
const rewritten = rewriteNode(value, schema, map);
|
|
15237
15499
|
return rewritten.drop ? null : rewritten.value;
|
|
15238
15500
|
};
|
|
15239
|
-
var provenanceSchema =
|
|
15501
|
+
var provenanceSchema = strictObject({
|
|
15240
15502
|
kind: _enum(["host_observed", "agent_reported", "imported"]),
|
|
15241
15503
|
host: hostSchema,
|
|
15242
|
-
session:
|
|
15504
|
+
session: nullable(refSchema),
|
|
15243
15505
|
workerId: nullableId
|
|
15244
|
-
})
|
|
15245
|
-
var entrySchema = (data) =>
|
|
15506
|
+
});
|
|
15507
|
+
var entrySchema = (data) => strictObject({ id, recordedAt: utc, provenance: provenanceSchema, data });
|
|
15246
15508
|
var RISK_TIERS = ["trivial", "normal", "high"];
|
|
15247
|
-
var judgmentSchema =
|
|
15509
|
+
var judgmentSchema = strictObject({
|
|
15248
15510
|
riskTier: _enum(RISK_TIERS),
|
|
15249
15511
|
behaviorChange: boolean2(),
|
|
15250
15512
|
productChoiceOpen: boolean2(),
|
|
15251
15513
|
needsPlan: boolean2(),
|
|
15252
|
-
note:
|
|
15514
|
+
note: nullable(text),
|
|
15253
15515
|
refs: array(refSchema)
|
|
15254
|
-
})
|
|
15516
|
+
});
|
|
15255
15517
|
var legacyAssessmentSchema = looseObject({});
|
|
15256
|
-
var constraintSchema =
|
|
15518
|
+
var constraintSchema = strictObject({
|
|
15257
15519
|
id: nonEmpty,
|
|
15258
15520
|
kind: _enum(["host", "project", "user"]),
|
|
15259
15521
|
statement: text,
|
|
15260
15522
|
source: refSchema,
|
|
15261
15523
|
acceptanceAllowed: boolean2(),
|
|
15262
|
-
requires: array(
|
|
15524
|
+
requires: array(strictObject({
|
|
15263
15525
|
kind: _enum(["check", "method", "decision"]),
|
|
15264
15526
|
scope: scopeSchema,
|
|
15265
15527
|
refs: array(refSchema),
|
|
15266
|
-
method: _enum([
|
|
15528
|
+
method: nullable(_enum([
|
|
15267
15529
|
"investigation",
|
|
15268
15530
|
"challenge",
|
|
15269
15531
|
"artifacts",
|
|
@@ -15273,10 +15535,10 @@ var constraintSchema = object({
|
|
|
15273
15535
|
"delegation",
|
|
15274
15536
|
"continuity",
|
|
15275
15537
|
"decisions"
|
|
15276
|
-
])
|
|
15538
|
+
])),
|
|
15277
15539
|
before: _enum(["dependent_action", "write", "close"]),
|
|
15278
|
-
dependentAction:
|
|
15279
|
-
}).
|
|
15540
|
+
dependentAction: nullable(text)
|
|
15541
|
+
}).check((ctx) => {
|
|
15280
15542
|
const obligation = ctx.value;
|
|
15281
15543
|
const validMethod = obligation.kind === "method" && obligation.method !== null || obligation.kind !== "method" && obligation.method === null;
|
|
15282
15544
|
if (!validMethod)
|
|
@@ -15287,13 +15549,17 @@ var constraintSchema = object({
|
|
|
15287
15549
|
path: ["method"]
|
|
15288
15550
|
});
|
|
15289
15551
|
}))
|
|
15290
|
-
})
|
|
15291
|
-
var intentSchema =
|
|
15292
|
-
|
|
15552
|
+
});
|
|
15553
|
+
var intentSchema = strictObject({
|
|
15554
|
+
objective: text,
|
|
15555
|
+
scope: scopeSchema,
|
|
15556
|
+
authorityRefs: array(refSchema)
|
|
15557
|
+
});
|
|
15558
|
+
var progressSchema = strictObject({
|
|
15293
15559
|
summary: text,
|
|
15294
|
-
nextAction:
|
|
15295
|
-
blockers: array(
|
|
15296
|
-
})
|
|
15560
|
+
nextAction: nullable(text),
|
|
15561
|
+
blockers: array(strictObject({ reason: text, dependentAction: text, refs: array(refSchema) }))
|
|
15562
|
+
});
|
|
15297
15563
|
var dimensionSchema = _enum([
|
|
15298
15564
|
"investigation",
|
|
15299
15565
|
"challenge",
|
|
@@ -15305,10 +15571,10 @@ var dimensionSchema = _enum([
|
|
|
15305
15571
|
"continuity",
|
|
15306
15572
|
"decisions"
|
|
15307
15573
|
]);
|
|
15308
|
-
var policySchema =
|
|
15309
|
-
policyVersion: text.
|
|
15574
|
+
var policySchema = strictObject({
|
|
15575
|
+
policyVersion: text.check(_regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/)),
|
|
15310
15576
|
inputDigest: digest,
|
|
15311
|
-
requirements: array(
|
|
15577
|
+
requirements: array(strictObject({
|
|
15312
15578
|
id: digest,
|
|
15313
15579
|
ruleId: nonEmpty,
|
|
15314
15580
|
dimension: dimensionSchema,
|
|
@@ -15316,29 +15582,29 @@ var policySchema = object({
|
|
|
15316
15582
|
reason: text,
|
|
15317
15583
|
satisfaction: text,
|
|
15318
15584
|
before: _enum(["dependent_action", "write", "close"]),
|
|
15319
|
-
dependentAction:
|
|
15585
|
+
dependentAction: nullable(text),
|
|
15320
15586
|
acceptanceAllowed: boolean2()
|
|
15321
|
-
})
|
|
15322
|
-
})
|
|
15323
|
-
var requirementSchema = policySchema.shape.requirements.element;
|
|
15324
|
-
var policyChangeSchema =
|
|
15587
|
+
}))
|
|
15588
|
+
});
|
|
15589
|
+
var requirementSchema = policySchema.shape.requirements._zod.def.element;
|
|
15590
|
+
var policyChangeSchema = strictObject({
|
|
15325
15591
|
recordedAt: utc,
|
|
15326
15592
|
fromInputDigest: nullableDigest,
|
|
15327
15593
|
toInputDigest: digest,
|
|
15328
15594
|
added: array(digest),
|
|
15329
15595
|
retired: array(digest),
|
|
15330
15596
|
reason: text
|
|
15331
|
-
})
|
|
15332
|
-
var candidateSchema =
|
|
15597
|
+
});
|
|
15598
|
+
var candidateSchema = strictObject({
|
|
15333
15599
|
id: digest,
|
|
15334
15600
|
scope: scopeSchema,
|
|
15335
15601
|
completeness: _enum(["known", "uncertain"]),
|
|
15336
|
-
files: array(
|
|
15602
|
+
files: array(strictObject({
|
|
15337
15603
|
path: pathValue,
|
|
15338
15604
|
kind: _enum(["file", "symlink", "absent"]),
|
|
15339
15605
|
digest: nullableDigest,
|
|
15340
|
-
executable: boolean2()
|
|
15341
|
-
}).
|
|
15606
|
+
executable: nullable(boolean2())
|
|
15607
|
+
}).check((ctx) => {
|
|
15342
15608
|
const file = ctx.value;
|
|
15343
15609
|
const valid = file.kind === "absent" ? file.digest === null && file.executable === null : file.kind === "file" ? file.digest !== null && typeof file.executable === "boolean" : file.digest !== null && file.executable === null;
|
|
15344
15610
|
if (!valid)
|
|
@@ -15349,7 +15615,7 @@ var candidateSchema = object({
|
|
|
15349
15615
|
path: []
|
|
15350
15616
|
});
|
|
15351
15617
|
})),
|
|
15352
|
-
environment: array(
|
|
15618
|
+
environment: array(strictObject({ name: nonEmpty, value: nullable(text), refs: array(refSchema) })).check((ctx) => {
|
|
15353
15619
|
if (new Set(ctx.value.map((value) => value.name)).size !== ctx.value.length)
|
|
15354
15620
|
ctx.issues.push({
|
|
15355
15621
|
code: "custom",
|
|
@@ -15358,8 +15624,8 @@ var candidateSchema = object({
|
|
|
15358
15624
|
path: []
|
|
15359
15625
|
});
|
|
15360
15626
|
}),
|
|
15361
|
-
head:
|
|
15362
|
-
}).
|
|
15627
|
+
head: nullable(text)
|
|
15628
|
+
}).check((ctx) => {
|
|
15363
15629
|
if (ctx.value.id !== candidateDigest(ctx.value))
|
|
15364
15630
|
ctx.issues.push({
|
|
15365
15631
|
code: "custom",
|
|
@@ -15368,139 +15634,142 @@ var candidateSchema = object({
|
|
|
15368
15634
|
path: ["id"]
|
|
15369
15635
|
});
|
|
15370
15636
|
});
|
|
15371
|
-
var checkObservationSchema =
|
|
15637
|
+
var checkObservationSchema = strictObject({
|
|
15372
15638
|
observer: literal("workit_cli"),
|
|
15373
|
-
name:
|
|
15639
|
+
name: nullable(nonEmpty),
|
|
15374
15640
|
configured: boolean2(),
|
|
15375
|
-
argv: array(text).
|
|
15641
|
+
argv: array(text).check(_minLength(1)),
|
|
15376
15642
|
shell: boolean2(),
|
|
15377
15643
|
cwd: nonEmpty,
|
|
15378
15644
|
exitCode: safeInteger,
|
|
15379
|
-
durationMs: safeInteger.
|
|
15645
|
+
durationMs: safeInteger.check(_gte(0)),
|
|
15380
15646
|
timedOut: boolean2(),
|
|
15381
|
-
head:
|
|
15382
|
-
tree:
|
|
15383
|
-
dirty: boolean2()
|
|
15384
|
-
signal:
|
|
15385
|
-
treeAfter:
|
|
15647
|
+
head: nullable(text),
|
|
15648
|
+
tree: nullable(text),
|
|
15649
|
+
dirty: nullable(boolean2()),
|
|
15650
|
+
signal: nullable(text),
|
|
15651
|
+
treeAfter: nullable(text),
|
|
15386
15652
|
modifiedWorktree: boolean2(),
|
|
15387
|
-
base:
|
|
15388
|
-
patchId:
|
|
15389
|
-
environment:
|
|
15653
|
+
base: nullable(text),
|
|
15654
|
+
patchId: nullable(text),
|
|
15655
|
+
environment: strictObject({
|
|
15390
15656
|
platform: nonEmpty,
|
|
15391
15657
|
arch: nonEmpty,
|
|
15392
|
-
vars: record(nonEmpty,
|
|
15393
|
-
})
|
|
15394
|
-
logDigest:
|
|
15395
|
-
logRef:
|
|
15396
|
-
logTail: array(text).
|
|
15397
|
-
ledgerRowId:
|
|
15398
|
-
attestation:
|
|
15399
|
-
})
|
|
15658
|
+
vars: record(nonEmpty, nullable(text))
|
|
15659
|
+
}),
|
|
15660
|
+
logDigest: nullable(text),
|
|
15661
|
+
logRef: nullable(text),
|
|
15662
|
+
logTail: array(text).check(_maxLength(40)),
|
|
15663
|
+
ledgerRowId: nullable(text),
|
|
15664
|
+
attestation: nullable(strictObject({ host: nonEmpty, session: nullable(text), agentId: nullable(text) }))
|
|
15665
|
+
});
|
|
15400
15666
|
var CHECK_OBSERVATION_PATH = "evidence.*.data.observation";
|
|
15401
15667
|
var evidenceFields = {
|
|
15402
15668
|
kind: _enum(["check", "review", "investigation", "artifact"]),
|
|
15403
15669
|
claim: text,
|
|
15404
15670
|
requirementIds: array(digest),
|
|
15405
|
-
beforeCandidateId:
|
|
15406
|
-
candidateId:
|
|
15671
|
+
beforeCandidateId: optional(nullableDigest),
|
|
15672
|
+
candidateId: optional(nullableDigest),
|
|
15407
15673
|
result: _enum(["passed", "failed", "missing", "skipped"]),
|
|
15408
15674
|
summary: text,
|
|
15409
15675
|
refs: array(refSchema),
|
|
15410
|
-
exitCode:
|
|
15411
|
-
reviewContext:
|
|
15676
|
+
exitCode: nullable(safeInteger),
|
|
15677
|
+
reviewContext: nullable(refSchema)
|
|
15412
15678
|
};
|
|
15413
|
-
var evidenceSchema =
|
|
15414
|
-
|
|
15415
|
-
|
|
15679
|
+
var evidenceSchema = strictObject({
|
|
15680
|
+
...evidenceFields,
|
|
15681
|
+
observation: optional(checkObservationSchema)
|
|
15682
|
+
});
|
|
15683
|
+
var reportedEvidenceSchema = strictObject(evidenceFields);
|
|
15684
|
+
var evidenceEvaluationSchema = strictObject({
|
|
15416
15685
|
evidenceId: id,
|
|
15417
15686
|
status: _enum(["passed", "failed", "missing", "skipped", "stale"]),
|
|
15418
15687
|
reason: text
|
|
15419
|
-
})
|
|
15420
|
-
var decisionSchema =
|
|
15688
|
+
});
|
|
15689
|
+
var decisionSchema = strictObject({
|
|
15421
15690
|
purpose: _enum(["design", "action", "limitation", "preference"]),
|
|
15422
|
-
binding:
|
|
15691
|
+
binding: strictObject({
|
|
15423
15692
|
taskId: id,
|
|
15424
15693
|
workspaceId: id,
|
|
15425
15694
|
scope: scopeSchema,
|
|
15426
15695
|
presented: text,
|
|
15427
15696
|
contentRefs: array(refSchema),
|
|
15428
|
-
statedChoice:
|
|
15429
|
-
})
|
|
15697
|
+
statedChoice: optional(strictObject({ ref: text, text }))
|
|
15698
|
+
}),
|
|
15430
15699
|
digest,
|
|
15431
15700
|
response: _enum(["approved", "rejected", "stated"]),
|
|
15432
15701
|
requirementIds: array(digest),
|
|
15433
|
-
revoked:
|
|
15434
|
-
})
|
|
15435
|
-
var findingSchema =
|
|
15702
|
+
revoked: nullable(strictObject({ at: utc, reason: text }))
|
|
15703
|
+
});
|
|
15704
|
+
var findingSchema = strictObject({
|
|
15436
15705
|
claim: text,
|
|
15437
15706
|
consequence: text,
|
|
15438
15707
|
scope: scopeSchema,
|
|
15439
15708
|
candidateId: nullableDigest,
|
|
15440
15709
|
refs: array(refSchema),
|
|
15441
15710
|
disposition: _enum(["open", "fixed", "dismissed", "deferred"]),
|
|
15442
|
-
resolution:
|
|
15443
|
-
leadOwned: literal(true)
|
|
15444
|
-
})
|
|
15445
|
-
var assignmentSchema =
|
|
15711
|
+
resolution: nullable(strictObject({ reason: text, evidenceIds: array(id), decisionIds: array(id) })),
|
|
15712
|
+
leadOwned: optional(literal(true))
|
|
15713
|
+
});
|
|
15714
|
+
var assignmentSchema = strictObject({
|
|
15446
15715
|
role: _enum(["investigator", "reviewer", "implementer"]),
|
|
15447
15716
|
objective: text,
|
|
15448
15717
|
scope: scopeSchema,
|
|
15449
15718
|
decisionIds: array(id),
|
|
15450
15719
|
requirementIds: array(digest),
|
|
15451
|
-
candidateId:
|
|
15720
|
+
candidateId: optional(nullableDigest),
|
|
15452
15721
|
stoppingCondition: text
|
|
15453
|
-
})
|
|
15454
|
-
var workerReportSchema =
|
|
15722
|
+
});
|
|
15723
|
+
var workerReportSchema = strictObject({
|
|
15455
15724
|
outcome: _enum(["completed", "failed", "cancelled"]),
|
|
15456
15725
|
summary: text,
|
|
15457
15726
|
evidenceIds: array(id),
|
|
15458
15727
|
findingIds: array(idRef)
|
|
15459
|
-
})
|
|
15460
|
-
var workerSchema =
|
|
15728
|
+
});
|
|
15729
|
+
var workerSchema = strictObject({
|
|
15461
15730
|
assignment: assignmentSchema,
|
|
15462
15731
|
state: _enum(["assigned", "dispatching", "running", "cancelling", "stopped", "unknown"]),
|
|
15463
|
-
session:
|
|
15464
|
-
coordinator:
|
|
15465
|
-
report:
|
|
15466
|
-
})
|
|
15467
|
-
var closureSchema =
|
|
15732
|
+
session: nullable(refSchema),
|
|
15733
|
+
coordinator: optional(refSchema),
|
|
15734
|
+
report: nullable(workerReportSchema)
|
|
15735
|
+
});
|
|
15736
|
+
var closureSchema = strictObject({
|
|
15468
15737
|
outcome: outcomeSchema,
|
|
15469
15738
|
at: utc,
|
|
15470
15739
|
summary: text,
|
|
15471
15740
|
decisionIds: array(id),
|
|
15472
15741
|
evidenceIds: array(id)
|
|
15473
|
-
})
|
|
15474
|
-
var runtimeSchema =
|
|
15475
|
-
createdWith:
|
|
15742
|
+
});
|
|
15743
|
+
var runtimeSchema = strictObject({
|
|
15744
|
+
createdWith: nullable(text),
|
|
15476
15745
|
updatedWith: text
|
|
15477
|
-
})
|
|
15478
|
-
var taskRecordSchema =
|
|
15746
|
+
});
|
|
15747
|
+
var taskRecordSchema = strictObject({
|
|
15479
15748
|
schemaVersion: literal(1),
|
|
15480
15749
|
id,
|
|
15481
15750
|
workspaceId: id,
|
|
15482
15751
|
revision,
|
|
15483
15752
|
createdAt: utc,
|
|
15484
15753
|
updatedAt: utc,
|
|
15485
|
-
origin:
|
|
15754
|
+
origin: nullable(strictObject({ workspaceId: id, taskId: id, exportDigest: digest })),
|
|
15486
15755
|
intent: entrySchema(intentSchema),
|
|
15487
15756
|
constraints: array(constraintSchema),
|
|
15488
15757
|
status: _enum(["active", "paused", "closed"]),
|
|
15489
|
-
closure:
|
|
15758
|
+
closure: nullable(closureSchema),
|
|
15490
15759
|
progress: progressSchema,
|
|
15491
|
-
pauseReason:
|
|
15492
|
-
runtime:
|
|
15760
|
+
pauseReason: optional(nullable(text)),
|
|
15761
|
+
runtime: optional(runtimeSchema),
|
|
15493
15762
|
assessments: array(entrySchema(legacyAssessmentSchema)),
|
|
15494
|
-
judgments: array(entrySchema(judgmentSchema))
|
|
15495
|
-
policy:
|
|
15763
|
+
judgments: optional(array(entrySchema(judgmentSchema))),
|
|
15764
|
+
policy: nullable(policySchema),
|
|
15496
15765
|
policyChanges: array(policyChangeSchema),
|
|
15497
15766
|
candidates: array(candidateSchema),
|
|
15498
15767
|
evidence: array(entrySchema(evidenceSchema)),
|
|
15499
15768
|
decisions: array(entrySchema(decisionSchema)),
|
|
15500
15769
|
findings: array(entrySchema(findingSchema)),
|
|
15501
15770
|
workers: array(entrySchema(workerSchema)),
|
|
15502
|
-
critical: array(nonEmpty)
|
|
15503
|
-
})
|
|
15771
|
+
critical: optional(array(nonEmpty))
|
|
15772
|
+
});
|
|
15504
15773
|
var stripCount = (strips) => strips.reduce((sum, strip) => sum + strip.keys.length, 0);
|
|
15505
15774
|
var strippable = (issues, prefix = []) => {
|
|
15506
15775
|
const strips = [];
|
|
@@ -15554,117 +15823,224 @@ var parseStoredRecord = (schema, value) => {
|
|
|
15554
15823
|
return { ...first, critical };
|
|
15555
15824
|
return { success: true, data: parsed.data, stripped: [...new Set(stripped)] };
|
|
15556
15825
|
};
|
|
15557
|
-
var workspaceRecordSchema =
|
|
15826
|
+
var workspaceRecordSchema = strictObject({
|
|
15558
15827
|
schemaVersion: literal(1),
|
|
15559
15828
|
id,
|
|
15560
15829
|
revision,
|
|
15561
15830
|
root: nonEmpty,
|
|
15562
|
-
runtime:
|
|
15563
|
-
critical: array(nonEmpty)
|
|
15564
|
-
})
|
|
15565
|
-
var capabilitySchema =
|
|
15831
|
+
runtime: optional(runtimeSchema),
|
|
15832
|
+
critical: optional(array(nonEmpty))
|
|
15833
|
+
});
|
|
15834
|
+
var capabilitySchema = strictObject({
|
|
15566
15835
|
name: nonEmpty,
|
|
15567
15836
|
surface: nonEmpty,
|
|
15568
15837
|
assurance: assuranceSchema,
|
|
15569
15838
|
reason: text,
|
|
15570
15839
|
refs: array(refSchema)
|
|
15571
|
-
})
|
|
15572
|
-
var requirementEvaluationSchema =
|
|
15840
|
+
});
|
|
15841
|
+
var requirementEvaluationSchema = strictObject({
|
|
15573
15842
|
requirementId: digest,
|
|
15574
15843
|
status: _enum(["satisfied", "unsatisfied", "accepted_limitation", "unavailable"]),
|
|
15575
15844
|
evidenceIds: array(id),
|
|
15576
15845
|
decisionIds: array(id),
|
|
15577
15846
|
reason: text
|
|
15578
|
-
})
|
|
15579
|
-
var taskViewSchema =
|
|
15847
|
+
});
|
|
15848
|
+
var taskViewSchema = strictObject({
|
|
15580
15849
|
task: taskRecordSchema,
|
|
15581
15850
|
workspace: workspaceRecordSchema,
|
|
15582
15851
|
capabilities: array(capabilitySchema),
|
|
15583
15852
|
requirements: array(requirementEvaluationSchema),
|
|
15584
15853
|
evidence: array(evidenceEvaluationSchema)
|
|
15585
|
-
})
|
|
15586
|
-
var taskSummarySchema =
|
|
15854
|
+
});
|
|
15855
|
+
var taskSummarySchema = strictObject({
|
|
15587
15856
|
id,
|
|
15588
15857
|
revision,
|
|
15589
15858
|
workspaceRevision: revision,
|
|
15590
15859
|
createdAt: utc,
|
|
15591
15860
|
updatedAt: utc,
|
|
15592
|
-
runtime:
|
|
15861
|
+
runtime: nullable(runtimeSchema),
|
|
15593
15862
|
objective: text,
|
|
15594
15863
|
status: _enum(["active", "paused", "closed"]),
|
|
15595
|
-
closure:
|
|
15864
|
+
closure: nullable(closureSchema),
|
|
15596
15865
|
progress: progressSchema,
|
|
15597
|
-
policy:
|
|
15866
|
+
policy: nullable(policySchema),
|
|
15598
15867
|
requirements: array(requirementEvaluationSchema)
|
|
15599
|
-
})
|
|
15600
|
-
var taskListItemSchema = taskSummarySchema
|
|
15601
|
-
var exportBundleSchema =
|
|
15868
|
+
});
|
|
15869
|
+
var taskListItemSchema = extend2(omit2(taskSummarySchema, { policy: true, requirements: true }), { source: pick2(provenanceSchema, { host: true, kind: true }) });
|
|
15870
|
+
var exportBundleSchema = strictObject({
|
|
15602
15871
|
schemaVersion: literal(1),
|
|
15603
15872
|
exportedAt: utc,
|
|
15604
15873
|
sourceWorkspaceId: id,
|
|
15605
15874
|
task: taskRecordSchema,
|
|
15606
15875
|
digest
|
|
15607
|
-
})
|
|
15608
|
-
var callerSchema =
|
|
15876
|
+
});
|
|
15877
|
+
var callerSchema = strictObject({ host: hostSchema, actor: text });
|
|
15878
|
+
var success = (revisionValue, workspaceRevisionValue, data) => ({
|
|
15879
|
+
ok: true,
|
|
15880
|
+
schemaVersion: 1,
|
|
15881
|
+
revision: revisionValue,
|
|
15882
|
+
workspaceRevision: workspaceRevisionValue,
|
|
15883
|
+
data
|
|
15884
|
+
});
|
|
15885
|
+
var failure2 = (code, error, details = {}) => ({ ok: false, schemaVersion: 1, code, error, details });
|
|
15886
|
+
function resolveIdRef(kind, ref, ids) {
|
|
15887
|
+
if (ids.includes(ref))
|
|
15888
|
+
return success(null, null, ref);
|
|
15889
|
+
const matches = ids.filter((candidate) => candidate.startsWith(ref));
|
|
15890
|
+
if (matches.length === 1)
|
|
15891
|
+
return success(null, null, matches[0]);
|
|
15892
|
+
if (matches.length === 0)
|
|
15893
|
+
return failure2("not_found", `${kind} not found`);
|
|
15894
|
+
return failure2("invalid_input", `${kind} prefix ${ref} is ambiguous; candidates: ${matches.join(", ")}`);
|
|
15895
|
+
}
|
|
15896
|
+
function canonical(value, seen) {
|
|
15897
|
+
if (value === null || typeof value === "boolean" || typeof value === "string") {
|
|
15898
|
+
if (typeof value === "string" && invalidUnicode(value))
|
|
15899
|
+
throw new TypeError("invalid Unicode");
|
|
15900
|
+
return value;
|
|
15901
|
+
}
|
|
15902
|
+
if (typeof value === "number") {
|
|
15903
|
+
if (!Number.isSafeInteger(value))
|
|
15904
|
+
throw new TypeError("number must be a finite safe integer");
|
|
15905
|
+
return value;
|
|
15906
|
+
}
|
|
15907
|
+
if (typeof value !== "object")
|
|
15908
|
+
throw new TypeError("value is not JSON serializable");
|
|
15909
|
+
if (seen.has(value))
|
|
15910
|
+
throw new TypeError("cyclic value");
|
|
15911
|
+
seen.add(value);
|
|
15912
|
+
let result;
|
|
15913
|
+
if (Array.isArray(value)) {
|
|
15914
|
+
for (let index = 0;index < value.length; index += 1) {
|
|
15915
|
+
if (!(index in value))
|
|
15916
|
+
throw new TypeError("sparse array");
|
|
15917
|
+
}
|
|
15918
|
+
result = value.map((item) => canonical(item, seen));
|
|
15919
|
+
} else {
|
|
15920
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)
|
|
15921
|
+
throw new TypeError("value is not a JSON object");
|
|
15922
|
+
if (Reflect.ownKeys(value).some((key) => typeof key !== "string"))
|
|
15923
|
+
throw new TypeError("symbol key is not JSON");
|
|
15924
|
+
if (Object.keys(value).some((key) => invalidUnicode(key)))
|
|
15925
|
+
throw new TypeError("invalid Unicode");
|
|
15926
|
+
result = Object.fromEntries(Object.keys(value).toSorted().map((key) => [key, canonical(value[key], seen)]));
|
|
15927
|
+
}
|
|
15928
|
+
seen.delete(value);
|
|
15929
|
+
return result;
|
|
15930
|
+
}
|
|
15931
|
+
function canonicalJson(value) {
|
|
15932
|
+
return JSON.stringify(canonical(value, new Set));
|
|
15933
|
+
}
|
|
15934
|
+
function sha256(value) {
|
|
15935
|
+
if (typeof value === "string" && invalidUnicode(value))
|
|
15936
|
+
throw new TypeError("invalid Unicode");
|
|
15937
|
+
return createHash("sha256").update(typeof value === "string" ? value : canonicalJson(value), "utf8").digest("hex");
|
|
15938
|
+
}
|
|
15939
|
+
function newId() {
|
|
15940
|
+
return randomUUID().toLowerCase();
|
|
15941
|
+
}
|
|
15942
|
+
function newRevision() {
|
|
15943
|
+
return randomUUID().toLowerCase();
|
|
15944
|
+
}
|
|
15945
|
+
var compareCodeUnits = (left, right) => {
|
|
15946
|
+
const length = Math.min(left.length, right.length);
|
|
15947
|
+
for (let index = 0;index < length; index += 1) {
|
|
15948
|
+
const difference = left.charCodeAt(index) - right.charCodeAt(index);
|
|
15949
|
+
if (difference !== 0)
|
|
15950
|
+
return difference;
|
|
15951
|
+
}
|
|
15952
|
+
return left.length - right.length;
|
|
15953
|
+
};
|
|
15954
|
+
var compareNullableText = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : compareCodeUnits(left, right);
|
|
15955
|
+
var compareBooleanNullable = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : Number(left) - Number(right);
|
|
15956
|
+
function decisionDigest(input) {
|
|
15957
|
+
const { digest: _ignored, revoked: _revoked, ...value } = input;
|
|
15958
|
+
return sha256(value);
|
|
15959
|
+
}
|
|
15960
|
+
function candidateDigest(input) {
|
|
15961
|
+
const normalizedScope = {
|
|
15962
|
+
description: input.scope.description,
|
|
15963
|
+
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
15964
|
+
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
15965
|
+
};
|
|
15966
|
+
return sha256({
|
|
15967
|
+
scope: normalizedScope,
|
|
15968
|
+
completeness: input.completeness,
|
|
15969
|
+
files: [...input.files].toSorted((left, right) => compareCodeUnits(left.path, right.path) || compareCodeUnits(left.kind, right.kind) || compareNullableText(left.digest, right.digest) || compareBooleanNullable(left.executable, right.executable)),
|
|
15970
|
+
environment: input.environment.map(({ name, value }) => ({ name, value })).toSorted((left, right) => compareCodeUnits(left.name, right.name) || compareNullableText(left.value, right.value)),
|
|
15971
|
+
head: input.head
|
|
15972
|
+
});
|
|
15973
|
+
}
|
|
15974
|
+
function requirementId(input) {
|
|
15975
|
+
return sha256({
|
|
15976
|
+
...input,
|
|
15977
|
+
scope: {
|
|
15978
|
+
description: input.scope.description,
|
|
15979
|
+
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
15980
|
+
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
15981
|
+
}
|
|
15982
|
+
});
|
|
15983
|
+
}
|
|
15984
|
+
// packages/workit-core/src/core/operations.ts
|
|
15609
15985
|
var base = { schemaVersion: literal(1) };
|
|
15610
15986
|
var revisions = {
|
|
15611
|
-
expectedRevision:
|
|
15612
|
-
expectedWorkspaceRevision:
|
|
15987
|
+
expectedRevision: optional(revision),
|
|
15988
|
+
expectedWorkspaceRevision: optional(revision)
|
|
15613
15989
|
};
|
|
15614
15990
|
var taskId = { taskId: id };
|
|
15615
|
-
var operation = (shape) =>
|
|
15991
|
+
var operation = (shape) => strictObject({ ...base, ...shape });
|
|
15616
15992
|
var taskOperations = {
|
|
15617
15993
|
start: operation({
|
|
15618
15994
|
action: literal("start"),
|
|
15619
|
-
expectedWorkspaceRevision:
|
|
15995
|
+
expectedWorkspaceRevision: optional(nullable(revision)),
|
|
15620
15996
|
intent: intentSchema
|
|
15621
15997
|
}),
|
|
15622
15998
|
list: operation({
|
|
15623
15999
|
action: literal("list"),
|
|
15624
|
-
status: _enum(["open", "closed", "all"])
|
|
15625
|
-
query: string2().
|
|
15626
|
-
limit: number2().int().
|
|
16000
|
+
status: optional(_enum(["open", "closed", "all"])),
|
|
16001
|
+
query: optional(string2().check(_trim()).check(_minLength(1)).check(_maxLength(200))),
|
|
16002
|
+
limit: optional(number2().check(int()).check(_gte(1)).check(_lte(50)))
|
|
15627
16003
|
}),
|
|
15628
16004
|
inspect: operation({
|
|
15629
16005
|
action: literal("inspect"),
|
|
15630
16006
|
...taskId,
|
|
15631
|
-
view: _enum(["summary", "full"])
|
|
16007
|
+
view: optional(_enum(["summary", "full"]))
|
|
15632
16008
|
}),
|
|
15633
16009
|
revise: operation({
|
|
15634
16010
|
action: literal("revise"),
|
|
15635
16011
|
...taskId,
|
|
15636
16012
|
...revisions,
|
|
15637
|
-
expectedWorkspaceRevision:
|
|
16013
|
+
expectedWorkspaceRevision: optional(revision),
|
|
15638
16014
|
intent: intentSchema,
|
|
15639
16015
|
reason: text
|
|
15640
16016
|
}),
|
|
15641
16017
|
progress: operation({
|
|
15642
16018
|
action: literal("progress"),
|
|
15643
16019
|
...taskId,
|
|
15644
|
-
expectedRevision:
|
|
16020
|
+
expectedRevision: optional(revision),
|
|
15645
16021
|
progress: progressSchema
|
|
15646
16022
|
}),
|
|
15647
16023
|
pause: operation({
|
|
15648
16024
|
action: literal("pause"),
|
|
15649
16025
|
...taskId,
|
|
15650
16026
|
...revisions,
|
|
15651
|
-
expectedWorkspaceRevision:
|
|
16027
|
+
expectedWorkspaceRevision: optional(revision),
|
|
15652
16028
|
reason: text
|
|
15653
16029
|
}),
|
|
15654
16030
|
resume: operation({
|
|
15655
16031
|
action: literal("resume"),
|
|
15656
16032
|
...taskId,
|
|
15657
16033
|
...revisions,
|
|
15658
|
-
expectedWorkspaceRevision:
|
|
16034
|
+
expectedWorkspaceRevision: optional(revision)
|
|
15659
16035
|
}),
|
|
15660
16036
|
close: operation({
|
|
15661
16037
|
action: literal("close"),
|
|
15662
16038
|
...taskId,
|
|
15663
16039
|
...revisions,
|
|
15664
|
-
expectedWorkspaceRevision:
|
|
16040
|
+
expectedWorkspaceRevision: optional(revision),
|
|
15665
16041
|
outcome: outcomeSchema,
|
|
15666
16042
|
summary: text,
|
|
15667
|
-
decisionIds: array(id)
|
|
16043
|
+
decisionIds: optional(array(id))
|
|
15668
16044
|
})
|
|
15669
16045
|
};
|
|
15670
16046
|
var rawJudgment = record(string2(), unknown());
|
|
@@ -15672,7 +16048,7 @@ var policyOperations = {
|
|
|
15672
16048
|
assess: operation({
|
|
15673
16049
|
action: literal("assess"),
|
|
15674
16050
|
...taskId,
|
|
15675
|
-
expectedRevision:
|
|
16051
|
+
expectedRevision: optional(revision),
|
|
15676
16052
|
judgment: rawJudgment
|
|
15677
16053
|
}),
|
|
15678
16054
|
preview: operation({ action: literal("preview"), ...taskId, judgment: rawJudgment }),
|
|
@@ -15682,7 +16058,7 @@ var evidenceOperations = {
|
|
|
15682
16058
|
record: operation({
|
|
15683
16059
|
action: literal("record"),
|
|
15684
16060
|
...taskId,
|
|
15685
|
-
expectedRevision:
|
|
16061
|
+
expectedRevision: optional(revision),
|
|
15686
16062
|
evidence: reportedEvidenceSchema
|
|
15687
16063
|
})
|
|
15688
16064
|
};
|
|
@@ -15690,17 +16066,17 @@ var findingOperations = {
|
|
|
15690
16066
|
record: operation({
|
|
15691
16067
|
action: literal("record"),
|
|
15692
16068
|
...taskId,
|
|
15693
|
-
expectedRevision:
|
|
16069
|
+
expectedRevision: optional(revision),
|
|
15694
16070
|
claim: text,
|
|
15695
16071
|
consequence: text,
|
|
15696
16072
|
scope: scopeSchema,
|
|
15697
|
-
candidateId:
|
|
16073
|
+
candidateId: optional(nullableDigest),
|
|
15698
16074
|
refs: array(refSchema)
|
|
15699
16075
|
}),
|
|
15700
16076
|
resolve: operation({
|
|
15701
16077
|
action: literal("resolve"),
|
|
15702
16078
|
...taskId,
|
|
15703
|
-
expectedRevision:
|
|
16079
|
+
expectedRevision: optional(revision),
|
|
15704
16080
|
findingId: idRef,
|
|
15705
16081
|
disposition: _enum(["open", "fixed", "dismissed", "deferred"]),
|
|
15706
16082
|
reason: text,
|
|
@@ -15712,11 +16088,11 @@ var decisionOperations = {
|
|
|
15712
16088
|
record: operation({
|
|
15713
16089
|
action: literal("record"),
|
|
15714
16090
|
...taskId,
|
|
15715
|
-
expectedRevision:
|
|
16091
|
+
expectedRevision: optional(revision),
|
|
15716
16092
|
purpose: decisionSchema.shape.purpose,
|
|
15717
|
-
binding: decisionSchema.shape.binding
|
|
15718
|
-
taskId:
|
|
15719
|
-
workspaceId:
|
|
16093
|
+
binding: extend2(decisionSchema.shape.binding, {
|
|
16094
|
+
taskId: optional(id),
|
|
16095
|
+
workspaceId: optional(id)
|
|
15720
16096
|
}),
|
|
15721
16097
|
response: decisionSchema.shape.response,
|
|
15722
16098
|
requirementIds: array(digest)
|
|
@@ -15724,7 +16100,7 @@ var decisionOperations = {
|
|
|
15724
16100
|
revoke: operation({
|
|
15725
16101
|
action: literal("revoke"),
|
|
15726
16102
|
...taskId,
|
|
15727
|
-
expectedRevision:
|
|
16103
|
+
expectedRevision: optional(revision),
|
|
15728
16104
|
decisionId: id,
|
|
15729
16105
|
reason: text
|
|
15730
16106
|
})
|
|
@@ -15734,14 +16110,14 @@ var workerOperations = {
|
|
|
15734
16110
|
action: literal("assign"),
|
|
15735
16111
|
...taskId,
|
|
15736
16112
|
...revisions,
|
|
15737
|
-
expectedWorkspaceRevision:
|
|
16113
|
+
expectedWorkspaceRevision: optional(revision),
|
|
15738
16114
|
assignment: assignmentSchema
|
|
15739
16115
|
}),
|
|
15740
16116
|
report: operation({
|
|
15741
16117
|
action: literal("report"),
|
|
15742
16118
|
...taskId,
|
|
15743
|
-
expectedRevision:
|
|
15744
|
-
expectedWorkspaceRevision:
|
|
16119
|
+
expectedRevision: optional(revision),
|
|
16120
|
+
expectedWorkspaceRevision: optional(revision),
|
|
15745
16121
|
workerId: idRef,
|
|
15746
16122
|
report: workerReportSchema
|
|
15747
16123
|
}),
|
|
@@ -15749,7 +16125,7 @@ var workerOperations = {
|
|
|
15749
16125
|
action: literal("cancel"),
|
|
15750
16126
|
...taskId,
|
|
15751
16127
|
...revisions,
|
|
15752
|
-
expectedWorkspaceRevision:
|
|
16128
|
+
expectedWorkspaceRevision: optional(revision),
|
|
15753
16129
|
workerId: idRef,
|
|
15754
16130
|
reason: text
|
|
15755
16131
|
})
|
|
@@ -15758,7 +16134,7 @@ var stateOperations = {
|
|
|
15758
16134
|
export: operation({ action: literal("export"), ...taskId }),
|
|
15759
16135
|
import: operation({
|
|
15760
16136
|
action: literal("import"),
|
|
15761
|
-
expectedWorkspaceRevision:
|
|
16137
|
+
expectedWorkspaceRevision: optional(nullable(revision)),
|
|
15762
16138
|
bundle: exportBundleSchema
|
|
15763
16139
|
})
|
|
15764
16140
|
};
|
|
@@ -15780,7 +16156,7 @@ var OPERATION_ACTIONS = {
|
|
|
15780
16156
|
worker: Object.keys(workerOperations),
|
|
15781
16157
|
state: Object.keys(stateOperations)
|
|
15782
16158
|
};
|
|
15783
|
-
var withImplicitTask = (options) => Object.values(options).map((option) => ("taskId" in option.shape) ? option
|
|
16159
|
+
var withImplicitTask = (options) => Object.values(options).map((option) => ("taskId" in option.shape) ? extend2(option, { taskId: optional(id) }) : option);
|
|
15784
16160
|
var advertised = (options) => discriminatedUnion("action", withImplicitTask(options));
|
|
15785
16161
|
var advertisedOperationSchemas = {
|
|
15786
16162
|
task: advertised(taskOperations),
|
|
@@ -15791,24 +16167,6 @@ var advertisedOperationSchemas = {
|
|
|
15791
16167
|
worker: advertised(workerOperations),
|
|
15792
16168
|
state: advertised(stateOperations)
|
|
15793
16169
|
};
|
|
15794
|
-
var success = (revisionValue, workspaceRevisionValue, data) => ({
|
|
15795
|
-
ok: true,
|
|
15796
|
-
schemaVersion: 1,
|
|
15797
|
-
revision: revisionValue,
|
|
15798
|
-
workspaceRevision: workspaceRevisionValue,
|
|
15799
|
-
data
|
|
15800
|
-
});
|
|
15801
|
-
var failure2 = (code, error, details = {}) => ({ ok: false, schemaVersion: 1, code, error, details });
|
|
15802
|
-
function resolveIdRef(kind, ref, ids) {
|
|
15803
|
-
if (ids.includes(ref))
|
|
15804
|
-
return success(null, null, ref);
|
|
15805
|
-
const matches = ids.filter((candidate) => candidate.startsWith(ref));
|
|
15806
|
-
if (matches.length === 1)
|
|
15807
|
-
return success(null, null, matches[0]);
|
|
15808
|
-
if (matches.length === 0)
|
|
15809
|
-
return failure2("not_found", `${kind} not found`);
|
|
15810
|
-
return failure2("invalid_input", `${kind} prefix ${ref} is ambiguous; candidates: ${matches.join(", ")}`);
|
|
15811
|
-
}
|
|
15812
16170
|
function parseOperation(family, input) {
|
|
15813
16171
|
if (typeof input === "object" && input !== null && "schemaVersion" in input && input.schemaVersion !== SCHEMA_VERSION)
|
|
15814
16172
|
return failure2("unsupported_version", "unsupported schema version", { operation: family });
|
|
@@ -15821,94 +16179,6 @@ function parseOperation(family, input) {
|
|
|
15821
16179
|
}));
|
|
15822
16180
|
return failure2("invalid_input", "operation input is invalid", { fields });
|
|
15823
16181
|
}
|
|
15824
|
-
function canonical(value, seen) {
|
|
15825
|
-
if (value === null || typeof value === "boolean" || typeof value === "string") {
|
|
15826
|
-
if (typeof value === "string" && invalidUnicode(value))
|
|
15827
|
-
throw new TypeError("invalid Unicode");
|
|
15828
|
-
return value;
|
|
15829
|
-
}
|
|
15830
|
-
if (typeof value === "number") {
|
|
15831
|
-
if (!Number.isSafeInteger(value))
|
|
15832
|
-
throw new TypeError("number must be a finite safe integer");
|
|
15833
|
-
return value;
|
|
15834
|
-
}
|
|
15835
|
-
if (typeof value !== "object")
|
|
15836
|
-
throw new TypeError("value is not JSON serializable");
|
|
15837
|
-
if (seen.has(value))
|
|
15838
|
-
throw new TypeError("cyclic value");
|
|
15839
|
-
seen.add(value);
|
|
15840
|
-
let result;
|
|
15841
|
-
if (Array.isArray(value)) {
|
|
15842
|
-
for (let index = 0;index < value.length; index += 1) {
|
|
15843
|
-
if (!(index in value))
|
|
15844
|
-
throw new TypeError("sparse array");
|
|
15845
|
-
}
|
|
15846
|
-
result = value.map((item) => canonical(item, seen));
|
|
15847
|
-
} else {
|
|
15848
|
-
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)
|
|
15849
|
-
throw new TypeError("value is not a JSON object");
|
|
15850
|
-
if (Reflect.ownKeys(value).some((key) => typeof key !== "string"))
|
|
15851
|
-
throw new TypeError("symbol key is not JSON");
|
|
15852
|
-
if (Object.keys(value).some((key) => invalidUnicode(key)))
|
|
15853
|
-
throw new TypeError("invalid Unicode");
|
|
15854
|
-
result = Object.fromEntries(Object.keys(value).toSorted().map((key) => [key, canonical(value[key], seen)]));
|
|
15855
|
-
}
|
|
15856
|
-
seen.delete(value);
|
|
15857
|
-
return result;
|
|
15858
|
-
}
|
|
15859
|
-
function canonicalJson(value) {
|
|
15860
|
-
return JSON.stringify(canonical(value, new Set));
|
|
15861
|
-
}
|
|
15862
|
-
function sha256(value) {
|
|
15863
|
-
if (typeof value === "string" && invalidUnicode(value))
|
|
15864
|
-
throw new TypeError("invalid Unicode");
|
|
15865
|
-
return createHash("sha256").update(typeof value === "string" ? value : canonicalJson(value), "utf8").digest("hex");
|
|
15866
|
-
}
|
|
15867
|
-
function newId() {
|
|
15868
|
-
return randomUUID().toLowerCase();
|
|
15869
|
-
}
|
|
15870
|
-
function newRevision() {
|
|
15871
|
-
return randomUUID().toLowerCase();
|
|
15872
|
-
}
|
|
15873
|
-
var compareCodeUnits = (left, right) => {
|
|
15874
|
-
const length = Math.min(left.length, right.length);
|
|
15875
|
-
for (let index = 0;index < length; index += 1) {
|
|
15876
|
-
const difference = left.charCodeAt(index) - right.charCodeAt(index);
|
|
15877
|
-
if (difference !== 0)
|
|
15878
|
-
return difference;
|
|
15879
|
-
}
|
|
15880
|
-
return left.length - right.length;
|
|
15881
|
-
};
|
|
15882
|
-
var compareNullableText = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : compareCodeUnits(left, right);
|
|
15883
|
-
var compareBooleanNullable = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : Number(left) - Number(right);
|
|
15884
|
-
function decisionDigest(input) {
|
|
15885
|
-
const { digest: _ignored, revoked: _revoked, ...value } = input;
|
|
15886
|
-
return sha256(value);
|
|
15887
|
-
}
|
|
15888
|
-
function candidateDigest(input) {
|
|
15889
|
-
const normalizedScope = {
|
|
15890
|
-
description: input.scope.description,
|
|
15891
|
-
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
15892
|
-
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
15893
|
-
};
|
|
15894
|
-
return sha256({
|
|
15895
|
-
scope: normalizedScope,
|
|
15896
|
-
completeness: input.completeness,
|
|
15897
|
-
files: [...input.files].toSorted((left, right) => compareCodeUnits(left.path, right.path) || compareCodeUnits(left.kind, right.kind) || compareNullableText(left.digest, right.digest) || compareBooleanNullable(left.executable, right.executable)),
|
|
15898
|
-
environment: input.environment.map(({ name, value }) => ({ name, value })).toSorted((left, right) => compareCodeUnits(left.name, right.name) || compareNullableText(left.value, right.value)),
|
|
15899
|
-
head: input.head
|
|
15900
|
-
});
|
|
15901
|
-
}
|
|
15902
|
-
function requirementId(input) {
|
|
15903
|
-
return sha256({
|
|
15904
|
-
...input,
|
|
15905
|
-
scope: {
|
|
15906
|
-
description: input.scope.description,
|
|
15907
|
-
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
15908
|
-
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
15909
|
-
}
|
|
15910
|
-
});
|
|
15911
|
-
}
|
|
15912
16182
|
// packages/workit-core/src/core/operation-input.ts
|
|
15913
16183
|
var str = (d, values) => ({
|
|
15914
16184
|
type: "string",
|
|
@@ -15917,7 +16187,7 @@ var str = (d, values) => ({
|
|
|
15917
16187
|
});
|
|
15918
16188
|
var list = (d) => ({ type: "array", ...d ? { d } : {} });
|
|
15919
16189
|
var bool = (d) => ({ type: "boolean", ...d ? { d } : {} });
|
|
15920
|
-
var
|
|
16190
|
+
var int3 = (d) => ({ type: "integer", ...d ? { d } : {} });
|
|
15921
16191
|
var scopeFields = {
|
|
15922
16192
|
paths: list("Scope paths (default: whole checkout)."),
|
|
15923
16193
|
exclusions: list(),
|
|
@@ -15938,7 +16208,7 @@ var FLAT = {
|
|
|
15938
16208
|
decisionIds: list(),
|
|
15939
16209
|
status: str(undefined, ["open", "closed", "all"]),
|
|
15940
16210
|
query: str(),
|
|
15941
|
-
limit:
|
|
16211
|
+
limit: int3(),
|
|
15942
16212
|
view: str(undefined, ["summary", "full"])
|
|
15943
16213
|
}
|
|
15944
16214
|
},
|
|
@@ -15958,7 +16228,7 @@ var FLAT = {
|
|
|
15958
16228
|
claim: str(),
|
|
15959
16229
|
result: str(undefined, ["passed", "failed", "missing", "skipped"]),
|
|
15960
16230
|
summary: str(),
|
|
15961
|
-
exitCode:
|
|
16231
|
+
exitCode: int3(),
|
|
15962
16232
|
refs,
|
|
15963
16233
|
requirementIds: list(),
|
|
15964
16234
|
candidateId: str(),
|
|
@@ -16307,7 +16577,7 @@ var FLAT_NAME = {
|
|
|
16307
16577
|
};
|
|
16308
16578
|
var NOT_FLAT = new Set(["schemaVersion", "action", "workspaceId"]);
|
|
16309
16579
|
function actionKeys(family, action) {
|
|
16310
|
-
const options = advertisedOperationSchemas[family].options;
|
|
16580
|
+
const options = advertisedOperationSchemas[family]._zod.def.options;
|
|
16311
16581
|
const option = options.find((item) => {
|
|
16312
16582
|
const literal = defOf(item).shape?.action;
|
|
16313
16583
|
return literal._zod.def.values.includes(action);
|
|
@@ -17839,59 +18109,57 @@ var checkoutRemotes = (cwd) => {
|
|
|
17839
18109
|
};
|
|
17840
18110
|
|
|
17841
18111
|
// packages/workit-core/src/core/workspaces.ts
|
|
17842
|
-
var nonBlank = string2().refine((value) => value.trim().length > 0, "must not be blank");
|
|
18112
|
+
var nonBlank = string2().check(refine((value) => value.trim().length > 0, "must not be blank"));
|
|
17843
18113
|
var branchPreset = custom((value) => typeof value === "string" && Object.hasOwn(PRESETS, value), "unsupported branch preset");
|
|
17844
18114
|
var commitPreset = custom((value) => typeof value === "string" && COMMIT_PRESETS.includes(value), "unsupported commit preset");
|
|
17845
|
-
var workspaceBranchPolicySchema =
|
|
17846
|
-
preset: branchPreset
|
|
17847
|
-
developBranch:
|
|
17848
|
-
prefixes:
|
|
18115
|
+
var workspaceBranchPolicySchema = strictObject({
|
|
18116
|
+
preset: described(branchPreset, "The branch model: gitflow, github-flow, trunk-based or custom (allowed/protected set by hand)."),
|
|
18117
|
+
developBranch: described(optional(nonBlank), "The integration branch gitflow uses (default develop)."),
|
|
18118
|
+
prefixes: described(optional(looseObject({
|
|
17849
18119
|
feature: nonBlank,
|
|
17850
18120
|
bugfix: nonBlank,
|
|
17851
18121
|
release: nonBlank,
|
|
17852
18122
|
hotfix: nonBlank
|
|
17853
|
-
})
|
|
17854
|
-
allowed: array(nonBlank)
|
|
17855
|
-
protected: array(nonBlank)
|
|
17856
|
-
integration: _enum(["pr", "merge"])
|
|
17857
|
-
})
|
|
17858
|
-
var workspaceCommitPolicySchema =
|
|
17859
|
-
preset: commitPreset
|
|
17860
|
-
pattern:
|
|
17861
|
-
})
|
|
17862
|
-
var workspaceProfileSchema =
|
|
17863
|
-
branchPolicy:
|
|
17864
|
-
commitPolicy:
|
|
17865
|
-
}).
|
|
17866
|
-
message: "a profile must define branchPolicy or commitPolicy"
|
|
17867
|
-
});
|
|
18123
|
+
})), "The branch prefix per kind (feature/, bugfix/, release/, hotfix/)."),
|
|
18124
|
+
allowed: described(optional(array(nonBlank)), "Branch name globs a new branch must match (`feature/*`)."),
|
|
18125
|
+
protected: described(optional(array(nonBlank)), "Branches nobody commits or pushes to directly."),
|
|
18126
|
+
integration: described(optional(_enum(["pr", "merge"])), "How work reaches its base: `pr` (default) opens a PR, `merge` merges locally.")
|
|
18127
|
+
});
|
|
18128
|
+
var workspaceCommitPolicySchema = strictObject({
|
|
18129
|
+
preset: described(commitPreset, "The commit message flavor, e.g. conventional."),
|
|
18130
|
+
pattern: described(optional(string2()), "A regular expression every commit subject must match.")
|
|
18131
|
+
});
|
|
18132
|
+
var workspaceProfileSchema = strictObject({
|
|
18133
|
+
branchPolicy: described(optional(workspaceBranchPolicySchema), "This profile's branch policy."),
|
|
18134
|
+
commitPolicy: described(optional(workspaceCommitPolicySchema), "This profile's commit policy.")
|
|
18135
|
+
}).check(refine((profile) => profile.branchPolicy !== undefined || profile.commitPolicy !== undefined, { message: "a profile must define branchPolicy or commitPolicy" }));
|
|
17868
18136
|
var versionSourceSchema = discriminatedUnion("kind", [
|
|
17869
|
-
|
|
18137
|
+
strictObject({
|
|
17870
18138
|
kind: literal("package-json"),
|
|
17871
18139
|
path: nonBlank,
|
|
17872
18140
|
field: nonBlank
|
|
17873
|
-
})
|
|
17874
|
-
|
|
17875
|
-
|
|
18141
|
+
}),
|
|
18142
|
+
strictObject({ kind: literal("git-tag") }),
|
|
18143
|
+
strictObject({ kind: literal("manual") })
|
|
17876
18144
|
]);
|
|
17877
|
-
var releaseTrackSchema =
|
|
17878
|
-
strategy:
|
|
17879
|
-
productionBranch: nonBlank
|
|
17880
|
-
integrationBranch: nonBlank
|
|
17881
|
-
naming:
|
|
17882
|
-
feature:
|
|
17883
|
-
release:
|
|
17884
|
-
hotfix:
|
|
17885
|
-
})
|
|
17886
|
-
baseBranch:
|
|
17887
|
-
mergeBackBranches: array(nonBlank)
|
|
17888
|
-
pullRequestTarget:
|
|
17889
|
-
tagNamespace:
|
|
17890
|
-
versionSource:
|
|
17891
|
-
requiredChecks: array(nonBlank)
|
|
17892
|
-
critical: array(nonBlank)
|
|
17893
|
-
releaseNotes:
|
|
17894
|
-
}).
|
|
18145
|
+
var releaseTrackSchema = looseObject({
|
|
18146
|
+
strategy: described(optional(branchPreset), "The branch model this track follows."),
|
|
18147
|
+
productionBranch: described(nonBlank, "The branch releases land on (main)."),
|
|
18148
|
+
integrationBranch: described(nonBlank, "The branch work integrates into (develop)."),
|
|
18149
|
+
naming: described(optional(looseObject({
|
|
18150
|
+
feature: optional(nonBlank),
|
|
18151
|
+
release: optional(nonBlank),
|
|
18152
|
+
hotfix: optional(nonBlank)
|
|
18153
|
+
})), "Branch name templates per kind, e.g. `feature/{name}`."),
|
|
18154
|
+
baseBranch: described(optional(nonBlank), "The branch new work starts from."),
|
|
18155
|
+
mergeBackBranches: described(optional(array(nonBlank)), "Branches a finished release or hotfix is merged back into."),
|
|
18156
|
+
pullRequestTarget: described(optional(nonBlank), "The branch PRs target."),
|
|
18157
|
+
tagNamespace: described(optional(string2()), "A prefix for this track's release tags."),
|
|
18158
|
+
versionSource: described(optional(versionSourceSchema), "Where the version comes from: package-json, git-tag or manual."),
|
|
18159
|
+
requiredChecks: described(optional(array(nonBlank)), "CI checks that must pass before a release."),
|
|
18160
|
+
critical: described(optional(array(nonBlank)), "Fields an older Workit must not ignore: when one is unknown or malformed, Workit fails closed."),
|
|
18161
|
+
releaseNotes: described(optional(unknown()), "This track's release notes mode, over the workspace's `releaseNotes`.")
|
|
18162
|
+
}).check(superRefine((track, context) => {
|
|
17895
18163
|
for (const [field, values] of [
|
|
17896
18164
|
["mergeBackBranches", track.mergeBackBranches ?? []],
|
|
17897
18165
|
["requiredChecks", track.requiredChecks ?? []]
|
|
@@ -17911,67 +18179,67 @@ var releaseTrackSchema = object({
|
|
|
17911
18179
|
message: "must stay inside the repository"
|
|
17912
18180
|
});
|
|
17913
18181
|
}
|
|
17914
|
-
});
|
|
17915
|
-
var modelRoles =
|
|
17916
|
-
var workspaceConfigSchema =
|
|
17917
|
-
name: nonBlank
|
|
17918
|
-
glob: nonBlank
|
|
17919
|
-
vcs:
|
|
17920
|
-
provider: _enum(["gitlab", "github"])
|
|
17921
|
-
defaultTargetBranch:
|
|
17922
|
-
tokenFile:
|
|
17923
|
-
account:
|
|
17924
|
-
host:
|
|
17925
|
-
})
|
|
17926
|
-
autoApprove: union([boolean2(), array(nonBlank)])
|
|
17927
|
-
defaultEndpoint:
|
|
17928
|
-
verification: _enum(["proportional", "self", "independent"])
|
|
17929
|
-
delegation:
|
|
17930
|
-
changelog:
|
|
17931
|
-
docs:
|
|
17932
|
-
changelogPath:
|
|
17933
|
-
prTemplate:
|
|
17934
|
-
releaseNotes:
|
|
17935
|
-
trailers:
|
|
17936
|
-
deleteBranch:
|
|
17937
|
-
cleanup:
|
|
17938
|
-
feedback:
|
|
17939
|
-
liveSessionGuard:
|
|
17940
|
-
fanout:
|
|
17941
|
-
tierModels:
|
|
17942
|
-
deps:
|
|
17943
|
-
installTimeout:
|
|
17944
|
-
})
|
|
17945
|
-
models:
|
|
17946
|
-
resources:
|
|
17947
|
-
remotes: array(nonBlank.refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)"))
|
|
17948
|
-
externalRepos: array(nonBlank.
|
|
17949
|
-
autonomy:
|
|
18182
|
+
}));
|
|
18183
|
+
var modelRoles = described(optional(unknown()), "Per role (decider, implementer, verifier, reviewer, explore, babysit, default for a general-purpose spawn): a model name, `{ model, effort }`, or one of those per host (claude_code, opencode, codex, codex_cli, codex_desktop, cursor, pi, default). The implementer takes one per tier (mundane, standard, hard).");
|
|
18184
|
+
var workspaceConfigSchema = looseObject({
|
|
18185
|
+
name: described(nonBlank, "The workspace's unique name."),
|
|
18186
|
+
glob: described(nonBlank, "The directories this entry covers, an absolute path glob with * and ** (`/home/you/work/**`); the narrowest match wins."),
|
|
18187
|
+
vcs: described(optional(looseObject({
|
|
18188
|
+
provider: described(_enum(["gitlab", "github"]), "The forge: github or gitlab."),
|
|
18189
|
+
defaultTargetBranch: described(optional(nonBlank), "The branch PRs target by default."),
|
|
18190
|
+
tokenFile: described(optional(nonBlank), "A file holding the forge token for this workspace."),
|
|
18191
|
+
account: described(optional(nonBlank), "The forge login delivery runs as; grants need it to reach the forge."),
|
|
18192
|
+
host: described(optional(unknown()), "A self-hosted forge's host name.")
|
|
18193
|
+
})), "The forge this workspace's repositories live on."),
|
|
18194
|
+
autoApprove: described(optional(union([boolean2(), array(nonBlank)])), "Legacy (≤4.x) standing approvals, read once as autonomy grants; use `autonomy`."),
|
|
18195
|
+
defaultEndpoint: described(optional(unknown()), "Where an unnamed request stops: commit (default), pr, green or merged. Set with `workit grant set`, like grants."),
|
|
18196
|
+
verification: described(optional(_enum(["proportional", "self", "independent"])), "How a normal-risk behavior change is verified: proportional (default), self or independent. Set with `workit grant set`, like grants."),
|
|
18197
|
+
delegation: described(optional(unknown()), "Who does the work: `inline-first` (default) keeps the lead working itself and refuses a slice without a reason to delegate; `lead-orchestrates` allows slices without one."),
|
|
18198
|
+
changelog: described(optional(unknown()), "The Keep a Changelog step before a PR opens: `off` (default), `update` (an existing CHANGELOG.md needs an Unreleased entry from a user-facing PR) or `create` (the entry is required, creating the file). `workit pr create` enforces it."),
|
|
18199
|
+
docs: described(optional(unknown()), "The docs refresh the ship skill does before a PR opens: `off` (default) or `when-user-facing`."),
|
|
18200
|
+
changelogPath: described(optional(unknown()), "Where the changelog lives, repo-relative: one path or glob, or a list (a monorepo with one changelog per package; any of them satisfies the gate). Default CHANGELOG.md at the repo root."),
|
|
18201
|
+
prTemplate: described(optional(unknown()), "Which template a PR description fills: `auto` (default: the repo's GitHub/GitLab template, else Workit's), `repo` (the repo's, refused when it has none), `workit` (Workit's Summary/Evidence/Merge danger) or a repo-relative path to one `.md` file."),
|
|
18202
|
+
releaseNotes: described(optional(unknown()), "The release notes `workit release finish` publishes on the forge release: `auto` (default: the draft when there is one, else the notes built from the version's changelog section), `off` (no forge release) or `review` (finish refuses until `workit release notes approve`). A release track overrides it."),
|
|
18203
|
+
trailers: described(optional(boolean2()), "Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
|
|
18204
|
+
deleteBranch: described(optional(boolean2()), "Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
|
|
18205
|
+
cleanup: described(optional(unknown()), "What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
|
|
18206
|
+
feedback: described(optional(unknown()), '`workit feedback` for this workspace: `off` hides its contract line and makes the verb refuse; `{ "account": "<login>" }` names the GitHub login it posts with; workspaces inside this one inherit it.'),
|
|
18207
|
+
liveSessionGuard: described(optional(boolean2()), "Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
18208
|
+
fanout: described(optional(looseObject({
|
|
18209
|
+
tierModels: described(optional(unknown()), "The model per slice TIER (mundane, standard, hard), as one name or per host."),
|
|
18210
|
+
deps: described(optional(unknown()), "How `workit fanout worktree create` gives a slice worktree node_modules: `install` (default: its own frozen install of its lockfile) or `link` (links into the main checkout's installed packages, for a repo too slow to install per slice). `--deps` overrides it."),
|
|
18211
|
+
installTimeout: described(optional(unknown()), "How long the own install may run before its process tree is killed and the worktree is linked instead: a duration such as `90s` or `10m` (default `5m`). `--install-timeout` overrides it.")
|
|
18212
|
+
})), "Fanout settings."),
|
|
18213
|
+
models: described(optional(looseObject({ roles: modelRoles })), "Model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false); the same key at the top of workspaces.json is the global default."),
|
|
18214
|
+
resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
|
|
18215
|
+
remotes: described(optional(array(nonBlank.check(refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")))), "Remote URLs this entry owns: a checkout pushing to or opening PRs on one never exceeds this entry's grants, wherever the folder is (`owner/*` claims a whole owner). Only the user changes it, in their own terminal."),
|
|
18216
|
+
externalRepos: described(optional(array(nonBlank.check(_regex(/^[\w-]+(?:\/\w[\w.-]*)*\/(?:\w[\w.-]*|\*)$/u, "is owner/name, group/project or owner/* on the checkout's forge host, without the host")))), "Repositories outside this workspace's own forge owners that `workit issue create|comment|close --repo` may write to: `owner/name`, or `owner/*` for a whole owner. Only the user changes it, in their own terminal."),
|
|
18217
|
+
autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
|
|
17950
18218
|
kind,
|
|
17951
|
-
union([boolean2(), literal("verified")])
|
|
17952
|
-
])))
|
|
17953
|
-
youtrack:
|
|
17954
|
-
baseUrl:
|
|
17955
|
-
link_issues:
|
|
17956
|
-
writes: _enum(["ask", "auto"])
|
|
17957
|
-
autoHosts: array(nonBlank)
|
|
17958
|
-
})
|
|
17959
|
-
issues:
|
|
17960
|
-
provider: _enum(["github", "gitlab", "youtrack"])
|
|
17961
|
-
link:
|
|
17962
|
-
relation:
|
|
17963
|
-
backlink:
|
|
17964
|
-
link_on_pr:
|
|
17965
|
-
repo:
|
|
17966
|
-
host:
|
|
17967
|
-
})
|
|
17968
|
-
branchPolicy:
|
|
17969
|
-
commitPolicy:
|
|
17970
|
-
defaultProfile:
|
|
17971
|
-
profiles: record(nonBlank, workspaceProfileSchema)
|
|
17972
|
-
releaseTracks: record(nonBlank, releaseTrackSchema)
|
|
17973
|
-
releasePackages:
|
|
17974
|
-
}).
|
|
18219
|
+
described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
|
|
18220
|
+
])))), "Autonomy grants (D15): only ever set here, by the user, with `workit grant set`."),
|
|
18221
|
+
youtrack: described(optional(looseObject({
|
|
18222
|
+
baseUrl: described(optional(nonBlank), "This workspace's YouTrack URL."),
|
|
18223
|
+
link_issues: described(optional(boolean2()), "Legacy alias of `issues: { provider: youtrack, link: true }`."),
|
|
18224
|
+
writes: described(optional(_enum(["ask", "auto"])), "ask (default): each workit youtrack write waits for the user's yes. auto: posts without asking, behind WORKIT_YT_WRITE=1."),
|
|
18225
|
+
autoHosts: described(optional(array(nonBlank)), "With writes auto: the only YouTrack hosts (`acme.youtrack.cloud`) a write may reach without asking. A raw ytrack write must name one with --host; a write elsewhere asks. Only the user widens it, in their own terminal (`workit workspace seal`).")
|
|
18226
|
+
})), "YouTrack settings for this workspace."),
|
|
18227
|
+
issues: described(optional(looseObject({
|
|
18228
|
+
provider: described(optional(_enum(["github", "gitlab", "youtrack"])), "The issue tracker PRs link to."),
|
|
18229
|
+
link: described(optional(boolean2()), "Derive the issue from the branch name."),
|
|
18230
|
+
relation: described(optional(unknown()), "How a PR names its issue: `closes` (default) or `refs`."),
|
|
18231
|
+
backlink: described(optional(boolean2()), "Post the PR URL on each linked issue after the PR is opened."),
|
|
18232
|
+
link_on_pr: described(optional(boolean2()), "Legacy alias of `link`."),
|
|
18233
|
+
repo: described(optional(unknown()), "The GitHub/GitLab repository (owner/name) that holds the issues; default the PR's own."),
|
|
18234
|
+
host: described(optional(unknown()), "That repository's host; default the PR's host, or the tracker's public one.")
|
|
18235
|
+
})), "The issue tracker PRs link to (any forge with any tracker)."),
|
|
18236
|
+
branchPolicy: described(optional(workspaceBranchPolicySchema), "Which branches may be created and which are protected."),
|
|
18237
|
+
commitPolicy: described(optional(workspaceCommitPolicySchema), "The commit message rules."),
|
|
18238
|
+
defaultProfile: described(optional(nonBlank), "The profile used when none is named; must be a key of `profiles`."),
|
|
18239
|
+
profiles: described(optional(record(nonBlank, workspaceProfileSchema)), "Named branch/commit policy variants of this workspace."),
|
|
18240
|
+
releaseTracks: described(optional(record(nonBlank, releaseTrackSchema)), "Named release tracks: production and integration branches, naming and versioning."),
|
|
18241
|
+
releasePackages: described(optional(unknown()), "Packages released from this repository's own release line under their own tag namespace (`pkg-a@0.1.0`): keyed by package name, each `{ tagNamespace?, changelogPath? }` (default namespace `<name>@`). `workit release package <name> <version>` tags and publishes one.")
|
|
18242
|
+
}).check(superRefine((workspace, context) => {
|
|
17975
18243
|
if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
|
|
17976
18244
|
context.addIssue({
|
|
17977
18245
|
code: "custom",
|
|
@@ -17979,14 +18247,14 @@ var workspaceConfigSchema = object({
|
|
|
17979
18247
|
message: `does not name a configured profile`
|
|
17980
18248
|
});
|
|
17981
18249
|
}
|
|
17982
|
-
});
|
|
17983
|
-
var workspacesFileSchema =
|
|
17984
|
-
workspaces: array(workspaceConfigSchema)
|
|
17985
|
-
models:
|
|
17986
|
-
feedback:
|
|
17987
|
-
account:
|
|
17988
|
-
})
|
|
17989
|
-
}).
|
|
18250
|
+
}));
|
|
18251
|
+
var workspacesFileSchema = looseObject({
|
|
18252
|
+
workspaces: described(optional(array(workspaceConfigSchema)), "Workspace entries, each mapping a path glob to its forge, policies and grants."),
|
|
18253
|
+
models: described(optional(looseObject({ roles: modelRoles })), "The global default model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false)."),
|
|
18254
|
+
feedback: described(optional(looseObject({
|
|
18255
|
+
account: described(optional(nonBlank), "The GitHub login `workit feedback --post` uses when no workspace names one; never the workspace's work account by default.")
|
|
18256
|
+
})), "`workit feedback` defaults for every workspace.")
|
|
18257
|
+
}).check(superRefine((file, context) => {
|
|
17990
18258
|
const names = new Set;
|
|
17991
18259
|
for (const [index, workspace] of (file.workspaces ?? []).entries()) {
|
|
17992
18260
|
if (names.has(workspace.name)) {
|
|
@@ -17998,7 +18266,7 @@ var workspacesFileSchema = object({
|
|
|
17998
18266
|
}
|
|
17999
18267
|
names.add(workspace.name);
|
|
18000
18268
|
}
|
|
18001
|
-
});
|
|
18269
|
+
}));
|
|
18002
18270
|
var workspacesRevision = (contents) => createHash4("sha256").update(contents ?? "<missing>").digest("hex");
|
|
18003
18271
|
var validateWorkspacesDocument = (parsed, file) => {
|
|
18004
18272
|
if (!isConfigObject(parsed)) {
|
|
@@ -18343,25 +18611,25 @@ var resolveWorkspaceFrom = (cwd, dir, workspaceName) => {
|
|
|
18343
18611
|
};
|
|
18344
18612
|
var runtimeWorkspacePolicySchema = (kind) => {
|
|
18345
18613
|
const key = kind === "branch" ? "branchPolicy" : kind === "commit" ? "commitPolicy" : "vcs";
|
|
18346
|
-
const policySchema = kind === "branch" ? workspaceBranchPolicySchema : kind === "commit" ? workspaceCommitPolicySchema :
|
|
18614
|
+
const policySchema = kind === "branch" ? workspaceBranchPolicySchema : kind === "commit" ? workspaceCommitPolicySchema : looseObject({
|
|
18347
18615
|
provider: _enum(["gitlab", "github"]),
|
|
18348
|
-
defaultTargetBranch:
|
|
18349
|
-
account:
|
|
18350
|
-
})
|
|
18351
|
-
const profileSchema =
|
|
18352
|
-
const entrySchema =
|
|
18616
|
+
defaultTargetBranch: optional(nonBlank),
|
|
18617
|
+
account: optional(nonBlank)
|
|
18618
|
+
});
|
|
18619
|
+
const profileSchema = looseObject({ [key]: optional(policySchema) });
|
|
18620
|
+
const entrySchema = looseObject({
|
|
18353
18621
|
name: nonBlank,
|
|
18354
18622
|
glob: nonBlank,
|
|
18355
|
-
[key]:
|
|
18356
|
-
defaultProfile:
|
|
18357
|
-
profiles: record(nonBlank, profileSchema)
|
|
18358
|
-
})
|
|
18623
|
+
[key]: optional(policySchema),
|
|
18624
|
+
defaultProfile: optional(nonBlank),
|
|
18625
|
+
profiles: optional(record(nonBlank, profileSchema))
|
|
18626
|
+
});
|
|
18359
18627
|
return entrySchema;
|
|
18360
18628
|
};
|
|
18361
18629
|
var resolveRuntimeWorkspaceVcs = (cwd) => resolveRuntimeWorkspaceCandidate(cwd, "vcs");
|
|
18362
|
-
var runtimeWorkspaceIndexSchema =
|
|
18363
|
-
workspaces: array(
|
|
18364
|
-
})
|
|
18630
|
+
var runtimeWorkspaceIndexSchema = looseObject({
|
|
18631
|
+
workspaces: optional(array(looseObject({ name: nonBlank, glob: nonBlank })))
|
|
18632
|
+
});
|
|
18365
18633
|
var matchRuntimeWorkspace = (cwd, dir = configDir2()) => {
|
|
18366
18634
|
const file = path7.join(dir, "workspaces.json");
|
|
18367
18635
|
let raw;
|
|
@@ -20980,13 +21248,13 @@ var assetRoot = () => {
|
|
|
20980
21248
|
import { spawnSync as spawnSync10 } from "node:child_process";
|
|
20981
21249
|
import fs12 from "node:fs";
|
|
20982
21250
|
import { hostname } from "node:os";
|
|
20983
|
-
var metadataLockSchema =
|
|
20984
|
-
pid: number2().int()
|
|
20985
|
-
processStart: string2()
|
|
20986
|
-
host: string2().
|
|
20987
|
-
nonce: string2().
|
|
20988
|
-
externalAction: literal(true)
|
|
20989
|
-
})
|
|
21251
|
+
var metadataLockSchema = strictObject({
|
|
21252
|
+
pid: number2().check(int(), _nonnegative(), int()),
|
|
21253
|
+
processStart: nullable(string2()),
|
|
21254
|
+
host: string2().check(_minLength(1)),
|
|
21255
|
+
nonce: string2().check(_minLength(1)),
|
|
21256
|
+
externalAction: optional(literal(true))
|
|
21257
|
+
});
|
|
20990
21258
|
var FOREIGN_LOCK_TTL_MS = 10 * 60000;
|
|
20991
21259
|
var UNREADABLE_LOCK_TTL_MS = 30000;
|
|
20992
21260
|
var RECLAIM_GUARD_TTL_MS = 30000;
|
|
@@ -27388,7 +27656,7 @@ import path24 from "node:path";
|
|
|
27388
27656
|
var SEAL_FILE = "workspaces.json.seal";
|
|
27389
27657
|
var SEAL_VERSION = 1;
|
|
27390
27658
|
var SEAL_COMMAND = "workit workspace seal";
|
|
27391
|
-
var
|
|
27659
|
+
var pick3 = (value, keys) => {
|
|
27392
27660
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
27393
27661
|
return;
|
|
27394
27662
|
const out = Object.fromEntries(keys.flatMap((key) => {
|
|
@@ -27411,11 +27679,11 @@ var ENTRY_KEYS = [
|
|
|
27411
27679
|
];
|
|
27412
27680
|
var IDENTITY_KEYS = ["provider", "account", "tokenFile", "host"];
|
|
27413
27681
|
var sealProjection = (entries) => entries.map((entry) => {
|
|
27414
|
-
const all =
|
|
27415
|
-
return
|
|
27682
|
+
const all = pick3(entry, ENTRY_KEYS) ?? {};
|
|
27683
|
+
return pick3({
|
|
27416
27684
|
...all,
|
|
27417
|
-
vcs:
|
|
27418
|
-
youtrack:
|
|
27685
|
+
vcs: pick3(all.vcs, IDENTITY_KEYS),
|
|
27686
|
+
youtrack: pick3(all.youtrack, ["writes", "autoHosts"])
|
|
27419
27687
|
}, ENTRY_KEYS);
|
|
27420
27688
|
});
|
|
27421
27689
|
var canonical4 = (value) => JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)) : item);
|
|
@@ -30851,8 +31119,8 @@ var fetchYouTrackIssueBody = async (issue, ytrack = ytrackRunner(process.env, yo
|
|
|
30851
31119
|
};
|
|
30852
31120
|
|
|
30853
31121
|
// packages/workit-core/src/core/context-read.ts
|
|
30854
|
-
var contextReadSchema =
|
|
30855
|
-
kind:
|
|
31122
|
+
var contextReadSchema = object2({
|
|
31123
|
+
kind: _enum2([
|
|
30856
31124
|
"git",
|
|
30857
31125
|
"pr",
|
|
30858
31126
|
"youtrack",
|
|
@@ -30862,14 +31130,14 @@ var contextReadSchema = object({
|
|
|
30862
31130
|
"release",
|
|
30863
31131
|
"affected"
|
|
30864
31132
|
]),
|
|
30865
|
-
range:
|
|
30866
|
-
issueId:
|
|
30867
|
-
issueUrl:
|
|
30868
|
-
issueRef:
|
|
30869
|
-
mode:
|
|
30870
|
-
specPath:
|
|
30871
|
-
planPath:
|
|
30872
|
-
cwd:
|
|
31133
|
+
range: string3().optional(),
|
|
31134
|
+
issueId: string3().optional(),
|
|
31135
|
+
issueUrl: string3().optional(),
|
|
31136
|
+
issueRef: string3().optional(),
|
|
31137
|
+
mode: string3().optional(),
|
|
31138
|
+
specPath: string3().optional(),
|
|
31139
|
+
planPath: string3().optional(),
|
|
31140
|
+
cwd: string3().min(1).optional()
|
|
30873
31141
|
}).strict();
|
|
30874
31142
|
var readExternalContext = async (root, payload) => {
|
|
30875
31143
|
if (payload.range !== undefined && !isSafeContextRange(payload.range))
|
|
@@ -31024,7 +31292,7 @@ var SAME_CALL_FAILED = "Same call failed twice:";
|
|
|
31024
31292
|
var MAX_SESSIONS = 256;
|
|
31025
31293
|
var stable = (value) => JSON.stringify(value, (_key, entry) => entry && typeof entry === "object" && !Array.isArray(entry) ? Object.fromEntries(Object.entries(entry).toSorted(([a], [b]) => a.localeCompare(b))) : entry) ?? "null";
|
|
31026
31294
|
var hashOf = (call) => createHash13("sha256").update(call).digest("hex").slice(0, 32);
|
|
31027
|
-
var
|
|
31295
|
+
var record4 = (memo, sessionId, call, failed, next) => {
|
|
31028
31296
|
const previous = memo.get(sessionId);
|
|
31029
31297
|
memo.delete(sessionId);
|
|
31030
31298
|
if (!failed)
|
|
@@ -31045,7 +31313,7 @@ var correctedPayload = (tool, result) => {
|
|
|
31045
31313
|
};
|
|
31046
31314
|
var escalateToolFailure = (memo, sessionId, tool, input, result) => {
|
|
31047
31315
|
const failed = isFailure(result);
|
|
31048
|
-
const line =
|
|
31316
|
+
const line = record4(memo, sessionId, `tool\x00${tool}\x00${stable(input)}`, failed, failed ? correctedPayload(tool, result) : null);
|
|
31049
31317
|
return line && failed ? { ...result, error: `${result.error}
|
|
31050
31318
|
${line}` } : result;
|
|
31051
31319
|
};
|