oh-my-opencode 5.0.0-beta.60 → 5.0.0-beta.63
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/THIRD-PARTY-NOTICES.md +8 -6
- package/dist/cli/doctor/checks/browser-provider.d.ts +2 -0
- package/dist/cli/index.js +465 -348
- package/dist/cli-node/index.js +465 -348
- package/dist/config/schema/agent-names.d.ts +0 -1
- package/dist/config/schema/browser-automation.d.ts +0 -2
- package/dist/config/schema/oh-my-opencode-config.d.ts +0 -1
- package/dist/hooks/comment-checker/__fixtures__/download-probe.fixture.d.ts +1 -0
- package/dist/index.js +61 -535
- package/dist/oh-my-opencode.schema.json +0 -1
- package/dist/skills/ast-grep/SKILL.md +12 -0
- package/dist/skills/debugging/references/tools/playwright-cli.md +79 -161
- package/dist/skills/frontend/SKILL.md +1 -1
- package/dist/skills/frontend/references/design/aside.md +1 -1
- package/dist/skills/frontend/references/design/clone-from-url.md +1 -1
- package/dist/skills/frontend/scripts/perfection/lighthouse-audit.py +2 -2
- package/dist/skills/review-work/SKILL.md +1 -1
- package/dist/skills/ultimate-browsing/ATTRIBUTION.md +1 -82
- package/dist/skills/ultimate-browsing/SKILL.md +17 -29
- package/dist/skills/ultimate-browsing/engine/AGENTS.md +2 -1
- package/dist/skills/ultimate-browsing/engine/templates/package.json +2 -2
- package/dist/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +5 -2
- package/dist/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +8 -6
- package/dist/skills/ultimate-browsing/engine/tests/test_playwright_stealth.py +86 -0
- package/dist/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +4 -7
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +86 -100
- package/dist/skills/ultimate-browsing/references/insane-search/README.md +9 -3
- package/dist/skills/ultimate-browsing/references/insane-search/playwright.md +16 -13
- package/dist/skills/ultimate-browsing/scripts/extract_cookies.py +3 -3
- package/dist/skills/ulw-execute/SKILL.md +1 -1
- package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
- package/dist/skills/ulw-research/SKILL.md +3 -3
- package/dist/skills/visual-qa/AGENTS.md +1 -1
- package/dist/skills/visual-qa/SKILL.md +1 -1
- package/dist/skills/visual-qa/references/browser-setup.md +75 -0
- package/dist/tui.js +12 -5
- package/package.json +16 -23
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +6887 -249
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +7 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +25 -15
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/src/directive-content.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/directive.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +15 -0
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +25 -15
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +5 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +640 -327
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.js +16 -12
- package/packages/omo-codex/plugin/components/ulw-loop/dist/ledger.d.ts +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/ledger.js +34 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-commit.d.ts +19 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-commit.js +107 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +48 -22
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +9 -7
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +105 -114
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-log.d.ts +15 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-log.js +86 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-missing-recovery.d.ts +5 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-missing-recovery.js +15 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.js +3 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/sdk/factory.js +29 -6
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-budget-io.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-budget-io.js +67 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-guard.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-guard.js +29 -66
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-role-guard.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-role-guard.js +22 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/state-lock.d.ts +11 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/state-lock.js +120 -88
- package/packages/omo-codex/plugin/components/ulw-loop/dist/status-next-actions.d.ts +3 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/status-next-actions.js +18 -10
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-batch.js +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +8 -17
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +7 -7
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +5 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/evidence.ts +16 -16
- package/packages/omo-codex/plugin/components/ulw-loop/src/ledger.ts +33 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-commit.ts +124 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +58 -51
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +126 -140
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-log.ts +84 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-missing-recovery.ts +26 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/review-blockers.ts +3 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/sdk/factory.ts +55 -6
- package/packages/omo-codex/plugin/components/ulw-loop/src/spawn-budget-io.ts +59 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/spawn-guard.ts +29 -62
- package/packages/omo-codex/plugin/components/ulw-loop/src/spawn-role-guard.ts +22 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/state-lock.ts +129 -111
- package/packages/omo-codex/plugin/components/ulw-loop/src/status-next-actions.ts +19 -10
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-batch.ts +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +5 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +8 -16
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/barrier.ts +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-child.ts +65 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-cli-qa.mjs +76 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-crash.ts +23 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-mutations.mjs +58 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-writer.ts +65 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/lease-clock.ts +23 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-commit-log.test.ts +252 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-commit-recovery.test.ts +190 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io.test.ts +50 -35
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-log-newest.test.ts +72 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/sdk-completed-plan.test.ts +43 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/sdk-driver-states.test.ts +145 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/sdk-session-context.test.ts +21 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/spawn-guard.test.ts +7 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/spawn-role-matrix.test.ts +113 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/state-lock.test.ts +92 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/status-next-actions-surface.test.ts +133 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering-batch.test.ts +12 -12
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +4 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/sync-skills.d.mts +4 -0
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +18 -10
- package/packages/omo-codex/plugin/skills/ast-grep/SKILL.md +12 -0
- package/packages/omo-codex/plugin/skills/debugging/references/tools/playwright-cli.md +79 -161
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/aside.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/clone-from-url.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/lighthouse-audit.py +2 -2
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +3 -3
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +3 -3
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +3 -3
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +4 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +1 -82
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +17 -29
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +2 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +2 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +5 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +8 -6
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_stealth.py +86 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +4 -7
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +86 -100
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +9 -3
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/playwright.md +16 -13
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/extract_cookies.py +3 -3
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +25 -15
- package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +4 -4
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +3 -3
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +6 -6
- package/packages/omo-codex/plugin/skills/visual-qa/AGENTS.md +1 -1
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +4 -4
- package/packages/omo-codex/plugin/skills/visual-qa/references/browser-setup.md +75 -0
- package/packages/omo-codex/plugin/test/bootstrap-default-role.test.mjs +66 -0
- package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +13 -1
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +7060 -417
- package/packages/prompts-core/prompts/ultrawork/codex.md +25 -15
- package/packages/shared-skills/skills/ast-grep/SKILL.md +12 -0
- package/packages/shared-skills/skills/debugging/references/tools/playwright-cli.md +79 -161
- package/packages/shared-skills/skills/frontend/SKILL.md +1 -1
- package/packages/shared-skills/skills/frontend/references/design/aside.md +1 -1
- package/packages/shared-skills/skills/frontend/references/design/clone-from-url.md +1 -1
- package/packages/shared-skills/skills/frontend/scripts/perfection/lighthouse-audit.py +2 -2
- package/packages/shared-skills/skills/review-work/SKILL.md +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +1 -82
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +17 -29
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +2 -1
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +2 -2
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +5 -2
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +8 -6
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_playwright_stealth.py +86 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +4 -7
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +86 -100
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +9 -3
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/playwright.md +16 -13
- package/packages/shared-skills/skills/ultimate-browsing/scripts/extract_cookies.py +3 -3
- package/packages/shared-skills/skills/ulw-execute/SKILL.md +1 -1
- package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/SKILL.md +3 -3
- package/packages/shared-skills/skills/visual-qa/AGENTS.md +1 -1
- package/packages/shared-skills/skills/visual-qa/SKILL.md +1 -1
- package/packages/shared-skills/skills/visual-qa/references/browser-setup.md +75 -0
- package/dist/skills/visual-qa/references/agent-browser-setup.md +0 -45
- package/packages/omo-codex/plugin/skills/visual-qa/references/agent-browser-setup.md +0 -45
- package/packages/shared-skills/skills/visual-qa/references/agent-browser-setup.md +0 -45
package/dist/cli-node/index.js
CHANGED
|
@@ -65,7 +65,7 @@ var package_default;
|
|
|
65
65
|
var init_package = __esm(() => {
|
|
66
66
|
package_default = {
|
|
67
67
|
name: "oh-my-opencode",
|
|
68
|
-
version: "5.0.0-beta.
|
|
68
|
+
version: "5.0.0-beta.63",
|
|
69
69
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
70
70
|
main: "./dist/index.js",
|
|
71
71
|
types: "dist/index.d.ts",
|
|
@@ -97,8 +97,6 @@ var init_package = __esm(() => {
|
|
|
97
97
|
"packages/omo-codex",
|
|
98
98
|
"packages/omo-senpi",
|
|
99
99
|
"packages/senpi-task",
|
|
100
|
-
"packages/pi-goal",
|
|
101
|
-
"packages/pi-webfetch",
|
|
102
100
|
"packages/omo-opencode",
|
|
103
101
|
"packages/omo-native"
|
|
104
102
|
],
|
|
@@ -200,7 +198,7 @@ var init_package = __esm(() => {
|
|
|
200
198
|
prepublishOnly: "bun run clean && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && bun run build",
|
|
201
199
|
"test:model-capabilities": "bun test --timeout 20000 packages/model-core/src/model-capability-aliases.test.ts packages/model-core/src/model-capability-guardrails.test.ts packages/model-core/src/model-capabilities.test.ts packages/omo-opencode/src/cli/doctor/checks/model-resolution.test.ts --bail",
|
|
202
200
|
typecheck: "tsgo --noEmit && bun run typecheck:script && bun run typecheck:packages",
|
|
203
|
-
"typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/ast-grep-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/omo-config-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/openclaw-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/memory-core/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/omo-codex/plugin/shared/tsconfig.json && tsgo --noEmit -p packages/omo-codex/tsconfig.json && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && tsgo --noEmit -p packages/senpi-task/tsconfig.json && tsgo --noEmit -p packages/
|
|
201
|
+
"typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/ast-grep-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/omo-config-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/openclaw-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/memory-core/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/omo-codex/plugin/shared/tsconfig.json && tsgo --noEmit -p packages/omo-codex/tsconfig.json && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && tsgo --noEmit -p packages/senpi-task/tsconfig.json && tsgo --noEmit -p packages/omo-opencode/tsconfig.json && tsgo --noEmit -p packages/omo-native/tsconfig.json",
|
|
204
202
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
205
203
|
test: "bun test --timeout 20000",
|
|
206
204
|
"changelog:section": "bun script/changelog-section.ts",
|
|
@@ -232,7 +230,6 @@ var init_package = __esm(() => {
|
|
|
232
230
|
homepage: "https://github.com/code-yeongyu/oh-my-openagent#readme",
|
|
233
231
|
dependencies: {
|
|
234
232
|
"@clack/prompts": "^1.7.0",
|
|
235
|
-
"@code-yeongyu/comment-checker": "^0.8.0",
|
|
236
233
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
237
234
|
"@opencode-ai/plugin": "1.18.22",
|
|
238
235
|
"@opencode-ai/sdk": "1.18.22",
|
|
@@ -250,7 +247,7 @@ var init_package = __esm(() => {
|
|
|
250
247
|
zod: "^4.4.3"
|
|
251
248
|
},
|
|
252
249
|
devDependencies: {
|
|
253
|
-
"@code-yeongyu/senpi": "2026.9.
|
|
250
|
+
"@code-yeongyu/senpi": "2026.9.15-2",
|
|
254
251
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
255
252
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
256
253
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
@@ -269,8 +266,6 @@ var init_package = __esm(() => {
|
|
|
269
266
|
"@oh-my-opencode/omo-opencode": "workspace:*",
|
|
270
267
|
"@oh-my-opencode/omo-senpi": "workspace:*",
|
|
271
268
|
"@oh-my-opencode/openclaw-core": "workspace:*",
|
|
272
|
-
"@oh-my-opencode/pi-goal": "workspace:*",
|
|
273
|
-
"@oh-my-opencode/pi-webfetch": "workspace:*",
|
|
274
269
|
"@oh-my-opencode/prompts-core": "workspace:*",
|
|
275
270
|
"@oh-my-opencode/rules-engine": "workspace:*",
|
|
276
271
|
"@oh-my-opencode/senpi-task": "workspace:*",
|
|
@@ -291,18 +286,18 @@ var init_package = __esm(() => {
|
|
|
291
286
|
typescript: "^7.0.2"
|
|
292
287
|
},
|
|
293
288
|
optionalDependencies: {
|
|
294
|
-
"oh-my-opencode-darwin-arm64": "5.0.0-beta.
|
|
295
|
-
"oh-my-opencode-darwin-x64": "5.0.0-beta.
|
|
296
|
-
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.
|
|
297
|
-
"oh-my-opencode-linux-arm64": "5.0.0-beta.
|
|
298
|
-
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.
|
|
299
|
-
"oh-my-opencode-linux-x64": "5.0.0-beta.
|
|
300
|
-
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.
|
|
301
|
-
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.
|
|
302
|
-
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.
|
|
303
|
-
"oh-my-opencode-windows-arm64": "5.0.0-beta.
|
|
304
|
-
"oh-my-opencode-windows-x64": "5.0.0-beta.
|
|
305
|
-
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.
|
|
289
|
+
"oh-my-opencode-darwin-arm64": "5.0.0-beta.63",
|
|
290
|
+
"oh-my-opencode-darwin-x64": "5.0.0-beta.63",
|
|
291
|
+
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.63",
|
|
292
|
+
"oh-my-opencode-linux-arm64": "5.0.0-beta.63",
|
|
293
|
+
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.63",
|
|
294
|
+
"oh-my-opencode-linux-x64": "5.0.0-beta.63",
|
|
295
|
+
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.63",
|
|
296
|
+
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.63",
|
|
297
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.63",
|
|
298
|
+
"oh-my-opencode-windows-arm64": "5.0.0-beta.63",
|
|
299
|
+
"oh-my-opencode-windows-x64": "5.0.0-beta.63",
|
|
300
|
+
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.63"
|
|
306
301
|
},
|
|
307
302
|
overrides: {
|
|
308
303
|
"@earendil-works/pi-agent-core": "0.84.2",
|
|
@@ -316,9 +311,7 @@ var init_package = __esm(() => {
|
|
|
316
311
|
"path-to-regexp": "^8.4.2",
|
|
317
312
|
"@types/node": "26.2.0"
|
|
318
313
|
},
|
|
319
|
-
trustedDependencies: [
|
|
320
|
-
"@code-yeongyu/comment-checker"
|
|
321
|
-
]
|
|
314
|
+
trustedDependencies: []
|
|
322
315
|
};
|
|
323
316
|
});
|
|
324
317
|
|
|
@@ -7151,15 +7144,20 @@ var init_agent_model_requirements = __esm(() => {
|
|
|
7151
7144
|
},
|
|
7152
7145
|
metis: {
|
|
7153
7146
|
fallbackChain: [
|
|
7147
|
+
{
|
|
7148
|
+
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7149
|
+
model: "claude-fable-5-1",
|
|
7150
|
+
variant: "max"
|
|
7151
|
+
},
|
|
7154
7152
|
{
|
|
7155
7153
|
providers: ["anthropic", "github-copilot", "opencode"],
|
|
7156
7154
|
model: "claude-opus-5",
|
|
7157
|
-
variant: "
|
|
7155
|
+
variant: "max"
|
|
7158
7156
|
},
|
|
7159
7157
|
{
|
|
7160
7158
|
providers: ["opencode-go", "kimi-for-coding", "moonshotai", "opencode"],
|
|
7161
7159
|
model: "kimi-k3",
|
|
7162
|
-
variant: "
|
|
7160
|
+
variant: "max"
|
|
7163
7161
|
}
|
|
7164
7162
|
]
|
|
7165
7163
|
},
|
|
@@ -73013,6 +73011,7 @@ var init_task = __esm(() => {
|
|
|
73013
73011
|
model_concurrency: record(string2(), number2().int().nonnegative()).optional(),
|
|
73014
73012
|
max_depth: number2().int().nonnegative().default(1),
|
|
73015
73013
|
residency_max_children: ResidencyMaxChildrenInputSchema.default(8),
|
|
73014
|
+
resident_idle_timeout_ms: number2().int().positive().max(Number.MAX_SAFE_INTEGER).default(900000),
|
|
73016
73015
|
ttl_ms: number2().int().positive().default(86400000),
|
|
73017
73016
|
state_dir: string2().optional(),
|
|
73018
73017
|
reattach_on_reconcile: boolean2().optional(),
|
|
@@ -73057,6 +73056,7 @@ var init_task = __esm(() => {
|
|
|
73057
73056
|
model_concurrency: record(string2(), number2().int().nonnegative()).optional(),
|
|
73058
73057
|
max_depth: number2().int().nonnegative().optional(),
|
|
73059
73058
|
residency_max_children: ResidencyMaxChildrenInputSchema.optional(),
|
|
73059
|
+
resident_idle_timeout_ms: number2().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),
|
|
73060
73060
|
ttl_ms: number2().int().positive().optional(),
|
|
73061
73061
|
state_dir: string2().optional(),
|
|
73062
73062
|
reattach_on_reconcile: boolean2().optional(),
|
|
@@ -77023,20 +77023,20 @@ var init_config_manager = __esm(() => {
|
|
|
77023
77023
|
|
|
77024
77024
|
// packages/telemetry-core/src/activity-state.ts
|
|
77025
77025
|
import { existsSync as existsSync24, mkdirSync as mkdirSync8, readFileSync as readFileSync11 } from "node:fs";
|
|
77026
|
-
import { basename as basename8, join as
|
|
77026
|
+
import { basename as basename8, join as join51 } from "node:path";
|
|
77027
77027
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
77028
77028
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
77029
77029
|
env: options.env,
|
|
77030
77030
|
osProvider: options.osProvider
|
|
77031
77031
|
});
|
|
77032
|
-
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined :
|
|
77032
|
+
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join51(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
77033
77033
|
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename8(dataDir) === product.cacheDirName) {
|
|
77034
77034
|
return dataDir;
|
|
77035
77035
|
}
|
|
77036
|
-
return
|
|
77036
|
+
return join51(dataDir, product.cacheDirName);
|
|
77037
77037
|
}
|
|
77038
77038
|
function getTelemetryActivityStateFilePath(stateDir) {
|
|
77039
|
-
return
|
|
77039
|
+
return join51(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
|
|
77040
77040
|
}
|
|
77041
77041
|
function getDailyActiveCaptureState(input) {
|
|
77042
77042
|
const state = readPostHogActivityState(input.stateDir, input.diagnostics);
|
|
@@ -77107,9 +77107,9 @@ var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY =
|
|
|
77107
77107
|
|
|
77108
77108
|
// packages/telemetry-core/src/diagnostics.ts
|
|
77109
77109
|
import { appendFileSync as appendFileSync2, existsSync as existsSync25, mkdirSync as mkdirSync9, readFileSync as readFileSync12 } from "node:fs";
|
|
77110
|
-
import { join as
|
|
77110
|
+
import { join as join52 } from "node:path";
|
|
77111
77111
|
function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
|
|
77112
|
-
return
|
|
77112
|
+
return join52(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
|
|
77113
77113
|
}
|
|
77114
77114
|
function writeTelemetryDiagnostic(input, options) {
|
|
77115
77115
|
const now = options.now ?? new Date;
|
|
@@ -84416,13 +84416,13 @@ var init_index_node = __esm(() => {
|
|
|
84416
84416
|
});
|
|
84417
84417
|
|
|
84418
84418
|
// packages/telemetry-core/src/machine-id.ts
|
|
84419
|
-
import { createHash as
|
|
84419
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
84420
84420
|
import os4 from "node:os";
|
|
84421
84421
|
function getDefaultTelemetryOsProvider() {
|
|
84422
84422
|
return os4;
|
|
84423
84423
|
}
|
|
84424
84424
|
function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
|
|
84425
|
-
return
|
|
84425
|
+
return createHash5("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
|
|
84426
84426
|
}
|
|
84427
84427
|
var init_machine_id = () => {};
|
|
84428
84428
|
|
|
@@ -84621,7 +84621,7 @@ var package_default2;
|
|
|
84621
84621
|
var init_package2 = __esm(() => {
|
|
84622
84622
|
package_default2 = {
|
|
84623
84623
|
name: "@oh-my-opencode/omo-codex",
|
|
84624
|
-
version: "5.0.0-beta.
|
|
84624
|
+
version: "5.0.0-beta.63",
|
|
84625
84625
|
type: "module",
|
|
84626
84626
|
private: true,
|
|
84627
84627
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -85493,7 +85493,7 @@ var init_update_toasts = __esm(() => {
|
|
|
85493
85493
|
|
|
85494
85494
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
85495
85495
|
import { existsSync as existsSync46 } from "node:fs";
|
|
85496
|
-
import { dirname as dirname30, join as
|
|
85496
|
+
import { dirname as dirname30, join as join74 } from "node:path";
|
|
85497
85497
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
85498
85498
|
function defaultGetModuleHostingWorkspace() {
|
|
85499
85499
|
try {
|
|
@@ -85647,7 +85647,7 @@ var init_background_update_check = __esm(() => {
|
|
|
85647
85647
|
init_update_toasts();
|
|
85648
85648
|
defaultDeps4 = {
|
|
85649
85649
|
existsSync: existsSync46,
|
|
85650
|
-
join:
|
|
85650
|
+
join: join74,
|
|
85651
85651
|
runBunInstallWithDetails,
|
|
85652
85652
|
log: log2,
|
|
85653
85653
|
getOpenCodeCacheDir,
|
|
@@ -88069,7 +88069,19 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
|
|
|
88069
88069
|
}
|
|
88070
88070
|
|
|
88071
88071
|
// packages/omo-codex/src/install/install-codex.ts
|
|
88072
|
-
import { join as
|
|
88072
|
+
import { join as join53, resolve as resolve12 } from "node:path";
|
|
88073
|
+
|
|
88074
|
+
// packages/omo-codex/src/install/codex-default-role-config.ts
|
|
88075
|
+
init_src4();
|
|
88076
|
+
function readDefaultRoleConfig(options = {}) {
|
|
88077
|
+
const result = loadOmoConfig({ ...options, harness: "codex" });
|
|
88078
|
+
return {
|
|
88079
|
+
enabled: result.config.agents?.default?.disable !== true,
|
|
88080
|
+
warnings: result.diagnostics.map((diagnostic) => diagnostic.message)
|
|
88081
|
+
};
|
|
88082
|
+
}
|
|
88083
|
+
|
|
88084
|
+
// packages/omo-codex/src/install/install-codex.ts
|
|
88073
88085
|
import { existsSync as existsSync26 } from "node:fs";
|
|
88074
88086
|
import { homedir as homedir6 } from "node:os";
|
|
88075
88087
|
|
|
@@ -89996,6 +90008,12 @@ function removeStaleManagedAgentBlocks(config, keepAgentNames) {
|
|
|
89996
90008
|
|
|
89997
90009
|
`);
|
|
89998
90010
|
}
|
|
90011
|
+
function hasForeignAgentRegistration(config, agentConfig) {
|
|
90012
|
+
const section = findTomlSection(config, `agents.${tomlKeySegment(agentConfig.name)}`);
|
|
90013
|
+
if (!section)
|
|
90014
|
+
return false;
|
|
90015
|
+
return !section.text.includes(`config_file = ${JSON.stringify(agentConfig.configFile)}`);
|
|
90016
|
+
}
|
|
89999
90017
|
function ensureAgentConfig(config, agentConfig) {
|
|
90000
90018
|
const header = `agents.${tomlKeySegment(agentConfig.name)}`;
|
|
90001
90019
|
const section = findTomlSection(config, header);
|
|
@@ -90965,8 +90983,8 @@ function toCodexResolution(resolution) {
|
|
|
90965
90983
|
}
|
|
90966
90984
|
|
|
90967
90985
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
90968
|
-
import { copyFile, lstat as
|
|
90969
|
-
import { basename as basename6, join as
|
|
90986
|
+
import { copyFile, lstat as lstat10, mkdir as mkdir6, readdir as readdir7, rm as rm9, writeFile as writeFile7 } from "node:fs/promises";
|
|
90987
|
+
import { basename as basename6, join as join41 } from "node:path";
|
|
90970
90988
|
|
|
90971
90989
|
// packages/omo-codex/src/install/preserved-agent-settings.ts
|
|
90972
90990
|
import { lstat as lstat7, readFile as readFile13, readdir as readdir6, writeFile as writeFile6 } from "node:fs/promises";
|
|
@@ -91383,6 +91401,66 @@ function nodeErrorCode2(error) {
|
|
|
91383
91401
|
return typeof error.code === "string" ? error.code : null;
|
|
91384
91402
|
}
|
|
91385
91403
|
|
|
91404
|
+
// packages/omo-codex/src/install/default-agent-role.ts
|
|
91405
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
91406
|
+
import { lstat as lstat9, readFile as readFile15, rm as rm8 } from "node:fs/promises";
|
|
91407
|
+
import { join as join40 } from "node:path";
|
|
91408
|
+
var REGISTRATION = { name: "default", configFile: "./agents/default.toml" };
|
|
91409
|
+
async function installDefaultAgentRole(input) {
|
|
91410
|
+
const target = join40(input.codexHome, "agents", "default.toml");
|
|
91411
|
+
const receipt = join40(input.codexHome, "agents", ".lazycodex-default.sha256");
|
|
91412
|
+
const configPath = join40(input.codexHome, "config.toml");
|
|
91413
|
+
const config = await readIfPresent(configPath);
|
|
91414
|
+
const entry = await lstat9(target).catch((error) => {
|
|
91415
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
91416
|
+
return null;
|
|
91417
|
+
throw error;
|
|
91418
|
+
});
|
|
91419
|
+
if (entry !== null && !entry.isFile()) {
|
|
91420
|
+
if (!input.enabled)
|
|
91421
|
+
return null;
|
|
91422
|
+
throw new Error("Preserved user-owned agents/default.toml: refusing to replace a symlink or directory");
|
|
91423
|
+
}
|
|
91424
|
+
const existing = await readIfPresent(target);
|
|
91425
|
+
const digest = await readIfPresent(receipt);
|
|
91426
|
+
const owned = existing !== null && digest === hash(existing);
|
|
91427
|
+
const foreign = hasForeignAgentRegistration(config ?? "", REGISTRATION);
|
|
91428
|
+
if (!input.enabled) {
|
|
91429
|
+
if (owned) {
|
|
91430
|
+
if (!foreign && config !== null) {
|
|
91431
|
+
const next = splitTomlSections(config).filter((section) => section.header === null || parseAgentHeaderName(section.header) !== "default").map((section) => section.text).join("");
|
|
91432
|
+
if (next !== config)
|
|
91433
|
+
await writeFileAtomic(configPath, next);
|
|
91434
|
+
}
|
|
91435
|
+
await rm8(target);
|
|
91436
|
+
await rm8(receipt);
|
|
91437
|
+
}
|
|
91438
|
+
return null;
|
|
91439
|
+
}
|
|
91440
|
+
if (foreign || existing !== null && !owned) {
|
|
91441
|
+
throw new Error("Preserved user-owned agents.default / agents/default.toml. Move it aside to install the LazyCodex fallback, or set [codex].agents.default.disable = true in omo.jsonc. Explicit LazyCodex roles remain required.");
|
|
91442
|
+
}
|
|
91443
|
+
const worker = await readFile15(input.worker.path, "utf8");
|
|
91444
|
+
const content = worker.replace(/^name\s*=\s*["']lazycodex-worker-medium["']\s*$/m, 'name = "default"');
|
|
91445
|
+
if (content === worker)
|
|
91446
|
+
throw new Error("Cannot derive default: medium worker has no matching internal name");
|
|
91447
|
+
await writeFileAtomic(target, content);
|
|
91448
|
+
await writeFileAtomic(receipt, hash(content));
|
|
91449
|
+
return { name: "default.toml", path: target, target: input.worker.target };
|
|
91450
|
+
}
|
|
91451
|
+
async function readIfPresent(path) {
|
|
91452
|
+
try {
|
|
91453
|
+
return await readFile15(path, "utf8");
|
|
91454
|
+
} catch (error) {
|
|
91455
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
91456
|
+
return null;
|
|
91457
|
+
throw error;
|
|
91458
|
+
}
|
|
91459
|
+
}
|
|
91460
|
+
function hash(content) {
|
|
91461
|
+
return createHash3("sha256").update(content).digest("hex");
|
|
91462
|
+
}
|
|
91463
|
+
|
|
91386
91464
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
91387
91465
|
var MANIFEST_FILE = ".installed-agents.json";
|
|
91388
91466
|
async function linkCachedPluginAgents(input) {
|
|
@@ -91392,13 +91470,13 @@ async function linkCachedPluginAgents(input) {
|
|
|
91392
91470
|
await writeManifest(input.pluginRoot, []);
|
|
91393
91471
|
return [];
|
|
91394
91472
|
}
|
|
91395
|
-
const agentsDir =
|
|
91473
|
+
const agentsDir = join41(input.codexHome, "agents");
|
|
91396
91474
|
await mkdir6(agentsDir, { recursive: true });
|
|
91397
91475
|
const linked = [];
|
|
91398
91476
|
for (const agentPath of bundledAgents) {
|
|
91399
91477
|
const agentFileName = basename6(agentPath);
|
|
91400
91478
|
const agentName = agentNameFromToml2(agentFileName);
|
|
91401
|
-
const linkPath =
|
|
91479
|
+
const linkPath = join41(agentsDir, agentFileName);
|
|
91402
91480
|
await replaceWithCopy(linkPath, agentPath);
|
|
91403
91481
|
await restorePreservedReasoning({
|
|
91404
91482
|
agentName,
|
|
@@ -91413,11 +91491,17 @@ async function linkCachedPluginAgents(input) {
|
|
|
91413
91491
|
});
|
|
91414
91492
|
linked.push({ name: agentFileName, path: linkPath, target: agentPath });
|
|
91415
91493
|
}
|
|
91494
|
+
const worker = linked.find((entry) => entry.name === "lazycodex-worker-medium.toml");
|
|
91495
|
+
if (worker !== undefined) {
|
|
91496
|
+
const fallback = await installDefaultAgentRole({ codexHome: input.codexHome, worker, enabled: input.defaultRoleEnabled !== false });
|
|
91497
|
+
if (fallback !== null)
|
|
91498
|
+
linked.push(fallback);
|
|
91499
|
+
}
|
|
91416
91500
|
await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
|
|
91417
91501
|
return linked;
|
|
91418
91502
|
}
|
|
91419
91503
|
async function discoverBundledAgents(pluginRoot) {
|
|
91420
|
-
const componentsRoot =
|
|
91504
|
+
const componentsRoot = join41(pluginRoot, "components");
|
|
91421
91505
|
if (!await exists4(componentsRoot))
|
|
91422
91506
|
return [];
|
|
91423
91507
|
const componentEntries = await readdir7(componentsRoot, { withFileTypes: true });
|
|
@@ -91425,14 +91509,14 @@ async function discoverBundledAgents(pluginRoot) {
|
|
|
91425
91509
|
for (const entry of componentEntries) {
|
|
91426
91510
|
if (!entry.isDirectory())
|
|
91427
91511
|
continue;
|
|
91428
|
-
const agentsRoot =
|
|
91512
|
+
const agentsRoot = join41(componentsRoot, entry.name, "agents");
|
|
91429
91513
|
if (!await exists4(agentsRoot))
|
|
91430
91514
|
continue;
|
|
91431
91515
|
const agentEntries = await readdir7(agentsRoot, { withFileTypes: true });
|
|
91432
91516
|
for (const file of agentEntries) {
|
|
91433
91517
|
if (!file.isFile() || !file.name.endsWith(".toml"))
|
|
91434
91518
|
continue;
|
|
91435
|
-
agents.push(
|
|
91519
|
+
agents.push(join41(agentsRoot, file.name));
|
|
91436
91520
|
}
|
|
91437
91521
|
}
|
|
91438
91522
|
agents.sort();
|
|
@@ -91445,14 +91529,14 @@ async function replaceWithCopy(linkPath, target) {
|
|
|
91445
91529
|
async function prepareReplacement(linkPath) {
|
|
91446
91530
|
if (!await exists4(linkPath))
|
|
91447
91531
|
return;
|
|
91448
|
-
const entryStat = await
|
|
91532
|
+
const entryStat = await lstat10(linkPath);
|
|
91449
91533
|
if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
|
|
91450
91534
|
throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
|
|
91451
91535
|
}
|
|
91452
|
-
await
|
|
91536
|
+
await rm9(linkPath, { force: true });
|
|
91453
91537
|
}
|
|
91454
91538
|
async function writeManifest(pluginRoot, agentPaths) {
|
|
91455
|
-
const manifestPath =
|
|
91539
|
+
const manifestPath = join41(pluginRoot, MANIFEST_FILE);
|
|
91456
91540
|
const payload = { agents: [...agentPaths].sort() };
|
|
91457
91541
|
await writeFile7(manifestPath, `${JSON.stringify(payload, null, "\t")}
|
|
91458
91542
|
`);
|
|
@@ -91462,7 +91546,7 @@ function agentNameFromToml2(fileName) {
|
|
|
91462
91546
|
}
|
|
91463
91547
|
async function exists4(path) {
|
|
91464
91548
|
try {
|
|
91465
|
-
await
|
|
91549
|
+
await lstat10(path);
|
|
91466
91550
|
return true;
|
|
91467
91551
|
} catch (error) {
|
|
91468
91552
|
if (nodeErrorCode3(error) !== "ENOENT")
|
|
@@ -91477,12 +91561,12 @@ function nodeErrorCode3(error) {
|
|
|
91477
91561
|
}
|
|
91478
91562
|
|
|
91479
91563
|
// packages/omo-codex/src/install/codex-marketplace.ts
|
|
91480
|
-
import { readFile as
|
|
91481
|
-
import { join as
|
|
91564
|
+
import { readFile as readFile16 } from "node:fs/promises";
|
|
91565
|
+
import { join as join42 } from "node:path";
|
|
91482
91566
|
var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
|
|
91483
91567
|
async function readMarketplace(repoRoot, options) {
|
|
91484
|
-
const marketplacePath = options?.marketplacePath ??
|
|
91485
|
-
const raw = await
|
|
91568
|
+
const marketplacePath = options?.marketplacePath ?? join42(repoRoot, DEFAULT_MARKETPLACE_PATH);
|
|
91569
|
+
const raw = await readFile16(marketplacePath, "utf8");
|
|
91486
91570
|
const parsed = JSON.parse(raw);
|
|
91487
91571
|
if (!isPlainRecord4(parsed))
|
|
91488
91572
|
throw new Error("marketplace.json must be an object");
|
|
@@ -91500,10 +91584,10 @@ async function readMarketplace(repoRoot, options) {
|
|
|
91500
91584
|
function resolvePluginSource(repoRoot, plugin, options) {
|
|
91501
91585
|
const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
|
|
91502
91586
|
const relativePath = sourcePath.slice(2);
|
|
91503
|
-
return
|
|
91587
|
+
return join42(repoRoot, ...relativePath.split(/[\\/]/));
|
|
91504
91588
|
}
|
|
91505
91589
|
async function readPluginManifest(pluginRoot) {
|
|
91506
|
-
const raw = await
|
|
91590
|
+
const raw = await readFile16(join42(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
|
|
91507
91591
|
const parsed = JSON.parse(raw);
|
|
91508
91592
|
if (!isPlainRecord4(parsed))
|
|
91509
91593
|
throw new Error(`${pluginRoot} plugin.json must be an object`);
|
|
@@ -91584,8 +91668,8 @@ function validateLocalSourcePath(path) {
|
|
|
91584
91668
|
}
|
|
91585
91669
|
|
|
91586
91670
|
// packages/omo-codex/src/install/codex-marketplace-snapshot.ts
|
|
91587
|
-
import { cp as cp3, mkdir as mkdir7, rename as rename4, rm as
|
|
91588
|
-
import { join as
|
|
91671
|
+
import { cp as cp3, mkdir as mkdir7, rename as rename4, rm as rm10, writeFile as writeFile8 } from "node:fs/promises";
|
|
91672
|
+
import { join as join43, sep as sep6 } from "node:path";
|
|
91589
91673
|
var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
|
|
91590
91674
|
async function writeInstalledMarketplaceSnapshot(input) {
|
|
91591
91675
|
const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
|
|
@@ -91598,28 +91682,28 @@ async function writeInstalledMarketplaceSnapshot(input) {
|
|
|
91598
91682
|
return snapshotPlugins;
|
|
91599
91683
|
}
|
|
91600
91684
|
function installedMarketplaceRoot(codexHome, marketplaceName) {
|
|
91601
|
-
return
|
|
91685
|
+
return join43(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
|
|
91602
91686
|
}
|
|
91603
91687
|
async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
|
|
91604
|
-
const manifestDir =
|
|
91688
|
+
const manifestDir = join43(marketplaceRoot, ".agents", "plugins");
|
|
91605
91689
|
await mkdir7(manifestDir, { recursive: true });
|
|
91606
|
-
const tempPath =
|
|
91690
|
+
const tempPath = join43(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
|
|
91607
91691
|
await writeFile8(tempPath, `${JSON.stringify(marketplace, null, "\t")}
|
|
91608
91692
|
`);
|
|
91609
|
-
await rename4(tempPath,
|
|
91693
|
+
await rename4(tempPath, join43(manifestDir, "marketplace.json"));
|
|
91610
91694
|
}
|
|
91611
91695
|
async function writeSnapshotPlugin(marketplaceRoot, plugin) {
|
|
91612
|
-
const pluginsDir =
|
|
91696
|
+
const pluginsDir = join43(marketplaceRoot, "plugins");
|
|
91613
91697
|
await mkdir7(pluginsDir, { recursive: true });
|
|
91614
|
-
const targetPath =
|
|
91615
|
-
const tempPath =
|
|
91616
|
-
await
|
|
91698
|
+
const targetPath = join43(pluginsDir, plugin.name);
|
|
91699
|
+
const tempPath = join43(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
|
|
91700
|
+
await rm10(tempPath, { recursive: true, force: true });
|
|
91617
91701
|
await cp3(plugin.sourcePath, tempPath, {
|
|
91618
91702
|
recursive: true,
|
|
91619
91703
|
filter: (source) => shouldCopyMarketplaceSourcePath(source, plugin.sourcePath)
|
|
91620
91704
|
});
|
|
91621
91705
|
await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: plugin.sourcePath });
|
|
91622
|
-
await
|
|
91706
|
+
await rm10(targetPath, { recursive: true, force: true });
|
|
91623
91707
|
await rename4(tempPath, targetPath);
|
|
91624
91708
|
await rewriteCachedMcpManifest(targetPath, plugin.sourcePath);
|
|
91625
91709
|
return { name: plugin.name, path: targetPath };
|
|
@@ -91633,11 +91717,11 @@ function shouldCopyMarketplaceSourcePath(path, root) {
|
|
|
91633
91717
|
}
|
|
91634
91718
|
|
|
91635
91719
|
// packages/omo-codex/src/install/lazycodex-version-stamp.ts
|
|
91636
|
-
import { readdir as readdir8, readFile as
|
|
91637
|
-
import { join as
|
|
91720
|
+
import { readdir as readdir8, readFile as readFile17, writeFile as writeFile9 } from "node:fs/promises";
|
|
91721
|
+
import { join as join44 } from "node:path";
|
|
91638
91722
|
async function readDistributionManifest(repoRoot) {
|
|
91639
91723
|
try {
|
|
91640
|
-
const parsed = JSON.parse(await
|
|
91724
|
+
const parsed = JSON.parse(await readFile17(join44(repoRoot, "package.json"), "utf8"));
|
|
91641
91725
|
if (!isPlainRecord4(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
|
|
91642
91726
|
return;
|
|
91643
91727
|
return {
|
|
@@ -91661,19 +91745,19 @@ function resolveLazyCodexPluginVersion(input) {
|
|
|
91661
91745
|
return input.manifestVersion ?? "local";
|
|
91662
91746
|
}
|
|
91663
91747
|
async function stampLazyCodexPluginVersion(input) {
|
|
91664
|
-
const manifestPath =
|
|
91748
|
+
const manifestPath = join44(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
91665
91749
|
const hookPaths = await readPluginHookPaths(manifestPath);
|
|
91666
91750
|
await stampJsonVersion(manifestPath, input.version);
|
|
91667
|
-
await stampJsonVersion(
|
|
91751
|
+
await stampJsonVersion(join44(input.pluginRoot, "package.json"), input.version);
|
|
91668
91752
|
for (const hookPath of hookPaths) {
|
|
91669
|
-
await stampHookStatusMessages(
|
|
91753
|
+
await stampHookStatusMessages(join44(input.pluginRoot, hookPath), input.version);
|
|
91670
91754
|
}
|
|
91671
91755
|
await stampComponentVersions(input);
|
|
91672
91756
|
}
|
|
91673
91757
|
async function writeLazyCodexInstallSnapshot(input) {
|
|
91674
91758
|
if (input.distributionManifest === undefined)
|
|
91675
91759
|
return;
|
|
91676
|
-
await writeFile9(
|
|
91760
|
+
await writeFile9(join44(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
|
|
91677
91761
|
packageName: input.distributionManifest.name,
|
|
91678
91762
|
version: input.distributionManifest.version
|
|
91679
91763
|
}, null, "\t")}
|
|
@@ -91681,7 +91765,7 @@ async function writeLazyCodexInstallSnapshot(input) {
|
|
|
91681
91765
|
}
|
|
91682
91766
|
async function stampJsonVersion(path, version) {
|
|
91683
91767
|
try {
|
|
91684
|
-
const parsed = JSON.parse(await
|
|
91768
|
+
const parsed = JSON.parse(await readFile17(path, "utf8"));
|
|
91685
91769
|
if (!isPlainRecord4(parsed))
|
|
91686
91770
|
return;
|
|
91687
91771
|
parsed.version = version;
|
|
@@ -91695,7 +91779,7 @@ async function stampJsonVersion(path, version) {
|
|
|
91695
91779
|
}
|
|
91696
91780
|
async function readPluginHookPaths(manifestPath) {
|
|
91697
91781
|
try {
|
|
91698
|
-
const parsed = JSON.parse(await
|
|
91782
|
+
const parsed = JSON.parse(await readFile17(manifestPath, "utf8"));
|
|
91699
91783
|
if (!isPlainRecord4(parsed))
|
|
91700
91784
|
return [];
|
|
91701
91785
|
if (typeof parsed.hooks === "string" && parsed.hooks.trim().length > 0)
|
|
@@ -91715,7 +91799,7 @@ function stripDotSlash3(path) {
|
|
|
91715
91799
|
}
|
|
91716
91800
|
async function stampHookStatusMessages(path, version) {
|
|
91717
91801
|
try {
|
|
91718
|
-
const parsed = JSON.parse(await
|
|
91802
|
+
const parsed = JSON.parse(await readFile17(path, "utf8"));
|
|
91719
91803
|
if (!isPlainRecord4(parsed))
|
|
91720
91804
|
return;
|
|
91721
91805
|
stampHookGroups(parsed.hooks, version);
|
|
@@ -91730,16 +91814,16 @@ async function stampHookStatusMessages(path, version) {
|
|
|
91730
91814
|
async function stampComponentVersions(input) {
|
|
91731
91815
|
let entries;
|
|
91732
91816
|
try {
|
|
91733
|
-
entries = await readdir8(
|
|
91817
|
+
entries = await readdir8(join44(input.pluginRoot, "components"));
|
|
91734
91818
|
} catch (error) {
|
|
91735
91819
|
if (error instanceof Error)
|
|
91736
91820
|
return;
|
|
91737
91821
|
throw error;
|
|
91738
91822
|
}
|
|
91739
91823
|
for (const entry of entries) {
|
|
91740
|
-
const componentRoot =
|
|
91741
|
-
await stampJsonVersion(
|
|
91742
|
-
await stampHookStatusMessages(
|
|
91824
|
+
const componentRoot = join44(input.pluginRoot, "components", entry);
|
|
91825
|
+
await stampJsonVersion(join44(componentRoot, "package.json"), input.version);
|
|
91826
|
+
await stampHookStatusMessages(join44(componentRoot, "hooks", "hooks.json"), input.version);
|
|
91743
91827
|
}
|
|
91744
91828
|
}
|
|
91745
91829
|
function stampHookGroups(hooks, version) {
|
|
@@ -91796,8 +91880,8 @@ var defaultRunCommand = async (command, args, options) => {
|
|
|
91796
91880
|
};
|
|
91797
91881
|
|
|
91798
91882
|
// packages/omo-codex/src/install/codex-project-local-cleanup.ts
|
|
91799
|
-
import { copyFile as copyFile2, lstat as
|
|
91800
|
-
import { dirname as dirname16, join as
|
|
91883
|
+
import { copyFile as copyFile2, lstat as lstat11, readFile as readFile18, writeFile as writeFile10 } from "node:fs/promises";
|
|
91884
|
+
import { dirname as dirname16, join as join45, resolve as resolve10 } from "node:path";
|
|
91801
91885
|
var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
|
|
91802
91886
|
var PROJECT_LOCAL_ARTIFACT_PATHS = [
|
|
91803
91887
|
".codex/hooks.json",
|
|
@@ -91816,7 +91900,7 @@ async function repairNearestProjectLocalCodexArtifacts(input) {
|
|
|
91816
91900
|
const artifacts = await collectProjectLocalArtifacts(project.artifactRoots);
|
|
91817
91901
|
const configs = [];
|
|
91818
91902
|
for (const configPath of project.configPaths) {
|
|
91819
|
-
const original = await
|
|
91903
|
+
const original = await readFile18(configPath, "utf8");
|
|
91820
91904
|
const repair = repairProjectLocalCodexConfigText(original);
|
|
91821
91905
|
if (!repair.changed) {
|
|
91822
91906
|
configs.push({
|
|
@@ -91900,17 +91984,17 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
91900
91984
|
if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
|
|
91901
91985
|
throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
|
|
91902
91986
|
}
|
|
91903
|
-
const codexHomeConfigPath = codexHome === undefined ? null :
|
|
91987
|
+
const codexHomeConfigPath = codexHome === undefined ? null : join45(resolve10(codexHome), "config.toml");
|
|
91904
91988
|
let current = resolve10(startDirectory);
|
|
91905
91989
|
const configPathsFromCwd = [];
|
|
91906
91990
|
while (true) {
|
|
91907
|
-
const configPath =
|
|
91991
|
+
const configPath = join45(current, ".codex", "config.toml");
|
|
91908
91992
|
if (await isRegularProjectLocalConfig(current, configPath)) {
|
|
91909
91993
|
if (codexHomeConfigPath === null || resolve10(configPath) !== codexHomeConfigPath) {
|
|
91910
91994
|
configPathsFromCwd.push(configPath);
|
|
91911
91995
|
}
|
|
91912
91996
|
}
|
|
91913
|
-
if (await exists5(
|
|
91997
|
+
if (await exists5(join45(current, ".git"))) {
|
|
91914
91998
|
return configPathsFromCwd.length === 0 ? null : {
|
|
91915
91999
|
projectRoot: current,
|
|
91916
92000
|
configPaths: [...configPathsFromCwd].reverse(),
|
|
@@ -91930,7 +92014,7 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
91930
92014
|
}
|
|
91931
92015
|
}
|
|
91932
92016
|
async function isRegularProjectLocalConfig(directory, configPath) {
|
|
91933
|
-
const codexDirStat = await maybeLstat(
|
|
92017
|
+
const codexDirStat = await maybeLstat(join45(directory, ".codex"));
|
|
91934
92018
|
if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
|
|
91935
92019
|
return false;
|
|
91936
92020
|
const configStat = await maybeLstat(configPath);
|
|
@@ -91950,7 +92034,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
|
|
|
91950
92034
|
const seenPaths = new Set;
|
|
91951
92035
|
for (const projectRoot of projectRoots) {
|
|
91952
92036
|
for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
|
|
91953
|
-
const artifactPath =
|
|
92037
|
+
const artifactPath = join45(projectRoot, relativePath);
|
|
91954
92038
|
if (seenPaths.has(artifactPath))
|
|
91955
92039
|
continue;
|
|
91956
92040
|
const entryStat = await maybeLstat(artifactPath);
|
|
@@ -91984,7 +92068,7 @@ function formatBackupTimestamp(date) {
|
|
|
91984
92068
|
}
|
|
91985
92069
|
async function maybeLstat(path) {
|
|
91986
92070
|
try {
|
|
91987
|
-
return await
|
|
92071
|
+
return await lstat11(path);
|
|
91988
92072
|
} catch (error) {
|
|
91989
92073
|
if (nodeErrorCode4(error) === "ENOENT")
|
|
91990
92074
|
return null;
|
|
@@ -92025,14 +92109,14 @@ function formatUnknownError(error) {
|
|
|
92025
92109
|
}
|
|
92026
92110
|
|
|
92027
92111
|
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
|
|
92028
|
-
import { createHash as
|
|
92029
|
-
import { lstat as
|
|
92112
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
92113
|
+
import { lstat as lstat12, readFile as readFile20, readdir as readdir10, rm as rm11 } from "node:fs/promises";
|
|
92030
92114
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
92031
|
-
import { join as
|
|
92115
|
+
import { join as join46, posix as posix6 } from "node:path";
|
|
92032
92116
|
|
|
92033
92117
|
// packages/omo-codex/src/install/lsp-daemon-reaper-attestation.ts
|
|
92034
92118
|
import { execFile } from "node:child_process";
|
|
92035
|
-
import { readFile as
|
|
92119
|
+
import { readFile as readFile19, readdir as readdir9, readlink as readlink5 } from "node:fs/promises";
|
|
92036
92120
|
import { connect } from "node:net";
|
|
92037
92121
|
import { basename as basename7 } from "node:path";
|
|
92038
92122
|
var PROBE_TIMEOUT_MS = 500;
|
|
@@ -92074,7 +92158,7 @@ async function attestLegacyDaemonOwnership(input, deps = {}) {
|
|
|
92074
92158
|
return false;
|
|
92075
92159
|
}
|
|
92076
92160
|
async function attestLinuxOwnership(input, deps) {
|
|
92077
|
-
const readFileImpl = deps.readFile ??
|
|
92161
|
+
const readFileImpl = deps.readFile ?? readFile19;
|
|
92078
92162
|
const readDirImpl = deps.readDir ?? readdir9;
|
|
92079
92163
|
const readLinkImpl = deps.readLink ?? readlink5;
|
|
92080
92164
|
const procNetUnix = await readText(readFileImpl, "/proc/net/unix");
|
|
@@ -92201,7 +92285,7 @@ async function readBinary(readFileImpl, path) {
|
|
|
92201
92285
|
var LEGACY_EXIT_WAIT_TIMEOUT_MS = 5000;
|
|
92202
92286
|
var LEGACY_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
|
|
92203
92287
|
async function reapLspDaemons(codexHome, deps = {}) {
|
|
92204
|
-
const daemonRoot =
|
|
92288
|
+
const daemonRoot = join46(codexHome, "codex-lsp", "daemon");
|
|
92205
92289
|
const platform = deps.platform ?? process.platform;
|
|
92206
92290
|
const tmpDir = deps.tmpDir ?? tmpdir3();
|
|
92207
92291
|
const probe = deps.probeLegacyJsonRpc ?? probeLegacyJsonRpcEndpoint;
|
|
@@ -92211,7 +92295,7 @@ async function reapLspDaemons(codexHome, deps = {}) {
|
|
|
92211
92295
|
const entries = await readdir10(daemonRoot, { withFileTypes: true }).catch(() => []);
|
|
92212
92296
|
const results = [];
|
|
92213
92297
|
for (const entry of [...entries].sort((left, right) => left.name.localeCompare(right.name))) {
|
|
92214
|
-
const versionPath =
|
|
92298
|
+
const versionPath = join46(daemonRoot, entry.name);
|
|
92215
92299
|
const parsedVersion = parseVersionEntry(entry.name);
|
|
92216
92300
|
if (parsedVersion === null || !entry.isDirectory()) {
|
|
92217
92301
|
await removeVersionDir(versionPath);
|
|
@@ -92259,7 +92343,7 @@ function parseVersionEntry(entryName) {
|
|
|
92259
92343
|
return LEGACY_VERSION_PATTERN.test(version) ? version : null;
|
|
92260
92344
|
}
|
|
92261
92345
|
async function readLegacyMetadata(input) {
|
|
92262
|
-
const pidText = await readRegularTrimmedFile(
|
|
92346
|
+
const pidText = await readRegularTrimmedFile(join46(input.versionPath, "daemon.pid"));
|
|
92263
92347
|
if (pidText === "non_regular")
|
|
92264
92348
|
return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
|
|
92265
92349
|
if (pidText === null)
|
|
@@ -92267,7 +92351,7 @@ async function readLegacyMetadata(input) {
|
|
|
92267
92351
|
const pid = Number.parseInt(pidText, 10);
|
|
92268
92352
|
if (!Number.isInteger(pid) || pid <= 0)
|
|
92269
92353
|
return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
|
|
92270
|
-
const endpointText = await readRegularTrimmedFile(
|
|
92354
|
+
const endpointText = await readRegularTrimmedFile(join46(input.versionPath, "daemon.endpoint"));
|
|
92271
92355
|
if (endpointText === "non_regular")
|
|
92272
92356
|
return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
|
|
92273
92357
|
if (endpointText === null)
|
|
@@ -92294,19 +92378,19 @@ function legacyEndpointCandidates(input) {
|
|
|
92294
92378
|
return [natural, hashed];
|
|
92295
92379
|
}
|
|
92296
92380
|
async function readRegularTrimmedFile(path) {
|
|
92297
|
-
const stats = await
|
|
92381
|
+
const stats = await lstat12(path).catch(() => null);
|
|
92298
92382
|
if (stats === null)
|
|
92299
92383
|
return null;
|
|
92300
92384
|
if (!stats.isFile())
|
|
92301
92385
|
return "non_regular";
|
|
92302
|
-
const content = (await
|
|
92386
|
+
const content = (await readFile20(path, "utf8")).trim();
|
|
92303
92387
|
return content.length > 0 ? content : null;
|
|
92304
92388
|
}
|
|
92305
92389
|
function shortDigest(value) {
|
|
92306
|
-
return
|
|
92390
|
+
return createHash4("sha256").update(value).digest("hex").slice(0, 16);
|
|
92307
92391
|
}
|
|
92308
92392
|
async function removeVersionDir(path) {
|
|
92309
|
-
await
|
|
92393
|
+
await rm11(path, { recursive: true, force: true });
|
|
92310
92394
|
}
|
|
92311
92395
|
function removed(version, reason) {
|
|
92312
92396
|
return { version, status: "removed", reason };
|
|
@@ -92346,7 +92430,7 @@ function processIsRunning(pid) {
|
|
|
92346
92430
|
|
|
92347
92431
|
// packages/omo-codex/src/install/codex-installer-bin-dir.ts
|
|
92348
92432
|
import { homedir as homedir5 } from "node:os";
|
|
92349
|
-
import { join as
|
|
92433
|
+
import { join as join47, resolve as resolve11 } from "node:path";
|
|
92350
92434
|
function resolveCodexInstallerBinDir(input) {
|
|
92351
92435
|
const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
|
|
92352
92436
|
if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
|
|
@@ -92355,16 +92439,16 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
92355
92439
|
const defaultCodexHome = resolve11(homeDir, ".codex");
|
|
92356
92440
|
const resolvedCodexHome = resolve11(input.codexHome);
|
|
92357
92441
|
if (resolvedCodexHome !== defaultCodexHome)
|
|
92358
|
-
return
|
|
92442
|
+
return join47(resolvedCodexHome, "bin");
|
|
92359
92443
|
return resolve11(homeDir, ".local", "bin");
|
|
92360
92444
|
}
|
|
92361
92445
|
|
|
92362
92446
|
// packages/omo-codex/src/install/codex-installed-bin-dir.ts
|
|
92363
|
-
import { readFile as
|
|
92364
|
-
import { join as
|
|
92447
|
+
import { readFile as readFile21, readdir as readdir11, writeFile as writeFile11 } from "node:fs/promises";
|
|
92448
|
+
import { join as join48 } from "node:path";
|
|
92365
92449
|
var INSTALLED_BIN_DIR_MANIFEST = ".installed-bin-dir.json";
|
|
92366
92450
|
async function writeInstalledCodexBinDir(input) {
|
|
92367
|
-
await writeFile11(
|
|
92451
|
+
await writeFile11(join48(input.pluginRoot, INSTALLED_BIN_DIR_MANIFEST), `${JSON.stringify({ binDir: input.binDir }, null, 2)}
|
|
92368
92452
|
`);
|
|
92369
92453
|
}
|
|
92370
92454
|
async function readInstalledCodexBinDir(codexHome) {
|
|
@@ -92377,20 +92461,20 @@ async function readInstalledCodexBinDir(codexHome) {
|
|
|
92377
92461
|
}
|
|
92378
92462
|
async function installedBinDirManifestPaths(codexHome) {
|
|
92379
92463
|
const paths = [
|
|
92380
|
-
|
|
92464
|
+
join48(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_BIN_DIR_MANIFEST)
|
|
92381
92465
|
];
|
|
92382
|
-
const versionRoot =
|
|
92466
|
+
const versionRoot = join48(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
|
|
92383
92467
|
const entries = await readdir11(versionRoot, { withFileTypes: true }).catch(() => null);
|
|
92384
92468
|
if (entries !== null) {
|
|
92385
92469
|
for (const entry of entries) {
|
|
92386
92470
|
if (entry.isDirectory())
|
|
92387
|
-
paths.push(
|
|
92471
|
+
paths.push(join48(versionRoot, entry.name, INSTALLED_BIN_DIR_MANIFEST));
|
|
92388
92472
|
}
|
|
92389
92473
|
}
|
|
92390
92474
|
return paths;
|
|
92391
92475
|
}
|
|
92392
92476
|
async function readBinDirFromManifest(manifestPath) {
|
|
92393
|
-
const raw = await
|
|
92477
|
+
const raw = await readFile21(manifestPath, "utf8").catch(() => null);
|
|
92394
92478
|
if (raw === null)
|
|
92395
92479
|
return null;
|
|
92396
92480
|
let parsed;
|
|
@@ -92408,8 +92492,8 @@ async function readBinDirFromManifest(manifestPath) {
|
|
|
92408
92492
|
}
|
|
92409
92493
|
|
|
92410
92494
|
// packages/omo-codex/src/install/codex-git-bash-hooks.ts
|
|
92411
|
-
import { readFile as
|
|
92412
|
-
import { join as
|
|
92495
|
+
import { readFile as readFile22, writeFile as writeFile12 } from "node:fs/promises";
|
|
92496
|
+
import { join as join49 } from "node:path";
|
|
92413
92497
|
var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
|
|
92414
92498
|
"./hooks/pre-tool-use-recommending-git-bash-mcp.json",
|
|
92415
92499
|
"./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
|
|
@@ -92417,8 +92501,8 @@ var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
|
|
|
92417
92501
|
async function removeGitBashHooksOffWindows(input) {
|
|
92418
92502
|
if (input.platform === "win32")
|
|
92419
92503
|
return;
|
|
92420
|
-
const manifestPath =
|
|
92421
|
-
const parsed = JSON.parse(await
|
|
92504
|
+
const manifestPath = join49(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
92505
|
+
const parsed = JSON.parse(await readFile22(manifestPath, "utf8"));
|
|
92422
92506
|
if (!isPlainRecord4(parsed) || !Array.isArray(parsed.hooks))
|
|
92423
92507
|
return;
|
|
92424
92508
|
const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
|
|
@@ -92430,7 +92514,7 @@ async function removeGitBashHooksOffWindows(input) {
|
|
|
92430
92514
|
|
|
92431
92515
|
// packages/omo-codex/src/install/install-ast-grep-sg.ts
|
|
92432
92516
|
init_src();
|
|
92433
|
-
import { join as
|
|
92517
|
+
import { join as join50 } from "node:path";
|
|
92434
92518
|
function describeResult(result) {
|
|
92435
92519
|
if (result.kind === "succeeded")
|
|
92436
92520
|
return null;
|
|
@@ -92444,7 +92528,7 @@ async function installAstGrepForCodex(options) {
|
|
|
92444
92528
|
return;
|
|
92445
92529
|
const platform = options.platform ?? process.platform;
|
|
92446
92530
|
const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
|
|
92447
|
-
const skillDir =
|
|
92531
|
+
const skillDir = join50(plugin.path, "skills", "ast-grep");
|
|
92448
92532
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
92449
92533
|
try {
|
|
92450
92534
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -92477,7 +92561,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
92477
92561
|
const env = options.env ?? process.env;
|
|
92478
92562
|
const platform = options.platform ?? process.platform;
|
|
92479
92563
|
const repoRoot = resolve12(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env }));
|
|
92480
|
-
const codexHome = resolve12(options.codexHome ?? env.CODEX_HOME ??
|
|
92564
|
+
const codexHome = resolve12(options.codexHome ?? env.CODEX_HOME ?? join53(homedir6(), ".codex"));
|
|
92481
92565
|
const projectDirectory = resolve12(options.projectDirectory ?? env.OMO_CODEX_PROJECT ?? process.cwd());
|
|
92482
92566
|
const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env });
|
|
92483
92567
|
const runCommand = options.runCommand ?? defaultRunCommand;
|
|
@@ -92494,9 +92578,9 @@ async function runCodexInstaller(options = {}) {
|
|
|
92494
92578
|
if (!gitBashResolution.found) {
|
|
92495
92579
|
throw new Error(gitBashResolution.installHint);
|
|
92496
92580
|
}
|
|
92497
|
-
const codexPackageRoot =
|
|
92581
|
+
const codexPackageRoot = join53(repoRoot, "packages", "omo-codex");
|
|
92498
92582
|
const marketplace = await readMarketplace(repoRoot, {
|
|
92499
|
-
marketplacePath:
|
|
92583
|
+
marketplacePath: join53(codexPackageRoot, "marketplace.json")
|
|
92500
92584
|
});
|
|
92501
92585
|
const distributionManifest = await readDistributionManifest(repoRoot);
|
|
92502
92586
|
const installed = [];
|
|
@@ -92542,7 +92626,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
92542
92626
|
if (runtimeLink !== null)
|
|
92543
92627
|
log(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
|
|
92544
92628
|
else
|
|
92545
|
-
log(`Warning: skipped the omo-agent-toolkit runtime wrapper because ${
|
|
92629
|
+
log(`Warning: skipped the omo-agent-toolkit runtime wrapper because ${join53(repoRoot, "dist", "cli", "index.js")} is missing; omo-agent-toolkit ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
|
|
92546
92630
|
}
|
|
92547
92631
|
pluginSources.push({ name: entry.name, sourcePath });
|
|
92548
92632
|
installed.push(plugin);
|
|
@@ -92562,6 +92646,9 @@ async function runCodexInstaller(options = {}) {
|
|
|
92562
92646
|
installed,
|
|
92563
92647
|
pluginSources
|
|
92564
92648
|
});
|
|
92649
|
+
const omoConfig = readDefaultRoleConfig({ cwd: projectDirectory, env });
|
|
92650
|
+
for (const warning of omoConfig.warnings)
|
|
92651
|
+
log(`Warning: ${warning}`);
|
|
92565
92652
|
for (const plugin of installed) {
|
|
92566
92653
|
const pluginRoot = agentSourceRoots.get(plugin.name) ?? plugin.path;
|
|
92567
92654
|
const agentLinks = await linkCachedPluginAgents({
|
|
@@ -92569,7 +92656,8 @@ async function runCodexInstaller(options = {}) {
|
|
|
92569
92656
|
pluginRoot,
|
|
92570
92657
|
platform,
|
|
92571
92658
|
preservedReasoning,
|
|
92572
|
-
preservedServiceTier
|
|
92659
|
+
preservedServiceTier,
|
|
92660
|
+
defaultRoleEnabled: omoConfig.enabled
|
|
92573
92661
|
});
|
|
92574
92662
|
for (const link of agentLinks) {
|
|
92575
92663
|
log(`Linked agent ${link.name} -> ${link.target}`);
|
|
@@ -92605,13 +92693,13 @@ async function runCodexInstaller(options = {}) {
|
|
|
92605
92693
|
continue;
|
|
92606
92694
|
log(`Warning: deferred legacy Codex LSP daemon cleanup for v${cleanup.version}: ${cleanup.reason}`);
|
|
92607
92695
|
}
|
|
92608
|
-
const marketplaceRoot =
|
|
92696
|
+
const marketplaceRoot = join53(codexHome, "plugins", "cache", marketplace.name);
|
|
92609
92697
|
await writeCachedMarketplaceManifest({
|
|
92610
92698
|
marketplaceName: marketplace.name,
|
|
92611
92699
|
marketplaceRoot,
|
|
92612
92700
|
plugins: installed
|
|
92613
92701
|
});
|
|
92614
|
-
const configPath =
|
|
92702
|
+
const configPath = join53(codexHome, "config.toml");
|
|
92615
92703
|
await updateCodexConfig({
|
|
92616
92704
|
configPath,
|
|
92617
92705
|
repoRoot: codexPackageRoot,
|
|
@@ -92670,7 +92758,7 @@ function findRepoRootFromImporter(importerDir) {
|
|
|
92670
92758
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
92671
92759
|
if (isRepoRootWithCodexPlugin(current))
|
|
92672
92760
|
return current;
|
|
92673
|
-
for (const wrapperPackageRoot of [
|
|
92761
|
+
for (const wrapperPackageRoot of [join53(current, "node_modules", "oh-my-openagent"), join53(current, "oh-my-openagent")]) {
|
|
92674
92762
|
if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
|
|
92675
92763
|
return wrapperPackageRoot;
|
|
92676
92764
|
}
|
|
@@ -92688,7 +92776,7 @@ function findRepoRoot(input) {
|
|
|
92688
92776
|
return findRepoRootFromImporter(input.importerDir);
|
|
92689
92777
|
}
|
|
92690
92778
|
function isRepoRootWithCodexPlugin(repoRoot) {
|
|
92691
|
-
return existsSync26(
|
|
92779
|
+
return existsSync26(join53(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
|
|
92692
92780
|
}
|
|
92693
92781
|
function codexMarketplaceSource(marketplaceRoot) {
|
|
92694
92782
|
return { sourceType: "local", source: marketplaceRoot };
|
|
@@ -92823,13 +92911,13 @@ function defaultRunCommand2(command, args) {
|
|
|
92823
92911
|
});
|
|
92824
92912
|
}
|
|
92825
92913
|
// packages/omo-codex/src/install/codex-cleanup.ts
|
|
92826
|
-
import { lstat as
|
|
92914
|
+
import { lstat as lstat15, readFile as readFile25, readdir as readdir13, rm as rm13, rmdir } from "node:fs/promises";
|
|
92827
92915
|
import { homedir as homedir8 } from "node:os";
|
|
92828
|
-
import { isAbsolute as isAbsolute11, join as
|
|
92916
|
+
import { isAbsolute as isAbsolute11, join as join56, relative as relative6, resolve as resolve15 } from "node:path";
|
|
92829
92917
|
|
|
92830
92918
|
// packages/omo-codex/src/install/codex-cleanup-bins.ts
|
|
92831
|
-
import { lstat as
|
|
92832
|
-
import { dirname as dirname18, isAbsolute as isAbsolute9, join as
|
|
92919
|
+
import { lstat as lstat13, readFile as readFile23, readdir as readdir12, readlink as readlink6, rm as rm12 } from "node:fs/promises";
|
|
92920
|
+
import { dirname as dirname18, isAbsolute as isAbsolute9, join as join54, resolve as resolve13 } from "node:path";
|
|
92833
92921
|
var ROOT_RUNTIME_BIN_NAME = "omo";
|
|
92834
92922
|
var MANAGED_CODEX_BIN_NAMES = new Set([
|
|
92835
92923
|
ROOT_RUNTIME_BIN_NAME,
|
|
@@ -92859,9 +92947,9 @@ async function removeManagedCodexBins(binDir, platform) {
|
|
|
92859
92947
|
const binName = managedBinNameForEntry2(entry.name, platform);
|
|
92860
92948
|
if (binName === null || !MANAGED_CODEX_BIN_NAMES.has(binName))
|
|
92861
92949
|
continue;
|
|
92862
|
-
const linkPath =
|
|
92950
|
+
const linkPath = join54(binDir, entry.name);
|
|
92863
92951
|
if (await isManagedCodexBin(linkPath, platform, binName)) {
|
|
92864
|
-
await
|
|
92952
|
+
await rm12(linkPath, { force: true });
|
|
92865
92953
|
removed.push(linkPath);
|
|
92866
92954
|
}
|
|
92867
92955
|
}
|
|
@@ -92874,7 +92962,7 @@ function managedBinNameForEntry2(entryName, platform) {
|
|
|
92874
92962
|
return normalizedEntryName.endsWith(".cmd") ? normalizedEntryName.slice(0, -".cmd".length) : null;
|
|
92875
92963
|
}
|
|
92876
92964
|
async function isManagedCodexBin(linkPath, platform, binName) {
|
|
92877
|
-
const entryStat = await
|
|
92965
|
+
const entryStat = await lstat13(linkPath).catch((error) => {
|
|
92878
92966
|
if (isNodeErrorWithCode(error) && error.code === "ENOENT")
|
|
92879
92967
|
return null;
|
|
92880
92968
|
throw error;
|
|
@@ -92890,12 +92978,12 @@ async function isManagedCodexBin(linkPath, platform, binName) {
|
|
|
92890
92978
|
}
|
|
92891
92979
|
if (!entryStat.isFile())
|
|
92892
92980
|
return false;
|
|
92893
|
-
const content = await
|
|
92981
|
+
const content = await readFile23(linkPath, "utf8");
|
|
92894
92982
|
return content.includes(RUNTIME_WRAPPER_MARKER) || content.includes(COMMAND_SHIM_MARKER);
|
|
92895
92983
|
}
|
|
92896
92984
|
|
|
92897
92985
|
// packages/omo-codex/src/install/codex-cleanup-config.ts
|
|
92898
|
-
import { lstat as
|
|
92986
|
+
import { lstat as lstat14, mkdir as mkdir8, readFile as readFile24, writeFile as writeFile13 } from "node:fs/promises";
|
|
92899
92987
|
import { dirname as dirname19 } from "node:path";
|
|
92900
92988
|
var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
|
|
92901
92989
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
|
|
@@ -92928,7 +93016,7 @@ function cleanupCodexLightConfigText(config) {
|
|
|
92928
93016
|
async function cleanupCodexConfig(configPath, now) {
|
|
92929
93017
|
if (!await configExists(configPath))
|
|
92930
93018
|
return { changed: false };
|
|
92931
|
-
const original = await
|
|
93019
|
+
const original = await readFile24(configPath, "utf8");
|
|
92932
93020
|
const next = cleanupCodexLightConfigText(original);
|
|
92933
93021
|
if (next === original)
|
|
92934
93022
|
return { changed: false };
|
|
@@ -92997,7 +93085,7 @@ function formatBackupTimestamp2(date) {
|
|
|
92997
93085
|
}
|
|
92998
93086
|
async function configExists(path) {
|
|
92999
93087
|
try {
|
|
93000
|
-
await
|
|
93088
|
+
await lstat14(path);
|
|
93001
93089
|
return true;
|
|
93002
93090
|
} catch (error) {
|
|
93003
93091
|
if (nodeErrorCode5(error) === "ENOENT")
|
|
@@ -93012,7 +93100,7 @@ function nodeErrorCode5(error) {
|
|
|
93012
93100
|
}
|
|
93013
93101
|
|
|
93014
93102
|
// packages/omo-codex/src/install/codex-cleanup-safety.ts
|
|
93015
|
-
import { dirname as dirname20, isAbsolute as isAbsolute10, join as
|
|
93103
|
+
import { dirname as dirname20, isAbsolute as isAbsolute10, join as join55, relative as relative5, resolve as resolve14 } from "node:path";
|
|
93016
93104
|
function codexHomeResolvesToFilesystemRoot(codexHome) {
|
|
93017
93105
|
const resolved = resolve14(codexHome);
|
|
93018
93106
|
return dirname20(resolved) === resolved;
|
|
@@ -93029,11 +93117,11 @@ function validateManagedCleanupTarget(input) {
|
|
|
93029
93117
|
if (target === codexHome)
|
|
93030
93118
|
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
93031
93119
|
const exactManagedRoots = new Set([
|
|
93032
|
-
resolve14(
|
|
93033
|
-
resolve14(
|
|
93034
|
-
resolve14(
|
|
93035
|
-
resolve14(
|
|
93036
|
-
resolve14(
|
|
93120
|
+
resolve14(join55(codexHome, "plugins", "cache", "sisyphuslabs")),
|
|
93121
|
+
resolve14(join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
|
|
93122
|
+
resolve14(join55(codexHome, "runtime", "ast-grep")),
|
|
93123
|
+
resolve14(join55(codexHome, "runtime", "node")),
|
|
93124
|
+
resolve14(join55(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
|
|
93037
93125
|
]);
|
|
93038
93126
|
if (exactManagedRoots.has(target))
|
|
93039
93127
|
return null;
|
|
@@ -93063,8 +93151,8 @@ function skipped(path, reason) {
|
|
|
93063
93151
|
var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
|
|
93064
93152
|
async function cleanupCodexLight(input = {}) {
|
|
93065
93153
|
const env = input.env ?? process.env;
|
|
93066
|
-
const codexHome = resolve15(input.codexHome ?? env.CODEX_HOME ??
|
|
93067
|
-
const configPath =
|
|
93154
|
+
const codexHome = resolve15(input.codexHome ?? env.CODEX_HOME ?? join56(homedir8(), ".codex"));
|
|
93155
|
+
const configPath = join56(codexHome, "config.toml");
|
|
93068
93156
|
const installedBinDir = await readInstalledCodexBinDir(codexHome);
|
|
93069
93157
|
const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
|
|
93070
93158
|
const configCleanup = await cleanupCodexConfig(configPath, input.now);
|
|
@@ -93118,17 +93206,17 @@ function firstConfiguredPath(...values) {
|
|
|
93118
93206
|
}
|
|
93119
93207
|
function managedGlobalStatePaths(codexHome) {
|
|
93120
93208
|
return [
|
|
93121
|
-
|
|
93122
|
-
|
|
93123
|
-
|
|
93124
|
-
|
|
93125
|
-
|
|
93209
|
+
join56(codexHome, "plugins", "cache", "sisyphuslabs"),
|
|
93210
|
+
join56(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
|
|
93211
|
+
join56(codexHome, "runtime", "ast-grep"),
|
|
93212
|
+
join56(codexHome, "runtime", "node"),
|
|
93213
|
+
join56(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
|
|
93126
93214
|
];
|
|
93127
93215
|
}
|
|
93128
93216
|
var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
|
|
93129
93217
|
async function collectBootstrapDataDirsByGlob(codexHome) {
|
|
93130
93218
|
const results = [];
|
|
93131
|
-
await walkForManagedBootstrapDirs(
|
|
93219
|
+
await walkForManagedBootstrapDirs(join56(codexHome, "plugins"), 0, results);
|
|
93132
93220
|
return results;
|
|
93133
93221
|
}
|
|
93134
93222
|
async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
@@ -93140,9 +93228,9 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
|
93140
93228
|
for (const entry of entries) {
|
|
93141
93229
|
if (!entry.isDirectory())
|
|
93142
93230
|
continue;
|
|
93143
|
-
const childPath =
|
|
93231
|
+
const childPath = join56(directory, entry.name);
|
|
93144
93232
|
if (isManagedBootstrapOwnerName(entry.name)) {
|
|
93145
|
-
const bootstrapDir =
|
|
93233
|
+
const bootstrapDir = join56(childPath, "bootstrap");
|
|
93146
93234
|
if (await exists6(bootstrapDir))
|
|
93147
93235
|
results.push(bootstrapDir);
|
|
93148
93236
|
continue;
|
|
@@ -93166,9 +93254,9 @@ async function removeManagedPathBestEffort(path, seams) {
|
|
|
93166
93254
|
}
|
|
93167
93255
|
async function attemptRemove(path) {
|
|
93168
93256
|
try {
|
|
93169
|
-
if (await
|
|
93257
|
+
if (await lstat15(path).catch(() => null) === null)
|
|
93170
93258
|
return false;
|
|
93171
|
-
await
|
|
93259
|
+
await rm13(path, { recursive: true, force: true });
|
|
93172
93260
|
return true;
|
|
93173
93261
|
} catch {
|
|
93174
93262
|
return false;
|
|
@@ -93176,7 +93264,7 @@ async function attemptRemove(path) {
|
|
|
93176
93264
|
}
|
|
93177
93265
|
async function pruneEmptyRuntimeDirBestEffort(codexHome) {
|
|
93178
93266
|
try {
|
|
93179
|
-
await rmdir(
|
|
93267
|
+
await rmdir(join56(codexHome, "runtime"));
|
|
93180
93268
|
} catch (error) {
|
|
93181
93269
|
if (isExpectedRuntimePruneFailure(error))
|
|
93182
93270
|
return;
|
|
@@ -93188,14 +93276,14 @@ function isExpectedRuntimePruneFailure(error) {
|
|
|
93188
93276
|
}
|
|
93189
93277
|
async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
93190
93278
|
const manifestPaths = [
|
|
93191
|
-
|
|
93279
|
+
join56(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
|
|
93192
93280
|
];
|
|
93193
|
-
const versionRoot =
|
|
93281
|
+
const versionRoot = join56(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
|
|
93194
93282
|
if (await exists6(versionRoot)) {
|
|
93195
93283
|
const entries = await readdir13(versionRoot, { withFileTypes: true });
|
|
93196
93284
|
for (const entry of entries) {
|
|
93197
93285
|
if (entry.isDirectory())
|
|
93198
|
-
manifestPaths.push(
|
|
93286
|
+
manifestPaths.push(join56(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
|
|
93199
93287
|
}
|
|
93200
93288
|
}
|
|
93201
93289
|
const paths = new Set;
|
|
@@ -93212,19 +93300,19 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
|
93212
93300
|
async function readManagedAgentPathsFromConfig(codexHome, configPath) {
|
|
93213
93301
|
if (!await exists6(configPath))
|
|
93214
93302
|
return [];
|
|
93215
|
-
const config = await
|
|
93216
|
-
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) =>
|
|
93303
|
+
const config = await readFile25(configPath, "utf8");
|
|
93304
|
+
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join56(codexHome, "agents", `${agentName}.toml`));
|
|
93217
93305
|
}
|
|
93218
93306
|
async function readInstalledAgentManifest(manifestPath) {
|
|
93219
93307
|
if (!await exists6(manifestPath))
|
|
93220
93308
|
return [];
|
|
93221
|
-
const parsed = JSON.parse(await
|
|
93309
|
+
const parsed = JSON.parse(await readFile25(manifestPath, "utf8"));
|
|
93222
93310
|
if (!isPlainRecord4(parsed) || !Array.isArray(parsed.agents))
|
|
93223
93311
|
return [];
|
|
93224
93312
|
return parsed.agents.filter((path) => typeof path === "string");
|
|
93225
93313
|
}
|
|
93226
93314
|
async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
93227
|
-
const agentsDir =
|
|
93315
|
+
const agentsDir = join56(codexHome, "agents");
|
|
93228
93316
|
const removed = [];
|
|
93229
93317
|
const skipped = [];
|
|
93230
93318
|
for (const path of paths) {
|
|
@@ -93239,7 +93327,7 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
|
93239
93327
|
skipped.push(path);
|
|
93240
93328
|
continue;
|
|
93241
93329
|
}
|
|
93242
|
-
await
|
|
93330
|
+
await rm13(path, { force: true });
|
|
93243
93331
|
removed.push(path);
|
|
93244
93332
|
}
|
|
93245
93333
|
return { removed, skipped };
|
|
@@ -93260,7 +93348,7 @@ async function exists6(path) {
|
|
|
93260
93348
|
}
|
|
93261
93349
|
async function maybeLstat2(path) {
|
|
93262
93350
|
try {
|
|
93263
|
-
return await
|
|
93351
|
+
return await lstat15(path);
|
|
93264
93352
|
} catch (error) {
|
|
93265
93353
|
if (nodeErrorCode6(error) === "ENOENT")
|
|
93266
93354
|
return null;
|
|
@@ -93276,14 +93364,14 @@ function nodeErrorCode6(error) {
|
|
|
93276
93364
|
import { execFile as execFile3 } from "node:child_process";
|
|
93277
93365
|
import { existsSync as existsSync30 } from "node:fs";
|
|
93278
93366
|
import { homedir as homedir11 } from "node:os";
|
|
93279
|
-
import { dirname as dirname24, join as
|
|
93367
|
+
import { dirname as dirname24, join as join61, resolve as resolve19 } from "node:path";
|
|
93280
93368
|
import { fileURLToPath } from "node:url";
|
|
93281
93369
|
import { promisify as promisify2 } from "node:util";
|
|
93282
93370
|
|
|
93283
93371
|
// packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
|
|
93284
93372
|
import { existsSync as existsSync28 } from "node:fs";
|
|
93285
93373
|
import { homedir as homedir9 } from "node:os";
|
|
93286
|
-
import { join as
|
|
93374
|
+
import { join as join57, resolve as resolve16 } from "node:path";
|
|
93287
93375
|
var AGENT_DIR_ENV_NAMES = [
|
|
93288
93376
|
"OMO_CODING_AGENT_DIR",
|
|
93289
93377
|
"SENPI_CODING_AGENT_DIR",
|
|
@@ -93297,25 +93385,25 @@ function resolveAgentHome(options) {
|
|
|
93297
93385
|
if (configured)
|
|
93298
93386
|
return resolve16(configured);
|
|
93299
93387
|
}
|
|
93300
|
-
const brandedHome =
|
|
93301
|
-
const canonical =
|
|
93302
|
-
if (exists(
|
|
93388
|
+
const brandedHome = join57(homeDir, ".omo");
|
|
93389
|
+
const canonical = join57(brandedHome, "agent");
|
|
93390
|
+
if (exists(join57(canonical, AGENT_HOME_SENTINEL)))
|
|
93303
93391
|
return canonical;
|
|
93304
|
-
if (exists(
|
|
93392
|
+
if (exists(join57(brandedHome, AGENT_HOME_SENTINEL)))
|
|
93305
93393
|
return brandedHome;
|
|
93306
|
-
return
|
|
93394
|
+
return join57(homeDir, ".senpi", "agent");
|
|
93307
93395
|
}
|
|
93308
93396
|
|
|
93309
93397
|
// packages/omo-senpi/src/install/local-launcher.ts
|
|
93310
93398
|
import { chmodSync as chmodSync3, existsSync as existsSync29, mkdirSync as mkdirSync10, readFileSync as readFileSync13, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
|
|
93311
93399
|
import { homedir as homedir10 } from "node:os";
|
|
93312
|
-
import { dirname as dirname21, join as
|
|
93400
|
+
import { dirname as dirname21, join as join58, resolve as resolve17 } from "node:path";
|
|
93313
93401
|
var MARKER = "omo-local-launcher";
|
|
93314
93402
|
function localLauncherPath(homeDir = homedir10()) {
|
|
93315
|
-
return
|
|
93403
|
+
return join58(homeDir, ".local", "bin", "omo");
|
|
93316
93404
|
}
|
|
93317
93405
|
function localLauncherCmdPath(homeDir = homedir10()) {
|
|
93318
|
-
return
|
|
93406
|
+
return join58(homeDir, ".local", "bin", "omo.cmd");
|
|
93319
93407
|
}
|
|
93320
93408
|
function renderLocalLauncher(options) {
|
|
93321
93409
|
const brand = {
|
|
@@ -93328,7 +93416,7 @@ function renderLocalLauncher(options) {
|
|
|
93328
93416
|
userAgent: "omo",
|
|
93329
93417
|
originator: "omo",
|
|
93330
93418
|
changelog: {
|
|
93331
|
-
path:
|
|
93419
|
+
path: join58(options.pluginPath, "CHANGELOG.md").replaceAll("\\", "/")
|
|
93332
93420
|
},
|
|
93333
93421
|
update: {
|
|
93334
93422
|
packageName: "omo-ai",
|
|
@@ -93395,10 +93483,10 @@ node "%~dp0omo" %*\r
|
|
|
93395
93483
|
}
|
|
93396
93484
|
|
|
93397
93485
|
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
93398
|
-
import { createHash as
|
|
93486
|
+
import { createHash as createHash6 } from "node:crypto";
|
|
93399
93487
|
import { constants as constants9 } from "node:fs";
|
|
93400
|
-
import { access as access2, readFile as
|
|
93401
|
-
import { dirname as dirname23, join as
|
|
93488
|
+
import { access as access2, readFile as readFile27, stat as stat6 } from "node:fs/promises";
|
|
93489
|
+
import { dirname as dirname23, join as join60 } from "node:path";
|
|
93402
93490
|
|
|
93403
93491
|
// packages/memory-core/src/personas/manifest.ts
|
|
93404
93492
|
var PERSONA_ASSET_FILENAMES = {
|
|
@@ -93416,18 +93504,18 @@ var PERSONA_ASSET_FILES = [
|
|
|
93416
93504
|
|
|
93417
93505
|
// packages/omo-senpi/src/install/senpi-settings.ts
|
|
93418
93506
|
import { constants as constants8 } from "node:fs";
|
|
93419
|
-
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as
|
|
93420
|
-
import { basename as basename9, dirname as dirname22, join as
|
|
93507
|
+
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile26, rename as rename5, writeFile as writeFile14 } from "node:fs/promises";
|
|
93508
|
+
import { basename as basename9, dirname as dirname22, join as join59, resolve as resolve18 } from "node:path";
|
|
93421
93509
|
var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
|
|
93422
93510
|
var GENERATED_PLUGIN_BASENAME = /^omo-senpi-cli-plugin-[A-Za-z0-9]{6}$/;
|
|
93423
93511
|
var LEGACY_BUILTIN_SHADOW_PACKAGES = [
|
|
93424
|
-
|
|
93425
|
-
|
|
93512
|
+
join59("packages", "pi-goal"),
|
|
93513
|
+
join59("packages", "pi-webfetch")
|
|
93426
93514
|
];
|
|
93427
93515
|
async function readSettings(settingsPath) {
|
|
93428
93516
|
let raw;
|
|
93429
93517
|
try {
|
|
93430
|
-
raw = await
|
|
93518
|
+
raw = await readFile26(settingsPath, "utf8");
|
|
93431
93519
|
} catch (error) {
|
|
93432
93520
|
if (isErrno(error, "ENOENT"))
|
|
93433
93521
|
return {};
|
|
@@ -93501,7 +93589,7 @@ function isRecord13(value) {
|
|
|
93501
93589
|
async function readPackageName(packagePath) {
|
|
93502
93590
|
let raw;
|
|
93503
93591
|
try {
|
|
93504
|
-
raw = await
|
|
93592
|
+
raw = await readFile26(join59(packagePath, "package.json"), "utf8");
|
|
93505
93593
|
} catch (error) {
|
|
93506
93594
|
if (isErrno(error, "ENOENT") || isErrno(error, "ENOTDIR"))
|
|
93507
93595
|
return;
|
|
@@ -93533,50 +93621,50 @@ function isErrno(error, code) {
|
|
|
93533
93621
|
|
|
93534
93622
|
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
93535
93623
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
93536
|
-
|
|
93537
|
-
|
|
93538
|
-
|
|
93539
|
-
|
|
93540
|
-
|
|
93541
|
-
|
|
93542
|
-
|
|
93543
|
-
|
|
93544
|
-
|
|
93545
|
-
|
|
93546
|
-
|
|
93547
|
-
|
|
93548
|
-
|
|
93549
|
-
|
|
93550
|
-
|
|
93551
|
-
|
|
93552
|
-
|
|
93553
|
-
|
|
93554
|
-
|
|
93555
|
-
|
|
93556
|
-
|
|
93557
|
-
|
|
93558
|
-
|
|
93559
|
-
|
|
93560
|
-
|
|
93561
|
-
|
|
93562
|
-
|
|
93563
|
-
|
|
93564
|
-
|
|
93565
|
-
|
|
93566
|
-
|
|
93567
|
-
|
|
93568
|
-
|
|
93569
|
-
|
|
93624
|
+
join60("extensions", "omo.js"),
|
|
93625
|
+
join60("extensions", "omo-task.js"),
|
|
93626
|
+
join60("extensions", "omo-member.js"),
|
|
93627
|
+
join60("extensions", "memory-run-supervisor.mjs"),
|
|
93628
|
+
...PERSONA_ASSET_FILES.map((filename) => join60("extensions", filename)),
|
|
93629
|
+
join60("skills", "ast-grep", "SKILL.md"),
|
|
93630
|
+
join60("skills", "coding-agent-sessions", "SKILL.md"),
|
|
93631
|
+
join60("skills", "debugging", "SKILL.md"),
|
|
93632
|
+
join60("skills", "frontend", "SKILL.md"),
|
|
93633
|
+
join60("skills", "git-master", "SKILL.md"),
|
|
93634
|
+
join60("skills", "init-deep", "SKILL.md"),
|
|
93635
|
+
join60("skills", "lsp-setup", "SKILL.md"),
|
|
93636
|
+
join60("skills", "programming", "SKILL.md"),
|
|
93637
|
+
join60("skills", "refactor", "SKILL.md"),
|
|
93638
|
+
join60("skills", "remove-ai-slops", "SKILL.md"),
|
|
93639
|
+
join60("skills", "review-work", "SKILL.md"),
|
|
93640
|
+
join60("skills", "ultimate-browsing", "SKILL.md"),
|
|
93641
|
+
join60("skills", "ultrawork", "SKILL.md"),
|
|
93642
|
+
join60("skills", "ulw-execute", "SKILL.md"),
|
|
93643
|
+
join60("skills", "ulw-loop", "SKILL.md"),
|
|
93644
|
+
join60("skills", "ulw-plan", "SKILL.md"),
|
|
93645
|
+
join60("skills", "ulw-research", "SKILL.md"),
|
|
93646
|
+
join60("skills", "visual-qa", "SKILL.md"),
|
|
93647
|
+
join60("skills-conditional", "x-search", "SKILL.md"),
|
|
93648
|
+
join60("runtime", "agent-toolkit-sdk", "sdk.js"),
|
|
93649
|
+
join60("runtime", "ast-grep-mcp", "cli.js"),
|
|
93650
|
+
join60("runtime", "lsp-daemon", "dist", "cli.js"),
|
|
93651
|
+
join60("runtime", "lsp-daemon", "dist", "index.js"),
|
|
93652
|
+
join60("runtime", "lsp-daemon", "dist", "index.d.ts"),
|
|
93653
|
+
join60("runtime", "lsp-daemon", "dist", "daemon-client.js"),
|
|
93654
|
+
join60("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
|
|
93655
|
+
join60("runtime", "lsp-daemon", "dist", "package.json"),
|
|
93656
|
+
join60("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
93657
|
+
join60("scripts", "install.mjs")
|
|
93570
93658
|
];
|
|
93571
93659
|
async function ensurePluginArtifacts(context) {
|
|
93572
93660
|
if (context.allowBuild) {
|
|
93573
|
-
await context.runCommand("node", [
|
|
93574
|
-
await context.runCommand("node", [
|
|
93575
|
-
await context.runCommand("node", [
|
|
93576
|
-
await context.runCommand("node", [
|
|
93577
|
-
await context.runCommand("node", [
|
|
93578
|
-
await context.runCommand("node", [
|
|
93579
|
-
await context.runCommand("node", [
|
|
93661
|
+
await context.runCommand("node", [join60(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
93662
|
+
await context.runCommand("node", [join60("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
|
|
93663
|
+
await context.runCommand("node", [join60(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
93664
|
+
await context.runCommand("node", [join60(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
|
|
93665
|
+
await context.runCommand("node", [join60(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
|
|
93666
|
+
await context.runCommand("node", [join60(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
|
|
93667
|
+
await context.runCommand("node", [join60(context.pluginPath, "scripts", "stage-x-search-skill.mjs")], { cwd: context.repoRoot });
|
|
93580
93668
|
}
|
|
93581
93669
|
if (await hasMissingPluginArtifact(context.pluginPath)) {
|
|
93582
93670
|
throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
|
|
@@ -93585,14 +93673,14 @@ async function ensurePluginArtifacts(context) {
|
|
|
93585
93673
|
}
|
|
93586
93674
|
async function hasMissingPluginArtifact(pluginPath) {
|
|
93587
93675
|
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
93588
|
-
if (!await fileExists2(
|
|
93676
|
+
if (!await fileExists2(join60(pluginPath, artifact)))
|
|
93589
93677
|
return true;
|
|
93590
93678
|
}
|
|
93591
93679
|
return false;
|
|
93592
93680
|
}
|
|
93593
93681
|
async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
|
|
93594
|
-
const runtimeEntry =
|
|
93595
|
-
const manifestPath =
|
|
93682
|
+
const runtimeEntry = join60(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
|
|
93683
|
+
const manifestPath = join60(dirname23(runtimeEntry), "manifest.json");
|
|
93596
93684
|
let runtimeStat;
|
|
93597
93685
|
try {
|
|
93598
93686
|
runtimeStat = await stat6(runtimeEntry);
|
|
@@ -93607,7 +93695,7 @@ async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
|
|
|
93607
93695
|
}
|
|
93608
93696
|
let manifest;
|
|
93609
93697
|
try {
|
|
93610
|
-
manifest = JSON.parse(await
|
|
93698
|
+
manifest = JSON.parse(await readFile27(manifestPath, "utf8"));
|
|
93611
93699
|
} catch (error) {
|
|
93612
93700
|
throw astGrepIntegrityError(runtimeEntry, `manifest is unreadable or invalid JSON: ${messageOf(error)}`);
|
|
93613
93701
|
}
|
|
@@ -93616,7 +93704,7 @@ async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
|
|
|
93616
93704
|
}
|
|
93617
93705
|
let actualSha256;
|
|
93618
93706
|
try {
|
|
93619
|
-
actualSha256 =
|
|
93707
|
+
actualSha256 = createHash6("sha256").update(await readFile27(runtimeEntry)).digest("hex");
|
|
93620
93708
|
} catch (error) {
|
|
93621
93709
|
throw astGrepIntegrityError(runtimeEntry, `runtime hash could not be computed: ${messageOf(error)}`);
|
|
93622
93710
|
}
|
|
@@ -93667,7 +93755,7 @@ async function runSenpiInstaller(options = {}) {
|
|
|
93667
93755
|
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
93668
93756
|
const launcherPath = installLocalLauncher({
|
|
93669
93757
|
pluginPath: context.pluginPath,
|
|
93670
|
-
senpiCliPath:
|
|
93758
|
+
senpiCliPath: join61(context.repoRoot, "packages", "coding-agent", "dist", "cli.js"),
|
|
93671
93759
|
homeDir: context.homeDir
|
|
93672
93760
|
});
|
|
93673
93761
|
return {
|
|
@@ -93687,13 +93775,13 @@ function resolveInstallContext(options) {
|
|
|
93687
93775
|
const repoRoot = resolve19(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve19(options.pluginPath))));
|
|
93688
93776
|
const homeDir = options.homeDir ?? env.HOME ?? homedir11();
|
|
93689
93777
|
const agentDir = resolve19(options.agentDir ?? resolveAgentHome({ env, homeDir }));
|
|
93690
|
-
const pluginPath = resolve19(options.pluginPath ??
|
|
93778
|
+
const pluginPath = resolve19(options.pluginPath ?? join61(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
93691
93779
|
return {
|
|
93692
93780
|
env,
|
|
93693
93781
|
repoRoot,
|
|
93694
93782
|
agentDir,
|
|
93695
93783
|
homeDir,
|
|
93696
|
-
settingsPath:
|
|
93784
|
+
settingsPath: join61(agentDir, "settings.json"),
|
|
93697
93785
|
pluginPath,
|
|
93698
93786
|
platform: options.platform ?? process.platform,
|
|
93699
93787
|
allowBuild,
|
|
@@ -93710,7 +93798,7 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
93710
93798
|
function findRepoRoot2(importerDir) {
|
|
93711
93799
|
let current = importerDir;
|
|
93712
93800
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
93713
|
-
if (fileExistsSync(
|
|
93801
|
+
if (fileExistsSync(join61(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
93714
93802
|
return current;
|
|
93715
93803
|
current = resolve19(current, "..");
|
|
93716
93804
|
}
|
|
@@ -93754,19 +93842,19 @@ init_provider_availability();
|
|
|
93754
93842
|
|
|
93755
93843
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
93756
93844
|
import { existsSync as existsSync32, mkdirSync as mkdirSync11, readFileSync as readFileSync15 } from "node:fs";
|
|
93757
|
-
import { join as
|
|
93845
|
+
import { join as join63 } from "node:path";
|
|
93758
93846
|
|
|
93759
93847
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
93760
93848
|
init_shared();
|
|
93761
93849
|
import { existsSync as existsSync31, readFileSync as readFileSync14 } from "node:fs";
|
|
93762
|
-
import { join as
|
|
93850
|
+
import { join as join62 } from "node:path";
|
|
93763
93851
|
var TUI_SUBPATH = "tui";
|
|
93764
93852
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
93765
93853
|
function fileEntryPackageJsonPath(entry) {
|
|
93766
93854
|
let path = entry.slice("file:".length);
|
|
93767
93855
|
if (path.startsWith("//"))
|
|
93768
93856
|
path = path.slice(2);
|
|
93769
|
-
return
|
|
93857
|
+
return join62(path, "package.json");
|
|
93770
93858
|
}
|
|
93771
93859
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
93772
93860
|
if (!existsSync31(pkgJsonPath))
|
|
@@ -93804,7 +93892,7 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
93804
93892
|
const packageName = packageNameFromServerEntry(entry);
|
|
93805
93893
|
if (packageName === null)
|
|
93806
93894
|
return null;
|
|
93807
|
-
return packageJsonExportsTui(
|
|
93895
|
+
return packageJsonExportsTui(join62(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
93808
93896
|
}
|
|
93809
93897
|
function isOurFilePluginEntry(entry) {
|
|
93810
93898
|
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
@@ -93869,7 +93957,7 @@ function detectServerPluginRegistration() {
|
|
|
93869
93957
|
}
|
|
93870
93958
|
}
|
|
93871
93959
|
function detectTuiPluginRegistration() {
|
|
93872
|
-
const tuiJsonPath =
|
|
93960
|
+
const tuiJsonPath = join62(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
93873
93961
|
if (!existsSync31(tuiJsonPath)) {
|
|
93874
93962
|
return {
|
|
93875
93963
|
registered: false,
|
|
@@ -94025,10 +94113,10 @@ function readConfig(path) {
|
|
|
94025
94113
|
return null;
|
|
94026
94114
|
}
|
|
94027
94115
|
function readServerConfig(configDir) {
|
|
94028
|
-
const jsoncPath =
|
|
94116
|
+
const jsoncPath = join63(configDir, "opencode.jsonc");
|
|
94029
94117
|
if (existsSync32(jsoncPath))
|
|
94030
94118
|
return readConfig(jsoncPath);
|
|
94031
|
-
const jsonPath =
|
|
94119
|
+
const jsonPath = join63(configDir, "opencode.json");
|
|
94032
94120
|
if (existsSync32(jsonPath))
|
|
94033
94121
|
return readConfig(jsonPath);
|
|
94034
94122
|
return null;
|
|
@@ -94070,7 +94158,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
94070
94158
|
if (!desiredEntry) {
|
|
94071
94159
|
return { changed: false, reason: "no-server-entry" };
|
|
94072
94160
|
}
|
|
94073
|
-
const tuiJsonPath =
|
|
94161
|
+
const tuiJsonPath = join63(configDir, "tui.json");
|
|
94074
94162
|
const { config, malformed } = readTuiConfig(tuiJsonPath);
|
|
94075
94163
|
if (malformed) {
|
|
94076
94164
|
return { changed: false, reason: "malformed" };
|
|
@@ -94086,7 +94174,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
94086
94174
|
|
|
94087
94175
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
94088
94176
|
import { homedir as homedir12 } from "node:os";
|
|
94089
|
-
import { join as
|
|
94177
|
+
import { join as join64 } from "node:path";
|
|
94090
94178
|
|
|
94091
94179
|
// packages/shared-skills/index.mjs
|
|
94092
94180
|
import { existsSync as existsSync33 } from "node:fs";
|
|
@@ -94108,9 +94196,9 @@ function describeResult2(result) {
|
|
|
94108
94196
|
}
|
|
94109
94197
|
async function installAstGrepForOpenCode(options = {}) {
|
|
94110
94198
|
const platform = options.platform ?? process.platform;
|
|
94111
|
-
const baseDir =
|
|
94199
|
+
const baseDir = join64(options.homeDir ?? homedir12(), ".omo");
|
|
94112
94200
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
94113
|
-
const skillDir =
|
|
94201
|
+
const skillDir = join64(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
94114
94202
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
94115
94203
|
try {
|
|
94116
94204
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -96890,7 +96978,6 @@ var BuiltinAgentNameSchema = _enum([
|
|
|
96890
96978
|
]);
|
|
96891
96979
|
var BuiltinSkillNameSchema = _enum([
|
|
96892
96980
|
"playwright",
|
|
96893
|
-
"agent-browser",
|
|
96894
96981
|
"dev-browser",
|
|
96895
96982
|
"frontend",
|
|
96896
96983
|
"git-master",
|
|
@@ -97053,10 +97140,11 @@ var BackgroundTaskConfigSchema = object({
|
|
|
97053
97140
|
init_zod();
|
|
97054
97141
|
var BrowserAutomationProviderSchema = _enum([
|
|
97055
97142
|
"playwright",
|
|
97056
|
-
"agent-browser",
|
|
97057
97143
|
"dev-browser",
|
|
97058
97144
|
"playwright-cli"
|
|
97059
|
-
]
|
|
97145
|
+
], {
|
|
97146
|
+
error: (issue) => `Browser provider ${JSON.stringify(issue.input)} is no longer supported; use the built-in browser path: Bun.WebView / playwright-core scripts`
|
|
97147
|
+
});
|
|
97060
97148
|
var BrowserAutomationConfigSchema = object({
|
|
97061
97149
|
provider: BrowserAutomationProviderSchema.default("playwright"),
|
|
97062
97150
|
playwright_mcp_args: array(string2()).optional()
|
|
@@ -98331,9 +98419,9 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
98331
98419
|
}
|
|
98332
98420
|
// packages/boulder-state/src/storage/path.ts
|
|
98333
98421
|
import { existsSync as existsSync35 } from "node:fs";
|
|
98334
|
-
import { isAbsolute as isAbsolute12, join as
|
|
98422
|
+
import { isAbsolute as isAbsolute12, join as join65, relative as relative8, resolve as resolve20 } from "node:path";
|
|
98335
98423
|
function getBoulderFilePath(directory) {
|
|
98336
|
-
return
|
|
98424
|
+
return join65(directory, BOULDER_DIR, BOULDER_FILE);
|
|
98337
98425
|
}
|
|
98338
98426
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
98339
98427
|
return isAbsolute12(trackedPath) ? resolve20(trackedPath) : resolve20(baseDirectory, trackedPath);
|
|
@@ -98516,9 +98604,9 @@ init_state();
|
|
|
98516
98604
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
98517
98605
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
98518
98606
|
import { existsSync as existsSync38, mkdirSync as mkdirSync12, readFileSync as readFileSync19, rmSync as rmSync3, writeFileSync as writeFileSync7 } from "node:fs";
|
|
98519
|
-
import { join as
|
|
98607
|
+
import { join as join66 } from "node:path";
|
|
98520
98608
|
function getMarkerPath(directory, sessionID) {
|
|
98521
|
-
return
|
|
98609
|
+
return join66(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
98522
98610
|
}
|
|
98523
98611
|
function readContinuationMarker(directory, sessionID) {
|
|
98524
98612
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
@@ -98591,7 +98679,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
98591
98679
|
init_shared();
|
|
98592
98680
|
init_compaction_marker();
|
|
98593
98681
|
import { readFileSync as readFileSync20, readdirSync as readdirSync8 } from "node:fs";
|
|
98594
|
-
import { join as
|
|
98682
|
+
import { join as join67 } from "node:path";
|
|
98595
98683
|
var defaultSessionLastAgentDeps = {
|
|
98596
98684
|
getMessageDir,
|
|
98597
98685
|
isSqliteBackend,
|
|
@@ -98651,7 +98739,7 @@ async function getLastAgentFromSession(sessionID, client, deps = {}) {
|
|
|
98651
98739
|
try {
|
|
98652
98740
|
const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
98653
98741
|
try {
|
|
98654
|
-
const content = readFileSync20(
|
|
98742
|
+
const content = readFileSync20(join67(messageDir, fileName), "utf-8");
|
|
98655
98743
|
const parsed = JSON.parse(content);
|
|
98656
98744
|
return {
|
|
98657
98745
|
fileName,
|
|
@@ -98695,7 +98783,7 @@ init_agent_display_names();
|
|
|
98695
98783
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
98696
98784
|
init_frontmatter2();
|
|
98697
98785
|
import { existsSync as existsSync39, readFileSync as readFileSync21, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "node:fs";
|
|
98698
|
-
import { dirname as dirname26, join as
|
|
98786
|
+
import { dirname as dirname26, join as join68 } from "node:path";
|
|
98699
98787
|
|
|
98700
98788
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
98701
98789
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -98704,7 +98792,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
98704
98792
|
|
|
98705
98793
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
98706
98794
|
function getStateFilePath(directory, customPath) {
|
|
98707
|
-
return customPath ?
|
|
98795
|
+
return customPath ? join68(directory, customPath) : join68(directory, DEFAULT_STATE_FILE);
|
|
98708
98796
|
}
|
|
98709
98797
|
function readState(directory, customPath) {
|
|
98710
98798
|
const filePath = getStateFilePath(directory, customPath);
|
|
@@ -99811,7 +99899,7 @@ init_extract_semver();
|
|
|
99811
99899
|
init_bun_which_shim();
|
|
99812
99900
|
import { existsSync as existsSync47, accessSync as accessSync4, constants as constants12 } from "node:fs";
|
|
99813
99901
|
import { homedir as homedir15 } from "node:os";
|
|
99814
|
-
import { join as
|
|
99902
|
+
import { join as join75 } from "node:path";
|
|
99815
99903
|
|
|
99816
99904
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
99817
99905
|
init_spawn_with_windows_hide();
|
|
@@ -99903,17 +99991,17 @@ function getDesktopAppPaths(platform) {
|
|
|
99903
99991
|
case "darwin":
|
|
99904
99992
|
return [
|
|
99905
99993
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
99906
|
-
|
|
99994
|
+
join75(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
99907
99995
|
];
|
|
99908
99996
|
case "win32": {
|
|
99909
99997
|
const programFiles = process.env.ProgramFiles;
|
|
99910
99998
|
const localAppData = process.env.LOCALAPPDATA;
|
|
99911
99999
|
const paths = [];
|
|
99912
100000
|
if (programFiles) {
|
|
99913
|
-
paths.push(
|
|
100001
|
+
paths.push(join75(programFiles, "OpenCode", "OpenCode.exe"));
|
|
99914
100002
|
}
|
|
99915
100003
|
if (localAppData) {
|
|
99916
|
-
paths.push(
|
|
100004
|
+
paths.push(join75(localAppData, "OpenCode", "OpenCode.exe"));
|
|
99917
100005
|
}
|
|
99918
100006
|
return paths;
|
|
99919
100007
|
}
|
|
@@ -99921,8 +100009,8 @@ function getDesktopAppPaths(platform) {
|
|
|
99921
100009
|
return [
|
|
99922
100010
|
"/usr/bin/opencode",
|
|
99923
100011
|
"/usr/lib/opencode/opencode",
|
|
99924
|
-
|
|
99925
|
-
|
|
100012
|
+
join75(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
100013
|
+
join75(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
99926
100014
|
];
|
|
99927
100015
|
default:
|
|
99928
100016
|
return [];
|
|
@@ -99954,7 +100042,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
99954
100042
|
const candidates = getCommandCandidates2(platform);
|
|
99955
100043
|
for (const entry of pathEnv.split(delimiter).filter(Boolean)) {
|
|
99956
100044
|
for (const command of candidates) {
|
|
99957
|
-
const fullPath =
|
|
100045
|
+
const fullPath = join75(entry, command);
|
|
99958
100046
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
99959
100047
|
return { binary: command, path: fullPath };
|
|
99960
100048
|
}
|
|
@@ -100098,22 +100186,22 @@ init_package_json_locator();
|
|
|
100098
100186
|
import { existsSync as existsSync49, readFileSync as readFileSync30, readdirSync as readdirSync10 } from "node:fs";
|
|
100099
100187
|
import { createRequire as createRequire2 } from "node:module";
|
|
100100
100188
|
import { homedir as homedir16 } from "node:os";
|
|
100101
|
-
import { join as
|
|
100189
|
+
import { join as join76 } from "node:path";
|
|
100102
100190
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
100103
100191
|
init_shared();
|
|
100104
100192
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
100105
100193
|
if (platform === "darwin")
|
|
100106
|
-
return
|
|
100194
|
+
return join76(homedir16(), "Library", "Caches");
|
|
100107
100195
|
if (platform === "win32")
|
|
100108
|
-
return process.env.LOCALAPPDATA ??
|
|
100109
|
-
return
|
|
100196
|
+
return process.env.LOCALAPPDATA ?? join76(homedir16(), "AppData", "Local");
|
|
100197
|
+
return join76(homedir16(), ".cache");
|
|
100110
100198
|
}
|
|
100111
100199
|
function resolveOpenCodeCacheDir() {
|
|
100112
100200
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
100113
100201
|
if (xdgCacheHome)
|
|
100114
|
-
return
|
|
100202
|
+
return join76(xdgCacheHome, "opencode");
|
|
100115
100203
|
const fromShared = getOpenCodeCacheDir();
|
|
100116
|
-
const platformDefault =
|
|
100204
|
+
const platformDefault = join76(getPlatformDefaultCacheDir(), "opencode");
|
|
100117
100205
|
if (existsSync49(fromShared) || !existsSync49(platformDefault))
|
|
100118
100206
|
return fromShared;
|
|
100119
100207
|
return platformDefault;
|
|
@@ -100145,11 +100233,11 @@ function normalizeVersion(value) {
|
|
|
100145
100233
|
function createPackageCandidates(rootDir) {
|
|
100146
100234
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
100147
100235
|
packageName,
|
|
100148
|
-
installedPackagePath:
|
|
100236
|
+
installedPackagePath: join76(rootDir, "node_modules", packageName, "package.json")
|
|
100149
100237
|
}));
|
|
100150
100238
|
}
|
|
100151
100239
|
function createTaggedInstallCandidates(rootDir) {
|
|
100152
|
-
const packagesDir =
|
|
100240
|
+
const packagesDir = join76(rootDir, "packages");
|
|
100153
100241
|
if (!existsSync49(packagesDir))
|
|
100154
100242
|
return [];
|
|
100155
100243
|
const candidates = [];
|
|
@@ -100157,14 +100245,14 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
100157
100245
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
100158
100246
|
if (packageName === undefined)
|
|
100159
100247
|
continue;
|
|
100160
|
-
const installDir =
|
|
100248
|
+
const installDir = join76(packagesDir, entryName);
|
|
100161
100249
|
candidates.push({
|
|
100162
100250
|
cacheDir: installDir,
|
|
100163
|
-
cachePackagePath:
|
|
100251
|
+
cachePackagePath: join76(installDir, "package.json"),
|
|
100164
100252
|
packageCandidates: [
|
|
100165
100253
|
{
|
|
100166
100254
|
packageName,
|
|
100167
|
-
installedPackagePath:
|
|
100255
|
+
installedPackagePath: join76(installDir, "node_modules", packageName, "package.json")
|
|
100168
100256
|
}
|
|
100169
100257
|
]
|
|
100170
100258
|
});
|
|
@@ -100209,13 +100297,13 @@ function getLoadedPluginVersion() {
|
|
|
100209
100297
|
const candidates = [
|
|
100210
100298
|
{
|
|
100211
100299
|
cacheDir: configDir,
|
|
100212
|
-
cachePackagePath:
|
|
100300
|
+
cachePackagePath: join76(configDir, "package.json"),
|
|
100213
100301
|
packageCandidates: createPackageCandidates(configDir)
|
|
100214
100302
|
},
|
|
100215
100303
|
...createTaggedInstallCandidates(configDir),
|
|
100216
100304
|
{
|
|
100217
100305
|
cacheDir,
|
|
100218
|
-
cachePackagePath:
|
|
100306
|
+
cachePackagePath: join76(cacheDir, "package.json"),
|
|
100219
100307
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
100220
100308
|
},
|
|
100221
100309
|
...createTaggedInstallCandidates(cacheDir)
|
|
@@ -100264,7 +100352,6 @@ var defaultDeps5 = {
|
|
|
100264
100352
|
readConfigFile: (path) => readFileSync31(path, "utf-8"),
|
|
100265
100353
|
parseConfigContent: (content) => parseJsonc(content)
|
|
100266
100354
|
};
|
|
100267
|
-
var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
|
|
100268
100355
|
function isConfigValid(configPath, deps) {
|
|
100269
100356
|
if (!configPath)
|
|
100270
100357
|
return true;
|
|
@@ -100385,7 +100472,7 @@ async function checkSystem(deps = defaultDeps5) {
|
|
|
100385
100472
|
description: `Loaded ${systemInfo.loadedVersion}, latest ${latestVersion}.`,
|
|
100386
100473
|
fix: `Update: cd "${loadedInfo.cacheDir}" && bun add ${loadedPackageName}@${installTag}
|
|
100387
100474
|
` + `If Bun reports blocked postinstalls, inspect them: cd "${loadedInfo.cacheDir}" && bun pm untrusted
|
|
100388
|
-
` + `Then trust only OMO-related packages from that list: cd "${loadedInfo.cacheDir}" && bun pm trust ${loadedPackageName}
|
|
100475
|
+
` + `Then trust only OMO-related packages from that list: cd "${loadedInfo.cacheDir}" && bun pm trust ${loadedPackageName}`,
|
|
100389
100476
|
severity: "warning",
|
|
100390
100477
|
affects: ["plugin features"]
|
|
100391
100478
|
});
|
|
@@ -100409,18 +100496,18 @@ async function checkSystem(deps = defaultDeps5) {
|
|
|
100409
100496
|
init_shared();
|
|
100410
100497
|
import { existsSync as existsSync51, readFileSync as readFileSync32 } from "node:fs";
|
|
100411
100498
|
import { homedir as homedir17 } from "node:os";
|
|
100412
|
-
import { join as
|
|
100499
|
+
import { join as join77 } from "node:path";
|
|
100413
100500
|
function getUserConfigDir2() {
|
|
100414
100501
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
100415
100502
|
if (xdgConfig)
|
|
100416
|
-
return
|
|
100417
|
-
return
|
|
100503
|
+
return join77(xdgConfig, "opencode");
|
|
100504
|
+
return join77(homedir17(), ".config", "opencode");
|
|
100418
100505
|
}
|
|
100419
100506
|
function loadCustomProviderNames() {
|
|
100420
100507
|
const configDir = getUserConfigDir2();
|
|
100421
100508
|
const candidatePaths = [
|
|
100422
|
-
|
|
100423
|
-
|
|
100509
|
+
join77(configDir, "opencode.json"),
|
|
100510
|
+
join77(configDir, "opencode.jsonc")
|
|
100424
100511
|
];
|
|
100425
100512
|
for (const configPath of candidatePaths) {
|
|
100426
100513
|
if (!existsSync51(configPath))
|
|
@@ -100441,7 +100528,7 @@ function loadCustomProviderNames() {
|
|
|
100441
100528
|
return [];
|
|
100442
100529
|
}
|
|
100443
100530
|
function loadAvailableModelsFromCache() {
|
|
100444
|
-
const cacheFile =
|
|
100531
|
+
const cacheFile = join77(getOpenCodeCacheDir(), "models.json");
|
|
100445
100532
|
const customProviders = loadCustomProviderNames();
|
|
100446
100533
|
if (!existsSync51(cacheFile)) {
|
|
100447
100534
|
if (customProviders.length > 0) {
|
|
@@ -100503,7 +100590,7 @@ function loadOmoConfig2() {
|
|
|
100503
100590
|
|
|
100504
100591
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
100505
100592
|
init_shared();
|
|
100506
|
-
import { join as
|
|
100593
|
+
import { join as join78 } from "node:path";
|
|
100507
100594
|
|
|
100508
100595
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
100509
100596
|
function formatModelWithVariant(model, variant) {
|
|
@@ -100545,7 +100632,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
100545
100632
|
}
|
|
100546
100633
|
function buildModelResolutionDetails(options) {
|
|
100547
100634
|
const details = [];
|
|
100548
|
-
const cacheFile =
|
|
100635
|
+
const cacheFile = join78(getOpenCodeCacheDir(), "models.json");
|
|
100549
100636
|
details.push("═══ Available Models (from cache) ═══");
|
|
100550
100637
|
details.push("");
|
|
100551
100638
|
if (options.available.cacheExists) {
|
|
@@ -100852,12 +100939,41 @@ async function checkConfig() {
|
|
|
100852
100939
|
};
|
|
100853
100940
|
}
|
|
100854
100941
|
|
|
100942
|
+
// packages/omo-opencode/src/cli/doctor/checks/browser-provider.ts
|
|
100943
|
+
async function checkBrowserProvider() {
|
|
100944
|
+
const chain = loadOmoOpenCodeConfigChain(process.cwd());
|
|
100945
|
+
const issues = [];
|
|
100946
|
+
for (const view of chain.views) {
|
|
100947
|
+
const browserConfig = view.config.browser_automation_engine;
|
|
100948
|
+
if (browserConfig === undefined)
|
|
100949
|
+
continue;
|
|
100950
|
+
const result = BrowserAutomationConfigSchema.safeParse(browserConfig);
|
|
100951
|
+
if (result.success)
|
|
100952
|
+
continue;
|
|
100953
|
+
for (const issue of result.error.issues) {
|
|
100954
|
+
const path = ["browser_automation_engine", ...issue.path].join(".");
|
|
100955
|
+
issues.push({
|
|
100956
|
+
title: "Invalid browser provider configuration",
|
|
100957
|
+
description: `${view.path}: ${path}: ${issue.message}`,
|
|
100958
|
+
severity: "error",
|
|
100959
|
+
affects: [path]
|
|
100960
|
+
});
|
|
100961
|
+
}
|
|
100962
|
+
}
|
|
100963
|
+
return {
|
|
100964
|
+
name: "Browser Provider",
|
|
100965
|
+
status: issues.length > 0 ? "fail" : "pass",
|
|
100966
|
+
message: issues.length > 0 ? "Browser provider configuration requires migration" : "Browser provider configuration is valid",
|
|
100967
|
+
issues
|
|
100968
|
+
};
|
|
100969
|
+
}
|
|
100970
|
+
|
|
100855
100971
|
// packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
|
|
100856
100972
|
init_src4();
|
|
100857
100973
|
init_main();
|
|
100858
100974
|
init_config_migration();
|
|
100859
100975
|
import { existsSync as existsSync52, readFileSync as readFileSync33 } from "node:fs";
|
|
100860
|
-
import { join as
|
|
100976
|
+
import { join as join79 } from "node:path";
|
|
100861
100977
|
var CANONICAL_REPLACEMENT = new Map([
|
|
100862
100978
|
["variant", "reasoning"],
|
|
100863
100979
|
["reasoningEffort", "reasoning"],
|
|
@@ -100918,7 +101034,7 @@ function userConfigPaths() {
|
|
|
100918
101034
|
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
100919
101035
|
if (home === undefined || home.length === 0)
|
|
100920
101036
|
return [];
|
|
100921
|
-
return [
|
|
101037
|
+
return [join79(home, ".omo", "omo.jsonc"), join79(home, ".omo", "omo.json")];
|
|
100922
101038
|
}
|
|
100923
101039
|
async function checkDeprecatedReasoningKeys() {
|
|
100924
101040
|
const issues = [];
|
|
@@ -100944,25 +101060,25 @@ init_src();
|
|
|
100944
101060
|
import { existsSync as existsSync53 } from "node:fs";
|
|
100945
101061
|
import { createRequire as createRequire3 } from "node:module";
|
|
100946
101062
|
import { homedir as homedir19 } from "node:os";
|
|
100947
|
-
import { dirname as dirname31, join as
|
|
101063
|
+
import { dirname as dirname31, join as join81 } from "node:path";
|
|
100948
101064
|
|
|
100949
101065
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
100950
|
-
import { join as join79 } from "path";
|
|
100951
|
-
import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
|
|
100952
101066
|
init_binary_downloader();
|
|
100953
101067
|
init_logger2();
|
|
100954
101068
|
init_plugin_identity();
|
|
101069
|
+
import { join as join80 } from "path";
|
|
101070
|
+
import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
|
|
100955
101071
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
100956
|
-
var DEBUG_FILE =
|
|
101072
|
+
var DEBUG_FILE = join80(tmpdir4(), "comment-checker-debug.log");
|
|
100957
101073
|
function getCacheDir2() {
|
|
100958
101074
|
if (process.platform === "win32") {
|
|
100959
101075
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
100960
|
-
const base = localAppData ||
|
|
100961
|
-
return
|
|
101076
|
+
const base = localAppData || join80(homedir18(), "AppData", "Local");
|
|
101077
|
+
return join80(base, CACHE_DIR_NAME, "bin");
|
|
100962
101078
|
}
|
|
100963
101079
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
100964
|
-
const base = xdgCache ||
|
|
100965
|
-
return
|
|
101080
|
+
const base = xdgCache || join80(homedir18(), ".cache");
|
|
101081
|
+
return join80(base, CACHE_DIR_NAME, "bin");
|
|
100966
101082
|
}
|
|
100967
101083
|
function getBinaryName() {
|
|
100968
101084
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -101012,7 +101128,7 @@ async function getBinaryVersion(binary) {
|
|
|
101012
101128
|
}
|
|
101013
101129
|
}
|
|
101014
101130
|
async function checkAstGrepCli() {
|
|
101015
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
101131
|
+
const runtimeDir = astGrepRuntimeDir(join81(homedir19(), ".omo"));
|
|
101016
101132
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
101017
101133
|
if (sgPath === null) {
|
|
101018
101134
|
return {
|
|
@@ -101042,10 +101158,10 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
101042
101158
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
101043
101159
|
try {
|
|
101044
101160
|
const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
|
|
101045
|
-
const vendorPath =
|
|
101161
|
+
const vendorPath = join81(packageDir, "vendor", platformKey, binaryName);
|
|
101046
101162
|
if (existsSync53(vendorPath))
|
|
101047
101163
|
return vendorPath;
|
|
101048
|
-
const binPath =
|
|
101164
|
+
const binPath = join81(packageDir, "bin", binaryName);
|
|
101049
101165
|
if (existsSync53(binPath))
|
|
101050
101166
|
return binPath;
|
|
101051
101167
|
} catch (error) {
|
|
@@ -101421,13 +101537,13 @@ function getInstalledLspServers(options = {}) {
|
|
|
101421
101537
|
init_shared();
|
|
101422
101538
|
import { existsSync as existsSync55, readFileSync as readFileSync35 } from "node:fs";
|
|
101423
101539
|
import { homedir as homedir20 } from "node:os";
|
|
101424
|
-
import { join as
|
|
101540
|
+
import { join as join82 } from "node:path";
|
|
101425
101541
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
101426
101542
|
function getMcpConfigPaths() {
|
|
101427
101543
|
return [
|
|
101428
|
-
|
|
101429
|
-
|
|
101430
|
-
|
|
101544
|
+
join82(homedir20(), ".claude", ".mcp.json"),
|
|
101545
|
+
join82(process.cwd(), ".mcp.json"),
|
|
101546
|
+
join82(process.cwd(), ".claude", ".mcp.json")
|
|
101431
101547
|
];
|
|
101432
101548
|
}
|
|
101433
101549
|
function loadUserMcpConfig() {
|
|
@@ -101509,7 +101625,7 @@ function buildToolIssues(summary) {
|
|
|
101509
101625
|
issues.push({
|
|
101510
101626
|
title: "Comment checker unavailable",
|
|
101511
101627
|
description: "Comment checker binary is not installed.",
|
|
101512
|
-
fix: "
|
|
101628
|
+
fix: "The hook downloads its pinned GitHub release automatically on first use. Allow access to github.com and restart OpenCode to retry.",
|
|
101513
101629
|
severity: "warning",
|
|
101514
101630
|
affects: ["comment-checker hook"]
|
|
101515
101631
|
});
|
|
@@ -101707,9 +101823,9 @@ async function pathExists(dir) {
|
|
|
101707
101823
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
101708
101824
|
init_src();
|
|
101709
101825
|
import { existsSync as existsSync57 } from "node:fs";
|
|
101710
|
-
import { lstat as
|
|
101826
|
+
import { lstat as lstat16, readdir as readdir14, readFile as readFile28 } from "node:fs/promises";
|
|
101711
101827
|
import { homedir as homedir22 } from "node:os";
|
|
101712
|
-
import { basename as basename11, join as
|
|
101828
|
+
import { basename as basename11, join as join83, resolve as resolve23 } from "node:path";
|
|
101713
101829
|
// packages/omo-opencode/package.json
|
|
101714
101830
|
var package_default3 = {
|
|
101715
101831
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -101775,13 +101891,13 @@ var CODEX_BIN_NAMES = [
|
|
|
101775
101891
|
"omo-git-bash-hook"
|
|
101776
101892
|
];
|
|
101777
101893
|
async function gatherCodexSummary(deps = {}) {
|
|
101778
|
-
const codexHome = resolve23(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
101894
|
+
const codexHome = resolve23(deps.codexHome ?? process.env.CODEX_HOME ?? join83(homedir22(), ".codex"));
|
|
101779
101895
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
101780
101896
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
101781
101897
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
101782
|
-
const manifest = pluginRoot === null ? null : await readJson(
|
|
101783
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
101784
|
-
const configPath =
|
|
101898
|
+
const manifest = pluginRoot === null ? null : await readJson(join83(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
101899
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join83(pluginRoot, "lazycodex-install.json"));
|
|
101900
|
+
const configPath = join83(codexHome, "config.toml");
|
|
101785
101901
|
const pluginVersion = stringField(manifest, "version");
|
|
101786
101902
|
return {
|
|
101787
101903
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -101838,7 +101954,7 @@ function buildCodexIssues(summary) {
|
|
|
101838
101954
|
if (summary.pluginRoot === null) {
|
|
101839
101955
|
issues.push({
|
|
101840
101956
|
title: "OMO Codex plugin is not installed",
|
|
101841
|
-
description: `Expected cached plugin at ${
|
|
101957
|
+
description: `Expected cached plugin at ${join83("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
101842
101958
|
fix: "Run: npx lazycodex-ai install",
|
|
101843
101959
|
severity: "error",
|
|
101844
101960
|
affects: ["plugin loading"]
|
|
@@ -101903,12 +102019,12 @@ function buildCodexIssues(summary) {
|
|
|
101903
102019
|
return issues;
|
|
101904
102020
|
}
|
|
101905
102021
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
101906
|
-
const pluginRoot =
|
|
102022
|
+
const pluginRoot = join83(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
101907
102023
|
if (!existsSync57(pluginRoot))
|
|
101908
102024
|
return null;
|
|
101909
102025
|
const versions = await readdir14(pluginRoot, { withFileTypes: true });
|
|
101910
102026
|
const candidates = versions.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
101911
|
-
return candidates.length === 0 ? null :
|
|
102027
|
+
return candidates.length === 0 ? null : join83(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
101912
102028
|
}
|
|
101913
102029
|
async function readCodexConfigSummary(configPath) {
|
|
101914
102030
|
if (!existsSync57(configPath)) {
|
|
@@ -101922,7 +102038,7 @@ async function readCodexConfigSummary(configPath) {
|
|
|
101922
102038
|
companionLifecycleHookStateEvents: []
|
|
101923
102039
|
};
|
|
101924
102040
|
}
|
|
101925
|
-
const content = await
|
|
102041
|
+
const content = await readFile28(configPath, "utf8");
|
|
101926
102042
|
return {
|
|
101927
102043
|
exists: true,
|
|
101928
102044
|
marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
|
|
@@ -101936,13 +102052,13 @@ async function readCodexConfigSummary(configPath) {
|
|
|
101936
102052
|
async function readLinkedBins(binDir) {
|
|
101937
102053
|
const linked = [];
|
|
101938
102054
|
for (const name of CODEX_BIN_NAMES) {
|
|
101939
|
-
if (await pathExists2(
|
|
102055
|
+
if (await pathExists2(join83(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
101940
102056
|
linked.push(name);
|
|
101941
102057
|
}
|
|
101942
102058
|
return linked;
|
|
101943
102059
|
}
|
|
101944
102060
|
async function readLinkedAgents(codexHome) {
|
|
101945
|
-
const agentsDir =
|
|
102061
|
+
const agentsDir = join83(codexHome, "agents");
|
|
101946
102062
|
if (!existsSync57(agentsDir))
|
|
101947
102063
|
return [];
|
|
101948
102064
|
const entries = await readdir14(agentsDir, { withFileTypes: true });
|
|
@@ -101950,7 +102066,7 @@ async function readLinkedAgents(codexHome) {
|
|
|
101950
102066
|
}
|
|
101951
102067
|
async function readJson(path) {
|
|
101952
102068
|
try {
|
|
101953
|
-
const parsed = JSON.parse(await
|
|
102069
|
+
const parsed = JSON.parse(await readFile28(path, "utf8"));
|
|
101954
102070
|
return isPlainRecord(parsed) ? parsed : null;
|
|
101955
102071
|
} catch (error) {
|
|
101956
102072
|
if (error instanceof Error)
|
|
@@ -102045,7 +102161,7 @@ function compareVersionsDescending(left, right) {
|
|
|
102045
102161
|
}
|
|
102046
102162
|
async function pathExists2(path) {
|
|
102047
102163
|
try {
|
|
102048
|
-
await
|
|
102164
|
+
await lstat16(path);
|
|
102049
102165
|
return true;
|
|
102050
102166
|
} catch (error) {
|
|
102051
102167
|
if (error instanceof Error)
|
|
@@ -102074,9 +102190,9 @@ function resolveLatestVersion(input) {
|
|
|
102074
102190
|
|
|
102075
102191
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
102076
102192
|
init_src();
|
|
102077
|
-
import { readdir as readdir15, readFile as
|
|
102193
|
+
import { readdir as readdir15, readFile as readFile29, stat as stat7 } from "node:fs/promises";
|
|
102078
102194
|
import { homedir as homedir23 } from "node:os";
|
|
102079
|
-
import { dirname as dirname33, isAbsolute as isAbsolute13, join as
|
|
102195
|
+
import { dirname as dirname33, isAbsolute as isAbsolute13, join as join84, relative as relative9, resolve as resolve24, sep as sep9 } from "node:path";
|
|
102080
102196
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
102081
102197
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
102082
102198
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -102086,7 +102202,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
102086
102202
|
const env = deps.env ?? process.env;
|
|
102087
102203
|
const platform = deps.platform ?? process.platform;
|
|
102088
102204
|
const arch = deps.arch ?? process.arch;
|
|
102089
|
-
const codexHome = resolve24(deps.codexHome ?? env["CODEX_HOME"] ??
|
|
102205
|
+
const codexHome = resolve24(deps.codexHome ?? env["CODEX_HOME"] ?? join84(homedir23(), ".codex"));
|
|
102090
102206
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
102091
102207
|
if (summary.pluginRoot === null) {
|
|
102092
102208
|
return {
|
|
@@ -102111,7 +102227,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
102111
102227
|
});
|
|
102112
102228
|
}
|
|
102113
102229
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
102114
|
-
const runtimeSgPath =
|
|
102230
|
+
const runtimeSgPath = join84(runtimeSgDir, sgBinaryName(platform));
|
|
102115
102231
|
const sg = findSgBinarySync({
|
|
102116
102232
|
arch,
|
|
102117
102233
|
env,
|
|
@@ -102223,7 +102339,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
102223
102339
|
for (const entry of entries) {
|
|
102224
102340
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
102225
102341
|
continue;
|
|
102226
|
-
const entryPath =
|
|
102342
|
+
const entryPath = join84(root, entry.name);
|
|
102227
102343
|
if (entry.isDirectory()) {
|
|
102228
102344
|
paths.push(...await findManifestPaths(entryPath, manifestName));
|
|
102229
102345
|
continue;
|
|
@@ -102267,18 +102383,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
102267
102383
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute13(arg));
|
|
102268
102384
|
}
|
|
102269
102385
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
102270
|
-
return
|
|
102386
|
+
return join84(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
102271
102387
|
}
|
|
102272
102388
|
function describeSgSource(sgPath, env, runtimeSgDir, platform) {
|
|
102273
102389
|
const override = env[SG_PATH_ENV_KEY]?.trim();
|
|
102274
102390
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
102275
102391
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
102276
|
-
if (sgPath ===
|
|
102392
|
+
if (sgPath === join84(runtimeSgDir, sgBinaryName(platform)))
|
|
102277
102393
|
return "runtime dir";
|
|
102278
102394
|
return "PATH";
|
|
102279
102395
|
}
|
|
102280
102396
|
async function readBootstrapStateSummary(codexHome) {
|
|
102281
|
-
const statePath =
|
|
102397
|
+
const statePath = join84(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
102282
102398
|
const raw = await readJson2(statePath);
|
|
102283
102399
|
if (raw === null)
|
|
102284
102400
|
return null;
|
|
@@ -102327,7 +102443,7 @@ function degradedDetailLines(entries) {
|
|
|
102327
102443
|
}
|
|
102328
102444
|
async function readJson2(path) {
|
|
102329
102445
|
try {
|
|
102330
|
-
const parsed = JSON.parse(await
|
|
102446
|
+
const parsed = JSON.parse(await readFile29(path, "utf8"));
|
|
102331
102447
|
return isRecord15(parsed) ? parsed : null;
|
|
102332
102448
|
} catch (error) {
|
|
102333
102449
|
if (error instanceof Error)
|
|
@@ -102355,18 +102471,18 @@ function isRecord15(value) {
|
|
|
102355
102471
|
|
|
102356
102472
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
102357
102473
|
import { existsSync as existsSync58 } from "node:fs";
|
|
102358
|
-
import { readFile as
|
|
102474
|
+
import { readFile as readFile30 } from "node:fs/promises";
|
|
102359
102475
|
import { homedir as homedir24 } from "node:os";
|
|
102360
|
-
import { join as
|
|
102476
|
+
import { join as join85, resolve as resolve25 } from "node:path";
|
|
102361
102477
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
102362
102478
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
102363
102479
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
102364
102480
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
102365
|
-
const codexHome = resolve25(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
102481
|
+
const codexHome = resolve25(deps.codexHome ?? process.env.CODEX_HOME ?? join85(homedir24(), ".codex"));
|
|
102366
102482
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
102367
102483
|
const platform = deps.platform ?? process.platform;
|
|
102368
|
-
const wrapperPath =
|
|
102369
|
-
const legacyWrapperPath =
|
|
102484
|
+
const wrapperPath = join85(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
|
|
102485
|
+
const legacyWrapperPath = join85(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
102370
102486
|
const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
|
|
102371
102487
|
const issues = [];
|
|
102372
102488
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
@@ -102400,7 +102516,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
|
|
|
102400
102516
|
}
|
|
102401
102517
|
async function readRuntimeWrapper(path) {
|
|
102402
102518
|
try {
|
|
102403
|
-
return await
|
|
102519
|
+
return await readFile30(path, "utf8");
|
|
102404
102520
|
} catch (error) {
|
|
102405
102521
|
if (error instanceof Error)
|
|
102406
102522
|
return null;
|
|
@@ -102417,6 +102533,7 @@ function parseRuntimeTargetPath(wrapper) {
|
|
|
102417
102533
|
// packages/omo-opencode/src/cli/doctor/checks/index.ts
|
|
102418
102534
|
function getAllCheckDefinitions() {
|
|
102419
102535
|
return [
|
|
102536
|
+
{ id: "browser-provider", name: "Browser Provider", check: checkBrowserProvider },
|
|
102420
102537
|
{
|
|
102421
102538
|
id: CHECK_IDS.SYSTEM,
|
|
102422
102539
|
name: CHECK_NAMES[CHECK_IDS.SYSTEM],
|
|
@@ -102890,7 +103007,7 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
102890
103007
|
}
|
|
102891
103008
|
|
|
102892
103009
|
// packages/mcp-client-core/src/mcp-oauth/storage.ts
|
|
102893
|
-
import { createHash as
|
|
103010
|
+
import { createHash as createHash7 } from "node:crypto";
|
|
102894
103011
|
import {
|
|
102895
103012
|
chmodSync as chmodSync5,
|
|
102896
103013
|
existsSync as existsSync61,
|
|
@@ -102901,12 +103018,12 @@ import {
|
|
|
102901
103018
|
unlinkSync as unlinkSync9,
|
|
102902
103019
|
writeFileSync as writeFileSync12
|
|
102903
103020
|
} from "node:fs";
|
|
102904
|
-
import { basename as basename12, dirname as dirname34, join as
|
|
103021
|
+
import { basename as basename12, dirname as dirname34, join as join88 } from "node:path";
|
|
102905
103022
|
|
|
102906
103023
|
// packages/mcp-client-core/src/config-dir.ts
|
|
102907
103024
|
import { existsSync as existsSync59, realpathSync as realpathSync8 } from "node:fs";
|
|
102908
103025
|
import { homedir as homedir25 } from "node:os";
|
|
102909
|
-
import { join as
|
|
103026
|
+
import { join as join86, resolve as resolve26 } from "node:path";
|
|
102910
103027
|
function resolveConfigPath2(pathValue) {
|
|
102911
103028
|
const resolvedPath = resolve26(pathValue);
|
|
102912
103029
|
if (!existsSync59(resolvedPath))
|
|
@@ -102924,13 +103041,13 @@ function getOpenCodeCliConfigDir(env = process.env) {
|
|
|
102924
103041
|
if (customConfigDir) {
|
|
102925
103042
|
return resolveConfigPath2(customConfigDir);
|
|
102926
103043
|
}
|
|
102927
|
-
const xdgConfigDir = env["XDG_CONFIG_HOME"]?.trim() ||
|
|
102928
|
-
return resolveConfigPath2(
|
|
103044
|
+
const xdgConfigDir = env["XDG_CONFIG_HOME"]?.trim() || join86(homedir25(), ".config");
|
|
103045
|
+
return resolveConfigPath2(join86(xdgConfigDir, "opencode"));
|
|
102929
103046
|
}
|
|
102930
103047
|
|
|
102931
103048
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
102932
103049
|
import { chmodSync as chmodSync4, existsSync as existsSync60, readFileSync as readFileSync37, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "node:fs";
|
|
102933
|
-
import { join as
|
|
103050
|
+
import { join as join87 } from "node:path";
|
|
102934
103051
|
var INDEX_FILE_NAME = "index.json";
|
|
102935
103052
|
function isTokenIndex(value) {
|
|
102936
103053
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -102938,7 +103055,7 @@ function isTokenIndex(value) {
|
|
|
102938
103055
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
102939
103056
|
}
|
|
102940
103057
|
function getIndexPath(storageDir) {
|
|
102941
|
-
return
|
|
103058
|
+
return join87(storageDir, INDEX_FILE_NAME);
|
|
102942
103059
|
}
|
|
102943
103060
|
function readTokenIndex(storageDir) {
|
|
102944
103061
|
const indexPath = getIndexPath(storageDir);
|
|
@@ -102982,16 +103099,16 @@ function deleteTokenIndexEntry(storageDir, hash) {
|
|
|
102982
103099
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
102983
103100
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
102984
103101
|
function getMcpOauthStorageDir() {
|
|
102985
|
-
return
|
|
103102
|
+
return join88(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
102986
103103
|
}
|
|
102987
103104
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
102988
|
-
return
|
|
103105
|
+
return createHash7("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
102989
103106
|
}
|
|
102990
103107
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
102991
|
-
return
|
|
103108
|
+
return join88(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
102992
103109
|
}
|
|
102993
103110
|
function getLegacyStoragePath() {
|
|
102994
|
-
return
|
|
103111
|
+
return join88(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
102995
103112
|
}
|
|
102996
103113
|
function normalizeHost2(serverHost) {
|
|
102997
103114
|
let host = serverHost.trim();
|
|
@@ -103170,7 +103287,7 @@ function listTokensByHost(serverHost) {
|
|
|
103170
103287
|
for (const [hash, indexedKey] of Object.entries(index)) {
|
|
103171
103288
|
if (!indexedKey.startsWith(prefix))
|
|
103172
103289
|
continue;
|
|
103173
|
-
const indexedToken = readTokenFile(
|
|
103290
|
+
const indexedToken = readTokenFile(join88(getMcpOauthStorageDir(), `${hash}.json`));
|
|
103174
103291
|
if (indexedToken)
|
|
103175
103292
|
result[indexedKey] = indexedToken;
|
|
103176
103293
|
}
|
|
@@ -103185,7 +103302,7 @@ function listAllTokens() {
|
|
|
103185
103302
|
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
103186
103303
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
103187
103304
|
continue;
|
|
103188
|
-
const token = readTokenFile(
|
|
103305
|
+
const token = readTokenFile(join88(dir, entry.name));
|
|
103189
103306
|
const hash = basename12(entry.name, ".json");
|
|
103190
103307
|
if (token)
|
|
103191
103308
|
result[index[hash] ?? hash] = token;
|
|
@@ -103359,13 +103476,13 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
|
|
|
103359
103476
|
|
|
103360
103477
|
// packages/mcp-client-core/src/mcp-oauth/oauth-authorization-flow.ts
|
|
103361
103478
|
import { spawn as spawn4 } from "node:child_process";
|
|
103362
|
-
import { createHash as
|
|
103479
|
+
import { createHash as createHash8, randomBytes as randomBytes2 } from "node:crypto";
|
|
103363
103480
|
import { createServer as createServer2 } from "node:http";
|
|
103364
103481
|
function generateCodeVerifier() {
|
|
103365
103482
|
return randomBytes2(32).toString("base64url");
|
|
103366
103483
|
}
|
|
103367
103484
|
function generateCodeChallenge(verifier) {
|
|
103368
|
-
return
|
|
103485
|
+
return createHash8("sha256").update(verifier).digest("base64url");
|
|
103369
103486
|
}
|
|
103370
103487
|
function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
103371
103488
|
const url = new URL(authorizationEndpoint);
|