@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.
- package/DEVIATIONS.md +148 -31
- package/README.md +40 -14
- package/UPSTREAM.json +10 -10
- package/dist/antigravity-hook.js +13 -8
- package/dist/antigravity-statusline.js +1 -1
- package/dist/antigravity-stop-hook.js +13 -8
- package/dist/claude-hook.js +13 -8
- package/dist/claude-sessionstart-hook.js +13 -8
- package/dist/claude-stop-hook.js +13 -8
- package/dist/cline.js +51 -2
- package/dist/codebuddy-hook.js +13 -8
- package/dist/codebuddy-sessionstart-hook.js +13 -8
- package/dist/codebuddy-stop-hook.js +13 -8
- package/dist/codex-hook.js +13 -8
- package/dist/codex-sessionstart-hook.js +13 -8
- package/dist/codex-stop-hook.js +13 -8
- package/dist/copilot-hook.js +13 -8
- package/dist/copilot-sessionstart-hook.js +13 -8
- package/dist/copilot-stop-hook.js +13 -8
- package/dist/cursor-hook.js +13 -8
- package/dist/cursor-sessionstart-hook.js +13 -8
- package/dist/cursor-stop-hook.js +13 -8
- package/dist/dcode-hook.js +13 -8
- package/dist/dcode-sessionstart-hook.js +13 -8
- package/dist/dcode-stop-hook.js +13 -8
- package/dist/deepen.js +7 -3
- package/dist/devin-hook.js +13 -8
- package/dist/devin-sessionstart-hook.js +13 -8
- package/dist/devin-stop-hook.js +13 -8
- package/dist/droid-hook.js +13 -8
- package/dist/droid-sessionstart-hook.js +13 -8
- package/dist/droid-stop-hook.js +13 -8
- package/dist/dsh.js +51 -2
- package/dist/grok-hook.js +13 -8
- package/dist/grok-sessionstart-hook.js +13 -8
- package/dist/grok-stop-hook.js +13 -8
- package/dist/hindsight-seed.js +1 -1
- package/dist/index.js +51 -2
- package/dist/installer.js +13 -8
- package/dist/kilo.js +51 -2
- package/dist/kimi-hook.js +13 -8
- package/dist/kimi-sessionstart-hook.js +13 -8
- package/dist/kimi-stop-hook.js +13 -8
- package/dist/mcp-server.js +51 -2
- package/dist/opencode2.js +51 -2
- package/dist/pi.js +51 -2
- package/dist/prime-agent.js +51 -2
- package/dist/qwen-hook.js +13 -8
- package/dist/qwen-sessionstart-hook.js +13 -8
- package/dist/qwen-stop-hook.js +13 -8
- package/dist/status.js +1 -1
- package/dist/traecode-hook.js +13 -8
- package/dist/traecode-sessionstart-hook.js +13 -8
- package/dist/traecode-stop-hook.js +13 -8
- package/dist/workbuddy-hook.js +13 -8
- package/dist/workbuddy-sessionstart-hook.js +13 -8
- package/dist/workbuddy-stop-hook.js +13 -8
- package/dist/zcode-hook.js +13 -8
- package/dist/zcode-sessionstart-hook.js +13 -8
- package/dist/zcode-stop-hook.js +13 -8
- package/npm-shrinkwrap.json +730 -328
- package/package.json +10 -9
- package/plugin.json +1 -1
- package/skill/SKILL.md +113 -106
|
@@ -1348,7 +1348,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
|
|
|
1348
1348
|
];
|
|
1349
1349
|
|
|
1350
1350
|
// package.json
|
|
1351
|
-
var version = "0.8.
|
|
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
|
|
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
|
-
|
|
2933
|
+
const chunk = decoder.write(buffer.subarray(0, bytesRead));
|
|
2934
|
+
let start = 0;
|
|
2934
2935
|
let newline;
|
|
2935
|
-
while ((newline =
|
|
2936
|
-
|
|
2937
|
-
|
|
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
|
-
|
|
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:
|
|
5268
|
+
patch: 7
|
|
5264
5269
|
};
|
|
5265
5270
|
|
|
5266
5271
|
// node_modules/zod/v4/core/schemas.js
|
package/dist/kimi-stop-hook.js
CHANGED
|
@@ -1214,7 +1214,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
|
|
|
1214
1214
|
];
|
|
1215
1215
|
|
|
1216
1216
|
// package.json
|
|
1217
|
-
var version = "0.8.
|
|
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
|
|
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
|
-
|
|
3151
|
+
const chunk = decoder.write(buffer.subarray(0, bytesRead));
|
|
3152
|
+
let start = 0;
|
|
3152
3153
|
let newline;
|
|
3153
|
-
while ((newline =
|
|
3154
|
-
|
|
3155
|
-
|
|
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
|
-
|
|
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:
|
|
4778
|
+
patch: 7
|
|
4774
4779
|
};
|
|
4775
4780
|
|
|
4776
4781
|
// node_modules/zod/v4/core/schemas.js
|
package/dist/mcp-server.js
CHANGED
|
@@ -11600,6 +11600,7 @@ __export(util_exports, {
|
|
|
11600
11600
|
required: () => required,
|
|
11601
11601
|
safeExtend: () => safeExtend,
|
|
11602
11602
|
shallowClone: () => shallowClone,
|
|
11603
|
+
sizeCaps: () => sizeCaps,
|
|
11603
11604
|
slugify: () => slugify,
|
|
11604
11605
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
11605
11606
|
toZod: () => toZod,
|
|
@@ -12119,6 +12120,18 @@ function prefixIssues(path, issues) {
|
|
|
12119
12120
|
function unwrapMessage(message) {
|
|
12120
12121
|
return typeof message === "string" ? message : message?.message;
|
|
12121
12122
|
}
|
|
12123
|
+
function sizeCaps(defChecks) {
|
|
12124
|
+
const caps = [];
|
|
12125
|
+
for (const ch of defChecks ?? []) {
|
|
12126
|
+
const d = ch._zod.def;
|
|
12127
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
12128
|
+
break;
|
|
12129
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
12130
|
+
if (max >= 0)
|
|
12131
|
+
caps.push([max, ch]);
|
|
12132
|
+
}
|
|
12133
|
+
return caps;
|
|
12134
|
+
}
|
|
12122
12135
|
function attachSchema(issues, start, inst) {
|
|
12123
12136
|
var _a3;
|
|
12124
12137
|
for (let i = start; i < issues.length; i++) {
|
|
@@ -13539,7 +13552,7 @@ ${content.join("\n")}
|
|
|
13539
13552
|
var version = {
|
|
13540
13553
|
major: 4,
|
|
13541
13554
|
minor: 6,
|
|
13542
|
-
patch:
|
|
13555
|
+
patch: 7
|
|
13543
13556
|
};
|
|
13544
13557
|
|
|
13545
13558
|
// node_modules/zod/v4/core/schemas.js
|
|
@@ -14295,6 +14308,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
14295
14308
|
return payload;
|
|
14296
14309
|
};
|
|
14297
14310
|
});
|
|
14311
|
+
function capSize(inst, size) {
|
|
14312
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
14313
|
+
if (!caps.length)
|
|
14314
|
+
return;
|
|
14315
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
14316
|
+
const parse3 = inst._zod.parse;
|
|
14317
|
+
inst._zod.parse = (payload, ctx) => {
|
|
14318
|
+
const n = size(payload.value);
|
|
14319
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
14320
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
14321
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
14322
|
+
const start = payload.issues.length;
|
|
14323
|
+
ch._zod.check(payload);
|
|
14324
|
+
payload.issues[start].continue = false;
|
|
14325
|
+
attachSchema(payload.issues, start, inst);
|
|
14326
|
+
return payload;
|
|
14327
|
+
}
|
|
14328
|
+
}
|
|
14329
|
+
}
|
|
14330
|
+
return parse3(payload, ctx);
|
|
14331
|
+
};
|
|
14332
|
+
}
|
|
14333
|
+
var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
|
|
14334
|
+
var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
|
|
14335
|
+
var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
|
|
14298
14336
|
function handleArrayResult(result, final, index) {
|
|
14299
14337
|
if (result.issues.length) {
|
|
14300
14338
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -14338,6 +14376,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
14338
14376
|
}
|
|
14339
14377
|
return payload;
|
|
14340
14378
|
};
|
|
14379
|
+
capSize(inst, arraySize);
|
|
14341
14380
|
});
|
|
14342
14381
|
function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
14343
14382
|
const isPresent = key in input2;
|
|
@@ -15294,6 +15333,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
15294
15333
|
return Promise.all(proms).then(() => payload);
|
|
15295
15334
|
return payload;
|
|
15296
15335
|
};
|
|
15336
|
+
capSize(inst, mapSize);
|
|
15297
15337
|
});
|
|
15298
15338
|
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
15299
15339
|
if (keyResult.issues.length) {
|
|
@@ -15360,6 +15400,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
15360
15400
|
return Promise.all(proms).then(() => payload);
|
|
15361
15401
|
return payload;
|
|
15362
15402
|
};
|
|
15403
|
+
capSize(inst, setSize);
|
|
15363
15404
|
});
|
|
15364
15405
|
function handleSetResult(result, final) {
|
|
15365
15406
|
if (result.issues.length) {
|
|
@@ -24890,9 +24931,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
24890
24931
|
doc.write(`}`);
|
|
24891
24932
|
return outputVar;
|
|
24892
24933
|
}
|
|
24934
|
+
function generateSizeGate(doc, schema, size) {
|
|
24935
|
+
for (const [max, check2] of sizeCaps(schema._zod.def.checks)) {
|
|
24936
|
+
doc.write(`if (${size} > ${numericOperand(max, check2._zod.def.check)}) return INVALID;`);
|
|
24937
|
+
}
|
|
24938
|
+
}
|
|
24893
24939
|
function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
24894
24940
|
const def = schema._zod.def;
|
|
24895
24941
|
doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
|
|
24942
|
+
generateSizeGate(doc, schema, `${accessor}.length`);
|
|
24896
24943
|
const outputVar = buildsValue ? newVar(ctx) : null;
|
|
24897
24944
|
const iVar = newVar(ctx);
|
|
24898
24945
|
const elemVar = newVar(ctx);
|
|
@@ -25292,6 +25339,7 @@ function literalPropertyKey(ctx, key) {
|
|
|
25292
25339
|
function generateMapCheck(doc, ctx, schema, accessor) {
|
|
25293
25340
|
const def = schema._zod.def;
|
|
25294
25341
|
doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
|
|
25342
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
25295
25343
|
const outputVar = newVar(ctx);
|
|
25296
25344
|
const kVar = newVar(ctx);
|
|
25297
25345
|
const valVar = newVar(ctx);
|
|
@@ -25308,6 +25356,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
|
|
|
25308
25356
|
function generateSetCheck(doc, ctx, schema, accessor) {
|
|
25309
25357
|
const def = schema._zod.def;
|
|
25310
25358
|
doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
|
|
25359
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
25311
25360
|
const outputVar = newVar(ctx);
|
|
25312
25361
|
const valVar = newVar(ctx);
|
|
25313
25362
|
doc.write(`const ${outputVar} = new Set();`);
|
|
@@ -37826,7 +37875,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
|
|
|
37826
37875
|
];
|
|
37827
37876
|
|
|
37828
37877
|
// package.json
|
|
37829
|
-
var version2 = "0.8.
|
|
37878
|
+
var version2 = "0.8.7";
|
|
37830
37879
|
|
|
37831
37880
|
// src/core/util.ts
|
|
37832
37881
|
import { accessSync, constants } from "fs";
|
package/dist/opencode2.js
CHANGED
|
@@ -1235,6 +1235,7 @@ __export(util_exports, {
|
|
|
1235
1235
|
required: () => required,
|
|
1236
1236
|
safeExtend: () => safeExtend,
|
|
1237
1237
|
shallowClone: () => shallowClone,
|
|
1238
|
+
sizeCaps: () => sizeCaps,
|
|
1238
1239
|
slugify: () => slugify,
|
|
1239
1240
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
1240
1241
|
toZod: () => toZod,
|
|
@@ -1754,6 +1755,18 @@ function prefixIssues(path, issues) {
|
|
|
1754
1755
|
function unwrapMessage(message) {
|
|
1755
1756
|
return typeof message === "string" ? message : message?.message;
|
|
1756
1757
|
}
|
|
1758
|
+
function sizeCaps(defChecks) {
|
|
1759
|
+
const caps = [];
|
|
1760
|
+
for (const ch of defChecks ?? []) {
|
|
1761
|
+
const d = ch._zod.def;
|
|
1762
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
1763
|
+
break;
|
|
1764
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
1765
|
+
if (max >= 0)
|
|
1766
|
+
caps.push([max, ch]);
|
|
1767
|
+
}
|
|
1768
|
+
return caps;
|
|
1769
|
+
}
|
|
1757
1770
|
function attachSchema(issues, start, inst) {
|
|
1758
1771
|
var _a3;
|
|
1759
1772
|
for (let i = start; i < issues.length; i++) {
|
|
@@ -3174,7 +3187,7 @@ ${content.join("\n")}
|
|
|
3174
3187
|
var version = {
|
|
3175
3188
|
major: 4,
|
|
3176
3189
|
minor: 6,
|
|
3177
|
-
patch:
|
|
3190
|
+
patch: 7
|
|
3178
3191
|
};
|
|
3179
3192
|
|
|
3180
3193
|
// node_modules/zod/v4/core/schemas.js
|
|
@@ -3930,6 +3943,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
3930
3943
|
return payload;
|
|
3931
3944
|
};
|
|
3932
3945
|
});
|
|
3946
|
+
function capSize(inst, size) {
|
|
3947
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
3948
|
+
if (!caps.length)
|
|
3949
|
+
return;
|
|
3950
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
3951
|
+
const parse5 = inst._zod.parse;
|
|
3952
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3953
|
+
const n = size(payload.value);
|
|
3954
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
3955
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
3956
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
3957
|
+
const start = payload.issues.length;
|
|
3958
|
+
ch._zod.check(payload);
|
|
3959
|
+
payload.issues[start].continue = false;
|
|
3960
|
+
attachSchema(payload.issues, start, inst);
|
|
3961
|
+
return payload;
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
}
|
|
3965
|
+
return parse5(payload, ctx);
|
|
3966
|
+
};
|
|
3967
|
+
}
|
|
3968
|
+
var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
|
|
3969
|
+
var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
|
|
3970
|
+
var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
|
|
3933
3971
|
function handleArrayResult(result, final, index) {
|
|
3934
3972
|
if (result.issues.length) {
|
|
3935
3973
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -3973,6 +4011,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3973
4011
|
}
|
|
3974
4012
|
return payload;
|
|
3975
4013
|
};
|
|
4014
|
+
capSize(inst, arraySize);
|
|
3976
4015
|
});
|
|
3977
4016
|
function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
3978
4017
|
const isPresent = key in input2;
|
|
@@ -4929,6 +4968,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
4929
4968
|
return Promise.all(proms).then(() => payload);
|
|
4930
4969
|
return payload;
|
|
4931
4970
|
};
|
|
4971
|
+
capSize(inst, mapSize);
|
|
4932
4972
|
});
|
|
4933
4973
|
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
4934
4974
|
if (keyResult.issues.length) {
|
|
@@ -4995,6 +5035,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
4995
5035
|
return Promise.all(proms).then(() => payload);
|
|
4996
5036
|
return payload;
|
|
4997
5037
|
};
|
|
5038
|
+
capSize(inst, setSize);
|
|
4998
5039
|
});
|
|
4999
5040
|
function handleSetResult(result, final) {
|
|
5000
5041
|
if (result.issues.length) {
|
|
@@ -14525,9 +14566,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
14525
14566
|
doc.write(`}`);
|
|
14526
14567
|
return outputVar;
|
|
14527
14568
|
}
|
|
14569
|
+
function generateSizeGate(doc, schema, size) {
|
|
14570
|
+
for (const [max, check3] of sizeCaps(schema._zod.def.checks)) {
|
|
14571
|
+
doc.write(`if (${size} > ${numericOperand(max, check3._zod.def.check)}) return INVALID;`);
|
|
14572
|
+
}
|
|
14573
|
+
}
|
|
14528
14574
|
function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
14529
14575
|
const def = schema._zod.def;
|
|
14530
14576
|
doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
|
|
14577
|
+
generateSizeGate(doc, schema, `${accessor}.length`);
|
|
14531
14578
|
const outputVar = buildsValue ? newVar(ctx) : null;
|
|
14532
14579
|
const iVar = newVar(ctx);
|
|
14533
14580
|
const elemVar = newVar(ctx);
|
|
@@ -14927,6 +14974,7 @@ function literalPropertyKey(ctx, key) {
|
|
|
14927
14974
|
function generateMapCheck(doc, ctx, schema, accessor) {
|
|
14928
14975
|
const def = schema._zod.def;
|
|
14929
14976
|
doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
|
|
14977
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
14930
14978
|
const outputVar = newVar(ctx);
|
|
14931
14979
|
const kVar = newVar(ctx);
|
|
14932
14980
|
const valVar = newVar(ctx);
|
|
@@ -14943,6 +14991,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
|
|
|
14943
14991
|
function generateSetCheck(doc, ctx, schema, accessor) {
|
|
14944
14992
|
const def = schema._zod.def;
|
|
14945
14993
|
doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
|
|
14994
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
14946
14995
|
const outputVar = newVar(ctx);
|
|
14947
14996
|
const valVar = newVar(ctx);
|
|
14948
14997
|
doc.write(`const ${outputVar} = new Set();`);
|
|
@@ -20990,7 +21039,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
|
|
|
20990
21039
|
];
|
|
20991
21040
|
|
|
20992
21041
|
// package.json
|
|
20993
|
-
var version2 = "0.8.
|
|
21042
|
+
var version2 = "0.8.7";
|
|
20994
21043
|
|
|
20995
21044
|
// src/core/util.ts
|
|
20996
21045
|
import { accessSync, constants } from "fs";
|
package/dist/pi.js
CHANGED
|
@@ -655,6 +655,7 @@ __export(util_exports, {
|
|
|
655
655
|
required: () => required,
|
|
656
656
|
safeExtend: () => safeExtend,
|
|
657
657
|
shallowClone: () => shallowClone,
|
|
658
|
+
sizeCaps: () => sizeCaps,
|
|
658
659
|
slugify: () => slugify,
|
|
659
660
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
660
661
|
toZod: () => toZod,
|
|
@@ -1174,6 +1175,18 @@ function prefixIssues(path, issues) {
|
|
|
1174
1175
|
function unwrapMessage(message) {
|
|
1175
1176
|
return typeof message === "string" ? message : message?.message;
|
|
1176
1177
|
}
|
|
1178
|
+
function sizeCaps(defChecks) {
|
|
1179
|
+
const caps = [];
|
|
1180
|
+
for (const ch of defChecks ?? []) {
|
|
1181
|
+
const d = ch._zod.def;
|
|
1182
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
1183
|
+
break;
|
|
1184
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
1185
|
+
if (max >= 0)
|
|
1186
|
+
caps.push([max, ch]);
|
|
1187
|
+
}
|
|
1188
|
+
return caps;
|
|
1189
|
+
}
|
|
1177
1190
|
function attachSchema(issues, start, inst) {
|
|
1178
1191
|
var _a3;
|
|
1179
1192
|
for (let i = start; i < issues.length; i++) {
|
|
@@ -2594,7 +2607,7 @@ ${content.join("\n")}
|
|
|
2594
2607
|
var version = {
|
|
2595
2608
|
major: 4,
|
|
2596
2609
|
minor: 6,
|
|
2597
|
-
patch:
|
|
2610
|
+
patch: 7
|
|
2598
2611
|
};
|
|
2599
2612
|
|
|
2600
2613
|
// node_modules/zod/v4/core/schemas.js
|
|
@@ -3350,6 +3363,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
3350
3363
|
return payload;
|
|
3351
3364
|
};
|
|
3352
3365
|
});
|
|
3366
|
+
function capSize(inst, size) {
|
|
3367
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
3368
|
+
if (!caps.length)
|
|
3369
|
+
return;
|
|
3370
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
3371
|
+
const parse3 = inst._zod.parse;
|
|
3372
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3373
|
+
const n = size(payload.value);
|
|
3374
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
3375
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
3376
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
3377
|
+
const start = payload.issues.length;
|
|
3378
|
+
ch._zod.check(payload);
|
|
3379
|
+
payload.issues[start].continue = false;
|
|
3380
|
+
attachSchema(payload.issues, start, inst);
|
|
3381
|
+
return payload;
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
return parse3(payload, ctx);
|
|
3386
|
+
};
|
|
3387
|
+
}
|
|
3388
|
+
var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
|
|
3389
|
+
var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
|
|
3390
|
+
var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
|
|
3353
3391
|
function handleArrayResult(result, final, index) {
|
|
3354
3392
|
if (result.issues.length) {
|
|
3355
3393
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -3393,6 +3431,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3393
3431
|
}
|
|
3394
3432
|
return payload;
|
|
3395
3433
|
};
|
|
3434
|
+
capSize(inst, arraySize);
|
|
3396
3435
|
});
|
|
3397
3436
|
function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
3398
3437
|
const isPresent = key in input2;
|
|
@@ -4349,6 +4388,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
4349
4388
|
return Promise.all(proms).then(() => payload);
|
|
4350
4389
|
return payload;
|
|
4351
4390
|
};
|
|
4391
|
+
capSize(inst, mapSize);
|
|
4352
4392
|
});
|
|
4353
4393
|
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
4354
4394
|
if (keyResult.issues.length) {
|
|
@@ -4415,6 +4455,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
4415
4455
|
return Promise.all(proms).then(() => payload);
|
|
4416
4456
|
return payload;
|
|
4417
4457
|
};
|
|
4458
|
+
capSize(inst, setSize);
|
|
4418
4459
|
});
|
|
4419
4460
|
function handleSetResult(result, final) {
|
|
4420
4461
|
if (result.issues.length) {
|
|
@@ -13945,9 +13986,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
13945
13986
|
doc.write(`}`);
|
|
13946
13987
|
return outputVar;
|
|
13947
13988
|
}
|
|
13989
|
+
function generateSizeGate(doc, schema, size) {
|
|
13990
|
+
for (const [max, check2] of sizeCaps(schema._zod.def.checks)) {
|
|
13991
|
+
doc.write(`if (${size} > ${numericOperand(max, check2._zod.def.check)}) return INVALID;`);
|
|
13992
|
+
}
|
|
13993
|
+
}
|
|
13948
13994
|
function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
13949
13995
|
const def = schema._zod.def;
|
|
13950
13996
|
doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
|
|
13997
|
+
generateSizeGate(doc, schema, `${accessor}.length`);
|
|
13951
13998
|
const outputVar = buildsValue ? newVar(ctx) : null;
|
|
13952
13999
|
const iVar = newVar(ctx);
|
|
13953
14000
|
const elemVar = newVar(ctx);
|
|
@@ -14347,6 +14394,7 @@ function literalPropertyKey(ctx, key) {
|
|
|
14347
14394
|
function generateMapCheck(doc, ctx, schema, accessor) {
|
|
14348
14395
|
const def = schema._zod.def;
|
|
14349
14396
|
doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
|
|
14397
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
14350
14398
|
const outputVar = newVar(ctx);
|
|
14351
14399
|
const kVar = newVar(ctx);
|
|
14352
14400
|
const valVar = newVar(ctx);
|
|
@@ -14363,6 +14411,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
|
|
|
14363
14411
|
function generateSetCheck(doc, ctx, schema, accessor) {
|
|
14364
14412
|
const def = schema._zod.def;
|
|
14365
14413
|
doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
|
|
14414
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
14366
14415
|
const outputVar = newVar(ctx);
|
|
14367
14416
|
const valVar = newVar(ctx);
|
|
14368
14417
|
doc.write(`const ${outputVar} = new Set();`);
|
|
@@ -20992,7 +21041,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
|
|
|
20992
21041
|
];
|
|
20993
21042
|
|
|
20994
21043
|
// package.json
|
|
20995
|
-
var version2 = "0.8.
|
|
21044
|
+
var version2 = "0.8.7";
|
|
20996
21045
|
|
|
20997
21046
|
// src/core/util.ts
|
|
20998
21047
|
import { accessSync, constants } from "fs";
|
package/dist/prime-agent.js
CHANGED
|
@@ -655,6 +655,7 @@ __export(util_exports, {
|
|
|
655
655
|
required: () => required,
|
|
656
656
|
safeExtend: () => safeExtend,
|
|
657
657
|
shallowClone: () => shallowClone,
|
|
658
|
+
sizeCaps: () => sizeCaps,
|
|
658
659
|
slugify: () => slugify,
|
|
659
660
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
660
661
|
toZod: () => toZod,
|
|
@@ -1174,6 +1175,18 @@ function prefixIssues(path, issues) {
|
|
|
1174
1175
|
function unwrapMessage(message) {
|
|
1175
1176
|
return typeof message === "string" ? message : message?.message;
|
|
1176
1177
|
}
|
|
1178
|
+
function sizeCaps(defChecks) {
|
|
1179
|
+
const caps = [];
|
|
1180
|
+
for (const ch of defChecks ?? []) {
|
|
1181
|
+
const d = ch._zod.def;
|
|
1182
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
1183
|
+
break;
|
|
1184
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
1185
|
+
if (max >= 0)
|
|
1186
|
+
caps.push([max, ch]);
|
|
1187
|
+
}
|
|
1188
|
+
return caps;
|
|
1189
|
+
}
|
|
1177
1190
|
function attachSchema(issues, start, inst) {
|
|
1178
1191
|
var _a3;
|
|
1179
1192
|
for (let i = start; i < issues.length; i++) {
|
|
@@ -2594,7 +2607,7 @@ ${content.join("\n")}
|
|
|
2594
2607
|
var version = {
|
|
2595
2608
|
major: 4,
|
|
2596
2609
|
minor: 6,
|
|
2597
|
-
patch:
|
|
2610
|
+
patch: 7
|
|
2598
2611
|
};
|
|
2599
2612
|
|
|
2600
2613
|
// node_modules/zod/v4/core/schemas.js
|
|
@@ -3350,6 +3363,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
3350
3363
|
return payload;
|
|
3351
3364
|
};
|
|
3352
3365
|
});
|
|
3366
|
+
function capSize(inst, size) {
|
|
3367
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
3368
|
+
if (!caps.length)
|
|
3369
|
+
return;
|
|
3370
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
3371
|
+
const parse3 = inst._zod.parse;
|
|
3372
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3373
|
+
const n = size(payload.value);
|
|
3374
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
3375
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
3376
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
3377
|
+
const start = payload.issues.length;
|
|
3378
|
+
ch._zod.check(payload);
|
|
3379
|
+
payload.issues[start].continue = false;
|
|
3380
|
+
attachSchema(payload.issues, start, inst);
|
|
3381
|
+
return payload;
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
return parse3(payload, ctx);
|
|
3386
|
+
};
|
|
3387
|
+
}
|
|
3388
|
+
var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
|
|
3389
|
+
var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
|
|
3390
|
+
var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
|
|
3353
3391
|
function handleArrayResult(result, final, index) {
|
|
3354
3392
|
if (result.issues.length) {
|
|
3355
3393
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -3393,6 +3431,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3393
3431
|
}
|
|
3394
3432
|
return payload;
|
|
3395
3433
|
};
|
|
3434
|
+
capSize(inst, arraySize);
|
|
3396
3435
|
});
|
|
3397
3436
|
function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
3398
3437
|
const isPresent = key in input2;
|
|
@@ -4349,6 +4388,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
4349
4388
|
return Promise.all(proms).then(() => payload);
|
|
4350
4389
|
return payload;
|
|
4351
4390
|
};
|
|
4391
|
+
capSize(inst, mapSize);
|
|
4352
4392
|
});
|
|
4353
4393
|
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
4354
4394
|
if (keyResult.issues.length) {
|
|
@@ -4415,6 +4455,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
4415
4455
|
return Promise.all(proms).then(() => payload);
|
|
4416
4456
|
return payload;
|
|
4417
4457
|
};
|
|
4458
|
+
capSize(inst, setSize);
|
|
4418
4459
|
});
|
|
4419
4460
|
function handleSetResult(result, final) {
|
|
4420
4461
|
if (result.issues.length) {
|
|
@@ -13945,9 +13986,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
13945
13986
|
doc.write(`}`);
|
|
13946
13987
|
return outputVar;
|
|
13947
13988
|
}
|
|
13989
|
+
function generateSizeGate(doc, schema, size) {
|
|
13990
|
+
for (const [max, check2] of sizeCaps(schema._zod.def.checks)) {
|
|
13991
|
+
doc.write(`if (${size} > ${numericOperand(max, check2._zod.def.check)}) return INVALID;`);
|
|
13992
|
+
}
|
|
13993
|
+
}
|
|
13948
13994
|
function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
13949
13995
|
const def = schema._zod.def;
|
|
13950
13996
|
doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
|
|
13997
|
+
generateSizeGate(doc, schema, `${accessor}.length`);
|
|
13951
13998
|
const outputVar = buildsValue ? newVar(ctx) : null;
|
|
13952
13999
|
const iVar = newVar(ctx);
|
|
13953
14000
|
const elemVar = newVar(ctx);
|
|
@@ -14347,6 +14394,7 @@ function literalPropertyKey(ctx, key) {
|
|
|
14347
14394
|
function generateMapCheck(doc, ctx, schema, accessor) {
|
|
14348
14395
|
const def = schema._zod.def;
|
|
14349
14396
|
doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
|
|
14397
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
14350
14398
|
const outputVar = newVar(ctx);
|
|
14351
14399
|
const kVar = newVar(ctx);
|
|
14352
14400
|
const valVar = newVar(ctx);
|
|
@@ -14363,6 +14411,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
|
|
|
14363
14411
|
function generateSetCheck(doc, ctx, schema, accessor) {
|
|
14364
14412
|
const def = schema._zod.def;
|
|
14365
14413
|
doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
|
|
14414
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
14366
14415
|
const outputVar = newVar(ctx);
|
|
14367
14416
|
const valVar = newVar(ctx);
|
|
14368
14417
|
doc.write(`const ${outputVar} = new Set();`);
|
|
@@ -20992,7 +21041,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
|
|
|
20992
21041
|
];
|
|
20993
21042
|
|
|
20994
21043
|
// package.json
|
|
20995
|
-
var version2 = "0.8.
|
|
21044
|
+
var version2 = "0.8.7";
|
|
20996
21045
|
|
|
20997
21046
|
// src/core/util.ts
|
|
20998
21047
|
import { accessSync, constants } from "fs";
|
package/dist/qwen-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.
|
|
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
|
|
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
|
-
|
|
3184
|
+
const chunk = decoder.write(buffer.subarray(0, bytesRead));
|
|
3185
|
+
let start = 0;
|
|
3185
3186
|
let newline;
|
|
3186
|
-
while ((newline =
|
|
3187
|
-
|
|
3188
|
-
|
|
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
|
-
|
|
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:
|
|
4585
|
+
patch: 7
|
|
4581
4586
|
};
|
|
4582
4587
|
|
|
4583
4588
|
// node_modules/zod/v4/core/schemas.js
|