@brainervirus/workit-opencode 5.0.0 → 6.0.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.
Files changed (3) hide show
  1. package/README.md +17 -72
  2. package/dist/plugin.js +4142 -6240
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,87 +1,32 @@
1
1
  # @brainervirus/workit-opencode
2
2
 
3
3
  [![CI](https://github.com/BrainerVirus/workit/actions/workflows/ci.yml/badge.svg)](https://github.com/BrainerVirus/workit/actions/workflows/ci.yml)
4
- [![npm version](https://img.shields.io/npm/v/@brainervirus/workit-opencode.svg)](https://www.npmjs.com/package/@brainervirus/workit-opencode)
5
- [![license: MIT](https://img.shields.io/badge/license-MIT-green.svg)](../../LICENSE)
4
+ [![npm](https://img.shields.io/npm/v/@brainervirus/workit-opencode.svg)](https://www.npmjs.com/package/@brainervirus/workit-opencode)
5
+ [![license: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/BrainerVirus/workit/blob/main/LICENSE)
6
6
 
7
- OpenCode plugin for Workit — optional coordination, policy, delegation, handoff, and read-only context. Native OpenCode tools execute Git, hosting, YouTrack and documentation effects.
7
+ [Workit](https://github.com/BrainerVirus/workit) for OpenCode 2.0.18+: the seven task families,
8
+ read-only `workit_context` and `workit_init_apply` as native tools, the
9
+ eleven method skills with `/wk-*` commands, direct-child delegation, and
10
+ context injection on session start and after compaction. Requires Node.js 24+.
8
11
 
9
- ## Install
10
-
11
- ```jsonc
12
- // opencode.json / opencode.jsonc
12
+ ```json
13
13
  {
14
14
  "$schema": "https://opencode.ai/config.json",
15
15
  "plugins": ["@brainervirus/workit-opencode"]
16
16
  }
17
17
  ```
18
18
 
19
- OpenCode 2.x reads `"plugins"` and still normalizes the older `"plugin"` key.
20
-
21
- Local dev variant (absolute path to this repo):
22
-
23
- ```jsonc
24
- {
25
- "$schema": "https://opencode.ai/config.json",
26
- "plugins": ["file:///path/to/workit/packages/workit-opencode"]
27
- }
28
- ```
29
-
30
- Requirements: OpenCode 2.0.18+, Node ≥ 24. The published plugin is a
31
- self-contained Node bundle whose default export is the V2 plugin definition
32
- (`{ id: "workit", setup }`). Workit 3.0 removed the OpenCode 1.x `server()`
33
- adapter; OpenCode 1.x hosts must stay on Workit 2.x by pinning
34
- `"plugin": ["@brainervirus/workit-opencode@2"]` (the V1 key) until they upgrade
35
- OpenCode.
36
-
37
- ## What it provides
38
-
39
- - **Eight native operation tools** — `workit_task`, `workit_policy`, `workit_evidence`, `workit_finding`, `workit_decision`, `workit_worker`, `workit_writer`, and `workit_state`.
40
- - **Read-only context and init tools** — `workit_context` accepts `{ "kind": "git" }` and the existing PR/YouTrack/changelog/release/affected context fields; `workit_init_apply` keeps confirmed configuration initialization.
41
- - **Eleven policy-selected method skills** — shape, implement, review, debug, ship, continue, bdd, test-audit,
42
- deslop, fanout, and verify-app.
43
- - **Native lifecycle hooks** — host-observed question receipts, direct-child task workers, compact task bootstrap/restoration, and known-surface writer checks.
19
+ Local checkout: run `bun packages/workit-opencode/scripts/build.ts`, then pin
20
+ `"file:///path/to/workit/packages/workit-opencode"`. OpenCode 1.x must stay on
21
+ `"plugin": ["@brainervirus/workit-opencode@2"]`.
44
22
 
45
- ## Host-native behavior
46
-
47
- - **Receipts** — native `question` answers are purpose-bound, session-bound, fresh, and one-use; unrelated questions fail closed.
48
- - **Delegation** — native `task` workers are direct-child-only; nested or uncertain lineage is denied (`delegation_lineage_denied`).
49
- - **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`.
50
-
51
- Workit does not register `workit_external_action` on OpenCode.
52
- Use native tools for mutations under the host permissions and target conventions;
53
- no Workit task, writer or decision is needed merely to run an ordinary command.
54
- Old action/decision history is preserved. Inspect and reconcile any uncertain
55
- effect before retrying; removal does not settle or migrate it.
56
-
57
- ## Upgrade from Workit 1.x
58
-
59
- Workit 2.0 removes the managed external-action tool on both OpenCode versions.
60
- Use native host tools for mutations and `workit_context` for read-only context.
61
- Existing task and action history remains untouched; reconcile uncertain effects
62
- before retrying them.
63
-
64
- ## Bundle / runtime model
65
-
66
- The build bundles the `@opencode/plugin` SDK surface used by the adapter into `dist/plugin.js`, so the published plugin has **no** runtime dependency on the SDK (it stays a development/build-only pin). The plugin loads through its real package entry `dist/plugin.js`; only the eleven method skills ship under `assets/`.
67
-
68
- The plugin registers ten tools with `codemode: false`, the eleven
69
- skills and up to eleven `wk-*` commands. Existing user skills and commands
70
- are preserved; an alias is added only when its Workit skill is registered. It
71
- also provides question receipts for `decision.record`, direct-child subagent
72
- lineage with durable dispatch claims, and bootstrap/task/worker context plus
73
- compaction injection. Its shell
74
- permission hook adds branch-name policy denials for direct, unquoted literal
75
- branch-creation forms only. It leaves compliant branches, PR and worktree
76
- commands, and unsupported shell syntax to OpenCode's native permission rules.
77
-
78
- ## Package scripts
23
+ Effects (git, forge, files) run through OpenCode's native tools and the
24
+ `workit` CLI under OpenCode permissions plus the workspace
25
+ [grants](https://github.com/BrainerVirus/workit/blob/main/docs/guides/grants.md). The shell hook only denies direct,
26
+ unquoted branch-creation commands that break the naming policy. Details:
27
+ [hosts guide](https://github.com/BrainerVirus/workit/blob/main/docs/guides/hosts.md#opencode).
79
28
 
80
29
  ```bash
81
- bun run build # bundle dist/plugin.js + assets
82
- bun run typecheck # tsc --noEmit
30
+ bun run build # bundle dist/plugin.js (self-contained, no runtime SDK dependency)
31
+ bun run typecheck
83
32
  ```
84
-
85
- ## Docs
86
-
87
- Full usage: https://github.com/BrainerVirus/workit#readme