@mickey-kras/hindsight-memory-router-coding-agents 0.8.2 → 0.8.7

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.
Files changed (64) hide show
  1. package/DEVIATIONS.md +148 -31
  2. package/README.md +40 -14
  3. package/UPSTREAM.json +10 -10
  4. package/dist/antigravity-hook.js +13 -8
  5. package/dist/antigravity-statusline.js +1 -1
  6. package/dist/antigravity-stop-hook.js +13 -8
  7. package/dist/claude-hook.js +13 -8
  8. package/dist/claude-sessionstart-hook.js +13 -8
  9. package/dist/claude-stop-hook.js +13 -8
  10. package/dist/cline.js +51 -2
  11. package/dist/codebuddy-hook.js +13 -8
  12. package/dist/codebuddy-sessionstart-hook.js +13 -8
  13. package/dist/codebuddy-stop-hook.js +13 -8
  14. package/dist/codex-hook.js +13 -8
  15. package/dist/codex-sessionstart-hook.js +13 -8
  16. package/dist/codex-stop-hook.js +13 -8
  17. package/dist/copilot-hook.js +13 -8
  18. package/dist/copilot-sessionstart-hook.js +13 -8
  19. package/dist/copilot-stop-hook.js +13 -8
  20. package/dist/cursor-hook.js +13 -8
  21. package/dist/cursor-sessionstart-hook.js +13 -8
  22. package/dist/cursor-stop-hook.js +13 -8
  23. package/dist/dcode-hook.js +13 -8
  24. package/dist/dcode-sessionstart-hook.js +13 -8
  25. package/dist/dcode-stop-hook.js +13 -8
  26. package/dist/deepen.js +7 -3
  27. package/dist/devin-hook.js +13 -8
  28. package/dist/devin-sessionstart-hook.js +13 -8
  29. package/dist/devin-stop-hook.js +13 -8
  30. package/dist/droid-hook.js +13 -8
  31. package/dist/droid-sessionstart-hook.js +13 -8
  32. package/dist/droid-stop-hook.js +13 -8
  33. package/dist/dsh.js +51 -2
  34. package/dist/grok-hook.js +13 -8
  35. package/dist/grok-sessionstart-hook.js +13 -8
  36. package/dist/grok-stop-hook.js +13 -8
  37. package/dist/hindsight-seed.js +1 -1
  38. package/dist/index.js +51 -2
  39. package/dist/installer.js +13 -8
  40. package/dist/kilo.js +51 -2
  41. package/dist/kimi-hook.js +13 -8
  42. package/dist/kimi-sessionstart-hook.js +13 -8
  43. package/dist/kimi-stop-hook.js +13 -8
  44. package/dist/mcp-server.js +51 -2
  45. package/dist/opencode2.js +51 -2
  46. package/dist/pi.js +51 -2
  47. package/dist/prime-agent.js +51 -2
  48. package/dist/qwen-hook.js +13 -8
  49. package/dist/qwen-sessionstart-hook.js +13 -8
  50. package/dist/qwen-stop-hook.js +13 -8
  51. package/dist/status.js +1 -1
  52. package/dist/traecode-hook.js +13 -8
  53. package/dist/traecode-sessionstart-hook.js +13 -8
  54. package/dist/traecode-stop-hook.js +13 -8
  55. package/dist/workbuddy-hook.js +13 -8
  56. package/dist/workbuddy-sessionstart-hook.js +13 -8
  57. package/dist/workbuddy-stop-hook.js +13 -8
  58. package/dist/zcode-hook.js +13 -8
  59. package/dist/zcode-sessionstart-hook.js +13 -8
  60. package/dist/zcode-stop-hook.js +13 -8
  61. package/npm-shrinkwrap.json +730 -328
  62. package/package.json +10 -9
  63. package/plugin.json +1 -1
  64. package/skill/SKILL.md +113 -106
package/dist/dsh.js CHANGED
@@ -1325,7 +1325,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1325
1325
  ];
1326
1326
 
1327
1327
  // package.json
1328
- var version = "0.8.2";
1328
+ var version = "0.8.7";
1329
1329
 
