oh-my-opencode 5.0.0-beta.7 → 5.0.0-beta.9
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/command/publish.md +44 -16
- package/.agents/skills/publish/SKILL.md +44 -16
- package/.agents/skills/work-with-pr/SKILL.md +37 -23
- package/.opencode/command/publish.md +44 -16
- package/.opencode/skills/work-with-pr/SKILL.md +37 -23
- package/dist/agents/atlas/agent.d.ts +0 -1
- package/dist/agents/sisyphus/grok-4.d.ts +20 -0
- package/dist/agents/sisyphus/index.d.ts +2 -0
- package/dist/agents/sisyphus-agent-config.d.ts +6 -0
- package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/index.js +465 -352
- package/dist/cli/run/on-complete-hook.d.ts +2 -0
- package/dist/cli-node/index.js +465 -352
- package/dist/hooks/atlas/final-wave-approval-gate.test-support.d.ts +50 -0
- package/dist/hooks/atlas/system-reminder-templates.d.ts +0 -1
- package/dist/index.js +283 -38
- package/dist/shared/normalize-sdk-response.d.ts +1 -0
- package/dist/shared/shell-env.d.ts +1 -1
- package/dist/skills/frontend/SKILL.md +10 -7
- package/dist/skills/frontend/references/design/_INDEX.md +1 -0
- package/dist/skills/frontend/references/design/stylegallery.md +80 -0
- package/dist/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/dist/skills/ultimate-browsing/engine/AGENTS.md +110 -0
- package/dist/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
- package/dist/skills/ulw-plan/SKILL.md +2 -2
- package/dist/skills/ulw-plan/references/full-workflow.md +27 -3
- package/dist/skills/ulw-plan/references/intent-clear.md +2 -1
- package/dist/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/dist/tui.js +77 -9
- package/package.json +20 -19
- package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- 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/dist/cli.js +26 -4
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +26 -4
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- 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/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/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +3 -17
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- 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/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +16 -23
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
- package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
- package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +37 -69
- package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -15
- 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/start-work-continuation/test/cli.test.ts +0 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +2 -16
- 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/teammode/test/thread-title-hook.test.ts +3 -9
- 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/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +27 -3
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
- package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +5 -3
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +0 -3
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +2 -35
- package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
- 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-guarding-ulw-loop-spawns.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/stop-checking-ulw-loop-resume.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 +20 -20
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +10 -7
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +110 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
- package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +5 -3
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +27 -3
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -24
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
- package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
- package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
- package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
- package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
- package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
- package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
- package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
- package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
- package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
- package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
- package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
- package/packages/shared-skills/skills/frontend/SKILL.md +10 -7
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +110 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +2 -2
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +27 -3
- package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
- package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
package/dist/cli-node/index.js
CHANGED
|
@@ -1020,7 +1020,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1020
1020
|
this._exitCallback = (err) => {
|
|
1021
1021
|
if (err.code !== "commander.executeSubCommandAsync") {
|
|
1022
1022
|
throw err;
|
|
1023
|
-
}
|
|
1023
|
+
}
|
|
1024
1024
|
};
|
|
1025
1025
|
}
|
|
1026
1026
|
return this;
|
|
@@ -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: "5.0.0-beta.
|
|
2149
|
+
version: "5.0.0-beta.9",
|
|
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",
|
|
@@ -2282,6 +2282,7 @@ var init_package = __esm(() => {
|
|
|
2282
2282
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
2283
2283
|
test: "bun test",
|
|
2284
2284
|
"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 && npm --prefix packages/omo-codex/plugin/components/ulw-loop test && 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",
|
|
2285
|
+
"test:fast": "bun run script/test-fast.ts",
|
|
2285
2286
|
"test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test packages/omo-senpi",
|
|
2286
2287
|
"test:windows-codex": "bun run test:codex",
|
|
2287
2288
|
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
|
|
@@ -2326,7 +2327,7 @@ var init_package = __esm(() => {
|
|
|
2326
2327
|
zod: "^4.4.3"
|
|
2327
2328
|
},
|
|
2328
2329
|
devDependencies: {
|
|
2329
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
2330
|
+
"@code-yeongyu/senpi": "2026.8.17",
|
|
2330
2331
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
2331
2332
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
2332
2333
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
@@ -2358,7 +2359,7 @@ var init_package = __esm(() => {
|
|
|
2358
2359
|
"@oh-my-opencode/utils": "workspace:*",
|
|
2359
2360
|
"@types/js-yaml": "^4.0.9",
|
|
2360
2361
|
"@types/picomatch": "^4.0.3",
|
|
2361
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
2362
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
2362
2363
|
"@xterm/addon-unicode11": "^0.9.0",
|
|
2363
2364
|
"@xterm/xterm": "^6.0.0",
|
|
2364
2365
|
"bun-types": "1.3.14",
|
|
@@ -2367,24 +2368,24 @@ var init_package = __esm(() => {
|
|
|
2367
2368
|
typescript: "^7.0.2"
|
|
2368
2369
|
},
|
|
2369
2370
|
optionalDependencies: {
|
|
2370
|
-
"oh-my-opencode-darwin-arm64": "5.0.0-beta.
|
|
2371
|
-
"oh-my-opencode-darwin-x64": "5.0.0-beta.
|
|
2372
|
-
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.
|
|
2373
|
-
"oh-my-opencode-linux-arm64": "5.0.0-beta.
|
|
2374
|
-
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.
|
|
2375
|
-
"oh-my-opencode-linux-x64": "5.0.0-beta.
|
|
2376
|
-
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.
|
|
2377
|
-
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.
|
|
2378
|
-
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.
|
|
2379
|
-
"oh-my-opencode-windows-arm64": "5.0.0-beta.
|
|
2380
|
-
"oh-my-opencode-windows-x64": "5.0.0-beta.
|
|
2381
|
-
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.
|
|
2371
|
+
"oh-my-opencode-darwin-arm64": "5.0.0-beta.9",
|
|
2372
|
+
"oh-my-opencode-darwin-x64": "5.0.0-beta.9",
|
|
2373
|
+
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.9",
|
|
2374
|
+
"oh-my-opencode-linux-arm64": "5.0.0-beta.9",
|
|
2375
|
+
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.9",
|
|
2376
|
+
"oh-my-opencode-linux-x64": "5.0.0-beta.9",
|
|
2377
|
+
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.9",
|
|
2378
|
+
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.9",
|
|
2379
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.9",
|
|
2380
|
+
"oh-my-opencode-windows-arm64": "5.0.0-beta.9",
|
|
2381
|
+
"oh-my-opencode-windows-x64": "5.0.0-beta.9",
|
|
2382
|
+
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.9"
|
|
2382
2383
|
},
|
|
2383
2384
|
overrides: {
|
|
2384
|
-
"@earendil-works/pi-agent-core": "0.
|
|
2385
|
-
"@earendil-works/pi-ai": "0.
|
|
2386
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
2387
|
-
"@earendil-works/pi-tui": "0.
|
|
2385
|
+
"@earendil-works/pi-agent-core": "0.84.2",
|
|
2386
|
+
"@earendil-works/pi-ai": "0.84.2",
|
|
2387
|
+
"@earendil-works/pi-coding-agent": "0.84.2",
|
|
2388
|
+
"@earendil-works/pi-tui": "0.84.2",
|
|
2388
2389
|
hono: "^4.12.18",
|
|
2389
2390
|
"@hono/node-server": "^1.19.13",
|
|
2390
2391
|
"express-rate-limit": "^8.5.1",
|
|
@@ -18763,7 +18764,7 @@ function finalize(ctx, schema) {
|
|
|
18763
18764
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
18764
18765
|
} else if (ctx.target === "draft-04") {
|
|
18765
18766
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
18766
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
18767
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
18767
18768
|
if (ctx.external?.uri) {
|
|
18768
18769
|
const id = ctx.external.registry.get(schema)?.id;
|
|
18769
18770
|
if (!id)
|
|
@@ -19024,7 +19025,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
19024
19025
|
if (val === undefined) {
|
|
19025
19026
|
if (ctx.unrepresentable === "throw") {
|
|
19026
19027
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
19027
|
-
}
|
|
19028
|
+
}
|
|
19028
19029
|
} else if (typeof val === "bigint") {
|
|
19029
19030
|
if (ctx.unrepresentable === "throw") {
|
|
19030
19031
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -22585,7 +22586,7 @@ function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism
|
|
|
22585
22586
|
residency_max_children: record2["residency_max_children"] ?? Math.max(8, resolveParallelism() * 3)
|
|
22586
22587
|
});
|
|
22587
22588
|
}
|
|
22588
|
-
var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskSettingsSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
|
|
22589
|
+
var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
|
|
22589
22590
|
var init_task = __esm(() => {
|
|
22590
22591
|
init_zod();
|
|
22591
22592
|
ResidencyMaxChildrenInputSchema = union([number2().int().positive(), literal("unlimited")]);
|
|
@@ -22602,6 +22603,16 @@ var init_task = __esm(() => {
|
|
|
22602
22603
|
OmoTaskWarningsSchema = object({
|
|
22603
22604
|
unavailable_categories: boolean2().default(true)
|
|
22604
22605
|
}).strict();
|
|
22606
|
+
OmoTaskDagSettingsSchema = object({
|
|
22607
|
+
max_nodes_per_run: number2().int().positive().default(64),
|
|
22608
|
+
max_runs_per_session: number2().int().positive().default(16),
|
|
22609
|
+
subscriber_ring: number2().int().positive().default(1000),
|
|
22610
|
+
heartbeat_ms: number2().int().positive().default(15000),
|
|
22611
|
+
history_default_limit: number2().int().positive().default(256),
|
|
22612
|
+
history_max_limit: number2().int().positive().default(1000),
|
|
22613
|
+
retention_days: number2().int().positive().default(7),
|
|
22614
|
+
max_prompt_bytes: number2().int().positive().default(262144)
|
|
22615
|
+
}).strict();
|
|
22605
22616
|
OmoTaskSettingsSchema = object({
|
|
22606
22617
|
default_execution_mode: _enum2(["in-process", "process"]).default("in-process"),
|
|
22607
22618
|
default_concurrency: number2().int().positive().default(5),
|
|
@@ -22619,7 +22630,18 @@ var init_task = __esm(() => {
|
|
|
22619
22630
|
max_members: 8,
|
|
22620
22631
|
max_parallel_members: 4,
|
|
22621
22632
|
max_wall_clock_minutes: 120
|
|
22622
|
-
})
|
|
22633
|
+
}),
|
|
22634
|
+
dag: OmoTaskDagSettingsSchema.optional()
|
|
22635
|
+
}).strict();
|
|
22636
|
+
OmoTaskDagSettingsLayerSchema = object({
|
|
22637
|
+
max_nodes_per_run: number2().int().positive().optional(),
|
|
22638
|
+
max_runs_per_session: number2().int().positive().optional(),
|
|
22639
|
+
subscriber_ring: number2().int().positive().optional(),
|
|
22640
|
+
heartbeat_ms: number2().int().positive().optional(),
|
|
22641
|
+
history_default_limit: number2().int().positive().optional(),
|
|
22642
|
+
history_max_limit: number2().int().positive().optional(),
|
|
22643
|
+
retention_days: number2().int().positive().optional(),
|
|
22644
|
+
max_prompt_bytes: number2().int().positive().optional()
|
|
22623
22645
|
}).strict();
|
|
22624
22646
|
OmoTaskWaitLayerSchema = object({
|
|
22625
22647
|
min_ms: number2().int().positive().optional(),
|
|
@@ -22647,7 +22669,8 @@ var init_task = __esm(() => {
|
|
|
22647
22669
|
resume_children: boolean2().optional(),
|
|
22648
22670
|
warnings: OmoTaskWarningsLayerSchema.optional(),
|
|
22649
22671
|
wait: OmoTaskWaitLayerSchema.optional(),
|
|
22650
|
-
team: OmoTaskTeamSettingsLayerSchema.optional()
|
|
22672
|
+
team: OmoTaskTeamSettingsLayerSchema.optional(),
|
|
22673
|
+
dag: OmoTaskDagSettingsLayerSchema.optional()
|
|
22651
22674
|
}).strict();
|
|
22652
22675
|
});
|
|
22653
22676
|
|
|
@@ -26472,10 +26495,10 @@ var init_category_model_requirements = __esm(() => {
|
|
|
26472
26495
|
quick: {
|
|
26473
26496
|
fallbackChain: [
|
|
26474
26497
|
{ providers: ["kimi-for-coding"], model: "kimi-for-coding-highspeed" },
|
|
26475
|
-
{ providers: ["
|
|
26498
|
+
{ providers: ["openai-codex"], model: "gpt-5.6-luna-fast", variant: "low" },
|
|
26476
26499
|
{ providers: ["deepseek"], model: "deepseek-v4-flash", variant: "off" },
|
|
26477
26500
|
{
|
|
26478
|
-
providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "
|
|
26501
|
+
providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "vercel"],
|
|
26479
26502
|
model: "qwen3.6-flash",
|
|
26480
26503
|
variant: "low"
|
|
26481
26504
|
},
|
|
@@ -26491,6 +26514,11 @@ var init_category_model_requirements = __esm(() => {
|
|
|
26491
26514
|
},
|
|
26492
26515
|
"unspecified-low": {
|
|
26493
26516
|
fallbackChain: [
|
|
26517
|
+
{
|
|
26518
|
+
providers: ["xai", "github-copilot", "opencode", "vercel"],
|
|
26519
|
+
model: "grok-4.6",
|
|
26520
|
+
variant: "xhigh"
|
|
26521
|
+
},
|
|
26494
26522
|
{
|
|
26495
26523
|
providers: ["openai", "quotio-openai", "github-copilot", "opencode", "vercel"],
|
|
26496
26524
|
model: "gpt-5.6-terra",
|
|
@@ -27725,6 +27753,7 @@ var init_context_limit_resolver2 = () => {};
|
|
|
27725
27753
|
|
|
27726
27754
|
// packages/omo-opencode/src/shared/normalize-sdk-response.ts
|
|
27727
27755
|
function normalizeSDKResponse(response, fallback, options) {
|
|
27756
|
+
const fallbackIsArray = Array.isArray(fallback);
|
|
27728
27757
|
if (response == null) {
|
|
27729
27758
|
return fallback;
|
|
27730
27759
|
}
|
|
@@ -27734,14 +27763,17 @@ function normalizeSDKResponse(response, fallback, options) {
|
|
|
27734
27763
|
if (typeof response === "object" && "data" in response) {
|
|
27735
27764
|
const data = response.data;
|
|
27736
27765
|
if (data != null) {
|
|
27766
|
+
if (fallbackIsArray && !Array.isArray(data)) {
|
|
27767
|
+
return fallback;
|
|
27768
|
+
}
|
|
27737
27769
|
return data;
|
|
27738
27770
|
}
|
|
27739
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
27771
|
+
if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
|
|
27740
27772
|
return response;
|
|
27741
27773
|
}
|
|
27742
27774
|
return fallback;
|
|
27743
27775
|
}
|
|
27744
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
27776
|
+
if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
|
|
27745
27777
|
return response;
|
|
27746
27778
|
}
|
|
27747
27779
|
return fallback;
|
|
@@ -28221,7 +28253,7 @@ This is NOT a default choice - it's for genuinely unclassifiable moderate-effort
|
|
|
28221
28253
|
</Category_Context>
|
|
28222
28254
|
|
|
28223
28255
|
<Caller_Warning>
|
|
28224
|
-
THIS CATEGORY USES
|
|
28256
|
+
THIS CATEGORY USES GROK 4.6 (xhigh).
|
|
28225
28257
|
|
|
28226
28258
|
**PROVIDE CLEAR STRUCTURE:**
|
|
28227
28259
|
1. MUST DO: Enumerate required actions explicitly
|
|
@@ -28253,7 +28285,7 @@ var init_openai_categories = __esm(() => {
|
|
|
28253
28285
|
},
|
|
28254
28286
|
{
|
|
28255
28287
|
name: "unspecified-low",
|
|
28256
|
-
config: { model: "
|
|
28288
|
+
config: { model: "xai/grok-4.6", variant: "xhigh" },
|
|
28257
28289
|
description: "Tasks that don't fit other categories, low effort required",
|
|
28258
28290
|
promptAppend: UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND
|
|
28259
28291
|
}
|
|
@@ -83150,6 +83182,47 @@ var init_model_capabilities_generated = __esm(() => {
|
|
|
83150
83182
|
input: 272000,
|
|
83151
83183
|
output: 128000
|
|
83152
83184
|
}
|
|
83185
|
+
},
|
|
83186
|
+
"grok-4.6": {
|
|
83187
|
+
id: "grok-4.6",
|
|
83188
|
+
family: "grok",
|
|
83189
|
+
reasoning: true,
|
|
83190
|
+
temperature: true,
|
|
83191
|
+
toolCall: true,
|
|
83192
|
+
modalities: {
|
|
83193
|
+
input: [
|
|
83194
|
+
"text",
|
|
83195
|
+
"image"
|
|
83196
|
+
],
|
|
83197
|
+
output: [
|
|
83198
|
+
"text"
|
|
83199
|
+
]
|
|
83200
|
+
},
|
|
83201
|
+
limit: {
|
|
83202
|
+
context: 500000,
|
|
83203
|
+
output: 500000
|
|
83204
|
+
}
|
|
83205
|
+
},
|
|
83206
|
+
"xai/grok-4.6": {
|
|
83207
|
+
id: "xai/grok-4.6",
|
|
83208
|
+
family: "grok",
|
|
83209
|
+
reasoning: true,
|
|
83210
|
+
temperature: true,
|
|
83211
|
+
toolCall: true,
|
|
83212
|
+
modalities: {
|
|
83213
|
+
input: [
|
|
83214
|
+
"text",
|
|
83215
|
+
"image",
|
|
83216
|
+
"pdf"
|
|
83217
|
+
],
|
|
83218
|
+
output: [
|
|
83219
|
+
"text"
|
|
83220
|
+
]
|
|
83221
|
+
},
|
|
83222
|
+
limit: {
|
|
83223
|
+
context: 500000,
|
|
83224
|
+
output: 500000
|
|
83225
|
+
}
|
|
83153
83226
|
}
|
|
83154
83227
|
}
|
|
83155
83228
|
};
|
|
@@ -83191,21 +83264,21 @@ var init_session_cursor = __esm(() => {
|
|
|
83191
83264
|
});
|
|
83192
83265
|
|
|
83193
83266
|
// packages/omo-opencode/src/shared/shell-env.ts
|
|
83194
|
-
function detectShellType() {
|
|
83195
|
-
if (
|
|
83196
|
-
const shell =
|
|
83267
|
+
function detectShellType(platform = process.platform, env2 = process.env) {
|
|
83268
|
+
if (env2.SHELL) {
|
|
83269
|
+
const shell = env2.SHELL;
|
|
83197
83270
|
if (shell.includes("csh") || shell.includes("tcsh")) {
|
|
83198
83271
|
return "csh";
|
|
83199
83272
|
}
|
|
83200
83273
|
return "unix";
|
|
83201
83274
|
}
|
|
83202
|
-
if (
|
|
83275
|
+
if (platform === "win32" && (env2.BASH_VERSION || env2.MSYSTEM || env2.WSL_DISTRO_NAME)) {
|
|
83203
83276
|
return "unix";
|
|
83204
83277
|
}
|
|
83205
|
-
if (
|
|
83278
|
+
if (env2.PSModulePath) {
|
|
83206
83279
|
return "powershell";
|
|
83207
83280
|
}
|
|
83208
|
-
return
|
|
83281
|
+
return platform === "win32" ? "cmd" : "unix";
|
|
83209
83282
|
}
|
|
83210
83283
|
var init_shell_env = () => {};
|
|
83211
83284
|
|
|
@@ -94613,7 +94686,7 @@ var package_default2;
|
|
|
94613
94686
|
var init_package2 = __esm(() => {
|
|
94614
94687
|
package_default2 = {
|
|
94615
94688
|
name: "@oh-my-opencode/omo-codex",
|
|
94616
|
-
version: "5.0.0-beta.
|
|
94689
|
+
version: "5.0.0-beta.9",
|
|
94617
94690
|
type: "module",
|
|
94618
94691
|
private: true,
|
|
94619
94692
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -95582,8 +95655,8 @@ var init_update_toasts = __esm(() => {
|
|
|
95582
95655
|
});
|
|
95583
95656
|
|
|
95584
95657
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
95585
|
-
import { existsSync as
|
|
95586
|
-
import { dirname as dirname30, join as
|
|
95658
|
+
import { existsSync as existsSync48 } from "node:fs";
|
|
95659
|
+
import { dirname as dirname30, join as join76 } from "node:path";
|
|
95587
95660
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
95588
95661
|
function defaultGetModuleHostingWorkspace() {
|
|
95589
95662
|
try {
|
|
@@ -95736,8 +95809,8 @@ var init_background_update_check = __esm(() => {
|
|
|
95736
95809
|
init_package_json_locator();
|
|
95737
95810
|
init_update_toasts();
|
|
95738
95811
|
defaultDeps4 = {
|
|
95739
|
-
existsSync:
|
|
95740
|
-
join:
|
|
95812
|
+
existsSync: existsSync48,
|
|
95813
|
+
join: join76,
|
|
95741
95814
|
runBunInstallWithDetails,
|
|
95742
95815
|
log: log2,
|
|
95743
95816
|
getOpenCodeCacheDir,
|
|
@@ -95900,7 +95973,7 @@ async function showSpinnerToast(ctx, version3, message) {
|
|
|
95900
95973
|
duration: frameInterval + 50
|
|
95901
95974
|
}
|
|
95902
95975
|
}).catch(ignoreToastError);
|
|
95903
|
-
await new Promise((
|
|
95976
|
+
await new Promise((resolve22) => setTimeout(resolve22, frameInterval));
|
|
95904
95977
|
}
|
|
95905
95978
|
}
|
|
95906
95979
|
var SISYPHUS_SPINNER;
|
|
@@ -101512,29 +101585,55 @@ function nodeErrorCode6(error51) {
|
|
|
101512
101585
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
101513
101586
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101514
101587
|
import { execFile as execFile4 } from "node:child_process";
|
|
101515
|
-
import { existsSync as
|
|
101516
|
-
import { homedir as
|
|
101517
|
-
import { dirname as dirname24, join as
|
|
101588
|
+
import { existsSync as existsSync32 } from "node:fs";
|
|
101589
|
+
import { homedir as homedir11 } from "node:os";
|
|
101590
|
+
import { dirname as dirname24, join as join63, resolve as resolve20 } from "node:path";
|
|
101518
101591
|
import { fileURLToPath } from "node:url";
|
|
101519
101592
|
import { promisify as promisify2 } from "node:util";
|
|
101520
101593
|
|
|
101521
|
-
// packages/omo-senpi/src/
|
|
101522
|
-
import {
|
|
101594
|
+
// packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
|
|
101595
|
+
import { existsSync as existsSync30 } from "node:fs";
|
|
101523
101596
|
import { homedir as homedir9 } from "node:os";
|
|
101524
|
-
import {
|
|
101597
|
+
import { join as join59, resolve as resolve17 } from "node:path";
|
|
101598
|
+
var AGENT_DIR_ENV_NAMES = [
|
|
101599
|
+
"OMO_CODING_AGENT_DIR",
|
|
101600
|
+
"SENPI_CODING_AGENT_DIR",
|
|
101601
|
+
"PI_CODING_AGENT_DIR"
|
|
101602
|
+
];
|
|
101603
|
+
var AGENT_HOME_SENTINEL = "settings.json";
|
|
101604
|
+
function resolveAgentHome(options) {
|
|
101605
|
+
const { env: env3, homeDir = homedir9(), exists: exists7 = existsSync30 } = options;
|
|
101606
|
+
for (const name of AGENT_DIR_ENV_NAMES) {
|
|
101607
|
+
const configured = env3[name]?.trim();
|
|
101608
|
+
if (configured)
|
|
101609
|
+
return resolve17(configured);
|
|
101610
|
+
}
|
|
101611
|
+
const brandedHome = join59(homeDir, ".omo");
|
|
101612
|
+
const canonical = join59(brandedHome, "agent");
|
|
101613
|
+
if (exists7(join59(canonical, AGENT_HOME_SENTINEL)))
|
|
101614
|
+
return canonical;
|
|
101615
|
+
if (exists7(join59(brandedHome, AGENT_HOME_SENTINEL)))
|
|
101616
|
+
return brandedHome;
|
|
101617
|
+
return join59(homeDir, ".senpi", "agent");
|
|
101618
|
+
}
|
|
101619
|
+
|
|
101620
|
+
// packages/omo-senpi/src/install/local-launcher.ts
|
|
101621
|
+
import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync, writeFileSync as writeFileSync6 } from "node:fs";
|
|
101622
|
+
import { homedir as homedir10 } from "node:os";
|
|
101623
|
+
import { dirname as dirname21, join as join60, resolve as resolve18 } from "node:path";
|
|
101525
101624
|
var MARKER = "omo-local-launcher";
|
|
101526
|
-
function localLauncherPath(homeDir =
|
|
101527
|
-
return
|
|
101625
|
+
function localLauncherPath(homeDir = homedir10()) {
|
|
101626
|
+
return join60(homeDir, ".local", "bin", "omo");
|
|
101528
101627
|
}
|
|
101529
|
-
function localLauncherCmdPath(homeDir =
|
|
101530
|
-
return
|
|
101628
|
+
function localLauncherCmdPath(homeDir = homedir10()) {
|
|
101629
|
+
return join60(homeDir, ".local", "bin", "omo.cmd");
|
|
101531
101630
|
}
|
|
101532
101631
|
function renderLocalLauncher(options) {
|
|
101533
101632
|
const brand = {
|
|
101534
101633
|
name: "omo",
|
|
101535
101634
|
displayVersion: options.version ?? "local",
|
|
101536
101635
|
configDir: ".omo",
|
|
101537
|
-
flatLayout:
|
|
101636
|
+
flatLayout: false,
|
|
101538
101637
|
envPrefix: "OMO",
|
|
101539
101638
|
userAgent: "omo",
|
|
101540
101639
|
originator: "omo",
|
|
@@ -101548,11 +101647,23 @@ function renderLocalLauncher(options) {
|
|
|
101548
101647
|
return `#!/usr/bin/env node
|
|
101549
101648
|
// ${MARKER}: generated by the omo-senpi installer. Delete this file to remove the local launcher.
|
|
101550
101649
|
import { spawn } from "node:child_process"
|
|
101650
|
+
import { homedir } from "node:os"
|
|
101651
|
+
import { join } from "node:path"
|
|
101551
101652
|
|
|
101552
101653
|
const brand = ${JSON.stringify(brand)}
|
|
101553
101654
|
const cli = process.env.OMO_SENPI_CLI_PATH ?? ${JSON.stringify(options.senpiCliPath)}
|
|
101554
101655
|
const plugin = process.env.OMO_PLUGIN_ROOT ?? ${JSON.stringify(options.pluginPath)}
|
|
101555
|
-
|
|
101656
|
+
// The same directory the published launcher pins, so a local install shares one state location
|
|
101657
|
+
// with the published one and with anything either of them spawns.
|
|
101658
|
+
const agentDir = process.env.OMO_CODING_AGENT_DIR ?? process.env.SENPI_CODING_AGENT_DIR
|
|
101659
|
+
?? process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".omo", "agent")
|
|
101660
|
+
const env = {
|
|
101661
|
+
...process.env,
|
|
101662
|
+
SENPI_BRAND: JSON.stringify(brand),
|
|
101663
|
+
OMO_NATIVE: "1",
|
|
101664
|
+
OMO_CODING_AGENT_DIR: agentDir,
|
|
101665
|
+
SENPI_CODING_AGENT_DIR: agentDir,
|
|
101666
|
+
}
|
|
101556
101667
|
// Anything resolving the product by name must re-enter through this launcher, never the engine.
|
|
101557
101668
|
env.OMO_BIN = process.argv[1]
|
|
101558
101669
|
const selfUpdate = process.argv[2] === "update"
|
|
@@ -101577,7 +101688,7 @@ child.on("close", (code, signal) => {
|
|
|
101577
101688
|
}
|
|
101578
101689
|
function installLocalLauncher(options) {
|
|
101579
101690
|
const path6 = localLauncherPath(options.homeDir);
|
|
101580
|
-
if (
|
|
101691
|
+
if (existsSync31(path6) && !readFileSync14(path6, "utf8").includes(MARKER))
|
|
101581
101692
|
return;
|
|
101582
101693
|
mkdirSync10(dirname21(path6), { recursive: true });
|
|
101583
101694
|
writeFileSync6(path6, renderLocalLauncher(options));
|
|
@@ -101594,16 +101705,16 @@ node "%~dp0omo" %*\r
|
|
|
101594
101705
|
import { createHash as createHash5 } from "node:crypto";
|
|
101595
101706
|
import { constants as constants8 } from "node:fs";
|
|
101596
101707
|
import { access as access2, readFile as readFile26, stat as stat6 } from "node:fs/promises";
|
|
101597
|
-
import { dirname as dirname23, join as
|
|
101708
|
+
import { dirname as dirname23, join as join62 } from "node:path";
|
|
101598
101709
|
|
|
101599
101710
|
// packages/omo-senpi/src/install/senpi-settings.ts
|
|
101600
101711
|
import { constants as constants7 } from "node:fs";
|
|
101601
101712
|
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "node:fs/promises";
|
|
101602
|
-
import { dirname as dirname22, join as
|
|
101713
|
+
import { dirname as dirname22, join as join61, resolve as resolve19 } from "node:path";
|
|
101603
101714
|
var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
|
|
101604
101715
|
var LEGACY_BUILTIN_SHADOW_PACKAGES = [
|
|
101605
|
-
|
|
101606
|
-
|
|
101716
|
+
join61("packages", "pi-goal"),
|
|
101717
|
+
join61("packages", "pi-webfetch")
|
|
101607
101718
|
];
|
|
101608
101719
|
async function readSettings(settingsPath) {
|
|
101609
101720
|
let raw;
|
|
@@ -101632,13 +101743,13 @@ function dedupePackages(packages) {
|
|
|
101632
101743
|
return [...new Set(packages)];
|
|
101633
101744
|
}
|
|
101634
101745
|
function removeLegacyBuiltinShadows(packages, repoRoot, agentDir) {
|
|
101635
|
-
const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) =>
|
|
101636
|
-
return packages.filter((entry) => !shadowPaths.has(
|
|
101746
|
+
const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) => resolve19(repoRoot, path6)));
|
|
101747
|
+
return packages.filter((entry) => !shadowPaths.has(resolve19(agentDir, entry)));
|
|
101637
101748
|
}
|
|
101638
101749
|
async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir) {
|
|
101639
|
-
const currentPath =
|
|
101750
|
+
const currentPath = resolve19(currentPluginPath);
|
|
101640
101751
|
const entries = await Promise.all(packages.map(async (entry) => {
|
|
101641
|
-
const packagePath =
|
|
101752
|
+
const packagePath = resolve19(agentDir, entry);
|
|
101642
101753
|
if (packagePath === currentPath)
|
|
101643
101754
|
return currentPath;
|
|
101644
101755
|
return await readPackageName(packagePath) === OMO_SENPI_PACKAGE_NAME ? undefined : entry;
|
|
@@ -101678,7 +101789,7 @@ function isRecord10(value) {
|
|
|
101678
101789
|
async function readPackageName(packagePath) {
|
|
101679
101790
|
let raw;
|
|
101680
101791
|
try {
|
|
101681
|
-
raw = await readFile25(
|
|
101792
|
+
raw = await readFile25(join61(packagePath, "package.json"), "utf8");
|
|
101682
101793
|
} catch (error51) {
|
|
101683
101794
|
if (isErrno(error51, "ENOENT") || isErrno(error51, "ENOTDIR"))
|
|
101684
101795
|
return;
|
|
@@ -101703,54 +101814,54 @@ function isErrno(error51, code) {
|
|
|
101703
101814
|
|
|
101704
101815
|
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101705
101816
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
101706
|
-
|
|
101707
|
-
|
|
101708
|
-
|
|
101709
|
-
|
|
101710
|
-
|
|
101711
|
-
|
|
101712
|
-
|
|
101713
|
-
|
|
101714
|
-
|
|
101715
|
-
|
|
101716
|
-
|
|
101717
|
-
|
|
101718
|
-
|
|
101719
|
-
|
|
101720
|
-
|
|
101721
|
-
|
|
101722
|
-
|
|
101723
|
-
|
|
101724
|
-
|
|
101725
|
-
|
|
101726
|
-
|
|
101727
|
-
|
|
101728
|
-
|
|
101729
|
-
|
|
101730
|
-
|
|
101731
|
-
|
|
101732
|
-
|
|
101733
|
-
|
|
101734
|
-
|
|
101735
|
-
|
|
101736
|
-
|
|
101737
|
-
|
|
101738
|
-
|
|
101739
|
-
|
|
101740
|
-
|
|
101741
|
-
|
|
101742
|
-
|
|
101743
|
-
|
|
101817
|
+
join62("extensions", "omo.js"),
|
|
101818
|
+
join62("extensions", "omo-task.js"),
|
|
101819
|
+
join62("extensions", "omo-member.js"),
|
|
101820
|
+
join62("extensions", "memory-run-supervisor.mjs"),
|
|
101821
|
+
join62("extensions", "reflection-persona.md"),
|
|
101822
|
+
join62("extensions", "dream-persona.md"),
|
|
101823
|
+
join62("extensions", "facts-persona.md"),
|
|
101824
|
+
join62("skills", "ast-grep", "SKILL.md"),
|
|
101825
|
+
join62("skills", "coding-agent-sessions", "SKILL.md"),
|
|
101826
|
+
join62("skills", "debugging", "SKILL.md"),
|
|
101827
|
+
join62("skills", "frontend", "SKILL.md"),
|
|
101828
|
+
join62("skills", "git-master", "SKILL.md"),
|
|
101829
|
+
join62("skills", "init-deep", "SKILL.md"),
|
|
101830
|
+
join62("skills", "lsp-setup", "SKILL.md"),
|
|
101831
|
+
join62("skills", "programming", "SKILL.md"),
|
|
101832
|
+
join62("skills", "refactor", "SKILL.md"),
|
|
101833
|
+
join62("skills", "remove-ai-slops", "SKILL.md"),
|
|
101834
|
+
join62("skills", "review-work", "SKILL.md"),
|
|
101835
|
+
join62("skills", "start-work", "SKILL.md"),
|
|
101836
|
+
join62("skills", "ultimate-browsing", "SKILL.md"),
|
|
101837
|
+
join62("skills", "ultrawork", "SKILL.md"),
|
|
101838
|
+
join62("skills", "ulw-loop", "SKILL.md"),
|
|
101839
|
+
join62("skills", "ulw-plan", "SKILL.md"),
|
|
101840
|
+
join62("skills", "ulw-research", "SKILL.md"),
|
|
101841
|
+
join62("skills", "visual-qa", "SKILL.md"),
|
|
101842
|
+
join62("runtime", "ast-grep-mcp", "cli.js"),
|
|
101843
|
+
join62("runtime", "agent-toolkit", "cli.js"),
|
|
101844
|
+
join62("runtime", "agent-toolkit", "ulw-loop", "cli.js"),
|
|
101845
|
+
join62("runtime", "agent-toolkit", "omo-agent-toolkit"),
|
|
101846
|
+
join62("runtime", "agent-toolkit", "omo-agent-toolkit.cmd"),
|
|
101847
|
+
join62("runtime", "lsp-daemon", "dist", "cli.js"),
|
|
101848
|
+
join62("runtime", "lsp-daemon", "dist", "index.js"),
|
|
101849
|
+
join62("runtime", "lsp-daemon", "dist", "index.d.ts"),
|
|
101850
|
+
join62("runtime", "lsp-daemon", "dist", "daemon-client.js"),
|
|
101851
|
+
join62("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
|
|
101852
|
+
join62("runtime", "lsp-daemon", "dist", "package.json"),
|
|
101853
|
+
join62("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
101854
|
+
join62("scripts", "install.mjs")
|
|
101744
101855
|
];
|
|
101745
101856
|
async function ensurePluginArtifacts(context) {
|
|
101746
101857
|
if (context.allowBuild) {
|
|
101747
|
-
await context.runCommand("node", [
|
|
101748
|
-
await context.runCommand("node", [
|
|
101749
|
-
await context.runCommand("node", [
|
|
101750
|
-
await context.runCommand("node", [
|
|
101751
|
-
await context.runCommand("node", [
|
|
101752
|
-
await context.runCommand("node", [
|
|
101753
|
-
await context.runCommand("node", [
|
|
101858
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
101859
|
+
await context.runCommand("node", [join62("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
|
|
101860
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
101861
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
|
|
101862
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
|
|
101863
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
|
|
101864
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-agent-toolkit.mjs")], { cwd: context.repoRoot });
|
|
101754
101865
|
}
|
|
101755
101866
|
if (await hasMissingPluginArtifact(context.pluginPath)) {
|
|
101756
101867
|
throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
|
|
@@ -101759,14 +101870,14 @@ async function ensurePluginArtifacts(context) {
|
|
|
101759
101870
|
}
|
|
101760
101871
|
async function hasMissingPluginArtifact(pluginPath) {
|
|
101761
101872
|
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
101762
|
-
if (!await fileExists2(
|
|
101873
|
+
if (!await fileExists2(join62(pluginPath, artifact)))
|
|
101763
101874
|
return true;
|
|
101764
101875
|
}
|
|
101765
101876
|
return false;
|
|
101766
101877
|
}
|
|
101767
101878
|
async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
|
|
101768
|
-
const runtimeEntry =
|
|
101769
|
-
const manifestPath =
|
|
101879
|
+
const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
|
|
101880
|
+
const manifestPath = join62(dirname23(runtimeEntry), "manifest.json");
|
|
101770
101881
|
let runtimeStat;
|
|
101771
101882
|
try {
|
|
101772
101883
|
runtimeStat = await stat6(runtimeEntry);
|
|
@@ -101841,7 +101952,7 @@ async function runSenpiInstaller(options = {}) {
|
|
|
101841
101952
|
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101842
101953
|
installLocalLauncher({
|
|
101843
101954
|
pluginPath: context.pluginPath,
|
|
101844
|
-
senpiCliPath:
|
|
101955
|
+
senpiCliPath: join63(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
|
|
101845
101956
|
});
|
|
101846
101957
|
return {
|
|
101847
101958
|
ok: true,
|
|
@@ -101856,14 +101967,14 @@ async function runSenpiInstaller(options = {}) {
|
|
|
101856
101967
|
function resolveInstallContext(options) {
|
|
101857
101968
|
const env3 = options.env ?? process.env;
|
|
101858
101969
|
const allowBuild = options.pluginPath === undefined;
|
|
101859
|
-
const repoRoot =
|
|
101860
|
-
const agentDir =
|
|
101861
|
-
const pluginPath =
|
|
101970
|
+
const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve20(options.pluginPath))));
|
|
101971
|
+
const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env: env3, homeDir: env3.HOME ?? homedir11() }));
|
|
101972
|
+
const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101862
101973
|
return {
|
|
101863
101974
|
env: env3,
|
|
101864
101975
|
repoRoot,
|
|
101865
101976
|
agentDir,
|
|
101866
|
-
settingsPath:
|
|
101977
|
+
settingsPath: join63(agentDir, "settings.json"),
|
|
101867
101978
|
pluginPath,
|
|
101868
101979
|
platform: options.platform ?? process.platform,
|
|
101869
101980
|
allowBuild,
|
|
@@ -101880,14 +101991,14 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
101880
101991
|
function findRepoRoot2(importerDir) {
|
|
101881
101992
|
let current = importerDir;
|
|
101882
101993
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
101883
|
-
if (fileExistsSync(
|
|
101994
|
+
if (fileExistsSync(join63(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
101884
101995
|
return current;
|
|
101885
|
-
current =
|
|
101996
|
+
current = resolve20(current, "..");
|
|
101886
101997
|
}
|
|
101887
101998
|
throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
|
|
101888
101999
|
}
|
|
101889
102000
|
function fileExistsSync(path6) {
|
|
101890
|
-
return
|
|
102001
|
+
return existsSync32(path6);
|
|
101891
102002
|
}
|
|
101892
102003
|
// packages/omo-opencode/src/cli/star-request.ts
|
|
101893
102004
|
import { execFile as execFile5 } from "node:child_process";
|
|
@@ -101923,23 +102034,23 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
|
|
|
101923
102034
|
init_provider_availability();
|
|
101924
102035
|
|
|
101925
102036
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
101926
|
-
import { existsSync as
|
|
101927
|
-
import { join as
|
|
102037
|
+
import { existsSync as existsSync34, mkdirSync as mkdirSync11, readFileSync as readFileSync16 } from "node:fs";
|
|
102038
|
+
import { join as join65 } from "node:path";
|
|
101928
102039
|
|
|
101929
102040
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
101930
102041
|
init_shared();
|
|
101931
|
-
import { existsSync as
|
|
101932
|
-
import { join as
|
|
102042
|
+
import { existsSync as existsSync33, readFileSync as readFileSync15 } from "node:fs";
|
|
102043
|
+
import { join as join64 } from "node:path";
|
|
101933
102044
|
var TUI_SUBPATH = "tui";
|
|
101934
102045
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
101935
102046
|
function fileEntryPackageJsonPath(entry) {
|
|
101936
102047
|
let path6 = entry.slice("file:".length);
|
|
101937
102048
|
if (path6.startsWith("//"))
|
|
101938
102049
|
path6 = path6.slice(2);
|
|
101939
|
-
return
|
|
102050
|
+
return join64(path6, "package.json");
|
|
101940
102051
|
}
|
|
101941
102052
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
101942
|
-
if (!
|
|
102053
|
+
if (!existsSync33(pkgJsonPath))
|
|
101943
102054
|
return null;
|
|
101944
102055
|
try {
|
|
101945
102056
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
@@ -101974,14 +102085,14 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
101974
102085
|
const packageName = packageNameFromServerEntry(entry);
|
|
101975
102086
|
if (packageName === null)
|
|
101976
102087
|
return null;
|
|
101977
|
-
return packageJsonExportsTui(
|
|
102088
|
+
return packageJsonExportsTui(join64(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
101978
102089
|
}
|
|
101979
102090
|
function isOurFilePluginEntry(entry) {
|
|
101980
102091
|
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
101981
102092
|
return false;
|
|
101982
102093
|
try {
|
|
101983
102094
|
const pkgJsonPath = fileEntryPackageJsonPath(entry);
|
|
101984
|
-
if (!
|
|
102095
|
+
if (!existsSync33(pkgJsonPath))
|
|
101985
102096
|
return false;
|
|
101986
102097
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
101987
102098
|
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
|
|
@@ -102016,7 +102127,7 @@ function isCanonicalNamedTuiPluginEntry(entry) {
|
|
|
102016
102127
|
}
|
|
102017
102128
|
function detectServerPluginRegistration() {
|
|
102018
102129
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
102019
|
-
const configPath =
|
|
102130
|
+
const configPath = existsSync33(paths2.configJsonc) ? paths2.configJsonc : existsSync33(paths2.configJson) ? paths2.configJson : null;
|
|
102020
102131
|
if (!configPath) {
|
|
102021
102132
|
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
|
|
102022
102133
|
}
|
|
@@ -102039,8 +102150,8 @@ function detectServerPluginRegistration() {
|
|
|
102039
102150
|
}
|
|
102040
102151
|
}
|
|
102041
102152
|
function detectTuiPluginRegistration() {
|
|
102042
|
-
const tuiJsonPath =
|
|
102043
|
-
if (!
|
|
102153
|
+
const tuiJsonPath = join64(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
102154
|
+
if (!existsSync33(tuiJsonPath)) {
|
|
102044
102155
|
return {
|
|
102045
102156
|
registered: false,
|
|
102046
102157
|
configPath: tuiJsonPath,
|
|
@@ -102195,11 +102306,11 @@ function readConfig(path6) {
|
|
|
102195
102306
|
return null;
|
|
102196
102307
|
}
|
|
102197
102308
|
function readServerConfig(configDir) {
|
|
102198
|
-
const jsoncPath =
|
|
102199
|
-
if (
|
|
102309
|
+
const jsoncPath = join65(configDir, "opencode.jsonc");
|
|
102310
|
+
if (existsSync34(jsoncPath))
|
|
102200
102311
|
return readConfig(jsoncPath);
|
|
102201
|
-
const jsonPath =
|
|
102202
|
-
if (
|
|
102312
|
+
const jsonPath = join65(configDir, "opencode.json");
|
|
102313
|
+
if (existsSync34(jsonPath))
|
|
102203
102314
|
return readConfig(jsonPath);
|
|
102204
102315
|
return null;
|
|
102205
102316
|
}
|
|
@@ -102219,7 +102330,7 @@ function desiredTuiEntry(serverEntry) {
|
|
|
102219
102330
|
return null;
|
|
102220
102331
|
}
|
|
102221
102332
|
function readTuiConfig(tuiJsonPath) {
|
|
102222
|
-
if (!
|
|
102333
|
+
if (!existsSync34(tuiJsonPath)) {
|
|
102223
102334
|
return { config: {}, malformed: false };
|
|
102224
102335
|
}
|
|
102225
102336
|
const config3 = readConfig(tuiJsonPath);
|
|
@@ -102240,7 +102351,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102240
102351
|
if (!desiredEntry) {
|
|
102241
102352
|
return { changed: false, reason: "no-server-entry" };
|
|
102242
102353
|
}
|
|
102243
|
-
const tuiJsonPath =
|
|
102354
|
+
const tuiJsonPath = join65(configDir, "tui.json");
|
|
102244
102355
|
const { config: config3, malformed } = readTuiConfig(tuiJsonPath);
|
|
102245
102356
|
if (malformed) {
|
|
102246
102357
|
return { changed: false, reason: "malformed" };
|
|
@@ -102255,16 +102366,16 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102255
102366
|
}
|
|
102256
102367
|
|
|
102257
102368
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
102258
|
-
import { homedir as
|
|
102259
|
-
import { join as
|
|
102369
|
+
import { homedir as homedir12 } from "node:os";
|
|
102370
|
+
import { join as join66 } from "node:path";
|
|
102260
102371
|
|
|
102261
102372
|
// packages/shared-skills/index.mjs
|
|
102262
|
-
import { existsSync as
|
|
102373
|
+
import { existsSync as existsSync35 } from "node:fs";
|
|
102263
102374
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
102264
102375
|
var SKILLS_PROBE_SPECIFIERS = ["./skills/", "../skills/", "../../skills/"];
|
|
102265
102376
|
function sharedSkillsRootPath() {
|
|
102266
102377
|
const candidates = SKILLS_PROBE_SPECIFIERS.map((specifier) => fileURLToPath2(new URL(specifier, import.meta.url)));
|
|
102267
|
-
return candidates.find((candidate2) =>
|
|
102378
|
+
return candidates.find((candidate2) => existsSync35(candidate2)) ?? candidates[0];
|
|
102268
102379
|
}
|
|
102269
102380
|
|
|
102270
102381
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
@@ -102278,9 +102389,9 @@ function describeResult2(result) {
|
|
|
102278
102389
|
}
|
|
102279
102390
|
async function installAstGrepForOpenCode(options = {}) {
|
|
102280
102391
|
const platform = options.platform ?? process.platform;
|
|
102281
|
-
const baseDir =
|
|
102392
|
+
const baseDir = join66(options.homeDir ?? homedir12(), ".omo");
|
|
102282
102393
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
102283
|
-
const skillDir =
|
|
102394
|
+
const skillDir = join66(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
102284
102395
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
102285
102396
|
try {
|
|
102286
102397
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -106310,7 +106421,7 @@ async function resolveSession(options) {
|
|
|
106310
106421
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
106311
106422
|
const delay2 = retryDelayMs * attempt;
|
|
106312
106423
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
106313
|
-
await new Promise((
|
|
106424
|
+
await new Promise((resolve21) => setTimeout(resolve21, delay2));
|
|
106314
106425
|
}
|
|
106315
106426
|
continue;
|
|
106316
106427
|
}
|
|
@@ -106321,7 +106432,7 @@ async function resolveSession(options) {
|
|
|
106321
106432
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
106322
106433
|
const delay2 = retryDelayMs * attempt;
|
|
106323
106434
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
106324
|
-
await new Promise((
|
|
106435
|
+
await new Promise((resolve21) => setTimeout(resolve21, delay2));
|
|
106325
106436
|
}
|
|
106326
106437
|
}
|
|
106327
106438
|
throw new Error("Failed to create session after all retries");
|
|
@@ -106360,7 +106471,7 @@ function createJsonOutputManager(options = {}) {
|
|
|
106360
106471
|
|
|
106361
106472
|
// packages/omo-opencode/src/cli/run/on-complete-hook.ts
|
|
106362
106473
|
init_spawn_with_windows_hide();
|
|
106363
|
-
|
|
106474
|
+
init_shell_env();
|
|
106364
106475
|
init_logger2();
|
|
106365
106476
|
var defaultDeps3 = {
|
|
106366
106477
|
spawnWithWindowsHide,
|
|
@@ -106380,15 +106491,15 @@ async function readOutput(stream, streamName, deps = defaultDeps3) {
|
|
|
106380
106491
|
return "";
|
|
106381
106492
|
}
|
|
106382
106493
|
}
|
|
106383
|
-
function resolveHookShellCommand(command) {
|
|
106384
|
-
const shellType = detectShellType();
|
|
106494
|
+
function resolveHookShellCommand(command, platform, env3) {
|
|
106495
|
+
const shellType = detectShellType(platform, env3);
|
|
106385
106496
|
switch (shellType) {
|
|
106386
106497
|
case "powershell": {
|
|
106387
|
-
const powershellExecutable =
|
|
106498
|
+
const powershellExecutable = platform === "win32" ? "powershell.exe" : "pwsh";
|
|
106388
106499
|
return [powershellExecutable, "-NoProfile", "-Command", command];
|
|
106389
106500
|
}
|
|
106390
106501
|
case "cmd":
|
|
106391
|
-
return [
|
|
106502
|
+
return [env3.ComSpec || "cmd.exe", "/d", "/s", "/c", command];
|
|
106392
106503
|
case "csh":
|
|
106393
106504
|
return ["csh", "-c", command];
|
|
106394
106505
|
case "unix":
|
|
@@ -106404,10 +106515,12 @@ async function executeOnCompleteHook(options, deps = defaultDeps3) {
|
|
|
106404
106515
|
}
|
|
106405
106516
|
deps.log("Running on-complete hook", { command: trimmedCommand });
|
|
106406
106517
|
try {
|
|
106407
|
-
const
|
|
106518
|
+
const platform = deps.platform ?? process.platform;
|
|
106519
|
+
const env3 = deps.env ?? process.env;
|
|
106520
|
+
const shellCommand = resolveHookShellCommand(trimmedCommand, platform, env3);
|
|
106408
106521
|
const proc = deps.spawnWithWindowsHide(shellCommand, {
|
|
106409
106522
|
env: {
|
|
106410
|
-
...
|
|
106523
|
+
...env3,
|
|
106411
106524
|
SESSION_ID: sessionId,
|
|
106412
106525
|
EXIT_CODE: String(exitCode),
|
|
106413
106526
|
DURATION_MS: String(durationMs),
|
|
@@ -106719,9 +106832,9 @@ function isClosingFence(line, fence) {
|
|
|
106719
106832
|
return run?.charAt(0) === fence.marker && run.length >= fence.length;
|
|
106720
106833
|
}
|
|
106721
106834
|
// packages/boulder-state/src/top-level-task.ts
|
|
106722
|
-
import { existsSync as
|
|
106835
|
+
import { existsSync as existsSync36, readFileSync as readFileSync17 } from "node:fs";
|
|
106723
106836
|
function readCurrentTopLevelTask(planPath) {
|
|
106724
|
-
if (!
|
|
106837
|
+
if (!existsSync36(planPath)) {
|
|
106725
106838
|
return null;
|
|
106726
106839
|
}
|
|
106727
106840
|
try {
|
|
@@ -106732,13 +106845,13 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
106732
106845
|
}
|
|
106733
106846
|
}
|
|
106734
106847
|
// packages/boulder-state/src/storage/path.ts
|
|
106735
|
-
import { existsSync as
|
|
106736
|
-
import { isAbsolute as isAbsolute11, join as
|
|
106848
|
+
import { existsSync as existsSync37 } from "node:fs";
|
|
106849
|
+
import { isAbsolute as isAbsolute11, join as join67, relative as relative8, resolve as resolve21 } from "node:path";
|
|
106737
106850
|
function getBoulderFilePath(directory) {
|
|
106738
|
-
return
|
|
106851
|
+
return join67(directory, BOULDER_DIR, BOULDER_FILE);
|
|
106739
106852
|
}
|
|
106740
106853
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
106741
|
-
return isAbsolute11(trackedPath) ?
|
|
106854
|
+
return isAbsolute11(trackedPath) ? resolve21(trackedPath) : resolve21(baseDirectory, trackedPath);
|
|
106742
106855
|
}
|
|
106743
106856
|
function resolveBoulderPlanPath(directory, state) {
|
|
106744
106857
|
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
|
|
@@ -106746,22 +106859,22 @@ function resolveBoulderPlanPath(directory, state) {
|
|
|
106746
106859
|
if (!worktreePath) {
|
|
106747
106860
|
return absolutePlanPath;
|
|
106748
106861
|
}
|
|
106749
|
-
const absoluteDirectory =
|
|
106862
|
+
const absoluteDirectory = resolve21(directory);
|
|
106750
106863
|
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
|
|
106751
106864
|
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
|
|
106752
106865
|
return absolutePlanPath;
|
|
106753
106866
|
}
|
|
106754
106867
|
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
|
|
106755
|
-
const worktreePlanPath =
|
|
106756
|
-
return
|
|
106868
|
+
const worktreePlanPath = resolve21(absoluteWorktreePath, relativePlanPath);
|
|
106869
|
+
return existsSync37(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
|
|
106757
106870
|
}
|
|
106758
106871
|
function resolveBoulderPlanPathForWork(directory, work) {
|
|
106759
106872
|
return resolveBoulderPlanPath(directory, work);
|
|
106760
106873
|
}
|
|
106761
106874
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
106762
|
-
import { existsSync as
|
|
106875
|
+
import { existsSync as existsSync38, readFileSync as readFileSync18, readdirSync as readdirSync7, statSync as statSync4 } from "node:fs";
|
|
106763
106876
|
function getPlanProgress(planPath) {
|
|
106764
|
-
if (!
|
|
106877
|
+
if (!existsSync38(planPath)) {
|
|
106765
106878
|
return { total: 0, completed: 0, isComplete: false };
|
|
106766
106879
|
}
|
|
106767
106880
|
try {
|
|
@@ -106844,10 +106957,10 @@ function selectMirrorWork(state) {
|
|
|
106844
106957
|
return sorted[0] ?? null;
|
|
106845
106958
|
}
|
|
106846
106959
|
// packages/boulder-state/src/storage/read-state.ts
|
|
106847
|
-
import { existsSync as
|
|
106960
|
+
import { existsSync as existsSync39, readFileSync as readFileSync19 } from "node:fs";
|
|
106848
106961
|
function readBoulderState(directory) {
|
|
106849
106962
|
const filePath = getBoulderFilePath(directory);
|
|
106850
|
-
if (!
|
|
106963
|
+
if (!existsSync39(filePath)) {
|
|
106851
106964
|
return null;
|
|
106852
106965
|
}
|
|
106853
106966
|
try {
|
|
@@ -106917,14 +107030,14 @@ init_state();
|
|
|
106917
107030
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
106918
107031
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
106919
107032
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
106920
|
-
import { existsSync as
|
|
106921
|
-
import { join as
|
|
107033
|
+
import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "node:fs";
|
|
107034
|
+
import { join as join68 } from "node:path";
|
|
106922
107035
|
function getMarkerPath(directory, sessionID) {
|
|
106923
|
-
return
|
|
107036
|
+
return join68(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
106924
107037
|
}
|
|
106925
107038
|
function readContinuationMarker(directory, sessionID) {
|
|
106926
107039
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
106927
|
-
if (!
|
|
107040
|
+
if (!existsSync40(markerPath))
|
|
106928
107041
|
return null;
|
|
106929
107042
|
try {
|
|
106930
107043
|
const raw = readFileSync20(markerPath, "utf-8");
|
|
@@ -106993,7 +107106,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
106993
107106
|
init_shared();
|
|
106994
107107
|
init_compaction_marker();
|
|
106995
107108
|
import { readFileSync as readFileSync21, readdirSync as readdirSync8 } from "node:fs";
|
|
106996
|
-
import { join as
|
|
107109
|
+
import { join as join69 } from "node:path";
|
|
106997
107110
|
var defaultSessionLastAgentDeps = {
|
|
106998
107111
|
getMessageDir,
|
|
106999
107112
|
isSqliteBackend,
|
|
@@ -107053,7 +107166,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
107053
107166
|
try {
|
|
107054
107167
|
const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
107055
107168
|
try {
|
|
107056
|
-
const content = readFileSync21(
|
|
107169
|
+
const content = readFileSync21(join69(messageDir, fileName), "utf-8");
|
|
107057
107170
|
const parsed = JSON.parse(content);
|
|
107058
107171
|
return {
|
|
107059
107172
|
fileName,
|
|
@@ -107096,8 +107209,8 @@ init_agent_display_names();
|
|
|
107096
107209
|
|
|
107097
107210
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
107098
107211
|
init_frontmatter2();
|
|
107099
|
-
import { existsSync as
|
|
107100
|
-
import { dirname as dirname26, join as
|
|
107212
|
+
import { existsSync as existsSync41, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "node:fs";
|
|
107213
|
+
import { dirname as dirname26, join as join70 } from "node:path";
|
|
107101
107214
|
|
|
107102
107215
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
107103
107216
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -107106,11 +107219,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
107106
107219
|
|
|
107107
107220
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
107108
107221
|
function getStateFilePath(directory, customPath) {
|
|
107109
|
-
return customPath ?
|
|
107222
|
+
return customPath ? join70(directory, customPath) : join70(directory, DEFAULT_STATE_FILE);
|
|
107110
107223
|
}
|
|
107111
107224
|
function readState(directory, customPath) {
|
|
107112
107225
|
const filePath = getStateFilePath(directory, customPath);
|
|
107113
|
-
if (!
|
|
107226
|
+
if (!existsSync41(filePath)) {
|
|
107114
107227
|
return null;
|
|
107115
107228
|
}
|
|
107116
107229
|
try {
|
|
@@ -107340,7 +107453,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
|
|
|
107340
107453
|
const secondaryMeaningfulWorkTimeoutMs = options.secondaryMeaningfulWorkTimeoutMs ?? DEFAULT_SECONDARY_MEANINGFUL_WORK_TIMEOUT_MS;
|
|
107341
107454
|
const requireMeaningfulWork = options.requireMeaningfulWork ?? false;
|
|
107342
107455
|
const now = options.now ?? Date.now;
|
|
107343
|
-
const sleep = options.sleep ?? ((ms) => new Promise((
|
|
107456
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve22) => setTimeout(resolve22, ms)));
|
|
107344
107457
|
let consecutiveCompleteChecks = 0;
|
|
107345
107458
|
let errorCycleCount = 0;
|
|
107346
107459
|
let firstWorkTimestamp = null;
|
|
@@ -107505,7 +107618,7 @@ function createAbortError() {
|
|
|
107505
107618
|
return error51;
|
|
107506
107619
|
}
|
|
107507
107620
|
function sleep(delayMs) {
|
|
107508
|
-
return new Promise((
|
|
107621
|
+
return new Promise((resolve22) => setTimeout(resolve22, delayMs));
|
|
107509
107622
|
}
|
|
107510
107623
|
function hasPromptStartEvidence(eventState) {
|
|
107511
107624
|
return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
|
|
@@ -107880,7 +107993,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
|
|
|
107880
107993
|
async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
|
|
107881
107994
|
const completed = await Promise.race([
|
|
107882
107995
|
eventProcessor.then(() => true),
|
|
107883
|
-
new Promise((
|
|
107996
|
+
new Promise((resolve22) => setTimeout(() => resolve22(false), timeoutMs))
|
|
107884
107997
|
]);
|
|
107885
107998
|
}
|
|
107886
107999
|
async function run(options) {
|
|
@@ -108206,14 +108319,14 @@ async function getLocalVersion(options = {}) {
|
|
|
108206
108319
|
}
|
|
108207
108320
|
}
|
|
108208
108321
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
108209
|
-
import { existsSync as
|
|
108322
|
+
import { existsSync as existsSync52, readFileSync as readFileSync32 } from "node:fs";
|
|
108210
108323
|
|
|
108211
108324
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
108212
108325
|
init_extract_semver();
|
|
108213
108326
|
init_bun_which_shim();
|
|
108214
|
-
import { existsSync as
|
|
108215
|
-
import { homedir as
|
|
108216
|
-
import { join as
|
|
108327
|
+
import { existsSync as existsSync49, accessSync as accessSync4, constants as constants11 } from "node:fs";
|
|
108328
|
+
import { homedir as homedir15 } from "node:os";
|
|
108329
|
+
import { join as join77 } from "node:path";
|
|
108217
108330
|
|
|
108218
108331
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
108219
108332
|
init_spawn_with_windows_hide();
|
|
@@ -108252,8 +108365,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
108252
108365
|
const stdoutPromise = readSpawnStream(proc.stdout);
|
|
108253
108366
|
const stderrPromise = readSpawnStream(proc.stderr);
|
|
108254
108367
|
let timer;
|
|
108255
|
-
const timeoutPromise = new Promise((
|
|
108256
|
-
timer = setTimeout(() =>
|
|
108368
|
+
const timeoutPromise = new Promise((resolve22) => {
|
|
108369
|
+
timer = setTimeout(() => resolve22("timeout"), timeoutMs);
|
|
108257
108370
|
});
|
|
108258
108371
|
const processPromise = (async () => {
|
|
108259
108372
|
await proc.exited;
|
|
@@ -108300,22 +108413,22 @@ function isExecutable2(path12) {
|
|
|
108300
108413
|
}
|
|
108301
108414
|
}
|
|
108302
108415
|
function getDesktopAppPaths(platform) {
|
|
108303
|
-
const home =
|
|
108416
|
+
const home = homedir15();
|
|
108304
108417
|
switch (platform) {
|
|
108305
108418
|
case "darwin":
|
|
108306
108419
|
return [
|
|
108307
108420
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
108308
|
-
|
|
108421
|
+
join77(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
108309
108422
|
];
|
|
108310
108423
|
case "win32": {
|
|
108311
108424
|
const programFiles = process.env.ProgramFiles;
|
|
108312
108425
|
const localAppData = process.env.LOCALAPPDATA;
|
|
108313
108426
|
const paths2 = [];
|
|
108314
108427
|
if (programFiles) {
|
|
108315
|
-
paths2.push(
|
|
108428
|
+
paths2.push(join77(programFiles, "OpenCode", "OpenCode.exe"));
|
|
108316
108429
|
}
|
|
108317
108430
|
if (localAppData) {
|
|
108318
|
-
paths2.push(
|
|
108431
|
+
paths2.push(join77(localAppData, "OpenCode", "OpenCode.exe"));
|
|
108319
108432
|
}
|
|
108320
108433
|
return paths2;
|
|
108321
108434
|
}
|
|
@@ -108323,8 +108436,8 @@ function getDesktopAppPaths(platform) {
|
|
|
108323
108436
|
return [
|
|
108324
108437
|
"/usr/bin/opencode",
|
|
108325
108438
|
"/usr/lib/opencode/opencode",
|
|
108326
|
-
|
|
108327
|
-
|
|
108439
|
+
join77(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
108440
|
+
join77(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
108328
108441
|
];
|
|
108329
108442
|
default:
|
|
108330
108443
|
return [];
|
|
@@ -108336,7 +108449,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
108336
108449
|
}
|
|
108337
108450
|
return [binaryPath, "--version"];
|
|
108338
108451
|
}
|
|
108339
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
108452
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync49) {
|
|
108340
108453
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
108341
108454
|
if (checkExists(desktopPath)) {
|
|
108342
108455
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -108344,7 +108457,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
108344
108457
|
}
|
|
108345
108458
|
return null;
|
|
108346
108459
|
}
|
|
108347
|
-
async function findOpenCodeBinary(platform = process.platform, checkExists =
|
|
108460
|
+
async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync49) {
|
|
108348
108461
|
for (const binary of OPENCODE_BINARIES2) {
|
|
108349
108462
|
const path12 = bunWhich(binary);
|
|
108350
108463
|
if (path12 && checkExists(path12)) {
|
|
@@ -108356,7 +108469,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
108356
108469
|
const candidates = getCommandCandidates2(platform);
|
|
108357
108470
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
108358
108471
|
for (const command of candidates) {
|
|
108359
|
-
const fullPath =
|
|
108472
|
+
const fullPath = join77(entry, command);
|
|
108360
108473
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
108361
108474
|
return { binary: command, path: fullPath };
|
|
108362
108475
|
}
|
|
@@ -108402,12 +108515,12 @@ function compareVersions3(current, minimum) {
|
|
|
108402
108515
|
|
|
108403
108516
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
108404
108517
|
init_shared();
|
|
108405
|
-
import { existsSync as
|
|
108518
|
+
import { existsSync as existsSync50, readFileSync as readFileSync30 } from "node:fs";
|
|
108406
108519
|
function detectConfigPath() {
|
|
108407
108520
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
108408
|
-
if (
|
|
108521
|
+
if (existsSync50(paths2.configJsonc))
|
|
108409
108522
|
return paths2.configJsonc;
|
|
108410
|
-
if (
|
|
108523
|
+
if (existsSync50(paths2.configJson))
|
|
108411
108524
|
return paths2.configJson;
|
|
108412
108525
|
return null;
|
|
108413
108526
|
}
|
|
@@ -108495,36 +108608,36 @@ init_file_utils2();
|
|
|
108495
108608
|
init_checker();
|
|
108496
108609
|
init_auto_update_checker();
|
|
108497
108610
|
init_package_json_locator();
|
|
108498
|
-
import { existsSync as
|
|
108611
|
+
import { existsSync as existsSync51, readFileSync as readFileSync31, readdirSync as readdirSync10 } from "node:fs";
|
|
108499
108612
|
import { createRequire as createRequire3 } from "node:module";
|
|
108500
|
-
import { homedir as
|
|
108501
|
-
import { join as
|
|
108613
|
+
import { homedir as homedir16 } from "node:os";
|
|
108614
|
+
import { join as join78 } from "node:path";
|
|
108502
108615
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
108503
108616
|
init_shared();
|
|
108504
108617
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
108505
108618
|
if (platform === "darwin")
|
|
108506
|
-
return
|
|
108619
|
+
return join78(homedir16(), "Library", "Caches");
|
|
108507
108620
|
if (platform === "win32")
|
|
108508
|
-
return process.env.LOCALAPPDATA ??
|
|
108509
|
-
return
|
|
108621
|
+
return process.env.LOCALAPPDATA ?? join78(homedir16(), "AppData", "Local");
|
|
108622
|
+
return join78(homedir16(), ".cache");
|
|
108510
108623
|
}
|
|
108511
108624
|
function resolveOpenCodeCacheDir() {
|
|
108512
108625
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
108513
108626
|
if (xdgCacheHome)
|
|
108514
|
-
return
|
|
108627
|
+
return join78(xdgCacheHome, "opencode");
|
|
108515
108628
|
const fromShared = getOpenCodeCacheDir();
|
|
108516
|
-
const platformDefault =
|
|
108517
|
-
if (
|
|
108629
|
+
const platformDefault = join78(getPlatformDefaultCacheDir(), "opencode");
|
|
108630
|
+
if (existsSync51(fromShared) || !existsSync51(platformDefault))
|
|
108518
108631
|
return fromShared;
|
|
108519
108632
|
return platformDefault;
|
|
108520
108633
|
}
|
|
108521
108634
|
function resolveExistingDir(dirPath) {
|
|
108522
|
-
if (!
|
|
108635
|
+
if (!existsSync51(dirPath))
|
|
108523
108636
|
return dirPath;
|
|
108524
108637
|
return resolveSymlink(dirPath);
|
|
108525
108638
|
}
|
|
108526
108639
|
function readPackageJson(filePath) {
|
|
108527
|
-
if (!
|
|
108640
|
+
if (!existsSync51(filePath))
|
|
108528
108641
|
return null;
|
|
108529
108642
|
try {
|
|
108530
108643
|
const content = readFileSync31(filePath, "utf-8");
|
|
@@ -108545,26 +108658,26 @@ function normalizeVersion(value) {
|
|
|
108545
108658
|
function createPackageCandidates(rootDir) {
|
|
108546
108659
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
108547
108660
|
packageName,
|
|
108548
|
-
installedPackagePath:
|
|
108661
|
+
installedPackagePath: join78(rootDir, "node_modules", packageName, "package.json")
|
|
108549
108662
|
}));
|
|
108550
108663
|
}
|
|
108551
108664
|
function createTaggedInstallCandidates(rootDir) {
|
|
108552
|
-
const packagesDir =
|
|
108553
|
-
if (!
|
|
108665
|
+
const packagesDir = join78(rootDir, "packages");
|
|
108666
|
+
if (!existsSync51(packagesDir))
|
|
108554
108667
|
return [];
|
|
108555
108668
|
const candidates = [];
|
|
108556
108669
|
for (const entryName of readdirSync10(packagesDir).sort()) {
|
|
108557
108670
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
108558
108671
|
if (packageName === undefined)
|
|
108559
108672
|
continue;
|
|
108560
|
-
const installDir =
|
|
108673
|
+
const installDir = join78(packagesDir, entryName);
|
|
108561
108674
|
candidates.push({
|
|
108562
108675
|
cacheDir: installDir,
|
|
108563
|
-
cachePackagePath:
|
|
108676
|
+
cachePackagePath: join78(installDir, "package.json"),
|
|
108564
108677
|
packageCandidates: [
|
|
108565
108678
|
{
|
|
108566
108679
|
packageName,
|
|
108567
|
-
installedPackagePath:
|
|
108680
|
+
installedPackagePath: join78(installDir, "node_modules", packageName, "package.json")
|
|
108568
108681
|
}
|
|
108569
108682
|
]
|
|
108570
108683
|
});
|
|
@@ -108572,7 +108685,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
108572
108685
|
return candidates;
|
|
108573
108686
|
}
|
|
108574
108687
|
function selectInstalledPackage(candidate2) {
|
|
108575
|
-
return candidate2.packageCandidates.find((packageCandidate) =>
|
|
108688
|
+
return candidate2.packageCandidates.find((packageCandidate) => existsSync51(packageCandidate.installedPackagePath)) ?? candidate2.packageCandidates[0];
|
|
108576
108689
|
}
|
|
108577
108690
|
function getExpectedVersion(cachePackage, packageName) {
|
|
108578
108691
|
return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
|
|
@@ -108583,7 +108696,7 @@ function resolveInstalledPackageJsonPath() {
|
|
|
108583
108696
|
for (const packageName of ACCEPTED_PACKAGE_NAMES) {
|
|
108584
108697
|
try {
|
|
108585
108698
|
const packageJsonPath = require2.resolve(`${packageName}/package.json`);
|
|
108586
|
-
if (
|
|
108699
|
+
if (existsSync51(packageJsonPath)) {
|
|
108587
108700
|
return { packageName, packageJsonPath };
|
|
108588
108701
|
}
|
|
108589
108702
|
} catch {
|
|
@@ -108609,22 +108722,22 @@ function getLoadedPluginVersion() {
|
|
|
108609
108722
|
const candidates = [
|
|
108610
108723
|
{
|
|
108611
108724
|
cacheDir: configDir,
|
|
108612
|
-
cachePackagePath:
|
|
108725
|
+
cachePackagePath: join78(configDir, "package.json"),
|
|
108613
108726
|
packageCandidates: createPackageCandidates(configDir)
|
|
108614
108727
|
},
|
|
108615
108728
|
...createTaggedInstallCandidates(configDir),
|
|
108616
108729
|
{
|
|
108617
108730
|
cacheDir,
|
|
108618
|
-
cachePackagePath:
|
|
108731
|
+
cachePackagePath: join78(cacheDir, "package.json"),
|
|
108619
108732
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
108620
108733
|
},
|
|
108621
108734
|
...createTaggedInstallCandidates(cacheDir)
|
|
108622
108735
|
];
|
|
108623
|
-
const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) =>
|
|
108736
|
+
const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) => existsSync51(packageCandidate.installedPackagePath))) ?? candidates[0];
|
|
108624
108737
|
const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
|
|
108625
108738
|
const selectedPackage = selectInstalledPackage(selectedCandidate);
|
|
108626
108739
|
const candidateInstalledPath = selectedPackage.installedPackagePath;
|
|
108627
|
-
const candidateExists =
|
|
108740
|
+
const candidateExists = existsSync51(candidateInstalledPath);
|
|
108628
108741
|
const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
|
|
108629
108742
|
const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
|
|
108630
108743
|
const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
|
|
@@ -108660,7 +108773,7 @@ var defaultDeps6 = {
|
|
|
108660
108773
|
getLoadedPluginVersion,
|
|
108661
108774
|
getLatestPluginVersion,
|
|
108662
108775
|
getSuggestedInstallTag,
|
|
108663
|
-
configExists:
|
|
108776
|
+
configExists: existsSync52,
|
|
108664
108777
|
readConfigFile: (path12) => readFileSync32(path12, "utf-8"),
|
|
108665
108778
|
parseConfigContent: (content) => parseJsonc(content)
|
|
108666
108779
|
};
|
|
@@ -108806,23 +108919,23 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
108806
108919
|
|
|
108807
108920
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
108808
108921
|
init_shared();
|
|
108809
|
-
import { existsSync as
|
|
108810
|
-
import { homedir as
|
|
108811
|
-
import { join as
|
|
108922
|
+
import { existsSync as existsSync53, readFileSync as readFileSync33 } from "node:fs";
|
|
108923
|
+
import { homedir as homedir17 } from "node:os";
|
|
108924
|
+
import { join as join79 } from "node:path";
|
|
108812
108925
|
function getUserConfigDir2() {
|
|
108813
108926
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
108814
108927
|
if (xdgConfig)
|
|
108815
|
-
return
|
|
108816
|
-
return
|
|
108928
|
+
return join79(xdgConfig, "opencode");
|
|
108929
|
+
return join79(homedir17(), ".config", "opencode");
|
|
108817
108930
|
}
|
|
108818
108931
|
function loadCustomProviderNames() {
|
|
108819
108932
|
const configDir = getUserConfigDir2();
|
|
108820
108933
|
const candidatePaths = [
|
|
108821
|
-
|
|
108822
|
-
|
|
108934
|
+
join79(configDir, "opencode.json"),
|
|
108935
|
+
join79(configDir, "opencode.jsonc")
|
|
108823
108936
|
];
|
|
108824
108937
|
for (const configPath of candidatePaths) {
|
|
108825
|
-
if (!
|
|
108938
|
+
if (!existsSync53(configPath))
|
|
108826
108939
|
continue;
|
|
108827
108940
|
try {
|
|
108828
108941
|
const content = readFileSync33(configPath, "utf-8");
|
|
@@ -108840,9 +108953,9 @@ function loadCustomProviderNames() {
|
|
|
108840
108953
|
return [];
|
|
108841
108954
|
}
|
|
108842
108955
|
function loadAvailableModelsFromCache() {
|
|
108843
|
-
const cacheFile =
|
|
108956
|
+
const cacheFile = join79(getOpenCodeCacheDir(), "models.json");
|
|
108844
108957
|
const customProviders = loadCustomProviderNames();
|
|
108845
|
-
if (!
|
|
108958
|
+
if (!existsSync53(cacheFile)) {
|
|
108846
108959
|
if (customProviders.length > 0) {
|
|
108847
108960
|
return { providers: customProviders, modelCount: 0, cacheExists: true };
|
|
108848
108961
|
}
|
|
@@ -108902,7 +109015,7 @@ function loadOmoConfig2() {
|
|
|
108902
109015
|
|
|
108903
109016
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
108904
109017
|
init_shared();
|
|
108905
|
-
import { join as
|
|
109018
|
+
import { join as join80 } from "node:path";
|
|
108906
109019
|
|
|
108907
109020
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
108908
109021
|
function formatModelWithVariant(model, variant) {
|
|
@@ -108944,7 +109057,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
108944
109057
|
}
|
|
108945
109058
|
function buildModelResolutionDetails(options) {
|
|
108946
109059
|
const details = [];
|
|
108947
|
-
const cacheFile =
|
|
109060
|
+
const cacheFile = join80(getOpenCodeCacheDir(), "models.json");
|
|
108948
109061
|
details.push("═══ Available Models (from cache) ═══");
|
|
108949
109062
|
details.push("");
|
|
108950
109063
|
if (options.available.cacheExists) {
|
|
@@ -109253,8 +109366,8 @@ async function checkConfig() {
|
|
|
109253
109366
|
|
|
109254
109367
|
// packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
|
|
109255
109368
|
init_main();
|
|
109256
|
-
import { existsSync as
|
|
109257
|
-
import { join as
|
|
109369
|
+
import { existsSync as existsSync54, readFileSync as readFileSync34 } from "node:fs";
|
|
109370
|
+
import { join as join81 } from "node:path";
|
|
109258
109371
|
var CANONICAL_REPLACEMENT = new Map([
|
|
109259
109372
|
["variant", "reasoning"],
|
|
109260
109373
|
["reasoningEffort", "reasoning"],
|
|
@@ -109309,13 +109422,13 @@ function userConfigPaths() {
|
|
|
109309
109422
|
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
109310
109423
|
if (home === undefined || home.length === 0)
|
|
109311
109424
|
return [];
|
|
109312
|
-
return [
|
|
109425
|
+
return [join81(home, ".omo", "omo.jsonc"), join81(home, ".omo", "omo.json")];
|
|
109313
109426
|
}
|
|
109314
109427
|
async function checkDeprecatedReasoningKeys() {
|
|
109315
109428
|
const issues = [];
|
|
109316
109429
|
const scanned = [];
|
|
109317
109430
|
for (const configPath of userConfigPaths()) {
|
|
109318
|
-
if (!
|
|
109431
|
+
if (!existsSync54(configPath))
|
|
109319
109432
|
continue;
|
|
109320
109433
|
scanned.push(configPath);
|
|
109321
109434
|
const parsed = parse2(readFileSync34(configPath, "utf-8"));
|
|
@@ -109332,28 +109445,28 @@ async function checkDeprecatedReasoningKeys() {
|
|
|
109332
109445
|
|
|
109333
109446
|
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
109334
109447
|
init_src2();
|
|
109335
|
-
import { existsSync as
|
|
109448
|
+
import { existsSync as existsSync55 } from "node:fs";
|
|
109336
109449
|
import { createRequire as createRequire4 } from "node:module";
|
|
109337
|
-
import { homedir as
|
|
109338
|
-
import { dirname as dirname31, join as
|
|
109450
|
+
import { homedir as homedir19 } from "node:os";
|
|
109451
|
+
import { dirname as dirname31, join as join83 } from "node:path";
|
|
109339
109452
|
|
|
109340
109453
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
109341
|
-
import { join as
|
|
109342
|
-
import { homedir as
|
|
109454
|
+
import { join as join82 } from "path";
|
|
109455
|
+
import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
|
|
109343
109456
|
init_binary_downloader();
|
|
109344
109457
|
init_logger2();
|
|
109345
109458
|
init_plugin_identity();
|
|
109346
109459
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
109347
|
-
var DEBUG_FILE =
|
|
109460
|
+
var DEBUG_FILE = join82(tmpdir4(), "comment-checker-debug.log");
|
|
109348
109461
|
function getCacheDir2() {
|
|
109349
109462
|
if (process.platform === "win32") {
|
|
109350
109463
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
109351
|
-
const base2 = localAppData ||
|
|
109352
|
-
return
|
|
109464
|
+
const base2 = localAppData || join82(homedir18(), "AppData", "Local");
|
|
109465
|
+
return join82(base2, CACHE_DIR_NAME, "bin");
|
|
109353
109466
|
}
|
|
109354
109467
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
109355
|
-
const base = xdgCache ||
|
|
109356
|
-
return
|
|
109468
|
+
const base = xdgCache || join82(homedir18(), ".cache");
|
|
109469
|
+
return join82(base, CACHE_DIR_NAME, "bin");
|
|
109357
109470
|
}
|
|
109358
109471
|
function getBinaryName() {
|
|
109359
109472
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -109403,7 +109516,7 @@ async function getBinaryVersion(binary) {
|
|
|
109403
109516
|
}
|
|
109404
109517
|
}
|
|
109405
109518
|
async function checkAstGrepCli() {
|
|
109406
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
109519
|
+
const runtimeDir = astGrepRuntimeDir(join83(homedir19(), ".omo"));
|
|
109407
109520
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
109408
109521
|
if (sgPath === null) {
|
|
109409
109522
|
return {
|
|
@@ -109433,11 +109546,11 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
109433
109546
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
109434
109547
|
try {
|
|
109435
109548
|
const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
|
|
109436
|
-
const vendorPath =
|
|
109437
|
-
if (
|
|
109549
|
+
const vendorPath = join83(packageDir, "vendor", platformKey, binaryName);
|
|
109550
|
+
if (existsSync55(vendorPath))
|
|
109438
109551
|
return vendorPath;
|
|
109439
|
-
const binPath =
|
|
109440
|
-
if (
|
|
109552
|
+
const binPath = join83(packageDir, "bin", binaryName);
|
|
109553
|
+
if (existsSync55(binPath))
|
|
109441
109554
|
return binPath;
|
|
109442
109555
|
} catch (error51) {
|
|
109443
109556
|
if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
|
|
@@ -109583,8 +109696,8 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
109583
109696
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
109584
109697
|
init_zod();
|
|
109585
109698
|
init_opencode_config_dir();
|
|
109586
|
-
import { existsSync as
|
|
109587
|
-
import { delimiter as delimiter3, dirname as dirname32, resolve as
|
|
109699
|
+
import { existsSync as existsSync56, readFileSync as readFileSync35 } from "node:fs";
|
|
109700
|
+
import { delimiter as delimiter3, dirname as dirname32, resolve as resolve23 } from "node:path";
|
|
109588
109701
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
109589
109702
|
|
|
109590
109703
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -109631,7 +109744,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
|
|
|
109631
109744
|
}
|
|
109632
109745
|
|
|
109633
109746
|
// packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
|
|
109634
|
-
import { resolve as
|
|
109747
|
+
import { resolve as resolve22 } from "node:path";
|
|
109635
109748
|
function resolveJavaScriptRuntime(resolveExecutable) {
|
|
109636
109749
|
const node = resolveExecutable("node");
|
|
109637
109750
|
return node.available ? node : resolveExecutable("bun");
|
|
@@ -109639,9 +109752,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
|
|
|
109639
109752
|
function createAncestorCliCandidates(options) {
|
|
109640
109753
|
const candidates = [];
|
|
109641
109754
|
const seenPaths = new Set;
|
|
109642
|
-
let currentDirectory =
|
|
109755
|
+
let currentDirectory = resolve22(options.startDirectory);
|
|
109643
109756
|
while (true) {
|
|
109644
|
-
const distCliPath =
|
|
109757
|
+
const distCliPath = resolve22(currentDirectory, options.packageRel, options.distCliRel);
|
|
109645
109758
|
if (!seenPaths.has(distCliPath)) {
|
|
109646
109759
|
const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
|
|
109647
109760
|
seenPaths.add(distCliPath);
|
|
@@ -109653,7 +109766,7 @@ function createAncestorCliCandidates(options) {
|
|
|
109653
109766
|
runtimeAvailable: runtime5.available
|
|
109654
109767
|
});
|
|
109655
109768
|
}
|
|
109656
|
-
const sourceCliPath =
|
|
109769
|
+
const sourceCliPath = resolve22(currentDirectory, options.packageRel, options.sourceCliRel);
|
|
109657
109770
|
if (!seenPaths.has(sourceCliPath)) {
|
|
109658
109771
|
const runtime5 = options.resolveExecutable("bun");
|
|
109659
109772
|
const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
|
|
@@ -109670,7 +109783,7 @@ function createAncestorCliCandidates(options) {
|
|
|
109670
109783
|
runtimeAvailable: runtime5.available
|
|
109671
109784
|
});
|
|
109672
109785
|
}
|
|
109673
|
-
const parentDirectory =
|
|
109786
|
+
const parentDirectory = resolve22(currentDirectory, "..");
|
|
109674
109787
|
if (parentDirectory === currentDirectory)
|
|
109675
109788
|
return candidates;
|
|
109676
109789
|
currentDirectory = parentDirectory;
|
|
@@ -109723,11 +109836,11 @@ function getModuleDirectory(moduleUrl) {
|
|
|
109723
109836
|
}
|
|
109724
109837
|
}
|
|
109725
109838
|
function findBootstrapRoot(candidates, pathExists) {
|
|
109726
|
-
return candidates.find((candidate2) => pathExists(
|
|
109839
|
+
return candidates.find((candidate2) => pathExists(resolve23(candidate2.root, "package.json")))?.root ?? process.cwd();
|
|
109727
109840
|
}
|
|
109728
109841
|
function readDaemonPackageVersion(root) {
|
|
109729
109842
|
try {
|
|
109730
|
-
const packageJson = JSON.parse(readFileSync35(
|
|
109843
|
+
const packageJson = JSON.parse(readFileSync35(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
109731
109844
|
return DaemonPackageSchema.parse(packageJson).version;
|
|
109732
109845
|
} catch (error51) {
|
|
109733
109846
|
if (!(error51 instanceof Error))
|
|
@@ -109739,17 +109852,17 @@ function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
|
109739
109852
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
109740
109853
|
const bun = resolveExecutable("bun");
|
|
109741
109854
|
const npm = resolveExecutable("npm");
|
|
109742
|
-
const packageManifestPath =
|
|
109855
|
+
const packageManifestPath = resolve23(root, PACKAGE_REL, "package.json");
|
|
109743
109856
|
return {
|
|
109744
109857
|
command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
|
|
109745
109858
|
root,
|
|
109746
|
-
path:
|
|
109859
|
+
path: resolve23(root, PACKAGE_REL, DIST_CLI_REL),
|
|
109747
109860
|
exists: runtime5.available && npm.available && pathExists(packageManifestPath),
|
|
109748
109861
|
runtimeAvailable: runtime5.available
|
|
109749
109862
|
};
|
|
109750
109863
|
}
|
|
109751
109864
|
function resolveLspCommand(options = {}) {
|
|
109752
|
-
const pathExists = options.exists ??
|
|
109865
|
+
const pathExists = options.exists ?? existsSync56;
|
|
109753
109866
|
const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
|
|
109754
109867
|
const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
|
|
109755
109868
|
const candidates = moduleDirectory ? createAncestorCliCandidates({
|
|
@@ -109759,7 +109872,7 @@ function resolveLspCommand(options = {}) {
|
|
|
109759
109872
|
sourceCliRel: SOURCE_CLI_REL,
|
|
109760
109873
|
pathExists,
|
|
109761
109874
|
resolveExecutable,
|
|
109762
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(
|
|
109875
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve23(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
|
|
109763
109876
|
}) : [];
|
|
109764
109877
|
const distCandidate = candidates.find((candidate2) => hasCliSuffix(candidate2.path, DIST_CLI_REL) && candidate2.exists);
|
|
109765
109878
|
if (distCandidate) {
|
|
@@ -109773,7 +109886,7 @@ function resolveLspCommand(options = {}) {
|
|
|
109773
109886
|
}
|
|
109774
109887
|
function createLspMcpConfig(options = {}) {
|
|
109775
109888
|
const resolvedCommand = resolveLspCommand(options);
|
|
109776
|
-
const cwd =
|
|
109889
|
+
const cwd = resolve23(options.cwd ?? process.cwd());
|
|
109777
109890
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
109778
109891
|
const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
|
|
109779
109892
|
return {
|
|
@@ -109782,9 +109895,9 @@ function createLspMcpConfig(options = {}) {
|
|
|
109782
109895
|
enabled: resolvedCommand.exists,
|
|
109783
109896
|
cwd,
|
|
109784
109897
|
environment: {
|
|
109785
|
-
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) =>
|
|
109786
|
-
LSP_TOOLS_MCP_USER_CONFIG:
|
|
109787
|
-
LSP_TOOLS_MCP_INSTALL_DECISIONS:
|
|
109898
|
+
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve23(cwd, configPath)).join(delimiter3),
|
|
109899
|
+
LSP_TOOLS_MCP_USER_CONFIG: resolve23(configDir, "lsp.json"),
|
|
109900
|
+
LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve23(configDir, "lsp-install-decisions.json"),
|
|
109788
109901
|
...sourceVersion ? {
|
|
109789
109902
|
[OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
|
|
109790
109903
|
[OMO_LSP_DAEMON_VERSION]: sourceVersion
|
|
@@ -109809,21 +109922,21 @@ function getInstalledLspServers(options = {}) {
|
|
|
109809
109922
|
|
|
109810
109923
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
109811
109924
|
init_shared();
|
|
109812
|
-
import { existsSync as
|
|
109813
|
-
import { homedir as
|
|
109814
|
-
import { join as
|
|
109925
|
+
import { existsSync as existsSync57, readFileSync as readFileSync36 } from "node:fs";
|
|
109926
|
+
import { homedir as homedir20 } from "node:os";
|
|
109927
|
+
import { join as join84 } from "node:path";
|
|
109815
109928
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
109816
109929
|
function getMcpConfigPaths() {
|
|
109817
109930
|
return [
|
|
109818
|
-
|
|
109819
|
-
|
|
109820
|
-
|
|
109931
|
+
join84(homedir20(), ".claude", ".mcp.json"),
|
|
109932
|
+
join84(process.cwd(), ".mcp.json"),
|
|
109933
|
+
join84(process.cwd(), ".claude", ".mcp.json")
|
|
109821
109934
|
];
|
|
109822
109935
|
}
|
|
109823
109936
|
function loadUserMcpConfig() {
|
|
109824
109937
|
const servers = {};
|
|
109825
109938
|
for (const configPath of getMcpConfigPaths()) {
|
|
109826
|
-
if (!
|
|
109939
|
+
if (!existsSync57(configPath))
|
|
109827
109940
|
continue;
|
|
109828
109941
|
try {
|
|
109829
109942
|
const content = readFileSync36(configPath, "utf-8");
|
|
@@ -109961,12 +110074,12 @@ async function checkTools() {
|
|
|
109961
110074
|
|
|
109962
110075
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
109963
110076
|
init_src5();
|
|
109964
|
-
import { existsSync as
|
|
110077
|
+
import { existsSync as existsSync58, readFileSync as readFileSync37 } from "node:fs";
|
|
109965
110078
|
function isTelemetryState(value) {
|
|
109966
110079
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
109967
110080
|
}
|
|
109968
110081
|
function readLastActiveDay(stateFilePath) {
|
|
109969
|
-
if (!
|
|
110082
|
+
if (!existsSync58(stateFilePath)) {
|
|
109970
110083
|
return "never";
|
|
109971
110084
|
}
|
|
109972
110085
|
let parsed;
|
|
@@ -110029,17 +110142,17 @@ async function probeBinary(cmd, args, spawnImpl) {
|
|
|
110029
110142
|
}
|
|
110030
110143
|
|
|
110031
110144
|
// packages/team-core/src/team-registry/paths.ts
|
|
110032
|
-
import { homedir as
|
|
110145
|
+
import { homedir as homedir21 } from "node:os";
|
|
110033
110146
|
import path12 from "node:path";
|
|
110034
110147
|
function resolveBaseDir(config4) {
|
|
110035
|
-
return expandHomeDirectory(config4.base_dir ?? path12.join(
|
|
110148
|
+
return expandHomeDirectory(config4.base_dir ?? path12.join(homedir21(), ".omo"));
|
|
110036
110149
|
}
|
|
110037
110150
|
function expandHomeDirectory(directoryPath3) {
|
|
110038
110151
|
if (directoryPath3 === "~") {
|
|
110039
|
-
return
|
|
110152
|
+
return homedir21();
|
|
110040
110153
|
}
|
|
110041
110154
|
if (directoryPath3.startsWith("~/") || directoryPath3.startsWith("~\\")) {
|
|
110042
|
-
return path12.join(
|
|
110155
|
+
return path12.join(homedir21(), directoryPath3.slice(2));
|
|
110043
110156
|
}
|
|
110044
110157
|
return directoryPath3;
|
|
110045
110158
|
}
|
|
@@ -110096,10 +110209,10 @@ async function pathExists(dir) {
|
|
|
110096
110209
|
|
|
110097
110210
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
110098
110211
|
init_src2();
|
|
110099
|
-
import { existsSync as
|
|
110212
|
+
import { existsSync as existsSync59 } from "node:fs";
|
|
110100
110213
|
import { lstat as lstat15, readdir as readdir14, readFile as readFile27 } from "node:fs/promises";
|
|
110101
|
-
import { homedir as
|
|
110102
|
-
import { basename as basename11, join as
|
|
110214
|
+
import { homedir as homedir22 } from "node:os";
|
|
110215
|
+
import { basename as basename11, join as join85, resolve as resolve24 } from "node:path";
|
|
110103
110216
|
// packages/omo-opencode/package.json
|
|
110104
110217
|
var package_default3 = {
|
|
110105
110218
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -110164,13 +110277,13 @@ var CODEX_BIN_NAMES = [
|
|
|
110164
110277
|
"omo-git-bash-hook"
|
|
110165
110278
|
];
|
|
110166
110279
|
async function gatherCodexSummary(deps = {}) {
|
|
110167
|
-
const codexHome =
|
|
110280
|
+
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join85(homedir22(), ".codex"));
|
|
110168
110281
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110169
110282
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
110170
110283
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
110171
|
-
const manifest2 = pluginRoot === null ? null : await readJson(
|
|
110172
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
110173
|
-
const configPath =
|
|
110284
|
+
const manifest2 = pluginRoot === null ? null : await readJson(join85(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
110285
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join85(pluginRoot, "lazycodex-install.json"));
|
|
110286
|
+
const configPath = join85(codexHome, "config.toml");
|
|
110174
110287
|
const pluginVersion = stringField(manifest2, "version");
|
|
110175
110288
|
return {
|
|
110176
110289
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -110227,7 +110340,7 @@ function buildCodexIssues(summary) {
|
|
|
110227
110340
|
if (summary.pluginRoot === null) {
|
|
110228
110341
|
issues.push({
|
|
110229
110342
|
title: "OMO Codex plugin is not installed",
|
|
110230
|
-
description: `Expected cached plugin at ${
|
|
110343
|
+
description: `Expected cached plugin at ${join85("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
110231
110344
|
fix: "Run: npx lazycodex-ai install",
|
|
110232
110345
|
severity: "error",
|
|
110233
110346
|
affects: ["plugin loading"]
|
|
@@ -110292,15 +110405,15 @@ function buildCodexIssues(summary) {
|
|
|
110292
110405
|
return issues;
|
|
110293
110406
|
}
|
|
110294
110407
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
110295
|
-
const pluginRoot =
|
|
110296
|
-
if (!
|
|
110408
|
+
const pluginRoot = join85(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
110409
|
+
if (!existsSync59(pluginRoot))
|
|
110297
110410
|
return null;
|
|
110298
110411
|
const versions2 = await readdir14(pluginRoot, { withFileTypes: true });
|
|
110299
110412
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
110300
|
-
return candidates.length === 0 ? null :
|
|
110413
|
+
return candidates.length === 0 ? null : join85(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
110301
110414
|
}
|
|
110302
110415
|
async function readCodexConfigSummary(configPath) {
|
|
110303
|
-
if (!
|
|
110416
|
+
if (!existsSync59(configPath)) {
|
|
110304
110417
|
return {
|
|
110305
110418
|
exists: false,
|
|
110306
110419
|
marketplaceConfigured: false,
|
|
@@ -110325,14 +110438,14 @@ async function readCodexConfigSummary(configPath) {
|
|
|
110325
110438
|
async function readLinkedBins(binDir) {
|
|
110326
110439
|
const linked = [];
|
|
110327
110440
|
for (const name of CODEX_BIN_NAMES) {
|
|
110328
|
-
if (await pathExists2(
|
|
110441
|
+
if (await pathExists2(join85(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
110329
110442
|
linked.push(name);
|
|
110330
110443
|
}
|
|
110331
110444
|
return linked;
|
|
110332
110445
|
}
|
|
110333
110446
|
async function readLinkedAgents(codexHome) {
|
|
110334
|
-
const agentsDir =
|
|
110335
|
-
if (!
|
|
110447
|
+
const agentsDir = join85(codexHome, "agents");
|
|
110448
|
+
if (!existsSync59(agentsDir))
|
|
110336
110449
|
return [];
|
|
110337
110450
|
const entries = await readdir14(agentsDir, { withFileTypes: true });
|
|
110338
110451
|
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename11(entry.name, ".toml")).sort();
|
|
@@ -110446,8 +110559,8 @@ async function pathExists2(path14) {
|
|
|
110446
110559
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
110447
110560
|
init_src2();
|
|
110448
110561
|
import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "node:fs/promises";
|
|
110449
|
-
import { homedir as
|
|
110450
|
-
import { dirname as dirname33, isAbsolute as isAbsolute12, join as
|
|
110562
|
+
import { homedir as homedir23 } from "node:os";
|
|
110563
|
+
import { dirname as dirname33, isAbsolute as isAbsolute12, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "node:path";
|
|
110451
110564
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
110452
110565
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
110453
110566
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -110457,7 +110570,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110457
110570
|
const env3 = deps.env ?? process.env;
|
|
110458
110571
|
const platform = deps.platform ?? process.platform;
|
|
110459
110572
|
const arch = deps.arch ?? process.arch;
|
|
110460
|
-
const codexHome =
|
|
110573
|
+
const codexHome = resolve25(deps.codexHome ?? env3["CODEX_HOME"] ?? join86(homedir23(), ".codex"));
|
|
110461
110574
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
110462
110575
|
if (summary.pluginRoot === null) {
|
|
110463
110576
|
return {
|
|
@@ -110482,7 +110595,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110482
110595
|
});
|
|
110483
110596
|
}
|
|
110484
110597
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
110485
|
-
const runtimeSgPath =
|
|
110598
|
+
const runtimeSgPath = join86(runtimeSgDir, sgBinaryName(platform));
|
|
110486
110599
|
const sg = findSgBinarySync({
|
|
110487
110600
|
arch,
|
|
110488
110601
|
env: env3,
|
|
@@ -110522,7 +110635,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110522
110635
|
if (manifest2 === null || !isRecord12(manifest2["mcpServers"]))
|
|
110523
110636
|
continue;
|
|
110524
110637
|
const manifestRoot = dirname33(manifestPath);
|
|
110525
|
-
const isRootManifest =
|
|
110638
|
+
const isRootManifest = resolve25(manifestRoot) === resolve25(pluginRoot);
|
|
110526
110639
|
for (const server2 of Object.values(manifest2["mcpServers"])) {
|
|
110527
110640
|
if (!isRecord12(server2) || !Array.isArray(server2["args"]))
|
|
110528
110641
|
continue;
|
|
@@ -110564,8 +110677,8 @@ function recordBrokenTarget(broken, classified, origin) {
|
|
|
110564
110677
|
broken.push(entry);
|
|
110565
110678
|
}
|
|
110566
110679
|
async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
|
|
110567
|
-
const targetPath =
|
|
110568
|
-
const bundleRootPath =
|
|
110680
|
+
const targetPath = resolve25(baseRoot, relativePath);
|
|
110681
|
+
const bundleRootPath = resolve25(bundleRoot);
|
|
110569
110682
|
const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
|
|
110570
110683
|
if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
|
|
110571
110684
|
if (allowEscape)
|
|
@@ -110594,7 +110707,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
110594
110707
|
for (const entry of entries) {
|
|
110595
110708
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
110596
110709
|
continue;
|
|
110597
|
-
const entryPath =
|
|
110710
|
+
const entryPath = join86(root, entry.name);
|
|
110598
110711
|
if (entry.isDirectory()) {
|
|
110599
110712
|
paths3.push(...await findManifestPaths(entryPath, manifestName));
|
|
110600
110713
|
continue;
|
|
@@ -110638,18 +110751,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
110638
110751
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
110639
110752
|
}
|
|
110640
110753
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
110641
|
-
return
|
|
110754
|
+
return join86(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
110642
110755
|
}
|
|
110643
110756
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
110644
110757
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
110645
110758
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
110646
110759
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
110647
|
-
if (sgPath ===
|
|
110760
|
+
if (sgPath === join86(runtimeSgDir, sgBinaryName(platform)))
|
|
110648
110761
|
return "runtime dir";
|
|
110649
110762
|
return "PATH";
|
|
110650
110763
|
}
|
|
110651
110764
|
async function readBootstrapStateSummary(codexHome) {
|
|
110652
|
-
const statePath =
|
|
110765
|
+
const statePath = join86(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
110653
110766
|
const raw = await readJson2(statePath);
|
|
110654
110767
|
if (raw === null)
|
|
110655
110768
|
return null;
|
|
@@ -110725,24 +110838,24 @@ function isRecord12(value) {
|
|
|
110725
110838
|
}
|
|
110726
110839
|
|
|
110727
110840
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
110728
|
-
import { existsSync as
|
|
110841
|
+
import { existsSync as existsSync60 } from "node:fs";
|
|
110729
110842
|
import { readFile as readFile29 } from "node:fs/promises";
|
|
110730
|
-
import { homedir as
|
|
110731
|
-
import { join as
|
|
110843
|
+
import { homedir as homedir24 } from "node:os";
|
|
110844
|
+
import { join as join87, resolve as resolve26 } from "node:path";
|
|
110732
110845
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
110733
110846
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
110734
110847
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
110735
110848
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
110736
|
-
const codexHome =
|
|
110849
|
+
const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join87(homedir24(), ".codex"));
|
|
110737
110850
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110738
110851
|
const platform = deps.platform ?? process.platform;
|
|
110739
|
-
const wrapperPath =
|
|
110740
|
-
const legacyWrapperPath =
|
|
110852
|
+
const wrapperPath = join87(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
|
|
110853
|
+
const legacyWrapperPath = join87(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
110741
110854
|
const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
|
|
110742
110855
|
const issues = [];
|
|
110743
110856
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
110744
110857
|
const targetPath = parseRuntimeTargetPath(wrapper);
|
|
110745
|
-
if (targetPath !== null && !
|
|
110858
|
+
if (targetPath !== null && !existsSync60(targetPath)) {
|
|
110746
110859
|
issues.push({
|
|
110747
110860
|
title: "omo-agent-toolkit runtime wrapper target is missing",
|
|
110748
110861
|
description: `Generated omo-agent-toolkit runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
|
|
@@ -111257,7 +111370,7 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
111257
111370
|
import { createHash as createHash6 } from "node:crypto";
|
|
111258
111371
|
import {
|
|
111259
111372
|
chmodSync as chmodSync5,
|
|
111260
|
-
existsSync as
|
|
111373
|
+
existsSync as existsSync63,
|
|
111261
111374
|
mkdirSync as mkdirSync15,
|
|
111262
111375
|
readdirSync as readdirSync11,
|
|
111263
111376
|
readFileSync as readFileSync39,
|
|
@@ -111265,15 +111378,15 @@ import {
|
|
|
111265
111378
|
unlinkSync as unlinkSync9,
|
|
111266
111379
|
writeFileSync as writeFileSync12
|
|
111267
111380
|
} from "node:fs";
|
|
111268
|
-
import { basename as basename12, dirname as dirname34, join as
|
|
111381
|
+
import { basename as basename12, dirname as dirname34, join as join90 } from "node:path";
|
|
111269
111382
|
|
|
111270
111383
|
// packages/mcp-client-core/src/config-dir.ts
|
|
111271
|
-
import { existsSync as
|
|
111272
|
-
import { homedir as
|
|
111273
|
-
import { join as
|
|
111384
|
+
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
|
|
111385
|
+
import { homedir as homedir25 } from "node:os";
|
|
111386
|
+
import { join as join88, resolve as resolve27 } from "node:path";
|
|
111274
111387
|
function resolveConfigPath2(pathValue) {
|
|
111275
|
-
const resolvedPath =
|
|
111276
|
-
if (!
|
|
111388
|
+
const resolvedPath = resolve27(pathValue);
|
|
111389
|
+
if (!existsSync61(resolvedPath))
|
|
111277
111390
|
return resolvedPath;
|
|
111278
111391
|
try {
|
|
111279
111392
|
return realpathSync8(resolvedPath);
|
|
@@ -111288,13 +111401,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
111288
111401
|
if (customConfigDir) {
|
|
111289
111402
|
return resolveConfigPath2(customConfigDir);
|
|
111290
111403
|
}
|
|
111291
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
111292
|
-
return resolveConfigPath2(
|
|
111404
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join88(homedir25(), ".config");
|
|
111405
|
+
return resolveConfigPath2(join88(xdgConfigDir, "opencode"));
|
|
111293
111406
|
}
|
|
111294
111407
|
|
|
111295
111408
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
111296
|
-
import { chmodSync as chmodSync4, existsSync as
|
|
111297
|
-
import { join as
|
|
111409
|
+
import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync38, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "node:fs";
|
|
111410
|
+
import { join as join89 } from "node:path";
|
|
111298
111411
|
var INDEX_FILE_NAME = "index.json";
|
|
111299
111412
|
function isTokenIndex(value) {
|
|
111300
111413
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -111302,11 +111415,11 @@ function isTokenIndex(value) {
|
|
|
111302
111415
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
111303
111416
|
}
|
|
111304
111417
|
function getIndexPath(storageDir) {
|
|
111305
|
-
return
|
|
111418
|
+
return join89(storageDir, INDEX_FILE_NAME);
|
|
111306
111419
|
}
|
|
111307
111420
|
function readTokenIndex(storageDir) {
|
|
111308
111421
|
const indexPath = getIndexPath(storageDir);
|
|
111309
|
-
if (!
|
|
111422
|
+
if (!existsSync62(indexPath))
|
|
111310
111423
|
return {};
|
|
111311
111424
|
try {
|
|
111312
111425
|
const parsed = JSON.parse(readFileSync38(indexPath, "utf-8"));
|
|
@@ -111346,16 +111459,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
111346
111459
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
111347
111460
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
111348
111461
|
function getMcpOauthStorageDir() {
|
|
111349
|
-
return
|
|
111462
|
+
return join90(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
111350
111463
|
}
|
|
111351
111464
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
111352
111465
|
return createHash6("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
111353
111466
|
}
|
|
111354
111467
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
111355
|
-
return
|
|
111468
|
+
return join90(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
111356
111469
|
}
|
|
111357
111470
|
function getLegacyStoragePath() {
|
|
111358
|
-
return
|
|
111471
|
+
return join90(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
111359
111472
|
}
|
|
111360
111473
|
function normalizeHost2(serverHost) {
|
|
111361
111474
|
let host = serverHost.trim();
|
|
@@ -111416,7 +111529,7 @@ function isOAuthTokenData(value) {
|
|
|
111416
111529
|
return clientSecret === undefined || typeof clientSecret === "string";
|
|
111417
111530
|
}
|
|
111418
111531
|
function readTokenFile(filePath) {
|
|
111419
|
-
if (!
|
|
111532
|
+
if (!existsSync63(filePath))
|
|
111420
111533
|
return null;
|
|
111421
111534
|
try {
|
|
111422
111535
|
const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
|
|
@@ -111429,7 +111542,7 @@ function readTokenFile(filePath) {
|
|
|
111429
111542
|
}
|
|
111430
111543
|
function readLegacyStore() {
|
|
111431
111544
|
const filePath = getLegacyStoragePath();
|
|
111432
|
-
if (!
|
|
111545
|
+
if (!existsSync63(filePath))
|
|
111433
111546
|
return null;
|
|
111434
111547
|
try {
|
|
111435
111548
|
const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
|
|
@@ -111450,7 +111563,7 @@ function readLegacyStore() {
|
|
|
111450
111563
|
function writeTokenFile(filePath, token) {
|
|
111451
111564
|
try {
|
|
111452
111565
|
const dir = dirname34(filePath);
|
|
111453
|
-
if (!
|
|
111566
|
+
if (!existsSync63(dir)) {
|
|
111454
111567
|
mkdirSync15(dir, { recursive: true });
|
|
111455
111568
|
}
|
|
111456
111569
|
const tempPath = `${filePath}.tmp.${Date.now()}`;
|
|
@@ -111474,7 +111587,7 @@ function saveToken(serverHost, resource, token) {
|
|
|
111474
111587
|
}
|
|
111475
111588
|
function deleteToken(serverHost, resource) {
|
|
111476
111589
|
const filePath = getMcpOauthStoragePath(serverHost, resource);
|
|
111477
|
-
if (!
|
|
111590
|
+
if (!existsSync63(filePath))
|
|
111478
111591
|
return deleteLegacyToken(serverHost, resource);
|
|
111479
111592
|
try {
|
|
111480
111593
|
unlinkSync9(filePath);
|
|
@@ -111496,7 +111609,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
111496
111609
|
if (Object.keys(store2).length === 0) {
|
|
111497
111610
|
try {
|
|
111498
111611
|
const filePath = getLegacyStoragePath();
|
|
111499
|
-
if (
|
|
111612
|
+
if (existsSync63(filePath))
|
|
111500
111613
|
unlinkSync9(filePath);
|
|
111501
111614
|
return true;
|
|
111502
111615
|
} catch (deleteError) {
|
|
@@ -111534,7 +111647,7 @@ function listTokensByHost(serverHost) {
|
|
|
111534
111647
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
111535
111648
|
if (!indexedKey.startsWith(prefix))
|
|
111536
111649
|
continue;
|
|
111537
|
-
const indexedToken = readTokenFile(
|
|
111650
|
+
const indexedToken = readTokenFile(join90(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
111538
111651
|
if (indexedToken)
|
|
111539
111652
|
result[indexedKey] = indexedToken;
|
|
111540
111653
|
}
|
|
@@ -111543,13 +111656,13 @@ function listTokensByHost(serverHost) {
|
|
|
111543
111656
|
function listAllTokens() {
|
|
111544
111657
|
const result = { ...readLegacyStore() ?? {} };
|
|
111545
111658
|
const dir = getMcpOauthStorageDir();
|
|
111546
|
-
if (!
|
|
111659
|
+
if (!existsSync63(dir))
|
|
111547
111660
|
return result;
|
|
111548
111661
|
const index = readTokenIndex(dir);
|
|
111549
111662
|
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
111550
111663
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
111551
111664
|
continue;
|
|
111552
|
-
const token = readTokenFile(
|
|
111665
|
+
const token = readTokenFile(join90(dir, entry.name));
|
|
111553
111666
|
const hash2 = basename12(entry.name, ".json");
|
|
111554
111667
|
if (token)
|
|
111555
111668
|
result[index[hash2] ?? hash2] = token;
|
|
@@ -111749,7 +111862,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
|
111749
111862
|
}
|
|
111750
111863
|
var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
111751
111864
|
function startCallbackServer(port) {
|
|
111752
|
-
return new Promise((
|
|
111865
|
+
return new Promise((resolve28, reject) => {
|
|
111753
111866
|
let timeoutId;
|
|
111754
111867
|
const server2 = createServer2((request, response) => {
|
|
111755
111868
|
clearTimeout(timeoutId);
|
|
@@ -111775,7 +111888,7 @@ function startCallbackServer(port) {
|
|
|
111775
111888
|
response.writeHead(200, { "content-type": "text/html" });
|
|
111776
111889
|
response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
|
|
111777
111890
|
server2.close();
|
|
111778
|
-
|
|
111891
|
+
resolve28({ code, state: state2 });
|
|
111779
111892
|
});
|
|
111780
111893
|
timeoutId = setTimeout(() => {
|
|
111781
111894
|
server2.close();
|
|
@@ -112115,7 +112228,7 @@ function createMcpOAuthCommand() {
|
|
|
112115
112228
|
}
|
|
112116
112229
|
|
|
112117
112230
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
112118
|
-
import { existsSync as
|
|
112231
|
+
import { existsSync as existsSync64 } from "node:fs";
|
|
112119
112232
|
|
|
112120
112233
|
// packages/omo-opencode/src/cli/boulder/formatter.ts
|
|
112121
112234
|
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
@@ -112252,10 +112365,10 @@ async function boulder(options) {
|
|
|
112252
112365
|
const boulderFilePath = getBoulderFilePath(directory);
|
|
112253
112366
|
const state2 = readBoulderState(directory);
|
|
112254
112367
|
if (!state2) {
|
|
112255
|
-
const message =
|
|
112368
|
+
const message = existsSync64(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
|
|
112256
112369
|
process.stderr.write(`${message}
|
|
112257
112370
|
`);
|
|
112258
|
-
return
|
|
112371
|
+
return existsSync64(boulderFilePath) ? 2 : 1;
|
|
112259
112372
|
}
|
|
112260
112373
|
const works = getBoulderWorks(state2);
|
|
112261
112374
|
const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
|
|
@@ -112273,12 +112386,12 @@ async function boulder(options) {
|
|
|
112273
112386
|
}
|
|
112274
112387
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
112275
112388
|
import { spawn as spawn5 } from "node:child_process";
|
|
112276
|
-
import { existsSync as
|
|
112277
|
-
import { homedir as
|
|
112389
|
+
import { existsSync as existsSync65, readFileSync as readFileSync40, realpathSync as realpathSync9 } from "node:fs";
|
|
112390
|
+
import { homedir as homedir26 } from "node:os";
|
|
112278
112391
|
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
|
|
112279
112392
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
112280
112393
|
const env3 = input.env ?? process.env;
|
|
112281
|
-
const homeDir = input.homeDir ??
|
|
112394
|
+
const homeDir = input.homeDir ?? homedir26();
|
|
112282
112395
|
const localComponentBin = resolveLocalUlwLoopBin(env3, homeDir);
|
|
112283
112396
|
if (localComponentBin !== null)
|
|
112284
112397
|
return { executable: localComponentBin, argsPrefix: [] };
|
|
@@ -112301,25 +112414,25 @@ async function codexUlwLoop(args) {
|
|
|
112301
112414
|
console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
|
|
112302
112415
|
return 1;
|
|
112303
112416
|
}
|
|
112304
|
-
const { promise: promise2, resolve:
|
|
112417
|
+
const { promise: promise2, resolve: resolve28 } = Promise.withResolvers();
|
|
112305
112418
|
const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
|
|
112306
112419
|
stdio: "inherit",
|
|
112307
112420
|
env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
|
|
112308
112421
|
});
|
|
112309
112422
|
child.on("error", (error51) => {
|
|
112310
112423
|
console.error(error51.message);
|
|
112311
|
-
|
|
112424
|
+
resolve28(1);
|
|
112312
112425
|
});
|
|
112313
|
-
child.on("close", (code) =>
|
|
112426
|
+
child.on("close", (code) => resolve28(code ?? 1));
|
|
112314
112427
|
return promise2;
|
|
112315
112428
|
}
|
|
112316
112429
|
function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
112317
112430
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
|
|
112318
|
-
return candidates.find((candidate2) =>
|
|
112431
|
+
return candidates.find((candidate2) => existsSync65(candidate2)) ?? null;
|
|
112319
112432
|
}
|
|
112320
112433
|
function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
112321
112434
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
|
|
112322
|
-
return candidates.find((candidate2) =>
|
|
112435
|
+
return candidates.find((candidate2) => existsSync65(candidate2) && !isCurrentExecutable(candidate2, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate2)) ?? null;
|
|
112323
112436
|
}
|
|
112324
112437
|
function isGeneratedRuntimeWrapper(candidate2) {
|
|
112325
112438
|
try {
|