@meego-harness/opencode-worker 0.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 ADDED
@@ -0,0 +1,51 @@
1
+ # @meego-harness/opencode-worker
2
+
3
+ Standalone worker bridge that runs tasks through the OpenCode CLI and connects to a meego-harness worker server.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ meego-opencode-worker setup
9
+ meego-opencode-worker list
10
+ meego-opencode-worker doctor
11
+ meego-opencode-worker start --worker <workerId>
12
+ meego-opencode-worker stop --worker <workerId>
13
+ meego-opencode-worker uninstall --worker <workerId>
14
+ ```
15
+
16
+ Use `--opencode-shell` when `opencode` is only available through the user's interactive shell configuration.
17
+
18
+ ## Setup Inputs
19
+
20
+ Non-interactive setup accepts:
21
+
22
+ ```bash
23
+ meego-opencode-worker setup \
24
+ --server-url ws://127.0.0.1:3000/workers \
25
+ --email worker@example.com \
26
+ --worker opencode-worker-1 \
27
+ --capability-summary "Handles TypeScript work" \
28
+ --workspace <workspace-root> \
29
+ --permission-preset default \
30
+ --model anthropic/claude-sonnet-4-5 \
31
+ --variant high \
32
+ --agent build
33
+ ```
34
+
35
+ The worker runs tasks with `opencode run --format json`. `--permission-preset full-access` adds
36
+ `--dangerously-skip-permissions`; `safe` and `default` leave OpenCode permission handling unchanged.
37
+
38
+ | Preset | OpenCode behavior |
39
+ | --- | --- |
40
+ | `safe` | Do not skip permissions |
41
+ | `default` | Do not skip permissions |
42
+ | `full-access` | Pass `--dangerously-skip-permissions` |
43
+
44
+ ## Task Metadata
45
+
46
+ | Key | Type | Description |
47
+ | --- | --- | --- |
48
+ | `repo` | string | Repository directory under the configured workspace or an explicit repo mapping |
49
+ | `openCodeVariant` | string | Provider-specific model variant, for example `high` or `max` |
50
+ | `openCodeAgent` | string | OpenCode agent name, for example `build` or `plan` |
51
+ | `openCodePlanMode` | boolean | Prepends a planning-only preamble on the first message in that context |
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ import process from 'node:process'
4
+ import { runOpenCodeWorkerCli } from '../dist/cli.js'
5
+
6
+ runOpenCodeWorkerCli().catch((error) => {
7
+ console.error(error instanceof Error ? error.message : 'OpenCode worker CLI failed')
8
+ process.exitCode = 1
9
+ })