Skip to content

v0.8.0 — API v2 runtimes and views

Choose a tag to compare

@Juliusolsson05 Juliusolsson05 released this 13 Sep 02:21
503bced

Types and build helpers for the Agent Code extension platform API v2. Extensions now get one background runtime that owns commands and shared state, plus separate sandboxed views that attach and detach independently.

Install

The SDK is distributed from GitHub, not npm. Its built dist/ is committed.

npm i -D github:Juliusolsson05/agent-code-extension-api#v0.8.0

It requires an Agent Code build that includes the extension platform (Juliusolsson05/agent-code#577).

What's new since v0.3.0

  • Runtimes and views: defineRuntime and defineView helpers, host-issued view identities, bounded JSON requests and published view state, and explicit activation events (onStartupFinished, onCommand:<id>, onView:<id>).
  • Build preset: extensionViteConfig({ entries }) builds independent runtime and view modules, and the single-entry v1 build still works.
    • It pins the production JSX transform, so a build run with NODE_ENV=development no longer ships a view that crashes with jsxDEV is not a function.
    • The package exports now include a default condition, so a vite.config.ts in a CommonJS package can load the SDK.
  • Themes: declarative, namespaced themes built from the Agent Code appearance-token vocabulary.
  • Project files: files.readText and files.writeText for runtimes and views.
    • Reads need the fs.read permission, and writes need fs.write.
    • Paths are relative to a live session's project.
    • Writes are create-only unless you pass the version from your last read.
  • Notifications: notifications.show(message) needs the notifications.show permission. It posts a short toast attributed to your extension, even when no view is open.

API v1 extensions keep working unchanged. See the README for the full contract and limits.