@workit-dev/opencode 2.17.1 → 2.18.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.
|
@@ -13,7 +13,7 @@ and report the grant it names. PR creation does not start babysitting (a
|
|
|
13
13
|
`green` or `merged` endpoint does), and a babysit request does not authorize
|
|
14
14
|
merge: Stop at PR-ready (`babysit` `ready`) unless the user, or `merged` on a
|
|
15
15
|
request that named no endpoint, set merge. `release publish` only if asked.
|
|
16
|
-
Release: `workit release start <v>`, commits, `finish` (references/release.md).
|
|
16
|
+
Release: `workit release start <v>`, commits, `finish`; a repo that releases by pushing a tag: `workit release tag v<v>` (references/release.md).
|
|
17
17
|
|
|
18
18
|
**Babysit endpoints.** After opening the PR keep babysitting without asking
|
|
19
19
|
until CI is green, every thread is resolved and the verification gate is met;
|
|
@@ -53,7 +53,7 @@ the same check. Fix round and recheck both failed: the decider agent (call the s
|
|
|
53
53
|
with `workit check`, fix the root cause, batch every fix in one push, one focused commit per fix (unrelated hunks in one file: `workit git stage --patch <file>`, then `workit git commit -m "<msg>" --staged`). A tool warning is a finding: fix it in this PR in the right layer, or record the false positive with evidence; pre-existing ones get their own PR.
|
|
54
54
|
6. **Verified.** The lane in `workit pr status` decides: none, no verdict; self, your `--self` verdict; focused or full (or `verification: self|independent`), one non-author verifier per PR after the last push, never per push (call the skill tool with `workit-review`), on Claude Code with the `model` and `effort` of `workit models show --role verifier`. A docs-only push (or test-only under a unit verdict) keeps the verdict (`carried`); `reverify: focused` re-checks only the new diff, reusing green CI; one verdict at a stack's top covers its unchanged lower PRs. Land only when
|
|
55
55
|
granted: `workit stack land` or `workit pr merge`; `--unverified --reason` if user-asked.
|
|
56
|
-
Never pipe a delivery verb through `grep`: read its exit code, or use `--json`.
|
|
56
|
+
Never pipe a delivery verb through `grep`, `tail` or `head`: read its exit code, or use `--json`. Trunk CI after a merge: `workit ci wait --branch <trunk>`.
|
|
57
57
|
7. **Observe it landed:** `workit verify-delivery pr` or `merge`. After a failed
|
|
58
58
|
verdict or a check red 3+ times, at any endpoint: offer `/wk-retro` in one
|
|
59
59
|
line of the final or stop report; never pause the babysit loop for it.
|
|
@@ -48,3 +48,11 @@ A workspace `releasePackages` entry, after the workspace release finished:
|
|
|
48
48
|
release commit (`--at <ref>`), pushes it, creates its forge release (not
|
|
49
49
|
Latest; `--latest` only when asked) and verifies it. Notes:
|
|
50
50
|
`workit release notes draft <name>@<version>`.
|
|
51
|
+
|
|
52
|
+
## Release by tag (goreleaser and similar)
|
|
53
|
+
|
|
54
|
+
A repo whose workflow releases on a pushed `v<version>` tag: merge the
|
|
55
|
+
changelog roll (`## [<version>]`) by PR, then `workit release tag
|
|
56
|
+
v<version>` (never raw `git tag`). It refuses red CI, an existing tag or a
|
|
57
|
+
missing section, naming the fix; `--wait` (background) watches the release
|
|
58
|
+
workflow. Backfill notes: `workit release notes edit <tag> --from-changelog`.
|
package/dist/plugin.js
CHANGED
|
@@ -25899,7 +25899,7 @@ function heavyPlan(command, options) {
|
|
|
25899
25899
|
};
|
|
25900
25900
|
}
|
|
25901
25901
|
if (single) {
|
|
25902
|
-
const rewrite = leaseRewrite(command);
|
|
25902
|
+
const rewrite = leaseRewrite(command.trim().replace(TAIL_FILTER, ""));
|
|
25903
25903
|
return rewrite ? { kind: "rewrite", command: rewrite, reason: single.reason } : { kind: "none" };
|
|
25904
25904
|
}
|
|
25905
25905
|
const parts = heavy.map((match) => leaseCommand(match.line));
|
|
@@ -25944,6 +25944,7 @@ function workitOnPath2(env = process.env) {
|
|
|
25944
25944
|
}
|
|
25945
25945
|
return false;
|
|
25946
25946
|
}
|
|
25947
|
+
var TAIL_FILTER = /(?:\s+2>&1)?\s*\|\s*(?:tail|head)(?:\s+[\w=.+-]+)*\s*$/u;
|
|
25947
25948
|
var ASSIGNMENTS = /^\s*((?:[A-Za-z_]\w*=(?:'[^']*'|"(?:[^"\\]|\\.)*"|[^\s'"])*\s+)*)/u;
|
|
25948
25949
|
function leaseRewrite(command) {
|
|
25949
25950
|
const text = command.trim();
|
|
@@ -29841,6 +29842,96 @@ Retry as: ${retry}` : ""}`,
|
|
|
29841
29842
|
};
|
|
29842
29843
|
};
|
|
29843
29844
|
|
|
29845
|
+
// packages/workit-core/src/hooks/exit-pipe.ts
|
|
29846
|
+
var EXIT_VERBS = [
|
|
29847
|
+
["ci", "wait"],
|
|
29848
|
+
["check"],
|
|
29849
|
+
["pr", "merge"],
|
|
29850
|
+
["release"],
|
|
29851
|
+
["verify-delivery"]
|
|
29852
|
+
];
|
|
29853
|
+
var base2 = (word = "") => word.split(/[\\/]/u).at(-1) ?? "";
|
|
29854
|
+
var quote3 = (word) => /^[\w@%+=:,./-]+$/u.test(word) ? word : `'${word.replaceAll("'", `'\\''`)}'`;
|
|
29855
|
+
var verbPath = (words) => {
|
|
29856
|
+
const path = [];
|
|
29857
|
+
for (let at = 0;at < words.length && path.length < 2; at += 1) {
|
|
29858
|
+
const word = words[at];
|
|
29859
|
+
if (word === "--")
|
|
29860
|
+
break;
|
|
29861
|
+
if (word === "--cwd")
|
|
29862
|
+
at += 1;
|
|
29863
|
+
else if (!word.startsWith("-"))
|
|
29864
|
+
path.push(word);
|
|
29865
|
+
}
|
|
29866
|
+
return path;
|
|
29867
|
+
};
|
|
29868
|
+
var exitCall = (words) => {
|
|
29869
|
+
let at = 0;
|
|
29870
|
+
while (at < words.length && /^[A-Za-z_]\w*=/u.test(words[at]))
|
|
29871
|
+
at += 1;
|
|
29872
|
+
if (!/^workit(?:-cli)?$/u.test(base2(words[at])))
|
|
29873
|
+
return null;
|
|
29874
|
+
const path = verbPath(words.slice(at + 1));
|
|
29875
|
+
return EXIT_VERBS.some((verb) => verb.every((word, index) => path[index] === word)) ? words.slice(at) : null;
|
|
29876
|
+
};
|
|
29877
|
+
var setsPipefail = (words) => words[0] === "set" && words.some((word, at) => word === "pipefail" && /^-[a-z]*o$/u.test(words[at - 1] ?? ""));
|
|
29878
|
+
var retryOf = ({ call, dir }) => {
|
|
29879
|
+
const at = call[1]?.startsWith("-") ? 1 : 2;
|
|
29880
|
+
const words = dir && !call.includes("--cwd") ? [...call.slice(0, at), "--cwd", dir, ...call.slice(at)] : call;
|
|
29881
|
+
return ["workit", ...words.slice(1)].map(quote3).join(" ");
|
|
29882
|
+
};
|
|
29883
|
+
function exitPipeGate(command, dialect = "posix") {
|
|
29884
|
+
if (!/\bworkit/u.test(command) || !/\b(?:tail|head)\b/u.test(command))
|
|
29885
|
+
return null;
|
|
29886
|
+
const subshellPiped = /\)\s*(?:\d*>&?\d*\s*)*\|(?!\|)/u.test(command);
|
|
29887
|
+
const groups = [];
|
|
29888
|
+
let carry = null;
|
|
29889
|
+
let pipefail = false;
|
|
29890
|
+
let dir = null;
|
|
29891
|
+
for (const segment of segmentsOf(command, dialect)) {
|
|
29892
|
+
if (segment.unanalyzable)
|
|
29893
|
+
return null;
|
|
29894
|
+
let words = segment.words;
|
|
29895
|
+
let closes = segment.group === "close";
|
|
29896
|
+
if (segment.group === "open") {
|
|
29897
|
+
groups.push(null);
|
|
29898
|
+
continue;
|
|
29899
|
+
}
|
|
29900
|
+
if (words[0] === "{") {
|
|
29901
|
+
groups.push(null);
|
|
29902
|
+
words = words.slice(1);
|
|
29903
|
+
} else if (words[0] === "}") {
|
|
29904
|
+
closes = true;
|
|
29905
|
+
words = words.slice(1);
|
|
29906
|
+
}
|
|
29907
|
+
if (closes) {
|
|
29908
|
+
const inner = groups.pop() ?? null;
|
|
29909
|
+
const piped = segment.pipe === true || segment.group === "close" && subshellPiped;
|
|
29910
|
+
carry = piped ? inner ?? carry : null;
|
|
29911
|
+
continue;
|
|
29912
|
+
}
|
|
29913
|
+
if (setsPipefail(words))
|
|
29914
|
+
pipefail = true;
|
|
29915
|
+
const filter = base2(words[0]);
|
|
29916
|
+
if (carry && !pipefail && (filter === "tail" || filter === "head")) {
|
|
29917
|
+
const retry = retryOf(carry);
|
|
29918
|
+
return {
|
|
29919
|
+
kind: "deny",
|
|
29920
|
+
reason: `workit exit-pipe: piping \`workit ${verbPath(carry.call.slice(1)).join(" ")}\` into ${filter} hides its exit code.
|
|
29921
|
+
Retry as: ${retry}`,
|
|
29922
|
+
unblock: retry
|
|
29923
|
+
};
|
|
29924
|
+
}
|
|
29925
|
+
const call = exitCall(words);
|
|
29926
|
+
const found = call ? { call, dir } : null;
|
|
29927
|
+
if (found && groups.length)
|
|
29928
|
+
groups[groups.length - 1] = found;
|
|
29929
|
+
carry = segment.pipe ? found ?? carry : null;
|
|
29930
|
+
dir = words.length === 2 && words[0] === "cd" && !segment.expands?.length ? words[1] : null;
|
|
29931
|
+
}
|
|
29932
|
+
return null;
|
|
29933
|
+
}
|
|
29934
|
+
|
|
29844
29935
|
// packages/workit-core/src/hooks/handle.ts
|
|
29845
29936
|
var offered = new Set;
|
|
29846
29937
|
var PRE_TOOL = new Set(["shell.pre", "write.pre", "tool.pre"]);
|
|
@@ -32029,6 +32120,9 @@ var evaluateShellPermission = (root, event, workdirs = new Map) => {
|
|
|
32029
32120
|
const ytrack = ytrackGate(cwd, resource, "posix", false);
|
|
32030
32121
|
if (ytrack?.kind === "deny")
|
|
32031
32122
|
return deny(ytrack.reason);
|
|
32123
|
+
const piped = exitPipeGate(resource, "posix");
|
|
32124
|
+
if (piped?.kind === "deny")
|
|
32125
|
+
return deny(piped.reason);
|
|
32032
32126
|
const raw = rawGitPre({
|
|
32033
32127
|
host: "opencode",
|
|
32034
32128
|
cwd,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/opencode",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.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.18.1"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=24"
|