@workit-dev/opencode 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/plugin.js +1406 -1339
- package/package.json +2 -2
package/dist/plugin.js
CHANGED
|
@@ -229,14 +229,6 @@ function cleanRegex(source) {
|
|
|
229
229
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
230
230
|
return source.slice(start, end);
|
|
231
231
|
}
|
|
232
|
-
function floatSafeRemainder(val, step) {
|
|
233
|
-
const ratio = val / step;
|
|
234
|
-
const roundedRatio = Math.round(ratio);
|
|
235
|
-
const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
236
|
-
if (Math.abs(ratio - roundedRatio) < tolerance)
|
|
237
|
-
return 0;
|
|
238
|
-
return ratio - roundedRatio;
|
|
239
|
-
}
|
|
240
232
|
function assignProp(target, prop, value) {
|
|
241
233
|
Object.defineProperty(target, prop, {
|
|
242
234
|
value,
|
|
@@ -997,6 +989,7 @@ var _parse = (_Err) => {
|
|
|
997
989
|
};
|
|
998
990
|
return fn;
|
|
999
991
|
};
|
|
992
|
+
var parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
1000
993
|
var _parseAsync = (_Err) => {
|
|
1001
994
|
const fn = async (schema, value, _ctx, params) => {
|
|
1002
995
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
@@ -1012,6 +1005,7 @@ var _parseAsync = (_Err) => {
|
|
|
1012
1005
|
};
|
|
1013
1006
|
return fn;
|
|
1014
1007
|
};
|
|
1008
|
+
var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
1015
1009
|
var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
1016
1010
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
1017
1011
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -1020,6 +1014,7 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
1020
1014
|
}
|
|
1021
1015
|
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
1022
1016
|
};
|
|
1017
|
+
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
1023
1018
|
function failure(Err, issues, ctx) {
|
|
1024
1019
|
let error;
|
|
1025
1020
|
return {
|
|
@@ -1046,6 +1041,7 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1046
1041
|
result = await result;
|
|
1047
1042
|
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
1048
1043
|
};
|
|
1044
|
+
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
1049
1045
|
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
1050
1046
|
var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
1051
1047
|
var validate = (schema, value, _ctx) => {
|
|
@@ -1234,24 +1230,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
1234
1230
|
});
|
|
1235
1231
|
};
|
|
1236
1232
|
});
|
|
1237
|
-
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1238
|
-
$ZodCheck.init(inst, def);
|
|
1239
|
-
inst._zod.check = (payload) => {
|
|
1240
|
-
if (typeof payload.value !== typeof def.value)
|
|
1241
|
-
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
1242
|
-
const isMultiple = typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0;
|
|
1243
|
-
if (isMultiple)
|
|
1244
|
-
return;
|
|
1245
|
-
payload.issues.push({
|
|
1246
|
-
origin: typeof payload.value,
|
|
1247
|
-
code: "not_multiple_of",
|
|
1248
|
-
divisor: def.value,
|
|
1249
|
-
input: payload.value,
|
|
1250
|
-
inst,
|
|
1251
|
-
continue: !def.abort
|
|
1252
|
-
});
|
|
1253
|
-
};
|
|
1254
|
-
});
|
|
1255
1233
|
var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
1256
1234
|
$ZodCheck.init(inst, def);
|
|
1257
1235
|
def.format = def.format || "float64";
|
|
@@ -3896,14 +3874,6 @@ function _never(Class, params) {
|
|
|
3896
3874
|
...normalizeParams(params)
|
|
3897
3875
|
});
|
|
3898
3876
|
}
|
|
3899
|
-
function _lt(value, params) {
|
|
3900
|
-
return new $ZodCheckLessThan({
|
|
3901
|
-
check: "less_than",
|
|
3902
|
-
...normalizeParams(params),
|
|
3903
|
-
value,
|
|
3904
|
-
inclusive: false
|
|
3905
|
-
});
|
|
3906
|
-
}
|
|
3907
3877
|
function _lte(value, params) {
|
|
3908
3878
|
return new $ZodCheckLessThan({
|
|
3909
3879
|
check: "less_than",
|
|
@@ -3912,14 +3882,6 @@ function _lte(value, params) {
|
|
|
3912
3882
|
inclusive: true
|
|
3913
3883
|
});
|
|
3914
3884
|
}
|
|
3915
|
-
function _gt(value, params) {
|
|
3916
|
-
return new $ZodCheckGreaterThan({
|
|
3917
|
-
check: "greater_than",
|
|
3918
|
-
...normalizeParams(params),
|
|
3919
|
-
value,
|
|
3920
|
-
inclusive: false
|
|
3921
|
-
});
|
|
3922
|
-
}
|
|
3923
3885
|
function _gte(value, params) {
|
|
3924
3886
|
return new $ZodCheckGreaterThan({
|
|
3925
3887
|
check: "greater_than",
|
|
@@ -3928,12 +3890,8 @@ function _gte(value, params) {
|
|
|
3928
3890
|
inclusive: true
|
|
3929
3891
|
});
|
|
3930
3892
|
}
|
|
3931
|
-
function
|
|
3932
|
-
return
|
|
3933
|
-
check: "multiple_of",
|
|
3934
|
-
...normalizeParams(params),
|
|
3935
|
-
value
|
|
3936
|
-
});
|
|
3893
|
+
function _nonnegative(params) {
|
|
3894
|
+
return _gte(0, params);
|
|
3937
3895
|
}
|
|
3938
3896
|
function _maxLength(maximum, params) {
|
|
3939
3897
|
const ch = new $ZodCheckMaxLength({
|
|
@@ -5346,95 +5304,44 @@ function toJSONSchema(input, params) {
|
|
|
5346
5304
|
extractDefs(ctx, input);
|
|
5347
5305
|
return finalize(ctx, input);
|
|
5348
5306
|
}
|
|
5349
|
-
// node_modules/zod/v4/
|
|
5350
|
-
var
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
configurable: true,
|
|
5354
|
-
enumerable: false,
|
|
5355
|
-
get() {
|
|
5356
|
-
const value = make(this);
|
|
5357
|
-
Object.defineProperty(this, key, { value, configurable: true, writable: true });
|
|
5358
|
-
return value;
|
|
5359
|
-
},
|
|
5360
|
-
set(value) {
|
|
5361
|
-
Object.defineProperty(this, key, { value, configurable: true, writable: true });
|
|
5362
|
-
}
|
|
5363
|
-
});
|
|
5364
|
-
}
|
|
5365
|
-
var initializer2 = (inst, issues) => {
|
|
5366
|
-
$ZodError.init(inst, issues);
|
|
5367
|
-
inst.name = "ZodError";
|
|
5368
|
-
const proto = Object.getPrototypeOf(inst);
|
|
5369
|
-
if (_installedErrorProtos.has(proto))
|
|
5370
|
-
return;
|
|
5371
|
-
_installedErrorProtos.add(proto);
|
|
5372
|
-
_lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
|
|
5373
|
-
_lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
|
|
5374
|
-
_lazyMethod(proto, "addIssue", (self) => (issue) => {
|
|
5375
|
-
self.issues.push(issue);
|
|
5376
|
-
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
5377
|
-
});
|
|
5378
|
-
_lazyMethod(proto, "addIssues", (self) => (issues) => {
|
|
5379
|
-
self.issues.push(...issues);
|
|
5380
|
-
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
5381
|
-
});
|
|
5382
|
-
Object.defineProperty(proto, "isEmpty", {
|
|
5383
|
-
configurable: true,
|
|
5384
|
-
enumerable: false,
|
|
5385
|
-
get() {
|
|
5386
|
-
return this.issues.length === 0;
|
|
5387
|
-
}
|
|
5388
|
-
});
|
|
5389
|
-
};
|
|
5390
|
-
var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, undefined, {
|
|
5391
|
-
Parent: Error
|
|
5392
|
-
});
|
|
5393
|
-
|
|
5394
|
-
// node_modules/zod/v4/classic/parse.js
|
|
5395
|
-
var parse2 = /* @__PURE__ */ _parse(ZodRealError);
|
|
5396
|
-
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5397
|
-
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
5398
|
-
var safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
5399
|
-
var encode = /* @__PURE__ */ _encode(ZodRealError);
|
|
5400
|
-
var decode = /* @__PURE__ */ _decode(ZodRealError);
|
|
5401
|
-
var encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
5402
|
-
var decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
5403
|
-
var safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
5404
|
-
var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
5405
|
-
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5406
|
-
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5407
|
-
|
|
5408
|
-
// node_modules/zod/v4/classic/schemas.js
|
|
5409
|
-
function _ensureDefaultLocale() {
|
|
5410
|
-
if (!globalConfig.localeError)
|
|
5411
|
-
config(en_default());
|
|
5412
|
-
}
|
|
5413
|
-
function _ensureDefaultMemoizer() {
|
|
5414
|
-
if (!globalConfig.memoizer)
|
|
5415
|
-
config({ memoizer: memoizer() });
|
|
5416
|
-
}
|
|
5417
|
-
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
5418
|
-
_ensureDefaultLocale();
|
|
5307
|
+
// node_modules/zod/v4/mini/schemas.js
|
|
5308
|
+
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
5309
|
+
if (!inst._zod)
|
|
5310
|
+
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
5419
5311
|
$ZodType.init(inst, def);
|
|
5420
5312
|
inst.def = def;
|
|
5421
5313
|
inst.type = def.type;
|
|
5422
|
-
return inst;
|
|
5423
5314
|
}, {
|
|
5424
|
-
|
|
5315
|
+
get with() {
|
|
5316
|
+
return this.check;
|
|
5317
|
+
},
|
|
5318
|
+
set with(value) {
|
|
5319
|
+
own(this, "with", value);
|
|
5320
|
+
},
|
|
5321
|
+
parse(data, params) {
|
|
5322
|
+
return parse(this, data, params, { callee: this.parse });
|
|
5323
|
+
},
|
|
5324
|
+
parseAsync(data, params) {
|
|
5325
|
+
return parseAsync(this, data, params, { callee: this.parseAsync });
|
|
5326
|
+
},
|
|
5327
|
+
safeParse(data, params) {
|
|
5328
|
+
return safeParse(this, data, params);
|
|
5329
|
+
},
|
|
5330
|
+
safeParseAsync(data, params) {
|
|
5331
|
+
return safeParseAsync(this, data, params);
|
|
5332
|
+
},
|
|
5333
|
+
check(...checks) {
|
|
5425
5334
|
const def = this.def;
|
|
5426
|
-
return this.clone(
|
|
5335
|
+
return this.clone({
|
|
5336
|
+
...def,
|
|
5427
5337
|
checks: [
|
|
5428
5338
|
...def.checks ?? [],
|
|
5429
|
-
...
|
|
5339
|
+
...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
5430
5340
|
]
|
|
5431
|
-
}
|
|
5432
|
-
},
|
|
5433
|
-
with(...chks) {
|
|
5434
|
-
return this.check(...chks);
|
|
5341
|
+
}, { parent: true });
|
|
5435
5342
|
},
|
|
5436
|
-
clone(
|
|
5437
|
-
return clone(this,
|
|
5343
|
+
clone(_def, params) {
|
|
5344
|
+
return clone(this, _def, params);
|
|
5438
5345
|
},
|
|
5439
5346
|
brand() {
|
|
5440
5347
|
return this;
|
|
@@ -5443,879 +5350,215 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
5443
5350
|
reg.add(this, meta);
|
|
5444
5351
|
return this;
|
|
5445
5352
|
},
|
|
5446
|
-
refine(check, params) {
|
|
5447
|
-
return this.check(refine(check, params));
|
|
5448
|
-
},
|
|
5449
|
-
superRefine(refinement, params) {
|
|
5450
|
-
return this.check(superRefine(refinement, params));
|
|
5451
|
-
},
|
|
5452
|
-
overwrite(fn) {
|
|
5453
|
-
return this.check(_overwrite(fn));
|
|
5454
|
-
},
|
|
5455
|
-
optional() {
|
|
5456
|
-
return optional(this);
|
|
5457
|
-
},
|
|
5458
|
-
exactOptional() {
|
|
5459
|
-
return exactOptional(this);
|
|
5460
|
-
},
|
|
5461
|
-
nullable() {
|
|
5462
|
-
return nullable(this);
|
|
5463
|
-
},
|
|
5464
|
-
nullish() {
|
|
5465
|
-
return optional(nullable(this));
|
|
5466
|
-
},
|
|
5467
|
-
nonoptional(params) {
|
|
5468
|
-
return nonoptional(this, params);
|
|
5469
|
-
},
|
|
5470
|
-
array() {
|
|
5471
|
-
return array(this);
|
|
5472
|
-
},
|
|
5473
|
-
or(arg) {
|
|
5474
|
-
return union([this, arg]);
|
|
5475
|
-
},
|
|
5476
|
-
and(arg) {
|
|
5477
|
-
return intersection(this, arg);
|
|
5478
|
-
},
|
|
5479
|
-
transform(tx) {
|
|
5480
|
-
return pipe(this, transform(tx));
|
|
5481
|
-
},
|
|
5482
|
-
default(d) {
|
|
5483
|
-
return _default(this, d);
|
|
5484
|
-
},
|
|
5485
|
-
prefault(d) {
|
|
5486
|
-
return prefault(this, d);
|
|
5487
|
-
},
|
|
5488
|
-
catch(params) {
|
|
5489
|
-
return _catch(this, params);
|
|
5490
|
-
},
|
|
5491
|
-
pipe(target) {
|
|
5492
|
-
return pipe(this, target);
|
|
5493
|
-
},
|
|
5494
|
-
readonly() {
|
|
5495
|
-
return readonly(this);
|
|
5496
|
-
},
|
|
5497
|
-
describe(description) {
|
|
5498
|
-
const cl = this.clone();
|
|
5499
|
-
globalRegistry.add(cl, { description });
|
|
5500
|
-
return cl;
|
|
5501
|
-
},
|
|
5502
|
-
meta(...args) {
|
|
5503
|
-
if (args.length === 0)
|
|
5504
|
-
return globalRegistry.get(this);
|
|
5505
|
-
const cl = this.clone();
|
|
5506
|
-
globalRegistry.add(cl, args[0]);
|
|
5507
|
-
return cl;
|
|
5508
|
-
},
|
|
5509
|
-
isOptional() {
|
|
5510
|
-
return this.safeParse(undefined).success;
|
|
5511
|
-
},
|
|
5512
|
-
isNullable() {
|
|
5513
|
-
return this.safeParse(null).success;
|
|
5514
|
-
},
|
|
5515
5353
|
apply(fn, ...args) {
|
|
5516
5354
|
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
5517
|
-
},
|
|
5518
|
-
get "~standard"() {
|
|
5519
|
-
return hide(this, "~standard", {
|
|
5520
|
-
...standardProps(this),
|
|
5521
|
-
jsonSchema: {
|
|
5522
|
-
input: createStandardJSONSchemaMethod(this, "input"),
|
|
5523
|
-
output: createStandardJSONSchemaMethod(this, "output")
|
|
5524
|
-
}
|
|
5525
|
-
});
|
|
5526
|
-
},
|
|
5527
|
-
set "~standard"(value) {
|
|
5528
|
-
own(this, "~standard", value);
|
|
5529
|
-
},
|
|
5530
|
-
parse: function _parse(data, params) {
|
|
5531
|
-
return parse2(this, data, params, { callee: _parse });
|
|
5532
|
-
},
|
|
5533
|
-
parseAsync: async function _parseAsync(data, params) {
|
|
5534
|
-
return await parseAsync(this, data, params, { callee: _parseAsync });
|
|
5535
|
-
},
|
|
5536
|
-
safeParse(data, params) {
|
|
5537
|
-
return safeParse(this, data, params);
|
|
5538
|
-
},
|
|
5539
|
-
async safeParseAsync(data, params) {
|
|
5540
|
-
return safeParseAsync(this, data, params);
|
|
5541
|
-
},
|
|
5542
|
-
get spa() {
|
|
5543
|
-
return this?.safeParseAsync;
|
|
5544
|
-
},
|
|
5545
|
-
set spa(value) {
|
|
5546
|
-
own(this, "spa", value);
|
|
5547
|
-
},
|
|
5548
|
-
validate(data, params) {
|
|
5549
|
-
return validate(this, data, params);
|
|
5550
|
-
},
|
|
5551
|
-
validateAsync(data, params) {
|
|
5552
|
-
return validateAsync(this, data, params);
|
|
5553
|
-
},
|
|
5554
|
-
encode: function _encode(data, params) {
|
|
5555
|
-
return encode(this, data, params, { callee: _encode });
|
|
5556
|
-
},
|
|
5557
|
-
decode: function _decode(data, params) {
|
|
5558
|
-
return decode(this, data, params, { callee: _decode });
|
|
5559
|
-
},
|
|
5560
|
-
encodeAsync: async function _encodeAsync(data, params) {
|
|
5561
|
-
return await encodeAsync(this, data, params, { callee: _encodeAsync });
|
|
5562
|
-
},
|
|
5563
|
-
decodeAsync: async function _decodeAsync(data, params) {
|
|
5564
|
-
return await decodeAsync(this, data, params, { callee: _decodeAsync });
|
|
5565
|
-
},
|
|
5566
|
-
safeEncode(data, params) {
|
|
5567
|
-
return safeEncode(this, data, params);
|
|
5568
|
-
},
|
|
5569
|
-
safeDecode(data, params) {
|
|
5570
|
-
return safeDecode(this, data, params);
|
|
5571
|
-
},
|
|
5572
|
-
async safeEncodeAsync(data, params) {
|
|
5573
|
-
return safeEncodeAsync(this, data, params);
|
|
5574
|
-
},
|
|
5575
|
-
async safeDecodeAsync(data, params) {
|
|
5576
|
-
return safeDecodeAsync(this, data, params);
|
|
5577
|
-
},
|
|
5578
|
-
toJSONSchema(params) {
|
|
5579
|
-
return createToJSONSchemaMethod(this, {})(params);
|
|
5580
|
-
},
|
|
5581
|
-
get description() {
|
|
5582
|
-
return globalRegistry.get(this)?.description;
|
|
5583
|
-
},
|
|
5584
|
-
get _def() {
|
|
5585
|
-
return this._zod.def;
|
|
5586
5355
|
}
|
|
5587
5356
|
});
|
|
5588
|
-
var
|
|
5357
|
+
var ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
|
|
5589
5358
|
$ZodString.init(inst, def);
|
|
5590
|
-
|
|
5591
|
-
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
5592
|
-
}, /* @__PURE__ */ derived({
|
|
5593
|
-
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
5594
|
-
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
5595
|
-
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
5596
|
-
}, {
|
|
5597
|
-
regex(...args) {
|
|
5598
|
-
return this.check(_regex(...args));
|
|
5599
|
-
},
|
|
5600
|
-
includes(...args) {
|
|
5601
|
-
return this.check(_includes(...args));
|
|
5602
|
-
},
|
|
5603
|
-
startsWith(...args) {
|
|
5604
|
-
return this.check(_startsWith(...args));
|
|
5605
|
-
},
|
|
5606
|
-
endsWith(...args) {
|
|
5607
|
-
return this.check(_endsWith(...args));
|
|
5608
|
-
},
|
|
5609
|
-
min(...args) {
|
|
5610
|
-
return this.check(_minLength(...args));
|
|
5611
|
-
},
|
|
5612
|
-
max(...args) {
|
|
5613
|
-
return this.check(_maxLength(...args));
|
|
5614
|
-
},
|
|
5615
|
-
length(...args) {
|
|
5616
|
-
return this.check(_length(...args));
|
|
5617
|
-
},
|
|
5618
|
-
nonempty(...args) {
|
|
5619
|
-
return this.check(_minLength(1, ...args));
|
|
5620
|
-
},
|
|
5621
|
-
lowercase(params) {
|
|
5622
|
-
return this.check(_lowercase(params));
|
|
5623
|
-
},
|
|
5624
|
-
uppercase(params) {
|
|
5625
|
-
return this.check(_uppercase(params));
|
|
5626
|
-
},
|
|
5627
|
-
trim() {
|
|
5628
|
-
return this.check(_trim());
|
|
5629
|
-
},
|
|
5630
|
-
normalize(...args) {
|
|
5631
|
-
return this.check(_normalize(...args));
|
|
5632
|
-
},
|
|
5633
|
-
toLowerCase() {
|
|
5634
|
-
return this.check(_toLowerCase());
|
|
5635
|
-
},
|
|
5636
|
-
toUpperCase() {
|
|
5637
|
-
return this.check(_toUpperCase());
|
|
5638
|
-
},
|
|
5639
|
-
slugify() {
|
|
5640
|
-
return this.check(_slugify());
|
|
5641
|
-
}
|
|
5642
|
-
}));
|
|
5643
|
-
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
5644
|
-
$ZodString.init(inst, def);
|
|
5645
|
-
_ZodString.init(inst, def);
|
|
5646
|
-
}, {
|
|
5647
|
-
email(params) {
|
|
5648
|
-
return this.check(_email(ZodEmail, params));
|
|
5649
|
-
},
|
|
5650
|
-
url(params) {
|
|
5651
|
-
return this.check(_url(ZodURL, params));
|
|
5652
|
-
},
|
|
5653
|
-
jwt(params) {
|
|
5654
|
-
return this.check(_jwt(ZodJWT, params));
|
|
5655
|
-
},
|
|
5656
|
-
emoji(params) {
|
|
5657
|
-
return this.check(_emoji2(ZodEmoji, params));
|
|
5658
|
-
},
|
|
5659
|
-
guid(params) {
|
|
5660
|
-
return this.check(_guid(ZodGUID, params));
|
|
5661
|
-
},
|
|
5662
|
-
uuid(params) {
|
|
5663
|
-
return this.check(_uuid(ZodUUID, params));
|
|
5664
|
-
},
|
|
5665
|
-
uuidv4(params) {
|
|
5666
|
-
return this.check(_uuidv4(ZodUUID, params));
|
|
5667
|
-
},
|
|
5668
|
-
uuidv6(params) {
|
|
5669
|
-
return this.check(_uuidv6(ZodUUID, params));
|
|
5670
|
-
},
|
|
5671
|
-
uuidv7(params) {
|
|
5672
|
-
return this.check(_uuidv7(ZodUUID, params));
|
|
5673
|
-
},
|
|
5674
|
-
nanoid(params) {
|
|
5675
|
-
return this.check(_nanoid(ZodNanoID, params));
|
|
5676
|
-
},
|
|
5677
|
-
cuid(params) {
|
|
5678
|
-
return this.check(_cuid(ZodCUID, params));
|
|
5679
|
-
},
|
|
5680
|
-
cuid2(params) {
|
|
5681
|
-
return this.check(_cuid2(ZodCUID2, params));
|
|
5682
|
-
},
|
|
5683
|
-
ulid(params) {
|
|
5684
|
-
return this.check(_ulid(ZodULID, params));
|
|
5685
|
-
},
|
|
5686
|
-
base64(params) {
|
|
5687
|
-
return this.check(_base64(ZodBase64, params));
|
|
5688
|
-
},
|
|
5689
|
-
base64url(params) {
|
|
5690
|
-
return this.check(_base64url(ZodBase64URL, params));
|
|
5691
|
-
},
|
|
5692
|
-
xid(params) {
|
|
5693
|
-
return this.check(_xid(ZodXID, params));
|
|
5694
|
-
},
|
|
5695
|
-
ksuid(params) {
|
|
5696
|
-
return this.check(_ksuid(ZodKSUID, params));
|
|
5697
|
-
},
|
|
5698
|
-
ipv4(params) {
|
|
5699
|
-
return this.check(_ipv4(ZodIPv4, params));
|
|
5700
|
-
},
|
|
5701
|
-
ipv6(params) {
|
|
5702
|
-
return this.check(_ipv6(ZodIPv6, params));
|
|
5703
|
-
},
|
|
5704
|
-
cidrv4(params) {
|
|
5705
|
-
return this.check(_cidrv4(ZodCIDRv4, params));
|
|
5706
|
-
},
|
|
5707
|
-
cidrv6(params) {
|
|
5708
|
-
return this.check(_cidrv6(ZodCIDRv6, params));
|
|
5709
|
-
},
|
|
5710
|
-
e164(params) {
|
|
5711
|
-
return this.check(_e164(ZodE164, params));
|
|
5712
|
-
},
|
|
5713
|
-
datetime(params) {
|
|
5714
|
-
return this.check(_isoDateTime(ZodISODateTime, params));
|
|
5715
|
-
},
|
|
5716
|
-
date(params) {
|
|
5717
|
-
return this.check(_isoDate(ZodISODate, params));
|
|
5718
|
-
},
|
|
5719
|
-
time(params) {
|
|
5720
|
-
return this.check(_isoTime(ZodISOTime, params));
|
|
5721
|
-
},
|
|
5722
|
-
duration(params) {
|
|
5723
|
-
return this.check(_isoDuration(ZodISODuration, params));
|
|
5724
|
-
}
|
|
5359
|
+
ZodMiniType.init(inst, def);
|
|
5725
5360
|
});
|
|
5726
5361
|
function string2(params) {
|
|
5727
|
-
return _string(
|
|
5362
|
+
return _string(ZodMiniString, params);
|
|
5728
5363
|
}
|
|
5729
|
-
var
|
|
5364
|
+
var ZodMiniStringFormat = /* @__PURE__ */ $constructor("ZodMiniStringFormat", (inst, def) => {
|
|
5730
5365
|
$ZodStringFormat.init(inst, def);
|
|
5731
|
-
|
|
5732
|
-
});
|
|
5733
|
-
var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
5734
|
-
$ZodISODateTime.init(inst, def);
|
|
5735
|
-
ZodStringFormat.init(inst, def);
|
|
5736
|
-
});
|
|
5737
|
-
var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
5738
|
-
$ZodISODate.init(inst, def);
|
|
5739
|
-
ZodStringFormat.init(inst, def);
|
|
5740
|
-
});
|
|
5741
|
-
var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
5742
|
-
$ZodISOTime.init(inst, def);
|
|
5743
|
-
ZodStringFormat.init(inst, def);
|
|
5744
|
-
});
|
|
5745
|
-
var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
|
|
5746
|
-
$ZodISODuration.init(inst, def);
|
|
5747
|
-
ZodStringFormat.init(inst, def);
|
|
5748
|
-
});
|
|
5749
|
-
var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
|
|
5750
|
-
$ZodEmail.init(inst, def);
|
|
5751
|
-
ZodStringFormat.init(inst, def);
|
|
5752
|
-
});
|
|
5753
|
-
var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
|
|
5754
|
-
$ZodGUID.init(inst, def);
|
|
5755
|
-
ZodStringFormat.init(inst, def);
|
|
5756
|
-
});
|
|
5757
|
-
var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
|
|
5758
|
-
$ZodUUID.init(inst, def);
|
|
5759
|
-
ZodStringFormat.init(inst, def);
|
|
5366
|
+
ZodMiniString.init(inst, def);
|
|
5760
5367
|
});
|
|
5761
|
-
var
|
|
5368
|
+
var ZodMiniURL = /* @__PURE__ */ $constructor("ZodMiniURL", (inst, def) => {
|
|
5762
5369
|
$ZodURL.init(inst, def);
|
|
5763
|
-
|
|
5764
|
-
});
|
|
5765
|
-
var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
|
|
5766
|
-
$ZodEmoji.init(inst, def);
|
|
5767
|
-
ZodStringFormat.init(inst, def);
|
|
5768
|
-
});
|
|
5769
|
-
var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
|
|
5770
|
-
$ZodNanoID.init(inst, def);
|
|
5771
|
-
ZodStringFormat.init(inst, def);
|
|
5772
|
-
});
|
|
5773
|
-
var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
|
|
5774
|
-
$ZodCUID.init(inst, def);
|
|
5775
|
-
ZodStringFormat.init(inst, def);
|
|
5776
|
-
});
|
|
5777
|
-
var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
|
|
5778
|
-
$ZodCUID2.init(inst, def);
|
|
5779
|
-
ZodStringFormat.init(inst, def);
|
|
5780
|
-
});
|
|
5781
|
-
var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
|
|
5782
|
-
$ZodULID.init(inst, def);
|
|
5783
|
-
ZodStringFormat.init(inst, def);
|
|
5784
|
-
});
|
|
5785
|
-
var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
|
|
5786
|
-
$ZodXID.init(inst, def);
|
|
5787
|
-
ZodStringFormat.init(inst, def);
|
|
5788
|
-
});
|
|
5789
|
-
var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
|
|
5790
|
-
$ZodKSUID.init(inst, def);
|
|
5791
|
-
ZodStringFormat.init(inst, def);
|
|
5792
|
-
});
|
|
5793
|
-
var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
|
|
5794
|
-
$ZodIPv4.init(inst, def);
|
|
5795
|
-
ZodStringFormat.init(inst, def);
|
|
5796
|
-
});
|
|
5797
|
-
var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
|
|
5798
|
-
$ZodIPv6.init(inst, def);
|
|
5799
|
-
ZodStringFormat.init(inst, def);
|
|
5800
|
-
});
|
|
5801
|
-
var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
|
|
5802
|
-
$ZodCIDRv4.init(inst, def);
|
|
5803
|
-
ZodStringFormat.init(inst, def);
|
|
5804
|
-
});
|
|
5805
|
-
var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
|
|
5806
|
-
$ZodCIDRv6.init(inst, def);
|
|
5807
|
-
ZodStringFormat.init(inst, def);
|
|
5808
|
-
});
|
|
5809
|
-
var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
|
|
5810
|
-
$ZodBase64.init(inst, def);
|
|
5811
|
-
ZodStringFormat.init(inst, def);
|
|
5812
|
-
});
|
|
5813
|
-
var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
|
|
5814
|
-
$ZodBase64URL.init(inst, def);
|
|
5815
|
-
ZodStringFormat.init(inst, def);
|
|
5816
|
-
});
|
|
5817
|
-
var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
|
|
5818
|
-
$ZodE164.init(inst, def);
|
|
5819
|
-
ZodStringFormat.init(inst, def);
|
|
5820
|
-
});
|
|
5821
|
-
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
5822
|
-
$ZodJWT.init(inst, def);
|
|
5823
|
-
ZodStringFormat.init(inst, def);
|
|
5370
|
+
ZodMiniStringFormat.init(inst, def);
|
|
5824
5371
|
});
|
|
5825
|
-
|
|
5372
|
+
function url(params) {
|
|
5373
|
+
return _url(ZodMiniURL, params);
|
|
5374
|
+
}
|
|
5375
|
+
var ZodMiniNumber = /* @__PURE__ */ $constructor("ZodMiniNumber", (inst, def) => {
|
|
5826
5376
|
$ZodNumber.init(inst, def);
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
inst.isFinite = true;
|
|
5830
|
-
}, /* @__PURE__ */ derived({
|
|
5831
|
-
minValue: (inst) => {
|
|
5832
|
-
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
5833
|
-
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
5834
|
-
},
|
|
5835
|
-
maxValue: (inst) => {
|
|
5836
|
-
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
5837
|
-
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
5838
|
-
},
|
|
5839
|
-
isInt: (inst) => {
|
|
5840
|
-
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
5841
|
-
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
5842
|
-
},
|
|
5843
|
-
format: (inst) => aggregateChecks(inst).format ?? null
|
|
5844
|
-
}, {
|
|
5845
|
-
gt(value, params) {
|
|
5846
|
-
return this.check(_gt(value, params));
|
|
5847
|
-
},
|
|
5848
|
-
gte(value, params) {
|
|
5849
|
-
return this.check(_gte(value, params));
|
|
5850
|
-
},
|
|
5851
|
-
min(value, params) {
|
|
5852
|
-
return this.check(_gte(value, params));
|
|
5853
|
-
},
|
|
5854
|
-
lt(value, params) {
|
|
5855
|
-
return this.check(_lt(value, params));
|
|
5856
|
-
},
|
|
5857
|
-
lte(value, params) {
|
|
5858
|
-
return this.check(_lte(value, params));
|
|
5859
|
-
},
|
|
5860
|
-
max(value, params) {
|
|
5861
|
-
return this.check(_lte(value, params));
|
|
5862
|
-
},
|
|
5863
|
-
int(params) {
|
|
5864
|
-
return this.check(int(params));
|
|
5865
|
-
},
|
|
5866
|
-
safe(params) {
|
|
5867
|
-
return this.check(int(params));
|
|
5868
|
-
},
|
|
5869
|
-
positive(params) {
|
|
5870
|
-
return this.check(_gt(0, params));
|
|
5871
|
-
},
|
|
5872
|
-
nonnegative(params) {
|
|
5873
|
-
return this.check(_gte(0, params));
|
|
5874
|
-
},
|
|
5875
|
-
negative(params) {
|
|
5876
|
-
return this.check(_lt(0, params));
|
|
5877
|
-
},
|
|
5878
|
-
nonpositive(params) {
|
|
5879
|
-
return this.check(_lte(0, params));
|
|
5880
|
-
},
|
|
5881
|
-
multipleOf(value, params) {
|
|
5882
|
-
return this.check(_multipleOf(value, params));
|
|
5883
|
-
},
|
|
5884
|
-
step(value, params) {
|
|
5885
|
-
return this.check(_multipleOf(value, params));
|
|
5886
|
-
},
|
|
5887
|
-
finite() {
|
|
5888
|
-
return this;
|
|
5889
|
-
}
|
|
5890
|
-
}));
|
|
5377
|
+
ZodMiniType.init(inst, def);
|
|
5378
|
+
});
|
|
5891
5379
|
function number2(params) {
|
|
5892
|
-
return _number(
|
|
5380
|
+
return _number(ZodMiniNumber, params);
|
|
5893
5381
|
}
|
|
5894
|
-
var
|
|
5382
|
+
var ZodMiniNumberFormat = /* @__PURE__ */ $constructor("ZodMiniNumberFormat", (inst, def) => {
|
|
5895
5383
|
$ZodNumberFormat.init(inst, def);
|
|
5896
|
-
|
|
5384
|
+
ZodMiniNumber.init(inst, def);
|
|
5897
5385
|
});
|
|
5898
5386
|
function int(params) {
|
|
5899
|
-
return _int(
|
|
5387
|
+
return _int(ZodMiniNumberFormat, params);
|
|
5900
5388
|
}
|
|
5901
|
-
var
|
|
5389
|
+
var ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
|
|
5902
5390
|
$ZodBoolean.init(inst, def);
|
|
5903
|
-
|
|
5904
|
-
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
|
|
5391
|
+
ZodMiniType.init(inst, def);
|
|
5905
5392
|
});
|
|
5906
5393
|
function boolean2(params) {
|
|
5907
|
-
return _boolean(
|
|
5394
|
+
return _boolean(ZodMiniBoolean, params);
|
|
5908
5395
|
}
|
|
5909
|
-
var
|
|
5396
|
+
var ZodMiniUnknown = /* @__PURE__ */ $constructor("ZodMiniUnknown", (inst, def) => {
|
|
5910
5397
|
$ZodUnknown.init(inst, def);
|
|
5911
|
-
|
|
5912
|
-
inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
|
|
5398
|
+
ZodMiniType.init(inst, def);
|
|
5913
5399
|
});
|
|
5914
5400
|
function unknown() {
|
|
5915
|
-
return _unknown(
|
|
5401
|
+
return _unknown(ZodMiniUnknown);
|
|
5916
5402
|
}
|
|
5917
|
-
var
|
|
5403
|
+
var ZodMiniNever = /* @__PURE__ */ $constructor("ZodMiniNever", (inst, def) => {
|
|
5918
5404
|
$ZodNever.init(inst, def);
|
|
5919
|
-
|
|
5920
|
-
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
|
|
5405
|
+
ZodMiniType.init(inst, def);
|
|
5921
5406
|
});
|
|
5922
5407
|
function never(params) {
|
|
5923
|
-
return _never(
|
|
5408
|
+
return _never(ZodMiniNever, params);
|
|
5924
5409
|
}
|
|
5925
|
-
var
|
|
5926
|
-
_ensureDefaultMemoizer();
|
|
5410
|
+
var ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
|
|
5927
5411
|
$ZodArray.init(inst, def);
|
|
5928
|
-
|
|
5929
|
-
inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
|
|
5930
|
-
inst.element = def.element;
|
|
5931
|
-
}, {
|
|
5932
|
-
min(n, params) {
|
|
5933
|
-
return this.check(_minLength(n, params));
|
|
5934
|
-
},
|
|
5935
|
-
nonempty(params) {
|
|
5936
|
-
return this.check(_minLength(1, params));
|
|
5937
|
-
},
|
|
5938
|
-
max(n, params) {
|
|
5939
|
-
return this.check(_maxLength(n, params));
|
|
5940
|
-
},
|
|
5941
|
-
length(n, params) {
|
|
5942
|
-
return this.check(_length(n, params));
|
|
5943
|
-
},
|
|
5944
|
-
unwrap() {
|
|
5945
|
-
return this.element;
|
|
5946
|
-
}
|
|
5412
|
+
ZodMiniType.init(inst, def);
|
|
5947
5413
|
});
|
|
5948
5414
|
function array(element, params) {
|
|
5949
|
-
return
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5415
|
+
return new ZodMiniArray({
|
|
5416
|
+
type: "array",
|
|
5417
|
+
element,
|
|
5418
|
+
...normalizeParams(params)
|
|
5419
|
+
});
|
|
5420
|
+
}
|
|
5421
|
+
var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
5422
|
+
$ZodObject.init(inst, def);
|
|
5423
|
+
ZodMiniType.init(inst, def);
|
|
5956
5424
|
installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
5957
|
-
}, {
|
|
5958
|
-
keyof() {
|
|
5959
|
-
return _enum(Object.keys(this._zod.def.shape));
|
|
5960
|
-
},
|
|
5961
|
-
catchall(catchall) {
|
|
5962
|
-
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
5963
|
-
},
|
|
5964
|
-
passthrough() {
|
|
5965
|
-
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
5966
|
-
},
|
|
5967
|
-
loose() {
|
|
5968
|
-
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
5969
|
-
},
|
|
5970
|
-
strict() {
|
|
5971
|
-
return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
|
|
5972
|
-
},
|
|
5973
|
-
strip() {
|
|
5974
|
-
return this.clone(mergeDefs(this._zod.def, { catchall: undefined }));
|
|
5975
|
-
},
|
|
5976
|
-
extend(incoming) {
|
|
5977
|
-
return extend(this, incoming);
|
|
5978
|
-
},
|
|
5979
|
-
safeExtend(incoming) {
|
|
5980
|
-
return safeExtend(this, incoming);
|
|
5981
|
-
},
|
|
5982
|
-
merge(other) {
|
|
5983
|
-
return merge(this, other);
|
|
5984
|
-
},
|
|
5985
|
-
pick(mask) {
|
|
5986
|
-
return pick(this, mask);
|
|
5987
|
-
},
|
|
5988
|
-
omit(mask) {
|
|
5989
|
-
return omit(this, mask);
|
|
5990
|
-
},
|
|
5991
|
-
partial(...args) {
|
|
5992
|
-
return partial(ZodOptional, this, args[0]);
|
|
5993
|
-
},
|
|
5994
|
-
exactPartial(...args) {
|
|
5995
|
-
return partial(ZodExactOptional, this, args[0], "exactPartial");
|
|
5996
|
-
},
|
|
5997
|
-
required(...args) {
|
|
5998
|
-
return required(ZodNonOptional, this, args[0]);
|
|
5999
|
-
}
|
|
6000
5425
|
});
|
|
6001
|
-
function
|
|
6002
|
-
|
|
5426
|
+
function strictObject(shape, params) {
|
|
5427
|
+
return new ZodMiniObject({
|
|
6003
5428
|
type: "object",
|
|
6004
|
-
shape
|
|
5429
|
+
shape,
|
|
5430
|
+
catchall: never(),
|
|
6005
5431
|
...normalizeParams(params)
|
|
6006
|
-
};
|
|
6007
|
-
return new ZodObject(def);
|
|
5432
|
+
});
|
|
6008
5433
|
}
|
|
6009
5434
|
function looseObject(shape, params) {
|
|
6010
|
-
return new
|
|
5435
|
+
return new ZodMiniObject({
|
|
6011
5436
|
type: "object",
|
|
6012
5437
|
shape,
|
|
6013
5438
|
catchall: unknown(),
|
|
6014
5439
|
...normalizeParams(params)
|
|
6015
5440
|
});
|
|
6016
5441
|
}
|
|
6017
|
-
|
|
5442
|
+
function extend2(schema, shape) {
|
|
5443
|
+
return extend(schema, shape);
|
|
5444
|
+
}
|
|
5445
|
+
function pick2(schema, mask) {
|
|
5446
|
+
return pick(schema, mask);
|
|
5447
|
+
}
|
|
5448
|
+
function omit2(schema, mask) {
|
|
5449
|
+
return omit(schema, mask);
|
|
5450
|
+
}
|
|
5451
|
+
var ZodMiniUnion = /* @__PURE__ */ $constructor("ZodMiniUnion", (inst, def) => {
|
|
6018
5452
|
$ZodUnion.init(inst, def);
|
|
6019
|
-
|
|
6020
|
-
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
6021
|
-
inst.options = def.options;
|
|
5453
|
+
ZodMiniType.init(inst, def);
|
|
6022
5454
|
});
|
|
6023
5455
|
function union(options, params) {
|
|
6024
|
-
return new
|
|
5456
|
+
return new ZodMiniUnion({
|
|
6025
5457
|
type: "union",
|
|
6026
5458
|
options,
|
|
6027
5459
|
...normalizeParams(params)
|
|
6028
5460
|
});
|
|
6029
5461
|
}
|
|
6030
|
-
var
|
|
6031
|
-
ZodUnion.init(inst, def);
|
|
5462
|
+
var ZodMiniDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
|
|
6032
5463
|
$ZodDiscriminatedUnion.init(inst, def);
|
|
5464
|
+
ZodMiniType.init(inst, def);
|
|
6033
5465
|
});
|
|
6034
5466
|
function discriminatedUnion(discriminator, options, params) {
|
|
6035
|
-
return new
|
|
5467
|
+
return new ZodMiniDiscriminatedUnion({
|
|
6036
5468
|
type: "union",
|
|
6037
5469
|
options,
|
|
6038
5470
|
discriminator,
|
|
6039
5471
|
...normalizeParams(params)
|
|
6040
5472
|
});
|
|
6041
5473
|
}
|
|
6042
|
-
var
|
|
6043
|
-
$ZodIntersection.init(inst, def);
|
|
6044
|
-
ZodType.init(inst, def);
|
|
6045
|
-
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
6046
|
-
});
|
|
6047
|
-
function intersection(left, right) {
|
|
6048
|
-
return new ZodIntersection({
|
|
6049
|
-
type: "intersection",
|
|
6050
|
-
left,
|
|
6051
|
-
right
|
|
6052
|
-
});
|
|
6053
|
-
}
|
|
6054
|
-
var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
6055
|
-
_ensureDefaultMemoizer();
|
|
5474
|
+
var ZodMiniRecord = /* @__PURE__ */ $constructor("ZodMiniRecord", (inst, def) => {
|
|
6056
5475
|
$ZodRecord.init(inst, def);
|
|
6057
|
-
|
|
6058
|
-
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
6059
|
-
inst.keyType = def.keyType;
|
|
6060
|
-
inst.valueType = def.valueType;
|
|
5476
|
+
ZodMiniType.init(inst, def);
|
|
6061
5477
|
});
|
|
6062
5478
|
function record(keyType, valueType, params) {
|
|
6063
5479
|
if (!valueType || !valueType._zod) {
|
|
6064
|
-
return new
|
|
5480
|
+
return new ZodMiniRecord({
|
|
6065
5481
|
type: "record",
|
|
6066
5482
|
keyType: string2(),
|
|
6067
5483
|
valueType: keyType,
|
|
6068
5484
|
...normalizeParams(valueType)
|
|
6069
5485
|
});
|
|
6070
5486
|
}
|
|
6071
|
-
return new
|
|
5487
|
+
return new ZodMiniRecord({
|
|
6072
5488
|
type: "record",
|
|
6073
5489
|
keyType,
|
|
6074
5490
|
valueType,
|
|
6075
5491
|
...normalizeParams(params)
|
|
6076
5492
|
});
|
|
6077
5493
|
}
|
|
6078
|
-
var
|
|
5494
|
+
var ZodMiniEnum = /* @__PURE__ */ $constructor("ZodMiniEnum", (inst, def) => {
|
|
6079
5495
|
$ZodEnum.init(inst, def);
|
|
6080
|
-
|
|
6081
|
-
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
6082
|
-
inst.enum = def.entries;
|
|
5496
|
+
ZodMiniType.init(inst, def);
|
|
6083
5497
|
inst.options = [...inst._zod.values];
|
|
6084
|
-
const keys = new Set(Object.keys(def.entries));
|
|
6085
|
-
inst.extract = (values, params) => {
|
|
6086
|
-
const newEntries = {};
|
|
6087
|
-
for (const value of values) {
|
|
6088
|
-
if (keys.has(value)) {
|
|
6089
|
-
newEntries[value] = def.entries[value];
|
|
6090
|
-
} else
|
|
6091
|
-
throw new Error(`Key ${value} not found in enum`);
|
|
6092
|
-
}
|
|
6093
|
-
return new ZodEnum({
|
|
6094
|
-
...def,
|
|
6095
|
-
checks: [],
|
|
6096
|
-
...normalizeParams(params),
|
|
6097
|
-
entries: newEntries
|
|
6098
|
-
});
|
|
6099
|
-
};
|
|
6100
|
-
inst.exclude = (values, params) => {
|
|
6101
|
-
const newEntries = { ...def.entries };
|
|
6102
|
-
for (const value of values) {
|
|
6103
|
-
if (keys.has(value)) {
|
|
6104
|
-
delete newEntries[value];
|
|
6105
|
-
} else
|
|
6106
|
-
throw new Error(`Key ${value} not found in enum`);
|
|
6107
|
-
}
|
|
6108
|
-
return new ZodEnum({
|
|
6109
|
-
...def,
|
|
6110
|
-
checks: [],
|
|
6111
|
-
...normalizeParams(params),
|
|
6112
|
-
entries: newEntries
|
|
6113
|
-
});
|
|
6114
|
-
};
|
|
6115
5498
|
});
|
|
6116
5499
|
function _enum(values, params) {
|
|
6117
5500
|
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
6118
|
-
return new
|
|
5501
|
+
return new ZodMiniEnum({
|
|
6119
5502
|
type: "enum",
|
|
6120
5503
|
entries,
|
|
6121
5504
|
...normalizeParams(params)
|
|
6122
5505
|
});
|
|
6123
5506
|
}
|
|
6124
|
-
var
|
|
5507
|
+
var ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
|
|
6125
5508
|
$ZodLiteral.init(inst, def);
|
|
6126
|
-
|
|
6127
|
-
inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
|
|
6128
|
-
inst.values = new Set(def.values);
|
|
6129
|
-
Object.defineProperty(inst, "value", {
|
|
6130
|
-
get() {
|
|
6131
|
-
if (def.values.length > 1) {
|
|
6132
|
-
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
6133
|
-
}
|
|
6134
|
-
return def.values[0];
|
|
6135
|
-
}
|
|
6136
|
-
});
|
|
5509
|
+
ZodMiniType.init(inst, def);
|
|
6137
5510
|
});
|
|
6138
5511
|
function literal(value, params) {
|
|
6139
|
-
return new
|
|
5512
|
+
return new ZodMiniLiteral({
|
|
6140
5513
|
type: "literal",
|
|
6141
5514
|
values: Array.isArray(value) ? value : [value],
|
|
6142
5515
|
...normalizeParams(params)
|
|
6143
5516
|
});
|
|
6144
5517
|
}
|
|
6145
|
-
var
|
|
6146
|
-
_ensureDefaultMemoizer();
|
|
6147
|
-
$ZodTransform.init(inst, def);
|
|
6148
|
-
ZodType.init(inst, def);
|
|
6149
|
-
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
|
|
6150
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
6151
|
-
if (_ctx.direction === "backward") {
|
|
6152
|
-
throw new $ZodEncodeError(inst.constructor.name);
|
|
6153
|
-
}
|
|
6154
|
-
payload.addIssue = (issue2) => {
|
|
6155
|
-
if (typeof issue2 === "string") {
|
|
6156
|
-
payload.issues.push(issue(issue2, payload.value, def));
|
|
6157
|
-
} else {
|
|
6158
|
-
const _issue = issue2;
|
|
6159
|
-
if (_issue.fatal)
|
|
6160
|
-
_issue.continue = false;
|
|
6161
|
-
_issue.code ?? (_issue.code = "custom");
|
|
6162
|
-
if (!("input" in _issue))
|
|
6163
|
-
_issue.input = payload.value;
|
|
6164
|
-
_issue.inst ?? (_issue.inst = inst);
|
|
6165
|
-
payload.issues.push(issue(_issue));
|
|
6166
|
-
}
|
|
6167
|
-
};
|
|
6168
|
-
const output = def.transform(payload.value, payload);
|
|
6169
|
-
if (output instanceof Promise) {
|
|
6170
|
-
return output.then((output) => {
|
|
6171
|
-
payload.value = output;
|
|
6172
|
-
return payload;
|
|
6173
|
-
});
|
|
6174
|
-
}
|
|
6175
|
-
payload.value = output;
|
|
6176
|
-
return payload;
|
|
6177
|
-
};
|
|
6178
|
-
});
|
|
6179
|
-
function transform(fn) {
|
|
6180
|
-
return new ZodTransform({
|
|
6181
|
-
type: "transform",
|
|
6182
|
-
transform: fn
|
|
6183
|
-
});
|
|
6184
|
-
}
|
|
6185
|
-
var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
5518
|
+
var ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
|
|
6186
5519
|
$ZodOptional.init(inst, def);
|
|
6187
|
-
|
|
6188
|
-
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
6189
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
5520
|
+
ZodMiniType.init(inst, def);
|
|
6190
5521
|
});
|
|
6191
5522
|
function optional(innerType) {
|
|
6192
|
-
return new
|
|
6193
|
-
type: "optional",
|
|
6194
|
-
innerType
|
|
6195
|
-
});
|
|
6196
|
-
}
|
|
6197
|
-
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
6198
|
-
$ZodExactOptional.init(inst, def);
|
|
6199
|
-
ZodType.init(inst, def);
|
|
6200
|
-
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
6201
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
6202
|
-
});
|
|
6203
|
-
function exactOptional(innerType) {
|
|
6204
|
-
return new ZodExactOptional({
|
|
5523
|
+
return new ZodMiniOptional({
|
|
6205
5524
|
type: "optional",
|
|
6206
5525
|
innerType
|
|
6207
5526
|
});
|
|
6208
5527
|
}
|
|
6209
|
-
var
|
|
5528
|
+
var ZodMiniNullable = /* @__PURE__ */ $constructor("ZodMiniNullable", (inst, def) => {
|
|
6210
5529
|
$ZodNullable.init(inst, def);
|
|
6211
|
-
|
|
6212
|
-
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
6213
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
5530
|
+
ZodMiniType.init(inst, def);
|
|
6214
5531
|
});
|
|
6215
5532
|
function nullable(innerType) {
|
|
6216
|
-
return new
|
|
5533
|
+
return new ZodMiniNullable({
|
|
6217
5534
|
type: "nullable",
|
|
6218
5535
|
innerType
|
|
6219
5536
|
});
|
|
6220
5537
|
}
|
|
6221
|
-
var
|
|
6222
|
-
$
|
|
6223
|
-
|
|
6224
|
-
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
6225
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
6226
|
-
inst.removeDefault = inst.unwrap;
|
|
6227
|
-
});
|
|
6228
|
-
function _default(innerType, defaultValue) {
|
|
6229
|
-
return new ZodDefault({
|
|
6230
|
-
type: "default",
|
|
6231
|
-
innerType,
|
|
6232
|
-
get defaultValue() {
|
|
6233
|
-
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
6234
|
-
}
|
|
6235
|
-
});
|
|
6236
|
-
}
|
|
6237
|
-
var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
6238
|
-
$ZodPrefault.init(inst, def);
|
|
6239
|
-
ZodType.init(inst, def);
|
|
6240
|
-
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
6241
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
6242
|
-
});
|
|
6243
|
-
function prefault(innerType, defaultValue) {
|
|
6244
|
-
return new ZodPrefault({
|
|
6245
|
-
type: "prefault",
|
|
6246
|
-
innerType,
|
|
6247
|
-
get defaultValue() {
|
|
6248
|
-
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
6249
|
-
}
|
|
6250
|
-
});
|
|
6251
|
-
}
|
|
6252
|
-
var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
6253
|
-
$ZodNonOptional.init(inst, def);
|
|
6254
|
-
ZodType.init(inst, def);
|
|
6255
|
-
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
6256
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
5538
|
+
var ZodMiniCustom = /* @__PURE__ */ $constructor("ZodMiniCustom", (inst, def) => {
|
|
5539
|
+
$ZodCustom.init(inst, def);
|
|
5540
|
+
ZodMiniType.init(inst, def);
|
|
6257
5541
|
});
|
|
6258
|
-
function
|
|
6259
|
-
return
|
|
6260
|
-
type: "nonoptional",
|
|
6261
|
-
innerType,
|
|
6262
|
-
...normalizeParams(params)
|
|
6263
|
-
});
|
|
5542
|
+
function custom(fn, _params) {
|
|
5543
|
+
return _custom(ZodMiniCustom, fn ?? (() => true), _params);
|
|
6264
5544
|
}
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
ZodType.init(inst, def);
|
|
6268
|
-
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
6269
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
6270
|
-
inst.removeCatch = inst.unwrap;
|
|
6271
|
-
});
|
|
6272
|
-
function _catch(innerType, catchValue) {
|
|
6273
|
-
return new ZodCatch({
|
|
6274
|
-
type: "catch",
|
|
6275
|
-
innerType,
|
|
6276
|
-
catchValue: typeof catchValue === "function" ? catchValue : constantCatch(catchValue)
|
|
6277
|
-
});
|
|
5545
|
+
function refine(fn, _params = {}) {
|
|
5546
|
+
return _refine(ZodMiniCustom, fn, _params);
|
|
6278
5547
|
}
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
ZodType.init(inst, def);
|
|
6282
|
-
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
6283
|
-
inst.in = def.in;
|
|
6284
|
-
inst.out = def.out;
|
|
6285
|
-
});
|
|
6286
|
-
function pipe(in_, out) {
|
|
6287
|
-
return new ZodPipe({
|
|
6288
|
-
type: "pipe",
|
|
6289
|
-
in: in_,
|
|
6290
|
-
out
|
|
6291
|
-
});
|
|
6292
|
-
}
|
|
6293
|
-
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
6294
|
-
$ZodReadonly.init(inst, def);
|
|
6295
|
-
ZodType.init(inst, def);
|
|
6296
|
-
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
6297
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
6298
|
-
});
|
|
6299
|
-
function readonly(innerType) {
|
|
6300
|
-
return new ZodReadonly({
|
|
6301
|
-
type: "readonly",
|
|
6302
|
-
innerType
|
|
6303
|
-
});
|
|
6304
|
-
}
|
|
6305
|
-
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
6306
|
-
$ZodCustom.init(inst, def);
|
|
6307
|
-
ZodType.init(inst, def);
|
|
6308
|
-
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
6309
|
-
});
|
|
6310
|
-
function custom(fn, _params) {
|
|
6311
|
-
return _custom(ZodCustom, fn ?? (() => true), _params);
|
|
6312
|
-
}
|
|
6313
|
-
function refine(fn, _params = {}) {
|
|
6314
|
-
return _refine(ZodCustom, fn, _params);
|
|
6315
|
-
}
|
|
6316
|
-
function superRefine(fn, params) {
|
|
6317
|
-
return _superRefine(fn, params);
|
|
5548
|
+
function superRefine(fn, params) {
|
|
5549
|
+
return _superRefine(fn, params);
|
|
6318
5550
|
}
|
|
5551
|
+
// packages/workit-core/src/core/zod-mini.ts
|
|
5552
|
+
if (!globalConfig.localeError)
|
|
5553
|
+
config(en_default());
|
|
5554
|
+
if (!globalConfig.memoizer)
|
|
5555
|
+
config({ memoizer: memoizer() });
|
|
5556
|
+
var described = (schema, description) => {
|
|
5557
|
+
const copy = schema.clone();
|
|
5558
|
+
globalRegistry.add(copy, { description });
|
|
5559
|
+
return copy;
|
|
5560
|
+
};
|
|
5561
|
+
|
|
6319
5562
|
// packages/workit-core/src/core/scope-glob.ts
|
|
6320
5563
|
var GLOB = /[*?[\]{}]/u;
|
|
6321
5564
|
var segmentRegex = (pattern) => {
|
|
@@ -6403,11 +5646,11 @@ var text = string2().check((ctx) => {
|
|
|
6403
5646
|
if (invalidUnicode(ctx.value))
|
|
6404
5647
|
ctx.issues.push({ code: "custom", input: ctx.value, message: "invalid Unicode", path: [] });
|
|
6405
5648
|
});
|
|
6406
|
-
var id = text.
|
|
5649
|
+
var id = text.check(_regex(uuidPattern, "expected lowercase UUID"));
|
|
6407
5650
|
var idRefPattern = /^[0-9a-f][0-9a-f-]{7,35}$/;
|
|
6408
|
-
var idRef = text.
|
|
6409
|
-
var digest = text.
|
|
6410
|
-
var revision = text.
|
|
5651
|
+
var idRef = text.check(_regex(idRefPattern, "expected a UUID or an id prefix of 8+ characters"));
|
|
5652
|
+
var digest = text.check(_regex(digestPattern, "expected lowercase SHA-256 digest"));
|
|
5653
|
+
var revision = text.check(_regex(uuidPattern, "expected UUID revision"));
|
|
6411
5654
|
var validUtc = (value) => {
|
|
6412
5655
|
const match = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,9}))?Z$/.exec(value);
|
|
6413
5656
|
if (!match)
|
|
@@ -6428,8 +5671,8 @@ var utcSchema = text.check((ctx) => {
|
|
|
6428
5671
|
});
|
|
6429
5672
|
});
|
|
6430
5673
|
var utc = utcSchema;
|
|
6431
|
-
var safeInteger = number2().int().
|
|
6432
|
-
var nonEmpty = text.
|
|
5674
|
+
var safeInteger = number2().check(int()).check(int());
|
|
5675
|
+
var nonEmpty = text.check(_minLength(1));
|
|
6433
5676
|
var pathValue = nonEmpty.check((ctx) => {
|
|
6434
5677
|
if (ctx.value !== "." && (ctx.value.includes("\\") || ctx.value.split("/").includes(".."))) {
|
|
6435
5678
|
ctx.issues.push({
|
|
@@ -6440,8 +5683,8 @@ var pathValue = nonEmpty.check((ctx) => {
|
|
|
6440
5683
|
});
|
|
6441
5684
|
}
|
|
6442
5685
|
});
|
|
6443
|
-
var nullableDigest =
|
|
6444
|
-
var nullableId =
|
|
5686
|
+
var nullableDigest = nullable(digest);
|
|
5687
|
+
var nullableId = nullable(id);
|
|
6445
5688
|
var hostSchema = _enum([
|
|
6446
5689
|
"opencode",
|
|
6447
5690
|
"cursor",
|
|
@@ -6453,11 +5696,11 @@ var hostSchema = _enum([
|
|
|
6453
5696
|
]);
|
|
6454
5697
|
var assuranceSchema = _enum(["enforced", "agent_guided", "unavailable"]);
|
|
6455
5698
|
var outcomeSchema = _enum(["verified", "accepted_limitations", "stopped"]);
|
|
6456
|
-
var scopeSchema =
|
|
5699
|
+
var scopeSchema = strictObject({
|
|
6457
5700
|
description: text,
|
|
6458
5701
|
paths: array(pathValue),
|
|
6459
5702
|
exclusions: array(pathValue)
|
|
6460
|
-
})
|
|
5703
|
+
});
|
|
6461
5704
|
var scopeGap = (outer, inner) => {
|
|
6462
5705
|
const strip = (value) => value.length > 1 ? value.replace(/\/+$/, "") : value;
|
|
6463
5706
|
const normOuter = {
|
|
@@ -6482,14 +5725,14 @@ var scopeGap = (outer, inner) => {
|
|
|
6482
5725
|
};
|
|
6483
5726
|
var scopeCovers = (outer, inner) => scopeGap(outer, inner) === null;
|
|
6484
5727
|
var refSchema = discriminatedUnion("kind", [
|
|
6485
|
-
|
|
6486
|
-
|
|
5728
|
+
strictObject({ kind: literal("file"), path: pathValue, digest: nullableDigest }),
|
|
5729
|
+
strictObject({
|
|
6487
5730
|
kind: literal("record"),
|
|
6488
5731
|
collection: _enum(["evidence", "decisions", "findings", "workers"]),
|
|
6489
5732
|
id
|
|
6490
|
-
})
|
|
6491
|
-
|
|
6492
|
-
|
|
5733
|
+
}),
|
|
5734
|
+
strictObject({ kind: literal("host"), host: hostSchema, handle: nonEmpty }),
|
|
5735
|
+
strictObject({ kind: literal("external"), url: text.check(url()) })
|
|
6493
5736
|
]);
|
|
6494
5737
|
var rewriteUnknown = (value, map) => {
|
|
6495
5738
|
if (Array.isArray(value)) {
|
|
@@ -6521,8 +5764,8 @@ var rewriteNode = (value, schema, map) => {
|
|
|
6521
5764
|
return mapped === null ? { drop: true } : { drop: false, value: mapped };
|
|
6522
5765
|
}
|
|
6523
5766
|
let node = schema;
|
|
6524
|
-
while (node instanceof ZodNullable || node instanceof ZodOptional || node instanceof ZodDefault) {
|
|
6525
|
-
node = node.
|
|
5767
|
+
while (node instanceof $ZodNullable || node instanceof $ZodOptional || node instanceof $ZodDefault) {
|
|
5768
|
+
node = node._zod.def.innerType;
|
|
6526
5769
|
}
|
|
6527
5770
|
if (node === refSchema) {
|
|
6528
5771
|
if (!refSchema.safeParse(value).success)
|
|
@@ -6530,21 +5773,21 @@ var rewriteNode = (value, schema, map) => {
|
|
|
6530
5773
|
const mapped = map(value);
|
|
6531
5774
|
return mapped === null ? { drop: true } : { drop: false, value: mapped };
|
|
6532
5775
|
}
|
|
6533
|
-
if (node instanceof ZodArray) {
|
|
5776
|
+
if (node instanceof $ZodArray) {
|
|
6534
5777
|
if (!Array.isArray(value))
|
|
6535
5778
|
return { drop: false, value };
|
|
6536
5779
|
const out = [];
|
|
6537
5780
|
for (const item of value) {
|
|
6538
|
-
const rewritten = rewriteNode(item, node.element, map);
|
|
5781
|
+
const rewritten = rewriteNode(item, node._zod.def.element, map);
|
|
6539
5782
|
if (!rewritten.drop)
|
|
6540
5783
|
out.push(rewritten.value);
|
|
6541
5784
|
}
|
|
6542
5785
|
return { drop: false, value: out };
|
|
6543
5786
|
}
|
|
6544
|
-
if (node instanceof ZodObject) {
|
|
5787
|
+
if (node instanceof $ZodObject) {
|
|
6545
5788
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
6546
5789
|
return { drop: false, value };
|
|
6547
|
-
const shape = node.shape;
|
|
5790
|
+
const shape = node._zod.def.shape;
|
|
6548
5791
|
const record = value;
|
|
6549
5792
|
const out = {};
|
|
6550
5793
|
for (const [key, item] of Object.entries(record)) {
|
|
@@ -6556,9 +5799,9 @@ var rewriteNode = (value, schema, map) => {
|
|
|
6556
5799
|
const child = shape[key];
|
|
6557
5800
|
const rewritten = rewriteNode(item, child, map);
|
|
6558
5801
|
if (rewritten.drop) {
|
|
6559
|
-
if (child instanceof ZodOptional || child instanceof ZodDefault)
|
|
5802
|
+
if (child instanceof $ZodOptional || child instanceof $ZodDefault)
|
|
6560
5803
|
continue;
|
|
6561
|
-
if (child instanceof ZodNullable) {
|
|
5804
|
+
if (child instanceof $ZodNullable) {
|
|
6562
5805
|
out[key] = null;
|
|
6563
5806
|
continue;
|
|
6564
5807
|
}
|
|
@@ -6574,34 +5817,34 @@ var rewriteRecordRefs = (value, schema, map) => {
|
|
|
6574
5817
|
const rewritten = rewriteNode(value, schema, map);
|
|
6575
5818
|
return rewritten.drop ? null : rewritten.value;
|
|
6576
5819
|
};
|
|
6577
|
-
var provenanceSchema =
|
|
5820
|
+
var provenanceSchema = strictObject({
|
|
6578
5821
|
kind: _enum(["host_observed", "agent_reported", "imported"]),
|
|
6579
5822
|
host: hostSchema,
|
|
6580
|
-
session:
|
|
5823
|
+
session: nullable(refSchema),
|
|
6581
5824
|
workerId: nullableId
|
|
6582
|
-
})
|
|
6583
|
-
var entrySchema = (data) =>
|
|
5825
|
+
});
|
|
5826
|
+
var entrySchema = (data) => strictObject({ id, recordedAt: utc, provenance: provenanceSchema, data });
|
|
6584
5827
|
var RISK_TIERS = ["trivial", "normal", "high"];
|
|
6585
|
-
var judgmentSchema =
|
|
5828
|
+
var judgmentSchema = strictObject({
|
|
6586
5829
|
riskTier: _enum(RISK_TIERS),
|
|
6587
5830
|
behaviorChange: boolean2(),
|
|
6588
5831
|
productChoiceOpen: boolean2(),
|
|
6589
5832
|
needsPlan: boolean2(),
|
|
6590
|
-
note:
|
|
5833
|
+
note: nullable(text),
|
|
6591
5834
|
refs: array(refSchema)
|
|
6592
|
-
})
|
|
5835
|
+
});
|
|
6593
5836
|
var legacyAssessmentSchema = looseObject({});
|
|
6594
|
-
var constraintSchema =
|
|
5837
|
+
var constraintSchema = strictObject({
|
|
6595
5838
|
id: nonEmpty,
|
|
6596
5839
|
kind: _enum(["host", "project", "user"]),
|
|
6597
5840
|
statement: text,
|
|
6598
5841
|
source: refSchema,
|
|
6599
5842
|
acceptanceAllowed: boolean2(),
|
|
6600
|
-
requires: array(
|
|
5843
|
+
requires: array(strictObject({
|
|
6601
5844
|
kind: _enum(["check", "method", "decision"]),
|
|
6602
5845
|
scope: scopeSchema,
|
|
6603
5846
|
refs: array(refSchema),
|
|
6604
|
-
method: _enum([
|
|
5847
|
+
method: nullable(_enum([
|
|
6605
5848
|
"investigation",
|
|
6606
5849
|
"challenge",
|
|
6607
5850
|
"artifacts",
|
|
@@ -6611,10 +5854,10 @@ var constraintSchema = object({
|
|
|
6611
5854
|
"delegation",
|
|
6612
5855
|
"continuity",
|
|
6613
5856
|
"decisions"
|
|
6614
|
-
])
|
|
5857
|
+
])),
|
|
6615
5858
|
before: _enum(["dependent_action", "write", "close"]),
|
|
6616
|
-
dependentAction:
|
|
6617
|
-
}).
|
|
5859
|
+
dependentAction: nullable(text)
|
|
5860
|
+
}).check((ctx) => {
|
|
6618
5861
|
const obligation = ctx.value;
|
|
6619
5862
|
const validMethod = obligation.kind === "method" && obligation.method !== null || obligation.kind !== "method" && obligation.method === null;
|
|
6620
5863
|
if (!validMethod)
|
|
@@ -6625,13 +5868,17 @@ var constraintSchema = object({
|
|
|
6625
5868
|
path: ["method"]
|
|
6626
5869
|
});
|
|
6627
5870
|
}))
|
|
6628
|
-
})
|
|
6629
|
-
var intentSchema =
|
|
6630
|
-
|
|
5871
|
+
});
|
|
5872
|
+
var intentSchema = strictObject({
|
|
5873
|
+
objective: text,
|
|
5874
|
+
scope: scopeSchema,
|
|
5875
|
+
authorityRefs: array(refSchema)
|
|
5876
|
+
});
|
|
5877
|
+
var progressSchema = strictObject({
|
|
6631
5878
|
summary: text,
|
|
6632
|
-
nextAction:
|
|
6633
|
-
blockers: array(
|
|
6634
|
-
})
|
|
5879
|
+
nextAction: nullable(text),
|
|
5880
|
+
blockers: array(strictObject({ reason: text, dependentAction: text, refs: array(refSchema) }))
|
|
5881
|
+
});
|
|
6635
5882
|
var dimensionSchema = _enum([
|
|
6636
5883
|
"investigation",
|
|
6637
5884
|
"challenge",
|
|
@@ -6643,10 +5890,10 @@ var dimensionSchema = _enum([
|
|
|
6643
5890
|
"continuity",
|
|
6644
5891
|
"decisions"
|
|
6645
5892
|
]);
|
|
6646
|
-
var policySchema =
|
|
6647
|
-
policyVersion: text.
|
|
5893
|
+
var policySchema = strictObject({
|
|
5894
|
+
policyVersion: text.check(_regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/)),
|
|
6648
5895
|
inputDigest: digest,
|
|
6649
|
-
requirements: array(
|
|
5896
|
+
requirements: array(strictObject({
|
|
6650
5897
|
id: digest,
|
|
6651
5898
|
ruleId: nonEmpty,
|
|
6652
5899
|
dimension: dimensionSchema,
|
|
@@ -6654,29 +5901,29 @@ var policySchema = object({
|
|
|
6654
5901
|
reason: text,
|
|
6655
5902
|
satisfaction: text,
|
|
6656
5903
|
before: _enum(["dependent_action", "write", "close"]),
|
|
6657
|
-
dependentAction:
|
|
5904
|
+
dependentAction: nullable(text),
|
|
6658
5905
|
acceptanceAllowed: boolean2()
|
|
6659
|
-
})
|
|
6660
|
-
})
|
|
6661
|
-
var requirementSchema = policySchema.shape.requirements.element;
|
|
6662
|
-
var policyChangeSchema =
|
|
5906
|
+
}))
|
|
5907
|
+
});
|
|
5908
|
+
var requirementSchema = policySchema.shape.requirements._zod.def.element;
|
|
5909
|
+
var policyChangeSchema = strictObject({
|
|
6663
5910
|
recordedAt: utc,
|
|
6664
5911
|
fromInputDigest: nullableDigest,
|
|
6665
5912
|
toInputDigest: digest,
|
|
6666
5913
|
added: array(digest),
|
|
6667
5914
|
retired: array(digest),
|
|
6668
5915
|
reason: text
|
|
6669
|
-
})
|
|
6670
|
-
var candidateSchema =
|
|
5916
|
+
});
|
|
5917
|
+
var candidateSchema = strictObject({
|
|
6671
5918
|
id: digest,
|
|
6672
5919
|
scope: scopeSchema,
|
|
6673
5920
|
completeness: _enum(["known", "uncertain"]),
|
|
6674
|
-
files: array(
|
|
5921
|
+
files: array(strictObject({
|
|
6675
5922
|
path: pathValue,
|
|
6676
5923
|
kind: _enum(["file", "symlink", "absent"]),
|
|
6677
5924
|
digest: nullableDigest,
|
|
6678
|
-
executable: boolean2()
|
|
6679
|
-
}).
|
|
5925
|
+
executable: nullable(boolean2())
|
|
5926
|
+
}).check((ctx) => {
|
|
6680
5927
|
const file = ctx.value;
|
|
6681
5928
|
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;
|
|
6682
5929
|
if (!valid)
|
|
@@ -6687,7 +5934,7 @@ var candidateSchema = object({
|
|
|
6687
5934
|
path: []
|
|
6688
5935
|
});
|
|
6689
5936
|
})),
|
|
6690
|
-
environment: array(
|
|
5937
|
+
environment: array(strictObject({ name: nonEmpty, value: nullable(text), refs: array(refSchema) })).check((ctx) => {
|
|
6691
5938
|
if (new Set(ctx.value.map((value) => value.name)).size !== ctx.value.length)
|
|
6692
5939
|
ctx.issues.push({
|
|
6693
5940
|
code: "custom",
|
|
@@ -6696,8 +5943,8 @@ var candidateSchema = object({
|
|
|
6696
5943
|
path: []
|
|
6697
5944
|
});
|
|
6698
5945
|
}),
|
|
6699
|
-
head:
|
|
6700
|
-
}).
|
|
5946
|
+
head: nullable(text)
|
|
5947
|
+
}).check((ctx) => {
|
|
6701
5948
|
if (ctx.value.id !== candidateDigest(ctx.value))
|
|
6702
5949
|
ctx.issues.push({
|
|
6703
5950
|
code: "custom",
|
|
@@ -6706,139 +5953,142 @@ var candidateSchema = object({
|
|
|
6706
5953
|
path: ["id"]
|
|
6707
5954
|
});
|
|
6708
5955
|
});
|
|
6709
|
-
var checkObservationSchema =
|
|
5956
|
+
var checkObservationSchema = strictObject({
|
|
6710
5957
|
observer: literal("workit_cli"),
|
|
6711
|
-
name:
|
|
5958
|
+
name: nullable(nonEmpty),
|
|
6712
5959
|
configured: boolean2(),
|
|
6713
|
-
argv: array(text).
|
|
5960
|
+
argv: array(text).check(_minLength(1)),
|
|
6714
5961
|
shell: boolean2(),
|
|
6715
5962
|
cwd: nonEmpty,
|
|
6716
5963
|
exitCode: safeInteger,
|
|
6717
|
-
durationMs: safeInteger.
|
|
5964
|
+
durationMs: safeInteger.check(_gte(0)),
|
|
6718
5965
|
timedOut: boolean2(),
|
|
6719
|
-
head:
|
|
6720
|
-
tree:
|
|
6721
|
-
dirty: boolean2()
|
|
6722
|
-
signal:
|
|
6723
|
-
treeAfter:
|
|
5966
|
+
head: nullable(text),
|
|
5967
|
+
tree: nullable(text),
|
|
5968
|
+
dirty: nullable(boolean2()),
|
|
5969
|
+
signal: nullable(text),
|
|
5970
|
+
treeAfter: nullable(text),
|
|
6724
5971
|
modifiedWorktree: boolean2(),
|
|
6725
|
-
base:
|
|
6726
|
-
patchId:
|
|
6727
|
-
environment:
|
|
5972
|
+
base: nullable(text),
|
|
5973
|
+
patchId: nullable(text),
|
|
5974
|
+
environment: strictObject({
|
|
6728
5975
|
platform: nonEmpty,
|
|
6729
5976
|
arch: nonEmpty,
|
|
6730
|
-
vars: record(nonEmpty,
|
|
6731
|
-
})
|
|
6732
|
-
logDigest:
|
|
6733
|
-
logRef:
|
|
6734
|
-
logTail: array(text).
|
|
6735
|
-
ledgerRowId:
|
|
6736
|
-
attestation:
|
|
6737
|
-
})
|
|
5977
|
+
vars: record(nonEmpty, nullable(text))
|
|
5978
|
+
}),
|
|
5979
|
+
logDigest: nullable(text),
|
|
5980
|
+
logRef: nullable(text),
|
|
5981
|
+
logTail: array(text).check(_maxLength(40)),
|
|
5982
|
+
ledgerRowId: nullable(text),
|
|
5983
|
+
attestation: nullable(strictObject({ host: nonEmpty, session: nullable(text), agentId: nullable(text) }))
|
|
5984
|
+
});
|
|
6738
5985
|
var CHECK_OBSERVATION_PATH = "evidence.*.data.observation";
|
|
6739
5986
|
var evidenceFields = {
|
|
6740
5987
|
kind: _enum(["check", "review", "investigation", "artifact"]),
|
|
6741
5988
|
claim: text,
|
|
6742
5989
|
requirementIds: array(digest),
|
|
6743
|
-
beforeCandidateId:
|
|
6744
|
-
candidateId:
|
|
5990
|
+
beforeCandidateId: optional(nullableDigest),
|
|
5991
|
+
candidateId: optional(nullableDigest),
|
|
6745
5992
|
result: _enum(["passed", "failed", "missing", "skipped"]),
|
|
6746
5993
|
summary: text,
|
|
6747
5994
|
refs: array(refSchema),
|
|
6748
|
-
exitCode:
|
|
6749
|
-
reviewContext:
|
|
5995
|
+
exitCode: nullable(safeInteger),
|
|
5996
|
+
reviewContext: nullable(refSchema)
|
|
6750
5997
|
};
|
|
6751
|
-
var evidenceSchema =
|
|
6752
|
-
|
|
6753
|
-
|
|
5998
|
+
var evidenceSchema = strictObject({
|
|
5999
|
+
...evidenceFields,
|
|
6000
|
+
observation: optional(checkObservationSchema)
|
|
6001
|
+
});
|
|
6002
|
+
var reportedEvidenceSchema = strictObject(evidenceFields);
|
|
6003
|
+
var evidenceEvaluationSchema = strictObject({
|
|
6754
6004
|
evidenceId: id,
|
|
6755
6005
|
status: _enum(["passed", "failed", "missing", "skipped", "stale"]),
|
|
6756
6006
|
reason: text
|
|
6757
|
-
})
|
|
6758
|
-
var decisionSchema =
|
|
6007
|
+
});
|
|
6008
|
+
var decisionSchema = strictObject({
|
|
6759
6009
|
purpose: _enum(["design", "action", "limitation", "preference"]),
|
|
6760
|
-
binding:
|
|
6010
|
+
binding: strictObject({
|
|
6761
6011
|
taskId: id,
|
|
6762
6012
|
workspaceId: id,
|
|
6763
6013
|
scope: scopeSchema,
|
|
6764
6014
|
presented: text,
|
|
6765
6015
|
contentRefs: array(refSchema),
|
|
6766
|
-
statedChoice:
|
|
6767
|
-
})
|
|
6016
|
+
statedChoice: optional(strictObject({ ref: text, text }))
|
|
6017
|
+
}),
|
|
6768
6018
|
digest,
|
|
6769
6019
|
response: _enum(["approved", "rejected", "stated"]),
|
|
6770
6020
|
requirementIds: array(digest),
|
|
6771
|
-
revoked:
|
|
6772
|
-
})
|
|
6773
|
-
var findingSchema =
|
|
6021
|
+
revoked: nullable(strictObject({ at: utc, reason: text }))
|
|
6022
|
+
});
|
|
6023
|
+
var findingSchema = strictObject({
|
|
6774
6024
|
claim: text,
|
|
6775
6025
|
consequence: text,
|
|
6776
6026
|
scope: scopeSchema,
|
|
6777
6027
|
candidateId: nullableDigest,
|
|
6778
6028
|
refs: array(refSchema),
|
|
6779
6029
|
disposition: _enum(["open", "fixed", "dismissed", "deferred"]),
|
|
6780
|
-
resolution:
|
|
6781
|
-
leadOwned: literal(true)
|
|
6782
|
-
})
|
|
6783
|
-
var assignmentSchema =
|
|
6030
|
+
resolution: nullable(strictObject({ reason: text, evidenceIds: array(id), decisionIds: array(id) })),
|
|
6031
|
+
leadOwned: optional(literal(true))
|
|
6032
|
+
});
|
|
6033
|
+
var assignmentSchema = strictObject({
|
|
6784
6034
|
role: _enum(["investigator", "reviewer", "implementer"]),
|
|
6785
6035
|
objective: text,
|
|
6786
6036
|
scope: scopeSchema,
|
|
6787
6037
|
decisionIds: array(id),
|
|
6788
6038
|
requirementIds: array(digest),
|
|
6789
|
-
candidateId:
|
|
6039
|
+
candidateId: optional(nullableDigest),
|
|
6790
6040
|
stoppingCondition: text
|
|
6791
|
-
})
|
|
6792
|
-
var workerReportSchema =
|
|
6041
|
+
});
|
|
6042
|
+
var workerReportSchema = strictObject({
|
|
6793
6043
|
outcome: _enum(["completed", "failed", "cancelled"]),
|
|
6794
6044
|
summary: text,
|
|
6795
6045
|
evidenceIds: array(id),
|
|
6796
6046
|
findingIds: array(idRef)
|
|
6797
|
-
})
|
|
6798
|
-
var workerSchema =
|
|
6047
|
+
});
|
|
6048
|
+
var workerSchema = strictObject({
|
|
6799
6049
|
assignment: assignmentSchema,
|
|
6800
6050
|
state: _enum(["assigned", "dispatching", "running", "cancelling", "stopped", "unknown"]),
|
|
6801
|
-
session:
|
|
6802
|
-
coordinator:
|
|
6803
|
-
report:
|
|
6804
|
-
})
|
|
6805
|
-
var closureSchema =
|
|
6051
|
+
session: nullable(refSchema),
|
|
6052
|
+
coordinator: optional(refSchema),
|
|
6053
|
+
report: nullable(workerReportSchema)
|
|
6054
|
+
});
|
|
6055
|
+
var closureSchema = strictObject({
|
|
6806
6056
|
outcome: outcomeSchema,
|
|
6807
6057
|
at: utc,
|
|
6808
6058
|
summary: text,
|
|
6809
6059
|
decisionIds: array(id),
|
|
6810
6060
|
evidenceIds: array(id)
|
|
6811
|
-
})
|
|
6812
|
-
var runtimeSchema =
|
|
6813
|
-
createdWith:
|
|
6061
|
+
});
|
|
6062
|
+
var runtimeSchema = strictObject({
|
|
6063
|
+
createdWith: nullable(text),
|
|
6814
6064
|
updatedWith: text
|
|
6815
|
-
})
|
|
6816
|
-
var taskRecordSchema =
|
|
6065
|
+
});
|
|
6066
|
+
var taskRecordSchema = strictObject({
|
|
6817
6067
|
schemaVersion: literal(1),
|
|
6818
6068
|
id,
|
|
6819
6069
|
workspaceId: id,
|
|
6820
6070
|
revision,
|
|
6821
6071
|
createdAt: utc,
|
|
6822
6072
|
updatedAt: utc,
|
|
6823
|
-
origin:
|
|
6073
|
+
origin: nullable(strictObject({ workspaceId: id, taskId: id, exportDigest: digest })),
|
|
6824
6074
|
intent: entrySchema(intentSchema),
|
|
6825
6075
|
constraints: array(constraintSchema),
|
|
6826
6076
|
status: _enum(["active", "paused", "closed"]),
|
|
6827
|
-
closure:
|
|
6077
|
+
closure: nullable(closureSchema),
|
|
6828
6078
|
progress: progressSchema,
|
|
6829
|
-
pauseReason:
|
|
6830
|
-
runtime:
|
|
6079
|
+
pauseReason: optional(nullable(text)),
|
|
6080
|
+
runtime: optional(runtimeSchema),
|
|
6831
6081
|
assessments: array(entrySchema(legacyAssessmentSchema)),
|
|
6832
|
-
judgments: array(entrySchema(judgmentSchema))
|
|
6833
|
-
policy:
|
|
6082
|
+
judgments: optional(array(entrySchema(judgmentSchema))),
|
|
6083
|
+
policy: nullable(policySchema),
|
|
6834
6084
|
policyChanges: array(policyChangeSchema),
|
|
6835
6085
|
candidates: array(candidateSchema),
|
|
6836
6086
|
evidence: array(entrySchema(evidenceSchema)),
|
|
6837
6087
|
decisions: array(entrySchema(decisionSchema)),
|
|
6838
6088
|
findings: array(entrySchema(findingSchema)),
|
|
6839
6089
|
workers: array(entrySchema(workerSchema)),
|
|
6840
|
-
critical: array(nonEmpty)
|
|
6841
|
-
})
|
|
6090
|
+
critical: optional(array(nonEmpty))
|
|
6091
|
+
});
|
|
6842
6092
|
var stripCount = (strips) => strips.reduce((sum, strip) => sum + strip.keys.length, 0);
|
|
6843
6093
|
var strippable = (issues, prefix = []) => {
|
|
6844
6094
|
const strips = [];
|
|
@@ -6892,117 +6142,224 @@ var parseStoredRecord = (schema, value) => {
|
|
|
6892
6142
|
return { ...first, critical };
|
|
6893
6143
|
return { success: true, data: parsed.data, stripped: [...new Set(stripped)] };
|
|
6894
6144
|
};
|
|
6895
|
-
var workspaceRecordSchema =
|
|
6145
|
+
var workspaceRecordSchema = strictObject({
|
|
6896
6146
|
schemaVersion: literal(1),
|
|
6897
6147
|
id,
|
|
6898
6148
|
revision,
|
|
6899
6149
|
root: nonEmpty,
|
|
6900
|
-
runtime:
|
|
6901
|
-
critical: array(nonEmpty)
|
|
6902
|
-
})
|
|
6903
|
-
var capabilitySchema =
|
|
6150
|
+
runtime: optional(runtimeSchema),
|
|
6151
|
+
critical: optional(array(nonEmpty))
|
|
6152
|
+
});
|
|
6153
|
+
var capabilitySchema = strictObject({
|
|
6904
6154
|
name: nonEmpty,
|
|
6905
6155
|
surface: nonEmpty,
|
|
6906
6156
|
assurance: assuranceSchema,
|
|
6907
6157
|
reason: text,
|
|
6908
6158
|
refs: array(refSchema)
|
|
6909
|
-
})
|
|
6910
|
-
var requirementEvaluationSchema =
|
|
6159
|
+
});
|
|
6160
|
+
var requirementEvaluationSchema = strictObject({
|
|
6911
6161
|
requirementId: digest,
|
|
6912
6162
|
status: _enum(["satisfied", "unsatisfied", "accepted_limitation", "unavailable"]),
|
|
6913
6163
|
evidenceIds: array(id),
|
|
6914
6164
|
decisionIds: array(id),
|
|
6915
6165
|
reason: text
|
|
6916
|
-
})
|
|
6917
|
-
var taskViewSchema =
|
|
6166
|
+
});
|
|
6167
|
+
var taskViewSchema = strictObject({
|
|
6918
6168
|
task: taskRecordSchema,
|
|
6919
6169
|
workspace: workspaceRecordSchema,
|
|
6920
6170
|
capabilities: array(capabilitySchema),
|
|
6921
6171
|
requirements: array(requirementEvaluationSchema),
|
|
6922
6172
|
evidence: array(evidenceEvaluationSchema)
|
|
6923
|
-
})
|
|
6924
|
-
var taskSummarySchema =
|
|
6173
|
+
});
|
|
6174
|
+
var taskSummarySchema = strictObject({
|
|
6925
6175
|
id,
|
|
6926
6176
|
revision,
|
|
6927
6177
|
workspaceRevision: revision,
|
|
6928
6178
|
createdAt: utc,
|
|
6929
6179
|
updatedAt: utc,
|
|
6930
|
-
runtime:
|
|
6180
|
+
runtime: nullable(runtimeSchema),
|
|
6931
6181
|
objective: text,
|
|
6932
6182
|
status: _enum(["active", "paused", "closed"]),
|
|
6933
|
-
closure:
|
|
6183
|
+
closure: nullable(closureSchema),
|
|
6934
6184
|
progress: progressSchema,
|
|
6935
|
-
policy:
|
|
6185
|
+
policy: nullable(policySchema),
|
|
6936
6186
|
requirements: array(requirementEvaluationSchema)
|
|
6937
|
-
})
|
|
6938
|
-
var taskListItemSchema = taskSummarySchema
|
|
6939
|
-
var exportBundleSchema =
|
|
6187
|
+
});
|
|
6188
|
+
var taskListItemSchema = extend2(omit2(taskSummarySchema, { policy: true, requirements: true }), { source: pick2(provenanceSchema, { host: true, kind: true }) });
|
|
6189
|
+
var exportBundleSchema = strictObject({
|
|
6940
6190
|
schemaVersion: literal(1),
|
|
6941
6191
|
exportedAt: utc,
|
|
6942
6192
|
sourceWorkspaceId: id,
|
|
6943
6193
|
task: taskRecordSchema,
|
|
6944
6194
|
digest
|
|
6945
|
-
})
|
|
6946
|
-
var callerSchema =
|
|
6195
|
+
});
|
|
6196
|
+
var callerSchema = strictObject({ host: hostSchema, actor: text });
|
|
6197
|
+
var success = (revisionValue, workspaceRevisionValue, data) => ({
|
|
6198
|
+
ok: true,
|
|
6199
|
+
schemaVersion: 1,
|
|
6200
|
+
revision: revisionValue,
|
|
6201
|
+
workspaceRevision: workspaceRevisionValue,
|
|
6202
|
+
data
|
|
6203
|
+
});
|
|
6204
|
+
var failure2 = (code, error, details = {}) => ({ ok: false, schemaVersion: 1, code, error, details });
|
|
6205
|
+
function resolveIdRef(kind, ref, ids) {
|
|
6206
|
+
if (ids.includes(ref))
|
|
6207
|
+
return success(null, null, ref);
|
|
6208
|
+
const matches = ids.filter((candidate) => candidate.startsWith(ref));
|
|
6209
|
+
if (matches.length === 1)
|
|
6210
|
+
return success(null, null, matches[0]);
|
|
6211
|
+
if (matches.length === 0)
|
|
6212
|
+
return failure2("not_found", `${kind} not found`);
|
|
6213
|
+
return failure2("invalid_input", `${kind} prefix ${ref} is ambiguous; candidates: ${matches.join(", ")}`);
|
|
6214
|
+
}
|
|
6215
|
+
function canonical(value, seen) {
|
|
6216
|
+
if (value === null || typeof value === "boolean" || typeof value === "string") {
|
|
6217
|
+
if (typeof value === "string" && invalidUnicode(value))
|
|
6218
|
+
throw new TypeError("invalid Unicode");
|
|
6219
|
+
return value;
|
|
6220
|
+
}
|
|
6221
|
+
if (typeof value === "number") {
|
|
6222
|
+
if (!Number.isSafeInteger(value))
|
|
6223
|
+
throw new TypeError("number must be a finite safe integer");
|
|
6224
|
+
return value;
|
|
6225
|
+
}
|
|
6226
|
+
if (typeof value !== "object")
|
|
6227
|
+
throw new TypeError("value is not JSON serializable");
|
|
6228
|
+
if (seen.has(value))
|
|
6229
|
+
throw new TypeError("cyclic value");
|
|
6230
|
+
seen.add(value);
|
|
6231
|
+
let result;
|
|
6232
|
+
if (Array.isArray(value)) {
|
|
6233
|
+
for (let index = 0;index < value.length; index += 1) {
|
|
6234
|
+
if (!(index in value))
|
|
6235
|
+
throw new TypeError("sparse array");
|
|
6236
|
+
}
|
|
6237
|
+
result = value.map((item) => canonical(item, seen));
|
|
6238
|
+
} else {
|
|
6239
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)
|
|
6240
|
+
throw new TypeError("value is not a JSON object");
|
|
6241
|
+
if (Reflect.ownKeys(value).some((key) => typeof key !== "string"))
|
|
6242
|
+
throw new TypeError("symbol key is not JSON");
|
|
6243
|
+
if (Object.keys(value).some((key) => invalidUnicode(key)))
|
|
6244
|
+
throw new TypeError("invalid Unicode");
|
|
6245
|
+
result = Object.fromEntries(Object.keys(value).toSorted().map((key) => [key, canonical(value[key], seen)]));
|
|
6246
|
+
}
|
|
6247
|
+
seen.delete(value);
|
|
6248
|
+
return result;
|
|
6249
|
+
}
|
|
6250
|
+
function canonicalJson(value) {
|
|
6251
|
+
return JSON.stringify(canonical(value, new Set));
|
|
6252
|
+
}
|
|
6253
|
+
function sha256(value) {
|
|
6254
|
+
if (typeof value === "string" && invalidUnicode(value))
|
|
6255
|
+
throw new TypeError("invalid Unicode");
|
|
6256
|
+
return createHash3("sha256").update(typeof value === "string" ? value : canonicalJson(value), "utf8").digest("hex");
|
|
6257
|
+
}
|
|
6258
|
+
function newId() {
|
|
6259
|
+
return randomUUID().toLowerCase();
|
|
6260
|
+
}
|
|
6261
|
+
function newRevision() {
|
|
6262
|
+
return randomUUID().toLowerCase();
|
|
6263
|
+
}
|
|
6264
|
+
var compareCodeUnits = (left, right) => {
|
|
6265
|
+
const length = Math.min(left.length, right.length);
|
|
6266
|
+
for (let index = 0;index < length; index += 1) {
|
|
6267
|
+
const difference = left.charCodeAt(index) - right.charCodeAt(index);
|
|
6268
|
+
if (difference !== 0)
|
|
6269
|
+
return difference;
|
|
6270
|
+
}
|
|
6271
|
+
return left.length - right.length;
|
|
6272
|
+
};
|
|
6273
|
+
var compareNullableText = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : compareCodeUnits(left, right);
|
|
6274
|
+
var compareBooleanNullable = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : Number(left) - Number(right);
|
|
6275
|
+
function decisionDigest(input) {
|
|
6276
|
+
const { digest: _ignored, revoked: _revoked, ...value } = input;
|
|
6277
|
+
return sha256(value);
|
|
6278
|
+
}
|
|
6279
|
+
function candidateDigest(input) {
|
|
6280
|
+
const normalizedScope = {
|
|
6281
|
+
description: input.scope.description,
|
|
6282
|
+
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
6283
|
+
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
6284
|
+
};
|
|
6285
|
+
return sha256({
|
|
6286
|
+
scope: normalizedScope,
|
|
6287
|
+
completeness: input.completeness,
|
|
6288
|
+
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)),
|
|
6289
|
+
environment: input.environment.map(({ name, value }) => ({ name, value })).toSorted((left, right) => compareCodeUnits(left.name, right.name) || compareNullableText(left.value, right.value)),
|
|
6290
|
+
head: input.head
|
|
6291
|
+
});
|
|
6292
|
+
}
|
|
6293
|
+
function requirementId(input) {
|
|
6294
|
+
return sha256({
|
|
6295
|
+
...input,
|
|
6296
|
+
scope: {
|
|
6297
|
+
description: input.scope.description,
|
|
6298
|
+
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
6299
|
+
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
6300
|
+
}
|
|
6301
|
+
});
|
|
6302
|
+
}
|
|
6303
|
+
// packages/workit-core/src/core/operations.ts
|
|
6947
6304
|
var base = { schemaVersion: literal(1) };
|
|
6948
6305
|
var revisions = {
|
|
6949
|
-
expectedRevision:
|
|
6950
|
-
expectedWorkspaceRevision:
|
|
6306
|
+
expectedRevision: optional(revision),
|
|
6307
|
+
expectedWorkspaceRevision: optional(revision)
|
|
6951
6308
|
};
|
|
6952
6309
|
var taskId = { taskId: id };
|
|
6953
|
-
var operation = (shape) =>
|
|
6310
|
+
var operation = (shape) => strictObject({ ...base, ...shape });
|
|
6954
6311
|
var taskOperations = {
|
|
6955
6312
|
start: operation({
|
|
6956
6313
|
action: literal("start"),
|
|
6957
|
-
expectedWorkspaceRevision:
|
|
6314
|
+
expectedWorkspaceRevision: optional(nullable(revision)),
|
|
6958
6315
|
intent: intentSchema
|
|
6959
6316
|
}),
|
|
6960
6317
|
list: operation({
|
|
6961
6318
|
action: literal("list"),
|
|
6962
|
-
status: _enum(["open", "closed", "all"])
|
|
6963
|
-
query: string2().
|
|
6964
|
-
limit: number2().int().
|
|
6319
|
+
status: optional(_enum(["open", "closed", "all"])),
|
|
6320
|
+
query: optional(string2().check(_trim()).check(_minLength(1)).check(_maxLength(200))),
|
|
6321
|
+
limit: optional(number2().check(int()).check(_gte(1)).check(_lte(50)))
|
|
6965
6322
|
}),
|
|
6966
6323
|
inspect: operation({
|
|
6967
6324
|
action: literal("inspect"),
|
|
6968
6325
|
...taskId,
|
|
6969
|
-
view: _enum(["summary", "full"])
|
|
6326
|
+
view: optional(_enum(["summary", "full"]))
|
|
6970
6327
|
}),
|
|
6971
6328
|
revise: operation({
|
|
6972
6329
|
action: literal("revise"),
|
|
6973
6330
|
...taskId,
|
|
6974
6331
|
...revisions,
|
|
6975
|
-
expectedWorkspaceRevision:
|
|
6332
|
+
expectedWorkspaceRevision: optional(revision),
|
|
6976
6333
|
intent: intentSchema,
|
|
6977
6334
|
reason: text
|
|
6978
6335
|
}),
|
|
6979
6336
|
progress: operation({
|
|
6980
6337
|
action: literal("progress"),
|
|
6981
6338
|
...taskId,
|
|
6982
|
-
expectedRevision:
|
|
6339
|
+
expectedRevision: optional(revision),
|
|
6983
6340
|
progress: progressSchema
|
|
6984
6341
|
}),
|
|
6985
6342
|
pause: operation({
|
|
6986
6343
|
action: literal("pause"),
|
|
6987
6344
|
...taskId,
|
|
6988
6345
|
...revisions,
|
|
6989
|
-
expectedWorkspaceRevision:
|
|
6346
|
+
expectedWorkspaceRevision: optional(revision),
|
|
6990
6347
|
reason: text
|
|
6991
6348
|
}),
|
|
6992
6349
|
resume: operation({
|
|
6993
6350
|
action: literal("resume"),
|
|
6994
6351
|
...taskId,
|
|
6995
6352
|
...revisions,
|
|
6996
|
-
expectedWorkspaceRevision:
|
|
6353
|
+
expectedWorkspaceRevision: optional(revision)
|
|
6997
6354
|
}),
|
|
6998
6355
|
close: operation({
|
|
6999
6356
|
action: literal("close"),
|
|
7000
6357
|
...taskId,
|
|
7001
6358
|
...revisions,
|
|
7002
|
-
expectedWorkspaceRevision:
|
|
6359
|
+
expectedWorkspaceRevision: optional(revision),
|
|
7003
6360
|
outcome: outcomeSchema,
|
|
7004
6361
|
summary: text,
|
|
7005
|
-
decisionIds: array(id)
|
|
6362
|
+
decisionIds: optional(array(id))
|
|
7006
6363
|
})
|
|
7007
6364
|
};
|
|
7008
6365
|
var rawJudgment = record(string2(), unknown());
|
|
@@ -7010,7 +6367,7 @@ var policyOperations = {
|
|
|
7010
6367
|
assess: operation({
|
|
7011
6368
|
action: literal("assess"),
|
|
7012
6369
|
...taskId,
|
|
7013
|
-
expectedRevision:
|
|
6370
|
+
expectedRevision: optional(revision),
|
|
7014
6371
|
judgment: rawJudgment
|
|
7015
6372
|
}),
|
|
7016
6373
|
preview: operation({ action: literal("preview"), ...taskId, judgment: rawJudgment }),
|
|
@@ -7020,7 +6377,7 @@ var evidenceOperations = {
|
|
|
7020
6377
|
record: operation({
|
|
7021
6378
|
action: literal("record"),
|
|
7022
6379
|
...taskId,
|
|
7023
|
-
expectedRevision:
|
|
6380
|
+
expectedRevision: optional(revision),
|
|
7024
6381
|
evidence: reportedEvidenceSchema
|
|
7025
6382
|
})
|
|
7026
6383
|
};
|
|
@@ -7028,17 +6385,17 @@ var findingOperations = {
|
|
|
7028
6385
|
record: operation({
|
|
7029
6386
|
action: literal("record"),
|
|
7030
6387
|
...taskId,
|
|
7031
|
-
expectedRevision:
|
|
6388
|
+
expectedRevision: optional(revision),
|
|
7032
6389
|
claim: text,
|
|
7033
6390
|
consequence: text,
|
|
7034
6391
|
scope: scopeSchema,
|
|
7035
|
-
candidateId:
|
|
6392
|
+
candidateId: optional(nullableDigest),
|
|
7036
6393
|
refs: array(refSchema)
|
|
7037
6394
|
}),
|
|
7038
6395
|
resolve: operation({
|
|
7039
6396
|
action: literal("resolve"),
|
|
7040
6397
|
...taskId,
|
|
7041
|
-
expectedRevision:
|
|
6398
|
+
expectedRevision: optional(revision),
|
|
7042
6399
|
findingId: idRef,
|
|
7043
6400
|
disposition: _enum(["open", "fixed", "dismissed", "deferred"]),
|
|
7044
6401
|
reason: text,
|
|
@@ -7050,11 +6407,11 @@ var decisionOperations = {
|
|
|
7050
6407
|
record: operation({
|
|
7051
6408
|
action: literal("record"),
|
|
7052
6409
|
...taskId,
|
|
7053
|
-
expectedRevision:
|
|
6410
|
+
expectedRevision: optional(revision),
|
|
7054
6411
|
purpose: decisionSchema.shape.purpose,
|
|
7055
|
-
binding: decisionSchema.shape.binding
|
|
7056
|
-
taskId:
|
|
7057
|
-
workspaceId:
|
|
6412
|
+
binding: extend2(decisionSchema.shape.binding, {
|
|
6413
|
+
taskId: optional(id),
|
|
6414
|
+
workspaceId: optional(id)
|
|
7058
6415
|
}),
|
|
7059
6416
|
response: decisionSchema.shape.response,
|
|
7060
6417
|
requirementIds: array(digest)
|
|
@@ -7062,7 +6419,7 @@ var decisionOperations = {
|
|
|
7062
6419
|
revoke: operation({
|
|
7063
6420
|
action: literal("revoke"),
|
|
7064
6421
|
...taskId,
|
|
7065
|
-
expectedRevision:
|
|
6422
|
+
expectedRevision: optional(revision),
|
|
7066
6423
|
decisionId: id,
|
|
7067
6424
|
reason: text
|
|
7068
6425
|
})
|
|
@@ -7072,14 +6429,14 @@ var workerOperations = {
|
|
|
7072
6429
|
action: literal("assign"),
|
|
7073
6430
|
...taskId,
|
|
7074
6431
|
...revisions,
|
|
7075
|
-
expectedWorkspaceRevision:
|
|
6432
|
+
expectedWorkspaceRevision: optional(revision),
|
|
7076
6433
|
assignment: assignmentSchema
|
|
7077
6434
|
}),
|
|
7078
6435
|
report: operation({
|
|
7079
6436
|
action: literal("report"),
|
|
7080
6437
|
...taskId,
|
|
7081
|
-
expectedRevision:
|
|
7082
|
-
expectedWorkspaceRevision:
|
|
6438
|
+
expectedRevision: optional(revision),
|
|
6439
|
+
expectedWorkspaceRevision: optional(revision),
|
|
7083
6440
|
workerId: idRef,
|
|
7084
6441
|
report: workerReportSchema
|
|
7085
6442
|
}),
|
|
@@ -7087,7 +6444,7 @@ var workerOperations = {
|
|
|
7087
6444
|
action: literal("cancel"),
|
|
7088
6445
|
...taskId,
|
|
7089
6446
|
...revisions,
|
|
7090
|
-
expectedWorkspaceRevision:
|
|
6447
|
+
expectedWorkspaceRevision: optional(revision),
|
|
7091
6448
|
workerId: idRef,
|
|
7092
6449
|
reason: text
|
|
7093
6450
|
})
|
|
@@ -7096,7 +6453,7 @@ var stateOperations = {
|
|
|
7096
6453
|
export: operation({ action: literal("export"), ...taskId }),
|
|
7097
6454
|
import: operation({
|
|
7098
6455
|
action: literal("import"),
|
|
7099
|
-
expectedWorkspaceRevision:
|
|
6456
|
+
expectedWorkspaceRevision: optional(nullable(revision)),
|
|
7100
6457
|
bundle: exportBundleSchema
|
|
7101
6458
|
})
|
|
7102
6459
|
};
|
|
@@ -7118,7 +6475,7 @@ var OPERATION_ACTIONS = {
|
|
|
7118
6475
|
worker: Object.keys(workerOperations),
|
|
7119
6476
|
state: Object.keys(stateOperations)
|
|
7120
6477
|
};
|
|
7121
|
-
var withImplicitTask = (options) => Object.values(options).map((option) => ("taskId" in option.shape) ? option
|
|
6478
|
+
var withImplicitTask = (options) => Object.values(options).map((option) => ("taskId" in option.shape) ? extend2(option, { taskId: optional(id) }) : option);
|
|
7122
6479
|
var advertised = (options) => discriminatedUnion("action", withImplicitTask(options));
|
|
7123
6480
|
var advertisedOperationSchemas = {
|
|
7124
6481
|
task: advertised(taskOperations),
|
|
@@ -7129,24 +6486,6 @@ var advertisedOperationSchemas = {
|
|
|
7129
6486
|
worker: advertised(workerOperations),
|
|
7130
6487
|
state: advertised(stateOperations)
|
|
7131
6488
|
};
|
|
7132
|
-
var success = (revisionValue, workspaceRevisionValue, data) => ({
|
|
7133
|
-
ok: true,
|
|
7134
|
-
schemaVersion: 1,
|
|
7135
|
-
revision: revisionValue,
|
|
7136
|
-
workspaceRevision: workspaceRevisionValue,
|
|
7137
|
-
data
|
|
7138
|
-
});
|
|
7139
|
-
var failure2 = (code, error, details = {}) => ({ ok: false, schemaVersion: 1, code, error, details });
|
|
7140
|
-
function resolveIdRef(kind, ref, ids) {
|
|
7141
|
-
if (ids.includes(ref))
|
|
7142
|
-
return success(null, null, ref);
|
|
7143
|
-
const matches = ids.filter((candidate) => candidate.startsWith(ref));
|
|
7144
|
-
if (matches.length === 1)
|
|
7145
|
-
return success(null, null, matches[0]);
|
|
7146
|
-
if (matches.length === 0)
|
|
7147
|
-
return failure2("not_found", `${kind} not found`);
|
|
7148
|
-
return failure2("invalid_input", `${kind} prefix ${ref} is ambiguous; candidates: ${matches.join(", ")}`);
|
|
7149
|
-
}
|
|
7150
6489
|
function parseOperation(family, input) {
|
|
7151
6490
|
if (typeof input === "object" && input !== null && "schemaVersion" in input && input.schemaVersion !== SCHEMA_VERSION)
|
|
7152
6491
|
return failure2("unsupported_version", "unsupported schema version", { operation: family });
|
|
@@ -7159,125 +6498,37 @@ function parseOperation(family, input) {
|
|
|
7159
6498
|
}));
|
|
7160
6499
|
return failure2("invalid_input", "operation input is invalid", { fields });
|
|
7161
6500
|
}
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
}
|
|
7194
|
-
seen.delete(value);
|
|
7195
|
-
return result;
|
|
7196
|
-
}
|
|
7197
|
-
function canonicalJson(value) {
|
|
7198
|
-
return JSON.stringify(canonical(value, new Set));
|
|
7199
|
-
}
|
|
7200
|
-
function sha256(value) {
|
|
7201
|
-
if (typeof value === "string" && invalidUnicode(value))
|
|
7202
|
-
throw new TypeError("invalid Unicode");
|
|
7203
|
-
return createHash3("sha256").update(typeof value === "string" ? value : canonicalJson(value), "utf8").digest("hex");
|
|
7204
|
-
}
|
|
7205
|
-
function newId() {
|
|
7206
|
-
return randomUUID().toLowerCase();
|
|
7207
|
-
}
|
|
7208
|
-
function newRevision() {
|
|
7209
|
-
return randomUUID().toLowerCase();
|
|
7210
|
-
}
|
|
7211
|
-
var compareCodeUnits = (left, right) => {
|
|
7212
|
-
const length = Math.min(left.length, right.length);
|
|
7213
|
-
for (let index = 0;index < length; index += 1) {
|
|
7214
|
-
const difference = left.charCodeAt(index) - right.charCodeAt(index);
|
|
7215
|
-
if (difference !== 0)
|
|
7216
|
-
return difference;
|
|
7217
|
-
}
|
|
7218
|
-
return left.length - right.length;
|
|
7219
|
-
};
|
|
7220
|
-
var compareNullableText = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : compareCodeUnits(left, right);
|
|
7221
|
-
var compareBooleanNullable = (left, right) => left === right ? 0 : left === null ? -1 : right === null ? 1 : Number(left) - Number(right);
|
|
7222
|
-
function decisionDigest(input) {
|
|
7223
|
-
const { digest: _ignored, revoked: _revoked, ...value } = input;
|
|
7224
|
-
return sha256(value);
|
|
7225
|
-
}
|
|
7226
|
-
function candidateDigest(input) {
|
|
7227
|
-
const normalizedScope = {
|
|
7228
|
-
description: input.scope.description,
|
|
7229
|
-
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
7230
|
-
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
7231
|
-
};
|
|
7232
|
-
return sha256({
|
|
7233
|
-
scope: normalizedScope,
|
|
7234
|
-
completeness: input.completeness,
|
|
7235
|
-
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)),
|
|
7236
|
-
environment: input.environment.map(({ name, value }) => ({ name, value })).toSorted((left, right) => compareCodeUnits(left.name, right.name) || compareNullableText(left.value, right.value)),
|
|
7237
|
-
head: input.head
|
|
7238
|
-
});
|
|
7239
|
-
}
|
|
7240
|
-
function requirementId(input) {
|
|
7241
|
-
return sha256({
|
|
7242
|
-
...input,
|
|
7243
|
-
scope: {
|
|
7244
|
-
description: input.scope.description,
|
|
7245
|
-
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
7246
|
-
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits)
|
|
7247
|
-
}
|
|
7248
|
-
});
|
|
7249
|
-
}
|
|
7250
|
-
// packages/workit-core/src/core/operation-input.ts
|
|
7251
|
-
var str = (d, values) => ({
|
|
7252
|
-
type: "string",
|
|
7253
|
-
...values ? { enum: values } : {},
|
|
7254
|
-
...d ? { d } : {}
|
|
7255
|
-
});
|
|
7256
|
-
var list = (d) => ({ type: "array", ...d ? { d } : {} });
|
|
7257
|
-
var bool = (d) => ({ type: "boolean", ...d ? { d } : {} });
|
|
7258
|
-
var int2 = (d) => ({ type: "integer", ...d ? { d } : {} });
|
|
7259
|
-
var scopeFields = {
|
|
7260
|
-
paths: list("Scope paths (default: whole checkout)."),
|
|
7261
|
-
exclusions: list(),
|
|
7262
|
-
scope: str("Scope description.")
|
|
7263
|
-
};
|
|
7264
|
-
var refs = list("Paths or URLs.");
|
|
7265
|
-
var FLAT = {
|
|
7266
|
-
task: {
|
|
7267
|
-
fields: {
|
|
7268
|
-
objective: str(),
|
|
7269
|
-
...scopeFields,
|
|
7270
|
-
refs,
|
|
7271
|
-
reason: str(),
|
|
7272
|
-
summary: str(),
|
|
7273
|
-
nextAction: str(),
|
|
7274
|
-
blockers: list(),
|
|
7275
|
-
outcome: str(undefined, ["verified", "accepted_limitations", "stopped"]),
|
|
7276
|
-
decisionIds: list(),
|
|
7277
|
-
status: str(undefined, ["open", "closed", "all"]),
|
|
7278
|
-
query: str(),
|
|
7279
|
-
limit: int2(),
|
|
7280
|
-
view: str(undefined, ["summary", "full"])
|
|
6501
|
+
// packages/workit-core/src/core/operation-input.ts
|
|
6502
|
+
var str = (d, values) => ({
|
|
6503
|
+
type: "string",
|
|
6504
|
+
...values ? { enum: values } : {},
|
|
6505
|
+
...d ? { d } : {}
|
|
6506
|
+
});
|
|
6507
|
+
var list = (d) => ({ type: "array", ...d ? { d } : {} });
|
|
6508
|
+
var bool = (d) => ({ type: "boolean", ...d ? { d } : {} });
|
|
6509
|
+
var int2 = (d) => ({ type: "integer", ...d ? { d } : {} });
|
|
6510
|
+
var scopeFields = {
|
|
6511
|
+
paths: list("Scope paths (default: whole checkout)."),
|
|
6512
|
+
exclusions: list(),
|
|
6513
|
+
scope: str("Scope description.")
|
|
6514
|
+
};
|
|
6515
|
+
var refs = list("Paths or URLs.");
|
|
6516
|
+
var FLAT = {
|
|
6517
|
+
task: {
|
|
6518
|
+
fields: {
|
|
6519
|
+
objective: str(),
|
|
6520
|
+
...scopeFields,
|
|
6521
|
+
refs,
|
|
6522
|
+
reason: str(),
|
|
6523
|
+
summary: str(),
|
|
6524
|
+
nextAction: str(),
|
|
6525
|
+
blockers: list(),
|
|
6526
|
+
outcome: str(undefined, ["verified", "accepted_limitations", "stopped"]),
|
|
6527
|
+
decisionIds: list(),
|
|
6528
|
+
status: str(undefined, ["open", "closed", "all"]),
|
|
6529
|
+
query: str(),
|
|
6530
|
+
limit: int2(),
|
|
6531
|
+
view: str(undefined, ["summary", "full"])
|
|
7281
6532
|
}
|
|
7282
6533
|
},
|
|
7283
6534
|
policy: {
|
|
@@ -7645,7 +6896,7 @@ var FLAT_NAME = {
|
|
|
7645
6896
|
};
|
|
7646
6897
|
var NOT_FLAT = new Set(["schemaVersion", "action", "workspaceId"]);
|
|
7647
6898
|
function actionKeys(family, action) {
|
|
7648
|
-
const options = advertisedOperationSchemas[family].options;
|
|
6899
|
+
const options = advertisedOperationSchemas[family]._zod.def.options;
|
|
7649
6900
|
const option = options.find((item) => {
|
|
7650
6901
|
const literal = defOf(item).shape?.action;
|
|
7651
6902
|
return literal._zod.def.values.includes(action);
|
|
@@ -9452,59 +8703,57 @@ var pushTarget = (cwd, remote, replay = {}) => {
|
|
|
9452
8703
|
};
|
|
9453
8704
|
|
|
9454
8705
|
// packages/workit-core/src/core/workspaces.ts
|
|
9455
|
-
var nonBlank = string2().refine((value) => value.trim().length > 0, "must not be blank");
|
|
8706
|
+
var nonBlank = string2().check(refine((value) => value.trim().length > 0, "must not be blank"));
|
|
9456
8707
|
var branchPreset = custom((value) => typeof value === "string" && Object.hasOwn(PRESETS, value), "unsupported branch preset");
|
|
9457
8708
|
var commitPreset = custom((value) => typeof value === "string" && COMMIT_PRESETS.includes(value), "unsupported commit preset");
|
|
9458
|
-
var workspaceBranchPolicySchema =
|
|
9459
|
-
preset: branchPreset
|
|
9460
|
-
developBranch:
|
|
9461
|
-
prefixes:
|
|
8709
|
+
var workspaceBranchPolicySchema = strictObject({
|
|
8710
|
+
preset: described(branchPreset, "The branch model: gitflow, github-flow, trunk-based or custom (allowed/protected set by hand)."),
|
|
8711
|
+
developBranch: described(optional(nonBlank), "The integration branch gitflow uses (default develop)."),
|
|
8712
|
+
prefixes: described(optional(looseObject({
|
|
9462
8713
|
feature: nonBlank,
|
|
9463
8714
|
bugfix: nonBlank,
|
|
9464
8715
|
release: nonBlank,
|
|
9465
8716
|
hotfix: nonBlank
|
|
9466
|
-
})
|
|
9467
|
-
allowed: array(nonBlank)
|
|
9468
|
-
protected: array(nonBlank)
|
|
9469
|
-
integration: _enum(["pr", "merge"])
|
|
9470
|
-
}).strict();
|
|
9471
|
-
var workspaceCommitPolicySchema = object({
|
|
9472
|
-
preset: commitPreset.describe("The commit message flavor, e.g. conventional."),
|
|
9473
|
-
pattern: string2().optional().describe("A regular expression every commit subject must match.")
|
|
9474
|
-
}).strict();
|
|
9475
|
-
var workspaceProfileSchema = object({
|
|
9476
|
-
branchPolicy: workspaceBranchPolicySchema.optional().describe("This profile's branch policy."),
|
|
9477
|
-
commitPolicy: workspaceCommitPolicySchema.optional().describe("This profile's commit policy.")
|
|
9478
|
-
}).strict().refine((profile) => profile.branchPolicy !== undefined || profile.commitPolicy !== undefined, {
|
|
9479
|
-
message: "a profile must define branchPolicy or commitPolicy"
|
|
8717
|
+
})), "The branch prefix per kind (feature/, bugfix/, release/, hotfix/)."),
|
|
8718
|
+
allowed: described(optional(array(nonBlank)), "Branch name globs a new branch must match (`feature/*`)."),
|
|
8719
|
+
protected: described(optional(array(nonBlank)), "Branches nobody commits or pushes to directly."),
|
|
8720
|
+
integration: described(optional(_enum(["pr", "merge"])), "How work reaches its base: `pr` (default) opens a PR, `merge` merges locally.")
|
|
9480
8721
|
});
|
|
8722
|
+
var workspaceCommitPolicySchema = strictObject({
|
|
8723
|
+
preset: described(commitPreset, "The commit message flavor, e.g. conventional."),
|
|
8724
|
+
pattern: described(optional(string2()), "A regular expression every commit subject must match.")
|
|
8725
|
+
});
|
|
8726
|
+
var workspaceProfileSchema = strictObject({
|
|
8727
|
+
branchPolicy: described(optional(workspaceBranchPolicySchema), "This profile's branch policy."),
|
|
8728
|
+
commitPolicy: described(optional(workspaceCommitPolicySchema), "This profile's commit policy.")
|
|
8729
|
+
}).check(refine((profile) => profile.branchPolicy !== undefined || profile.commitPolicy !== undefined, { message: "a profile must define branchPolicy or commitPolicy" }));
|
|
9481
8730
|
var versionSourceSchema = discriminatedUnion("kind", [
|
|
9482
|
-
|
|
8731
|
+
strictObject({
|
|
9483
8732
|
kind: literal("package-json"),
|
|
9484
8733
|
path: nonBlank,
|
|
9485
8734
|
field: nonBlank
|
|
9486
|
-
})
|
|
9487
|
-
|
|
9488
|
-
|
|
8735
|
+
}),
|
|
8736
|
+
strictObject({ kind: literal("git-tag") }),
|
|
8737
|
+
strictObject({ kind: literal("manual") })
|
|
9489
8738
|
]);
|
|
9490
|
-
var releaseTrackSchema =
|
|
9491
|
-
strategy:
|
|
9492
|
-
productionBranch: nonBlank
|
|
9493
|
-
integrationBranch: nonBlank
|
|
9494
|
-
naming:
|
|
9495
|
-
feature:
|
|
9496
|
-
release:
|
|
9497
|
-
hotfix:
|
|
9498
|
-
})
|
|
9499
|
-
baseBranch:
|
|
9500
|
-
mergeBackBranches: array(nonBlank)
|
|
9501
|
-
pullRequestTarget:
|
|
9502
|
-
tagNamespace:
|
|
9503
|
-
versionSource:
|
|
9504
|
-
requiredChecks: array(nonBlank)
|
|
9505
|
-
critical: array(nonBlank)
|
|
9506
|
-
releaseNotes:
|
|
9507
|
-
}).
|
|
8739
|
+
var releaseTrackSchema = looseObject({
|
|
8740
|
+
strategy: described(optional(branchPreset), "The branch model this track follows."),
|
|
8741
|
+
productionBranch: described(nonBlank, "The branch releases land on (main)."),
|
|
8742
|
+
integrationBranch: described(nonBlank, "The branch work integrates into (develop)."),
|
|
8743
|
+
naming: described(optional(looseObject({
|
|
8744
|
+
feature: optional(nonBlank),
|
|
8745
|
+
release: optional(nonBlank),
|
|
8746
|
+
hotfix: optional(nonBlank)
|
|
8747
|
+
})), "Branch name templates per kind, e.g. `feature/{name}`."),
|
|
8748
|
+
baseBranch: described(optional(nonBlank), "The branch new work starts from."),
|
|
8749
|
+
mergeBackBranches: described(optional(array(nonBlank)), "Branches a finished release or hotfix is merged back into."),
|
|
8750
|
+
pullRequestTarget: described(optional(nonBlank), "The branch PRs target."),
|
|
8751
|
+
tagNamespace: described(optional(string2()), "A prefix for this track's release tags."),
|
|
8752
|
+
versionSource: described(optional(versionSourceSchema), "Where the version comes from: package-json, git-tag or manual."),
|
|
8753
|
+
requiredChecks: described(optional(array(nonBlank)), "CI checks that must pass before a release."),
|
|
8754
|
+
critical: described(optional(array(nonBlank)), "Fields an older Workit must not ignore: when one is unknown or malformed, Workit fails closed."),
|
|
8755
|
+
releaseNotes: described(optional(unknown()), "This track's release notes mode, over the workspace's `releaseNotes`.")
|
|
8756
|
+
}).check(superRefine((track, context) => {
|
|
9508
8757
|
for (const [field, values] of [
|
|
9509
8758
|
["mergeBackBranches", track.mergeBackBranches ?? []],
|
|
9510
8759
|
["requiredChecks", track.requiredChecks ?? []]
|
|
@@ -9524,67 +8773,67 @@ var releaseTrackSchema = object({
|
|
|
9524
8773
|
message: "must stay inside the repository"
|
|
9525
8774
|
});
|
|
9526
8775
|
}
|
|
9527
|
-
});
|
|
9528
|
-
var modelRoles =
|
|
9529
|
-
var workspaceConfigSchema =
|
|
9530
|
-
name: nonBlank
|
|
9531
|
-
glob: nonBlank
|
|
9532
|
-
vcs:
|
|
9533
|
-
provider: _enum(["gitlab", "github"])
|
|
9534
|
-
defaultTargetBranch:
|
|
9535
|
-
tokenFile:
|
|
9536
|
-
account:
|
|
9537
|
-
host:
|
|
9538
|
-
})
|
|
9539
|
-
autoApprove: union([boolean2(), array(nonBlank)])
|
|
9540
|
-
defaultEndpoint:
|
|
9541
|
-
verification: _enum(["proportional", "self", "independent"])
|
|
9542
|
-
delegation:
|
|
9543
|
-
changelog:
|
|
9544
|
-
docs:
|
|
9545
|
-
changelogPath:
|
|
9546
|
-
prTemplate:
|
|
9547
|
-
releaseNotes:
|
|
9548
|
-
trailers:
|
|
9549
|
-
deleteBranch:
|
|
9550
|
-
cleanup:
|
|
9551
|
-
feedback:
|
|
9552
|
-
liveSessionGuard:
|
|
9553
|
-
fanout:
|
|
9554
|
-
tierModels:
|
|
9555
|
-
deps:
|
|
9556
|
-
installTimeout:
|
|
9557
|
-
})
|
|
9558
|
-
models:
|
|
9559
|
-
resources:
|
|
9560
|
-
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/*)"))
|
|
9561
|
-
externalRepos: array(nonBlank.
|
|
9562
|
-
autonomy:
|
|
8776
|
+
}));
|
|
8777
|
+
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).");
|
|
8778
|
+
var workspaceConfigSchema = looseObject({
|
|
8779
|
+
name: described(nonBlank, "The workspace's unique name."),
|
|
8780
|
+
glob: described(nonBlank, "The directories this entry covers, an absolute path glob with * and ** (`/home/you/work/**`); the narrowest match wins."),
|
|
8781
|
+
vcs: described(optional(looseObject({
|
|
8782
|
+
provider: described(_enum(["gitlab", "github"]), "The forge: github or gitlab."),
|
|
8783
|
+
defaultTargetBranch: described(optional(nonBlank), "The branch PRs target by default."),
|
|
8784
|
+
tokenFile: described(optional(nonBlank), "A file holding the forge token for this workspace."),
|
|
8785
|
+
account: described(optional(nonBlank), "The forge login delivery runs as; grants need it to reach the forge."),
|
|
8786
|
+
host: described(optional(unknown()), "A self-hosted forge's host name.")
|
|
8787
|
+
})), "The forge this workspace's repositories live on."),
|
|
8788
|
+
autoApprove: described(optional(union([boolean2(), array(nonBlank)])), "Legacy (≤4.x) standing approvals, read once as autonomy grants; use `autonomy`."),
|
|
8789
|
+
defaultEndpoint: described(optional(unknown()), "Where an unnamed request stops: commit (default), pr, green or merged. Set with `workit grant set`, like grants."),
|
|
8790
|
+
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."),
|
|
8791
|
+
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."),
|
|
8792
|
+
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."),
|
|
8793
|
+
docs: described(optional(unknown()), "The docs refresh the ship skill does before a PR opens: `off` (default) or `when-user-facing`."),
|
|
8794
|
+
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."),
|
|
8795
|
+
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."),
|
|
8796
|
+
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."),
|
|
8797
|
+
trailers: described(optional(boolean2()), "Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
|
|
8798
|
+
deleteBranch: described(optional(boolean2()), "Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
|
|
8799
|
+
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`."),
|
|
8800
|
+
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.'),
|
|
8801
|
+
liveSessionGuard: described(optional(boolean2()), "Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
8802
|
+
fanout: described(optional(looseObject({
|
|
8803
|
+
tierModels: described(optional(unknown()), "The model per slice TIER (mundane, standard, hard), as one name or per host."),
|
|
8804
|
+
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."),
|
|
8805
|
+
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.")
|
|
8806
|
+
})), "Fanout settings."),
|
|
8807
|
+
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."),
|
|
8808
|
+
resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
|
|
8809
|
+
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."),
|
|
8810
|
+
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."),
|
|
8811
|
+
autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
|
|
9563
8812
|
kind,
|
|
9564
|
-
union([boolean2(), literal("verified")])
|
|
9565
|
-
])))
|
|
9566
|
-
youtrack:
|
|
9567
|
-
baseUrl:
|
|
9568
|
-
link_issues:
|
|
9569
|
-
writes: _enum(["ask", "auto"])
|
|
9570
|
-
autoHosts: array(nonBlank)
|
|
9571
|
-
})
|
|
9572
|
-
issues:
|
|
9573
|
-
provider: _enum(["github", "gitlab", "youtrack"])
|
|
9574
|
-
link:
|
|
9575
|
-
relation:
|
|
9576
|
-
backlink:
|
|
9577
|
-
link_on_pr:
|
|
9578
|
-
repo:
|
|
9579
|
-
host:
|
|
9580
|
-
})
|
|
9581
|
-
branchPolicy:
|
|
9582
|
-
commitPolicy:
|
|
9583
|
-
defaultProfile:
|
|
9584
|
-
profiles: record(nonBlank, workspaceProfileSchema)
|
|
9585
|
-
releaseTracks: record(nonBlank, releaseTrackSchema)
|
|
9586
|
-
releasePackages:
|
|
9587
|
-
}).
|
|
8813
|
+
described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
|
|
8814
|
+
])))), "Autonomy grants (D15): only ever set here, by the user, with `workit grant set`."),
|
|
8815
|
+
youtrack: described(optional(looseObject({
|
|
8816
|
+
baseUrl: described(optional(nonBlank), "This workspace's YouTrack URL."),
|
|
8817
|
+
link_issues: described(optional(boolean2()), "Legacy alias of `issues: { provider: youtrack, link: true }`."),
|
|
8818
|
+
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."),
|
|
8819
|
+
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`).")
|
|
8820
|
+
})), "YouTrack settings for this workspace."),
|
|
8821
|
+
issues: described(optional(looseObject({
|
|
8822
|
+
provider: described(optional(_enum(["github", "gitlab", "youtrack"])), "The issue tracker PRs link to."),
|
|
8823
|
+
link: described(optional(boolean2()), "Derive the issue from the branch name."),
|
|
8824
|
+
relation: described(optional(unknown()), "How a PR names its issue: `closes` (default) or `refs`."),
|
|
8825
|
+
backlink: described(optional(boolean2()), "Post the PR URL on each linked issue after the PR is opened."),
|
|
8826
|
+
link_on_pr: described(optional(boolean2()), "Legacy alias of `link`."),
|
|
8827
|
+
repo: described(optional(unknown()), "The GitHub/GitLab repository (owner/name) that holds the issues; default the PR's own."),
|
|
8828
|
+
host: described(optional(unknown()), "That repository's host; default the PR's host, or the tracker's public one.")
|
|
8829
|
+
})), "The issue tracker PRs link to (any forge with any tracker)."),
|
|
8830
|
+
branchPolicy: described(optional(workspaceBranchPolicySchema), "Which branches may be created and which are protected."),
|
|
8831
|
+
commitPolicy: described(optional(workspaceCommitPolicySchema), "The commit message rules."),
|
|
8832
|
+
defaultProfile: described(optional(nonBlank), "The profile used when none is named; must be a key of `profiles`."),
|
|
8833
|
+
profiles: described(optional(record(nonBlank, workspaceProfileSchema)), "Named branch/commit policy variants of this workspace."),
|
|
8834
|
+
releaseTracks: described(optional(record(nonBlank, releaseTrackSchema)), "Named release tracks: production and integration branches, naming and versioning."),
|
|
8835
|
+
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.")
|
|
8836
|
+
}).check(superRefine((workspace, context) => {
|
|
9588
8837
|
if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
|
|
9589
8838
|
context.addIssue({
|
|
9590
8839
|
code: "custom",
|
|
@@ -9592,14 +8841,14 @@ var workspaceConfigSchema = object({
|
|
|
9592
8841
|
message: `does not name a configured profile`
|
|
9593
8842
|
});
|
|
9594
8843
|
}
|
|
9595
|
-
});
|
|
9596
|
-
var workspacesFileSchema =
|
|
9597
|
-
workspaces: array(workspaceConfigSchema)
|
|
9598
|
-
models:
|
|
9599
|
-
feedback:
|
|
9600
|
-
account:
|
|
9601
|
-
})
|
|
9602
|
-
}).
|
|
8844
|
+
}));
|
|
8845
|
+
var workspacesFileSchema = looseObject({
|
|
8846
|
+
workspaces: described(optional(array(workspaceConfigSchema)), "Workspace entries, each mapping a path glob to its forge, policies and grants."),
|
|
8847
|
+
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)."),
|
|
8848
|
+
feedback: described(optional(looseObject({
|
|
8849
|
+
account: described(optional(nonBlank), "The GitHub login `workit feedback --post` uses when no workspace names one; never the workspace's work account by default.")
|
|
8850
|
+
})), "`workit feedback` defaults for every workspace.")
|
|
8851
|
+
}).check(superRefine((file, context) => {
|
|
9603
8852
|
const names = new Set;
|
|
9604
8853
|
for (const [index, workspace] of (file.workspaces ?? []).entries()) {
|
|
9605
8854
|
if (names.has(workspace.name)) {
|
|
@@ -9611,7 +8860,7 @@ var workspacesFileSchema = object({
|
|
|
9611
8860
|
}
|
|
9612
8861
|
names.add(workspace.name);
|
|
9613
8862
|
}
|
|
9614
|
-
});
|
|
8863
|
+
}));
|
|
9615
8864
|
var workspacesPath = () => path9.join(configDir2(), "workspaces.json");
|
|
9616
8865
|
var workspacesRevision = (contents) => createHash6("sha256").update(contents ?? "<missing>").digest("hex");
|
|
9617
8866
|
var validateWorkspacesDocument = (parsed, file) => {
|
|
@@ -9957,25 +9206,25 @@ var resolveWorkspaceFrom = (cwd, dir, workspaceName) => {
|
|
|
9957
9206
|
};
|
|
9958
9207
|
var runtimeWorkspacePolicySchema = (kind) => {
|
|
9959
9208
|
const key = kind === "branch" ? "branchPolicy" : kind === "commit" ? "commitPolicy" : "vcs";
|
|
9960
|
-
const policySchema = kind === "branch" ? workspaceBranchPolicySchema : kind === "commit" ? workspaceCommitPolicySchema :
|
|
9209
|
+
const policySchema = kind === "branch" ? workspaceBranchPolicySchema : kind === "commit" ? workspaceCommitPolicySchema : looseObject({
|
|
9961
9210
|
provider: _enum(["gitlab", "github"]),
|
|
9962
|
-
defaultTargetBranch:
|
|
9963
|
-
account:
|
|
9964
|
-
})
|
|
9965
|
-
const profileSchema =
|
|
9966
|
-
const entrySchema =
|
|
9211
|
+
defaultTargetBranch: optional(nonBlank),
|
|
9212
|
+
account: optional(nonBlank)
|
|
9213
|
+
});
|
|
9214
|
+
const profileSchema = looseObject({ [key]: optional(policySchema) });
|
|
9215
|
+
const entrySchema = looseObject({
|
|
9967
9216
|
name: nonBlank,
|
|
9968
9217
|
glob: nonBlank,
|
|
9969
|
-
[key]:
|
|
9970
|
-
defaultProfile:
|
|
9971
|
-
profiles: record(nonBlank, profileSchema)
|
|
9972
|
-
})
|
|
9218
|
+
[key]: optional(policySchema),
|
|
9219
|
+
defaultProfile: optional(nonBlank),
|
|
9220
|
+
profiles: optional(record(nonBlank, profileSchema))
|
|
9221
|
+
});
|
|
9973
9222
|
return entrySchema;
|
|
9974
9223
|
};
|
|
9975
9224
|
var resolveRuntimeWorkspaceVcs = (cwd) => resolveRuntimeWorkspaceCandidate(cwd, "vcs");
|
|
9976
|
-
var runtimeWorkspaceIndexSchema =
|
|
9977
|
-
workspaces: array(
|
|
9978
|
-
})
|
|
9225
|
+
var runtimeWorkspaceIndexSchema = looseObject({
|
|
9226
|
+
workspaces: optional(array(looseObject({ name: nonBlank, glob: nonBlank })))
|
|
9227
|
+
});
|
|
9979
9228
|
var matchRuntimeWorkspace = (cwd, dir = configDir2()) => {
|
|
9980
9229
|
const file = path9.join(dir, "workspaces.json");
|
|
9981
9230
|
let raw;
|
|
@@ -12869,13 +12118,13 @@ var assetRoot = () => {
|
|
|
12869
12118
|
import { spawnSync as spawnSync10 } from "node:child_process";
|
|
12870
12119
|
import fs14 from "node:fs";
|
|
12871
12120
|
import { hostname } from "node:os";
|
|
12872
|
-
var metadataLockSchema =
|
|
12873
|
-
pid: number2().int()
|
|
12874
|
-
processStart: string2()
|
|
12875
|
-
host: string2().
|
|
12876
|
-
nonce: string2().
|
|
12877
|
-
externalAction: literal(true)
|
|
12878
|
-
})
|
|
12121
|
+
var metadataLockSchema = strictObject({
|
|
12122
|
+
pid: number2().check(int(), _nonnegative(), int()),
|
|
12123
|
+
processStart: nullable(string2()),
|
|
12124
|
+
host: string2().check(_minLength(1)),
|
|
12125
|
+
nonce: string2().check(_minLength(1)),
|
|
12126
|
+
externalAction: optional(literal(true))
|
|
12127
|
+
});
|
|
12879
12128
|
var FOREIGN_LOCK_TTL_MS = 10 * 60000;
|
|
12880
12129
|
var UNREADABLE_LOCK_TTL_MS = 30000;
|
|
12881
12130
|
var RECLAIM_GUARD_TTL_MS = 30000;
|
|
@@ -19772,7 +19021,7 @@ import path27 from "node:path";
|
|
|
19772
19021
|
var SEAL_FILE = "workspaces.json.seal";
|
|
19773
19022
|
var SEAL_VERSION = 1;
|
|
19774
19023
|
var SEAL_COMMAND = "workit workspace seal";
|
|
19775
|
-
var
|
|
19024
|
+
var pick3 = (value, keys) => {
|
|
19776
19025
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
19777
19026
|
return;
|
|
19778
19027
|
const out = Object.fromEntries(keys.flatMap((key) => {
|
|
@@ -19795,11 +19044,11 @@ var ENTRY_KEYS = [
|
|
|
19795
19044
|
];
|
|
19796
19045
|
var IDENTITY_KEYS = ["provider", "account", "tokenFile", "host"];
|
|
19797
19046
|
var sealProjection = (entries) => entries.map((entry) => {
|
|
19798
|
-
const all =
|
|
19799
|
-
return
|
|
19047
|
+
const all = pick3(entry, ENTRY_KEYS) ?? {};
|
|
19048
|
+
return pick3({
|
|
19800
19049
|
...all,
|
|
19801
|
-
vcs:
|
|
19802
|
-
youtrack:
|
|
19050
|
+
vcs: pick3(all.vcs, IDENTITY_KEYS),
|
|
19051
|
+
youtrack: pick3(all.youtrack, ["writes", "autoHosts"])
|
|
19803
19052
|
}, ENTRY_KEYS);
|
|
19804
19053
|
});
|
|
19805
19054
|
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);
|
|
@@ -24982,6 +24231,824 @@ class WorkitCore {
|
|
|
24982
24231
|
return this.summary(changed.data.task);
|
|
24983
24232
|
}
|
|
24984
24233
|
}
|
|
24234
|
+
// node_modules/zod/v4/classic/errors.js
|
|
24235
|
+
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
24236
|
+
function _lazyMethod(proto, key, make) {
|
|
24237
|
+
Object.defineProperty(proto, key, {
|
|
24238
|
+
configurable: true,
|
|
24239
|
+
enumerable: false,
|
|
24240
|
+
get() {
|
|
24241
|
+
const value = make(this);
|
|
24242
|
+
Object.defineProperty(this, key, { value, configurable: true, writable: true });
|
|
24243
|
+
return value;
|
|
24244
|
+
},
|
|
24245
|
+
set(value) {
|
|
24246
|
+
Object.defineProperty(this, key, { value, configurable: true, writable: true });
|
|
24247
|
+
}
|
|
24248
|
+
});
|
|
24249
|
+
}
|
|
24250
|
+
var initializer2 = (inst, issues) => {
|
|
24251
|
+
$ZodError.init(inst, issues);
|
|
24252
|
+
inst.name = "ZodError";
|
|
24253
|
+
const proto = Object.getPrototypeOf(inst);
|
|
24254
|
+
if (_installedErrorProtos.has(proto))
|
|
24255
|
+
return;
|
|
24256
|
+
_installedErrorProtos.add(proto);
|
|
24257
|
+
_lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
|
|
24258
|
+
_lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
|
|
24259
|
+
_lazyMethod(proto, "addIssue", (self) => (issue) => {
|
|
24260
|
+
self.issues.push(issue);
|
|
24261
|
+
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
24262
|
+
});
|
|
24263
|
+
_lazyMethod(proto, "addIssues", (self) => (issues) => {
|
|
24264
|
+
self.issues.push(...issues);
|
|
24265
|
+
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
24266
|
+
});
|
|
24267
|
+
Object.defineProperty(proto, "isEmpty", {
|
|
24268
|
+
configurable: true,
|
|
24269
|
+
enumerable: false,
|
|
24270
|
+
get() {
|
|
24271
|
+
return this.issues.length === 0;
|
|
24272
|
+
}
|
|
24273
|
+
});
|
|
24274
|
+
};
|
|
24275
|
+
var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, undefined, {
|
|
24276
|
+
Parent: Error
|
|
24277
|
+
});
|
|
24278
|
+
|
|
24279
|
+
// node_modules/zod/v4/classic/parse.js
|
|
24280
|
+
var parse4 = /* @__PURE__ */ _parse(ZodRealError);
|
|
24281
|
+
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
24282
|
+
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
24283
|
+
var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
24284
|
+
var encode2 = /* @__PURE__ */ _encode(ZodRealError);
|
|
24285
|
+
var decode3 = /* @__PURE__ */ _decode(ZodRealError);
|
|
24286
|
+
var encodeAsync2 = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
24287
|
+
var decodeAsync2 = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
24288
|
+
var safeEncode2 = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
24289
|
+
var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
24290
|
+
var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
24291
|
+
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
24292
|
+
|
|
24293
|
+
// node_modules/zod/v4/classic/schemas.js
|
|
24294
|
+
function _ensureDefaultLocale() {
|
|
24295
|
+
if (!globalConfig.localeError)
|
|
24296
|
+
config(en_default());
|
|
24297
|
+
}
|
|
24298
|
+
function _ensureDefaultMemoizer() {
|
|
24299
|
+
if (!globalConfig.memoizer)
|
|
24300
|
+
config({ memoizer: memoizer() });
|
|
24301
|
+
}
|
|
24302
|
+
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
24303
|
+
_ensureDefaultLocale();
|
|
24304
|
+
$ZodType.init(inst, def);
|
|
24305
|
+
inst.def = def;
|
|
24306
|
+
inst.type = def.type;
|
|
24307
|
+
return inst;
|
|
24308
|
+
}, {
|
|
24309
|
+
check(...chks) {
|
|
24310
|
+
const def = this.def;
|
|
24311
|
+
return this.clone(mergeDefs(def, {
|
|
24312
|
+
checks: [
|
|
24313
|
+
...def.checks ?? [],
|
|
24314
|
+
...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
24315
|
+
]
|
|
24316
|
+
}), { parent: true });
|
|
24317
|
+
},
|
|
24318
|
+
with(...chks) {
|
|
24319
|
+
return this.check(...chks);
|
|
24320
|
+
},
|
|
24321
|
+
clone(def, params) {
|
|
24322
|
+
return clone(this, def, params);
|
|
24323
|
+
},
|
|
24324
|
+
brand() {
|
|
24325
|
+
return this;
|
|
24326
|
+
},
|
|
24327
|
+
register(reg, meta) {
|
|
24328
|
+
reg.add(this, meta);
|
|
24329
|
+
return this;
|
|
24330
|
+
},
|
|
24331
|
+
refine(check, params) {
|
|
24332
|
+
return this.check(refine2(check, params));
|
|
24333
|
+
},
|
|
24334
|
+
superRefine(refinement, params) {
|
|
24335
|
+
return this.check(superRefine2(refinement, params));
|
|
24336
|
+
},
|
|
24337
|
+
overwrite(fn) {
|
|
24338
|
+
return this.check(_overwrite(fn));
|
|
24339
|
+
},
|
|
24340
|
+
optional() {
|
|
24341
|
+
return optional2(this);
|
|
24342
|
+
},
|
|
24343
|
+
exactOptional() {
|
|
24344
|
+
return exactOptional(this);
|
|
24345
|
+
},
|
|
24346
|
+
nullable() {
|
|
24347
|
+
return nullable2(this);
|
|
24348
|
+
},
|
|
24349
|
+
nullish() {
|
|
24350
|
+
return optional2(nullable2(this));
|
|
24351
|
+
},
|
|
24352
|
+
nonoptional(params) {
|
|
24353
|
+
return nonoptional(this, params);
|
|
24354
|
+
},
|
|
24355
|
+
array() {
|
|
24356
|
+
return array2(this);
|
|
24357
|
+
},
|
|
24358
|
+
or(arg) {
|
|
24359
|
+
return union2([this, arg]);
|
|
24360
|
+
},
|
|
24361
|
+
and(arg) {
|
|
24362
|
+
return intersection(this, arg);
|
|
24363
|
+
},
|
|
24364
|
+
transform(tx) {
|
|
24365
|
+
return pipe(this, transform(tx));
|
|
24366
|
+
},
|
|
24367
|
+
default(d) {
|
|
24368
|
+
return _default(this, d);
|
|
24369
|
+
},
|
|
24370
|
+
prefault(d) {
|
|
24371
|
+
return prefault(this, d);
|
|
24372
|
+
},
|
|
24373
|
+
catch(params) {
|
|
24374
|
+
return _catch(this, params);
|
|
24375
|
+
},
|
|
24376
|
+
pipe(target) {
|
|
24377
|
+
return pipe(this, target);
|
|
24378
|
+
},
|
|
24379
|
+
readonly() {
|
|
24380
|
+
return readonly(this);
|
|
24381
|
+
},
|
|
24382
|
+
describe(description) {
|
|
24383
|
+
const cl = this.clone();
|
|
24384
|
+
globalRegistry.add(cl, { description });
|
|
24385
|
+
return cl;
|
|
24386
|
+
},
|
|
24387
|
+
meta(...args) {
|
|
24388
|
+
if (args.length === 0)
|
|
24389
|
+
return globalRegistry.get(this);
|
|
24390
|
+
const cl = this.clone();
|
|
24391
|
+
globalRegistry.add(cl, args[0]);
|
|
24392
|
+
return cl;
|
|
24393
|
+
},
|
|
24394
|
+
isOptional() {
|
|
24395
|
+
return this.safeParse(undefined).success;
|
|
24396
|
+
},
|
|
24397
|
+
isNullable() {
|
|
24398
|
+
return this.safeParse(null).success;
|
|
24399
|
+
},
|
|
24400
|
+
apply(fn, ...args) {
|
|
24401
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
24402
|
+
},
|
|
24403
|
+
get "~standard"() {
|
|
24404
|
+
return hide(this, "~standard", {
|
|
24405
|
+
...standardProps(this),
|
|
24406
|
+
jsonSchema: {
|
|
24407
|
+
input: createStandardJSONSchemaMethod(this, "input"),
|
|
24408
|
+
output: createStandardJSONSchemaMethod(this, "output")
|
|
24409
|
+
}
|
|
24410
|
+
});
|
|
24411
|
+
},
|
|
24412
|
+
set "~standard"(value) {
|
|
24413
|
+
own(this, "~standard", value);
|
|
24414
|
+
},
|
|
24415
|
+
parse: function _parse(data, params) {
|
|
24416
|
+
return parse4(this, data, params, { callee: _parse });
|
|
24417
|
+
},
|
|
24418
|
+
parseAsync: async function _parseAsync(data, params) {
|
|
24419
|
+
return await parseAsync2(this, data, params, { callee: _parseAsync });
|
|
24420
|
+
},
|
|
24421
|
+
safeParse(data, params) {
|
|
24422
|
+
return safeParse2(this, data, params);
|
|
24423
|
+
},
|
|
24424
|
+
async safeParseAsync(data, params) {
|
|
24425
|
+
return safeParseAsync2(this, data, params);
|
|
24426
|
+
},
|
|
24427
|
+
get spa() {
|
|
24428
|
+
return this?.safeParseAsync;
|
|
24429
|
+
},
|
|
24430
|
+
set spa(value) {
|
|
24431
|
+
own(this, "spa", value);
|
|
24432
|
+
},
|
|
24433
|
+
validate(data, params) {
|
|
24434
|
+
return validate(this, data, params);
|
|
24435
|
+
},
|
|
24436
|
+
validateAsync(data, params) {
|
|
24437
|
+
return validateAsync(this, data, params);
|
|
24438
|
+
},
|
|
24439
|
+
encode: function _encode(data, params) {
|
|
24440
|
+
return encode2(this, data, params, { callee: _encode });
|
|
24441
|
+
},
|
|
24442
|
+
decode: function _decode(data, params) {
|
|
24443
|
+
return decode3(this, data, params, { callee: _decode });
|
|
24444
|
+
},
|
|
24445
|
+
encodeAsync: async function _encodeAsync(data, params) {
|
|
24446
|
+
return await encodeAsync2(this, data, params, { callee: _encodeAsync });
|
|
24447
|
+
},
|
|
24448
|
+
decodeAsync: async function _decodeAsync(data, params) {
|
|
24449
|
+
return await decodeAsync2(this, data, params, { callee: _decodeAsync });
|
|
24450
|
+
},
|
|
24451
|
+
safeEncode(data, params) {
|
|
24452
|
+
return safeEncode2(this, data, params);
|
|
24453
|
+
},
|
|
24454
|
+
safeDecode(data, params) {
|
|
24455
|
+
return safeDecode2(this, data, params);
|
|
24456
|
+
},
|
|
24457
|
+
async safeEncodeAsync(data, params) {
|
|
24458
|
+
return safeEncodeAsync2(this, data, params);
|
|
24459
|
+
},
|
|
24460
|
+
async safeDecodeAsync(data, params) {
|
|
24461
|
+
return safeDecodeAsync2(this, data, params);
|
|
24462
|
+
},
|
|
24463
|
+
toJSONSchema(params) {
|
|
24464
|
+
return createToJSONSchemaMethod(this, {})(params);
|
|
24465
|
+
},
|
|
24466
|
+
get description() {
|
|
24467
|
+
return globalRegistry.get(this)?.description;
|
|
24468
|
+
},
|
|
24469
|
+
get _def() {
|
|
24470
|
+
return this._zod.def;
|
|
24471
|
+
}
|
|
24472
|
+
});
|
|
24473
|
+
var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
24474
|
+
$ZodString.init(inst, def);
|
|
24475
|
+
ZodType.init(inst, def);
|
|
24476
|
+
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
24477
|
+
}, /* @__PURE__ */ derived({
|
|
24478
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
24479
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
24480
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
24481
|
+
}, {
|
|
24482
|
+
regex(...args) {
|
|
24483
|
+
return this.check(_regex(...args));
|
|
24484
|
+
},
|
|
24485
|
+
includes(...args) {
|
|
24486
|
+
return this.check(_includes(...args));
|
|
24487
|
+
},
|
|
24488
|
+
startsWith(...args) {
|
|
24489
|
+
return this.check(_startsWith(...args));
|
|
24490
|
+
},
|
|
24491
|
+
endsWith(...args) {
|
|
24492
|
+
return this.check(_endsWith(...args));
|
|
24493
|
+
},
|
|
24494
|
+
min(...args) {
|
|
24495
|
+
return this.check(_minLength(...args));
|
|
24496
|
+
},
|
|
24497
|
+
max(...args) {
|
|
24498
|
+
return this.check(_maxLength(...args));
|
|
24499
|
+
},
|
|
24500
|
+
length(...args) {
|
|
24501
|
+
return this.check(_length(...args));
|
|
24502
|
+
},
|
|
24503
|
+
nonempty(...args) {
|
|
24504
|
+
return this.check(_minLength(1, ...args));
|
|
24505
|
+
},
|
|
24506
|
+
lowercase(params) {
|
|
24507
|
+
return this.check(_lowercase(params));
|
|
24508
|
+
},
|
|
24509
|
+
uppercase(params) {
|
|
24510
|
+
return this.check(_uppercase(params));
|
|
24511
|
+
},
|
|
24512
|
+
trim() {
|
|
24513
|
+
return this.check(_trim());
|
|
24514
|
+
},
|
|
24515
|
+
normalize(...args) {
|
|
24516
|
+
return this.check(_normalize(...args));
|
|
24517
|
+
},
|
|
24518
|
+
toLowerCase() {
|
|
24519
|
+
return this.check(_toLowerCase());
|
|
24520
|
+
},
|
|
24521
|
+
toUpperCase() {
|
|
24522
|
+
return this.check(_toUpperCase());
|
|
24523
|
+
},
|
|
24524
|
+
slugify() {
|
|
24525
|
+
return this.check(_slugify());
|
|
24526
|
+
}
|
|
24527
|
+
}));
|
|
24528
|
+
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
24529
|
+
$ZodString.init(inst, def);
|
|
24530
|
+
_ZodString.init(inst, def);
|
|
24531
|
+
}, {
|
|
24532
|
+
email(params) {
|
|
24533
|
+
return this.check(_email(ZodEmail, params));
|
|
24534
|
+
},
|
|
24535
|
+
url(params) {
|
|
24536
|
+
return this.check(_url(ZodURL, params));
|
|
24537
|
+
},
|
|
24538
|
+
jwt(params) {
|
|
24539
|
+
return this.check(_jwt(ZodJWT, params));
|
|
24540
|
+
},
|
|
24541
|
+
emoji(params) {
|
|
24542
|
+
return this.check(_emoji2(ZodEmoji, params));
|
|
24543
|
+
},
|
|
24544
|
+
guid(params) {
|
|
24545
|
+
return this.check(_guid(ZodGUID, params));
|
|
24546
|
+
},
|
|
24547
|
+
uuid(params) {
|
|
24548
|
+
return this.check(_uuid(ZodUUID, params));
|
|
24549
|
+
},
|
|
24550
|
+
uuidv4(params) {
|
|
24551
|
+
return this.check(_uuidv4(ZodUUID, params));
|
|
24552
|
+
},
|
|
24553
|
+
uuidv6(params) {
|
|
24554
|
+
return this.check(_uuidv6(ZodUUID, params));
|
|
24555
|
+
},
|
|
24556
|
+
uuidv7(params) {
|
|
24557
|
+
return this.check(_uuidv7(ZodUUID, params));
|
|
24558
|
+
},
|
|
24559
|
+
nanoid(params) {
|
|
24560
|
+
return this.check(_nanoid(ZodNanoID, params));
|
|
24561
|
+
},
|
|
24562
|
+
cuid(params) {
|
|
24563
|
+
return this.check(_cuid(ZodCUID, params));
|
|
24564
|
+
},
|
|
24565
|
+
cuid2(params) {
|
|
24566
|
+
return this.check(_cuid2(ZodCUID2, params));
|
|
24567
|
+
},
|
|
24568
|
+
ulid(params) {
|
|
24569
|
+
return this.check(_ulid(ZodULID, params));
|
|
24570
|
+
},
|
|
24571
|
+
base64(params) {
|
|
24572
|
+
return this.check(_base64(ZodBase64, params));
|
|
24573
|
+
},
|
|
24574
|
+
base64url(params) {
|
|
24575
|
+
return this.check(_base64url(ZodBase64URL, params));
|
|
24576
|
+
},
|
|
24577
|
+
xid(params) {
|
|
24578
|
+
return this.check(_xid(ZodXID, params));
|
|
24579
|
+
},
|
|
24580
|
+
ksuid(params) {
|
|
24581
|
+
return this.check(_ksuid(ZodKSUID, params));
|
|
24582
|
+
},
|
|
24583
|
+
ipv4(params) {
|
|
24584
|
+
return this.check(_ipv4(ZodIPv4, params));
|
|
24585
|
+
},
|
|
24586
|
+
ipv6(params) {
|
|
24587
|
+
return this.check(_ipv6(ZodIPv6, params));
|
|
24588
|
+
},
|
|
24589
|
+
cidrv4(params) {
|
|
24590
|
+
return this.check(_cidrv4(ZodCIDRv4, params));
|
|
24591
|
+
},
|
|
24592
|
+
cidrv6(params) {
|
|
24593
|
+
return this.check(_cidrv6(ZodCIDRv6, params));
|
|
24594
|
+
},
|
|
24595
|
+
e164(params) {
|
|
24596
|
+
return this.check(_e164(ZodE164, params));
|
|
24597
|
+
},
|
|
24598
|
+
datetime(params) {
|
|
24599
|
+
return this.check(_isoDateTime(ZodISODateTime, params));
|
|
24600
|
+
},
|
|
24601
|
+
date(params) {
|
|
24602
|
+
return this.check(_isoDate(ZodISODate, params));
|
|
24603
|
+
},
|
|
24604
|
+
time(params) {
|
|
24605
|
+
return this.check(_isoTime(ZodISOTime, params));
|
|
24606
|
+
},
|
|
24607
|
+
duration(params) {
|
|
24608
|
+
return this.check(_isoDuration(ZodISODuration, params));
|
|
24609
|
+
}
|
|
24610
|
+
});
|
|
24611
|
+
function string3(params) {
|
|
24612
|
+
return _string(ZodString, params);
|
|
24613
|
+
}
|
|
24614
|
+
var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
|
|
24615
|
+
$ZodStringFormat.init(inst, def);
|
|
24616
|
+
_ZodString.init(inst, def);
|
|
24617
|
+
});
|
|
24618
|
+
var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
24619
|
+
$ZodISODateTime.init(inst, def);
|
|
24620
|
+
ZodStringFormat.init(inst, def);
|
|
24621
|
+
});
|
|
24622
|
+
var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
24623
|
+
$ZodISODate.init(inst, def);
|
|
24624
|
+
ZodStringFormat.init(inst, def);
|
|
24625
|
+
});
|
|
24626
|
+
var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
24627
|
+
$ZodISOTime.init(inst, def);
|
|
24628
|
+
ZodStringFormat.init(inst, def);
|
|
24629
|
+
});
|
|
24630
|
+
var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
|
|
24631
|
+
$ZodISODuration.init(inst, def);
|
|
24632
|
+
ZodStringFormat.init(inst, def);
|
|
24633
|
+
});
|
|
24634
|
+
var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
|
|
24635
|
+
$ZodEmail.init(inst, def);
|
|
24636
|
+
ZodStringFormat.init(inst, def);
|
|
24637
|
+
});
|
|
24638
|
+
var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
|
|
24639
|
+
$ZodGUID.init(inst, def);
|
|
24640
|
+
ZodStringFormat.init(inst, def);
|
|
24641
|
+
});
|
|
24642
|
+
var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
|
|
24643
|
+
$ZodUUID.init(inst, def);
|
|
24644
|
+
ZodStringFormat.init(inst, def);
|
|
24645
|
+
});
|
|
24646
|
+
var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
|
|
24647
|
+
$ZodURL.init(inst, def);
|
|
24648
|
+
ZodStringFormat.init(inst, def);
|
|
24649
|
+
});
|
|
24650
|
+
var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
|
|
24651
|
+
$ZodEmoji.init(inst, def);
|
|
24652
|
+
ZodStringFormat.init(inst, def);
|
|
24653
|
+
});
|
|
24654
|
+
var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
|
|
24655
|
+
$ZodNanoID.init(inst, def);
|
|
24656
|
+
ZodStringFormat.init(inst, def);
|
|
24657
|
+
});
|
|
24658
|
+
var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
|
|
24659
|
+
$ZodCUID.init(inst, def);
|
|
24660
|
+
ZodStringFormat.init(inst, def);
|
|
24661
|
+
});
|
|
24662
|
+
var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
|
|
24663
|
+
$ZodCUID2.init(inst, def);
|
|
24664
|
+
ZodStringFormat.init(inst, def);
|
|
24665
|
+
});
|
|
24666
|
+
var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
|
|
24667
|
+
$ZodULID.init(inst, def);
|
|
24668
|
+
ZodStringFormat.init(inst, def);
|
|
24669
|
+
});
|
|
24670
|
+
var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
|
|
24671
|
+
$ZodXID.init(inst, def);
|
|
24672
|
+
ZodStringFormat.init(inst, def);
|
|
24673
|
+
});
|
|
24674
|
+
var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
|
|
24675
|
+
$ZodKSUID.init(inst, def);
|
|
24676
|
+
ZodStringFormat.init(inst, def);
|
|
24677
|
+
});
|
|
24678
|
+
var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
|
|
24679
|
+
$ZodIPv4.init(inst, def);
|
|
24680
|
+
ZodStringFormat.init(inst, def);
|
|
24681
|
+
});
|
|
24682
|
+
var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
|
|
24683
|
+
$ZodIPv6.init(inst, def);
|
|
24684
|
+
ZodStringFormat.init(inst, def);
|
|
24685
|
+
});
|
|
24686
|
+
var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
|
|
24687
|
+
$ZodCIDRv4.init(inst, def);
|
|
24688
|
+
ZodStringFormat.init(inst, def);
|
|
24689
|
+
});
|
|
24690
|
+
var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
|
|
24691
|
+
$ZodCIDRv6.init(inst, def);
|
|
24692
|
+
ZodStringFormat.init(inst, def);
|
|
24693
|
+
});
|
|
24694
|
+
var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
|
|
24695
|
+
$ZodBase64.init(inst, def);
|
|
24696
|
+
ZodStringFormat.init(inst, def);
|
|
24697
|
+
});
|
|
24698
|
+
var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
|
|
24699
|
+
$ZodBase64URL.init(inst, def);
|
|
24700
|
+
ZodStringFormat.init(inst, def);
|
|
24701
|
+
});
|
|
24702
|
+
var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
|
|
24703
|
+
$ZodE164.init(inst, def);
|
|
24704
|
+
ZodStringFormat.init(inst, def);
|
|
24705
|
+
});
|
|
24706
|
+
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
24707
|
+
$ZodJWT.init(inst, def);
|
|
24708
|
+
ZodStringFormat.init(inst, def);
|
|
24709
|
+
});
|
|
24710
|
+
var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
24711
|
+
$ZodUnknown.init(inst, def);
|
|
24712
|
+
ZodType.init(inst, def);
|
|
24713
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
|
|
24714
|
+
});
|
|
24715
|
+
function unknown2() {
|
|
24716
|
+
return _unknown(ZodUnknown);
|
|
24717
|
+
}
|
|
24718
|
+
var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
24719
|
+
$ZodNever.init(inst, def);
|
|
24720
|
+
ZodType.init(inst, def);
|
|
24721
|
+
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
|
|
24722
|
+
});
|
|
24723
|
+
function never2(params) {
|
|
24724
|
+
return _never(ZodNever, params);
|
|
24725
|
+
}
|
|
24726
|
+
var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
24727
|
+
_ensureDefaultMemoizer();
|
|
24728
|
+
$ZodArray.init(inst, def);
|
|
24729
|
+
ZodType.init(inst, def);
|
|
24730
|
+
inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
|
|
24731
|
+
inst.element = def.element;
|
|
24732
|
+
}, {
|
|
24733
|
+
min(n, params) {
|
|
24734
|
+
return this.check(_minLength(n, params));
|
|
24735
|
+
},
|
|
24736
|
+
nonempty(params) {
|
|
24737
|
+
return this.check(_minLength(1, params));
|
|
24738
|
+
},
|
|
24739
|
+
max(n, params) {
|
|
24740
|
+
return this.check(_maxLength(n, params));
|
|
24741
|
+
},
|
|
24742
|
+
length(n, params) {
|
|
24743
|
+
return this.check(_length(n, params));
|
|
24744
|
+
},
|
|
24745
|
+
unwrap() {
|
|
24746
|
+
return this.element;
|
|
24747
|
+
}
|
|
24748
|
+
});
|
|
24749
|
+
function array2(element, params) {
|
|
24750
|
+
return _array(ZodArray, element, params);
|
|
24751
|
+
}
|
|
24752
|
+
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
24753
|
+
_ensureDefaultMemoizer();
|
|
24754
|
+
$ZodObjectJIT.init(inst, def);
|
|
24755
|
+
ZodType.init(inst, def);
|
|
24756
|
+
inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
|
|
24757
|
+
installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
24758
|
+
}, {
|
|
24759
|
+
keyof() {
|
|
24760
|
+
return _enum2(Object.keys(this._zod.def.shape));
|
|
24761
|
+
},
|
|
24762
|
+
catchall(catchall) {
|
|
24763
|
+
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
24764
|
+
},
|
|
24765
|
+
passthrough() {
|
|
24766
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown2() }));
|
|
24767
|
+
},
|
|
24768
|
+
loose() {
|
|
24769
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown2() }));
|
|
24770
|
+
},
|
|
24771
|
+
strict() {
|
|
24772
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: never2() }));
|
|
24773
|
+
},
|
|
24774
|
+
strip() {
|
|
24775
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: undefined }));
|
|
24776
|
+
},
|
|
24777
|
+
extend(incoming) {
|
|
24778
|
+
return extend(this, incoming);
|
|
24779
|
+
},
|
|
24780
|
+
safeExtend(incoming) {
|
|
24781
|
+
return safeExtend(this, incoming);
|
|
24782
|
+
},
|
|
24783
|
+
merge(other) {
|
|
24784
|
+
return merge(this, other);
|
|
24785
|
+
},
|
|
24786
|
+
pick(mask) {
|
|
24787
|
+
return pick(this, mask);
|
|
24788
|
+
},
|
|
24789
|
+
omit(mask) {
|
|
24790
|
+
return omit(this, mask);
|
|
24791
|
+
},
|
|
24792
|
+
partial(...args) {
|
|
24793
|
+
return partial(ZodOptional, this, args[0]);
|
|
24794
|
+
},
|
|
24795
|
+
exactPartial(...args) {
|
|
24796
|
+
return partial(ZodExactOptional, this, args[0], "exactPartial");
|
|
24797
|
+
},
|
|
24798
|
+
required(...args) {
|
|
24799
|
+
return required(ZodNonOptional, this, args[0]);
|
|
24800
|
+
}
|
|
24801
|
+
});
|
|
24802
|
+
function object(shape, params) {
|
|
24803
|
+
const def = {
|
|
24804
|
+
type: "object",
|
|
24805
|
+
shape: shape ?? {},
|
|
24806
|
+
...normalizeParams(params)
|
|
24807
|
+
};
|
|
24808
|
+
return new ZodObject(def);
|
|
24809
|
+
}
|
|
24810
|
+
var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
24811
|
+
$ZodUnion.init(inst, def);
|
|
24812
|
+
ZodType.init(inst, def);
|
|
24813
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
24814
|
+
inst.options = def.options;
|
|
24815
|
+
});
|
|
24816
|
+
function union2(options, params) {
|
|
24817
|
+
return new ZodUnion({
|
|
24818
|
+
type: "union",
|
|
24819
|
+
options,
|
|
24820
|
+
...normalizeParams(params)
|
|
24821
|
+
});
|
|
24822
|
+
}
|
|
24823
|
+
var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
24824
|
+
$ZodIntersection.init(inst, def);
|
|
24825
|
+
ZodType.init(inst, def);
|
|
24826
|
+
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
24827
|
+
});
|
|
24828
|
+
function intersection(left, right) {
|
|
24829
|
+
return new ZodIntersection({
|
|
24830
|
+
type: "intersection",
|
|
24831
|
+
left,
|
|
24832
|
+
right
|
|
24833
|
+
});
|
|
24834
|
+
}
|
|
24835
|
+
var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
24836
|
+
$ZodEnum.init(inst, def);
|
|
24837
|
+
ZodType.init(inst, def);
|
|
24838
|
+
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
24839
|
+
inst.enum = def.entries;
|
|
24840
|
+
inst.options = [...inst._zod.values];
|
|
24841
|
+
const keys = new Set(Object.keys(def.entries));
|
|
24842
|
+
inst.extract = (values, params) => {
|
|
24843
|
+
const newEntries = {};
|
|
24844
|
+
for (const value of values) {
|
|
24845
|
+
if (keys.has(value)) {
|
|
24846
|
+
newEntries[value] = def.entries[value];
|
|
24847
|
+
} else
|
|
24848
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
24849
|
+
}
|
|
24850
|
+
return new ZodEnum({
|
|
24851
|
+
...def,
|
|
24852
|
+
checks: [],
|
|
24853
|
+
...normalizeParams(params),
|
|
24854
|
+
entries: newEntries
|
|
24855
|
+
});
|
|
24856
|
+
};
|
|
24857
|
+
inst.exclude = (values, params) => {
|
|
24858
|
+
const newEntries = { ...def.entries };
|
|
24859
|
+
for (const value of values) {
|
|
24860
|
+
if (keys.has(value)) {
|
|
24861
|
+
delete newEntries[value];
|
|
24862
|
+
} else
|
|
24863
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
24864
|
+
}
|
|
24865
|
+
return new ZodEnum({
|
|
24866
|
+
...def,
|
|
24867
|
+
checks: [],
|
|
24868
|
+
...normalizeParams(params),
|
|
24869
|
+
entries: newEntries
|
|
24870
|
+
});
|
|
24871
|
+
};
|
|
24872
|
+
});
|
|
24873
|
+
function _enum2(values, params) {
|
|
24874
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
24875
|
+
return new ZodEnum({
|
|
24876
|
+
type: "enum",
|
|
24877
|
+
entries,
|
|
24878
|
+
...normalizeParams(params)
|
|
24879
|
+
});
|
|
24880
|
+
}
|
|
24881
|
+
var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
24882
|
+
_ensureDefaultMemoizer();
|
|
24883
|
+
$ZodTransform.init(inst, def);
|
|
24884
|
+
ZodType.init(inst, def);
|
|
24885
|
+
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
|
|
24886
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
24887
|
+
if (_ctx.direction === "backward") {
|
|
24888
|
+
throw new $ZodEncodeError(inst.constructor.name);
|
|
24889
|
+
}
|
|
24890
|
+
payload.addIssue = (issue2) => {
|
|
24891
|
+
if (typeof issue2 === "string") {
|
|
24892
|
+
payload.issues.push(issue(issue2, payload.value, def));
|
|
24893
|
+
} else {
|
|
24894
|
+
const _issue = issue2;
|
|
24895
|
+
if (_issue.fatal)
|
|
24896
|
+
_issue.continue = false;
|
|
24897
|
+
_issue.code ?? (_issue.code = "custom");
|
|
24898
|
+
if (!("input" in _issue))
|
|
24899
|
+
_issue.input = payload.value;
|
|
24900
|
+
_issue.inst ?? (_issue.inst = inst);
|
|
24901
|
+
payload.issues.push(issue(_issue));
|
|
24902
|
+
}
|
|
24903
|
+
};
|
|
24904
|
+
const output = def.transform(payload.value, payload);
|
|
24905
|
+
if (output instanceof Promise) {
|
|
24906
|
+
return output.then((output) => {
|
|
24907
|
+
payload.value = output;
|
|
24908
|
+
return payload;
|
|
24909
|
+
});
|
|
24910
|
+
}
|
|
24911
|
+
payload.value = output;
|
|
24912
|
+
return payload;
|
|
24913
|
+
};
|
|
24914
|
+
});
|
|
24915
|
+
function transform(fn) {
|
|
24916
|
+
return new ZodTransform({
|
|
24917
|
+
type: "transform",
|
|
24918
|
+
transform: fn
|
|
24919
|
+
});
|
|
24920
|
+
}
|
|
24921
|
+
var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
24922
|
+
$ZodOptional.init(inst, def);
|
|
24923
|
+
ZodType.init(inst, def);
|
|
24924
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
24925
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24926
|
+
});
|
|
24927
|
+
function optional2(innerType) {
|
|
24928
|
+
return new ZodOptional({
|
|
24929
|
+
type: "optional",
|
|
24930
|
+
innerType
|
|
24931
|
+
});
|
|
24932
|
+
}
|
|
24933
|
+
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
24934
|
+
$ZodExactOptional.init(inst, def);
|
|
24935
|
+
ZodType.init(inst, def);
|
|
24936
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
24937
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24938
|
+
});
|
|
24939
|
+
function exactOptional(innerType) {
|
|
24940
|
+
return new ZodExactOptional({
|
|
24941
|
+
type: "optional",
|
|
24942
|
+
innerType
|
|
24943
|
+
});
|
|
24944
|
+
}
|
|
24945
|
+
var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
24946
|
+
$ZodNullable.init(inst, def);
|
|
24947
|
+
ZodType.init(inst, def);
|
|
24948
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
24949
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24950
|
+
});
|
|
24951
|
+
function nullable2(innerType) {
|
|
24952
|
+
return new ZodNullable({
|
|
24953
|
+
type: "nullable",
|
|
24954
|
+
innerType
|
|
24955
|
+
});
|
|
24956
|
+
}
|
|
24957
|
+
var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
24958
|
+
$ZodDefault.init(inst, def);
|
|
24959
|
+
ZodType.init(inst, def);
|
|
24960
|
+
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
24961
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24962
|
+
inst.removeDefault = inst.unwrap;
|
|
24963
|
+
});
|
|
24964
|
+
function _default(innerType, defaultValue) {
|
|
24965
|
+
return new ZodDefault({
|
|
24966
|
+
type: "default",
|
|
24967
|
+
innerType,
|
|
24968
|
+
get defaultValue() {
|
|
24969
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
24970
|
+
}
|
|
24971
|
+
});
|
|
24972
|
+
}
|
|
24973
|
+
var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
24974
|
+
$ZodPrefault.init(inst, def);
|
|
24975
|
+
ZodType.init(inst, def);
|
|
24976
|
+
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
24977
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24978
|
+
});
|
|
24979
|
+
function prefault(innerType, defaultValue) {
|
|
24980
|
+
return new ZodPrefault({
|
|
24981
|
+
type: "prefault",
|
|
24982
|
+
innerType,
|
|
24983
|
+
get defaultValue() {
|
|
24984
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
24985
|
+
}
|
|
24986
|
+
});
|
|
24987
|
+
}
|
|
24988
|
+
var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
24989
|
+
$ZodNonOptional.init(inst, def);
|
|
24990
|
+
ZodType.init(inst, def);
|
|
24991
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
24992
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
24993
|
+
});
|
|
24994
|
+
function nonoptional(innerType, params) {
|
|
24995
|
+
return new ZodNonOptional({
|
|
24996
|
+
type: "nonoptional",
|
|
24997
|
+
innerType,
|
|
24998
|
+
...normalizeParams(params)
|
|
24999
|
+
});
|
|
25000
|
+
}
|
|
25001
|
+
var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
25002
|
+
$ZodCatch.init(inst, def);
|
|
25003
|
+
ZodType.init(inst, def);
|
|
25004
|
+
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
25005
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
25006
|
+
inst.removeCatch = inst.unwrap;
|
|
25007
|
+
});
|
|
25008
|
+
function _catch(innerType, catchValue) {
|
|
25009
|
+
return new ZodCatch({
|
|
25010
|
+
type: "catch",
|
|
25011
|
+
innerType,
|
|
25012
|
+
catchValue: typeof catchValue === "function" ? catchValue : constantCatch(catchValue)
|
|
25013
|
+
});
|
|
25014
|
+
}
|
|
25015
|
+
var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
25016
|
+
$ZodPipe.init(inst, def);
|
|
25017
|
+
ZodType.init(inst, def);
|
|
25018
|
+
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
25019
|
+
inst.in = def.in;
|
|
25020
|
+
inst.out = def.out;
|
|
25021
|
+
});
|
|
25022
|
+
function pipe(in_, out) {
|
|
25023
|
+
return new ZodPipe({
|
|
25024
|
+
type: "pipe",
|
|
25025
|
+
in: in_,
|
|
25026
|
+
out
|
|
25027
|
+
});
|
|
25028
|
+
}
|
|
25029
|
+
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
25030
|
+
$ZodReadonly.init(inst, def);
|
|
25031
|
+
ZodType.init(inst, def);
|
|
25032
|
+
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
25033
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
25034
|
+
});
|
|
25035
|
+
function readonly(innerType) {
|
|
25036
|
+
return new ZodReadonly({
|
|
25037
|
+
type: "readonly",
|
|
25038
|
+
innerType
|
|
25039
|
+
});
|
|
25040
|
+
}
|
|
25041
|
+
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
25042
|
+
$ZodCustom.init(inst, def);
|
|
25043
|
+
ZodType.init(inst, def);
|
|
25044
|
+
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
25045
|
+
});
|
|
25046
|
+
function refine2(fn, _params = {}) {
|
|
25047
|
+
return _refine(ZodCustom, fn, _params);
|
|
25048
|
+
}
|
|
25049
|
+
function superRefine2(fn, params) {
|
|
25050
|
+
return _superRefine(fn, params);
|
|
25051
|
+
}
|
|
24985
25052
|
// packages/workit-core/src/core/repo-context.ts
|
|
24986
25053
|
import { spawnSync as spawnSync19 } from "node:child_process";
|
|
24987
25054
|
import { existsSync as existsSync14, readFileSync as readFileSync11, readdirSync as readdirSync4 } from "node:fs";
|
|
@@ -25900,7 +25967,7 @@ var fetchYouTrackIssueBody = async (issue, ytrack = ytrackRunner(process.env, yo
|
|
|
25900
25967
|
|
|
25901
25968
|
// packages/workit-core/src/core/context-read.ts
|
|
25902
25969
|
var contextReadSchema = object({
|
|
25903
|
-
kind:
|
|
25970
|
+
kind: _enum2([
|
|
25904
25971
|
"git",
|
|
25905
25972
|
"pr",
|
|
25906
25973
|
"youtrack",
|
|
@@ -25910,14 +25977,14 @@ var contextReadSchema = object({
|
|
|
25910
25977
|
"release",
|
|
25911
25978
|
"affected"
|
|
25912
25979
|
]),
|
|
25913
|
-
range:
|
|
25914
|
-
issueId:
|
|
25915
|
-
issueUrl:
|
|
25916
|
-
issueRef:
|
|
25917
|
-
mode:
|
|
25918
|
-
specPath:
|
|
25919
|
-
planPath:
|
|
25920
|
-
cwd:
|
|
25980
|
+
range: string3().optional(),
|
|
25981
|
+
issueId: string3().optional(),
|
|
25982
|
+
issueUrl: string3().optional(),
|
|
25983
|
+
issueRef: string3().optional(),
|
|
25984
|
+
mode: string3().optional(),
|
|
25985
|
+
specPath: string3().optional(),
|
|
25986
|
+
planPath: string3().optional(),
|
|
25987
|
+
cwd: string3().min(1).optional()
|
|
25921
25988
|
}).strict();
|
|
25922
25989
|
var contextReadJsonSchema = () => {
|
|
25923
25990
|
const { $schema: _schema, ...schema } = toJSONSchema(contextReadSchema, {
|
|
@@ -28957,7 +29024,7 @@ var pidAlive2 = (pid) => {
|
|
|
28957
29024
|
return error.code === "EPERM";
|
|
28958
29025
|
}
|
|
28959
29026
|
};
|
|
28960
|
-
var
|
|
29027
|
+
var parse6 = (raw) => {
|
|
28961
29028
|
try {
|
|
28962
29029
|
const value = JSON.parse(raw);
|
|
28963
29030
|
if (typeof value.pr !== "number" || typeof value.pid !== "number" || typeof value.deadline !== "number" || typeof value.host !== "string" || typeof value.startedAt !== "number")
|
|
@@ -28988,7 +29055,7 @@ var liveCiWaiter = (cwd, pr, head = null, nowMs = Date.now()) => {
|
|
|
28988
29055
|
const file = waiterFile(cwd, pr);
|
|
28989
29056
|
if (!file)
|
|
28990
29057
|
return null;
|
|
28991
|
-
const waiter =
|
|
29058
|
+
const waiter = parse6(fs29.readFileSync(file, "utf8"));
|
|
28992
29059
|
if (!waiter || waiter.pr !== pr || waiter.pid === process.pid)
|
|
28993
29060
|
return null;
|
|
28994
29061
|
if (head && waiter.head && !sameSha(waiter.head, head))
|