oh-my-opencode 5.1.47 → 5.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/refusal-rule.d.ts +7 -0
- package/dist/cli/index.js +1194 -752
- package/dist/cli/service-auth/accounts-gate.d.ts +11 -0
- package/dist/cli/service-auth/commands.d.ts +2 -4
- package/dist/cli/service-auth/index.d.ts +1 -1
- package/dist/cli/service-auth/keystore.d.ts +26 -2
- package/dist/cli/service-auth/protocol.d.ts +7 -1
- package/dist/cli/service-auth/session.d.ts +6 -0
- package/dist/cli/service-auth/signed-out-marker.d.ts +11 -0
- package/dist/cli-node/index.js +1194 -752
- package/dist/config/schema/hooks.d.ts +1 -0
- package/dist/create-hooks.d.ts +1 -0
- package/dist/features/boulder-state/storage.d.ts +1 -1
- package/dist/features/boulder-state/types.d.ts +1 -1
- package/dist/hooks/atlas/idle-continuation.d.ts +2 -1
- package/dist/hooks/atlas/types.d.ts +9 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/momus-review-persistence/hook.d.ts +19 -0
- package/dist/hooks/momus-review-persistence/index.d.ts +1 -0
- package/dist/hooks/momus-review-persistence/review-resolution.d.ts +20 -0
- package/dist/hooks/prometheus-md-only/constants.d.ts +2 -0
- package/dist/hooks/prometheus-md-only/fixtures/denial-log.d.ts +1 -0
- package/dist/hooks/prometheus-md-only/fixtures/guarded-hashline.d.ts +1 -0
- package/dist/hooks/prometheus-md-only/fixtures/invoke-before.d.ts +7 -0
- package/dist/hooks/prometheus-md-only/fixtures/opencode-patch-parser.d.ts +2 -0
- package/dist/hooks/prometheus-md-only/hook.d.ts +5 -1
- package/dist/hooks/prometheus-md-only/path-policy.d.ts +2 -9
- package/dist/hooks/prometheus-md-only/vendor/opencode-patch-parser.d.ts +22 -0
- package/dist/index.js +2322 -1045
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
- package/dist/shared/posthog-activity-state.d.ts +1 -0
- package/dist/shared/posthog.d.ts +1 -2
- package/dist/shared/resolve-file-write-path.d.ts +6 -0
- package/dist/skills/ast-grep/README.md +1 -1
- package/dist/skills/ast-grep/install.ps1 +5 -3
- package/dist/skills/ast-grep/install.sh +4 -5
- package/dist/skills/ast-grep/references/install.md +2 -2
- package/dist/skills/ast-grep/scripts/ast_grep_helper.py +13 -3
- package/dist/skills/browser/runtime/omowright/manifest.json +1 -1
- package/dist/skills/coding-agent-sessions/AGENTS.md +5 -4
- package/dist/skills/coding-agent-sessions/SKILL.md +11 -11
- package/dist/skills/coding-agent-sessions/references/all-platforms.md +2 -2
- package/dist/skills/coding-agent-sessions/references/codex.md +4 -4
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +1 -1
- package/dist/skills/coding-agent-sessions/scripts/find-agent-sessions.py +6 -3
- package/dist/skills/frontend/ATTRIBUTION.md +1 -1
- package/dist/skills/frontend/SKILL.md +34 -12
- package/dist/skills/frontend/references/design/README.md +2 -2
- package/dist/skills/frontend/references/design/_INDEX.md +2 -1
- package/dist/skills/frontend/references/design/component-catalogs.md +14 -10
- package/dist/skills/frontend/references/design/design-system-architecture.md +19 -6
- package/dist/skills/frontend/references/design/grounding.md +29 -0
- package/dist/skills/frontend/references/ui-ux-db/scripts/design_system.py +2 -0
- package/dist/skills/frontend/references/ui-ux-db/scripts/search.py +2 -0
- package/dist/skills/ultimate-browsing/SKILL.md +5 -4
- package/dist/skills/ultimate-browsing/engine/AGENTS.md +2 -2
- package/dist/skills/ultimate-browsing/engine/__main__.py +9 -6
- package/dist/skills/ultimate-browsing/engine/summary.py +1 -1
- package/dist/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/dist/skills/ultimate-browsing/scripts/extract_cookies.py +4 -2
- package/dist/skills/ulw-research/AGENTS.md +8 -4
- package/dist/skills/ulw-research/SKILL.md +7 -259
- package/dist/skills/ulw-research/references/deliverable-phase.md +68 -24
- package/dist/skills/ulw-research/references/fact-ledger-grammar.md +7 -3
- package/dist/skills/ulw-research/references/fact-ledger.md +42 -8
- package/dist/skills/ulw-research/references/fidelity-claim-kinds.md +1 -1
- package/dist/skills/ulw-research/references/markdown-blocks.md +12 -0
- package/dist/skills/ulw-research/references/report-gates.md +14 -6
- package/dist/skills/ulw-research/references/research-collection.md +195 -0
- package/dist/skills/ulw-research/references/research-delivery.md +123 -0
- package/dist/skills/ulw-research/scripts/claim-kinds.mjs +33 -5
- package/dist/skills/ulw-research/scripts/claim-kinds.test.ts +37 -2
- package/dist/skills/ulw-research/scripts/claim-prefix.test.ts +76 -0
- package/dist/skills/ulw-research/scripts/contracts-validation.test.ts +83 -0
- package/dist/skills/ulw-research/scripts/contracts.mjs +16 -15
- package/dist/skills/ulw-research/scripts/contracts.test.ts +6 -109
- package/dist/skills/ulw-research/scripts/conversion-altered.test.ts +154 -0
- package/dist/skills/ulw-research/scripts/conversion-originals.test.ts +297 -0
- package/dist/skills/ulw-research/scripts/conversion-probe-classes.test.ts +361 -0
- package/dist/skills/ulw-research/scripts/conversion-probe.mjs +229 -0
- package/dist/skills/ulw-research/scripts/conversion-probe.test.ts +218 -0
- package/dist/skills/ulw-research/scripts/copy-returns-fidelity-policy.test.ts +156 -0
- package/dist/skills/ulw-research/scripts/copy-returns-polish.test.ts +10 -9
- package/dist/skills/ulw-research/scripts/css-hiding.mjs +158 -0
- package/dist/skills/ulw-research/scripts/css-lite.mjs +4 -2
- package/dist/skills/ulw-research/scripts/delivery-barrier-meaning.test.ts +186 -0
- package/dist/skills/ulw-research/scripts/delivery-barrier.test.ts +40 -87
- package/dist/skills/ulw-research/scripts/entities.mjs +13 -4
- package/dist/skills/ulw-research/scripts/fact-commands-fill.mjs +96 -0
- package/dist/skills/ulw-research/scripts/fact-commands-meaning.mjs +26 -30
- package/dist/skills/ulw-research/scripts/fact-commands-polish.mjs +46 -19
- package/dist/skills/ulw-research/scripts/fact-commands-verify.mjs +37 -6
- package/dist/skills/ulw-research/scripts/fact-commands.mjs +40 -62
- package/dist/skills/ulw-research/scripts/fact-derive-2.test.ts +149 -0
- package/dist/skills/ulw-research/scripts/fact-derive.mjs +7 -2
- package/dist/skills/ulw-research/scripts/fact-derive.test.ts +7 -192
- package/dist/skills/ulw-research/scripts/fact-fill.mjs +9 -6
- package/dist/skills/ulw-research/scripts/fact-ledger-kinds.mjs +6 -7
- package/dist/skills/ulw-research/scripts/fact-ledger-kinds.test.ts +2 -1
- package/dist/skills/ulw-research/scripts/fact-ledger-legacy.test.ts +2 -1
- package/dist/skills/ulw-research/scripts/fact-locate.mjs +15 -9
- package/dist/skills/ulw-research/scripts/fact-unit-dimensions-2.test.ts +149 -0
- package/dist/skills/ulw-research/scripts/fact-unit-dimensions.test.ts +4 -168
- package/dist/skills/ulw-research/scripts/fact-unit-rules.test.ts +3 -229
- package/dist/skills/ulw-research/scripts/fidelity-claims.mjs +4 -3
- package/dist/skills/ulw-research/scripts/fidelity-csv.mjs +32 -0
- package/dist/skills/ulw-research/scripts/fidelity-lexicon.mjs +1 -1
- package/dist/skills/ulw-research/scripts/fidelity-originals.mjs +161 -0
- package/dist/skills/ulw-research/scripts/fidelity-policy.mjs +183 -0
- package/dist/skills/ulw-research/scripts/fidelity-records.mjs +81 -14
- package/dist/skills/ulw-research/scripts/fidelity-snapshot-readability.mjs +49 -0
- package/dist/skills/ulw-research/scripts/fidelity-sources.mjs +76 -0
- package/dist/skills/ulw-research/scripts/fidelity-trace.mjs +25 -11
- package/dist/skills/ulw-research/scripts/fidelity-value-unit.mjs +202 -0
- package/dist/skills/ulw-research/scripts/fidelity-values.mjs +40 -39
- package/dist/skills/ulw-research/scripts/fidelity-values.test.ts +8 -29
- package/dist/skills/ulw-research/scripts/gates-fidelity.mjs +8 -6
- package/dist/skills/ulw-research/scripts/gates-static-headings.test.ts +17 -0
- package/dist/skills/ulw-research/scripts/gates-static.mjs +10 -1
- package/dist/skills/ulw-research/scripts/html-lite.mjs +6 -2
- package/dist/skills/ulw-research/scripts/html-markup.mjs +2 -2
- package/dist/skills/ulw-research/scripts/html-text-map.mjs +140 -0
- package/dist/skills/ulw-research/scripts/html-text-map.test.ts +148 -0
- package/dist/skills/ulw-research/scripts/markdown-closers.mjs +126 -0
- package/dist/skills/ulw-research/scripts/md-lite-boundaries.test.ts +46 -0
- package/dist/skills/ulw-research/scripts/md-lite.mjs +1 -1
- package/dist/skills/ulw-research/scripts/number-grammar.mjs +33 -0
- package/dist/skills/ulw-research/scripts/number-grammar.test.ts +36 -0
- package/dist/skills/ulw-research/scripts/numerals.mjs +18 -7
- package/dist/skills/ulw-research/scripts/numerals.test.ts +3 -0
- package/dist/skills/ulw-research/scripts/outcome-start.mjs +66 -0
- package/dist/skills/ulw-research/scripts/outcome-start.test.ts +109 -0
- package/dist/skills/ulw-research/scripts/outcome.mjs +11 -22
- package/dist/skills/ulw-research/scripts/page-source-locator.test.ts +187 -0
- package/dist/skills/ulw-research/scripts/placeholder.mjs +18 -6
- package/dist/skills/ulw-research/scripts/polish-apply.mjs +3 -2
- package/dist/skills/ulw-research/scripts/polish-markup.test.ts +15 -1
- package/dist/skills/ulw-research/scripts/polish-partial.test.ts +42 -0
- package/dist/skills/ulw-research/scripts/raw-decode.mjs +110 -0
- package/dist/skills/ulw-research/scripts/raw-locator.mjs +47 -0
- package/dist/skills/ulw-research/scripts/raw-snapshot.test.ts +139 -0
- package/dist/skills/ulw-research/scripts/report-tools-2.test.ts +233 -0
- package/dist/skills/ulw-research/scripts/report-tools-3.test.ts +141 -0
- package/dist/skills/ulw-research/scripts/report-tools-4.test.ts +135 -0
- package/dist/skills/ulw-research/scripts/report-tools-5.test.ts +231 -0
- package/dist/skills/ulw-research/scripts/report-tools-commands.mjs +1 -1
- package/dist/skills/ulw-research/scripts/report-tools.mjs +7 -1
- package/dist/skills/ulw-research/scripts/report-tools.test.ts +6 -560
- package/dist/skills/ulw-research/scripts/snapshot-readability.test.ts +116 -0
- package/dist/skills/ulw-research/scripts/source-commands.mjs +87 -29
- package/dist/skills/ulw-research/scripts/source-integrity.test.ts +243 -0
- package/dist/skills/ulw-research/scripts/source-refresh.mjs +82 -0
- package/dist/skills/ulw-research/scripts/source-snapshot.mjs +73 -69
- package/dist/skills/ulw-research/scripts/source-snapshot.test.ts +7 -4
- package/dist/skills/ulw-research/scripts/source-view.mjs +89 -0
- package/dist/skills/ulw-research/scripts/sources-citation.mjs +203 -0
- package/dist/skills/ulw-research/scripts/sources-citation.test.ts +236 -0
- package/dist/skills/ulw-research/scripts/tests/contracts-support.ts +147 -0
- package/dist/skills/ulw-research/scripts/tests/delivery-barrier-session.ts +59 -0
- package/dist/skills/ulw-research/scripts/tests/derive-clock.ts +4 -0
- package/dist/skills/ulw-research/scripts/tests/fact-derive-support.ts +65 -0
- package/dist/skills/ulw-research/scripts/tests/fact-unit-dimensions-support.ts +41 -0
- package/dist/skills/ulw-research/scripts/tests/fact-unit-rules-support.ts +241 -0
- package/dist/skills/ulw-research/scripts/tests/fidelity-values-support.ts +30 -0
- package/dist/skills/ulw-research/scripts/tests/fixtures/conversion-probe.html +14 -0
- package/dist/skills/ulw-research/scripts/tests/fixtures/sources-shapes.html +20 -0
- package/dist/skills/ulw-research/scripts/tests/numeral-classes.ts +196 -0
- package/dist/skills/ulw-research/scripts/tests/report-tools-support.ts +182 -0
- package/dist/skills/ulw-research/scripts/tests/value-mode-support.ts +48 -0
- package/dist/skills/ulw-research/scripts/units.mjs +14 -3
- package/dist/skills/ulw-research/scripts/units.test.ts +10 -0
- package/dist/skills/ulw-research/scripts/value-mode-unit-classes.test.ts +255 -0
- package/dist/skills/ulw-research/scripts/value-mode-unit.test.ts +179 -0
- package/dist/skills/ulw-research/scripts/value-rules-cli.test.ts +157 -0
- package/dist/skills/ulw-research/scripts/value-rules-followups.test.ts +72 -0
- package/dist/skills/ulw-research/scripts/value-rules-priority.test.ts +80 -0
- package/dist/tools/delegate-task/executor-types.d.ts +1 -0
- package/dist/tools/delegate-task/sync-session-existence.d.ts +4 -0
- package/dist/tools/delegate-task/types.d.ts +1 -0
- package/dist/tools/skill/description-formatter.d.ts +2 -1
- package/dist/tools/skill/types.d.ts +6 -0
- package/dist/tui.js +131 -33
- package/package.json +18 -15
- package/packages/git-bash-mcp/package.json +1 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/README.md +1 -1
- 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/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/lcx/skills/lcx-contribute-bug-fix/SKILL.md +51 -55
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-contribute-bug-fix/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-report-bug/SKILL.md +7 -7
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-report-bug/agents/openai.yaml +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 +2 -2
- package/packages/omo-codex/plugin/components/telemetry/README.md +2 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +52 -15
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +52 -19
- 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/telemetry/src/codex-hook.ts +2 -9
- package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +4 -13
- package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +0 -2
- package/packages/omo-codex/plugin/components/telemetry/test/codex-hook-diagnostics.test.ts +0 -3
- package/packages/omo-codex/plugin/components/telemetry/test/codex-hook.test.ts +3 -8
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +3 -0
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/src/directive-content.ts +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/directive.md +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -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 +16 -16
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/shared/package.json +1 -1
- package/packages/omo-codex/plugin/skills/ast-grep/README.md +1 -1
- package/packages/omo-codex/plugin/skills/ast-grep/install.ps1 +5 -3
- package/packages/omo-codex/plugin/skills/ast-grep/install.sh +4 -5
- package/packages/omo-codex/plugin/skills/ast-grep/references/install.md +2 -2
- package/packages/omo-codex/plugin/skills/ast-grep/scripts/ast_grep_helper.py +13 -3
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/AGENTS.md +5 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +11 -11
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +2 -2
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/codex.md +4 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/find-agent-sessions.py +6 -3
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +34 -12
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +2 -2
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +2 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/component-catalogs.md +14 -10
- package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +19 -6
- package/packages/omo-codex/plugin/skills/frontend/references/design/grounding.md +29 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/design_system.py +2 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/search.py +2 -0
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +51 -55
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +7 -7
- package/packages/omo-codex/plugin/skills/lcx-report-bug/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +5 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +2 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/__main__.py +9 -6
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/summary.py +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/extract_cookies.py +4 -2
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +3 -0
- package/packages/omo-codex/plugin/skills/ulw-research/AGENTS.md +8 -4
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +7 -259
- package/packages/omo-codex/plugin/skills/ulw-research/references/deliverable-phase.md +68 -24
- package/packages/omo-codex/plugin/skills/ulw-research/references/fact-ledger-grammar.md +7 -3
- package/packages/omo-codex/plugin/skills/ulw-research/references/fact-ledger.md +42 -8
- package/packages/omo-codex/plugin/skills/ulw-research/references/fidelity-claim-kinds.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/references/markdown-blocks.md +12 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/report-gates.md +14 -6
- package/packages/omo-codex/plugin/skills/ulw-research/references/research-collection.md +195 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/research-delivery.md +123 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/claim-kinds.mjs +33 -5
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/contracts.mjs +16 -15
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/conversion-probe.mjs +229 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/css-hiding.mjs +158 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/css-lite.mjs +4 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/entities.mjs +13 -4
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-fill.mjs +96 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-meaning.mjs +26 -30
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-polish.mjs +46 -19
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-verify.mjs +37 -6
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands.mjs +40 -62
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-derive.mjs +7 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-fill.mjs +9 -6
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-ledger-kinds.mjs +6 -7
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-locate.mjs +15 -9
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-claims.mjs +4 -3
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-csv.mjs +32 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-lexicon.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-originals.mjs +161 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-policy.mjs +183 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-records.mjs +81 -14
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-snapshot-readability.mjs +49 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-sources.mjs +76 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-trace.mjs +25 -11
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-value-unit.mjs +202 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-values.mjs +40 -39
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-fidelity.mjs +8 -6
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-static.mjs +10 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-lite.mjs +6 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-markup.mjs +2 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-text-map.mjs +140 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/markdown-closers.mjs +126 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/md-lite.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/number-grammar.mjs +33 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/numerals.mjs +18 -7
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/outcome-start.mjs +66 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/outcome.mjs +11 -22
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/placeholder.mjs +18 -6
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-apply.mjs +3 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/raw-decode.mjs +110 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/raw-locator.mjs +47 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/report-tools-commands.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/report-tools.mjs +7 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-commands.mjs +87 -29
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-refresh.mjs +82 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-snapshot.mjs +73 -69
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-view.mjs +89 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/sources-citation.mjs +203 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/units.mjs +14 -3
- package/packages/omo-codex/plugin/test/payload-equivalence.test.mjs +6 -4
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +4 -3
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +338 -237
- package/packages/prompts-core/prompts/ultrawork/codex.md +3 -0
- package/packages/shared-skills/skill-source-filter.mjs +6 -2
- package/packages/shared-skills/skills/ast-grep/README.md +1 -1
- package/packages/shared-skills/skills/ast-grep/install.ps1 +5 -3
- package/packages/shared-skills/skills/ast-grep/install.sh +4 -5
- package/packages/shared-skills/skills/ast-grep/references/install.md +2 -2
- package/packages/shared-skills/skills/ast-grep/scripts/ast_grep_helper.py +13 -3
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/AGENTS.md +5 -4
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +11 -11
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +2 -2
- package/packages/shared-skills/skills/coding-agent-sessions/references/codex.md +4 -4
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/find-agent-sessions.py +6 -3
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +1 -1
- package/packages/shared-skills/skills/frontend/SKILL.md +34 -12
- package/packages/shared-skills/skills/frontend/references/design/README.md +2 -2
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +2 -1
- package/packages/shared-skills/skills/frontend/references/design/component-catalogs.md +14 -10
- package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +19 -6
- package/packages/shared-skills/skills/frontend/references/design/grounding.md +29 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/design_system.py +2 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/search.py +2 -0
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +5 -4
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +2 -2
- package/packages/shared-skills/skills/ultimate-browsing/engine/__main__.py +9 -6
- package/packages/shared-skills/skills/ultimate-browsing/engine/summary.py +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/packages/shared-skills/skills/ultimate-browsing/scripts/extract_cookies.py +4 -2
- package/packages/shared-skills/skills/ulw-research/AGENTS.md +8 -4
- package/packages/shared-skills/skills/ulw-research/SKILL.md +7 -259
- package/packages/shared-skills/skills/ulw-research/references/deliverable-phase.md +68 -24
- package/packages/shared-skills/skills/ulw-research/references/fact-ledger-grammar.md +7 -3
- package/packages/shared-skills/skills/ulw-research/references/fact-ledger.md +42 -8
- package/packages/shared-skills/skills/ulw-research/references/fidelity-claim-kinds.md +1 -1
- package/packages/shared-skills/skills/ulw-research/references/markdown-blocks.md +12 -0
- package/packages/shared-skills/skills/ulw-research/references/report-gates.md +14 -6
- package/packages/shared-skills/skills/ulw-research/references/research-collection.md +195 -0
- package/packages/shared-skills/skills/ulw-research/references/research-delivery.md +123 -0
- package/packages/shared-skills/skills/ulw-research/scripts/claim-kinds.mjs +33 -5
- package/packages/shared-skills/skills/ulw-research/scripts/claim-kinds.test.ts +37 -2
- package/packages/shared-skills/skills/ulw-research/scripts/claim-prefix.test.ts +76 -0
- package/packages/shared-skills/skills/ulw-research/scripts/contracts-validation.test.ts +83 -0
- package/packages/shared-skills/skills/ulw-research/scripts/contracts.mjs +16 -15
- package/packages/shared-skills/skills/ulw-research/scripts/contracts.test.ts +6 -109
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-altered.test.ts +154 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-originals.test.ts +297 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-probe-classes.test.ts +361 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-probe.mjs +229 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-probe.test.ts +218 -0
- package/packages/shared-skills/skills/ulw-research/scripts/copy-returns-fidelity-policy.test.ts +156 -0
- package/packages/shared-skills/skills/ulw-research/scripts/copy-returns-polish.test.ts +10 -9
- package/packages/shared-skills/skills/ulw-research/scripts/css-hiding.mjs +158 -0
- package/packages/shared-skills/skills/ulw-research/scripts/css-lite.mjs +4 -2
- package/packages/shared-skills/skills/ulw-research/scripts/delivery-barrier-meaning.test.ts +186 -0
- package/packages/shared-skills/skills/ulw-research/scripts/delivery-barrier.test.ts +40 -87
- package/packages/shared-skills/skills/ulw-research/scripts/entities.mjs +13 -4
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-fill.mjs +96 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-meaning.mjs +26 -30
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-polish.mjs +46 -19
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-verify.mjs +37 -6
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands.mjs +40 -62
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive-2.test.ts +149 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive.mjs +7 -2
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive.test.ts +7 -192
- package/packages/shared-skills/skills/ulw-research/scripts/fact-fill.mjs +9 -6
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-kinds.mjs +6 -7
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-kinds.test.ts +2 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-legacy.test.ts +2 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fact-locate.mjs +15 -9
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-dimensions-2.test.ts +149 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-dimensions.test.ts +4 -168
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-rules.test.ts +3 -229
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-claims.mjs +4 -3
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-csv.mjs +32 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-lexicon.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-originals.mjs +161 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-policy.mjs +183 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-records.mjs +81 -14
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-snapshot-readability.mjs +49 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-sources.mjs +76 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-trace.mjs +25 -11
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-value-unit.mjs +202 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.mjs +40 -39
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.test.ts +8 -29
- package/packages/shared-skills/skills/ulw-research/scripts/gates-fidelity.mjs +8 -6
- package/packages/shared-skills/skills/ulw-research/scripts/gates-static-headings.test.ts +17 -0
- package/packages/shared-skills/skills/ulw-research/scripts/gates-static.mjs +10 -1
- package/packages/shared-skills/skills/ulw-research/scripts/html-lite.mjs +6 -2
- package/packages/shared-skills/skills/ulw-research/scripts/html-markup.mjs +2 -2
- package/packages/shared-skills/skills/ulw-research/scripts/html-text-map.mjs +140 -0
- package/packages/shared-skills/skills/ulw-research/scripts/html-text-map.test.ts +148 -0
- package/packages/shared-skills/skills/ulw-research/scripts/markdown-closers.mjs +126 -0
- package/packages/shared-skills/skills/ulw-research/scripts/md-lite-boundaries.test.ts +46 -0
- package/packages/shared-skills/skills/ulw-research/scripts/md-lite.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/number-grammar.mjs +33 -0
- package/packages/shared-skills/skills/ulw-research/scripts/number-grammar.test.ts +36 -0
- package/packages/shared-skills/skills/ulw-research/scripts/numerals.mjs +18 -7
- package/packages/shared-skills/skills/ulw-research/scripts/numerals.test.ts +3 -0
- package/packages/shared-skills/skills/ulw-research/scripts/outcome-start.mjs +66 -0
- package/packages/shared-skills/skills/ulw-research/scripts/outcome-start.test.ts +109 -0
- package/packages/shared-skills/skills/ulw-research/scripts/outcome.mjs +11 -22
- package/packages/shared-skills/skills/ulw-research/scripts/page-source-locator.test.ts +187 -0
- package/packages/shared-skills/skills/ulw-research/scripts/placeholder.mjs +18 -6
- package/packages/shared-skills/skills/ulw-research/scripts/polish-apply.mjs +3 -2
- package/packages/shared-skills/skills/ulw-research/scripts/polish-markup.test.ts +15 -1
- package/packages/shared-skills/skills/ulw-research/scripts/polish-partial.test.ts +42 -0
- package/packages/shared-skills/skills/ulw-research/scripts/raw-decode.mjs +110 -0
- package/packages/shared-skills/skills/ulw-research/scripts/raw-locator.mjs +47 -0
- package/packages/shared-skills/skills/ulw-research/scripts/raw-snapshot.test.ts +139 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-2.test.ts +233 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-3.test.ts +141 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-4.test.ts +135 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-5.test.ts +231 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-commands.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools.mjs +7 -1
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools.test.ts +6 -560
- package/packages/shared-skills/skills/ulw-research/scripts/snapshot-readability.test.ts +116 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-commands.mjs +87 -29
- package/packages/shared-skills/skills/ulw-research/scripts/source-integrity.test.ts +243 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-refresh.mjs +82 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-snapshot.mjs +73 -69
- package/packages/shared-skills/skills/ulw-research/scripts/source-snapshot.test.ts +7 -4
- package/packages/shared-skills/skills/ulw-research/scripts/source-view.mjs +89 -0
- package/packages/shared-skills/skills/ulw-research/scripts/sources-citation.mjs +203 -0
- package/packages/shared-skills/skills/ulw-research/scripts/sources-citation.test.ts +236 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/contracts-support.ts +147 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/delivery-barrier-session.ts +59 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/derive-clock.ts +4 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fact-derive-support.ts +65 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fact-unit-dimensions-support.ts +41 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fact-unit-rules-support.ts +241 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fidelity-values-support.ts +30 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/conversion-probe.html +14 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/sources-shapes.html +20 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/numeral-classes.ts +196 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/report-tools-support.ts +182 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/value-mode-support.ts +48 -0
- package/packages/shared-skills/skills/ulw-research/scripts/units.mjs +14 -3
- package/packages/shared-skills/skills/ulw-research/scripts/units.test.ts +10 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-mode-unit-classes.test.ts +255 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-mode-unit.test.ts +179 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-rules-cli.test.ts +157 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-rules-followups.test.ts +72 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-rules-priority.test.ts +80 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +0 -7
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +0 -19
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +0 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +0 -1128
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_fetch_chain.py +0 -77
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_stealth.py +0 -86
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +0 -279
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate.py +0 -252
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +0 -78
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// omo-codex-install:
|
|
2
|
+
// omo-codex-install:2cc6bdfa5c18e3ada377e31b95394052d0d763fa5ca10fb77204728c12f8ab45:ea48fd64c2b141e89231f77a680d39339a6c5b336e6b0cfc9d5a100ac79018bd
|
|
3
3
|
var __esm = (fn, res, err) => () => {
|
|
4
4
|
if (fn)
|
|
5
5
|
try {
|
|
@@ -108,9 +108,9 @@ var init_atomic_write = __esm(() => {
|
|
|
108
108
|
|
|
109
109
|
// packages/telemetry-core/src/day-claim.ts
|
|
110
110
|
import { closeSync as closeSync2, mkdirSync as mkdirSync2, openSync as openSync2, readdirSync, rmSync as rmSync2 } from "node:fs";
|
|
111
|
-
import { join as
|
|
111
|
+
import { join as join35 } from "node:path";
|
|
112
112
|
function getTelemetryDayClaimFilePath(stateDir, dayUTC) {
|
|
113
|
-
return
|
|
113
|
+
return join35(stateDir, `${CLAIM_PREFIX}${dayUTC}${CLAIM_SUFFIX}`);
|
|
114
114
|
}
|
|
115
115
|
function claimUtcDay(stateDir, dayUTC) {
|
|
116
116
|
try {
|
|
@@ -136,7 +136,7 @@ function pruneSupersededClaims(stateDir, dayUTC) {
|
|
|
136
136
|
if (!entry.startsWith(CLAIM_PREFIX) || !entry.endsWith(CLAIM_SUFFIX))
|
|
137
137
|
continue;
|
|
138
138
|
try {
|
|
139
|
-
rmSync2(
|
|
139
|
+
rmSync2(join35(stateDir, entry), { force: true });
|
|
140
140
|
} catch {}
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -145,20 +145,20 @@ var init_day_claim = () => {};
|
|
|
145
145
|
|
|
146
146
|
// packages/telemetry-core/src/activity-state.ts
|
|
147
147
|
import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync3 } from "node:fs";
|
|
148
|
-
import { basename as basename6, join as
|
|
148
|
+
import { basename as basename6, join as join36 } from "node:path";
|
|
149
149
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
150
150
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
151
151
|
env: options.env,
|
|
152
152
|
osProvider: options.osProvider
|
|
153
153
|
});
|
|
154
|
-
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined :
|
|
154
|
+
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join36(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
155
155
|
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename6(dataDir) === product.cacheDirName) {
|
|
156
156
|
return dataDir;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return join36(dataDir, product.cacheDirName);
|
|
159
159
|
}
|
|
160
160
|
function getTelemetryActivityStateFilePath(stateDir) {
|
|
161
|
-
return
|
|
161
|
+
return join36(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
|
|
162
162
|
}
|
|
163
163
|
function getDailyActiveCaptureState(input) {
|
|
164
164
|
const dayUTC = getUtcDayString(input.now ?? new Date);
|
|
@@ -242,9 +242,9 @@ var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY =
|
|
|
242
242
|
|
|
243
243
|
// packages/telemetry-core/src/diagnostics.ts
|
|
244
244
|
import { appendFileSync, existsSync as existsSync6, mkdirSync as mkdirSync4, readFileSync as readFileSync4 } from "node:fs";
|
|
245
|
-
import { join as
|
|
245
|
+
import { join as join37 } from "node:path";
|
|
246
246
|
function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
|
|
247
|
-
return
|
|
247
|
+
return join37(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
|
|
248
248
|
}
|
|
249
249
|
function writeTelemetryDiagnostic(input, options) {
|
|
250
250
|
const now = options.now ?? new Date;
|
|
@@ -453,14 +453,10 @@ var init_event_id = __esm(() => {
|
|
|
453
453
|
});
|
|
454
454
|
|
|
455
455
|
// packages/telemetry-core/src/machine-id.ts
|
|
456
|
-
import { createHash as createHash5 } from "node:crypto";
|
|
457
456
|
import os2 from "node:os";
|
|
458
457
|
function getDefaultTelemetryOsProvider() {
|
|
459
458
|
return os2;
|
|
460
459
|
}
|
|
461
|
-
function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
|
|
462
|
-
return createHash5("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
|
|
463
|
-
}
|
|
464
460
|
var init_machine_id = () => {};
|
|
465
461
|
|
|
466
462
|
// packages/telemetry-core/src/injected-client.ts
|
|
@@ -610,7 +606,7 @@ var init_injected_client = __esm(() => {
|
|
|
610
606
|
});
|
|
611
607
|
|
|
612
608
|
// node_modules/.bun/posthog-node@5.52.4/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
613
|
-
import { dirname as dirname11, posix as posix3, sep as
|
|
609
|
+
import { dirname as dirname11, posix as posix3, sep as sep8 } from "node:path";
|
|
614
610
|
function createModulerModifier() {
|
|
615
611
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
616
612
|
return async (frames) => {
|
|
@@ -619,7 +615,7 @@ function createModulerModifier() {
|
|
|
619
615
|
return frames;
|
|
620
616
|
};
|
|
621
617
|
}
|
|
622
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname11(process.argv[1]) : process.cwd(), isWindows =
|
|
618
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname11(process.argv[1]) : process.cwd(), isWindows = sep8 === "\\") {
|
|
623
619
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
624
620
|
return (filename) => {
|
|
625
621
|
if (!filename)
|
|
@@ -6979,16 +6975,16 @@ var init_context_lines_node = __esm(() => {
|
|
|
6979
6975
|
});
|
|
6980
6976
|
|
|
6981
6977
|
// node_modules/.bun/posthog-node@5.52.4/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/relative-path.node.mjs
|
|
6982
|
-
import { isAbsolute as isAbsolute8, relative as
|
|
6978
|
+
import { isAbsolute as isAbsolute8, relative as relative5, sep as sep9 } from "node:path";
|
|
6983
6979
|
function createRelativePathModifier(basePath = process.cwd()) {
|
|
6984
|
-
const isWindows =
|
|
6980
|
+
const isWindows = sep9 === "\\";
|
|
6985
6981
|
const toUnix = (p) => isWindows ? p.replace(/\\/g, "/") : p;
|
|
6986
6982
|
const normalizedBase = toUnix(basePath);
|
|
6987
6983
|
return async (frames) => {
|
|
6988
6984
|
for (const frame of frames)
|
|
6989
6985
|
if (!(!frame.filename || frame.filename.startsWith("node:") || frame.filename.startsWith("data:"))) {
|
|
6990
6986
|
if (isAbsolute8(frame.filename))
|
|
6991
|
-
frame.filename = toUnix(
|
|
6987
|
+
frame.filename = toUnix(relative5(normalizedBase, toUnix(frame.filename)));
|
|
6992
6988
|
}
|
|
6993
6989
|
return frames;
|
|
6994
6990
|
};
|
|
@@ -10086,6 +10082,55 @@ var init_posthog_transport = __esm(() => {
|
|
|
10086
10082
|
// packages/telemetry-core/src/events.ts
|
|
10087
10083
|
var init_events = () => {};
|
|
10088
10084
|
|
|
10085
|
+
// packages/telemetry-core/src/install-id.ts
|
|
10086
|
+
import { createHash as createHash5, randomBytes } from "node:crypto";
|
|
10087
|
+
import { mkdirSync as mkdirSync5, readFileSync as readFileSync5, writeFileSync as writeFileSync2 } from "node:fs";
|
|
10088
|
+
import { dirname as dirname12, join as join38 } from "node:path";
|
|
10089
|
+
function getTelemetryInstallDistinctId(stateDir) {
|
|
10090
|
+
return createHash5("sha256").update(readOrCreateInstallId(join38(stateDir, TELEMETRY_INSTALL_ID_FILE_NAME))).digest("hex");
|
|
10091
|
+
}
|
|
10092
|
+
function readOrCreateInstallId(path) {
|
|
10093
|
+
const persisted = readInstallId(path);
|
|
10094
|
+
if (persisted !== undefined)
|
|
10095
|
+
return persisted;
|
|
10096
|
+
const installId = randomBytes(32).toString("hex");
|
|
10097
|
+
try {
|
|
10098
|
+
mkdirSync5(dirname12(path), { recursive: true });
|
|
10099
|
+
writeFileSync2(path, `${installId}
|
|
10100
|
+
`, { flag: "wx", mode: 384 });
|
|
10101
|
+
fallbackInstallIds.delete(path);
|
|
10102
|
+
return installId;
|
|
10103
|
+
} catch {
|
|
10104
|
+
const concurrentlyCreated = readInstallId(path);
|
|
10105
|
+
if (concurrentlyCreated !== undefined)
|
|
10106
|
+
return concurrentlyCreated;
|
|
10107
|
+
try {
|
|
10108
|
+
writeFileSync2(path, `${installId}
|
|
10109
|
+
`, { flag: "w", mode: 384 });
|
|
10110
|
+
fallbackInstallIds.delete(path);
|
|
10111
|
+
return installId;
|
|
10112
|
+
} catch {}
|
|
10113
|
+
const fallback = fallbackInstallIds.get(path);
|
|
10114
|
+
if (fallback !== undefined)
|
|
10115
|
+
return fallback;
|
|
10116
|
+
fallbackInstallIds.set(path, installId);
|
|
10117
|
+
return installId;
|
|
10118
|
+
}
|
|
10119
|
+
}
|
|
10120
|
+
function readInstallId(path) {
|
|
10121
|
+
try {
|
|
10122
|
+
const value = readFileSync5(path, "utf8").trim();
|
|
10123
|
+
return INSTALL_ID_PATTERN.test(value) ? value : undefined;
|
|
10124
|
+
} catch {
|
|
10125
|
+
return;
|
|
10126
|
+
}
|
|
10127
|
+
}
|
|
10128
|
+
var TELEMETRY_INSTALL_ID_FILE_NAME = "install-id", INSTALL_ID_PATTERN, fallbackInstallIds;
|
|
10129
|
+
var init_install_id = __esm(() => {
|
|
10130
|
+
INSTALL_ID_PATTERN = /^[0-9a-f]{64}$/;
|
|
10131
|
+
fallbackInstallIds = new Map;
|
|
10132
|
+
});
|
|
10133
|
+
|
|
10089
10134
|
// packages/telemetry-core/src/posthog-client.ts
|
|
10090
10135
|
function createTelemetryClient2(input) {
|
|
10091
10136
|
return createTelemetryClient({ ...input, transportFactory: input.transportFactory ?? createDefaultPostHogTransport });
|
|
@@ -10112,6 +10157,7 @@ var init_src = __esm(() => {
|
|
|
10112
10157
|
init_env();
|
|
10113
10158
|
init_event_id();
|
|
10114
10159
|
init_events();
|
|
10160
|
+
init_install_id();
|
|
10115
10161
|
init_machine_id();
|
|
10116
10162
|
init_posthog_client();
|
|
10117
10163
|
init_record_daily_active();
|
|
@@ -10123,7 +10169,7 @@ var package_default;
|
|
|
10123
10169
|
var init_package = __esm(() => {
|
|
10124
10170
|
package_default = {
|
|
10125
10171
|
name: "@oh-my-opencode/omo-codex",
|
|
10126
|
-
version: "5.1.
|
|
10172
|
+
version: "5.1.51",
|
|
10127
10173
|
type: "module",
|
|
10128
10174
|
private: true,
|
|
10129
10175
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -10159,7 +10205,7 @@ var init_package = __esm(() => {
|
|
|
10159
10205
|
"@oh-my-opencode/utils": "workspace:*"
|
|
10160
10206
|
},
|
|
10161
10207
|
devDependencies: {
|
|
10162
|
-
"bun-types": "1.4.
|
|
10208
|
+
"bun-types": "1.4.4"
|
|
10163
10209
|
}
|
|
10164
10210
|
};
|
|
10165
10211
|
});
|
|
@@ -10174,7 +10220,6 @@ function createCodexTelemetryProductConfig(packageVersion = getProductVersion(),
|
|
|
10174
10220
|
defaultApiKey: DEFAULT_POSTHOG_API_KEY,
|
|
10175
10221
|
defaultHost: DEFAULT_POSTHOG_HOST,
|
|
10176
10222
|
eventName: EVENT_NAME,
|
|
10177
|
-
machineIdPrefix: MACHINE_ID_PREFIX,
|
|
10178
10223
|
packageName: PACKAGE_NAME,
|
|
10179
10224
|
packageVersion,
|
|
10180
10225
|
platform: "omo-codex",
|
|
@@ -10189,7 +10234,7 @@ function createCodexTelemetryProductConfig(packageVersion = getProductVersion(),
|
|
|
10189
10234
|
additionalProperties
|
|
10190
10235
|
};
|
|
10191
10236
|
}
|
|
10192
|
-
var PRODUCT_NAME = "omo-codex", PACKAGE_NAME = "@oh-my-opencode/omo-codex", CACHE_DIR_NAME = "omo-codex", EVENT_NAME = "omo_codex_daily_active", PRODUCT_ENV_PREFIX = "OMO_CODEX"
|
|
10237
|
+
var PRODUCT_NAME = "omo-codex", PACKAGE_NAME = "@oh-my-opencode/omo-codex", CACHE_DIR_NAME = "omo-codex", EVENT_NAME = "omo_codex_daily_active", PRODUCT_ENV_PREFIX = "OMO_CODEX";
|
|
10193
10238
|
var init_product_identity = __esm(() => {
|
|
10194
10239
|
init_src();
|
|
10195
10240
|
init_package();
|
|
@@ -10267,7 +10312,7 @@ function createPostHogClient(source, options = {}) {
|
|
|
10267
10312
|
}
|
|
10268
10313
|
const activityStateProvider = resolveActivityStateProvider(options);
|
|
10269
10314
|
return {
|
|
10270
|
-
trackActive: (
|
|
10315
|
+
trackActive: (reason) => {
|
|
10271
10316
|
const activityState = options.stateDir === undefined ? activityStateProvider() : getDailyActiveCaptureState({
|
|
10272
10317
|
diagnostics: writeTelemetryDiagnostic2,
|
|
10273
10318
|
now: options.now,
|
|
@@ -10278,7 +10323,7 @@ function createPostHogClient(source, options = {}) {
|
|
|
10278
10323
|
}
|
|
10279
10324
|
client.trackActive({
|
|
10280
10325
|
dayUTC: activityState.dayUTC,
|
|
10281
|
-
distinctId,
|
|
10326
|
+
distinctId: getTelemetryInstallDistinctId(options.stateDir ?? getActivityStateDir()),
|
|
10282
10327
|
reason
|
|
10283
10328
|
});
|
|
10284
10329
|
},
|
|
@@ -10287,15 +10332,13 @@ function createPostHogClient(source, options = {}) {
|
|
|
10287
10332
|
}
|
|
10288
10333
|
};
|
|
10289
10334
|
}
|
|
10290
|
-
function getPostHogDistinctId() {
|
|
10291
|
-
return getTelemetryDistinctId(MACHINE_ID_PREFIX, resolveOsProvider());
|
|
10292
|
-
}
|
|
10293
10335
|
function createInstallPostHog() {
|
|
10294
10336
|
return createPostHogClient("install");
|
|
10295
10337
|
}
|
|
10296
10338
|
var osProviderOverride2 = null, activityStateProviderOverride = null, transportFactoryOverride = null, NO_OP_POSTHOG;
|
|
10297
10339
|
var init_posthog = __esm(() => {
|
|
10298
10340
|
init_src();
|
|
10341
|
+
init_data_path();
|
|
10299
10342
|
init_diagnostics2();
|
|
10300
10343
|
init_posthog_activity_state();
|
|
10301
10344
|
init_product_identity();
|
|
@@ -10316,7 +10359,7 @@ var init_telemetry = __esm(() => {
|
|
|
10316
10359
|
|
|
10317
10360
|
// packages/omo-codex/src/install/install-local-cli.ts
|
|
10318
10361
|
import { readFile as readFile26 } from "node:fs/promises";
|
|
10319
|
-
import { dirname as
|
|
10362
|
+
import { dirname as dirname14, join as join43, resolve as resolve11 } from "node:path";
|
|
10320
10363
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
10321
10364
|
|
|
10322
10365
|
// packages/utils/src/runtime/spawn.ts
|
|
@@ -10587,7 +10630,7 @@ var defaultRunCommand = async (command, args, options) => {
|
|
|
10587
10630
|
};
|
|
10588
10631
|
|
|
10589
10632
|
// packages/omo-codex/src/install/install-codex.ts
|
|
10590
|
-
import { join as
|
|
10633
|
+
import { join as join39, resolve as resolve10 } from "node:path";
|
|
10591
10634
|
import { existsSync as existsSync7 } from "node:fs";
|
|
10592
10635
|
import { homedir as homedir2 } from "node:os";
|
|
10593
10636
|
|
|
@@ -11141,8 +11184,8 @@ async function existingNonSymlink(path) {
|
|
|
11141
11184
|
}
|
|
11142
11185
|
}
|
|
11143
11186
|
// packages/omo-codex/src/install/codex-cache-install.ts
|
|
11144
|
-
import { cp as
|
|
11145
|
-
import { basename as basename2, dirname as dirname4, join as
|
|
11187
|
+
import { cp as cp3, mkdir as mkdir3, readFile as readFile8, readdir as readdir5, rename as rename2, rm as rm5 } from "node:fs/promises";
|
|
11188
|
+
import { basename as basename2, dirname as dirname4, join as join11, sep as sep6 } from "node:path";
|
|
11146
11189
|
|
|
11147
11190
|
// packages/omo-codex/src/install/codex-cache-bundled-mcps.ts
|
|
11148
11191
|
import { cp, mkdir as mkdir2, readFile as readFile4, stat as stat3 } from "node:fs/promises";
|
|
@@ -11494,9 +11537,66 @@ async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
|
|
|
11494
11537
|
`);
|
|
11495
11538
|
}
|
|
11496
11539
|
|
|
11540
|
+
// packages/omo-codex/src/install/codex-cache-payload.ts
|
|
11541
|
+
import { cp as cp2, lstat as lstat5, mkdtemp, readdir as readdir4, rename, rm as rm4 } from "node:fs/promises";
|
|
11542
|
+
import { join as join9, relative as relative4, sep as sep4 } from "node:path";
|
|
11543
|
+
var NPM_BIN_PATH_SEGMENT = `${sep4}node_modules${sep4}.bin${sep4}`;
|
|
11544
|
+
async function finalizeCachedPluginPayload(pluginRoot) {
|
|
11545
|
+
await materializeDirectory(pluginRoot);
|
|
11546
|
+
const unsupported = await unsupportedEntries(pluginRoot, pluginRoot);
|
|
11547
|
+
if (unsupported.length > 0) {
|
|
11548
|
+
throw new Error(`Codex plugin contains unsupported entry types: ${unsupported.sort().join(", ")}`);
|
|
11549
|
+
}
|
|
11550
|
+
}
|
|
11551
|
+
async function materializeDirectory(directory) {
|
|
11552
|
+
for (const name of await readdir4(directory)) {
|
|
11553
|
+
const path = join9(directory, name);
|
|
11554
|
+
let entry = await lstat5(path);
|
|
11555
|
+
if (path.includes(NPM_BIN_PATH_SEGMENT) && !entry.isFile() && !entry.isDirectory()) {
|
|
11556
|
+
await rm4(path, { recursive: true, force: true });
|
|
11557
|
+
continue;
|
|
11558
|
+
}
|
|
11559
|
+
if (entry.isSymbolicLink()) {
|
|
11560
|
+
const staging = await mkdtemp(join9(directory, ".omo-materialize-"));
|
|
11561
|
+
try {
|
|
11562
|
+
const copyPath = join9(staging, "entry");
|
|
11563
|
+
await cp2(path, copyPath, {
|
|
11564
|
+
recursive: true,
|
|
11565
|
+
dereference: true,
|
|
11566
|
+
filter: async (source) => {
|
|
11567
|
+
if (!source.includes(NPM_BIN_PATH_SEGMENT))
|
|
11568
|
+
return true;
|
|
11569
|
+
const sourceEntry = await lstat5(source);
|
|
11570
|
+
return sourceEntry.isFile() || sourceEntry.isDirectory();
|
|
11571
|
+
}
|
|
11572
|
+
});
|
|
11573
|
+
await rm4(path, { force: true, recursive: true });
|
|
11574
|
+
await rename(copyPath, path);
|
|
11575
|
+
} finally {
|
|
11576
|
+
await rm4(staging, { recursive: true, force: true });
|
|
11577
|
+
}
|
|
11578
|
+
entry = await lstat5(path);
|
|
11579
|
+
}
|
|
11580
|
+
if (entry.isDirectory())
|
|
11581
|
+
await materializeDirectory(path);
|
|
11582
|
+
}
|
|
11583
|
+
}
|
|
11584
|
+
async function unsupportedEntries(root, directory) {
|
|
11585
|
+
const unsupported = [];
|
|
11586
|
+
for (const name of await readdir4(directory)) {
|
|
11587
|
+
const path = join9(directory, name);
|
|
11588
|
+
const entry = await lstat5(path);
|
|
11589
|
+
if (entry.isDirectory())
|
|
11590
|
+
unsupported.push(...await unsupportedEntries(root, path));
|
|
11591
|
+
else if (!entry.isFile())
|
|
11592
|
+
unsupported.push(relative4(root, path));
|
|
11593
|
+
}
|
|
11594
|
+
return unsupported;
|
|
11595
|
+
}
|
|
11596
|
+
|
|
11497
11597
|
// packages/omo-codex/src/install/codex-hook-targets.ts
|
|
11498
11598
|
import { readFile as readFile7 } from "node:fs/promises";
|
|
11499
|
-
import { join as
|
|
11599
|
+
import { join as join10, sep as sep5 } from "node:path";
|
|
11500
11600
|
var PLUGIN_ROOT_TARGET_PATTERN = /\$\{PLUGIN_ROOT\}[\\/]+([^"']+)/g;
|
|
11501
11601
|
async function findMissingHookCommandTargets(pluginRoot) {
|
|
11502
11602
|
const commands = [];
|
|
@@ -11513,7 +11613,7 @@ async function findMissingHookCommandTargets(pluginRoot) {
|
|
|
11513
11613
|
const targetSuffix = match[1];
|
|
11514
11614
|
if (targetSuffix === undefined)
|
|
11515
11615
|
continue;
|
|
11516
|
-
const target =
|
|
11616
|
+
const target = join10(pluginRoot, ...targetSuffix.split(/[\\/]+/));
|
|
11517
11617
|
if (seen.has(target))
|
|
11518
11618
|
continue;
|
|
11519
11619
|
seen.add(target);
|
|
@@ -11524,17 +11624,17 @@ async function findMissingHookCommandTargets(pluginRoot) {
|
|
|
11524
11624
|
return missing;
|
|
11525
11625
|
}
|
|
11526
11626
|
async function hookManifestPaths(pluginRoot) {
|
|
11527
|
-
const pluginManifestPath =
|
|
11627
|
+
const pluginManifestPath = join10(pluginRoot, ".codex-plugin", "plugin.json");
|
|
11528
11628
|
if (!await fileExistsStrict(pluginManifestPath))
|
|
11529
|
-
return [
|
|
11629
|
+
return [join10(pluginRoot, "hooks", "hooks.json")];
|
|
11530
11630
|
const parsed = JSON.parse(await readFile7(pluginManifestPath, "utf8"));
|
|
11531
11631
|
if (!isPlainRecord(parsed))
|
|
11532
11632
|
return [];
|
|
11533
11633
|
if (typeof parsed.hooks === "string" && parsed.hooks.trim() !== "") {
|
|
11534
|
-
return [
|
|
11634
|
+
return [join10(pluginRoot, stripDotSlash(parsed.hooks))];
|
|
11535
11635
|
}
|
|
11536
11636
|
if (Array.isArray(parsed.hooks)) {
|
|
11537
|
-
return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) =>
|
|
11637
|
+
return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) => join10(pluginRoot, stripDotSlash(hookPath)));
|
|
11538
11638
|
}
|
|
11539
11639
|
return [];
|
|
11540
11640
|
}
|
|
@@ -11545,7 +11645,7 @@ async function assertHookCommandTargets(pluginRoot) {
|
|
|
11545
11645
|
const missing = await findMissingHookCommandTargets(pluginRoot);
|
|
11546
11646
|
if (missing.length === 0)
|
|
11547
11647
|
return;
|
|
11548
|
-
const relativeMissing = missing.map((path) => path.split(`${pluginRoot}${
|
|
11648
|
+
const relativeMissing = missing.map((path) => path.split(`${pluginRoot}${sep5}`).join("").split(sep5).join("/"));
|
|
11549
11649
|
throw new Error(`Plugin payload is missing ${missing.length} hook command target(s) referenced by hooks.json: ${relativeMissing.join(", ")}. ` + "The previous plugin cache was left untouched; this payload was not activated.");
|
|
11550
11650
|
}
|
|
11551
11651
|
function collectCommands(value, commands) {
|
|
@@ -11572,9 +11672,9 @@ async function installCachedPlugin(input) {
|
|
|
11572
11672
|
await maybeRunNpmInstall(input.sourcePath, input.runCommand, npmInstallEnv);
|
|
11573
11673
|
await maybeRunNpmBuild(input.sourcePath, input.runCommand, env);
|
|
11574
11674
|
}
|
|
11575
|
-
const targetPath =
|
|
11675
|
+
const targetPath = join11(input.codexHome, "plugins", "cache", input.marketplaceName, input.name, input.version);
|
|
11576
11676
|
const tempPath = createTempSiblingPath(targetPath);
|
|
11577
|
-
await
|
|
11677
|
+
await rm5(tempPath, { recursive: true, force: true });
|
|
11578
11678
|
try {
|
|
11579
11679
|
await copyDirectory(input.sourcePath, tempPath);
|
|
11580
11680
|
const rewroteLocalFileDependencies = await rewriteCachedPackageLocalFileDependencies(tempPath, input.sourcePath);
|
|
@@ -11590,30 +11690,31 @@ async function installCachedPlugin(input) {
|
|
|
11590
11690
|
await rewriteCachedMcpManifest(tempPath, input.sourcePath);
|
|
11591
11691
|
await rewriteCachedManifestRoot(tempPath, tempPath, targetPath);
|
|
11592
11692
|
await assertHookCommandTargets(tempPath);
|
|
11593
|
-
await
|
|
11594
|
-
|
|
11693
|
+
await finalizeCachedPluginPayload(tempPath);
|
|
11694
|
+
await promoteDirectory(tempPath, targetPath, input.renameDirectory ?? rename2);
|
|
11695
|
+
const versions = await readdir5(dirname4(targetPath), { withFileTypes: true });
|
|
11595
11696
|
for (const entry of versions) {
|
|
11596
11697
|
if (!entry.isDirectory() || entry.name === input.version || entry.name.startsWith("."))
|
|
11597
11698
|
continue;
|
|
11598
11699
|
if (!/^[a-zA-Z0-9_+-][a-zA-Z0-9._+-]*$/.test(entry.name))
|
|
11599
11700
|
continue;
|
|
11600
|
-
await
|
|
11701
|
+
await rm5(join11(dirname4(targetPath), entry.name), { recursive: true, force: true });
|
|
11601
11702
|
}
|
|
11602
11703
|
} catch (error) {
|
|
11603
|
-
await
|
|
11704
|
+
await rm5(tempPath, { recursive: true, force: true });
|
|
11604
11705
|
throw error;
|
|
11605
11706
|
}
|
|
11606
11707
|
return { name: input.name, version: input.version, path: targetPath };
|
|
11607
11708
|
}
|
|
11608
11709
|
async function maybeRunNpmInstall(cwd, runCommand, env, args = ["install"]) {
|
|
11609
|
-
if (!await fileExistsStrict(
|
|
11710
|
+
if (!await fileExistsStrict(join11(cwd, "package.json")))
|
|
11610
11711
|
return;
|
|
11611
11712
|
await runCommand("npm", args, { cwd, env });
|
|
11612
11713
|
}
|
|
11613
11714
|
async function maybeRunNpmBuild(cwd, runCommand, env) {
|
|
11614
|
-
if (!await fileExistsStrict(
|
|
11715
|
+
if (!await fileExistsStrict(join11(cwd, "package.json")))
|
|
11615
11716
|
return;
|
|
11616
|
-
const packageJson = JSON.parse(await readFile8(
|
|
11717
|
+
const packageJson = JSON.parse(await readFile8(join11(cwd, "package.json"), "utf8"));
|
|
11617
11718
|
if (!isPlainRecord(packageJson))
|
|
11618
11719
|
return;
|
|
11619
11720
|
const scripts = packageJson.scripts;
|
|
@@ -11622,9 +11723,9 @@ async function maybeRunNpmBuild(cwd, runCommand, env) {
|
|
|
11622
11723
|
await runCommand("npm", ["run", "build"], { cwd, env });
|
|
11623
11724
|
}
|
|
11624
11725
|
async function maybeRunNpmSyncSkills(cwd, runCommand, env) {
|
|
11625
|
-
if (!await fileExistsStrict(
|
|
11726
|
+
if (!await fileExistsStrict(join11(cwd, "package.json")))
|
|
11626
11727
|
return;
|
|
11627
|
-
const packageJson = JSON.parse(await readFile8(
|
|
11728
|
+
const packageJson = JSON.parse(await readFile8(join11(cwd, "package.json"), "utf8"));
|
|
11628
11729
|
if (!isPlainRecord(packageJson))
|
|
11629
11730
|
return;
|
|
11630
11731
|
const scripts = packageJson.scripts;
|
|
@@ -11636,18 +11737,18 @@ function sanitizeNpmInstallEnv(env) {
|
|
|
11636
11737
|
return Object.fromEntries(Object.entries(env).filter(([key]) => key.toLowerCase() !== "npm_config_allow_scripts"));
|
|
11637
11738
|
}
|
|
11638
11739
|
function createTempSiblingPath(targetPath) {
|
|
11639
|
-
return
|
|
11740
|
+
return join11(dirname4(targetPath), `.tmp-${basename2(targetPath)}-${process.pid}-${Date.now()}`);
|
|
11640
11741
|
}
|
|
11641
11742
|
function createBackupSiblingPath(targetPath) {
|
|
11642
|
-
return
|
|
11743
|
+
return join11(dirname4(targetPath), `.backup-${basename2(targetPath)}-${process.pid}-${Date.now()}`);
|
|
11643
11744
|
}
|
|
11644
11745
|
async function copyDirectory(sourcePath, targetPath) {
|
|
11645
11746
|
await mkdir3(dirname4(targetPath), { recursive: true });
|
|
11646
|
-
await
|
|
11747
|
+
await cp3(sourcePath, targetPath, { recursive: true, filter: (source) => shouldCopyPluginPath(source, sourcePath) });
|
|
11647
11748
|
}
|
|
11648
11749
|
async function promoteDirectory(tempPath, targetPath, renameDirectory) {
|
|
11649
11750
|
const backupPath = createBackupSiblingPath(targetPath);
|
|
11650
|
-
await
|
|
11751
|
+
await rm5(backupPath, { recursive: true, force: true });
|
|
11651
11752
|
let backupMoved = false;
|
|
11652
11753
|
try {
|
|
11653
11754
|
if (await fileExistsStrict(targetPath)) {
|
|
@@ -11661,19 +11762,19 @@ async function promoteDirectory(tempPath, targetPath, renameDirectory) {
|
|
|
11661
11762
|
throw error;
|
|
11662
11763
|
}
|
|
11663
11764
|
if (backupMoved)
|
|
11664
|
-
await
|
|
11765
|
+
await rm5(backupPath, { recursive: true, force: true });
|
|
11665
11766
|
}
|
|
11666
11767
|
async function restoreBackupDirectory(backupPath, targetPath, renameDirectory) {
|
|
11667
11768
|
if (!await fileExistsStrict(backupPath))
|
|
11668
11769
|
return;
|
|
11669
|
-
await
|
|
11770
|
+
await rm5(targetPath, { recursive: true, force: true });
|
|
11670
11771
|
await renameDirectory(backupPath, targetPath);
|
|
11671
11772
|
}
|
|
11672
11773
|
function shouldCopyPluginPath(path, root) {
|
|
11673
|
-
const relative = path === root ? "" : path.slice(root.length +
|
|
11774
|
+
const relative = path === root ? "" : path.slice(root.length + sep6.length);
|
|
11674
11775
|
if (relative === "")
|
|
11675
11776
|
return true;
|
|
11676
|
-
const parts = relative.split(
|
|
11777
|
+
const parts = relative.split(sep6);
|
|
11677
11778
|
if (parts.some((part) => part === ".git" || part === "node_modules"))
|
|
11678
11779
|
return false;
|
|
11679
11780
|
return !isNestedComponentMcpManifest(parts);
|
|
@@ -11687,18 +11788,18 @@ var removedSparkshellPromptSurfaceFiles = new Set(["directive.md", "plugin.json"
|
|
|
11687
11788
|
var removedSparkshellTextFilePattern = /\.(?:json|md|toml|ya?ml)$/i;
|
|
11688
11789
|
async function assertNoRemovedSparkshellPromptReferences(pluginRoot) {
|
|
11689
11790
|
for (const filePath of await listRemovedSparkshellPromptSurfaceFiles(pluginRoot, "")) {
|
|
11690
|
-
const content = await readFile8(
|
|
11791
|
+
const content = await readFile8(join11(pluginRoot, filePath), "utf8");
|
|
11691
11792
|
if (!removedSparkshellReferencePattern.test(content))
|
|
11692
11793
|
continue;
|
|
11693
11794
|
throw new Error(`removed sparkshell reference found in Codex plugin prompt surface: ${filePath}`);
|
|
11694
11795
|
}
|
|
11695
11796
|
}
|
|
11696
11797
|
async function listRemovedSparkshellPromptSurfaceFiles(pluginRoot, relativeDirectory) {
|
|
11697
|
-
const directory = relativeDirectory === "" ? pluginRoot :
|
|
11698
|
-
const entries = await
|
|
11798
|
+
const directory = relativeDirectory === "" ? pluginRoot : join11(pluginRoot, relativeDirectory);
|
|
11799
|
+
const entries = await readdir5(directory, { withFileTypes: true });
|
|
11699
11800
|
const files = [];
|
|
11700
11801
|
for (const entry of entries) {
|
|
11701
|
-
const relativePath = relativeDirectory === "" ? entry.name :
|
|
11802
|
+
const relativePath = relativeDirectory === "" ? entry.name : join11(relativeDirectory, entry.name);
|
|
11702
11803
|
if (entry.isDirectory()) {
|
|
11703
11804
|
if (shouldDescendIntoRemovedSparkshellPromptSurface(relativePath)) {
|
|
11704
11805
|
files.push(...await listRemovedSparkshellPromptSurfaceFiles(pluginRoot, relativePath));
|
|
@@ -11711,7 +11812,7 @@ async function listRemovedSparkshellPromptSurfaceFiles(pluginRoot, relativeDirec
|
|
|
11711
11812
|
return files.sort();
|
|
11712
11813
|
}
|
|
11713
11814
|
function shouldDescendIntoRemovedSparkshellPromptSurface(relativePath) {
|
|
11714
|
-
const parts = relativePath.split(
|
|
11815
|
+
const parts = relativePath.split(sep6);
|
|
11715
11816
|
if (parts.some((part) => part === ".git" || part === "dist" || part === "node_modules"))
|
|
11716
11817
|
return false;
|
|
11717
11818
|
if (parts[0] === "components") {
|
|
@@ -11724,7 +11825,7 @@ function shouldDescendIntoRemovedSparkshellPromptSurface(relativePath) {
|
|
|
11724
11825
|
function shouldCheckRemovedSparkshellPromptFile(relativePath) {
|
|
11725
11826
|
if (!removedSparkshellTextFilePattern.test(relativePath))
|
|
11726
11827
|
return false;
|
|
11727
|
-
const parts = relativePath.split(
|
|
11828
|
+
const parts = relativePath.split(sep6);
|
|
11728
11829
|
const fileName = parts.at(-1) ?? "";
|
|
11729
11830
|
if (parts[0] === "components") {
|
|
11730
11831
|
if (parts.length === 3)
|
|
@@ -11738,25 +11839,25 @@ async function copyRootRuntimeDists(input) {
|
|
|
11738
11839
|
if (repoRoot === null)
|
|
11739
11840
|
return;
|
|
11740
11841
|
for (const runtimePath of ["dist/cli", "dist/cli-node"]) {
|
|
11741
|
-
const sourcePath =
|
|
11742
|
-
if (!await fileExistsStrict(
|
|
11842
|
+
const sourcePath = join11(repoRoot, runtimePath);
|
|
11843
|
+
if (!await fileExistsStrict(join11(sourcePath, "index.js")))
|
|
11743
11844
|
continue;
|
|
11744
|
-
await mkdir3(dirname4(
|
|
11745
|
-
await
|
|
11845
|
+
await mkdir3(dirname4(join11(input.pluginRoot, runtimePath)), { recursive: true });
|
|
11846
|
+
await cp3(sourcePath, join11(input.pluginRoot, runtimePath), { recursive: true });
|
|
11746
11847
|
}
|
|
11747
11848
|
}
|
|
11748
|
-
var canonicalPromptRelativePaths = [
|
|
11849
|
+
var canonicalPromptRelativePaths = [join11("packages", "prompts-core", "prompts", "ultrawork", "codex.md")];
|
|
11749
11850
|
async function copyCanonicalPromptSources(input) {
|
|
11750
11851
|
const repoRoot = repoRootForCodexPluginSource(input.sourcePath);
|
|
11751
11852
|
if (repoRoot === null)
|
|
11752
11853
|
return;
|
|
11753
11854
|
for (const relativePath of canonicalPromptRelativePaths) {
|
|
11754
|
-
const sourceFile =
|
|
11855
|
+
const sourceFile = join11(repoRoot, relativePath);
|
|
11755
11856
|
if (!await fileExistsStrict(sourceFile))
|
|
11756
11857
|
continue;
|
|
11757
|
-
const targetFile =
|
|
11858
|
+
const targetFile = join11(input.pluginRoot, relativePath);
|
|
11758
11859
|
await mkdir3(dirname4(targetFile), { recursive: true });
|
|
11759
|
-
await
|
|
11860
|
+
await cp3(sourceFile, targetFile);
|
|
11760
11861
|
}
|
|
11761
11862
|
}
|
|
11762
11863
|
function repoRootForCodexPluginSource(sourcePath) {
|
|
@@ -11771,10 +11872,10 @@ function repoRootForCodexPluginSource(sourcePath) {
|
|
|
11771
11872
|
return dirname4(packagesRoot);
|
|
11772
11873
|
}
|
|
11773
11874
|
// packages/omo-codex/src/install/codex-cache-prune.ts
|
|
11774
|
-
import { lstat as
|
|
11775
|
-
import { join as
|
|
11875
|
+
import { lstat as lstat6, readdir as readdir6, rm as rm6, stat as stat4 } from "node:fs/promises";
|
|
11876
|
+
import { join as join12 } from "node:path";
|
|
11776
11877
|
async function pruneMarketplaceCache(input) {
|
|
11777
|
-
const cacheRoot =
|
|
11878
|
+
const cacheRoot = join12(input.codexHome, "plugins", "cache", input.marketplaceName);
|
|
11778
11879
|
if (!await fileExistsStrict(cacheRoot))
|
|
11779
11880
|
return;
|
|
11780
11881
|
const keep = new Set(input.keepPluginNames);
|
|
@@ -11782,28 +11883,28 @@ async function pruneMarketplaceCache(input) {
|
|
|
11782
11883
|
for (const entry of entries) {
|
|
11783
11884
|
if (!entry.isDirectory() || keep.has(entry.name))
|
|
11784
11885
|
continue;
|
|
11785
|
-
await
|
|
11886
|
+
await rm6(join12(cacheRoot, entry.name), { recursive: true, force: true });
|
|
11786
11887
|
}
|
|
11787
11888
|
}
|
|
11788
11889
|
async function pruneMarketplacePluginCaches(input) {
|
|
11789
|
-
const cacheRoot =
|
|
11890
|
+
const cacheRoot = join12(input.codexHome, "plugins", "cache", input.marketplaceName);
|
|
11790
11891
|
if (!await fileExistsStrict(cacheRoot))
|
|
11791
11892
|
return;
|
|
11792
11893
|
for (const pluginName of input.pluginNames) {
|
|
11793
|
-
await
|
|
11894
|
+
await rm6(join12(cacheRoot, pluginName), { recursive: true, force: true });
|
|
11794
11895
|
}
|
|
11795
11896
|
const remainingEntries = await readCacheEntryNames(cacheRoot);
|
|
11796
11897
|
if (remainingEntries.length === 0) {
|
|
11797
|
-
await
|
|
11898
|
+
await rm6(cacheRoot, { recursive: true, force: true });
|
|
11798
11899
|
}
|
|
11799
11900
|
}
|
|
11800
11901
|
async function readCacheEntries(path) {
|
|
11801
11902
|
const emptyEntries = [];
|
|
11802
|
-
return readCacheRoot(path, () =>
|
|
11903
|
+
return readCacheRoot(path, () => readdir6(path, { withFileTypes: true }), emptyEntries);
|
|
11803
11904
|
}
|
|
11804
11905
|
async function readCacheEntryNames(path) {
|
|
11805
11906
|
const emptyNames = [];
|
|
11806
|
-
return readCacheRoot(path, () =>
|
|
11907
|
+
return readCacheRoot(path, () => readdir6(path), emptyNames);
|
|
11807
11908
|
}
|
|
11808
11909
|
async function readCacheRoot(path, readEntries, fallback) {
|
|
11809
11910
|
try {
|
|
@@ -11818,7 +11919,7 @@ async function readCacheRoot(path, readEntries, fallback) {
|
|
|
11818
11919
|
}
|
|
11819
11920
|
async function isBrokenCacheSymlink(path) {
|
|
11820
11921
|
try {
|
|
11821
|
-
const entry = await
|
|
11922
|
+
const entry = await lstat6(path);
|
|
11822
11923
|
if (!entry.isSymbolicLink())
|
|
11823
11924
|
return false;
|
|
11824
11925
|
} catch (error) {
|
|
@@ -11836,18 +11937,18 @@ async function isBrokenCacheSymlink(path) {
|
|
|
11836
11937
|
}
|
|
11837
11938
|
}
|
|
11838
11939
|
// packages/omo-codex/src/install/codex-cached-marketplace-manifest.ts
|
|
11839
|
-
import { mkdir as mkdir4, rename as
|
|
11840
|
-
import { join as
|
|
11940
|
+
import { mkdir as mkdir4, rename as rename3, rm as rm7, stat as stat5, writeFile as writeFile4 } from "node:fs/promises";
|
|
11941
|
+
import { join as join13 } from "node:path";
|
|
11841
11942
|
async function writeCachedMarketplaceManifest(input) {
|
|
11842
|
-
const marketplaceDir =
|
|
11943
|
+
const marketplaceDir = join13(input.marketplaceRoot, ".agents", "plugins");
|
|
11843
11944
|
await mkdir4(marketplaceDir, { recursive: true });
|
|
11844
11945
|
for (const plugin of input.plugins) {
|
|
11845
|
-
const pluginPath =
|
|
11946
|
+
const pluginPath = join13(input.marketplaceRoot, plugin.name, plugin.version);
|
|
11846
11947
|
if (!await isDirectory2(pluginPath))
|
|
11847
11948
|
throw new Error(`Cannot write cached marketplace manifest: ${pluginPath} does not exist`);
|
|
11848
11949
|
}
|
|
11849
|
-
const manifestPath =
|
|
11850
|
-
const tempPath =
|
|
11950
|
+
const manifestPath = join13(marketplaceDir, "marketplace.json");
|
|
11951
|
+
const tempPath = join13(marketplaceDir, `.marketplace.json.tmp-${process.pid}-${Date.now()}`);
|
|
11851
11952
|
try {
|
|
11852
11953
|
await writeFile4(tempPath, `${JSON.stringify({
|
|
11853
11954
|
name: input.marketplaceName,
|
|
@@ -11857,9 +11958,9 @@ async function writeCachedMarketplaceManifest(input) {
|
|
|
11857
11958
|
}))
|
|
11858
11959
|
}, null, "\t")}
|
|
11859
11960
|
`);
|
|
11860
|
-
await
|
|
11961
|
+
await rename3(tempPath, manifestPath);
|
|
11861
11962
|
} catch (error) {
|
|
11862
|
-
await
|
|
11963
|
+
await rm7(tempPath, { force: true });
|
|
11863
11964
|
throw error;
|
|
11864
11965
|
}
|
|
11865
11966
|
}
|
|
@@ -11876,7 +11977,7 @@ async function isDirectory2(path) {
|
|
|
11876
11977
|
// packages/omo-codex/src/install/codex-package-layout.ts
|
|
11877
11978
|
import { existsSync as existsSync2 } from "node:fs";
|
|
11878
11979
|
import { readFile as readFile9 } from "node:fs/promises";
|
|
11879
|
-
import { join as
|
|
11980
|
+
import { join as join14 } from "node:path";
|
|
11880
11981
|
var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
|
|
11881
11982
|
"@code-yeongyu/lazycodex",
|
|
11882
11983
|
"@code-yeongyu/lazycodex-ai",
|
|
@@ -11886,9 +11987,9 @@ var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
|
|
|
11886
11987
|
"oh-my-openagent"
|
|
11887
11988
|
]);
|
|
11888
11989
|
async function shouldBuildSourcePackages(repoRoot) {
|
|
11889
|
-
if (existsSync2(
|
|
11990
|
+
if (existsSync2(join14(repoRoot, "packages", "omo-opencode", "src", "index.ts")))
|
|
11890
11991
|
return true;
|
|
11891
|
-
const packageJsonPath =
|
|
11992
|
+
const packageJsonPath = join14(repoRoot, "package.json");
|
|
11892
11993
|
if (!existsSync2(packageJsonPath))
|
|
11893
11994
|
return true;
|
|
11894
11995
|
const packageJson = JSON.parse(await readFile9(packageJsonPath, "utf8"));
|
|
@@ -12495,13 +12596,13 @@ function tomlKeySegment(value) {
|
|
|
12495
12596
|
}
|
|
12496
12597
|
|
|
12497
12598
|
// packages/omo-codex/src/install/codex-config-atomic-write.ts
|
|
12498
|
-
import { lstat as
|
|
12499
|
-
import { basename as basename3, dirname as dirname5, isAbsolute as isAbsolute5, join as
|
|
12599
|
+
import { lstat as lstat7, readlink as readlink4, realpath, rename as rename4, unlink, writeFile as writeFile5 } from "node:fs/promises";
|
|
12600
|
+
import { basename as basename3, dirname as dirname5, isAbsolute as isAbsolute5, join as join15, resolve as resolve6 } from "node:path";
|
|
12500
12601
|
var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
|
|
12501
12602
|
var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
|
|
12502
12603
|
async function writeFileAtomic(targetPath, data) {
|
|
12503
12604
|
const writeTarget = await resolveSymlinkTarget(targetPath);
|
|
12504
|
-
const temporaryPath =
|
|
12605
|
+
const temporaryPath = join15(dirname5(writeTarget), `.tmp-${basename3(writeTarget)}-${process.pid}-${Date.now()}`);
|
|
12505
12606
|
await writeFile5(temporaryPath, data);
|
|
12506
12607
|
try {
|
|
12507
12608
|
await renameWithRetry(temporaryPath, writeTarget);
|
|
@@ -12516,7 +12617,7 @@ async function writeFileAtomic(targetPath, data) {
|
|
|
12516
12617
|
}
|
|
12517
12618
|
async function resolveSymlinkTarget(targetPath) {
|
|
12518
12619
|
try {
|
|
12519
|
-
const linkStats = await
|
|
12620
|
+
const linkStats = await lstat7(targetPath);
|
|
12520
12621
|
if (!linkStats.isSymbolicLink())
|
|
12521
12622
|
return targetPath;
|
|
12522
12623
|
} catch (error) {
|
|
@@ -12536,7 +12637,7 @@ async function resolveSymlinkTarget(targetPath) {
|
|
|
12536
12637
|
async function renameWithRetry(fromPath, toPath) {
|
|
12537
12638
|
for (let attempt = 0;; attempt += 1) {
|
|
12538
12639
|
try {
|
|
12539
|
-
await
|
|
12640
|
+
await rename4(fromPath, toPath);
|
|
12540
12641
|
return;
|
|
12541
12642
|
} catch (error) {
|
|
12542
12643
|
if (!isRetriableRenameError(error) || attempt >= RENAME_RETRY_DELAYS_MS.length) {
|
|
@@ -13001,7 +13102,7 @@ function isRootSetting(line, key) {
|
|
|
13001
13102
|
|
|
13002
13103
|
// packages/omo-codex/src/install/codex-model-catalog.ts
|
|
13003
13104
|
import { readFile as readFile10 } from "node:fs/promises";
|
|
13004
|
-
import { join as
|
|
13105
|
+
import { join as join16 } from "node:path";
|
|
13005
13106
|
|
|
13006
13107
|
// packages/model-core/src/latest-models.ts
|
|
13007
13108
|
var LATEST_MODEL_BY_FAMILY = {
|
|
@@ -13050,7 +13151,7 @@ var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
|
13050
13151
|
]
|
|
13051
13152
|
};
|
|
13052
13153
|
async function readCodexModelCatalog(codexPackageRoot) {
|
|
13053
|
-
const catalogPath =
|
|
13154
|
+
const catalogPath = join16(codexPackageRoot, "plugin", "model-catalog.json");
|
|
13054
13155
|
try {
|
|
13055
13156
|
const parsed = JSON.parse(await readFile10(catalogPath, "utf8"));
|
|
13056
13157
|
return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
|
|
@@ -13134,7 +13235,7 @@ function isRootSetting2(line, key) {
|
|
|
13134
13235
|
|
|
13135
13236
|
// packages/omo-codex/src/install/codex-multi-agent-v2-config.ts
|
|
13136
13237
|
import { readFileSync } from "node:fs";
|
|
13137
|
-
import { dirname as dirname6, isAbsolute as isAbsolute6, join as
|
|
13238
|
+
import { dirname as dirname6, isAbsolute as isAbsolute6, join as join17 } from "node:path";
|
|
13138
13239
|
var CODEX_AGENTS_HEADER = "agents";
|
|
13139
13240
|
var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
|
|
13140
13241
|
function ensureCodexMultiAgentV2Config(config, options = {}) {
|
|
@@ -13162,8 +13263,8 @@ function resolveCodexMultiAgentVersion(config, configPath) {
|
|
|
13162
13263
|
}
|
|
13163
13264
|
function resolveCatalogPath(configuredPath, configPath) {
|
|
13164
13265
|
if (configuredPath === null)
|
|
13165
|
-
return
|
|
13166
|
-
return isAbsolute6(configuredPath) ? configuredPath :
|
|
13266
|
+
return join17(dirname6(configPath), "models_cache.json");
|
|
13267
|
+
return isAbsolute6(configuredPath) ? configuredPath : join17(dirname6(configPath), configuredPath);
|
|
13167
13268
|
}
|
|
13168
13269
|
function readCatalogMultiAgentVersion(model, cachePath) {
|
|
13169
13270
|
let raw;
|
|
@@ -13326,7 +13427,7 @@ function isMissingFileError(error) {
|
|
|
13326
13427
|
// packages/omo-codex/src/install/codex-hook-trust.ts
|
|
13327
13428
|
import { createHash } from "node:crypto";
|
|
13328
13429
|
import { readFile as readFile12 } from "node:fs/promises";
|
|
13329
|
-
import { join as
|
|
13430
|
+
import { join as join18 } from "node:path";
|
|
13330
13431
|
var EVENT_LABELS = new Map([
|
|
13331
13432
|
["PreToolUse", "pre_tool_use"],
|
|
13332
13433
|
["PermissionRequest", "permission_request"],
|
|
@@ -13340,7 +13441,7 @@ var EVENT_LABELS = new Map([
|
|
|
13340
13441
|
["Stop", "stop"]
|
|
13341
13442
|
]);
|
|
13342
13443
|
async function trustedHookStatesForPlugin(input) {
|
|
13343
|
-
const manifestPath =
|
|
13444
|
+
const manifestPath = join18(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
13344
13445
|
if (!await exists(manifestPath))
|
|
13345
13446
|
return [];
|
|
13346
13447
|
const manifest = JSON.parse(await readFile12(manifestPath, "utf8"));
|
|
@@ -13348,7 +13449,7 @@ async function trustedHookStatesForPlugin(input) {
|
|
|
13348
13449
|
return [];
|
|
13349
13450
|
const states = [];
|
|
13350
13451
|
for (const hookPath of hookManifestPaths2(manifest.hooks)) {
|
|
13351
|
-
const hooksPath =
|
|
13452
|
+
const hooksPath = join18(input.pluginRoot, hookPath);
|
|
13352
13453
|
if (!await exists(hooksPath))
|
|
13353
13454
|
continue;
|
|
13354
13455
|
const parsed = JSON.parse(await readFile12(hooksPath, "utf8"));
|
|
@@ -21524,7 +21625,7 @@ function validateConfigLayer(path, data) {
|
|
|
21524
21625
|
|
|
21525
21626
|
// packages/omo-config-core/src/loader/paths.ts
|
|
21526
21627
|
import { userInfo } from "node:os";
|
|
21527
|
-
import { dirname as dirname8, join as
|
|
21628
|
+
import { dirname as dirname8, join as join19, posix, resolve as resolve7 } from "node:path";
|
|
21528
21629
|
|
|
21529
21630
|
// packages/omo-config-core/src/internal/posix-path.ts
|
|
21530
21631
|
function toPosixPath2(path) {
|
|
@@ -21539,14 +21640,14 @@ function resolveHomeDir(env = process.env) {
|
|
|
21539
21640
|
return homeDir.startsWith("/") ? posix.resolve(homeDir) : toPosixPath2(resolve7(homeDir));
|
|
21540
21641
|
}
|
|
21541
21642
|
function resolveUserOmoConfigDirectory(env = process.env) {
|
|
21542
|
-
return
|
|
21643
|
+
return join19(resolveHomeDir(env), ".omo");
|
|
21543
21644
|
}
|
|
21544
21645
|
function detectUserOmoJsonPath(env, fileSystem) {
|
|
21545
21646
|
const configDir = resolveUserOmoConfigDirectory(env);
|
|
21546
|
-
const jsoncPath =
|
|
21647
|
+
const jsoncPath = join19(configDir, "omo.jsonc");
|
|
21547
21648
|
if (fileSystem.existsSync(jsoncPath))
|
|
21548
21649
|
return jsoncPath;
|
|
21549
|
-
const jsonPath =
|
|
21650
|
+
const jsonPath = join19(configDir, "omo.json");
|
|
21550
21651
|
return fileSystem.existsSync(jsonPath) ? jsonPath : jsoncPath;
|
|
21551
21652
|
}
|
|
21552
21653
|
function isSymlinkedProjectPath(path, fileSystem) {
|
|
@@ -21564,13 +21665,13 @@ function isLoadableProjectConfigFile(path, fileSystem) {
|
|
|
21564
21665
|
return fileSystem.existsSync(path) && !isSymlinkedProjectPath(path, fileSystem);
|
|
21565
21666
|
}
|
|
21566
21667
|
function detectOmoJsonPath(dir, fileSystem) {
|
|
21567
|
-
const omoDir =
|
|
21668
|
+
const omoDir = join19(dir, ".omo");
|
|
21568
21669
|
if (isSymlinkedProjectPath(omoDir, fileSystem))
|
|
21569
21670
|
return null;
|
|
21570
|
-
const jsoncPath =
|
|
21671
|
+
const jsoncPath = join19(omoDir, "omo.jsonc");
|
|
21571
21672
|
if (isLoadableProjectConfigFile(jsoncPath, fileSystem))
|
|
21572
21673
|
return jsoncPath;
|
|
21573
|
-
const jsonPath =
|
|
21674
|
+
const jsonPath = join19(omoDir, "omo.json");
|
|
21574
21675
|
return isLoadableProjectConfigFile(jsonPath, fileSystem) ? jsonPath : null;
|
|
21575
21676
|
}
|
|
21576
21677
|
function realpathOrSelf(path, fileSystem) {
|
|
@@ -21890,8 +21991,8 @@ function recordAt(value, key) {
|
|
|
21890
21991
|
}
|
|
21891
21992
|
|
|
21892
21993
|
// packages/omo-codex/src/install/codex-marketplace-snapshot.ts
|
|
21893
|
-
import { cp as
|
|
21894
|
-
import { join as
|
|
21994
|
+
import { cp as cp4, mkdir as mkdir6, rename as rename5, rm as rm8, writeFile as writeFile6 } from "node:fs/promises";
|
|
21995
|
+
import { join as join20, sep as sep7 } from "node:path";
|
|
21895
21996
|
var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
|
|
21896
21997
|
async function writeInstalledMarketplaceSnapshot(input) {
|
|
21897
21998
|
const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
|
|
@@ -21904,51 +22005,51 @@ async function writeInstalledMarketplaceSnapshot(input) {
|
|
|
21904
22005
|
return snapshotPlugins;
|
|
21905
22006
|
}
|
|
21906
22007
|
function installedMarketplaceRoot(codexHome, marketplaceName) {
|
|
21907
|
-
return
|
|
22008
|
+
return join20(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
|
|
21908
22009
|
}
|
|
21909
22010
|
async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
|
|
21910
|
-
const manifestDir =
|
|
22011
|
+
const manifestDir = join20(marketplaceRoot, ".agents", "plugins");
|
|
21911
22012
|
await mkdir6(manifestDir, { recursive: true });
|
|
21912
|
-
const tempPath =
|
|
22013
|
+
const tempPath = join20(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
|
|
21913
22014
|
await writeFile6(tempPath, `${JSON.stringify(marketplace, null, "\t")}
|
|
21914
22015
|
`);
|
|
21915
|
-
await
|
|
22016
|
+
await rename5(tempPath, join20(manifestDir, "marketplace.json"));
|
|
21916
22017
|
}
|
|
21917
22018
|
async function writeSnapshotPlugin(marketplaceRoot, plugin) {
|
|
21918
|
-
const pluginsDir =
|
|
22019
|
+
const pluginsDir = join20(marketplaceRoot, "plugins");
|
|
21919
22020
|
await mkdir6(pluginsDir, { recursive: true });
|
|
21920
|
-
const targetPath =
|
|
21921
|
-
const tempPath =
|
|
21922
|
-
await
|
|
21923
|
-
await
|
|
22021
|
+
const targetPath = join20(pluginsDir, plugin.name);
|
|
22022
|
+
const tempPath = join20(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
|
|
22023
|
+
await rm8(tempPath, { recursive: true, force: true });
|
|
22024
|
+
await cp4(plugin.sourcePath, tempPath, {
|
|
21924
22025
|
recursive: true,
|
|
21925
22026
|
filter: (source) => shouldCopyMarketplaceSourcePath(source, plugin.sourcePath)
|
|
21926
22027
|
});
|
|
21927
22028
|
await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: plugin.sourcePath });
|
|
21928
|
-
await
|
|
21929
|
-
await
|
|
22029
|
+
await rm8(targetPath, { recursive: true, force: true });
|
|
22030
|
+
await rename5(tempPath, targetPath);
|
|
21930
22031
|
await rewriteCachedMcpManifest(targetPath, plugin.sourcePath);
|
|
21931
22032
|
return { name: plugin.name, path: targetPath };
|
|
21932
22033
|
}
|
|
21933
22034
|
function shouldCopyMarketplaceSourcePath(path, root) {
|
|
21934
|
-
const relative = path === root ? "" : path.slice(root.length +
|
|
22035
|
+
const relative = path === root ? "" : path.slice(root.length + sep7.length);
|
|
21935
22036
|
if (relative === "")
|
|
21936
22037
|
return true;
|
|
21937
|
-
const parts = relative.split(
|
|
22038
|
+
const parts = relative.split(sep7);
|
|
21938
22039
|
return !parts.some((part) => part === ".git" || part === "node_modules");
|
|
21939
22040
|
}
|
|
21940
22041
|
|
|
21941
22042
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
21942
|
-
import { copyFile, lstat as
|
|
21943
|
-
import { basename as basename4, join as
|
|
22043
|
+
import { copyFile, lstat as lstat11, mkdir as mkdir7, readdir as readdir8, readFile as readFile17, rm as rm12, writeFile as writeFile9 } from "node:fs/promises";
|
|
22044
|
+
import { basename as basename4, join as join25 } from "node:path";
|
|
21944
22045
|
|
|
21945
22046
|
// packages/omo-codex/src/install/agent-model-overrides.ts
|
|
21946
|
-
import { readFile as readFile14, rm as
|
|
21947
|
-
import { join as
|
|
22047
|
+
import { readFile as readFile14, rm as rm9, writeFile as writeFile8 } from "node:fs/promises";
|
|
22048
|
+
import { join as join22 } from "node:path";
|
|
21948
22049
|
|
|
21949
22050
|
// packages/omo-codex/src/install/preserved-agent-settings.ts
|
|
21950
|
-
import { lstat as
|
|
21951
|
-
import { join as
|
|
22051
|
+
import { lstat as lstat8, readFile as readFile13, readdir as readdir7, writeFile as writeFile7 } from "node:fs/promises";
|
|
22052
|
+
import { join as join21 } from "node:path";
|
|
21952
22053
|
|
|
21953
22054
|
// packages/omo-codex/src/install/managed-agent-reasoning-defaults.ts
|
|
21954
22055
|
var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
@@ -22141,15 +22242,15 @@ function resolveManagedAgentReasoning(input) {
|
|
|
22141
22242
|
|
|
22142
22243
|
// packages/omo-codex/src/install/preserved-agent-settings.ts
|
|
22143
22244
|
async function capturePreservedAgentReasoning(input) {
|
|
22144
|
-
const agentsDir =
|
|
22245
|
+
const agentsDir = join21(input.codexHome, "agents");
|
|
22145
22246
|
if (!await exists2(agentsDir))
|
|
22146
22247
|
return new Map;
|
|
22147
22248
|
const preserved = new Map;
|
|
22148
|
-
const agentEntries = await
|
|
22249
|
+
const agentEntries = await readdir7(agentsDir, { withFileTypes: true });
|
|
22149
22250
|
for (const entry of agentEntries) {
|
|
22150
22251
|
if (!entry.name.endsWith(".toml"))
|
|
22151
22252
|
continue;
|
|
22152
|
-
const content = await readTextIfExists(
|
|
22253
|
+
const content = await readTextIfExists(join21(agentsDir, entry.name));
|
|
22153
22254
|
if (content === null)
|
|
22154
22255
|
continue;
|
|
22155
22256
|
const effort = extractReasoningEffort(content);
|
|
@@ -22163,15 +22264,15 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
22163
22264
|
return preserved;
|
|
22164
22265
|
}
|
|
22165
22266
|
async function capturePreservedAgentServiceTier(input) {
|
|
22166
|
-
const agentsDir =
|
|
22267
|
+
const agentsDir = join21(input.codexHome, "agents");
|
|
22167
22268
|
if (!await exists2(agentsDir))
|
|
22168
22269
|
return new Map;
|
|
22169
22270
|
const preserved = new Map;
|
|
22170
|
-
const agentEntries = await
|
|
22271
|
+
const agentEntries = await readdir7(agentsDir, { withFileTypes: true });
|
|
22171
22272
|
for (const entry of agentEntries) {
|
|
22172
22273
|
if (!entry.name.endsWith(".toml"))
|
|
22173
22274
|
continue;
|
|
22174
|
-
const content = await readTextIfExists(
|
|
22275
|
+
const content = await readTextIfExists(join21(agentsDir, entry.name));
|
|
22175
22276
|
if (content === null)
|
|
22176
22277
|
continue;
|
|
22177
22278
|
preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
|
|
@@ -22300,7 +22401,7 @@ function agentNameFromToml(fileName) {
|
|
|
22300
22401
|
}
|
|
22301
22402
|
async function exists2(path) {
|
|
22302
22403
|
try {
|
|
22303
|
-
await
|
|
22404
|
+
await lstat8(path);
|
|
22304
22405
|
return true;
|
|
22305
22406
|
} catch (error) {
|
|
22306
22407
|
if (nodeErrorCode(error) !== "ENOENT")
|
|
@@ -22339,7 +22440,7 @@ async function readAgentModelReceipts(codexHome) {
|
|
|
22339
22440
|
async function writeAgentModelReceipts(codexHome, receipts) {
|
|
22340
22441
|
const path = receiptPath(codexHome);
|
|
22341
22442
|
if (receipts.size === 0) {
|
|
22342
|
-
await
|
|
22443
|
+
await rm9(path, { force: true });
|
|
22343
22444
|
return;
|
|
22344
22445
|
}
|
|
22345
22446
|
await writeFile8(path, `${JSON.stringify(Object.fromEntries(receipts), null, "\t")}
|
|
@@ -22360,7 +22461,7 @@ async function applyAgentOverride(input) {
|
|
|
22360
22461
|
await writeFile8(input.linkPath, content);
|
|
22361
22462
|
}
|
|
22362
22463
|
function receiptPath(codexHome) {
|
|
22363
|
-
return
|
|
22464
|
+
return join22(codexHome, "agents", RECEIPT_FILE);
|
|
22364
22465
|
}
|
|
22365
22466
|
function parseJson(content) {
|
|
22366
22467
|
try {
|
|
@@ -22392,8 +22493,8 @@ function handEditedAgentModel(installedModel, receipt) {
|
|
|
22392
22493
|
}
|
|
22393
22494
|
|
|
22394
22495
|
// packages/omo-codex/src/install/retired-managed-agent-purge.ts
|
|
22395
|
-
import { lstat as
|
|
22396
|
-
import { join as
|
|
22496
|
+
import { lstat as lstat9, readFile as readFile15, rm as rm10 } from "node:fs/promises";
|
|
22497
|
+
import { join as join23 } from "node:path";
|
|
22397
22498
|
var RETIRED_MANAGED_AGENT_FILES = [
|
|
22398
22499
|
{
|
|
22399
22500
|
fileName: "codex-ultrawork-reviewer.toml",
|
|
@@ -22405,20 +22506,20 @@ var RETIRED_MANAGED_AGENT_FILES = [
|
|
|
22405
22506
|
}
|
|
22406
22507
|
];
|
|
22407
22508
|
async function purgeRetiredManagedAgentFiles(input) {
|
|
22408
|
-
const agentsDir =
|
|
22509
|
+
const agentsDir = join23(input.codexHome, "agents");
|
|
22409
22510
|
if (!await exists3(agentsDir))
|
|
22410
22511
|
return;
|
|
22411
22512
|
for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
|
|
22412
|
-
const agentPath =
|
|
22513
|
+
const agentPath = join23(agentsDir, retiredAgent.fileName);
|
|
22413
22514
|
if (!await exists3(agentPath))
|
|
22414
22515
|
continue;
|
|
22415
|
-
const agentStat = await
|
|
22516
|
+
const agentStat = await lstat9(agentPath);
|
|
22416
22517
|
if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
|
|
22417
22518
|
continue;
|
|
22418
22519
|
const content = await readTextIfExists2(agentPath);
|
|
22419
22520
|
if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
|
|
22420
22521
|
continue;
|
|
22421
|
-
await
|
|
22522
|
+
await rm10(agentPath, { force: true });
|
|
22422
22523
|
}
|
|
22423
22524
|
}
|
|
22424
22525
|
function hasRequiredMarkers(content, markers) {
|
|
@@ -22435,7 +22536,7 @@ async function readTextIfExists2(path) {
|
|
|
22435
22536
|
}
|
|
22436
22537
|
async function exists3(path) {
|
|
22437
22538
|
try {
|
|
22438
|
-
await
|
|
22539
|
+
await lstat9(path);
|
|
22439
22540
|
return true;
|
|
22440
22541
|
} catch (error) {
|
|
22441
22542
|
if (nodeErrorCode2(error) !== "ENOENT")
|
|
@@ -22451,15 +22552,15 @@ function nodeErrorCode2(error) {
|
|
|
22451
22552
|
|
|
22452
22553
|
// packages/omo-codex/src/install/default-agent-role.ts
|
|
22453
22554
|
import { createHash as createHash3 } from "node:crypto";
|
|
22454
|
-
import { lstat as
|
|
22455
|
-
import { join as
|
|
22555
|
+
import { lstat as lstat10, readFile as readFile16, rm as rm11 } from "node:fs/promises";
|
|
22556
|
+
import { join as join24 } from "node:path";
|
|
22456
22557
|
var REGISTRATION = { name: "default", configFile: "./agents/default.toml" };
|
|
22457
22558
|
async function installDefaultAgentRole(input) {
|
|
22458
|
-
const target =
|
|
22459
|
-
const receipt =
|
|
22460
|
-
const configPath =
|
|
22559
|
+
const target = join24(input.codexHome, "agents", "default.toml");
|
|
22560
|
+
const receipt = join24(input.codexHome, "agents", ".lazycodex-default.sha256");
|
|
22561
|
+
const configPath = join24(input.codexHome, "config.toml");
|
|
22461
22562
|
const config = await readIfPresent(configPath);
|
|
22462
|
-
const entry = await
|
|
22563
|
+
const entry = await lstat10(target).catch((error) => {
|
|
22463
22564
|
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
22464
22565
|
return null;
|
|
22465
22566
|
throw error;
|
|
@@ -22480,8 +22581,8 @@ async function installDefaultAgentRole(input) {
|
|
|
22480
22581
|
if (next !== config)
|
|
22481
22582
|
await writeFileAtomic(configPath, next);
|
|
22482
22583
|
}
|
|
22483
|
-
await
|
|
22484
|
-
await
|
|
22584
|
+
await rm11(target);
|
|
22585
|
+
await rm11(receipt);
|
|
22485
22586
|
}
|
|
22486
22587
|
return null;
|
|
22487
22588
|
}
|
|
@@ -22518,7 +22619,7 @@ async function linkCachedPluginAgents(input) {
|
|
|
22518
22619
|
await writeManifest(input.pluginRoot, []);
|
|
22519
22620
|
return [];
|
|
22520
22621
|
}
|
|
22521
|
-
const agentsDir =
|
|
22622
|
+
const agentsDir = join25(input.codexHome, "agents");
|
|
22522
22623
|
await mkdir7(agentsDir, { recursive: true });
|
|
22523
22624
|
const previousReceipts = await readAgentModelReceipts(input.codexHome);
|
|
22524
22625
|
const receipts = new Map;
|
|
@@ -22526,7 +22627,7 @@ async function linkCachedPluginAgents(input) {
|
|
|
22526
22627
|
for (const agentPath of bundledAgents) {
|
|
22527
22628
|
const agentFileName = basename4(agentPath);
|
|
22528
22629
|
const agentName = agentNameFromToml2(agentFileName);
|
|
22529
|
-
const linkPath =
|
|
22630
|
+
const linkPath = join25(agentsDir, agentFileName);
|
|
22530
22631
|
receipts.set(agentName, await syncAgentFile({ ...input, agentName, agentPath, linkPath, previousReceipt: previousReceipts.get(agentName) }));
|
|
22531
22632
|
linked.push({ name: agentFileName, path: linkPath, target: agentPath });
|
|
22532
22633
|
}
|
|
@@ -22566,22 +22667,22 @@ async function syncAgentFile(input) {
|
|
|
22566
22667
|
};
|
|
22567
22668
|
}
|
|
22568
22669
|
async function discoverBundledAgents(pluginRoot) {
|
|
22569
|
-
const componentsRoot =
|
|
22670
|
+
const componentsRoot = join25(pluginRoot, "components");
|
|
22570
22671
|
if (!await exists4(componentsRoot))
|
|
22571
22672
|
return [];
|
|
22572
|
-
const componentEntries = await
|
|
22673
|
+
const componentEntries = await readdir8(componentsRoot, { withFileTypes: true });
|
|
22573
22674
|
const agents = [];
|
|
22574
22675
|
for (const entry of componentEntries) {
|
|
22575
22676
|
if (!entry.isDirectory())
|
|
22576
22677
|
continue;
|
|
22577
|
-
const agentsRoot =
|
|
22678
|
+
const agentsRoot = join25(componentsRoot, entry.name, "agents");
|
|
22578
22679
|
if (!await exists4(agentsRoot))
|
|
22579
22680
|
continue;
|
|
22580
|
-
const agentEntries = await
|
|
22681
|
+
const agentEntries = await readdir8(agentsRoot, { withFileTypes: true });
|
|
22581
22682
|
for (const file of agentEntries) {
|
|
22582
22683
|
if (!file.isFile() || !file.name.endsWith(".toml"))
|
|
22583
22684
|
continue;
|
|
22584
|
-
agents.push(
|
|
22685
|
+
agents.push(join25(agentsRoot, file.name));
|
|
22585
22686
|
}
|
|
22586
22687
|
}
|
|
22587
22688
|
agents.sort();
|
|
@@ -22594,14 +22695,14 @@ async function replaceWithCopy(linkPath, target) {
|
|
|
22594
22695
|
async function prepareReplacement(linkPath) {
|
|
22595
22696
|
if (!await exists4(linkPath))
|
|
22596
22697
|
return;
|
|
22597
|
-
const entryStat = await
|
|
22698
|
+
const entryStat = await lstat11(linkPath);
|
|
22598
22699
|
if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
|
|
22599
22700
|
throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
|
|
22600
22701
|
}
|
|
22601
|
-
await
|
|
22702
|
+
await rm12(linkPath, { force: true });
|
|
22602
22703
|
}
|
|
22603
22704
|
async function writeManifest(pluginRoot, agentPaths) {
|
|
22604
|
-
const manifestPath =
|
|
22705
|
+
const manifestPath = join25(pluginRoot, MANIFEST_FILE);
|
|
22605
22706
|
const payload = { agents: [...agentPaths].sort() };
|
|
22606
22707
|
await writeFile9(manifestPath, `${JSON.stringify(payload, null, "\t")}
|
|
22607
22708
|
`);
|
|
@@ -22611,7 +22712,7 @@ function agentNameFromToml2(fileName) {
|
|
|
22611
22712
|
}
|
|
22612
22713
|
async function exists4(path) {
|
|
22613
22714
|
try {
|
|
22614
|
-
await
|
|
22715
|
+
await lstat11(path);
|
|
22615
22716
|
return true;
|
|
22616
22717
|
} catch (error) {
|
|
22617
22718
|
if (nodeErrorCode3(error) !== "ENOENT")
|
|
@@ -22673,10 +22774,10 @@ function agentNameFromToml3(fileName) {
|
|
|
22673
22774
|
|
|
22674
22775
|
// packages/omo-codex/src/install/codex-marketplace.ts
|
|
22675
22776
|
import { readFile as readFile18 } from "node:fs/promises";
|
|
22676
|
-
import { join as
|
|
22777
|
+
import { join as join26 } from "node:path";
|
|
22677
22778
|
var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
|
|
22678
22779
|
async function readMarketplace(repoRoot, options) {
|
|
22679
|
-
const marketplacePath = options?.marketplacePath ??
|
|
22780
|
+
const marketplacePath = options?.marketplacePath ?? join26(repoRoot, DEFAULT_MARKETPLACE_PATH);
|
|
22680
22781
|
const raw = await readFile18(marketplacePath, "utf8");
|
|
22681
22782
|
const parsed = JSON.parse(raw);
|
|
22682
22783
|
if (!isPlainRecord(parsed))
|
|
@@ -22695,10 +22796,10 @@ async function readMarketplace(repoRoot, options) {
|
|
|
22695
22796
|
function resolvePluginSource(repoRoot, plugin, options) {
|
|
22696
22797
|
const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
|
|
22697
22798
|
const relativePath = sourcePath.slice(2);
|
|
22698
|
-
return
|
|
22799
|
+
return join26(repoRoot, ...relativePath.split(/[\\/]/));
|
|
22699
22800
|
}
|
|
22700
22801
|
async function readPluginManifest(pluginRoot) {
|
|
22701
|
-
const raw = await readFile18(
|
|
22802
|
+
const raw = await readFile18(join26(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
|
|
22702
22803
|
const parsed = JSON.parse(raw);
|
|
22703
22804
|
if (!isPlainRecord(parsed))
|
|
22704
22805
|
throw new Error(`${pluginRoot} plugin.json must be an object`);
|
|
@@ -22779,11 +22880,11 @@ function validateLocalSourcePath(path) {
|
|
|
22779
22880
|
}
|
|
22780
22881
|
|
|
22781
22882
|
// packages/omo-codex/src/install/lazycodex-version-stamp.ts
|
|
22782
|
-
import { readdir as
|
|
22783
|
-
import { join as
|
|
22883
|
+
import { readdir as readdir9, readFile as readFile19, writeFile as writeFile10 } from "node:fs/promises";
|
|
22884
|
+
import { join as join27 } from "node:path";
|
|
22784
22885
|
async function readDistributionManifest(repoRoot) {
|
|
22785
22886
|
try {
|
|
22786
|
-
const parsed = JSON.parse(await readFile19(
|
|
22887
|
+
const parsed = JSON.parse(await readFile19(join27(repoRoot, "package.json"), "utf8"));
|
|
22787
22888
|
if (!isPlainRecord(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
|
|
22788
22889
|
return;
|
|
22789
22890
|
return {
|
|
@@ -22807,19 +22908,19 @@ function resolveLazyCodexPluginVersion(input) {
|
|
|
22807
22908
|
return input.manifestVersion ?? "local";
|
|
22808
22909
|
}
|
|
22809
22910
|
async function stampLazyCodexPluginVersion(input) {
|
|
22810
|
-
const manifestPath =
|
|
22911
|
+
const manifestPath = join27(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
22811
22912
|
const hookPaths = await readPluginHookPaths(manifestPath);
|
|
22812
22913
|
await stampJsonVersion(manifestPath, input.version);
|
|
22813
|
-
await stampJsonVersion(
|
|
22914
|
+
await stampJsonVersion(join27(input.pluginRoot, "package.json"), input.version);
|
|
22814
22915
|
for (const hookPath of hookPaths) {
|
|
22815
|
-
await stampHookStatusMessages(
|
|
22916
|
+
await stampHookStatusMessages(join27(input.pluginRoot, hookPath), input.version);
|
|
22816
22917
|
}
|
|
22817
22918
|
await stampComponentVersions(input);
|
|
22818
22919
|
}
|
|
22819
22920
|
async function writeLazyCodexInstallSnapshot(input) {
|
|
22820
22921
|
if (input.distributionManifest === undefined)
|
|
22821
22922
|
return;
|
|
22822
|
-
await writeFile10(
|
|
22923
|
+
await writeFile10(join27(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
|
|
22823
22924
|
packageName: input.distributionManifest.name,
|
|
22824
22925
|
version: input.distributionManifest.version
|
|
22825
22926
|
}, null, "\t")}
|
|
@@ -22876,16 +22977,16 @@ async function stampHookStatusMessages(path, version) {
|
|
|
22876
22977
|
async function stampComponentVersions(input) {
|
|
22877
22978
|
let entries;
|
|
22878
22979
|
try {
|
|
22879
|
-
entries = await
|
|
22980
|
+
entries = await readdir9(join27(input.pluginRoot, "components"));
|
|
22880
22981
|
} catch (error) {
|
|
22881
22982
|
if (error instanceof Error)
|
|
22882
22983
|
return;
|
|
22883
22984
|
throw error;
|
|
22884
22985
|
}
|
|
22885
22986
|
for (const entry of entries) {
|
|
22886
|
-
const componentRoot =
|
|
22887
|
-
await stampJsonVersion(
|
|
22888
|
-
await stampHookStatusMessages(
|
|
22987
|
+
const componentRoot = join27(input.pluginRoot, "components", entry);
|
|
22988
|
+
await stampJsonVersion(join27(componentRoot, "package.json"), input.version);
|
|
22989
|
+
await stampHookStatusMessages(join27(componentRoot, "hooks", "hooks.json"), input.version);
|
|
22889
22990
|
}
|
|
22890
22991
|
}
|
|
22891
22992
|
function stampHookGroups(hooks, version) {
|
|
@@ -22914,8 +23015,8 @@ function normalizeHookStatusVersion(version) {
|
|
|
22914
23015
|
}
|
|
22915
23016
|
|
|
22916
23017
|
// packages/omo-codex/src/install/codex-project-local-cleanup.ts
|
|
22917
|
-
import { copyFile as copyFile2, lstat as
|
|
22918
|
-
import { dirname as dirname9, join as
|
|
23018
|
+
import { copyFile as copyFile2, lstat as lstat12, readFile as readFile20, writeFile as writeFile11 } from "node:fs/promises";
|
|
23019
|
+
import { dirname as dirname9, join as join28, resolve as resolve8 } from "node:path";
|
|
22919
23020
|
var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
|
|
22920
23021
|
var PROJECT_LOCAL_ARTIFACT_PATHS = [
|
|
22921
23022
|
".codex/hooks.json",
|
|
@@ -23018,17 +23119,17 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
23018
23119
|
if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
|
|
23019
23120
|
throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
|
|
23020
23121
|
}
|
|
23021
|
-
const codexHomeConfigPath = codexHome === undefined ? null :
|
|
23122
|
+
const codexHomeConfigPath = codexHome === undefined ? null : join28(resolve8(codexHome), "config.toml");
|
|
23022
23123
|
let current = resolve8(startDirectory);
|
|
23023
23124
|
const configPathsFromCwd = [];
|
|
23024
23125
|
while (true) {
|
|
23025
|
-
const configPath =
|
|
23126
|
+
const configPath = join28(current, ".codex", "config.toml");
|
|
23026
23127
|
if (await isRegularProjectLocalConfig(current, configPath)) {
|
|
23027
23128
|
if (codexHomeConfigPath === null || resolve8(configPath) !== codexHomeConfigPath) {
|
|
23028
23129
|
configPathsFromCwd.push(configPath);
|
|
23029
23130
|
}
|
|
23030
23131
|
}
|
|
23031
|
-
if (await exists5(
|
|
23132
|
+
if (await exists5(join28(current, ".git"))) {
|
|
23032
23133
|
return configPathsFromCwd.length === 0 ? null : {
|
|
23033
23134
|
projectRoot: current,
|
|
23034
23135
|
configPaths: [...configPathsFromCwd].reverse(),
|
|
@@ -23048,7 +23149,7 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
23048
23149
|
}
|
|
23049
23150
|
}
|
|
23050
23151
|
async function isRegularProjectLocalConfig(directory, configPath) {
|
|
23051
|
-
const codexDirStat = await maybeLstat(
|
|
23152
|
+
const codexDirStat = await maybeLstat(join28(directory, ".codex"));
|
|
23052
23153
|
if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
|
|
23053
23154
|
return false;
|
|
23054
23155
|
const configStat = await maybeLstat(configPath);
|
|
@@ -23068,7 +23169,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
|
|
|
23068
23169
|
const seenPaths = new Set;
|
|
23069
23170
|
for (const projectRoot of projectRoots) {
|
|
23070
23171
|
for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
|
|
23071
|
-
const artifactPath =
|
|
23172
|
+
const artifactPath = join28(projectRoot, relativePath);
|
|
23072
23173
|
if (seenPaths.has(artifactPath))
|
|
23073
23174
|
continue;
|
|
23074
23175
|
const entryStat = await maybeLstat(artifactPath);
|
|
@@ -23102,7 +23203,7 @@ function formatBackupTimestamp(date) {
|
|
|
23102
23203
|
}
|
|
23103
23204
|
async function maybeLstat(path) {
|
|
23104
23205
|
try {
|
|
23105
|
-
return await
|
|
23206
|
+
return await lstat12(path);
|
|
23106
23207
|
} catch (error) {
|
|
23107
23208
|
if (nodeErrorCode4(error) === "ENOENT")
|
|
23108
23209
|
return null;
|
|
@@ -23144,13 +23245,13 @@ function formatUnknownError(error) {
|
|
|
23144
23245
|
|
|
23145
23246
|
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
|
|
23146
23247
|
import { createHash as createHash4 } from "node:crypto";
|
|
23147
|
-
import { lstat as
|
|
23248
|
+
import { lstat as lstat13, readFile as readFile22, readdir as readdir11, rm as rm13 } from "node:fs/promises";
|
|
23148
23249
|
import { tmpdir } from "node:os";
|
|
23149
|
-
import { join as
|
|
23250
|
+
import { join as join29, posix as posix2 } from "node:path";
|
|
23150
23251
|
|
|
23151
23252
|
// packages/omo-codex/src/install/lsp-daemon-reaper-attestation.ts
|
|
23152
23253
|
import { execFile } from "node:child_process";
|
|
23153
|
-
import { readFile as readFile21, readdir as
|
|
23254
|
+
import { readFile as readFile21, readdir as readdir10, readlink as readlink5 } from "node:fs/promises";
|
|
23154
23255
|
import { connect } from "node:net";
|
|
23155
23256
|
import { basename as basename5 } from "node:path";
|
|
23156
23257
|
var PROBE_TIMEOUT_MS = 500;
|
|
@@ -23193,7 +23294,7 @@ async function attestLegacyDaemonOwnership(input, deps = {}) {
|
|
|
23193
23294
|
}
|
|
23194
23295
|
async function attestLinuxOwnership(input, deps) {
|
|
23195
23296
|
const readFileImpl = deps.readFile ?? readFile21;
|
|
23196
|
-
const readDirImpl = deps.readDir ??
|
|
23297
|
+
const readDirImpl = deps.readDir ?? readdir10;
|
|
23197
23298
|
const readLinkImpl = deps.readLink ?? readlink5;
|
|
23198
23299
|
const procNetUnix = await readText(readFileImpl, "/proc/net/unix");
|
|
23199
23300
|
if (procNetUnix === null)
|
|
@@ -23319,17 +23420,17 @@ async function readBinary(readFileImpl, path) {
|
|
|
23319
23420
|
var LEGACY_EXIT_WAIT_TIMEOUT_MS = 5000;
|
|
23320
23421
|
var LEGACY_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
|
|
23321
23422
|
async function reapLspDaemons(codexHome, deps = {}) {
|
|
23322
|
-
const daemonRoot =
|
|
23423
|
+
const daemonRoot = join29(codexHome, "codex-lsp", "daemon");
|
|
23323
23424
|
const platform = deps.platform ?? process.platform;
|
|
23324
23425
|
const tmpDir = deps.tmpDir ?? tmpdir();
|
|
23325
23426
|
const probe = deps.probeLegacyJsonRpc ?? probeLegacyJsonRpcEndpoint;
|
|
23326
23427
|
const attest = deps.attestLegacyDaemonOwnership ?? ((input) => attestLegacyDaemonOwnership(input));
|
|
23327
23428
|
const killProcess = deps.killProcess ?? sendSigterm;
|
|
23328
23429
|
const waitForProcessExit = deps.waitForProcessExit ?? defaultWaitForProcessExit;
|
|
23329
|
-
const entries = await
|
|
23430
|
+
const entries = await readdir11(daemonRoot, { withFileTypes: true }).catch(() => []);
|
|
23330
23431
|
const results = [];
|
|
23331
23432
|
for (const entry of [...entries].sort((left, right) => left.name.localeCompare(right.name))) {
|
|
23332
|
-
const versionPath =
|
|
23433
|
+
const versionPath = join29(daemonRoot, entry.name);
|
|
23333
23434
|
const parsedVersion = parseVersionEntry(entry.name);
|
|
23334
23435
|
if (parsedVersion === null || !entry.isDirectory()) {
|
|
23335
23436
|
await removeVersionDir(versionPath);
|
|
@@ -23377,7 +23478,7 @@ function parseVersionEntry(entryName) {
|
|
|
23377
23478
|
return LEGACY_VERSION_PATTERN.test(version) ? version : null;
|
|
23378
23479
|
}
|
|
23379
23480
|
async function readLegacyMetadata(input) {
|
|
23380
|
-
const pidText = await readRegularTrimmedFile(
|
|
23481
|
+
const pidText = await readRegularTrimmedFile(join29(input.versionPath, "daemon.pid"));
|
|
23381
23482
|
if (pidText === "non_regular")
|
|
23382
23483
|
return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
|
|
23383
23484
|
if (pidText === null)
|
|
@@ -23385,7 +23486,7 @@ async function readLegacyMetadata(input) {
|
|
|
23385
23486
|
const pid = Number.parseInt(pidText, 10);
|
|
23386
23487
|
if (!Number.isInteger(pid) || pid <= 0)
|
|
23387
23488
|
return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
|
|
23388
|
-
const endpointText = await readRegularTrimmedFile(
|
|
23489
|
+
const endpointText = await readRegularTrimmedFile(join29(input.versionPath, "daemon.endpoint"));
|
|
23389
23490
|
if (endpointText === "non_regular")
|
|
23390
23491
|
return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
|
|
23391
23492
|
if (endpointText === null)
|
|
@@ -23412,7 +23513,7 @@ function legacyEndpointCandidates(input) {
|
|
|
23412
23513
|
return [natural, hashed];
|
|
23413
23514
|
}
|
|
23414
23515
|
async function readRegularTrimmedFile(path) {
|
|
23415
|
-
const stats = await
|
|
23516
|
+
const stats = await lstat13(path).catch(() => null);
|
|
23416
23517
|
if (stats === null)
|
|
23417
23518
|
return null;
|
|
23418
23519
|
if (!stats.isFile())
|
|
@@ -23424,7 +23525,7 @@ function shortDigest(value) {
|
|
|
23424
23525
|
return createHash4("sha256").update(value).digest("hex").slice(0, 16);
|
|
23425
23526
|
}
|
|
23426
23527
|
async function removeVersionDir(path) {
|
|
23427
|
-
await
|
|
23528
|
+
await rm13(path, { recursive: true, force: true });
|
|
23428
23529
|
}
|
|
23429
23530
|
function removed(version, reason) {
|
|
23430
23531
|
return { version, status: "removed", reason };
|
|
@@ -23464,7 +23565,7 @@ function processIsRunning(pid) {
|
|
|
23464
23565
|
|
|
23465
23566
|
// packages/omo-codex/src/install/codex-installer-bin-dir.ts
|
|
23466
23567
|
import { homedir } from "node:os";
|
|
23467
|
-
import { join as
|
|
23568
|
+
import { join as join30, resolve as resolve9 } from "node:path";
|
|
23468
23569
|
function resolveCodexInstallerBinDir(input) {
|
|
23469
23570
|
const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
|
|
23470
23571
|
if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
|
|
@@ -23473,22 +23574,22 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
23473
23574
|
const defaultCodexHome = resolve9(homeDir, ".codex");
|
|
23474
23575
|
const resolvedCodexHome = resolve9(input.codexHome);
|
|
23475
23576
|
if (resolvedCodexHome !== defaultCodexHome)
|
|
23476
|
-
return
|
|
23577
|
+
return join30(resolvedCodexHome, "bin");
|
|
23477
23578
|
return resolve9(homeDir, ".local", "bin");
|
|
23478
23579
|
}
|
|
23479
23580
|
|
|
23480
23581
|
// packages/omo-codex/src/install/codex-installed-bin-dir.ts
|
|
23481
|
-
import { readFile as readFile23, readdir as
|
|
23482
|
-
import { join as
|
|
23582
|
+
import { readFile as readFile23, readdir as readdir12, writeFile as writeFile12 } from "node:fs/promises";
|
|
23583
|
+
import { join as join31 } from "node:path";
|
|
23483
23584
|
var INSTALLED_BIN_DIR_MANIFEST = ".installed-bin-dir.json";
|
|
23484
23585
|
async function writeInstalledCodexBinDir(input) {
|
|
23485
|
-
await writeFile12(
|
|
23586
|
+
await writeFile12(join31(input.pluginRoot, INSTALLED_BIN_DIR_MANIFEST), `${JSON.stringify({ binDir: input.binDir }, null, 2)}
|
|
23486
23587
|
`);
|
|
23487
23588
|
}
|
|
23488
23589
|
|
|
23489
23590
|
// packages/omo-codex/src/install/codex-git-bash-hooks.ts
|
|
23490
23591
|
import { readFile as readFile24, writeFile as writeFile13 } from "node:fs/promises";
|
|
23491
|
-
import { join as
|
|
23592
|
+
import { join as join32 } from "node:path";
|
|
23492
23593
|
var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
|
|
23493
23594
|
"./hooks/pre-tool-use-recommending-git-bash-mcp.json",
|
|
23494
23595
|
"./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
|
|
@@ -23496,7 +23597,7 @@ var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
|
|
|
23496
23597
|
async function removeGitBashHooksOffWindows(input) {
|
|
23497
23598
|
if (input.platform === "win32")
|
|
23498
23599
|
return;
|
|
23499
|
-
const manifestPath =
|
|
23600
|
+
const manifestPath = join32(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
23500
23601
|
const parsed = JSON.parse(await readFile24(manifestPath, "utf8"));
|
|
23501
23602
|
if (!isPlainRecord(parsed) || !Array.isArray(parsed.hooks))
|
|
23502
23603
|
return;
|
|
@@ -23508,12 +23609,12 @@ async function removeGitBashHooksOffWindows(input) {
|
|
|
23508
23609
|
}
|
|
23509
23610
|
|
|
23510
23611
|
// packages/omo-codex/src/install/install-ast-grep-sg.ts
|
|
23511
|
-
import { join as
|
|
23612
|
+
import { join as join34 } from "node:path";
|
|
23512
23613
|
|
|
23513
23614
|
// packages/utils/src/ast-grep/install-script.ts
|
|
23514
23615
|
import { spawn as spawn2 } from "node:child_process";
|
|
23515
23616
|
import { existsSync as existsSync4 } from "node:fs";
|
|
23516
|
-
import { join as
|
|
23617
|
+
import { join as join33 } from "node:path";
|
|
23517
23618
|
|
|
23518
23619
|
// packages/utils/src/ast-grep/sg-manifest.ts
|
|
23519
23620
|
function normalizeRuntimePlatform(platform = process.platform) {
|
|
@@ -23535,7 +23636,7 @@ var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR";
|
|
|
23535
23636
|
var KILL_GRACE_MS = 1000;
|
|
23536
23637
|
var AST_GREP_INSTALL_TIMEOUT_MS = 30000;
|
|
23537
23638
|
function astGrepRuntimeDir(baseDir, platform = process.platform, arch = process.arch) {
|
|
23538
|
-
return
|
|
23639
|
+
return join33(baseDir, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
23539
23640
|
}
|
|
23540
23641
|
function isMissingExecutable(error) {
|
|
23541
23642
|
if (!("code" in error))
|
|
@@ -23573,7 +23674,7 @@ function defaultSpawnProcess(command, args, options) {
|
|
|
23573
23674
|
};
|
|
23574
23675
|
}
|
|
23575
23676
|
function scriptPathForPlatform(skillDir, platform) {
|
|
23576
|
-
return
|
|
23677
|
+
return join33(skillDir, platform === "win32" ? "install.ps1" : "install.sh");
|
|
23577
23678
|
}
|
|
23578
23679
|
function invocationsForPlatform(scriptPath, platform) {
|
|
23579
23680
|
if (platform !== "win32")
|
|
@@ -23659,7 +23760,7 @@ async function installAstGrepForCodex(options) {
|
|
|
23659
23760
|
return;
|
|
23660
23761
|
const platform = options.platform ?? process.platform;
|
|
23661
23762
|
const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
|
|
23662
|
-
const skillDir =
|
|
23763
|
+
const skillDir = join34(plugin.path, "skills", "ast-grep");
|
|
23663
23764
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
23664
23765
|
try {
|
|
23665
23766
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -23677,7 +23778,7 @@ async function trackCodexInstallTelemetry() {
|
|
|
23677
23778
|
try {
|
|
23678
23779
|
await Promise.resolve().then(() => init_telemetry());
|
|
23679
23780
|
const posthog = createInstallPostHog();
|
|
23680
|
-
posthog.trackActive(
|
|
23781
|
+
posthog.trackActive("install_completed");
|
|
23681
23782
|
await posthog.shutdown();
|
|
23682
23783
|
} catch (error) {
|
|
23683
23784
|
if (error instanceof Error)
|
|
@@ -23692,7 +23793,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
23692
23793
|
const env = options.env ?? process.env;
|
|
23693
23794
|
const platform = options.platform ?? process.platform;
|
|
23694
23795
|
const repoRoot = resolve10(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env }));
|
|
23695
|
-
const codexHome = resolve10(options.codexHome ?? env.CODEX_HOME ??
|
|
23796
|
+
const codexHome = resolve10(options.codexHome ?? env.CODEX_HOME ?? join39(homedir2(), ".codex"));
|
|
23696
23797
|
const projectDirectory = resolve10(options.projectDirectory ?? env.OMO_CODEX_PROJECT ?? process.cwd());
|
|
23697
23798
|
const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env });
|
|
23698
23799
|
const runCommand = options.runCommand ?? defaultRunCommand;
|
|
@@ -23709,9 +23810,9 @@ async function runCodexInstaller(options = {}) {
|
|
|
23709
23810
|
if (!gitBashResolution.found) {
|
|
23710
23811
|
throw new Error(gitBashResolution.installHint);
|
|
23711
23812
|
}
|
|
23712
|
-
const codexPackageRoot =
|
|
23813
|
+
const codexPackageRoot = join39(repoRoot, "packages", "omo-codex");
|
|
23713
23814
|
const marketplace = await readMarketplace(repoRoot, {
|
|
23714
|
-
marketplacePath:
|
|
23815
|
+
marketplacePath: join39(codexPackageRoot, "marketplace.json")
|
|
23715
23816
|
});
|
|
23716
23817
|
const distributionManifest = await readDistributionManifest(repoRoot);
|
|
23717
23818
|
const installed = [];
|
|
@@ -23756,7 +23857,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
23756
23857
|
if (runtimeLink !== null)
|
|
23757
23858
|
log(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
|
|
23758
23859
|
else
|
|
23759
|
-
log(`Warning: skipped the omo-agent-toolkit runtime wrapper because ${
|
|
23860
|
+
log(`Warning: skipped the omo-agent-toolkit runtime wrapper because ${join39(repoRoot, "dist", "cli", "index.js")} is missing; omo-agent-toolkit ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
|
|
23760
23861
|
}
|
|
23761
23862
|
pluginSources.push({ name: entry.name, sourcePath });
|
|
23762
23863
|
installed.push(plugin);
|
|
@@ -23806,13 +23907,13 @@ async function runCodexInstaller(options = {}) {
|
|
|
23806
23907
|
continue;
|
|
23807
23908
|
log(`Warning: deferred legacy Codex LSP daemon cleanup for v${cleanup.version}: ${cleanup.reason}`);
|
|
23808
23909
|
}
|
|
23809
|
-
const marketplaceRoot =
|
|
23910
|
+
const marketplaceRoot = join39(codexHome, "plugins", "cache", marketplace.name);
|
|
23810
23911
|
await writeCachedMarketplaceManifest({
|
|
23811
23912
|
marketplaceName: marketplace.name,
|
|
23812
23913
|
marketplaceRoot,
|
|
23813
23914
|
plugins: installed
|
|
23814
23915
|
});
|
|
23815
|
-
const configPath =
|
|
23916
|
+
const configPath = join39(codexHome, "config.toml");
|
|
23816
23917
|
await updateCodexConfig({
|
|
23817
23918
|
configPath,
|
|
23818
23919
|
repoRoot: codexPackageRoot,
|
|
@@ -23857,7 +23958,7 @@ function findRepoRootFromImporter(importerDir) {
|
|
|
23857
23958
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
23858
23959
|
if (isRepoRootWithCodexPlugin(current))
|
|
23859
23960
|
return current;
|
|
23860
|
-
for (const wrapperPackageRoot of [
|
|
23961
|
+
for (const wrapperPackageRoot of [join39(current, "node_modules", "oh-my-openagent"), join39(current, "oh-my-openagent")]) {
|
|
23861
23962
|
if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
|
|
23862
23963
|
return wrapperPackageRoot;
|
|
23863
23964
|
}
|
|
@@ -23875,7 +23976,7 @@ function findRepoRoot(input) {
|
|
|
23875
23976
|
return findRepoRootFromImporter(input.importerDir);
|
|
23876
23977
|
}
|
|
23877
23978
|
function isRepoRootWithCodexPlugin(repoRoot) {
|
|
23878
|
-
return existsSync7(
|
|
23979
|
+
return existsSync7(join39(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
|
|
23879
23980
|
}
|
|
23880
23981
|
function codexMarketplaceSource(marketplaceRoot) {
|
|
23881
23982
|
return { sourceType: "local", source: marketplaceRoot };
|
|
@@ -24187,13 +24288,13 @@ function shellQuote(value) {
|
|
|
24187
24288
|
|
|
24188
24289
|
// packages/omo-codex/src/install/lazycodex-manual-update.ts
|
|
24189
24290
|
import { spawn as spawn3, spawnSync as spawnSync2 } from "node:child_process";
|
|
24190
|
-
import { readFileSync as
|
|
24191
|
-
import { dirname as
|
|
24291
|
+
import { readFileSync as readFileSync6 } from "node:fs";
|
|
24292
|
+
import { dirname as dirname13, join as join41 } from "node:path";
|
|
24192
24293
|
import { createInterface as createInterface2 } from "node:readline/promises";
|
|
24193
24294
|
import { fileURLToPath } from "node:url";
|
|
24194
24295
|
|
|
24195
24296
|
// packages/omo-codex/src/install/lazycodex-bun-global-paths.ts
|
|
24196
|
-
import { join as
|
|
24297
|
+
import { join as join40 } from "node:path";
|
|
24197
24298
|
function isBunGlobalEntrypointPath(invokedPath, env) {
|
|
24198
24299
|
if (typeof invokedPath !== "string" || invokedPath.trim().length === 0)
|
|
24199
24300
|
return false;
|
|
@@ -24204,8 +24305,8 @@ function resolveBunGlobalRoots(env) {
|
|
|
24204
24305
|
const bunInstallRoot = env.BUN_INSTALL?.trim();
|
|
24205
24306
|
const homeRoot = env.HOME?.trim();
|
|
24206
24307
|
return [
|
|
24207
|
-
...bunInstallRoot ? [
|
|
24208
|
-
...homeRoot ? [
|
|
24308
|
+
...bunInstallRoot ? [join40(bunInstallRoot, "bin"), join40(bunInstallRoot, "install", "global", "node_modules")] : [],
|
|
24309
|
+
...homeRoot ? [join40(homeRoot, ".bun", "bin"), join40(homeRoot, ".bun", "install", "global", "node_modules")] : []
|
|
24209
24310
|
].map(normalizePathForPrefix);
|
|
24210
24311
|
}
|
|
24211
24312
|
function normalizePathForPrefix(path) {
|
|
@@ -24297,8 +24398,8 @@ function resolveArgs(env) {
|
|
|
24297
24398
|
function resolveCurrentVersion(env) {
|
|
24298
24399
|
if (env.LAZYCODEX_CURRENT_VERSION?.trim())
|
|
24299
24400
|
return env.LAZYCODEX_CURRENT_VERSION.trim();
|
|
24300
|
-
const pluginRoot =
|
|
24301
|
-
return readVersionManifest(resolveInstalledVersionPath(env, pluginRoot)) ?? readVersionManifest(
|
|
24401
|
+
const pluginRoot = dirname13(dirname13(fileURLToPath(import.meta.url)));
|
|
24402
|
+
return readVersionManifest(resolveInstalledVersionPath(env, pluginRoot)) ?? readVersionManifest(join41(pluginRoot, "..", "..", "..", "package.json")) ?? readVersionManifest(join41(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
24302
24403
|
}
|
|
24303
24404
|
function resolveLatestVersion(env) {
|
|
24304
24405
|
if (env.LAZYCODEX_LATEST_VERSION?.trim())
|
|
@@ -24414,11 +24515,11 @@ function compareVersions(left, right) {
|
|
|
24414
24515
|
function resolveInstalledVersionPath(env, pluginRoot) {
|
|
24415
24516
|
if (env.LAZYCODEX_INSTALLED_VERSION_FILE?.trim())
|
|
24416
24517
|
return env.LAZYCODEX_INSTALLED_VERSION_FILE.trim();
|
|
24417
|
-
return
|
|
24518
|
+
return join41(pluginRoot, INSTALLED_VERSION_FILE);
|
|
24418
24519
|
}
|
|
24419
24520
|
function readVersionManifest(path) {
|
|
24420
24521
|
try {
|
|
24421
|
-
const parsed = JSON.parse(
|
|
24522
|
+
const parsed = JSON.parse(readFileSync6(path, "utf8"));
|
|
24422
24523
|
if (typeof parsed === "object" && parsed !== null && "version" in parsed && typeof parsed.version === "string") {
|
|
24423
24524
|
return parsed.version;
|
|
24424
24525
|
}
|
|
@@ -24431,10 +24532,10 @@ function readVersionManifest(path) {
|
|
|
24431
24532
|
}
|
|
24432
24533
|
// packages/omo-codex/src/install/codex-git-bash-mcp-env.ts
|
|
24433
24534
|
import { readFile as readFile25, writeFile as writeFile14 } from "node:fs/promises";
|
|
24434
|
-
import { join as
|
|
24535
|
+
import { join as join42 } from "node:path";
|
|
24435
24536
|
var GIT_BASH_ENV_KEY2 = "OMO_CODEX_GIT_BASH_PATH";
|
|
24436
24537
|
async function stampGitBashMcpEnv(input) {
|
|
24437
|
-
const manifestPath =
|
|
24538
|
+
const manifestPath = join42(input.pluginRoot, ".mcp.json");
|
|
24438
24539
|
if (!await fileExistsStrict(manifestPath))
|
|
24439
24540
|
return false;
|
|
24440
24541
|
const parsed = JSON.parse(await readFile25(manifestPath, "utf8"));
|
|
@@ -24465,7 +24566,7 @@ async function installMarketplaceLocally(options = {}) {
|
|
|
24465
24566
|
return runCodexInstaller(options);
|
|
24466
24567
|
}
|
|
24467
24568
|
function resolveDefaultRepoRootForEntrypoint(entrypointPath) {
|
|
24468
|
-
return resolve11(
|
|
24569
|
+
return resolve11(dirname14(entrypointPath), "..", "..", "..");
|
|
24469
24570
|
}
|
|
24470
24571
|
function resolveDefaultRepoRoot() {
|
|
24471
24572
|
return resolveDefaultRepoRootForEntrypoint(fileURLToPath2(import.meta.url));
|
|
@@ -24481,7 +24582,7 @@ async function runLazyCodexInstallLocalCli(input) {
|
|
|
24481
24582
|
return 0;
|
|
24482
24583
|
}
|
|
24483
24584
|
if (parsed.kind === "version") {
|
|
24484
|
-
const packageJson = JSON.parse(await readFile26(
|
|
24585
|
+
const packageJson = JSON.parse(await readFile26(join43(input.defaultRepoRoot, "package.json"), "utf8"));
|
|
24485
24586
|
const version = typeof packageJson.version === "string" ? packageJson.version : "unknown";
|
|
24486
24587
|
input.log(`lazycodex-ai ${version}`);
|
|
24487
24588
|
return 0;
|