oh-my-opencode 4.19.4 → 5.0.0-beta.10
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/publish.md +44 -16
- package/.agents/skills/publish/SKILL.md +44 -16
- package/.agents/skills/work-with-pr/SKILL.md +37 -23
- package/.opencode/command/publish.md +44 -16
- package/.opencode/skills/work-with-pr/SKILL.md +37 -23
- package/README.ja.md +1 -1
- package/README.ko.md +1 -1
- package/README.md +18 -6
- package/README.ru.md +1 -1
- package/README.zh-cn.md +1 -1
- package/bin/oh-my-opencode.js +14 -1
- package/bin/oh-my-opencode.test.ts +21 -0
- package/dist/agents/atlas/agent.d.ts +0 -1
- package/dist/agents/sisyphus/grok-4.d.ts +20 -0
- package/dist/agents/sisyphus/index.d.ts +2 -0
- package/dist/agents/sisyphus-agent-config.d.ts +6 -0
- package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
- package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +15 -4
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/index.js +1888 -807
- package/dist/cli/run/on-complete-hook.d.ts +2 -0
- package/dist/cli-node/index.js +1888 -807
- package/dist/config/schema/agent-overrides.d.ts +528 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +495 -0
- package/dist/features/monitor/batcher.d.ts +3 -1
- package/dist/features/monitor/manager-internals.d.ts +1 -0
- package/dist/features/monitor/output-injector-types.d.ts +2 -0
- package/dist/features/monitor/output-injector.d.ts +6 -0
- package/dist/hooks/atlas/final-wave-approval-gate.test-support.d.ts +50 -0
- package/dist/hooks/atlas/system-reminder-templates.d.ts +0 -1
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/unrecoverable-request-error.d.ts +9 -0
- package/dist/hooks/tool-pair-validator/hook.test-support.d.ts +29 -0
- package/dist/hooks/tool-pair-validator/tool-part-ids.d.ts +14 -5
- package/dist/hooks/tool-pair-validator/tool-result-repair.d.ts +4 -3
- package/dist/hooks/tool-pair-validator/types.d.ts +5 -22
- package/dist/index.js +3139 -2232
- package/dist/mcp/lsp.d.ts +1 -0
- package/dist/oh-my-opencode.schema.json +1466 -131
- package/dist/shared/normalize-sdk-response.d.ts +1 -0
- package/dist/shared/shell-env.d.ts +1 -1
- package/dist/shared/tmux/constants.d.ts +1 -1
- package/dist/skills/ast-grep/SOURCE +1 -1
- package/dist/skills/ast-grep/install.ps1 +2 -2
- package/dist/skills/ast-grep/install.sh +1 -1
- package/dist/skills/ast-grep/references/install.md +2 -2
- package/dist/skills/ast-grep/tests/smoke.sh +1 -1
- package/dist/skills/coding-agent-sessions/SKILL.md +3 -2
- package/dist/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/dist/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/dist/skills/frontend/SKILL.md +10 -7
- package/dist/skills/frontend/references/design/_INDEX.md +1 -0
- package/dist/skills/frontend/references/design/stylegallery.md +80 -0
- package/dist/skills/start-work/SKILL.md +54 -9
- package/dist/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/dist/skills/ultimate-browsing/SKILL.md +2 -2
- package/dist/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/dist/skills/ultimate-browsing/engine/__main__.py +8 -1
- package/dist/skills/ultimate-browsing/engine/bias_check.py +11 -0
- package/dist/skills/ultimate-browsing/engine/fetch_chain.py +90 -52
- package/dist/skills/ultimate-browsing/engine/result_schema.py +10 -1
- package/dist/skills/ultimate-browsing/engine/surrogate.py +214 -0
- package/dist/skills/ultimate-browsing/engine/surrogates.yaml +60 -0
- package/dist/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/dist/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +7 -0
- package/dist/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +19 -0
- package/dist/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +1 -0
- package/dist/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +1128 -0
- package/dist/skills/ultimate-browsing/engine/tests/test_surrogate.py +252 -0
- package/dist/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +78 -0
- package/dist/skills/ultimate-browsing/engine/validators.py +46 -0
- package/dist/skills/ultimate-browsing/engine/waf_detector.py +1 -1
- package/dist/skills/ultimate-browsing/engine/waf_profiles.yaml +10 -5
- package/dist/skills/ultimate-browsing/references/agent-reach/social.md +1 -1
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/dist/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/dist/skills/ultimate-browsing/references/insane-search/cache-archive.md +51 -50
- package/dist/skills/ultimate-browsing/references/insane-search/fallback.md +1 -1
- package/dist/skills/ultimate-browsing/references/insane-search/jina.md +8 -2
- package/dist/skills/ultimate-browsing/references/insane-search/naver.md +1 -1
- package/dist/skills/ultimate-browsing/references/insane-search/twitter.md +3 -3
- package/dist/skills/ulw-plan/SKILL.md +3 -3
- package/dist/skills/ulw-plan/references/full-workflow.md +30 -6
- package/dist/skills/ulw-plan/references/intent-clear.md +2 -1
- package/dist/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
- package/dist/skills/ulw-research/SKILL.md +15 -10
- package/dist/tui.js +477 -36
- package/docs/reference/web-terminal-visual-qa.md +1 -1
- package/package.json +34 -24
- package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +60 -7
- package/packages/lsp-core/src/lsp/client-wrapper.ts +69 -16
- package/packages/lsp-core/src/lsp/connection.ts +1 -1
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
- package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
- package/packages/lsp-core/src/tools/navigation.ts +4 -2
- package/packages/lsp-core/src/tools/rename.ts +4 -2
- package/packages/lsp-core/src/tools/symbols.ts +1 -1
- package/packages/lsp-daemon/dist/cli.js +108 -40
- package/packages/lsp-daemon/dist/client.js +123 -55
- package/packages/lsp-daemon/dist/ensure-daemon.d.ts +1 -0
- package/packages/lsp-daemon/dist/ensure-daemon.js +18 -5
- package/packages/lsp-daemon/dist/index.js +111 -43
- package/packages/lsp-tools-mcp/dist/cli.js +77 -23
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +1 -1
- package/packages/lsp-tools-mcp/dist/mcp.js +77 -23
- package/packages/lsp-tools-mcp/dist/tools.js +77 -23
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +268 -92
- 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 +7 -7
- package/packages/omo-codex/plugin/components/bootstrap/src/worker.ts +3 -0
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +220 -10
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +220 -10
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- 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/lazycodex-executor-verify/test/codex-hook.test.ts +3 -17
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +135 -67
- 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/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +16 -23
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
- package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
- package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +37 -69
- package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -15
- package/packages/omo-codex/plugin/components/start-work-continuation/AGENTS.md +4 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/README.md +5 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +2 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +18 -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/src/codex-hook.ts +21 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/cli.test.ts +0 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +107 -16
- 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/teammode/test/thread-title-hook.test.ts +3 -9
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +24 -12
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +24 -12
- 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/CHANGELOG.md +2 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.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-low.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +9 -2
- 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/ultrawork/SKILL.md +9 -2
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +3 -3
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +30 -6
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
- package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
- package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +11 -11
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +9 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +1 -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 +9 -9
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +66 -66
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +2 -2
- 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/SKILL.md +5 -4
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +23 -25
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +9 -9
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-commands.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-helpers.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-kind-guidance.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +2 -5
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/quality-gate-builder.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +7 -40
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-roles.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +20 -20
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +4 -4
- package/packages/omo-codex/plugin/skills/ast-grep/SOURCE +1 -1
- package/packages/omo-codex/plugin/skills/ast-grep/install.ps1 +2 -2
- package/packages/omo-codex/plugin/skills/ast-grep/install.sh +1 -1
- package/packages/omo-codex/plugin/skills/ast-grep/references/install.md +2 -2
- package/packages/omo-codex/plugin/skills/ast-grep/tests/smoke.sh +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +10 -7
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +54 -9
- package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/__main__.py +8 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/bias_check.py +11 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/fetch_chain.py +90 -52
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/result_schema.py +10 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/surrogate.py +214 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/surrogates.yaml +60 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +7 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +19 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +1 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +1128 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate.py +252 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +78 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/validators.py +46 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/waf_detector.py +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/waf_profiles.yaml +10 -5
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/social.md +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/cache-archive.md +51 -50
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/fallback.md +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/jina.md +8 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/naver.md +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/twitter.md +3 -3
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +9 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +5 -4
- package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +23 -25
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +3 -3
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +30 -6
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/omo-codex/plugin/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +15 -10
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -24
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
- package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
- package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
- package/packages/omo-codex/plugin/test/bootstrap-binlinks.test.mjs +12 -12
- package/packages/omo-codex/plugin/test/bootstrap-orchestration.test.mjs +36 -4
- package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
- package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +4 -4
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
- package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
- package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
- package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
- package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
- package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
- package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
- package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
- package/packages/omo-codex/scripts/install-bin-links.test.mjs +56 -2
- package/packages/omo-codex/scripts/install-delegated-command.test.mjs +6 -6
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +170 -78
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
- package/packages/omo-codex/scripts/install-local-entrypoint.test.mjs +4 -4
- package/packages/omo-codex/scripts/install-local.test.mjs +5 -2
- package/packages/shared-skills/index.mjs +19 -1
- package/packages/shared-skills/skills/ast-grep/SOURCE +1 -1
- package/packages/shared-skills/skills/ast-grep/install.ps1 +2 -2
- package/packages/shared-skills/skills/ast-grep/install.sh +1 -1
- package/packages/shared-skills/skills/ast-grep/references/install.md +2 -2
- package/packages/shared-skills/skills/ast-grep/tests/smoke.sh +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/packages/shared-skills/skills/frontend/SKILL.md +10 -7
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/shared-skills/skills/start-work/SKILL.md +54 -9
- package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +2 -2
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/__main__.py +8 -1
- package/packages/shared-skills/skills/ultimate-browsing/engine/bias_check.py +11 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/fetch_chain.py +90 -52
- package/packages/shared-skills/skills/ultimate-browsing/engine/result_schema.py +10 -1
- package/packages/shared-skills/skills/ultimate-browsing/engine/surrogate.py +214 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/surrogates.yaml +60 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +7 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +19 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +1 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +1128 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_surrogate.py +252 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +78 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/validators.py +46 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/waf_detector.py +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/engine/waf_profiles.yaml +10 -5
- package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/social.md +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/cache-archive.md +51 -50
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/fallback.md +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/jina.md +8 -2
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/naver.md +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/twitter.md +3 -3
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +3 -3
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +30 -6
- package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/SKILL.md +15 -10
- package/postinstall.mjs +6 -0
- package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
- package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
|
@@ -8,7 +8,7 @@ import { argv, execPath as execPath2, stderr } from "node:process";
|
|
|
8
8
|
import { stdin as processStdin } from "node:process";
|
|
9
9
|
|
|
10
10
|
// src/codex-hook.ts
|
|
11
|
-
import { readFileSync as readFileSync9, realpathSync as
|
|
11
|
+
import { readFileSync as readFileSync9, realpathSync as realpathSync7 } from "node:fs";
|
|
12
12
|
import { homedir as homedir3 } from "node:os";
|
|
13
13
|
import { join as join11, resolve as resolve11 } from "node:path";
|
|
14
14
|
|
|
@@ -18,10 +18,10 @@ import { AsyncLocalStorage } from "node:async_hooks";
|
|
|
18
18
|
import { existsSync, realpathSync, statSync } from "node:fs";
|
|
19
19
|
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
20
20
|
import { spawn } from "node:child_process";
|
|
21
|
-
import { closeSync as closeSync2, mkdirSync as mkdirSync2, openSync as openSync2 } from "node:fs";
|
|
21
|
+
import { closeSync as closeSync2, existsSync as existsSync2, mkdirSync as mkdirSync2, openSync as openSync2, writeSync as writeSync2 } from "node:fs";
|
|
22
22
|
import { Socket } from "node:net";
|
|
23
|
-
import { dirname as dirname3 } from "node:path";
|
|
24
|
-
import { execPath } from "node:process";
|
|
23
|
+
import { dirname as dirname3, isAbsolute as isAbsolute3 } from "node:path";
|
|
24
|
+
import { argv0, execPath } from "node:process";
|
|
25
25
|
import {
|
|
26
26
|
chmodSync,
|
|
27
27
|
closeSync,
|
|
@@ -42,38 +42,38 @@ import * as path from "node:path";
|
|
|
42
42
|
import { fileURLToPath } from "node:url";
|
|
43
43
|
import { statSync as statSync2 } from "node:fs";
|
|
44
44
|
import { isAbsolute as isAbsolute2 } from "node:path";
|
|
45
|
-
import { existsSync as
|
|
46
|
-
import { dirname as dirname8, join as join4, resolve as resolve7 } from "node:path";
|
|
45
|
+
import { existsSync as existsSync10, realpathSync as realpathSync4, statSync as statSync4 } from "node:fs";
|
|
46
|
+
import { basename as basename3, dirname as dirname8, join as join4, resolve as resolve7 } from "node:path";
|
|
47
47
|
import { basename as basename2, extname } from "node:path";
|
|
48
48
|
import { resolve as resolve6 } from "node:path";
|
|
49
49
|
import { pathToFileURL as pathToFileURL3 } from "node:url";
|
|
50
50
|
import { pathToFileURL } from "node:url";
|
|
51
51
|
import { spawn as spawn2, spawnSync } from "node:child_process";
|
|
52
|
-
import { existsSync as
|
|
52
|
+
import { existsSync as existsSync3, statSync as statSync3 } from "node:fs";
|
|
53
53
|
import { delimiter as delimiter2, join as join2 } from "node:path";
|
|
54
54
|
import { readFileSync as readFileSync2, realpathSync as realpathSync2 } from "node:fs";
|
|
55
55
|
import { relative as relative2, resolve as resolve2 } from "node:path";
|
|
56
56
|
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
57
|
-
import { existsSync as
|
|
58
|
-
import { existsSync as
|
|
59
|
-
import { dirname as dirname4, isAbsolute as
|
|
57
|
+
import { existsSync as existsSync5, lstatSync as lstatSync3, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
58
|
+
import { existsSync as existsSync4, lstatSync as lstatSync2, readFileSync as readFileSync3, readdirSync, realpathSync as realpathSync3 } from "node:fs";
|
|
59
|
+
import { dirname as dirname4, isAbsolute as isAbsolute4, relative as relative3, resolve as resolve3 } from "node:path";
|
|
60
60
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
61
61
|
import { createHash as createHash2 } from "node:crypto";
|
|
62
62
|
import { dirname as dirname5, relative as relative4, resolve as resolve4 } from "node:path";
|
|
63
|
-
import { existsSync as
|
|
63
|
+
import { existsSync as existsSync6, lstatSync as lstatSync4, readdirSync as readdirSync2 } from "node:fs";
|
|
64
64
|
import { dirname as dirname6, resolve as resolve5 } from "node:path";
|
|
65
|
-
import { existsSync as
|
|
65
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
66
66
|
import { dirname as dirname7 } from "node:path";
|
|
67
|
-
import { existsSync as
|
|
68
|
-
import { existsSync as
|
|
67
|
+
import { existsSync as existsSync8, readFileSync as readFileSync5 } from "node:fs";
|
|
68
|
+
import { existsSync as existsSync9 } from "node:fs";
|
|
69
69
|
import { delimiter as delimiter3, join as join3 } from "node:path";
|
|
70
|
-
import { existsSync as
|
|
70
|
+
import { existsSync as existsSync11, lstatSync as lstatSync5, readdirSync as readdirSync3 } from "node:fs";
|
|
71
71
|
import { join as join5, resolve as resolve8 } from "node:path";
|
|
72
72
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
73
73
|
import { lstatSync as lstatSync6, readdirSync as readdirSync4 } from "node:fs";
|
|
74
74
|
import { join as join6 } from "node:path";
|
|
75
75
|
import { statSync as statSync5 } from "node:fs";
|
|
76
|
-
import { isAbsolute as
|
|
76
|
+
import { isAbsolute as isAbsolute5 } from "node:path";
|
|
77
77
|
|
|
78
78
|
class LspRequestContextParseError extends Error {
|
|
79
79
|
code;
|
|
@@ -563,15 +563,29 @@ function spawnDaemonProcess(paths) {
|
|
|
563
563
|
mkdirSync2(dirname3(paths.log), { recursive: true });
|
|
564
564
|
const logFd = openSync2(paths.log, "a");
|
|
565
565
|
try {
|
|
566
|
-
const child = spawn(
|
|
566
|
+
const child = spawn(resolveDaemonNodeExecutable(), [paths.cliPath, "daemon"], {
|
|
567
567
|
detached: true,
|
|
568
568
|
stdio: ["ignore", logFd, logFd]
|
|
569
569
|
});
|
|
570
|
+
child.once("spawn", () => closeSync2(logFd));
|
|
571
|
+
child.once("error", (error) => {
|
|
572
|
+
writeSync2(logFd, `[lsp-daemon] failed to spawn daemon: ${error.message}
|
|
573
|
+
`);
|
|
574
|
+
closeSync2(logFd);
|
|
575
|
+
});
|
|
570
576
|
child.unref();
|
|
571
|
-
}
|
|
577
|
+
} catch (error) {
|
|
572
578
|
closeSync2(logFd);
|
|
579
|
+
throw error;
|
|
573
580
|
}
|
|
574
581
|
}
|
|
582
|
+
function resolveDaemonNodeExecutable(cachedExecPath = execPath, originalArgv0 = argv0, pathExists = existsSync2) {
|
|
583
|
+
if (pathExists(cachedExecPath))
|
|
584
|
+
return cachedExecPath;
|
|
585
|
+
if (isAbsolute3(originalArgv0) && pathExists(originalArgv0))
|
|
586
|
+
return originalArgv0;
|
|
587
|
+
return "node";
|
|
588
|
+
}
|
|
575
589
|
function defaultEnsureDaemonDeps() {
|
|
576
590
|
return {
|
|
577
591
|
probe: (paths, signal) => probeDaemon(paths, PROBE_TIMEOUT_MS, signal),
|
|
@@ -1085,7 +1099,7 @@ function reportKillError(context, error) {
|
|
|
1085
1099
|
}
|
|
1086
1100
|
function validateCwd(cwd) {
|
|
1087
1101
|
try {
|
|
1088
|
-
if (!
|
|
1102
|
+
if (!existsSync3(cwd)) {
|
|
1089
1103
|
return { valid: false, error: `Working directory does not exist: ${cwd}` };
|
|
1090
1104
|
}
|
|
1091
1105
|
const stats = statSync3(cwd);
|
|
@@ -1173,7 +1187,7 @@ function resolveWindowsCommand(command, env) {
|
|
|
1173
1187
|
for (const baseDirectory of baseDirectories) {
|
|
1174
1188
|
for (const extension of extensions) {
|
|
1175
1189
|
const candidate = baseDirectory ? join2(baseDirectory, `${command}${extension}`) : `${command}${extension}`;
|
|
1176
|
-
if (
|
|
1190
|
+
if (existsSync3(candidate))
|
|
1177
1191
|
return candidate;
|
|
1178
1192
|
}
|
|
1179
1193
|
}
|
|
@@ -1567,7 +1581,7 @@ class LspClientConnection extends LspClientTransport {
|
|
|
1567
1581
|
initializationOptions: this.server.initialization
|
|
1568
1582
|
}, { timeoutMs: this.initializeTimeoutMs });
|
|
1569
1583
|
this.setDiagnosticPullSupported(supportsDiagnosticPull(result?.capabilities));
|
|
1570
|
-
await this.sendNotification("initialized");
|
|
1584
|
+
await this.sendNotification("initialized", {});
|
|
1571
1585
|
await this.sendNotification("workspace/didChangeConfiguration", {
|
|
1572
1586
|
settings: { json: { validate: { enable: true } } }
|
|
1573
1587
|
});
|
|
@@ -2037,11 +2051,11 @@ class WorkspaceEditPathError extends Error {
|
|
|
2037
2051
|
}
|
|
2038
2052
|
function isPathInsideWorkspace(filePath, workspaceRoot) {
|
|
2039
2053
|
const relativePath = relative3(workspaceRoot, filePath);
|
|
2040
|
-
return relativePath === "" || !relativePath.startsWith("..") && !
|
|
2054
|
+
return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute4(relativePath);
|
|
2041
2055
|
}
|
|
2042
2056
|
function canonicalizeMissingPath(filePath) {
|
|
2043
2057
|
let ancestor = filePath;
|
|
2044
|
-
while (!
|
|
2058
|
+
while (!existsSync4(ancestor)) {
|
|
2045
2059
|
const parent = dirname4(ancestor);
|
|
2046
2060
|
if (parent === ancestor)
|
|
2047
2061
|
throw new WorkspaceEditPathError(filePath, "no existing ancestor");
|
|
@@ -2059,7 +2073,7 @@ function canonicalWorkspaceRoot(workspaceRoot) {
|
|
|
2059
2073
|
success: true,
|
|
2060
2074
|
path: canonical,
|
|
2061
2075
|
requestedPath: resolve3(workspaceRoot),
|
|
2062
|
-
followedSymbolicLink:
|
|
2076
|
+
followedSymbolicLink: existsSync4(resolve3(workspaceRoot)) && lstatSync2(resolve3(workspaceRoot)).isSymbolicLink()
|
|
2063
2077
|
};
|
|
2064
2078
|
} catch (error) {
|
|
2065
2079
|
const detail = error instanceof Error ? error.message : String(error);
|
|
@@ -2079,7 +2093,7 @@ function uriToCanonicalWorkspacePath(uri, workspaceRoot) {
|
|
|
2079
2093
|
return { success: false, error: `non-file URI ${uri}: ${detail}` };
|
|
2080
2094
|
}
|
|
2081
2095
|
try {
|
|
2082
|
-
const canonical =
|
|
2096
|
+
const canonical = existsSync4(requestedPath) ? realpathSync3(requestedPath) : canonicalizeMissingPath(requestedPath);
|
|
2083
2097
|
if (!isPathInsideWorkspace(canonical, workspaceRoot)) {
|
|
2084
2098
|
return { success: false, error: `${requestedPath}: outside workspace ${workspaceRoot}` };
|
|
2085
2099
|
}
|
|
@@ -2087,7 +2101,7 @@ function uriToCanonicalWorkspacePath(uri, workspaceRoot) {
|
|
|
2087
2101
|
success: true,
|
|
2088
2102
|
path: canonical,
|
|
2089
2103
|
requestedPath,
|
|
2090
|
-
followedSymbolicLink:
|
|
2104
|
+
followedSymbolicLink: existsSync4(requestedPath) && lstatSync2(requestedPath).isSymbolicLink()
|
|
2091
2105
|
};
|
|
2092
2106
|
} catch (error) {
|
|
2093
2107
|
const detail = error instanceof Error ? error.message : String(error);
|
|
@@ -2095,7 +2109,7 @@ function uriToCanonicalWorkspacePath(uri, workspaceRoot) {
|
|
|
2095
2109
|
}
|
|
2096
2110
|
}
|
|
2097
2111
|
function snapshotPath(path2, includeChildren) {
|
|
2098
|
-
if (!
|
|
2112
|
+
if (!existsSync4(path2))
|
|
2099
2113
|
return { kind: "missing" };
|
|
2100
2114
|
const stats = lstatSync2(path2);
|
|
2101
2115
|
if (stats.isFile())
|
|
@@ -2213,7 +2227,7 @@ function commitOperation(context, operation) {
|
|
|
2213
2227
|
}
|
|
2214
2228
|
if (operation.kind === "rename") {
|
|
2215
2229
|
if (operation.replaceDestination) {
|
|
2216
|
-
const targetKind =
|
|
2230
|
+
const targetKind = existsSync5(operation.newPath) && lstatSync3(operation.newPath).isDirectory() ? "directory" : "file";
|
|
2217
2231
|
io.remove(operation.newPath, targetKind === "directory");
|
|
2218
2232
|
accumulator.mutations.push({ kind: "delete", path: operation.newPath, targetKind });
|
|
2219
2233
|
addModifiedPath(accumulator.filesModified, reportedPath(plan, operation.newPath));
|
|
@@ -2841,7 +2855,7 @@ class WorkspaceSnapshotBuilder {
|
|
|
2841
2855
|
break;
|
|
2842
2856
|
candidate = dirname6(candidate);
|
|
2843
2857
|
}
|
|
2844
|
-
if (!includeChildren || !
|
|
2858
|
+
if (!includeChildren || !existsSync6(path2) || !lstatSync4(path2).isDirectory())
|
|
2845
2859
|
return;
|
|
2846
2860
|
for (const child of readdirSync2(path2))
|
|
2847
2861
|
this.add(resolve5(path2, child), true);
|
|
@@ -3597,7 +3611,7 @@ function getInstallDecisionsPath() {
|
|
|
3597
3611
|
}
|
|
3598
3612
|
function loadInstallDecisions() {
|
|
3599
3613
|
const path2 = getInstallDecisionsPath();
|
|
3600
|
-
if (!
|
|
3614
|
+
if (!existsSync7(path2))
|
|
3601
3615
|
return {};
|
|
3602
3616
|
try {
|
|
3603
3617
|
const parsed = JSON.parse(readFileSync4(path2, "utf8"));
|
|
@@ -3788,7 +3802,7 @@ function getUserConfigPath() {
|
|
|
3788
3802
|
return lspRequestContext().userConfigPath;
|
|
3789
3803
|
}
|
|
3790
3804
|
function loadJsonFile(path2) {
|
|
3791
|
-
if (!
|
|
3805
|
+
if (!existsSync8(path2))
|
|
3792
3806
|
return null;
|
|
3793
3807
|
try {
|
|
3794
3808
|
const parsed = JSON.parse(readFileSync5(path2, "utf-8"));
|
|
@@ -3981,7 +3995,7 @@ function isServerInstalled(command, _workingDirectory) {
|
|
|
3981
3995
|
if (!cmd)
|
|
3982
3996
|
return false;
|
|
3983
3997
|
if (cmd.includes("/") || cmd.includes("\\")) {
|
|
3984
|
-
if (
|
|
3998
|
+
if (existsSync9(cmd))
|
|
3985
3999
|
return true;
|
|
3986
4000
|
}
|
|
3987
4001
|
const isWindows = process.platform === "win32";
|
|
@@ -4002,7 +4016,7 @@ function isServerInstalled(command, _workingDirectory) {
|
|
|
4002
4016
|
const paths = pathEnv.split(delimiter3);
|
|
4003
4017
|
for (const p of paths) {
|
|
4004
4018
|
for (const suffix of exts) {
|
|
4005
|
-
if (
|
|
4019
|
+
if (existsSync9(join3(p, cmd + suffix))) {
|
|
4006
4020
|
return true;
|
|
4007
4021
|
}
|
|
4008
4022
|
}
|
|
@@ -4103,32 +4117,86 @@ function isDirectoryPath(filePath) {
|
|
|
4103
4117
|
}
|
|
4104
4118
|
}
|
|
4105
4119
|
function findWorkspaceRoot(filePath) {
|
|
4106
|
-
const
|
|
4120
|
+
const cwd = contextCwd();
|
|
4121
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4107
4122
|
let dir = abs;
|
|
4108
4123
|
if (!isDirectoryPath(dir)) {
|
|
4109
4124
|
dir = dirname8(dir);
|
|
4110
4125
|
}
|
|
4111
|
-
|
|
4112
|
-
while (dir
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4126
|
+
const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
|
|
4127
|
+
while (isPathInside(cwd, dir)) {
|
|
4128
|
+
const canonicalDir = existingDirectoryInsideContext(dir, cwd);
|
|
4129
|
+
if (canonicalDir !== undefined) {
|
|
4130
|
+
for (const marker of WORKSPACE_MARKERS) {
|
|
4131
|
+
if (existsSync10(join4(dir, marker))) {
|
|
4132
|
+
return canonicalDir;
|
|
4133
|
+
}
|
|
4116
4134
|
}
|
|
4117
4135
|
}
|
|
4118
|
-
|
|
4136
|
+
if (dir === cwd)
|
|
4137
|
+
break;
|
|
4119
4138
|
dir = dirname8(dir);
|
|
4120
4139
|
}
|
|
4121
|
-
return
|
|
4140
|
+
return fallbackRoot;
|
|
4122
4141
|
}
|
|
4123
|
-
function
|
|
4142
|
+
function resolveReadablePathInsideContext(filePath) {
|
|
4124
4143
|
const cwd = contextCwd();
|
|
4125
4144
|
const abs = resolve7(cwd, filePath);
|
|
4145
|
+
if (isPathInside(cwd, abs))
|
|
4146
|
+
return abs;
|
|
4147
|
+
const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
|
|
4148
|
+
if (rebased !== undefined)
|
|
4149
|
+
return rebased;
|
|
4150
|
+
const canonical = canonicalizeExistingOrNearestAncestor(abs);
|
|
4151
|
+
if (isPathInside(cwd, canonical))
|
|
4152
|
+
return canonical;
|
|
4153
|
+
throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
|
|
4154
|
+
}
|
|
4155
|
+
function resolvePathInsideContext(filePath) {
|
|
4156
|
+
const cwd = contextCwd();
|
|
4157
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4126
4158
|
const canonical = canonicalizeExistingOrNearestAncestor(abs);
|
|
4127
4159
|
if (!isPathInside(cwd, canonical)) {
|
|
4128
4160
|
throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
|
|
4129
4161
|
}
|
|
4130
4162
|
return canonical;
|
|
4131
4163
|
}
|
|
4164
|
+
function rebaseThroughCanonicalAncestor(path2, cwd) {
|
|
4165
|
+
let current = path2;
|
|
4166
|
+
const suffix = [];
|
|
4167
|
+
while (true) {
|
|
4168
|
+
if (existsSync10(current)) {
|
|
4169
|
+
const canonical = realpathSync4(current);
|
|
4170
|
+
if (isPathInside(cwd, canonical))
|
|
4171
|
+
return suffix.length === 0 ? canonical : join4(canonical, ...suffix);
|
|
4172
|
+
}
|
|
4173
|
+
const parent = dirname8(current);
|
|
4174
|
+
if (parent === current)
|
|
4175
|
+
return;
|
|
4176
|
+
suffix.unshift(basename3(current));
|
|
4177
|
+
current = parent;
|
|
4178
|
+
}
|
|
4179
|
+
}
|
|
4180
|
+
function existingDirectoryInsideContext(directory, cwd) {
|
|
4181
|
+
if (!existsSync10(directory))
|
|
4182
|
+
return;
|
|
4183
|
+
const canonical = realpathSync4(directory);
|
|
4184
|
+
if (!statSync4(canonical).isDirectory())
|
|
4185
|
+
return;
|
|
4186
|
+
return isPathInside(cwd, canonical) ? canonical : undefined;
|
|
4187
|
+
}
|
|
4188
|
+
function nearestExistingDirectoryInsideContext(directory, cwd) {
|
|
4189
|
+
let current = directory;
|
|
4190
|
+
while (isPathInside(cwd, current)) {
|
|
4191
|
+
const canonical = existingDirectoryInsideContext(current, cwd);
|
|
4192
|
+
if (canonical !== undefined)
|
|
4193
|
+
return canonical;
|
|
4194
|
+
if (current === cwd)
|
|
4195
|
+
return;
|
|
4196
|
+
current = dirname8(current);
|
|
4197
|
+
}
|
|
4198
|
+
return;
|
|
4199
|
+
}
|
|
4132
4200
|
function formatServerLookupError(result) {
|
|
4133
4201
|
if (result.status === "not_installed") {
|
|
4134
4202
|
return formatNotInstalled(result);
|
|
@@ -4199,7 +4267,7 @@ function formatNotInstalled(result) {
|
|
|
4199
4267
|
].join(`
|
|
4200
4268
|
`);
|
|
4201
4269
|
}
|
|
4202
|
-
var
|
|
4270
|
+
var READ_ONLY_TOOLS = new Set([
|
|
4203
4271
|
"diagnostics",
|
|
4204
4272
|
"definition",
|
|
4205
4273
|
"references",
|
|
@@ -4208,7 +4276,7 @@ var READ_ONLY_RETRY_TOOLS = new Set([
|
|
|
4208
4276
|
"prepareRename"
|
|
4209
4277
|
]);
|
|
4210
4278
|
async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
4211
|
-
const absPath = resolvePathInsideContext(filePath);
|
|
4279
|
+
const absPath = READ_ONLY_TOOLS.has(toolName) ? resolveReadablePathInsideContext(filePath) : resolvePathInsideContext(filePath);
|
|
4212
4280
|
if (isDirectoryPath(absPath)) {
|
|
4213
4281
|
throw new LspInvalidPathError("Directory paths are not supported by this LSP tool. " + "Use lsp.diagnostics with a directory path for directory diagnostics.");
|
|
4214
4282
|
}
|
|
@@ -4223,9 +4291,9 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4223
4291
|
const acquireAndCall = async (allowRetry) => {
|
|
4224
4292
|
const client = await manager.getClient(root, server2, options.signal);
|
|
4225
4293
|
try {
|
|
4226
|
-
return await fn(client, root);
|
|
4294
|
+
return await fn(client, root, absPath);
|
|
4227
4295
|
} catch (err) {
|
|
4228
|
-
if (allowRetry &&
|
|
4296
|
+
if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
|
|
4229
4297
|
manager.invalidateClient(root, server2.id, client);
|
|
4230
4298
|
return acquireAndCall(false);
|
|
4231
4299
|
}
|
|
@@ -4391,7 +4459,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4391
4459
|
throw new LspInvalidPathError(`Extension must start with a dot (e.g., ".ts", not "${extension}"). Use ".${extension}" instead.`);
|
|
4392
4460
|
}
|
|
4393
4461
|
const absDir = resolve8(options.workspaceRoot ?? contextCwd(), directory);
|
|
4394
|
-
if (!
|
|
4462
|
+
if (!existsSync11(absDir)) {
|
|
4395
4463
|
throw new LspInvalidPathError(`Directory does not exist: ${absDir}`);
|
|
4396
4464
|
}
|
|
4397
4465
|
const serverResult = options.server === undefined ? findServerForExtension(extension) : { status: "found", server: options.server };
|
|
@@ -4655,7 +4723,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4655
4723
|
const filePath = requireString(params, "filePath");
|
|
4656
4724
|
const severity = severityFilter(params);
|
|
4657
4725
|
try {
|
|
4658
|
-
const absPath =
|
|
4726
|
+
const absPath = resolveReadablePathInsideContext(filePath);
|
|
4659
4727
|
if (isDirectoryPath(absPath)) {
|
|
4660
4728
|
const extension = inferExtensionFromDirectory(absPath);
|
|
4661
4729
|
if (!extension) {
|
|
@@ -4684,7 +4752,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4684
4752
|
};
|
|
4685
4753
|
return text(output2.output, details2);
|
|
4686
4754
|
}
|
|
4687
|
-
const result = await withLspClient(filePath, async (client) => client.diagnostics(
|
|
4755
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
|
|
4688
4756
|
if (result.transientError) {
|
|
4689
4757
|
const message = result.transientError.message;
|
|
4690
4758
|
const details2 = {
|
|
@@ -4756,7 +4824,7 @@ async function executeLspGotoDefinition(params, signal) {
|
|
|
4756
4824
|
const line = requireNumber(params, "line");
|
|
4757
4825
|
const character = requireNumber(params, "character");
|
|
4758
4826
|
try {
|
|
4759
|
-
const result = await withLspClient(filePath, async (client) => client.definition(
|
|
4827
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.definition(resolvedFilePath, line, character, signal), "definition", clientOptions(signal));
|
|
4760
4828
|
const locations = !result ? [] : Array.isArray(result) ? result : [result];
|
|
4761
4829
|
const details = { filePath, line, character, locations };
|
|
4762
4830
|
if (locations.length === 0)
|
|
@@ -4781,7 +4849,7 @@ async function executeLspFindReferences(params, signal) {
|
|
|
4781
4849
|
const character = requireNumber(params, "character");
|
|
4782
4850
|
const includeDeclaration = optionalBoolean(params, "includeDeclaration") ?? true;
|
|
4783
4851
|
try {
|
|
4784
|
-
const result = await withLspClient(filePath, async (client) => client.references(
|
|
4852
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.references(resolvedFilePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
|
|
4785
4853
|
const references = Array.isArray(result) ? result : [];
|
|
4786
4854
|
const total = references.length;
|
|
4787
4855
|
const truncated = total > DEFAULT_MAX_REFERENCES;
|
|
@@ -4821,7 +4889,7 @@ async function executeLspPrepareRename(params, signal) {
|
|
|
4821
4889
|
const line = requireNumber(params, "line");
|
|
4822
4890
|
const character = requireNumber(params, "character");
|
|
4823
4891
|
try {
|
|
4824
|
-
const result = await withLspClient(filePath, async (client) => client.prepareRename(
|
|
4892
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.prepareRename(resolvedFilePath, line, character, signal), "prepareRename", clientOptions(signal));
|
|
4825
4893
|
const details = { filePath, line, character, result };
|
|
4826
4894
|
return text(formatPrepareRenameResult(result), details);
|
|
4827
4895
|
} catch (error) {
|
|
@@ -4842,7 +4910,7 @@ async function executeLspRename(params, signal) {
|
|
|
4842
4910
|
const character = requireNumber(params, "character");
|
|
4843
4911
|
const newName = requireString(params, "newName");
|
|
4844
4912
|
try {
|
|
4845
|
-
const result = await withLspClient(filePath, async (client) => client.rename(
|
|
4913
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.rename(resolvedFilePath, line, character, newName, signal), "rename", clientOptions(signal));
|
|
4846
4914
|
const details = { filePath, line, character, newName, apply: result.apply, edit: result.edit };
|
|
4847
4915
|
return text(formatApplyResult(result.apply), details, !result.apply.success);
|
|
4848
4916
|
} catch (error) {
|
|
@@ -4916,7 +4984,7 @@ async function executeLspSymbols(params, signal) {
|
|
|
4916
4984
|
const symbols2 = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
|
|
4917
4985
|
return formatSymbolsResult(filePath, scope, symbols2, limit, query);
|
|
4918
4986
|
}
|
|
4919
|
-
const symbols = await withLspClient(filePath, async (client) => client.documentSymbols(
|
|
4987
|
+
const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
|
|
4920
4988
|
return formatSymbolsResult(filePath, scope, symbols, limit);
|
|
4921
4989
|
} catch (error) {
|
|
4922
4990
|
const query = optionalString(params, "query");
|
|
@@ -5260,12 +5328,12 @@ function resolveDaemonRuntime2(env, defaults) {
|
|
|
5260
5328
|
throw new InvalidRuntimeOverrideError2("paired_values_required", `${OMO_LSP_DAEMON_CLI2} and ${OMO_LSP_DAEMON_VERSION2} must be set together`);
|
|
5261
5329
|
}
|
|
5262
5330
|
if (!hasCliOverride || !hasVersionOverride) {
|
|
5263
|
-
if (!
|
|
5331
|
+
if (!isAbsolute5(defaults.cliPath)) {
|
|
5264
5332
|
throw new InvalidRuntimeOverrideError2("packaged_cli_must_be_absolute", "Packaged LSP daemon CLI path must be absolute");
|
|
5265
5333
|
}
|
|
5266
5334
|
return { cliPath: defaults.cliPath, version: validateDaemonVersion2(defaults.version) };
|
|
5267
5335
|
}
|
|
5268
|
-
if (!
|
|
5336
|
+
if (!isAbsolute5(cliOverride)) {
|
|
5269
5337
|
throw new InvalidRuntimeOverrideError2("cli_must_be_absolute", `${OMO_LSP_DAEMON_CLI2} must be an absolute path to an existing regular file`);
|
|
5270
5338
|
}
|
|
5271
5339
|
const stat = statSync5(cliOverride, { throwIfNoEntry: false });
|
|
@@ -5386,8 +5454,8 @@ function extensionKey(filePath) {
|
|
|
5386
5454
|
}
|
|
5387
5455
|
// ../../../../lsp-core/src/request-context.ts
|
|
5388
5456
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
5389
|
-
import { existsSync as
|
|
5390
|
-
import { basename as
|
|
5457
|
+
import { existsSync as existsSync12, realpathSync as realpathSync5, statSync as statSync6 } from "node:fs";
|
|
5458
|
+
import { basename as basename4, delimiter as delimiter4, dirname as dirname2, isAbsolute as isAbsolute6, join as join7, relative as relative5, resolve as resolve9 } from "node:path";
|
|
5391
5459
|
|
|
5392
5460
|
class LspRequestContextParseError2 extends Error {
|
|
5393
5461
|
code;
|
|
@@ -5430,17 +5498,17 @@ function parseLspRequestContext2(value) {
|
|
|
5430
5498
|
}
|
|
5431
5499
|
function canonicalCwd2(cwd) {
|
|
5432
5500
|
const resolved = resolve9(cwd);
|
|
5433
|
-
if (!
|
|
5501
|
+
if (!existsSync12(resolved) || !statSync6(resolved).isDirectory()) {
|
|
5434
5502
|
throw new LspRequestContextParseError2("invalid_cwd", `LSP request cwd must be an existing directory: ${cwd}`);
|
|
5435
5503
|
}
|
|
5436
|
-
return
|
|
5504
|
+
return realpathSync5(resolved);
|
|
5437
5505
|
}
|
|
5438
5506
|
function canonicalizeExistingOrNearestAncestor2(path2) {
|
|
5439
5507
|
let current = resolve9(path2);
|
|
5440
5508
|
const suffix = [];
|
|
5441
5509
|
while (true) {
|
|
5442
5510
|
try {
|
|
5443
|
-
const existing =
|
|
5511
|
+
const existing = realpathSync5(current);
|
|
5444
5512
|
return suffix.length === 0 ? existing : join7(existing, ...suffix);
|
|
5445
5513
|
} catch (error) {
|
|
5446
5514
|
if (!isMissingPathError2(error))
|
|
@@ -5448,7 +5516,7 @@ function canonicalizeExistingOrNearestAncestor2(path2) {
|
|
|
5448
5516
|
const parent = dirname2(current);
|
|
5449
5517
|
if (parent === current)
|
|
5450
5518
|
throw error;
|
|
5451
|
-
suffix.unshift(
|
|
5519
|
+
suffix.unshift(basename4(current));
|
|
5452
5520
|
current = parent;
|
|
5453
5521
|
}
|
|
5454
5522
|
}
|
|
@@ -5479,14 +5547,14 @@ function stringArrayField2(value, field) {
|
|
|
5479
5547
|
return fieldValue;
|
|
5480
5548
|
}
|
|
5481
5549
|
function requireAbsolutePath2(path2, field) {
|
|
5482
|
-
if (!
|
|
5550
|
+
if (!isAbsolute6(path2)) {
|
|
5483
5551
|
throw new LspRequestContextParseError2("relative_path", `LSP request context.${field} must be absolute: ${path2}`);
|
|
5484
5552
|
}
|
|
5485
5553
|
}
|
|
5486
5554
|
function isPathInside2(parent, child) {
|
|
5487
5555
|
const childPath = resolve9(child);
|
|
5488
5556
|
const relativePath = relative5(parent, childPath);
|
|
5489
|
-
return relativePath === "" || !relativePath.startsWith("..") && !
|
|
5557
|
+
return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute6(relativePath);
|
|
5490
5558
|
}
|
|
5491
5559
|
function isMissingPathError2(error) {
|
|
5492
5560
|
const code = errorCode2(error);
|
|
@@ -5509,7 +5577,7 @@ function errorCode2(error) {
|
|
|
5509
5577
|
}
|
|
5510
5578
|
|
|
5511
5579
|
// src/daemon-cli-path.ts
|
|
5512
|
-
import { existsSync as
|
|
5580
|
+
import { existsSync as existsSync14, readFileSync as readFileSync6 } from "node:fs";
|
|
5513
5581
|
import { createRequire as createRequire2 } from "node:module";
|
|
5514
5582
|
import { dirname as dirname9, join as join9 } from "node:path";
|
|
5515
5583
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
@@ -5533,7 +5601,7 @@ function resolveLspDaemonCli() {
|
|
|
5533
5601
|
if (packageCli !== null)
|
|
5534
5602
|
return resolveConfiguredLspDaemonCli(packageCli);
|
|
5535
5603
|
const bundledCli = fileURLToPath4(new URL("../../lsp-daemon/dist/cli.js", import.meta.url));
|
|
5536
|
-
if (
|
|
5604
|
+
if (existsSync14(bundledCli))
|
|
5537
5605
|
return resolveConfiguredLspDaemonCli(bundledCli);
|
|
5538
5606
|
return resolveConfiguredLspDaemonCli(bundledCli);
|
|
5539
5607
|
}
|
|
@@ -5761,7 +5829,7 @@ function notConfiguredAvailability(details) {
|
|
|
5761
5829
|
return typeof extension === "string" && extension.length > 0 ? { extension } : undefined;
|
|
5762
5830
|
}
|
|
5763
5831
|
function codexLspRequestContext(env = process.env, cwd = process.cwd()) {
|
|
5764
|
-
const canonicalCwd3 =
|
|
5832
|
+
const canonicalCwd3 = realpathSync7(resolve11(cwd));
|
|
5765
5833
|
const codexHome = resolve11(env["CODEX_HOME"]?.trim() || join11(homedir3(), ".codex"));
|
|
5766
5834
|
return parseLspRequestContext2({
|
|
5767
5835
|
cwd: canonicalCwd3,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "command",
|
|
9
9
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
|
|
10
10
|
"timeout": 60,
|
|
11
|
-
"statusMessage": "(OmO
|
|
11
|
+
"statusMessage": "(OmO 5.0.0-beta.10) Checking LSP Diagnostics"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"type": "command",
|
|
22
22
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
|
|
23
23
|
"timeout": 5,
|
|
24
|
-
"statusMessage": "(OmO
|
|
24
|
+
"statusMessage": "(OmO 5.0.0-beta.10) Resetting LSP Diagnostics Cache"
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
27
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"type": "command",
|
|
8
8
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook session-start",
|
|
9
9
|
"timeout": 10,
|
|
10
|
-
"statusMessage": "(OmO
|
|
10
|
+
"statusMessage": "(OmO 5.0.0-beta.10) Loading Project Rules"
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"type": "command",
|
|
20
20
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook user-prompt-submit",
|
|
21
21
|
"timeout": 10,
|
|
22
|
-
"statusMessage": "(OmO
|
|
22
|
+
"statusMessage": "(OmO 5.0.0-beta.10) Loading Project Rules"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"type": "command",
|
|
33
33
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
|
|
34
34
|
"timeout": 10,
|
|
35
|
-
"statusMessage": "(OmO
|
|
35
|
+
"statusMessage": "(OmO 5.0.0-beta.10) Matching Project Rules"
|
|
36
36
|
}
|
|
37
37
|
]
|
|
38
38
|
}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"type": "command",
|
|
46
46
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
|
|
47
47
|
"timeout": 10,
|
|
48
|
-
"statusMessage": "(OmO
|
|
48
|
+
"statusMessage": "(OmO 5.0.0-beta.10) Resetting Project Rule Cache"
|
|
49
49
|
}
|
|
50
50
|
]
|
|
51
51
|
}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import type { RuleCandidate } from "@oh-my-opencode/rules-engine/engine";
|
|
5
|
+
import {
|
|
6
|
+
createEngine,
|
|
7
|
+
defaultConfig,
|
|
8
|
+
type EngineDeps,
|
|
9
|
+
resolvePluginRulesRoot,
|
|
10
|
+
SOURCE_PRIORITY,
|
|
11
|
+
} from "@oh-my-opencode/rules-engine/engine";
|
|
4
12
|
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
|
|
6
13
|
import { configFromEnvironment } from "../src/config.js";
|
|
7
|
-
import { SOURCE_PRIORITY } from "@oh-my-opencode/rules-engine/engine";
|
|
8
|
-
import { createEngine, defaultConfig, type EngineDeps } from "@oh-my-opencode/rules-engine/engine";
|
|
9
|
-
import { resolvePluginRulesRoot } from "@oh-my-opencode/rules-engine/engine";
|
|
10
|
-
import type { RuleCandidate } from "@oh-my-opencode/rules-engine/engine";
|
|
11
14
|
|
|
12
15
|
const projectRoot = "/tmp/codex-rules-bundled-priority";
|
|
13
16
|
const bundledPath = join(projectRoot, "bundled-rules", "hephaestus.md");
|
|
14
17
|
const homePath = join(projectRoot, "home", ".opencode", "rules", "hephaestus.md");
|
|
15
|
-
const bundledBody = "
|
|
16
|
-
const homeBody = "
|
|
18
|
+
const bundledBody = "BUNDLED_BASELINE_SENTINEL";
|
|
19
|
+
const homeBody = "HOME_OVERRIDE_SENTINEL";
|
|
17
20
|
const tempDirectories: string[] = [];
|
|
18
21
|
|
|
19
22
|
afterEach(() => {
|
|
@@ -35,14 +38,7 @@ function globalCandidate(source: "plugin-bundled" | "~/.opencode/rules", path: s
|
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
function ruleMarkdown(body: string): string {
|
|
38
|
-
return [
|
|
39
|
-
"---",
|
|
40
|
-
"description: OMO Hephaestus baseline discipline for Codex",
|
|
41
|
-
"alwaysApply: true",
|
|
42
|
-
"---",
|
|
43
|
-
"",
|
|
44
|
-
body,
|
|
45
|
-
].join("\n");
|
|
41
|
+
return ["---", "description: Fixture", "alwaysApply: true", "---", "", body].join("\n");
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
describe("plugin bundled rule priority", () => {
|
|
@@ -85,7 +81,6 @@ describe("plugin bundled rule priority", () => {
|
|
|
85
81
|
// then
|
|
86
82
|
expect(formatted).toContain(homePath);
|
|
87
83
|
expect(formatted).toContain(homeBody);
|
|
88
|
-
expect(formatted).not.toContain(`- [hephaestus.md]{${homePath}}`);
|
|
89
84
|
expect(formatted).not.toContain(bundledPath);
|
|
90
85
|
expect(formatted).not.toContain(bundledBody);
|
|
91
86
|
});
|