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/index.js
CHANGED
|
@@ -1019,7 +1019,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1019
1019
|
this._exitCallback = (err) => {
|
|
1020
1020
|
if (err.code !== "commander.executeSubCommandAsync") {
|
|
1021
1021
|
throw err;
|
|
1022
|
-
}
|
|
1022
|
+
}
|
|
1023
1023
|
};
|
|
1024
1024
|
}
|
|
1025
1025
|
return this;
|
|
@@ -2145,7 +2145,7 @@ var package_default;
|
|
|
2145
2145
|
var init_package = __esm(() => {
|
|
2146
2146
|
package_default = {
|
|
2147
2147
|
name: "oh-my-opencode",
|
|
2148
|
-
version: "5.0.0-beta.
|
|
2148
|
+
version: "5.0.0-beta.9",
|
|
2149
2149
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
2150
2150
|
main: "./dist/index.js",
|
|
2151
2151
|
types: "dist/index.d.ts",
|
|
@@ -2281,6 +2281,7 @@ var init_package = __esm(() => {
|
|
|
2281
2281
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
2282
2282
|
test: "bun test",
|
|
2283
2283
|
"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",
|
|
2284
|
+
"test:fast": "bun run script/test-fast.ts",
|
|
2284
2285
|
"test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test packages/omo-senpi",
|
|
2285
2286
|
"test:windows-codex": "bun run test:codex",
|
|
2286
2287
|
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
|
|
@@ -2325,7 +2326,7 @@ var init_package = __esm(() => {
|
|
|
2325
2326
|
zod: "^4.4.3"
|
|
2326
2327
|
},
|
|
2327
2328
|
devDependencies: {
|
|
2328
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
2329
|
+
"@code-yeongyu/senpi": "2026.8.17",
|
|
2329
2330
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
2330
2331
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
2331
2332
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
@@ -2357,7 +2358,7 @@ var init_package = __esm(() => {
|
|
|
2357
2358
|
"@oh-my-opencode/utils": "workspace:*",
|
|
2358
2359
|
"@types/js-yaml": "^4.0.9",
|
|
2359
2360
|
"@types/picomatch": "^4.0.3",
|
|
2360
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
2361
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
2361
2362
|
"@xterm/addon-unicode11": "^0.9.0",
|
|
2362
2363
|
"@xterm/xterm": "^6.0.0",
|
|
2363
2364
|
"bun-types": "1.3.14",
|
|
@@ -2366,24 +2367,24 @@ var init_package = __esm(() => {
|
|
|
2366
2367
|
typescript: "^7.0.2"
|
|
2367
2368
|
},
|
|
2368
2369
|
optionalDependencies: {
|
|
2369
|
-
"oh-my-opencode-darwin-arm64": "5.0.0-beta.
|
|
2370
|
-
"oh-my-opencode-darwin-x64": "5.0.0-beta.
|
|
2371
|
-
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.
|
|
2372
|
-
"oh-my-opencode-linux-arm64": "5.0.0-beta.
|
|
2373
|
-
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.
|
|
2374
|
-
"oh-my-opencode-linux-x64": "5.0.0-beta.
|
|
2375
|
-
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.
|
|
2376
|
-
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.
|
|
2377
|
-
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.
|
|
2378
|
-
"oh-my-opencode-windows-arm64": "5.0.0-beta.
|
|
2379
|
-
"oh-my-opencode-windows-x64": "5.0.0-beta.
|
|
2380
|
-
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.
|
|
2370
|
+
"oh-my-opencode-darwin-arm64": "5.0.0-beta.9",
|
|
2371
|
+
"oh-my-opencode-darwin-x64": "5.0.0-beta.9",
|
|
2372
|
+
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.9",
|
|
2373
|
+
"oh-my-opencode-linux-arm64": "5.0.0-beta.9",
|
|
2374
|
+
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.9",
|
|
2375
|
+
"oh-my-opencode-linux-x64": "5.0.0-beta.9",
|
|
2376
|
+
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.9",
|
|
2377
|
+
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.9",
|
|
2378
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.9",
|
|
2379
|
+
"oh-my-opencode-windows-arm64": "5.0.0-beta.9",
|
|
2380
|
+
"oh-my-opencode-windows-x64": "5.0.0-beta.9",
|
|
2381
|
+
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.9"
|
|
2381
2382
|
},
|
|
2382
2383
|
overrides: {
|
|
2383
|
-
"@earendil-works/pi-agent-core": "0.
|
|
2384
|
-
"@earendil-works/pi-ai": "0.
|
|
2385
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
2386
|
-
"@earendil-works/pi-tui": "0.
|
|
2384
|
+
"@earendil-works/pi-agent-core": "0.84.2",
|
|
2385
|
+
"@earendil-works/pi-ai": "0.84.2",
|
|
2386
|
+
"@earendil-works/pi-coding-agent": "0.84.2",
|
|
2387
|
+
"@earendil-works/pi-tui": "0.84.2",
|
|
2387
2388
|
hono: "^4.12.18",
|
|
2388
2389
|
"@hono/node-server": "^1.19.13",
|
|
2389
2390
|
"express-rate-limit": "^8.5.1",
|
|
@@ -18762,7 +18763,7 @@ function finalize(ctx, schema) {
|
|
|
18762
18763
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
18763
18764
|
} else if (ctx.target === "draft-04") {
|
|
18764
18765
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
18765
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
18766
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
18766
18767
|
if (ctx.external?.uri) {
|
|
18767
18768
|
const id = ctx.external.registry.get(schema)?.id;
|
|
18768
18769
|
if (!id)
|
|
@@ -19023,7 +19024,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
19023
19024
|
if (val === undefined) {
|
|
19024
19025
|
if (ctx.unrepresentable === "throw") {
|
|
19025
19026
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
19026
|
-
}
|
|
19027
|
+
}
|
|
19027
19028
|
} else if (typeof val === "bigint") {
|
|
19028
19029
|
if (ctx.unrepresentable === "throw") {
|
|
19029
19030
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -22584,7 +22585,7 @@ function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism
|
|
|
22584
22585
|
residency_max_children: record2["residency_max_children"] ?? Math.max(8, resolveParallelism() * 3)
|
|
22585
22586
|
});
|
|
22586
22587
|
}
|
|
22587
|
-
var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskSettingsSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
|
|
22588
|
+
var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
|
|
22588
22589
|
var init_task = __esm(() => {
|
|
22589
22590
|
init_zod();
|
|
22590
22591
|
ResidencyMaxChildrenInputSchema = union([number2().int().positive(), literal("unlimited")]);
|
|
@@ -22601,6 +22602,16 @@ var init_task = __esm(() => {
|
|
|
22601
22602
|
OmoTaskWarningsSchema = object({
|
|
22602
22603
|
unavailable_categories: boolean2().default(true)
|
|
22603
22604
|
}).strict();
|
|
22605
|
+
OmoTaskDagSettingsSchema = object({
|
|
22606
|
+
max_nodes_per_run: number2().int().positive().default(64),
|
|
22607
|
+
max_runs_per_session: number2().int().positive().default(16),
|
|
22608
|
+
subscriber_ring: number2().int().positive().default(1000),
|
|
22609
|
+
heartbeat_ms: number2().int().positive().default(15000),
|
|
22610
|
+
history_default_limit: number2().int().positive().default(256),
|
|
22611
|
+
history_max_limit: number2().int().positive().default(1000),
|
|
22612
|
+
retention_days: number2().int().positive().default(7),
|
|
22613
|
+
max_prompt_bytes: number2().int().positive().default(262144)
|
|
22614
|
+
}).strict();
|
|
22604
22615
|
OmoTaskSettingsSchema = object({
|
|
22605
22616
|
default_execution_mode: _enum2(["in-process", "process"]).default("in-process"),
|
|
22606
22617
|
default_concurrency: number2().int().positive().default(5),
|
|
@@ -22618,7 +22629,18 @@ var init_task = __esm(() => {
|
|
|
22618
22629
|
max_members: 8,
|
|
22619
22630
|
max_parallel_members: 4,
|
|
22620
22631
|
max_wall_clock_minutes: 120
|
|
22621
|
-
})
|
|
22632
|
+
}),
|
|
22633
|
+
dag: OmoTaskDagSettingsSchema.optional()
|
|
22634
|
+
}).strict();
|
|
22635
|
+
OmoTaskDagSettingsLayerSchema = object({
|
|
22636
|
+
max_nodes_per_run: number2().int().positive().optional(),
|
|
22637
|
+
max_runs_per_session: number2().int().positive().optional(),
|
|
22638
|
+
subscriber_ring: number2().int().positive().optional(),
|
|
22639
|
+
heartbeat_ms: number2().int().positive().optional(),
|
|
22640
|
+
history_default_limit: number2().int().positive().optional(),
|
|
22641
|
+
history_max_limit: number2().int().positive().optional(),
|
|
22642
|
+
retention_days: number2().int().positive().optional(),
|
|
22643
|
+
max_prompt_bytes: number2().int().positive().optional()
|
|
22622
22644
|
}).strict();
|
|
22623
22645
|
OmoTaskWaitLayerSchema = object({
|
|
22624
22646
|
min_ms: number2().int().positive().optional(),
|
|
@@ -22646,7 +22668,8 @@ var init_task = __esm(() => {
|
|
|
22646
22668
|
resume_children: boolean2().optional(),
|
|
22647
22669
|
warnings: OmoTaskWarningsLayerSchema.optional(),
|
|
22648
22670
|
wait: OmoTaskWaitLayerSchema.optional(),
|
|
22649
|
-
team: OmoTaskTeamSettingsLayerSchema.optional()
|
|
22671
|
+
team: OmoTaskTeamSettingsLayerSchema.optional(),
|
|
22672
|
+
dag: OmoTaskDagSettingsLayerSchema.optional()
|
|
22650
22673
|
}).strict();
|
|
22651
22674
|
});
|
|
22652
22675
|
|
|
@@ -26471,10 +26494,10 @@ var init_category_model_requirements = __esm(() => {
|
|
|
26471
26494
|
quick: {
|
|
26472
26495
|
fallbackChain: [
|
|
26473
26496
|
{ providers: ["kimi-for-coding"], model: "kimi-for-coding-highspeed" },
|
|
26474
|
-
{ providers: ["
|
|
26497
|
+
{ providers: ["openai-codex"], model: "gpt-5.6-luna-fast", variant: "low" },
|
|
26475
26498
|
{ providers: ["deepseek"], model: "deepseek-v4-flash", variant: "off" },
|
|
26476
26499
|
{
|
|
26477
|
-
providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "
|
|
26500
|
+
providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "vercel"],
|
|
26478
26501
|
model: "qwen3.6-flash",
|
|
26479
26502
|
variant: "low"
|
|
26480
26503
|
},
|
|
@@ -26490,6 +26513,11 @@ var init_category_model_requirements = __esm(() => {
|
|
|
26490
26513
|
},
|
|
26491
26514
|
"unspecified-low": {
|
|
26492
26515
|
fallbackChain: [
|
|
26516
|
+
{
|
|
26517
|
+
providers: ["xai", "github-copilot", "opencode", "vercel"],
|
|
26518
|
+
model: "grok-4.6",
|
|
26519
|
+
variant: "xhigh"
|
|
26520
|
+
},
|
|
26493
26521
|
{
|
|
26494
26522
|
providers: ["openai", "quotio-openai", "github-copilot", "opencode", "vercel"],
|
|
26495
26523
|
model: "gpt-5.6-terra",
|
|
@@ -27724,6 +27752,7 @@ var init_context_limit_resolver2 = () => {};
|
|
|
27724
27752
|
|
|
27725
27753
|
// packages/omo-opencode/src/shared/normalize-sdk-response.ts
|
|
27726
27754
|
function normalizeSDKResponse(response, fallback, options) {
|
|
27755
|
+
const fallbackIsArray = Array.isArray(fallback);
|
|
27727
27756
|
if (response == null) {
|
|
27728
27757
|
return fallback;
|
|
27729
27758
|
}
|
|
@@ -27733,14 +27762,17 @@ function normalizeSDKResponse(response, fallback, options) {
|
|
|
27733
27762
|
if (typeof response === "object" && "data" in response) {
|
|
27734
27763
|
const data = response.data;
|
|
27735
27764
|
if (data != null) {
|
|
27765
|
+
if (fallbackIsArray && !Array.isArray(data)) {
|
|
27766
|
+
return fallback;
|
|
27767
|
+
}
|
|
27736
27768
|
return data;
|
|
27737
27769
|
}
|
|
27738
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
27770
|
+
if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
|
|
27739
27771
|
return response;
|
|
27740
27772
|
}
|
|
27741
27773
|
return fallback;
|
|
27742
27774
|
}
|
|
27743
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
27775
|
+
if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
|
|
27744
27776
|
return response;
|
|
27745
27777
|
}
|
|
27746
27778
|
return fallback;
|
|
@@ -28220,7 +28252,7 @@ This is NOT a default choice - it's for genuinely unclassifiable moderate-effort
|
|
|
28220
28252
|
</Category_Context>
|
|
28221
28253
|
|
|
28222
28254
|
<Caller_Warning>
|
|
28223
|
-
THIS CATEGORY USES
|
|
28255
|
+
THIS CATEGORY USES GROK 4.6 (xhigh).
|
|
28224
28256
|
|
|
28225
28257
|
**PROVIDE CLEAR STRUCTURE:**
|
|
28226
28258
|
1. MUST DO: Enumerate required actions explicitly
|
|
@@ -28252,7 +28284,7 @@ var init_openai_categories = __esm(() => {
|
|
|
28252
28284
|
},
|
|
28253
28285
|
{
|
|
28254
28286
|
name: "unspecified-low",
|
|
28255
|
-
config: { model: "
|
|
28287
|
+
config: { model: "xai/grok-4.6", variant: "xhigh" },
|
|
28256
28288
|
description: "Tasks that don't fit other categories, low effort required",
|
|
28257
28289
|
promptAppend: UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND
|
|
28258
28290
|
}
|
|
@@ -83149,6 +83181,47 @@ var init_model_capabilities_generated = __esm(() => {
|
|
|
83149
83181
|
input: 272000,
|
|
83150
83182
|
output: 128000
|
|
83151
83183
|
}
|
|
83184
|
+
},
|
|
83185
|
+
"grok-4.6": {
|
|
83186
|
+
id: "grok-4.6",
|
|
83187
|
+
family: "grok",
|
|
83188
|
+
reasoning: true,
|
|
83189
|
+
temperature: true,
|
|
83190
|
+
toolCall: true,
|
|
83191
|
+
modalities: {
|
|
83192
|
+
input: [
|
|
83193
|
+
"text",
|
|
83194
|
+
"image"
|
|
83195
|
+
],
|
|
83196
|
+
output: [
|
|
83197
|
+
"text"
|
|
83198
|
+
]
|
|
83199
|
+
},
|
|
83200
|
+
limit: {
|
|
83201
|
+
context: 500000,
|
|
83202
|
+
output: 500000
|
|
83203
|
+
}
|
|
83204
|
+
},
|
|
83205
|
+
"xai/grok-4.6": {
|
|
83206
|
+
id: "xai/grok-4.6",
|
|
83207
|
+
family: "grok",
|
|
83208
|
+
reasoning: true,
|
|
83209
|
+
temperature: true,
|
|
83210
|
+
toolCall: true,
|
|
83211
|
+
modalities: {
|
|
83212
|
+
input: [
|
|
83213
|
+
"text",
|
|
83214
|
+
"image",
|
|
83215
|
+
"pdf"
|
|
83216
|
+
],
|
|
83217
|
+
output: [
|
|
83218
|
+
"text"
|
|
83219
|
+
]
|
|
83220
|
+
},
|
|
83221
|
+
limit: {
|
|
83222
|
+
context: 500000,
|
|
83223
|
+
output: 500000
|
|
83224
|
+
}
|
|
83152
83225
|
}
|
|
83153
83226
|
}
|
|
83154
83227
|
};
|
|
@@ -83190,21 +83263,21 @@ var init_session_cursor = __esm(() => {
|
|
|
83190
83263
|
});
|
|
83191
83264
|
|
|
83192
83265
|
// packages/omo-opencode/src/shared/shell-env.ts
|
|
83193
|
-
function detectShellType() {
|
|
83194
|
-
if (
|
|
83195
|
-
const shell =
|
|
83266
|
+
function detectShellType(platform = process.platform, env2 = process.env) {
|
|
83267
|
+
if (env2.SHELL) {
|
|
83268
|
+
const shell = env2.SHELL;
|
|
83196
83269
|
if (shell.includes("csh") || shell.includes("tcsh")) {
|
|
83197
83270
|
return "csh";
|
|
83198
83271
|
}
|
|
83199
83272
|
return "unix";
|
|
83200
83273
|
}
|
|
83201
|
-
if (
|
|
83274
|
+
if (platform === "win32" && (env2.BASH_VERSION || env2.MSYSTEM || env2.WSL_DISTRO_NAME)) {
|
|
83202
83275
|
return "unix";
|
|
83203
83276
|
}
|
|
83204
|
-
if (
|
|
83277
|
+
if (env2.PSModulePath) {
|
|
83205
83278
|
return "powershell";
|
|
83206
83279
|
}
|
|
83207
|
-
return
|
|
83280
|
+
return platform === "win32" ? "cmd" : "unix";
|
|
83208
83281
|
}
|
|
83209
83282
|
var init_shell_env = () => {};
|
|
83210
83283
|
|
|
@@ -94557,7 +94630,7 @@ var package_default2;
|
|
|
94557
94630
|
var init_package2 = __esm(() => {
|
|
94558
94631
|
package_default2 = {
|
|
94559
94632
|
name: "@oh-my-opencode/omo-codex",
|
|
94560
|
-
version: "5.0.0-beta.
|
|
94633
|
+
version: "5.0.0-beta.9",
|
|
94561
94634
|
type: "module",
|
|
94562
94635
|
private: true,
|
|
94563
94636
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -95526,8 +95599,8 @@ var init_update_toasts = __esm(() => {
|
|
|
95526
95599
|
});
|
|
95527
95600
|
|
|
95528
95601
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
95529
|
-
import { existsSync as
|
|
95530
|
-
import { dirname as dirname30, join as
|
|
95602
|
+
import { existsSync as existsSync48 } from "fs";
|
|
95603
|
+
import { dirname as dirname30, join as join76 } from "path";
|
|
95531
95604
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
95532
95605
|
function defaultGetModuleHostingWorkspace() {
|
|
95533
95606
|
try {
|
|
@@ -95680,8 +95753,8 @@ var init_background_update_check = __esm(() => {
|
|
|
95680
95753
|
init_package_json_locator();
|
|
95681
95754
|
init_update_toasts();
|
|
95682
95755
|
defaultDeps4 = {
|
|
95683
|
-
existsSync:
|
|
95684
|
-
join:
|
|
95756
|
+
existsSync: existsSync48,
|
|
95757
|
+
join: join76,
|
|
95685
95758
|
runBunInstallWithDetails,
|
|
95686
95759
|
log: log2,
|
|
95687
95760
|
getOpenCodeCacheDir,
|
|
@@ -95844,7 +95917,7 @@ async function showSpinnerToast(ctx, version3, message) {
|
|
|
95844
95917
|
duration: frameInterval + 50
|
|
95845
95918
|
}
|
|
95846
95919
|
}).catch(ignoreToastError);
|
|
95847
|
-
await new Promise((
|
|
95920
|
+
await new Promise((resolve22) => setTimeout(resolve22, frameInterval));
|
|
95848
95921
|
}
|
|
95849
95922
|
}
|
|
95850
95923
|
var SISYPHUS_SPINNER;
|
|
@@ -101456,29 +101529,55 @@ function nodeErrorCode6(error51) {
|
|
|
101456
101529
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
101457
101530
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101458
101531
|
import { execFile as execFile4 } from "child_process";
|
|
101459
|
-
import { existsSync as
|
|
101460
|
-
import { homedir as
|
|
101461
|
-
import { dirname as dirname24, join as
|
|
101532
|
+
import { existsSync as existsSync32 } from "fs";
|
|
101533
|
+
import { homedir as homedir11 } from "os";
|
|
101534
|
+
import { dirname as dirname24, join as join63, resolve as resolve20 } from "path";
|
|
101462
101535
|
import { fileURLToPath } from "url";
|
|
101463
101536
|
import { promisify as promisify2 } from "util";
|
|
101464
101537
|
|
|
101465
|
-
// packages/omo-senpi/src/
|
|
101466
|
-
import {
|
|
101538
|
+
// packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
|
|
101539
|
+
import { existsSync as existsSync30 } from "fs";
|
|
101467
101540
|
import { homedir as homedir9 } from "os";
|
|
101468
|
-
import {
|
|
101541
|
+
import { join as join59, resolve as resolve17 } from "path";
|
|
101542
|
+
var AGENT_DIR_ENV_NAMES = [
|
|
101543
|
+
"OMO_CODING_AGENT_DIR",
|
|
101544
|
+
"SENPI_CODING_AGENT_DIR",
|
|
101545
|
+
"PI_CODING_AGENT_DIR"
|
|
101546
|
+
];
|
|
101547
|
+
var AGENT_HOME_SENTINEL = "settings.json";
|
|
101548
|
+
function resolveAgentHome(options) {
|
|
101549
|
+
const { env: env3, homeDir = homedir9(), exists: exists7 = existsSync30 } = options;
|
|
101550
|
+
for (const name of AGENT_DIR_ENV_NAMES) {
|
|
101551
|
+
const configured = env3[name]?.trim();
|
|
101552
|
+
if (configured)
|
|
101553
|
+
return resolve17(configured);
|
|
101554
|
+
}
|
|
101555
|
+
const brandedHome = join59(homeDir, ".omo");
|
|
101556
|
+
const canonical = join59(brandedHome, "agent");
|
|
101557
|
+
if (exists7(join59(canonical, AGENT_HOME_SENTINEL)))
|
|
101558
|
+
return canonical;
|
|
101559
|
+
if (exists7(join59(brandedHome, AGENT_HOME_SENTINEL)))
|
|
101560
|
+
return brandedHome;
|
|
101561
|
+
return join59(homeDir, ".senpi", "agent");
|
|
101562
|
+
}
|
|
101563
|
+
|
|
101564
|
+
// packages/omo-senpi/src/install/local-launcher.ts
|
|
101565
|
+
import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync, writeFileSync as writeFileSync6 } from "fs";
|
|
101566
|
+
import { homedir as homedir10 } from "os";
|
|
101567
|
+
import { dirname as dirname21, join as join60, resolve as resolve18 } from "path";
|
|
101469
101568
|
var MARKER = "omo-local-launcher";
|
|
101470
|
-
function localLauncherPath(homeDir =
|
|
101471
|
-
return
|
|
101569
|
+
function localLauncherPath(homeDir = homedir10()) {
|
|
101570
|
+
return join60(homeDir, ".local", "bin", "omo");
|
|
101472
101571
|
}
|
|
101473
|
-
function localLauncherCmdPath(homeDir =
|
|
101474
|
-
return
|
|
101572
|
+
function localLauncherCmdPath(homeDir = homedir10()) {
|
|
101573
|
+
return join60(homeDir, ".local", "bin", "omo.cmd");
|
|
101475
101574
|
}
|
|
101476
101575
|
function renderLocalLauncher(options) {
|
|
101477
101576
|
const brand = {
|
|
101478
101577
|
name: "omo",
|
|
101479
101578
|
displayVersion: options.version ?? "local",
|
|
101480
101579
|
configDir: ".omo",
|
|
101481
|
-
flatLayout:
|
|
101580
|
+
flatLayout: false,
|
|
101482
101581
|
envPrefix: "OMO",
|
|
101483
101582
|
userAgent: "omo",
|
|
101484
101583
|
originator: "omo",
|
|
@@ -101492,11 +101591,23 @@ function renderLocalLauncher(options) {
|
|
|
101492
101591
|
return `#!/usr/bin/env node
|
|
101493
101592
|
// ${MARKER}: generated by the omo-senpi installer. Delete this file to remove the local launcher.
|
|
101494
101593
|
import { spawn } from "node:child_process"
|
|
101594
|
+
import { homedir } from "node:os"
|
|
101595
|
+
import { join } from "node:path"
|
|
101495
101596
|
|
|
101496
101597
|
const brand = ${JSON.stringify(brand)}
|
|
101497
101598
|
const cli = process.env.OMO_SENPI_CLI_PATH ?? ${JSON.stringify(options.senpiCliPath)}
|
|
101498
101599
|
const plugin = process.env.OMO_PLUGIN_ROOT ?? ${JSON.stringify(options.pluginPath)}
|
|
101499
|
-
|
|
101600
|
+
// The same directory the published launcher pins, so a local install shares one state location
|
|
101601
|
+
// with the published one and with anything either of them spawns.
|
|
101602
|
+
const agentDir = process.env.OMO_CODING_AGENT_DIR ?? process.env.SENPI_CODING_AGENT_DIR
|
|
101603
|
+
?? process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".omo", "agent")
|
|
101604
|
+
const env = {
|
|
101605
|
+
...process.env,
|
|
101606
|
+
SENPI_BRAND: JSON.stringify(brand),
|
|
101607
|
+
OMO_NATIVE: "1",
|
|
101608
|
+
OMO_CODING_AGENT_DIR: agentDir,
|
|
101609
|
+
SENPI_CODING_AGENT_DIR: agentDir,
|
|
101610
|
+
}
|
|
101500
101611
|
// Anything resolving the product by name must re-enter through this launcher, never the engine.
|
|
101501
101612
|
env.OMO_BIN = process.argv[1]
|
|
101502
101613
|
const selfUpdate = process.argv[2] === "update"
|
|
@@ -101521,7 +101632,7 @@ child.on("close", (code, signal) => {
|
|
|
101521
101632
|
}
|
|
101522
101633
|
function installLocalLauncher(options) {
|
|
101523
101634
|
const path6 = localLauncherPath(options.homeDir);
|
|
101524
|
-
if (
|
|
101635
|
+
if (existsSync31(path6) && !readFileSync14(path6, "utf8").includes(MARKER))
|
|
101525
101636
|
return;
|
|
101526
101637
|
mkdirSync10(dirname21(path6), { recursive: true });
|
|
101527
101638
|
writeFileSync6(path6, renderLocalLauncher(options));
|
|
@@ -101538,16 +101649,16 @@ node "%~dp0omo" %*\r
|
|
|
101538
101649
|
import { createHash as createHash5 } from "crypto";
|
|
101539
101650
|
import { constants as constants8 } from "fs";
|
|
101540
101651
|
import { access as access2, readFile as readFile26, stat as stat6 } from "fs/promises";
|
|
101541
|
-
import { dirname as dirname23, join as
|
|
101652
|
+
import { dirname as dirname23, join as join62 } from "path";
|
|
101542
101653
|
|
|
101543
101654
|
// packages/omo-senpi/src/install/senpi-settings.ts
|
|
101544
101655
|
import { constants as constants7 } from "fs";
|
|
101545
101656
|
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "fs/promises";
|
|
101546
|
-
import { dirname as dirname22, join as
|
|
101657
|
+
import { dirname as dirname22, join as join61, resolve as resolve19 } from "path";
|
|
101547
101658
|
var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
|
|
101548
101659
|
var LEGACY_BUILTIN_SHADOW_PACKAGES = [
|
|
101549
|
-
|
|
101550
|
-
|
|
101660
|
+
join61("packages", "pi-goal"),
|
|
101661
|
+
join61("packages", "pi-webfetch")
|
|
101551
101662
|
];
|
|
101552
101663
|
async function readSettings(settingsPath) {
|
|
101553
101664
|
let raw;
|
|
@@ -101576,13 +101687,13 @@ function dedupePackages(packages) {
|
|
|
101576
101687
|
return [...new Set(packages)];
|
|
101577
101688
|
}
|
|
101578
101689
|
function removeLegacyBuiltinShadows(packages, repoRoot, agentDir) {
|
|
101579
|
-
const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) =>
|
|
101580
|
-
return packages.filter((entry) => !shadowPaths.has(
|
|
101690
|
+
const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) => resolve19(repoRoot, path6)));
|
|
101691
|
+
return packages.filter((entry) => !shadowPaths.has(resolve19(agentDir, entry)));
|
|
101581
101692
|
}
|
|
101582
101693
|
async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir) {
|
|
101583
|
-
const currentPath =
|
|
101694
|
+
const currentPath = resolve19(currentPluginPath);
|
|
101584
101695
|
const entries = await Promise.all(packages.map(async (entry) => {
|
|
101585
|
-
const packagePath =
|
|
101696
|
+
const packagePath = resolve19(agentDir, entry);
|
|
101586
101697
|
if (packagePath === currentPath)
|
|
101587
101698
|
return currentPath;
|
|
101588
101699
|
return await readPackageName(packagePath) === OMO_SENPI_PACKAGE_NAME ? undefined : entry;
|
|
@@ -101622,7 +101733,7 @@ function isRecord10(value) {
|
|
|
101622
101733
|
async function readPackageName(packagePath) {
|
|
101623
101734
|
let raw;
|
|
101624
101735
|
try {
|
|
101625
|
-
raw = await readFile25(
|
|
101736
|
+
raw = await readFile25(join61(packagePath, "package.json"), "utf8");
|
|
101626
101737
|
} catch (error51) {
|
|
101627
101738
|
if (isErrno(error51, "ENOENT") || isErrno(error51, "ENOTDIR"))
|
|
101628
101739
|
return;
|
|
@@ -101647,54 +101758,54 @@ function isErrno(error51, code) {
|
|
|
101647
101758
|
|
|
101648
101759
|
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101649
101760
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
101650
|
-
|
|
101651
|
-
|
|
101652
|
-
|
|
101653
|
-
|
|
101654
|
-
|
|
101655
|
-
|
|
101656
|
-
|
|
101657
|
-
|
|
101658
|
-
|
|
101659
|
-
|
|
101660
|
-
|
|
101661
|
-
|
|
101662
|
-
|
|
101663
|
-
|
|
101664
|
-
|
|
101665
|
-
|
|
101666
|
-
|
|
101667
|
-
|
|
101668
|
-
|
|
101669
|
-
|
|
101670
|
-
|
|
101671
|
-
|
|
101672
|
-
|
|
101673
|
-
|
|
101674
|
-
|
|
101675
|
-
|
|
101676
|
-
|
|
101677
|
-
|
|
101678
|
-
|
|
101679
|
-
|
|
101680
|
-
|
|
101681
|
-
|
|
101682
|
-
|
|
101683
|
-
|
|
101684
|
-
|
|
101685
|
-
|
|
101686
|
-
|
|
101687
|
-
|
|
101761
|
+
join62("extensions", "omo.js"),
|
|
101762
|
+
join62("extensions", "omo-task.js"),
|
|
101763
|
+
join62("extensions", "omo-member.js"),
|
|
101764
|
+
join62("extensions", "memory-run-supervisor.mjs"),
|
|
101765
|
+
join62("extensions", "reflection-persona.md"),
|
|
101766
|
+
join62("extensions", "dream-persona.md"),
|
|
101767
|
+
join62("extensions", "facts-persona.md"),
|
|
101768
|
+
join62("skills", "ast-grep", "SKILL.md"),
|
|
101769
|
+
join62("skills", "coding-agent-sessions", "SKILL.md"),
|
|
101770
|
+
join62("skills", "debugging", "SKILL.md"),
|
|
101771
|
+
join62("skills", "frontend", "SKILL.md"),
|
|
101772
|
+
join62("skills", "git-master", "SKILL.md"),
|
|
101773
|
+
join62("skills", "init-deep", "SKILL.md"),
|
|
101774
|
+
join62("skills", "lsp-setup", "SKILL.md"),
|
|
101775
|
+
join62("skills", "programming", "SKILL.md"),
|
|
101776
|
+
join62("skills", "refactor", "SKILL.md"),
|
|
101777
|
+
join62("skills", "remove-ai-slops", "SKILL.md"),
|
|
101778
|
+
join62("skills", "review-work", "SKILL.md"),
|
|
101779
|
+
join62("skills", "start-work", "SKILL.md"),
|
|
101780
|
+
join62("skills", "ultimate-browsing", "SKILL.md"),
|
|
101781
|
+
join62("skills", "ultrawork", "SKILL.md"),
|
|
101782
|
+
join62("skills", "ulw-loop", "SKILL.md"),
|
|
101783
|
+
join62("skills", "ulw-plan", "SKILL.md"),
|
|
101784
|
+
join62("skills", "ulw-research", "SKILL.md"),
|
|
101785
|
+
join62("skills", "visual-qa", "SKILL.md"),
|
|
101786
|
+
join62("runtime", "ast-grep-mcp", "cli.js"),
|
|
101787
|
+
join62("runtime", "agent-toolkit", "cli.js"),
|
|
101788
|
+
join62("runtime", "agent-toolkit", "ulw-loop", "cli.js"),
|
|
101789
|
+
join62("runtime", "agent-toolkit", "omo-agent-toolkit"),
|
|
101790
|
+
join62("runtime", "agent-toolkit", "omo-agent-toolkit.cmd"),
|
|
101791
|
+
join62("runtime", "lsp-daemon", "dist", "cli.js"),
|
|
101792
|
+
join62("runtime", "lsp-daemon", "dist", "index.js"),
|
|
101793
|
+
join62("runtime", "lsp-daemon", "dist", "index.d.ts"),
|
|
101794
|
+
join62("runtime", "lsp-daemon", "dist", "daemon-client.js"),
|
|
101795
|
+
join62("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
|
|
101796
|
+
join62("runtime", "lsp-daemon", "dist", "package.json"),
|
|
101797
|
+
join62("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
101798
|
+
join62("scripts", "install.mjs")
|
|
101688
101799
|
];
|
|
101689
101800
|
async function ensurePluginArtifacts(context) {
|
|
101690
101801
|
if (context.allowBuild) {
|
|
101691
|
-
await context.runCommand("node", [
|
|
101692
|
-
await context.runCommand("node", [
|
|
101693
|
-
await context.runCommand("node", [
|
|
101694
|
-
await context.runCommand("node", [
|
|
101695
|
-
await context.runCommand("node", [
|
|
101696
|
-
await context.runCommand("node", [
|
|
101697
|
-
await context.runCommand("node", [
|
|
101802
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
101803
|
+
await context.runCommand("node", [join62("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
|
|
101804
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
101805
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
|
|
101806
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
|
|
101807
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
|
|
101808
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-agent-toolkit.mjs")], { cwd: context.repoRoot });
|
|
101698
101809
|
}
|
|
101699
101810
|
if (await hasMissingPluginArtifact(context.pluginPath)) {
|
|
101700
101811
|
throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
|
|
@@ -101703,14 +101814,14 @@ async function ensurePluginArtifacts(context) {
|
|
|
101703
101814
|
}
|
|
101704
101815
|
async function hasMissingPluginArtifact(pluginPath) {
|
|
101705
101816
|
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
101706
|
-
if (!await fileExists2(
|
|
101817
|
+
if (!await fileExists2(join62(pluginPath, artifact)))
|
|
101707
101818
|
return true;
|
|
101708
101819
|
}
|
|
101709
101820
|
return false;
|
|
101710
101821
|
}
|
|
101711
101822
|
async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
|
|
101712
|
-
const runtimeEntry =
|
|
101713
|
-
const manifestPath =
|
|
101823
|
+
const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
|
|
101824
|
+
const manifestPath = join62(dirname23(runtimeEntry), "manifest.json");
|
|
101714
101825
|
let runtimeStat;
|
|
101715
101826
|
try {
|
|
101716
101827
|
runtimeStat = await stat6(runtimeEntry);
|
|
@@ -101785,7 +101896,7 @@ async function runSenpiInstaller(options = {}) {
|
|
|
101785
101896
|
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101786
101897
|
installLocalLauncher({
|
|
101787
101898
|
pluginPath: context.pluginPath,
|
|
101788
|
-
senpiCliPath:
|
|
101899
|
+
senpiCliPath: join63(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
|
|
101789
101900
|
});
|
|
101790
101901
|
return {
|
|
101791
101902
|
ok: true,
|
|
@@ -101800,14 +101911,14 @@ async function runSenpiInstaller(options = {}) {
|
|
|
101800
101911
|
function resolveInstallContext(options) {
|
|
101801
101912
|
const env3 = options.env ?? process.env;
|
|
101802
101913
|
const allowBuild = options.pluginPath === undefined;
|
|
101803
|
-
const repoRoot =
|
|
101804
|
-
const agentDir =
|
|
101805
|
-
const pluginPath =
|
|
101914
|
+
const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve20(options.pluginPath))));
|
|
101915
|
+
const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env: env3, homeDir: env3.HOME ?? homedir11() }));
|
|
101916
|
+
const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101806
101917
|
return {
|
|
101807
101918
|
env: env3,
|
|
101808
101919
|
repoRoot,
|
|
101809
101920
|
agentDir,
|
|
101810
|
-
settingsPath:
|
|
101921
|
+
settingsPath: join63(agentDir, "settings.json"),
|
|
101811
101922
|
pluginPath,
|
|
101812
101923
|
platform: options.platform ?? process.platform,
|
|
101813
101924
|
allowBuild,
|
|
@@ -101824,14 +101935,14 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
101824
101935
|
function findRepoRoot2(importerDir) {
|
|
101825
101936
|
let current = importerDir;
|
|
101826
101937
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
101827
|
-
if (fileExistsSync(
|
|
101938
|
+
if (fileExistsSync(join63(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
101828
101939
|
return current;
|
|
101829
|
-
current =
|
|
101940
|
+
current = resolve20(current, "..");
|
|
101830
101941
|
}
|
|
101831
101942
|
throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
|
|
101832
101943
|
}
|
|
101833
101944
|
function fileExistsSync(path6) {
|
|
101834
|
-
return
|
|
101945
|
+
return existsSync32(path6);
|
|
101835
101946
|
}
|
|
101836
101947
|
// packages/omo-opencode/src/cli/star-request.ts
|
|
101837
101948
|
import { execFile as execFile5 } from "child_process";
|
|
@@ -101867,23 +101978,23 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
|
|
|
101867
101978
|
init_provider_availability();
|
|
101868
101979
|
|
|
101869
101980
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
101870
|
-
import { existsSync as
|
|
101871
|
-
import { join as
|
|
101981
|
+
import { existsSync as existsSync34, mkdirSync as mkdirSync11, readFileSync as readFileSync16 } from "fs";
|
|
101982
|
+
import { join as join65 } from "path";
|
|
101872
101983
|
|
|
101873
101984
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
101874
101985
|
init_shared();
|
|
101875
|
-
import { existsSync as
|
|
101876
|
-
import { join as
|
|
101986
|
+
import { existsSync as existsSync33, readFileSync as readFileSync15 } from "fs";
|
|
101987
|
+
import { join as join64 } from "path";
|
|
101877
101988
|
var TUI_SUBPATH = "tui";
|
|
101878
101989
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
101879
101990
|
function fileEntryPackageJsonPath(entry) {
|
|
101880
101991
|
let path6 = entry.slice("file:".length);
|
|
101881
101992
|
if (path6.startsWith("//"))
|
|
101882
101993
|
path6 = path6.slice(2);
|
|
101883
|
-
return
|
|
101994
|
+
return join64(path6, "package.json");
|
|
101884
101995
|
}
|
|
101885
101996
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
101886
|
-
if (!
|
|
101997
|
+
if (!existsSync33(pkgJsonPath))
|
|
101887
101998
|
return null;
|
|
101888
101999
|
try {
|
|
101889
102000
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
@@ -101918,14 +102029,14 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
101918
102029
|
const packageName = packageNameFromServerEntry(entry);
|
|
101919
102030
|
if (packageName === null)
|
|
101920
102031
|
return null;
|
|
101921
|
-
return packageJsonExportsTui(
|
|
102032
|
+
return packageJsonExportsTui(join64(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
101922
102033
|
}
|
|
101923
102034
|
function isOurFilePluginEntry(entry) {
|
|
101924
102035
|
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
101925
102036
|
return false;
|
|
101926
102037
|
try {
|
|
101927
102038
|
const pkgJsonPath = fileEntryPackageJsonPath(entry);
|
|
101928
|
-
if (!
|
|
102039
|
+
if (!existsSync33(pkgJsonPath))
|
|
101929
102040
|
return false;
|
|
101930
102041
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
101931
102042
|
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
|
|
@@ -101960,7 +102071,7 @@ function isCanonicalNamedTuiPluginEntry(entry) {
|
|
|
101960
102071
|
}
|
|
101961
102072
|
function detectServerPluginRegistration() {
|
|
101962
102073
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
101963
|
-
const configPath =
|
|
102074
|
+
const configPath = existsSync33(paths2.configJsonc) ? paths2.configJsonc : existsSync33(paths2.configJson) ? paths2.configJson : null;
|
|
101964
102075
|
if (!configPath) {
|
|
101965
102076
|
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
|
|
101966
102077
|
}
|
|
@@ -101983,8 +102094,8 @@ function detectServerPluginRegistration() {
|
|
|
101983
102094
|
}
|
|
101984
102095
|
}
|
|
101985
102096
|
function detectTuiPluginRegistration() {
|
|
101986
|
-
const tuiJsonPath =
|
|
101987
|
-
if (!
|
|
102097
|
+
const tuiJsonPath = join64(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
102098
|
+
if (!existsSync33(tuiJsonPath)) {
|
|
101988
102099
|
return {
|
|
101989
102100
|
registered: false,
|
|
101990
102101
|
configPath: tuiJsonPath,
|
|
@@ -102139,11 +102250,11 @@ function readConfig(path6) {
|
|
|
102139
102250
|
return null;
|
|
102140
102251
|
}
|
|
102141
102252
|
function readServerConfig(configDir) {
|
|
102142
|
-
const jsoncPath =
|
|
102143
|
-
if (
|
|
102253
|
+
const jsoncPath = join65(configDir, "opencode.jsonc");
|
|
102254
|
+
if (existsSync34(jsoncPath))
|
|
102144
102255
|
return readConfig(jsoncPath);
|
|
102145
|
-
const jsonPath =
|
|
102146
|
-
if (
|
|
102256
|
+
const jsonPath = join65(configDir, "opencode.json");
|
|
102257
|
+
if (existsSync34(jsonPath))
|
|
102147
102258
|
return readConfig(jsonPath);
|
|
102148
102259
|
return null;
|
|
102149
102260
|
}
|
|
@@ -102163,7 +102274,7 @@ function desiredTuiEntry(serverEntry) {
|
|
|
102163
102274
|
return null;
|
|
102164
102275
|
}
|
|
102165
102276
|
function readTuiConfig(tuiJsonPath) {
|
|
102166
|
-
if (!
|
|
102277
|
+
if (!existsSync34(tuiJsonPath)) {
|
|
102167
102278
|
return { config: {}, malformed: false };
|
|
102168
102279
|
}
|
|
102169
102280
|
const config3 = readConfig(tuiJsonPath);
|
|
@@ -102184,7 +102295,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102184
102295
|
if (!desiredEntry) {
|
|
102185
102296
|
return { changed: false, reason: "no-server-entry" };
|
|
102186
102297
|
}
|
|
102187
|
-
const tuiJsonPath =
|
|
102298
|
+
const tuiJsonPath = join65(configDir, "tui.json");
|
|
102188
102299
|
const { config: config3, malformed } = readTuiConfig(tuiJsonPath);
|
|
102189
102300
|
if (malformed) {
|
|
102190
102301
|
return { changed: false, reason: "malformed" };
|
|
@@ -102199,16 +102310,16 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102199
102310
|
}
|
|
102200
102311
|
|
|
102201
102312
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
102202
|
-
import { homedir as
|
|
102203
|
-
import { join as
|
|
102313
|
+
import { homedir as homedir12 } from "os";
|
|
102314
|
+
import { join as join66 } from "path";
|
|
102204
102315
|
|
|
102205
102316
|
// packages/shared-skills/index.mjs
|
|
102206
|
-
import { existsSync as
|
|
102317
|
+
import { existsSync as existsSync35 } from "fs";
|
|
102207
102318
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
102208
102319
|
var SKILLS_PROBE_SPECIFIERS = ["./skills/", "../skills/", "../../skills/"];
|
|
102209
102320
|
function sharedSkillsRootPath() {
|
|
102210
102321
|
const candidates = SKILLS_PROBE_SPECIFIERS.map((specifier) => fileURLToPath2(new URL(specifier, import.meta.url)));
|
|
102211
|
-
return candidates.find((candidate2) =>
|
|
102322
|
+
return candidates.find((candidate2) => existsSync35(candidate2)) ?? candidates[0];
|
|
102212
102323
|
}
|
|
102213
102324
|
|
|
102214
102325
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
@@ -102222,9 +102333,9 @@ function describeResult2(result) {
|
|
|
102222
102333
|
}
|
|
102223
102334
|
async function installAstGrepForOpenCode(options = {}) {
|
|
102224
102335
|
const platform = options.platform ?? process.platform;
|
|
102225
|
-
const baseDir =
|
|
102336
|
+
const baseDir = join66(options.homeDir ?? homedir12(), ".omo");
|
|
102226
102337
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
102227
|
-
const skillDir =
|
|
102338
|
+
const skillDir = join66(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
102228
102339
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
102229
102340
|
try {
|
|
102230
102341
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -106254,7 +106365,7 @@ async function resolveSession(options) {
|
|
|
106254
106365
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
106255
106366
|
const delay2 = retryDelayMs * attempt;
|
|
106256
106367
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
106257
|
-
await new Promise((
|
|
106368
|
+
await new Promise((resolve21) => setTimeout(resolve21, delay2));
|
|
106258
106369
|
}
|
|
106259
106370
|
continue;
|
|
106260
106371
|
}
|
|
@@ -106265,7 +106376,7 @@ async function resolveSession(options) {
|
|
|
106265
106376
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
106266
106377
|
const delay2 = retryDelayMs * attempt;
|
|
106267
106378
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
106268
|
-
await new Promise((
|
|
106379
|
+
await new Promise((resolve21) => setTimeout(resolve21, delay2));
|
|
106269
106380
|
}
|
|
106270
106381
|
}
|
|
106271
106382
|
throw new Error("Failed to create session after all retries");
|
|
@@ -106304,7 +106415,7 @@ function createJsonOutputManager(options = {}) {
|
|
|
106304
106415
|
|
|
106305
106416
|
// packages/omo-opencode/src/cli/run/on-complete-hook.ts
|
|
106306
106417
|
init_spawn_with_windows_hide();
|
|
106307
|
-
|
|
106418
|
+
init_shell_env();
|
|
106308
106419
|
init_logger2();
|
|
106309
106420
|
var defaultDeps3 = {
|
|
106310
106421
|
spawnWithWindowsHide,
|
|
@@ -106324,15 +106435,15 @@ async function readOutput(stream, streamName, deps = defaultDeps3) {
|
|
|
106324
106435
|
return "";
|
|
106325
106436
|
}
|
|
106326
106437
|
}
|
|
106327
|
-
function resolveHookShellCommand(command) {
|
|
106328
|
-
const shellType = detectShellType();
|
|
106438
|
+
function resolveHookShellCommand(command, platform, env3) {
|
|
106439
|
+
const shellType = detectShellType(platform, env3);
|
|
106329
106440
|
switch (shellType) {
|
|
106330
106441
|
case "powershell": {
|
|
106331
|
-
const powershellExecutable =
|
|
106442
|
+
const powershellExecutable = platform === "win32" ? "powershell.exe" : "pwsh";
|
|
106332
106443
|
return [powershellExecutable, "-NoProfile", "-Command", command];
|
|
106333
106444
|
}
|
|
106334
106445
|
case "cmd":
|
|
106335
|
-
return [
|
|
106446
|
+
return [env3.ComSpec || "cmd.exe", "/d", "/s", "/c", command];
|
|
106336
106447
|
case "csh":
|
|
106337
106448
|
return ["csh", "-c", command];
|
|
106338
106449
|
case "unix":
|
|
@@ -106348,10 +106459,12 @@ async function executeOnCompleteHook(options, deps = defaultDeps3) {
|
|
|
106348
106459
|
}
|
|
106349
106460
|
deps.log("Running on-complete hook", { command: trimmedCommand });
|
|
106350
106461
|
try {
|
|
106351
|
-
const
|
|
106462
|
+
const platform = deps.platform ?? process.platform;
|
|
106463
|
+
const env3 = deps.env ?? process.env;
|
|
106464
|
+
const shellCommand = resolveHookShellCommand(trimmedCommand, platform, env3);
|
|
106352
106465
|
const proc = deps.spawnWithWindowsHide(shellCommand, {
|
|
106353
106466
|
env: {
|
|
106354
|
-
...
|
|
106467
|
+
...env3,
|
|
106355
106468
|
SESSION_ID: sessionId,
|
|
106356
106469
|
EXIT_CODE: String(exitCode),
|
|
106357
106470
|
DURATION_MS: String(durationMs),
|
|
@@ -106663,9 +106776,9 @@ function isClosingFence(line, fence) {
|
|
|
106663
106776
|
return run?.charAt(0) === fence.marker && run.length >= fence.length;
|
|
106664
106777
|
}
|
|
106665
106778
|
// packages/boulder-state/src/top-level-task.ts
|
|
106666
|
-
import { existsSync as
|
|
106779
|
+
import { existsSync as existsSync36, readFileSync as readFileSync17 } from "fs";
|
|
106667
106780
|
function readCurrentTopLevelTask(planPath) {
|
|
106668
|
-
if (!
|
|
106781
|
+
if (!existsSync36(planPath)) {
|
|
106669
106782
|
return null;
|
|
106670
106783
|
}
|
|
106671
106784
|
try {
|
|
@@ -106676,13 +106789,13 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
106676
106789
|
}
|
|
106677
106790
|
}
|
|
106678
106791
|
// packages/boulder-state/src/storage/path.ts
|
|
106679
|
-
import { existsSync as
|
|
106680
|
-
import { isAbsolute as isAbsolute11, join as
|
|
106792
|
+
import { existsSync as existsSync37 } from "fs";
|
|
106793
|
+
import { isAbsolute as isAbsolute11, join as join67, relative as relative8, resolve as resolve21 } from "path";
|
|
106681
106794
|
function getBoulderFilePath(directory) {
|
|
106682
|
-
return
|
|
106795
|
+
return join67(directory, BOULDER_DIR, BOULDER_FILE);
|
|
106683
106796
|
}
|
|
106684
106797
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
106685
|
-
return isAbsolute11(trackedPath) ?
|
|
106798
|
+
return isAbsolute11(trackedPath) ? resolve21(trackedPath) : resolve21(baseDirectory, trackedPath);
|
|
106686
106799
|
}
|
|
106687
106800
|
function resolveBoulderPlanPath(directory, state) {
|
|
106688
106801
|
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
|
|
@@ -106690,22 +106803,22 @@ function resolveBoulderPlanPath(directory, state) {
|
|
|
106690
106803
|
if (!worktreePath) {
|
|
106691
106804
|
return absolutePlanPath;
|
|
106692
106805
|
}
|
|
106693
|
-
const absoluteDirectory =
|
|
106806
|
+
const absoluteDirectory = resolve21(directory);
|
|
106694
106807
|
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
|
|
106695
106808
|
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
|
|
106696
106809
|
return absolutePlanPath;
|
|
106697
106810
|
}
|
|
106698
106811
|
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
|
|
106699
|
-
const worktreePlanPath =
|
|
106700
|
-
return
|
|
106812
|
+
const worktreePlanPath = resolve21(absoluteWorktreePath, relativePlanPath);
|
|
106813
|
+
return existsSync37(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
|
|
106701
106814
|
}
|
|
106702
106815
|
function resolveBoulderPlanPathForWork(directory, work) {
|
|
106703
106816
|
return resolveBoulderPlanPath(directory, work);
|
|
106704
106817
|
}
|
|
106705
106818
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
106706
|
-
import { existsSync as
|
|
106819
|
+
import { existsSync as existsSync38, readFileSync as readFileSync18, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
106707
106820
|
function getPlanProgress(planPath) {
|
|
106708
|
-
if (!
|
|
106821
|
+
if (!existsSync38(planPath)) {
|
|
106709
106822
|
return { total: 0, completed: 0, isComplete: false };
|
|
106710
106823
|
}
|
|
106711
106824
|
try {
|
|
@@ -106788,10 +106901,10 @@ function selectMirrorWork(state) {
|
|
|
106788
106901
|
return sorted[0] ?? null;
|
|
106789
106902
|
}
|
|
106790
106903
|
// packages/boulder-state/src/storage/read-state.ts
|
|
106791
|
-
import { existsSync as
|
|
106904
|
+
import { existsSync as existsSync39, readFileSync as readFileSync19 } from "fs";
|
|
106792
106905
|
function readBoulderState(directory) {
|
|
106793
106906
|
const filePath = getBoulderFilePath(directory);
|
|
106794
|
-
if (!
|
|
106907
|
+
if (!existsSync39(filePath)) {
|
|
106795
106908
|
return null;
|
|
106796
106909
|
}
|
|
106797
106910
|
try {
|
|
@@ -106861,14 +106974,14 @@ init_state();
|
|
|
106861
106974
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
106862
106975
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
106863
106976
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
106864
|
-
import { existsSync as
|
|
106865
|
-
import { join as
|
|
106977
|
+
import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
106978
|
+
import { join as join68 } from "path";
|
|
106866
106979
|
function getMarkerPath(directory, sessionID) {
|
|
106867
|
-
return
|
|
106980
|
+
return join68(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
106868
106981
|
}
|
|
106869
106982
|
function readContinuationMarker(directory, sessionID) {
|
|
106870
106983
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
106871
|
-
if (!
|
|
106984
|
+
if (!existsSync40(markerPath))
|
|
106872
106985
|
return null;
|
|
106873
106986
|
try {
|
|
106874
106987
|
const raw = readFileSync20(markerPath, "utf-8");
|
|
@@ -106937,7 +107050,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
106937
107050
|
init_shared();
|
|
106938
107051
|
init_compaction_marker();
|
|
106939
107052
|
import { readFileSync as readFileSync21, readdirSync as readdirSync8 } from "fs";
|
|
106940
|
-
import { join as
|
|
107053
|
+
import { join as join69 } from "path";
|
|
106941
107054
|
var defaultSessionLastAgentDeps = {
|
|
106942
107055
|
getMessageDir,
|
|
106943
107056
|
isSqliteBackend,
|
|
@@ -106997,7 +107110,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
106997
107110
|
try {
|
|
106998
107111
|
const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
106999
107112
|
try {
|
|
107000
|
-
const content = readFileSync21(
|
|
107113
|
+
const content = readFileSync21(join69(messageDir, fileName), "utf-8");
|
|
107001
107114
|
const parsed = JSON.parse(content);
|
|
107002
107115
|
return {
|
|
107003
107116
|
fileName,
|
|
@@ -107040,8 +107153,8 @@ init_agent_display_names();
|
|
|
107040
107153
|
|
|
107041
107154
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
107042
107155
|
init_frontmatter2();
|
|
107043
|
-
import { existsSync as
|
|
107044
|
-
import { dirname as dirname26, join as
|
|
107156
|
+
import { existsSync as existsSync41, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
|
|
107157
|
+
import { dirname as dirname26, join as join70 } from "path";
|
|
107045
107158
|
|
|
107046
107159
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
107047
107160
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -107050,11 +107163,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
107050
107163
|
|
|
107051
107164
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
107052
107165
|
function getStateFilePath(directory, customPath) {
|
|
107053
|
-
return customPath ?
|
|
107166
|
+
return customPath ? join70(directory, customPath) : join70(directory, DEFAULT_STATE_FILE);
|
|
107054
107167
|
}
|
|
107055
107168
|
function readState(directory, customPath) {
|
|
107056
107169
|
const filePath = getStateFilePath(directory, customPath);
|
|
107057
|
-
if (!
|
|
107170
|
+
if (!existsSync41(filePath)) {
|
|
107058
107171
|
return null;
|
|
107059
107172
|
}
|
|
107060
107173
|
try {
|
|
@@ -107284,7 +107397,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
|
|
|
107284
107397
|
const secondaryMeaningfulWorkTimeoutMs = options.secondaryMeaningfulWorkTimeoutMs ?? DEFAULT_SECONDARY_MEANINGFUL_WORK_TIMEOUT_MS;
|
|
107285
107398
|
const requireMeaningfulWork = options.requireMeaningfulWork ?? false;
|
|
107286
107399
|
const now = options.now ?? Date.now;
|
|
107287
|
-
const sleep = options.sleep ?? ((ms) => new Promise((
|
|
107400
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve22) => setTimeout(resolve22, ms)));
|
|
107288
107401
|
let consecutiveCompleteChecks = 0;
|
|
107289
107402
|
let errorCycleCount = 0;
|
|
107290
107403
|
let firstWorkTimestamp = null;
|
|
@@ -107449,7 +107562,7 @@ function createAbortError() {
|
|
|
107449
107562
|
return error51;
|
|
107450
107563
|
}
|
|
107451
107564
|
function sleep(delayMs) {
|
|
107452
|
-
return new Promise((
|
|
107565
|
+
return new Promise((resolve22) => setTimeout(resolve22, delayMs));
|
|
107453
107566
|
}
|
|
107454
107567
|
function hasPromptStartEvidence(eventState) {
|
|
107455
107568
|
return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
|
|
@@ -107824,7 +107937,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
|
|
|
107824
107937
|
async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
|
|
107825
107938
|
const completed = await Promise.race([
|
|
107826
107939
|
eventProcessor.then(() => true),
|
|
107827
|
-
new Promise((
|
|
107940
|
+
new Promise((resolve22) => setTimeout(() => resolve22(false), timeoutMs))
|
|
107828
107941
|
]);
|
|
107829
107942
|
}
|
|
107830
107943
|
async function run(options) {
|
|
@@ -108150,14 +108263,14 @@ async function getLocalVersion(options = {}) {
|
|
|
108150
108263
|
}
|
|
108151
108264
|
}
|
|
108152
108265
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
108153
|
-
import { existsSync as
|
|
108266
|
+
import { existsSync as existsSync52, readFileSync as readFileSync32 } from "fs";
|
|
108154
108267
|
|
|
108155
108268
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
108156
108269
|
init_extract_semver();
|
|
108157
108270
|
init_bun_which_shim();
|
|
108158
|
-
import { existsSync as
|
|
108159
|
-
import { homedir as
|
|
108160
|
-
import { join as
|
|
108271
|
+
import { existsSync as existsSync49, accessSync as accessSync4, constants as constants11 } from "fs";
|
|
108272
|
+
import { homedir as homedir15 } from "os";
|
|
108273
|
+
import { join as join77 } from "path";
|
|
108161
108274
|
|
|
108162
108275
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
108163
108276
|
init_spawn_with_windows_hide();
|
|
@@ -108196,8 +108309,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
108196
108309
|
const stdoutPromise = readSpawnStream(proc.stdout);
|
|
108197
108310
|
const stderrPromise = readSpawnStream(proc.stderr);
|
|
108198
108311
|
let timer;
|
|
108199
|
-
const timeoutPromise = new Promise((
|
|
108200
|
-
timer = setTimeout(() =>
|
|
108312
|
+
const timeoutPromise = new Promise((resolve22) => {
|
|
108313
|
+
timer = setTimeout(() => resolve22("timeout"), timeoutMs);
|
|
108201
108314
|
});
|
|
108202
108315
|
const processPromise = (async () => {
|
|
108203
108316
|
await proc.exited;
|
|
@@ -108244,22 +108357,22 @@ function isExecutable2(path12) {
|
|
|
108244
108357
|
}
|
|
108245
108358
|
}
|
|
108246
108359
|
function getDesktopAppPaths(platform) {
|
|
108247
|
-
const home =
|
|
108360
|
+
const home = homedir15();
|
|
108248
108361
|
switch (platform) {
|
|
108249
108362
|
case "darwin":
|
|
108250
108363
|
return [
|
|
108251
108364
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
108252
|
-
|
|
108365
|
+
join77(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
108253
108366
|
];
|
|
108254
108367
|
case "win32": {
|
|
108255
108368
|
const programFiles = process.env.ProgramFiles;
|
|
108256
108369
|
const localAppData = process.env.LOCALAPPDATA;
|
|
108257
108370
|
const paths2 = [];
|
|
108258
108371
|
if (programFiles) {
|
|
108259
|
-
paths2.push(
|
|
108372
|
+
paths2.push(join77(programFiles, "OpenCode", "OpenCode.exe"));
|
|
108260
108373
|
}
|
|
108261
108374
|
if (localAppData) {
|
|
108262
|
-
paths2.push(
|
|
108375
|
+
paths2.push(join77(localAppData, "OpenCode", "OpenCode.exe"));
|
|
108263
108376
|
}
|
|
108264
108377
|
return paths2;
|
|
108265
108378
|
}
|
|
@@ -108267,8 +108380,8 @@ function getDesktopAppPaths(platform) {
|
|
|
108267
108380
|
return [
|
|
108268
108381
|
"/usr/bin/opencode",
|
|
108269
108382
|
"/usr/lib/opencode/opencode",
|
|
108270
|
-
|
|
108271
|
-
|
|
108383
|
+
join77(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
108384
|
+
join77(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
108272
108385
|
];
|
|
108273
108386
|
default:
|
|
108274
108387
|
return [];
|
|
@@ -108280,7 +108393,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
108280
108393
|
}
|
|
108281
108394
|
return [binaryPath, "--version"];
|
|
108282
108395
|
}
|
|
108283
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
108396
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync49) {
|
|
108284
108397
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
108285
108398
|
if (checkExists(desktopPath)) {
|
|
108286
108399
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -108288,7 +108401,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
108288
108401
|
}
|
|
108289
108402
|
return null;
|
|
108290
108403
|
}
|
|
108291
|
-
async function findOpenCodeBinary(platform = process.platform, checkExists =
|
|
108404
|
+
async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync49) {
|
|
108292
108405
|
for (const binary of OPENCODE_BINARIES2) {
|
|
108293
108406
|
const path12 = bunWhich(binary);
|
|
108294
108407
|
if (path12 && checkExists(path12)) {
|
|
@@ -108300,7 +108413,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
108300
108413
|
const candidates = getCommandCandidates2(platform);
|
|
108301
108414
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
108302
108415
|
for (const command of candidates) {
|
|
108303
|
-
const fullPath =
|
|
108416
|
+
const fullPath = join77(entry, command);
|
|
108304
108417
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
108305
108418
|
return { binary: command, path: fullPath };
|
|
108306
108419
|
}
|
|
@@ -108346,12 +108459,12 @@ function compareVersions3(current, minimum) {
|
|
|
108346
108459
|
|
|
108347
108460
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
108348
108461
|
init_shared();
|
|
108349
|
-
import { existsSync as
|
|
108462
|
+
import { existsSync as existsSync50, readFileSync as readFileSync30 } from "fs";
|
|
108350
108463
|
function detectConfigPath() {
|
|
108351
108464
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
108352
|
-
if (
|
|
108465
|
+
if (existsSync50(paths2.configJsonc))
|
|
108353
108466
|
return paths2.configJsonc;
|
|
108354
|
-
if (
|
|
108467
|
+
if (existsSync50(paths2.configJson))
|
|
108355
108468
|
return paths2.configJson;
|
|
108356
108469
|
return null;
|
|
108357
108470
|
}
|
|
@@ -108439,36 +108552,36 @@ init_file_utils2();
|
|
|
108439
108552
|
init_checker();
|
|
108440
108553
|
init_auto_update_checker();
|
|
108441
108554
|
init_package_json_locator();
|
|
108442
|
-
import { existsSync as
|
|
108555
|
+
import { existsSync as existsSync51, readFileSync as readFileSync31, readdirSync as readdirSync10 } from "fs";
|
|
108443
108556
|
import { createRequire as createRequire2 } from "module";
|
|
108444
|
-
import { homedir as
|
|
108445
|
-
import { join as
|
|
108557
|
+
import { homedir as homedir16 } from "os";
|
|
108558
|
+
import { join as join78 } from "path";
|
|
108446
108559
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
108447
108560
|
init_shared();
|
|
108448
108561
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
108449
108562
|
if (platform === "darwin")
|
|
108450
|
-
return
|
|
108563
|
+
return join78(homedir16(), "Library", "Caches");
|
|
108451
108564
|
if (platform === "win32")
|
|
108452
|
-
return process.env.LOCALAPPDATA ??
|
|
108453
|
-
return
|
|
108565
|
+
return process.env.LOCALAPPDATA ?? join78(homedir16(), "AppData", "Local");
|
|
108566
|
+
return join78(homedir16(), ".cache");
|
|
108454
108567
|
}
|
|
108455
108568
|
function resolveOpenCodeCacheDir() {
|
|
108456
108569
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
108457
108570
|
if (xdgCacheHome)
|
|
108458
|
-
return
|
|
108571
|
+
return join78(xdgCacheHome, "opencode");
|
|
108459
108572
|
const fromShared = getOpenCodeCacheDir();
|
|
108460
|
-
const platformDefault =
|
|
108461
|
-
if (
|
|
108573
|
+
const platformDefault = join78(getPlatformDefaultCacheDir(), "opencode");
|
|
108574
|
+
if (existsSync51(fromShared) || !existsSync51(platformDefault))
|
|
108462
108575
|
return fromShared;
|
|
108463
108576
|
return platformDefault;
|
|
108464
108577
|
}
|
|
108465
108578
|
function resolveExistingDir(dirPath) {
|
|
108466
|
-
if (!
|
|
108579
|
+
if (!existsSync51(dirPath))
|
|
108467
108580
|
return dirPath;
|
|
108468
108581
|
return resolveSymlink(dirPath);
|
|
108469
108582
|
}
|
|
108470
108583
|
function readPackageJson(filePath) {
|
|
108471
|
-
if (!
|
|
108584
|
+
if (!existsSync51(filePath))
|
|
108472
108585
|
return null;
|
|
108473
108586
|
try {
|
|
108474
108587
|
const content = readFileSync31(filePath, "utf-8");
|
|
@@ -108489,26 +108602,26 @@ function normalizeVersion(value) {
|
|
|
108489
108602
|
function createPackageCandidates(rootDir) {
|
|
108490
108603
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
108491
108604
|
packageName,
|
|
108492
|
-
installedPackagePath:
|
|
108605
|
+
installedPackagePath: join78(rootDir, "node_modules", packageName, "package.json")
|
|
108493
108606
|
}));
|
|
108494
108607
|
}
|
|
108495
108608
|
function createTaggedInstallCandidates(rootDir) {
|
|
108496
|
-
const packagesDir =
|
|
108497
|
-
if (!
|
|
108609
|
+
const packagesDir = join78(rootDir, "packages");
|
|
108610
|
+
if (!existsSync51(packagesDir))
|
|
108498
108611
|
return [];
|
|
108499
108612
|
const candidates = [];
|
|
108500
108613
|
for (const entryName of readdirSync10(packagesDir).sort()) {
|
|
108501
108614
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
108502
108615
|
if (packageName === undefined)
|
|
108503
108616
|
continue;
|
|
108504
|
-
const installDir =
|
|
108617
|
+
const installDir = join78(packagesDir, entryName);
|
|
108505
108618
|
candidates.push({
|
|
108506
108619
|
cacheDir: installDir,
|
|
108507
|
-
cachePackagePath:
|
|
108620
|
+
cachePackagePath: join78(installDir, "package.json"),
|
|
108508
108621
|
packageCandidates: [
|
|
108509
108622
|
{
|
|
108510
108623
|
packageName,
|
|
108511
|
-
installedPackagePath:
|
|
108624
|
+
installedPackagePath: join78(installDir, "node_modules", packageName, "package.json")
|
|
108512
108625
|
}
|
|
108513
108626
|
]
|
|
108514
108627
|
});
|
|
@@ -108516,7 +108629,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
108516
108629
|
return candidates;
|
|
108517
108630
|
}
|
|
108518
108631
|
function selectInstalledPackage(candidate2) {
|
|
108519
|
-
return candidate2.packageCandidates.find((packageCandidate) =>
|
|
108632
|
+
return candidate2.packageCandidates.find((packageCandidate) => existsSync51(packageCandidate.installedPackagePath)) ?? candidate2.packageCandidates[0];
|
|
108520
108633
|
}
|
|
108521
108634
|
function getExpectedVersion(cachePackage, packageName) {
|
|
108522
108635
|
return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
|
|
@@ -108527,7 +108640,7 @@ function resolveInstalledPackageJsonPath() {
|
|
|
108527
108640
|
for (const packageName of ACCEPTED_PACKAGE_NAMES) {
|
|
108528
108641
|
try {
|
|
108529
108642
|
const packageJsonPath = require2.resolve(`${packageName}/package.json`);
|
|
108530
|
-
if (
|
|
108643
|
+
if (existsSync51(packageJsonPath)) {
|
|
108531
108644
|
return { packageName, packageJsonPath };
|
|
108532
108645
|
}
|
|
108533
108646
|
} catch {
|
|
@@ -108553,22 +108666,22 @@ function getLoadedPluginVersion() {
|
|
|
108553
108666
|
const candidates = [
|
|
108554
108667
|
{
|
|
108555
108668
|
cacheDir: configDir,
|
|
108556
|
-
cachePackagePath:
|
|
108669
|
+
cachePackagePath: join78(configDir, "package.json"),
|
|
108557
108670
|
packageCandidates: createPackageCandidates(configDir)
|
|
108558
108671
|
},
|
|
108559
108672
|
...createTaggedInstallCandidates(configDir),
|
|
108560
108673
|
{
|
|
108561
108674
|
cacheDir,
|
|
108562
|
-
cachePackagePath:
|
|
108675
|
+
cachePackagePath: join78(cacheDir, "package.json"),
|
|
108563
108676
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
108564
108677
|
},
|
|
108565
108678
|
...createTaggedInstallCandidates(cacheDir)
|
|
108566
108679
|
];
|
|
108567
|
-
const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) =>
|
|
108680
|
+
const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) => existsSync51(packageCandidate.installedPackagePath))) ?? candidates[0];
|
|
108568
108681
|
const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
|
|
108569
108682
|
const selectedPackage = selectInstalledPackage(selectedCandidate);
|
|
108570
108683
|
const candidateInstalledPath = selectedPackage.installedPackagePath;
|
|
108571
|
-
const candidateExists =
|
|
108684
|
+
const candidateExists = existsSync51(candidateInstalledPath);
|
|
108572
108685
|
const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
|
|
108573
108686
|
const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
|
|
108574
108687
|
const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
|
|
@@ -108604,7 +108717,7 @@ var defaultDeps6 = {
|
|
|
108604
108717
|
getLoadedPluginVersion,
|
|
108605
108718
|
getLatestPluginVersion,
|
|
108606
108719
|
getSuggestedInstallTag,
|
|
108607
|
-
configExists:
|
|
108720
|
+
configExists: existsSync52,
|
|
108608
108721
|
readConfigFile: (path12) => readFileSync32(path12, "utf-8"),
|
|
108609
108722
|
parseConfigContent: (content) => parseJsonc(content)
|
|
108610
108723
|
};
|
|
@@ -108750,23 +108863,23 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
108750
108863
|
|
|
108751
108864
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
108752
108865
|
init_shared();
|
|
108753
|
-
import { existsSync as
|
|
108754
|
-
import { homedir as
|
|
108755
|
-
import { join as
|
|
108866
|
+
import { existsSync as existsSync53, readFileSync as readFileSync33 } from "fs";
|
|
108867
|
+
import { homedir as homedir17 } from "os";
|
|
108868
|
+
import { join as join79 } from "path";
|
|
108756
108869
|
function getUserConfigDir2() {
|
|
108757
108870
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
108758
108871
|
if (xdgConfig)
|
|
108759
|
-
return
|
|
108760
|
-
return
|
|
108872
|
+
return join79(xdgConfig, "opencode");
|
|
108873
|
+
return join79(homedir17(), ".config", "opencode");
|
|
108761
108874
|
}
|
|
108762
108875
|
function loadCustomProviderNames() {
|
|
108763
108876
|
const configDir = getUserConfigDir2();
|
|
108764
108877
|
const candidatePaths = [
|
|
108765
|
-
|
|
108766
|
-
|
|
108878
|
+
join79(configDir, "opencode.json"),
|
|
108879
|
+
join79(configDir, "opencode.jsonc")
|
|
108767
108880
|
];
|
|
108768
108881
|
for (const configPath of candidatePaths) {
|
|
108769
|
-
if (!
|
|
108882
|
+
if (!existsSync53(configPath))
|
|
108770
108883
|
continue;
|
|
108771
108884
|
try {
|
|
108772
108885
|
const content = readFileSync33(configPath, "utf-8");
|
|
@@ -108784,9 +108897,9 @@ function loadCustomProviderNames() {
|
|
|
108784
108897
|
return [];
|
|
108785
108898
|
}
|
|
108786
108899
|
function loadAvailableModelsFromCache() {
|
|
108787
|
-
const cacheFile =
|
|
108900
|
+
const cacheFile = join79(getOpenCodeCacheDir(), "models.json");
|
|
108788
108901
|
const customProviders = loadCustomProviderNames();
|
|
108789
|
-
if (!
|
|
108902
|
+
if (!existsSync53(cacheFile)) {
|
|
108790
108903
|
if (customProviders.length > 0) {
|
|
108791
108904
|
return { providers: customProviders, modelCount: 0, cacheExists: true };
|
|
108792
108905
|
}
|
|
@@ -108846,7 +108959,7 @@ function loadOmoConfig2() {
|
|
|
108846
108959
|
|
|
108847
108960
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
108848
108961
|
init_shared();
|
|
108849
|
-
import { join as
|
|
108962
|
+
import { join as join80 } from "path";
|
|
108850
108963
|
|
|
108851
108964
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
108852
108965
|
function formatModelWithVariant(model, variant) {
|
|
@@ -108888,7 +109001,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
108888
109001
|
}
|
|
108889
109002
|
function buildModelResolutionDetails(options) {
|
|
108890
109003
|
const details = [];
|
|
108891
|
-
const cacheFile =
|
|
109004
|
+
const cacheFile = join80(getOpenCodeCacheDir(), "models.json");
|
|
108892
109005
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
108893
109006
|
details.push("");
|
|
108894
109007
|
if (options.available.cacheExists) {
|
|
@@ -109197,8 +109310,8 @@ async function checkConfig() {
|
|
|
109197
109310
|
|
|
109198
109311
|
// packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
|
|
109199
109312
|
init_main();
|
|
109200
|
-
import { existsSync as
|
|
109201
|
-
import { join as
|
|
109313
|
+
import { existsSync as existsSync54, readFileSync as readFileSync34 } from "fs";
|
|
109314
|
+
import { join as join81 } from "path";
|
|
109202
109315
|
var CANONICAL_REPLACEMENT = new Map([
|
|
109203
109316
|
["variant", "reasoning"],
|
|
109204
109317
|
["reasoningEffort", "reasoning"],
|
|
@@ -109253,13 +109366,13 @@ function userConfigPaths() {
|
|
|
109253
109366
|
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
109254
109367
|
if (home === undefined || home.length === 0)
|
|
109255
109368
|
return [];
|
|
109256
|
-
return [
|
|
109369
|
+
return [join81(home, ".omo", "omo.jsonc"), join81(home, ".omo", "omo.json")];
|
|
109257
109370
|
}
|
|
109258
109371
|
async function checkDeprecatedReasoningKeys() {
|
|
109259
109372
|
const issues = [];
|
|
109260
109373
|
const scanned = [];
|
|
109261
109374
|
for (const configPath of userConfigPaths()) {
|
|
109262
|
-
if (!
|
|
109375
|
+
if (!existsSync54(configPath))
|
|
109263
109376
|
continue;
|
|
109264
109377
|
scanned.push(configPath);
|
|
109265
109378
|
const parsed = parse2(readFileSync34(configPath, "utf-8"));
|
|
@@ -109276,28 +109389,28 @@ async function checkDeprecatedReasoningKeys() {
|
|
|
109276
109389
|
|
|
109277
109390
|
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
109278
109391
|
init_src2();
|
|
109279
|
-
import { existsSync as
|
|
109392
|
+
import { existsSync as existsSync55 } from "fs";
|
|
109280
109393
|
import { createRequire as createRequire3 } from "module";
|
|
109281
|
-
import { homedir as
|
|
109282
|
-
import { dirname as dirname31, join as
|
|
109394
|
+
import { homedir as homedir19 } from "os";
|
|
109395
|
+
import { dirname as dirname31, join as join83 } from "path";
|
|
109283
109396
|
|
|
109284
109397
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
109285
|
-
import { join as
|
|
109286
|
-
import { homedir as
|
|
109398
|
+
import { join as join82 } from "path";
|
|
109399
|
+
import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
|
|
109287
109400
|
init_binary_downloader();
|
|
109288
109401
|
init_logger2();
|
|
109289
109402
|
init_plugin_identity();
|
|
109290
109403
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
109291
|
-
var DEBUG_FILE =
|
|
109404
|
+
var DEBUG_FILE = join82(tmpdir4(), "comment-checker-debug.log");
|
|
109292
109405
|
function getCacheDir2() {
|
|
109293
109406
|
if (process.platform === "win32") {
|
|
109294
109407
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
109295
|
-
const base2 = localAppData ||
|
|
109296
|
-
return
|
|
109408
|
+
const base2 = localAppData || join82(homedir18(), "AppData", "Local");
|
|
109409
|
+
return join82(base2, CACHE_DIR_NAME, "bin");
|
|
109297
109410
|
}
|
|
109298
109411
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
109299
|
-
const base = xdgCache ||
|
|
109300
|
-
return
|
|
109412
|
+
const base = xdgCache || join82(homedir18(), ".cache");
|
|
109413
|
+
return join82(base, CACHE_DIR_NAME, "bin");
|
|
109301
109414
|
}
|
|
109302
109415
|
function getBinaryName() {
|
|
109303
109416
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -109347,7 +109460,7 @@ async function getBinaryVersion(binary) {
|
|
|
109347
109460
|
}
|
|
109348
109461
|
}
|
|
109349
109462
|
async function checkAstGrepCli() {
|
|
109350
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
109463
|
+
const runtimeDir = astGrepRuntimeDir(join83(homedir19(), ".omo"));
|
|
109351
109464
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
109352
109465
|
if (sgPath === null) {
|
|
109353
109466
|
return {
|
|
@@ -109377,11 +109490,11 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
109377
109490
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
109378
109491
|
try {
|
|
109379
109492
|
const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
|
|
109380
|
-
const vendorPath =
|
|
109381
|
-
if (
|
|
109493
|
+
const vendorPath = join83(packageDir, "vendor", platformKey, binaryName);
|
|
109494
|
+
if (existsSync55(vendorPath))
|
|
109382
109495
|
return vendorPath;
|
|
109383
|
-
const binPath =
|
|
109384
|
-
if (
|
|
109496
|
+
const binPath = join83(packageDir, "bin", binaryName);
|
|
109497
|
+
if (existsSync55(binPath))
|
|
109385
109498
|
return binPath;
|
|
109386
109499
|
} catch (error51) {
|
|
109387
109500
|
if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
|
|
@@ -109527,8 +109640,8 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
109527
109640
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
109528
109641
|
init_zod();
|
|
109529
109642
|
init_opencode_config_dir();
|
|
109530
|
-
import { existsSync as
|
|
109531
|
-
import { delimiter as delimiter3, dirname as dirname32, resolve as
|
|
109643
|
+
import { existsSync as existsSync56, readFileSync as readFileSync35 } from "fs";
|
|
109644
|
+
import { delimiter as delimiter3, dirname as dirname32, resolve as resolve23 } from "path";
|
|
109532
109645
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
109533
109646
|
|
|
109534
109647
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -109575,7 +109688,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
|
|
|
109575
109688
|
}
|
|
109576
109689
|
|
|
109577
109690
|
// packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
|
|
109578
|
-
import { resolve as
|
|
109691
|
+
import { resolve as resolve22 } from "path";
|
|
109579
109692
|
function resolveJavaScriptRuntime(resolveExecutable) {
|
|
109580
109693
|
const node = resolveExecutable("node");
|
|
109581
109694
|
return node.available ? node : resolveExecutable("bun");
|
|
@@ -109583,9 +109696,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
|
|
|
109583
109696
|
function createAncestorCliCandidates(options) {
|
|
109584
109697
|
const candidates = [];
|
|
109585
109698
|
const seenPaths = new Set;
|
|
109586
|
-
let currentDirectory =
|
|
109699
|
+
let currentDirectory = resolve22(options.startDirectory);
|
|
109587
109700
|
while (true) {
|
|
109588
|
-
const distCliPath =
|
|
109701
|
+
const distCliPath = resolve22(currentDirectory, options.packageRel, options.distCliRel);
|
|
109589
109702
|
if (!seenPaths.has(distCliPath)) {
|
|
109590
109703
|
const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
|
|
109591
109704
|
seenPaths.add(distCliPath);
|
|
@@ -109597,7 +109710,7 @@ function createAncestorCliCandidates(options) {
|
|
|
109597
109710
|
runtimeAvailable: runtime5.available
|
|
109598
109711
|
});
|
|
109599
109712
|
}
|
|
109600
|
-
const sourceCliPath =
|
|
109713
|
+
const sourceCliPath = resolve22(currentDirectory, options.packageRel, options.sourceCliRel);
|
|
109601
109714
|
if (!seenPaths.has(sourceCliPath)) {
|
|
109602
109715
|
const runtime5 = options.resolveExecutable("bun");
|
|
109603
109716
|
const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
|
|
@@ -109614,7 +109727,7 @@ function createAncestorCliCandidates(options) {
|
|
|
109614
109727
|
runtimeAvailable: runtime5.available
|
|
109615
109728
|
});
|
|
109616
109729
|
}
|
|
109617
|
-
const parentDirectory =
|
|
109730
|
+
const parentDirectory = resolve22(currentDirectory, "..");
|
|
109618
109731
|
if (parentDirectory === currentDirectory)
|
|
109619
109732
|
return candidates;
|
|
109620
109733
|
currentDirectory = parentDirectory;
|
|
@@ -109667,11 +109780,11 @@ function getModuleDirectory(moduleUrl) {
|
|
|
109667
109780
|
}
|
|
109668
109781
|
}
|
|
109669
109782
|
function findBootstrapRoot(candidates, pathExists) {
|
|
109670
|
-
return candidates.find((candidate2) => pathExists(
|
|
109783
|
+
return candidates.find((candidate2) => pathExists(resolve23(candidate2.root, "package.json")))?.root ?? process.cwd();
|
|
109671
109784
|
}
|
|
109672
109785
|
function readDaemonPackageVersion(root) {
|
|
109673
109786
|
try {
|
|
109674
|
-
const packageJson = JSON.parse(readFileSync35(
|
|
109787
|
+
const packageJson = JSON.parse(readFileSync35(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
109675
109788
|
return DaemonPackageSchema.parse(packageJson).version;
|
|
109676
109789
|
} catch (error51) {
|
|
109677
109790
|
if (!(error51 instanceof Error))
|
|
@@ -109683,17 +109796,17 @@ function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
|
109683
109796
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
109684
109797
|
const bun = resolveExecutable("bun");
|
|
109685
109798
|
const npm = resolveExecutable("npm");
|
|
109686
|
-
const packageManifestPath =
|
|
109799
|
+
const packageManifestPath = resolve23(root, PACKAGE_REL, "package.json");
|
|
109687
109800
|
return {
|
|
109688
109801
|
command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
|
|
109689
109802
|
root,
|
|
109690
|
-
path:
|
|
109803
|
+
path: resolve23(root, PACKAGE_REL, DIST_CLI_REL),
|
|
109691
109804
|
exists: runtime5.available && npm.available && pathExists(packageManifestPath),
|
|
109692
109805
|
runtimeAvailable: runtime5.available
|
|
109693
109806
|
};
|
|
109694
109807
|
}
|
|
109695
109808
|
function resolveLspCommand(options = {}) {
|
|
109696
|
-
const pathExists = options.exists ??
|
|
109809
|
+
const pathExists = options.exists ?? existsSync56;
|
|
109697
109810
|
const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
|
|
109698
109811
|
const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
|
|
109699
109812
|
const candidates = moduleDirectory ? createAncestorCliCandidates({
|
|
@@ -109703,7 +109816,7 @@ function resolveLspCommand(options = {}) {
|
|
|
109703
109816
|
sourceCliRel: SOURCE_CLI_REL,
|
|
109704
109817
|
pathExists,
|
|
109705
109818
|
resolveExecutable,
|
|
109706
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(
|
|
109819
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve23(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
|
|
109707
109820
|
}) : [];
|
|
109708
109821
|
const distCandidate = candidates.find((candidate2) => hasCliSuffix(candidate2.path, DIST_CLI_REL) && candidate2.exists);
|
|
109709
109822
|
if (distCandidate) {
|
|
@@ -109717,7 +109830,7 @@ function resolveLspCommand(options = {}) {
|
|
|
109717
109830
|
}
|
|
109718
109831
|
function createLspMcpConfig(options = {}) {
|
|
109719
109832
|
const resolvedCommand = resolveLspCommand(options);
|
|
109720
|
-
const cwd =
|
|
109833
|
+
const cwd = resolve23(options.cwd ?? process.cwd());
|
|
109721
109834
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
109722
109835
|
const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
|
|
109723
109836
|
return {
|
|
@@ -109726,9 +109839,9 @@ function createLspMcpConfig(options = {}) {
|
|
|
109726
109839
|
enabled: resolvedCommand.exists,
|
|
109727
109840
|
cwd,
|
|
109728
109841
|
environment: {
|
|
109729
|
-
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) =>
|
|
109730
|
-
LSP_TOOLS_MCP_USER_CONFIG:
|
|
109731
|
-
LSP_TOOLS_MCP_INSTALL_DECISIONS:
|
|
109842
|
+
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve23(cwd, configPath)).join(delimiter3),
|
|
109843
|
+
LSP_TOOLS_MCP_USER_CONFIG: resolve23(configDir, "lsp.json"),
|
|
109844
|
+
LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve23(configDir, "lsp-install-decisions.json"),
|
|
109732
109845
|
...sourceVersion ? {
|
|
109733
109846
|
[OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
|
|
109734
109847
|
[OMO_LSP_DAEMON_VERSION]: sourceVersion
|
|
@@ -109753,21 +109866,21 @@ function getInstalledLspServers(options = {}) {
|
|
|
109753
109866
|
|
|
109754
109867
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
109755
109868
|
init_shared();
|
|
109756
|
-
import { existsSync as
|
|
109757
|
-
import { homedir as
|
|
109758
|
-
import { join as
|
|
109869
|
+
import { existsSync as existsSync57, readFileSync as readFileSync36 } from "fs";
|
|
109870
|
+
import { homedir as homedir20 } from "os";
|
|
109871
|
+
import { join as join84 } from "path";
|
|
109759
109872
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
109760
109873
|
function getMcpConfigPaths() {
|
|
109761
109874
|
return [
|
|
109762
|
-
|
|
109763
|
-
|
|
109764
|
-
|
|
109875
|
+
join84(homedir20(), ".claude", ".mcp.json"),
|
|
109876
|
+
join84(process.cwd(), ".mcp.json"),
|
|
109877
|
+
join84(process.cwd(), ".claude", ".mcp.json")
|
|
109765
109878
|
];
|
|
109766
109879
|
}
|
|
109767
109880
|
function loadUserMcpConfig() {
|
|
109768
109881
|
const servers = {};
|
|
109769
109882
|
for (const configPath of getMcpConfigPaths()) {
|
|
109770
|
-
if (!
|
|
109883
|
+
if (!existsSync57(configPath))
|
|
109771
109884
|
continue;
|
|
109772
109885
|
try {
|
|
109773
109886
|
const content = readFileSync36(configPath, "utf-8");
|
|
@@ -109905,12 +110018,12 @@ async function checkTools() {
|
|
|
109905
110018
|
|
|
109906
110019
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
109907
110020
|
init_src5();
|
|
109908
|
-
import { existsSync as
|
|
110021
|
+
import { existsSync as existsSync58, readFileSync as readFileSync37 } from "fs";
|
|
109909
110022
|
function isTelemetryState(value) {
|
|
109910
110023
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
109911
110024
|
}
|
|
109912
110025
|
function readLastActiveDay(stateFilePath) {
|
|
109913
|
-
if (!
|
|
110026
|
+
if (!existsSync58(stateFilePath)) {
|
|
109914
110027
|
return "never";
|
|
109915
110028
|
}
|
|
109916
110029
|
let parsed;
|
|
@@ -109973,17 +110086,17 @@ async function probeBinary(cmd, args, spawnImpl) {
|
|
|
109973
110086
|
}
|
|
109974
110087
|
|
|
109975
110088
|
// packages/team-core/src/team-registry/paths.ts
|
|
109976
|
-
import { homedir as
|
|
110089
|
+
import { homedir as homedir21 } from "os";
|
|
109977
110090
|
import path12 from "path";
|
|
109978
110091
|
function resolveBaseDir(config4) {
|
|
109979
|
-
return expandHomeDirectory(config4.base_dir ?? path12.join(
|
|
110092
|
+
return expandHomeDirectory(config4.base_dir ?? path12.join(homedir21(), ".omo"));
|
|
109980
110093
|
}
|
|
109981
110094
|
function expandHomeDirectory(directoryPath3) {
|
|
109982
110095
|
if (directoryPath3 === "~") {
|
|
109983
|
-
return
|
|
110096
|
+
return homedir21();
|
|
109984
110097
|
}
|
|
109985
110098
|
if (directoryPath3.startsWith("~/") || directoryPath3.startsWith("~\\")) {
|
|
109986
|
-
return path12.join(
|
|
110099
|
+
return path12.join(homedir21(), directoryPath3.slice(2));
|
|
109987
110100
|
}
|
|
109988
110101
|
return directoryPath3;
|
|
109989
110102
|
}
|
|
@@ -110040,10 +110153,10 @@ async function pathExists(dir) {
|
|
|
110040
110153
|
|
|
110041
110154
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
110042
110155
|
init_src2();
|
|
110043
|
-
import { existsSync as
|
|
110156
|
+
import { existsSync as existsSync59 } from "fs";
|
|
110044
110157
|
import { lstat as lstat15, readdir as readdir14, readFile as readFile27 } from "fs/promises";
|
|
110045
|
-
import { homedir as
|
|
110046
|
-
import { basename as basename11, join as
|
|
110158
|
+
import { homedir as homedir22 } from "os";
|
|
110159
|
+
import { basename as basename11, join as join85, resolve as resolve24 } from "path";
|
|
110047
110160
|
// packages/omo-opencode/package.json
|
|
110048
110161
|
var package_default3 = {
|
|
110049
110162
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -110108,13 +110221,13 @@ var CODEX_BIN_NAMES = [
|
|
|
110108
110221
|
"omo-git-bash-hook"
|
|
110109
110222
|
];
|
|
110110
110223
|
async function gatherCodexSummary(deps = {}) {
|
|
110111
|
-
const codexHome =
|
|
110224
|
+
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join85(homedir22(), ".codex"));
|
|
110112
110225
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110113
110226
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
110114
110227
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
110115
|
-
const manifest2 = pluginRoot === null ? null : await readJson(
|
|
110116
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
110117
|
-
const configPath =
|
|
110228
|
+
const manifest2 = pluginRoot === null ? null : await readJson(join85(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
110229
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join85(pluginRoot, "lazycodex-install.json"));
|
|
110230
|
+
const configPath = join85(codexHome, "config.toml");
|
|
110118
110231
|
const pluginVersion = stringField(manifest2, "version");
|
|
110119
110232
|
return {
|
|
110120
110233
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -110171,7 +110284,7 @@ function buildCodexIssues(summary) {
|
|
|
110171
110284
|
if (summary.pluginRoot === null) {
|
|
110172
110285
|
issues.push({
|
|
110173
110286
|
title: "OMO Codex plugin is not installed",
|
|
110174
|
-
description: `Expected cached plugin at ${
|
|
110287
|
+
description: `Expected cached plugin at ${join85("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
110175
110288
|
fix: "Run: npx lazycodex-ai install",
|
|
110176
110289
|
severity: "error",
|
|
110177
110290
|
affects: ["plugin loading"]
|
|
@@ -110236,15 +110349,15 @@ function buildCodexIssues(summary) {
|
|
|
110236
110349
|
return issues;
|
|
110237
110350
|
}
|
|
110238
110351
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
110239
|
-
const pluginRoot =
|
|
110240
|
-
if (!
|
|
110352
|
+
const pluginRoot = join85(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
110353
|
+
if (!existsSync59(pluginRoot))
|
|
110241
110354
|
return null;
|
|
110242
110355
|
const versions2 = await readdir14(pluginRoot, { withFileTypes: true });
|
|
110243
110356
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
110244
|
-
return candidates.length === 0 ? null :
|
|
110357
|
+
return candidates.length === 0 ? null : join85(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
110245
110358
|
}
|
|
110246
110359
|
async function readCodexConfigSummary(configPath) {
|
|
110247
|
-
if (!
|
|
110360
|
+
if (!existsSync59(configPath)) {
|
|
110248
110361
|
return {
|
|
110249
110362
|
exists: false,
|
|
110250
110363
|
marketplaceConfigured: false,
|
|
@@ -110269,14 +110382,14 @@ async function readCodexConfigSummary(configPath) {
|
|
|
110269
110382
|
async function readLinkedBins(binDir) {
|
|
110270
110383
|
const linked = [];
|
|
110271
110384
|
for (const name of CODEX_BIN_NAMES) {
|
|
110272
|
-
if (await pathExists2(
|
|
110385
|
+
if (await pathExists2(join85(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
110273
110386
|
linked.push(name);
|
|
110274
110387
|
}
|
|
110275
110388
|
return linked;
|
|
110276
110389
|
}
|
|
110277
110390
|
async function readLinkedAgents(codexHome) {
|
|
110278
|
-
const agentsDir =
|
|
110279
|
-
if (!
|
|
110391
|
+
const agentsDir = join85(codexHome, "agents");
|
|
110392
|
+
if (!existsSync59(agentsDir))
|
|
110280
110393
|
return [];
|
|
110281
110394
|
const entries = await readdir14(agentsDir, { withFileTypes: true });
|
|
110282
110395
|
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename11(entry.name, ".toml")).sort();
|
|
@@ -110390,8 +110503,8 @@ async function pathExists2(path14) {
|
|
|
110390
110503
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
110391
110504
|
init_src2();
|
|
110392
110505
|
import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "fs/promises";
|
|
110393
|
-
import { homedir as
|
|
110394
|
-
import { dirname as dirname33, isAbsolute as isAbsolute12, join as
|
|
110506
|
+
import { homedir as homedir23 } from "os";
|
|
110507
|
+
import { dirname as dirname33, isAbsolute as isAbsolute12, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "path";
|
|
110395
110508
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
110396
110509
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
110397
110510
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -110401,7 +110514,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110401
110514
|
const env3 = deps.env ?? process.env;
|
|
110402
110515
|
const platform = deps.platform ?? process.platform;
|
|
110403
110516
|
const arch = deps.arch ?? process.arch;
|
|
110404
|
-
const codexHome =
|
|
110517
|
+
const codexHome = resolve25(deps.codexHome ?? env3["CODEX_HOME"] ?? join86(homedir23(), ".codex"));
|
|
110405
110518
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
110406
110519
|
if (summary.pluginRoot === null) {
|
|
110407
110520
|
return {
|
|
@@ -110426,7 +110539,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110426
110539
|
});
|
|
110427
110540
|
}
|
|
110428
110541
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
110429
|
-
const runtimeSgPath =
|
|
110542
|
+
const runtimeSgPath = join86(runtimeSgDir, sgBinaryName(platform));
|
|
110430
110543
|
const sg = findSgBinarySync({
|
|
110431
110544
|
arch,
|
|
110432
110545
|
env: env3,
|
|
@@ -110466,7 +110579,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110466
110579
|
if (manifest2 === null || !isRecord12(manifest2["mcpServers"]))
|
|
110467
110580
|
continue;
|
|
110468
110581
|
const manifestRoot = dirname33(manifestPath);
|
|
110469
|
-
const isRootManifest =
|
|
110582
|
+
const isRootManifest = resolve25(manifestRoot) === resolve25(pluginRoot);
|
|
110470
110583
|
for (const server2 of Object.values(manifest2["mcpServers"])) {
|
|
110471
110584
|
if (!isRecord12(server2) || !Array.isArray(server2["args"]))
|
|
110472
110585
|
continue;
|
|
@@ -110508,8 +110621,8 @@ function recordBrokenTarget(broken, classified, origin) {
|
|
|
110508
110621
|
broken.push(entry);
|
|
110509
110622
|
}
|
|
110510
110623
|
async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
|
|
110511
|
-
const targetPath =
|
|
110512
|
-
const bundleRootPath =
|
|
110624
|
+
const targetPath = resolve25(baseRoot, relativePath);
|
|
110625
|
+
const bundleRootPath = resolve25(bundleRoot);
|
|
110513
110626
|
const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
|
|
110514
110627
|
if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
|
|
110515
110628
|
if (allowEscape)
|
|
@@ -110538,7 +110651,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
110538
110651
|
for (const entry of entries) {
|
|
110539
110652
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
110540
110653
|
continue;
|
|
110541
|
-
const entryPath =
|
|
110654
|
+
const entryPath = join86(root, entry.name);
|
|
110542
110655
|
if (entry.isDirectory()) {
|
|
110543
110656
|
paths3.push(...await findManifestPaths(entryPath, manifestName));
|
|
110544
110657
|
continue;
|
|
@@ -110582,18 +110695,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
110582
110695
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
110583
110696
|
}
|
|
110584
110697
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
110585
|
-
return
|
|
110698
|
+
return join86(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
110586
110699
|
}
|
|
110587
110700
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
110588
110701
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
110589
110702
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
110590
110703
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
110591
|
-
if (sgPath ===
|
|
110704
|
+
if (sgPath === join86(runtimeSgDir, sgBinaryName(platform)))
|
|
110592
110705
|
return "runtime dir";
|
|
110593
110706
|
return "PATH";
|
|
110594
110707
|
}
|
|
110595
110708
|
async function readBootstrapStateSummary(codexHome) {
|
|
110596
|
-
const statePath =
|
|
110709
|
+
const statePath = join86(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
110597
110710
|
const raw = await readJson2(statePath);
|
|
110598
110711
|
if (raw === null)
|
|
110599
110712
|
return null;
|
|
@@ -110669,24 +110782,24 @@ function isRecord12(value) {
|
|
|
110669
110782
|
}
|
|
110670
110783
|
|
|
110671
110784
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
110672
|
-
import { existsSync as
|
|
110785
|
+
import { existsSync as existsSync60 } from "fs";
|
|
110673
110786
|
import { readFile as readFile29 } from "fs/promises";
|
|
110674
|
-
import { homedir as
|
|
110675
|
-
import { join as
|
|
110787
|
+
import { homedir as homedir24 } from "os";
|
|
110788
|
+
import { join as join87, resolve as resolve26 } from "path";
|
|
110676
110789
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
110677
110790
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
110678
110791
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
110679
110792
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
110680
|
-
const codexHome =
|
|
110793
|
+
const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join87(homedir24(), ".codex"));
|
|
110681
110794
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110682
110795
|
const platform = deps.platform ?? process.platform;
|
|
110683
|
-
const wrapperPath =
|
|
110684
|
-
const legacyWrapperPath =
|
|
110796
|
+
const wrapperPath = join87(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
|
|
110797
|
+
const legacyWrapperPath = join87(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
110685
110798
|
const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
|
|
110686
110799
|
const issues = [];
|
|
110687
110800
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
110688
110801
|
const targetPath = parseRuntimeTargetPath(wrapper);
|
|
110689
|
-
if (targetPath !== null && !
|
|
110802
|
+
if (targetPath !== null && !existsSync60(targetPath)) {
|
|
110690
110803
|
issues.push({
|
|
110691
110804
|
title: "omo-agent-toolkit runtime wrapper target is missing",
|
|
110692
110805
|
description: `Generated omo-agent-toolkit runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
|
|
@@ -111201,7 +111314,7 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
111201
111314
|
import { createHash as createHash6 } from "crypto";
|
|
111202
111315
|
import {
|
|
111203
111316
|
chmodSync as chmodSync5,
|
|
111204
|
-
existsSync as
|
|
111317
|
+
existsSync as existsSync63,
|
|
111205
111318
|
mkdirSync as mkdirSync15,
|
|
111206
111319
|
readdirSync as readdirSync11,
|
|
111207
111320
|
readFileSync as readFileSync39,
|
|
@@ -111209,15 +111322,15 @@ import {
|
|
|
111209
111322
|
unlinkSync as unlinkSync9,
|
|
111210
111323
|
writeFileSync as writeFileSync12
|
|
111211
111324
|
} from "fs";
|
|
111212
|
-
import { basename as basename12, dirname as dirname34, join as
|
|
111325
|
+
import { basename as basename12, dirname as dirname34, join as join90 } from "path";
|
|
111213
111326
|
|
|
111214
111327
|
// packages/mcp-client-core/src/config-dir.ts
|
|
111215
|
-
import { existsSync as
|
|
111216
|
-
import { homedir as
|
|
111217
|
-
import { join as
|
|
111328
|
+
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
|
|
111329
|
+
import { homedir as homedir25 } from "os";
|
|
111330
|
+
import { join as join88, resolve as resolve27 } from "path";
|
|
111218
111331
|
function resolveConfigPath2(pathValue) {
|
|
111219
|
-
const resolvedPath =
|
|
111220
|
-
if (!
|
|
111332
|
+
const resolvedPath = resolve27(pathValue);
|
|
111333
|
+
if (!existsSync61(resolvedPath))
|
|
111221
111334
|
return resolvedPath;
|
|
111222
111335
|
try {
|
|
111223
111336
|
return realpathSync8(resolvedPath);
|
|
@@ -111232,13 +111345,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
111232
111345
|
if (customConfigDir) {
|
|
111233
111346
|
return resolveConfigPath2(customConfigDir);
|
|
111234
111347
|
}
|
|
111235
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
111236
|
-
return resolveConfigPath2(
|
|
111348
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join88(homedir25(), ".config");
|
|
111349
|
+
return resolveConfigPath2(join88(xdgConfigDir, "opencode"));
|
|
111237
111350
|
}
|
|
111238
111351
|
|
|
111239
111352
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
111240
|
-
import { chmodSync as chmodSync4, existsSync as
|
|
111241
|
-
import { join as
|
|
111353
|
+
import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync38, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "fs";
|
|
111354
|
+
import { join as join89 } from "path";
|
|
111242
111355
|
var INDEX_FILE_NAME = "index.json";
|
|
111243
111356
|
function isTokenIndex(value) {
|
|
111244
111357
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -111246,11 +111359,11 @@ function isTokenIndex(value) {
|
|
|
111246
111359
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
111247
111360
|
}
|
|
111248
111361
|
function getIndexPath(storageDir) {
|
|
111249
|
-
return
|
|
111362
|
+
return join89(storageDir, INDEX_FILE_NAME);
|
|
111250
111363
|
}
|
|
111251
111364
|
function readTokenIndex(storageDir) {
|
|
111252
111365
|
const indexPath = getIndexPath(storageDir);
|
|
111253
|
-
if (!
|
|
111366
|
+
if (!existsSync62(indexPath))
|
|
111254
111367
|
return {};
|
|
111255
111368
|
try {
|
|
111256
111369
|
const parsed = JSON.parse(readFileSync38(indexPath, "utf-8"));
|
|
@@ -111290,16 +111403,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
111290
111403
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
111291
111404
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
111292
111405
|
function getMcpOauthStorageDir() {
|
|
111293
|
-
return
|
|
111406
|
+
return join90(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
111294
111407
|
}
|
|
111295
111408
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
111296
111409
|
return createHash6("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
111297
111410
|
}
|
|
111298
111411
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
111299
|
-
return
|
|
111412
|
+
return join90(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
111300
111413
|
}
|
|
111301
111414
|
function getLegacyStoragePath() {
|
|
111302
|
-
return
|
|
111415
|
+
return join90(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
111303
111416
|
}
|
|
111304
111417
|
function normalizeHost2(serverHost) {
|
|
111305
111418
|
let host = serverHost.trim();
|
|
@@ -111360,7 +111473,7 @@ function isOAuthTokenData(value) {
|
|
|
111360
111473
|
return clientSecret === undefined || typeof clientSecret === "string";
|
|
111361
111474
|
}
|
|
111362
111475
|
function readTokenFile(filePath) {
|
|
111363
|
-
if (!
|
|
111476
|
+
if (!existsSync63(filePath))
|
|
111364
111477
|
return null;
|
|
111365
111478
|
try {
|
|
111366
111479
|
const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
|
|
@@ -111373,7 +111486,7 @@ function readTokenFile(filePath) {
|
|
|
111373
111486
|
}
|
|
111374
111487
|
function readLegacyStore() {
|
|
111375
111488
|
const filePath = getLegacyStoragePath();
|
|
111376
|
-
if (!
|
|
111489
|
+
if (!existsSync63(filePath))
|
|
111377
111490
|
return null;
|
|
111378
111491
|
try {
|
|
111379
111492
|
const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
|
|
@@ -111394,7 +111507,7 @@ function readLegacyStore() {
|
|
|
111394
111507
|
function writeTokenFile(filePath, token) {
|
|
111395
111508
|
try {
|
|
111396
111509
|
const dir = dirname34(filePath);
|
|
111397
|
-
if (!
|
|
111510
|
+
if (!existsSync63(dir)) {
|
|
111398
111511
|
mkdirSync15(dir, { recursive: true });
|
|
111399
111512
|
}
|
|
111400
111513
|
const tempPath = `${filePath}.tmp.${Date.now()}`;
|
|
@@ -111418,7 +111531,7 @@ function saveToken(serverHost, resource, token) {
|
|
|
111418
111531
|
}
|
|
111419
111532
|
function deleteToken(serverHost, resource) {
|
|
111420
111533
|
const filePath = getMcpOauthStoragePath(serverHost, resource);
|
|
111421
|
-
if (!
|
|
111534
|
+
if (!existsSync63(filePath))
|
|
111422
111535
|
return deleteLegacyToken(serverHost, resource);
|
|
111423
111536
|
try {
|
|
111424
111537
|
unlinkSync9(filePath);
|
|
@@ -111440,7 +111553,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
111440
111553
|
if (Object.keys(store2).length === 0) {
|
|
111441
111554
|
try {
|
|
111442
111555
|
const filePath = getLegacyStoragePath();
|
|
111443
|
-
if (
|
|
111556
|
+
if (existsSync63(filePath))
|
|
111444
111557
|
unlinkSync9(filePath);
|
|
111445
111558
|
return true;
|
|
111446
111559
|
} catch (deleteError) {
|
|
@@ -111478,7 +111591,7 @@ function listTokensByHost(serverHost) {
|
|
|
111478
111591
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
111479
111592
|
if (!indexedKey.startsWith(prefix))
|
|
111480
111593
|
continue;
|
|
111481
|
-
const indexedToken = readTokenFile(
|
|
111594
|
+
const indexedToken = readTokenFile(join90(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
111482
111595
|
if (indexedToken)
|
|
111483
111596
|
result[indexedKey] = indexedToken;
|
|
111484
111597
|
}
|
|
@@ -111487,13 +111600,13 @@ function listTokensByHost(serverHost) {
|
|
|
111487
111600
|
function listAllTokens() {
|
|
111488
111601
|
const result = { ...readLegacyStore() ?? {} };
|
|
111489
111602
|
const dir = getMcpOauthStorageDir();
|
|
111490
|
-
if (!
|
|
111603
|
+
if (!existsSync63(dir))
|
|
111491
111604
|
return result;
|
|
111492
111605
|
const index = readTokenIndex(dir);
|
|
111493
111606
|
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
111494
111607
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
111495
111608
|
continue;
|
|
111496
|
-
const token = readTokenFile(
|
|
111609
|
+
const token = readTokenFile(join90(dir, entry.name));
|
|
111497
111610
|
const hash2 = basename12(entry.name, ".json");
|
|
111498
111611
|
if (token)
|
|
111499
111612
|
result[index[hash2] ?? hash2] = token;
|
|
@@ -111693,7 +111806,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
|
111693
111806
|
}
|
|
111694
111807
|
var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
111695
111808
|
function startCallbackServer(port) {
|
|
111696
|
-
return new Promise((
|
|
111809
|
+
return new Promise((resolve28, reject) => {
|
|
111697
111810
|
let timeoutId;
|
|
111698
111811
|
const server2 = createServer2((request, response) => {
|
|
111699
111812
|
clearTimeout(timeoutId);
|
|
@@ -111719,7 +111832,7 @@ function startCallbackServer(port) {
|
|
|
111719
111832
|
response.writeHead(200, { "content-type": "text/html" });
|
|
111720
111833
|
response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
|
|
111721
111834
|
server2.close();
|
|
111722
|
-
|
|
111835
|
+
resolve28({ code, state: state2 });
|
|
111723
111836
|
});
|
|
111724
111837
|
timeoutId = setTimeout(() => {
|
|
111725
111838
|
server2.close();
|
|
@@ -112059,7 +112172,7 @@ function createMcpOAuthCommand() {
|
|
|
112059
112172
|
}
|
|
112060
112173
|
|
|
112061
112174
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
112062
|
-
import { existsSync as
|
|
112175
|
+
import { existsSync as existsSync64 } from "fs";
|
|
112063
112176
|
|
|
112064
112177
|
// packages/omo-opencode/src/cli/boulder/formatter.ts
|
|
112065
112178
|
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
@@ -112196,10 +112309,10 @@ async function boulder(options) {
|
|
|
112196
112309
|
const boulderFilePath = getBoulderFilePath(directory);
|
|
112197
112310
|
const state2 = readBoulderState(directory);
|
|
112198
112311
|
if (!state2) {
|
|
112199
|
-
const message =
|
|
112312
|
+
const message = existsSync64(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
|
|
112200
112313
|
process.stderr.write(`${message}
|
|
112201
112314
|
`);
|
|
112202
|
-
return
|
|
112315
|
+
return existsSync64(boulderFilePath) ? 2 : 1;
|
|
112203
112316
|
}
|
|
112204
112317
|
const works = getBoulderWorks(state2);
|
|
112205
112318
|
const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
|
|
@@ -112217,12 +112330,12 @@ async function boulder(options) {
|
|
|
112217
112330
|
}
|
|
112218
112331
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
112219
112332
|
import { spawn as spawn5 } from "child_process";
|
|
112220
|
-
import { existsSync as
|
|
112221
|
-
import { homedir as
|
|
112333
|
+
import { existsSync as existsSync65, readFileSync as readFileSync40, realpathSync as realpathSync9 } from "fs";
|
|
112334
|
+
import { homedir as homedir26 } from "os";
|
|
112222
112335
|
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
|
|
112223
112336
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
112224
112337
|
const env3 = input.env ?? process.env;
|
|
112225
|
-
const homeDir = input.homeDir ??
|
|
112338
|
+
const homeDir = input.homeDir ?? homedir26();
|
|
112226
112339
|
const localComponentBin = resolveLocalUlwLoopBin(env3, homeDir);
|
|
112227
112340
|
if (localComponentBin !== null)
|
|
112228
112341
|
return { executable: localComponentBin, argsPrefix: [] };
|
|
@@ -112245,25 +112358,25 @@ async function codexUlwLoop(args) {
|
|
|
112245
112358
|
console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
|
|
112246
112359
|
return 1;
|
|
112247
112360
|
}
|
|
112248
|
-
const { promise: promise2, resolve:
|
|
112361
|
+
const { promise: promise2, resolve: resolve28 } = Promise.withResolvers();
|
|
112249
112362
|
const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
|
|
112250
112363
|
stdio: "inherit",
|
|
112251
112364
|
env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
|
|
112252
112365
|
});
|
|
112253
112366
|
child.on("error", (error51) => {
|
|
112254
112367
|
console.error(error51.message);
|
|
112255
|
-
|
|
112368
|
+
resolve28(1);
|
|
112256
112369
|
});
|
|
112257
|
-
child.on("close", (code) =>
|
|
112370
|
+
child.on("close", (code) => resolve28(code ?? 1));
|
|
112258
112371
|
return promise2;
|
|
112259
112372
|
}
|
|
112260
112373
|
function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
112261
112374
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
|
|
112262
|
-
return candidates.find((candidate2) =>
|
|
112375
|
+
return candidates.find((candidate2) => existsSync65(candidate2)) ?? null;
|
|
112263
112376
|
}
|
|
112264
112377
|
function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
112265
112378
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
|
|
112266
|
-
return candidates.find((candidate2) =>
|
|
112379
|
+
return candidates.find((candidate2) => existsSync65(candidate2) && !isCurrentExecutable(candidate2, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate2)) ?? null;
|
|
112267
112380
|
}
|
|
112268
112381
|
function isGeneratedRuntimeWrapper(candidate2) {
|
|
112269
112382
|
try {
|