1330
1330
  // src/core/util.ts
1331
1331
  import { accessSync, constants } from "fs";
@@ -3513,6 +3513,7 @@ __export(util_exports, {
3513
3513
  required: () => required,
3514
3514
  safeExtend: () => safeExtend,
3515
3515
  shallowClone: () => shallowClone,
3516
+ sizeCaps: () => sizeCaps,
3516
3517
  slugify: () => slugify,
3517
3518
  stringifyPrimitive: () => stringifyPrimitive,
3518
3519
  toZod: () => toZod,
@@ -4032,6 +4033,18 @@ function prefixIssues(path, issues) {
4032
4033
  function unwrapMessage(message) {
4033
4034
  return typeof message === "string" ? message : message?.message;
4034
4035
  }
4036
+ function sizeCaps(defChecks) {
4037
+ const caps = [];
4038
+ for (const ch of defChecks ?? []) {
4039
+ const d = ch._zod.def;
4040
+ if (!/_(length|size)$|_equals$/.test(d.check))
4041
+ break;
4042
+ const max = d.maximum ?? d.length ?? d.size;
4043
+ if (max >= 0)
4044
+ caps.push([max, ch]);
4045
+ }
4046
+ return caps;
4047
+ }
4035
4048
  function attachSchema(issues, start, inst) {
4036
4049
  var _a3;
4037
4050
  for (let i = start; i < issues.length; i++) {
@@ -5452,7 +5465,7 @@ ${content.join("\n")}
5452
5465
  var version2 = {
5453
5466
  major: 4,
5454
5467
  minor: 6,
5455
- patch: 5
5468
+ patch: 7
5456
5469
  };
5457
5470
 
5458
5471
  // node_modules/zod/v4/core/schemas.js
@@ -6208,6 +6221,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
6208
6221
  return payload;
6209
6222
  };
6210
6223
  });
6224
+ function capSize(inst, size) {
6225
+ const caps = sizeCaps(inst._zod.def.checks);
6226
+ if (!caps.length)
6227
+ return;
6228
+ const cap = Math.min(...caps.map((c) => c[0]));
6229
+ const parse3 = inst._zod.parse;
6230
+ inst._zod.parse = (payload, ctx) => {
6231
+ const n = size(payload.value);
6232
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
6233
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
6234
+ if (n > max && ch._zod.def.when(payload)) {
6235
+ const start = payload.issues.length;
6236
+ ch._zod.check(payload);
6237
+ payload.issues[start].continue = false;
6238
+ attachSchema(payload.issues, start, inst);
6239
+ return payload;
6240
+ }
6241
+ }
6242
+ }
6243
+ return parse3(payload, ctx);
6244
+ };
6245
+ }
6246
+ var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
6247
+ var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
6248
+ var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
6211
6249
  function handleArrayResult(result, final, index) {
6212
6250
  if (result.issues.length) {
6213
6251
  final.issues.push(...prefixIssues(index, result.issues));
@@ -6251,6 +6289,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
6251
6289
  }
6252
6290
  return payload;
6253
6291
  };
6292
+ capSize(inst, arraySize);
6254
6293
  });
6255
6294
  function handlePropertyResult(result, final, key, input2, optin, optout) {
6256
6295
  const isPresent = key in input2;
@@ -7207,6 +7246,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
7207
7246
  return Promise.all(proms).then(() => payload);
7208
7247
  return payload;
7209
7248
  };
7249
+ capSize(inst, mapSize);
7210
7250
  });
7211
7251
  function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
7212
7252
  if (keyResult.issues.length) {
@@ -7273,6 +7313,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
7273
7313
  return Promise.all(proms).then(() => payload);
7274
7314
  return payload;
7275
7315
  };
7316
+ capSize(inst, setSize);
7276
7317
  });
