Skip to content

fix: bundle OMO component hook CLIs#46

Open
IndianMarshmello wants to merge 6 commits into
code-yeongyu:mainfrom
IndianMarshmello:lazycodex/bug-fix-issue-45-component-dist
Open

fix: bundle OMO component hook CLIs#46
IndianMarshmello wants to merge 6 commits into
code-yeongyu:mainfrom
IndianMarshmello:lazycodex/bug-fix-issue-45-component-dist

Conversation

@IndianMarshmello

@IndianMarshmello IndianMarshmello commented Jun 10, 2026

Copy link
Copy Markdown

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

  • RED: node --test test/aggregate-hooks.test.mjs failed on missing components/*/dist/cli.js targets before generated outputs were added
  • GREEN: node --test test/aggregate-hooks.test.mjs passed after adding bundled dist outputs
  • Manual QA: printf '{}' | node plugins/omo/components/git-bash/dist/cli.js hook pre-tool-use exited 0 with no MODULE_NOT_FOUND
  • Smoke: all eight hook CLI target paths exist=true and load enough to print usage or process arguments
  • Note: npm test is not fully runnable from this LazyCodex mirror checkout; existing tests expect upstream monorepo paths such as packages/omo-codex and @oh-my-opencode/shared-skills. The targeted aggregate hook regression passed.

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-mcp and ast-grep) so hooks resolve components/*/dist/cli.js and MCP servers run from the bundle. Fixes MODULE_NOT_FOUND on fresh installs and aligns LSP/MCP paths; addresses LazyCodex issue #45.

  • Bug Fixes
    • Bundled compiled CLIs for comment-checker, git-bash, lsp, and rules under plugins/omo/components/*/dist/cli.js to match plugins/omo/hooks/hooks.json; kept the rules hook dependency-free and aligned its dist CLI mode for consistent execution.
    • Vendored components/lsp-tools-mcp and wired components/lsp to it: components/lsp/.mcp.json runs ../lsp-tools-mcp/dist/cli.js mcp, and the omo-lsp CLI delegates to the bundled runtime and exposes hook post-tool-use and hook post-compact.
    • Bundled components/ast-grep-mcp runtime to satisfy the ast_grep MCP server from the plugin manifest.
    • Removed the root git_bash MCP entry from plugins/omo/.mcp.json; README updated to include ast-grep-mcp and reflect MCP changes.

Written for commit 12be80c. Summary will update on new commits.

Review in cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant