oh-my-opencode 4.5.1 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/opencode-qa/SKILL.md +194 -0
- package/.agents/skills/opencode-qa/references/cli-commands.md +188 -0
- package/.agents/skills/opencode-qa/references/db-investigation.md +197 -0
- package/.agents/skills/opencode-qa/references/events-hooks.md +110 -0
- package/.agents/skills/opencode-qa/references/sdk.md +96 -0
- package/.agents/skills/opencode-qa/references/server-api.md +200 -0
- package/.agents/skills/opencode-qa/references/testing-harness.md +218 -0
- package/.agents/skills/opencode-qa/references/tui-tmux.md +52 -0
- package/.agents/skills/opencode-qa/scripts/db-session-by-id.sh +53 -0
- package/.agents/skills/opencode-qa/scripts/db-session-by-name.sh +57 -0
- package/.agents/skills/opencode-qa/scripts/db-session-by-text.sh +158 -0
- package/.agents/skills/opencode-qa/scripts/export-roundtrip.sh +57 -0
- package/.agents/skills/opencode-qa/scripts/lib/common.sh +216 -0
- package/.agents/skills/opencode-qa/scripts/server-smoke.sh +64 -0
- package/.agents/skills/opencode-qa/scripts/sse-hook-probe.sh +106 -0
- package/.agents/skills/opencode-qa/scripts/tui-smoke.sh +89 -0
- package/README.ja.md +43 -18
- package/README.ko.md +43 -18
- package/README.md +92 -24
- package/README.ru.md +43 -18
- package/README.zh-cn.md +55 -24
- package/bin/oh-my-opencode.js +49 -3
- package/bin/oh-my-opencode.test.ts +202 -0
- package/bin/platform.d.ts +7 -1
- package/bin/platform.js +23 -4
- package/bin/platform.test.ts +97 -10
- package/dist/cli/cleanup-command.d.ts +4 -0
- package/dist/cli/cleanup.d.ts +11 -0
- package/dist/cli/cli-program.d.ts +19 -0
- package/dist/cli/index.js +30085 -26385
- package/dist/cli/install-codex/codex-cache-bundled-mcps.d.ts +5 -0
- package/dist/cli/install-codex/codex-cache-command-shim.d.ts +1 -0
- package/dist/cli/install-codex/codex-cache-legacy-bins.d.ts +3 -0
- package/dist/cli/install-codex/codex-cache-local-dependencies.d.ts +1 -0
- package/dist/cli/install-codex/codex-cache-paths.d.ts +2 -0
- package/dist/cli/install-codex/codex-cache.d.ts +32 -0
- package/dist/cli/install-codex/codex-cleanup-config.d.ts +6 -0
- package/dist/cli/install-codex/codex-cleanup.d.ts +21 -0
- package/dist/cli/install-codex/codex-config-mcp.d.ts +1 -0
- package/dist/cli/install-codex/codex-config-permissions.d.ts +1 -0
- package/dist/cli/install-codex/codex-config-reasoning.d.ts +1 -0
- package/dist/cli/install-codex/codex-config-toml.d.ts +12 -0
- package/dist/cli/install-codex/codex-hook-trust.d.ts +6 -0
- package/dist/cli/install-codex/codex-installation-detection.d.ts +36 -0
- package/dist/cli/install-codex/codex-marketplace-snapshot.d.ts +15 -0
- package/dist/cli/install-codex/codex-marketplace.d.ts +9 -0
- package/dist/cli/install-codex/codex-multi-agent-v2-config.d.ts +1 -0
- package/dist/cli/install-codex/codex-package-layout.d.ts +1 -0
- package/dist/cli/install-codex/codex-process.d.ts +2 -0
- package/dist/cli/install-codex/codex-project-local-cleanup-best-effort.d.ts +7 -0
- package/dist/cli/install-codex/codex-project-local-cleanup.d.ts +35 -0
- package/dist/cli/install-codex/git-bash.d.ts +35 -0
- package/dist/cli/install-codex/index.d.ts +11 -0
- package/dist/cli/install-codex/install-codex.d.ts +17 -0
- package/dist/cli/install-codex/link-cached-plugin-agents.d.ts +12 -0
- package/dist/cli/install-codex/toml-section-editor.d.ts +11 -0
- package/dist/cli/install-codex/types.d.ts +76 -0
- package/dist/cli/run/event-state.d.ts +1 -0
- package/dist/cli/run/poll-for-completion.d.ts +1 -0
- package/dist/cli/run/prompt-start.d.ts +7 -0
- package/dist/cli/star-request.d.ts +11 -0
- package/dist/cli/tui-install-prompts.d.ts +3 -2
- package/dist/cli/types.d.ts +8 -0
- package/dist/config/schema/agent-names.d.ts +4 -1
- package/dist/config/schema/commands.d.ts +1 -2
- package/dist/config/schema/hooks.d.ts +0 -1
- package/dist/config/schema/oh-my-opencode-config.d.ts +5 -3
- package/dist/create-hooks.d.ts +0 -1
- package/dist/create-managers.d.ts +1 -0
- package/dist/features/background-agent/parent-wake-message-activity.d.ts +23 -0
- package/dist/features/background-agent/parent-wake-notifier.d.ts +0 -1
- package/dist/features/boulder-state/storage.d.ts +1 -1
- package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
- package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +2 -2
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/builtin-skills/skill-file-loader.d.ts +4 -0
- package/dist/features/builtin-skills/skills/debugging.d.ts +2 -0
- package/dist/features/builtin-skills/skills/index.d.ts +5 -1
- package/dist/features/builtin-skills/skills/init-deep.d.ts +2 -0
- package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +2 -0
- package/dist/features/builtin-skills/skills/security-research.d.ts +2 -0
- package/dist/features/builtin-skills/skills/security-review.d.ts +2 -0
- package/dist/features/opencode-runtime-skills/index.d.ts +2 -0
- package/dist/features/opencode-runtime-skills/runtime-skill-config.d.ts +17 -0
- package/dist/features/opencode-runtime-skills/skill-markdown.d.ts +7 -0
- package/dist/features/opencode-runtime-skills/source-server.d.ts +8 -0
- package/dist/hooks/claude-code-hooks/hook-text.d.ts +2 -0
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/session-recovery/storage/latest-assistant-message.d.ts +5 -0
- package/dist/hooks/session-recovery/storage/thinking-prepend.d.ts +3 -0
- package/dist/hooks/thinking-block-validator/hook.d.ts +0 -18
- package/dist/hooks/todo-continuation-enforcer/pending-question-detection.d.ts +4 -0
- package/dist/index.js +1949 -1913
- package/dist/oh-my-opencode.schema.json +4 -2
- package/dist/plugin/hooks/create-core-hooks.d.ts +0 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +1 -2
- package/dist/plugin/messages-transform.d.ts +8 -1
- package/dist/plugin/user-abort-interrupted-recovery-guard.d.ts +6 -0
- package/dist/plugin-handlers/config-handler.d.ts +2 -1
- package/dist/shared/external-plugin-detector.d.ts +8 -0
- package/dist/shared/prompt-async-gate/message-inspection-error.d.ts +1 -0
- package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +1 -0
- package/dist/shared/prompt-async-gate/prompt-message-state.d.ts +8 -0
- package/dist/shared/prompt-async-gate/recent-dispatches.d.ts +14 -0
- package/dist/shared/prompt-async-gate/semantic-dedupe.d.ts +7 -0
- package/dist/shared/prompt-async-gate/session-idle-dispatch.d.ts +1 -0
- package/dist/shared/prompt-async-gate/timing.d.ts +1 -0
- package/dist/shared/prompt-async-gate/types.d.ts +2 -0
- package/dist/shared/prompt-async-gate.d.ts +1 -1
- package/dist/shared/prompt-timeout-context.d.ts +2 -0
- package/dist/testing/create-plugin-module.d.ts +5 -1
- package/dist/tools/delegate-task/sync-prompt-sender.d.ts +2 -2
- package/package.json +38 -18
- package/packages/ast-grep-mcp/dist/cli.js +245 -40
- package/packages/git-bash-mcp/dist/cli.js +367 -0
- package/packages/lsp-tools-mcp/dist/cli.js +1 -1
- package/packages/omo-codex/marketplace.json +17 -0
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +35 -0
- package/packages/omo-codex/plugin/.mcp.json +25 -0
- package/packages/omo-codex/plugin/README.md +13 -0
- package/packages/omo-codex/plugin/components/comment-checker/.gitattributes +13 -0
- package/packages/omo-codex/plugin/components/comment-checker/.github/CODEOWNERS +12 -0
- package/packages/omo-codex/plugin/components/comment-checker/.github/ISSUE_TEMPLATE/bug.yml +40 -0
- package/packages/omo-codex/plugin/components/comment-checker/.github/ISSUE_TEMPLATE/feature.yml +27 -0
- package/packages/omo-codex/plugin/components/comment-checker/.github/branch-ruleset.json +45 -0
- package/packages/omo-codex/plugin/components/comment-checker/.github/dependabot.yml +16 -0
- package/packages/omo-codex/plugin/components/comment-checker/.github/pull_request_template.md +19 -0
- package/packages/omo-codex/plugin/components/comment-checker/.github/workflows/ci.yml +47 -0
- package/packages/omo-codex/plugin/components/comment-checker/.github/workflows/publish.yml +51 -0
- package/packages/omo-codex/plugin/components/comment-checker/AGENTS.md +35 -0
- package/packages/omo-codex/plugin/components/comment-checker/CHANGELOG.md +33 -0
- package/packages/omo-codex/plugin/components/comment-checker/LICENSE +21 -0
- package/packages/omo-codex/plugin/components/comment-checker/NOTICE +6 -0
- package/packages/omo-codex/plugin/components/comment-checker/README.md +87 -0
- package/packages/omo-codex/plugin/components/comment-checker/biome.json +48 -0
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +17 -0
- package/packages/omo-codex/plugin/components/comment-checker/package.json +57 -0
- package/packages/omo-codex/plugin/components/comment-checker/skills/comment-checker/SKILL.md +16 -0
- package/packages/omo-codex/plugin/components/comment-checker/src/cli.ts +12 -0
- package/packages/omo-codex/plugin/components/comment-checker/src/codex-hook.ts +205 -0
- package/packages/omo-codex/plugin/components/comment-checker/src/core.ts +361 -0
- package/packages/omo-codex/plugin/components/comment-checker/src/runner.ts +195 -0
- package/packages/omo-codex/plugin/components/comment-checker/test/codex-hook-newline.test.ts +52 -0
- package/packages/omo-codex/plugin/components/comment-checker/test/codex-hook.test.ts +368 -0
- package/packages/omo-codex/plugin/components/comment-checker/test/fixtures/post-tool-use.json +15 -0
- package/packages/omo-codex/plugin/components/comment-checker/test/package-smoke.test.ts +93 -0
- package/packages/omo-codex/plugin/components/comment-checker/test/runner.test.ts +66 -0
- package/packages/omo-codex/plugin/components/comment-checker/tsconfig.build.json +12 -0
- package/packages/omo-codex/plugin/components/comment-checker/tsconfig.json +27 -0
- package/packages/omo-codex/plugin/components/comment-checker/vitest.config.ts +9 -0
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +29 -0
- package/packages/omo-codex/plugin/components/git-bash/package.json +23 -0
- package/packages/omo-codex/plugin/components/git-bash/src/cli.ts +33 -0
- package/packages/omo-codex/plugin/components/git-bash/src/codex-hook.ts +180 -0
- package/packages/omo-codex/plugin/components/git-bash/src/index.ts +10 -0
- package/packages/omo-codex/plugin/components/git-bash/test/codex-hook.test.ts +195 -0
- package/packages/omo-codex/plugin/components/git-bash/tsconfig.build.json +13 -0
- package/packages/omo-codex/plugin/components/git-bash/tsconfig.json +25 -0
- package/packages/omo-codex/plugin/components/lsp/.gitattributes +13 -0
- package/packages/omo-codex/plugin/components/lsp/.github/CODEOWNERS +1 -0
- package/packages/omo-codex/plugin/components/lsp/.github/ISSUE_TEMPLATE/bug.yml +26 -0
- package/packages/omo-codex/plugin/components/lsp/.github/ISSUE_TEMPLATE/feature.yml +19 -0
- package/packages/omo-codex/plugin/components/lsp/.github/branch-ruleset.json +45 -0
- package/packages/omo-codex/plugin/components/lsp/.github/dependabot.yml +11 -0
- package/packages/omo-codex/plugin/components/lsp/.github/pull_request_template.md +11 -0
- package/packages/omo-codex/plugin/components/lsp/.github/workflows/ci.yml +56 -0
- package/packages/omo-codex/plugin/components/lsp/.github/workflows/publish.yml +60 -0
- package/packages/omo-codex/plugin/components/lsp/.mcp.json +9 -0
- package/packages/omo-codex/plugin/components/lsp/AGENTS.md +25 -0
- package/packages/omo-codex/plugin/components/lsp/CHANGELOG.md +25 -0
- package/packages/omo-codex/plugin/components/lsp/LICENSE +21 -0
- package/packages/omo-codex/plugin/components/lsp/NOTICE +3 -0
- package/packages/omo-codex/plugin/components/lsp/README.md +148 -0
- package/packages/omo-codex/plugin/components/lsp/biome.json +48 -0
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +17 -0
- package/packages/omo-codex/plugin/components/lsp/package.json +64 -0
- package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-tools.mjs +46 -0
- package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-tools.test.mjs +104 -0
- package/packages/omo-codex/plugin/components/lsp/scripts/clean-dist.mjs +5 -0
- package/packages/omo-codex/plugin/components/lsp/scripts/test.mjs +8 -0
- package/packages/omo-codex/plugin/components/lsp/skills/lsp/SKILL.md +35 -0
- package/packages/omo-codex/plugin/components/lsp/src/cli.ts +44 -0
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +33 -0
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +277 -0
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-cli.test.ts +28 -0
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-errors.test.ts +55 -0
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook.test.ts +358 -0
- package/packages/omo-codex/plugin/components/lsp/test/fixtures/broken.py +1 -0
- package/packages/omo-codex/plugin/components/lsp/test/fixtures/post-tool-use.json +15 -0
- package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +155 -0
- package/packages/omo-codex/plugin/components/lsp/tsconfig.build.json +12 -0
- package/packages/omo-codex/plugin/components/lsp/tsconfig.json +27 -0
- package/packages/omo-codex/plugin/components/lsp/vitest.config.ts +9 -0
- package/packages/omo-codex/plugin/components/rules/.codex-plugin/plugin.json +3 -0
- package/packages/omo-codex/plugin/components/rules/.gitattributes +13 -0
- package/packages/omo-codex/plugin/components/rules/.github/CODEOWNERS +12 -0
- package/packages/omo-codex/plugin/components/rules/.github/ISSUE_TEMPLATE/bug.yml +49 -0
- package/packages/omo-codex/plugin/components/rules/.github/ISSUE_TEMPLATE/feature.yml +27 -0
- package/packages/omo-codex/plugin/components/rules/.github/branch-ruleset.json +45 -0
- package/packages/omo-codex/plugin/components/rules/.github/dependabot.yml +16 -0
- package/packages/omo-codex/plugin/components/rules/.github/pull_request_template.md +20 -0
- package/packages/omo-codex/plugin/components/rules/.github/workflows/ci.yml +47 -0
- package/packages/omo-codex/plugin/components/rules/.github/workflows/publish.yml +51 -0
- package/packages/omo-codex/plugin/components/rules/AGENTS.md +34 -0
- package/packages/omo-codex/plugin/components/rules/CHANGELOG.md +19 -0
- package/packages/omo-codex/plugin/components/rules/LICENSE +21 -0
- package/packages/omo-codex/plugin/components/rules/NOTICE +15 -0
- package/packages/omo-codex/plugin/components/rules/README.md +124 -0
- package/packages/omo-codex/plugin/components/rules/biome.json +48 -0
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +209 -0
- package/packages/omo-codex/plugin/components/rules/bundled-rules/windows-git-bash.md +10 -0
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +54 -0
- package/packages/omo-codex/plugin/components/rules/package.json +62 -0
- package/packages/omo-codex/plugin/components/rules/scripts/bench-codex-rules.mjs +268 -0
- package/packages/omo-codex/plugin/components/rules/skills/rules/SKILL.md +34 -0
- package/packages/omo-codex/plugin/components/rules/src/cli.ts +143 -0
- package/packages/omo-codex/plugin/components/rules/src/codex-hook-options.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/src/codex-hook.ts +238 -0
- package/packages/omo-codex/plugin/components/rules/src/config.ts +107 -0
- package/packages/omo-codex/plugin/components/rules/src/context-pressure.ts +26 -0
- package/packages/omo-codex/plugin/components/rules/src/debug-log.ts +65 -0
- package/packages/omo-codex/plugin/components/rules/src/dynamic-target-fingerprints.ts +98 -0
- package/packages/omo-codex/plugin/components/rules/src/hook-output.ts +19 -0
- package/packages/omo-codex/plugin/components/rules/src/path-utils.ts +29 -0
- package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +234 -0
- package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +104 -0
- package/packages/omo-codex/plugin/components/rules/src/post-compact-claim.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/src/post-compact-state.ts +45 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/cache.ts +64 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/constants.ts +115 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/engine.ts +535 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/errors.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/finder-cache.ts +73 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/finder-paths.ts +47 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/finder-sources.ts +50 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/finder.ts +207 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/formatter.ts +123 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/matcher.ts +142 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/ordering.ts +33 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/parser.ts +326 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/plugin-root.ts +55 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/project-root.ts +30 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/scanner.ts +162 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/truncator.ts +67 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/types.ts +141 -0
- package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +24 -0
- package/packages/omo-codex/plugin/components/rules/src/session-state-lock.ts +47 -0
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +56 -0
- package/packages/omo-codex/plugin/components/rules/src/tool-paths.ts +192 -0
- package/packages/omo-codex/plugin/components/rules/src/transcript-rule-filter.ts +44 -0
- package/packages/omo-codex/plugin/components/rules/src/transcript-search.ts +108 -0
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +107 -0
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +268 -0
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-context-pressure.test.ts +243 -0
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-performance.test.ts +99 -0
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +132 -0
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +156 -0
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +299 -0
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-lock.test.ts +46 -0
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-process.test.ts +83 -0
- package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +667 -0
- package/packages/omo-codex/plugin/components/rules/test/engine.test.ts +192 -0
- package/packages/omo-codex/plugin/components/rules/test/finder.test.ts +102 -0
- package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +168 -0
- package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +42 -0
- package/packages/omo-codex/plugin/components/rules/test/matcher.test.ts +206 -0
- package/packages/omo-codex/plugin/components/rules/test/package-smoke.test.ts +153 -0
- package/packages/omo-codex/plugin/components/rules/test/persistent-cache.test.ts +63 -0
- package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +172 -0
- package/packages/omo-codex/plugin/components/rules/test/post-compact-test-fixture.ts +196 -0
- package/packages/omo-codex/plugin/components/rules/test/scanner.test.ts +63 -0
- package/packages/omo-codex/plugin/components/rules/test/tool-paths.test.ts +198 -0
- package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +97 -0
- package/packages/omo-codex/plugin/components/rules/tsconfig.build.json +12 -0
- package/packages/omo-codex/plugin/components/rules/tsconfig.json +27 -0
- package/packages/omo-codex/plugin/components/rules/vitest.config.ts +8 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/.gitattributes +13 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/AGENTS.md +43 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/CHANGELOG.md +5 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/LICENSE +21 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/NOTICE +5 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/README.md +55 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/biome.json +48 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +52 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +28 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +53 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/src/boulder-reader.ts +167 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/src/cli.ts +52 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/src/codex-hook.ts +66 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/src/directive.ts +6 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/src/index.ts +5 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/src/types.ts +23 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/boulder-reader.test.ts +63 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/cli.test.ts +124 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +182 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/fixtures/boulder-completed.json +19 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/fixtures/boulder-mixed-platforms.json +27 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/fixtures/boulder-single-codex-work.json +19 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/fixtures/plan-all-done.md +5 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/fixtures/plan-with-nested-checkboxes.md +11 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/fixtures/plan-with-unchecked.md +6 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/tsconfig.build.json +12 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/tsconfig.json +27 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/vitest.config.ts +10 -0
- package/packages/omo-codex/plugin/components/telemetry/AGENTS.md +37 -0
- package/packages/omo-codex/plugin/components/telemetry/README.md +102 -0
- package/packages/omo-codex/plugin/components/telemetry/biome.json +48 -0
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +16 -0
- package/packages/omo-codex/plugin/components/telemetry/package.json +56 -0
- package/packages/omo-codex/plugin/components/telemetry/src/atomic-write.ts +22 -0
- package/packages/omo-codex/plugin/components/telemetry/src/cli.ts +69 -0
- package/packages/omo-codex/plugin/components/telemetry/src/codex-hook.ts +49 -0
- package/packages/omo-codex/plugin/components/telemetry/src/data-path.ts +45 -0
- package/packages/omo-codex/plugin/components/telemetry/src/env-flags.ts +43 -0
- package/packages/omo-codex/plugin/components/telemetry/src/posthog-activity-state.ts +81 -0
- package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +165 -0
- package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +35 -0
- package/packages/omo-codex/plugin/components/telemetry/test/codex-hook.test.ts +270 -0
- package/packages/omo-codex/plugin/components/telemetry/tsconfig.build.json +12 -0
- package/packages/omo-codex/plugin/components/telemetry/tsconfig.json +27 -0
- package/packages/omo-codex/plugin/components/telemetry/vitest.config.ts +8 -0
- package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +41 -0
- package/packages/omo-codex/plugin/components/ultrawork/CHANGELOG.md +25 -0
- package/packages/omo-codex/plugin/components/ultrawork/LICENSE +21 -0
- package/packages/omo-codex/plugin/components/ultrawork/NOTICE +5 -0
- package/packages/omo-codex/plugin/components/ultrawork/README.md +60 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/codex-ultrawork-reviewer.toml +18 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +82 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +222 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/metis.toml +65 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/momus.toml +69 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +164 -0
- package/packages/omo-codex/plugin/components/ultrawork/biome.json +48 -0
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +290 -0
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +16 -0
- package/packages/omo-codex/plugin/components/ultrawork/package.json +54 -0
- package/packages/omo-codex/plugin/components/ultrawork/src/cli.ts +50 -0
- package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +84 -0
- package/packages/omo-codex/plugin/components/ultrawork/src/directive.ts +3 -0
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +275 -0
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +103 -0
- package/packages/omo-codex/plugin/components/ultrawork/tsconfig.build.json +12 -0
- package/packages/omo-codex/plugin/components/ultrawork/tsconfig.json +27 -0
- package/packages/omo-codex/plugin/components/ulw-loop/.gitattributes +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +48 -0
- package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +7 -0
- package/packages/omo-codex/plugin/components/ulw-loop/LICENSE +21 -0
- package/packages/omo-codex/plugin/components/ulw-loop/NOTICE +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +74 -0
- package/packages/omo-codex/plugin/components/ulw-loop/biome.json +48 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +29 -0
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +55 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/.gitkeep +0 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +44 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/agents/openai.yaml +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +230 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/.gitkeep +0 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +155 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-arg-parser.ts +95 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +156 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +63 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +94 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +40 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +129 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-snapshot.ts +139 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +177 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/evidence.ts +122 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/goal-status.ts +88 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/paths.ts +73 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +113 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +124 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +102 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/review-blockers.ts +81 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +270 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/types.ts +277 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint.test.ts +213 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-commands.test.ts +375 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-helpers.test.ts +250 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering.test.ts +407 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +169 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-snapshot.test.ts +156 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +275 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/evidence-criteria-gate.test.ts +100 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/evidence.test.ts +263 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/.gitkeep +0 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/codex-goal-snapshot.json +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/sample-brief.md +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/sample-plan.json +108 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/sample-quality-gate.json +18 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/steering-proposal.json +8 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/user-prompt-submit.json +10 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/goal-status.test.ts +327 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +261 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/paths.test.ts +62 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-crud.test.ts +256 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io.test.ts +239 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +203 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/review-blockers.test.ts +180 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +353 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/types.test.ts +79 -0
- package/packages/omo-codex/plugin/components/ulw-loop/tsconfig.build.json +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/tsconfig.json +27 -0
- package/packages/omo-codex/plugin/components/ulw-loop/vitest.config.ts +10 -0
- package/packages/omo-codex/plugin/hooks/hooks.json +160 -0
- package/packages/omo-codex/plugin/package-lock.json +1769 -0
- package/packages/omo-codex/plugin/package.json +28 -0
- package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +65 -0
- package/packages/omo-codex/plugin/scripts/build-components.mjs +24 -0
- package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +46 -0
- package/packages/omo-codex/plugin/scripts/sync-hook-status-messages.mjs +87 -0
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +75 -0
- package/packages/omo-codex/plugin/skills/comment-checker/SKILL.md +16 -0
- package/packages/omo-codex/plugin/skills/debugging/SKILL.md +116 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/00-setup.md +108 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/02-investigate.md +130 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/04-oracle-triple.md +136 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/05-escalate.md +69 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/06-fix.md +116 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/08-qa.md +94 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/09-cleanup.md +164 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/partial-runtime-evidence.md +229 -0
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/bundled-js-binary.md +415 -0
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/go.md +252 -0
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/native-binary.md +484 -0
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/node.md +260 -0
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/python.md +248 -0
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/rust.md +234 -0
- package/packages/omo-codex/plugin/skills/debugging/references/tools/ghidra.md +212 -0
- package/packages/omo-codex/plugin/skills/debugging/references/tools/playwright-cli.md +194 -0
- package/packages/omo-codex/plugin/skills/debugging/references/tools/pwndbg.md +263 -0
- package/packages/omo-codex/plugin/skills/debugging/references/tools/pwntools.md +265 -0
- package/packages/omo-codex/plugin/skills/frontend-ui-ux/SKILL.md +77 -0
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +325 -0
- package/packages/omo-codex/plugin/skills/lsp/SKILL.md +35 -0
- package/packages/omo-codex/plugin/skills/programming/SKILL.md +463 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/README.md +90 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/backend-stack.md +641 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/bootstrap.md +328 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/bubbletea-v2.md +360 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/cobra-stack.md +468 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/concurrency.md +362 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/data-modeling.md +329 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/error-handling.md +359 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/golangci-strict.md +236 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/grpc-connect.md +375 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/libraries.md +337 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/one-liners.md +202 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/sqlc-pgx.md +471 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/testing.md +467 -0
- package/packages/omo-codex/plugin/skills/programming/references/go/type-patterns.md +298 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/README.md +314 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/async-anyio.md +442 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/data-modeling.md +233 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/data-processing.md +133 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/error-handling.md +218 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/fastapi-stack.md +316 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/httpx2-optimization.md +360 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/libraries.md +307 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/one-liners.md +268 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/orjson-stack.md +378 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/pydantic-ai.md +285 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/pyproject-strict.md +232 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/textual-tui.md +201 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/type-patterns.md +176 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/README.md +317 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/async-tokio.md +299 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/axum-stack.md +467 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/cargo-strict.md +317 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/clap-stack.md +409 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/concurrency.md +375 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/libraries.md +439 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/one-liners.md +291 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/proptest-insta.md +429 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/type-state.md +354 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/unsafe-discipline.md +250 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/zero-cost-safety.md +527 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust-ub/README.md +289 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust-ub/miri-sanitizers-loom.md +411 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust-ub/ub-taxonomy.md +269 -0
- package/packages/omo-codex/plugin/skills/programming/references/typescript/README.md +195 -0
- package/packages/omo-codex/plugin/skills/programming/references/typescript/backend-hono.md +672 -0
- package/packages/omo-codex/plugin/skills/programming/references/typescript/bootstrap.md +199 -0
- package/packages/omo-codex/plugin/skills/programming/references/typescript/data-modeling.md +202 -0
- package/packages/omo-codex/plugin/skills/programming/references/typescript/error-handling.md +169 -0
- package/packages/omo-codex/plugin/skills/programming/references/typescript/tsconfig-strict.md +152 -0
- package/packages/omo-codex/plugin/skills/programming/references/typescript/type-patterns.md +196 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/check-no-excuse-rules.sh +173 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/new-project.py +138 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/templates/.editorconfig +13 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/templates/.golangci.yml +95 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/templates/AGENTS.md.tmpl +24 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/templates/README.md.tmpl +12 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/templates/Taskfile.yml +40 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/templates/ci.yml +37 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/templates/config.go +24 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/templates/gitignore +15 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/templates/main.go.tmpl +22 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/go/templates/run.go +15 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/python/check-no-excuse-rules.py +687 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/python/new-project.py +172 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/python/new-script.py +116 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/rust/check-no-excuse-rules.py +296 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/rust/check-no-excuse-rules.sh +158 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/rust/new-project.py +175 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/check-no-excuse-rules.ts +282 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/new-project.ts +177 -0
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +779 -0
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +333 -0
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +574 -0
- package/packages/omo-codex/plugin/skills/rules/SKILL.md +34 -0
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +149 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/.gitkeep +0 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +44 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/agents/openai.yaml +6 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +230 -0
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +399 -0
- package/packages/omo-codex/plugin/test/aggregate.test.mjs +345 -0
- package/packages/omo-codex/plugin/test/component-bin-names.test.mjs +66 -0
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +195 -0
- package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +34 -0
- package/packages/omo-codex/plugin/test/mcp-research-servers.test.mjs +21 -0
- package/packages/omo-codex/plugin/test/node-install-surface.test.mjs +48 -0
- package/packages/omo-codex/plugin/test/subagent-guidance.test.mjs +76 -0
- package/packages/omo-codex/plugin/test/sync-hook-status-messages.test.mjs +66 -0
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +229 -0
- package/packages/omo-codex/scripts/install/agents.mjs +84 -0
- package/packages/omo-codex/scripts/install/cache.mjs +247 -0
- package/packages/omo-codex/scripts/install/cli-args.mjs +112 -0
- package/packages/omo-codex/scripts/install/command-shim.mjs +1 -0
- package/packages/omo-codex/scripts/install/config.mjs +264 -0
- package/packages/omo-codex/scripts/install/delegated-command.mjs +25 -0
- package/packages/omo-codex/scripts/install/git-bash.mjs +99 -0
- package/packages/omo-codex/scripts/install/git-bash.test.mjs +174 -0
- package/packages/omo-codex/scripts/install/hook-trust.mjs +84 -0
- package/packages/omo-codex/scripts/install/legacy-bins.mjs +57 -0
- package/packages/omo-codex/scripts/install/marketplace.mjs +104 -0
- package/packages/omo-codex/scripts/install/mcp-runtime-cache.mjs +81 -0
- package/packages/omo-codex/scripts/install/multi-agent-v2-config.mjs +38 -0
- package/packages/omo-codex/scripts/install/permissions.d.mts +1 -0
- package/packages/omo-codex/scripts/install/permissions.mjs +26 -0
- package/packages/omo-codex/scripts/install/process.mjs +19 -0
- package/packages/omo-codex/scripts/install/project-local-cleanup.mjs +229 -0
- package/packages/omo-codex/scripts/install/reasoning-config.mjs +14 -0
- package/packages/omo-codex/scripts/install/snapshot.mjs +54 -0
- package/packages/omo-codex/scripts/install/source-package-build.mjs +20 -0
- package/packages/omo-codex/scripts/install/toml-editor.mjs +64 -0
- package/packages/omo-codex/scripts/install/utils.mjs +15 -0
- package/packages/omo-codex/scripts/install-agent-links.test.mjs +104 -0
- package/packages/omo-codex/scripts/install-bin-links.test.mjs +123 -0
- package/packages/omo-codex/scripts/install-cache-copy.test.mjs +30 -0
- package/packages/omo-codex/scripts/install-cli-args.test.mjs +146 -0
- package/packages/omo-codex/scripts/install-config-autonomous.test.mjs +48 -0
- package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +62 -0
- package/packages/omo-codex/scripts/install-config.test.mjs +324 -0
- package/packages/omo-codex/scripts/install-local-entrypoint.test.mjs +129 -0
- package/packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs +145 -0
- package/packages/omo-codex/scripts/install-local.mjs +275 -0
- package/packages/omo-codex/scripts/install-local.test.mjs +394 -0
- package/packages/omo-codex/scripts/install-mcp-runtime.test.mjs +233 -0
- package/packages/omo-codex/scripts/install-packaged-local.test.mjs +67 -0
- package/packages/omo-codex/scripts/install-project-local-cleanup.test.mjs +277 -0
- package/packages/omo-codex/scripts/install-test-fixtures.mjs +58 -0
- package/packages/omo-codex/scripts/sync-telemetry-component.mjs +115 -0
- package/packages/omo-codex/scripts/sync-telemetry-component.test.mjs +94 -0
- package/packages/shared-skills/index.mjs +5 -0
- package/packages/shared-skills/package.json +14 -0
- package/packages/shared-skills/skills/debugging/SKILL.md +116 -0
- package/packages/shared-skills/skills/debugging/references/methodology/00-setup.md +108 -0
- package/packages/shared-skills/skills/debugging/references/methodology/02-investigate.md +130 -0
- package/packages/shared-skills/skills/debugging/references/methodology/04-oracle-triple.md +136 -0
- package/packages/shared-skills/skills/debugging/references/methodology/05-escalate.md +69 -0
- package/packages/shared-skills/skills/debugging/references/methodology/06-fix.md +116 -0
- package/packages/shared-skills/skills/debugging/references/methodology/08-qa.md +94 -0
- package/packages/shared-skills/skills/debugging/references/methodology/09-cleanup.md +164 -0
- package/packages/shared-skills/skills/debugging/references/methodology/partial-runtime-evidence.md +229 -0
- package/packages/shared-skills/skills/debugging/references/runtimes/bundled-js-binary.md +415 -0
- package/packages/shared-skills/skills/debugging/references/runtimes/go.md +252 -0
- package/packages/shared-skills/skills/debugging/references/runtimes/native-binary.md +484 -0
- package/packages/shared-skills/skills/debugging/references/runtimes/node.md +260 -0
- package/packages/shared-skills/skills/debugging/references/runtimes/python.md +248 -0
- package/packages/shared-skills/skills/debugging/references/runtimes/rust.md +234 -0
- package/packages/shared-skills/skills/debugging/references/tools/ghidra.md +212 -0
- package/packages/shared-skills/skills/debugging/references/tools/playwright-cli.md +194 -0
- package/packages/shared-skills/skills/debugging/references/tools/pwndbg.md +263 -0
- package/packages/shared-skills/skills/debugging/references/tools/pwntools.md +265 -0
- package/packages/shared-skills/skills/frontend-ui-ux/SKILL.md +77 -0
- package/packages/shared-skills/skills/init-deep/SKILL.md +309 -0
- package/packages/shared-skills/skills/programming/SKILL.md +463 -0
- package/packages/shared-skills/skills/programming/references/go/README.md +90 -0
- package/packages/shared-skills/skills/programming/references/go/backend-stack.md +641 -0
- package/packages/shared-skills/skills/programming/references/go/bootstrap.md +328 -0
- package/packages/shared-skills/skills/programming/references/go/bubbletea-v2.md +360 -0
- package/packages/shared-skills/skills/programming/references/go/cobra-stack.md +468 -0
- package/packages/shared-skills/skills/programming/references/go/concurrency.md +362 -0
- package/packages/shared-skills/skills/programming/references/go/data-modeling.md +329 -0
- package/packages/shared-skills/skills/programming/references/go/error-handling.md +359 -0
- package/packages/shared-skills/skills/programming/references/go/golangci-strict.md +236 -0
- package/packages/shared-skills/skills/programming/references/go/grpc-connect.md +375 -0
- package/packages/shared-skills/skills/programming/references/go/libraries.md +337 -0
- package/packages/shared-skills/skills/programming/references/go/one-liners.md +202 -0
- package/packages/shared-skills/skills/programming/references/go/sqlc-pgx.md +471 -0
- package/packages/shared-skills/skills/programming/references/go/testing.md +467 -0
- package/packages/shared-skills/skills/programming/references/go/type-patterns.md +298 -0
- package/packages/shared-skills/skills/programming/references/python/README.md +314 -0
- package/packages/shared-skills/skills/programming/references/python/async-anyio.md +442 -0
- package/packages/shared-skills/skills/programming/references/python/data-modeling.md +233 -0
- package/packages/shared-skills/skills/programming/references/python/data-processing.md +133 -0
- package/packages/shared-skills/skills/programming/references/python/error-handling.md +218 -0
- package/packages/shared-skills/skills/programming/references/python/fastapi-stack.md +316 -0
- package/packages/shared-skills/skills/programming/references/python/httpx2-optimization.md +360 -0
- package/packages/shared-skills/skills/programming/references/python/libraries.md +307 -0
- package/packages/shared-skills/skills/programming/references/python/one-liners.md +268 -0
- package/packages/shared-skills/skills/programming/references/python/orjson-stack.md +378 -0
- package/packages/shared-skills/skills/programming/references/python/pydantic-ai.md +285 -0
- package/packages/shared-skills/skills/programming/references/python/pyproject-strict.md +232 -0
- package/packages/shared-skills/skills/programming/references/python/textual-tui.md +201 -0
- package/packages/shared-skills/skills/programming/references/python/type-patterns.md +176 -0
- package/packages/shared-skills/skills/programming/references/rust/README.md +317 -0
- package/packages/shared-skills/skills/programming/references/rust/async-tokio.md +299 -0
- package/packages/shared-skills/skills/programming/references/rust/axum-stack.md +467 -0
- package/packages/shared-skills/skills/programming/references/rust/cargo-strict.md +317 -0
- package/packages/shared-skills/skills/programming/references/rust/clap-stack.md +409 -0
- package/packages/shared-skills/skills/programming/references/rust/concurrency.md +375 -0
- package/packages/shared-skills/skills/programming/references/rust/libraries.md +439 -0
- package/packages/shared-skills/skills/programming/references/rust/one-liners.md +291 -0
- package/packages/shared-skills/skills/programming/references/rust/proptest-insta.md +429 -0
- package/packages/shared-skills/skills/programming/references/rust/type-state.md +354 -0
- package/packages/shared-skills/skills/programming/references/rust/unsafe-discipline.md +250 -0
- package/packages/shared-skills/skills/programming/references/rust/zero-cost-safety.md +527 -0
- package/packages/shared-skills/skills/programming/references/rust-ub/README.md +289 -0
- package/packages/shared-skills/skills/programming/references/rust-ub/miri-sanitizers-loom.md +411 -0
- package/packages/shared-skills/skills/programming/references/rust-ub/ub-taxonomy.md +269 -0
- package/packages/shared-skills/skills/programming/references/typescript/README.md +195 -0
- package/packages/shared-skills/skills/programming/references/typescript/backend-hono.md +672 -0
- package/packages/shared-skills/skills/programming/references/typescript/bootstrap.md +199 -0
- package/packages/shared-skills/skills/programming/references/typescript/data-modeling.md +202 -0
- package/packages/shared-skills/skills/programming/references/typescript/error-handling.md +169 -0
- package/packages/shared-skills/skills/programming/references/typescript/tsconfig-strict.md +152 -0
- package/packages/shared-skills/skills/programming/references/typescript/type-patterns.md +196 -0
- package/packages/shared-skills/skills/programming/scripts/go/check-no-excuse-rules.sh +173 -0
- package/packages/shared-skills/skills/programming/scripts/go/new-project.py +138 -0
- package/packages/shared-skills/skills/programming/scripts/go/templates/.editorconfig +13 -0
- package/packages/shared-skills/skills/programming/scripts/go/templates/.golangci.yml +95 -0
- package/packages/shared-skills/skills/programming/scripts/go/templates/AGENTS.md.tmpl +24 -0
- package/packages/shared-skills/skills/programming/scripts/go/templates/README.md.tmpl +12 -0
- package/packages/shared-skills/skills/programming/scripts/go/templates/Taskfile.yml +40 -0
- package/packages/shared-skills/skills/programming/scripts/go/templates/ci.yml +37 -0
- package/packages/shared-skills/skills/programming/scripts/go/templates/config.go +24 -0
- package/packages/shared-skills/skills/programming/scripts/go/templates/gitignore +15 -0
- package/packages/shared-skills/skills/programming/scripts/go/templates/main.go.tmpl +22 -0
- package/packages/shared-skills/skills/programming/scripts/go/templates/run.go +15 -0
- package/packages/shared-skills/skills/programming/scripts/python/check-no-excuse-rules.py +687 -0
- package/packages/shared-skills/skills/programming/scripts/python/new-project.py +172 -0
- package/packages/shared-skills/skills/programming/scripts/python/new-script.py +116 -0
- package/packages/shared-skills/skills/programming/scripts/rust/check-no-excuse-rules.py +296 -0
- package/packages/shared-skills/skills/programming/scripts/rust/check-no-excuse-rules.sh +158 -0
- package/packages/shared-skills/skills/programming/scripts/rust/new-project.py +175 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.ts +282 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/new-project.ts +177 -0
- package/packages/shared-skills/skills/refactor/SKILL.md +763 -0
- package/packages/shared-skills/skills/remove-ai-slops/SKILL.md +317 -0
- package/packages/shared-skills/skills/review-work/SKILL.md +574 -0
- package/packages/shared-skills/skills/start-work/SKILL.md +149 -0
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +383 -0
- package/postinstall.mjs +6 -2
- package/dist/features/builtin-commands/templates/init-deep.d.ts +0 -1
- package/dist/features/builtin-skills/skills/ai-slop-remover.d.ts +0 -2
- package/dist/hooks/context-window-monitor.d.ts +0 -19
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
type CodexPostToolUseInput,
|
|
10
|
+
extractCodexCommentCheckRequests,
|
|
11
|
+
runCommentCheckerPostToolUse,
|
|
12
|
+
} from "../src/codex-hook.ts";
|
|
13
|
+
|
|
14
|
+
type CliResult = {
|
|
15
|
+
exitCode: number | null;
|
|
16
|
+
stdout: string;
|
|
17
|
+
stderr: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const CLI_PATH = fileURLToPath(new URL("../dist/cli.js", import.meta.url));
|
|
21
|
+
const tempDirs: string[] = [];
|
|
22
|
+
|
|
23
|
+
afterEach(() => {
|
|
24
|
+
for (const tempDir of tempDirs.splice(0)) {
|
|
25
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
function runHookCli(input: string): Promise<CliResult> {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
const child = spawn(process.execPath, [CLI_PATH, "hook", "post-tool-use"], {
|
|
32
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
33
|
+
});
|
|
34
|
+
let stdout = "";
|
|
35
|
+
let stderr = "";
|
|
36
|
+
child.stdout.setEncoding("utf8");
|
|
37
|
+
child.stderr.setEncoding("utf8");
|
|
38
|
+
child.stdout.on("data", (chunk: string) => {
|
|
39
|
+
stdout += chunk;
|
|
40
|
+
});
|
|
41
|
+
child.stderr.on("data", (chunk: string) => {
|
|
42
|
+
stderr += chunk;
|
|
43
|
+
});
|
|
44
|
+
child.once("error", reject);
|
|
45
|
+
child.once("close", (exitCode) => {
|
|
46
|
+
resolve({ exitCode, stdout, stderr });
|
|
47
|
+
});
|
|
48
|
+
child.stdin.end(input);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function postToolUseInput(overrides: Partial<CodexPostToolUseInput> = {}): CodexPostToolUseInput {
|
|
53
|
+
return {
|
|
54
|
+
session_id: "thread-1",
|
|
55
|
+
turn_id: "turn-1",
|
|
56
|
+
transcript_path: null,
|
|
57
|
+
cwd: "/repo",
|
|
58
|
+
hook_event_name: "PostToolUse",
|
|
59
|
+
model: "gpt-5.5",
|
|
60
|
+
permission_mode: "never",
|
|
61
|
+
tool_name: "apply_patch",
|
|
62
|
+
tool_input: {
|
|
63
|
+
command: [
|
|
64
|
+
"*** Begin Patch",
|
|
65
|
+
"*** Update File: src/example.ts",
|
|
66
|
+
"@@",
|
|
67
|
+
"-const value = 1;",
|
|
68
|
+
"+// explains value",
|
|
69
|
+
"+const value = 2;",
|
|
70
|
+
"*** End Patch",
|
|
71
|
+
].join("\n"),
|
|
72
|
+
},
|
|
73
|
+
tool_response: "Success. Updated files.",
|
|
74
|
+
tool_use_id: "call-1",
|
|
75
|
+
...overrides,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
describe("extractCodexCommentCheckRequests", () => {
|
|
80
|
+
it("#given codex apply_patch command #when extracting #then returns edit request for changed file", () => {
|
|
81
|
+
const requests = extractCodexCommentCheckRequests(postToolUseInput());
|
|
82
|
+
|
|
83
|
+
expect(requests).toEqual([
|
|
84
|
+
{
|
|
85
|
+
sourceToolName: "apply_patch",
|
|
86
|
+
toolName: "Edit",
|
|
87
|
+
filePath: "src/example.ts",
|
|
88
|
+
toolInput: {
|
|
89
|
+
file_path: "src/example.ts",
|
|
90
|
+
old_string: "const value = 1;\n",
|
|
91
|
+
new_string: "// explains value\nconst value = 2;\n",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
]);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("#given unsupported post tool event #when extracting #then returns no requests", () => {
|
|
98
|
+
const requests = extractCodexCommentCheckRequests(
|
|
99
|
+
postToolUseInput({
|
|
100
|
+
tool_name: "read",
|
|
101
|
+
tool_input: { file_path: "src/example.ts", content: "// hi\nconst value = 1;\n" },
|
|
102
|
+
}),
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
expect(requests).toEqual([]);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("#given codex write payload #when extracting #then returns write request", () => {
|
|
109
|
+
const requests = extractCodexCommentCheckRequests(
|
|
110
|
+
postToolUseInput({
|
|
111
|
+
tool_name: "write",
|
|
112
|
+
tool_input: {
|
|
113
|
+
file_path: "src/example.ts",
|
|
114
|
+
content: "// explains value\nconst value = 1;\n",
|
|
115
|
+
},
|
|
116
|
+
}),
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
expect(requests).toEqual([
|
|
120
|
+
{
|
|
121
|
+
sourceToolName: "write",
|
|
122
|
+
toolName: "Write",
|
|
123
|
+
filePath: "src/example.ts",
|
|
124
|
+
toolInput: {
|
|
125
|
+
file_path: "src/example.ts",
|
|
126
|
+
content: "// explains value\nconst value = 1;\n",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
]);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it("#given codex edit payload #when extracting #then returns edit request", () => {
|
|
133
|
+
const requests = extractCodexCommentCheckRequests(
|
|
134
|
+
postToolUseInput({
|
|
135
|
+
tool_name: "edit",
|
|
136
|
+
tool_input: {
|
|
137
|
+
path: "src/example.ts",
|
|
138
|
+
oldString: "const value = 1;\n",
|
|
139
|
+
newString: "// explains value\nconst value = 2;\n",
|
|
140
|
+
},
|
|
141
|
+
}),
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
expect(requests).toEqual([
|
|
145
|
+
{
|
|
146
|
+
sourceToolName: "edit",
|
|
147
|
+
toolName: "Edit",
|
|
148
|
+
filePath: "src/example.ts",
|
|
149
|
+
toolInput: {
|
|
150
|
+
file_path: "src/example.ts",
|
|
151
|
+
old_string: "const value = 1;\n",
|
|
152
|
+
new_string: "// explains value\nconst value = 2;\n",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
]);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("#given one-sided codex edit payload #when extracting #then returns no requests", () => {
|
|
159
|
+
const requests = extractCodexCommentCheckRequests(
|
|
160
|
+
postToolUseInput({
|
|
161
|
+
tool_name: "edit",
|
|
162
|
+
tool_input: {
|
|
163
|
+
path: "src/example.ts",
|
|
164
|
+
oldString: "const value = 1;\n",
|
|
165
|
+
},
|
|
166
|
+
}),
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
expect(requests).toEqual([]);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it("#given codex multi_edit payload #when extracting #then returns multiedit request", () => {
|
|
173
|
+
const requests = extractCodexCommentCheckRequests(
|
|
174
|
+
postToolUseInput({
|
|
175
|
+
tool_name: "multi_edit",
|
|
176
|
+
tool_input: {
|
|
177
|
+
filePath: "src/example.ts",
|
|
178
|
+
edits: [
|
|
179
|
+
{ old_string: "const a = 1;\n", new_string: "// explains a\nconst a = 2;\n" },
|
|
180
|
+
{ oldString: "const b = 1;\n", newString: "// explains b\nconst b = 2;\n" },
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
}),
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
expect(requests).toEqual([
|
|
187
|
+
{
|
|
188
|
+
sourceToolName: "multi_edit",
|
|
189
|
+
toolName: "MultiEdit",
|
|
190
|
+
filePath: "src/example.ts",
|
|
191
|
+
toolInput: {
|
|
192
|
+
file_path: "src/example.ts",
|
|
193
|
+
edits: [
|
|
194
|
+
{ old_string: "const a = 1;\n", new_string: "// explains a\nconst a = 2;\n" },
|
|
195
|
+
{ old_string: "const b = 1;\n", new_string: "// explains b\nconst b = 2;\n" },
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
]);
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
describe("runCommentCheckerPostToolUse", () => {
|
|
204
|
+
it("#given checker warning #when hook runs #then returns blocking feedback JSON", async () => {
|
|
205
|
+
const output = await runCommentCheckerPostToolUse(postToolUseInput(), {
|
|
206
|
+
run: async () => ({
|
|
207
|
+
status: "warning",
|
|
208
|
+
message: "comment warning: explain less",
|
|
209
|
+
}),
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
expect(JSON.parse(output)).toEqual({
|
|
213
|
+
decision: "block",
|
|
214
|
+
reason: "comment-checker found issues in src/example.ts:\ncomment warning: explain less",
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it("#given missing checker binary #when hook runs #then emits no hook output", async () => {
|
|
219
|
+
const output = await runCommentCheckerPostToolUse(postToolUseInput(), {
|
|
220
|
+
run: async () => ({
|
|
221
|
+
status: "missing",
|
|
222
|
+
message: "not installed",
|
|
223
|
+
}),
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
expect(output).toBe("");
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it("#given transcript path #when hook runs #then forwards it to checker input", async () => {
|
|
230
|
+
let transcriptPath = "";
|
|
231
|
+
|
|
232
|
+
await runCommentCheckerPostToolUse(
|
|
233
|
+
postToolUseInput({
|
|
234
|
+
transcript_path: "/tmp/codex-comment-checker-transcript.jsonl",
|
|
235
|
+
tool_name: "write",
|
|
236
|
+
tool_input: {
|
|
237
|
+
file_path: "src/example.ts",
|
|
238
|
+
content: "// explains value\nconst value = 1;\n",
|
|
239
|
+
},
|
|
240
|
+
}),
|
|
241
|
+
{
|
|
242
|
+
run: async (input) => {
|
|
243
|
+
transcriptPath = input.transcript_path;
|
|
244
|
+
return {
|
|
245
|
+
status: "pass",
|
|
246
|
+
message: "",
|
|
247
|
+
};
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
expect(transcriptPath).toBe("/tmp/codex-comment-checker-transcript.jsonl");
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it("#given null transcript path #when hook runs #then forwards empty string fallback", async () => {
|
|
256
|
+
let transcriptPath = "unset";
|
|
257
|
+
|
|
258
|
+
await runCommentCheckerPostToolUse(
|
|
259
|
+
postToolUseInput({
|
|
260
|
+
transcript_path: null,
|
|
261
|
+
tool_name: "write",
|
|
262
|
+
tool_input: {
|
|
263
|
+
file_path: "src/example.ts",
|
|
264
|
+
content: "// explains value\nconst value = 1;\n",
|
|
265
|
+
},
|
|
266
|
+
}),
|
|
267
|
+
{
|
|
268
|
+
run: async (input) => {
|
|
269
|
+
transcriptPath = input.transcript_path;
|
|
270
|
+
return {
|
|
271
|
+
status: "pass",
|
|
272
|
+
message: "",
|
|
273
|
+
};
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
expect(transcriptPath).toBe("");
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
it("#given Codex canonical context-window transcript and long checker warning #when hook blocks #then it caps feedback", async () => {
|
|
282
|
+
const root = mkdtempSync(path.join(tmpdir(), "codex-comment-checker-context-pressure-"));
|
|
283
|
+
tempDirs.push(root);
|
|
284
|
+
const transcriptPath = path.join(root, "transcript.jsonl");
|
|
285
|
+
writeFileSync(
|
|
286
|
+
transcriptPath,
|
|
287
|
+
[
|
|
288
|
+
"context_length_exceeded",
|
|
289
|
+
"Codex ran out of room in the model's context window. Start a new thread before retrying.",
|
|
290
|
+
"",
|
|
291
|
+
].join("\n"),
|
|
292
|
+
);
|
|
293
|
+
|
|
294
|
+
const output = await runCommentCheckerPostToolUse(postToolUseInput({ transcript_path: transcriptPath }), {
|
|
295
|
+
run: async () => ({
|
|
296
|
+
status: "warning",
|
|
297
|
+
message: `comment warning: explain less\n${"x".repeat(10_000)}`,
|
|
298
|
+
}),
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
const parsed: unknown = JSON.parse(output);
|
|
302
|
+
if (!isBlockingOutput(parsed)) throw new TypeError("Expected blocking output");
|
|
303
|
+
|
|
304
|
+
expect(parsed.reason.length).toBeLessThanOrEqual(1200);
|
|
305
|
+
expect(parsed.reason).toContain("comment-checker found issues in src/example.ts");
|
|
306
|
+
expect(parsed.reason).toContain("[Truncated hook output");
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
describe("runCodexHookCli", () => {
|
|
311
|
+
it("#given malformed post-tool-use stdin #when hook CLI runs #then it no-ops without stderr", async () => {
|
|
312
|
+
// given
|
|
313
|
+
const input = "break;\n";
|
|
314
|
+
|
|
315
|
+
// when
|
|
316
|
+
const result = await runHookCli(input);
|
|
317
|
+
|
|
318
|
+
// then
|
|
319
|
+
expect(result).toEqual({
|
|
320
|
+
exitCode: 0,
|
|
321
|
+
stdout: "",
|
|
322
|
+
stderr: "",
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it("#given non-object post-tool-use JSON #when hook CLI runs #then it no-ops without stderr", async () => {
|
|
327
|
+
// given
|
|
328
|
+
const input = '"break;"\n';
|
|
329
|
+
|
|
330
|
+
// when
|
|
331
|
+
const result = await runHookCli(input);
|
|
332
|
+
|
|
333
|
+
// then
|
|
334
|
+
expect(result).toEqual({
|
|
335
|
+
exitCode: 0,
|
|
336
|
+
stdout: "",
|
|
337
|
+
stderr: "",
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it("#given non-string transcript path #when hook CLI runs #then it no-ops without stderr", async () => {
|
|
342
|
+
// given
|
|
343
|
+
const input = `${JSON.stringify({ ...postToolUseInput(), transcript_path: 42 })}\n`;
|
|
344
|
+
|
|
345
|
+
// when
|
|
346
|
+
const result = await runHookCli(input);
|
|
347
|
+
|
|
348
|
+
// then
|
|
349
|
+
expect(result).toEqual({
|
|
350
|
+
exitCode: 0,
|
|
351
|
+
stdout: "",
|
|
352
|
+
stderr: "",
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
interface BlockingOutput {
|
|
358
|
+
readonly decision: "block";
|
|
359
|
+
readonly reason: string;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function isBlockingOutput(value: unknown): value is BlockingOutput {
|
|
363
|
+
return isRecord(value) && value["decision"] === "block" && typeof value["reason"] === "string";
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
367
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
368
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"session_id": "00000000-0000-0000-0000-000000000000",
|
|
3
|
+
"turn_id": "00000000-0000-0000-0000-000000000001",
|
|
4
|
+
"transcript_path": "/tmp/codex-comment-checker-transcript.jsonl",
|
|
5
|
+
"cwd": ".",
|
|
6
|
+
"hook_event_name": "PostToolUse",
|
|
7
|
+
"model": "gpt-5.5",
|
|
8
|
+
"permission_mode": "default",
|
|
9
|
+
"tool_name": "apply_patch",
|
|
10
|
+
"tool_input": {
|
|
11
|
+
"command": "*** Begin Patch\n*** Add File: src/example.ts\n+export const meaning = 42;\n*** End Patch\n"
|
|
12
|
+
},
|
|
13
|
+
"tool_response": "Success. Updated files.",
|
|
14
|
+
"tool_use_id": "toolu_000000000000000000000000"
|
|
15
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
type PackageJson = {
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly packageManager: string;
|
|
7
|
+
readonly bin: Record<string, string>;
|
|
8
|
+
readonly dependencies?: Record<string, unknown>;
|
|
9
|
+
readonly optionalDependencies: Record<string, string>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type HookCommand = {
|
|
13
|
+
readonly command: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type HookEntry = {
|
|
17
|
+
readonly hooks: readonly HookCommand[];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type HooksJson = {
|
|
21
|
+
readonly hooks: Record<string, readonly HookEntry[]>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function readPackageJson(path: string): PackageJson {
|
|
25
|
+
const parsed: unknown = JSON.parse(readFileSync(path, "utf8"));
|
|
26
|
+
if (!isPackageJson(parsed)) throw new TypeError(`Invalid package metadata: ${path}`);
|
|
27
|
+
return parsed;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function readHooksJson(path: string): HooksJson {
|
|
31
|
+
const parsed: unknown = JSON.parse(readFileSync(path, "utf8"));
|
|
32
|
+
if (!isHooksJson(parsed)) throw new TypeError(`Invalid hooks metadata: ${path}`);
|
|
33
|
+
return parsed;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
describe("plugin package metadata", () => {
|
|
37
|
+
it("#given packaged plugin files #when validating entrypoints #then hook command uses portable plugin root interpolation", () => {
|
|
38
|
+
// given
|
|
39
|
+
const packageJson = readPackageJson("package.json");
|
|
40
|
+
const hooksJson = readHooksJson("hooks/hooks.json");
|
|
41
|
+
const cliSource = readFileSync("src/cli.ts", "utf8");
|
|
42
|
+
|
|
43
|
+
// when
|
|
44
|
+
const command = hooksJson.hooks["PostToolUse"]?.[0]?.hooks[0]?.command;
|
|
45
|
+
const pluginRoot = ["$", "{PLUGIN_ROOT}"].join("");
|
|
46
|
+
|
|
47
|
+
// then
|
|
48
|
+
expect(packageJson.type).toBe("module");
|
|
49
|
+
expect(packageJson.packageManager).toBe("npm@11.12.1");
|
|
50
|
+
expect(packageJson.dependencies ?? {}).not.toHaveProperty("@code-yeongyu/comment-checker");
|
|
51
|
+
expect(packageJson.optionalDependencies).toHaveProperty("@code-yeongyu/comment-checker");
|
|
52
|
+
expect(packageJson.bin["omo-comment-checker"]).toBe("./dist/cli.js");
|
|
53
|
+
expect(cliSource.startsWith("#!/usr/bin/env node")).toBe(true);
|
|
54
|
+
expect(command).toBe(`node "${pluginRoot}/dist/cli.js" hook post-tool-use`);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
function isPackageJson(value: unknown): value is PackageJson {
|
|
59
|
+
if (!isRecord(value)) return false;
|
|
60
|
+
const dependencies = value["dependencies"];
|
|
61
|
+
return (
|
|
62
|
+
value["type"] === "module" &&
|
|
63
|
+
value["packageManager"] === "npm@11.12.1" &&
|
|
64
|
+
isStringRecord(value["bin"]) &&
|
|
65
|
+
isStringRecord(value["optionalDependencies"]) &&
|
|
66
|
+
(dependencies === undefined || isRecord(dependencies))
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function isHooksJson(value: unknown): value is HooksJson {
|
|
71
|
+
if (!isRecord(value) || !isRecord(value["hooks"])) return false;
|
|
72
|
+
return Object.values(value["hooks"]).every(isHookEntries);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function isHookEntries(value: unknown): value is readonly HookEntry[] {
|
|
76
|
+
return Array.isArray(value) && value.every(isHookEntry);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function isHookEntry(value: unknown): value is HookEntry {
|
|
80
|
+
return isRecord(value) && Array.isArray(value["hooks"]) && value["hooks"].every(isHookCommand);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function isHookCommand(value: unknown): value is HookCommand {
|
|
84
|
+
return isRecord(value) && typeof value["command"] === "string";
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function isStringRecord(value: unknown): value is Record<string, string> {
|
|
88
|
+
return isRecord(value) && Object.values(value).every((item) => typeof item === "string");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
92
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
93
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
MAX_PROCESS_OUTPUT_BYTES,
|
|
6
|
+
resolveCommentCheckerBinary,
|
|
7
|
+
runCommentChecker,
|
|
8
|
+
spawnProcess,
|
|
9
|
+
} from "../src/runner.js";
|
|
10
|
+
|
|
11
|
+
describe("spawnProcess", () => {
|
|
12
|
+
it("#given noisy checker process #when output exceeds cap #then stderr is bounded", async () => {
|
|
13
|
+
// given
|
|
14
|
+
const maxOutputBytes = 16;
|
|
15
|
+
|
|
16
|
+
// when
|
|
17
|
+
const result = await spawnProcess(
|
|
18
|
+
process.execPath,
|
|
19
|
+
["-e", "process.stderr.write('x'.repeat(40)); process.exit(2);"],
|
|
20
|
+
"",
|
|
21
|
+
maxOutputBytes,
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
// then
|
|
25
|
+
expect(MAX_PROCESS_OUTPUT_BYTES).toBeGreaterThan(maxOutputBytes);
|
|
26
|
+
expect(result.exitCode).toBe(2);
|
|
27
|
+
expect(result.stderr).toBe(`${"x".repeat(maxOutputBytes)}\n[stderr truncated after 16 bytes]`);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe("resolveCommentCheckerBinary", () => {
|
|
32
|
+
it("#given installed checker package #when resolving binary #then returns existing checker binary", () => {
|
|
33
|
+
// given / when
|
|
34
|
+
const binaryPath = resolveCommentCheckerBinary();
|
|
35
|
+
|
|
36
|
+
// then
|
|
37
|
+
expect(binaryPath).toBeDefined();
|
|
38
|
+
expect(binaryPath ?? "").toContain("comment-checker");
|
|
39
|
+
expect(existsSync(binaryPath ?? "")).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe("runCommentChecker", () => {
|
|
44
|
+
it("#given missing checker binary #when runner starts #then returns missing result", async () => {
|
|
45
|
+
// given / when
|
|
46
|
+
const result = await runCommentChecker(
|
|
47
|
+
{
|
|
48
|
+
session_id: "session-1",
|
|
49
|
+
tool_name: "Write",
|
|
50
|
+
transcript_path: "",
|
|
51
|
+
cwd: "/repo",
|
|
52
|
+
hook_event_name: "PostToolUse",
|
|
53
|
+
tool_input: {
|
|
54
|
+
file_path: "src/example.ts",
|
|
55
|
+
content: "const value = 1;\n",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
resolveBinary: () => undefined,
|
|
60
|
+
},
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// then
|
|
64
|
+
expect(result.status).toBe("missing");
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "Node16",
|
|
5
|
+
"moduleResolution": "Node16",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"strict": true,
|
|
8
|
+
"exactOptionalPropertyTypes": true,
|
|
9
|
+
"noUncheckedIndexedAccess": true,
|
|
10
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"noImplicitOverride": true,
|
|
13
|
+
"noImplicitReturns": true,
|
|
14
|
+
"noFallthroughCasesInSwitch": true,
|
|
15
|
+
"noUnusedLocals": true,
|
|
16
|
+
"noUnusedParameters": true,
|
|
17
|
+
"esModuleInterop": true,
|
|
18
|
+
"allowImportingTsExtensions": true,
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
"forceConsistentCasingInFileNames": true,
|
|
21
|
+
"resolveJsonModule": true,
|
|
22
|
+
"useDefineForClassFields": false,
|
|
23
|
+
"types": ["node"],
|
|
24
|
+
"noEmit": true
|
|
25
|
+
},
|
|
26
|
+
"include": ["src/**/*", "test/**/*"]
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"PreToolUse": [
|
|
4
|
+
{
|
|
5
|
+
"matcher": "^Bash$",
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook pre-tool-use",
|
|
10
|
+
"timeout": 5,
|
|
11
|
+
"statusMessage": "LazyCodex(0.1.0): Recommending Git Bash Mcp"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"PostCompact": [
|
|
17
|
+
{
|
|
18
|
+
"hooks": [
|
|
19
|
+
{
|
|
20
|
+
"type": "command",
|
|
21
|
+
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
|
|
22
|
+
"timeout": 5,
|
|
23
|
+
"statusMessage": "LazyCodex(0.1.0): Resetting Git Bash Mcp Reminder"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sisyphuslabs/codex-git-bash-hook",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Codex hook component that reminds Windows sessions to prefer the OMO git_bash MCP.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": true,
|
|
7
|
+
"bin": {
|
|
8
|
+
"omo-git-bash-hook": "./dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": ["dist", "hooks"],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc -p tsconfig.build.json",
|
|
13
|
+
"test": "bun test test/*.test.ts",
|
|
14
|
+
"typecheck": "tsc --noEmit"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^25.7.0",
|
|
18
|
+
"typescript": "^6.0.3"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20.0.0"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runGitBashHookCli } from "./codex-hook.js";
|
|
3
|
+
|
|
4
|
+
const TOP_LEVEL_HELP =
|
|
5
|
+
"Usage:\n omo-git-bash-hook hook pre-tool-use\n omo-git-bash-hook hook post-compact\n omo-git-bash-hook help | --help | -h\n";
|
|
6
|
+
|
|
7
|
+
async function main(): Promise<number> {
|
|
8
|
+
const argv = process.argv.slice(2);
|
|
9
|
+
const command = argv[0];
|
|
10
|
+
if (command === undefined || command === "help" || command === "--help" || command === "-h") {
|
|
11
|
+
process.stdout.write(TOP_LEVEL_HELP);
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
if (command === "hook" && argv[1] === "pre-tool-use") {
|
|
15
|
+
await runGitBashHookCli(process.stdin, process.stdout, "pre-tool-use");
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
if (command === "hook" && argv[1] === "post-compact") {
|
|
19
|
+
await runGitBashHookCli(process.stdin, process.stdout, "post-compact");
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
process.stderr.write(`[omo-git-bash-hook] unknown command: ${argv.join(" ")}\n${TOP_LEVEL_HELP}`);
|
|
23
|
+
return 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
main()
|
|
27
|
+
.then((code) => {
|
|
28
|
+
process.exit(code);
|
|
29
|
+
})
|
|
30
|
+
.catch((error: unknown) => {
|
|
31
|
+
process.stderr.write(`[omo-git-bash-hook] ${error instanceof Error ? error.message : String(error)}\n`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
});
|