diff --git a/package.json b/package.json index f9f3c4e..67b212c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencode-supermemory", - "version": "2.0.16", + "version": "2.0.17", "description": "OpenCode plugin that gives coding agents persistent memory using Supermemory", "type": "module", "main": "dist/index.js", diff --git a/src/server.ts b/src/server.ts index 45e74fd..468ce1b 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,15 +1,19 @@ /** - * OpenCode 2 server plugin entry, resolved as `opencode-supermemory/server`. - * The root export stays the OpenCode V1 plugin so both generations can load - * the same package. + * Server plugin entry, resolved as `opencode-supermemory/server` by both + * OpenCode generations. OpenCode 2 reads `id` and `setup()`. OpenCode V1 + * (1.16 and later) also resolves this export and calls `server()`, so the + * default export carries both implementations. */ +import type { Plugin as V1Plugin } from "@opencode-ai/plugin"; import type { Plugin } from "@opencode/plugin"; +import { SupermemoryPlugin } from "./index.js"; import { setupV2 } from "./v2/runtime.js"; -const plugin: Plugin.Plugin = { +const plugin: Plugin.Plugin & { server: V1Plugin } = { id: "supermemory", setup: (context) => setupV2(context), + server: (input, options) => SupermemoryPlugin(input, options), }; export default plugin; diff --git a/src/version.ts b/src/version.ts index 33a1c36..4ee3164 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,3 +1,3 @@ // AUTO-GENERATED by scripts/sync-version.mjs — do not edit by hand. // Sourced from package.json "version" so the two cannot drift. -export const PLUGIN_VERSION = "2.0.16"; +export const PLUGIN_VERSION = "2.0.17";