opencode-agent-orchestration-kit 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/README.md CHANGED
@@ -398,8 +398,9 @@ OpenCode default model, small/title model, and per-agent overrides. It builds
398
398
  its provider list from OpenCode itself and reads the local model catalog from
399
399
  `opencode models --pure`, so it only shows providers configured in your
400
400
  OpenCode installation. Startup is cache-first; press `r` when you want an
401
- explicit remote catalog refresh through `--refresh`. It does not share a
402
- catalog with Pi.
401
+ explicit remote catalog refresh through `--refresh`. On OpenCode 2, which
402
+ removed both flags and already lists only providers with credentials, it reads
403
+ `opencode models` instead. It does not share a catalog with Pi.
403
404
 
404
405
  From this checkout, run:
405
406
 
@@ -425,7 +426,7 @@ After a tagged release is published, you can install the same CLI directly
425
426
  from GitHub without keeping a checkout:
426
427
 
427
428
  ```bash
428
- npm install --global "git+https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit.git#v1.2.0"
429
+ npm install --global "git+https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit.git#v1.2.1"
429
430
  oc-switch
430
431
  ```
431
432
 
@@ -445,7 +446,12 @@ global bin directory) on `PATH` if npm is configured with a user prefix.
445
446
  `r` explicitly refreshes OpenCode's catalog.
446
447
 
447
448
  The selected values are persisted in the OpenCode model-switcher state and in
448
- the managed model block of `.zshrc` or `.bashrc`.
449
+ the managed model block of `.zshrc` or `.bashrc`. On OpenCode 2, saving also
450
+ runs `opencode service restart` with the new values, because the background
451
+ service keeps the environment it started with; if the restart fails, the
452
+ values stay saved and `oc-switch` asks you to run that command yourself.
453
+ Terminals that were already open keep the old variables until you open a new
454
+ shell.
449
455
 
450
456
  Pi has its own independent `pi-switch`; its catalog comes only from Pi's
451
457
  `pi --list-models` command.
@@ -842,7 +848,7 @@ Validate only the canonical identity and current release note with:
842
848
 
843
849
  ```bash
844
850
  npm run check:version
845
- node scripts/version.mjs --check-tag v1.2.0
851
+ node scripts/version.mjs --check-tag v1.2.1
846
852
  ```
847
853
 
848
854
  Tag validation compares an explicitly supplied tag with the package identity.
package/docs/models.md CHANGED
@@ -34,7 +34,7 @@ oc-switch
34
34
  Once a release tag exists, a checkout is optional:
35
35
 
36
36
  ```bash
37
- npm install --global "git+https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit.git#v1.2.0"
37
+ npm install --global "git+https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit.git#v1.2.1"
38
38
  oc-switch
39
39
  ```
40
40
 
