oh-my-opencode 4.13.0 → 4.14.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/skills/codex-qa/SKILL.md +15 -0
- package/.agents/skills/codex-qa/references/isolation.md +1 -1
- package/.agents/skills/codex-qa/references/logging-debug.md +12 -0
- package/.agents/skills/opencode-qa/SKILL.md +17 -0
- package/.agents/skills/opencode-qa/references/tui-tmux.md +17 -0
- package/.agents/skills/work-with-pr/SKILL.md +18 -10
- package/.opencode/skills/work-with-pr/SKILL.md +18 -10
- package/README.md +3 -3
- package/dist/cli/doctor/checks/telemetry.d.ts +2 -0
- package/dist/cli/doctor/framework/constants.d.ts +1 -0
- package/dist/cli/doctor/framework/doctor-target.d.ts +1 -1
- package/dist/cli/doctor/framework/types.d.ts +2 -0
- package/dist/cli/index.js +24779 -17857
- package/dist/cli-node/index.js +24779 -17857
- package/dist/config/schema/oh-my-opencode-config.d.ts +1 -0
- package/dist/features/team-mode/test-support/async-test-helpers.d.ts +19 -0
- package/dist/hooks/atlas/final-wave-approval-gate.d.ts +1 -0
- package/dist/hooks/atlas/subagent-completion-reminder.d.ts +30 -0
- package/dist/hooks/atlas/types.d.ts +2 -0
- package/dist/hooks/atlas/verification-reminders.d.ts +3 -0
- package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +43845 -26631
- package/dist/mcp/context7.d.ts +9 -8
- package/dist/oh-my-opencode.schema.json +4 -0
- package/dist/plugin/native-skills.d.ts +9 -0
- package/dist/plugin/system-transform.d.ts +1 -1
- package/dist/shared/posthog.d.ts +17 -10
- package/dist/shared/telemetry-product-identity.d.ts +2 -0
- package/dist/skills/coding-agent-sessions/SKILL.md +128 -0
- package/dist/skills/coding-agent-sessions/agents/openai.yaml +4 -0
- package/dist/skills/coding-agent-sessions/references/all-platforms.md +71 -0
- package/dist/skills/coding-agent-sessions/references/claude.md +32 -0
- package/dist/skills/coding-agent-sessions/references/codex.md +30 -0
- package/dist/skills/coding-agent-sessions/references/opencode.md +43 -0
- package/dist/skills/coding-agent-sessions/references/senpi.md +17 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +92 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
- package/dist/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
- package/dist/skills/frontend/ATTRIBUTION.md +52 -8
- package/dist/skills/frontend/SKILL.md +29 -8
- package/dist/skills/frontend/references/design/README.md +29 -12
- package/dist/skills/frontend/references/design/_INDEX.md +3 -3
- package/dist/skills/frontend/references/design/design-system-architecture.md +22 -19
- package/dist/skills/frontend/references/designpowers/EVIDENCE.md +89 -0
- package/dist/skills/frontend/references/designpowers/README.md +48 -0
- package/dist/skills/frontend/references/designpowers/UPSTREAM.md +80 -0
- package/dist/skills/frontend/references/designpowers/lane-a-direction.md +64 -0
- package/dist/skills/frontend/references/designpowers/lane-b-execution.md +65 -0
- package/dist/skills/frontend/references/designpowers/lane-c-review.md +65 -0
- package/dist/skills/frontend/references/designpowers/lane-d-memory.md +83 -0
- package/dist/skills/frontend/references/designpowers/orchestration.md +80 -0
- package/dist/skills/frontend/references/designpowers/routing.md +79 -0
- package/dist/skills/frontend/references/designpowers/vendor/LICENSE +21 -0
- package/dist/skills/frontend/references/designpowers/vendor/agents/accessibility-reviewer.md +83 -0
- package/dist/skills/frontend/references/designpowers/vendor/agents/content-writer.md +132 -0
- package/dist/skills/frontend/references/designpowers/vendor/agents/design-builder.md +109 -0
- package/dist/skills/frontend/references/designpowers/vendor/agents/design-critic.md +89 -0
- package/dist/skills/frontend/references/designpowers/vendor/agents/design-lead.md +113 -0
- package/dist/skills/frontend/references/designpowers/vendor/agents/design-scout.md +78 -0
- package/dist/skills/frontend/references/designpowers/vendor/agents/design-strategist.md +121 -0
- package/dist/skills/frontend/references/designpowers/vendor/agents/heuristic-evaluator.md +268 -0
- package/dist/skills/frontend/references/designpowers/vendor/agents/inspiration-scout.md +107 -0
- package/dist/skills/frontend/references/designpowers/vendor/agents/motion-designer.md +120 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/accessible-content/SKILL.md +101 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/adaptive-interfaces/SKILL.md +109 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/cognitive-accessibility/SKILL.md +107 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/design-debate/SKILL.md +199 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/design-debt-tracker/SKILL.md +174 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/design-handoff/SKILL.md +125 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/design-md/SKILL.md +106 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/design-retrospective/SKILL.md +266 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/design-review/SKILL.md +123 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/design-system-alignment/SKILL.md +120 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/designpowers-critique/SKILL.md +164 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/heuristic-evaluation/SKILL.md +85 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/inclusive-personas/SKILL.md +98 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/inspiration-scouting/SKILL.md +165 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/interaction-design/SKILL.md +122 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/motion-choreography/SKILL.md +81 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/research-planning/SKILL.md +96 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/responsive-patterns/SKILL.md +77 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/synthetic-user-testing/SKILL.md +192 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/taste-feedback/SKILL.md +165 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/taste-report/SKILL.md +78 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/token-architecture/SKILL.md +75 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/ui-composition/SKILL.md +117 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/usability-testing/SKILL.md +78 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/verification-before-shipping/SKILL.md +125 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/voice-and-tone/SKILL.md +79 -0
- package/dist/skills/frontend/references/designpowers/vendor/skills/writing-design-plans/SKILL.md +119 -0
- package/dist/skills/frontend/references/ui-ux-db/scripts/core.py +0 -0
- package/dist/skills/git-master/SKILL.md +4 -0
- package/dist/skills/lcx-contribute-bug-fix/SKILL.md +44 -13
- package/dist/skills/lcx-contribute-bug-fix/agents/openai.yaml +1 -1
- package/dist/skills/lcx-doctor/SKILL.md +48 -13
- package/dist/skills/lcx-doctor/agents/openai.yaml +1 -1
- package/dist/skills/lcx-report-bug/SKILL.md +44 -13
- package/dist/skills/lcx-report-bug/agents/openai.yaml +1 -1
- package/dist/skills/review-work/SKILL.md +3 -3
- package/dist/skills/start-work/SKILL.md +7 -5
- package/dist/skills/ultraresearch/SKILL.md +4 -252
- package/dist/skills/ulw-plan/SKILL.md +8 -6
- package/dist/skills/ulw-plan/references/full-workflow.md +11 -6
- package/dist/skills/ulw-plan/references/intent-clear.md +3 -3
- package/dist/skills/ulw-plan/references/intent-unclear.md +1 -1
- package/{packages/shared-skills/skills/ultraresearch → dist/skills/ulw-research}/ATTRIBUTION.md +1 -1
- package/dist/skills/ulw-research/SKILL.md +260 -0
- package/dist/skills/visual-qa/SKILL.md +109 -18
- package/dist/skills/visual-qa/references/agent-browser-setup.md +5 -4
- package/dist/skills/visual-qa/scripts/cli.test.ts +7 -2
- package/dist/skills/visual-qa/scripts/skill-prompt-contract.test.ts +130 -3
- package/dist/skills/visual-qa/scripts/visual-qa.mjs +530 -0
- package/dist/testing/create-plugin-module.d.ts +2 -0
- package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
- package/dist/tools/delegate-task/types.d.ts +2 -0
- package/dist/tools/skill/types.d.ts +1 -0
- package/dist/tui.js +23917 -16117
- package/docs/reference/github-attachment-upload.md +51 -0
- package/docs/reference/web-terminal-visual-qa.md +81 -0
- package/package.json +33 -14
- package/packages/git-bash-mcp/dist/cli.js +2 -0
- package/packages/lsp-core/src/lsp/process.ts +4 -1
- package/packages/lsp-core/src/mcp.ts +1 -0
- package/packages/lsp-daemon/dist/cli.js +20 -5
- package/packages/lsp-daemon/dist/ensure-daemon.d.ts +1 -0
- package/packages/lsp-daemon/dist/ensure-daemon.js +9 -3
- package/packages/lsp-daemon/dist/index.js +20 -5
- package/packages/lsp-daemon/dist/paths.d.ts +1 -0
- package/packages/lsp-daemon/dist/paths.js +6 -1
- package/packages/lsp-daemon/dist/proxy.js +1 -0
- package/packages/lsp-tools-mcp/dist/cli.js +5 -1
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +4 -1
- package/packages/lsp-tools-mcp/dist/mcp.js +5 -1
- package/packages/lsp-tools-mcp/dist/tools.js +4 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +327 -69
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/scripts/bootstrap.ps1 +37 -68
- package/packages/omo-codex/plugin/components/bootstrap/scripts/node-dispatch.ps1 +75 -0
- package/packages/omo-codex/plugin/components/bootstrap/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +3 -19
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +688 -334
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +317 -39
- package/packages/omo-codex/plugin/components/codegraph/package.json +2 -2
- package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +7 -1
- package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +103 -3
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +231 -0
- package/packages/omo-codex/plugin/components/codegraph/src/serve-invocation.ts +29 -0
- package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +31 -57
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +7 -4
- package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +43 -9
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +287 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +12 -7
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +71 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +94 -26
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.js +2 -0
- package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.d.ts +2 -0
- package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.js +56 -0
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/cli.ts +2 -5
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +2 -0
- package/packages/omo-codex/plugin/components/lsp/src/daemon-cli-path.ts +65 -0
- package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +6 -1
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +8 -106
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +4 -17
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +6 -6
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +23 -0
- package/packages/omo-codex/plugin/components/teammode/dist/cli.js +22 -4
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/SKILL.md +57 -7
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-guide.mjs +32 -5
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-state.mjs +63 -1
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team.mjs +87 -53
- package/packages/omo-codex/plugin/components/teammode/src/codex-hook.ts +19 -4
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +32 -2
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/README.md +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +18 -10
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +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 +6 -4
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +11 -6
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +3 -3
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +1 -1
- 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 +24 -0
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +7 -28
- package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +25 -21
- package/packages/omo-codex/plugin/components/ulw-loop/biome.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +373 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +14 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +145 -14
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +6 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +16 -6
- package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.js +104 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +5 -2
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +22 -14
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +14 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +4 -2
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +28 -6
- package/packages/omo-codex/plugin/components/ulw-loop/src/ultrawork-directive.ts +113 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +33 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-kind-guidance.test.ts +31 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/sample-quality-gate.json +7 -7
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +39 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-doc.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +7 -6
- package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +64 -0
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +2 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +2 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +2 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +2 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +2 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +2 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +2 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +2 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +2 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +2 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +2 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +2 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +2 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +2 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +2 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +2 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +2 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +2 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +2 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +2 -1
- package/packages/omo-codex/plugin/package-lock.json +16 -56
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +9 -5
- package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +1 -0
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/context7-placeholder-guard.mjs +131 -0
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-mode-guard.mjs +60 -0
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +3 -10
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/root-settings.mjs +31 -1
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +73 -0
- package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +20 -3
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +30 -8
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +128 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/agents/openai.yaml +4 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +71 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/claude.md +32 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/codex.md +30 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/opencode.md +43 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +17 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +92 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +52 -8
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +29 -8
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +29 -12
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +3 -3
- package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +22 -19
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/EVIDENCE.md +89 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/README.md +48 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/UPSTREAM.md +80 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-a-direction.md +64 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-b-execution.md +65 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-c-review.md +65 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-d-memory.md +83 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/orchestration.md +80 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/routing.md +79 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/LICENSE +21 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/accessibility-reviewer.md +83 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/content-writer.md +132 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-builder.md +109 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-critic.md +89 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-lead.md +113 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-scout.md +78 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-strategist.md +121 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/heuristic-evaluator.md +268 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/inspiration-scout.md +107 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/motion-designer.md +120 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/accessible-content/SKILL.md +101 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/adaptive-interfaces/SKILL.md +109 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/cognitive-accessibility/SKILL.md +107 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-debate/SKILL.md +199 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-debt-tracker/SKILL.md +174 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-handoff/SKILL.md +125 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-md/SKILL.md +106 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-retrospective/SKILL.md +266 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-review/SKILL.md +123 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-system-alignment/SKILL.md +120 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/designpowers-critique/SKILL.md +164 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/heuristic-evaluation/SKILL.md +85 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/inclusive-personas/SKILL.md +98 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/inspiration-scouting/SKILL.md +165 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/interaction-design/SKILL.md +122 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/motion-choreography/SKILL.md +81 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/research-planning/SKILL.md +96 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/responsive-patterns/SKILL.md +77 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/synthetic-user-testing/SKILL.md +192 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/taste-feedback/SKILL.md +165 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/taste-report/SKILL.md +78 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/token-architecture/SKILL.md +75 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/ui-composition/SKILL.md +117 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/usability-testing/SKILL.md +78 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/verification-before-shipping/SKILL.md +125 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/voice-and-tone/SKILL.md +79 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/writing-design-plans/SKILL.md +119 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/core.py +0 -0
- package/packages/omo-codex/plugin/skills/git-master/SKILL.md +4 -0
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +4 -0
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +44 -13
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +48 -13
- package/packages/omo-codex/plugin/skills/lcx-doctor/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +44 -13
- package/packages/omo-codex/plugin/skills/lcx-report-bug/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +4 -0
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +4 -0
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +12 -4
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +14 -8
- package/packages/omo-codex/plugin/skills/teammode/SKILL.md +57 -7
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-guide.mjs +32 -5
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-state.mjs +63 -1
- package/packages/omo-codex/plugin/skills/teammode/scripts/team.mjs +87 -53
- package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +4 -250
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +22 -14
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +6 -4
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +11 -6
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +3 -3
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +1 -1
- package/{dist/skills/ultraresearch → packages/omo-codex/plugin/skills/ulw-research}/ATTRIBUTION.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +262 -0
- package/packages/omo-codex/plugin/skills/ulw-research/agents/openai.yaml +2 -0
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +113 -18
- package/packages/omo-codex/plugin/skills/visual-qa/references/agent-browser-setup.md +5 -4
- package/packages/omo-codex/plugin/skills/visual-qa/scripts/visual-qa.mjs +530 -0
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +23 -0
- package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -0
- package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +1 -0
- package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +24 -1
- package/packages/omo-codex/plugin/test/bootstrap-binlinks.test.mjs +61 -7
- package/packages/omo-codex/plugin/test/bootstrap-hooks.test.mjs +38 -0
- package/packages/omo-codex/plugin/test/bootstrap-ps-guard.test.mjs +25 -0
- package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +1 -7
- package/packages/omo-codex/plugin/test/component-bin-names.test.mjs +12 -11
- package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +99 -1
- package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +62 -8
- package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +206 -6
- package/packages/omo-codex/plugin/test/node-install-surface.test.mjs +1 -0
- package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +44 -0
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +50 -1
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +10 -7
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +28 -2
- package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +102 -0
- package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +20 -0
- package/packages/omo-codex/plugin/test/teammode-safety-fixture.mjs +41 -1
- package/packages/omo-codex/plugin/test/teammode-safety.test.mjs +93 -0
- package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +117 -0
- package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +5 -2
- package/packages/omo-codex/plugin/test/ulw-research-skill-contract.test.mjs +285 -0
- package/packages/omo-codex/scripts/install-bin-links.test.mjs +12 -1
- package/packages/omo-codex/scripts/install-cache-copy.test.mjs +79 -0
- package/packages/omo-codex/scripts/install-config-autonomous-features.test.mjs +43 -3
- package/packages/omo-codex/scripts/install-config.test.mjs +198 -17
- package/packages/omo-codex/scripts/install-delegated-command.test.mjs +93 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +803 -309
- package/packages/omo-codex/scripts/install-local-entrypoint.test.mjs +21 -2
- package/packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs +24 -15
- package/packages/omo-codex/scripts/install-local.test.mjs +5 -2
- package/packages/omo-codex/scripts/install-mcp-context7-runtime.test.mjs +84 -0
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +128 -0
- package/packages/shared-skills/skills/coding-agent-sessions/agents/openai.yaml +4 -0
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +71 -0
- package/packages/shared-skills/skills/coding-agent-sessions/references/claude.md +32 -0
- package/packages/shared-skills/skills/coding-agent-sessions/references/codex.md +30 -0
- package/packages/shared-skills/skills/coding-agent-sessions/references/opencode.md +43 -0
- package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +17 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +92 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +52 -8
- package/packages/shared-skills/skills/frontend/SKILL.md +29 -8
- package/packages/shared-skills/skills/frontend/references/design/README.md +29 -12
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +3 -3
- package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +22 -19
- package/packages/shared-skills/skills/frontend/references/designpowers/EVIDENCE.md +89 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/README.md +48 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/UPSTREAM.md +80 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-a-direction.md +64 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-b-execution.md +65 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-c-review.md +65 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-d-memory.md +83 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/orchestration.md +80 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/routing.md +79 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/LICENSE +21 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/accessibility-reviewer.md +83 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/content-writer.md +132 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-builder.md +109 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-critic.md +89 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-lead.md +113 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-scout.md +78 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-strategist.md +121 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/heuristic-evaluator.md +268 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/inspiration-scout.md +107 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/motion-designer.md +120 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/accessible-content/SKILL.md +101 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/adaptive-interfaces/SKILL.md +109 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/cognitive-accessibility/SKILL.md +107 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-debate/SKILL.md +199 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-debt-tracker/SKILL.md +174 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-handoff/SKILL.md +125 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-md/SKILL.md +106 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-retrospective/SKILL.md +266 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-review/SKILL.md +123 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-system-alignment/SKILL.md +120 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/designpowers-critique/SKILL.md +164 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/heuristic-evaluation/SKILL.md +85 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/inclusive-personas/SKILL.md +98 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/inspiration-scouting/SKILL.md +165 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/interaction-design/SKILL.md +122 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/motion-choreography/SKILL.md +81 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/research-planning/SKILL.md +96 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/responsive-patterns/SKILL.md +77 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/synthetic-user-testing/SKILL.md +192 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/taste-feedback/SKILL.md +165 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/taste-report/SKILL.md +78 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/token-architecture/SKILL.md +75 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/ui-composition/SKILL.md +117 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/usability-testing/SKILL.md +78 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/verification-before-shipping/SKILL.md +125 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/voice-and-tone/SKILL.md +79 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/writing-design-plans/SKILL.md +119 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/core.py +0 -0
- package/packages/shared-skills/skills/git-master/SKILL.md +4 -0
- package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +44 -13
- package/packages/shared-skills/skills/lcx-contribute-bug-fix/agents/openai.yaml +1 -1
- package/packages/shared-skills/skills/lcx-doctor/SKILL.md +48 -13
- package/packages/shared-skills/skills/lcx-doctor/agents/openai.yaml +1 -1
- package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +44 -13
- package/packages/shared-skills/skills/lcx-report-bug/agents/openai.yaml +1 -1
- package/packages/shared-skills/skills/review-work/SKILL.md +3 -3
- package/packages/shared-skills/skills/start-work/SKILL.md +7 -5
- package/packages/shared-skills/skills/ultraresearch/SKILL.md +4 -252
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +8 -6
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +11 -6
- package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +3 -3
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +1 -1
- package/packages/{omo-codex/plugin/skills/ultraresearch → shared-skills/skills/ulw-research}/ATTRIBUTION.md +1 -1
- package/packages/shared-skills/skills/ulw-research/SKILL.md +260 -0
- package/packages/shared-skills/skills/visual-qa/SKILL.md +109 -18
- package/packages/shared-skills/skills/visual-qa/references/agent-browser-setup.md +5 -4
- package/packages/shared-skills/skills/visual-qa/scripts/cli.test.ts +7 -2
- package/packages/shared-skills/skills/visual-qa/scripts/skill-prompt-contract.test.ts +130 -3
- package/packages/shared-skills/skills/visual-qa/scripts/visual-qa.mjs +530 -0
- package/script/qa/web-terminal-redaction.d.mts +13 -0
- package/script/qa/web-terminal-redaction.mjs +43 -0
- package/script/qa/web-terminal-renderer.mjs +218 -0
- package/script/qa/web-terminal-visual-qa.mjs +264 -0
- package/dist/cli/sparkshell-appserver-websocket.d.ts +0 -4
- package/dist/cli/sparkshell-appserver.d.ts +0 -16
- package/dist/cli/sparkshell-condense.d.ts +0 -10
- package/dist/cli/sparkshell-parse.d.ts +0 -24
- package/dist/cli/sparkshell-session-context.d.ts +0 -20
- package/dist/cli/sparkshell-spark.d.ts +0 -23
- package/dist/cli/sparkshell.d.ts +0 -33
- package/dist/shared/sparkshell-awareness.d.ts +0 -5
- package/packages/omo-codex/plugin/components/rules/src/sparkshell-awareness.ts +0 -106
- package/packages/omo-codex/plugin/components/rules/test/sparkshell-awareness.test.ts +0 -346
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/tests/test_cookie_domain_filter.py +0 -110
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/tests/test_extract_cookies.py +0 -245
- package/packages/omo-codex/plugin/test/ultraresearch-skill-contract.test.mjs +0 -204
|
@@ -5907,7 +5907,7 @@ var package_default;
|
|
|
5907
5907
|
var init_package = __esm(() => {
|
|
5908
5908
|
package_default = {
|
|
5909
5909
|
name: "@oh-my-opencode/omo-codex",
|
|
5910
|
-
version: "4.
|
|
5910
|
+
version: "4.14.1",
|
|
5911
5911
|
type: "module",
|
|
5912
5912
|
private: true,
|
|
5913
5913
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -6352,7 +6352,6 @@ function bunWhich(commandName) {
|
|
|
6352
6352
|
import { execFileSync } from "node:child_process";
|
|
6353
6353
|
import { existsSync } from "node:fs";
|
|
6354
6354
|
var GIT_BASH_ENV_KEY = "OMO_CODEX_GIT_BASH_PATH";
|
|
6355
|
-
var WINGET_INSTALL_ARGS = ["install", "--id", "Git.Git", "-e", "--source", "winget"];
|
|
6356
6355
|
var PROGRAM_FILES_GIT_BASH = "C:\\Program Files\\Git\\bin\\bash.exe";
|
|
6357
6356
|
var PROGRAM_FILES_X86_GIT_BASH = "C:\\Program Files (x86)\\Git\\bin\\bash.exe";
|
|
6358
6357
|
var NON_GIT_BASH_LAUNCHER_DIR_SEGMENTS = ["\\windows\\system32\\", "\\microsoft\\windowsapps\\"];
|
|
@@ -6469,6 +6468,44 @@ import { basename, isAbsolute, join as join4, relative, resolve, sep } from "nod
|
|
|
6469
6468
|
|
|
6470
6469
|
// packages/omo-codex/src/install/codex-cache-command-shim.ts
|
|
6471
6470
|
var COMMAND_SHIM_MARKER = ":: generated by oh-my-openagent Codex installer";
|
|
6471
|
+
function windowsNodeDiscoveryLines() {
|
|
6472
|
+
return [
|
|
6473
|
+
"setlocal EnableExtensions EnableDelayedExpansion",
|
|
6474
|
+
'set "OMO_NODE_BINARY="',
|
|
6475
|
+
'set "OMO_NODE_REPL_NODE_PATH=%NODE_REPL_NODE_PATH%"',
|
|
6476
|
+
'if exist "%CODEX_HOME%\\config.toml" (',
|
|
6477
|
+
` for /f "tokens=1,* delims==" %%A in ('findstr /R /C:"NODE_REPL_NODE_PATH[ ]*=" "%CODEX_HOME%\\config.toml" 2^>nul') do (`,
|
|
6478
|
+
' set "OMO_NODE_REPL_NODE_PATH=%%B"',
|
|
6479
|
+
" )",
|
|
6480
|
+
")",
|
|
6481
|
+
"if defined OMO_NODE_REPL_NODE_PATH (",
|
|
6482
|
+
' set "OMO_NODE_BINARY=!OMO_NODE_REPL_NODE_PATH!"',
|
|
6483
|
+
' for /f "tokens=* delims= " %%N in ("!OMO_NODE_BINARY!") do set "OMO_NODE_BINARY=%%N"',
|
|
6484
|
+
` if "!OMO_NODE_BINARY:~0,1!"=="'" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~1!"`,
|
|
6485
|
+
` if "!OMO_NODE_BINARY:~-1!"=="'" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~0,-1!"`,
|
|
6486
|
+
' if "!OMO_NODE_BINARY:~0,1!"=="^"" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~1!"',
|
|
6487
|
+
' if "!OMO_NODE_BINARY:~-1!"=="^"" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~0,-1!"',
|
|
6488
|
+
' if defined OMO_NODE_BINARY if not exist "!OMO_NODE_BINARY!" set "OMO_NODE_BINARY="',
|
|
6489
|
+
")",
|
|
6490
|
+
'if not defined OMO_NODE_BINARY where node >nul 2>nul && set "OMO_NODE_BINARY=node"'
|
|
6491
|
+
];
|
|
6492
|
+
}
|
|
6493
|
+
function windowsCommandShim(targetPath) {
|
|
6494
|
+
return [
|
|
6495
|
+
"@echo off",
|
|
6496
|
+
COMMAND_SHIM_MARKER,
|
|
6497
|
+
'if not defined CODEX_HOME set "CODEX_HOME=%USERPROFILE%\\.codex"',
|
|
6498
|
+
...windowsNodeDiscoveryLines(),
|
|
6499
|
+
"if not defined OMO_NODE_BINARY (",
|
|
6500
|
+
" echo omo: no Node runtime was discovered from NODE_REPL_NODE_PATH or PATH; rerun LazyCodex install from Codex Desktop 1>&2",
|
|
6501
|
+
" exit /b 127",
|
|
6502
|
+
")",
|
|
6503
|
+
`"%OMO_NODE_BINARY%" "${targetPath}" %*`,
|
|
6504
|
+
"exit /b %ERRORLEVEL%",
|
|
6505
|
+
""
|
|
6506
|
+
].join(`\r
|
|
6507
|
+
`);
|
|
6508
|
+
}
|
|
6472
6509
|
|
|
6473
6510
|
// packages/omo-codex/src/install/codex-cache-fs.ts
|
|
6474
6511
|
import { lstat } from "node:fs/promises";
|
|
@@ -6566,10 +6603,9 @@ function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
|
6566
6603
|
"#!/bin/sh",
|
|
6567
6604
|
`# ${RUNTIME_WRAPPER_MARKER}`,
|
|
6568
6605
|
`export CODEX_HOME="\${CODEX_HOME:-${escapedCodexHome}}"`,
|
|
6569
|
-
'export OMO_SPARKSHELL_APP_SERVER_SOCKET="${OMO_SPARKSHELL_APP_SERVER_SOCKET:-$CODEX_HOME/app-server-control/app-server-control.sock}"',
|
|
6570
6606
|
'if [ "$1" = "ulw-loop" ] && [ -x "' + escapedUlwLoopBin + '" ]; then',
|
|
6571
6607
|
" shift",
|
|
6572
|
-
' exec "' + escapedUlwLoopBin + '" "$@"',
|
|
6608
|
+
' exec "' + escapedUlwLoopBin + '" ulw-loop "$@"',
|
|
6573
6609
|
"fi",
|
|
6574
6610
|
`if [ "\${OMO_RUNTIME:-}" = "node" ] && [ -f "${nodeCli}" ]; then`,
|
|
6575
6611
|
` exec node "${nodeCli}" "$@"`,
|
|
@@ -6608,24 +6644,24 @@ function windowsRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
|
6608
6644
|
"@echo off",
|
|
6609
6645
|
`rem ${RUNTIME_WRAPPER_MARKER}`,
|
|
6610
6646
|
`if not defined CODEX_HOME set "CODEX_HOME=${codexHome}"`,
|
|
6611
|
-
|
|
6647
|
+
...windowsNodeDiscoveryLines(),
|
|
6612
6648
|
`if "%~1"=="ulw-loop" if exist "${ulwLoopBin}" (`,
|
|
6613
6649
|
" shift /1",
|
|
6614
|
-
` "${ulwLoopBin}" %*`,
|
|
6650
|
+
` "${ulwLoopBin}" ulw-loop %*`,
|
|
6615
6651
|
" exit /b %ERRORLEVEL%",
|
|
6616
6652
|
")",
|
|
6617
|
-
`if "%OMO_RUNTIME%"=="node" if exist "${nodeCliPath}" (`,
|
|
6618
|
-
`
|
|
6653
|
+
`if "%OMO_RUNTIME%"=="node" if defined OMO_NODE_BINARY if exist "${nodeCliPath}" (`,
|
|
6654
|
+
` "%OMO_NODE_BINARY%" "${nodeCliPath}" %*`,
|
|
6619
6655
|
" exit /b %ERRORLEVEL%",
|
|
6620
6656
|
")",
|
|
6621
6657
|
'if not defined BUN_BINARY where bun >nul 2>nul && set "BUN_BINARY=bun"',
|
|
6622
6658
|
'if not defined BUN_BINARY if exist "%USERPROFILE%\\.bun\\bin\\bun.exe" set "BUN_BINARY=%USERPROFILE%\\.bun\\bin\\bun.exe"',
|
|
6623
6659
|
"if not defined BUN_BINARY (",
|
|
6624
|
-
` if exist "${nodeCliPath}" (`,
|
|
6625
|
-
`
|
|
6660
|
+
` if defined OMO_NODE_BINARY if exist "${nodeCliPath}" (`,
|
|
6661
|
+
` "%OMO_NODE_BINARY%" "${nodeCliPath}" %*`,
|
|
6626
6662
|
" exit /b %ERRORLEVEL%",
|
|
6627
6663
|
" )",
|
|
6628
|
-
` echo omo: bun runtime not found
|
|
6664
|
+
` echo omo: bun runtime not found, no Node runtime was discovered from NODE_REPL_NODE_PATH or PATH, or the node fallback CLI is missing at ${nodeCliPath}; install bun from https://bun.sh or rerun LazyCodex install from Codex Desktop 1>&2`,
|
|
6629
6665
|
" exit /b 127",
|
|
6630
6666
|
")",
|
|
6631
6667
|
`if not exist "${cliPath}" (`,
|
|
@@ -6658,6 +6694,20 @@ async function linkCachedPluginBins(input) {
|
|
|
6658
6694
|
}
|
|
6659
6695
|
return linked;
|
|
6660
6696
|
}
|
|
6697
|
+
async function removeCachedManagedNpmBinShims(pluginRoot) {
|
|
6698
|
+
const binLinks = await discoverPackageBins(pluginRoot);
|
|
6699
|
+
if (binLinks.length === 0)
|
|
6700
|
+
return;
|
|
6701
|
+
const npmBinDir = join4(pluginRoot, "node_modules", ".bin");
|
|
6702
|
+
if (!await isFileSystemEntry(npmBinDir))
|
|
6703
|
+
return;
|
|
6704
|
+
const managedBinNames = new Set(binLinks.map((link) => link.name));
|
|
6705
|
+
for (const name of managedBinNames) {
|
|
6706
|
+
for (const suffix of ["", ".cmd", ".ps1"]) {
|
|
6707
|
+
await rm2(join4(npmBinDir, `${name}${suffix}`), { force: true });
|
|
6708
|
+
}
|
|
6709
|
+
}
|
|
6710
|
+
}
|
|
6661
6711
|
async function linkRootRuntimeBin(input) {
|
|
6662
6712
|
const cliPath = join4(input.repoRoot, "dist", "cli", "index.js");
|
|
6663
6713
|
if (!await isFile(cliPath))
|
|
@@ -6694,6 +6744,16 @@ async function isFile(path) {
|
|
|
6694
6744
|
throw error;
|
|
6695
6745
|
}
|
|
6696
6746
|
}
|
|
6747
|
+
async function isFileSystemEntry(path) {
|
|
6748
|
+
try {
|
|
6749
|
+
await stat(path);
|
|
6750
|
+
return true;
|
|
6751
|
+
} catch (error) {
|
|
6752
|
+
if (isNodeErrorWithCode(error) && error.code === "ENOENT")
|
|
6753
|
+
return false;
|
|
6754
|
+
throw error;
|
|
6755
|
+
}
|
|
6756
|
+
}
|
|
6697
6757
|
async function discoverPackageBins(root) {
|
|
6698
6758
|
const links = [];
|
|
6699
6759
|
await collectPackageBins(root, root, links);
|
|
@@ -6768,10 +6828,7 @@ async function replaceSymlink(linkPath, targetPath) {
|
|
|
6768
6828
|
async function replaceCommandShim(linkPath, targetPath) {
|
|
6769
6829
|
if (await existingNonShim(linkPath))
|
|
6770
6830
|
throw new Error(`${linkPath} already exists and is not a command shim`);
|
|
6771
|
-
await writeFile(linkPath,
|
|
6772
|
-
${COMMAND_SHIM_MARKER}\r
|
|
6773
|
-
node "${targetPath}" %*\r
|
|
6774
|
-
`);
|
|
6831
|
+
await writeFile(linkPath, windowsCommandShim(targetPath));
|
|
6775
6832
|
}
|
|
6776
6833
|
async function replaceRuntimeWrapper(linkPath, content) {
|
|
6777
6834
|
if (await existingNonRuntimeWrapper(linkPath))
|
|
@@ -6824,7 +6881,7 @@ async function existingNonSymlink(path) {
|
|
|
6824
6881
|
}
|
|
6825
6882
|
// packages/omo-codex/src/install/codex-cache-install.ts
|
|
6826
6883
|
import { cp as cp2, mkdir as mkdir3, readFile as readFile7, rename, rm as rm3 } from "node:fs/promises";
|
|
6827
|
-
import { basename as
|
|
6884
|
+
import { basename as basename3, dirname as dirname4, join as join11, sep as sep5 } from "node:path";
|
|
6828
6885
|
|
|
6829
6886
|
// packages/omo-codex/src/install/codex-cache-bundled-mcps.ts
|
|
6830
6887
|
import { cp, mkdir as mkdir2, readFile as readFile3, stat as stat2 } from "node:fs/promises";
|
|
@@ -7042,10 +7099,127 @@ async function collectPackageJsonPaths(directory, root, paths) {
|
|
|
7042
7099
|
|
|
7043
7100
|
// packages/omo-codex/src/install/codex-cache-mcp-manifest.ts
|
|
7044
7101
|
import { readFile as readFile5, writeFile as writeFile3 } from "node:fs/promises";
|
|
7045
|
-
import { join as
|
|
7102
|
+
import { join as join9, sep as sep3 } from "node:path";
|
|
7103
|
+
|
|
7104
|
+
// packages/utils/src/codegraph/resolve.ts
|
|
7105
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
7106
|
+
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
7107
|
+
import { basename as basename2, dirname as dirname3, join as join8 } from "node:path";
|
|
7108
|
+
import { createRequire } from "node:module";
|
|
7109
|
+
|
|
7110
|
+
// packages/utils/src/codegraph/node-support.ts
|
|
7111
|
+
var CODEGRAPH_MIN_NODE_MAJOR = 20;
|
|
7112
|
+
var CODEGRAPH_BLOCKED_NODE_MAJOR = 25;
|
|
7113
|
+
var CODEGRAPH_UNSAFE_NODE_ENV = "CODEGRAPH_ALLOW_UNSAFE_NODE";
|
|
7114
|
+
var CODEGRAPH_NODE_BIN_ENV = "CODEGRAPH_NODE_BIN";
|
|
7115
|
+
function evaluateCodegraphNodeSupport(options = {}) {
|
|
7116
|
+
const nodeVersion = options.nodeVersion ?? process.versions.node;
|
|
7117
|
+
const env = options.env ?? process.env;
|
|
7118
|
+
const override = (env[CODEGRAPH_UNSAFE_NODE_ENV]?.trim().length ?? 0) > 0;
|
|
7119
|
+
const major = parseNodeMajor(nodeVersion);
|
|
7120
|
+
if (major >= CODEGRAPH_BLOCKED_NODE_MAJOR) {
|
|
7121
|
+
return { major, override, reason: "too-new", supported: override };
|
|
7122
|
+
}
|
|
7123
|
+
if (major < CODEGRAPH_MIN_NODE_MAJOR) {
|
|
7124
|
+
return { major, override, reason: "too-old", supported: override };
|
|
7125
|
+
}
|
|
7126
|
+
return { major, override, supported: true };
|
|
7127
|
+
}
|
|
7128
|
+
function parseNodeMajor(version) {
|
|
7129
|
+
const normalized = version.startsWith("v") ? version.slice(1) : version;
|
|
7130
|
+
const major = Number.parseInt(normalized.split(".")[0] ?? "", 10);
|
|
7131
|
+
return Number.isNaN(major) ? 0 : major;
|
|
7132
|
+
}
|
|
7133
|
+
|
|
7134
|
+
// packages/utils/src/codegraph/resolve.ts
|
|
7135
|
+
var CODEGRAPH_NODE_CANDIDATES = ["node24", "node22", "node20", "node"];
|
|
7136
|
+
var CODEGRAPH_NODE_PATH_CANDIDATES = [
|
|
7137
|
+
"/opt/homebrew/opt/node@24/bin/node",
|
|
7138
|
+
"/opt/homebrew/opt/node@22/bin/node",
|
|
7139
|
+
"/opt/homebrew/opt/node@20/bin/node",
|
|
7140
|
+
"/usr/local/opt/node@24/bin/node",
|
|
7141
|
+
"/usr/local/opt/node@22/bin/node",
|
|
7142
|
+
"/usr/local/opt/node@20/bin/node"
|
|
7143
|
+
];
|
|
7144
|
+
var requireFromHere = createRequire(import.meta.url);
|
|
7145
|
+
function defaultNodeVersion(nodePath) {
|
|
7146
|
+
if (nodePath === process.execPath && isNodeExecutableName(nodePath))
|
|
7147
|
+
return process.versions.node;
|
|
7148
|
+
try {
|
|
7149
|
+
const result = spawnSync2(nodePath, ["--version"], {
|
|
7150
|
+
encoding: "utf8",
|
|
7151
|
+
timeout: 2000,
|
|
7152
|
+
windowsHide: true
|
|
7153
|
+
});
|
|
7154
|
+
if (result.error !== undefined || result.status !== 0)
|
|
7155
|
+
return null;
|
|
7156
|
+
const version = `${result.stdout}
|
|
7157
|
+
${result.stderr}`.trim().split(/\s+/)[0];
|
|
7158
|
+
return version === undefined || version.length === 0 ? null : version;
|
|
7159
|
+
} catch (error) {
|
|
7160
|
+
if (error instanceof Error)
|
|
7161
|
+
return null;
|
|
7162
|
+
throw error;
|
|
7163
|
+
}
|
|
7164
|
+
}
|
|
7165
|
+
function isNodeExecutableName(filePath) {
|
|
7166
|
+
const executable = basename2(filePath).toLowerCase();
|
|
7167
|
+
return executable === "node" || executable === "node.exe" || /^node\d+(\.exe)?$/.test(executable);
|
|
7168
|
+
}
|
|
7169
|
+
function looksLikePath(command) {
|
|
7170
|
+
return command.includes("/") || command.includes("\\") || /^[a-zA-Z]:/.test(command);
|
|
7171
|
+
}
|
|
7172
|
+
function resolveConfiguredNodeRuntime(configured, fileExists, which2) {
|
|
7173
|
+
if (looksLikePath(configured))
|
|
7174
|
+
return fileExists(configured) ? configured : null;
|
|
7175
|
+
return which2(configured);
|
|
7176
|
+
}
|
|
7177
|
+
function supportsCodegraphNodeRuntime(nodePath, env, nodeVersion) {
|
|
7178
|
+
const version = nodeVersion(nodePath);
|
|
7179
|
+
if (version === null)
|
|
7180
|
+
return false;
|
|
7181
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: version }).supported;
|
|
7182
|
+
}
|
|
7183
|
+
function defaultNodeRuntime(env, fileExists, which2, nodeVersion) {
|
|
7184
|
+
const configured = env[CODEGRAPH_NODE_BIN_ENV]?.trim();
|
|
7185
|
+
if (configured !== undefined && configured.length > 0) {
|
|
7186
|
+
const resolved = resolveConfiguredNodeRuntime(configured, fileExists, which2);
|
|
7187
|
+
return resolved !== null && supportsCodegraphNodeRuntime(resolved, env, nodeVersion) ? resolved : null;
|
|
7188
|
+
}
|
|
7189
|
+
const candidates = [
|
|
7190
|
+
...isNodeExecutableName(process.execPath) ? [process.execPath] : [],
|
|
7191
|
+
...CODEGRAPH_NODE_CANDIDATES.map((commandName) => which2(commandName)).filter((candidate) => candidate !== null),
|
|
7192
|
+
...CODEGRAPH_NODE_PATH_CANDIDATES.filter((candidate) => fileExists(candidate))
|
|
7193
|
+
];
|
|
7194
|
+
const seen = new Set;
|
|
7195
|
+
for (const candidate of candidates) {
|
|
7196
|
+
if (seen.has(candidate))
|
|
7197
|
+
continue;
|
|
7198
|
+
seen.add(candidate);
|
|
7199
|
+
if (supportsCodegraphNodeRuntime(candidate, env, nodeVersion))
|
|
7200
|
+
return candidate;
|
|
7201
|
+
}
|
|
7202
|
+
return null;
|
|
7203
|
+
}
|
|
7204
|
+
function resolveCodegraphNodeRuntime(options = {}) {
|
|
7205
|
+
const env = options.env ?? process.env;
|
|
7206
|
+
return defaultNodeRuntime(env, options.fileExists ?? existsSync2, options.which ?? bunWhich, options.nodeVersion ?? defaultNodeVersion);
|
|
7207
|
+
}
|
|
7208
|
+
function resolveCodegraphNodeSupport(options = {}) {
|
|
7209
|
+
const env = options.env ?? process.env;
|
|
7210
|
+
const nodeVersion = options.nodeVersion ?? defaultNodeVersion;
|
|
7211
|
+
const runtime3 = resolveCodegraphNodeRuntime({ ...options, env, nodeVersion });
|
|
7212
|
+
if (runtime3 === null) {
|
|
7213
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: "0.0.0" });
|
|
7214
|
+
}
|
|
7215
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: nodeVersion(runtime3) ?? "0.0.0" });
|
|
7216
|
+
}
|
|
7217
|
+
|
|
7218
|
+
// packages/omo-codex/src/install/codex-cache-mcp-manifest.ts
|
|
7046
7219
|
var CODEGRAPH_RELATIVE_ARGS = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
7047
|
-
|
|
7048
|
-
|
|
7220
|
+
var CONTEXT7_API_KEY_ENV = "CONTEXT7_API_KEY";
|
|
7221
|
+
async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot, options = {}) {
|
|
7222
|
+
const manifestPath = join9(pluginRoot, ".mcp.json");
|
|
7049
7223
|
if (!await fileExistsStrict(manifestPath))
|
|
7050
7224
|
return;
|
|
7051
7225
|
const raw = await readFile5(manifestPath, "utf8");
|
|
@@ -7053,7 +7227,7 @@ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
|
7053
7227
|
if (!isPlainRecord(parsed) || !isPlainRecord(parsed.mcpServers))
|
|
7054
7228
|
return;
|
|
7055
7229
|
let changed = false;
|
|
7056
|
-
for (const server of Object.
|
|
7230
|
+
for (const [serverName, server] of Object.entries(parsed.mcpServers)) {
|
|
7057
7231
|
if (!isPlainRecord(server))
|
|
7058
7232
|
continue;
|
|
7059
7233
|
if (server.cwd === "." || server.cwd === "./") {
|
|
@@ -7061,31 +7235,95 @@ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
|
7061
7235
|
changed = true;
|
|
7062
7236
|
}
|
|
7063
7237
|
const currentArgs = server.args;
|
|
7064
|
-
if (
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7238
|
+
if (Array.isArray(currentArgs)) {
|
|
7239
|
+
const nextArgs = currentArgs.map((arg) => {
|
|
7240
|
+
if (typeof arg !== "string")
|
|
7241
|
+
return arg;
|
|
7242
|
+
const bundledMcpRuntimeArg = resolveBundledMcpRuntimeArg(pluginRoot, arg);
|
|
7243
|
+
if (bundledMcpRuntimeArg !== null)
|
|
7244
|
+
return bundledMcpRuntimeArg;
|
|
7245
|
+
if (CODEGRAPH_RELATIVE_ARGS.has(arg))
|
|
7246
|
+
return join9(pluginRoot, "components", "codegraph", "dist", "serve.js");
|
|
7247
|
+
if (arg.startsWith("./") || arg.startsWith("../"))
|
|
7248
|
+
return resolveCachedRuntimePath(pluginRoot, sourceRoot, arg);
|
|
7068
7249
|
return arg;
|
|
7069
|
-
|
|
7070
|
-
if (
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
return arg;
|
|
7077
|
-
});
|
|
7078
|
-
if (nextArgs.some((value, index) => value !== currentArgs[index])) {
|
|
7079
|
-
server.args = nextArgs;
|
|
7250
|
+
});
|
|
7251
|
+
if (nextArgs.some((value, index) => value !== currentArgs[index])) {
|
|
7252
|
+
server.args = nextArgs;
|
|
7253
|
+
changed = true;
|
|
7254
|
+
}
|
|
7255
|
+
}
|
|
7256
|
+
if (serverName === "context7" && sanitizeContext7Auth(server)) {
|
|
7080
7257
|
changed = true;
|
|
7081
7258
|
}
|
|
7259
|
+
if (!Array.isArray(currentArgs))
|
|
7260
|
+
continue;
|
|
7261
|
+
if (server === parsed.mcpServers.codegraph) {
|
|
7262
|
+
const runtime3 = options.codegraphNodeRuntime?.() ?? resolveCodegraphNodeRuntime();
|
|
7263
|
+
if (runtime3 !== null && server.command === "node") {
|
|
7264
|
+
server.command = runtime3;
|
|
7265
|
+
changed = true;
|
|
7266
|
+
}
|
|
7267
|
+
}
|
|
7082
7268
|
}
|
|
7083
7269
|
if (changed)
|
|
7084
7270
|
await writeFile3(manifestPath, `${JSON.stringify(parsed, null, "\t")}
|
|
7085
7271
|
`);
|
|
7086
7272
|
}
|
|
7273
|
+
function sanitizeContext7Auth(server) {
|
|
7274
|
+
let changed = false;
|
|
7275
|
+
const currentArgs = server.args;
|
|
7276
|
+
if (Array.isArray(currentArgs)) {
|
|
7277
|
+
const nextArgs = removeContext7ApiKeyArgs(currentArgs);
|
|
7278
|
+
if (nextArgs.some((value, index) => value !== currentArgs[index]) || nextArgs.length !== currentArgs.length) {
|
|
7279
|
+
server.args = nextArgs;
|
|
7280
|
+
changed = true;
|
|
7281
|
+
}
|
|
7282
|
+
}
|
|
7283
|
+
const beforeEnv = JSON.stringify(server.env);
|
|
7284
|
+
const nextEnv = sanitizeContext7Env(server.env);
|
|
7285
|
+
if (Object.keys(nextEnv).length > 0) {
|
|
7286
|
+
server.env = nextEnv;
|
|
7287
|
+
} else {
|
|
7288
|
+
delete server.env;
|
|
7289
|
+
}
|
|
7290
|
+
return changed || JSON.stringify(server.env) !== beforeEnv;
|
|
7291
|
+
}
|
|
7292
|
+
function removeContext7ApiKeyArgs(args) {
|
|
7293
|
+
const nextArgs = [];
|
|
7294
|
+
for (let index = 0;index < args.length; index += 1) {
|
|
7295
|
+
const arg = args[index];
|
|
7296
|
+
const value = args[index + 1];
|
|
7297
|
+
if (typeof arg === "string" && isContext7ApiKeyFlag(arg) && (isPlaceholderContext7ApiKey(value) || value === undefined)) {
|
|
7298
|
+
index += 1;
|
|
7299
|
+
continue;
|
|
7300
|
+
}
|
|
7301
|
+
nextArgs.push(arg);
|
|
7302
|
+
}
|
|
7303
|
+
return nextArgs;
|
|
7304
|
+
}
|
|
7305
|
+
function sanitizeContext7Env(value) {
|
|
7306
|
+
const nextEnv = {};
|
|
7307
|
+
if (isPlainRecord(value)) {
|
|
7308
|
+
for (const [key, envValue] of Object.entries(value)) {
|
|
7309
|
+
if (key === CONTEXT7_API_KEY_ENV && isPlaceholderContext7ApiKey(envValue))
|
|
7310
|
+
continue;
|
|
7311
|
+
nextEnv[key] = envValue;
|
|
7312
|
+
}
|
|
7313
|
+
}
|
|
7314
|
+
return nextEnv;
|
|
7315
|
+
}
|
|
7316
|
+
function isContext7ApiKeyFlag(value) {
|
|
7317
|
+
return value === "--api-key" || value === "--apiKey";
|
|
7318
|
+
}
|
|
7319
|
+
function isPlaceholderContext7ApiKey(value) {
|
|
7320
|
+
if (typeof value !== "string")
|
|
7321
|
+
return false;
|
|
7322
|
+
const normalized = value.trim().toLowerCase().replace(/[<>"'`]/g, "").replace(/[\s_-]+/g, " ");
|
|
7323
|
+
return normalized.length === 0 || normalized === "your api key";
|
|
7324
|
+
}
|
|
7087
7325
|
async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
|
|
7088
|
-
const manifestPath =
|
|
7326
|
+
const manifestPath = join9(pluginRoot, ".mcp.json");
|
|
7089
7327
|
if (!await fileExistsStrict(manifestPath))
|
|
7090
7328
|
return;
|
|
7091
7329
|
const raw = await readFile5(manifestPath, "utf8");
|
|
@@ -7121,7 +7359,7 @@ async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
|
|
|
7121
7359
|
|
|
7122
7360
|
// packages/omo-codex/src/install/codex-hook-targets.ts
|
|
7123
7361
|
import { readFile as readFile6 } from "node:fs/promises";
|
|
7124
|
-
import { join as
|
|
7362
|
+
import { join as join10, sep as sep4 } from "node:path";
|
|
7125
7363
|
var PLUGIN_ROOT_TARGET_PATTERN = /\$\{PLUGIN_ROOT\}[\\/]+([^"']+)/g;
|
|
7126
7364
|
async function findMissingHookCommandTargets(pluginRoot) {
|
|
7127
7365
|
const commands = [];
|
|
@@ -7138,7 +7376,7 @@ async function findMissingHookCommandTargets(pluginRoot) {
|
|
|
7138
7376
|
const targetSuffix = match[1];
|
|
7139
7377
|
if (targetSuffix === undefined)
|
|
7140
7378
|
continue;
|
|
7141
|
-
const target =
|
|
7379
|
+
const target = join10(pluginRoot, ...targetSuffix.split(/[\\/]+/));
|
|
7142
7380
|
if (seen.has(target))
|
|
7143
7381
|
continue;
|
|
7144
7382
|
seen.add(target);
|
|
@@ -7149,17 +7387,17 @@ async function findMissingHookCommandTargets(pluginRoot) {
|
|
|
7149
7387
|
return missing;
|
|
7150
7388
|
}
|
|
7151
7389
|
async function hookManifestPaths(pluginRoot) {
|
|
7152
|
-
const pluginManifestPath =
|
|
7390
|
+
const pluginManifestPath = join10(pluginRoot, ".codex-plugin", "plugin.json");
|
|
7153
7391
|
if (!await fileExistsStrict(pluginManifestPath))
|
|
7154
|
-
return [
|
|
7392
|
+
return [join10(pluginRoot, "hooks", "hooks.json")];
|
|
7155
7393
|
const parsed = JSON.parse(await readFile6(pluginManifestPath, "utf8"));
|
|
7156
7394
|
if (!isPlainRecord(parsed))
|
|
7157
7395
|
return [];
|
|
7158
7396
|
if (typeof parsed.hooks === "string" && parsed.hooks.trim() !== "") {
|
|
7159
|
-
return [
|
|
7397
|
+
return [join10(pluginRoot, stripDotSlash(parsed.hooks))];
|
|
7160
7398
|
}
|
|
7161
7399
|
if (Array.isArray(parsed.hooks)) {
|
|
7162
|
-
return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) =>
|
|
7400
|
+
return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) => join10(pluginRoot, stripDotSlash(hookPath)));
|
|
7163
7401
|
}
|
|
7164
7402
|
return [];
|
|
7165
7403
|
}
|
|
@@ -7195,14 +7433,16 @@ async function installCachedPlugin(input) {
|
|
|
7195
7433
|
await maybeRunNpmInstall(input.sourcePath, input.runCommand);
|
|
7196
7434
|
await maybeRunNpmBuild(input.sourcePath, input.runCommand);
|
|
7197
7435
|
}
|
|
7198
|
-
const targetPath =
|
|
7436
|
+
const targetPath = join11(input.codexHome, "plugins", "cache", input.marketplaceName, input.name, input.version);
|
|
7199
7437
|
const tempPath = createTempSiblingPath(targetPath);
|
|
7200
7438
|
await rm3(tempPath, { recursive: true, force: true });
|
|
7201
7439
|
try {
|
|
7202
7440
|
await copyDirectory(input.sourcePath, tempPath);
|
|
7203
7441
|
await rewriteCachedPackageLocalFileDependencies(tempPath, input.sourcePath);
|
|
7204
7442
|
await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: input.sourcePath });
|
|
7443
|
+
await copyRootRuntimeDists({ pluginRoot: tempPath, sourcePath: input.sourcePath });
|
|
7205
7444
|
await maybeRunNpmInstall(tempPath, input.runCommand, ["ci", "--omit=dev"]);
|
|
7445
|
+
await removeCachedManagedNpmBinShims(tempPath);
|
|
7206
7446
|
if (input.buildSource === false)
|
|
7207
7447
|
await maybeRunNpmSyncSkills(tempPath, input.runCommand);
|
|
7208
7448
|
await rewriteCachedMcpManifest(tempPath, input.sourcePath);
|
|
@@ -7216,14 +7456,14 @@ async function installCachedPlugin(input) {
|
|
|
7216
7456
|
return { name: input.name, version: input.version, path: targetPath };
|
|
7217
7457
|
}
|
|
7218
7458
|
async function maybeRunNpmInstall(cwd, runCommand, args = ["install"]) {
|
|
7219
|
-
if (!await fileExistsStrict(
|
|
7459
|
+
if (!await fileExistsStrict(join11(cwd, "package.json")))
|
|
7220
7460
|
return;
|
|
7221
7461
|
await runCommand("npm", args, { cwd });
|
|
7222
7462
|
}
|
|
7223
7463
|
async function maybeRunNpmBuild(cwd, runCommand) {
|
|
7224
|
-
if (!await fileExistsStrict(
|
|
7464
|
+
if (!await fileExistsStrict(join11(cwd, "package.json")))
|
|
7225
7465
|
return;
|
|
7226
|
-
const packageJson = JSON.parse(await readFile7(
|
|
7466
|
+
const packageJson = JSON.parse(await readFile7(join11(cwd, "package.json"), "utf8"));
|
|
7227
7467
|
if (!isPlainRecord(packageJson))
|
|
7228
7468
|
return;
|
|
7229
7469
|
const scripts = packageJson.scripts;
|
|
@@ -7232,9 +7472,9 @@ async function maybeRunNpmBuild(cwd, runCommand) {
|
|
|
7232
7472
|
await runCommand("npm", ["run", "build"], { cwd });
|
|
7233
7473
|
}
|
|
7234
7474
|
async function maybeRunNpmSyncSkills(cwd, runCommand) {
|
|
7235
|
-
if (!await fileExistsStrict(
|
|
7475
|
+
if (!await fileExistsStrict(join11(cwd, "package.json")))
|
|
7236
7476
|
return;
|
|
7237
|
-
const packageJson = JSON.parse(await readFile7(
|
|
7477
|
+
const packageJson = JSON.parse(await readFile7(join11(cwd, "package.json"), "utf8"));
|
|
7238
7478
|
if (!isPlainRecord(packageJson))
|
|
7239
7479
|
return;
|
|
7240
7480
|
const scripts = packageJson.scripts;
|
|
@@ -7243,13 +7483,13 @@ async function maybeRunNpmSyncSkills(cwd, runCommand) {
|
|
|
7243
7483
|
await runCommand("npm", ["run", "sync:skills"], { cwd });
|
|
7244
7484
|
}
|
|
7245
7485
|
function createTempSiblingPath(targetPath) {
|
|
7246
|
-
return
|
|
7486
|
+
return join11(dirname4(targetPath), `.tmp-${basename3(targetPath)}-${process.pid}-${Date.now()}`);
|
|
7247
7487
|
}
|
|
7248
7488
|
function createBackupSiblingPath(targetPath) {
|
|
7249
|
-
return
|
|
7489
|
+
return join11(dirname4(targetPath), `.backup-${basename3(targetPath)}-${process.pid}-${Date.now()}`);
|
|
7250
7490
|
}
|
|
7251
7491
|
async function copyDirectory(sourcePath, targetPath) {
|
|
7252
|
-
await mkdir3(
|
|
7492
|
+
await mkdir3(dirname4(targetPath), { recursive: true });
|
|
7253
7493
|
await cp2(sourcePath, targetPath, { recursive: true, filter: (source) => shouldCopyPluginPath(source, sourcePath) });
|
|
7254
7494
|
}
|
|
7255
7495
|
async function promoteDirectory(tempPath, targetPath, renameDirectory) {
|
|
@@ -7283,11 +7523,34 @@ function shouldCopyPluginPath(path, root) {
|
|
|
7283
7523
|
const parts = relative4.split(sep5);
|
|
7284
7524
|
return !parts.some((part) => part === ".git" || part === "node_modules");
|
|
7285
7525
|
}
|
|
7526
|
+
async function copyRootRuntimeDists(input) {
|
|
7527
|
+
const repoRoot = repoRootForCodexPluginSource(input.sourcePath);
|
|
7528
|
+
if (repoRoot === null)
|
|
7529
|
+
return;
|
|
7530
|
+
for (const runtimePath of ["dist/cli", "dist/cli-node"]) {
|
|
7531
|
+
const sourcePath = join11(repoRoot, runtimePath);
|
|
7532
|
+
if (!await fileExistsStrict(join11(sourcePath, "index.js")))
|
|
7533
|
+
continue;
|
|
7534
|
+
await mkdir3(dirname4(join11(input.pluginRoot, runtimePath)), { recursive: true });
|
|
7535
|
+
await cp2(sourcePath, join11(input.pluginRoot, runtimePath), { recursive: true });
|
|
7536
|
+
}
|
|
7537
|
+
}
|
|
7538
|
+
function repoRootForCodexPluginSource(sourcePath) {
|
|
7539
|
+
const codexPackageRoot = dirname4(sourcePath);
|
|
7540
|
+
const packagesRoot = dirname4(codexPackageRoot);
|
|
7541
|
+
if (basename3(sourcePath) !== "plugin")
|
|
7542
|
+
return null;
|
|
7543
|
+
if (basename3(codexPackageRoot) !== "omo-codex")
|
|
7544
|
+
return null;
|
|
7545
|
+
if (basename3(packagesRoot) !== "packages")
|
|
7546
|
+
return null;
|
|
7547
|
+
return dirname4(packagesRoot);
|
|
7548
|
+
}
|
|
7286
7549
|
// packages/omo-codex/src/install/codex-cache-prune.ts
|
|
7287
7550
|
import { lstat as lstat4, readdir as readdir3, rm as rm4, stat as stat3 } from "node:fs/promises";
|
|
7288
|
-
import { join as
|
|
7551
|
+
import { join as join12 } from "node:path";
|
|
7289
7552
|
async function pruneMarketplaceCache(input) {
|
|
7290
|
-
const cacheRoot =
|
|
7553
|
+
const cacheRoot = join12(input.codexHome, "plugins", "cache", input.marketplaceName);
|
|
7291
7554
|
if (!await fileExistsStrict(cacheRoot))
|
|
7292
7555
|
return;
|
|
7293
7556
|
const keep = new Set(input.keepPluginNames);
|
|
@@ -7295,15 +7558,15 @@ async function pruneMarketplaceCache(input) {
|
|
|
7295
7558
|
for (const entry of entries) {
|
|
7296
7559
|
if (!entry.isDirectory() || keep.has(entry.name))
|
|
7297
7560
|
continue;
|
|
7298
|
-
await rm4(
|
|
7561
|
+
await rm4(join12(cacheRoot, entry.name), { recursive: true, force: true });
|
|
7299
7562
|
}
|
|
7300
7563
|
}
|
|
7301
7564
|
async function pruneMarketplacePluginCaches(input) {
|
|
7302
|
-
const cacheRoot =
|
|
7565
|
+
const cacheRoot = join12(input.codexHome, "plugins", "cache", input.marketplaceName);
|
|
7303
7566
|
if (!await fileExistsStrict(cacheRoot))
|
|
7304
7567
|
return;
|
|
7305
7568
|
for (const pluginName of input.pluginNames) {
|
|
7306
|
-
await rm4(
|
|
7569
|
+
await rm4(join12(cacheRoot, pluginName), { recursive: true, force: true });
|
|
7307
7570
|
}
|
|
7308
7571
|
const remainingEntries = await readCacheEntryNames(cacheRoot);
|
|
7309
7572
|
if (remainingEntries.length === 0) {
|
|
@@ -7350,11 +7613,11 @@ async function isBrokenCacheSymlink(path) {
|
|
|
7350
7613
|
}
|
|
7351
7614
|
// packages/omo-codex/src/install/codex-cached-marketplace-manifest.ts
|
|
7352
7615
|
import { mkdir as mkdir4, writeFile as writeFile4 } from "node:fs/promises";
|
|
7353
|
-
import { join as
|
|
7616
|
+
import { join as join13 } from "node:path";
|
|
7354
7617
|
async function writeCachedMarketplaceManifest(input) {
|
|
7355
|
-
const marketplaceDir =
|
|
7618
|
+
const marketplaceDir = join13(input.marketplaceRoot, ".agents", "plugins");
|
|
7356
7619
|
await mkdir4(marketplaceDir, { recursive: true });
|
|
7357
|
-
await writeFile4(
|
|
7620
|
+
await writeFile4(join13(marketplaceDir, "marketplace.json"), `${JSON.stringify({
|
|
7358
7621
|
name: input.marketplaceName,
|
|
7359
7622
|
plugins: input.plugins.map((plugin) => ({
|
|
7360
7623
|
name: plugin.name,
|
|
@@ -7365,9 +7628,9 @@ async function writeCachedMarketplaceManifest(input) {
|
|
|
7365
7628
|
}
|
|
7366
7629
|
|
|
7367
7630
|
// packages/omo-codex/src/install/codex-package-layout.ts
|
|
7368
|
-
import { existsSync as
|
|
7631
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
7369
7632
|
import { readFile as readFile8 } from "node:fs/promises";
|
|
7370
|
-
import { join as
|
|
7633
|
+
import { join as join14 } from "node:path";
|
|
7371
7634
|
var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
|
|
7372
7635
|
"@code-yeongyu/lazycodex",
|
|
7373
7636
|
"@code-yeongyu/lazycodex-ai",
|
|
@@ -7377,10 +7640,10 @@ var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
|
|
|
7377
7640
|
"oh-my-openagent"
|
|
7378
7641
|
]);
|
|
7379
7642
|
async function shouldBuildSourcePackages(repoRoot) {
|
|
7380
|
-
if (
|
|
7643
|
+
if (existsSync3(join14(repoRoot, "packages", "omo-opencode", "src", "index.ts")))
|
|
7381
7644
|
return true;
|
|
7382
|
-
const packageJsonPath =
|
|
7383
|
-
if (!
|
|
7645
|
+
const packageJsonPath = join14(repoRoot, "package.json");
|
|
7646
|
+
if (!existsSync3(packageJsonPath))
|
|
7384
7647
|
return true;
|
|
7385
7648
|
const packageJson = JSON.parse(await readFile8(packageJsonPath, "utf8"));
|
|
7386
7649
|
if (!isPlainRecord(packageJson) || typeof packageJson.name !== "string")
|
|
@@ -7390,7 +7653,7 @@ async function shouldBuildSourcePackages(repoRoot) {
|
|
|
7390
7653
|
|
|
7391
7654
|
// packages/omo-codex/src/install/codex-config-toml.ts
|
|
7392
7655
|
import { mkdir as mkdir5, readFile as readFile10 } from "node:fs/promises";
|
|
7393
|
-
import { dirname as
|
|
7656
|
+
import { dirname as dirname6 } from "node:path";
|
|
7394
7657
|
|
|
7395
7658
|
// packages/omo-codex/src/install/toml-section-editor.ts
|
|
7396
7659
|
function findTomlSection(config, header) {
|
|
@@ -7406,7 +7669,7 @@ function findTomlSection(config, header) {
|
|
|
7406
7669
|
if (start === -1) {
|
|
7407
7670
|
if (tomlTableHeaderMatches(trimmed, headerLine, targetHeaderPath))
|
|
7408
7671
|
start = offset;
|
|
7409
|
-
} else if (
|
|
7672
|
+
} else if (isTomlTableHeaderLine(line)) {
|
|
7410
7673
|
return { start, end: offset, text: config.slice(start, offset) };
|
|
7411
7674
|
}
|
|
7412
7675
|
offset += line.length;
|
|
@@ -7416,12 +7679,12 @@ function findTomlSection(config, header) {
|
|
|
7416
7679
|
return { start, end: config.length, text: config.slice(start) };
|
|
7417
7680
|
}
|
|
7418
7681
|
function replaceOrInsertSetting(config, section, key, value) {
|
|
7419
|
-
const linePattern = new RegExp(
|
|
7682
|
+
const linePattern = new RegExp(`^[ \\t]*${escapeRegExp(key)}[ \\t]*=.*$`, "m");
|
|
7420
7683
|
const replacement = linePattern.test(section.text) ? section.text.replace(linePattern, `${key} = ${value}`) : insertSetting(section.text, key, value);
|
|
7421
7684
|
return config.slice(0, section.start) + replacement + config.slice(section.end);
|
|
7422
7685
|
}
|
|
7423
7686
|
function removeSetting(config, section, key) {
|
|
7424
|
-
const linePattern = new RegExp(
|
|
7687
|
+
const linePattern = new RegExp(`^[ \\t]*${escapeRegExp(key)}[ \\t]*=.*(?:\\n|$)`, "m");
|
|
7425
7688
|
const replacement = section.text.replace(linePattern, "");
|
|
7426
7689
|
return config.slice(0, section.start) + replacement + config.slice(section.end);
|
|
7427
7690
|
}
|
|
@@ -7429,7 +7692,7 @@ function replaceOrInsertRootSetting(config, key, value) {
|
|
|
7429
7692
|
const sectionStart = findFirstTableStart(config);
|
|
7430
7693
|
const root = config.slice(0, sectionStart);
|
|
7431
7694
|
const suffix = config.slice(sectionStart);
|
|
7432
|
-
const linePattern = new RegExp(
|
|
7695
|
+
const linePattern = new RegExp(`^[ \\t]*${escapeRegExp(key)}[ \\t]*=.*$`, "m");
|
|
7433
7696
|
const replacement = linePattern.test(root) ? root.replace(linePattern, `${key} = ${value}`) : `${root.trimEnd()}${root.trimEnd().length > 0 ? `
|
|
7434
7697
|
` : ""}${key} = ${value}
|
|
7435
7698
|
`;
|
|
@@ -7447,8 +7710,16 @@ function appendBlock(config, block) {
|
|
|
7447
7710
|
`;
|
|
7448
7711
|
}
|
|
7449
7712
|
function findFirstTableStart(config) {
|
|
7450
|
-
const
|
|
7451
|
-
|
|
7713
|
+
const lines = config.match(/[^\n]*\n?|$/g) ?? [];
|
|
7714
|
+
let offset = 0;
|
|
7715
|
+
for (const line of lines) {
|
|
7716
|
+
if (line.length === 0)
|
|
7717
|
+
break;
|
|
7718
|
+
if (isTomlTableHeaderLine(line))
|
|
7719
|
+
return offset;
|
|
7720
|
+
offset += line.length;
|
|
7721
|
+
}
|
|
7722
|
+
return config.length;
|
|
7452
7723
|
}
|
|
7453
7724
|
function insertSetting(sectionText, key, value) {
|
|
7454
7725
|
const lines = sectionText.split(`
|
|
@@ -7461,19 +7732,57 @@ function escapeRegExp(value) {
|
|
|
7461
7732
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
7462
7733
|
}
|
|
7463
7734
|
function tomlTableHeaderMatches(line, headerLine, targetHeaderPath) {
|
|
7464
|
-
|
|
7735
|
+
const normalizedLine = stripUnquotedInlineComment(line).trim();
|
|
7736
|
+
if (normalizedLine === headerLine)
|
|
7465
7737
|
return true;
|
|
7466
7738
|
if (!targetHeaderPath)
|
|
7467
7739
|
return false;
|
|
7468
|
-
const candidateHeaderPath = parseTomlTableHeader(
|
|
7740
|
+
const candidateHeaderPath = parseTomlTableHeader(normalizedLine);
|
|
7469
7741
|
if (!candidateHeaderPath || candidateHeaderPath.length !== targetHeaderPath.length)
|
|
7470
7742
|
return false;
|
|
7471
7743
|
return candidateHeaderPath.every((part, index) => part === targetHeaderPath[index]);
|
|
7472
7744
|
}
|
|
7473
7745
|
function parseTomlTableHeader(line) {
|
|
7474
|
-
|
|
7746
|
+
const normalizedLine = stripUnquotedInlineComment(line).trim();
|
|
7747
|
+
if (!normalizedLine.startsWith("[") || !normalizedLine.endsWith("]") || normalizedLine.startsWith("[["))
|
|
7475
7748
|
return null;
|
|
7476
|
-
return parseTomlDottedKey(
|
|
7749
|
+
return parseTomlDottedKey(normalizedLine.slice(1, -1).trim());
|
|
7750
|
+
}
|
|
7751
|
+
function isTomlTableHeaderLine(line) {
|
|
7752
|
+
const normalizedLine = stripUnquotedInlineComment(line).trim();
|
|
7753
|
+
return normalizedLine.startsWith("[") && normalizedLine.endsWith("]");
|
|
7754
|
+
}
|
|
7755
|
+
function stripUnquotedInlineComment(line) {
|
|
7756
|
+
let quote = null;
|
|
7757
|
+
let index = 0;
|
|
7758
|
+
while (index < line.length) {
|
|
7759
|
+
const char = line[index];
|
|
7760
|
+
if (quote === '"') {
|
|
7761
|
+
if (char === "\\") {
|
|
7762
|
+
index += 2;
|
|
7763
|
+
continue;
|
|
7764
|
+
}
|
|
7765
|
+
if (char === '"')
|
|
7766
|
+
quote = null;
|
|
7767
|
+
index += 1;
|
|
7768
|
+
continue;
|
|
7769
|
+
}
|
|
7770
|
+
if (quote === "'") {
|
|
7771
|
+
if (char === "'")
|
|
7772
|
+
quote = null;
|
|
7773
|
+
index += 1;
|
|
7774
|
+
continue;
|
|
7775
|
+
}
|
|
7776
|
+
if (char === '"' || char === "'") {
|
|
7777
|
+
quote = char;
|
|
7778
|
+
index += 1;
|
|
7779
|
+
continue;
|
|
7780
|
+
}
|
|
7781
|
+
if (char === "#")
|
|
7782
|
+
return line.slice(0, index);
|
|
7783
|
+
index += 1;
|
|
7784
|
+
}
|
|
7785
|
+
return line;
|
|
7477
7786
|
}
|
|
7478
7787
|
function parseTomlDottedKey(input) {
|
|
7479
7788
|
const parts = [];
|
|
@@ -7584,7 +7893,7 @@ function skipWhitespace(input, startIndex) {
|
|
|
7584
7893
|
|
|
7585
7894
|
// packages/omo-codex/src/install/codex-config-toml-sections.ts
|
|
7586
7895
|
function removeTomlSections(config, shouldRemove) {
|
|
7587
|
-
return splitTomlSections(config).filter((section) => section.header === null || !shouldRemove(section.header)).map((section) => section.text).join("").replace(/\n{3,}/g, `
|
|
7896
|
+
return splitTomlSections(config).filter((section) => section.header === null || !shouldRemove(section.header, section)).map((section) => section.text).join("").replace(/\n{3,}/g, `
|
|
7588
7897
|
|
|
7589
7898
|
`);
|
|
7590
7899
|
}
|
|
@@ -7623,11 +7932,43 @@ function parseHookStateHeaderKey(header) {
|
|
|
7623
7932
|
return path[2] ?? null;
|
|
7624
7933
|
}
|
|
7625
7934
|
function parseTomlHeader(line) {
|
|
7626
|
-
const trimmed = line.trim();
|
|
7935
|
+
const trimmed = stripTomlLineComment(line).trim();
|
|
7627
7936
|
if (!trimmed.startsWith("[") || !trimmed.endsWith("]") || trimmed.startsWith("[["))
|
|
7628
7937
|
return null;
|
|
7629
7938
|
return trimmed.slice(1, -1);
|
|
7630
7939
|
}
|
|
7940
|
+
function stripTomlLineComment(line) {
|
|
7941
|
+
let quote = null;
|
|
7942
|
+
let index = 0;
|
|
7943
|
+
while (index < line.length) {
|
|
7944
|
+
const char = line[index];
|
|
7945
|
+
if (quote === '"') {
|
|
7946
|
+
if (char === "\\") {
|
|
7947
|
+
index += 2;
|
|
7948
|
+
continue;
|
|
7949
|
+
}
|
|
7950
|
+
if (char === '"')
|
|
7951
|
+
quote = null;
|
|
7952
|
+
index += 1;
|
|
7953
|
+
continue;
|
|
7954
|
+
}
|
|
7955
|
+
if (quote === "'") {
|
|
7956
|
+
if (char === "'")
|
|
7957
|
+
quote = null;
|
|
7958
|
+
index += 1;
|
|
7959
|
+
continue;
|
|
7960
|
+
}
|
|
7961
|
+
if (char === '"' || char === "'") {
|
|
7962
|
+
quote = char;
|
|
7963
|
+
index += 1;
|
|
7964
|
+
continue;
|
|
7965
|
+
}
|
|
7966
|
+
if (char === "#")
|
|
7967
|
+
return line.slice(0, index);
|
|
7968
|
+
index += 1;
|
|
7969
|
+
}
|
|
7970
|
+
return line;
|
|
7971
|
+
}
|
|
7631
7972
|
|
|
7632
7973
|
// packages/omo-codex/src/install/codex-config-agents.ts
|
|
7633
7974
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE = ["codex-ultrawork-reviewer"];
|
|
@@ -7671,12 +8012,12 @@ function tomlKeySegment(value) {
|
|
|
7671
8012
|
|
|
7672
8013
|
// packages/omo-codex/src/install/codex-config-atomic-write.ts
|
|
7673
8014
|
import { lstat as lstat5, readlink as readlink3, realpath, rename as rename2, unlink, writeFile as writeFile5 } from "node:fs/promises";
|
|
7674
|
-
import { basename as
|
|
8015
|
+
import { basename as basename4, dirname as dirname5, isAbsolute as isAbsolute4, join as join15, resolve as resolve5 } from "node:path";
|
|
7675
8016
|
var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
|
|
7676
8017
|
var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
|
|
7677
8018
|
async function writeFileAtomic(targetPath, data) {
|
|
7678
8019
|
const writeTarget = await resolveSymlinkTarget(targetPath);
|
|
7679
|
-
const temporaryPath =
|
|
8020
|
+
const temporaryPath = join15(dirname5(writeTarget), `.tmp-${basename4(writeTarget)}-${process.pid}-${Date.now()}`);
|
|
7680
8021
|
await writeFile5(temporaryPath, data);
|
|
7681
8022
|
try {
|
|
7682
8023
|
await renameWithRetry(temporaryPath, writeTarget);
|
|
@@ -7705,7 +8046,7 @@ async function resolveSymlinkTarget(targetPath) {
|
|
|
7705
8046
|
if (!(error instanceof Error))
|
|
7706
8047
|
throw error;
|
|
7707
8048
|
const linkValue = await readlink3(targetPath);
|
|
7708
|
-
return isAbsolute4(linkValue) ? linkValue : resolve5(
|
|
8049
|
+
return isAbsolute4(linkValue) ? linkValue : resolve5(dirname5(targetPath), linkValue);
|
|
7709
8050
|
}
|
|
7710
8051
|
}
|
|
7711
8052
|
async function renameWithRetry(fromPath, toPath) {
|
|
@@ -7798,7 +8139,7 @@ function ensureMarketplaceBlock(config, marketplaceName, source) {
|
|
|
7798
8139
|
}
|
|
7799
8140
|
|
|
7800
8141
|
// packages/omo-codex/src/install/codex-config-permissions.ts
|
|
7801
|
-
var AUTONOMOUS_FEATURES = ["multi_agent", "
|
|
8142
|
+
var AUTONOMOUS_FEATURES = ["multi_agent", "unified_exec", "goals"];
|
|
7802
8143
|
function ensureAutonomousPermissions(config) {
|
|
7803
8144
|
let next = replaceOrInsertRootSetting(config, "approval_policy", JSON.stringify("never"));
|
|
7804
8145
|
next = replaceOrInsertRootSetting(next, "sandbox_mode", JSON.stringify("danger-full-access"));
|
|
@@ -7851,7 +8192,8 @@ function ensureOmoBuiltinMcpPolicies(config, input) {
|
|
|
7851
8192
|
return config;
|
|
7852
8193
|
const codegraphEnabled = input.codegraphMcpEnabled ?? true;
|
|
7853
8194
|
const gitBashEnabled = (input.platform ?? process.platform) === "win32" && input.gitBashEnabled === true;
|
|
7854
|
-
let nextConfig =
|
|
8195
|
+
let nextConfig = removeStaleContext7PlaceholderMcp(config);
|
|
8196
|
+
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "context7", true);
|
|
7855
8197
|
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "codegraph", codegraphEnabled);
|
|
7856
8198
|
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "git_bash", gitBashEnabled);
|
|
7857
8199
|
return nextConfig;
|
|
@@ -7875,6 +8217,107 @@ enabled = ${enabledValue}
|
|
|
7875
8217
|
`);
|
|
7876
8218
|
return replaceOrInsertSetting(config, section, "enabled", enabledValue);
|
|
7877
8219
|
}
|
|
8220
|
+
function removeStaleContext7PlaceholderMcp(config) {
|
|
8221
|
+
return removeTomlSections(config, (header, section) => header === "mcp_servers.context7" && isContext7PlaceholderSection(section.text));
|
|
8222
|
+
}
|
|
8223
|
+
function isContext7PlaceholderSection(sectionText) {
|
|
8224
|
+
const args = readStringArraySetting(sectionText, "args");
|
|
8225
|
+
if (args === null || !args.includes("@upstash/context7-mcp"))
|
|
8226
|
+
return false;
|
|
8227
|
+
const apiKey = valueAfter(args, "--api-key");
|
|
8228
|
+
return apiKey !== null && isPlaceholderApiKey(apiKey);
|
|
8229
|
+
}
|
|
8230
|
+
function valueAfter(values, key) {
|
|
8231
|
+
const index = values.indexOf(key);
|
|
8232
|
+
return index >= 0 ? values[index + 1] ?? null : null;
|
|
8233
|
+
}
|
|
8234
|
+
function isPlaceholderApiKey(value) {
|
|
8235
|
+
return /^your[-_ ]?api[-_ ]?key$/i.test(value);
|
|
8236
|
+
}
|
|
8237
|
+
function readStringArraySetting(sectionText, key) {
|
|
8238
|
+
for (const line of sectionText.split(`
|
|
8239
|
+
`)) {
|
|
8240
|
+
if (!new RegExp(`^\\s*${key}\\s*=`).test(line))
|
|
8241
|
+
continue;
|
|
8242
|
+
const assignmentIndex = line.indexOf("=");
|
|
8243
|
+
if (assignmentIndex === -1)
|
|
8244
|
+
return null;
|
|
8245
|
+
return parseTomlStringArray(stripUnquotedInlineComment2(line.slice(assignmentIndex + 1)).trim());
|
|
8246
|
+
}
|
|
8247
|
+
return null;
|
|
8248
|
+
}
|
|
8249
|
+
function parseTomlStringArray(value) {
|
|
8250
|
+
if (!value.startsWith("[") || !value.endsWith("]"))
|
|
8251
|
+
return null;
|
|
8252
|
+
const items = [];
|
|
8253
|
+
let index = 1;
|
|
8254
|
+
while (index < value.length - 1) {
|
|
8255
|
+
const char = value[index];
|
|
8256
|
+
if (char === '"' || char === "'") {
|
|
8257
|
+
const parsed = parseTomlString(value, index);
|
|
8258
|
+
if (parsed === null)
|
|
8259
|
+
return null;
|
|
8260
|
+
items.push(parsed.value);
|
|
8261
|
+
index = parsed.nextIndex;
|
|
8262
|
+
continue;
|
|
8263
|
+
}
|
|
8264
|
+
index += 1;
|
|
8265
|
+
}
|
|
8266
|
+
return items;
|
|
8267
|
+
}
|
|
8268
|
+
function parseTomlString(input, startIndex) {
|
|
8269
|
+
const quote = input[startIndex];
|
|
8270
|
+
let value = "";
|
|
8271
|
+
let index = startIndex + 1;
|
|
8272
|
+
while (index < input.length) {
|
|
8273
|
+
const char = input[index];
|
|
8274
|
+
if (quote === '"' && char === "\\") {
|
|
8275
|
+
const next = input[index + 1];
|
|
8276
|
+
if (next === undefined)
|
|
8277
|
+
return null;
|
|
8278
|
+
value += next;
|
|
8279
|
+
index += 2;
|
|
8280
|
+
continue;
|
|
8281
|
+
}
|
|
8282
|
+
if (char === quote)
|
|
8283
|
+
return { value, nextIndex: index + 1 };
|
|
8284
|
+
value += char;
|
|
8285
|
+
index += 1;
|
|
8286
|
+
}
|
|
8287
|
+
return null;
|
|
8288
|
+
}
|
|
8289
|
+
function stripUnquotedInlineComment2(line) {
|
|
8290
|
+
let quote = null;
|
|
8291
|
+
let index = 0;
|
|
8292
|
+
while (index < line.length) {
|
|
8293
|
+
const char = line[index];
|
|
8294
|
+
if (quote === '"') {
|
|
8295
|
+
if (char === "\\") {
|
|
8296
|
+
index += 2;
|
|
8297
|
+
continue;
|
|
8298
|
+
}
|
|
8299
|
+
if (char === '"')
|
|
8300
|
+
quote = null;
|
|
8301
|
+
index += 1;
|
|
8302
|
+
continue;
|
|
8303
|
+
}
|
|
8304
|
+
if (quote === "'") {
|
|
8305
|
+
if (char === "'")
|
|
8306
|
+
quote = null;
|
|
8307
|
+
index += 1;
|
|
8308
|
+
continue;
|
|
8309
|
+
}
|
|
8310
|
+
if (char === '"' || char === "'") {
|
|
8311
|
+
quote = char;
|
|
8312
|
+
index += 1;
|
|
8313
|
+
continue;
|
|
8314
|
+
}
|
|
8315
|
+
if (char === "#")
|
|
8316
|
+
return line.slice(0, index);
|
|
8317
|
+
index += 1;
|
|
8318
|
+
}
|
|
8319
|
+
return line;
|
|
8320
|
+
}
|
|
7878
8321
|
|
|
7879
8322
|
// packages/omo-codex/src/install/codex-config-reasoning.ts
|
|
7880
8323
|
var MANAGED_KEYS = ["model", "model_context_window", "model_reasoning_effort", "plan_mode_reasoning_effort"];
|
|
@@ -7945,7 +8388,7 @@ function isRootSetting(line, key) {
|
|
|
7945
8388
|
|
|
7946
8389
|
// packages/omo-codex/src/install/codex-model-catalog.ts
|
|
7947
8390
|
import { readFile as readFile9 } from "node:fs/promises";
|
|
7948
|
-
import { join as
|
|
8391
|
+
import { join as join16 } from "node:path";
|
|
7949
8392
|
var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
7950
8393
|
current: {
|
|
7951
8394
|
model: "gpt-5.5",
|
|
@@ -7964,7 +8407,7 @@ var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
|
7964
8407
|
]
|
|
7965
8408
|
};
|
|
7966
8409
|
async function readCodexModelCatalog(codexPackageRoot) {
|
|
7967
|
-
const catalogPath =
|
|
8410
|
+
const catalogPath = join16(codexPackageRoot, "plugin", "model-catalog.json");
|
|
7968
8411
|
try {
|
|
7969
8412
|
const parsed = JSON.parse(await readFile9(catalogPath, "utf8"));
|
|
7970
8413
|
return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
|
|
@@ -8015,36 +8458,92 @@ function parseProfileMatch(match) {
|
|
|
8015
8458
|
return profile;
|
|
8016
8459
|
}
|
|
8017
8460
|
|
|
8461
|
+
// packages/omo-codex/src/install/codex-multi-agent-mode-config.ts
|
|
8462
|
+
var CODEX_MULTI_AGENT_MODE_KEY = "multi_agent_mode";
|
|
8463
|
+
function removeUnsupportedCodexMultiAgentModeConfig(config) {
|
|
8464
|
+
const lines = config.split(/\n/);
|
|
8465
|
+
const output = [];
|
|
8466
|
+
let inRoot = true;
|
|
8467
|
+
let changed = false;
|
|
8468
|
+
for (const line of lines) {
|
|
8469
|
+
const sectionHeader = isSectionHeader2(line);
|
|
8470
|
+
if (inRoot && isRootSetting2(line, CODEX_MULTI_AGENT_MODE_KEY)) {
|
|
8471
|
+
changed = true;
|
|
8472
|
+
continue;
|
|
8473
|
+
}
|
|
8474
|
+
output.push(line);
|
|
8475
|
+
if (sectionHeader)
|
|
8476
|
+
inRoot = false;
|
|
8477
|
+
}
|
|
8478
|
+
return changed ? output.join(`
|
|
8479
|
+
`) : config;
|
|
8480
|
+
}
|
|
8481
|
+
function isSectionHeader2(line) {
|
|
8482
|
+
return isTomlTableHeaderLine(line);
|
|
8483
|
+
}
|
|
8484
|
+
function isRootSetting2(line, key) {
|
|
8485
|
+
const trimmed = line.trimStart();
|
|
8486
|
+
if (trimmed.startsWith("#") || trimmed.startsWith("["))
|
|
8487
|
+
return false;
|
|
8488
|
+
const match = trimmed.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=/);
|
|
8489
|
+
return match?.[1] === key;
|
|
8490
|
+
}
|
|
8491
|
+
|
|
8018
8492
|
// packages/omo-codex/src/install/codex-multi-agent-v2-config.ts
|
|
8493
|
+
var CODEX_AGENTS_HEADER = "agents";
|
|
8019
8494
|
var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
|
|
8020
|
-
var
|
|
8495
|
+
var CODEX_SUBAGENT_THREAD_LIMIT = 1000;
|
|
8021
8496
|
function ensureCodexMultiAgentV2Config(config) {
|
|
8022
|
-
const
|
|
8023
|
-
const
|
|
8024
|
-
const
|
|
8497
|
+
const featureFlag = removeFeatureFlagSetting(config, "multi_agent_v2");
|
|
8498
|
+
const agentsConfig = ensureAgentsMaxThreads(featureFlag.config);
|
|
8499
|
+
const section = findTomlSection(agentsConfig, CODEX_MULTI_AGENT_V2_HEADER);
|
|
8500
|
+
const maxThreadsValue = CODEX_SUBAGENT_THREAD_LIMIT.toString();
|
|
8025
8501
|
if (!section) {
|
|
8026
|
-
|
|
8502
|
+
const enabledSetting = featureFlag.value === false ? `enabled = false
|
|
8503
|
+
` : "";
|
|
8504
|
+
return appendBlock(agentsConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
|
|
8505
|
+
${enabledSetting}max_concurrent_threads_per_session = ${maxThreadsValue}
|
|
8506
|
+
`);
|
|
8507
|
+
}
|
|
8508
|
+
const withPreservedDisable = featureFlag.value === false ? replaceOrInsertSetting(agentsConfig, section, "enabled", "false") : agentsConfig;
|
|
8509
|
+
const updatedSection = featureFlag.value === false ? findTomlSection(withPreservedDisable, CODEX_MULTI_AGENT_V2_HEADER) : section;
|
|
8510
|
+
if (!updatedSection) {
|
|
8511
|
+
return appendBlock(withPreservedDisable, `[${CODEX_MULTI_AGENT_V2_HEADER}]
|
|
8512
|
+
enabled = false
|
|
8027
8513
|
max_concurrent_threads_per_session = ${maxThreadsValue}
|
|
8028
8514
|
`);
|
|
8029
8515
|
}
|
|
8030
|
-
return replaceOrInsertSetting(
|
|
8516
|
+
return replaceOrInsertSetting(withPreservedDisable, updatedSection, "max_concurrent_threads_per_session", maxThreadsValue);
|
|
8031
8517
|
}
|
|
8032
8518
|
function removeFeatureFlagSetting(config, featureName) {
|
|
8033
8519
|
const section = findTomlSection(config, "features");
|
|
8034
8520
|
if (!section)
|
|
8035
|
-
return config;
|
|
8036
|
-
return
|
|
8521
|
+
return { config, value: null };
|
|
8522
|
+
return {
|
|
8523
|
+
config: removeSetting(config, section, featureName),
|
|
8524
|
+
value: readBooleanSetting(section.text, featureName)
|
|
8525
|
+
};
|
|
8037
8526
|
}
|
|
8038
|
-
function
|
|
8039
|
-
const
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8527
|
+
function ensureAgentsMaxThreads(config) {
|
|
8528
|
+
const maxThreadsValue = CODEX_SUBAGENT_THREAD_LIMIT.toString();
|
|
8529
|
+
const section = findTomlSection(config, CODEX_AGENTS_HEADER);
|
|
8530
|
+
if (!section) {
|
|
8531
|
+
return appendBlock(config, `[${CODEX_AGENTS_HEADER}]
|
|
8532
|
+
max_threads = ${maxThreadsValue}
|
|
8533
|
+
`);
|
|
8534
|
+
}
|
|
8535
|
+
return replaceOrInsertSetting(config, section, "max_threads", maxThreadsValue);
|
|
8536
|
+
}
|
|
8537
|
+
function readBooleanSetting(sectionText, key) {
|
|
8538
|
+
const match = new RegExp(`^\\s*${escapeRegExp(key)}\\s*=\\s*(true|false)\\s*(?:#.*)?$`, "m").exec(sectionText);
|
|
8539
|
+
if (!match)
|
|
8540
|
+
return null;
|
|
8541
|
+
return match[1] === "true";
|
|
8043
8542
|
}
|
|
8044
8543
|
|
|
8045
8544
|
// packages/omo-codex/src/install/codex-config-toml.ts
|
|
8046
8545
|
async function updateCodexConfig(input) {
|
|
8047
|
-
await mkdir5(
|
|
8546
|
+
await mkdir5(dirname6(input.configPath), { recursive: true });
|
|
8048
8547
|
let config = "";
|
|
8049
8548
|
if (await exists(input.configPath))
|
|
8050
8549
|
config = await readFile10(input.configPath, "utf8");
|
|
@@ -8060,7 +8559,7 @@ async function updateCodexConfig(input) {
|
|
|
8060
8559
|
config = ensureFeatureEnabled(config, "plugins");
|
|
8061
8560
|
config = ensureFeatureEnabled(config, "plugin_hooks");
|
|
8062
8561
|
config = ensureFeatureEnabled(config, "multi_agent");
|
|
8063
|
-
config =
|
|
8562
|
+
config = removeUnsupportedCodexMultiAgentModeConfig(config);
|
|
8064
8563
|
config = ensureCodexReasoningConfig(config, await readCodexModelCatalog(input.repoRoot));
|
|
8065
8564
|
config = ensureCodexMultiAgentV2Config(config);
|
|
8066
8565
|
if (input.autonomousPermissions === true)
|
|
@@ -8095,7 +8594,7 @@ async function exists(path) {
|
|
|
8095
8594
|
// packages/omo-codex/src/install/codex-hook-trust.ts
|
|
8096
8595
|
import { createHash } from "node:crypto";
|
|
8097
8596
|
import { readFile as readFile11 } from "node:fs/promises";
|
|
8098
|
-
import { join as
|
|
8597
|
+
import { join as join17 } from "node:path";
|
|
8099
8598
|
var EVENT_LABELS = new Map([
|
|
8100
8599
|
["PreToolUse", "pre_tool_use"],
|
|
8101
8600
|
["PermissionRequest", "permission_request"],
|
|
@@ -8109,7 +8608,7 @@ var EVENT_LABELS = new Map([
|
|
|
8109
8608
|
["Stop", "stop"]
|
|
8110
8609
|
]);
|
|
8111
8610
|
async function trustedHookStatesForPlugin(input) {
|
|
8112
|
-
const manifestPath =
|
|
8611
|
+
const manifestPath = join17(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
8113
8612
|
if (!await exists2(manifestPath))
|
|
8114
8613
|
return [];
|
|
8115
8614
|
const manifest = JSON.parse(await readFile11(manifestPath, "utf8"));
|
|
@@ -8117,7 +8616,7 @@ async function trustedHookStatesForPlugin(input) {
|
|
|
8117
8616
|
return [];
|
|
8118
8617
|
const states = [];
|
|
8119
8618
|
for (const hookPath of hookManifestPaths2(manifest.hooks)) {
|
|
8120
|
-
const hooksPath =
|
|
8619
|
+
const hooksPath = join17(input.pluginRoot, hookPath);
|
|
8121
8620
|
if (!await exists2(hooksPath))
|
|
8122
8621
|
continue;
|
|
8123
8622
|
const parsed = JSON.parse(await readFile11(hooksPath, "utf8"));
|
|
@@ -8125,7 +8624,8 @@ async function trustedHookStatesForPlugin(input) {
|
|
|
8125
8624
|
continue;
|
|
8126
8625
|
states.push(...trustedHookStatesForHooksFile({
|
|
8127
8626
|
keySource: `${input.pluginName}@${input.marketplaceName}:${hookPath}`,
|
|
8128
|
-
hooks: parsed.hooks
|
|
8627
|
+
hooks: parsed.hooks,
|
|
8628
|
+
platform: input.platform ?? process.platform
|
|
8129
8629
|
}));
|
|
8130
8630
|
}
|
|
8131
8631
|
return states;
|
|
@@ -8153,20 +8653,28 @@ function trustedHookStatesForHooksFile(input) {
|
|
|
8153
8653
|
continue;
|
|
8154
8654
|
if (handler.async === true)
|
|
8155
8655
|
continue;
|
|
8156
|
-
|
|
8656
|
+
const command = commandForPlatform(handler, input.platform);
|
|
8657
|
+
if (command === undefined || command.trim() === "")
|
|
8157
8658
|
continue;
|
|
8158
8659
|
const key = `${input.keySource}:${eventLabel}:${groupIndex}:${handlerIndex}`;
|
|
8159
|
-
states.push({ key, trustedHash: commandHookHash(eventLabel, group.matcher, handler) });
|
|
8660
|
+
states.push({ key, trustedHash: commandHookHash(eventLabel, group.matcher, handler, command) });
|
|
8160
8661
|
}
|
|
8161
8662
|
}
|
|
8162
8663
|
}
|
|
8163
8664
|
return states;
|
|
8164
8665
|
}
|
|
8165
|
-
function
|
|
8666
|
+
function commandForPlatform(handler, platform) {
|
|
8667
|
+
if (typeof handler.command !== "string")
|
|
8668
|
+
return;
|
|
8669
|
+
if (platform === "win32" && typeof handler.commandWindows === "string")
|
|
8670
|
+
return handler.commandWindows;
|
|
8671
|
+
return handler.command;
|
|
8672
|
+
}
|
|
8673
|
+
function commandHookHash(eventName, matcher, handler, command) {
|
|
8166
8674
|
const timeout = Math.max(Number(handler.timeout ?? 600), 1);
|
|
8167
8675
|
const normalizedHandler = {
|
|
8168
8676
|
type: "command",
|
|
8169
|
-
command
|
|
8677
|
+
command,
|
|
8170
8678
|
timeout,
|
|
8171
8679
|
async: false
|
|
8172
8680
|
};
|
|
@@ -8204,25 +8712,13 @@ async function exists2(path) {
|
|
|
8204
8712
|
}
|
|
8205
8713
|
|
|
8206
8714
|
// packages/omo-codex/src/install/git-bash.ts
|
|
8207
|
-
var SKIP_GIT_BASH_AUTO_INSTALL_ENV_KEY = "OMO_CODEX_SKIP_GIT_BASH_AUTO_INSTALL";
|
|
8208
8715
|
var resolveGitBashForCurrentProcess2 = (input = {}) => {
|
|
8209
8716
|
return toCodexResolution(resolveGitBashForCurrentProcess(input));
|
|
8210
8717
|
};
|
|
8211
8718
|
async function prepareGitBashForInstall(input) {
|
|
8212
8719
|
const resolve6 = input.resolveGitBash ?? (() => resolveGitBashForCurrentProcess2({ platform: input.platform, env: input.env }));
|
|
8213
8720
|
const initialResolution = resolve6();
|
|
8214
|
-
|
|
8215
|
-
return initialResolution;
|
|
8216
|
-
if (input.env[SKIP_GIT_BASH_AUTO_INSTALL_ENV_KEY] === "1")
|
|
8217
|
-
return initialResolution;
|
|
8218
|
-
try {
|
|
8219
|
-
await input.runCommand("winget", WINGET_INSTALL_ARGS, { cwd: input.cwd });
|
|
8220
|
-
} catch (error) {
|
|
8221
|
-
if (!(error instanceof Error))
|
|
8222
|
-
throw error;
|
|
8223
|
-
return initialResolution;
|
|
8224
|
-
}
|
|
8225
|
-
return resolve6();
|
|
8721
|
+
return initialResolution;
|
|
8226
8722
|
}
|
|
8227
8723
|
function toCodexResolution(resolution) {
|
|
8228
8724
|
if (resolution.found) {
|
|
@@ -8246,11 +8742,11 @@ function toCodexResolution(resolution) {
|
|
|
8246
8742
|
|
|
8247
8743
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
8248
8744
|
import { copyFile, lstat as lstat7, mkdir as mkdir6, readFile as readFile13, readdir as readdir4, rm as rm6, writeFile as writeFile6 } from "node:fs/promises";
|
|
8249
|
-
import { basename as
|
|
8745
|
+
import { basename as basename5, join as join19 } from "node:path";
|
|
8250
8746
|
|
|
8251
8747
|
// packages/omo-codex/src/install/retired-managed-agent-purge.ts
|
|
8252
8748
|
import { lstat as lstat6, readFile as readFile12, rm as rm5 } from "node:fs/promises";
|
|
8253
|
-
import { join as
|
|
8749
|
+
import { join as join18 } from "node:path";
|
|
8254
8750
|
var RETIRED_MANAGED_AGENT_FILES = [
|
|
8255
8751
|
{
|
|
8256
8752
|
fileName: "codex-ultrawork-reviewer.toml",
|
|
@@ -8262,11 +8758,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
|
|
|
8262
8758
|
}
|
|
8263
8759
|
];
|
|
8264
8760
|
async function purgeRetiredManagedAgentFiles(input) {
|
|
8265
|
-
const agentsDir =
|
|
8761
|
+
const agentsDir = join18(input.codexHome, "agents");
|
|
8266
8762
|
if (!await exists3(agentsDir))
|
|
8267
8763
|
return;
|
|
8268
8764
|
for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
|
|
8269
|
-
const agentPath =
|
|
8765
|
+
const agentPath = join18(agentsDir, retiredAgent.fileName);
|
|
8270
8766
|
if (!await exists3(agentPath))
|
|
8271
8767
|
continue;
|
|
8272
8768
|
const agentStat = await lstat6(agentPath);
|
|
@@ -8309,7 +8805,7 @@ function nodeErrorCode(error) {
|
|
|
8309
8805
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
8310
8806
|
var MANIFEST_FILE = ".installed-agents.json";
|
|
8311
8807
|
async function capturePreservedAgentReasoning(input) {
|
|
8312
|
-
const agentsDir =
|
|
8808
|
+
const agentsDir = join19(input.codexHome, "agents");
|
|
8313
8809
|
if (!await exists4(agentsDir))
|
|
8314
8810
|
return new Map;
|
|
8315
8811
|
const preserved = new Map;
|
|
@@ -8317,7 +8813,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
8317
8813
|
for (const entry of agentEntries) {
|
|
8318
8814
|
if (!entry.name.endsWith(".toml"))
|
|
8319
8815
|
continue;
|
|
8320
|
-
const content = await readTextIfExists2(
|
|
8816
|
+
const content = await readTextIfExists2(join19(agentsDir, entry.name));
|
|
8321
8817
|
if (content === null)
|
|
8322
8818
|
continue;
|
|
8323
8819
|
const effort = extractReasoningEffort(content);
|
|
@@ -8327,7 +8823,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
8327
8823
|
return preserved;
|
|
8328
8824
|
}
|
|
8329
8825
|
async function capturePreservedAgentServiceTier(input) {
|
|
8330
|
-
const agentsDir =
|
|
8826
|
+
const agentsDir = join19(input.codexHome, "agents");
|
|
8331
8827
|
if (!await exists4(agentsDir))
|
|
8332
8828
|
return new Map;
|
|
8333
8829
|
const preserved = new Map;
|
|
@@ -8335,7 +8831,7 @@ async function capturePreservedAgentServiceTier(input) {
|
|
|
8335
8831
|
for (const entry of agentEntries) {
|
|
8336
8832
|
if (!entry.name.endsWith(".toml"))
|
|
8337
8833
|
continue;
|
|
8338
|
-
const content = await readTextIfExists2(
|
|
8834
|
+
const content = await readTextIfExists2(join19(agentsDir, entry.name));
|
|
8339
8835
|
if (content === null)
|
|
8340
8836
|
continue;
|
|
8341
8837
|
preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
|
|
@@ -8349,13 +8845,13 @@ async function linkCachedPluginAgents(input) {
|
|
|
8349
8845
|
await writeManifest(input.pluginRoot, []);
|
|
8350
8846
|
return [];
|
|
8351
8847
|
}
|
|
8352
|
-
const agentsDir =
|
|
8848
|
+
const agentsDir = join19(input.codexHome, "agents");
|
|
8353
8849
|
await mkdir6(agentsDir, { recursive: true });
|
|
8354
8850
|
const linked = [];
|
|
8355
8851
|
for (const agentPath of bundledAgents) {
|
|
8356
|
-
const agentFileName =
|
|
8852
|
+
const agentFileName = basename5(agentPath);
|
|
8357
8853
|
const agentName = agentNameFromToml(agentFileName);
|
|
8358
|
-
const linkPath =
|
|
8854
|
+
const linkPath = join19(agentsDir, agentFileName);
|
|
8359
8855
|
await replaceWithCopy(linkPath, agentPath);
|
|
8360
8856
|
await restorePreservedReasoning({
|
|
8361
8857
|
agentName,
|
|
@@ -8385,7 +8881,7 @@ async function restorePreservedServiceTier(input) {
|
|
|
8385
8881
|
await writeFile6(input.linkPath, replacement.content);
|
|
8386
8882
|
}
|
|
8387
8883
|
async function discoverBundledAgents(pluginRoot) {
|
|
8388
|
-
const componentsRoot =
|
|
8884
|
+
const componentsRoot = join19(pluginRoot, "components");
|
|
8389
8885
|
if (!await exists4(componentsRoot))
|
|
8390
8886
|
return [];
|
|
8391
8887
|
const componentEntries = await readdir4(componentsRoot, { withFileTypes: true });
|
|
@@ -8393,14 +8889,14 @@ async function discoverBundledAgents(pluginRoot) {
|
|
|
8393
8889
|
for (const entry of componentEntries) {
|
|
8394
8890
|
if (!entry.isDirectory())
|
|
8395
8891
|
continue;
|
|
8396
|
-
const agentsRoot =
|
|
8892
|
+
const agentsRoot = join19(componentsRoot, entry.name, "agents");
|
|
8397
8893
|
if (!await exists4(agentsRoot))
|
|
8398
8894
|
continue;
|
|
8399
8895
|
const agentEntries = await readdir4(agentsRoot, { withFileTypes: true });
|
|
8400
8896
|
for (const file2 of agentEntries) {
|
|
8401
8897
|
if (!file2.isFile() || !file2.name.endsWith(".toml"))
|
|
8402
8898
|
continue;
|
|
8403
|
-
agents.push(
|
|
8899
|
+
agents.push(join19(agentsRoot, file2.name));
|
|
8404
8900
|
}
|
|
8405
8901
|
}
|
|
8406
8902
|
agents.sort();
|
|
@@ -8420,7 +8916,7 @@ async function prepareReplacement(linkPath) {
|
|
|
8420
8916
|
await rm6(linkPath, { force: true });
|
|
8421
8917
|
}
|
|
8422
8918
|
async function writeManifest(pluginRoot, agentPaths) {
|
|
8423
|
-
const manifestPath =
|
|
8919
|
+
const manifestPath = join19(pluginRoot, MANIFEST_FILE);
|
|
8424
8920
|
const payload = { agents: [...agentPaths].sort() };
|
|
8425
8921
|
await writeFile6(manifestPath, `${JSON.stringify(payload, null, "\t")}
|
|
8426
8922
|
`);
|
|
@@ -8454,7 +8950,7 @@ function extractServiceTier(content) {
|
|
|
8454
8950
|
}
|
|
8455
8951
|
function extractTopLevelStringSetting(content, key) {
|
|
8456
8952
|
for (const line of content.split(/\n/)) {
|
|
8457
|
-
if (
|
|
8953
|
+
if (isSectionHeader3(line))
|
|
8458
8954
|
return null;
|
|
8459
8955
|
const rawValue = topLevelStringSettingRawValue(line, key);
|
|
8460
8956
|
if (rawValue === undefined)
|
|
@@ -8475,7 +8971,7 @@ function replaceTopLevelStringSetting(content, key, value, options) {
|
|
|
8475
8971
|
const lines = content.split(/\n/);
|
|
8476
8972
|
for (let index = 0;index < lines.length; index += 1) {
|
|
8477
8973
|
const line = lines[index];
|
|
8478
|
-
if (line === undefined ||
|
|
8974
|
+
if (line === undefined || isSectionHeader3(line))
|
|
8479
8975
|
break;
|
|
8480
8976
|
if (topLevelStringSettingRawValue(line, key) === undefined)
|
|
8481
8977
|
continue;
|
|
@@ -8505,7 +9001,7 @@ function topLevelStringSettingRawValue(line, key) {
|
|
|
8505
9001
|
return rawValue;
|
|
8506
9002
|
}
|
|
8507
9003
|
function topLevelInsertionIndex(lines) {
|
|
8508
|
-
const sectionIndex = lines.findIndex((line) =>
|
|
9004
|
+
const sectionIndex = lines.findIndex((line) => isSectionHeader3(line));
|
|
8509
9005
|
const topLevelEnd = sectionIndex === -1 ? lines.length : sectionIndex;
|
|
8510
9006
|
let insertionIndex = topLevelEnd;
|
|
8511
9007
|
while (insertionIndex > 0 && lines[insertionIndex - 1] === "") {
|
|
@@ -8513,7 +9009,7 @@ function topLevelInsertionIndex(lines) {
|
|
|
8513
9009
|
}
|
|
8514
9010
|
return insertionIndex;
|
|
8515
9011
|
}
|
|
8516
|
-
function
|
|
9012
|
+
function isSectionHeader3(line) {
|
|
8517
9013
|
const trimmed = line.trim();
|
|
8518
9014
|
return trimmed.startsWith("[") && trimmed.endsWith("]");
|
|
8519
9015
|
}
|
|
@@ -8548,10 +9044,10 @@ function nodeErrorCode2(error) {
|
|
|
8548
9044
|
|
|
8549
9045
|
// packages/omo-codex/src/install/codex-marketplace.ts
|
|
8550
9046
|
import { readFile as readFile14 } from "node:fs/promises";
|
|
8551
|
-
import { join as
|
|
9047
|
+
import { join as join20 } from "node:path";
|
|
8552
9048
|
var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
|
|
8553
9049
|
async function readMarketplace(repoRoot, options) {
|
|
8554
|
-
const marketplacePath = options?.marketplacePath ??
|
|
9050
|
+
const marketplacePath = options?.marketplacePath ?? join20(repoRoot, DEFAULT_MARKETPLACE_PATH);
|
|
8555
9051
|
const raw = await readFile14(marketplacePath, "utf8");
|
|
8556
9052
|
const parsed = JSON.parse(raw);
|
|
8557
9053
|
if (!isPlainRecord(parsed))
|
|
@@ -8570,10 +9066,10 @@ async function readMarketplace(repoRoot, options) {
|
|
|
8570
9066
|
function resolvePluginSource(repoRoot, plugin, options) {
|
|
8571
9067
|
const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
|
|
8572
9068
|
const relativePath = sourcePath.slice(2);
|
|
8573
|
-
return
|
|
9069
|
+
return join20(repoRoot, ...relativePath.split(/[\\/]/));
|
|
8574
9070
|
}
|
|
8575
9071
|
async function readPluginManifest(pluginRoot) {
|
|
8576
|
-
const raw = await readFile14(
|
|
9072
|
+
const raw = await readFile14(join20(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
|
|
8577
9073
|
const parsed = JSON.parse(raw);
|
|
8578
9074
|
if (!isPlainRecord(parsed))
|
|
8579
9075
|
throw new Error(`${pluginRoot} plugin.json must be an object`);
|
|
@@ -8655,7 +9151,7 @@ function validateLocalSourcePath(path) {
|
|
|
8655
9151
|
|
|
8656
9152
|
// packages/omo-codex/src/install/codex-marketplace-snapshot.ts
|
|
8657
9153
|
import { cp as cp3, mkdir as mkdir7, rename as rename3, rm as rm7, writeFile as writeFile7 } from "node:fs/promises";
|
|
8658
|
-
import { join as
|
|
9154
|
+
import { join as join21, sep as sep6 } from "node:path";
|
|
8659
9155
|
var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
|
|
8660
9156
|
async function writeInstalledMarketplaceSnapshot(input) {
|
|
8661
9157
|
const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
|
|
@@ -8668,21 +9164,21 @@ async function writeInstalledMarketplaceSnapshot(input) {
|
|
|
8668
9164
|
return snapshotPlugins;
|
|
8669
9165
|
}
|
|
8670
9166
|
function installedMarketplaceRoot(codexHome, marketplaceName) {
|
|
8671
|
-
return
|
|
9167
|
+
return join21(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
|
|
8672
9168
|
}
|
|
8673
9169
|
async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
|
|
8674
|
-
const manifestDir =
|
|
9170
|
+
const manifestDir = join21(marketplaceRoot, ".agents", "plugins");
|
|
8675
9171
|
await mkdir7(manifestDir, { recursive: true });
|
|
8676
|
-
const tempPath =
|
|
9172
|
+
const tempPath = join21(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
|
|
8677
9173
|
await writeFile7(tempPath, `${JSON.stringify(marketplace, null, "\t")}
|
|
8678
9174
|
`);
|
|
8679
|
-
await rename3(tempPath,
|
|
9175
|
+
await rename3(tempPath, join21(manifestDir, "marketplace.json"));
|
|
8680
9176
|
}
|
|
8681
9177
|
async function writeSnapshotPlugin(marketplaceRoot, plugin) {
|
|
8682
|
-
const pluginsDir =
|
|
9178
|
+
const pluginsDir = join21(marketplaceRoot, "plugins");
|
|
8683
9179
|
await mkdir7(pluginsDir, { recursive: true });
|
|
8684
|
-
const targetPath =
|
|
8685
|
-
const tempPath =
|
|
9180
|
+
const targetPath = join21(pluginsDir, plugin.name);
|
|
9181
|
+
const tempPath = join21(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
|
|
8686
9182
|
await rm7(tempPath, { recursive: true, force: true });
|
|
8687
9183
|
await cp3(plugin.sourcePath, tempPath, {
|
|
8688
9184
|
recursive: true,
|
|
@@ -8704,10 +9200,10 @@ function shouldCopyMarketplaceSourcePath(path, root) {
|
|
|
8704
9200
|
|
|
8705
9201
|
// packages/omo-codex/src/install/lazycodex-version-stamp.ts
|
|
8706
9202
|
import { readdir as readdir5, readFile as readFile15, writeFile as writeFile8 } from "node:fs/promises";
|
|
8707
|
-
import { join as
|
|
9203
|
+
import { join as join22 } from "node:path";
|
|
8708
9204
|
async function readDistributionManifest(repoRoot) {
|
|
8709
9205
|
try {
|
|
8710
|
-
const parsed = JSON.parse(await readFile15(
|
|
9206
|
+
const parsed = JSON.parse(await readFile15(join22(repoRoot, "package.json"), "utf8"));
|
|
8711
9207
|
if (!isPlainRecord(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
|
|
8712
9208
|
return;
|
|
8713
9209
|
return {
|
|
@@ -8727,19 +9223,19 @@ function resolveLazyCodexPluginVersion(input) {
|
|
|
8727
9223
|
return input.manifestVersion ?? "local";
|
|
8728
9224
|
}
|
|
8729
9225
|
async function stampLazyCodexPluginVersion(input) {
|
|
8730
|
-
const manifestPath =
|
|
9226
|
+
const manifestPath = join22(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
8731
9227
|
const hookPaths = await readPluginHookPaths(manifestPath);
|
|
8732
9228
|
await stampJsonVersion(manifestPath, input.version);
|
|
8733
|
-
await stampJsonVersion(
|
|
9229
|
+
await stampJsonVersion(join22(input.pluginRoot, "package.json"), input.version);
|
|
8734
9230
|
for (const hookPath of hookPaths) {
|
|
8735
|
-
await stampHookStatusMessages(
|
|
9231
|
+
await stampHookStatusMessages(join22(input.pluginRoot, hookPath), input.version);
|
|
8736
9232
|
}
|
|
8737
9233
|
await stampComponentVersions(input);
|
|
8738
9234
|
}
|
|
8739
9235
|
async function writeLazyCodexInstallSnapshot(input) {
|
|
8740
9236
|
if (input.distributionManifest === undefined)
|
|
8741
9237
|
return;
|
|
8742
|
-
await writeFile8(
|
|
9238
|
+
await writeFile8(join22(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
|
|
8743
9239
|
packageName: input.distributionManifest.name,
|
|
8744
9240
|
version: input.distributionManifest.version
|
|
8745
9241
|
}, null, "\t")}
|
|
@@ -8796,16 +9292,16 @@ async function stampHookStatusMessages(path, version) {
|
|
|
8796
9292
|
async function stampComponentVersions(input) {
|
|
8797
9293
|
let entries;
|
|
8798
9294
|
try {
|
|
8799
|
-
entries = await readdir5(
|
|
9295
|
+
entries = await readdir5(join22(input.pluginRoot, "components"));
|
|
8800
9296
|
} catch (error) {
|
|
8801
9297
|
if (error instanceof Error)
|
|
8802
9298
|
return;
|
|
8803
9299
|
throw error;
|
|
8804
9300
|
}
|
|
8805
9301
|
for (const entry of entries) {
|
|
8806
|
-
const componentRoot =
|
|
8807
|
-
await stampJsonVersion(
|
|
8808
|
-
await stampHookStatusMessages(
|
|
9302
|
+
const componentRoot = join22(input.pluginRoot, "components", entry);
|
|
9303
|
+
await stampJsonVersion(join22(componentRoot, "package.json"), input.version);
|
|
9304
|
+
await stampHookStatusMessages(join22(componentRoot, "hooks", "hooks.json"), input.version);
|
|
8809
9305
|
}
|
|
8810
9306
|
}
|
|
8811
9307
|
function stampHookGroups(hooks, version) {
|
|
@@ -8831,7 +9327,7 @@ function stampHookStatusMessage(hook, version) {
|
|
|
8831
9327
|
|
|
8832
9328
|
// packages/omo-codex/src/install/codex-project-local-cleanup.ts
|
|
8833
9329
|
import { copyFile as copyFile2, lstat as lstat8, readFile as readFile16, writeFile as writeFile9 } from "node:fs/promises";
|
|
8834
|
-
import { dirname as
|
|
9330
|
+
import { dirname as dirname7, join as join23, resolve as resolve6 } from "node:path";
|
|
8835
9331
|
var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
|
|
8836
9332
|
var PROJECT_LOCAL_ARTIFACT_PATHS = [
|
|
8837
9333
|
".codex/hooks.json",
|
|
@@ -8934,37 +9430,37 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
8934
9430
|
if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
|
|
8935
9431
|
throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
|
|
8936
9432
|
}
|
|
8937
|
-
const codexHomeConfigPath = codexHome === undefined ? null :
|
|
9433
|
+
const codexHomeConfigPath = codexHome === undefined ? null : join23(resolve6(codexHome), "config.toml");
|
|
8938
9434
|
let current = resolve6(startDirectory);
|
|
8939
9435
|
const configPathsFromCwd = [];
|
|
8940
9436
|
while (true) {
|
|
8941
|
-
const configPath =
|
|
9437
|
+
const configPath = join23(current, ".codex", "config.toml");
|
|
8942
9438
|
if (await isRegularProjectLocalConfig(current, configPath)) {
|
|
8943
9439
|
if (codexHomeConfigPath === null || resolve6(configPath) !== codexHomeConfigPath) {
|
|
8944
9440
|
configPathsFromCwd.push(configPath);
|
|
8945
9441
|
}
|
|
8946
9442
|
}
|
|
8947
|
-
if (await exists5(
|
|
9443
|
+
if (await exists5(join23(current, ".git"))) {
|
|
8948
9444
|
return configPathsFromCwd.length === 0 ? null : {
|
|
8949
9445
|
projectRoot: current,
|
|
8950
9446
|
configPaths: [...configPathsFromCwd].reverse(),
|
|
8951
9447
|
artifactRoots: artifactRootsForConfigPaths(configPathsFromCwd)
|
|
8952
9448
|
};
|
|
8953
9449
|
}
|
|
8954
|
-
const parent =
|
|
9450
|
+
const parent = dirname7(current);
|
|
8955
9451
|
if (parent === current) {
|
|
8956
9452
|
const nearestConfigPath = configPathsFromCwd[0];
|
|
8957
9453
|
return nearestConfigPath === undefined ? null : {
|
|
8958
|
-
projectRoot:
|
|
9454
|
+
projectRoot: dirname7(dirname7(nearestConfigPath)),
|
|
8959
9455
|
configPaths: [nearestConfigPath],
|
|
8960
|
-
artifactRoots: [
|
|
9456
|
+
artifactRoots: [dirname7(dirname7(nearestConfigPath))]
|
|
8961
9457
|
};
|
|
8962
9458
|
}
|
|
8963
9459
|
current = parent;
|
|
8964
9460
|
}
|
|
8965
9461
|
}
|
|
8966
9462
|
async function isRegularProjectLocalConfig(directory, configPath) {
|
|
8967
|
-
const codexDirStat = await maybeLstat(
|
|
9463
|
+
const codexDirStat = await maybeLstat(join23(directory, ".codex"));
|
|
8968
9464
|
if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
|
|
8969
9465
|
return false;
|
|
8970
9466
|
const configStat = await maybeLstat(configPath);
|
|
@@ -8973,7 +9469,7 @@ async function isRegularProjectLocalConfig(directory, configPath) {
|
|
|
8973
9469
|
function artifactRootsForConfigPaths(configPaths) {
|
|
8974
9470
|
const roots = [];
|
|
8975
9471
|
for (const configPath of configPaths) {
|
|
8976
|
-
const root =
|
|
9472
|
+
const root = dirname7(dirname7(configPath));
|
|
8977
9473
|
if (!roots.includes(root))
|
|
8978
9474
|
roots.push(root);
|
|
8979
9475
|
}
|
|
@@ -8984,7 +9480,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
|
|
|
8984
9480
|
const seenPaths = new Set;
|
|
8985
9481
|
for (const projectRoot of projectRoots) {
|
|
8986
9482
|
for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
|
|
8987
|
-
const artifactPath =
|
|
9483
|
+
const artifactPath = join23(projectRoot, relativePath);
|
|
8988
9484
|
if (seenPaths.has(artifactPath))
|
|
8989
9485
|
continue;
|
|
8990
9486
|
const entryStat = await maybeLstat(artifactPath);
|
|
@@ -9061,11 +9557,11 @@ function formatUnknownError(error) {
|
|
|
9061
9557
|
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
|
|
9062
9558
|
import { readFile as readFile17, readdir as readdir6, rm as rm8 } from "node:fs/promises";
|
|
9063
9559
|
import { connect } from "node:net";
|
|
9064
|
-
import { join as
|
|
9560
|
+
import { join as join24 } from "node:path";
|
|
9065
9561
|
async function reapLspDaemons(codexHome, deps = {}) {
|
|
9066
9562
|
const killProcess = deps.killProcess ?? sendSigterm;
|
|
9067
9563
|
const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
|
|
9068
|
-
const daemonRoot =
|
|
9564
|
+
const daemonRoot = join24(codexHome, "codex-lsp", "daemon");
|
|
9069
9565
|
const reaped = [];
|
|
9070
9566
|
let entries;
|
|
9071
9567
|
try {
|
|
@@ -9074,9 +9570,9 @@ async function reapLspDaemons(codexHome, deps = {}) {
|
|
|
9074
9570
|
return reaped;
|
|
9075
9571
|
}
|
|
9076
9572
|
for (const entry of entries) {
|
|
9077
|
-
const versionDir =
|
|
9078
|
-
const pid = await readPidFile(
|
|
9079
|
-
const socketPath = await readEndpointFile(
|
|
9573
|
+
const versionDir = join24(daemonRoot, entry);
|
|
9574
|
+
const pid = await readPidFile(join24(versionDir, "daemon.pid"));
|
|
9575
|
+
const socketPath = await readEndpointFile(join24(versionDir, "daemon.endpoint"));
|
|
9080
9576
|
if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
|
|
9081
9577
|
reaped.push(pid);
|
|
9082
9578
|
}
|
|
@@ -9130,7 +9626,7 @@ function sendSigterm(pid) {
|
|
|
9130
9626
|
|
|
9131
9627
|
// packages/omo-codex/src/install/codex-installer-bin-dir.ts
|
|
9132
9628
|
import { homedir } from "node:os";
|
|
9133
|
-
import { join as
|
|
9629
|
+
import { join as join25, resolve as resolve7 } from "node:path";
|
|
9134
9630
|
function resolveCodexInstallerBinDir(input) {
|
|
9135
9631
|
const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
|
|
9136
9632
|
if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
|
|
@@ -9139,15 +9635,15 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
9139
9635
|
const defaultCodexHome = resolve7(homeDir, ".codex");
|
|
9140
9636
|
const resolvedCodexHome = resolve7(input.codexHome);
|
|
9141
9637
|
if (resolvedCodexHome !== defaultCodexHome)
|
|
9142
|
-
return
|
|
9638
|
+
return join25(resolvedCodexHome, "bin");
|
|
9143
9639
|
return resolve7(homeDir, ".local", "bin");
|
|
9144
9640
|
}
|
|
9145
9641
|
|
|
9146
9642
|
// packages/omo-codex/src/install/omo-sot-migration.ts
|
|
9147
|
-
import { join as
|
|
9643
|
+
import { join as join26 } from "node:path";
|
|
9148
9644
|
async function seedAndMigrateOmoSot(input) {
|
|
9149
9645
|
const commandEnv = { ...input.env };
|
|
9150
|
-
const scriptPath =
|
|
9646
|
+
const scriptPath = join26(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
|
|
9151
9647
|
try {
|
|
9152
9648
|
await input.runCommand(process.execPath, [scriptPath, "--seed"], {
|
|
9153
9649
|
cwd: input.repoRoot,
|
|
@@ -12132,12 +12628,12 @@ function runtimeSlug(platform = process.platform, arch = process.arch) {
|
|
|
12132
12628
|
}
|
|
12133
12629
|
// packages/utils/src/ast-grep/install-script.ts
|
|
12134
12630
|
import { spawn as spawn3 } from "node:child_process";
|
|
12135
|
-
import { existsSync as
|
|
12136
|
-
import { join as
|
|
12631
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
12632
|
+
import { join as join27 } from "node:path";
|
|
12137
12633
|
var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR";
|
|
12138
12634
|
var AST_GREP_INSTALL_TIMEOUT_MS = 30000;
|
|
12139
12635
|
function astGrepRuntimeDir(baseDir, platform = process.platform, arch = process.arch) {
|
|
12140
|
-
return
|
|
12636
|
+
return join27(baseDir, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
12141
12637
|
}
|
|
12142
12638
|
function isMissingExecutable(error) {
|
|
12143
12639
|
if (!("code" in error))
|
|
@@ -12175,7 +12671,7 @@ function defaultSpawnProcess(command, args, options) {
|
|
|
12175
12671
|
};
|
|
12176
12672
|
}
|
|
12177
12673
|
function scriptPathForPlatform(skillDir, platform) {
|
|
12178
|
-
return
|
|
12674
|
+
return join27(skillDir, platform === "win32" ? "install.ps1" : "install.sh");
|
|
12179
12675
|
}
|
|
12180
12676
|
function invocationsForPlatform(scriptPath, platform) {
|
|
12181
12677
|
if (platform !== "win32")
|
|
@@ -12203,7 +12699,7 @@ function failedReason(outcome) {
|
|
|
12203
12699
|
}
|
|
12204
12700
|
async function runAstGrepSkillInstall(options) {
|
|
12205
12701
|
const platform = options.platform ?? process.platform;
|
|
12206
|
-
const fileExists = options.fileExists ??
|
|
12702
|
+
const fileExists = options.fileExists ?? existsSync4;
|
|
12207
12703
|
const scriptPath = scriptPathForPlatform(options.skillDir, platform);
|
|
12208
12704
|
if (!fileExists(scriptPath))
|
|
12209
12705
|
return { kind: "skipped", reason: `missing ${scriptPath}` };
|
|
@@ -12232,111 +12728,46 @@ async function runAstGrepSkillInstall(options) {
|
|
|
12232
12728
|
return { kind: "failed", reason: String(error) };
|
|
12233
12729
|
}
|
|
12234
12730
|
}
|
|
12235
|
-
// packages/utils/src/codegraph/
|
|
12236
|
-
var
|
|
12237
|
-
|
|
12238
|
-
|
|
12239
|
-
|
|
12240
|
-
|
|
12241
|
-
|
|
12242
|
-
|
|
12243
|
-
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
|
|
12248
|
-
|
|
12249
|
-
|
|
12250
|
-
|
|
12251
|
-
|
|
12252
|
-
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
|
|
12731
|
+
// packages/utils/src/codegraph/env.ts
|
|
12732
|
+
var SAFE_AMBIENT_ENV_KEYS = new Set([
|
|
12733
|
+
"APPDATA",
|
|
12734
|
+
"CI",
|
|
12735
|
+
"CODEX_HOME",
|
|
12736
|
+
"ComSpec",
|
|
12737
|
+
"HOME",
|
|
12738
|
+
"HOMEDRIVE",
|
|
12739
|
+
"HOMEPATH",
|
|
12740
|
+
"LANG",
|
|
12741
|
+
"LC_ALL",
|
|
12742
|
+
"LC_CTYPE",
|
|
12743
|
+
"LOCALAPPDATA",
|
|
12744
|
+
"PATH",
|
|
12745
|
+
"PATHEXT",
|
|
12746
|
+
"Path",
|
|
12747
|
+
"SystemRoot",
|
|
12748
|
+
"TEMP",
|
|
12749
|
+
"TMP",
|
|
12750
|
+
"TMPDIR",
|
|
12751
|
+
"USERPROFILE",
|
|
12752
|
+
"WINDIR",
|
|
12753
|
+
"XDG_CACHE_HOME",
|
|
12754
|
+
"XDG_CONFIG_HOME",
|
|
12755
|
+
"XDG_DATA_HOME",
|
|
12756
|
+
"XDG_STATE_HOME"
|
|
12757
|
+
]);
|
|
12758
|
+
var SAFE_CODEGRAPH_RUNTIME_ENV_KEYS = new Set([
|
|
12759
|
+
"CODEGRAPH_ALLOW_UNSAFE_NODE",
|
|
12760
|
+
"CODEGRAPH_BIN",
|
|
12761
|
+
"CODEGRAPH_FAKE_LOG",
|
|
12762
|
+
"CODEGRAPH_NODE_BIN",
|
|
12763
|
+
"OMO_CODEGRAPH_BIN",
|
|
12764
|
+
"OMO_CODEGRAPH_PROJECT_CWD",
|
|
12765
|
+
"OMO_CODEGRAPH_SESSION_START_CWD"
|
|
12766
|
+
]);
|
|
12258
12767
|
// packages/utils/src/codegraph/provision.ts
|
|
12259
12768
|
import { execFile } from "node:child_process";
|
|
12260
12769
|
import { promisify } from "node:util";
|
|
12261
12770
|
var execFileAsync = promisify(execFile);
|
|
12262
|
-
// packages/utils/src/codegraph/resolve.ts
|
|
12263
|
-
import { existsSync as existsSync4 } from "node:fs";
|
|
12264
|
-
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
12265
|
-
import { basename as basename5, dirname as dirname7, join as join27 } from "node:path";
|
|
12266
|
-
import { createRequire } from "node:module";
|
|
12267
|
-
var CODEGRAPH_NODE_CANDIDATES = ["node24", "node22", "node20", "node"];
|
|
12268
|
-
var requireFromHere = createRequire(import.meta.url);
|
|
12269
|
-
function defaultNodeVersion(nodePath) {
|
|
12270
|
-
if (nodePath === process.execPath && isNodeExecutableName(nodePath))
|
|
12271
|
-
return process.versions.node;
|
|
12272
|
-
try {
|
|
12273
|
-
const result = spawnSync2(nodePath, ["--version"], {
|
|
12274
|
-
encoding: "utf8",
|
|
12275
|
-
timeout: 2000,
|
|
12276
|
-
windowsHide: true
|
|
12277
|
-
});
|
|
12278
|
-
if (result.error !== undefined || result.status !== 0)
|
|
12279
|
-
return null;
|
|
12280
|
-
const version = `${result.stdout}
|
|
12281
|
-
${result.stderr}`.trim().split(/\s+/)[0];
|
|
12282
|
-
return version === undefined || version.length === 0 ? null : version;
|
|
12283
|
-
} catch (error) {
|
|
12284
|
-
if (error instanceof Error)
|
|
12285
|
-
return null;
|
|
12286
|
-
throw error;
|
|
12287
|
-
}
|
|
12288
|
-
}
|
|
12289
|
-
function isNodeExecutableName(filePath) {
|
|
12290
|
-
const executable = basename5(filePath).toLowerCase();
|
|
12291
|
-
return executable === "node" || executable === "node.exe" || /^node\d+(\.exe)?$/.test(executable);
|
|
12292
|
-
}
|
|
12293
|
-
function looksLikePath(command) {
|
|
12294
|
-
return command.includes("/") || command.includes("\\") || /^[a-zA-Z]:/.test(command);
|
|
12295
|
-
}
|
|
12296
|
-
function resolveConfiguredNodeRuntime(configured, fileExists, which2) {
|
|
12297
|
-
if (looksLikePath(configured))
|
|
12298
|
-
return fileExists(configured) ? configured : null;
|
|
12299
|
-
return which2(configured);
|
|
12300
|
-
}
|
|
12301
|
-
function supportsCodegraphNodeRuntime(nodePath, env, nodeVersion) {
|
|
12302
|
-
const version = nodeVersion(nodePath);
|
|
12303
|
-
if (version === null)
|
|
12304
|
-
return false;
|
|
12305
|
-
return evaluateCodegraphNodeSupport({ env, nodeVersion: version }).supported;
|
|
12306
|
-
}
|
|
12307
|
-
function defaultNodeRuntime(env, fileExists, which2, nodeVersion) {
|
|
12308
|
-
const configured = env[CODEGRAPH_NODE_BIN_ENV]?.trim();
|
|
12309
|
-
if (configured !== undefined && configured.length > 0) {
|
|
12310
|
-
const resolved = resolveConfiguredNodeRuntime(configured, fileExists, which2);
|
|
12311
|
-
return resolved !== null && supportsCodegraphNodeRuntime(resolved, env, nodeVersion) ? resolved : null;
|
|
12312
|
-
}
|
|
12313
|
-
const candidates = [
|
|
12314
|
-
...isNodeExecutableName(process.execPath) ? [process.execPath] : [],
|
|
12315
|
-
...CODEGRAPH_NODE_CANDIDATES.map((commandName) => which2(commandName)).filter((candidate) => candidate !== null)
|
|
12316
|
-
];
|
|
12317
|
-
const seen = new Set;
|
|
12318
|
-
for (const candidate of candidates) {
|
|
12319
|
-
if (seen.has(candidate))
|
|
12320
|
-
continue;
|
|
12321
|
-
seen.add(candidate);
|
|
12322
|
-
if (supportsCodegraphNodeRuntime(candidate, env, nodeVersion))
|
|
12323
|
-
return candidate;
|
|
12324
|
-
}
|
|
12325
|
-
return null;
|
|
12326
|
-
}
|
|
12327
|
-
function resolveCodegraphNodeRuntime(options = {}) {
|
|
12328
|
-
const env = options.env ?? process.env;
|
|
12329
|
-
return defaultNodeRuntime(env, options.fileExists ?? existsSync4, options.which ?? bunWhich, options.nodeVersion ?? defaultNodeVersion);
|
|
12330
|
-
}
|
|
12331
|
-
function resolveCodegraphNodeSupport(options = {}) {
|
|
12332
|
-
const env = options.env ?? process.env;
|
|
12333
|
-
const nodeVersion = options.nodeVersion ?? defaultNodeVersion;
|
|
12334
|
-
const runtime3 = resolveCodegraphNodeRuntime({ ...options, env, nodeVersion });
|
|
12335
|
-
if (runtime3 === null) {
|
|
12336
|
-
return evaluateCodegraphNodeSupport({ env, nodeVersion: "0.0.0" });
|
|
12337
|
-
}
|
|
12338
|
-
return evaluateCodegraphNodeSupport({ env, nodeVersion: nodeVersion(runtime3) ?? "0.0.0" });
|
|
12339
|
-
}
|
|
12340
12771
|
// packages/utils/src/command-executor/execute-command.ts
|
|
12341
12772
|
import { exec } from "node:child_process";
|
|
12342
12773
|
import { promisify as promisify2 } from "node:util";
|
|
@@ -12540,6 +12971,13 @@ function messageIsTerminalNoReplyUser(message) {
|
|
|
12540
12971
|
const initiatorMessage = toInternalInitiatorMessageLike(message);
|
|
12541
12972
|
return initiatorMessage !== undefined && isTerminalNoReplyUserMessage(initiatorMessage);
|
|
12542
12973
|
}
|
|
12974
|
+
function messageHasInternalInitiatorMarker(message) {
|
|
12975
|
+
const initiatorMessage = toInternalInitiatorMessageLike(message);
|
|
12976
|
+
if (initiatorMessage === undefined) {
|
|
12977
|
+
return false;
|
|
12978
|
+
}
|
|
12979
|
+
return (initiatorMessage.parts ?? []).some((part) => part.type === "text" && typeof part.text === "string" && hasInternalInitiatorMarker(part.text));
|
|
12980
|
+
}
|
|
12543
12981
|
var QUESTION_TOOL_NAMES = new Set(["question", "ask_user_question", "askuserquestion"]);
|
|
12544
12982
|
function partToolName(part) {
|
|
12545
12983
|
if (typeof part.name === "string") {
|
|
@@ -12712,6 +13150,9 @@ function latestAssistantTurnBlocksInternalPrompt(messages) {
|
|
|
12712
13150
|
continue;
|
|
12713
13151
|
}
|
|
12714
13152
|
if (!sawAssistantAfterLatestUser) {
|
|
13153
|
+
if (messageHasInternalInitiatorMarker(message)) {
|
|
13154
|
+
continue;
|
|
13155
|
+
}
|
|
12715
13156
|
return true;
|
|
12716
13157
|
}
|
|
12717
13158
|
continue;
|
|
@@ -13085,8 +13526,6 @@ async function runCodexInstaller(options = {}) {
|
|
|
13085
13526
|
const gitBashResolution = await prepareGitBashForInstall({
|
|
13086
13527
|
platform,
|
|
13087
13528
|
env: env3,
|
|
13088
|
-
cwd: repoRoot,
|
|
13089
|
-
runCommand,
|
|
13090
13529
|
resolveGitBash: platform === "win32" ? options.gitBashResolver ?? (() => resolveGitBashForCurrentProcess2({ platform, env: env3 })) : undefined
|
|
13091
13530
|
});
|
|
13092
13531
|
if (!gitBashResolution.found) {
|
|
@@ -13136,7 +13575,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
13136
13575
|
if (runtimeLink !== null)
|
|
13137
13576
|
log2(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
|
|
13138
13577
|
else
|
|
13139
|
-
log2(`Warning: skipped the omo runtime wrapper because ${join31(repoRoot, "dist", "cli", "index.js")} is missing; omo
|
|
13578
|
+
log2(`Warning: skipped the omo runtime wrapper because ${join31(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
|
|
13140
13579
|
}
|
|
13141
13580
|
pluginSources.push({ name: entry.name, sourcePath });
|
|
13142
13581
|
installed.push(plugin);
|
|
@@ -13173,6 +13612,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
13173
13612
|
}
|
|
13174
13613
|
const trustedHookStates = (await Promise.all(installed.map((plugin) => trustedHookStatesForPlugin({
|
|
13175
13614
|
marketplaceName: marketplace.name,
|
|
13615
|
+
platform,
|
|
13176
13616
|
pluginName: plugin.name,
|
|
13177
13617
|
pluginRoot: plugin.path
|
|
13178
13618
|
})))).flat();
|
|
@@ -13436,6 +13876,7 @@ function formatLazyCodexInstallHelp() {
|
|
|
13436
13876
|
"Usage: lazycodex-ai install [--no-tui] [--codex-autonomous|--no-codex-autonomous] [--repo-root <path>]",
|
|
13437
13877
|
" lazycodex-ai uninstall [--project <path>]",
|
|
13438
13878
|
" lazycodex-ai update [--dry-run] [--repo-root <path>]",
|
|
13879
|
+
" lazycodex-ai doctor [--source-root <path>] [--model <model>] [--json|--status|--verbose]",
|
|
13439
13880
|
" lazycodex-ai version",
|
|
13440
13881
|
" lazycodex-ai <command> [args...]",
|
|
13441
13882
|
"",
|
|
@@ -13465,20 +13906,22 @@ async function runDelegatedOmoCommand(parsed, options) {
|
|
|
13465
13906
|
function buildDelegatedOmoInvocation(parsed) {
|
|
13466
13907
|
if (parsed.command === "doctor")
|
|
13467
13908
|
return buildLazyCodexDoctorInvocation(parsed.args);
|
|
13468
|
-
const args = ["--yes", "--package", "oh-my-openagent", "omo", parsed.command];
|
|
13469
13909
|
if (parsed.command === "install") {
|
|
13470
|
-
|
|
13910
|
+
const args2 = ["--yes", "oh-my-openagent@latest", parsed.command, "--platform=codex"];
|
|
13471
13911
|
if (parsed.noTui)
|
|
13472
|
-
|
|
13912
|
+
args2.push("--no-tui");
|
|
13473
13913
|
if (parsed.skipAuth)
|
|
13474
|
-
|
|
13914
|
+
args2.push("--skip-auth");
|
|
13475
13915
|
if (parsed.autonomousPermissions !== false)
|
|
13476
|
-
|
|
13916
|
+
args2.push("--codex-autonomous");
|
|
13477
13917
|
if (parsed.autonomousPermissions === false)
|
|
13478
|
-
|
|
13918
|
+
args2.push("--no-codex-autonomous");
|
|
13479
13919
|
if (parsed.repoRoot)
|
|
13480
|
-
|
|
13481
|
-
|
|
13920
|
+
args2.push(`--repo-root=${parsed.repoRoot}`);
|
|
13921
|
+
return { command: "npx", args: args2, delegatesToOmo: true };
|
|
13922
|
+
}
|
|
13923
|
+
const args = ["--yes", "--package", "oh-my-openagent", "omo", parsed.command];
|
|
13924
|
+
if (parsed.command === "cleanup") {
|
|
13482
13925
|
args.push("--platform=codex", ...parsed.args);
|
|
13483
13926
|
} else {
|
|
13484
13927
|
args.push(...parsed.args);
|
|
@@ -13486,21 +13929,26 @@ function buildDelegatedOmoInvocation(parsed) {
|
|
|
13486
13929
|
return { command: "npx", args, delegatesToOmo: true };
|
|
13487
13930
|
}
|
|
13488
13931
|
function buildLazyCodexDoctorInvocation(doctorArgs) {
|
|
13932
|
+
const doctorOptions = parseLazyCodexDoctorOptions(doctorArgs);
|
|
13933
|
+
const codexArgs = [
|
|
13934
|
+
"exec",
|
|
13935
|
+
"--ephemeral",
|
|
13936
|
+
"--sandbox",
|
|
13937
|
+
"danger-full-access",
|
|
13938
|
+
"--skip-git-repo-check",
|
|
13939
|
+
"--cd",
|
|
13940
|
+
"."
|
|
13941
|
+
];
|
|
13942
|
+
if (doctorOptions.model !== undefined)
|
|
13943
|
+
codexArgs.push("--model", doctorOptions.model);
|
|
13944
|
+
codexArgs.push(buildLazyCodexDoctorPrompt(doctorOptions.args));
|
|
13489
13945
|
return {
|
|
13490
13946
|
command: "codex",
|
|
13491
|
-
args:
|
|
13492
|
-
"exec",
|
|
13493
|
-
"--ephemeral",
|
|
13494
|
-
"--sandbox",
|
|
13495
|
-
"read-only",
|
|
13496
|
-
"--skip-git-repo-check",
|
|
13497
|
-
"--cd",
|
|
13498
|
-
".",
|
|
13499
|
-
buildLazyCodexDoctorPrompt(doctorArgs)
|
|
13500
|
-
],
|
|
13947
|
+
args: codexArgs,
|
|
13501
13948
|
delegatesToOmo: false,
|
|
13502
13949
|
env: {
|
|
13503
|
-
LAZYCODEX_DOCTOR_LCX_ACTIVE: "1"
|
|
13950
|
+
LAZYCODEX_DOCTOR_LCX_ACTIVE: "1",
|
|
13951
|
+
...doctorOptions.sourceRoot === undefined ? {} : { LAZYCODEX_SOURCE_ROOT: doctorOptions.sourceRoot }
|
|
13504
13952
|
}
|
|
13505
13953
|
};
|
|
13506
13954
|
}
|
|
@@ -13508,12 +13956,58 @@ function buildLazyCodexDoctorPrompt(doctorArgs) {
|
|
|
13508
13956
|
return [
|
|
13509
13957
|
"Use $omo:lcx-doctor to diagnose this LazyCodex/Codex installation.",
|
|
13510
13958
|
"This command is already the lazycodex doctor surface; never invoke lazycodex doctor from inside the doctor workflow.",
|
|
13511
|
-
"
|
|
13959
|
+
"Use the resolved source root from LAZYCODEX_SOURCE_ROOT when set; otherwise use ${TMPDIR:-/tmp}/lazycodex-sources.",
|
|
13960
|
+
"Validate cached source checkouts before reuse, quarantine corrupt caches, and do not rely on /tmp/lazycodex-source.",
|
|
13961
|
+
"Sync the latest LazyCodex and OpenAI Codex sources there, inventory the local installation,",
|
|
13512
13962
|
"probe the Codex plugin/cache/hooks/MCP state, and report PASS/WARN/FAIL findings with evidence and remediations.",
|
|
13513
13963
|
buildDoctorOutputInstruction(doctorArgs),
|
|
13514
13964
|
doctorArgs.length > 0 ? `Requested doctor arguments: ${doctorArgs.join(" ")}` : "Requested doctor arguments: none"
|
|
13515
13965
|
].join(" ");
|
|
13516
13966
|
}
|
|
13967
|
+
function parseLazyCodexDoctorOptions(doctorArgs) {
|
|
13968
|
+
const args = [];
|
|
13969
|
+
let model;
|
|
13970
|
+
let sourceRoot;
|
|
13971
|
+
let index = 0;
|
|
13972
|
+
while (index < doctorArgs.length) {
|
|
13973
|
+
const arg = doctorArgs[index];
|
|
13974
|
+
if (arg === "--model") {
|
|
13975
|
+
const value = doctorArgs[index + 1];
|
|
13976
|
+
if (typeof value !== "string" || value.trim().length === 0)
|
|
13977
|
+
throw new Error("--model requires a value");
|
|
13978
|
+
model = value;
|
|
13979
|
+
index += 2;
|
|
13980
|
+
continue;
|
|
13981
|
+
}
|
|
13982
|
+
if (typeof arg === "string" && arg.startsWith("--model=")) {
|
|
13983
|
+
const value = arg.slice("--model=".length);
|
|
13984
|
+
if (value.trim().length === 0)
|
|
13985
|
+
throw new Error("--model requires a value");
|
|
13986
|
+
model = value;
|
|
13987
|
+
index += 1;
|
|
13988
|
+
continue;
|
|
13989
|
+
}
|
|
13990
|
+
if (arg === "--source-root") {
|
|
13991
|
+
const value = doctorArgs[index + 1];
|
|
13992
|
+
if (typeof value !== "string" || value.trim().length === 0)
|
|
13993
|
+
throw new Error("--source-root requires a path");
|
|
13994
|
+
sourceRoot = value;
|
|
13995
|
+
index += 2;
|
|
13996
|
+
continue;
|
|
13997
|
+
}
|
|
13998
|
+
if (typeof arg === "string" && arg.startsWith("--source-root=")) {
|
|
13999
|
+
const value = arg.slice("--source-root=".length);
|
|
14000
|
+
if (value.trim().length === 0)
|
|
14001
|
+
throw new Error("--source-root requires a path");
|
|
14002
|
+
sourceRoot = value;
|
|
14003
|
+
index += 1;
|
|
14004
|
+
continue;
|
|
14005
|
+
}
|
|
14006
|
+
args.push(arg);
|
|
14007
|
+
index += 1;
|
|
14008
|
+
}
|
|
14009
|
+
return { args, ...model === undefined ? {} : { model }, ...sourceRoot === undefined ? {} : { sourceRoot } };
|
|
14010
|
+
}
|
|
13517
14011
|
function buildDoctorOutputInstruction(doctorArgs) {
|
|
13518
14012
|
if (doctorArgs.includes("--json")) {
|
|
13519
14013
|
return "Return exactly one JSON object with summary, environment, checks, remediations, and knownIssues fields; do not wrap it in Markdown.";
|