Skip to content

v2.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 05 Jun 02:58

v2.0.0 — Breaking: definePlugin required

⚠️ Breaking Change

ensureContracts() has been removed. All plugins must now use definePlugin() to declare their tools. The old-style createEntry()/register() pattern without contracts.tools will fail at both build time and load time.

If you see this error after upgrading:

Plugin "my-plugin" is missing contracts.tools.
Migrate to definePlugin() from carapace-plugin-sdk

You need to migrate your plugin to use definePlugin(). See the migration example below.

What changed

  • Removed ensureContracts() function and its backward-compat fallback
  • createAdapter() now throws if contracts.tools is missing
  • carapace-generate-cli validates contracts.tools before generating artifacts
  • Updated ARCHITECTURE.md to reflect v2 behavior

Migration

Replace your manual createEntry() with definePlugin():

// Before (v1.x) — no longer works
function createEntry() {
  return {
    id: "my-plugin",
    register(api) {
      api.registerTool({ name: "my_tool", ... });
    },
  };
}
export { createEntry };

// After (v2.0) — required
import { definePlugin } from "carapace-plugin-sdk";
import { Type } from "@sinclair/typebox";

export const createEntry = definePlugin({
  id: "my-plugin",
  name: "My Plugin",
  tools: (tool) => [
    tool({
      name: "my_tool",
      description: "Does the thing.",
      parameters: Type.Object({ input: Type.String() }),
      execute: async ({ input }, config) => ({ result: input }),
    }),
  ],
});

Installation

npm install carapace-plugin-sdk@latest