oh-my-opencode 4.18.2 → 4.19.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/.agents/command/omomomo.md +1 -1
- package/.agents/skills/omomomo/SKILL.md +1 -1
- package/.opencode/command/omomomo.md +1 -1
- package/README.ja.md +6 -6
- package/README.ko.md +6 -6
- package/README.md +8 -8
- package/README.ru.md +6 -6
- package/README.zh-cn.md +6 -6
- package/dist/agents/atlas/agent.d.ts +7 -6
- package/dist/agents/gpt-prompt-identity.d.ts +3 -0
- package/dist/agents/sisyphus/gpt-5-5.d.ts +1 -1
- package/dist/agents/sisyphus/gpt-task-system-guide.d.ts +1 -0
- package/dist/agents/sisyphus/index.d.ts +5 -0
- package/dist/agents/sisyphus/kimi-k3.d.ts +19 -0
- package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
- package/dist/agents/sisyphus-junior/agent.d.ts +8 -4
- package/dist/agents/sisyphus-junior/gpt-5-5.d.ts +2 -2
- package/dist/agents/sisyphus-junior/index.d.ts +2 -0
- package/dist/agents/sisyphus-junior/kimi-k3.d.ts +12 -0
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/index.js +781 -215
- package/dist/cli-node/index.js +781 -215
- package/dist/config/index.d.ts +1 -1
- package/dist/config/schema/agent-overrides.d.ts +48 -48
- package/dist/config/schema/browser-automation.d.ts +1 -0
- package/dist/config/schema/categories.d.ts +6 -6
- package/dist/config/schema/codegraph.d.ts +2 -0
- package/dist/config/schema/commands.d.ts +1 -3
- package/dist/config/schema/default-mode.d.ts +1 -1
- package/dist/config/schema/fallback-models.d.ts +5 -5
- package/dist/config/schema/goal.d.ts +7 -0
- package/dist/config/schema/hooks.d.ts +1 -1
- package/dist/config/schema/oh-my-opencode-config.d.ts +56 -58
- package/dist/config/schema/ralph-loop.d.ts +1 -1
- package/dist/config/schema.d.ts +1 -1
- package/dist/create-hooks.d.ts +1 -1
- package/dist/features/builtin-commands/templates/goal.d.ts +1 -0
- package/dist/features/builtin-commands/templates/stop-continuation.d.ts +1 -1
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/hooks/auto-slash-command/executor.d.ts +1 -0
- package/dist/hooks/codegraph-bootstrap/hook.d.ts +3 -2
- package/dist/hooks/goal/command-arguments.d.ts +13 -0
- package/dist/hooks/goal/controller.d.ts +26 -0
- package/dist/hooks/goal/index.d.ts +23 -0
- package/dist/hooks/goal/prompt.d.ts +3 -0
- package/dist/hooks/goal/store.d.ts +8 -0
- package/dist/hooks/goal/tools.d.ts +10 -0
- package/dist/hooks/goal/types.d.ts +93 -0
- package/dist/hooks/goal/validation.d.ts +4 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/keyword-detector/hook.d.ts +1 -2
- package/dist/hooks/ralph-loop/types.d.ts +1 -1
- package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +1 -1
- package/dist/hooks/start-work/notepad-scaffold.d.ts +10 -0
- package/dist/index.js +5398 -5109
- package/dist/oh-my-opencode.schema.json +34 -19
- package/dist/plugin/chat-message/loop-commands.d.ts +1 -1
- package/dist/plugin/chat-message/types.d.ts +23 -10
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +3 -2
- package/dist/plugin/hooks/create-transform-hooks.d.ts +0 -2
- package/dist/plugin/stop-continuation.d.ts +2 -2
- package/dist/shared/omo-process-sweep.d.ts +18 -0
- package/dist/shared/system-directive.d.ts +0 -1
- package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.test.ts +87 -0
- package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.ts +35 -5
- package/dist/skills/ulw-plan/SKILL.md +31 -8
- package/dist/skills/ulw-plan/references/full-workflow.md +117 -6
- package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +46 -10
- package/dist/skills/ulw-research/SKILL.md +3 -3
- package/dist/testing/create-plugin-module.d.ts +1 -0
- package/dist/tools/delegate-task/types.d.ts +0 -1
- package/dist/tui.js +138 -80
- package/package.json +14 -14
- package/packages/git-bash-mcp/dist/cli.js +54 -8
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +60 -0
- package/packages/lsp-core/src/lsp/client.ts +14 -1
- package/packages/lsp-core/src/lsp/fixtures/diagnostics-freshness-contract-probe.ts +2 -2
- package/packages/lsp-core/src/mcp.ts +9 -0
- package/packages/lsp-daemon/dist/cli.js +319 -51
- package/packages/lsp-daemon/dist/client.js +136 -48
- package/packages/lsp-daemon/dist/daemon-client.d.ts +0 -10
- package/packages/lsp-daemon/dist/daemon-client.js +4 -34
- package/packages/lsp-daemon/dist/daemon-failure-result.d.ts +3 -0
- package/packages/lsp-daemon/dist/daemon-failure-result.js +38 -0
- package/packages/lsp-daemon/dist/daemon-request-error.d.ts +14 -0
- package/packages/lsp-daemon/dist/daemon-request-error.js +26 -0
- package/packages/lsp-daemon/dist/daemon-server.js +5 -1
- package/packages/lsp-daemon/dist/index.js +137 -48
- package/packages/lsp-daemon/dist/proxy.d.ts +2 -0
- package/packages/lsp-daemon/dist/proxy.js +1 -0
- package/packages/lsp-daemon/dist/version-reap.d.ts +26 -0
- package/packages/lsp-daemon/dist/version-reap.js +182 -0
- package/packages/lsp-tools-mcp/dist/cli.js +61 -10
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +6 -1
- package/packages/lsp-tools-mcp/dist/mcp.js +61 -10
- package/packages/lsp-tools-mcp/dist/tools.js +6 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +416 -25
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +22 -2
- package/packages/omo-codex/plugin/components/codegraph/AGENTS.md +7 -6
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +638 -267
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +178 -89
- package/packages/omo-codex/plugin/components/codegraph/package.json +2 -2
- package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +3 -1
- package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +3 -1
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +98 -32
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +5 -0
- package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +15 -6
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +6 -2
- package/packages/omo-codex/plugin/components/codegraph/src/sweep-cli.ts +1 -0
- package/packages/omo-codex/plugin/components/codegraph/test/hook-exclusion.test.ts +1 -1
- package/packages/omo-codex/plugin/components/codegraph/test/hook-store-upgrade.test.ts +148 -0
- package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +31 -2
- package/packages/omo-codex/plugin/components/codegraph/test/package-runtime.test.ts +1 -1
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge-lifecycle.test.ts +65 -1
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +3 -7
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-facade.test.ts +1 -1
- package/packages/omo-codex/plugin/components/codegraph/test/serve-provision.test.ts +57 -3
- package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable.test.ts +41 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +109 -8
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-node-support.test.ts +2 -2
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +43 -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/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/AGENTS.md +1 -0
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +80 -40
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +11 -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/post-compact-budget.ts +11 -0
- package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +60 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/AGENTS.md +8 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +147 -60
- 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/src/boulder-reader.ts +3 -71
- package/packages/omo-codex/plugin/components/start-work-continuation/src/plan-checklist.ts +171 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/boulder-reader.test.ts +198 -23
- package/packages/omo-codex/plugin/components/start-work-continuation/test/cli.test.ts +4 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +6 -5
- package/packages/omo-codex/plugin/components/start-work-continuation/test/fixtures/plan-scaffold.md +15 -0
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- 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.md +10 -10
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/agents/momus.toml +3 -3
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +1 -1
- 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 +31 -8
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +117 -6
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/scaffold-plan.mjs +46 -10
- package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +42 -0
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +6 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.d.ts +21 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.js +64 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +15 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +3 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.d.ts +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +85 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.d.ts +0 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +13 -33
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +998 -593
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.d.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.js +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +10 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-verdicts.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-batch.d.ts +15 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-batch.js +84 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-mutations.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-mutations.js +81 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +7 -59
- package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +12 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/validation-batch.d.ts +9 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/validation-batch.js +122 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +8 -6
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-continuation.ts +84 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +13 -2
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-arg-parser.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +3 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +49 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +13 -45
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/constants.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +7 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/goal-status.ts +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +4 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +20 -2
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-verdicts.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-batch.ts +125 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-mutations.ts +59 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +6 -58
- package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +12 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/validation-batch.ts +122 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +76 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-checkpoint-continuation.test.ts +111 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-batch.test.ts +67 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-validation-batch.test.ts +57 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/paths.test.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering-batch.test.ts +152 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +29 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/validation-batch-checkpoint.test.ts +147 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/validation-batch.test.ts +73 -0
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +2 -2
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +2 -2
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +2 -2
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +41 -41
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +32 -28
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +17 -45
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/toml-section-editor.mjs +455 -0
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +3 -18
- package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +43 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/check-no-excuse-rules.ts +35 -5
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +8 -6
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +31 -8
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +117 -6
- package/packages/omo-codex/plugin/skills/ulw-plan/scripts/scaffold-plan.mjs +46 -10
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +11 -11
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +26 -0
- package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +41 -0
- package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +2 -2
- package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +6 -6
- package/packages/omo-codex/plugin/test/multi-agent-v2-regression.test.mjs +3 -3
- package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +62 -0
- package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +271 -14
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +3 -18
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +0 -5
- package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +293 -0
- package/packages/omo-codex/scripts/install-config.test.mjs +10 -10
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +401 -22
- package/packages/omo-codex/scripts/install-generated-bundle.test.mjs +39 -2
- package/packages/omo-codex/scripts/install-marketplace-cache.test.mjs +4 -1
- package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.test.ts +87 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.ts +35 -5
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +31 -8
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +117 -6
- package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +46 -10
- package/packages/shared-skills/skills/ulw-research/SKILL.md +3 -3
- package/dist/features/builtin-commands/templates/ralph-loop.d.ts +0 -3
- package/dist/skills/ultraresearch/SKILL.md +0 -10
- package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +0 -273
- package/packages/shared-skills/skills/lcx-contribute-bug-fix/agents/openai.yaml +0 -12
- package/packages/shared-skills/skills/lcx-contribute-bug-fix/scripts/create-pr-body.mjs +0 -107
- package/packages/shared-skills/skills/lcx-doctor/SKILL.md +0 -128
- package/packages/shared-skills/skills/lcx-doctor/agents/openai.yaml +0 -11
- package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +0 -268
- package/packages/shared-skills/skills/lcx-report-bug/agents/openai.yaml +0 -11
- package/packages/shared-skills/skills/ultraresearch/SKILL.md +0 -10
- /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-contribute-bug-fix/SKILL.md +0 -0
- /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-contribute-bug-fix/agents/openai.yaml +0 -0
- /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-contribute-bug-fix/scripts/create-pr-body.mjs +0 -0
- /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-doctor/SKILL.md +0 -0
- /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-doctor/agents/openai.yaml +0 -0
- /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-report-bug/SKILL.md +0 -0
- /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-report-bug/agents/openai.yaml +0 -0
|
@@ -50,6 +50,7 @@ var SAFE_AMBIENT_ENV_KEYS = new Set([
|
|
|
50
50
|
var SAFE_CODEGRAPH_RUNTIME_ENV_KEYS = new Set([
|
|
51
51
|
"CODEGRAPH_ALLOW_UNSAFE_NODE",
|
|
52
52
|
"CODEGRAPH_BIN",
|
|
53
|
+
"CODEGRAPH_DAEMON_IDLE_TIMEOUT_MS",
|
|
53
54
|
"CODEGRAPH_FAKE_LOG",
|
|
54
55
|
"CODEGRAPH_NO_DAEMON",
|
|
55
56
|
"CODEGRAPH_NODE_BIN",
|
|
@@ -61,7 +62,7 @@ function buildCodegraphEnv(options = {}) {
|
|
|
61
62
|
const homeDir = options.homeDir ?? homedir();
|
|
62
63
|
return {
|
|
63
64
|
[CODEGRAPH_INSTALL_DIR_ENV]: join(homeDir, ".omo", "codegraph"),
|
|
64
|
-
[CODEGRAPH_NO_DAEMON_ENV]: "1",
|
|
65
|
+
...options.daemon === true ? {} : { [CODEGRAPH_NO_DAEMON_ENV]: "1" },
|
|
65
66
|
[CODEGRAPH_NO_DOWNLOAD_ENV]: "1",
|
|
66
67
|
[CODEGRAPH_TELEMETRY_ENV]: "0",
|
|
67
68
|
[DO_NOT_TRACK_ENV]: "1"
|
|
@@ -88,6 +89,44 @@ function buildCodegraphChildEnv(options = {}) {
|
|
|
88
89
|
return env;
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
// ../../../../utils/src/codegraph/manifest.ts
|
|
93
|
+
var CODEGRAPH_PINNED_VERSION = "1.4.1";
|
|
94
|
+
var CODEGRAPH_PROVISION_MANIFEST = {
|
|
95
|
+
assets: {
|
|
96
|
+
"darwin-arm64": {
|
|
97
|
+
executableName: "codegraph",
|
|
98
|
+
sha256: "4a679ae5a5cb9fff900dd59bb786da6a581b7f68f4cf713bdedd137e347d34dc",
|
|
99
|
+
url: "https://github.com/colbymchenry/codegraph/releases/download/v1.4.1/codegraph-darwin-arm64.tar.gz"
|
|
100
|
+
},
|
|
101
|
+
"darwin-x64": {
|
|
102
|
+
executableName: "codegraph",
|
|
103
|
+
sha256: "436f96943cfd926ea6d0a8454f18833d21254d5fd9b3d224317b1426132def95",
|
|
104
|
+
url: "https://github.com/colbymchenry/codegraph/releases/download/v1.4.1/codegraph-darwin-x64.tar.gz"
|
|
105
|
+
},
|
|
106
|
+
"linux-arm64": {
|
|
107
|
+
executableName: "codegraph",
|
|
108
|
+
sha256: "0d62c5eb2722f8d19d20f7a1bd974445e18d5294cb59be116a0c3d55ce87591f",
|
|
109
|
+
url: "https://github.com/colbymchenry/codegraph/releases/download/v1.4.1/codegraph-linux-arm64.tar.gz"
|
|
110
|
+
},
|
|
111
|
+
"linux-x64": {
|
|
112
|
+
executableName: "codegraph",
|
|
113
|
+
sha256: "fb585ff5018d6faaa46d282b61f4f689bc7967ed8a1b467a5c556dd7ced9b542",
|
|
114
|
+
url: "https://github.com/colbymchenry/codegraph/releases/download/v1.4.1/codegraph-linux-x64.tar.gz"
|
|
115
|
+
},
|
|
116
|
+
"win32-arm64": {
|
|
117
|
+
executableName: "codegraph.cmd",
|
|
118
|
+
sha256: "e2a2a28c802a79804c7df203afa50bd461309c6c180ce3f76079fdc7cddc7697",
|
|
119
|
+
url: "https://registry.npmjs.org/@colbymchenry/codegraph-win32-arm64/-/codegraph-win32-arm64-1.4.1.tgz"
|
|
120
|
+
},
|
|
121
|
+
"win32-x64": {
|
|
122
|
+
executableName: "codegraph.cmd",
|
|
123
|
+
sha256: "4f08700fda5f4a03ad5b2956135c5788d739a351b3433db2b5820e5d5224c30d",
|
|
124
|
+
url: "https://registry.npmjs.org/@colbymchenry/codegraph-win32-x64/-/codegraph-win32-x64-1.4.1.tgz"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
version: CODEGRAPH_PINNED_VERSION
|
|
128
|
+
};
|
|
129
|
+
|
|
91
130
|
// ../../../../utils/src/codegraph/node-support.ts
|
|
92
131
|
var CODEGRAPH_MIN_NODE_MAJOR = 20;
|
|
93
132
|
var CODEGRAPH_BLOCKED_NODE_MAJOR = 25;
|
|
@@ -125,45 +164,6 @@ import { existsSync } from "node:fs";
|
|
|
125
164
|
import { homedir as homedir2, hostname } from "node:os";
|
|
126
165
|
import { basename, join as join2 } from "node:path";
|
|
127
166
|
import { promisify } from "node:util";
|
|
128
|
-
|
|
129
|
-
// ../../../../utils/src/codegraph/manifest.ts
|
|
130
|
-
var CODEGRAPH_PROVISION_MANIFEST = {
|
|
131
|
-
assets: {
|
|
132
|
-
"darwin-arm64": {
|
|
133
|
-
executableName: "codegraph",
|
|
134
|
-
sha256: "95bb27bf6382b69659e158e0c04d71cc394778951e1317d582be7807e7866908",
|
|
135
|
-
url: "https://github.com/colbymchenry/codegraph/releases/download/v1.0.1/codegraph-darwin-arm64.tar.gz"
|
|
136
|
-
},
|
|
137
|
-
"darwin-x64": {
|
|
138
|
-
executableName: "codegraph",
|
|
139
|
-
sha256: "3311cc1d1f0f0ad742709b6a43d8a9187b1ef0af0dd30e0b58008dc673e29478",
|
|
140
|
-
url: "https://github.com/colbymchenry/codegraph/releases/download/v1.0.1/codegraph-darwin-x64.tar.gz"
|
|
141
|
-
},
|
|
142
|
-
"linux-arm64": {
|
|
143
|
-
executableName: "codegraph",
|
|
144
|
-
sha256: "e16f612bc96c2ebccd04574cbed500c9939147c80666ad6bb024398dff7992ae",
|
|
145
|
-
url: "https://github.com/colbymchenry/codegraph/releases/download/v1.0.1/codegraph-linux-arm64.tar.gz"
|
|
146
|
-
},
|
|
147
|
-
"linux-x64": {
|
|
148
|
-
executableName: "codegraph",
|
|
149
|
-
sha256: "d45a068f44596a85c7ba7d0ef924eaf7103fbbf3cafbeb668127daff60a52228",
|
|
150
|
-
url: "https://github.com/colbymchenry/codegraph/releases/download/v1.0.1/codegraph-linux-x64.tar.gz"
|
|
151
|
-
},
|
|
152
|
-
"win32-arm64": {
|
|
153
|
-
executableName: "codegraph.cmd",
|
|
154
|
-
sha256: "8d57ced73b24d35f758f2ede2318e80e1d7241987f37a999e3d80edb6fddf961",
|
|
155
|
-
url: "https://registry.npmjs.org/@colbymchenry/codegraph-win32-arm64/-/codegraph-win32-arm64-1.0.1.tgz"
|
|
156
|
-
},
|
|
157
|
-
"win32-x64": {
|
|
158
|
-
executableName: "codegraph.cmd",
|
|
159
|
-
sha256: "52607fe73b05e741fd1087da2ceca9d3c8f565e36bf1a7070600bdbdf3931e32",
|
|
160
|
-
url: "https://registry.npmjs.org/@colbymchenry/codegraph-win32-x64/-/codegraph-win32-x64-1.0.1.tgz"
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
version: "1.0.1"
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
// ../../../../utils/src/codegraph/provision.ts
|
|
167
167
|
var DEFAULT_LOCK_WAIT_MS = 5000;
|
|
168
168
|
var DEFAULT_LOCK_STALE_MS = 120000;
|
|
169
169
|
var DEFAULT_DOWNLOAD_TIMEOUT_MS = 60000;
|
|
@@ -1490,8 +1490,9 @@ function parseJsoncSafe(content) {
|
|
|
1490
1490
|
var HARNESS_IDS = ["codex", "opencode", "omo"];
|
|
1491
1491
|
var SETTING_HARNESS_SUPPORT = {
|
|
1492
1492
|
"codegraph.auto_provision": HARNESS_IDS,
|
|
1493
|
+
"codegraph.daemon": ["codex", "opencode"],
|
|
1493
1494
|
"codegraph.enabled": HARNESS_IDS,
|
|
1494
|
-
"codegraph.excluded_roots": ["codex"],
|
|
1495
|
+
"codegraph.excluded_roots": ["codex", "opencode"],
|
|
1495
1496
|
"codegraph.install_dir": HARNESS_IDS,
|
|
1496
1497
|
"codegraph.telemetry": HARNESS_IDS,
|
|
1497
1498
|
"codegraph.watch_debounce_ms": ["opencode", "omo"]
|
|
@@ -1508,6 +1509,7 @@ var BUILT_IN_DEFAULTS = {
|
|
|
1508
1509
|
var HARNESS_BLOCK_KEYS = HARNESS_IDS.map((harness) => `[${harness}]`);
|
|
1509
1510
|
var CODEGRAPH_SETTING_KEYS = [
|
|
1510
1511
|
"auto_provision",
|
|
1512
|
+
"daemon",
|
|
1511
1513
|
"enabled",
|
|
1512
1514
|
"excluded_roots",
|
|
1513
1515
|
"install_dir",
|
|
@@ -1581,6 +1583,10 @@ function setCodegraphSetting(config, key, value) {
|
|
|
1581
1583
|
if (typeof value === "boolean")
|
|
1582
1584
|
config.auto_provision = value;
|
|
1583
1585
|
return;
|
|
1586
|
+
case "daemon":
|
|
1587
|
+
if (typeof value === "boolean")
|
|
1588
|
+
config.daemon = value;
|
|
1589
|
+
return;
|
|
1584
1590
|
case "enabled":
|
|
1585
1591
|
if (typeof value === "boolean")
|
|
1586
1592
|
config.enabled = value;
|
|
@@ -2043,16 +2049,35 @@ function bufferFromChunk(chunk) {
|
|
|
2043
2049
|
|
|
2044
2050
|
// ../../../../mcp-stdio-core/src/server.ts
|
|
2045
2051
|
var DEFAULT_IDLE_TIMEOUT_MS = 10 * 60000;
|
|
2052
|
+
var DEFAULT_PARENT_POLL_INTERVAL_MS = 30000;
|
|
2046
2053
|
var noopLog = () => {};
|
|
2054
|
+
function isProcessAlive(pid) {
|
|
2055
|
+
try {
|
|
2056
|
+
process.kill(pid, 0);
|
|
2057
|
+
return true;
|
|
2058
|
+
} catch (error) {
|
|
2059
|
+
return !hasErrorCode(error, "ESRCH");
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2047
2062
|
async function runJsonRpcStdioServer(config) {
|
|
2048
2063
|
const log = config.log ?? noopLog;
|
|
2049
2064
|
const idleTimeoutMs = config.idleTimeoutMs ?? DEFAULT_IDLE_TIMEOUT_MS;
|
|
2050
|
-
|
|
2065
|
+
let isClosed = false;
|
|
2066
|
+
const idleTimer = createIdleTimer(idleTimeoutMs, log, () => {
|
|
2067
|
+
isClosed = true;
|
|
2068
|
+
config.onIdleTimeout?.();
|
|
2069
|
+
});
|
|
2070
|
+
const watchdog = createParentWatchdog(config.parentWatchdog, (parentPid, pollIntervalMs) => {
|
|
2071
|
+
isClosed = true;
|
|
2072
|
+
log("parent_exit", { parent_pid: parentPid, poll_interval_ms: pollIntervalMs });
|
|
2073
|
+
config.onParentExit?.();
|
|
2074
|
+
config.input.destroy();
|
|
2075
|
+
});
|
|
2051
2076
|
log("stdio_started", { cwd: process.cwd(), idle_timeout_ms: idleTimeoutMs });
|
|
2052
2077
|
idleTimer.arm();
|
|
2053
2078
|
try {
|
|
2054
2079
|
for await (const message of readStdioJsonRpcMessages(config.input)) {
|
|
2055
|
-
if (
|
|
2080
|
+
if (isClosed)
|
|
2056
2081
|
break;
|
|
2057
2082
|
idleTimer.arm();
|
|
2058
2083
|
if (message.kind === "parse_error") {
|
|
@@ -2063,8 +2088,12 @@ async function runJsonRpcStdioServer(config) {
|
|
|
2063
2088
|
if (!await handleRequest(message, config, log))
|
|
2064
2089
|
break;
|
|
2065
2090
|
}
|
|
2091
|
+
} catch (error) {
|
|
2092
|
+
if (!(isClosed && hasErrorCode(error, "ERR_STREAM_PREMATURE_CLOSE")))
|
|
2093
|
+
throw error;
|
|
2066
2094
|
} finally {
|
|
2067
2095
|
idleTimer.clear();
|
|
2096
|
+
watchdog.clear();
|
|
2068
2097
|
log("stdio_stopped");
|
|
2069
2098
|
}
|
|
2070
2099
|
}
|
|
@@ -2120,9 +2149,33 @@ function isTerminalOutputError(error) {
|
|
|
2120
2149
|
return false;
|
|
2121
2150
|
return error.code === "EPIPE" || error.code === "ERR_STREAM_DESTROYED" || error.code === "ERR_STREAM_WRITE_AFTER_END";
|
|
2122
2151
|
}
|
|
2123
|
-
function
|
|
2152
|
+
function hasErrorCode(error, code) {
|
|
2153
|
+
return error instanceof Error && "code" in error && error.code === code;
|
|
2154
|
+
}
|
|
2155
|
+
function createParentWatchdog(config, onDeadParent) {
|
|
2156
|
+
if (config === undefined)
|
|
2157
|
+
return { clear: () => {} };
|
|
2158
|
+
const pollIntervalMs = config.pollIntervalMs ?? DEFAULT_PARENT_POLL_INTERVAL_MS;
|
|
2159
|
+
if (pollIntervalMs <= 0)
|
|
2160
|
+
return { clear: () => {} };
|
|
2161
|
+
const parentPid = config.parentPid ?? process.ppid;
|
|
2162
|
+
const probeAlive = config.probeAlive ?? isProcessAlive;
|
|
2163
|
+
let fired = false;
|
|
2164
|
+
const timer = setInterval(() => {
|
|
2165
|
+
if (fired || probeAlive(parentPid))
|
|
2166
|
+
return;
|
|
2167
|
+
fired = true;
|
|
2168
|
+
onDeadParent(parentPid, pollIntervalMs);
|
|
2169
|
+
}, pollIntervalMs);
|
|
2170
|
+
timer.unref();
|
|
2171
|
+
return {
|
|
2172
|
+
clear: () => {
|
|
2173
|
+
clearInterval(timer);
|
|
2174
|
+
}
|
|
2175
|
+
};
|
|
2176
|
+
}
|
|
2177
|
+
function createIdleTimer(idleTimeoutMs, log, onTimeout) {
|
|
2124
2178
|
let timer = null;
|
|
2125
|
-
let isClosed = false;
|
|
2126
2179
|
return {
|
|
2127
2180
|
arm: () => {
|
|
2128
2181
|
if (timer !== null)
|
|
@@ -2130,9 +2183,8 @@ function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
|
|
|
2130
2183
|
if (idleTimeoutMs <= 0)
|
|
2131
2184
|
return;
|
|
2132
2185
|
timer = setTimeout(() => {
|
|
2133
|
-
isClosed = true;
|
|
2134
2186
|
log("idle_timeout", { idle_timeout_ms: idleTimeoutMs });
|
|
2135
|
-
|
|
2187
|
+
onTimeout();
|
|
2136
2188
|
}, idleTimeoutMs);
|
|
2137
2189
|
timer.unref();
|
|
2138
2190
|
},
|
|
@@ -2141,8 +2193,7 @@ function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
|
|
|
2141
2193
|
return;
|
|
2142
2194
|
clearTimeout(timer);
|
|
2143
2195
|
timer = null;
|
|
2144
|
-
}
|
|
2145
|
-
closed: () => isClosed
|
|
2196
|
+
}
|
|
2146
2197
|
};
|
|
2147
2198
|
}
|
|
2148
2199
|
// src/serve-invocation.ts
|
|
@@ -2175,6 +2226,7 @@ class CodegraphBridgeStdioError extends Error {
|
|
|
2175
2226
|
var CODEGRAPH_NODE_DESCRIPTION = "Inspect one named symbol or file. In symbol mode, includeCode=true includes leaf-symbol source when available. Container symbols such as classes, interfaces, structs, enums, modules, and namespaces return structural outlines with member lists by design. For container source, request a specific member symbol or use file mode with symbolsOnly=false plus offset/limit.";
|
|
2176
2227
|
var CODEGRAPH_NODE_INCLUDE_CODE_DESCRIPTION = "Symbol mode: include leaf-symbol source when available. Container symbols such as classes, interfaces, structs, enums, modules, and namespaces intentionally return structural outlines with members; request a specific member symbol or use file mode with symbolsOnly=false plus offset/limit for source.";
|
|
2177
2228
|
var CODEGRAPH_CONTAINER_OUTLINE_GUIDANCE = "Container symbols intentionally return structural outlines with members. For source, request a specific member symbol or call codegraph_node in file mode with symbolsOnly=false plus offset/limit around the symbol location.";
|
|
2229
|
+
var SIGKILL_ESCALATION_MS = 2000;
|
|
2178
2230
|
async function runBridgedCodegraphProcess(command, args, options) {
|
|
2179
2231
|
const invocation = resolveServeProcessInvocation(command, args);
|
|
2180
2232
|
const child = spawn(invocation.command, invocation.args, {
|
|
@@ -2200,17 +2252,24 @@ async function runBridgedCodegraphProcess(command, args, options) {
|
|
|
2200
2252
|
resolveExit(signal === null ? 0 : 1);
|
|
2201
2253
|
});
|
|
2202
2254
|
});
|
|
2203
|
-
const clientForwardingDone = forwardClientToCodegraph(options.input, childInput, pendingResponses, (mode) => {
|
|
2204
|
-
defaultResponseMode = mode;
|
|
2205
|
-
});
|
|
2206
|
-
const responseForwardingDone = forwardCodegraphToClient(childOutput, options.output, pendingResponses, () => defaultResponseMode);
|
|
2207
|
-
const bridgeDone = Promise.all([clientForwardingDone, responseForwardingDone]);
|
|
2208
|
-
const childAndResponsesDone = Promise.all([childExit, responseForwardingDone]).then(([exitCode]) => exitCode);
|
|
2209
2255
|
const destroyChildPipes = () => {
|
|
2210
2256
|
childInput.destroy();
|
|
2211
2257
|
childOutput.destroy();
|
|
2212
2258
|
};
|
|
2213
2259
|
childExit.then(destroyChildPipes, destroyChildPipes);
|
|
2260
|
+
let parentWatchdogFired = false;
|
|
2261
|
+
const parentWatchdog = createParentWatchdog(options.parentWatchdog, () => {
|
|
2262
|
+
parentWatchdogFired = true;
|
|
2263
|
+
options.input.destroy();
|
|
2264
|
+
destroyChildPipes();
|
|
2265
|
+
terminateCodegraphChild(child);
|
|
2266
|
+
});
|
|
2267
|
+
const clientForwardingDone = forwardClientToCodegraph(options.input, childInput, pendingResponses, (mode) => {
|
|
2268
|
+
defaultResponseMode = mode;
|
|
2269
|
+
}, () => parentWatchdogFired);
|
|
2270
|
+
const responseForwardingDone = forwardCodegraphToClient(childOutput, options.output, pendingResponses, () => defaultResponseMode, () => parentWatchdogFired);
|
|
2271
|
+
const bridgeDone = Promise.all([clientForwardingDone, responseForwardingDone]);
|
|
2272
|
+
const childAndResponsesDone = Promise.all([childExit, responseForwardingDone]).then(([exitCode]) => exitCode);
|
|
2214
2273
|
try {
|
|
2215
2274
|
return await Promise.race([childAndResponsesDone, bridgeDone.then(() => childExit)]);
|
|
2216
2275
|
} catch (error) {
|
|
@@ -2221,39 +2280,66 @@ async function runBridgedCodegraphProcess(command, args, options) {
|
|
|
2221
2280
|
return;
|
|
2222
2281
|
});
|
|
2223
2282
|
throw error;
|
|
2283
|
+
} finally {
|
|
2284
|
+
parentWatchdog.clear();
|
|
2224
2285
|
}
|
|
2225
2286
|
}
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2287
|
+
function terminateCodegraphChild(child) {
|
|
2288
|
+
if (child.exitCode !== null || child.signalCode !== null)
|
|
2289
|
+
return;
|
|
2290
|
+
child.kill("SIGTERM");
|
|
2291
|
+
const escalation = setTimeout(() => {
|
|
2292
|
+
if (child.exitCode === null && child.signalCode === null)
|
|
2293
|
+
child.kill("SIGKILL");
|
|
2294
|
+
}, SIGKILL_ESCALATION_MS);
|
|
2295
|
+
escalation.unref();
|
|
2296
|
+
}
|
|
2297
|
+
function isWatchdogTeardownError(error) {
|
|
2298
|
+
if (!(error instanceof Error) || !("code" in error))
|
|
2299
|
+
return false;
|
|
2300
|
+
return error.code === "ERR_STREAM_PREMATURE_CLOSE" || error.code === "ERR_STREAM_DESTROYED" || error.code === "ERR_STREAM_WRITE_AFTER_END" || error.code === "EPIPE";
|
|
2301
|
+
}
|
|
2302
|
+
async function forwardClientToCodegraph(input, childInput, pendingResponses, setDefaultResponseMode, tolerateWatchdogClose) {
|
|
2303
|
+
try {
|
|
2304
|
+
for await (const message of readStdioJsonRpcMessages(input)) {
|
|
2305
|
+
if (message.kind === "parse_error") {
|
|
2306
|
+
continue;
|
|
2307
|
+
}
|
|
2308
|
+
const responseMode = message.responseMode;
|
|
2309
|
+
setDefaultResponseMode(responseMode);
|
|
2310
|
+
const key = responseModeKey(message.payload);
|
|
2311
|
+
if (key !== null) {
|
|
2312
|
+
pendingResponses.set(key, {
|
|
2313
|
+
method: jsonRpcMethod(message.payload),
|
|
2314
|
+
responseMode,
|
|
2315
|
+
toolName: jsonRpcToolName(message.payload)
|
|
2316
|
+
});
|
|
2317
|
+
}
|
|
2318
|
+
await writeLine(childInput, JSON.stringify(message.payload));
|
|
2240
2319
|
}
|
|
2241
|
-
|
|
2320
|
+
childInput.end();
|
|
2321
|
+
} catch (error) {
|
|
2322
|
+
if (!(tolerateWatchdogClose() && isWatchdogTeardownError(error)))
|
|
2323
|
+
throw error;
|
|
2242
2324
|
}
|
|
2243
|
-
childInput.end();
|
|
2244
2325
|
}
|
|
2245
|
-
async function forwardCodegraphToClient(childOutput, output, pendingResponses, defaultResponseMode) {
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2326
|
+
async function forwardCodegraphToClient(childOutput, output, pendingResponses, defaultResponseMode, tolerateWatchdogClose) {
|
|
2327
|
+
try {
|
|
2328
|
+
for await (const message of readStdioJsonRpcMessages(childOutput)) {
|
|
2329
|
+
if (message.kind === "parse_error") {
|
|
2330
|
+
await writeStdioJsonRpcResponse(output, errorResponse(null, -32700, "Parse error", message.message), defaultResponseMode());
|
|
2331
|
+
continue;
|
|
2332
|
+
}
|
|
2333
|
+
const key = responseModeKey(message.payload);
|
|
2334
|
+
const pendingResponse = key === null ? undefined : pendingResponses.get(key);
|
|
2335
|
+
const responseMode = pendingResponse?.responseMode ?? defaultResponseMode();
|
|
2336
|
+
if (key !== null)
|
|
2337
|
+
pendingResponses.delete(key);
|
|
2338
|
+
await writeStdioJsonRpcResponse(output, clarifyCodegraphResponse(message.payload, pendingResponse), responseMode);
|
|
2250
2339
|
}
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
if (key !== null)
|
|
2255
|
-
pendingResponses.delete(key);
|
|
2256
|
-
await writeStdioJsonRpcResponse(output, clarifyCodegraphResponse(message.payload, pendingResponse), responseMode);
|
|
2340
|
+
} catch (error) {
|
|
2341
|
+
if (!(tolerateWatchdogClose() && isWatchdogTeardownError(error)))
|
|
2342
|
+
throw error;
|
|
2257
2343
|
}
|
|
2258
2344
|
}
|
|
2259
2345
|
function responseModeKey(payload) {
|
|
@@ -2385,7 +2471,8 @@ async function runUnavailableCodegraphMcpServer(options) {
|
|
|
2385
2471
|
serverVersion: options.serverVersion
|
|
2386
2472
|
},
|
|
2387
2473
|
input: options.input,
|
|
2388
|
-
output: options.output
|
|
2474
|
+
output: options.output,
|
|
2475
|
+
parentWatchdog: options.parentWatchdog ?? {}
|
|
2389
2476
|
});
|
|
2390
2477
|
}
|
|
2391
2478
|
async function handleUnavailableCodegraphMcpRequest(input, options) {
|
|
@@ -2434,7 +2521,7 @@ var CODEGRAPH_DISABLED_HINT = `CodeGraph MCP skipped: disabled by OMO SOT config
|
|
|
2434
2521
|
`;
|
|
2435
2522
|
var CODEGRAPH_EXCLUDED_HINT = `CodeGraph MCP skipped: project excluded by OMO CodeGraph policy.
|
|
2436
2523
|
`;
|
|
2437
|
-
var CODEGRAPH_VERSION =
|
|
2524
|
+
var CODEGRAPH_VERSION = CODEGRAPH_PINNED_VERSION;
|
|
2438
2525
|
var PROJECT_CWD_ENV_KEYS = ["OMO_CODEGRAPH_PROJECT_CWD", SESSION_START_CWD_ENV, "PWD"];
|
|
2439
2526
|
async function runCodegraphServe(options = {}) {
|
|
2440
2527
|
const env = options.env ?? processEnv;
|
|
@@ -2482,7 +2569,7 @@ async function runCodegraphServe(options = {}) {
|
|
|
2482
2569
|
return runUnavailableMcp(buildCodegraphNodeSkipHint(nodeSupport), options);
|
|
2483
2570
|
}
|
|
2484
2571
|
const runProcess = options.runProcess ?? runBridgedCodegraphProcess;
|
|
2485
|
-
const codegraphEnv = codegraphEnvForConfig(trustedInstallDir, homeDir, options.buildEnv);
|
|
2572
|
+
const codegraphEnv = codegraphEnvForConfig(trustedInstallDir, homeDir, codegraphConfig.daemon === true, options.buildEnv);
|
|
2486
2573
|
const mergedEnv = buildCodegraphChildEnv({ ambientEnv: env, codegraphEnv, runtimeEnv: env });
|
|
2487
2574
|
return runProcess(resolution.command, [...resolution.argsPrefix, "serve", "--mcp"], {
|
|
2488
2575
|
cwd: projectCwd,
|
|
@@ -2490,7 +2577,8 @@ async function runCodegraphServe(options = {}) {
|
|
|
2490
2577
|
input: options.stdin ?? processStdin,
|
|
2491
2578
|
output: options.stdout ?? processStdout,
|
|
2492
2579
|
stderr: options.stderr ?? processStderr,
|
|
2493
|
-
stdio: "pipe"
|
|
2580
|
+
stdio: "pipe",
|
|
2581
|
+
parentWatchdog: options.parentWatchdog ?? {}
|
|
2494
2582
|
});
|
|
2495
2583
|
}
|
|
2496
2584
|
async function runUnavailableMcp(reason, options) {
|
|
@@ -2499,7 +2587,8 @@ async function runUnavailableMcp(reason, options) {
|
|
|
2499
2587
|
input: options.stdin ?? processStdin,
|
|
2500
2588
|
output: options.stdout ?? processStdout,
|
|
2501
2589
|
reason,
|
|
2502
|
-
serverVersion: CODEGRAPH_VERSION
|
|
2590
|
+
serverVersion: CODEGRAPH_VERSION,
|
|
2591
|
+
parentWatchdog: options.parentWatchdog ?? {}
|
|
2503
2592
|
});
|
|
2504
2593
|
return 0;
|
|
2505
2594
|
}
|
|
@@ -2528,8 +2617,8 @@ function shouldSkipResolvedCommand(resolution, commandExists) {
|
|
|
2528
2617
|
function looksLikePath2(command) {
|
|
2529
2618
|
return command.includes("/") || command.includes("\\");
|
|
2530
2619
|
}
|
|
2531
|
-
function codegraphEnvForConfig(trustedInstallDir, homeDir, buildEnv) {
|
|
2532
|
-
const env =
|
|
2620
|
+
function codegraphEnvForConfig(trustedInstallDir, homeDir, daemon, buildEnv) {
|
|
2621
|
+
const env = buildEnv?.({ daemon, homeDir }) ?? buildCodegraphEnv({ daemon, homeDir });
|
|
2533
2622
|
return trustedInstallDir === undefined ? env : { ...env, CODEGRAPH_INSTALL_DIR: trustedInstallDir };
|
|
2534
2623
|
}
|
|
2535
2624
|
function resolveProjectCwd(env, fallback) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sisyphuslabs/codex-codegraph",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.1",
|
|
4
4
|
"description": "Codex plugin MCP wrapper for CodeGraph.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": true,
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"typescript": "^6.0.3"
|
|
26
26
|
},
|
|
27
27
|
"optionalDependencies": {
|
|
28
|
-
"@colbymchenry/codegraph": "1.
|
|
28
|
+
"@colbymchenry/codegraph": "1.4.1"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|
|
31
31
|
"node": ">=20.0.0"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Readable } from "node:stream";
|
|
2
2
|
|
|
3
3
|
import type { CodexOmoConfig as SharedCodexOmoConfig } from "../../../shared/src/config-loader.ts";
|
|
4
|
+
import type { CODEGRAPH_PINNED_VERSION } from "../../../../../utils/src/codegraph/manifest.ts";
|
|
4
5
|
import type { SweepCodegraphZombiesOptions } from "../../../../../utils/src/codegraph/process-sweep.ts";
|
|
5
6
|
import type { CodegraphProvisionResult as SharedCodegraphProvisionResult } from "../../../../../utils/src/codegraph/provision.ts";
|
|
6
7
|
import type {
|
|
@@ -58,7 +59,7 @@ export interface CodegraphSessionStartOutcome {
|
|
|
58
59
|
|
|
59
60
|
export interface CodegraphSessionStartDeps {
|
|
60
61
|
readonly ensureGitignored: (projectRoot: string) => boolean;
|
|
61
|
-
readonly ensureProvisioned: (options: { readonly installDir?: string; readonly lockDir: string; readonly version:
|
|
62
|
+
readonly ensureProvisioned: (options: { readonly installDir?: string; readonly lockDir: string; readonly version: typeof CODEGRAPH_PINNED_VERSION }) => Promise<CodegraphProvisionResult>;
|
|
62
63
|
readonly prepareWorkspace: (projectRoot: string, options: { readonly homeDir: string }) => CodegraphWorkspacePreparation;
|
|
63
64
|
readonly resolveCommand: (options?: ResolveCodegraphCommandOptions) => CodegraphCommandResolution;
|
|
64
65
|
readonly runCommand: (
|
|
@@ -76,6 +77,7 @@ export interface SessionStartHookOptions {
|
|
|
76
77
|
readonly env?: Record<string, string | undefined>;
|
|
77
78
|
readonly spawnWorker?: (invocation: WorkerSpawnInvocation) => void;
|
|
78
79
|
readonly statusProbe?: (options: {
|
|
80
|
+
readonly daemon: boolean;
|
|
79
81
|
readonly env: Record<string, string | undefined>;
|
|
80
82
|
readonly homeDir: string;
|
|
81
83
|
readonly projectRoot: string;
|
|
@@ -87,6 +87,7 @@ export async function executeCodegraphSessionStartHook(options: SessionStartHook
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
const isInitialized = await (options.statusProbe ?? isCodegraphProjectInitialized)({
|
|
90
|
+
daemon: config.codegraph?.daemon === true,
|
|
90
91
|
env,
|
|
91
92
|
homeDir,
|
|
92
93
|
projectRoot,
|
|
@@ -110,6 +111,7 @@ export async function executeCodegraphSessionStartHook(options: SessionStartHook
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
async function isCodegraphProjectInitialized(options: {
|
|
114
|
+
readonly daemon: boolean;
|
|
113
115
|
readonly env: Record<string, string | undefined>;
|
|
114
116
|
readonly homeDir: string;
|
|
115
117
|
readonly projectRoot: string;
|
|
@@ -124,7 +126,7 @@ async function isCodegraphProjectInitialized(options: {
|
|
|
124
126
|
|
|
125
127
|
const invocation = resolveCodegraphCommandInvocation(resolved.command, [...resolved.argsPrefix, "status", "--json"]);
|
|
126
128
|
const codegraphEnv = {
|
|
127
|
-
...buildCodegraphEnv({ homeDir: options.homeDir }),
|
|
129
|
+
...buildCodegraphEnv({ daemon: options.daemon, homeDir: options.homeDir }),
|
|
128
130
|
...(options.trustedCodegraphInstallDir === undefined ? {} : { CODEGRAPH_INSTALL_DIR: options.trustedCodegraphInstallDir }),
|
|
129
131
|
};
|
|
130
132
|
const status = await runStatusProbe(
|