@workit-dev/opencode 2.21.1 → 2.21.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 +38 -2
- package/package.json +3 -3
package/dist/plugin.js
CHANGED
|
@@ -535,6 +535,18 @@ function prefixIssues(path, issues) {
|
|
|
535
535
|
function unwrapMessage(message) {
|
|
536
536
|
return typeof message === "string" ? message : message?.message;
|
|
537
537
|
}
|
|
538
|
+
function sizeCaps(defChecks) {
|
|
539
|
+
const caps = [];
|
|
540
|
+
for (const ch of defChecks ?? []) {
|
|
541
|
+
const d = ch._zod.def;
|
|
542
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
543
|
+
break;
|
|
544
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
545
|
+
if (max >= 0)
|
|
546
|
+
caps.push([max, ch]);
|
|
547
|
+
}
|
|
548
|
+
return caps;
|
|
549
|
+
}
|
|
538
550
|
function attachSchema(issues, start, inst) {
|
|
539
551
|
var _a;
|
|
540
552
|
for (let i = start;i < issues.length; i++) {
|
|
@@ -1532,7 +1544,7 @@ ${content.join(`
|
|
|
1532
1544
|
var version = {
|
|
1533
1545
|
major: 4,
|
|
1534
1546
|
minor: 6,
|
|
1535
|
-
patch:
|
|
1547
|
+
patch: 7
|
|
1536
1548
|
};
|
|
1537
1549
|
|
|
1538
1550
|
// node_modules/zod/v4/core/schemas.js
|
|
@@ -2084,6 +2096,29 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
2084
2096
|
return payload;
|
|
2085
2097
|
};
|
|
2086
2098
|
});
|
|
2099
|
+
function capSize(inst, size) {
|
|
2100
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
2101
|
+
if (!caps.length)
|
|
2102
|
+
return;
|
|
2103
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
2104
|
+
const parse = inst._zod.parse;
|
|
2105
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2106
|
+
const n = size(payload.value);
|
|
2107
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
2108
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
2109
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
2110
|
+
const start = payload.issues.length;
|
|
2111
|
+
ch._zod.check(payload);
|
|
2112
|
+
payload.issues[start].continue = false;
|
|
2113
|
+
attachSchema(payload.issues, start, inst);
|
|
2114
|
+
return payload;
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
return parse(payload, ctx);
|
|
2119
|
+
};
|
|
2120
|
+
}
|
|
2121
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
2087
2122
|
function handleArrayResult(result, final, index) {
|
|
2088
2123
|
if (result.issues.length) {
|
|
2089
2124
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -2127,6 +2162,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
2127
2162
|
}
|
|
2128
2163
|
return payload;
|
|
2129
2164
|
};
|
|
2165
|
+
capSize(inst, arraySize);
|
|
2130
2166
|
});
|
|
2131
2167
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
2132
2168
|
const isPresent = key in input;
|
|
@@ -11942,7 +11978,7 @@ function normalizeMaxBytes(value, options = {}) {
|
|
|
11942
11978
|
if (selected === undefined || selected === Number.POSITIVE_INFINITY)
|
|
11943
11979
|
return selected;
|
|
11944
11980
|
if (!Number.isSafeInteger(selected) || selected < 0) {
|
|
11945
|
-
throw new RangeError(
|
|
11981
|
+
throw new RangeError("maxBytes must be a non-negative safe integer or Infinity");
|
|
11946
11982
|
}
|
|
11947
11983
|
return selected;
|
|
11948
11984
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/opencode",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"typecheck": "tsc --noEmit"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@opencode/plugin": "2.
|
|
44
|
-
"@workit-dev/core": "^2.21.
|
|
43
|
+
"@opencode/plugin": "2.3.2",
|
|
44
|
+
"@workit-dev/core": "^2.21.2"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=24"
|