42 lines
1.9 KiB
Markdown
42 lines
1.9 KiB
Markdown
# Requirements
|
|
|
|
## Plugin loading and tools
|
|
|
|
- OpenCode V2 must load the plugin from the consuming project's installed local
|
|
package directory without trying to download the provisional package name
|
|
from npm.
|
|
- The package root must expose an OpenCode-loadable JavaScript entrypoint.
|
|
- Register `toolkit_project_status` in the `toolkit` Code Mode namespace. The
|
|
tool must report the current project and VCS status through OpenCode's V2 API
|
|
without mutating project state.
|
|
|
|
## Installation safety
|
|
|
|
- Register the plugin with a config-relative path that works with either
|
|
`opencode.json` or `.opencode/opencode.json`.
|
|
- Migrate an installer-owned legacy npm-name entry on update, and remove only
|
|
the installer-owned local path on uninstall.
|
|
- Preserve JSONC comments and unrelated plugin entries; do not overwrite
|
|
unmanaged project files.
|
|
|
|
## Verification
|
|
|
|
- Keep unit and installer tests deterministic and independent of external model
|
|
providers.
|
|
- Verify plugin activation and tool execution on OpenCode 2.0.24 using a local
|
|
mock OpenAI-compatible endpoint; do not make a paid or remote provider call as
|
|
part of deterministic validation.
|
|
|
|
## Optional memory
|
|
|
|
- Memory tools must not register unless explicitly enabled in plugin options.
|
|
- Session memory is scoped to the current OpenCode project and session; project
|
|
memory is separately opt-in and shared only within the same canonical project.
|
|
- Memory must be written, listed, retrieved, and deleted only through explicit
|
|
tool calls; prompts, tool outputs, and summaries are not captured automatically.
|
|
- Apply a configurable expiration (default 30 days); expired entries must never
|
|
be returned, and memory content must not be automatically injected into future
|
|
model context or uploaded by the plugin.
|
|
- Reject memory operations for sessions belonging to another project. Provider-
|
|
backed learning and live-profile persistence require separate verification.
|