@@ -0,0 +1,75 @@
1
+ # v1.2.1 - Safe lifecycle and canonical release identity
2
+
3
+ This patch release makes `oc-switch` work with OpenCode 2, makes `/loop` and
4
+ `/loop-status` find their state runtime in any project, and clears new
5
+ advisories in the dependency audit.
6
+
7
+ ## Highlights
8
+
9
+ - **`oc-switch` works with OpenCode 2.** OpenCode 2 removed the `--pure` and
10
+ `--refresh` flags of `opencode models`, so `oc-switch` could not load any
11
+ catalog and every provider showed as unavailable. It now detects the
12
+ OpenCode major version and, on OpenCode 2, reads `opencode models`, which
13
+ already lists only providers with credentials. OpenCode 1 keeps the
14
+ previous commands.
15
+ - **Saved models apply on OpenCode 2.** OpenCode 2 runs prompts through a
16
+ background service that keeps the environment it started with, so new
17
+ models had no effect until a manual restart. Saving now runs
18
+ `opencode service restart` with the new model variables. If the restart
19
+ fails, the models stay saved and `oc-switch` prints a warning that tells you
20
+ to run `opencode service restart` yourself.
21
+ - **`/loop` and `/loop-status` use the runtime in the OpenCode config
22
+ directory.** They called `scripts/loop-state.mjs` and
23
+ `scripts/mission-status.mjs` relative to the project, where those files do
24
+ not exist, and agents improvised their own state writer. Both commands now
25
+ resolve the scripts from
26
+ `${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}`, and a
27
+ missing runtime stops the loop instead of being improvised. `lead` can now
28
+ run `/loop-status`, which its default deny rule blocked.
29
+ - **Dependency audit.** Exact overrides clear new advisories in the shipped
30
+ OpenCode tool dependencies: `effect` (GHSA-chp3-j5qr-2vfr), `glob`,
31
+ `minimatch` and `seroval`. The OpenCode 2 typecheck lockfile also takes
32
+ patched `ip-address`, `undici` and `http-cache-semantics` versions.
33
+ - **Release checks ignore a local CodeGraph index.** The public boundary scan
34
+ no longer fails on a `.codegraph/` directory, which is never packaged.
35
+
36
+ ## Installation or upgrade
37
+
38
+ Install or upgrade the published CLI package:
39
+
40
+ ```bash
41
+ npm install --global opencode-agent-orchestration-kit@1.2.1
42
+ oak version
43
+ oak upgrade --dry-run
44
+ oak upgrade
45
+ ```
46
+
47
+ The npm installation exposes the CLIs but does not mutate OpenCode
48
+ configuration. `oak install` and `oak upgrade` remain separate, explicit
49
+ operations. Run `oak upgrade` to get the new `/loop` and `/loop-status`
50
+ commands in your OpenCode configuration.
51
+
52
+ ## Migration
53
+
54
+ No migration is required. Existing harness configuration remains compatible.
55
+ On OpenCode 2, if you changed models with an earlier `oc-switch`, run
56
+ `opencode service restart` once from a new shell so the service picks them up.
57
+
58
+ ## Validation performed
59
+
60
+ The public contract check, unit and script suite, typechecks for OpenCode 1
61
+ and OpenCode 2, compatibility and supply-chain checks, installation smoke and
62
+ package smoke passed. `oc-switch` was also run against OpenCode 2.4.1: it
63
+ loaded the catalog, and after a save the restarted service ran prompts with
64
+ the saved provider instead of the one in the calling shell. GitHub
65
+ Actions Check was green on the merged pull request before the release tag.
66
+
67
+ ## Public safety boundary
68
+
69
+ The public release excludes private OpenCode and Pi configuration, local
70
+ providers and MCP wiring, credentials, authentication files, provider URLs,
71
+ raw transcripts, private evidence, absolute machine-local paths, and runtime
72
+ state.
73
+
74
+ Boundary statement: no private config, no credentials, no provider URLs, no
75
+ raw transcripts, no machine-local paths.
@@ -16,10 +16,10 @@ the immutable identifier consumed by the repository.
16
16
  | opencode-ai | 1.14.31 | exact version |
17
17
  | @babel/core override | 7.29.7 | exact version |
18
18
  | brace-expansion override | 5.0.12 | exact version |
19
- | seroval override | 1.6.8 | exact version |
20
- | seroval-plugins override | 1.6.8 | exact version |
21
- | toml override | 5.0.1 | exact version |
22
- | uuid override | 14.0.0 | exact version |
19
+ | effect override | 4.0.7 | exact version |
20
+ | glob override | 14.0.2 | exact version |
21
+ | seroval override | 1.6.12 | exact version |
22
+ | seroval-plugins override | 1.6.12 | exact version |
23
23
  | zod override | 4.6.7 | exact version |
24
24
  <!-- supply-chain-pins:end -->
25
25
 
@@ -36,13 +36,20 @@ The exact overrides exist for reviewable reasons: `@babel/core` 7.29.7 removes
36
36
  the audited low-severity findings without an incompatible downgrade,
37
37
  `brace-expansion` 5.0.12 fixes GHSA-mh99-v99m-4gvg, GHSA-rgw5-rvv9-x895,
38
38
  GHSA-6j4f-fj2g-mc7p, GHSA-qhr7-859c-m2p7 and GHSA-q2hr-2g5m-vwhr in the transitive
39
- OpenTUI/Babel resolution, and `uuid` 14.0.0 preserves the already tested
40
- lockfile resolution. `seroval` and `seroval-plugins` 1.6.8 fix
41
- GHSA-p6vx-979v-rg4c and GHSA-jp82-f5mq-hwhp under `solid-js`, which stays at
42
- 1.9.12 because `@opentui/solid` 0.2.5 requires exactly that version; 1.6.8 is
43
- the line `solid-js` 1.9.17 itself depends on. `toml` 5.0.1 fixes
44
- GHSA-4qx8-w7c3-pj3p, GHSA-9j65-hcg3-gc64 and GHSA-9qmh-m7c6-f92p, and `zod` 4.6.7
45
- fixes GHSA-mrhx-c7xc-m3w5, both under the pinned `@opencode-ai/plugin`. Change an override and regenerate the lockfile in the same
39
+ OpenTUI/Babel resolution. `seroval` and `seroval-plugins` 1.6.12 fix
40
+ GHSA-p6vx-979v-rg4c, GHSA-jp82-f5mq-hwhp, GHSA-9wx9-5pv9-3349 and
41
+ GHSA-f86p-h4j2-7qgj under `solid-js`, which stays at 1.9.12 because
42
+ `@opentui/solid` 0.2.5 requires exactly that version; 1.6 is the line
43
+ `solid-js` 1.9.17 itself depends on. `glob` 14.0.2 fixes GHSA-3g3m-2fjr-6pw4
44
+ and, through its `minimatch` 11 range, GHSA-g3hv-75wg-m249 under
45
+ `babel-plugin-module-resolver`; that plugin only calls `glob` for its `root`
46
+ option, which `@opentui/solid` does not pass. `zod` 4.6.7 fixes
47
+ GHSA-mrhx-c7xc-m3w5 under the pinned `@opencode-ai/plugin`. `effect` 4.0.7
48
+ fixes GHSA-chp3-j5qr-2vfr under the same plugin, which pins the vulnerable
49
+ `4.0.0-beta.59` and only uses it for the `Effect.Effect<void>` type in
50
+ `tool.d.ts`; 4.0.7 is the last 4.0 stable release and has no dependencies,
51
+ which also drops the `toml` and `uuid` that only `effect` 4.0.0-beta.59
52
+ pulled in. Change an override and regenerate the lockfile in the same
46
53
  reviewed diff. Review every changed version, `resolved` URL, integrity value,
