opencode-claude-code-acpbridge 0.10.0 → 0.11.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/CHANGELOG.md +335 -261
- package/LICENSE +21 -0
- package/README.md +633 -324
- package/dist/acp/claude-config.d.ts +1 -1
- package/dist/plugin/compat.d.ts +14 -0
- package/dist/plugin/compat.d.ts.map +1 -0
- package/dist/plugin/compat.js +45 -0
- package/dist/plugin/compat.js.map +1 -0
- package/dist/plugin/index.d.ts +8 -0
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +124 -30
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/pairing.d.ts +66 -0
- package/dist/plugin/pairing.d.ts.map +1 -0
- package/dist/plugin/pairing.js +110 -0
- package/dist/plugin/pairing.js.map +1 -0
- package/dist/provider/factory.d.ts.map +1 -1
- package/dist/provider/factory.js +10 -1
- package/dist/provider/factory.js.map +1 -1
- package/dist/provider/model.d.ts +7 -1
- package/dist/provider/model.d.ts.map +1 -1
- package/dist/provider/model.js +54 -15
- package/dist/provider/model.js.map +1 -1
- package/docs/DEVELOPMENT.md +438 -138
- package/examples/01-minimal.jsonc +14 -9
- package/examples/02-per-agent-permissions.jsonc +39 -0
- package/examples/03-opencode-fidelity.jsonc +21 -0
- package/examples/04-model-and-effort.jsonc +36 -0
- package/examples/05-custom-agents.jsonc +32 -0
- package/examples/06-claude-ecosystem.jsonc +28 -0
- package/examples/07-manual-provider.jsonc +55 -0
- package/examples/08-permission-bridge.jsonc +42 -0
- package/examples/README.md +35 -17
- package/package.json +35 -30
- package/examples/02-permisos-por-agente.jsonc +0 -34
- package/examples/03-fidelidad-opencode.jsonc +0 -21
- package/examples/04-modelo-y-esfuerzo.jsonc +0 -36
- package/examples/05-agentes-personalizados.jsonc +0 -29
- package/examples/06-ecosistema-claude.jsonc +0 -24
- package/examples/07-provider-manual.jsonc +0 -42
- package/examples/08-puente-permisos.jsonc +0 -50
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Control total: declaras el provider `acp` a mano en la config de OpenCode.
|
|
3
|
-
// En V2 normalmente NO hace falta: con `options.command` el plugin
|
|
4
|
-
// auto-registra el provider (V2 resuelve el paquete como `aisdk:<spec>`).
|
|
5
|
-
// Declararlo a mano sirve para fijar modelos, costes y límites exactos, o en
|
|
6
|
-
// entornos sin descubrimiento. El plugin DETECTA `provider.acp` declarado y
|
|
7
|
-
// NO lo toca (guard nuevo).
|
|
8
|
-
"$schema": "https://opencode.ai/config.json",
|
|
9
|
-
"provider": {
|
|
10
|
-
"acp": {
|
|
11
|
-
"npm": "opencode-claude-code-acpbridge", // en dev: RUTA DEL DIRECTORIO local (no `file://`)
|
|
12
|
-
"name": "Claude Code (ACP)",
|
|
13
|
-
"options": {
|
|
14
|
-
"command": "claude-agent-acp",
|
|
15
|
-
"claudeExecutable": "/home/usuario/.local/bin/claude",
|
|
16
|
-
"claudeCode": { "systemPromptMode": "preset" }
|
|
17
|
-
},
|
|
18
|
-
"models": {
|
|
19
|
-
"default": {
|
|
20
|
-
"id": "default", "name": "Opus 4.7 (recommended)",
|
|
21
|
-
"tool_call": true, "reasoning": true, "attachment": true,
|
|
22
|
-
"limit": { "context": 1000000, "output": 64000 },
|
|
23
|
-
"cost": { "input": 5, "output": 25, "cache_read": 0.5, "cache_write": 6.25 },
|
|
24
|
-
"variants": { "low": {"effort":"low"}, "high": {"effort":"high"}, "max": {"effort":"max"} }
|
|
25
|
-
},
|
|
26
|
-
"sonnet": {
|
|
27
|
-
"id": "sonnet", "name": "Sonnet 4.6",
|
|
28
|
-
"tool_call": true, "reasoning": true, "attachment": true,
|
|
29
|
-
"limit": { "context": 1000000, "output": 64000 },
|
|
30
|
-
"cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }
|
|
31
|
-
},
|
|
32
|
-
"haiku": { "id": "haiku", "name": "Haiku 4.5", "tool_call": true, "reasoning": true }
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
// El plugin se sigue cargando para inyectar los agentes y el context hook
|
|
37
|
-
// (`session.hook("context")`: sessionID/resume + options por agente);
|
|
38
|
-
// como `provider.acp` ya existe, no lo reescribe.
|
|
39
|
-
"plugins": [
|
|
40
|
-
{ "package": "opencode-claude-code-acpbridge", "options": { "command": "claude-agent-acp" } }
|
|
41
|
-
]
|
|
42
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Puente de permisos (OpenCode V2): el agente `claude-code` usa tools NATIVAS
|
|
3
|
-
// de Claude (Skill, Read, NotebookEdit, subagentes) y CADA acción nativa pasa
|
|
4
|
-
// por el puente. Aquí ajustas QUÉ pide permiso y qué features nativos van
|
|
5
|
-
// activos, sin tocar el código del plugin (tu config gana por merge).
|
|
6
|
-
//
|
|
7
|
-
// El puente YA NO usa la meta-tool `claude_permission`: el provider emite un
|
|
8
|
-
// tool-call de la tool NATIVA `question` de OpenCode. El diálogo se titula
|
|
9
|
-
// `Permission` y ofrece `Allow once` / `Always allow` / `Deny`. Las reglas
|
|
10
|
-
// `allow`/`deny` se resuelven SIN diálogo; `Always allow` persiste la regla
|
|
11
|
-
// en `~/.acp-model-provider/always.json`.
|
|
12
|
-
"$schema": "https://opencode.ai/config.json",
|
|
13
|
-
"plugins": [
|
|
14
|
-
{ "package": "opencode-claude-code-acpbridge",
|
|
15
|
-
"options": {
|
|
16
|
-
"command": "claude-agent-acp",
|
|
17
|
-
// Toggles de features nativos (todos ON por defecto). Descomenta para cambiar:
|
|
18
|
-
"agents": {
|
|
19
|
-
"claude-code": {
|
|
20
|
-
"options": {
|
|
21
|
-
// "nativeSkills": ["pdf", "xlsx"], // precargar solo estos skills (en vez de todo ~/.claude/skills)
|
|
22
|
-
// "nativeSubagents": false, // desactivar los subagentes nativos de Claude
|
|
23
|
-
// "nativeTools": ["NotebookEdit", "Read", "WebSearch"], // exponer otra tool nativa de nicho
|
|
24
|
-
// "mode": "bypassPermissions" // volver al "cerebro limpio" clásico (sin puente)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
} }
|
|
29
|
-
],
|
|
30
|
-
"agents": {
|
|
31
|
-
"claude-code": {
|
|
32
|
-
// Reglas del puente POR TOOL NATIVA — salen de `agents.<n>.permissions`
|
|
33
|
-
// (ruleset V2) vía `bridge-rules.ts`. El `resource` admite GLOBS.
|
|
34
|
-
// Regla `allow`/`deny` → sin diálogo; sin regla que matchee → diálogo
|
|
35
|
-
// (fail-closed).
|
|
36
|
-
"permissions": [
|
|
37
|
-
{ "action": "Read", "resource": "*", "effect": "allow" }, // lecturas nativas (multimodal): permitir siempre
|
|
38
|
-
{ "action": "Skill", "resource": "*", "effect": "allow" }, // cualquier skill: permitir
|
|
39
|
-
{ "action": "NotebookEdit", "resource": "*", "effect": "ask" } // editar notebooks Jupyter: preguntar
|
|
40
|
-
// El `"*": "ask"` de V1 NO se puede declarar: el puente IGNORA
|
|
41
|
-
// `action:"*"` a propósito. El default del puente ya es preguntar
|
|
42
|
-
// (fail-closed) para cualquier tool nativa sin regla.
|
|
43
|
-
// La regla `{action:"question", resource:"*", effect:"allow"}` la
|
|
44
|
-
// AÑADE EL PLUGIN SOLO — no la declares aquí.
|
|
45
|
-
]
|
|
46
|
-
// Los toggles de features nativos viven en
|
|
47
|
-
// `plugins[0].options.agents.claude-code.options` (ver arriba).
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|