opencode-claude-code-acpbridge 0.8.0 → 0.9.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +69 -39
  3. package/dist/acp/claude-config.d.ts.map +1 -1
  4. package/dist/acp/claude-config.js +17 -5
  5. package/dist/acp/claude-config.js.map +1 -1
  6. package/dist/acp/mcp-runtime.js +93 -9
  7. package/dist/acp/mcp-runtime.js.map +1 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +3 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/plugin/bridge-rules.d.ts +22 -0
  12. package/dist/plugin/bridge-rules.d.ts.map +1 -0
  13. package/dist/plugin/bridge-rules.js +104 -0
  14. package/dist/plugin/bridge-rules.js.map +1 -0
  15. package/dist/plugin/catalog.d.ts +7 -0
  16. package/dist/plugin/catalog.d.ts.map +1 -1
  17. package/dist/plugin/catalog.js +38 -0
  18. package/dist/plugin/catalog.js.map +1 -1
  19. package/dist/plugin/index.d.ts +3 -13
  20. package/dist/plugin/index.d.ts.map +1 -1
  21. package/dist/plugin/index.js +242 -238
  22. package/dist/plugin/index.js.map +1 -1
  23. package/dist/plugin/sessions.d.ts.map +1 -1
  24. package/dist/plugin/sessions.js +12 -5
  25. package/dist/plugin/sessions.js.map +1 -1
  26. package/dist/provider/model.d.ts +36 -11
  27. package/dist/provider/model.d.ts.map +1 -1
  28. package/dist/provider/model.js +188 -49
  29. package/dist/provider/model.js.map +1 -1
  30. package/docs/DEVELOPMENT.md +42 -22
  31. package/examples/01-minimal.jsonc +9 -6
  32. package/examples/02-permisos-por-agente.jsonc +22 -17
  33. package/examples/03-fidelidad-opencode.jsonc +8 -7
  34. package/examples/04-modelo-y-esfuerzo.jsonc +29 -23
  35. package/examples/05-agentes-personalizados.jsonc +24 -14
  36. package/examples/06-ecosistema-claude.jsonc +12 -11
  37. package/examples/07-provider-manual.jsonc +12 -8
  38. package/examples/08-puente-permisos.jsonc +43 -25
  39. package/examples/README.md +10 -9
  40. package/package.json +4 -4
@@ -1,18 +1,19 @@
1
- import { tool } from "@opencode-ai/plugin";
1
+ import { Agent, Model, Plugin, Provider } from "@opencode/plugin";
2
2
  import { fileURLToPath } from "node:url";
3
3
  import { dirname, join } from "node:path";
4
4
  import { discoverAgent } from "./discover.js";
5
- import { loadAnthropicCatalog, buildModels } from "./catalog.js";
5
+ import { loadAnthropicCatalog, buildModelsInfo } from "./catalog.js";
6
6
  import { readCacheKeyed, writeCache } from "./cache.js";
7
7
  import { getLink, clearLink } from "./sessions.js";
8
+ import { publishAgentRules } from "./bridge-rules.js";
8
9
  import { detectClaudeExecutable } from "../provider/factory.js";
9
10
  const DEBUG = !!process.env.ACP_DEBUG;
10
11
  const dbg = (m) => { if (DEBUG)
11
12
  process.stderr.write(`[acp-plugin] ${m}\n`); };
12
13
  const DISCOVERY_TTL = 60 * 60 * 1000; // 1h
