@workit-dev/pi 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/worker.js +1410 -1533
- package/dist/workit.js +1409 -1342
- package/package.json +1 -1
package/dist/workit.js
CHANGED
|
@@ -50,14 +50,6 @@ function cleanRegex(source) {
|
|
|
50
50
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
51
51
|
return source.slice(start, end);
|
|
52
52
|
}
|
|
53
|
-
function floatSafeRemainder(val, step) {
|
|
54
|
-
const ratio = val / step;
|
|
55
|
-
const roundedRatio = Math.round(ratio);
|
|
56
|
-
const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
57
|
-
if (Math.abs(ratio - roundedRatio) < tolerance)
|
|
58
|
-
return 0;
|
|
59
|
-
return ratio - roundedRatio;
|
|
60
|
-
}
|
|
61
53
|
function assignProp(target, prop, value) {
|
|
62
54
|
Object.defineProperty(target, prop, {
|
|
63
55
|
value,
|
|
@@ -818,6 +810,7 @@ var _parse = (_Err) => {
|
|
|
818
810
|
};
|
|
819
811
|
return fn;
|
|
820
812
|
};
|
|
813
|
+
var parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
821
814
|
var _parseAsync = (_Err) => {
|
|
822
815
|
const fn = async (schema, value, _ctx, params) => {
|
|
823
816
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
@@ -833,6 +826,7 @@ var _parseAsync = (_Err) => {
|
|
|
833
826
|
};
|
|
834
827
|
return fn;
|
|
835
828
|
};
|
|
829
|
+
var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
836
830
|
var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
837
831
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
838
832
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -841,6 +835,7 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
841
835
|
}
|
|
842
836
|
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
843
837
|
};
|
|
838
|
+
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
844
839
|
function failure(Err, issues, ctx) {
|
|
845
840
|
let error;
|
|
846
841
|
return {
|
|
@@ -867,6 +862,7 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
867
862
|
result = await result;
|
|
868
863
|
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
869
864
|
};
|
|
865
|
+
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
870
866
|
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
871
867
|
var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
872
868
|
var validate = (schema, value, _ctx) => {
|
|
@@ -1055,24 +1051,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
1055
1051
|
});
|
|
1056
1052
|
};
|
|
1057
1053
|
});
|
|
1058
|
-
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1059
|
-
$ZodCheck.init(inst, def);
|
|
1060
|
-
inst._zod.check = (payload) => {
|
|
1061
|
-
if (typeof payload.value !== typeof def.value)
|
|
1062
|
-
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
1063
|
-
const isMultiple = typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0;
|
|
1064
|
-
if (isMultiple)
|
|
1065
|
-
return;
|
|
1066
|
-
payload.issues.push({
|
|
1067
|
-
origin: typeof payload.value,
|
|
1068
|
-
code: "not_multiple_of",
|
|
1069
|
-
divisor: def.value,
|
|
1070
|
-
input: payload.value,
|
|
1071
|
-
inst,
|
|
1072
|
-
continue: !def.abort
|
|
1073
|
-
});
|
|
1074
|
-
};
|
|
1075
|
-
});
|
|
1076
1054
|
var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
1077
1055
|
$ZodCheck.init(inst, def);
|
|
1078
1056
|
def.format = def.format || "float64";
|
|
@@ -3717,14 +3695,6 @@ function _never(Class, params) {
|
|
|
3717
3695
|
...normalizeParams(params)
|
|
3718
3696
|
});
|
|
3719
3697
|
}
|
|
3720
|
-
function _lt(value, params) {
|
|
3721
|
-
return new $ZodCheckLessThan({
|
|
3722
|
-
check: "less_than",
|
|
3723
|
-
...normalizeParams(params),
|
|
3724
|
-
value,
|
|
3725
|
-
inclusive: false
|
|
3726
|
-
});
|
|
3727
|
-
}
|
|
3728
3698
|
function _lte(value, params) {
|
|
3729
3699
|
return new $ZodCheckLessThan({
|
|
3730
3700
|
check: "less_than",
|
|
@@ -3733,14 +3703,6 @@ function _lte(value, params) {
|
|
|
3733
3703
|
inclusive: true
|
|
3734
3704
|
});
|
|
3735
3705
|
}
|
|
3736
|
-
function _gt(value, params) {
|
|
3737
|
-
return new $ZodCheckGreaterThan({
|
|
3738
|
-
check: "greater_than",
|
|
3739
|
-
...normalizeParams(params),
|
|
3740
|
-
value,
|
|
3741
|
-
inclusive: false
|
|
3742
|
-
});
|
|
3743
|
-
}
|
|
3744
3706
|
function _gte(value, params) {
|
|
3745
3707
|
return new $ZodCheckGreaterThan({
|
|
3746
3708
|
check: "greater_than",
|
|
@@ -3749,12 +3711,8 @@ function _gte(value, params) {
|
|
|
3749
3711
|
inclusive: true
|
|
3750
3712
|
});
|
|
3751
3713
|
}
|
|
3752
|
-
function
|
|
3753
|
-
return
|
|
3754
|
-
check: "multiple_of",
|
|
3755
|
-
...normalizeParams(params),
|
|
3756
|
-
value
|
|
3757
|
-
});
|
|
3714
|
+
function _nonnegative(params) {
|
|
3715
|
+
return _gte(0, params);
|
|
3758
3716
|
}
|
|
3759
3717
|
function _maxLength(maximum, params) {
|
|
3760
3718
|
const ch = new $ZodCheckMaxLength({
|
|
@@ -5167,95 +5125,44 @@ function toJSONSchema(input, params) {
|
|
|
5167
5125
|
extractDefs(ctx, input);
|
|
5168
5126
|
return finalize(ctx, input);
|
|
5169
5127
|
}
|
|
5170
|
-
// node_modules/zod/v4/
|
|
5171
|
-
var
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
configurable: true,
|
|
5175
|
-
enumerable: false,
|
|
5176
|
-
get() {
|
|
5177
|
-
const value = make(this);
|
|
5178
|
-
Object.defineProperty(this, key, { value, configurable: true, writable: true });
|
|
5179
|
-
return value;
|
|
5180
|
-
},
|
|
5181
|
-
set(value) {
|
|
5182
|
-
Object.defineProperty(this, key, { value, configurable: true, writable: true });
|
|
5183
|
-
}
|
|
5184
|
-
});
|
|
5185
|
-
}
|
|
5186
|
-
var initializer2 = (inst, issues) => {
|
|
5187
|
-
$ZodError.init(inst, issues);
|
|
5188
|
-
inst.name = "ZodError";
|
|
5189
|
-
const proto = Object.getPrototypeOf(inst);
|
|
5190
|
-
if (_installedErrorProtos.has(proto))
|
|
5191
|
-
return;
|
|
5192
|
-
_installedErrorProtos.add(proto);
|
|
5193
|
-
_lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
|
|
5194
|
-
_lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
|
|
5195
|
-
_lazyMethod(proto, "addIssue", (self) => (issue) => {
|
|
5196
|
-
self.issues.push(issue);
|
|
5197
|
-
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
5198
|
-
});
|
|
5199
|
-
_lazyMethod(proto, "addIssues", (self) => (issues) => {
|
|
5200
|
-
self.issues.push(...issues);
|
|
5201
|
-
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
5202
|
-
});
|
|
5203
|
-
Object.defineProperty(proto, "isEmpty", {
|
|
5204
|
-
configurable: true,
|
|
5205
|
-
enumerable: false,
|
|
5206
|
-
get() {
|
|
5207
|
-
return this.issues.length === 0;
|
|
5208
|
-
}
|
|
5209
|
-
});
|
|
5210
|
-
};
|
|
5211
|
-
var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, undefined, {
|
|
5212
|
-
Parent: Error
|
|
5213
|
-
});
|
|
5214
|
-
|
|
5215
|
-
// node_modules/zod/v4/classic/parse.js
|
|
5216
|
-
var parse2 = /* @__PURE__ */ _parse(ZodRealError);
|
|
5217
|
-
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5218
|
-
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
5219
|
-
var safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
5220
|
-
var encode = /* @__PURE__ */ _encode(ZodRealError);
|
|
5221
|
-
var decode = /* @__PURE__ */ _decode(ZodRealError);
|
|
5222
|
-
var encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
5223
|
-
var decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
5224
|
-
var safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
5225
|
-
var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
5226
|
-
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5227
|
-
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5228
|
-
|
|
5229
|
-
// node_modules/zod/v4/classic/schemas.js
|
|
5230
|
-
function _ensureDefaultLocale() {
|
|
5231
|
-
if (!globalConfig.localeError)
|
|
5232
|
-
config(en_default());
|
|
5233
|
-
}
|
|
5234
|
-
function _ensureDefaultMemoizer() {
|
|
5235
|
-
if (!globalConfig.memoizer)
|
|
5236
|
-
config({ memoizer: memoizer() });
|
|
5237
|
-
}
|
|
5238
|
-
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
5239
|
-
_ensureDefaultLocale();
|
|
5128
|
+
// node_modules/zod/v4/mini/schemas.js
|
|
5129
|
+
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
5130
|
+
if (!inst._zod)
|
|
5131
|
+
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
5240
5132
|
$ZodType.init(inst, def);
|
|
5241
5133
|
inst.def = def;
|
|
5242
5134
|
inst.type = def.type;
|
|
5243
|
-
return inst;
|
|
5244
5135
|
}, {
|
|
5245
|
-
|
|
5136
|
+
get with() {
|
|
5137
|
+
return this.check;
|
|
5138
|
+
},
|
|
5139
|
+
set with(value) {
|
|
5140
|
+
own(this, "with", value);
|
|
5141
|
+
},
|
|
5142
|
+
parse(data, params) {
|
|
5143
|
+
return parse(this, data, params, { callee: this.parse });
|
|
5144
|
+
},
|
|
5145
|
+
parseAsync(data, params) {
|
|
5146
|
+
return parseAsync(this, data, params, { callee: this.parseAsync });
|
|
5147
|
+
},
|
|
5148
|
+
safeParse(data, params) {
|
|
5149
|
+
return safeParse(this, data, params);
|
|
5150
|
+
},
|
|
5151
|
+
safeParseAsync(data, params) {
|
|
5152
|
+
return safeParseAsync(this, data, params);
|
|
5153
|
+
},
|
|
5154
|
+
check(...checks) {
|
|
5246
5155
|
const def = this.def;
|
|
5247
|
-
return this.clone(
|
|
5156
|
+
return this.clone({
|
|
5157
|
+
...def,
|
|
5248
5158
|
checks: [
|
|
5249
5159
|
...def.checks ?? [],
|
|
5250
|
-
...
|
|
5160
|
+
...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
5251
5161
|
]
|
|
5252
|
-
}
|
|
5253
|
-
},
|
|
5254
|
-
with(...chks) {
|
|
5255
|
-
return this.check(...chks);
|
|
5162
|
+
}, { parent: true });
|
|
5256
5163
|
},
|
|
5257
|
-
clone(
|
|
5258
|
-
return clone(this,
|
|
5164
|
+
clone(_def, params) {
|
|
5165
|
+
return clone(this, _def, params);
|
|
5259
5166
|
},
|
|
5260
5167
|
brand() {
|
|
5261
5168
|
return this;
|
|
@@ -5264,879 +5171,215 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
5264
5171
|
reg.add(this, meta);
|
|
5265
5172
|
return this;
|
|
5266
5173
|
},
|
|
5267
|
-
refine(check, params) {
|
|
5268
|
-
return this.check(refine(check, params));
|
|
5269
|
-
},
|
|
5270
|
-
superRefine(refinement, params) {
|
|
5271
|
-
return this.check(superRefine(refinement, params));
|
|
5272
|
-
},
|
|
5273
|
-
overwrite(fn) {
|
|
5274
|
-
return this.check(_overwrite(fn));
|
|
5275
|
-
},
|
|
5276
|
-
optional() {
|
|
5277
|
-
return optional(this);
|
|
5278
|
-
},
|
|
5279
|
-
exactOptional() {
|
|
5280
|
-
return exactOptional(this);
|
|
5281
|
-
},
|
|
5282
|
-
nullable() {
|
|
5283
|
-
return nullable(this);
|
|
5284
|
-
},
|
|
5285
|
-
nullish() {
|
|
5286
|
-
return optional(nullable(this));
|
|
5287
|
-
},
|
|
5288
|
-
nonoptional(params) {
|
|
5289
|
-
return nonoptional(this, params);
|
|
5290
|
-
},
|
|
5291
|
-
array() {
|
|
5292
|
-
return array(this);
|
|
5293
|
-
},
|
|
5294
|
-
or(arg) {
|
|
5295
|
-
return union([this, arg]);
|
|
5296
|
-
},
|
|
5297
|
-
and(arg) {
|
|
5298
|
-
return intersection(this, arg);
|
|
5299
|
-
},
|
|
5300
|
-
transform(tx) {
|
|
5301
|
-
return pipe(this, transform(tx));
|
|
5302
|
-
},
|
|
5303
|
-
default(d) {
|
|
5304
|
-
return _default(this, d);
|
|
5305
|
-
},
|
|
5306
|
-
prefault(d) {
|
|
5307
|
-
return prefault(this, d);
|
|
5308
|
-
},
|
|
5309
|
-
catch(params) {
|
|
5310
|
-
return _catch(this, params);
|
|
5311
|
-
},
|
|
5312
|
-
pipe(target) {
|
|
5313
|
-
return pipe(this, target);
|
|
5314
|
-
},
|
|
5315
|
-
readonly() {
|
|
5316
|
-
return readonly(this);
|
|
5317
|
-
},
|
|
5318
|
-
describe(description) {
|
|
5319
|
-
const cl = this.clone();
|
|
5320
|
-
globalRegistry.add(cl, { description });
|
|
5321
|
-
return cl;
|
|
5322
|
-
},
|
|
5323
|
-
meta(...args) {
|
|
5324
|
-
if (args.length === 0)
|
|
5325
|
-
return globalRegistry.get(this);
|
|
5326
|
-
const cl = this.clone();
|
|
5327
|
-
globalRegistry.add(cl, args[0]);
|
|
5328
|
-
return cl;
|
|
5329
|
-
},
|
|
5330
|
-
isOptional() {
|
|
5331
|
-
return this.safeParse(undefined).success;
|
|
5332
|
-
},
|
|
5333
|
-
isNullable() {
|
|
5334
|
-
return this.safeParse(null).success;
|
|
5335
|
-
},
|
|
5336
5174
|
apply(fn, ...args) {
|
|
5337
5175
|
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
5338
|
-
},
|
|
5339
|
-
get "~standard"() {
|
|
5340
|
-
return hide(this, "~standard", {
|
|
5341
|
-
...standardProps(this),
|
|
5342
|
-
jsonSchema: {
|
|
5343
|
-
input: createStandardJSONSchemaMethod(this, "input"),
|
|
5344
|
-
output: createStandardJSONSchemaMethod(this, "output")
|
|
5345
|
-
}
|
|
5346
|
-
});
|
|
5347
|
-
},
|
|
5348
|
-
set "~standard"(value) {
|
|
5349
|
-
own(this, "~standard", value);
|
|
5350
|
-
},
|
|
5351
|
-
parse: function _parse(data, params) {
|
|
5352
|
-
return parse2(this, data, params, { callee: _parse });
|
|
5353
|
-
},
|
|
5354
|
-
parseAsync: async function _parseAsync(data, params) {
|
|
5355
|
-
return await parseAsync(this, data, params, { callee: _parseAsync });
|
|
5356
|
-
},
|
|
5357
|
-
safeParse(data, params) {
|
|
5358
|
-
return safeParse(this, data, params);
|
|
5359
|
-
},
|
|
5360
|
-
async safeParseAsync(data, params) {
|
|
5361
|
-
return safeParseAsync(this, data, params);
|
|
5362
|
-
},
|
|
5363
|
-
get spa() {
|
|
5364
|
-
return this?.safeParseAsync;
|
|
5365
|
-
},
|
|
5366
|
-
set spa(value) {
|
|
5367
|
-
own(this, "spa", value);
|
|
5368
|
-
},
|
|
5369
|
-
validate(data, params) {
|
|
5370
|
-
return validate(this, data, params);
|
|
5371
|
-
},
|
|
5372
|
-
validateAsync(data, params) {
|
|
5373
|
-
return validateAsync(this, data, params);
|
|
5374
|
-
},
|
|
5375
|
-
encode: function _encode(data, params) {
|
|
5376
|
-
return encode(this, data, params, { callee: _encode });
|
|
5377
|
-
},
|
|
5378
|
-
decode: function _decode(data, params) {
|
|
5379
|
-
return decode(this, data, params, { callee: _decode });
|
|
5380
|
-
},
|
|
5381
|
-
encodeAsync: async function _encodeAsync(data, params) {
|
|
5382
|
-
return await encodeAsync(this, data, params, { callee: _encodeAsync });
|
|
5383
|
-
},
|
|
5384
|
-
decodeAsync: async function _decodeAsync(data, params) {
|
|
5385
|
-
return await decodeAsync(this, data, params, { callee: _decodeAsync });
|
|
5386
|
-
},
|
|
5387
|
-
safeEncode(data, params) {
|
|
5388
|
-
return safeEncode(this, data, params);
|
|
5389
|
-
},
|
|
5390
|
-
safeDecode(data, params) {
|
|
5391
|
-
return safeDecode(this, data, params);
|
|
5392
|
-
},
|
|
5393
|
-
async safeEncodeAsync(data, params) {
|
|
5394
|
-
return safeEncodeAsync(this, data, params);
|
|
5395
|
-
},
|
|
5396
|
-
async safeDecodeAsync(data, params) {
|
|
5397
|
-
return safeDecodeAsync(this, data, params);
|
|
5398
|
-
},
|
|
5399
|
-
toJSONSchema(params) {
|
|
5400
|
-
return createToJSONSchemaMethod(this, {})(params);
|
|
5401
|
-
},
|
|
5402
|
-
get description() {
|
|
5403
|
-
return globalRegistry.get(this)?.description;
|
|
5404
|
-
},
|
|
5405
|
-
get _def() {
|
|
5406
|
-
return this._zod.def;
|
|
5407
5176
|
}
|
|
5408
5177
|
});
|
|
5409
|
-
var
|
|
5178
|
+
var ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
|
|
5410
5179
|
$ZodString.init(inst, def);
|
|
5411
|
-
|
|
5412
|
-
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
5413
|
-
}, /* @__PURE__ */ derived({
|
|
5414
|
-
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
5415
|
-
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
5416
|
-
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
5417
|
-
}, {
|
|
5418
|
-
regex(...args) {
|
|
5419
|
-
return this.check(_regex(...args));
|
|
5420
|
-
},
|
|
5421
|
-
includes(...args) {
|
|
5422
|
-
return this.check(_includes(...args));
|
|
5423
|
-
},
|
|
5424
|
-
startsWith(...args) {
|
|
5425
|
-
return this.check(_startsWith(...args));
|
|
5426
|
-
},
|
|
5427
|
-
endsWith(...args) {
|
|
5428
|
-
return this.check(_endsWith(...args));
|
|
5429
|
-
},
|
|
5430
|
-
min(...args) {
|
|
5431
|
-
return this.check(_minLength(...args));
|
|
5432
|
-
},
|
|
5433
|
-
max(...args) {
|
|
5434
|
-
return this.check(_maxLength(...args));
|
|
5435
|
-
},
|
|
5436
|
-
length(...args) {
|
|
5437
|
-
return this.check(_length(...args));
|
|
5438
|
-
},
|
|
5439
|
-
nonempty(...args) {
|
|
5440
|
-
return this.check(_minLength(1, ...args));
|
|
5441
|
-
},
|
|
5442
|
-
lowercase(params) {
|
|
5443
|
-
return this.check(_lowercase(params));
|
|
5444
|
-
},
|
|
5445
|
-
uppercase(params) {
|
|
5446
|
-
return this.check(_uppercase(params));
|
|
5447
|
-
},
|
|
5448
|
-
trim() {
|
|
5449
|
-
return this.check(_trim());
|
|
5450
|
-
},
|
|
5451
|
-
normalize(...args) {
|
|
5452
|
-
return this.check(_normalize(...args));
|
|
5453
|
-
},
|
|
5454
|
-
toLowerCase() {
|
|
5455
|
-
return this.check(_toLowerCase());
|
|
5456
|
-
},
|
|
5457
|
-
toUpperCase() {
|
|
5458
|
-
return this.check(_toUpperCase());
|
|
5459
|
-
},
|
|
5460
|
-
slugify() {
|
|
5461
|
-
return this.check(_slugify());
|
|
5462
|
-
}
|
|
5463
|
-
}));
|
|
5464
|
-
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
5465
|
-
$ZodString.init(inst, def);
|
|
5466
|
-
_ZodString.init(inst, def);
|
|
5467
|
-
}, {
|
|
5468
|
-
email(params) {
|
|
5469
|
-
return this.check(_email(ZodEmail, params));
|
|
5470
|
-
},
|
|
5471
|
-
url(params) {
|
|
5472
|
-
return this.check(_url(ZodURL, params));
|
|
5473
|
-
},
|
|
5474
|
-
jwt(params) {
|
|
5475
|
-
return this.check(_jwt(ZodJWT, params));
|
|
5476
|
-
},
|
|
5477
|
-
emoji(params) {
|
|
5478
|
-
return this.check(_emoji2(ZodEmoji, params));
|
|
5479
|
-
},
|
|
5480
|
-
guid(params) {
|
|
5481
|
-
return this.check(_guid(ZodGUID, params));
|
|
5482
|
-
},
|
|
5483
|
-
uuid(params) {
|
|
5484
|
-
return this.check(_uuid(ZodUUID, params));
|
|
5485
|
-
},
|
|
5486
|
-
uuidv4(params) {
|
|
5487
|
-
return this.check(_uuidv4(ZodUUID, params));
|
|
5488
|
-
},
|
|
5489
|
-
uuidv6(params) {
|
|
5490
|
-
return this.check(_uuidv6(ZodUUID, params));
|
|
5491
|
-
},
|
|
5492
|
-
uuidv7(params) {
|
|
5493
|
-
return this.check(_uuidv7(ZodUUID, params));
|
|
5494
|
-
},
|
|
5495
|
-
nanoid(params) {
|
|
5496
|
-
return this.check(_nanoid(ZodNanoID, params));
|
|
5497
|
-
},
|
|
5498
|
-
cuid(params) {
|
|
5499
|
-
return this.check(_cuid(ZodCUID, params));
|
|
5500
|
-
},
|
|
5501
|
-
cuid2(params) {
|
|
5502
|
-
return this.check(_cuid2(ZodCUID2, params));
|
|
5503
|
-
},
|
|
5504
|
-
ulid(params) {
|
|
5505
|
-
return this.check(_ulid(ZodULID, params));
|
|
5506
|
-
},
|
|
5507
|
-
base64(params) {
|
|
5508
|
-
return this.check(_base64(ZodBase64, params));
|
|
5509
|
-
},
|
|
5510
|
-
base64url(params) {
|
|
5511
|
-
return this.check(_base64url(ZodBase64URL, params));
|
|
5512
|
-
},
|
|
5513
|
-
xid(params) {
|
|
5514
|
-
return this.check(_xid(ZodXID, params));
|
|
5515
|
-
},
|
|
5516
|
-
ksuid(params) {
|
|
5517
|
-
return this.check(_ksuid(ZodKSUID, params));
|
|
5518
|
-
},
|
|
5519
|
-
ipv4(params) {
|
|
5520
|
-
return this.check(_ipv4(ZodIPv4, params));
|
|
5521
|
-
},
|
|
5522
|
-
ipv6(params) {
|
|
5523
|
-
return this.check(_ipv6(ZodIPv6, params));
|
|
5524
|
-
},
|
|
5525
|
-
cidrv4(params) {
|
|
5526
|
-
return this.check(_cidrv4(ZodCIDRv4, params));
|
|
5527
|
-
},
|
|
5528
|
-
cidrv6(params) {
|
|
5529
|
-
return this.check(_cidrv6(ZodCIDRv6, params));
|
|
5530
|
-
},
|
|
5531
|
-
e164(params) {
|
|
5532
|
-
return this.check(_e164(ZodE164, params));
|
|
5533
|
-
},
|
|
5534
|
-
datetime(params) {
|
|
5535
|
-
return this.check(_isoDateTime(ZodISODateTime, params));
|
|
5536
|
-
},
|
|
5537
|
-
date(params) {
|
|
5538
|
-
return this.check(_isoDate(ZodISODate, params));
|
|
5539
|
-
},
|
|
5540
|
-
time(params) {
|
|
5541
|
-
return this.check(_isoTime(ZodISOTime, params));
|
|
5542
|
-
},
|
|
5543
|
-
duration(params) {
|
|
5544
|
-
return this.check(_isoDuration(ZodISODuration, params));
|
|
5545
|
-
}
|
|
5180
|
+
ZodMiniType.init(inst, def);
|
|
5546
5181
|
});
|
|
5547
5182
|
function string2(params) {
|
|
5548
|
-
return _string(
|
|
5183
|
+
return _string(ZodMiniString, params);
|
|
5549
5184
|
}
|
|
5550
|
-
var
|
|
5185
|
+
var ZodMiniStringFormat = /* @__PURE__ */ $constructor("ZodMiniStringFormat", (inst, def) => {
|
|
5551
5186
|
$ZodStringFormat.init(inst, def);
|
|
5552
|
-
|
|
5553
|
-
});
|
|
5554
|
-
var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
5555
|
-
$ZodISODateTime.init(inst, def);
|
|
5556
|
-
ZodStringFormat.init(inst, def);
|
|
5557
|
-
});
|
|
5558
|
-
var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
5559
|
-
$ZodISODate.init(inst, def);
|
|
5560
|
-
ZodStringFormat.init(inst, def);
|
|
5561
|
-
});
|
|
5562
|
-
var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
5563
|
-
$ZodISOTime.init(inst, def);
|
|
5564
|
-
ZodStringFormat.init(inst, def);
|
|
5565
|
-
});
|
|
5566
|
-
var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
|
|
5567
|
-
$ZodISODuration.init(inst, def);
|
|
5568
|
-
ZodStringFormat.init(inst, def);
|
|
5569
|
-
});
|
|
5570
|
-
var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
|
|
5571
|
-
$ZodEmail.init(inst, def);
|
|
5572
|
-
ZodStringFormat.init(inst, def);
|
|
5573
|
-
});
|
|
5574
|
-
var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
|
|
5575
|
-
$ZodGUID.init(inst, def);
|
|
5576
|
-
ZodStringFormat.init(inst, def);
|
|
5577
|
-
});
|
|
5578
|
-
var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
|
|
5579
|
-
$ZodUUID.init(inst, def);
|
|
5580
|
-
ZodStringFormat.init(inst, def);
|
|
5187
|
+
ZodMiniString.init(inst, def);
|
|
5581
5188
|
});
|
|
5582
|
-
var
|
|
5189
|
+
var ZodMiniURL = /* @__PURE__ */ $constructor("ZodMiniURL", (inst, def) => {
|
|
5583
5190
|
$ZodURL.init(inst, def);
|
|
5584
|
-
|
|
5585
|
-
});
|
|
5586
|
-
var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
|
|
5587
|
-
$ZodEmoji.init(inst, def);
|
|
5588
|
-
ZodStringFormat.init(inst, def);
|
|
5589
|
-
});
|
|
5590
|
-
var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
|
|
5591
|
-
$ZodNanoID.init(inst, def);
|
|
5592
|
-
ZodStringFormat.init(inst, def);
|
|
5593
|
-
});
|
|
5594
|
-
var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
|
|
5595
|
-
$ZodCUID.init(inst, def);
|
|
5596
|
-
ZodStringFormat.init(inst, def);
|
|
5597
|
-
});
|
|
5598
|
-
var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
|
|
5599
|
-
$ZodCUID2.init(inst, def);
|
|
5600
|
-
ZodStringFormat.init(inst, def);
|
|
5601
|
-
});
|
|
5602
|
-
var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
|
|
5603
|
-
$ZodULID.init(inst, def);
|
|
5604
|
-
ZodStringFormat.init(inst, def);
|
|
5605
|
-
});
|
|
5606
|
-
var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
|
|
5607
|
-
$ZodXID.init(inst, def);
|
|
5608
|
-
ZodStringFormat.init(inst, def);
|
|
5609
|
-
});
|
|
5610
|
-
var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
|
|
5611
|
-
$ZodKSUID.init(inst, def);
|
|
5612
|
-
ZodStringFormat.init(inst, def);
|
|
5613
|
-
});
|
|
5614
|
-
var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
|
|
5615
|
-
$ZodIPv4.init(inst, def);
|
|
5616
|
-
ZodStringFormat.init(inst, def);
|
|
5617
|
-
});
|
|
5618
|
-
var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
|
|
5619
|
-
$ZodIPv6.init(inst, def);
|
|
5620
|
-
ZodStringFormat.init(inst, def);
|
|
5621
|
-
});
|
|
5622
|
-
var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
|
|
5623
|
-
$ZodCIDRv4.init(inst, def);
|
|
5624
|
-
ZodStringFormat.init(inst, def);
|
|
5625
|
-
});
|
|
5626
|
-
var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
|
|
5627
|
-
$ZodCIDRv6.init(inst, def);
|
|
5628
|
-
ZodStringFormat.init(inst, def);
|
|
5629
|
-
});
|
|
5630
|
-
var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
|
|
5631
|
-
$ZodBase64.init(inst, def);
|
|
5632
|
-
ZodStringFormat.init(inst, def);
|
|
5633
|
-
});
|
|
5634
|
-
var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
|
|
5635
|
-
$ZodBase64URL.init(inst, def);
|
|
5636
|
-
ZodStringFormat.init(inst, def);
|
|
5637
|
-
});
|
|
5638
|
-
var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
|
|
5639
|
-
$ZodE164.init(inst, def);
|
|
5640
|
-
ZodStringFormat.init(inst, def);
|
|
5641
|
-
});
|
|
5642
|
-
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
5643
|
-
$ZodJWT.init(inst, def);
|
|
5644
|
-
ZodStringFormat.init(inst, def);
|
|
5191
|
+
ZodMiniStringFormat.init(inst, def);
|
|
5645
5192
|
});
|
|
5646
|
-
|
|
5193
|
+
function url(params) {
|
|
5194
|
+
return _url(ZodMiniURL, params);
|
|
5195
|
+
}
|
|
5196
|
+
var ZodMiniNumber = /* @__PURE__ */ $constructor("ZodMiniNumber", (inst, def) => {
|
|
5647
5197
|
$ZodNumber.init(inst, def);
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
inst.isFinite = true;
|
|
5651
|
-
}, /* @__PURE__ */ derived({
|
|
5652
|
-
minValue: (inst) => {
|
|
5653
|
-
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
5654
|
-
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
5655
|
-
},
|
|
5656
|
-
maxValue: (inst) => {
|
|
5657
|
-
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
5658
|
-
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
5659
|
-
},
|
|
5660
|
-
isInt: (inst) => {
|
|
5661
|
-
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
5662
|
-
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
5663
|
-
},
|
|
5664
|
-
format: (inst) => aggregateChecks(inst).format ?? null
|
|
5665
|
-
}, {
|
|
5666
|
-
gt(value, params) {
|
|
5667
|
-
return this.check(_gt(value, params));
|
|
5668
|
-
},
|
|
5669
|
-
gte(value, params) {
|
|
5670
|
-
return this.check(_gte(value, params));
|
|
5671
|
-
},
|
|
5672
|
-
min(value, params) {
|
|
5673
|
-
return this.check(_gte(value, params));
|
|
5674
|
-
},
|
|
5675
|
-
lt(value, params) {
|
|
5676
|
-
return this.check(_lt(value, params));
|
|
5677
|
-
},
|
|
5678
|
-
lte(value, params) {
|
|
5679
|
-
return this.check(_lte(value, params));
|
|
5680
|
-
},
|
|
5681
|
-
max(value, params) {
|
|
5682
|
-
return this.check(_lte(value, params));
|
|
5683
|
-
},
|
|
5684
|
-
int(params) {
|
|
5685
|
-
return this.check(int(params));
|
|
5686
|
-
},
|
|
5687
|
-
safe(params) {
|
|
5688
|
-
return this.check(int(params));
|
|
5689
|
-
},
|
|
5690
|
-
positive(params) {
|
|
5691
|
-
return this.check(_gt(0, params));
|
|
5692
|
-
},
|
|
5693
|
-
nonnegative(params) {
|
|
5694
|
-
return this.check(_gte(0, params));
|
|
5695
|
-
},
|
|
5696
|
-
negative(params) {
|
|
5697
|
-
return this.check(_lt(0, params));
|
|
5698
|
-
},
|
|
5699
|
-
nonpositive(params) {
|
|
5700
|
-
return this.check(_lte(0, params));
|
|
5701
|
-
},
|
|
5702
|
-
multipleOf(value, params) {
|
|
5703
|
-
return this.check(_multipleOf(value, params));
|
|
5704
|
-
},
|
|
5705
|
-
step(value, params) {
|
|
5706
|
-
return this.check(_multipleOf(value, params));
|
|
5707
|
-
},
|
|
5708
|
-
finite() {
|
|
5709
|
-
return this;
|
|
5710
|
-
}
|
|
5711
|
-
}));
|
|
5198
|
+
ZodMiniType.init(inst, def);
|
|
5199
|
+
});
|
|
5712
5200
|
function number2(params) {
|
|
5713
|
-
return _number(
|
|
5201
|
+
return _number(ZodMiniNumber, params);
|
|
5714
5202
|
}
|
|
5715
|
-
var
|
|
5203
|
+
var ZodMiniNumberFormat = /* @__PURE__ */ $constructor("ZodMiniNumberFormat", (inst, def) => {
|
|
5716
5204
|
$ZodNumberFormat.init(inst, def);
|
|
5717
|
-
|
|
5205
|
+
ZodMiniNumber.init(inst, def);
|
|
5718
5206
|
});
|
|
5719
5207
|
function int(params) {
|
|
5720
|
-
return _int(
|
|
5208
|
+
return _int(ZodMiniNumberFormat, params);
|
|
5721
5209
|
}
|
|
5722
|
-
var
|
|
5210
|
+
var ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
|
|
5723
5211
|
$ZodBoolean.init(inst, def);
|
|
5724
|
-
|
|
5725
|
-
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
|
|
5212
|
+
ZodMiniType.init(inst, def);
|
|
5726
5213
|
});
|
|
5727
5214
|
function boolean2(params) {
|
|
5728
|
-
return _boolean(
|
|
5215
|
+
return _boolean(ZodMiniBoolean, params);
|
|
5729
5216
|
}
|
|
5730
|
-
var
|
|
5217
|
+
var ZodMiniUnknown = /* @__PURE__ */ $constructor("ZodMiniUnknown", (inst, def) => {
|
|
5731
5218
|
$ZodUnknown.init(inst, def);
|
|
5732
|
-
|
|
5733
|
-
inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
|
|
5219
|
+
ZodMiniType.init(inst, def);
|
|
5734
5220
|
});
|
|
5735
5221
|
function unknown() {
|
|
5736
|
-
return _unknown(
|
|
5222
|
+
return _unknown(ZodMiniUnknown);
|
|
5737
5223
|
}
|
|
5738
|
-
var
|
|
5224
|
+
var ZodMiniNever = /* @__PURE__ */ $constructor("ZodMiniNever", (inst, def) => {
|
|
5739
5225
|
$ZodNever.init(inst, def);
|
|
5740
|
-
|
|
5741
|
-
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
|
|
5226
|
+
ZodMiniType.init(inst, def);
|
|
5742
5227
|
});
|
|
5743
5228
|
function never(params) {
|
|
5744
|
-
return _never(
|
|
5229
|
+
return _never(ZodMiniNever, params);
|
|
5745
5230
|
}
|
|
5746
|
-
var
|
|
5747
|
-
_ensureDefaultMemoizer();
|
|
5231
|
+
var ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
|
|
5748
5232
|
$ZodArray.init(inst, def);
|
|
5749
|
-
|
|
5750
|
-
inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
|
|
5751
|
-
inst.element = def.element;
|
|
5752
|
-
}, {
|
|
5753
|
-
min(n, params) {
|
|
5754
|
-
return this.check(_minLength(n, params));
|
|
5755
|
-
},
|
|
5756
|
-
nonempty(params) {
|
|
5757
|
-
return this.check(_minLength(1, params));
|
|
5758
|
-
},
|
|
5759
|
-
max(n, params) {
|
|
5760
|
-
return this.check(_maxLength(n, params));
|
|
5761
|
-
},
|
|
5762
|
-
length(n, params) {
|
|
5763
|
-
return this.check(_length(n, params));
|
|
5764
|
-
},
|
|
5765
|
-
unwrap() {
|
|
5766
|
-
return this.element;
|
|
5767
|
-
}
|
|
5233
|
+
ZodMiniType.init(inst, def);
|
|
5768
5234
|
});
|
|
5769
5235
|
function array(element, params) {
|
|
5770
|
-
return
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5236
|
+
return new ZodMiniArray({
|
|
5237
|
+
type: "array",
|
|
5238
|
+
element,
|
|
5239
|
+
...normalizeParams(params)
|
|
5240
|
+
});
|
|
5241
|
+
}
|
|
5242
|
+
var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
5243
|
+
$ZodObject.init(inst, def);
|
|
5244
|
+
ZodMiniType.init(inst, def);
|
|
5777
5245
|
installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
5778
|
-
}, {
|
|
5779
|
-
keyof() {
|
|
5780
|
-
return _enum(Object.keys(this._zod.def.shape));
|
|
5781
|
-
},
|
|
5782
|
-
catchall(catchall) {
|
|
5783
|
-
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
5784
|
-
},
|
|
5785
|
-
passthrough() {
|
|
5786
|
-
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
5787
|
-
},
|
|
5788
|
-
loose() {
|
|
5789
|
-
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
5790
|
-
},
|
|
5791
|
-
strict() {
|
|
5792
|
-
return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
|
|
5793
|
-
},
|
|
5794
|
-
strip() {
|
|
5795
|
-
return this.clone(mergeDefs(this._zod.def, { catchall: undefined }));
|
|
5796
|
-
},
|
|
5797
|
-
extend(incoming) {
|
|
5798
|
-
return extend(this, incoming);
|
|
5799
|
-
},
|
|
5800
|
-
safeExtend(incoming) {
|
|
5801
|
-
return safeExtend(this, incoming);
|
|
5802
|
-
},
|
|
5803
|
-
merge(other) {
|
|
5804
|
-
return merge(this, other);
|
|
5805
|
-
},
|
|
5806
|
-
pick(mask) {
|
|
5807
|
-
return pick(this, mask);
|
|
5808
|
-
},
|
|
5809
|
-
omit(mask) {
|
|
5810
|
-
return omit(this, mask);
|
|
5811
|
-
},
|
|
5812
|
-
partial(...args) {
|
|
5813
|
-
return partial(ZodOptional, this, args[0]);
|
|
5814
|
-
},
|
|
5815
|
-
exactPartial(...args) {
|
|
5816
|
-
return partial(ZodExactOptional, this, args[0], "exactPartial");
|
|
5817
|
-
},
|
|
5818
|
-
required(...args) {
|
|
5819
|
-
return required(ZodNonOptional, this, args[0]);
|
|
5820
|
-
}
|
|
5821
5246
|
});
|
|
5822
|
-
function
|
|
5823
|
-
|
|
5247
|
+
function strictObject(shape, params) {
|
|
5248
|
+
return new ZodMiniObject({
|
|
5824
5249
|
type: "object",
|
|
5825
|
-
shape
|
|
5250
|
+
shape,
|
|
5251
|
+
catchall: never(),
|
|
5826
5252
|
...normalizeParams(params)
|
|
5827
|
-
};
|
|
5828
|
-
return new ZodObject(def);
|
|
5253
|
+
});
|
|
5829
5254
|
}
|
|
5830
5255
|
function looseObject(shape, params) {
|
|
5831
|
-
return new
|
|
5256
|
+
return new ZodMiniObject({
|
|
5832
5257
|
type: "object",
|
|
5833
5258
|
shape,
|
|
5834
5259
|
catchall: unknown(),
|
|
5835
5260
|
...normalizeParams(params)
|
|
5836
5261
|
});
|
|
5837
5262
|
}
|
|
5838
|
-
|
|
5263
|
+
function extend2(schema, shape) {
|
|
5264
|
+
return extend(schema, shape);
|
|
5265
|
+
}
|
|
5266
|
+
function pick2(schema, mask) {
|
|
5267
|
+
return pick(schema, mask);
|
|
5268
|
+
}
|
|
5269
|
+
function omit2(schema, mask) {
|
|
5270
|
+
return omit(schema, mask);
|
|
5271
|
+
}
|
|
5272
|
+
var ZodMiniUnion = /* @__PURE__ */ $constructor("ZodMiniUnion", (inst, def) => {
|
|
5839
5273
|
$ZodUnion.init(inst, def);
|
|
5840
|
-
|
|
5841
|
-
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
5842
|
-
inst.options = def.options;
|
|
5274
|
+
ZodMiniType.init(inst, def);
|
|
5843
5275
|
});
|
|
5844
5276
|
function union(options, params) {
|
|
5845
|
-
return new
|
|
5277
|
+
return new ZodMiniUnion({
|
|
5846
5278
|
type: "union",
|
|
5847
5279
|
options,
|
|
5848
5280
|
...normalizeParams(params)
|
|
5849
5281
|
});
|
|
5850
5282
|
}
|
|
5851
|
-
var
|
|
5852
|
-
ZodUnion.init(inst, def);
|
|
5283
|
+
var ZodMiniDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
|
|
5853
5284
|
$ZodDiscriminatedUnion.init(inst, def);
|
|
5285
|
+
ZodMiniType.init(inst, def);
|
|
5854
5286
|
});
|
|
5855
5287
|
function discriminatedUnion(discriminator, options, params) {
|
|
5856
|
-
return new
|
|
5288
|
+
return new ZodMiniDiscriminatedUnion({
|
|
5857
5289
|
type: "union",
|
|
5858
5290
|
options,
|
|
5859
5291
|
discriminator,
|
|
5860
5292
|
...normalizeParams(params)
|
|
5861
5293
|
});
|
|
5862
5294
|
}
|
|
5863
|
-
var
|
|
5864
|
-
$ZodIntersection.init(inst, def);
|
|
5865
|
-
ZodType.init(inst, def);
|
|
5866
|
-
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
5867
|
-
});
|
|
5868
|
-
function intersection(left, right) {
|
|
5869
|
-
return new ZodIntersection({
|
|
5870
|
-
type: "intersection",
|
|
5871
|
-
left,
|
|
5872
|
-
right
|
|
5873
|
-
});
|
|
5874
|
-
}
|
|
5875
|
-
var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
5876
|
-
_ensureDefaultMemoizer();
|
|
5295
|
+
var ZodMiniRecord = /* @__PURE__ */ $constructor("ZodMiniRecord", (inst, def) => {
|
|
5877
5296
|
$ZodRecord.init(inst, def);
|
|
5878
|
-
|
|
5879
|
-
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
5880
|
-
inst.keyType = def.keyType;
|
|
5881
|
-
inst.valueType = def.valueType;
|
|
5297
|
+
ZodMiniType.init(inst, def);
|
|
5882
5298
|
});
|
|
5883
5299
|
function record(keyType, valueType, params) {
|
|
5884
5300
|
if (!valueType || !valueType._zod) {
|
|
5885
|
-
return new
|
|
5301
|
+
return new ZodMiniRecord({
|
|
5886
5302
|
type: "record",
|
|
5887
5303
|
keyType: string2(),
|
|
5888
5304
|
valueType: keyType,
|
|
5889
5305
|
...normalizeParams(valueType)
|
|
5890
5306
|
});
|
|
5891
5307
|
}
|
|
5892
|
-
return new
|
|
5308
|
+
return new ZodMiniRecord({
|
|
5893
5309
|
type: "record",
|
|
5894
5310
|
keyType,
|
|
5895
5311
|
valueType,
|
|
5896
5312
|
...normalizeParams(params)
|
|
5897
5313
|
});
|
|
5898
5314
|
}
|
|
5899
|
-
var
|
|
5315
|
+
var ZodMiniEnum = /* @__PURE__ */ $constructor("ZodMiniEnum", (inst, def) => {
|
|
5900
5316
|
$ZodEnum.init(inst, def);
|
|
5901
|
-
|
|
5902
|
-
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
5903
|
-
inst.enum = def.entries;
|
|
5317
|
+
ZodMiniType.init(inst, def);
|
|
5904
5318
|
inst.options = [...inst._zod.values];
|
|
5905
|
-
const keys = new Set(Object.keys(def.entries));
|
|
5906
|
-
inst.extract = (values, params) => {
|
|
5907
|
-
const newEntries = {};
|
|
5908
|
-
for (const value of values) {
|
|
5909
|
-
if (keys.has(value)) {
|
|
5910
|
-
newEntries[value] = def.entries[value];
|
|
5911
|
-
} else
|
|
5912
|
-
throw new Error(`Key ${value} not found in enum`);
|
|
5913
|
-
}
|
|
5914
|
-
return new ZodEnum({
|
|
5915
|
-
...def,
|
|
5916
|
-
checks: [],
|
|
5917
|
-
...normalizeParams(params),
|
|
5918
|
-
entries: newEntries
|
|
5919
|
-
});
|
|
5920
|
-
};
|
|
5921
|
-
inst.exclude = (values, params) => {
|
|
5922
|
-
const newEntries = { ...def.entries };
|
|
5923
|
-
for (const value of values) {
|
|
5924
|
-
if (keys.has(value)) {
|
|
5925
|
-
delete newEntries[value];
|
|
5926
|
-
} else
|
|
5927
|
-
throw new Error(`Key ${value} not found in enum`);
|
|
5928
|
-
}
|
|
5929
|
-
return new ZodEnum({
|
|
5930
|
-
...def,
|
|
5931
|
-
checks: [],
|
|
5932
|
-
...normalizeParams(params),
|
|
5933
|
-
entries: newEntries
|
|
5934
|
-
});
|
|
5935
|
-
};
|
|
5936
5319
|
});
|
|
5937
5320
|
function _enum(values, params) {
|
|
5938
5321
|
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
5939
|
-
return new
|
|
5322
|
+
return new ZodMiniEnum({
|
|
5940
5323
|
type: "enum",
|
|
5941
5324
|
entries,
|
|
5942
5325
|
...normalizeParams(params)
|
|
5943
5326
|
});
|
|
5944
5327
|
}
|
|
5945
|
-
var
|
|
5328
|
+
var ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
|
|
5946
5329
|
$ZodLiteral.init(inst, def);
|
|
5947
|
-
|
|
5948
|
-
inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
|
|
5949
|
-
inst.values = new Set(def.values);
|
|
5950
|
-
Object.defineProperty(inst, "value", {
|
|
5951
|
-
get() {
|
|
5952
|
-
if (def.values.length > 1) {
|
|
5953
|
-
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
5954
|
-
}
|
|
5955
|
-
return def.values[0];
|
|
5956
|
-
}
|
|
5957
|
-
});
|
|
5330
|
+
ZodMiniType.init(inst, def);
|
|
5958
5331
|
});
|
|
5959
5332
|
function literal(value, params) {
|
|
5960
|
-
return new
|
|
5333
|
+
return new ZodMiniLiteral({
|
|
5961
5334
|
type: "literal",
|
|
5962
5335
|
values: Array.isArray(value) ? value : [value],
|
|
5963
5336
|
...normalizeParams(params)
|
|
5964
5337
|
});
|
|
5965
5338
|
}
|
|
5966
|
-
var
|
|
5967
|
-
_ensureDefaultMemoizer();
|
|
5968
|
-
$ZodTransform.init(inst, def);
|
|
5969
|
-
ZodType.init(inst, def);
|
|
5970
|
-
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
|
|
5971
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
5972
|
-
if (_ctx.direction === "backward") {
|
|
5973
|
-
throw new $ZodEncodeError(inst.constructor.name);
|
|
5974
|
-
}
|
|
5975
|
-
payload.addIssue = (issue2) => {
|
|
5976
|
-
if (typeof issue2 === "string") {
|
|
5977
|
-
payload.issues.push(issue(issue2, payload.value, def));
|
|
5978
|
-
} else {
|
|
5979
|
-
const _issue = issue2;
|
|
5980
|
-
if (_issue.fatal)
|
|
5981
|
-
_issue.continue = false;
|
|
5982
|
-
_issue.code ?? (_issue.code = "custom");
|
|
5983
|
-
if (!("input" in _issue))
|
|
5984
|
-
_issue.input = payload.value;
|
|
5985
|
-
_issue.inst ?? (_issue.inst = inst);
|
|
5986
|
-
payload.issues.push(issue(_issue));
|
|
5987
|
-
}
|
|
5988
|
-
};
|
|
5989
|
-
const output = def.transform(payload.value, payload);
|
|
5990
|
-
if (output instanceof Promise) {
|
|
5991
|
-
return output.then((output) => {
|
|
5992
|
-
payload.value = output;
|
|
5993
|
-
return payload;
|
|
5994
|
-
});
|
|
5995
|
-
}
|
|
5996
|
-
payload.value = output;
|
|
5997
|
-
return payload;
|
|
5998
|
-
};
|
|
5999
|
-
});
|
|
6000
|
-
function transform(fn) {
|
|
6001
|
-
return new ZodTransform({
|
|
6002
|
-
type: "transform",
|
|
6003
|
-
transform: fn
|
|
6004
|
-
});
|
|
6005
|
-
}
|
|
6006
|
-
var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
5339
|
+
var ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
|
|
6007
5340
|
$ZodOptional.init(inst, def);
|
|
6008
|
-
|
|
6009
|
-
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
6010
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
5341
|
+
ZodMiniType.init(inst, def);
|
|
6011
5342
|
});
|
|
6012
5343
|
function optional(innerType) {
|
|
6013
|
-
return new
|
|
6014
|
-
type: "optional",
|
|
6015
|
-
innerType
|
|
6016
|
-
});
|
|
6017
|
-
}
|
|
6018
|
-
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
6019
|
-
$ZodExactOptional.init(inst, def);
|
|
6020
|
-
ZodType.init(inst, def);
|
|
6021
|
-
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
6022
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
6023
|
-
});
|
|
6024
|
-
function exactOptional(innerType) {
|
|
6025
|
-
return new ZodExactOptional({
|
|
5344
|
+
return new ZodMiniOptional({
|
|
6026
5345
|
type: "optional",
|
|
6027
5346
|
innerType
|
|
6028
5347
|
});
|
|
6029
5348
|
}
|
|
6030
|
-
var
|
|
5349
|
+
var ZodMiniNullable = /* @__PURE__ */ $constructor("ZodMiniNullable", (inst, def) => {
|
|
6031
5350
|
$ZodNullable.init(inst, def);
|
|
6032
|
-
|
|
6033
|
-
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
6034
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
5351
|
+
ZodMiniType.init(inst, def);
|
|
6035
5352
|
});
|
|
6036
5353
|
function nullable(innerType) {
|
|
6037
|
-
return new
|
|
5354
|
+
return new ZodMiniNullable({
|
|
6038
5355
|
type: "nullable",
|
|
6039
5356
|
innerType
|
|
6040
5357
|
});
|
|
6041
5358
|
}
|
|
6042
|
-
var
|
|
6043
|
-
$
|
|
6044
|
-
|
|
6045
|
-
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
6046
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
6047
|
-
inst.removeDefault = inst.unwrap;
|
|
6048
|
-
});
|
|
6049
|
-
function _default(innerType, defaultValue) {
|
|
6050
|
-
return new ZodDefault({
|
|
6051
|
-
type: "default",
|
|
6052
|
-
innerType,
|
|
6053
|
-
get defaultValue() {
|
|
6054
|
-
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
6055
|
-
}
|
|
6056
|
-
});
|
|
6057
|
-
}
|
|
6058
|
-
var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
6059
|
-
$ZodPrefault.init(inst, def);
|
|
6060
|
-
ZodType.init(inst, def);
|
|
6061
|
-
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
6062
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
6063
|
-
});
|
|
6064
|
-
function prefault(innerType, defaultValue) {
|
|
6065
|
-
return new ZodPrefault({
|
|
6066
|
-
type: "prefault",
|
|
6067
|
-
innerType,
|
|
6068
|
-
get defaultValue() {
|
|
6069
|
-
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
6070
|
-
}
|
|
6071
|
-
});
|
|
6072
|
-
}
|
|
6073
|
-
var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
6074
|
-
$ZodNonOptional.init(inst, def);
|
|
6075
|
-
ZodType.init(inst, def);
|
|
6076
|
-
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
6077
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
5359
|
+
var ZodMiniCustom = /* @__PURE__ */ $constructor("ZodMiniCustom", (inst, def) => {
|
|
5360
|
+
$ZodCustom.init(inst, def);
|
|
5361
|
+
ZodMiniType.init(inst, def);
|
|
6078
5362
|
});
|
|
6079
|
-
function
|
|
6080
|
-
return
|
|
6081
|
-
type: "nonoptional",
|
|
6082
|
-
innerType,
|
|
6083
|
-
...normalizeParams(params)
|
|
6084
|
-
});
|
|
5363
|
+
function custom(fn, _params) {
|
|
5364
|
+
return _custom(ZodMiniCustom, fn ?? (() => true), _params);
|
|
6085
5365
|
}
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
ZodType.init(inst, def);
|
|
6089
|
-
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
6090
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
6091
|
-
inst.removeCatch = inst.unwrap;
|
|
6092
|
-
});
|
|
6093
|
-
function _catch(innerType, catchValue) {
|
|
6094
|
-
return new ZodCatch({
|
|
6095
|
-
type: "catch",
|
|
6096
|
-
innerType,
|
|
6097
|
-
catchValue: typeof catchValue === "function" ? catchValue : constantCatch(catchValue)
|
|
6098
|
-
});
|
|
5366
|
+
function refine(fn, _params = {}) {
|
|
5367
|
+
return _refine(ZodMiniCustom, fn, _params);
|
|
6099
5368
|
}
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
ZodType.init(inst, def);
|
|
6103
|
-
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
6104
|
-
inst.in = def.in;
|
|
6105
|
-
inst.out = def.out;
|
|
6106
|
-
});
|
|
6107
|
-
function pipe(in_, out) {
|
|
6108
|
-
return new ZodPipe({
|
|
6109
|
-
type: "pipe",
|
|
6110
|
-
in: in_,
|
|
6111
|
-
out
|
|
6112
|
-
});
|
|
6113
|
-
}
|
|
6114
|
-
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
6115
|
-
$ZodReadonly.init(inst, def);
|
|
6116
|
-
ZodType.init(inst, def);
|
|
6117
|
-
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
6118
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
6119
|
-
});
|
|
6120
|
-
function readonly(innerType) {
|
|
6121
|
-
return new ZodReadonly({
|
|
6122
|
-
type: "readonly",
|
|
6123
|
-
innerType
|
|
6124
|
-
});
|
|
6125
|
-
}
|
|
6126
|
-
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
6127
|
-
$ZodCustom.init(inst, def);
|
|
6128
|
-
ZodType.init(inst, def);
|
|
6129
|
-
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
6130
|
-
});
|
|
6131
|
-
function custom(fn, _params) {
|
|
6132
|
-
return _custom(ZodCustom, fn ?? (() => true), _params);
|
|
6133
|
-
}
|
|
6134
|
-
function refine(fn, _params = {}) {
|
|
6135
|
-
return _refine(ZodCustom, fn, _params);
|
|
6136
|
-
}
|
|
6137
|
-
function superRefine(fn, params) {
|
|
6138
|
-
return _superRefine(fn, params);
|
|
5369
|
+
function superRefine(fn, params) {
|
|
5370
|
+
return _superRefine(fn, params);
|
|
6139
5371
|
}
|
|
5372
|
+
// packages/workit-core/src/core/zod-mini.ts
|
|
5373
|
+
if (!globalConfig.localeError)
|
|
5374
|
+
config(en_default());
|
|
5375
|
+
if (!globalConfig.memoizer)
|
|
5376
|
+
config({ memoizer: memoizer() });
|
|
5377
|
+
var described = (schema, description) => {
|
|
5378
|
+
const copy = schema.clone();
|
|
5379
|
+
globalRegistry.add(copy, { description });
|
|
5380
|
+
return copy;
|
|
5381
|
+
};
|
|
5382
|
+
|
|
6140
5383
|
// packages/workit-core/src/core/scope-glob.ts
|
|
6141
5384
|
var GLOB = /[*?[\]{}]/u;
|
|
6142
5385
|
var segmentRegex = (pattern) => {
|
|
@@ -6224,11 +5467,11 @@ var text = string2().check((ctx) => {
|
|
|
6224
5467
|
if (invalidUnicode(ctx.value))
|
|
6225
5468
|
ctx.issues.push({ code: "custom", input: ctx.value, message: "invalid Unicode", path: [] });
|
|
6226
5469
|
});
|
|
6227
|
-
var id = text.
|
|
5470
|
+
var id = text.check(_regex(uuidPattern, "expected lowercase UUID"));
|
|
6228
5471
|
var idRefPattern = /^[0-9a-f][0-9a-f-]{7,35}$/;
|
|
6229
|
-
var idRef = text.
|
|
6230
|
-
var digest = text.
|
|
6231
|
-
var revision = text.
|
|
5472
|
+
var idRef = text.check(_regex(idRefPattern, "expected a UUID or an id prefix of 8+ characters"));
|
|
5473
|
+
var digest = text.check(_regex(digestPattern, "expected lowercase SHA-256 digest"));
|
|
5474
|
+
var revision = text.check(_regex(uuidPattern, "expected UUID revision"));
|
|
6232
5475
|
var validUtc = (value) => {
|
|
6233
5476
|
const match = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,9}))?Z$/.exec(value);
|
|
6234
5477
|
if (!match)
|
|
@@ -6249,8 +5492,8 @@ var utcSchema = text.check((ctx) => {
|
|
|
6249
5492
|
});
|
|
6250
5493
|
});
|
|
6251
5494
|
var utc = utcSchema;
|
|
6252
|
-
var safeInteger = number2().int().
|
|
6253
|
-
var nonEmpty = text.
|
|
5495
|
+
var safeInteger = number2().check(int()).check(int());
|
|
5496
|
+
var nonEmpty = text.check(_minLength(1));
|
|
6254
5497
|
var pathValue = nonEmpty.check((ctx) => {
|
|
6255
5498
|
if (ctx.value !== "." && (ctx.value.includes("\\") || ctx.value.split("/").includes(".."))) {
|
|
6256
5499
|
ctx.issues.push({
|
|
@@ -6261,8 +5504,8 @@ var pathValue = nonEmpty.check((ctx) => {
|
|
|
6261
5504
|
});
|
|
6262
5505
|
}
|
|
6263
5506
|
});
|
|
6264
|
-
var nullableDigest =
|
|
6265
|
-
var nullableId =
|
|
5507
|
+
var nullableDigest = nullable(digest);
|
|
5508
|
+
var nullableId = nullable(id);
|
|
6266
5509
|
var hostSchema = _enum([
|
|
6267
5510
|
"opencode",
|
|
6268
5511
|
"cursor",
|
|
@@ -6274,11 +5517,11 @@ var hostSchema = _enum([
|
|
|
6274
5517
|
]);
|
|
6275
5518
|
var assuranceSchema = _enum(["enforced", "agent_guided", "unavailable"]);
|
|
6276
5519
|
var outcomeSchema = _enum(["verified", "accepted_limitations", "stopped"]);
|
|
6277
|
-
var scopeSchema =
|
|
5520
|
+
var scopeSchema = strictObject({
|
|
6278
5521
|
description: text,
|
|
6279
5522
|
paths: array(pathValue),
|
|
6280
5523
|
exclusions: array(pathValue)
|
|
6281
|
-
})
|
|
5524
|
+
});
|
|
6282
5525
|
var scopeGap = (outer, inner) => {
|
|
6283
5526
|
const strip = (value) => value.length > 1 ? value.replace(/\/+$/, "") : value;
|
|
6284
5527
|
const normOuter = {
|
|
@@ -6303,14 +5546,14 @@ var scopeGap = (outer, inner) => {
|
|
|
6303
5546
|
};
|
|
6304
5547
|
var scopeCovers = (outer, inner) => scopeGap(outer, inner) === null;
|
|
6305
5548
|
var refSchema = discriminatedUnion("kind", [
|
|
6306
|
-
|
|
6307
|
-
|
|
5549
|
+
strictObject({ kind: literal("file"), path: pathValue, digest: nullableDigest }),
|
|
5550
|
+
strictObject({
|
|
6308
5551
|
kind: literal("record"),
|
|
6309
5552
|
collection: _enum(["evidence", "decisions", "findings", "workers"]),
|
|
6310
5553
|
id
|
|
6311
|
-
})
|
|
6312
|
-
|
|
6313
|
-
|
|
5554
|
+
}),
|
|
5555
|
+
strictObject({ kind: literal("host"), host: hostSchema, handle: nonEmpty }),
|
|
5556
|
+
strictObject({ kind: literal("external"), url: text.check(url()) })
|
|
6314
5557
|
]);
|
|
6315
5558
|
var rewriteUnknown = (value, map) => {
|
|
6316
5559
|
if (Array.isArray(value)) {
|
|
@@ -6342,8 +5585,8 @@ var rewriteNode = (value, schema, map) => {
|
|
|
6342
5585
|
return mapped === null ? { drop: true } : { drop: false, value: mapped };
|
|
6343
5586
|
}
|
|
6344
5587
|
let node = schema;
|
|
6345
|
-
while (node instanceof ZodNullable || node instanceof ZodOptional || node instanceof ZodDefault) {
|
|
6346
|
-
node = node.
|
|
5588
|
+
while (node instanceof $ZodNullable || node instanceof $ZodOptional || node instanceof $ZodDefault) {
|
|
5589
|
+
node = node._zod.def.innerType;
|
|
6347
5590
|
}
|
|
6348
5591
|
if (node === refSchema) {
|
|
6349
5592
|
if (!refSchema.safeParse(value).success)
|
|
@@ -6351,21 +5594,21 @@ var rewriteNode = (value, schema, map) => {
|
|
|
6351
5594
|
const mapped = map(value);
|
|
6352
5595
|
return mapped === null ? { drop: true } : { drop: false, value: mapped };
|
|
6353
5596
|
}
|
|
6354
|
-
if (node instanceof ZodArray) {
|
|
5597
|
+
if (node instanceof $ZodArray) {
|
|
6355
5598
|
if (!Array.isArray(value))
|
|
6356
5599
|
return { drop: false, value };
|
|
6357
5600
|
const out = [];
|
|
6358
5601
|
for (const item of value) {
|
|
6359
|
-
const rewritten = rewriteNode(item, node.element, map);
|
|
5602
|
+
const rewritten = rewriteNode(item, node._zod.def.element, map);
|
|
6360
5603
|
if (!rewritten.drop)
|
|
6361
5604
|
out.push(rewritten.value);
|
|
6362
5605
|
}
|
|
6363
5606
|
return { drop: false, value: out };
|
|
6364
5607
|
}
|
|
6365
|
-
if (node instanceof ZodObject) {
|
|
5608
|
+
if (node instanceof $ZodObject) {
|
|
6366
5609
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
6367
5610
|
return { drop: false, value };
|
|
6368
|
-
const shape = node.shape;
|
|
5611
|
+
const shape = node._zod.def.shape;
|
|
6369
5612
|
const record = value;
|
|
6370
5613
|
const out = {};
|
|
6371
5614
|
for (const [key, item] of Object.entries(record)) {
|
|
@@ -6377,9 +5620,9 @@ var rewriteNode = (value, schema, map) => {
|
|
|
6377
5620
|
const child = shape[key];
|
|
6378
5621
|
const rewritten = rewriteNode(item, child, map);
|
|
6379
5622
|
if (rewritten.drop) {
|
|
6380
|
-
if (child instanceof ZodOptional || child instanceof ZodDefault)
|
|
5623
|
+
if (child instanceof $ZodOptional || child instanceof $ZodDefault)
|
|
6381
5624
|
continue;
|
|
6382
|
-
if (child instanceof ZodNullable) {
|
|
5625
|
+
if (child instanceof $ZodNullable) {
|
|
6383
5626
|
out[key] = null;
|
|
6384
5627
|
continue;
|
|
6385
5628
|
}
|
|
@@ -6395,34 +5638,34 @@ var rewriteRecordRefs = (value, schema, map) => {
|
|
|
6395
5638
|
const rewritten = rewriteNode(value, schema, map);
|
|
6396
5639
|
return rewritten.drop ? null : rewritten.value;
|
|
6397
5640
|
};
|
|
6398
|
-
var provenanceSchema =
|
|
5641
|
+
var provenanceSchema = strictObject({
|
|
6399
5642
|
kind: _enum(["host_observed", "agent_reported", "imported"]),
|
|
6400
5643
|
host: hostSchema,
|
|
6401
|
-
session:
|
|
5644
|
+
session: nullable(refSchema),
|
|
6402
5645
|
workerId: nullableId
|
|
6403
|
-
})
|
|
6404
|
-
var entrySchema = (data) =>
|
|
5646
|
+
});
|
|
5647
|
+
var entrySchema = (data) => strictObject({ id, recordedAt: utc, provenance: provenanceSchema, data });
|
|
6405
5648
|
var RISK_TIERS = ["trivial", "normal", "high"];
|
|
6406
|
-
var judgmentSchema =
|
|
5649
|
+
var judgmentSchema = strictObject({
|
|
6407
5650
|
riskTier: _enum(RISK_TIERS),
|
|
6408
5651
|
behaviorChange: boolean2(),
|
|
6409
5652
|
productChoiceOpen: boolean2(),
|
|
6410
5653
|
needsPlan: boolean2(),
|
|
6411
|
-
note:
|
|
5654
|
+
note: nullable(text),
|
|
6412
5655
|
refs: array(refSchema)
|
|
6413
|
-
})
|
|
5656
|
+
});
|
|
6414
5657
|
var legacyAssessmentSchema = looseObject({});
|
|
6415
|
-
var constraintSchema =
|
|
5658
|
+
var constraintSchema = strictObject({
|
|
6416
5659
|
id: nonEmpty,
|
|
6417
5660
|
kind: _enum(["host", "project", "user"]),
|
|
6418
5661
|
statement: text,
|
|
6419
5662
|
source: refSchema,
|
|
6420
5663
|
acceptanceAllowed: boolean2(),
|
|
6421
|
-
requires: array(
|
|
5664
|
+
requires: array(strictObject({
|
|
6422
5665
|
kind: _enum(["check", "method", "decision"]),
|
|
6423
5666
|
scope: scopeSchema,
|
|
6424
5667
|
refs: array(refSchema),
|
|
6425
|
-
method: _enum([
|
|
5668
|
+
method: nullable(_enum([
|
|
6426
5669
|
"investigation",
|
|
6427
5670
|
"challenge",
|
|
6428
5671
|
"artifacts",
|
|
@@ -6432,10 +5675,10 @@ var constraintSchema = object({
|
|
|
6432
5675
|
"delegation",
|
|
6433
5676
|
"continuity",
|
|
6434
5677
|
"decisions"
|
|
6435
|
-
])
|
|
5678
|
+
])),
|
|
6436
5679
|
before: _enum(["dependent_action", "write", "close"]),
|
|
6437
|
-
dependentAction:
|
|
6438
|
-
}).
|
|
5680
|
+
dependentAction: nullable(text)
|
|
5681
|
+
}).check((ctx) => {
|
|
6439
5682
|
const obligation = ctx.value;
|
|
6440
5683
|
const validMethod = obligation.kind === "method" && obligation.method !== null || obligation.kind !== "method" && obligation.method === null;
|
|
6441
5684
|
if (!validMethod)
|
|
@@ -6446,13 +5689,17 @@ var constraintSchema = object({
|
|
|
6446
5689
|
path: ["method"]
|
|
6447
5690
|
});
|
|
6448
5691
|
}))
|
|
6449
|
-
})
|
|
6450
|
-
var intentSchema =
|
|
6451
|
-
|
|
5692
|
+
});
|
|
5693
|
+
var intentSchema = strictObject({
|
|
5694
|
+
objective: text,
|
|
5695
|
+
scope: scopeSchema,
|
|
5696
|
+
authorityRefs: array(refSchema)
|
|
5697
|
+
});
|
|
5698
|
+
var progressSchema = strictObject({
|
|
6452
5699
|
summary: text,
|
|
6453
|
-
nextAction:
|
|
6454
|
-
blockers: array(
|
|
6455
|
-
})
|
|
5700
|
+
nextAction: nullable(text),
|
|
5701
|
+
blockers: array(strictObject({ reason: text, dependentAction: text, refs: array(refSchema) }))
|
|
5702
|
+
});
|
|
6456
5703
|
var dimensionSchema = _enum([
|
|
6457
5704
|
"investigation",
|
|
6458
5705
|
"challenge",
|
|
@@ -6464,10 +5711,10 @@ var dimensionSchema = _enum([
|
|
|
6464
5711
|
"continuity",
|
|
6465
5712
|
"decisions"
|
|
6466
5713
|
]);
|
|
6467
|
-
var policySchema =
|
|
6468
|
-
policyVersion: text.
|
|
5714
|
+
var policySchema = strictObject({
|
|
5715
|
+
policyVersion: text.check(_regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/)),
|
|
6469
5716
|
inputDigest: digest,
|
|
6470
|
-
requirements: array(
|
|
5717
|
+
requirements: array(strictObject({
|
|
6471
5718
|
id: digest,
|
|
6472
5719
|
ruleId: nonEmpty,
|
|
6473
5720
|
dimension: dimensionSchema,
|
|
@@ -6475,29 +5722,29 @@ var policySchema = object({
|
|
|
6475
5722
|
reason: text,
|
|
6476
5723
|
satisfaction: text,
|
|
6477
5724
|
before: _enum(["dependent_action", "write", "close"]),
|
|
6478
|
-
dependentAction:
|
|
5725
|
+
dependentAction: nullable(text),
|
|
6479
5726
|
acceptanceAllowed: boolean2()
|
|
6480
|
-
})
|
|
6481
|
-
})
|
|
6482
|
-
var requirementSchema = policySchema.shape.requirements.element;
|
|
6483
|
-
var policyChangeSchema =
|
|
5727
|
+
}))
|
|
5728
|
+
});
|
|
5729
|
+
var requirementSchema = policySchema.shape.requirements._zod.def.element;
|
|
5730
|
+
var policyChangeSchema = strictObject({
|
|
6484
5731
|
recordedAt: utc,
|
|
6485
5732
|
fromInputDigest: nullableDigest,
|
|
6486
5733
|
toInputDigest: digest,
|
|
6487
5734
|
added: array(digest),
|
|
6488
5735
|
retired: array(digest),
|
|
6489
5736
|
reason: text
|
|
6490
|
-
})
|
|
6491
|
-
var candidateSchema =
|
|
5737
|
+
});
|
|
5738
|
+
var candidateSchema = strictObject({
|
|
6492
5739
|
id: digest,
|
|
6493
5740
|
scope: scopeSchema,
|
|
6494
5741
|
completeness: _enum(["known", "uncertain"]),
|
|
6495
|
-
files: array(
|
|
5742
|
+
files: array(strictObject({
|
|
6496
5743
|
path: pathValue,
|
|
6497
5744
|
kind: _enum(["file", "symlink", "absent"]),
|
|
6498
5745
|
digest: nullableDigest,
|
|
6499
|
-
executable: boolean2()
|
|
6500
|
-
}).
|
|
5746
|
+
executable: nullable(boolean2())
|
|
5747
|
+
}).check((ctx) => {
|
|
6501
5748
|
const file = ctx.value;
|
|
6502
5749
|
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;
|
|
6503
5750
|
if (!valid)
|
|
@@ -6508,7 +5755,7 @@ var candidateSchema = object({
|
|
|
6508
5755
|
path: []
|
|
6509
5756
|
});
|
|
6510
5757
|
})),
|
|
6511
|
-
environment: array(
|
|
5758
|
+
environment: array(strictObject({ name: nonEmpty, value: nullable(text), refs: array(refSchema) })).check((ctx) => {
|
|
6512
5759
|
if (new Set(ctx.value.map((value) => value.name)).size !== ctx.value.length)
|
|
6513
5760
|
ctx.issues.push({
|
|
6514
5761
|
code: "custom",
|
|
@@ -6517,8 +5764,8 @@ var candidateSchema = object({
|
|
|
6517
5764
|
path: []
|
|
6518
5765
|
});
|
|
6519
5766
|
}),
|
|
6520
|
-
head:
|
|
6521
|
-
}).
|
|
5767
|
+
head: nullable(text)
|
|
5768
|
+
}).check((ctx) => {
|
|
6522
5769
|
if (ctx.value.id !== candidateDigest(ctx.value))
|
|
6523
5770
|
ctx.issues.push({
|
|
6524
5771
|
code: "custom",
|
|
@@ -6527,139 +5774,142 @@ var candidateSchema = object({
|
|
|
6527
5774
|
path: ["id"]
|
|
6528
5775
|
});
|
|
6529
5776
|
});
|
|
6530
|
-
var checkObservationSchema =
|
|
5777
|
+
var checkObservationSchema = strictObject({
|
|
6531
5778
|
observer: literal("workit_cli"),
|
|
6532
|
-
name:
|
|
5779
|
+
name: nullable(nonEmpty),
|
|
6533
5780
|
configured: boolean2(),
|
|
6534
|
-
argv: array(text).
|
|
5781
|
+
argv: array(text).check(_minLength(1)),
|
|
6535
5782
|
shell: boolean2(),
|
|
6536
5783
|
cwd: nonEmpty,
|
|
6537
5784
|
exitCode: safeInteger,
|
|
6538
|
-
durationMs: safeInteger.
|
|
5785
|
+
durationMs: safeInteger.check(_gte(0)),
|
|
6539
5786
|
timedOut: boolean2(),
|
|
6540
|
-
head:
|
|
6541
|
-
tree:
|
|
6542
|
-
dirty: boolean2()
|
|
6543
|
-
signal:
|
|
6544
|
-
treeAfter:
|
|
5787
|
+
head: nullable(text),
|
|
5788
|
+
tree: nullable(text),
|
|
5789
|
+
dirty: nullable(boolean2()),
|
|
5790
|
+
signal: nullable(text),
|
|
5791
|
+
treeAfter: nullable(text),
|
|
6545
5792
|
modifiedWorktree: boolean2(),
|
|
6546
|
-
base:
|
|
6547
|
-
patchId:
|
|
6548
|
-
environment:
|
|
5793
|
+
base: nullable(text),
|
|
5794
|
+
patchId: nullable(text),
|
|
5795
|
+
environment: strictObject({
|
|
6549
5796
|
platform: nonEmpty,
|
|
6550
5797
|
arch: nonEmpty,
|
|
6551
|
-
vars: record(nonEmpty,
|
|
6552
|
-
})
|
|
6553
|
-
logDigest:
|
|
6554
|
-
logRef:
|
|
6555
|
-
logTail: array(text).
|
|
6556
|
-
ledgerRowId:
|
|
6557
|
-
attestation:
|
|
6558
|
-
})
|
|
5798
|
+
vars: record(nonEmpty, nullable(text))
|
|
5799
|
+
}),
|
|
5800
|
+
logDigest: nullable(text),
|
|
5801
|
+
logRef: nullable(text),
|
|
5802
|
+
logTail: array(text).check(_maxLength(40)),
|
|
5803
|
+
ledgerRowId: nullable(text),
|
|
5804
|
+
attestation: nullable(strictObject({ host: nonEmpty, session: nullable(text), agentId: nullable(text) }))
|
|
5805
|
+
});
|
|
6559
5806
|
var CHECK_OBSERVATION_PATH = "evidence.*.data.observation";
|
|
6560
5807
|
var evidenceFields = {
|
|
6561
5808
|
kind: _enum(["check", "review", "investigation", "artifact"]),
|
|
6562
5809
|
claim: text,
|
|
6563
5810
|
requirementIds: array(digest),
|
|
6564
|
-
beforeCandidateId:
|
|
6565
|
-
candidateId:
|
|
5811
|
+
beforeCandidateId: optional(nullableDigest),
|
|
5812
|
+
candidateId: optional(nullableDigest),
|
|
6566
5813
|
result: _enum(["passed", "failed", "missing", "skipped"]),
|
|
6567
5814
|
summary: text,
|
|
6568
5815
|
refs: array(refSchema),
|
|
6569
|
-
exitCode:
|
|
6570
|
-
reviewContext:
|
|
5816
|
+
exitCode: nullable(safeInteger),
|
|
5817
|
+
reviewContext: nullable(refSchema)
|
|
6571
5818
|
};
|
|
6572
|
-
var evidenceSchema =
|
|
6573
|
-
|
|
6574
|
-
|
|
5819
|
+
var evidenceSchema = strictObject({
|
|
5820
|
+
...evidenceFields,
|
|
5821
|
+
observation: optional(checkObservationSchema)
|
|
5822
|
+
});
|
|
5823
|
+
var reportedEvidenceSchema = strictObject(evidenceFields);
|
|
5824
|
+
var evidenceEvaluationSchema = strictObject({
|
|
6575
5825
|
evidenceId: id,
|
|
6576
5826
|
status: _enum(["passed", "failed", "missing", "skipped", "stale"]),
|
|
6577
5827
|
reason: text
|
|
6578
|
-
})
|
|
6579
|
-
var decisionSchema =
|
|
5828
|
+
});
|
|
5829
|
+
var decisionSchema = strictObject({
|
|
6580
5830
|
purpose: _enum(["design", "action", "limitation", "preference"]),
|
|
6581
|
-
binding:
|
|
5831
|
+
binding: strictObject({
|
|
6582
5832
|
taskId: id,
|
|
6583
5833
|
workspaceId: id,
|
|
6584
5834
|
scope: scopeSchema,
|
|
6585
5835
|
presented: text,
|
|
6586
5836
|
contentRefs: array(refSchema),
|
|
6587
|
-
statedChoice:
|
|
6588
|
-
})
|
|
5837
|
+
statedChoice: optional(strictObject({ ref: text, text }))
|
|
5838
|
+
}),
|
|
6589
5839
|
digest,
|
|
6590
5840
|
response: _enum(["approved", "rejected", "stated"]),
|
|
6591
5841
|
requirementIds: array(digest),
|
|
6592
|
-
revoked:
|
|
6593
|
-
})
|
|
6594
|
-
var findingSchema =
|
|
5842
|
+
revoked: nullable(strictObject({ at: utc, reason: text }))
|
|
5843
|
+
});
|
|
5844
|
+
var findingSchema = strictObject({
|
|
6595
5845
|
claim: text,
|
|
6596
5846
|
consequence: text,
|
|
6597
5847
|
scope: scopeSchema,
|
|
6598
5848
|
candidateId: nullableDigest,
|
|
6599
5849
|
refs: array(refSchema),
|
|
6600
5850
|
disposition: _enum(["open", "fixed", "dismissed", "deferred"]),
|
|
6601
|
-
resolution:
|
|
6602
|
-
leadOwned: literal(true)
|
|
6603
|
-
})
|
|
6604
|
-
var assignmentSchema =
|
|
5851
|
+
resolution: nullable(strictObject({ reason: text, evidenceIds: array(id), decisionIds: array(id) })),
|
|
5852
|
+
leadOwned: optional(literal(true))
|
|
5853
|
+
});
|
|
5854
|
+
var assignmentSchema = strictObject({
|
|
6605
5855
|
role: _enum(["investigator", "reviewer", "implementer"]),
|
|
6606
5856
|
objective: text,
|
|
6607
5857
|
scope: scopeSchema,
|
|
6608
5858
|
decisionIds: array(id),
|
|
6609
5859
|
requirementIds: array(digest),
|
|
6610
|
-
candidateId:
|
|
5860
|
+
candidateId: optional(nullableDigest),
|
|
6611
5861
|
stoppingCondition: text
|
|
6612
|
-
})
|
|
6613
|
-
var workerReportSchema =
|
|
5862
|
+
});
|
|
5863
|
+
var workerReportSchema = strictObject({
|
|
6614
5864
|
outcome: _enum(["completed", "failed", "cancelled"]),
|
|
6615
5865
|
summary: text,
|
|
6616
5866
|
evidenceIds: array(id),
|
|
6617
5867
|
findingIds: array(idRef)
|
|
6618
|
-
})
|
|
6619
|
-
var workerSchema =
|
|
5868
|
+
});
|
|
5869
|
+
var workerSchema = strictObject({
|
|
6620
5870
|
assignment: assignmentSchema,
|
|
6621
5871
|
state: _enum(["assigned", "dispatching", "running", "cancelling", "stopped", "unknown"]),
|
|
6622
|
-
session:
|
|
6623
|
-
coordinator:
|
|
6624
|
-
report:
|
|
6625
|
-
})
|
|
6626
|
-
var closureSchema =
|
|
5872
|
+
session: nullable(refSchema),
|
|
5873
|
+
coordinator: optional(refSchema),
|
|
5874
|
+
report: nullable(workerReportSchema)
|
|
5875
|
+
});
|
|
5876
|
+
var closureSchema = strictObject({
|
|
6627
5877
|
outcome: outcomeSchema,
|
|
6628
5878
|
at: utc,
|
|
6629
5879
|
summary: text,
|
|
6630
5880
|
decisionIds: array(id),
|
|
6631
5881
|
evidenceIds: array(id)
|
|
6632
|
-
})
|
|
6633
|
-
var runtimeSchema =
|
|
6634
|
-
createdWith:
|
|
5882
|
+
});
|
|
5883
|
+
var runtimeSchema = strictObject({
|
|
5884
|
+
createdWith: nullable(text),
|
|
6635
5885
|
updatedWith: text
|
|
6636
|
-
})
|
|
6637
|
-
var taskRecordSchema =
|
|
5886
|
+
});
|
|
5887
|
+
var taskRecordSchema = strictObject({
|
|
6638
5888
|
schemaVersion: literal(1),
|
|
6639
5889
|
id,
|
|
6640
5890
|
workspaceId: id,
|
|
6641
5891
|
revision,
|
|
6642
5892
|
createdAt: utc,
|
|
6643
5893
|
updatedAt: utc,
|
|
6644
|
-
origin:
|
|
5894
|
+
origin: nullable(strictObject({ workspaceId: id, taskId: id, exportDigest: digest })),
|
|
6645
5895
|
intent: entrySchema(intentSchema),
|
|
6646
5896
|
constraints: array(constraintSchema),
|
|
6647
5897
|
status: _enum(["active", "paused", "closed"]),
|
|
6648
|
-
closure:
|
|
5898
|
+
closure: nullable(closureSchema),
|
|
6649
5899
|
progress: progressSchema,
|
|
6650
|
-
pauseReason:
|
|
6651
|
-
runtime:
|
|
5900
|
+
pauseReason: optional(nullable(text)),
|
|
5901
|
+
runtime: optional(runtimeSchema),
|
|
6652
5902
|
assessments: array(entrySchema(legacyAssessmentSchema)),
|
|
6653
|
-
judgments: array(entrySchema(judgmentSchema))
|
|
6654
|
-
policy:
|
|
5903
|
+
judgments: optional(array(entrySchema(judgmentSchema))),
|
|
5904
|
+
policy: nullable(policySchema),
|
|
6655
5905
|
policyChanges: array(policyChangeSchema),
|
|
6656
5906
|
candidates: array(candidateSchema),
|
|
6657
5907
|
evidence: array(entrySchema(evidenceSchema)),
|
|
6658
5908
|
decisions: array(entrySchema(decisionSchema)),
|
|
6659
5909
|
findings: array(entrySchema(findingSchema)),
|
|
6660
5910
|
workers: array(entrySchema(workerSchema)),
|
|
6661
|
-
critical: array(nonEmpty)
|
|
6662
|
-
})
|
|
5911
|
+
critical: optional(array(nonEmpty))
|
|
5912
|
+
});
|
|
6663
5913
|
var stripCount = (strips) => strips.reduce((sum, strip) => sum + strip.keys.length, 0);
|
|
6664
5914
|
var strippable = (issues, prefix = []) => {
|
|
6665
5915
|
const strips = [];
|
|
@@ -6713,117 +5963,224 @@ var parseStoredRecord = (schema, value) => {
|
|
|
6713
5963
|
return { ...first, critical };
|
|
6714
5964
|
return { success: true, data: parsed.data, stripped: [...new Set(stripped)] };
|
|
6715
5965
|
};
|
|
6716
|
-
var workspaceRecordSchema =
|
|
5966
|
+
var workspaceRecordSchema = strictObject({
|
|
6717
5967
|
schemaVersion: literal(1),
|
|
6718
5968
|
id,
|
|
6719
5969
|
revision,
|
|
6720
5970
|
root: nonEmpty,
|
|
6721
|
-
runtime:
|
|
6722
|
-
critical: array(nonEmpty)
|
|
6723
|
-
})
|
|
6724
|
-
var capabilitySchema =
|
|
5971
|
+
runtime: optional(runtimeSchema),
|
|
5972
|
+
critical: optional(array(nonEmpty))
|
|
5973
|
+
});
|
|
5974
|
+
var capabilitySchema = strictObject({
|
|
6725
5975
|
name: nonEmpty,
|
|
6726
5976
|
surface: nonEmpty,
|
|
6727
5977
|
assurance: assuranceSchema,
|
|
6728
5978
|
reason: text,
|
|
6729
5979
|
refs: array(refSchema)
|
|
6730
|
-
})
|
|
6731
|
-
var requirementEvaluationSchema =
|
|
5980
|
+
});
|
|
5981
|
+
var requirementEvaluationSchema = strictObject({
|
|
6732
5982
|
requirementId: digest,
|
|
6733
5983
|
status: _enum(["satisfied", "unsatisfied", "accepted_limitation", "unavailable"]),
|
|
6734
5984
|
evidenceIds: array(id),
|
|
6735
5985
|
decisionIds: array(id),
|
|
6736
5986
|
reason: text
|
|
6737
|
-
})
|
|
6738
|
-
var taskViewSchema =
|
|
5987
|
+
});
|
|
5988
|
+
var taskViewSchema = strictObject({
|
|
6739
5989
|
task: taskRecordSchema,
|
|
6740
5990
|
workspace: workspaceRecordSchema,
|
|
6741
5991
|
capabilities: array(capabilitySchema),
|
|
6742
5992
|
requirements: array(requirementEvaluationSchema),
|
|
6743
5993
|
evidence: array(evidenceEvaluationSchema)
|
|
6744
|
-
})
|
|
6745
|
-
var taskSummarySchema =
|
|
5994
|
+
});
|
|
5995
|
+
var taskSummarySchema = strictObject({
|
|
6746
5996
|
id,
|
|
6747
5997
|
revision,
|
|
6748
5998
|
workspaceRevision: revision,
|
|
6749
5999
|
createdAt: utc,
|
|
6750
6000
|
updatedAt: utc,
|
|
6751
|
-
runtime:
|
|
6001
|
+
runtime: nullable(runtimeSchema),
|
|
6752
6002
|
objective: text,
|
|
6753
6003
|
status: _enum(["active", "paused", "closed"]),
|
|
6754
|
-
closure:
|
|
6004
|
+
closure: nullable(closureSchema),
|
|
6755
6005
|
progress: progressSchema,
|
|
6756
|
-
policy:
|
|
6006
|
+
policy: nullable(policySchema),
|
|
6757
6007
|
requirements: array(requirementEvaluationSchema)
|
|
6758
|
-
})
|
|
6759
|
-
var taskListItemSchema = taskSummarySchema
|
|
6760
|
-
var exportBundleSchema =
|
|
6008
|
+
});
|
|
6009
|
+
var taskListItemSchema = extend2(omit2(taskSummarySchema, { policy: true, requirements: true }), { source: pick2(provenanceSchema, { host: true, kind: true }) });
|
|
6010
|
+
var exportBundleSchema = strictObject({
|
|
6761
6011
|
schemaVersion: literal(1),
|
|
6762
6012
|
exportedAt: utc,
|
|
6763
6013
|
sourceWorkspaceId: id,
|
|
6764
6014
|
task: taskRecordSchema,
|
|
6765
6015
|
digest
|
|
6766
|
-
})
|
|
6767
|
-
var callerSchema =
|
|
6016
|
+
});
|
|
6017
|
+
var callerSchema = strictObject({ host: hostSchema, actor: text });
|
|
6018
|
+
var success = (revisionValue, workspaceRevisionValue, data) => ({
|
|
6019
|
+
ok: true,
|
|
6020
|
+
schemaVersion: 1,
|
|
6021
|
+
revision: revisionValue,
|
|
6022
|
+
workspaceRevision: workspaceRevisionValue,
|
|
6023
|
+
data
|
|
6024
|
+
});
|
|
6025
|
+
var failure2 = (code, error, details = {}) => ({ ok: false, schemaVersion: 1, code, error, details });
|
|
6026
|
+
function resolveIdRef(kind, ref, ids) {
|
|
6027
|
+
if (ids.includes(ref))
|
|
6028
|
+
return success(null, null, ref);
|
|
6029
|
+
const matches = ids.filter((candidate) => candidate.startsWith(ref));
|
|
6030
|
+
if (matches.length === 1)
|
|
6031
|
+
return success(null, null, matches[0]);
|
|
6032
|
+
if (matches.length === 0)
|
|
6033
|
+
return failure2("not_found", `${kind} not found`);
|
|
6034
|
+
return failure2("invalid_input", `${kind} prefix ${ref} is ambiguous; candidates: ${matches.join(", ")}`);
|
|
6035
|
+
}
|
|
6036
|
+
function canonical(value, seen) {
|
|
6037
|
+
if (value === null || typeof value === "boolean" || typeof value === "string") {
|
|
6038
|
+
if (typeof value === "string" && invalidUnicode(value))
|
|
6039
|
+
throw new TypeError("invalid Unicode");
|
|
6040
|
+
return value;
|
|
6041
|
+
}
|
|
6042
|
+
if (typeof value === "number") {
|
|
6043
|
+
if (!Number.isSafeInteger(value))
|
|
6044
|
+
throw new TypeError("number must be a finite safe integer");
|
|
6045
|
+
return value;
|
|
6046
|
+
}
|
|
6047
|
+
if (typeof value !== "object")
|
|
6048
|
+
throw new TypeError("value is not JSON serializable");
|
|
6049
|
+
if (seen.has(value))
|
|
6050
|
+
throw new TypeError("cyclic value");
|
|
6051
|
+
seen.add(value);
|
|
6052
|
+
let result;
|
|
6053
|
+
if (Array.isArray(value)) {
|
|
6054
|
+
for (let index = 0;index < value.length; index += 1) {
|
|
6055
|
+
if (!(index in value))
|
|
6056
|
+
throw new TypeError("sparse array");
|
|
6057
|
+
}
|
|
6058
|
+
result = value.map((item) => canonical(item, seen));
|
|
6059
|
+
} else {
|
|
6060
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)
|
|
6061
|
+
throw new TypeError("value is not a JSON object");
|
|
6062
|
+
if (Reflect.ownKeys(value).some((key) => typeof key !== "string"))
|
|
6063
|
+
throw new TypeError("symbol key is not JSON");
|
|
6064
|
+
if (Object.keys(value).some((key) => invalidUnicode(key)))
|
|
6065
|
+
throw new TypeError("invalid Unicode");
|
|
6066
|
+
result = Object.fromEntries(Object.keys(value).toSorted().map((key) => [key, canonical(value[key], seen)]));
|
|
6067
|
+
}
|
|
6068
|
+
seen.delete(value);
|
|
6069
|
+
return result;
|
|
6070
|
+
}
|
|
6071
|
+
function canonicalJson(value) {
|
|
6072
|
+
return JSON.stringify(canonical(value, new Set));
|
|
6073
|
+
}
|
|
6074
|
+
function sha256(value) {
|
|
6075
|
+
if (typeof value === "string" && invalidUnicode(value))
|
|
6076
|
+
throw new TypeError("invalid Unicode");
|
|
6077
|
+
return createHash("sha256").update(typeof value === "string" ? value : canonicalJson(value), "utf8").digest("hex");
|
|
6078
|
+
}
|
|
6079
|
+
function newId() {
|
|
6080
|
+
return randomUUID().toLowerCase();
|
|
6081
|
+
}
|
|
6082
|
+
function newRevision() {
|
|
6083
|
+
return randomUUID().toLowerCase();
|
|
6084
|
+
}
|
|
6085
|
+
var compareCodeUnits = (left, right) => {
|
|
6086
|
+
const length = Math.min(left.length, right.length);
|
|
6087
|
+
for (let index = 0;index < length; index += 1) {
|
|
6088
|
+
const difference = left.charCodeAt(index) - right.charCodeAt(index);
|
|
6089
|
+
if (difference !== 0)
|
|
6090
|
+
return difference;
|
|
6091
|
+
}
|
|
6092
|
+
return left.length - right.length;
|
|
6093
|
+
};
|
|
6094
|
+
var compareNullableText = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : compareCodeUnits(left, right);
|
|
6095
|
+
var compareBooleanNullable = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : Number(left) - Number(right);
|
|
6096
|
+
function decisionDigest(input) {
|
|
6097
|
+
const { digest: _ignored, revoked: _revoked, ...value } = input;
|
|
6098
|
+
return sha256(value);
|
|
6099
|
+
}
|
|
6100
|
+
function candidateDigest(input) {
|
|
6101
|
+
const normalizedScope = {
|
|
6102
|
+
description: input.scope.description,
|
|
6103
|
+
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
6104
|
+
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
6105
|
+
};
|
|
6106
|
+
return sha256({
|
|
6107
|
+
scope: normalizedScope,
|
|
6108
|
+
completeness: input.completeness,
|
|
6109
|
+
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)),
|
|
6110
|
+
environment: input.environment.map(({ name, value }) => ({ name, value })).toSorted((left, right) => compareCodeUnits(left.name, right.name) || compareNullableText(left.value, right.value)),
|
|
6111
|
+
head: input.head
|
|
6112
|
+
});
|
|
6113
|
+
}
|
|
6114
|
+
function requirementId(input) {
|
|
6115
|
+
return sha256({
|
|
6116
|
+
...input,
|
|
6117
|
+
scope: {
|
|
6118
|
+
description: input.scope.description,
|
|
6119
|
+
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
6120
|
+
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
6121
|
+
}
|
|
6122
|
+
});
|
|
6123
|
+
}
|
|
6124
|
+
// packages/workit-core/src/core/operations.ts
|
|
6768
6125
|
var base = { schemaVersion: literal(1) };
|
|
6769
6126
|
var revisions = {
|
|
6770
|
-
expectedRevision:
|
|
6771
|
-
expectedWorkspaceRevision:
|
|
6127
|
+
expectedRevision: optional(revision),
|
|
6128
|
+
expectedWorkspaceRevision: optional(revision)
|
|
6772
6129
|
};
|
|
6773
6130
|
var taskId = { taskId: id };
|
|
6774
|
-
var operation = (shape) =>
|
|
6131
|
+
var operation = (shape) => strictObject({ ...base, ...shape });
|
|
6775
6132
|
var taskOperations = {
|
|
6776
6133
|
start: operation({
|
|
6777
6134
|
action: literal("start"),
|
|
6778
|
-
expectedWorkspaceRevision:
|
|
6135
|
+
expectedWorkspaceRevision: optional(nullable(revision)),
|
|
6779
6136
|
intent: intentSchema
|
|
6780
6137
|
}),
|
|
6781
6138
|
list: operation({
|
|
6782
6139
|
action: literal("list"),
|
|
6783
|
-
status: _enum(["open", "closed", "all"])
|
|
6784
|
-
query: string2().
|
|
6785
|
-
limit: number2().int().
|
|
6140
|
+
status: optional(_enum(["open", "closed", "all"])),
|
|
6141
|
+
query: optional(string2().check(_trim()).check(_minLength(1)).check(_maxLength(200))),
|
|
6142
|
+
limit: optional(number2().check(int()).check(_gte(1)).check(_lte(50)))
|
|
6786
6143
|
}),
|
|
6787
6144
|
inspect: operation({
|
|
6788
6145
|
action: literal("inspect"),
|
|
6789
6146
|
...taskId,
|
|
6790
|
-
view: _enum(["summary", "full"])
|
|
6147
|
+
view: optional(_enum(["summary", "full"]))
|
|
6791
6148
|
}),
|
|
6792
6149
|
revise: operation({
|
|
6793
6150
|
action: literal("revise"),
|
|
6794
6151
|
...taskId,
|
|
6795
6152
|
...revisions,
|
|
6796
|
-
expectedWorkspaceRevision:
|
|
6153
|
+
expectedWorkspaceRevision: optional(revision),
|
|
6797
6154
|
intent: intentSchema,
|
|
6798
6155
|
reason: text
|
|
6799
6156
|
}),
|
|
6800
6157
|
progress: operation({
|
|
6801
6158
|
action: literal("progress"),
|
|
6802
6159
|
...taskId,
|
|
6803
|
-
expectedRevision:
|
|
6160
|
+
expectedRevision: optional(revision),
|
|
6804
6161
|
progress: progressSchema
|
|
6805
6162
|
}),
|
|
6806
6163
|
pause: operation({
|
|
6807
6164
|
action: literal("pause"),
|
|
6808
6165
|
...taskId,
|
|
6809
6166
|
...revisions,
|
|
6810
|
-
expectedWorkspaceRevision:
|
|
6167
|
+
expectedWorkspaceRevision: optional(revision),
|
|
6811
6168
|
reason: text
|
|
6812
6169
|
}),
|
|
6813
6170
|
resume: operation({
|
|
6814
6171
|
action: literal("resume"),
|
|
6815
6172
|
...taskId,
|
|
6816
6173
|
...revisions,
|
|
6817
|
-
expectedWorkspaceRevision:
|
|
6174
|
+
expectedWorkspaceRevision: optional(revision)
|
|
6818
6175
|
}),
|
|
6819
6176
|
close: operation({
|
|
6820
6177
|
action: literal("close"),
|
|
6821
6178
|
...taskId,
|
|
6822
6179
|
...revisions,
|
|
6823
|
-
expectedWorkspaceRevision:
|
|
6180
|
+
expectedWorkspaceRevision: optional(revision),
|
|
6824
6181
|
outcome: outcomeSchema,
|
|
6825
6182
|
summary: text,
|
|
6826
|
-
decisionIds: array(id)
|
|
6183
|
+
decisionIds: optional(array(id))
|
|
6827
6184
|
})
|
|
6828
6185
|
};
|
|
6829
6186
|
var rawJudgment = record(string2(), unknown());
|
|
@@ -6831,7 +6188,7 @@ var policyOperations = {
|
|
|
6831
6188
|
assess: operation({
|
|
6832
6189
|
action: literal("assess"),
|
|
6833
6190
|
...taskId,
|
|
6834
|
-
expectedRevision:
|
|
6191
|
+
expectedRevision: optional(revision),
|
|
6835
6192
|
judgment: rawJudgment
|
|
6836
6193
|
}),
|
|
6837
6194
|
preview: operation({ action: literal("preview"), ...taskId, judgment: rawJudgment }),
|
|
@@ -6841,7 +6198,7 @@ var evidenceOperations = {
|
|
|
6841
6198
|
record: operation({
|
|
6842
6199
|
action: literal("record"),
|
|
6843
6200
|
...taskId,
|
|
6844
|
-
expectedRevision:
|
|
6201
|
+
expectedRevision: optional(revision),
|
|
6845
6202
|
evidence: reportedEvidenceSchema
|
|
6846
6203
|
})
|
|
6847
6204
|
};
|
|
@@ -6849,17 +6206,17 @@ var findingOperations = {
|
|
|
6849
6206
|
record: operation({
|
|
6850
6207
|
action: literal("record"),
|
|
6851
6208
|
...taskId,
|
|
6852
|
-
expectedRevision:
|
|
6209
|
+
expectedRevision: optional(revision),
|
|
6853
6210
|
claim: text,
|
|
6854
6211
|
consequence: text,
|
|
6855
6212
|
scope: scopeSchema,
|
|
6856
|
-
candidateId:
|
|
6213
|
+
candidateId: optional(nullableDigest),
|
|
6857
6214
|
refs: array(refSchema)
|
|
6858
6215
|
}),
|
|
6859
6216
|
resolve: operation({
|
|
6860
6217
|
action: literal("resolve"),
|
|
6861
6218
|
...taskId,
|
|
6862
|
-
expectedRevision:
|
|
6219
|
+
expectedRevision: optional(revision),
|
|
6863
6220
|
findingId: idRef,
|
|
6864
6221
|
disposition: _enum(["open", "fixed", "dismissed", "deferred"]),
|
|
6865
6222
|
reason: text,
|
|
@@ -6871,11 +6228,11 @@ var decisionOperations = {
|
|
|
6871
6228
|
record: operation({
|
|
6872
6229
|
action: literal("record"),
|
|
6873
6230
|
...taskId,
|
|
6874
|
-
expectedRevision:
|
|
6231
|
+
expectedRevision: optional(revision),
|
|
6875
6232
|
purpose: decisionSchema.shape.purpose,
|
|
6876
|
-
binding: decisionSchema.shape.binding
|
|
6877
|
-
taskId:
|
|
6878
|
-
workspaceId:
|
|
6233
|
+
binding: extend2(decisionSchema.shape.binding, {
|
|
6234
|
+
taskId: optional(id),
|
|
6235
|
+
workspaceId: optional(id)
|
|
6879
6236
|
}),
|
|
6880
6237
|
response: decisionSchema.shape.response,
|
|
6881
6238
|
requirementIds: array(digest)
|
|
@@ -6883,7 +6240,7 @@ var decisionOperations = {
|
|
|
6883
6240
|
revoke: operation({
|
|
6884
6241
|
action: literal("revoke"),
|
|
6885
6242
|
...taskId,
|
|
6886
|
-
expectedRevision:
|
|
6243
|
+
expectedRevision: optional(revision),
|
|
6887
6244
|
decisionId: id,
|
|
6888
6245
|
reason: text
|
|
6889
6246
|
})
|
|
@@ -6893,14 +6250,14 @@ var workerOperations = {
|
|
|
6893
6250
|
action: literal("assign"),
|
|
6894
6251
|
...taskId,
|
|
6895
6252
|
...revisions,
|
|
6896
|
-
expectedWorkspaceRevision:
|
|
6253
|
+
expectedWorkspaceRevision: optional(revision),
|
|
6897
6254
|
assignment: assignmentSchema
|
|
6898
6255
|
}),
|
|
6899
6256
|
report: operation({
|
|
6900
6257
|
action: literal("report"),
|
|
6901
6258
|
...taskId,
|
|
6902
|
-
expectedRevision:
|
|
6903
|
-
expectedWorkspaceRevision:
|
|
6259
|
+
expectedRevision: optional(revision),
|
|
6260
|
+
expectedWorkspaceRevision: optional(revision),
|
|
6904
6261
|
workerId: idRef,
|
|
6905
6262
|
report: workerReportSchema
|
|
6906
6263
|
}),
|
|
@@ -6908,7 +6265,7 @@ var workerOperations = {
|
|
|
6908
6265
|
action: literal("cancel"),
|
|
6909
6266
|
...taskId,
|
|
6910
6267
|
...revisions,
|
|
6911
|
-
expectedWorkspaceRevision:
|
|
6268
|
+
expectedWorkspaceRevision: optional(revision),
|
|
6912
6269
|
workerId: idRef,
|
|
6913
6270
|
reason: text
|
|
6914
6271
|
})
|
|
@@ -6917,7 +6274,7 @@ var stateOperations = {
|
|
|
6917
6274
|
export: operation({ action: literal("export"), ...taskId }),
|
|
6918
6275
|
import: operation({
|
|
6919
6276
|
action: literal("import"),
|
|
6920
|
-
expectedWorkspaceRevision:
|
|
6277
|
+
expectedWorkspaceRevision: optional(nullable(revision)),
|
|
6921
6278
|
bundle: exportBundleSchema
|
|
6922
6279
|
})
|
|
6923
6280
|
};
|
|
@@ -6939,7 +6296,7 @@ var OPERATION_ACTIONS = {
|
|
|
6939
6296
|
worker: Object.keys(workerOperations),
|
|
6940
6297
|
state: Object.keys(stateOperations)
|
|
6941
6298
|
};
|
|
6942
|
-
var withImplicitTask = (options) => Object.values(options).map((option) => ("taskId" in option.shape) ? option
|
|
6299
|
+
var withImplicitTask = (options) => Object.values(options).map((option) => ("taskId" in option.shape) ? extend2(option, { taskId: optional(id) }) : option);
|
|
6943
6300
|
var advertised = (options) => discriminatedUnion("action", withImplicitTask(options));
|
|
6944
6301
|
var advertisedOperationSchemas = {
|
|
6945
6302
|
task: advertised(taskOperations),
|
|
@@ -6950,24 +6307,6 @@ var advertisedOperationSchemas = {
|
|
|
6950
6307
|
worker: advertised(workerOperations),
|
|
6951
6308
|
state: advertised(stateOperations)
|
|
6952
6309
|
};
|
|
6953
|
-
var success = (revisionValue, workspaceRevisionValue, data) => ({
|
|
6954
|
-
ok: true,
|
|
6955
|
-
schemaVersion: 1,
|
|
6956
|
-
revision: revisionValue,
|
|
6957
|
-
workspaceRevision: workspaceRevisionValue,
|
|
6958
|
-
data
|
|
6959
|
-
});
|
|
6960
|
-
var failure2 = (code, error, details = {}) => ({ ok: false, schemaVersion: 1, code, error, details });
|
|
6961
|
-
function resolveIdRef(kind, ref, ids) {
|
|
6962
|
-
if (ids.includes(ref))
|
|
6963
|
-
return success(null, null, ref);
|
|
6964
|
-
const matches = ids.filter((candidate) => candidate.startsWith(ref));
|
|
6965
|
-
if (matches.length === 1)
|
|
6966
|
-
return success(null, null, matches[0]);
|
|
6967
|
-
if (matches.length === 0)
|
|
6968
|
-
return failure2("not_found", `${kind} not found`);
|
|
6969
|
-
return failure2("invalid_input", `${kind} prefix ${ref} is ambiguous; candidates: ${matches.join(", ")}`);
|
|
6970
|
-
}
|
|
6971
6310
|
function parseOperation(family, input) {
|
|
6972
6311
|
if (typeof input === "object" && input !== null && "schemaVersion" in input && input.schemaVersion !== SCHEMA_VERSION)
|
|
6973
6312
|
return failure2("unsupported_version", "unsupported schema version", { operation: family });
|
|
@@ -6980,125 +6319,37 @@ function parseOperation(family, input) {
|
|
|
6980
6319
|
}));
|
|
6981
6320
|
return failure2("invalid_input", "operation input is invalid", { fields });
|
|
6982
6321
|
}
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
}
|
|
7015
|
-
seen.delete(value);
|
|
7016
|
-
return result;
|
|
7017
|
-
}
|
|
7018
|
-
function canonicalJson(value) {
|
|
7019
|
-
return JSON.stringify(canonical(value, new Set));
|
|
7020
|
-
}
|
|
7021
|
-
function sha256(value) {
|
|
7022
|
-
if (typeof value === "string" && invalidUnicode(value))
|
|
7023
|
-
throw new TypeError("invalid Unicode");
|
|
7024
|
-
return createHash("sha256").update(typeof value === "string" ? value : canonicalJson(value), "utf8").digest("hex");
|
|
7025
|
-
}
|
|
7026
|
-
function newId() {
|
|
7027
|
-
return randomUUID().toLowerCase();
|
|
7028
|
-
}
|
|
7029
|
-
function newRevision() {
|
|
7030
|
-
return randomUUID().toLowerCase();
|
|
7031
|
-
}
|
|
7032
|
-
var compareCodeUnits = (left, right) => {
|
|
7033
|
-
const length = Math.min(left.length, right.length);
|
|
7034
|
-
for (let index = 0;index < length; index += 1) {
|
|
7035
|
-
const difference = left.charCodeAt(index) - right.charCodeAt(index);
|
|
7036
|
-
if (difference !== 0)
|
|
7037
|
-
return difference;
|
|
7038
|
-
}
|
|
7039
|
-
return left.length - right.length;
|
|
7040
|
-
};
|
|
7041
|
-
var compareNullableText = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : compareCodeUnits(left, right);
|
|
7042
|
-
var compareBooleanNullable = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : Number(left) - Number(right);
|
|
7043
|
-
function decisionDigest(input) {
|
|
7044
|
-
const { digest: _ignored, revoked: _revoked, ...value } = input;
|
|
7045
|
-
return sha256(value);
|
|
7046
|
-
}
|
|
7047
|
-
function candidateDigest(input) {
|
|
7048
|
-
const normalizedScope = {
|
|
7049
|
-
description: input.scope.description,
|
|
7050
|
-
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
7051
|
-
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
7052
|
-
};
|
|
7053
|
-
return sha256({
|
|
7054
|
-
scope: normalizedScope,
|
|
7055
|
-
completeness: input.completeness,
|
|
7056
|
-
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)),
|
|
7057
|
-
environment: input.environment.map(({ name, value }) => ({ name, value })).toSorted((left, right) => compareCodeUnits(left.name, right.name) || compareNullableText(left.value, right.value)),
|
|
7058
|
-
head: input.head
|
|
7059
|
-
});
|
|
7060
|
-
}
|
|
7061
|
-
function requirementId(input) {
|
|
7062
|
-
return sha256({
|
|
7063
|
-
...input,
|
|
7064
|
-
scope: {
|
|
7065
|
-
description: input.scope.description,
|
|
7066
|
-
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
7067
|
-
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
7068
|
-
}
|
|
7069
|
-
});
|
|
7070
|
-
}
|
|
7071
|
-
// packages/workit-core/src/core/operation-input.ts
|
|
7072
|
-
var str = (d, values) => ({
|
|
7073
|
-
type: "string",
|
|
7074
|
-
...values ? { enum: values } : {},
|
|
7075
|
-
...d ? { d } : {}
|
|
7076
|
-
});
|
|
7077
|
-
var list = (d) => ({ type: "array", ...d ? { d } : {} });
|
|
7078
|
-
var bool = (d) => ({ type: "boolean", ...d ? { d } : {} });
|
|
7079
|
-
var int2 = (d) => ({ type: "integer", ...d ? { d } : {} });
|
|
7080
|
-
var scopeFields = {
|
|
7081
|
-
paths: list("Scope paths (default: whole checkout)."),
|
|
7082
|
-
exclusions: list(),
|
|
7083
|
-
scope: str("Scope description.")
|
|
7084
|
-
};
|
|
7085
|
-
var refs = list("Paths or URLs.");
|
|
7086
|
-
var FLAT = {
|
|
7087
|
-
task: {
|
|
7088
|
-
fields: {
|
|
7089
|
-
objective: str(),
|
|
7090
|
-
...scopeFields,
|
|
7091
|
-
refs,
|
|
7092
|
-
reason: str(),
|
|
7093
|
-
summary: str(),
|
|
7094
|
-
nextAction: str(),
|
|
7095
|
-
blockers: list(),
|
|
7096
|
-
outcome: str(undefined, ["verified", "accepted_limitations", "stopped"]),
|
|
7097
|
-
decisionIds: list(),
|
|
7098
|
-
status: str(undefined, ["open", "closed", "all"]),
|
|
7099
|
-
query: str(),
|
|
7100
|
-
limit: int2(),
|
|
7101
|
-
view: str(undefined, ["summary", "full"])
|
|
6322
|
+
// packages/workit-core/src/core/operation-input.ts
|
|
6323
|
+
var str = (d, values) => ({
|
|
6324
|
+
type: "string",
|
|
6325
|
+
...values ? { enum: values } : {},
|
|
6326
|
+
...d ? { d } : {}
|
|
6327
|
+
});
|
|
6328
|
+
var list = (d) => ({ type: "array", ...d ? { d } : {} });
|
|
6329
|
+
var bool = (d) => ({ type: "boolean", ...d ? { d } : {} });
|
|
6330
|
+
var int2 = (d) => ({ type: "integer", ...d ? { d } : {} });
|
|
6331
|
+
var scopeFields = {
|
|
6332
|
+
paths: list("Scope paths (default: whole checkout)."),
|
|
6333
|
+
exclusions: list(),
|
|
6334
|
+
scope: str("Scope description.")
|
|
6335
|
+
};
|
|
6336
|
+
var refs = list("Paths or URLs.");
|
|
6337
|
+
var FLAT = {
|
|
6338
|
+
task: {
|
|
6339
|
+
fields: {
|
|
6340
|
+
objective: str(),
|
|
6341
|
+
...scopeFields,
|
|
6342
|
+
refs,
|
|
6343
|
+
reason: str(),
|
|
6344
|
+
summary: str(),
|
|
6345
|
+
nextAction: str(),
|
|
6346
|
+
blockers: list(),
|
|
6347
|
+
outcome: str(undefined, ["verified", "accepted_limitations", "stopped"]),
|
|
6348
|
+
decisionIds: list(),
|
|
6349
|
+
status: str(undefined, ["open", "closed", "all"]),
|
|
6350
|
+
query: str(),
|
|
6351
|
+
limit: int2(),
|
|
6352
|
+
view: str(undefined, ["summary", "full"])
|
|
7102
6353
|
}
|
|
7103
6354
|
},
|
|
7104
6355
|
policy: {
|
|
@@ -7466,7 +6717,7 @@ var FLAT_NAME = {
|
|
|
7466
6717
|
};
|
|
7467
6718
|
var NOT_FLAT = new Set(["schemaVersion", "action", "workspaceId"]);
|
|
7468
6719
|
function actionKeys(family, action) {
|
|
7469
|
-
const options = advertisedOperationSchemas[family].options;
|
|
6720
|
+
const options = advertisedOperationSchemas[family]._zod.def.options;
|
|
7470
6721
|
const option = options.find((item) => {
|
|
7471
6722
|
const literal = defOf(item).shape?.action;
|
|
7472
6723
|
return literal._zod.def.values.includes(action);
|
|
@@ -9123,59 +8374,57 @@ var pushTarget = (cwd, remote, replay = {}) => {
|
|
|
9123
8374
|
};
|
|
9124
8375
|
|
|
9125
8376
|
// packages/workit-core/src/core/workspaces.ts
|
|
9126
|
-
var nonBlank = string2().refine((value) => value.trim().length > 0, "must not be blank");
|
|
8377
|
+
var nonBlank = string2().check(refine((value) => value.trim().length > 0, "must not be blank"));
|
|
9127
8378
|
var branchPreset = custom((value) => typeof value === "string" && Object.hasOwn(PRESETS, value), "unsupported branch preset");
|
|
9128
8379
|
var commitPreset = custom((value) => typeof value === "string" && COMMIT_PRESETS.includes(value), "unsupported commit preset");
|
|
9129
|
-
var workspaceBranchPolicySchema =
|
|
9130
|
-
preset: branchPreset
|
|
9131
|
-
developBranch:
|
|
9132
|
-
prefixes:
|
|
8380
|
+
var workspaceBranchPolicySchema = strictObject({
|
|
8381
|
+
preset: described(branchPreset, "The branch model: gitflow, github-flow, trunk-based or custom (allowed/protected set by hand)."),
|
|
8382
|
+
developBranch: described(optional(nonBlank), "The integration branch gitflow uses (default develop)."),
|
|
8383
|
+
prefixes: described(optional(looseObject({
|
|
9133
8384
|
feature: nonBlank,
|
|
9134
8385
|
bugfix: nonBlank,
|
|
9135
8386
|
release: nonBlank,
|
|
9136
8387
|
hotfix: nonBlank
|
|
9137
|
-
})
|
|
9138
|
-
allowed: array(nonBlank)
|
|
9139
|
-
protected: array(nonBlank)
|
|
9140
|
-
integration: _enum(["pr", "merge"])
|
|
9141
|
-
}).strict();
|
|
9142
|
-
var workspaceCommitPolicySchema = object({
|
|
9143
|
-
preset: commitPreset.describe("The commit message flavor, e.g. conventional."),
|
|
9144
|
-
pattern: string2().optional().describe("A regular expression every commit subject must match.")
|
|
9145
|
-
}).strict();
|
|
9146
|
-
var workspaceProfileSchema = object({
|
|
9147
|
-
branchPolicy: workspaceBranchPolicySchema.optional().describe("This profile's branch policy."),
|
|
9148
|
-
commitPolicy: workspaceCommitPolicySchema.optional().describe("This profile's commit policy.")
|
|
9149
|
-
}).strict().refine((profile) => profile.branchPolicy !== undefined || profile.commitPolicy !== undefined, {
|
|
9150
|
-
message: "a profile must define branchPolicy or commitPolicy"
|
|
8388
|
+
})), "The branch prefix per kind (feature/, bugfix/, release/, hotfix/)."),
|
|
8389
|
+
allowed: described(optional(array(nonBlank)), "Branch name globs a new branch must match (`feature/*`)."),
|
|
8390
|
+
protected: described(optional(array(nonBlank)), "Branches nobody commits or pushes to directly."),
|
|
8391
|
+
integration: described(optional(_enum(["pr", "merge"])), "How work reaches its base: `pr` (default) opens a PR, `merge` merges locally.")
|
|
9151
8392
|
});
|
|
8393
|
+
var workspaceCommitPolicySchema = strictObject({
|
|
8394
|
+
preset: described(commitPreset, "The commit message flavor, e.g. conventional."),
|
|
8395
|
+
pattern: described(optional(string2()), "A regular expression every commit subject must match.")
|
|
8396
|
+
});
|
|
8397
|
+
var workspaceProfileSchema = strictObject({
|
|
8398
|
+
branchPolicy: described(optional(workspaceBranchPolicySchema), "This profile's branch policy."),
|
|
8399
|
+
commitPolicy: described(optional(workspaceCommitPolicySchema), "This profile's commit policy.")
|
|
8400
|
+
}).check(refine((profile) => profile.branchPolicy !== undefined || profile.commitPolicy !== undefined, { message: "a profile must define branchPolicy or commitPolicy" }));
|
|
9152
8401
|
var versionSourceSchema = discriminatedUnion("kind", [
|
|
9153
|
-
|
|
8402
|
+
strictObject({
|
|
9154
8403
|
kind: literal("package-json"),
|
|
9155
8404
|
path: nonBlank,
|
|
9156
8405
|
field: nonBlank
|
|
9157
|
-
})
|
|
9158
|
-
|
|
9159
|
-
|
|
8406
|
+
}),
|
|
8407
|
+
strictObject({ kind: literal("git-tag") }),
|
|
8408
|
+
strictObject({ kind: literal("manual") })
|
|
9160
8409
|
]);
|
|
9161
|
-
var releaseTrackSchema =
|
|
9162
|
-
strategy:
|
|
9163
|
-
productionBranch: nonBlank
|
|
9164
|
-
integrationBranch: nonBlank
|
|
9165
|
-
naming:
|
|
9166
|
-
feature:
|
|
9167
|
-
release:
|
|
9168
|
-
hotfix:
|
|
9169
|
-
})
|
|
9170
|
-
baseBranch:
|
|
9171
|
-
mergeBackBranches: array(nonBlank)
|
|
9172
|
-
pullRequestTarget:
|
|
9173
|
-
tagNamespace:
|
|
9174
|
-
versionSource:
|
|
9175
|
-
requiredChecks: array(nonBlank)
|
|
9176
|
-
critical: array(nonBlank)
|
|
9177
|
-
releaseNotes:
|
|
9178
|
-
}).
|
|
8410
|
+
var releaseTrackSchema = looseObject({
|
|
8411
|
+
strategy: described(optional(branchPreset), "The branch model this track follows."),
|
|
8412
|
+
productionBranch: described(nonBlank, "The branch releases land on (main)."),
|
|
8413
|
+
integrationBranch: described(nonBlank, "The branch work integrates into (develop)."),
|
|
8414
|
+
naming: described(optional(looseObject({
|
|
8415
|
+
feature: optional(nonBlank),
|
|
8416
|
+
release: optional(nonBlank),
|
|
8417
|
+
hotfix: optional(nonBlank)
|
|
8418
|
+
})), "Branch name templates per kind, e.g. `feature/{name}`."),
|
|
8419
|
+
baseBranch: described(optional(nonBlank), "The branch new work starts from."),
|
|
8420
|
+
mergeBackBranches: described(optional(array(nonBlank)), "Branches a finished release or hotfix is merged back into."),
|
|
8421
|
+
pullRequestTarget: described(optional(nonBlank), "The branch PRs target."),
|
|
8422
|
+
tagNamespace: described(optional(string2()), "A prefix for this track's release tags."),
|
|
8423
|
+
versionSource: described(optional(versionSourceSchema), "Where the version comes from: package-json, git-tag or manual."),
|
|
8424
|
+
requiredChecks: described(optional(array(nonBlank)), "CI checks that must pass before a release."),
|
|
8425
|
+
critical: described(optional(array(nonBlank)), "Fields an older Workit must not ignore: when one is unknown or malformed, Workit fails closed."),
|
|
8426
|
+
releaseNotes: described(optional(unknown()), "This track's release notes mode, over the workspace's `releaseNotes`.")
|
|
8427
|
+
}).check(superRefine((track, context) => {
|
|
9179
8428
|
for (const [field, values] of [
|
|
9180
8429
|
["mergeBackBranches", track.mergeBackBranches ?? []],
|
|
9181
8430
|
["requiredChecks", track.requiredChecks ?? []]
|
|
@@ -9195,67 +8444,67 @@ var releaseTrackSchema = object({
|
|
|
9195
8444
|
message: "must stay inside the repository"
|
|
9196
8445
|
});
|
|
9197
8446
|
}
|
|
9198
|
-
});
|
|
9199
|
-
var modelRoles =
|
|
9200
|
-
var workspaceConfigSchema =
|
|
9201
|
-
name: nonBlank
|
|
9202
|
-
glob: nonBlank
|
|
9203
|
-
vcs:
|
|
9204
|
-
provider: _enum(["gitlab", "github"])
|
|
9205
|
-
defaultTargetBranch:
|
|
9206
|
-
tokenFile:
|
|
9207
|
-
account:
|
|
9208
|
-
host:
|
|
9209
|
-
})
|
|
9210
|
-
autoApprove: union([boolean2(), array(nonBlank)])
|
|
9211
|
-
defaultEndpoint:
|
|
9212
|
-
verification: _enum(["proportional", "self", "independent"])
|
|
9213
|
-
delegation:
|
|
9214
|
-
changelog:
|
|
9215
|
-
docs:
|
|
9216
|
-
changelogPath:
|
|
9217
|
-
prTemplate:
|
|
9218
|
-
releaseNotes:
|
|
9219
|
-
trailers:
|
|
9220
|
-
deleteBranch:
|
|
9221
|
-
cleanup:
|
|
9222
|
-
feedback:
|
|
9223
|
-
liveSessionGuard:
|
|
9224
|
-
fanout:
|
|
9225
|
-
tierModels:
|
|
9226
|
-
deps:
|
|
9227
|
-
installTimeout:
|
|
9228
|
-
})
|
|
9229
|
-
models:
|
|
9230
|
-
resources:
|
|
9231
|
-
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/*)"))
|
|
9232
|
-
externalRepos: array(nonBlank.
|
|
9233
|
-
autonomy:
|
|
8447
|
+
}));
|
|
8448
|
+
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).");
|
|
8449
|
+
var workspaceConfigSchema = looseObject({
|
|
8450
|
+
name: described(nonBlank, "The workspace's unique name."),
|
|
8451
|
+
glob: described(nonBlank, "The directories this entry covers, an absolute path glob with * and ** (`/home/you/work/**`); the narrowest match wins."),
|
|
8452
|
+
vcs: described(optional(looseObject({
|
|
8453
|
+
provider: described(_enum(["gitlab", "github"]), "The forge: github or gitlab."),
|
|
8454
|
+
defaultTargetBranch: described(optional(nonBlank), "The branch PRs target by default."),
|
|
8455
|
+
tokenFile: described(optional(nonBlank), "A file holding the forge token for this workspace."),
|
|
8456
|
+
account: described(optional(nonBlank), "The forge login delivery runs as; grants need it to reach the forge."),
|
|
8457
|
+
host: described(optional(unknown()), "A self-hosted forge's host name.")
|
|
8458
|
+
})), "The forge this workspace's repositories live on."),
|
|
8459
|
+
autoApprove: described(optional(union([boolean2(), array(nonBlank)])), "Legacy (≤4.x) standing approvals, read once as autonomy grants; use `autonomy`."),
|
|
8460
|
+
defaultEndpoint: described(optional(unknown()), "Where an unnamed request stops: commit (default), pr, green or merged. Set with `workit grant set`, like grants."),
|
|
8461
|
+
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."),
|
|
8462
|
+
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."),
|
|
8463
|
+
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."),
|
|
8464
|
+
docs: described(optional(unknown()), "The docs refresh the ship skill does before a PR opens: `off` (default) or `when-user-facing`."),
|
|
8465
|
+
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."),
|
|
8466
|
+
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."),
|
|
8467
|
+
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."),
|
|
8468
|
+
trailers: described(optional(boolean2()), "Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
|
|
8469
|
+
deleteBranch: described(optional(boolean2()), "Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
|
|
8470
|
+
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`."),
|
|
8471
|
+
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.'),
|
|
8472
|
+
liveSessionGuard: described(optional(boolean2()), "Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
8473
|
+
fanout: described(optional(looseObject({
|
|
8474
|
+
tierModels: described(optional(unknown()), "The model per slice TIER (mundane, standard, hard), as one name or per host."),
|
|
8475
|
+
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."),
|
|
8476
|
+
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.")
|
|
8477
|
+
})), "Fanout settings."),
|
|
8478
|
+
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."),
|
|
8479
|
+
resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
|
|
8480
|
+
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."),
|
|
8481
|
+
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."),
|
|
8482
|
+
autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
|
|
9234
8483
|
kind,
|
|
9235
|
-
union([boolean2(), literal("verified")])
|
|
9236
|
-
])))
|
|
9237
|
-
youtrack:
|
|
9238
|
-
baseUrl:
|
|
9239
|
-
link_issues:
|
|
9240
|
-
writes: _enum(["ask", "auto"])
|
|
9241
|
-
autoHosts: array(nonBlank)
|
|
9242
|
-
})
|
|
9243
|
-
issues:
|
|
9244
|
-
provider: _enum(["github", "gitlab", "youtrack"])
|
|
9245
|
-
link:
|
|
9246
|
-
relation:
|
|
9247
|
-
backlink:
|
|
9248
|
-
link_on_pr:
|
|
9249
|
-
repo:
|
|
9250
|
-
host:
|
|
9251
|
-
})
|
|
9252
|
-
branchPolicy:
|
|
9253
|
-
commitPolicy:
|
|
9254
|
-
defaultProfile:
|
|
9255
|
-
profiles: record(nonBlank, workspaceProfileSchema)
|
|
9256
|
-
releaseTracks: record(nonBlank, releaseTrackSchema)
|
|
9257
|
-
releasePackages:
|
|
9258
|
-
}).
|
|
8484
|
+
described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
|
|
8485
|
+
])))), "Autonomy grants (D15): only ever set here, by the user, with `workit grant set`."),
|
|
8486
|
+
youtrack: described(optional(looseObject({
|
|
8487
|
+
baseUrl: described(optional(nonBlank), "This workspace's YouTrack URL."),
|
|
8488
|
+
link_issues: described(optional(boolean2()), "Legacy alias of `issues: { provider: youtrack, link: true }`."),
|
|
8489
|
+
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."),
|
|
8490
|
+
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`).")
|
|
8491
|
+
})), "YouTrack settings for this workspace."),
|
|
8492
|
+
issues: described(optional(looseObject({
|
|
8493
|
+
provider: described(optional(_enum(["github", "gitlab", "youtrack"])), "The issue tracker PRs link to."),
|
|
8494
|
+
link: described(optional(boolean2()), "Derive the issue from the branch name."),
|
|
8495
|
+
relation: described(optional(unknown()), "How a PR names its issue: `closes` (default) or `refs`."),
|
|
8496
|
+
backlink: described(optional(boolean2()), "Post the PR URL on each linked issue after the PR is opened."),
|
|
8497
|
+
link_on_pr: described(optional(boolean2()), "Legacy alias of `link`."),
|
|
8498
|
+
repo: described(optional(unknown()), "The GitHub/GitLab repository (owner/name) that holds the issues; default the PR's own."),
|
|
8499
|
+
host: described(optional(unknown()), "That repository's host; default the PR's host, or the tracker's public one.")
|
|
8500
|
+
})), "The issue tracker PRs link to (any forge with any tracker)."),
|
|
8501
|
+
branchPolicy: described(optional(workspaceBranchPolicySchema), "Which branches may be created and which are protected."),
|
|
8502
|
+
commitPolicy: described(optional(workspaceCommitPolicySchema), "The commit message rules."),
|
|
8503
|
+
defaultProfile: described(optional(nonBlank), "The profile used when none is named; must be a key of `profiles`."),
|
|
8504
|
+
profiles: described(optional(record(nonBlank, workspaceProfileSchema)), "Named branch/commit policy variants of this workspace."),
|
|
8505
|
+
releaseTracks: described(optional(record(nonBlank, releaseTrackSchema)), "Named release tracks: production and integration branches, naming and versioning."),
|
|
8506
|
+
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.")
|
|
8507
|
+
}).check(superRefine((workspace, context) => {
|
|
9259
8508
|
if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
|
|
9260
8509
|
context.addIssue({
|
|
9261
8510
|
code: "custom",
|
|
@@ -9263,14 +8512,14 @@ var workspaceConfigSchema = object({
|
|
|
9263
8512
|
message: `does not name a configured profile`
|
|
9264
8513
|
});
|
|
9265
8514
|
}
|
|
9266
|
-
});
|
|
9267
|
-
var workspacesFileSchema =
|
|
9268
|
-
workspaces: array(workspaceConfigSchema)
|
|
9269
|
-
models:
|
|
9270
|
-
feedback:
|
|
9271
|
-
account:
|
|
9272
|
-
})
|
|
9273
|
-
}).
|
|
8515
|
+
}));
|
|
8516
|
+
var workspacesFileSchema = looseObject({
|
|
8517
|
+
workspaces: described(optional(array(workspaceConfigSchema)), "Workspace entries, each mapping a path glob to its forge, policies and grants."),
|
|
8518
|
+
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)."),
|
|
8519
|
+
feedback: described(optional(looseObject({
|
|
8520
|
+
account: described(optional(nonBlank), "The GitHub login `workit feedback --post` uses when no workspace names one; never the workspace's work account by default.")
|
|
8521
|
+
})), "`workit feedback` defaults for every workspace.")
|
|
8522
|
+
}).check(superRefine((file, context) => {
|
|
9274
8523
|
const names = new Set;
|
|
9275
8524
|
for (const [index, workspace] of (file.workspaces ?? []).entries()) {
|
|
9276
8525
|
if (names.has(workspace.name)) {
|
|
@@ -9282,7 +8531,7 @@ var workspacesFileSchema = object({
|
|
|
9282
8531
|
}
|
|
9283
8532
|
names.add(workspace.name);
|
|
9284
8533
|
}
|
|
9285
|
-
});
|
|
8534
|
+
}));
|
|
9286
8535
|
var workspacesRevision = (contents) => createHash4("sha256").update(contents ?? "<missing>").digest("hex");
|
|
9287
8536
|
var validateWorkspacesDocument = (parsed, file) => {
|
|
9288
8537
|
if (!isConfigObject(parsed)) {
|
|
@@ -9627,25 +8876,25 @@ var resolveWorkspaceFrom = (cwd, dir, workspaceName) => {
|
|
|
9627
8876
|
};
|
|
9628
8877
|
var runtimeWorkspacePolicySchema = (kind) => {
|
|
9629
8878
|
const key = kind === "branch" ? "branchPolicy" : kind === "commit" ? "commitPolicy" : "vcs";
|
|
9630
|
-
const policySchema = kind === "branch" ? workspaceBranchPolicySchema : kind === "commit" ? workspaceCommitPolicySchema :
|
|
8879
|
+
const policySchema = kind === "branch" ? workspaceBranchPolicySchema : kind === "commit" ? workspaceCommitPolicySchema : looseObject({
|
|
9631
8880
|
provider: _enum(["gitlab", "github"]),
|
|
9632
|
-
defaultTargetBranch:
|
|
9633
|
-
account:
|
|
9634
|
-
})
|
|
9635
|
-
const profileSchema =
|
|
9636
|
-
const entrySchema =
|
|
8881
|
+
defaultTargetBranch: optional(nonBlank),
|
|
8882
|
+
account: optional(nonBlank)
|
|
8883
|
+
});
|
|
8884
|
+
const profileSchema = looseObject({ [key]: optional(policySchema) });
|
|
8885
|
+
const entrySchema = looseObject({
|
|
9637
8886
|
name: nonBlank,
|
|
9638
8887
|
glob: nonBlank,
|
|
9639
|
-
[key]:
|
|
9640
|
-
defaultProfile:
|
|
9641
|
-
profiles: record(nonBlank, profileSchema)
|
|
9642
|
-
})
|
|
8888
|
+
[key]: optional(policySchema),
|
|
8889
|
+
defaultProfile: optional(nonBlank),
|
|
8890
|
+
profiles: optional(record(nonBlank, profileSchema))
|
|
8891
|
+
});
|
|
9643
8892
|
return entrySchema;
|
|
9644
8893
|
};
|
|
9645
8894
|
var resolveRuntimeWorkspaceVcs = (cwd) => resolveRuntimeWorkspaceCandidate(cwd, "vcs");
|
|
9646
|
-
var runtimeWorkspaceIndexSchema =
|
|
9647
|
-
workspaces: array(
|
|
9648
|
-
})
|
|
8895
|
+
var runtimeWorkspaceIndexSchema = looseObject({
|
|
8896
|
+
workspaces: optional(array(looseObject({ name: nonBlank, glob: nonBlank })))
|
|
8897
|
+
});
|
|
9649
8898
|
var matchRuntimeWorkspace = (cwd, dir = configDir2()) => {
|
|
9650
8899
|
const file = path7.join(dir, "workspaces.json");
|
|
9651
8900
|
let raw;
|
|
@@ -12611,13 +11860,13 @@ var assetRoot = () => {
|
|
|
12611
11860
|
import { spawnSync as spawnSync10 } from "node:child_process";
|
|
12612
11861
|
import fs12 from "node:fs";
|
|
12613
11862
|
import { hostname } from "node:os";
|
|
12614
|
-
var metadataLockSchema =
|
|
12615
|
-
pid: number2().int()
|
|
12616
|
-
processStart: string2()
|
|
12617
|
-
host: string2().
|
|
12618
|
-
nonce: string2().
|
|
12619
|
-
externalAction: literal(true)
|
|
12620
|
-
})
|
|
11863
|
+
var metadataLockSchema = strictObject({
|
|
11864
|
+
pid: number2().check(int(), _nonnegative(), int()),
|
|
11865
|
+
processStart: nullable(string2()),
|
|
11866
|
+
host: string2().check(_minLength(1)),
|
|
11867
|
+
nonce: string2().check(_minLength(1)),
|
|
11868
|
+
externalAction: optional(literal(true))
|
|
11869
|
+
});
|
|
12621
11870
|
var FOREIGN_LOCK_TTL_MS = 10 * 60000;
|
|
12622
11871
|
var UNREADABLE_LOCK_TTL_MS = 30000;
|
|
12623
11872
|
var RECLAIM_GUARD_TTL_MS = 30000;
|
|
@@ -19616,7 +18865,7 @@ function writeFileAtomic(file, content, mode) {
|
|
|
19616
18865
|
var SEAL_FILE = "workspaces.json.seal";
|
|
19617
18866
|
var SEAL_VERSION = 1;
|
|
19618
18867
|
var SEAL_COMMAND = "workit workspace seal";
|
|
19619
|
-
var
|
|
18868
|
+
var pick3 = (value, keys) => {
|
|
19620
18869
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
19621
18870
|
return;
|
|
19622
18871
|
const out = Object.fromEntries(keys.flatMap((key) => {
|
|
@@ -19639,11 +18888,11 @@ var ENTRY_KEYS = [
|
|
|
19639
18888
|
];
|
|
19640
18889
|
var IDENTITY_KEYS = ["provider", "account", "tokenFile", "host"];
|
|
19641
18890
|
var sealProjection = (entries) => entries.map((entry) => {
|
|
19642
|
-
const all =
|
|
19643
|
-
return
|
|
18891
|
+
const all = pick3(entry, ENTRY_KEYS) ?? {};
|
|
18892
|
+
return pick3({
|
|
19644
18893
|
...all,
|
|
19645
|
-
vcs:
|
|
19646
|
-
youtrack:
|
|
18894
|
+
vcs: pick3(all.vcs, IDENTITY_KEYS),
|
|
18895
|
+
youtrack: pick3(all.youtrack, ["writes", "autoHosts"])
|
|
19647
18896
|
}, ENTRY_KEYS);
|
|
19648
18897
|
});
|
|
19649
18898
|
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);
|
|
@@ -24794,6 +24043,824 @@ class WorkitCore {
|
|
|
24794
24043
|
return this.summary(changed.data.task);
|
|
24795
24044
|
}
|
|
24796
24045
|
}
|
|
24046
|
+
// node_modules/zod/v4/classic/errors.js
|
|
24047
|
+
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
24048
|
+
function _lazyMethod(proto, key, make) {
|
|
24049
|
+
Object.defineProperty(proto, key, {
|
|
24050
|
+
configurable: true,
|
|
24051
|
+
enumerable: false,
|
|
24052
|
+
get() {
|
|
24053
|
+
const value = make(this);
|
|
24054
|
+
Object.defineProperty(this, key, { value, configurable: true, writable: true });
|
|
24055
|
+
return value;
|
|
24056
|
+
},
|
|
24057
|
+
set(value) {
|
|
24058
|
+
Object.defineProperty(this, key, { value, configurable: true, writable: true });
|
|
24059
|
+
}
|
|
24060
|
+
});
|
|
24061
|
+
}
|
|
24062
|
+
var initializer2 = (inst, issues) => {
|
|
24063
|
+
$ZodError.init(inst, issues);
|
|
24064
|
+
inst.name = "ZodError";
|
|
24065
|
+
const proto = Object.getPrototypeOf(inst);
|
|
24066
|
+
if (_installedErrorProtos.has(proto))
|
|
24067
|
+
return;
|
|
24068
|
+
_installedErrorProtos.add(proto);
|
|
24069
|
+
_lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
|
|
24070
|
+
_lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
|
|
24071
|
+
_lazyMethod(proto, "addIssue", (self) => (issue) => {
|
|
24072
|
+
self.issues.push(issue);
|
|
24073
|
+
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
24074
|
+
});
|
|
24075
|
+
_lazyMethod(proto, "addIssues", (self) => (issues) => {
|
|
24076
|
+
self.issues.push(...issues);
|
|
24077
|
+
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
24078
|
+
});
|
|
24079
|
+
Object.defineProperty(proto, "isEmpty", {
|
|
24080
|
+
configurable: true,
|
|
24081
|
+
enumerable: false,
|
|
24082
|
+
get() {
|
|
24083
|
+
return this.issues.length === 0;
|
|
24084
|
+
}
|
|
24085
|
+
});
|
|
24086
|
+
};
|
|
24087
|
+
var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, undefined, {
|
|
24088
|
+
Parent: Error
|
|
24089
|
+
});
|
|
24090
|
+
|
|
24091
|
+
// node_modules/zod/v4/classic/parse.js
|
|
24092
|
+
var parse4 = /* @__PURE__ */ _parse(ZodRealError);
|
|
24093
|
+
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
24094
|
+
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
24095
|
+
var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
24096
|
+
var encode2 = /* @__PURE__ */ _encode(ZodRealError);
|
|
24097
|
+
var decode3 = /* @__PURE__ */ _decode(ZodRealError);
|
|
24098
|
+
var encodeAsync2 = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
24099
|
+
var decodeAsync2 = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
24100
|
+
var safeEncode2 = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
24101
|
+
var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
24102
|
+
var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
24103
|
+
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
24104
|
+
|
|
24105
|
+
// node_modules/zod/v4/classic/schemas.js
|
|
24106
|
+
function _ensureDefaultLocale() {
|
|
24107
|
+
if (!globalConfig.localeError)
|
|
24108
|
+
config(en_default());
|
|
24109
|
+
}
|
|
24110
|
+
function _ensureDefaultMemoizer() {
|
|
24111
|
+
if (!globalConfig.memoizer)
|
|
24112
|
+
config({ memoizer: memoizer() });
|
|
24113
|
+
}
|
|
24114
|
+
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
24115
|
+
_ensureDefaultLocale();
|
|
24116
|
+
$ZodType.init(inst, def);
|
|
24117
|
+
inst.def = def;
|
|
24118
|
+
inst.type = def.type;
|
|
24119
|
+
return inst;
|
|
24120
|
+
}, {
|
|
24121
|
+
check(...chks) {
|
|
24122
|
+
const def = this.def;
|
|
24123
|
+
return this.clone(mergeDefs(def, {
|
|
24124
|
+
checks: [
|
|
24125
|
+
...def.checks ?? [],
|
|
24126
|
+
...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
24127
|
+
]
|
|
24128
|
+
}), { parent: true });
|
|
24129
|
+
},
|
|
24130
|
+
with(...chks) {
|
|
24131
|
+
return this.check(...chks);
|
|
24132
|
+
},
|
|
24133
|
+
clone(def, params) {
|
|
24134
|
+
return clone(this, def, params);
|
|
24135
|
+
},
|
|
24136
|
+
brand() {
|
|
24137
|
+
return this;
|
|
24138
|
+
},
|
|
24139
|
+
register(reg, meta) {
|
|
24140
|
+
reg.add(this, meta);
|
|
24141
|
+
return this;
|
|
24142
|
+
},
|
|
24143
|
+
refine(check, params) {
|
|
24144
|
+
return this.check(refine2(check, params));
|
|
24145
|
+
},
|
|
24146
|
+
superRefine(refinement, params) {
|
|
24147
|
+
return this.check(superRefine2(refinement, params));
|
|
24148
|
+
},
|
|
24149
|
+
overwrite(fn) {
|
|
24150
|
+
return this.check(_overwrite(fn));
|
|
24151
|
+
},
|
|
24152
|
+
optional() {
|
|
24153
|
+
return optional2(this);
|
|
24154
|
+
},
|
|
24155
|
+
exactOptional() {
|
|
24156
|
+
return exactOptional(this);
|
|
24157
|
+
},
|
|
24158
|
+
nullable() {
|
|
24159
|
+
return nullable2(this);
|
|
24160
|
+
},
|
|
24161
|
+
nullish() {
|
|
24162
|
+
return optional2(nullable2(this));
|
|
24163
|
+
},
|
|
24164
|
+
nonoptional(params) {
|
|
24165
|
+
return nonoptional(this, params);
|
|
24166
|
+
},
|
|
24167
|
+
array() {
|
|
24168
|
+
return array2(this);
|
|
24169
|
+
},
|
|
24170
|
+
or(arg) {
|
|
24171
|
+
return union2([this, arg]);
|
|
24172
|
+
},
|
|
24173
|
+
and(arg) {
|
|
24174
|
+
return intersection(this, arg);
|
|
24175
|
+
},
|
|
24176
|
+
transform(tx) {
|
|
24177
|
+
return pipe(this, transform(tx));
|
|
24178
|
+
},
|
|
24179
|
+
default(d) {
|
|
24180
|
+
return _default(this, d);
|
|
24181
|
+
},
|
|
24182
|
+
prefault(d) {
|
|
24183
|
+
return prefault(this, d);
|
|
24184
|
+
},
|
|
24185
|
+
catch(params) {
|
|
24186
|
+
return _catch(this, params);
|
|
24187
|
+
},
|
|
24188
|
+
pipe(target) {
|
|
24189
|
+
return pipe(this, target);
|
|
24190
|
+
},
|
|
24191
|
+
readonly() {
|
|
24192
|
+
return readonly(this);
|
|
24193
|
+
},
|
|
24194
|
+
describe(description) {
|
|
24195
|
+
const cl = this.clone();
|
|
24196
|
+
globalRegistry.add(cl, { description });
|
|
24197
|
+
return cl;
|
|
24198
|
+
},
|
|
24199
|
+
meta(...args) {
|
|
24200
|
+
if (args.length === 0)
|
|
24201
|
+
return globalRegistry.get(this);
|
|
24202
|
+
const cl = this.clone();
|
|
24203
|
+
globalRegistry.add(cl, args[0]);
|
|
24204
|
+
return cl;
|
|
24205
|
+
},
|
|
24206
|
+
isOptional() {
|
|
24207
|
+
return this.safeParse(undefined).success;
|
|
24208
|
+
},
|
|
24209
|
+
isNullable() {
|
|
24210
|
+
return this.safeParse(null).success;
|
|
24211
|
+
},
|
|
24212
|
+
apply(fn, ...args) {
|
|
24213
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
24214
|
+
},
|
|
24215
|
+
get "~standard"() {
|
|
24216
|
+
return hide(this, "~standard", {
|
|
24217
|
+
...standardProps(this),
|
|
24218
|
+
jsonSchema: {
|
|
24219
|
+
input: createStandardJSONSchemaMethod(this, "input"),
|
|
24220
|
+
output: createStandardJSONSchemaMethod(this, "output")
|
|
24221
|
+
}
|
|
24222
|
+
});
|
|
24223
|
+
},
|
|
24224
|
+
set "~standard"(value) {
|
|
24225
|
+
own(this, "~standard", value);
|
|
24226
|
+
},
|
|
24227
|
+
parse: function _parse(data, params) {
|
|
24228
|
+
return parse4(this, data, params, { callee: _parse });
|
|
24229
|
+
},
|
|
24230
|
+
parseAsync: async function _parseAsync(data, params) {
|
|
24231
|
+
return await parseAsync2(this, data, params, { callee: _parseAsync });
|
|
24232
|
+
},
|
|
24233
|
+
safeParse(data, params) {
|
|
24234
|
+
return safeParse2(this, data, params);
|
|
24235
|
+
},
|
|
24236
|
+
async safeParseAsync(data, params) {
|
|
24237
|
+
return safeParseAsync2(this, data, params);
|
|
24238
|
+
},
|
|
24239
|
+
get spa() {
|
|
24240
|
+
return this?.safeParseAsync;
|
|
24241
|
+
},
|
|
24242
|
+
set spa(value) {
|
|
24243
|
+
own(this, "spa", value);
|
|
24244
|
+
},
|
|
24245
|
+
validate(data, params) {
|
|
24246
|
+
return validate(this, data, params);
|
|
24247
|
+
},
|
|
24248
|
+
validateAsync(data, params) {
|
|
24249
|
+
return validateAsync(this, data, params);
|
|
24250
|
+
},
|
|
24251
|
+
encode: function _encode(data, params) {
|
|
24252
|
+
return encode2(this, data, params, { callee: _encode });
|
|
24253
|
+
},
|
|
24254
|
+
decode: function _decode(data, params) {
|
|
24255
|
+
return decode3(this, data, params, { callee: _decode });
|
|
24256
|
+
},
|
|
24257
|
+
encodeAsync: async function _encodeAsync(data, params) {
|
|
24258
|
+
return await encodeAsync2(this, data, params, { callee: _encodeAsync });
|
|
24259
|
+
},
|
|
24260
|
+
decodeAsync: async function _decodeAsync(data, params) {
|
|
24261
|
+
return await decodeAsync2(this, data, params, { callee: _decodeAsync });
|
|
24262
|
+
},
|
|
24263
|
+
safeEncode(data, params) {
|
|
24264
|
+
return safeEncode2(this, data, params);
|
|
24265
|
+
},
|
|
24266
|
+
safeDecode(data, params) {
|
|
24267
|
+
return safeDecode2(this, data, params);
|
|
24268
|
+
},
|
|
24269
|
+
async safeEncodeAsync(data, params) {
|
|
24270
|
+
return safeEncodeAsync2(this, data, params);
|
|
24271
|
+
},
|
|
24272
|
+
async safeDecodeAsync(data, params) {
|
|
24273
|
+
return safeDecodeAsync2(this, data, params);
|
|
24274
|
+
},
|
|
24275
|
+
toJSONSchema(params) {
|
|
24276
|
+
return createToJSONSchemaMethod(this, {})(params);
|
|
24277
|
+
},
|
|
24278
|
+
get description() {
|
|
24279
|
+
return globalRegistry.get(this)?.description;
|
|
24280
|
+
},
|
|
24281
|
+
get _def() {
|
|
24282
|
+
return this._zod.def;
|
|
24283
|
+
}
|
|
24284
|
+
});
|
|
24285
|
+
var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
24286
|
+
$ZodString.init(inst, def);
|
|
24287
|
+
ZodType.init(inst, def);
|
|
24288
|
+
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
24289
|
+
}, /* @__PURE__ */ derived({
|
|
24290
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
24291
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
24292
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
24293
|
+
}, {
|
|
24294
|
+
regex(...args) {
|
|
24295
|
+
return this.check(_regex(...args));
|
|
24296
|
+
},
|
|
24297
|
+
includes(...args) {
|
|
24298
|
+
return this.check(_includes(...args));
|
|
24299
|
+
},
|
|
24300
|
+
startsWith(...args) {
|
|
24301
|
+
return this.check(_startsWith(...args));
|
|
24302
|
+
},
|
|
24303
|
+
endsWith(...args) {
|
|
24304
|
+
return this.check(_endsWith(...args));
|
|
24305
|
+
},
|
|
24306
|
+
min(...args) {
|
|
24307
|
+
return this.check(_minLength(...args));
|
|
24308
|
+
},
|
|
24309
|
+
max(...args) {
|
|
24310
|
+
return this.check(_maxLength(...args));
|
|
24311
|
+
},
|
|
24312
|
+
length(...args) {
|
|
24313
|
+
return this.check(_length(...args));
|
|
24314
|
+
},
|
|
24315
|
+
nonempty(...args) {
|
|
24316
|
+
return this.check(_minLength(1, ...args));
|
|
24317
|
+
},
|
|
24318
|
+
lowercase(params) {
|
|
24319
|
+
return this.check(_lowercase(params));
|
|
24320
|
+
},
|
|
24321
|
+
uppercase(params) {
|
|
24322
|
+
return this.check(_uppercase(params));
|
|
24323
|
+
},
|
|
24324
|
+
trim() {
|
|
24325
|
+
return this.check(_trim());
|
|
24326
|
+
},
|
|
24327
|
+
normalize(...args) {
|
|
24328
|
+
return this.check(_normalize(...args));
|
|
24329
|
+
},
|
|
24330
|
+
toLowerCase() {
|
|
24331
|
+
return this.check(_toLowerCase());
|
|
24332
|
+
},
|
|
24333
|
+
toUpperCase() {
|
|
24334
|
+
return this.check(_toUpperCase());
|
|
24335
|
+
},
|
|
24336
|
+
slugify() {
|
|
24337
|
+
return this.check(_slugify());
|
|
24338
|
+
}
|
|
24339
|
+
}));
|
|
24340
|
+
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
24341
|
+
$ZodString.init(inst, def);
|
|
24342
|
+
_ZodString.init(inst, def);
|
|
24343
|
+
}, {
|
|
24344
|
+
email(params) {
|
|
24345
|
+
return this.check(_email(ZodEmail, params));
|
|
24346
|
+
},
|
|
24347
|
+
url(params) {
|
|
24348
|
+
return this.check(_url(ZodURL, params));
|
|
24349
|
+
},
|
|
24350
|
+
jwt(params) {
|
|
24351
|
+
return this.check(_jwt(ZodJWT, params));
|
|
24352
|
+
},
|
|
24353
|
+
emoji(params) {
|
|
24354
|
+
return this.check(_emoji2(ZodEmoji, params));
|
|
24355
|
+
},
|
|
24356
|
+
guid(params) {
|
|
24357
|
+
return this.check(_guid(ZodGUID, params));
|
|
24358
|
+
},
|
|
24359
|
+
uuid(params) {
|
|
24360
|
+
return this.check(_uuid(ZodUUID, params));
|
|
24361
|
+
},
|
|
24362
|
+
uuidv4(params) {
|
|
24363
|
+
return this.check(_uuidv4(ZodUUID, params));
|
|
24364
|
+
},
|
|
24365
|
+
uuidv6(params) {
|
|
24366
|
+
return this.check(_uuidv6(ZodUUID, params));
|
|
24367
|
+
},
|
|
24368
|
+
uuidv7(params) {
|
|
24369
|
+
return this.check(_uuidv7(ZodUUID, params));
|
|
24370
|
+
},
|
|
24371
|
+
nanoid(params) {
|
|
24372
|
+
return this.check(_nanoid(ZodNanoID, params));
|
|
24373
|
+
},
|
|
24374
|
+
cuid(params) {
|
|
24375
|
+
return this.check(_cuid(ZodCUID, params));
|
|
24376
|
+
},
|
|
24377
|
+
cuid2(params) {
|
|
24378
|
+
return this.check(_cuid2(ZodCUID2, params));
|
|
24379
|
+
},
|
|
24380
|
+
ulid(params) {
|
|
24381
|
+
return this.check(_ulid(ZodULID, params));
|
|
24382
|
+
},
|
|
24383
|
+
base64(params) {
|
|
24384
|
+
return this.check(_base64(ZodBase64, params));
|
|
24385
|
+
},
|
|
24386
|
+
base64url(params) {
|
|
24387
|
+
return this.check(_base64url(ZodBase64URL, params));
|
|
24388
|
+
},
|
|
24389
|
+
xid(params) {
|
|
24390
|
+
return this.check(_xid(ZodXID, params));
|
|
24391
|
+
},
|
|
24392
|
+
ksuid(params) {
|
|
24393
|
+
return this.check(_ksuid(ZodKSUID, params));
|
|
24394
|
+
},
|
|
24395
|
+
ipv4(params) {
|
|
24396
|
+
return this.check(_ipv4(ZodIPv4, params));
|
|
24397
|
+
},
|
|
24398
|
+
ipv6(params) {
|
|
24399
|
+
return this.check(_ipv6(ZodIPv6, params));
|
|
24400
|
+
},
|
|
24401
|
+
cidrv4(params) {
|
|
24402
|
+
return this.check(_cidrv4(ZodCIDRv4, params));
|
|
24403
|
+
},
|
|
24404
|
+
cidrv6(params) {
|
|
24405
|
+
return this.check(_cidrv6(ZodCIDRv6, params));
|
|
24406
|
+
},
|
|
24407
|
+
e164(params) {
|
|
24408
|
+
return this.check(_e164(ZodE164, params));
|
|
24409
|
+
},
|
|
24410
|
+
datetime(params) {
|
|
24411
|
+
return this.check(_isoDateTime(ZodISODateTime, params));
|
|
24412
|
+
},
|
|
24413
|
+
date(params) {
|
|
24414
|
+
return this.check(_isoDate(ZodISODate, params));
|
|
24415
|
+
},
|
|
24416
|
+
time(params) {
|
|
24417
|
+
return this.check(_isoTime(ZodISOTime, params));
|
|
24418
|
+
},
|
|
24419
|
+
duration(params) {
|
|
24420
|
+
return this.check(_isoDuration(ZodISODuration, params));
|
|
24421
|
+
}
|
|
24422
|
+
});
|
|
24423
|
+
function string3(params) {
|
|
24424
|
+
return _string(ZodString, params);
|
|
24425
|
+
}
|
|
24426
|
+
var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
|
|
24427
|
+
$ZodStringFormat.init(inst, def);
|
|
24428
|
+
_ZodString.init(inst, def);
|
|
24429
|
+
});
|
|
24430
|
+
var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
24431
|
+
$ZodISODateTime.init(inst, def);
|
|
24432
|
+
ZodStringFormat.init(inst, def);
|
|
24433
|
+
});
|
|
24434
|
+
var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
24435
|
+
$ZodISODate.init(inst, def);
|
|
24436
|
+
ZodStringFormat.init(inst, def);
|
|
24437
|
+
});
|
|
24438
|
+
var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
24439
|
+
$ZodISOTime.init(inst, def);
|
|
24440
|
+
ZodStringFormat.init(inst, def);
|
|
24441
|
+
});
|
|
24442
|
+
var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
|
|
24443
|
+
$ZodISODuration.init(inst, def);
|
|
24444
|
+
ZodStringFormat.init(inst, def);
|
|
24445
|
+
});
|
|
24446
|
+
var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
|
|
24447
|
+
$ZodEmail.init(inst, def);
|
|
24448
|
+
ZodStringFormat.init(inst, def);
|
|
24449
|
+
});
|
|
24450
|
+
var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
|
|
24451
|
+
$ZodGUID.init(inst, def);
|
|
24452
|
+
ZodStringFormat.init(inst, def);
|
|
24453
|
+
});
|
|
24454
|
+
var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
|
|
24455
|
+
$ZodUUID.init(inst, def);
|
|
24456
|
+
ZodStringFormat.init(inst, def);
|
|
24457
|
+
});
|
|
24458
|
+
var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
|
|
24459
|
+
$ZodURL.init(inst, def);
|
|
24460
|
+
ZodStringFormat.init(inst, def);
|
|
24461
|
+
});
|
|
24462
|
+
var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
|
|
24463
|
+
$ZodEmoji.init(inst, def);
|
|
24464
|
+
ZodStringFormat.init(inst, def);
|
|
24465
|
+
});
|
|
24466
|
+
var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
|
|
24467
|
+
$ZodNanoID.init(inst, def);
|
|
24468
|
+
ZodStringFormat.init(inst, def);
|
|
24469
|
+
});
|
|
24470
|
+
var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
|
|
24471
|
+
$ZodCUID.init(inst, def);
|
|
24472
|
+
ZodStringFormat.init(inst, def);
|
|
24473
|
+
});
|
|
24474
|
+
var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
|
|
24475
|
+
$ZodCUID2.init(inst, def);
|
|
24476
|
+
ZodStringFormat.init(inst, def);
|
|
24477
|
+
});
|
|
24478
|
+
var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
|
|
24479
|
+
$ZodULID.init(inst, def);
|
|
24480
|
+
ZodStringFormat.init(inst, def);
|
|
24481
|
+
});
|
|
24482
|
+
var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
|
|
24483
|
+
$ZodXID.init(inst, def);
|
|
24484
|
+
ZodStringFormat.init(inst, def);
|
|
24485
|
+
});
|
|
24486
|
+
var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
|
|
24487
|
+
$ZodKSUID.init(inst, def);
|
|
24488
|
+
ZodStringFormat.init(inst, def);
|
|
24489
|
+
});
|
|
24490
|
+
var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
|
|
24491
|
+
$ZodIPv4.init(inst, def);
|
|
24492
|
+
ZodStringFormat.init(inst, def);
|
|
24493
|
+
});
|
|
24494
|
+
var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
|
|
24495
|
+
$ZodIPv6.init(inst, def);
|
|
24496
|
+
ZodStringFormat.init(inst, def);
|
|
24497
|
+
});
|
|
24498
|
+
var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
|
|
24499
|
+
$ZodCIDRv4.init(inst, def);
|
|
24500
|
+
ZodStringFormat.init(inst, def);
|
|
24501
|
+
});
|
|
24502
|
+
var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
|
|
24503
|
+
$ZodCIDRv6.init(inst, def);
|
|
24504
|
+
ZodStringFormat.init(inst, def);
|
|
24505
|
+
});
|
|
24506
|
+
var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
|
|
24507
|
+
$ZodBase64.init(inst, def);
|
|
24508
|
+
ZodStringFormat.init(inst, def);
|
|
24509
|
+
});
|
|
24510
|
+
var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
|
|
24511
|
+
$ZodBase64URL.init(inst, def);
|
|
24512
|
+
ZodStringFormat.init(inst, def);
|
|
24513
|
+
});
|
|
24514
|
+
var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
|
|
24515
|
+
$ZodE164.init(inst, def);
|
|
24516
|
+
ZodStringFormat.init(inst, def);
|
|
24517
|
+
});
|
|
24518
|
+
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
24519
|
+
$ZodJWT.init(inst, def);
|
|
24520
|
+
ZodStringFormat.init(inst, def);
|
|
24521
|
+
});
|
|
24522
|
+
var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
24523
|
+
$ZodUnknown.init(inst, def);
|
|
24524
|
+
ZodType.init(inst, def);
|
|
24525
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
|
|
24526
|
+
});
|
|
24527
|
+
function unknown2() {
|
|
24528
|
+
return _unknown(ZodUnknown);
|
|
24529
|
+
}
|
|
24530
|
+
var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
24531
|
+
$ZodNever.init(inst, def);
|
|
24532
|
+
ZodType.init(inst, def);
|
|
24533
|
+
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
|
|
24534
|
+
});
|
|
24535
|
+
function never2(params) {
|
|
24536
|
+
return _never(ZodNever, params);
|
|
24537
|
+
}
|
|
24538
|
+
var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
24539
|
+
_ensureDefaultMemoizer();
|
|
24540
|
+
$ZodArray.init(inst, def);
|
|
24541
|
+
ZodType.init(inst, def);
|
|
24542
|
+
inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
|
|
24543
|
+
inst.element = def.element;
|
|
24544
|
+
}, {
|
|
24545
|
+
min(n, params) {
|
|
24546
|
+
return this.check(_minLength(n, params));
|
|
24547
|
+
},
|
|
24548
|
+
nonempty(params) {
|
|
24549
|
+
return this.check(_minLength(1, params));
|
|
24550
|
+
},
|
|
24551
|
+
max(n, params) {
|
|
24552
|
+
return this.check(_maxLength(n, params));
|
|
24553
|
+
},
|
|
24554
|
+
length(n, params) {
|
|
24555
|
+
return this.check(_length(n, params));
|
|
24556
|
+
},
|
|
24557
|
+
unwrap() {
|
|
24558
|
+
return this.element;
|
|
24559
|
+
}
|
|
24560
|
+
});
|
|
24561
|
+
function array2(element, params) {
|
|
24562
|
+
return _array(ZodArray, element, params);
|
|
24563
|
+
}
|
|
24564
|
+
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
24565
|
+
_ensureDefaultMemoizer();
|
|
24566
|
+
$ZodObjectJIT.init(inst, def);
|
|
24567
|
+
ZodType.init(inst, def);
|
|
24568
|
+
inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
|
|
24569
|
+
installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
24570
|
+
}, {
|
|
24571
|
+
keyof() {
|
|
24572
|
+
return _enum2(Object.keys(this._zod.def.shape));
|
|
24573
|
+
},
|
|
24574
|
+
catchall(catchall) {
|
|
24575
|
+
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
24576
|
+
},
|
|
24577
|
+
passthrough() {
|
|
24578
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown2() }));
|
|
24579
|
+
},
|
|
24580
|
+
loose() {
|
|
24581
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown2() }));
|
|
24582
|
+
},
|
|
24583
|
+
strict() {
|
|
24584
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: never2() }));
|
|
24585
|
+
},
|
|
24586
|
+
strip() {
|
|
24587
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: undefined }));
|
|
24588
|
+
},
|
|
24589
|
+
extend(incoming) {
|
|
24590
|
+
return extend(this, incoming);
|
|
24591
|
+
},
|
|
24592
|
+
safeExtend(incoming) {
|
|
24593
|
+
return safeExtend(this, incoming);
|
|
24594
|
+
},
|
|
24595
|
+
merge(other) {
|
|
24596
|
+
return merge(this, other);
|
|
24597
|
+
},
|
|
24598
|
+
pick(mask) {
|
|
24599
|
+
return pick(this, mask);
|
|
24600
|
+
},
|
|
24601
|
+
omit(mask) {
|
|
24602
|
+
return omit(this, mask);
|
|
24603
|
+
},
|
|
24604
|
+
partial(...args) {
|
|
24605
|
+
return partial(ZodOptional, this, args[0]);
|
|
24606
|
+
},
|
|
24607
|
+
exactPartial(...args) {
|
|
24608
|
+
return partial(ZodExactOptional, this, args[0], "exactPartial");
|
|
24609
|
+
},
|
|
24610
|
+
required(...args) {
|
|
24611
|
+
return required(ZodNonOptional, this, args[0]);
|
|
24612
|
+
}
|
|
24613
|
+
});
|
|
24614
|
+
function object(shape, params) {
|
|
24615
|
+
const def = {
|
|
24616
|
+
type: "object",
|
|
24617
|
+
shape: shape ?? {},
|
|
24618
|
+
...normalizeParams(params)
|
|
24619
|
+
};
|
|
24620
|
+
return new ZodObject(def);
|
|
24621
|
+
}
|
|
24622
|
+
var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
24623
|
+
$ZodUnion.init(inst, def);
|
|
24624
|
+
ZodType.init(inst, def);
|
|
24625
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
24626
|
+
inst.options = def.options;
|
|
24627
|
+
});
|
|
24628
|
+
function union2(options, params) {
|
|
24629
|
+
return new ZodUnion({
|
|
24630
|
+
type: "union",
|
|
24631
|
+
options,
|
|
24632
|
+
...normalizeParams(params)
|
|
24633
|
+
});
|
|
24634
|
+
}
|
|
24635
|
+
var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
24636
|
+
$ZodIntersection.init(inst, def);
|
|
24637
|
+
ZodType.init(inst, def);
|
|
24638
|
+
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
24639
|
+
});
|
|
24640
|
+
function intersection(left, right) {
|
|
24641
|
+
return new ZodIntersection({
|
|
24642
|
+
type: "intersection",
|
|
24643
|
+
left,
|
|
24644
|
+
right
|
|
24645
|
+
});
|
|
24646
|
+
}
|
|
24647
|
+
var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
24648
|
+
$ZodEnum.init(inst, def);
|
|
24649
|
+
ZodType.init(inst, def);
|
|
24650
|
+
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
24651
|
+
inst.enum = def.entries;
|
|
24652
|
+
inst.options = [...inst._zod.values];
|
|
24653
|
+
const keys = new Set(Object.keys(def.entries));
|
|
24654
|
+
inst.extract = (values, params) => {
|
|
24655
|
+
const newEntries = {};
|
|
24656
|
+
for (const value of values) {
|
|
24657
|
+
if (keys.has(value)) {
|
|
24658
|
+
newEntries[value] = def.entries[value];
|
|
24659
|
+
} else
|
|
24660
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
24661
|
+
}
|
|
24662
|
+
return new ZodEnum({
|
|
24663
|
+
...def,
|
|
24664
|
+
checks: [],
|
|
24665
|
+
...normalizeParams(params),
|
|
24666
|
+
entries: newEntries
|
|
24667
|
+
});
|
|
24668
|
+
};
|
|
24669
|
+
inst.exclude = (values, params) => {
|
|
24670
|
+
const newEntries = { ...def.entries };
|
|
24671
|
+
for (const value of values) {
|
|
24672
|
+
if (keys.has(value)) {
|
|
24673
|
+
delete newEntries[value];
|
|
24674
|
+
} else
|
|
24675
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
24676
|
+
}
|
|
24677
|
+
return new ZodEnum({
|
|
24678
|
+
...def,
|
|
24679
|
+
checks: [],
|
|
24680
|
+
...normalizeParams(params),
|
|
24681
|
+
entries: newEntries
|
|
24682
|
+
});
|
|
24683
|
+
};
|
|
24684
|
+
});
|
|
24685
|
+
function _enum2(values, params) {
|
|
24686
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
24687
|
+
return new ZodEnum({
|
|
24688
|
+
type: "enum",
|
|
24689
|
+
entries,
|
|
24690
|
+
...normalizeParams(params)
|
|
24691
|
+
});
|
|
24692
|
+
}
|
|
24693
|
+
var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
24694
|
+
_ensureDefaultMemoizer();
|
|
24695
|
+
$ZodTransform.init(inst, def);
|
|
24696
|
+
ZodType.init(inst, def);
|
|
24697
|
+
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
|
|
24698
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
24699
|
+
if (_ctx.direction === "backward") {
|
|
24700
|
+
throw new $ZodEncodeError(inst.constructor.name);
|
|
24701
|
+
}
|
|
24702
|
+
payload.addIssue = (issue2) => {
|
|
24703
|
+
if (typeof issue2 === "string") {
|
|
24704
|
+
payload.issues.push(issue(issue2, payload.value, def));
|
|
24705
|
+
} else {
|
|
24706
|
+
const _issue = issue2;
|
|
24707
|
+
if (_issue.fatal)
|
|
24708
|
+
_issue.continue = false;
|
|
24709
|
+
_issue.code ?? (_issue.code = "custom");
|
|
24710
|
+
if (!("input" in _issue))
|
|
24711
|
+
_issue.input = payload.value;
|
|
24712
|
+
_issue.inst ?? (_issue.inst = inst);
|
|
24713
|
+
payload.issues.push(issue(_issue));
|
|
24714
|
+
}
|
|
24715
|
+
};
|
|
24716
|
+
const output = def.transform(payload.value, payload);
|
|
24717
|
+
if (output instanceof Promise) {
|
|
24718
|
+
return output.then((output) => {
|
|
24719
|
+
payload.value = output;
|
|
24720
|
+
return payload;
|
|
24721
|
+
});
|
|
24722
|
+
}
|
|
24723
|
+
payload.value = output;
|
|
24724
|
+
return payload;
|
|
24725
|
+
};
|
|
24726
|
+
});
|
|
24727
|
+
function transform(fn) {
|
|
24728
|
+
return new ZodTransform({
|
|
24729
|
+
type: "transform",
|
|
24730
|
+
transform: fn
|
|
24731
|
+
});
|
|
24732
|
+
}
|
|
24733
|
+
var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
24734
|
+
$ZodOptional.init(inst, def);
|
|
24735
|
+
ZodType.init(inst, def);
|
|
24736
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
24737
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24738
|
+
});
|
|
24739
|
+
function optional2(innerType) {
|
|
24740
|
+
return new ZodOptional({
|
|
24741
|
+
type: "optional",
|
|
24742
|
+
innerType
|
|
24743
|
+
});
|
|
24744
|
+
}
|
|
24745
|
+
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
24746
|
+
$ZodExactOptional.init(inst, def);
|
|
24747
|
+
ZodType.init(inst, def);
|
|
24748
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
24749
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24750
|
+
});
|
|
24751
|
+
function exactOptional(innerType) {
|
|
24752
|
+
return new ZodExactOptional({
|
|
24753
|
+
type: "optional",
|
|
24754
|
+
innerType
|
|
24755
|
+
});
|
|
24756
|
+
}
|
|
24757
|
+
var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
24758
|
+
$ZodNullable.init(inst, def);
|
|
24759
|
+
ZodType.init(inst, def);
|
|
24760
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
24761
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24762
|
+
});
|
|
24763
|
+
function nullable2(innerType) {
|
|
24764
|
+
return new ZodNullable({
|
|
24765
|
+
type: "nullable",
|
|
24766
|
+
innerType
|
|
24767
|
+
});
|
|
24768
|
+
}
|
|
24769
|
+
var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
24770
|
+
$ZodDefault.init(inst, def);
|
|
24771
|
+
ZodType.init(inst, def);
|
|
24772
|
+
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
24773
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24774
|
+
inst.removeDefault = inst.unwrap;
|
|
24775
|
+
});
|
|
24776
|
+
function _default(innerType, defaultValue) {
|
|
24777
|
+
return new ZodDefault({
|
|
24778
|
+
type: "default",
|
|
24779
|
+
innerType,
|
|
24780
|
+
get defaultValue() {
|
|
24781
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
24782
|
+
}
|
|
24783
|
+
});
|
|
24784
|
+
}
|
|
24785
|
+
var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
24786
|
+
$ZodPrefault.init(inst, def);
|
|
24787
|
+
ZodType.init(inst, def);
|
|
24788
|
+
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
24789
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24790
|
+
});
|
|
24791
|
+
function prefault(innerType, defaultValue) {
|
|
24792
|
+
return new ZodPrefault({
|
|
24793
|
+
type: "prefault",
|
|
24794
|
+
innerType,
|
|
24795
|
+
get defaultValue() {
|
|
24796
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
24797
|
+
}
|
|
24798
|
+
});
|
|
24799
|
+
}
|
|
24800
|
+
var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
24801
|
+
$ZodNonOptional.init(inst, def);
|
|
24802
|
+
ZodType.init(inst, def);
|
|
24803
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
24804
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24805
|
+
});
|
|
24806
|
+
function nonoptional(innerType, params) {
|
|
24807
|
+
return new ZodNonOptional({
|
|
24808
|
+
type: "nonoptional",
|
|
24809
|
+
innerType,
|
|
24810
|
+
...normalizeParams(params)
|
|
24811
|
+
});
|
|
24812
|
+
}
|
|
24813
|
+
var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
24814
|
+
$ZodCatch.init(inst, def);
|
|
24815
|
+
ZodType.init(inst, def);
|
|
24816
|
+
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
24817
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24818
|
+
inst.removeCatch = inst.unwrap;
|
|
24819
|
+
});
|
|
24820
|
+
function _catch(innerType, catchValue) {
|
|
24821
|
+
return new ZodCatch({
|
|
24822
|
+
type: "catch",
|
|
24823
|
+
innerType,
|
|
24824
|
+
catchValue: typeof catchValue === "function" ? catchValue : constantCatch(catchValue)
|
|
24825
|
+
});
|
|
24826
|
+
}
|
|
24827
|
+
var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
24828
|
+
$ZodPipe.init(inst, def);
|
|
24829
|
+
ZodType.init(inst, def);
|
|
24830
|
+
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
24831
|
+
inst.in = def.in;
|
|
24832
|
+
inst.out = def.out;
|
|
24833
|
+
});
|
|
24834
|
+
function pipe(in_, out) {
|
|
24835
|
+
return new ZodPipe({
|
|
24836
|
+
type: "pipe",
|
|
24837
|
+
in: in_,
|
|
24838
|
+
out
|
|
24839
|
+
});
|
|
24840
|
+
}
|
|
24841
|
+
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
24842
|
+
$ZodReadonly.init(inst, def);
|
|
24843
|
+
ZodType.init(inst, def);
|
|
24844
|
+
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
24845
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24846
|
+
});
|
|
24847
|
+
function readonly(innerType) {
|
|
24848
|
+
return new ZodReadonly({
|
|
24849
|
+
type: "readonly",
|
|
24850
|
+
innerType
|
|
24851
|
+
});
|
|
24852
|
+
}
|
|
24853
|
+
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
24854
|
+
$ZodCustom.init(inst, def);
|
|
24855
|
+
ZodType.init(inst, def);
|
|
24856
|
+
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
24857
|
+
});
|
|
24858
|
+
function refine2(fn, _params = {}) {
|
|
24859
|
+
return _refine(ZodCustom, fn, _params);
|
|
24860
|
+
}
|
|
24861
|
+
function superRefine2(fn, params) {
|
|
24862
|
+
return _superRefine(fn, params);
|
|
24863
|
+
}
|
|
24797
24864
|
// packages/workit-core/src/core/repo-context.ts
|
|
24798
24865
|
import { spawnSync as spawnSync19 } from "node:child_process";
|
|
24799
24866
|
import { existsSync as existsSync14, readFileSync as readFileSync11, readdirSync as readdirSync4 } from "node:fs";
|
|
@@ -25678,7 +25745,7 @@ var fetchYouTrackIssueBody = async (issue, ytrack = ytrackRunner(process.env, yo
|
|
|
25678
25745
|
|
|
25679
25746
|
// packages/workit-core/src/core/context-read.ts
|
|
25680
25747
|
var contextReadSchema = object({
|
|
25681
|
-
kind:
|
|
25748
|
+
kind: _enum2([
|
|
25682
25749
|
"git",
|
|
25683
25750
|
"pr",
|
|
25684
25751
|
"youtrack",
|
|
@@ -25688,14 +25755,14 @@ var contextReadSchema = object({
|
|
|
25688
25755
|
"release",
|
|
25689
25756
|
"affected"
|
|
25690
25757
|
]),
|
|
25691
|
-
range:
|
|
25692
|
-
issueId:
|
|
25693
|
-
issueUrl:
|
|
25694
|
-
issueRef:
|
|
25695
|
-
mode:
|
|
25696
|
-
specPath:
|
|
25697
|
-
planPath:
|
|
25698
|
-
cwd:
|
|
25758
|
+
range: string3().optional(),
|
|
25759
|
+
issueId: string3().optional(),
|
|
25760
|
+
issueUrl: string3().optional(),
|
|
25761
|
+
issueRef: string3().optional(),
|
|
25762
|
+
mode: string3().optional(),
|
|
25763
|
+
specPath: string3().optional(),
|
|
25764
|
+
planPath: string3().optional(),
|
|
25765
|
+
cwd: string3().min(1).optional()
|
|
25699
25766
|
}).strict();
|
|
25700
25767
|
var contextReadJsonSchema = () => {
|
|
25701
25768
|
const { $schema: _schema, ...schema } = toJSONSchema(contextReadSchema, {
|
|
@@ -28925,7 +28992,7 @@ var pidAlive2 = (pid) => {
|
|
|
28925
28992
|
return error.code === "EPERM";
|
|
28926
28993
|
}
|
|
28927
28994
|
};
|
|
28928
|
-
var
|
|
28995
|
+
var parse6 = (raw) => {
|
|
28929
28996
|
try {
|
|
28930
28997
|
const value = JSON.parse(raw);
|
|
28931
28998
|
if (typeof value.pr !== "number" || typeof value.pid !== "number" || typeof value.deadline !== "number" || typeof value.host !== "string" || typeof value.startedAt !== "number")
|
|
@@ -28956,7 +29023,7 @@ var liveCiWaiter = (cwd, pr, head = null, nowMs = Date.now()) => {
|
|
|
28956
29023
|
const file = waiterFile(cwd, pr);
|
|
28957
29024
|
if (!file)
|
|
28958
29025
|
return null;
|
|
28959
|
-
const waiter =
|
|
29026
|
+
const waiter = parse6(fs29.readFileSync(file, "utf8"));
|
|
28960
29027
|
if (!waiter || waiter.pr !== pr || waiter.pid === process.pid)
|
|
28961
29028
|
return null;
|
|
28962
29029
|
if (head && waiter.head && !sameSha(waiter.head, head))
|
|
@@ -31628,7 +31695,7 @@ var start = (file) => {
|
|
|
31628
31695
|
closeSync4(fd);
|
|
31629
31696
|
}
|
|
31630
31697
|
};
|
|
31631
|
-
var
|
|
31698
|
+
var parse7 = (line) => {
|
|
31632
31699
|
try {
|
|
31633
31700
|
const value = JSON.parse(line);
|
|
31634
31701
|
return value && typeof value === "object" ? value : null;
|
|
@@ -31649,7 +31716,7 @@ var lastApiError = (text) => {
|
|
|
31649
31716
|
const lines = text.split(`
|
|
31650
31717
|
`).filter(Boolean).toReversed();
|
|
31651
31718
|
for (const line of lines) {
|
|
31652
|
-
const entry =
|
|
31719
|
+
const entry = parse7(line);
|
|
31653
31720
|
if (entry?.type !== "assistant")
|
|
31654
31721
|
continue;
|
|
31655
31722
|
const model = entry.message?.model;
|
|
@@ -31661,7 +31728,7 @@ var lastApiError = (text) => {
|
|
|
31661
31728
|
var firstPrompt = (file) => {
|
|
31662
31729
|
for (const line of start(file).split(`
|
|
31663
31730
|
`)) {
|
|
31664
|
-
const entry =
|
|
31731
|
+
const entry = parse7(line);
|
|
31665
31732
|
if (entry?.type === "user")
|
|
31666
31733
|
return textOf2(entry.message) || null;
|
|
31667
31734
|
}
|