oh-my-opencode 4.15.1 → 4.16.1
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/.agents/skills/codex-qa/SKILL.md +9 -7
- package/.agents/skills/codex-qa/references/logging-debug.md +6 -4
- package/.agents/skills/opencode-qa/SKILL.md +9 -9
- package/.agents/skills/opencode-qa/references/tui-tmux.md +10 -8
- package/dist/cli/codex-ulw-loop.d.ts +8 -0
- package/dist/cli/doctor/checks/tui-plugin-config.d.ts +4 -4
- package/dist/cli/get-local-version/types.d.ts +1 -1
- package/dist/cli/index.js +792 -744
- package/dist/cli/install-senpi/index.d.ts +1 -0
- package/dist/cli/run/poll-for-completion.d.ts +4 -0
- package/dist/cli/run/session-resolver.d.ts +1 -0
- package/dist/cli/senpi-platform-flag.d.ts +4 -0
- package/dist/cli/types.d.ts +2 -1
- package/dist/cli-node/index.js +792 -744
- package/dist/features/background-agent/manager.d.ts +16 -0
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/monitor/process.d.ts +17 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/aggressive-truncation-strategy.d.ts +1 -0
- package/dist/index.js +2206 -1971
- package/dist/skills/debugging/references/methodology/06-fix.md +6 -0
- package/dist/skills/frontend/ATTRIBUTION.md +10 -1
- package/dist/skills/frontend/SKILL.md +12 -7
- package/dist/skills/frontend/references/design/README.md +8 -4
- package/dist/skills/frontend/references/design/_INDEX.md +2 -2
- package/dist/skills/frontend/references/design/design-system-architecture.md +24 -2
- package/dist/skills/frontend/references/design/lazyweb.md +77 -0
- package/dist/skills/frontend/references/design/stitch-design-example.md +121 -0
- package/dist/skills/frontend/references/designpowers/README.md +2 -2
- package/dist/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
- package/dist/skills/programming/SKILL.md +10 -1
- package/dist/skills/programming/references/logging.md +91 -0
- package/dist/skills/start-work/SKILL.md +2 -2
- package/dist/skills/ulw-plan/SKILL.md +5 -5
- package/dist/skills/ulw-plan/references/full-workflow.md +7 -7
- package/dist/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/dist/skills/ulw-research/ATTRIBUTION.md +2 -2
- package/dist/skills/ulw-research/SKILL.md +28 -7
- package/dist/skills/visual-qa/SKILL.md +13 -17
- package/dist/tools/skill/description-formatter.d.ts +1 -0
- package/dist/tools/skill/description-formatter.test-support.d.ts +9 -0
- package/dist/tools/skill/zauc-mocks-skill-tools/test-support.d.ts +25 -0
- package/dist/tui.js +121 -419
- package/docs/reference/web-terminal-visual-qa.md +39 -45
- package/package.json +48 -25
- package/packages/git-bash-mcp/dist/cli.js +2 -2
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/AGENTS.md +55 -0
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +19 -16
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/AGENTS.md +51 -0
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +936 -248
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +233 -135
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/src/cache-gc.ts +29 -0
- package/packages/omo-codex/plugin/components/codegraph/src/cli.ts +13 -0
- package/packages/omo-codex/plugin/components/codegraph/src/hook-sweep.ts +25 -0
- package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +3 -1
- package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +30 -1
- package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +16 -2
- package/packages/omo-codex/plugin/components/codegraph/src/sweep-cli.ts +80 -0
- package/packages/omo-codex/plugin/components/codegraph/test/cache-gc.test.ts +34 -0
- package/packages/omo-codex/plugin/components/codegraph/test/hook-exclusion.test.ts +107 -0
- package/packages/omo-codex/plugin/components/codegraph/test/hook-registration.test.ts +26 -0
- package/packages/omo-codex/plugin/components/codegraph/test/hook-sweep.test.ts +29 -0
- package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +8 -21
- package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +108 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve-built-wrapper.test.ts +76 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +17 -111
- package/packages/omo-codex/plugin/components/codegraph/test/serve-provision.test.ts +1 -1
- package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +45 -67
- package/packages/omo-codex/plugin/components/codegraph/test/sweep-cli.test.ts +56 -0
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/AGENTS.md +31 -0
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/AGENTS.md +45 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +37 -102
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/AGENTS.md +46 -0
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +6 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +6 -0
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +5 -2
- package/packages/omo-codex/plugin/components/ultrawork/CHANGELOG.md +2 -0
- package/packages/omo-codex/plugin/components/ultrawork/README.md +3 -3
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +18 -10
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +51 -2
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +2 -1
- package/packages/omo-codex/plugin/components/ultrawork/scripts/sync-directive.mjs +14 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +388 -0
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +16 -2
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +4 -4
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +5 -3
- package/packages/omo-codex/plugin/components/ultrawork/src/skill-pointer.ts +56 -0
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +26 -5
- package/packages/omo-codex/plugin/components/ultrawork/test/directive-source.test.ts +12 -0
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +1 -0
- package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +82 -0
- package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +18 -10
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +15 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +145 -32
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +5 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +55 -9
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-snapshot.d.ts +15 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-snapshot.js +33 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.d.ts +10 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +15 -11
- package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.d.ts +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.js +5 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-skill-pointer.d.ts +7 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-skill-pointer.js +46 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +7 -7
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +17 -2
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +5 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +59 -11
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-snapshot.ts +38 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-types.ts +11 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +15 -7
- package/packages/omo-codex/plugin/components/ulw-loop/src/ultrawork-directive.ts +9 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/ultrawork-skill-pointer.ts +55 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io.test.ts +260 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering-snapshot.test.ts +124 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +101 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +49 -0
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +13 -13
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/build-components.mjs +63 -17
- package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +10 -6
- package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +10 -3
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +1 -0
- package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +18 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/06-fix.md +6 -0
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +10 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +12 -7
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +8 -4
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +2 -2
- package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +24 -2
- package/packages/omo-codex/plugin/skills/frontend/references/design/lazyweb.md +77 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stitch-design-example.md +121 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/README.md +2 -2
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
- package/packages/omo-codex/plugin/skills/programming/SKILL.md +10 -1
- package/packages/omo-codex/plugin/skills/programming/references/logging.md +91 -0
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +388 -0
- package/packages/omo-codex/plugin/skills/ultrawork/agents/openai.yaml +2 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +7 -7
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +16 -2
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +4 -4
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-research/ATTRIBUTION.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +28 -7
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +13 -17
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -4
- package/packages/omo-codex/plugin/test/bootstrap-hooks.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +22 -9
- package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/sync-hook-status-messages.test.mjs +6 -6
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -0
- package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +56 -0
- package/packages/omo-codex/plugin/test/ulw-plan-skill-contract.test.mjs +52 -0
- package/packages/omo-codex/plugin/test/ulw-research-epistemic-contract.test.mjs +98 -0
- package/packages/omo-codex/plugin/test/ulw-research-skill-contract.test.mjs +6 -6
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +310 -3979
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +2 -2
- package/packages/shared-skills/skills/debugging/references/methodology/06-fix.md +6 -0
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +10 -1
- package/packages/shared-skills/skills/frontend/SKILL.md +12 -7
- package/packages/shared-skills/skills/frontend/references/design/README.md +8 -4
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +2 -2
- package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +24 -2
- package/packages/shared-skills/skills/frontend/references/design/lazyweb.md +77 -0
- package/packages/shared-skills/skills/frontend/references/design/stitch-design-example.md +121 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/README.md +2 -2
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
- package/packages/shared-skills/skills/programming/SKILL.md +10 -1
- package/packages/shared-skills/skills/programming/references/logging.md +91 -0
- package/packages/shared-skills/skills/start-work/SKILL.md +2 -2
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +5 -5
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +7 -7
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/shared-skills/skills/ulw-research/ATTRIBUTION.md +2 -2
- package/packages/shared-skills/skills/ulw-research/SKILL.md +28 -7
- package/packages/shared-skills/skills/visual-qa/SKILL.md +13 -17
- package/script/qa/strip-ansi.mjs +10 -0
- package/script/qa/web-terminal-visual-qa.mjs +112 -195
- package/script/qa/xterm-live-terminal.mjs +180 -0
- package/script/qa/web-terminal-renderer.mjs +0 -218
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.16.1",
|
|
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",
|
|
@@ -2159,6 +2159,7 @@ var init_package = __esm(() => {
|
|
|
2159
2159
|
"packages/lsp-core",
|
|
2160
2160
|
"packages/utils",
|
|
2161
2161
|
"packages/model-core",
|
|
2162
|
+
"packages/omo-config-core",
|
|
2162
2163
|
"packages/prompts-core",
|
|
2163
2164
|
"packages/comment-checker-core",
|
|
2164
2165
|
"packages/hashline-core",
|
|
@@ -2172,6 +2173,10 @@ var init_package = __esm(() => {
|
|
|
2172
2173
|
"packages/agents-md-core",
|
|
2173
2174
|
"packages/shared-skills",
|
|
2174
2175
|
"packages/omo-codex",
|
|
2176
|
+
"packages/omo-senpi",
|
|
2177
|
+
"packages/senpi-task",
|
|
2178
|
+
"packages/pi-goal",
|
|
2179
|
+
"packages/pi-webfetch",
|
|
2175
2180
|
"packages/omo-opencode"
|
|
2176
2181
|
],
|
|
2177
2182
|
bin: {
|
|
@@ -2186,10 +2191,11 @@ var init_package = __esm(() => {
|
|
|
2186
2191
|
"dist",
|
|
2187
2192
|
"bin",
|
|
2188
2193
|
"postinstall.mjs",
|
|
2194
|
+
"script/qa/strip-ansi.mjs",
|
|
2189
2195
|
"script/qa/web-terminal-redaction.d.mts",
|
|
2190
2196
|
"script/qa/web-terminal-redaction.mjs",
|
|
2191
|
-
"script/qa/web-terminal-renderer.mjs",
|
|
2192
2197
|
"script/qa/web-terminal-visual-qa.mjs",
|
|
2198
|
+
"script/qa/xterm-live-terminal.mjs",
|
|
2193
2199
|
"docs/reference/github-attachment-upload.md",
|
|
2194
2200
|
"docs/reference/web-terminal-visual-qa.md",
|
|
2195
2201
|
".opencode/command",
|
|
@@ -2228,6 +2234,7 @@ var init_package = __esm(() => {
|
|
|
2228
2234
|
"packages/omo-codex/plugin/.codex-plugin",
|
|
2229
2235
|
"!packages/omo-codex/plugin/node_modules",
|
|
2230
2236
|
"!packages/omo-codex/plugin/**/node_modules",
|
|
2237
|
+
"!packages/omo-codex/plugin/components/workflow-selector",
|
|
2231
2238
|
"packages/omo-codex/scripts",
|
|
2232
2239
|
"!packages/omo-codex/scripts/install"
|
|
2233
2240
|
],
|
|
@@ -2241,10 +2248,11 @@ var init_package = __esm(() => {
|
|
|
2241
2248
|
"./schema.json": "./dist/oh-my-opencode.schema.json"
|
|
2242
2249
|
},
|
|
2243
2250
|
scripts: {
|
|
2244
|
-
build: "bun run
|
|
2251
|
+
build: "bun run script/build.ts",
|
|
2245
2252
|
"build:cli-node": "bun run script/build-cli-node.ts",
|
|
2246
2253
|
"build:codex-install": "bun run script/build-codex-install.ts",
|
|
2247
2254
|
"build:codex-plugin": "npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build",
|
|
2255
|
+
"build:senpi-plugin": "node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check",
|
|
2248
2256
|
"build:materialize-frontend": "node packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs --strict",
|
|
2249
2257
|
"build:shared-skills-assets": "bun run build:materialize-frontend && rm -rf dist/skills && cp -R packages/shared-skills/skills dist/skills",
|
|
2250
2258
|
"build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
|
|
@@ -2253,6 +2261,7 @@ var init_package = __esm(() => {
|
|
|
2253
2261
|
"build:all": "bun run build && bun run build:binaries",
|
|
2254
2262
|
"build:binaries": "bun run script/build-binaries.ts",
|
|
2255
2263
|
"build:schema": "bun run script/build-schema.ts",
|
|
2264
|
+
"build:omo-schema": "bun run script/build-omo-schema.ts",
|
|
2256
2265
|
"build:model-capabilities": "bun run script/build-model-capabilities.ts",
|
|
2257
2266
|
clean: "rm -rf dist",
|
|
2258
2267
|
prepack: "bun run build:materialize-frontend",
|
|
@@ -2261,10 +2270,11 @@ var init_package = __esm(() => {
|
|
|
2261
2270
|
prepublishOnly: "bun run clean && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && bun run build",
|
|
2262
2271
|
"test:model-capabilities": "bun test packages/model-core/src/model-capability-aliases.test.ts packages/model-core/src/model-capability-guardrails.test.ts packages/model-core/src/model-capabilities.test.ts packages/omo-opencode/src/cli/doctor/checks/model-resolution.test.ts --bail",
|
|
2263
2272
|
typecheck: "tsgo --noEmit && bun run typecheck:script && bun run typecheck:packages",
|
|
2264
|
-
"typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/openclaw-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/omo-codex/plugin/shared/tsconfig.json && tsgo --noEmit -p packages/omo-codex/tsconfig.json && tsgo --noEmit -p packages/omo-opencode/tsconfig.json",
|
|
2273
|
+
"typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/omo-config-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/openclaw-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/omo-codex/plugin/shared/tsconfig.json && tsgo --noEmit -p packages/omo-codex/tsconfig.json && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && tsgo --noEmit -p packages/senpi-task/tsconfig.json && tsgo --noEmit -p packages/pi-goal/tsconfig.json && tsgo --noEmit -p packages/pi-webfetch/tsconfig.json && tsgo --noEmit -p packages/omo-opencode/tsconfig.json",
|
|
2265
2274
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
2266
2275
|
test: "bun test",
|
|
2267
2276
|
"test:codex": "bun run build:codex-install && bun run build:git-bash-mcp && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && npm --prefix packages/lsp-tools-mcp test && npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build && npm --prefix packages/omo-codex/plugin/components/codegraph run typecheck && npm --prefix packages/omo-codex/plugin/components/codegraph test && node scripts/check-third-party-notices.mjs --ship && bun test packages/omo-opencode/src/cli/cli-installer.platform.test.ts packages/omo-codex/src/install/codex-cache.test.ts packages/omo-codex/src/install/codex-cleanup.test.ts packages/omo-codex/src/install/codex-config-agent-cleanup.test.ts packages/omo-codex/src/install/codex-config-autonomous-features.test.ts packages/omo-codex/src/install/codex-config-reasoning.test.ts packages/omo-codex/src/install/codex-config-toml.test.ts packages/omo-codex/src/install/codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex.test.ts packages/omo-codex/src/install/install-codex-packaged.test.ts packages/omo-codex/src/install/link-cached-plugin-agents.test.ts packages/omo-codex/src/**/*.test.ts packages/utils/src/jsonc-parser.test.ts packages/utils/src/frontmatter.test.ts packages/hashline-core/src/hash-computation.test.ts packages/hashline-core/src/smoke-untested-modules.test.ts packages/rules-engine/src/index.test.ts packages/rules-engine/src/security-boundary.test.ts packages/agents-md-core/src/injector.test.ts packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts && node --test packages/omo-codex/plugin/test/*.test.mjs packages/omo-codex/scripts/install-cache-copy.test.mjs packages/omo-codex/scripts/install-cli-args.test.mjs packages/omo-codex/scripts/install-delegated-command.test.mjs packages/omo-codex/scripts/install-config-autonomous-features.test.mjs packages/omo-codex/scripts/install-config-autonomous.test.mjs packages/omo-codex/scripts/install-config-reasoning.test.mjs packages/omo-codex/scripts/install-config.test.mjs packages/omo-codex/scripts/install-hook-targets.test.mjs packages/omo-codex/scripts/install-project-local-cleanup.test.mjs packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs packages/omo-codex/scripts/install-local-entrypoint.test.mjs packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs packages/omo-codex/scripts/install-local.test.mjs packages/omo-codex/scripts/install-marketplace-cache.test.mjs packages/omo-codex/scripts/install-mcp-context7-runtime.test.mjs packages/omo-codex/scripts/install-mcp-runtime.test.mjs packages/omo-codex/scripts/install-packaged-local.test.mjs packages/omo-codex/scripts/install-generated-bundle.test.mjs packages/omo-codex/scripts/install-agent-links.test.mjs packages/omo-codex/scripts/install-bin-links.test.mjs",
|
|
2277
|
+
"test:senpi": "node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check && bun test packages/omo-senpi",
|
|
2268
2278
|
"test:windows-codex": "bun run test:codex",
|
|
2269
2279
|
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
|
|
2270
2280
|
},
|
|
@@ -2308,48 +2318,61 @@ var init_package = __esm(() => {
|
|
|
2308
2318
|
zod: "^4.4.3"
|
|
2309
2319
|
},
|
|
2310
2320
|
devDependencies: {
|
|
2311
|
-
"@oh-my-opencode/git-bash-mcp": "workspace:*",
|
|
2312
|
-
"@oh-my-opencode/lsp-core": "workspace:*",
|
|
2313
|
-
"@oh-my-opencode/mcp-stdio-core": "workspace:*",
|
|
2314
|
-
"@oh-my-opencode/mcp-client-core": "workspace:*",
|
|
2315
2321
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
2316
2322
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
2317
2323
|
"@oh-my-opencode/claude-code-compat-core": "workspace:*",
|
|
2318
|
-
"@oh-my-opencode/skills-loader-core": "workspace:*",
|
|
2319
2324
|
"@oh-my-opencode/comment-checker-core": "workspace:*",
|
|
2320
2325
|
"@oh-my-opencode/delegate-core": "workspace:*",
|
|
2326
|
+
"@oh-my-opencode/git-bash-mcp": "workspace:*",
|
|
2321
2327
|
"@oh-my-opencode/hashline-core": "workspace:*",
|
|
2322
|
-
"@oh-my-opencode/
|
|
2323
|
-
"@oh-my-opencode/
|
|
2324
|
-
"@oh-my-opencode/
|
|
2328
|
+
"@oh-my-opencode/lsp-core": "workspace:*",
|
|
2329
|
+
"@oh-my-opencode/mcp-client-core": "workspace:*",
|
|
2330
|
+
"@oh-my-opencode/mcp-stdio-core": "workspace:*",
|
|
2325
2331
|
"@oh-my-opencode/model-core": "workspace:*",
|
|
2326
2332
|
"@oh-my-opencode/omo-codex": "workspace:*",
|
|
2333
|
+
"@oh-my-opencode/omo-config-core": "workspace:*",
|
|
2334
|
+
"@oh-my-opencode/omo-senpi": "workspace:*",
|
|
2335
|
+
"@oh-my-opencode/openclaw-core": "workspace:*",
|
|
2336
|
+
"@oh-my-opencode/pi-goal": "workspace:*",
|
|
2337
|
+
"@oh-my-opencode/pi-webfetch": "workspace:*",
|
|
2327
2338
|
"@oh-my-opencode/prompts-core": "workspace:*",
|
|
2328
2339
|
"@oh-my-opencode/rules-engine": "workspace:*",
|
|
2340
|
+
"@oh-my-opencode/senpi-task": "workspace:*",
|
|
2329
2341
|
"@oh-my-opencode/shared-skills": "workspace:*",
|
|
2342
|
+
"@oh-my-opencode/skills-loader-core": "workspace:*",
|
|
2343
|
+
"@oh-my-opencode/team-core": "workspace:*",
|
|
2330
2344
|
"@oh-my-opencode/telemetry-core": "workspace:*",
|
|
2345
|
+
"@oh-my-opencode/tmux-core": "workspace:*",
|
|
2331
2346
|
"@oh-my-opencode/utils": "workspace:*",
|
|
2332
|
-
"@typescript/native-preview": "7.0.0-dev.20260518.1",
|
|
2333
2347
|
"@types/js-yaml": "^4.0.9",
|
|
2334
2348
|
"@types/picomatch": "^4.0.3",
|
|
2349
|
+
"@typescript/native-preview": "7.0.0-dev.20260518.1",
|
|
2350
|
+
"@xterm/addon-unicode11": "^0.9.0",
|
|
2351
|
+
"@xterm/xterm": "^6.0.0",
|
|
2335
2352
|
"bun-types": "1.3.14",
|
|
2353
|
+
"node-pty": "^1.1.0",
|
|
2354
|
+
"puppeteer-core": "^25.3.0",
|
|
2336
2355
|
typescript: "^6.0.3"
|
|
2337
2356
|
},
|
|
2338
2357
|
optionalDependencies: {
|
|
2339
|
-
"oh-my-opencode-darwin-arm64": "4.
|
|
2340
|
-
"oh-my-opencode-darwin-x64": "4.
|
|
2341
|
-
"oh-my-opencode-darwin-x64-baseline": "4.
|
|
2342
|
-
"oh-my-opencode-linux-arm64": "4.
|
|
2343
|
-
"oh-my-opencode-linux-arm64-musl": "4.
|
|
2344
|
-
"oh-my-opencode-linux-x64": "4.
|
|
2345
|
-
"oh-my-opencode-linux-x64-baseline": "4.
|
|
2346
|
-
"oh-my-opencode-linux-x64-musl": "4.
|
|
2347
|
-
"oh-my-opencode-linux-x64-musl-baseline": "4.
|
|
2348
|
-
"oh-my-opencode-windows-arm64": "4.
|
|
2349
|
-
"oh-my-opencode-windows-x64": "4.
|
|
2350
|
-
"oh-my-opencode-windows-x64-baseline": "4.
|
|
2358
|
+
"oh-my-opencode-darwin-arm64": "4.16.1",
|
|
2359
|
+
"oh-my-opencode-darwin-x64": "4.16.1",
|
|
2360
|
+
"oh-my-opencode-darwin-x64-baseline": "4.16.1",
|
|
2361
|
+
"oh-my-opencode-linux-arm64": "4.16.1",
|
|
2362
|
+
"oh-my-opencode-linux-arm64-musl": "4.16.1",
|
|
2363
|
+
"oh-my-opencode-linux-x64": "4.16.1",
|
|
2364
|
+
"oh-my-opencode-linux-x64-baseline": "4.16.1",
|
|
2365
|
+
"oh-my-opencode-linux-x64-musl": "4.16.1",
|
|
2366
|
+
"oh-my-opencode-linux-x64-musl-baseline": "4.16.1",
|
|
2367
|
+
"oh-my-opencode-windows-arm64": "4.16.1",
|
|
2368
|
+
"oh-my-opencode-windows-x64": "4.16.1",
|
|
2369
|
+
"oh-my-opencode-windows-x64-baseline": "4.16.1"
|
|
2351
2370
|
},
|
|
2352
2371
|
overrides: {
|
|
2372
|
+
"@earendil-works/pi-agent-core": "0.80.3",
|
|
2373
|
+
"@earendil-works/pi-ai": "0.80.3",
|
|
2374
|
+
"@earendil-works/pi-coding-agent": "0.80.3",
|
|
2375
|
+
"@earendil-works/pi-tui": "0.80.3",
|
|
2353
2376
|
hono: "^4.12.18",
|
|
2354
2377
|
"@hono/node-server": "^1.19.13",
|
|
2355
2378
|
"express-rate-limit": "^8.5.1",
|
|
@@ -2529,14 +2552,10 @@ var init_config_section_parser = __esm(() => {
|
|
|
2529
2552
|
});
|
|
2530
2553
|
|
|
2531
2554
|
// packages/utils/src/env-expansion.ts
|
|
2532
|
-
var init_env_expansion =
|
|
2533
|
-
init_deep_merge();
|
|
2534
|
-
});
|
|
2555
|
+
var init_env_expansion = () => {};
|
|
2535
2556
|
|
|
2536
2557
|
// packages/utils/src/snake-case.ts
|
|
2537
|
-
var init_snake_case =
|
|
2538
|
-
init_deep_merge();
|
|
2539
|
-
});
|
|
2558
|
+
var init_snake_case = () => {};
|
|
2540
2559
|
|
|
2541
2560
|
// packages/utils/src/record-type-guard.ts
|
|
2542
2561
|
function isRecord(value) {
|
|
@@ -5634,6 +5653,7 @@ var init_port_utils = () => {};
|
|
|
5634
5653
|
|
|
5635
5654
|
// packages/utils/src/tool-name.ts
|
|
5636
5655
|
var init_tool_name = () => {};
|
|
5656
|
+
|
|
5637
5657
|
// node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
5638
5658
|
function createScanner(text, ignoreTrivia = false) {
|
|
5639
5659
|
const len = text.length;
|
|
@@ -7115,27 +7135,13 @@ function log(message, data) {
|
|
|
7115
7135
|
var sharedSubunitLogger = () => {};
|
|
7116
7136
|
|
|
7117
7137
|
// packages/utils/src/omo-config.ts
|
|
7118
|
-
var
|
|
7119
|
-
var init_omo_config = __esm(() => {
|
|
7120
|
-
HARNESS_IDS = ["codex", "opencode", "omo"];
|
|
7121
|
-
});
|
|
7122
|
-
|
|
7123
|
-
// packages/utils/src/omo-config/env-overrides.ts
|
|
7124
|
-
var init_env_overrides = () => {};
|
|
7138
|
+
var init_omo_config = () => {};
|
|
7125
7139
|
|
|
7126
7140
|
// packages/utils/src/omo-config/resolve.ts
|
|
7127
7141
|
var init_resolve = () => {};
|
|
7128
7142
|
|
|
7129
7143
|
// packages/utils/src/omo-config/loader.ts
|
|
7130
|
-
var
|
|
7131
|
-
var init_loader = __esm(() => {
|
|
7132
|
-
init_deep_merge();
|
|
7133
|
-
init_jsonc_parser();
|
|
7134
|
-
init_omo_config();
|
|
7135
|
-
init_env_overrides();
|
|
7136
|
-
init_resolve();
|
|
7137
|
-
HARNESS_BLOCK_KEYS = HARNESS_IDS.map((harness) => `[${harness}]`);
|
|
7138
|
-
});
|
|
7144
|
+
var init_loader = () => {};
|
|
7139
7145
|
|
|
7140
7146
|
// packages/utils/src/archive-entry-validator.ts
|
|
7141
7147
|
var init_archive_entry_validator = () => {};
|
|
@@ -7160,9 +7166,7 @@ function sgBinaryName(platform = process.platform) {
|
|
|
7160
7166
|
var init_sg_manifest = () => {};
|
|
7161
7167
|
|
|
7162
7168
|
// packages/utils/src/ast-grep/sg-provisioner.ts
|
|
7163
|
-
var init_sg_provisioner =
|
|
7164
|
-
init_sg_manifest();
|
|
7165
|
-
});
|
|
7169
|
+
var init_sg_provisioner = () => {};
|
|
7166
7170
|
|
|
7167
7171
|
// packages/utils/src/ast-grep/types.ts
|
|
7168
7172
|
var SG_PATH_ENV_KEY = "OMO_AST_GREP_SG_PATH";
|
|
@@ -7421,6 +7425,7 @@ var init_env = __esm(() => {
|
|
|
7421
7425
|
"CODEGRAPH_ALLOW_UNSAFE_NODE",
|
|
7422
7426
|
"CODEGRAPH_BIN",
|
|
7423
7427
|
"CODEGRAPH_FAKE_LOG",
|
|
7428
|
+
"CODEGRAPH_NO_DAEMON",
|
|
7424
7429
|
"CODEGRAPH_NODE_BIN",
|
|
7425
7430
|
"OMO_CODEGRAPH_BIN",
|
|
7426
7431
|
"OMO_CODEGRAPH_PROJECT_CWD",
|
|
@@ -7432,9 +7437,7 @@ var init_env = __esm(() => {
|
|
|
7432
7437
|
var init_workspace = () => {};
|
|
7433
7438
|
|
|
7434
7439
|
// packages/utils/src/codegraph/guidance.ts
|
|
7435
|
-
var init_guidance =
|
|
7436
|
-
init_workspace();
|
|
7437
|
-
});
|
|
7440
|
+
var init_guidance = () => {};
|
|
7438
7441
|
|
|
7439
7442
|
// packages/utils/src/codegraph/node-support.ts
|
|
7440
7443
|
function evaluateCodegraphNodeSupport(options = {}) {
|
|
@@ -7457,18 +7460,17 @@ function parseNodeMajor(version) {
|
|
|
7457
7460
|
}
|
|
7458
7461
|
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";
|
|
7459
7462
|
|
|
7460
|
-
// packages/utils/src/codegraph/manifest.ts
|
|
7461
|
-
var init_manifest = () => {};
|
|
7462
|
-
|
|
7463
7463
|
// packages/utils/src/codegraph/provision.ts
|
|
7464
7464
|
import { execFile } from "child_process";
|
|
7465
7465
|
import { promisify } from "util";
|
|
7466
7466
|
var execFileAsync;
|
|
7467
7467
|
var init_provision = __esm(() => {
|
|
7468
|
-
init_manifest();
|
|
7469
7468
|
execFileAsync = promisify(execFile);
|
|
7470
7469
|
});
|
|
7471
7470
|
|
|
7471
|
+
// packages/utils/src/codegraph/process-sweep.ts
|
|
7472
|
+
var init_process_sweep = () => {};
|
|
7473
|
+
|
|
7472
7474
|
// packages/utils/src/codegraph/resolve.ts
|
|
7473
7475
|
import { existsSync as existsSync7 } from "fs";
|
|
7474
7476
|
import { spawnSync } from "child_process";
|
|
@@ -7566,56 +7568,16 @@ var init_codegraph = __esm(() => {
|
|
|
7566
7568
|
init_env();
|
|
7567
7569
|
init_guidance();
|
|
7568
7570
|
init_provision();
|
|
7571
|
+
init_process_sweep();
|
|
7569
7572
|
init_resolve2();
|
|
7570
7573
|
init_workspace();
|
|
7571
7574
|
});
|
|
7572
7575
|
|
|
7573
|
-
// packages/utils/src/command-executor/home-directory.ts
|
|
7574
|
-
var init_home_directory = () => {};
|
|
7575
|
-
|
|
7576
|
-
// packages/utils/src/command-executor/shell-path.ts
|
|
7577
|
-
var init_shell_path = () => {};
|
|
7578
|
-
|
|
7579
|
-
// packages/utils/src/command-executor/execute-hook-command.ts
|
|
7580
|
-
var init_execute_hook_command = __esm(() => {
|
|
7581
|
-
init_home_directory();
|
|
7582
|
-
init_shell_path();
|
|
7583
|
-
});
|
|
7584
|
-
|
|
7585
|
-
// packages/utils/src/command-executor/execute-command.ts
|
|
7586
|
-
import { exec } from "child_process";
|
|
7587
|
-
import { promisify as promisify2 } from "util";
|
|
7588
|
-
var execAsync;
|
|
7589
|
-
var init_execute_command = __esm(() => {
|
|
7590
|
-
execAsync = promisify2(exec);
|
|
7591
|
-
});
|
|
7592
|
-
|
|
7593
|
-
// packages/utils/src/command-executor/embedded-commands.ts
|
|
7594
|
-
var init_embedded_commands = () => {};
|
|
7595
|
-
|
|
7596
|
-
// packages/utils/src/command-executor/resolve-commands-in-text.ts
|
|
7597
|
-
var init_resolve_commands_in_text = __esm(() => {
|
|
7598
|
-
init_execute_command();
|
|
7599
|
-
init_embedded_commands();
|
|
7600
|
-
});
|
|
7601
|
-
|
|
7602
7576
|
// packages/utils/src/command-executor.ts
|
|
7603
|
-
var init_command_executor =
|
|
7604
|
-
|
|
7605
|
-
init_execute_command();
|
|
7606
|
-
init_resolve_commands_in_text();
|
|
7607
|
-
});
|
|
7608
|
-
// packages/utils/src/git-worktree/parse-status-porcelain.ts
|
|
7609
|
-
var init_parse_status_porcelain = () => {};
|
|
7610
|
-
// packages/utils/src/git-worktree/collect-git-diff-stats.ts
|
|
7611
|
-
var init_collect_git_diff_stats = __esm(() => {
|
|
7612
|
-
init_parse_status_porcelain();
|
|
7613
|
-
});
|
|
7577
|
+
var init_command_executor = () => {};
|
|
7578
|
+
|
|
7614
7579
|
// packages/utils/src/git-worktree/index.ts
|
|
7615
|
-
var init_git_worktree =
|
|
7616
|
-
init_parse_status_porcelain();
|
|
7617
|
-
init_collect_git_diff_stats();
|
|
7618
|
-
});
|
|
7580
|
+
var init_git_worktree = () => {};
|
|
7619
7581
|
|
|
7620
7582
|
// packages/utils/src/internal-initiator-marker.ts
|
|
7621
7583
|
function hasInternalInitiatorMarker(text) {
|
|
@@ -8036,12 +7998,9 @@ var init_config_migration = __esm(() => {
|
|
|
8036
7998
|
|
|
8037
7999
|
// packages/utils/src/migration.ts
|
|
8038
8000
|
var init_migration = __esm(() => {
|
|
8039
|
-
init_agent_names();
|
|
8040
|
-
init_hook_names();
|
|
8041
|
-
init_model_versions();
|
|
8042
|
-
init_agent_category();
|
|
8043
8001
|
init_config_migration();
|
|
8044
8002
|
});
|
|
8003
|
+
|
|
8045
8004
|
// packages/utils/src/prompt-async-gate/route-resolver.ts
|
|
8046
8005
|
function identityRoute(client) {
|
|
8047
8006
|
return { client, route: "in-process", reason: "identity" };
|
|
@@ -9103,7 +9062,6 @@ var init_prompt_async_gate = __esm(() => {
|
|
|
9103
9062
|
init_route_resolver();
|
|
9104
9063
|
init_session_idle_settle();
|
|
9105
9064
|
init_queue();
|
|
9106
|
-
init_recent_dispatches();
|
|
9107
9065
|
init_reservations();
|
|
9108
9066
|
init_session_idle_dispatch();
|
|
9109
9067
|
init_semantic_dedupe();
|
|
@@ -9136,39 +9094,8 @@ function isAmbiguousPostDispatchPromptFailure(result) {
|
|
|
9136
9094
|
return result.dispatchAttempted === true && isAmbiguousPromptDispatchFailure(result.error);
|
|
9137
9095
|
}
|
|
9138
9096
|
|
|
9139
|
-
// packages/utils/src/zip-entry-listing/python-zip-entry-listing.ts
|
|
9140
|
-
var init_python_zip_entry_listing = __esm(() => {
|
|
9141
|
-
init_runtime();
|
|
9142
|
-
});
|
|
9143
|
-
|
|
9144
|
-
// packages/utils/src/zip-entry-listing/powershell-zip-entry-listing.ts
|
|
9145
|
-
var init_powershell_zip_entry_listing = __esm(() => {
|
|
9146
|
-
init_runtime();
|
|
9147
|
-
});
|
|
9148
|
-
|
|
9149
|
-
// packages/utils/src/zip-entry-listing/tar-zip-entry-listing.ts
|
|
9150
|
-
var init_tar_zip_entry_listing = __esm(() => {
|
|
9151
|
-
init_runtime();
|
|
9152
|
-
});
|
|
9153
|
-
|
|
9154
|
-
// packages/utils/src/zip-entry-listing/read-zip-symlink-target.ts
|
|
9155
|
-
var init_read_zip_symlink_target = __esm(() => {
|
|
9156
|
-
init_runtime();
|
|
9157
|
-
});
|
|
9158
|
-
|
|
9159
|
-
// packages/utils/src/zip-entry-listing/zipinfo-zip-entry-listing.ts
|
|
9160
|
-
var init_zipinfo_zip_entry_listing = __esm(() => {
|
|
9161
|
-
init_runtime();
|
|
9162
|
-
init_read_zip_symlink_target();
|
|
9163
|
-
});
|
|
9164
|
-
|
|
9165
9097
|
// packages/utils/src/zip-entry-listing.ts
|
|
9166
|
-
var init_zip_entry_listing =
|
|
9167
|
-
init_python_zip_entry_listing();
|
|
9168
|
-
init_powershell_zip_entry_listing();
|
|
9169
|
-
init_tar_zip_entry_listing();
|
|
9170
|
-
init_zipinfo_zip_entry_listing();
|
|
9171
|
-
});
|
|
9098
|
+
var init_zip_entry_listing = () => {};
|
|
9172
9099
|
|
|
9173
9100
|
// packages/utils/src/index.ts
|
|
9174
9101
|
var init_src = __esm(() => {
|
|
@@ -9816,10 +9743,7 @@ var init_model_capability_heuristics = __esm(() => {
|
|
|
9816
9743
|
});
|
|
9817
9744
|
|
|
9818
9745
|
// packages/model-core/src/model-capability-guardrails.ts
|
|
9819
|
-
var init_model_capability_guardrails =
|
|
9820
|
-
init_model_capability_aliases();
|
|
9821
|
-
init_model_requirements();
|
|
9822
|
-
});
|
|
9746
|
+
var init_model_capability_guardrails = () => {};
|
|
9823
9747
|
|
|
9824
9748
|
// packages/model-core/src/model-settings-compatibility.ts
|
|
9825
9749
|
function downgradeWithinLadder(value, allowed, ladder) {
|
|
@@ -9954,6 +9878,7 @@ var init_model_settings_compatibility = __esm(() => {
|
|
|
9954
9878
|
VARIANT_LADDER = ["low", "medium", "high", "xhigh", "max"];
|
|
9955
9879
|
REASONING_LADDER = ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
9956
9880
|
});
|
|
9881
|
+
|
|
9957
9882
|
// packages/model-core/src/provider-model-id-transform.ts
|
|
9958
9883
|
function inferSubProvider(model) {
|
|
9959
9884
|
if (model.startsWith("claude-"))
|
|
@@ -10013,11 +9938,6 @@ var init_provider_model_id_transform = __esm(() => {
|
|
|
10013
9938
|
GEMINI_3_FLASH_PREVIEW = /gemini-3-flash(?!-)/g;
|
|
10014
9939
|
});
|
|
10015
9940
|
|
|
10016
|
-
// packages/model-core/src/model-resolution-pipeline.ts
|
|
10017
|
-
var init_model_resolution_pipeline = __esm(() => {
|
|
10018
|
-
init_provider_model_id_transform();
|
|
10019
|
-
});
|
|
10020
|
-
|
|
10021
9941
|
// packages/model-core/src/known-variants.ts
|
|
10022
9942
|
var KNOWN_VARIANTS;
|
|
10023
9943
|
var init_known_variants = __esm(() => {
|
|
@@ -10034,9 +9954,6 @@ var init_known_variants = __esm(() => {
|
|
|
10034
9954
|
]);
|
|
10035
9955
|
});
|
|
10036
9956
|
|
|
10037
|
-
// packages/model-core/src/connected-providers-cache.ts
|
|
10038
|
-
var init_connected_providers_cache = () => {};
|
|
10039
|
-
|
|
10040
9957
|
// packages/model-core/src/model-resolver.ts
|
|
10041
9958
|
function normalizeFallbackModels(models) {
|
|
10042
9959
|
if (!models)
|
|
@@ -10045,11 +9962,8 @@ function normalizeFallbackModels(models) {
|
|
|
10045
9962
|
return [models];
|
|
10046
9963
|
return models;
|
|
10047
9964
|
}
|
|
10048
|
-
var init_model_resolver =
|
|
10049
|
-
|
|
10050
|
-
init_known_variants();
|
|
10051
|
-
init_connected_providers_cache();
|
|
10052
|
-
});
|
|
9965
|
+
var init_model_resolver = () => {};
|
|
9966
|
+
|
|
10053
9967
|
// packages/model-core/src/model-string-parser.ts
|
|
10054
9968
|
var KNOWN_VARIANTS2;
|
|
10055
9969
|
var init_model_string_parser = __esm(() => {
|
|
@@ -10065,16 +9979,13 @@ var init_model_string_parser = __esm(() => {
|
|
|
10065
9979
|
"thinking"
|
|
10066
9980
|
]);
|
|
10067
9981
|
});
|
|
9982
|
+
|
|
10068
9983
|
// packages/model-core/src/fallback-chain-from-models.ts
|
|
10069
|
-
var init_fallback_chain_from_models =
|
|
10070
|
-
init_model_resolver();
|
|
10071
|
-
init_known_variants();
|
|
10072
|
-
});
|
|
9984
|
+
var init_fallback_chain_from_models = () => {};
|
|
10073
9985
|
|
|
10074
9986
|
// packages/model-core/src/model-error-classifier.ts
|
|
10075
9987
|
var RETRYABLE_ERROR_NAMES, STOP_ERROR_NAMES, NON_RETRYABLE_ERROR_NAMES;
|
|
10076
9988
|
var init_model_error_classifier = __esm(() => {
|
|
10077
|
-
init_connected_providers_cache();
|
|
10078
9989
|
RETRYABLE_ERROR_NAMES = new Set([
|
|
10079
9990
|
"providermodelnotfounderror",
|
|
10080
9991
|
"ratelimiterror",
|
|
@@ -10105,21 +10016,13 @@ var init_runtime_fallback_auto_retry_signal = () => {};
|
|
|
10105
10016
|
var init_runtime_fallback_error_shape = () => {};
|
|
10106
10017
|
|
|
10107
10018
|
// packages/model-core/src/runtime-fallback-error-classifier.ts
|
|
10108
|
-
var init_runtime_fallback_error_classifier =
|
|
10109
|
-
init_runtime_fallback_auto_retry_signal();
|
|
10110
|
-
init_runtime_fallback_error_shape();
|
|
10111
|
-
init_runtime_fallback_error_shape();
|
|
10112
|
-
});
|
|
10019
|
+
var init_runtime_fallback_error_classifier = () => {};
|
|
10113
10020
|
|
|
10114
10021
|
// packages/model-core/src/provider-exhaustion-fallback-policy.ts
|
|
10115
|
-
var init_provider_exhaustion_fallback_policy =
|
|
10116
|
-
init_runtime_fallback_error_classifier();
|
|
10117
|
-
});
|
|
10022
|
+
var init_provider_exhaustion_fallback_policy = () => {};
|
|
10118
10023
|
|
|
10119
10024
|
// packages/model-core/src/runtime-fallback-model.ts
|
|
10120
|
-
var init_runtime_fallback_model =
|
|
10121
|
-
init_model_string_parser();
|
|
10122
|
-
});
|
|
10025
|
+
var init_runtime_fallback_model = () => {};
|
|
10123
10026
|
|
|
10124
10027
|
// packages/model-core/src/model-capabilities/supplemental-entries.ts
|
|
10125
10028
|
var SUPPLEMENTAL_MODEL_CAPABILITIES;
|
|
@@ -10526,11 +10429,11 @@ async function fetchModelCapabilitiesSnapshot(args = {}) {
|
|
|
10526
10429
|
};
|
|
10527
10430
|
}
|
|
10528
10431
|
var MODELS_DEV_SOURCE_URL = "https://models.dev/api.json";
|
|
10432
|
+
|
|
10529
10433
|
// packages/model-core/src/index.ts
|
|
10530
10434
|
var init_src2 = __esm(() => {
|
|
10531
10435
|
init_model_resolver();
|
|
10532
10436
|
init_provider_model_id_transform();
|
|
10533
|
-
init_model_resolution_pipeline();
|
|
10534
10437
|
init_model_requirements();
|
|
10535
10438
|
init_model_family_detectors();
|
|
10536
10439
|
init_model_capability_aliases();
|
|
@@ -10551,19 +10454,13 @@ var init_src2 = __esm(() => {
|
|
|
10551
10454
|
});
|
|
10552
10455
|
|
|
10553
10456
|
// packages/omo-opencode/src/shared/model-sanitizer.ts
|
|
10554
|
-
var init_model_sanitizer =
|
|
10555
|
-
init_src2();
|
|
10556
|
-
});
|
|
10457
|
+
var init_model_sanitizer = () => {};
|
|
10557
10458
|
|
|
10558
10459
|
// packages/omo-opencode/src/shared/snake-case.ts
|
|
10559
|
-
var init_snake_case2 =
|
|
10560
|
-
init_src();
|
|
10561
|
-
});
|
|
10460
|
+
var init_snake_case2 = () => {};
|
|
10562
10461
|
|
|
10563
10462
|
// packages/omo-opencode/src/shared/tool-name.ts
|
|
10564
|
-
var init_tool_name2 =
|
|
10565
|
-
init_src();
|
|
10566
|
-
});
|
|
10463
|
+
var init_tool_name2 = () => {};
|
|
10567
10464
|
|
|
10568
10465
|
// packages/omo-opencode/src/shared/pattern-matcher.ts
|
|
10569
10466
|
var regexCache;
|
|
@@ -10571,9 +10468,7 @@ var init_pattern_matcher = __esm(() => {
|
|
|
10571
10468
|
regexCache = new Map;
|
|
10572
10469
|
});
|
|
10573
10470
|
// packages/omo-opencode/src/shared/deep-merge.ts
|
|
10574
|
-
var init_deep_merge2 =
|
|
10575
|
-
init_src();
|
|
10576
|
-
});
|
|
10471
|
+
var init_deep_merge2 = () => {};
|
|
10577
10472
|
|
|
10578
10473
|
// packages/omo-opencode/src/shared/file-utils.ts
|
|
10579
10474
|
var init_file_utils2 = __esm(() => {
|
|
@@ -10581,9 +10476,7 @@ var init_file_utils2 = __esm(() => {
|
|
|
10581
10476
|
});
|
|
10582
10477
|
|
|
10583
10478
|
// packages/omo-opencode/src/shared/context-limit-resolver.ts
|
|
10584
|
-
var init_context_limit_resolver2 =
|
|
10585
|
-
init_src2();
|
|
10586
|
-
});
|
|
10479
|
+
var init_context_limit_resolver2 = () => {};
|
|
10587
10480
|
|
|
10588
10481
|
// packages/omo-opencode/src/shared/normalize-sdk-response.ts
|
|
10589
10482
|
function normalizeSDKResponse(response, fallback, options) {
|
|
@@ -10974,9 +10867,7 @@ function isGpt5_5Model(model) {
|
|
|
10974
10867
|
const modelName = extractModelName(model).toLowerCase();
|
|
10975
10868
|
return modelName.includes("gpt-5.5") || modelName.includes("gpt-5-5");
|
|
10976
10869
|
}
|
|
10977
|
-
var init_types =
|
|
10978
|
-
init_src2();
|
|
10979
|
-
});
|
|
10870
|
+
var init_types = () => {};
|
|
10980
10871
|
|
|
10981
10872
|
// packages/omo-opencode/src/tools/delegate-task/openai-categories.ts
|
|
10982
10873
|
function resolveDeepCategoryPromptAppend(model) {
|
|
@@ -11480,9 +11371,7 @@ var init_zip_extractor = __esm(() => {
|
|
|
11480
11371
|
});
|
|
11481
11372
|
|
|
11482
11373
|
// packages/omo-opencode/src/shared/bun-file-shim.ts
|
|
11483
|
-
var init_bun_file_shim =
|
|
11484
|
-
init_runtime();
|
|
11485
|
-
});
|
|
11374
|
+
var init_bun_file_shim = () => {};
|
|
11486
11375
|
|
|
11487
11376
|
// packages/omo-opencode/src/shared/binary-downloader.ts
|
|
11488
11377
|
import { chmodSync, existsSync as existsSync12, mkdirSync as mkdirSync4, unlinkSync as unlinkSync3 } from "fs";
|
|
@@ -11644,9 +11533,7 @@ function detectShellType() {
|
|
|
11644
11533
|
}
|
|
11645
11534
|
return process.platform === "win32" ? "cmd" : "unix";
|
|
11646
11535
|
}
|
|
11647
|
-
var init_shell_env =
|
|
11648
|
-
init_src();
|
|
11649
|
-
});
|
|
11536
|
+
var init_shell_env = () => {};
|
|
11650
11537
|
|
|
11651
11538
|
// packages/omo-opencode/src/shared/system-directive.ts
|
|
11652
11539
|
var init_system_directive = () => {};
|
|
@@ -11737,8 +11624,8 @@ var init_json_file_cache_store = __esm(() => {
|
|
|
11737
11624
|
});
|
|
11738
11625
|
|
|
11739
11626
|
// packages/omo-opencode/src/shared/connected-providers-cache.ts
|
|
11740
|
-
var
|
|
11741
|
-
__export(
|
|
11627
|
+
var exports_connected_providers_cache = {};
|
|
11628
|
+
__export(exports_connected_providers_cache, {
|
|
11742
11629
|
writeProviderModelsCache: () => writeProviderModelsCache,
|
|
11743
11630
|
updateConnectedProvidersCache: () => updateConnectedProvidersCache,
|
|
11744
11631
|
readProviderModelsCache: () => readProviderModelsCache,
|
|
@@ -11913,7 +11800,7 @@ function findProviderModelMetadata(providerID, modelID, cache = defaultConnected
|
|
|
11913
11800
|
return;
|
|
11914
11801
|
}
|
|
11915
11802
|
var providerModelsCacheWrittenInCurrentProcess = false, CONNECTED_PROVIDERS_CACHE_FILE = "connected-providers.json", PROVIDER_MODELS_CACHE_FILE = "provider-models.json", defaultConnectedProvidersCacheStore, readConnectedProvidersCache, hasConnectedProvidersCache, readProviderModelsCache, hasProviderModelsCache, writeProviderModelsCache, updateConnectedProvidersCache, _resetMemCacheForTesting;
|
|
11916
|
-
var
|
|
11803
|
+
var init_connected_providers_cache = __esm(() => {
|
|
11917
11804
|
init_src();
|
|
11918
11805
|
init_logger2();
|
|
11919
11806
|
init_data_path();
|
|
@@ -11933,18 +11820,15 @@ var init_connected_providers_cache2 = __esm(() => {
|
|
|
11933
11820
|
// packages/omo-opencode/src/shared/model-resolver.ts
|
|
11934
11821
|
var init_model_resolver2 = __esm(() => {
|
|
11935
11822
|
init_src2();
|
|
11936
|
-
|
|
11823
|
+
init_connected_providers_cache();
|
|
11937
11824
|
});
|
|
11938
11825
|
|
|
11939
11826
|
// packages/omo-opencode/src/shared/model-normalization.ts
|
|
11940
|
-
var init_model_normalization =
|
|
11941
|
-
init_src2();
|
|
11942
|
-
});
|
|
11827
|
+
var init_model_normalization = () => {};
|
|
11943
11828
|
|
|
11944
11829
|
// packages/omo-opencode/src/shared/model-resolution-pipeline.ts
|
|
11945
|
-
var
|
|
11946
|
-
|
|
11947
|
-
init_connected_providers_cache2();
|
|
11830
|
+
var init_model_resolution_pipeline = __esm(() => {
|
|
11831
|
+
init_connected_providers_cache();
|
|
11948
11832
|
});
|
|
11949
11833
|
|
|
11950
11834
|
// packages/omo-opencode/src/shared/model-availability.ts
|
|
@@ -11960,7 +11844,7 @@ function isModelCacheAvailable() {
|
|
|
11960
11844
|
var init_model_availability = __esm(() => {
|
|
11961
11845
|
init_logger2();
|
|
11962
11846
|
init_data_path();
|
|
11963
|
-
|
|
11847
|
+
init_connected_providers_cache();
|
|
11964
11848
|
});
|
|
11965
11849
|
|
|
11966
11850
|
// packages/omo-opencode/src/generated/model-capabilities.generated.json
|
|
@@ -62060,12 +61944,12 @@ function getModelCapabilities2(input) {
|
|
|
62060
61944
|
return getModelCapabilities({
|
|
62061
61945
|
...input,
|
|
62062
61946
|
bundledSnapshot: input.bundledSnapshot ?? getBundledModelCapabilitiesSnapshotForRuntime(),
|
|
62063
|
-
providerCache: input.providerCache ??
|
|
61947
|
+
providerCache: input.providerCache ?? exports_connected_providers_cache
|
|
62064
61948
|
});
|
|
62065
61949
|
}
|
|
62066
61950
|
var init_model_capabilities2 = __esm(() => {
|
|
62067
61951
|
init_src2();
|
|
62068
|
-
|
|
61952
|
+
init_connected_providers_cache();
|
|
62069
61953
|
init_model_capabilities_generated();
|
|
62070
61954
|
});
|
|
62071
61955
|
|
|
@@ -62119,13 +62003,11 @@ var init_model_capabilities_cache = __esm(() => {
|
|
|
62119
62003
|
});
|
|
62120
62004
|
|
|
62121
62005
|
// packages/omo-opencode/src/shared/model-settings-compatibility.ts
|
|
62122
|
-
var init_model_settings_compatibility2 =
|
|
62123
|
-
init_src2();
|
|
62124
|
-
});
|
|
62006
|
+
var init_model_settings_compatibility2 = () => {};
|
|
62125
62007
|
|
|
62126
62008
|
// packages/omo-opencode/src/shared/fallback-model-availability.ts
|
|
62127
62009
|
var init_fallback_model_availability = __esm(() => {
|
|
62128
|
-
|
|
62010
|
+
init_connected_providers_cache();
|
|
62129
62011
|
init_logger2();
|
|
62130
62012
|
init_model_availability();
|
|
62131
62013
|
});
|
|
@@ -62333,10 +62215,10 @@ var init_constants3 = __esm(() => {
|
|
|
62333
62215
|
SESSION_TIMEOUT_MS = 60 * 60 * 1000;
|
|
62334
62216
|
SESSION_MISSING_GRACE_MS = 30 * 1000;
|
|
62335
62217
|
});
|
|
62218
|
+
|
|
62336
62219
|
// packages/tmux-core/src/runner.ts
|
|
62337
|
-
var init_runner =
|
|
62338
|
-
|
|
62339
|
-
});
|
|
62220
|
+
var init_runner = () => {};
|
|
62221
|
+
|
|
62340
62222
|
// packages/tmux-core/src/tmux-utils/server-health.ts
|
|
62341
62223
|
var SERVER_RUNNING_KEY;
|
|
62342
62224
|
var init_server_health = __esm(() => {
|
|
@@ -62344,63 +62226,37 @@ var init_server_health = __esm(() => {
|
|
|
62344
62226
|
});
|
|
62345
62227
|
|
|
62346
62228
|
// packages/tmux-core/src/tmux-utils/pane-dimensions.ts
|
|
62347
|
-
var init_pane_dimensions =
|
|
62348
|
-
init_runner();
|
|
62349
|
-
});
|
|
62229
|
+
var init_pane_dimensions = () => {};
|
|
62350
62230
|
|
|
62351
62231
|
// packages/tmux-core/src/tmux-utils/pane-command.ts
|
|
62352
|
-
var init_pane_command =
|
|
62353
|
-
init_src();
|
|
62354
|
-
});
|
|
62232
|
+
var init_pane_command = () => {};
|
|
62355
62233
|
|
|
62356
62234
|
// packages/tmux-core/src/tmux-utils/pane-spawn.ts
|
|
62357
|
-
var init_pane_spawn =
|
|
62358
|
-
|
|
62359
|
-
init_pane_command();
|
|
62360
|
-
});
|
|
62235
|
+
var init_pane_spawn = () => {};
|
|
62236
|
+
|
|
62361
62237
|
// packages/tmux-core/src/tmux-utils/pane-replace.ts
|
|
62362
|
-
var init_pane_replace =
|
|
62363
|
-
init_pane_command();
|
|
62364
|
-
});
|
|
62238
|
+
var init_pane_replace = () => {};
|
|
62365
62239
|
|
|
62366
62240
|
// packages/tmux-core/src/tmux-utils/pane-activate.ts
|
|
62367
|
-
var init_pane_activate =
|
|
62368
|
-
init_runner();
|
|
62369
|
-
init_pane_command();
|
|
62370
|
-
});
|
|
62241
|
+
var init_pane_activate = () => {};
|
|
62371
62242
|
|
|
62372
62243
|
// packages/tmux-core/src/tmux-utils/window-spawn.ts
|
|
62373
|
-
var init_window_spawn =
|
|
62374
|
-
init_server_health();
|
|
62375
|
-
init_pane_command();
|
|
62376
|
-
});
|
|
62244
|
+
var init_window_spawn = () => {};
|
|
62377
62245
|
|
|
62378
62246
|
// packages/tmux-core/src/tmux-utils/session-spawn.ts
|
|
62379
|
-
var init_session_spawn =
|
|
62380
|
-
init_server_health();
|
|
62381
|
-
init_pane_command();
|
|
62382
|
-
});
|
|
62247
|
+
var init_session_spawn = () => {};
|
|
62383
62248
|
|
|
62384
62249
|
// packages/tmux-core/src/tmux-utils/session-kill.ts
|
|
62385
|
-
var init_session_kill =
|
|
62386
|
-
init_runner();
|
|
62387
|
-
});
|
|
62250
|
+
var init_session_kill = () => {};
|
|
62388
62251
|
|
|
62389
62252
|
// packages/tmux-core/src/tmux-utils/stale-session-sweep.ts
|
|
62390
|
-
var init_stale_session_sweep =
|
|
62391
|
-
init_runner();
|
|
62392
|
-
init_session_kill();
|
|
62393
|
-
});
|
|
62253
|
+
var init_stale_session_sweep = () => {};
|
|
62394
62254
|
|
|
62395
62255
|
// packages/tmux-core/src/tmux-utils/layout.ts
|
|
62396
|
-
var init_layout =
|
|
62397
|
-
init_runner();
|
|
62398
|
-
});
|
|
62256
|
+
var init_layout = () => {};
|
|
62399
62257
|
|
|
62400
62258
|
// packages/tmux-core/src/tmux-utils/spawn-process.ts
|
|
62401
|
-
var init_spawn_process =
|
|
62402
|
-
init_runtime();
|
|
62403
|
-
});
|
|
62259
|
+
var init_spawn_process = () => {};
|
|
62404
62260
|
|
|
62405
62261
|
// packages/tmux-core/src/tmux-utils.ts
|
|
62406
62262
|
var init_tmux_utils = __esm(() => {
|
|
@@ -62427,34 +62283,22 @@ var init_src3 = __esm(() => {
|
|
|
62427
62283
|
});
|
|
62428
62284
|
|
|
62429
62285
|
// packages/omo-opencode/src/shared/tmux/constants.ts
|
|
62430
|
-
var init_constants4 =
|
|
62431
|
-
init_src3();
|
|
62432
|
-
});
|
|
62286
|
+
var init_constants4 = () => {};
|
|
62433
62287
|
|
|
62434
62288
|
// packages/omo-opencode/src/shared/tmux/cmux-detect.ts
|
|
62435
|
-
var init_cmux_detect =
|
|
62436
|
-
init_src3();
|
|
62437
|
-
});
|
|
62289
|
+
var init_cmux_detect = () => {};
|
|
62438
62290
|
|
|
62439
62291
|
// packages/omo-opencode/src/shared/tmux/runner.ts
|
|
62440
|
-
var init_runner2 =
|
|
62441
|
-
init_src3();
|
|
62442
|
-
});
|
|
62292
|
+
var init_runner2 = () => {};
|
|
62443
62293
|
|
|
62444
62294
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/environment.ts
|
|
62445
|
-
var init_environment =
|
|
62446
|
-
init_src3();
|
|
62447
|
-
});
|
|
62295
|
+
var init_environment = () => {};
|
|
62448
62296
|
|
|
62449
62297
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/server-health.ts
|
|
62450
|
-
var init_server_health2 =
|
|
62451
|
-
init_src3();
|
|
62452
|
-
});
|
|
62298
|
+
var init_server_health2 = () => {};
|
|
62453
62299
|
|
|
62454
62300
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-dimensions.ts
|
|
62455
|
-
var init_pane_dimensions2 =
|
|
62456
|
-
init_src3();
|
|
62457
|
-
});
|
|
62301
|
+
var init_pane_dimensions2 = () => {};
|
|
62458
62302
|
|
|
62459
62303
|
// packages/omo-opencode/src/shared/bun-which-shim.ts
|
|
62460
62304
|
var init_bun_which_shim = __esm(() => {
|
|
@@ -62479,61 +62323,46 @@ var init_adapter_deps = __esm(() => {
|
|
|
62479
62323
|
|
|
62480
62324
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-spawn.ts
|
|
62481
62325
|
var init_pane_spawn2 = __esm(() => {
|
|
62482
|
-
init_src3();
|
|
62483
62326
|
init_adapter_deps();
|
|
62484
62327
|
});
|
|
62485
62328
|
|
|
62486
62329
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-close.ts
|
|
62487
|
-
var init_pane_close =
|
|
62488
|
-
init_src3();
|
|
62489
|
-
});
|
|
62330
|
+
var init_pane_close = () => {};
|
|
62490
62331
|
|
|
62491
62332
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-replace.ts
|
|
62492
62333
|
var init_pane_replace2 = __esm(() => {
|
|
62493
|
-
init_src3();
|
|
62494
62334
|
init_adapter_deps();
|
|
62495
62335
|
});
|
|
62496
62336
|
|
|
62497
62337
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-activate.ts
|
|
62498
62338
|
var init_pane_activate2 = __esm(() => {
|
|
62499
|
-
init_src3();
|
|
62500
62339
|
init_adapter_deps();
|
|
62501
62340
|
});
|
|
62502
62341
|
|
|
62503
62342
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/window-spawn.ts
|
|
62504
62343
|
var init_window_spawn2 = __esm(() => {
|
|
62505
|
-
init_src3();
|
|
62506
62344
|
init_adapter_deps();
|
|
62507
62345
|
});
|
|
62508
62346
|
|
|
62509
62347
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/session-spawn.ts
|
|
62510
62348
|
var init_session_spawn2 = __esm(() => {
|
|
62511
|
-
init_src3();
|
|
62512
62349
|
init_adapter_deps();
|
|
62513
62350
|
});
|
|
62514
62351
|
|
|
62515
62352
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/session-kill.ts
|
|
62516
|
-
var init_session_kill2 =
|
|
62517
|
-
init_src3();
|
|
62518
|
-
});
|
|
62353
|
+
var init_session_kill2 = () => {};
|
|
62519
62354
|
|
|
62520
62355
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/stale-session-sweep.ts
|
|
62521
|
-
var init_stale_session_sweep2 =
|
|
62522
|
-
init_src3();
|
|
62523
|
-
});
|
|
62356
|
+
var init_stale_session_sweep2 = () => {};
|
|
62524
62357
|
|
|
62525
62358
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/stale-attach-pane-sweep.ts
|
|
62526
62359
|
var init_stale_attach_pane_sweep = () => {};
|
|
62527
62360
|
|
|
62528
62361
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-command.ts
|
|
62529
|
-
var init_pane_command2 =
|
|
62530
|
-
init_src3();
|
|
62531
|
-
});
|
|
62362
|
+
var init_pane_command2 = () => {};
|
|
62532
62363
|
|
|
62533
62364
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/layout.ts
|
|
62534
|
-
var init_layout2 =
|
|
62535
|
-
init_src3();
|
|
62536
|
-
});
|
|
62365
|
+
var init_layout2 = () => {};
|
|
62537
62366
|
|
|
62538
62367
|
// packages/omo-opencode/src/shared/tmux/tmux-utils.ts
|
|
62539
62368
|
var init_tmux_utils2 = __esm(() => {
|
|
@@ -64905,7 +64734,6 @@ var init_prompt_failure_classifier = () => {};
|
|
|
64905
64734
|
|
|
64906
64735
|
// packages/omo-opencode/src/shared/model-suggestion-retry.ts
|
|
64907
64736
|
var init_model_suggestion_retry = __esm(() => {
|
|
64908
|
-
init_src2();
|
|
64909
64737
|
init_logger2();
|
|
64910
64738
|
init_prompt_async_gate2();
|
|
64911
64739
|
init_prompt_failure_classifier();
|
|
@@ -64913,7 +64741,6 @@ var init_model_suggestion_retry = __esm(() => {
|
|
|
64913
64741
|
|
|
64914
64742
|
// packages/omo-opencode/src/shared/opencode-provider-auth.ts
|
|
64915
64743
|
var init_opencode_provider_auth = __esm(() => {
|
|
64916
|
-
init_src();
|
|
64917
64744
|
init_data_path();
|
|
64918
64745
|
init_logger2();
|
|
64919
64746
|
});
|
|
@@ -65044,9 +64871,7 @@ var init_logger3 = __esm(() => {
|
|
|
65044
64871
|
});
|
|
65045
64872
|
|
|
65046
64873
|
// packages/claude-code-compat-core/src/shared/contains-path.ts
|
|
65047
|
-
var init_contains_path3 =
|
|
65048
|
-
init_src();
|
|
65049
|
-
});
|
|
64874
|
+
var init_contains_path3 = () => {};
|
|
65050
64875
|
|
|
65051
64876
|
// packages/claude-code-compat-core/src/features/claude-code-plugin-loader/scope-filter.ts
|
|
65052
64877
|
var init_scope_filter = __esm(() => {
|
|
@@ -65108,19 +64933,13 @@ var init_discovery = __esm(() => {
|
|
|
65108
64933
|
});
|
|
65109
64934
|
|
|
65110
64935
|
// packages/claude-code-compat-core/src/shared/frontmatter.ts
|
|
65111
|
-
var init_frontmatter3 =
|
|
65112
|
-
init_src();
|
|
65113
|
-
});
|
|
64936
|
+
var init_frontmatter3 = () => {};
|
|
65114
64937
|
|
|
65115
64938
|
// packages/claude-code-compat-core/src/shared/file-utils.ts
|
|
65116
|
-
var init_file_utils3 =
|
|
65117
|
-
init_src();
|
|
65118
|
-
});
|
|
64939
|
+
var init_file_utils3 = () => {};
|
|
65119
64940
|
|
|
65120
64941
|
// packages/claude-code-compat-core/src/shared/model-sanitizer.ts
|
|
65121
|
-
var init_model_sanitizer2 =
|
|
65122
|
-
init_src2();
|
|
65123
|
-
});
|
|
64942
|
+
var init_model_sanitizer2 = () => {};
|
|
65124
64943
|
// packages/claude-code-compat-core/src/features/claude-code-plugin-loader/command-loader.ts
|
|
65125
64944
|
var init_command_loader = __esm(() => {
|
|
65126
64945
|
init_frontmatter3();
|
|
@@ -65141,14 +64960,10 @@ var init_skill_loader = __esm(() => {
|
|
|
65141
64960
|
init_logger3();
|
|
65142
64961
|
});
|
|
65143
64962
|
// packages/claude-code-compat-core/src/shared/model-format-normalizer.ts
|
|
65144
|
-
var init_model_format_normalizer =
|
|
65145
|
-
init_src2();
|
|
65146
|
-
});
|
|
64963
|
+
var init_model_format_normalizer = () => {};
|
|
65147
64964
|
|
|
65148
64965
|
// packages/claude-code-compat-core/src/shared/model-normalization.ts
|
|
65149
|
-
var init_model_normalization2 =
|
|
65150
|
-
init_src2();
|
|
65151
|
-
});
|
|
64966
|
+
var init_model_normalization2 = () => {};
|
|
65152
64967
|
|
|
65153
64968
|
// packages/claude-code-compat-core/src/features/claude-code-agent-loader/claude-model-mapper.ts
|
|
65154
64969
|
var ANTHROPIC_PREFIX = "anthropic/", CLAUDE_CODE_ALIAS_MAP;
|
|
@@ -65178,7 +64993,6 @@ var init_configure_allowed_env_vars = __esm(() => {
|
|
|
65178
64993
|
|
|
65179
64994
|
// packages/claude-code-compat-core/src/features/claude-code-mcp-loader/env-expander.ts
|
|
65180
64995
|
var init_env_expander = __esm(() => {
|
|
65181
|
-
init_src();
|
|
65182
64996
|
init_logger3();
|
|
65183
64997
|
init_configure_allowed_env_vars();
|
|
65184
64998
|
});
|
|
@@ -65194,9 +65008,7 @@ var init_transformer = __esm(() => {
|
|
|
65194
65008
|
});
|
|
65195
65009
|
|
|
65196
65010
|
// packages/claude-code-compat-core/src/shared/bun-file-shim.ts
|
|
65197
|
-
var init_bun_file_shim2 =
|
|
65198
|
-
init_runtime();
|
|
65199
|
-
});
|
|
65011
|
+
var init_bun_file_shim2 = () => {};
|
|
65200
65012
|
|
|
65201
65013
|
// packages/claude-code-compat-core/src/features/claude-code-plugin-loader/mcp-server-loader.ts
|
|
65202
65014
|
var init_mcp_server_loader = __esm(() => {
|
|
@@ -65293,9 +65105,7 @@ var init_legacy_workspace_migration = __esm(() => {
|
|
|
65293
65105
|
init_logger2();
|
|
65294
65106
|
});
|
|
65295
65107
|
// packages/omo-opencode/src/shared/model-string-parser.ts
|
|
65296
|
-
var init_model_string_parser2 =
|
|
65297
|
-
init_src2();
|
|
65298
|
-
});
|
|
65108
|
+
var init_model_string_parser2 = () => {};
|
|
65299
65109
|
|
|
65300
65110
|
// packages/omo-opencode/src/shared/excluded-dirs.ts
|
|
65301
65111
|
var EXCLUDED_DIR_NAMES, EXCLUDED_DIRS;
|
|
@@ -65320,15 +65130,13 @@ var init_excluded_dirs = __esm(() => {
|
|
|
65320
65130
|
});
|
|
65321
65131
|
|
|
65322
65132
|
// packages/omo-opencode/src/shared/replace-tool-args.ts
|
|
65323
|
-
var init_replace_tool_args =
|
|
65324
|
-
init_src();
|
|
65325
|
-
});
|
|
65133
|
+
var init_replace_tool_args = () => {};
|
|
65326
65134
|
|
|
65327
65135
|
// packages/omo-opencode/src/shared/index.ts
|
|
65328
65136
|
var init_shared = __esm(() => {
|
|
65329
65137
|
init_model_normalization();
|
|
65330
65138
|
init_model_resolver2();
|
|
65331
|
-
|
|
65139
|
+
init_model_resolution_pipeline();
|
|
65332
65140
|
init_session_category_registry();
|
|
65333
65141
|
init_model_string_parser2();
|
|
65334
65142
|
init_excluded_dirs();
|
|
@@ -65369,7 +65177,7 @@ var init_shared = __esm(() => {
|
|
|
65369
65177
|
init_model_capabilities_cache();
|
|
65370
65178
|
init_model_settings_compatibility2();
|
|
65371
65179
|
init_fallback_model_availability();
|
|
65372
|
-
|
|
65180
|
+
init_connected_providers_cache();
|
|
65373
65181
|
init_context_limit_resolver2();
|
|
65374
65182
|
init_session_utils();
|
|
65375
65183
|
init_event_session_id();
|
|
@@ -66826,20 +66634,20 @@ var init_config_manager = __esm(() => {
|
|
|
66826
66634
|
|
|
66827
66635
|
// packages/telemetry-core/src/activity-state.ts
|
|
66828
66636
|
import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync13 } from "fs";
|
|
66829
|
-
import { basename as basename10, join as
|
|
66637
|
+
import { basename as basename10, join as join51 } from "path";
|
|
66830
66638
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
66831
66639
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
66832
66640
|
env: options.env,
|
|
66833
66641
|
osProvider: options.osProvider
|
|
66834
66642
|
});
|
|
66835
|
-
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined :
|
|
66643
|
+
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join51(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
66836
66644
|
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
|
|
66837
66645
|
return dataDir;
|
|
66838
66646
|
}
|
|
66839
|
-
return
|
|
66647
|
+
return join51(dataDir, product.cacheDirName);
|
|
66840
66648
|
}
|
|
66841
66649
|
function getTelemetryActivityStateFilePath(stateDir) {
|
|
66842
|
-
return
|
|
66650
|
+
return join51(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
|
|
66843
66651
|
}
|
|
66844
66652
|
function getDailyActiveCaptureState(input) {
|
|
66845
66653
|
const state = readPostHogActivityState(input.stateDir, input.diagnostics);
|
|
@@ -66910,9 +66718,9 @@ var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY =
|
|
|
66910
66718
|
|
|
66911
66719
|
// packages/telemetry-core/src/diagnostics.ts
|
|
66912
66720
|
import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync14 } from "fs";
|
|
66913
|
-
import { join as
|
|
66721
|
+
import { join as join52 } from "path";
|
|
66914
66722
|
function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
|
|
66915
|
-
return
|
|
66723
|
+
return join52(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
|
|
66916
66724
|
}
|
|
66917
66725
|
function writeTelemetryDiagnostic(input, options) {
|
|
66918
66726
|
const now = options.now ?? new Date;
|
|
@@ -72616,11 +72424,7 @@ var init_posthog_client = __esm(() => {
|
|
|
72616
72424
|
});
|
|
72617
72425
|
|
|
72618
72426
|
// packages/telemetry-core/src/record-daily-active.ts
|
|
72619
|
-
var init_record_daily_active =
|
|
72620
|
-
init_activity_state();
|
|
72621
|
-
init_posthog_client();
|
|
72622
|
-
init_machine_id();
|
|
72623
|
-
});
|
|
72427
|
+
var init_record_daily_active = () => {};
|
|
72624
72428
|
|
|
72625
72429
|
// packages/telemetry-core/src/index.ts
|
|
72626
72430
|
var init_src4 = __esm(() => {
|
|
@@ -72637,7 +72441,7 @@ var package_default2;
|
|
|
72637
72441
|
var init_package2 = __esm(() => {
|
|
72638
72442
|
package_default2 = {
|
|
72639
72443
|
name: "@oh-my-opencode/omo-codex",
|
|
72640
|
-
version: "4.
|
|
72444
|
+
version: "4.16.1",
|
|
72641
72445
|
type: "module",
|
|
72642
72446
|
private: true,
|
|
72643
72447
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -72984,7 +72788,7 @@ function stripJsonComments(json2) {
|
|
|
72984
72788
|
|
|
72985
72789
|
// packages/omo-opencode/src/hooks/auto-update-checker/checker/local-dev-path.ts
|
|
72986
72790
|
import * as fs6 from "fs";
|
|
72987
|
-
import { fileURLToPath as
|
|
72791
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
72988
72792
|
function isLocalDevMode(directory) {
|
|
72989
72793
|
return getLocalDevPath(directory) !== null;
|
|
72990
72794
|
}
|
|
@@ -73002,7 +72806,7 @@ function getLocalDevPath(directory) {
|
|
|
73002
72806
|
if (!ACCEPTED_PACKAGE_NAMES2.some((name) => entry.includes(name)))
|
|
73003
72807
|
continue;
|
|
73004
72808
|
try {
|
|
73005
|
-
return
|
|
72809
|
+
return fileURLToPath3(entry);
|
|
73006
72810
|
} catch (error51) {
|
|
73007
72811
|
if (!(error51 instanceof Error)) {
|
|
73008
72812
|
throw error51;
|
|
@@ -73127,7 +72931,7 @@ var init_plugin_entry = __esm(() => {
|
|
|
73127
72931
|
// packages/omo-opencode/src/hooks/auto-update-checker/checker/cached-version.ts
|
|
73128
72932
|
import * as fs10 from "fs";
|
|
73129
72933
|
import * as path11 from "path";
|
|
73130
|
-
import { fileURLToPath as
|
|
72934
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
73131
72935
|
function readPackageVersion(packageJsonPath) {
|
|
73132
72936
|
const content = fs10.readFileSync(packageJsonPath, "utf-8");
|
|
73133
72937
|
const pkg = JSON.parse(content);
|
|
@@ -73137,7 +72941,7 @@ function getCachedVersion(options = {}) {
|
|
|
73137
72941
|
const packageJsonCandidates = options.packageJsonCandidates ?? INSTALLED_PACKAGE_JSON_CANDIDATES;
|
|
73138
72942
|
const findPackageJson = options.findPackageJson ?? findPackageJsonUp;
|
|
73139
72943
|
try {
|
|
73140
|
-
const currentDir = options.currentDir === undefined ? path11.dirname(
|
|
72944
|
+
const currentDir = options.currentDir === undefined ? path11.dirname(fileURLToPath4(import.meta.url)) : options.currentDir;
|
|
73141
72945
|
if (currentDir) {
|
|
73142
72946
|
const pkgPath = findPackageJson(currentDir);
|
|
73143
72947
|
if (pkgPath) {
|
|
@@ -73606,20 +73410,20 @@ var init_update_toasts = __esm(() => {
|
|
|
73606
73410
|
});
|
|
73607
73411
|
|
|
73608
73412
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
73609
|
-
import { existsSync as
|
|
73610
|
-
import { dirname as
|
|
73611
|
-
import { fileURLToPath as
|
|
73413
|
+
import { existsSync as existsSync49 } from "fs";
|
|
73414
|
+
import { dirname as dirname27, join as join70 } from "path";
|
|
73415
|
+
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
73612
73416
|
function defaultGetModuleHostingWorkspace() {
|
|
73613
73417
|
try {
|
|
73614
|
-
const currentDir =
|
|
73418
|
+
const currentDir = dirname27(fileURLToPath5(import.meta.url));
|
|
73615
73419
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
73616
73420
|
if (!pkgJsonPath)
|
|
73617
73421
|
return null;
|
|
73618
|
-
const pkgDir =
|
|
73619
|
-
const nodeModulesDir =
|
|
73422
|
+
const pkgDir = dirname27(pkgJsonPath);
|
|
73423
|
+
const nodeModulesDir = dirname27(pkgDir);
|
|
73620
73424
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
73621
73425
|
return null;
|
|
73622
|
-
return
|
|
73426
|
+
return dirname27(nodeModulesDir);
|
|
73623
73427
|
} catch (error51) {
|
|
73624
73428
|
if (error51 instanceof Error) {
|
|
73625
73429
|
return null;
|
|
@@ -73760,8 +73564,8 @@ var init_background_update_check = __esm(() => {
|
|
|
73760
73564
|
init_package_json_locator();
|
|
73761
73565
|
init_update_toasts();
|
|
73762
73566
|
defaultDeps4 = {
|
|
73763
|
-
existsSync:
|
|
73764
|
-
join:
|
|
73567
|
+
existsSync: existsSync49,
|
|
73568
|
+
join: join70,
|
|
73765
73569
|
runBunInstallWithDetails,
|
|
73766
73570
|
log: log2,
|
|
73767
73571
|
getOpenCodeCacheDir,
|
|
@@ -73851,7 +73655,7 @@ async function updateAndShowConnectedProvidersCacheStatus(ctx) {
|
|
|
73851
73655
|
}
|
|
73852
73656
|
var CACHE_UPDATE_TIMEOUT_MS = 1e4;
|
|
73853
73657
|
var init_connected_providers_status = __esm(() => {
|
|
73854
|
-
|
|
73658
|
+
init_connected_providers_cache();
|
|
73855
73659
|
init_model_availability();
|
|
73856
73660
|
init_logger2();
|
|
73857
73661
|
});
|
|
@@ -73924,7 +73728,7 @@ async function showSpinnerToast(ctx, version3, message) {
|
|
|
73924
73728
|
duration: frameInterval + 50
|
|
73925
73729
|
}
|
|
73926
73730
|
}).catch(ignoreToastError);
|
|
73927
|
-
await new Promise((
|
|
73731
|
+
await new Promise((resolve20) => setTimeout(resolve20, frameInterval));
|
|
73928
73732
|
}
|
|
73929
73733
|
}
|
|
73930
73734
|
var SISYPHUS_SPINNER;
|
|
@@ -74110,6 +73914,9 @@ function formatConfigSummary(config) {
|
|
|
74110
73914
|
if (config.hasCodex) {
|
|
74111
73915
|
lines.push(` ${SYMBOLS.info} Codex autonomous mode: ${config.codexAutonomous ? "enabled" : "disabled"}`);
|
|
74112
73916
|
}
|
|
73917
|
+
if (config.hasSenpi) {
|
|
73918
|
+
lines.push(` ${SYMBOLS.info} Senpi adapter: enabled`);
|
|
73919
|
+
}
|
|
74113
73920
|
if (!config.hasOpenCode)
|
|
74114
73921
|
return lines.join(`
|
|
74115
73922
|
`);
|
|
@@ -74265,6 +74072,7 @@ function argsToConfig(args) {
|
|
|
74265
74072
|
const platform = resolvePlatform(args);
|
|
74266
74073
|
const hasOpenCode = platform === "opencode" || platform === "both";
|
|
74267
74074
|
const hasCodex = platform === "codex" || platform === "both";
|
|
74075
|
+
const hasSenpi = platform === "senpi";
|
|
74268
74076
|
return {
|
|
74269
74077
|
platform,
|
|
74270
74078
|
hasOpenCode,
|
|
@@ -74274,6 +74082,7 @@ function argsToConfig(args) {
|
|
|
74274
74082
|
hasGemini: hasOpenCode && args.gemini === "yes",
|
|
74275
74083
|
hasCopilot: hasOpenCode && args.copilot === "yes",
|
|
74276
74084
|
hasCodex,
|
|
74085
|
+
hasSenpi,
|
|
74277
74086
|
hasOpencodeZen: hasOpenCode && args.opencodeZen === "yes",
|
|
74278
74087
|
hasZaiCodingPlan: hasOpenCode && args.zaiCodingPlan === "yes",
|
|
74279
74088
|
hasKimiForCoding: hasOpenCode && args.kimiForCoding === "yes",
|
|
@@ -74365,7 +74174,7 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
|
|
|
74365
74174
|
}
|
|
74366
74175
|
|
|
74367
74176
|
// packages/omo-codex/src/install/install-codex.ts
|
|
74368
|
-
import { join as
|
|
74177
|
+
import { join as join53, resolve as resolve15 } from "path";
|
|
74369
74178
|
import { existsSync as existsSync30 } from "fs";
|
|
74370
74179
|
import { homedir as homedir6 } from "os";
|
|
74371
74180
|
|
|
@@ -76546,9 +76355,14 @@ function readBooleanSetting(sectionText, key) {
|
|
|
76546
76355
|
// packages/omo-codex/src/install/codex-config-toml.ts
|
|
76547
76356
|
async function updateCodexConfig(input) {
|
|
76548
76357
|
await mkdir5(dirname15(input.configPath), { recursive: true });
|
|
76549
|
-
let config
|
|
76550
|
-
|
|
76358
|
+
let config;
|
|
76359
|
+
try {
|
|
76551
76360
|
config = await readFile11(input.configPath, "utf8");
|
|
76361
|
+
} catch (error) {
|
|
76362
|
+
if (!isMissingFileError(error))
|
|
76363
|
+
throw error;
|
|
76364
|
+
config = "";
|
|
76365
|
+
}
|
|
76552
76366
|
const pluginSet = new Set(input.pluginNames);
|
|
76553
76367
|
for (const legacyMarketplaceName of legacyMarketplaceNames(input.marketplaceName)) {
|
|
76554
76368
|
config = removeMarketplaceBlock(config, legacyMarketplaceName);
|
|
@@ -76582,15 +76396,8 @@ async function updateCodexConfig(input) {
|
|
|
76582
76396
|
await writeFileAtomic(input.configPath, `${config.trimEnd()}
|
|
76583
76397
|
`);
|
|
76584
76398
|
}
|
|
76585
|
-
|
|
76586
|
-
|
|
76587
|
-
await readFile11(path7, "utf8");
|
|
76588
|
-
return true;
|
|
76589
|
-
} catch (error) {
|
|
76590
|
-
if (error instanceof Error)
|
|
76591
|
-
return false;
|
|
76592
|
-
return false;
|
|
76593
|
-
}
|
|
76399
|
+
function isMissingFileError(error) {
|
|
76400
|
+
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
76594
76401
|
}
|
|
76595
76402
|
|
|
76596
76403
|
// packages/omo-codex/src/install/codex-hook-trust.ts
|
|
@@ -76611,7 +76418,7 @@ var EVENT_LABELS = new Map([
|
|
|
76611
76418
|
]);
|
|
76612
76419
|
async function trustedHookStatesForPlugin(input) {
|
|
76613
76420
|
const manifestPath = join39(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
76614
|
-
if (!await
|
|
76421
|
+
if (!await exists(manifestPath))
|
|
76615
76422
|
return [];
|
|
76616
76423
|
const manifest = JSON.parse(await readFile12(manifestPath, "utf8"));
|
|
76617
76424
|
if (!isPlainRecord3(manifest))
|
|
@@ -76619,7 +76426,7 @@ async function trustedHookStatesForPlugin(input) {
|
|
|
76619
76426
|
const states = [];
|
|
76620
76427
|
for (const hookPath of hookManifestPaths2(manifest.hooks)) {
|
|
76621
76428
|
const hooksPath = join39(input.pluginRoot, hookPath);
|
|
76622
|
-
if (!await
|
|
76429
|
+
if (!await exists(hooksPath))
|
|
76623
76430
|
continue;
|
|
76624
76431
|
const parsed = JSON.parse(await readFile12(hooksPath, "utf8"));
|
|
76625
76432
|
if (!isPlainRecord3(parsed) || !isPlainRecord3(parsed.hooks))
|
|
@@ -76702,7 +76509,7 @@ function canonicalJson(value) {
|
|
|
76702
76509
|
function stripDotSlash2(value) {
|
|
76703
76510
|
return value.startsWith("./") ? value.slice(2) : value;
|
|
76704
76511
|
}
|
|
76705
|
-
async function
|
|
76512
|
+
async function exists(path7) {
|
|
76706
76513
|
try {
|
|
76707
76514
|
await readFile12(path7, "utf8");
|
|
76708
76515
|
return true;
|
|
@@ -76762,11 +76569,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
|
|
|
76762
76569
|
];
|
|
76763
76570
|
async function purgeRetiredManagedAgentFiles(input) {
|
|
76764
76571
|
const agentsDir = join40(input.codexHome, "agents");
|
|
76765
|
-
if (!await
|
|
76572
|
+
if (!await exists2(agentsDir))
|
|
76766
76573
|
return;
|
|
76767
76574
|
for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
|
|
76768
76575
|
const agentPath = join40(agentsDir, retiredAgent.fileName);
|
|
76769
|
-
if (!await
|
|
76576
|
+
if (!await exists2(agentPath))
|
|
76770
76577
|
continue;
|
|
76771
76578
|
const agentStat = await lstat7(agentPath);
|
|
76772
76579
|
if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
|
|
@@ -76789,7 +76596,7 @@ async function readTextIfExists(path7) {
|
|
|
76789
76596
|
throw error;
|
|
76790
76597
|
}
|
|
76791
76598
|
}
|
|
76792
|
-
async function
|
|
76599
|
+
async function exists2(path7) {
|
|
76793
76600
|
try {
|
|
76794
76601
|
await lstat7(path7);
|
|
76795
76602
|
return true;
|
|
@@ -76809,7 +76616,7 @@ function nodeErrorCode(error) {
|
|
|
76809
76616
|
var MANIFEST_FILE = ".installed-agents.json";
|
|
76810
76617
|
async function capturePreservedAgentReasoning(input) {
|
|
76811
76618
|
const agentsDir = join41(input.codexHome, "agents");
|
|
76812
|
-
if (!await
|
|
76619
|
+
if (!await exists3(agentsDir))
|
|
76813
76620
|
return new Map;
|
|
76814
76621
|
const preserved = new Map;
|
|
76815
76622
|
const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
|
|
@@ -76827,7 +76634,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
76827
76634
|
}
|
|
76828
76635
|
async function capturePreservedAgentServiceTier(input) {
|
|
76829
76636
|
const agentsDir = join41(input.codexHome, "agents");
|
|
76830
|
-
if (!await
|
|
76637
|
+
if (!await exists3(agentsDir))
|
|
76831
76638
|
return new Map;
|
|
76832
76639
|
const preserved = new Map;
|
|
76833
76640
|
const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
|
|
@@ -76885,7 +76692,7 @@ async function restorePreservedServiceTier(input) {
|
|
|
76885
76692
|
}
|
|
76886
76693
|
async function discoverBundledAgents(pluginRoot) {
|
|
76887
76694
|
const componentsRoot = join41(pluginRoot, "components");
|
|
76888
|
-
if (!await
|
|
76695
|
+
if (!await exists3(componentsRoot))
|
|
76889
76696
|
return [];
|
|
76890
76697
|
const componentEntries = await readdir6(componentsRoot, { withFileTypes: true });
|
|
76891
76698
|
const agents = [];
|
|
@@ -76893,7 +76700,7 @@ async function discoverBundledAgents(pluginRoot) {
|
|
|
76893
76700
|
if (!entry.isDirectory())
|
|
76894
76701
|
continue;
|
|
76895
76702
|
const agentsRoot = join41(componentsRoot, entry.name, "agents");
|
|
76896
|
-
if (!await
|
|
76703
|
+
if (!await exists3(agentsRoot))
|
|
76897
76704
|
continue;
|
|
76898
76705
|
const agentEntries = await readdir6(agentsRoot, { withFileTypes: true });
|
|
76899
76706
|
for (const file2 of agentEntries) {
|
|
@@ -76910,7 +76717,7 @@ async function replaceWithCopy(linkPath, target) {
|
|
|
76910
76717
|
await copyFile(target, linkPath);
|
|
76911
76718
|
}
|
|
76912
76719
|
async function prepareReplacement(linkPath) {
|
|
76913
|
-
if (!await
|
|
76720
|
+
if (!await exists3(linkPath))
|
|
76914
76721
|
return;
|
|
76915
76722
|
const entryStat = await lstat8(linkPath);
|
|
76916
76723
|
if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
|
|
@@ -77029,7 +76836,7 @@ function parseJsonString(value) {
|
|
|
77029
76836
|
return null;
|
|
77030
76837
|
}
|
|
77031
76838
|
}
|
|
77032
|
-
async function
|
|
76839
|
+
async function exists3(path7) {
|
|
77033
76840
|
try {
|
|
77034
76841
|
await lstat8(path7);
|
|
77035
76842
|
return true;
|
|
@@ -77325,7 +77132,11 @@ function stampHookGroups(hooks, version) {
|
|
|
77325
77132
|
function stampHookStatusMessage(hook, version) {
|
|
77326
77133
|
if (!isPlainRecord3(hook) || typeof hook.statusMessage !== "string")
|
|
77327
77134
|
return;
|
|
77328
|
-
hook.statusMessage = hook.statusMessage.replace(/^LazyCodex\([^)]+\)
|
|
77135
|
+
hook.statusMessage = hook.statusMessage.replace(/^(?:LazyCodex\([^)]+\):|\(OmO(?:\s+[^)]+)?\))\s*/, `(OmO ${normalizeHookStatusVersion(version)}) `);
|
|
77136
|
+
}
|
|
77137
|
+
function normalizeHookStatusVersion(version) {
|
|
77138
|
+
const normalized = version.trim();
|
|
77139
|
+
return normalized.length === 0 ? "local" : normalized;
|
|
77329
77140
|
}
|
|
77330
77141
|
|
|
77331
77142
|
// packages/omo-codex/src/install/codex-process.ts
|
|
@@ -77471,7 +77282,7 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
77471
77282
|
configPathsFromCwd.push(configPath);
|
|
77472
77283
|
}
|
|
77473
77284
|
}
|
|
77474
|
-
if (await
|
|
77285
|
+
if (await exists4(join45(current, ".git"))) {
|
|
77475
77286
|
return configPathsFromCwd.length === 0 ? null : {
|
|
77476
77287
|
projectRoot: current,
|
|
77477
77288
|
configPaths: [...configPathsFromCwd].reverse(),
|
|
@@ -77552,7 +77363,7 @@ async function maybeLstat(path7) {
|
|
|
77552
77363
|
throw error;
|
|
77553
77364
|
}
|
|
77554
77365
|
}
|
|
77555
|
-
async function
|
|
77366
|
+
async function exists4(path7) {
|
|
77556
77367
|
return await maybeLstat(path7) !== null;
|
|
77557
77368
|
}
|
|
77558
77369
|
function nodeErrorCode3(error) {
|
|
@@ -77670,11 +77481,32 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
77670
77481
|
return resolve14(homeDir, ".local", "bin");
|
|
77671
77482
|
}
|
|
77672
77483
|
|
|
77673
|
-
// packages/omo-codex/src/install/
|
|
77484
|
+
// packages/omo-codex/src/install/codex-git-bash-hooks.ts
|
|
77485
|
+
import { readFile as readFile19, writeFile as writeFile10 } from "fs/promises";
|
|
77674
77486
|
import { join as join48 } from "path";
|
|
77487
|
+
var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
|
|
77488
|
+
"./hooks/pre-tool-use-recommending-git-bash-mcp.json",
|
|
77489
|
+
"./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
|
|
77490
|
+
]);
|
|
77491
|
+
async function removeGitBashHooksOffWindows(input) {
|
|
77492
|
+
if (input.platform === "win32")
|
|
77493
|
+
return;
|
|
77494
|
+
const manifestPath = join48(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
77495
|
+
const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
|
|
77496
|
+
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
|
|
77497
|
+
return;
|
|
77498
|
+
const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
|
|
77499
|
+
if (hooks.length === parsed.hooks.length)
|
|
77500
|
+
return;
|
|
77501
|
+
await writeFile10(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
|
|
77502
|
+
`);
|
|
77503
|
+
}
|
|
77504
|
+
|
|
77505
|
+
// packages/omo-codex/src/install/omo-sot-migration.ts
|
|
77506
|
+
import { join as join49 } from "path";
|
|
77675
77507
|
async function seedAndMigrateOmoSot(input) {
|
|
77676
77508
|
const commandEnv = { ...input.env };
|
|
77677
|
-
const scriptPath =
|
|
77509
|
+
const scriptPath = join49(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
|
|
77678
77510
|
try {
|
|
77679
77511
|
await input.runCommand(process.execPath, [scriptPath, "--seed"], {
|
|
77680
77512
|
cwd: input.repoRoot,
|
|
@@ -77689,7 +77521,7 @@ async function seedAndMigrateOmoSot(input) {
|
|
|
77689
77521
|
|
|
77690
77522
|
// packages/omo-codex/src/install/install-ast-grep-sg.ts
|
|
77691
77523
|
init_src();
|
|
77692
|
-
import { join as
|
|
77524
|
+
import { join as join50 } from "path";
|
|
77693
77525
|
function describeResult(result) {
|
|
77694
77526
|
if (result.kind === "succeeded")
|
|
77695
77527
|
return null;
|
|
@@ -77703,7 +77535,7 @@ async function installAstGrepForCodex(options) {
|
|
|
77703
77535
|
return;
|
|
77704
77536
|
const platform = options.platform ?? process.platform;
|
|
77705
77537
|
const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
|
|
77706
|
-
const skillDir =
|
|
77538
|
+
const skillDir = join50(plugin.path, "skills", "ast-grep");
|
|
77707
77539
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
77708
77540
|
try {
|
|
77709
77541
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -77737,7 +77569,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
77737
77569
|
const env3 = options.env ?? process.env;
|
|
77738
77570
|
const platform = options.platform ?? process.platform;
|
|
77739
77571
|
const repoRoot = resolve15(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env3 }));
|
|
77740
|
-
const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ??
|
|
77572
|
+
const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join53(homedir6(), ".codex"));
|
|
77741
77573
|
const projectDirectory = resolve15(options.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd());
|
|
77742
77574
|
const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env3 });
|
|
77743
77575
|
const runCommand = options.runCommand ?? defaultRunCommand;
|
|
@@ -77753,9 +77585,9 @@ async function runCodexInstaller(options = {}) {
|
|
|
77753
77585
|
if (!gitBashResolution.found) {
|
|
77754
77586
|
throw new Error(gitBashResolution.installHint);
|
|
77755
77587
|
}
|
|
77756
|
-
const codexPackageRoot =
|
|
77588
|
+
const codexPackageRoot = join53(repoRoot, "packages", "omo-codex");
|
|
77757
77589
|
const marketplace = await readMarketplace(repoRoot, {
|
|
77758
|
-
marketplacePath:
|
|
77590
|
+
marketplacePath: join53(codexPackageRoot, "marketplace.json")
|
|
77759
77591
|
});
|
|
77760
77592
|
const distributionManifest = await readDistributionManifest(repoRoot);
|
|
77761
77593
|
const installed = [];
|
|
@@ -77787,6 +77619,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
77787
77619
|
if (marketplace.name === "sisyphuslabs" && plugin.name === "omo") {
|
|
77788
77620
|
await stampLazyCodexPluginVersion({ pluginRoot: plugin.path, version: version2 });
|
|
77789
77621
|
await writeLazyCodexInstallSnapshot({ pluginRoot: plugin.path, distributionManifest });
|
|
77622
|
+
await removeGitBashHooksOffWindows({ platform, pluginRoot: plugin.path });
|
|
77790
77623
|
}
|
|
77791
77624
|
const links = await linkCachedPluginBins({ binDir, pluginRoot: plugin.path, platform });
|
|
77792
77625
|
for (const link of links) {
|
|
@@ -77797,7 +77630,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
77797
77630
|
if (runtimeLink !== null)
|
|
77798
77631
|
log4(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
|
|
77799
77632
|
else
|
|
77800
|
-
log4(`Warning: skipped the omo runtime wrapper because ${
|
|
77633
|
+
log4(`Warning: skipped the omo runtime wrapper because ${join53(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
|
|
77801
77634
|
}
|
|
77802
77635
|
pluginSources.push({ name: entry.name, sourcePath });
|
|
77803
77636
|
installed.push(plugin);
|
|
@@ -77851,13 +77684,13 @@ async function runCodexInstaller(options = {}) {
|
|
|
77851
77684
|
});
|
|
77852
77685
|
}
|
|
77853
77686
|
await reapLspDaemons(codexHome).catch(() => []);
|
|
77854
|
-
const marketplaceRoot =
|
|
77687
|
+
const marketplaceRoot = join53(codexHome, "plugins", "cache", marketplace.name);
|
|
77855
77688
|
await writeCachedMarketplaceManifest({
|
|
77856
77689
|
marketplaceName: marketplace.name,
|
|
77857
77690
|
marketplaceRoot,
|
|
77858
77691
|
plugins: installed
|
|
77859
77692
|
});
|
|
77860
|
-
const configPath =
|
|
77693
|
+
const configPath = join53(codexHome, "config.toml");
|
|
77861
77694
|
await updateCodexConfig({
|
|
77862
77695
|
configPath,
|
|
77863
77696
|
repoRoot: codexPackageRoot,
|
|
@@ -77917,7 +77750,7 @@ function findRepoRootFromImporter(importerDir) {
|
|
|
77917
77750
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
77918
77751
|
if (isRepoRootWithCodexPlugin(current))
|
|
77919
77752
|
return current;
|
|
77920
|
-
for (const wrapperPackageRoot of [
|
|
77753
|
+
for (const wrapperPackageRoot of [join53(current, "node_modules", "oh-my-openagent"), join53(current, "oh-my-openagent")]) {
|
|
77921
77754
|
if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
|
|
77922
77755
|
return wrapperPackageRoot;
|
|
77923
77756
|
}
|
|
@@ -77935,7 +77768,7 @@ function findRepoRoot(input) {
|
|
|
77935
77768
|
return findRepoRootFromImporter(input.importerDir);
|
|
77936
77769
|
}
|
|
77937
77770
|
function isRepoRootWithCodexPlugin(repoRoot) {
|
|
77938
|
-
return existsSync30(
|
|
77771
|
+
return existsSync30(join53(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
|
|
77939
77772
|
}
|
|
77940
77773
|
function codexMarketplaceSource(marketplaceRoot) {
|
|
77941
77774
|
return { sourceType: "local", source: marketplaceRoot };
|
|
@@ -77956,19 +77789,19 @@ async function detectCodexInstallation(input = {}) {
|
|
|
77956
77789
|
const platform = input.platform ?? process.platform;
|
|
77957
77790
|
const env3 = input.env ?? process.env;
|
|
77958
77791
|
const homeDir = input.homeDir ?? homedir7();
|
|
77959
|
-
const
|
|
77792
|
+
const exists5 = input.exists ?? existsSync31;
|
|
77960
77793
|
const which2 = input.which ?? bunWhich;
|
|
77961
77794
|
const checkedPaths = [CODEX_PATH_CHECK_LABEL];
|
|
77962
77795
|
const cliPath = nonEmptyValue2(which2("codex"));
|
|
77963
77796
|
if (cliPath !== undefined)
|
|
77964
77797
|
return { found: true, source: "cli", path: cliPath };
|
|
77965
77798
|
if (platform === "darwin") {
|
|
77966
|
-
return detectMacCodexInstallation({ homeDir, exists:
|
|
77799
|
+
return detectMacCodexInstallation({ homeDir, exists: exists5, checkedPaths });
|
|
77967
77800
|
}
|
|
77968
77801
|
if (platform === "win32") {
|
|
77969
77802
|
return detectWindowsCodexInstallation({
|
|
77970
77803
|
env: env3,
|
|
77971
|
-
exists:
|
|
77804
|
+
exists: exists5,
|
|
77972
77805
|
checkedPaths,
|
|
77973
77806
|
runCommand: input.runCommand ?? defaultRunCommand2
|
|
77974
77807
|
});
|
|
@@ -78070,12 +77903,12 @@ function defaultRunCommand2(command, args) {
|
|
|
78070
77903
|
});
|
|
78071
77904
|
}
|
|
78072
77905
|
// packages/omo-codex/src/install/codex-cleanup.ts
|
|
78073
|
-
import { lstat as lstat11, readFile as
|
|
77906
|
+
import { lstat as lstat11, readFile as readFile21, readdir as readdir9, rm as rm11, rmdir } from "fs/promises";
|
|
78074
77907
|
import { homedir as homedir8 } from "os";
|
|
78075
|
-
import { isAbsolute as isAbsolute10, join as
|
|
77908
|
+
import { isAbsolute as isAbsolute10, join as join55, relative as relative7, resolve as resolve17 } from "path";
|
|
78076
77909
|
|
|
78077
77910
|
// packages/omo-codex/src/install/codex-cleanup-config.ts
|
|
78078
|
-
import { lstat as lstat10, mkdir as mkdir8, readFile as
|
|
77911
|
+
import { lstat as lstat10, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile11 } from "fs/promises";
|
|
78079
77912
|
import { dirname as dirname18 } from "path";
|
|
78080
77913
|
var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
|
|
78081
77914
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
|
|
@@ -78105,14 +77938,14 @@ function cleanupCodexLightConfigText(config) {
|
|
|
78105
77938
|
async function cleanupCodexConfig(configPath, now) {
|
|
78106
77939
|
if (!await configExists(configPath))
|
|
78107
77940
|
return { changed: false };
|
|
78108
|
-
const original = await
|
|
77941
|
+
const original = await readFile20(configPath, "utf8");
|
|
78109
77942
|
const next = cleanupCodexLightConfigText(original);
|
|
78110
77943
|
if (next === original)
|
|
78111
77944
|
return { changed: false };
|
|
78112
77945
|
const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
|
|
78113
77946
|
await mkdir8(dirname18(configPath), { recursive: true });
|
|
78114
|
-
await
|
|
78115
|
-
await
|
|
77947
|
+
await writeFile11(backupPath, original);
|
|
77948
|
+
await writeFile11(configPath, `${next.trimEnd()}
|
|
78116
77949
|
`);
|
|
78117
77950
|
return { changed: true, backupPath };
|
|
78118
77951
|
}
|
|
@@ -78189,7 +78022,7 @@ function nodeErrorCode4(error) {
|
|
|
78189
78022
|
}
|
|
78190
78023
|
|
|
78191
78024
|
// packages/omo-codex/src/install/codex-cleanup-safety.ts
|
|
78192
|
-
import { dirname as dirname19, isAbsolute as isAbsolute9, join as
|
|
78025
|
+
import { dirname as dirname19, isAbsolute as isAbsolute9, join as join54, relative as relative6, resolve as resolve16 } from "path";
|
|
78193
78026
|
function validateManagedCleanupTarget(input) {
|
|
78194
78027
|
if (!isAbsolute9(input.path))
|
|
78195
78028
|
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
@@ -78202,11 +78035,11 @@ function validateManagedCleanupTarget(input) {
|
|
|
78202
78035
|
if (target === codexHome)
|
|
78203
78036
|
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
78204
78037
|
const exactManagedRoots = new Set([
|
|
78205
|
-
resolve16(
|
|
78206
|
-
resolve16(
|
|
78207
|
-
resolve16(
|
|
78208
|
-
resolve16(
|
|
78209
|
-
resolve16(
|
|
78038
|
+
resolve16(join54(codexHome, "plugins", "cache", "sisyphuslabs")),
|
|
78039
|
+
resolve16(join54(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
|
|
78040
|
+
resolve16(join54(codexHome, "runtime", "ast-grep")),
|
|
78041
|
+
resolve16(join54(codexHome, "runtime", "node")),
|
|
78042
|
+
resolve16(join54(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
|
|
78210
78043
|
]);
|
|
78211
78044
|
if (exactManagedRoots.has(target))
|
|
78212
78045
|
return null;
|
|
@@ -78236,8 +78069,8 @@ function skipped(path7, reason) {
|
|
|
78236
78069
|
var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
|
|
78237
78070
|
async function cleanupCodexLight(input = {}) {
|
|
78238
78071
|
const env3 = input.env ?? process.env;
|
|
78239
|
-
const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ??
|
|
78240
|
-
const configPath =
|
|
78072
|
+
const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join55(homedir8(), ".codex"));
|
|
78073
|
+
const configPath = join55(codexHome, "config.toml");
|
|
78241
78074
|
const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
|
|
78242
78075
|
const configCleanup = await cleanupCodexConfig(configPath, input.now);
|
|
78243
78076
|
const agentCleanup = await removeManifestListedAgentLinks(codexHome, agentPaths);
|
|
@@ -78276,17 +78109,17 @@ async function cleanupCodexLight(input = {}) {
|
|
|
78276
78109
|
}
|
|
78277
78110
|
function managedGlobalStatePaths(codexHome) {
|
|
78278
78111
|
return [
|
|
78279
|
-
|
|
78280
|
-
|
|
78281
|
-
|
|
78282
|
-
|
|
78283
|
-
|
|
78112
|
+
join55(codexHome, "plugins", "cache", "sisyphuslabs"),
|
|
78113
|
+
join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
|
|
78114
|
+
join55(codexHome, "runtime", "ast-grep"),
|
|
78115
|
+
join55(codexHome, "runtime", "node"),
|
|
78116
|
+
join55(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
|
|
78284
78117
|
];
|
|
78285
78118
|
}
|
|
78286
78119
|
var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
|
|
78287
78120
|
async function collectBootstrapDataDirsByGlob(codexHome) {
|
|
78288
78121
|
const results = [];
|
|
78289
|
-
await walkForManagedBootstrapDirs(
|
|
78122
|
+
await walkForManagedBootstrapDirs(join55(codexHome, "plugins"), 0, results);
|
|
78290
78123
|
return results;
|
|
78291
78124
|
}
|
|
78292
78125
|
async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
@@ -78298,10 +78131,10 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
|
78298
78131
|
for (const entry of entries) {
|
|
78299
78132
|
if (!entry.isDirectory())
|
|
78300
78133
|
continue;
|
|
78301
|
-
const childPath =
|
|
78134
|
+
const childPath = join55(directory, entry.name);
|
|
78302
78135
|
if (isManagedBootstrapOwnerName(entry.name)) {
|
|
78303
|
-
const bootstrapDir =
|
|
78304
|
-
if (await
|
|
78136
|
+
const bootstrapDir = join55(childPath, "bootstrap");
|
|
78137
|
+
if (await exists5(bootstrapDir))
|
|
78305
78138
|
results.push(bootstrapDir);
|
|
78306
78139
|
continue;
|
|
78307
78140
|
}
|
|
@@ -78334,7 +78167,7 @@ async function attemptRemove(path7) {
|
|
|
78334
78167
|
}
|
|
78335
78168
|
async function pruneEmptyRuntimeDirBestEffort(codexHome) {
|
|
78336
78169
|
try {
|
|
78337
|
-
await rmdir(
|
|
78170
|
+
await rmdir(join55(codexHome, "runtime"));
|
|
78338
78171
|
} catch (error) {
|
|
78339
78172
|
if (isExpectedRuntimePruneFailure(error))
|
|
78340
78173
|
return;
|
|
@@ -78346,14 +78179,14 @@ function isExpectedRuntimePruneFailure(error) {
|
|
|
78346
78179
|
}
|
|
78347
78180
|
async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
78348
78181
|
const manifestPaths = [
|
|
78349
|
-
|
|
78182
|
+
join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
|
|
78350
78183
|
];
|
|
78351
|
-
const versionRoot =
|
|
78352
|
-
if (await
|
|
78184
|
+
const versionRoot = join55(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
|
|
78185
|
+
if (await exists5(versionRoot)) {
|
|
78353
78186
|
const entries = await readdir9(versionRoot, { withFileTypes: true });
|
|
78354
78187
|
for (const entry of entries) {
|
|
78355
78188
|
if (entry.isDirectory())
|
|
78356
|
-
manifestPaths.push(
|
|
78189
|
+
manifestPaths.push(join55(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
|
|
78357
78190
|
}
|
|
78358
78191
|
}
|
|
78359
78192
|
const paths = new Set;
|
|
@@ -78368,21 +78201,21 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
|
78368
78201
|
return [...paths].sort();
|
|
78369
78202
|
}
|
|
78370
78203
|
async function readManagedAgentPathsFromConfig(codexHome, configPath) {
|
|
78371
|
-
if (!await
|
|
78204
|
+
if (!await exists5(configPath))
|
|
78372
78205
|
return [];
|
|
78373
|
-
const config = await
|
|
78374
|
-
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) =>
|
|
78206
|
+
const config = await readFile21(configPath, "utf8");
|
|
78207
|
+
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join55(codexHome, "agents", `${agentName}.toml`));
|
|
78375
78208
|
}
|
|
78376
78209
|
async function readInstalledAgentManifest(manifestPath) {
|
|
78377
|
-
if (!await
|
|
78210
|
+
if (!await exists5(manifestPath))
|
|
78378
78211
|
return [];
|
|
78379
|
-
const parsed = JSON.parse(await
|
|
78212
|
+
const parsed = JSON.parse(await readFile21(manifestPath, "utf8"));
|
|
78380
78213
|
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
|
|
78381
78214
|
return [];
|
|
78382
78215
|
return parsed.agents.filter((path7) => typeof path7 === "string");
|
|
78383
78216
|
}
|
|
78384
78217
|
async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
78385
|
-
const agentsDir =
|
|
78218
|
+
const agentsDir = join55(codexHome, "agents");
|
|
78386
78219
|
const removed = [];
|
|
78387
78220
|
const skipped2 = [];
|
|
78388
78221
|
for (const path7 of paths) {
|
|
@@ -78413,7 +78246,7 @@ function isSafeManagedAgentPath(agentsDir, path7) {
|
|
|
78413
78246
|
return false;
|
|
78414
78247
|
return MANAGED_CODEX_AGENT_NAMES2.some((agentName) => fileName === `${agentName}.toml`);
|
|
78415
78248
|
}
|
|
78416
|
-
async function
|
|
78249
|
+
async function exists5(path7) {
|
|
78417
78250
|
return await maybeLstat2(path7) !== null;
|
|
78418
78251
|
}
|
|
78419
78252
|
async function maybeLstat2(path7) {
|
|
@@ -78432,8 +78265,158 @@ function nodeErrorCode5(error) {
|
|
|
78432
78265
|
}
|
|
78433
78266
|
// packages/omo-codex/src/install/codex-git-bash-mcp-env.ts
|
|
78434
78267
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
78435
|
-
// packages/omo-
|
|
78268
|
+
// packages/omo-senpi/src/install/install-senpi.ts
|
|
78436
78269
|
import { execFile as execFile3 } from "child_process";
|
|
78270
|
+
import { constants as constants7, existsSync as existsSync32 } from "fs";
|
|
78271
|
+
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile12 } from "fs/promises";
|
|
78272
|
+
import { homedir as homedir9 } from "os";
|
|
78273
|
+
import { dirname as dirname20, join as join56, resolve as resolve18 } from "path";
|
|
78274
|
+
import { fileURLToPath } from "url";
|
|
78275
|
+
import { promisify as promisify2 } from "util";
|
|
78276
|
+
var execFileAsync2 = promisify2(execFile3);
|
|
78277
|
+
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
78278
|
+
join56("extensions", "omo.js"),
|
|
78279
|
+
join56("skills", "ultrawork", "SKILL.md"),
|
|
78280
|
+
join56("skills", "ulw-loop", "SKILL.md")
|
|
78281
|
+
];
|
|
78282
|
+
async function runSenpiInstaller(options = {}) {
|
|
78283
|
+
const context = resolveInstallContext(options);
|
|
78284
|
+
await ensurePluginArtifacts(context);
|
|
78285
|
+
const settings = await readSettings(context.settingsPath);
|
|
78286
|
+
const before = JSON.stringify(settings);
|
|
78287
|
+
const packages = dedupePackages(readPackages(settings));
|
|
78288
|
+
if (!packages.includes(context.pluginPath))
|
|
78289
|
+
packages.push(context.pluginPath);
|
|
78290
|
+
settings.packages = packages;
|
|
78291
|
+
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
78292
|
+
return {
|
|
78293
|
+
ok: true,
|
|
78294
|
+
action: "install",
|
|
78295
|
+
agentDir: context.agentDir,
|
|
78296
|
+
settingsPath: context.settingsPath,
|
|
78297
|
+
pluginPath: context.pluginPath,
|
|
78298
|
+
changed: JSON.stringify(settings) !== before,
|
|
78299
|
+
backupPath
|
|
78300
|
+
};
|
|
78301
|
+
}
|
|
78302
|
+
function resolveInstallContext(options) {
|
|
78303
|
+
const env3 = options.env ?? process.env;
|
|
78304
|
+
const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname20(fileURLToPath(import.meta.url))));
|
|
78305
|
+
const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join56(homedir9(), ".senpi", "agent"));
|
|
78306
|
+
const pluginPath = resolve18(options.pluginPath ?? join56(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
78307
|
+
return {
|
|
78308
|
+
env: env3,
|
|
78309
|
+
repoRoot,
|
|
78310
|
+
agentDir,
|
|
78311
|
+
settingsPath: join56(agentDir, "settings.json"),
|
|
78312
|
+
pluginPath,
|
|
78313
|
+
runCommand: options.runCommand ?? defaultRunCommand3
|
|
78314
|
+
};
|
|
78315
|
+
}
|
|
78316
|
+
async function ensurePluginArtifacts(context) {
|
|
78317
|
+
const missing = await hasMissingPluginArtifact(context.pluginPath);
|
|
78318
|
+
if (!missing)
|
|
78319
|
+
return;
|
|
78320
|
+
await context.runCommand("node", [join56(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
78321
|
+
await context.runCommand("node", [join56(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
78322
|
+
}
|
|
78323
|
+
async function hasMissingPluginArtifact(pluginPath) {
|
|
78324
|
+
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
78325
|
+
if (!await fileExists(join56(pluginPath, artifact)))
|
|
78326
|
+
return true;
|
|
78327
|
+
}
|
|
78328
|
+
return false;
|
|
78329
|
+
}
|
|
78330
|
+
async function defaultRunCommand3(command, args, options) {
|
|
78331
|
+
const result = await execFileAsync2(command, [...args], { cwd: options.cwd });
|
|
78332
|
+
if (result.stderr.trim().length > 0)
|
|
78333
|
+
process.stderr.write(result.stderr);
|
|
78334
|
+
if (result.stdout.trim().length > 0)
|
|
78335
|
+
process.stdout.write(result.stdout);
|
|
78336
|
+
}
|
|
78337
|
+
async function readSettings(settingsPath) {
|
|
78338
|
+
let raw;
|
|
78339
|
+
try {
|
|
78340
|
+
raw = await readFile22(settingsPath, "utf8");
|
|
78341
|
+
} catch (error) {
|
|
78342
|
+
if (isErrno(error, "ENOENT"))
|
|
78343
|
+
return {};
|
|
78344
|
+
throw error;
|
|
78345
|
+
}
|
|
78346
|
+
const parsed = JSON.parse(raw);
|
|
78347
|
+
if (!isPlainObject3(parsed))
|
|
78348
|
+
throw new Error(`${settingsPath} must contain a JSON object`);
|
|
78349
|
+
return parsed;
|
|
78350
|
+
}
|
|
78351
|
+
function readPackages(settings) {
|
|
78352
|
+
const packages = settings.packages;
|
|
78353
|
+
if (packages === undefined)
|
|
78354
|
+
return [];
|
|
78355
|
+
if (!Array.isArray(packages) || !packages.every((entry) => typeof entry === "string")) {
|
|
78356
|
+
throw new Error("Senpi settings packages must be an array of strings");
|
|
78357
|
+
}
|
|
78358
|
+
return packages;
|
|
78359
|
+
}
|
|
78360
|
+
function dedupePackages(packages) {
|
|
78361
|
+
return [...new Set(packages)];
|
|
78362
|
+
}
|
|
78363
|
+
async function writeSettingsAtomically(settingsPath, settings) {
|
|
78364
|
+
await mkdir9(dirname20(settingsPath), { recursive: true });
|
|
78365
|
+
const backupPath = await nextBackupPath(settingsPath);
|
|
78366
|
+
if (await fileExists(settingsPath)) {
|
|
78367
|
+
await copyFile3(settingsPath, backupPath);
|
|
78368
|
+
} else {
|
|
78369
|
+
await writeFile12(backupPath, `{}
|
|
78370
|
+
`, "utf8");
|
|
78371
|
+
}
|
|
78372
|
+
const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
|
|
78373
|
+
await writeFile12(tempPath, `${JSON.stringify(settings, null, 2)}
|
|
78374
|
+
`, "utf8");
|
|
78375
|
+
await rename5(tempPath, settingsPath);
|
|
78376
|
+
return backupPath;
|
|
78377
|
+
}
|
|
78378
|
+
async function nextBackupPath(settingsPath) {
|
|
78379
|
+
for (let index = 0;index < 1000; index += 1) {
|
|
78380
|
+
const suffix = index === 0 ? "" : `-${index}`;
|
|
78381
|
+
const candidate = `${settingsPath}.${timestampForBackup()}${suffix}.backup`;
|
|
78382
|
+
if (!await fileExists(candidate))
|
|
78383
|
+
return candidate;
|
|
78384
|
+
}
|
|
78385
|
+
throw new Error(`Unable to allocate backup path for ${settingsPath}`);
|
|
78386
|
+
}
|
|
78387
|
+
function timestampForBackup() {
|
|
78388
|
+
return new Date().toISOString().replace(/[-:.]/g, "");
|
|
78389
|
+
}
|
|
78390
|
+
function findRepoRoot2(importerDir) {
|
|
78391
|
+
let current = importerDir;
|
|
78392
|
+
for (let depth = 0;depth <= 7; depth += 1) {
|
|
78393
|
+
if (fileExistsSync(join56(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
78394
|
+
return current;
|
|
78395
|
+
current = resolve18(current, "..");
|
|
78396
|
+
}
|
|
78397
|
+
throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
|
|
78398
|
+
}
|
|
78399
|
+
function isPlainObject3(value) {
|
|
78400
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
78401
|
+
}
|
|
78402
|
+
async function fileExists(path7) {
|
|
78403
|
+
try {
|
|
78404
|
+
await access(path7, constants7.F_OK);
|
|
78405
|
+
return true;
|
|
78406
|
+
} catch (error) {
|
|
78407
|
+
if (isErrno(error, "ENOENT"))
|
|
78408
|
+
return false;
|
|
78409
|
+
throw error;
|
|
78410
|
+
}
|
|
78411
|
+
}
|
|
78412
|
+
function fileExistsSync(path7) {
|
|
78413
|
+
return existsSync32(path7);
|
|
78414
|
+
}
|
|
78415
|
+
function isErrno(error, code) {
|
|
78416
|
+
return error instanceof Error && "code" in error && error.code === code;
|
|
78417
|
+
}
|
|
78418
|
+
// packages/omo-opencode/src/cli/star-request.ts
|
|
78419
|
+
import { execFile as execFile4 } from "child_process";
|
|
78437
78420
|
import { promisify as promisify3 } from "util";
|
|
78438
78421
|
var STAR_REPOSITORIES = [
|
|
78439
78422
|
"code-yeongyu/oh-my-openagent",
|
|
@@ -78442,11 +78425,12 @@ var STAR_REPOSITORIES = [
|
|
|
78442
78425
|
var PLATFORM_REPOSITORIES = {
|
|
78443
78426
|
opencode: ["code-yeongyu/oh-my-openagent"],
|
|
78444
78427
|
codex: STAR_REPOSITORIES,
|
|
78445
|
-
both: STAR_REPOSITORIES
|
|
78428
|
+
both: STAR_REPOSITORIES,
|
|
78429
|
+
senpi: STAR_REPOSITORIES
|
|
78446
78430
|
};
|
|
78447
|
-
var
|
|
78431
|
+
var execFileAsync3 = promisify3(execFile4);
|
|
78448
78432
|
async function runGitHubStarCommand(repository) {
|
|
78449
|
-
await
|
|
78433
|
+
await execFileAsync3("gh", ["api", "--silent", "--method", "PUT", `/user/starred/${repository}`]);
|
|
78450
78434
|
}
|
|
78451
78435
|
async function starGitHubRepositories(platform = "both", runCommand = runGitHubStarCommand) {
|
|
78452
78436
|
const results = [];
|
|
@@ -78465,23 +78449,23 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
|
|
|
78465
78449
|
init_provider_availability();
|
|
78466
78450
|
|
|
78467
78451
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
78468
|
-
import { existsSync as
|
|
78469
|
-
import { join as
|
|
78452
|
+
import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "fs";
|
|
78453
|
+
import { join as join58 } from "path";
|
|
78470
78454
|
|
|
78471
78455
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
78472
78456
|
init_shared();
|
|
78473
|
-
import { existsSync as
|
|
78474
|
-
import { join as
|
|
78457
|
+
import { existsSync as existsSync33, readFileSync as readFileSync15 } from "fs";
|
|
78458
|
+
import { join as join57 } from "path";
|
|
78475
78459
|
var TUI_SUBPATH = "tui";
|
|
78476
78460
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
78477
78461
|
function fileEntryPackageJsonPath(entry) {
|
|
78478
78462
|
let path7 = entry.slice("file:".length);
|
|
78479
78463
|
if (path7.startsWith("//"))
|
|
78480
78464
|
path7 = path7.slice(2);
|
|
78481
|
-
return
|
|
78465
|
+
return join57(path7, "package.json");
|
|
78482
78466
|
}
|
|
78483
78467
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
78484
|
-
if (!
|
|
78468
|
+
if (!existsSync33(pkgJsonPath))
|
|
78485
78469
|
return null;
|
|
78486
78470
|
try {
|
|
78487
78471
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
@@ -78501,9 +78485,9 @@ function packageJsonExportsTui(pkgJsonPath) {
|
|
|
78501
78485
|
}
|
|
78502
78486
|
}
|
|
78503
78487
|
function packageNameFromServerEntry(entry) {
|
|
78504
|
-
if (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`))
|
|
78488
|
+
if (typeof entry === "string" && (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`)))
|
|
78505
78489
|
return PLUGIN_NAME;
|
|
78506
|
-
if (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`))
|
|
78490
|
+
if (typeof entry === "string" && (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)))
|
|
78507
78491
|
return LEGACY_PLUGIN_NAME;
|
|
78508
78492
|
return null;
|
|
78509
78493
|
}
|
|
@@ -78511,19 +78495,19 @@ function isPackagePluginEntry(entry) {
|
|
|
78511
78495
|
return packageNameFromServerEntry(entry) !== null;
|
|
78512
78496
|
}
|
|
78513
78497
|
function packageExportsTuiForServerEntry(entry) {
|
|
78514
|
-
if (entry.startsWith("file:"))
|
|
78498
|
+
if (typeof entry === "string" && entry.startsWith("file:"))
|
|
78515
78499
|
return packageJsonExportsTui(fileEntryPackageJsonPath(entry));
|
|
78516
78500
|
const packageName = packageNameFromServerEntry(entry);
|
|
78517
78501
|
if (packageName === null)
|
|
78518
78502
|
return null;
|
|
78519
|
-
return packageJsonExportsTui(
|
|
78503
|
+
return packageJsonExportsTui(join57(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
78520
78504
|
}
|
|
78521
78505
|
function isOurFilePluginEntry(entry) {
|
|
78522
|
-
if (!entry.startsWith("file:"))
|
|
78506
|
+
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
78523
78507
|
return false;
|
|
78524
78508
|
try {
|
|
78525
78509
|
const pkgJsonPath = fileEntryPackageJsonPath(entry);
|
|
78526
|
-
if (!
|
|
78510
|
+
if (!existsSync33(pkgJsonPath))
|
|
78527
78511
|
return false;
|
|
78528
78512
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
78529
78513
|
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
|
|
@@ -78536,37 +78520,29 @@ function isOurFilePluginEntry(entry) {
|
|
|
78536
78520
|
}
|
|
78537
78521
|
}
|
|
78538
78522
|
function isServerPluginEntry(entry) {
|
|
78539
|
-
if (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`))
|
|
78523
|
+
if (typeof entry === "string" && (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`)))
|
|
78540
78524
|
return true;
|
|
78541
|
-
if (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`))
|
|
78525
|
+
if (typeof entry === "string" && (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)))
|
|
78542
78526
|
return true;
|
|
78543
|
-
if (entry.startsWith("file:") && isOurFilePluginEntry(entry))
|
|
78527
|
+
if (typeof entry === "string" && entry.startsWith("file:") && isOurFilePluginEntry(entry))
|
|
78544
78528
|
return true;
|
|
78545
78529
|
return false;
|
|
78546
78530
|
}
|
|
78547
78531
|
function isTuiPluginEntry(entry) {
|
|
78548
|
-
|
|
78549
|
-
return true;
|
|
78550
|
-
if (entry.startsWith("file:") && isOurFilePluginEntry(entry))
|
|
78551
|
-
return true;
|
|
78552
|
-
return false;
|
|
78532
|
+
return typeof entry === "string" && (isPackagePluginEntry(entry) || entry.startsWith("file:") && isOurFilePluginEntry(entry));
|
|
78553
78533
|
}
|
|
78554
78534
|
function isNamedTuiPluginEntry(entry) {
|
|
78555
78535
|
const canonicalPrefix = `${PLUGIN_NAME}/${TUI_SUBPATH}`;
|
|
78556
78536
|
const legacyPrefix = `${LEGACY_PLUGIN_NAME}/${TUI_SUBPATH}`;
|
|
78557
|
-
|
|
78558
|
-
return true;
|
|
78559
|
-
if (entry === legacyPrefix || entry.startsWith(`${legacyPrefix}@`))
|
|
78560
|
-
return true;
|
|
78561
|
-
return false;
|
|
78537
|
+
return typeof entry === "string" && (entry === canonicalPrefix || entry.startsWith(`${canonicalPrefix}@`) || entry === legacyPrefix || entry.startsWith(`${legacyPrefix}@`));
|
|
78562
78538
|
}
|
|
78563
78539
|
function isCanonicalNamedTuiPluginEntry(entry) {
|
|
78564
78540
|
const canonicalPrefix = `${PLUGIN_NAME}/${TUI_SUBPATH}`;
|
|
78565
|
-
return entry === canonicalPrefix || entry.startsWith(`${canonicalPrefix}@`);
|
|
78541
|
+
return typeof entry === "string" && (entry === canonicalPrefix || entry.startsWith(`${canonicalPrefix}@`));
|
|
78566
78542
|
}
|
|
78567
78543
|
function detectServerPluginRegistration() {
|
|
78568
78544
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
78569
|
-
const configPath =
|
|
78545
|
+
const configPath = existsSync33(paths.configJsonc) ? paths.configJsonc : existsSync33(paths.configJson) ? paths.configJson : null;
|
|
78570
78546
|
if (!configPath) {
|
|
78571
78547
|
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
|
|
78572
78548
|
}
|
|
@@ -78589,8 +78565,8 @@ function detectServerPluginRegistration() {
|
|
|
78589
78565
|
}
|
|
78590
78566
|
}
|
|
78591
78567
|
function detectTuiPluginRegistration() {
|
|
78592
|
-
const tuiJsonPath =
|
|
78593
|
-
if (!
|
|
78568
|
+
const tuiJsonPath = join57(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
78569
|
+
if (!existsSync33(tuiJsonPath)) {
|
|
78594
78570
|
return {
|
|
78595
78571
|
registered: false,
|
|
78596
78572
|
configPath: tuiJsonPath,
|
|
@@ -78745,11 +78721,11 @@ function readConfig(path7) {
|
|
|
78745
78721
|
return null;
|
|
78746
78722
|
}
|
|
78747
78723
|
function readServerConfig(configDir) {
|
|
78748
|
-
const jsoncPath =
|
|
78749
|
-
if (
|
|
78724
|
+
const jsoncPath = join58(configDir, "opencode.jsonc");
|
|
78725
|
+
if (existsSync34(jsoncPath))
|
|
78750
78726
|
return readConfig(jsoncPath);
|
|
78751
|
-
const jsonPath =
|
|
78752
|
-
if (
|
|
78727
|
+
const jsonPath = join58(configDir, "opencode.json");
|
|
78728
|
+
if (existsSync34(jsonPath))
|
|
78753
78729
|
return readConfig(jsonPath);
|
|
78754
78730
|
return null;
|
|
78755
78731
|
}
|
|
@@ -78769,7 +78745,7 @@ function desiredTuiEntry(serverEntry) {
|
|
|
78769
78745
|
return null;
|
|
78770
78746
|
}
|
|
78771
78747
|
function readTuiConfig(tuiJsonPath) {
|
|
78772
|
-
if (!
|
|
78748
|
+
if (!existsSync34(tuiJsonPath)) {
|
|
78773
78749
|
return { config: {}, malformed: false };
|
|
78774
78750
|
}
|
|
78775
78751
|
const config = readConfig(tuiJsonPath);
|
|
@@ -78790,7 +78766,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
78790
78766
|
if (!desiredEntry) {
|
|
78791
78767
|
return { changed: false, reason: "no-server-entry" };
|
|
78792
78768
|
}
|
|
78793
|
-
const tuiJsonPath =
|
|
78769
|
+
const tuiJsonPath = join58(configDir, "tui.json");
|
|
78794
78770
|
const { config, malformed } = readTuiConfig(tuiJsonPath);
|
|
78795
78771
|
if (malformed) {
|
|
78796
78772
|
return { changed: false, reason: "malformed" };
|
|
@@ -78805,13 +78781,13 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
78805
78781
|
}
|
|
78806
78782
|
|
|
78807
78783
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
78808
|
-
import { homedir as
|
|
78809
|
-
import { join as
|
|
78784
|
+
import { homedir as homedir10 } from "os";
|
|
78785
|
+
import { join as join59 } from "path";
|
|
78810
78786
|
|
|
78811
78787
|
// packages/shared-skills/index.mjs
|
|
78812
|
-
import { fileURLToPath } from "url";
|
|
78788
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
78813
78789
|
function sharedSkillsRootPath() {
|
|
78814
|
-
return
|
|
78790
|
+
return fileURLToPath2(new URL("./skills/", import.meta.url));
|
|
78815
78791
|
}
|
|
78816
78792
|
|
|
78817
78793
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
@@ -78825,9 +78801,9 @@ function describeResult2(result) {
|
|
|
78825
78801
|
}
|
|
78826
78802
|
async function installAstGrepForOpenCode(options = {}) {
|
|
78827
78803
|
const platform = options.platform ?? process.platform;
|
|
78828
|
-
const baseDir =
|
|
78804
|
+
const baseDir = join59(options.homeDir ?? homedir10(), ".omo");
|
|
78829
78805
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
78830
|
-
const skillDir =
|
|
78806
|
+
const skillDir = join59(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
78831
78807
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
78832
78808
|
try {
|
|
78833
78809
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -78948,6 +78924,18 @@ async function runCliInstaller(args, version2) {
|
|
|
78948
78924
|
}
|
|
78949
78925
|
console.log();
|
|
78950
78926
|
}
|
|
78927
|
+
if (config.hasSenpi) {
|
|
78928
|
+
printInfo("Installing Senpi harness adapter...");
|
|
78929
|
+
try {
|
|
78930
|
+
const senpiResult = await runSenpiInstaller();
|
|
78931
|
+
printSuccess(`Senpi adapter installed ${SYMBOLS.arrow} ${import_picocolors3.default.dim(senpiResult.settingsPath)}`);
|
|
78932
|
+
} catch (error) {
|
|
78933
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
78934
|
+
printError(`Senpi install failed: ${message}`);
|
|
78935
|
+
return 1;
|
|
78936
|
+
}
|
|
78937
|
+
console.log();
|
|
78938
|
+
}
|
|
78951
78939
|
printInfo("Anonymous telemetry is enabled by default. Disable it with OMO_SEND_ANONYMOUS_TELEMETRY=0 or OMO_DISABLE_POSTHOG=1.");
|
|
78952
78940
|
printInfo("Docs: docs/legal/privacy-policy.md and docs/legal/terms-of-service.md");
|
|
78953
78941
|
console.log();
|
|
@@ -79229,7 +79217,7 @@ var stringVisibleTrimSpacesRight = (string) => {
|
|
|
79229
79217
|
}
|
|
79230
79218
|
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
79231
79219
|
};
|
|
79232
|
-
var
|
|
79220
|
+
var exec = (string, columns, options = {}) => {
|
|
79233
79221
|
if (options.trim !== false && string.trim() === "") {
|
|
79234
79222
|
return "";
|
|
79235
79223
|
}
|
|
@@ -79339,7 +79327,7 @@ var exec2 = (string, columns, options = {}) => {
|
|
|
79339
79327
|
};
|
|
79340
79328
|
var CRLF_OR_LF = /\r?\n/;
|
|
79341
79329
|
function wrapAnsi(string, columns, options) {
|
|
79342
|
-
return String(string).normalize().split(CRLF_OR_LF).map((line) =>
|
|
79330
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join(`
|
|
79343
79331
|
`);
|
|
79344
79332
|
}
|
|
79345
79333
|
|
|
@@ -80313,6 +80301,21 @@ var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
|
80313
80301
|
|
|
80314
80302
|
// packages/omo-opencode/src/cli/tui-install-prompts.ts
|
|
80315
80303
|
init_model_fallback();
|
|
80304
|
+
|
|
80305
|
+
// packages/omo-opencode/src/cli/senpi-platform-flag.ts
|
|
80306
|
+
var SENPI_PLATFORM_ENV_FLAG = "OMO_ENABLE_SENPI_PLATFORM";
|
|
80307
|
+
function isSenpiPlatformEnabled(env3 = process.env) {
|
|
80308
|
+
const value = env3[SENPI_PLATFORM_ENV_FLAG]?.trim().toLowerCase();
|
|
80309
|
+
return value === "1" || value === "true";
|
|
80310
|
+
}
|
|
80311
|
+
function availableInstallPlatforms(env3 = process.env) {
|
|
80312
|
+
const platforms = ["opencode", "codex", "both"];
|
|
80313
|
+
if (isSenpiPlatformEnabled(env3))
|
|
80314
|
+
platforms.push("senpi");
|
|
80315
|
+
return platforms;
|
|
80316
|
+
}
|
|
80317
|
+
|
|
80318
|
+
// packages/omo-opencode/src/cli/tui-install-prompts.ts
|
|
80316
80319
|
async function selectOrCancel(params) {
|
|
80317
80320
|
if (!process.stdin.isTTY || !process.stdout.isTTY)
|
|
80318
80321
|
return null;
|
|
@@ -80333,6 +80336,9 @@ async function promptInstallPlatform(initialValue = "opencode") {
|
|
|
80333
80336
|
{ value: "codex", label: "Codex", hint: "Install Codex harness adapter only" },
|
|
80334
80337
|
{ value: "both", label: "Both", hint: "Install OpenCode plugin and Codex adapter" }
|
|
80335
80338
|
];
|
|
80339
|
+
if (isSenpiPlatformEnabled()) {
|
|
80340
|
+
options.push({ value: "senpi", label: "Senpi", hint: "Install Senpi harness adapter only" });
|
|
80341
|
+
}
|
|
80336
80342
|
return selectOrCancel({
|
|
80337
80343
|
message: "Which platform do you want to install?",
|
|
80338
80344
|
options,
|
|
@@ -80342,6 +80348,7 @@ async function promptInstallPlatform(initialValue = "opencode") {
|
|
|
80342
80348
|
async function promptInstallConfig(detected, platform, codexAutonomousOverride) {
|
|
80343
80349
|
const hasOpenCode = platform === "opencode" || platform === "both";
|
|
80344
80350
|
const hasCodex = platform === "codex" || platform === "both";
|
|
80351
|
+
const hasSenpi = platform === "senpi";
|
|
80345
80352
|
const codexAutonomous = await resolveCodexAutonomous(hasCodex, codexAutonomousOverride);
|
|
80346
80353
|
if (codexAutonomous === null)
|
|
80347
80354
|
return null;
|
|
@@ -80355,6 +80362,7 @@ async function promptInstallConfig(detected, platform, codexAutonomousOverride)
|
|
|
80355
80362
|
hasGemini: false,
|
|
80356
80363
|
hasCopilot: false,
|
|
80357
80364
|
hasCodex,
|
|
80365
|
+
hasSenpi,
|
|
80358
80366
|
hasOpencodeZen: false,
|
|
80359
80367
|
hasZaiCodingPlan: false,
|
|
80360
80368
|
hasKimiForCoding: false,
|
|
@@ -80497,6 +80505,7 @@ async function promptInstallConfig(detected, platform, codexAutonomousOverride)
|
|
|
80497
80505
|
hasGemini: gemini === "yes",
|
|
80498
80506
|
hasCopilot: copilot === "yes",
|
|
80499
80507
|
hasCodex,
|
|
80508
|
+
hasSenpi,
|
|
80500
80509
|
hasOpencodeZen: opencodeZen === "yes",
|
|
80501
80510
|
hasZaiCodingPlan: zaiCodingPlan === "yes",
|
|
80502
80511
|
hasKimiForCoding: kimiForCoding === "yes",
|
|
@@ -80626,6 +80635,19 @@ async function runTuiInstaller(args, version2) {
|
|
|
80626
80635
|
R2.warn(`Codex install failed (OpenCode install remains successful): ${message}`);
|
|
80627
80636
|
}
|
|
80628
80637
|
}
|
|
80638
|
+
if (config.hasSenpi) {
|
|
80639
|
+
spinner.start("Installing Senpi harness adapter");
|
|
80640
|
+
try {
|
|
80641
|
+
const senpiResult = await runSenpiInstaller();
|
|
80642
|
+
spinner.stop(`Senpi adapter installed to ${import_picocolors4.default.cyan(senpiResult.settingsPath)}`);
|
|
80643
|
+
} catch (error) {
|
|
80644
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
80645
|
+
spinner.stop(`Senpi install failed ${import_picocolors4.default.yellow("[!]")}`);
|
|
80646
|
+
R2.error(`Senpi install failed: ${message}`);
|
|
80647
|
+
fe(import_picocolors4.default.red("Installation failed."));
|
|
80648
|
+
return 1;
|
|
80649
|
+
}
|
|
80650
|
+
}
|
|
80629
80651
|
R2.success(import_picocolors4.default.bold(isUpdate ? "Configuration updated!" : "Installation complete!"));
|
|
80630
80652
|
if (config.hasOpenCode) {
|
|
80631
80653
|
R2.message(`Run ${import_picocolors4.default.cyan("opencode")} to start!`);
|
|
@@ -80673,7 +80695,7 @@ async function runTuiInstaller(args, version2) {
|
|
|
80673
80695
|
|
|
80674
80696
|
// packages/omo-opencode/src/cli/install.ts
|
|
80675
80697
|
var VERSION = package_default.version;
|
|
80676
|
-
async function
|
|
80698
|
+
async function install3(args) {
|
|
80677
80699
|
return args.tui ? runTuiInstaller(args, VERSION) : runCliInstaller(args, VERSION);
|
|
80678
80700
|
}
|
|
80679
80701
|
// packages/omo-opencode/src/cli/cleanup.ts
|
|
@@ -81476,7 +81498,7 @@ async function processEvents(ctx, stream, state) {
|
|
|
81476
81498
|
}
|
|
81477
81499
|
// packages/omo-opencode/src/plugin-config/layered-config-loader.ts
|
|
81478
81500
|
import * as fs5 from "fs";
|
|
81479
|
-
import { homedir as
|
|
81501
|
+
import { homedir as homedir11 } from "os";
|
|
81480
81502
|
import * as path7 from "path";
|
|
81481
81503
|
|
|
81482
81504
|
// node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
@@ -82110,7 +82132,7 @@ __export(exports_util, {
|
|
|
82110
82132
|
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
82111
82133
|
joinValues: () => joinValues,
|
|
82112
82134
|
issue: () => issue,
|
|
82113
|
-
isPlainObject: () =>
|
|
82135
|
+
isPlainObject: () => isPlainObject4,
|
|
82114
82136
|
isObject: () => isObject2,
|
|
82115
82137
|
hexToUint8Array: () => hexToUint8Array,
|
|
82116
82138
|
getSizableOrigin: () => getSizableOrigin,
|
|
@@ -82292,7 +82314,7 @@ var allowsEval = /* @__PURE__ */ cached(() => {
|
|
|
82292
82314
|
return false;
|
|
82293
82315
|
}
|
|
82294
82316
|
});
|
|
82295
|
-
function
|
|
82317
|
+
function isPlainObject4(o) {
|
|
82296
82318
|
if (isObject2(o) === false)
|
|
82297
82319
|
return false;
|
|
82298
82320
|
const ctor = o.constructor;
|
|
@@ -82309,7 +82331,7 @@ function isPlainObject3(o) {
|
|
|
82309
82331
|
return true;
|
|
82310
82332
|
}
|
|
82311
82333
|
function shallowClone(o) {
|
|
82312
|
-
if (
|
|
82334
|
+
if (isPlainObject4(o))
|
|
82313
82335
|
return { ...o };
|
|
82314
82336
|
if (Array.isArray(o))
|
|
82315
82337
|
return [...o];
|
|
@@ -82513,7 +82535,7 @@ function omit(schema, mask) {
|
|
|
82513
82535
|
return clone(schema, def);
|
|
82514
82536
|
}
|
|
82515
82537
|
function extend(schema, shape) {
|
|
82516
|
-
if (!
|
|
82538
|
+
if (!isPlainObject4(shape)) {
|
|
82517
82539
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
82518
82540
|
}
|
|
82519
82541
|
const checks = schema._zod.def.checks;
|
|
@@ -82536,7 +82558,7 @@ function extend(schema, shape) {
|
|
|
82536
82558
|
return clone(schema, def);
|
|
82537
82559
|
}
|
|
82538
82560
|
function safeExtend(schema, shape) {
|
|
82539
|
-
if (!
|
|
82561
|
+
if (!isPlainObject4(shape)) {
|
|
82540
82562
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
82541
82563
|
}
|
|
82542
82564
|
const def = mergeDefs(schema._zod.def, {
|
|
@@ -84879,7 +84901,7 @@ function mergeValues(a, b2) {
|
|
|
84879
84901
|
if (a instanceof Date && b2 instanceof Date && +a === +b2) {
|
|
84880
84902
|
return { valid: true, data: a };
|
|
84881
84903
|
}
|
|
84882
|
-
if (
|
|
84904
|
+
if (isPlainObject4(a) && isPlainObject4(b2)) {
|
|
84883
84905
|
const bKeys = Object.keys(b2);
|
|
84884
84906
|
const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
84885
84907
|
const newObj = { ...a, ...b2 };
|
|
@@ -85065,7 +85087,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
85065
85087
|
$ZodType.init(inst, def);
|
|
85066
85088
|
inst._zod.parse = (payload, ctx) => {
|
|
85067
85089
|
const input = payload.value;
|
|
85068
|
-
if (!
|
|
85090
|
+
if (!isPlainObject4(input)) {
|
|
85069
85091
|
payload.issues.push({
|
|
85070
85092
|
expected: "record",
|
|
85071
85093
|
code: "invalid_type",
|
|
@@ -96217,18 +96239,18 @@ var RuntimeFallbackConfigSchema = exports_external.object({
|
|
|
96217
96239
|
});
|
|
96218
96240
|
|
|
96219
96241
|
// packages/team-core/src/config.ts
|
|
96220
|
-
var TeamModeConfigSchema =
|
|
96221
|
-
enabled:
|
|
96222
|
-
tmux_visualization:
|
|
96223
|
-
max_parallel_members:
|
|
96224
|
-
max_members:
|
|
96225
|
-
max_messages_per_run:
|
|
96226
|
-
max_wall_clock_minutes:
|
|
96227
|
-
max_member_turns:
|
|
96228
|
-
base_dir:
|
|
96229
|
-
message_payload_max_bytes:
|
|
96230
|
-
recipient_unread_max_bytes:
|
|
96231
|
-
mailbox_poll_interval_ms:
|
|
96242
|
+
var TeamModeConfigSchema = object({
|
|
96243
|
+
enabled: boolean2().default(false),
|
|
96244
|
+
tmux_visualization: boolean2().default(false),
|
|
96245
|
+
max_parallel_members: number2().int().min(1).max(8).default(4),
|
|
96246
|
+
max_members: number2().int().min(1).max(8).default(8),
|
|
96247
|
+
max_messages_per_run: number2().int().min(1).default(1e4),
|
|
96248
|
+
max_wall_clock_minutes: number2().int().min(1).default(120),
|
|
96249
|
+
max_member_turns: number2().int().min(1).default(500),
|
|
96250
|
+
base_dir: string2().optional(),
|
|
96251
|
+
message_payload_max_bytes: number2().int().min(1024).default(32768),
|
|
96252
|
+
recipient_unread_max_bytes: number2().int().min(1024).default(262144),
|
|
96253
|
+
mailbox_poll_interval_ms: number2().int().min(500).default(3000)
|
|
96232
96254
|
});
|
|
96233
96255
|
// packages/omo-opencode/src/config/schema/skills.ts
|
|
96234
96256
|
var SkillSourceSchema = exports_external.union([
|
|
@@ -96635,7 +96657,7 @@ function loadConfigFromPath(configPath, _ctx) {
|
|
|
96635
96657
|
|
|
96636
96658
|
// packages/omo-opencode/src/plugin-config/layered-config-loader.ts
|
|
96637
96659
|
function resolveHomeDirectory() {
|
|
96638
|
-
return process.env.HOME ?? process.env.USERPROFILE ??
|
|
96660
|
+
return process.env.HOME ?? process.env.USERPROFILE ?? homedir11();
|
|
96639
96661
|
}
|
|
96640
96662
|
function resolveConfigPathAfterLegacyMigration(detectedPath) {
|
|
96641
96663
|
if (!path7.basename(detectedPath).startsWith(LEGACY_CONFIG_BASENAME)) {
|
|
@@ -96776,7 +96798,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
96776
96798
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
96777
96799
|
init_bun_which_shim();
|
|
96778
96800
|
init_spawn_with_windows_hide();
|
|
96779
|
-
import { delimiter as delimiter2, dirname as
|
|
96801
|
+
import { delimiter as delimiter2, dirname as dirname22, posix as posix4, win32 as win324 } from "path";
|
|
96780
96802
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
96781
96803
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
96782
96804
|
function getCommandCandidates(platform) {
|
|
@@ -96834,7 +96856,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
96834
96856
|
return null;
|
|
96835
96857
|
}
|
|
96836
96858
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
96837
|
-
const preferredDir =
|
|
96859
|
+
const preferredDir = dirname22(binaryPath);
|
|
96838
96860
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
96839
96861
|
return [preferredDir, ...existing].join(delimiter2);
|
|
96840
96862
|
}
|
|
@@ -96976,6 +96998,7 @@ var SESSION_CREATE_MAX_RETRIES = 3;
|
|
|
96976
96998
|
var SESSION_CREATE_RETRY_DELAY_MS = 1000;
|
|
96977
96999
|
async function resolveSession(options) {
|
|
96978
97000
|
const { client: client3, sessionId, directory } = options;
|
|
97001
|
+
const retryDelayMs = options.retryDelayMs ?? SESSION_CREATE_RETRY_DELAY_MS;
|
|
96979
97002
|
if (sessionId) {
|
|
96980
97003
|
const res = await client3.session.get({
|
|
96981
97004
|
path: { id: sessionId },
|
|
@@ -97000,9 +97023,9 @@ async function resolveSession(options) {
|
|
|
97000
97023
|
console.error(import_picocolors12.default.yellow(`Session create attempt ${attempt}/${SESSION_CREATE_MAX_RETRIES} failed:`));
|
|
97001
97024
|
console.error(import_picocolors12.default.dim(` Error: ${serializeError2(res.error)}`));
|
|
97002
97025
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
97003
|
-
const delay2 =
|
|
97026
|
+
const delay2 = retryDelayMs * attempt;
|
|
97004
97027
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
97005
|
-
await new Promise((
|
|
97028
|
+
await new Promise((resolve19) => setTimeout(resolve19, delay2));
|
|
97006
97029
|
}
|
|
97007
97030
|
continue;
|
|
97008
97031
|
}
|
|
@@ -97011,9 +97034,9 @@ async function resolveSession(options) {
|
|
|
97011
97034
|
}
|
|
97012
97035
|
console.error(import_picocolors12.default.yellow(`Session create attempt ${attempt}/${SESSION_CREATE_MAX_RETRIES}: No session ID returned`));
|
|
97013
97036
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
97014
|
-
const delay2 =
|
|
97037
|
+
const delay2 = retryDelayMs * attempt;
|
|
97015
97038
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
97016
|
-
await new Promise((
|
|
97039
|
+
await new Promise((resolve19) => setTimeout(resolve19, delay2));
|
|
97017
97040
|
}
|
|
97018
97041
|
}
|
|
97019
97042
|
throw new Error("Failed to create session after all retries");
|
|
@@ -97226,7 +97249,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
97226
97249
|
var NOTEPAD_DIR = "notepads";
|
|
97227
97250
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
97228
97251
|
// packages/boulder-state/src/top-level-task.ts
|
|
97229
|
-
import { existsSync as
|
|
97252
|
+
import { existsSync as existsSync37, readFileSync as readFileSync18 } from "fs";
|
|
97230
97253
|
var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
|
|
97231
97254
|
var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
|
|
97232
97255
|
var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
|
|
@@ -97249,7 +97272,7 @@ function buildTaskRef(section, taskLabel) {
|
|
|
97249
97272
|
};
|
|
97250
97273
|
}
|
|
97251
97274
|
function readCurrentTopLevelTask(planPath) {
|
|
97252
|
-
if (!
|
|
97275
|
+
if (!existsSync37(planPath)) {
|
|
97253
97276
|
return null;
|
|
97254
97277
|
}
|
|
97255
97278
|
try {
|
|
@@ -97278,13 +97301,13 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
97278
97301
|
}
|
|
97279
97302
|
}
|
|
97280
97303
|
// packages/boulder-state/src/storage/path.ts
|
|
97281
|
-
import { existsSync as
|
|
97282
|
-
import { isAbsolute as isAbsolute11, join as
|
|
97304
|
+
import { existsSync as existsSync38 } from "fs";
|
|
97305
|
+
import { isAbsolute as isAbsolute11, join as join61, relative as relative8, resolve as resolve19 } from "path";
|
|
97283
97306
|
function getBoulderFilePath(directory) {
|
|
97284
|
-
return
|
|
97307
|
+
return join61(directory, BOULDER_DIR, BOULDER_FILE);
|
|
97285
97308
|
}
|
|
97286
97309
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
97287
|
-
return isAbsolute11(trackedPath) ?
|
|
97310
|
+
return isAbsolute11(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
|
|
97288
97311
|
}
|
|
97289
97312
|
function resolveBoulderPlanPath(directory, state) {
|
|
97290
97313
|
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
|
|
@@ -97292,20 +97315,20 @@ function resolveBoulderPlanPath(directory, state) {
|
|
|
97292
97315
|
if (!worktreePath) {
|
|
97293
97316
|
return absolutePlanPath;
|
|
97294
97317
|
}
|
|
97295
|
-
const absoluteDirectory =
|
|
97318
|
+
const absoluteDirectory = resolve19(directory);
|
|
97296
97319
|
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
|
|
97297
97320
|
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
|
|
97298
97321
|
return absolutePlanPath;
|
|
97299
97322
|
}
|
|
97300
97323
|
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
|
|
97301
|
-
const worktreePlanPath =
|
|
97302
|
-
return
|
|
97324
|
+
const worktreePlanPath = resolve19(absoluteWorktreePath, relativePlanPath);
|
|
97325
|
+
return existsSync38(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
|
|
97303
97326
|
}
|
|
97304
97327
|
function resolveBoulderPlanPathForWork(directory, work) {
|
|
97305
97328
|
return resolveBoulderPlanPath(directory, work);
|
|
97306
97329
|
}
|
|
97307
97330
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
97308
|
-
import { existsSync as
|
|
97331
|
+
import { existsSync as existsSync39, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
|
|
97309
97332
|
var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
|
|
97310
97333
|
var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
|
|
97311
97334
|
var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
|
|
@@ -97314,7 +97337,7 @@ var CHECKED_CHECKBOX_PATTERN = /^(\s*)[-*]\s*\[[xX]\]\s*(.+)$/;
|
|
|
97314
97337
|
var TODO_TASK_PATTERN2 = /^\d+\.\s+/;
|
|
97315
97338
|
var FINAL_WAVE_TASK_PATTERN2 = /^F\d+\.\s+/i;
|
|
97316
97339
|
function getPlanProgress(planPath) {
|
|
97317
|
-
if (!
|
|
97340
|
+
if (!existsSync39(planPath)) {
|
|
97318
97341
|
return { total: 0, completed: 0, isComplete: false };
|
|
97319
97342
|
}
|
|
97320
97343
|
try {
|
|
@@ -97434,10 +97457,10 @@ function selectMirrorWork(state) {
|
|
|
97434
97457
|
return sorted[0] ?? null;
|
|
97435
97458
|
}
|
|
97436
97459
|
// packages/boulder-state/src/storage/read-state.ts
|
|
97437
|
-
import { existsSync as
|
|
97460
|
+
import { existsSync as existsSync40, readFileSync as readFileSync20 } from "fs";
|
|
97438
97461
|
function readBoulderState(directory) {
|
|
97439
97462
|
const filePath = getBoulderFilePath(directory);
|
|
97440
|
-
if (!
|
|
97463
|
+
if (!existsSync40(filePath)) {
|
|
97441
97464
|
return null;
|
|
97442
97465
|
}
|
|
97443
97466
|
try {
|
|
@@ -97502,21 +97525,19 @@ function getBoulderWorks(state) {
|
|
|
97502
97525
|
}
|
|
97503
97526
|
return [buildWorkFromMirror(state)];
|
|
97504
97527
|
}
|
|
97505
|
-
// packages/omo-opencode/src/features/boulder-state/format-duration.ts
|
|
97506
|
-
init_src();
|
|
97507
97528
|
// packages/omo-opencode/src/features/claude-code-session-state/index.ts
|
|
97508
97529
|
init_state();
|
|
97509
97530
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
97510
97531
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
97511
97532
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
97512
|
-
import { existsSync as
|
|
97513
|
-
import { join as
|
|
97533
|
+
import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
|
|
97534
|
+
import { join as join62 } from "path";
|
|
97514
97535
|
function getMarkerPath(directory, sessionID) {
|
|
97515
|
-
return
|
|
97536
|
+
return join62(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
97516
97537
|
}
|
|
97517
97538
|
function readContinuationMarker(directory, sessionID) {
|
|
97518
97539
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
97519
|
-
if (!
|
|
97540
|
+
if (!existsSync41(markerPath))
|
|
97520
97541
|
return null;
|
|
97521
97542
|
try {
|
|
97522
97543
|
const raw = readFileSync21(markerPath, "utf-8");
|
|
@@ -97585,7 +97606,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
97585
97606
|
init_shared();
|
|
97586
97607
|
init_compaction_marker();
|
|
97587
97608
|
import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "fs";
|
|
97588
|
-
import { join as
|
|
97609
|
+
import { join as join63 } from "path";
|
|
97589
97610
|
var defaultSessionLastAgentDeps = {
|
|
97590
97611
|
getMessageDir,
|
|
97591
97612
|
isSqliteBackend,
|
|
@@ -97645,7 +97666,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
97645
97666
|
try {
|
|
97646
97667
|
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
97647
97668
|
try {
|
|
97648
|
-
const content = readFileSync22(
|
|
97669
|
+
const content = readFileSync22(join63(messageDir, fileName), "utf-8");
|
|
97649
97670
|
const parsed = JSON.parse(content);
|
|
97650
97671
|
return {
|
|
97651
97672
|
fileName,
|
|
@@ -97688,8 +97709,8 @@ init_agent_display_names();
|
|
|
97688
97709
|
|
|
97689
97710
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
97690
97711
|
init_frontmatter2();
|
|
97691
|
-
import { existsSync as
|
|
97692
|
-
import { dirname as
|
|
97712
|
+
import { existsSync as existsSync42, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "fs";
|
|
97713
|
+
import { dirname as dirname23, join as join64 } from "path";
|
|
97693
97714
|
|
|
97694
97715
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
97695
97716
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -97698,11 +97719,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
97698
97719
|
|
|
97699
97720
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
97700
97721
|
function getStateFilePath(directory, customPath) {
|
|
97701
|
-
return customPath ?
|
|
97722
|
+
return customPath ? join64(directory, customPath) : join64(directory, DEFAULT_STATE_FILE);
|
|
97702
97723
|
}
|
|
97703
97724
|
function readState(directory, customPath) {
|
|
97704
97725
|
const filePath = getStateFilePath(directory, customPath);
|
|
97705
|
-
if (!
|
|
97726
|
+
if (!existsSync42(filePath)) {
|
|
97706
97727
|
return null;
|
|
97707
97728
|
}
|
|
97708
97729
|
try {
|
|
@@ -97931,13 +97952,15 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
|
|
|
97931
97952
|
const eventWatchdogMs = options.eventWatchdogMs ?? DEFAULT_EVENT_WATCHDOG_MS;
|
|
97932
97953
|
const secondaryMeaningfulWorkTimeoutMs = options.secondaryMeaningfulWorkTimeoutMs ?? DEFAULT_SECONDARY_MEANINGFUL_WORK_TIMEOUT_MS;
|
|
97933
97954
|
const requireMeaningfulWork = options.requireMeaningfulWork ?? false;
|
|
97955
|
+
const now = options.now ?? Date.now;
|
|
97956
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve20) => setTimeout(resolve20, ms)));
|
|
97934
97957
|
let consecutiveCompleteChecks = 0;
|
|
97935
97958
|
let errorCycleCount = 0;
|
|
97936
97959
|
let firstWorkTimestamp = null;
|
|
97937
97960
|
let secondaryTimeoutChecked = false;
|
|
97938
|
-
const pollStartTimestamp =
|
|
97961
|
+
const pollStartTimestamp = now();
|
|
97939
97962
|
while (!abortController.signal.aborted) {
|
|
97940
|
-
await
|
|
97963
|
+
await sleep(pollIntervalMs);
|
|
97941
97964
|
if (abortController.signal.aborted) {
|
|
97942
97965
|
return 130;
|
|
97943
97966
|
}
|
|
@@ -97963,7 +97986,7 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
97963
97986
|
}
|
|
97964
97987
|
let mainSessionStatus = null;
|
|
97965
97988
|
if (eventState.lastEventTimestamp !== null) {
|
|
97966
|
-
const timeSinceLastEvent =
|
|
97989
|
+
const timeSinceLastEvent = now() - eventState.lastEventTimestamp;
|
|
97967
97990
|
if (timeSinceLastEvent > eventWatchdogMs) {
|
|
97968
97991
|
console.log(import_picocolors15.default.yellow(`
|
|
97969
97992
|
No events for ${Math.round(timeSinceLastEvent / 1000)}s, verifying session status...`));
|
|
@@ -97973,7 +97996,7 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
97973
97996
|
} else if (mainSessionStatus === "busy" || mainSessionStatus === "retry") {
|
|
97974
97997
|
eventState.mainSessionIdle = false;
|
|
97975
97998
|
}
|
|
97976
|
-
eventState.lastEventTimestamp =
|
|
97999
|
+
eventState.lastEventTimestamp = now();
|
|
97977
98000
|
}
|
|
97978
98001
|
}
|
|
97979
98002
|
if (mainSessionStatus === null) {
|
|
@@ -97993,12 +98016,12 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
97993
98016
|
continue;
|
|
97994
98017
|
}
|
|
97995
98018
|
if (!eventState.hasReceivedMeaningfulWork) {
|
|
97996
|
-
if (
|
|
98019
|
+
if (now() - pollStartTimestamp < minStabilizationMs) {
|
|
97997
98020
|
consecutiveCompleteChecks = 0;
|
|
97998
98021
|
continue;
|
|
97999
98022
|
}
|
|
98000
98023
|
if (requireMeaningfulWork) {
|
|
98001
|
-
if (
|
|
98024
|
+
if (now() - pollStartTimestamp <= secondaryMeaningfulWorkTimeoutMs) {
|
|
98002
98025
|
consecutiveCompleteChecks = 0;
|
|
98003
98026
|
continue;
|
|
98004
98027
|
}
|
|
@@ -98012,7 +98035,7 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
98012
98035
|
Session never produced assistant output, tool activity, or reasoning after the prompt started.`));
|
|
98013
98036
|
return 1;
|
|
98014
98037
|
}
|
|
98015
|
-
if (
|
|
98038
|
+
if (now() - pollStartTimestamp > secondaryMeaningfulWorkTimeoutMs && !secondaryTimeoutChecked) {
|
|
98016
98039
|
secondaryTimeoutChecked = true;
|
|
98017
98040
|
const hasActiveWork = await hasActiveSessionWork(ctx);
|
|
98018
98041
|
if (hasActiveWork) {
|
|
@@ -98023,9 +98046,9 @@ Session never produced assistant output, tool activity, or reasoning after the p
|
|
|
98023
98046
|
}
|
|
98024
98047
|
} else {
|
|
98025
98048
|
if (firstWorkTimestamp === null) {
|
|
98026
|
-
firstWorkTimestamp =
|
|
98049
|
+
firstWorkTimestamp = now();
|
|
98027
98050
|
}
|
|
98028
|
-
if (
|
|
98051
|
+
if (now() - firstWorkTimestamp < minStabilizationMs) {
|
|
98029
98052
|
consecutiveCompleteChecks = 0;
|
|
98030
98053
|
continue;
|
|
98031
98054
|
}
|
|
@@ -98095,7 +98118,7 @@ function createAbortError() {
|
|
|
98095
98118
|
return error51;
|
|
98096
98119
|
}
|
|
98097
98120
|
function sleep(delayMs) {
|
|
98098
|
-
return new Promise((
|
|
98121
|
+
return new Promise((resolve20) => setTimeout(resolve20, delayMs));
|
|
98099
98122
|
}
|
|
98100
98123
|
function hasPromptStartEvidence(eventState) {
|
|
98101
98124
|
return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
|
|
@@ -98470,7 +98493,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
|
|
|
98470
98493
|
async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
|
|
98471
98494
|
const completed = await Promise.race([
|
|
98472
98495
|
eventProcessor.then(() => true),
|
|
98473
|
-
new Promise((
|
|
98496
|
+
new Promise((resolve20) => setTimeout(() => resolve20(false), timeoutMs))
|
|
98474
98497
|
]);
|
|
98475
98498
|
}
|
|
98476
98499
|
async function run(options) {
|
|
@@ -98668,6 +98691,10 @@ function formatVersionOutput(info) {
|
|
|
98668
98691
|
lines.push(` ${SYMBOLS3.pin} ${import_picocolors17.default.magenta(`Version pinned to ${info.pinnedVersion}`)}`);
|
|
98669
98692
|
lines.push(` ${import_picocolors17.default.dim("Update check skipped for pinned versions")}`);
|
|
98670
98693
|
break;
|
|
98694
|
+
case "pinned-mismatch":
|
|
98695
|
+
lines.push(` ${SYMBOLS3.warn} ${import_picocolors17.default.yellow(`Version pinned to ${info.pinnedVersion} but running ${info.currentVersion}`)}`);
|
|
98696
|
+
lines.push(` ${import_picocolors17.default.dim("The pin only skips the update check; it does not control which version OpenCode loads")}`);
|
|
98697
|
+
break;
|
|
98671
98698
|
case "error":
|
|
98672
98699
|
lines.push(` ${SYMBOLS3.cross} ${import_picocolors17.default.red("Unable to check for updates")}`);
|
|
98673
98700
|
lines.push(` ${import_picocolors17.default.dim("Network error or npm registry unavailable")}`);
|
|
@@ -98704,14 +98731,16 @@ async function getLocalVersion(options = {}) {
|
|
|
98704
98731
|
}
|
|
98705
98732
|
const pluginInfo = findPluginEntry(directory);
|
|
98706
98733
|
if (pluginInfo?.isPinned) {
|
|
98734
|
+
const actualVersion = getCachedVersion();
|
|
98735
|
+
const isMismatch = actualVersion !== null && actualVersion !== pluginInfo.pinnedVersion;
|
|
98707
98736
|
const info2 = {
|
|
98708
|
-
currentVersion: pluginInfo.pinnedVersion,
|
|
98737
|
+
currentVersion: isMismatch ? actualVersion : pluginInfo.pinnedVersion,
|
|
98709
98738
|
latestVersion: null,
|
|
98710
98739
|
isUpToDate: false,
|
|
98711
98740
|
isLocalDev: false,
|
|
98712
98741
|
isPinned: true,
|
|
98713
98742
|
pinnedVersion: pluginInfo.pinnedVersion,
|
|
98714
|
-
status: "pinned"
|
|
98743
|
+
status: isMismatch ? "pinned-mismatch" : "pinned"
|
|
98715
98744
|
};
|
|
98716
98745
|
console.log(options.json ? formatJsonOutput(info2) : formatVersionOutput(info2));
|
|
98717
98746
|
return 0;
|
|
@@ -98773,14 +98802,14 @@ async function getLocalVersion(options = {}) {
|
|
|
98773
98802
|
}
|
|
98774
98803
|
}
|
|
98775
98804
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
98776
|
-
import { existsSync as
|
|
98805
|
+
import { existsSync as existsSync53, readFileSync as readFileSync33 } from "fs";
|
|
98777
98806
|
|
|
98778
98807
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
98779
98808
|
init_extract_semver();
|
|
98780
98809
|
init_bun_which_shim();
|
|
98781
|
-
import { existsSync as
|
|
98782
|
-
import { homedir as
|
|
98783
|
-
import { join as
|
|
98810
|
+
import { existsSync as existsSync50, accessSync as accessSync4, constants as constants10 } from "fs";
|
|
98811
|
+
import { homedir as homedir14 } from "os";
|
|
98812
|
+
import { join as join71 } from "path";
|
|
98784
98813
|
|
|
98785
98814
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
98786
98815
|
init_spawn_with_windows_hide();
|
|
@@ -98819,8 +98848,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
98819
98848
|
const stdoutPromise = readSpawnStream(proc.stdout);
|
|
98820
98849
|
const stderrPromise = readSpawnStream(proc.stderr);
|
|
98821
98850
|
let timer;
|
|
98822
|
-
const timeoutPromise = new Promise((
|
|
98823
|
-
timer = setTimeout(() =>
|
|
98851
|
+
const timeoutPromise = new Promise((resolve20) => {
|
|
98852
|
+
timer = setTimeout(() => resolve20("timeout"), timeoutMs);
|
|
98824
98853
|
});
|
|
98825
98854
|
const processPromise = (async () => {
|
|
98826
98855
|
await proc.exited;
|
|
@@ -98857,7 +98886,7 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
98857
98886
|
var WINDOWS_EXECUTABLE_EXTS = [".exe", ".cmd", ".bat", ".ps1"];
|
|
98858
98887
|
function isExecutable2(path14) {
|
|
98859
98888
|
try {
|
|
98860
|
-
accessSync4(path14,
|
|
98889
|
+
accessSync4(path14, constants10.X_OK);
|
|
98861
98890
|
return true;
|
|
98862
98891
|
} catch (error51) {
|
|
98863
98892
|
if (error51 instanceof Error) {
|
|
@@ -98867,22 +98896,22 @@ function isExecutable2(path14) {
|
|
|
98867
98896
|
}
|
|
98868
98897
|
}
|
|
98869
98898
|
function getDesktopAppPaths(platform) {
|
|
98870
|
-
const home =
|
|
98899
|
+
const home = homedir14();
|
|
98871
98900
|
switch (platform) {
|
|
98872
98901
|
case "darwin":
|
|
98873
98902
|
return [
|
|
98874
98903
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
98875
|
-
|
|
98904
|
+
join71(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
98876
98905
|
];
|
|
98877
98906
|
case "win32": {
|
|
98878
98907
|
const programFiles = process.env.ProgramFiles;
|
|
98879
98908
|
const localAppData = process.env.LOCALAPPDATA;
|
|
98880
98909
|
const paths = [];
|
|
98881
98910
|
if (programFiles) {
|
|
98882
|
-
paths.push(
|
|
98911
|
+
paths.push(join71(programFiles, "OpenCode", "OpenCode.exe"));
|
|
98883
98912
|
}
|
|
98884
98913
|
if (localAppData) {
|
|
98885
|
-
paths.push(
|
|
98914
|
+
paths.push(join71(localAppData, "OpenCode", "OpenCode.exe"));
|
|
98886
98915
|
}
|
|
98887
98916
|
return paths;
|
|
98888
98917
|
}
|
|
@@ -98890,8 +98919,8 @@ function getDesktopAppPaths(platform) {
|
|
|
98890
98919
|
return [
|
|
98891
98920
|
"/usr/bin/opencode",
|
|
98892
98921
|
"/usr/lib/opencode/opencode",
|
|
98893
|
-
|
|
98894
|
-
|
|
98922
|
+
join71(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
98923
|
+
join71(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
98895
98924
|
];
|
|
98896
98925
|
default:
|
|
98897
98926
|
return [];
|
|
@@ -98903,7 +98932,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
98903
98932
|
}
|
|
98904
98933
|
return [binaryPath, "--version"];
|
|
98905
98934
|
}
|
|
98906
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
98935
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync50) {
|
|
98907
98936
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
98908
98937
|
if (checkExists(desktopPath)) {
|
|
98909
98938
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -98911,7 +98940,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
98911
98940
|
}
|
|
98912
98941
|
return null;
|
|
98913
98942
|
}
|
|
98914
|
-
async function findOpenCodeBinary(platform = process.platform, checkExists =
|
|
98943
|
+
async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync50) {
|
|
98915
98944
|
for (const binary of OPENCODE_BINARIES2) {
|
|
98916
98945
|
const path14 = bunWhich(binary);
|
|
98917
98946
|
if (path14 && checkExists(path14)) {
|
|
@@ -98923,7 +98952,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
98923
98952
|
const candidates = getCommandCandidates2(platform);
|
|
98924
98953
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
98925
98954
|
for (const command of candidates) {
|
|
98926
|
-
const fullPath =
|
|
98955
|
+
const fullPath = join71(entry, command);
|
|
98927
98956
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
98928
98957
|
return { binary: command, path: fullPath };
|
|
98929
98958
|
}
|
|
@@ -98969,12 +98998,12 @@ function compareVersions3(current, minimum) {
|
|
|
98969
98998
|
|
|
98970
98999
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
98971
99000
|
init_shared();
|
|
98972
|
-
import { existsSync as
|
|
99001
|
+
import { existsSync as existsSync51, readFileSync as readFileSync31 } from "fs";
|
|
98973
99002
|
function detectConfigPath() {
|
|
98974
99003
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
98975
|
-
if (
|
|
99004
|
+
if (existsSync51(paths.configJsonc))
|
|
98976
99005
|
return paths.configJsonc;
|
|
98977
|
-
if (
|
|
99006
|
+
if (existsSync51(paths.configJson))
|
|
98978
99007
|
return paths.configJson;
|
|
98979
99008
|
return null;
|
|
98980
99009
|
}
|
|
@@ -99062,36 +99091,36 @@ init_file_utils2();
|
|
|
99062
99091
|
init_checker();
|
|
99063
99092
|
init_auto_update_checker();
|
|
99064
99093
|
init_package_json_locator();
|
|
99065
|
-
import { existsSync as
|
|
99094
|
+
import { existsSync as existsSync52, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "fs";
|
|
99066
99095
|
import { createRequire as createRequire2 } from "module";
|
|
99067
|
-
import { homedir as
|
|
99068
|
-
import { join as
|
|
99069
|
-
import { fileURLToPath as
|
|
99096
|
+
import { homedir as homedir15 } from "os";
|
|
99097
|
+
import { join as join72 } from "path";
|
|
99098
|
+
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
99070
99099
|
init_shared();
|
|
99071
99100
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
99072
99101
|
if (platform === "darwin")
|
|
99073
|
-
return
|
|
99102
|
+
return join72(homedir15(), "Library", "Caches");
|
|
99074
99103
|
if (platform === "win32")
|
|
99075
|
-
return process.env.LOCALAPPDATA ??
|
|
99076
|
-
return
|
|
99104
|
+
return process.env.LOCALAPPDATA ?? join72(homedir15(), "AppData", "Local");
|
|
99105
|
+
return join72(homedir15(), ".cache");
|
|
99077
99106
|
}
|
|
99078
99107
|
function resolveOpenCodeCacheDir() {
|
|
99079
99108
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
99080
99109
|
if (xdgCacheHome)
|
|
99081
|
-
return
|
|
99110
|
+
return join72(xdgCacheHome, "opencode");
|
|
99082
99111
|
const fromShared = getOpenCodeCacheDir();
|
|
99083
|
-
const platformDefault =
|
|
99084
|
-
if (
|
|
99112
|
+
const platformDefault = join72(getPlatformDefaultCacheDir(), "opencode");
|
|
99113
|
+
if (existsSync52(fromShared) || !existsSync52(platformDefault))
|
|
99085
99114
|
return fromShared;
|
|
99086
99115
|
return platformDefault;
|
|
99087
99116
|
}
|
|
99088
99117
|
function resolveExistingDir(dirPath) {
|
|
99089
|
-
if (!
|
|
99118
|
+
if (!existsSync52(dirPath))
|
|
99090
99119
|
return dirPath;
|
|
99091
99120
|
return resolveSymlink(dirPath);
|
|
99092
99121
|
}
|
|
99093
99122
|
function readPackageJson(filePath) {
|
|
99094
|
-
if (!
|
|
99123
|
+
if (!existsSync52(filePath))
|
|
99095
99124
|
return null;
|
|
99096
99125
|
try {
|
|
99097
99126
|
const content = readFileSync32(filePath, "utf-8");
|
|
@@ -99112,26 +99141,26 @@ function normalizeVersion(value) {
|
|
|
99112
99141
|
function createPackageCandidates(rootDir) {
|
|
99113
99142
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
99114
99143
|
packageName,
|
|
99115
|
-
installedPackagePath:
|
|
99144
|
+
installedPackagePath: join72(rootDir, "node_modules", packageName, "package.json")
|
|
99116
99145
|
}));
|
|
99117
99146
|
}
|
|
99118
99147
|
function createTaggedInstallCandidates(rootDir) {
|
|
99119
|
-
const packagesDir =
|
|
99120
|
-
if (!
|
|
99148
|
+
const packagesDir = join72(rootDir, "packages");
|
|
99149
|
+
if (!existsSync52(packagesDir))
|
|
99121
99150
|
return [];
|
|
99122
99151
|
const candidates = [];
|
|
99123
99152
|
for (const entryName of readdirSync8(packagesDir).sort()) {
|
|
99124
99153
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
99125
99154
|
if (packageName === undefined)
|
|
99126
99155
|
continue;
|
|
99127
|
-
const installDir =
|
|
99156
|
+
const installDir = join72(packagesDir, entryName);
|
|
99128
99157
|
candidates.push({
|
|
99129
99158
|
cacheDir: installDir,
|
|
99130
|
-
cachePackagePath:
|
|
99159
|
+
cachePackagePath: join72(installDir, "package.json"),
|
|
99131
99160
|
packageCandidates: [
|
|
99132
99161
|
{
|
|
99133
99162
|
packageName,
|
|
99134
|
-
installedPackagePath:
|
|
99163
|
+
installedPackagePath: join72(installDir, "node_modules", packageName, "package.json")
|
|
99135
99164
|
}
|
|
99136
99165
|
]
|
|
99137
99166
|
});
|
|
@@ -99139,7 +99168,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
99139
99168
|
return candidates;
|
|
99140
99169
|
}
|
|
99141
99170
|
function selectInstalledPackage(candidate) {
|
|
99142
|
-
return candidate.packageCandidates.find((packageCandidate) =>
|
|
99171
|
+
return candidate.packageCandidates.find((packageCandidate) => existsSync52(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
|
|
99143
99172
|
}
|
|
99144
99173
|
function getExpectedVersion(cachePackage, packageName) {
|
|
99145
99174
|
return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
|
|
@@ -99150,14 +99179,14 @@ function resolveInstalledPackageJsonPath() {
|
|
|
99150
99179
|
for (const packageName of ACCEPTED_PACKAGE_NAMES) {
|
|
99151
99180
|
try {
|
|
99152
99181
|
const packageJsonPath = require2.resolve(`${packageName}/package.json`);
|
|
99153
|
-
if (
|
|
99182
|
+
if (existsSync52(packageJsonPath)) {
|
|
99154
99183
|
return { packageName, packageJsonPath };
|
|
99155
99184
|
}
|
|
99156
99185
|
} catch {
|
|
99157
99186
|
continue;
|
|
99158
99187
|
}
|
|
99159
99188
|
}
|
|
99160
|
-
const ownPackageJsonPath = findPackageJsonUp(
|
|
99189
|
+
const ownPackageJsonPath = findPackageJsonUp(fileURLToPath6(import.meta.url));
|
|
99161
99190
|
if (ownPackageJsonPath) {
|
|
99162
99191
|
return { packageName: PACKAGE_NAME, packageJsonPath: ownPackageJsonPath };
|
|
99163
99192
|
}
|
|
@@ -99176,22 +99205,22 @@ function getLoadedPluginVersion() {
|
|
|
99176
99205
|
const candidates = [
|
|
99177
99206
|
{
|
|
99178
99207
|
cacheDir: configDir,
|
|
99179
|
-
cachePackagePath:
|
|
99208
|
+
cachePackagePath: join72(configDir, "package.json"),
|
|
99180
99209
|
packageCandidates: createPackageCandidates(configDir)
|
|
99181
99210
|
},
|
|
99182
99211
|
...createTaggedInstallCandidates(configDir),
|
|
99183
99212
|
{
|
|
99184
99213
|
cacheDir,
|
|
99185
|
-
cachePackagePath:
|
|
99214
|
+
cachePackagePath: join72(cacheDir, "package.json"),
|
|
99186
99215
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
99187
99216
|
},
|
|
99188
99217
|
...createTaggedInstallCandidates(cacheDir)
|
|
99189
99218
|
];
|
|
99190
|
-
const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) =>
|
|
99219
|
+
const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync52(packageCandidate.installedPackagePath))) ?? candidates[0];
|
|
99191
99220
|
const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
|
|
99192
99221
|
const selectedPackage = selectInstalledPackage(selectedCandidate);
|
|
99193
99222
|
const candidateInstalledPath = selectedPackage.installedPackagePath;
|
|
99194
|
-
const candidateExists =
|
|
99223
|
+
const candidateExists = existsSync52(candidateInstalledPath);
|
|
99195
99224
|
const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
|
|
99196
99225
|
const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
|
|
99197
99226
|
const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
|
|
@@ -99227,7 +99256,7 @@ var defaultDeps6 = {
|
|
|
99227
99256
|
getLoadedPluginVersion,
|
|
99228
99257
|
getLatestPluginVersion,
|
|
99229
99258
|
getSuggestedInstallTag,
|
|
99230
|
-
configExists:
|
|
99259
|
+
configExists: existsSync53,
|
|
99231
99260
|
readConfigFile: (path14) => readFileSync33(path14, "utf-8"),
|
|
99232
99261
|
parseConfigContent: (content) => parseJsonc(content)
|
|
99233
99262
|
};
|
|
@@ -99374,12 +99403,12 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
99374
99403
|
// packages/omo-opencode/src/config/validate.ts
|
|
99375
99404
|
init_src();
|
|
99376
99405
|
import { readFileSync as readFileSync34 } from "fs";
|
|
99377
|
-
import { homedir as
|
|
99378
|
-
import { dirname as
|
|
99406
|
+
import { homedir as homedir16 } from "os";
|
|
99407
|
+
import { dirname as dirname28, relative as relative9 } from "path";
|
|
99379
99408
|
init_shared();
|
|
99380
99409
|
init_plugin_identity();
|
|
99381
99410
|
function resolveHomeDirectory2() {
|
|
99382
|
-
return process.env.HOME ?? process.env.USERPROFILE ??
|
|
99411
|
+
return process.env.HOME ?? process.env.USERPROFILE ?? homedir16();
|
|
99383
99412
|
}
|
|
99384
99413
|
function discoverConfigInDirectory(configDir) {
|
|
99385
99414
|
const detected = detectPluginConfigFile(configDir, {
|
|
@@ -99399,7 +99428,7 @@ function discoverProjectLayersNearestFirst(directory) {
|
|
|
99399
99428
|
const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
|
|
99400
99429
|
return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
|
|
99401
99430
|
path: configPath,
|
|
99402
|
-
configDir:
|
|
99431
|
+
configDir: dirname28(configPath)
|
|
99403
99432
|
}));
|
|
99404
99433
|
}
|
|
99405
99434
|
function shortPath(configPath) {
|
|
@@ -99423,7 +99452,7 @@ function parseLayerConfig(configPath) {
|
|
|
99423
99452
|
if (!isPlainRecord(rawConfig)) {
|
|
99424
99453
|
return {
|
|
99425
99454
|
path: configPath,
|
|
99426
|
-
configDir:
|
|
99455
|
+
configDir: dirname28(configPath),
|
|
99427
99456
|
config: null,
|
|
99428
99457
|
messages: [`${shortPath(configPath)}: <root>: Expected object`]
|
|
99429
99458
|
};
|
|
@@ -99431,7 +99460,7 @@ function parseLayerConfig(configPath) {
|
|
|
99431
99460
|
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
99432
99461
|
return {
|
|
99433
99462
|
path: configPath,
|
|
99434
|
-
configDir:
|
|
99463
|
+
configDir: dirname28(configPath),
|
|
99435
99464
|
config: result.success ? result.data : parseConfigPartially(rawConfig),
|
|
99436
99465
|
messages: schemaMessages(configPath, rawConfig)
|
|
99437
99466
|
};
|
|
@@ -99441,7 +99470,7 @@ function parseLayerConfig(configPath) {
|
|
|
99441
99470
|
}
|
|
99442
99471
|
return {
|
|
99443
99472
|
path: configPath,
|
|
99444
|
-
configDir:
|
|
99473
|
+
configDir: dirname28(configPath),
|
|
99445
99474
|
config: null,
|
|
99446
99475
|
messages: [`${shortPath(configPath)}: ${error51.message}`]
|
|
99447
99476
|
};
|
|
@@ -99487,23 +99516,23 @@ function validatePluginConfig(directory) {
|
|
|
99487
99516
|
|
|
99488
99517
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
99489
99518
|
init_shared();
|
|
99490
|
-
import { existsSync as
|
|
99491
|
-
import { homedir as
|
|
99492
|
-
import { join as
|
|
99519
|
+
import { existsSync as existsSync54, readFileSync as readFileSync35 } from "fs";
|
|
99520
|
+
import { homedir as homedir17 } from "os";
|
|
99521
|
+
import { join as join73 } from "path";
|
|
99493
99522
|
function getUserConfigDir2() {
|
|
99494
99523
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
99495
99524
|
if (xdgConfig)
|
|
99496
|
-
return
|
|
99497
|
-
return
|
|
99525
|
+
return join73(xdgConfig, "opencode");
|
|
99526
|
+
return join73(homedir17(), ".config", "opencode");
|
|
99498
99527
|
}
|
|
99499
99528
|
function loadCustomProviderNames() {
|
|
99500
99529
|
const configDir = getUserConfigDir2();
|
|
99501
99530
|
const candidatePaths = [
|
|
99502
|
-
|
|
99503
|
-
|
|
99531
|
+
join73(configDir, "opencode.json"),
|
|
99532
|
+
join73(configDir, "opencode.jsonc")
|
|
99504
99533
|
];
|
|
99505
99534
|
for (const configPath of candidatePaths) {
|
|
99506
|
-
if (!
|
|
99535
|
+
if (!existsSync54(configPath))
|
|
99507
99536
|
continue;
|
|
99508
99537
|
try {
|
|
99509
99538
|
const content = readFileSync35(configPath, "utf-8");
|
|
@@ -99521,9 +99550,9 @@ function loadCustomProviderNames() {
|
|
|
99521
99550
|
return [];
|
|
99522
99551
|
}
|
|
99523
99552
|
function loadAvailableModelsFromCache() {
|
|
99524
|
-
const cacheFile =
|
|
99553
|
+
const cacheFile = join73(getOpenCodeCacheDir(), "models.json");
|
|
99525
99554
|
const customProviders = loadCustomProviderNames();
|
|
99526
|
-
if (!
|
|
99555
|
+
if (!existsSync54(cacheFile)) {
|
|
99527
99556
|
if (customProviders.length > 0) {
|
|
99528
99557
|
return { providers: customProviders, modelCount: 0, cacheExists: true };
|
|
99529
99558
|
}
|
|
@@ -99558,8 +99587,8 @@ init_model_capabilities2();
|
|
|
99558
99587
|
init_shared();
|
|
99559
99588
|
init_plugin_identity();
|
|
99560
99589
|
import { readFileSync as readFileSync36 } from "fs";
|
|
99561
|
-
import { join as
|
|
99562
|
-
var PROJECT_CONFIG_DIR =
|
|
99590
|
+
import { join as join74 } from "path";
|
|
99591
|
+
var PROJECT_CONFIG_DIR = join74(process.cwd(), ".opencode");
|
|
99563
99592
|
function loadOmoConfig() {
|
|
99564
99593
|
const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR, {
|
|
99565
99594
|
basenames: [CONFIG_BASENAME],
|
|
@@ -99597,7 +99626,7 @@ function loadOmoConfig() {
|
|
|
99597
99626
|
|
|
99598
99627
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
99599
99628
|
init_shared();
|
|
99600
|
-
import { join as
|
|
99629
|
+
import { join as join75 } from "path";
|
|
99601
99630
|
|
|
99602
99631
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
99603
99632
|
function formatModelWithVariant(model, variant) {
|
|
@@ -99639,7 +99668,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
99639
99668
|
}
|
|
99640
99669
|
function buildModelResolutionDetails(options) {
|
|
99641
99670
|
const details = [];
|
|
99642
|
-
const cacheFile =
|
|
99671
|
+
const cacheFile = join75(getOpenCodeCacheDir(), "models.json");
|
|
99643
99672
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
99644
99673
|
details.push("");
|
|
99645
99674
|
if (options.available.cacheExists) {
|
|
@@ -99915,28 +99944,28 @@ async function checkConfig() {
|
|
|
99915
99944
|
|
|
99916
99945
|
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
99917
99946
|
init_src();
|
|
99918
|
-
import { existsSync as
|
|
99947
|
+
import { existsSync as existsSync55 } from "fs";
|
|
99919
99948
|
import { createRequire as createRequire3 } from "module";
|
|
99920
|
-
import { homedir as
|
|
99921
|
-
import { dirname as
|
|
99949
|
+
import { homedir as homedir19 } from "os";
|
|
99950
|
+
import { dirname as dirname29, join as join77 } from "path";
|
|
99922
99951
|
|
|
99923
99952
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
99924
|
-
import { join as
|
|
99925
|
-
import { homedir as
|
|
99953
|
+
import { join as join76 } from "path";
|
|
99954
|
+
import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
|
|
99926
99955
|
init_binary_downloader();
|
|
99927
99956
|
init_logger2();
|
|
99928
99957
|
init_plugin_identity();
|
|
99929
99958
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
99930
|
-
var DEBUG_FILE =
|
|
99959
|
+
var DEBUG_FILE = join76(tmpdir3(), "comment-checker-debug.log");
|
|
99931
99960
|
function getCacheDir2() {
|
|
99932
99961
|
if (process.platform === "win32") {
|
|
99933
99962
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
99934
|
-
const base2 = localAppData ||
|
|
99935
|
-
return
|
|
99963
|
+
const base2 = localAppData || join76(homedir18(), "AppData", "Local");
|
|
99964
|
+
return join76(base2, CACHE_DIR_NAME, "bin");
|
|
99936
99965
|
}
|
|
99937
99966
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
99938
|
-
const base = xdgCache ||
|
|
99939
|
-
return
|
|
99967
|
+
const base = xdgCache || join76(homedir18(), ".cache");
|
|
99968
|
+
return join76(base, CACHE_DIR_NAME, "bin");
|
|
99940
99969
|
}
|
|
99941
99970
|
function getBinaryName() {
|
|
99942
99971
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -99986,7 +100015,7 @@ async function getBinaryVersion(binary) {
|
|
|
99986
100015
|
}
|
|
99987
100016
|
}
|
|
99988
100017
|
async function checkAstGrepCli() {
|
|
99989
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
100018
|
+
const runtimeDir = astGrepRuntimeDir(join77(homedir19(), ".omo"));
|
|
99990
100019
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
99991
100020
|
if (sgPath === null) {
|
|
99992
100021
|
return {
|
|
@@ -100015,12 +100044,12 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
100015
100044
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
100016
100045
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
100017
100046
|
try {
|
|
100018
|
-
const packageDir = baseDirOverride ??
|
|
100019
|
-
const vendorPath =
|
|
100020
|
-
if (
|
|
100047
|
+
const packageDir = baseDirOverride ?? dirname29(resolvePackageJsonPath());
|
|
100048
|
+
const vendorPath = join77(packageDir, "vendor", platformKey, binaryName);
|
|
100049
|
+
if (existsSync55(vendorPath))
|
|
100021
100050
|
return vendorPath;
|
|
100022
|
-
const binPath =
|
|
100023
|
-
if (
|
|
100051
|
+
const binPath = join77(packageDir, "bin", binaryName);
|
|
100052
|
+
if (existsSync55(binPath))
|
|
100024
100053
|
return binPath;
|
|
100025
100054
|
} catch (error51) {
|
|
100026
100055
|
if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
|
|
@@ -100165,12 +100194,12 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
100165
100194
|
|
|
100166
100195
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
100167
100196
|
import { readFileSync as readFileSync37 } from "fs";
|
|
100168
|
-
import { join as
|
|
100197
|
+
import { join as join78 } from "path";
|
|
100169
100198
|
|
|
100170
100199
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
100171
|
-
import { existsSync as
|
|
100172
|
-
import { delimiter as delimiter3, dirname as
|
|
100173
|
-
import { fileURLToPath as
|
|
100200
|
+
import { existsSync as existsSync56 } from "fs";
|
|
100201
|
+
import { delimiter as delimiter3, dirname as dirname30, resolve as resolve21 } from "path";
|
|
100202
|
+
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
100174
100203
|
|
|
100175
100204
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
100176
100205
|
function normalizeCliPath(path14) {
|
|
@@ -100216,7 +100245,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
|
|
|
100216
100245
|
}
|
|
100217
100246
|
|
|
100218
100247
|
// packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
|
|
100219
|
-
import { resolve as
|
|
100248
|
+
import { resolve as resolve20 } from "path";
|
|
100220
100249
|
function resolveJavaScriptRuntime(resolveExecutable) {
|
|
100221
100250
|
const node = resolveExecutable("node");
|
|
100222
100251
|
return node.available ? node : resolveExecutable("bun");
|
|
@@ -100224,9 +100253,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
|
|
|
100224
100253
|
function createAncestorCliCandidates(options) {
|
|
100225
100254
|
const candidates = [];
|
|
100226
100255
|
const seenPaths = new Set;
|
|
100227
|
-
let currentDirectory =
|
|
100256
|
+
let currentDirectory = resolve20(options.startDirectory);
|
|
100228
100257
|
while (true) {
|
|
100229
|
-
const distCliPath =
|
|
100258
|
+
const distCliPath = resolve20(currentDirectory, options.packageRel, options.distCliRel);
|
|
100230
100259
|
if (!seenPaths.has(distCliPath)) {
|
|
100231
100260
|
const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
|
|
100232
100261
|
seenPaths.add(distCliPath);
|
|
@@ -100238,7 +100267,7 @@ function createAncestorCliCandidates(options) {
|
|
|
100238
100267
|
runtimeAvailable: runtime5.available
|
|
100239
100268
|
});
|
|
100240
100269
|
}
|
|
100241
|
-
const sourceCliPath =
|
|
100270
|
+
const sourceCliPath = resolve20(currentDirectory, options.packageRel, options.sourceCliRel);
|
|
100242
100271
|
if (!seenPaths.has(sourceCliPath)) {
|
|
100243
100272
|
const runtime5 = options.resolveExecutable("bun");
|
|
100244
100273
|
const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
|
|
@@ -100255,7 +100284,7 @@ function createAncestorCliCandidates(options) {
|
|
|
100255
100284
|
runtimeAvailable: runtime5.available
|
|
100256
100285
|
});
|
|
100257
100286
|
}
|
|
100258
|
-
const parentDirectory =
|
|
100287
|
+
const parentDirectory = resolve20(currentDirectory, "..");
|
|
100259
100288
|
if (parentDirectory === currentDirectory)
|
|
100260
100289
|
return candidates;
|
|
100261
100290
|
currentDirectory = parentDirectory;
|
|
@@ -100291,7 +100320,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
100291
100320
|
].join(";");
|
|
100292
100321
|
function getModuleDirectory(moduleUrl) {
|
|
100293
100322
|
try {
|
|
100294
|
-
return
|
|
100323
|
+
return dirname30(fileURLToPath7(moduleUrl));
|
|
100295
100324
|
} catch (error51) {
|
|
100296
100325
|
if (!(error51 instanceof Error))
|
|
100297
100326
|
throw error51;
|
|
@@ -100299,23 +100328,23 @@ function getModuleDirectory(moduleUrl) {
|
|
|
100299
100328
|
}
|
|
100300
100329
|
}
|
|
100301
100330
|
function findBootstrapRoot(candidates, pathExists) {
|
|
100302
|
-
return candidates.find((candidate) => pathExists(
|
|
100331
|
+
return candidates.find((candidate) => pathExists(resolve21(candidate.root, "package.json")))?.root ?? process.cwd();
|
|
100303
100332
|
}
|
|
100304
100333
|
function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
100305
100334
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
100306
100335
|
const bun = resolveExecutable("bun");
|
|
100307
100336
|
const npm = resolveExecutable("npm");
|
|
100308
|
-
const packageManifestPath =
|
|
100337
|
+
const packageManifestPath = resolve21(root, PACKAGE_REL, "package.json");
|
|
100309
100338
|
return {
|
|
100310
100339
|
command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
|
|
100311
100340
|
root,
|
|
100312
|
-
path:
|
|
100341
|
+
path: resolve21(root, PACKAGE_REL, DIST_CLI_REL),
|
|
100313
100342
|
exists: runtime5.available && npm.available && pathExists(packageManifestPath),
|
|
100314
100343
|
runtimeAvailable: runtime5.available
|
|
100315
100344
|
};
|
|
100316
100345
|
}
|
|
100317
100346
|
function resolveLspCommand(options = {}) {
|
|
100318
|
-
const pathExists = options.exists ??
|
|
100347
|
+
const pathExists = options.exists ?? existsSync56;
|
|
100319
100348
|
const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
|
|
100320
100349
|
const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
|
|
100321
100350
|
const candidates = moduleDirectory ? createAncestorCliCandidates({
|
|
@@ -100325,7 +100354,7 @@ function resolveLspCommand(options = {}) {
|
|
|
100325
100354
|
sourceCliRel: SOURCE_CLI_REL,
|
|
100326
100355
|
pathExists,
|
|
100327
100356
|
resolveExecutable,
|
|
100328
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(
|
|
100357
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL))
|
|
100329
100358
|
}) : [];
|
|
100330
100359
|
const distCandidate = candidates.find((candidate) => hasCliSuffix(candidate.path, DIST_CLI_REL) && candidate.exists);
|
|
100331
100360
|
if (distCandidate) {
|
|
@@ -100372,7 +100401,7 @@ function readOmoConfig(configDirectory) {
|
|
|
100372
100401
|
}
|
|
100373
100402
|
function isLspMcpDisabled(options) {
|
|
100374
100403
|
const userConfigDirectory = options.configDirectory ?? getOpenCodeConfigDir({ binary: "opencode" });
|
|
100375
|
-
const projectConfigDirectory =
|
|
100404
|
+
const projectConfigDirectory = join78(options.cwd ?? process.cwd(), ".opencode");
|
|
100376
100405
|
const userConfig = readOmoConfig(userConfigDirectory);
|
|
100377
100406
|
const projectConfig = readOmoConfig(projectConfigDirectory);
|
|
100378
100407
|
const disabledMcps = new Set([
|
|
@@ -100391,21 +100420,21 @@ function getInstalledLspServers(options = {}) {
|
|
|
100391
100420
|
|
|
100392
100421
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
100393
100422
|
init_shared();
|
|
100394
|
-
import { existsSync as
|
|
100395
|
-
import { homedir as
|
|
100396
|
-
import { join as
|
|
100423
|
+
import { existsSync as existsSync57, readFileSync as readFileSync38 } from "fs";
|
|
100424
|
+
import { homedir as homedir20 } from "os";
|
|
100425
|
+
import { join as join79 } from "path";
|
|
100397
100426
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
100398
100427
|
function getMcpConfigPaths() {
|
|
100399
100428
|
return [
|
|
100400
|
-
|
|
100401
|
-
|
|
100402
|
-
|
|
100429
|
+
join79(homedir20(), ".claude", ".mcp.json"),
|
|
100430
|
+
join79(process.cwd(), ".mcp.json"),
|
|
100431
|
+
join79(process.cwd(), ".claude", ".mcp.json")
|
|
100403
100432
|
];
|
|
100404
100433
|
}
|
|
100405
100434
|
function loadUserMcpConfig() {
|
|
100406
100435
|
const servers = {};
|
|
100407
100436
|
for (const configPath of getMcpConfigPaths()) {
|
|
100408
|
-
if (!
|
|
100437
|
+
if (!existsSync57(configPath))
|
|
100409
100438
|
continue;
|
|
100410
100439
|
try {
|
|
100411
100440
|
const content = readFileSync38(configPath, "utf-8");
|
|
@@ -100543,12 +100572,12 @@ async function checkTools() {
|
|
|
100543
100572
|
|
|
100544
100573
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
100545
100574
|
init_src4();
|
|
100546
|
-
import { existsSync as
|
|
100575
|
+
import { existsSync as existsSync58, readFileSync as readFileSync39 } from "fs";
|
|
100547
100576
|
function isTelemetryState(value) {
|
|
100548
100577
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
100549
100578
|
}
|
|
100550
100579
|
function readLastActiveDay(stateFilePath) {
|
|
100551
|
-
if (!
|
|
100580
|
+
if (!existsSync58(stateFilePath)) {
|
|
100552
100581
|
return "never";
|
|
100553
100582
|
}
|
|
100554
100583
|
let parsed;
|
|
@@ -100611,17 +100640,17 @@ async function probeBinary(cmd, args, spawnImpl) {
|
|
|
100611
100640
|
}
|
|
100612
100641
|
|
|
100613
100642
|
// packages/team-core/src/team-registry/paths.ts
|
|
100614
|
-
import { homedir as
|
|
100643
|
+
import { homedir as homedir21 } from "os";
|
|
100615
100644
|
import path14 from "path";
|
|
100616
100645
|
function resolveBaseDir(config3) {
|
|
100617
|
-
return expandHomeDirectory(config3.base_dir ?? path14.join(
|
|
100646
|
+
return expandHomeDirectory(config3.base_dir ?? path14.join(homedir21(), ".omo"));
|
|
100618
100647
|
}
|
|
100619
100648
|
function expandHomeDirectory(directoryPath) {
|
|
100620
100649
|
if (directoryPath === "~") {
|
|
100621
|
-
return
|
|
100650
|
+
return homedir21();
|
|
100622
100651
|
}
|
|
100623
100652
|
if (directoryPath.startsWith("~/") || directoryPath.startsWith("~\\")) {
|
|
100624
|
-
return path14.join(
|
|
100653
|
+
return path14.join(homedir21(), directoryPath.slice(2));
|
|
100625
100654
|
}
|
|
100626
100655
|
return directoryPath;
|
|
100627
100656
|
}
|
|
@@ -100698,10 +100727,10 @@ async function pathExists(dir) {
|
|
|
100698
100727
|
|
|
100699
100728
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
100700
100729
|
init_src();
|
|
100701
|
-
import { existsSync as
|
|
100702
|
-
import { lstat as lstat12, readdir as readdir10, readFile as
|
|
100703
|
-
import { homedir as
|
|
100704
|
-
import { basename as basename13, join as
|
|
100730
|
+
import { existsSync as existsSync59 } from "fs";
|
|
100731
|
+
import { lstat as lstat12, readdir as readdir10, readFile as readFile23 } from "fs/promises";
|
|
100732
|
+
import { homedir as homedir22 } from "os";
|
|
100733
|
+
import { basename as basename13, join as join80, resolve as resolve22 } from "path";
|
|
100705
100734
|
// packages/omo-opencode/package.json
|
|
100706
100735
|
var package_default3 = {
|
|
100707
100736
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -100759,13 +100788,13 @@ var CODEX_BIN_NAMES = [
|
|
|
100759
100788
|
"omo-git-bash-hook"
|
|
100760
100789
|
];
|
|
100761
100790
|
async function gatherCodexSummary(deps = {}) {
|
|
100762
|
-
const codexHome =
|
|
100791
|
+
const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join80(homedir22(), ".codex"));
|
|
100763
100792
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
100764
100793
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
100765
100794
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
100766
|
-
const manifest = pluginRoot === null ? null : await readJson(
|
|
100767
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
100768
|
-
const configPath =
|
|
100795
|
+
const manifest = pluginRoot === null ? null : await readJson(join80(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
100796
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join80(pluginRoot, "lazycodex-install.json"));
|
|
100797
|
+
const configPath = join80(codexHome, "config.toml");
|
|
100769
100798
|
const pluginVersion = stringField(manifest, "version");
|
|
100770
100799
|
return {
|
|
100771
100800
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -100822,7 +100851,7 @@ function buildCodexIssues(summary) {
|
|
|
100822
100851
|
if (summary.pluginRoot === null) {
|
|
100823
100852
|
issues.push({
|
|
100824
100853
|
title: "OMO Codex plugin is not installed",
|
|
100825
|
-
description: `Expected cached plugin at ${
|
|
100854
|
+
description: `Expected cached plugin at ${join80("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
100826
100855
|
fix: "Run: npx lazycodex-ai install",
|
|
100827
100856
|
severity: "error",
|
|
100828
100857
|
affects: ["plugin loading"]
|
|
@@ -100887,15 +100916,15 @@ function buildCodexIssues(summary) {
|
|
|
100887
100916
|
return issues;
|
|
100888
100917
|
}
|
|
100889
100918
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
100890
|
-
const pluginRoot =
|
|
100891
|
-
if (!
|
|
100919
|
+
const pluginRoot = join80(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
100920
|
+
if (!existsSync59(pluginRoot))
|
|
100892
100921
|
return null;
|
|
100893
100922
|
const versions2 = await readdir10(pluginRoot, { withFileTypes: true });
|
|
100894
100923
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
100895
|
-
return candidates.length === 0 ? null :
|
|
100924
|
+
return candidates.length === 0 ? null : join80(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
100896
100925
|
}
|
|
100897
100926
|
async function readCodexConfigSummary(configPath) {
|
|
100898
|
-
if (!
|
|
100927
|
+
if (!existsSync59(configPath)) {
|
|
100899
100928
|
return {
|
|
100900
100929
|
exists: false,
|
|
100901
100930
|
marketplaceConfigured: false,
|
|
@@ -100906,7 +100935,7 @@ async function readCodexConfigSummary(configPath) {
|
|
|
100906
100935
|
companionLifecycleHookStateEvents: []
|
|
100907
100936
|
};
|
|
100908
100937
|
}
|
|
100909
|
-
const content = await
|
|
100938
|
+
const content = await readFile23(configPath, "utf8");
|
|
100910
100939
|
return {
|
|
100911
100940
|
exists: true,
|
|
100912
100941
|
marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
|
|
@@ -100920,21 +100949,21 @@ async function readCodexConfigSummary(configPath) {
|
|
|
100920
100949
|
async function readLinkedBins(binDir) {
|
|
100921
100950
|
const linked = [];
|
|
100922
100951
|
for (const name of CODEX_BIN_NAMES) {
|
|
100923
|
-
if (await pathExists2(
|
|
100952
|
+
if (await pathExists2(join80(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
100924
100953
|
linked.push(name);
|
|
100925
100954
|
}
|
|
100926
100955
|
return linked;
|
|
100927
100956
|
}
|
|
100928
100957
|
async function readLinkedAgents(codexHome) {
|
|
100929
|
-
const agentsDir =
|
|
100930
|
-
if (!
|
|
100958
|
+
const agentsDir = join80(codexHome, "agents");
|
|
100959
|
+
if (!existsSync59(agentsDir))
|
|
100931
100960
|
return [];
|
|
100932
100961
|
const entries = await readdir10(agentsDir, { withFileTypes: true });
|
|
100933
100962
|
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
|
|
100934
100963
|
}
|
|
100935
100964
|
async function readJson(path16) {
|
|
100936
100965
|
try {
|
|
100937
|
-
const parsed = JSON.parse(await
|
|
100966
|
+
const parsed = JSON.parse(await readFile23(path16, "utf8"));
|
|
100938
100967
|
return isPlainRecord(parsed) ? parsed : null;
|
|
100939
100968
|
} catch (error51) {
|
|
100940
100969
|
if (error51 instanceof Error)
|
|
@@ -101040,9 +101069,9 @@ async function pathExists2(path16) {
|
|
|
101040
101069
|
|
|
101041
101070
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
101042
101071
|
init_src();
|
|
101043
|
-
import { readdir as readdir11, readFile as
|
|
101044
|
-
import { homedir as
|
|
101045
|
-
import { dirname as
|
|
101072
|
+
import { readdir as readdir11, readFile as readFile24, stat as stat6 } from "fs/promises";
|
|
101073
|
+
import { homedir as homedir23 } from "os";
|
|
101074
|
+
import { dirname as dirname31, isAbsolute as isAbsolute12, join as join81, relative as relative10, resolve as resolve23, sep as sep9 } from "path";
|
|
101046
101075
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
101047
101076
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
101048
101077
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -101052,7 +101081,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
101052
101081
|
const env3 = deps.env ?? process.env;
|
|
101053
101082
|
const platform = deps.platform ?? process.platform;
|
|
101054
101083
|
const arch = deps.arch ?? process.arch;
|
|
101055
|
-
const codexHome =
|
|
101084
|
+
const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join81(homedir23(), ".codex"));
|
|
101056
101085
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
101057
101086
|
if (summary.pluginRoot === null) {
|
|
101058
101087
|
return {
|
|
@@ -101077,7 +101106,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
101077
101106
|
});
|
|
101078
101107
|
}
|
|
101079
101108
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
101080
|
-
const runtimeSgPath =
|
|
101109
|
+
const runtimeSgPath = join81(runtimeSgDir, sgBinaryName(platform));
|
|
101081
101110
|
const sg = findSgBinarySync({
|
|
101082
101111
|
arch,
|
|
101083
101112
|
env: env3,
|
|
@@ -101116,8 +101145,8 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
101116
101145
|
const manifest = await readJson2(manifestPath);
|
|
101117
101146
|
if (manifest === null || !isRecord5(manifest["mcpServers"]))
|
|
101118
101147
|
continue;
|
|
101119
|
-
const manifestRoot =
|
|
101120
|
-
const isRootManifest =
|
|
101148
|
+
const manifestRoot = dirname31(manifestPath);
|
|
101149
|
+
const isRootManifest = resolve23(manifestRoot) === resolve23(pluginRoot);
|
|
101121
101150
|
for (const server2 of Object.values(manifest["mcpServers"])) {
|
|
101122
101151
|
if (!isRecord5(server2) || !Array.isArray(server2["args"]))
|
|
101123
101152
|
continue;
|
|
@@ -101137,7 +101166,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
101137
101166
|
continue;
|
|
101138
101167
|
const commands2 = [];
|
|
101139
101168
|
collectHookCommands(manifest, commands2);
|
|
101140
|
-
const hookPluginRoot =
|
|
101169
|
+
const hookPluginRoot = dirname31(dirname31(hookManifestPath));
|
|
101141
101170
|
for (const command of commands2) {
|
|
101142
101171
|
for (const relativePath of extractPluginRootPaths(command)) {
|
|
101143
101172
|
referencedCount += 1;
|
|
@@ -101159,8 +101188,8 @@ function recordBrokenTarget(broken, classified, origin) {
|
|
|
101159
101188
|
broken.push(entry);
|
|
101160
101189
|
}
|
|
101161
101190
|
async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
|
|
101162
|
-
const targetPath =
|
|
101163
|
-
const bundleRootPath =
|
|
101191
|
+
const targetPath = resolve23(baseRoot, relativePath);
|
|
101192
|
+
const bundleRootPath = resolve23(bundleRoot);
|
|
101164
101193
|
const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
|
|
101165
101194
|
if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
|
|
101166
101195
|
if (allowEscape)
|
|
@@ -101176,7 +101205,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
|
|
|
101176
101205
|
}
|
|
101177
101206
|
async function findHookManifestPaths(root) {
|
|
101178
101207
|
const paths2 = await findManifestPaths(root, "hooks.json");
|
|
101179
|
-
return paths2.filter((path16) =>
|
|
101208
|
+
return paths2.filter((path16) => dirname31(path16).endsWith(`${sep9}hooks`));
|
|
101180
101209
|
}
|
|
101181
101210
|
async function findManifestPaths(root, manifestName) {
|
|
101182
101211
|
let entries;
|
|
@@ -101189,7 +101218,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
101189
101218
|
for (const entry of entries) {
|
|
101190
101219
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
101191
101220
|
continue;
|
|
101192
|
-
const entryPath =
|
|
101221
|
+
const entryPath = join81(root, entry.name);
|
|
101193
101222
|
if (entry.isDirectory()) {
|
|
101194
101223
|
paths2.push(...await findManifestPaths(entryPath, manifestName));
|
|
101195
101224
|
continue;
|
|
@@ -101233,18 +101262,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
101233
101262
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
101234
101263
|
}
|
|
101235
101264
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
101236
|
-
return
|
|
101265
|
+
return join81(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
101237
101266
|
}
|
|
101238
101267
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
101239
101268
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
101240
101269
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
101241
101270
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
101242
|
-
if (sgPath ===
|
|
101271
|
+
if (sgPath === join81(runtimeSgDir, sgBinaryName(platform)))
|
|
101243
101272
|
return "runtime dir";
|
|
101244
101273
|
return "PATH";
|
|
101245
101274
|
}
|
|
101246
101275
|
async function readBootstrapStateSummary(codexHome) {
|
|
101247
|
-
const statePath =
|
|
101276
|
+
const statePath = join81(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
101248
101277
|
const raw = await readJson2(statePath);
|
|
101249
101278
|
if (raw === null)
|
|
101250
101279
|
return null;
|
|
@@ -101293,7 +101322,7 @@ function degradedDetailLines(entries) {
|
|
|
101293
101322
|
}
|
|
101294
101323
|
async function readJson2(path16) {
|
|
101295
101324
|
try {
|
|
101296
|
-
const parsed = JSON.parse(await
|
|
101325
|
+
const parsed = JSON.parse(await readFile24(path16, "utf8"));
|
|
101297
101326
|
return isRecord5(parsed) ? parsed : null;
|
|
101298
101327
|
} catch (error51) {
|
|
101299
101328
|
if (error51 instanceof Error)
|
|
@@ -101320,23 +101349,23 @@ function isRecord5(value) {
|
|
|
101320
101349
|
}
|
|
101321
101350
|
|
|
101322
101351
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
101323
|
-
import { existsSync as
|
|
101324
|
-
import { readFile as
|
|
101325
|
-
import { homedir as
|
|
101326
|
-
import { join as
|
|
101352
|
+
import { existsSync as existsSync60 } from "fs";
|
|
101353
|
+
import { readFile as readFile25 } from "fs/promises";
|
|
101354
|
+
import { homedir as homedir24 } from "os";
|
|
101355
|
+
import { join as join82, resolve as resolve24 } from "path";
|
|
101327
101356
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
101328
101357
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
101329
101358
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
101330
101359
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
101331
|
-
const codexHome =
|
|
101360
|
+
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir24(), ".codex"));
|
|
101332
101361
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
101333
101362
|
const platform = deps.platform ?? process.platform;
|
|
101334
|
-
const wrapperPath =
|
|
101363
|
+
const wrapperPath = join82(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
101335
101364
|
const wrapper = await readRuntimeWrapper(wrapperPath);
|
|
101336
101365
|
const issues = [];
|
|
101337
101366
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
101338
101367
|
const targetPath = parseRuntimeTargetPath(wrapper);
|
|
101339
|
-
if (targetPath !== null && !
|
|
101368
|
+
if (targetPath !== null && !existsSync60(targetPath)) {
|
|
101340
101369
|
issues.push({
|
|
101341
101370
|
title: "omo runtime wrapper target is missing",
|
|
101342
101371
|
description: `Generated omo runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
|
|
@@ -101356,7 +101385,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
|
|
|
101356
101385
|
}
|
|
101357
101386
|
async function readRuntimeWrapper(path16) {
|
|
101358
101387
|
try {
|
|
101359
|
-
return await
|
|
101388
|
+
return await readFile25(path16, "utf8");
|
|
101360
101389
|
} catch (error51) {
|
|
101361
101390
|
if (error51 instanceof Error)
|
|
101362
101391
|
return null;
|
|
@@ -101835,7 +101864,7 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
101835
101864
|
import { createHash as createHash4 } from "crypto";
|
|
101836
101865
|
import {
|
|
101837
101866
|
chmodSync as chmodSync4,
|
|
101838
|
-
existsSync as
|
|
101867
|
+
existsSync as existsSync63,
|
|
101839
101868
|
mkdirSync as mkdirSync14,
|
|
101840
101869
|
readdirSync as readdirSync9,
|
|
101841
101870
|
readFileSync as readFileSync42,
|
|
@@ -101843,15 +101872,15 @@ import {
|
|
|
101843
101872
|
unlinkSync as unlinkSync8,
|
|
101844
101873
|
writeFileSync as writeFileSync11
|
|
101845
101874
|
} from "fs";
|
|
101846
|
-
import { basename as basename14, dirname as
|
|
101875
|
+
import { basename as basename14, dirname as dirname32, join as join85 } from "path";
|
|
101847
101876
|
|
|
101848
101877
|
// packages/mcp-client-core/src/config-dir.ts
|
|
101849
|
-
import { existsSync as
|
|
101850
|
-
import { homedir as
|
|
101851
|
-
import { join as
|
|
101878
|
+
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
|
|
101879
|
+
import { homedir as homedir25 } from "os";
|
|
101880
|
+
import { join as join83, resolve as resolve25 } from "path";
|
|
101852
101881
|
function resolveConfigPath2(pathValue) {
|
|
101853
|
-
const resolvedPath =
|
|
101854
|
-
if (!
|
|
101882
|
+
const resolvedPath = resolve25(pathValue);
|
|
101883
|
+
if (!existsSync61(resolvedPath))
|
|
101855
101884
|
return resolvedPath;
|
|
101856
101885
|
try {
|
|
101857
101886
|
return realpathSync8(resolvedPath);
|
|
@@ -101866,13 +101895,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
101866
101895
|
if (customConfigDir) {
|
|
101867
101896
|
return resolveConfigPath2(customConfigDir);
|
|
101868
101897
|
}
|
|
101869
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
101870
|
-
return resolveConfigPath2(
|
|
101898
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join83(homedir25(), ".config");
|
|
101899
|
+
return resolveConfigPath2(join83(xdgConfigDir, "opencode"));
|
|
101871
101900
|
}
|
|
101872
101901
|
|
|
101873
101902
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
101874
|
-
import { chmodSync as chmodSync3, existsSync as
|
|
101875
|
-
import { join as
|
|
101903
|
+
import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "fs";
|
|
101904
|
+
import { join as join84 } from "path";
|
|
101876
101905
|
var INDEX_FILE_NAME = "index.json";
|
|
101877
101906
|
function isTokenIndex(value) {
|
|
101878
101907
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -101880,11 +101909,11 @@ function isTokenIndex(value) {
|
|
|
101880
101909
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
101881
101910
|
}
|
|
101882
101911
|
function getIndexPath(storageDir) {
|
|
101883
|
-
return
|
|
101912
|
+
return join84(storageDir, INDEX_FILE_NAME);
|
|
101884
101913
|
}
|
|
101885
101914
|
function readTokenIndex(storageDir) {
|
|
101886
101915
|
const indexPath = getIndexPath(storageDir);
|
|
101887
|
-
if (!
|
|
101916
|
+
if (!existsSync62(indexPath))
|
|
101888
101917
|
return {};
|
|
101889
101918
|
try {
|
|
101890
101919
|
const parsed = JSON.parse(readFileSync41(indexPath, "utf-8"));
|
|
@@ -101924,16 +101953,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
101924
101953
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
101925
101954
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
101926
101955
|
function getMcpOauthStorageDir() {
|
|
101927
|
-
return
|
|
101956
|
+
return join85(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
101928
101957
|
}
|
|
101929
101958
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
101930
101959
|
return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
101931
101960
|
}
|
|
101932
101961
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
101933
|
-
return
|
|
101962
|
+
return join85(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
101934
101963
|
}
|
|
101935
101964
|
function getLegacyStoragePath() {
|
|
101936
|
-
return
|
|
101965
|
+
return join85(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
101937
101966
|
}
|
|
101938
101967
|
function normalizeHost2(serverHost) {
|
|
101939
101968
|
let host = serverHost.trim();
|
|
@@ -101994,7 +102023,7 @@ function isOAuthTokenData(value) {
|
|
|
101994
102023
|
return clientSecret === undefined || typeof clientSecret === "string";
|
|
101995
102024
|
}
|
|
101996
102025
|
function readTokenFile(filePath) {
|
|
101997
|
-
if (!
|
|
102026
|
+
if (!existsSync63(filePath))
|
|
101998
102027
|
return null;
|
|
101999
102028
|
try {
|
|
102000
102029
|
const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
|
|
@@ -102007,7 +102036,7 @@ function readTokenFile(filePath) {
|
|
|
102007
102036
|
}
|
|
102008
102037
|
function readLegacyStore() {
|
|
102009
102038
|
const filePath = getLegacyStoragePath();
|
|
102010
|
-
if (!
|
|
102039
|
+
if (!existsSync63(filePath))
|
|
102011
102040
|
return null;
|
|
102012
102041
|
try {
|
|
102013
102042
|
const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
|
|
@@ -102027,8 +102056,8 @@ function readLegacyStore() {
|
|
|
102027
102056
|
}
|
|
102028
102057
|
function writeTokenFile(filePath, token) {
|
|
102029
102058
|
try {
|
|
102030
|
-
const dir =
|
|
102031
|
-
if (!
|
|
102059
|
+
const dir = dirname32(filePath);
|
|
102060
|
+
if (!existsSync63(dir)) {
|
|
102032
102061
|
mkdirSync14(dir, { recursive: true });
|
|
102033
102062
|
}
|
|
102034
102063
|
const tempPath = `${filePath}.tmp.${Date.now()}`;
|
|
@@ -102052,7 +102081,7 @@ function saveToken(serverHost, resource, token) {
|
|
|
102052
102081
|
}
|
|
102053
102082
|
function deleteToken(serverHost, resource) {
|
|
102054
102083
|
const filePath = getMcpOauthStoragePath(serverHost, resource);
|
|
102055
|
-
if (!
|
|
102084
|
+
if (!existsSync63(filePath))
|
|
102056
102085
|
return deleteLegacyToken(serverHost, resource);
|
|
102057
102086
|
try {
|
|
102058
102087
|
unlinkSync8(filePath);
|
|
@@ -102074,7 +102103,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
102074
102103
|
if (Object.keys(store2).length === 0) {
|
|
102075
102104
|
try {
|
|
102076
102105
|
const filePath = getLegacyStoragePath();
|
|
102077
|
-
if (
|
|
102106
|
+
if (existsSync63(filePath))
|
|
102078
102107
|
unlinkSync8(filePath);
|
|
102079
102108
|
return true;
|
|
102080
102109
|
} catch (deleteError) {
|
|
@@ -102112,7 +102141,7 @@ function listTokensByHost(serverHost) {
|
|
|
102112
102141
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
102113
102142
|
if (!indexedKey.startsWith(prefix))
|
|
102114
102143
|
continue;
|
|
102115
|
-
const indexedToken = readTokenFile(
|
|
102144
|
+
const indexedToken = readTokenFile(join85(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
102116
102145
|
if (indexedToken)
|
|
102117
102146
|
result[indexedKey] = indexedToken;
|
|
102118
102147
|
}
|
|
@@ -102121,13 +102150,13 @@ function listTokensByHost(serverHost) {
|
|
|
102121
102150
|
function listAllTokens() {
|
|
102122
102151
|
const result = { ...readLegacyStore() ?? {} };
|
|
102123
102152
|
const dir = getMcpOauthStorageDir();
|
|
102124
|
-
if (!
|
|
102153
|
+
if (!existsSync63(dir))
|
|
102125
102154
|
return result;
|
|
102126
102155
|
const index = readTokenIndex(dir);
|
|
102127
102156
|
for (const entry of readdirSync9(dir, { withFileTypes: true })) {
|
|
102128
102157
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
102129
102158
|
continue;
|
|
102130
|
-
const token = readTokenFile(
|
|
102159
|
+
const token = readTokenFile(join85(dir, entry.name));
|
|
102131
102160
|
const hash2 = basename14(entry.name, ".json");
|
|
102132
102161
|
if (token)
|
|
102133
102162
|
result[index[hash2] ?? hash2] = token;
|
|
@@ -102327,7 +102356,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
|
102327
102356
|
}
|
|
102328
102357
|
var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
102329
102358
|
function startCallbackServer(port) {
|
|
102330
|
-
return new Promise((
|
|
102359
|
+
return new Promise((resolve26, reject) => {
|
|
102331
102360
|
let timeoutId;
|
|
102332
102361
|
const server2 = createServer2((request, response) => {
|
|
102333
102362
|
clearTimeout(timeoutId);
|
|
@@ -102353,7 +102382,7 @@ function startCallbackServer(port) {
|
|
|
102353
102382
|
response.writeHead(200, { "content-type": "text/html" });
|
|
102354
102383
|
response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
|
|
102355
102384
|
server2.close();
|
|
102356
|
-
|
|
102385
|
+
resolve26({ code, state: state2 });
|
|
102357
102386
|
});
|
|
102358
102387
|
timeoutId = setTimeout(() => {
|
|
102359
102388
|
server2.close();
|
|
@@ -102693,7 +102722,7 @@ function createMcpOAuthCommand() {
|
|
|
102693
102722
|
}
|
|
102694
102723
|
|
|
102695
102724
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
102696
|
-
import { existsSync as
|
|
102725
|
+
import { existsSync as existsSync64 } from "fs";
|
|
102697
102726
|
|
|
102698
102727
|
// packages/omo-opencode/src/cli/boulder/formatter.ts
|
|
102699
102728
|
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
@@ -102757,7 +102786,7 @@ function formatReadErrorMessage(isJson) {
|
|
|
102757
102786
|
}
|
|
102758
102787
|
|
|
102759
102788
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
102760
|
-
function
|
|
102789
|
+
function formatDurationHuman(durationMs) {
|
|
102761
102790
|
if (durationMs < 1000) {
|
|
102762
102791
|
return `${durationMs}ms`;
|
|
102763
102792
|
}
|
|
@@ -102796,11 +102825,11 @@ function buildCliWork(directory, work) {
|
|
|
102796
102825
|
const taskSession = currentTask ? work.task_sessions?.[currentTask.key] : undefined;
|
|
102797
102826
|
let currentTaskElapsedHuman;
|
|
102798
102827
|
if (taskSession?.elapsed_ms !== undefined) {
|
|
102799
|
-
currentTaskElapsedHuman =
|
|
102828
|
+
currentTaskElapsedHuman = formatDurationHuman(taskSession.elapsed_ms);
|
|
102800
102829
|
} else if (taskSession?.started_at) {
|
|
102801
102830
|
const startedAtMs = Date.parse(taskSession.started_at);
|
|
102802
102831
|
if (!Number.isNaN(startedAtMs)) {
|
|
102803
|
-
currentTaskElapsedHuman =
|
|
102832
|
+
currentTaskElapsedHuman = formatDurationHuman(Math.max(0, Date.now() - startedAtMs));
|
|
102804
102833
|
}
|
|
102805
102834
|
}
|
|
102806
102835
|
return {
|
|
@@ -102812,7 +102841,7 @@ function buildCliWork(directory, work) {
|
|
|
102812
102841
|
started_at: work.started_at,
|
|
102813
102842
|
ended_at: work.ended_at,
|
|
102814
102843
|
elapsed_ms: elapsedMs,
|
|
102815
|
-
elapsed_human: elapsedMs !== undefined ?
|
|
102844
|
+
elapsed_human: elapsedMs !== undefined ? formatDurationHuman(elapsedMs) : undefined,
|
|
102816
102845
|
total_tasks: progress.total,
|
|
102817
102846
|
completed_tasks: progress.completed,
|
|
102818
102847
|
remaining_tasks: Math.max(0, progress.total - progress.completed),
|
|
@@ -102830,10 +102859,10 @@ async function boulder(options) {
|
|
|
102830
102859
|
const boulderFilePath = getBoulderFilePath(directory);
|
|
102831
102860
|
const state2 = readBoulderState(directory);
|
|
102832
102861
|
if (!state2) {
|
|
102833
|
-
const message =
|
|
102862
|
+
const message = existsSync64(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
|
|
102834
102863
|
process.stderr.write(`${message}
|
|
102835
102864
|
`);
|
|
102836
|
-
return
|
|
102865
|
+
return existsSync64(boulderFilePath) ? 2 : 1;
|
|
102837
102866
|
}
|
|
102838
102867
|
const works = getBoulderWorks(state2);
|
|
102839
102868
|
const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
|
|
@@ -102851,11 +102880,12 @@ async function boulder(options) {
|
|
|
102851
102880
|
}
|
|
102852
102881
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
102853
102882
|
import { spawn as spawn5 } from "child_process";
|
|
102854
|
-
import { existsSync as
|
|
102855
|
-
import { homedir as
|
|
102883
|
+
import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync9 } from "fs";
|
|
102884
|
+
import { homedir as homedir26 } from "os";
|
|
102885
|
+
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
|
|
102856
102886
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
102857
102887
|
const env3 = input.env ?? process.env;
|
|
102858
|
-
const homeDir = input.homeDir ??
|
|
102888
|
+
const homeDir = input.homeDir ?? homedir26();
|
|
102859
102889
|
const localComponentBin = resolveLocalUlwLoopBin(env3, homeDir);
|
|
102860
102890
|
if (localComponentBin !== null)
|
|
102861
102891
|
return { executable: localComponentBin, argsPrefix: [] };
|
|
@@ -102865,6 +102895,8 @@ function resolveCodexUlwLoopCommand(input = {}) {
|
|
|
102865
102895
|
});
|
|
102866
102896
|
if (componentCli !== null)
|
|
102867
102897
|
return { executable: process.execPath, argsPrefix: [componentCli] };
|
|
102898
|
+
if (env3[ULW_LOOP_DELEGATION_SENTINEL] === "1")
|
|
102899
|
+
return null;
|
|
102868
102900
|
const legacyLocalBin = resolveLegacyLocalOmoBin(env3, homeDir, input.currentExecutablePaths ?? [process.argv[1]].filter((value) => typeof value === "string"));
|
|
102869
102901
|
if (legacyLocalBin !== null)
|
|
102870
102902
|
return { executable: legacyLocalBin, argsPrefix: ["ulw-loop"] };
|
|
@@ -102876,22 +102908,34 @@ async function codexUlwLoop(args) {
|
|
|
102876
102908
|
console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
|
|
102877
102909
|
return 1;
|
|
102878
102910
|
}
|
|
102879
|
-
|
|
102880
|
-
|
|
102881
|
-
|
|
102882
|
-
|
|
102883
|
-
|
|
102884
|
-
|
|
102885
|
-
|
|
102911
|
+
const { promise: promise2, resolve: resolve26 } = Promise.withResolvers();
|
|
102912
|
+
const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
|
|
102913
|
+
stdio: "inherit",
|
|
102914
|
+
env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
|
|
102915
|
+
});
|
|
102916
|
+
child.on("error", (error51) => {
|
|
102917
|
+
console.error(error51.message);
|
|
102918
|
+
resolve26(1);
|
|
102886
102919
|
});
|
|
102920
|
+
child.on("close", (code) => resolve26(code ?? 1));
|
|
102921
|
+
return promise2;
|
|
102887
102922
|
}
|
|
102888
102923
|
function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
102889
102924
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
|
|
102890
|
-
return candidates.find((candidate) =>
|
|
102925
|
+
return candidates.find((candidate) => existsSync65(candidate)) ?? null;
|
|
102891
102926
|
}
|
|
102892
102927
|
function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
102893
102928
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
|
|
102894
|
-
return candidates.find((candidate) =>
|
|
102929
|
+
return candidates.find((candidate) => existsSync65(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate)) ?? null;
|
|
102930
|
+
}
|
|
102931
|
+
function isGeneratedRuntimeWrapper(candidate) {
|
|
102932
|
+
try {
|
|
102933
|
+
return readFileSync43(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
|
|
102934
|
+
} catch (error51) {
|
|
102935
|
+
if (error51 instanceof Error)
|
|
102936
|
+
return false;
|
|
102937
|
+
return false;
|
|
102938
|
+
}
|
|
102895
102939
|
}
|
|
102896
102940
|
function isCurrentExecutable(candidate, currentExecutablePaths) {
|
|
102897
102941
|
const candidateRealPath = realpathOrSelf(candidate);
|
|
@@ -102975,13 +103019,17 @@ var VERSION3 = package_default.version;
|
|
|
102975
103019
|
var program2 = new Command;
|
|
102976
103020
|
function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION_NAME) {
|
|
102977
103021
|
const defaultPlatform = invocationName === "lazycodex" || invocationName === "lazycodex-ai" ? "codex" : undefined;
|
|
103022
|
+
const platform = options.platform ?? defaultPlatform;
|
|
103023
|
+
if (platform === "senpi" && !isSenpiPlatformEnabled()) {
|
|
103024
|
+
throw new Error(`The senpi install platform is not available in this release. Set ${SENPI_PLATFORM_ENV_FLAG}=1 to enable it from a source checkout.`);
|
|
103025
|
+
}
|
|
102978
103026
|
return {
|
|
102979
103027
|
tui: options.tui !== false,
|
|
102980
103028
|
claude: options.claude,
|
|
102981
103029
|
openai: options.openai,
|
|
102982
103030
|
gemini: options.gemini,
|
|
102983
103031
|
copilot: options.copilot,
|
|
102984
|
-
platform
|
|
103032
|
+
platform,
|
|
102985
103033
|
opencodeZen: options.opencodeZen,
|
|
102986
103034
|
zaiCodingPlan: options.zaiCodingPlan,
|
|
102987
103035
|
kimiForCoding: options.kimiForCoding,
|
|
@@ -102994,8 +103042,8 @@ function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION
|
|
|
102994
103042
|
skipAuth: options.skipAuth ?? false
|
|
102995
103043
|
};
|
|
102996
103044
|
}
|
|
102997
|
-
program2.name("oh-my-opencode").description("The ultimate OpenCode plugin - multi-model orchestration, LSP tools, and more").version(VERSION3, "-v, --version", "Show version number").helpOption("-h, --help", "Display help for command").addOption(new Option("--platform <platform>",
|
|
102998
|
-
program2.command("install").alias("setup").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").addOption(new Option("--platform <platform>",
|
|
103045
|
+
program2.name("oh-my-opencode").description("The ultimate OpenCode plugin - multi-model orchestration, LSP tools, and more").version(VERSION3, "-v, --version", "Show version number").helpOption("-h, --help", "Display help for command").addOption(new Option("--platform <platform>", `Install target platform: ${availableInstallPlatforms().join(", ")}`).choices(availableInstallPlatforms()).hideHelp()).enablePositionalOptions();
|
|
103046
|
+
program2.command("install").alias("setup").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").addOption(new Option("--platform <platform>", `Install target platform: ${availableInstallPlatforms().join(", ")}`).choices(availableInstallPlatforms())).option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--opencode-go <value>", "OpenCode Go subscription: no, yes (default: no)").option("--bailian-coding-plan <value>", "Bailian Coding Plan subscription: no, yes (default: no)").option("--minimax-cn-coding-plan <value>", "MiniMax Coding Plan (minimaxi.com) subscription: no, yes (default: no)").option("--minimax-coding-plan <value>", "MiniMax Coding Plan (minimax.io) subscription: no, yes (default: no)").option("--vercel-ai-gateway <value>", "Vercel AI Gateway: no, yes (default: no)").option("--codex-autonomous", "Configure Codex with approval never, full filesystem access, and network enabled").option("--no-codex-autonomous", "Leave existing Codex permission settings unchanged").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `
|
|
102999
103047
|
Examples:
|
|
103000
103048
|
$ bunx oh-my-opencode install
|
|
103001
103049
|
$ npx lazycodex-ai install --no-tui
|
|
@@ -103018,7 +103066,7 @@ Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi > Baili
|
|
|
103018
103066
|
`).action(async (options) => {
|
|
103019
103067
|
const rootOptions = program2.opts();
|
|
103020
103068
|
const args = resolveInstallArgs({ ...options, platform: options.platform ?? rootOptions.platform });
|
|
103021
|
-
const exitCode = await
|
|
103069
|
+
const exitCode = await install3(args);
|
|
103022
103070
|
process.exit(exitCode);
|
|
103023
103071
|
});
|
|
103024
103072
|
configureCleanupCommand(program2);
|