13
- /** Last seen revert marker per OpenCode session, so the `session.updated` firehose
14
- * only acts when the rewind point actually moved. */
15
- const revertMarks = new Map();
14
+ /** Registro del provider en vuelo por providerId: si la config recarga dos veces
15
+ * en paralelo, la segunda reutiliza la promesa en vez de correr check+add en carrera. */
16
+ const providerRegisterInflight = new Map();
16
17
  function hash(s) {
17
18
  let h = 5381;
18
19
  for (let i = 0; i < s.length; i++)
@@ -22,156 +23,138 @@ function hash(s) {
22
23
  function isPlainObject(v) {
23
24
  return v != null && typeof v === "object" && !Array.isArray(v);
24
25
  }
25
- /** Deep merge where `override` wins (arrays/scalars replace; plain objects recurse). */
26
+ /** Clon profundo de valores (arrays / plain objects recursivos; escalares tal cual). */
27
+ function cloneValue(v) {
28
+ if (Array.isArray(v))
29
+ return v.map(cloneValue);
30
+ if (isPlainObject(v)) {
31
+ const o = {};
32
+ for (const k of Object.keys(v))
33
+ o[k] = cloneValue(v[k]);
34
+ return o;
35
+ }
36
+ return v;
37
+ }
38
+ /** Deep merge where `override` wins (arrays/scalars replace; plain objects recurse).
39
+ * Clona la estructura fusionada para no compartir referencias anidadas con `base`. */
26
40
  function deepMerge(base, override) {
27
41
  if (!isPlainObject(base) || !isPlainObject(override))
28
- return override;
29
- const out = { ...base };
42
+ return cloneValue(override);
43
+ const out = cloneValue(base);
30
44
  for (const k of Object.keys(override)) {
31
- out[k] = k in base ? deepMerge(base[k], override[k]) : override[k];
45
+ out[k] = k in base ? deepMerge(base[k], override[k]) : cloneValue(override[k]);
32
46
  }
33
47
  return out;
34
48
  }
35
- /** Resolve the npm spec OpenCode should load the provider factory from. */
49
+ /** Resolve the module spec OpenCode should load the provider factory from. */
36
50
  function resolveNpmSpec(override) {
37
51
  if (override)
38
52
  return override;
39
53
  const here = fileURLToPath(import.meta.url); // <root>/dist/plugin/index.js
40
54
  if (here.includes("/node_modules/opencode-claude-code-acpbridge/"))
41
55
  return "opencode-claude-code-acpbridge";
42
- return `file://${join(dirname(here), "..", "..")}`; // dev / file install → package root
56
+ // dev / local install → the built entrypoint (importable from both Bun and Node,
57
+ // unlike the package directory which only Bun resolves)
58
+ return `file://${join(dirname(here), "..", "index.js")}`;
43
59
  }
44
60
  /** Strip plugin-only keys; the rest are the provider/agent options passed to the factory. */
45
61
  function providerOptions(opts) {
46
- const { name: _n, npm: _npm, providerId: _p, models: _m, ...rest } = opts;
62
+ const { name: _n, npm: _npm, providerId: _p, models: _m, agents: _a, agentModel: _am, ...rest } = opts;
47
63
  return rest;
48
64
  }
65
+ /** Native feature set shared by the Claude Code agents ("clean brain" + the reactivated
66
+ * native capabilities, all permission-bridged to OpenCode). CRUCIAL: `nativeSubagents`
67
+ * gives the agent Claude Code's OWN `Task` tool, so delegated work runs as a native
68
+ * subagent on the subscription. Without it the agent falls back to OpenCode's forwarded
69
+ * `task` tool, which spawns OpenCode subagents routed to OTHER providers — those fail
70
+ * when they're down/out-of-balance. IDENTICAL for both agents on purpose: they differ
71
+ * ONLY in the initial session mode, so a plan session can never end up half-restricted. */
72
+ const NATIVE_BASE = {
73
+ allowedTools: ["mcp__opencode"], // OpenCode's tools don't double-prompt (it owns them)
74
+ // Common native tools are covered by OpenCode → disable them so the agent doesn't try
75
+ // (and "approve") a native Bash/Write/… it can't actually run; it uses mcp__opencode__* instead.
76
+ disallowedTools: ["Bash", "Write", "Edit", "MultiEdit", "Glob", "Grep", "WebFetch", "TodoWrite"],
77
+ resourceSearch: true, // ListMcpResources / ReadMcpResource (superior to OpenCode)
78
+ nativeSubagents: true, // Task: native subagents that delegate to OpenCode's tools
79
+ // Gap tools OpenCode doesn't cover, plus the two that make plan mode work at all:
80
+ // ExitPlanMode (without it a plan-mode session has NO way out) and WebSearch.
81
+ nativeTools: ["NotebookEdit", "Read", "ExitPlanMode", "WebSearch"],
82
+ projectMemory: true, // CLAUDE.md/AGENTS.md (verified: keeps subscription)
83
+ nativeSkills: true, // ~/.claude/skills, hooks disabled (verified: keeps subscription)
84
+ };
85
+ /** Agent profiles: Claude session mode (the only difference between the two) + Claude
86
+ * native options. V2's `Agent.Info` has no `options` field, so these travel to the
87
+ * provider per call through the `context` hook (merged with `options.agents.<name>.options`). */
88
+ function agentDefs(opts) {
89
+ if (opts.agents && opts.agents !== true && isPlainObject(opts.agents))
90
+ return opts.agents;
91
+ if (opts.agents && opts.agents !== true && !isPlainObject(opts.agents)) {
92
+ dbg("agents config inválida — usando defaults");
93
+ }
94
+ return {
95
+ "claude-code": {
96
+ name: "Claude Code",
97
+ description: "Claude Code (subscription) — native capabilities with permissions bridged to OpenCode",
98
+ model: opts.agentModel ?? "default",
99
+ options: { mode: "default", ...NATIVE_BASE },
100
+ },
101
+ "claude-code-plan": {
102
+ name: "Claude Code (plan)",
103
+ description: "Claude Code — plan mode (research & plan, no destructive edits)",
104
+ model: opts.agentModel ?? "default",
105
+ variant: "high",
106
+ options: { mode: "plan", ...NATIVE_BASE },
107
+ },
108
+ };
109
+ }
110
+ /** `Model.Ref` for an agent: `"default"` → `<provider>/default`, a full ref passes through. */
111
+ function modelRef(value, providerID, variant) {
112
+ const ref = typeof value === "string"
113
+ ? Model.Ref.parse(value.includes("/") || value.includes("#") ? value : `${providerID}/${value}`)
114
+ : value;
115
+ return { ...ref, ...(variant && !ref.variant ? { variant: Model.VariantID.make(variant) } : {}) };
116
+ }
49
117
  /**
50
- * Permission-bridge meta-tool. The provider emits a `claude_permission` tool-call
51
- * when the Claude agent asks (via ACP `requestPermission`) to run a NATIVE tool;
52
- * this surfaces OpenCode's own `ask` prompt with the native tool's details, and
53
- * the verdict (approved / rejected) is the tool-result the provider maps back to
54
- * allow/deny. Granularity per native tool comes from the `patterns` below, e.g.
55
- * `permission: { claude_permission: { "Read*": "allow", "*": "ask" } }`.
56
- */
57
- const claudePermissionTool = tool({
58
- description: "Permission gate for a native Claude Code tool. Approve to let the agent run that native tool; reject to block it.",
59
- args: {
60
- tool: tool.schema.string().optional().describe("native tool requested (e.g. Write, Bash, NotebookEdit, Skill)"),
61
- kind: tool.schema.string().optional().describe("execute|edit|read|delete|fetch|think|…"),
62
- title: tool.schema.string().optional().describe("human label of the action"),
63
- input: tool.schema.any().optional().describe("the native tool input"),
64
- },
65
- async execute(args, ctx) {
66
- // Permission = the NATIVE tool name → the prompt reads "Call tool Skill /
67
- // NotebookEdit / Bash …" and rules/"Allow always" are PER native tool.
68
- const native = String(args.tool ?? args.title ?? "native tool").trim() || "native tool";
69
- // Pattern = the action target (command / skill / path) so GLOB rules match,
70
- // e.g. `permission: { Bash: { "git *": "allow" }, Skill: { "review*": "allow" }, "*": "ask" }`.
71
- const inp = args.input && typeof args.input === "object" ? args.input : {};
72
- const rawTarget = String((inp.command ?? inp.skill ?? inp.name ?? inp.notebook_path ?? inp.file_path ?? inp.path) ||
73
- (typeof args.input === "string" ? args.input : "") || args.title || "").trim();
74
- const target = rawTarget || "*";
75
- // "Allow always" glob: ONLY collapse shell commands (kind=execute) to the first
76
- // token (`git status` → `git *`); otherwise the exact target. With no real target
77
- // offer NO always-glob — avoids persisting a broad "*" rule that would auto-approve
78
- // everything for this native tool.
79
- const always = args.kind === "execute" && rawTarget.includes(" ") ? `${rawTarget.split(/\s+/)[0]} *`
80
- : rawTarget || undefined;
81
- // ctx.ask surfaces OpenCode's prompt (default "ask" when no rule matches); throws
82
- // PermissionRejectedError on reject → the provider denies the native tool.
83
- await ctx.ask({
84
- permission: native,
85
- patterns: [target],
86
- always: always ? [always] : [],
87
- metadata: { kind: args.kind, title: args.title, input: args.input },
88
- });
89
- return `approved: ${native}`;
90
- },
91
- });
92
- /**
93
- * OpenCode plugin half. With the auto-register hook below, a minimal config is enough:
118
+ * OpenCode plugin half. Minimal config is enough:
94
119
  *
95
- * "plugin": [["opencode-claude-code-acpbridge", { "command": "claude-agent-acp" }]]
120
+ * "plugins": [{ "package": "opencode-claude-code-acpbridge",
121
+ * "options": { "command": "claude-agent-acp" } }]
96
122
  *
97
- * The plugin discovers the agent's models (cached), pulls their metadata from
98
- * models.dev, and injects `provider.acp` with the populated models — while the
99
- * user keeps full control of every agent option via these plugin options.
123
+ * It discovers the agent's models (cached), pulls their metadata from models.dev,
124
+ * registers the `acp` provider with the populated `Model.Info[]`, injects the
125
+ * `claude-code` / `claude-code-plan` agents, and bridges every per-request value
126
+ * (session link, agent options) through the `context` hook.
100
127
  */
101
- export const ACPPlugin = async (_input, options) => {
102
- const opts = (options ?? {});
103
- const providerId = opts.providerId ?? "acp";
104
- return {
105
- // Register the permission-bridge meta-tool so OpenCode can execute it and show
106
- // its `ask` prompt when the Claude agent requests a native tool.
107
- tool: { claude_permission: claudePermissionTool },
108
- // Bridge OpenCode's sessionID → providerOptions.acp so the provider can map it
109
- // to a Claude Code session and resume instead of replaying the whole history.
110
- "chat.params": async (input, output) => {
111
- try {
112
- if (input?.model?.providerID !== providerId)
113
- return;
114
- const oc = input?.sessionID;
115
- if (!oc)
116
- return;
117
- output.options = output.options ?? {};
118
- output.options.ocSession = oc; // registry key — always
119
- // Which OpenCode agent is driving this turn. The provider keeps it for its
120
- // logs and for the notice it prints when the Claude agent leaves plan mode
121
- // on its own (OpenCode still shows the agent the user picked).
122
- if (input?.agent)
123
- output.options.ocAgent = String(input.agent);
124
- const link = getLink(oc);
125
- if (link?.acpSessionId) { // only if registered (resumable)
126
- output.options.resumeId = link.acpSessionId;
127
- output.options.resumeLen = link.sentHistoryLen;
128
- // Seed the model's cumulative usage snapshot so per-turn deltas stay
129
- // correct after a process restart (ACP usage is cumulative per session).
130
- if (link.lastUsage)
131
- output.options.resumeLastUsage = link.lastUsage;
132
- // Conversation identity, for the model to notice if this OpenCode
133
- // sessionID were ever reused for an unrelated conversation.
134
- if (link.convKey)
135
- output.options.resumeConvKey = link.convKey;
136
- }
137
- }
138
- catch { /* ignore */ }
139
- },
140
- // Rewinding a conversation (revert / unrevert) truncates OpenCode's history,
141
- // but the Claude Code session on the other side still remembers every turn that
142
- // was undone. Drop the registry link so the next turn starts a clean agent
143
- // session from the truncated history instead of resuming one that would
144
- // resurrect it. The provider ALSO detects this from the prompt itself (history
145
- // fingerprint), so programmatic use without the plugin stays correct.
146
- event: async ({ event }) => {
147
- try {
148
- if (event?.type !== "session.updated")
149
- return;
150
- const info = event?.properties?.info;
151
- const id = info?.id;
152
- if (!id)
153
- return;
154
- const mark = info?.revert ? `${info.revert.messageID}:${info.revert.partID ?? ""}` : "";
155
- if (revertMarks.get(id) === mark)
156
- return;
157
- revertMarks.set(id, mark);
158
- if (clearLink(id))
159
- dbg(`session ${id} rewound (revert=${mark || "cleared"}) — link dropped, next turn starts fresh`);
160
- }
161
- catch { /* never break the event bus */ }
162
- },
163
- config: async (cfg) => {
128
+ /** ¿Está la tool `question` en el set de tools del agente? Soporta array / Set /
129
+ * Record (según cómo OpenCode lo haya convertido); sin info se asume que sí
130
+ * para conservar el comportamiento actual. */
131
+ function hasQuestionTool(item) {
132
+ const t = item?.tools;
133
+ if (t == null)
134
+ return true;
135
+ if (Array.isArray(t))
136
+ return t.includes("question");
137
+ if (t instanceof Set)
138
+ return t.has("question");
139
+ if (typeof t === "object") {
140
+ if ("question" in t)
141
+ return !!t.question;
142
+ return true;
143
+ }
144
+ return true;
145
+ }
146
+ export const ACPPlugin = Plugin.define({
147
+ id: "opencode-claude-code-acpbridge",
148
+ async setup(ctx) {
149
+ const opts = (ctx.options ?? {});
150
+ const providerId = opts.providerId ?? "acp";
151
+ const agentOptions = new Map();
152
+ if (!opts.command && !process.env.ACP_COMMAND) {
153
+ dbg("no `command` in plugin options — skipping auto-register (declare the provider manually)");
154
+ }
155
+ else {
164
156
  try {
165
- if (!opts.command && !process.env.ACP_COMMAND) {
166
- dbg("no `command` in plugin options — skipping auto-register (declare the provider manually)");
167
- return;
168
- }
169
157
  const command = opts.command ?? process.env.ACP_COMMAND;
170
- cfg.provider ??= {};
171
- if (cfg.provider[providerId]) {
172
- dbg(`provider '${providerId}' already declared in config — leaving it untouched`);
173
- return;
174
- }
175
158
  // Resolve the native Claude binary the same way the provider factory does,
176
159
  // so the ephemeral discovery agent can find it under a minimal config.
177
160
  const claudeExecutable = opts.claudeExecutable ?? process.env.CLAUDE_CODE_EXECUTABLE ?? detectClaudeExecutable();
@@ -184,117 +167,138 @@ export const ACPPlugin = async (_input, options) => {
184
167
  discovered = await discoverAgent(discOpts);
185
168
  writeCache("discovery.json", discovered, key);
186
169
  }
187
- const agentModels = discovered?.models?.length
188
- ? discovered.models
189
- : [{ id: "default", name: "Claude Code (ACP)" }];
170
+ const agentModels = discovered?.models?.length ? discovered.models : [{ id: "default", name: "Claude Code (ACP)" }];
190
171
  const catalog = await loadAnthropicCatalog();
191
- const models = buildModels(agentModels, discovered?.promptCaps ?? {}, catalog);
192
- cfg.provider[providerId] = {
193
- npm: resolveNpmSpec(opts.npm),
194
- name: opts.name ?? "Claude Code (ACP)",
195
- options: { ...discOpts },
196
- models,
197
- };
198
- dbg(`auto-registered provider '${providerId}' (npm ${resolveNpmSpec(opts.npm)}) — models: ${Object.keys(models).join(", ")}`);
199
- // Inject "claude-code" agents (unless disabled or already declared). Default
200
- // model is the agent's recommended one ("default" = Opus 4.7). Per-agent ACP
201
- // options (mode/effort) travel to the provider as `providerOptions.acp`.
202
- if (opts.agents !== false) {
203
- const defaultModel = opts.agentModel ?? "default";
204
- const toRef = (m) => (m.includes("/") ? m : `${providerId}/${m}`);
205
- // Native feature set shared by the Claude Code agents ("clean brain" + the
206
- // reactivated native capabilities, all permission-bridged to OpenCode). CRUCIAL:
207
- // `nativeSubagents` gives the agent Claude Code's OWN `Task` tool, so delegated
208
- // work runs as a native subagent on the subscription. Without it the agent falls
209
- // back to OpenCode's forwarded `task` tool, which spawns OpenCode subagents routed
210
- // to OTHER providers (opencode-go/…) — those fail when they're down/out-of-balance.
211
- // IDENTICAL for both agents on purpose. `claude-code-plan` and `claude-code`
212
- // differ ONLY in the initial session mode. The Claude agent can leave plan
213
- // mode by itself (ExitPlanMode), and nothing tells OpenCode to switch agent —
214
- // so if the two profiles differed, the agent would believe it may edit while
215
- // OpenCode kept handing it the restricted plan profile. Making the mode the
216
- // only difference removes that half-restricted state entirely.
217
- const nativeBase = {
218
- allowedTools: ["mcp__opencode"], // OpenCode's tools don't double-prompt (it owns them)
219
- // Common native tools are covered by OpenCode → disable them so the agent
220
- // doesn't try (and "approve") a native Bash/Write/… it can't actually run;
221
- // it uses mcp__opencode__* instead. Native gap tools stay (see `nativeTools`).
222
- disallowedTools: ["Bash", "Write", "Edit", "MultiEdit", "Glob", "Grep", "WebFetch", "TodoWrite"],
223
- resourceSearch: true, // ListMcpResources / ReadMcpResource (superior to OpenCode)
224
- nativeSubagents: true, // Task: native subagents that delegate to OpenCode's tools
225
- // Gap tools OpenCode doesn't cover, plus the two that make plan mode work
226
- // at all: ExitPlanMode (without it a plan-mode session has NO way out and
227
- // the mode is re-forced every turn) and WebSearch (OpenCode only registers
228
- // its own `websearch` for providerID "opencode" or with exa/parallel on).
229
- nativeTools: ["NotebookEdit", "Read", "ExitPlanMode", "WebSearch"],
230
- projectMemory: true, // CLAUDE.md/AGENTS.md (verified: keeps subscription)
231
- nativeSkills: true, // ~/.claude/skills, hooks disabled (verified: keeps subscription)
232
- };
233
- const defs = opts.agents ?? {
234
- "claude-code": {
235
- description: "Claude Code (subscription) — native capabilities with permissions bridged to OpenCode",
236
- model: defaultModel,
237
- // The bridge meta-tool itself is auto-allowed; the REAL prompt is raised
238
- // inside it via ctx.ask under the NATIVE tool's name (Skill/NotebookEdit/…),
239
- // so users see and rule on the actual action. Override per tool, e.g.
240
- // `permission: { Skill: "allow", NotebookEdit: "ask" }`.
241
- permission: { claude_permission: "allow" },
242
- options: {
243
- mode: "default", // not bypass → the agent asks → permission bridge
244
- ...nativeBase,
245
- },
246
- },
247
- "claude-code-plan": {
248
- description: "Claude Code — plan mode (research & plan, no destructive edits)",
249
- model: defaultModel, variant: "high",
250
- // Same permission bridge as claude-code: native tool requests surface as
251
- // OpenCode `ask` prompts under the real tool name.
252
- permission: { claude_permission: "allow" },
253
- options: {
254
- ...nativeBase,
255
- // The ONLY difference from `claude-code`. Read-only research & planning
256
- // is enforced by the session mode (and OpenCode's own plan gating), not
257
- // by a narrower tool profile — see the note on `nativeBase`. Approving
258
- // the plan moves the session to `default`, and from that moment this
259
- // agent behaves exactly like `claude-code`.
260
- mode: "plan",
172
+ const models = buildModelsInfo(agentModels, discovered?.promptCaps ?? {}, catalog, providerId);
173
+ const npmSpec = resolveNpmSpec(opts.npm);
174
+ // The provider no longer comes from `provider.<id>` in config (V2 resolves
175
+ // packages through `aisdk:<spec>`): the plugin registers it directly.
176
+ // Guard contra reloads paralelos: el check `get` + `add` no es atómico,
177
+ // así que se memoiza la promesa en vuelo por providerId y se reutiliza.
178
+ let registering = providerRegisterInflight.get(providerId);
179
+ if (!registering) {
180
+ const fresh = ctx.provider.transform((editor) => {
181
+ if (editor.get(providerId)) {
182
+ dbg(`provider '${providerId}' already declared — keeping the existing definition`);
183
+ return;
184
+ }
185
+ editor.add({
186
+ info: {
187
+ ...Provider.Info.empty(Provider.ID.make(providerId)),
188
+ name: opts.name ?? "Claude Code (ACP)",
189
+ activation: "enabled",
190
+ package: `aisdk:${npmSpec}`,
191
+ settings: { ...discOpts },
261
192
  },
262
- },
193
+ models,
194
+ });
195
+ });
196
+ providerRegisterInflight.set(providerId, fresh);
197
+ // Solo se memoiza mientras está en vuelo: al asentarse se libera para
198
+ // que la próxima recarga (secuencial) use su propio `ctx`.
199
+ const done = () => {
200
+ if (providerRegisterInflight.get(providerId) === fresh)
201
+ providerRegisterInflight.delete(providerId);
263
202
  };
264
- cfg.agent ??= {};
265
- const injected = [];
266
- for (const [name, raw] of Object.entries(defs)) {
267
- const def = raw;
268
- const pluginBase = {
269
- description: def.description,
270
- model: toRef(def.model ?? defaultModel),
271
- mode: def.mode ?? "primary",
272
- ...(def.variant ? { variant: def.variant } : {}),
273
- ...(def.permission ? { permission: def.permission } : {}),
274
- options: def.options ?? {},
275
- };
276
- // The user's `agent.<name>` in opencode.json wins over the plugin defaults
277
- // (merge): declare only what you want to change (e.g. `permission`) and
278
- // inherit the rest; `disable:true` turns the agent off.
279
- cfg.agent[name] = cfg.agent[name] ? deepMerge(pluginBase, cfg.agent[name]) : pluginBase;
280
- injected.push(name);
281
- }
282
- if (injected.length)
283
- dbg(`agents (plugin defaults ⊕ user config): ${injected.join(", ")}`);
203
+ fresh.then(done, done);
204
+ registering = fresh;
205
+ }
206
+ await registering;
207
+ dbg(`auto-registered provider '${providerId}' (aisdk:${npmSpec}) — models: ${models.map((m) => m.id).join(", ")}`);
208
+ if (opts.agents !== false) {
209
+ const defs = agentDefs(opts);
210
+ await ctx.agent.transform((editor) => {
211
+ for (const [name, raw] of Object.entries(defs)) {
212
+ const def = raw;
213
+ const user = isPlainObject(opts.agents) ? opts.agents[name] : undefined;
214
+ // V1-style per-agent Claude options, overridden by the user's copy.
215
+ agentOptions.set(name, deepMerge(def.options ?? {}, isPlainObject(user) ? user.options ?? {} : {}));
216
+ // A `model` the user already declared (config/other plugin) wins: only
217
+ // fill the field when it is missing, so the transform stays idempotent.
218
+ const model = modelRef((isPlainObject(user) && user.model) || def.model || "default", providerId, def.variant);
219
+ const description = (isPlainObject(user) && user.description) || def.description;
220
+ const questionRule = { action: "question", resource: "*", effect: "allow" };
221
+ editor.update(name, (item) => {
222
+ if (def.name)
223
+ item.name = Agent.Name.make(def.name);
224
+ if (description && !item.description)
225
+ item.description = description;
226
+ if (!item.model)
227
+ item.model = model;
228
+ // Solo tiene sentido permitir `question` si la tool existe en el agente.
229
+ if (hasQuestionTool(item) &&
230
+ !item.permissions.some((r) => r.action === "question" && r.resource === "*")) {
231
+ item.permissions.push(questionRule);
232
+ }
233
+ // Publish the rules the permission bridge evaluates against (the
234
+ // user's `permissions` included). `action:"*"` defaults are ignored
235
+ // at evaluation time — see bridge-rules.ts.
236
+ publishAgentRules(name, item.permissions);
237
+ });
238
+ }
239
+ });
240
+ dbg(`agents registered: ${Object.keys(defs).join(", ")}`);
284
241
  }
285
242
  }
286
243
  catch (e) {
287
- // Never break OpenCode boot: log and continue (user can declare provider manually).
288
- const detail = e instanceof Error ? (e.stack || e.message) : typeof e === "object" ? JSON.stringify(e) : String(e);
289
- dbg(`auto-register failed: ${detail}`);
244
+ // Never break OpenCode boot: log and continue (the user can still declare
245
+ // the provider manually, and the hooks below stay registered).
246
+ dbg(`auto-register failed: ${e instanceof Error ? e.stack || e.message : String(e)}`);
290
247
  }
291
- },
292
- dispose: async () => { },
293
- };
294
- };
295
- const acpPluginModule = {
296
- id: "opencode-claude-code-acpbridge",
297
- server: ACPPlugin,
298
- };
299
- export default acpPluginModule;
248
+ }
249
+ // Session link + agent options → the provider. V2 passes NO provider options
250
+ // from config, so everything the model needs per call is injected here
251
+ // (`SessionRequestOptions`: generation keys stay typed, the rest becomes
252
+ // `providerOptions.<providerID>`).
253
+ const context = await ctx.session.hook("context", (event) => {
254
+ if (event.model.providerID !== providerId)
255
+ return;
256
+ event.options.ocSession = event.sessionID;
257
+ event.options.ocAgent = String(event.agent);
258
+ const link = getLink(event.sessionID);
259
+ if (link?.acpSessionId) {
260
+ event.options.resumeId = link.acpSessionId;
261
+ event.options.resumeLen = link.sentHistoryLen;
262
+ // Seed the cumulative usage snapshot so per-turn deltas stay correct
263
+ // after a restart (ACP usage is cumulative per session).
264
+ if (link.lastUsage)
265
+ event.options.resumeLastUsage = link.lastUsage;
266
+ if (link.convKey)
267
+ event.options.resumeConvKey = link.convKey;
268
+ }
269
+ const extra = agentOptions.get(String(event.agent));
270
+ if (extra)
271
+ for (const [k, v] of Object.entries(extra))
272
+ event.options[k] = v;
273
+ }, { providerID: providerId });
274
+ // Rewinding a conversation truncates OpenCode's history, but the Claude Code
275
+ // session on the other side still remembers every undone turn. Drop the
276
+ // registry link so the next turn starts a clean agent session instead of
277
+ // resuming one that would resurrect it. The provider ALSO detects this from
278
+ // the prompt itself (history fingerprint), so programmatic use without the
279
+ // plugin stays correct.
280
+ const closed = new AbortController();
281
+ const events = (async () => {
282
+ try {
283
+ for await (const event of ctx.event.subscribe({ signal: closed.signal })) {
284
+ if (event.type !== "session.revert.committed" && event.type !== "session.revert.cleared")
285
+ continue;
286
+ const sessionID = event.data?.sessionID;
287
+ if (sessionID && clearLink(sessionID)) {
288
+ dbg(`session ${sessionID} rewound — link dropped, next turn starts fresh`);
289
+ }
290
+ }
291
+ }
292
+ catch {
293
+ /* aborted on cleanup */
294
+ }
295
+ })();
296
+ return async () => {
297
+ closed.abort();
298
+ await context.dispose();
299
+ await events;
300
+ };
301
+ },
302
+ });
303
+ export default ACPPlugin;
300
304
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkC,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAwB,MAAM,eAAe,CAAC;AACpE,OAAO,EA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