@workit-dev/opencode 2.7.2 → 2.8.1
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 +25 -7
- package/package.json +2 -2
package/dist/plugin.js
CHANGED
|
@@ -16980,6 +16980,7 @@ function activeStanding(rows, fanout, leads = null) {
|
|
|
16980
16980
|
}
|
|
16981
16981
|
return active;
|
|
16982
16982
|
}
|
|
16983
|
+
var CHECKED_RESULTS = new Set(["verified", "tests-verified"]);
|
|
16983
16984
|
var OBSERVED_ONLY = new Set([
|
|
16984
16985
|
"check",
|
|
16985
16986
|
"merge.unverified",
|
|
@@ -25232,17 +25233,34 @@ var opencodePermission = (permission, rules) => {
|
|
|
25232
25233
|
}
|
|
25233
25234
|
return true;
|
|
25234
25235
|
};
|
|
25235
|
-
var
|
|
25236
|
-
|
|
25237
|
-
|
|
25238
|
-
if (
|
|
25236
|
+
var EFFECTS = new Set(["allow", "ask", "deny"]);
|
|
25237
|
+
var actionMatches = (pattern, action) => new RegExp(`^${pattern.split("").map((char) => char === "*" ? ".*" : char === "?" ? "." : char.replace(/[.+^${}()|[\]\\]/u, "\\$&")).join("")}$`, "su").test(action);
|
|
25238
|
+
var opencodeRuleset = (ruleset, rules) => {
|
|
25239
|
+
if (ruleset === undefined)
|
|
25240
|
+
return true;
|
|
25241
|
+
if (!Array.isArray(ruleset))
|
|
25239
25242
|
return false;
|
|
25240
|
-
|
|
25243
|
+
for (const rule of ruleset) {
|
|
25244
|
+
if (!isRecord5(rule))
|
|
25245
|
+
return false;
|
|
25246
|
+
const { action, resource, effect } = rule;
|
|
25247
|
+
if (typeof action !== "string" || typeof resource !== "string")
|
|
25248
|
+
return false;
|
|
25249
|
+
if (typeof effect !== "string" || !EFFECTS.has(effect))
|
|
25250
|
+
return false;
|
|
25251
|
+
if (actionMatches(action, "shell"))
|
|
25252
|
+
(effect === "allow" ? rules.allow : rules.deny).push(resource);
|
|
25253
|
+
}
|
|
25254
|
+
return true;
|
|
25255
|
+
};
|
|
25256
|
+
var opencodeAgents = (agents, read) => {
|
|
25257
|
+
if (agents === undefined)
|
|
25241
25258
|
return true;
|
|
25242
|
-
if (!isRecord5(
|
|
25259
|
+
if (!isRecord5(agents))
|
|
25243
25260
|
return false;
|
|
25244
|
-
return Object.values(
|
|
25261
|
+
return Object.values(agents).every((agent) => isRecord5(agent) && read(agent));
|
|
25245
25262
|
};
|
|
25263
|
+
var opencodeConfig = (value, rules) => isRecord5(value) && opencodeRuleset(value.permissions, rules) && opencodePermission(value.permission, rules) && opencodeAgents(value.agents, (agent) => opencodeRuleset(agent.permissions, rules)) && opencodeAgents(value.agent, (agent) => opencodePermission(agent.permission, rules));
|
|
25246
25264
|
function opencodeRules(cwd, env = process.env) {
|
|
25247
25265
|
const rules = EMPTY2();
|
|
25248
25266
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/opencode",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.1",
|
|
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.
|
|
44
|
+
"@workit-dev/core": "^2.8.1"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=24"
|