chore: update opencode api to v2
Release / release (push) Failing after 5s

This commit is contained in:
2026-09-12 10:29:24 +02:00
parent 411cdd13ff
commit c48fe99b96
13 changed files with 740 additions and 37 deletions
+7 -1
View File
@@ -65,6 +65,12 @@ export default Plugin.define({
// asynchronous setup is running.
const updates = (async () => {
for await (const event of context.event.subscribe({ signal: controller.signal })) {
if (
event.location &&
(event.location.directory !== context.location.directory ||
event.location.workspaceID !== context.location.workspaceID)
)
continue;
if (event.type === "catalog.updated") {
models = await discover(context, selected.provider);
await context.agent.reload();
@@ -223,7 +229,7 @@ export default Plugin.define({
)?.effect ?? "ask";
if (effect !== "allow")
throw new Error(
`${action} requires an allow permission: OpenCode beta's public plugin API cannot request custom-tool permission approval (${effect}).`,
`${action} requires an allow permission: OpenCode's public plugin API cannot request custom-tool permission approval (${effect}).`,
);
}
await context.tool.transform((editor) => {