oh-my-opencode 4.12.1 → 4.13.0
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/README.md +1 -1
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/agents/sisyphus-agent-factory.d.ts +9 -0
- package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +31 -0
- package/dist/cli/index.js +896 -669
- package/dist/cli-node/index.js +896 -669
- package/dist/config/schema/codegraph.d.ts +1 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +2 -0
- package/dist/config/schema/runtime-fallback.d.ts +1 -0
- package/dist/features/background-agent/background-task-marker.d.ts +8 -0
- package/dist/features/background-agent/fallback-retry-handler.d.ts +1 -0
- package/dist/features/background-agent/manager.d.ts +1 -0
- package/dist/features/background-agent/parent-wake-dedupe.d.ts +1 -0
- package/dist/features/background-agent/parent-wake-notifier-types.d.ts +2 -0
- package/dist/features/background-agent/parent-wake-notifier.d.ts +1 -0
- package/dist/features/background-agent/parent-wake-window-recovery.d.ts +2 -0
- package/dist/hooks/runtime-fallback/auto-retry-dispatch.d.ts +2 -2
- package/dist/hooks/runtime-fallback/auto-retry-timeout.d.ts +2 -2
- package/dist/hooks/runtime-fallback/auto-retry.d.ts +1 -1
- package/dist/hooks/runtime-fallback/fallback-state-snapshot.d.ts +13 -0
- package/dist/hooks/runtime-fallback/types.d.ts +8 -0
- package/dist/index.js +708 -413
- package/dist/oh-my-opencode.schema.json +8 -0
- package/dist/plugin/runtime-skill-resolver.d.ts +35 -0
- package/dist/plugin/skill-context.d.ts +9 -0
- package/dist/skills/frontend/ATTRIBUTION.md +32 -8
- package/dist/skills/frontend/references/design/airbnb.md +3 -0
- package/dist/skills/frontend/references/design/airtable.md +3 -0
- package/dist/skills/frontend/references/design/apple.md +3 -0
- package/dist/skills/frontend/references/design/binance.md +3 -0
- package/dist/skills/frontend/references/design/bmw.md +3 -0
- package/dist/skills/frontend/references/design/bugatti.md +3 -0
- package/dist/skills/frontend/references/design/cal.md +3 -0
- package/dist/skills/frontend/references/design/claude.md +3 -0
- package/dist/skills/frontend/references/design/clay.md +3 -0
- package/dist/skills/frontend/references/design/clickhouse.md +3 -0
- package/dist/skills/frontend/references/design/cohere.md +3 -0
- package/dist/skills/frontend/references/design/coinbase.md +3 -0
- package/dist/skills/frontend/references/design/composio.md +3 -0
- package/dist/skills/frontend/references/design/cursor.md +3 -0
- package/dist/skills/frontend/references/design/elevenlabs.md +3 -0
- package/dist/skills/frontend/references/design/expo.md +3 -0
- package/dist/skills/frontend/references/design/ferrari.md +3 -0
- package/dist/skills/frontend/references/design/figma.md +3 -0
- package/dist/skills/frontend/references/design/framer.md +3 -0
- package/dist/skills/frontend/references/design/hashicorp.md +3 -0
- package/dist/skills/frontend/references/design/ibm.md +3 -0
- package/dist/skills/frontend/references/design/imagegen-frontend-web.md +380 -79
- package/dist/skills/frontend/references/design/intercom.md +3 -0
- package/dist/skills/frontend/references/design/kraken.md +3 -0
- package/dist/skills/frontend/references/design/lamborghini.md +3 -0
- package/dist/skills/frontend/references/design/linear.app.md +3 -0
- package/dist/skills/frontend/references/design/lovable.md +3 -0
- package/dist/skills/frontend/references/design/mastercard.md +3 -0
- package/dist/skills/frontend/references/design/meta.md +3 -0
- package/dist/skills/frontend/references/design/minimax.md +3 -0
- package/dist/skills/frontend/references/design/mintlify.md +3 -0
- package/dist/skills/frontend/references/design/miro.md +3 -0
- package/dist/skills/frontend/references/design/mistral.ai.md +3 -0
- package/dist/skills/frontend/references/design/mongodb.md +3 -0
- package/dist/skills/frontend/references/design/nike.md +3 -0
- package/dist/skills/frontend/references/design/notion.md +3 -0
- package/dist/skills/frontend/references/design/nvidia.md +3 -0
- package/dist/skills/frontend/references/design/ollama.md +3 -0
- package/dist/skills/frontend/references/design/opencode.ai.md +3 -0
- package/dist/skills/frontend/references/design/pinterest.md +3 -0
- package/dist/skills/frontend/references/design/playstation.md +3 -0
- package/dist/skills/frontend/references/design/posthog.md +3 -0
- package/dist/skills/frontend/references/design/raycast.md +3 -0
- package/dist/skills/frontend/references/design/renault.md +3 -0
- package/dist/skills/frontend/references/design/replicate.md +3 -0
- package/dist/skills/frontend/references/design/resend.md +3 -0
- package/dist/skills/frontend/references/design/revolut.md +3 -0
- package/dist/skills/frontend/references/design/runwayml.md +3 -0
- package/dist/skills/frontend/references/design/sanity.md +3 -0
- package/dist/skills/frontend/references/design/sentry.md +3 -0
- package/dist/skills/frontend/references/design/shopify.md +3 -0
- package/dist/skills/frontend/references/design/spacex.md +3 -0
- package/dist/skills/frontend/references/design/spotify.md +3 -0
- package/dist/skills/frontend/references/design/starbucks.md +3 -0
- package/dist/skills/frontend/references/design/stitch-skill.md +1 -1
- package/dist/skills/frontend/references/design/stripe.md +3 -0
- package/dist/skills/frontend/references/design/supabase.md +3 -0
- package/dist/skills/frontend/references/design/superhuman.md +3 -0
- package/dist/skills/frontend/references/design/taste-skill.md +1188 -208
- package/dist/skills/frontend/references/design/tesla.md +3 -0
- package/dist/skills/frontend/references/design/theverge.md +3 -0
- package/dist/skills/frontend/references/design/together.ai.md +3 -0
- package/dist/skills/frontend/references/design/uber.md +3 -0
- package/dist/skills/frontend/references/design/vercel.md +3 -0
- package/dist/skills/frontend/references/design/vodafone.md +3 -0
- package/dist/skills/frontend/references/design/voltagent.md +3 -0
- package/dist/skills/frontend/references/design/warp.md +3 -0
- package/dist/skills/frontend/references/design/webflow.md +3 -0
- package/dist/skills/frontend/references/design/wired.md +3 -0
- package/dist/skills/frontend/references/design/wise.md +3 -0
- package/dist/skills/frontend/references/design/x.ai.md +3 -0
- package/dist/skills/frontend/references/design/zapier.md +3 -0
- package/dist/skills/frontend/references/ui-ux-db/README.md +501 -115
- package/dist/skills/frontend/references/ui-ux-db/data/charts.csv +26 -26
- package/dist/skills/frontend/references/ui-ux-db/data/colors.csv +162 -97
- package/dist/skills/frontend/references/ui-ux-db/data/icons.csv +105 -100
- package/dist/skills/frontend/references/ui-ux-db/data/landing.csv +22 -18
- package/dist/skills/frontend/references/ui-ux-db/data/products.csv +162 -97
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -53
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -56
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -53
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -54
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -54
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -51
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -50
- package/dist/skills/frontend/references/ui-ux-db/data/styles.csv +17 -0
- package/dist/skills/frontend/references/ui-ux-db/data/typography.csv +17 -1
- package/dist/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -101
- package/dist/skills/frontend/references/ui-ux-db/data/web-interface.csv +30 -30
- package/dist/skills/frontend/references/ui-ux-db/scripts/core.py +31 -22
- package/dist/skills/frontend/references/ui-ux-db/scripts/design_system.py +150 -69
- package/dist/skills/frontend/references/ui-ux-db/scripts/search.py +3 -3
- package/dist/skills/lcx-doctor/SKILL.md +1 -1
- package/dist/skills/ultimate-browsing/ATTRIBUTION.md +105 -0
- package/dist/skills/ultimate-browsing/SKILL.md +140 -0
- package/dist/skills/ultimate-browsing/engine/__init__.py +24 -0
- package/dist/skills/ultimate-browsing/engine/__main__.py +106 -0
- package/dist/skills/ultimate-browsing/engine/bias_check.py +174 -0
- package/dist/skills/ultimate-browsing/engine/curl_probe.py +91 -0
- package/dist/skills/ultimate-browsing/engine/executor.py +192 -0
- package/dist/skills/ultimate-browsing/engine/fetch_chain.py +268 -0
- package/dist/skills/ultimate-browsing/engine/referers.py +15 -0
- package/dist/skills/ultimate-browsing/engine/result_schema.py +45 -0
- package/dist/skills/ultimate-browsing/engine/summary.py +37 -0
- package/dist/skills/ultimate-browsing/engine/templates/package.json +11 -0
- package/dist/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +129 -0
- package/dist/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +167 -0
- package/dist/skills/ultimate-browsing/engine/tests/test_fetch_chain.py +77 -0
- package/dist/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +282 -0
- package/dist/skills/ultimate-browsing/engine/url_transforms.py +98 -0
- package/dist/skills/ultimate-browsing/engine/validators.py +216 -0
- package/dist/skills/ultimate-browsing/engine/waf_detector.py +214 -0
- package/dist/skills/ultimate-browsing/engine/waf_profiles.yaml +162 -0
- package/dist/skills/ultimate-browsing/references/agent-reach/README.md +79 -0
- package/dist/skills/ultimate-browsing/references/agent-reach/career.md +29 -0
- package/dist/skills/ultimate-browsing/references/agent-reach/dev.md +62 -0
- package/dist/skills/ultimate-browsing/references/agent-reach/search.md +33 -0
- package/dist/skills/ultimate-browsing/references/agent-reach/social.md +207 -0
- package/dist/skills/ultimate-browsing/references/agent-reach/video.md +115 -0
- package/dist/skills/ultimate-browsing/references/agent-reach/web.md +76 -0
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +120 -0
- package/dist/skills/ultimate-browsing/references/insane-search/README.md +319 -0
- package/dist/skills/ultimate-browsing/references/insane-search/cache-archive.md +83 -0
- package/dist/skills/ultimate-browsing/references/insane-search/fallback.md +159 -0
- package/dist/skills/ultimate-browsing/references/insane-search/jina.md +130 -0
- package/dist/skills/ultimate-browsing/references/insane-search/json-api.md +133 -0
- package/dist/skills/ultimate-browsing/references/insane-search/media.md +123 -0
- package/dist/skills/ultimate-browsing/references/insane-search/metadata.md +116 -0
- package/dist/skills/ultimate-browsing/references/insane-search/naver.md +107 -0
- package/dist/skills/ultimate-browsing/references/insane-search/playwright.md +142 -0
- package/dist/skills/ultimate-browsing/references/insane-search/public-api.md +119 -0
- package/dist/skills/ultimate-browsing/references/insane-search/rss.md +123 -0
- package/dist/skills/ultimate-browsing/references/insane-search/tls-impersonate.md +186 -0
- package/dist/skills/ultimate-browsing/references/insane-search/twitter.md +104 -0
- package/dist/skills/ultimate-browsing/scripts/cookie_crypto.py +75 -0
- package/dist/skills/ultimate-browsing/scripts/cookie_domains.py +38 -0
- package/dist/skills/ultimate-browsing/scripts/cookie_paths.py +112 -0
- package/dist/skills/ultimate-browsing/scripts/extract_cookies.py +280 -0
- package/dist/skills/ultimate-browsing/scripts/tests/test_cookie_domain_filter.py +110 -0
- package/dist/skills/ultimate-browsing/scripts/tests/test_extract_cookies.py +245 -0
- package/dist/skills/ultraresearch/ATTRIBUTION.md +49 -0
- package/dist/skills/ultraresearch/SKILL.md +23 -4
- package/dist/skills/ulw-plan/SKILL.md +4 -1
- package/dist/tools/delegate-task/sync-task-deps.d.ts +8 -6
- package/dist/tools/skill-mcp/tools.d.ts +1 -1
- package/dist/tui.js +9 -1
- package/package.json +16 -14
- package/packages/omo-codex/THIRD-PARTY-NOTICES.md +27 -4
- 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/dist/cli.js +134 -42
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/LICENSE +21 -0
- package/packages/omo-codex/plugin/components/codegraph/NODE-RUNTIME-LICENSES.md +2951 -0
- package/packages/omo-codex/plugin/components/codegraph/NOTICE +16 -0
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +323 -39
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +292 -19
- package/packages/omo-codex/plugin/components/codegraph/package.json +9 -3
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +75 -0
- package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +29 -13
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +20 -7
- package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +1 -243
- package/packages/omo-codex/plugin/components/codegraph/test/package-runtime.test.ts +91 -0
- package/packages/omo-codex/plugin/components/codegraph/test/provisioned-node-guard.test.ts +1 -1
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-facade.test.ts +68 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve-node-support.test.ts +11 -1
- package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable.test.ts +133 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +1 -113
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-node-support.test.ts +8 -1
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-trust-boundary.test.ts +63 -0
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-availability.test.ts +106 -0
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +150 -0
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +3 -3
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/src/sparkshell-awareness.ts +3 -3
- package/packages/omo-codex/plugin/components/rules/test/sparkshell-awareness.test.ts +33 -9
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/SKILL.md +59 -32
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-guide.mjs +17 -16
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-state.mjs +70 -3
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-worktree.mjs +113 -0
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team.mjs +63 -4
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +5 -4
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +24 -3
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +8 -7
- package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +1 -1
- package/packages/omo-codex/plugin/package-lock.json +112 -13
- package/packages/omo-codex/plugin/package.json +2 -2
- package/packages/omo-codex/plugin/scripts/auto-update-plan.mjs +133 -0
- package/packages/omo-codex/plugin/scripts/auto-update-release-notes.mjs +135 -0
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +33 -133
- package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +41 -0
- package/packages/omo-codex/plugin/shared/src/config-loader.ts +20 -2
- package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +16 -0
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +32 -8
- package/packages/omo-codex/plugin/skills/frontend/references/design/airbnb.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/airtable.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/apple.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/binance.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/bmw.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/bugatti.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/cal.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/claude.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/clay.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/clickhouse.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/cohere.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/coinbase.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/composio.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/cursor.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/elevenlabs.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/expo.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/ferrari.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/figma.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/framer.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/hashicorp.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/ibm.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-frontend-web.md +380 -79
- package/packages/omo-codex/plugin/skills/frontend/references/design/intercom.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/kraken.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/lamborghini.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/linear.app.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/lovable.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/mastercard.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/meta.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/minimax.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/mintlify.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/miro.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/mistral.ai.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/mongodb.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/nike.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/notion.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/nvidia.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/ollama.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/opencode.ai.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/pinterest.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/playstation.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/posthog.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/raycast.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/renault.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/replicate.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/resend.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/revolut.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/runwayml.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/sanity.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/sentry.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/shopify.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/spacex.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/spotify.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/starbucks.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stitch-skill.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/stripe.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/supabase.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/superhuman.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/taste-skill.md +1188 -208
- package/packages/omo-codex/plugin/skills/frontend/references/design/tesla.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/theverge.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/together.ai.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/uber.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/vercel.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/vodafone.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/voltagent.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/warp.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/webflow.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/wired.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/wise.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/x.ai.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/zapier.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/README.md +501 -115
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/charts.csv +26 -26
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/colors.csv +162 -97
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/icons.csv +105 -100
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/landing.csv +22 -18
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/products.csv +162 -97
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -53
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -56
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -53
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -54
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -54
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -51
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -50
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/styles.csv +17 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/typography.csv +17 -1
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -101
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/web-interface.csv +30 -30
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/core.py +31 -22
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/design_system.py +150 -69
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/search.py +3 -3
- package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/teammode/SKILL.md +59 -32
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-guide.mjs +17 -16
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-state.mjs +70 -3
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-worktree.mjs +113 -0
- package/packages/omo-codex/plugin/skills/teammode/scripts/team.mjs +63 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +105 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +140 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/agents/openai.yaml +2 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/__init__.py +24 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/__main__.py +106 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/bias_check.py +174 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/curl_probe.py +91 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/executor.py +192 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/fetch_chain.py +268 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/referers.py +15 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/result_schema.py +45 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/summary.py +37 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +11 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +129 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +167 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_fetch_chain.py +77 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +282 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/url_transforms.py +98 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/validators.py +216 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/waf_detector.py +214 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/waf_profiles.yaml +162 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/README.md +79 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/career.md +29 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/dev.md +62 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/search.md +33 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/social.md +207 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/video.md +115 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/web.md +76 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +120 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +319 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/cache-archive.md +83 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/fallback.md +159 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/jina.md +130 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/json-api.md +133 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/media.md +123 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/metadata.md +116 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/naver.md +107 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/playwright.md +142 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/public-api.md +119 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/rss.md +123 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/tls-impersonate.md +186 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/twitter.md +104 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/cookie_crypto.py +75 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/cookie_domains.py +38 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/cookie_paths.py +112 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/extract_cookies.py +280 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/tests/test_cookie_domain_filter.py +110 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/tests/test_extract_cookies.py +245 -0
- package/packages/omo-codex/plugin/skills/ultraresearch/ATTRIBUTION.md +49 -0
- package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +23 -4
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +8 -7
- package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +2 -1
- package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +95 -0
- package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +12 -3
- package/packages/omo-codex/plugin/test/component-codegraph-mcp-smoke.test.mjs +76 -0
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +1 -0
- package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +87 -0
- package/packages/omo-codex/plugin/test/teammode-thread-title.test.mjs +169 -0
- package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +246 -0
- package/packages/omo-codex/plugin/test/ultraresearch-skill-contract.test.mjs +30 -0
- package/packages/omo-codex/scripts/install-cli-args.test.mjs +1 -1
- package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +23 -0
- package/packages/omo-codex/scripts/install-delegated-command.test.mjs +76 -4
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +520 -216
- package/packages/omo-codex/scripts/install-local-entrypoint.test.mjs +40 -3
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +32 -8
- package/packages/shared-skills/skills/frontend/references/design/airbnb.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/airtable.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/apple.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/binance.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/bmw.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/bugatti.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/cal.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/claude.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/clay.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/clickhouse.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/cohere.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/coinbase.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/composio.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/cursor.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/elevenlabs.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/expo.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/ferrari.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/figma.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/framer.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/hashicorp.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/ibm.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/imagegen-frontend-web.md +380 -79
- package/packages/shared-skills/skills/frontend/references/design/intercom.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/kraken.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/lamborghini.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/linear.app.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/lovable.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/mastercard.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/meta.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/minimax.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/mintlify.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/miro.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/mistral.ai.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/mongodb.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/nike.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/notion.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/nvidia.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/ollama.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/opencode.ai.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/pinterest.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/playstation.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/posthog.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/raycast.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/renault.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/replicate.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/resend.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/revolut.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/runwayml.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/sanity.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/sentry.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/shopify.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/spacex.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/spotify.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/starbucks.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/stitch-skill.md +1 -1
- package/packages/shared-skills/skills/frontend/references/design/stripe.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/supabase.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/superhuman.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/taste-skill.md +1188 -208
- package/packages/shared-skills/skills/frontend/references/design/tesla.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/theverge.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/together.ai.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/uber.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/vercel.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/vodafone.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/voltagent.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/warp.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/webflow.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/wired.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/wise.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/x.ai.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/zapier.md +3 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/README.md +501 -115
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/charts.csv +26 -26
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/colors.csv +162 -97
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/icons.csv +105 -100
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/landing.csv +22 -18
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/products.csv +162 -97
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -53
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -56
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -53
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -54
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -54
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -51
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -50
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/styles.csv +17 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/typography.csv +17 -1
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -101
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/web-interface.csv +30 -30
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/core.py +31 -22
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/design_system.py +150 -69
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/search.py +3 -3
- package/packages/shared-skills/skills/lcx-doctor/SKILL.md +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +105 -0
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +140 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/__init__.py +24 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/__main__.py +106 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/bias_check.py +174 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/curl_probe.py +91 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/executor.py +192 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/fetch_chain.py +268 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/referers.py +15 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/result_schema.py +45 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/summary.py +37 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +11 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +129 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +167 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_fetch_chain.py +77 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +282 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/url_transforms.py +98 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/validators.py +216 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/waf_detector.py +214 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/waf_profiles.yaml +162 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/README.md +79 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/career.md +29 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/dev.md +62 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/search.md +33 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/social.md +207 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/video.md +115 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/web.md +76 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +120 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +319 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/cache-archive.md +83 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/fallback.md +159 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/jina.md +130 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/json-api.md +133 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/media.md +123 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/metadata.md +116 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/naver.md +107 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/playwright.md +142 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/public-api.md +119 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/rss.md +123 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/tls-impersonate.md +186 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/twitter.md +104 -0
- package/packages/shared-skills/skills/ultimate-browsing/scripts/cookie_crypto.py +75 -0
- package/packages/shared-skills/skills/ultimate-browsing/scripts/cookie_domains.py +38 -0
- package/packages/shared-skills/skills/ultimate-browsing/scripts/cookie_paths.py +112 -0
- package/packages/shared-skills/skills/ultimate-browsing/scripts/extract_cookies.py +280 -0
- package/packages/shared-skills/skills/ultimate-browsing/scripts/tests/test_cookie_domain_filter.py +110 -0
- package/packages/shared-skills/skills/ultimate-browsing/scripts/tests/test_extract_cookies.py +245 -0
- package/packages/shared-skills/skills/ultraresearch/ATTRIBUTION.md +49 -0
- package/packages/shared-skills/skills/ultraresearch/SKILL.md +23 -4
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +4 -1
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.d.ts +0 -2
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.d.ts +0 -32
|
@@ -16,7 +16,7 @@ var __export = (target, all) => {
|
|
|
16
16
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
17
17
|
|
|
18
18
|
// packages/utils/src/xdg-data-dir.ts
|
|
19
|
-
import { accessSync, constants, mkdirSync } from "node:fs";
|
|
19
|
+
import { accessSync as accessSync2, constants as constants2, mkdirSync } from "node:fs";
|
|
20
20
|
import os from "node:os";
|
|
21
21
|
import path from "node:path";
|
|
22
22
|
function resolveXdgDataDir(appName, options = {}) {
|
|
@@ -28,7 +28,7 @@ function resolveXdgDataDir(appName, options = {}) {
|
|
|
28
28
|
function resolveWritableDirectory(preferredDir, fallbackSuffix, osProvider) {
|
|
29
29
|
try {
|
|
30
30
|
mkdirSync(preferredDir, { recursive: true });
|
|
31
|
-
|
|
31
|
+
accessSync2(preferredDir, constants2.W_OK);
|
|
32
32
|
return preferredDir;
|
|
33
33
|
} catch (error) {
|
|
34
34
|
if (!(error instanceof Error))
|
|
@@ -95,21 +95,21 @@ var init_atomic_write = __esm(() => {
|
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
// packages/telemetry-core/src/activity-state.ts
|
|
98
|
-
import { existsSync as
|
|
99
|
-
import { basename as
|
|
98
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync } from "node:fs";
|
|
99
|
+
import { basename as basename6, join as join29 } from "node:path";
|
|
100
100
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
101
101
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
102
102
|
env: options.env,
|
|
103
103
|
osProvider: options.osProvider
|
|
104
104
|
});
|
|
105
|
-
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined :
|
|
106
|
-
if (dataDir === xdgStateDir || xdgStateDir === undefined &&
|
|
105
|
+
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join29(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
106
|
+
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename6(dataDir) === product.cacheDirName) {
|
|
107
107
|
return dataDir;
|
|
108
108
|
}
|
|
109
|
-
return
|
|
109
|
+
return join29(dataDir, product.cacheDirName);
|
|
110
110
|
}
|
|
111
111
|
function getTelemetryActivityStateFilePath(stateDir) {
|
|
112
|
-
return
|
|
112
|
+
return join29(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
|
|
113
113
|
}
|
|
114
114
|
function getDailyActiveCaptureState(input) {
|
|
115
115
|
const state = readPostHogActivityState(input.stateDir, input.diagnostics);
|
|
@@ -134,7 +134,7 @@ function isPostHogActivityState(value) {
|
|
|
134
134
|
}
|
|
135
135
|
function readPostHogActivityState(stateDir, diagnostics) {
|
|
136
136
|
const stateFilePath = getTelemetryActivityStateFilePath(stateDir);
|
|
137
|
-
if (!
|
|
137
|
+
if (!existsSync5(stateFilePath)) {
|
|
138
138
|
return {};
|
|
139
139
|
}
|
|
140
140
|
try {
|
|
@@ -179,10 +179,10 @@ var init_activity_state = __esm(() => {
|
|
|
179
179
|
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
|
|
180
180
|
|
|
181
181
|
// packages/telemetry-core/src/diagnostics.ts
|
|
182
|
-
import { appendFileSync, existsSync as
|
|
183
|
-
import { join as
|
|
182
|
+
import { appendFileSync, existsSync as existsSync6, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
183
|
+
import { join as join30 } from "node:path";
|
|
184
184
|
function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
|
|
185
|
-
return
|
|
185
|
+
return join30(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
|
|
186
186
|
}
|
|
187
187
|
function writeTelemetryDiagnostic(input, options) {
|
|
188
188
|
const now = options.now ?? new Date;
|
|
@@ -200,7 +200,7 @@ function writeTelemetryDiagnostic(input, options) {
|
|
|
200
200
|
}
|
|
201
201
|
function cleanupTelemetryDiagnostics(options) {
|
|
202
202
|
const diagnosticsFilePath = getTelemetryDiagnosticsFilePath(options.diagnosticsDir);
|
|
203
|
-
if (!
|
|
203
|
+
if (!existsSync6(diagnosticsFilePath)) {
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
206
|
try {
|
|
@@ -348,7 +348,7 @@ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetr
|
|
|
348
348
|
var init_machine_id = () => {};
|
|
349
349
|
|
|
350
350
|
// node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
351
|
-
import { dirname as
|
|
351
|
+
import { dirname as dirname8, posix, sep as sep7 } from "node:path";
|
|
352
352
|
function createModulerModifier() {
|
|
353
353
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
354
354
|
return async (frames) => {
|
|
@@ -357,7 +357,7 @@ function createModulerModifier() {
|
|
|
357
357
|
return frames;
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
360
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname8(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
|
|
361
361
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
362
362
|
return (filename) => {
|
|
363
363
|
if (!filename)
|
|
@@ -5907,7 +5907,7 @@ var package_default;
|
|
|
5907
5907
|
var init_package = __esm(() => {
|
|
5908
5908
|
package_default = {
|
|
5909
5909
|
name: "@oh-my-opencode/omo-codex",
|
|
5910
|
-
version: "4.
|
|
5910
|
+
version: "4.13.0",
|
|
5911
5911
|
type: "module",
|
|
5912
5912
|
private: true,
|
|
5913
5913
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -6042,7 +6042,7 @@ function createPostHogClient(source, options = {}) {
|
|
|
6042
6042
|
osProvider: options.osProvider ?? resolveOsProvider(),
|
|
6043
6043
|
product: createCodexTelemetryProductConfig(),
|
|
6044
6044
|
source,
|
|
6045
|
-
transportFactory: options.transportFactory
|
|
6045
|
+
transportFactory: options.transportFactory ?? transportFactoryOverride ?? undefined
|
|
6046
6046
|
});
|
|
6047
6047
|
if (!client.enabled) {
|
|
6048
6048
|
return NO_OP_POSTHOG;
|
|
@@ -6093,7 +6093,7 @@ function __setActivityStateProviderForTesting(provider) {
|
|
|
6093
6093
|
function __resetActivityStateProviderForTesting() {
|
|
6094
6094
|
activityStateProviderOverride = null;
|
|
6095
6095
|
}
|
|
6096
|
-
var osProviderOverride2 = null, activityStateProviderOverride = null, NO_OP_POSTHOG;
|
|
6096
|
+
var osProviderOverride2 = null, activityStateProviderOverride = null, transportFactoryOverride = null, NO_OP_POSTHOG;
|
|
6097
6097
|
var init_posthog = __esm(() => {
|
|
6098
6098
|
init_src();
|
|
6099
6099
|
init_diagnostics2();
|
|
@@ -6127,7 +6127,7 @@ var init_telemetry = __esm(() => {
|
|
|
6127
6127
|
|
|
6128
6128
|
// packages/omo-codex/src/install/install-local-cli.ts
|
|
6129
6129
|
import { readFile as readFile19 } from "node:fs/promises";
|
|
6130
|
-
import { dirname as
|
|
6130
|
+
import { dirname as dirname10, join as join35, resolve as resolve11 } from "node:path";
|
|
6131
6131
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
6132
6132
|
|
|
6133
6133
|
// packages/utils/src/runtime/spawn.ts
|
|
@@ -6284,6 +6284,70 @@ function spawn(cmdOrOpts, opts) {
|
|
|
6284
6284
|
throw new Error("spawn requires a command");
|
|
6285
6285
|
return wrapNodeProcess(nodeSpawn(bin, args, createNodeSpawnOptions(options)));
|
|
6286
6286
|
}
|
|
6287
|
+
// packages/utils/src/runtime/which.ts
|
|
6288
|
+
import { accessSync, constants } from "node:fs";
|
|
6289
|
+
import { delimiter, join } from "node:path";
|
|
6290
|
+
var runtime2 = globalThis;
|
|
6291
|
+
function isUnsafeCommandName(commandName) {
|
|
6292
|
+
if (commandName.includes("/") || commandName.includes("\\"))
|
|
6293
|
+
return true;
|
|
6294
|
+
if (commandName === "." || commandName === ".." || commandName.includes(".."))
|
|
6295
|
+
return true;
|
|
6296
|
+
if (/^[a-zA-Z]:/.test(commandName))
|
|
6297
|
+
return true;
|
|
6298
|
+
if (commandName.includes("\x00"))
|
|
6299
|
+
return true;
|
|
6300
|
+
return false;
|
|
6301
|
+
}
|
|
6302
|
+
function isExecutable(filePath) {
|
|
6303
|
+
try {
|
|
6304
|
+
accessSync(filePath, process.platform === "win32" ? constants.F_OK : constants.X_OK);
|
|
6305
|
+
return true;
|
|
6306
|
+
} catch (error) {
|
|
6307
|
+
if (!(error instanceof Error) && Object.prototype.toString.call(error) !== "[object Error]") {
|
|
6308
|
+
throw error;
|
|
6309
|
+
}
|
|
6310
|
+
return false;
|
|
6311
|
+
}
|
|
6312
|
+
}
|
|
6313
|
+
function resolvePathValue() {
|
|
6314
|
+
if (process.platform === "win32")
|
|
6315
|
+
return process.env["Path"] ?? process.env["PATH"];
|
|
6316
|
+
return process.env["PATH"];
|
|
6317
|
+
}
|
|
6318
|
+
function getWindowsCandidates(commandName) {
|
|
6319
|
+
if (process.platform !== "win32")
|
|
6320
|
+
return [commandName];
|
|
6321
|
+
if (/\.[^\\/]+$/.test(commandName))
|
|
6322
|
+
return [commandName];
|
|
6323
|
+
return [commandName, `${commandName}.exe`, `${commandName}.cmd`, `${commandName}.bat`, `${commandName}.com`];
|
|
6324
|
+
}
|
|
6325
|
+
function bunWhich(commandName) {
|
|
6326
|
+
if (!commandName)
|
|
6327
|
+
return null;
|
|
6328
|
+
if (isUnsafeCommandName(commandName))
|
|
6329
|
+
return null;
|
|
6330
|
+
const candidateNames = getWindowsCandidates(commandName);
|
|
6331
|
+
for (const candidateName of candidateNames) {
|
|
6332
|
+
const resolvedPath = runtime2.Bun?.which(candidateName) ?? null;
|
|
6333
|
+
if (resolvedPath !== null)
|
|
6334
|
+
return resolvedPath;
|
|
6335
|
+
}
|
|
6336
|
+
const pathValue = resolvePathValue();
|
|
6337
|
+
if (!pathValue)
|
|
6338
|
+
return null;
|
|
6339
|
+
const pathEntries = pathValue.split(delimiter).filter((pathEntry) => pathEntry.length > 0);
|
|
6340
|
+
if (pathEntries.length === 0)
|
|
6341
|
+
return null;
|
|
6342
|
+
for (const pathEntry of pathEntries) {
|
|
6343
|
+
for (const candidateName of candidateNames) {
|
|
6344
|
+
const candidatePath = join(pathEntry, candidateName);
|
|
6345
|
+
if (isExecutable(candidatePath))
|
|
6346
|
+
return candidatePath;
|
|
6347
|
+
}
|
|
6348
|
+
}
|
|
6349
|
+
return null;
|
|
6350
|
+
}
|
|
6287
6351
|
// packages/utils/src/runtime/git-bash.ts
|
|
6288
6352
|
import { execFileSync } from "node:child_process";
|
|
6289
6353
|
import { existsSync } from "node:fs";
|
|
@@ -6395,13 +6459,13 @@ var defaultRunCommand = async (command, args, options) => {
|
|
|
6395
6459
|
};
|
|
6396
6460
|
|
|
6397
6461
|
// packages/omo-codex/src/install/install-codex.ts
|
|
6398
|
-
import { join as
|
|
6399
|
-
import { existsSync as
|
|
6462
|
+
import { join as join31, resolve as resolve10 } from "node:path";
|
|
6463
|
+
import { existsSync as existsSync7 } from "node:fs";
|
|
6400
6464
|
import { homedir as homedir2 } from "node:os";
|
|
6401
6465
|
|
|
6402
6466
|
// packages/omo-codex/src/install/codex-cache-bins.ts
|
|
6403
6467
|
import { chmod, lstat as lstat3, mkdir, readFile as readFile2, readdir, readlink as readlink2, rm as rm2, stat, symlink, writeFile } from "node:fs/promises";
|
|
6404
|
-
import { basename, isAbsolute, join as
|
|
6468
|
+
import { basename, isAbsolute, join as join4, relative, resolve, sep } from "node:path";
|
|
6405
6469
|
|
|
6406
6470
|
// packages/omo-codex/src/install/codex-cache-command-shim.ts
|
|
6407
6471
|
var COMMAND_SHIM_MARKER = ":: generated by oh-my-openagent Codex installer";
|
|
@@ -6427,7 +6491,7 @@ function isNodeErrorWithCode(error) {
|
|
|
6427
6491
|
|
|
6428
6492
|
// packages/omo-codex/src/install/codex-cache-legacy-bins.ts
|
|
6429
6493
|
import { lstat as lstat2, readFile, readlink, rm } from "node:fs/promises";
|
|
6430
|
-
import { join } from "node:path";
|
|
6494
|
+
import { join as join2 } from "node:path";
|
|
6431
6495
|
var LEGACY_CODEX_COMPONENT_BINS = [
|
|
6432
6496
|
{ name: "omo", component: "ulw-loop" },
|
|
6433
6497
|
{ name: "codex-comment-checker", component: "comment-checker" },
|
|
@@ -6439,7 +6503,7 @@ var LEGACY_CODEX_COMPONENT_BINS = [
|
|
|
6439
6503
|
];
|
|
6440
6504
|
async function removeLegacyCodexComponentBins(binDir, platform) {
|
|
6441
6505
|
for (const entry of LEGACY_CODEX_COMPONENT_BINS) {
|
|
6442
|
-
const linkPath =
|
|
6506
|
+
const linkPath = join2(binDir, platform === "win32" ? `${entry.name}.cmd` : entry.name);
|
|
6443
6507
|
await removeLegacyCodexComponentBin(linkPath, entry.component, platform);
|
|
6444
6508
|
}
|
|
6445
6509
|
}
|
|
@@ -6490,10 +6554,10 @@ function isNodeErrorWithCode2(error) {
|
|
|
6490
6554
|
}
|
|
6491
6555
|
|
|
6492
6556
|
// packages/omo-codex/src/install/codex-cache-runtime-wrapper.ts
|
|
6493
|
-
import { join as
|
|
6557
|
+
import { join as join3 } from "node:path";
|
|
6494
6558
|
var RUNTIME_WRAPPER_MARKER = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
6495
6559
|
function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
6496
|
-
const ulwLoopBin = toPosixPath(
|
|
6560
|
+
const ulwLoopBin = toPosixPath(join3(binDir, "omo-ulw-loop"));
|
|
6497
6561
|
const nodeCli = escapePosixDoubleQuoted(toPosixPath(nodeCliPath));
|
|
6498
6562
|
const escapedCliPath = escapePosixDoubleQuoted(toPosixPath(cliPath));
|
|
6499
6563
|
const escapedCodexHome = escapePosixDoubleQuoted(toPosixPath(codexHome));
|
|
@@ -6539,7 +6603,7 @@ function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
|
6539
6603
|
`);
|
|
6540
6604
|
}
|
|
6541
6605
|
function windowsRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
6542
|
-
const ulwLoopBin =
|
|
6606
|
+
const ulwLoopBin = join3(binDir, "omo-ulw-loop.cmd");
|
|
6543
6607
|
return [
|
|
6544
6608
|
"@echo off",
|
|
6545
6609
|
`rem ${RUNTIME_WRAPPER_MARKER}`,
|
|
@@ -6595,29 +6659,29 @@ async function linkCachedPluginBins(input) {
|
|
|
6595
6659
|
return linked;
|
|
6596
6660
|
}
|
|
6597
6661
|
async function linkRootRuntimeBin(input) {
|
|
6598
|
-
const cliPath =
|
|
6662
|
+
const cliPath = join4(input.repoRoot, "dist", "cli", "index.js");
|
|
6599
6663
|
if (!await isFile(cliPath))
|
|
6600
6664
|
return null;
|
|
6601
|
-
const nodeCliPath =
|
|
6665
|
+
const nodeCliPath = join4(input.repoRoot, "dist", "cli-node", "index.js");
|
|
6602
6666
|
const platform = input.platform ?? process.platform;
|
|
6603
6667
|
await mkdir(input.binDir, { recursive: true });
|
|
6604
6668
|
if (platform === "win32") {
|
|
6605
|
-
const linkPath2 =
|
|
6669
|
+
const linkPath2 = join4(input.binDir, "omo.cmd");
|
|
6606
6670
|
await replaceRuntimeWrapper(linkPath2, windowsRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
|
|
6607
6671
|
return { name: "omo", path: linkPath2, target: cliPath };
|
|
6608
6672
|
}
|
|
6609
|
-
const linkPath =
|
|
6673
|
+
const linkPath = join4(input.binDir, "omo");
|
|
6610
6674
|
await replaceRuntimeWrapper(linkPath, posixRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
|
|
6611
6675
|
await chmod(linkPath, 493);
|
|
6612
6676
|
return { name: "omo", path: linkPath, target: cliPath };
|
|
6613
6677
|
}
|
|
6614
6678
|
async function linkCachedPluginBin(binDir, link, platform) {
|
|
6615
6679
|
if (platform === "win32") {
|
|
6616
|
-
const linkPath2 =
|
|
6680
|
+
const linkPath2 = join4(binDir, `${link.name}.cmd`);
|
|
6617
6681
|
await replaceCommandShim(linkPath2, link.target);
|
|
6618
6682
|
return linkPath2;
|
|
6619
6683
|
}
|
|
6620
|
-
const linkPath =
|
|
6684
|
+
const linkPath = join4(binDir, link.name);
|
|
6621
6685
|
await replaceSymlink(linkPath, link.target);
|
|
6622
6686
|
return linkPath;
|
|
6623
6687
|
}
|
|
@@ -6638,14 +6702,14 @@ async function discoverPackageBins(root) {
|
|
|
6638
6702
|
async function collectPackageBins(directory, root, links) {
|
|
6639
6703
|
const entries = await readdir(directory, { withFileTypes: true });
|
|
6640
6704
|
if (entries.some((entry) => entry.isFile() && entry.name === "package.json")) {
|
|
6641
|
-
await appendPackageBinLinks(
|
|
6705
|
+
await appendPackageBinLinks(join4(directory, "package.json"), directory, root, links);
|
|
6642
6706
|
}
|
|
6643
6707
|
for (const entry of entries) {
|
|
6644
6708
|
if (!entry.isDirectory())
|
|
6645
6709
|
continue;
|
|
6646
6710
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist")
|
|
6647
6711
|
continue;
|
|
6648
|
-
const childPath =
|
|
6712
|
+
const childPath = join4(directory, entry.name);
|
|
6649
6713
|
if (!childPath.startsWith(root))
|
|
6650
6714
|
continue;
|
|
6651
6715
|
await collectPackageBins(childPath, root, links);
|
|
@@ -6760,11 +6824,11 @@ async function existingNonSymlink(path) {
|
|
|
6760
6824
|
}
|
|
6761
6825
|
// packages/omo-codex/src/install/codex-cache-install.ts
|
|
6762
6826
|
import { cp as cp2, mkdir as mkdir3, readFile as readFile7, rename, rm as rm3 } from "node:fs/promises";
|
|
6763
|
-
import { basename as basename2, dirname as dirname3, join as
|
|
6827
|
+
import { basename as basename2, dirname as dirname3, join as join10, sep as sep5 } from "node:path";
|
|
6764
6828
|
|
|
6765
6829
|
// packages/omo-codex/src/install/codex-cache-bundled-mcps.ts
|
|
6766
6830
|
import { cp, mkdir as mkdir2, readFile as readFile3, stat as stat2 } from "node:fs/promises";
|
|
6767
|
-
import { dirname, join as
|
|
6831
|
+
import { dirname, join as join5, resolve as resolve2 } from "node:path";
|
|
6768
6832
|
var BUNDLED_MCP_RUNTIMES = [
|
|
6769
6833
|
{
|
|
6770
6834
|
label: "Git Bash MCP",
|
|
@@ -6782,23 +6846,23 @@ var BUNDLED_MCP_RUNTIMES = [
|
|
|
6782
6846
|
}
|
|
6783
6847
|
];
|
|
6784
6848
|
async function copyBundledMcpRuntimeDists(input) {
|
|
6785
|
-
const sourceArgs = await readSourceMcpArgs(
|
|
6786
|
-
for (const
|
|
6787
|
-
if (!sourceArgs.has(
|
|
6849
|
+
const sourceArgs = await readSourceMcpArgs(join5(input.sourceRoot, ".mcp.json"));
|
|
6850
|
+
for (const runtime3 of BUNDLED_MCP_RUNTIMES) {
|
|
6851
|
+
if (!sourceArgs.has(runtime3.sourceArg))
|
|
6788
6852
|
continue;
|
|
6789
|
-
await copyBundledMcpRuntimeDist(input.pluginRoot, input.sourceRoot,
|
|
6853
|
+
await copyBundledMcpRuntimeDist(input.pluginRoot, input.sourceRoot, runtime3);
|
|
6790
6854
|
}
|
|
6791
6855
|
}
|
|
6792
6856
|
function resolveBundledMcpRuntimeArg(pluginRoot, arg) {
|
|
6793
|
-
const
|
|
6794
|
-
return
|
|
6857
|
+
const runtime3 = BUNDLED_MCP_RUNTIMES.find((candidate) => candidate.sourceArg === arg);
|
|
6858
|
+
return runtime3 ? join5(pluginRoot, runtime3.destinationArg) : null;
|
|
6795
6859
|
}
|
|
6796
|
-
async function copyBundledMcpRuntimeDist(pluginRoot, sourceRoot,
|
|
6797
|
-
const sourcePath = resolve2(sourceRoot,
|
|
6860
|
+
async function copyBundledMcpRuntimeDist(pluginRoot, sourceRoot, runtime3) {
|
|
6861
|
+
const sourcePath = resolve2(sourceRoot, runtime3.sourceDistFromPlugin);
|
|
6798
6862
|
if (!await isDirectory(sourcePath)) {
|
|
6799
|
-
throw new Error(`missing built ${
|
|
6863
|
+
throw new Error(`missing built ${runtime3.label} dist at ${sourcePath}`);
|
|
6800
6864
|
}
|
|
6801
|
-
const destinationPath =
|
|
6865
|
+
const destinationPath = join5(pluginRoot, runtime3.destinationDistFromPlugin);
|
|
6802
6866
|
await mkdir2(dirname(destinationPath), { recursive: true });
|
|
6803
6867
|
await cp(sourcePath, destinationPath, { recursive: true });
|
|
6804
6868
|
}
|
|
@@ -6837,10 +6901,10 @@ async function isDirectory(path) {
|
|
|
6837
6901
|
// packages/omo-codex/src/install/codex-cache-local-dependencies.ts
|
|
6838
6902
|
import { realpathSync } from "node:fs";
|
|
6839
6903
|
import { readFile as readFile4, readdir as readdir2, writeFile as writeFile2 } from "node:fs/promises";
|
|
6840
|
-
import { dirname as dirname2, isAbsolute as isAbsolute3, join as
|
|
6904
|
+
import { dirname as dirname2, isAbsolute as isAbsolute3, join as join7, relative as relative3, resolve as resolve4, sep as sep2 } from "node:path";
|
|
6841
6905
|
|
|
6842
6906
|
// packages/omo-codex/src/install/codex-cache-paths.ts
|
|
6843
|
-
import { isAbsolute as isAbsolute2, join as
|
|
6907
|
+
import { isAbsolute as isAbsolute2, join as join6, relative as relative2, resolve as resolve3 } from "node:path";
|
|
6844
6908
|
function resolveCachedRuntimePath(pluginRoot, sourceRoot, runtimePath) {
|
|
6845
6909
|
const targetPath = resolve3(pluginRoot, runtimePath);
|
|
6846
6910
|
if (isPathInside(targetPath, pluginRoot))
|
|
@@ -6863,7 +6927,7 @@ async function rewriteCachedPackageLocalFileDependencies(pluginRoot, sourceRoot)
|
|
|
6863
6927
|
if (!isPlainRecord(parsed))
|
|
6864
6928
|
continue;
|
|
6865
6929
|
const packageDir = dirname2(packageJsonPath);
|
|
6866
|
-
const sourcePackageDir =
|
|
6930
|
+
const sourcePackageDir = join7(sourceRoot, relative3(pluginRoot, packageDir));
|
|
6867
6931
|
let changed = false;
|
|
6868
6932
|
for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
|
|
6869
6933
|
const dependencies = parsed[field];
|
|
@@ -6901,7 +6965,7 @@ async function rewriteCachedPackageLocalFileDependencies(pluginRoot, sourceRoot)
|
|
|
6901
6965
|
`);
|
|
6902
6966
|
}
|
|
6903
6967
|
async function readPackageLock(pluginRoot) {
|
|
6904
|
-
const path =
|
|
6968
|
+
const path = join7(pluginRoot, "package-lock.json");
|
|
6905
6969
|
try {
|
|
6906
6970
|
const parsed = JSON.parse(await readFile4(path, "utf8"));
|
|
6907
6971
|
return { path, value: isPlainRecord(parsed) ? parsed : null, changed: false };
|
|
@@ -6962,14 +7026,14 @@ function canonicalizeExistingPath(path) {
|
|
|
6962
7026
|
async function collectPackageJsonPaths(directory, root, paths) {
|
|
6963
7027
|
const entries = await readdir2(directory, { withFileTypes: true });
|
|
6964
7028
|
if (entries.some((entry) => entry.isFile() && entry.name === "package.json")) {
|
|
6965
|
-
paths.push(
|
|
7029
|
+
paths.push(join7(directory, "package.json"));
|
|
6966
7030
|
}
|
|
6967
7031
|
for (const entry of entries) {
|
|
6968
7032
|
if (!entry.isDirectory())
|
|
6969
7033
|
continue;
|
|
6970
7034
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist")
|
|
6971
7035
|
continue;
|
|
6972
|
-
const childPath =
|
|
7036
|
+
const childPath = join7(directory, entry.name);
|
|
6973
7037
|
if (!isPathInside(childPath, root))
|
|
6974
7038
|
continue;
|
|
6975
7039
|
await collectPackageJsonPaths(childPath, root, paths);
|
|
@@ -6978,10 +7042,10 @@ async function collectPackageJsonPaths(directory, root, paths) {
|
|
|
6978
7042
|
|
|
6979
7043
|
// packages/omo-codex/src/install/codex-cache-mcp-manifest.ts
|
|
6980
7044
|
import { readFile as readFile5, writeFile as writeFile3 } from "node:fs/promises";
|
|
6981
|
-
import { join as
|
|
7045
|
+
import { join as join8, sep as sep3 } from "node:path";
|
|
6982
7046
|
var CODEGRAPH_RELATIVE_ARGS = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
6983
7047
|
async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
6984
|
-
const manifestPath =
|
|
7048
|
+
const manifestPath = join8(pluginRoot, ".mcp.json");
|
|
6985
7049
|
if (!await fileExistsStrict(manifestPath))
|
|
6986
7050
|
return;
|
|
6987
7051
|
const raw = await readFile5(manifestPath, "utf8");
|
|
@@ -7006,7 +7070,7 @@ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
|
7006
7070
|
if (bundledMcpRuntimeArg !== null)
|
|
7007
7071
|
return bundledMcpRuntimeArg;
|
|
7008
7072
|
if (CODEGRAPH_RELATIVE_ARGS.has(arg))
|
|
7009
|
-
return
|
|
7073
|
+
return join8(pluginRoot, "components", "codegraph", "dist", "serve.js");
|
|
7010
7074
|
if (arg.startsWith("./") || arg.startsWith("../"))
|
|
7011
7075
|
return resolveCachedRuntimePath(pluginRoot, sourceRoot, arg);
|
|
7012
7076
|
return arg;
|
|
@@ -7021,7 +7085,7 @@ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
|
7021
7085
|
`);
|
|
7022
7086
|
}
|
|
7023
7087
|
async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
|
|
7024
|
-
const manifestPath =
|
|
7088
|
+
const manifestPath = join8(pluginRoot, ".mcp.json");
|
|
7025
7089
|
if (!await fileExistsStrict(manifestPath))
|
|
7026
7090
|
return;
|
|
7027
7091
|
const raw = await readFile5(manifestPath, "utf8");
|
|
@@ -7057,7 +7121,7 @@ async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
|
|
|
7057
7121
|
|
|
7058
7122
|
// packages/omo-codex/src/install/codex-hook-targets.ts
|
|
7059
7123
|
import { readFile as readFile6 } from "node:fs/promises";
|
|
7060
|
-
import { join as
|
|
7124
|
+
import { join as join9, sep as sep4 } from "node:path";
|
|
7061
7125
|
var PLUGIN_ROOT_TARGET_PATTERN = /\$\{PLUGIN_ROOT\}[\\/]+([^"']+)/g;
|
|
7062
7126
|
async function findMissingHookCommandTargets(pluginRoot) {
|
|
7063
7127
|
const commands = [];
|
|
@@ -7074,7 +7138,7 @@ async function findMissingHookCommandTargets(pluginRoot) {
|
|
|
7074
7138
|
const targetSuffix = match[1];
|
|
7075
7139
|
if (targetSuffix === undefined)
|
|
7076
7140
|
continue;
|
|
7077
|
-
const target =
|
|
7141
|
+
const target = join9(pluginRoot, ...targetSuffix.split(/[\\/]+/));
|
|
7078
7142
|
if (seen.has(target))
|
|
7079
7143
|
continue;
|
|
7080
7144
|
seen.add(target);
|
|
@@ -7085,17 +7149,17 @@ async function findMissingHookCommandTargets(pluginRoot) {
|
|
|
7085
7149
|
return missing;
|
|
7086
7150
|
}
|
|
7087
7151
|
async function hookManifestPaths(pluginRoot) {
|
|
7088
|
-
const pluginManifestPath =
|
|
7152
|
+
const pluginManifestPath = join9(pluginRoot, ".codex-plugin", "plugin.json");
|
|
7089
7153
|
if (!await fileExistsStrict(pluginManifestPath))
|
|
7090
|
-
return [
|
|
7154
|
+
return [join9(pluginRoot, "hooks", "hooks.json")];
|
|
7091
7155
|
const parsed = JSON.parse(await readFile6(pluginManifestPath, "utf8"));
|
|
7092
7156
|
if (!isPlainRecord(parsed))
|
|
7093
7157
|
return [];
|
|
7094
7158
|
if (typeof parsed.hooks === "string" && parsed.hooks.trim() !== "") {
|
|
7095
|
-
return [
|
|
7159
|
+
return [join9(pluginRoot, stripDotSlash(parsed.hooks))];
|
|
7096
7160
|
}
|
|
7097
7161
|
if (Array.isArray(parsed.hooks)) {
|
|
7098
|
-
return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) =>
|
|
7162
|
+
return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) => join9(pluginRoot, stripDotSlash(hookPath)));
|
|
7099
7163
|
}
|
|
7100
7164
|
return [];
|
|
7101
7165
|
}
|
|
@@ -7131,7 +7195,7 @@ async function installCachedPlugin(input) {
|
|
|
7131
7195
|
await maybeRunNpmInstall(input.sourcePath, input.runCommand);
|
|
7132
7196
|
await maybeRunNpmBuild(input.sourcePath, input.runCommand);
|
|
7133
7197
|
}
|
|
7134
|
-
const targetPath =
|
|
7198
|
+
const targetPath = join10(input.codexHome, "plugins", "cache", input.marketplaceName, input.name, input.version);
|
|
7135
7199
|
const tempPath = createTempSiblingPath(targetPath);
|
|
7136
7200
|
await rm3(tempPath, { recursive: true, force: true });
|
|
7137
7201
|
try {
|
|
@@ -7152,14 +7216,14 @@ async function installCachedPlugin(input) {
|
|
|
7152
7216
|
return { name: input.name, version: input.version, path: targetPath };
|
|
7153
7217
|
}
|
|
7154
7218
|
async function maybeRunNpmInstall(cwd, runCommand, args = ["install"]) {
|
|
7155
|
-
if (!await fileExistsStrict(
|
|
7219
|
+
if (!await fileExistsStrict(join10(cwd, "package.json")))
|
|
7156
7220
|
return;
|
|
7157
7221
|
await runCommand("npm", args, { cwd });
|
|
7158
7222
|
}
|
|
7159
7223
|
async function maybeRunNpmBuild(cwd, runCommand) {
|
|
7160
|
-
if (!await fileExistsStrict(
|
|
7224
|
+
if (!await fileExistsStrict(join10(cwd, "package.json")))
|
|
7161
7225
|
return;
|
|
7162
|
-
const packageJson = JSON.parse(await readFile7(
|
|
7226
|
+
const packageJson = JSON.parse(await readFile7(join10(cwd, "package.json"), "utf8"));
|
|
7163
7227
|
if (!isPlainRecord(packageJson))
|
|
7164
7228
|
return;
|
|
7165
7229
|
const scripts = packageJson.scripts;
|
|
@@ -7168,9 +7232,9 @@ async function maybeRunNpmBuild(cwd, runCommand) {
|
|
|
7168
7232
|
await runCommand("npm", ["run", "build"], { cwd });
|
|
7169
7233
|
}
|
|
7170
7234
|
async function maybeRunNpmSyncSkills(cwd, runCommand) {
|
|
7171
|
-
if (!await fileExistsStrict(
|
|
7235
|
+
if (!await fileExistsStrict(join10(cwd, "package.json")))
|
|
7172
7236
|
return;
|
|
7173
|
-
const packageJson = JSON.parse(await readFile7(
|
|
7237
|
+
const packageJson = JSON.parse(await readFile7(join10(cwd, "package.json"), "utf8"));
|
|
7174
7238
|
if (!isPlainRecord(packageJson))
|
|
7175
7239
|
return;
|
|
7176
7240
|
const scripts = packageJson.scripts;
|
|
@@ -7179,10 +7243,10 @@ async function maybeRunNpmSyncSkills(cwd, runCommand) {
|
|
|
7179
7243
|
await runCommand("npm", ["run", "sync:skills"], { cwd });
|
|
7180
7244
|
}
|
|
7181
7245
|
function createTempSiblingPath(targetPath) {
|
|
7182
|
-
return
|
|
7246
|
+
return join10(dirname3(targetPath), `.tmp-${basename2(targetPath)}-${process.pid}-${Date.now()}`);
|
|
7183
7247
|
}
|
|
7184
7248
|
function createBackupSiblingPath(targetPath) {
|
|
7185
|
-
return
|
|
7249
|
+
return join10(dirname3(targetPath), `.backup-${basename2(targetPath)}-${process.pid}-${Date.now()}`);
|
|
7186
7250
|
}
|
|
7187
7251
|
async function copyDirectory(sourcePath, targetPath) {
|
|
7188
7252
|
await mkdir3(dirname3(targetPath), { recursive: true });
|
|
@@ -7221,9 +7285,9 @@ function shouldCopyPluginPath(path, root) {
|
|
|
7221
7285
|
}
|
|
7222
7286
|
// packages/omo-codex/src/install/codex-cache-prune.ts
|
|
7223
7287
|
import { lstat as lstat4, readdir as readdir3, rm as rm4, stat as stat3 } from "node:fs/promises";
|
|
7224
|
-
import { join as
|
|
7288
|
+
import { join as join11 } from "node:path";
|
|
7225
7289
|
async function pruneMarketplaceCache(input) {
|
|
7226
|
-
const cacheRoot =
|
|
7290
|
+
const cacheRoot = join11(input.codexHome, "plugins", "cache", input.marketplaceName);
|
|
7227
7291
|
if (!await fileExistsStrict(cacheRoot))
|
|
7228
7292
|
return;
|
|
7229
7293
|
const keep = new Set(input.keepPluginNames);
|
|
@@ -7231,15 +7295,15 @@ async function pruneMarketplaceCache(input) {
|
|
|
7231
7295
|
for (const entry of entries) {
|
|
7232
7296
|
if (!entry.isDirectory() || keep.has(entry.name))
|
|
7233
7297
|
continue;
|
|
7234
|
-
await rm4(
|
|
7298
|
+
await rm4(join11(cacheRoot, entry.name), { recursive: true, force: true });
|
|
7235
7299
|
}
|
|
7236
7300
|
}
|
|
7237
7301
|
async function pruneMarketplacePluginCaches(input) {
|
|
7238
|
-
const cacheRoot =
|
|
7302
|
+
const cacheRoot = join11(input.codexHome, "plugins", "cache", input.marketplaceName);
|
|
7239
7303
|
if (!await fileExistsStrict(cacheRoot))
|
|
7240
7304
|
return;
|
|
7241
7305
|
for (const pluginName of input.pluginNames) {
|
|
7242
|
-
await rm4(
|
|
7306
|
+
await rm4(join11(cacheRoot, pluginName), { recursive: true, force: true });
|
|
7243
7307
|
}
|
|
7244
7308
|
const remainingEntries = await readCacheEntryNames(cacheRoot);
|
|
7245
7309
|
if (remainingEntries.length === 0) {
|
|
@@ -7286,11 +7350,11 @@ async function isBrokenCacheSymlink(path) {
|
|
|
7286
7350
|
}
|
|
7287
7351
|
// packages/omo-codex/src/install/codex-cached-marketplace-manifest.ts
|
|
7288
7352
|
import { mkdir as mkdir4, writeFile as writeFile4 } from "node:fs/promises";
|
|
7289
|
-
import { join as
|
|
7353
|
+
import { join as join12 } from "node:path";
|
|
7290
7354
|
async function writeCachedMarketplaceManifest(input) {
|
|
7291
|
-
const marketplaceDir =
|
|
7355
|
+
const marketplaceDir = join12(input.marketplaceRoot, ".agents", "plugins");
|
|
7292
7356
|
await mkdir4(marketplaceDir, { recursive: true });
|
|
7293
|
-
await writeFile4(
|
|
7357
|
+
await writeFile4(join12(marketplaceDir, "marketplace.json"), `${JSON.stringify({
|
|
7294
7358
|
name: input.marketplaceName,
|
|
7295
7359
|
plugins: input.plugins.map((plugin) => ({
|
|
7296
7360
|
name: plugin.name,
|
|
@@ -7303,7 +7367,7 @@ async function writeCachedMarketplaceManifest(input) {
|
|
|
7303
7367
|
// packages/omo-codex/src/install/codex-package-layout.ts
|
|
7304
7368
|
import { existsSync as existsSync2 } from "node:fs";
|
|
7305
7369
|
import { readFile as readFile8 } from "node:fs/promises";
|
|
7306
|
-
import { join as
|
|
7370
|
+
import { join as join13 } from "node:path";
|
|
7307
7371
|
var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
|
|
7308
7372
|
"@code-yeongyu/lazycodex",
|
|
7309
7373
|
"@code-yeongyu/lazycodex-ai",
|
|
@@ -7313,9 +7377,9 @@ var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
|
|
|
7313
7377
|
"oh-my-openagent"
|
|
7314
7378
|
]);
|
|
7315
7379
|
async function shouldBuildSourcePackages(repoRoot) {
|
|
7316
|
-
if (existsSync2(
|
|
7380
|
+
if (existsSync2(join13(repoRoot, "packages", "omo-opencode", "src", "index.ts")))
|
|
7317
7381
|
return true;
|
|
7318
|
-
const packageJsonPath =
|
|
7382
|
+
const packageJsonPath = join13(repoRoot, "package.json");
|
|
7319
7383
|
if (!existsSync2(packageJsonPath))
|
|
7320
7384
|
return true;
|
|
7321
7385
|
const packageJson = JSON.parse(await readFile8(packageJsonPath, "utf8"));
|
|
@@ -7331,6 +7395,7 @@ import { dirname as dirname5 } from "node:path";
|
|
|
7331
7395
|
// packages/omo-codex/src/install/toml-section-editor.ts
|
|
7332
7396
|
function findTomlSection(config, header) {
|
|
7333
7397
|
const headerLine = `[${header}]`;
|
|
7398
|
+
const targetHeaderPath = parseTomlDottedKey(header);
|
|
7334
7399
|
const lines = config.match(/[^\n]*\n?|$/g) ?? [];
|
|
7335
7400
|
let offset = 0;
|
|
7336
7401
|
let start = -1;
|
|
@@ -7339,7 +7404,7 @@ function findTomlSection(config, header) {
|
|
|
7339
7404
|
break;
|
|
7340
7405
|
const trimmed = line.trim();
|
|
7341
7406
|
if (start === -1) {
|
|
7342
|
-
if (trimmed
|
|
7407
|
+
if (tomlTableHeaderMatches(trimmed, headerLine, targetHeaderPath))
|
|
7343
7408
|
start = offset;
|
|
7344
7409
|
} else if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
7345
7410
|
return { start, end: offset, text: config.slice(start, offset) };
|
|
@@ -7395,6 +7460,127 @@ function insertSetting(sectionText, key, value) {
|
|
|
7395
7460
|
function escapeRegExp(value) {
|
|
7396
7461
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
7397
7462
|
}
|
|
7463
|
+
function tomlTableHeaderMatches(line, headerLine, targetHeaderPath) {
|
|
7464
|
+
if (line === headerLine)
|
|
7465
|
+
return true;
|
|
7466
|
+
if (!targetHeaderPath)
|
|
7467
|
+
return false;
|
|
7468
|
+
const candidateHeaderPath = parseTomlTableHeader(line);
|
|
7469
|
+
if (!candidateHeaderPath || candidateHeaderPath.length !== targetHeaderPath.length)
|
|
7470
|
+
return false;
|
|
7471
|
+
return candidateHeaderPath.every((part, index) => part === targetHeaderPath[index]);
|
|
7472
|
+
}
|
|
7473
|
+
function parseTomlTableHeader(line) {
|
|
7474
|
+
if (!line.startsWith("[") || !line.endsWith("]") || line.startsWith("[["))
|
|
7475
|
+
return null;
|
|
7476
|
+
return parseTomlDottedKey(line.slice(1, -1).trim());
|
|
7477
|
+
}
|
|
7478
|
+
function parseTomlDottedKey(input) {
|
|
7479
|
+
const parts = [];
|
|
7480
|
+
let index = 0;
|
|
7481
|
+
while (index < input.length) {
|
|
7482
|
+
index = skipWhitespace(input, index);
|
|
7483
|
+
const parsedKey = parseTomlKeyPart(input, index);
|
|
7484
|
+
if (!parsedKey)
|
|
7485
|
+
return null;
|
|
7486
|
+
parts.push(parsedKey.value);
|
|
7487
|
+
index = skipWhitespace(input, parsedKey.nextIndex);
|
|
7488
|
+
if (index === input.length)
|
|
7489
|
+
return parts;
|
|
7490
|
+
if (input[index] !== ".")
|
|
7491
|
+
return null;
|
|
7492
|
+
index += 1;
|
|
7493
|
+
}
|
|
7494
|
+
return parts.length > 0 ? parts : null;
|
|
7495
|
+
}
|
|
7496
|
+
function parseTomlKeyPart(input, startIndex) {
|
|
7497
|
+
const quote = input[startIndex];
|
|
7498
|
+
if (quote === "'")
|
|
7499
|
+
return parseLiteralTomlString(input, startIndex);
|
|
7500
|
+
if (quote === '"')
|
|
7501
|
+
return parseBasicTomlString(input, startIndex);
|
|
7502
|
+
return parseBareTomlKey(input, startIndex);
|
|
7503
|
+
}
|
|
7504
|
+
function parseLiteralTomlString(input, startIndex) {
|
|
7505
|
+
let index = startIndex + 1;
|
|
7506
|
+
let value = "";
|
|
7507
|
+
while (index < input.length) {
|
|
7508
|
+
const char = input[index];
|
|
7509
|
+
if (char === "'")
|
|
7510
|
+
return { value, nextIndex: index + 1 };
|
|
7511
|
+
value += char;
|
|
7512
|
+
index += 1;
|
|
7513
|
+
}
|
|
7514
|
+
return null;
|
|
7515
|
+
}
|
|
7516
|
+
function parseBasicTomlString(input, startIndex) {
|
|
7517
|
+
let index = startIndex + 1;
|
|
7518
|
+
let value = "";
|
|
7519
|
+
while (index < input.length) {
|
|
7520
|
+
const char = input[index];
|
|
7521
|
+
if (char === '"')
|
|
7522
|
+
return { value, nextIndex: index + 1 };
|
|
7523
|
+
if (char !== "\\") {
|
|
7524
|
+
value += char;
|
|
7525
|
+
index += 1;
|
|
7526
|
+
continue;
|
|
7527
|
+
}
|
|
7528
|
+
const escaped = parseBasicTomlEscape(input, index);
|
|
7529
|
+
if (!escaped)
|
|
7530
|
+
return null;
|
|
7531
|
+
value += escaped.value;
|
|
7532
|
+
index = escaped.nextIndex;
|
|
7533
|
+
}
|
|
7534
|
+
return null;
|
|
7535
|
+
}
|
|
7536
|
+
function parseBasicTomlEscape(input, backslashIndex) {
|
|
7537
|
+
const escape = input[backslashIndex + 1];
|
|
7538
|
+
if (escape === undefined)
|
|
7539
|
+
return null;
|
|
7540
|
+
if (escape === "b")
|
|
7541
|
+
return { value: "\b", nextIndex: backslashIndex + 2 };
|
|
7542
|
+
if (escape === "t")
|
|
7543
|
+
return { value: "\t", nextIndex: backslashIndex + 2 };
|
|
7544
|
+
if (escape === "n")
|
|
7545
|
+
return { value: `
|
|
7546
|
+
`, nextIndex: backslashIndex + 2 };
|
|
7547
|
+
if (escape === "f")
|
|
7548
|
+
return { value: "\f", nextIndex: backslashIndex + 2 };
|
|
7549
|
+
if (escape === "r")
|
|
7550
|
+
return { value: "\r", nextIndex: backslashIndex + 2 };
|
|
7551
|
+
if (escape === '"')
|
|
7552
|
+
return { value: '"', nextIndex: backslashIndex + 2 };
|
|
7553
|
+
if (escape === "\\")
|
|
7554
|
+
return { value: "\\", nextIndex: backslashIndex + 2 };
|
|
7555
|
+
if (escape === "u")
|
|
7556
|
+
return parseUnicodeEscape(input, backslashIndex + 2, 4);
|
|
7557
|
+
if (escape === "U")
|
|
7558
|
+
return parseUnicodeEscape(input, backslashIndex + 2, 8);
|
|
7559
|
+
return null;
|
|
7560
|
+
}
|
|
7561
|
+
function parseUnicodeEscape(input, digitsStart, digitCount) {
|
|
7562
|
+
const digits = input.slice(digitsStart, digitsStart + digitCount);
|
|
7563
|
+
if (digits.length !== digitCount || !/^[0-9A-Fa-f]+$/.test(digits))
|
|
7564
|
+
return null;
|
|
7565
|
+
const codePoint = Number.parseInt(digits, 16);
|
|
7566
|
+
if (codePoint > 1114111)
|
|
7567
|
+
return null;
|
|
7568
|
+
return { value: String.fromCodePoint(codePoint), nextIndex: digitsStart + digitCount };
|
|
7569
|
+
}
|
|
7570
|
+
function parseBareTomlKey(input, startIndex) {
|
|
7571
|
+
let index = startIndex;
|
|
7572
|
+
while (index < input.length && /[A-Za-z0-9_-]/.test(input[index]))
|
|
7573
|
+
index += 1;
|
|
7574
|
+
if (index === startIndex)
|
|
7575
|
+
return null;
|
|
7576
|
+
return { value: input.slice(startIndex, index), nextIndex: index };
|
|
7577
|
+
}
|
|
7578
|
+
function skipWhitespace(input, startIndex) {
|
|
7579
|
+
let index = startIndex;
|
|
7580
|
+
while (index < input.length && /\s/.test(input[index]))
|
|
7581
|
+
index += 1;
|
|
7582
|
+
return index;
|
|
7583
|
+
}
|
|
7398
7584
|
|
|
7399
7585
|
// packages/omo-codex/src/install/codex-config-toml-sections.ts
|
|
7400
7586
|
function removeTomlSections(config, shouldRemove) {
|
|
@@ -7423,27 +7609,18 @@ function splitTomlSections(config) {
|
|
|
7423
7609
|
return sections;
|
|
7424
7610
|
}
|
|
7425
7611
|
function parsePluginHeaderKey(header) {
|
|
7426
|
-
const
|
|
7427
|
-
|
|
7428
|
-
return null;
|
|
7429
|
-
return parseLeadingJsonString(header.slice(prefix.length));
|
|
7612
|
+
const path = parseTomlDottedKey(header);
|
|
7613
|
+
return path?.[0] === "plugins" ? path[1] ?? null : null;
|
|
7430
7614
|
}
|
|
7431
7615
|
function parseAgentHeaderName(header) {
|
|
7432
|
-
const
|
|
7433
|
-
|
|
7434
|
-
return null;
|
|
7435
|
-
const key = header.slice(prefix.length);
|
|
7436
|
-
return key.startsWith('"') ? parseLeadingJsonString(key) : key;
|
|
7616
|
+
const path = parseTomlDottedKey(header);
|
|
7617
|
+
return path?.[0] === "agents" ? path[1] ?? null : null;
|
|
7437
7618
|
}
|
|
7438
|
-
function
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
return typeof parsed === "string" ? parsed : null;
|
|
7442
|
-
} catch (error) {
|
|
7443
|
-
if (error instanceof Error)
|
|
7444
|
-
return null;
|
|
7619
|
+
function parseHookStateHeaderKey(header) {
|
|
7620
|
+
const path = parseTomlDottedKey(header);
|
|
7621
|
+
if (path?.[0] !== "hooks" || path[1] !== "state")
|
|
7445
7622
|
return null;
|
|
7446
|
-
|
|
7623
|
+
return path[2] ?? null;
|
|
7447
7624
|
}
|
|
7448
7625
|
function parseTomlHeader(line) {
|
|
7449
7626
|
const trimmed = line.trim();
|
|
@@ -7451,25 +7628,6 @@ function parseTomlHeader(line) {
|
|
|
7451
7628
|
return null;
|
|
7452
7629
|
return trimmed.slice(1, -1);
|
|
7453
7630
|
}
|
|
7454
|
-
function parseLeadingJsonString(value) {
|
|
7455
|
-
if (!value.startsWith('"'))
|
|
7456
|
-
return parseJsonString(value);
|
|
7457
|
-
let escaped = false;
|
|
7458
|
-
for (let index = 1;index < value.length; index += 1) {
|
|
7459
|
-
const char = value[index];
|
|
7460
|
-
if (escaped) {
|
|
7461
|
-
escaped = false;
|
|
7462
|
-
continue;
|
|
7463
|
-
}
|
|
7464
|
-
if (char === "\\") {
|
|
7465
|
-
escaped = true;
|
|
7466
|
-
continue;
|
|
7467
|
-
}
|
|
7468
|
-
if (char === '"')
|
|
7469
|
-
return parseJsonString(value.slice(0, index + 1));
|
|
7470
|
-
}
|
|
7471
|
-
return null;
|
|
7472
|
-
}
|
|
7473
7631
|
|
|
7474
7632
|
// packages/omo-codex/src/install/codex-config-agents.ts
|
|
7475
7633
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE = ["codex-ultrawork-reviewer"];
|
|
@@ -7513,12 +7671,12 @@ function tomlKeySegment(value) {
|
|
|
7513
7671
|
|
|
7514
7672
|
// packages/omo-codex/src/install/codex-config-atomic-write.ts
|
|
7515
7673
|
import { lstat as lstat5, readlink as readlink3, realpath, rename as rename2, unlink, writeFile as writeFile5 } from "node:fs/promises";
|
|
7516
|
-
import { basename as basename3, dirname as dirname4, isAbsolute as isAbsolute4, join as
|
|
7674
|
+
import { basename as basename3, dirname as dirname4, isAbsolute as isAbsolute4, join as join14, resolve as resolve5 } from "node:path";
|
|
7517
7675
|
var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
|
|
7518
7676
|
var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
|
|
7519
7677
|
async function writeFileAtomic(targetPath, data) {
|
|
7520
7678
|
const writeTarget = await resolveSymlinkTarget(targetPath);
|
|
7521
|
-
const temporaryPath =
|
|
7679
|
+
const temporaryPath = join14(dirname4(writeTarget), `.tmp-${basename3(writeTarget)}-${process.pid}-${Date.now()}`);
|
|
7522
7680
|
await writeFile5(temporaryPath, data);
|
|
7523
7681
|
try {
|
|
7524
7682
|
await renameWithRetry(temporaryPath, writeTarget);
|
|
@@ -7606,10 +7764,7 @@ function removeStaleMarketplacePluginBlocks(config, marketplaceName, keepPluginN
|
|
|
7606
7764
|
}
|
|
7607
7765
|
function removeStaleMarketplaceHookStateBlocks(config, marketplaceName, keepPluginNames) {
|
|
7608
7766
|
return removeTomlSections(config, (header) => {
|
|
7609
|
-
const
|
|
7610
|
-
if (!header.startsWith(prefix))
|
|
7611
|
-
return false;
|
|
7612
|
-
const hookKey = parseJsonString(header.slice(prefix.length));
|
|
7767
|
+
const hookKey = parseHookStateHeaderKey(header);
|
|
7613
7768
|
if (hookKey === null)
|
|
7614
7769
|
return false;
|
|
7615
7770
|
const separator = hookKey.indexOf(":");
|
|
@@ -7694,9 +7849,10 @@ enabled = true
|
|
|
7694
7849
|
function ensureOmoBuiltinMcpPolicies(config, input) {
|
|
7695
7850
|
if (input.marketplaceName !== "sisyphuslabs" || !input.pluginNames.includes("omo"))
|
|
7696
7851
|
return config;
|
|
7852
|
+
const codegraphEnabled = input.codegraphMcpEnabled ?? true;
|
|
7697
7853
|
const gitBashEnabled = (input.platform ?? process.platform) === "win32" && input.gitBashEnabled === true;
|
|
7698
7854
|
let nextConfig = ensurePluginMcpEnabled(config, "omo@sisyphuslabs", "context7", true);
|
|
7699
|
-
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "codegraph",
|
|
7855
|
+
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "codegraph", codegraphEnabled);
|
|
7700
7856
|
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "git_bash", gitBashEnabled);
|
|
7701
7857
|
return nextConfig;
|
|
7702
7858
|
}
|
|
@@ -7789,7 +7945,7 @@ function isRootSetting(line, key) {
|
|
|
7789
7945
|
|
|
7790
7946
|
// packages/omo-codex/src/install/codex-model-catalog.ts
|
|
7791
7947
|
import { readFile as readFile9 } from "node:fs/promises";
|
|
7792
|
-
import { join as
|
|
7948
|
+
import { join as join15 } from "node:path";
|
|
7793
7949
|
var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
7794
7950
|
current: {
|
|
7795
7951
|
model: "gpt-5.5",
|
|
@@ -7808,7 +7964,7 @@ var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
|
7808
7964
|
]
|
|
7809
7965
|
};
|
|
7810
7966
|
async function readCodexModelCatalog(codexPackageRoot) {
|
|
7811
|
-
const catalogPath =
|
|
7967
|
+
const catalogPath = join15(codexPackageRoot, "plugin", "model-catalog.json");
|
|
7812
7968
|
try {
|
|
7813
7969
|
const parsed = JSON.parse(await readFile9(catalogPath, "utf8"));
|
|
7814
7970
|
return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
|
|
@@ -7939,7 +8095,7 @@ async function exists(path) {
|
|
|
7939
8095
|
// packages/omo-codex/src/install/codex-hook-trust.ts
|
|
7940
8096
|
import { createHash } from "node:crypto";
|
|
7941
8097
|
import { readFile as readFile11 } from "node:fs/promises";
|
|
7942
|
-
import { join as
|
|
8098
|
+
import { join as join16 } from "node:path";
|
|
7943
8099
|
var EVENT_LABELS = new Map([
|
|
7944
8100
|
["PreToolUse", "pre_tool_use"],
|
|
7945
8101
|
["PermissionRequest", "permission_request"],
|
|
@@ -7953,7 +8109,7 @@ var EVENT_LABELS = new Map([
|
|
|
7953
8109
|
["Stop", "stop"]
|
|
7954
8110
|
]);
|
|
7955
8111
|
async function trustedHookStatesForPlugin(input) {
|
|
7956
|
-
const manifestPath =
|
|
8112
|
+
const manifestPath = join16(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
7957
8113
|
if (!await exists2(manifestPath))
|
|
7958
8114
|
return [];
|
|
7959
8115
|
const manifest = JSON.parse(await readFile11(manifestPath, "utf8"));
|
|
@@ -7961,7 +8117,7 @@ async function trustedHookStatesForPlugin(input) {
|
|
|
7961
8117
|
return [];
|
|
7962
8118
|
const states = [];
|
|
7963
8119
|
for (const hookPath of hookManifestPaths2(manifest.hooks)) {
|
|
7964
|
-
const hooksPath =
|
|
8120
|
+
const hooksPath = join16(input.pluginRoot, hookPath);
|
|
7965
8121
|
if (!await exists2(hooksPath))
|
|
7966
8122
|
continue;
|
|
7967
8123
|
const parsed = JSON.parse(await readFile11(hooksPath, "utf8"));
|
|
@@ -8090,11 +8246,11 @@ function toCodexResolution(resolution) {
|
|
|
8090
8246
|
|
|
8091
8247
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
8092
8248
|
import { copyFile, lstat as lstat7, mkdir as mkdir6, readFile as readFile13, readdir as readdir4, rm as rm6, writeFile as writeFile6 } from "node:fs/promises";
|
|
8093
|
-
import { basename as basename4, join as
|
|
8249
|
+
import { basename as basename4, join as join18 } from "node:path";
|
|
8094
8250
|
|
|
8095
8251
|
// packages/omo-codex/src/install/retired-managed-agent-purge.ts
|
|
8096
8252
|
import { lstat as lstat6, readFile as readFile12, rm as rm5 } from "node:fs/promises";
|
|
8097
|
-
import { join as
|
|
8253
|
+
import { join as join17 } from "node:path";
|
|
8098
8254
|
var RETIRED_MANAGED_AGENT_FILES = [
|
|
8099
8255
|
{
|
|
8100
8256
|
fileName: "codex-ultrawork-reviewer.toml",
|
|
@@ -8106,11 +8262,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
|
|
|
8106
8262
|
}
|
|
8107
8263
|
];
|
|
8108
8264
|
async function purgeRetiredManagedAgentFiles(input) {
|
|
8109
|
-
const agentsDir =
|
|
8265
|
+
const agentsDir = join17(input.codexHome, "agents");
|
|
8110
8266
|
if (!await exists3(agentsDir))
|
|
8111
8267
|
return;
|
|
8112
8268
|
for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
|
|
8113
|
-
const agentPath =
|
|
8269
|
+
const agentPath = join17(agentsDir, retiredAgent.fileName);
|
|
8114
8270
|
if (!await exists3(agentPath))
|
|
8115
8271
|
continue;
|
|
8116
8272
|
const agentStat = await lstat6(agentPath);
|
|
@@ -8153,7 +8309,7 @@ function nodeErrorCode(error) {
|
|
|
8153
8309
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
8154
8310
|
var MANIFEST_FILE = ".installed-agents.json";
|
|
8155
8311
|
async function capturePreservedAgentReasoning(input) {
|
|
8156
|
-
const agentsDir =
|
|
8312
|
+
const agentsDir = join18(input.codexHome, "agents");
|
|
8157
8313
|
if (!await exists4(agentsDir))
|
|
8158
8314
|
return new Map;
|
|
8159
8315
|
const preserved = new Map;
|
|
@@ -8161,7 +8317,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
8161
8317
|
for (const entry of agentEntries) {
|
|
8162
8318
|
if (!entry.name.endsWith(".toml"))
|
|
8163
8319
|
continue;
|
|
8164
|
-
const content = await readTextIfExists2(
|
|
8320
|
+
const content = await readTextIfExists2(join18(agentsDir, entry.name));
|
|
8165
8321
|
if (content === null)
|
|
8166
8322
|
continue;
|
|
8167
8323
|
const effort = extractReasoningEffort(content);
|
|
@@ -8171,7 +8327,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
8171
8327
|
return preserved;
|
|
8172
8328
|
}
|
|
8173
8329
|
async function capturePreservedAgentServiceTier(input) {
|
|
8174
|
-
const agentsDir =
|
|
8330
|
+
const agentsDir = join18(input.codexHome, "agents");
|
|
8175
8331
|
if (!await exists4(agentsDir))
|
|
8176
8332
|
return new Map;
|
|
8177
8333
|
const preserved = new Map;
|
|
@@ -8179,7 +8335,7 @@ async function capturePreservedAgentServiceTier(input) {
|
|
|
8179
8335
|
for (const entry of agentEntries) {
|
|
8180
8336
|
if (!entry.name.endsWith(".toml"))
|
|
8181
8337
|
continue;
|
|
8182
|
-
const content = await readTextIfExists2(
|
|
8338
|
+
const content = await readTextIfExists2(join18(agentsDir, entry.name));
|
|
8183
8339
|
if (content === null)
|
|
8184
8340
|
continue;
|
|
8185
8341
|
preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
|
|
@@ -8193,13 +8349,13 @@ async function linkCachedPluginAgents(input) {
|
|
|
8193
8349
|
await writeManifest(input.pluginRoot, []);
|
|
8194
8350
|
return [];
|
|
8195
8351
|
}
|
|
8196
|
-
const agentsDir =
|
|
8352
|
+
const agentsDir = join18(input.codexHome, "agents");
|
|
8197
8353
|
await mkdir6(agentsDir, { recursive: true });
|
|
8198
8354
|
const linked = [];
|
|
8199
8355
|
for (const agentPath of bundledAgents) {
|
|
8200
8356
|
const agentFileName = basename4(agentPath);
|
|
8201
8357
|
const agentName = agentNameFromToml(agentFileName);
|
|
8202
|
-
const linkPath =
|
|
8358
|
+
const linkPath = join18(agentsDir, agentFileName);
|
|
8203
8359
|
await replaceWithCopy(linkPath, agentPath);
|
|
8204
8360
|
await restorePreservedReasoning({
|
|
8205
8361
|
agentName,
|
|
@@ -8229,7 +8385,7 @@ async function restorePreservedServiceTier(input) {
|
|
|
8229
8385
|
await writeFile6(input.linkPath, replacement.content);
|
|
8230
8386
|
}
|
|
8231
8387
|
async function discoverBundledAgents(pluginRoot) {
|
|
8232
|
-
const componentsRoot =
|
|
8388
|
+
const componentsRoot = join18(pluginRoot, "components");
|
|
8233
8389
|
if (!await exists4(componentsRoot))
|
|
8234
8390
|
return [];
|
|
8235
8391
|
const componentEntries = await readdir4(componentsRoot, { withFileTypes: true });
|
|
@@ -8237,14 +8393,14 @@ async function discoverBundledAgents(pluginRoot) {
|
|
|
8237
8393
|
for (const entry of componentEntries) {
|
|
8238
8394
|
if (!entry.isDirectory())
|
|
8239
8395
|
continue;
|
|
8240
|
-
const agentsRoot =
|
|
8396
|
+
const agentsRoot = join18(componentsRoot, entry.name, "agents");
|
|
8241
8397
|
if (!await exists4(agentsRoot))
|
|
8242
8398
|
continue;
|
|
8243
8399
|
const agentEntries = await readdir4(agentsRoot, { withFileTypes: true });
|
|
8244
8400
|
for (const file2 of agentEntries) {
|
|
8245
8401
|
if (!file2.isFile() || !file2.name.endsWith(".toml"))
|
|
8246
8402
|
continue;
|
|
8247
|
-
agents.push(
|
|
8403
|
+
agents.push(join18(agentsRoot, file2.name));
|
|
8248
8404
|
}
|
|
8249
8405
|
}
|
|
8250
8406
|
agents.sort();
|
|
@@ -8264,7 +8420,7 @@ async function prepareReplacement(linkPath) {
|
|
|
8264
8420
|
await rm6(linkPath, { force: true });
|
|
8265
8421
|
}
|
|
8266
8422
|
async function writeManifest(pluginRoot, agentPaths) {
|
|
8267
|
-
const manifestPath =
|
|
8423
|
+
const manifestPath = join18(pluginRoot, MANIFEST_FILE);
|
|
8268
8424
|
const payload = { agents: [...agentPaths].sort() };
|
|
8269
8425
|
await writeFile6(manifestPath, `${JSON.stringify(payload, null, "\t")}
|
|
8270
8426
|
`);
|
|
@@ -8303,7 +8459,7 @@ function extractTopLevelStringSetting(content, key) {
|
|
|
8303
8459
|
const rawValue = topLevelStringSettingRawValue(line, key);
|
|
8304
8460
|
if (rawValue === undefined)
|
|
8305
8461
|
continue;
|
|
8306
|
-
const parsed =
|
|
8462
|
+
const parsed = parseJsonString(rawValue);
|
|
8307
8463
|
if (parsed !== null)
|
|
8308
8464
|
return parsed;
|
|
8309
8465
|
}
|
|
@@ -8364,7 +8520,7 @@ function isSectionHeader2(line) {
|
|
|
8364
8520
|
function agentNameFromToml(fileName) {
|
|
8365
8521
|
return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
|
|
8366
8522
|
}
|
|
8367
|
-
function
|
|
8523
|
+
function parseJsonString(value) {
|
|
8368
8524
|
try {
|
|
8369
8525
|
const parsed = JSON.parse(value);
|
|
8370
8526
|
return typeof parsed === "string" ? parsed : null;
|
|
@@ -8392,10 +8548,10 @@ function nodeErrorCode2(error) {
|
|
|
8392
8548
|
|
|
8393
8549
|
// packages/omo-codex/src/install/codex-marketplace.ts
|
|
8394
8550
|
import { readFile as readFile14 } from "node:fs/promises";
|
|
8395
|
-
import { join as
|
|
8551
|
+
import { join as join19 } from "node:path";
|
|
8396
8552
|
var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
|
|
8397
8553
|
async function readMarketplace(repoRoot, options) {
|
|
8398
|
-
const marketplacePath = options?.marketplacePath ??
|
|
8554
|
+
const marketplacePath = options?.marketplacePath ?? join19(repoRoot, DEFAULT_MARKETPLACE_PATH);
|
|
8399
8555
|
const raw = await readFile14(marketplacePath, "utf8");
|
|
8400
8556
|
const parsed = JSON.parse(raw);
|
|
8401
8557
|
if (!isPlainRecord(parsed))
|
|
@@ -8414,10 +8570,10 @@ async function readMarketplace(repoRoot, options) {
|
|
|
8414
8570
|
function resolvePluginSource(repoRoot, plugin, options) {
|
|
8415
8571
|
const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
|
|
8416
8572
|
const relativePath = sourcePath.slice(2);
|
|
8417
|
-
return
|
|
8573
|
+
return join19(repoRoot, ...relativePath.split(/[\\/]/));
|
|
8418
8574
|
}
|
|
8419
8575
|
async function readPluginManifest(pluginRoot) {
|
|
8420
|
-
const raw = await readFile14(
|
|
8576
|
+
const raw = await readFile14(join19(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
|
|
8421
8577
|
const parsed = JSON.parse(raw);
|
|
8422
8578
|
if (!isPlainRecord(parsed))
|
|
8423
8579
|
throw new Error(`${pluginRoot} plugin.json must be an object`);
|
|
@@ -8499,7 +8655,7 @@ function validateLocalSourcePath(path) {
|
|
|
8499
8655
|
|
|
8500
8656
|
// packages/omo-codex/src/install/codex-marketplace-snapshot.ts
|
|
8501
8657
|
import { cp as cp3, mkdir as mkdir7, rename as rename3, rm as rm7, writeFile as writeFile7 } from "node:fs/promises";
|
|
8502
|
-
import { join as
|
|
8658
|
+
import { join as join20, sep as sep6 } from "node:path";
|
|
8503
8659
|
var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
|
|
8504
8660
|
async function writeInstalledMarketplaceSnapshot(input) {
|
|
8505
8661
|
const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
|
|
@@ -8512,21 +8668,21 @@ async function writeInstalledMarketplaceSnapshot(input) {
|
|
|
8512
8668
|
return snapshotPlugins;
|
|
8513
8669
|
}
|
|
8514
8670
|
function installedMarketplaceRoot(codexHome, marketplaceName) {
|
|
8515
|
-
return
|
|
8671
|
+
return join20(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
|
|
8516
8672
|
}
|
|
8517
8673
|
async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
|
|
8518
|
-
const manifestDir =
|
|
8674
|
+
const manifestDir = join20(marketplaceRoot, ".agents", "plugins");
|
|
8519
8675
|
await mkdir7(manifestDir, { recursive: true });
|
|
8520
|
-
const tempPath =
|
|
8676
|
+
const tempPath = join20(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
|
|
8521
8677
|
await writeFile7(tempPath, `${JSON.stringify(marketplace, null, "\t")}
|
|
8522
8678
|
`);
|
|
8523
|
-
await rename3(tempPath,
|
|
8679
|
+
await rename3(tempPath, join20(manifestDir, "marketplace.json"));
|
|
8524
8680
|
}
|
|
8525
8681
|
async function writeSnapshotPlugin(marketplaceRoot, plugin) {
|
|
8526
|
-
const pluginsDir =
|
|
8682
|
+
const pluginsDir = join20(marketplaceRoot, "plugins");
|
|
8527
8683
|
await mkdir7(pluginsDir, { recursive: true });
|
|
8528
|
-
const targetPath =
|
|
8529
|
-
const tempPath =
|
|
8684
|
+
const targetPath = join20(pluginsDir, plugin.name);
|
|
8685
|
+
const tempPath = join20(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
|
|
8530
8686
|
await rm7(tempPath, { recursive: true, force: true });
|
|
8531
8687
|
await cp3(plugin.sourcePath, tempPath, {
|
|
8532
8688
|
recursive: true,
|
|
@@ -8548,10 +8704,10 @@ function shouldCopyMarketplaceSourcePath(path, root) {
|
|
|
8548
8704
|
|
|
8549
8705
|
// packages/omo-codex/src/install/lazycodex-version-stamp.ts
|
|
8550
8706
|
import { readdir as readdir5, readFile as readFile15, writeFile as writeFile8 } from "node:fs/promises";
|
|
8551
|
-
import { join as
|
|
8707
|
+
import { join as join21 } from "node:path";
|
|
8552
8708
|
async function readDistributionManifest(repoRoot) {
|
|
8553
8709
|
try {
|
|
8554
|
-
const parsed = JSON.parse(await readFile15(
|
|
8710
|
+
const parsed = JSON.parse(await readFile15(join21(repoRoot, "package.json"), "utf8"));
|
|
8555
8711
|
if (!isPlainRecord(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
|
|
8556
8712
|
return;
|
|
8557
8713
|
return {
|
|
@@ -8571,19 +8727,19 @@ function resolveLazyCodexPluginVersion(input) {
|
|
|
8571
8727
|
return input.manifestVersion ?? "local";
|
|
8572
8728
|
}
|
|
8573
8729
|
async function stampLazyCodexPluginVersion(input) {
|
|
8574
|
-
const manifestPath =
|
|
8730
|
+
const manifestPath = join21(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
8575
8731
|
const hookPaths = await readPluginHookPaths(manifestPath);
|
|
8576
8732
|
await stampJsonVersion(manifestPath, input.version);
|
|
8577
|
-
await stampJsonVersion(
|
|
8733
|
+
await stampJsonVersion(join21(input.pluginRoot, "package.json"), input.version);
|
|
8578
8734
|
for (const hookPath of hookPaths) {
|
|
8579
|
-
await stampHookStatusMessages(
|
|
8735
|
+
await stampHookStatusMessages(join21(input.pluginRoot, hookPath), input.version);
|
|
8580
8736
|
}
|
|
8581
8737
|
await stampComponentVersions(input);
|
|
8582
8738
|
}
|
|
8583
8739
|
async function writeLazyCodexInstallSnapshot(input) {
|
|
8584
8740
|
if (input.distributionManifest === undefined)
|
|
8585
8741
|
return;
|
|
8586
|
-
await writeFile8(
|
|
8742
|
+
await writeFile8(join21(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
|
|
8587
8743
|
packageName: input.distributionManifest.name,
|
|
8588
8744
|
version: input.distributionManifest.version
|
|
8589
8745
|
}, null, "\t")}
|
|
@@ -8640,16 +8796,16 @@ async function stampHookStatusMessages(path, version) {
|
|
|
8640
8796
|
async function stampComponentVersions(input) {
|
|
8641
8797
|
let entries;
|
|
8642
8798
|
try {
|
|
8643
|
-
entries = await readdir5(
|
|
8799
|
+
entries = await readdir5(join21(input.pluginRoot, "components"));
|
|
8644
8800
|
} catch (error) {
|
|
8645
8801
|
if (error instanceof Error)
|
|
8646
8802
|
return;
|
|
8647
8803
|
throw error;
|
|
8648
8804
|
}
|
|
8649
8805
|
for (const entry of entries) {
|
|
8650
|
-
const componentRoot =
|
|
8651
|
-
await stampJsonVersion(
|
|
8652
|
-
await stampHookStatusMessages(
|
|
8806
|
+
const componentRoot = join21(input.pluginRoot, "components", entry);
|
|
8807
|
+
await stampJsonVersion(join21(componentRoot, "package.json"), input.version);
|
|
8808
|
+
await stampHookStatusMessages(join21(componentRoot, "hooks", "hooks.json"), input.version);
|
|
8653
8809
|
}
|
|
8654
8810
|
}
|
|
8655
8811
|
function stampHookGroups(hooks, version) {
|
|
@@ -8675,7 +8831,7 @@ function stampHookStatusMessage(hook, version) {
|
|
|
8675
8831
|
|
|
8676
8832
|
// packages/omo-codex/src/install/codex-project-local-cleanup.ts
|
|
8677
8833
|
import { copyFile as copyFile2, lstat as lstat8, readFile as readFile16, writeFile as writeFile9 } from "node:fs/promises";
|
|
8678
|
-
import { dirname as dirname6, join as
|
|
8834
|
+
import { dirname as dirname6, join as join22, resolve as resolve6 } from "node:path";
|
|
8679
8835
|
var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
|
|
8680
8836
|
var PROJECT_LOCAL_ARTIFACT_PATHS = [
|
|
8681
8837
|
".codex/hooks.json",
|
|
@@ -8778,17 +8934,17 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
8778
8934
|
if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
|
|
8779
8935
|
throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
|
|
8780
8936
|
}
|
|
8781
|
-
const codexHomeConfigPath = codexHome === undefined ? null :
|
|
8937
|
+
const codexHomeConfigPath = codexHome === undefined ? null : join22(resolve6(codexHome), "config.toml");
|
|
8782
8938
|
let current = resolve6(startDirectory);
|
|
8783
8939
|
const configPathsFromCwd = [];
|
|
8784
8940
|
while (true) {
|
|
8785
|
-
const configPath =
|
|
8941
|
+
const configPath = join22(current, ".codex", "config.toml");
|
|
8786
8942
|
if (await isRegularProjectLocalConfig(current, configPath)) {
|
|
8787
8943
|
if (codexHomeConfigPath === null || resolve6(configPath) !== codexHomeConfigPath) {
|
|
8788
8944
|
configPathsFromCwd.push(configPath);
|
|
8789
8945
|
}
|
|
8790
8946
|
}
|
|
8791
|
-
if (await exists5(
|
|
8947
|
+
if (await exists5(join22(current, ".git"))) {
|
|
8792
8948
|
return configPathsFromCwd.length === 0 ? null : {
|
|
8793
8949
|
projectRoot: current,
|
|
8794
8950
|
configPaths: [...configPathsFromCwd].reverse(),
|
|
@@ -8808,7 +8964,7 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
8808
8964
|
}
|
|
8809
8965
|
}
|
|
8810
8966
|
async function isRegularProjectLocalConfig(directory, configPath) {
|
|
8811
|
-
const codexDirStat = await maybeLstat(
|
|
8967
|
+
const codexDirStat = await maybeLstat(join22(directory, ".codex"));
|
|
8812
8968
|
if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
|
|
8813
8969
|
return false;
|
|
8814
8970
|
const configStat = await maybeLstat(configPath);
|
|
@@ -8828,7 +8984,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
|
|
|
8828
8984
|
const seenPaths = new Set;
|
|
8829
8985
|
for (const projectRoot of projectRoots) {
|
|
8830
8986
|
for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
|
|
8831
|
-
const artifactPath =
|
|
8987
|
+
const artifactPath = join22(projectRoot, relativePath);
|
|
8832
8988
|
if (seenPaths.has(artifactPath))
|
|
8833
8989
|
continue;
|
|
8834
8990
|
const entryStat = await maybeLstat(artifactPath);
|
|
@@ -8905,11 +9061,11 @@ function formatUnknownError(error) {
|
|
|
8905
9061
|
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
|
|
8906
9062
|
import { readFile as readFile17, readdir as readdir6, rm as rm8 } from "node:fs/promises";
|
|
8907
9063
|
import { connect } from "node:net";
|
|
8908
|
-
import { join as
|
|
9064
|
+
import { join as join23 } from "node:path";
|
|
8909
9065
|
async function reapLspDaemons(codexHome, deps = {}) {
|
|
8910
9066
|
const killProcess = deps.killProcess ?? sendSigterm;
|
|
8911
9067
|
const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
|
|
8912
|
-
const daemonRoot =
|
|
9068
|
+
const daemonRoot = join23(codexHome, "codex-lsp", "daemon");
|
|
8913
9069
|
const reaped = [];
|
|
8914
9070
|
let entries;
|
|
8915
9071
|
try {
|
|
@@ -8918,9 +9074,9 @@ async function reapLspDaemons(codexHome, deps = {}) {
|
|
|
8918
9074
|
return reaped;
|
|
8919
9075
|
}
|
|
8920
9076
|
for (const entry of entries) {
|
|
8921
|
-
const versionDir =
|
|
8922
|
-
const pid = await readPidFile(
|
|
8923
|
-
const socketPath = await readEndpointFile(
|
|
9077
|
+
const versionDir = join23(daemonRoot, entry);
|
|
9078
|
+
const pid = await readPidFile(join23(versionDir, "daemon.pid"));
|
|
9079
|
+
const socketPath = await readEndpointFile(join23(versionDir, "daemon.endpoint"));
|
|
8924
9080
|
if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
|
|
8925
9081
|
reaped.push(pid);
|
|
8926
9082
|
}
|
|
@@ -8974,7 +9130,7 @@ function sendSigterm(pid) {
|
|
|
8974
9130
|
|
|
8975
9131
|
// packages/omo-codex/src/install/codex-installer-bin-dir.ts
|
|
8976
9132
|
import { homedir } from "node:os";
|
|
8977
|
-
import { join as
|
|
9133
|
+
import { join as join24, resolve as resolve7 } from "node:path";
|
|
8978
9134
|
function resolveCodexInstallerBinDir(input) {
|
|
8979
9135
|
const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
|
|
8980
9136
|
if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
|
|
@@ -8983,15 +9139,15 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
8983
9139
|
const defaultCodexHome = resolve7(homeDir, ".codex");
|
|
8984
9140
|
const resolvedCodexHome = resolve7(input.codexHome);
|
|
8985
9141
|
if (resolvedCodexHome !== defaultCodexHome)
|
|
8986
|
-
return
|
|
9142
|
+
return join24(resolvedCodexHome, "bin");
|
|
8987
9143
|
return resolve7(homeDir, ".local", "bin");
|
|
8988
9144
|
}
|
|
8989
9145
|
|
|
8990
9146
|
// packages/omo-codex/src/install/omo-sot-migration.ts
|
|
8991
|
-
import { join as
|
|
9147
|
+
import { join as join25 } from "node:path";
|
|
8992
9148
|
async function seedAndMigrateOmoSot(input) {
|
|
8993
9149
|
const commandEnv = { ...input.env };
|
|
8994
|
-
const scriptPath =
|
|
9150
|
+
const scriptPath = join25(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
|
|
8995
9151
|
try {
|
|
8996
9152
|
await input.runCommand(process.execPath, [scriptPath, "--seed"], {
|
|
8997
9153
|
cwd: input.repoRoot,
|
|
@@ -9005,7 +9161,7 @@ async function seedAndMigrateOmoSot(input) {
|
|
|
9005
9161
|
}
|
|
9006
9162
|
|
|
9007
9163
|
// packages/omo-codex/src/install/install-ast-grep-sg.ts
|
|
9008
|
-
import { join as
|
|
9164
|
+
import { join as join28 } from "node:path";
|
|
9009
9165
|
|
|
9010
9166
|
// packages/utils/src/deep-merge.ts
|
|
9011
9167
|
var DANGEROUS_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
@@ -11977,11 +12133,11 @@ function runtimeSlug(platform = process.platform, arch = process.arch) {
|
|
|
11977
12133
|
// packages/utils/src/ast-grep/install-script.ts
|
|
11978
12134
|
import { spawn as spawn3 } from "node:child_process";
|
|
11979
12135
|
import { existsSync as existsSync3 } from "node:fs";
|
|
11980
|
-
import { join as
|
|
12136
|
+
import { join as join26 } from "node:path";
|
|
11981
12137
|
var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR";
|
|
11982
12138
|
var AST_GREP_INSTALL_TIMEOUT_MS = 30000;
|
|
11983
12139
|
function astGrepRuntimeDir(baseDir, platform = process.platform, arch = process.arch) {
|
|
11984
|
-
return
|
|
12140
|
+
return join26(baseDir, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
11985
12141
|
}
|
|
11986
12142
|
function isMissingExecutable(error) {
|
|
11987
12143
|
if (!("code" in error))
|
|
@@ -12019,7 +12175,7 @@ function defaultSpawnProcess(command, args, options) {
|
|
|
12019
12175
|
};
|
|
12020
12176
|
}
|
|
12021
12177
|
function scriptPathForPlatform(skillDir, platform) {
|
|
12022
|
-
return
|
|
12178
|
+
return join26(skillDir, platform === "win32" ? "install.ps1" : "install.sh");
|
|
12023
12179
|
}
|
|
12024
12180
|
function invocationsForPlatform(scriptPath, platform) {
|
|
12025
12181
|
if (platform !== "win32")
|
|
@@ -12076,13 +12232,111 @@ async function runAstGrepSkillInstall(options) {
|
|
|
12076
12232
|
return { kind: "failed", reason: String(error) };
|
|
12077
12233
|
}
|
|
12078
12234
|
}
|
|
12235
|
+
// packages/utils/src/codegraph/node-support.ts
|
|
12236
|
+
var CODEGRAPH_MIN_NODE_MAJOR = 20;
|
|
12237
|
+
var CODEGRAPH_BLOCKED_NODE_MAJOR = 25;
|
|
12238
|
+
var CODEGRAPH_UNSAFE_NODE_ENV = "CODEGRAPH_ALLOW_UNSAFE_NODE";
|
|
12239
|
+
var CODEGRAPH_NODE_BIN_ENV = "CODEGRAPH_NODE_BIN";
|
|
12240
|
+
function evaluateCodegraphNodeSupport(options = {}) {
|
|
12241
|
+
const nodeVersion = options.nodeVersion ?? process.versions.node;
|
|
12242
|
+
const env = options.env ?? process.env;
|
|
12243
|
+
const override = (env[CODEGRAPH_UNSAFE_NODE_ENV]?.trim().length ?? 0) > 0;
|
|
12244
|
+
const major = parseNodeMajor(nodeVersion);
|
|
12245
|
+
if (major >= CODEGRAPH_BLOCKED_NODE_MAJOR) {
|
|
12246
|
+
return { major, override, reason: "too-new", supported: override };
|
|
12247
|
+
}
|
|
12248
|
+
if (major < CODEGRAPH_MIN_NODE_MAJOR) {
|
|
12249
|
+
return { major, override, reason: "too-old", supported: override };
|
|
12250
|
+
}
|
|
12251
|
+
return { major, override, supported: true };
|
|
12252
|
+
}
|
|
12253
|
+
function parseNodeMajor(version) {
|
|
12254
|
+
const normalized = version.startsWith("v") ? version.slice(1) : version;
|
|
12255
|
+
const major = Number.parseInt(normalized.split(".")[0] ?? "", 10);
|
|
12256
|
+
return Number.isNaN(major) ? 0 : major;
|
|
12257
|
+
}
|
|
12079
12258
|
// packages/utils/src/codegraph/provision.ts
|
|
12080
12259
|
import { execFile } from "node:child_process";
|
|
12081
12260
|
import { promisify } from "node:util";
|
|
12082
12261
|
var execFileAsync = promisify(execFile);
|
|
12083
12262
|
// packages/utils/src/codegraph/resolve.ts
|
|
12263
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
12264
|
+
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
12265
|
+
import { basename as basename5, dirname as dirname7, join as join27 } from "node:path";
|
|
12084
12266
|
import { createRequire } from "node:module";
|
|
12267
|
+
var CODEGRAPH_NODE_CANDIDATES = ["node24", "node22", "node20", "node"];
|
|
12085
12268
|
var requireFromHere = createRequire(import.meta.url);
|
|
12269
|
+
function defaultNodeVersion(nodePath) {
|
|
12270
|
+
if (nodePath === process.execPath && isNodeExecutableName(nodePath))
|
|
12271
|
+
return process.versions.node;
|
|
12272
|
+
try {
|
|
12273
|
+
const result = spawnSync2(nodePath, ["--version"], {
|
|
12274
|
+
encoding: "utf8",
|
|
12275
|
+
timeout: 2000,
|
|
12276
|
+
windowsHide: true
|
|
12277
|
+
});
|
|
12278
|
+
if (result.error !== undefined || result.status !== 0)
|
|
12279
|
+
return null;
|
|
12280
|
+
const version = `${result.stdout}
|
|
12281
|
+
${result.stderr}`.trim().split(/\s+/)[0];
|
|
12282
|
+
return version === undefined || version.length === 0 ? null : version;
|
|
12283
|
+
} catch (error) {
|
|
12284
|
+
if (error instanceof Error)
|
|
12285
|
+
return null;
|
|
12286
|
+
throw error;
|
|
12287
|
+
}
|
|
12288
|
+
}
|
|
12289
|
+
function isNodeExecutableName(filePath) {
|
|
12290
|
+
const executable = basename5(filePath).toLowerCase();
|
|
12291
|
+
return executable === "node" || executable === "node.exe" || /^node\d+(\.exe)?$/.test(executable);
|
|
12292
|
+
}
|
|
12293
|
+
function looksLikePath(command) {
|
|
12294
|
+
return command.includes("/") || command.includes("\\") || /^[a-zA-Z]:/.test(command);
|
|
12295
|
+
}
|
|
12296
|
+
function resolveConfiguredNodeRuntime(configured, fileExists, which2) {
|
|
12297
|
+
if (looksLikePath(configured))
|
|
12298
|
+
return fileExists(configured) ? configured : null;
|
|
12299
|
+
return which2(configured);
|
|
12300
|
+
}
|
|
12301
|
+
function supportsCodegraphNodeRuntime(nodePath, env, nodeVersion) {
|
|
12302
|
+
const version = nodeVersion(nodePath);
|
|
12303
|
+
if (version === null)
|
|
12304
|
+
return false;
|
|
12305
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: version }).supported;
|
|
12306
|
+
}
|
|
12307
|
+
function defaultNodeRuntime(env, fileExists, which2, nodeVersion) {
|
|
12308
|
+
const configured = env[CODEGRAPH_NODE_BIN_ENV]?.trim();
|
|
12309
|
+
if (configured !== undefined && configured.length > 0) {
|
|
12310
|
+
const resolved = resolveConfiguredNodeRuntime(configured, fileExists, which2);
|
|
12311
|
+
return resolved !== null && supportsCodegraphNodeRuntime(resolved, env, nodeVersion) ? resolved : null;
|
|
12312
|
+
}
|
|
12313
|
+
const candidates = [
|
|
12314
|
+
...isNodeExecutableName(process.execPath) ? [process.execPath] : [],
|
|
12315
|
+
...CODEGRAPH_NODE_CANDIDATES.map((commandName) => which2(commandName)).filter((candidate) => candidate !== null)
|
|
12316
|
+
];
|
|
12317
|
+
const seen = new Set;
|
|
12318
|
+
for (const candidate of candidates) {
|
|
12319
|
+
if (seen.has(candidate))
|
|
12320
|
+
continue;
|
|
12321
|
+
seen.add(candidate);
|
|
12322
|
+
if (supportsCodegraphNodeRuntime(candidate, env, nodeVersion))
|
|
12323
|
+
return candidate;
|
|
12324
|
+
}
|
|
12325
|
+
return null;
|
|
12326
|
+
}
|
|
12327
|
+
function resolveCodegraphNodeRuntime(options = {}) {
|
|
12328
|
+
const env = options.env ?? process.env;
|
|
12329
|
+
return defaultNodeRuntime(env, options.fileExists ?? existsSync4, options.which ?? bunWhich, options.nodeVersion ?? defaultNodeVersion);
|
|
12330
|
+
}
|
|
12331
|
+
function resolveCodegraphNodeSupport(options = {}) {
|
|
12332
|
+
const env = options.env ?? process.env;
|
|
12333
|
+
const nodeVersion = options.nodeVersion ?? defaultNodeVersion;
|
|
12334
|
+
const runtime3 = resolveCodegraphNodeRuntime({ ...options, env, nodeVersion });
|
|
12335
|
+
if (runtime3 === null) {
|
|
12336
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: "0.0.0" });
|
|
12337
|
+
}
|
|
12338
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: nodeVersion(runtime3) ?? "0.0.0" });
|
|
12339
|
+
}
|
|
12086
12340
|
// packages/utils/src/command-executor/execute-command.ts
|
|
12087
12341
|
import { exec } from "node:child_process";
|
|
12088
12342
|
import { promisify as promisify2 } from "node:util";
|
|
@@ -12787,7 +13041,7 @@ async function installAstGrepForCodex(options) {
|
|
|
12787
13041
|
return;
|
|
12788
13042
|
const platform = options.platform ?? process.platform;
|
|
12789
13043
|
const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
|
|
12790
|
-
const skillDir =
|
|
13044
|
+
const skillDir = join28(plugin.path, "skills", "ast-grep");
|
|
12791
13045
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
12792
13046
|
try {
|
|
12793
13047
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -12820,7 +13074,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
12820
13074
|
const env3 = options.env ?? process.env;
|
|
12821
13075
|
const platform = options.platform ?? process.platform;
|
|
12822
13076
|
const repoRoot = resolve10(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env3 }));
|
|
12823
|
-
const codexHome = resolve10(options.codexHome ?? env3.CODEX_HOME ??
|
|
13077
|
+
const codexHome = resolve10(options.codexHome ?? env3.CODEX_HOME ?? join31(homedir2(), ".codex"));
|
|
12824
13078
|
const projectDirectory = resolve10(options.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd());
|
|
12825
13079
|
const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env3 });
|
|
12826
13080
|
const runCommand = options.runCommand ?? defaultRunCommand;
|
|
@@ -12838,9 +13092,9 @@ async function runCodexInstaller(options = {}) {
|
|
|
12838
13092
|
if (!gitBashResolution.found) {
|
|
12839
13093
|
throw new Error(gitBashResolution.installHint);
|
|
12840
13094
|
}
|
|
12841
|
-
const codexPackageRoot =
|
|
13095
|
+
const codexPackageRoot = join31(repoRoot, "packages", "omo-codex");
|
|
12842
13096
|
const marketplace = await readMarketplace(repoRoot, {
|
|
12843
|
-
marketplacePath:
|
|
13097
|
+
marketplacePath: join31(codexPackageRoot, "marketplace.json")
|
|
12844
13098
|
});
|
|
12845
13099
|
const distributionManifest = await readDistributionManifest(repoRoot);
|
|
12846
13100
|
const installed = [];
|
|
@@ -12882,7 +13136,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
12882
13136
|
if (runtimeLink !== null)
|
|
12883
13137
|
log2(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
|
|
12884
13138
|
else
|
|
12885
|
-
log2(`Warning: skipped the omo runtime wrapper because ${
|
|
13139
|
+
log2(`Warning: skipped the omo runtime wrapper because ${join31(repoRoot, "dist", "cli", "index.js")} is missing; omo sparkshell/ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
|
|
12886
13140
|
}
|
|
12887
13141
|
pluginSources.push({ name: entry.name, sourcePath });
|
|
12888
13142
|
installed.push(plugin);
|
|
@@ -12935,13 +13189,13 @@ async function runCodexInstaller(options = {}) {
|
|
|
12935
13189
|
});
|
|
12936
13190
|
}
|
|
12937
13191
|
await reapLspDaemons(codexHome).catch(() => []);
|
|
12938
|
-
const marketplaceRoot =
|
|
13192
|
+
const marketplaceRoot = join31(codexHome, "plugins", "cache", marketplace.name);
|
|
12939
13193
|
await writeCachedMarketplaceManifest({
|
|
12940
13194
|
marketplaceName: marketplace.name,
|
|
12941
13195
|
marketplaceRoot,
|
|
12942
13196
|
plugins: installed
|
|
12943
13197
|
});
|
|
12944
|
-
const configPath =
|
|
13198
|
+
const configPath = join31(codexHome, "config.toml");
|
|
12945
13199
|
await updateCodexConfig({
|
|
12946
13200
|
configPath,
|
|
12947
13201
|
repoRoot: codexPackageRoot,
|
|
@@ -12949,6 +13203,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
12949
13203
|
marketplaceSource: codexMarketplaceSource(marketplaceRoot),
|
|
12950
13204
|
pluginNames: marketplace.plugins.map((plugin) => plugin.name),
|
|
12951
13205
|
platform,
|
|
13206
|
+
codegraphMcpEnabled: options.codegraphMcpEnabled ?? resolveCodegraphNodeSupport({ env: env3 }).supported,
|
|
12952
13207
|
gitBashEnabled: platform === "win32" && gitBashResolution.found,
|
|
12953
13208
|
trustedHookStates,
|
|
12954
13209
|
agentConfigs: [...agentConfigs.values()].sort((left, right) => left.name.localeCompare(right.name)),
|
|
@@ -13000,7 +13255,7 @@ function findRepoRootFromImporter(importerDir) {
|
|
|
13000
13255
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
13001
13256
|
if (isRepoRootWithCodexPlugin(current))
|
|
13002
13257
|
return current;
|
|
13003
|
-
for (const wrapperPackageRoot of [
|
|
13258
|
+
for (const wrapperPackageRoot of [join31(current, "node_modules", "oh-my-openagent"), join31(current, "oh-my-openagent")]) {
|
|
13004
13259
|
if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
|
|
13005
13260
|
return wrapperPackageRoot;
|
|
13006
13261
|
}
|
|
@@ -13018,7 +13273,7 @@ function findRepoRoot(input) {
|
|
|
13018
13273
|
return findRepoRootFromImporter(input.importerDir);
|
|
13019
13274
|
}
|
|
13020
13275
|
function isRepoRootWithCodexPlugin(repoRoot) {
|
|
13021
|
-
return
|
|
13276
|
+
return existsSync7(join31(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
|
|
13022
13277
|
}
|
|
13023
13278
|
function codexMarketplaceSource(marketplaceRoot) {
|
|
13024
13279
|
return { sourceType: "local", source: marketplaceRoot };
|
|
@@ -13188,22 +13443,28 @@ function formatLazyCodexInstallHelp() {
|
|
|
13188
13443
|
"`uninstall` removes managed Codex Light state; `cleanup` is a backward-compatible alias.",
|
|
13189
13444
|
"`update` refreshes the installed Codex Light edition in place.",
|
|
13190
13445
|
"",
|
|
13191
|
-
`
|
|
13446
|
+
`Commands supported by lazycodex-ai: ${passthrough}.`,
|
|
13447
|
+
"`doctor` runs the Codex LazyCodex doctor workflow; other pass-through commands delegate to the omo CLI."
|
|
13192
13448
|
].join(`
|
|
13193
13449
|
`);
|
|
13194
13450
|
}
|
|
13195
13451
|
|
|
13196
13452
|
// packages/omo-codex/src/install/lazycodex-delegated-command.ts
|
|
13197
13453
|
async function runDelegatedOmoCommand(parsed, options) {
|
|
13454
|
+
if (parsed.command === "doctor" && process.env.LAZYCODEX_DOCTOR_LCX_ACTIVE === "1") {
|
|
13455
|
+
throw new Error("Refusing recursive lazycodex doctor invocation from inside $omo:lcx-doctor");
|
|
13456
|
+
}
|
|
13198
13457
|
const invocation = buildDelegatedOmoInvocation(parsed);
|
|
13199
13458
|
if (parsed.dryRun) {
|
|
13200
|
-
options.log(
|
|
13459
|
+
options.log(formatShellCommand(invocation.command, invocation.args));
|
|
13201
13460
|
return;
|
|
13202
13461
|
}
|
|
13203
|
-
const env3 = { ...process.env, OMO_INVOCATION_NAME: "omo" };
|
|
13462
|
+
const env3 = invocation.delegatesToOmo ? { ...process.env, OMO_INVOCATION_NAME: "omo", ...invocation.env } : { ...process.env, ...invocation.env };
|
|
13204
13463
|
await options.runCommand(invocation.command, invocation.args, { cwd: options.cwd, env: env3 });
|
|
13205
13464
|
}
|
|
13206
13465
|
function buildDelegatedOmoInvocation(parsed) {
|
|
13466
|
+
if (parsed.command === "doctor")
|
|
13467
|
+
return buildLazyCodexDoctorInvocation(parsed.args);
|
|
13207
13468
|
const args = ["--yes", "--package", "oh-my-openagent", "omo", parsed.command];
|
|
13208
13469
|
if (parsed.command === "install") {
|
|
13209
13470
|
args.push("--platform=codex");
|
|
@@ -13222,18 +13483,61 @@ function buildDelegatedOmoInvocation(parsed) {
|
|
|
13222
13483
|
} else {
|
|
13223
13484
|
args.push(...parsed.args);
|
|
13224
13485
|
}
|
|
13225
|
-
return { command: "npx", args };
|
|
13486
|
+
return { command: "npx", args, delegatesToOmo: true };
|
|
13487
|
+
}
|
|
13488
|
+
function buildLazyCodexDoctorInvocation(doctorArgs) {
|
|
13489
|
+
return {
|
|
13490
|
+
command: "codex",
|
|
13491
|
+
args: [
|
|
13492
|
+
"exec",
|
|
13493
|
+
"--ephemeral",
|
|
13494
|
+
"--sandbox",
|
|
13495
|
+
"read-only",
|
|
13496
|
+
"--skip-git-repo-check",
|
|
13497
|
+
"--cd",
|
|
13498
|
+
".",
|
|
13499
|
+
buildLazyCodexDoctorPrompt(doctorArgs)
|
|
13500
|
+
],
|
|
13501
|
+
delegatesToOmo: false,
|
|
13502
|
+
env: {
|
|
13503
|
+
LAZYCODEX_DOCTOR_LCX_ACTIVE: "1"
|
|
13504
|
+
}
|
|
13505
|
+
};
|
|
13506
|
+
}
|
|
13507
|
+
function buildLazyCodexDoctorPrompt(doctorArgs) {
|
|
13508
|
+
return [
|
|
13509
|
+
"Use $omo:lcx-doctor to diagnose this LazyCodex/Codex installation.",
|
|
13510
|
+
"This command is already the lazycodex doctor surface; never invoke lazycodex doctor from inside the doctor workflow.",
|
|
13511
|
+
"Sync the latest LazyCodex and OpenAI Codex sources into /tmp, inventory the local installation,",
|
|
13512
|
+
"probe the Codex plugin/cache/hooks/MCP state, and report PASS/WARN/FAIL findings with evidence and remediations.",
|
|
13513
|
+
buildDoctorOutputInstruction(doctorArgs),
|
|
13514
|
+
doctorArgs.length > 0 ? `Requested doctor arguments: ${doctorArgs.join(" ")}` : "Requested doctor arguments: none"
|
|
13515
|
+
].join(" ");
|
|
13516
|
+
}
|
|
13517
|
+
function buildDoctorOutputInstruction(doctorArgs) {
|
|
13518
|
+
if (doctorArgs.includes("--json")) {
|
|
13519
|
+
return "Return exactly one JSON object with summary, environment, checks, remediations, and knownIssues fields; do not wrap it in Markdown.";
|
|
13520
|
+
}
|
|
13521
|
+
return "Return the standard Markdown LazyCodex Doctor Report.";
|
|
13522
|
+
}
|
|
13523
|
+
function formatShellCommand(command, args) {
|
|
13524
|
+
return [command, ...args].map(shellQuote).join(" ");
|
|
13525
|
+
}
|
|
13526
|
+
function shellQuote(value) {
|
|
13527
|
+
if (/^[A-Za-z0-9_/:=.,@%+-]+$/.test(value))
|
|
13528
|
+
return value;
|
|
13529
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
13226
13530
|
}
|
|
13227
13531
|
|
|
13228
13532
|
// packages/omo-codex/src/install/lazycodex-manual-update.ts
|
|
13229
|
-
import { spawn as spawn4, spawnSync as
|
|
13533
|
+
import { spawn as spawn4, spawnSync as spawnSync3 } from "node:child_process";
|
|
13230
13534
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
13231
|
-
import { dirname as
|
|
13535
|
+
import { dirname as dirname9, join as join33 } from "node:path";
|
|
13232
13536
|
import { createInterface as createInterface2 } from "node:readline/promises";
|
|
13233
13537
|
import { fileURLToPath } from "node:url";
|
|
13234
13538
|
|
|
13235
13539
|
// packages/omo-codex/src/install/lazycodex-bun-global-paths.ts
|
|
13236
|
-
import { join as
|
|
13540
|
+
import { join as join32 } from "node:path";
|
|
13237
13541
|
function isBunGlobalEntrypointPath(invokedPath, env3) {
|
|
13238
13542
|
if (typeof invokedPath !== "string" || invokedPath.trim().length === 0)
|
|
13239
13543
|
return false;
|
|
@@ -13244,8 +13548,8 @@ function resolveBunGlobalRoots(env3) {
|
|
|
13244
13548
|
const bunInstallRoot = env3.BUN_INSTALL?.trim();
|
|
13245
13549
|
const homeRoot = env3.HOME?.trim();
|
|
13246
13550
|
return [
|
|
13247
|
-
...bunInstallRoot ? [
|
|
13248
|
-
...homeRoot ? [
|
|
13551
|
+
...bunInstallRoot ? [join32(bunInstallRoot, "bin"), join32(bunInstallRoot, "install", "global", "node_modules")] : [],
|
|
13552
|
+
...homeRoot ? [join32(homeRoot, ".bun", "bin"), join32(homeRoot, ".bun", "install", "global", "node_modules")] : []
|
|
13249
13553
|
].map(normalizePathForPrefix);
|
|
13250
13554
|
}
|
|
13251
13555
|
function normalizePathForPrefix(path2) {
|
|
@@ -13337,13 +13641,13 @@ function resolveArgs(env3) {
|
|
|
13337
13641
|
function resolveCurrentVersion(env3) {
|
|
13338
13642
|
if (env3.LAZYCODEX_CURRENT_VERSION?.trim())
|
|
13339
13643
|
return env3.LAZYCODEX_CURRENT_VERSION.trim();
|
|
13340
|
-
const pluginRoot =
|
|
13341
|
-
return readVersionManifest(resolveInstalledVersionPath(env3, pluginRoot)) ?? readVersionManifest(
|
|
13644
|
+
const pluginRoot = dirname9(dirname9(fileURLToPath(import.meta.url)));
|
|
13645
|
+
return readVersionManifest(resolveInstalledVersionPath(env3, pluginRoot)) ?? readVersionManifest(join33(pluginRoot, "..", "..", "..", "package.json")) ?? readVersionManifest(join33(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
13342
13646
|
}
|
|
13343
13647
|
function resolveLatestVersion(env3) {
|
|
13344
13648
|
if (env3.LAZYCODEX_LATEST_VERSION?.trim())
|
|
13345
13649
|
return env3.LAZYCODEX_LATEST_VERSION.trim();
|
|
13346
|
-
const result =
|
|
13650
|
+
const result = spawnSync3("npm", ["view", "lazycodex-ai", "version", "--silent"], {
|
|
13347
13651
|
encoding: "utf8",
|
|
13348
13652
|
stdio: ["ignore", "pipe", "ignore"]
|
|
13349
13653
|
});
|
|
@@ -13371,7 +13675,7 @@ ${trustCommand}`);
|
|
|
13371
13675
|
${trustCommand}`);
|
|
13372
13676
|
}
|
|
13373
13677
|
function resolveKnownBunGlobalUntrustedPackages(env3) {
|
|
13374
|
-
const result =
|
|
13678
|
+
const result = spawnSync3(BUN_UPDATE_COMMAND, BUN_GLOBAL_UNTRUSTED_ARGS, {
|
|
13375
13679
|
encoding: "utf8",
|
|
13376
13680
|
env: env3,
|
|
13377
13681
|
stdio: ["ignore", "pipe", "ignore"]
|
|
@@ -13454,7 +13758,7 @@ function compareVersions(left, right) {
|
|
|
13454
13758
|
function resolveInstalledVersionPath(env3, pluginRoot) {
|
|
13455
13759
|
if (env3.LAZYCODEX_INSTALLED_VERSION_FILE?.trim())
|
|
13456
13760
|
return env3.LAZYCODEX_INSTALLED_VERSION_FILE.trim();
|
|
13457
|
-
return
|
|
13761
|
+
return join33(pluginRoot, INSTALLED_VERSION_FILE);
|
|
13458
13762
|
}
|
|
13459
13763
|
function readVersionManifest(path2) {
|
|
13460
13764
|
try {
|
|
@@ -13471,11 +13775,11 @@ function readVersionManifest(path2) {
|
|
|
13471
13775
|
}
|
|
13472
13776
|
// packages/omo-codex/src/install/codex-git-bash-mcp-env.ts
|
|
13473
13777
|
import { readFile as readFile18, writeFile as writeFile10 } from "node:fs/promises";
|
|
13474
|
-
import { join as
|
|
13778
|
+
import { join as join34 } from "node:path";
|
|
13475
13779
|
var GIT_BASH_ENV_KEY2 = "OMO_CODEX_GIT_BASH_PATH";
|
|
13476
13780
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
13477
13781
|
async function stampGitBashMcpEnv(input) {
|
|
13478
|
-
const manifestPath =
|
|
13782
|
+
const manifestPath = join34(input.pluginRoot, ".mcp.json");
|
|
13479
13783
|
if (!await fileExistsStrict(manifestPath))
|
|
13480
13784
|
return false;
|
|
13481
13785
|
const parsed = JSON.parse(await readFile18(manifestPath, "utf8"));
|
|
@@ -13508,7 +13812,7 @@ function stampCodegraphMcpPath(mcpServers, pluginRoot) {
|
|
|
13508
13812
|
const entrypoint = args[0];
|
|
13509
13813
|
if (typeof entrypoint !== "string" || !CODEGRAPH_RELATIVE_ARGS2.has(entrypoint))
|
|
13510
13814
|
return false;
|
|
13511
|
-
codegraphServer["args"] = [
|
|
13815
|
+
codegraphServer["args"] = [join34(pluginRoot, "components", "codegraph", "dist", "serve.js"), ...args.slice(1)];
|
|
13512
13816
|
return true;
|
|
13513
13817
|
}
|
|
13514
13818
|
|
|
@@ -13517,7 +13821,7 @@ async function installMarketplaceLocally(options = {}) {
|
|
|
13517
13821
|
return runCodexInstaller(options);
|
|
13518
13822
|
}
|
|
13519
13823
|
function resolveDefaultRepoRootForEntrypoint(entrypointPath) {
|
|
13520
|
-
return resolve11(
|
|
13824
|
+
return resolve11(dirname10(entrypointPath), "..", "..", "..");
|
|
13521
13825
|
}
|
|
13522
13826
|
function resolveDefaultRepoRoot() {
|
|
13523
13827
|
return resolveDefaultRepoRootForEntrypoint(fileURLToPath2(import.meta.url));
|
|
@@ -13529,7 +13833,7 @@ async function runLazyCodexInstallLocalCli(input) {
|
|
|
13529
13833
|
return 0;
|
|
13530
13834
|
}
|
|
13531
13835
|
if (parsed.kind === "version") {
|
|
13532
|
-
const packageJson = JSON.parse(await readFile19(
|
|
13836
|
+
const packageJson = JSON.parse(await readFile19(join35(input.defaultRepoRoot, "package.json"), "utf8"));
|
|
13533
13837
|
const version2 = typeof packageJson.version === "string" ? packageJson.version : "unknown";
|
|
13534
13838
|
input.log(`lazycodex-ai ${version2}`);
|
|
13535
13839
|
return 0;
|