{"_id":"@candelahq/missions","name":"@candelahq/missions","dist-tags":{"latest":"0.3.0"},"versions":{"0.3.0":{"name":"@candelahq/missions","version":"0.3.0","description":"OpenCode plugin for multi-step mission orchestration — plan, execute, and validate goals across sessions","type":"module","main":"src/index.ts","types":"src/index.ts","scripts":{"test":"vitest run","test:watch":"vitest","lint":"biome check src/","format":"biome format --write src/"},"license":"Apache-2.0","peerDependencies":{"@opencode-ai/plugin":"*","@opentui/core":">=0.2.11","@opentui/solid":">=0.2.11","solid-js":"^1.9.12"},"peerDependenciesMeta":{"@opentui/core":{"optional":true},"@opentui/solid":{"optional":true},"solid-js":{"optional":true}},"devDependencies":{"@biomejs/biome":"^2.0.0","@opencode-ai/plugin":"latest","@opentui/core":"0.4.5","@opentui/solid":"0.4.5","@types/node":"^25.8.0","solid-js":"1.9.12","typescript":"^5.8.0","vitest":"^4.1.10"},"gitHead":"7479de58db20f69c7d4f2064fc58f50acdb0c059","_id":"@candelahq/missions@0.3.0","_nodeVersion":"26.5.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-B6OTqTXda4FY+2kj7lYQJ4Vi/DFKD16CqZkJqyIHb7SowNQ3ZfrIm2aXyoygERF0yWb1ShGpM1D48gKPpifrQw==","shasum":"ee562777ee631a4e85657e4c549fb0f995b1749f","tarball":"https://registry.npmjs.org/@candelahq/missions/-/missions-0.3.0.tgz","fileCount":13,"unpackedSize":49193,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDsL5iih4yoPCg8+GQQXxnncNKp1FByY6vwvkRvj80sZAIhAKj4d60IJZk1djkGP7UbcjK5mMTFVmIkrsKoNqaFBnWs"}]},"_npmUser":{"name":"austinatapache","email":"austin@apache.org"},"directories":{},"maintainers":[{"name":"austinatapache","email":"austin@apache.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/missions_0.3.0_1785702330588_0.5901180300805138"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-02T20:25:30.436Z","0.3.0":"2026-08-02T20:25:30.732Z","modified":"2026-08-02T20:25:30.991Z"},"maintainers":[{"name":"austinatapache","email":"austin@apache.org"}],"description":"OpenCode plugin for multi-step mission orchestration — plan, execute, and validate goals across sessions","license":"Apache-2.0","readme":"# opencode-missions\n\n`opencode-missions` is a companion plugin for OpenCode that enables multi-step autonomous workflows. It provides mission orchestration tools to decompose large goals into smaller milestones, dispatch child sessions to work on them, and validate results across sessions.\n\n## Features\n\n- **Mission Planning:** Decompose user goals into ordered, testable milestones.\n- **Child Sessions:** Dispatch isolated child sessions for focused work on individual milestones.\n- **Validation:** Define test commands for milestones and validate their completion.\n- **Cross-Session Persistence:** Missions are saved to disk and persist across restarts.\n- **TUI Integration:** A built-in sidebar widget tracks mission progress in the terminal.\n- **Cost Tracking:** Integrates seamlessly with `opencode-candela` for mission-level cost tracking.\n\n## Installation\n\nInstall the plugin in your project workspace:\n\n```bash\nnpm install opencode-missions\n```\n\nRegister it in your project's `.opencode.json` file:\n\n```json\n{\n  \"plugins\": [\n    \"opencode-missions\"\n  ]\n}\n```\n\n## Quick Start\n\nA typical autonomous workflow looks like this:\n\n1. **`mission_plan`**: The agent breaks down a complex goal (\"Build a REST API\") into smaller milestones (\"Set up Express\", \"Add routes\", \"Write tests\").\n2. **`mission_next`**: Starts the first pending milestone and spawns a child session focused on that specific task.\n3. **`mission_validate`**: After the child session finishes, the agent runs the test command to validate completion. If successful, it marks the milestone as done.\n4. The cycle repeats until all milestones are complete!\n\n## Available Tools\n\n| Tool | Description | Key Arguments |\n| --- | --- | --- |\n| `mission_plan` | Create a new mission broken into ordered milestones. | `goal`, `title`, `milestones` |\n| `mission_next` | Start the next pending milestone in a child session. | (None) |\n| `mission_validate` | Run tests to validate a milestone or mark it done/failed. | `milestone_id`, `status` |\n| `mission_status` | View the progress of the active mission. | (None) |\n| `mission_cancel` | Abort child sessions and cancel the current mission. | (None) |\n\n## TUI Sidebar\n\nThe plugin registers a sidebar widget in OpenCode's TUI that displays the active mission's progress and milestone list.\n\n*(Screenshot Placeholder)*\n\n## How It Works\n\n- **File Persistence:** Missions are stored as JSON in `~/.config/opencode/candela-missions.json`, providing atomic updates and persistence across restarts or crashes.\n- **Child Sessions:** For each milestone, `mission_next` spawns a temporary child session. This keeps the agent's context window clean and focused on the immediate task.\n- **Milestone State Machine:** Milestones transition through `pending` -> `working` -> `validating` -> `done`/`failed`.\n\n## Integration with opencode-candela\n\nWhen combined with `opencode-candela`, child sessions spawned by missions automatically inject the `CANDELA_MISSION_ID` environment variable. The Candela plugin maps this to the `X-Mission-Id` HTTP header, enabling grouped cost attribution and tracking for entire multi-step workflows.\n\n## Configuration\n\nBy default, completed missions are pruned after 90 days. You can adjust this or other behavior inside the plugin initialization logic if needed.\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md","_rev":"1-42fd1780372f6154e5f960b3153983e9"}