oh-my-opencode 4.12.0 → 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 +916 -670
- package/dist/cli-node/index.js +916 -670
- 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 +1042 -640
- 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 +34 -6
- package/dist/skills/ulw-plan/SKILL.md +4 -1
- package/dist/tools/background-task/constants.d.ts +1 -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 +18 -4
- package/package.json +16 -14
- package/packages/omo-codex/THIRD-PARTY-NOTICES.md +27 -4
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +3 -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 +633 -193
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +561 -44
- package/packages/omo-codex/plugin/components/codegraph/package.json +9 -3
- package/packages/omo-codex/plugin/components/codegraph/src/cli.ts +11 -0
- package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +12 -0
- package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +34 -0
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +75 -0
- package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +66 -13
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +26 -12
- package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +50 -330
- 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 +2 -2
- 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-provision.test.ts +48 -0
- 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 -112
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-node-support.test.ts +149 -0
- 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/dist/cli.js +94 -0
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +17 -0
- package/packages/omo-codex/plugin/components/teammode/package.json +26 -0
- 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/teammode/src/cli.ts +12 -0
- package/packages/omo-codex/plugin/components/teammode/src/codex-hook.ts +125 -0
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +116 -0
- package/packages/omo-codex/plugin/components/teammode/tsconfig.json +25 -0
- 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/hooks/post-tool-use-checking-codegraph-init-guidance.json +17 -0
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +17 -0
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +129 -12
- package/packages/omo-codex/plugin/package.json +3 -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/hook-status-message.mjs +1 -0
- 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 +34 -6
- 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/aggregate-hooks.test.mjs +36 -0
- package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +2 -1
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +1 -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-bundled-cli.test.mjs +1 -0
- package/packages/omo-codex/plugin/test/component-codegraph-mcp-smoke.test.mjs +76 -0
- package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +24 -0
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +1 -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 +78 -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 +531 -214
- 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 +34 -6
- 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
package/dist/cli-node/index.js
CHANGED
|
@@ -2146,7 +2146,7 @@ var package_default;
|
|
|
2146
2146
|
var init_package = __esm(() => {
|
|
2147
2147
|
package_default = {
|
|
2148
2148
|
name: "oh-my-opencode",
|
|
2149
|
-
version: "4.
|
|
2149
|
+
version: "4.13.0",
|
|
2150
2150
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
2151
2151
|
main: "./dist/index.js",
|
|
2152
2152
|
types: "dist/index.d.ts",
|
|
@@ -2227,7 +2227,8 @@ var init_package = __esm(() => {
|
|
|
2227
2227
|
"build:cli-node": "bun run script/build-cli-node.ts",
|
|
2228
2228
|
"build:codex-install": "bun run script/build-codex-install.ts",
|
|
2229
2229
|
"build:codex-plugin": "npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build",
|
|
2230
|
-
"build:
|
|
2230
|
+
"build:materialize-frontend": "node packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs --strict",
|
|
2231
|
+
"build:shared-skills-assets": "bun run build:materialize-frontend && rm -rf dist/skills && cp -R packages/shared-skills/skills dist/skills",
|
|
2231
2232
|
"build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
|
|
2232
2233
|
"build:lsp-daemon": "npm --prefix packages/lsp-daemon ci && npm --prefix packages/lsp-daemon run build",
|
|
2233
2234
|
"build:node-require-shim": "bun run script/patch-node-require-shim.ts",
|
|
@@ -2236,6 +2237,7 @@ var init_package = __esm(() => {
|
|
|
2236
2237
|
"build:schema": "bun run script/build-schema.ts",
|
|
2237
2238
|
"build:model-capabilities": "bun run script/build-model-capabilities.ts",
|
|
2238
2239
|
clean: "rm -rf dist",
|
|
2240
|
+
prepack: "bun run build:materialize-frontend",
|
|
2239
2241
|
prepare: "bun run build",
|
|
2240
2242
|
postinstall: "node postinstall.mjs",
|
|
2241
2243
|
prepublishOnly: "bun run clean && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && bun run build",
|
|
@@ -2316,18 +2318,18 @@ var init_package = __esm(() => {
|
|
|
2316
2318
|
typescript: "^6.0.3"
|
|
2317
2319
|
},
|
|
2318
2320
|
optionalDependencies: {
|
|
2319
|
-
"oh-my-opencode-darwin-arm64": "4.
|
|
2320
|
-
"oh-my-opencode-darwin-x64": "4.
|
|
2321
|
-
"oh-my-opencode-darwin-x64-baseline": "4.
|
|
2322
|
-
"oh-my-opencode-linux-arm64": "4.
|
|
2323
|
-
"oh-my-opencode-linux-arm64-musl": "4.
|
|
2324
|
-
"oh-my-opencode-linux-x64": "4.
|
|
2325
|
-
"oh-my-opencode-linux-x64-baseline": "4.
|
|
2326
|
-
"oh-my-opencode-linux-x64-musl": "4.
|
|
2327
|
-
"oh-my-opencode-linux-x64-musl-baseline": "4.
|
|
2328
|
-
"oh-my-opencode-windows-arm64": "4.
|
|
2329
|
-
"oh-my-opencode-windows-x64": "4.
|
|
2330
|
-
"oh-my-opencode-windows-x64-baseline": "4.
|
|
2321
|
+
"oh-my-opencode-darwin-arm64": "4.13.0",
|
|
2322
|
+
"oh-my-opencode-darwin-x64": "4.13.0",
|
|
2323
|
+
"oh-my-opencode-darwin-x64-baseline": "4.13.0",
|
|
2324
|
+
"oh-my-opencode-linux-arm64": "4.13.0",
|
|
2325
|
+
"oh-my-opencode-linux-arm64-musl": "4.13.0",
|
|
2326
|
+
"oh-my-opencode-linux-x64": "4.13.0",
|
|
2327
|
+
"oh-my-opencode-linux-x64-baseline": "4.13.0",
|
|
2328
|
+
"oh-my-opencode-linux-x64-musl": "4.13.0",
|
|
2329
|
+
"oh-my-opencode-linux-x64-musl-baseline": "4.13.0",
|
|
2330
|
+
"oh-my-opencode-windows-arm64": "4.13.0",
|
|
2331
|
+
"oh-my-opencode-windows-x64": "4.13.0",
|
|
2332
|
+
"oh-my-opencode-windows-x64-baseline": "4.13.0"
|
|
2331
2333
|
},
|
|
2332
2334
|
overrides: {
|
|
2333
2335
|
hono: "^4.12.18",
|
|
@@ -7371,6 +7373,36 @@ var init_classify_path_environment = () => {};
|
|
|
7371
7373
|
|
|
7372
7374
|
// packages/utils/src/codegraph/env.ts
|
|
7373
7375
|
var init_env = () => {};
|
|
7376
|
+
|
|
7377
|
+
// packages/utils/src/codegraph/workspace.ts
|
|
7378
|
+
var init_workspace = () => {};
|
|
7379
|
+
|
|
7380
|
+
// packages/utils/src/codegraph/guidance.ts
|
|
7381
|
+
var init_guidance = __esm(() => {
|
|
7382
|
+
init_workspace();
|
|
7383
|
+
});
|
|
7384
|
+
|
|
7385
|
+
// packages/utils/src/codegraph/node-support.ts
|
|
7386
|
+
function evaluateCodegraphNodeSupport(options = {}) {
|
|
7387
|
+
const nodeVersion = options.nodeVersion ?? process.versions.node;
|
|
7388
|
+
const env = options.env ?? process.env;
|
|
7389
|
+
const override = (env[CODEGRAPH_UNSAFE_NODE_ENV]?.trim().length ?? 0) > 0;
|
|
7390
|
+
const major = parseNodeMajor(nodeVersion);
|
|
7391
|
+
if (major >= CODEGRAPH_BLOCKED_NODE_MAJOR) {
|
|
7392
|
+
return { major, override, reason: "too-new", supported: override };
|
|
7393
|
+
}
|
|
7394
|
+
if (major < CODEGRAPH_MIN_NODE_MAJOR) {
|
|
7395
|
+
return { major, override, reason: "too-old", supported: override };
|
|
7396
|
+
}
|
|
7397
|
+
return { major, override, supported: true };
|
|
7398
|
+
}
|
|
7399
|
+
function parseNodeMajor(version) {
|
|
7400
|
+
const normalized = version.startsWith("v") ? version.slice(1) : version;
|
|
7401
|
+
const major = Number.parseInt(normalized.split(".")[0] ?? "", 10);
|
|
7402
|
+
return Number.isNaN(major) ? 0 : major;
|
|
7403
|
+
}
|
|
7404
|
+
var CODEGRAPH_MIN_NODE_MAJOR = 20, CODEGRAPH_BLOCKED_NODE_MAJOR = 25, CODEGRAPH_UNSAFE_NODE_ENV = "CODEGRAPH_ALLOW_UNSAFE_NODE", CODEGRAPH_NODE_BIN_ENV = "CODEGRAPH_NODE_BIN";
|
|
7405
|
+
|
|
7374
7406
|
// packages/utils/src/codegraph/manifest.ts
|
|
7375
7407
|
var init_manifest = () => {};
|
|
7376
7408
|
|
|
@@ -7384,19 +7416,92 @@ var init_provision = __esm(() => {
|
|
|
7384
7416
|
});
|
|
7385
7417
|
|
|
7386
7418
|
// packages/utils/src/codegraph/resolve.ts
|
|
7419
|
+
import { existsSync as existsSync7 } from "node:fs";
|
|
7420
|
+
import { spawnSync } from "node:child_process";
|
|
7421
|
+
import { basename as basename2, dirname as dirname2, join as join7 } from "node:path";
|
|
7387
7422
|
import { createRequire as createRequire2 } from "node:module";
|
|
7388
|
-
|
|
7423
|
+
function defaultNodeVersion(nodePath) {
|
|
7424
|
+
if (nodePath === process.execPath && isNodeExecutableName(nodePath))
|
|
7425
|
+
return process.versions.node;
|
|
7426
|
+
try {
|
|
7427
|
+
const result = spawnSync(nodePath, ["--version"], {
|
|
7428
|
+
encoding: "utf8",
|
|
7429
|
+
timeout: 2000,
|
|
7430
|
+
windowsHide: true
|
|
7431
|
+
});
|
|
7432
|
+
if (result.error !== undefined || result.status !== 0)
|
|
7433
|
+
return null;
|
|
7434
|
+
const version = `${result.stdout}
|
|
7435
|
+
${result.stderr}`.trim().split(/\s+/)[0];
|
|
7436
|
+
return version === undefined || version.length === 0 ? null : version;
|
|
7437
|
+
} catch (error) {
|
|
7438
|
+
if (error instanceof Error)
|
|
7439
|
+
return null;
|
|
7440
|
+
throw error;
|
|
7441
|
+
}
|
|
7442
|
+
}
|
|
7443
|
+
function isNodeExecutableName(filePath) {
|
|
7444
|
+
const executable = basename2(filePath).toLowerCase();
|
|
7445
|
+
return executable === "node" || executable === "node.exe" || /^node\d+(\.exe)?$/.test(executable);
|
|
7446
|
+
}
|
|
7447
|
+
function looksLikePath(command) {
|
|
7448
|
+
return command.includes("/") || command.includes("\\") || /^[a-zA-Z]:/.test(command);
|
|
7449
|
+
}
|
|
7450
|
+
function resolveConfiguredNodeRuntime(configured, fileExists, which2) {
|
|
7451
|
+
if (looksLikePath(configured))
|
|
7452
|
+
return fileExists(configured) ? configured : null;
|
|
7453
|
+
return which2(configured);
|
|
7454
|
+
}
|
|
7455
|
+
function supportsCodegraphNodeRuntime(nodePath, env, nodeVersion) {
|
|
7456
|
+
const version = nodeVersion(nodePath);
|
|
7457
|
+
if (version === null)
|
|
7458
|
+
return false;
|
|
7459
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: version }).supported;
|
|
7460
|
+
}
|
|
7461
|
+
function defaultNodeRuntime(env, fileExists, which2, nodeVersion) {
|
|
7462
|
+
const configured = env[CODEGRAPH_NODE_BIN_ENV]?.trim();
|
|
7463
|
+
if (configured !== undefined && configured.length > 0) {
|
|
7464
|
+
const resolved = resolveConfiguredNodeRuntime(configured, fileExists, which2);
|
|
7465
|
+
return resolved !== null && supportsCodegraphNodeRuntime(resolved, env, nodeVersion) ? resolved : null;
|
|
7466
|
+
}
|
|
7467
|
+
const candidates = [
|
|
7468
|
+
...isNodeExecutableName(process.execPath) ? [process.execPath] : [],
|
|
7469
|
+
...CODEGRAPH_NODE_CANDIDATES.map((commandName) => which2(commandName)).filter((candidate) => candidate !== null)
|
|
7470
|
+
];
|
|
7471
|
+
const seen = new Set;
|
|
7472
|
+
for (const candidate of candidates) {
|
|
7473
|
+
if (seen.has(candidate))
|
|
7474
|
+
continue;
|
|
7475
|
+
seen.add(candidate);
|
|
7476
|
+
if (supportsCodegraphNodeRuntime(candidate, env, nodeVersion))
|
|
7477
|
+
return candidate;
|
|
7478
|
+
}
|
|
7479
|
+
return null;
|
|
7480
|
+
}
|
|
7481
|
+
function resolveCodegraphNodeRuntime(options = {}) {
|
|
7482
|
+
const env = options.env ?? process.env;
|
|
7483
|
+
return defaultNodeRuntime(env, options.fileExists ?? existsSync7, options.which ?? bunWhich, options.nodeVersion ?? defaultNodeVersion);
|
|
7484
|
+
}
|
|
7485
|
+
function resolveCodegraphNodeSupport(options = {}) {
|
|
7486
|
+
const env = options.env ?? process.env;
|
|
7487
|
+
const nodeVersion = options.nodeVersion ?? defaultNodeVersion;
|
|
7488
|
+
const runtime3 = resolveCodegraphNodeRuntime({ ...options, env, nodeVersion });
|
|
7489
|
+
if (runtime3 === null) {
|
|
7490
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: "0.0.0" });
|
|
7491
|
+
}
|
|
7492
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: nodeVersion(runtime3) ?? "0.0.0" });
|
|
7493
|
+
}
|
|
7494
|
+
var CODEGRAPH_NODE_CANDIDATES, requireFromHere;
|
|
7389
7495
|
var init_resolve2 = __esm(() => {
|
|
7390
7496
|
init_which();
|
|
7497
|
+
CODEGRAPH_NODE_CANDIDATES = ["node24", "node22", "node20", "node"];
|
|
7391
7498
|
requireFromHere = createRequire2(import.meta.url);
|
|
7392
7499
|
});
|
|
7393
7500
|
|
|
7394
|
-
// packages/utils/src/codegraph/workspace.ts
|
|
7395
|
-
var init_workspace = () => {};
|
|
7396
|
-
|
|
7397
7501
|
// packages/utils/src/codegraph/index.ts
|
|
7398
7502
|
var init_codegraph = __esm(() => {
|
|
7399
7503
|
init_env();
|
|
7504
|
+
init_guidance();
|
|
7400
7505
|
init_provision();
|
|
7401
7506
|
init_resolve2();
|
|
7402
7507
|
init_workspace();
|
|
@@ -9935,6 +10040,11 @@ var init_runtime_fallback_error_classifier = __esm(() => {
|
|
|
9935
10040
|
init_runtime_fallback_error_shape();
|
|
9936
10041
|
});
|
|
9937
10042
|
|
|
10043
|
+
// packages/model-core/src/provider-exhaustion-fallback-policy.ts
|
|
10044
|
+
var init_provider_exhaustion_fallback_policy = __esm(() => {
|
|
10045
|
+
init_runtime_fallback_error_classifier();
|
|
10046
|
+
});
|
|
10047
|
+
|
|
9938
10048
|
// packages/model-core/src/runtime-fallback-model.ts
|
|
9939
10049
|
var init_runtime_fallback_model = __esm(() => {
|
|
9940
10050
|
init_model_string_parser();
|
|
@@ -10363,6 +10473,7 @@ var init_src2 = __esm(() => {
|
|
|
10363
10473
|
init_runtime_fallback_auto_retry_signal();
|
|
10364
10474
|
init_runtime_fallback_error_classifier();
|
|
10365
10475
|
init_runtime_fallback_error_shape();
|
|
10476
|
+
init_provider_exhaustion_fallback_policy();
|
|
10366
10477
|
init_runtime_fallback_model();
|
|
10367
10478
|
init_model_capabilities();
|
|
10368
10479
|
init_context_limit_resolver();
|
|
@@ -10974,9 +11085,9 @@ var init_migration2 = __esm(() => {
|
|
|
10974
11085
|
});
|
|
10975
11086
|
|
|
10976
11087
|
// packages/omo-opencode/src/shared/opencode-config-dir.ts
|
|
10977
|
-
import { existsSync as
|
|
11088
|
+
import { existsSync as existsSync9, realpathSync as realpathSync3 } from "node:fs";
|
|
10978
11089
|
import { homedir as homedir3 } from "node:os";
|
|
10979
|
-
import { join as
|
|
11090
|
+
import { join as join9, posix, resolve as resolve4, win32 } from "node:path";
|
|
10980
11091
|
function isDevBuild(version) {
|
|
10981
11092
|
if (!version)
|
|
10982
11093
|
return false;
|
|
@@ -10986,15 +11097,15 @@ function getTauriConfigDir(identifier) {
|
|
|
10986
11097
|
const platform = process.platform;
|
|
10987
11098
|
switch (platform) {
|
|
10988
11099
|
case "darwin":
|
|
10989
|
-
return
|
|
11100
|
+
return join9(homedir3(), "Library", "Application Support", identifier);
|
|
10990
11101
|
case "win32": {
|
|
10991
|
-
const appData = process.env.APPDATA ||
|
|
11102
|
+
const appData = process.env.APPDATA || join9(homedir3(), "AppData", "Roaming");
|
|
10992
11103
|
return win32.join(appData, identifier);
|
|
10993
11104
|
}
|
|
10994
11105
|
case "linux":
|
|
10995
11106
|
default: {
|
|
10996
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME ||
|
|
10997
|
-
return
|
|
11107
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join9(homedir3(), ".config");
|
|
11108
|
+
return join9(xdgConfig, identifier);
|
|
10998
11109
|
}
|
|
10999
11110
|
}
|
|
11000
11111
|
}
|
|
@@ -11003,7 +11114,7 @@ function resolveConfigPath(pathValue) {
|
|
|
11003
11114
|
return posix.normalize(pathValue);
|
|
11004
11115
|
}
|
|
11005
11116
|
const resolvedPath = resolve4(pathValue);
|
|
11006
|
-
if (!
|
|
11117
|
+
if (!existsSync9(resolvedPath))
|
|
11007
11118
|
return resolvedPath;
|
|
11008
11119
|
try {
|
|
11009
11120
|
return realpathSync3(resolvedPath);
|
|
@@ -11037,8 +11148,8 @@ function getWslLinuxHomeDir(windowsConfigRoot) {
|
|
|
11037
11148
|
function getCliDefaultConfigDir() {
|
|
11038
11149
|
const envXdgConfig = process.env.XDG_CONFIG_HOME?.trim();
|
|
11039
11150
|
const shouldIgnoreWindowsXdg = envXdgConfig !== undefined && envXdgConfig.length > 0 && isWslEnvironment() && isWindowsUserConfigRoot(envXdgConfig);
|
|
11040
|
-
const xdgConfig = shouldIgnoreWindowsXdg ? posix.join(getWslLinuxHomeDir(envXdgConfig) ?? "/home", ".config") : envXdgConfig ||
|
|
11041
|
-
const configDir = isWslEnvironment() ? posix.join(xdgConfig, "opencode") :
|
|
11151
|
+
const xdgConfig = shouldIgnoreWindowsXdg ? posix.join(getWslLinuxHomeDir(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join9(homedir3(), ".config");
|
|
11152
|
+
const configDir = isWslEnvironment() ? posix.join(xdgConfig, "opencode") : join9(xdgConfig, "opencode");
|
|
11042
11153
|
return resolveConfigPath(configDir);
|
|
11043
11154
|
}
|
|
11044
11155
|
function getCliCustomConfigDir() {
|
|
@@ -11071,9 +11182,9 @@ function getOpenCodeConfigDir(options) {
|
|
|
11071
11182
|
const tauriDir = process.platform === "win32" ? win32.isAbsolute(tauriDirBase) ? win32.normalize(tauriDirBase) : win32.resolve(tauriDirBase) : resolveConfigPath(tauriDirBase);
|
|
11072
11183
|
if (checkExisting) {
|
|
11073
11184
|
const legacyDir = getCliConfigDir();
|
|
11074
|
-
const legacyConfig =
|
|
11075
|
-
const legacyConfigC =
|
|
11076
|
-
if (
|
|
11185
|
+
const legacyConfig = join9(legacyDir, "opencode.json");
|
|
11186
|
+
const legacyConfigC = join9(legacyDir, "opencode.jsonc");
|
|
11187
|
+
if (existsSync9(legacyConfig) || existsSync9(legacyConfigC)) {
|
|
11077
11188
|
return legacyDir;
|
|
11078
11189
|
}
|
|
11079
11190
|
}
|
|
@@ -11083,10 +11194,10 @@ function getOpenCodeConfigPaths(options) {
|
|
|
11083
11194
|
const configDir = getOpenCodeConfigDir(options);
|
|
11084
11195
|
return {
|
|
11085
11196
|
configDir,
|
|
11086
|
-
configJson:
|
|
11087
|
-
configJsonc:
|
|
11088
|
-
packageJson:
|
|
11089
|
-
omoConfig:
|
|
11197
|
+
configJson: join9(configDir, "opencode.json"),
|
|
11198
|
+
configJsonc: join9(configDir, "opencode.jsonc"),
|
|
11199
|
+
packageJson: join9(configDir, "package.json"),
|
|
11200
|
+
omoConfig: join9(configDir, `${CONFIG_BASENAME}.json`)
|
|
11090
11201
|
};
|
|
11091
11202
|
}
|
|
11092
11203
|
var TAURI_APP_IDENTIFIER = "ai.opencode.desktop", TAURI_APP_IDENTIFIER_DEV = "ai.opencode.desktop.dev";
|
|
@@ -11096,10 +11207,10 @@ var init_opencode_config_dir = __esm(() => {
|
|
|
11096
11207
|
|
|
11097
11208
|
// packages/omo-opencode/src/shared/resolve-agent-definition-paths.ts
|
|
11098
11209
|
import { homedir as homedir4 } from "os";
|
|
11099
|
-
import { isAbsolute as isAbsolute2, join as
|
|
11210
|
+
import { isAbsolute as isAbsolute2, join as join10, resolve as resolve5 } from "path";
|
|
11100
11211
|
function resolveAgentDefinitionPaths(paths, baseDir, containmentDir) {
|
|
11101
11212
|
return paths.flatMap((p) => {
|
|
11102
|
-
const expanded = p.startsWith("~/") ?
|
|
11213
|
+
const expanded = p.startsWith("~/") ? join10(homedir4(), p.slice(2)) : p;
|
|
11103
11214
|
const resolved = isAbsolute2(expanded) ? expanded : resolve5(baseDir, expanded);
|
|
11104
11215
|
if (containmentDir !== null && !isWithinProject(resolved, containmentDir)) {
|
|
11105
11216
|
log2(`agent_definitions path rejected (outside project boundary): ${p} -> ${resolved}`);
|
|
@@ -11115,8 +11226,8 @@ var init_resolve_agent_definition_paths = __esm(() => {
|
|
|
11115
11226
|
|
|
11116
11227
|
// packages/omo-opencode/src/shared/opencode-version.ts
|
|
11117
11228
|
import { execSync } from "child_process";
|
|
11118
|
-
import { existsSync as
|
|
11119
|
-
import { dirname as
|
|
11229
|
+
import { existsSync as existsSync10, readFileSync as readFileSync4, realpathSync as realpathSync4 } from "fs";
|
|
11230
|
+
import { dirname as dirname4, join as join11 } from "path";
|
|
11120
11231
|
function parseVersion(version) {
|
|
11121
11232
|
const cleaned = version.replace(/^v/, "").split("-")[0];
|
|
11122
11233
|
return cleaned.split(".").map((n) => parseInt(n, 10) || 0);
|
|
@@ -11157,7 +11268,7 @@ function parsePackageVersion(content) {
|
|
|
11157
11268
|
function getPackageVersionFromBinary(binaryPath, deps) {
|
|
11158
11269
|
try {
|
|
11159
11270
|
const realBinaryPath = deps.realpath(binaryPath);
|
|
11160
|
-
const packagePath =
|
|
11271
|
+
const packagePath = join11(dirname4(dirname4(realBinaryPath)), "package.json");
|
|
11161
11272
|
if (!deps.exists(packagePath))
|
|
11162
11273
|
return null;
|
|
11163
11274
|
return parsePackageVersion(deps.readText(packagePath));
|
|
@@ -11217,15 +11328,15 @@ var init_opencode_version = __esm(() => {
|
|
|
11217
11328
|
return envPath;
|
|
11218
11329
|
return globalThis.Bun?.which("opencode") ?? null;
|
|
11219
11330
|
},
|
|
11220
|
-
exists:
|
|
11331
|
+
exists: existsSync10,
|
|
11221
11332
|
realpath: realpathSync4,
|
|
11222
11333
|
readText: (filePath) => readFileSync4(filePath, "utf-8")
|
|
11223
11334
|
};
|
|
11224
11335
|
});
|
|
11225
11336
|
|
|
11226
11337
|
// packages/omo-opencode/src/shared/opencode-storage-detection.ts
|
|
11227
|
-
import { existsSync as
|
|
11228
|
-
import { join as
|
|
11338
|
+
import { existsSync as existsSync11 } from "node:fs";
|
|
11339
|
+
import { join as join12 } from "node:path";
|
|
11229
11340
|
function isSqliteBackend() {
|
|
11230
11341
|
if (cachedResult === true)
|
|
11231
11342
|
return true;
|
|
@@ -11233,8 +11344,8 @@ function isSqliteBackend() {
|
|
|
11233
11344
|
return false;
|
|
11234
11345
|
const check = () => {
|
|
11235
11346
|
const versionOk = isOpenCodeVersionAtLeast(OPENCODE_SQLITE_VERSION);
|
|
11236
|
-
const dbPath =
|
|
11237
|
-
return versionOk &&
|
|
11347
|
+
const dbPath = join12(getDataDir(), "opencode", "opencode.db");
|
|
11348
|
+
return versionOk && existsSync11(dbPath);
|
|
11238
11349
|
};
|
|
11239
11350
|
if (cachedResult === FALSE_PENDING_RETRY) {
|
|
11240
11351
|
const result2 = check();
|
|
@@ -11303,11 +11414,11 @@ var init_bun_file_shim = __esm(() => {
|
|
|
11303
11414
|
});
|
|
11304
11415
|
|
|
11305
11416
|
// packages/omo-opencode/src/shared/binary-downloader.ts
|
|
11306
|
-
import { chmodSync, existsSync as
|
|
11417
|
+
import { chmodSync, existsSync as existsSync12, mkdirSync as mkdirSync4, unlinkSync as unlinkSync3 } from "node:fs";
|
|
11307
11418
|
import * as path6 from "node:path";
|
|
11308
11419
|
function getCachedBinaryPath(cacheDir, binaryName) {
|
|
11309
11420
|
const binaryPath = path6.join(cacheDir, binaryName);
|
|
11310
|
-
return
|
|
11421
|
+
return existsSync12(binaryPath) ? binaryPath : null;
|
|
11311
11422
|
}
|
|
11312
11423
|
var init_binary_downloader = __esm(() => {
|
|
11313
11424
|
init_bun_spawn_shim();
|
|
@@ -11475,8 +11586,8 @@ var init_agent_tool_restrictions = __esm(() => {
|
|
|
11475
11586
|
});
|
|
11476
11587
|
|
|
11477
11588
|
// packages/omo-opencode/src/shared/json-file-cache-store.ts
|
|
11478
|
-
import { existsSync as
|
|
11479
|
-
import { join as
|
|
11589
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync5, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "node:fs";
|
|
11590
|
+
import { join as join14 } from "node:path";
|
|
11480
11591
|
function toLogLabel(cacheLabel) {
|
|
11481
11592
|
return cacheLabel.toLowerCase();
|
|
11482
11593
|
}
|
|
@@ -11484,11 +11595,11 @@ function createJsonFileCacheStore(options) {
|
|
|
11484
11595
|
let memoryValue;
|
|
11485
11596
|
let writtenInCurrentProcess = false;
|
|
11486
11597
|
function getCacheFilePath() {
|
|
11487
|
-
return
|
|
11598
|
+
return join14(options.getCacheDir(), options.filename);
|
|
11488
11599
|
}
|
|
11489
11600
|
function ensureCacheDir() {
|
|
11490
11601
|
const cacheDir = options.getCacheDir();
|
|
11491
|
-
if (!
|
|
11602
|
+
if (!existsSync13(cacheDir)) {
|
|
11492
11603
|
mkdirSync5(cacheDir, { recursive: true });
|
|
11493
11604
|
}
|
|
11494
11605
|
}
|
|
@@ -11497,7 +11608,7 @@ function createJsonFileCacheStore(options) {
|
|
|
11497
11608
|
return memoryValue;
|
|
11498
11609
|
}
|
|
11499
11610
|
const cacheFile = getCacheFilePath();
|
|
11500
|
-
if (!
|
|
11611
|
+
if (!existsSync13(cacheFile)) {
|
|
11501
11612
|
memoryValue = null;
|
|
11502
11613
|
log2(`[${options.logPrefix}] ${options.cacheLabel} file not found`, { cacheFile });
|
|
11503
11614
|
return null;
|
|
@@ -11523,7 +11634,7 @@ function createJsonFileCacheStore(options) {
|
|
|
11523
11634
|
if (writtenInCurrentProcess) {
|
|
11524
11635
|
return true;
|
|
11525
11636
|
}
|
|
11526
|
-
return
|
|
11637
|
+
return existsSync13(getCacheFilePath());
|
|
11527
11638
|
}
|
|
11528
11639
|
function write(value) {
|
|
11529
11640
|
ensureCacheDir();
|
|
@@ -11766,14 +11877,14 @@ var init_model_resolution_pipeline2 = __esm(() => {
|
|
|
11766
11877
|
});
|
|
11767
11878
|
|
|
11768
11879
|
// packages/omo-opencode/src/shared/model-availability.ts
|
|
11769
|
-
import { existsSync as
|
|
11770
|
-
import { join as
|
|
11880
|
+
import { existsSync as existsSync14, readFileSync as readFileSync6 } from "fs";
|
|
11881
|
+
import { join as join15 } from "path";
|
|
11771
11882
|
function isModelCacheAvailable() {
|
|
11772
11883
|
if (hasProviderModelsCache()) {
|
|
11773
11884
|
return true;
|
|
11774
11885
|
}
|
|
11775
|
-
const cacheFile =
|
|
11776
|
-
return
|
|
11886
|
+
const cacheFile = join15(getOpenCodeCacheDir(), "models.json");
|
|
11887
|
+
return existsSync14(cacheFile);
|
|
11777
11888
|
}
|
|
11778
11889
|
var init_model_availability = __esm(() => {
|
|
11779
11890
|
init_logger2();
|
|
@@ -54197,19 +54308,19 @@ var init_fallback_model_availability = __esm(() => {
|
|
|
54197
54308
|
});
|
|
54198
54309
|
|
|
54199
54310
|
// packages/omo-opencode/src/shared/opencode-storage-paths.ts
|
|
54200
|
-
import { join as
|
|
54311
|
+
import { join as join16 } from "node:path";
|
|
54201
54312
|
var OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE, SESSION_STORAGE;
|
|
54202
54313
|
var init_opencode_storage_paths = __esm(() => {
|
|
54203
54314
|
init_data_path();
|
|
54204
54315
|
OPENCODE_STORAGE = getOpenCodeStorageDir();
|
|
54205
|
-
MESSAGE_STORAGE =
|
|
54206
|
-
PART_STORAGE =
|
|
54207
|
-
SESSION_STORAGE =
|
|
54316
|
+
MESSAGE_STORAGE = join16(OPENCODE_STORAGE, "message");
|
|
54317
|
+
PART_STORAGE = join16(OPENCODE_STORAGE, "part");
|
|
54318
|
+
SESSION_STORAGE = join16(OPENCODE_STORAGE, "session");
|
|
54208
54319
|
});
|
|
54209
54320
|
|
|
54210
54321
|
// packages/omo-opencode/src/shared/compaction-marker.ts
|
|
54211
|
-
import { existsSync as
|
|
54212
|
-
import { join as
|
|
54322
|
+
import { existsSync as existsSync15, readdirSync, readFileSync as readFileSync7 } from "node:fs";
|
|
54323
|
+
import { join as join17 } from "node:path";
|
|
54213
54324
|
function isCompactionPart(part) {
|
|
54214
54325
|
return typeof part === "object" && part !== null && part.type === "compaction";
|
|
54215
54326
|
}
|
|
@@ -54223,20 +54334,20 @@ function isCompactionMessage(message) {
|
|
|
54223
54334
|
return isCompactionAgent(message.info?.agent ?? message.agent) || hasCompactionPart(message.parts);
|
|
54224
54335
|
}
|
|
54225
54336
|
function getCompactionPartStorageDir(messageID) {
|
|
54226
|
-
return
|
|
54337
|
+
return join17(PART_STORAGE, messageID);
|
|
54227
54338
|
}
|
|
54228
54339
|
function hasCompactionPartInStorage(messageID) {
|
|
54229
54340
|
if (!messageID) {
|
|
54230
54341
|
return false;
|
|
54231
54342
|
}
|
|
54232
54343
|
const partDir = getCompactionPartStorageDir(messageID);
|
|
54233
|
-
if (!
|
|
54344
|
+
if (!existsSync15(partDir)) {
|
|
54234
54345
|
return false;
|
|
54235
54346
|
}
|
|
54236
54347
|
try {
|
|
54237
54348
|
return readdirSync(partDir).filter((fileName) => fileName.endsWith(".json")).some((fileName) => {
|
|
54238
54349
|
try {
|
|
54239
|
-
const content = readFileSync7(
|
|
54350
|
+
const content = readFileSync7(join17(partDir, fileName), "utf-8");
|
|
54240
54351
|
return isCompactionPart(JSON.parse(content));
|
|
54241
54352
|
} catch (error) {
|
|
54242
54353
|
if (error instanceof Error) {
|
|
@@ -54336,23 +54447,23 @@ var init_hook_message_injector = __esm(() => {
|
|
|
54336
54447
|
});
|
|
54337
54448
|
|
|
54338
54449
|
// packages/omo-opencode/src/shared/opencode-message-dir.ts
|
|
54339
|
-
import { existsSync as
|
|
54340
|
-
import { join as
|
|
54450
|
+
import { existsSync as existsSync16, readdirSync as readdirSync2 } from "node:fs";
|
|
54451
|
+
import { join as join18 } from "node:path";
|
|
54341
54452
|
function getMessageDir(sessionID) {
|
|
54342
54453
|
if (!sessionID.startsWith("ses_"))
|
|
54343
54454
|
return null;
|
|
54344
54455
|
if (/[/\\]|\.\./.test(sessionID))
|
|
54345
54456
|
return null;
|
|
54346
|
-
if (!
|
|
54457
|
+
if (!existsSync16(MESSAGE_STORAGE))
|
|
54347
54458
|
return null;
|
|
54348
|
-
const directPath =
|
|
54349
|
-
if (
|
|
54459
|
+
const directPath = join18(MESSAGE_STORAGE, sessionID);
|
|
54460
|
+
if (existsSync16(directPath)) {
|
|
54350
54461
|
return directPath;
|
|
54351
54462
|
}
|
|
54352
54463
|
try {
|
|
54353
54464
|
for (const dir of readdirSync2(MESSAGE_STORAGE)) {
|
|
54354
|
-
const sessionPath =
|
|
54355
|
-
if (
|
|
54465
|
+
const sessionPath = join18(MESSAGE_STORAGE, dir, sessionID);
|
|
54466
|
+
if (existsSync16(sessionPath)) {
|
|
54356
54467
|
return sessionPath;
|
|
54357
54468
|
}
|
|
54358
54469
|
}
|
|
@@ -56486,7 +56597,7 @@ var require_cross_spawn = __commonJS((exports, module) => {
|
|
|
56486
56597
|
enoent.hookChildProcess(spawned, parsed);
|
|
56487
56598
|
return spawned;
|
|
56488
56599
|
}
|
|
56489
|
-
function
|
|
56600
|
+
function spawnSync3(command, args, options) {
|
|
56490
56601
|
const parsed = parse3(command, args, options);
|
|
56491
56602
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
56492
56603
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
@@ -56494,18 +56605,18 @@ var require_cross_spawn = __commonJS((exports, module) => {
|
|
|
56494
56605
|
}
|
|
56495
56606
|
module.exports = spawn4;
|
|
56496
56607
|
module.exports.spawn = spawn4;
|
|
56497
|
-
module.exports.sync =
|
|
56608
|
+
module.exports.sync = spawnSync3;
|
|
56498
56609
|
module.exports._parse = parse3;
|
|
56499
56610
|
module.exports._enoent = enoent;
|
|
56500
56611
|
});
|
|
56501
56612
|
|
|
56502
56613
|
// node_modules/.bun/@opencode-ai+sdk@1.15.13/node_modules/@opencode-ai/sdk/dist/process.js
|
|
56503
|
-
import { spawnSync as
|
|
56614
|
+
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
56504
56615
|
function stop(proc) {
|
|
56505
56616
|
if (proc.exitCode !== null || proc.signalCode !== null)
|
|
56506
56617
|
return;
|
|
56507
56618
|
if (process.platform === "win32" && proc.pid) {
|
|
56508
|
-
const out =
|
|
56619
|
+
const out = spawnSync3("taskkill", ["/pid", String(proc.pid), "/T", "/F"], { windowsHide: true });
|
|
56509
56620
|
if (!out.error && out.status === 0)
|
|
56510
56621
|
return;
|
|
56511
56622
|
}
|
|
@@ -57012,11 +57123,11 @@ var init_opencode_command_dirs = __esm(() => {
|
|
|
57012
57123
|
});
|
|
57013
57124
|
|
|
57014
57125
|
// packages/omo-opencode/src/shared/project-discovery-dirs.ts
|
|
57015
|
-
import { existsSync as
|
|
57016
|
-
import { dirname as
|
|
57126
|
+
import { existsSync as existsSync17, realpathSync as realpathSync5 } from "node:fs";
|
|
57127
|
+
import { dirname as dirname5, join as join19, resolve as resolve6, win32 as win322 } from "node:path";
|
|
57017
57128
|
function normalizePath(path7) {
|
|
57018
57129
|
const resolvedPath = process.platform !== "win32" && win322.isAbsolute(path7) ? path7 : resolve6(path7);
|
|
57019
|
-
if (!
|
|
57130
|
+
if (!existsSync17(resolvedPath)) {
|
|
57020
57131
|
return resolvedPath;
|
|
57021
57132
|
}
|
|
57022
57133
|
try {
|
|
@@ -57046,8 +57157,8 @@ function findProjectOpencodePluginConfigFiles(startDirectory, stopDirectory) {
|
|
|
57046
57157
|
const resolvedStopDirectory = stopDirectory ? normalizePath(stopDirectory) : undefined;
|
|
57047
57158
|
const stopDirectoryKey = resolvedStopDirectory ? pathKey(resolvedStopDirectory) : undefined;
|
|
57048
57159
|
while (true) {
|
|
57049
|
-
const opencodeDirectory =
|
|
57050
|
-
if (
|
|
57160
|
+
const opencodeDirectory = join19(currentDirectory, ".opencode");
|
|
57161
|
+
if (existsSync17(opencodeDirectory)) {
|
|
57051
57162
|
const detected = detectPluginConfigFile(opencodeDirectory, {
|
|
57052
57163
|
basenames: [CONFIG_BASENAME],
|
|
57053
57164
|
legacyBasenames: [LEGACY_CONFIG_BASENAME]
|
|
@@ -57063,7 +57174,7 @@ function findProjectOpencodePluginConfigFiles(startDirectory, stopDirectory) {
|
|
|
57063
57174
|
if (stopDirectoryKey === pathKey(currentDirectory)) {
|
|
57064
57175
|
return paths;
|
|
57065
57176
|
}
|
|
57066
|
-
const parentDirectory =
|
|
57177
|
+
const parentDirectory = dirname5(currentDirectory);
|
|
57067
57178
|
if (parentDirectory === currentDirectory) {
|
|
57068
57179
|
return paths;
|
|
57069
57180
|
}
|
|
@@ -57604,17 +57715,17 @@ var init_plugin_name_with_version = __esm(() => {
|
|
|
57604
57715
|
});
|
|
57605
57716
|
|
|
57606
57717
|
// packages/omo-opencode/src/cli/config-manager/backup-config.ts
|
|
57607
|
-
import { copyFileSync as copyFileSync2, existsSync as
|
|
57608
|
-
import { dirname as
|
|
57718
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync18, mkdirSync as mkdirSync6 } from "node:fs";
|
|
57719
|
+
import { dirname as dirname6 } from "node:path";
|
|
57609
57720
|
function backupConfigFile(configPath) {
|
|
57610
|
-
if (!
|
|
57721
|
+
if (!existsSync18(configPath)) {
|
|
57611
57722
|
return { success: true };
|
|
57612
57723
|
}
|
|
57613
57724
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
57614
57725
|
const backupPath = `${configPath}.backup-${timestamp}`;
|
|
57615
57726
|
try {
|
|
57616
|
-
const dir =
|
|
57617
|
-
if (!
|
|
57727
|
+
const dir = dirname6(backupPath);
|
|
57728
|
+
if (!existsSync18(dir)) {
|
|
57618
57729
|
mkdirSync6(dir, { recursive: true });
|
|
57619
57730
|
}
|
|
57620
57731
|
copyFileSync2(configPath, backupPath);
|
|
@@ -57629,10 +57740,10 @@ function backupConfigFile(configPath) {
|
|
|
57629
57740
|
var init_backup_config = () => {};
|
|
57630
57741
|
|
|
57631
57742
|
// packages/omo-opencode/src/cli/config-manager/ensure-config-directory-exists.ts
|
|
57632
|
-
import { existsSync as
|
|
57743
|
+
import { existsSync as existsSync19, mkdirSync as mkdirSync7 } from "node:fs";
|
|
57633
57744
|
function ensureConfigDirectoryExists() {
|
|
57634
57745
|
const configDir = getConfigDir();
|
|
57635
|
-
if (!
|
|
57746
|
+
if (!existsSync19(configDir)) {
|
|
57636
57747
|
mkdirSync7(configDir, { recursive: true });
|
|
57637
57748
|
}
|
|
57638
57749
|
}
|
|
@@ -57670,14 +57781,14 @@ function formatErrorWithSuggestion(err, context) {
|
|
|
57670
57781
|
}
|
|
57671
57782
|
|
|
57672
57783
|
// packages/omo-opencode/src/cli/config-manager/opencode-config-format.ts
|
|
57673
|
-
import { existsSync as
|
|
57784
|
+
import { existsSync as existsSync20 } from "node:fs";
|
|
57674
57785
|
function detectConfigFormat() {
|
|
57675
57786
|
const configJsonc = getConfigJsonc();
|
|
57676
57787
|
const configJson = getConfigJson();
|
|
57677
|
-
if (
|
|
57788
|
+
if (existsSync20(configJsonc)) {
|
|
57678
57789
|
return { format: "jsonc", path: configJsonc };
|
|
57679
57790
|
}
|
|
57680
|
-
if (
|
|
57791
|
+
if (existsSync20(configJson)) {
|
|
57681
57792
|
return { format: "json", path: configJson };
|
|
57682
57793
|
}
|
|
57683
57794
|
return { format: "none", path: configJson };
|
|
@@ -57810,30 +57921,30 @@ function extractVersionFromPluginEntry(entry) {
|
|
|
57810
57921
|
}
|
|
57811
57922
|
|
|
57812
57923
|
// packages/omo-opencode/src/cli/config-manager/add-plugin-to-opencode-config.ts
|
|
57813
|
-
import { existsSync as
|
|
57814
|
-
import { basename as
|
|
57924
|
+
import { existsSync as existsSync21, readdirSync as readdirSync3, readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "node:fs";
|
|
57925
|
+
import { basename as basename3, dirname as dirname7, join as join20 } from "node:path";
|
|
57815
57926
|
function detectConfigFormatInDir(configDir) {
|
|
57816
|
-
const configJsonc =
|
|
57817
|
-
const configJson =
|
|
57818
|
-
if (
|
|
57927
|
+
const configJsonc = join20(configDir, "opencode.jsonc");
|
|
57928
|
+
const configJson = join20(configDir, "opencode.json");
|
|
57929
|
+
if (existsSync21(configJsonc)) {
|
|
57819
57930
|
return { format: "jsonc", path: configJsonc };
|
|
57820
57931
|
}
|
|
57821
|
-
if (
|
|
57932
|
+
if (existsSync21(configJson)) {
|
|
57822
57933
|
return { format: "json", path: configJson };
|
|
57823
57934
|
}
|
|
57824
57935
|
return { format: "none", path: configJson };
|
|
57825
57936
|
}
|
|
57826
57937
|
function getParentConfigDirForProfile(configDir) {
|
|
57827
|
-
const parentDir =
|
|
57828
|
-
if (
|
|
57938
|
+
const parentDir = dirname7(configDir);
|
|
57939
|
+
if (basename3(parentDir) !== "profiles")
|
|
57829
57940
|
return null;
|
|
57830
|
-
return
|
|
57941
|
+
return dirname7(parentDir);
|
|
57831
57942
|
}
|
|
57832
57943
|
function listProfileConfigDirs(rootConfigDir) {
|
|
57833
|
-
const profilesDir =
|
|
57834
|
-
if (!
|
|
57944
|
+
const profilesDir = join20(rootConfigDir, "profiles");
|
|
57945
|
+
if (!existsSync21(profilesDir))
|
|
57835
57946
|
return [];
|
|
57836
|
-
return readdirSync3(profilesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) =>
|
|
57947
|
+
return readdirSync3(profilesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join20(profilesDir, entry.name)).filter((profileDir) => detectConfigFormatInDir(profileDir).format !== "none");
|
|
57837
57948
|
}
|
|
57838
57949
|
function getConfigTargets() {
|
|
57839
57950
|
const primaryConfigDir = getConfigDir();
|
|
@@ -58333,12 +58444,12 @@ var init_migrations_sidecar2 = __esm(() => {
|
|
|
58333
58444
|
});
|
|
58334
58445
|
|
|
58335
58446
|
// packages/omo-opencode/src/shared/migrate-legacy-config-file.ts
|
|
58336
|
-
import { existsSync as
|
|
58337
|
-
import { join as
|
|
58447
|
+
import { existsSync as existsSync22, readFileSync as readFileSync10, renameSync as renameSync4, rmSync } from "node:fs";
|
|
58448
|
+
import { join as join21, dirname as dirname8, basename as basename4 } from "node:path";
|
|
58338
58449
|
function buildCanonicalPath(legacyPath) {
|
|
58339
|
-
const dir =
|
|
58340
|
-
const ext =
|
|
58341
|
-
return
|
|
58450
|
+
const dir = dirname8(legacyPath);
|
|
58451
|
+
const ext = basename4(legacyPath).includes(".jsonc") ? ".jsonc" : ".json";
|
|
58452
|
+
return join21(dir, `${CONFIG_BASENAME}${ext}`);
|
|
58342
58453
|
}
|
|
58343
58454
|
function archiveLegacyConfigFile(legacyPath) {
|
|
58344
58455
|
const backupPath = `${legacyPath}.bak`;
|
|
@@ -58371,10 +58482,10 @@ function archiveLegacyConfigFile(legacyPath) {
|
|
|
58371
58482
|
}
|
|
58372
58483
|
function migrateLegacySidecarFile(legacyPath, canonicalPath) {
|
|
58373
58484
|
const legacySidecarPath = getSidecarPath(legacyPath);
|
|
58374
|
-
if (!
|
|
58485
|
+
if (!existsSync22(legacySidecarPath))
|
|
58375
58486
|
return true;
|
|
58376
58487
|
const canonicalSidecarPath = getSidecarPath(canonicalPath);
|
|
58377
|
-
if (
|
|
58488
|
+
if (existsSync22(canonicalSidecarPath))
|
|
58378
58489
|
return true;
|
|
58379
58490
|
try {
|
|
58380
58491
|
const content = readFileSync10(legacySidecarPath, "utf-8");
|
|
@@ -58394,12 +58505,12 @@ function migrateLegacySidecarFile(legacyPath, canonicalPath) {
|
|
|
58394
58505
|
}
|
|
58395
58506
|
}
|
|
58396
58507
|
function migrateLegacyConfigFile(legacyPath) {
|
|
58397
|
-
if (!
|
|
58508
|
+
if (!existsSync22(legacyPath))
|
|
58398
58509
|
return false;
|
|
58399
|
-
if (!
|
|
58510
|
+
if (!basename4(legacyPath).startsWith(LEGACY_CONFIG_BASENAME))
|
|
58400
58511
|
return false;
|
|
58401
58512
|
const canonicalPath = buildCanonicalPath(legacyPath);
|
|
58402
|
-
if (
|
|
58513
|
+
if (existsSync22(canonicalPath))
|
|
58403
58514
|
return false;
|
|
58404
58515
|
try {
|
|
58405
58516
|
const content = readFileSync10(legacyPath, "utf-8");
|
|
@@ -58443,8 +58554,8 @@ function deepMergeRecord(target, source) {
|
|
|
58443
58554
|
}
|
|
58444
58555
|
|
|
58445
58556
|
// packages/omo-opencode/src/cli/config-manager/write-omo-config.ts
|
|
58446
|
-
import { existsSync as
|
|
58447
|
-
import { basename as
|
|
58557
|
+
import { existsSync as existsSync23, readFileSync as readFileSync11, statSync as statSync4, writeFileSync as writeFileSync5 } from "node:fs";
|
|
58558
|
+
import { basename as basename5, dirname as dirname9, extname, join as join22 } from "node:path";
|
|
58448
58559
|
function isEmptyOrWhitespace2(content) {
|
|
58449
58560
|
return content.trim().length === 0;
|
|
58450
58561
|
}
|
|
@@ -58459,12 +58570,12 @@ function writeOmoConfig(installConfig) {
|
|
|
58459
58570
|
};
|
|
58460
58571
|
}
|
|
58461
58572
|
const detectedConfigPath = getOmoConfigPath();
|
|
58462
|
-
const canonicalConfigPath =
|
|
58463
|
-
const shouldMigrateLegacyPath =
|
|
58464
|
-
const omoConfigPath = shouldMigrateLegacyPath ? migrateLegacyConfigFile(detectedConfigPath) ||
|
|
58573
|
+
const canonicalConfigPath = join22(dirname9(detectedConfigPath), `${CONFIG_BASENAME}${extname(detectedConfigPath) || ".json"}`);
|
|
58574
|
+
const shouldMigrateLegacyPath = basename5(detectedConfigPath).startsWith(LEGACY_CONFIG_BASENAME);
|
|
58575
|
+
const omoConfigPath = shouldMigrateLegacyPath ? migrateLegacyConfigFile(detectedConfigPath) || existsSync23(canonicalConfigPath) ? canonicalConfigPath : detectedConfigPath : detectedConfigPath;
|
|
58465
58576
|
try {
|
|
58466
58577
|
const newConfig = generateOmoConfig(installConfig);
|
|
58467
|
-
if (
|
|
58578
|
+
if (existsSync23(omoConfigPath)) {
|
|
58468
58579
|
const backupResult = backupConfigFile(omoConfigPath);
|
|
58469
58580
|
if (!backupResult.success) {
|
|
58470
58581
|
return {
|
|
@@ -58681,10 +58792,10 @@ var init_opencode_binary = __esm(() => {
|
|
|
58681
58792
|
});
|
|
58682
58793
|
|
|
58683
58794
|
// packages/omo-opencode/src/cli/config-manager/detect-current-config.ts
|
|
58684
|
-
import { existsSync as
|
|
58795
|
+
import { existsSync as existsSync24, readFileSync as readFileSync12 } from "node:fs";
|
|
58685
58796
|
function detectProvidersFromOmoConfig() {
|
|
58686
58797
|
const omoConfigPath = getOmoConfigPath();
|
|
58687
|
-
if (!
|
|
58798
|
+
if (!existsSync24(omoConfigPath)) {
|
|
58688
58799
|
return {
|
|
58689
58800
|
hasOpenAI: true,
|
|
58690
58801
|
hasOpencodeZen: true,
|
|
@@ -58836,10 +58947,10 @@ var init_detect_current_config = __esm(() => {
|
|
|
58836
58947
|
});
|
|
58837
58948
|
|
|
58838
58949
|
// packages/omo-opencode/src/cli/config-manager/bun-install.ts
|
|
58839
|
-
import { existsSync as
|
|
58840
|
-
import { join as
|
|
58950
|
+
import { existsSync as existsSync25 } from "node:fs";
|
|
58951
|
+
import { join as join23 } from "node:path";
|
|
58841
58952
|
function getDefaultWorkspaceDir() {
|
|
58842
|
-
return
|
|
58953
|
+
return join23(getOpenCodeCacheDir(), "packages");
|
|
58843
58954
|
}
|
|
58844
58955
|
function readProcessOutput(stream) {
|
|
58845
58956
|
if (!stream) {
|
|
@@ -58865,7 +58976,7 @@ async function runBunInstallWithDetails(options) {
|
|
|
58865
58976
|
const outputMode = options?.outputMode ?? "pipe";
|
|
58866
58977
|
const cacheDir = options?.workspaceDir ?? getDefaultWorkspaceDir();
|
|
58867
58978
|
const packageJsonPath = `${cacheDir}/package.json`;
|
|
58868
|
-
if (!
|
|
58979
|
+
if (!existsSync25(packageJsonPath)) {
|
|
58869
58980
|
return {
|
|
58870
58981
|
success: false,
|
|
58871
58982
|
error: `Workspace not initialized: ${packageJsonPath} not found. OpenCode should create this on first run.`
|
|
@@ -58946,21 +59057,21 @@ var init_config_manager = __esm(() => {
|
|
|
58946
59057
|
});
|
|
58947
59058
|
|
|
58948
59059
|
// packages/telemetry-core/src/activity-state.ts
|
|
58949
|
-
import { existsSync as
|
|
58950
|
-
import { basename as
|
|
59060
|
+
import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync13 } from "node:fs";
|
|
59061
|
+
import { basename as basename10, join as join49 } from "node:path";
|
|
58951
59062
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
58952
59063
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
58953
59064
|
env: options.env,
|
|
58954
59065
|
osProvider: options.osProvider
|
|
58955
59066
|
});
|
|
58956
|
-
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined :
|
|
58957
|
-
if (dataDir === xdgStateDir || xdgStateDir === undefined &&
|
|
59067
|
+
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join49(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
59068
|
+
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
|
|
58958
59069
|
return dataDir;
|
|
58959
59070
|
}
|
|
58960
|
-
return
|
|
59071
|
+
return join49(dataDir, product.cacheDirName);
|
|
58961
59072
|
}
|
|
58962
59073
|
function getTelemetryActivityStateFilePath(stateDir) {
|
|
58963
|
-
return
|
|
59074
|
+
return join49(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
|
|
58964
59075
|
}
|
|
58965
59076
|
function getDailyActiveCaptureState(input) {
|
|
58966
59077
|
const state = readPostHogActivityState(input.stateDir, input.diagnostics);
|
|
@@ -58985,7 +59096,7 @@ function isPostHogActivityState(value) {
|
|
|
58985
59096
|
}
|
|
58986
59097
|
function readPostHogActivityState(stateDir, diagnostics) {
|
|
58987
59098
|
const stateFilePath = getTelemetryActivityStateFilePath(stateDir);
|
|
58988
|
-
if (!
|
|
59099
|
+
if (!existsSync28(stateFilePath)) {
|
|
58989
59100
|
return {};
|
|
58990
59101
|
}
|
|
58991
59102
|
try {
|
|
@@ -59030,10 +59141,10 @@ var init_activity_state = __esm(() => {
|
|
|
59030
59141
|
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
|
|
59031
59142
|
|
|
59032
59143
|
// packages/telemetry-core/src/diagnostics.ts
|
|
59033
|
-
import { appendFileSync as appendFileSync2, existsSync as
|
|
59034
|
-
import { join as
|
|
59144
|
+
import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync14 } from "node:fs";
|
|
59145
|
+
import { join as join50 } from "node:path";
|
|
59035
59146
|
function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
|
|
59036
|
-
return
|
|
59147
|
+
return join50(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
|
|
59037
59148
|
}
|
|
59038
59149
|
function writeTelemetryDiagnostic(input, options) {
|
|
59039
59150
|
const now = options.now ?? new Date;
|
|
@@ -59051,7 +59162,7 @@ function writeTelemetryDiagnostic(input, options) {
|
|
|
59051
59162
|
}
|
|
59052
59163
|
function cleanupTelemetryDiagnostics(options) {
|
|
59053
59164
|
const diagnosticsFilePath = getTelemetryDiagnosticsFilePath(options.diagnosticsDir);
|
|
59054
|
-
if (!
|
|
59165
|
+
if (!existsSync29(diagnosticsFilePath)) {
|
|
59055
59166
|
return;
|
|
59056
59167
|
}
|
|
59057
59168
|
try {
|
|
@@ -59199,7 +59310,7 @@ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetr
|
|
|
59199
59310
|
var init_machine_id = () => {};
|
|
59200
59311
|
|
|
59201
59312
|
// node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
59202
|
-
import { dirname as
|
|
59313
|
+
import { dirname as dirname16, posix as posix2, sep as sep7 } from "path";
|
|
59203
59314
|
function createModulerModifier() {
|
|
59204
59315
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
59205
59316
|
return async (frames) => {
|
|
@@ -59208,7 +59319,7 @@ function createModulerModifier() {
|
|
|
59208
59319
|
return frames;
|
|
59209
59320
|
};
|
|
59210
59321
|
}
|
|
59211
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
59322
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname16(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
|
|
59212
59323
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
59213
59324
|
return (filename) => {
|
|
59214
59325
|
if (!filename)
|
|
@@ -64758,7 +64869,7 @@ var package_default2;
|
|
|
64758
64869
|
var init_package2 = __esm(() => {
|
|
64759
64870
|
package_default2 = {
|
|
64760
64871
|
name: "@oh-my-opencode/omo-codex",
|
|
64761
|
-
version: "4.
|
|
64872
|
+
version: "4.13.0",
|
|
64762
64873
|
type: "module",
|
|
64763
64874
|
private: true,
|
|
64764
64875
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -64893,7 +65004,7 @@ function createPostHogClient(source, options = {}) {
|
|
|
64893
65004
|
osProvider: options.osProvider ?? resolveOsProvider(),
|
|
64894
65005
|
product: createCodexTelemetryProductConfig(),
|
|
64895
65006
|
source,
|
|
64896
|
-
transportFactory: options.transportFactory
|
|
65007
|
+
transportFactory: options.transportFactory ?? transportFactoryOverride ?? undefined
|
|
64897
65008
|
});
|
|
64898
65009
|
if (!client3.enabled) {
|
|
64899
65010
|
return NO_OP_POSTHOG;
|
|
@@ -64944,7 +65055,7 @@ function __setActivityStateProviderForTesting(provider) {
|
|
|
64944
65055
|
function __resetActivityStateProviderForTesting() {
|
|
64945
65056
|
activityStateProviderOverride = null;
|
|
64946
65057
|
}
|
|
64947
|
-
var osProviderOverride2 = null, activityStateProviderOverride = null, NO_OP_POSTHOG;
|
|
65058
|
+
var osProviderOverride2 = null, activityStateProviderOverride = null, transportFactoryOverride = null, NO_OP_POSTHOG;
|
|
64948
65059
|
var init_posthog = __esm(() => {
|
|
64949
65060
|
init_src4();
|
|
64950
65061
|
init_diagnostics2();
|
|
@@ -65727,20 +65838,20 @@ var init_update_toasts = __esm(() => {
|
|
|
65727
65838
|
});
|
|
65728
65839
|
|
|
65729
65840
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
65730
|
-
import { existsSync as
|
|
65731
|
-
import { dirname as
|
|
65841
|
+
import { existsSync as existsSync48 } from "node:fs";
|
|
65842
|
+
import { dirname as dirname25, join as join67 } from "node:path";
|
|
65732
65843
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
65733
65844
|
function defaultGetModuleHostingWorkspace() {
|
|
65734
65845
|
try {
|
|
65735
|
-
const currentDir =
|
|
65846
|
+
const currentDir = dirname25(fileURLToPath4(import.meta.url));
|
|
65736
65847
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
65737
65848
|
if (!pkgJsonPath)
|
|
65738
65849
|
return null;
|
|
65739
|
-
const pkgDir =
|
|
65740
|
-
const nodeModulesDir =
|
|
65850
|
+
const pkgDir = dirname25(pkgJsonPath);
|
|
65851
|
+
const nodeModulesDir = dirname25(pkgDir);
|
|
65741
65852
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
65742
65853
|
return null;
|
|
65743
|
-
return
|
|
65854
|
+
return dirname25(nodeModulesDir);
|
|
65744
65855
|
} catch (error51) {
|
|
65745
65856
|
if (error51 instanceof Error) {
|
|
65746
65857
|
return null;
|
|
@@ -65881,8 +65992,8 @@ var init_background_update_check = __esm(() => {
|
|
|
65881
65992
|
init_package_json_locator();
|
|
65882
65993
|
init_update_toasts();
|
|
65883
65994
|
defaultDeps4 = {
|
|
65884
|
-
existsSync:
|
|
65885
|
-
join:
|
|
65995
|
+
existsSync: existsSync48,
|
|
65996
|
+
join: join67,
|
|
65886
65997
|
runBunInstallWithDetails,
|
|
65887
65998
|
log: log2,
|
|
65888
65999
|
getOpenCodeCacheDir,
|
|
@@ -66045,7 +66156,7 @@ async function showSpinnerToast(ctx, version3, message) {
|
|
|
66045
66156
|
duration: frameInterval + 50
|
|
66046
66157
|
}
|
|
66047
66158
|
}).catch(ignoreToastError);
|
|
66048
|
-
await new Promise((
|
|
66159
|
+
await new Promise((resolve18) => setTimeout(resolve18, frameInterval));
|
|
66049
66160
|
}
|
|
66050
66161
|
}
|
|
66051
66162
|
var SISYPHUS_SPINNER;
|
|
@@ -66484,13 +66595,13 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
|
|
|
66484
66595
|
}
|
|
66485
66596
|
|
|
66486
66597
|
// packages/omo-codex/src/install/install-codex.ts
|
|
66487
|
-
import { join as
|
|
66488
|
-
import { existsSync as
|
|
66598
|
+
import { join as join51, resolve as resolve14 } from "node:path";
|
|
66599
|
+
import { existsSync as existsSync30 } from "node:fs";
|
|
66489
66600
|
import { homedir as homedir6 } from "node:os";
|
|
66490
66601
|
|
|
66491
66602
|
// packages/omo-codex/src/install/codex-cache-bins.ts
|
|
66492
66603
|
import { chmod, lstat as lstat3, mkdir, readFile as readFile2, readdir, readlink as readlink2, rm as rm2, stat, symlink, writeFile } from "node:fs/promises";
|
|
66493
|
-
import { basename as
|
|
66604
|
+
import { basename as basename6, isAbsolute as isAbsolute3, join as join26, relative as relative2, resolve as resolve7, sep } from "node:path";
|
|
66494
66605
|
|
|
66495
66606
|
// packages/omo-codex/src/install/codex-cache-command-shim.ts
|
|
66496
66607
|
var COMMAND_SHIM_MARKER = ":: generated by oh-my-openagent Codex installer";
|
|
@@ -66516,7 +66627,7 @@ function isNodeErrorWithCode(error) {
|
|
|
66516
66627
|
|
|
66517
66628
|
// packages/omo-codex/src/install/codex-cache-legacy-bins.ts
|
|
66518
66629
|
import { lstat as lstat2, readFile, readlink, rm } from "node:fs/promises";
|
|
66519
|
-
import { join as
|
|
66630
|
+
import { join as join24 } from "node:path";
|
|
66520
66631
|
var LEGACY_CODEX_COMPONENT_BINS = [
|
|
66521
66632
|
{ name: "omo", component: "ulw-loop" },
|
|
66522
66633
|
{ name: "codex-comment-checker", component: "comment-checker" },
|
|
@@ -66528,7 +66639,7 @@ var LEGACY_CODEX_COMPONENT_BINS = [
|
|
|
66528
66639
|
];
|
|
66529
66640
|
async function removeLegacyCodexComponentBins(binDir, platform) {
|
|
66530
66641
|
for (const entry of LEGACY_CODEX_COMPONENT_BINS) {
|
|
66531
|
-
const linkPath =
|
|
66642
|
+
const linkPath = join24(binDir, platform === "win32" ? `${entry.name}.cmd` : entry.name);
|
|
66532
66643
|
await removeLegacyCodexComponentBin(linkPath, entry.component, platform);
|
|
66533
66644
|
}
|
|
66534
66645
|
}
|
|
@@ -66579,10 +66690,10 @@ function isNodeErrorWithCode2(error) {
|
|
|
66579
66690
|
}
|
|
66580
66691
|
|
|
66581
66692
|
// packages/omo-codex/src/install/codex-cache-runtime-wrapper.ts
|
|
66582
|
-
import { join as
|
|
66693
|
+
import { join as join25 } from "node:path";
|
|
66583
66694
|
var RUNTIME_WRAPPER_MARKER = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
66584
66695
|
function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
66585
|
-
const ulwLoopBin = toPosixPath(
|
|
66696
|
+
const ulwLoopBin = toPosixPath(join25(binDir, "omo-ulw-loop"));
|
|
66586
66697
|
const nodeCli = escapePosixDoubleQuoted(toPosixPath(nodeCliPath));
|
|
66587
66698
|
const escapedCliPath = escapePosixDoubleQuoted(toPosixPath(cliPath));
|
|
66588
66699
|
const escapedCodexHome = escapePosixDoubleQuoted(toPosixPath(codexHome));
|
|
@@ -66628,7 +66739,7 @@ function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
|
66628
66739
|
`);
|
|
66629
66740
|
}
|
|
66630
66741
|
function windowsRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
66631
|
-
const ulwLoopBin =
|
|
66742
|
+
const ulwLoopBin = join25(binDir, "omo-ulw-loop.cmd");
|
|
66632
66743
|
return [
|
|
66633
66744
|
"@echo off",
|
|
66634
66745
|
`rem ${RUNTIME_WRAPPER_MARKER}`,
|
|
@@ -66684,29 +66795,29 @@ async function linkCachedPluginBins(input) {
|
|
|
66684
66795
|
return linked;
|
|
66685
66796
|
}
|
|
66686
66797
|
async function linkRootRuntimeBin(input) {
|
|
66687
|
-
const cliPath =
|
|
66798
|
+
const cliPath = join26(input.repoRoot, "dist", "cli", "index.js");
|
|
66688
66799
|
if (!await isFile(cliPath))
|
|
66689
66800
|
return null;
|
|
66690
|
-
const nodeCliPath =
|
|
66801
|
+
const nodeCliPath = join26(input.repoRoot, "dist", "cli-node", "index.js");
|
|
66691
66802
|
const platform = input.platform ?? process.platform;
|
|
66692
66803
|
await mkdir(input.binDir, { recursive: true });
|
|
66693
66804
|
if (platform === "win32") {
|
|
66694
|
-
const linkPath2 =
|
|
66805
|
+
const linkPath2 = join26(input.binDir, "omo.cmd");
|
|
66695
66806
|
await replaceRuntimeWrapper(linkPath2, windowsRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
|
|
66696
66807
|
return { name: "omo", path: linkPath2, target: cliPath };
|
|
66697
66808
|
}
|
|
66698
|
-
const linkPath =
|
|
66809
|
+
const linkPath = join26(input.binDir, "omo");
|
|
66699
66810
|
await replaceRuntimeWrapper(linkPath, posixRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
|
|
66700
66811
|
await chmod(linkPath, 493);
|
|
66701
66812
|
return { name: "omo", path: linkPath, target: cliPath };
|
|
66702
66813
|
}
|
|
66703
66814
|
async function linkCachedPluginBin(binDir, link, platform) {
|
|
66704
66815
|
if (platform === "win32") {
|
|
66705
|
-
const linkPath2 =
|
|
66816
|
+
const linkPath2 = join26(binDir, `${link.name}.cmd`);
|
|
66706
66817
|
await replaceCommandShim(linkPath2, link.target);
|
|
66707
66818
|
return linkPath2;
|
|
66708
66819
|
}
|
|
66709
|
-
const linkPath =
|
|
66820
|
+
const linkPath = join26(binDir, link.name);
|
|
66710
66821
|
await replaceSymlink(linkPath, link.target);
|
|
66711
66822
|
return linkPath;
|
|
66712
66823
|
}
|
|
@@ -66727,14 +66838,14 @@ async function discoverPackageBins(root) {
|
|
|
66727
66838
|
async function collectPackageBins(directory, root, links) {
|
|
66728
66839
|
const entries = await readdir(directory, { withFileTypes: true });
|
|
66729
66840
|
if (entries.some((entry) => entry.isFile() && entry.name === "package.json")) {
|
|
66730
|
-
await appendPackageBinLinks(
|
|
66841
|
+
await appendPackageBinLinks(join26(directory, "package.json"), directory, root, links);
|
|
66731
66842
|
}
|
|
66732
66843
|
for (const entry of entries) {
|
|
66733
66844
|
if (!entry.isDirectory())
|
|
66734
66845
|
continue;
|
|
66735
66846
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist")
|
|
66736
66847
|
continue;
|
|
66737
|
-
const childPath =
|
|
66848
|
+
const childPath = join26(directory, entry.name);
|
|
66738
66849
|
if (!childPath.startsWith(root))
|
|
66739
66850
|
continue;
|
|
66740
66851
|
await collectPackageBins(childPath, root, links);
|
|
@@ -66747,7 +66858,7 @@ async function appendPackageBinLinks(packageJsonPath, packageRoot, root, links)
|
|
|
66747
66858
|
const packageName = packageJson.name;
|
|
66748
66859
|
const packageBin = packageJson.bin;
|
|
66749
66860
|
if (typeof packageBin === "string" && typeof packageName === "string") {
|
|
66750
|
-
const name = assertSafeCommandName(
|
|
66861
|
+
const name = assertSafeCommandName(basename6(packageName));
|
|
66751
66862
|
if (!isReservedNestedBinName(name, packageRoot, root)) {
|
|
66752
66863
|
links.push({ name, target: resolvePackageBinTarget(packageRoot, packageBin) });
|
|
66753
66864
|
}
|
|
@@ -66849,11 +66960,11 @@ async function existingNonSymlink(path7) {
|
|
|
66849
66960
|
}
|
|
66850
66961
|
// packages/omo-codex/src/install/codex-cache-install.ts
|
|
66851
66962
|
import { cp as cp2, mkdir as mkdir3, readFile as readFile7, rename, rm as rm3 } from "node:fs/promises";
|
|
66852
|
-
import { basename as
|
|
66963
|
+
import { basename as basename7, dirname as dirname12, join as join32, sep as sep5 } from "node:path";
|
|
66853
66964
|
|
|
66854
66965
|
// packages/omo-codex/src/install/codex-cache-bundled-mcps.ts
|
|
66855
66966
|
import { cp, mkdir as mkdir2, readFile as readFile3, stat as stat2 } from "node:fs/promises";
|
|
66856
|
-
import { dirname as
|
|
66967
|
+
import { dirname as dirname10, join as join27, resolve as resolve8 } from "node:path";
|
|
66857
66968
|
var BUNDLED_MCP_RUNTIMES = [
|
|
66858
66969
|
{
|
|
66859
66970
|
label: "Git Bash MCP",
|
|
@@ -66871,7 +66982,7 @@ var BUNDLED_MCP_RUNTIMES = [
|
|
|
66871
66982
|
}
|
|
66872
66983
|
];
|
|
66873
66984
|
async function copyBundledMcpRuntimeDists(input) {
|
|
66874
|
-
const sourceArgs = await readSourceMcpArgs(
|
|
66985
|
+
const sourceArgs = await readSourceMcpArgs(join27(input.sourceRoot, ".mcp.json"));
|
|
66875
66986
|
for (const runtime4 of BUNDLED_MCP_RUNTIMES) {
|
|
66876
66987
|
if (!sourceArgs.has(runtime4.sourceArg))
|
|
66877
66988
|
continue;
|
|
@@ -66880,15 +66991,15 @@ async function copyBundledMcpRuntimeDists(input) {
|
|
|
66880
66991
|
}
|
|
66881
66992
|
function resolveBundledMcpRuntimeArg(pluginRoot, arg) {
|
|
66882
66993
|
const runtime4 = BUNDLED_MCP_RUNTIMES.find((candidate) => candidate.sourceArg === arg);
|
|
66883
|
-
return runtime4 ?
|
|
66994
|
+
return runtime4 ? join27(pluginRoot, runtime4.destinationArg) : null;
|
|
66884
66995
|
}
|
|
66885
66996
|
async function copyBundledMcpRuntimeDist(pluginRoot, sourceRoot, runtime4) {
|
|
66886
66997
|
const sourcePath = resolve8(sourceRoot, runtime4.sourceDistFromPlugin);
|
|
66887
66998
|
if (!await isDirectory(sourcePath)) {
|
|
66888
66999
|
throw new Error(`missing built ${runtime4.label} dist at ${sourcePath}`);
|
|
66889
67000
|
}
|
|
66890
|
-
const destinationPath =
|
|
66891
|
-
await mkdir2(
|
|
67001
|
+
const destinationPath = join27(pluginRoot, runtime4.destinationDistFromPlugin);
|
|
67002
|
+
await mkdir2(dirname10(destinationPath), { recursive: true });
|
|
66892
67003
|
await cp(sourcePath, destinationPath, { recursive: true });
|
|
66893
67004
|
}
|
|
66894
67005
|
async function readSourceMcpArgs(path7) {
|
|
@@ -66926,37 +67037,37 @@ async function isDirectory(path7) {
|
|
|
66926
67037
|
// packages/omo-codex/src/install/codex-cache-local-dependencies.ts
|
|
66927
67038
|
import { realpathSync as realpathSync6 } from "node:fs";
|
|
66928
67039
|
import { readFile as readFile4, readdir as readdir2, writeFile as writeFile2 } from "node:fs/promises";
|
|
66929
|
-
import { dirname as
|
|
67040
|
+
import { dirname as dirname11, isAbsolute as isAbsolute5, join as join29, relative as relative4, resolve as resolve10, sep as sep2 } from "node:path";
|
|
66930
67041
|
|
|
66931
67042
|
// packages/omo-codex/src/install/codex-cache-paths.ts
|
|
66932
|
-
import { existsSync as
|
|
66933
|
-
import { isAbsolute as isAbsolute4, join as
|
|
67043
|
+
import { existsSync as existsSync26, readdirSync as readdirSync4 } from "node:fs";
|
|
67044
|
+
import { isAbsolute as isAbsolute4, join as join28, relative as relative3, resolve as resolve9 } from "node:path";
|
|
66934
67045
|
var DEFAULT_CODEX_MARKETPLACE_NAME = "sisyphuslabs";
|
|
66935
67046
|
var DEFAULT_CODEX_PLUGIN_NAME = "omo";
|
|
66936
67047
|
function resolveDefaultCodexHome(homeDir) {
|
|
66937
|
-
return
|
|
67048
|
+
return join28(homeDir, ".codex");
|
|
66938
67049
|
}
|
|
66939
67050
|
function resolveCodexPluginCacheRoot(codexHome, input = {}) {
|
|
66940
|
-
return
|
|
67051
|
+
return join28(codexHome, "plugins", "cache", input.marketplaceName ?? DEFAULT_CODEX_MARKETPLACE_NAME, input.pluginName ?? DEFAULT_CODEX_PLUGIN_NAME);
|
|
66941
67052
|
}
|
|
66942
67053
|
function resolveCachedCodexComponentCliPath(pluginRoot, componentName) {
|
|
66943
|
-
return
|
|
67054
|
+
return join28(pluginRoot, "components", componentName, "dist", "cli.js");
|
|
66944
67055
|
}
|
|
66945
67056
|
function resolveCodexComponentBinCandidates(input) {
|
|
66946
67057
|
return [
|
|
66947
|
-
input.env.CODEX_LOCAL_BIN_DIR ?
|
|
66948
|
-
|
|
66949
|
-
|
|
67058
|
+
input.env.CODEX_LOCAL_BIN_DIR ? join28(input.env.CODEX_LOCAL_BIN_DIR, input.executableName) : undefined,
|
|
67059
|
+
join28(input.homeDir, ".local", "bin", input.executableName),
|
|
67060
|
+
join28(resolveDefaultCodexHome(input.homeDir), "bin", input.executableName)
|
|
66950
67061
|
].filter((value) => typeof value === "string");
|
|
66951
67062
|
}
|
|
66952
67063
|
function findNewestCachedCodexComponentCli(input) {
|
|
66953
67064
|
const versionsRoot = resolveCodexPluginCacheRoot(input.codexHome, input);
|
|
66954
|
-
if (!
|
|
67065
|
+
if (!existsSync26(versionsRoot))
|
|
66955
67066
|
return null;
|
|
66956
67067
|
const versions = readdirSync4(versionsRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionNames).reverse();
|
|
66957
67068
|
for (const version of versions) {
|
|
66958
|
-
const candidate = resolveCachedCodexComponentCliPath(
|
|
66959
|
-
if (
|
|
67069
|
+
const candidate = resolveCachedCodexComponentCliPath(join28(versionsRoot, version), input.componentName);
|
|
67070
|
+
if (existsSync26(candidate))
|
|
66960
67071
|
return candidate;
|
|
66961
67072
|
}
|
|
66962
67073
|
return null;
|
|
@@ -66994,8 +67105,8 @@ async function rewriteCachedPackageLocalFileDependencies(pluginRoot, sourceRoot)
|
|
|
66994
67105
|
const parsed = JSON.parse(raw);
|
|
66995
67106
|
if (!isPlainRecord3(parsed))
|
|
66996
67107
|
continue;
|
|
66997
|
-
const packageDir =
|
|
66998
|
-
const sourcePackageDir =
|
|
67108
|
+
const packageDir = dirname11(packageJsonPath);
|
|
67109
|
+
const sourcePackageDir = join29(sourceRoot, relative4(pluginRoot, packageDir));
|
|
66999
67110
|
let changed = false;
|
|
67000
67111
|
for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
|
|
67001
67112
|
const dependencies = parsed[field];
|
|
@@ -67033,7 +67144,7 @@ async function rewriteCachedPackageLocalFileDependencies(pluginRoot, sourceRoot)
|
|
|
67033
67144
|
`);
|
|
67034
67145
|
}
|
|
67035
67146
|
async function readPackageLock(pluginRoot) {
|
|
67036
|
-
const path7 =
|
|
67147
|
+
const path7 = join29(pluginRoot, "package-lock.json");
|
|
67037
67148
|
try {
|
|
67038
67149
|
const parsed = JSON.parse(await readFile4(path7, "utf8"));
|
|
67039
67150
|
return { path: path7, value: isPlainRecord3(parsed) ? parsed : null, changed: false };
|
|
@@ -67094,14 +67205,14 @@ function canonicalizeExistingPath(path7) {
|
|
|
67094
67205
|
async function collectPackageJsonPaths(directory, root, paths) {
|
|
67095
67206
|
const entries = await readdir2(directory, { withFileTypes: true });
|
|
67096
67207
|
if (entries.some((entry) => entry.isFile() && entry.name === "package.json")) {
|
|
67097
|
-
paths.push(
|
|
67208
|
+
paths.push(join29(directory, "package.json"));
|
|
67098
67209
|
}
|
|
67099
67210
|
for (const entry of entries) {
|
|
67100
67211
|
if (!entry.isDirectory())
|
|
67101
67212
|
continue;
|
|
67102
67213
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist")
|
|
67103
67214
|
continue;
|
|
67104
|
-
const childPath =
|
|
67215
|
+
const childPath = join29(directory, entry.name);
|
|
67105
67216
|
if (!isPathInside(childPath, root))
|
|
67106
67217
|
continue;
|
|
67107
67218
|
await collectPackageJsonPaths(childPath, root, paths);
|
|
@@ -67110,10 +67221,10 @@ async function collectPackageJsonPaths(directory, root, paths) {
|
|
|
67110
67221
|
|
|
67111
67222
|
// packages/omo-codex/src/install/codex-cache-mcp-manifest.ts
|
|
67112
67223
|
import { readFile as readFile5, writeFile as writeFile3 } from "node:fs/promises";
|
|
67113
|
-
import { join as
|
|
67224
|
+
import { join as join30, sep as sep3 } from "node:path";
|
|
67114
67225
|
var CODEGRAPH_RELATIVE_ARGS = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
67115
67226
|
async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
67116
|
-
const manifestPath =
|
|
67227
|
+
const manifestPath = join30(pluginRoot, ".mcp.json");
|
|
67117
67228
|
if (!await fileExistsStrict(manifestPath))
|
|
67118
67229
|
return;
|
|
67119
67230
|
const raw = await readFile5(manifestPath, "utf8");
|
|
@@ -67138,7 +67249,7 @@ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
|
67138
67249
|
if (bundledMcpRuntimeArg !== null)
|
|
67139
67250
|
return bundledMcpRuntimeArg;
|
|
67140
67251
|
if (CODEGRAPH_RELATIVE_ARGS.has(arg))
|
|
67141
|
-
return
|
|
67252
|
+
return join30(pluginRoot, "components", "codegraph", "dist", "serve.js");
|
|
67142
67253
|
if (arg.startsWith("./") || arg.startsWith("../"))
|
|
67143
67254
|
return resolveCachedRuntimePath(pluginRoot, sourceRoot, arg);
|
|
67144
67255
|
return arg;
|
|
@@ -67153,7 +67264,7 @@ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
|
67153
67264
|
`);
|
|
67154
67265
|
}
|
|
67155
67266
|
async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
|
|
67156
|
-
const manifestPath =
|
|
67267
|
+
const manifestPath = join30(pluginRoot, ".mcp.json");
|
|
67157
67268
|
if (!await fileExistsStrict(manifestPath))
|
|
67158
67269
|
return;
|
|
67159
67270
|
const raw = await readFile5(manifestPath, "utf8");
|
|
@@ -67189,7 +67300,7 @@ async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
|
|
|
67189
67300
|
|
|
67190
67301
|
// packages/omo-codex/src/install/codex-hook-targets.ts
|
|
67191
67302
|
import { readFile as readFile6 } from "node:fs/promises";
|
|
67192
|
-
import { join as
|
|
67303
|
+
import { join as join31, sep as sep4 } from "node:path";
|
|
67193
67304
|
var PLUGIN_ROOT_TARGET_PATTERN = /\$\{PLUGIN_ROOT\}[\\/]+([^"']+)/g;
|
|
67194
67305
|
async function findMissingHookCommandTargets(pluginRoot) {
|
|
67195
67306
|
const commands = [];
|
|
@@ -67206,7 +67317,7 @@ async function findMissingHookCommandTargets(pluginRoot) {
|
|
|
67206
67317
|
const targetSuffix = match[1];
|
|
67207
67318
|
if (targetSuffix === undefined)
|
|
67208
67319
|
continue;
|
|
67209
|
-
const target =
|
|
67320
|
+
const target = join31(pluginRoot, ...targetSuffix.split(/[\\/]+/));
|
|
67210
67321
|
if (seen.has(target))
|
|
67211
67322
|
continue;
|
|
67212
67323
|
seen.add(target);
|
|
@@ -67217,17 +67328,17 @@ async function findMissingHookCommandTargets(pluginRoot) {
|
|
|
67217
67328
|
return missing;
|
|
67218
67329
|
}
|
|
67219
67330
|
async function hookManifestPaths(pluginRoot) {
|
|
67220
|
-
const pluginManifestPath =
|
|
67331
|
+
const pluginManifestPath = join31(pluginRoot, ".codex-plugin", "plugin.json");
|
|
67221
67332
|
if (!await fileExistsStrict(pluginManifestPath))
|
|
67222
|
-
return [
|
|
67333
|
+
return [join31(pluginRoot, "hooks", "hooks.json")];
|
|
67223
67334
|
const parsed = JSON.parse(await readFile6(pluginManifestPath, "utf8"));
|
|
67224
67335
|
if (!isPlainRecord3(parsed))
|
|
67225
67336
|
return [];
|
|
67226
67337
|
if (typeof parsed.hooks === "string" && parsed.hooks.trim() !== "") {
|
|
67227
|
-
return [
|
|
67338
|
+
return [join31(pluginRoot, stripDotSlash(parsed.hooks))];
|
|
67228
67339
|
}
|
|
67229
67340
|
if (Array.isArray(parsed.hooks)) {
|
|
67230
|
-
return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) =>
|
|
67341
|
+
return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) => join31(pluginRoot, stripDotSlash(hookPath)));
|
|
67231
67342
|
}
|
|
67232
67343
|
return [];
|
|
67233
67344
|
}
|
|
@@ -67263,7 +67374,7 @@ async function installCachedPlugin(input) {
|
|
|
67263
67374
|
await maybeRunNpmInstall(input.sourcePath, input.runCommand);
|
|
67264
67375
|
await maybeRunNpmBuild(input.sourcePath, input.runCommand);
|
|
67265
67376
|
}
|
|
67266
|
-
const targetPath =
|
|
67377
|
+
const targetPath = join32(input.codexHome, "plugins", "cache", input.marketplaceName, input.name, input.version);
|
|
67267
67378
|
const tempPath = createTempSiblingPath(targetPath);
|
|
67268
67379
|
await rm3(tempPath, { recursive: true, force: true });
|
|
67269
67380
|
try {
|
|
@@ -67271,6 +67382,8 @@ async function installCachedPlugin(input) {
|
|
|
67271
67382
|
await rewriteCachedPackageLocalFileDependencies(tempPath, input.sourcePath);
|
|
67272
67383
|
await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: input.sourcePath });
|
|
67273
67384
|
await maybeRunNpmInstall(tempPath, input.runCommand, ["ci", "--omit=dev"]);
|
|
67385
|
+
if (input.buildSource === false)
|
|
67386
|
+
await maybeRunNpmSyncSkills(tempPath, input.runCommand);
|
|
67274
67387
|
await rewriteCachedMcpManifest(tempPath, input.sourcePath);
|
|
67275
67388
|
await rewriteCachedManifestRoot(tempPath, tempPath, targetPath);
|
|
67276
67389
|
await assertHookCommandTargets(tempPath);
|
|
@@ -67282,14 +67395,14 @@ async function installCachedPlugin(input) {
|
|
|
67282
67395
|
return { name: input.name, version: input.version, path: targetPath };
|
|
67283
67396
|
}
|
|
67284
67397
|
async function maybeRunNpmInstall(cwd, runCommand, args = ["install"]) {
|
|
67285
|
-
if (!await fileExistsStrict(
|
|
67398
|
+
if (!await fileExistsStrict(join32(cwd, "package.json")))
|
|
67286
67399
|
return;
|
|
67287
67400
|
await runCommand("npm", args, { cwd });
|
|
67288
67401
|
}
|
|
67289
67402
|
async function maybeRunNpmBuild(cwd, runCommand) {
|
|
67290
|
-
if (!await fileExistsStrict(
|
|
67403
|
+
if (!await fileExistsStrict(join32(cwd, "package.json")))
|
|
67291
67404
|
return;
|
|
67292
|
-
const packageJson = JSON.parse(await readFile7(
|
|
67405
|
+
const packageJson = JSON.parse(await readFile7(join32(cwd, "package.json"), "utf8"));
|
|
67293
67406
|
if (!isPlainRecord3(packageJson))
|
|
67294
67407
|
return;
|
|
67295
67408
|
const scripts = packageJson.scripts;
|
|
@@ -67297,14 +67410,25 @@ async function maybeRunNpmBuild(cwd, runCommand) {
|
|
|
67297
67410
|
return;
|
|
67298
67411
|
await runCommand("npm", ["run", "build"], { cwd });
|
|
67299
67412
|
}
|
|
67413
|
+
async function maybeRunNpmSyncSkills(cwd, runCommand) {
|
|
67414
|
+
if (!await fileExistsStrict(join32(cwd, "package.json")))
|
|
67415
|
+
return;
|
|
67416
|
+
const packageJson = JSON.parse(await readFile7(join32(cwd, "package.json"), "utf8"));
|
|
67417
|
+
if (!isPlainRecord3(packageJson))
|
|
67418
|
+
return;
|
|
67419
|
+
const scripts = packageJson.scripts;
|
|
67420
|
+
if (!isPlainRecord3(scripts) || typeof scripts["sync:skills"] !== "string")
|
|
67421
|
+
return;
|
|
67422
|
+
await runCommand("npm", ["run", "sync:skills"], { cwd });
|
|
67423
|
+
}
|
|
67300
67424
|
function createTempSiblingPath(targetPath) {
|
|
67301
|
-
return
|
|
67425
|
+
return join32(dirname12(targetPath), `.tmp-${basename7(targetPath)}-${process.pid}-${Date.now()}`);
|
|
67302
67426
|
}
|
|
67303
67427
|
function createBackupSiblingPath(targetPath) {
|
|
67304
|
-
return
|
|
67428
|
+
return join32(dirname12(targetPath), `.backup-${basename7(targetPath)}-${process.pid}-${Date.now()}`);
|
|
67305
67429
|
}
|
|
67306
67430
|
async function copyDirectory(sourcePath, targetPath) {
|
|
67307
|
-
await mkdir3(
|
|
67431
|
+
await mkdir3(dirname12(targetPath), { recursive: true });
|
|
67308
67432
|
await cp2(sourcePath, targetPath, { recursive: true, filter: (source) => shouldCopyPluginPath(source, sourcePath) });
|
|
67309
67433
|
}
|
|
67310
67434
|
async function promoteDirectory(tempPath, targetPath, renameDirectory) {
|
|
@@ -67340,9 +67464,9 @@ function shouldCopyPluginPath(path7, root) {
|
|
|
67340
67464
|
}
|
|
67341
67465
|
// packages/omo-codex/src/install/codex-cache-prune.ts
|
|
67342
67466
|
import { lstat as lstat4, readdir as readdir3, rm as rm4, stat as stat3 } from "node:fs/promises";
|
|
67343
|
-
import { join as
|
|
67467
|
+
import { join as join33 } from "node:path";
|
|
67344
67468
|
async function pruneMarketplaceCache(input) {
|
|
67345
|
-
const cacheRoot =
|
|
67469
|
+
const cacheRoot = join33(input.codexHome, "plugins", "cache", input.marketplaceName);
|
|
67346
67470
|
if (!await fileExistsStrict(cacheRoot))
|
|
67347
67471
|
return;
|
|
67348
67472
|
const keep = new Set(input.keepPluginNames);
|
|
@@ -67350,15 +67474,15 @@ async function pruneMarketplaceCache(input) {
|
|
|
67350
67474
|
for (const entry of entries) {
|
|
67351
67475
|
if (!entry.isDirectory() || keep.has(entry.name))
|
|
67352
67476
|
continue;
|
|
67353
|
-
await rm4(
|
|
67477
|
+
await rm4(join33(cacheRoot, entry.name), { recursive: true, force: true });
|
|
67354
67478
|
}
|
|
67355
67479
|
}
|
|
67356
67480
|
async function pruneMarketplacePluginCaches(input) {
|
|
67357
|
-
const cacheRoot =
|
|
67481
|
+
const cacheRoot = join33(input.codexHome, "plugins", "cache", input.marketplaceName);
|
|
67358
67482
|
if (!await fileExistsStrict(cacheRoot))
|
|
67359
67483
|
return;
|
|
67360
67484
|
for (const pluginName of input.pluginNames) {
|
|
67361
|
-
await rm4(
|
|
67485
|
+
await rm4(join33(cacheRoot, pluginName), { recursive: true, force: true });
|
|
67362
67486
|
}
|
|
67363
67487
|
const remainingEntries = await readCacheEntryNames(cacheRoot);
|
|
67364
67488
|
if (remainingEntries.length === 0) {
|
|
@@ -67405,11 +67529,11 @@ async function isBrokenCacheSymlink(path7) {
|
|
|
67405
67529
|
}
|
|
67406
67530
|
// packages/omo-codex/src/install/codex-cached-marketplace-manifest.ts
|
|
67407
67531
|
import { mkdir as mkdir4, writeFile as writeFile4 } from "node:fs/promises";
|
|
67408
|
-
import { join as
|
|
67532
|
+
import { join as join34 } from "node:path";
|
|
67409
67533
|
async function writeCachedMarketplaceManifest(input) {
|
|
67410
|
-
const marketplaceDir =
|
|
67534
|
+
const marketplaceDir = join34(input.marketplaceRoot, ".agents", "plugins");
|
|
67411
67535
|
await mkdir4(marketplaceDir, { recursive: true });
|
|
67412
|
-
await writeFile4(
|
|
67536
|
+
await writeFile4(join34(marketplaceDir, "marketplace.json"), `${JSON.stringify({
|
|
67413
67537
|
name: input.marketplaceName,
|
|
67414
67538
|
plugins: input.plugins.map((plugin) => ({
|
|
67415
67539
|
name: plugin.name,
|
|
@@ -67420,9 +67544,9 @@ async function writeCachedMarketplaceManifest(input) {
|
|
|
67420
67544
|
}
|
|
67421
67545
|
|
|
67422
67546
|
// packages/omo-codex/src/install/codex-package-layout.ts
|
|
67423
|
-
import { existsSync as
|
|
67547
|
+
import { existsSync as existsSync27 } from "node:fs";
|
|
67424
67548
|
import { readFile as readFile8 } from "node:fs/promises";
|
|
67425
|
-
import { join as
|
|
67549
|
+
import { join as join35 } from "node:path";
|
|
67426
67550
|
var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
|
|
67427
67551
|
"@code-yeongyu/lazycodex",
|
|
67428
67552
|
"@code-yeongyu/lazycodex-ai",
|
|
@@ -67432,10 +67556,10 @@ var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
|
|
|
67432
67556
|
"oh-my-openagent"
|
|
67433
67557
|
]);
|
|
67434
67558
|
async function shouldBuildSourcePackages(repoRoot) {
|
|
67435
|
-
if (
|
|
67559
|
+
if (existsSync27(join35(repoRoot, "packages", "omo-opencode", "src", "index.ts")))
|
|
67436
67560
|
return true;
|
|
67437
|
-
const packageJsonPath =
|
|
67438
|
-
if (!
|
|
67561
|
+
const packageJsonPath = join35(repoRoot, "package.json");
|
|
67562
|
+
if (!existsSync27(packageJsonPath))
|
|
67439
67563
|
return true;
|
|
67440
67564
|
const packageJson = JSON.parse(await readFile8(packageJsonPath, "utf8"));
|
|
67441
67565
|
if (!isPlainRecord3(packageJson) || typeof packageJson.name !== "string")
|
|
@@ -67445,11 +67569,12 @@ async function shouldBuildSourcePackages(repoRoot) {
|
|
|
67445
67569
|
|
|
67446
67570
|
// packages/omo-codex/src/install/codex-config-toml.ts
|
|
67447
67571
|
import { mkdir as mkdir5, readFile as readFile10 } from "node:fs/promises";
|
|
67448
|
-
import { dirname as
|
|
67572
|
+
import { dirname as dirname14 } from "node:path";
|
|
67449
67573
|
|
|
67450
67574
|
// packages/omo-codex/src/install/toml-section-editor.ts
|
|
67451
67575
|
function findTomlSection(config, header) {
|
|
67452
67576
|
const headerLine = `[${header}]`;
|
|
67577
|
+
const targetHeaderPath = parseTomlDottedKey(header);
|
|
67453
67578
|
const lines = config.match(/[^\n]*\n?|$/g) ?? [];
|
|
67454
67579
|
let offset = 0;
|
|
67455
67580
|
let start = -1;
|
|
@@ -67458,7 +67583,7 @@ function findTomlSection(config, header) {
|
|
|
67458
67583
|
break;
|
|
67459
67584
|
const trimmed = line.trim();
|
|
67460
67585
|
if (start === -1) {
|
|
67461
|
-
if (trimmed
|
|
67586
|
+
if (tomlTableHeaderMatches(trimmed, headerLine, targetHeaderPath))
|
|
67462
67587
|
start = offset;
|
|
67463
67588
|
} else if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
67464
67589
|
return { start, end: offset, text: config.slice(start, offset) };
|
|
@@ -67514,6 +67639,127 @@ function insertSetting(sectionText, key, value) {
|
|
|
67514
67639
|
function escapeRegExp(value) {
|
|
67515
67640
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
67516
67641
|
}
|
|
67642
|
+
function tomlTableHeaderMatches(line, headerLine, targetHeaderPath) {
|
|
67643
|
+
if (line === headerLine)
|
|
67644
|
+
return true;
|
|
67645
|
+
if (!targetHeaderPath)
|
|
67646
|
+
return false;
|
|
67647
|
+
const candidateHeaderPath = parseTomlTableHeader(line);
|
|
67648
|
+
if (!candidateHeaderPath || candidateHeaderPath.length !== targetHeaderPath.length)
|
|
67649
|
+
return false;
|
|
67650
|
+
return candidateHeaderPath.every((part, index) => part === targetHeaderPath[index]);
|
|
67651
|
+
}
|
|
67652
|
+
function parseTomlTableHeader(line) {
|
|
67653
|
+
if (!line.startsWith("[") || !line.endsWith("]") || line.startsWith("[["))
|
|
67654
|
+
return null;
|
|
67655
|
+
return parseTomlDottedKey(line.slice(1, -1).trim());
|
|
67656
|
+
}
|
|
67657
|
+
function parseTomlDottedKey(input) {
|
|
67658
|
+
const parts = [];
|
|
67659
|
+
let index = 0;
|
|
67660
|
+
while (index < input.length) {
|
|
67661
|
+
index = skipWhitespace(input, index);
|
|
67662
|
+
const parsedKey = parseTomlKeyPart(input, index);
|
|
67663
|
+
if (!parsedKey)
|
|
67664
|
+
return null;
|
|
67665
|
+
parts.push(parsedKey.value);
|
|
67666
|
+
index = skipWhitespace(input, parsedKey.nextIndex);
|
|
67667
|
+
if (index === input.length)
|
|
67668
|
+
return parts;
|
|
67669
|
+
if (input[index] !== ".")
|
|
67670
|
+
return null;
|
|
67671
|
+
index += 1;
|
|
67672
|
+
}
|
|
67673
|
+
return parts.length > 0 ? parts : null;
|
|
67674
|
+
}
|
|
67675
|
+
function parseTomlKeyPart(input, startIndex) {
|
|
67676
|
+
const quote = input[startIndex];
|
|
67677
|
+
if (quote === "'")
|
|
67678
|
+
return parseLiteralTomlString(input, startIndex);
|
|
67679
|
+
if (quote === '"')
|
|
67680
|
+
return parseBasicTomlString(input, startIndex);
|
|
67681
|
+
return parseBareTomlKey(input, startIndex);
|
|
67682
|
+
}
|
|
67683
|
+
function parseLiteralTomlString(input, startIndex) {
|
|
67684
|
+
let index = startIndex + 1;
|
|
67685
|
+
let value = "";
|
|
67686
|
+
while (index < input.length) {
|
|
67687
|
+
const char = input[index];
|
|
67688
|
+
if (char === "'")
|
|
67689
|
+
return { value, nextIndex: index + 1 };
|
|
67690
|
+
value += char;
|
|
67691
|
+
index += 1;
|
|
67692
|
+
}
|
|
67693
|
+
return null;
|
|
67694
|
+
}
|
|
67695
|
+
function parseBasicTomlString(input, startIndex) {
|
|
67696
|
+
let index = startIndex + 1;
|
|
67697
|
+
let value = "";
|
|
67698
|
+
while (index < input.length) {
|
|
67699
|
+
const char = input[index];
|
|
67700
|
+
if (char === '"')
|
|
67701
|
+
return { value, nextIndex: index + 1 };
|
|
67702
|
+
if (char !== "\\") {
|
|
67703
|
+
value += char;
|
|
67704
|
+
index += 1;
|
|
67705
|
+
continue;
|
|
67706
|
+
}
|
|
67707
|
+
const escaped = parseBasicTomlEscape(input, index);
|
|
67708
|
+
if (!escaped)
|
|
67709
|
+
return null;
|
|
67710
|
+
value += escaped.value;
|
|
67711
|
+
index = escaped.nextIndex;
|
|
67712
|
+
}
|
|
67713
|
+
return null;
|
|
67714
|
+
}
|
|
67715
|
+
function parseBasicTomlEscape(input, backslashIndex) {
|
|
67716
|
+
const escape = input[backslashIndex + 1];
|
|
67717
|
+
if (escape === undefined)
|
|
67718
|
+
return null;
|
|
67719
|
+
if (escape === "b")
|
|
67720
|
+
return { value: "\b", nextIndex: backslashIndex + 2 };
|
|
67721
|
+
if (escape === "t")
|
|
67722
|
+
return { value: "\t", nextIndex: backslashIndex + 2 };
|
|
67723
|
+
if (escape === "n")
|
|
67724
|
+
return { value: `
|
|
67725
|
+
`, nextIndex: backslashIndex + 2 };
|
|
67726
|
+
if (escape === "f")
|
|
67727
|
+
return { value: "\f", nextIndex: backslashIndex + 2 };
|
|
67728
|
+
if (escape === "r")
|
|
67729
|
+
return { value: "\r", nextIndex: backslashIndex + 2 };
|
|
67730
|
+
if (escape === '"')
|
|
67731
|
+
return { value: '"', nextIndex: backslashIndex + 2 };
|
|
67732
|
+
if (escape === "\\")
|
|
67733
|
+
return { value: "\\", nextIndex: backslashIndex + 2 };
|
|
67734
|
+
if (escape === "u")
|
|
67735
|
+
return parseUnicodeEscape(input, backslashIndex + 2, 4);
|
|
67736
|
+
if (escape === "U")
|
|
67737
|
+
return parseUnicodeEscape(input, backslashIndex + 2, 8);
|
|
67738
|
+
return null;
|
|
67739
|
+
}
|
|
67740
|
+
function parseUnicodeEscape(input, digitsStart, digitCount) {
|
|
67741
|
+
const digits = input.slice(digitsStart, digitsStart + digitCount);
|
|
67742
|
+
if (digits.length !== digitCount || !/^[0-9A-Fa-f]+$/.test(digits))
|
|
67743
|
+
return null;
|
|
67744
|
+
const codePoint = Number.parseInt(digits, 16);
|
|
67745
|
+
if (codePoint > 1114111)
|
|
67746
|
+
return null;
|
|
67747
|
+
return { value: String.fromCodePoint(codePoint), nextIndex: digitsStart + digitCount };
|
|
67748
|
+
}
|
|
67749
|
+
function parseBareTomlKey(input, startIndex) {
|
|
67750
|
+
let index = startIndex;
|
|
67751
|
+
while (index < input.length && /[A-Za-z0-9_-]/.test(input[index]))
|
|
67752
|
+
index += 1;
|
|
67753
|
+
if (index === startIndex)
|
|
67754
|
+
return null;
|
|
67755
|
+
return { value: input.slice(startIndex, index), nextIndex: index };
|
|
67756
|
+
}
|
|
67757
|
+
function skipWhitespace(input, startIndex) {
|
|
67758
|
+
let index = startIndex;
|
|
67759
|
+
while (index < input.length && /\s/.test(input[index]))
|
|
67760
|
+
index += 1;
|
|
67761
|
+
return index;
|
|
67762
|
+
}
|
|
67517
67763
|
|
|
67518
67764
|
// packages/omo-codex/src/install/codex-config-toml-sections.ts
|
|
67519
67765
|
function removeTomlSections(config, shouldRemove) {
|
|
@@ -67542,27 +67788,18 @@ function splitTomlSections(config) {
|
|
|
67542
67788
|
return sections;
|
|
67543
67789
|
}
|
|
67544
67790
|
function parsePluginHeaderKey(header) {
|
|
67545
|
-
const
|
|
67546
|
-
|
|
67547
|
-
return null;
|
|
67548
|
-
return parseLeadingJsonString(header.slice(prefix.length));
|
|
67791
|
+
const path7 = parseTomlDottedKey(header);
|
|
67792
|
+
return path7?.[0] === "plugins" ? path7[1] ?? null : null;
|
|
67549
67793
|
}
|
|
67550
67794
|
function parseAgentHeaderName(header) {
|
|
67551
|
-
const
|
|
67552
|
-
|
|
67553
|
-
return null;
|
|
67554
|
-
const key = header.slice(prefix.length);
|
|
67555
|
-
return key.startsWith('"') ? parseLeadingJsonString(key) : key;
|
|
67795
|
+
const path7 = parseTomlDottedKey(header);
|
|
67796
|
+
return path7?.[0] === "agents" ? path7[1] ?? null : null;
|
|
67556
67797
|
}
|
|
67557
|
-
function
|
|
67558
|
-
|
|
67559
|
-
|
|
67560
|
-
return typeof parsed === "string" ? parsed : null;
|
|
67561
|
-
} catch (error) {
|
|
67562
|
-
if (error instanceof Error)
|
|
67563
|
-
return null;
|
|
67798
|
+
function parseHookStateHeaderKey(header) {
|
|
67799
|
+
const path7 = parseTomlDottedKey(header);
|
|
67800
|
+
if (path7?.[0] !== "hooks" || path7[1] !== "state")
|
|
67564
67801
|
return null;
|
|
67565
|
-
|
|
67802
|
+
return path7[2] ?? null;
|
|
67566
67803
|
}
|
|
67567
67804
|
function parseTomlHeader(line) {
|
|
67568
67805
|
const trimmed = line.trim();
|
|
@@ -67570,25 +67807,6 @@ function parseTomlHeader(line) {
|
|
|
67570
67807
|
return null;
|
|
67571
67808
|
return trimmed.slice(1, -1);
|
|
67572
67809
|
}
|
|
67573
|
-
function parseLeadingJsonString(value) {
|
|
67574
|
-
if (!value.startsWith('"'))
|
|
67575
|
-
return parseJsonString(value);
|
|
67576
|
-
let escaped = false;
|
|
67577
|
-
for (let index = 1;index < value.length; index += 1) {
|
|
67578
|
-
const char = value[index];
|
|
67579
|
-
if (escaped) {
|
|
67580
|
-
escaped = false;
|
|
67581
|
-
continue;
|
|
67582
|
-
}
|
|
67583
|
-
if (char === "\\") {
|
|
67584
|
-
escaped = true;
|
|
67585
|
-
continue;
|
|
67586
|
-
}
|
|
67587
|
-
if (char === '"')
|
|
67588
|
-
return parseJsonString(value.slice(0, index + 1));
|
|
67589
|
-
}
|
|
67590
|
-
return null;
|
|
67591
|
-
}
|
|
67592
67810
|
|
|
67593
67811
|
// packages/omo-codex/src/install/codex-config-agents.ts
|
|
67594
67812
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE = ["codex-ultrawork-reviewer"];
|
|
@@ -67632,12 +67850,12 @@ function tomlKeySegment(value) {
|
|
|
67632
67850
|
|
|
67633
67851
|
// packages/omo-codex/src/install/codex-config-atomic-write.ts
|
|
67634
67852
|
import { lstat as lstat5, readlink as readlink3, realpath, rename as rename2, unlink, writeFile as writeFile5 } from "node:fs/promises";
|
|
67635
|
-
import { basename as
|
|
67853
|
+
import { basename as basename8, dirname as dirname13, isAbsolute as isAbsolute6, join as join36, resolve as resolve11 } from "node:path";
|
|
67636
67854
|
var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
|
|
67637
67855
|
var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
|
|
67638
67856
|
async function writeFileAtomic(targetPath, data) {
|
|
67639
67857
|
const writeTarget = await resolveSymlinkTarget(targetPath);
|
|
67640
|
-
const temporaryPath =
|
|
67858
|
+
const temporaryPath = join36(dirname13(writeTarget), `.tmp-${basename8(writeTarget)}-${process.pid}-${Date.now()}`);
|
|
67641
67859
|
await writeFile5(temporaryPath, data);
|
|
67642
67860
|
try {
|
|
67643
67861
|
await renameWithRetry(temporaryPath, writeTarget);
|
|
@@ -67666,7 +67884,7 @@ async function resolveSymlinkTarget(targetPath) {
|
|
|
67666
67884
|
if (!(error instanceof Error))
|
|
67667
67885
|
throw error;
|
|
67668
67886
|
const linkValue = await readlink3(targetPath);
|
|
67669
|
-
return isAbsolute6(linkValue) ? linkValue : resolve11(
|
|
67887
|
+
return isAbsolute6(linkValue) ? linkValue : resolve11(dirname13(targetPath), linkValue);
|
|
67670
67888
|
}
|
|
67671
67889
|
}
|
|
67672
67890
|
async function renameWithRetry(fromPath, toPath) {
|
|
@@ -67725,10 +67943,7 @@ function removeStaleMarketplacePluginBlocks(config, marketplaceName, keepPluginN
|
|
|
67725
67943
|
}
|
|
67726
67944
|
function removeStaleMarketplaceHookStateBlocks(config, marketplaceName, keepPluginNames) {
|
|
67727
67945
|
return removeTomlSections(config, (header) => {
|
|
67728
|
-
const
|
|
67729
|
-
if (!header.startsWith(prefix))
|
|
67730
|
-
return false;
|
|
67731
|
-
const hookKey = parseJsonString(header.slice(prefix.length));
|
|
67946
|
+
const hookKey = parseHookStateHeaderKey(header);
|
|
67732
67947
|
if (hookKey === null)
|
|
67733
67948
|
return false;
|
|
67734
67949
|
const separator = hookKey.indexOf(":");
|
|
@@ -67813,9 +68028,10 @@ enabled = true
|
|
|
67813
68028
|
function ensureOmoBuiltinMcpPolicies(config, input) {
|
|
67814
68029
|
if (input.marketplaceName !== "sisyphuslabs" || !input.pluginNames.includes("omo"))
|
|
67815
68030
|
return config;
|
|
68031
|
+
const codegraphEnabled = input.codegraphMcpEnabled ?? true;
|
|
67816
68032
|
const gitBashEnabled = (input.platform ?? process.platform) === "win32" && input.gitBashEnabled === true;
|
|
67817
68033
|
let nextConfig = ensurePluginMcpEnabled(config, "omo@sisyphuslabs", "context7", true);
|
|
67818
|
-
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "codegraph",
|
|
68034
|
+
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "codegraph", codegraphEnabled);
|
|
67819
68035
|
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "git_bash", gitBashEnabled);
|
|
67820
68036
|
return nextConfig;
|
|
67821
68037
|
}
|
|
@@ -67908,7 +68124,7 @@ function isRootSetting(line, key) {
|
|
|
67908
68124
|
|
|
67909
68125
|
// packages/omo-codex/src/install/codex-model-catalog.ts
|
|
67910
68126
|
import { readFile as readFile9 } from "node:fs/promises";
|
|
67911
|
-
import { join as
|
|
68127
|
+
import { join as join37 } from "node:path";
|
|
67912
68128
|
var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
67913
68129
|
current: {
|
|
67914
68130
|
model: "gpt-5.5",
|
|
@@ -67927,7 +68143,7 @@ var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
|
67927
68143
|
]
|
|
67928
68144
|
};
|
|
67929
68145
|
async function readCodexModelCatalog(codexPackageRoot) {
|
|
67930
|
-
const catalogPath =
|
|
68146
|
+
const catalogPath = join37(codexPackageRoot, "plugin", "model-catalog.json");
|
|
67931
68147
|
try {
|
|
67932
68148
|
const parsed = JSON.parse(await readFile9(catalogPath, "utf8"));
|
|
67933
68149
|
return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
|
|
@@ -68007,7 +68223,7 @@ function removeLegacyAgentsMaxThreadsSetting(config) {
|
|
|
68007
68223
|
|
|
68008
68224
|
// packages/omo-codex/src/install/codex-config-toml.ts
|
|
68009
68225
|
async function updateCodexConfig(input) {
|
|
68010
|
-
await mkdir5(
|
|
68226
|
+
await mkdir5(dirname14(input.configPath), { recursive: true });
|
|
68011
68227
|
let config = "";
|
|
68012
68228
|
if (await exists(input.configPath))
|
|
68013
68229
|
config = await readFile10(input.configPath, "utf8");
|
|
@@ -68058,7 +68274,7 @@ async function exists(path7) {
|
|
|
68058
68274
|
// packages/omo-codex/src/install/codex-hook-trust.ts
|
|
68059
68275
|
import { createHash as createHash2 } from "node:crypto";
|
|
68060
68276
|
import { readFile as readFile11 } from "node:fs/promises";
|
|
68061
|
-
import { join as
|
|
68277
|
+
import { join as join38 } from "node:path";
|
|
68062
68278
|
var EVENT_LABELS = new Map([
|
|
68063
68279
|
["PreToolUse", "pre_tool_use"],
|
|
68064
68280
|
["PermissionRequest", "permission_request"],
|
|
@@ -68072,7 +68288,7 @@ var EVENT_LABELS = new Map([
|
|
|
68072
68288
|
["Stop", "stop"]
|
|
68073
68289
|
]);
|
|
68074
68290
|
async function trustedHookStatesForPlugin(input) {
|
|
68075
|
-
const manifestPath =
|
|
68291
|
+
const manifestPath = join38(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
68076
68292
|
if (!await exists2(manifestPath))
|
|
68077
68293
|
return [];
|
|
68078
68294
|
const manifest = JSON.parse(await readFile11(manifestPath, "utf8"));
|
|
@@ -68080,7 +68296,7 @@ async function trustedHookStatesForPlugin(input) {
|
|
|
68080
68296
|
return [];
|
|
68081
68297
|
const states = [];
|
|
68082
68298
|
for (const hookPath of hookManifestPaths2(manifest.hooks)) {
|
|
68083
|
-
const hooksPath =
|
|
68299
|
+
const hooksPath = join38(input.pluginRoot, hookPath);
|
|
68084
68300
|
if (!await exists2(hooksPath))
|
|
68085
68301
|
continue;
|
|
68086
68302
|
const parsed = JSON.parse(await readFile11(hooksPath, "utf8"));
|
|
@@ -68210,11 +68426,11 @@ function toCodexResolution(resolution) {
|
|
|
68210
68426
|
|
|
68211
68427
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
68212
68428
|
import { copyFile, lstat as lstat7, mkdir as mkdir6, readFile as readFile13, readdir as readdir4, rm as rm6, writeFile as writeFile6 } from "node:fs/promises";
|
|
68213
|
-
import { basename as
|
|
68429
|
+
import { basename as basename9, join as join40 } from "node:path";
|
|
68214
68430
|
|
|
68215
68431
|
// packages/omo-codex/src/install/retired-managed-agent-purge.ts
|
|
68216
68432
|
import { lstat as lstat6, readFile as readFile12, rm as rm5 } from "node:fs/promises";
|
|
68217
|
-
import { join as
|
|
68433
|
+
import { join as join39 } from "node:path";
|
|
68218
68434
|
var RETIRED_MANAGED_AGENT_FILES = [
|
|
68219
68435
|
{
|
|
68220
68436
|
fileName: "codex-ultrawork-reviewer.toml",
|
|
@@ -68226,11 +68442,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
|
|
|
68226
68442
|
}
|
|
68227
68443
|
];
|
|
68228
68444
|
async function purgeRetiredManagedAgentFiles(input) {
|
|
68229
|
-
const agentsDir =
|
|
68445
|
+
const agentsDir = join39(input.codexHome, "agents");
|
|
68230
68446
|
if (!await exists3(agentsDir))
|
|
68231
68447
|
return;
|
|
68232
68448
|
for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
|
|
68233
|
-
const agentPath =
|
|
68449
|
+
const agentPath = join39(agentsDir, retiredAgent.fileName);
|
|
68234
68450
|
if (!await exists3(agentPath))
|
|
68235
68451
|
continue;
|
|
68236
68452
|
const agentStat = await lstat6(agentPath);
|
|
@@ -68273,7 +68489,7 @@ function nodeErrorCode(error) {
|
|
|
68273
68489
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
68274
68490
|
var MANIFEST_FILE = ".installed-agents.json";
|
|
68275
68491
|
async function capturePreservedAgentReasoning(input) {
|
|
68276
|
-
const agentsDir =
|
|
68492
|
+
const agentsDir = join40(input.codexHome, "agents");
|
|
68277
68493
|
if (!await exists4(agentsDir))
|
|
68278
68494
|
return new Map;
|
|
68279
68495
|
const preserved = new Map;
|
|
@@ -68281,7 +68497,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
68281
68497
|
for (const entry of agentEntries) {
|
|
68282
68498
|
if (!entry.name.endsWith(".toml"))
|
|
68283
68499
|
continue;
|
|
68284
|
-
const content = await readTextIfExists2(
|
|
68500
|
+
const content = await readTextIfExists2(join40(agentsDir, entry.name));
|
|
68285
68501
|
if (content === null)
|
|
68286
68502
|
continue;
|
|
68287
68503
|
const effort = extractReasoningEffort(content);
|
|
@@ -68291,7 +68507,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
68291
68507
|
return preserved;
|
|
68292
68508
|
}
|
|
68293
68509
|
async function capturePreservedAgentServiceTier(input) {
|
|
68294
|
-
const agentsDir =
|
|
68510
|
+
const agentsDir = join40(input.codexHome, "agents");
|
|
68295
68511
|
if (!await exists4(agentsDir))
|
|
68296
68512
|
return new Map;
|
|
68297
68513
|
const preserved = new Map;
|
|
@@ -68299,7 +68515,7 @@ async function capturePreservedAgentServiceTier(input) {
|
|
|
68299
68515
|
for (const entry of agentEntries) {
|
|
68300
68516
|
if (!entry.name.endsWith(".toml"))
|
|
68301
68517
|
continue;
|
|
68302
|
-
const content = await readTextIfExists2(
|
|
68518
|
+
const content = await readTextIfExists2(join40(agentsDir, entry.name));
|
|
68303
68519
|
if (content === null)
|
|
68304
68520
|
continue;
|
|
68305
68521
|
preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
|
|
@@ -68313,13 +68529,13 @@ async function linkCachedPluginAgents(input) {
|
|
|
68313
68529
|
await writeManifest(input.pluginRoot, []);
|
|
68314
68530
|
return [];
|
|
68315
68531
|
}
|
|
68316
|
-
const agentsDir =
|
|
68532
|
+
const agentsDir = join40(input.codexHome, "agents");
|
|
68317
68533
|
await mkdir6(agentsDir, { recursive: true });
|
|
68318
68534
|
const linked = [];
|
|
68319
68535
|
for (const agentPath of bundledAgents) {
|
|
68320
|
-
const agentFileName =
|
|
68536
|
+
const agentFileName = basename9(agentPath);
|
|
68321
68537
|
const agentName = agentNameFromToml(agentFileName);
|
|
68322
|
-
const linkPath =
|
|
68538
|
+
const linkPath = join40(agentsDir, agentFileName);
|
|
68323
68539
|
await replaceWithCopy(linkPath, agentPath);
|
|
68324
68540
|
await restorePreservedReasoning({
|
|
68325
68541
|
agentName,
|
|
@@ -68349,7 +68565,7 @@ async function restorePreservedServiceTier(input) {
|
|
|
68349
68565
|
await writeFile6(input.linkPath, replacement.content);
|
|
68350
68566
|
}
|
|
68351
68567
|
async function discoverBundledAgents(pluginRoot) {
|
|
68352
|
-
const componentsRoot =
|
|
68568
|
+
const componentsRoot = join40(pluginRoot, "components");
|
|
68353
68569
|
if (!await exists4(componentsRoot))
|
|
68354
68570
|
return [];
|
|
68355
68571
|
const componentEntries = await readdir4(componentsRoot, { withFileTypes: true });
|
|
@@ -68357,14 +68573,14 @@ async function discoverBundledAgents(pluginRoot) {
|
|
|
68357
68573
|
for (const entry of componentEntries) {
|
|
68358
68574
|
if (!entry.isDirectory())
|
|
68359
68575
|
continue;
|
|
68360
|
-
const agentsRoot =
|
|
68576
|
+
const agentsRoot = join40(componentsRoot, entry.name, "agents");
|
|
68361
68577
|
if (!await exists4(agentsRoot))
|
|
68362
68578
|
continue;
|
|
68363
68579
|
const agentEntries = await readdir4(agentsRoot, { withFileTypes: true });
|
|
68364
68580
|
for (const file2 of agentEntries) {
|
|
68365
68581
|
if (!file2.isFile() || !file2.name.endsWith(".toml"))
|
|
68366
68582
|
continue;
|
|
68367
|
-
agents.push(
|
|
68583
|
+
agents.push(join40(agentsRoot, file2.name));
|
|
68368
68584
|
}
|
|
68369
68585
|
}
|
|
68370
68586
|
agents.sort();
|
|
@@ -68384,7 +68600,7 @@ async function prepareReplacement(linkPath) {
|
|
|
68384
68600
|
await rm6(linkPath, { force: true });
|
|
68385
68601
|
}
|
|
68386
68602
|
async function writeManifest(pluginRoot, agentPaths) {
|
|
68387
|
-
const manifestPath =
|
|
68603
|
+
const manifestPath = join40(pluginRoot, MANIFEST_FILE);
|
|
68388
68604
|
const payload = { agents: [...agentPaths].sort() };
|
|
68389
68605
|
await writeFile6(manifestPath, `${JSON.stringify(payload, null, "\t")}
|
|
68390
68606
|
`);
|
|
@@ -68423,7 +68639,7 @@ function extractTopLevelStringSetting(content, key) {
|
|
|
68423
68639
|
const rawValue = topLevelStringSettingRawValue(line, key);
|
|
68424
68640
|
if (rawValue === undefined)
|
|
68425
68641
|
continue;
|
|
68426
|
-
const parsed =
|
|
68642
|
+
const parsed = parseJsonString(rawValue);
|
|
68427
68643
|
if (parsed !== null)
|
|
68428
68644
|
return parsed;
|
|
68429
68645
|
}
|
|
@@ -68484,7 +68700,7 @@ function isSectionHeader2(line) {
|
|
|
68484
68700
|
function agentNameFromToml(fileName) {
|
|
68485
68701
|
return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
|
|
68486
68702
|
}
|
|
68487
|
-
function
|
|
68703
|
+
function parseJsonString(value) {
|
|
68488
68704
|
try {
|
|
68489
68705
|
const parsed = JSON.parse(value);
|
|
68490
68706
|
return typeof parsed === "string" ? parsed : null;
|
|
@@ -68512,10 +68728,10 @@ function nodeErrorCode2(error) {
|
|
|
68512
68728
|
|
|
68513
68729
|
// packages/omo-codex/src/install/codex-marketplace.ts
|
|
68514
68730
|
import { readFile as readFile14 } from "node:fs/promises";
|
|
68515
|
-
import { join as
|
|
68731
|
+
import { join as join41 } from "node:path";
|
|
68516
68732
|
var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
|
|
68517
68733
|
async function readMarketplace(repoRoot, options) {
|
|
68518
|
-
const marketplacePath = options?.marketplacePath ??
|
|
68734
|
+
const marketplacePath = options?.marketplacePath ?? join41(repoRoot, DEFAULT_MARKETPLACE_PATH);
|
|
68519
68735
|
const raw = await readFile14(marketplacePath, "utf8");
|
|
68520
68736
|
const parsed = JSON.parse(raw);
|
|
68521
68737
|
if (!isPlainRecord3(parsed))
|
|
@@ -68534,10 +68750,10 @@ async function readMarketplace(repoRoot, options) {
|
|
|
68534
68750
|
function resolvePluginSource(repoRoot, plugin, options) {
|
|
68535
68751
|
const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
|
|
68536
68752
|
const relativePath = sourcePath.slice(2);
|
|
68537
|
-
return
|
|
68753
|
+
return join41(repoRoot, ...relativePath.split(/[\\/]/));
|
|
68538
68754
|
}
|
|
68539
68755
|
async function readPluginManifest(pluginRoot) {
|
|
68540
|
-
const raw = await readFile14(
|
|
68756
|
+
const raw = await readFile14(join41(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
|
|
68541
68757
|
const parsed = JSON.parse(raw);
|
|
68542
68758
|
if (!isPlainRecord3(parsed))
|
|
68543
68759
|
throw new Error(`${pluginRoot} plugin.json must be an object`);
|
|
@@ -68619,7 +68835,7 @@ function validateLocalSourcePath(path7) {
|
|
|
68619
68835
|
|
|
68620
68836
|
// packages/omo-codex/src/install/codex-marketplace-snapshot.ts
|
|
68621
68837
|
import { cp as cp3, mkdir as mkdir7, rename as rename3, rm as rm7, writeFile as writeFile7 } from "node:fs/promises";
|
|
68622
|
-
import { join as
|
|
68838
|
+
import { join as join42, sep as sep6 } from "node:path";
|
|
68623
68839
|
var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
|
|
68624
68840
|
async function writeInstalledMarketplaceSnapshot(input) {
|
|
68625
68841
|
const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
|
|
@@ -68632,21 +68848,21 @@ async function writeInstalledMarketplaceSnapshot(input) {
|
|
|
68632
68848
|
return snapshotPlugins;
|
|
68633
68849
|
}
|
|
68634
68850
|
function installedMarketplaceRoot(codexHome, marketplaceName) {
|
|
68635
|
-
return
|
|
68851
|
+
return join42(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
|
|
68636
68852
|
}
|
|
68637
68853
|
async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
|
|
68638
|
-
const manifestDir =
|
|
68854
|
+
const manifestDir = join42(marketplaceRoot, ".agents", "plugins");
|
|
68639
68855
|
await mkdir7(manifestDir, { recursive: true });
|
|
68640
|
-
const tempPath =
|
|
68856
|
+
const tempPath = join42(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
|
|
68641
68857
|
await writeFile7(tempPath, `${JSON.stringify(marketplace, null, "\t")}
|
|
68642
68858
|
`);
|
|
68643
|
-
await rename3(tempPath,
|
|
68859
|
+
await rename3(tempPath, join42(manifestDir, "marketplace.json"));
|
|
68644
68860
|
}
|
|
68645
68861
|
async function writeSnapshotPlugin(marketplaceRoot, plugin) {
|
|
68646
|
-
const pluginsDir =
|
|
68862
|
+
const pluginsDir = join42(marketplaceRoot, "plugins");
|
|
68647
68863
|
await mkdir7(pluginsDir, { recursive: true });
|
|
68648
|
-
const targetPath =
|
|
68649
|
-
const tempPath =
|
|
68864
|
+
const targetPath = join42(pluginsDir, plugin.name);
|
|
68865
|
+
const tempPath = join42(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
|
|
68650
68866
|
await rm7(tempPath, { recursive: true, force: true });
|
|
68651
68867
|
await cp3(plugin.sourcePath, tempPath, {
|
|
68652
68868
|
recursive: true,
|
|
@@ -68668,10 +68884,10 @@ function shouldCopyMarketplaceSourcePath(path7, root) {
|
|
|
68668
68884
|
|
|
68669
68885
|
// packages/omo-codex/src/install/lazycodex-version-stamp.ts
|
|
68670
68886
|
import { readdir as readdir5, readFile as readFile15, writeFile as writeFile8 } from "node:fs/promises";
|
|
68671
|
-
import { join as
|
|
68887
|
+
import { join as join43 } from "node:path";
|
|
68672
68888
|
async function readDistributionManifest(repoRoot) {
|
|
68673
68889
|
try {
|
|
68674
|
-
const parsed = JSON.parse(await readFile15(
|
|
68890
|
+
const parsed = JSON.parse(await readFile15(join43(repoRoot, "package.json"), "utf8"));
|
|
68675
68891
|
if (!isPlainRecord3(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
|
|
68676
68892
|
return;
|
|
68677
68893
|
return {
|
|
@@ -68691,19 +68907,19 @@ function resolveLazyCodexPluginVersion(input) {
|
|
|
68691
68907
|
return input.manifestVersion ?? "local";
|
|
68692
68908
|
}
|
|
68693
68909
|
async function stampLazyCodexPluginVersion(input) {
|
|
68694
|
-
const manifestPath =
|
|
68910
|
+
const manifestPath = join43(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
68695
68911
|
const hookPaths = await readPluginHookPaths(manifestPath);
|
|
68696
68912
|
await stampJsonVersion(manifestPath, input.version);
|
|
68697
|
-
await stampJsonVersion(
|
|
68913
|
+
await stampJsonVersion(join43(input.pluginRoot, "package.json"), input.version);
|
|
68698
68914
|
for (const hookPath of hookPaths) {
|
|
68699
|
-
await stampHookStatusMessages(
|
|
68915
|
+
await stampHookStatusMessages(join43(input.pluginRoot, hookPath), input.version);
|
|
68700
68916
|
}
|
|
68701
68917
|
await stampComponentVersions(input);
|
|
68702
68918
|
}
|
|
68703
68919
|
async function writeLazyCodexInstallSnapshot(input) {
|
|
68704
68920
|
if (input.distributionManifest === undefined)
|
|
68705
68921
|
return;
|
|
68706
|
-
await writeFile8(
|
|
68922
|
+
await writeFile8(join43(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
|
|
68707
68923
|
packageName: input.distributionManifest.name,
|
|
68708
68924
|
version: input.distributionManifest.version
|
|
68709
68925
|
}, null, "\t")}
|
|
@@ -68760,16 +68976,16 @@ async function stampHookStatusMessages(path7, version) {
|
|
|
68760
68976
|
async function stampComponentVersions(input) {
|
|
68761
68977
|
let entries;
|
|
68762
68978
|
try {
|
|
68763
|
-
entries = await readdir5(
|
|
68979
|
+
entries = await readdir5(join43(input.pluginRoot, "components"));
|
|
68764
68980
|
} catch (error) {
|
|
68765
68981
|
if (error instanceof Error)
|
|
68766
68982
|
return;
|
|
68767
68983
|
throw error;
|
|
68768
68984
|
}
|
|
68769
68985
|
for (const entry of entries) {
|
|
68770
|
-
const componentRoot =
|
|
68771
|
-
await stampJsonVersion(
|
|
68772
|
-
await stampHookStatusMessages(
|
|
68986
|
+
const componentRoot = join43(input.pluginRoot, "components", entry);
|
|
68987
|
+
await stampJsonVersion(join43(componentRoot, "package.json"), input.version);
|
|
68988
|
+
await stampHookStatusMessages(join43(componentRoot, "hooks", "hooks.json"), input.version);
|
|
68773
68989
|
}
|
|
68774
68990
|
}
|
|
68775
68991
|
function stampHookGroups(hooks, version) {
|
|
@@ -68823,7 +69039,7 @@ var defaultRunCommand = async (command, args, options) => {
|
|
|
68823
69039
|
|
|
68824
69040
|
// packages/omo-codex/src/install/codex-project-local-cleanup.ts
|
|
68825
69041
|
import { copyFile as copyFile2, lstat as lstat8, readFile as readFile16, writeFile as writeFile9 } from "node:fs/promises";
|
|
68826
|
-
import { dirname as
|
|
69042
|
+
import { dirname as dirname15, join as join44, resolve as resolve12 } from "node:path";
|
|
68827
69043
|
var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
|
|
68828
69044
|
var PROJECT_LOCAL_ARTIFACT_PATHS = [
|
|
68829
69045
|
".codex/hooks.json",
|
|
@@ -68926,37 +69142,37 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
68926
69142
|
if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
|
|
68927
69143
|
throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
|
|
68928
69144
|
}
|
|
68929
|
-
const codexHomeConfigPath = codexHome === undefined ? null :
|
|
69145
|
+
const codexHomeConfigPath = codexHome === undefined ? null : join44(resolve12(codexHome), "config.toml");
|
|
68930
69146
|
let current = resolve12(startDirectory);
|
|
68931
69147
|
const configPathsFromCwd = [];
|
|
68932
69148
|
while (true) {
|
|
68933
|
-
const configPath =
|
|
69149
|
+
const configPath = join44(current, ".codex", "config.toml");
|
|
68934
69150
|
if (await isRegularProjectLocalConfig(current, configPath)) {
|
|
68935
69151
|
if (codexHomeConfigPath === null || resolve12(configPath) !== codexHomeConfigPath) {
|
|
68936
69152
|
configPathsFromCwd.push(configPath);
|
|
68937
69153
|
}
|
|
68938
69154
|
}
|
|
68939
|
-
if (await exists5(
|
|
69155
|
+
if (await exists5(join44(current, ".git"))) {
|
|
68940
69156
|
return configPathsFromCwd.length === 0 ? null : {
|
|
68941
69157
|
projectRoot: current,
|
|
68942
69158
|
configPaths: [...configPathsFromCwd].reverse(),
|
|
68943
69159
|
artifactRoots: artifactRootsForConfigPaths(configPathsFromCwd)
|
|
68944
69160
|
};
|
|
68945
69161
|
}
|
|
68946
|
-
const parent =
|
|
69162
|
+
const parent = dirname15(current);
|
|
68947
69163
|
if (parent === current) {
|
|
68948
69164
|
const nearestConfigPath = configPathsFromCwd[0];
|
|
68949
69165
|
return nearestConfigPath === undefined ? null : {
|
|
68950
|
-
projectRoot:
|
|
69166
|
+
projectRoot: dirname15(dirname15(nearestConfigPath)),
|
|
68951
69167
|
configPaths: [nearestConfigPath],
|
|
68952
|
-
artifactRoots: [
|
|
69168
|
+
artifactRoots: [dirname15(dirname15(nearestConfigPath))]
|
|
68953
69169
|
};
|
|
68954
69170
|
}
|
|
68955
69171
|
current = parent;
|
|
68956
69172
|
}
|
|
68957
69173
|
}
|
|
68958
69174
|
async function isRegularProjectLocalConfig(directory, configPath) {
|
|
68959
|
-
const codexDirStat = await maybeLstat(
|
|
69175
|
+
const codexDirStat = await maybeLstat(join44(directory, ".codex"));
|
|
68960
69176
|
if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
|
|
68961
69177
|
return false;
|
|
68962
69178
|
const configStat = await maybeLstat(configPath);
|
|
@@ -68965,7 +69181,7 @@ async function isRegularProjectLocalConfig(directory, configPath) {
|
|
|
68965
69181
|
function artifactRootsForConfigPaths(configPaths) {
|
|
68966
69182
|
const roots = [];
|
|
68967
69183
|
for (const configPath of configPaths) {
|
|
68968
|
-
const root =
|
|
69184
|
+
const root = dirname15(dirname15(configPath));
|
|
68969
69185
|
if (!roots.includes(root))
|
|
68970
69186
|
roots.push(root);
|
|
68971
69187
|
}
|
|
@@ -68976,7 +69192,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
|
|
|
68976
69192
|
const seenPaths = new Set;
|
|
68977
69193
|
for (const projectRoot of projectRoots) {
|
|
68978
69194
|
for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
|
|
68979
|
-
const artifactPath =
|
|
69195
|
+
const artifactPath = join44(projectRoot, relativePath);
|
|
68980
69196
|
if (seenPaths.has(artifactPath))
|
|
68981
69197
|
continue;
|
|
68982
69198
|
const entryStat = await maybeLstat(artifactPath);
|
|
@@ -69053,11 +69269,11 @@ function formatUnknownError(error) {
|
|
|
69053
69269
|
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
|
|
69054
69270
|
import { readFile as readFile17, readdir as readdir6, rm as rm8 } from "node:fs/promises";
|
|
69055
69271
|
import { connect } from "node:net";
|
|
69056
|
-
import { join as
|
|
69272
|
+
import { join as join45 } from "node:path";
|
|
69057
69273
|
async function reapLspDaemons(codexHome, deps = {}) {
|
|
69058
69274
|
const killProcess = deps.killProcess ?? sendSigterm;
|
|
69059
69275
|
const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
|
|
69060
|
-
const daemonRoot =
|
|
69276
|
+
const daemonRoot = join45(codexHome, "codex-lsp", "daemon");
|
|
69061
69277
|
const reaped = [];
|
|
69062
69278
|
let entries;
|
|
69063
69279
|
try {
|
|
@@ -69066,9 +69282,9 @@ async function reapLspDaemons(codexHome, deps = {}) {
|
|
|
69066
69282
|
return reaped;
|
|
69067
69283
|
}
|
|
69068
69284
|
for (const entry of entries) {
|
|
69069
|
-
const versionDir =
|
|
69070
|
-
const pid = await readPidFile(
|
|
69071
|
-
const socketPath = await readEndpointFile(
|
|
69285
|
+
const versionDir = join45(daemonRoot, entry);
|
|
69286
|
+
const pid = await readPidFile(join45(versionDir, "daemon.pid"));
|
|
69287
|
+
const socketPath = await readEndpointFile(join45(versionDir, "daemon.endpoint"));
|
|
69072
69288
|
if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
|
|
69073
69289
|
reaped.push(pid);
|
|
69074
69290
|
}
|
|
@@ -69122,7 +69338,7 @@ function sendSigterm(pid) {
|
|
|
69122
69338
|
|
|
69123
69339
|
// packages/omo-codex/src/install/codex-installer-bin-dir.ts
|
|
69124
69340
|
import { homedir as homedir5 } from "node:os";
|
|
69125
|
-
import { join as
|
|
69341
|
+
import { join as join46, resolve as resolve13 } from "node:path";
|
|
69126
69342
|
function resolveCodexInstallerBinDir(input) {
|
|
69127
69343
|
const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
|
|
69128
69344
|
if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
|
|
@@ -69131,15 +69347,15 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
69131
69347
|
const defaultCodexHome = resolve13(homeDir, ".codex");
|
|
69132
69348
|
const resolvedCodexHome = resolve13(input.codexHome);
|
|
69133
69349
|
if (resolvedCodexHome !== defaultCodexHome)
|
|
69134
|
-
return
|
|
69350
|
+
return join46(resolvedCodexHome, "bin");
|
|
69135
69351
|
return resolve13(homeDir, ".local", "bin");
|
|
69136
69352
|
}
|
|
69137
69353
|
|
|
69138
69354
|
// packages/omo-codex/src/install/omo-sot-migration.ts
|
|
69139
|
-
import { join as
|
|
69355
|
+
import { join as join47 } from "node:path";
|
|
69140
69356
|
async function seedAndMigrateOmoSot(input) {
|
|
69141
69357
|
const commandEnv = { ...input.env };
|
|
69142
|
-
const scriptPath =
|
|
69358
|
+
const scriptPath = join47(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
|
|
69143
69359
|
try {
|
|
69144
69360
|
await input.runCommand(process.execPath, [scriptPath, "--seed"], {
|
|
69145
69361
|
cwd: input.repoRoot,
|
|
@@ -69154,7 +69370,7 @@ async function seedAndMigrateOmoSot(input) {
|
|
|
69154
69370
|
|
|
69155
69371
|
// packages/omo-codex/src/install/install-ast-grep-sg.ts
|
|
69156
69372
|
init_src();
|
|
69157
|
-
import { join as
|
|
69373
|
+
import { join as join48 } from "node:path";
|
|
69158
69374
|
function describeResult(result) {
|
|
69159
69375
|
if (result.kind === "succeeded")
|
|
69160
69376
|
return null;
|
|
@@ -69168,7 +69384,7 @@ async function installAstGrepForCodex(options) {
|
|
|
69168
69384
|
return;
|
|
69169
69385
|
const platform = options.platform ?? process.platform;
|
|
69170
69386
|
const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
|
|
69171
|
-
const skillDir =
|
|
69387
|
+
const skillDir = join48(plugin.path, "skills", "ast-grep");
|
|
69172
69388
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
69173
69389
|
try {
|
|
69174
69390
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -69196,12 +69412,13 @@ async function trackCodexInstallTelemetry() {
|
|
|
69196
69412
|
}
|
|
69197
69413
|
|
|
69198
69414
|
// packages/omo-codex/src/install/install-codex.ts
|
|
69415
|
+
init_src();
|
|
69199
69416
|
var SISYPHUS_LEGACY_CACHE_MARKETPLACES = ["lazycodex", "code-yeongyu-codex-plugins"];
|
|
69200
69417
|
async function runCodexInstaller(options = {}) {
|
|
69201
69418
|
const env3 = options.env ?? process.env;
|
|
69202
69419
|
const platform = options.platform ?? process.platform;
|
|
69203
69420
|
const repoRoot = resolve14(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env3 }));
|
|
69204
|
-
const codexHome = resolve14(options.codexHome ?? env3.CODEX_HOME ??
|
|
69421
|
+
const codexHome = resolve14(options.codexHome ?? env3.CODEX_HOME ?? join51(homedir6(), ".codex"));
|
|
69205
69422
|
const projectDirectory = resolve14(options.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd());
|
|
69206
69423
|
const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env3 });
|
|
69207
69424
|
const runCommand = options.runCommand ?? defaultRunCommand;
|
|
@@ -69219,9 +69436,9 @@ async function runCodexInstaller(options = {}) {
|
|
|
69219
69436
|
if (!gitBashResolution.found) {
|
|
69220
69437
|
throw new Error(gitBashResolution.installHint);
|
|
69221
69438
|
}
|
|
69222
|
-
const codexPackageRoot =
|
|
69439
|
+
const codexPackageRoot = join51(repoRoot, "packages", "omo-codex");
|
|
69223
69440
|
const marketplace = await readMarketplace(repoRoot, {
|
|
69224
|
-
marketplacePath:
|
|
69441
|
+
marketplacePath: join51(codexPackageRoot, "marketplace.json")
|
|
69225
69442
|
});
|
|
69226
69443
|
const distributionManifest = await readDistributionManifest(repoRoot);
|
|
69227
69444
|
const installed = [];
|
|
@@ -69263,7 +69480,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
69263
69480
|
if (runtimeLink !== null)
|
|
69264
69481
|
log4(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
|
|
69265
69482
|
else
|
|
69266
|
-
log4(`Warning: skipped the omo runtime wrapper because ${
|
|
69483
|
+
log4(`Warning: skipped the omo runtime wrapper because ${join51(repoRoot, "dist", "cli", "index.js")} is missing; omo sparkshell/ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
|
|
69267
69484
|
}
|
|
69268
69485
|
pluginSources.push({ name: entry.name, sourcePath });
|
|
69269
69486
|
installed.push(plugin);
|
|
@@ -69316,13 +69533,13 @@ async function runCodexInstaller(options = {}) {
|
|
|
69316
69533
|
});
|
|
69317
69534
|
}
|
|
69318
69535
|
await reapLspDaemons(codexHome).catch(() => []);
|
|
69319
|
-
const marketplaceRoot =
|
|
69536
|
+
const marketplaceRoot = join51(codexHome, "plugins", "cache", marketplace.name);
|
|
69320
69537
|
await writeCachedMarketplaceManifest({
|
|
69321
69538
|
marketplaceName: marketplace.name,
|
|
69322
69539
|
marketplaceRoot,
|
|
69323
69540
|
plugins: installed
|
|
69324
69541
|
});
|
|
69325
|
-
const configPath =
|
|
69542
|
+
const configPath = join51(codexHome, "config.toml");
|
|
69326
69543
|
await updateCodexConfig({
|
|
69327
69544
|
configPath,
|
|
69328
69545
|
repoRoot: codexPackageRoot,
|
|
@@ -69330,6 +69547,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
69330
69547
|
marketplaceSource: codexMarketplaceSource(marketplaceRoot),
|
|
69331
69548
|
pluginNames: marketplace.plugins.map((plugin) => plugin.name),
|
|
69332
69549
|
platform,
|
|
69550
|
+
codegraphMcpEnabled: options.codegraphMcpEnabled ?? resolveCodegraphNodeSupport({ env: env3 }).supported,
|
|
69333
69551
|
gitBashEnabled: platform === "win32" && gitBashResolution.found,
|
|
69334
69552
|
trustedHookStates,
|
|
69335
69553
|
agentConfigs: [...agentConfigs.values()].sort((left, right) => left.name.localeCompare(right.name)),
|
|
@@ -69381,7 +69599,7 @@ function findRepoRootFromImporter(importerDir) {
|
|
|
69381
69599
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
69382
69600
|
if (isRepoRootWithCodexPlugin(current))
|
|
69383
69601
|
return current;
|
|
69384
|
-
for (const wrapperPackageRoot of [
|
|
69602
|
+
for (const wrapperPackageRoot of [join51(current, "node_modules", "oh-my-openagent"), join51(current, "oh-my-openagent")]) {
|
|
69385
69603
|
if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
|
|
69386
69604
|
return wrapperPackageRoot;
|
|
69387
69605
|
}
|
|
@@ -69399,7 +69617,7 @@ function findRepoRoot(input) {
|
|
|
69399
69617
|
return findRepoRootFromImporter(input.importerDir);
|
|
69400
69618
|
}
|
|
69401
69619
|
function isRepoRootWithCodexPlugin(repoRoot) {
|
|
69402
|
-
return
|
|
69620
|
+
return existsSync30(join51(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
|
|
69403
69621
|
}
|
|
69404
69622
|
function codexMarketplaceSource(marketplaceRoot) {
|
|
69405
69623
|
return { sourceType: "local", source: marketplaceRoot };
|
|
@@ -69407,7 +69625,7 @@ function codexMarketplaceSource(marketplaceRoot) {
|
|
|
69407
69625
|
// packages/omo-codex/src/install/codex-installation-detection.ts
|
|
69408
69626
|
init_bun_which_shim();
|
|
69409
69627
|
import { execFile as execFile2 } from "node:child_process";
|
|
69410
|
-
import { existsSync as
|
|
69628
|
+
import { existsSync as existsSync31 } from "node:fs";
|
|
69411
69629
|
import { homedir as homedir7 } from "node:os";
|
|
69412
69630
|
import { posix as posix3, win32 as win323 } from "node:path";
|
|
69413
69631
|
var CODEX_PATH_CHECK_LABEL = "codex (PATH)";
|
|
@@ -69420,7 +69638,7 @@ async function detectCodexInstallation(input = {}) {
|
|
|
69420
69638
|
const platform = input.platform ?? process.platform;
|
|
69421
69639
|
const env3 = input.env ?? process.env;
|
|
69422
69640
|
const homeDir = input.homeDir ?? homedir7();
|
|
69423
|
-
const exists6 = input.exists ??
|
|
69641
|
+
const exists6 = input.exists ?? existsSync31;
|
|
69424
69642
|
const which2 = input.which ?? bunWhich;
|
|
69425
69643
|
const checkedPaths = [CODEX_PATH_CHECK_LABEL];
|
|
69426
69644
|
const cliPath = nonEmptyValue2(which2("codex"));
|
|
@@ -69536,11 +69754,11 @@ function defaultRunCommand2(command, args) {
|
|
|
69536
69754
|
// packages/omo-codex/src/install/codex-cleanup.ts
|
|
69537
69755
|
import { lstat as lstat10, readFile as readFile19, readdir as readdir7, rm as rm9, rmdir } from "node:fs/promises";
|
|
69538
69756
|
import { homedir as homedir8 } from "node:os";
|
|
69539
|
-
import { isAbsolute as
|
|
69757
|
+
import { isAbsolute as isAbsolute9, join as join53, relative as relative7, resolve as resolve16 } from "node:path";
|
|
69540
69758
|
|
|
69541
69759
|
// packages/omo-codex/src/install/codex-cleanup-config.ts
|
|
69542
69760
|
import { lstat as lstat9, mkdir as mkdir8, readFile as readFile18, writeFile as writeFile10 } from "node:fs/promises";
|
|
69543
|
-
import { dirname as
|
|
69761
|
+
import { dirname as dirname17 } from "node:path";
|
|
69544
69762
|
var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
|
|
69545
69763
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
|
|
69546
69764
|
var CURRENT_MANAGED_CODEX_AGENT_NAMES2 = [
|
|
@@ -69574,7 +69792,7 @@ async function cleanupCodexConfig(configPath, now) {
|
|
|
69574
69792
|
if (next === original)
|
|
69575
69793
|
return { changed: false };
|
|
69576
69794
|
const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
|
|
69577
|
-
await mkdir8(
|
|
69795
|
+
await mkdir8(dirname17(configPath), { recursive: true });
|
|
69578
69796
|
await writeFile10(backupPath, original);
|
|
69579
69797
|
await writeFile10(configPath, `${next.trimEnd()}
|
|
69580
69798
|
`);
|
|
@@ -69585,21 +69803,18 @@ function removeManagedAgentBlocks(config) {
|
|
|
69585
69803
|
return splitTomlSections2(config).filter((section) => {
|
|
69586
69804
|
if (section.header === null)
|
|
69587
69805
|
return true;
|
|
69588
|
-
const agentName =
|
|
69806
|
+
const agentName = parseAgentHeaderName(section.header);
|
|
69589
69807
|
if (agentName === null || !managedAgentNames.has(agentName))
|
|
69590
69808
|
return true;
|
|
69591
69809
|
return !section.text.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`);
|
|
69592
69810
|
}).map((section) => section.text).join("");
|
|
69593
69811
|
}
|
|
69594
69812
|
function isManagedPluginHeader(header, marketplace) {
|
|
69595
|
-
const pluginKey =
|
|
69813
|
+
const pluginKey = parsePluginHeaderKey(header);
|
|
69596
69814
|
return pluginKey !== null && pluginKey.endsWith(`@${marketplace}`);
|
|
69597
69815
|
}
|
|
69598
69816
|
function isManagedHookStateHeader(header, marketplace) {
|
|
69599
|
-
const
|
|
69600
|
-
if (!header.startsWith(prefix))
|
|
69601
|
-
return false;
|
|
69602
|
-
const hookKey = parseJsonString3(header.slice(prefix.length));
|
|
69817
|
+
const hookKey = parseHookStateHeaderKey(header);
|
|
69603
69818
|
if (hookKey === null)
|
|
69604
69819
|
return false;
|
|
69605
69820
|
const separator = hookKey.indexOf(":");
|
|
@@ -69636,48 +69851,6 @@ function parseTomlHeader2(line) {
|
|
|
69636
69851
|
return null;
|
|
69637
69852
|
return trimmed.slice(1, -1);
|
|
69638
69853
|
}
|
|
69639
|
-
function parsePluginHeaderKey2(header) {
|
|
69640
|
-
const prefix = "plugins.";
|
|
69641
|
-
if (!header.startsWith(prefix))
|
|
69642
|
-
return null;
|
|
69643
|
-
return parseLeadingJsonString2(header.slice(prefix.length));
|
|
69644
|
-
}
|
|
69645
|
-
function parseAgentHeaderName2(header) {
|
|
69646
|
-
const prefix = "agents.";
|
|
69647
|
-
if (!header.startsWith(prefix))
|
|
69648
|
-
return null;
|
|
69649
|
-
const key = header.slice(prefix.length);
|
|
69650
|
-
return key.startsWith('"') ? parseLeadingJsonString2(key) : key;
|
|
69651
|
-
}
|
|
69652
|
-
function parseLeadingJsonString2(value) {
|
|
69653
|
-
if (!value.startsWith('"'))
|
|
69654
|
-
return parseJsonString3(value);
|
|
69655
|
-
let escaped = false;
|
|
69656
|
-
for (let index = 1;index < value.length; index += 1) {
|
|
69657
|
-
const char = value[index];
|
|
69658
|
-
if (escaped) {
|
|
69659
|
-
escaped = false;
|
|
69660
|
-
continue;
|
|
69661
|
-
}
|
|
69662
|
-
if (char === "\\") {
|
|
69663
|
-
escaped = true;
|
|
69664
|
-
continue;
|
|
69665
|
-
}
|
|
69666
|
-
if (char === '"')
|
|
69667
|
-
return parseJsonString3(value.slice(0, index + 1));
|
|
69668
|
-
}
|
|
69669
|
-
return null;
|
|
69670
|
-
}
|
|
69671
|
-
function parseJsonString3(value) {
|
|
69672
|
-
try {
|
|
69673
|
-
const parsed = JSON.parse(value);
|
|
69674
|
-
return typeof parsed === "string" ? parsed : null;
|
|
69675
|
-
} catch (error) {
|
|
69676
|
-
if (error instanceof Error)
|
|
69677
|
-
return null;
|
|
69678
|
-
return null;
|
|
69679
|
-
}
|
|
69680
|
-
}
|
|
69681
69854
|
function formatBackupTimestamp2(date) {
|
|
69682
69855
|
return date.toISOString().replace(/[:.]/g, "-");
|
|
69683
69856
|
}
|
|
@@ -69697,23 +69870,69 @@ function nodeErrorCode4(error) {
|
|
|
69697
69870
|
return typeof error.code === "string" ? error.code : null;
|
|
69698
69871
|
}
|
|
69699
69872
|
|
|
69873
|
+
// packages/omo-codex/src/install/codex-cleanup-safety.ts
|
|
69874
|
+
import { dirname as dirname18, isAbsolute as isAbsolute8, join as join52, relative as relative6, resolve as resolve15 } from "node:path";
|
|
69875
|
+
function validateManagedCleanupTarget(input) {
|
|
69876
|
+
if (!isAbsolute8(input.path))
|
|
69877
|
+
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
69878
|
+
const codexHome = resolve15(input.codexHome);
|
|
69879
|
+
if (dirname18(codexHome) === codexHome)
|
|
69880
|
+
return skipped(input.path, "Codex home resolves to a filesystem root");
|
|
69881
|
+
const target = resolve15(input.path);
|
|
69882
|
+
if (!isWithinDirectory(codexHome, target))
|
|
69883
|
+
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
69884
|
+
if (target === codexHome)
|
|
69885
|
+
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
69886
|
+
const exactManagedRoots = new Set([
|
|
69887
|
+
resolve15(join52(codexHome, "plugins", "cache", "sisyphuslabs")),
|
|
69888
|
+
resolve15(join52(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
|
|
69889
|
+
resolve15(join52(codexHome, "runtime", "ast-grep")),
|
|
69890
|
+
resolve15(join52(codexHome, "runtime", "node")),
|
|
69891
|
+
resolve15(join52(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
|
|
69892
|
+
]);
|
|
69893
|
+
if (exactManagedRoots.has(target))
|
|
69894
|
+
return null;
|
|
69895
|
+
if (isManagedBootstrapDriftPath(codexHome, target))
|
|
69896
|
+
return null;
|
|
69897
|
+
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
69898
|
+
}
|
|
69899
|
+
function isWithinDirectory(parent, child) {
|
|
69900
|
+
const relativePath = relative6(parent, child);
|
|
69901
|
+
return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute8(relativePath);
|
|
69902
|
+
}
|
|
69903
|
+
function isManagedBootstrapDriftPath(codexHome, target) {
|
|
69904
|
+
const relativePath = relative6(codexHome, target);
|
|
69905
|
+
const segments = relativePath.split(/[\\/]/);
|
|
69906
|
+
if (segments[0] !== "plugins")
|
|
69907
|
+
return false;
|
|
69908
|
+
if (segments[segments.length - 1] !== "bootstrap")
|
|
69909
|
+
return false;
|
|
69910
|
+
const ownerName = segments[segments.length - 2];
|
|
69911
|
+
return ownerName !== undefined && ownerName.startsWith("omo") && ownerName.slice("omo".length).includes("sisyphuslabs");
|
|
69912
|
+
}
|
|
69913
|
+
function skipped(path7, reason) {
|
|
69914
|
+
return { path: path7, reason };
|
|
69915
|
+
}
|
|
69916
|
+
|
|
69700
69917
|
// packages/omo-codex/src/install/codex-cleanup.ts
|
|
69701
69918
|
var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
|
|
69702
69919
|
async function cleanupCodexLight(input = {}) {
|
|
69703
69920
|
const env3 = input.env ?? process.env;
|
|
69704
|
-
const codexHome =
|
|
69705
|
-
const configPath =
|
|
69921
|
+
const codexHome = resolve16(input.codexHome ?? env3.CODEX_HOME ?? join53(homedir8(), ".codex"));
|
|
69922
|
+
const configPath = join53(codexHome, "config.toml");
|
|
69706
69923
|
const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
|
|
69707
69924
|
const configCleanup = await cleanupCodexConfig(configPath, input.now);
|
|
69708
69925
|
const agentCleanup = await removeManifestListedAgentLinks(codexHome, agentPaths);
|
|
69709
69926
|
const removedPaths = [];
|
|
69927
|
+
const skippedPaths = [];
|
|
69710
69928
|
const managedStatePaths = new Set([
|
|
69711
69929
|
...managedGlobalStatePaths(codexHome),
|
|
69712
69930
|
...await collectBootstrapDataDirsByGlob(codexHome)
|
|
69713
69931
|
]);
|
|
69714
69932
|
for (const path7 of managedStatePaths) {
|
|
69715
|
-
if (await removeManagedPathBestEffort(path7))
|
|
69933
|
+
if (await removeManagedPathBestEffort(path7, { codexHome, onSkip: (skip) => skippedPaths.push(skip) })) {
|
|
69716
69934
|
removedPaths.push(path7);
|
|
69935
|
+
}
|
|
69717
69936
|
}
|
|
69718
69937
|
await pruneEmptyRuntimeDirBestEffort(codexHome);
|
|
69719
69938
|
const projectDirectory = input.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd();
|
|
@@ -69731,6 +69950,7 @@ async function cleanupCodexLight(input = {}) {
|
|
|
69731
69950
|
configChanged: configCleanup.changed,
|
|
69732
69951
|
configBackupPath: configCleanup.backupPath,
|
|
69733
69952
|
removedPaths,
|
|
69953
|
+
skippedPaths,
|
|
69734
69954
|
removedAgentLinks: agentCleanup.removed,
|
|
69735
69955
|
skippedAgentLinks: agentCleanup.skipped,
|
|
69736
69956
|
projectCleanup
|
|
@@ -69738,17 +69958,17 @@ async function cleanupCodexLight(input = {}) {
|
|
|
69738
69958
|
}
|
|
69739
69959
|
function managedGlobalStatePaths(codexHome) {
|
|
69740
69960
|
return [
|
|
69741
|
-
|
|
69742
|
-
|
|
69743
|
-
|
|
69744
|
-
|
|
69745
|
-
|
|
69961
|
+
join53(codexHome, "plugins", "cache", "sisyphuslabs"),
|
|
69962
|
+
join53(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
|
|
69963
|
+
join53(codexHome, "runtime", "ast-grep"),
|
|
69964
|
+
join53(codexHome, "runtime", "node"),
|
|
69965
|
+
join53(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
|
|
69746
69966
|
];
|
|
69747
69967
|
}
|
|
69748
69968
|
var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
|
|
69749
69969
|
async function collectBootstrapDataDirsByGlob(codexHome) {
|
|
69750
69970
|
const results = [];
|
|
69751
|
-
await walkForManagedBootstrapDirs(
|
|
69971
|
+
await walkForManagedBootstrapDirs(join53(codexHome, "plugins"), 0, results);
|
|
69752
69972
|
return results;
|
|
69753
69973
|
}
|
|
69754
69974
|
async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
@@ -69760,9 +69980,9 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
|
69760
69980
|
for (const entry of entries) {
|
|
69761
69981
|
if (!entry.isDirectory())
|
|
69762
69982
|
continue;
|
|
69763
|
-
const childPath =
|
|
69983
|
+
const childPath = join53(directory, entry.name);
|
|
69764
69984
|
if (isManagedBootstrapOwnerName(entry.name)) {
|
|
69765
|
-
const bootstrapDir =
|
|
69985
|
+
const bootstrapDir = join53(childPath, "bootstrap");
|
|
69766
69986
|
if (await exists6(bootstrapDir))
|
|
69767
69987
|
results.push(bootstrapDir);
|
|
69768
69988
|
continue;
|
|
@@ -69773,7 +69993,12 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
|
69773
69993
|
function isManagedBootstrapOwnerName(name) {
|
|
69774
69994
|
return name.startsWith("omo") && name.slice("omo".length).includes("sisyphuslabs");
|
|
69775
69995
|
}
|
|
69776
|
-
async function removeManagedPathBestEffort(path7, seams
|
|
69996
|
+
async function removeManagedPathBestEffort(path7, seams) {
|
|
69997
|
+
const skip = validateManagedCleanupTarget({ codexHome: seams.codexHome, path: path7 });
|
|
69998
|
+
if (skip !== null) {
|
|
69999
|
+
seams.onSkip?.(skip);
|
|
70000
|
+
return false;
|
|
70001
|
+
}
|
|
69777
70002
|
const removedOnFirstAttempt = await attemptRemove(path7);
|
|
69778
70003
|
await seams.afterFirstAttempt?.();
|
|
69779
70004
|
const removedOnRetry = await attemptRemove(path7);
|
|
@@ -69791,19 +70016,26 @@ async function attemptRemove(path7) {
|
|
|
69791
70016
|
}
|
|
69792
70017
|
async function pruneEmptyRuntimeDirBestEffort(codexHome) {
|
|
69793
70018
|
try {
|
|
69794
|
-
await rmdir(
|
|
69795
|
-
} catch {
|
|
70019
|
+
await rmdir(join53(codexHome, "runtime"));
|
|
70020
|
+
} catch (error) {
|
|
70021
|
+
if (isExpectedRuntimePruneFailure(error))
|
|
70022
|
+
return;
|
|
70023
|
+
throw error;
|
|
70024
|
+
}
|
|
70025
|
+
}
|
|
70026
|
+
function isExpectedRuntimePruneFailure(error) {
|
|
70027
|
+
return ["ENOENT", "ENOTEMPTY", "EEXIST", "EPERM", "EBUSY", "ENOTDIR"].includes(nodeErrorCode5(error) ?? "");
|
|
69796
70028
|
}
|
|
69797
70029
|
async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
69798
70030
|
const manifestPaths = [
|
|
69799
|
-
|
|
70031
|
+
join53(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
|
|
69800
70032
|
];
|
|
69801
|
-
const versionRoot =
|
|
70033
|
+
const versionRoot = join53(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
|
|
69802
70034
|
if (await exists6(versionRoot)) {
|
|
69803
70035
|
const entries = await readdir7(versionRoot, { withFileTypes: true });
|
|
69804
70036
|
for (const entry of entries) {
|
|
69805
70037
|
if (entry.isDirectory())
|
|
69806
|
-
manifestPaths.push(
|
|
70038
|
+
manifestPaths.push(join53(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
|
|
69807
70039
|
}
|
|
69808
70040
|
}
|
|
69809
70041
|
const paths = new Set;
|
|
@@ -69821,7 +70053,7 @@ async function readManagedAgentPathsFromConfig(codexHome, configPath) {
|
|
|
69821
70053
|
if (!await exists6(configPath))
|
|
69822
70054
|
return [];
|
|
69823
70055
|
const config = await readFile19(configPath, "utf8");
|
|
69824
|
-
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) =>
|
|
70056
|
+
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join53(codexHome, "agents", `${agentName}.toml`));
|
|
69825
70057
|
}
|
|
69826
70058
|
async function readInstalledAgentManifest(manifestPath) {
|
|
69827
70059
|
if (!await exists6(manifestPath))
|
|
@@ -69832,31 +70064,31 @@ async function readInstalledAgentManifest(manifestPath) {
|
|
|
69832
70064
|
return parsed.agents.filter((path7) => typeof path7 === "string");
|
|
69833
70065
|
}
|
|
69834
70066
|
async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
69835
|
-
const agentsDir =
|
|
70067
|
+
const agentsDir = join53(codexHome, "agents");
|
|
69836
70068
|
const removed = [];
|
|
69837
|
-
const
|
|
70069
|
+
const skipped2 = [];
|
|
69838
70070
|
for (const path7 of paths) {
|
|
69839
70071
|
if (!isSafeManagedAgentPath(agentsDir, path7)) {
|
|
69840
|
-
|
|
70072
|
+
skipped2.push(path7);
|
|
69841
70073
|
continue;
|
|
69842
70074
|
}
|
|
69843
70075
|
const entryStat = await maybeLstat2(path7);
|
|
69844
70076
|
if (entryStat === null)
|
|
69845
70077
|
continue;
|
|
69846
70078
|
if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
|
|
69847
|
-
|
|
70079
|
+
skipped2.push(path7);
|
|
69848
70080
|
continue;
|
|
69849
70081
|
}
|
|
69850
70082
|
await rm9(path7, { force: true });
|
|
69851
70083
|
removed.push(path7);
|
|
69852
70084
|
}
|
|
69853
|
-
return { removed, skipped };
|
|
70085
|
+
return { removed, skipped: skipped2 };
|
|
69854
70086
|
}
|
|
69855
70087
|
function isSafeManagedAgentPath(agentsDir, path7) {
|
|
69856
|
-
if (!
|
|
70088
|
+
if (!isAbsolute9(path7))
|
|
69857
70089
|
return false;
|
|
69858
|
-
const relativePath =
|
|
69859
|
-
if (relativePath === "" || relativePath.startsWith("..") ||
|
|
70090
|
+
const relativePath = relative7(agentsDir, path7);
|
|
70091
|
+
if (relativePath === "" || relativePath.startsWith("..") || isAbsolute9(relativePath))
|
|
69860
70092
|
return false;
|
|
69861
70093
|
const fileName = relativePath.split(/[\\/]/).pop();
|
|
69862
70094
|
if (fileName === undefined)
|
|
@@ -69915,23 +70147,23 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
|
|
|
69915
70147
|
init_provider_availability();
|
|
69916
70148
|
|
|
69917
70149
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
69918
|
-
import { existsSync as
|
|
69919
|
-
import { join as
|
|
70150
|
+
import { existsSync as existsSync33, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "node:fs";
|
|
70151
|
+
import { join as join55 } from "node:path";
|
|
69920
70152
|
|
|
69921
70153
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
69922
70154
|
init_shared();
|
|
69923
|
-
import { existsSync as
|
|
69924
|
-
import { join as
|
|
70155
|
+
import { existsSync as existsSync32, readFileSync as readFileSync15 } from "node:fs";
|
|
70156
|
+
import { join as join54 } from "node:path";
|
|
69925
70157
|
var TUI_SUBPATH = "tui";
|
|
69926
70158
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
69927
70159
|
function fileEntryPackageJsonPath(entry) {
|
|
69928
70160
|
let path7 = entry.slice("file:".length);
|
|
69929
70161
|
if (path7.startsWith("//"))
|
|
69930
70162
|
path7 = path7.slice(2);
|
|
69931
|
-
return
|
|
70163
|
+
return join54(path7, "package.json");
|
|
69932
70164
|
}
|
|
69933
70165
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
69934
|
-
if (!
|
|
70166
|
+
if (!existsSync32(pkgJsonPath))
|
|
69935
70167
|
return null;
|
|
69936
70168
|
try {
|
|
69937
70169
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
@@ -69966,14 +70198,14 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
69966
70198
|
const packageName = packageNameFromServerEntry(entry);
|
|
69967
70199
|
if (packageName === null)
|
|
69968
70200
|
return null;
|
|
69969
|
-
return packageJsonExportsTui(
|
|
70201
|
+
return packageJsonExportsTui(join54(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
69970
70202
|
}
|
|
69971
70203
|
function isOurFilePluginEntry(entry) {
|
|
69972
70204
|
if (!entry.startsWith("file:"))
|
|
69973
70205
|
return false;
|
|
69974
70206
|
try {
|
|
69975
70207
|
const pkgJsonPath = fileEntryPackageJsonPath(entry);
|
|
69976
|
-
if (!
|
|
70208
|
+
if (!existsSync32(pkgJsonPath))
|
|
69977
70209
|
return false;
|
|
69978
70210
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
69979
70211
|
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
|
|
@@ -70016,7 +70248,7 @@ function isCanonicalNamedTuiPluginEntry(entry) {
|
|
|
70016
70248
|
}
|
|
70017
70249
|
function detectServerPluginRegistration() {
|
|
70018
70250
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
70019
|
-
const configPath =
|
|
70251
|
+
const configPath = existsSync32(paths.configJsonc) ? paths.configJsonc : existsSync32(paths.configJson) ? paths.configJson : null;
|
|
70020
70252
|
if (!configPath) {
|
|
70021
70253
|
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
|
|
70022
70254
|
}
|
|
@@ -70039,8 +70271,8 @@ function detectServerPluginRegistration() {
|
|
|
70039
70271
|
}
|
|
70040
70272
|
}
|
|
70041
70273
|
function detectTuiPluginRegistration() {
|
|
70042
|
-
const tuiJsonPath =
|
|
70043
|
-
if (!
|
|
70274
|
+
const tuiJsonPath = join54(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
70275
|
+
if (!existsSync32(tuiJsonPath)) {
|
|
70044
70276
|
return {
|
|
70045
70277
|
registered: false,
|
|
70046
70278
|
configPath: tuiJsonPath,
|
|
@@ -70195,11 +70427,11 @@ function readConfig(path7) {
|
|
|
70195
70427
|
return null;
|
|
70196
70428
|
}
|
|
70197
70429
|
function readServerConfig(configDir) {
|
|
70198
|
-
const jsoncPath =
|
|
70199
|
-
if (
|
|
70430
|
+
const jsoncPath = join55(configDir, "opencode.jsonc");
|
|
70431
|
+
if (existsSync33(jsoncPath))
|
|
70200
70432
|
return readConfig(jsoncPath);
|
|
70201
|
-
const jsonPath =
|
|
70202
|
-
if (
|
|
70433
|
+
const jsonPath = join55(configDir, "opencode.json");
|
|
70434
|
+
if (existsSync33(jsonPath))
|
|
70203
70435
|
return readConfig(jsonPath);
|
|
70204
70436
|
return null;
|
|
70205
70437
|
}
|
|
@@ -70219,7 +70451,7 @@ function desiredTuiEntry(serverEntry) {
|
|
|
70219
70451
|
return null;
|
|
70220
70452
|
}
|
|
70221
70453
|
function readTuiConfig(tuiJsonPath) {
|
|
70222
|
-
if (!
|
|
70454
|
+
if (!existsSync33(tuiJsonPath)) {
|
|
70223
70455
|
return { config: {}, malformed: false };
|
|
70224
70456
|
}
|
|
70225
70457
|
const config = readConfig(tuiJsonPath);
|
|
@@ -70240,7 +70472,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
70240
70472
|
if (!desiredEntry) {
|
|
70241
70473
|
return { changed: false, reason: "no-server-entry" };
|
|
70242
70474
|
}
|
|
70243
|
-
const tuiJsonPath =
|
|
70475
|
+
const tuiJsonPath = join55(configDir, "tui.json");
|
|
70244
70476
|
const { config, malformed } = readTuiConfig(tuiJsonPath);
|
|
70245
70477
|
if (malformed) {
|
|
70246
70478
|
return { changed: false, reason: "malformed" };
|
|
@@ -70256,7 +70488,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
70256
70488
|
|
|
70257
70489
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
70258
70490
|
import { homedir as homedir9 } from "node:os";
|
|
70259
|
-
import { join as
|
|
70491
|
+
import { join as join56 } from "node:path";
|
|
70260
70492
|
|
|
70261
70493
|
// packages/shared-skills/index.mjs
|
|
70262
70494
|
import { fileURLToPath } from "node:url";
|
|
@@ -70275,9 +70507,9 @@ function describeResult2(result) {
|
|
|
70275
70507
|
}
|
|
70276
70508
|
async function installAstGrepForOpenCode(options = {}) {
|
|
70277
70509
|
const platform = options.platform ?? process.platform;
|
|
70278
|
-
const baseDir =
|
|
70510
|
+
const baseDir = join56(options.homeDir ?? homedir9(), ".omo");
|
|
70279
70511
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
70280
|
-
const skillDir =
|
|
70512
|
+
const skillDir = join56(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
70281
70513
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
70282
70514
|
try {
|
|
70283
70515
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -72156,6 +72388,9 @@ async function cleanup(options) {
|
|
|
72156
72388
|
for (const path7 of result.removedPaths) {
|
|
72157
72389
|
console.log(`- Removed ${path7}`);
|
|
72158
72390
|
}
|
|
72391
|
+
for (const skippedPath of result.skippedPaths) {
|
|
72392
|
+
console.log(`- Skipped cleanup target ${skippedPath.path}: ${skippedPath.reason}`);
|
|
72393
|
+
}
|
|
72159
72394
|
for (const path7 of result.removedAgentLinks) {
|
|
72160
72395
|
console.log(`- Removed managed agent link ${path7}`);
|
|
72161
72396
|
}
|
|
@@ -87419,6 +87654,7 @@ var ClaudeCodeConfigSchema = exports_external.object({
|
|
|
87419
87654
|
});
|
|
87420
87655
|
// packages/omo-opencode/src/config/schema/codegraph.ts
|
|
87421
87656
|
var CodegraphConfigSchema = exports_external.object({
|
|
87657
|
+
auto_init: exports_external.boolean().default(true),
|
|
87422
87658
|
auto_provision: exports_external.boolean().default(true),
|
|
87423
87659
|
enabled: exports_external.boolean().default(true),
|
|
87424
87660
|
install_dir: exports_external.string().optional(),
|
|
@@ -87658,7 +87894,8 @@ var RuntimeFallbackConfigSchema = exports_external.object({
|
|
|
87658
87894
|
max_fallback_attempts: exports_external.number().min(1).max(20).optional(),
|
|
87659
87895
|
cooldown_seconds: exports_external.number().min(0).optional(),
|
|
87660
87896
|
timeout_seconds: exports_external.number().min(0).optional(),
|
|
87661
|
-
notify_on_fallback: exports_external.boolean().optional()
|
|
87897
|
+
notify_on_fallback: exports_external.boolean().optional(),
|
|
87898
|
+
restore_primary_after_cooldown: exports_external.boolean().optional()
|
|
87662
87899
|
});
|
|
87663
87900
|
|
|
87664
87901
|
// packages/team-core/src/config.ts
|
|
@@ -88220,7 +88457,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
88220
88457
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
88221
88458
|
init_bun_which_shim();
|
|
88222
88459
|
init_spawn_with_windows_hide();
|
|
88223
|
-
import { delimiter as delimiter2, dirname as
|
|
88460
|
+
import { delimiter as delimiter2, dirname as dirname20, posix as posix4, win32 as win324 } from "node:path";
|
|
88224
88461
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
88225
88462
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
88226
88463
|
function getCommandCandidates(platform) {
|
|
@@ -88278,7 +88515,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
88278
88515
|
return null;
|
|
88279
88516
|
}
|
|
88280
88517
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
88281
|
-
const preferredDir =
|
|
88518
|
+
const preferredDir = dirname20(binaryPath);
|
|
88282
88519
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
88283
88520
|
return [preferredDir, ...existing].join(delimiter2);
|
|
88284
88521
|
}
|
|
@@ -88446,7 +88683,7 @@ async function resolveSession(options) {
|
|
|
88446
88683
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
88447
88684
|
const delay2 = SESSION_CREATE_RETRY_DELAY_MS * attempt;
|
|
88448
88685
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
88449
|
-
await new Promise((
|
|
88686
|
+
await new Promise((resolve17) => setTimeout(resolve17, delay2));
|
|
88450
88687
|
}
|
|
88451
88688
|
continue;
|
|
88452
88689
|
}
|
|
@@ -88457,7 +88694,7 @@ async function resolveSession(options) {
|
|
|
88457
88694
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
88458
88695
|
const delay2 = SESSION_CREATE_RETRY_DELAY_MS * attempt;
|
|
88459
88696
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
88460
|
-
await new Promise((
|
|
88697
|
+
await new Promise((resolve17) => setTimeout(resolve17, delay2));
|
|
88461
88698
|
}
|
|
88462
88699
|
}
|
|
88463
88700
|
throw new Error("Failed to create session after all retries");
|
|
@@ -88670,7 +88907,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
88670
88907
|
var NOTEPAD_DIR = "notepads";
|
|
88671
88908
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
88672
88909
|
// packages/boulder-state/src/top-level-task.ts
|
|
88673
|
-
import { existsSync as
|
|
88910
|
+
import { existsSync as existsSync36, readFileSync as readFileSync18 } from "node:fs";
|
|
88674
88911
|
var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
|
|
88675
88912
|
var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
|
|
88676
88913
|
var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
|
|
@@ -88693,7 +88930,7 @@ function buildTaskRef(section, taskLabel) {
|
|
|
88693
88930
|
};
|
|
88694
88931
|
}
|
|
88695
88932
|
function readCurrentTopLevelTask(planPath) {
|
|
88696
|
-
if (!
|
|
88933
|
+
if (!existsSync36(planPath)) {
|
|
88697
88934
|
return null;
|
|
88698
88935
|
}
|
|
88699
88936
|
try {
|
|
@@ -88722,13 +88959,13 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
88722
88959
|
}
|
|
88723
88960
|
}
|
|
88724
88961
|
// packages/boulder-state/src/storage/path.ts
|
|
88725
|
-
import { existsSync as
|
|
88726
|
-
import { isAbsolute as
|
|
88962
|
+
import { existsSync as existsSync37 } from "node:fs";
|
|
88963
|
+
import { isAbsolute as isAbsolute10, join as join58, relative as relative8, resolve as resolve17 } from "node:path";
|
|
88727
88964
|
function getBoulderFilePath(directory) {
|
|
88728
|
-
return
|
|
88965
|
+
return join58(directory, BOULDER_DIR, BOULDER_FILE);
|
|
88729
88966
|
}
|
|
88730
88967
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
88731
|
-
return
|
|
88968
|
+
return isAbsolute10(trackedPath) ? resolve17(trackedPath) : resolve17(baseDirectory, trackedPath);
|
|
88732
88969
|
}
|
|
88733
88970
|
function resolveBoulderPlanPath(directory, state) {
|
|
88734
88971
|
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
|
|
@@ -88736,20 +88973,20 @@ function resolveBoulderPlanPath(directory, state) {
|
|
|
88736
88973
|
if (!worktreePath) {
|
|
88737
88974
|
return absolutePlanPath;
|
|
88738
88975
|
}
|
|
88739
|
-
const absoluteDirectory =
|
|
88740
|
-
const relativePlanPath =
|
|
88741
|
-
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") ||
|
|
88976
|
+
const absoluteDirectory = resolve17(directory);
|
|
88977
|
+
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
|
|
88978
|
+
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute10(relativePlanPath)) {
|
|
88742
88979
|
return absolutePlanPath;
|
|
88743
88980
|
}
|
|
88744
88981
|
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
|
|
88745
|
-
const worktreePlanPath =
|
|
88746
|
-
return
|
|
88982
|
+
const worktreePlanPath = resolve17(absoluteWorktreePath, relativePlanPath);
|
|
88983
|
+
return existsSync37(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
|
|
88747
88984
|
}
|
|
88748
88985
|
function resolveBoulderPlanPathForWork(directory, work) {
|
|
88749
88986
|
return resolveBoulderPlanPath(directory, work);
|
|
88750
88987
|
}
|
|
88751
88988
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
88752
|
-
import { existsSync as
|
|
88989
|
+
import { existsSync as existsSync38, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "node:fs";
|
|
88753
88990
|
var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
|
|
88754
88991
|
var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
|
|
88755
88992
|
var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
|
|
@@ -88758,7 +88995,7 @@ var CHECKED_CHECKBOX_PATTERN = /^(\s*)[-*]\s*\[[xX]\]\s*(.+)$/;
|
|
|
88758
88995
|
var TODO_TASK_PATTERN2 = /^\d+\.\s+/;
|
|
88759
88996
|
var FINAL_WAVE_TASK_PATTERN2 = /^F\d+\.\s+/i;
|
|
88760
88997
|
function getPlanProgress(planPath) {
|
|
88761
|
-
if (!
|
|
88998
|
+
if (!existsSync38(planPath)) {
|
|
88762
88999
|
return { total: 0, completed: 0, isComplete: false };
|
|
88763
89000
|
}
|
|
88764
89001
|
try {
|
|
@@ -88878,10 +89115,10 @@ function selectMirrorWork(state) {
|
|
|
88878
89115
|
return sorted[0] ?? null;
|
|
88879
89116
|
}
|
|
88880
89117
|
// packages/boulder-state/src/storage/read-state.ts
|
|
88881
|
-
import { existsSync as
|
|
89118
|
+
import { existsSync as existsSync39, readFileSync as readFileSync20 } from "node:fs";
|
|
88882
89119
|
function readBoulderState(directory) {
|
|
88883
89120
|
const filePath = getBoulderFilePath(directory);
|
|
88884
|
-
if (!
|
|
89121
|
+
if (!existsSync39(filePath)) {
|
|
88885
89122
|
return null;
|
|
88886
89123
|
}
|
|
88887
89124
|
try {
|
|
@@ -88953,14 +89190,14 @@ init_state();
|
|
|
88953
89190
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
88954
89191
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
88955
89192
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
88956
|
-
import { existsSync as
|
|
88957
|
-
import { join as
|
|
89193
|
+
import { existsSync as existsSync40, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
|
|
89194
|
+
import { join as join59 } from "node:path";
|
|
88958
89195
|
function getMarkerPath(directory, sessionID) {
|
|
88959
|
-
return
|
|
89196
|
+
return join59(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
88960
89197
|
}
|
|
88961
89198
|
function readContinuationMarker(directory, sessionID) {
|
|
88962
89199
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
88963
|
-
if (!
|
|
89200
|
+
if (!existsSync40(markerPath))
|
|
88964
89201
|
return null;
|
|
88965
89202
|
try {
|
|
88966
89203
|
const raw = readFileSync21(markerPath, "utf-8");
|
|
@@ -89029,7 +89266,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
89029
89266
|
init_shared();
|
|
89030
89267
|
init_compaction_marker();
|
|
89031
89268
|
import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "node:fs";
|
|
89032
|
-
import { join as
|
|
89269
|
+
import { join as join60 } from "node:path";
|
|
89033
89270
|
var defaultSessionLastAgentDeps = {
|
|
89034
89271
|
getMessageDir,
|
|
89035
89272
|
isSqliteBackend,
|
|
@@ -89089,7 +89326,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
89089
89326
|
try {
|
|
89090
89327
|
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
89091
89328
|
try {
|
|
89092
|
-
const content = readFileSync22(
|
|
89329
|
+
const content = readFileSync22(join60(messageDir, fileName), "utf-8");
|
|
89093
89330
|
const parsed = JSON.parse(content);
|
|
89094
89331
|
return {
|
|
89095
89332
|
fileName,
|
|
@@ -89132,8 +89369,8 @@ init_agent_display_names();
|
|
|
89132
89369
|
|
|
89133
89370
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
89134
89371
|
init_frontmatter2();
|
|
89135
|
-
import { existsSync as
|
|
89136
|
-
import { dirname as
|
|
89372
|
+
import { existsSync as existsSync41, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "node:fs";
|
|
89373
|
+
import { dirname as dirname21, join as join61 } from "node:path";
|
|
89137
89374
|
|
|
89138
89375
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
89139
89376
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -89142,11 +89379,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
89142
89379
|
|
|
89143
89380
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
89144
89381
|
function getStateFilePath(directory, customPath) {
|
|
89145
|
-
return customPath ?
|
|
89382
|
+
return customPath ? join61(directory, customPath) : join61(directory, DEFAULT_STATE_FILE);
|
|
89146
89383
|
}
|
|
89147
89384
|
function readState(directory, customPath) {
|
|
89148
89385
|
const filePath = getStateFilePath(directory, customPath);
|
|
89149
|
-
if (!
|
|
89386
|
+
if (!existsSync41(filePath)) {
|
|
89150
89387
|
return null;
|
|
89151
89388
|
}
|
|
89152
89389
|
try {
|
|
@@ -89381,7 +89618,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
|
|
|
89381
89618
|
let secondaryTimeoutChecked = false;
|
|
89382
89619
|
const pollStartTimestamp = Date.now();
|
|
89383
89620
|
while (!abortController.signal.aborted) {
|
|
89384
|
-
await new Promise((
|
|
89621
|
+
await new Promise((resolve18) => setTimeout(resolve18, pollIntervalMs));
|
|
89385
89622
|
if (abortController.signal.aborted) {
|
|
89386
89623
|
return 130;
|
|
89387
89624
|
}
|
|
@@ -89539,7 +89776,7 @@ function createAbortError() {
|
|
|
89539
89776
|
return error51;
|
|
89540
89777
|
}
|
|
89541
89778
|
function sleep(delayMs) {
|
|
89542
|
-
return new Promise((
|
|
89779
|
+
return new Promise((resolve18) => setTimeout(resolve18, delayMs));
|
|
89543
89780
|
}
|
|
89544
89781
|
function hasPromptStartEvidence(eventState) {
|
|
89545
89782
|
return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
|
|
@@ -89760,7 +89997,7 @@ function getPostHogActivityCaptureState2(now = new Date) {
|
|
|
89760
89997
|
// packages/omo-opencode/src/shared/posthog.ts
|
|
89761
89998
|
var activityStateProviderOverride2 = null;
|
|
89762
89999
|
var osProviderOverride3 = null;
|
|
89763
|
-
var
|
|
90000
|
+
var transportFactoryOverride2 = null;
|
|
89764
90001
|
function resolveActivityState() {
|
|
89765
90002
|
return (activityStateProviderOverride2 ?? getPostHogActivityCaptureState2)();
|
|
89766
90003
|
}
|
|
@@ -89768,7 +90005,7 @@ function resolveOsProvider2() {
|
|
|
89768
90005
|
return osProviderOverride3 ?? os5;
|
|
89769
90006
|
}
|
|
89770
90007
|
function resolveTransportFactory() {
|
|
89771
|
-
return
|
|
90008
|
+
return transportFactoryOverride2 ?? createDefaultPostHogTransport;
|
|
89772
90009
|
}
|
|
89773
90010
|
var NO_OP_POSTHOG2 = {
|
|
89774
90011
|
trackActive: () => {
|
|
@@ -89945,7 +90182,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
|
|
|
89945
90182
|
async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
|
|
89946
90183
|
const completed = await Promise.race([
|
|
89947
90184
|
eventProcessor.then(() => true),
|
|
89948
|
-
new Promise((
|
|
90185
|
+
new Promise((resolve18) => setTimeout(() => resolve18(false), timeoutMs))
|
|
89949
90186
|
]);
|
|
89950
90187
|
}
|
|
89951
90188
|
async function run(options) {
|
|
@@ -90248,14 +90485,14 @@ async function getLocalVersion(options = {}) {
|
|
|
90248
90485
|
}
|
|
90249
90486
|
}
|
|
90250
90487
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
90251
|
-
import { existsSync as
|
|
90488
|
+
import { existsSync as existsSync52, readFileSync as readFileSync33 } from "node:fs";
|
|
90252
90489
|
|
|
90253
90490
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
90254
90491
|
init_extract_semver();
|
|
90255
90492
|
init_bun_which_shim();
|
|
90256
|
-
import { existsSync as
|
|
90493
|
+
import { existsSync as existsSync49, accessSync as accessSync4, constants as constants9 } from "node:fs";
|
|
90257
90494
|
import { homedir as homedir13 } from "node:os";
|
|
90258
|
-
import { join as
|
|
90495
|
+
import { join as join68 } from "node:path";
|
|
90259
90496
|
|
|
90260
90497
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
90261
90498
|
init_spawn_with_windows_hide();
|
|
@@ -90294,8 +90531,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
90294
90531
|
const stdoutPromise = readSpawnStream(proc.stdout);
|
|
90295
90532
|
const stderrPromise = readSpawnStream(proc.stderr);
|
|
90296
90533
|
let timer;
|
|
90297
|
-
const timeoutPromise = new Promise((
|
|
90298
|
-
timer = setTimeout(() =>
|
|
90534
|
+
const timeoutPromise = new Promise((resolve18) => {
|
|
90535
|
+
timer = setTimeout(() => resolve18("timeout"), timeoutMs);
|
|
90299
90536
|
});
|
|
90300
90537
|
const processPromise = (async () => {
|
|
90301
90538
|
await proc.exited;
|
|
@@ -90347,17 +90584,17 @@ function getDesktopAppPaths(platform) {
|
|
|
90347
90584
|
case "darwin":
|
|
90348
90585
|
return [
|
|
90349
90586
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
90350
|
-
|
|
90587
|
+
join68(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
90351
90588
|
];
|
|
90352
90589
|
case "win32": {
|
|
90353
90590
|
const programFiles = process.env.ProgramFiles;
|
|
90354
90591
|
const localAppData = process.env.LOCALAPPDATA;
|
|
90355
90592
|
const paths = [];
|
|
90356
90593
|
if (programFiles) {
|
|
90357
|
-
paths.push(
|
|
90594
|
+
paths.push(join68(programFiles, "OpenCode", "OpenCode.exe"));
|
|
90358
90595
|
}
|
|
90359
90596
|
if (localAppData) {
|
|
90360
|
-
paths.push(
|
|
90597
|
+
paths.push(join68(localAppData, "OpenCode", "OpenCode.exe"));
|
|
90361
90598
|
}
|
|
90362
90599
|
return paths;
|
|
90363
90600
|
}
|
|
@@ -90365,8 +90602,8 @@ function getDesktopAppPaths(platform) {
|
|
|
90365
90602
|
return [
|
|
90366
90603
|
"/usr/bin/opencode",
|
|
90367
90604
|
"/usr/lib/opencode/opencode",
|
|
90368
|
-
|
|
90369
|
-
|
|
90605
|
+
join68(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
90606
|
+
join68(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
90370
90607
|
];
|
|
90371
90608
|
default:
|
|
90372
90609
|
return [];
|
|
@@ -90378,7 +90615,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
90378
90615
|
}
|
|
90379
90616
|
return [binaryPath, "--version"];
|
|
90380
90617
|
}
|
|
90381
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
90618
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync49) {
|
|
90382
90619
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
90383
90620
|
if (checkExists(desktopPath)) {
|
|
90384
90621
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -90386,7 +90623,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
90386
90623
|
}
|
|
90387
90624
|
return null;
|
|
90388
90625
|
}
|
|
90389
|
-
async function findOpenCodeBinary(platform = process.platform, checkExists =
|
|
90626
|
+
async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync49) {
|
|
90390
90627
|
for (const binary of OPENCODE_BINARIES2) {
|
|
90391
90628
|
const path14 = bunWhich(binary);
|
|
90392
90629
|
if (path14 && checkExists(path14)) {
|
|
@@ -90398,7 +90635,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
90398
90635
|
const candidates = getCommandCandidates2(platform);
|
|
90399
90636
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
90400
90637
|
for (const command of candidates) {
|
|
90401
|
-
const fullPath =
|
|
90638
|
+
const fullPath = join68(entry, command);
|
|
90402
90639
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
90403
90640
|
return { binary: command, path: fullPath };
|
|
90404
90641
|
}
|
|
@@ -90444,12 +90681,12 @@ function compareVersions3(current, minimum) {
|
|
|
90444
90681
|
|
|
90445
90682
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
90446
90683
|
init_shared();
|
|
90447
|
-
import { existsSync as
|
|
90684
|
+
import { existsSync as existsSync50, readFileSync as readFileSync31 } from "node:fs";
|
|
90448
90685
|
function detectConfigPath() {
|
|
90449
90686
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
90450
|
-
if (
|
|
90687
|
+
if (existsSync50(paths.configJsonc))
|
|
90451
90688
|
return paths.configJsonc;
|
|
90452
|
-
if (
|
|
90689
|
+
if (existsSync50(paths.configJson))
|
|
90453
90690
|
return paths.configJson;
|
|
90454
90691
|
return null;
|
|
90455
90692
|
}
|
|
@@ -90537,36 +90774,36 @@ init_file_utils2();
|
|
|
90537
90774
|
init_checker();
|
|
90538
90775
|
init_auto_update_checker();
|
|
90539
90776
|
init_package_json_locator();
|
|
90540
|
-
import { existsSync as
|
|
90777
|
+
import { existsSync as existsSync51, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "node:fs";
|
|
90541
90778
|
import { createRequire as createRequire3 } from "node:module";
|
|
90542
90779
|
import { homedir as homedir14 } from "node:os";
|
|
90543
|
-
import { join as
|
|
90780
|
+
import { join as join69 } from "node:path";
|
|
90544
90781
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
90545
90782
|
init_shared();
|
|
90546
90783
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
90547
90784
|
if (platform === "darwin")
|
|
90548
|
-
return
|
|
90785
|
+
return join69(homedir14(), "Library", "Caches");
|
|
90549
90786
|
if (platform === "win32")
|
|
90550
|
-
return process.env.LOCALAPPDATA ??
|
|
90551
|
-
return
|
|
90787
|
+
return process.env.LOCALAPPDATA ?? join69(homedir14(), "AppData", "Local");
|
|
90788
|
+
return join69(homedir14(), ".cache");
|
|
90552
90789
|
}
|
|
90553
90790
|
function resolveOpenCodeCacheDir() {
|
|
90554
90791
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
90555
90792
|
if (xdgCacheHome)
|
|
90556
|
-
return
|
|
90793
|
+
return join69(xdgCacheHome, "opencode");
|
|
90557
90794
|
const fromShared = getOpenCodeCacheDir();
|
|
90558
|
-
const platformDefault =
|
|
90559
|
-
if (
|
|
90795
|
+
const platformDefault = join69(getPlatformDefaultCacheDir(), "opencode");
|
|
90796
|
+
if (existsSync51(fromShared) || !existsSync51(platformDefault))
|
|
90560
90797
|
return fromShared;
|
|
90561
90798
|
return platformDefault;
|
|
90562
90799
|
}
|
|
90563
90800
|
function resolveExistingDir(dirPath) {
|
|
90564
|
-
if (!
|
|
90801
|
+
if (!existsSync51(dirPath))
|
|
90565
90802
|
return dirPath;
|
|
90566
90803
|
return resolveSymlink(dirPath);
|
|
90567
90804
|
}
|
|
90568
90805
|
function readPackageJson(filePath) {
|
|
90569
|
-
if (!
|
|
90806
|
+
if (!existsSync51(filePath))
|
|
90570
90807
|
return null;
|
|
90571
90808
|
try {
|
|
90572
90809
|
const content = readFileSync32(filePath, "utf-8");
|
|
@@ -90587,26 +90824,26 @@ function normalizeVersion(value) {
|
|
|
90587
90824
|
function createPackageCandidates(rootDir) {
|
|
90588
90825
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
90589
90826
|
packageName,
|
|
90590
|
-
installedPackagePath:
|
|
90827
|
+
installedPackagePath: join69(rootDir, "node_modules", packageName, "package.json")
|
|
90591
90828
|
}));
|
|
90592
90829
|
}
|
|
90593
90830
|
function createTaggedInstallCandidates(rootDir) {
|
|
90594
|
-
const packagesDir =
|
|
90595
|
-
if (!
|
|
90831
|
+
const packagesDir = join69(rootDir, "packages");
|
|
90832
|
+
if (!existsSync51(packagesDir))
|
|
90596
90833
|
return [];
|
|
90597
90834
|
const candidates = [];
|
|
90598
90835
|
for (const entryName of readdirSync8(packagesDir).sort()) {
|
|
90599
90836
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
90600
90837
|
if (packageName === undefined)
|
|
90601
90838
|
continue;
|
|
90602
|
-
const installDir =
|
|
90839
|
+
const installDir = join69(packagesDir, entryName);
|
|
90603
90840
|
candidates.push({
|
|
90604
90841
|
cacheDir: installDir,
|
|
90605
|
-
cachePackagePath:
|
|
90842
|
+
cachePackagePath: join69(installDir, "package.json"),
|
|
90606
90843
|
packageCandidates: [
|
|
90607
90844
|
{
|
|
90608
90845
|
packageName,
|
|
90609
|
-
installedPackagePath:
|
|
90846
|
+
installedPackagePath: join69(installDir, "node_modules", packageName, "package.json")
|
|
90610
90847
|
}
|
|
90611
90848
|
]
|
|
90612
90849
|
});
|
|
@@ -90614,7 +90851,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
90614
90851
|
return candidates;
|
|
90615
90852
|
}
|
|
90616
90853
|
function selectInstalledPackage(candidate) {
|
|
90617
|
-
return candidate.packageCandidates.find((packageCandidate) =>
|
|
90854
|
+
return candidate.packageCandidates.find((packageCandidate) => existsSync51(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
|
|
90618
90855
|
}
|
|
90619
90856
|
function getExpectedVersion(cachePackage, packageName) {
|
|
90620
90857
|
return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
|
|
@@ -90625,7 +90862,7 @@ function resolveInstalledPackageJsonPath() {
|
|
|
90625
90862
|
for (const packageName of ACCEPTED_PACKAGE_NAMES) {
|
|
90626
90863
|
try {
|
|
90627
90864
|
const packageJsonPath = require2.resolve(`${packageName}/package.json`);
|
|
90628
|
-
if (
|
|
90865
|
+
if (existsSync51(packageJsonPath)) {
|
|
90629
90866
|
return { packageName, packageJsonPath };
|
|
90630
90867
|
}
|
|
90631
90868
|
} catch {
|
|
@@ -90651,22 +90888,22 @@ function getLoadedPluginVersion() {
|
|
|
90651
90888
|
const candidates = [
|
|
90652
90889
|
{
|
|
90653
90890
|
cacheDir: configDir,
|
|
90654
|
-
cachePackagePath:
|
|
90891
|
+
cachePackagePath: join69(configDir, "package.json"),
|
|
90655
90892
|
packageCandidates: createPackageCandidates(configDir)
|
|
90656
90893
|
},
|
|
90657
90894
|
...createTaggedInstallCandidates(configDir),
|
|
90658
90895
|
{
|
|
90659
90896
|
cacheDir,
|
|
90660
|
-
cachePackagePath:
|
|
90897
|
+
cachePackagePath: join69(cacheDir, "package.json"),
|
|
90661
90898
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
90662
90899
|
},
|
|
90663
90900
|
...createTaggedInstallCandidates(cacheDir)
|
|
90664
90901
|
];
|
|
90665
|
-
const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) =>
|
|
90902
|
+
const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync51(packageCandidate.installedPackagePath))) ?? candidates[0];
|
|
90666
90903
|
const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
|
|
90667
90904
|
const selectedPackage = selectInstalledPackage(selectedCandidate);
|
|
90668
90905
|
const candidateInstalledPath = selectedPackage.installedPackagePath;
|
|
90669
|
-
const candidateExists =
|
|
90906
|
+
const candidateExists = existsSync51(candidateInstalledPath);
|
|
90670
90907
|
const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
|
|
90671
90908
|
const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
|
|
90672
90909
|
const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
|
|
@@ -90702,7 +90939,7 @@ var defaultDeps6 = {
|
|
|
90702
90939
|
getLoadedPluginVersion,
|
|
90703
90940
|
getLatestPluginVersion,
|
|
90704
90941
|
getSuggestedInstallTag,
|
|
90705
|
-
configExists:
|
|
90942
|
+
configExists: existsSync52,
|
|
90706
90943
|
readConfigFile: (path14) => readFileSync33(path14, "utf-8"),
|
|
90707
90944
|
parseConfigContent: (content) => parseJsonc(content)
|
|
90708
90945
|
};
|
|
@@ -90846,7 +91083,7 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
90846
91083
|
init_src();
|
|
90847
91084
|
import { readFileSync as readFileSync34 } from "node:fs";
|
|
90848
91085
|
import { homedir as homedir15 } from "node:os";
|
|
90849
|
-
import { dirname as
|
|
91086
|
+
import { dirname as dirname26, relative as relative9 } from "node:path";
|
|
90850
91087
|
init_shared();
|
|
90851
91088
|
init_plugin_identity();
|
|
90852
91089
|
function resolveHomeDirectory2() {
|
|
@@ -90870,11 +91107,11 @@ function discoverProjectLayersNearestFirst(directory) {
|
|
|
90870
91107
|
const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
|
|
90871
91108
|
return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
|
|
90872
91109
|
path: configPath,
|
|
90873
|
-
configDir:
|
|
91110
|
+
configDir: dirname26(configPath)
|
|
90874
91111
|
}));
|
|
90875
91112
|
}
|
|
90876
91113
|
function shortPath(configPath) {
|
|
90877
|
-
const candidate =
|
|
91114
|
+
const candidate = relative9(process.cwd(), configPath);
|
|
90878
91115
|
return candidate.length > 0 ? candidate : configPath;
|
|
90879
91116
|
}
|
|
90880
91117
|
function formatIssuePath(path14) {
|
|
@@ -90894,7 +91131,7 @@ function parseLayerConfig(configPath) {
|
|
|
90894
91131
|
if (!isPlainRecord(rawConfig)) {
|
|
90895
91132
|
return {
|
|
90896
91133
|
path: configPath,
|
|
90897
|
-
configDir:
|
|
91134
|
+
configDir: dirname26(configPath),
|
|
90898
91135
|
config: null,
|
|
90899
91136
|
messages: [`${shortPath(configPath)}: <root>: Expected object`]
|
|
90900
91137
|
};
|
|
@@ -90902,7 +91139,7 @@ function parseLayerConfig(configPath) {
|
|
|
90902
91139
|
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
90903
91140
|
return {
|
|
90904
91141
|
path: configPath,
|
|
90905
|
-
configDir:
|
|
91142
|
+
configDir: dirname26(configPath),
|
|
90906
91143
|
config: result.success ? result.data : parseConfigPartially(rawConfig),
|
|
90907
91144
|
messages: schemaMessages(configPath, rawConfig)
|
|
90908
91145
|
};
|
|
@@ -90912,7 +91149,7 @@ function parseLayerConfig(configPath) {
|
|
|
90912
91149
|
}
|
|
90913
91150
|
return {
|
|
90914
91151
|
path: configPath,
|
|
90915
|
-
configDir:
|
|
91152
|
+
configDir: dirname26(configPath),
|
|
90916
91153
|
config: null,
|
|
90917
91154
|
messages: [`${shortPath(configPath)}: ${error51.message}`]
|
|
90918
91155
|
};
|
|
@@ -90958,23 +91195,23 @@ function validatePluginConfig(directory) {
|
|
|
90958
91195
|
|
|
90959
91196
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
90960
91197
|
init_shared();
|
|
90961
|
-
import { existsSync as
|
|
91198
|
+
import { existsSync as existsSync53, readFileSync as readFileSync35 } from "node:fs";
|
|
90962
91199
|
import { homedir as homedir16 } from "node:os";
|
|
90963
|
-
import { join as
|
|
91200
|
+
import { join as join70 } from "node:path";
|
|
90964
91201
|
function getUserConfigDir2() {
|
|
90965
91202
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
90966
91203
|
if (xdgConfig)
|
|
90967
|
-
return
|
|
90968
|
-
return
|
|
91204
|
+
return join70(xdgConfig, "opencode");
|
|
91205
|
+
return join70(homedir16(), ".config", "opencode");
|
|
90969
91206
|
}
|
|
90970
91207
|
function loadCustomProviderNames() {
|
|
90971
91208
|
const configDir = getUserConfigDir2();
|
|
90972
91209
|
const candidatePaths = [
|
|
90973
|
-
|
|
90974
|
-
|
|
91210
|
+
join70(configDir, "opencode.json"),
|
|
91211
|
+
join70(configDir, "opencode.jsonc")
|
|
90975
91212
|
];
|
|
90976
91213
|
for (const configPath of candidatePaths) {
|
|
90977
|
-
if (!
|
|
91214
|
+
if (!existsSync53(configPath))
|
|
90978
91215
|
continue;
|
|
90979
91216
|
try {
|
|
90980
91217
|
const content = readFileSync35(configPath, "utf-8");
|
|
@@ -90992,9 +91229,9 @@ function loadCustomProviderNames() {
|
|
|
90992
91229
|
return [];
|
|
90993
91230
|
}
|
|
90994
91231
|
function loadAvailableModelsFromCache() {
|
|
90995
|
-
const cacheFile =
|
|
91232
|
+
const cacheFile = join70(getOpenCodeCacheDir(), "models.json");
|
|
90996
91233
|
const customProviders = loadCustomProviderNames();
|
|
90997
|
-
if (!
|
|
91234
|
+
if (!existsSync53(cacheFile)) {
|
|
90998
91235
|
if (customProviders.length > 0) {
|
|
90999
91236
|
return { providers: customProviders, modelCount: 0, cacheExists: true };
|
|
91000
91237
|
}
|
|
@@ -91029,8 +91266,8 @@ init_model_capabilities2();
|
|
|
91029
91266
|
init_shared();
|
|
91030
91267
|
init_plugin_identity();
|
|
91031
91268
|
import { readFileSync as readFileSync36 } from "node:fs";
|
|
91032
|
-
import { join as
|
|
91033
|
-
var PROJECT_CONFIG_DIR =
|
|
91269
|
+
import { join as join71 } from "node:path";
|
|
91270
|
+
var PROJECT_CONFIG_DIR = join71(process.cwd(), ".opencode");
|
|
91034
91271
|
function loadOmoConfig() {
|
|
91035
91272
|
const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR, {
|
|
91036
91273
|
basenames: [CONFIG_BASENAME],
|
|
@@ -91068,7 +91305,7 @@ function loadOmoConfig() {
|
|
|
91068
91305
|
|
|
91069
91306
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
91070
91307
|
init_shared();
|
|
91071
|
-
import { join as
|
|
91308
|
+
import { join as join72 } from "node:path";
|
|
91072
91309
|
|
|
91073
91310
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
91074
91311
|
function formatModelWithVariant(model, variant) {
|
|
@@ -91110,7 +91347,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
91110
91347
|
}
|
|
91111
91348
|
function buildModelResolutionDetails(options) {
|
|
91112
91349
|
const details = [];
|
|
91113
|
-
const cacheFile =
|
|
91350
|
+
const cacheFile = join72(getOpenCodeCacheDir(), "models.json");
|
|
91114
91351
|
details.push("═══ Available Models (from cache) ═══");
|
|
91115
91352
|
details.push("");
|
|
91116
91353
|
if (options.available.cacheExists) {
|
|
@@ -91386,28 +91623,28 @@ async function checkConfig() {
|
|
|
91386
91623
|
|
|
91387
91624
|
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
91388
91625
|
init_src();
|
|
91389
|
-
import { existsSync as
|
|
91626
|
+
import { existsSync as existsSync54 } from "node:fs";
|
|
91390
91627
|
import { createRequire as createRequire4 } from "node:module";
|
|
91391
91628
|
import { homedir as homedir18 } from "node:os";
|
|
91392
|
-
import { dirname as
|
|
91629
|
+
import { dirname as dirname27, join as join74 } from "node:path";
|
|
91393
91630
|
|
|
91394
91631
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
91395
|
-
import { join as
|
|
91632
|
+
import { join as join73 } from "path";
|
|
91396
91633
|
import { homedir as homedir17, tmpdir as tmpdir3 } from "os";
|
|
91397
91634
|
init_binary_downloader();
|
|
91398
91635
|
init_logger2();
|
|
91399
91636
|
init_plugin_identity();
|
|
91400
91637
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
91401
|
-
var DEBUG_FILE =
|
|
91638
|
+
var DEBUG_FILE = join73(tmpdir3(), "comment-checker-debug.log");
|
|
91402
91639
|
function getCacheDir2() {
|
|
91403
91640
|
if (process.platform === "win32") {
|
|
91404
91641
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
91405
|
-
const base2 = localAppData ||
|
|
91406
|
-
return
|
|
91642
|
+
const base2 = localAppData || join73(homedir17(), "AppData", "Local");
|
|
91643
|
+
return join73(base2, CACHE_DIR_NAME, "bin");
|
|
91407
91644
|
}
|
|
91408
91645
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
91409
|
-
const base = xdgCache ||
|
|
91410
|
-
return
|
|
91646
|
+
const base = xdgCache || join73(homedir17(), ".cache");
|
|
91647
|
+
return join73(base, CACHE_DIR_NAME, "bin");
|
|
91411
91648
|
}
|
|
91412
91649
|
function getBinaryName() {
|
|
91413
91650
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -91457,7 +91694,7 @@ async function getBinaryVersion(binary) {
|
|
|
91457
91694
|
}
|
|
91458
91695
|
}
|
|
91459
91696
|
async function checkAstGrepCli() {
|
|
91460
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
91697
|
+
const runtimeDir = astGrepRuntimeDir(join74(homedir18(), ".omo"));
|
|
91461
91698
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
91462
91699
|
if (sgPath === null) {
|
|
91463
91700
|
return {
|
|
@@ -91486,12 +91723,12 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
91486
91723
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
91487
91724
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
91488
91725
|
try {
|
|
91489
|
-
const packageDir = baseDirOverride ??
|
|
91490
|
-
const vendorPath =
|
|
91491
|
-
if (
|
|
91726
|
+
const packageDir = baseDirOverride ?? dirname27(resolvePackageJsonPath());
|
|
91727
|
+
const vendorPath = join74(packageDir, "vendor", platformKey, binaryName);
|
|
91728
|
+
if (existsSync54(vendorPath))
|
|
91492
91729
|
return vendorPath;
|
|
91493
|
-
const binPath =
|
|
91494
|
-
if (
|
|
91730
|
+
const binPath = join74(packageDir, "bin", binaryName);
|
|
91731
|
+
if (existsSync54(binPath))
|
|
91495
91732
|
return binPath;
|
|
91496
91733
|
} catch (error51) {
|
|
91497
91734
|
if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
|
|
@@ -91636,11 +91873,11 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
91636
91873
|
|
|
91637
91874
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
91638
91875
|
import { readFileSync as readFileSync37 } from "node:fs";
|
|
91639
|
-
import { join as
|
|
91876
|
+
import { join as join75 } from "node:path";
|
|
91640
91877
|
|
|
91641
91878
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
91642
|
-
import { existsSync as
|
|
91643
|
-
import { delimiter as delimiter3, dirname as
|
|
91879
|
+
import { existsSync as existsSync55 } from "node:fs";
|
|
91880
|
+
import { delimiter as delimiter3, dirname as dirname28, resolve as resolve19 } from "node:path";
|
|
91644
91881
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
91645
91882
|
|
|
91646
91883
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -91653,7 +91890,7 @@ function hasCliSuffix(candidatePath, suffix) {
|
|
|
91653
91890
|
|
|
91654
91891
|
// packages/omo-opencode/src/mcp/runtime-executable.ts
|
|
91655
91892
|
init_bun_which_shim();
|
|
91656
|
-
import { basename as
|
|
91893
|
+
import { basename as basename12 } from "node:path";
|
|
91657
91894
|
var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
|
|
91658
91895
|
function isUnsafeCommandName2(commandName) {
|
|
91659
91896
|
if (commandName.length === 0)
|
|
@@ -91669,7 +91906,7 @@ function isUnsafeCommandName2(commandName) {
|
|
|
91669
91906
|
return false;
|
|
91670
91907
|
}
|
|
91671
91908
|
function isNodeExecPath(execPath) {
|
|
91672
|
-
return NODE_EXECUTABLE_NAMES.has(
|
|
91909
|
+
return NODE_EXECUTABLE_NAMES.has(basename12(execPath).toLowerCase());
|
|
91673
91910
|
}
|
|
91674
91911
|
function resolveRuntimeExecutable(commandName, options = {}) {
|
|
91675
91912
|
if (isUnsafeCommandName2(commandName)) {
|
|
@@ -91687,7 +91924,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
|
|
|
91687
91924
|
}
|
|
91688
91925
|
|
|
91689
91926
|
// packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
|
|
91690
|
-
import { resolve as
|
|
91927
|
+
import { resolve as resolve18 } from "node:path";
|
|
91691
91928
|
function resolveJavaScriptRuntime(resolveExecutable) {
|
|
91692
91929
|
const node = resolveExecutable("node");
|
|
91693
91930
|
return node.available ? node : resolveExecutable("bun");
|
|
@@ -91695,9 +91932,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
|
|
|
91695
91932
|
function createAncestorCliCandidates(options) {
|
|
91696
91933
|
const candidates = [];
|
|
91697
91934
|
const seenPaths = new Set;
|
|
91698
|
-
let currentDirectory =
|
|
91935
|
+
let currentDirectory = resolve18(options.startDirectory);
|
|
91699
91936
|
while (true) {
|
|
91700
|
-
const distCliPath =
|
|
91937
|
+
const distCliPath = resolve18(currentDirectory, options.packageRel, options.distCliRel);
|
|
91701
91938
|
if (!seenPaths.has(distCliPath)) {
|
|
91702
91939
|
const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
|
|
91703
91940
|
seenPaths.add(distCliPath);
|
|
@@ -91709,7 +91946,7 @@ function createAncestorCliCandidates(options) {
|
|
|
91709
91946
|
runtimeAvailable: runtime5.available
|
|
91710
91947
|
});
|
|
91711
91948
|
}
|
|
91712
|
-
const sourceCliPath =
|
|
91949
|
+
const sourceCliPath = resolve18(currentDirectory, options.packageRel, options.sourceCliRel);
|
|
91713
91950
|
if (!seenPaths.has(sourceCliPath)) {
|
|
91714
91951
|
const runtime5 = options.resolveExecutable("bun");
|
|
91715
91952
|
const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
|
|
@@ -91726,7 +91963,7 @@ function createAncestorCliCandidates(options) {
|
|
|
91726
91963
|
runtimeAvailable: runtime5.available
|
|
91727
91964
|
});
|
|
91728
91965
|
}
|
|
91729
|
-
const parentDirectory =
|
|
91966
|
+
const parentDirectory = resolve18(currentDirectory, "..");
|
|
91730
91967
|
if (parentDirectory === currentDirectory)
|
|
91731
91968
|
return candidates;
|
|
91732
91969
|
currentDirectory = parentDirectory;
|
|
@@ -91762,7 +91999,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
91762
91999
|
].join(";");
|
|
91763
92000
|
function getModuleDirectory(moduleUrl) {
|
|
91764
92001
|
try {
|
|
91765
|
-
return
|
|
92002
|
+
return dirname28(fileURLToPath6(moduleUrl));
|
|
91766
92003
|
} catch (error51) {
|
|
91767
92004
|
if (!(error51 instanceof Error))
|
|
91768
92005
|
throw error51;
|
|
@@ -91770,23 +92007,23 @@ function getModuleDirectory(moduleUrl) {
|
|
|
91770
92007
|
}
|
|
91771
92008
|
}
|
|
91772
92009
|
function findBootstrapRoot(candidates, pathExists) {
|
|
91773
|
-
return candidates.find((candidate) => pathExists(
|
|
92010
|
+
return candidates.find((candidate) => pathExists(resolve19(candidate.root, "package.json")))?.root ?? process.cwd();
|
|
91774
92011
|
}
|
|
91775
92012
|
function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
91776
92013
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
91777
92014
|
const bun = resolveExecutable("bun");
|
|
91778
92015
|
const npm = resolveExecutable("npm");
|
|
91779
|
-
const packageManifestPath =
|
|
92016
|
+
const packageManifestPath = resolve19(root, PACKAGE_REL, "package.json");
|
|
91780
92017
|
return {
|
|
91781
92018
|
command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
|
|
91782
92019
|
root,
|
|
91783
|
-
path:
|
|
92020
|
+
path: resolve19(root, PACKAGE_REL, DIST_CLI_REL),
|
|
91784
92021
|
exists: runtime5.available && npm.available && pathExists(packageManifestPath),
|
|
91785
92022
|
runtimeAvailable: runtime5.available
|
|
91786
92023
|
};
|
|
91787
92024
|
}
|
|
91788
92025
|
function resolveLspCommand(options = {}) {
|
|
91789
|
-
const pathExists = options.exists ??
|
|
92026
|
+
const pathExists = options.exists ?? existsSync55;
|
|
91790
92027
|
const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
|
|
91791
92028
|
const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
|
|
91792
92029
|
const candidates = moduleDirectory ? createAncestorCliCandidates({
|
|
@@ -91796,7 +92033,7 @@ function resolveLspCommand(options = {}) {
|
|
|
91796
92033
|
sourceCliRel: SOURCE_CLI_REL,
|
|
91797
92034
|
pathExists,
|
|
91798
92035
|
resolveExecutable,
|
|
91799
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(
|
|
92036
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve19(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL))
|
|
91800
92037
|
}) : [];
|
|
91801
92038
|
const distCandidate = candidates.find((candidate) => hasCliSuffix(candidate.path, DIST_CLI_REL) && candidate.exists);
|
|
91802
92039
|
if (distCandidate) {
|
|
@@ -91843,7 +92080,7 @@ function readOmoConfig(configDirectory) {
|
|
|
91843
92080
|
}
|
|
91844
92081
|
function isLspMcpDisabled(options) {
|
|
91845
92082
|
const userConfigDirectory = options.configDirectory ?? getOpenCodeConfigDir({ binary: "opencode" });
|
|
91846
|
-
const projectConfigDirectory =
|
|
92083
|
+
const projectConfigDirectory = join75(options.cwd ?? process.cwd(), ".opencode");
|
|
91847
92084
|
const userConfig = readOmoConfig(userConfigDirectory);
|
|
91848
92085
|
const projectConfig = readOmoConfig(projectConfigDirectory);
|
|
91849
92086
|
const disabledMcps = new Set([
|
|
@@ -91862,21 +92099,21 @@ function getInstalledLspServers(options = {}) {
|
|
|
91862
92099
|
|
|
91863
92100
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
91864
92101
|
init_shared();
|
|
91865
|
-
import { existsSync as
|
|
92102
|
+
import { existsSync as existsSync56, readFileSync as readFileSync38 } from "node:fs";
|
|
91866
92103
|
import { homedir as homedir19 } from "node:os";
|
|
91867
|
-
import { join as
|
|
92104
|
+
import { join as join76 } from "node:path";
|
|
91868
92105
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
91869
92106
|
function getMcpConfigPaths() {
|
|
91870
92107
|
return [
|
|
91871
|
-
|
|
91872
|
-
|
|
91873
|
-
|
|
92108
|
+
join76(homedir19(), ".claude", ".mcp.json"),
|
|
92109
|
+
join76(process.cwd(), ".mcp.json"),
|
|
92110
|
+
join76(process.cwd(), ".claude", ".mcp.json")
|
|
91874
92111
|
];
|
|
91875
92112
|
}
|
|
91876
92113
|
function loadUserMcpConfig() {
|
|
91877
92114
|
const servers = {};
|
|
91878
92115
|
for (const configPath of getMcpConfigPaths()) {
|
|
91879
|
-
if (!
|
|
92116
|
+
if (!existsSync56(configPath))
|
|
91880
92117
|
continue;
|
|
91881
92118
|
try {
|
|
91882
92119
|
const content = readFileSync38(configPath, "utf-8");
|
|
@@ -92039,7 +92276,16 @@ async function probeBinary(cmd, args, spawnImpl) {
|
|
|
92039
92276
|
import { homedir as homedir20 } from "node:os";
|
|
92040
92277
|
import path14 from "node:path";
|
|
92041
92278
|
function resolveBaseDir(config3) {
|
|
92042
|
-
return config3.base_dir ?? path14.join(homedir20(), ".omo");
|
|
92279
|
+
return expandHomeDirectory(config3.base_dir ?? path14.join(homedir20(), ".omo"));
|
|
92280
|
+
}
|
|
92281
|
+
function expandHomeDirectory(directoryPath) {
|
|
92282
|
+
if (directoryPath === "~") {
|
|
92283
|
+
return homedir20();
|
|
92284
|
+
}
|
|
92285
|
+
if (directoryPath.startsWith("~/") || directoryPath.startsWith("~\\")) {
|
|
92286
|
+
return path14.join(homedir20(), directoryPath.slice(2));
|
|
92287
|
+
}
|
|
92288
|
+
return directoryPath;
|
|
92043
92289
|
}
|
|
92044
92290
|
// packages/omo-opencode/src/cli/doctor/checks/team-mode.ts
|
|
92045
92291
|
init_shared();
|
|
@@ -92114,10 +92360,10 @@ async function pathExists(dir) {
|
|
|
92114
92360
|
|
|
92115
92361
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
92116
92362
|
init_src();
|
|
92117
|
-
import { existsSync as
|
|
92363
|
+
import { existsSync as existsSync57 } from "node:fs";
|
|
92118
92364
|
import { lstat as lstat11, readdir as readdir8, readFile as readFile20 } from "node:fs/promises";
|
|
92119
92365
|
import { homedir as homedir21 } from "node:os";
|
|
92120
|
-
import { basename as
|
|
92366
|
+
import { basename as basename13, join as join77, resolve as resolve20 } from "node:path";
|
|
92121
92367
|
// packages/omo-opencode/package.json
|
|
92122
92368
|
var package_default3 = {
|
|
92123
92369
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -92173,13 +92419,13 @@ var CODEX_BIN_NAMES = [
|
|
|
92173
92419
|
"omo-git-bash-hook"
|
|
92174
92420
|
];
|
|
92175
92421
|
async function gatherCodexSummary(deps = {}) {
|
|
92176
|
-
const codexHome =
|
|
92422
|
+
const codexHome = resolve20(deps.codexHome ?? process.env.CODEX_HOME ?? join77(homedir21(), ".codex"));
|
|
92177
92423
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
92178
92424
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
92179
92425
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
92180
|
-
const manifest = pluginRoot === null ? null : await readJson(
|
|
92181
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
92182
|
-
const configPath =
|
|
92426
|
+
const manifest = pluginRoot === null ? null : await readJson(join77(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
92427
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join77(pluginRoot, "lazycodex-install.json"));
|
|
92428
|
+
const configPath = join77(codexHome, "config.toml");
|
|
92183
92429
|
const pluginVersion = stringField(manifest, "version");
|
|
92184
92430
|
return {
|
|
92185
92431
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -92235,7 +92481,7 @@ function buildCodexIssues(summary) {
|
|
|
92235
92481
|
if (summary.pluginRoot === null) {
|
|
92236
92482
|
issues.push({
|
|
92237
92483
|
title: "OMO Codex plugin is not installed",
|
|
92238
|
-
description: `Expected cached plugin at ${
|
|
92484
|
+
description: `Expected cached plugin at ${join77("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
92239
92485
|
fix: "Run: npx lazycodex-ai install",
|
|
92240
92486
|
severity: "error",
|
|
92241
92487
|
affects: ["plugin loading"]
|
|
@@ -92288,15 +92534,15 @@ function buildCodexIssues(summary) {
|
|
|
92288
92534
|
return issues;
|
|
92289
92535
|
}
|
|
92290
92536
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
92291
|
-
const pluginRoot =
|
|
92292
|
-
if (!
|
|
92537
|
+
const pluginRoot = join77(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
92538
|
+
if (!existsSync57(pluginRoot))
|
|
92293
92539
|
return null;
|
|
92294
92540
|
const versions2 = await readdir8(pluginRoot, { withFileTypes: true });
|
|
92295
92541
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
92296
|
-
return candidates.length === 0 ? null :
|
|
92542
|
+
return candidates.length === 0 ? null : join77(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
92297
92543
|
}
|
|
92298
92544
|
async function readCodexConfigSummary(configPath) {
|
|
92299
|
-
if (!
|
|
92545
|
+
if (!existsSync57(configPath)) {
|
|
92300
92546
|
return { exists: false, marketplaceConfigured: false, pluginEnabled: false, pluginsFeatureEnabled: false, pluginHooksFeatureEnabled: false };
|
|
92301
92547
|
}
|
|
92302
92548
|
const content = await readFile20(configPath, "utf8");
|
|
@@ -92311,17 +92557,17 @@ async function readCodexConfigSummary(configPath) {
|
|
|
92311
92557
|
async function readLinkedBins(binDir) {
|
|
92312
92558
|
const linked = [];
|
|
92313
92559
|
for (const name of CODEX_BIN_NAMES) {
|
|
92314
|
-
if (await pathExists2(
|
|
92560
|
+
if (await pathExists2(join77(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
92315
92561
|
linked.push(name);
|
|
92316
92562
|
}
|
|
92317
92563
|
return linked;
|
|
92318
92564
|
}
|
|
92319
92565
|
async function readLinkedAgents(codexHome) {
|
|
92320
|
-
const agentsDir =
|
|
92321
|
-
if (!
|
|
92566
|
+
const agentsDir = join77(codexHome, "agents");
|
|
92567
|
+
if (!existsSync57(agentsDir))
|
|
92322
92568
|
return [];
|
|
92323
92569
|
const entries = await readdir8(agentsDir, { withFileTypes: true });
|
|
92324
|
-
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) =>
|
|
92570
|
+
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
|
|
92325
92571
|
}
|
|
92326
92572
|
async function readJson(path16) {
|
|
92327
92573
|
try {
|
|
@@ -92377,7 +92623,7 @@ async function pathExists2(path16) {
|
|
|
92377
92623
|
init_src();
|
|
92378
92624
|
import { readdir as readdir9, readFile as readFile21, stat as stat4 } from "node:fs/promises";
|
|
92379
92625
|
import { homedir as homedir22 } from "node:os";
|
|
92380
|
-
import { dirname as
|
|
92626
|
+
import { dirname as dirname29, join as join78, relative as relative10, resolve as resolve21, sep as sep9 } from "node:path";
|
|
92381
92627
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
92382
92628
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
92383
92629
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -92387,7 +92633,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
92387
92633
|
const env3 = deps.env ?? process.env;
|
|
92388
92634
|
const platform = deps.platform ?? process.platform;
|
|
92389
92635
|
const arch = deps.arch ?? process.arch;
|
|
92390
|
-
const codexHome =
|
|
92636
|
+
const codexHome = resolve21(deps.codexHome ?? env3["CODEX_HOME"] ?? join78(homedir22(), ".codex"));
|
|
92391
92637
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
92392
92638
|
if (summary.pluginRoot === null) {
|
|
92393
92639
|
return {
|
|
@@ -92412,7 +92658,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
92412
92658
|
});
|
|
92413
92659
|
}
|
|
92414
92660
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
92415
|
-
const runtimeSgPath =
|
|
92661
|
+
const runtimeSgPath = join78(runtimeSgDir, sgBinaryName(platform));
|
|
92416
92662
|
const sg = findSgBinarySync({
|
|
92417
92663
|
arch,
|
|
92418
92664
|
env: env3,
|
|
@@ -92451,8 +92697,8 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
92451
92697
|
const manifest = await readJson2(manifestPath);
|
|
92452
92698
|
if (manifest === null || !isRecord5(manifest["mcpServers"]))
|
|
92453
92699
|
continue;
|
|
92454
|
-
const manifestRoot =
|
|
92455
|
-
const isRootManifest =
|
|
92700
|
+
const manifestRoot = dirname29(manifestPath);
|
|
92701
|
+
const isRootManifest = resolve21(manifestRoot) === resolve21(pluginRoot);
|
|
92456
92702
|
for (const server2 of Object.values(manifest["mcpServers"])) {
|
|
92457
92703
|
if (!isRecord5(server2) || !Array.isArray(server2["args"]))
|
|
92458
92704
|
continue;
|
|
@@ -92472,7 +92718,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
92472
92718
|
continue;
|
|
92473
92719
|
const commands2 = [];
|
|
92474
92720
|
collectHookCommands(manifest, commands2);
|
|
92475
|
-
const hookPluginRoot =
|
|
92721
|
+
const hookPluginRoot = dirname29(dirname29(hookManifestPath));
|
|
92476
92722
|
for (const command of commands2) {
|
|
92477
92723
|
for (const relativePath of extractPluginRootPaths(command)) {
|
|
92478
92724
|
referencedCount += 1;
|
|
@@ -92494,8 +92740,8 @@ function recordBrokenTarget(broken, classified, origin) {
|
|
|
92494
92740
|
broken.push(entry);
|
|
92495
92741
|
}
|
|
92496
92742
|
async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
|
|
92497
|
-
const targetPath =
|
|
92498
|
-
const bundleRootPath =
|
|
92743
|
+
const targetPath = resolve21(baseRoot, relativePath);
|
|
92744
|
+
const bundleRootPath = resolve21(bundleRoot);
|
|
92499
92745
|
const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
|
|
92500
92746
|
if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
|
|
92501
92747
|
if (allowEscape)
|
|
@@ -92511,7 +92757,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
|
|
|
92511
92757
|
}
|
|
92512
92758
|
async function findHookManifestPaths(root) {
|
|
92513
92759
|
const paths2 = await findManifestPaths(root, "hooks.json");
|
|
92514
|
-
return paths2.filter((path16) =>
|
|
92760
|
+
return paths2.filter((path16) => dirname29(path16).endsWith(`${sep9}hooks`));
|
|
92515
92761
|
}
|
|
92516
92762
|
async function findManifestPaths(root, manifestName) {
|
|
92517
92763
|
let entries;
|
|
@@ -92524,7 +92770,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
92524
92770
|
for (const entry of entries) {
|
|
92525
92771
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
92526
92772
|
continue;
|
|
92527
|
-
const entryPath =
|
|
92773
|
+
const entryPath = join78(root, entry.name);
|
|
92528
92774
|
if (entry.isDirectory()) {
|
|
92529
92775
|
paths2.push(...await findManifestPaths(entryPath, manifestName));
|
|
92530
92776
|
continue;
|
|
@@ -92567,18 +92813,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
92567
92813
|
return (arg.startsWith("./") || arg.startsWith("../")) && arg.endsWith("/dist/cli.js");
|
|
92568
92814
|
}
|
|
92569
92815
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
92570
|
-
return
|
|
92816
|
+
return join78(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
92571
92817
|
}
|
|
92572
92818
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
92573
92819
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
92574
92820
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
92575
92821
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
92576
|
-
if (sgPath ===
|
|
92822
|
+
if (sgPath === join78(runtimeSgDir, sgBinaryName(platform)))
|
|
92577
92823
|
return "runtime dir";
|
|
92578
92824
|
return "PATH";
|
|
92579
92825
|
}
|
|
92580
92826
|
async function readBootstrapStateSummary(codexHome) {
|
|
92581
|
-
const statePath =
|
|
92827
|
+
const statePath = join78(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
92582
92828
|
const raw = await readJson2(statePath);
|
|
92583
92829
|
if (raw === null)
|
|
92584
92830
|
return null;
|
|
@@ -92644,7 +92890,7 @@ async function fileSize(path16) {
|
|
|
92644
92890
|
}
|
|
92645
92891
|
}
|
|
92646
92892
|
function normalizeRelative(root, target) {
|
|
92647
|
-
return normalizePathSeparators(
|
|
92893
|
+
return normalizePathSeparators(relative10(root, target));
|
|
92648
92894
|
}
|
|
92649
92895
|
function normalizePathSeparators(path16) {
|
|
92650
92896
|
return path16.split("\\").join("/");
|
|
@@ -92654,23 +92900,23 @@ function isRecord5(value) {
|
|
|
92654
92900
|
}
|
|
92655
92901
|
|
|
92656
92902
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
92657
|
-
import { existsSync as
|
|
92903
|
+
import { existsSync as existsSync58 } from "node:fs";
|
|
92658
92904
|
import { readFile as readFile22 } from "node:fs/promises";
|
|
92659
92905
|
import { homedir as homedir23 } from "node:os";
|
|
92660
|
-
import { join as
|
|
92906
|
+
import { join as join79, resolve as resolve22 } from "node:path";
|
|
92661
92907
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
92662
92908
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
92663
92909
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
92664
92910
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
92665
|
-
const codexHome =
|
|
92911
|
+
const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join79(homedir23(), ".codex"));
|
|
92666
92912
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
92667
92913
|
const platform = deps.platform ?? process.platform;
|
|
92668
|
-
const wrapperPath =
|
|
92914
|
+
const wrapperPath = join79(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
92669
92915
|
const wrapper = await readRuntimeWrapper(wrapperPath);
|
|
92670
92916
|
const issues = [];
|
|
92671
92917
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
92672
92918
|
const targetPath = parseRuntimeTargetPath(wrapper);
|
|
92673
|
-
if (targetPath !== null && !
|
|
92919
|
+
if (targetPath !== null && !existsSync58(targetPath)) {
|
|
92674
92920
|
issues.push({
|
|
92675
92921
|
title: "omo runtime wrapper target is missing",
|
|
92676
92922
|
description: `Generated omo runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
|
|
@@ -93162,7 +93408,7 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
93162
93408
|
import { createHash as createHash4 } from "node:crypto";
|
|
93163
93409
|
import {
|
|
93164
93410
|
chmodSync as chmodSync4,
|
|
93165
|
-
existsSync as
|
|
93411
|
+
existsSync as existsSync61,
|
|
93166
93412
|
mkdirSync as mkdirSync14,
|
|
93167
93413
|
readdirSync as readdirSync9,
|
|
93168
93414
|
readFileSync as readFileSync41,
|
|
@@ -93170,15 +93416,15 @@ import {
|
|
|
93170
93416
|
unlinkSync as unlinkSync8,
|
|
93171
93417
|
writeFileSync as writeFileSync11
|
|
93172
93418
|
} from "node:fs";
|
|
93173
|
-
import { basename as
|
|
93419
|
+
import { basename as basename14, dirname as dirname30, join as join82 } from "node:path";
|
|
93174
93420
|
|
|
93175
93421
|
// packages/mcp-client-core/src/config-dir.ts
|
|
93176
|
-
import { existsSync as
|
|
93422
|
+
import { existsSync as existsSync59, realpathSync as realpathSync8 } from "node:fs";
|
|
93177
93423
|
import { homedir as homedir24 } from "node:os";
|
|
93178
|
-
import { join as
|
|
93424
|
+
import { join as join80, resolve as resolve23 } from "node:path";
|
|
93179
93425
|
function resolveConfigPath2(pathValue) {
|
|
93180
|
-
const resolvedPath =
|
|
93181
|
-
if (!
|
|
93426
|
+
const resolvedPath = resolve23(pathValue);
|
|
93427
|
+
if (!existsSync59(resolvedPath))
|
|
93182
93428
|
return resolvedPath;
|
|
93183
93429
|
try {
|
|
93184
93430
|
return realpathSync8(resolvedPath);
|
|
@@ -93193,13 +93439,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
93193
93439
|
if (customConfigDir) {
|
|
93194
93440
|
return resolveConfigPath2(customConfigDir);
|
|
93195
93441
|
}
|
|
93196
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
93197
|
-
return resolveConfigPath2(
|
|
93442
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join80(homedir24(), ".config");
|
|
93443
|
+
return resolveConfigPath2(join80(xdgConfigDir, "opencode"));
|
|
93198
93444
|
}
|
|
93199
93445
|
|
|
93200
93446
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
93201
|
-
import { chmodSync as chmodSync3, existsSync as
|
|
93202
|
-
import { join as
|
|
93447
|
+
import { chmodSync as chmodSync3, existsSync as existsSync60, readFileSync as readFileSync40, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
|
|
93448
|
+
import { join as join81 } from "node:path";
|
|
93203
93449
|
var INDEX_FILE_NAME = "index.json";
|
|
93204
93450
|
function isTokenIndex(value) {
|
|
93205
93451
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -93207,11 +93453,11 @@ function isTokenIndex(value) {
|
|
|
93207
93453
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
93208
93454
|
}
|
|
93209
93455
|
function getIndexPath(storageDir) {
|
|
93210
|
-
return
|
|
93456
|
+
return join81(storageDir, INDEX_FILE_NAME);
|
|
93211
93457
|
}
|
|
93212
93458
|
function readTokenIndex(storageDir) {
|
|
93213
93459
|
const indexPath = getIndexPath(storageDir);
|
|
93214
|
-
if (!
|
|
93460
|
+
if (!existsSync60(indexPath))
|
|
93215
93461
|
return {};
|
|
93216
93462
|
try {
|
|
93217
93463
|
const parsed = JSON.parse(readFileSync40(indexPath, "utf-8"));
|
|
@@ -93251,16 +93497,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
93251
93497
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
93252
93498
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
93253
93499
|
function getMcpOauthStorageDir() {
|
|
93254
|
-
return
|
|
93500
|
+
return join82(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
93255
93501
|
}
|
|
93256
93502
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
93257
93503
|
return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
93258
93504
|
}
|
|
93259
93505
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
93260
|
-
return
|
|
93506
|
+
return join82(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
93261
93507
|
}
|
|
93262
93508
|
function getLegacyStoragePath() {
|
|
93263
|
-
return
|
|
93509
|
+
return join82(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
93264
93510
|
}
|
|
93265
93511
|
function normalizeHost2(serverHost) {
|
|
93266
93512
|
let host = serverHost.trim();
|
|
@@ -93321,7 +93567,7 @@ function isOAuthTokenData(value) {
|
|
|
93321
93567
|
return clientSecret === undefined || typeof clientSecret === "string";
|
|
93322
93568
|
}
|
|
93323
93569
|
function readTokenFile(filePath) {
|
|
93324
|
-
if (!
|
|
93570
|
+
if (!existsSync61(filePath))
|
|
93325
93571
|
return null;
|
|
93326
93572
|
try {
|
|
93327
93573
|
const parsed = JSON.parse(readFileSync41(filePath, "utf-8"));
|
|
@@ -93334,7 +93580,7 @@ function readTokenFile(filePath) {
|
|
|
93334
93580
|
}
|
|
93335
93581
|
function readLegacyStore() {
|
|
93336
93582
|
const filePath = getLegacyStoragePath();
|
|
93337
|
-
if (!
|
|
93583
|
+
if (!existsSync61(filePath))
|
|
93338
93584
|
return null;
|
|
93339
93585
|
try {
|
|
93340
93586
|
const parsed = JSON.parse(readFileSync41(filePath, "utf-8"));
|
|
@@ -93354,8 +93600,8 @@ function readLegacyStore() {
|
|
|
93354
93600
|
}
|
|
93355
93601
|
function writeTokenFile(filePath, token) {
|
|
93356
93602
|
try {
|
|
93357
|
-
const dir =
|
|
93358
|
-
if (!
|
|
93603
|
+
const dir = dirname30(filePath);
|
|
93604
|
+
if (!existsSync61(dir)) {
|
|
93359
93605
|
mkdirSync14(dir, { recursive: true });
|
|
93360
93606
|
}
|
|
93361
93607
|
const tempPath = `${filePath}.tmp.${Date.now()}`;
|
|
@@ -93379,7 +93625,7 @@ function saveToken(serverHost, resource, token) {
|
|
|
93379
93625
|
}
|
|
93380
93626
|
function deleteToken(serverHost, resource) {
|
|
93381
93627
|
const filePath = getMcpOauthStoragePath(serverHost, resource);
|
|
93382
|
-
if (!
|
|
93628
|
+
if (!existsSync61(filePath))
|
|
93383
93629
|
return deleteLegacyToken(serverHost, resource);
|
|
93384
93630
|
try {
|
|
93385
93631
|
unlinkSync8(filePath);
|
|
@@ -93401,7 +93647,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
93401
93647
|
if (Object.keys(store2).length === 0) {
|
|
93402
93648
|
try {
|
|
93403
93649
|
const filePath = getLegacyStoragePath();
|
|
93404
|
-
if (
|
|
93650
|
+
if (existsSync61(filePath))
|
|
93405
93651
|
unlinkSync8(filePath);
|
|
93406
93652
|
return true;
|
|
93407
93653
|
} catch (deleteError) {
|
|
@@ -93439,7 +93685,7 @@ function listTokensByHost(serverHost) {
|
|
|
93439
93685
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
93440
93686
|
if (!indexedKey.startsWith(prefix))
|
|
93441
93687
|
continue;
|
|
93442
|
-
const indexedToken = readTokenFile(
|
|
93688
|
+
const indexedToken = readTokenFile(join82(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
93443
93689
|
if (indexedToken)
|
|
93444
93690
|
result[indexedKey] = indexedToken;
|
|
93445
93691
|
}
|
|
@@ -93448,14 +93694,14 @@ function listTokensByHost(serverHost) {
|
|
|
93448
93694
|
function listAllTokens() {
|
|
93449
93695
|
const result = { ...readLegacyStore() ?? {} };
|
|
93450
93696
|
const dir = getMcpOauthStorageDir();
|
|
93451
|
-
if (!
|
|
93697
|
+
if (!existsSync61(dir))
|
|
93452
93698
|
return result;
|
|
93453
93699
|
const index = readTokenIndex(dir);
|
|
93454
93700
|
for (const entry of readdirSync9(dir, { withFileTypes: true })) {
|
|
93455
93701
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
93456
93702
|
continue;
|
|
93457
|
-
const token = readTokenFile(
|
|
93458
|
-
const hash2 =
|
|
93703
|
+
const token = readTokenFile(join82(dir, entry.name));
|
|
93704
|
+
const hash2 = basename14(entry.name, ".json");
|
|
93459
93705
|
if (token)
|
|
93460
93706
|
result[index[hash2] ?? hash2] = token;
|
|
93461
93707
|
}
|
|
@@ -93654,7 +93900,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
|
93654
93900
|
}
|
|
93655
93901
|
var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
93656
93902
|
function startCallbackServer(port) {
|
|
93657
|
-
return new Promise((
|
|
93903
|
+
return new Promise((resolve24, reject) => {
|
|
93658
93904
|
let timeoutId;
|
|
93659
93905
|
const server2 = createServer2((request, response) => {
|
|
93660
93906
|
clearTimeout(timeoutId);
|
|
@@ -93680,7 +93926,7 @@ function startCallbackServer(port) {
|
|
|
93680
93926
|
response.writeHead(200, { "content-type": "text/html" });
|
|
93681
93927
|
response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
|
|
93682
93928
|
server2.close();
|
|
93683
|
-
|
|
93929
|
+
resolve24({ code, state: state2 });
|
|
93684
93930
|
});
|
|
93685
93931
|
timeoutId = setTimeout(() => {
|
|
93686
93932
|
server2.close();
|
|
@@ -94020,7 +94266,7 @@ function createMcpOAuthCommand() {
|
|
|
94020
94266
|
}
|
|
94021
94267
|
|
|
94022
94268
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
94023
|
-
import { existsSync as
|
|
94269
|
+
import { existsSync as existsSync62 } from "node:fs";
|
|
94024
94270
|
|
|
94025
94271
|
// packages/omo-opencode/src/cli/boulder/formatter.ts
|
|
94026
94272
|
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
@@ -94157,10 +94403,10 @@ async function boulder(options) {
|
|
|
94157
94403
|
const boulderFilePath = getBoulderFilePath(directory);
|
|
94158
94404
|
const state2 = readBoulderState(directory);
|
|
94159
94405
|
if (!state2) {
|
|
94160
|
-
const message =
|
|
94406
|
+
const message = existsSync62(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
|
|
94161
94407
|
process.stderr.write(`${message}
|
|
94162
94408
|
`);
|
|
94163
|
-
return
|
|
94409
|
+
return existsSync62(boulderFilePath) ? 2 : 1;
|
|
94164
94410
|
}
|
|
94165
94411
|
const works = getBoulderWorks(state2);
|
|
94166
94412
|
const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
|
|
@@ -94178,7 +94424,7 @@ async function boulder(options) {
|
|
|
94178
94424
|
}
|
|
94179
94425
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
94180
94426
|
import { spawn as spawn5 } from "node:child_process";
|
|
94181
|
-
import { existsSync as
|
|
94427
|
+
import { existsSync as existsSync63, realpathSync as realpathSync9 } from "node:fs";
|
|
94182
94428
|
import { homedir as homedir25 } from "node:os";
|
|
94183
94429
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
94184
94430
|
const env3 = input.env ?? process.env;
|
|
@@ -94203,22 +94449,22 @@ async function codexUlwLoop(args) {
|
|
|
94203
94449
|
console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
|
|
94204
94450
|
return 1;
|
|
94205
94451
|
}
|
|
94206
|
-
return new Promise((
|
|
94452
|
+
return new Promise((resolve24) => {
|
|
94207
94453
|
const child = spawn5(command.executable, [...command.argsPrefix, ...args], { stdio: "inherit" });
|
|
94208
94454
|
child.on("error", (error51) => {
|
|
94209
94455
|
console.error(error51.message);
|
|
94210
|
-
|
|
94456
|
+
resolve24(1);
|
|
94211
94457
|
});
|
|
94212
|
-
child.on("close", (code) =>
|
|
94458
|
+
child.on("close", (code) => resolve24(code ?? 1));
|
|
94213
94459
|
});
|
|
94214
94460
|
}
|
|
94215
94461
|
function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
94216
94462
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
|
|
94217
|
-
return candidates.find((candidate) =>
|
|
94463
|
+
return candidates.find((candidate) => existsSync63(candidate)) ?? null;
|
|
94218
94464
|
}
|
|
94219
94465
|
function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
94220
94466
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
|
|
94221
|
-
return candidates.find((candidate) =>
|
|
94467
|
+
return candidates.find((candidate) => existsSync63(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths)) ?? null;
|
|
94222
94468
|
}
|
|
94223
94469
|
function isCurrentExecutable(candidate, currentExecutablePaths) {
|
|
94224
94470
|
const candidateRealPath = realpathOrSelf(candidate);
|
|
@@ -94267,15 +94513,15 @@ async function refreshModelCapabilities(options, deps = {}) {
|
|
|
94267
94513
|
}
|
|
94268
94514
|
|
|
94269
94515
|
// packages/omo-opencode/src/cli/sparkshell.ts
|
|
94270
|
-
import { spawnSync as
|
|
94516
|
+
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
94271
94517
|
import { constants as osConstants } from "node:os";
|
|
94272
|
-
import { isAbsolute as
|
|
94518
|
+
import { isAbsolute as isAbsolute11, resolve as resolve24 } from "node:path";
|
|
94273
94519
|
|
|
94274
94520
|
// packages/omo-opencode/src/cli/sparkshell-appserver.ts
|
|
94275
94521
|
init_src();
|
|
94276
|
-
import { existsSync as
|
|
94522
|
+
import { existsSync as existsSync64 } from "node:fs";
|
|
94277
94523
|
import { homedir as homedir26 } from "node:os";
|
|
94278
|
-
import { join as
|
|
94524
|
+
import { join as join83 } from "node:path";
|
|
94279
94525
|
|
|
94280
94526
|
// packages/omo-opencode/src/cli/sparkshell-appserver-websocket.ts
|
|
94281
94527
|
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
@@ -94426,7 +94672,7 @@ function bufferUnreadSocketBytes(socket, unread) {
|
|
|
94426
94672
|
// packages/omo-opencode/src/cli/sparkshell-appserver.ts
|
|
94427
94673
|
function createDefaultSparkShellAppServerClient(env3) {
|
|
94428
94674
|
const socketPath = resolveAppServerSocketPath(env3);
|
|
94429
|
-
if (!socketPath || !
|
|
94675
|
+
if (!socketPath || !existsSync64(socketPath)) {
|
|
94430
94676
|
return null;
|
|
94431
94677
|
}
|
|
94432
94678
|
return new JsonRpcSparkShellAppServerClient(socketPath, resolveAppServerTimeoutMs(env3));
|
|
@@ -94436,8 +94682,8 @@ function resolveAppServerSocketPath(env3) {
|
|
|
94436
94682
|
if (explicit) {
|
|
94437
94683
|
return explicit;
|
|
94438
94684
|
}
|
|
94439
|
-
const codexHome = env3["CODEX_HOME"]?.trim() ||
|
|
94440
|
-
return
|
|
94685
|
+
const codexHome = env3["CODEX_HOME"]?.trim() || join83(homedir26(), ".codex");
|
|
94686
|
+
return join83(codexHome, "app-server-control", "app-server-control.sock");
|
|
94441
94687
|
}
|
|
94442
94688
|
function resolveAppServerTimeoutMs(env3) {
|
|
94443
94689
|
const parsed = Number.parseInt(env3["OMO_SPARKSHELL_APP_SERVER_TIMEOUT_MS"]?.trim() ?? "", 10);
|
|
@@ -94866,9 +95112,9 @@ function extractContextHints(requests) {
|
|
|
94866
95112
|
seen.add(key);
|
|
94867
95113
|
hints.push(hint);
|
|
94868
95114
|
}
|
|
94869
|
-
const
|
|
94870
|
-
if (
|
|
94871
|
-
add(
|
|
95115
|
+
const basename15 = hint.slice(hint.lastIndexOf("/") + 1);
|
|
95116
|
+
if (basename15.length > 0 && basename15 !== hint) {
|
|
95117
|
+
add(basename15);
|
|
94872
95118
|
}
|
|
94873
95119
|
};
|
|
94874
95120
|
for (const request of requests) {
|
|
@@ -95007,9 +95253,9 @@ function isLowSurrogate(codeUnit) {
|
|
|
95007
95253
|
|
|
95008
95254
|
// packages/omo-opencode/src/cli/sparkshell-session-context.ts
|
|
95009
95255
|
init_src();
|
|
95010
|
-
import { existsSync as
|
|
95256
|
+
import { existsSync as existsSync65, readdirSync as readdirSync10, readFileSync as readFileSync42 } from "node:fs";
|
|
95011
95257
|
import { homedir as homedir27 } from "node:os";
|
|
95012
|
-
import { join as
|
|
95258
|
+
import { join as join84 } from "node:path";
|
|
95013
95259
|
var SPARKSHELL_SESSION_CONTEXT_ENV = "OMO_SPARKSHELL_SESSION_CONTEXT";
|
|
95014
95260
|
var SPARKSHELL_SESSION_ID_ENV = "OMO_SPARKSHELL_SESSION_ID";
|
|
95015
95261
|
var CODEX_THREAD_ID_ENV = "CODEX_THREAD_ID";
|
|
@@ -95022,11 +95268,11 @@ function resolveCodexSessionId(env3) {
|
|
|
95022
95268
|
return /^[0-9a-f][0-9a-f-]{7,}$/i.test(candidate) ? candidate : null;
|
|
95023
95269
|
}
|
|
95024
95270
|
function findRolloutPath(sessionId, env3, deps = {}) {
|
|
95025
|
-
const fileExists = deps.fileExists ??
|
|
95271
|
+
const fileExists = deps.fileExists ?? existsSync65;
|
|
95026
95272
|
const listDirectory = deps.listDirectory ?? ((path16) => readdirSync10(path16));
|
|
95027
95273
|
const homeDirectory = deps.homeDirectory ?? homedir27;
|
|
95028
|
-
const codexHome = env3["CODEX_HOME"]?.trim() ||
|
|
95029
|
-
const roots = [
|
|
95274
|
+
const codexHome = env3["CODEX_HOME"]?.trim() || join84(homeDirectory(), ".codex");
|
|
95275
|
+
const roots = [join84(codexHome, "sessions"), join84(codexHome, "archived_sessions")];
|
|
95030
95276
|
const fileSuffix = `-${sessionId}.jsonl`;
|
|
95031
95277
|
const scanDay = (dayDir) => {
|
|
95032
95278
|
if (!fileExists(dayDir)) {
|
|
@@ -95034,14 +95280,14 @@ function findRolloutPath(sessionId, env3, deps = {}) {
|
|
|
95034
95280
|
}
|
|
95035
95281
|
for (const name of listSafely(listDirectory, dayDir)) {
|
|
95036
95282
|
if (name.startsWith("rollout-") && name.endsWith(fileSuffix)) {
|
|
95037
|
-
return
|
|
95283
|
+
return join84(dayDir, name);
|
|
95038
95284
|
}
|
|
95039
95285
|
}
|
|
95040
95286
|
return null;
|
|
95041
95287
|
};
|
|
95042
95288
|
for (const dayDir of uuidV7DayDirCandidates(sessionId)) {
|
|
95043
95289
|
for (const root of roots) {
|
|
95044
|
-
const found = scanDay(
|
|
95290
|
+
const found = scanDay(join84(root, dayDir));
|
|
95045
95291
|
if (found) {
|
|
95046
95292
|
return found;
|
|
95047
95293
|
}
|
|
@@ -95052,9 +95298,9 @@ function findRolloutPath(sessionId, env3, deps = {}) {
|
|
|
95052
95298
|
continue;
|
|
95053
95299
|
}
|
|
95054
95300
|
for (const year of numericNamesDescending(listSafely(listDirectory, root))) {
|
|
95055
|
-
for (const month of numericNamesDescending(listSafely(listDirectory,
|
|
95056
|
-
for (const day of numericNamesDescending(listSafely(listDirectory,
|
|
95057
|
-
const found = scanDay(
|
|
95301
|
+
for (const month of numericNamesDescending(listSafely(listDirectory, join84(root, year)))) {
|
|
95302
|
+
for (const day of numericNamesDescending(listSafely(listDirectory, join84(root, year, month)))) {
|
|
95303
|
+
const found = scanDay(join84(root, year, month, day));
|
|
95058
95304
|
if (found) {
|
|
95059
95305
|
return found;
|
|
95060
95306
|
}
|
|
@@ -95214,7 +95460,7 @@ function uuidV7DayDirCandidates(sessionId) {
|
|
|
95214
95460
|
const candidates = [];
|
|
95215
95461
|
for (const offsetDays of [0, 1, -1]) {
|
|
95216
95462
|
const date5 = new Date(ms + offsetDays * DAY_MS);
|
|
95217
|
-
candidates.push(
|
|
95463
|
+
candidates.push(join84(String(date5.getFullYear()), pad2(date5.getMonth() + 1), pad2(date5.getDate())));
|
|
95218
95464
|
}
|
|
95219
95465
|
return candidates;
|
|
95220
95466
|
}
|
|
@@ -95252,10 +95498,10 @@ function isFalsy2(value) {
|
|
|
95252
95498
|
}
|
|
95253
95499
|
|
|
95254
95500
|
// packages/omo-opencode/src/cli/sparkshell-spark.ts
|
|
95255
|
-
import { spawnSync as
|
|
95501
|
+
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
95256
95502
|
import { mkdtempSync, readFileSync as readFileSync43, rmSync as rmSync4 } from "node:fs";
|
|
95257
95503
|
import { tmpdir as tmpdir4 } from "node:os";
|
|
95258
|
-
import { join as
|
|
95504
|
+
import { join as join85 } from "node:path";
|
|
95259
95505
|
var SPARKSHELL_SPARK_ENV = "OMO_SPARKSHELL_SPARK";
|
|
95260
95506
|
var SPARKSHELL_SPARK_MODEL_ENV = "OMO_SPARKSHELL_SPARK_MODEL";
|
|
95261
95507
|
var SPARKSHELL_SPARK_TIMEOUT_ENV = "OMO_SPARKSHELL_SPARK_TIMEOUT_MS";
|
|
@@ -95329,10 +95575,10 @@ function buildSparkExecArgs(env3, lastMessagePath) {
|
|
|
95329
95575
|
function createDefaultSparkSummarizer(env3, cwd) {
|
|
95330
95576
|
return (request) => {
|
|
95331
95577
|
const binary = env3[SPARKSHELL_SPARK_BIN_ENV]?.trim() || "codex";
|
|
95332
|
-
const tempDir = mkdtempSync(
|
|
95333
|
-
const lastMessagePath =
|
|
95578
|
+
const tempDir = mkdtempSync(join85(tmpdir4(), "omo-sparkshell-spark-"));
|
|
95579
|
+
const lastMessagePath = join85(tempDir, "last-message.txt");
|
|
95334
95580
|
try {
|
|
95335
|
-
const result =
|
|
95581
|
+
const result = spawnSync4(binary, [...buildSparkExecArgs(env3, lastMessagePath)], {
|
|
95336
95582
|
cwd,
|
|
95337
95583
|
env: { ...process.env, ...env3, [SPARKSHELL_SPARK_ENV]: "0" },
|
|
95338
95584
|
input: buildSparkSummaryPrompt(request),
|
|
@@ -95525,7 +95771,7 @@ function resolveNativeBinaryOverride(env3, cwd) {
|
|
|
95525
95771
|
if (override.length === 0) {
|
|
95526
95772
|
return "";
|
|
95527
95773
|
}
|
|
95528
|
-
return
|
|
95774
|
+
return isAbsolute11(override) || /^[A-Za-z]:[\\/]/.test(override) ? override : resolve24(cwd, override);
|
|
95529
95775
|
}
|
|
95530
95776
|
async function runAppServerCommand(args, appServerClient, options) {
|
|
95531
95777
|
let invocation;
|
|
@@ -95637,13 +95883,13 @@ function signalExitCode(signal) {
|
|
|
95637
95883
|
return typeof signalNumber === "number" && Number.isFinite(signalNumber) ? 128 + signalNumber : 1;
|
|
95638
95884
|
}
|
|
95639
95885
|
function defaultCommandExists(command) {
|
|
95640
|
-
const result =
|
|
95886
|
+
const result = spawnSync5(command, ["--version"], {
|
|
95641
95887
|
stdio: "ignore"
|
|
95642
95888
|
});
|
|
95643
95889
|
return result.error === undefined;
|
|
95644
95890
|
}
|
|
95645
95891
|
function defaultSpawn(command, args, options) {
|
|
95646
|
-
const result =
|
|
95892
|
+
const result = spawnSync5(command, [...args], {
|
|
95647
95893
|
cwd: options.cwd,
|
|
95648
95894
|
env: { ...process.env, ...options.env },
|
|
95649
95895
|
stdio: ["inherit", "pipe", "pipe"],
|