feat: add OpenCode plugin support (closes #6)#9
Open
alfasin wants to merge 1 commit intocytostack:mainfrom
Open
feat: add OpenCode plugin support (closes #6)#9alfasin wants to merge 1 commit intocytostack:mainfrom
alfasin wants to merge 1 commit intocytostack:mainfrom
Conversation
Add --opencode flag to 'openwolf init' for registering OpenCode plugin instead of Claude Code hooks. - Create OpenCode plugin directory with separated modules: - types.ts: interfaces for SessionState, FileRead, FileWrite, etc. - fs.ts: file system helpers (readJSON, writeJSON, etc.) - anatomy.ts: anatomy.md parsing and serialization - session.ts: session start handling - pre-read.ts: repeated read warnings, anatomy lookups - pre-write.ts: cerebrum check, buglog lookup - post-read.ts: token estimation - post-write.ts: anatomy update, memory append, bug detection - stop.ts: session summary, ledger update - index.ts: main plugin entry point - Map OpenCode hooks to OpenWolf infrastructure - Add opencode-md-snippet.md template - Update shared.ts with projectDir param + wolfDirExists() - Exclude plugin directory from tsconfig build Refactors monolithic 1000-line file into 10 focused modules. Closes cytostack#6
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.
Summary
Add OpenCode plugin support to OpenWolf via a new
--opencodeflag onopenwolf init..opencode/plugin/openwolf.ts.wolf/infrastructureexperimental.chat.system.transformChanges
src/cli/init.tsinitOpenCode()function,--opencodeoption handlingsrc/cli/index.ts--opencodeCLI optionsrc/hooks/shared.tsprojectDirparam togetWolfDir(), newwolfDirExists()tsconfig.jsonsrc/templates/*.tsfrom compilationsrc/templates/opencode-plugin.tssrc/templates/opencode-md-snippet.mdUsage
This creates:
.wolf/directory with all OpenWolf infrastructure.opencode/plugin/openwolf.ts- the pluginopencode.mdwith OpenWolf instructions