@workit-dev/opencode 1.2.0 → 1.2.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 +102 -2
- package/package.json +2 -2
package/dist/plugin.js
CHANGED
|
@@ -25586,7 +25586,7 @@ var shellScript2 = (words) => {
|
|
|
25586
25586
|
return null;
|
|
25587
25587
|
for (let index = 1;index < words.length; index++) {
|
|
25588
25588
|
const word = words[index];
|
|
25589
|
-
if (/^-[a-z]*c
|
|
25589
|
+
if (/^-[a-z]*c[a-z]*$/.test(word))
|
|
25590
25590
|
return words[index + 1] ?? null;
|
|
25591
25591
|
if (/^[-+][oO]$/.test(word))
|
|
25592
25592
|
index++;
|
|
@@ -25617,8 +25617,16 @@ var opaqueWrites = (input, scriptOf = (index) => input[index]) => {
|
|
|
25617
25617
|
const files = operands(args);
|
|
25618
25618
|
const has = (pattern) => args.some((arg) => pattern.test(arg));
|
|
25619
25619
|
const listed = (named) => named.length ? named : ["."];
|
|
25620
|
-
if (name === "unlink" || name === "shred")
|
|
25620
|
+
if (name === "unlink" || name === "shred" || name === "mkfifo")
|
|
25621
25621
|
return listed(files);
|
|
25622
|
+
if (name === "wget")
|
|
25623
|
+
return wgetOutputs(args);
|
|
25624
|
+
if (name === "tar")
|
|
25625
|
+
return tarOutputs(args);
|
|
25626
|
+
if (name === "unzip")
|
|
25627
|
+
return has(/^-[a-zA-Z]*[lptvzZ]/) ? null : listed(args.flatMap((arg, at) => arg.startsWith("-d") ? [arg.slice(2) || args[at + 1] || "."] : []));
|
|
25628
|
+
if (name === "git")
|
|
25629
|
+
return gitOutputs(args);
|
|
25622
25630
|
if (/^(?:chmod|chown|chgrp|chattr)$/.test(name))
|
|
25623
25631
|
return listed(has(/^--reference/) ? files : files.slice(1));
|
|
25624
25632
|
if (name === "rsync") {
|
|
@@ -25738,6 +25746,85 @@ var curlOutputs = (args) => {
|
|
|
25738
25746
|
files.push(...dirs.length ? dirs : ["."]);
|
|
25739
25747
|
return files.length > 0 ? files : null;
|
|
25740
25748
|
};
|
|
25749
|
+
var valueOf = (args, option) => {
|
|
25750
|
+
const at = args.findIndex((arg) => option.test(arg));
|
|
25751
|
+
return at < 0 ? undefined : option.exec(args[at])?.[1] || args[at + 1];
|
|
25752
|
+
};
|
|
25753
|
+
var wgetOutputs = (args) => {
|
|
25754
|
+
const named = valueOf(args, /^(?:-[a-zA-Z]*O|--output-document=?)(.*)$/s);
|
|
25755
|
+
const logs = [/^-[a-zA-Z]*[oa](.*)$/s, /^--(?:output-file|append-output)=?(.*)$/s].flatMap((option) => valueOf(args, option) ?? []);
|
|
25756
|
+
if (named === undefined)
|
|
25757
|
+
return [...logs, valueOf(args, /^(?:-[a-zA-Z]*P|--directory-prefix=?)(.*)$/s) ?? "."];
|
|
25758
|
+
return named === "-" ? logs : [...logs, named];
|
|
25759
|
+
};
|
|
25760
|
+
var tarOutputs = (args) => {
|
|
25761
|
+
const letters = args.filter((arg, at) => at === 0 && !arg.startsWith("-") || /^-[a-zA-Z]+$/.test(arg)).join("").replaceAll("C", "");
|
|
25762
|
+
const long = (pattern) => args.some((arg) => pattern.test(arg));
|
|
25763
|
+
const extract = /x/.test(letters) || long(/^--(?:extract|get)$/);
|
|
25764
|
+
const creates = /[cruA]/.test(letters) || long(/^--(?:create|append|update|concatenate|delete)$/);
|
|
25765
|
+
if (!extract && !creates)
|
|
25766
|
+
return null;
|
|
25767
|
+
const files = [];
|
|
25768
|
+
if (extract) {
|
|
25769
|
+
const dirs = args.flatMap((arg, at) => /^-C|^--directory(?:=|$)/.test(arg) ? [arg.replace(/^-C|^--directory=?/, "") || args[at + 1] || "."] : []);
|
|
25770
|
+
files.push(...dirs.length ? dirs : ["."]);
|
|
25771
|
+
}
|
|
25772
|
+
const old = args[0] !== undefined && !args[0].startsWith("-") && args[0].includes("f");
|
|
25773
|
+
const archive = old ? args[1] : valueOf(args, /^(?:-[a-zA-Z]*f|--file=?)(.*)$/s);
|
|
25774
|
+
if (creates && archive !== undefined && archive !== "-")
|
|
25775
|
+
files.push(archive);
|
|
25776
|
+
return files;
|
|
25777
|
+
};
|
|
25778
|
+
var CONFIG_READ = /^(?:--get(?:-all|-regexp|-urlmatch)?|--list|-l|get|list)$/;
|
|
25779
|
+
var CONFIG_WRITE = /^(?:--(?:unset(?:-all)?|add|replace-all|rename-section|remove-section|edit)|-e|set|unset|rename-section|remove-section|edit)$/;
|
|
25780
|
+
var CONFIG_VALUE = /^(?:--file|-f|--blob|--type|--default|--comment)$/;
|
|
25781
|
+
var configWrites = (rest) => {
|
|
25782
|
+
if (rest.some((arg) => CONFIG_READ.test(arg)))
|
|
25783
|
+
return false;
|
|
25784
|
+
if (rest.some((arg) => CONFIG_WRITE.test(arg)))
|
|
25785
|
+
return true;
|
|
25786
|
+
let named = 0;
|
|
25787
|
+
for (let index = 0;index < rest.length; index++)
|
|
25788
|
+
if (CONFIG_VALUE.test(rest[index]))
|
|
25789
|
+
index++;
|
|
25790
|
+
else if (!rest[index].startsWith("-"))
|
|
25791
|
+
named++;
|
|
25792
|
+
return named > 1;
|
|
25793
|
+
};
|
|
25794
|
+
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))$/;
|
|
25795
|
+
var gitOutputs = (args) => {
|
|
25796
|
+
let at = 0;
|
|
25797
|
+
let base;
|
|
25798
|
+
for (;args[at]?.startsWith("-"); at += GIT_VALUE.test(args[at]) ? 2 : 1)
|
|
25799
|
+
if (args[at] === "-C")
|
|
25800
|
+
base = args[at + 1];
|
|
25801
|
+
const [sub = "", ...rest] = args.slice(at);
|
|
25802
|
+
if (rest.some((arg) => arg === "--help" || arg === "-h"))
|
|
25803
|
+
return null;
|
|
25804
|
+
const names = rest.filter((arg, index) => !arg.startsWith("-") && !GIT_VALUE.test(rest[index - 1] ?? ""));
|
|
25805
|
+
const has = (pattern) => rest.some((arg) => pattern.test(arg));
|
|
25806
|
+
const files = [];
|
|
25807
|
+
const output = valueOf(rest, sub === "archive" ? /^(?:-o|--output=?)(.*)$/s : /^--output=?(.*)$/s);
|
|
25808
|
+
if (output !== undefined)
|
|
25809
|
+
files.push(output);
|
|
25810
|
+
if (sub === "init")
|
|
25811
|
+
files.push(names[0] ?? ".");
|
|
25812
|
+
if (sub === "clone")
|
|
25813
|
+
files.push(names[1] ?? names[0]?.replace(/(?:\.git)?[\\/]*$/, "").split(/[\\/:]/).at(-1) ?? ".");
|
|
25814
|
+
if (sub === "format-patch" && !has(/^--stdout$/))
|
|
25815
|
+
files.push(valueOf(rest, /^(?:-o|--output-directory=?)(.*)$/s) ?? ".");
|
|
25816
|
+
if (sub === "bundle" && names[0] === "create" && names[1])
|
|
25817
|
+
files.push(names[1]);
|
|
25818
|
+
if (sub === "config" && configWrites(rest))
|
|
25819
|
+
files.push(has(/^--global$/) ? "~/.gitconfig" : has(/^--system$/) ? "/etc/gitconfig" : valueOf(rest, /^(?:-f|--file=?)(.*)$/s) ?? ".");
|
|
25820
|
+
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)/);
|
|
25821
|
+
if (sub === "fetch" || sub === "gc" || sub === "branch" && branchWrite)
|
|
25822
|
+
files.push(".");
|
|
25823
|
+
if (base === undefined)
|
|
25824
|
+
return files.length ? files : null;
|
|
25825
|
+
const under = (file) => file === "." ? `${base}/${OPAQUE_TARGET}git` : /^[/~$]|^[A-Za-z]:[\\/]/.test(file) ? file : `${base}/${file}`;
|
|
25826
|
+
return files.length ? files.map(under) : null;
|
|
25827
|
+
};
|
|
25741
25828
|
var pathsIn = (text) => [
|
|
25742
25829
|
...text.matchAll(/(?<![\w.~:/$-])(?:~\/|\/|[A-Za-z]:\/|\.\.(?:\/|$))[^\s'"`$),;:*?<>|\\[\]{}]*/g)
|
|
25743
25830
|
].map((match) => match[0]);
|
|
@@ -27447,6 +27534,19 @@ var MUTATING_REMOTE = new Set([
|
|
|
27447
27534
|
"set-branches",
|
|
27448
27535
|
"prune"
|
|
27449
27536
|
]);
|
|
27537
|
+
var JUDGE_VERBS = {
|
|
27538
|
+
check: true,
|
|
27539
|
+
dir: true,
|
|
27540
|
+
help: true,
|
|
27541
|
+
"test-audit": true,
|
|
27542
|
+
ledger: ["verdict", "finding", "list", "check", "ruling"],
|
|
27543
|
+
pr: ["status"],
|
|
27544
|
+
ci: ["wait", "logs"],
|
|
27545
|
+
fanout: ["status", "brief"],
|
|
27546
|
+
models: ["show"],
|
|
27547
|
+
lock: ["status"]
|
|
27548
|
+
};
|
|
27549
|
+
var JUDGE_JOB = Object.entries(JUDGE_VERBS).map(([verb, subs]) => `workit ${verb}${subs === true ? "" : ` ${subs.join("|")}`}`).join(", ");
|
|
27450
27550
|
|
|
27451
27551
|
// packages/workit-core/src/hooks/steering.ts
|
|
27452
27552
|
var ROLES = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/opencode",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.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": "^1.2.
|
|
44
|
+
"@workit-dev/core": "^1.2.1"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=24"
|