@agentproto/adapter-opencode 0.1.0-alpha.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/LICENSE +21 -0
- package/OPENCODE.md +93 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.mjs +116 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 agentproto contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/OPENCODE.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: opencode
|
|
3
|
+
id: opencode
|
|
4
|
+
description: sst/opencode — open-source coding agent with first-party ACP mode. Spawned as `npx -y opencode-ai acp`, drives the agent over stdio JSON-RPC. Multi-provider (Anthropic, OpenAI, Groq, OpenRouter, OpenCode-hosted, …) — operator picks the underlying model via env-keyed provider auth.
|
|
5
|
+
version: 0.1.0
|
|
6
|
+
bin: npx
|
|
7
|
+
bin_args: ["-y", "opencode-ai", "acp"]
|
|
8
|
+
install:
|
|
9
|
+
- method: npm
|
|
10
|
+
package: opencode-ai
|
|
11
|
+
global: true
|
|
12
|
+
- method: curl
|
|
13
|
+
url: https://opencode.ai/install
|
|
14
|
+
version_check:
|
|
15
|
+
cmd: npm view opencode-ai version
|
|
16
|
+
parse: "(\\d+\\.\\d+\\.\\d+)"
|
|
17
|
+
range: ">=1.0.0"
|
|
18
|
+
timeout_ms: 15000
|
|
19
|
+
auth:
|
|
20
|
+
ref: ./SECRETS.md
|
|
21
|
+
state:
|
|
22
|
+
env: [OPENCODE_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, GROQ_API_KEY]
|
|
23
|
+
sandbox: ./SANDBOX.md
|
|
24
|
+
protocol: acp
|
|
25
|
+
acp: ./opencode-acp.ACP.md
|
|
26
|
+
session:
|
|
27
|
+
mode: persistent
|
|
28
|
+
idle_timeout_ms: 1800000
|
|
29
|
+
context_carryover: true
|
|
30
|
+
models:
|
|
31
|
+
default: anthropic/claude-sonnet-4-6
|
|
32
|
+
allowed:
|
|
33
|
+
- anthropic/claude-sonnet-4-6
|
|
34
|
+
- anthropic/claude-opus-4-7
|
|
35
|
+
- anthropic/claude-haiku-4-5
|
|
36
|
+
- openai/gpt-5
|
|
37
|
+
- openai/gpt-5-mini
|
|
38
|
+
- openrouter/anthropic/claude-sonnet-4-6
|
|
39
|
+
env:
|
|
40
|
+
anthropic: ANTHROPIC_API_KEY
|
|
41
|
+
openai: OPENAI_API_KEY
|
|
42
|
+
openrouter: OPENROUTER_API_KEY
|
|
43
|
+
opencode: OPENCODE_API_KEY
|
|
44
|
+
groq: GROQ_API_KEY
|
|
45
|
+
capabilities:
|
|
46
|
+
streaming: true
|
|
47
|
+
tool_calls: true
|
|
48
|
+
sub_agents: false
|
|
49
|
+
file_io: true
|
|
50
|
+
multimodal: true
|
|
51
|
+
resumable: true
|
|
52
|
+
bidirectional: true
|
|
53
|
+
tags: ["opencode", "sst", "acp", "agent-runtime", "coding"]
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
# OpenCode adapter
|
|
57
|
+
|
|
58
|
+
`@agentproto/adapter-opencode` wraps **sst/opencode** as an AIP-45 agent
|
|
59
|
+
CLI. OpenCode ships its own ACP server — no third-party wrapper is
|
|
60
|
+
needed; the adapter spawns `npx -y opencode-ai acp` and drives the
|
|
61
|
+
agent over stdio JSON-RPC.
|
|
62
|
+
|
|
63
|
+
## Why OpenCode
|
|
64
|
+
|
|
65
|
+
- Multi-provider (Anthropic, OpenAI, OpenRouter, Groq, OpenCode hosted)
|
|
66
|
+
- First-party ACP mode (vs claude-code which needs a wrapper)
|
|
67
|
+
- MIT-licensed, broad community plugin surface
|
|
68
|
+
|
|
69
|
+
## Install
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# npm (global)
|
|
73
|
+
npm install -g opencode-ai
|
|
74
|
+
|
|
75
|
+
# or curl bootstrap
|
|
76
|
+
curl -fsSL https://opencode.ai/install | bash
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The npx form `npx -y opencode-ai acp` works without a global install
|
|
80
|
+
— the adapter prefers this for ephemeral / sandboxed spawns.
|
|
81
|
+
|
|
82
|
+
## Auth
|
|
83
|
+
|
|
84
|
+
OpenCode reads provider keys from the environment. Set whichever
|
|
85
|
+
provider the operator's `models.default` is pinned to:
|
|
86
|
+
|
|
87
|
+
| Provider | Env var |
|
|
88
|
+
|--------------|-----------------------|
|
|
89
|
+
| Anthropic | `ANTHROPIC_API_KEY` |
|
|
90
|
+
| OpenAI | `OPENAI_API_KEY` |
|
|
91
|
+
| OpenRouter | `OPENROUTER_API_KEY` |
|
|
92
|
+
| Groq | `GROQ_API_KEY` |
|
|
93
|
+
| OpenCode SaaS| `OPENCODE_API_KEY` |
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AgentCliHandle, AgentCliRuntime } from '@agentproto/driver-agent-cli';
|
|
2
|
+
export { AgentCliHandle, AgentCliRuntime } from '@agentproto/driver-agent-cli';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @agentproto/adapter-opencode — AIP-45 adapter for sst/opencode.
|
|
6
|
+
*
|
|
7
|
+
* OpenCode ships first-party ACP support (`opencode acp`) so no
|
|
8
|
+
* third-party wrapper is needed. We spawn it via `npx -y opencode-ai
|
|
9
|
+
* acp` and drive it over stdio JSON-RPC the same way the claude-code
|
|
10
|
+
* adapter drives @agentclientprotocol/claude-agent-acp.
|
|
11
|
+
*
|
|
12
|
+
* import { opencode, opencodeRuntime } from "@agentproto/adapter-opencode"
|
|
13
|
+
* const session = await opencodeRuntime().start({
|
|
14
|
+
* env: { ANTHROPIC_API_KEY: "sk-..." },
|
|
15
|
+
* })
|
|
16
|
+
* for await (const evt of session.send({ role: "user", content: "..." })) {
|
|
17
|
+
* console.log(evt)
|
|
18
|
+
* }
|
|
19
|
+
* await session.close()
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
declare const opencode: AgentCliHandle;
|
|
23
|
+
declare function opencodeRuntime(): AgentCliRuntime;
|
|
24
|
+
|
|
25
|
+
export { opencode, opencodeRuntime };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { defineAgentCli, createAgentCliRuntime } from '@agentproto/driver-agent-cli';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @agentproto/adapter-opencode v0.1.0-alpha
|
|
5
|
+
* AIP-45 adapter for sst/opencode via its built-in `opencode acp` mode.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
var opencode = defineAgentCli({
|
|
9
|
+
name: "opencode",
|
|
10
|
+
id: "opencode",
|
|
11
|
+
description: "sst/opencode \u2014 open-source coding agent with first-party ACP mode. Spawned via `npx -y opencode-ai acp` and driven over stdio JSON-RPC. Multi-provider (Anthropic / OpenAI / OpenRouter / Groq / OpenCode hosted).",
|
|
12
|
+
version: "0.1.0",
|
|
13
|
+
bin: "npx",
|
|
14
|
+
bin_args: ["-y", "opencode-ai", "acp"],
|
|
15
|
+
install: [
|
|
16
|
+
{ method: "npm", package: "opencode-ai", global: true },
|
|
17
|
+
{ method: "curl", url: "https://opencode.ai/install" }
|
|
18
|
+
],
|
|
19
|
+
version_check: {
|
|
20
|
+
cmd: "npm view opencode-ai version",
|
|
21
|
+
parse: "(\\d+\\.\\d+\\.\\d+)",
|
|
22
|
+
range: ">=1.0.0",
|
|
23
|
+
timeout_ms: 15e3
|
|
24
|
+
},
|
|
25
|
+
auth: {
|
|
26
|
+
ref: "./SECRETS.md",
|
|
27
|
+
state: {
|
|
28
|
+
env: [
|
|
29
|
+
"OPENCODE_API_KEY",
|
|
30
|
+
"ANTHROPIC_API_KEY",
|
|
31
|
+
"OPENAI_API_KEY",
|
|
32
|
+
"OPENROUTER_API_KEY",
|
|
33
|
+
"GROQ_API_KEY"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
sandbox: "./SANDBOX.md",
|
|
38
|
+
protocol: "acp",
|
|
39
|
+
acp: "./opencode-acp.ACP.md",
|
|
40
|
+
session: {
|
|
41
|
+
mode: "persistent",
|
|
42
|
+
idle_timeout_ms: 18e5,
|
|
43
|
+
context_carryover: true
|
|
44
|
+
},
|
|
45
|
+
models: {
|
|
46
|
+
default: "anthropic/claude-sonnet-4-6",
|
|
47
|
+
allowed: [
|
|
48
|
+
"anthropic/claude-sonnet-4-6",
|
|
49
|
+
"anthropic/claude-opus-4-7",
|
|
50
|
+
"anthropic/claude-haiku-4-5",
|
|
51
|
+
"openai/gpt-5",
|
|
52
|
+
"openai/gpt-5-mini",
|
|
53
|
+
"openrouter/anthropic/claude-sonnet-4-6"
|
|
54
|
+
],
|
|
55
|
+
env: {
|
|
56
|
+
anthropic: "ANTHROPIC_API_KEY",
|
|
57
|
+
openai: "OPENAI_API_KEY",
|
|
58
|
+
openrouter: "OPENROUTER_API_KEY",
|
|
59
|
+
opencode: "OPENCODE_API_KEY",
|
|
60
|
+
groq: "GROQ_API_KEY"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
capabilities: {
|
|
64
|
+
streaming: true,
|
|
65
|
+
tool_calls: true,
|
|
66
|
+
sub_agents: false,
|
|
67
|
+
file_io: true,
|
|
68
|
+
// OpenCode forwards ACP image content blocks to the underlying
|
|
69
|
+
// provider (Anthropic Messages API for Claude models, OpenAI vision
|
|
70
|
+
// for GPT-5). Hosts SHOULD send `{type: "image", data, mimeType}`
|
|
71
|
+
// blocks alongside text in `session.send`.
|
|
72
|
+
multimodal: true,
|
|
73
|
+
// OpenCode persists session state internally and the ACP server
|
|
74
|
+
// implements newSession/loadSession/resumeSession. Pair with the
|
|
75
|
+
// `native-resume` continuation strategy for cold-start reattach.
|
|
76
|
+
resumable: true,
|
|
77
|
+
bidirectional: true
|
|
78
|
+
},
|
|
79
|
+
modes: [
|
|
80
|
+
{ id: "default", description: "Standard interactive mode." },
|
|
81
|
+
{
|
|
82
|
+
id: "plan",
|
|
83
|
+
description: "Plan-only mode \u2014 reasoning + proposals, no edits or shell calls.",
|
|
84
|
+
bin_args_append: ["--mode", "plan"]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "build",
|
|
88
|
+
description: "Auto-execute mode \u2014 file edits and shell commands run without per-step prompts.",
|
|
89
|
+
bin_args_append: ["--mode", "build"]
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
options: [
|
|
93
|
+
{
|
|
94
|
+
id: "model",
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "Provider/model override for this operator binding (e.g. `openrouter/anthropic/claude-sonnet-4-6`).",
|
|
97
|
+
bin_args_template: ["--model", "{value}"]
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
continuation: {
|
|
101
|
+
default: "native-resume",
|
|
102
|
+
supported: ["native-resume", "pinned-session", "transcript", "none"],
|
|
103
|
+
pinned_session: {
|
|
104
|
+
idle_timeout_ms: 18e5,
|
|
105
|
+
key_scope: ["conversation", "operator"]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
tags: ["opencode", "sst", "acp", "agent-runtime", "coding"]
|
|
109
|
+
});
|
|
110
|
+
function opencodeRuntime() {
|
|
111
|
+
return createAgentCliRuntime(opencode);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { opencode, opencodeRuntime };
|
|
115
|
+
//# sourceMappingURL=index.mjs.map
|
|
116
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"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","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-opencode — AIP-45 adapter for sst/opencode.\n *\n * OpenCode ships first-party ACP support (`opencode acp`) so no\n * third-party wrapper is needed. We spawn it via `npx -y opencode-ai\n * acp` and drive it over stdio JSON-RPC the same way the claude-code\n * adapter drives @agentclientprotocol/claude-agent-acp.\n *\n * import { opencode, opencodeRuntime } from \"@agentproto/adapter-opencode\"\n * const session = await opencodeRuntime().start({\n * env: { ANTHROPIC_API_KEY: \"sk-...\" },\n * })\n * for await (const evt of session.send({ role: \"user\", content: \"...\" })) {\n * console.log(evt)\n * }\n * await session.close()\n */\n\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\n\nexport const opencode: AgentCliHandle = defineAgentCli({\n name: \"opencode\",\n id: \"opencode\",\n description:\n \"sst/opencode — open-source coding agent with first-party ACP mode. Spawned via `npx -y opencode-ai acp` and driven over stdio JSON-RPC. Multi-provider (Anthropic / OpenAI / OpenRouter / Groq / OpenCode hosted).\",\n version: \"0.1.0\",\n bin: \"npx\",\n bin_args: [\"-y\", \"opencode-ai\", \"acp\"],\n install: [\n { method: \"npm\", package: \"opencode-ai\", global: true },\n { method: \"curl\", url: \"https://opencode.ai/install\" },\n ],\n version_check: {\n cmd: \"npm view opencode-ai version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=1.0.0\",\n timeout_ms: 15_000,\n },\n auth: {\n ref: \"./SECRETS.md\",\n state: {\n env: [\n \"OPENCODE_API_KEY\",\n \"ANTHROPIC_API_KEY\",\n \"OPENAI_API_KEY\",\n \"OPENROUTER_API_KEY\",\n \"GROQ_API_KEY\",\n ],\n },\n },\n sandbox: \"./SANDBOX.md\",\n protocol: \"acp\",\n acp: \"./opencode-acp.ACP.md\",\n session: {\n mode: \"persistent\",\n idle_timeout_ms: 1_800_000,\n context_carryover: true,\n },\n models: {\n default: \"anthropic/claude-sonnet-4-6\",\n allowed: [\n \"anthropic/claude-sonnet-4-6\",\n \"anthropic/claude-opus-4-7\",\n \"anthropic/claude-haiku-4-5\",\n \"openai/gpt-5\",\n \"openai/gpt-5-mini\",\n \"openrouter/anthropic/claude-sonnet-4-6\",\n ],\n env: {\n anthropic: \"ANTHROPIC_API_KEY\",\n openai: \"OPENAI_API_KEY\",\n openrouter: \"OPENROUTER_API_KEY\",\n opencode: \"OPENCODE_API_KEY\",\n groq: \"GROQ_API_KEY\",\n },\n },\n capabilities: {\n streaming: true,\n tool_calls: true,\n sub_agents: false,\n file_io: true,\n // OpenCode forwards ACP image content blocks to the underlying\n // provider (Anthropic Messages API for Claude models, OpenAI vision\n // for GPT-5). Hosts SHOULD send `{type: \"image\", data, mimeType}`\n // blocks alongside text in `session.send`.\n multimodal: true,\n // OpenCode persists session state internally and the ACP server\n // implements newSession/loadSession/resumeSession. Pair with the\n // `native-resume` continuation strategy for cold-start reattach.\n resumable: true,\n bidirectional: true,\n },\n modes: [\n { id: \"default\", description: \"Standard interactive mode.\" },\n {\n id: \"plan\",\n description:\n \"Plan-only mode — reasoning + proposals, no edits or shell calls.\",\n bin_args_append: [\"--mode\", \"plan\"],\n },\n {\n id: \"build\",\n description:\n \"Auto-execute mode — file edits and shell commands run without per-step prompts.\",\n bin_args_append: [\"--mode\", \"build\"],\n },\n ],\n options: [\n {\n id: \"model\",\n type: \"string\",\n description:\n \"Provider/model override for this operator binding (e.g. `openrouter/anthropic/claude-sonnet-4-6`).\",\n bin_args_template: [\"--model\", \"{value}\"],\n },\n ],\n continuation: {\n default: \"native-resume\",\n supported: [\"native-resume\", \"pinned-session\", \"transcript\", \"none\"],\n pinned_session: {\n idle_timeout_ms: 1_800_000,\n key_scope: [\"conversation\", \"operator\"],\n },\n },\n tags: [\"opencode\", \"sst\", \"acp\", \"agent-runtime\", \"coding\"],\n})\n\nexport function opencodeRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(opencode)\n}\n\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentproto/adapter-opencode",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "@agentproto/adapter-opencode — AIP-45 AGENT-CLI adapter for sst/opencode. Spawns `opencode acp` (via npx -y opencode-ai) and drives OpenCode as an agentproto agent CLI over stdio JSON-RPC.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agentproto",
|
|
7
|
+
"aip-45",
|
|
8
|
+
"opencode",
|
|
9
|
+
"sst",
|
|
10
|
+
"acp",
|
|
11
|
+
"agent-cli",
|
|
12
|
+
"adapter"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://agentproto.sh/docs/aip-45",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/agentproto/ts",
|
|
18
|
+
"directory": "adapters/opencode"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"main": "dist/index.mjs",
|
|
23
|
+
"module": "dist/index.mjs",
|
|
24
|
+
"types": "dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.mjs",
|
|
29
|
+
"default": "./dist/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"./OPENCODE.md": "./OPENCODE.md",
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"OPENCODE.md",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@agentproto/driver-agent-cli": "0.1.1"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/node": "^25.6.2",
|
|
48
|
+
"tsup": "^8.5.1",
|
|
49
|
+
"typescript": "^5.9.3",
|
|
50
|
+
"vitest": "^3.2.4",
|
|
51
|
+
"@agentproto/tooling": "0.1.0-alpha.0"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "tsup --watch",
|
|
55
|
+
"build": "tsup",
|
|
56
|
+
"clean": "rm -rf dist",
|
|
57
|
+
"check-types": "tsc --noEmit",
|
|
58
|
+
"test": "vitest run --passWithNoTests",
|
|
59
|
+
"test:watch": "vitest"
|
|
60
|
+
}
|
|
61
|
+
}
|