fix: bundle OMO component hook CLIs#46
Conversation
|
Thanks for digging into this — your aggregate hooks-target regression test idea was spot on. The fix landed upstream in code-yeongyu/oh-my-openagent@b4c96895c rather than here, at a different layer: the root cause was publish-step ordering (the oh-my-opencode/oh-my-openagent tarballs that feed the plugin cache were packed before the component build step; the components were built, just too late). Upstream now builds components before any plugin-shipping package packs, pins that ordering with a workflow test, and adds an install-time guard that resolves every |
Problem Situation
LazyCodex issue #45 reports that OMO 4.8.1 hook commands point at components/*/dist/cli.js, but the marketplace plugin bundle omitted those built files, causing Node MODULE_NOT_FOUND before hooks can parse input.
Reproduction Logs
RED: node --test test/aggregate-hooks.test.mjs failed with missing targets including components/git-bash/dist/cli.js, components/ulw-loop/dist/cli.js, components/comment-checker/dist/cli.js, components/lsp/dist/cli.js, components/rules/dist/cli.js, components/start-work-continuation/dist/cli.js, components/telemetry/dist/cli.js, and components/ultrawork/dist/cli.js.
Approach
Commit the generated dist outputs for every component referenced by plugins/omo/hooks/hooks.json and add an aggregate packaging regression test that extracts ${PLUGIN_ROOT}/components/*/dist/cli.js hook command targets and asserts each exists in the bundle.
Why I Am Confident
The new regression test failed before the bundled outputs and passes after them. A direct invocation of the reported git-bash hook target exits without MODULE_NOT_FOUND, and a broad smoke check confirms all eight component CLI targets exist and load.
Risks
Low-to-medium: this adds generated bundle files to the marketplace repository. The risk is artifact drift if the upstream sync process is skipped again; the new test makes that failure visible in this repository.
User-Visible Behavior Changes
Fresh LazyCodex/OMO plugin cache installs include the hook CLI files referenced by hooks/hooks.json, so PreToolUse, PostToolUse, Stop, SessionStart, and related hooks no longer fail at Node module resolution.
Verification
This PR was debugged, implemented, and created with LazyCodex.
Tag: lazycodex-generated
Summary by cubic
Bundle OMO component hook CLIs and all configured MCP runtimes inside the plugin (including LSP via bundled
@code-yeongyu/lsp-tools-mcpandast-grep) so hooks resolvecomponents/*/dist/cli.jsand MCP servers run from the bundle. Fixes MODULE_NOT_FOUND on fresh installs and aligns LSP/MCP paths; addresses LazyCodex issue #45.comment-checker,git-bash,lsp, andrulesunderplugins/omo/components/*/dist/cli.jsto matchplugins/omo/hooks/hooks.json; kept theruleshook dependency-free and aligned its dist CLI mode for consistent execution.components/lsp-tools-mcpand wiredcomponents/lspto it:components/lsp/.mcp.jsonruns../lsp-tools-mcp/dist/cli.js mcp, and theomo-lspCLI delegates to the bundled runtime and exposeshook post-tool-useandhook post-compact.components/ast-grep-mcpruntime to satisfy theast_grepMCP server from the plugin manifest.git_bashMCP entry fromplugins/omo/.mcp.json; README updated to includeast-grep-mcpand reflect MCP changes.Written for commit 12be80c. Summary will update on new commits.