47
54
  lifecycle script, and Git or non-registry dependency.
48
55
 
@@ -90,9 +97,7 @@ For each surface, also record:
90
97
  signature audit, import, and typecheck evidence.
91
98
  - `brace-expansion` override: advisory rationale, manifest/lockfile diff, low
92
99
  audit, signature audit, import, and full package smoke evidence.
93
- - `uuid` override: compatibility rationale, manifest/lockfile diff, signature
94
- audit, import, and typecheck evidence.
95
- - `seroval`, `seroval-plugins`, `toml` and `zod` overrides: advisory rationale,
100
+ - `effect`, `glob`, `seroval`, `seroval-plugins` and `zod` overrides: advisory rationale,
96
101
  manifest/lockfile diff, low audit, signature audit, import, and OpenCode
97
102
  compatibility smoke evidence.
98
103
 
@@ -25,7 +25,8 @@ permission:
25
25
  "grep *": allow
26
26
  "rg *": allow
27
27
  "node scripts/collect-session-evidence.mjs --iteration *": allow
28
- "node scripts/loop-state.mjs inspect*": allow
28
+ "node *scripts/loop-state.mjs inspect*": allow
29
+ "node *scripts/mission-status.mjs*": allow
29
30
  "node scripts/preflight-audit.mjs --iteration *": allow
30
31
  "tail *": allow
31
32
  "which": allow
@@ -9,8 +9,8 @@ Usa esta consulta para inspeccionar un loop existente sin reanudarlo ni
9
9
  modificarlo.
10
10
 
11
11
  ```bash
12
- node scripts/mission-status.mjs --root /ruta/absoluta/al/repo --slug <slug>
13
- node scripts/mission-status.mjs --root /ruta/absoluta/al/repo --slug <slug> --json
12
+ node "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/scripts/mission-status.mjs" --root /ruta/absoluta/al/repo --slug <slug>
13
+ node "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/scripts/mission-status.mjs" --root /ruta/absoluta/al/repo --slug <slug> --json
14
14
  ```
15
15
 
16
16
  La salida proyecta el snapshot canónico y el último evento validado:
@@ -26,8 +26,22 @@ history_path: .opencode/loops/<slug>.history.jsonl
26
26
  lock_path: .opencode/loops/<slug>.lock
27
27
  human_view_path: .opencode/loops/<slug>.md
28
28
  worktree_mode: explicit_opt_in
