Official
opencode-v2
OpenCode 2 agent provider: runs opencode serve (2.x) and talks to its /api over HTTP and server-sent events.
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/opencode-v2@0.1.4
Permissions in 0.1.4
Files
permission.test.ts798 B
// The approval card's title. Run with
// `node --import ./testing/register.mjs --test opencode-v2/permission.test.ts`.
import assert from "node:assert/strict";
import { test } from "node:test";
import { approvalTitle } from "./permission.ts";
const shell = { id: "per_1", sessionID: "ses_1", action: "shell", resources: ["ls plugins", "head -4"] } as Parameters<
typeof approvalTitle
>[0];
test("a shell approval names the whole command, not its parts", () => {
assert.equal(approvalTitle(shell, { command: "ls plugins | head -4" }), "Run ls plugins | head -4");
// Without the call, the parts are all there is.
assert.equal(approvalTitle(shell), "Run ls plugins, head -4");
assert.equal(approvalTitle({ ...shell, message: "Run the tests?" }, { command: "x" }), "Run the tests?");
});
No comments yet.