@amends-dev/harness-opencode 0.2.0 → 0.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 +8 -8
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @amends-dev/harness-opencode
|
|
2
2
|
|
|
3
|
-
opencode as an agent for the [`@amends-dev/harness`](
|
|
3
|
+
opencode as an agent for the [`@amends-dev/harness`](../harness) contract. opencode
|
|
4
4
|
works in the sandbox behind its bridge, a program the agent's template installs there with opencode
|
|
5
5
|
itself: the bridge drives opencode's server, and hosts reach the bridge over a WebSocket on a port
|
|
6
6
|
of the sandbox's. Nothing else of opencode is exposed outside the sandbox, and hosts that start
|
|
@@ -27,8 +27,8 @@ request; they share everything but the opencode they run and the session API the
|
|
|
27
27
|
bun add @amends-dev/harness-opencode @amends-dev/harness @amends-dev/sandbox effect
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
Add a sandbox provider, such as [`@amends-dev/sandbox-local`](
|
|
31
|
-
[`@amends-dev/sandbox-daytona`](
|
|
30
|
+
Add a sandbox provider, such as [`@amends-dev/sandbox-local`](https://github.com/amends-dev/sandbox/tree/main/packages/sandbox-local) for this machine or
|
|
31
|
+
[`@amends-dev/sandbox-daytona`](https://github.com/amends-dev/sandbox/tree/main/packages/sandbox-daytona). The host runs on Bun: `OpencodeAgent.make`
|
|
32
32
|
bundles the bridge program with `Bun.build`. It needs Effect's `Crypto` and a
|
|
33
33
|
`Socket.WebSocketConstructor` that sends headers, as `@effect/platform-bun` provides them.
|
|
34
34
|
|
|
@@ -80,7 +80,7 @@ replace: `provider` for `OpencodeAgent`, as opencode 1 names them, and `provider
|
|
|
80
80
|
`Opencode2Agent`, as opencode 2 does. `env` is the environment variables opencode's server runs
|
|
81
81
|
with. Both take effect when the bridge starts the server. All of the options, the keys included,
|
|
82
82
|
name the bridge, so an agent made with other options gets a bridge and a server of its own in a
|
|
83
|
-
sandbox, and never runs on another's. [`@amends-dev/harness`](
|
|
83
|
+
sandbox, and never runs on another's. [`@amends-dev/harness`](../harness/README.md) says
|
|
84
84
|
how sessions, turns, and releasing a session work, which these agents do as any agent does.
|
|
85
85
|
`Opencode2Agent.make` takes the same options.
|
|
86
86
|
|
|
@@ -212,13 +212,13 @@ agent cannot read; and `UnknownError` for the rest.
|
|
|
212
212
|
|
|
213
213
|
## Development
|
|
214
214
|
|
|
215
|
-
Run the package's tests with `bun run test
|
|
215
|
+
Run the package's tests with `bun run test packages/harness-opencode`: each agent's sessions against
|
|
216
216
|
a fake of opencode's server, scripted turn by turn, and the translation of its events and
|
|
217
217
|
conversations, under `test/v1` and `test/v2`; the server and the bridge program as real processes,
|
|
218
218
|
with `test/fake-opencode-server.js` standing in for `opencode serve`; the bridge launched by
|
|
219
219
|
`BridgeClient` in a sandbox on this machine and reached over a WebSocket; and the template with its
|
|
220
220
|
commands answered as a sandbox would answer them. With `AMENDS_TEST_OPENCODE=1`, the live tests run
|
|
221
221
|
`opencode` and `opencode2` from this machine's `PATH` under the agents, whose turns OpenCode Zen's
|
|
222
|
-
free model answers.
|
|
223
|
-
`bun run dist check
|
|
224
|
-
consumer
|
|
222
|
+
free model answers.
|
|
223
|
+
`bun run dist check packages/harness-opencode` builds the package as npm gets it and checks it as a
|
|
224
|
+
consumer.
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amends-dev/harness-opencode",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "opencode as an agent for the @amends-dev/harness contract: opencode works in a sandbox behind its bridge, which the agent's template installs there.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"homepage": "https://github.com/amends-dev/
|
|
6
|
+
"homepage": "https://github.com/amends-dev/harness/tree/main/packages/harness-opencode#readme",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/amends-dev/
|
|
10
|
-
"directory": "
|
|
9
|
+
"url": "https://github.com/amends-dev/harness.git",
|
|
10
|
+
"directory": "packages/harness-opencode"
|
|
11
11
|
},
|
|
12
12
|
"bugs": {
|
|
13
|
-
"url": "https://github.com/amends-dev/
|
|
13
|
+
"url": "https://github.com/amends-dev/harness/issues"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"agent",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"./internal/*": null
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@amends-dev/harness": "^0.2.
|
|
32
|
-
"@amends-dev/sandbox": "^0.2.
|
|
31
|
+
"@amends-dev/harness": "^0.2.1",
|
|
32
|
+
"@amends-dev/sandbox": "^0.2.1",
|
|
33
33
|
"@effect/platform-bun": "^4.0.5"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|