29
+ state_runtime: ${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/scripts/loop-state.mjs
30
+ state_runtime_missing: stop_and_report
29
31
  ```
30
32
 
33
+ ## State runtime
34
+
35
+ The state writer is the kit's own `loop-state.mjs`, installed in the OpenCode
36
+ config directory, not in the project. Every `loop-state.mjs` subcommand in this
37
+ command (`inspect`, `init`, `resume`, `record`, `repair`, `migrate`, `release`)
38
+ runs as `node "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/scripts/loop-state.mjs" <subcommand>`
39
+ from the project root. A project-local `scripts/loop-state.mjs` is never used.
40
+
41
+ If that file does not exist, stop and report the missing path. Never create,
42
+ copy, or hand-write a state writer, and never write `.opencode/loops/` files
43
+ directly.
44
+
31
45
  The three-iteration value limits one invocation. The persisted
32
46
  `planned_iteration_budget` (`planned_iterations` in canonical state) is the total budget for the mission and may not
33
47
  exceed the hard ceiling of six; `current_iteration` may never exceed that
@@ -64,7 +78,7 @@ Before any write or handoff to `developer`:
64
78
 
65
79
  1. Read `AGENTS.md`, `PROJECT_CONTEXT.md`, or `docs/ai/project-context.md` when
66
80
  present, plus git state and the minimum relevant repository documentation.
67
- 2. For resume, run only `node scripts/loop-state.mjs inspect` and read the
81
+ 2. For resume, run only `node "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/scripts/loop-state.mjs" inspect` and read the
68
82
  requested Markdown. If state is missing or corrupt, stop; do not silently
69
83
  repair or replace it. `inspect` is read-only and does not acquire the lock.
70
84
  3. Identify pre-existing local changes and mark them protected. If the loop must
@@ -93,9 +107,9 @@ writes. Approval of the original objective is not approval of the concrete
93
107
  After approval, delegate only:
94
108
 
95
109
  1. for a new loop, creation or update of `.opencode/loops/<slug>.md`, followed
96
- by `node scripts/loop-state.mjs init` with git baseline, session, and a
110
+ by `node "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/scripts/loop-state.mjs" init` with git baseline, session, and a
97
111
  unique `action_id`;
98
- 2. for an approved resume, `node scripts/loop-state.mjs resume` with slug,
112
+ 2. for an approved resume, `node "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/scripts/loop-state.mjs" resume` with slug,
99
113
  contract, session, and a new `action_id`.
100
114
 
101
115
  Do not edit those files as `lead`.
@@ -118,7 +132,7 @@ modify `.gitignore` unless explicitly requested.
118
132
  JSON is the source of truth for schema version, approved contract hash, git
119
133
  baseline, session, approval, lease, status, iteration, last completed step,
120
134
  blocking cause, and last action ID. Record every transition with
121
- `node scripts/loop-state.mjs record`. Repeating identical content with the same
135
+ `node "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/scripts/loop-state.mjs" record`. Repeating identical content with the same
122
136
  `action_id` is idempotent; reusing it for different content is an error.
123
137
  Transitions from the same session are serialized inside the durable lock. A
124
138
  retry succeeds only when journal, snapshot, and locks prove a complete commit;
@@ -175,7 +189,7 @@ For sensitive paths use `blocked` or `paused`; never create a silent exception.
175
189
  ## Recovery and repair
176
190
 
177
191
  - An interrupted write can leave the journal ahead of the snapshot. Run
178
- `node scripts/loop-state.mjs repair` to rebuild JSON from the latest complete
192
+ `node "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/scripts/loop-state.mjs" repair` to rebuild JSON from the latest complete
179
193
  event.
180
194
  - Repair validates continuity of slug, contract, baseline, approval, iteration,
181
195
  and lease before trusting `state_after`.
@@ -44,7 +44,9 @@ generate or modify frontmatter.
44
44
  run anything, writes included. Measured: `lead` implemented on its own with
45
45
  grep/glob/read/bash instead of delegating. It is now `"*": deny` with a
46
46
  read-only allowlist, plus the exact scripts its own commands tell it to run
47
- (`loop-state.mjs inspect`, `preflight-audit.mjs`). A shell plugin that
47
+ (`loop-state.mjs inspect` and `mission-status.mjs`, matched by
48
+ `node *scripts/...` because `/loop` and `/loop-status` run them from the
49
+ config directory; `preflight-audit.mjs`). A shell plugin that
48
50
  rewrites commands must have its rewritten forms allowlisted too, or they fall
49
51
  through to the deny.
50
52
  - `lead` emits its routing decision as **fields, not prose**: `route`,
@@ -159,6 +159,10 @@ Criteria:
159
159
  - `scripts/loop-state.mjs` performs atomic writes, requires idempotent
160
160
  `action_id` values, rejects a different contract, prevents simultaneous
161
161
  resumes, and serializes concurrent transitions from the same session.
162
+ - `/loop` runs the kit's `scripts/loop-state.mjs` from the OpenCode config
163
+ directory (`${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}`),
164
+ never a project-local copy. If it is missing, `/loop` stops and reports; it
165
+ never improvises a state writer.
162
166
  - Each iteration allows one focused `developer` change; `reviewer` has exclusive
163
167
  authority to approve or escalate.
164
168
  - `developer` synchronizes the verdict into state without mixing in
@@ -180,7 +184,7 @@ Contract: `lead` read-only projection.
180
184
 
181
185
  `/loop-status --slug <slug>` inspects the canonical snapshot and append-only
182
186
  history without acquiring a write lock or changing files. Use
183
- `node scripts/mission-status.mjs --root /absolute/repository --slug <slug>`
187
+ `node "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/scripts/mission-status.mjs" --root /absolute/repository --slug <slug>`
184
188
  when an explicit repository root is needed. If state is missing, stale, or
185
189
  corrupt, report the durable error and do not repair or resume automatically.
186
190