7277
7318
  function handleSetResult(result, final) {
7278
7319
  if (result.issues.length) {
@@ -16803,9 +16844,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
16803
16844
  doc.write(`}`);
16804
16845
  return outputVar;
16805
16846
  }
16847
+ function generateSizeGate(doc, schema, size) {
16848
+ for (const [max, check2] of sizeCaps(schema._zod.def.checks)) {
16849
+ doc.write(`if (${size} > ${numericOperand(max, check2._zod.def.check)}) return INVALID;`);
16850
+ }
16851
+ }
16806
16852
  function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
16807
16853
  const def = schema._zod.def;
16808
16854
  doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
16855
+ generateSizeGate(doc, schema, `${accessor}.length`);
16809
16856
  const outputVar = buildsValue ? newVar(ctx) : null;
16810
16857
  const iVar = newVar(ctx);
16811
16858
  const elemVar = newVar(ctx);
@@ -17205,6 +17252,7 @@ function literalPropertyKey(ctx, key) {
17205
17252
  function generateMapCheck(doc, ctx, schema, accessor) {
17206
17253
  const def = schema._zod.def;
17207
17254
  doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
17255
+ generateSizeGate(doc, schema, `${accessor}.size`);
17208
17256
  const outputVar = newVar(ctx);
17209
17257
  const kVar = newVar(ctx);
17210
17258
  const valVar = newVar(ctx);
@@ -17221,6 +17269,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
17221
17269
  function generateSetCheck(doc, ctx, schema, accessor) {
17222
17270
  const def = schema._zod.def;
17223
17271
  doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
17272
+ generateSizeGate(doc, schema, `${accessor}.size`);
17224
17273
  const outputVar = newVar(ctx);
17225
17274
  const valVar = newVar(ctx);
17226
17275
  doc.write(`const ${outputVar} = new Set();`);
package/dist/grok-hook.js CHANGED
@@ -1277,7 +1277,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1277
1277
  ];
1278
1278
 
1279
1279
  // package.json
1280
- var version = "0.8.2";
1280
+ var version = "0.8.7";
1281
1281
 
1282
1282
  // src/core/util.ts
1283
1283
  import { accessSync, constants } from "fs";
@@ -3175,20 +3175,25 @@ function* readJsonl(path) {
3175
3175
  try {
3176
3176
  const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
3177
3177
  const decoder = new StringDecoder("utf8");
3178
- let pending = "";
3178
+ let fragments = [];
3179
3179
  let position = 0;
3180
3180
  for (; ; ) {
3181
3181
  const bytesRead = readSync2(fd, buffer, 0, buffer.length, position);
3182
3182
  if (bytesRead <= 0) break;
3183
3183
  position += bytesRead;
3184
- pending += decoder.write(buffer.subarray(0, bytesRead));
3184
+ const chunk = decoder.write(buffer.subarray(0, bytesRead));
3185
+ let start = 0;
3185
3186
  let newline;
3186
- while ((newline = pending.indexOf("\n")) !== -1) {
3187
- yield pending.slice(0, newline);
3188
- pending = pending.slice(newline + 1);
3187
+ while ((newline = chunk.indexOf("\n", start)) !== -1) {
3188
+ fragments.push(chunk.slice(start, newline));
3189
+ yield fragments.join("");
3190
+ fragments = [];
3191
+ start = newline + 1;
3189
3192
  }
3193
+ if (start < chunk.length) fragments.push(chunk.slice(start));
3190
3194
  }
3191
- pending += decoder.end();
3195
+ fragments.push(decoder.end());
3196
+ const pending = fragments.join("");
3192
3197
  if (pending) yield pending;
3193
3198
  } finally {
3194
3199
  closeSync2(fd);
@@ -4577,7 +4582,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
4577
4582
  var version2 = {
4578
4583
  major: 4,
4579
4584
  minor: 6,
4580
- patch: 5
4585
+ patch: 7
4581
4586
  };
4582
4587
 
4583
4588
  // node_modules/zod/v4/core/schemas.js
@@ -1348,7 +1348,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1348
1348
  ];
1349
1349
 
1350
1350
  // package.json
1351
- var version = "0.8.2";
1351
+ var version = "0.8.7";
1352
1352
 
1353
1353
  // src/core/util.ts
1354
1354
  import { accessSync, constants } from "fs";
@@ -2924,20 +2924,25 @@ function* readJsonl(path) {
2924
2924
  try {
2925
2925
  const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
2926
2926
  const decoder = new StringDecoder("utf8");
2927
- let pending = "";
2927
+ let fragments = [];
2928
2928
  let position = 0;
2929
2929
  for (; ; ) {
2930
2930
  const bytesRead = readSync2(fd, buffer, 0, buffer.length, position);
2931
2931
  if (bytesRead <= 0) break;
2932
2932
  position += bytesRead;
2933
- pending += decoder.write(buffer.subarray(0, bytesRead));
2933
+ const chunk = decoder.write(buffer.subarray(0, bytesRead));
2934
+ let start = 0;
2934
2935
  let newline;
2935
- while ((newline = pending.indexOf("\n")) !== -1) {
2936
- yield pending.slice(0, newline);
2937
- pending = pending.slice(newline + 1);
2936
+ while ((newline = chunk.indexOf("\n", start)) !== -1) {
2937
+ fragments.push(chunk.slice(start, newline));
2938
+ yield fragments.join("");
2939
+ fragments = [];
2940
+ start = newline + 1;
2938
2941
  }
2942
+ if (start < chunk.length) fragments.push(chunk.slice(start));
2939
2943
  }
2940
- pending += decoder.end();
2944
+ fragments.push(decoder.end());
2945
+ const pending = fragments.join("");
2941
2946
  if (pending) yield pending;
2942
2947
  } finally {
2943
2948
  closeSync2(fd);
@@ -5260,7 +5265,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
5260
5265
  var version2 = {
5261
5266
  major: 4,
5262
5267
  minor: 6,
5263
- patch: 5
5268
+ patch: 7
5264
5269
  };
5265
5270
 
5266
5271
  // node_modules/zod/v4/core/schemas.js
@@ -1214,7 +1214,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1214
1214
  ];
1215
1215
 
1216
1216
  // package.json
1217
- var version = "0.8.2";
1217
+ var version = "0.8.7";
1218
1218
 
1219
1219
  // src/core/util.ts
1220
1220
  import { accessSync, constants } from "fs";
@@ -3142,20 +3142,25 @@ function* readJsonl(path) {
3142
3142
  try {
3143
3143
  const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
3144
3144
  const decoder = new StringDecoder("utf8");
3145
- let pending = "";
3145
+ let fragments = [];
3146
3146
  let position = 0;
3147
3147
  for (; ; ) {
3148
3148
  const bytesRead = readSync2(fd, buffer, 0, buffer.length, position);
3149
3149
  if (bytesRead <= 0) break;
3150
3150
  position += bytesRead;
3151
- pending += decoder.write(buffer.subarray(0, bytesRead));
3151
+ const chunk = decoder.write(buffer.subarray(0, bytesRead));
3152
+ let start = 0;
3152
3153
  let newline;
3153
- while ((newline = pending.indexOf("\n")) !== -1) {
3154
- yield pending.slice(0, newline);
3155
- pending = pending.slice(newline + 1);
3154
+ while ((newline = chunk.indexOf("\n", start)) !== -1) {
3155
+ fragments.push(chunk.slice(start, newline));
3156
+ yield fragments.join("");
3157
+ fragments = [];
3158
+ start = newline + 1;
3156
3159
  }
3160
+ if (start < chunk.length) fragments.push(chunk.slice(start));
3157
3161
  }
3158
- pending += decoder.end();
3162
+ fragments.push(decoder.end());
3163
+ const pending = fragments.join("");
3159
3164
  if (pending) yield pending;
3160
3165
  } finally {
3161
3166
  closeSync2(fd);
@@ -4770,7 +4775,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
4770
4775
  var version2 = {
4771
4776
  major: 4,
4772
4777
  minor: 6,
4773
- patch: 5
4778
+ patch: 7
4774
4779
  };
4775
4780
 
4776
4781
  // node_modules/zod/v4/core/schemas.js
@@ -761,7 +761,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
761
761
  ];
762
762
 
763
763
  // package.json
764
- var version = "0.8.2";
764
+ var version = "0.8.7";
765
765
 
766
766
  // src/core/util.ts
767
767
  import { accessSync, constants } from "fs";
package/dist/index.js CHANGED
@@ -1334,7 +1334,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1334
1334
  ];
1335
1335
 
1336
1336
  // package.json
1337
- var version = "0.8.2";
1337
+ var version = "0.8.7";
1338
1338
 
1339
1339
  // src/core/util.ts
1340
1340
  import { accessSync, constants } from "fs";
@@ -3522,6 +3522,7 @@ __export(util_exports, {
3522
3522
  required: () => required,
3523
3523
  safeExtend: () => safeExtend,
3524
3524
  shallowClone: () => shallowClone,
3525
+ sizeCaps: () => sizeCaps,
3525
3526
  slugify: () => slugify,
3526
3527
  stringifyPrimitive: () => stringifyPrimitive,
3527
3528
  toZod: () => toZod,
@@ -4041,6 +4042,18 @@ function prefixIssues(path, issues) {
4041
4042
  function unwrapMessage(message) {
4042
4043
  return typeof message === "string" ? message : message?.message;
4043
4044
  }
4045
+ function sizeCaps(defChecks) {
4046
+ const caps = [];
4047
+ for (const ch of defChecks ?? []) {
4048
+ const d = ch._zod.def;
4049
+ if (!/_(length|size)$|_equals$/.test(d.check))
4050
+ break;
4051
+ const max = d.maximum ?? d.length ?? d.size;
4052
+ if (max >= 0)
4053
+ caps.push([max, ch]);
4054
+ }
4055
+ return caps;
4056
+ }
4044
4057
  function attachSchema(issues, start, inst) {
4045
4058
  var _a3;
4046
4059
  for (let i = start; i < issues.length; i++) {
@@ -5461,7 +5474,7 @@ ${content.join("\n")}
5461
5474
  var version2 = {
5462
5475
  major: 4,
5463
5476
  minor: 6,
5464
- patch: 5
5477
+ patch: 7
5465
5478
  };
5466
5479
 
5467
5480
  // node_modules/zod/v4/core/schemas.js
@@ -6217,6 +6230,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
6217
6230
  return payload;
6218
6231
  };
6219
6232
  });
6233
+ function capSize(inst, size) {
6234
+ const caps = sizeCaps(inst._zod.def.checks);
6235
+ if (!caps.length)
6236
+ return;
6237
+ const cap = Math.min(...caps.map((c) => c[0]));
6238
+ const parse5 = inst._zod.parse;
6239
+ inst._zod.parse = (payload, ctx) => {
6240
+ const n = size(payload.value);
6241
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
6242
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
6243
+ if (n > max && ch._zod.def.when(payload)) {
6244
+ const start = payload.issues.length;
6245
+ ch._zod.check(payload);
6246
+ payload.issues[start].continue = false;
6247
+ attachSchema(payload.issues, start, inst);
6248
+ return payload;
6249
+ }
6250
+ }
6251
+ }
6252
+ return parse5(payload, ctx);
6253
+ };
6254
+ }
6255
+ var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
6256
+ var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
6257
+ var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
6220
6258
  function handleArrayResult(result, final, index) {
6221
6259
  if (result.issues.length) {
6222
6260
  final.issues.push(...prefixIssues(index, result.issues));
@@ -6260,6 +6298,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
6260
6298
  }
6261
6299
  return payload;
6262
6300
  };
6301
+ capSize(inst, arraySize);
6263
6302
  });
6264
6303
  function handlePropertyResult(result, final, key, input2, optin, optout) {
6265
6304
  const isPresent = key in input2;
@@ -7216,6 +7255,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
7216
7255
  return Promise.all(proms).then(() => payload);
7217
7256
  return payload;
7218
7257
  };
7258
+ capSize(inst, mapSize);
7219
7259
  });
7220
7260
  function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
7221
7261
  if (keyResult.issues.length) {
@@ -7282,6 +7322,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
7282
7322
  return Promise.all(proms).then(() => payload);
7283
7323
  return payload;
7284
7324
  };
7325
+ capSize(inst, setSize);
7285
7326
  });
7286
7327
  function handleSetResult(result, final) {
7287
7328
  if (result.issues.length) {
@@ -16812,9 +16853,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
16812
16853
  doc.write(`}`);
16813
16854
  return outputVar;
16814
16855
  }
16856
+ function generateSizeGate(doc, schema, size) {
16857
+ for (const [max, check3] of sizeCaps(schema._zod.def.checks)) {
16858
+ doc.write(`if (${size} > ${numericOperand(max, check3._zod.def.check)}) return INVALID;`);
16859
+ }
16860
+ }
16815
16861
  function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
16816
16862
  const def = schema._zod.def;
16817
16863
  doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
16864
+ generateSizeGate(doc, schema, `${accessor}.length`);
16818
16865
  const outputVar = buildsValue ? newVar(ctx) : null;
16819
16866
  const iVar = newVar(ctx);
16820
16867
  const elemVar = newVar(ctx);
@@ -17214,6 +17261,7 @@ function literalPropertyKey(ctx, key) {
17214
17261
  function generateMapCheck(doc, ctx, schema, accessor) {
17215
17262
  const def = schema._zod.def;
17216
17263
  doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
17264
+ generateSizeGate(doc, schema, `${accessor}.size`);
17217
17265
  const outputVar = newVar(ctx);
17218
17266
  const kVar = newVar(ctx);
17219
17267
  const valVar = newVar(ctx);
@@ -17230,6 +17278,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
17230
17278
  function generateSetCheck(doc, ctx, schema, accessor) {
17231
17279
  const def = schema._zod.def;
17232
17280
  doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
17281
+ generateSizeGate(doc, schema, `${accessor}.size`);
17233
17282
  const outputVar = newVar(ctx);
17234
17283
  const valVar = newVar(ctx);
17235
17284
  doc.write(`const ${outputVar} = new Set();`);
package/dist/installer.js CHANGED
@@ -3407,7 +3407,7 @@ var PAGE_TAXONOMY = [
3407
3407
  var PAGE_NAMES = PAGE_TAXONOMY.map((page) => page.name);
3408
3408
 
3409
3409
  // package.json
3410
- var version = "0.8.2";
3410
+ var version = "0.8.7";
3411
3411
 
3412
3412
  // src/core/util.ts
3413
3413
  import { accessSync, constants } from "fs";
@@ -3681,20 +3681,25 @@ function* readJsonl(path) {
3681
3681
  try {
3682
3682
  const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
3683
3683
  const decoder = new StringDecoder("utf8");
3684
- let pending = "";
3684
+ let fragments = [];
3685
3685
  let position = 0;
3686
3686
  for (; ; ) {
3687
3687
  const bytesRead = readSync2(fd, buffer, 0, buffer.length, position);
3688
3688
  if (bytesRead <= 0) break;
3689
3689
  position += bytesRead;
3690
- pending += decoder.write(buffer.subarray(0, bytesRead));
3690
+ const chunk = decoder.write(buffer.subarray(0, bytesRead));
3691
+ let start = 0;
3691
3692
  let newline;
3692
- while ((newline = pending.indexOf("\n")) !== -1) {
3693
- yield pending.slice(0, newline);
3694
- pending = pending.slice(newline + 1);
3693
+ while ((newline = chunk.indexOf("\n", start)) !== -1) {
3694
+ fragments.push(chunk.slice(start, newline));
3695
+ yield fragments.join("");
3696
+ fragments = [];
3697
+ start = newline + 1;
3695
3698
  }
3699
+ if (start < chunk.length) fragments.push(chunk.slice(start));
3696
3700
  }
3697
- pending += decoder.end();
3701
+ fragments.push(decoder.end());
3702
+ const pending = fragments.join("");
3698
3703
  if (pending) yield pending;
3699
3704
  } finally {
3700
3705
  closeSync2(fd);
@@ -5392,7 +5397,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
5392
5397
  var version2 = {
5393
5398
  major: 4,
5394
5399
  minor: 6,
5395
- patch: 5
5400
+ patch: 7
5396
5401
  };
5397
5402
 
5398
5403
  // node_modules/zod/v4/core/schemas.js
package/dist/kilo.js CHANGED
@@ -1334,7 +1334,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1334
1334
  ];
1335
1335
 
1336
1336
  // package.json
1337
- var version = "0.8.2";
1337
+ var version = "0.8.7";
1338
1338
 
1339
1339
  // src/core/util.ts
1340
1340
  import { accessSync, constants } from "fs";
@@ -3522,6 +3522,7 @@ __export(util_exports, {
3522
3522
  required: () => required,
3523
3523
  safeExtend: () => safeExtend,
3524
3524
  shallowClone: () => shallowClone,
3525
+ sizeCaps: () => sizeCaps,
3525
3526
  slugify: () => slugify,
3526
3527
  stringifyPrimitive: () => stringifyPrimitive,
3527
3528
  toZod: () => toZod,
@@ -4041,6 +4042,18 @@ function prefixIssues(path, issues) {
4041
4042
  function unwrapMessage(message) {
4042
4043
  return typeof message === "string" ? message : message?.message;
4043
4044
  }
4045
+ function sizeCaps(defChecks) {
4046
+ const caps = [];
4047
+ for (const ch of defChecks ?? []) {
4048
+ const d = ch._zod.def;
4049
+ if (!/_(length|size)$|_equals$/.test(d.check))
4050
+ break;
4051
+ const max = d.maximum ?? d.length ?? d.size;
4052
+ if (max >= 0)
4053
+ caps.push([max, ch]);
4054
+ }
4055
+ return caps;
4056
+ }
4044
4057
  function attachSchema(issues, start, inst) {
4045
4058
  var _a3;
4046
4059
  for (let i = start; i < issues.length; i++) {
@@ -5461,7 +5474,7 @@ ${content.join("\n")}
5461
5474
  var version2 = {
5462
5475
  major: 4,
5463
5476
  minor: 6,
5464
- patch: 5
5477
+ patch: 7
5465
5478
  };
5466
5479
 
5467
5480
  // node_modules/zod/v4/core/schemas.js
@@ -6217,6 +6230,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
6217
6230
  return payload;
6218
6231
  };
6219
6232
  });
6233
+ function capSize(inst, size) {
6234
+ const caps = sizeCaps(inst._zod.def.checks);
6235
+ if (!caps.length)
6236
+ return;
6237
+ const cap = Math.min(...caps.map((c) => c[0]));
6238
+ const parse5 = inst._zod.parse;
6239
+ inst._zod.parse = (payload, ctx) => {
6240
+ const n = size(payload.value);
6241
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
6242
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
6243
+ if (n > max && ch._zod.def.when(payload)) {
6244
+ const start = payload.issues.length;
6245
+ ch._zod.check(payload);
6246
+ payload.issues[start].continue = false;
6247
+ attachSchema(payload.issues, start, inst);
6248
+ return payload;
6249
+ }
6250
+ }
6251
+ }
6252
+ return parse5(payload, ctx);
6253
+ };
6254
+ }
6255
+ var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
6256
+ var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
6257
+ var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
6220
6258
  function handleArrayResult(result, final, index) {
6221
6259
  if (result.issues.length) {
6222
6260
  final.issues.push(...prefixIssues(index, result.issues));
@@ -6260,6 +6298,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
6260
6298
  }
6261
6299
  return payload;
6262
6300
  };
6301
+ capSize(inst, arraySize);
6263
6302
  });
6264
6303
  function handlePropertyResult(result, final, key, input2, optin, optout) {
6265
6304
  const isPresent = key in input2;
@@ -7216,6 +7255,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
7216
7255
  return Promise.all(proms).then(() => payload);
7217
7256
  return payload;
7218
7257
  };
7258
+ capSize(inst, mapSize);
7219
7259
  });
7220
7260
  function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
7221
7261
  if (keyResult.issues.length) {
@@ -7282,6 +7322,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
7282
7322
  return Promise.all(proms).then(() => payload);
7283
7323
  return payload;
7284
7324
  };
7325
+ capSize(inst, setSize);
7285
7326
  });
7286
7327
  function handleSetResult(result, final) {
7287
7328
  if (result.issues.length) {
@@ -16812,9 +16853,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
16812
16853
  doc.write(`}`);
16813
16854
  return outputVar;
16814
16855
  }
16856
+ function generateSizeGate(doc, schema, size) {
16857
+ for (const [max, check3] of sizeCaps(schema._zod.def.checks)) {
16858
+ doc.write(`if (${size} > ${numericOperand(max, check3._zod.def.check)}) return INVALID;`);
16859
+ }
16860
+ }
16815
16861
  function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
16816
16862
  const def = schema._zod.def;
16817
16863
  doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
16864
+ generateSizeGate(doc, schema, `${accessor}.length`);
16818
16865
  const outputVar = buildsValue ? newVar(ctx) : null;
16819
16866
  const iVar = newVar(ctx);
16820
16867
  const elemVar = newVar(ctx);
@@ -17214,6 +17261,7 @@ function literalPropertyKey(ctx, key) {
17214
17261
  function generateMapCheck(doc, ctx, schema, accessor) {
17215
17262
  const def = schema._zod.def;
17216
17263
  doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
17264
+ generateSizeGate(doc, schema, `${accessor}.size`);
17217
17265
  const outputVar = newVar(ctx);
17218
17266
  const kVar = newVar(ctx);
17219
17267
  const valVar = newVar(ctx);
@@ -17230,6 +17278,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
17230
17278
  function generateSetCheck(doc, ctx, schema, accessor) {
17231
17279
  const def = schema._zod.def;
17232
17280
  doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
17281
+ generateSizeGate(doc, schema, `${accessor}.size`);
17233
17282
  const outputVar = newVar(ctx);
17234
17283
  const valVar = newVar(ctx);
17235
17284
  doc.write(`const ${outputVar} = new Set();`);
package/dist/kimi-hook.js CHANGED
@@ -1277,7 +1277,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1277
1277
  ];
1278
1278
 
1279
1279
  // package.json
1280
- var version = "0.8.2";
1280
+ var version = "0.8.7";
1281
1281
 
1282
1282
  // src/core/util.ts
1283
1283
  import { accessSync, constants } from "fs";
@@ -3175,20 +3175,25 @@ function* readJsonl(path) {
3175
3175
  try {
3176
3176
  const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
3177
3177
  const decoder = new StringDecoder("utf8");
3178
- let pending = "";
3178
+ let fragments = [];
3179
3179
  let position = 0;
3180
3180
  for (; ; ) {
3181
3181
  const bytesRead = readSync2(fd, buffer, 0, buffer.length, position);
3182
3182
  if (bytesRead <= 0) break;
3183
3183
  position += bytesRead;
3184
- pending += decoder.write(buffer.subarray(0, bytesRead));
3184
+ const chunk = decoder.write(buffer.subarray(0, bytesRead));
3185
+ let start = 0;
3185
3186
  let newline;
3186
- while ((newline = pending.indexOf("\n")) !== -1) {
3187
- yield pending.slice(0, newline);
3188
- pending = pending.slice(newline + 1);
3187
+ while ((newline = chunk.indexOf("\n", start)) !== -1) {
3188
+ fragments.push(chunk.slice(start, newline));
3189
+ yield fragments.join("");
3190
+ fragments = [];
3191
+ start = newline + 1;
3189
3192
  }
3193
+ if (start < chunk.length) fragments.push(chunk.slice(start));
3190
3194
  }
3191
- pending += decoder.end();
3195
+ fragments.push(decoder.end());
3196
+ const pending = fragments.join("");
3192
3197
  if (pending) yield pending;
3193
3198
  } finally {
3194
3199
  closeSync2(fd);
@@ -4577,7 +4582,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
4577
4582
  var version2 = {
4578
4583
  major: 4,
4579
4584
  minor: 6,
4580
- patch: 5
4585
+ patch: 7
4581
4586
  };
4582
4587
 
4583
4588
  // node_modules/zod/v4/core/schemas.js