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-node/index.js
CHANGED
|
@@ -2146,7 +2146,7 @@ var package_default;
|
|
|
2146
2146
|
var init_package = __esm(() => {
|
|
2147
2147
|
package_default = {
|
|
2148
2148
|
name: "oh-my-opencode",
|
|
2149
|
-
version: "4.
|
|
2149
|
+
version: "4.16.1",
|
|
2150
2150
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
2151
2151
|
main: "./dist/index.js",
|
|
2152
2152
|
types: "dist/index.d.ts",
|
|
@@ -2160,6 +2160,7 @@ var init_package = __esm(() => {
|
|
|
2160
2160
|
"packages/lsp-core",
|
|
2161
2161
|
"packages/utils",
|
|
2162
2162
|
"packages/model-core",
|
|
2163
|
+
"packages/omo-config-core",
|
|
2163
2164
|
"packages/prompts-core",
|
|
2164
2165
|
"packages/comment-checker-core",
|
|
2165
2166
|
"packages/hashline-core",
|
|
@@ -2173,6 +2174,10 @@ var init_package = __esm(() => {
|
|
|
2173
2174
|
"packages/agents-md-core",
|
|
2174
2175
|
"packages/shared-skills",
|
|
2175
2176
|
"packages/omo-codex",
|
|
2177
|
+
"packages/omo-senpi",
|
|
2178
|
+
"packages/senpi-task",
|
|
2179
|
+
"packages/pi-goal",
|
|
2180
|
+
"packages/pi-webfetch",
|
|
2176
2181
|
"packages/omo-opencode"
|
|
2177
2182
|
],
|
|
2178
2183
|
bin: {
|
|
@@ -2187,10 +2192,11 @@ var init_package = __esm(() => {
|
|
|
2187
2192
|
"dist",
|
|
2188
2193
|
"bin",
|
|
2189
2194
|
"postinstall.mjs",
|
|
2195
|
+
"script/qa/strip-ansi.mjs",
|
|
2190
2196
|
"script/qa/web-terminal-redaction.d.mts",
|
|
2191
2197
|
"script/qa/web-terminal-redaction.mjs",
|
|
2192
|
-
"script/qa/web-terminal-renderer.mjs",
|
|
2193
2198
|
"script/qa/web-terminal-visual-qa.mjs",
|
|
2199
|
+
"script/qa/xterm-live-terminal.mjs",
|
|
2194
2200
|
"docs/reference/github-attachment-upload.md",
|
|
2195
2201
|
"docs/reference/web-terminal-visual-qa.md",
|
|
2196
2202
|
".opencode/command",
|
|
@@ -2229,6 +2235,7 @@ var init_package = __esm(() => {
|
|
|
2229
2235
|
"packages/omo-codex/plugin/.codex-plugin",
|
|
2230
2236
|
"!packages/omo-codex/plugin/node_modules",
|
|
2231
2237
|
"!packages/omo-codex/plugin/**/node_modules",
|
|
2238
|
+
"!packages/omo-codex/plugin/components/workflow-selector",
|
|
2232
2239
|
"packages/omo-codex/scripts",
|
|
2233
2240
|
"!packages/omo-codex/scripts/install"
|
|
2234
2241
|
],
|
|
@@ -2242,10 +2249,11 @@ var init_package = __esm(() => {
|
|
|
2242
2249
|
"./schema.json": "./dist/oh-my-opencode.schema.json"
|
|
2243
2250
|
},
|
|
2244
2251
|
scripts: {
|
|
2245
|
-
build: "bun run
|
|
2252
|
+
build: "bun run script/build.ts",
|
|
2246
2253
|
"build:cli-node": "bun run script/build-cli-node.ts",
|
|
2247
2254
|
"build:codex-install": "bun run script/build-codex-install.ts",
|
|
2248
2255
|
"build:codex-plugin": "npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build",
|
|
2256
|
+
"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",
|
|
2249
2257
|
"build:materialize-frontend": "node packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs --strict",
|
|
2250
2258
|
"build:shared-skills-assets": "bun run build:materialize-frontend && rm -rf dist/skills && cp -R packages/shared-skills/skills dist/skills",
|
|
2251
2259
|
"build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
|
|
@@ -2254,6 +2262,7 @@ var init_package = __esm(() => {
|
|
|
2254
2262
|
"build:all": "bun run build && bun run build:binaries",
|
|
2255
2263
|
"build:binaries": "bun run script/build-binaries.ts",
|
|
2256
2264
|
"build:schema": "bun run script/build-schema.ts",
|
|
2265
|
+
"build:omo-schema": "bun run script/build-omo-schema.ts",
|
|
2257
2266
|
"build:model-capabilities": "bun run script/build-model-capabilities.ts",
|
|
2258
2267
|
clean: "rm -rf dist",
|
|
2259
2268
|
prepack: "bun run build:materialize-frontend",
|
|
@@ -2262,10 +2271,11 @@ var init_package = __esm(() => {
|
|
|
2262
2271
|
prepublishOnly: "bun run clean && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && bun run build",
|
|
2263
2272
|
"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",
|
|
2264
2273
|
typecheck: "tsgo --noEmit && bun run typecheck:script && bun run typecheck:packages",
|
|
2265
|
-
"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",
|
|
2274
|
+
"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",
|
|
2266
2275
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
2267
2276
|
test: "bun test",
|
|
2268
2277
|
"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",
|
|
2278
|
+
"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",
|
|
2269
2279
|
"test:windows-codex": "bun run test:codex",
|
|
2270
2280
|
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
|
|
2271
2281
|
},
|
|
@@ -2309,48 +2319,61 @@ var init_package = __esm(() => {
|
|
|
2309
2319
|
zod: "^4.4.3"
|
|
2310
2320
|
},
|
|
2311
2321
|
devDependencies: {
|
|
2312
|
-
"@oh-my-opencode/git-bash-mcp": "workspace:*",
|
|
2313
|
-
"@oh-my-opencode/lsp-core": "workspace:*",
|
|
2314
|
-
"@oh-my-opencode/mcp-stdio-core": "workspace:*",
|
|
2315
|
-
"@oh-my-opencode/mcp-client-core": "workspace:*",
|
|
2316
2322
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
2317
2323
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
2318
2324
|
"@oh-my-opencode/claude-code-compat-core": "workspace:*",
|
|
2319
|
-
"@oh-my-opencode/skills-loader-core": "workspace:*",
|
|
2320
2325
|
"@oh-my-opencode/comment-checker-core": "workspace:*",
|
|
2321
2326
|
"@oh-my-opencode/delegate-core": "workspace:*",
|
|
2327
|
+
"@oh-my-opencode/git-bash-mcp": "workspace:*",
|
|
2322
2328
|
"@oh-my-opencode/hashline-core": "workspace:*",
|
|
2323
|
-
"@oh-my-opencode/
|
|
2324
|
-
"@oh-my-opencode/
|
|
2325
|
-
"@oh-my-opencode/
|
|
2329
|
+
"@oh-my-opencode/lsp-core": "workspace:*",
|
|
2330
|
+
"@oh-my-opencode/mcp-client-core": "workspace:*",
|
|
2331
|
+
"@oh-my-opencode/mcp-stdio-core": "workspace:*",
|
|
2326
2332
|
"@oh-my-opencode/model-core": "workspace:*",
|
|
2327
2333
|
"@oh-my-opencode/omo-codex": "workspace:*",
|
|
2334
|
+
"@oh-my-opencode/omo-config-core": "workspace:*",
|
|
2335
|
+
"@oh-my-opencode/omo-senpi": "workspace:*",
|
|
2336
|
+
"@oh-my-opencode/openclaw-core": "workspace:*",
|
|
2337
|
+
"@oh-my-opencode/pi-goal": "workspace:*",
|
|
2338
|
+
"@oh-my-opencode/pi-webfetch": "workspace:*",
|
|
2328
2339
|
"@oh-my-opencode/prompts-core": "workspace:*",
|
|
2329
2340
|
"@oh-my-opencode/rules-engine": "workspace:*",
|
|
2341
|
+
"@oh-my-opencode/senpi-task": "workspace:*",
|
|
2330
2342
|
"@oh-my-opencode/shared-skills": "workspace:*",
|
|
2343
|
+
"@oh-my-opencode/skills-loader-core": "workspace:*",
|
|
2344
|
+
"@oh-my-opencode/team-core": "workspace:*",
|
|
2331
2345
|
"@oh-my-opencode/telemetry-core": "workspace:*",
|
|
2346
|
+
"@oh-my-opencode/tmux-core": "workspace:*",
|
|
2332
2347
|
"@oh-my-opencode/utils": "workspace:*",
|
|
2333
|
-
"@typescript/native-preview": "7.0.0-dev.20260518.1",
|
|
2334
2348
|
"@types/js-yaml": "^4.0.9",
|
|
2335
2349
|
"@types/picomatch": "^4.0.3",
|
|
2350
|
+
"@typescript/native-preview": "7.0.0-dev.20260518.1",
|
|
2351
|
+
"@xterm/addon-unicode11": "^0.9.0",
|
|
2352
|
+
"@xterm/xterm": "^6.0.0",
|
|
2336
2353
|
"bun-types": "1.3.14",
|
|
2354
|
+
"node-pty": "^1.1.0",
|
|
2355
|
+
"puppeteer-core": "^25.3.0",
|
|
2337
2356
|
typescript: "^6.0.3"
|
|
2338
2357
|
},
|
|
2339
2358
|
optionalDependencies: {
|
|
2340
|
-
"oh-my-opencode-darwin-arm64": "4.
|
|
2341
|
-
"oh-my-opencode-darwin-x64": "4.
|
|
2342
|
-
"oh-my-opencode-darwin-x64-baseline": "4.
|
|
2343
|
-
"oh-my-opencode-linux-arm64": "4.
|
|
2344
|
-
"oh-my-opencode-linux-arm64-musl": "4.
|
|
2345
|
-
"oh-my-opencode-linux-x64": "4.
|
|
2346
|
-
"oh-my-opencode-linux-x64-baseline": "4.
|
|
2347
|
-
"oh-my-opencode-linux-x64-musl": "4.
|
|
2348
|
-
"oh-my-opencode-linux-x64-musl-baseline": "4.
|
|
2349
|
-
"oh-my-opencode-windows-arm64": "4.
|
|
2350
|
-
"oh-my-opencode-windows-x64": "4.
|
|
2351
|
-
"oh-my-opencode-windows-x64-baseline": "4.
|
|
2359
|
+
"oh-my-opencode-darwin-arm64": "4.16.1",
|
|
2360
|
+
"oh-my-opencode-darwin-x64": "4.16.1",
|
|
2361
|
+
"oh-my-opencode-darwin-x64-baseline": "4.16.1",
|
|
2362
|
+
"oh-my-opencode-linux-arm64": "4.16.1",
|
|
2363
|
+
"oh-my-opencode-linux-arm64-musl": "4.16.1",
|
|
2364
|
+
"oh-my-opencode-linux-x64": "4.16.1",
|
|
2365
|
+
"oh-my-opencode-linux-x64-baseline": "4.16.1",
|
|
2366
|
+
"oh-my-opencode-linux-x64-musl": "4.16.1",
|
|
2367
|
+
"oh-my-opencode-linux-x64-musl-baseline": "4.16.1",
|
|
2368
|
+
"oh-my-opencode-windows-arm64": "4.16.1",
|
|
2369
|
+
"oh-my-opencode-windows-x64": "4.16.1",
|
|
2370
|
+
"oh-my-opencode-windows-x64-baseline": "4.16.1"
|
|
2352
2371
|
},
|
|
2353
2372
|
overrides: {
|
|
2373
|
+
"@earendil-works/pi-agent-core": "0.80.3",
|
|
2374
|
+
"@earendil-works/pi-ai": "0.80.3",
|
|
2375
|
+
"@earendil-works/pi-coding-agent": "0.80.3",
|
|
2376
|
+
"@earendil-works/pi-tui": "0.80.3",
|
|
2354
2377
|
hono: "^4.12.18",
|
|
2355
2378
|
"@hono/node-server": "^1.19.13",
|
|
2356
2379
|
"express-rate-limit": "^8.5.1",
|
|
@@ -2530,14 +2553,10 @@ var init_config_section_parser = __esm(() => {
|
|
|
2530
2553
|
});
|
|
2531
2554
|
|
|
2532
2555
|
// packages/utils/src/env-expansion.ts
|
|
2533
|
-
var init_env_expansion =
|
|
2534
|
-
init_deep_merge();
|
|
2535
|
-
});
|
|
2556
|
+
var init_env_expansion = () => {};
|
|
2536
2557
|
|
|
2537
2558
|
// packages/utils/src/snake-case.ts
|
|
2538
|
-
var init_snake_case =
|
|
2539
|
-
init_deep_merge();
|
|
2540
|
-
});
|
|
2559
|
+
var init_snake_case = () => {};
|
|
2541
2560
|
|
|
2542
2561
|
// packages/utils/src/record-type-guard.ts
|
|
2543
2562
|
function isRecord(value) {
|
|
@@ -5635,6 +5654,7 @@ var init_port_utils = () => {};
|
|
|
5635
5654
|
|
|
5636
5655
|
// packages/utils/src/tool-name.ts
|
|
5637
5656
|
var init_tool_name = () => {};
|
|
5657
|
+
|
|
5638
5658
|
// node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
5639
5659
|
function createScanner(text, ignoreTrivia = false) {
|
|
5640
5660
|
const len = text.length;
|
|
@@ -7116,27 +7136,13 @@ function log(message, data) {
|
|
|
7116
7136
|
var sharedSubunitLogger = () => {};
|
|
7117
7137
|
|
|
7118
7138
|
// packages/utils/src/omo-config.ts
|
|
7119
|
-
var
|
|
7120
|
-
var init_omo_config = __esm(() => {
|
|
7121
|
-
HARNESS_IDS = ["codex", "opencode", "omo"];
|
|
7122
|
-
});
|
|
7123
|
-
|
|
7124
|
-
// packages/utils/src/omo-config/env-overrides.ts
|
|
7125
|
-
var init_env_overrides = () => {};
|
|
7139
|
+
var init_omo_config = () => {};
|
|
7126
7140
|
|
|
7127
7141
|
// packages/utils/src/omo-config/resolve.ts
|
|
7128
7142
|
var init_resolve = () => {};
|
|
7129
7143
|
|
|
7130
7144
|
// packages/utils/src/omo-config/loader.ts
|
|
7131
|
-
var
|
|
7132
|
-
var init_loader = __esm(() => {
|
|
7133
|
-
init_deep_merge();
|
|
7134
|
-
init_jsonc_parser();
|
|
7135
|
-
init_omo_config();
|
|
7136
|
-
init_env_overrides();
|
|
7137
|
-
init_resolve();
|
|
7138
|
-
HARNESS_BLOCK_KEYS = HARNESS_IDS.map((harness) => `[${harness}]`);
|
|
7139
|
-
});
|
|
7145
|
+
var init_loader = () => {};
|
|
7140
7146
|
|
|
7141
7147
|
// packages/utils/src/archive-entry-validator.ts
|
|
7142
7148
|
var init_archive_entry_validator = () => {};
|
|
@@ -7161,9 +7167,7 @@ function sgBinaryName(platform = process.platform) {
|
|
|
7161
7167
|
var init_sg_manifest = () => {};
|
|
7162
7168
|
|
|
7163
7169
|
// packages/utils/src/ast-grep/sg-provisioner.ts
|
|
7164
|
-
var init_sg_provisioner =
|
|
7165
|
-
init_sg_manifest();
|
|
7166
|
-
});
|
|
7170
|
+
var init_sg_provisioner = () => {};
|
|
7167
7171
|
|
|
7168
7172
|
// packages/utils/src/ast-grep/types.ts
|
|
7169
7173
|
var SG_PATH_ENV_KEY = "OMO_AST_GREP_SG_PATH";
|
|
@@ -7422,6 +7426,7 @@ var init_env = __esm(() => {
|
|
|
7422
7426
|
"CODEGRAPH_ALLOW_UNSAFE_NODE",
|
|
7423
7427
|
"CODEGRAPH_BIN",
|
|
7424
7428
|
"CODEGRAPH_FAKE_LOG",
|
|
7429
|
+
"CODEGRAPH_NO_DAEMON",
|
|
7425
7430
|
"CODEGRAPH_NODE_BIN",
|
|
7426
7431
|
"OMO_CODEGRAPH_BIN",
|
|
7427
7432
|
"OMO_CODEGRAPH_PROJECT_CWD",
|
|
@@ -7433,9 +7438,7 @@ var init_env = __esm(() => {
|
|
|
7433
7438
|
var init_workspace = () => {};
|
|
7434
7439
|
|
|
7435
7440
|
// packages/utils/src/codegraph/guidance.ts
|
|
7436
|
-
var init_guidance =
|
|
7437
|
-
init_workspace();
|
|
7438
|
-
});
|
|
7441
|
+
var init_guidance = () => {};
|
|
7439
7442
|
|
|
7440
7443
|
// packages/utils/src/codegraph/node-support.ts
|
|
7441
7444
|
function evaluateCodegraphNodeSupport(options = {}) {
|
|
@@ -7458,18 +7461,17 @@ function parseNodeMajor(version) {
|
|
|
7458
7461
|
}
|
|
7459
7462
|
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";
|
|
7460
7463
|
|
|
7461
|
-
// packages/utils/src/codegraph/manifest.ts
|
|
7462
|
-
var init_manifest = () => {};
|
|
7463
|
-
|
|
7464
7464
|
// packages/utils/src/codegraph/provision.ts
|
|
7465
7465
|
import { execFile } from "node:child_process";
|
|
7466
7466
|
import { promisify } from "node:util";
|
|
7467
7467
|
var execFileAsync;
|
|
7468
7468
|
var init_provision = __esm(() => {
|
|
7469
|
-
init_manifest();
|
|
7470
7469
|
execFileAsync = promisify(execFile);
|
|
7471
7470
|
});
|
|
7472
7471
|
|
|
7472
|
+
// packages/utils/src/codegraph/process-sweep.ts
|
|
7473
|
+
var init_process_sweep = () => {};
|
|
7474
|
+
|
|
7473
7475
|
// packages/utils/src/codegraph/resolve.ts
|
|
7474
7476
|
import { existsSync as existsSync7 } from "node:fs";
|
|
7475
7477
|
import { spawnSync } from "node:child_process";
|
|
@@ -7567,56 +7569,16 @@ var init_codegraph = __esm(() => {
|
|
|
7567
7569
|
init_env();
|
|
7568
7570
|
init_guidance();
|
|
7569
7571
|
init_provision();
|
|
7572
|
+
init_process_sweep();
|
|
7570
7573
|
init_resolve2();
|
|
7571
7574
|
init_workspace();
|
|
7572
7575
|
});
|
|
7573
7576
|
|
|
7574
|
-
// packages/utils/src/command-executor/home-directory.ts
|
|
7575
|
-
var init_home_directory = () => {};
|
|
7576
|
-
|
|
7577
|
-
// packages/utils/src/command-executor/shell-path.ts
|
|
7578
|
-
var init_shell_path = () => {};
|
|
7579
|
-
|
|
7580
|
-
// packages/utils/src/command-executor/execute-hook-command.ts
|
|
7581
|
-
var init_execute_hook_command = __esm(() => {
|
|
7582
|
-
init_home_directory();
|
|
7583
|
-
init_shell_path();
|
|
7584
|
-
});
|
|
7585
|
-
|
|
7586
|
-
// packages/utils/src/command-executor/execute-command.ts
|
|
7587
|
-
import { exec } from "node:child_process";
|
|
7588
|
-
import { promisify as promisify2 } from "node:util";
|
|
7589
|
-
var execAsync;
|
|
7590
|
-
var init_execute_command = __esm(() => {
|
|
7591
|
-
execAsync = promisify2(exec);
|
|
7592
|
-
});
|
|
7593
|
-
|
|
7594
|
-
// packages/utils/src/command-executor/embedded-commands.ts
|
|
7595
|
-
var init_embedded_commands = () => {};
|
|
7596
|
-
|
|
7597
|
-
// packages/utils/src/command-executor/resolve-commands-in-text.ts
|
|
7598
|
-
var init_resolve_commands_in_text = __esm(() => {
|
|
7599
|
-
init_execute_command();
|
|
7600
|
-
init_embedded_commands();
|
|
7601
|
-
});
|
|
7602
|
-
|
|
7603
7577
|
// packages/utils/src/command-executor.ts
|
|
7604
|
-
var init_command_executor =
|
|
7605
|
-
|
|
7606
|
-
init_execute_command();
|
|
7607
|
-
init_resolve_commands_in_text();
|
|
7608
|
-
});
|
|
7609
|
-
// packages/utils/src/git-worktree/parse-status-porcelain.ts
|
|
7610
|
-
var init_parse_status_porcelain = () => {};
|
|
7611
|
-
// packages/utils/src/git-worktree/collect-git-diff-stats.ts
|
|
7612
|
-
var init_collect_git_diff_stats = __esm(() => {
|
|
7613
|
-
init_parse_status_porcelain();
|
|
7614
|
-
});
|
|
7578
|
+
var init_command_executor = () => {};
|
|
7579
|
+
|
|
7615
7580
|
// packages/utils/src/git-worktree/index.ts
|
|
7616
|
-
var init_git_worktree =
|
|
7617
|
-
init_parse_status_porcelain();
|
|
7618
|
-
init_collect_git_diff_stats();
|
|
7619
|
-
});
|
|
7581
|
+
var init_git_worktree = () => {};
|
|
7620
7582
|
|
|
7621
7583
|
// packages/utils/src/internal-initiator-marker.ts
|
|
7622
7584
|
function hasInternalInitiatorMarker(text) {
|
|
@@ -8037,12 +7999,9 @@ var init_config_migration = __esm(() => {
|
|
|
8037
7999
|
|
|
8038
8000
|
// packages/utils/src/migration.ts
|
|
8039
8001
|
var init_migration = __esm(() => {
|
|
8040
|
-
init_agent_names();
|
|
8041
|
-
init_hook_names();
|
|
8042
|
-
init_model_versions();
|
|
8043
|
-
init_agent_category();
|
|
8044
8002
|
init_config_migration();
|
|
8045
8003
|
});
|
|
8004
|
+
|
|
8046
8005
|
// packages/utils/src/prompt-async-gate/route-resolver.ts
|
|
8047
8006
|
function identityRoute(client) {
|
|
8048
8007
|
return { client, route: "in-process", reason: "identity" };
|
|
@@ -9104,7 +9063,6 @@ var init_prompt_async_gate = __esm(() => {
|
|
|
9104
9063
|
init_route_resolver();
|
|
9105
9064
|
init_session_idle_settle();
|
|
9106
9065
|
init_queue();
|
|
9107
|
-
init_recent_dispatches();
|
|
9108
9066
|
init_reservations();
|
|
9109
9067
|
init_session_idle_dispatch();
|
|
9110
9068
|
init_semantic_dedupe();
|
|
@@ -9137,39 +9095,8 @@ function isAmbiguousPostDispatchPromptFailure(result) {
|
|
|
9137
9095
|
return result.dispatchAttempted === true && isAmbiguousPromptDispatchFailure(result.error);
|
|
9138
9096
|
}
|
|
9139
9097
|
|
|
9140
|
-
// packages/utils/src/zip-entry-listing/python-zip-entry-listing.ts
|
|
9141
|
-
var init_python_zip_entry_listing = __esm(() => {
|
|
9142
|
-
init_runtime();
|
|
9143
|
-
});
|
|
9144
|
-
|
|
9145
|
-
// packages/utils/src/zip-entry-listing/powershell-zip-entry-listing.ts
|
|
9146
|
-
var init_powershell_zip_entry_listing = __esm(() => {
|
|
9147
|
-
init_runtime();
|
|
9148
|
-
});
|
|
9149
|
-
|
|
9150
|
-
// packages/utils/src/zip-entry-listing/tar-zip-entry-listing.ts
|
|
9151
|
-
var init_tar_zip_entry_listing = __esm(() => {
|
|
9152
|
-
init_runtime();
|
|
9153
|
-
});
|
|
9154
|
-
|
|
9155
|
-
// packages/utils/src/zip-entry-listing/read-zip-symlink-target.ts
|
|
9156
|
-
var init_read_zip_symlink_target = __esm(() => {
|
|
9157
|
-
init_runtime();
|
|
9158
|
-
});
|
|
9159
|
-
|
|
9160
|
-
// packages/utils/src/zip-entry-listing/zipinfo-zip-entry-listing.ts
|
|
9161
|
-
var init_zipinfo_zip_entry_listing = __esm(() => {
|
|
9162
|
-
init_runtime();
|
|
9163
|
-
init_read_zip_symlink_target();
|
|
9164
|
-
});
|
|
9165
|
-
|
|
9166
9098
|
// packages/utils/src/zip-entry-listing.ts
|
|
9167
|
-
var init_zip_entry_listing =
|
|
9168
|
-
init_python_zip_entry_listing();
|
|
9169
|
-
init_powershell_zip_entry_listing();
|
|
9170
|
-
init_tar_zip_entry_listing();
|
|
9171
|
-
init_zipinfo_zip_entry_listing();
|
|
9172
|
-
});
|
|
9099
|
+
var init_zip_entry_listing = () => {};
|
|
9173
9100
|
|
|
9174
9101
|
// packages/utils/src/index.ts
|
|
9175
9102
|
var init_src = __esm(() => {
|
|
@@ -9817,10 +9744,7 @@ var init_model_capability_heuristics = __esm(() => {
|
|
|
9817
9744
|
});
|
|
9818
9745
|
|
|
9819
9746
|
// packages/model-core/src/model-capability-guardrails.ts
|
|
9820
|
-
var init_model_capability_guardrails =
|
|
9821
|
-
init_model_capability_aliases();
|
|
9822
|
-
init_model_requirements();
|
|
9823
|
-
});
|
|
9747
|
+
var init_model_capability_guardrails = () => {};
|
|
9824
9748
|
|
|
9825
9749
|
// packages/model-core/src/model-settings-compatibility.ts
|
|
9826
9750
|
function downgradeWithinLadder(value, allowed, ladder) {
|
|
@@ -9955,6 +9879,7 @@ var init_model_settings_compatibility = __esm(() => {
|
|
|
9955
9879
|
VARIANT_LADDER = ["low", "medium", "high", "xhigh", "max"];
|
|
9956
9880
|
REASONING_LADDER = ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
9957
9881
|
});
|
|
9882
|
+
|
|
9958
9883
|
// packages/model-core/src/provider-model-id-transform.ts
|
|
9959
9884
|
function inferSubProvider(model) {
|
|
9960
9885
|
if (model.startsWith("claude-"))
|
|
@@ -10014,11 +9939,6 @@ var init_provider_model_id_transform = __esm(() => {
|
|
|
10014
9939
|
GEMINI_3_FLASH_PREVIEW = /gemini-3-flash(?!-)/g;
|
|
10015
9940
|
});
|
|
10016
9941
|
|
|
10017
|
-
// packages/model-core/src/model-resolution-pipeline.ts
|
|
10018
|
-
var init_model_resolution_pipeline = __esm(() => {
|
|
10019
|
-
init_provider_model_id_transform();
|
|
10020
|
-
});
|
|
10021
|
-
|
|
10022
9942
|
// packages/model-core/src/known-variants.ts
|
|
10023
9943
|
var KNOWN_VARIANTS;
|
|
10024
9944
|
var init_known_variants = __esm(() => {
|
|
@@ -10035,9 +9955,6 @@ var init_known_variants = __esm(() => {
|
|
|
10035
9955
|
]);
|
|
10036
9956
|
});
|
|
10037
9957
|
|
|
10038
|
-
// packages/model-core/src/connected-providers-cache.ts
|
|
10039
|
-
var init_connected_providers_cache = () => {};
|
|
10040
|
-
|
|
10041
9958
|
// packages/model-core/src/model-resolver.ts
|
|
10042
9959
|
function normalizeFallbackModels(models) {
|
|
10043
9960
|
if (!models)
|
|
@@ -10046,11 +9963,8 @@ function normalizeFallbackModels(models) {
|
|
|
10046
9963
|
return [models];
|
|
10047
9964
|
return models;
|
|
10048
9965
|
}
|
|
10049
|
-
var init_model_resolver =
|
|
10050
|
-
|
|
10051
|
-
init_known_variants();
|
|
10052
|
-
init_connected_providers_cache();
|
|
10053
|
-
});
|
|
9966
|
+
var init_model_resolver = () => {};
|
|
9967
|
+
|
|
10054
9968
|
// packages/model-core/src/model-string-parser.ts
|
|
10055
9969
|
var KNOWN_VARIANTS2;
|
|
10056
9970
|
var init_model_string_parser = __esm(() => {
|
|
@@ -10066,16 +9980,13 @@ var init_model_string_parser = __esm(() => {
|
|
|
10066
9980
|
"thinking"
|
|
10067
9981
|
]);
|
|
10068
9982
|
});
|
|
9983
|
+
|
|
10069
9984
|
// packages/model-core/src/fallback-chain-from-models.ts
|
|
10070
|
-
var init_fallback_chain_from_models =
|
|
10071
|
-
init_model_resolver();
|
|
10072
|
-
init_known_variants();
|
|
10073
|
-
});
|
|
9985
|
+
var init_fallback_chain_from_models = () => {};
|
|
10074
9986
|
|
|
10075
9987
|
// packages/model-core/src/model-error-classifier.ts
|
|
10076
9988
|
var RETRYABLE_ERROR_NAMES, STOP_ERROR_NAMES, NON_RETRYABLE_ERROR_NAMES;
|
|
10077
9989
|
var init_model_error_classifier = __esm(() => {
|
|
10078
|
-
init_connected_providers_cache();
|
|
10079
9990
|
RETRYABLE_ERROR_NAMES = new Set([
|
|
10080
9991
|
"providermodelnotfounderror",
|
|
10081
9992
|
"ratelimiterror",
|
|
@@ -10106,21 +10017,13 @@ var init_runtime_fallback_auto_retry_signal = () => {};
|
|
|
10106
10017
|
var init_runtime_fallback_error_shape = () => {};
|
|
10107
10018
|
|
|
10108
10019
|
// packages/model-core/src/runtime-fallback-error-classifier.ts
|
|
10109
|
-
var init_runtime_fallback_error_classifier =
|
|
10110
|
-
init_runtime_fallback_auto_retry_signal();
|
|
10111
|
-
init_runtime_fallback_error_shape();
|
|
10112
|
-
init_runtime_fallback_error_shape();
|
|
10113
|
-
});
|
|
10020
|
+
var init_runtime_fallback_error_classifier = () => {};
|
|
10114
10021
|
|
|
10115
10022
|
// packages/model-core/src/provider-exhaustion-fallback-policy.ts
|
|
10116
|
-
var init_provider_exhaustion_fallback_policy =
|
|
10117
|
-
init_runtime_fallback_error_classifier();
|
|
10118
|
-
});
|
|
10023
|
+
var init_provider_exhaustion_fallback_policy = () => {};
|
|
10119
10024
|
|
|
10120
10025
|
// packages/model-core/src/runtime-fallback-model.ts
|
|
10121
|
-
var init_runtime_fallback_model =
|
|
10122
|
-
init_model_string_parser();
|
|
10123
|
-
});
|
|
10026
|
+
var init_runtime_fallback_model = () => {};
|
|
10124
10027
|
|
|
10125
10028
|
// packages/model-core/src/model-capabilities/supplemental-entries.ts
|
|
10126
10029
|
var SUPPLEMENTAL_MODEL_CAPABILITIES;
|
|
@@ -10527,11 +10430,11 @@ async function fetchModelCapabilitiesSnapshot(args = {}) {
|
|
|
10527
10430
|
};
|
|
10528
10431
|
}
|
|
10529
10432
|
var MODELS_DEV_SOURCE_URL = "https://models.dev/api.json";
|
|
10433
|
+
|
|
10530
10434
|
// packages/model-core/src/index.ts
|
|
10531
10435
|
var init_src2 = __esm(() => {
|
|
10532
10436
|
init_model_resolver();
|
|
10533
10437
|
init_provider_model_id_transform();
|
|
10534
|
-
init_model_resolution_pipeline();
|
|
10535
10438
|
init_model_requirements();
|
|
10536
10439
|
init_model_family_detectors();
|
|
10537
10440
|
init_model_capability_aliases();
|
|
@@ -10552,19 +10455,13 @@ var init_src2 = __esm(() => {
|
|
|
10552
10455
|
});
|
|
10553
10456
|
|
|
10554
10457
|
// packages/omo-opencode/src/shared/model-sanitizer.ts
|
|
10555
|
-
var init_model_sanitizer =
|
|
10556
|
-
init_src2();
|
|
10557
|
-
});
|
|
10458
|
+
var init_model_sanitizer = () => {};
|
|
10558
10459
|
|
|
10559
10460
|
// packages/omo-opencode/src/shared/snake-case.ts
|
|
10560
|
-
var init_snake_case2 =
|
|
10561
|
-
init_src();
|
|
10562
|
-
});
|
|
10461
|
+
var init_snake_case2 = () => {};
|
|
10563
10462
|
|
|
10564
10463
|
// packages/omo-opencode/src/shared/tool-name.ts
|
|
10565
|
-
var init_tool_name2 =
|
|
10566
|
-
init_src();
|
|
10567
|
-
});
|
|
10464
|
+
var init_tool_name2 = () => {};
|
|
10568
10465
|
|
|
10569
10466
|
// packages/omo-opencode/src/shared/pattern-matcher.ts
|
|
10570
10467
|
var regexCache;
|
|
@@ -10572,9 +10469,7 @@ var init_pattern_matcher = __esm(() => {
|
|
|
10572
10469
|
regexCache = new Map;
|
|
10573
10470
|
});
|
|
10574
10471
|
// packages/omo-opencode/src/shared/deep-merge.ts
|
|
10575
|
-
var init_deep_merge2 =
|
|
10576
|
-
init_src();
|
|
10577
|
-
});
|
|
10472
|
+
var init_deep_merge2 = () => {};
|
|
10578
10473
|
|
|
10579
10474
|
// packages/omo-opencode/src/shared/file-utils.ts
|
|
10580
10475
|
var init_file_utils2 = __esm(() => {
|
|
@@ -10582,9 +10477,7 @@ var init_file_utils2 = __esm(() => {
|
|
|
10582
10477
|
});
|
|
10583
10478
|
|
|
10584
10479
|
// packages/omo-opencode/src/shared/context-limit-resolver.ts
|
|
10585
|
-
var init_context_limit_resolver2 =
|
|
10586
|
-
init_src2();
|
|
10587
|
-
});
|
|
10480
|
+
var init_context_limit_resolver2 = () => {};
|
|
10588
10481
|
|
|
10589
10482
|
// packages/omo-opencode/src/shared/normalize-sdk-response.ts
|
|
10590
10483
|
function normalizeSDKResponse(response, fallback, options) {
|
|
@@ -10975,9 +10868,7 @@ function isGpt5_5Model(model) {
|
|
|
10975
10868
|
const modelName = extractModelName(model).toLowerCase();
|
|
10976
10869
|
return modelName.includes("gpt-5.5") || modelName.includes("gpt-5-5");
|
|
10977
10870
|
}
|
|
10978
|
-
var init_types =
|
|
10979
|
-
init_src2();
|
|
10980
|
-
});
|
|
10871
|
+
var init_types = () => {};
|
|
10981
10872
|
|
|
10982
10873
|
// packages/omo-opencode/src/tools/delegate-task/openai-categories.ts
|
|
10983
10874
|
function resolveDeepCategoryPromptAppend(model) {
|
|
@@ -11481,9 +11372,7 @@ var init_zip_extractor = __esm(() => {
|
|
|
11481
11372
|
});
|
|
11482
11373
|
|
|
11483
11374
|
// packages/omo-opencode/src/shared/bun-file-shim.ts
|
|
11484
|
-
var init_bun_file_shim =
|
|
11485
|
-
init_runtime();
|
|
11486
|
-
});
|
|
11375
|
+
var init_bun_file_shim = () => {};
|
|
11487
11376
|
|
|
11488
11377
|
// packages/omo-opencode/src/shared/binary-downloader.ts
|
|
11489
11378
|
import { chmodSync, existsSync as existsSync12, mkdirSync as mkdirSync4, unlinkSync as unlinkSync3 } from "node:fs";
|
|
@@ -11645,9 +11534,7 @@ function detectShellType() {
|
|
|
11645
11534
|
}
|
|
11646
11535
|
return process.platform === "win32" ? "cmd" : "unix";
|
|
11647
11536
|
}
|
|
11648
|
-
var init_shell_env =
|
|
11649
|
-
init_src();
|
|
11650
|
-
});
|
|
11537
|
+
var init_shell_env = () => {};
|
|
11651
11538
|
|
|
11652
11539
|
// packages/omo-opencode/src/shared/system-directive.ts
|
|
11653
11540
|
var init_system_directive = () => {};
|
|
@@ -11738,8 +11625,8 @@ var init_json_file_cache_store = __esm(() => {
|
|
|
11738
11625
|
});
|
|
11739
11626
|
|
|
11740
11627
|
// packages/omo-opencode/src/shared/connected-providers-cache.ts
|
|
11741
|
-
var
|
|
11742
|
-
__export(
|
|
11628
|
+
var exports_connected_providers_cache = {};
|
|
11629
|
+
__export(exports_connected_providers_cache, {
|
|
11743
11630
|
writeProviderModelsCache: () => writeProviderModelsCache,
|
|
11744
11631
|
updateConnectedProvidersCache: () => updateConnectedProvidersCache,
|
|
11745
11632
|
readProviderModelsCache: () => readProviderModelsCache,
|
|
@@ -11914,7 +11801,7 @@ function findProviderModelMetadata(providerID, modelID, cache = defaultConnected
|
|
|
11914
11801
|
return;
|
|
11915
11802
|
}
|
|
11916
11803
|
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;
|
|
11917
|
-
var
|
|
11804
|
+
var init_connected_providers_cache = __esm(() => {
|
|
11918
11805
|
init_src();
|
|
11919
11806
|
init_logger2();
|
|
11920
11807
|
init_data_path();
|
|
@@ -11934,18 +11821,15 @@ var init_connected_providers_cache2 = __esm(() => {
|
|
|
11934
11821
|
// packages/omo-opencode/src/shared/model-resolver.ts
|
|
11935
11822
|
var init_model_resolver2 = __esm(() => {
|
|
11936
11823
|
init_src2();
|
|
11937
|
-
|
|
11824
|
+
init_connected_providers_cache();
|
|
11938
11825
|
});
|
|
11939
11826
|
|
|
11940
11827
|
// packages/omo-opencode/src/shared/model-normalization.ts
|
|
11941
|
-
var init_model_normalization =
|
|
11942
|
-
init_src2();
|
|
11943
|
-
});
|
|
11828
|
+
var init_model_normalization = () => {};
|
|
11944
11829
|
|
|
11945
11830
|
// packages/omo-opencode/src/shared/model-resolution-pipeline.ts
|
|
11946
|
-
var
|
|
11947
|
-
|
|
11948
|
-
init_connected_providers_cache2();
|
|
11831
|
+
var init_model_resolution_pipeline = __esm(() => {
|
|
11832
|
+
init_connected_providers_cache();
|
|
11949
11833
|
});
|
|
11950
11834
|
|
|
11951
11835
|
// packages/omo-opencode/src/shared/model-availability.ts
|
|
@@ -11961,7 +11845,7 @@ function isModelCacheAvailable() {
|
|
|
11961
11845
|
var init_model_availability = __esm(() => {
|
|
11962
11846
|
init_logger2();
|
|
11963
11847
|
init_data_path();
|
|
11964
|
-
|
|
11848
|
+
init_connected_providers_cache();
|
|
11965
11849
|
});
|
|
11966
11850
|
|
|
11967
11851
|
// packages/omo-opencode/src/generated/model-capabilities.generated.json
|
|
@@ -62061,12 +61945,12 @@ function getModelCapabilities2(input) {
|
|
|
62061
61945
|
return getModelCapabilities({
|
|
62062
61946
|
...input,
|
|
62063
61947
|
bundledSnapshot: input.bundledSnapshot ?? getBundledModelCapabilitiesSnapshotForRuntime(),
|
|
62064
|
-
providerCache: input.providerCache ??
|
|
61948
|
+
providerCache: input.providerCache ?? exports_connected_providers_cache
|
|
62065
61949
|
});
|
|
62066
61950
|
}
|
|
62067
61951
|
var init_model_capabilities2 = __esm(() => {
|
|
62068
61952
|
init_src2();
|
|
62069
|
-
|
|
61953
|
+
init_connected_providers_cache();
|
|
62070
61954
|
init_model_capabilities_generated();
|
|
62071
61955
|
});
|
|
62072
61956
|
|
|
@@ -62120,13 +62004,11 @@ var init_model_capabilities_cache = __esm(() => {
|
|
|
62120
62004
|
});
|
|
62121
62005
|
|
|
62122
62006
|
// packages/omo-opencode/src/shared/model-settings-compatibility.ts
|
|
62123
|
-
var init_model_settings_compatibility2 =
|
|
62124
|
-
init_src2();
|
|
62125
|
-
});
|
|
62007
|
+
var init_model_settings_compatibility2 = () => {};
|
|
62126
62008
|
|
|
62127
62009
|
// packages/omo-opencode/src/shared/fallback-model-availability.ts
|
|
62128
62010
|
var init_fallback_model_availability = __esm(() => {
|
|
62129
|
-
|
|
62011
|
+
init_connected_providers_cache();
|
|
62130
62012
|
init_logger2();
|
|
62131
62013
|
init_model_availability();
|
|
62132
62014
|
});
|
|
@@ -62334,10 +62216,10 @@ var init_constants3 = __esm(() => {
|
|
|
62334
62216
|
SESSION_TIMEOUT_MS = 60 * 60 * 1000;
|
|
62335
62217
|
SESSION_MISSING_GRACE_MS = 30 * 1000;
|
|
62336
62218
|
});
|
|
62219
|
+
|
|
62337
62220
|
// packages/tmux-core/src/runner.ts
|
|
62338
|
-
var init_runner =
|
|
62339
|
-
|
|
62340
|
-
});
|
|
62221
|
+
var init_runner = () => {};
|
|
62222
|
+
|
|
62341
62223
|
// packages/tmux-core/src/tmux-utils/server-health.ts
|
|
62342
62224
|
var SERVER_RUNNING_KEY;
|
|
62343
62225
|
var init_server_health = __esm(() => {
|
|
@@ -62345,63 +62227,37 @@ var init_server_health = __esm(() => {
|
|
|
62345
62227
|
});
|
|
62346
62228
|
|
|
62347
62229
|
// packages/tmux-core/src/tmux-utils/pane-dimensions.ts
|
|
62348
|
-
var init_pane_dimensions =
|
|
62349
|
-
init_runner();
|
|
62350
|
-
});
|
|
62230
|
+
var init_pane_dimensions = () => {};
|
|
62351
62231
|
|
|
62352
62232
|
// packages/tmux-core/src/tmux-utils/pane-command.ts
|
|
62353
|
-
var init_pane_command =
|
|
62354
|
-
init_src();
|
|
62355
|
-
});
|
|
62233
|
+
var init_pane_command = () => {};
|
|
62356
62234
|
|
|
62357
62235
|
// packages/tmux-core/src/tmux-utils/pane-spawn.ts
|
|
62358
|
-
var init_pane_spawn =
|
|
62359
|
-
|
|
62360
|
-
init_pane_command();
|
|
62361
|
-
});
|
|
62236
|
+
var init_pane_spawn = () => {};
|
|
62237
|
+
|
|
62362
62238
|
// packages/tmux-core/src/tmux-utils/pane-replace.ts
|
|
62363
|
-
var init_pane_replace =
|
|
62364
|
-
init_pane_command();
|
|
62365
|
-
});
|
|
62239
|
+
var init_pane_replace = () => {};
|
|
62366
62240
|
|
|
62367
62241
|
// packages/tmux-core/src/tmux-utils/pane-activate.ts
|
|
62368
|
-
var init_pane_activate =
|
|
62369
|
-
init_runner();
|
|
62370
|
-
init_pane_command();
|
|
62371
|
-
});
|
|
62242
|
+
var init_pane_activate = () => {};
|
|
62372
62243
|
|
|
62373
62244
|
// packages/tmux-core/src/tmux-utils/window-spawn.ts
|
|
62374
|
-
var init_window_spawn =
|
|
62375
|
-
init_server_health();
|
|
62376
|
-
init_pane_command();
|
|
62377
|
-
});
|
|
62245
|
+
var init_window_spawn = () => {};
|
|
62378
62246
|
|
|
62379
62247
|
// packages/tmux-core/src/tmux-utils/session-spawn.ts
|
|
62380
|
-
var init_session_spawn =
|
|
62381
|
-
init_server_health();
|
|
62382
|
-
init_pane_command();
|
|
62383
|
-
});
|
|
62248
|
+
var init_session_spawn = () => {};
|
|
62384
62249
|
|
|
62385
62250
|
// packages/tmux-core/src/tmux-utils/session-kill.ts
|
|
62386
|
-
var init_session_kill =
|
|
62387
|
-
init_runner();
|
|
62388
|
-
});
|
|
62251
|
+
var init_session_kill = () => {};
|
|
62389
62252
|
|
|
62390
62253
|
// packages/tmux-core/src/tmux-utils/stale-session-sweep.ts
|
|
62391
|
-
var init_stale_session_sweep =
|
|
62392
|
-
init_runner();
|
|
62393
|
-
init_session_kill();
|
|
62394
|
-
});
|
|
62254
|
+
var init_stale_session_sweep = () => {};
|
|
62395
62255
|
|
|
62396
62256
|
// packages/tmux-core/src/tmux-utils/layout.ts
|
|
62397
|
-
var init_layout =
|
|
62398
|
-
init_runner();
|
|
62399
|
-
});
|
|
62257
|
+
var init_layout = () => {};
|
|
62400
62258
|
|
|
62401
62259
|
// packages/tmux-core/src/tmux-utils/spawn-process.ts
|
|
62402
|
-
var init_spawn_process =
|
|
62403
|
-
init_runtime();
|
|
62404
|
-
});
|
|
62260
|
+
var init_spawn_process = () => {};
|
|
62405
62261
|
|
|
62406
62262
|
// packages/tmux-core/src/tmux-utils.ts
|
|
62407
62263
|
var init_tmux_utils = __esm(() => {
|
|
@@ -62428,34 +62284,22 @@ var init_src3 = __esm(() => {
|
|
|
62428
62284
|
});
|
|
62429
62285
|
|
|
62430
62286
|
// packages/omo-opencode/src/shared/tmux/constants.ts
|
|
62431
|
-
var init_constants4 =
|
|
62432
|
-
init_src3();
|
|
62433
|
-
});
|
|
62287
|
+
var init_constants4 = () => {};
|
|
62434
62288
|
|
|
62435
62289
|
// packages/omo-opencode/src/shared/tmux/cmux-detect.ts
|
|
62436
|
-
var init_cmux_detect =
|
|
62437
|
-
init_src3();
|
|
62438
|
-
});
|
|
62290
|
+
var init_cmux_detect = () => {};
|
|
62439
62291
|
|
|
62440
62292
|
// packages/omo-opencode/src/shared/tmux/runner.ts
|
|
62441
|
-
var init_runner2 =
|
|
62442
|
-
init_src3();
|
|
62443
|
-
});
|
|
62293
|
+
var init_runner2 = () => {};
|
|
62444
62294
|
|
|
62445
62295
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/environment.ts
|
|
62446
|
-
var init_environment =
|
|
62447
|
-
init_src3();
|
|
62448
|
-
});
|
|
62296
|
+
var init_environment = () => {};
|
|
62449
62297
|
|
|
62450
62298
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/server-health.ts
|
|
62451
|
-
var init_server_health2 =
|
|
62452
|
-
init_src3();
|
|
62453
|
-
});
|
|
62299
|
+
var init_server_health2 = () => {};
|
|
62454
62300
|
|
|
62455
62301
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-dimensions.ts
|
|
62456
|
-
var init_pane_dimensions2 =
|
|
62457
|
-
init_src3();
|
|
62458
|
-
});
|
|
62302
|
+
var init_pane_dimensions2 = () => {};
|
|
62459
62303
|
|
|
62460
62304
|
// packages/omo-opencode/src/shared/bun-which-shim.ts
|
|
62461
62305
|
var init_bun_which_shim = __esm(() => {
|
|
@@ -62480,61 +62324,46 @@ var init_adapter_deps = __esm(() => {
|
|
|
62480
62324
|
|
|
62481
62325
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-spawn.ts
|
|
62482
62326
|
var init_pane_spawn2 = __esm(() => {
|
|
62483
|
-
init_src3();
|
|
62484
62327
|
init_adapter_deps();
|
|
62485
62328
|
});
|
|
62486
62329
|
|
|
62487
62330
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-close.ts
|
|
62488
|
-
var init_pane_close =
|
|
62489
|
-
init_src3();
|
|
62490
|
-
});
|
|
62331
|
+
var init_pane_close = () => {};
|
|
62491
62332
|
|
|
62492
62333
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-replace.ts
|
|
62493
62334
|
var init_pane_replace2 = __esm(() => {
|
|
62494
|
-
init_src3();
|
|
62495
62335
|
init_adapter_deps();
|
|
62496
62336
|
});
|
|
62497
62337
|
|
|
62498
62338
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-activate.ts
|
|
62499
62339
|
var init_pane_activate2 = __esm(() => {
|
|
62500
|
-
init_src3();
|
|
62501
62340
|
init_adapter_deps();
|
|
62502
62341
|
});
|
|
62503
62342
|
|
|
62504
62343
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/window-spawn.ts
|
|
62505
62344
|
var init_window_spawn2 = __esm(() => {
|
|
62506
|
-
init_src3();
|
|
62507
62345
|
init_adapter_deps();
|
|
62508
62346
|
});
|
|
62509
62347
|
|
|
62510
62348
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/session-spawn.ts
|
|
62511
62349
|
var init_session_spawn2 = __esm(() => {
|
|
62512
|
-
init_src3();
|
|
62513
62350
|
init_adapter_deps();
|
|
62514
62351
|
});
|
|
62515
62352
|
|
|
62516
62353
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/session-kill.ts
|
|
62517
|
-
var init_session_kill2 =
|
|
62518
|
-
init_src3();
|
|
62519
|
-
});
|
|
62354
|
+
var init_session_kill2 = () => {};
|
|
62520
62355
|
|
|
62521
62356
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/stale-session-sweep.ts
|
|
62522
|
-
var init_stale_session_sweep2 =
|
|
62523
|
-
init_src3();
|
|
62524
|
-
});
|
|
62357
|
+
var init_stale_session_sweep2 = () => {};
|
|
62525
62358
|
|
|
62526
62359
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/stale-attach-pane-sweep.ts
|
|
62527
62360
|
var init_stale_attach_pane_sweep = () => {};
|
|
62528
62361
|
|
|
62529
62362
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/pane-command.ts
|
|
62530
|
-
var init_pane_command2 =
|
|
62531
|
-
init_src3();
|
|
62532
|
-
});
|
|
62363
|
+
var init_pane_command2 = () => {};
|
|
62533
62364
|
|
|
62534
62365
|
// packages/omo-opencode/src/shared/tmux/tmux-utils/layout.ts
|
|
62535
|
-
var init_layout2 =
|
|
62536
|
-
init_src3();
|
|
62537
|
-
});
|
|
62366
|
+
var init_layout2 = () => {};
|
|
62538
62367
|
|
|
62539
62368
|
// packages/omo-opencode/src/shared/tmux/tmux-utils.ts
|
|
62540
62369
|
var init_tmux_utils2 = __esm(() => {
|
|
@@ -64906,7 +64735,6 @@ var init_prompt_failure_classifier = () => {};
|
|
|
64906
64735
|
|
|
64907
64736
|
// packages/omo-opencode/src/shared/model-suggestion-retry.ts
|
|
64908
64737
|
var init_model_suggestion_retry = __esm(() => {
|
|
64909
|
-
init_src2();
|
|
64910
64738
|
init_logger2();
|
|
64911
64739
|
init_prompt_async_gate2();
|
|
64912
64740
|
init_prompt_failure_classifier();
|
|
@@ -64914,7 +64742,6 @@ var init_model_suggestion_retry = __esm(() => {
|
|
|
64914
64742
|
|
|
64915
64743
|
// packages/omo-opencode/src/shared/opencode-provider-auth.ts
|
|
64916
64744
|
var init_opencode_provider_auth = __esm(() => {
|
|
64917
|
-
init_src();
|
|
64918
64745
|
init_data_path();
|
|
64919
64746
|
init_logger2();
|
|
64920
64747
|
});
|
|
@@ -65045,9 +64872,7 @@ var init_logger3 = __esm(() => {
|
|
|
65045
64872
|
});
|
|
65046
64873
|
|
|
65047
64874
|
// packages/claude-code-compat-core/src/shared/contains-path.ts
|
|
65048
|
-
var init_contains_path3 =
|
|
65049
|
-
init_src();
|
|
65050
|
-
});
|
|
64875
|
+
var init_contains_path3 = () => {};
|
|
65051
64876
|
|
|
65052
64877
|
// packages/claude-code-compat-core/src/features/claude-code-plugin-loader/scope-filter.ts
|
|
65053
64878
|
var init_scope_filter = __esm(() => {
|
|
@@ -65109,19 +64934,13 @@ var init_discovery = __esm(() => {
|
|
|
65109
64934
|
});
|
|
65110
64935
|
|
|
65111
64936
|
// packages/claude-code-compat-core/src/shared/frontmatter.ts
|
|
65112
|
-
var init_frontmatter3 =
|
|
65113
|
-
init_src();
|
|
65114
|
-
});
|
|
64937
|
+
var init_frontmatter3 = () => {};
|
|
65115
64938
|
|
|
65116
64939
|
// packages/claude-code-compat-core/src/shared/file-utils.ts
|
|
65117
|
-
var init_file_utils3 =
|
|
65118
|
-
init_src();
|
|
65119
|
-
});
|
|
64940
|
+
var init_file_utils3 = () => {};
|
|
65120
64941
|
|
|
65121
64942
|
// packages/claude-code-compat-core/src/shared/model-sanitizer.ts
|
|
65122
|
-
var init_model_sanitizer2 =
|
|
65123
|
-
init_src2();
|
|
65124
|
-
});
|
|
64943
|
+
var init_model_sanitizer2 = () => {};
|
|
65125
64944
|
// packages/claude-code-compat-core/src/features/claude-code-plugin-loader/command-loader.ts
|
|
65126
64945
|
var init_command_loader = __esm(() => {
|
|
65127
64946
|
init_frontmatter3();
|
|
@@ -65142,14 +64961,10 @@ var init_skill_loader = __esm(() => {
|
|
|
65142
64961
|
init_logger3();
|
|
65143
64962
|
});
|
|
65144
64963
|
// packages/claude-code-compat-core/src/shared/model-format-normalizer.ts
|
|
65145
|
-
var init_model_format_normalizer =
|
|
65146
|
-
init_src2();
|
|
65147
|
-
});
|
|
64964
|
+
var init_model_format_normalizer = () => {};
|
|
65148
64965
|
|
|
65149
64966
|
// packages/claude-code-compat-core/src/shared/model-normalization.ts
|
|
65150
|
-
var init_model_normalization2 =
|
|
65151
|
-
init_src2();
|
|
65152
|
-
});
|
|
64967
|
+
var init_model_normalization2 = () => {};
|
|
65153
64968
|
|
|
65154
64969
|
// packages/claude-code-compat-core/src/features/claude-code-agent-loader/claude-model-mapper.ts
|
|
65155
64970
|
var ANTHROPIC_PREFIX = "anthropic/", CLAUDE_CODE_ALIAS_MAP;
|
|
@@ -65179,7 +64994,6 @@ var init_configure_allowed_env_vars = __esm(() => {
|
|
|
65179
64994
|
|
|
65180
64995
|
// packages/claude-code-compat-core/src/features/claude-code-mcp-loader/env-expander.ts
|
|
65181
64996
|
var init_env_expander = __esm(() => {
|
|
65182
|
-
init_src();
|
|
65183
64997
|
init_logger3();
|
|
65184
64998
|
init_configure_allowed_env_vars();
|
|
65185
64999
|
});
|
|
@@ -65195,9 +65009,7 @@ var init_transformer = __esm(() => {
|
|
|
65195
65009
|
});
|
|
65196
65010
|
|
|
65197
65011
|
// packages/claude-code-compat-core/src/shared/bun-file-shim.ts
|
|
65198
|
-
var init_bun_file_shim2 =
|
|
65199
|
-
init_runtime();
|
|
65200
|
-
});
|
|
65012
|
+
var init_bun_file_shim2 = () => {};
|
|
65201
65013
|
|
|
65202
65014
|
// packages/claude-code-compat-core/src/features/claude-code-plugin-loader/mcp-server-loader.ts
|
|
65203
65015
|
var init_mcp_server_loader = __esm(() => {
|
|
@@ -65349,9 +65161,7 @@ var init_legacy_workspace_migration = __esm(() => {
|
|
|
65349
65161
|
init_logger2();
|
|
65350
65162
|
});
|
|
65351
65163
|
// packages/omo-opencode/src/shared/model-string-parser.ts
|
|
65352
|
-
var init_model_string_parser2 =
|
|
65353
|
-
init_src2();
|
|
65354
|
-
});
|
|
65164
|
+
var init_model_string_parser2 = () => {};
|
|
65355
65165
|
|
|
65356
65166
|
// packages/omo-opencode/src/shared/excluded-dirs.ts
|
|
65357
65167
|
var EXCLUDED_DIR_NAMES, EXCLUDED_DIRS;
|
|
@@ -65376,15 +65186,13 @@ var init_excluded_dirs = __esm(() => {
|
|
|
65376
65186
|
});
|
|
65377
65187
|
|
|
65378
65188
|
// packages/omo-opencode/src/shared/replace-tool-args.ts
|
|
65379
|
-
var init_replace_tool_args =
|
|
65380
|
-
init_src();
|
|
65381
|
-
});
|
|
65189
|
+
var init_replace_tool_args = () => {};
|
|
65382
65190
|
|
|
65383
65191
|
// packages/omo-opencode/src/shared/index.ts
|
|
65384
65192
|
var init_shared = __esm(() => {
|
|
65385
65193
|
init_model_normalization();
|
|
65386
65194
|
init_model_resolver2();
|
|
65387
|
-
|
|
65195
|
+
init_model_resolution_pipeline();
|
|
65388
65196
|
init_session_category_registry();
|
|
65389
65197
|
init_model_string_parser2();
|
|
65390
65198
|
init_excluded_dirs();
|
|
@@ -65425,7 +65233,7 @@ var init_shared = __esm(() => {
|
|
|
65425
65233
|
init_model_capabilities_cache();
|
|
65426
65234
|
init_model_settings_compatibility2();
|
|
65427
65235
|
init_fallback_model_availability();
|
|
65428
|
-
|
|
65236
|
+
init_connected_providers_cache();
|
|
65429
65237
|
init_context_limit_resolver2();
|
|
65430
65238
|
init_session_utils();
|
|
65431
65239
|
init_event_session_id();
|
|
@@ -66882,20 +66690,20 @@ var init_config_manager = __esm(() => {
|
|
|
66882
66690
|
|
|
66883
66691
|
// packages/telemetry-core/src/activity-state.ts
|
|
66884
66692
|
import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync13 } from "node:fs";
|
|
66885
|
-
import { basename as basename10, join as
|
|
66693
|
+
import { basename as basename10, join as join51 } from "node:path";
|
|
66886
66694
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
66887
66695
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
66888
66696
|
env: options.env,
|
|
66889
66697
|
osProvider: options.osProvider
|
|
66890
66698
|
});
|
|
66891
|
-
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined :
|
|
66699
|
+
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join51(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
66892
66700
|
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
|
|
66893
66701
|
return dataDir;
|
|
66894
66702
|
}
|
|
66895
|
-
return
|
|
66703
|
+
return join51(dataDir, product.cacheDirName);
|
|
66896
66704
|
}
|
|
66897
66705
|
function getTelemetryActivityStateFilePath(stateDir) {
|
|
66898
|
-
return
|
|
66706
|
+
return join51(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
|
|
66899
66707
|
}
|
|
66900
66708
|
function getDailyActiveCaptureState(input) {
|
|
66901
66709
|
const state = readPostHogActivityState(input.stateDir, input.diagnostics);
|
|
@@ -66966,9 +66774,9 @@ var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY =
|
|
|
66966
66774
|
|
|
66967
66775
|
// packages/telemetry-core/src/diagnostics.ts
|
|
66968
66776
|
import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync14 } from "node:fs";
|
|
66969
|
-
import { join as
|
|
66777
|
+
import { join as join52 } from "node:path";
|
|
66970
66778
|
function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
|
|
66971
|
-
return
|
|
66779
|
+
return join52(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
|
|
66972
66780
|
}
|
|
66973
66781
|
function writeTelemetryDiagnostic(input, options) {
|
|
66974
66782
|
const now = options.now ?? new Date;
|
|
@@ -72672,11 +72480,7 @@ var init_posthog_client = __esm(() => {
|
|
|
72672
72480
|
});
|
|
72673
72481
|
|
|
72674
72482
|
// packages/telemetry-core/src/record-daily-active.ts
|
|
72675
|
-
var init_record_daily_active =
|
|
72676
|
-
init_activity_state();
|
|
72677
|
-
init_posthog_client();
|
|
72678
|
-
init_machine_id();
|
|
72679
|
-
});
|
|
72483
|
+
var init_record_daily_active = () => {};
|
|
72680
72484
|
|
|
72681
72485
|
// packages/telemetry-core/src/index.ts
|
|
72682
72486
|
var init_src4 = __esm(() => {
|
|
@@ -72693,7 +72497,7 @@ var package_default2;
|
|
|
72693
72497
|
var init_package2 = __esm(() => {
|
|
72694
72498
|
package_default2 = {
|
|
72695
72499
|
name: "@oh-my-opencode/omo-codex",
|
|
72696
|
-
version: "4.
|
|
72500
|
+
version: "4.16.1",
|
|
72697
72501
|
type: "module",
|
|
72698
72502
|
private: true,
|
|
72699
72503
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -73040,7 +72844,7 @@ function stripJsonComments(json2) {
|
|
|
73040
72844
|
|
|
73041
72845
|
// packages/omo-opencode/src/hooks/auto-update-checker/checker/local-dev-path.ts
|
|
73042
72846
|
import * as fs6 from "node:fs";
|
|
73043
|
-
import { fileURLToPath as
|
|
72847
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
73044
72848
|
function isLocalDevMode(directory) {
|
|
73045
72849
|
return getLocalDevPath(directory) !== null;
|
|
73046
72850
|
}
|
|
@@ -73058,7 +72862,7 @@ function getLocalDevPath(directory) {
|
|
|
73058
72862
|
if (!ACCEPTED_PACKAGE_NAMES2.some((name) => entry.includes(name)))
|
|
73059
72863
|
continue;
|
|
73060
72864
|
try {
|
|
73061
|
-
return
|
|
72865
|
+
return fileURLToPath3(entry);
|
|
73062
72866
|
} catch (error51) {
|
|
73063
72867
|
if (!(error51 instanceof Error)) {
|
|
73064
72868
|
throw error51;
|
|
@@ -73183,7 +72987,7 @@ var init_plugin_entry = __esm(() => {
|
|
|
73183
72987
|
// packages/omo-opencode/src/hooks/auto-update-checker/checker/cached-version.ts
|
|
73184
72988
|
import * as fs10 from "node:fs";
|
|
73185
72989
|
import * as path11 from "node:path";
|
|
73186
|
-
import { fileURLToPath as
|
|
72990
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
73187
72991
|
function readPackageVersion(packageJsonPath) {
|
|
73188
72992
|
const content = fs10.readFileSync(packageJsonPath, "utf-8");
|
|
73189
72993
|
const pkg = JSON.parse(content);
|
|
@@ -73193,7 +72997,7 @@ function getCachedVersion(options = {}) {
|
|
|
73193
72997
|
const packageJsonCandidates = options.packageJsonCandidates ?? INSTALLED_PACKAGE_JSON_CANDIDATES;
|
|
73194
72998
|
const findPackageJson = options.findPackageJson ?? findPackageJsonUp;
|
|
73195
72999
|
try {
|
|
73196
|
-
const currentDir = options.currentDir === undefined ? path11.dirname(
|
|
73000
|
+
const currentDir = options.currentDir === undefined ? path11.dirname(fileURLToPath4(import.meta.url)) : options.currentDir;
|
|
73197
73001
|
if (currentDir) {
|
|
73198
73002
|
const pkgPath = findPackageJson(currentDir);
|
|
73199
73003
|
if (pkgPath) {
|
|
@@ -73662,20 +73466,20 @@ var init_update_toasts = __esm(() => {
|
|
|
73662
73466
|
});
|
|
73663
73467
|
|
|
73664
73468
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
73665
|
-
import { existsSync as
|
|
73666
|
-
import { dirname as
|
|
73667
|
-
import { fileURLToPath as
|
|
73469
|
+
import { existsSync as existsSync49 } from "node:fs";
|
|
73470
|
+
import { dirname as dirname27, join as join70 } from "node:path";
|
|
73471
|
+
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
73668
73472
|
function defaultGetModuleHostingWorkspace() {
|
|
73669
73473
|
try {
|
|
73670
|
-
const currentDir =
|
|
73474
|
+
const currentDir = dirname27(fileURLToPath5(import.meta.url));
|
|
73671
73475
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
73672
73476
|
if (!pkgJsonPath)
|
|
73673
73477
|
return null;
|
|
73674
|
-
const pkgDir =
|
|
73675
|
-
const nodeModulesDir =
|
|
73478
|
+
const pkgDir = dirname27(pkgJsonPath);
|
|
73479
|
+
const nodeModulesDir = dirname27(pkgDir);
|
|
73676
73480
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
73677
73481
|
return null;
|
|
73678
|
-
return
|
|
73482
|
+
return dirname27(nodeModulesDir);
|
|
73679
73483
|
} catch (error51) {
|
|
73680
73484
|
if (error51 instanceof Error) {
|
|
73681
73485
|
return null;
|
|
@@ -73816,8 +73620,8 @@ var init_background_update_check = __esm(() => {
|
|
|
73816
73620
|
init_package_json_locator();
|
|
73817
73621
|
init_update_toasts();
|
|
73818
73622
|
defaultDeps4 = {
|
|
73819
|
-
existsSync:
|
|
73820
|
-
join:
|
|
73623
|
+
existsSync: existsSync49,
|
|
73624
|
+
join: join70,
|
|
73821
73625
|
runBunInstallWithDetails,
|
|
73822
73626
|
log: log2,
|
|
73823
73627
|
getOpenCodeCacheDir,
|
|
@@ -73907,7 +73711,7 @@ async function updateAndShowConnectedProvidersCacheStatus(ctx) {
|
|
|
73907
73711
|
}
|
|
73908
73712
|
var CACHE_UPDATE_TIMEOUT_MS = 1e4;
|
|
73909
73713
|
var init_connected_providers_status = __esm(() => {
|
|
73910
|
-
|
|
73714
|
+
init_connected_providers_cache();
|
|
73911
73715
|
init_model_availability();
|
|
73912
73716
|
init_logger2();
|
|
73913
73717
|
});
|
|
@@ -73980,7 +73784,7 @@ async function showSpinnerToast(ctx, version3, message) {
|
|
|
73980
73784
|
duration: frameInterval + 50
|
|
73981
73785
|
}
|
|
73982
73786
|
}).catch(ignoreToastError);
|
|
73983
|
-
await new Promise((
|
|
73787
|
+
await new Promise((resolve20) => setTimeout(resolve20, frameInterval));
|
|
73984
73788
|
}
|
|
73985
73789
|
}
|
|
73986
73790
|
var SISYPHUS_SPINNER;
|
|
@@ -74166,6 +73970,9 @@ function formatConfigSummary(config) {
|
|
|
74166
73970
|
if (config.hasCodex) {
|
|
74167
73971
|
lines.push(` ${SYMBOLS.info} Codex autonomous mode: ${config.codexAutonomous ? "enabled" : "disabled"}`);
|
|
74168
73972
|
}
|
|
73973
|
+
if (config.hasSenpi) {
|
|
73974
|
+
lines.push(` ${SYMBOLS.info} Senpi adapter: enabled`);
|
|
73975
|
+
}
|
|
74169
73976
|
if (!config.hasOpenCode)
|
|
74170
73977
|
return lines.join(`
|
|
74171
73978
|
`);
|
|
@@ -74321,6 +74128,7 @@ function argsToConfig(args) {
|
|
|
74321
74128
|
const platform = resolvePlatform(args);
|
|
74322
74129
|
const hasOpenCode = platform === "opencode" || platform === "both";
|
|
74323
74130
|
const hasCodex = platform === "codex" || platform === "both";
|
|
74131
|
+
const hasSenpi = platform === "senpi";
|
|
74324
74132
|
return {
|
|
74325
74133
|
platform,
|
|
74326
74134
|
hasOpenCode,
|
|
@@ -74330,6 +74138,7 @@ function argsToConfig(args) {
|
|
|
74330
74138
|
hasGemini: hasOpenCode && args.gemini === "yes",
|
|
74331
74139
|
hasCopilot: hasOpenCode && args.copilot === "yes",
|
|
74332
74140
|
hasCodex,
|
|
74141
|
+
hasSenpi,
|
|
74333
74142
|
hasOpencodeZen: hasOpenCode && args.opencodeZen === "yes",
|
|
74334
74143
|
hasZaiCodingPlan: hasOpenCode && args.zaiCodingPlan === "yes",
|
|
74335
74144
|
hasKimiForCoding: hasOpenCode && args.kimiForCoding === "yes",
|
|
@@ -74421,7 +74230,7 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
|
|
|
74421
74230
|
}
|
|
74422
74231
|
|
|
74423
74232
|
// packages/omo-codex/src/install/install-codex.ts
|
|
74424
|
-
import { join as
|
|
74233
|
+
import { join as join53, resolve as resolve15 } from "node:path";
|
|
74425
74234
|
import { existsSync as existsSync30 } from "node:fs";
|
|
74426
74235
|
import { homedir as homedir6 } from "node:os";
|
|
74427
74236
|
|
|
@@ -76602,9 +76411,14 @@ function readBooleanSetting(sectionText, key) {
|
|
|
76602
76411
|
// packages/omo-codex/src/install/codex-config-toml.ts
|
|
76603
76412
|
async function updateCodexConfig(input) {
|
|
76604
76413
|
await mkdir5(dirname15(input.configPath), { recursive: true });
|
|
76605
|
-
let config
|
|
76606
|
-
|
|
76414
|
+
let config;
|
|
76415
|
+
try {
|
|
76607
76416
|
config = await readFile11(input.configPath, "utf8");
|
|
76417
|
+
} catch (error) {
|
|
76418
|
+
if (!isMissingFileError(error))
|
|
76419
|
+
throw error;
|
|
76420
|
+
config = "";
|
|
76421
|
+
}
|
|
76608
76422
|
const pluginSet = new Set(input.pluginNames);
|
|
76609
76423
|
for (const legacyMarketplaceName of legacyMarketplaceNames(input.marketplaceName)) {
|
|
76610
76424
|
config = removeMarketplaceBlock(config, legacyMarketplaceName);
|
|
@@ -76638,15 +76452,8 @@ async function updateCodexConfig(input) {
|
|
|
76638
76452
|
await writeFileAtomic(input.configPath, `${config.trimEnd()}
|
|
76639
76453
|
`);
|
|
76640
76454
|
}
|
|
76641
|
-
|
|
76642
|
-
|
|
76643
|
-
await readFile11(path7, "utf8");
|
|
76644
|
-
return true;
|
|
76645
|
-
} catch (error) {
|
|
76646
|
-
if (error instanceof Error)
|
|
76647
|
-
return false;
|
|
76648
|
-
return false;
|
|
76649
|
-
}
|
|
76455
|
+
function isMissingFileError(error) {
|
|
76456
|
+
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
76650
76457
|
}
|
|
76651
76458
|
|
|
76652
76459
|
// packages/omo-codex/src/install/codex-hook-trust.ts
|
|
@@ -76667,7 +76474,7 @@ var EVENT_LABELS = new Map([
|
|
|
76667
76474
|
]);
|
|
76668
76475
|
async function trustedHookStatesForPlugin(input) {
|
|
76669
76476
|
const manifestPath = join39(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
76670
|
-
if (!await
|
|
76477
|
+
if (!await exists(manifestPath))
|
|
76671
76478
|
return [];
|
|
76672
76479
|
const manifest = JSON.parse(await readFile12(manifestPath, "utf8"));
|
|
76673
76480
|
if (!isPlainRecord3(manifest))
|
|
@@ -76675,7 +76482,7 @@ async function trustedHookStatesForPlugin(input) {
|
|
|
76675
76482
|
const states = [];
|
|
76676
76483
|
for (const hookPath of hookManifestPaths2(manifest.hooks)) {
|
|
76677
76484
|
const hooksPath = join39(input.pluginRoot, hookPath);
|
|
76678
|
-
if (!await
|
|
76485
|
+
if (!await exists(hooksPath))
|
|
76679
76486
|
continue;
|
|
76680
76487
|
const parsed = JSON.parse(await readFile12(hooksPath, "utf8"));
|
|
76681
76488
|
if (!isPlainRecord3(parsed) || !isPlainRecord3(parsed.hooks))
|
|
@@ -76758,7 +76565,7 @@ function canonicalJson(value) {
|
|
|
76758
76565
|
function stripDotSlash2(value) {
|
|
76759
76566
|
return value.startsWith("./") ? value.slice(2) : value;
|
|
76760
76567
|
}
|
|
76761
|
-
async function
|
|
76568
|
+
async function exists(path7) {
|
|
76762
76569
|
try {
|
|
76763
76570
|
await readFile12(path7, "utf8");
|
|
76764
76571
|
return true;
|
|
@@ -76818,11 +76625,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
|
|
|
76818
76625
|
];
|
|
76819
76626
|
async function purgeRetiredManagedAgentFiles(input) {
|
|
76820
76627
|
const agentsDir = join40(input.codexHome, "agents");
|
|
76821
|
-
if (!await
|
|
76628
|
+
if (!await exists2(agentsDir))
|
|
76822
76629
|
return;
|
|
76823
76630
|
for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
|
|
76824
76631
|
const agentPath = join40(agentsDir, retiredAgent.fileName);
|
|
76825
|
-
if (!await
|
|
76632
|
+
if (!await exists2(agentPath))
|
|
76826
76633
|
continue;
|
|
76827
76634
|
const agentStat = await lstat7(agentPath);
|
|
76828
76635
|
if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
|
|
@@ -76845,7 +76652,7 @@ async function readTextIfExists(path7) {
|
|
|
76845
76652
|
throw error;
|
|
76846
76653
|
}
|
|
76847
76654
|
}
|
|
76848
|
-
async function
|
|
76655
|
+
async function exists2(path7) {
|
|
76849
76656
|
try {
|
|
76850
76657
|
await lstat7(path7);
|
|
76851
76658
|
return true;
|
|
@@ -76865,7 +76672,7 @@ function nodeErrorCode(error) {
|
|
|
76865
76672
|
var MANIFEST_FILE = ".installed-agents.json";
|
|
76866
76673
|
async function capturePreservedAgentReasoning(input) {
|
|
76867
76674
|
const agentsDir = join41(input.codexHome, "agents");
|
|
76868
|
-
if (!await
|
|
76675
|
+
if (!await exists3(agentsDir))
|
|
76869
76676
|
return new Map;
|
|
76870
76677
|
const preserved = new Map;
|
|
76871
76678
|
const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
|
|
@@ -76883,7 +76690,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
76883
76690
|
}
|
|
76884
76691
|
async function capturePreservedAgentServiceTier(input) {
|
|
76885
76692
|
const agentsDir = join41(input.codexHome, "agents");
|
|
76886
|
-
if (!await
|
|
76693
|
+
if (!await exists3(agentsDir))
|
|
76887
76694
|
return new Map;
|
|
76888
76695
|
const preserved = new Map;
|
|
76889
76696
|
const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
|
|
@@ -76941,7 +76748,7 @@ async function restorePreservedServiceTier(input) {
|
|
|
76941
76748
|
}
|
|
76942
76749
|
async function discoverBundledAgents(pluginRoot) {
|
|
76943
76750
|
const componentsRoot = join41(pluginRoot, "components");
|
|
76944
|
-
if (!await
|
|
76751
|
+
if (!await exists3(componentsRoot))
|
|
76945
76752
|
return [];
|
|
76946
76753
|
const componentEntries = await readdir6(componentsRoot, { withFileTypes: true });
|
|
76947
76754
|
const agents = [];
|
|
@@ -76949,7 +76756,7 @@ async function discoverBundledAgents(pluginRoot) {
|
|
|
76949
76756
|
if (!entry.isDirectory())
|
|
76950
76757
|
continue;
|
|
76951
76758
|
const agentsRoot = join41(componentsRoot, entry.name, "agents");
|
|
76952
|
-
if (!await
|
|
76759
|
+
if (!await exists3(agentsRoot))
|
|
76953
76760
|
continue;
|
|
76954
76761
|
const agentEntries = await readdir6(agentsRoot, { withFileTypes: true });
|
|
76955
76762
|
for (const file2 of agentEntries) {
|
|
@@ -76966,7 +76773,7 @@ async function replaceWithCopy(linkPath, target) {
|
|
|
76966
76773
|
await copyFile(target, linkPath);
|
|
76967
76774
|
}
|
|
76968
76775
|
async function prepareReplacement(linkPath) {
|
|
76969
|
-
if (!await
|
|
76776
|
+
if (!await exists3(linkPath))
|
|
76970
76777
|
return;
|
|
76971
76778
|
const entryStat = await lstat8(linkPath);
|
|
76972
76779
|
if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
|
|
@@ -77085,7 +76892,7 @@ function parseJsonString(value) {
|
|
|
77085
76892
|
return null;
|
|
77086
76893
|
}
|
|
77087
76894
|
}
|
|
77088
|
-
async function
|
|
76895
|
+
async function exists3(path7) {
|
|
77089
76896
|
try {
|
|
77090
76897
|
await lstat8(path7);
|
|
77091
76898
|
return true;
|
|
@@ -77381,7 +77188,11 @@ function stampHookGroups(hooks, version) {
|
|
|
77381
77188
|
function stampHookStatusMessage(hook, version) {
|
|
77382
77189
|
if (!isPlainRecord3(hook) || typeof hook.statusMessage !== "string")
|
|
77383
77190
|
return;
|
|
77384
|
-
hook.statusMessage = hook.statusMessage.replace(/^LazyCodex\([^)]+\)
|
|
77191
|
+
hook.statusMessage = hook.statusMessage.replace(/^(?:LazyCodex\([^)]+\):|\(OmO(?:\s+[^)]+)?\))\s*/, `(OmO ${normalizeHookStatusVersion(version)}) `);
|
|
77192
|
+
}
|
|
77193
|
+
function normalizeHookStatusVersion(version) {
|
|
77194
|
+
const normalized = version.trim();
|
|
77195
|
+
return normalized.length === 0 ? "local" : normalized;
|
|
77385
77196
|
}
|
|
77386
77197
|
|
|
77387
77198
|
// packages/omo-codex/src/install/codex-process.ts
|
|
@@ -77527,7 +77338,7 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
|
|
|
77527
77338
|
configPathsFromCwd.push(configPath);
|
|
77528
77339
|
}
|
|
77529
77340
|
}
|
|
77530
|
-
if (await
|
|
77341
|
+
if (await exists4(join45(current, ".git"))) {
|
|
77531
77342
|
return configPathsFromCwd.length === 0 ? null : {
|
|
77532
77343
|
projectRoot: current,
|
|
77533
77344
|
configPaths: [...configPathsFromCwd].reverse(),
|
|
@@ -77608,7 +77419,7 @@ async function maybeLstat(path7) {
|
|
|
77608
77419
|
throw error;
|
|
77609
77420
|
}
|
|
77610
77421
|
}
|
|
77611
|
-
async function
|
|
77422
|
+
async function exists4(path7) {
|
|
77612
77423
|
return await maybeLstat(path7) !== null;
|
|
77613
77424
|
}
|
|
77614
77425
|
function nodeErrorCode3(error) {
|
|
@@ -77726,11 +77537,32 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
77726
77537
|
return resolve14(homeDir, ".local", "bin");
|
|
77727
77538
|
}
|
|
77728
77539
|
|
|
77729
|
-
// packages/omo-codex/src/install/
|
|
77540
|
+
// packages/omo-codex/src/install/codex-git-bash-hooks.ts
|
|
77541
|
+
import { readFile as readFile19, writeFile as writeFile10 } from "node:fs/promises";
|
|
77730
77542
|
import { join as join48 } from "node:path";
|
|
77543
|
+
var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
|
|
77544
|
+
"./hooks/pre-tool-use-recommending-git-bash-mcp.json",
|
|
77545
|
+
"./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
|
|
77546
|
+
]);
|
|
77547
|
+
async function removeGitBashHooksOffWindows(input) {
|
|
77548
|
+
if (input.platform === "win32")
|
|
77549
|
+
return;
|
|
77550
|
+
const manifestPath = join48(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
77551
|
+
const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
|
|
77552
|
+
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
|
|
77553
|
+
return;
|
|
77554
|
+
const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
|
|
77555
|
+
if (hooks.length === parsed.hooks.length)
|
|
77556
|
+
return;
|
|
77557
|
+
await writeFile10(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
|
|
77558
|
+
`);
|
|
77559
|
+
}
|
|
77560
|
+
|
|
77561
|
+
// packages/omo-codex/src/install/omo-sot-migration.ts
|
|
77562
|
+
import { join as join49 } from "node:path";
|
|
77731
77563
|
async function seedAndMigrateOmoSot(input) {
|
|
77732
77564
|
const commandEnv = { ...input.env };
|
|
77733
|
-
const scriptPath =
|
|
77565
|
+
const scriptPath = join49(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
|
|
77734
77566
|
try {
|
|
77735
77567
|
await input.runCommand(process.execPath, [scriptPath, "--seed"], {
|
|
77736
77568
|
cwd: input.repoRoot,
|
|
@@ -77745,7 +77577,7 @@ async function seedAndMigrateOmoSot(input) {
|
|
|
77745
77577
|
|
|
77746
77578
|
// packages/omo-codex/src/install/install-ast-grep-sg.ts
|
|
77747
77579
|
init_src();
|
|
77748
|
-
import { join as
|
|
77580
|
+
import { join as join50 } from "node:path";
|
|
77749
77581
|
function describeResult(result) {
|
|
77750
77582
|
if (result.kind === "succeeded")
|
|
77751
77583
|
return null;
|
|
@@ -77759,7 +77591,7 @@ async function installAstGrepForCodex(options) {
|
|
|
77759
77591
|
return;
|
|
77760
77592
|
const platform = options.platform ?? process.platform;
|
|
77761
77593
|
const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
|
|
77762
|
-
const skillDir =
|
|
77594
|
+
const skillDir = join50(plugin.path, "skills", "ast-grep");
|
|
77763
77595
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
77764
77596
|
try {
|
|
77765
77597
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -77793,7 +77625,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
77793
77625
|
const env3 = options.env ?? process.env;
|
|
77794
77626
|
const platform = options.platform ?? process.platform;
|
|
77795
77627
|
const repoRoot = resolve15(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env3 }));
|
|
77796
|
-
const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ??
|
|
77628
|
+
const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join53(homedir6(), ".codex"));
|
|
77797
77629
|
const projectDirectory = resolve15(options.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd());
|
|
77798
77630
|
const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env3 });
|
|
77799
77631
|
const runCommand = options.runCommand ?? defaultRunCommand;
|
|
@@ -77809,9 +77641,9 @@ async function runCodexInstaller(options = {}) {
|
|
|
77809
77641
|
if (!gitBashResolution.found) {
|
|
77810
77642
|
throw new Error(gitBashResolution.installHint);
|
|
77811
77643
|
}
|
|
77812
|
-
const codexPackageRoot =
|
|
77644
|
+
const codexPackageRoot = join53(repoRoot, "packages", "omo-codex");
|
|
77813
77645
|
const marketplace = await readMarketplace(repoRoot, {
|
|
77814
|
-
marketplacePath:
|
|
77646
|
+
marketplacePath: join53(codexPackageRoot, "marketplace.json")
|
|
77815
77647
|
});
|
|
77816
77648
|
const distributionManifest = await readDistributionManifest(repoRoot);
|
|
77817
77649
|
const installed = [];
|
|
@@ -77843,6 +77675,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
77843
77675
|
if (marketplace.name === "sisyphuslabs" && plugin.name === "omo") {
|
|
77844
77676
|
await stampLazyCodexPluginVersion({ pluginRoot: plugin.path, version: version2 });
|
|
77845
77677
|
await writeLazyCodexInstallSnapshot({ pluginRoot: plugin.path, distributionManifest });
|
|
77678
|
+
await removeGitBashHooksOffWindows({ platform, pluginRoot: plugin.path });
|
|
77846
77679
|
}
|
|
77847
77680
|
const links = await linkCachedPluginBins({ binDir, pluginRoot: plugin.path, platform });
|
|
77848
77681
|
for (const link of links) {
|
|
@@ -77853,7 +77686,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
77853
77686
|
if (runtimeLink !== null)
|
|
77854
77687
|
log4(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
|
|
77855
77688
|
else
|
|
77856
|
-
log4(`Warning: skipped the omo runtime wrapper because ${
|
|
77689
|
+
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`);
|
|
77857
77690
|
}
|
|
77858
77691
|
pluginSources.push({ name: entry.name, sourcePath });
|
|
77859
77692
|
installed.push(plugin);
|
|
@@ -77907,13 +77740,13 @@ async function runCodexInstaller(options = {}) {
|
|
|
77907
77740
|
});
|
|
77908
77741
|
}
|
|
77909
77742
|
await reapLspDaemons(codexHome).catch(() => []);
|
|
77910
|
-
const marketplaceRoot =
|
|
77743
|
+
const marketplaceRoot = join53(codexHome, "plugins", "cache", marketplace.name);
|
|
77911
77744
|
await writeCachedMarketplaceManifest({
|
|
77912
77745
|
marketplaceName: marketplace.name,
|
|
77913
77746
|
marketplaceRoot,
|
|
77914
77747
|
plugins: installed
|
|
77915
77748
|
});
|
|
77916
|
-
const configPath =
|
|
77749
|
+
const configPath = join53(codexHome, "config.toml");
|
|
77917
77750
|
await updateCodexConfig({
|
|
77918
77751
|
configPath,
|
|
77919
77752
|
repoRoot: codexPackageRoot,
|
|
@@ -77973,7 +77806,7 @@ function findRepoRootFromImporter(importerDir) {
|
|
|
77973
77806
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
77974
77807
|
if (isRepoRootWithCodexPlugin(current))
|
|
77975
77808
|
return current;
|
|
77976
|
-
for (const wrapperPackageRoot of [
|
|
77809
|
+
for (const wrapperPackageRoot of [join53(current, "node_modules", "oh-my-openagent"), join53(current, "oh-my-openagent")]) {
|
|
77977
77810
|
if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
|
|
77978
77811
|
return wrapperPackageRoot;
|
|
77979
77812
|
}
|
|
@@ -77991,7 +77824,7 @@ function findRepoRoot(input) {
|
|
|
77991
77824
|
return findRepoRootFromImporter(input.importerDir);
|
|
77992
77825
|
}
|
|
77993
77826
|
function isRepoRootWithCodexPlugin(repoRoot) {
|
|
77994
|
-
return existsSync30(
|
|
77827
|
+
return existsSync30(join53(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
|
|
77995
77828
|
}
|
|
77996
77829
|
function codexMarketplaceSource(marketplaceRoot) {
|
|
77997
77830
|
return { sourceType: "local", source: marketplaceRoot };
|
|
@@ -78012,19 +77845,19 @@ async function detectCodexInstallation(input = {}) {
|
|
|
78012
77845
|
const platform = input.platform ?? process.platform;
|
|
78013
77846
|
const env3 = input.env ?? process.env;
|
|
78014
77847
|
const homeDir = input.homeDir ?? homedir7();
|
|
78015
|
-
const
|
|
77848
|
+
const exists5 = input.exists ?? existsSync31;
|
|
78016
77849
|
const which2 = input.which ?? bunWhich;
|
|
78017
77850
|
const checkedPaths = [CODEX_PATH_CHECK_LABEL];
|
|
78018
77851
|
const cliPath = nonEmptyValue2(which2("codex"));
|
|
78019
77852
|
if (cliPath !== undefined)
|
|
78020
77853
|
return { found: true, source: "cli", path: cliPath };
|
|
78021
77854
|
if (platform === "darwin") {
|
|
78022
|
-
return detectMacCodexInstallation({ homeDir, exists:
|
|
77855
|
+
return detectMacCodexInstallation({ homeDir, exists: exists5, checkedPaths });
|
|
78023
77856
|
}
|
|
78024
77857
|
if (platform === "win32") {
|
|
78025
77858
|
return detectWindowsCodexInstallation({
|
|
78026
77859
|
env: env3,
|
|
78027
|
-
exists:
|
|
77860
|
+
exists: exists5,
|
|
78028
77861
|
checkedPaths,
|
|
78029
77862
|
runCommand: input.runCommand ?? defaultRunCommand2
|
|
78030
77863
|
});
|
|
@@ -78126,12 +77959,12 @@ function defaultRunCommand2(command, args) {
|
|
|
78126
77959
|
});
|
|
78127
77960
|
}
|
|
78128
77961
|
// packages/omo-codex/src/install/codex-cleanup.ts
|
|
78129
|
-
import { lstat as lstat11, readFile as
|
|
77962
|
+
import { lstat as lstat11, readFile as readFile21, readdir as readdir9, rm as rm11, rmdir } from "node:fs/promises";
|
|
78130
77963
|
import { homedir as homedir8 } from "node:os";
|
|
78131
|
-
import { isAbsolute as isAbsolute10, join as
|
|
77964
|
+
import { isAbsolute as isAbsolute10, join as join55, relative as relative7, resolve as resolve17 } from "node:path";
|
|
78132
77965
|
|
|
78133
77966
|
// packages/omo-codex/src/install/codex-cleanup-config.ts
|
|
78134
|
-
import { lstat as lstat10, mkdir as mkdir8, readFile as
|
|
77967
|
+
import { lstat as lstat10, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile11 } from "node:fs/promises";
|
|
78135
77968
|
import { dirname as dirname18 } from "node:path";
|
|
78136
77969
|
var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
|
|
78137
77970
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
|
|
@@ -78161,14 +77994,14 @@ function cleanupCodexLightConfigText(config) {
|
|
|
78161
77994
|
async function cleanupCodexConfig(configPath, now) {
|
|
78162
77995
|
if (!await configExists(configPath))
|
|
78163
77996
|
return { changed: false };
|
|
78164
|
-
const original = await
|
|
77997
|
+
const original = await readFile20(configPath, "utf8");
|
|
78165
77998
|
const next = cleanupCodexLightConfigText(original);
|
|
78166
77999
|
if (next === original)
|
|
78167
78000
|
return { changed: false };
|
|
78168
78001
|
const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
|
|
78169
78002
|
await mkdir8(dirname18(configPath), { recursive: true });
|
|
78170
|
-
await
|
|
78171
|
-
await
|
|
78003
|
+
await writeFile11(backupPath, original);
|
|
78004
|
+
await writeFile11(configPath, `${next.trimEnd()}
|
|
78172
78005
|
`);
|
|
78173
78006
|
return { changed: true, backupPath };
|
|
78174
78007
|
}
|
|
@@ -78245,7 +78078,7 @@ function nodeErrorCode4(error) {
|
|
|
78245
78078
|
}
|
|
78246
78079
|
|
|
78247
78080
|
// packages/omo-codex/src/install/codex-cleanup-safety.ts
|
|
78248
|
-
import { dirname as dirname19, isAbsolute as isAbsolute9, join as
|
|
78081
|
+
import { dirname as dirname19, isAbsolute as isAbsolute9, join as join54, relative as relative6, resolve as resolve16 } from "node:path";
|
|
78249
78082
|
function validateManagedCleanupTarget(input) {
|
|
78250
78083
|
if (!isAbsolute9(input.path))
|
|
78251
78084
|
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
@@ -78258,11 +78091,11 @@ function validateManagedCleanupTarget(input) {
|
|
|
78258
78091
|
if (target === codexHome)
|
|
78259
78092
|
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
78260
78093
|
const exactManagedRoots = new Set([
|
|
78261
|
-
resolve16(
|
|
78262
|
-
resolve16(
|
|
78263
|
-
resolve16(
|
|
78264
|
-
resolve16(
|
|
78265
|
-
resolve16(
|
|
78094
|
+
resolve16(join54(codexHome, "plugins", "cache", "sisyphuslabs")),
|
|
78095
|
+
resolve16(join54(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
|
|
78096
|
+
resolve16(join54(codexHome, "runtime", "ast-grep")),
|
|
78097
|
+
resolve16(join54(codexHome, "runtime", "node")),
|
|
78098
|
+
resolve16(join54(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
|
|
78266
78099
|
]);
|
|
78267
78100
|
if (exactManagedRoots.has(target))
|
|
78268
78101
|
return null;
|
|
@@ -78292,8 +78125,8 @@ function skipped(path7, reason) {
|
|
|
78292
78125
|
var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
|
|
78293
78126
|
async function cleanupCodexLight(input = {}) {
|
|
78294
78127
|
const env3 = input.env ?? process.env;
|
|
78295
|
-
const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ??
|
|
78296
|
-
const configPath =
|
|
78128
|
+
const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join55(homedir8(), ".codex"));
|
|
78129
|
+
const configPath = join55(codexHome, "config.toml");
|
|
78297
78130
|
const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
|
|
78298
78131
|
const configCleanup = await cleanupCodexConfig(configPath, input.now);
|
|
78299
78132
|
const agentCleanup = await removeManifestListedAgentLinks(codexHome, agentPaths);
|
|
@@ -78332,17 +78165,17 @@ async function cleanupCodexLight(input = {}) {
|
|
|
78332
78165
|
}
|
|
78333
78166
|
function managedGlobalStatePaths(codexHome) {
|
|
78334
78167
|
return [
|
|
78335
|
-
|
|
78336
|
-
|
|
78337
|
-
|
|
78338
|
-
|
|
78339
|
-
|
|
78168
|
+
join55(codexHome, "plugins", "cache", "sisyphuslabs"),
|
|
78169
|
+
join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
|
|
78170
|
+
join55(codexHome, "runtime", "ast-grep"),
|
|
78171
|
+
join55(codexHome, "runtime", "node"),
|
|
78172
|
+
join55(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
|
|
78340
78173
|
];
|
|
78341
78174
|
}
|
|
78342
78175
|
var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
|
|
78343
78176
|
async function collectBootstrapDataDirsByGlob(codexHome) {
|
|
78344
78177
|
const results = [];
|
|
78345
|
-
await walkForManagedBootstrapDirs(
|
|
78178
|
+
await walkForManagedBootstrapDirs(join55(codexHome, "plugins"), 0, results);
|
|
78346
78179
|
return results;
|
|
78347
78180
|
}
|
|
78348
78181
|
async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
@@ -78354,10 +78187,10 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
|
78354
78187
|
for (const entry of entries) {
|
|
78355
78188
|
if (!entry.isDirectory())
|
|
78356
78189
|
continue;
|
|
78357
|
-
const childPath =
|
|
78190
|
+
const childPath = join55(directory, entry.name);
|
|
78358
78191
|
if (isManagedBootstrapOwnerName(entry.name)) {
|
|
78359
|
-
const bootstrapDir =
|
|
78360
|
-
if (await
|
|
78192
|
+
const bootstrapDir = join55(childPath, "bootstrap");
|
|
78193
|
+
if (await exists5(bootstrapDir))
|
|
78361
78194
|
results.push(bootstrapDir);
|
|
78362
78195
|
continue;
|
|
78363
78196
|
}
|
|
@@ -78390,7 +78223,7 @@ async function attemptRemove(path7) {
|
|
|
78390
78223
|
}
|
|
78391
78224
|
async function pruneEmptyRuntimeDirBestEffort(codexHome) {
|
|
78392
78225
|
try {
|
|
78393
|
-
await rmdir(
|
|
78226
|
+
await rmdir(join55(codexHome, "runtime"));
|
|
78394
78227
|
} catch (error) {
|
|
78395
78228
|
if (isExpectedRuntimePruneFailure(error))
|
|
78396
78229
|
return;
|
|
@@ -78402,14 +78235,14 @@ function isExpectedRuntimePruneFailure(error) {
|
|
|
78402
78235
|
}
|
|
78403
78236
|
async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
78404
78237
|
const manifestPaths = [
|
|
78405
|
-
|
|
78238
|
+
join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
|
|
78406
78239
|
];
|
|
78407
|
-
const versionRoot =
|
|
78408
|
-
if (await
|
|
78240
|
+
const versionRoot = join55(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
|
|
78241
|
+
if (await exists5(versionRoot)) {
|
|
78409
78242
|
const entries = await readdir9(versionRoot, { withFileTypes: true });
|
|
78410
78243
|
for (const entry of entries) {
|
|
78411
78244
|
if (entry.isDirectory())
|
|
78412
|
-
manifestPaths.push(
|
|
78245
|
+
manifestPaths.push(join55(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
|
|
78413
78246
|
}
|
|
78414
78247
|
}
|
|
78415
78248
|
const paths = new Set;
|
|
@@ -78424,21 +78257,21 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
|
78424
78257
|
return [...paths].sort();
|
|
78425
78258
|
}
|
|
78426
78259
|
async function readManagedAgentPathsFromConfig(codexHome, configPath) {
|
|
78427
|
-
if (!await
|
|
78260
|
+
if (!await exists5(configPath))
|
|
78428
78261
|
return [];
|
|
78429
|
-
const config = await
|
|
78430
|
-
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) =>
|
|
78262
|
+
const config = await readFile21(configPath, "utf8");
|
|
78263
|
+
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join55(codexHome, "agents", `${agentName}.toml`));
|
|
78431
78264
|
}
|
|
78432
78265
|
async function readInstalledAgentManifest(manifestPath) {
|
|
78433
|
-
if (!await
|
|
78266
|
+
if (!await exists5(manifestPath))
|
|
78434
78267
|
return [];
|
|
78435
|
-
const parsed = JSON.parse(await
|
|
78268
|
+
const parsed = JSON.parse(await readFile21(manifestPath, "utf8"));
|
|
78436
78269
|
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
|
|
78437
78270
|
return [];
|
|
78438
78271
|
return parsed.agents.filter((path7) => typeof path7 === "string");
|
|
78439
78272
|
}
|
|
78440
78273
|
async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
78441
|
-
const agentsDir =
|
|
78274
|
+
const agentsDir = join55(codexHome, "agents");
|
|
78442
78275
|
const removed = [];
|
|
78443
78276
|
const skipped2 = [];
|
|
78444
78277
|
for (const path7 of paths) {
|
|
@@ -78469,7 +78302,7 @@ function isSafeManagedAgentPath(agentsDir, path7) {
|
|
|
78469
78302
|
return false;
|
|
78470
78303
|
return MANAGED_CODEX_AGENT_NAMES2.some((agentName) => fileName === `${agentName}.toml`);
|
|
78471
78304
|
}
|
|
78472
|
-
async function
|
|
78305
|
+
async function exists5(path7) {
|
|
78473
78306
|
return await maybeLstat2(path7) !== null;
|
|
78474
78307
|
}
|
|
78475
78308
|
async function maybeLstat2(path7) {
|
|
@@ -78488,8 +78321,158 @@ function nodeErrorCode5(error) {
|
|
|
78488
78321
|
}
|
|
78489
78322
|
// packages/omo-codex/src/install/codex-git-bash-mcp-env.ts
|
|
78490
78323
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
78491
|
-
// packages/omo-
|
|
78324
|
+
// packages/omo-senpi/src/install/install-senpi.ts
|
|
78492
78325
|
import { execFile as execFile3 } from "node:child_process";
|
|
78326
|
+
import { constants as constants7, existsSync as existsSync32 } from "node:fs";
|
|
78327
|
+
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile12 } from "node:fs/promises";
|
|
78328
|
+
import { homedir as homedir9 } from "node:os";
|
|
78329
|
+
import { dirname as dirname20, join as join56, resolve as resolve18 } from "node:path";
|
|
78330
|
+
import { fileURLToPath } from "node:url";
|
|
78331
|
+
import { promisify as promisify2 } from "node:util";
|
|
78332
|
+
var execFileAsync2 = promisify2(execFile3);
|
|
78333
|
+
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
78334
|
+
join56("extensions", "omo.js"),
|
|
78335
|
+
join56("skills", "ultrawork", "SKILL.md"),
|
|
78336
|
+
join56("skills", "ulw-loop", "SKILL.md")
|
|
78337
|
+
];
|
|
78338
|
+
async function runSenpiInstaller(options = {}) {
|
|
78339
|
+
const context = resolveInstallContext(options);
|
|
78340
|
+
await ensurePluginArtifacts(context);
|
|
78341
|
+
const settings = await readSettings(context.settingsPath);
|
|
78342
|
+
const before = JSON.stringify(settings);
|
|
78343
|
+
const packages = dedupePackages(readPackages(settings));
|
|
78344
|
+
if (!packages.includes(context.pluginPath))
|
|
78345
|
+
packages.push(context.pluginPath);
|
|
78346
|
+
settings.packages = packages;
|
|
78347
|
+
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
78348
|
+
return {
|
|
78349
|
+
ok: true,
|
|
78350
|
+
action: "install",
|
|
78351
|
+
agentDir: context.agentDir,
|
|
78352
|
+
settingsPath: context.settingsPath,
|
|
78353
|
+
pluginPath: context.pluginPath,
|
|
78354
|
+
changed: JSON.stringify(settings) !== before,
|
|
78355
|
+
backupPath
|
|
78356
|
+
};
|
|
78357
|
+
}
|
|
78358
|
+
function resolveInstallContext(options) {
|
|
78359
|
+
const env3 = options.env ?? process.env;
|
|
78360
|
+
const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname20(fileURLToPath(import.meta.url))));
|
|
78361
|
+
const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join56(homedir9(), ".senpi", "agent"));
|
|
78362
|
+
const pluginPath = resolve18(options.pluginPath ?? join56(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
78363
|
+
return {
|
|
78364
|
+
env: env3,
|
|
78365
|
+
repoRoot,
|
|
78366
|
+
agentDir,
|
|
78367
|
+
settingsPath: join56(agentDir, "settings.json"),
|
|
78368
|
+
pluginPath,
|
|
78369
|
+
runCommand: options.runCommand ?? defaultRunCommand3
|
|
78370
|
+
};
|
|
78371
|
+
}
|
|
78372
|
+
async function ensurePluginArtifacts(context) {
|
|
78373
|
+
const missing = await hasMissingPluginArtifact(context.pluginPath);
|
|
78374
|
+
if (!missing)
|
|
78375
|
+
return;
|
|
78376
|
+
await context.runCommand("node", [join56(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
78377
|
+
await context.runCommand("node", [join56(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
78378
|
+
}
|
|
78379
|
+
async function hasMissingPluginArtifact(pluginPath) {
|
|
78380
|
+
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
78381
|
+
if (!await fileExists(join56(pluginPath, artifact)))
|
|
78382
|
+
return true;
|
|
78383
|
+
}
|
|
78384
|
+
return false;
|
|
78385
|
+
}
|
|
78386
|
+
async function defaultRunCommand3(command, args, options) {
|
|
78387
|
+
const result = await execFileAsync2(command, [...args], { cwd: options.cwd });
|
|
78388
|
+
if (result.stderr.trim().length > 0)
|
|
78389
|
+
process.stderr.write(result.stderr);
|
|
78390
|
+
if (result.stdout.trim().length > 0)
|
|
78391
|
+
process.stdout.write(result.stdout);
|
|
78392
|
+
}
|
|
78393
|
+
async function readSettings(settingsPath) {
|
|
78394
|
+
let raw;
|
|
78395
|
+
try {
|
|
78396
|
+
raw = await readFile22(settingsPath, "utf8");
|
|
78397
|
+
} catch (error) {
|
|
78398
|
+
if (isErrno(error, "ENOENT"))
|
|
78399
|
+
return {};
|
|
78400
|
+
throw error;
|
|
78401
|
+
}
|
|
78402
|
+
const parsed = JSON.parse(raw);
|
|
78403
|
+
if (!isPlainObject3(parsed))
|
|
78404
|
+
throw new Error(`${settingsPath} must contain a JSON object`);
|
|
78405
|
+
return parsed;
|
|
78406
|
+
}
|
|
78407
|
+
function readPackages(settings) {
|
|
78408
|
+
const packages = settings.packages;
|
|
78409
|
+
if (packages === undefined)
|
|
78410
|
+
return [];
|
|
78411
|
+
if (!Array.isArray(packages) || !packages.every((entry) => typeof entry === "string")) {
|
|
78412
|
+
throw new Error("Senpi settings packages must be an array of strings");
|
|
78413
|
+
}
|
|
78414
|
+
return packages;
|
|
78415
|
+
}
|
|
78416
|
+
function dedupePackages(packages) {
|
|
78417
|
+
return [...new Set(packages)];
|
|
78418
|
+
}
|
|
78419
|
+
async function writeSettingsAtomically(settingsPath, settings) {
|
|
78420
|
+
await mkdir9(dirname20(settingsPath), { recursive: true });
|
|
78421
|
+
const backupPath = await nextBackupPath(settingsPath);
|
|
78422
|
+
if (await fileExists(settingsPath)) {
|
|
78423
|
+
await copyFile3(settingsPath, backupPath);
|
|
78424
|
+
} else {
|
|
78425
|
+
await writeFile12(backupPath, `{}
|
|
78426
|
+
`, "utf8");
|
|
78427
|
+
}
|
|
78428
|
+
const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
|
|
78429
|
+
await writeFile12(tempPath, `${JSON.stringify(settings, null, 2)}
|
|
78430
|
+
`, "utf8");
|
|
78431
|
+
await rename5(tempPath, settingsPath);
|
|
78432
|
+
return backupPath;
|
|
78433
|
+
}
|
|
78434
|
+
async function nextBackupPath(settingsPath) {
|
|
78435
|
+
for (let index = 0;index < 1000; index += 1) {
|
|
78436
|
+
const suffix = index === 0 ? "" : `-${index}`;
|
|
78437
|
+
const candidate = `${settingsPath}.${timestampForBackup()}${suffix}.backup`;
|
|
78438
|
+
if (!await fileExists(candidate))
|
|
78439
|
+
return candidate;
|
|
78440
|
+
}
|
|
78441
|
+
throw new Error(`Unable to allocate backup path for ${settingsPath}`);
|
|
78442
|
+
}
|
|
78443
|
+
function timestampForBackup() {
|
|
78444
|
+
return new Date().toISOString().replace(/[-:.]/g, "");
|
|
78445
|
+
}
|
|
78446
|
+
function findRepoRoot2(importerDir) {
|
|
78447
|
+
let current = importerDir;
|
|
78448
|
+
for (let depth = 0;depth <= 7; depth += 1) {
|
|
78449
|
+
if (fileExistsSync(join56(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
78450
|
+
return current;
|
|
78451
|
+
current = resolve18(current, "..");
|
|
78452
|
+
}
|
|
78453
|
+
throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
|
|
78454
|
+
}
|
|
78455
|
+
function isPlainObject3(value) {
|
|
78456
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
78457
|
+
}
|
|
78458
|
+
async function fileExists(path7) {
|
|
78459
|
+
try {
|
|
78460
|
+
await access(path7, constants7.F_OK);
|
|
78461
|
+
return true;
|
|
78462
|
+
} catch (error) {
|
|
78463
|
+
if (isErrno(error, "ENOENT"))
|
|
78464
|
+
return false;
|
|
78465
|
+
throw error;
|
|
78466
|
+
}
|
|
78467
|
+
}
|
|
78468
|
+
function fileExistsSync(path7) {
|
|
78469
|
+
return existsSync32(path7);
|
|
78470
|
+
}
|
|
78471
|
+
function isErrno(error, code) {
|
|
78472
|
+
return error instanceof Error && "code" in error && error.code === code;
|
|
78473
|
+
}
|
|
78474
|
+
// packages/omo-opencode/src/cli/star-request.ts
|
|
78475
|
+
import { execFile as execFile4 } from "node:child_process";
|
|
78493
78476
|
import { promisify as promisify3 } from "node:util";
|
|
78494
78477
|
var STAR_REPOSITORIES = [
|
|
78495
78478
|
"code-yeongyu/oh-my-openagent",
|
|
@@ -78498,11 +78481,12 @@ var STAR_REPOSITORIES = [
|
|
|
78498
78481
|
var PLATFORM_REPOSITORIES = {
|
|
78499
78482
|
opencode: ["code-yeongyu/oh-my-openagent"],
|
|
78500
78483
|
codex: STAR_REPOSITORIES,
|
|
78501
|
-
both: STAR_REPOSITORIES
|
|
78484
|
+
both: STAR_REPOSITORIES,
|
|
78485
|
+
senpi: STAR_REPOSITORIES
|
|
78502
78486
|
};
|
|
78503
|
-
var
|
|
78487
|
+
var execFileAsync3 = promisify3(execFile4);
|
|
78504
78488
|
async function runGitHubStarCommand(repository) {
|
|
78505
|
-
await
|
|
78489
|
+
await execFileAsync3("gh", ["api", "--silent", "--method", "PUT", `/user/starred/${repository}`]);
|
|
78506
78490
|
}
|
|
78507
78491
|
async function starGitHubRepositories(platform = "both", runCommand = runGitHubStarCommand) {
|
|
78508
78492
|
const results = [];
|
|
@@ -78521,23 +78505,23 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
|
|
|
78521
78505
|
init_provider_availability();
|
|
78522
78506
|
|
|
78523
78507
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
78524
|
-
import { existsSync as
|
|
78525
|
-
import { join as
|
|
78508
|
+
import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "node:fs";
|
|
78509
|
+
import { join as join58 } from "node:path";
|
|
78526
78510
|
|
|
78527
78511
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
78528
78512
|
init_shared();
|
|
78529
|
-
import { existsSync as
|
|
78530
|
-
import { join as
|
|
78513
|
+
import { existsSync as existsSync33, readFileSync as readFileSync15 } from "node:fs";
|
|
78514
|
+
import { join as join57 } from "node:path";
|
|
78531
78515
|
var TUI_SUBPATH = "tui";
|
|
78532
78516
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
78533
78517
|
function fileEntryPackageJsonPath(entry) {
|
|
78534
78518
|
let path7 = entry.slice("file:".length);
|
|
78535
78519
|
if (path7.startsWith("//"))
|
|
78536
78520
|
path7 = path7.slice(2);
|
|
78537
|
-
return
|
|
78521
|
+
return join57(path7, "package.json");
|
|
78538
78522
|
}
|
|
78539
78523
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
78540
|
-
if (!
|
|
78524
|
+
if (!existsSync33(pkgJsonPath))
|
|
78541
78525
|
return null;
|
|
78542
78526
|
try {
|
|
78543
78527
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
@@ -78557,9 +78541,9 @@ function packageJsonExportsTui(pkgJsonPath) {
|
|
|
78557
78541
|
}
|
|
78558
78542
|
}
|
|
78559
78543
|
function packageNameFromServerEntry(entry) {
|
|
78560
|
-
if (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`))
|
|
78544
|
+
if (typeof entry === "string" && (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`)))
|
|
78561
78545
|
return PLUGIN_NAME;
|
|
78562
|
-
if (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`))
|
|
78546
|
+
if (typeof entry === "string" && (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)))
|
|
78563
78547
|
return LEGACY_PLUGIN_NAME;
|
|
78564
78548
|
return null;
|
|
78565
78549
|
}
|
|
@@ -78567,19 +78551,19 @@ function isPackagePluginEntry(entry) {
|
|
|
78567
78551
|
return packageNameFromServerEntry(entry) !== null;
|
|
78568
78552
|
}
|
|
78569
78553
|
function packageExportsTuiForServerEntry(entry) {
|
|
78570
|
-
if (entry.startsWith("file:"))
|
|
78554
|
+
if (typeof entry === "string" && entry.startsWith("file:"))
|
|
78571
78555
|
return packageJsonExportsTui(fileEntryPackageJsonPath(entry));
|
|
78572
78556
|
const packageName = packageNameFromServerEntry(entry);
|
|
78573
78557
|
if (packageName === null)
|
|
78574
78558
|
return null;
|
|
78575
|
-
return packageJsonExportsTui(
|
|
78559
|
+
return packageJsonExportsTui(join57(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
78576
78560
|
}
|
|
78577
78561
|
function isOurFilePluginEntry(entry) {
|
|
78578
|
-
if (!entry.startsWith("file:"))
|
|
78562
|
+
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
78579
78563
|
return false;
|
|
78580
78564
|
try {
|
|
78581
78565
|
const pkgJsonPath = fileEntryPackageJsonPath(entry);
|
|
78582
|
-
if (!
|
|
78566
|
+
if (!existsSync33(pkgJsonPath))
|
|
78583
78567
|
return false;
|
|
78584
78568
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
78585
78569
|
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
|
|
@@ -78592,37 +78576,29 @@ function isOurFilePluginEntry(entry) {
|
|
|
78592
78576
|
}
|
|
78593
78577
|
}
|
|
78594
78578
|
function isServerPluginEntry(entry) {
|
|
78595
|
-
if (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`))
|
|
78579
|
+
if (typeof entry === "string" && (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`)))
|
|
78596
78580
|
return true;
|
|
78597
|
-
if (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`))
|
|
78581
|
+
if (typeof entry === "string" && (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)))
|
|
78598
78582
|
return true;
|
|
78599
|
-
if (entry.startsWith("file:") && isOurFilePluginEntry(entry))
|
|
78583
|
+
if (typeof entry === "string" && entry.startsWith("file:") && isOurFilePluginEntry(entry))
|
|
78600
78584
|
return true;
|
|
78601
78585
|
return false;
|
|
78602
78586
|
}
|
|
78603
78587
|
function isTuiPluginEntry(entry) {
|
|
78604
|
-
|
|
78605
|
-
return true;
|
|
78606
|
-
if (entry.startsWith("file:") && isOurFilePluginEntry(entry))
|
|
78607
|
-
return true;
|
|
78608
|
-
return false;
|
|
78588
|
+
return typeof entry === "string" && (isPackagePluginEntry(entry) || entry.startsWith("file:") && isOurFilePluginEntry(entry));
|
|
78609
78589
|
}
|
|
78610
78590
|
function isNamedTuiPluginEntry(entry) {
|
|
78611
78591
|
const canonicalPrefix = `${PLUGIN_NAME}/${TUI_SUBPATH}`;
|
|
78612
78592
|
const legacyPrefix = `${LEGACY_PLUGIN_NAME}/${TUI_SUBPATH}`;
|
|
78613
|
-
|
|
78614
|
-
return true;
|
|
78615
|
-
if (entry === legacyPrefix || entry.startsWith(`${legacyPrefix}@`))
|
|
78616
|
-
return true;
|
|
78617
|
-
return false;
|
|
78593
|
+
return typeof entry === "string" && (entry === canonicalPrefix || entry.startsWith(`${canonicalPrefix}@`) || entry === legacyPrefix || entry.startsWith(`${legacyPrefix}@`));
|
|
78618
78594
|
}
|
|
78619
78595
|
function isCanonicalNamedTuiPluginEntry(entry) {
|
|
78620
78596
|
const canonicalPrefix = `${PLUGIN_NAME}/${TUI_SUBPATH}`;
|
|
78621
|
-
return entry === canonicalPrefix || entry.startsWith(`${canonicalPrefix}@`);
|
|
78597
|
+
return typeof entry === "string" && (entry === canonicalPrefix || entry.startsWith(`${canonicalPrefix}@`));
|
|
78622
78598
|
}
|
|
78623
78599
|
function detectServerPluginRegistration() {
|
|
78624
78600
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
78625
|
-
const configPath =
|
|
78601
|
+
const configPath = existsSync33(paths.configJsonc) ? paths.configJsonc : existsSync33(paths.configJson) ? paths.configJson : null;
|
|
78626
78602
|
if (!configPath) {
|
|
78627
78603
|
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
|
|
78628
78604
|
}
|
|
@@ -78645,8 +78621,8 @@ function detectServerPluginRegistration() {
|
|
|
78645
78621
|
}
|
|
78646
78622
|
}
|
|
78647
78623
|
function detectTuiPluginRegistration() {
|
|
78648
|
-
const tuiJsonPath =
|
|
78649
|
-
if (!
|
|
78624
|
+
const tuiJsonPath = join57(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
78625
|
+
if (!existsSync33(tuiJsonPath)) {
|
|
78650
78626
|
return {
|
|
78651
78627
|
registered: false,
|
|
78652
78628
|
configPath: tuiJsonPath,
|
|
@@ -78801,11 +78777,11 @@ function readConfig(path7) {
|
|
|
78801
78777
|
return null;
|
|
78802
78778
|
}
|
|
78803
78779
|
function readServerConfig(configDir) {
|
|
78804
|
-
const jsoncPath =
|
|
78805
|
-
if (
|
|
78780
|
+
const jsoncPath = join58(configDir, "opencode.jsonc");
|
|
78781
|
+
if (existsSync34(jsoncPath))
|
|
78806
78782
|
return readConfig(jsoncPath);
|
|
78807
|
-
const jsonPath =
|
|
78808
|
-
if (
|
|
78783
|
+
const jsonPath = join58(configDir, "opencode.json");
|
|
78784
|
+
if (existsSync34(jsonPath))
|
|
78809
78785
|
return readConfig(jsonPath);
|
|
78810
78786
|
return null;
|
|
78811
78787
|
}
|
|
@@ -78825,7 +78801,7 @@ function desiredTuiEntry(serverEntry) {
|
|
|
78825
78801
|
return null;
|
|
78826
78802
|
}
|
|
78827
78803
|
function readTuiConfig(tuiJsonPath) {
|
|
78828
|
-
if (!
|
|
78804
|
+
if (!existsSync34(tuiJsonPath)) {
|
|
78829
78805
|
return { config: {}, malformed: false };
|
|
78830
78806
|
}
|
|
78831
78807
|
const config = readConfig(tuiJsonPath);
|
|
@@ -78846,7 +78822,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
78846
78822
|
if (!desiredEntry) {
|
|
78847
78823
|
return { changed: false, reason: "no-server-entry" };
|
|
78848
78824
|
}
|
|
78849
|
-
const tuiJsonPath =
|
|
78825
|
+
const tuiJsonPath = join58(configDir, "tui.json");
|
|
78850
78826
|
const { config, malformed } = readTuiConfig(tuiJsonPath);
|
|
78851
78827
|
if (malformed) {
|
|
78852
78828
|
return { changed: false, reason: "malformed" };
|
|
@@ -78861,13 +78837,13 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
78861
78837
|
}
|
|
78862
78838
|
|
|
78863
78839
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
78864
|
-
import { homedir as
|
|
78865
|
-
import { join as
|
|
78840
|
+
import { homedir as homedir10 } from "node:os";
|
|
78841
|
+
import { join as join59 } from "node:path";
|
|
78866
78842
|
|
|
78867
78843
|
// packages/shared-skills/index.mjs
|
|
78868
|
-
import { fileURLToPath } from "node:url";
|
|
78844
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
78869
78845
|
function sharedSkillsRootPath() {
|
|
78870
|
-
return
|
|
78846
|
+
return fileURLToPath2(new URL("./skills/", import.meta.url));
|
|
78871
78847
|
}
|
|
78872
78848
|
|
|
78873
78849
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
@@ -78881,9 +78857,9 @@ function describeResult2(result) {
|
|
|
78881
78857
|
}
|
|
78882
78858
|
async function installAstGrepForOpenCode(options = {}) {
|
|
78883
78859
|
const platform = options.platform ?? process.platform;
|
|
78884
|
-
const baseDir =
|
|
78860
|
+
const baseDir = join59(options.homeDir ?? homedir10(), ".omo");
|
|
78885
78861
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
78886
|
-
const skillDir =
|
|
78862
|
+
const skillDir = join59(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
78887
78863
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
78888
78864
|
try {
|
|
78889
78865
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -79004,6 +78980,18 @@ async function runCliInstaller(args, version2) {
|
|
|
79004
78980
|
}
|
|
79005
78981
|
console.log();
|
|
79006
78982
|
}
|
|
78983
|
+
if (config.hasSenpi) {
|
|
78984
|
+
printInfo("Installing Senpi harness adapter...");
|
|
78985
|
+
try {
|
|
78986
|
+
const senpiResult = await runSenpiInstaller();
|
|
78987
|
+
printSuccess(`Senpi adapter installed ${SYMBOLS.arrow} ${import_picocolors3.default.dim(senpiResult.settingsPath)}`);
|
|
78988
|
+
} catch (error) {
|
|
78989
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
78990
|
+
printError(`Senpi install failed: ${message}`);
|
|
78991
|
+
return 1;
|
|
78992
|
+
}
|
|
78993
|
+
console.log();
|
|
78994
|
+
}
|
|
79007
78995
|
printInfo("Anonymous telemetry is enabled by default. Disable it with OMO_SEND_ANONYMOUS_TELEMETRY=0 or OMO_DISABLE_POSTHOG=1.");
|
|
79008
78996
|
printInfo("Docs: docs/legal/privacy-policy.md and docs/legal/terms-of-service.md");
|
|
79009
78997
|
console.log();
|
|
@@ -79285,7 +79273,7 @@ var stringVisibleTrimSpacesRight = (string) => {
|
|
|
79285
79273
|
}
|
|
79286
79274
|
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
79287
79275
|
};
|
|
79288
|
-
var
|
|
79276
|
+
var exec = (string, columns, options = {}) => {
|
|
79289
79277
|
if (options.trim !== false && string.trim() === "") {
|
|
79290
79278
|
return "";
|
|
79291
79279
|
}
|
|
@@ -79395,7 +79383,7 @@ var exec2 = (string, columns, options = {}) => {
|
|
|
79395
79383
|
};
|
|
79396
79384
|
var CRLF_OR_LF = /\r?\n/;
|
|
79397
79385
|
function wrapAnsi(string, columns, options) {
|
|
79398
|
-
return String(string).normalize().split(CRLF_OR_LF).map((line) =>
|
|
79386
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join(`
|
|
79399
79387
|
`);
|
|
79400
79388
|
}
|
|
79401
79389
|
|
|
@@ -80369,6 +80357,21 @@ var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
|
80369
80357
|
|
|
80370
80358
|
// packages/omo-opencode/src/cli/tui-install-prompts.ts
|
|
80371
80359
|
init_model_fallback();
|
|
80360
|
+
|
|
80361
|
+
// packages/omo-opencode/src/cli/senpi-platform-flag.ts
|
|
80362
|
+
var SENPI_PLATFORM_ENV_FLAG = "OMO_ENABLE_SENPI_PLATFORM";
|
|
80363
|
+
function isSenpiPlatformEnabled(env3 = process.env) {
|
|
80364
|
+
const value = env3[SENPI_PLATFORM_ENV_FLAG]?.trim().toLowerCase();
|
|
80365
|
+
return value === "1" || value === "true";
|
|
80366
|
+
}
|
|
80367
|
+
function availableInstallPlatforms(env3 = process.env) {
|
|
80368
|
+
const platforms = ["opencode", "codex", "both"];
|
|
80369
|
+
if (isSenpiPlatformEnabled(env3))
|
|
80370
|
+
platforms.push("senpi");
|
|
80371
|
+
return platforms;
|
|
80372
|
+
}
|
|
80373
|
+
|
|
80374
|
+
// packages/omo-opencode/src/cli/tui-install-prompts.ts
|
|
80372
80375
|
async function selectOrCancel(params) {
|
|
80373
80376
|
if (!process.stdin.isTTY || !process.stdout.isTTY)
|
|
80374
80377
|
return null;
|
|
@@ -80389,6 +80392,9 @@ async function promptInstallPlatform(initialValue = "opencode") {
|
|
|
80389
80392
|
{ value: "codex", label: "Codex", hint: "Install Codex harness adapter only" },
|
|
80390
80393
|
{ value: "both", label: "Both", hint: "Install OpenCode plugin and Codex adapter" }
|
|
80391
80394
|
];
|
|
80395
|
+
if (isSenpiPlatformEnabled()) {
|
|
80396
|
+
options.push({ value: "senpi", label: "Senpi", hint: "Install Senpi harness adapter only" });
|
|
80397
|
+
}
|
|
80392
80398
|
return selectOrCancel({
|
|
80393
80399
|
message: "Which platform do you want to install?",
|
|
80394
80400
|
options,
|
|
@@ -80398,6 +80404,7 @@ async function promptInstallPlatform(initialValue = "opencode") {
|
|
|
80398
80404
|
async function promptInstallConfig(detected, platform, codexAutonomousOverride) {
|
|
80399
80405
|
const hasOpenCode = platform === "opencode" || platform === "both";
|
|
80400
80406
|
const hasCodex = platform === "codex" || platform === "both";
|
|
80407
|
+
const hasSenpi = platform === "senpi";
|
|
80401
80408
|
const codexAutonomous = await resolveCodexAutonomous(hasCodex, codexAutonomousOverride);
|
|
80402
80409
|
if (codexAutonomous === null)
|
|
80403
80410
|
return null;
|
|
@@ -80411,6 +80418,7 @@ async function promptInstallConfig(detected, platform, codexAutonomousOverride)
|
|
|
80411
80418
|
hasGemini: false,
|
|
80412
80419
|
hasCopilot: false,
|
|
80413
80420
|
hasCodex,
|
|
80421
|
+
hasSenpi,
|
|
80414
80422
|
hasOpencodeZen: false,
|
|
80415
80423
|
hasZaiCodingPlan: false,
|
|
80416
80424
|
hasKimiForCoding: false,
|
|
@@ -80553,6 +80561,7 @@ async function promptInstallConfig(detected, platform, codexAutonomousOverride)
|
|
|
80553
80561
|
hasGemini: gemini === "yes",
|
|
80554
80562
|
hasCopilot: copilot === "yes",
|
|
80555
80563
|
hasCodex,
|
|
80564
|
+
hasSenpi,
|
|
80556
80565
|
hasOpencodeZen: opencodeZen === "yes",
|
|
80557
80566
|
hasZaiCodingPlan: zaiCodingPlan === "yes",
|
|
80558
80567
|
hasKimiForCoding: kimiForCoding === "yes",
|
|
@@ -80682,6 +80691,19 @@ async function runTuiInstaller(args, version2) {
|
|
|
80682
80691
|
R2.warn(`Codex install failed (OpenCode install remains successful): ${message}`);
|
|
80683
80692
|
}
|
|
80684
80693
|
}
|
|
80694
|
+
if (config.hasSenpi) {
|
|
80695
|
+
spinner.start("Installing Senpi harness adapter");
|
|
80696
|
+
try {
|
|
80697
|
+
const senpiResult = await runSenpiInstaller();
|
|
80698
|
+
spinner.stop(`Senpi adapter installed to ${import_picocolors4.default.cyan(senpiResult.settingsPath)}`);
|
|
80699
|
+
} catch (error) {
|
|
80700
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
80701
|
+
spinner.stop(`Senpi install failed ${import_picocolors4.default.yellow("[!]")}`);
|
|
80702
|
+
R2.error(`Senpi install failed: ${message}`);
|
|
80703
|
+
fe(import_picocolors4.default.red("Installation failed."));
|
|
80704
|
+
return 1;
|
|
80705
|
+
}
|
|
80706
|
+
}
|
|
80685
80707
|
R2.success(import_picocolors4.default.bold(isUpdate ? "Configuration updated!" : "Installation complete!"));
|
|
80686
80708
|
if (config.hasOpenCode) {
|
|
80687
80709
|
R2.message(`Run ${import_picocolors4.default.cyan("opencode")} to start!`);
|
|
@@ -80729,7 +80751,7 @@ async function runTuiInstaller(args, version2) {
|
|
|
80729
80751
|
|
|
80730
80752
|
// packages/omo-opencode/src/cli/install.ts
|
|
80731
80753
|
var VERSION = package_default.version;
|
|
80732
|
-
async function
|
|
80754
|
+
async function install3(args) {
|
|
80733
80755
|
return args.tui ? runTuiInstaller(args, VERSION) : runCliInstaller(args, VERSION);
|
|
80734
80756
|
}
|
|
80735
80757
|
// packages/omo-opencode/src/cli/cleanup.ts
|
|
@@ -81532,7 +81554,7 @@ async function processEvents(ctx, stream, state) {
|
|
|
81532
81554
|
}
|
|
81533
81555
|
// packages/omo-opencode/src/plugin-config/layered-config-loader.ts
|
|
81534
81556
|
import * as fs5 from "fs";
|
|
81535
|
-
import { homedir as
|
|
81557
|
+
import { homedir as homedir11 } from "node:os";
|
|
81536
81558
|
import * as path7 from "path";
|
|
81537
81559
|
|
|
81538
81560
|
// node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
@@ -82166,7 +82188,7 @@ __export(exports_util, {
|
|
|
82166
82188
|
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
82167
82189
|
joinValues: () => joinValues,
|
|
82168
82190
|
issue: () => issue,
|
|
82169
|
-
isPlainObject: () =>
|
|
82191
|
+
isPlainObject: () => isPlainObject4,
|
|
82170
82192
|
isObject: () => isObject2,
|
|
82171
82193
|
hexToUint8Array: () => hexToUint8Array,
|
|
82172
82194
|
getSizableOrigin: () => getSizableOrigin,
|
|
@@ -82348,7 +82370,7 @@ var allowsEval = /* @__PURE__ */ cached(() => {
|
|
|
82348
82370
|
return false;
|
|
82349
82371
|
}
|
|
82350
82372
|
});
|
|
82351
|
-
function
|
|
82373
|
+
function isPlainObject4(o) {
|
|
82352
82374
|
if (isObject2(o) === false)
|
|
82353
82375
|
return false;
|
|
82354
82376
|
const ctor = o.constructor;
|
|
@@ -82365,7 +82387,7 @@ function isPlainObject3(o) {
|
|
|
82365
82387
|
return true;
|
|
82366
82388
|
}
|
|
82367
82389
|
function shallowClone(o) {
|
|
82368
|
-
if (
|
|
82390
|
+
if (isPlainObject4(o))
|
|
82369
82391
|
return { ...o };
|
|
82370
82392
|
if (Array.isArray(o))
|
|
82371
82393
|
return [...o];
|
|
@@ -82569,7 +82591,7 @@ function omit(schema, mask) {
|
|
|
82569
82591
|
return clone(schema, def);
|
|
82570
82592
|
}
|
|
82571
82593
|
function extend(schema, shape) {
|
|
82572
|
-
if (!
|
|
82594
|
+
if (!isPlainObject4(shape)) {
|
|
82573
82595
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
82574
82596
|
}
|
|
82575
82597
|
const checks = schema._zod.def.checks;
|
|
@@ -82592,7 +82614,7 @@ function extend(schema, shape) {
|
|
|
82592
82614
|
return clone(schema, def);
|
|
82593
82615
|
}
|
|
82594
82616
|
function safeExtend(schema, shape) {
|
|
82595
|
-
if (!
|
|
82617
|
+
if (!isPlainObject4(shape)) {
|
|
82596
82618
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
82597
82619
|
}
|
|
82598
82620
|
const def = mergeDefs(schema._zod.def, {
|
|
@@ -84935,7 +84957,7 @@ function mergeValues(a, b2) {
|
|
|
84935
84957
|
if (a instanceof Date && b2 instanceof Date && +a === +b2) {
|
|
84936
84958
|
return { valid: true, data: a };
|
|
84937
84959
|
}
|
|
84938
|
-
if (
|
|
84960
|
+
if (isPlainObject4(a) && isPlainObject4(b2)) {
|
|
84939
84961
|
const bKeys = Object.keys(b2);
|
|
84940
84962
|
const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
84941
84963
|
const newObj = { ...a, ...b2 };
|
|
@@ -85121,7 +85143,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
85121
85143
|
$ZodType.init(inst, def);
|
|
85122
85144
|
inst._zod.parse = (payload, ctx) => {
|
|
85123
85145
|
const input = payload.value;
|
|
85124
|
-
if (!
|
|
85146
|
+
if (!isPlainObject4(input)) {
|
|
85125
85147
|
payload.issues.push({
|
|
85126
85148
|
expected: "record",
|
|
85127
85149
|
code: "invalid_type",
|
|
@@ -96273,18 +96295,18 @@ var RuntimeFallbackConfigSchema = exports_external.object({
|
|
|
96273
96295
|
});
|
|
96274
96296
|
|
|
96275
96297
|
// packages/team-core/src/config.ts
|
|
96276
|
-
var TeamModeConfigSchema =
|
|
96277
|
-
enabled:
|
|
96278
|
-
tmux_visualization:
|
|
96279
|
-
max_parallel_members:
|
|
96280
|
-
max_members:
|
|
96281
|
-
max_messages_per_run:
|
|
96282
|
-
max_wall_clock_minutes:
|
|
96283
|
-
max_member_turns:
|
|
96284
|
-
base_dir:
|
|
96285
|
-
message_payload_max_bytes:
|
|
96286
|
-
recipient_unread_max_bytes:
|
|
96287
|
-
mailbox_poll_interval_ms:
|
|
96298
|
+
var TeamModeConfigSchema = object({
|
|
96299
|
+
enabled: boolean2().default(false),
|
|
96300
|
+
tmux_visualization: boolean2().default(false),
|
|
96301
|
+
max_parallel_members: number2().int().min(1).max(8).default(4),
|
|
96302
|
+
max_members: number2().int().min(1).max(8).default(8),
|
|
96303
|
+
max_messages_per_run: number2().int().min(1).default(1e4),
|
|
96304
|
+
max_wall_clock_minutes: number2().int().min(1).default(120),
|
|
96305
|
+
max_member_turns: number2().int().min(1).default(500),
|
|
96306
|
+
base_dir: string2().optional(),
|
|
96307
|
+
message_payload_max_bytes: number2().int().min(1024).default(32768),
|
|
96308
|
+
recipient_unread_max_bytes: number2().int().min(1024).default(262144),
|
|
96309
|
+
mailbox_poll_interval_ms: number2().int().min(500).default(3000)
|
|
96288
96310
|
});
|
|
96289
96311
|
// packages/omo-opencode/src/config/schema/skills.ts
|
|
96290
96312
|
var SkillSourceSchema = exports_external.union([
|
|
@@ -96691,7 +96713,7 @@ function loadConfigFromPath(configPath, _ctx) {
|
|
|
96691
96713
|
|
|
96692
96714
|
// packages/omo-opencode/src/plugin-config/layered-config-loader.ts
|
|
96693
96715
|
function resolveHomeDirectory() {
|
|
96694
|
-
return process.env.HOME ?? process.env.USERPROFILE ??
|
|
96716
|
+
return process.env.HOME ?? process.env.USERPROFILE ?? homedir11();
|
|
96695
96717
|
}
|
|
96696
96718
|
function resolveConfigPathAfterLegacyMigration(detectedPath) {
|
|
96697
96719
|
if (!path7.basename(detectedPath).startsWith(LEGACY_CONFIG_BASENAME)) {
|
|
@@ -96832,7 +96854,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
96832
96854
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
96833
96855
|
init_bun_which_shim();
|
|
96834
96856
|
init_spawn_with_windows_hide();
|
|
96835
|
-
import { delimiter as delimiter2, dirname as
|
|
96857
|
+
import { delimiter as delimiter2, dirname as dirname22, posix as posix4, win32 as win324 } from "node:path";
|
|
96836
96858
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
96837
96859
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
96838
96860
|
function getCommandCandidates(platform) {
|
|
@@ -96890,7 +96912,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
96890
96912
|
return null;
|
|
96891
96913
|
}
|
|
96892
96914
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
96893
|
-
const preferredDir =
|
|
96915
|
+
const preferredDir = dirname22(binaryPath);
|
|
96894
96916
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
96895
96917
|
return [preferredDir, ...existing].join(delimiter2);
|
|
96896
96918
|
}
|
|
@@ -97032,6 +97054,7 @@ var SESSION_CREATE_MAX_RETRIES = 3;
|
|
|
97032
97054
|
var SESSION_CREATE_RETRY_DELAY_MS = 1000;
|
|
97033
97055
|
async function resolveSession(options) {
|
|
97034
97056
|
const { client: client3, sessionId, directory } = options;
|
|
97057
|
+
const retryDelayMs = options.retryDelayMs ?? SESSION_CREATE_RETRY_DELAY_MS;
|
|
97035
97058
|
if (sessionId) {
|
|
97036
97059
|
const res = await client3.session.get({
|
|
97037
97060
|
path: { id: sessionId },
|
|
@@ -97056,9 +97079,9 @@ async function resolveSession(options) {
|
|
|
97056
97079
|
console.error(import_picocolors12.default.yellow(`Session create attempt ${attempt}/${SESSION_CREATE_MAX_RETRIES} failed:`));
|
|
97057
97080
|
console.error(import_picocolors12.default.dim(` Error: ${serializeError2(res.error)}`));
|
|
97058
97081
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
97059
|
-
const delay2 =
|
|
97082
|
+
const delay2 = retryDelayMs * attempt;
|
|
97060
97083
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
97061
|
-
await new Promise((
|
|
97084
|
+
await new Promise((resolve19) => setTimeout(resolve19, delay2));
|
|
97062
97085
|
}
|
|
97063
97086
|
continue;
|
|
97064
97087
|
}
|
|
@@ -97067,9 +97090,9 @@ async function resolveSession(options) {
|
|
|
97067
97090
|
}
|
|
97068
97091
|
console.error(import_picocolors12.default.yellow(`Session create attempt ${attempt}/${SESSION_CREATE_MAX_RETRIES}: No session ID returned`));
|
|
97069
97092
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
97070
|
-
const delay2 =
|
|
97093
|
+
const delay2 = retryDelayMs * attempt;
|
|
97071
97094
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
97072
|
-
await new Promise((
|
|
97095
|
+
await new Promise((resolve19) => setTimeout(resolve19, delay2));
|
|
97073
97096
|
}
|
|
97074
97097
|
}
|
|
97075
97098
|
throw new Error("Failed to create session after all retries");
|
|
@@ -97282,7 +97305,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
97282
97305
|
var NOTEPAD_DIR = "notepads";
|
|
97283
97306
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
97284
97307
|
// packages/boulder-state/src/top-level-task.ts
|
|
97285
|
-
import { existsSync as
|
|
97308
|
+
import { existsSync as existsSync37, readFileSync as readFileSync18 } from "node:fs";
|
|
97286
97309
|
var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
|
|
97287
97310
|
var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
|
|
97288
97311
|
var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
|
|
@@ -97305,7 +97328,7 @@ function buildTaskRef(section, taskLabel) {
|
|
|
97305
97328
|
};
|
|
97306
97329
|
}
|
|
97307
97330
|
function readCurrentTopLevelTask(planPath) {
|
|
97308
|
-
if (!
|
|
97331
|
+
if (!existsSync37(planPath)) {
|
|
97309
97332
|
return null;
|
|
97310
97333
|
}
|
|
97311
97334
|
try {
|
|
@@ -97334,13 +97357,13 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
97334
97357
|
}
|
|
97335
97358
|
}
|
|
97336
97359
|
// packages/boulder-state/src/storage/path.ts
|
|
97337
|
-
import { existsSync as
|
|
97338
|
-
import { isAbsolute as isAbsolute11, join as
|
|
97360
|
+
import { existsSync as existsSync38 } from "node:fs";
|
|
97361
|
+
import { isAbsolute as isAbsolute11, join as join61, relative as relative8, resolve as resolve19 } from "node:path";
|
|
97339
97362
|
function getBoulderFilePath(directory) {
|
|
97340
|
-
return
|
|
97363
|
+
return join61(directory, BOULDER_DIR, BOULDER_FILE);
|
|
97341
97364
|
}
|
|
97342
97365
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
97343
|
-
return isAbsolute11(trackedPath) ?
|
|
97366
|
+
return isAbsolute11(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
|
|
97344
97367
|
}
|
|
97345
97368
|
function resolveBoulderPlanPath(directory, state) {
|
|
97346
97369
|
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
|
|
@@ -97348,20 +97371,20 @@ function resolveBoulderPlanPath(directory, state) {
|
|
|
97348
97371
|
if (!worktreePath) {
|
|
97349
97372
|
return absolutePlanPath;
|
|
97350
97373
|
}
|
|
97351
|
-
const absoluteDirectory =
|
|
97374
|
+
const absoluteDirectory = resolve19(directory);
|
|
97352
97375
|
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
|
|
97353
97376
|
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
|
|
97354
97377
|
return absolutePlanPath;
|
|
97355
97378
|
}
|
|
97356
97379
|
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
|
|
97357
|
-
const worktreePlanPath =
|
|
97358
|
-
return
|
|
97380
|
+
const worktreePlanPath = resolve19(absoluteWorktreePath, relativePlanPath);
|
|
97381
|
+
return existsSync38(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
|
|
97359
97382
|
}
|
|
97360
97383
|
function resolveBoulderPlanPathForWork(directory, work) {
|
|
97361
97384
|
return resolveBoulderPlanPath(directory, work);
|
|
97362
97385
|
}
|
|
97363
97386
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
97364
|
-
import { existsSync as
|
|
97387
|
+
import { existsSync as existsSync39, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "node:fs";
|
|
97365
97388
|
var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
|
|
97366
97389
|
var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
|
|
97367
97390
|
var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
|
|
@@ -97370,7 +97393,7 @@ var CHECKED_CHECKBOX_PATTERN = /^(\s*)[-*]\s*\[[xX]\]\s*(.+)$/;
|
|
|
97370
97393
|
var TODO_TASK_PATTERN2 = /^\d+\.\s+/;
|
|
97371
97394
|
var FINAL_WAVE_TASK_PATTERN2 = /^F\d+\.\s+/i;
|
|
97372
97395
|
function getPlanProgress(planPath) {
|
|
97373
|
-
if (!
|
|
97396
|
+
if (!existsSync39(planPath)) {
|
|
97374
97397
|
return { total: 0, completed: 0, isComplete: false };
|
|
97375
97398
|
}
|
|
97376
97399
|
try {
|
|
@@ -97490,10 +97513,10 @@ function selectMirrorWork(state) {
|
|
|
97490
97513
|
return sorted[0] ?? null;
|
|
97491
97514
|
}
|
|
97492
97515
|
// packages/boulder-state/src/storage/read-state.ts
|
|
97493
|
-
import { existsSync as
|
|
97516
|
+
import { existsSync as existsSync40, readFileSync as readFileSync20 } from "node:fs";
|
|
97494
97517
|
function readBoulderState(directory) {
|
|
97495
97518
|
const filePath = getBoulderFilePath(directory);
|
|
97496
|
-
if (!
|
|
97519
|
+
if (!existsSync40(filePath)) {
|
|
97497
97520
|
return null;
|
|
97498
97521
|
}
|
|
97499
97522
|
try {
|
|
@@ -97558,21 +97581,19 @@ function getBoulderWorks(state) {
|
|
|
97558
97581
|
}
|
|
97559
97582
|
return [buildWorkFromMirror(state)];
|
|
97560
97583
|
}
|
|
97561
|
-
// packages/omo-opencode/src/features/boulder-state/format-duration.ts
|
|
97562
|
-
init_src();
|
|
97563
97584
|
// packages/omo-opencode/src/features/claude-code-session-state/index.ts
|
|
97564
97585
|
init_state();
|
|
97565
97586
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
97566
97587
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
97567
97588
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
97568
|
-
import { existsSync as
|
|
97569
|
-
import { join as
|
|
97589
|
+
import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
|
|
97590
|
+
import { join as join62 } from "node:path";
|
|
97570
97591
|
function getMarkerPath(directory, sessionID) {
|
|
97571
|
-
return
|
|
97592
|
+
return join62(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
97572
97593
|
}
|
|
97573
97594
|
function readContinuationMarker(directory, sessionID) {
|
|
97574
97595
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
97575
|
-
if (!
|
|
97596
|
+
if (!existsSync41(markerPath))
|
|
97576
97597
|
return null;
|
|
97577
97598
|
try {
|
|
97578
97599
|
const raw = readFileSync21(markerPath, "utf-8");
|
|
@@ -97641,7 +97662,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
97641
97662
|
init_shared();
|
|
97642
97663
|
init_compaction_marker();
|
|
97643
97664
|
import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "node:fs";
|
|
97644
|
-
import { join as
|
|
97665
|
+
import { join as join63 } from "node:path";
|
|
97645
97666
|
var defaultSessionLastAgentDeps = {
|
|
97646
97667
|
getMessageDir,
|
|
97647
97668
|
isSqliteBackend,
|
|
@@ -97701,7 +97722,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
97701
97722
|
try {
|
|
97702
97723
|
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
97703
97724
|
try {
|
|
97704
|
-
const content = readFileSync22(
|
|
97725
|
+
const content = readFileSync22(join63(messageDir, fileName), "utf-8");
|
|
97705
97726
|
const parsed = JSON.parse(content);
|
|
97706
97727
|
return {
|
|
97707
97728
|
fileName,
|
|
@@ -97744,8 +97765,8 @@ init_agent_display_names();
|
|
|
97744
97765
|
|
|
97745
97766
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
97746
97767
|
init_frontmatter2();
|
|
97747
|
-
import { existsSync as
|
|
97748
|
-
import { dirname as
|
|
97768
|
+
import { existsSync as existsSync42, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "node:fs";
|
|
97769
|
+
import { dirname as dirname23, join as join64 } from "node:path";
|
|
97749
97770
|
|
|
97750
97771
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
97751
97772
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -97754,11 +97775,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
97754
97775
|
|
|
97755
97776
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
97756
97777
|
function getStateFilePath(directory, customPath) {
|
|
97757
|
-
return customPath ?
|
|
97778
|
+
return customPath ? join64(directory, customPath) : join64(directory, DEFAULT_STATE_FILE);
|
|
97758
97779
|
}
|
|
97759
97780
|
function readState(directory, customPath) {
|
|
97760
97781
|
const filePath = getStateFilePath(directory, customPath);
|
|
97761
|
-
if (!
|
|
97782
|
+
if (!existsSync42(filePath)) {
|
|
97762
97783
|
return null;
|
|
97763
97784
|
}
|
|
97764
97785
|
try {
|
|
@@ -97987,13 +98008,15 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
|
|
|
97987
98008
|
const eventWatchdogMs = options.eventWatchdogMs ?? DEFAULT_EVENT_WATCHDOG_MS;
|
|
97988
98009
|
const secondaryMeaningfulWorkTimeoutMs = options.secondaryMeaningfulWorkTimeoutMs ?? DEFAULT_SECONDARY_MEANINGFUL_WORK_TIMEOUT_MS;
|
|
97989
98010
|
const requireMeaningfulWork = options.requireMeaningfulWork ?? false;
|
|
98011
|
+
const now = options.now ?? Date.now;
|
|
98012
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve20) => setTimeout(resolve20, ms)));
|
|
97990
98013
|
let consecutiveCompleteChecks = 0;
|
|
97991
98014
|
let errorCycleCount = 0;
|
|
97992
98015
|
let firstWorkTimestamp = null;
|
|
97993
98016
|
let secondaryTimeoutChecked = false;
|
|
97994
|
-
const pollStartTimestamp =
|
|
98017
|
+
const pollStartTimestamp = now();
|
|
97995
98018
|
while (!abortController.signal.aborted) {
|
|
97996
|
-
await
|
|
98019
|
+
await sleep(pollIntervalMs);
|
|
97997
98020
|
if (abortController.signal.aborted) {
|
|
97998
98021
|
return 130;
|
|
97999
98022
|
}
|
|
@@ -98019,7 +98042,7 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
98019
98042
|
}
|
|
98020
98043
|
let mainSessionStatus = null;
|
|
98021
98044
|
if (eventState.lastEventTimestamp !== null) {
|
|
98022
|
-
const timeSinceLastEvent =
|
|
98045
|
+
const timeSinceLastEvent = now() - eventState.lastEventTimestamp;
|
|
98023
98046
|
if (timeSinceLastEvent > eventWatchdogMs) {
|
|
98024
98047
|
console.log(import_picocolors15.default.yellow(`
|
|
98025
98048
|
No events for ${Math.round(timeSinceLastEvent / 1000)}s, verifying session status...`));
|
|
@@ -98029,7 +98052,7 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
98029
98052
|
} else if (mainSessionStatus === "busy" || mainSessionStatus === "retry") {
|
|
98030
98053
|
eventState.mainSessionIdle = false;
|
|
98031
98054
|
}
|
|
98032
|
-
eventState.lastEventTimestamp =
|
|
98055
|
+
eventState.lastEventTimestamp = now();
|
|
98033
98056
|
}
|
|
98034
98057
|
}
|
|
98035
98058
|
if (mainSessionStatus === null) {
|
|
@@ -98049,12 +98072,12 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
98049
98072
|
continue;
|
|
98050
98073
|
}
|
|
98051
98074
|
if (!eventState.hasReceivedMeaningfulWork) {
|
|
98052
|
-
if (
|
|
98075
|
+
if (now() - pollStartTimestamp < minStabilizationMs) {
|
|
98053
98076
|
consecutiveCompleteChecks = 0;
|
|
98054
98077
|
continue;
|
|
98055
98078
|
}
|
|
98056
98079
|
if (requireMeaningfulWork) {
|
|
98057
|
-
if (
|
|
98080
|
+
if (now() - pollStartTimestamp <= secondaryMeaningfulWorkTimeoutMs) {
|
|
98058
98081
|
consecutiveCompleteChecks = 0;
|
|
98059
98082
|
continue;
|
|
98060
98083
|
}
|
|
@@ -98068,7 +98091,7 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
98068
98091
|
Session never produced assistant output, tool activity, or reasoning after the prompt started.`));
|
|
98069
98092
|
return 1;
|
|
98070
98093
|
}
|
|
98071
|
-
if (
|
|
98094
|
+
if (now() - pollStartTimestamp > secondaryMeaningfulWorkTimeoutMs && !secondaryTimeoutChecked) {
|
|
98072
98095
|
secondaryTimeoutChecked = true;
|
|
98073
98096
|
const hasActiveWork = await hasActiveSessionWork(ctx);
|
|
98074
98097
|
if (hasActiveWork) {
|
|
@@ -98079,9 +98102,9 @@ Session never produced assistant output, tool activity, or reasoning after the p
|
|
|
98079
98102
|
}
|
|
98080
98103
|
} else {
|
|
98081
98104
|
if (firstWorkTimestamp === null) {
|
|
98082
|
-
firstWorkTimestamp =
|
|
98105
|
+
firstWorkTimestamp = now();
|
|
98083
98106
|
}
|
|
98084
|
-
if (
|
|
98107
|
+
if (now() - firstWorkTimestamp < minStabilizationMs) {
|
|
98085
98108
|
consecutiveCompleteChecks = 0;
|
|
98086
98109
|
continue;
|
|
98087
98110
|
}
|
|
@@ -98151,7 +98174,7 @@ function createAbortError() {
|
|
|
98151
98174
|
return error51;
|
|
98152
98175
|
}
|
|
98153
98176
|
function sleep(delayMs) {
|
|
98154
|
-
return new Promise((
|
|
98177
|
+
return new Promise((resolve20) => setTimeout(resolve20, delayMs));
|
|
98155
98178
|
}
|
|
98156
98179
|
function hasPromptStartEvidence(eventState) {
|
|
98157
98180
|
return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
|
|
@@ -98526,7 +98549,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
|
|
|
98526
98549
|
async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
|
|
98527
98550
|
const completed = await Promise.race([
|
|
98528
98551
|
eventProcessor.then(() => true),
|
|
98529
|
-
new Promise((
|
|
98552
|
+
new Promise((resolve20) => setTimeout(() => resolve20(false), timeoutMs))
|
|
98530
98553
|
]);
|
|
98531
98554
|
}
|
|
98532
98555
|
async function run(options) {
|
|
@@ -98724,6 +98747,10 @@ function formatVersionOutput(info) {
|
|
|
98724
98747
|
lines.push(` ${SYMBOLS3.pin} ${import_picocolors17.default.magenta(`Version pinned to ${info.pinnedVersion}`)}`);
|
|
98725
98748
|
lines.push(` ${import_picocolors17.default.dim("Update check skipped for pinned versions")}`);
|
|
98726
98749
|
break;
|
|
98750
|
+
case "pinned-mismatch":
|
|
98751
|
+
lines.push(` ${SYMBOLS3.warn} ${import_picocolors17.default.yellow(`Version pinned to ${info.pinnedVersion} but running ${info.currentVersion}`)}`);
|
|
98752
|
+
lines.push(` ${import_picocolors17.default.dim("The pin only skips the update check; it does not control which version OpenCode loads")}`);
|
|
98753
|
+
break;
|
|
98727
98754
|
case "error":
|
|
98728
98755
|
lines.push(` ${SYMBOLS3.cross} ${import_picocolors17.default.red("Unable to check for updates")}`);
|
|
98729
98756
|
lines.push(` ${import_picocolors17.default.dim("Network error or npm registry unavailable")}`);
|
|
@@ -98760,14 +98787,16 @@ async function getLocalVersion(options = {}) {
|
|
|
98760
98787
|
}
|
|
98761
98788
|
const pluginInfo = findPluginEntry(directory);
|
|
98762
98789
|
if (pluginInfo?.isPinned) {
|
|
98790
|
+
const actualVersion = getCachedVersion();
|
|
98791
|
+
const isMismatch = actualVersion !== null && actualVersion !== pluginInfo.pinnedVersion;
|
|
98763
98792
|
const info2 = {
|
|
98764
|
-
currentVersion: pluginInfo.pinnedVersion,
|
|
98793
|
+
currentVersion: isMismatch ? actualVersion : pluginInfo.pinnedVersion,
|
|
98765
98794
|
latestVersion: null,
|
|
98766
98795
|
isUpToDate: false,
|
|
98767
98796
|
isLocalDev: false,
|
|
98768
98797
|
isPinned: true,
|
|
98769
98798
|
pinnedVersion: pluginInfo.pinnedVersion,
|
|
98770
|
-
status: "pinned"
|
|
98799
|
+
status: isMismatch ? "pinned-mismatch" : "pinned"
|
|
98771
98800
|
};
|
|
98772
98801
|
console.log(options.json ? formatJsonOutput(info2) : formatVersionOutput(info2));
|
|
98773
98802
|
return 0;
|
|
@@ -98829,14 +98858,14 @@ async function getLocalVersion(options = {}) {
|
|
|
98829
98858
|
}
|
|
98830
98859
|
}
|
|
98831
98860
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
98832
|
-
import { existsSync as
|
|
98861
|
+
import { existsSync as existsSync53, readFileSync as readFileSync33 } from "node:fs";
|
|
98833
98862
|
|
|
98834
98863
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
98835
98864
|
init_extract_semver();
|
|
98836
98865
|
init_bun_which_shim();
|
|
98837
|
-
import { existsSync as
|
|
98838
|
-
import { homedir as
|
|
98839
|
-
import { join as
|
|
98866
|
+
import { existsSync as existsSync50, accessSync as accessSync4, constants as constants10 } from "node:fs";
|
|
98867
|
+
import { homedir as homedir14 } from "node:os";
|
|
98868
|
+
import { join as join71 } from "node:path";
|
|
98840
98869
|
|
|
98841
98870
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
98842
98871
|
init_spawn_with_windows_hide();
|
|
@@ -98875,8 +98904,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
98875
98904
|
const stdoutPromise = readSpawnStream(proc.stdout);
|
|
98876
98905
|
const stderrPromise = readSpawnStream(proc.stderr);
|
|
98877
98906
|
let timer;
|
|
98878
|
-
const timeoutPromise = new Promise((
|
|
98879
|
-
timer = setTimeout(() =>
|
|
98907
|
+
const timeoutPromise = new Promise((resolve20) => {
|
|
98908
|
+
timer = setTimeout(() => resolve20("timeout"), timeoutMs);
|
|
98880
98909
|
});
|
|
98881
98910
|
const processPromise = (async () => {
|
|
98882
98911
|
await proc.exited;
|
|
@@ -98913,7 +98942,7 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
98913
98942
|
var WINDOWS_EXECUTABLE_EXTS = [".exe", ".cmd", ".bat", ".ps1"];
|
|
98914
98943
|
function isExecutable2(path14) {
|
|
98915
98944
|
try {
|
|
98916
|
-
accessSync4(path14,
|
|
98945
|
+
accessSync4(path14, constants10.X_OK);
|
|
98917
98946
|
return true;
|
|
98918
98947
|
} catch (error51) {
|
|
98919
98948
|
if (error51 instanceof Error) {
|
|
@@ -98923,22 +98952,22 @@ function isExecutable2(path14) {
|
|
|
98923
98952
|
}
|
|
98924
98953
|
}
|
|
98925
98954
|
function getDesktopAppPaths(platform) {
|
|
98926
|
-
const home =
|
|
98955
|
+
const home = homedir14();
|
|
98927
98956
|
switch (platform) {
|
|
98928
98957
|
case "darwin":
|
|
98929
98958
|
return [
|
|
98930
98959
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
98931
|
-
|
|
98960
|
+
join71(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
98932
98961
|
];
|
|
98933
98962
|
case "win32": {
|
|
98934
98963
|
const programFiles = process.env.ProgramFiles;
|
|
98935
98964
|
const localAppData = process.env.LOCALAPPDATA;
|
|
98936
98965
|
const paths = [];
|
|
98937
98966
|
if (programFiles) {
|
|
98938
|
-
paths.push(
|
|
98967
|
+
paths.push(join71(programFiles, "OpenCode", "OpenCode.exe"));
|
|
98939
98968
|
}
|
|
98940
98969
|
if (localAppData) {
|
|
98941
|
-
paths.push(
|
|
98970
|
+
paths.push(join71(localAppData, "OpenCode", "OpenCode.exe"));
|
|
98942
98971
|
}
|
|
98943
98972
|
return paths;
|
|
98944
98973
|
}
|
|
@@ -98946,8 +98975,8 @@ function getDesktopAppPaths(platform) {
|
|
|
98946
98975
|
return [
|
|
98947
98976
|
"/usr/bin/opencode",
|
|
98948
98977
|
"/usr/lib/opencode/opencode",
|
|
98949
|
-
|
|
98950
|
-
|
|
98978
|
+
join71(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
98979
|
+
join71(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
98951
98980
|
];
|
|
98952
98981
|
default:
|
|
98953
98982
|
return [];
|
|
@@ -98959,7 +98988,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
98959
98988
|
}
|
|
98960
98989
|
return [binaryPath, "--version"];
|
|
98961
98990
|
}
|
|
98962
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
98991
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync50) {
|
|
98963
98992
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
98964
98993
|
if (checkExists(desktopPath)) {
|
|
98965
98994
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -98967,7 +98996,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
98967
98996
|
}
|
|
98968
98997
|
return null;
|
|
98969
98998
|
}
|
|
98970
|
-
async function findOpenCodeBinary(platform = process.platform, checkExists =
|
|
98999
|
+
async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync50) {
|
|
98971
99000
|
for (const binary of OPENCODE_BINARIES2) {
|
|
98972
99001
|
const path14 = bunWhich(binary);
|
|
98973
99002
|
if (path14 && checkExists(path14)) {
|
|
@@ -98979,7 +99008,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
98979
99008
|
const candidates = getCommandCandidates2(platform);
|
|
98980
99009
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
98981
99010
|
for (const command of candidates) {
|
|
98982
|
-
const fullPath =
|
|
99011
|
+
const fullPath = join71(entry, command);
|
|
98983
99012
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
98984
99013
|
return { binary: command, path: fullPath };
|
|
98985
99014
|
}
|
|
@@ -99025,12 +99054,12 @@ function compareVersions3(current, minimum) {
|
|
|
99025
99054
|
|
|
99026
99055
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
99027
99056
|
init_shared();
|
|
99028
|
-
import { existsSync as
|
|
99057
|
+
import { existsSync as existsSync51, readFileSync as readFileSync31 } from "node:fs";
|
|
99029
99058
|
function detectConfigPath() {
|
|
99030
99059
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
99031
|
-
if (
|
|
99060
|
+
if (existsSync51(paths.configJsonc))
|
|
99032
99061
|
return paths.configJsonc;
|
|
99033
|
-
if (
|
|
99062
|
+
if (existsSync51(paths.configJson))
|
|
99034
99063
|
return paths.configJson;
|
|
99035
99064
|
return null;
|
|
99036
99065
|
}
|
|
@@ -99118,36 +99147,36 @@ init_file_utils2();
|
|
|
99118
99147
|
init_checker();
|
|
99119
99148
|
init_auto_update_checker();
|
|
99120
99149
|
init_package_json_locator();
|
|
99121
|
-
import { existsSync as
|
|
99150
|
+
import { existsSync as existsSync52, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "node:fs";
|
|
99122
99151
|
import { createRequire as createRequire3 } from "node:module";
|
|
99123
|
-
import { homedir as
|
|
99124
|
-
import { join as
|
|
99125
|
-
import { fileURLToPath as
|
|
99152
|
+
import { homedir as homedir15 } from "node:os";
|
|
99153
|
+
import { join as join72 } from "node:path";
|
|
99154
|
+
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
99126
99155
|
init_shared();
|
|
99127
99156
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
99128
99157
|
if (platform === "darwin")
|
|
99129
|
-
return
|
|
99158
|
+
return join72(homedir15(), "Library", "Caches");
|
|
99130
99159
|
if (platform === "win32")
|
|
99131
|
-
return process.env.LOCALAPPDATA ??
|
|
99132
|
-
return
|
|
99160
|
+
return process.env.LOCALAPPDATA ?? join72(homedir15(), "AppData", "Local");
|
|
99161
|
+
return join72(homedir15(), ".cache");
|
|
99133
99162
|
}
|
|
99134
99163
|
function resolveOpenCodeCacheDir() {
|
|
99135
99164
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
99136
99165
|
if (xdgCacheHome)
|
|
99137
|
-
return
|
|
99166
|
+
return join72(xdgCacheHome, "opencode");
|
|
99138
99167
|
const fromShared = getOpenCodeCacheDir();
|
|
99139
|
-
const platformDefault =
|
|
99140
|
-
if (
|
|
99168
|
+
const platformDefault = join72(getPlatformDefaultCacheDir(), "opencode");
|
|
99169
|
+
if (existsSync52(fromShared) || !existsSync52(platformDefault))
|
|
99141
99170
|
return fromShared;
|
|
99142
99171
|
return platformDefault;
|
|
99143
99172
|
}
|
|
99144
99173
|
function resolveExistingDir(dirPath) {
|
|
99145
|
-
if (!
|
|
99174
|
+
if (!existsSync52(dirPath))
|
|
99146
99175
|
return dirPath;
|
|
99147
99176
|
return resolveSymlink(dirPath);
|
|
99148
99177
|
}
|
|
99149
99178
|
function readPackageJson(filePath) {
|
|
99150
|
-
if (!
|
|
99179
|
+
if (!existsSync52(filePath))
|
|
99151
99180
|
return null;
|
|
99152
99181
|
try {
|
|
99153
99182
|
const content = readFileSync32(filePath, "utf-8");
|
|
@@ -99168,26 +99197,26 @@ function normalizeVersion(value) {
|
|
|
99168
99197
|
function createPackageCandidates(rootDir) {
|
|
99169
99198
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
99170
99199
|
packageName,
|
|
99171
|
-
installedPackagePath:
|
|
99200
|
+
installedPackagePath: join72(rootDir, "node_modules", packageName, "package.json")
|
|
99172
99201
|
}));
|
|
99173
99202
|
}
|
|
99174
99203
|
function createTaggedInstallCandidates(rootDir) {
|
|
99175
|
-
const packagesDir =
|
|
99176
|
-
if (!
|
|
99204
|
+
const packagesDir = join72(rootDir, "packages");
|
|
99205
|
+
if (!existsSync52(packagesDir))
|
|
99177
99206
|
return [];
|
|
99178
99207
|
const candidates = [];
|
|
99179
99208
|
for (const entryName of readdirSync8(packagesDir).sort()) {
|
|
99180
99209
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
99181
99210
|
if (packageName === undefined)
|
|
99182
99211
|
continue;
|
|
99183
|
-
const installDir =
|
|
99212
|
+
const installDir = join72(packagesDir, entryName);
|
|
99184
99213
|
candidates.push({
|
|
99185
99214
|
cacheDir: installDir,
|
|
99186
|
-
cachePackagePath:
|
|
99215
|
+
cachePackagePath: join72(installDir, "package.json"),
|
|
99187
99216
|
packageCandidates: [
|
|
99188
99217
|
{
|
|
99189
99218
|
packageName,
|
|
99190
|
-
installedPackagePath:
|
|
99219
|
+
installedPackagePath: join72(installDir, "node_modules", packageName, "package.json")
|
|
99191
99220
|
}
|
|
99192
99221
|
]
|
|
99193
99222
|
});
|
|
@@ -99195,7 +99224,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
99195
99224
|
return candidates;
|
|
99196
99225
|
}
|
|
99197
99226
|
function selectInstalledPackage(candidate) {
|
|
99198
|
-
return candidate.packageCandidates.find((packageCandidate) =>
|
|
99227
|
+
return candidate.packageCandidates.find((packageCandidate) => existsSync52(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
|
|
99199
99228
|
}
|
|
99200
99229
|
function getExpectedVersion(cachePackage, packageName) {
|
|
99201
99230
|
return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
|
|
@@ -99206,14 +99235,14 @@ function resolveInstalledPackageJsonPath() {
|
|
|
99206
99235
|
for (const packageName of ACCEPTED_PACKAGE_NAMES) {
|
|
99207
99236
|
try {
|
|
99208
99237
|
const packageJsonPath = require2.resolve(`${packageName}/package.json`);
|
|
99209
|
-
if (
|
|
99238
|
+
if (existsSync52(packageJsonPath)) {
|
|
99210
99239
|
return { packageName, packageJsonPath };
|
|
99211
99240
|
}
|
|
99212
99241
|
} catch {
|
|
99213
99242
|
continue;
|
|
99214
99243
|
}
|
|
99215
99244
|
}
|
|
99216
|
-
const ownPackageJsonPath = findPackageJsonUp(
|
|
99245
|
+
const ownPackageJsonPath = findPackageJsonUp(fileURLToPath6(import.meta.url));
|
|
99217
99246
|
if (ownPackageJsonPath) {
|
|
99218
99247
|
return { packageName: PACKAGE_NAME, packageJsonPath: ownPackageJsonPath };
|
|
99219
99248
|
}
|
|
@@ -99232,22 +99261,22 @@ function getLoadedPluginVersion() {
|
|
|
99232
99261
|
const candidates = [
|
|
99233
99262
|
{
|
|
99234
99263
|
cacheDir: configDir,
|
|
99235
|
-
cachePackagePath:
|
|
99264
|
+
cachePackagePath: join72(configDir, "package.json"),
|
|
99236
99265
|
packageCandidates: createPackageCandidates(configDir)
|
|
99237
99266
|
},
|
|
99238
99267
|
...createTaggedInstallCandidates(configDir),
|
|
99239
99268
|
{
|
|
99240
99269
|
cacheDir,
|
|
99241
|
-
cachePackagePath:
|
|
99270
|
+
cachePackagePath: join72(cacheDir, "package.json"),
|
|
99242
99271
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
99243
99272
|
},
|
|
99244
99273
|
...createTaggedInstallCandidates(cacheDir)
|
|
99245
99274
|
];
|
|
99246
|
-
const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) =>
|
|
99275
|
+
const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync52(packageCandidate.installedPackagePath))) ?? candidates[0];
|
|
99247
99276
|
const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
|
|
99248
99277
|
const selectedPackage = selectInstalledPackage(selectedCandidate);
|
|
99249
99278
|
const candidateInstalledPath = selectedPackage.installedPackagePath;
|
|
99250
|
-
const candidateExists =
|
|
99279
|
+
const candidateExists = existsSync52(candidateInstalledPath);
|
|
99251
99280
|
const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
|
|
99252
99281
|
const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
|
|
99253
99282
|
const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
|
|
@@ -99283,7 +99312,7 @@ var defaultDeps6 = {
|
|
|
99283
99312
|
getLoadedPluginVersion,
|
|
99284
99313
|
getLatestPluginVersion,
|
|
99285
99314
|
getSuggestedInstallTag,
|
|
99286
|
-
configExists:
|
|
99315
|
+
configExists: existsSync53,
|
|
99287
99316
|
readConfigFile: (path14) => readFileSync33(path14, "utf-8"),
|
|
99288
99317
|
parseConfigContent: (content) => parseJsonc(content)
|
|
99289
99318
|
};
|
|
@@ -99430,12 +99459,12 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
99430
99459
|
// packages/omo-opencode/src/config/validate.ts
|
|
99431
99460
|
init_src();
|
|
99432
99461
|
import { readFileSync as readFileSync34 } from "node:fs";
|
|
99433
|
-
import { homedir as
|
|
99434
|
-
import { dirname as
|
|
99462
|
+
import { homedir as homedir16 } from "node:os";
|
|
99463
|
+
import { dirname as dirname28, relative as relative9 } from "node:path";
|
|
99435
99464
|
init_shared();
|
|
99436
99465
|
init_plugin_identity();
|
|
99437
99466
|
function resolveHomeDirectory2() {
|
|
99438
|
-
return process.env.HOME ?? process.env.USERPROFILE ??
|
|
99467
|
+
return process.env.HOME ?? process.env.USERPROFILE ?? homedir16();
|
|
99439
99468
|
}
|
|
99440
99469
|
function discoverConfigInDirectory(configDir) {
|
|
99441
99470
|
const detected = detectPluginConfigFile(configDir, {
|
|
@@ -99455,7 +99484,7 @@ function discoverProjectLayersNearestFirst(directory) {
|
|
|
99455
99484
|
const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
|
|
99456
99485
|
return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
|
|
99457
99486
|
path: configPath,
|
|
99458
|
-
configDir:
|
|
99487
|
+
configDir: dirname28(configPath)
|
|
99459
99488
|
}));
|
|
99460
99489
|
}
|
|
99461
99490
|
function shortPath(configPath) {
|
|
@@ -99479,7 +99508,7 @@ function parseLayerConfig(configPath) {
|
|
|
99479
99508
|
if (!isPlainRecord(rawConfig)) {
|
|
99480
99509
|
return {
|
|
99481
99510
|
path: configPath,
|
|
99482
|
-
configDir:
|
|
99511
|
+
configDir: dirname28(configPath),
|
|
99483
99512
|
config: null,
|
|
99484
99513
|
messages: [`${shortPath(configPath)}: <root>: Expected object`]
|
|
99485
99514
|
};
|
|
@@ -99487,7 +99516,7 @@ function parseLayerConfig(configPath) {
|
|
|
99487
99516
|
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
99488
99517
|
return {
|
|
99489
99518
|
path: configPath,
|
|
99490
|
-
configDir:
|
|
99519
|
+
configDir: dirname28(configPath),
|
|
99491
99520
|
config: result.success ? result.data : parseConfigPartially(rawConfig),
|
|
99492
99521
|
messages: schemaMessages(configPath, rawConfig)
|
|
99493
99522
|
};
|
|
@@ -99497,7 +99526,7 @@ function parseLayerConfig(configPath) {
|
|
|
99497
99526
|
}
|
|
99498
99527
|
return {
|
|
99499
99528
|
path: configPath,
|
|
99500
|
-
configDir:
|
|
99529
|
+
configDir: dirname28(configPath),
|
|
99501
99530
|
config: null,
|
|
99502
99531
|
messages: [`${shortPath(configPath)}: ${error51.message}`]
|
|
99503
99532
|
};
|
|
@@ -99543,23 +99572,23 @@ function validatePluginConfig(directory) {
|
|
|
99543
99572
|
|
|
99544
99573
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
99545
99574
|
init_shared();
|
|
99546
|
-
import { existsSync as
|
|
99547
|
-
import { homedir as
|
|
99548
|
-
import { join as
|
|
99575
|
+
import { existsSync as existsSync54, readFileSync as readFileSync35 } from "node:fs";
|
|
99576
|
+
import { homedir as homedir17 } from "node:os";
|
|
99577
|
+
import { join as join73 } from "node:path";
|
|
99549
99578
|
function getUserConfigDir2() {
|
|
99550
99579
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
99551
99580
|
if (xdgConfig)
|
|
99552
|
-
return
|
|
99553
|
-
return
|
|
99581
|
+
return join73(xdgConfig, "opencode");
|
|
99582
|
+
return join73(homedir17(), ".config", "opencode");
|
|
99554
99583
|
}
|
|
99555
99584
|
function loadCustomProviderNames() {
|
|
99556
99585
|
const configDir = getUserConfigDir2();
|
|
99557
99586
|
const candidatePaths = [
|
|
99558
|
-
|
|
99559
|
-
|
|
99587
|
+
join73(configDir, "opencode.json"),
|
|
99588
|
+
join73(configDir, "opencode.jsonc")
|
|
99560
99589
|
];
|
|
99561
99590
|
for (const configPath of candidatePaths) {
|
|
99562
|
-
if (!
|
|
99591
|
+
if (!existsSync54(configPath))
|
|
99563
99592
|
continue;
|
|
99564
99593
|
try {
|
|
99565
99594
|
const content = readFileSync35(configPath, "utf-8");
|
|
@@ -99577,9 +99606,9 @@ function loadCustomProviderNames() {
|
|
|
99577
99606
|
return [];
|
|
99578
99607
|
}
|
|
99579
99608
|
function loadAvailableModelsFromCache() {
|
|
99580
|
-
const cacheFile =
|
|
99609
|
+
const cacheFile = join73(getOpenCodeCacheDir(), "models.json");
|
|
99581
99610
|
const customProviders = loadCustomProviderNames();
|
|
99582
|
-
if (!
|
|
99611
|
+
if (!existsSync54(cacheFile)) {
|
|
99583
99612
|
if (customProviders.length > 0) {
|
|
99584
99613
|
return { providers: customProviders, modelCount: 0, cacheExists: true };
|
|
99585
99614
|
}
|
|
@@ -99614,8 +99643,8 @@ init_model_capabilities2();
|
|
|
99614
99643
|
init_shared();
|
|
99615
99644
|
init_plugin_identity();
|
|
99616
99645
|
import { readFileSync as readFileSync36 } from "node:fs";
|
|
99617
|
-
import { join as
|
|
99618
|
-
var PROJECT_CONFIG_DIR =
|
|
99646
|
+
import { join as join74 } from "node:path";
|
|
99647
|
+
var PROJECT_CONFIG_DIR = join74(process.cwd(), ".opencode");
|
|
99619
99648
|
function loadOmoConfig() {
|
|
99620
99649
|
const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR, {
|
|
99621
99650
|
basenames: [CONFIG_BASENAME],
|
|
@@ -99653,7 +99682,7 @@ function loadOmoConfig() {
|
|
|
99653
99682
|
|
|
99654
99683
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
99655
99684
|
init_shared();
|
|
99656
|
-
import { join as
|
|
99685
|
+
import { join as join75 } from "node:path";
|
|
99657
99686
|
|
|
99658
99687
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
99659
99688
|
function formatModelWithVariant(model, variant) {
|
|
@@ -99695,7 +99724,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
99695
99724
|
}
|
|
99696
99725
|
function buildModelResolutionDetails(options) {
|
|
99697
99726
|
const details = [];
|
|
99698
|
-
const cacheFile =
|
|
99727
|
+
const cacheFile = join75(getOpenCodeCacheDir(), "models.json");
|
|
99699
99728
|
details.push("═══ Available Models (from cache) ═══");
|
|
99700
99729
|
details.push("");
|
|
99701
99730
|
if (options.available.cacheExists) {
|
|
@@ -99971,28 +100000,28 @@ async function checkConfig() {
|
|
|
99971
100000
|
|
|
99972
100001
|
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
99973
100002
|
init_src();
|
|
99974
|
-
import { existsSync as
|
|
100003
|
+
import { existsSync as existsSync55 } from "node:fs";
|
|
99975
100004
|
import { createRequire as createRequire4 } from "node:module";
|
|
99976
|
-
import { homedir as
|
|
99977
|
-
import { dirname as
|
|
100005
|
+
import { homedir as homedir19 } from "node:os";
|
|
100006
|
+
import { dirname as dirname29, join as join77 } from "node:path";
|
|
99978
100007
|
|
|
99979
100008
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
99980
|
-
import { join as
|
|
99981
|
-
import { homedir as
|
|
100009
|
+
import { join as join76 } from "path";
|
|
100010
|
+
import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
|
|
99982
100011
|
init_binary_downloader();
|
|
99983
100012
|
init_logger2();
|
|
99984
100013
|
init_plugin_identity();
|
|
99985
100014
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
99986
|
-
var DEBUG_FILE =
|
|
100015
|
+
var DEBUG_FILE = join76(tmpdir3(), "comment-checker-debug.log");
|
|
99987
100016
|
function getCacheDir2() {
|
|
99988
100017
|
if (process.platform === "win32") {
|
|
99989
100018
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
99990
|
-
const base2 = localAppData ||
|
|
99991
|
-
return
|
|
100019
|
+
const base2 = localAppData || join76(homedir18(), "AppData", "Local");
|
|
100020
|
+
return join76(base2, CACHE_DIR_NAME, "bin");
|
|
99992
100021
|
}
|
|
99993
100022
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
99994
|
-
const base = xdgCache ||
|
|
99995
|
-
return
|
|
100023
|
+
const base = xdgCache || join76(homedir18(), ".cache");
|
|
100024
|
+
return join76(base, CACHE_DIR_NAME, "bin");
|
|
99996
100025
|
}
|
|
99997
100026
|
function getBinaryName() {
|
|
99998
100027
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -100042,7 +100071,7 @@ async function getBinaryVersion(binary) {
|
|
|
100042
100071
|
}
|
|
100043
100072
|
}
|
|
100044
100073
|
async function checkAstGrepCli() {
|
|
100045
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
100074
|
+
const runtimeDir = astGrepRuntimeDir(join77(homedir19(), ".omo"));
|
|
100046
100075
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
100047
100076
|
if (sgPath === null) {
|
|
100048
100077
|
return {
|
|
@@ -100071,12 +100100,12 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
100071
100100
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
100072
100101
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
100073
100102
|
try {
|
|
100074
|
-
const packageDir = baseDirOverride ??
|
|
100075
|
-
const vendorPath =
|
|
100076
|
-
if (
|
|
100103
|
+
const packageDir = baseDirOverride ?? dirname29(resolvePackageJsonPath());
|
|
100104
|
+
const vendorPath = join77(packageDir, "vendor", platformKey, binaryName);
|
|
100105
|
+
if (existsSync55(vendorPath))
|
|
100077
100106
|
return vendorPath;
|
|
100078
|
-
const binPath =
|
|
100079
|
-
if (
|
|
100107
|
+
const binPath = join77(packageDir, "bin", binaryName);
|
|
100108
|
+
if (existsSync55(binPath))
|
|
100080
100109
|
return binPath;
|
|
100081
100110
|
} catch (error51) {
|
|
100082
100111
|
if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
|
|
@@ -100221,12 +100250,12 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
100221
100250
|
|
|
100222
100251
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
100223
100252
|
import { readFileSync as readFileSync37 } from "node:fs";
|
|
100224
|
-
import { join as
|
|
100253
|
+
import { join as join78 } from "node:path";
|
|
100225
100254
|
|
|
100226
100255
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
100227
|
-
import { existsSync as
|
|
100228
|
-
import { delimiter as delimiter3, dirname as
|
|
100229
|
-
import { fileURLToPath as
|
|
100256
|
+
import { existsSync as existsSync56 } from "node:fs";
|
|
100257
|
+
import { delimiter as delimiter3, dirname as dirname30, resolve as resolve21 } from "node:path";
|
|
100258
|
+
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
100230
100259
|
|
|
100231
100260
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
100232
100261
|
function normalizeCliPath(path14) {
|
|
@@ -100272,7 +100301,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
|
|
|
100272
100301
|
}
|
|
100273
100302
|
|
|
100274
100303
|
// packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
|
|
100275
|
-
import { resolve as
|
|
100304
|
+
import { resolve as resolve20 } from "node:path";
|
|
100276
100305
|
function resolveJavaScriptRuntime(resolveExecutable) {
|
|
100277
100306
|
const node = resolveExecutable("node");
|
|
100278
100307
|
return node.available ? node : resolveExecutable("bun");
|
|
@@ -100280,9 +100309,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
|
|
|
100280
100309
|
function createAncestorCliCandidates(options) {
|
|
100281
100310
|
const candidates = [];
|
|
100282
100311
|
const seenPaths = new Set;
|
|
100283
|
-
let currentDirectory =
|
|
100312
|
+
let currentDirectory = resolve20(options.startDirectory);
|
|
100284
100313
|
while (true) {
|
|
100285
|
-
const distCliPath =
|
|
100314
|
+
const distCliPath = resolve20(currentDirectory, options.packageRel, options.distCliRel);
|
|
100286
100315
|
if (!seenPaths.has(distCliPath)) {
|
|
100287
100316
|
const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
|
|
100288
100317
|
seenPaths.add(distCliPath);
|
|
@@ -100294,7 +100323,7 @@ function createAncestorCliCandidates(options) {
|
|
|
100294
100323
|
runtimeAvailable: runtime5.available
|
|
100295
100324
|
});
|
|
100296
100325
|
}
|
|
100297
|
-
const sourceCliPath =
|
|
100326
|
+
const sourceCliPath = resolve20(currentDirectory, options.packageRel, options.sourceCliRel);
|
|
100298
100327
|
if (!seenPaths.has(sourceCliPath)) {
|
|
100299
100328
|
const runtime5 = options.resolveExecutable("bun");
|
|
100300
100329
|
const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
|
|
@@ -100311,7 +100340,7 @@ function createAncestorCliCandidates(options) {
|
|
|
100311
100340
|
runtimeAvailable: runtime5.available
|
|
100312
100341
|
});
|
|
100313
100342
|
}
|
|
100314
|
-
const parentDirectory =
|
|
100343
|
+
const parentDirectory = resolve20(currentDirectory, "..");
|
|
100315
100344
|
if (parentDirectory === currentDirectory)
|
|
100316
100345
|
return candidates;
|
|
100317
100346
|
currentDirectory = parentDirectory;
|
|
@@ -100347,7 +100376,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
100347
100376
|
].join(";");
|
|
100348
100377
|
function getModuleDirectory(moduleUrl) {
|
|
100349
100378
|
try {
|
|
100350
|
-
return
|
|
100379
|
+
return dirname30(fileURLToPath7(moduleUrl));
|
|
100351
100380
|
} catch (error51) {
|
|
100352
100381
|
if (!(error51 instanceof Error))
|
|
100353
100382
|
throw error51;
|
|
@@ -100355,23 +100384,23 @@ function getModuleDirectory(moduleUrl) {
|
|
|
100355
100384
|
}
|
|
100356
100385
|
}
|
|
100357
100386
|
function findBootstrapRoot(candidates, pathExists) {
|
|
100358
|
-
return candidates.find((candidate) => pathExists(
|
|
100387
|
+
return candidates.find((candidate) => pathExists(resolve21(candidate.root, "package.json")))?.root ?? process.cwd();
|
|
100359
100388
|
}
|
|
100360
100389
|
function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
100361
100390
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
100362
100391
|
const bun = resolveExecutable("bun");
|
|
100363
100392
|
const npm = resolveExecutable("npm");
|
|
100364
|
-
const packageManifestPath =
|
|
100393
|
+
const packageManifestPath = resolve21(root, PACKAGE_REL, "package.json");
|
|
100365
100394
|
return {
|
|
100366
100395
|
command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
|
|
100367
100396
|
root,
|
|
100368
|
-
path:
|
|
100397
|
+
path: resolve21(root, PACKAGE_REL, DIST_CLI_REL),
|
|
100369
100398
|
exists: runtime5.available && npm.available && pathExists(packageManifestPath),
|
|
100370
100399
|
runtimeAvailable: runtime5.available
|
|
100371
100400
|
};
|
|
100372
100401
|
}
|
|
100373
100402
|
function resolveLspCommand(options = {}) {
|
|
100374
|
-
const pathExists = options.exists ??
|
|
100403
|
+
const pathExists = options.exists ?? existsSync56;
|
|
100375
100404
|
const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
|
|
100376
100405
|
const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
|
|
100377
100406
|
const candidates = moduleDirectory ? createAncestorCliCandidates({
|
|
@@ -100381,7 +100410,7 @@ function resolveLspCommand(options = {}) {
|
|
|
100381
100410
|
sourceCliRel: SOURCE_CLI_REL,
|
|
100382
100411
|
pathExists,
|
|
100383
100412
|
resolveExecutable,
|
|
100384
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(
|
|
100413
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL))
|
|
100385
100414
|
}) : [];
|
|
100386
100415
|
const distCandidate = candidates.find((candidate) => hasCliSuffix(candidate.path, DIST_CLI_REL) && candidate.exists);
|
|
100387
100416
|
if (distCandidate) {
|
|
@@ -100428,7 +100457,7 @@ function readOmoConfig(configDirectory) {
|
|
|
100428
100457
|
}
|
|
100429
100458
|
function isLspMcpDisabled(options) {
|
|
100430
100459
|
const userConfigDirectory = options.configDirectory ?? getOpenCodeConfigDir({ binary: "opencode" });
|
|
100431
|
-
const projectConfigDirectory =
|
|
100460
|
+
const projectConfigDirectory = join78(options.cwd ?? process.cwd(), ".opencode");
|
|
100432
100461
|
const userConfig = readOmoConfig(userConfigDirectory);
|
|
100433
100462
|
const projectConfig = readOmoConfig(projectConfigDirectory);
|
|
100434
100463
|
const disabledMcps = new Set([
|
|
@@ -100447,21 +100476,21 @@ function getInstalledLspServers(options = {}) {
|
|
|
100447
100476
|
|
|
100448
100477
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
100449
100478
|
init_shared();
|
|
100450
|
-
import { existsSync as
|
|
100451
|
-
import { homedir as
|
|
100452
|
-
import { join as
|
|
100479
|
+
import { existsSync as existsSync57, readFileSync as readFileSync38 } from "node:fs";
|
|
100480
|
+
import { homedir as homedir20 } from "node:os";
|
|
100481
|
+
import { join as join79 } from "node:path";
|
|
100453
100482
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
100454
100483
|
function getMcpConfigPaths() {
|
|
100455
100484
|
return [
|
|
100456
|
-
|
|
100457
|
-
|
|
100458
|
-
|
|
100485
|
+
join79(homedir20(), ".claude", ".mcp.json"),
|
|
100486
|
+
join79(process.cwd(), ".mcp.json"),
|
|
100487
|
+
join79(process.cwd(), ".claude", ".mcp.json")
|
|
100459
100488
|
];
|
|
100460
100489
|
}
|
|
100461
100490
|
function loadUserMcpConfig() {
|
|
100462
100491
|
const servers = {};
|
|
100463
100492
|
for (const configPath of getMcpConfigPaths()) {
|
|
100464
|
-
if (!
|
|
100493
|
+
if (!existsSync57(configPath))
|
|
100465
100494
|
continue;
|
|
100466
100495
|
try {
|
|
100467
100496
|
const content = readFileSync38(configPath, "utf-8");
|
|
@@ -100599,12 +100628,12 @@ async function checkTools() {
|
|
|
100599
100628
|
|
|
100600
100629
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
100601
100630
|
init_src4();
|
|
100602
|
-
import { existsSync as
|
|
100631
|
+
import { existsSync as existsSync58, readFileSync as readFileSync39 } from "node:fs";
|
|
100603
100632
|
function isTelemetryState(value) {
|
|
100604
100633
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
100605
100634
|
}
|
|
100606
100635
|
function readLastActiveDay(stateFilePath) {
|
|
100607
|
-
if (!
|
|
100636
|
+
if (!existsSync58(stateFilePath)) {
|
|
100608
100637
|
return "never";
|
|
100609
100638
|
}
|
|
100610
100639
|
let parsed;
|
|
@@ -100667,17 +100696,17 @@ async function probeBinary(cmd, args, spawnImpl) {
|
|
|
100667
100696
|
}
|
|
100668
100697
|
|
|
100669
100698
|
// packages/team-core/src/team-registry/paths.ts
|
|
100670
|
-
import { homedir as
|
|
100699
|
+
import { homedir as homedir21 } from "node:os";
|
|
100671
100700
|
import path14 from "node:path";
|
|
100672
100701
|
function resolveBaseDir(config3) {
|
|
100673
|
-
return expandHomeDirectory(config3.base_dir ?? path14.join(
|
|
100702
|
+
return expandHomeDirectory(config3.base_dir ?? path14.join(homedir21(), ".omo"));
|
|
100674
100703
|
}
|
|
100675
100704
|
function expandHomeDirectory(directoryPath) {
|
|
100676
100705
|
if (directoryPath === "~") {
|
|
100677
|
-
return
|
|
100706
|
+
return homedir21();
|
|
100678
100707
|
}
|
|
100679
100708
|
if (directoryPath.startsWith("~/") || directoryPath.startsWith("~\\")) {
|
|
100680
|
-
return path14.join(
|
|
100709
|
+
return path14.join(homedir21(), directoryPath.slice(2));
|
|
100681
100710
|
}
|
|
100682
100711
|
return directoryPath;
|
|
100683
100712
|
}
|
|
@@ -100754,10 +100783,10 @@ async function pathExists(dir) {
|
|
|
100754
100783
|
|
|
100755
100784
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
100756
100785
|
init_src();
|
|
100757
|
-
import { existsSync as
|
|
100758
|
-
import { lstat as lstat12, readdir as readdir10, readFile as
|
|
100759
|
-
import { homedir as
|
|
100760
|
-
import { basename as basename13, join as
|
|
100786
|
+
import { existsSync as existsSync59 } from "node:fs";
|
|
100787
|
+
import { lstat as lstat12, readdir as readdir10, readFile as readFile23 } from "node:fs/promises";
|
|
100788
|
+
import { homedir as homedir22 } from "node:os";
|
|
100789
|
+
import { basename as basename13, join as join80, resolve as resolve22 } from "node:path";
|
|
100761
100790
|
// packages/omo-opencode/package.json
|
|
100762
100791
|
var package_default3 = {
|
|
100763
100792
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -100815,13 +100844,13 @@ var CODEX_BIN_NAMES = [
|
|
|
100815
100844
|
"omo-git-bash-hook"
|
|
100816
100845
|
];
|
|
100817
100846
|
async function gatherCodexSummary(deps = {}) {
|
|
100818
|
-
const codexHome =
|
|
100847
|
+
const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join80(homedir22(), ".codex"));
|
|
100819
100848
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
100820
100849
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
100821
100850
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
100822
|
-
const manifest = pluginRoot === null ? null : await readJson(
|
|
100823
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
100824
|
-
const configPath =
|
|
100851
|
+
const manifest = pluginRoot === null ? null : await readJson(join80(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
100852
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join80(pluginRoot, "lazycodex-install.json"));
|
|
100853
|
+
const configPath = join80(codexHome, "config.toml");
|
|
100825
100854
|
const pluginVersion = stringField(manifest, "version");
|
|
100826
100855
|
return {
|
|
100827
100856
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -100878,7 +100907,7 @@ function buildCodexIssues(summary) {
|
|
|
100878
100907
|
if (summary.pluginRoot === null) {
|
|
100879
100908
|
issues.push({
|
|
100880
100909
|
title: "OMO Codex plugin is not installed",
|
|
100881
|
-
description: `Expected cached plugin at ${
|
|
100910
|
+
description: `Expected cached plugin at ${join80("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
100882
100911
|
fix: "Run: npx lazycodex-ai install",
|
|
100883
100912
|
severity: "error",
|
|
100884
100913
|
affects: ["plugin loading"]
|
|
@@ -100943,15 +100972,15 @@ function buildCodexIssues(summary) {
|
|
|
100943
100972
|
return issues;
|
|
100944
100973
|
}
|
|
100945
100974
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
100946
|
-
const pluginRoot =
|
|
100947
|
-
if (!
|
|
100975
|
+
const pluginRoot = join80(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
100976
|
+
if (!existsSync59(pluginRoot))
|
|
100948
100977
|
return null;
|
|
100949
100978
|
const versions2 = await readdir10(pluginRoot, { withFileTypes: true });
|
|
100950
100979
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
100951
|
-
return candidates.length === 0 ? null :
|
|
100980
|
+
return candidates.length === 0 ? null : join80(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
100952
100981
|
}
|
|
100953
100982
|
async function readCodexConfigSummary(configPath) {
|
|
100954
|
-
if (!
|
|
100983
|
+
if (!existsSync59(configPath)) {
|
|
100955
100984
|
return {
|
|
100956
100985
|
exists: false,
|
|
100957
100986
|
marketplaceConfigured: false,
|
|
@@ -100962,7 +100991,7 @@ async function readCodexConfigSummary(configPath) {
|
|
|
100962
100991
|
companionLifecycleHookStateEvents: []
|
|
100963
100992
|
};
|
|
100964
100993
|
}
|
|
100965
|
-
const content = await
|
|
100994
|
+
const content = await readFile23(configPath, "utf8");
|
|
100966
100995
|
return {
|
|
100967
100996
|
exists: true,
|
|
100968
100997
|
marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
|
|
@@ -100976,21 +101005,21 @@ async function readCodexConfigSummary(configPath) {
|
|
|
100976
101005
|
async function readLinkedBins(binDir) {
|
|
100977
101006
|
const linked = [];
|
|
100978
101007
|
for (const name of CODEX_BIN_NAMES) {
|
|
100979
|
-
if (await pathExists2(
|
|
101008
|
+
if (await pathExists2(join80(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
100980
101009
|
linked.push(name);
|
|
100981
101010
|
}
|
|
100982
101011
|
return linked;
|
|
100983
101012
|
}
|
|
100984
101013
|
async function readLinkedAgents(codexHome) {
|
|
100985
|
-
const agentsDir =
|
|
100986
|
-
if (!
|
|
101014
|
+
const agentsDir = join80(codexHome, "agents");
|
|
101015
|
+
if (!existsSync59(agentsDir))
|
|
100987
101016
|
return [];
|
|
100988
101017
|
const entries = await readdir10(agentsDir, { withFileTypes: true });
|
|
100989
101018
|
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
|
|
100990
101019
|
}
|
|
100991
101020
|
async function readJson(path16) {
|
|
100992
101021
|
try {
|
|
100993
|
-
const parsed = JSON.parse(await
|
|
101022
|
+
const parsed = JSON.parse(await readFile23(path16, "utf8"));
|
|
100994
101023
|
return isPlainRecord(parsed) ? parsed : null;
|
|
100995
101024
|
} catch (error51) {
|
|
100996
101025
|
if (error51 instanceof Error)
|
|
@@ -101096,9 +101125,9 @@ async function pathExists2(path16) {
|
|
|
101096
101125
|
|
|
101097
101126
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
101098
101127
|
init_src();
|
|
101099
|
-
import { readdir as readdir11, readFile as
|
|
101100
|
-
import { homedir as
|
|
101101
|
-
import { dirname as
|
|
101128
|
+
import { readdir as readdir11, readFile as readFile24, stat as stat6 } from "node:fs/promises";
|
|
101129
|
+
import { homedir as homedir23 } from "node:os";
|
|
101130
|
+
import { dirname as dirname31, isAbsolute as isAbsolute12, join as join81, relative as relative10, resolve as resolve23, sep as sep9 } from "node:path";
|
|
101102
101131
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
101103
101132
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
101104
101133
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -101108,7 +101137,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
101108
101137
|
const env3 = deps.env ?? process.env;
|
|
101109
101138
|
const platform = deps.platform ?? process.platform;
|
|
101110
101139
|
const arch = deps.arch ?? process.arch;
|
|
101111
|
-
const codexHome =
|
|
101140
|
+
const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join81(homedir23(), ".codex"));
|
|
101112
101141
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
101113
101142
|
if (summary.pluginRoot === null) {
|
|
101114
101143
|
return {
|
|
@@ -101133,7 +101162,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
101133
101162
|
});
|
|
101134
101163
|
}
|
|
101135
101164
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
101136
|
-
const runtimeSgPath =
|
|
101165
|
+
const runtimeSgPath = join81(runtimeSgDir, sgBinaryName(platform));
|
|
101137
101166
|
const sg = findSgBinarySync({
|
|
101138
101167
|
arch,
|
|
101139
101168
|
env: env3,
|
|
@@ -101172,8 +101201,8 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
101172
101201
|
const manifest = await readJson2(manifestPath);
|
|
101173
101202
|
if (manifest === null || !isRecord5(manifest["mcpServers"]))
|
|
101174
101203
|
continue;
|
|
101175
|
-
const manifestRoot =
|
|
101176
|
-
const isRootManifest =
|
|
101204
|
+
const manifestRoot = dirname31(manifestPath);
|
|
101205
|
+
const isRootManifest = resolve23(manifestRoot) === resolve23(pluginRoot);
|
|
101177
101206
|
for (const server2 of Object.values(manifest["mcpServers"])) {
|
|
101178
101207
|
if (!isRecord5(server2) || !Array.isArray(server2["args"]))
|
|
101179
101208
|
continue;
|
|
@@ -101193,7 +101222,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
101193
101222
|
continue;
|
|
101194
101223
|
const commands2 = [];
|
|
101195
101224
|
collectHookCommands(manifest, commands2);
|
|
101196
|
-
const hookPluginRoot =
|
|
101225
|
+
const hookPluginRoot = dirname31(dirname31(hookManifestPath));
|
|
101197
101226
|
for (const command of commands2) {
|
|
101198
101227
|
for (const relativePath of extractPluginRootPaths(command)) {
|
|
101199
101228
|
referencedCount += 1;
|
|
@@ -101215,8 +101244,8 @@ function recordBrokenTarget(broken, classified, origin) {
|
|
|
101215
101244
|
broken.push(entry);
|
|
101216
101245
|
}
|
|
101217
101246
|
async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
|
|
101218
|
-
const targetPath =
|
|
101219
|
-
const bundleRootPath =
|
|
101247
|
+
const targetPath = resolve23(baseRoot, relativePath);
|
|
101248
|
+
const bundleRootPath = resolve23(bundleRoot);
|
|
101220
101249
|
const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
|
|
101221
101250
|
if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
|
|
101222
101251
|
if (allowEscape)
|
|
@@ -101232,7 +101261,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
|
|
|
101232
101261
|
}
|
|
101233
101262
|
async function findHookManifestPaths(root) {
|
|
101234
101263
|
const paths2 = await findManifestPaths(root, "hooks.json");
|
|
101235
|
-
return paths2.filter((path16) =>
|
|
101264
|
+
return paths2.filter((path16) => dirname31(path16).endsWith(`${sep9}hooks`));
|
|
101236
101265
|
}
|
|
101237
101266
|
async function findManifestPaths(root, manifestName) {
|
|
101238
101267
|
let entries;
|
|
@@ -101245,7 +101274,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
101245
101274
|
for (const entry of entries) {
|
|
101246
101275
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
101247
101276
|
continue;
|
|
101248
|
-
const entryPath =
|
|
101277
|
+
const entryPath = join81(root, entry.name);
|
|
101249
101278
|
if (entry.isDirectory()) {
|
|
101250
101279
|
paths2.push(...await findManifestPaths(entryPath, manifestName));
|
|
101251
101280
|
continue;
|
|
@@ -101289,18 +101318,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
101289
101318
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
101290
101319
|
}
|
|
101291
101320
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
101292
|
-
return
|
|
101321
|
+
return join81(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
101293
101322
|
}
|
|
101294
101323
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
101295
101324
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
101296
101325
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
101297
101326
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
101298
|
-
if (sgPath ===
|
|
101327
|
+
if (sgPath === join81(runtimeSgDir, sgBinaryName(platform)))
|
|
101299
101328
|
return "runtime dir";
|
|
101300
101329
|
return "PATH";
|
|
101301
101330
|
}
|
|
101302
101331
|
async function readBootstrapStateSummary(codexHome) {
|
|
101303
|
-
const statePath =
|
|
101332
|
+
const statePath = join81(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
101304
101333
|
const raw = await readJson2(statePath);
|
|
101305
101334
|
if (raw === null)
|
|
101306
101335
|
return null;
|
|
@@ -101349,7 +101378,7 @@ function degradedDetailLines(entries) {
|
|
|
101349
101378
|
}
|
|
101350
101379
|
async function readJson2(path16) {
|
|
101351
101380
|
try {
|
|
101352
|
-
const parsed = JSON.parse(await
|
|
101381
|
+
const parsed = JSON.parse(await readFile24(path16, "utf8"));
|
|
101353
101382
|
return isRecord5(parsed) ? parsed : null;
|
|
101354
101383
|
} catch (error51) {
|
|
101355
101384
|
if (error51 instanceof Error)
|
|
@@ -101376,23 +101405,23 @@ function isRecord5(value) {
|
|
|
101376
101405
|
}
|
|
101377
101406
|
|
|
101378
101407
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
101379
|
-
import { existsSync as
|
|
101380
|
-
import { readFile as
|
|
101381
|
-
import { homedir as
|
|
101382
|
-
import { join as
|
|
101408
|
+
import { existsSync as existsSync60 } from "node:fs";
|
|
101409
|
+
import { readFile as readFile25 } from "node:fs/promises";
|
|
101410
|
+
import { homedir as homedir24 } from "node:os";
|
|
101411
|
+
import { join as join82, resolve as resolve24 } from "node:path";
|
|
101383
101412
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
101384
101413
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
101385
101414
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
101386
101415
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
101387
|
-
const codexHome =
|
|
101416
|
+
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir24(), ".codex"));
|
|
101388
101417
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
101389
101418
|
const platform = deps.platform ?? process.platform;
|
|
101390
|
-
const wrapperPath =
|
|
101419
|
+
const wrapperPath = join82(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
101391
101420
|
const wrapper = await readRuntimeWrapper(wrapperPath);
|
|
101392
101421
|
const issues = [];
|
|
101393
101422
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
101394
101423
|
const targetPath = parseRuntimeTargetPath(wrapper);
|
|
101395
|
-
if (targetPath !== null && !
|
|
101424
|
+
if (targetPath !== null && !existsSync60(targetPath)) {
|
|
101396
101425
|
issues.push({
|
|
101397
101426
|
title: "omo runtime wrapper target is missing",
|
|
101398
101427
|
description: `Generated omo runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
|
|
@@ -101412,7 +101441,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
|
|
|
101412
101441
|
}
|
|
101413
101442
|
async function readRuntimeWrapper(path16) {
|
|
101414
101443
|
try {
|
|
101415
|
-
return await
|
|
101444
|
+
return await readFile25(path16, "utf8");
|
|
101416
101445
|
} catch (error51) {
|
|
101417
101446
|
if (error51 instanceof Error)
|
|
101418
101447
|
return null;
|
|
@@ -101891,7 +101920,7 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
101891
101920
|
import { createHash as createHash4 } from "node:crypto";
|
|
101892
101921
|
import {
|
|
101893
101922
|
chmodSync as chmodSync4,
|
|
101894
|
-
existsSync as
|
|
101923
|
+
existsSync as existsSync63,
|
|
101895
101924
|
mkdirSync as mkdirSync14,
|
|
101896
101925
|
readdirSync as readdirSync9,
|
|
101897
101926
|
readFileSync as readFileSync42,
|
|
@@ -101899,15 +101928,15 @@ import {
|
|
|
101899
101928
|
unlinkSync as unlinkSync8,
|
|
101900
101929
|
writeFileSync as writeFileSync11
|
|
101901
101930
|
} from "node:fs";
|
|
101902
|
-
import { basename as basename14, dirname as
|
|
101931
|
+
import { basename as basename14, dirname as dirname32, join as join85 } from "node:path";
|
|
101903
101932
|
|
|
101904
101933
|
// packages/mcp-client-core/src/config-dir.ts
|
|
101905
|
-
import { existsSync as
|
|
101906
|
-
import { homedir as
|
|
101907
|
-
import { join as
|
|
101934
|
+
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
|
|
101935
|
+
import { homedir as homedir25 } from "node:os";
|
|
101936
|
+
import { join as join83, resolve as resolve25 } from "node:path";
|
|
101908
101937
|
function resolveConfigPath2(pathValue) {
|
|
101909
|
-
const resolvedPath =
|
|
101910
|
-
if (!
|
|
101938
|
+
const resolvedPath = resolve25(pathValue);
|
|
101939
|
+
if (!existsSync61(resolvedPath))
|
|
101911
101940
|
return resolvedPath;
|
|
101912
101941
|
try {
|
|
101913
101942
|
return realpathSync8(resolvedPath);
|
|
@@ -101922,13 +101951,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
101922
101951
|
if (customConfigDir) {
|
|
101923
101952
|
return resolveConfigPath2(customConfigDir);
|
|
101924
101953
|
}
|
|
101925
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
101926
|
-
return resolveConfigPath2(
|
|
101954
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join83(homedir25(), ".config");
|
|
101955
|
+
return resolveConfigPath2(join83(xdgConfigDir, "opencode"));
|
|
101927
101956
|
}
|
|
101928
101957
|
|
|
101929
101958
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
101930
|
-
import { chmodSync as chmodSync3, existsSync as
|
|
101931
|
-
import { join as
|
|
101959
|
+
import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
|
|
101960
|
+
import { join as join84 } from "node:path";
|
|
101932
101961
|
var INDEX_FILE_NAME = "index.json";
|
|
101933
101962
|
function isTokenIndex(value) {
|
|
101934
101963
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -101936,11 +101965,11 @@ function isTokenIndex(value) {
|
|
|
101936
101965
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
101937
101966
|
}
|
|
101938
101967
|
function getIndexPath(storageDir) {
|
|
101939
|
-
return
|
|
101968
|
+
return join84(storageDir, INDEX_FILE_NAME);
|
|
101940
101969
|
}
|
|
101941
101970
|
function readTokenIndex(storageDir) {
|
|
101942
101971
|
const indexPath = getIndexPath(storageDir);
|
|
101943
|
-
if (!
|
|
101972
|
+
if (!existsSync62(indexPath))
|
|
101944
101973
|
return {};
|
|
101945
101974
|
try {
|
|
101946
101975
|
const parsed = JSON.parse(readFileSync41(indexPath, "utf-8"));
|
|
@@ -101980,16 +102009,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
101980
102009
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
101981
102010
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
101982
102011
|
function getMcpOauthStorageDir() {
|
|
101983
|
-
return
|
|
102012
|
+
return join85(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
101984
102013
|
}
|
|
101985
102014
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
101986
102015
|
return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
101987
102016
|
}
|
|
101988
102017
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
101989
|
-
return
|
|
102018
|
+
return join85(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
101990
102019
|
}
|
|
101991
102020
|
function getLegacyStoragePath() {
|
|
101992
|
-
return
|
|
102021
|
+
return join85(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
101993
102022
|
}
|
|
101994
102023
|
function normalizeHost2(serverHost) {
|
|
101995
102024
|
let host = serverHost.trim();
|
|
@@ -102050,7 +102079,7 @@ function isOAuthTokenData(value) {
|
|
|
102050
102079
|
return clientSecret === undefined || typeof clientSecret === "string";
|
|
102051
102080
|
}
|
|
102052
102081
|
function readTokenFile(filePath) {
|
|
102053
|
-
if (!
|
|
102082
|
+
if (!existsSync63(filePath))
|
|
102054
102083
|
return null;
|
|
102055
102084
|
try {
|
|
102056
102085
|
const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
|
|
@@ -102063,7 +102092,7 @@ function readTokenFile(filePath) {
|
|
|
102063
102092
|
}
|
|
102064
102093
|
function readLegacyStore() {
|
|
102065
102094
|
const filePath = getLegacyStoragePath();
|
|
102066
|
-
if (!
|
|
102095
|
+
if (!existsSync63(filePath))
|
|
102067
102096
|
return null;
|
|
102068
102097
|
try {
|
|
102069
102098
|
const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
|
|
@@ -102083,8 +102112,8 @@ function readLegacyStore() {
|
|
|
102083
102112
|
}
|
|
102084
102113
|
function writeTokenFile(filePath, token) {
|
|
102085
102114
|
try {
|
|
102086
|
-
const dir =
|
|
102087
|
-
if (!
|
|
102115
|
+
const dir = dirname32(filePath);
|
|
102116
|
+
if (!existsSync63(dir)) {
|
|
102088
102117
|
mkdirSync14(dir, { recursive: true });
|
|
102089
102118
|
}
|
|
102090
102119
|
const tempPath = `${filePath}.tmp.${Date.now()}`;
|
|
@@ -102108,7 +102137,7 @@ function saveToken(serverHost, resource, token) {
|
|
|
102108
102137
|
}
|
|
102109
102138
|
function deleteToken(serverHost, resource) {
|
|
102110
102139
|
const filePath = getMcpOauthStoragePath(serverHost, resource);
|
|
102111
|
-
if (!
|
|
102140
|
+
if (!existsSync63(filePath))
|
|
102112
102141
|
return deleteLegacyToken(serverHost, resource);
|
|
102113
102142
|
try {
|
|
102114
102143
|
unlinkSync8(filePath);
|
|
@@ -102130,7 +102159,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
102130
102159
|
if (Object.keys(store2).length === 0) {
|
|
102131
102160
|
try {
|
|
102132
102161
|
const filePath = getLegacyStoragePath();
|
|
102133
|
-
if (
|
|
102162
|
+
if (existsSync63(filePath))
|
|
102134
102163
|
unlinkSync8(filePath);
|
|
102135
102164
|
return true;
|
|
102136
102165
|
} catch (deleteError) {
|
|
@@ -102168,7 +102197,7 @@ function listTokensByHost(serverHost) {
|
|
|
102168
102197
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
102169
102198
|
if (!indexedKey.startsWith(prefix))
|
|
102170
102199
|
continue;
|
|
102171
|
-
const indexedToken = readTokenFile(
|
|
102200
|
+
const indexedToken = readTokenFile(join85(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
102172
102201
|
if (indexedToken)
|
|
102173
102202
|
result[indexedKey] = indexedToken;
|
|
102174
102203
|
}
|
|
@@ -102177,13 +102206,13 @@ function listTokensByHost(serverHost) {
|
|
|
102177
102206
|
function listAllTokens() {
|
|
102178
102207
|
const result = { ...readLegacyStore() ?? {} };
|
|
102179
102208
|
const dir = getMcpOauthStorageDir();
|
|
102180
|
-
if (!
|
|
102209
|
+
if (!existsSync63(dir))
|
|
102181
102210
|
return result;
|
|
102182
102211
|
const index = readTokenIndex(dir);
|
|
102183
102212
|
for (const entry of readdirSync9(dir, { withFileTypes: true })) {
|
|
102184
102213
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
102185
102214
|
continue;
|
|
102186
|
-
const token = readTokenFile(
|
|
102215
|
+
const token = readTokenFile(join85(dir, entry.name));
|
|
102187
102216
|
const hash2 = basename14(entry.name, ".json");
|
|
102188
102217
|
if (token)
|
|
102189
102218
|
result[index[hash2] ?? hash2] = token;
|
|
@@ -102383,7 +102412,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
|
102383
102412
|
}
|
|
102384
102413
|
var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
102385
102414
|
function startCallbackServer(port) {
|
|
102386
|
-
return new Promise((
|
|
102415
|
+
return new Promise((resolve26, reject) => {
|
|
102387
102416
|
let timeoutId;
|
|
102388
102417
|
const server2 = createServer2((request, response) => {
|
|
102389
102418
|
clearTimeout(timeoutId);
|
|
@@ -102409,7 +102438,7 @@ function startCallbackServer(port) {
|
|
|
102409
102438
|
response.writeHead(200, { "content-type": "text/html" });
|
|
102410
102439
|
response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
|
|
102411
102440
|
server2.close();
|
|
102412
|
-
|
|
102441
|
+
resolve26({ code, state: state2 });
|
|
102413
102442
|
});
|
|
102414
102443
|
timeoutId = setTimeout(() => {
|
|
102415
102444
|
server2.close();
|
|
@@ -102749,7 +102778,7 @@ function createMcpOAuthCommand() {
|
|
|
102749
102778
|
}
|
|
102750
102779
|
|
|
102751
102780
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
102752
|
-
import { existsSync as
|
|
102781
|
+
import { existsSync as existsSync64 } from "node:fs";
|
|
102753
102782
|
|
|
102754
102783
|
// packages/omo-opencode/src/cli/boulder/formatter.ts
|
|
102755
102784
|
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
@@ -102813,7 +102842,7 @@ function formatReadErrorMessage(isJson) {
|
|
|
102813
102842
|
}
|
|
102814
102843
|
|
|
102815
102844
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
102816
|
-
function
|
|
102845
|
+
function formatDurationHuman(durationMs) {
|
|
102817
102846
|
if (durationMs < 1000) {
|
|
102818
102847
|
return `${durationMs}ms`;
|
|
102819
102848
|
}
|
|
@@ -102852,11 +102881,11 @@ function buildCliWork(directory, work) {
|
|
|
102852
102881
|
const taskSession = currentTask ? work.task_sessions?.[currentTask.key] : undefined;
|
|
102853
102882
|
let currentTaskElapsedHuman;
|
|
102854
102883
|
if (taskSession?.elapsed_ms !== undefined) {
|
|
102855
|
-
currentTaskElapsedHuman =
|
|
102884
|
+
currentTaskElapsedHuman = formatDurationHuman(taskSession.elapsed_ms);
|
|
102856
102885
|
} else if (taskSession?.started_at) {
|
|
102857
102886
|
const startedAtMs = Date.parse(taskSession.started_at);
|
|
102858
102887
|
if (!Number.isNaN(startedAtMs)) {
|
|
102859
|
-
currentTaskElapsedHuman =
|
|
102888
|
+
currentTaskElapsedHuman = formatDurationHuman(Math.max(0, Date.now() - startedAtMs));
|
|
102860
102889
|
}
|
|
102861
102890
|
}
|
|
102862
102891
|
return {
|
|
@@ -102868,7 +102897,7 @@ function buildCliWork(directory, work) {
|
|
|
102868
102897
|
started_at: work.started_at,
|
|
102869
102898
|
ended_at: work.ended_at,
|
|
102870
102899
|
elapsed_ms: elapsedMs,
|
|
102871
|
-
elapsed_human: elapsedMs !== undefined ?
|
|
102900
|
+
elapsed_human: elapsedMs !== undefined ? formatDurationHuman(elapsedMs) : undefined,
|
|
102872
102901
|
total_tasks: progress.total,
|
|
102873
102902
|
completed_tasks: progress.completed,
|
|
102874
102903
|
remaining_tasks: Math.max(0, progress.total - progress.completed),
|
|
@@ -102886,10 +102915,10 @@ async function boulder(options) {
|
|
|
102886
102915
|
const boulderFilePath = getBoulderFilePath(directory);
|
|
102887
102916
|
const state2 = readBoulderState(directory);
|
|
102888
102917
|
if (!state2) {
|
|
102889
|
-
const message =
|
|
102918
|
+
const message = existsSync64(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
|
|
102890
102919
|
process.stderr.write(`${message}
|
|
102891
102920
|
`);
|
|
102892
|
-
return
|
|
102921
|
+
return existsSync64(boulderFilePath) ? 2 : 1;
|
|
102893
102922
|
}
|
|
102894
102923
|
const works = getBoulderWorks(state2);
|
|
102895
102924
|
const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
|
|
@@ -102907,11 +102936,12 @@ async function boulder(options) {
|
|
|
102907
102936
|
}
|
|
102908
102937
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
102909
102938
|
import { spawn as spawn5 } from "node:child_process";
|
|
102910
|
-
import { existsSync as
|
|
102911
|
-
import { homedir as
|
|
102939
|
+
import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync9 } from "node:fs";
|
|
102940
|
+
import { homedir as homedir26 } from "node:os";
|
|
102941
|
+
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
|
|
102912
102942
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
102913
102943
|
const env3 = input.env ?? process.env;
|
|
102914
|
-
const homeDir = input.homeDir ??
|
|
102944
|
+
const homeDir = input.homeDir ?? homedir26();
|
|
102915
102945
|
const localComponentBin = resolveLocalUlwLoopBin(env3, homeDir);
|
|
102916
102946
|
if (localComponentBin !== null)
|
|
102917
102947
|
return { executable: localComponentBin, argsPrefix: [] };
|
|
@@ -102921,6 +102951,8 @@ function resolveCodexUlwLoopCommand(input = {}) {
|
|
|
102921
102951
|
});
|
|
102922
102952
|
if (componentCli !== null)
|
|
102923
102953
|
return { executable: process.execPath, argsPrefix: [componentCli] };
|
|
102954
|
+
if (env3[ULW_LOOP_DELEGATION_SENTINEL] === "1")
|
|
102955
|
+
return null;
|
|
102924
102956
|
const legacyLocalBin = resolveLegacyLocalOmoBin(env3, homeDir, input.currentExecutablePaths ?? [process.argv[1]].filter((value) => typeof value === "string"));
|
|
102925
102957
|
if (legacyLocalBin !== null)
|
|
102926
102958
|
return { executable: legacyLocalBin, argsPrefix: ["ulw-loop"] };
|
|
@@ -102932,22 +102964,34 @@ async function codexUlwLoop(args) {
|
|
|
102932
102964
|
console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
|
|
102933
102965
|
return 1;
|
|
102934
102966
|
}
|
|
102935
|
-
|
|
102936
|
-
|
|
102937
|
-
|
|
102938
|
-
|
|
102939
|
-
|
|
102940
|
-
|
|
102941
|
-
|
|
102967
|
+
const { promise: promise2, resolve: resolve26 } = Promise.withResolvers();
|
|
102968
|
+
const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
|
|
102969
|
+
stdio: "inherit",
|
|
102970
|
+
env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
|
|
102971
|
+
});
|
|
102972
|
+
child.on("error", (error51) => {
|
|
102973
|
+
console.error(error51.message);
|
|
102974
|
+
resolve26(1);
|
|
102942
102975
|
});
|
|
102976
|
+
child.on("close", (code) => resolve26(code ?? 1));
|
|
102977
|
+
return promise2;
|
|
102943
102978
|
}
|
|
102944
102979
|
function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
102945
102980
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
|
|
102946
|
-
return candidates.find((candidate) =>
|
|
102981
|
+
return candidates.find((candidate) => existsSync65(candidate)) ?? null;
|
|
102947
102982
|
}
|
|
102948
102983
|
function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
102949
102984
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
|
|
102950
|
-
return candidates.find((candidate) =>
|
|
102985
|
+
return candidates.find((candidate) => existsSync65(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate)) ?? null;
|
|
102986
|
+
}
|
|
102987
|
+
function isGeneratedRuntimeWrapper(candidate) {
|
|
102988
|
+
try {
|
|
102989
|
+
return readFileSync43(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
|
|
102990
|
+
} catch (error51) {
|
|
102991
|
+
if (error51 instanceof Error)
|
|
102992
|
+
return false;
|
|
102993
|
+
return false;
|
|
102994
|
+
}
|
|
102951
102995
|
}
|
|
102952
102996
|
function isCurrentExecutable(candidate, currentExecutablePaths) {
|
|
102953
102997
|
const candidateRealPath = realpathOrSelf(candidate);
|
|
@@ -103031,13 +103075,17 @@ var VERSION3 = package_default.version;
|
|
|
103031
103075
|
var program2 = new Command;
|
|
103032
103076
|
function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION_NAME) {
|
|
103033
103077
|
const defaultPlatform = invocationName === "lazycodex" || invocationName === "lazycodex-ai" ? "codex" : undefined;
|
|
103078
|
+
const platform = options.platform ?? defaultPlatform;
|
|
103079
|
+
if (platform === "senpi" && !isSenpiPlatformEnabled()) {
|
|
103080
|
+
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.`);
|
|
103081
|
+
}
|
|
103034
103082
|
return {
|
|
103035
103083
|
tui: options.tui !== false,
|
|
103036
103084
|
claude: options.claude,
|
|
103037
103085
|
openai: options.openai,
|
|
103038
103086
|
gemini: options.gemini,
|
|
103039
103087
|
copilot: options.copilot,
|
|
103040
|
-
platform
|
|
103088
|
+
platform,
|
|
103041
103089
|
opencodeZen: options.opencodeZen,
|
|
103042
103090
|
zaiCodingPlan: options.zaiCodingPlan,
|
|
103043
103091
|
kimiForCoding: options.kimiForCoding,
|
|
@@ -103050,8 +103098,8 @@ function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION
|
|
|
103050
103098
|
skipAuth: options.skipAuth ?? false
|
|
103051
103099
|
};
|
|
103052
103100
|
}
|
|
103053
|
-
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>",
|
|
103054
|
-
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>",
|
|
103101
|
+
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();
|
|
103102
|
+
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", `
|
|
103055
103103
|
Examples:
|
|
103056
103104
|
$ bunx oh-my-opencode install
|
|
103057
103105
|
$ npx lazycodex-ai install --no-tui
|
|
@@ -103074,7 +103122,7 @@ Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi > Baili
|
|
|
103074
103122
|
`).action(async (options) => {
|
|
103075
103123
|
const rootOptions = program2.opts();
|
|
103076
103124
|
const args = resolveInstallArgs({ ...options, platform: options.platform ?? rootOptions.platform });
|
|
103077
|
-
const exitCode = await
|
|
103125
|
+
const exitCode = await install3(args);
|
|
103078
103126
|
process.exit(exitCode);
|
|
103079
103127
|
});
|
|
103080
103128
|
configureCleanupCommand(program2);
|