Repository navigation
Releases
Releases · ranjithrajv/opencode-plugin-kit
v1.0.0-alpha.8
Added
- Behaviour-level coverage for the polling fetcher refresh-after-stop and post-error
inFlight()reset semantics. theme.ts—toneColor()maps semantic tones (base,muted,error,warning,success,info) onto host theme tokens, replacing per-plugin colour branches.util.ts—safe()wraps throw-prone host reads.tokens.ts—tokenBreakdown(),messageCost()andestimateTokens()normalize v1/v2 token and cost shapes.slot.ts—claimSlot()claims a UI slot and always returns a callable cleanup.panel.ts—createPanel()ownssession.panelclaim, name filtering, host open/close/fullscreen actions and active-state checks.persistedState.ts—createPersistedState()provides a reactive persisted object across the memory, store and signal backends.layout.ts—budgetFor(),compactFor()andcolumnFor()centralize sidebar width/row-budget math.format.tsgainscompactNumber(),formatCost(),formatDuration(),formatClock(),formatDelta(),formatPercent(),shortPath()andtruncate().commands.tsgainsregisterKeymapLayer()for layers registered from a rendered component.KitSlotOptionsgainsbefore/replaceanchors,KitUIgains an optionalpanel,KitStoragegains an optionalmemory, andKitKeymap.layeraccepts an optional layer-levelenabled.jsonc.ts—cleanJsonc(),tolerantParse(),addPluginSpec(),addPluginsKey(),removePluginSpec()andeditPluginsText()read JSONC and edit a config'spluginsarray textually, preserving comments.hostEvents.ts—createHostEvents()subscribes to host data events and keeps a heartbeat with a polling fallback.catalog.ts—listSkillCatalog(),syncSkillCatalog(),readSkillCatalog()andfindAgentsMd()centralize the location/sync/list dance and AGENTS.md discovery.messageIndex.ts—createMessageIndex()builds an incremental, fingerprint-guarded, windowed index of session messages, keyed per context.statusbar.ts—createStatusbar()claims a footer/status slot (home.footer,home.footer.status,prompt.footer,prompt.footer.status,prompt.footer.file) and degrades to a no-op on hosts without it.composer.ts—createComposer()claimssession.composer.topand exposes the last render input.palette.ts—paletteCommand(),registerPaletteCommand(),registerPaletteGroup()anddynamicPaletteCommand()register command-palette entries through a renderedapp-slot keymap layer.router.ts—createPage(),navigateTo()andcurrentRoute()register and drive plugin pages on hosts that exposeui.router.attention.ts—requestAttention(),notifyTaskComplete()andnotifyError()request a notification/sound and fall back to a toast.tabs.ts—createTabs()reads and controls session tabs (open/focus/move/close/active), no-op on hosts without tab support.KitRouter,KitTabsandKitAttentionhost-contract types;KitUIgains optionalrouterandtabs.QUICKSTART.mdandexamples/hello-plugin/— a from-scratch guide and a minimal working plugin.docs/SURFACES.md— maps every plugin surface (sidebar, footer/status, composer, panel, pages, palette, tabs, attention) to the module that owns it.docs/COMPATIBILITY.md— the published host compatibility matrix.tests/runtime-smoke.test.ts(npm run test:smoke) — imports the real@opencode/pluginruntime and executes every kit factory against a host-shaped context, catching import-time and runtime breakage the type-tripwire cannot see.scripts/check-host-compat.mjs(npm run check:host-compat) now runs both the type tripwire and the runtime smoke against each pinned@opencode/pluginversion, reports per-check results, and can refresh the matrix with--write-matrix..github/workflows/host-compat.yml— a version matrix that runs the compatibility checks on every push and PR.
Changed
tabs.ts—active()andisOpen()drop redundant try/catch around the internallist(), which already swallows host errors.publish.ymlgains a host-compatibility gate beforenpm publish, so a release that breaks a supported host cannot be published.package.json#filesagain includesdist/— the built./collapsibleentry (dist/collapsible.js) is the non-development export, so dropping it from the tarball would have broken the published subpath.
v1.0.0-alpha.7
Changed
- Widened the
@opencode/pluginpeer range from^2.0.15to^2.0.3, matching what the kit actually supports. Verified by typecheck and the type-tripwire against 2.0.3, 2.0.10 and 2.0.18. 2.0.3 is the floor: earlier 2.x releases ship no./tuisubpath export, so nothing importing@opencode/plugin/tuican resolve it. - Documented the 2.0.3 floor in the Compatibility section.
CollapsibleSectionandCollapsibleGrouptake an optionalthemeprop, so a consumer can hand down the host's ownusePlugin().themeinstead of the kit reaching for the plugin context itself.
Fixed
CollapsibleSection/CollapsibleGroupno longer throwPluginContextProvider is missingwhen the kit is installed fromnode_modules. Both calledusePlugin()unconditionally, but a registry install resolves a different copy of@opencode/pluginandsolid-jsthan the one the host renders with, so the host's plugin context was never visible. Callers that already hold the context passthemedown; theusePlugin()fallback still resolves for deduped module graphs (tests, monorepos) and degrades to unthemed text rather than throwing.
Install
npm install opencode-plugin-kitlatest now points at this release, so a plain install gets the v2 kit. The
publish workflow tags each prerelease under its own identifier and leaves
latest alone, so later alphas will not move it automatically — install
opencode-plugin-kit@alpha to track the newest build.
Consumer action required
If you render a collapsible sidebar section, pass the host theme:
const { theme } = usePlugin()
<CollapsibleSection title="..." count={n} theme={theme}>...</CollapsibleSection>v1.0.0-alpha.6
Changed
- Migrated the host contract from the legacy V1 plugin beta to the OpenCode v2 packages
@opencode/plugin/@opencode/sdk/@opencode/theme(2.0.15, types-only optional peer): import paths,ResolvedThemetext tokens (text.base/text.muted), anddialog.selectplaceholder. palette/slash.argumentsare literal types matching the v2KeymapCommand.- Added
KitModelShapeso the model accessors accept both messages (numericcost) and model-list entries /ModelInfo(arraycost). readAuth()now reads OpenCode 2's SQLite credential store, falling back to the legacyauth.json.
Fixed
tsconfig.jsonno longer excludestests/**/*.test-d.ts. The exclude was inherited by Vitest's typechecker, sohost.test-d.ts— the host-contract tripwire — was silently never typechecked.- Corrected
host.test-d.ts(missingKitStorageimport, a non-existentexpectTypeOf(...).get(), and the command subset omitting requiredrun).
Added
- Tests covering the OpenCode 2 SQLite credential store (restores the 100% coverage gate).
v1.0.0-alpha.1
First published release of opencode-plugin-kit.
Added
- Shared provider vocabulary (
providers.ts) — Zen/Go provider ids, labels, discovery - Row formatting (
rows.ts), number/date formatting (format.ts) - Persisted view/filter picker (
viewPicker.ts) — registry, slash command, dialog, toast - Storage-backed cache (
cache.ts/cachedResource.ts), polling fetcher, schemas, toast, toggle commands, collapsible sections - Full vitest suite with 100% coverage gate (pre-commit enforced)
Changed
- License changed from AGPL-3.0 to MIT