- Install:
bun install - Type check:
bun run tsc --noEmit - Run:
bun run index.ts - Test manually:
bun -e "import { MemoryPlugin } from './index.ts'; ..."
- Runtime: Bun (use Bun APIs:
Bun.file(),Bun.write(),Bun.Glob,Bun.$) - Imports: Use
import typefor type-only imports (verbatimModuleSyntax) - Types: Strict mode enabled, handle
undefinedfrom indexed access (noUncheckedIndexedAccess) - Naming: camelCase for functions/variables, PascalCase for types/interfaces
- Exports: Re-export public API from
index.ts, implementation insrc/
- Tools use
@opencode-ai/plugintool()helper with Zod-like schema (tool.schema) - Plugin exports async function returning
{ tool: { ... } } - Memories stored in
.opencode/memory/as logfmt files