@fro.bot/systematic 3.18.3 → 3.18.5

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.
@@ -47,6 +47,25 @@ export interface ReviewReturnValidatorOptions {
47
47
  readonly outputSink?: (message: string) => void;
48
48
  readonly errorSink?: (message: string) => void;
49
49
  }
50
+ export type StdinRead = {
51
+ readonly status: 'ok';
52
+ readonly buffer: Buffer;
53
+ } | {
54
+ readonly status: 'oversized';
55
+ } | {
56
+ readonly status: 'read-error';
57
+ };
58
+ export declare function defaultReadChunk(fd: number, buffer: Buffer, offset: number, length: number, position: number | null): number;
59
+ /**
60
+ * Read stdin in bounded chunks, stopping at the cap plus one byte so an
61
+ * oversized payload is rejected without buffering the whole document.
62
+ *
63
+ * `maxBytes` defaults to {@link MAX_REVIEW_RETURN_BYTES} (the `return`/`screen`
64
+ * 1 MiB cap); callers with a different bound -- such as `prepare`'s larger
65
+ * aggregate envelope cap -- pass it explicitly. The default preserves
66
+ * `return` and `screen`'s existing behavior byte-for-byte.
67
+ */
68
+ export declare function readBoundedStdin(fd: number, readChunk: ReadChunk, maxBytes?: number): StdinRead;
50
69
  /**
51
70
  * Validate exactly one raw persona return from stdin.
52
71
  *
package/dist/pi.js CHANGED
@@ -3549,7 +3549,7 @@ var BUNDLED_SKILL_NAMES = [
3549
3549
  "writing-skills"
3550
3550
  ];
3551
3551
 
3552
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/util.js
3552
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/util.js
3553
3553
  function getEnumValues(entries) {
3554
3554
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
3555
3555
  const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -3987,9 +3987,6 @@ function members(proto, table) {
3987
3987
  else
3988
3988
  defineBound(proto, key, desc.value);
3989
3989
  }
3990
- for (const sym of Object.getOwnPropertySymbols(table)) {
3991
- defineBound(proto, sym, table[sym]);
3992
- }
3993
3990
  }
3994
3991
  function own(inst, key, value, enumerable = true) {
3995
3992
  Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
@@ -4095,7 +4092,7 @@ function constantCatch(value) {
4095
4092
  return fn;
4096
4093
  }
4097
4094
 
4098
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/core.js
4095
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/core.js
4099
4096
  var _a;
4100
4097
  var _zodDesc = { value: undefined, enumerable: false };
4101
4098
  var _E = "captureStackTrace" in Error ? Error : null;
@@ -4137,8 +4134,7 @@ function $constructor(name, initializer, proto, params) {
4137
4134
  } finally {
4138
4135
  _zodDesc.value = undefined;
4139
4136
  }
4140
- }
4141
- if (inst._zod.traits.has(name)) {
4137
+ } else if (inst._zod.traits.has(name)) {
4142
4138
  return;
4143
4139
  }
4144
4140
  inst._zod.traits.add(name);
@@ -4214,7 +4210,7 @@ function config(newConfig) {
4214
4210
  Object.assign(globalConfig, newConfig);
4215
4211
  return globalConfig;
4216
4212
  }
4217
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/errors.js
4213
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/errors.js
4218
4214
  function _getMessage() {
4219
4215
  const internals = this._zod;
4220
4216
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -4329,7 +4325,7 @@ function formatError(error, mapper = (issue) => issue.message) {
4329
4325
  return fieldErrors;
4330
4326
  }
4331
4327
 
4332
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/parse.js
4328
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/parse.js
4333
4329
  function finalizeParams(callee, params) {
4334
4330
  return { callee: params?.callee ?? callee, Err: params?.Err };
4335
4331
  }
@@ -4476,7 +4472,7 @@ var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
4476
4472
  var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
4477
4473
  return _safeParseAsync(_Err)(schema, value, _ctx);
4478
4474
  };
4479
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/regexes.js
4475
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/regexes.js
4480
4476
  var cuid = /^[cC][0-9a-z]{6,}$/;
4481
4477
  var cuid2 = /^[0-9a-z]+$/;
4482
4478
  var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
@@ -4534,7 +4530,7 @@ var boolean = /^(?:true|false)$/i;
4534
4530
  var lowercase = /^[^A-Z]*$/;
4535
4531
  var uppercase = /^[^a-z]*$/;
4536
4532
 
4537
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/checks.js
4533
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/checks.js
4538
4534
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
4539
4535
  var _a;
4540
4536
  inst._zod ?? (inst._zod = {});
@@ -4850,7 +4846,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
4850
4846
  };
4851
4847
  });
4852
4848
 
4853
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/doc.js
4849
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/doc.js
4854
4850
  class Doc {
4855
4851
  constructor(args = [], closed = {}) {
4856
4852
  this.content = [];
@@ -4892,14 +4888,14 @@ ${content.join(`
4892
4888
  }
4893
4889
  }
4894
4890
 
4895
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/versions.js
4891
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/versions.js
4896
4892
  var version = {
4897
4893
  major: 4,
4898
4894
  minor: 6,
4899
- patch: 2
4895
+ patch: 4
4900
4896
  };
4901
4897
 
4902
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/schemas.js
4898
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/schemas.js
4903
4899
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
4904
4900
  var _a;
4905
4901
  inst ?? (inst = {});
@@ -5081,11 +5077,32 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
5081
5077
  });
5082
5078
  var URL_BAD_FORMAT = 1;
5083
5079
  var URL_UNPARSEABLE = 2;
5080
+ function canParseURL(input) {
5081
+ try {
5082
+ if (typeof URL !== "undefined" && typeof URL.canParse === "function")
5083
+ return URL.canParse(input);
5084
+ new URL(input);
5085
+ return true;
5086
+ } catch {
5087
+ return false;
5088
+ }
5089
+ }
5090
+ function validateURL(trimmed, def) {
5091
+ if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
5092
+ return canParseURL(trimmed) || URL_UNPARSEABLE;
5093
+ }
5094
+ return parseURLObject(trimmed, def);
5095
+ }
5084
5096
  function parseURLObject(trimmed, def) {
5085
5097
  if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
5086
5098
  return URL_BAD_FORMAT;
5087
5099
  }
5088
5100
  try {
5101
+ if (typeof URL !== "undefined") {
5102
+ const URLStatic = URL;
5103
+ if (typeof URLStatic.parse === "function")
5104
+ return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
5105
+ }
5089
5106
  return new URL(trimmed);
5090
5107
  } catch {
5091
5108
  return URL_UNPARSEABLE;
@@ -5108,7 +5125,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
5108
5125
  inst._zod.check = (payload) => {
5109
5126
  try {
5110
5127
  const trimmed = payload.value.trim();
5111
- const url = parseURLObject(trimmed, def);
5128
+ const url = validateURL(trimmed, def);
5112
5129
  if (url === URL_BAD_FORMAT) {
5113
5130
  payload.issues.push({
5114
5131
  code: "invalid_format",
@@ -5130,6 +5147,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
5130
5147
  });
5131
5148
  return;
5132
5149
  }
5150
+ if (url === true) {
5151
+ payload.value = stripTabAndNewline(trimmed);
5152
+ return;
5153
+ }
5133
5154
  if (def.hostname && !urlHostnameOk(url, def.hostname)) {
5134
5155
  payload.issues.push({
5135
5156
  code: "invalid_format",
@@ -5219,12 +5240,7 @@ var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
5219
5240
  function isValidIPv6(value) {
5220
5241
  if (!ipv6Alphabet.test(value))
5221
5242
  return false;
5222
- try {
5223
- new URL(`http://[${value}]`);
5224
- return true;
5225
- } catch {
5226
- return false;
5227
- }
5243
+ return canParseURL(`http://[${value}]`);
5228
5244
  }
5229
5245
  var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
5230
5246
  def.pattern ?? (def.pattern = ipv6);
@@ -6408,62 +6424,7 @@ function handleRefineResult(result, payload, input, inst) {
6408
6424
  payload.issues.push(issue(_iss));
6409
6425
  }
6410
6426
  }
6411
- function handlePropertiesResult(result, payload, key) {
6412
- if (result.issues.length) {
6413
- payload.issues.push(...prefixIssues(key, result.issues));
6414
- }
6415
- }
6416
- var $ZodProperties = /* @__PURE__ */ $constructor("$ZodProperties", (inst, def) => {
6417
- $ZodType.init(inst, def);
6418
- $ZodCheck.init(inst, def);
6419
- const memo = globalConfig.memoizer;
6420
- memo?.attach(inst);
6421
- let entries;
6422
- const runShape = (payload, ctx) => {
6423
- entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
6424
- const input = payload.value;
6425
- let proms;
6426
- for (const [key, schema] of entries) {
6427
- const result = schema._zod.run({ value: input[key], issues: [] }, ctx);
6428
- if (result instanceof Promise) {
6429
- proms ?? (proms = []);
6430
- proms.push(result.then((result) => handlePropertiesResult(result, payload, key)));
6431
- } else {
6432
- handlePropertiesResult(result, payload, key);
6433
- }
6434
- }
6435
- if (proms)
6436
- return Promise.all(proms).then(() => {
6437
- return;
6438
- });
6439
- return;
6440
- };
6441
- inst._zod.parse = (payload, ctx) => {
6442
- const input = payload.value;
6443
- if (input === null || typeof input !== "object" && typeof input !== "function") {
6444
- payload.issues.push({ expected: "object", code: "invalid_type", input, inst });
6445
- return payload;
6446
- }
6447
- if (ctx.direction === "backward")
6448
- ctx = { ...ctx, direction: "forward" };
6449
- if (memo)
6450
- memo.alloc(inst, payload, input, ctx);
6451
- const result = runShape(payload, ctx);
6452
- return result instanceof Promise ? result.then(() => payload) : payload;
6453
- };
6454
- inst._zod.check = (payload) => {
6455
- if (payload.value == null) {
6456
- payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
6457
- return;
6458
- }
6459
- return runShape(payload, {});
6460
- };
6461
- }, {
6462
- *[Symbol.iterator]() {
6463
- yield this;
6464
- }
6465
- });
6466
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/memoizer.js
6427
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/memoizer.js
6467
6428
  class $ZodCyclicError extends Error {
6468
6429
  constructor() {
6469
6430
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -6473,7 +6434,7 @@ class $ZodCyclicError extends Error {
6473
6434
  var STATE = "~memo";
6474
6435
  var NO_ISSUES = [];
6475
6436
  function isRef(value) {
6476
- return value !== null && (typeof value === "object" || typeof value === "function");
6437
+ return value !== null && typeof value === "object";
6477
6438
  }
6478
6439
  function cloneIssues(issues) {
6479
6440
  return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
@@ -6522,9 +6483,6 @@ function isRecursive(inst, stack, resolve) {
6522
6483
  check(def.catchall);
6523
6484
  break;
6524
6485
  }
6525
- case "properties":
6526
- merge(shape(def.shape, false));
6527
- break;
6528
6486
  case "array":
6529
6487
  check(def.element);
6530
6488
  break;
@@ -6735,7 +6693,7 @@ function isBackEdge(ctx, value) {
6735
6693
  const backEdges = ctx[STATE]?.backEdges;
6736
6694
  return backEdges !== undefined && isRef(value) && backEdges.has(value);
6737
6695
  }
6738
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/locales/en.js
6696
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/locales/en.js
6739
6697
  var error = () => {
6740
6698
  const Sizable = {
6741
6699
  string: { unit: "characters", verb: "to have" },
@@ -6775,6 +6733,7 @@ var error = () => {
6775
6733
  base64url: "base64url-encoded string",
6776
6734
  json_string: "JSON string",
6777
6735
  e164: "E.164 number",
6736
+ currency_code: "currency code",
6778
6737
  credit_card: "credit card number",
6779
6738
  iban: "IBAN",
6780
6739
  jwt: "JWT",
@@ -6856,7 +6815,7 @@ function en_default() {
6856
6815
  localeError: error()
6857
6816
  };
6858
6817
  }
6859
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/registries.js
6818
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/registries.js
6860
6819
  var _a2;
6861
6820
  class $ZodRegistry {
6862
6821
  constructor() {
@@ -6903,12 +6862,14 @@ function registry() {
6903
6862
  }
6904
6863
  (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
6905
6864
  var globalRegistry = globalThis.__zod_globalRegistry;
6906
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/api.js
6865
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/api.js
6866
+ function snapshotChecks(def) {
6867
+ if (def.checks)
6868
+ def.checks = [...def.checks];
6869
+ return def;
6870
+ }
6907
6871
  function _string(Class, params) {
6908
- return new Class({
6909
- type: "string",
6910
- ...normalizeParams(params)
6911
- });
6872
+ return new Class(snapshotChecks({ type: "string", ...normalizeParams(params) }));
6912
6873
  }
6913
6874
  function _email(Class, params) {
6914
6875
  return new Class({
@@ -7148,11 +7109,7 @@ function _isoDuration(Class, params) {
7148
7109
  });
7149
7110
  }
7150
7111
  function _number(Class, params) {
7151
- return new Class({
7152
- type: "number",
7153
- checks: [],
7154
- ...normalizeParams(params)
7155
- });
7112
+ return new Class(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
7156
7113
  }
7157
7114
  function _int(Class, params) {
7158
7115
  return new Class({
@@ -7353,7 +7310,7 @@ function _check(fn, params) {
7353
7310
  ch._zod.check = fn;
7354
7311
  return ch;
7355
7312
  }
7356
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/to-json-schema.js
7313
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/to-json-schema.js
7357
7314
  function assignProps(target, ...sources) {
7358
7315
  for (const source of sources) {
7359
7316
  for (const key of Reflect.ownKeys(source)) {
@@ -7876,7 +7833,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
7876
7833
  extractDefs(ctx, schema);
7877
7834
  return finalize(ctx, schema);
7878
7835
  };
7879
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/json-schema-processors.js
7836
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/json-schema-processors.js
7880
7837
  var narrowMin = (agg, key, value) => {
7881
7838
  if (agg[key] === undefined || value > agg[key])
7882
7839
  agg[key] = value;
@@ -8156,17 +8113,15 @@ var objectProcessor = (schema, ctx, _json, params) => {
8156
8113
  path: [...params.path, "properties", key]
8157
8114
  }));
8158
8115
  }
8159
- const allKeys = new Set(Object.keys(shape));
8160
- const requiredKeys = new Set([...allKeys].filter((key) => {
8116
+ const requiredKeys = [];
8117
+ for (const key of Object.keys(shape)) {
8161
8118
  const field = def.shape[key];
8162
- if (ctx.io === "input") {
8163
- return inputOptin(field) === undefined;
8164
- } else {
8165
- return field._zod.optout === undefined;
8119
+ if (ctx.io === "input" ? inputOptin(field) === undefined : field._zod.optout === undefined) {
8120
+ requiredKeys.push(key);
8166
8121
  }
8167
- }));
8168
- if (requiredKeys.size > 0) {
8169
- json.required = Array.from(requiredKeys);
8122
+ }
8123
+ if (requiredKeys.length > 0) {
8124
+ json.required = requiredKeys;
8170
8125
  }
8171
8126
  if (def.catchall?._zod.def.type === "never") {
8172
8127
  json.additionalProperties = false;
@@ -8403,7 +8358,7 @@ var optionalProcessor = (schema, ctx, _json, params) => {
8403
8358
  const seen = ctx.seen.get(schema);
8404
8359
  seen.ref = def.innerType;
8405
8360
  };
8406
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/classic/errors.js
8361
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/errors.js
8407
8362
  var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
8408
8363
  function _lazyMethod(proto, key, make) {
8409
8364
  Object.defineProperty(proto, key, {
@@ -8448,7 +8403,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, undefi
8448
8403
  Parent: Error
8449
8404
  });
8450
8405
 
8451
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/classic/parse.js
8406
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/parse.js
8452
8407
  var parse2 = /* @__PURE__ */ _parse(ZodRealError);
8453
8408
  var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
8454
8409
  var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -8462,7 +8417,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
8462
8417
  var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
8463
8418
  var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
8464
8419
 
8465
- // node_modules/.bun/zod@4.6.2/node_modules/zod/v4/classic/schemas.js
8420
+ // node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/schemas.js
8466
8421
  function _ensureDefaultLocale() {
8467
8422
  if (!globalConfig.localeError)
8468
8423
  config(en_default());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fro.bot/systematic",
3
- "version": "3.18.3",
3
+ "version": "3.18.5",
4
4
  "description": "Compound-engineering loops for OpenCode, Pi, and Claude Code",
5
5
  "type": "module",
6
6
  "homepage": "https://fro.bot/systematic",
@@ -122,7 +122,7 @@
122
122
  "jsonc-parser": "^3.3.0",
123
123
  "tree-sitter-bash": "0.25.1",
124
124
  "web-tree-sitter": "0.27.0",
125
- "zod": "4.6.2"
125
+ "zod": "4.6.4"
126
126
  },
127
127
  "overrides": {
128
128
  "@earendil-works/pi-ai": "0.83.0",