oh-my-opencode 4.8.1 → 4.9.1
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/dist/agents/prometheus/system-prompt.d.ts +1 -1
- package/dist/agents/sisyphus/claude-fable-5.d.ts +19 -0
- package/dist/agents/sisyphus/claude-opus-4-7.d.ts +3 -1
- package/dist/agents/sisyphus/claude-opus-4-8.d.ts +19 -0
- package/dist/agents/sisyphus/index.d.ts +4 -0
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/doctor/checks/codex.d.ts +1 -0
- package/dist/cli/doctor/checks/dependencies.d.ts +2 -2
- package/dist/cli/doctor/checks/tools-gh.d.ts +8 -1
- package/dist/cli/doctor/index.d.ts +1 -0
- package/dist/cli/doctor/types.d.ts +2 -0
- package/dist/cli/index.js +1908 -787
- package/dist/cli/install-codex/codex-config-permissions.d.ts +1 -1
- package/dist/cli/install-codex/codex-config-plugins.d.ts +1 -0
- package/dist/cli/install-codex/codex-config-toml.d.ts +1 -0
- package/dist/cli/install-codex/codex-installer-bin-dir.d.ts +8 -0
- package/dist/cli/install-codex/install-codex.d.ts +1 -8
- package/dist/cli/install-codex/lsp-daemon-reaper.d.ts +5 -0
- package/dist/cli/sparkshell-condense.d.ts +10 -0
- package/dist/cli/sparkshell-parse.d.ts +3 -0
- package/dist/cli/sparkshell-session-context.d.ts +20 -0
- package/dist/cli/sparkshell-spark.d.ts +23 -0
- package/dist/cli/sparkshell.d.ts +8 -1
- package/dist/cli-node/index.js +92564 -0
- package/dist/config/schema/agent-names.d.ts +2 -0
- package/dist/config/schema/hooks.d.ts +0 -2
- package/dist/config/schema/keyword-detector.d.ts +0 -6
- package/dist/config/schema/oh-my-opencode-config.d.ts +2 -4
- package/dist/create-hooks.d.ts +0 -2
- package/dist/features/background-agent/parent-wake-dedupe.d.ts +2 -0
- package/dist/features/background-agent/parent-wake-flush-runner.d.ts +2 -0
- package/dist/features/background-agent/parent-wake-prompt-dispatch.d.ts +1 -0
- package/dist/features/background-agent/parent-wake-session-history.d.ts +4 -0
- package/dist/features/background-agent/parent-wake-session-inspector.d.ts +1 -0
- package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
- package/dist/features/builtin-skills/index.d.ts +1 -1
- package/dist/features/builtin-skills/skills.d.ts +4 -0
- package/dist/features/opencode-runtime-skills/source-server.d.ts +16 -1
- package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +2 -0
- package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +2 -0
- package/dist/features/team-mode/types.d.ts +1 -0
- package/dist/features/tmux-subagent/failed-readiness-cache.d.ts +28 -0
- package/dist/features/tmux-subagent/manager.d.ts +1 -9
- package/dist/features/tmux-subagent/resolve-server-url.d.ts +3 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/keyword-detector/constants.d.ts +0 -4
- package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +1 -1
- package/dist/index.js +9001 -1795
- package/dist/oh-my-opencode.schema.json +2 -4
- package/dist/plugin/chat-params.d.ts +1 -8
- package/dist/plugin/hooks/create-core-hooks.d.ts +0 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts +0 -2
- package/dist/plugin/hooks/create-transform-hooks.d.ts +1 -2
- package/dist/plugin/messages-transform.d.ts +0 -1
- package/dist/shared/model-availability.d.ts +10 -2
- package/dist/shared/module-resolution-failure.d.ts +7 -0
- package/package.json +25 -18
- package/packages/ast-grep-mcp/dist/cli.js +2 -10
- package/packages/git-bash-mcp/dist/cli.js +11 -4
- package/packages/lsp-daemon/dist/cli.d.ts +2 -0
- package/packages/lsp-daemon/dist/cli.js +3711 -0
- package/packages/lsp-daemon/dist/daemon-client.d.ts +19 -0
- package/packages/lsp-daemon/dist/daemon-client.js +114 -0
- package/packages/lsp-daemon/dist/daemon-server.d.ts +12 -0
- package/packages/lsp-daemon/dist/daemon-server.js +106 -0
- package/packages/lsp-daemon/dist/ensure-daemon.d.ts +21 -0
- package/packages/lsp-daemon/dist/ensure-daemon.js +97 -0
- package/packages/lsp-daemon/dist/index.d.ts +5 -0
- package/packages/lsp-daemon/dist/index.js +3573 -0
- package/packages/lsp-daemon/dist/lock.d.ts +7 -0
- package/packages/lsp-daemon/dist/lock.js +61 -0
- package/packages/lsp-daemon/dist/package.json +6 -0
- package/packages/lsp-daemon/dist/paths.d.ts +11 -0
- package/packages/lsp-daemon/dist/paths.js +49 -0
- package/packages/lsp-daemon/dist/proxy.d.ts +10 -0
- package/packages/lsp-daemon/dist/proxy.js +61 -0
- package/packages/lsp-daemon/dist/request-routing.d.ts +9 -0
- package/packages/lsp-daemon/dist/request-routing.js +44 -0
- package/packages/lsp-daemon/dist/run-daemon.d.ts +1 -0
- package/packages/lsp-daemon/dist/run-daemon.js +11 -0
- package/packages/lsp-daemon/dist/socket-jsonrpc.d.ts +5 -0
- package/packages/lsp-daemon/dist/socket-jsonrpc.js +25 -0
- package/packages/lsp-daemon/package.json +38 -0
- package/packages/lsp-tools-mcp/dist/cli.js +0 -0
- package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.js +40 -17
- package/packages/lsp-tools-mcp/dist/lsp/client.js +11 -9
- package/packages/lsp-tools-mcp/dist/lsp/config-loader.js +5 -5
- package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.js +5 -3
- package/packages/lsp-tools-mcp/dist/lsp/effective-extension.d.ts +1 -0
- package/packages/lsp-tools-mcp/dist/lsp/effective-extension.js +8 -0
- package/packages/lsp-tools-mcp/dist/lsp/infer-extension.js +3 -2
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.js +1 -0
- package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +12 -0
- package/packages/lsp-tools-mcp/dist/lsp/server-install-state.d.ts +12 -0
- package/packages/lsp-tools-mcp/dist/lsp/server-install-state.js +51 -0
- package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.js +2 -1
- package/packages/lsp-tools-mcp/dist/request-context.d.ts +7 -0
- package/packages/lsp-tools-mcp/dist/request-context.js +14 -0
- package/packages/lsp-tools-mcp/dist/tools.js +44 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +46 -33
- package/packages/omo-codex/plugin/.mcp.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.d.ts +7 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.js +173 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +10 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.d.ts +22 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.js +165 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.d.ts +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.js +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core.d.ts +5 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core.js +4 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.d.ts +6 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.js +10 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/record.d.ts +2 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/record.js +11 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.d.ts +3 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.js +104 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/runner.d.ts +26 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/runner.js +144 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/types.d.ts +43 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/types.js +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/cli.js +29 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.d.ts +28 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.js +137 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/index.d.ts +1 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/index.js +1 -0
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +5 -2
- package/packages/omo-codex/plugin/components/lsp/.mcp.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +42 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +40 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.d.ts +16 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.js +180 -0
- package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.d.ts +12 -0
- package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +95 -0
- package/packages/omo-codex/plugin/components/lsp/dist/mutated-file-paths.d.ts +6 -0
- package/packages/omo-codex/plugin/components/lsp/dist/mutated-file-paths.js +79 -0
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +7 -7
- package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.mjs +68 -0
- package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-tools.mjs +45 -22
- package/packages/omo-codex/plugin/components/lsp/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +6 -2
- package/packages/omo-codex/plugin/components/lsp/src/lsp-session-state.ts +4 -0
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +68 -0
- package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +8 -20
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +69 -96
- package/packages/omo-codex/plugin/components/rules/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +118 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.js +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook.d.ts +47 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook.js +127 -0
- package/packages/omo-codex/plugin/components/rules/dist/config.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/config.js +100 -0
- package/packages/omo-codex/plugin/components/rules/dist/context-pressure.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/context-pressure.js +26 -0
- package/packages/omo-codex/plugin/components/rules/dist/debug-log.d.ts +8 -0
- package/packages/omo-codex/plugin/components/rules/dist/debug-log.js +36 -0
- package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.js +65 -0
- package/packages/omo-codex/plugin/components/rules/dist/event-budget.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/event-budget.js +14 -0
- package/packages/omo-codex/plugin/components/rules/dist/hook-output.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/hook-output.js +24 -0
- package/packages/omo-codex/plugin/components/rules/dist/path-utils.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/path-utils.js +24 -0
- package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.d.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.js +172 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.js +74 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.js +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.d.ts +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.js +32 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.d.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.js +29 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/cache.d.ts +9 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/cache.js +51 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/constants.d.ts +70 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/constants.js +101 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.js +60 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.js +61 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.js +60 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.d.ts +11 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.js +75 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.js +29 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.d.ts +44 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.js +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine.js +85 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/errors.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/errors.js +12 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.d.ts +14 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.js +51 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.js +33 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.js +40 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder.d.ts +28 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder.js +146 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.js +112 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.d.ts +18 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.js +93 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.js +27 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.js +30 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.js +237 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser.js +31 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.d.ts +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.js +48 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.d.ts +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.js +23 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.d.ts +14 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.js +111 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/sources.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/sources.js +9 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.d.ts +18 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.js +59 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/types.d.ts +126 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/types.js +8 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.js +20 -0
- package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.js +41 -0
- package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.d.ts +10 -0
- package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.js +90 -0
- package/packages/omo-codex/plugin/components/rules/dist/static-injection.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/static-injection.js +128 -0
- package/packages/omo-codex/plugin/components/rules/dist/tool-paths.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/tool-paths.js +168 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.js +49 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-search.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-search.js +91 -0
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/src/codex-hook.ts +4 -2
- package/packages/omo-codex/plugin/components/rules/src/config.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/src/event-budget.ts +17 -0
- package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +4 -1
- package/packages/omo-codex/plugin/components/rules/src/post-compact-directive.ts +39 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/constants.ts +16 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/engine.ts +8 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/types.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/src/sparkshell-awareness.ts +53 -4
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +127 -7
- package/packages/omo-codex/plugin/components/rules/src/transcript-rule-filter.ts +9 -1
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +4 -2
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +7 -2
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +9 -9
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +10 -4
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +241 -0
- package/packages/omo-codex/plugin/components/rules/test/event-budget.test.ts +168 -0
- package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/test/sparkshell-awareness.test.ts +86 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +15 -15
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.d.ts +16 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.js +146 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +49 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.d.ts +2 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.js +80 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.d.ts +1 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.js +2 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.d.ts +5 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.js +3 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.d.ts +20 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.js +1 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +24 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.d.ts +1 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.js +18 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +62 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.d.ts +15 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.js +42 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/data-path.d.ts +10 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/data-path.js +35 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.d.ts +12 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.js +108 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.d.ts +4 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.js +31 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.d.ts +8 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.js +68 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.d.ts +21 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +133 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.d.ts +8 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.js +29 -0
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +5 -13
- package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +61 -185
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +122 -117
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +48 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.d.ts +7 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.js +122 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/directive.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/directive.js +2 -0
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +20 -11
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +17 -11
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +2 -5
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +0 -71
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +200 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.d.ts +17 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.js +97 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.d.ts +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +183 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +55 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.d.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +145 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +39 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.d.ts +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +100 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.d.ts +26 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +97 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +28 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +145 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/command-types.d.ts +34 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/command-types.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.js +41 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +95 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.d.ts +31 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.js +119 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +69 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +59 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +48 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +119 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +8 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +89 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +123 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.js +70 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/runtime.d.ts +10 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/runtime.js +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.d.ts +63 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +292 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/types.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/types.js +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +14 -14
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +24 -25
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +17 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +95 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +0 -96
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +23 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +46 -0
- package/packages/omo-codex/plugin/hooks/hooks.json +16 -16
- package/packages/omo-codex/plugin/package-lock.json +10 -9
- package/packages/omo-codex/plugin/package.json +27 -26
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +64 -15
- package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +16 -0
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +82 -18
- package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +2 -2
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +23 -11
- package/packages/omo-codex/plugin/scripts/sync-version.mjs +94 -0
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +9 -9
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +16 -1
- package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +93 -0
- package/packages/omo-codex/plugin/skills/lcx-doctor/agents/openai.yaml +11 -0
- package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +17 -13
- package/packages/omo-codex/plugin/skills/lsp-setup/SKILL.md +139 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/bash/README.md +60 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/c-cpp/README.md +61 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/csharp/README.md +71 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/dart/README.md +48 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/elixir/README.md +51 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/go/README.md +57 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/haskell/README.md +57 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/java/README.md +57 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/julia/README.md +60 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/kotlin/README.md +59 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/lua/README.md +66 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/php/README.md +62 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/python/README.md +71 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/ruby/README.md +53 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/rust/README.md +59 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/swift/README.md +51 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/terraform/README.md +62 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/typescript/README.md +77 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/yaml/README.md +70 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/zig/README.md +49 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/tsconfig.json +17 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +9 -9
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +10 -10
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +20 -22
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +38 -61
- package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +135 -677
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +14 -14
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +24 -25
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +20 -11
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +17 -11
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +9 -9
- package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +2 -1
- package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +5 -5
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +6 -6
- package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +194 -0
- package/packages/omo-codex/plugin/test/auto-update.test.mjs +17 -0
- package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +15 -44
- package/packages/omo-codex/plugin/test/lsp-prebuild-layouts.test.mjs +140 -0
- package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +189 -7
- package/packages/omo-codex/plugin/test/start-work-skill.test.mjs +9 -31
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +68 -4
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +119 -0
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +11 -112
- package/packages/omo-codex/plugin/test/sync-version.test.mjs +68 -0
- package/packages/omo-codex/plugin/test/ultraresearch-skill-contract.test.mjs +126 -0
- package/packages/omo-codex/plugin/test/ulw-plan-skill.test.mjs +2 -2
- package/packages/omo-codex/scripts/install/bin-dir.mjs +20 -0
- package/packages/omo-codex/scripts/install/bin-links.mjs +43 -6
- package/packages/omo-codex/scripts/install/cache.mjs +4 -0
- package/packages/omo-codex/scripts/install/config.mjs +4 -4
- package/packages/omo-codex/scripts/install/delegated-command.mjs +5 -1
- package/packages/omo-codex/scripts/install/git-bash-mcp-env.mjs +28 -0
- package/packages/omo-codex/scripts/install/git-bash.mjs +12 -4
- package/packages/omo-codex/scripts/install/git-bash.test.mjs +39 -4
- package/packages/omo-codex/scripts/install/hook-targets.mjs +46 -0
- package/packages/omo-codex/scripts/install/multi-agent-v2-config.mjs +12 -2
- package/packages/omo-codex/scripts/install/process.mjs +1 -0
- package/packages/omo-codex/scripts/install-bin-links.test.mjs +131 -3
- package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +91 -0
- package/packages/omo-codex/scripts/install-config.test.mjs +50 -44
- package/packages/omo-codex/scripts/install-delegated-command.test.mjs +78 -0
- package/packages/omo-codex/scripts/install-git-bash-mcp-env.test.mjs +93 -0
- package/packages/omo-codex/scripts/install-hook-targets.test.mjs +100 -0
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +3 -1
- package/packages/omo-codex/scripts/install-local.mjs +7 -18
- package/packages/omo-codex/scripts/install-local.test.mjs +34 -1
- package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +16 -1
- package/packages/shared-skills/skills/lcx-doctor/SKILL.md +93 -0
- package/packages/shared-skills/skills/lcx-doctor/agents/openai.yaml +11 -0
- package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +17 -13
- package/packages/shared-skills/skills/lsp-setup/SKILL.md +139 -0
- package/packages/shared-skills/skills/lsp-setup/references/bash/README.md +60 -0
- package/packages/shared-skills/skills/lsp-setup/references/c-cpp/README.md +61 -0
- package/packages/shared-skills/skills/lsp-setup/references/csharp/README.md +71 -0
- package/packages/shared-skills/skills/lsp-setup/references/dart/README.md +48 -0
- package/packages/shared-skills/skills/lsp-setup/references/elixir/README.md +51 -0
- package/packages/shared-skills/skills/lsp-setup/references/go/README.md +57 -0
- package/packages/shared-skills/skills/lsp-setup/references/haskell/README.md +57 -0
- package/packages/shared-skills/skills/lsp-setup/references/java/README.md +57 -0
- package/packages/shared-skills/skills/lsp-setup/references/julia/README.md +60 -0
- package/packages/shared-skills/skills/lsp-setup/references/kotlin/README.md +59 -0
- package/packages/shared-skills/skills/lsp-setup/references/lua/README.md +66 -0
- package/packages/shared-skills/skills/lsp-setup/references/php/README.md +62 -0
- package/packages/shared-skills/skills/lsp-setup/references/python/README.md +71 -0
- package/packages/shared-skills/skills/lsp-setup/references/ruby/README.md +53 -0
- package/packages/shared-skills/skills/lsp-setup/references/rust/README.md +59 -0
- package/packages/shared-skills/skills/lsp-setup/references/swift/README.md +51 -0
- package/packages/shared-skills/skills/lsp-setup/references/terraform/README.md +62 -0
- package/packages/shared-skills/skills/lsp-setup/references/typescript/README.md +77 -0
- package/packages/shared-skills/skills/lsp-setup/references/yaml/README.md +70 -0
- package/packages/shared-skills/skills/lsp-setup/references/zig/README.md +49 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/tsconfig.json +17 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
- package/packages/shared-skills/skills/remove-ai-slops/SKILL.md +1 -1
- package/packages/shared-skills/skills/review-work/SKILL.md +10 -14
- package/packages/shared-skills/skills/start-work/SKILL.md +30 -59
- package/packages/shared-skills/skills/ultraresearch/SKILL.md +126 -667
- package/dist/hooks/anthropic-effort/hook.d.ts +0 -26
- package/dist/hooks/anthropic-effort/index.d.ts +0 -1
- package/dist/hooks/keyword-detector/analyze/default.d.ts +0 -12
- package/dist/hooks/keyword-detector/analyze/index.d.ts +0 -1
- package/dist/hooks/keyword-detector/search/default.d.ts +0 -12
- package/dist/hooks/keyword-detector/search/index.d.ts +0 -1
- package/dist/hooks/thinking-block-validator/hook.d.ts +0 -12
- package/dist/hooks/thinking-block-validator/index.d.ts +0 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/directive-contract.test.ts +0 -18
- package/packages/omo-codex/plugin/test/global-review-debug-gate.test.mjs +0 -29
- package/packages/omo-codex/plugin/test/subagent-guidance.test.mjs +0 -151
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<start-work-continuation>
|
|
2
2
|
|
|
3
|
-
You are mid-flight on a Prometheus work plan
|
|
3
|
+
You are mid-flight on a Prometheus work plan; this turn is an automatic continuation. Do NOT ask whether to continue — the contract is auto-continue until every top-level checkbox is `- [x]`.
|
|
4
4
|
|
|
5
5
|
# State
|
|
6
6
|
|
|
@@ -15,23 +15,24 @@ You are mid-flight on a Prometheus work plan. The turn just ended without finish
|
|
|
15
15
|
|
|
16
16
|
# What to do this turn
|
|
17
17
|
|
|
18
|
-
1. Read `{{PLAN_PATH}}` AND `{{LEDGER_PATH}}` first —
|
|
18
|
+
1. Read `{{PLAN_PATH}}` AND `{{LEDGER_PATH}}` first — they are the only sources of truth for what remains and what evidence exists; do not trust your memory of prior turns.
|
|
19
19
|
2. Pick the FIRST unchecked top-level checkbox in `## TODOs` or `## Final Verification Wave`. Ignore nested checkboxes under Acceptance Criteria / Evidence / Definition of Done.
|
|
20
20
|
3. Follow the `start-work` skill in full. The skill is already loaded from your earlier turn — re-read its file at `packages/omo-codex/plugin/skills/start-work/SKILL.md` if you have lost context.
|
|
21
|
-
4.
|
|
22
|
-
5.
|
|
23
|
-
6.
|
|
24
|
-
7.
|
|
25
|
-
8.
|
|
26
|
-
9.
|
|
21
|
+
4. Apply the checkbox's tier from its ledger entry, or classify it now per the start-work skill: LIGHT (default — a narrow change inside existing layers) needs one real-surface proof of the deliverable, with auxiliary surfaces first-class for CLI- or data-shaped work, and only trigger-mapped adversarial classes; HEAVY (new module/abstraction, auth/security, external integration, schema/migration, concurrency, cross-domain refactor, care signals) takes the full per-criterion regime. When unsure, take HEAVY; never downgrade.
|
|
22
|
+
5. Decompose the checkbox into atomic sub-tasks. Dispatch them in PARALLEL via `multi_agent_v1.spawn_agent` calls in this same response unless a sub-task has a NAMED blocking dependency (input from another sub-task or shared file). Use `fork_context: false` unless full history is truly required. Put role and specialty instructions inside `message`.
|
|
23
|
+
6. Every sub-task message MUST be self-contained, an executable assignment rather than a context handoff: start with `TASK: <imperative assignment>`, then name `DELIVERABLE`, `SCOPE`, and `VERIFY`. It must include all 7 sections and name one Manual-QA channel with its exact tool and exact invocation (the literal `curl` / `send-keys` / `page.click` with concrete inputs and the binary PASS/FAIL observable), plus the applicable ultraqa adversarial classes, a captured artifact, and a cleanup receipt. Channels: HTTP call (`curl -i`); tmux (`send-keys` + `capture-pane`); browser use — use Chrome to drive the page, else download and use agent-browser (https://github.com/vercel-labs/agent-browser); computer use — OS-level GUI automation for a desktop app.
|
|
24
|
+
7. Treat every worker DoneClaim as untrusted input. Run independent AdversarialVerify before any checkbox can become FullyDone; `confirmed` is the only pass verdict, while `false-positive`, `needs-fix`, and `needs-human-review` loop back to the executor with exact feedback.
|
|
25
|
+
8. Use `multi_agent_v1.wait_agent` for mailbox signals, not proof of completion — a timeout only means no new mailbox update arrived; a running child is alive. For sub-tasks likely to exceed one wait cycle, require `WORKING: <task> - <current phase>` before long passes and `BLOCKED: <reason>` only when progress stops. Send `TASK STILL ACTIVE: return <deliverable> or BLOCKED: <reason>` only when the child is completed without the deliverable, ack-only, or no longer running. If that followup is still silent or ack-only, record inconclusive, do not count it as pass/review approval, close if safe, and respawn a smaller `fork_context: false` task with the missing deliverable.
|
|
26
|
+
9. After verification of ALL sub-tasks under this checkbox: `apply_patch` the plan to change `- [ ]` → `- [x]`, re-read the plan to confirm the count decreased, append a `task-completed` line to the ledger, then continue.
|
|
27
|
+
10. Do not start fresh on a sub-agent failure. Re-dispatch with a fix-message: `FAILED: <exact error>` + `Diagnosis: <observation>` + `Fix: <instruction>`.
|
|
27
28
|
|
|
28
29
|
# Hard constraints
|
|
29
30
|
|
|
30
|
-
- No production code before a failing test
|
|
31
|
+
- No production code before a failing-first proof exists: a unit test at a seam, otherwise the sub-task's Manual-QA scenario captured failing. A test that mirrors its implementation (mock-call assertions, pinned constants) is not evidence. When the change touches existing behavior, PIN it first: a baseline characterization test that passes on the unchanged code, with exact inputs, exact observable, and exact assertion. PIN → RED → GREEN → SURFACE.
|
|
31
32
|
- No `--dry-run` as evidence. No "should work". No "tests pass" as completion proof.
|
|
32
33
|
- No `as any` / `@ts-ignore` / `@ts-expect-error`. No deleting failing tests.
|
|
33
|
-
- Probe every
|
|
34
|
-
- Cleanup receipt is mandatory. Register each QA resource teardown (scripts, tmux
|
|
34
|
+
- Probe every ultraqa adversarial class whose trigger fact holds (malformed input, prompt injection, cancel/resume, stale state, dirty worktree, hung or long commands, flaky tests, misleading success output, repeated interruptions — trigger map in the start-work skill) and capture the observable for each. A clean happy-path artifact alone is NOT a PASS when an applicable class went unprobed; record skipped classes with a one-line not-applicable reason.
|
|
35
|
+
- Cleanup receipt is mandatory. Register each QA resource teardown (scripts, tmux sessions, browser contexts, PIDs, ports, containers, temp dirs) as its own todo the moment it spawns, then execute it. Leftover QA state = BLOCKED, not PASS.
|
|
35
36
|
- The worktree path (if set in boulder.json) governs every file edit and command. Do not stray into the main repo.
|
|
36
37
|
- session_ids you write to boulder.json MUST be prefixed `codex:`. Bare ids on read are legacy `opencode:`.
|
|
37
38
|
|
|
@@ -44,15 +45,14 @@ Do not print `ORCHESTRATION COMPLETE`. Do not create a PR, PR handoff, or branch
|
|
|
44
45
|
# Stop conditions for THIS turn
|
|
45
46
|
|
|
46
47
|
- A top-level checkbox flipped to `- [x]` after the 5-phase QA gate (Phase 1 read, Phase 2 automated, Phase 3 channel scenario, Phase 4 adversarial-class probing, Phase 5 gate decision). Then the Stop hook will re-evaluate; if more checkboxes remain you will be continued again.
|
|
47
|
-
- 3 same-failure cycles on one sub-task → escalate via `spawn_agent({"
|
|
48
|
+
- 3 same-failure cycles on one sub-task → escalate via `multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. DELIVERABLE: diagnose the repeated sub-task failure and recommend the next safe action. VERIFY: cite the failing evidence.","fork_context":false})` and stop dispatch.
|
|
48
49
|
- Safety boundary (destructive command, secret exfiltration, production write) → stop and surface a safe substitute.
|
|
49
50
|
- All top-level checkboxes `- [x]` AND the Global Review and Debugging Gate passed → print the ORCHESTRATION COMPLETE block and end.
|
|
50
51
|
|
|
51
52
|
# Output discipline
|
|
52
53
|
|
|
53
|
-
- Surface only state changes: sub-agent dispatched,
|
|
54
|
-
- Do NOT print "Should I continue?" — the Stop hook
|
|
55
|
-
- Do NOT restate the full plan. Do NOT recap prior turns. The ledger and the plan file are the durable record.
|
|
54
|
+
- Surface only state changes: sub-agent dispatched, scenario PASS/FAIL with artifact path, checkbox marked, evidence appended.
|
|
55
|
+
- Do NOT print "Should I continue?", restate the plan, or recap prior turns — the Stop hook continues you; the ledger and plan are the durable record.
|
|
56
56
|
|
|
57
57
|
Begin now. Pick the next checkbox, dispatch the parallel sub-agents, verify, mark, continue.
|
|
58
58
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReadonlyFileSystem } from "./types.js";
|
|
2
|
+
export type PlanChecklist = {
|
|
3
|
+
readonly remaining: number;
|
|
4
|
+
readonly total: number;
|
|
5
|
+
readonly nextTaskLabel: string | null;
|
|
6
|
+
};
|
|
7
|
+
export type ContinuationState = {
|
|
8
|
+
readonly planName: string;
|
|
9
|
+
readonly planPath: string;
|
|
10
|
+
readonly boulderPath: string;
|
|
11
|
+
readonly ledgerPath: string;
|
|
12
|
+
readonly worktreePath: string | null;
|
|
13
|
+
readonly checklist: PlanChecklist;
|
|
14
|
+
};
|
|
15
|
+
export declare function parsePlanChecklist(markdown: string): PlanChecklist;
|
|
16
|
+
export declare function readContinuationState(cwd: string, sessionId: string, fs: ReadonlyFileSystem): ContinuationState | null;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
2
|
+
const CHECKBOX_PATTERN = /^- \[[ xX]\] /;
|
|
3
|
+
const UNCHECKED_PATTERN = /^- \[ \] /;
|
|
4
|
+
const TODO_HEADING = "TODOs";
|
|
5
|
+
const FINAL_VERIFICATION_HEADING = "Final Verification Wave";
|
|
6
|
+
export function parsePlanChecklist(markdown) {
|
|
7
|
+
const lines = markdown.split(/\r?\n/);
|
|
8
|
+
const hasCountedSections = lines.some(hasCountedSectionHeading);
|
|
9
|
+
let remaining = 0;
|
|
10
|
+
let total = 0;
|
|
11
|
+
let nextTaskLabel = null;
|
|
12
|
+
let isCountedSection = !hasCountedSections;
|
|
13
|
+
for (const line of lines) {
|
|
14
|
+
const heading = parseLevelTwoHeading(line);
|
|
15
|
+
if (heading !== null)
|
|
16
|
+
isCountedSection = isCountedHeading(heading);
|
|
17
|
+
if (!isCountedSection)
|
|
18
|
+
continue;
|
|
19
|
+
if (!CHECKBOX_PATTERN.test(line))
|
|
20
|
+
continue;
|
|
21
|
+
total += 1;
|
|
22
|
+
if (!UNCHECKED_PATTERN.test(line))
|
|
23
|
+
continue;
|
|
24
|
+
remaining += 1;
|
|
25
|
+
if (nextTaskLabel === null)
|
|
26
|
+
nextTaskLabel = line.slice("- [ ] ".length);
|
|
27
|
+
}
|
|
28
|
+
return { remaining, total, nextTaskLabel };
|
|
29
|
+
}
|
|
30
|
+
function hasCountedSectionHeading(line) {
|
|
31
|
+
const heading = parseLevelTwoHeading(line);
|
|
32
|
+
return heading !== null && isCountedHeading(heading);
|
|
33
|
+
}
|
|
34
|
+
export function readContinuationState(cwd, sessionId, fs) {
|
|
35
|
+
const boulderPath = join(cwd, ".omo", "boulder.json");
|
|
36
|
+
const boulderText = readTextFile(fs, boulderPath);
|
|
37
|
+
if (boulderText === null)
|
|
38
|
+
return null;
|
|
39
|
+
const parsed = parseJsonObject(boulderText);
|
|
40
|
+
if (parsed === null)
|
|
41
|
+
return null;
|
|
42
|
+
const work = findMatchingWork(parsed, `codex:${sessionId}`);
|
|
43
|
+
if (work === null)
|
|
44
|
+
return null;
|
|
45
|
+
const planPath = resolvePlanPath(cwd, work.activePlan);
|
|
46
|
+
const planText = readTextFile(fs, planPath);
|
|
47
|
+
if (planText === null)
|
|
48
|
+
return null;
|
|
49
|
+
const checklist = parsePlanChecklist(planText);
|
|
50
|
+
if (checklist.remaining === 0)
|
|
51
|
+
return null;
|
|
52
|
+
return {
|
|
53
|
+
planName: work.planName,
|
|
54
|
+
planPath,
|
|
55
|
+
boulderPath,
|
|
56
|
+
ledgerPath: join(cwd, ".omo", "start-work", "ledger.jsonl"),
|
|
57
|
+
worktreePath: work.worktreePath,
|
|
58
|
+
checklist,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function findMatchingWork(state, prefixedSessionId) {
|
|
62
|
+
const worksValue = state["works"];
|
|
63
|
+
const candidates = isRecord(worksValue) ? Object.values(worksValue) : [state];
|
|
64
|
+
for (const candidate of candidates) {
|
|
65
|
+
const work = parseBoulderWork(candidate);
|
|
66
|
+
if (work === null)
|
|
67
|
+
continue;
|
|
68
|
+
if (!isContinuableStatus(work.status))
|
|
69
|
+
continue;
|
|
70
|
+
if (work.sessionIds.includes(prefixedSessionId))
|
|
71
|
+
return work;
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
function parseBoulderWork(value) {
|
|
76
|
+
if (!isRecord(value))
|
|
77
|
+
return null;
|
|
78
|
+
const activePlan = value["active_plan"];
|
|
79
|
+
const planName = value["plan_name"];
|
|
80
|
+
const status = parseWorkStatus(value["status"]);
|
|
81
|
+
const sessionIds = value["session_ids"];
|
|
82
|
+
const worktreePath = value["worktree_path"];
|
|
83
|
+
if (typeof activePlan !== "string")
|
|
84
|
+
return null;
|
|
85
|
+
if (typeof planName !== "string")
|
|
86
|
+
return null;
|
|
87
|
+
if (status === null)
|
|
88
|
+
return null;
|
|
89
|
+
if (!isStringArray(sessionIds))
|
|
90
|
+
return null;
|
|
91
|
+
return {
|
|
92
|
+
activePlan,
|
|
93
|
+
planName,
|
|
94
|
+
status,
|
|
95
|
+
sessionIds,
|
|
96
|
+
worktreePath: typeof worktreePath === "string" ? worktreePath : null,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function parseWorkStatus(value) {
|
|
100
|
+
if (value === "active" || value === "completed" || value === "paused" || value === "abandoned")
|
|
101
|
+
return value;
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
function isContinuableStatus(status) {
|
|
105
|
+
return status === "active" || status === "paused";
|
|
106
|
+
}
|
|
107
|
+
function parseLevelTwoHeading(line) {
|
|
108
|
+
if (!line.startsWith("## "))
|
|
109
|
+
return null;
|
|
110
|
+
if (line.startsWith("### "))
|
|
111
|
+
return null;
|
|
112
|
+
return line.slice("## ".length).trim();
|
|
113
|
+
}
|
|
114
|
+
function isCountedHeading(heading) {
|
|
115
|
+
return heading === TODO_HEADING || heading === FINAL_VERIFICATION_HEADING;
|
|
116
|
+
}
|
|
117
|
+
function resolvePlanPath(cwd, activePlan) {
|
|
118
|
+
return isAbsolute(activePlan) ? activePlan : resolve(cwd, activePlan);
|
|
119
|
+
}
|
|
120
|
+
function readTextFile(fs, path) {
|
|
121
|
+
try {
|
|
122
|
+
return fs.readFileSync(path, "utf8");
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
if (error instanceof Error)
|
|
126
|
+
return null;
|
|
127
|
+
throw error;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function parseJsonObject(json) {
|
|
131
|
+
try {
|
|
132
|
+
const parsed = JSON.parse(json);
|
|
133
|
+
return isRecord(parsed) ? parsed : null;
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
if (error instanceof SyntaxError)
|
|
137
|
+
return null;
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function isStringArray(value) {
|
|
142
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
143
|
+
}
|
|
144
|
+
function isRecord(value) {
|
|
145
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
146
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { stdin as processStdin, stdout as processStdout } from "node:process";
|
|
4
|
+
import { runStopHook } from "./codex-hook.js";
|
|
5
|
+
const nodeFileSystem = {
|
|
6
|
+
readFileSync(path, encoding) {
|
|
7
|
+
return readFileSync(path, encoding);
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
const command = process.argv[2];
|
|
11
|
+
const subcommand = process.argv[3];
|
|
12
|
+
if (command === "hook" && (subcommand === "stop" || subcommand === "subagent-stop")) {
|
|
13
|
+
await runHookCli();
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
process.stderr.write("Usage: omo-start-work-continuation hook <stop|subagent-stop>\n");
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
}
|
|
19
|
+
async function runHookCli() {
|
|
20
|
+
const raw = await readStdin();
|
|
21
|
+
if (raw.trim().length === 0)
|
|
22
|
+
return;
|
|
23
|
+
const parsed = parseHookInput(raw);
|
|
24
|
+
const output = runStopHook(parsed, nodeFileSystem);
|
|
25
|
+
if (output.length > 0)
|
|
26
|
+
processStdout.write(output);
|
|
27
|
+
}
|
|
28
|
+
function parseHookInput(raw) {
|
|
29
|
+
try {
|
|
30
|
+
const parsed = JSON.parse(raw);
|
|
31
|
+
return parsed;
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (error instanceof SyntaxError)
|
|
35
|
+
return undefined;
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function readStdin() {
|
|
40
|
+
return new Promise((resolve) => {
|
|
41
|
+
let data = "";
|
|
42
|
+
processStdin.setEncoding("utf8");
|
|
43
|
+
processStdin.on("data", (chunk) => {
|
|
44
|
+
data += chunk;
|
|
45
|
+
});
|
|
46
|
+
processStdin.once("error", () => resolve(data));
|
|
47
|
+
processStdin.once("end", () => resolve(data));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { readContinuationState } from "./boulder-reader.js";
|
|
2
|
+
import { START_WORK_CONTINUATION_DIRECTIVE } from "./directive.js";
|
|
3
|
+
export function runStopHook(input, fs) {
|
|
4
|
+
if (!isStopInput(input))
|
|
5
|
+
return "";
|
|
6
|
+
if (input.stop_hook_active)
|
|
7
|
+
return "";
|
|
8
|
+
if (transcriptHasContextPressureMarker(input.transcript_path, fs))
|
|
9
|
+
return "";
|
|
10
|
+
const state = readContinuationState(input.cwd, input.session_id, fs);
|
|
11
|
+
if (state === null)
|
|
12
|
+
return "";
|
|
13
|
+
return JSON.stringify({
|
|
14
|
+
decision: "block",
|
|
15
|
+
reason: renderDirective(state, input.session_id),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function renderDirective(state, sessionId) {
|
|
19
|
+
const lineBreak = String.fromCharCode(10);
|
|
20
|
+
const worktreeBlock = state.worktreePath === null
|
|
21
|
+
? ""
|
|
22
|
+
: `${lineBreak}- Worktree: \`${state.worktreePath}\` (all edits, tests, and commands run inside this directory)`;
|
|
23
|
+
const replacements = {
|
|
24
|
+
PLAN_NAME: state.planName,
|
|
25
|
+
PLAN_PATH: state.planPath,
|
|
26
|
+
BOULDER_PATH: state.boulderPath,
|
|
27
|
+
REMAINING_COUNT: String(state.checklist.remaining),
|
|
28
|
+
TOTAL_COUNT: String(state.checklist.total),
|
|
29
|
+
NEXT_TASK_LABEL: state.checklist.nextTaskLabel ?? "",
|
|
30
|
+
WORKTREE_BLOCK: worktreeBlock,
|
|
31
|
+
LEDGER_PATH: state.ledgerPath,
|
|
32
|
+
SESSION_ID: sessionId,
|
|
33
|
+
};
|
|
34
|
+
let rendered = START_WORK_CONTINUATION_DIRECTIVE;
|
|
35
|
+
for (const [placeholder, value] of Object.entries(replacements)) {
|
|
36
|
+
rendered = rendered.replaceAll(`{{${placeholder}}}`, value);
|
|
37
|
+
}
|
|
38
|
+
return rendered;
|
|
39
|
+
}
|
|
40
|
+
const CONTEXT_PRESSURE_MARKERS = [
|
|
41
|
+
"context compacted",
|
|
42
|
+
"context_length_exceeded",
|
|
43
|
+
"skill descriptions were shortened",
|
|
44
|
+
"context_too_large",
|
|
45
|
+
"codex ran out of room in the model's context window",
|
|
46
|
+
"your input exceeds the context window",
|
|
47
|
+
"long threads and multiple compactions",
|
|
48
|
+
];
|
|
49
|
+
function transcriptHasContextPressureMarker(transcriptPath, fs) {
|
|
50
|
+
try {
|
|
51
|
+
const transcript = fs.readFileSync(transcriptPath, "utf8").toLowerCase();
|
|
52
|
+
return CONTEXT_PRESSURE_MARKERS.some((marker) => transcript.includes(marker));
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (error instanceof Error)
|
|
56
|
+
return false;
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function isStopInput(value) {
|
|
61
|
+
return (isRecord(value) &&
|
|
62
|
+
isStopHookEventName(value["hook_event_name"]) &&
|
|
63
|
+
typeof value["session_id"] === "string" &&
|
|
64
|
+
typeof value["turn_id"] === "string" &&
|
|
65
|
+
typeof value["transcript_path"] === "string" &&
|
|
66
|
+
typeof value["cwd"] === "string" &&
|
|
67
|
+
typeof value["model"] === "string" &&
|
|
68
|
+
typeof value["permission_mode"] === "string" &&
|
|
69
|
+
typeof value["stop_hook_active"] === "boolean" &&
|
|
70
|
+
optionalString(value["last_assistant_message"]));
|
|
71
|
+
}
|
|
72
|
+
function isStopHookEventName(value) {
|
|
73
|
+
return value === "Stop" || value === "SubagentStop";
|
|
74
|
+
}
|
|
75
|
+
function optionalString(value) {
|
|
76
|
+
return value === undefined || typeof value === "string";
|
|
77
|
+
}
|
|
78
|
+
function isRecord(value) {
|
|
79
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
80
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const START_WORK_CONTINUATION_DIRECTIVE: string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { ContinuationState, PlanChecklist } from "./boulder-reader.js";
|
|
2
|
+
export { parsePlanChecklist, readContinuationState } from "./boulder-reader.js";
|
|
3
|
+
export { runStopHook } from "./codex-hook.js";
|
|
4
|
+
export { START_WORK_CONTINUATION_DIRECTIVE } from "./directive.js";
|
|
5
|
+
export type { ReadonlyFileSystem, StopHookEventName, StopHookOutput, StopInput } from "./types.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const STOP_HOOK_EVENTS: readonly ["Stop", "SubagentStop"];
|
|
2
|
+
export type StopHookEventName = (typeof STOP_HOOK_EVENTS)[number];
|
|
3
|
+
export type StopInput = {
|
|
4
|
+
readonly hook_event_name: StopHookEventName;
|
|
5
|
+
readonly session_id: string;
|
|
6
|
+
readonly turn_id: string;
|
|
7
|
+
readonly transcript_path: string;
|
|
8
|
+
readonly cwd: string;
|
|
9
|
+
readonly model: string;
|
|
10
|
+
readonly permission_mode: string;
|
|
11
|
+
readonly stop_hook_active: boolean;
|
|
12
|
+
readonly last_assistant_message?: string;
|
|
13
|
+
};
|
|
14
|
+
export type StopHookOutput = {
|
|
15
|
+
readonly decision: "block";
|
|
16
|
+
readonly reason: string;
|
|
17
|
+
};
|
|
18
|
+
export type ReadonlyFileSystem = {
|
|
19
|
+
readFileSync(path: string, encoding: "utf8"): string;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const STOP_HOOK_EVENTS = ["Stop", "SubagentStop"];
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"type": "command",
|
|
8
8
|
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook stop",
|
|
9
9
|
"timeout": 10,
|
|
10
|
-
"statusMessage": "LazyCodex(
|
|
10
|
+
"statusMessage": "LazyCodex(4.9.1): Checking Start-Work Continuation"
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"type": "command",
|
|
20
20
|
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook subagent-stop",
|
|
21
21
|
"timeout": 10,
|
|
22
|
-
"statusMessage": "LazyCodex(
|
|
22
|
+
"statusMessage": "LazyCodex(4.9.1): Checking Start-Work Continuation"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
}
|
package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts
CHANGED
|
@@ -112,12 +112,34 @@ describe("start-work Stop hook", () => {
|
|
|
112
112
|
// then
|
|
113
113
|
const parsed = parseBlockOutput(output);
|
|
114
114
|
expect(parsed.reason).toMatch(/TASK:/);
|
|
115
|
-
expect(parsed.reason).toMatch(/
|
|
115
|
+
expect(parsed.reason).toMatch(/fork_context:\s*false/);
|
|
116
116
|
expect(parsed.reason).toMatch(/wait_agent.*mailbox signals/);
|
|
117
117
|
expect(parsed.reason).toMatch(/TASK STILL ACTIVE/);
|
|
118
118
|
expect(parsed.reason).toMatch(/respawn.*smaller/);
|
|
119
119
|
expect(parsed.reason).toMatch(/WORKING:/);
|
|
120
|
-
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("#given active codex work #when continuation directive is emitted #then QA weight is tier-scoped without echo bloat", () => {
|
|
123
|
+
// given
|
|
124
|
+
const fs = createMemoryFs({
|
|
125
|
+
[BOULDER_PATH]: createBoulderJson({
|
|
126
|
+
sessionIds: ["codex:sess_abc"],
|
|
127
|
+
status: "active",
|
|
128
|
+
}),
|
|
129
|
+
[PLAN_PATH]: ["# Plan", "", "## TODOs", "- [ ] First"].join("\n"),
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// when
|
|
133
|
+
const output = runStopHook(createStopInput(), fs);
|
|
134
|
+
|
|
135
|
+
// then
|
|
136
|
+
const parsed = parseBlockOutput(output);
|
|
137
|
+
expect(parsed.reason).toMatch(/LIGHT/);
|
|
138
|
+
expect(parsed.reason).toMatch(/HEAVY/);
|
|
139
|
+
expect(parsed.reason).toMatch(/When unsure[^.]{0,30}HEAVY/);
|
|
140
|
+
expect(parsed.reason).toMatch(/mirrors its implementation/);
|
|
141
|
+
expect((parsed.reason.match(/malformed input, prompt injection/g) ?? []).length).toBe(1);
|
|
142
|
+
expect(parsed.reason.split(/\s+/).filter(Boolean).length).toBeLessThanOrEqual(1100);
|
|
121
143
|
});
|
|
122
144
|
|
|
123
145
|
it("#given active work belongs to another harness #when hook runs #then returns empty output", () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function writeFileAtomically(filePath: string, content: string): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
|
+
export function writeFileAtomically(filePath, content) {
|
|
3
|
+
const tempPath = `${filePath}.tmp`;
|
|
4
|
+
writeFileSync(tempPath, content, "utf-8");
|
|
5
|
+
try {
|
|
6
|
+
renameSync(tempPath, filePath);
|
|
7
|
+
}
|
|
8
|
+
catch (error) {
|
|
9
|
+
const isPermissionError = error instanceof Error &&
|
|
10
|
+
(error.message.includes("EPERM") || error.message.includes("EACCES"));
|
|
11
|
+
if (process.platform === "win32" && isPermissionError) {
|
|
12
|
+
unlinkSync(filePath);
|
|
13
|
+
renameSync(tempPath, filePath);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { stdin as processStdin, stdout as processStdout } from "node:process";
|
|
3
|
+
import { runSessionStartHook } from "./codex-hook.js";
|
|
4
|
+
const command = process.argv[2];
|
|
5
|
+
const subcommand = process.argv[3];
|
|
6
|
+
if (command === "hook" && subcommand === "session-start") {
|
|
7
|
+
await runHookCli();
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
process.stderr.write("Usage: omo-telemetry hook session-start\n");
|
|
11
|
+
process.exitCode = 1;
|
|
12
|
+
}
|
|
13
|
+
async function runHookCli() {
|
|
14
|
+
const raw = await readStdin();
|
|
15
|
+
if (raw.trim().length === 0)
|
|
16
|
+
return;
|
|
17
|
+
const parsed = parseHookInput(raw);
|
|
18
|
+
if (!isCodexSessionStartInput(parsed))
|
|
19
|
+
return;
|
|
20
|
+
const output = await runSessionStartHook(parsed);
|
|
21
|
+
if (output.length > 0) {
|
|
22
|
+
processStdout.write(output);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function parseHookInput(raw) {
|
|
26
|
+
try {
|
|
27
|
+
const parsed = JSON.parse(raw);
|
|
28
|
+
return parsed;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function isCodexSessionStartInput(value) {
|
|
35
|
+
return (isRecord(value) &&
|
|
36
|
+
value["hook_event_name"] === "SessionStart" &&
|
|
37
|
+
typeof value["session_id"] === "string" &&
|
|
38
|
+
isStringOrNull(value["transcript_path"]) &&
|
|
39
|
+
typeof value["cwd"] === "string" &&
|
|
40
|
+
typeof value["model"] === "string" &&
|
|
41
|
+
typeof value["permission_mode"] === "string" &&
|
|
42
|
+
typeof value["source"] === "string");
|
|
43
|
+
}
|
|
44
|
+
function isStringOrNull(value) {
|
|
45
|
+
return typeof value === "string" || value === null;
|
|
46
|
+
}
|
|
47
|
+
function isRecord(value) {
|
|
48
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
49
|
+
}
|
|
50
|
+
function readStdin() {
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
let data = "";
|
|
53
|
+
processStdin.setEncoding("utf8");
|
|
54
|
+
processStdin.on("data", (chunk) => {
|
|
55
|
+
data += chunk;
|
|
56
|
+
});
|
|
57
|
+
processStdin.once("error", reject);
|
|
58
|
+
processStdin.once("end", () => {
|
|
59
|
+
resolve(data);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type PostHogClient } from "./posthog.js";
|
|
2
|
+
export type CodexSessionStartInput = {
|
|
3
|
+
session_id: string;
|
|
4
|
+
transcript_path: string | null;
|
|
5
|
+
cwd: string;
|
|
6
|
+
hook_event_name: "SessionStart";
|
|
7
|
+
model: string;
|
|
8
|
+
permission_mode: string;
|
|
9
|
+
source: "startup" | "resume" | "clear";
|
|
10
|
+
};
|
|
11
|
+
export type CodexTelemetryHookOptions = {
|
|
12
|
+
createClient?: () => PostHogClient | Promise<PostHogClient>;
|
|
13
|
+
getDistinctId?: () => string;
|
|
14
|
+
};
|
|
15
|
+
export declare function runSessionStartHook(_input: CodexSessionStartInput, options?: CodexTelemetryHookOptions): Promise<string>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { writeTelemetryDiagnostic, } from "./diagnostics.js";
|
|
2
|
+
import { createPluginPostHog, getPostHogDistinctId, } from "./posthog.js";
|
|
3
|
+
const SESSION_START_REASON = "session_start";
|
|
4
|
+
function writeHookDiagnostic(event, error, errorKind) {
|
|
5
|
+
writeTelemetryDiagnostic({
|
|
6
|
+
event,
|
|
7
|
+
source: "plugin",
|
|
8
|
+
error,
|
|
9
|
+
errorKind,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export async function runSessionStartHook(_input, options = {}) {
|
|
13
|
+
const createClient = options.createClient ?? createPluginPostHog;
|
|
14
|
+
const getDistinctId = options.getDistinctId ?? getPostHogDistinctId;
|
|
15
|
+
let client;
|
|
16
|
+
try {
|
|
17
|
+
client = await createClient();
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
writeHookDiagnostic("telemetry_posthog_init_failed", error, error instanceof Error ? "error" : "non_error");
|
|
21
|
+
return "";
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
client.trackActive(getDistinctId(), SESSION_START_REASON);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
writeHookDiagnostic("telemetry_capture_failed", error, error instanceof Error ? "error" : "non_error");
|
|
28
|
+
await safeShutdown(client);
|
|
29
|
+
return "";
|
|
30
|
+
}
|
|
31
|
+
await safeShutdown(client);
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
async function safeShutdown(client) {
|
|
35
|
+
try {
|
|
36
|
+
await client.shutdown();
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
writeHookDiagnostic("telemetry_shutdown_failed", error, error instanceof Error ? "error" : "non_error");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|