@aaplugin/platform-opencode
v1.0.0-beta.4
Published
OpenCode Platform integration for AAPlugin.
Readme
@aaplugin/platform-opencode
OpenCode Platform package for aaplugin.
pnpm add -D @aaplugin/kit @aaplugin/platform-opencodeimport { defineConfig } from '@aaplugin/kit';
import openCode from '@aaplugin/platform-opencode';
export default defineConfig({
name: 'my-plugin',
version: '1.0.0',
description: 'Reusable AI workflows.',
platforms: [openCode()],
});The package also exports the named openCode factory, its option types, OpenCodePackageComponent, OpenCodeNativeAgentComponent, PLATFORM_ID, and PLATFORM_API_VERSION.
OpenCodePackageComponent is for trusted Extension contributors that need native workspace delivery. OpenCode owns its validation and rendering and does not create a synthetic Plugin Manifest for it.
Runtime and installation
The delivery root is dist/opencode/workspace/: apply its contents to the business repository root, including hidden .opencode/ files and any generated opencode.json or Public files. This is a workspace overlay, not an npm Hook plugin. OpenCode's npm plugin loader does not install the complete Skill/Agent/Runtime tree.
A release branch can distribute the complete overlay:
git clone --single-branch --branch release-opencode https://github.com/OWNER/REPO.git ./my-plugin-opencodeMerge the checked-out delivery into the target repository through its normal version-controlled file workflow. Resolve existing-file and configuration conflicts before applying it; do not replace the repository or discard existing opencode.json settings. There is no claimed native OpenCode command to install this whole overlay from a Git ref.
For a fresh workspace, copy the complete overlay into a new directory before opening it:
mkdir ./my-workspace && cp -R ./dist/opencode/workspace/. ./my-workspace/
cd ./my-workspace
opencodeSkills are under .opencode/skills/ and Runtime entries under .opencode/runtime/<id>/main.mjs. Resolve ../../runtime/<id>/main.mjs from the loaded Skill, or resolve .opencode/runtime/<id>/main.mjs against the actual business repository root. Do not assume an arbitrary shell subdirectory is that root. Keep cwd at the business repository when invoking Node.
Node must be on PATH; the standalone OpenCode executable is not assumed to be Node. AAPlugin targets Node 20 ESM and does not supply an interpreter. SessionStart Hook context is cached per session and included in its system-transform output; repeated transforms do not duplicate text in the same output. Candidate/contract tests are separate from a real OpenCode discovery/session check.
Sources: Skills, Plugins. The system-transform callback shape was checked against @opencode-ai/[email protected].
License
MIT
