import type { Plugin } from "@opencode/plugin"; /** * Corvus AI plugin — shared OpenCode v1/v2 entry (built to `dist/server.js`). * * OpenCode 1.18.30+ resolves `exports["./server"]` before `main` and requires * a callable `server` on a default object with `id`. The v2 host requires * `{ id, setup }`; each loader ignores the other handler. `server` reuses the * legacy hook function through a runtime import of the sibling `index.js`; * v2 `setup` does not load it. `dist/index.js` remains the root function entry. * SDK imports here are TYPE-ONLY. A value import (for * example `Plugin.define`, which is an identity function) would turn the v2 * SDK into a runtime dependency and break v1 hosts that do not ship it, so * `dist/server.js` must contain zero runtime `@opencode/` or `@opencode-ai/` imports. * * INVARIANT — all-or-nothing registration. * `setup` runs `REGISTRARS` in the fixed order declared above and collects the * cleanup each one returns. The oracle for "this step is registered" is the * registrar resolving normally; a cleanup is recorded only AFTER its registrar * resolves, so the unwind list is read strictly after the mutations it covers * and never contains a registrar that failed mid-mutation. On any throw, the * cleanups collected so far run in reverse (LIFO) order and the original error * is rethrown. Fail direction per consumer: the HOST sees a failed plugin load * rather than a half-registered corpus, and the USER gets no corvus * agents/commands/skills at all rather than an arbitrary subset. If a cleanup * itself throws while unwinding, that error propagates in place of the original * and the remaining cleanups are skipped — registrars must therefore keep their * cleanups non-throwing. Nothing disables this control: it is unconditional in * `setup`, has no flag or environment switch, and an empty `REGISTRARS` list * degrades to a no-op cleanup. The host replays plugin transforms on config * reload, so every registrar must additionally be idempotent. */ declare const plugin: { id: string; server: (input: import("@opencode-ai/plugin").PluginInput, options?: import("@opencode-ai/plugin").PluginOptions | undefined) => Promise; setup: (ctx: Plugin.Context) => Promise; }; export default plugin; //# sourceMappingURL=server.d.ts.map