@workit-dev/opencode 2.7.0 → 2.7.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 +36 -19
- package/package.json +2 -2
package/dist/plugin.js
CHANGED
|
@@ -26239,6 +26239,12 @@ var isConfigDir = (file) => configDirs().some((dir) => canonical4(dir) === canon
|
|
|
26239
26239
|
var isRoot = (file) => isConfigDir(file) || /^(?:issued[^\\/]*|approvals)$/.test(path41.relative(canonical4(resolveStateDir()), canonical4(file)));
|
|
26240
26240
|
var READ_CALLS = /^(?:print|log|info|warn|error|debug|puts|readdir(?:Sync)?|listdir|scandir|iterdir|glob|l?stat(?:Sync)?|exists(?:Sync)?|isdir|isfile|is_dir|is_file|access(?:Sync)?|realpath(?:Sync)?|dirname|basename|relative|str|repr|len)$/;
|
|
26241
26241
|
var MUTATING_CALLS = /^(?:renames?(?:Sync)?|move|copy(?:2|file|tree|File)?(?:Sync)?|cp(?:Sync)?|rm(?:tree|dir|Sync|dirSync)?|unlink(?:Sync)?|remove(?:dirs)?|mkdirs?(?:Sync)?|makedirs|mkdtemp(?:Sync)?|(?:sym|hard)?link(?:Sync|_to)?|write\w*|append\w*|truncate(?:Sync)?|ch(?:mod|own)(?:Sync)?|touch|open(?:Sync)?|dump|save|extractall|unpack_archive|put_contents|mv|FileUtils)$/;
|
|
26242
|
+
var SPAWNS = /subprocess|child_process|WriteStream|tempfile|sqlite|inplace|getattr|spawn|\bvm\b|Function\s*\(|FileIO|ZipFile|tarfile|shelve|FileHandler|filename\s*=|savefig|utime|ch(?:mod|own)|mkfifo|mknod|\.(?:delete|to_\w+)\s*\(|Path\b.*\.replace\(|Bun\.\$|O_(?:WR|RDW|CR|AP|TR)|(?:PYTHON|NODE_)\w*=|-r\b|--(?:require|import|[\w-]*loader)|\bos\.replace|\b(?:system|popen|exec\w*|fork|eval|shutil|(?:unlink|rename|remove)\w*)\b|\]\s*\(|\brequire\s*\(\s*(?!(['"])(?:(?![a-zA-Z]:)[\w@][^'"]*|[^'"]*\.json)\1)/;
|
|
26243
|
+
var FREE_OPEN = /\bopen\w*\s*\(\s*(?:(['"])(?![rbtUwax+]*\1)[^'"]*\1|[\w.]+)?\s*(?:,\s*(?:(['"])[rbt]*\2|encoding\s*=\s*(['"])[\w-]+\3)\s*)*\)/g;
|
|
26244
|
+
var writesIn = (text) => {
|
|
26245
|
+
const bare = text.replace(FREE_OPEN, "").replace(/std(?:out|err)\.write|(?<![fF][rR]?)(['"])(?:\\.|(?!\1)[^\\\n])*\1/g, "");
|
|
26246
|
+
return SPAWNS.test(text) || /['"]/.test(bare) || /\$\{|\\[ux]|(?:^|[(,=:;!&|?{}[\s])\/(?![/*])[^/\n]*['"]/.test(text) || [...bare.matchAll(/[\w$]+/g)].some(([word]) => !/^(?:append|copy)$/.test(word) && MUTATING_CALLS.test(word));
|
|
26247
|
+
};
|
|
26242
26248
|
var PATH_CALLS = /^(?:join|resolve|normalize|abspath|expanduser|expandvars|Path|PurePath|fspath)$/;
|
|
26243
26249
|
var rootUse = (text, at) => {
|
|
26244
26250
|
let call;
|
|
@@ -26313,11 +26319,14 @@ var shellScript2 = (words) => {
|
|
|
26313
26319
|
};
|
|
26314
26320
|
var XARGS_VALUE = /^-[IinLPdsEa]$/;
|
|
26315
26321
|
var runsWriter = (words) => {
|
|
26316
|
-
const filled = [
|
|
26322
|
+
const filled = [
|
|
26323
|
+
...words.filter((word) => word !== ";" && word !== "+").map((word) => word.includes("{}") ? "eval" : word),
|
|
26324
|
+
"eval"
|
|
26325
|
+
];
|
|
26317
26326
|
const edits = editsOf(filled);
|
|
26318
26327
|
return edits === null || edits.length > 0 || opaqueWrites(filled) !== null;
|
|
26319
26328
|
};
|
|
26320
|
-
var opaqueWrites = (input, scriptOf = (index) => input[index]) => {
|
|
26329
|
+
var opaqueWrites = (input, scriptOf = (index) => input[index], fed) => {
|
|
26321
26330
|
let words = input;
|
|
26322
26331
|
while (words.length && (PREFIXES2.has(words[0]) || /^\w+=/.test(words[0]))) {
|
|
26323
26332
|
if (words[0] === "xargs") {
|
|
@@ -26374,17 +26383,17 @@ var opaqueWrites = (input, scriptOf = (index) => input[index]) => {
|
|
|
26374
26383
|
}
|
|
26375
26384
|
const inline = (flag) => {
|
|
26376
26385
|
const at = args.findIndex((arg) => flag.test(arg));
|
|
26377
|
-
if (at < 0)
|
|
26386
|
+
if (at < 0 && (fed === undefined || !/^(?:-|\/dev\/stdin)?$/.test(scriptArgs(name, args).named ?? "")))
|
|
26378
26387
|
return null;
|
|
26379
26388
|
const runs = input.length - args.length - 1;
|
|
26380
|
-
|
|
26389
|
+
const texts = input.map((word, index) => index === runs || index < runs && !/^\w+=/.test(word) ? "" : scriptOf(index));
|
|
26390
|
+
return /^(?:python[\d.]*|node|bun)$/.test(name) && [
|
|
26391
|
+
at < 0 ? fed : texts[runs + at + 2],
|
|
26392
|
+
...texts.slice(0, runs + 1 + (at < 0 ? args.length : at))
|
|
26393
|
+
].every((text) => text !== undefined && text !== null && !writesIn(text)) ? null : [
|
|
26381
26394
|
".",
|
|
26382
|
-
...
|
|
26383
|
-
|
|
26384
|
-
return [];
|
|
26385
|
-
const text = scriptOf(index);
|
|
26386
|
-
return text === undefined ? [unknownVarTarget(word)] : pathsIn(text);
|
|
26387
|
-
})
|
|
26395
|
+
...pathsIn(fed ?? ""),
|
|
26396
|
+
...texts.flatMap((text, index) => text === undefined ? [unknownVarTarget(input[index])] : pathsIn(text))
|
|
26388
26397
|
];
|
|
26389
26398
|
};
|
|
26390
26399
|
if (name === "curl")
|
|
@@ -26507,6 +26516,7 @@ var configWrites = (rest) => {
|
|
|
26507
26516
|
named++;
|
|
26508
26517
|
return named > 1;
|
|
26509
26518
|
};
|
|
26519
|
+
var plainFetch = (rest) => /^(?:\w[\w.-]*(?: [^-+:\s][^:\s]*)?)?$/.test(rest.filter((arg) => !/^-[qv]$|^--(?:quiet|verbose)$/.test(arg)).join(" "));
|
|
26510
26520
|
var GIT_VALUE = /^(?:-[Ccbouj]|--(?:git-dir|work-tree|namespace|config-env|branch|origin|config|depth|reference(?:-if-able)?|template|separate-git-dir|upload-pack|jobs|filter|initial-branch|object-format))$/;
|
|
26511
26521
|
var gitOutputs = (args) => {
|
|
26512
26522
|
let at = 0;
|
|
@@ -26548,7 +26558,7 @@ var gitOutputs = (args) => {
|
|
|
26548
26558
|
if (sub === "config" && configWrites(rest))
|
|
26549
26559
|
files.push(has(/^--global$/) ? "~/.gitconfig" : has(/^--system$/) ? "/etc/gitconfig" : valueOf(rest, /^(?:-f|--file=?)(.*)$/s) ?? ".");
|
|
26550
26560
|
const branchWrite = has(/^-[a-zA-Z]*[dDfmMcCu]|^--(?:delete|force|move|copy|set-upstream|unset-upstream|edit)/) || names.length > 0 && !has(/^-[a-zA-Z]*[lavr]|^--(?:list|all|remotes|verbose|show|contains|no-contains|merged|no-merged|points-at|format|sort)/);
|
|
26551
|
-
if (sub === "fetch" || sub === "gc" || sub === "branch" && branchWrite)
|
|
26561
|
+
if (sub === "fetch" && !plainFetch(rest) || sub === "gc" || sub === "branch" && branchWrite)
|
|
26552
26562
|
files.push(".");
|
|
26553
26563
|
if (base === undefined)
|
|
26554
26564
|
return files.length ? files : null;
|
|
@@ -26976,6 +26986,8 @@ var segmentTargets = (cwd, command, dialect, depth = 0, strict = false, inherite
|
|
|
26976
26986
|
const made = mktempPath(value, dir);
|
|
26977
26987
|
if (made !== null)
|
|
26978
26988
|
return made;
|
|
26989
|
+
if (/^(?:\$\(\s*pwd\s*\)|`pwd`)$/.test(value) && !redefined && dir !== UNKNOWN_DIR)
|
|
26990
|
+
return dir ?? null;
|
|
26979
26991
|
const all = expansions(value, vars, loops).map(homeExpanded);
|
|
26980
26992
|
return all.length === 1 && unresolvedRefs(all[0]).length === 0 ? all[0] : null;
|
|
26981
26993
|
};
|
|
@@ -27162,6 +27174,8 @@ var segmentTargets = (cwd, command, dialect, depth = 0, strict = false, inherite
|
|
|
27162
27174
|
for (const sub of depth < 4 ? segment.subs ?? [] : [])
|
|
27163
27175
|
targets.push(...segmentTargets(runIn, sub, dialect, depth + 1, strict, vars));
|
|
27164
27176
|
const expanding = new Set(segment.expands ?? []);
|
|
27177
|
+
const stdin = segment.stdin?.join(`
|
|
27178
|
+
`);
|
|
27165
27179
|
const scriptOf = (index) => {
|
|
27166
27180
|
const word = body[index];
|
|
27167
27181
|
if (word === undefined || !expanding.has(keywords + index))
|
|
@@ -27170,7 +27184,7 @@ var segmentTargets = (cwd, command, dialect, depth = 0, strict = false, inherite
|
|
|
27170
27184
|
return all.some((text) => unresolvedRefs(text).some(unescaped)) ? undefined : all.join(`
|
|
27171
27185
|
`);
|
|
27172
27186
|
};
|
|
27173
|
-
const opaque = segment.unanalyzable ? ["."] : inner === null ? opaqueWrites(body, scriptOf) : null;
|
|
27187
|
+
const opaque = segment.unanalyzable ? ["."] : inner === null ? opaqueWrites(body, scriptOf, stdin && (/[$`]/.test(stdin) && /<<-?[ \t]*[^'"\\\s]/.test(command.replaceAll("\\\n", "")) ? null : stdin)) : null;
|
|
27174
27188
|
const ran = words.findIndex((word) => word === "xargs" || !PREFIXES2.has(word));
|
|
27175
27189
|
const runner = words[ran];
|
|
27176
27190
|
if (runner !== undefined && expanding.has(keywords + lead + ran) && unresolvedRefs(homeExpanded(runner)).length > 0)
|
|
@@ -27186,15 +27200,13 @@ var segmentTargets = (cwd, command, dialect, depth = 0, strict = false, inherite
|
|
|
27186
27200
|
if (ln >= 0 && words.slice(0, ln).every((word) => PREFIXES2.has(word)) && (strict !== "registry" || !lnArgs.some((arg) => /^-[a-zA-Z]*s|^--symbolic$/.test(arg))))
|
|
27187
27201
|
targets.push(...linkSources(lnArgs, at));
|
|
27188
27202
|
}
|
|
27189
|
-
for (const file of segment.redirects)
|
|
27190
|
-
if (!/^\/dev\/(?:null|stdout|stderr|tty)$/.test(file))
|
|
27191
|
-
targets.push(...atAll(file));
|
|
27192
27203
|
const edits = editsOf(body);
|
|
27193
27204
|
if (edits === null) {
|
|
27194
27205
|
if (dir !== undefined)
|
|
27195
27206
|
targets.push(placeholderIn(dir, DIR_TARGET));
|
|
27196
|
-
}
|
|
27197
|
-
|
|
27207
|
+
}
|
|
27208
|
+
for (const file of [...segment.redirects, ...edits ?? []])
|
|
27209
|
+
if (!/^\/dev\/(?:null|stdout|stderr|tty)$/.test(file))
|
|
27198
27210
|
targets.push(...atAll(file));
|
|
27199
27211
|
if (dir !== undefined)
|
|
27200
27212
|
for (const invocation of workitInvocations(body.map(quoteWord2).join(" "), "posix")) {
|
|
@@ -28595,12 +28607,17 @@ var JUDGE_VERBS = {
|
|
|
28595
28607
|
dir: true,
|
|
28596
28608
|
help: true,
|
|
28597
28609
|
"test-audit": true,
|
|
28598
|
-
ledger: ["verdict", "
|
|
28610
|
+
ledger: ["verdict", "list", "check", "ruling", "show"],
|
|
28611
|
+
finding: ["record", "list"],
|
|
28599
28612
|
pr: ["status"],
|
|
28600
28613
|
ci: ["wait", "logs"],
|
|
28601
28614
|
fanout: ["status", "brief"],
|
|
28602
28615
|
models: ["show"],
|
|
28603
|
-
lock: ["status"]
|
|
28616
|
+
lock: ["status"],
|
|
28617
|
+
lease: ["status"],
|
|
28618
|
+
grant: ["show"],
|
|
28619
|
+
task: ["show", "list"],
|
|
28620
|
+
doctor: ["--json"]
|
|
28604
28621
|
};
|
|
28605
28622
|
var JUDGE_JOB = Object.entries(JUDGE_VERBS).map(([verb, subs]) => `workit ${verb}${subs === true ? "" : ` ${subs.join("|")}`}`).join(", ");
|
|
28606
28623
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/opencode",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.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.7.
|
|
44
|
+
"@workit-dev/core": "^2.7.1"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=24"
|