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/index.js
CHANGED
|
@@ -2145,7 +2145,7 @@ var package_default;
|
|
|
2145
2145
|
var init_package = __esm(() => {
|
|
2146
2146
|
package_default = {
|
|
2147
2147
|
name: "oh-my-opencode",
|
|
2148
|
-
version: "4.
|
|
2148
|
+
version: "4.13.0",
|
|
2149
2149
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
2150
2150
|
main: "./dist/index.js",
|
|
2151
2151
|
types: "dist/index.d.ts",
|
|
@@ -2226,7 +2226,8 @@ var init_package = __esm(() => {
|
|
|
2226
2226
|
"build:cli-node": "bun run script/build-cli-node.ts",
|
|
2227
2227
|
"build:codex-install": "bun run script/build-codex-install.ts",
|
|
2228
2228
|
"build:codex-plugin": "npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build",
|
|
2229
|
-
"build:
|
|
2229
|
+
"build:materialize-frontend": "node packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs --strict",
|
|
2230
|
+
"build:shared-skills-assets": "bun run build:materialize-frontend && rm -rf dist/skills && cp -R packages/shared-skills/skills dist/skills",
|
|
2230
2231
|
"build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
|
|
2231
2232
|
"build:lsp-daemon": "npm --prefix packages/lsp-daemon ci && npm --prefix packages/lsp-daemon run build",
|
|
2232
2233
|
"build:node-require-shim": "bun run script/patch-node-require-shim.ts",
|
|
@@ -2235,6 +2236,7 @@ var init_package = __esm(() => {
|
|
|
2235
2236
|
"build:schema": "bun run script/build-schema.ts",
|
|
2236
2237
|
"build:model-capabilities": "bun run script/build-model-capabilities.ts",
|
|
2237
2238
|
clean: "rm -rf dist",
|
|
2239
|
+
prepack: "bun run build:materialize-frontend",
|
|
2238
2240
|
prepare: "bun run build",
|
|
2239
2241
|
postinstall: "node postinstall.mjs",
|
|
2240
2242
|
prepublishOnly: "bun run clean && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && bun run build",
|
|
@@ -2315,18 +2317,18 @@ var init_package = __esm(() => {
|
|
|
2315
2317
|
typescript: "^6.0.3"
|
|
2316
2318
|
},
|
|
2317
2319
|
optionalDependencies: {
|
|
2318
|
-
"oh-my-opencode-darwin-arm64": "4.
|
|
2319
|
-
"oh-my-opencode-darwin-x64": "4.
|
|
2320
|
-
"oh-my-opencode-darwin-x64-baseline": "4.
|
|
2321
|
-
"oh-my-opencode-linux-arm64": "4.
|
|
2322
|
-
"oh-my-opencode-linux-arm64-musl": "4.
|
|
2323
|
-
"oh-my-opencode-linux-x64": "4.
|
|
2324
|
-
"oh-my-opencode-linux-x64-baseline": "4.
|
|
2325
|
-
"oh-my-opencode-linux-x64-musl": "4.
|
|
2326
|
-
"oh-my-opencode-linux-x64-musl-baseline": "4.
|
|
2327
|
-
"oh-my-opencode-windows-arm64": "4.
|
|
2328
|
-
"oh-my-opencode-windows-x64": "4.
|
|
2329
|
-
"oh-my-opencode-windows-x64-baseline": "4.
|
|
2320
|
+
"oh-my-opencode-darwin-arm64": "4.13.0",
|
|
2321
|
+
"oh-my-opencode-darwin-x64": "4.13.0",
|
|
2322
|
+
"oh-my-opencode-darwin-x64-baseline": "4.13.0",
|
|
2323
|
+
"oh-my-opencode-linux-arm64": "4.13.0",
|
|
2324
|
+
"oh-my-opencode-linux-arm64-musl": "4.13.0",
|
|
2325
|
+
"oh-my-opencode-linux-x64": "4.13.0",
|
|
2326
|
+
"oh-my-opencode-linux-x64-baseline": "4.13.0",
|
|
2327
|
+
"oh-my-opencode-linux-x64-musl": "4.13.0",
|
|
2328
|
+
"oh-my-opencode-linux-x64-musl-baseline": "4.13.0",
|
|
2329
|
+
"oh-my-opencode-windows-arm64": "4.13.0",
|
|
2330
|
+
"oh-my-opencode-windows-x64": "4.13.0",
|
|
2331
|
+
"oh-my-opencode-windows-x64-baseline": "4.13.0"
|
|
2330
2332
|
},
|
|
2331
2333
|
overrides: {
|
|
2332
2334
|
hono: "^4.12.18",
|
|
@@ -7370,6 +7372,36 @@ var init_classify_path_environment = () => {};
|
|
|
7370
7372
|
|
|
7371
7373
|
// packages/utils/src/codegraph/env.ts
|
|
7372
7374
|
var init_env = () => {};
|
|
7375
|
+
|
|
7376
|
+
// packages/utils/src/codegraph/workspace.ts
|
|
7377
|
+
var init_workspace = () => {};
|
|
7378
|
+
|
|
7379
|
+
// packages/utils/src/codegraph/guidance.ts
|
|
7380
|
+
var init_guidance = __esm(() => {
|
|
7381
|
+
init_workspace();
|
|
7382
|
+
});
|
|
7383
|
+
|
|
7384
|
+
// packages/utils/src/codegraph/node-support.ts
|
|
7385
|
+
function evaluateCodegraphNodeSupport(options = {}) {
|
|
7386
|
+
const nodeVersion = options.nodeVersion ?? process.versions.node;
|
|
7387
|
+
const env = options.env ?? process.env;
|
|
7388
|
+
const override = (env[CODEGRAPH_UNSAFE_NODE_ENV]?.trim().length ?? 0) > 0;
|
|
7389
|
+
const major = parseNodeMajor(nodeVersion);
|
|
7390
|
+
if (major >= CODEGRAPH_BLOCKED_NODE_MAJOR) {
|
|
7391
|
+
return { major, override, reason: "too-new", supported: override };
|
|
7392
|
+
}
|
|
7393
|
+
if (major < CODEGRAPH_MIN_NODE_MAJOR) {
|
|
7394
|
+
return { major, override, reason: "too-old", supported: override };
|
|
7395
|
+
}
|
|
7396
|
+
return { major, override, supported: true };
|
|
7397
|
+
}
|
|
7398
|
+
function parseNodeMajor(version) {
|
|
7399
|
+
const normalized = version.startsWith("v") ? version.slice(1) : version;
|
|
7400
|
+
const major = Number.parseInt(normalized.split(".")[0] ?? "", 10);
|
|
7401
|
+
return Number.isNaN(major) ? 0 : major;
|
|
7402
|
+
}
|
|
7403
|
+
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";
|
|
7404
|
+
|
|
7373
7405
|
// packages/utils/src/codegraph/manifest.ts
|
|
7374
7406
|
var init_manifest = () => {};
|
|
7375
7407
|
|
|
@@ -7383,19 +7415,92 @@ var init_provision = __esm(() => {
|
|
|
7383
7415
|
});
|
|
7384
7416
|
|
|
7385
7417
|
// packages/utils/src/codegraph/resolve.ts
|
|
7418
|
+
import { existsSync as existsSync7 } from "fs";
|
|
7419
|
+
import { spawnSync } from "child_process";
|
|
7420
|
+
import { basename as basename2, dirname as dirname2, join as join7 } from "path";
|
|
7386
7421
|
import { createRequire } from "module";
|
|
7387
|
-
|
|
7422
|
+
function defaultNodeVersion(nodePath) {
|
|
7423
|
+
if (nodePath === process.execPath && isNodeExecutableName(nodePath))
|
|
7424
|
+
return process.versions.node;
|
|
7425
|
+
try {
|
|
7426
|
+
const result = spawnSync(nodePath, ["--version"], {
|
|
7427
|
+
encoding: "utf8",
|
|
7428
|
+
timeout: 2000,
|
|
7429
|
+
windowsHide: true
|
|
7430
|
+
});
|
|
7431
|
+
if (result.error !== undefined || result.status !== 0)
|
|
7432
|
+
return null;
|
|
7433
|
+
const version = `${result.stdout}
|
|
7434
|
+
${result.stderr}`.trim().split(/\s+/)[0];
|
|
7435
|
+
return version === undefined || version.length === 0 ? null : version;
|
|
7436
|
+
} catch (error) {
|
|
7437
|
+
if (error instanceof Error)
|
|
7438
|
+
return null;
|
|
7439
|
+
throw error;
|
|
7440
|
+
}
|
|
7441
|
+
}
|
|
7442
|
+
function isNodeExecutableName(filePath) {
|
|
7443
|
+
const executable = basename2(filePath).toLowerCase();
|
|
7444
|
+
return executable === "node" || executable === "node.exe" || /^node\d+(\.exe)?$/.test(executable);
|
|
7445
|
+
}
|
|
7446
|
+
function looksLikePath(command) {
|
|
7447
|
+
return command.includes("/") || command.includes("\\") || /^[a-zA-Z]:/.test(command);
|
|
7448
|
+
}
|
|
7449
|
+
function resolveConfiguredNodeRuntime(configured, fileExists, which2) {
|
|
7450
|
+
if (looksLikePath(configured))
|
|
7451
|
+
return fileExists(configured) ? configured : null;
|
|
7452
|
+
return which2(configured);
|
|
7453
|
+
}
|
|
7454
|
+
function supportsCodegraphNodeRuntime(nodePath, env, nodeVersion) {
|
|
7455
|
+
const version = nodeVersion(nodePath);
|
|
7456
|
+
if (version === null)
|
|
7457
|
+
return false;
|
|
7458
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: version }).supported;
|
|
7459
|
+
}
|
|
7460
|
+
function defaultNodeRuntime(env, fileExists, which2, nodeVersion) {
|
|
7461
|
+
const configured = env[CODEGRAPH_NODE_BIN_ENV]?.trim();
|
|
7462
|
+
if (configured !== undefined && configured.length > 0) {
|
|
7463
|
+
const resolved = resolveConfiguredNodeRuntime(configured, fileExists, which2);
|
|
7464
|
+
return resolved !== null && supportsCodegraphNodeRuntime(resolved, env, nodeVersion) ? resolved : null;
|
|
7465
|
+
}
|
|
7466
|
+
const candidates = [
|
|
7467
|
+
...isNodeExecutableName(process.execPath) ? [process.execPath] : [],
|
|
7468
|
+
...CODEGRAPH_NODE_CANDIDATES.map((commandName) => which2(commandName)).filter((candidate) => candidate !== null)
|
|
7469
|
+
];
|
|
7470
|
+
const seen = new Set;
|
|
7471
|
+
for (const candidate of candidates) {
|
|
7472
|
+
if (seen.has(candidate))
|
|
7473
|
+
continue;
|
|
7474
|
+
seen.add(candidate);
|
|
7475
|
+
if (supportsCodegraphNodeRuntime(candidate, env, nodeVersion))
|
|
7476
|
+
return candidate;
|
|
7477
|
+
}
|
|
7478
|
+
return null;
|
|
7479
|
+
}
|
|
7480
|
+
function resolveCodegraphNodeRuntime(options = {}) {
|
|
7481
|
+
const env = options.env ?? process.env;
|
|
7482
|
+
return defaultNodeRuntime(env, options.fileExists ?? existsSync7, options.which ?? bunWhich, options.nodeVersion ?? defaultNodeVersion);
|
|
7483
|
+
}
|
|
7484
|
+
function resolveCodegraphNodeSupport(options = {}) {
|
|
7485
|
+
const env = options.env ?? process.env;
|
|
7486
|
+
const nodeVersion = options.nodeVersion ?? defaultNodeVersion;
|
|
7487
|
+
const runtime3 = resolveCodegraphNodeRuntime({ ...options, env, nodeVersion });
|
|
7488
|
+
if (runtime3 === null) {
|
|
7489
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: "0.0.0" });
|
|
7490
|
+
}
|
|
7491
|
+
return evaluateCodegraphNodeSupport({ env, nodeVersion: nodeVersion(runtime3) ?? "0.0.0" });
|
|
7492
|
+
}
|
|
7493
|
+
var CODEGRAPH_NODE_CANDIDATES, requireFromHere;
|
|
7388
7494
|
var init_resolve2 = __esm(() => {
|
|
7389
7495
|
init_which();
|
|
7496
|
+
CODEGRAPH_NODE_CANDIDATES = ["node24", "node22", "node20", "node"];
|
|
7390
7497
|
requireFromHere = createRequire(import.meta.url);
|
|
7391
7498
|
});
|
|
7392
7499
|
|
|
7393
|
-
// packages/utils/src/codegraph/workspace.ts
|
|
7394
|
-
var init_workspace = () => {};
|
|
7395
|
-
|
|
7396
7500
|
// packages/utils/src/codegraph/index.ts
|
|
7397
7501
|
var init_codegraph = __esm(() => {
|
|
7398
7502
|
init_env();
|
|
7503
|
+
init_guidance();
|
|
7399
7504
|
init_provision();
|
|
7400
7505
|
init_resolve2();
|
|
7401
7506
|
init_workspace();
|
|
@@ -9934,6 +10039,11 @@ var init_runtime_fallback_error_classifier = __esm(() => {
|
|
|
9934
10039
|
init_runtime_fallback_error_shape();
|
|
9935
10040
|
});
|
|
9936
10041
|
|
|
10042
|
+
// packages/model-core/src/provider-exhaustion-fallback-policy.ts
|
|
10043
|
+
var init_provider_exhaustion_fallback_policy = __esm(() => {
|
|
10044
|
+
init_runtime_fallback_error_classifier();
|
|
10045
|
+
});
|
|
10046
|
+
|
|
9937
10047
|
// packages/model-core/src/runtime-fallback-model.ts
|
|
9938
10048
|
var init_runtime_fallback_model = __esm(() => {
|
|
9939
10049
|
init_model_string_parser();
|
|
@@ -10362,6 +10472,7 @@ var init_src2 = __esm(() => {
|
|
|
10362
10472
|
init_runtime_fallback_auto_retry_signal();
|
|
10363
10473
|
init_runtime_fallback_error_classifier();
|
|
10364
10474
|
init_runtime_fallback_error_shape();
|
|
10475
|
+
init_provider_exhaustion_fallback_policy();
|
|
10365
10476
|
init_runtime_fallback_model();
|
|
10366
10477
|
init_model_capabilities();
|
|
10367
10478
|
init_context_limit_resolver();
|
|
@@ -10973,9 +11084,9 @@ var init_migration2 = __esm(() => {
|
|
|
10973
11084
|
});
|
|
10974
11085
|
|
|
10975
11086
|
// packages/omo-opencode/src/shared/opencode-config-dir.ts
|
|
10976
|
-
import { existsSync as
|
|
11087
|
+
import { existsSync as existsSync9, realpathSync as realpathSync3 } from "fs";
|
|
10977
11088
|
import { homedir as homedir3 } from "os";
|
|
10978
|
-
import { join as
|
|
11089
|
+
import { join as join9, posix, resolve as resolve4, win32 } from "path";
|
|
10979
11090
|
function isDevBuild(version) {
|
|
10980
11091
|
if (!version)
|
|
10981
11092
|
return false;
|
|
@@ -10985,15 +11096,15 @@ function getTauriConfigDir(identifier) {
|
|
|
10985
11096
|
const platform = process.platform;
|
|
10986
11097
|
switch (platform) {
|
|
10987
11098
|
case "darwin":
|
|
10988
|
-
return
|
|
11099
|
+
return join9(homedir3(), "Library", "Application Support", identifier);
|
|
10989
11100
|
case "win32": {
|
|
10990
|
-
const appData = process.env.APPDATA ||
|
|
11101
|
+
const appData = process.env.APPDATA || join9(homedir3(), "AppData", "Roaming");
|
|
10991
11102
|
return win32.join(appData, identifier);
|
|
10992
11103
|
}
|
|
10993
11104
|
case "linux":
|
|
10994
11105
|
default: {
|
|
10995
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME ||
|
|
10996
|
-
return
|
|
11106
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join9(homedir3(), ".config");
|
|
11107
|
+
return join9(xdgConfig, identifier);
|
|
10997
11108
|
}
|
|
10998
11109
|
}
|
|
10999
11110
|
}
|
|
@@ -11002,7 +11113,7 @@ function resolveConfigPath(pathValue) {
|
|
|
11002
11113
|
return posix.normalize(pathValue);
|
|
11003
11114
|
}
|
|
11004
11115
|
const resolvedPath = resolve4(pathValue);
|
|
11005
|
-
if (!
|
|
11116
|
+
if (!existsSync9(resolvedPath))
|
|
11006
11117
|
return resolvedPath;
|
|
11007
11118
|
try {
|
|
11008
11119
|
return realpathSync3(resolvedPath);
|
|
@@ -11036,8 +11147,8 @@ function getWslLinuxHomeDir(windowsConfigRoot) {
|
|
|
11036
11147
|
function getCliDefaultConfigDir() {
|
|
11037
11148
|
const envXdgConfig = process.env.XDG_CONFIG_HOME?.trim();
|
|
11038
11149
|
const shouldIgnoreWindowsXdg = envXdgConfig !== undefined && envXdgConfig.length > 0 && isWslEnvironment() && isWindowsUserConfigRoot(envXdgConfig);
|
|
11039
|
-
const xdgConfig = shouldIgnoreWindowsXdg ? posix.join(getWslLinuxHomeDir(envXdgConfig) ?? "/home", ".config") : envXdgConfig ||
|
|
11040
|
-
const configDir = isWslEnvironment() ? posix.join(xdgConfig, "opencode") :
|
|
11150
|
+
const xdgConfig = shouldIgnoreWindowsXdg ? posix.join(getWslLinuxHomeDir(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join9(homedir3(), ".config");
|
|
11151
|
+
const configDir = isWslEnvironment() ? posix.join(xdgConfig, "opencode") : join9(xdgConfig, "opencode");
|
|
11041
11152
|
return resolveConfigPath(configDir);
|
|
11042
11153
|
}
|
|
11043
11154
|
function getCliCustomConfigDir() {
|
|
@@ -11070,9 +11181,9 @@ function getOpenCodeConfigDir(options) {
|
|
|
11070
11181
|
const tauriDir = process.platform === "win32" ? win32.isAbsolute(tauriDirBase) ? win32.normalize(tauriDirBase) : win32.resolve(tauriDirBase) : resolveConfigPath(tauriDirBase);
|
|
11071
11182
|
if (checkExisting) {
|
|
11072
11183
|
const legacyDir = getCliConfigDir();
|
|
11073
|
-
const legacyConfig =
|
|
11074
|
-
const legacyConfigC =
|
|
11075
|
-
if (
|
|
11184
|
+
const legacyConfig = join9(legacyDir, "opencode.json");
|
|
11185
|
+
const legacyConfigC = join9(legacyDir, "opencode.jsonc");
|
|
11186
|
+
if (existsSync9(legacyConfig) || existsSync9(legacyConfigC)) {
|
|
11076
11187
|
return legacyDir;
|
|
11077
11188
|
}
|
|
11078
11189
|
}
|
|
@@ -11082,10 +11193,10 @@ function getOpenCodeConfigPaths(options) {
|
|
|
11082
11193
|
const configDir = getOpenCodeConfigDir(options);
|
|
11083
11194
|
return {
|
|
11084
11195
|
configDir,
|
|
11085
|
-
configJson:
|
|
11086
|
-
configJsonc:
|
|
11087
|
-
packageJson:
|
|
11088
|
-
omoConfig:
|
|
11196
|
+
configJson: join9(configDir, "opencode.json"),
|
|
11197
|
+
configJsonc: join9(configDir, "opencode.jsonc"),
|
|
11198
|
+
packageJson: join9(configDir, "package.json"),
|
|
11199
|
+
omoConfig: join9(configDir, `${CONFIG_BASENAME}.json`)
|
|
11089
11200
|
};
|
|
11090
11201
|
}
|
|
11091
11202
|
var TAURI_APP_IDENTIFIER = "ai.opencode.desktop", TAURI_APP_IDENTIFIER_DEV = "ai.opencode.desktop.dev";
|
|
@@ -11095,10 +11206,10 @@ var init_opencode_config_dir = __esm(() => {
|
|
|
11095
11206
|
|
|
11096
11207
|
// packages/omo-opencode/src/shared/resolve-agent-definition-paths.ts
|
|
11097
11208
|
import { homedir as homedir4 } from "os";
|
|
11098
|
-
import { isAbsolute as isAbsolute2, join as
|
|
11209
|
+
import { isAbsolute as isAbsolute2, join as join10, resolve as resolve5 } from "path";
|
|
11099
11210
|
function resolveAgentDefinitionPaths(paths, baseDir, containmentDir) {
|
|
11100
11211
|
return paths.flatMap((p) => {
|
|
11101
|
-
const expanded = p.startsWith("~/") ?
|
|
11212
|
+
const expanded = p.startsWith("~/") ? join10(homedir4(), p.slice(2)) : p;
|
|
11102
11213
|
const resolved = isAbsolute2(expanded) ? expanded : resolve5(baseDir, expanded);
|
|
11103
11214
|
if (containmentDir !== null && !isWithinProject(resolved, containmentDir)) {
|
|
11104
11215
|
log2(`agent_definitions path rejected (outside project boundary): ${p} -> ${resolved}`);
|
|
@@ -11114,8 +11225,8 @@ var init_resolve_agent_definition_paths = __esm(() => {
|
|
|
11114
11225
|
|
|
11115
11226
|
// packages/omo-opencode/src/shared/opencode-version.ts
|
|
11116
11227
|
import { execSync } from "child_process";
|
|
11117
|
-
import { existsSync as
|
|
11118
|
-
import { dirname as
|
|
11228
|
+
import { existsSync as existsSync10, readFileSync as readFileSync4, realpathSync as realpathSync4 } from "fs";
|
|
11229
|
+
import { dirname as dirname4, join as join11 } from "path";
|
|
11119
11230
|
function parseVersion(version) {
|
|
11120
11231
|
const cleaned = version.replace(/^v/, "").split("-")[0];
|
|
11121
11232
|
return cleaned.split(".").map((n) => parseInt(n, 10) || 0);
|
|
@@ -11156,7 +11267,7 @@ function parsePackageVersion(content) {
|
|
|
11156
11267
|
function getPackageVersionFromBinary(binaryPath, deps) {
|
|
11157
11268
|
try {
|
|
11158
11269
|
const realBinaryPath = deps.realpath(binaryPath);
|
|
11159
|
-
const packagePath =
|
|
11270
|
+
const packagePath = join11(dirname4(dirname4(realBinaryPath)), "package.json");
|
|
11160
11271
|
if (!deps.exists(packagePath))
|
|
11161
11272
|
return null;
|
|
11162
11273
|
return parsePackageVersion(deps.readText(packagePath));
|
|
@@ -11216,15 +11327,15 @@ var init_opencode_version = __esm(() => {
|
|
|
11216
11327
|
return envPath;
|
|
11217
11328
|
return globalThis.Bun?.which("opencode") ?? null;
|
|
11218
11329
|
},
|
|
11219
|
-
exists:
|
|
11330
|
+
exists: existsSync10,
|
|
11220
11331
|
realpath: realpathSync4,
|
|
11221
11332
|
readText: (filePath) => readFileSync4(filePath, "utf-8")
|
|
11222
11333
|
};
|
|
11223
11334
|
});
|
|
11224
11335
|
|
|
11225
11336
|
// packages/omo-opencode/src/shared/opencode-storage-detection.ts
|
|
11226
|
-
import { existsSync as
|
|
11227
|
-
import { join as
|
|
11337
|
+
import { existsSync as existsSync11 } from "fs";
|
|
11338
|
+
import { join as join12 } from "path";
|
|
11228
11339
|
function isSqliteBackend() {
|
|
11229
11340
|
if (cachedResult === true)
|
|
11230
11341
|
return true;
|
|
@@ -11232,8 +11343,8 @@ function isSqliteBackend() {
|
|
|
11232
11343
|
return false;
|
|
11233
11344
|
const check = () => {
|
|
11234
11345
|
const versionOk = isOpenCodeVersionAtLeast(OPENCODE_SQLITE_VERSION);
|
|
11235
|
-
const dbPath =
|
|
11236
|
-
return versionOk &&
|
|
11346
|
+
const dbPath = join12(getDataDir(), "opencode", "opencode.db");
|
|
11347
|
+
return versionOk && existsSync11(dbPath);
|
|
11237
11348
|
};
|
|
11238
11349
|
if (cachedResult === FALSE_PENDING_RETRY) {
|
|
11239
11350
|
const result2 = check();
|
|
@@ -11302,11 +11413,11 @@ var init_bun_file_shim = __esm(() => {
|
|
|
11302
11413
|
});
|
|
11303
11414
|
|
|
11304
11415
|
// packages/omo-opencode/src/shared/binary-downloader.ts
|
|
11305
|
-
import { chmodSync, existsSync as
|
|
11416
|
+
import { chmodSync, existsSync as existsSync12, mkdirSync as mkdirSync4, unlinkSync as unlinkSync3 } from "fs";
|
|
11306
11417
|
import * as path6 from "path";
|
|
11307
11418
|
function getCachedBinaryPath(cacheDir, binaryName) {
|
|
11308
11419
|
const binaryPath = path6.join(cacheDir, binaryName);
|
|
11309
|
-
return
|
|
11420
|
+
return existsSync12(binaryPath) ? binaryPath : null;
|
|
11310
11421
|
}
|
|
11311
11422
|
var init_binary_downloader = __esm(() => {
|
|
11312
11423
|
init_bun_spawn_shim();
|
|
@@ -11474,8 +11585,8 @@ var init_agent_tool_restrictions = __esm(() => {
|
|
|
11474
11585
|
});
|
|
11475
11586
|
|
|
11476
11587
|
// packages/omo-opencode/src/shared/json-file-cache-store.ts
|
|
11477
|
-
import { existsSync as
|
|
11478
|
-
import { join as
|
|
11588
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync5, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
11589
|
+
import { join as join14 } from "path";
|
|
11479
11590
|
function toLogLabel(cacheLabel) {
|
|
11480
11591
|
return cacheLabel.toLowerCase();
|
|
11481
11592
|
}
|
|
@@ -11483,11 +11594,11 @@ function createJsonFileCacheStore(options) {
|
|
|
11483
11594
|
let memoryValue;
|
|
11484
11595
|
let writtenInCurrentProcess = false;
|
|
11485
11596
|
function getCacheFilePath() {
|
|
11486
|
-
return
|
|
11597
|
+
return join14(options.getCacheDir(), options.filename);
|
|
11487
11598
|
}
|
|
11488
11599
|
function ensureCacheDir() {
|
|
11489
11600
|
const cacheDir = options.getCacheDir();
|
|
11490
|
-
if (!
|
|
11601
|
+
if (!existsSync13(cacheDir)) {
|
|
11491
11602
|
mkdirSync5(cacheDir, { recursive: true });
|
|
11492
11603
|
}
|
|
11493
11604
|
}
|
|
@@ -11496,7 +11607,7 @@ function createJsonFileCacheStore(options) {
|
|
|
11496
11607
|
return memoryValue;
|
|
11497
11608
|
}
|
|
11498
11609
|
const cacheFile = getCacheFilePath();
|
|
11499
|
-
if (!
|
|
11610
|
+
if (!existsSync13(cacheFile)) {
|
|
11500
11611
|
memoryValue = null;
|
|
11501
11612
|
log2(`[${options.logPrefix}] ${options.cacheLabel} file not found`, { cacheFile });
|
|
11502
11613
|
return null;
|
|
@@ -11522,7 +11633,7 @@ function createJsonFileCacheStore(options) {
|
|
|
11522
11633
|
if (writtenInCurrentProcess) {
|
|
11523
11634
|
return true;
|
|
11524
11635
|
}
|
|
11525
|
-
return
|
|
11636
|
+
return existsSync13(getCacheFilePath());
|
|
11526
11637
|
}
|
|
11527
11638
|
function write(value) {
|
|
11528
11639
|
ensureCacheDir();
|
|
@@ -11765,14 +11876,14 @@ var init_model_resolution_pipeline2 = __esm(() => {
|
|
|
11765
11876
|
});
|
|
11766
11877
|
|
|
11767
11878
|
// packages/omo-opencode/src/shared/model-availability.ts
|
|
11768
|
-
import { existsSync as
|
|
11769
|
-
import { join as
|
|
11879
|
+
import { existsSync as existsSync14, readFileSync as readFileSync6 } from "fs";
|
|
11880
|
+
import { join as join15 } from "path";
|
|
11770
11881
|
function isModelCacheAvailable() {
|
|
11771
11882
|
if (hasProviderModelsCache()) {
|
|
11772
11883
|
return true;
|
|
11773
11884
|
}
|
|
11774
|
-
const cacheFile =
|
|
11775
|
-
return
|
|
11885
|
+
const cacheFile = join15(getOpenCodeCacheDir(), "models.json");
|
|
11886
|
+
return existsSync14(cacheFile);
|
|
11776
11887
|
}
|
|
11777
11888
|
var init_model_availability = __esm(() => {
|
|
11778
11889
|
init_logger2();
|
|
@@ -54196,19 +54307,19 @@ var init_fallback_model_availability = __esm(() => {
|
|
|
54196
54307
|
});
|
|
54197
54308
|
|
|
54198
54309
|
// packages/omo-opencode/src/shared/opencode-storage-paths.ts
|
|
54199
|
-
import { join as
|
|
54310
|
+
import { join as join16 } from "path";
|
|
54200
54311
|
var OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE, SESSION_STORAGE;
|
|
54201
54312
|
var init_opencode_storage_paths = __esm(() => {
|
|
54202
54313
|
init_data_path();
|
|
54203
54314
|
OPENCODE_STORAGE = getOpenCodeStorageDir();
|
|
54204
|
-
MESSAGE_STORAGE =
|
|
54205
|
-
PART_STORAGE =
|
|
54206
|
-
SESSION_STORAGE =
|
|
54315
|
+
MESSAGE_STORAGE = join16(OPENCODE_STORAGE, "message");
|
|
54316
|
+
PART_STORAGE = join16(OPENCODE_STORAGE, "part");
|
|
54317
|
+
SESSION_STORAGE = join16(OPENCODE_STORAGE, "session");
|
|
54207
54318
|
});
|
|
54208
54319
|
|
|
54209
54320
|
// packages/omo-opencode/src/shared/compaction-marker.ts
|
|
54210
|
-
import { existsSync as
|
|
54211
|
-
import { join as
|
|
54321
|
+
import { existsSync as existsSync15, readdirSync, readFileSync as readFileSync7 } from "fs";
|
|
54322
|
+
import { join as join17 } from "path";
|
|
54212
54323
|
function isCompactionPart(part) {
|
|
54213
54324
|
return typeof part === "object" && part !== null && part.type === "compaction";
|
|
54214
54325
|
}
|
|
@@ -54222,20 +54333,20 @@ function isCompactionMessage(message) {
|
|
|
54222
54333
|
return isCompactionAgent(message.info?.agent ?? message.agent) || hasCompactionPart(message.parts);
|
|
54223
54334
|
}
|
|
54224
54335
|
function getCompactionPartStorageDir(messageID) {
|
|
54225
|
-
return
|
|
54336
|
+
return join17(PART_STORAGE, messageID);
|
|
54226
54337
|
}
|
|
54227
54338
|
function hasCompactionPartInStorage(messageID) {
|
|
54228
54339
|
if (!messageID) {
|
|
54229
54340
|
return false;
|
|
54230
54341
|
}
|
|
54231
54342
|
const partDir = getCompactionPartStorageDir(messageID);
|
|
54232
|
-
if (!
|
|
54343
|
+
if (!existsSync15(partDir)) {
|
|
54233
54344
|
return false;
|
|
54234
54345
|
}
|
|
54235
54346
|
try {
|
|
54236
54347
|
return readdirSync(partDir).filter((fileName) => fileName.endsWith(".json")).some((fileName) => {
|
|
54237
54348
|
try {
|
|
54238
|
-
const content = readFileSync7(
|
|
54349
|
+
const content = readFileSync7(join17(partDir, fileName), "utf-8");
|
|
54239
54350
|
return isCompactionPart(JSON.parse(content));
|
|
54240
54351
|
} catch (error) {
|
|
54241
54352
|
if (error instanceof Error) {
|
|
@@ -54335,23 +54446,23 @@ var init_hook_message_injector = __esm(() => {
|
|
|
54335
54446
|
});
|
|
54336
54447
|
|
|
54337
54448
|
// packages/omo-opencode/src/shared/opencode-message-dir.ts
|
|
54338
|
-
import { existsSync as
|
|
54339
|
-
import { join as
|
|
54449
|
+
import { existsSync as existsSync16, readdirSync as readdirSync2 } from "fs";
|
|
54450
|
+
import { join as join18 } from "path";
|
|
54340
54451
|
function getMessageDir(sessionID) {
|
|
54341
54452
|
if (!sessionID.startsWith("ses_"))
|
|
54342
54453
|
return null;
|
|
54343
54454
|
if (/[/\\]|\.\./.test(sessionID))
|
|
54344
54455
|
return null;
|
|
54345
|
-
if (!
|
|
54456
|
+
if (!existsSync16(MESSAGE_STORAGE))
|
|
54346
54457
|
return null;
|
|
54347
|
-
const directPath =
|
|
54348
|
-
if (
|
|
54458
|
+
const directPath = join18(MESSAGE_STORAGE, sessionID);
|
|
54459
|
+
if (existsSync16(directPath)) {
|
|
54349
54460
|
return directPath;
|
|
54350
54461
|
}
|
|
54351
54462
|
try {
|
|
54352
54463
|
for (const dir of readdirSync2(MESSAGE_STORAGE)) {
|
|
54353
|
-
const sessionPath =
|
|
54354
|
-
if (
|
|
54464
|
+
const sessionPath = join18(MESSAGE_STORAGE, dir, sessionID);
|
|
54465
|
+
if (existsSync16(sessionPath)) {
|
|
54355
54466
|
return sessionPath;
|
|
54356
54467
|
}
|
|
54357
54468
|
}
|
|
@@ -56485,7 +56596,7 @@ var require_cross_spawn = __commonJS((exports, module) => {
|
|
|
56485
56596
|
enoent.hookChildProcess(spawned, parsed);
|
|
56486
56597
|
return spawned;
|
|
56487
56598
|
}
|
|
56488
|
-
function
|
|
56599
|
+
function spawnSync3(command, args, options) {
|
|
56489
56600
|
const parsed = parse3(command, args, options);
|
|
56490
56601
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
56491
56602
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
@@ -56493,18 +56604,18 @@ var require_cross_spawn = __commonJS((exports, module) => {
|
|
|
56493
56604
|
}
|
|
56494
56605
|
module.exports = spawn4;
|
|
56495
56606
|
module.exports.spawn = spawn4;
|
|
56496
|
-
module.exports.sync =
|
|
56607
|
+
module.exports.sync = spawnSync3;
|
|
56497
56608
|
module.exports._parse = parse3;
|
|
56498
56609
|
module.exports._enoent = enoent;
|
|
56499
56610
|
});
|
|
56500
56611
|
|
|
56501
56612
|
// node_modules/.bun/@opencode-ai+sdk@1.15.13/node_modules/@opencode-ai/sdk/dist/process.js
|
|
56502
|
-
import { spawnSync as
|
|
56613
|
+
import { spawnSync as spawnSync3 } from "child_process";
|
|
56503
56614
|
function stop(proc) {
|
|
56504
56615
|
if (proc.exitCode !== null || proc.signalCode !== null)
|
|
56505
56616
|
return;
|
|
56506
56617
|
if (process.platform === "win32" && proc.pid) {
|
|
56507
|
-
const out =
|
|
56618
|
+
const out = spawnSync3("taskkill", ["/pid", String(proc.pid), "/T", "/F"], { windowsHide: true });
|
|
56508
56619
|
if (!out.error && out.status === 0)
|
|
56509
56620
|
return;
|
|
56510
56621
|
}
|
|
@@ -57011,11 +57122,11 @@ var init_opencode_command_dirs = __esm(() => {
|
|
|
57011
57122
|
});
|
|
57012
57123
|
|
|
57013
57124
|
// packages/omo-opencode/src/shared/project-discovery-dirs.ts
|
|
57014
|
-
import { existsSync as
|
|
57015
|
-
import { dirname as
|
|
57125
|
+
import { existsSync as existsSync17, realpathSync as realpathSync5 } from "fs";
|
|
57126
|
+
import { dirname as dirname5, join as join19, resolve as resolve6, win32 as win322 } from "path";
|
|
57016
57127
|
function normalizePath(path7) {
|
|
57017
57128
|
const resolvedPath = process.platform !== "win32" && win322.isAbsolute(path7) ? path7 : resolve6(path7);
|
|
57018
|
-
if (!
|
|
57129
|
+
if (!existsSync17(resolvedPath)) {
|
|
57019
57130
|
return resolvedPath;
|
|
57020
57131
|
}
|
|
57021
57132
|
try {
|
|
@@ -57045,8 +57156,8 @@ function findProjectOpencodePluginConfigFiles(startDirectory, stopDirectory) {
|
|
|
57045
57156
|
const resolvedStopDirectory = stopDirectory ? normalizePath(stopDirectory) : undefined;
|
|
57046
57157
|
const stopDirectoryKey = resolvedStopDirectory ? pathKey(resolvedStopDirectory) : undefined;
|
|
57047
57158
|
while (true) {
|
|
57048
|
-
const opencodeDirectory =
|
|
57049
|
-
if (
|
|
57159
|
+
const opencodeDirectory = join19(currentDirectory, ".opencode");
|
|
57160
|
+
if (existsSync17(opencodeDirectory)) {
|
|
57050
57161
|
const detected = detectPluginConfigFile(opencodeDirectory, {
|
|
57051
57162
|
basenames: [CONFIG_BASENAME],
|
|
57052
57163
|
legacyBasenames: [LEGACY_CONFIG_BASENAME]
|
|
@@ -57062,7 +57173,7 @@ function findProjectOpencodePluginConfigFiles(startDirectory, stopDirectory) {
|
|
|
57062
57173
|
if (stopDirectoryKey === pathKey(currentDirectory)) {
|
|
57063
57174
|
return paths;
|
|
57064
57175
|
}
|
|
57065
|
-
const parentDirectory =
|
|
57176
|
+
const parentDirectory = dirname5(currentDirectory);
|
|
57066
57177
|
if (parentDirectory === currentDirectory) {
|
|
57067
57178
|
return paths;
|
|
57068
57179
|
}
|
|
@@ -57548,17 +57659,17 @@ var init_plugin_name_with_version = __esm(() => {
|
|
|
57548
57659
|
});
|
|
57549
57660
|
|
|
57550
57661
|
// packages/omo-opencode/src/cli/config-manager/backup-config.ts
|
|
57551
|
-
import { copyFileSync as copyFileSync2, existsSync as
|
|
57552
|
-
import { dirname as
|
|
57662
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync18, mkdirSync as mkdirSync6 } from "fs";
|
|
57663
|
+
import { dirname as dirname6 } from "path";
|
|
57553
57664
|
function backupConfigFile(configPath) {
|
|
57554
|
-
if (!
|
|
57665
|
+
if (!existsSync18(configPath)) {
|
|
57555
57666
|
return { success: true };
|
|
57556
57667
|
}
|
|
57557
57668
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
57558
57669
|
const backupPath = `${configPath}.backup-${timestamp}`;
|
|
57559
57670
|
try {
|
|
57560
|
-
const dir =
|
|
57561
|
-
if (!
|
|
57671
|
+
const dir = dirname6(backupPath);
|
|
57672
|
+
if (!existsSync18(dir)) {
|
|
57562
57673
|
mkdirSync6(dir, { recursive: true });
|
|
57563
57674
|
}
|
|
57564
57675
|
copyFileSync2(configPath, backupPath);
|
|
@@ -57573,10 +57684,10 @@ function backupConfigFile(configPath) {
|
|
|
57573
57684
|
var init_backup_config = () => {};
|
|
57574
57685
|
|
|
57575
57686
|
// packages/omo-opencode/src/cli/config-manager/ensure-config-directory-exists.ts
|
|
57576
|
-
import { existsSync as
|
|
57687
|
+
import { existsSync as existsSync19, mkdirSync as mkdirSync7 } from "fs";
|
|
57577
57688
|
function ensureConfigDirectoryExists() {
|
|
57578
57689
|
const configDir = getConfigDir();
|
|
57579
|
-
if (!
|
|
57690
|
+
if (!existsSync19(configDir)) {
|
|
57580
57691
|
mkdirSync7(configDir, { recursive: true });
|
|
57581
57692
|
}
|
|
57582
57693
|
}
|
|
@@ -57614,14 +57725,14 @@ function formatErrorWithSuggestion(err, context) {
|
|
|
57614
57725
|
}
|
|
57615
57726
|
|
|
57616
57727
|
// packages/omo-opencode/src/cli/config-manager/opencode-config-format.ts
|
|
57617
|
-
import { existsSync as
|
|
57728
|
+
import { existsSync as existsSync20 } from "fs";
|
|
57618
57729
|
function detectConfigFormat() {
|
|
57619
57730
|
const configJsonc = getConfigJsonc();
|
|
57620
57731
|
const configJson = getConfigJson();
|
|
57621
|
-
if (
|
|
57732
|
+
if (existsSync20(configJsonc)) {
|
|
57622
57733
|
return { format: "jsonc", path: configJsonc };
|
|
57623
57734
|
}
|
|
57624
|
-
if (
|
|
57735
|
+
if (existsSync20(configJson)) {
|
|
57625
57736
|
return { format: "json", path: configJson };
|
|
57626
57737
|
}
|
|
57627
57738
|
return { format: "none", path: configJson };
|
|
@@ -57754,30 +57865,30 @@ function extractVersionFromPluginEntry(entry) {
|
|
|
57754
57865
|
}
|
|
57755
57866
|
|
|
57756
57867
|
// packages/omo-opencode/src/cli/config-manager/add-plugin-to-opencode-config.ts
|
|
57757
|
-
import { existsSync as
|
|
57758
|
-
import { basename as
|
|
57868
|
+
import { existsSync as existsSync21, readdirSync as readdirSync3, readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "fs";
|
|
57869
|
+
import { basename as basename3, dirname as dirname7, join as join20 } from "path";
|
|
57759
57870
|
function detectConfigFormatInDir(configDir) {
|
|
57760
|
-
const configJsonc =
|
|
57761
|
-
const configJson =
|
|
57762
|
-
if (
|
|
57871
|
+
const configJsonc = join20(configDir, "opencode.jsonc");
|
|
57872
|
+
const configJson = join20(configDir, "opencode.json");
|
|
57873
|
+
if (existsSync21(configJsonc)) {
|
|
57763
57874
|
return { format: "jsonc", path: configJsonc };
|
|
57764
57875
|
}
|
|
57765
|
-
if (
|
|
57876
|
+
if (existsSync21(configJson)) {
|
|
57766
57877
|
return { format: "json", path: configJson };
|
|
57767
57878
|
}
|
|
57768
57879
|
return { format: "none", path: configJson };
|
|
57769
57880
|
}
|
|
57770
57881
|
function getParentConfigDirForProfile(configDir) {
|
|
57771
|
-
const parentDir =
|
|
57772
|
-
if (
|
|
57882
|
+
const parentDir = dirname7(configDir);
|
|
57883
|
+
if (basename3(parentDir) !== "profiles")
|
|
57773
57884
|
return null;
|
|
57774
|
-
return
|
|
57885
|
+
return dirname7(parentDir);
|
|
57775
57886
|
}
|
|
57776
57887
|
function listProfileConfigDirs(rootConfigDir) {
|
|
57777
|
-
const profilesDir =
|
|
57778
|
-
if (!
|
|
57888
|
+
const profilesDir = join20(rootConfigDir, "profiles");
|
|
57889
|
+
if (!existsSync21(profilesDir))
|
|
57779
57890
|
return [];
|
|
57780
|
-
return readdirSync3(profilesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) =>
|
|
57891
|
+
return readdirSync3(profilesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join20(profilesDir, entry.name)).filter((profileDir) => detectConfigFormatInDir(profileDir).format !== "none");
|
|
57781
57892
|
}
|
|
57782
57893
|
function getConfigTargets() {
|
|
57783
57894
|
const primaryConfigDir = getConfigDir();
|
|
@@ -58277,12 +58388,12 @@ var init_migrations_sidecar2 = __esm(() => {
|
|
|
58277
58388
|
});
|
|
58278
58389
|
|
|
58279
58390
|
// packages/omo-opencode/src/shared/migrate-legacy-config-file.ts
|
|
58280
|
-
import { existsSync as
|
|
58281
|
-
import { join as
|
|
58391
|
+
import { existsSync as existsSync22, readFileSync as readFileSync10, renameSync as renameSync4, rmSync } from "fs";
|
|
58392
|
+
import { join as join21, dirname as dirname8, basename as basename4 } from "path";
|
|
58282
58393
|
function buildCanonicalPath(legacyPath) {
|
|
58283
|
-
const dir =
|
|
58284
|
-
const ext =
|
|
58285
|
-
return
|
|
58394
|
+
const dir = dirname8(legacyPath);
|
|
58395
|
+
const ext = basename4(legacyPath).includes(".jsonc") ? ".jsonc" : ".json";
|
|
58396
|
+
return join21(dir, `${CONFIG_BASENAME}${ext}`);
|
|
58286
58397
|
}
|
|
58287
58398
|
function archiveLegacyConfigFile(legacyPath) {
|
|
58288
58399
|
const backupPath = `${legacyPath}.bak`;
|
|
@@ -58315,10 +58426,10 @@ function archiveLegacyConfigFile(legacyPath) {
|
|
|
58315
58426
|
}
|
|
58316
58427
|
function migrateLegacySidecarFile(legacyPath, canonicalPath) {
|
|
58317
58428
|
const legacySidecarPath = getSidecarPath(legacyPath);
|
|
58318
|
-
if (!
|
|
58429
|
+
if (!existsSync22(legacySidecarPath))
|
|
58319
58430
|
return true;
|
|
58320
58431
|
const canonicalSidecarPath = getSidecarPath(canonicalPath);
|
|
58321
|
-
if (
|
|
58432
|
+
if (existsSync22(canonicalSidecarPath))
|
|
58322
58433
|
return true;
|
|
58323
58434
|
try {
|
|
58324
58435
|
const content = readFileSync10(legacySidecarPath, "utf-8");
|
|
@@ -58338,12 +58449,12 @@ function migrateLegacySidecarFile(legacyPath, canonicalPath) {
|
|
|
58338
58449
|
}
|
|
58339
58450
|
}
|
|
58340
58451
|
function migrateLegacyConfigFile(legacyPath) {
|
|
58341
|
-
if (!
|
|
58452
|
+
if (!existsSync22(legacyPath))
|
|
58342
58453
|
return false;
|
|
58343
|
-
if (!
|
|
58454
|
+
if (!basename4(legacyPath).startsWith(LEGACY_CONFIG_BASENAME))
|
|
58344
58455
|
return false;
|
|
58345
58456
|
const canonicalPath = buildCanonicalPath(legacyPath);
|
|
58346
|
-
if (
|
|
58457
|
+
if (existsSync22(canonicalPath))
|
|
58347
58458
|
return false;
|
|
58348
58459
|
try {
|
|
58349
58460
|
const content = readFileSync10(legacyPath, "utf-8");
|
|
@@ -58387,8 +58498,8 @@ function deepMergeRecord(target, source) {
|
|
|
58387
58498
|
}
|
|
58388
58499
|
|
|
58389
58500
|
// packages/omo-opencode/src/cli/config-manager/write-omo-config.ts
|
|
58390
|
-
import { existsSync as
|
|
58391
|
-
import { basename as
|
|
58501
|
+
import { existsSync as existsSync23, readFileSync as readFileSync11, statSync as statSync4, writeFileSync as writeFileSync5 } from "fs";
|
|
58502
|
+
import { basename as basename5, dirname as dirname9, extname, join as join22 } from "path";
|
|
58392
58503
|
function isEmptyOrWhitespace2(content) {
|
|
58393
58504
|
return content.trim().length === 0;
|
|
58394
58505
|
}
|
|
@@ -58403,12 +58514,12 @@ function writeOmoConfig(installConfig) {
|
|
|
58403
58514
|
};
|
|
58404
58515
|
}
|
|
58405
58516
|
const detectedConfigPath = getOmoConfigPath();
|
|
58406
|
-
const canonicalConfigPath =
|
|
58407
|
-
const shouldMigrateLegacyPath =
|
|
58408
|
-
const omoConfigPath = shouldMigrateLegacyPath ? migrateLegacyConfigFile(detectedConfigPath) ||
|
|
58517
|
+
const canonicalConfigPath = join22(dirname9(detectedConfigPath), `${CONFIG_BASENAME}${extname(detectedConfigPath) || ".json"}`);
|
|
58518
|
+
const shouldMigrateLegacyPath = basename5(detectedConfigPath).startsWith(LEGACY_CONFIG_BASENAME);
|
|
58519
|
+
const omoConfigPath = shouldMigrateLegacyPath ? migrateLegacyConfigFile(detectedConfigPath) || existsSync23(canonicalConfigPath) ? canonicalConfigPath : detectedConfigPath : detectedConfigPath;
|
|
58409
58520
|
try {
|
|
58410
58521
|
const newConfig = generateOmoConfig(installConfig);
|
|
58411
|
-
if (
|
|
58522
|
+
if (existsSync23(omoConfigPath)) {
|
|
58412
58523
|
const backupResult = backupConfigFile(omoConfigPath);
|
|
58413
58524
|
if (!backupResult.success) {
|
|
58414
58525
|
return {
|
|
@@ -58625,10 +58736,10 @@ var init_opencode_binary = __esm(() => {
|
|
|
58625
58736
|
});
|
|
58626
58737
|
|
|
58627
58738
|
// packages/omo-opencode/src/cli/config-manager/detect-current-config.ts
|
|
58628
|
-
import { existsSync as
|
|
58739
|
+
import { existsSync as existsSync24, readFileSync as readFileSync12 } from "fs";
|
|
58629
58740
|
function detectProvidersFromOmoConfig() {
|
|
58630
58741
|
const omoConfigPath = getOmoConfigPath();
|
|
58631
|
-
if (!
|
|
58742
|
+
if (!existsSync24(omoConfigPath)) {
|
|
58632
58743
|
return {
|
|
58633
58744
|
hasOpenAI: true,
|
|
58634
58745
|
hasOpencodeZen: true,
|
|
@@ -58780,10 +58891,10 @@ var init_detect_current_config = __esm(() => {
|
|
|
58780
58891
|
});
|
|
58781
58892
|
|
|
58782
58893
|
// packages/omo-opencode/src/cli/config-manager/bun-install.ts
|
|
58783
|
-
import { existsSync as
|
|
58784
|
-
import { join as
|
|
58894
|
+
import { existsSync as existsSync25 } from "fs";
|
|
58895
|
+
import { join as join23 } from "path";
|
|
58785
58896
|
function getDefaultWorkspaceDir() {
|
|
58786
|
-
return
|
|
58897
|
+
return join23(getOpenCodeCacheDir(), "packages");
|
|
58787
58898
|
}
|
|
58788
58899
|
function readProcessOutput(stream) {
|
|
58789
58900
|
if (!stream) {
|
|
@@ -58809,7 +58920,7 @@ async function runBunInstallWithDetails(options) {
|
|
|
58809
58920
|
const outputMode = options?.outputMode ?? "pipe";
|
|
58810
58921
|
const cacheDir = options?.workspaceDir ?? getDefaultWorkspaceDir();
|
|
58811
58922
|
const packageJsonPath = `${cacheDir}/package.json`;
|
|
58812
|
-
if (!
|
|
58923
|
+
if (!existsSync25(packageJsonPath)) {
|
|
58813
58924
|
return {
|
|
58814
58925
|
success: false,
|
|
58815
58926
|
error: `Workspace not initialized: ${packageJsonPath} not found. OpenCode should create this on first run.`
|
|
@@ -58890,21 +59001,21 @@ var init_config_manager = __esm(() => {
|
|
|
58890
59001
|
});
|
|
58891
59002
|
|
|
58892
59003
|
// packages/telemetry-core/src/activity-state.ts
|
|
58893
|
-
import { existsSync as
|
|
58894
|
-
import { basename as
|
|
59004
|
+
import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync13 } from "fs";
|
|
59005
|
+
import { basename as basename10, join as join49 } from "path";
|
|
58895
59006
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
58896
59007
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
58897
59008
|
env: options.env,
|
|
58898
59009
|
osProvider: options.osProvider
|
|
58899
59010
|
});
|
|
58900
|
-
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined :
|
|
58901
|
-
if (dataDir === xdgStateDir || xdgStateDir === undefined &&
|
|
59011
|
+
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join49(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
59012
|
+
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
|
|
58902
59013
|
return dataDir;
|
|
58903
59014
|
}
|
|
58904
|
-
return
|
|
59015
|
+
return join49(dataDir, product.cacheDirName);
|
|
58905
59016
|
}
|
|
58906
59017
|
function getTelemetryActivityStateFilePath(stateDir) {
|
|
58907
|
-
return
|
|
59018
|
+
return join49(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
|
|
58908
59019
|
}
|
|
58909
59020
|
function getDailyActiveCaptureState(input) {
|
|
58910
59021
|
const state = readPostHogActivityState(input.stateDir, input.diagnostics);
|
|
@@ -58929,7 +59040,7 @@ function isPostHogActivityState(value) {
|
|
|
58929
59040
|
}
|
|
58930
59041
|
function readPostHogActivityState(stateDir, diagnostics) {
|
|
58931
59042
|
const stateFilePath = getTelemetryActivityStateFilePath(stateDir);
|
|
58932
|
-
if (!
|
|
59043
|
+
if (!existsSync28(stateFilePath)) {
|
|
58933
59044
|
return {};
|
|
58934
59045
|
}
|
|
58935
59046
|
try {
|
|
@@ -58974,10 +59085,10 @@ var init_activity_state = __esm(() => {
|
|
|
58974
59085
|
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
|
|
58975
59086
|
|
|
58976
59087
|
// packages/telemetry-core/src/diagnostics.ts
|
|
58977
|
-
import { appendFileSync as appendFileSync2, existsSync as
|
|
58978
|
-
import { join as
|
|
59088
|
+
import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync14 } from "fs";
|
|
59089
|
+
import { join as join50 } from "path";
|
|
58979
59090
|
function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
|
|
58980
|
-
return
|
|
59091
|
+
return join50(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
|
|
58981
59092
|
}
|
|
58982
59093
|
function writeTelemetryDiagnostic(input, options) {
|
|
58983
59094
|
const now = options.now ?? new Date;
|
|
@@ -58995,7 +59106,7 @@ function writeTelemetryDiagnostic(input, options) {
|
|
|
58995
59106
|
}
|
|
58996
59107
|
function cleanupTelemetryDiagnostics(options) {
|
|
58997
59108
|
const diagnosticsFilePath = getTelemetryDiagnosticsFilePath(options.diagnosticsDir);
|
|
58998
|
-
if (!
|
|
59109
|
+
if (!existsSync29(diagnosticsFilePath)) {
|
|
58999
59110
|
return;
|
|
59000
59111
|
}
|
|
59001
59112
|
try {
|
|
@@ -59143,7 +59254,7 @@ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetr
|
|
|
59143
59254
|
var init_machine_id = () => {};
|
|
59144
59255
|
|
|
59145
59256
|
// node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
59146
|
-
import { dirname as
|
|
59257
|
+
import { dirname as dirname16, posix as posix2, sep as sep7 } from "path";
|
|
59147
59258
|
function createModulerModifier() {
|
|
59148
59259
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
59149
59260
|
return async (frames) => {
|
|
@@ -59152,7 +59263,7 @@ function createModulerModifier() {
|
|
|
59152
59263
|
return frames;
|
|
59153
59264
|
};
|
|
59154
59265
|
}
|
|
59155
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
59266
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname16(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
|
|
59156
59267
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
59157
59268
|
return (filename) => {
|
|
59158
59269
|
if (!filename)
|
|
@@ -64702,7 +64813,7 @@ var package_default2;
|
|
|
64702
64813
|
var init_package2 = __esm(() => {
|
|
64703
64814
|
package_default2 = {
|
|
64704
64815
|
name: "@oh-my-opencode/omo-codex",
|
|
64705
|
-
version: "4.
|
|
64816
|
+
version: "4.13.0",
|
|
64706
64817
|
type: "module",
|
|
64707
64818
|
private: true,
|
|
64708
64819
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -64837,7 +64948,7 @@ function createPostHogClient(source, options = {}) {
|
|
|
64837
64948
|
osProvider: options.osProvider ?? resolveOsProvider(),
|
|
64838
64949
|
product: createCodexTelemetryProductConfig(),
|
|
64839
64950
|
source,
|
|
64840
|
-
transportFactory: options.transportFactory
|
|
64951
|
+
transportFactory: options.transportFactory ?? transportFactoryOverride ?? undefined
|
|
64841
64952
|
});
|
|
64842
64953
|
if (!client3.enabled) {
|
|
64843
64954
|
return NO_OP_POSTHOG;
|
|
@@ -64888,7 +64999,7 @@ function __setActivityStateProviderForTesting(provider) {
|
|
|
64888
64999
|
function __resetActivityStateProviderForTesting() {
|
|
64889
65000
|
activityStateProviderOverride = null;
|
|
64890
65001
|
}
|
|
64891
|
-
var osProviderOverride2 = null, activityStateProviderOverride = null, NO_OP_POSTHOG;
|
|
65002
|
+
var osProviderOverride2 = null, activityStateProviderOverride = null, transportFactoryOverride = null, NO_OP_POSTHOG;
|
|
64892
65003
|
var init_posthog = __esm(() => {
|
|
64893
65004
|
init_src4();
|
|
64894
65005
|
init_diagnostics2();
|
|
@@ -65671,20 +65782,20 @@ var init_update_toasts = __esm(() => {
|
|
|
65671
65782
|
});
|
|
65672
65783
|
|
|
65673
65784
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
65674
|
-
import { existsSync as
|
|
65675
|
-
import { dirname as
|
|
65785
|
+
import { existsSync as existsSync48 } from "fs";
|
|
65786
|
+
import { dirname as dirname25, join as join67 } from "path";
|
|
65676
65787
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
65677
65788
|
function defaultGetModuleHostingWorkspace() {
|
|
65678
65789
|
try {
|
|
65679
|
-
const currentDir =
|
|
65790
|
+
const currentDir = dirname25(fileURLToPath4(import.meta.url));
|
|
65680
65791
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
65681
65792
|
if (!pkgJsonPath)
|
|
65682
65793
|
return null;
|
|
65683
|
-
const pkgDir =
|
|
65684
|
-
const nodeModulesDir =
|
|
65794
|
+
const pkgDir = dirname25(pkgJsonPath);
|
|
65795
|
+
const nodeModulesDir = dirname25(pkgDir);
|
|
65685
65796
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
65686
65797
|
return null;
|
|
65687
|
-
return
|
|
65798
|
+
return dirname25(nodeModulesDir);
|
|
65688
65799
|
} catch (error51) {
|
|
65689
65800
|
if (error51 instanceof Error) {
|
|
65690
65801
|
return null;
|
|
@@ -65825,8 +65936,8 @@ var init_background_update_check = __esm(() => {
|
|
|
65825
65936
|
init_package_json_locator();
|
|
65826
65937
|
init_update_toasts();
|
|
65827
65938
|
defaultDeps4 = {
|
|
65828
|
-
existsSync:
|
|
65829
|
-
join:
|
|
65939
|
+
existsSync: existsSync48,
|
|
65940
|
+
join: join67,
|
|
65830
65941
|
runBunInstallWithDetails,
|
|
65831
65942
|
log: log2,
|
|
65832
65943
|
getOpenCodeCacheDir,
|
|
@@ -65989,7 +66100,7 @@ async function showSpinnerToast(ctx, version3, message) {
|
|
|
65989
66100
|
duration: frameInterval + 50
|
|
65990
66101
|
}
|
|
65991
66102
|
}).catch(ignoreToastError);
|
|
65992
|
-
await new Promise((
|
|
66103
|
+
await new Promise((resolve18) => setTimeout(resolve18, frameInterval));
|
|
65993
66104
|
}
|
|
65994
66105
|
}
|
|
65995
66106
|
var SISYPHUS_SPINNER;
|
|
@@ -66428,13 +66539,13 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
|
|
|
66428
66539
|
}
|
|
66429
66540
|
|
|
66430
66541
|
// packages/omo-codex/src/install/install-codex.ts
|
|
66431
|
-
import { join as
|
|
66432
|
-
import { existsSync as
|
|
66542
|
+
import { join as join51, resolve as resolve14 } from "path";
|
|
66543
|
+
import { existsSync as existsSync30 } from "fs";
|
|
66433
66544
|
import { homedir as homedir6 } from "os";
|
|
66434
66545
|
|
|
66435
66546
|
// packages/omo-codex/src/install/codex-cache-bins.ts
|
|
66436
66547
|
import { chmod, lstat as lstat3, mkdir, readFile as readFile2, readdir, readlink as readlink2, rm as rm2, stat, symlink, writeFile } from "fs/promises";
|
|
66437
|
-
import { basename as
|
|
66548
|
+
import { basename as basename6, isAbsolute as isAbsolute3, join as join26, relative as relative2, resolve as resolve7, sep } from "path";
|
|
66438
66549
|
|
|
66439
66550
|
// packages/omo-codex/src/install/codex-cache-command-shim.ts
|
|
66440
66551
|
var COMMAND_SHIM_MARKER = ":: generated by oh-my-openagent Codex installer";
|
|
@@ -66460,7 +66571,7 @@ function isNodeErrorWithCode(error) {
|
|
|
66460
66571
|
|
|
66461
66572
|
// packages/omo-codex/src/install/codex-cache-legacy-bins.ts
|
|
66462
66573
|
import { lstat as lstat2, readFile, readlink, rm } from "fs/promises";
|
|
66463
|
-
import { join as
|
|
66574
|
+
import { join as join24 } from "path";
|
|
66464
66575
|
var LEGACY_CODEX_COMPONENT_BINS = [
|
|
66465
66576
|
{ name: "omo", component: "ulw-loop" },
|
|
66466
66577
|
{ name: "codex-comment-checker", component: "comment-checker" },
|
|
@@ -66472,7 +66583,7 @@ var LEGACY_CODEX_COMPONENT_BINS = [
|
|
|
66472
66583
|
];
|
|
66473
66584
|
async function removeLegacyCodexComponentBins(binDir, platform) {
|
|
66474
66585
|
for (const entry of LEGACY_CODEX_COMPONENT_BINS) {
|
|
66475
|
-
const linkPath =
|
|
66586
|
+
const linkPath = join24(binDir, platform === "win32" ? `${entry.name}.cmd` : entry.name);
|
|
66476
66587
|
await removeLegacyCodexComponentBin(linkPath, entry.component, platform);
|
|
66477
66588
|
}
|
|
66478
66589
|
}
|
|
@@ -66523,10 +66634,10 @@ function isNodeErrorWithCode2(error) {
|
|
|
66523
66634
|
}
|
|
66524
66635
|
|
|
66525
66636
|
// packages/omo-codex/src/install/codex-cache-runtime-wrapper.ts
|
|
66526
|
-
import { join as
|
|
66637
|
+
import { join as join25 } from "path";
|
|
66527
66638
|
var RUNTIME_WRAPPER_MARKER = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
66528
66639
|
function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
66529
|
-
const ulwLoopBin = toPosixPath(
|
|
66640
|
+
const ulwLoopBin = toPosixPath(join25(binDir, "omo-ulw-loop"));
|
|
66530
66641
|
const nodeCli = escapePosixDoubleQuoted(toPosixPath(nodeCliPath));
|
|
66531
66642
|
const escapedCliPath = escapePosixDoubleQuoted(toPosixPath(cliPath));
|
|
66532
66643
|
const escapedCodexHome = escapePosixDoubleQuoted(toPosixPath(codexHome));
|
|
@@ -66572,7 +66683,7 @@ function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
|
66572
66683
|
`);
|
|
66573
66684
|
}
|
|
66574
66685
|
function windowsRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
|
|
66575
|
-
const ulwLoopBin =
|
|
66686
|
+
const ulwLoopBin = join25(binDir, "omo-ulw-loop.cmd");
|
|
66576
66687
|
return [
|
|
66577
66688
|
"@echo off",
|
|
66578
66689
|
`rem ${RUNTIME_WRAPPER_MARKER}`,
|
|
@@ -66628,29 +66739,29 @@ async function linkCachedPluginBins(input) {
|
|
|
66628
66739
|
return linked;
|
|
66629
66740
|
}
|
|
66630
66741
|
async function linkRootRuntimeBin(input) {
|
|
66631
|
-
const cliPath =
|
|
66742
|
+
const cliPath = join26(input.repoRoot, "dist", "cli", "index.js");
|
|
66632
66743
|
if (!await isFile(cliPath))
|
|
66633
66744
|
return null;
|
|
66634
|
-
const nodeCliPath =
|
|
66745
|
+
const nodeCliPath = join26(input.repoRoot, "dist", "cli-node", "index.js");
|
|
66635
66746
|
const platform = input.platform ?? process.platform;
|
|
66636
66747
|
await mkdir(input.binDir, { recursive: true });
|
|
66637
66748
|
if (platform === "win32") {
|
|
66638
|
-
const linkPath2 =
|
|
66749
|
+
const linkPath2 = join26(input.binDir, "omo.cmd");
|
|
66639
66750
|
await replaceRuntimeWrapper(linkPath2, windowsRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
|
|
66640
66751
|
return { name: "omo", path: linkPath2, target: cliPath };
|
|
66641
66752
|
}
|
|
66642
|
-
const linkPath =
|
|
66753
|
+
const linkPath = join26(input.binDir, "omo");
|
|
66643
66754
|
await replaceRuntimeWrapper(linkPath, posixRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
|
|
66644
66755
|
await chmod(linkPath, 493);
|
|
66645
66756
|
return { name: "omo", path: linkPath, target: cliPath };
|
|
66646
66757
|
}
|
|
66647
66758
|
async function linkCachedPluginBin(binDir, link, platform) {
|
|
66648
66759
|
if (platform === "win32") {
|
|
66649
|
-
const linkPath2 =
|
|
66760
|
+
const linkPath2 = join26(binDir, `${link.name}.cmd`);
|
|
66650
66761
|
await replaceCommandShim(linkPath2, link.target);
|
|
66651
66762
|
return linkPath2;
|
|
66652
66763
|
}
|
|
66653
|
-
const linkPath =
|
|
66764
|
+
const linkPath = join26(binDir, link.name);
|
|
66654
66765
|
await replaceSymlink(linkPath, link.target);
|
|
66655
66766
|
return linkPath;
|
|
66656
66767
|
}
|
|
@@ -66671,14 +66782,14 @@ async function discoverPackageBins(root) {
|
|
|
66671
66782
|
async function collectPackageBins(directory, root, links) {
|
|
66672
66783
|
const entries = await readdir(directory, { withFileTypes: true });
|
|
66673
66784
|
if (entries.some((entry) => entry.isFile() && entry.name === "package.json")) {
|
|
66674
|
-
await appendPackageBinLinks(
|
|
66785
|
+
await appendPackageBinLinks(join26(directory, "package.json"), directory, root, links);
|
|
66675
66786
|
}
|
|
66676
66787
|
for (const entry of entries) {
|
|
66677
66788
|
if (!entry.isDirectory())
|
|
66678
66789
|
continue;
|
|
66679
66790
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist")
|
|
66680
66791
|
continue;
|
|
66681
|
-
const childPath =
|
|
66792
|
+
const childPath = join26(directory, entry.name);
|
|
66682
66793
|
if (!childPath.startsWith(root))
|
|
66683
66794
|
continue;
|
|
66684
66795
|
await collectPackageBins(childPath, root, links);
|
|
@@ -66691,7 +66802,7 @@ async function appendPackageBinLinks(packageJsonPath, packageRoot, root, links)
|
|
|
66691
66802
|
const packageName = packageJson.name;
|
|
66692
66803
|
const packageBin = packageJson.bin;
|
|
66693
66804
|
if (typeof packageBin === "string" && typeof packageName === "string") {
|
|
66694
|
-
const name = assertSafeCommandName(
|
|
66805
|
+
const name = assertSafeCommandName(basename6(packageName));
|
|
66695
66806
|
if (!isReservedNestedBinName(name, packageRoot, root)) {
|
|
66696
66807
|
links.push({ name, target: resolvePackageBinTarget(packageRoot, packageBin) });
|
|
66697
66808
|
}
|
|
@@ -66793,11 +66904,11 @@ async function existingNonSymlink(path7) {
|
|
|
66793
66904
|
}
|
|
66794
66905
|
// packages/omo-codex/src/install/codex-cache-install.ts
|
|
66795
66906
|
import { cp as cp2, mkdir as mkdir3, readFile as readFile7, rename, rm as rm3 } from "fs/promises";
|
|
66796
|
-
import { basename as
|
|
66907
|
+
import { basename as basename7, dirname as dirname12, join as join32, sep as sep5 } from "path";
|
|
66797
66908
|
|
|
66798
66909
|
// packages/omo-codex/src/install/codex-cache-bundled-mcps.ts
|
|
66799
66910
|
import { cp, mkdir as mkdir2, readFile as readFile3, stat as stat2 } from "fs/promises";
|
|
66800
|
-
import { dirname as
|
|
66911
|
+
import { dirname as dirname10, join as join27, resolve as resolve8 } from "path";
|
|
66801
66912
|
var BUNDLED_MCP_RUNTIMES = [
|
|
66802
66913
|
{
|
|
66803
66914
|
label: "Git Bash MCP",
|
|
@@ -66815,7 +66926,7 @@ var BUNDLED_MCP_RUNTIMES = [
|
|
|
66815
66926
|
}
|
|
66816
66927
|
];
|
|
66817
66928
|
async function copyBundledMcpRuntimeDists(input) {
|
|
66818
|
-
const sourceArgs = await readSourceMcpArgs(
|
|
66929
|
+
const sourceArgs = await readSourceMcpArgs(join27(input.sourceRoot, ".mcp.json"));
|
|
66819
66930
|
for (const runtime4 of BUNDLED_MCP_RUNTIMES) {
|
|
66820
66931
|
if (!sourceArgs.has(runtime4.sourceArg))
|
|
66821
66932
|
continue;
|
|
@@ -66824,15 +66935,15 @@ async function copyBundledMcpRuntimeDists(input) {
|
|
|
66824
66935
|
}
|
|
66825
66936
|
function resolveBundledMcpRuntimeArg(pluginRoot, arg) {
|
|
66826
66937
|
const runtime4 = BUNDLED_MCP_RUNTIMES.find((candidate) => candidate.sourceArg === arg);
|
|
66827
|
-
return runtime4 ?
|
|
66938
|
+
return runtime4 ? join27(pluginRoot, runtime4.destinationArg) : null;
|
|
66828
66939
|
}
|
|
66829
66940
|
async function copyBundledMcpRuntimeDist(pluginRoot, sourceRoot, runtime4) {
|
|
66830
66941
|
const sourcePath = resolve8(sourceRoot, runtime4.sourceDistFromPlugin);
|
|
66831
66942
|
if (!await isDirectory(sourcePath)) {
|
|
66832
66943
|
throw new Error(`missing built ${runtime4.label} dist at ${sourcePath}`);
|
|
66833
66944
|
}
|
|
66834
|
-
const destinationPath =
|
|
66835
|
-
await mkdir2(
|
|
66945
|
+
const destinationPath = join27(pluginRoot, runtime4.destinationDistFromPlugin);
|
|
66946
|
+
await mkdir2(dirname10(destinationPath), { recursive: true });
|
|
66836
66947
|
await cp(sourcePath, destinationPath, { recursive: true });
|
|
66837
66948
|
}
|
|
66838
66949
|
async function readSourceMcpArgs(path7) {
|
|
@@ -66870,37 +66981,37 @@ async function isDirectory(path7) {
|
|
|
66870
66981
|
// packages/omo-codex/src/install/codex-cache-local-dependencies.ts
|
|
66871
66982
|
import { realpathSync as realpathSync6 } from "fs";
|
|
66872
66983
|
import { readFile as readFile4, readdir as readdir2, writeFile as writeFile2 } from "fs/promises";
|
|
66873
|
-
import { dirname as
|
|
66984
|
+
import { dirname as dirname11, isAbsolute as isAbsolute5, join as join29, relative as relative4, resolve as resolve10, sep as sep2 } from "path";
|
|
66874
66985
|
|
|
66875
66986
|
// packages/omo-codex/src/install/codex-cache-paths.ts
|
|
66876
|
-
import { existsSync as
|
|
66877
|
-
import { isAbsolute as isAbsolute4, join as
|
|
66987
|
+
import { existsSync as existsSync26, readdirSync as readdirSync4 } from "fs";
|
|
66988
|
+
import { isAbsolute as isAbsolute4, join as join28, relative as relative3, resolve as resolve9 } from "path";
|
|
66878
66989
|
var DEFAULT_CODEX_MARKETPLACE_NAME = "sisyphuslabs";
|
|
66879
66990
|
var DEFAULT_CODEX_PLUGIN_NAME = "omo";
|
|
66880
66991
|
function resolveDefaultCodexHome(homeDir) {
|
|
66881
|
-
return
|
|
66992
|
+
return join28(homeDir, ".codex");
|
|
66882
66993
|
}
|
|
66883
66994
|
function resolveCodexPluginCacheRoot(codexHome, input = {}) {
|
|
66884
|
-
return
|
|
66995
|
+
return join28(codexHome, "plugins", "cache", input.marketplaceName ?? DEFAULT_CODEX_MARKETPLACE_NAME, input.pluginName ?? DEFAULT_CODEX_PLUGIN_NAME);
|
|
66885
66996
|
}
|
|
66886
66997
|
function resolveCachedCodexComponentCliPath(pluginRoot, componentName) {
|
|
66887
|
-
return
|
|
66998
|
+
return join28(pluginRoot, "components", componentName, "dist", "cli.js");
|
|
66888
66999
|
}
|
|
66889
67000
|
function resolveCodexComponentBinCandidates(input) {
|
|
66890
67001
|
return [
|
|
66891
|
-
input.env.CODEX_LOCAL_BIN_DIR ?
|
|
66892
|
-
|
|
66893
|
-
|
|
67002
|
+
input.env.CODEX_LOCAL_BIN_DIR ? join28(input.env.CODEX_LOCAL_BIN_DIR, input.executableName) : undefined,
|
|
67003
|
+
join28(input.homeDir, ".local", "bin", input.executableName),
|
|
67004
|
+
join28(resolveDefaultCodexHome(input.homeDir), "bin", input.executableName)
|
|
66894
67005
|
].filter((value) => typeof value === "string");
|
|
66895
67006
|
}
|
|
66896
67007
|
function findNewestCachedCodexComponentCli(input) {
|
|
66897
67008
|
const versionsRoot = resolveCodexPluginCacheRoot(input.codexHome, input);
|
|
66898
|
-
if (!
|
|
67009
|
+
if (!existsSync26(versionsRoot))
|
|
66899
67010
|
return null;
|
|
66900
67011
|
const versions = readdirSync4(versionsRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionNames).reverse();
|
|
66901
67012
|
for (const version of versions) {
|
|
66902
|
-
const candidate = resolveCachedCodexComponentCliPath(
|
|
66903
|
-
if (
|
|
67013
|
+
const candidate = resolveCachedCodexComponentCliPath(join28(versionsRoot, version), input.componentName);
|
|
67014
|
+
if (existsSync26(candidate))
|
|
66904
67015
|
return candidate;
|
|
66905
67016
|
}
|
|
66906
67017
|
return null;
|
|
@@ -66938,8 +67049,8 @@ async function rewriteCachedPackageLocalFileDependencies(pluginRoot, sourceRoot)
|
|
|
66938
67049
|
const parsed = JSON.parse(raw);
|
|
66939
67050
|
if (!isPlainRecord3(parsed))
|
|
66940
67051
|
continue;
|
|
66941
|
-
const packageDir =
|
|
66942
|
-
const sourcePackageDir =
|
|
67052
|
+
const packageDir = dirname11(packageJsonPath);
|
|
67053
|
+
const sourcePackageDir = join29(sourceRoot, relative4(pluginRoot, packageDir));
|
|
66943
67054
|
let changed = false;
|
|
66944
67055
|
for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
|
|
66945
67056
|
const dependencies = parsed[field];
|
|
@@ -66977,7 +67088,7 @@ async function rewriteCachedPackageLocalFileDependencies(pluginRoot, sourceRoot)
|
|
|
66977
67088
|
`);
|
|
66978
67089
|
}
|
|
66979
67090
|
async function readPackageLock(pluginRoot) {
|
|
66980
|
-
const path7 =
|
|
67091
|
+
const path7 = join29(pluginRoot, "package-lock.json");
|
|
66981
67092
|
try {
|
|
66982
67093
|
const parsed = JSON.parse(await readFile4(path7, "utf8"));
|
|
66983
67094
|
return { path: path7, value: isPlainRecord3(parsed) ? parsed : null, changed: false };
|
|
@@ -67038,14 +67149,14 @@ function canonicalizeExistingPath(path7) {
|
|
|
67038
67149
|
async function collectPackageJsonPaths(directory, root, paths) {
|
|
67039
67150
|
const entries = await readdir2(directory, { withFileTypes: true });
|
|
67040
67151
|
if (entries.some((entry) => entry.isFile() && entry.name === "package.json")) {
|
|
67041
|
-
paths.push(
|
|
67152
|
+
paths.push(join29(directory, "package.json"));
|
|
67042
67153
|
}
|
|
67043
67154
|
for (const entry of entries) {
|
|
67044
67155
|
if (!entry.isDirectory())
|
|
67045
67156
|
continue;
|
|
67046
67157
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist")
|
|
67047
67158
|
continue;
|
|
67048
|
-
const childPath =
|
|
67159
|
+
const childPath = join29(directory, entry.name);
|
|
67049
67160
|
if (!isPathInside(childPath, root))
|
|
67050
67161
|
continue;
|
|
67051
67162
|
await collectPackageJsonPaths(childPath, root, paths);
|
|
@@ -67054,10 +67165,10 @@ async function collectPackageJsonPaths(directory, root, paths) {
|
|
|
67054
67165
|
|
|
67055
67166
|
// packages/omo-codex/src/install/codex-cache-mcp-manifest.ts
|
|
67056
67167
|
import { readFile as readFile5, writeFile as writeFile3 } from "fs/promises";
|
|
67057
|
-
import { join as
|
|
67168
|
+
import { join as join30, sep as sep3 } from "path";
|
|
67058
67169
|
var CODEGRAPH_RELATIVE_ARGS = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
67059
67170
|
async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
67060
|
-
const manifestPath =
|
|
67171
|
+
const manifestPath = join30(pluginRoot, ".mcp.json");
|
|
67061
67172
|
if (!await fileExistsStrict(manifestPath))
|
|
67062
67173
|
return;
|
|
67063
67174
|
const raw = await readFile5(manifestPath, "utf8");
|
|
@@ -67082,7 +67193,7 @@ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
|
67082
67193
|
if (bundledMcpRuntimeArg !== null)
|
|
67083
67194
|
return bundledMcpRuntimeArg;
|
|
67084
67195
|
if (CODEGRAPH_RELATIVE_ARGS.has(arg))
|
|
67085
|
-
return
|
|
67196
|
+
return join30(pluginRoot, "components", "codegraph", "dist", "serve.js");
|
|
67086
67197
|
if (arg.startsWith("./") || arg.startsWith("../"))
|
|
67087
67198
|
return resolveCachedRuntimePath(pluginRoot, sourceRoot, arg);
|
|
67088
67199
|
return arg;
|
|
@@ -67097,7 +67208,7 @@ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
|
|
|
67097
67208
|
`);
|
|
67098
67209
|
}
|
|
67099
67210
|
async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
|
|
67100
|
-
const manifestPath =
|
|
67211
|
+
const manifestPath = join30(pluginRoot, ".mcp.json");
|
|
67101
67212
|
if (!await fileExistsStrict(manifestPath))
|
|
67102
67213
|
return;
|
|
67103
67214
|
const raw = await readFile5(manifestPath, "utf8");
|
|
@@ -67133,7 +67244,7 @@ async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
|
|
|
67133
67244
|
|
|
67134
67245
|
// packages/omo-codex/src/install/codex-hook-targets.ts
|
|
67135
67246
|
import { readFile as readFile6 } from "fs/promises";
|
|
67136
|
-
import { join as
|
|
67247
|
+
import { join as join31, sep as sep4 } from "path";
|
|
67137
67248
|
var PLUGIN_ROOT_TARGET_PATTERN = /\$\{PLUGIN_ROOT\}[\\/]+([^"']+)/g;
|
|
67138
67249
|
async function findMissingHookCommandTargets(pluginRoot) {
|
|
67139
67250
|
const commands = [];
|
|
@@ -67150,7 +67261,7 @@ async function findMissingHookCommandTargets(pluginRoot) {
|
|
|
67150
67261
|
const targetSuffix = match[1];
|
|
67151
67262
|
if (targetSuffix === undefined)
|
|
67152
67263
|
continue;
|
|
67153
|
-
const target =
|
|
67264
|
+
const target = join31(pluginRoot, ...targetSuffix.split(/[\\/]+/));
|
|
67154
67265
|
if (seen.has(target))
|
|
67155
67266
|
continue;
|
|
67156
67267
|
seen.add(target);
|
|
@@ -67161,17 +67272,17 @@ async function findMissingHookCommandTargets(pluginRoot) {
|
|
|
67161
67272
|
return missing;
|
|
67162
67273
|
}
|
|
67163
67274
|
async function hookManifestPaths(pluginRoot) {
|
|
67164
|
-
const pluginManifestPath =
|
|
67275
|
+
const pluginManifestPath = join31(pluginRoot, ".codex-plugin", "plugin.json");
|
|
67165
67276
|
if (!await fileExistsStrict(pluginManifestPath))
|
|
67166
|
-
return [
|
|
67277
|
+
return [join31(pluginRoot, "hooks", "hooks.json")];
|
|
67167
67278
|
const parsed = JSON.parse(await readFile6(pluginManifestPath, "utf8"));
|
|
67168
67279
|
if (!isPlainRecord3(parsed))
|
|
67169
67280
|
return [];
|
|
67170
67281
|
if (typeof parsed.hooks === "string" && parsed.hooks.trim() !== "") {
|
|
67171
|
-
return [
|
|
67282
|
+
return [join31(pluginRoot, stripDotSlash(parsed.hooks))];
|
|
67172
67283
|
}
|
|
67173
67284
|
if (Array.isArray(parsed.hooks)) {
|
|
67174
|
-
return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) =>
|
|
67285
|
+
return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) => join31(pluginRoot, stripDotSlash(hookPath)));
|
|
67175
67286
|
}
|
|
67176
67287
|
return [];
|
|
67177
67288
|
}
|
|
@@ -67207,7 +67318,7 @@ async function installCachedPlugin(input) {
|
|
|
67207
67318
|
await maybeRunNpmInstall(input.sourcePath, input.runCommand);
|
|
67208
67319
|
await maybeRunNpmBuild(input.sourcePath, input.runCommand);
|
|
67209
67320
|
}
|
|
67210
|
-
const targetPath =
|
|
67321
|
+
const targetPath = join32(input.codexHome, "plugins", "cache", input.marketplaceName, input.name, input.version);
|
|
67211
67322
|
const tempPath = createTempSiblingPath(targetPath);
|
|
67212
67323
|
await rm3(tempPath, { recursive: true, force: true });
|
|
67213
67324
|
try {
|
|
@@ -67215,6 +67326,8 @@ async function installCachedPlugin(input) {
|
|
|
67215
67326
|
await rewriteCachedPackageLocalFileDependencies(tempPath, input.sourcePath);
|
|
67216
67327
|
await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: input.sourcePath });
|
|
67217
67328
|
await maybeRunNpmInstall(tempPath, input.runCommand, ["ci", "--omit=dev"]);
|
|
67329
|
+
if (input.buildSource === false)
|
|
67330
|
+
await maybeRunNpmSyncSkills(tempPath, input.runCommand);
|
|
67218
67331
|
await rewriteCachedMcpManifest(tempPath, input.sourcePath);
|
|
67219
67332
|
await rewriteCachedManifestRoot(tempPath, tempPath, targetPath);
|
|
67220
67333
|
await assertHookCommandTargets(tempPath);
|
|
@@ -67226,14 +67339,14 @@ async function installCachedPlugin(input) {
|
|
|
67226
67339
|
return { name: input.name, version: input.version, path: targetPath };
|
|
67227
67340
|
}
|
|
67228
67341
|
async function maybeRunNpmInstall(cwd, runCommand, args = ["install"]) {
|
|
67229
|
-
if (!await fileExistsStrict(
|
|
67342
|
+
if (!await fileExistsStrict(join32(cwd, "package.json")))
|
|
67230
67343
|
return;
|
|
67231
67344
|
await runCommand("npm", args, { cwd });
|
|
67232
67345
|
}
|
|
67233
67346
|
async function maybeRunNpmBuild(cwd, runCommand) {
|
|
67234
|
-
if (!await fileExistsStrict(
|
|
67347
|
+
if (!await fileExistsStrict(join32(cwd, "package.json")))
|
|
67235
67348
|
return;
|
|
67236
|
-
const packageJson = JSON.parse(await readFile7(
|
|
67349
|
+
const packageJson = JSON.parse(await readFile7(join32(cwd, "package.json"), "utf8"));
|
|
67237
67350
|
if (!isPlainRecord3(packageJson))
|
|
67238
67351
|
return;
|
|
67239
67352
|
const scripts = packageJson.scripts;
|
|
@@ -67241,14 +67354,25 @@ async function maybeRunNpmBuild(cwd, runCommand) {
|
|
|
67241
67354
|
return;
|
|
67242
67355
|
await runCommand("npm", ["run", "build"], { cwd });
|
|
67243
67356
|
}
|
|
67357
|
+
async function maybeRunNpmSyncSkills(cwd, runCommand) {
|
|
67358
|
+
if (!await fileExistsStrict(join32(cwd, "package.json")))
|
|
67359
|
+
return;
|
|
67360
|
+
const packageJson = JSON.parse(await readFile7(join32(cwd, "package.json"), "utf8"));
|
|
67361
|
+
if (!isPlainRecord3(packageJson))
|
|
67362
|
+
return;
|
|
67363
|
+
const scripts = packageJson.scripts;
|
|
67364
|
+
if (!isPlainRecord3(scripts) || typeof scripts["sync:skills"] !== "string")
|
|
67365
|
+
return;
|
|
67366
|
+
await runCommand("npm", ["run", "sync:skills"], { cwd });
|
|
67367
|
+
}
|
|
67244
67368
|
function createTempSiblingPath(targetPath) {
|
|
67245
|
-
return
|
|
67369
|
+
return join32(dirname12(targetPath), `.tmp-${basename7(targetPath)}-${process.pid}-${Date.now()}`);
|
|
67246
67370
|
}
|
|
67247
67371
|
function createBackupSiblingPath(targetPath) {
|
|
67248
|
-
return
|
|
67372
|
+
return join32(dirname12(targetPath), `.backup-${basename7(targetPath)}-${process.pid}-${Date.now()}`);
|
|
67249
67373
|
}
|
|
67250
67374
|
async function copyDirectory(sourcePath, targetPath) {
|
|
67251
|
-
await mkdir3(
|
|
67375
|
+
await mkdir3(dirname12(targetPath), { recursive: true });
|
|
67252
67376
|
await cp2(sourcePath, targetPath, { recursive: true, filter: (source) => shouldCopyPluginPath(source, sourcePath) });
|
|
67253
67377
|
}
|
|
67254
67378
|
async function promoteDirectory(tempPath, targetPath, renameDirectory) {
|
|
@@ -67284,9 +67408,9 @@ function shouldCopyPluginPath(path7, root) {
|
|
|
67284
67408
|
}
|
|
67285
67409
|
// packages/omo-codex/src/install/codex-cache-prune.ts
|
|
67286
67410
|
import { lstat as lstat4, readdir as readdir3, rm as rm4, stat as stat3 } from "fs/promises";
|
|
67287
|
-
import { join as
|
|
67411
|
+
import { join as join33 } from "path";
|
|
67288
67412
|
async function pruneMarketplaceCache(input) {
|
|
67289
|
-
const cacheRoot =
|
|
67413
|
+
const cacheRoot = join33(input.codexHome, "plugins", "cache", input.marketplaceName);
|
|
67290
67414
|
if (!await fileExistsStrict(cacheRoot))
|
|
67291
67415
|
return;
|
|
67292
67416
|
const keep = new Set(input.keepPluginNames);
|
|
@@ -67294,15 +67418,15 @@ async function pruneMarketplaceCache(input) {
|
|
|
67294
67418
|
for (const entry of entries) {
|
|
67295
67419
|
if (!entry.isDirectory() || keep.has(entry.name))
|
|
67296
67420
|
continue;
|
|
67297
|
-
await rm4(
|
|
67421
|
+
await rm4(join33(cacheRoot, entry.name), { recursive: true, force: true });
|
|
67298
67422
|
}
|
|
67299
67423
|
}
|
|
67300
67424
|
async function pruneMarketplacePluginCaches(input) {
|
|
67301
|
-
const cacheRoot =
|
|
67425
|
+
const cacheRoot = join33(input.codexHome, "plugins", "cache", input.marketplaceName);
|
|
67302
67426
|
if (!await fileExistsStrict(cacheRoot))
|
|
67303
67427
|
return;
|
|
67304
67428
|
for (const pluginName of input.pluginNames) {
|
|
67305
|
-
await rm4(
|
|
67429
|
+
await rm4(join33(cacheRoot, pluginName), { recursive: true, force: true });
|
|
67306
67430
|
}
|
|
67307
67431
|
const remainingEntries = await readCacheEntryNames(cacheRoot);
|
|
67308
67432
|
if (remainingEntries.length === 0) {
|
|
@@ -67349,11 +67473,11 @@ async function isBrokenCacheSymlink(path7) {
|
|
|
67349
67473
|
}
|
|
67350
67474
|
// packages/omo-codex/src/install/codex-cached-marketplace-manifest.ts
|
|
67351
67475
|
import { mkdir as mkdir4, writeFile as writeFile4 } from "fs/promises";
|
|
67352
|
-
import { join as
|
|
67476
|
+
import { join as join34 } from "path";
|
|
67353
67477
|
async function writeCachedMarketplaceManifest(input) {
|
|
67354
|
-
const marketplaceDir =
|
|
67478
|
+
const marketplaceDir = join34(input.marketplaceRoot, ".agents", "plugins");
|
|
67355
67479
|
await mkdir4(marketplaceDir, { recursive: true });
|
|
67356
|
-
await writeFile4(
|
|
67480
|
+
await writeFile4(join34(marketplaceDir, "marketplace.json"), `${JSON.stringify({
|
|
67357
67481
|
name: input.marketplaceName,
|
|
67358
67482
|
plugins: input.plugins.map((plugin) => ({
|
|
67359
67483
|
name: plugin.name,
|
|
@@ -67364,9 +67488,9 @@ async function writeCachedMarketplaceManifest(input) {
|
|
|
67364
67488
|
}
|
|
67365
67489
|
|
|
67366
67490
|
// packages/omo-codex/src/install/codex-package-layout.ts
|
|
67367
|
-
import { existsSync as
|
|
67491
|
+
import { existsSync as existsSync27 } from "fs";
|
|
67368
67492
|
import { readFile as readFile8 } from "fs/promises";
|
|
67369
|
-
import { join as
|
|
67493
|
+
import { join as join35 } from "path";
|
|
67370
67494
|
var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
|
|
67371
67495
|
"@code-yeongyu/lazycodex",
|
|
67372
67496
|
"@code-yeongyu/lazycodex-ai",
|
|
@@ -67376,10 +67500,10 @@ var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
|
|
|
67376
67500
|
"oh-my-openagent"
|
|
67377
67501
|
]);
|
|
67378
67502
|
async function shouldBuildSourcePackages(repoRoot) {
|
|
67379
|
-
if (
|
|
67503
|
+
if (existsSync27(join35(repoRoot, "packages", "omo-opencode", "src", "index.ts")))
|
|
67380
67504
|
return true;
|
|
67381
|
-
const packageJsonPath =
|
|
67382
|
-
if (!
|
|
67505
|
+
const packageJsonPath = join35(repoRoot, "package.json");
|
|
67506
|
+
if (!existsSync27(packageJsonPath))
|
|
67383
67507
|
return true;
|
|
67384
67508
|
const packageJson = JSON.parse(await readFile8(packageJsonPath, "utf8"));
|
|
67385
67509
|
if (!isPlainRecord3(packageJson) || typeof packageJson.name !== "string")
|
|
@@ -67389,11 +67513,12 @@ async function shouldBuildSourcePackages(repoRoot) {
|
|
|
67389
67513
|
|
|
67390
67514
|
// packages/omo-codex/src/install/codex-config-toml.ts
|
|
67391
67515
|
import { mkdir as mkdir5, readFile as readFile10 } from "fs/promises";
|
|
67392
|
-
import { dirname as
|
|
67516
|
+
import { dirname as dirname14 } from "path";
|
|
67393
67517
|
|
|
67394
67518
|
// packages/omo-codex/src/install/toml-section-editor.ts
|
|
67395
67519
|
function findTomlSection(config, header) {
|
|
67396
67520
|
const headerLine = `[${header}]`;
|
|
67521
|
+
const targetHeaderPath = parseTomlDottedKey(header);
|
|
67397
67522
|
const lines = config.match(/[^\n]*\n?|$/g) ?? [];
|
|
67398
67523
|
let offset = 0;
|
|
67399
67524
|
let start = -1;
|
|
@@ -67402,7 +67527,7 @@ function findTomlSection(config, header) {
|
|
|
67402
67527
|
break;
|
|
67403
67528
|
const trimmed = line.trim();
|
|
67404
67529
|
if (start === -1) {
|
|
67405
|
-
if (trimmed
|
|
67530
|
+
if (tomlTableHeaderMatches(trimmed, headerLine, targetHeaderPath))
|
|
67406
67531
|
start = offset;
|
|
67407
67532
|
} else if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
67408
67533
|
return { start, end: offset, text: config.slice(start, offset) };
|
|
@@ -67458,6 +67583,127 @@ function insertSetting(sectionText, key, value) {
|
|
|
67458
67583
|
function escapeRegExp(value) {
|
|
67459
67584
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
67460
67585
|
}
|
|
67586
|
+
function tomlTableHeaderMatches(line, headerLine, targetHeaderPath) {
|
|
67587
|
+
if (line === headerLine)
|
|
67588
|
+
return true;
|
|
67589
|
+
if (!targetHeaderPath)
|
|
67590
|
+
return false;
|
|
67591
|
+
const candidateHeaderPath = parseTomlTableHeader(line);
|
|
67592
|
+
if (!candidateHeaderPath || candidateHeaderPath.length !== targetHeaderPath.length)
|
|
67593
|
+
return false;
|
|
67594
|
+
return candidateHeaderPath.every((part, index) => part === targetHeaderPath[index]);
|
|
67595
|
+
}
|
|
67596
|
+
function parseTomlTableHeader(line) {
|
|
67597
|
+
if (!line.startsWith("[") || !line.endsWith("]") || line.startsWith("[["))
|
|
67598
|
+
return null;
|
|
67599
|
+
return parseTomlDottedKey(line.slice(1, -1).trim());
|
|
67600
|
+
}
|
|
67601
|
+
function parseTomlDottedKey(input) {
|
|
67602
|
+
const parts = [];
|
|
67603
|
+
let index = 0;
|
|
67604
|
+
while (index < input.length) {
|
|
67605
|
+
index = skipWhitespace(input, index);
|
|
67606
|
+
const parsedKey = parseTomlKeyPart(input, index);
|
|
67607
|
+
if (!parsedKey)
|
|
67608
|
+
return null;
|
|
67609
|
+
parts.push(parsedKey.value);
|
|
67610
|
+
index = skipWhitespace(input, parsedKey.nextIndex);
|
|
67611
|
+
if (index === input.length)
|
|
67612
|
+
return parts;
|
|
67613
|
+
if (input[index] !== ".")
|
|
67614
|
+
return null;
|
|
67615
|
+
index += 1;
|
|
67616
|
+
}
|
|
67617
|
+
return parts.length > 0 ? parts : null;
|
|
67618
|
+
}
|
|
67619
|
+
function parseTomlKeyPart(input, startIndex) {
|
|
67620
|
+
const quote = input[startIndex];
|
|
67621
|
+
if (quote === "'")
|
|
67622
|
+
return parseLiteralTomlString(input, startIndex);
|
|
67623
|
+
if (quote === '"')
|
|
67624
|
+
return parseBasicTomlString(input, startIndex);
|
|
67625
|
+
return parseBareTomlKey(input, startIndex);
|
|
67626
|
+
}
|
|
67627
|
+
function parseLiteralTomlString(input, startIndex) {
|
|
67628
|
+
let index = startIndex + 1;
|
|
67629
|
+
let value = "";
|
|
67630
|
+
while (index < input.length) {
|
|
67631
|
+
const char = input[index];
|
|
67632
|
+
if (char === "'")
|
|
67633
|
+
return { value, nextIndex: index + 1 };
|
|
67634
|
+
value += char;
|
|
67635
|
+
index += 1;
|
|
67636
|
+
}
|
|
67637
|
+
return null;
|
|
67638
|
+
}
|
|
67639
|
+
function parseBasicTomlString(input, startIndex) {
|
|
67640
|
+
let index = startIndex + 1;
|
|
67641
|
+
let value = "";
|
|
67642
|
+
while (index < input.length) {
|
|
67643
|
+
const char = input[index];
|
|
67644
|
+
if (char === '"')
|
|
67645
|
+
return { value, nextIndex: index + 1 };
|
|
67646
|
+
if (char !== "\\") {
|
|
67647
|
+
value += char;
|
|
67648
|
+
index += 1;
|
|
67649
|
+
continue;
|
|
67650
|
+
}
|
|
67651
|
+
const escaped = parseBasicTomlEscape(input, index);
|
|
67652
|
+
if (!escaped)
|
|
67653
|
+
return null;
|
|
67654
|
+
value += escaped.value;
|
|
67655
|
+
index = escaped.nextIndex;
|
|
67656
|
+
}
|
|
67657
|
+
return null;
|
|
67658
|
+
}
|
|
67659
|
+
function parseBasicTomlEscape(input, backslashIndex) {
|
|
67660
|
+
const escape = input[backslashIndex + 1];
|
|
67661
|
+
if (escape === undefined)
|
|
67662
|
+
return null;
|
|
67663
|
+
if (escape === "b")
|
|
67664
|
+
return { value: "\b", nextIndex: backslashIndex + 2 };
|
|
67665
|
+
if (escape === "t")
|
|
67666
|
+
return { value: "\t", nextIndex: backslashIndex + 2 };
|
|
67667
|
+
if (escape === "n")
|
|
67668
|
+
return { value: `
|
|
67669
|
+
`, nextIndex: backslashIndex + 2 };
|
|
67670
|
+
if (escape === "f")
|
|
67671
|
+
return { value: "\f", nextIndex: backslashIndex + 2 };
|
|
67672
|
+
if (escape === "r")
|
|
67673
|
+
return { value: "\r", nextIndex: backslashIndex + 2 };
|
|
67674
|
+
if (escape === '"')
|
|
67675
|
+
return { value: '"', nextIndex: backslashIndex + 2 };
|
|
67676
|
+
if (escape === "\\")
|
|
67677
|
+
return { value: "\\", nextIndex: backslashIndex + 2 };
|
|
67678
|
+
if (escape === "u")
|
|
67679
|
+
return parseUnicodeEscape(input, backslashIndex + 2, 4);
|
|
67680
|
+
if (escape === "U")
|
|
67681
|
+
return parseUnicodeEscape(input, backslashIndex + 2, 8);
|
|
67682
|
+
return null;
|
|
67683
|
+
}
|
|
67684
|
+
function parseUnicodeEscape(input, digitsStart, digitCount) {
|
|
67685
|
+
const digits = input.slice(digitsStart, digitsStart + digitCount);
|
|
67686
|
+
if (digits.length !== digitCount || !/^[0-9A-Fa-f]+$/.test(digits))
|
|
67687
|
+
return null;
|
|
67688
|
+
const codePoint = Number.parseInt(digits, 16);
|
|
67689
|
+
if (codePoint > 1114111)
|
|
67690
|
+
return null;
|
|
67691
|
+
return { value: String.fromCodePoint(codePoint), nextIndex: digitsStart + digitCount };
|
|
67692
|
+
}
|
|
67693
|
+
function parseBareTomlKey(input, startIndex) {
|
|
67694
|
+
let index = startIndex;
|
|
67695
|
+
while (index < input.length && /[A-Za-z0-9_-]/.test(input[index]))
|
|
67696
|
+
index += 1;
|
|
67697
|
+
if (index === startIndex)
|
|
67698
|
+
return null;
|
|
67699
|
+
return { value: input.slice(startIndex, index), nextIndex: index };
|
|
67700
|
+
}
|
|
67701
|
+
function skipWhitespace(input, startIndex) {
|
|
67702
|
+
let index = startIndex;
|
|
67703
|
+
while (index < input.length && /\s/.test(input[index]))
|
|
67704
|
+
index += 1;
|
|
67705
|
+
return index;
|
|
67706
|
+
}
|
|
67461
67707
|
|
|
67462
67708
|
// packages/omo-codex/src/install/codex-config-toml-sections.ts
|
|
67463
67709
|
function removeTomlSections(config, shouldRemove) {
|
|
@@ -67486,27 +67732,18 @@ function splitTomlSections(config) {
|
|
|
67486
67732
|
return sections;
|
|
67487
67733
|
}
|
|
67488
67734
|
function parsePluginHeaderKey(header) {
|
|
67489
|
-
const
|
|
67490
|
-
|
|
67491
|
-
return null;
|
|
67492
|
-
return parseLeadingJsonString(header.slice(prefix.length));
|
|
67735
|
+
const path7 = parseTomlDottedKey(header);
|
|
67736
|
+
return path7?.[0] === "plugins" ? path7[1] ?? null : null;
|
|
67493
67737
|
}
|
|
67494
67738
|
function parseAgentHeaderName(header) {
|
|
67495
|
-
const
|
|
67496
|
-
|
|
67497
|
-
return null;
|
|
67498
|
-
const key = header.slice(prefix.length);
|
|
67499
|
-
return key.startsWith('"') ? parseLeadingJsonString(key) : key;
|
|
67739
|
+
const path7 = parseTomlDottedKey(header);
|
|
67740
|
+
return path7?.[0] === "agents" ? path7[1] ?? null : null;
|
|
67500
67741
|
}
|
|
67501
|
-
function
|
|
67502
|
-
|
|
67503
|
-
|
|
67504
|
-
return typeof parsed === "string" ? parsed : null;
|
|
67505
|
-
} catch (error) {
|
|
67506
|
-
if (error instanceof Error)
|
|
67507
|
-
return null;
|
|
67742
|
+
function parseHookStateHeaderKey(header) {
|
|
67743
|
+
const path7 = parseTomlDottedKey(header);
|
|
67744
|
+
if (path7?.[0] !== "hooks" || path7[1] !== "state")
|
|
67508
67745
|
return null;
|
|
67509
|
-
|
|
67746
|
+
return path7[2] ?? null;
|
|
67510
67747
|
}
|
|
67511
67748
|
function parseTomlHeader(line) {
|
|
67512
67749
|
const trimmed = line.trim();
|
|
@@ -67514,25 +67751,6 @@ function parseTomlHeader(line) {
|
|
|
67514
67751
|
return null;
|
|
67515
67752
|
return trimmed.slice(1, -1);
|
|
67516
67753
|
}
|
|
67517
|
-
function parseLeadingJsonString(value) {
|
|
67518
|
-
if (!value.startsWith('"'))
|
|
67519
|
-
return parseJsonString(value);
|
|
67520
|
-
let escaped = false;
|
|
67521
|
-
for (let index = 1;index < value.length; index += 1) {
|
|
67522
|
-
const char = value[index];
|
|
67523
|
-
if (escaped) {
|
|
67524
|
-
escaped = false;
|
|
67525
|
-
continue;
|
|
67526
|
-
}
|
|
67527
|
-
if (char === "\\") {
|
|
67528
|
-
escaped = true;
|
|
67529
|
-
continue;
|
|
67530
|
-
}
|
|
67531
|
-
if (char === '"')
|
|
67532
|
-
return parseJsonString(value.slice(0, index + 1));
|
|
67533
|
-
}
|
|
67534
|
-
return null;
|
|
67535
|
-
}
|
|
67536
67754
|
|
|
67537
67755
|
// packages/omo-codex/src/install/codex-config-agents.ts
|
|
67538
67756
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE = ["codex-ultrawork-reviewer"];
|
|
@@ -67576,12 +67794,12 @@ function tomlKeySegment(value) {
|
|
|
67576
67794
|
|
|
67577
67795
|
// packages/omo-codex/src/install/codex-config-atomic-write.ts
|
|
67578
67796
|
import { lstat as lstat5, readlink as readlink3, realpath, rename as rename2, unlink, writeFile as writeFile5 } from "fs/promises";
|
|
67579
|
-
import { basename as
|
|
67797
|
+
import { basename as basename8, dirname as dirname13, isAbsolute as isAbsolute6, join as join36, resolve as resolve11 } from "path";
|
|
67580
67798
|
var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
|
|
67581
67799
|
var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
|
|
67582
67800
|
async function writeFileAtomic(targetPath, data) {
|
|
67583
67801
|
const writeTarget = await resolveSymlinkTarget(targetPath);
|
|
67584
|
-
const temporaryPath =
|
|
67802
|
+
const temporaryPath = join36(dirname13(writeTarget), `.tmp-${basename8(writeTarget)}-${process.pid}-${Date.now()}`);
|
|
67585
67803
|
await writeFile5(temporaryPath, data);
|
|
67586
67804
|
try {
|
|
67587
67805
|
await renameWithRetry(temporaryPath, writeTarget);
|
|
@@ -67610,7 +67828,7 @@ async function resolveSymlinkTarget(targetPath) {
|
|
|
67610
67828
|
if (!(error instanceof Error))
|
|
67611
67829
|
throw error;
|
|
67612
67830
|
const linkValue = await readlink3(targetPath);
|
|
67613
|
-
return isAbsolute6(linkValue) ? linkValue : resolve11(
|
|
67831
|
+
return isAbsolute6(linkValue) ? linkValue : resolve11(dirname13(targetPath), linkValue);
|
|
67614
67832
|
}
|
|
67615
67833
|
}
|
|
67616
67834
|
async function renameWithRetry(fromPath, toPath) {
|
|
@@ -67669,10 +67887,7 @@ function removeStaleMarketplacePluginBlocks(config, marketplaceName, keepPluginN
|
|
|
67669
67887
|
}
|
|
67670
67888
|
function removeStaleMarketplaceHookStateBlocks(config, marketplaceName, keepPluginNames) {
|
|
67671
67889
|
return removeTomlSections(config, (header) => {
|
|
67672
|
-
const
|
|
67673
|
-
if (!header.startsWith(prefix))
|
|
67674
|
-
return false;
|
|
67675
|
-
const hookKey = parseJsonString(header.slice(prefix.length));
|
|
67890
|
+
const hookKey = parseHookStateHeaderKey(header);
|
|
67676
67891
|
if (hookKey === null)
|
|
67677
67892
|
return false;
|
|
67678
67893
|
const separator = hookKey.indexOf(":");
|
|
@@ -67757,9 +67972,10 @@ enabled = true
|
|
|
67757
67972
|
function ensureOmoBuiltinMcpPolicies(config, input) {
|
|
67758
67973
|
if (input.marketplaceName !== "sisyphuslabs" || !input.pluginNames.includes("omo"))
|
|
67759
67974
|
return config;
|
|
67975
|
+
const codegraphEnabled = input.codegraphMcpEnabled ?? true;
|
|
67760
67976
|
const gitBashEnabled = (input.platform ?? process.platform) === "win32" && input.gitBashEnabled === true;
|
|
67761
67977
|
let nextConfig = ensurePluginMcpEnabled(config, "omo@sisyphuslabs", "context7", true);
|
|
67762
|
-
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "codegraph",
|
|
67978
|
+
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "codegraph", codegraphEnabled);
|
|
67763
67979
|
nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "git_bash", gitBashEnabled);
|
|
67764
67980
|
return nextConfig;
|
|
67765
67981
|
}
|
|
@@ -67852,7 +68068,7 @@ function isRootSetting(line, key) {
|
|
|
67852
68068
|
|
|
67853
68069
|
// packages/omo-codex/src/install/codex-model-catalog.ts
|
|
67854
68070
|
import { readFile as readFile9 } from "fs/promises";
|
|
67855
|
-
import { join as
|
|
68071
|
+
import { join as join37 } from "path";
|
|
67856
68072
|
var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
67857
68073
|
current: {
|
|
67858
68074
|
model: "gpt-5.5",
|
|
@@ -67871,7 +68087,7 @@ var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
|
67871
68087
|
]
|
|
67872
68088
|
};
|
|
67873
68089
|
async function readCodexModelCatalog(codexPackageRoot) {
|
|
67874
|
-
const catalogPath =
|
|
68090
|
+
const catalogPath = join37(codexPackageRoot, "plugin", "model-catalog.json");
|
|
67875
68091
|
try {
|
|
67876
68092
|
const parsed = JSON.parse(await readFile9(catalogPath, "utf8"));
|
|
67877
68093
|
return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
|
|
@@ -67951,7 +68167,7 @@ function removeLegacyAgentsMaxThreadsSetting(config) {
|
|
|
67951
68167
|
|
|
67952
68168
|
// packages/omo-codex/src/install/codex-config-toml.ts
|
|
67953
68169
|
async function updateCodexConfig(input) {
|
|
67954
|
-
await mkdir5(
|
|
68170
|
+
await mkdir5(dirname14(input.configPath), { recursive: true });
|
|
67955
68171
|
let config = "";
|
|
67956
68172
|
if (await exists(input.configPath))
|
|
67957
68173
|
config = await readFile10(input.configPath, "utf8");
|
|
@@ -68002,7 +68218,7 @@ async function exists(path7) {
|
|
|
68002
68218
|
// packages/omo-codex/src/install/codex-hook-trust.ts
|
|
68003
68219
|
import { createHash as createHash2 } from "crypto";
|
|
68004
68220
|
import { readFile as readFile11 } from "fs/promises";
|
|
68005
|
-
import { join as
|
|
68221
|
+
import { join as join38 } from "path";
|
|
68006
68222
|
var EVENT_LABELS = new Map([
|
|
68007
68223
|
["PreToolUse", "pre_tool_use"],
|
|
68008
68224
|
["PermissionRequest", "permission_request"],
|
|
@@ -68016,7 +68232,7 @@ var EVENT_LABELS = new Map([
|
|
|
68016
68232
|
["Stop", "stop"]
|
|
68017
68233
|
]);
|
|
68018
68234
|
async function trustedHookStatesForPlugin(input) {
|
|
68019
|
-
const manifestPath =
|
|
68235
|
+
const manifestPath = join38(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
68020
68236
|
if (!await exists2(manifestPath))
|
|
68021
68237
|
return [];
|
|
68022
68238
|
const manifest = JSON.parse(await readFile11(manifestPath, "utf8"));
|
|
@@ -68024,7 +68240,7 @@ async function trustedHookStatesForPlugin(input) {
|
|
|
68024
68240
|
return [];
|
|
68025
68241
|
const states = [];
|
|
68026
68242
|
for (const hookPath of hookManifestPaths2(manifest.hooks)) {
|
|
68027
|
-
const hooksPath =
|
|
68243
|
+
const hooksPath = join38(input.pluginRoot, hookPath);
|
|
68028
68244
|
if (!await exists2(hooksPath))
|
|
68029
68245
|
continue;
|
|
68030
68246
|
const parsed = JSON.parse(await readFile11(hooksPath, "utf8"));
|
|
@@ -68154,11 +68370,11 @@ function toCodexResolution(resolution) {
|
|
|
68154
68370
|
|
|
68155
68371
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
68156
68372
|
import { copyFile, lstat as lstat7, mkdir as mkdir6, readFile as readFile13, readdir as readdir4, rm as rm6, writeFile as writeFile6 } from "fs/promises";
|
|
68157
|
-
import { basename as
|
|
68373
|
+
import { basename as basename9, join as join40 } from "path";
|
|
68158
68374
|
|
|
68159
68375
|
// packages/omo-codex/src/install/retired-managed-agent-purge.ts
|
|
68160
68376
|
import { lstat as lstat6, readFile as readFile12, rm as rm5 } from "fs/promises";
|
|
68161
|
-
import { join as
|
|
68377
|
+
import { join as join39 } from "path";
|
|
68162
68378
|
var RETIRED_MANAGED_AGENT_FILES = [
|
|
68163
68379
|
{
|
|
68164
68380
|
fileName: "codex-ultrawork-reviewer.toml",
|
|
@@ -68170,11 +68386,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
|
|
|
68170
68386
|
}
|
|
68171
68387
|
];
|
|
68172
68388
|
async function purgeRetiredManagedAgentFiles(input) {
|
|
68173
|
-
const agentsDir =
|
|
68389
|
+
const agentsDir = join39(input.codexHome, "agents");
|
|
68174
68390
|
if (!await exists3(agentsDir))
|
|
68175
68391
|
return;
|
|
68176
68392
|
for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
|
|
68177
|
-
const agentPath =
|
|
68393
|
+
const agentPath = join39(agentsDir, retiredAgent.fileName);
|
|
68178
68394
|
if (!await exists3(agentPath))
|
|
68179
68395
|
continue;
|
|
68180
68396
|
const agentStat = await lstat6(agentPath);
|
|
@@ -68217,7 +68433,7 @@ function nodeErrorCode(error) {
|
|
|
68217
68433
|
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
|
|
68218
68434
|
var MANIFEST_FILE = ".installed-agents.json";
|
|
68219
68435
|
async function capturePreservedAgentReasoning(input) {
|
|
68220
|
-
const agentsDir =
|
|
68436
|
+
const agentsDir = join40(input.codexHome, "agents");
|
|
68221
68437
|
if (!await exists4(agentsDir))
|
|
68222
68438
|
return new Map;
|
|
68223
68439
|
const preserved = new Map;
|
|
@@ -68225,7 +68441,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
68225
68441
|
for (const entry of agentEntries) {
|
|
68226
68442
|
if (!entry.name.endsWith(".toml"))
|
|
68227
68443
|
continue;
|
|
68228
|
-
const content = await readTextIfExists2(
|
|
68444
|
+
const content = await readTextIfExists2(join40(agentsDir, entry.name));
|
|
68229
68445
|
if (content === null)
|
|
68230
68446
|
continue;
|
|
68231
68447
|
const effort = extractReasoningEffort(content);
|
|
@@ -68235,7 +68451,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
68235
68451
|
return preserved;
|
|
68236
68452
|
}
|
|
68237
68453
|
async function capturePreservedAgentServiceTier(input) {
|
|
68238
|
-
const agentsDir =
|
|
68454
|
+
const agentsDir = join40(input.codexHome, "agents");
|
|
68239
68455
|
if (!await exists4(agentsDir))
|
|
68240
68456
|
return new Map;
|
|
68241
68457
|
const preserved = new Map;
|
|
@@ -68243,7 +68459,7 @@ async function capturePreservedAgentServiceTier(input) {
|
|
|
68243
68459
|
for (const entry of agentEntries) {
|
|
68244
68460
|
if (!entry.name.endsWith(".toml"))
|
|
68245
68461
|
continue;
|
|
68246
|
-
const content = await readTextIfExists2(
|
|
68462
|
+
const content = await readTextIfExists2(join40(agentsDir, entry.name));
|
|
68247
68463
|
if (content === null)
|
|
68248
68464
|
continue;
|
|
68249
68465
|
preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
|
|
@@ -68257,13 +68473,13 @@ async function linkCachedPluginAgents(input) {
|
|
|
68257
68473
|
await writeManifest(input.pluginRoot, []);
|
|
68258
68474
|
return [];
|
|
68259
68475
|
}
|
|
68260
|
-
const agentsDir =
|
|
68476
|
+
const agentsDir = join40(input.codexHome, "agents");
|
|
68261
68477
|
await mkdir6(agentsDir, { recursive: true });
|
|
68262
68478
|
const linked = [];
|
|
68263
68479
|
for (const agentPath of bundledAgents) {
|
|
68264
|
-
const agentFileName =
|
|
68480
|
+
const agentFileName = basename9(agentPath);
|
|
68265
68481
|
const agentName = agentNameFromToml(agentFileName);
|
|
68266
|
-
const linkPath =
|
|
68482
|
+
const linkPath = join40(agentsDir, agentFileName);
|
|
68267
68483
|
await replaceWithCopy(linkPath, agentPath);
|
|
68268
68484
|
await restorePreservedReasoning({
|
|
68269
68485
|
agentName,
|
|
@@ -68293,7 +68509,7 @@ async function restorePreservedServiceTier(input) {
|
|
|
68293
68509
|
await writeFile6(input.linkPath, replacement.content);
|
|
68294
68510
|
}
|
|
68295
68511
|
async function discoverBundledAgents(pluginRoot) {
|
|
68296
|
-
const componentsRoot =
|
|
68512
|
+
const componentsRoot = join40(pluginRoot, "components");
|
|
68297
68513
|
if (!await exists4(componentsRoot))
|
|
68298
68514
|
return [];
|
|
68299
68515
|
const componentEntries = await readdir4(componentsRoot, { withFileTypes: true });
|
|
@@ -68301,14 +68517,14 @@ async function discoverBundledAgents(pluginRoot) {
|
|
|
68301
68517
|
for (const entry of componentEntries) {
|
|
68302
68518
|
if (!entry.isDirectory())
|
|
68303
68519
|
continue;
|
|
68304
|
-
const agentsRoot =
|
|
68520
|
+
const agentsRoot = join40(componentsRoot, entry.name, "agents");
|
|
68305
68521
|
if (!await exists4(agentsRoot))
|
|
68306
68522
|
continue;
|
|
68307
68523
|
const agentEntries = await readdir4(agentsRoot, { withFileTypes: true });
|
|
68308
68524
|
for (const file2 of agentEntries) {
|
|
68309
68525
|
if (!file2.isFile() || !file2.name.endsWith(".toml"))
|
|
68310
68526
|
continue;
|
|
68311
|
-
agents.push(
|
|
68527
|
+
agents.push(join40(agentsRoot, file2.name));
|
|
68312
68528
|
}
|
|
68313
68529
|
}
|
|
68314
68530
|
agents.sort();
|
|
@@ -68328,7 +68544,7 @@ async function prepareReplacement(linkPath) {
|
|
|
68328
68544
|
await rm6(linkPath, { force: true });
|
|
68329
68545
|
}
|
|
68330
68546
|
async function writeManifest(pluginRoot, agentPaths) {
|
|
68331
|
-
const manifestPath =
|
|
68547
|
+
const manifestPath = join40(pluginRoot, MANIFEST_FILE);
|
|
68332
68548
|
const payload = { agents: [...agentPaths].sort() };
|
|
68333
68549
|
await writeFile6(manifestPath, `${JSON.stringify(payload, null, "\t")}
|
|
68334
68550
|
`);
|
|
@@ -68367,7 +68583,7 @@ function extractTopLevelStringSetting(content, key) {
|
|
|
68367
68583
|
const rawValue = topLevelStringSettingRawValue(line, key);
|
|
68368
68584
|
if (rawValue === undefined)
|
|
68369
68585
|
continue;
|
|
68370
|
-
const parsed =
|
|
68586
|
+
const parsed = parseJsonString(rawValue);
|
|
68371
68587
|
if (parsed !== null)
|
|
68372
68588
|
return parsed;
|
|
68373
68589
|
}
|
|
@@ -68428,7 +68644,7 @@ function isSectionHeader2(line) {
|
|
|
68428
68644
|
function agentNameFromToml(fileName) {
|
|
68429
68645
|
return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
|
|
68430
68646
|
}
|
|
68431
|
-
function
|
|
68647
|
+
function parseJsonString(value) {
|
|
68432
68648
|
try {
|
|
68433
68649
|
const parsed = JSON.parse(value);
|
|
68434
68650
|
return typeof parsed === "string" ? parsed : null;
|
|
@@ -68456,10 +68672,10 @@ function nodeErrorCode2(error) {
|
|
|
68456
68672
|
|
|
68457
68673
|
// packages/omo-codex/src/install/codex-marketplace.ts
|
|
68458
68674
|
import { readFile as readFile14 } from "fs/promises";
|
|
68459
|
-
import { join as
|
|
68675
|
+
import { join as join41 } from "path";
|
|
68460
68676
|
var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
|
|
68461
68677
|
async function readMarketplace(repoRoot, options) {
|
|
68462
|
-
const marketplacePath = options?.marketplacePath ??
|
|
68678
|
+
const marketplacePath = options?.marketplacePath ?? join41(repoRoot, DEFAULT_MARKETPLACE_PATH);
|
|
68463
68679
|
const raw = await readFile14(marketplacePath, "utf8");
|
|
68464
68680
|
const parsed = JSON.parse(raw);
|
|
68465
68681
|
if (!isPlainRecord3(parsed))
|
|
@@ -68478,10 +68694,10 @@ async function readMarketplace(repoRoot, options) {
|
|
|
68478
68694
|
function resolvePluginSource(repoRoot, plugin, options) {
|
|
68479
68695
|
const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
|
|
68480
68696
|
const relativePath = sourcePath.slice(2);
|
|
68481
|
-
return
|
|
68697
|
+
return join41(repoRoot, ...relativePath.split(/[\\/]/));
|
|
68482
68698
|
}
|
|
68483
68699
|
async function readPluginManifest(pluginRoot) {
|
|
68484
|
-
const raw = await readFile14(
|
|
68700
|
+
const raw = await readFile14(join41(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
|
|
68485
68701
|
const parsed = JSON.parse(raw);
|
|
68486
68702
|
if (!isPlainRecord3(parsed))
|
|
68487
68703
|
throw new Error(`${pluginRoot} plugin.json must be an object`);
|
|
@@ -68563,7 +68779,7 @@ function validateLocalSourcePath(path7) {
|
|
|
68563
68779
|
|
|
68564
68780
|
// packages/omo-codex/src/install/codex-marketplace-snapshot.ts
|
|
68565
68781
|
import { cp as cp3, mkdir as mkdir7, rename as rename3, rm as rm7, writeFile as writeFile7 } from "fs/promises";
|
|
68566
|
-
import { join as
|
|
68782
|
+
import { join as join42, sep as sep6 } from "path";
|
|
68567
68783
|
var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
|
|
68568
68784
|
async function writeInstalledMarketplaceSnapshot(input) {
|
|
68569
68785
|
const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
|
|
@@ -68576,21 +68792,21 @@ async function writeInstalledMarketplaceSnapshot(input) {
|
|
|
68576
68792
|
return snapshotPlugins;
|
|
68577
68793
|
}
|
|
68578
68794
|
function installedMarketplaceRoot(codexHome, marketplaceName) {
|
|
68579
|
-
return
|
|
68795
|
+
return join42(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
|
|
68580
68796
|
}
|
|
68581
68797
|
async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
|
|
68582
|
-
const manifestDir =
|
|
68798
|
+
const manifestDir = join42(marketplaceRoot, ".agents", "plugins");
|
|
68583
68799
|
await mkdir7(manifestDir, { recursive: true });
|
|
68584
|
-
const tempPath =
|
|
68800
|
+
const tempPath = join42(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
|
|
68585
68801
|
await writeFile7(tempPath, `${JSON.stringify(marketplace, null, "\t")}
|
|
68586
68802
|
`);
|
|
68587
|
-
await rename3(tempPath,
|
|
68803
|
+
await rename3(tempPath, join42(manifestDir, "marketplace.json"));
|
|
68588
68804
|
}
|
|
68589
68805
|
async function writeSnapshotPlugin(marketplaceRoot, plugin) {
|
|
68590
|
-
const pluginsDir =
|
|
68806
|
+
const pluginsDir = join42(marketplaceRoot, "plugins");
|
|
68591
68807
|
await mkdir7(pluginsDir, { recursive: true });
|
|
68592
|
-
const targetPath =
|
|
68593
|
-
const tempPath =
|
|
68808
|
+
const targetPath = join42(pluginsDir, plugin.name);
|
|
68809
|
+
const tempPath = join42(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
|
|
68594
68810
|
await rm7(tempPath, { recursive: true, force: true });
|
|
68595
68811
|
await cp3(plugin.sourcePath, tempPath, {
|
|
68596
68812
|
recursive: true,
|
|
@@ -68612,10 +68828,10 @@ function shouldCopyMarketplaceSourcePath(path7, root) {
|
|
|
68612
68828
|
|
|
68613
68829
|
// packages/omo-codex/src/install/lazycodex-version-stamp.ts
|
|
68614
68830
|
import { readdir as readdir5, readFile as readFile15, writeFile as writeFile8 } from "fs/promises";
|
|
68615
|
-
import { join as
|
|
68831
|
+
import { join as join43 } from "path";
|
|
68616
68832
|
async function readDistributionManifest(repoRoot) {
|
|
68617
68833
|
try {
|
|
68618
|
-
const parsed = JSON.parse(await readFile15(
|
|
68834
|
+
const parsed = JSON.parse(await readFile15(join43(repoRoot, "package.json"), "utf8"));
|
|
68619
68835
|
if (!isPlainRecord3(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
|
|
68620
68836
|
return;
|
|
68621
68837
|
return {
|
|
@@ -68635,19 +68851,19 @@ function resolveLazyCodexPluginVersion(input) {
|
|
|
68635
68851
|
return input.manifestVersion ?? "local";
|
|
68636
68852
|
}
|
|
68637
68853
|
async function stampLazyCodexPluginVersion(input) {
|
|
68638
|
-
const manifestPath =
|
|
68854
|
+
const manifestPath = join43(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
68639
68855
|
const hookPaths = await readPluginHookPaths(manifestPath);
|
|
68640
68856
|
await stampJsonVersion(manifestPath, input.version);
|
|
68641
|
-
await stampJsonVersion(
|
|
68857
|
+
await stampJsonVersion(join43(input.pluginRoot, "package.json"), input.version);
|
|
68642
68858
|
for (const hookPath of hookPaths) {
|
|
68643
|
-
await stampHookStatusMessages(
|
|
68859
|
+
await stampHookStatusMessages(join43(input.pluginRoot, hookPath), input.version);
|
|
68644
68860
|
}
|
|
68645
68861
|
await stampComponentVersions(input);
|
|
68646
68862
|
}
|
|
68647
68863
|
async function writeLazyCodexInstallSnapshot(input) {
|
|
68648
68864
|
if (input.distributionManifest === undefined)
|
|
68649
68865
|
return;
|
|
68650
|
-
await writeFile8(
|
|
68866
|
+
await writeFile8(join43(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
|
|
68651
68867
|
packageName: input.distributionManifest.name,
|
|
68652
68868
|
version: input.distributionManifest.version
|
|
68653
68869
|
}, null, "\t")}
|
|
@@ -68704,16 +68920,16 @@ async function stampHookStatusMessages(path7, version) {
|
|
|
68704
68920
|
async function stampComponentVersions(input) {
|
|
68705
68921
|
let entries;
|
|
68706
68922
|
try {
|
|
68707
|
-
entries = await readdir5(
|
|
68923
|
+
entries = await readdir5(join43(input.pluginRoot, "components"));
|
|
68708
68924
|
} catch (error) {
|
|
68709
68925
|
if (error instanceof Error)
|
|
68710
68926
|
return;
|
|
68711
68927
|
throw error;
|
|
68712
68928
|
}
|
|
68713
68929
|
for (const entry of entries) {
|
|
68714
|
-
const componentRoot =
|
|
68715
|
-
await stampJsonVersion(
|
|
68716
|
-
await stampHookStatusMessages(
|
|
68930
|
+
const componentRoot = join43(input.pluginRoot, "components", entry);
|
|
68931
|
+
await stampJsonVersion(join43(componentRoot, "package.json"), input.version);
|
|
68932
|
+
await stampHookStatusMessages(join43(componentRoot, "hooks", "hooks.json"), input.version);
|
|
68717
68933
|
}
|
|
68718
68934
|
}
|
|
68719
68935
|
function stampHookGroups(hooks, version) {
|
|
@@ -68767,7 +68983,7 @@ var defaultRunCommand = async (command, args, options) => {
|
|
|
68767
68983
|
|
|
68768
68984
|
// packages/omo-codex/src/install/codex-project-local-cleanup.ts
|
|
68769
68985
|
import { copyFile as copyFile2, lstat as lstat8, readFile as readFile16, writeFile as writeFile9 } from "fs/promises";
|
|
68770
|
-
import { dirname as
|
|
68986
|
+
import { dirname as dirname15, join as join44, resolve as resolve12 } from "path";
|
|
68771
68987
|
var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
|
|
68772
68988
|
var PROJECT_LOCAL_ARTIFACT_PATHS = [
|
|
68773
68989
|
".codex/hooks.json",
|
|
@@ -68870,37 +69086,37 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
68870
69086
|
if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
|
|
68871
69087
|
throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
|
|
68872
69088
|
}
|
|
68873
|
-
const codexHomeConfigPath = codexHome === undefined ? null :
|
|
69089
|
+
const codexHomeConfigPath = codexHome === undefined ? null : join44(resolve12(codexHome), "config.toml");
|
|
68874
69090
|
let current = resolve12(startDirectory);
|
|
68875
69091
|
const configPathsFromCwd = [];
|
|
68876
69092
|
while (true) {
|
|
68877
|
-
const configPath =
|
|
69093
|
+
const configPath = join44(current, ".codex", "config.toml");
|
|
68878
69094
|
if (await isRegularProjectLocalConfig(current, configPath)) {
|
|
68879
69095
|
if (codexHomeConfigPath === null || resolve12(configPath) !== codexHomeConfigPath) {
|
|
68880
69096
|
configPathsFromCwd.push(configPath);
|
|
68881
69097
|
}
|
|
68882
69098
|
}
|
|
68883
|
-
if (await exists5(
|
|
69099
|
+
if (await exists5(join44(current, ".git"))) {
|
|
68884
69100
|
return configPathsFromCwd.length === 0 ? null : {
|
|
68885
69101
|
projectRoot: current,
|
|
68886
69102
|
configPaths: [...configPathsFromCwd].reverse(),
|
|
68887
69103
|
artifactRoots: artifactRootsForConfigPaths(configPathsFromCwd)
|
|
68888
69104
|
};
|
|
68889
69105
|
}
|
|
68890
|
-
const parent =
|
|
69106
|
+
const parent = dirname15(current);
|
|
68891
69107
|
if (parent === current) {
|
|
68892
69108
|
const nearestConfigPath = configPathsFromCwd[0];
|
|
68893
69109
|
return nearestConfigPath === undefined ? null : {
|
|
68894
|
-
projectRoot:
|
|
69110
|
+
projectRoot: dirname15(dirname15(nearestConfigPath)),
|
|
68895
69111
|
configPaths: [nearestConfigPath],
|
|
68896
|
-
artifactRoots: [
|
|
69112
|
+
artifactRoots: [dirname15(dirname15(nearestConfigPath))]
|
|
68897
69113
|
};
|
|
68898
69114
|
}
|
|
68899
69115
|
current = parent;
|
|
68900
69116
|
}
|
|
68901
69117
|
}
|
|
68902
69118
|
async function isRegularProjectLocalConfig(directory, configPath) {
|
|
68903
|
-
const codexDirStat = await maybeLstat(
|
|
69119
|
+
const codexDirStat = await maybeLstat(join44(directory, ".codex"));
|
|
68904
69120
|
if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
|
|
68905
69121
|
return false;
|
|
68906
69122
|
const configStat = await maybeLstat(configPath);
|
|
@@ -68909,7 +69125,7 @@ async function isRegularProjectLocalConfig(directory, configPath) {
|
|
|
68909
69125
|
function artifactRootsForConfigPaths(configPaths) {
|
|
68910
69126
|
const roots = [];
|
|
68911
69127
|
for (const configPath of configPaths) {
|
|
68912
|
-
const root =
|
|
69128
|
+
const root = dirname15(dirname15(configPath));
|
|
68913
69129
|
if (!roots.includes(root))
|
|
68914
69130
|
roots.push(root);
|
|
68915
69131
|
}
|
|
@@ -68920,7 +69136,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
|
|
|
68920
69136
|
const seenPaths = new Set;
|
|
68921
69137
|
for (const projectRoot of projectRoots) {
|
|
68922
69138
|
for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
|
|
68923
|
-
const artifactPath =
|
|
69139
|
+
const artifactPath = join44(projectRoot, relativePath);
|
|
68924
69140
|
if (seenPaths.has(artifactPath))
|
|
68925
69141
|
continue;
|
|
68926
69142
|
const entryStat = await maybeLstat(artifactPath);
|
|
@@ -68997,11 +69213,11 @@ function formatUnknownError(error) {
|
|
|
68997
69213
|
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
|
|
68998
69214
|
import { readFile as readFile17, readdir as readdir6, rm as rm8 } from "fs/promises";
|
|
68999
69215
|
import { connect } from "net";
|
|
69000
|
-
import { join as
|
|
69216
|
+
import { join as join45 } from "path";
|
|
69001
69217
|
async function reapLspDaemons(codexHome, deps = {}) {
|
|
69002
69218
|
const killProcess = deps.killProcess ?? sendSigterm;
|
|
69003
69219
|
const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
|
|
69004
|
-
const daemonRoot =
|
|
69220
|
+
const daemonRoot = join45(codexHome, "codex-lsp", "daemon");
|
|
69005
69221
|
const reaped = [];
|
|
69006
69222
|
let entries;
|
|
69007
69223
|
try {
|
|
@@ -69010,9 +69226,9 @@ async function reapLspDaemons(codexHome, deps = {}) {
|
|
|
69010
69226
|
return reaped;
|
|
69011
69227
|
}
|
|
69012
69228
|
for (const entry of entries) {
|
|
69013
|
-
const versionDir =
|
|
69014
|
-
const pid = await readPidFile(
|
|
69015
|
-
const socketPath = await readEndpointFile(
|
|
69229
|
+
const versionDir = join45(daemonRoot, entry);
|
|
69230
|
+
const pid = await readPidFile(join45(versionDir, "daemon.pid"));
|
|
69231
|
+
const socketPath = await readEndpointFile(join45(versionDir, "daemon.endpoint"));
|
|
69016
69232
|
if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
|
|
69017
69233
|
reaped.push(pid);
|
|
69018
69234
|
}
|
|
@@ -69066,7 +69282,7 @@ function sendSigterm(pid) {
|
|
|
69066
69282
|
|
|
69067
69283
|
// packages/omo-codex/src/install/codex-installer-bin-dir.ts
|
|
69068
69284
|
import { homedir as homedir5 } from "os";
|
|
69069
|
-
import { join as
|
|
69285
|
+
import { join as join46, resolve as resolve13 } from "path";
|
|
69070
69286
|
function resolveCodexInstallerBinDir(input) {
|
|
69071
69287
|
const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
|
|
69072
69288
|
if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
|
|
@@ -69075,15 +69291,15 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
69075
69291
|
const defaultCodexHome = resolve13(homeDir, ".codex");
|
|
69076
69292
|
const resolvedCodexHome = resolve13(input.codexHome);
|
|
69077
69293
|
if (resolvedCodexHome !== defaultCodexHome)
|
|
69078
|
-
return
|
|
69294
|
+
return join46(resolvedCodexHome, "bin");
|
|
69079
69295
|
return resolve13(homeDir, ".local", "bin");
|
|
69080
69296
|
}
|
|
69081
69297
|
|
|
69082
69298
|
// packages/omo-codex/src/install/omo-sot-migration.ts
|
|
69083
|
-
import { join as
|
|
69299
|
+
import { join as join47 } from "path";
|
|
69084
69300
|
async function seedAndMigrateOmoSot(input) {
|
|
69085
69301
|
const commandEnv = { ...input.env };
|
|
69086
|
-
const scriptPath =
|
|
69302
|
+
const scriptPath = join47(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
|
|
69087
69303
|
try {
|
|
69088
69304
|
await input.runCommand(process.execPath, [scriptPath, "--seed"], {
|
|
69089
69305
|
cwd: input.repoRoot,
|
|
@@ -69098,7 +69314,7 @@ async function seedAndMigrateOmoSot(input) {
|
|
|
69098
69314
|
|
|
69099
69315
|
// packages/omo-codex/src/install/install-ast-grep-sg.ts
|
|
69100
69316
|
init_src();
|
|
69101
|
-
import { join as
|
|
69317
|
+
import { join as join48 } from "path";
|
|
69102
69318
|
function describeResult(result) {
|
|
69103
69319
|
if (result.kind === "succeeded")
|
|
69104
69320
|
return null;
|
|
@@ -69112,7 +69328,7 @@ async function installAstGrepForCodex(options) {
|
|
|
69112
69328
|
return;
|
|
69113
69329
|
const platform = options.platform ?? process.platform;
|
|
69114
69330
|
const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
|
|
69115
|
-
const skillDir =
|
|
69331
|
+
const skillDir = join48(plugin.path, "skills", "ast-grep");
|
|
69116
69332
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
69117
69333
|
try {
|
|
69118
69334
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -69140,12 +69356,13 @@ async function trackCodexInstallTelemetry() {
|
|
|
69140
69356
|
}
|
|
69141
69357
|
|
|
69142
69358
|
// packages/omo-codex/src/install/install-codex.ts
|
|
69359
|
+
init_src();
|
|
69143
69360
|
var SISYPHUS_LEGACY_CACHE_MARKETPLACES = ["lazycodex", "code-yeongyu-codex-plugins"];
|
|
69144
69361
|
async function runCodexInstaller(options = {}) {
|
|
69145
69362
|
const env3 = options.env ?? process.env;
|
|
69146
69363
|
const platform = options.platform ?? process.platform;
|
|
69147
69364
|
const repoRoot = resolve14(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env3 }));
|
|
69148
|
-
const codexHome = resolve14(options.codexHome ?? env3.CODEX_HOME ??
|
|
69365
|
+
const codexHome = resolve14(options.codexHome ?? env3.CODEX_HOME ?? join51(homedir6(), ".codex"));
|
|
69149
69366
|
const projectDirectory = resolve14(options.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd());
|
|
69150
69367
|
const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env3 });
|
|
69151
69368
|
const runCommand = options.runCommand ?? defaultRunCommand;
|
|
@@ -69163,9 +69380,9 @@ async function runCodexInstaller(options = {}) {
|
|
|
69163
69380
|
if (!gitBashResolution.found) {
|
|
69164
69381
|
throw new Error(gitBashResolution.installHint);
|
|
69165
69382
|
}
|
|
69166
|
-
const codexPackageRoot =
|
|
69383
|
+
const codexPackageRoot = join51(repoRoot, "packages", "omo-codex");
|
|
69167
69384
|
const marketplace = await readMarketplace(repoRoot, {
|
|
69168
|
-
marketplacePath:
|
|
69385
|
+
marketplacePath: join51(codexPackageRoot, "marketplace.json")
|
|
69169
69386
|
});
|
|
69170
69387
|
const distributionManifest = await readDistributionManifest(repoRoot);
|
|
69171
69388
|
const installed = [];
|
|
@@ -69207,7 +69424,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
69207
69424
|
if (runtimeLink !== null)
|
|
69208
69425
|
log4(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
|
|
69209
69426
|
else
|
|
69210
|
-
log4(`Warning: skipped the omo runtime wrapper because ${
|
|
69427
|
+
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`);
|
|
69211
69428
|
}
|
|
69212
69429
|
pluginSources.push({ name: entry.name, sourcePath });
|
|
69213
69430
|
installed.push(plugin);
|
|
@@ -69260,13 +69477,13 @@ async function runCodexInstaller(options = {}) {
|
|
|
69260
69477
|
});
|
|
69261
69478
|
}
|
|
69262
69479
|
await reapLspDaemons(codexHome).catch(() => []);
|
|
69263
|
-
const marketplaceRoot =
|
|
69480
|
+
const marketplaceRoot = join51(codexHome, "plugins", "cache", marketplace.name);
|
|
69264
69481
|
await writeCachedMarketplaceManifest({
|
|
69265
69482
|
marketplaceName: marketplace.name,
|
|
69266
69483
|
marketplaceRoot,
|
|
69267
69484
|
plugins: installed
|
|
69268
69485
|
});
|
|
69269
|
-
const configPath =
|
|
69486
|
+
const configPath = join51(codexHome, "config.toml");
|
|
69270
69487
|
await updateCodexConfig({
|
|
69271
69488
|
configPath,
|
|
69272
69489
|
repoRoot: codexPackageRoot,
|
|
@@ -69274,6 +69491,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
69274
69491
|
marketplaceSource: codexMarketplaceSource(marketplaceRoot),
|
|
69275
69492
|
pluginNames: marketplace.plugins.map((plugin) => plugin.name),
|
|
69276
69493
|
platform,
|
|
69494
|
+
codegraphMcpEnabled: options.codegraphMcpEnabled ?? resolveCodegraphNodeSupport({ env: env3 }).supported,
|
|
69277
69495
|
gitBashEnabled: platform === "win32" && gitBashResolution.found,
|
|
69278
69496
|
trustedHookStates,
|
|
69279
69497
|
agentConfigs: [...agentConfigs.values()].sort((left, right) => left.name.localeCompare(right.name)),
|
|
@@ -69325,7 +69543,7 @@ function findRepoRootFromImporter(importerDir) {
|
|
|
69325
69543
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
69326
69544
|
if (isRepoRootWithCodexPlugin(current))
|
|
69327
69545
|
return current;
|
|
69328
|
-
for (const wrapperPackageRoot of [
|
|
69546
|
+
for (const wrapperPackageRoot of [join51(current, "node_modules", "oh-my-openagent"), join51(current, "oh-my-openagent")]) {
|
|
69329
69547
|
if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
|
|
69330
69548
|
return wrapperPackageRoot;
|
|
69331
69549
|
}
|
|
@@ -69343,7 +69561,7 @@ function findRepoRoot(input) {
|
|
|
69343
69561
|
return findRepoRootFromImporter(input.importerDir);
|
|
69344
69562
|
}
|
|
69345
69563
|
function isRepoRootWithCodexPlugin(repoRoot) {
|
|
69346
|
-
return
|
|
69564
|
+
return existsSync30(join51(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
|
|
69347
69565
|
}
|
|
69348
69566
|
function codexMarketplaceSource(marketplaceRoot) {
|
|
69349
69567
|
return { sourceType: "local", source: marketplaceRoot };
|
|
@@ -69351,7 +69569,7 @@ function codexMarketplaceSource(marketplaceRoot) {
|
|
|
69351
69569
|
// packages/omo-codex/src/install/codex-installation-detection.ts
|
|
69352
69570
|
init_bun_which_shim();
|
|
69353
69571
|
import { execFile as execFile2 } from "child_process";
|
|
69354
|
-
import { existsSync as
|
|
69572
|
+
import { existsSync as existsSync31 } from "fs";
|
|
69355
69573
|
import { homedir as homedir7 } from "os";
|
|
69356
69574
|
import { posix as posix3, win32 as win323 } from "path";
|
|
69357
69575
|
var CODEX_PATH_CHECK_LABEL = "codex (PATH)";
|
|
@@ -69364,7 +69582,7 @@ async function detectCodexInstallation(input = {}) {
|
|
|
69364
69582
|
const platform = input.platform ?? process.platform;
|
|
69365
69583
|
const env3 = input.env ?? process.env;
|
|
69366
69584
|
const homeDir = input.homeDir ?? homedir7();
|
|
69367
|
-
const exists6 = input.exists ??
|
|
69585
|
+
const exists6 = input.exists ?? existsSync31;
|
|
69368
69586
|
const which2 = input.which ?? bunWhich;
|
|
69369
69587
|
const checkedPaths = [CODEX_PATH_CHECK_LABEL];
|
|
69370
69588
|
const cliPath = nonEmptyValue2(which2("codex"));
|
|
@@ -69480,11 +69698,11 @@ function defaultRunCommand2(command, args) {
|
|
|
69480
69698
|
// packages/omo-codex/src/install/codex-cleanup.ts
|
|
69481
69699
|
import { lstat as lstat10, readFile as readFile19, readdir as readdir7, rm as rm9, rmdir } from "fs/promises";
|
|
69482
69700
|
import { homedir as homedir8 } from "os";
|
|
69483
|
-
import { isAbsolute as
|
|
69701
|
+
import { isAbsolute as isAbsolute9, join as join53, relative as relative7, resolve as resolve16 } from "path";
|
|
69484
69702
|
|
|
69485
69703
|
// packages/omo-codex/src/install/codex-cleanup-config.ts
|
|
69486
69704
|
import { lstat as lstat9, mkdir as mkdir8, readFile as readFile18, writeFile as writeFile10 } from "fs/promises";
|
|
69487
|
-
import { dirname as
|
|
69705
|
+
import { dirname as dirname17 } from "path";
|
|
69488
69706
|
var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
|
|
69489
69707
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
|
|
69490
69708
|
var CURRENT_MANAGED_CODEX_AGENT_NAMES2 = [
|
|
@@ -69518,7 +69736,7 @@ async function cleanupCodexConfig(configPath, now) {
|
|
|
69518
69736
|
if (next === original)
|
|
69519
69737
|
return { changed: false };
|
|
69520
69738
|
const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
|
|
69521
|
-
await mkdir8(
|
|
69739
|
+
await mkdir8(dirname17(configPath), { recursive: true });
|
|
69522
69740
|
await writeFile10(backupPath, original);
|
|
69523
69741
|
await writeFile10(configPath, `${next.trimEnd()}
|
|
69524
69742
|
`);
|
|
@@ -69529,21 +69747,18 @@ function removeManagedAgentBlocks(config) {
|
|
|
69529
69747
|
return splitTomlSections2(config).filter((section) => {
|
|
69530
69748
|
if (section.header === null)
|
|
69531
69749
|
return true;
|
|
69532
|
-
const agentName =
|
|
69750
|
+
const agentName = parseAgentHeaderName(section.header);
|
|
69533
69751
|
if (agentName === null || !managedAgentNames.has(agentName))
|
|
69534
69752
|
return true;
|
|
69535
69753
|
return !section.text.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`);
|
|
69536
69754
|
}).map((section) => section.text).join("");
|
|
69537
69755
|
}
|
|
69538
69756
|
function isManagedPluginHeader(header, marketplace) {
|
|
69539
|
-
const pluginKey =
|
|
69757
|
+
const pluginKey = parsePluginHeaderKey(header);
|
|
69540
69758
|
return pluginKey !== null && pluginKey.endsWith(`@${marketplace}`);
|
|
69541
69759
|
}
|
|
69542
69760
|
function isManagedHookStateHeader(header, marketplace) {
|
|
69543
|
-
const
|
|
69544
|
-
if (!header.startsWith(prefix))
|
|
69545
|
-
return false;
|
|
69546
|
-
const hookKey = parseJsonString3(header.slice(prefix.length));
|
|
69761
|
+
const hookKey = parseHookStateHeaderKey(header);
|
|
69547
69762
|
if (hookKey === null)
|
|
69548
69763
|
return false;
|
|
69549
69764
|
const separator = hookKey.indexOf(":");
|
|
@@ -69580,48 +69795,6 @@ function parseTomlHeader2(line) {
|
|
|
69580
69795
|
return null;
|
|
69581
69796
|
return trimmed.slice(1, -1);
|
|
69582
69797
|
}
|
|
69583
|
-
function parsePluginHeaderKey2(header) {
|
|
69584
|
-
const prefix = "plugins.";
|
|
69585
|
-
if (!header.startsWith(prefix))
|
|
69586
|
-
return null;
|
|
69587
|
-
return parseLeadingJsonString2(header.slice(prefix.length));
|
|
69588
|
-
}
|
|
69589
|
-
function parseAgentHeaderName2(header) {
|
|
69590
|
-
const prefix = "agents.";
|
|
69591
|
-
if (!header.startsWith(prefix))
|
|
69592
|
-
return null;
|
|
69593
|
-
const key = header.slice(prefix.length);
|
|
69594
|
-
return key.startsWith('"') ? parseLeadingJsonString2(key) : key;
|
|
69595
|
-
}
|
|
69596
|
-
function parseLeadingJsonString2(value) {
|
|
69597
|
-
if (!value.startsWith('"'))
|
|
69598
|
-
return parseJsonString3(value);
|
|
69599
|
-
let escaped = false;
|
|
69600
|
-
for (let index = 1;index < value.length; index += 1) {
|
|
69601
|
-
const char = value[index];
|
|
69602
|
-
if (escaped) {
|
|
69603
|
-
escaped = false;
|
|
69604
|
-
continue;
|
|
69605
|
-
}
|
|
69606
|
-
if (char === "\\") {
|
|
69607
|
-
escaped = true;
|
|
69608
|
-
continue;
|
|
69609
|
-
}
|
|
69610
|
-
if (char === '"')
|
|
69611
|
-
return parseJsonString3(value.slice(0, index + 1));
|
|
69612
|
-
}
|
|
69613
|
-
return null;
|
|
69614
|
-
}
|
|
69615
|
-
function parseJsonString3(value) {
|
|
69616
|
-
try {
|
|
69617
|
-
const parsed = JSON.parse(value);
|
|
69618
|
-
return typeof parsed === "string" ? parsed : null;
|
|
69619
|
-
} catch (error) {
|
|
69620
|
-
if (error instanceof Error)
|
|
69621
|
-
return null;
|
|
69622
|
-
return null;
|
|
69623
|
-
}
|
|
69624
|
-
}
|
|
69625
69798
|
function formatBackupTimestamp2(date) {
|
|
69626
69799
|
return date.toISOString().replace(/[:.]/g, "-");
|
|
69627
69800
|
}
|
|
@@ -69641,23 +69814,69 @@ function nodeErrorCode4(error) {
|
|
|
69641
69814
|
return typeof error.code === "string" ? error.code : null;
|
|
69642
69815
|
}
|
|
69643
69816
|
|
|
69817
|
+
// packages/omo-codex/src/install/codex-cleanup-safety.ts
|
|
69818
|
+
import { dirname as dirname18, isAbsolute as isAbsolute8, join as join52, relative as relative6, resolve as resolve15 } from "path";
|
|
69819
|
+
function validateManagedCleanupTarget(input) {
|
|
69820
|
+
if (!isAbsolute8(input.path))
|
|
69821
|
+
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
69822
|
+
const codexHome = resolve15(input.codexHome);
|
|
69823
|
+
if (dirname18(codexHome) === codexHome)
|
|
69824
|
+
return skipped(input.path, "Codex home resolves to a filesystem root");
|
|
69825
|
+
const target = resolve15(input.path);
|
|
69826
|
+
if (!isWithinDirectory(codexHome, target))
|
|
69827
|
+
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
69828
|
+
if (target === codexHome)
|
|
69829
|
+
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
69830
|
+
const exactManagedRoots = new Set([
|
|
69831
|
+
resolve15(join52(codexHome, "plugins", "cache", "sisyphuslabs")),
|
|
69832
|
+
resolve15(join52(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
|
|
69833
|
+
resolve15(join52(codexHome, "runtime", "ast-grep")),
|
|
69834
|
+
resolve15(join52(codexHome, "runtime", "node")),
|
|
69835
|
+
resolve15(join52(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
|
|
69836
|
+
]);
|
|
69837
|
+
if (exactManagedRoots.has(target))
|
|
69838
|
+
return null;
|
|
69839
|
+
if (isManagedBootstrapDriftPath(codexHome, target))
|
|
69840
|
+
return null;
|
|
69841
|
+
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
69842
|
+
}
|
|
69843
|
+
function isWithinDirectory(parent, child) {
|
|
69844
|
+
const relativePath = relative6(parent, child);
|
|
69845
|
+
return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute8(relativePath);
|
|
69846
|
+
}
|
|
69847
|
+
function isManagedBootstrapDriftPath(codexHome, target) {
|
|
69848
|
+
const relativePath = relative6(codexHome, target);
|
|
69849
|
+
const segments = relativePath.split(/[\\/]/);
|
|
69850
|
+
if (segments[0] !== "plugins")
|
|
69851
|
+
return false;
|
|
69852
|
+
if (segments[segments.length - 1] !== "bootstrap")
|
|
69853
|
+
return false;
|
|
69854
|
+
const ownerName = segments[segments.length - 2];
|
|
69855
|
+
return ownerName !== undefined && ownerName.startsWith("omo") && ownerName.slice("omo".length).includes("sisyphuslabs");
|
|
69856
|
+
}
|
|
69857
|
+
function skipped(path7, reason) {
|
|
69858
|
+
return { path: path7, reason };
|
|
69859
|
+
}
|
|
69860
|
+
|
|
69644
69861
|
// packages/omo-codex/src/install/codex-cleanup.ts
|
|
69645
69862
|
var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
|
|
69646
69863
|
async function cleanupCodexLight(input = {}) {
|
|
69647
69864
|
const env3 = input.env ?? process.env;
|
|
69648
|
-
const codexHome =
|
|
69649
|
-
const configPath =
|
|
69865
|
+
const codexHome = resolve16(input.codexHome ?? env3.CODEX_HOME ?? join53(homedir8(), ".codex"));
|
|
69866
|
+
const configPath = join53(codexHome, "config.toml");
|
|
69650
69867
|
const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
|
|
69651
69868
|
const configCleanup = await cleanupCodexConfig(configPath, input.now);
|
|
69652
69869
|
const agentCleanup = await removeManifestListedAgentLinks(codexHome, agentPaths);
|
|
69653
69870
|
const removedPaths = [];
|
|
69871
|
+
const skippedPaths = [];
|
|
69654
69872
|
const managedStatePaths = new Set([
|
|
69655
69873
|
...managedGlobalStatePaths(codexHome),
|
|
69656
69874
|
...await collectBootstrapDataDirsByGlob(codexHome)
|
|
69657
69875
|
]);
|
|
69658
69876
|
for (const path7 of managedStatePaths) {
|
|
69659
|
-
if (await removeManagedPathBestEffort(path7))
|
|
69877
|
+
if (await removeManagedPathBestEffort(path7, { codexHome, onSkip: (skip) => skippedPaths.push(skip) })) {
|
|
69660
69878
|
removedPaths.push(path7);
|
|
69879
|
+
}
|
|
69661
69880
|
}
|
|
69662
69881
|
await pruneEmptyRuntimeDirBestEffort(codexHome);
|
|
69663
69882
|
const projectDirectory = input.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd();
|
|
@@ -69675,6 +69894,7 @@ async function cleanupCodexLight(input = {}) {
|
|
|
69675
69894
|
configChanged: configCleanup.changed,
|
|
69676
69895
|
configBackupPath: configCleanup.backupPath,
|
|
69677
69896
|
removedPaths,
|
|
69897
|
+
skippedPaths,
|
|
69678
69898
|
removedAgentLinks: agentCleanup.removed,
|
|
69679
69899
|
skippedAgentLinks: agentCleanup.skipped,
|
|
69680
69900
|
projectCleanup
|
|
@@ -69682,17 +69902,17 @@ async function cleanupCodexLight(input = {}) {
|
|
|
69682
69902
|
}
|
|
69683
69903
|
function managedGlobalStatePaths(codexHome) {
|
|
69684
69904
|
return [
|
|
69685
|
-
|
|
69686
|
-
|
|
69687
|
-
|
|
69688
|
-
|
|
69689
|
-
|
|
69905
|
+
join53(codexHome, "plugins", "cache", "sisyphuslabs"),
|
|
69906
|
+
join53(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
|
|
69907
|
+
join53(codexHome, "runtime", "ast-grep"),
|
|
69908
|
+
join53(codexHome, "runtime", "node"),
|
|
69909
|
+
join53(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
|
|
69690
69910
|
];
|
|
69691
69911
|
}
|
|
69692
69912
|
var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
|
|
69693
69913
|
async function collectBootstrapDataDirsByGlob(codexHome) {
|
|
69694
69914
|
const results = [];
|
|
69695
|
-
await walkForManagedBootstrapDirs(
|
|
69915
|
+
await walkForManagedBootstrapDirs(join53(codexHome, "plugins"), 0, results);
|
|
69696
69916
|
return results;
|
|
69697
69917
|
}
|
|
69698
69918
|
async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
@@ -69704,9 +69924,9 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
|
69704
69924
|
for (const entry of entries) {
|
|
69705
69925
|
if (!entry.isDirectory())
|
|
69706
69926
|
continue;
|
|
69707
|
-
const childPath =
|
|
69927
|
+
const childPath = join53(directory, entry.name);
|
|
69708
69928
|
if (isManagedBootstrapOwnerName(entry.name)) {
|
|
69709
|
-
const bootstrapDir =
|
|
69929
|
+
const bootstrapDir = join53(childPath, "bootstrap");
|
|
69710
69930
|
if (await exists6(bootstrapDir))
|
|
69711
69931
|
results.push(bootstrapDir);
|
|
69712
69932
|
continue;
|
|
@@ -69717,7 +69937,12 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
|
69717
69937
|
function isManagedBootstrapOwnerName(name) {
|
|
69718
69938
|
return name.startsWith("omo") && name.slice("omo".length).includes("sisyphuslabs");
|
|
69719
69939
|
}
|
|
69720
|
-
async function removeManagedPathBestEffort(path7, seams
|
|
69940
|
+
async function removeManagedPathBestEffort(path7, seams) {
|
|
69941
|
+
const skip = validateManagedCleanupTarget({ codexHome: seams.codexHome, path: path7 });
|
|
69942
|
+
if (skip !== null) {
|
|
69943
|
+
seams.onSkip?.(skip);
|
|
69944
|
+
return false;
|
|
69945
|
+
}
|
|
69721
69946
|
const removedOnFirstAttempt = await attemptRemove(path7);
|
|
69722
69947
|
await seams.afterFirstAttempt?.();
|
|
69723
69948
|
const removedOnRetry = await attemptRemove(path7);
|
|
@@ -69735,19 +69960,26 @@ async function attemptRemove(path7) {
|
|
|
69735
69960
|
}
|
|
69736
69961
|
async function pruneEmptyRuntimeDirBestEffort(codexHome) {
|
|
69737
69962
|
try {
|
|
69738
|
-
await rmdir(
|
|
69739
|
-
} catch {
|
|
69963
|
+
await rmdir(join53(codexHome, "runtime"));
|
|
69964
|
+
} catch (error) {
|
|
69965
|
+
if (isExpectedRuntimePruneFailure(error))
|
|
69966
|
+
return;
|
|
69967
|
+
throw error;
|
|
69968
|
+
}
|
|
69969
|
+
}
|
|
69970
|
+
function isExpectedRuntimePruneFailure(error) {
|
|
69971
|
+
return ["ENOENT", "ENOTEMPTY", "EEXIST", "EPERM", "EBUSY", "ENOTDIR"].includes(nodeErrorCode5(error) ?? "");
|
|
69740
69972
|
}
|
|
69741
69973
|
async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
69742
69974
|
const manifestPaths = [
|
|
69743
|
-
|
|
69975
|
+
join53(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
|
|
69744
69976
|
];
|
|
69745
|
-
const versionRoot =
|
|
69977
|
+
const versionRoot = join53(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
|
|
69746
69978
|
if (await exists6(versionRoot)) {
|
|
69747
69979
|
const entries = await readdir7(versionRoot, { withFileTypes: true });
|
|
69748
69980
|
for (const entry of entries) {
|
|
69749
69981
|
if (entry.isDirectory())
|
|
69750
|
-
manifestPaths.push(
|
|
69982
|
+
manifestPaths.push(join53(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
|
|
69751
69983
|
}
|
|
69752
69984
|
}
|
|
69753
69985
|
const paths = new Set;
|
|
@@ -69765,7 +69997,7 @@ async function readManagedAgentPathsFromConfig(codexHome, configPath) {
|
|
|
69765
69997
|
if (!await exists6(configPath))
|
|
69766
69998
|
return [];
|
|
69767
69999
|
const config = await readFile19(configPath, "utf8");
|
|
69768
|
-
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) =>
|
|
70000
|
+
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join53(codexHome, "agents", `${agentName}.toml`));
|
|
69769
70001
|
}
|
|
69770
70002
|
async function readInstalledAgentManifest(manifestPath) {
|
|
69771
70003
|
if (!await exists6(manifestPath))
|
|
@@ -69776,31 +70008,31 @@ async function readInstalledAgentManifest(manifestPath) {
|
|
|
69776
70008
|
return parsed.agents.filter((path7) => typeof path7 === "string");
|
|
69777
70009
|
}
|
|
69778
70010
|
async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
69779
|
-
const agentsDir =
|
|
70011
|
+
const agentsDir = join53(codexHome, "agents");
|
|
69780
70012
|
const removed = [];
|
|
69781
|
-
const
|
|
70013
|
+
const skipped2 = [];
|
|
69782
70014
|
for (const path7 of paths) {
|
|
69783
70015
|
if (!isSafeManagedAgentPath(agentsDir, path7)) {
|
|
69784
|
-
|
|
70016
|
+
skipped2.push(path7);
|
|
69785
70017
|
continue;
|
|
69786
70018
|
}
|
|
69787
70019
|
const entryStat = await maybeLstat2(path7);
|
|
69788
70020
|
if (entryStat === null)
|
|
69789
70021
|
continue;
|
|
69790
70022
|
if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
|
|
69791
|
-
|
|
70023
|
+
skipped2.push(path7);
|
|
69792
70024
|
continue;
|
|
69793
70025
|
}
|
|
69794
70026
|
await rm9(path7, { force: true });
|
|
69795
70027
|
removed.push(path7);
|
|
69796
70028
|
}
|
|
69797
|
-
return { removed, skipped };
|
|
70029
|
+
return { removed, skipped: skipped2 };
|
|
69798
70030
|
}
|
|
69799
70031
|
function isSafeManagedAgentPath(agentsDir, path7) {
|
|
69800
|
-
if (!
|
|
70032
|
+
if (!isAbsolute9(path7))
|
|
69801
70033
|
return false;
|
|
69802
|
-
const relativePath =
|
|
69803
|
-
if (relativePath === "" || relativePath.startsWith("..") ||
|
|
70034
|
+
const relativePath = relative7(agentsDir, path7);
|
|
70035
|
+
if (relativePath === "" || relativePath.startsWith("..") || isAbsolute9(relativePath))
|
|
69804
70036
|
return false;
|
|
69805
70037
|
const fileName = relativePath.split(/[\\/]/).pop();
|
|
69806
70038
|
if (fileName === undefined)
|
|
@@ -69859,23 +70091,23 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
|
|
|
69859
70091
|
init_provider_availability();
|
|
69860
70092
|
|
|
69861
70093
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
69862
|
-
import { existsSync as
|
|
69863
|
-
import { join as
|
|
70094
|
+
import { existsSync as existsSync33, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "fs";
|
|
70095
|
+
import { join as join55 } from "path";
|
|
69864
70096
|
|
|
69865
70097
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
69866
70098
|
init_shared();
|
|
69867
|
-
import { existsSync as
|
|
69868
|
-
import { join as
|
|
70099
|
+
import { existsSync as existsSync32, readFileSync as readFileSync15 } from "fs";
|
|
70100
|
+
import { join as join54 } from "path";
|
|
69869
70101
|
var TUI_SUBPATH = "tui";
|
|
69870
70102
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
69871
70103
|
function fileEntryPackageJsonPath(entry) {
|
|
69872
70104
|
let path7 = entry.slice("file:".length);
|
|
69873
70105
|
if (path7.startsWith("//"))
|
|
69874
70106
|
path7 = path7.slice(2);
|
|
69875
|
-
return
|
|
70107
|
+
return join54(path7, "package.json");
|
|
69876
70108
|
}
|
|
69877
70109
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
69878
|
-
if (!
|
|
70110
|
+
if (!existsSync32(pkgJsonPath))
|
|
69879
70111
|
return null;
|
|
69880
70112
|
try {
|
|
69881
70113
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
@@ -69910,14 +70142,14 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
69910
70142
|
const packageName = packageNameFromServerEntry(entry);
|
|
69911
70143
|
if (packageName === null)
|
|
69912
70144
|
return null;
|
|
69913
|
-
return packageJsonExportsTui(
|
|
70145
|
+
return packageJsonExportsTui(join54(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
69914
70146
|
}
|
|
69915
70147
|
function isOurFilePluginEntry(entry) {
|
|
69916
70148
|
if (!entry.startsWith("file:"))
|
|
69917
70149
|
return false;
|
|
69918
70150
|
try {
|
|
69919
70151
|
const pkgJsonPath = fileEntryPackageJsonPath(entry);
|
|
69920
|
-
if (!
|
|
70152
|
+
if (!existsSync32(pkgJsonPath))
|
|
69921
70153
|
return false;
|
|
69922
70154
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
69923
70155
|
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
|
|
@@ -69960,7 +70192,7 @@ function isCanonicalNamedTuiPluginEntry(entry) {
|
|
|
69960
70192
|
}
|
|
69961
70193
|
function detectServerPluginRegistration() {
|
|
69962
70194
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
69963
|
-
const configPath =
|
|
70195
|
+
const configPath = existsSync32(paths.configJsonc) ? paths.configJsonc : existsSync32(paths.configJson) ? paths.configJson : null;
|
|
69964
70196
|
if (!configPath) {
|
|
69965
70197
|
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
|
|
69966
70198
|
}
|
|
@@ -69983,8 +70215,8 @@ function detectServerPluginRegistration() {
|
|
|
69983
70215
|
}
|
|
69984
70216
|
}
|
|
69985
70217
|
function detectTuiPluginRegistration() {
|
|
69986
|
-
const tuiJsonPath =
|
|
69987
|
-
if (!
|
|
70218
|
+
const tuiJsonPath = join54(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
70219
|
+
if (!existsSync32(tuiJsonPath)) {
|
|
69988
70220
|
return {
|
|
69989
70221
|
registered: false,
|
|
69990
70222
|
configPath: tuiJsonPath,
|
|
@@ -70139,11 +70371,11 @@ function readConfig(path7) {
|
|
|
70139
70371
|
return null;
|
|
70140
70372
|
}
|
|
70141
70373
|
function readServerConfig(configDir) {
|
|
70142
|
-
const jsoncPath =
|
|
70143
|
-
if (
|
|
70374
|
+
const jsoncPath = join55(configDir, "opencode.jsonc");
|
|
70375
|
+
if (existsSync33(jsoncPath))
|
|
70144
70376
|
return readConfig(jsoncPath);
|
|
70145
|
-
const jsonPath =
|
|
70146
|
-
if (
|
|
70377
|
+
const jsonPath = join55(configDir, "opencode.json");
|
|
70378
|
+
if (existsSync33(jsonPath))
|
|
70147
70379
|
return readConfig(jsonPath);
|
|
70148
70380
|
return null;
|
|
70149
70381
|
}
|
|
@@ -70163,7 +70395,7 @@ function desiredTuiEntry(serverEntry) {
|
|
|
70163
70395
|
return null;
|
|
70164
70396
|
}
|
|
70165
70397
|
function readTuiConfig(tuiJsonPath) {
|
|
70166
|
-
if (!
|
|
70398
|
+
if (!existsSync33(tuiJsonPath)) {
|
|
70167
70399
|
return { config: {}, malformed: false };
|
|
70168
70400
|
}
|
|
70169
70401
|
const config = readConfig(tuiJsonPath);
|
|
@@ -70184,7 +70416,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
70184
70416
|
if (!desiredEntry) {
|
|
70185
70417
|
return { changed: false, reason: "no-server-entry" };
|
|
70186
70418
|
}
|
|
70187
|
-
const tuiJsonPath =
|
|
70419
|
+
const tuiJsonPath = join55(configDir, "tui.json");
|
|
70188
70420
|
const { config, malformed } = readTuiConfig(tuiJsonPath);
|
|
70189
70421
|
if (malformed) {
|
|
70190
70422
|
return { changed: false, reason: "malformed" };
|
|
@@ -70200,7 +70432,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
70200
70432
|
|
|
70201
70433
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
70202
70434
|
import { homedir as homedir9 } from "os";
|
|
70203
|
-
import { join as
|
|
70435
|
+
import { join as join56 } from "path";
|
|
70204
70436
|
|
|
70205
70437
|
// packages/shared-skills/index.mjs
|
|
70206
70438
|
import { fileURLToPath } from "url";
|
|
@@ -70219,9 +70451,9 @@ function describeResult2(result) {
|
|
|
70219
70451
|
}
|
|
70220
70452
|
async function installAstGrepForOpenCode(options = {}) {
|
|
70221
70453
|
const platform = options.platform ?? process.platform;
|
|
70222
|
-
const baseDir =
|
|
70454
|
+
const baseDir = join56(options.homeDir ?? homedir9(), ".omo");
|
|
70223
70455
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
70224
|
-
const skillDir =
|
|
70456
|
+
const skillDir = join56(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
70225
70457
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
70226
70458
|
try {
|
|
70227
70459
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -72100,6 +72332,9 @@ async function cleanup(options) {
|
|
|
72100
72332
|
for (const path7 of result.removedPaths) {
|
|
72101
72333
|
console.log(`- Removed ${path7}`);
|
|
72102
72334
|
}
|
|
72335
|
+
for (const skippedPath of result.skippedPaths) {
|
|
72336
|
+
console.log(`- Skipped cleanup target ${skippedPath.path}: ${skippedPath.reason}`);
|
|
72337
|
+
}
|
|
72103
72338
|
for (const path7 of result.removedAgentLinks) {
|
|
72104
72339
|
console.log(`- Removed managed agent link ${path7}`);
|
|
72105
72340
|
}
|
|
@@ -87363,6 +87598,7 @@ var ClaudeCodeConfigSchema = exports_external.object({
|
|
|
87363
87598
|
});
|
|
87364
87599
|
// packages/omo-opencode/src/config/schema/codegraph.ts
|
|
87365
87600
|
var CodegraphConfigSchema = exports_external.object({
|
|
87601
|
+
auto_init: exports_external.boolean().default(true),
|
|
87366
87602
|
auto_provision: exports_external.boolean().default(true),
|
|
87367
87603
|
enabled: exports_external.boolean().default(true),
|
|
87368
87604
|
install_dir: exports_external.string().optional(),
|
|
@@ -87602,7 +87838,8 @@ var RuntimeFallbackConfigSchema = exports_external.object({
|
|
|
87602
87838
|
max_fallback_attempts: exports_external.number().min(1).max(20).optional(),
|
|
87603
87839
|
cooldown_seconds: exports_external.number().min(0).optional(),
|
|
87604
87840
|
timeout_seconds: exports_external.number().min(0).optional(),
|
|
87605
|
-
notify_on_fallback: exports_external.boolean().optional()
|
|
87841
|
+
notify_on_fallback: exports_external.boolean().optional(),
|
|
87842
|
+
restore_primary_after_cooldown: exports_external.boolean().optional()
|
|
87606
87843
|
});
|
|
87607
87844
|
|
|
87608
87845
|
// packages/team-core/src/config.ts
|
|
@@ -88164,7 +88401,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
88164
88401
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
88165
88402
|
init_bun_which_shim();
|
|
88166
88403
|
init_spawn_with_windows_hide();
|
|
88167
|
-
import { delimiter as delimiter2, dirname as
|
|
88404
|
+
import { delimiter as delimiter2, dirname as dirname20, posix as posix4, win32 as win324 } from "path";
|
|
88168
88405
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
88169
88406
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
88170
88407
|
function getCommandCandidates(platform) {
|
|
@@ -88222,7 +88459,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
88222
88459
|
return null;
|
|
88223
88460
|
}
|
|
88224
88461
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
88225
|
-
const preferredDir =
|
|
88462
|
+
const preferredDir = dirname20(binaryPath);
|
|
88226
88463
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
88227
88464
|
return [preferredDir, ...existing].join(delimiter2);
|
|
88228
88465
|
}
|
|
@@ -88390,7 +88627,7 @@ async function resolveSession(options) {
|
|
|
88390
88627
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
88391
88628
|
const delay2 = SESSION_CREATE_RETRY_DELAY_MS * attempt;
|
|
88392
88629
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
88393
|
-
await new Promise((
|
|
88630
|
+
await new Promise((resolve17) => setTimeout(resolve17, delay2));
|
|
88394
88631
|
}
|
|
88395
88632
|
continue;
|
|
88396
88633
|
}
|
|
@@ -88401,7 +88638,7 @@ async function resolveSession(options) {
|
|
|
88401
88638
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
88402
88639
|
const delay2 = SESSION_CREATE_RETRY_DELAY_MS * attempt;
|
|
88403
88640
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
88404
|
-
await new Promise((
|
|
88641
|
+
await new Promise((resolve17) => setTimeout(resolve17, delay2));
|
|
88405
88642
|
}
|
|
88406
88643
|
}
|
|
88407
88644
|
throw new Error("Failed to create session after all retries");
|
|
@@ -88614,7 +88851,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
88614
88851
|
var NOTEPAD_DIR = "notepads";
|
|
88615
88852
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
88616
88853
|
// packages/boulder-state/src/top-level-task.ts
|
|
88617
|
-
import { existsSync as
|
|
88854
|
+
import { existsSync as existsSync36, readFileSync as readFileSync18 } from "fs";
|
|
88618
88855
|
var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
|
|
88619
88856
|
var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
|
|
88620
88857
|
var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
|
|
@@ -88637,7 +88874,7 @@ function buildTaskRef(section, taskLabel) {
|
|
|
88637
88874
|
};
|
|
88638
88875
|
}
|
|
88639
88876
|
function readCurrentTopLevelTask(planPath) {
|
|
88640
|
-
if (!
|
|
88877
|
+
if (!existsSync36(planPath)) {
|
|
88641
88878
|
return null;
|
|
88642
88879
|
}
|
|
88643
88880
|
try {
|
|
@@ -88666,13 +88903,13 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
88666
88903
|
}
|
|
88667
88904
|
}
|
|
88668
88905
|
// packages/boulder-state/src/storage/path.ts
|
|
88669
|
-
import { existsSync as
|
|
88670
|
-
import { isAbsolute as
|
|
88906
|
+
import { existsSync as existsSync37 } from "fs";
|
|
88907
|
+
import { isAbsolute as isAbsolute10, join as join58, relative as relative8, resolve as resolve17 } from "path";
|
|
88671
88908
|
function getBoulderFilePath(directory) {
|
|
88672
|
-
return
|
|
88909
|
+
return join58(directory, BOULDER_DIR, BOULDER_FILE);
|
|
88673
88910
|
}
|
|
88674
88911
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
88675
|
-
return
|
|
88912
|
+
return isAbsolute10(trackedPath) ? resolve17(trackedPath) : resolve17(baseDirectory, trackedPath);
|
|
88676
88913
|
}
|
|
88677
88914
|
function resolveBoulderPlanPath(directory, state) {
|
|
88678
88915
|
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
|
|
@@ -88680,20 +88917,20 @@ function resolveBoulderPlanPath(directory, state) {
|
|
|
88680
88917
|
if (!worktreePath) {
|
|
88681
88918
|
return absolutePlanPath;
|
|
88682
88919
|
}
|
|
88683
|
-
const absoluteDirectory =
|
|
88684
|
-
const relativePlanPath =
|
|
88685
|
-
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") ||
|
|
88920
|
+
const absoluteDirectory = resolve17(directory);
|
|
88921
|
+
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
|
|
88922
|
+
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute10(relativePlanPath)) {
|
|
88686
88923
|
return absolutePlanPath;
|
|
88687
88924
|
}
|
|
88688
88925
|
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
|
|
88689
|
-
const worktreePlanPath =
|
|
88690
|
-
return
|
|
88926
|
+
const worktreePlanPath = resolve17(absoluteWorktreePath, relativePlanPath);
|
|
88927
|
+
return existsSync37(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
|
|
88691
88928
|
}
|
|
88692
88929
|
function resolveBoulderPlanPathForWork(directory, work) {
|
|
88693
88930
|
return resolveBoulderPlanPath(directory, work);
|
|
88694
88931
|
}
|
|
88695
88932
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
88696
|
-
import { existsSync as
|
|
88933
|
+
import { existsSync as existsSync38, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
|
|
88697
88934
|
var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
|
|
88698
88935
|
var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
|
|
88699
88936
|
var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
|
|
@@ -88702,7 +88939,7 @@ var CHECKED_CHECKBOX_PATTERN = /^(\s*)[-*]\s*\[[xX]\]\s*(.+)$/;
|
|
|
88702
88939
|
var TODO_TASK_PATTERN2 = /^\d+\.\s+/;
|
|
88703
88940
|
var FINAL_WAVE_TASK_PATTERN2 = /^F\d+\.\s+/i;
|
|
88704
88941
|
function getPlanProgress(planPath) {
|
|
88705
|
-
if (!
|
|
88942
|
+
if (!existsSync38(planPath)) {
|
|
88706
88943
|
return { total: 0, completed: 0, isComplete: false };
|
|
88707
88944
|
}
|
|
88708
88945
|
try {
|
|
@@ -88822,10 +89059,10 @@ function selectMirrorWork(state) {
|
|
|
88822
89059
|
return sorted[0] ?? null;
|
|
88823
89060
|
}
|
|
88824
89061
|
// packages/boulder-state/src/storage/read-state.ts
|
|
88825
|
-
import { existsSync as
|
|
89062
|
+
import { existsSync as existsSync39, readFileSync as readFileSync20 } from "fs";
|
|
88826
89063
|
function readBoulderState(directory) {
|
|
88827
89064
|
const filePath = getBoulderFilePath(directory);
|
|
88828
|
-
if (!
|
|
89065
|
+
if (!existsSync39(filePath)) {
|
|
88829
89066
|
return null;
|
|
88830
89067
|
}
|
|
88831
89068
|
try {
|
|
@@ -88897,14 +89134,14 @@ init_state();
|
|
|
88897
89134
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
88898
89135
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
88899
89136
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
88900
|
-
import { existsSync as
|
|
88901
|
-
import { join as
|
|
89137
|
+
import { existsSync as existsSync40, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
|
|
89138
|
+
import { join as join59 } from "path";
|
|
88902
89139
|
function getMarkerPath(directory, sessionID) {
|
|
88903
|
-
return
|
|
89140
|
+
return join59(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
88904
89141
|
}
|
|
88905
89142
|
function readContinuationMarker(directory, sessionID) {
|
|
88906
89143
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
88907
|
-
if (!
|
|
89144
|
+
if (!existsSync40(markerPath))
|
|
88908
89145
|
return null;
|
|
88909
89146
|
try {
|
|
88910
89147
|
const raw = readFileSync21(markerPath, "utf-8");
|
|
@@ -88973,7 +89210,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
88973
89210
|
init_shared();
|
|
88974
89211
|
init_compaction_marker();
|
|
88975
89212
|
import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "fs";
|
|
88976
|
-
import { join as
|
|
89213
|
+
import { join as join60 } from "path";
|
|
88977
89214
|
var defaultSessionLastAgentDeps = {
|
|
88978
89215
|
getMessageDir,
|
|
88979
89216
|
isSqliteBackend,
|
|
@@ -89033,7 +89270,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
89033
89270
|
try {
|
|
89034
89271
|
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
89035
89272
|
try {
|
|
89036
|
-
const content = readFileSync22(
|
|
89273
|
+
const content = readFileSync22(join60(messageDir, fileName), "utf-8");
|
|
89037
89274
|
const parsed = JSON.parse(content);
|
|
89038
89275
|
return {
|
|
89039
89276
|
fileName,
|
|
@@ -89076,8 +89313,8 @@ init_agent_display_names();
|
|
|
89076
89313
|
|
|
89077
89314
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
89078
89315
|
init_frontmatter2();
|
|
89079
|
-
import { existsSync as
|
|
89080
|
-
import { dirname as
|
|
89316
|
+
import { existsSync as existsSync41, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "fs";
|
|
89317
|
+
import { dirname as dirname21, join as join61 } from "path";
|
|
89081
89318
|
|
|
89082
89319
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
89083
89320
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -89086,11 +89323,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
89086
89323
|
|
|
89087
89324
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
89088
89325
|
function getStateFilePath(directory, customPath) {
|
|
89089
|
-
return customPath ?
|
|
89326
|
+
return customPath ? join61(directory, customPath) : join61(directory, DEFAULT_STATE_FILE);
|
|
89090
89327
|
}
|
|
89091
89328
|
function readState(directory, customPath) {
|
|
89092
89329
|
const filePath = getStateFilePath(directory, customPath);
|
|
89093
|
-
if (!
|
|
89330
|
+
if (!existsSync41(filePath)) {
|
|
89094
89331
|
return null;
|
|
89095
89332
|
}
|
|
89096
89333
|
try {
|
|
@@ -89325,7 +89562,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
|
|
|
89325
89562
|
let secondaryTimeoutChecked = false;
|
|
89326
89563
|
const pollStartTimestamp = Date.now();
|
|
89327
89564
|
while (!abortController.signal.aborted) {
|
|
89328
|
-
await new Promise((
|
|
89565
|
+
await new Promise((resolve18) => setTimeout(resolve18, pollIntervalMs));
|
|
89329
89566
|
if (abortController.signal.aborted) {
|
|
89330
89567
|
return 130;
|
|
89331
89568
|
}
|
|
@@ -89483,7 +89720,7 @@ function createAbortError() {
|
|
|
89483
89720
|
return error51;
|
|
89484
89721
|
}
|
|
89485
89722
|
function sleep(delayMs) {
|
|
89486
|
-
return new Promise((
|
|
89723
|
+
return new Promise((resolve18) => setTimeout(resolve18, delayMs));
|
|
89487
89724
|
}
|
|
89488
89725
|
function hasPromptStartEvidence(eventState) {
|
|
89489
89726
|
return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
|
|
@@ -89704,7 +89941,7 @@ function getPostHogActivityCaptureState2(now = new Date) {
|
|
|
89704
89941
|
// packages/omo-opencode/src/shared/posthog.ts
|
|
89705
89942
|
var activityStateProviderOverride2 = null;
|
|
89706
89943
|
var osProviderOverride3 = null;
|
|
89707
|
-
var
|
|
89944
|
+
var transportFactoryOverride2 = null;
|
|
89708
89945
|
function resolveActivityState() {
|
|
89709
89946
|
return (activityStateProviderOverride2 ?? getPostHogActivityCaptureState2)();
|
|
89710
89947
|
}
|
|
@@ -89712,7 +89949,7 @@ function resolveOsProvider2() {
|
|
|
89712
89949
|
return osProviderOverride3 ?? os5;
|
|
89713
89950
|
}
|
|
89714
89951
|
function resolveTransportFactory() {
|
|
89715
|
-
return
|
|
89952
|
+
return transportFactoryOverride2 ?? createDefaultPostHogTransport;
|
|
89716
89953
|
}
|
|
89717
89954
|
var NO_OP_POSTHOG2 = {
|
|
89718
89955
|
trackActive: () => {
|
|
@@ -89889,7 +90126,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
|
|
|
89889
90126
|
async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
|
|
89890
90127
|
const completed = await Promise.race([
|
|
89891
90128
|
eventProcessor.then(() => true),
|
|
89892
|
-
new Promise((
|
|
90129
|
+
new Promise((resolve18) => setTimeout(() => resolve18(false), timeoutMs))
|
|
89893
90130
|
]);
|
|
89894
90131
|
}
|
|
89895
90132
|
async function run(options) {
|
|
@@ -90192,14 +90429,14 @@ async function getLocalVersion(options = {}) {
|
|
|
90192
90429
|
}
|
|
90193
90430
|
}
|
|
90194
90431
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
90195
|
-
import { existsSync as
|
|
90432
|
+
import { existsSync as existsSync52, readFileSync as readFileSync33 } from "fs";
|
|
90196
90433
|
|
|
90197
90434
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
90198
90435
|
init_extract_semver();
|
|
90199
90436
|
init_bun_which_shim();
|
|
90200
|
-
import { existsSync as
|
|
90437
|
+
import { existsSync as existsSync49, accessSync as accessSync4, constants as constants9 } from "fs";
|
|
90201
90438
|
import { homedir as homedir13 } from "os";
|
|
90202
|
-
import { join as
|
|
90439
|
+
import { join as join68 } from "path";
|
|
90203
90440
|
|
|
90204
90441
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
90205
90442
|
init_spawn_with_windows_hide();
|
|
@@ -90238,8 +90475,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
90238
90475
|
const stdoutPromise = readSpawnStream(proc.stdout);
|
|
90239
90476
|
const stderrPromise = readSpawnStream(proc.stderr);
|
|
90240
90477
|
let timer;
|
|
90241
|
-
const timeoutPromise = new Promise((
|
|
90242
|
-
timer = setTimeout(() =>
|
|
90478
|
+
const timeoutPromise = new Promise((resolve18) => {
|
|
90479
|
+
timer = setTimeout(() => resolve18("timeout"), timeoutMs);
|
|
90243
90480
|
});
|
|
90244
90481
|
const processPromise = (async () => {
|
|
90245
90482
|
await proc.exited;
|
|
@@ -90291,17 +90528,17 @@ function getDesktopAppPaths(platform) {
|
|
|
90291
90528
|
case "darwin":
|
|
90292
90529
|
return [
|
|
90293
90530
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
90294
|
-
|
|
90531
|
+
join68(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
90295
90532
|
];
|
|
90296
90533
|
case "win32": {
|
|
90297
90534
|
const programFiles = process.env.ProgramFiles;
|
|
90298
90535
|
const localAppData = process.env.LOCALAPPDATA;
|
|
90299
90536
|
const paths = [];
|
|
90300
90537
|
if (programFiles) {
|
|
90301
|
-
paths.push(
|
|
90538
|
+
paths.push(join68(programFiles, "OpenCode", "OpenCode.exe"));
|
|
90302
90539
|
}
|
|
90303
90540
|
if (localAppData) {
|
|
90304
|
-
paths.push(
|
|
90541
|
+
paths.push(join68(localAppData, "OpenCode", "OpenCode.exe"));
|
|
90305
90542
|
}
|
|
90306
90543
|
return paths;
|
|
90307
90544
|
}
|
|
@@ -90309,8 +90546,8 @@ function getDesktopAppPaths(platform) {
|
|
|
90309
90546
|
return [
|
|
90310
90547
|
"/usr/bin/opencode",
|
|
90311
90548
|
"/usr/lib/opencode/opencode",
|
|
90312
|
-
|
|
90313
|
-
|
|
90549
|
+
join68(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
90550
|
+
join68(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
90314
90551
|
];
|
|
90315
90552
|
default:
|
|
90316
90553
|
return [];
|
|
@@ -90322,7 +90559,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
90322
90559
|
}
|
|
90323
90560
|
return [binaryPath, "--version"];
|
|
90324
90561
|
}
|
|
90325
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
90562
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync49) {
|
|
90326
90563
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
90327
90564
|
if (checkExists(desktopPath)) {
|
|
90328
90565
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -90330,7 +90567,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
90330
90567
|
}
|
|
90331
90568
|
return null;
|
|
90332
90569
|
}
|
|
90333
|
-
async function findOpenCodeBinary(platform = process.platform, checkExists =
|
|
90570
|
+
async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync49) {
|
|
90334
90571
|
for (const binary of OPENCODE_BINARIES2) {
|
|
90335
90572
|
const path14 = bunWhich(binary);
|
|
90336
90573
|
if (path14 && checkExists(path14)) {
|
|
@@ -90342,7 +90579,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
90342
90579
|
const candidates = getCommandCandidates2(platform);
|
|
90343
90580
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
90344
90581
|
for (const command of candidates) {
|
|
90345
|
-
const fullPath =
|
|
90582
|
+
const fullPath = join68(entry, command);
|
|
90346
90583
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
90347
90584
|
return { binary: command, path: fullPath };
|
|
90348
90585
|
}
|
|
@@ -90388,12 +90625,12 @@ function compareVersions3(current, minimum) {
|
|
|
90388
90625
|
|
|
90389
90626
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
90390
90627
|
init_shared();
|
|
90391
|
-
import { existsSync as
|
|
90628
|
+
import { existsSync as existsSync50, readFileSync as readFileSync31 } from "fs";
|
|
90392
90629
|
function detectConfigPath() {
|
|
90393
90630
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
90394
|
-
if (
|
|
90631
|
+
if (existsSync50(paths.configJsonc))
|
|
90395
90632
|
return paths.configJsonc;
|
|
90396
|
-
if (
|
|
90633
|
+
if (existsSync50(paths.configJson))
|
|
90397
90634
|
return paths.configJson;
|
|
90398
90635
|
return null;
|
|
90399
90636
|
}
|
|
@@ -90481,36 +90718,36 @@ init_file_utils2();
|
|
|
90481
90718
|
init_checker();
|
|
90482
90719
|
init_auto_update_checker();
|
|
90483
90720
|
init_package_json_locator();
|
|
90484
|
-
import { existsSync as
|
|
90721
|
+
import { existsSync as existsSync51, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "fs";
|
|
90485
90722
|
import { createRequire as createRequire2 } from "module";
|
|
90486
90723
|
import { homedir as homedir14 } from "os";
|
|
90487
|
-
import { join as
|
|
90724
|
+
import { join as join69 } from "path";
|
|
90488
90725
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
90489
90726
|
init_shared();
|
|
90490
90727
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
90491
90728
|
if (platform === "darwin")
|
|
90492
|
-
return
|
|
90729
|
+
return join69(homedir14(), "Library", "Caches");
|
|
90493
90730
|
if (platform === "win32")
|
|
90494
|
-
return process.env.LOCALAPPDATA ??
|
|
90495
|
-
return
|
|
90731
|
+
return process.env.LOCALAPPDATA ?? join69(homedir14(), "AppData", "Local");
|
|
90732
|
+
return join69(homedir14(), ".cache");
|
|
90496
90733
|
}
|
|
90497
90734
|
function resolveOpenCodeCacheDir() {
|
|
90498
90735
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
90499
90736
|
if (xdgCacheHome)
|
|
90500
|
-
return
|
|
90737
|
+
return join69(xdgCacheHome, "opencode");
|
|
90501
90738
|
const fromShared = getOpenCodeCacheDir();
|
|
90502
|
-
const platformDefault =
|
|
90503
|
-
if (
|
|
90739
|
+
const platformDefault = join69(getPlatformDefaultCacheDir(), "opencode");
|
|
90740
|
+
if (existsSync51(fromShared) || !existsSync51(platformDefault))
|
|
90504
90741
|
return fromShared;
|
|
90505
90742
|
return platformDefault;
|
|
90506
90743
|
}
|
|
90507
90744
|
function resolveExistingDir(dirPath) {
|
|
90508
|
-
if (!
|
|
90745
|
+
if (!existsSync51(dirPath))
|
|
90509
90746
|
return dirPath;
|
|
90510
90747
|
return resolveSymlink(dirPath);
|
|
90511
90748
|
}
|
|
90512
90749
|
function readPackageJson(filePath) {
|
|
90513
|
-
if (!
|
|
90750
|
+
if (!existsSync51(filePath))
|
|
90514
90751
|
return null;
|
|
90515
90752
|
try {
|
|
90516
90753
|
const content = readFileSync32(filePath, "utf-8");
|
|
@@ -90531,26 +90768,26 @@ function normalizeVersion(value) {
|
|
|
90531
90768
|
function createPackageCandidates(rootDir) {
|
|
90532
90769
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
90533
90770
|
packageName,
|
|
90534
|
-
installedPackagePath:
|
|
90771
|
+
installedPackagePath: join69(rootDir, "node_modules", packageName, "package.json")
|
|
90535
90772
|
}));
|
|
90536
90773
|
}
|
|
90537
90774
|
function createTaggedInstallCandidates(rootDir) {
|
|
90538
|
-
const packagesDir =
|
|
90539
|
-
if (!
|
|
90775
|
+
const packagesDir = join69(rootDir, "packages");
|
|
90776
|
+
if (!existsSync51(packagesDir))
|
|
90540
90777
|
return [];
|
|
90541
90778
|
const candidates = [];
|
|
90542
90779
|
for (const entryName of readdirSync8(packagesDir).sort()) {
|
|
90543
90780
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
90544
90781
|
if (packageName === undefined)
|
|
90545
90782
|
continue;
|
|
90546
|
-
const installDir =
|
|
90783
|
+
const installDir = join69(packagesDir, entryName);
|
|
90547
90784
|
candidates.push({
|
|
90548
90785
|
cacheDir: installDir,
|
|
90549
|
-
cachePackagePath:
|
|
90786
|
+
cachePackagePath: join69(installDir, "package.json"),
|
|
90550
90787
|
packageCandidates: [
|
|
90551
90788
|
{
|
|
90552
90789
|
packageName,
|
|
90553
|
-
installedPackagePath:
|
|
90790
|
+
installedPackagePath: join69(installDir, "node_modules", packageName, "package.json")
|
|
90554
90791
|
}
|
|
90555
90792
|
]
|
|
90556
90793
|
});
|
|
@@ -90558,7 +90795,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
90558
90795
|
return candidates;
|
|
90559
90796
|
}
|
|
90560
90797
|
function selectInstalledPackage(candidate) {
|
|
90561
|
-
return candidate.packageCandidates.find((packageCandidate) =>
|
|
90798
|
+
return candidate.packageCandidates.find((packageCandidate) => existsSync51(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
|
|
90562
90799
|
}
|
|
90563
90800
|
function getExpectedVersion(cachePackage, packageName) {
|
|
90564
90801
|
return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
|
|
@@ -90569,7 +90806,7 @@ function resolveInstalledPackageJsonPath() {
|
|
|
90569
90806
|
for (const packageName of ACCEPTED_PACKAGE_NAMES) {
|
|
90570
90807
|
try {
|
|
90571
90808
|
const packageJsonPath = require2.resolve(`${packageName}/package.json`);
|
|
90572
|
-
if (
|
|
90809
|
+
if (existsSync51(packageJsonPath)) {
|
|
90573
90810
|
return { packageName, packageJsonPath };
|
|
90574
90811
|
}
|
|
90575
90812
|
} catch {
|
|
@@ -90595,22 +90832,22 @@ function getLoadedPluginVersion() {
|
|
|
90595
90832
|
const candidates = [
|
|
90596
90833
|
{
|
|
90597
90834
|
cacheDir: configDir,
|
|
90598
|
-
cachePackagePath:
|
|
90835
|
+
cachePackagePath: join69(configDir, "package.json"),
|
|
90599
90836
|
packageCandidates: createPackageCandidates(configDir)
|
|
90600
90837
|
},
|
|
90601
90838
|
...createTaggedInstallCandidates(configDir),
|
|
90602
90839
|
{
|
|
90603
90840
|
cacheDir,
|
|
90604
|
-
cachePackagePath:
|
|
90841
|
+
cachePackagePath: join69(cacheDir, "package.json"),
|
|
90605
90842
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
90606
90843
|
},
|
|
90607
90844
|
...createTaggedInstallCandidates(cacheDir)
|
|
90608
90845
|
];
|
|
90609
|
-
const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) =>
|
|
90846
|
+
const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync51(packageCandidate.installedPackagePath))) ?? candidates[0];
|
|
90610
90847
|
const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
|
|
90611
90848
|
const selectedPackage = selectInstalledPackage(selectedCandidate);
|
|
90612
90849
|
const candidateInstalledPath = selectedPackage.installedPackagePath;
|
|
90613
|
-
const candidateExists =
|
|
90850
|
+
const candidateExists = existsSync51(candidateInstalledPath);
|
|
90614
90851
|
const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
|
|
90615
90852
|
const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
|
|
90616
90853
|
const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
|
|
@@ -90646,7 +90883,7 @@ var defaultDeps6 = {
|
|
|
90646
90883
|
getLoadedPluginVersion,
|
|
90647
90884
|
getLatestPluginVersion,
|
|
90648
90885
|
getSuggestedInstallTag,
|
|
90649
|
-
configExists:
|
|
90886
|
+
configExists: existsSync52,
|
|
90650
90887
|
readConfigFile: (path14) => readFileSync33(path14, "utf-8"),
|
|
90651
90888
|
parseConfigContent: (content) => parseJsonc(content)
|
|
90652
90889
|
};
|
|
@@ -90790,7 +91027,7 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
90790
91027
|
init_src();
|
|
90791
91028
|
import { readFileSync as readFileSync34 } from "fs";
|
|
90792
91029
|
import { homedir as homedir15 } from "os";
|
|
90793
|
-
import { dirname as
|
|
91030
|
+
import { dirname as dirname26, relative as relative9 } from "path";
|
|
90794
91031
|
init_shared();
|
|
90795
91032
|
init_plugin_identity();
|
|
90796
91033
|
function resolveHomeDirectory2() {
|
|
@@ -90814,11 +91051,11 @@ function discoverProjectLayersNearestFirst(directory) {
|
|
|
90814
91051
|
const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
|
|
90815
91052
|
return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
|
|
90816
91053
|
path: configPath,
|
|
90817
|
-
configDir:
|
|
91054
|
+
configDir: dirname26(configPath)
|
|
90818
91055
|
}));
|
|
90819
91056
|
}
|
|
90820
91057
|
function shortPath(configPath) {
|
|
90821
|
-
const candidate =
|
|
91058
|
+
const candidate = relative9(process.cwd(), configPath);
|
|
90822
91059
|
return candidate.length > 0 ? candidate : configPath;
|
|
90823
91060
|
}
|
|
90824
91061
|
function formatIssuePath(path14) {
|
|
@@ -90838,7 +91075,7 @@ function parseLayerConfig(configPath) {
|
|
|
90838
91075
|
if (!isPlainRecord(rawConfig)) {
|
|
90839
91076
|
return {
|
|
90840
91077
|
path: configPath,
|
|
90841
|
-
configDir:
|
|
91078
|
+
configDir: dirname26(configPath),
|
|
90842
91079
|
config: null,
|
|
90843
91080
|
messages: [`${shortPath(configPath)}: <root>: Expected object`]
|
|
90844
91081
|
};
|
|
@@ -90846,7 +91083,7 @@ function parseLayerConfig(configPath) {
|
|
|
90846
91083
|
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
90847
91084
|
return {
|
|
90848
91085
|
path: configPath,
|
|
90849
|
-
configDir:
|
|
91086
|
+
configDir: dirname26(configPath),
|
|
90850
91087
|
config: result.success ? result.data : parseConfigPartially(rawConfig),
|
|
90851
91088
|
messages: schemaMessages(configPath, rawConfig)
|
|
90852
91089
|
};
|
|
@@ -90856,7 +91093,7 @@ function parseLayerConfig(configPath) {
|
|
|
90856
91093
|
}
|
|
90857
91094
|
return {
|
|
90858
91095
|
path: configPath,
|
|
90859
|
-
configDir:
|
|
91096
|
+
configDir: dirname26(configPath),
|
|
90860
91097
|
config: null,
|
|
90861
91098
|
messages: [`${shortPath(configPath)}: ${error51.message}`]
|
|
90862
91099
|
};
|
|
@@ -90902,23 +91139,23 @@ function validatePluginConfig(directory) {
|
|
|
90902
91139
|
|
|
90903
91140
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
90904
91141
|
init_shared();
|
|
90905
|
-
import { existsSync as
|
|
91142
|
+
import { existsSync as existsSync53, readFileSync as readFileSync35 } from "fs";
|
|
90906
91143
|
import { homedir as homedir16 } from "os";
|
|
90907
|
-
import { join as
|
|
91144
|
+
import { join as join70 } from "path";
|
|
90908
91145
|
function getUserConfigDir2() {
|
|
90909
91146
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
90910
91147
|
if (xdgConfig)
|
|
90911
|
-
return
|
|
90912
|
-
return
|
|
91148
|
+
return join70(xdgConfig, "opencode");
|
|
91149
|
+
return join70(homedir16(), ".config", "opencode");
|
|
90913
91150
|
}
|
|
90914
91151
|
function loadCustomProviderNames() {
|
|
90915
91152
|
const configDir = getUserConfigDir2();
|
|
90916
91153
|
const candidatePaths = [
|
|
90917
|
-
|
|
90918
|
-
|
|
91154
|
+
join70(configDir, "opencode.json"),
|
|
91155
|
+
join70(configDir, "opencode.jsonc")
|
|
90919
91156
|
];
|
|
90920
91157
|
for (const configPath of candidatePaths) {
|
|
90921
|
-
if (!
|
|
91158
|
+
if (!existsSync53(configPath))
|
|
90922
91159
|
continue;
|
|
90923
91160
|
try {
|
|
90924
91161
|
const content = readFileSync35(configPath, "utf-8");
|
|
@@ -90936,9 +91173,9 @@ function loadCustomProviderNames() {
|
|
|
90936
91173
|
return [];
|
|
90937
91174
|
}
|
|
90938
91175
|
function loadAvailableModelsFromCache() {
|
|
90939
|
-
const cacheFile =
|
|
91176
|
+
const cacheFile = join70(getOpenCodeCacheDir(), "models.json");
|
|
90940
91177
|
const customProviders = loadCustomProviderNames();
|
|
90941
|
-
if (!
|
|
91178
|
+
if (!existsSync53(cacheFile)) {
|
|
90942
91179
|
if (customProviders.length > 0) {
|
|
90943
91180
|
return { providers: customProviders, modelCount: 0, cacheExists: true };
|
|
90944
91181
|
}
|
|
@@ -90973,8 +91210,8 @@ init_model_capabilities2();
|
|
|
90973
91210
|
init_shared();
|
|
90974
91211
|
init_plugin_identity();
|
|
90975
91212
|
import { readFileSync as readFileSync36 } from "fs";
|
|
90976
|
-
import { join as
|
|
90977
|
-
var PROJECT_CONFIG_DIR =
|
|
91213
|
+
import { join as join71 } from "path";
|
|
91214
|
+
var PROJECT_CONFIG_DIR = join71(process.cwd(), ".opencode");
|
|
90978
91215
|
function loadOmoConfig() {
|
|
90979
91216
|
const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR, {
|
|
90980
91217
|
basenames: [CONFIG_BASENAME],
|
|
@@ -91012,7 +91249,7 @@ function loadOmoConfig() {
|
|
|
91012
91249
|
|
|
91013
91250
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
91014
91251
|
init_shared();
|
|
91015
|
-
import { join as
|
|
91252
|
+
import { join as join72 } from "path";
|
|
91016
91253
|
|
|
91017
91254
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
91018
91255
|
function formatModelWithVariant(model, variant) {
|
|
@@ -91054,7 +91291,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
91054
91291
|
}
|
|
91055
91292
|
function buildModelResolutionDetails(options) {
|
|
91056
91293
|
const details = [];
|
|
91057
|
-
const cacheFile =
|
|
91294
|
+
const cacheFile = join72(getOpenCodeCacheDir(), "models.json");
|
|
91058
91295
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
91059
91296
|
details.push("");
|
|
91060
91297
|
if (options.available.cacheExists) {
|
|
@@ -91330,28 +91567,28 @@ async function checkConfig() {
|
|
|
91330
91567
|
|
|
91331
91568
|
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
91332
91569
|
init_src();
|
|
91333
|
-
import { existsSync as
|
|
91570
|
+
import { existsSync as existsSync54 } from "fs";
|
|
91334
91571
|
import { createRequire as createRequire3 } from "module";
|
|
91335
91572
|
import { homedir as homedir18 } from "os";
|
|
91336
|
-
import { dirname as
|
|
91573
|
+
import { dirname as dirname27, join as join74 } from "path";
|
|
91337
91574
|
|
|
91338
91575
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
91339
|
-
import { join as
|
|
91576
|
+
import { join as join73 } from "path";
|
|
91340
91577
|
import { homedir as homedir17, tmpdir as tmpdir3 } from "os";
|
|
91341
91578
|
init_binary_downloader();
|
|
91342
91579
|
init_logger2();
|
|
91343
91580
|
init_plugin_identity();
|
|
91344
91581
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
91345
|
-
var DEBUG_FILE =
|
|
91582
|
+
var DEBUG_FILE = join73(tmpdir3(), "comment-checker-debug.log");
|
|
91346
91583
|
function getCacheDir2() {
|
|
91347
91584
|
if (process.platform === "win32") {
|
|
91348
91585
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
91349
|
-
const base2 = localAppData ||
|
|
91350
|
-
return
|
|
91586
|
+
const base2 = localAppData || join73(homedir17(), "AppData", "Local");
|
|
91587
|
+
return join73(base2, CACHE_DIR_NAME, "bin");
|
|
91351
91588
|
}
|
|
91352
91589
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
91353
|
-
const base = xdgCache ||
|
|
91354
|
-
return
|
|
91590
|
+
const base = xdgCache || join73(homedir17(), ".cache");
|
|
91591
|
+
return join73(base, CACHE_DIR_NAME, "bin");
|
|
91355
91592
|
}
|
|
91356
91593
|
function getBinaryName() {
|
|
91357
91594
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -91401,7 +91638,7 @@ async function getBinaryVersion(binary) {
|
|
|
91401
91638
|
}
|
|
91402
91639
|
}
|
|
91403
91640
|
async function checkAstGrepCli() {
|
|
91404
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
91641
|
+
const runtimeDir = astGrepRuntimeDir(join74(homedir18(), ".omo"));
|
|
91405
91642
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
91406
91643
|
if (sgPath === null) {
|
|
91407
91644
|
return {
|
|
@@ -91430,12 +91667,12 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
91430
91667
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
91431
91668
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
91432
91669
|
try {
|
|
91433
|
-
const packageDir = baseDirOverride ??
|
|
91434
|
-
const vendorPath =
|
|
91435
|
-
if (
|
|
91670
|
+
const packageDir = baseDirOverride ?? dirname27(resolvePackageJsonPath());
|
|
91671
|
+
const vendorPath = join74(packageDir, "vendor", platformKey, binaryName);
|
|
91672
|
+
if (existsSync54(vendorPath))
|
|
91436
91673
|
return vendorPath;
|
|
91437
|
-
const binPath =
|
|
91438
|
-
if (
|
|
91674
|
+
const binPath = join74(packageDir, "bin", binaryName);
|
|
91675
|
+
if (existsSync54(binPath))
|
|
91439
91676
|
return binPath;
|
|
91440
91677
|
} catch (error51) {
|
|
91441
91678
|
if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
|
|
@@ -91580,11 +91817,11 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
91580
91817
|
|
|
91581
91818
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
91582
91819
|
import { readFileSync as readFileSync37 } from "fs";
|
|
91583
|
-
import { join as
|
|
91820
|
+
import { join as join75 } from "path";
|
|
91584
91821
|
|
|
91585
91822
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
91586
|
-
import { existsSync as
|
|
91587
|
-
import { delimiter as delimiter3, dirname as
|
|
91823
|
+
import { existsSync as existsSync55 } from "fs";
|
|
91824
|
+
import { delimiter as delimiter3, dirname as dirname28, resolve as resolve19 } from "path";
|
|
91588
91825
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
91589
91826
|
|
|
91590
91827
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -91597,7 +91834,7 @@ function hasCliSuffix(candidatePath, suffix) {
|
|
|
91597
91834
|
|
|
91598
91835
|
// packages/omo-opencode/src/mcp/runtime-executable.ts
|
|
91599
91836
|
init_bun_which_shim();
|
|
91600
|
-
import { basename as
|
|
91837
|
+
import { basename as basename12 } from "path";
|
|
91601
91838
|
var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
|
|
91602
91839
|
function isUnsafeCommandName2(commandName) {
|
|
91603
91840
|
if (commandName.length === 0)
|
|
@@ -91613,7 +91850,7 @@ function isUnsafeCommandName2(commandName) {
|
|
|
91613
91850
|
return false;
|
|
91614
91851
|
}
|
|
91615
91852
|
function isNodeExecPath(execPath) {
|
|
91616
|
-
return NODE_EXECUTABLE_NAMES.has(
|
|
91853
|
+
return NODE_EXECUTABLE_NAMES.has(basename12(execPath).toLowerCase());
|
|
91617
91854
|
}
|
|
91618
91855
|
function resolveRuntimeExecutable(commandName, options = {}) {
|
|
91619
91856
|
if (isUnsafeCommandName2(commandName)) {
|
|
@@ -91631,7 +91868,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
|
|
|
91631
91868
|
}
|
|
91632
91869
|
|
|
91633
91870
|
// packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
|
|
91634
|
-
import { resolve as
|
|
91871
|
+
import { resolve as resolve18 } from "path";
|
|
91635
91872
|
function resolveJavaScriptRuntime(resolveExecutable) {
|
|
91636
91873
|
const node = resolveExecutable("node");
|
|
91637
91874
|
return node.available ? node : resolveExecutable("bun");
|
|
@@ -91639,9 +91876,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
|
|
|
91639
91876
|
function createAncestorCliCandidates(options) {
|
|
91640
91877
|
const candidates = [];
|
|
91641
91878
|
const seenPaths = new Set;
|
|
91642
|
-
let currentDirectory =
|
|
91879
|
+
let currentDirectory = resolve18(options.startDirectory);
|
|
91643
91880
|
while (true) {
|
|
91644
|
-
const distCliPath =
|
|
91881
|
+
const distCliPath = resolve18(currentDirectory, options.packageRel, options.distCliRel);
|
|
91645
91882
|
if (!seenPaths.has(distCliPath)) {
|
|
91646
91883
|
const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
|
|
91647
91884
|
seenPaths.add(distCliPath);
|
|
@@ -91653,7 +91890,7 @@ function createAncestorCliCandidates(options) {
|
|
|
91653
91890
|
runtimeAvailable: runtime5.available
|
|
91654
91891
|
});
|
|
91655
91892
|
}
|
|
91656
|
-
const sourceCliPath =
|
|
91893
|
+
const sourceCliPath = resolve18(currentDirectory, options.packageRel, options.sourceCliRel);
|
|
91657
91894
|
if (!seenPaths.has(sourceCliPath)) {
|
|
91658
91895
|
const runtime5 = options.resolveExecutable("bun");
|
|
91659
91896
|
const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
|
|
@@ -91670,7 +91907,7 @@ function createAncestorCliCandidates(options) {
|
|
|
91670
91907
|
runtimeAvailable: runtime5.available
|
|
91671
91908
|
});
|
|
91672
91909
|
}
|
|
91673
|
-
const parentDirectory =
|
|
91910
|
+
const parentDirectory = resolve18(currentDirectory, "..");
|
|
91674
91911
|
if (parentDirectory === currentDirectory)
|
|
91675
91912
|
return candidates;
|
|
91676
91913
|
currentDirectory = parentDirectory;
|
|
@@ -91706,7 +91943,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
91706
91943
|
].join(";");
|
|
91707
91944
|
function getModuleDirectory(moduleUrl) {
|
|
91708
91945
|
try {
|
|
91709
|
-
return
|
|
91946
|
+
return dirname28(fileURLToPath6(moduleUrl));
|
|
91710
91947
|
} catch (error51) {
|
|
91711
91948
|
if (!(error51 instanceof Error))
|
|
91712
91949
|
throw error51;
|
|
@@ -91714,23 +91951,23 @@ function getModuleDirectory(moduleUrl) {
|
|
|
91714
91951
|
}
|
|
91715
91952
|
}
|
|
91716
91953
|
function findBootstrapRoot(candidates, pathExists) {
|
|
91717
|
-
return candidates.find((candidate) => pathExists(
|
|
91954
|
+
return candidates.find((candidate) => pathExists(resolve19(candidate.root, "package.json")))?.root ?? process.cwd();
|
|
91718
91955
|
}
|
|
91719
91956
|
function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
91720
91957
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
91721
91958
|
const bun = resolveExecutable("bun");
|
|
91722
91959
|
const npm = resolveExecutable("npm");
|
|
91723
|
-
const packageManifestPath =
|
|
91960
|
+
const packageManifestPath = resolve19(root, PACKAGE_REL, "package.json");
|
|
91724
91961
|
return {
|
|
91725
91962
|
command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
|
|
91726
91963
|
root,
|
|
91727
|
-
path:
|
|
91964
|
+
path: resolve19(root, PACKAGE_REL, DIST_CLI_REL),
|
|
91728
91965
|
exists: runtime5.available && npm.available && pathExists(packageManifestPath),
|
|
91729
91966
|
runtimeAvailable: runtime5.available
|
|
91730
91967
|
};
|
|
91731
91968
|
}
|
|
91732
91969
|
function resolveLspCommand(options = {}) {
|
|
91733
|
-
const pathExists = options.exists ??
|
|
91970
|
+
const pathExists = options.exists ?? existsSync55;
|
|
91734
91971
|
const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
|
|
91735
91972
|
const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
|
|
91736
91973
|
const candidates = moduleDirectory ? createAncestorCliCandidates({
|
|
@@ -91740,7 +91977,7 @@ function resolveLspCommand(options = {}) {
|
|
|
91740
91977
|
sourceCliRel: SOURCE_CLI_REL,
|
|
91741
91978
|
pathExists,
|
|
91742
91979
|
resolveExecutable,
|
|
91743
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(
|
|
91980
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve19(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL))
|
|
91744
91981
|
}) : [];
|
|
91745
91982
|
const distCandidate = candidates.find((candidate) => hasCliSuffix(candidate.path, DIST_CLI_REL) && candidate.exists);
|
|
91746
91983
|
if (distCandidate) {
|
|
@@ -91787,7 +92024,7 @@ function readOmoConfig(configDirectory) {
|
|
|
91787
92024
|
}
|
|
91788
92025
|
function isLspMcpDisabled(options) {
|
|
91789
92026
|
const userConfigDirectory = options.configDirectory ?? getOpenCodeConfigDir({ binary: "opencode" });
|
|
91790
|
-
const projectConfigDirectory =
|
|
92027
|
+
const projectConfigDirectory = join75(options.cwd ?? process.cwd(), ".opencode");
|
|
91791
92028
|
const userConfig = readOmoConfig(userConfigDirectory);
|
|
91792
92029
|
const projectConfig = readOmoConfig(projectConfigDirectory);
|
|
91793
92030
|
const disabledMcps = new Set([
|
|
@@ -91806,21 +92043,21 @@ function getInstalledLspServers(options = {}) {
|
|
|
91806
92043
|
|
|
91807
92044
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
91808
92045
|
init_shared();
|
|
91809
|
-
import { existsSync as
|
|
92046
|
+
import { existsSync as existsSync56, readFileSync as readFileSync38 } from "fs";
|
|
91810
92047
|
import { homedir as homedir19 } from "os";
|
|
91811
|
-
import { join as
|
|
92048
|
+
import { join as join76 } from "path";
|
|
91812
92049
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
91813
92050
|
function getMcpConfigPaths() {
|
|
91814
92051
|
return [
|
|
91815
|
-
|
|
91816
|
-
|
|
91817
|
-
|
|
92052
|
+
join76(homedir19(), ".claude", ".mcp.json"),
|
|
92053
|
+
join76(process.cwd(), ".mcp.json"),
|
|
92054
|
+
join76(process.cwd(), ".claude", ".mcp.json")
|
|
91818
92055
|
];
|
|
91819
92056
|
}
|
|
91820
92057
|
function loadUserMcpConfig() {
|
|
91821
92058
|
const servers = {};
|
|
91822
92059
|
for (const configPath of getMcpConfigPaths()) {
|
|
91823
|
-
if (!
|
|
92060
|
+
if (!existsSync56(configPath))
|
|
91824
92061
|
continue;
|
|
91825
92062
|
try {
|
|
91826
92063
|
const content = readFileSync38(configPath, "utf-8");
|
|
@@ -91983,7 +92220,16 @@ async function probeBinary(cmd, args, spawnImpl) {
|
|
|
91983
92220
|
import { homedir as homedir20 } from "os";
|
|
91984
92221
|
import path14 from "path";
|
|
91985
92222
|
function resolveBaseDir(config3) {
|
|
91986
|
-
return config3.base_dir ?? path14.join(homedir20(), ".omo");
|
|
92223
|
+
return expandHomeDirectory(config3.base_dir ?? path14.join(homedir20(), ".omo"));
|
|
92224
|
+
}
|
|
92225
|
+
function expandHomeDirectory(directoryPath) {
|
|
92226
|
+
if (directoryPath === "~") {
|
|
92227
|
+
return homedir20();
|
|
92228
|
+
}
|
|
92229
|
+
if (directoryPath.startsWith("~/") || directoryPath.startsWith("~\\")) {
|
|
92230
|
+
return path14.join(homedir20(), directoryPath.slice(2));
|
|
92231
|
+
}
|
|
92232
|
+
return directoryPath;
|
|
91987
92233
|
}
|
|
91988
92234
|
// packages/omo-opencode/src/cli/doctor/checks/team-mode.ts
|
|
91989
92235
|
init_shared();
|
|
@@ -92058,10 +92304,10 @@ async function pathExists(dir) {
|
|
|
92058
92304
|
|
|
92059
92305
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
92060
92306
|
init_src();
|
|
92061
|
-
import { existsSync as
|
|
92307
|
+
import { existsSync as existsSync57 } from "fs";
|
|
92062
92308
|
import { lstat as lstat11, readdir as readdir8, readFile as readFile20 } from "fs/promises";
|
|
92063
92309
|
import { homedir as homedir21 } from "os";
|
|
92064
|
-
import { basename as
|
|
92310
|
+
import { basename as basename13, join as join77, resolve as resolve20 } from "path";
|
|
92065
92311
|
// packages/omo-opencode/package.json
|
|
92066
92312
|
var package_default3 = {
|
|
92067
92313
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -92117,13 +92363,13 @@ var CODEX_BIN_NAMES = [
|
|
|
92117
92363
|
"omo-git-bash-hook"
|
|
92118
92364
|
];
|
|
92119
92365
|
async function gatherCodexSummary(deps = {}) {
|
|
92120
|
-
const codexHome =
|
|
92366
|
+
const codexHome = resolve20(deps.codexHome ?? process.env.CODEX_HOME ?? join77(homedir21(), ".codex"));
|
|
92121
92367
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
92122
92368
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
92123
92369
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
92124
|
-
const manifest = pluginRoot === null ? null : await readJson(
|
|
92125
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
92126
|
-
const configPath =
|
|
92370
|
+
const manifest = pluginRoot === null ? null : await readJson(join77(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
92371
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join77(pluginRoot, "lazycodex-install.json"));
|
|
92372
|
+
const configPath = join77(codexHome, "config.toml");
|
|
92127
92373
|
const pluginVersion = stringField(manifest, "version");
|
|
92128
92374
|
return {
|
|
92129
92375
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -92179,7 +92425,7 @@ function buildCodexIssues(summary) {
|
|
|
92179
92425
|
if (summary.pluginRoot === null) {
|
|
92180
92426
|
issues.push({
|
|
92181
92427
|
title: "OMO Codex plugin is not installed",
|
|
92182
|
-
description: `Expected cached plugin at ${
|
|
92428
|
+
description: `Expected cached plugin at ${join77("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
92183
92429
|
fix: "Run: npx lazycodex-ai install",
|
|
92184
92430
|
severity: "error",
|
|
92185
92431
|
affects: ["plugin loading"]
|
|
@@ -92232,15 +92478,15 @@ function buildCodexIssues(summary) {
|
|
|
92232
92478
|
return issues;
|
|
92233
92479
|
}
|
|
92234
92480
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
92235
|
-
const pluginRoot =
|
|
92236
|
-
if (!
|
|
92481
|
+
const pluginRoot = join77(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
92482
|
+
if (!existsSync57(pluginRoot))
|
|
92237
92483
|
return null;
|
|
92238
92484
|
const versions2 = await readdir8(pluginRoot, { withFileTypes: true });
|
|
92239
92485
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
92240
|
-
return candidates.length === 0 ? null :
|
|
92486
|
+
return candidates.length === 0 ? null : join77(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
92241
92487
|
}
|
|
92242
92488
|
async function readCodexConfigSummary(configPath) {
|
|
92243
|
-
if (!
|
|
92489
|
+
if (!existsSync57(configPath)) {
|
|
92244
92490
|
return { exists: false, marketplaceConfigured: false, pluginEnabled: false, pluginsFeatureEnabled: false, pluginHooksFeatureEnabled: false };
|
|
92245
92491
|
}
|
|
92246
92492
|
const content = await readFile20(configPath, "utf8");
|
|
@@ -92255,17 +92501,17 @@ async function readCodexConfigSummary(configPath) {
|
|
|
92255
92501
|
async function readLinkedBins(binDir) {
|
|
92256
92502
|
const linked = [];
|
|
92257
92503
|
for (const name of CODEX_BIN_NAMES) {
|
|
92258
|
-
if (await pathExists2(
|
|
92504
|
+
if (await pathExists2(join77(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
92259
92505
|
linked.push(name);
|
|
92260
92506
|
}
|
|
92261
92507
|
return linked;
|
|
92262
92508
|
}
|
|
92263
92509
|
async function readLinkedAgents(codexHome) {
|
|
92264
|
-
const agentsDir =
|
|
92265
|
-
if (!
|
|
92510
|
+
const agentsDir = join77(codexHome, "agents");
|
|
92511
|
+
if (!existsSync57(agentsDir))
|
|
92266
92512
|
return [];
|
|
92267
92513
|
const entries = await readdir8(agentsDir, { withFileTypes: true });
|
|
92268
|
-
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) =>
|
|
92514
|
+
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
|
|
92269
92515
|
}
|
|
92270
92516
|
async function readJson(path16) {
|
|
92271
92517
|
try {
|
|
@@ -92321,7 +92567,7 @@ async function pathExists2(path16) {
|
|
|
92321
92567
|
init_src();
|
|
92322
92568
|
import { readdir as readdir9, readFile as readFile21, stat as stat4 } from "fs/promises";
|
|
92323
92569
|
import { homedir as homedir22 } from "os";
|
|
92324
|
-
import { dirname as
|
|
92570
|
+
import { dirname as dirname29, join as join78, relative as relative10, resolve as resolve21, sep as sep9 } from "path";
|
|
92325
92571
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
92326
92572
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
92327
92573
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -92331,7 +92577,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
92331
92577
|
const env3 = deps.env ?? process.env;
|
|
92332
92578
|
const platform = deps.platform ?? process.platform;
|
|
92333
92579
|
const arch = deps.arch ?? process.arch;
|
|
92334
|
-
const codexHome =
|
|
92580
|
+
const codexHome = resolve21(deps.codexHome ?? env3["CODEX_HOME"] ?? join78(homedir22(), ".codex"));
|
|
92335
92581
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
92336
92582
|
if (summary.pluginRoot === null) {
|
|
92337
92583
|
return {
|
|
@@ -92356,7 +92602,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
92356
92602
|
});
|
|
92357
92603
|
}
|
|
92358
92604
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
92359
|
-
const runtimeSgPath =
|
|
92605
|
+
const runtimeSgPath = join78(runtimeSgDir, sgBinaryName(platform));
|
|
92360
92606
|
const sg = findSgBinarySync({
|
|
92361
92607
|
arch,
|
|
92362
92608
|
env: env3,
|
|
@@ -92395,8 +92641,8 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
92395
92641
|
const manifest = await readJson2(manifestPath);
|
|
92396
92642
|
if (manifest === null || !isRecord5(manifest["mcpServers"]))
|
|
92397
92643
|
continue;
|
|
92398
|
-
const manifestRoot =
|
|
92399
|
-
const isRootManifest =
|
|
92644
|
+
const manifestRoot = dirname29(manifestPath);
|
|
92645
|
+
const isRootManifest = resolve21(manifestRoot) === resolve21(pluginRoot);
|
|
92400
92646
|
for (const server2 of Object.values(manifest["mcpServers"])) {
|
|
92401
92647
|
if (!isRecord5(server2) || !Array.isArray(server2["args"]))
|
|
92402
92648
|
continue;
|
|
@@ -92416,7 +92662,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
92416
92662
|
continue;
|
|
92417
92663
|
const commands2 = [];
|
|
92418
92664
|
collectHookCommands(manifest, commands2);
|
|
92419
|
-
const hookPluginRoot =
|
|
92665
|
+
const hookPluginRoot = dirname29(dirname29(hookManifestPath));
|
|
92420
92666
|
for (const command of commands2) {
|
|
92421
92667
|
for (const relativePath of extractPluginRootPaths(command)) {
|
|
92422
92668
|
referencedCount += 1;
|
|
@@ -92438,8 +92684,8 @@ function recordBrokenTarget(broken, classified, origin) {
|
|
|
92438
92684
|
broken.push(entry);
|
|
92439
92685
|
}
|
|
92440
92686
|
async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
|
|
92441
|
-
const targetPath =
|
|
92442
|
-
const bundleRootPath =
|
|
92687
|
+
const targetPath = resolve21(baseRoot, relativePath);
|
|
92688
|
+
const bundleRootPath = resolve21(bundleRoot);
|
|
92443
92689
|
const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
|
|
92444
92690
|
if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
|
|
92445
92691
|
if (allowEscape)
|
|
@@ -92455,7 +92701,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
|
|
|
92455
92701
|
}
|
|
92456
92702
|
async function findHookManifestPaths(root) {
|
|
92457
92703
|
const paths2 = await findManifestPaths(root, "hooks.json");
|
|
92458
|
-
return paths2.filter((path16) =>
|
|
92704
|
+
return paths2.filter((path16) => dirname29(path16).endsWith(`${sep9}hooks`));
|
|
92459
92705
|
}
|
|
92460
92706
|
async function findManifestPaths(root, manifestName) {
|
|
92461
92707
|
let entries;
|
|
@@ -92468,7 +92714,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
92468
92714
|
for (const entry of entries) {
|
|
92469
92715
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
92470
92716
|
continue;
|
|
92471
|
-
const entryPath =
|
|
92717
|
+
const entryPath = join78(root, entry.name);
|
|
92472
92718
|
if (entry.isDirectory()) {
|
|
92473
92719
|
paths2.push(...await findManifestPaths(entryPath, manifestName));
|
|
92474
92720
|
continue;
|
|
@@ -92511,18 +92757,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
92511
92757
|
return (arg.startsWith("./") || arg.startsWith("../")) && arg.endsWith("/dist/cli.js");
|
|
92512
92758
|
}
|
|
92513
92759
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
92514
|
-
return
|
|
92760
|
+
return join78(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
92515
92761
|
}
|
|
92516
92762
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
92517
92763
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
92518
92764
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
92519
92765
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
92520
|
-
if (sgPath ===
|
|
92766
|
+
if (sgPath === join78(runtimeSgDir, sgBinaryName(platform)))
|
|
92521
92767
|
return "runtime dir";
|
|
92522
92768
|
return "PATH";
|
|
92523
92769
|
}
|
|
92524
92770
|
async function readBootstrapStateSummary(codexHome) {
|
|
92525
|
-
const statePath =
|
|
92771
|
+
const statePath = join78(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
92526
92772
|
const raw = await readJson2(statePath);
|
|
92527
92773
|
if (raw === null)
|
|
92528
92774
|
return null;
|
|
@@ -92588,7 +92834,7 @@ async function fileSize(path16) {
|
|
|
92588
92834
|
}
|
|
92589
92835
|
}
|
|
92590
92836
|
function normalizeRelative(root, target) {
|
|
92591
|
-
return normalizePathSeparators(
|
|
92837
|
+
return normalizePathSeparators(relative10(root, target));
|
|
92592
92838
|
}
|
|
92593
92839
|
function normalizePathSeparators(path16) {
|
|
92594
92840
|
return path16.split("\\").join("/");
|
|
@@ -92598,23 +92844,23 @@ function isRecord5(value) {
|
|
|
92598
92844
|
}
|
|
92599
92845
|
|
|
92600
92846
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
92601
|
-
import { existsSync as
|
|
92847
|
+
import { existsSync as existsSync58 } from "fs";
|
|
92602
92848
|
import { readFile as readFile22 } from "fs/promises";
|
|
92603
92849
|
import { homedir as homedir23 } from "os";
|
|
92604
|
-
import { join as
|
|
92850
|
+
import { join as join79, resolve as resolve22 } from "path";
|
|
92605
92851
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
92606
92852
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
92607
92853
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
92608
92854
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
92609
|
-
const codexHome =
|
|
92855
|
+
const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join79(homedir23(), ".codex"));
|
|
92610
92856
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
92611
92857
|
const platform = deps.platform ?? process.platform;
|
|
92612
|
-
const wrapperPath =
|
|
92858
|
+
const wrapperPath = join79(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
92613
92859
|
const wrapper = await readRuntimeWrapper(wrapperPath);
|
|
92614
92860
|
const issues = [];
|
|
92615
92861
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
92616
92862
|
const targetPath = parseRuntimeTargetPath(wrapper);
|
|
92617
|
-
if (targetPath !== null && !
|
|
92863
|
+
if (targetPath !== null && !existsSync58(targetPath)) {
|
|
92618
92864
|
issues.push({
|
|
92619
92865
|
title: "omo runtime wrapper target is missing",
|
|
92620
92866
|
description: `Generated omo runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
|
|
@@ -93106,7 +93352,7 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
93106
93352
|
import { createHash as createHash4 } from "crypto";
|
|
93107
93353
|
import {
|
|
93108
93354
|
chmodSync as chmodSync4,
|
|
93109
|
-
existsSync as
|
|
93355
|
+
existsSync as existsSync61,
|
|
93110
93356
|
mkdirSync as mkdirSync14,
|
|
93111
93357
|
readdirSync as readdirSync9,
|
|
93112
93358
|
readFileSync as readFileSync41,
|
|
@@ -93114,15 +93360,15 @@ import {
|
|
|
93114
93360
|
unlinkSync as unlinkSync8,
|
|
93115
93361
|
writeFileSync as writeFileSync11
|
|
93116
93362
|
} from "fs";
|
|
93117
|
-
import { basename as
|
|
93363
|
+
import { basename as basename14, dirname as dirname30, join as join82 } from "path";
|
|
93118
93364
|
|
|
93119
93365
|
// packages/mcp-client-core/src/config-dir.ts
|
|
93120
|
-
import { existsSync as
|
|
93366
|
+
import { existsSync as existsSync59, realpathSync as realpathSync8 } from "fs";
|
|
93121
93367
|
import { homedir as homedir24 } from "os";
|
|
93122
|
-
import { join as
|
|
93368
|
+
import { join as join80, resolve as resolve23 } from "path";
|
|
93123
93369
|
function resolveConfigPath2(pathValue) {
|
|
93124
|
-
const resolvedPath =
|
|
93125
|
-
if (!
|
|
93370
|
+
const resolvedPath = resolve23(pathValue);
|
|
93371
|
+
if (!existsSync59(resolvedPath))
|
|
93126
93372
|
return resolvedPath;
|
|
93127
93373
|
try {
|
|
93128
93374
|
return realpathSync8(resolvedPath);
|
|
@@ -93137,13 +93383,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
93137
93383
|
if (customConfigDir) {
|
|
93138
93384
|
return resolveConfigPath2(customConfigDir);
|
|
93139
93385
|
}
|
|
93140
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
93141
|
-
return resolveConfigPath2(
|
|
93386
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join80(homedir24(), ".config");
|
|
93387
|
+
return resolveConfigPath2(join80(xdgConfigDir, "opencode"));
|
|
93142
93388
|
}
|
|
93143
93389
|
|
|
93144
93390
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
93145
|
-
import { chmodSync as chmodSync3, existsSync as
|
|
93146
|
-
import { join as
|
|
93391
|
+
import { chmodSync as chmodSync3, existsSync as existsSync60, readFileSync as readFileSync40, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "fs";
|
|
93392
|
+
import { join as join81 } from "path";
|
|
93147
93393
|
var INDEX_FILE_NAME = "index.json";
|
|
93148
93394
|
function isTokenIndex(value) {
|
|
93149
93395
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -93151,11 +93397,11 @@ function isTokenIndex(value) {
|
|
|
93151
93397
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
93152
93398
|
}
|
|
93153
93399
|
function getIndexPath(storageDir) {
|
|
93154
|
-
return
|
|
93400
|
+
return join81(storageDir, INDEX_FILE_NAME);
|
|
93155
93401
|
}
|
|
93156
93402
|
function readTokenIndex(storageDir) {
|
|
93157
93403
|
const indexPath = getIndexPath(storageDir);
|
|
93158
|
-
if (!
|
|
93404
|
+
if (!existsSync60(indexPath))
|
|
93159
93405
|
return {};
|
|
93160
93406
|
try {
|
|
93161
93407
|
const parsed = JSON.parse(readFileSync40(indexPath, "utf-8"));
|
|
@@ -93195,16 +93441,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
93195
93441
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
93196
93442
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
93197
93443
|
function getMcpOauthStorageDir() {
|
|
93198
|
-
return
|
|
93444
|
+
return join82(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
93199
93445
|
}
|
|
93200
93446
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
93201
93447
|
return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
93202
93448
|
}
|
|
93203
93449
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
93204
|
-
return
|
|
93450
|
+
return join82(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
93205
93451
|
}
|
|
93206
93452
|
function getLegacyStoragePath() {
|
|
93207
|
-
return
|
|
93453
|
+
return join82(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
93208
93454
|
}
|
|
93209
93455
|
function normalizeHost2(serverHost) {
|
|
93210
93456
|
let host = serverHost.trim();
|
|
@@ -93265,7 +93511,7 @@ function isOAuthTokenData(value) {
|
|
|
93265
93511
|
return clientSecret === undefined || typeof clientSecret === "string";
|
|
93266
93512
|
}
|
|
93267
93513
|
function readTokenFile(filePath) {
|
|
93268
|
-
if (!
|
|
93514
|
+
if (!existsSync61(filePath))
|
|
93269
93515
|
return null;
|
|
93270
93516
|
try {
|
|
93271
93517
|
const parsed = JSON.parse(readFileSync41(filePath, "utf-8"));
|
|
@@ -93278,7 +93524,7 @@ function readTokenFile(filePath) {
|
|
|
93278
93524
|
}
|
|
93279
93525
|
function readLegacyStore() {
|
|
93280
93526
|
const filePath = getLegacyStoragePath();
|
|
93281
|
-
if (!
|
|
93527
|
+
if (!existsSync61(filePath))
|
|
93282
93528
|
return null;
|
|
93283
93529
|
try {
|
|
93284
93530
|
const parsed = JSON.parse(readFileSync41(filePath, "utf-8"));
|
|
@@ -93298,8 +93544,8 @@ function readLegacyStore() {
|
|
|
93298
93544
|
}
|
|
93299
93545
|
function writeTokenFile(filePath, token) {
|
|
93300
93546
|
try {
|
|
93301
|
-
const dir =
|
|
93302
|
-
if (!
|
|
93547
|
+
const dir = dirname30(filePath);
|
|
93548
|
+
if (!existsSync61(dir)) {
|
|
93303
93549
|
mkdirSync14(dir, { recursive: true });
|
|
93304
93550
|
}
|
|
93305
93551
|
const tempPath = `${filePath}.tmp.${Date.now()}`;
|
|
@@ -93323,7 +93569,7 @@ function saveToken(serverHost, resource, token) {
|
|
|
93323
93569
|
}
|
|
93324
93570
|
function deleteToken(serverHost, resource) {
|
|
93325
93571
|
const filePath = getMcpOauthStoragePath(serverHost, resource);
|
|
93326
|
-
if (!
|
|
93572
|
+
if (!existsSync61(filePath))
|
|
93327
93573
|
return deleteLegacyToken(serverHost, resource);
|
|
93328
93574
|
try {
|
|
93329
93575
|
unlinkSync8(filePath);
|
|
@@ -93345,7 +93591,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
93345
93591
|
if (Object.keys(store2).length === 0) {
|
|
93346
93592
|
try {
|
|
93347
93593
|
const filePath = getLegacyStoragePath();
|
|
93348
|
-
if (
|
|
93594
|
+
if (existsSync61(filePath))
|
|
93349
93595
|
unlinkSync8(filePath);
|
|
93350
93596
|
return true;
|
|
93351
93597
|
} catch (deleteError) {
|
|
@@ -93383,7 +93629,7 @@ function listTokensByHost(serverHost) {
|
|
|
93383
93629
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
93384
93630
|
if (!indexedKey.startsWith(prefix))
|
|
93385
93631
|
continue;
|
|
93386
|
-
const indexedToken = readTokenFile(
|
|
93632
|
+
const indexedToken = readTokenFile(join82(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
93387
93633
|
if (indexedToken)
|
|
93388
93634
|
result[indexedKey] = indexedToken;
|
|
93389
93635
|
}
|
|
@@ -93392,14 +93638,14 @@ function listTokensByHost(serverHost) {
|
|
|
93392
93638
|
function listAllTokens() {
|
|
93393
93639
|
const result = { ...readLegacyStore() ?? {} };
|
|
93394
93640
|
const dir = getMcpOauthStorageDir();
|
|
93395
|
-
if (!
|
|
93641
|
+
if (!existsSync61(dir))
|
|
93396
93642
|
return result;
|
|
93397
93643
|
const index = readTokenIndex(dir);
|
|
93398
93644
|
for (const entry of readdirSync9(dir, { withFileTypes: true })) {
|
|
93399
93645
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
93400
93646
|
continue;
|
|
93401
|
-
const token = readTokenFile(
|
|
93402
|
-
const hash2 =
|
|
93647
|
+
const token = readTokenFile(join82(dir, entry.name));
|
|
93648
|
+
const hash2 = basename14(entry.name, ".json");
|
|
93403
93649
|
if (token)
|
|
93404
93650
|
result[index[hash2] ?? hash2] = token;
|
|
93405
93651
|
}
|
|
@@ -93598,7 +93844,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
|
93598
93844
|
}
|
|
93599
93845
|
var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
93600
93846
|
function startCallbackServer(port) {
|
|
93601
|
-
return new Promise((
|
|
93847
|
+
return new Promise((resolve24, reject) => {
|
|
93602
93848
|
let timeoutId;
|
|
93603
93849
|
const server2 = createServer2((request, response) => {
|
|
93604
93850
|
clearTimeout(timeoutId);
|
|
@@ -93624,7 +93870,7 @@ function startCallbackServer(port) {
|
|
|
93624
93870
|
response.writeHead(200, { "content-type": "text/html" });
|
|
93625
93871
|
response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
|
|
93626
93872
|
server2.close();
|
|
93627
|
-
|
|
93873
|
+
resolve24({ code, state: state2 });
|
|
93628
93874
|
});
|
|
93629
93875
|
timeoutId = setTimeout(() => {
|
|
93630
93876
|
server2.close();
|
|
@@ -93964,7 +94210,7 @@ function createMcpOAuthCommand() {
|
|
|
93964
94210
|
}
|
|
93965
94211
|
|
|
93966
94212
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
93967
|
-
import { existsSync as
|
|
94213
|
+
import { existsSync as existsSync62 } from "fs";
|
|
93968
94214
|
|
|
93969
94215
|
// packages/omo-opencode/src/cli/boulder/formatter.ts
|
|
93970
94216
|
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
@@ -94101,10 +94347,10 @@ async function boulder(options) {
|
|
|
94101
94347
|
const boulderFilePath = getBoulderFilePath(directory);
|
|
94102
94348
|
const state2 = readBoulderState(directory);
|
|
94103
94349
|
if (!state2) {
|
|
94104
|
-
const message =
|
|
94350
|
+
const message = existsSync62(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
|
|
94105
94351
|
process.stderr.write(`${message}
|
|
94106
94352
|
`);
|
|
94107
|
-
return
|
|
94353
|
+
return existsSync62(boulderFilePath) ? 2 : 1;
|
|
94108
94354
|
}
|
|
94109
94355
|
const works = getBoulderWorks(state2);
|
|
94110
94356
|
const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
|
|
@@ -94122,7 +94368,7 @@ async function boulder(options) {
|
|
|
94122
94368
|
}
|
|
94123
94369
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
94124
94370
|
import { spawn as spawn5 } from "child_process";
|
|
94125
|
-
import { existsSync as
|
|
94371
|
+
import { existsSync as existsSync63, realpathSync as realpathSync9 } from "fs";
|
|
94126
94372
|
import { homedir as homedir25 } from "os";
|
|
94127
94373
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
94128
94374
|
const env3 = input.env ?? process.env;
|
|
@@ -94147,22 +94393,22 @@ async function codexUlwLoop(args) {
|
|
|
94147
94393
|
console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
|
|
94148
94394
|
return 1;
|
|
94149
94395
|
}
|
|
94150
|
-
return new Promise((
|
|
94396
|
+
return new Promise((resolve24) => {
|
|
94151
94397
|
const child = spawn5(command.executable, [...command.argsPrefix, ...args], { stdio: "inherit" });
|
|
94152
94398
|
child.on("error", (error51) => {
|
|
94153
94399
|
console.error(error51.message);
|
|
94154
|
-
|
|
94400
|
+
resolve24(1);
|
|
94155
94401
|
});
|
|
94156
|
-
child.on("close", (code) =>
|
|
94402
|
+
child.on("close", (code) => resolve24(code ?? 1));
|
|
94157
94403
|
});
|
|
94158
94404
|
}
|
|
94159
94405
|
function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
94160
94406
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
|
|
94161
|
-
return candidates.find((candidate) =>
|
|
94407
|
+
return candidates.find((candidate) => existsSync63(candidate)) ?? null;
|
|
94162
94408
|
}
|
|
94163
94409
|
function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
94164
94410
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
|
|
94165
|
-
return candidates.find((candidate) =>
|
|
94411
|
+
return candidates.find((candidate) => existsSync63(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths)) ?? null;
|
|
94166
94412
|
}
|
|
94167
94413
|
function isCurrentExecutable(candidate, currentExecutablePaths) {
|
|
94168
94414
|
const candidateRealPath = realpathOrSelf(candidate);
|
|
@@ -94211,15 +94457,15 @@ async function refreshModelCapabilities(options, deps = {}) {
|
|
|
94211
94457
|
}
|
|
94212
94458
|
|
|
94213
94459
|
// packages/omo-opencode/src/cli/sparkshell.ts
|
|
94214
|
-
import { spawnSync as
|
|
94460
|
+
import { spawnSync as spawnSync5 } from "child_process";
|
|
94215
94461
|
import { constants as osConstants } from "os";
|
|
94216
|
-
import { isAbsolute as
|
|
94462
|
+
import { isAbsolute as isAbsolute11, resolve as resolve24 } from "path";
|
|
94217
94463
|
|
|
94218
94464
|
// packages/omo-opencode/src/cli/sparkshell-appserver.ts
|
|
94219
94465
|
init_src();
|
|
94220
|
-
import { existsSync as
|
|
94466
|
+
import { existsSync as existsSync64 } from "fs";
|
|
94221
94467
|
import { homedir as homedir26 } from "os";
|
|
94222
|
-
import { join as
|
|
94468
|
+
import { join as join83 } from "path";
|
|
94223
94469
|
|
|
94224
94470
|
// packages/omo-opencode/src/cli/sparkshell-appserver-websocket.ts
|
|
94225
94471
|
import { randomBytes as randomBytes3 } from "crypto";
|
|
@@ -94370,7 +94616,7 @@ function bufferUnreadSocketBytes(socket, unread) {
|
|
|
94370
94616
|
// packages/omo-opencode/src/cli/sparkshell-appserver.ts
|
|
94371
94617
|
function createDefaultSparkShellAppServerClient(env3) {
|
|
94372
94618
|
const socketPath = resolveAppServerSocketPath(env3);
|
|
94373
|
-
if (!socketPath || !
|
|
94619
|
+
if (!socketPath || !existsSync64(socketPath)) {
|
|
94374
94620
|
return null;
|
|
94375
94621
|
}
|
|
94376
94622
|
return new JsonRpcSparkShellAppServerClient(socketPath, resolveAppServerTimeoutMs(env3));
|
|
@@ -94380,8 +94626,8 @@ function resolveAppServerSocketPath(env3) {
|
|
|
94380
94626
|
if (explicit) {
|
|
94381
94627
|
return explicit;
|
|
94382
94628
|
}
|
|
94383
|
-
const codexHome = env3["CODEX_HOME"]?.trim() ||
|
|
94384
|
-
return
|
|
94629
|
+
const codexHome = env3["CODEX_HOME"]?.trim() || join83(homedir26(), ".codex");
|
|
94630
|
+
return join83(codexHome, "app-server-control", "app-server-control.sock");
|
|
94385
94631
|
}
|
|
94386
94632
|
function resolveAppServerTimeoutMs(env3) {
|
|
94387
94633
|
const parsed = Number.parseInt(env3["OMO_SPARKSHELL_APP_SERVER_TIMEOUT_MS"]?.trim() ?? "", 10);
|
|
@@ -94810,9 +95056,9 @@ function extractContextHints(requests) {
|
|
|
94810
95056
|
seen.add(key);
|
|
94811
95057
|
hints.push(hint);
|
|
94812
95058
|
}
|
|
94813
|
-
const
|
|
94814
|
-
if (
|
|
94815
|
-
add(
|
|
95059
|
+
const basename15 = hint.slice(hint.lastIndexOf("/") + 1);
|
|
95060
|
+
if (basename15.length > 0 && basename15 !== hint) {
|
|
95061
|
+
add(basename15);
|
|
94816
95062
|
}
|
|
94817
95063
|
};
|
|
94818
95064
|
for (const request of requests) {
|
|
@@ -94951,9 +95197,9 @@ function isLowSurrogate(codeUnit) {
|
|
|
94951
95197
|
|
|
94952
95198
|
// packages/omo-opencode/src/cli/sparkshell-session-context.ts
|
|
94953
95199
|
init_src();
|
|
94954
|
-
import { existsSync as
|
|
95200
|
+
import { existsSync as existsSync65, readdirSync as readdirSync10, readFileSync as readFileSync42 } from "fs";
|
|
94955
95201
|
import { homedir as homedir27 } from "os";
|
|
94956
|
-
import { join as
|
|
95202
|
+
import { join as join84 } from "path";
|
|
94957
95203
|
var SPARKSHELL_SESSION_CONTEXT_ENV = "OMO_SPARKSHELL_SESSION_CONTEXT";
|
|
94958
95204
|
var SPARKSHELL_SESSION_ID_ENV = "OMO_SPARKSHELL_SESSION_ID";
|
|
94959
95205
|
var CODEX_THREAD_ID_ENV = "CODEX_THREAD_ID";
|
|
@@ -94966,11 +95212,11 @@ function resolveCodexSessionId(env3) {
|
|
|
94966
95212
|
return /^[0-9a-f][0-9a-f-]{7,}$/i.test(candidate) ? candidate : null;
|
|
94967
95213
|
}
|
|
94968
95214
|
function findRolloutPath(sessionId, env3, deps = {}) {
|
|
94969
|
-
const fileExists = deps.fileExists ??
|
|
95215
|
+
const fileExists = deps.fileExists ?? existsSync65;
|
|
94970
95216
|
const listDirectory = deps.listDirectory ?? ((path16) => readdirSync10(path16));
|
|
94971
95217
|
const homeDirectory = deps.homeDirectory ?? homedir27;
|
|
94972
|
-
const codexHome = env3["CODEX_HOME"]?.trim() ||
|
|
94973
|
-
const roots = [
|
|
95218
|
+
const codexHome = env3["CODEX_HOME"]?.trim() || join84(homeDirectory(), ".codex");
|
|
95219
|
+
const roots = [join84(codexHome, "sessions"), join84(codexHome, "archived_sessions")];
|
|
94974
95220
|
const fileSuffix = `-${sessionId}.jsonl`;
|
|
94975
95221
|
const scanDay = (dayDir) => {
|
|
94976
95222
|
if (!fileExists(dayDir)) {
|
|
@@ -94978,14 +95224,14 @@ function findRolloutPath(sessionId, env3, deps = {}) {
|
|
|
94978
95224
|
}
|
|
94979
95225
|
for (const name of listSafely(listDirectory, dayDir)) {
|
|
94980
95226
|
if (name.startsWith("rollout-") && name.endsWith(fileSuffix)) {
|
|
94981
|
-
return
|
|
95227
|
+
return join84(dayDir, name);
|
|
94982
95228
|
}
|
|
94983
95229
|
}
|
|
94984
95230
|
return null;
|
|
94985
95231
|
};
|
|
94986
95232
|
for (const dayDir of uuidV7DayDirCandidates(sessionId)) {
|
|
94987
95233
|
for (const root of roots) {
|
|
94988
|
-
const found = scanDay(
|
|
95234
|
+
const found = scanDay(join84(root, dayDir));
|
|
94989
95235
|
if (found) {
|
|
94990
95236
|
return found;
|
|
94991
95237
|
}
|
|
@@ -94996,9 +95242,9 @@ function findRolloutPath(sessionId, env3, deps = {}) {
|
|
|
94996
95242
|
continue;
|
|
94997
95243
|
}
|
|
94998
95244
|
for (const year of numericNamesDescending(listSafely(listDirectory, root))) {
|
|
94999
|
-
for (const month of numericNamesDescending(listSafely(listDirectory,
|
|
95000
|
-
for (const day of numericNamesDescending(listSafely(listDirectory,
|
|
95001
|
-
const found = scanDay(
|
|
95245
|
+
for (const month of numericNamesDescending(listSafely(listDirectory, join84(root, year)))) {
|
|
95246
|
+
for (const day of numericNamesDescending(listSafely(listDirectory, join84(root, year, month)))) {
|
|
95247
|
+
const found = scanDay(join84(root, year, month, day));
|
|
95002
95248
|
if (found) {
|
|
95003
95249
|
return found;
|
|
95004
95250
|
}
|
|
@@ -95158,7 +95404,7 @@ function uuidV7DayDirCandidates(sessionId) {
|
|
|
95158
95404
|
const candidates = [];
|
|
95159
95405
|
for (const offsetDays of [0, 1, -1]) {
|
|
95160
95406
|
const date5 = new Date(ms + offsetDays * DAY_MS);
|
|
95161
|
-
candidates.push(
|
|
95407
|
+
candidates.push(join84(String(date5.getFullYear()), pad2(date5.getMonth() + 1), pad2(date5.getDate())));
|
|
95162
95408
|
}
|
|
95163
95409
|
return candidates;
|
|
95164
95410
|
}
|
|
@@ -95196,10 +95442,10 @@ function isFalsy2(value) {
|
|
|
95196
95442
|
}
|
|
95197
95443
|
|
|
95198
95444
|
// packages/omo-opencode/src/cli/sparkshell-spark.ts
|
|
95199
|
-
import { spawnSync as
|
|
95445
|
+
import { spawnSync as spawnSync4 } from "child_process";
|
|
95200
95446
|
import { mkdtempSync, readFileSync as readFileSync43, rmSync as rmSync4 } from "fs";
|
|
95201
95447
|
import { tmpdir as tmpdir4 } from "os";
|
|
95202
|
-
import { join as
|
|
95448
|
+
import { join as join85 } from "path";
|
|
95203
95449
|
var SPARKSHELL_SPARK_ENV = "OMO_SPARKSHELL_SPARK";
|
|
95204
95450
|
var SPARKSHELL_SPARK_MODEL_ENV = "OMO_SPARKSHELL_SPARK_MODEL";
|
|
95205
95451
|
var SPARKSHELL_SPARK_TIMEOUT_ENV = "OMO_SPARKSHELL_SPARK_TIMEOUT_MS";
|
|
@@ -95273,10 +95519,10 @@ function buildSparkExecArgs(env3, lastMessagePath) {
|
|
|
95273
95519
|
function createDefaultSparkSummarizer(env3, cwd) {
|
|
95274
95520
|
return (request) => {
|
|
95275
95521
|
const binary = env3[SPARKSHELL_SPARK_BIN_ENV]?.trim() || "codex";
|
|
95276
|
-
const tempDir = mkdtempSync(
|
|
95277
|
-
const lastMessagePath =
|
|
95522
|
+
const tempDir = mkdtempSync(join85(tmpdir4(), "omo-sparkshell-spark-"));
|
|
95523
|
+
const lastMessagePath = join85(tempDir, "last-message.txt");
|
|
95278
95524
|
try {
|
|
95279
|
-
const result =
|
|
95525
|
+
const result = spawnSync4(binary, [...buildSparkExecArgs(env3, lastMessagePath)], {
|
|
95280
95526
|
cwd,
|
|
95281
95527
|
env: { ...process.env, ...env3, [SPARKSHELL_SPARK_ENV]: "0" },
|
|
95282
95528
|
input: buildSparkSummaryPrompt(request),
|
|
@@ -95469,7 +95715,7 @@ function resolveNativeBinaryOverride(env3, cwd) {
|
|
|
95469
95715
|
if (override.length === 0) {
|
|
95470
95716
|
return "";
|
|
95471
95717
|
}
|
|
95472
|
-
return
|
|
95718
|
+
return isAbsolute11(override) || /^[A-Za-z]:[\\/]/.test(override) ? override : resolve24(cwd, override);
|
|
95473
95719
|
}
|
|
95474
95720
|
async function runAppServerCommand(args, appServerClient, options) {
|
|
95475
95721
|
let invocation;
|
|
@@ -95581,13 +95827,13 @@ function signalExitCode(signal) {
|
|
|
95581
95827
|
return typeof signalNumber === "number" && Number.isFinite(signalNumber) ? 128 + signalNumber : 1;
|
|
95582
95828
|
}
|
|
95583
95829
|
function defaultCommandExists(command) {
|
|
95584
|
-
const result =
|
|
95830
|
+
const result = spawnSync5(command, ["--version"], {
|
|
95585
95831
|
stdio: "ignore"
|
|
95586
95832
|
});
|
|
95587
95833
|
return result.error === undefined;
|
|
95588
95834
|
}
|
|
95589
95835
|
function defaultSpawn(command, args, options) {
|
|
95590
|
-
const result =
|
|
95836
|
+
const result = spawnSync5(command, [...args], {
|
|
95591
95837
|
cwd: options.cwd,
|
|
95592
95838
|
env: { ...process.env, ...options.env },
|
|
95593
95839
|
stdio: ["inherit", "pipe", "pipe"],
|