feat(extension): auto-deploy mode cards on activate (#533) - #546
Merged
Conversation
… on activate (#533) Stage autodev.md and autoresearch.md from the extension bundle into the global opencode agents directory on every activation. Same always-copy semantics as Pasqal connector staging: extension-owned, overwrite-on- activate, never blocks activation. This closes the gap where mode cards existed in the repo but were never deployed to a location opencode's agent discovery could find — users had to run deploy-agents.mjs manually or never saw the modes in the picker. Includes 6 tests mirroring pasqal_assets.test.ts (happy path, dir creation, overwrite, idempotency, missing-source throw, tripwire).
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe extension now copies bundled ChangesMode-card staging
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant ExtensionActivation
participant stageModCards
participant GlobalOpenCodeAgentsDirectory
ExtensionActivation->>stageModCards: stage bundled mode cards
stageModCards->>GlobalOpenCodeAgentsDirectory: create directory and copy cards
stageModCards-->>ExtensionActivation: return result or error
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #533
Stages
autodev.mdandautoresearch.mdfrom the extension bundle into~/.config/opencode/agents/on every activation — the global config directory opencode always globs for agent markdown.Why: Mode cards existed in the repo (PR #522) but were never deployed to a location opencode's agent discovery could find. Users who installed Amicode never saw the autodev/autoresearch modes in the agent picker unless they ran
deploy-agents.mjsmanually.How: Same always-copy pattern as Pasqal connector staging (
pasqal_assets.ts): extension-owned,mkdir -p+copyFileSyncon activate, never blocks activation on failure.Testing: 6 tests in
mode_cards_staging.test.ts(mirrorspasqal_assets.test.ts): happy path, dir creation, stale overwrite, idempotency, missing-source throw, tripwire that the extension ships the cards.Summary by CodeRabbit
New Features
Bug Fixes