@workit-dev/opencode 2.20.3 → 2.20.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.
- package/dist/plugin.js +31 -4
- package/package.json +2 -2
package/dist/plugin.js
CHANGED
|
@@ -14578,6 +14578,8 @@ function repoHeavyCommands(root) {
|
|
|
14578
14578
|
return [];
|
|
14579
14579
|
}
|
|
14580
14580
|
}
|
|
14581
|
+
var CHECK_HEAVY = [true, "io"];
|
|
14582
|
+
var CHECK_KEYS = ["command", "heavy"];
|
|
14581
14583
|
var isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14582
14584
|
var SHELL_META = /[|&;<>()$`\\*?[\]{}~!#]/u;
|
|
14583
14585
|
function splitCommand(command) {
|
|
@@ -14774,10 +14776,10 @@ function loadCheckConfig(cwd) {
|
|
|
14774
14776
|
for (const [name, value] of Object.entries(parsed.checks)) {
|
|
14775
14777
|
if (!CHECK_NAME.test(name))
|
|
14776
14778
|
return none(`${label}: check name "${name}" must match ${CHECK_NAME.source}`);
|
|
14777
|
-
const
|
|
14778
|
-
if (
|
|
14779
|
-
return none(`${label}: check "${name}": ${
|
|
14780
|
-
checks.push({ name, argv, accepts: [argv] });
|
|
14779
|
+
const check = checkEntry(value);
|
|
14780
|
+
if (check instanceof Error)
|
|
14781
|
+
return none(`${label}: check "${name}": ${check.message}`);
|
|
14782
|
+
checks.push({ name, argv: check.argv, accepts: [check.argv], ...check.heavy });
|
|
14781
14783
|
}
|
|
14782
14784
|
const gates = {};
|
|
14783
14785
|
if (parsed.gates !== undefined) {
|
|
@@ -14821,6 +14823,31 @@ function loadCheckConfig(cwd) {
|
|
|
14821
14823
|
regenerable
|
|
14822
14824
|
};
|
|
14823
14825
|
}
|
|
14826
|
+
function commandArgv(value) {
|
|
14827
|
+
if (typeof value === "string")
|
|
14828
|
+
return splitCommand(value);
|
|
14829
|
+
return Array.isArray(value) && value.length > 0 && value.every((item) => typeof item === "string" && item.length > 0) ? value : new Error("expected a command string or a non-empty argv array");
|
|
14830
|
+
}
|
|
14831
|
+
function checkEntry(value) {
|
|
14832
|
+
if (!isRecord2(value)) {
|
|
14833
|
+
const argv = commandArgv(value);
|
|
14834
|
+
return argv instanceof Error ? argv : { argv, heavy: {} };
|
|
14835
|
+
}
|
|
14836
|
+
const unknown = Object.keys(value).find((key) => !CHECK_KEYS.includes(key));
|
|
14837
|
+
if (unknown)
|
|
14838
|
+
return new Error(`"${unknown}" is not a check setting (use ${CHECK_KEYS.join(" or ")})`);
|
|
14839
|
+
if (value.command === undefined)
|
|
14840
|
+
return new Error('needs "command": a command string or a non-empty argv array');
|
|
14841
|
+
const argv = commandArgv(value.command);
|
|
14842
|
+
if (argv instanceof Error)
|
|
14843
|
+
return new Error(`command: ${argv.message}`);
|
|
14844
|
+
if (value.heavy === undefined)
|
|
14845
|
+
return { argv, heavy: {} };
|
|
14846
|
+
const heavy = CHECK_HEAVY.find((allowed) => allowed === value.heavy);
|
|
14847
|
+
if (heavy === undefined)
|
|
14848
|
+
return new Error(`heavy must be ${CHECK_HEAVY.map((allowed) => JSON.stringify(allowed)).join(" or ")}, not ${JSON.stringify(value.heavy)}`);
|
|
14849
|
+
return { argv, heavy: { heavy } };
|
|
14850
|
+
}
|
|
14824
14851
|
var sameArgv = (left, right) => left.length === right.length && left.every((item, index) => item === right[index]);
|
|
14825
14852
|
function matchesNamedCheck(config, name, argv, cwd) {
|
|
14826
14853
|
if (config.error || name === null || cwd !== ".")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/opencode",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@opencode/plugin": "2.0.18",
|
|
44
|
-
"@workit-dev/core": "^2.20.
|
|
44
|
+
"@workit-dev/core": "^2.20.5"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=24"
|