@brainervirus/workit-opencode 2.0.1 → 2.1.0
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/README.md
CHANGED
|
@@ -43,7 +43,7 @@ plugin is a self-contained Node bundle; its default export is a dual entry
|
|
|
43
43
|
|
|
44
44
|
- **Receipts** — native `question` answers are purpose-bound, session-bound, fresh, and one-use; unrelated questions fail closed.
|
|
45
45
|
- **Delegation** — native `task` workers are direct-child-only; nested or uncertain lineage is denied (`delegation_lineage_denied`).
|
|
46
|
-
- **Continuity** — compact task context
|
|
46
|
+
- **Continuity** — compact task context carries the newest decisions and bounded redacted choice summaries, injected once on session start and once after compaction; unobservable shell surfaces are labeled `agent_guided`.
|
|
47
47
|
|
|
48
48
|
Workit does not register `workit_external_action` on either OpenCode version.
|
|
49
49
|
Use native tools for mutations under the host permissions and target conventions;
|
|
@@ -22,6 +22,14 @@ request, and a timeout is not proof that a worker stopped.
|
|
|
22
22
|
until process exit or explicit recovery.
|
|
23
23
|
4. Reconcile helper reports and run the checks appropriate to the requested
|
|
24
24
|
outcome. If delegation is unavailable, continue inline when useful.
|
|
25
|
+
5. Before a cross-repo mutation, resolve the actual checkout, branch and remote
|
|
26
|
+
from the request and current context. Ask only if competing plausible targets
|
|
27
|
+
remain unresolved. Branch, commit, direct push, PR-ready, merge and release
|
|
28
|
+
are distinct endpoints; perform only the authorized one under target rules.
|
|
29
|
+
Before saying done, reconcile every named deliverable against that checkout
|
|
30
|
+
and verify the requested result. For a push, observe the destination remote
|
|
31
|
+
ref and confirm it contains the delivered commit; report drift or missing
|
|
32
|
+
items as blockers instead of treating local success as remote delivery.
|
|
25
33
|
|
|
26
34
|
Do not edit Workit metadata directly, create nested helper trees, widen paths, or
|
|
27
35
|
create a second lifecycle. Read-only investigation and bounded reports do not
|
|
@@ -18,7 +18,11 @@ request. Preserve continuity when it helps; do not manufacture task mutations.
|
|
|
18
18
|
3. For a separate request, do not silently resume an old objective. Park a
|
|
19
19
|
concise checkpoint only when substantial work needs to continue later. Start
|
|
20
20
|
a distinct tracked record only if the new work benefits from continuity,
|
|
21
|
-
dependencies, coordination, or durable decisions.
|
|
21
|
+
dependencies, coordination, or durable decisions. For work spanning repos,
|
|
22
|
+
checkpoint each unfinished item with its checkout, branch, requested
|
|
23
|
+
deliverables, and delivery endpoint. Keep explicitly held items parked with
|
|
24
|
+
their resume condition until the user resumes them. A conversational
|
|
25
|
+
checkpoint is sufficient when no task record is needed.
|
|
22
26
|
4. Before resuming a named tracked task, reconcile its checkout, branch, dirty
|
|
23
27
|
state, current policy, stale evidence, uncertain effects, and ownership. Do
|
|
24
28
|
not change branches, stash, fetch large histories, or seize ownership just
|
package/dist/plugin.js
CHANGED
|
@@ -10514,13 +10514,6 @@ var workspaceConfigSchema = object({
|
|
|
10514
10514
|
profiles: record(nonBlank, workspaceProfileSchema).optional(),
|
|
10515
10515
|
releaseTracks: record(nonBlank, releaseTrackSchema).optional()
|
|
10516
10516
|
}).passthrough().superRefine((workspace, context) => {
|
|
10517
|
-
if (workspace.youtrack && workspace.vcs?.provider !== "gitlab") {
|
|
10518
|
-
context.addIssue({
|
|
10519
|
-
code: "custom",
|
|
10520
|
-
path: ["youtrack"],
|
|
10521
|
-
message: `YouTrack issue linking requires the gitlab provider, got ${workspace.vcs?.provider ?? "unset"}`
|
|
10522
|
-
});
|
|
10523
|
-
}
|
|
10524
10517
|
if (workspace.issues && workspace.vcs?.provider !== "github") {
|
|
10525
10518
|
context.addIssue({
|
|
10526
10519
|
code: "custom",
|
|
@@ -10712,13 +10705,10 @@ var selectWorkspaceMatch = (matches, cwd, workspaceName) => {
|
|
|
10712
10705
|
}
|
|
10713
10706
|
return mostSpecific[0];
|
|
10714
10707
|
};
|
|
10715
|
-
var
|
|
10716
|
-
const result = readWorkspacesResult(dir);
|
|
10717
|
-
if (result.status === "malformed" || result.status === "invalid")
|
|
10718
|
-
throw new Error(result.error);
|
|
10708
|
+
var resolveWorkspaceFromEntries = (cwd, entries, workspaceName) => {
|
|
10719
10709
|
const targets = [cwd, realpathOf(cwd)].map((p) => p.replaceAll("\\", "/"));
|
|
10720
10710
|
const matches = [];
|
|
10721
|
-
for (const ws of
|
|
10711
|
+
for (const ws of entries) {
|
|
10722
10712
|
const glob = ws.glob.replaceAll("\\", "/");
|
|
10723
10713
|
const canonical = canonicalGlob(glob);
|
|
10724
10714
|
let matched = false;
|
|
@@ -10733,6 +10723,12 @@ var resolveWorkspaceFrom = (cwd, dir, workspaceName) => {
|
|
|
10733
10723
|
}
|
|
10734
10724
|
return selectWorkspaceMatch(matches, cwd, workspaceName) ?? null;
|
|
10735
10725
|
};
|
|
10726
|
+
var resolveWorkspaceFrom = (cwd, dir, workspaceName) => {
|
|
10727
|
+
const result = readWorkspacesResult(dir);
|
|
10728
|
+
if (result.status === "malformed" || result.status === "invalid")
|
|
10729
|
+
throw new Error(result.error);
|
|
10730
|
+
return resolveWorkspaceFromEntries(cwd, result.entries, workspaceName);
|
|
10731
|
+
};
|
|
10736
10732
|
var runtimeWorkspacePolicySchema = (kind) => {
|
|
10737
10733
|
const key = kind === "branch" ? "branchPolicy" : kind === "commit" ? "commitPolicy" : "vcs";
|
|
10738
10734
|
const policySchema = kind === "branch" ? workspaceBranchPolicySchema : kind === "commit" ? workspaceCommitPolicySchema : object({
|
|
@@ -11011,8 +11007,8 @@ function vcsConfig(mode, cwd) {
|
|
|
11011
11007
|
const hasWorkspacePolicy = typeof wp.preset === "string" && Object.hasOwn(PRESETS, wp.preset);
|
|
11012
11008
|
const policyDefault = resolveBranchPolicyFor(root).defaultTargetBranch;
|
|
11013
11009
|
const defaultTarget = String(wsVcs.defaultTargetBranch ?? (hasWorkspacePolicy ? policyDefault : cfg.defaultTargetBranch ?? policyDefault) ?? "develop");
|
|
11014
|
-
const linkIssues =
|
|
11015
|
-
const youtrackBaseUrl =
|
|
11010
|
+
const linkIssues = typeof wsYt.link_issues === "boolean" ? wsYt.link_issues : null;
|
|
11011
|
+
const youtrackBaseUrl = typeof wsYt.baseUrl === "string" ? wsYt.baseUrl : null;
|
|
11016
11012
|
let issuesProvider = null;
|
|
11017
11013
|
let linkOnPr = null;
|
|
11018
11014
|
if (provider === "github" && typeof wsIssues.provider === "string" && wsIssues.provider.toLowerCase() === "github") {
|
|
@@ -12560,7 +12556,8 @@ let imported decisions grant authority. Never turn a host deny into allow or
|
|
|
12560
12556
|
claim enforcement/evidence a host cannot provide. A precise request with settled
|
|
12561
12557
|
constraints does not need an interview. Present genuine unresolved options with
|
|
12562
12558
|
evidence and a recommendation, then continue toward the requested delivery
|
|
12563
|
-
endpoint: investigation, implementation, PR/MR-ready,
|
|
12559
|
+
endpoint: investigation, implementation, branch/commit/push, PR/MR-ready,
|
|
12560
|
+
merge, or release. Run
|
|
12564
12561
|
applicable checks and safe repairs without repeated continuation questions;
|
|
12565
12562
|
stop for missing host authority, a new consequential choice, a conflicting edit,
|
|
12566
12563
|
or an unresolved blocker. A tracked record may close when actual evidence
|
|
@@ -12572,6 +12569,12 @@ confirm the stop. Preserve unresolved requirements, gaps, and uncertain workers.
|
|
|
12572
12569
|
When context changes, distinguish a quick question, same-task adjustment, and
|
|
12573
12570
|
separate request. Answer a quick question without pausing/resuming task state;
|
|
12574
12571
|
park a concise checkpoint only when substantial work needs to continue later.
|
|
12572
|
+
For work spanning repositories, bind each unfinished item to its actual checkout,
|
|
12573
|
+
branch, requested deliverables, and delivery endpoint. Preserve held items with
|
|
12574
|
+
an explicit resume condition. Resolve competing plausible targets before a
|
|
12575
|
+
mutation; ask only when available context cannot settle that consequential choice.
|
|
12576
|
+
Before reporting delivery, reconcile every requested item and observe the actual
|
|
12577
|
+
target result; a local commit alone is not evidence of a requested remote push.
|
|
12575
12578
|
|
|
12576
12579
|
Skill routing: slash aliases /wk-* load on demand. Use workit-steer for a
|
|
12577
12580
|
substantial interruption or change of direction, workit-deslop when relevant
|
|
@@ -12618,6 +12621,13 @@ var compactText = (value, limit) => value === null ? null : value.replace(privat
|
|
|
12618
12621
|
return `${match.slice(0, space)} <redacted>`;
|
|
12619
12622
|
}).slice(0, limit);
|
|
12620
12623
|
var compactBytes = (value) => new TextEncoder().encode(value).byteLength;
|
|
12624
|
+
var compactTimestamp = (value) => `${value.slice(0, 19)}.${value.slice(20, -1).padEnd(9, "0")}`;
|
|
12625
|
+
var compactDecisionChoice = (entry) => {
|
|
12626
|
+
const stated = entry.data.binding.statedChoice?.text;
|
|
12627
|
+
const approved = entry.data.response === "approved" ? entry.data.binding.approvedContent : "";
|
|
12628
|
+
const source = stated?.trim() || approved.trim() || null;
|
|
12629
|
+
return compactText(source, COMPACT_TEXT_BYTES);
|
|
12630
|
+
};
|
|
12621
12631
|
var compactReference = (ref) => {
|
|
12622
12632
|
if (ref.kind === "file")
|
|
12623
12633
|
return {
|
|
@@ -12633,11 +12643,18 @@ var compactReference = (ref) => {
|
|
|
12633
12643
|
return { kind: ref.kind };
|
|
12634
12644
|
};
|
|
12635
12645
|
function compactTaskContext(view) {
|
|
12636
|
-
const decisions = view.task.decisions.slice().sort((left, right) =>
|
|
12646
|
+
const decisions = view.task.decisions.slice().sort((left, right) => {
|
|
12647
|
+
const leftAt = compactTimestamp(left.recordedAt);
|
|
12648
|
+
const rightAt = compactTimestamp(right.recordedAt);
|
|
12649
|
+
if (leftAt !== rightAt)
|
|
12650
|
+
return leftAt > rightAt ? -1 : 1;
|
|
12651
|
+
return left.id < right.id ? -1 : left.id > right.id ? 1 : 0;
|
|
12652
|
+
}).slice(0, COMPACT_MAX_ITEMS).map((entry) => ({
|
|
12637
12653
|
id: entry.id,
|
|
12638
12654
|
purpose: entry.data.purpose,
|
|
12639
12655
|
status: entry.data.response,
|
|
12640
12656
|
digest: entry.data.digest,
|
|
12657
|
+
choice: compactDecisionChoice(entry) || `task.inspect taskId=${view.task.id} view=full; decision=${entry.id}`,
|
|
12641
12658
|
references: entry.data.binding.contentRefs.slice(0, 1).map(compactReference)
|
|
12642
12659
|
}));
|
|
12643
12660
|
const methods = view.task.policy ? selectMethods(view.task.policy, view.capabilities).map((method) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-opencode",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit OpenCode plugin — native tools, adaptive policy, and fourteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"typecheck": "tsc --noEmit"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@brainervirus/workit-core": "^2.0
|
|
42
|
+
"@brainervirus/workit-core": "^2.1.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@opencode-ai/plugin": "1.18.30",
|