opencode-agent-orchestration-kit 1.0.37 → 1.0.39
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 +61 -4
- package/docker/open-design/Dockerfile +3 -1
- package/docker/open-design/entrypoint.mjs +61 -0
- package/docs/docker-open-design.md +5 -0
- package/docs/models.md +30 -0
- package/docs/open-design.md +8 -0
- package/docs/releases/v1.0.38.md +44 -0
- package/docs/releases/v1.0.39.md +44 -0
- package/opencode/tools/open-design-http.d.mts +45 -0
- package/opencode/tools/open-design-http.mjs +387 -0
- package/opencode/tools/open_design.ts +1 -102
- package/package.json +5 -3
- package/scripts/check-supply-chain.mjs +4 -1
- package/scripts/check-supply-chain.test.mjs +6 -5
- package/scripts/check.sh +4 -2
- package/scripts/oak.test.mjs +9 -2
- package/scripts/oc-switch.mjs +472 -0
- package/scripts/oc-switch.test.mjs +217 -0
- package/scripts/open-design-entrypoint.test.mjs +54 -0
- package/scripts/open-design-http.test.mjs +211 -0
- package/scripts/package-smoke.mjs +16 -2
- package/scripts/package-smoke.test.mjs +7 -5
- package/scripts/version.test.mjs +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# OpenCode Agent Orchestration Kit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit/actions/workflows/check.yml"><img src="https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit/actions/workflows/check.yml/badge.svg" alt="Check"></a>
|
|
5
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/jcarlosrodicio/opencode-agent-orchestration-kit" alt="License"></a>
|
|
6
|
+
<a href="https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit/releases"><img src="https://img.shields.io/github/v/release/jcarlosrodicio/opencode-agent-orchestration-kit" alt="Latest release"></a>
|
|
7
|
+
<a href="https://github.com/sponsors/jcarlosrodicio"><img src="https://img.shields.io/badge/Sponsor-GitHub%20Sponsors-ea4aaa?logo=githubsponsors&logoColor=white" alt="Sponsor on GitHub"></a>
|
|
8
|
+
</p>
|
|
6
9
|
|
|
7
10
|
A reproducible product-development workflow for OpenCode.
|
|
8
11
|
|
|
@@ -297,6 +300,58 @@ export OPENCODE_EVOLVER_MODEL="$OPENCODE_MODEL"
|
|
|
297
300
|
|
|
298
301
|
You can use one model for every role or assign different models depending on cost, speed, and task complexity.
|
|
299
302
|
|
|
303
|
+
### Interactive OpenCode model switching
|
|
304
|
+
|
|
305
|
+
The repository also includes `oc-switch`, a standalone TUI for changing the
|
|
306
|
+
OpenCode default model, small/title model, and per-agent overrides. It builds
|
|
307
|
+
its provider list from OpenCode itself and reads the local model catalog from
|
|
308
|
+
`opencode models --pure`, so it only shows providers configured in your
|
|
309
|
+
OpenCode installation. Startup is cache-first; press `r` when you want an
|
|
310
|
+
explicit remote catalog refresh through `--refresh`. It does not share a
|
|
311
|
+
catalog with Pi.
|
|
312
|
+
|
|
313
|
+
From this checkout, run:
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
npm run oc-switch
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
To install the command globally with npm from the cloned checkout:
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
npm install --global .
|
|
323
|
+
oc-switch
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
After a tagged release is published, you can install the same CLI directly
|
|
327
|
+
from GitHub without keeping a checkout:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
npm install --global "git+https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit.git#v1.0.39"
|
|
331
|
+
oc-switch
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
The package exposes `oc-switch` through its npm `bin` entry; no separate
|
|
335
|
+
wrapper or shell alias is required. Keep `~/.npm-global/bin` (or your npm
|
|
336
|
+
global bin directory) on `PATH` if npm is configured with a user prefix.
|
|
337
|
+
|
|
338
|
+
#### `oc-switch` quick guide
|
|
339
|
+
|
|
340
|
+
- `↑`/`↓` moves through `Default`, `Small/title`, and the agent rows.
|
|
341
|
+
- `Enter` or `/` opens the model picker for the focused row.
|
|
342
|
+
- Type to filter the current OpenCode catalog; `q`, `r`, and `s` are search
|
|
343
|
+
characters while the picker is open. `Backspace` deletes one character.
|
|
344
|
+
- `Enter` applies the highlighted model. `Space` marks several agent rows so
|
|
345
|
+
one selection can be applied to all of them.
|
|
346
|
+
- `s` saves. `q` saves and exits. `Esc` returns to the assignment list, and
|
|
347
|
+
`r` explicitly refreshes OpenCode's catalog.
|
|
348
|
+
|
|
349
|
+
The selected values are persisted in the OpenCode model-switcher state and in
|
|
350
|
+
the managed model block of `.zshrc` or `.bashrc`.
|
|
351
|
+
|
|
352
|
+
Pi has its own independent `pi-switch`; its catalog comes only from Pi's
|
|
353
|
+
`pi --list-models` command.
|
|
354
|
+
|
|
300
355
|
### 3. Install local plugin dependencies
|
|
301
356
|
|
|
302
357
|
```bash
|
|
@@ -677,7 +732,7 @@ Validate only the canonical identity and current release note with:
|
|
|
677
732
|
|
|
678
733
|
```bash
|
|
679
734
|
npm run check:version
|
|
680
|
-
node scripts/version.mjs --check-tag v1.0.
|
|
735
|
+
node scripts/version.mjs --check-tag v1.0.39
|
|
681
736
|
```
|
|
682
737
|
|
|
683
738
|
Tag validation compares an explicitly supplied tag with the package identity.
|
|
@@ -880,6 +935,8 @@ definitions, exact pins, evidence, and scope.
|
|
|
880
935
|
|
|
881
936
|
Contributions are welcome.
|
|
882
937
|
|
|
938
|
+
Found a bug or have an idea? [Open an issue](https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit/issues/new/choose) · [Browse existing issues](https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit/issues)
|
|
939
|
+
|
|
883
940
|
Good contributions include:
|
|
884
941
|
|
|
885
942
|
- Clearer documentation.
|
|
@@ -37,6 +37,8 @@ NODE
|
|
|
37
37
|
RUN pnpm --filter @open-design/daemon build \
|
|
38
38
|
&& (pnpm build || pnpm -r build)
|
|
39
39
|
|
|
40
|
+
COPY entrypoint.mjs /usr/local/bin/open-design-entrypoint.mjs
|
|
41
|
+
|
|
40
42
|
ENV OD_HOST=0.0.0.0
|
|
41
43
|
ENV OD_PORT=7456
|
|
42
44
|
ENV OPENCODE_CONFIG_DIR=/home/opencode/.config/opencode
|
|
@@ -47,4 +49,4 @@ RUN mkdir -p /home/opencode/.config/opencode /home/opencode/.local/share/opencod
|
|
|
47
49
|
USER opencode
|
|
48
50
|
EXPOSE 7456
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
ENTRYPOINT ["node", "/usr/local/bin/open-design-entrypoint.mjs"]
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const DEFAULT_PORT = "7456";
|
|
8
|
+
const DAEMON_ENTRYPOINT = "apps/daemon/dist/cli.js";
|
|
9
|
+
|
|
10
|
+
export function parsePort(rawPort) {
|
|
11
|
+
if (typeof rawPort !== "string" || !/^[0-9]+$/.test(rawPort)) {
|
|
12
|
+
throw new Error("OD_PORT must be a decimal TCP port between 1 and 65535");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const port = Number(rawPort);
|
|
16
|
+
if (!Number.isSafeInteger(port) || port < 1 || port > 65535) {
|
|
17
|
+
throw new Error("OD_PORT must be a decimal TCP port between 1 and 65535");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return port;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function daemonArguments(port) {
|
|
24
|
+
return [DAEMON_ENTRYPOINT, "--port", String(port), "--no-open"];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function main() {
|
|
28
|
+
let port;
|
|
29
|
+
try {
|
|
30
|
+
port = parsePort(process.env.OD_PORT ?? DEFAULT_PORT);
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error(`Open Design startup failed: ${error.message}`);
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const daemon = spawn(process.execPath, daemonArguments(port), { stdio: "inherit" });
|
|
38
|
+
const forwardSignal = (signal) => daemon.kill(signal);
|
|
39
|
+
const cleanup = () => {
|
|
40
|
+
process.removeListener("SIGINT", onSigint);
|
|
41
|
+
process.removeListener("SIGTERM", onSigterm);
|
|
42
|
+
};
|
|
43
|
+
const onSigint = () => forwardSignal("SIGINT");
|
|
44
|
+
const onSigterm = () => forwardSignal("SIGTERM");
|
|
45
|
+
|
|
46
|
+
process.once("SIGINT", onSigint);
|
|
47
|
+
process.once("SIGTERM", onSigterm);
|
|
48
|
+
daemon.once("error", (error) => {
|
|
49
|
+
cleanup();
|
|
50
|
+
console.error(`Open Design daemon failed to start: ${error.message}`);
|
|
51
|
+
process.exitCode = 1;
|
|
52
|
+
});
|
|
53
|
+
daemon.once("exit", (code, signal) => {
|
|
54
|
+
cleanup();
|
|
55
|
+
process.exitCode = signal ? 1 : (code ?? 1);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
60
|
+
main();
|
|
61
|
+
}
|
|
@@ -45,6 +45,11 @@ The compose file mounts:
|
|
|
45
45
|
|
|
46
46
|
Do not commit `data` or `opencode-auth`.
|
|
47
47
|
|
|
48
|
+
`OD_PORT` must be a decimal TCP port from `1` to `65535`; it defaults to
|
|
49
|
+
`7456`. The image validates this value before starting the daemon and passes it
|
|
50
|
+
as a separate argument without a shell. Invalid values stop the container with
|
|
51
|
+
a deterministic startup error.
|
|
52
|
+
|
|
48
53
|
## HTTP LAN and crypto.randomUUID
|
|
49
54
|
|
|
50
55
|
Some browser APIs require a secure context. If Open Design frontend code calls `crypto.randomUUID` and your browser blocks it over HTTP LAN, prefer HTTPS. Only patch upstream frontend code as a local operational workaround.
|
package/docs/models.md
CHANGED
|
@@ -14,4 +14,34 @@ export OPENCODE_RESEARCHER_MODEL="openai/gpt-5.5"
|
|
|
14
14
|
export OPENCODE_REVIEWER_MODEL="openai/gpt-5.5"
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
## Interactive switching
|
|
18
|
+
|
|
19
|
+
Run `npm run oc-switch` from a checkout, or install the CLI globally with npm:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install --global .
|
|
23
|
+
oc-switch
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Once a release tag exists, a checkout is optional:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install --global "git+https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit.git#v1.0.39"
|
|
30
|
+
oc-switch
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The TUI reads available models from OpenCode's own local `opencode models --pure`
|
|
34
|
+
catalog and discovers configured providers through OpenCode; it does not use
|
|
35
|
+
Pi's catalog. Startup is cache-first. Press `r` to request an explicit remote
|
|
36
|
+
refresh with `opencode models --pure --refresh`.
|
|
37
|
+
|
|
38
|
+
`Default` changes `OPENCODE_MODEL`, `Small/title` changes
|
|
39
|
+
`OPENCODE_SMALL_MODEL`, and agent rows change their corresponding
|
|
40
|
+
`OPENCODE_<AGENT>_MODEL` override. Press `Enter` or `/` to open the picker;
|
|
41
|
+
while it is open, all printable letters—including `q`, `r`, and `s`—filter the
|
|
42
|
+
catalog. Use `Enter` to apply, `Esc` to go back, `s` to save, and `q` to save
|
|
43
|
+
and exit. `Space` marks several agents for one assignment. The state is kept
|
|
44
|
+
under the XDG state directory and the model variables are updated in the
|
|
45
|
+
managed block of `.zshrc` or `.bashrc`.
|
|
46
|
+
|
|
17
47
|
Keep provider credentials in your shell, password manager, or OpenCode auth flow. Do not commit credentials.
|
package/docs/open-design.md
CHANGED
|
@@ -23,3 +23,11 @@ Do not use project or file URLs.
|
|
|
23
23
|
## Security
|
|
24
24
|
|
|
25
25
|
Do not expose Open Design directly to the Internet without authentication, VPN, Tailscale, WireGuard, or a secure reverse proxy.
|
|
26
|
+
|
|
27
|
+
## Runtime budgets
|
|
28
|
+
|
|
29
|
+
The Open Design client uses fixed safety budgets for remote calls: 5 seconds to
|
|
30
|
+
receive response headers, 15 seconds of read-idle time, 120 seconds total per
|
|
31
|
+
request, 1 MiB for JSON responses, 8 MiB for SSE responses, 2 MiB per stdout or
|
|
32
|
+
stderr channel, and 10,000 SSE events. Oversized, stalled, or incomplete
|
|
33
|
+
responses fail with a bounded diagnostic instead of being retained indefinitely.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# v1.0.38 - Safe lifecycle and canonical release identity
|
|
2
|
+
|
|
3
|
+
This release adds a standalone OpenCode model switcher for quickly assigning
|
|
4
|
+
configured models to the default, small/title, and individual agent routes.
|
|
5
|
+
|
|
6
|
+
## Highlights
|
|
7
|
+
|
|
8
|
+
- `oc-switch` provides a bounded interactive TUI with search, refresh, multi-agent selection, and persistent model assignments.
|
|
9
|
+
- The catalog is read from the current OpenCode installation and is independent from Pi's model catalog.
|
|
10
|
+
- The public README and model-routing documentation describe installation and shell persistence behavior.
|
|
11
|
+
|
|
12
|
+
## Installation or upgrade
|
|
13
|
+
|
|
14
|
+
Install or upgrade the public kit using the normal manifest-owned flow:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
./install.sh --dry-run
|
|
18
|
+
./install.sh
|
|
19
|
+
./upgrade.sh --dry-run
|
|
20
|
+
./upgrade.sh
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
After installation, run `oc-switch` from the checkout or global package. The
|
|
24
|
+
README and [model guide](../models.md) include both the local `npm run
|
|
25
|
+
oc-switch` path and the global `npm install --global` path, plus the keyboard
|
|
26
|
+
guide.
|
|
27
|
+
|
|
28
|
+
## Migration
|
|
29
|
+
|
|
30
|
+
No migration is required. Existing OpenCode model variables remain valid; the
|
|
31
|
+
switcher adds an interactive way to edit them.
|
|
32
|
+
|
|
33
|
+
## Validation performed
|
|
34
|
+
|
|
35
|
+
The public contract checker, unit and script tests, type checks, dependency
|
|
36
|
+
audits, signature checks, installation smoke, package smoke, and canonical
|
|
37
|
+
version/tag checks pass for this release.
|
|
38
|
+
|
|
39
|
+
## Public safety boundary
|
|
40
|
+
|
|
41
|
+
The public release excludes private OpenCode and Pi configuration, local
|
|
42
|
+
providers and MCP wiring, credentials, authentication files, raw transcripts,
|
|
43
|
+
private evidence, absolute machine paths, and runtime state. Pi uses its own
|
|
44
|
+
native model catalog and is not included in this OpenCode package.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# v1.0.39 - Safe lifecycle and canonical release identity
|
|
2
|
+
|
|
3
|
+
This release hardens the Open Design HTTP and SSE transport and its Docker
|
|
4
|
+
entrypoint for bounded, fail-closed operation.
|
|
5
|
+
|
|
6
|
+
## Highlights
|
|
7
|
+
|
|
8
|
+
- Bound Open Design connection, total, and idle-read timeouts.
|
|
9
|
+
- Bound JSON response bodies, SSE bytes, event counts, and captured output.
|
|
10
|
+
- Keep transport failures and diagnostics from returning unbounded remote data.
|
|
11
|
+
- Harden the Open Design Docker entrypoint's startup and signal lifecycle.
|
|
12
|
+
|
|
13
|
+
## Installation or upgrade
|
|
14
|
+
|
|
15
|
+
Install or upgrade the public kit using the normal manifest-owned flow:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
./install.sh --dry-run
|
|
19
|
+
./install.sh
|
|
20
|
+
./upgrade.sh --dry-run
|
|
21
|
+
./upgrade.sh
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
After installation, run `oak check` and review the installed target before
|
|
25
|
+
using the harness.
|
|
26
|
+
|
|
27
|
+
## Migration
|
|
28
|
+
|
|
29
|
+
No migration is required. Existing Open Design configuration remains valid;
|
|
30
|
+
requests that exceed the transport budgets now fail closed with bounded error
|
|
31
|
+
messages.
|
|
32
|
+
|
|
33
|
+
## Validation performed
|
|
34
|
+
|
|
35
|
+
The public contract checker, unit and script tests, type checks, dependency
|
|
36
|
+
audits, signature checks, installation smoke, package smoke, and canonical
|
|
37
|
+
version/tag checks pass for this release.
|
|
38
|
+
|
|
39
|
+
## Public safety boundary
|
|
40
|
+
|
|
41
|
+
The public release excludes private OpenCode and Pi configuration, local
|
|
42
|
+
providers and MCP wiring, credentials, authentication files, raw transcripts,
|
|
43
|
+
private evidence, absolute machine paths, and runtime state. Pi uses its own
|
|
44
|
+
native model catalog and is not included in this OpenCode package.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type OpenDesignHttpOptions = {
|
|
2
|
+
fetchImpl?: typeof fetch
|
|
3
|
+
connectTimeoutMs?: number
|
|
4
|
+
totalTimeoutMs?: number
|
|
5
|
+
idleTimeoutMs?: number
|
|
6
|
+
maxJsonBytes?: number
|
|
7
|
+
maxSseBytes?: number
|
|
8
|
+
maxOutputBytes?: number
|
|
9
|
+
maxEvents?: number
|
|
10
|
+
maxDiagnosticBytes?: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const OPEN_DESIGN_HTTP_LIMITS: Readonly<{
|
|
14
|
+
connectTimeoutMs: number
|
|
15
|
+
totalTimeoutMs: number
|
|
16
|
+
idleTimeoutMs: number
|
|
17
|
+
maxJsonBytes: number
|
|
18
|
+
maxSseBytes: number
|
|
19
|
+
maxOutputBytes: number
|
|
20
|
+
maxEvents: number
|
|
21
|
+
maxDiagnosticBytes: number
|
|
22
|
+
}>
|
|
23
|
+
|
|
24
|
+
export function requestJson(
|
|
25
|
+
base: string,
|
|
26
|
+
path: string,
|
|
27
|
+
init?: RequestInit,
|
|
28
|
+
options?: OpenDesignHttpOptions,
|
|
29
|
+
): Promise<unknown>
|
|
30
|
+
|
|
31
|
+
export function parseSseFrames(buffer: string): {
|
|
32
|
+
frames: Array<{ event: string; data: unknown }>
|
|
33
|
+
rest: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function streamOpenDesignChat(
|
|
37
|
+
base: string,
|
|
38
|
+
body: unknown,
|
|
39
|
+
options?: OpenDesignHttpOptions,
|
|
40
|
+
): Promise<{
|
|
41
|
+
stdout: string
|
|
42
|
+
stderr: string
|
|
43
|
+
end: unknown
|
|
44
|
+
eventsCount: number
|
|
45
|
+
}>
|