@@ -1,75 +1,79 @@
|
||||
# stanp-opencode
|
||||
|
||||
One package with three independently loadable OpenCode V2 plugins:
|
||||
## Release installation
|
||||
|
||||
- **Agents** (`stanp-opencode.agents`): coordinate, specialist workers, routing, inherited permissions, native delegation, and the anti-overengineering skill. Existing user skill definitions are preserved.
|
||||
- **Multi-work** (`stanp-opencode.multi-work`): Herdr delegation and authenticated child bindings. Requires Agents **loaded first**, including at destination locations.
|
||||
- **Quota** (`stanp-opencode.quota`): independent ChatGPT quota tracking and its TUI (`stanp-opencode.quota-tui`). The RPC remains `stanp-opencode.quota`.
|
||||
|
||||
There is no Personal plugin. Todos use native OpenCode tools. Plugins never register or alter MCP servers; user MCP configuration remains yours.
|
||||
|
||||
## Install the latest release
|
||||
|
||||
Requires OpenCode 2.0.22, Bun 1.4.2+, Bash, curl, jq, and `sha256sum` on Linux or WSL.
|
||||
|
||||
Run the installer without sudo:
|
||||
Requires OpenCode 2.0.22, Bun 1.4.2+, Bash, curl, jq, and `sha256sum` on Linux/WSL.
|
||||
|
||||
```sh
|
||||
# Upgrading the old monolith resets quota and invalidates its Multi-work bindings.
|
||||
curl -fsSL https://git.krtss.de/StanPonomarev/stanp-opencode/raw/branch/main/install.sh | bash -s -- --plugins agents,multi-work,quota
|
||||
opencode service restart
|
||||
# Connect OpenAI and select coordinate in OpenCode.
|
||||
```
|
||||
|
||||
Use any nonempty subset; Multi-work requires Agents. Explicit `--plugins multi-work` fails rather than silently adding Agents. When run from a terminal without the flag, the installer asks for a selection and offers Agents if Multi-work is selected alone. Noninteractive fresh installs require `--plugins`. Upgrades without a flag retain the existing selection; the old monolith upgrades to all three. Use an explicit flag to change that selection.
|
||||
Choose any plugin subset; Multi-work requires Agents first.
|
||||
|
||||
## Install from a local checkout
|
||||
## Local installation
|
||||
|
||||
This requires Bash and Bun 1.4.2+:
|
||||
From a local checkout, run:
|
||||
|
||||
```sh
|
||||
bash /path/to/stanp-opencode/install-local.sh --plugins agents,multi-work,quota
|
||||
opencode service restart
|
||||
# Connect OpenAI and select coordinate in OpenCode.
|
||||
```
|
||||
|
||||
The script installs dependencies and builds the checkout before installing it.
|
||||
## GPT configuration
|
||||
|
||||
After either installation, restart `opencode` or run `opencode service restart` for an existing service. Connect OpenAI and select `coordinate`. The required models must be available for the workers to run.
|
||||
Merge this into `~/.config/opencode/opencode.json`, preserving unrelated settings and plugins; update existing plugin entries instead of appending duplicates.
|
||||
|
||||
Both installers use `~/.config/opencode`, respect `XDG_CONFIG_HOME`, and accept `OPENCODE_CONFIG_DIR` as an override.
|
||||
They update only owned registrations in `opencode.json` and the owned installation directory; unrelated settings, plugins, MCP configuration, and `opencode.jsonc` remain unchanged. Quota's TUI is installed only when Quota is selected.
|
||||
```jsonc
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
// Required at the root and in worktrees.
|
||||
"experimental": { "subagent_depth": 2 },
|
||||
"plugins": [
|
||||
{
|
||||
"package": "./plugins/stanp-opencode/agents",
|
||||
"options": {
|
||||
"mode": "gpt",
|
||||
"provider": "openai",
|
||||
// Priority may cost more; set false to opt out.
|
||||
"lunaPriority": true,
|
||||
},
|
||||
},
|
||||
{ "package": "./plugins/stanp-opencode/multi-work" },
|
||||
{ "package": "./plugins/stanp-opencode/quota" },
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
## Clean-break upgrade
|
||||
## Custom model configuration
|
||||
|
||||
The monolith, root package entrypoint, and `basePlugin` export are deliberately retired. Use the `./agents`, `./multi-work`, and `./quota` package exports, or the installed directory paths below. Replace manually configured legacy registrations too; do not load the old monolith alongside the new plugins.
|
||||
Merge this into `~/.config/opencode/opencode.json`, preserving unrelated settings and plugins; update existing plugin entries instead of appending duplicates. The `deep-lo` and `deep-hi` assignments are optional as a pair; if either is omitted, both deep workers are disabled and orchestration uses `good-lo`.
|
||||
|
||||
Distinct plugin identities intentionally start fresh storage: **quota tracking resets and existing Multi-work bindings cannot resume**. Start new delegated sessions. Old host storage is not migrated or edited. Existing Git worktrees and Herdr workspaces are never deleted or modified by this upgrade. New bindings remain resumable across restarts within the new Multi-work identity.
|
||||
|
||||
## Configuration
|
||||
|
||||
See [GPT configuration](examples/gpt.opencode.jsonc) and [custom model assignments](examples/custom.opencode.jsonc).
|
||||
|
||||
Installed package paths are `./plugins/stanp-opencode/agents`, `./plugins/stanp-opencode/multi-work`, and `./plugins/stanp-opencode/quota`, in that order. Model options belong only to Agents. In GPT mode with the `openai` provider, set `lunaPriority` to `false` to avoid requesting priority pricing. Other providers do not accept this option. Custom top-level and per-agent `provider` and `lunaPriority` fields are invalid.
|
||||
Custom configurations require the four `fast-*` and `good-*` assignments; `deep-lo` and `deep-hi` are optional. Assignments use `provider/model` model names and require both `model` and `effort` when supplied. If either deep assignment is omitted, both deep workers are disabled and orchestration uses `good-lo`.
|
||||
The legacy optional `coordinate` assignment is accepted for compatibility but ignored. Orchestration
|
||||
inherits `deep-lo`, or `good-lo` when the configured `deep-lo` model is unavailable.
|
||||
|
||||
The plugin includes the anti-overengineering skill for keeping changes minimal without
|
||||
weakening correctness. `coordinate` can use it to audit worker review findings, reject
|
||||
redundant defensive additions, and ask before delegating substantial defensive complexity.
|
||||
Ordinary in-scope fixes do not require additional approval.
|
||||
|
||||
## Multi-work
|
||||
|
||||
Select `multi-work` in a verified live Herdr root checkout to delegate local retrieval
|
||||
to `fast-lo` and independent work to `coordinate` children in either the current root
|
||||
checkout or new Herdr worktrees.
|
||||
It is primary-only and, like `coordinate`, uses the `deep-lo` model and effort,
|
||||
falling back to `good-lo` when `deep-lo` is unavailable. Clients viewing the
|
||||
same eligible location can see it; eligibility is revalidated before creation.
|
||||
|
||||
Configure `experimental.subagent_depth: 2` at the root and worktree locations.
|
||||
For new coordinate tasks, omit `worktree` to share the current root checkout, or pass
|
||||
`worktree: { base: "source-branch" }` for an isolated checkout. The tool retains native
|
||||
session/job handling. See [usage, permissions,
|
||||
failure handling, and verification limits](docs/multi-work.md).
|
||||
|
||||
## Uninstall
|
||||
|
||||
Remove `plugins/stanp-opencode` from the selected configuration directory and its three owned configuration entries, then restart OpenCode. This does not remove worktrees or host storage.
|
||||
```jsonc
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
// Required at the root and in worktrees.
|
||||
"experimental": { "subagent_depth": 2 },
|
||||
"plugins": [
|
||||
{
|
||||
"package": "./plugins/stanp-opencode/agents",
|
||||
"options": {
|
||||
"mode": "custom",
|
||||
"agents": {
|
||||
"fast-lo": { "model": "openai/gpt-6-luna", "effort": "low" },
|
||||
"fast-hi": { "model": "openai/gpt-6-luna", "effort": "high" },
|
||||
"good-lo": { "model": "openai/gpt-6.1-sol", "effort": "low" },
|
||||
"good-hi": { "model": "openai/gpt-6.1-sol", "effort": "high" },
|
||||
"deep-lo": { "model": "openai/gpt-6-astra", "effort": "low" },
|
||||
"deep-hi": { "model": "openai/gpt-6-astra", "effort": "high" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "package": "./plugins/stanp-opencode/multi-work" },
|
||||
{ "package": "./plugins/stanp-opencode/quota" },
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user