From d7e2fc200f58a12632f9752a4a3a11e03d700b8f Mon Sep 17 00:00:00 2001 From: Muse Sweep Date: Sun, 18 Oct 2026 16:22:22 -0500 Subject: [PATCH] fix(mcpx): sync dogfood .opencode plugin ops table and guard against drift (#314) .opencode/plugin/mcpx/ops.gen.ts had 72 operations against 81 in pkgs/mcpx/plugin/opencode/mcpx/ops.gen.ts: preflight, reload, the six secrets/secret-requests operations and servers_get never reached the copy this repo's own opencode sessions load. Copy the generated table over (the two trees are now byte-identical) and add a sync guard step to mcpx.yml, with .opencode/plugin/** added to its trigger paths so a PR touching only the copy runs it. The guard lives in this repo's workflow, not in pkgs/mcpx, which also stands alone in dezren39/nix. --- .github/workflows/mcpx.yml | 16 ++++ .opencode/plugin/mcpx/ops.gen.ts | 135 +++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+) diff --git a/.github/workflows/mcpx.yml b/.github/workflows/mcpx.yml index bac6623cda..b4f3bbaecf 100644 --- a/.github/workflows/mcpx.yml +++ b/.github/workflows/mcpx.yml @@ -24,6 +24,9 @@ on: pull_request: paths: - "pkgs/mcpx/**" + # The dogfood copy of the plugin under .opencode/plugin, so a PR that + # only touches it still runs the sync guard below (#314). + - ".opencode/plugin/**" - "flake.nix" - "flake.lock" # Itself, so a bot bumping one of the actions below is tested by the @@ -33,6 +36,7 @@ on: branches: [main] paths: - "pkgs/mcpx/**" + - ".opencode/plugin/**" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -53,6 +57,18 @@ jobs: ref: ${{ github.head_ref || github.ref }} fetch-depth: 0 + # The repo dogfoods the plugin: .opencode/plugin is a copy of + # pkgs/mcpx/plugin/opencode, and the two must stay identical. The + # generated ops table in the copy once fell 9 operations behind + # (secrets, reload, preflight, servers_get) because the generation + # guard inside pkgs/mcpx only compares the pkgs copy (#314). This + # guard lives here, not in pkgs/mcpx, because that package also + # stands alone in dezren39/nix with no repo-root .opencode copy. + - name: Check the dogfood plugin copy is in sync + run: | + diff -r pkgs/mcpx/plugin/opencode/mcpx .opencode/plugin/mcpx + diff pkgs/mcpx/plugin/opencode/mcpx-session.ts .opencode/plugin/mcpx-session.ts + - uses: actions/setup-go@v7 with: go-version-file: pkgs/mcpx/go.mod diff --git a/.opencode/plugin/mcpx/ops.gen.ts b/.opencode/plugin/mcpx/ops.gen.ts index 593560c8c6..44e7f04f35 100644 --- a/.opencode/plugin/mcpx/ops.gen.ts +++ b/.opencode/plugin/mcpx/ops.gen.ts @@ -408,6 +408,14 @@ export const OPS: Record = { params: {}, response: "json", }, + preflight: { + method: "POST", + path: "/v1/preflight", + params: { + source: { in: "body", required: true }, + }, + response: "json", + }, prompt_get: { method: "POST", path: "/v1/prompt", @@ -487,6 +495,12 @@ export const OPS: Record = { }, response: "json", }, + reload: { + method: "POST", + path: "/v1/reload", + params: {}, + response: "json", + }, resolve: { method: "GET", path: "/v1/resolve", @@ -541,6 +555,51 @@ export const OPS: Record = { }, response: "json", }, + secret_request_decline: { + method: "DELETE", + path: "/v1/secret-requests/{id}", + params: { + id: { in: "path", required: true }, + }, + response: "json", + }, + secret_request_get: { + method: "GET", + path: "/v1/secret-requests/{id}", + params: { + id: { in: "path", required: true }, + }, + response: "json", + }, + secret_requests_list: { + method: "GET", + path: "/v1/secret-requests", + params: {}, + response: "json", + }, + secrets_list: { + method: "GET", + path: "/v1/secrets", + params: {}, + response: "json", + }, + secrets_set: { + method: "PUT", + path: "/v1/secrets/{name}", + params: { + name: { in: "path", required: true }, + value: { in: "body", required: true }, + }, + response: "json", + }, + secrets_unset: { + method: "DELETE", + path: "/v1/secrets/{name}", + params: { + name: { in: "path", required: true }, + }, + response: "json", + }, servers_add: { method: "POST", path: "/v1/servers", @@ -558,6 +617,14 @@ export const OPS: Record = { }, response: "json", }, + servers_get: { + method: "GET", + path: "/v1/servers/{name}", + params: { + name: { in: "path", required: true }, + }, + response: "json", + }, servers_list: { method: "GET", path: "/v1/servers", @@ -1080,6 +1147,13 @@ export class DaemonOps { return this.invoke("openapi", args, opts) as Promise } + /** + * Check a script's servers are ready before running it. `POST /v1/preflight`. + */ + preflight(args: { source: string }, opts: CallOptions = {}): Promise { + return this.invoke("preflight", args, opts) as Promise + } + /** * Render one prompt with its arguments filled in. `POST /v1/prompt`. */ @@ -1144,6 +1218,14 @@ export class DaemonOps { return this.invoke("registry_search", args, opts) as Promise } + /** + * Re-read the configuration and swap server pools without restarting unchanged servers. `POST /v1/reload`. + * Privileged: it changes the daemon rather than reading it. + */ + reload(args: Record = {}, opts: CallOptions = {}): Promise { + return this.invoke("reload", args, opts) as Promise + } + /** * Which daemon serves a directory. `GET /v1/resolve`. */ @@ -1188,6 +1270,52 @@ export class DaemonOps { return this.invoke("search", args, opts) as Promise } + /** + * Decline a secret request. `DELETE /v1/secret-requests/{id}`. + * Privileged: it changes the daemon rather than reading it. + */ + secretRequestDecline(args: { id: string }, opts: CallOptions = {}): Promise { + return this.invoke("secret_request_decline", args, opts) as Promise + } + + /** + * One secret request, and whether it is still waiting. `GET /v1/secret-requests/{id}`. + */ + secretRequestGet(args: { id: string }, opts: CallOptions = {}): Promise { + return this.invoke("secret_request_get", args, opts) as Promise + } + + /** + * Requests waiting for a person to give secrets. `GET /v1/secret-requests`. + */ + secretRequestsList(args: Record = {}, opts: CallOptions = {}): Promise { + return this.invoke("secret_requests_list", args, opts) as Promise + } + + /** + * Which secrets servers need, and which of them have a value. `GET /v1/secrets`. + */ + secretsList(args: Record = {}, opts: CallOptions = {}): Promise { + return this.invoke("secrets_list", args, opts) as Promise + } + + /** + * Give a secret a value, in memory only. `PUT /v1/secrets/{name}`. + * Privileged: it changes the daemon rather than reading it. + */ + secretsSet(args: { name: string; value: string }, opts: CallOptions = {}): Promise { + return this.invoke("secrets_set", args, opts) as Promise + } + + /** + * Forget a runtime value for a secret. `DELETE /v1/secrets/{name}`. + * Privileged: it changes the daemon rather than reading it. + * Destructive: it cannot be undone, and other callers are affected. + */ + secretsUnset(args: { name: string }, opts: CallOptions = {}): Promise { + return this.invoke("secrets_unset", args, opts) as Promise + } + /** * Add a server, live. `POST /v1/servers`. * Privileged: it changes the daemon rather than reading it. @@ -1196,6 +1324,13 @@ export class DaemonOps { return this.invoke("servers_add", args, opts) as Promise } + /** + * One configured server, and whether it can run now. `GET /v1/servers/{name}`. + */ + serversGet(args: { name: string }, opts: CallOptions = {}): Promise { + return this.invoke("servers_get", args, opts) as Promise + } + /** * Every configured server as it is written in the configuration. `GET /v1/servers`. */