Skip to content

feat: first slice of the plugin contract (app, storage, content API, search engine, forms) - #1

Merged
zumbrunn merged 9 commits into
mainfrom
feat/plugin-contract
Nov 10, 2026
Merged

zumbrunn merged 9 commits into
mainfrom
feat/plugin-contract

Conversation

@zumbrunn

@zumbrunn zumbrunn commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

The plugin contract of Dune 0.36 as a leaf package with no dependency on @dune/core: the types a plugin is written against, plus the few pure helpers (isDuneError). Born at 1.0.0 with Dune 0.36. This is the base of a four-PR stack (#2, #3, #4 add the split of extension points, the inline-edit HTTP gate, and EditorIdentity.relation); CHANGELOG.md has the full list.

Declared (this PR)

  • The app and route-context types (no web-framework type), storage, the content API, the search-engine contract, forms and submissions, blueprints, scheduled actions, InlineEditManager.
  • PluginServices and its parts (security, rate limit, sessions, users, passwords, authz, engines, blueprints, search, paths), identity (User, UserStore, Session), HistoryEngine.
  • The plugin object: DunePlugin, PluginApi, MountApi, hooks and event payloads, ResponseTransformContext, the capability types (editor.session, editor.inline, admin.prefix, scheduler.executor), the narrow config and PluginRuntime.
  • Error identity (isDuneError, codes) so a plugin can check an error without importing core.

Decisions (Chris, 2026-11-06)

  • SearchEngineCreateContext is narrow: register, setActiveEngine, pages, injectedRecords, loadText.
  • PageIndex here is wider than the theme contract's (search engines hand entries back to core); its pass-through fields are 1.0 promises.

Checks

The JSR package @dune/plugin-api exists and is linked to this repo; 1.0.0 is published by pushing a v1.0.0 tag, held until Dune 0.36 is ready.

🤖 Generated with Claude Code

zumbrunn and others added 7 commits November 6, 2026 13:41
…nd form contracts

First slice of the plugin contract. Copied from @dune/core where the shape
is already the public one, narrowed where core's is wider than a plugin
needs (SearchEngineCreateContext).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… (slice 2a)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ions (slice 2b)

DunePlugin, PluginApi, MountApi, HookRegistry, HookContext and the hook events;
the capability slot and contribution types; a narrow DuneConfig and PluginAuthz;
PluginRuntime with narrow structural interfaces for the engine, router, theme
loader, search, flex, submissions, sections, metrics and jobs. Handlers and
plugin callbacks are bivariant so core's wider contexts are accepted.

Also drops two unused imports left by slice 2a.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
User loses avatarUrl, providerId, linkedProviders, lastSeenAt and
stripeCustomerId; UserStore loses getByProvider, linkProvider and
unlinkProvider. PageIndex loses gated, roles, publishAt, unpublishAt, fileUrl,
termPageFor and coverImage. Nothing in the first-party plugins or the testing
harness reads them; adding a field later is additive, removing one is not.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
providerId, linkedProviders, getByProvider, linkProvider and unlinkProvider are
what a third-party OAuth login provider is built from. No first-party plugin
uses them yet; they stay so one can be written against the 1.0 contract.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Where the admin is mounted. Core reads it instead of assuming /admin; with no
provider there is no admin.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…une#125)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@zumbrunn
zumbrunn marked this pull request as ready for review November 10, 2026 12:53
@zumbrunn
zumbrunn merged commit dbf2575 into main Nov 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant