oh-my-opencode 5.0.0-beta.1 → 5.0.0-beta.10
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/README.md +12 -1
- 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/sisyphus-runtime-prompt-reconciler.d.ts +15 -4
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/index.js +797 -465
- package/dist/cli/run/on-complete-hook.d.ts +2 -0
- package/dist/cli-node/index.js +797 -465
- 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 +1511 -1140
- package/dist/shared/normalize-sdk-response.d.ts +1 -0
- package/dist/shared/shell-env.d.ts +1 -1
- package/dist/skills/coding-agent-sessions/SKILL.md +3 -2
- package/dist/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/dist/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +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 +179 -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 +176 -14
- package/package.json +21 -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/lsp-core/src/lsp/client-wrapper.test.ts +60 -7
- package/packages/lsp-core/src/lsp/client-wrapper.ts +69 -16
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
- package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
- package/packages/lsp-core/src/tools/navigation.ts +4 -2
- package/packages/lsp-core/src/tools/rename.ts +4 -2
- package/packages/lsp-core/src/tools/symbols.ts +1 -1
- package/packages/lsp-daemon/dist/cli.js +83 -29
- package/packages/lsp-daemon/dist/client.js +76 -22
- package/packages/lsp-daemon/dist/index.js +81 -27
- package/packages/lsp-tools-mcp/dist/cli.js +76 -22
- package/packages/lsp-tools-mcp/dist/mcp.js +76 -22
- package/packages/lsp-tools-mcp/dist/tools.js +76 -22
- 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 +118 -8
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +118 -8
- 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 +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +83 -29
- 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/AGENTS.md +3 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/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/dist/cli.js +24 -12
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +24 -12
- 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/directive.md +6 -0
- 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/ultrawork/SKILL.md +6 -0
- 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/directive.md +6 -0
- 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/SKILL.md +3 -2
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -0
- 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/coding-agent-sessions/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +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 +179 -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/ultrawork/SKILL.md +6 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -0
- 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 +57 -19
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- 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 +179 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +2 -2
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +27 -3
- package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
- package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
package/dist/cli-node/index.js
CHANGED
|
@@ -1020,7 +1020,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1020
1020
|
this._exitCallback = (err) => {
|
|
1021
1021
|
if (err.code !== "commander.executeSubCommandAsync") {
|
|
1022
1022
|
throw err;
|
|
1023
|
-
}
|
|
1023
|
+
}
|
|
1024
1024
|
};
|
|
1025
1025
|
}
|
|
1026
1026
|
return this;
|
|
@@ -2146,7 +2146,7 @@ var package_default;
|
|
|
2146
2146
|
var init_package = __esm(() => {
|
|
2147
2147
|
package_default = {
|
|
2148
2148
|
name: "oh-my-opencode",
|
|
2149
|
-
version: "5.0.0-beta.
|
|
2149
|
+
version: "5.0.0-beta.10",
|
|
2150
2150
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
2151
2151
|
main: "./dist/index.js",
|
|
2152
2152
|
types: "dist/index.d.ts",
|
|
@@ -2282,6 +2282,7 @@ var init_package = __esm(() => {
|
|
|
2282
2282
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
2283
2283
|
test: "bun test",
|
|
2284
2284
|
"test:codex": "bun run build:codex-install && bun run build:git-bash-mcp && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && npm --prefix packages/lsp-tools-mcp test && npm --prefix packages/omo-codex/plugin ci && npm --prefix packages/omo-codex/plugin/components/ulw-loop test && bun run --cwd packages/omo-codex/plugin build && npm --prefix packages/omo-codex/plugin/components/codegraph run typecheck && npm --prefix packages/omo-codex/plugin/components/codegraph test && node scripts/check-third-party-notices.mjs --ship && bun test packages/omo-opencode/src/cli/cli-installer.platform.test.ts packages/omo-codex/src/install/codex-cache.test.ts packages/omo-codex/src/install/codex-cleanup.test.ts packages/omo-codex/src/install/codex-config-agent-cleanup.test.ts packages/omo-codex/src/install/codex-config-autonomous-features.test.ts packages/omo-codex/src/install/codex-config-reasoning.test.ts packages/omo-codex/src/install/codex-config-toml.test.ts packages/omo-codex/src/install/codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex.test.ts packages/omo-codex/src/install/install-codex-packaged.test.ts packages/omo-codex/src/install/link-cached-plugin-agents.test.ts packages/omo-codex/src/**/*.test.ts packages/utils/src/jsonc-parser.test.ts packages/utils/src/frontmatter.test.ts packages/hashline-core/src/hash-computation.test.ts packages/hashline-core/src/smoke-untested-modules.test.ts packages/rules-engine/src/index.test.ts packages/rules-engine/src/security-boundary.test.ts packages/agents-md-core/src/injector.test.ts packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts && node --test packages/omo-codex/plugin/test/*.test.mjs packages/omo-codex/scripts/install-cache-copy.test.mjs packages/omo-codex/scripts/install-cli-args.test.mjs packages/omo-codex/scripts/install-delegated-command.test.mjs packages/omo-codex/scripts/install-config-autonomous-features.test.mjs packages/omo-codex/scripts/install-config-autonomous.test.mjs packages/omo-codex/scripts/install-config-reasoning.test.mjs packages/omo-codex/scripts/install-config.test.mjs packages/omo-codex/scripts/install-hook-targets.test.mjs packages/omo-codex/scripts/install-project-local-cleanup.test.mjs packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs packages/omo-codex/scripts/install-local-entrypoint.test.mjs packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs packages/omo-codex/scripts/install-local.test.mjs packages/omo-codex/scripts/install-marketplace-cache.test.mjs packages/omo-codex/scripts/install-mcp-context7-runtime.test.mjs packages/omo-codex/scripts/install-mcp-runtime.test.mjs packages/omo-codex/scripts/install-packaged-local.test.mjs packages/omo-codex/scripts/install-generated-bundle.test.mjs packages/omo-codex/scripts/install-agent-links.test.mjs packages/omo-codex/scripts/install-bin-links.test.mjs",
|
|
2285
|
+
"test:fast": "bun run script/test-fast.ts",
|
|
2285
2286
|
"test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test packages/omo-senpi",
|
|
2286
2287
|
"test:windows-codex": "bun run test:codex",
|
|
2287
2288
|
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
|
|
@@ -2326,7 +2327,7 @@ var init_package = __esm(() => {
|
|
|
2326
2327
|
zod: "^4.4.3"
|
|
2327
2328
|
},
|
|
2328
2329
|
devDependencies: {
|
|
2329
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
2330
|
+
"@code-yeongyu/senpi": "2026.8.18-2",
|
|
2330
2331
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
2331
2332
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
2332
2333
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
@@ -2342,6 +2343,7 @@ var init_package = __esm(() => {
|
|
|
2342
2343
|
"@oh-my-opencode/model-core": "workspace:*",
|
|
2343
2344
|
"@oh-my-opencode/omo-codex": "workspace:*",
|
|
2344
2345
|
"@oh-my-opencode/omo-config-core": "workspace:*",
|
|
2346
|
+
"@oh-my-opencode/omo-opencode": "workspace:*",
|
|
2345
2347
|
"@oh-my-opencode/omo-senpi": "workspace:*",
|
|
2346
2348
|
"@oh-my-opencode/openclaw-core": "workspace:*",
|
|
2347
2349
|
"@oh-my-opencode/pi-goal": "workspace:*",
|
|
@@ -2357,7 +2359,7 @@ var init_package = __esm(() => {
|
|
|
2357
2359
|
"@oh-my-opencode/utils": "workspace:*",
|
|
2358
2360
|
"@types/js-yaml": "^4.0.9",
|
|
2359
2361
|
"@types/picomatch": "^4.0.3",
|
|
2360
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
2362
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
2361
2363
|
"@xterm/addon-unicode11": "^0.9.0",
|
|
2362
2364
|
"@xterm/xterm": "^6.0.0",
|
|
2363
2365
|
"bun-types": "1.3.14",
|
|
@@ -2366,24 +2368,24 @@ var init_package = __esm(() => {
|
|
|
2366
2368
|
typescript: "^7.0.2"
|
|
2367
2369
|
},
|
|
2368
2370
|
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.
|
|
2371
|
+
"oh-my-opencode-darwin-arm64": "5.0.0-beta.10",
|
|
2372
|
+
"oh-my-opencode-darwin-x64": "5.0.0-beta.10",
|
|
2373
|
+
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.10",
|
|
2374
|
+
"oh-my-opencode-linux-arm64": "5.0.0-beta.10",
|
|
2375
|
+
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.10",
|
|
2376
|
+
"oh-my-opencode-linux-x64": "5.0.0-beta.10",
|
|
2377
|
+
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.10",
|
|
2378
|
+
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.10",
|
|
2379
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.10",
|
|
2380
|
+
"oh-my-opencode-windows-arm64": "5.0.0-beta.10",
|
|
2381
|
+
"oh-my-opencode-windows-x64": "5.0.0-beta.10",
|
|
2382
|
+
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.10"
|
|
2381
2383
|
},
|
|
2382
2384
|
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.
|
|
2385
|
+
"@earendil-works/pi-agent-core": "0.84.2",
|
|
2386
|
+
"@earendil-works/pi-ai": "0.84.2",
|
|
2387
|
+
"@earendil-works/pi-coding-agent": "0.84.2",
|
|
2388
|
+
"@earendil-works/pi-tui": "0.84.2",
|
|
2387
2389
|
hono: "^4.12.18",
|
|
2388
2390
|
"@hono/node-server": "^1.19.13",
|
|
2389
2391
|
"express-rate-limit": "^8.5.1",
|
|
@@ -18762,7 +18764,7 @@ function finalize(ctx, schema) {
|
|
|
18762
18764
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
18763
18765
|
} else if (ctx.target === "draft-04") {
|
|
18764
18766
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
18765
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
18767
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
18766
18768
|
if (ctx.external?.uri) {
|
|
18767
18769
|
const id = ctx.external.registry.get(schema)?.id;
|
|
18768
18770
|
if (!id)
|
|
@@ -19023,7 +19025,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
19023
19025
|
if (val === undefined) {
|
|
19024
19026
|
if (ctx.unrepresentable === "throw") {
|
|
19025
19027
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
19026
|
-
}
|
|
19028
|
+
}
|
|
19027
19029
|
} else if (typeof val === "bigint") {
|
|
19028
19030
|
if (ctx.unrepresentable === "throw") {
|
|
19029
19031
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -22405,15 +22407,16 @@ var init_codegraph = __esm(() => {
|
|
|
22405
22407
|
});
|
|
22406
22408
|
|
|
22407
22409
|
// packages/omo-config-core/src/schema/memory.ts
|
|
22408
|
-
var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
|
|
22410
|
+
var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryNudgeSchema, OmoMemoryFactsSchema, OmoMemoryDreamSchema, OmoMemoryPeopleSchema, OmoMemorySoulSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryNudgeLayerSchema, OmoMemoryFactsLayerSchema, OmoMemoryDreamLayerSchema, OmoMemoryPeopleLayerSchema, OmoMemorySoulLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
|
|
22409
22411
|
var init_memory = __esm(() => {
|
|
22410
22412
|
init_zod();
|
|
22411
22413
|
OmoMemoryReflectionTriggerSchema = object({
|
|
22412
|
-
step_count: number2().int().nonnegative().default(
|
|
22414
|
+
step_count: number2().int().nonnegative().default(25),
|
|
22413
22415
|
on_compaction: boolean2().default(true)
|
|
22414
22416
|
}).strict();
|
|
22415
22417
|
OmoMemoryReflectionSchema = object({
|
|
22416
|
-
|
|
22418
|
+
enabled: boolean2().default(true),
|
|
22419
|
+
trigger: OmoMemoryReflectionTriggerSchema.default({ step_count: 25, on_compaction: true }),
|
|
22417
22420
|
merge: _enum2(["auto", "integration"]).default("auto"),
|
|
22418
22421
|
category: string2().min(1).default("quick"),
|
|
22419
22422
|
timeout_minutes: number2().int().positive().default(15),
|
|
@@ -22426,11 +22429,36 @@ var init_memory = __esm(() => {
|
|
|
22426
22429
|
OmoMemorySearchSchema = object({
|
|
22427
22430
|
enabled: boolean2().default(true)
|
|
22428
22431
|
}).strict();
|
|
22432
|
+
OmoMemoryNudgeSchema = object({
|
|
22433
|
+
enabled: boolean2().default(true),
|
|
22434
|
+
every_user_turns: number2().int().min(1).default(10)
|
|
22435
|
+
}).strict();
|
|
22436
|
+
OmoMemoryFactsSchema = object({
|
|
22437
|
+
enabled: boolean2().default(true),
|
|
22438
|
+
debounce_settles: number2().int().min(1).default(4)
|
|
22439
|
+
}).strict();
|
|
22440
|
+
OmoMemoryDreamSchema = object({
|
|
22441
|
+
enabled: boolean2().default(true),
|
|
22442
|
+
idle_minutes: number2().int().min(0).default(30),
|
|
22443
|
+
min_hours_between: number2().int().min(1).default(24),
|
|
22444
|
+
shutdown_launch: boolean2().default(true),
|
|
22445
|
+
auto_select_max: number2().int().min(1).max(10).default(5),
|
|
22446
|
+
auto_select_max_chars: number2().int().min(1e4).default(150000)
|
|
22447
|
+
}).strict();
|
|
22448
|
+
OmoMemoryPeopleSchema = object({
|
|
22449
|
+
enabled: boolean2().default(true),
|
|
22450
|
+
max_entries: number2().int().min(1).max(100).default(40),
|
|
22451
|
+
max_entry_chars: number2().int().min(50).max(500).default(200)
|
|
22452
|
+
}).strict();
|
|
22453
|
+
OmoMemorySoulSchema = object({
|
|
22454
|
+
edit_notice: boolean2().default(true)
|
|
22455
|
+
}).strict();
|
|
22429
22456
|
OmoMemoryReflectionTriggerLayerSchema = object({
|
|
22430
22457
|
step_count: number2().int().nonnegative().optional(),
|
|
22431
22458
|
on_compaction: boolean2().optional()
|
|
22432
22459
|
}).strict();
|
|
22433
22460
|
OmoMemoryReflectionLayerSchema = object({
|
|
22461
|
+
enabled: boolean2().optional(),
|
|
22434
22462
|
trigger: OmoMemoryReflectionTriggerLayerSchema.optional(),
|
|
22435
22463
|
merge: _enum2(["auto", "integration"]).optional(),
|
|
22436
22464
|
category: string2().min(1).optional(),
|
|
@@ -22444,10 +22472,39 @@ var init_memory = __esm(() => {
|
|
|
22444
22472
|
OmoMemorySearchLayerSchema = object({
|
|
22445
22473
|
enabled: boolean2().optional()
|
|
22446
22474
|
}).strict();
|
|
22475
|
+
OmoMemoryNudgeLayerSchema = object({
|
|
22476
|
+
enabled: boolean2().optional(),
|
|
22477
|
+
every_user_turns: number2().int().min(1).optional()
|
|
22478
|
+
}).strict();
|
|
22479
|
+
OmoMemoryFactsLayerSchema = object({
|
|
22480
|
+
enabled: boolean2().optional(),
|
|
22481
|
+
debounce_settles: number2().int().min(1).optional()
|
|
22482
|
+
}).strict();
|
|
22483
|
+
OmoMemoryDreamLayerSchema = object({
|
|
22484
|
+
enabled: boolean2().optional(),
|
|
22485
|
+
idle_minutes: number2().int().min(0).optional(),
|
|
22486
|
+
min_hours_between: number2().int().min(1).optional(),
|
|
22487
|
+
shutdown_launch: boolean2().optional(),
|
|
22488
|
+
auto_select_max: number2().int().min(1).max(10).optional(),
|
|
22489
|
+
auto_select_max_chars: number2().int().min(1e4).optional()
|
|
22490
|
+
}).strict();
|
|
22491
|
+
OmoMemoryPeopleLayerSchema = object({
|
|
22492
|
+
enabled: boolean2().optional(),
|
|
22493
|
+
max_entries: number2().int().min(1).max(100).optional(),
|
|
22494
|
+
max_entry_chars: number2().int().min(50).max(500).optional()
|
|
22495
|
+
}).strict();
|
|
22496
|
+
OmoMemorySoulLayerSchema = object({
|
|
22497
|
+
edit_notice: boolean2().optional()
|
|
22498
|
+
}).strict();
|
|
22447
22499
|
OmoMemoryAgentOverridesSchema = object({
|
|
22448
22500
|
enabled: boolean2().optional(),
|
|
22449
22501
|
agent: string2().min(1).optional(),
|
|
22450
22502
|
reflection: OmoMemoryReflectionLayerSchema.optional(),
|
|
22503
|
+
nudge: OmoMemoryNudgeLayerSchema.optional(),
|
|
22504
|
+
facts: OmoMemoryFactsLayerSchema.optional(),
|
|
22505
|
+
dream: OmoMemoryDreamLayerSchema.optional(),
|
|
22506
|
+
people: OmoMemoryPeopleLayerSchema.optional(),
|
|
22507
|
+
soul: OmoMemorySoulLayerSchema.optional(),
|
|
22451
22508
|
sync: OmoMemorySyncLayerSchema.optional(),
|
|
22452
22509
|
search: OmoMemorySearchLayerSchema.optional(),
|
|
22453
22510
|
compile_warn_tokens: number2().int().positive().optional()
|
|
@@ -22455,13 +22512,27 @@ var init_memory = __esm(() => {
|
|
|
22455
22512
|
OmoMemorySettingsSchema = object({
|
|
22456
22513
|
enabled: boolean2().default(true),
|
|
22457
22514
|
agent: string2().min(1).default("auto"),
|
|
22515
|
+
tool_exposure: _enum2(["direct", "search"]).default("direct"),
|
|
22458
22516
|
reflection: OmoMemoryReflectionSchema.default({
|
|
22459
|
-
|
|
22517
|
+
enabled: true,
|
|
22518
|
+
trigger: { step_count: 25, on_compaction: true },
|
|
22460
22519
|
merge: "auto",
|
|
22461
22520
|
category: "quick",
|
|
22462
22521
|
timeout_minutes: 15,
|
|
22463
22522
|
sandbox: "auto"
|
|
22464
22523
|
}),
|
|
22524
|
+
nudge: OmoMemoryNudgeSchema.default({ enabled: true, every_user_turns: 10 }),
|
|
22525
|
+
facts: OmoMemoryFactsSchema.default({ enabled: true, debounce_settles: 4 }),
|
|
22526
|
+
dream: OmoMemoryDreamSchema.default({
|
|
22527
|
+
enabled: true,
|
|
22528
|
+
idle_minutes: 30,
|
|
22529
|
+
min_hours_between: 24,
|
|
22530
|
+
shutdown_launch: true,
|
|
22531
|
+
auto_select_max: 5,
|
|
22532
|
+
auto_select_max_chars: 150000
|
|
22533
|
+
}),
|
|
22534
|
+
people: OmoMemoryPeopleSchema.default({ enabled: true, max_entries: 40, max_entry_chars: 200 }),
|
|
22535
|
+
soul: OmoMemorySoulSchema.default({ edit_notice: true }),
|
|
22465
22536
|
sync: OmoMemorySyncSchema.default({ enabled: true }),
|
|
22466
22537
|
search: OmoMemorySearchSchema.default({ enabled: true }),
|
|
22467
22538
|
compile_warn_tokens: number2().int().positive().default(30000),
|
|
@@ -22470,7 +22541,13 @@ var init_memory = __esm(() => {
|
|
|
22470
22541
|
OmoMemorySettingsLayerSchema = object({
|
|
22471
22542
|
enabled: boolean2().optional(),
|
|
22472
22543
|
agent: string2().min(1).optional(),
|
|
22544
|
+
tool_exposure: _enum2(["direct", "search"]).optional(),
|
|
22473
22545
|
reflection: OmoMemoryReflectionLayerSchema.optional(),
|
|
22546
|
+
nudge: OmoMemoryNudgeLayerSchema.optional(),
|
|
22547
|
+
facts: OmoMemoryFactsLayerSchema.optional(),
|
|
22548
|
+
dream: OmoMemoryDreamLayerSchema.optional(),
|
|
22549
|
+
people: OmoMemoryPeopleLayerSchema.optional(),
|
|
22550
|
+
soul: OmoMemorySoulLayerSchema.optional(),
|
|
22474
22551
|
sync: OmoMemorySyncLayerSchema.optional(),
|
|
22475
22552
|
search: OmoMemorySearchLayerSchema.optional(),
|
|
22476
22553
|
compile_warn_tokens: number2().int().positive().optional(),
|
|
@@ -22509,7 +22586,7 @@ function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism
|
|
|
22509
22586
|
residency_max_children: record2["residency_max_children"] ?? Math.max(8, resolveParallelism() * 3)
|
|
22510
22587
|
});
|
|
22511
22588
|
}
|
|
22512
|
-
var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskSettingsSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
|
|
22589
|
+
var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
|
|
22513
22590
|
var init_task = __esm(() => {
|
|
22514
22591
|
init_zod();
|
|
22515
22592
|
ResidencyMaxChildrenInputSchema = union([number2().int().positive(), literal("unlimited")]);
|
|
@@ -22526,6 +22603,16 @@ var init_task = __esm(() => {
|
|
|
22526
22603
|
OmoTaskWarningsSchema = object({
|
|
22527
22604
|
unavailable_categories: boolean2().default(true)
|
|
22528
22605
|
}).strict();
|
|
22606
|
+
OmoTaskDagSettingsSchema = object({
|
|
22607
|
+
max_nodes_per_run: number2().int().positive().default(64),
|
|
22608
|
+
max_runs_per_session: number2().int().positive().default(16),
|
|
22609
|
+
subscriber_ring: number2().int().positive().default(1000),
|
|
22610
|
+
heartbeat_ms: number2().int().positive().default(15000),
|
|
22611
|
+
history_default_limit: number2().int().positive().default(256),
|
|
22612
|
+
history_max_limit: number2().int().positive().default(1000),
|
|
22613
|
+
retention_days: number2().int().positive().default(7),
|
|
22614
|
+
max_prompt_bytes: number2().int().positive().default(262144)
|
|
22615
|
+
}).strict();
|
|
22529
22616
|
OmoTaskSettingsSchema = object({
|
|
22530
22617
|
default_execution_mode: _enum2(["in-process", "process"]).default("in-process"),
|
|
22531
22618
|
default_concurrency: number2().int().positive().default(5),
|
|
@@ -22543,7 +22630,18 @@ var init_task = __esm(() => {
|
|
|
22543
22630
|
max_members: 8,
|
|
22544
22631
|
max_parallel_members: 4,
|
|
22545
22632
|
max_wall_clock_minutes: 120
|
|
22546
|
-
})
|
|
22633
|
+
}),
|
|
22634
|
+
dag: OmoTaskDagSettingsSchema.optional()
|
|
22635
|
+
}).strict();
|
|
22636
|
+
OmoTaskDagSettingsLayerSchema = object({
|
|
22637
|
+
max_nodes_per_run: number2().int().positive().optional(),
|
|
22638
|
+
max_runs_per_session: number2().int().positive().optional(),
|
|
22639
|
+
subscriber_ring: number2().int().positive().optional(),
|
|
22640
|
+
heartbeat_ms: number2().int().positive().optional(),
|
|
22641
|
+
history_default_limit: number2().int().positive().optional(),
|
|
22642
|
+
history_max_limit: number2().int().positive().optional(),
|
|
22643
|
+
retention_days: number2().int().positive().optional(),
|
|
22644
|
+
max_prompt_bytes: number2().int().positive().optional()
|
|
22547
22645
|
}).strict();
|
|
22548
22646
|
OmoTaskWaitLayerSchema = object({
|
|
22549
22647
|
min_ms: number2().int().positive().optional(),
|
|
@@ -22571,7 +22669,8 @@ var init_task = __esm(() => {
|
|
|
22571
22669
|
resume_children: boolean2().optional(),
|
|
22572
22670
|
warnings: OmoTaskWarningsLayerSchema.optional(),
|
|
22573
22671
|
wait: OmoTaskWaitLayerSchema.optional(),
|
|
22574
|
-
team: OmoTaskTeamSettingsLayerSchema.optional()
|
|
22672
|
+
team: OmoTaskTeamSettingsLayerSchema.optional(),
|
|
22673
|
+
dag: OmoTaskDagSettingsLayerSchema.optional()
|
|
22575
22674
|
}).strict();
|
|
22576
22675
|
});
|
|
22577
22676
|
|
|
@@ -22626,6 +22725,19 @@ var init_team = __esm(() => {
|
|
|
22626
22725
|
OmoTeamsConfigLayerSchema = record(string2(), OmoTeamSpecLayerSchema);
|
|
22627
22726
|
});
|
|
22628
22727
|
|
|
22728
|
+
// packages/omo-config-core/src/schema/telemetry.ts
|
|
22729
|
+
var OmoTelemetrySettingsShape, OmoTelemetrySettingsLayerSchema, OmoTelemetrySettingsSchema;
|
|
22730
|
+
var init_telemetry = __esm(() => {
|
|
22731
|
+
init_zod();
|
|
22732
|
+
OmoTelemetrySettingsShape = {
|
|
22733
|
+
enabled: boolean2()
|
|
22734
|
+
};
|
|
22735
|
+
OmoTelemetrySettingsLayerSchema = object(OmoTelemetrySettingsShape).partial().strict();
|
|
22736
|
+
OmoTelemetrySettingsSchema = OmoTelemetrySettingsLayerSchema.extend({
|
|
22737
|
+
enabled: boolean2().default(true)
|
|
22738
|
+
}).strict();
|
|
22739
|
+
});
|
|
22740
|
+
|
|
22629
22741
|
// packages/omo-config-core/src/schema/config.ts
|
|
22630
22742
|
var OmoOpenCodeHarnessConfigSchema, OmoTypedHarnessConfigSchema, OmoConfigProfileSchema, OmoConfigSchema, OmoConfigLayerSchema;
|
|
22631
22743
|
var init_config = __esm(() => {
|
|
@@ -22637,6 +22749,7 @@ var init_config = __esm(() => {
|
|
|
22637
22749
|
init_model_catalog();
|
|
22638
22750
|
init_task();
|
|
22639
22751
|
init_team();
|
|
22752
|
+
init_telemetry();
|
|
22640
22753
|
OmoOpenCodeHarnessConfigSchema = record(string2(), unknown());
|
|
22641
22754
|
OmoTypedHarnessConfigSchema = object({
|
|
22642
22755
|
categories: OmoCategoriesConfigSchema.optional(),
|
|
@@ -22645,7 +22758,8 @@ var init_config = __esm(() => {
|
|
|
22645
22758
|
task: OmoTaskSettingsLayerSchema.optional(),
|
|
22646
22759
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
22647
22760
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
22648
|
-
memory: OmoMemorySettingsLayerSchema.optional()
|
|
22761
|
+
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
22762
|
+
telemetry: OmoTelemetrySettingsLayerSchema.optional()
|
|
22649
22763
|
}).strict();
|
|
22650
22764
|
OmoConfigProfileSchema = object({
|
|
22651
22765
|
categories: OmoCategoriesConfigSchema.optional(),
|
|
@@ -22655,6 +22769,7 @@ var init_config = __esm(() => {
|
|
|
22655
22769
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
22656
22770
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
22657
22771
|
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
22772
|
+
telemetry: OmoTelemetrySettingsLayerSchema.optional(),
|
|
22658
22773
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
22659
22774
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
22660
22775
|
"[codex]": OmoTypedHarnessConfigSchema.optional()
|
|
@@ -22668,6 +22783,7 @@ var init_config = __esm(() => {
|
|
|
22668
22783
|
teams: OmoTeamsConfigSchema.optional(),
|
|
22669
22784
|
models: OmoModelCatalogSchema.optional(),
|
|
22670
22785
|
memory: OmoMemorySettingsSchema.optional(),
|
|
22786
|
+
telemetry: OmoTelemetrySettingsSchema.optional(),
|
|
22671
22787
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
22672
22788
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
22673
22789
|
"[codex]": OmoTypedHarnessConfigSchema.optional(),
|
|
@@ -22684,6 +22800,7 @@ var init_config = __esm(() => {
|
|
|
22684
22800
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
22685
22801
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
22686
22802
|
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
22803
|
+
telemetry: OmoTelemetrySettingsLayerSchema.optional(),
|
|
22687
22804
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
22688
22805
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
22689
22806
|
"[codex]": OmoTypedHarnessConfigSchema.optional(),
|
|
@@ -22706,6 +22823,7 @@ var init_schema = __esm(() => {
|
|
|
22706
22823
|
init_model_ref();
|
|
22707
22824
|
init_task();
|
|
22708
22825
|
init_team();
|
|
22826
|
+
init_telemetry();
|
|
22709
22827
|
});
|
|
22710
22828
|
|
|
22711
22829
|
// packages/omo-config-core/src/loader/merge.ts
|
|
@@ -24268,16 +24386,30 @@ function invocationsForPlatform(scriptPath, platform) {
|
|
|
24268
24386
|
async function runInvocation(input) {
|
|
24269
24387
|
const child = input.spawnProcess(input.invocation.command, input.invocation.args, { cwd: input.skillDir, env: input.env });
|
|
24270
24388
|
let timedOut = false;
|
|
24389
|
+
let terminateDeadline;
|
|
24390
|
+
let terminateDeadlineGrace;
|
|
24391
|
+
const killIgnored = new Promise((_, reject) => {
|
|
24392
|
+
terminateDeadline = () => reject(new Error("ast-grep install child ignored termination"));
|
|
24393
|
+
});
|
|
24271
24394
|
const timeout = setTimeout(() => {
|
|
24272
24395
|
timedOut = true;
|
|
24273
24396
|
child.kill();
|
|
24397
|
+
terminateDeadlineGrace = setTimeout(() => terminateDeadline?.(), KILL_GRACE_MS);
|
|
24274
24398
|
}, input.timeoutMs);
|
|
24275
|
-
timeout.unref?.();
|
|
24276
24399
|
try {
|
|
24277
|
-
const outcome = await child.outcome;
|
|
24278
|
-
|
|
24400
|
+
const outcome = await Promise.race([child.outcome, killIgnored]);
|
|
24401
|
+
if (timedOut)
|
|
24402
|
+
return { kind: "timed-out" };
|
|
24403
|
+
return outcome;
|
|
24404
|
+
} catch (error51) {
|
|
24405
|
+
if (error51 instanceof Error && error51.message.includes("ignored termination")) {
|
|
24406
|
+
return { kind: "spawn-error", error: error51, missingExecutable: false };
|
|
24407
|
+
}
|
|
24408
|
+
throw error51;
|
|
24279
24409
|
} finally {
|
|
24280
24410
|
clearTimeout(timeout);
|
|
24411
|
+
if (terminateDeadlineGrace !== undefined)
|
|
24412
|
+
clearTimeout(terminateDeadlineGrace);
|
|
24281
24413
|
}
|
|
24282
24414
|
}
|
|
24283
24415
|
function failedReason(outcome) {
|
|
@@ -24314,7 +24446,7 @@ async function runAstGrepSkillInstall(options) {
|
|
|
24314
24446
|
return { kind: "failed", reason: String(error51) };
|
|
24315
24447
|
}
|
|
24316
24448
|
}
|
|
24317
|
-
var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR", AST_GREP_INSTALL_TIMEOUT_MS = 30000;
|
|
24449
|
+
var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR", KILL_GRACE_MS = 1000, AST_GREP_INSTALL_TIMEOUT_MS = 30000;
|
|
24318
24450
|
var init_install_script = __esm(() => {
|
|
24319
24451
|
init_sg_manifest();
|
|
24320
24452
|
});
|
|
@@ -26377,10 +26509,10 @@ var init_category_model_requirements = __esm(() => {
|
|
|
26377
26509
|
quick: {
|
|
26378
26510
|
fallbackChain: [
|
|
26379
26511
|
{ providers: ["kimi-for-coding"], model: "kimi-for-coding-highspeed" },
|
|
26380
|
-
{ providers: ["
|
|
26512
|
+
{ providers: ["openai-codex"], model: "gpt-5.6-luna-fast", variant: "low" },
|
|
26381
26513
|
{ providers: ["deepseek"], model: "deepseek-v4-flash", variant: "off" },
|
|
26382
26514
|
{
|
|
26383
|
-
providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "
|
|
26515
|
+
providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "vercel"],
|
|
26384
26516
|
model: "qwen3.6-flash",
|
|
26385
26517
|
variant: "low"
|
|
26386
26518
|
},
|
|
@@ -26396,6 +26528,11 @@ var init_category_model_requirements = __esm(() => {
|
|
|
26396
26528
|
},
|
|
26397
26529
|
"unspecified-low": {
|
|
26398
26530
|
fallbackChain: [
|
|
26531
|
+
{
|
|
26532
|
+
providers: ["xai", "github-copilot", "opencode", "vercel"],
|
|
26533
|
+
model: "grok-4.6",
|
|
26534
|
+
variant: "xhigh"
|
|
26535
|
+
},
|
|
26399
26536
|
{
|
|
26400
26537
|
providers: ["openai", "quotio-openai", "github-copilot", "opencode", "vercel"],
|
|
26401
26538
|
model: "gpt-5.6-terra",
|
|
@@ -27630,6 +27767,7 @@ var init_context_limit_resolver2 = () => {};
|
|
|
27630
27767
|
|
|
27631
27768
|
// packages/omo-opencode/src/shared/normalize-sdk-response.ts
|
|
27632
27769
|
function normalizeSDKResponse(response, fallback, options) {
|
|
27770
|
+
const fallbackIsArray = Array.isArray(fallback);
|
|
27633
27771
|
if (response == null) {
|
|
27634
27772
|
return fallback;
|
|
27635
27773
|
}
|
|
@@ -27639,14 +27777,17 @@ function normalizeSDKResponse(response, fallback, options) {
|
|
|
27639
27777
|
if (typeof response === "object" && "data" in response) {
|
|
27640
27778
|
const data = response.data;
|
|
27641
27779
|
if (data != null) {
|
|
27780
|
+
if (fallbackIsArray && !Array.isArray(data)) {
|
|
27781
|
+
return fallback;
|
|
27782
|
+
}
|
|
27642
27783
|
return data;
|
|
27643
27784
|
}
|
|
27644
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
27785
|
+
if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
|
|
27645
27786
|
return response;
|
|
27646
27787
|
}
|
|
27647
27788
|
return fallback;
|
|
27648
27789
|
}
|
|
27649
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
27790
|
+
if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
|
|
27650
27791
|
return response;
|
|
27651
27792
|
}
|
|
27652
27793
|
return fallback;
|
|
@@ -28126,7 +28267,7 @@ This is NOT a default choice - it's for genuinely unclassifiable moderate-effort
|
|
|
28126
28267
|
</Category_Context>
|
|
28127
28268
|
|
|
28128
28269
|
<Caller_Warning>
|
|
28129
|
-
THIS CATEGORY USES
|
|
28270
|
+
THIS CATEGORY USES GROK 4.6 (xhigh).
|
|
28130
28271
|
|
|
28131
28272
|
**PROVIDE CLEAR STRUCTURE:**
|
|
28132
28273
|
1. MUST DO: Enumerate required actions explicitly
|
|
@@ -28158,7 +28299,7 @@ var init_openai_categories = __esm(() => {
|
|
|
28158
28299
|
},
|
|
28159
28300
|
{
|
|
28160
28301
|
name: "unspecified-low",
|
|
28161
|
-
config: { model: "
|
|
28302
|
+
config: { model: "xai/grok-4.6", variant: "xhigh" },
|
|
28162
28303
|
description: "Tasks that don't fit other categories, low effort required",
|
|
28163
28304
|
promptAppend: UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND
|
|
28164
28305
|
}
|
|
@@ -83055,6 +83196,47 @@ var init_model_capabilities_generated = __esm(() => {
|
|
|
83055
83196
|
input: 272000,
|
|
83056
83197
|
output: 128000
|
|
83057
83198
|
}
|
|
83199
|
+
},
|
|
83200
|
+
"grok-4.6": {
|
|
83201
|
+
id: "grok-4.6",
|
|
83202
|
+
family: "grok",
|
|
83203
|
+
reasoning: true,
|
|
83204
|
+
temperature: true,
|
|
83205
|
+
toolCall: true,
|
|
83206
|
+
modalities: {
|
|
83207
|
+
input: [
|
|
83208
|
+
"text",
|
|
83209
|
+
"image"
|
|
83210
|
+
],
|
|
83211
|
+
output: [
|
|
83212
|
+
"text"
|
|
83213
|
+
]
|
|
83214
|
+
},
|
|
83215
|
+
limit: {
|
|
83216
|
+
context: 500000,
|
|
83217
|
+
output: 500000
|
|
83218
|
+
}
|
|
83219
|
+
},
|
|
83220
|
+
"xai/grok-4.6": {
|
|
83221
|
+
id: "xai/grok-4.6",
|
|
83222
|
+
family: "grok",
|
|
83223
|
+
reasoning: true,
|
|
83224
|
+
temperature: true,
|
|
83225
|
+
toolCall: true,
|
|
83226
|
+
modalities: {
|
|
83227
|
+
input: [
|
|
83228
|
+
"text",
|
|
83229
|
+
"image",
|
|
83230
|
+
"pdf"
|
|
83231
|
+
],
|
|
83232
|
+
output: [
|
|
83233
|
+
"text"
|
|
83234
|
+
]
|
|
83235
|
+
},
|
|
83236
|
+
limit: {
|
|
83237
|
+
context: 500000,
|
|
83238
|
+
output: 500000
|
|
83239
|
+
}
|
|
83058
83240
|
}
|
|
83059
83241
|
}
|
|
83060
83242
|
};
|
|
@@ -83096,21 +83278,21 @@ var init_session_cursor = __esm(() => {
|
|
|
83096
83278
|
});
|
|
83097
83279
|
|
|
83098
83280
|
// packages/omo-opencode/src/shared/shell-env.ts
|
|
83099
|
-
function detectShellType() {
|
|
83100
|
-
if (
|
|
83101
|
-
const shell =
|
|
83281
|
+
function detectShellType(platform = process.platform, env2 = process.env) {
|
|
83282
|
+
if (env2.SHELL) {
|
|
83283
|
+
const shell = env2.SHELL;
|
|
83102
83284
|
if (shell.includes("csh") || shell.includes("tcsh")) {
|
|
83103
83285
|
return "csh";
|
|
83104
83286
|
}
|
|
83105
83287
|
return "unix";
|
|
83106
83288
|
}
|
|
83107
|
-
if (
|
|
83289
|
+
if (platform === "win32" && (env2.BASH_VERSION || env2.MSYSTEM || env2.WSL_DISTRO_NAME)) {
|
|
83108
83290
|
return "unix";
|
|
83109
83291
|
}
|
|
83110
|
-
if (
|
|
83292
|
+
if (env2.PSModulePath) {
|
|
83111
83293
|
return "powershell";
|
|
83112
83294
|
}
|
|
83113
|
-
return
|
|
83295
|
+
return platform === "win32" ? "cmd" : "unix";
|
|
83114
83296
|
}
|
|
83115
83297
|
var init_shell_env = () => {};
|
|
83116
83298
|
|
|
@@ -88768,7 +88950,7 @@ var init_activity_state = __esm(() => {
|
|
|
88768
88950
|
});
|
|
88769
88951
|
|
|
88770
88952
|
// packages/telemetry-core/src/constants.ts
|
|
88771
|
-
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
|
|
88953
|
+
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74", UNCONFIGURED_POSTHOG_API_KEY = "phc_REPLACE_ME_OMO_NATIVE";
|
|
88772
88954
|
|
|
88773
88955
|
// packages/telemetry-core/src/diagnostics.ts
|
|
88774
88956
|
import { appendFileSync as appendFileSync2, existsSync as existsSync27, mkdirSync as mkdirSync9, readFileSync as readFileSync13 } from "node:fs";
|
|
@@ -88906,6 +89088,9 @@ function shouldDisableTelemetry(input) {
|
|
|
88906
89088
|
const env2 = input.env ?? process.env;
|
|
88907
89089
|
const globalPrefix = input.globalEnvPrefix ?? "OMO";
|
|
88908
89090
|
const prefixes = Array.from(new Set([globalPrefix, input.productEnvPrefix]));
|
|
89091
|
+
if (isDisableFlag(env2["DO_NOT_TRACK"])) {
|
|
89092
|
+
return true;
|
|
89093
|
+
}
|
|
88909
89094
|
for (const prefix of prefixes) {
|
|
88910
89095
|
if (isDisableFlag(env2[`${prefix}_DISABLE_POSTHOG`])) {
|
|
88911
89096
|
return true;
|
|
@@ -88919,6 +89104,13 @@ function shouldDisableTelemetry(input) {
|
|
|
88919
89104
|
function getTelemetryApiKey(env2 = process.env, defaultApiKey = DEFAULT_POSTHOG_API_KEY) {
|
|
88920
89105
|
return env2["POSTHOG_API_KEY"]?.trim() ?? defaultApiKey;
|
|
88921
89106
|
}
|
|
89107
|
+
function isConfiguredTelemetryApiKey(apiKey) {
|
|
89108
|
+
const normalized = apiKey.trim();
|
|
89109
|
+
return normalized.length > 0 && normalized !== UNCONFIGURED_POSTHOG_API_KEY;
|
|
89110
|
+
}
|
|
89111
|
+
function hasTelemetryApiKey(env2, defaultApiKey) {
|
|
89112
|
+
return isConfiguredTelemetryApiKey(getTelemetryApiKey(env2, defaultApiKey));
|
|
89113
|
+
}
|
|
88922
89114
|
function getTelemetryHost(env2 = process.env, defaultHost = DEFAULT_POSTHOG_HOST) {
|
|
88923
89115
|
return env2["POSTHOG_HOST"]?.trim() || defaultHost;
|
|
88924
89116
|
}
|
|
@@ -88928,17 +89120,6 @@ var init_env2 = __esm(() => {
|
|
|
88928
89120
|
SEND_OPT_OUT_VALUES = ["0", "false", "no", "yes"];
|
|
88929
89121
|
});
|
|
88930
89122
|
|
|
88931
|
-
// packages/telemetry-core/src/machine-id.ts
|
|
88932
|
-
import { createHash as createHash4 } from "node:crypto";
|
|
88933
|
-
import os4 from "node:os";
|
|
88934
|
-
function getDefaultTelemetryOsProvider() {
|
|
88935
|
-
return os4;
|
|
88936
|
-
}
|
|
88937
|
-
function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
|
|
88938
|
-
return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
|
|
88939
|
-
}
|
|
88940
|
-
var init_machine_id = () => {};
|
|
88941
|
-
|
|
88942
89123
|
// node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
88943
89124
|
import { dirname as dirname17, posix as posix7, sep as sep7 } from "path";
|
|
88944
89125
|
function createModulerModifier() {
|
|
@@ -94313,6 +94494,17 @@ var init_index_node = __esm(() => {
|
|
|
94313
94494
|
};
|
|
94314
94495
|
});
|
|
94315
94496
|
|
|
94497
|
+
// packages/telemetry-core/src/machine-id.ts
|
|
94498
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
94499
|
+
import os4 from "node:os";
|
|
94500
|
+
function getDefaultTelemetryOsProvider() {
|
|
94501
|
+
return os4;
|
|
94502
|
+
}
|
|
94503
|
+
function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
|
|
94504
|
+
return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
|
|
94505
|
+
}
|
|
94506
|
+
var init_machine_id = () => {};
|
|
94507
|
+
|
|
94316
94508
|
// packages/telemetry-core/src/posthog-client.ts
|
|
94317
94509
|
class PostHogTelemetryTransport {
|
|
94318
94510
|
#client;
|
|
@@ -94334,7 +94526,7 @@ function createDefaultPostHogTransport(apiKey, options) {
|
|
|
94334
94526
|
}
|
|
94335
94527
|
function isTelemetryClientEnabled(input) {
|
|
94336
94528
|
const env2 = input.env ?? process.env;
|
|
94337
|
-
return !shouldDisableTelemetry({ env: env2, productEnvPrefix: input.product.productEnvPrefix }) &&
|
|
94529
|
+
return !shouldDisableTelemetry({ env: env2, productEnvPrefix: input.product.productEnvPrefix }) && hasTelemetryApiKey(env2, input.product.defaultApiKey);
|
|
94338
94530
|
}
|
|
94339
94531
|
function createTelemetryClient(input) {
|
|
94340
94532
|
if (!isTelemetryClientEnabled(input)) {
|
|
@@ -94400,7 +94592,8 @@ function createTransport(input) {
|
|
|
94400
94592
|
flushAt: 1,
|
|
94401
94593
|
flushInterval: 0,
|
|
94402
94594
|
host: getTelemetryHost(env2, input.product.defaultHost),
|
|
94403
|
-
disableGeoip: false
|
|
94595
|
+
disableGeoip: input.product.disableGeoip ?? false,
|
|
94596
|
+
...input.product.transportOptions
|
|
94404
94597
|
});
|
|
94405
94598
|
} catch (error51) {
|
|
94406
94599
|
input.diagnostics?.({
|
|
@@ -94477,6 +94670,17 @@ var init_posthog_client = __esm(() => {
|
|
|
94477
94670
|
};
|
|
94478
94671
|
});
|
|
94479
94672
|
|
|
94673
|
+
// packages/telemetry-core/src/events.ts
|
|
94674
|
+
var ALLOWED_DOLLAR_KEYS;
|
|
94675
|
+
var init_events = __esm(() => {
|
|
94676
|
+
ALLOWED_DOLLAR_KEYS = new Set([
|
|
94677
|
+
"$os",
|
|
94678
|
+
"$os_version",
|
|
94679
|
+
"$process_person_profile",
|
|
94680
|
+
"$session_id"
|
|
94681
|
+
]);
|
|
94682
|
+
});
|
|
94683
|
+
|
|
94480
94684
|
// packages/telemetry-core/src/record-daily-active.ts
|
|
94481
94685
|
var init_record_daily_active = () => {};
|
|
94482
94686
|
|
|
@@ -94485,6 +94689,7 @@ var init_src5 = __esm(() => {
|
|
|
94485
94689
|
init_activity_state();
|
|
94486
94690
|
init_diagnostics();
|
|
94487
94691
|
init_env2();
|
|
94692
|
+
init_events();
|
|
94488
94693
|
init_machine_id();
|
|
94489
94694
|
init_posthog_client();
|
|
94490
94695
|
init_record_daily_active();
|
|
@@ -94495,7 +94700,7 @@ var package_default2;
|
|
|
94495
94700
|
var init_package2 = __esm(() => {
|
|
94496
94701
|
package_default2 = {
|
|
94497
94702
|
name: "@oh-my-opencode/omo-codex",
|
|
94498
|
-
version: "5.0.0-beta.
|
|
94703
|
+
version: "5.0.0-beta.10",
|
|
94499
94704
|
type: "module",
|
|
94500
94705
|
private: true,
|
|
94501
94706
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -94709,7 +94914,7 @@ __export(exports_telemetry, {
|
|
|
94709
94914
|
__resetOsProviderForTesting: () => __resetOsProviderForTesting,
|
|
94710
94915
|
__resetActivityStateProviderForTesting: () => __resetActivityStateProviderForTesting
|
|
94711
94916
|
});
|
|
94712
|
-
var
|
|
94917
|
+
var init_telemetry2 = __esm(() => {
|
|
94713
94918
|
init_posthog();
|
|
94714
94919
|
});
|
|
94715
94920
|
|
|
@@ -95464,20 +95669,20 @@ var init_update_toasts = __esm(() => {
|
|
|
95464
95669
|
});
|
|
95465
95670
|
|
|
95466
95671
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
95467
|
-
import { existsSync as
|
|
95468
|
-
import { dirname as
|
|
95672
|
+
import { existsSync as existsSync48 } from "node:fs";
|
|
95673
|
+
import { dirname as dirname30, join as join76 } from "node:path";
|
|
95469
95674
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
95470
95675
|
function defaultGetModuleHostingWorkspace() {
|
|
95471
95676
|
try {
|
|
95472
|
-
const currentDir =
|
|
95677
|
+
const currentDir = dirname30(fileURLToPath5(import.meta.url));
|
|
95473
95678
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
95474
95679
|
if (!pkgJsonPath)
|
|
95475
95680
|
return null;
|
|
95476
|
-
const pkgDir =
|
|
95477
|
-
const nodeModulesDir =
|
|
95681
|
+
const pkgDir = dirname30(pkgJsonPath);
|
|
95682
|
+
const nodeModulesDir = dirname30(pkgDir);
|
|
95478
95683
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
95479
95684
|
return null;
|
|
95480
|
-
return
|
|
95685
|
+
return dirname30(nodeModulesDir);
|
|
95481
95686
|
} catch (error51) {
|
|
95482
95687
|
if (error51 instanceof Error) {
|
|
95483
95688
|
return null;
|
|
@@ -95618,8 +95823,8 @@ var init_background_update_check = __esm(() => {
|
|
|
95618
95823
|
init_package_json_locator();
|
|
95619
95824
|
init_update_toasts();
|
|
95620
95825
|
defaultDeps4 = {
|
|
95621
|
-
existsSync:
|
|
95622
|
-
join:
|
|
95826
|
+
existsSync: existsSync48,
|
|
95827
|
+
join: join76,
|
|
95623
95828
|
runBunInstallWithDetails,
|
|
95624
95829
|
log: log2,
|
|
95625
95830
|
getOpenCodeCacheDir,
|
|
@@ -95782,7 +95987,7 @@ async function showSpinnerToast(ctx, version3, message) {
|
|
|
95782
95987
|
duration: frameInterval + 50
|
|
95783
95988
|
}
|
|
95784
95989
|
}).catch(ignoreToastError);
|
|
95785
|
-
await new Promise((
|
|
95990
|
+
await new Promise((resolve22) => setTimeout(resolve22, frameInterval));
|
|
95786
95991
|
}
|
|
95787
95992
|
}
|
|
95788
95993
|
var SISYPHUS_SPINNER;
|
|
@@ -100574,7 +100779,7 @@ async function installAstGrepForCodex(options) {
|
|
|
100574
100779
|
// packages/omo-codex/src/install/codex-install-telemetry.ts
|
|
100575
100780
|
async function trackCodexInstallTelemetry() {
|
|
100576
100781
|
try {
|
|
100577
|
-
const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (
|
|
100782
|
+
const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (init_telemetry2(), exports_telemetry));
|
|
100578
100783
|
const posthog = createInstallPostHog2();
|
|
100579
100784
|
posthog.trackActive(getPostHogDistinctId2(), "install_completed");
|
|
100580
100785
|
await posthog.shutdown();
|
|
@@ -101394,22 +101599,136 @@ function nodeErrorCode6(error51) {
|
|
|
101394
101599
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
101395
101600
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101396
101601
|
import { execFile as execFile4 } from "node:child_process";
|
|
101397
|
-
import {
|
|
101398
|
-
import {
|
|
101399
|
-
import {
|
|
101400
|
-
import { homedir as homedir9 } from "node:os";
|
|
101401
|
-
import { dirname as dirname22, join as join60, resolve as resolve18 } from "node:path";
|
|
101602
|
+
import { existsSync as existsSync32 } from "node:fs";
|
|
101603
|
+
import { homedir as homedir11 } from "node:os";
|
|
101604
|
+
import { dirname as dirname24, join as join63, resolve as resolve20 } from "node:path";
|
|
101402
101605
|
import { fileURLToPath } from "node:url";
|
|
101403
101606
|
import { promisify as promisify2 } from "node:util";
|
|
101404
101607
|
|
|
101608
|
+
// packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
|
|
101609
|
+
import { existsSync as existsSync30 } from "node:fs";
|
|
101610
|
+
import { homedir as homedir9 } from "node:os";
|
|
101611
|
+
import { join as join59, resolve as resolve17 } from "node:path";
|
|
101612
|
+
var AGENT_DIR_ENV_NAMES = [
|
|
101613
|
+
"OMO_CODING_AGENT_DIR",
|
|
101614
|
+
"SENPI_CODING_AGENT_DIR",
|
|
101615
|
+
"PI_CODING_AGENT_DIR"
|
|
101616
|
+
];
|
|
101617
|
+
var AGENT_HOME_SENTINEL = "settings.json";
|
|
101618
|
+
function resolveAgentHome(options) {
|
|
101619
|
+
const { env: env3, homeDir = homedir9(), exists: exists7 = existsSync30 } = options;
|
|
101620
|
+
for (const name of AGENT_DIR_ENV_NAMES) {
|
|
101621
|
+
const configured = env3[name]?.trim();
|
|
101622
|
+
if (configured)
|
|
101623
|
+
return resolve17(configured);
|
|
101624
|
+
}
|
|
101625
|
+
const brandedHome = join59(homeDir, ".omo");
|
|
101626
|
+
const canonical = join59(brandedHome, "agent");
|
|
101627
|
+
if (exists7(join59(canonical, AGENT_HOME_SENTINEL)))
|
|
101628
|
+
return canonical;
|
|
101629
|
+
if (exists7(join59(brandedHome, AGENT_HOME_SENTINEL)))
|
|
101630
|
+
return brandedHome;
|
|
101631
|
+
return join59(homeDir, ".senpi", "agent");
|
|
101632
|
+
}
|
|
101633
|
+
|
|
101634
|
+
// packages/omo-senpi/src/install/local-launcher.ts
|
|
101635
|
+
import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync, writeFileSync as writeFileSync6 } from "node:fs";
|
|
101636
|
+
import { homedir as homedir10 } from "node:os";
|
|
101637
|
+
import { dirname as dirname21, join as join60, resolve as resolve18 } from "node:path";
|
|
101638
|
+
var MARKER = "omo-local-launcher";
|
|
101639
|
+
function localLauncherPath(homeDir = homedir10()) {
|
|
101640
|
+
return join60(homeDir, ".local", "bin", "omo");
|
|
101641
|
+
}
|
|
101642
|
+
function localLauncherCmdPath(homeDir = homedir10()) {
|
|
101643
|
+
return join60(homeDir, ".local", "bin", "omo.cmd");
|
|
101644
|
+
}
|
|
101645
|
+
function renderLocalLauncher(options) {
|
|
101646
|
+
const brand = {
|
|
101647
|
+
name: "omo",
|
|
101648
|
+
displayVersion: options.version ?? "local",
|
|
101649
|
+
configDir: ".omo",
|
|
101650
|
+
flatLayout: false,
|
|
101651
|
+
envPrefix: "OMO",
|
|
101652
|
+
userAgent: "omo",
|
|
101653
|
+
originator: "omo",
|
|
101654
|
+
update: {
|
|
101655
|
+
packageName: "omo-ai",
|
|
101656
|
+
distTag: "beta",
|
|
101657
|
+
command: "npm i -g omo-ai@beta",
|
|
101658
|
+
changelogUrl: "https://github.com/code-yeongyu/oh-my-openagent/releases"
|
|
101659
|
+
}
|
|
101660
|
+
};
|
|
101661
|
+
return `#!/usr/bin/env node
|
|
101662
|
+
// ${MARKER}: generated by the omo-senpi installer. Delete this file to remove the local launcher.
|
|
101663
|
+
import { spawn } from "node:child_process"
|
|
101664
|
+
import { homedir } from "node:os"
|
|
101665
|
+
import { join } from "node:path"
|
|
101666
|
+
|
|
101667
|
+
const brand = ${JSON.stringify(brand)}
|
|
101668
|
+
const cli = process.env.OMO_SENPI_CLI_PATH ?? ${JSON.stringify(options.senpiCliPath)}
|
|
101669
|
+
const plugin = process.env.OMO_PLUGIN_ROOT ?? ${JSON.stringify(options.pluginPath)}
|
|
101670
|
+
// The same directory the published launcher pins, so a local install shares one state location
|
|
101671
|
+
// with the published one and with anything either of them spawns.
|
|
101672
|
+
const agentDir = process.env.OMO_CODING_AGENT_DIR ?? process.env.SENPI_CODING_AGENT_DIR
|
|
101673
|
+
?? process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".omo", "agent")
|
|
101674
|
+
const env = {
|
|
101675
|
+
...process.env,
|
|
101676
|
+
SENPI_BRAND: JSON.stringify(brand),
|
|
101677
|
+
OMO_NATIVE: "1",
|
|
101678
|
+
OMO_CODING_AGENT_DIR: agentDir,
|
|
101679
|
+
SENPI_CODING_AGENT_DIR: agentDir,
|
|
101680
|
+
}
|
|
101681
|
+
// Anything resolving the product by name must re-enter through this launcher, never the engine.
|
|
101682
|
+
env.OMO_BIN = process.argv[1]
|
|
101683
|
+
const selfUpdate = process.argv[2] === "update"
|
|
101684
|
+
&& process.argv.slice(3).every((arg) => arg.startsWith("-") || ["self", "senpi", "omo"].includes(arg))
|
|
101685
|
+
&& !process.argv.slice(3).some((arg) => arg === "--extensions" || arg === "--models")
|
|
101686
|
+
if (selfUpdate) {
|
|
101687
|
+
console.log("omo is updated via npm: npm i -g omo-ai@beta")
|
|
101688
|
+
process.exit(0)
|
|
101689
|
+
}
|
|
101690
|
+
const child = spawn(process.execPath, [cli, "--extension", plugin, ...process.argv.slice(2)], {
|
|
101691
|
+
env,
|
|
101692
|
+
stdio: "inherit",
|
|
101693
|
+
})
|
|
101694
|
+
child.on("close", (code, signal) => {
|
|
101695
|
+
if (signal) {
|
|
101696
|
+
process.kill(process.pid, signal)
|
|
101697
|
+
return
|
|
101698
|
+
}
|
|
101699
|
+
process.exitCode = code ?? 1
|
|
101700
|
+
})
|
|
101701
|
+
`;
|
|
101702
|
+
}
|
|
101703
|
+
function installLocalLauncher(options) {
|
|
101704
|
+
const path6 = localLauncherPath(options.homeDir);
|
|
101705
|
+
if (existsSync31(path6) && !readFileSync14(path6, "utf8").includes(MARKER))
|
|
101706
|
+
return;
|
|
101707
|
+
mkdirSync10(dirname21(path6), { recursive: true });
|
|
101708
|
+
writeFileSync6(path6, renderLocalLauncher(options));
|
|
101709
|
+
chmodSync3(path6, 493);
|
|
101710
|
+
if ((options.platform ?? process.platform) === "win32") {
|
|
101711
|
+
writeFileSync6(localLauncherCmdPath(options.homeDir), `@echo off\r
|
|
101712
|
+
node "%~dp0omo" %*\r
|
|
101713
|
+
`);
|
|
101714
|
+
}
|
|
101715
|
+
return path6;
|
|
101716
|
+
}
|
|
101717
|
+
|
|
101718
|
+
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101719
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
101720
|
+
import { constants as constants8 } from "node:fs";
|
|
101721
|
+
import { access as access2, readFile as readFile26, stat as stat6 } from "node:fs/promises";
|
|
101722
|
+
import { dirname as dirname23, join as join62 } from "node:path";
|
|
101723
|
+
|
|
101405
101724
|
// packages/omo-senpi/src/install/senpi-settings.ts
|
|
101406
101725
|
import { constants as constants7 } from "node:fs";
|
|
101407
101726
|
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "node:fs/promises";
|
|
101408
|
-
import { dirname as
|
|
101727
|
+
import { dirname as dirname22, join as join61, resolve as resolve19 } from "node:path";
|
|
101409
101728
|
var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
|
|
101410
101729
|
var LEGACY_BUILTIN_SHADOW_PACKAGES = [
|
|
101411
|
-
|
|
101412
|
-
|
|
101730
|
+
join61("packages", "pi-goal"),
|
|
101731
|
+
join61("packages", "pi-webfetch")
|
|
101413
101732
|
];
|
|
101414
101733
|
async function readSettings(settingsPath) {
|
|
101415
101734
|
let raw;
|
|
@@ -101438,13 +101757,13 @@ function dedupePackages(packages) {
|
|
|
101438
101757
|
return [...new Set(packages)];
|
|
101439
101758
|
}
|
|
101440
101759
|
function removeLegacyBuiltinShadows(packages, repoRoot, agentDir) {
|
|
101441
|
-
const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) =>
|
|
101442
|
-
return packages.filter((entry) => !shadowPaths.has(
|
|
101760
|
+
const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) => resolve19(repoRoot, path6)));
|
|
101761
|
+
return packages.filter((entry) => !shadowPaths.has(resolve19(agentDir, entry)));
|
|
101443
101762
|
}
|
|
101444
101763
|
async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir) {
|
|
101445
|
-
const currentPath =
|
|
101764
|
+
const currentPath = resolve19(currentPluginPath);
|
|
101446
101765
|
const entries = await Promise.all(packages.map(async (entry) => {
|
|
101447
|
-
const packagePath =
|
|
101766
|
+
const packagePath = resolve19(agentDir, entry);
|
|
101448
101767
|
if (packagePath === currentPath)
|
|
101449
101768
|
return currentPath;
|
|
101450
101769
|
return await readPackageName(packagePath) === OMO_SENPI_PACKAGE_NAME ? undefined : entry;
|
|
@@ -101452,7 +101771,7 @@ async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir
|
|
|
101452
101771
|
return entries.filter((entry) => entry !== undefined);
|
|
101453
101772
|
}
|
|
101454
101773
|
async function writeSettingsAtomically(settingsPath, settings) {
|
|
101455
|
-
await mkdir9(
|
|
101774
|
+
await mkdir9(dirname22(settingsPath), { recursive: true });
|
|
101456
101775
|
const backupPath = await nextBackupPath(settingsPath);
|
|
101457
101776
|
if (await fileExists(settingsPath)) {
|
|
101458
101777
|
await copyFile3(settingsPath, backupPath);
|
|
@@ -101484,7 +101803,7 @@ function isRecord10(value) {
|
|
|
101484
101803
|
async function readPackageName(packagePath) {
|
|
101485
101804
|
let raw;
|
|
101486
101805
|
try {
|
|
101487
|
-
raw = await readFile25(
|
|
101806
|
+
raw = await readFile25(join61(packagePath, "package.json"), "utf8");
|
|
101488
101807
|
} catch (error51) {
|
|
101489
101808
|
if (isErrno(error51, "ENOENT") || isErrno(error51, "ENOTDIR"))
|
|
101490
101809
|
return;
|
|
@@ -101507,89 +101826,56 @@ function isErrno(error51, code) {
|
|
|
101507
101826
|
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101508
101827
|
}
|
|
101509
101828
|
|
|
101510
|
-
// packages/omo-senpi/src/install/
|
|
101511
|
-
var execFileAsync2 = promisify2(execFile4);
|
|
101829
|
+
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101512
101830
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
101513
|
-
|
|
101514
|
-
|
|
101515
|
-
|
|
101516
|
-
|
|
101517
|
-
|
|
101518
|
-
|
|
101519
|
-
|
|
101520
|
-
|
|
101521
|
-
|
|
101522
|
-
|
|
101523
|
-
|
|
101524
|
-
|
|
101525
|
-
|
|
101526
|
-
|
|
101527
|
-
|
|
101528
|
-
|
|
101529
|
-
|
|
101530
|
-
|
|
101531
|
-
|
|
101532
|
-
|
|
101533
|
-
|
|
101534
|
-
|
|
101535
|
-
|
|
101536
|
-
|
|
101537
|
-
|
|
101538
|
-
|
|
101539
|
-
|
|
101540
|
-
|
|
101541
|
-
|
|
101542
|
-
|
|
101543
|
-
|
|
101544
|
-
|
|
101545
|
-
|
|
101831
|
+
join62("extensions", "omo.js"),
|
|
101832
|
+
join62("extensions", "omo-task.js"),
|
|
101833
|
+
join62("extensions", "omo-member.js"),
|
|
101834
|
+
join62("extensions", "memory-run-supervisor.mjs"),
|
|
101835
|
+
join62("extensions", "reflection-persona.md"),
|
|
101836
|
+
join62("extensions", "dream-persona.md"),
|
|
101837
|
+
join62("extensions", "facts-persona.md"),
|
|
101838
|
+
join62("skills", "ast-grep", "SKILL.md"),
|
|
101839
|
+
join62("skills", "coding-agent-sessions", "SKILL.md"),
|
|
101840
|
+
join62("skills", "debugging", "SKILL.md"),
|
|
101841
|
+
join62("skills", "frontend", "SKILL.md"),
|
|
101842
|
+
join62("skills", "git-master", "SKILL.md"),
|
|
101843
|
+
join62("skills", "init-deep", "SKILL.md"),
|
|
101844
|
+
join62("skills", "lsp-setup", "SKILL.md"),
|
|
101845
|
+
join62("skills", "programming", "SKILL.md"),
|
|
101846
|
+
join62("skills", "refactor", "SKILL.md"),
|
|
101847
|
+
join62("skills", "remove-ai-slops", "SKILL.md"),
|
|
101848
|
+
join62("skills", "review-work", "SKILL.md"),
|
|
101849
|
+
join62("skills", "start-work", "SKILL.md"),
|
|
101850
|
+
join62("skills", "ultimate-browsing", "SKILL.md"),
|
|
101851
|
+
join62("skills", "ultrawork", "SKILL.md"),
|
|
101852
|
+
join62("skills", "ulw-loop", "SKILL.md"),
|
|
101853
|
+
join62("skills", "ulw-plan", "SKILL.md"),
|
|
101854
|
+
join62("skills", "ulw-research", "SKILL.md"),
|
|
101855
|
+
join62("skills", "visual-qa", "SKILL.md"),
|
|
101856
|
+
join62("runtime", "ast-grep-mcp", "cli.js"),
|
|
101857
|
+
join62("runtime", "agent-toolkit", "cli.js"),
|
|
101858
|
+
join62("runtime", "agent-toolkit", "ulw-loop", "cli.js"),
|
|
101859
|
+
join62("runtime", "agent-toolkit", "omo-agent-toolkit"),
|
|
101860
|
+
join62("runtime", "agent-toolkit", "omo-agent-toolkit.cmd"),
|
|
101861
|
+
join62("runtime", "lsp-daemon", "dist", "cli.js"),
|
|
101862
|
+
join62("runtime", "lsp-daemon", "dist", "index.js"),
|
|
101863
|
+
join62("runtime", "lsp-daemon", "dist", "index.d.ts"),
|
|
101864
|
+
join62("runtime", "lsp-daemon", "dist", "daemon-client.js"),
|
|
101865
|
+
join62("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
|
|
101866
|
+
join62("runtime", "lsp-daemon", "dist", "package.json"),
|
|
101867
|
+
join62("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
101868
|
+
join62("scripts", "install.mjs")
|
|
101546
101869
|
];
|
|
101547
|
-
async function runSenpiInstaller(options = {}) {
|
|
101548
|
-
const context = resolveInstallContext(options);
|
|
101549
|
-
await ensurePluginArtifacts(context);
|
|
101550
|
-
const settings = await readSettings(context.settingsPath);
|
|
101551
|
-
const before = JSON.stringify(settings);
|
|
101552
|
-
const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
|
|
101553
|
-
if (!packages.includes(context.pluginPath))
|
|
101554
|
-
packages.push(context.pluginPath);
|
|
101555
|
-
settings.packages = packages;
|
|
101556
|
-
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101557
|
-
return {
|
|
101558
|
-
ok: true,
|
|
101559
|
-
action: "install",
|
|
101560
|
-
agentDir: context.agentDir,
|
|
101561
|
-
settingsPath: context.settingsPath,
|
|
101562
|
-
pluginPath: context.pluginPath,
|
|
101563
|
-
changed: JSON.stringify(settings) !== before,
|
|
101564
|
-
backupPath
|
|
101565
|
-
};
|
|
101566
|
-
}
|
|
101567
|
-
function resolveInstallContext(options) {
|
|
101568
|
-
const env3 = options.env ?? process.env;
|
|
101569
|
-
const allowBuild = options.pluginPath === undefined;
|
|
101570
|
-
const repoRoot = resolve18(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname22(fileURLToPath(import.meta.url))) : dirname22(resolve18(options.pluginPath))));
|
|
101571
|
-
const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join60(homedir9(), ".senpi", "agent"));
|
|
101572
|
-
const pluginPath = resolve18(options.pluginPath ?? join60(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101573
|
-
return {
|
|
101574
|
-
env: env3,
|
|
101575
|
-
repoRoot,
|
|
101576
|
-
agentDir,
|
|
101577
|
-
settingsPath: join60(agentDir, "settings.json"),
|
|
101578
|
-
pluginPath,
|
|
101579
|
-
platform: options.platform ?? process.platform,
|
|
101580
|
-
allowBuild,
|
|
101581
|
-
runCommand: options.runCommand ?? defaultRunCommand3
|
|
101582
|
-
};
|
|
101583
|
-
}
|
|
101584
101870
|
async function ensurePluginArtifacts(context) {
|
|
101585
101871
|
if (context.allowBuild) {
|
|
101586
|
-
await context.runCommand("node", [
|
|
101587
|
-
await context.runCommand("node", [
|
|
101588
|
-
await context.runCommand("node", [
|
|
101589
|
-
await context.runCommand("node", [
|
|
101590
|
-
await context.runCommand("node", [
|
|
101591
|
-
await context.runCommand("node", [
|
|
101592
|
-
await context.runCommand("node", [
|
|
101872
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
101873
|
+
await context.runCommand("node", [join62("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
|
|
101874
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
101875
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
|
|
101876
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
|
|
101877
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
|
|
101878
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-agent-toolkit.mjs")], { cwd: context.repoRoot });
|
|
101593
101879
|
}
|
|
101594
101880
|
if (await hasMissingPluginArtifact(context.pluginPath)) {
|
|
101595
101881
|
throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
|
|
@@ -101598,14 +101884,14 @@ async function ensurePluginArtifacts(context) {
|
|
|
101598
101884
|
}
|
|
101599
101885
|
async function hasMissingPluginArtifact(pluginPath) {
|
|
101600
101886
|
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
101601
|
-
if (!await fileExists2(
|
|
101887
|
+
if (!await fileExists2(join62(pluginPath, artifact)))
|
|
101602
101888
|
return true;
|
|
101603
101889
|
}
|
|
101604
101890
|
return false;
|
|
101605
101891
|
}
|
|
101606
101892
|
async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
|
|
101607
|
-
const runtimeEntry =
|
|
101608
|
-
const manifestPath =
|
|
101893
|
+
const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
|
|
101894
|
+
const manifestPath = join62(dirname23(runtimeEntry), "manifest.json");
|
|
101609
101895
|
let runtimeStat;
|
|
101610
101896
|
try {
|
|
101611
101897
|
runtimeStat = await stat6(runtimeEntry);
|
|
@@ -101652,6 +101938,63 @@ function astGrepIntegrityError(runtimeEntry, reason) {
|
|
|
101652
101938
|
function messageOf(error51) {
|
|
101653
101939
|
return error51 instanceof Error ? error51.message : String(error51);
|
|
101654
101940
|
}
|
|
101941
|
+
async function fileExists2(path6) {
|
|
101942
|
+
try {
|
|
101943
|
+
await access2(path6, constants8.F_OK);
|
|
101944
|
+
return true;
|
|
101945
|
+
} catch (error51) {
|
|
101946
|
+
if (isErrno2(error51, "ENOENT"))
|
|
101947
|
+
return false;
|
|
101948
|
+
throw error51;
|
|
101949
|
+
}
|
|
101950
|
+
}
|
|
101951
|
+
function isErrno2(error51, code) {
|
|
101952
|
+
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101953
|
+
}
|
|
101954
|
+
|
|
101955
|
+
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101956
|
+
var execFileAsync2 = promisify2(execFile4);
|
|
101957
|
+
async function runSenpiInstaller(options = {}) {
|
|
101958
|
+
const context = resolveInstallContext(options);
|
|
101959
|
+
await ensurePluginArtifacts(context);
|
|
101960
|
+
const settings = await readSettings(context.settingsPath);
|
|
101961
|
+
const before = JSON.stringify(settings);
|
|
101962
|
+
const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
|
|
101963
|
+
if (!packages.includes(context.pluginPath))
|
|
101964
|
+
packages.push(context.pluginPath);
|
|
101965
|
+
settings.packages = packages;
|
|
101966
|
+
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101967
|
+
installLocalLauncher({
|
|
101968
|
+
pluginPath: context.pluginPath,
|
|
101969
|
+
senpiCliPath: join63(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
|
|
101970
|
+
});
|
|
101971
|
+
return {
|
|
101972
|
+
ok: true,
|
|
101973
|
+
action: "install",
|
|
101974
|
+
agentDir: context.agentDir,
|
|
101975
|
+
settingsPath: context.settingsPath,
|
|
101976
|
+
pluginPath: context.pluginPath,
|
|
101977
|
+
changed: JSON.stringify(settings) !== before,
|
|
101978
|
+
backupPath
|
|
101979
|
+
};
|
|
101980
|
+
}
|
|
101981
|
+
function resolveInstallContext(options) {
|
|
101982
|
+
const env3 = options.env ?? process.env;
|
|
101983
|
+
const allowBuild = options.pluginPath === undefined;
|
|
101984
|
+
const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve20(options.pluginPath))));
|
|
101985
|
+
const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env: env3, homeDir: env3.HOME ?? homedir11() }));
|
|
101986
|
+
const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101987
|
+
return {
|
|
101988
|
+
env: env3,
|
|
101989
|
+
repoRoot,
|
|
101990
|
+
agentDir,
|
|
101991
|
+
settingsPath: join63(agentDir, "settings.json"),
|
|
101992
|
+
pluginPath,
|
|
101993
|
+
platform: options.platform ?? process.platform,
|
|
101994
|
+
allowBuild,
|
|
101995
|
+
runCommand: options.runCommand ?? defaultRunCommand3
|
|
101996
|
+
};
|
|
101997
|
+
}
|
|
101655
101998
|
async function defaultRunCommand3(command, args, options) {
|
|
101656
101999
|
const result = await execFileAsync2(command, [...args], { cwd: options.cwd });
|
|
101657
102000
|
if (result.stderr.trim().length > 0)
|
|
@@ -101662,27 +102005,14 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
101662
102005
|
function findRepoRoot2(importerDir) {
|
|
101663
102006
|
let current = importerDir;
|
|
101664
102007
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
101665
|
-
if (fileExistsSync(
|
|
102008
|
+
if (fileExistsSync(join63(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
101666
102009
|
return current;
|
|
101667
|
-
current =
|
|
102010
|
+
current = resolve20(current, "..");
|
|
101668
102011
|
}
|
|
101669
102012
|
throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
|
|
101670
102013
|
}
|
|
101671
|
-
async function fileExists2(path6) {
|
|
101672
|
-
try {
|
|
101673
|
-
await access2(path6, constants8.F_OK);
|
|
101674
|
-
return true;
|
|
101675
|
-
} catch (error51) {
|
|
101676
|
-
if (isErrno2(error51, "ENOENT"))
|
|
101677
|
-
return false;
|
|
101678
|
-
throw error51;
|
|
101679
|
-
}
|
|
101680
|
-
}
|
|
101681
102014
|
function fileExistsSync(path6) {
|
|
101682
|
-
return
|
|
101683
|
-
}
|
|
101684
|
-
function isErrno2(error51, code) {
|
|
101685
|
-
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
102015
|
+
return existsSync32(path6);
|
|
101686
102016
|
}
|
|
101687
102017
|
// packages/omo-opencode/src/cli/star-request.ts
|
|
101688
102018
|
import { execFile as execFile5 } from "node:child_process";
|
|
@@ -101718,26 +102048,26 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
|
|
|
101718
102048
|
init_provider_availability();
|
|
101719
102049
|
|
|
101720
102050
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
101721
|
-
import { existsSync as
|
|
101722
|
-
import { join as
|
|
102051
|
+
import { existsSync as existsSync34, mkdirSync as mkdirSync11, readFileSync as readFileSync16 } from "node:fs";
|
|
102052
|
+
import { join as join65 } from "node:path";
|
|
101723
102053
|
|
|
101724
102054
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
101725
102055
|
init_shared();
|
|
101726
|
-
import { existsSync as
|
|
101727
|
-
import { join as
|
|
102056
|
+
import { existsSync as existsSync33, readFileSync as readFileSync15 } from "node:fs";
|
|
102057
|
+
import { join as join64 } from "node:path";
|
|
101728
102058
|
var TUI_SUBPATH = "tui";
|
|
101729
102059
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
101730
102060
|
function fileEntryPackageJsonPath(entry) {
|
|
101731
102061
|
let path6 = entry.slice("file:".length);
|
|
101732
102062
|
if (path6.startsWith("//"))
|
|
101733
102063
|
path6 = path6.slice(2);
|
|
101734
|
-
return
|
|
102064
|
+
return join64(path6, "package.json");
|
|
101735
102065
|
}
|
|
101736
102066
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
101737
|
-
if (!
|
|
102067
|
+
if (!existsSync33(pkgJsonPath))
|
|
101738
102068
|
return null;
|
|
101739
102069
|
try {
|
|
101740
|
-
const parsed = JSON.parse(
|
|
102070
|
+
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
101741
102071
|
if (parsed.exports === undefined)
|
|
101742
102072
|
return null;
|
|
101743
102073
|
if (typeof parsed.exports === "string")
|
|
@@ -101769,16 +102099,16 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
101769
102099
|
const packageName = packageNameFromServerEntry(entry);
|
|
101770
102100
|
if (packageName === null)
|
|
101771
102101
|
return null;
|
|
101772
|
-
return packageJsonExportsTui(
|
|
102102
|
+
return packageJsonExportsTui(join64(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
101773
102103
|
}
|
|
101774
102104
|
function isOurFilePluginEntry(entry) {
|
|
101775
102105
|
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
101776
102106
|
return false;
|
|
101777
102107
|
try {
|
|
101778
102108
|
const pkgJsonPath = fileEntryPackageJsonPath(entry);
|
|
101779
|
-
if (!
|
|
102109
|
+
if (!existsSync33(pkgJsonPath))
|
|
101780
102110
|
return false;
|
|
101781
|
-
const parsed = JSON.parse(
|
|
102111
|
+
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
101782
102112
|
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
|
|
101783
102113
|
} catch (error51) {
|
|
101784
102114
|
log2("[tui-plugin-config] Failed to inspect file plugin package", {
|
|
@@ -101811,12 +102141,12 @@ function isCanonicalNamedTuiPluginEntry(entry) {
|
|
|
101811
102141
|
}
|
|
101812
102142
|
function detectServerPluginRegistration() {
|
|
101813
102143
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
101814
|
-
const configPath =
|
|
102144
|
+
const configPath = existsSync33(paths2.configJsonc) ? paths2.configJsonc : existsSync33(paths2.configJson) ? paths2.configJson : null;
|
|
101815
102145
|
if (!configPath) {
|
|
101816
102146
|
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
|
|
101817
102147
|
}
|
|
101818
102148
|
try {
|
|
101819
|
-
const parsed = parseJsonc(
|
|
102149
|
+
const parsed = parseJsonc(readFileSync15(configPath, "utf-8"));
|
|
101820
102150
|
const plugins = parsed.plugin ?? [];
|
|
101821
102151
|
const serverEntry = plugins.find(isServerPluginEntry);
|
|
101822
102152
|
return {
|
|
@@ -101834,8 +102164,8 @@ function detectServerPluginRegistration() {
|
|
|
101834
102164
|
}
|
|
101835
102165
|
}
|
|
101836
102166
|
function detectTuiPluginRegistration() {
|
|
101837
|
-
const tuiJsonPath =
|
|
101838
|
-
if (!
|
|
102167
|
+
const tuiJsonPath = join64(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
102168
|
+
if (!existsSync33(tuiJsonPath)) {
|
|
101839
102169
|
return {
|
|
101840
102170
|
registered: false,
|
|
101841
102171
|
configPath: tuiJsonPath,
|
|
@@ -101846,7 +102176,7 @@ function detectTuiPluginRegistration() {
|
|
|
101846
102176
|
};
|
|
101847
102177
|
}
|
|
101848
102178
|
try {
|
|
101849
|
-
const parsed = parseJsonc(
|
|
102179
|
+
const parsed = parseJsonc(readFileSync15(tuiJsonPath, "utf-8"));
|
|
101850
102180
|
const plugins = parsed.plugin ?? [];
|
|
101851
102181
|
return {
|
|
101852
102182
|
registered: plugins.some(isTuiPluginEntry),
|
|
@@ -101979,7 +102309,7 @@ init_shared();
|
|
|
101979
102309
|
init_write_file_atomically();
|
|
101980
102310
|
function readConfig(path6) {
|
|
101981
102311
|
try {
|
|
101982
|
-
const parsed = parseJsonc(
|
|
102312
|
+
const parsed = parseJsonc(readFileSync16(path6, "utf-8"));
|
|
101983
102313
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
101984
102314
|
return parsed;
|
|
101985
102315
|
}
|
|
@@ -101990,11 +102320,11 @@ function readConfig(path6) {
|
|
|
101990
102320
|
return null;
|
|
101991
102321
|
}
|
|
101992
102322
|
function readServerConfig(configDir) {
|
|
101993
|
-
const jsoncPath =
|
|
101994
|
-
if (
|
|
102323
|
+
const jsoncPath = join65(configDir, "opencode.jsonc");
|
|
102324
|
+
if (existsSync34(jsoncPath))
|
|
101995
102325
|
return readConfig(jsoncPath);
|
|
101996
|
-
const jsonPath =
|
|
101997
|
-
if (
|
|
102326
|
+
const jsonPath = join65(configDir, "opencode.json");
|
|
102327
|
+
if (existsSync34(jsonPath))
|
|
101998
102328
|
return readConfig(jsonPath);
|
|
101999
102329
|
return null;
|
|
102000
102330
|
}
|
|
@@ -102014,7 +102344,7 @@ function desiredTuiEntry(serverEntry) {
|
|
|
102014
102344
|
return null;
|
|
102015
102345
|
}
|
|
102016
102346
|
function readTuiConfig(tuiJsonPath) {
|
|
102017
|
-
if (!
|
|
102347
|
+
if (!existsSync34(tuiJsonPath)) {
|
|
102018
102348
|
return { config: {}, malformed: false };
|
|
102019
102349
|
}
|
|
102020
102350
|
const config3 = readConfig(tuiJsonPath);
|
|
@@ -102035,7 +102365,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102035
102365
|
if (!desiredEntry) {
|
|
102036
102366
|
return { changed: false, reason: "no-server-entry" };
|
|
102037
102367
|
}
|
|
102038
|
-
const tuiJsonPath =
|
|
102368
|
+
const tuiJsonPath = join65(configDir, "tui.json");
|
|
102039
102369
|
const { config: config3, malformed } = readTuiConfig(tuiJsonPath);
|
|
102040
102370
|
if (malformed) {
|
|
102041
102371
|
return { changed: false, reason: "malformed" };
|
|
@@ -102044,22 +102374,22 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102044
102374
|
if (plugins.includes(desiredEntry)) {
|
|
102045
102375
|
return { changed: false, reason: "already-present" };
|
|
102046
102376
|
}
|
|
102047
|
-
|
|
102377
|
+
mkdirSync11(configDir, { recursive: true });
|
|
102048
102378
|
writeFileAtomically2(tuiJsonPath, formatConfig({ ...config3, plugin: [...plugins, desiredEntry] }));
|
|
102049
102379
|
return { changed: true, reason: "added" };
|
|
102050
102380
|
}
|
|
102051
102381
|
|
|
102052
102382
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
102053
|
-
import { homedir as
|
|
102054
|
-
import { join as
|
|
102383
|
+
import { homedir as homedir12 } from "node:os";
|
|
102384
|
+
import { join as join66 } from "node:path";
|
|
102055
102385
|
|
|
102056
102386
|
// packages/shared-skills/index.mjs
|
|
102057
|
-
import { existsSync as
|
|
102387
|
+
import { existsSync as existsSync35 } from "node:fs";
|
|
102058
102388
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
102059
102389
|
var SKILLS_PROBE_SPECIFIERS = ["./skills/", "../skills/", "../../skills/"];
|
|
102060
102390
|
function sharedSkillsRootPath() {
|
|
102061
102391
|
const candidates = SKILLS_PROBE_SPECIFIERS.map((specifier) => fileURLToPath2(new URL(specifier, import.meta.url)));
|
|
102062
|
-
return candidates.find((candidate2) =>
|
|
102392
|
+
return candidates.find((candidate2) => existsSync35(candidate2)) ?? candidates[0];
|
|
102063
102393
|
}
|
|
102064
102394
|
|
|
102065
102395
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
@@ -102073,9 +102403,9 @@ function describeResult2(result) {
|
|
|
102073
102403
|
}
|
|
102074
102404
|
async function installAstGrepForOpenCode(options = {}) {
|
|
102075
102405
|
const platform = options.platform ?? process.platform;
|
|
102076
|
-
const baseDir =
|
|
102406
|
+
const baseDir = join66(options.homeDir ?? homedir12(), ".omo");
|
|
102077
102407
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
102078
|
-
const skillDir =
|
|
102408
|
+
const skillDir = join66(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
102079
102409
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
102080
102410
|
try {
|
|
102081
102411
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -105878,7 +106208,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
105878
106208
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
105879
106209
|
init_bun_which_shim();
|
|
105880
106210
|
init_spawn_with_windows_hide();
|
|
105881
|
-
import { delimiter as delimiter2, dirname as
|
|
106211
|
+
import { delimiter as delimiter2, dirname as dirname25, posix as posix9, win32 as win325 } from "node:path";
|
|
105882
106212
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
105883
106213
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
105884
106214
|
function getCommandCandidates(platform) {
|
|
@@ -105936,7 +106266,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
105936
106266
|
return null;
|
|
105937
106267
|
}
|
|
105938
106268
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
105939
|
-
const preferredDir =
|
|
106269
|
+
const preferredDir = dirname25(binaryPath);
|
|
105940
106270
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
105941
106271
|
return [preferredDir, ...existing].join(delimiter2);
|
|
105942
106272
|
}
|
|
@@ -106105,7 +106435,7 @@ async function resolveSession(options) {
|
|
|
106105
106435
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
106106
106436
|
const delay2 = retryDelayMs * attempt;
|
|
106107
106437
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
106108
|
-
await new Promise((
|
|
106438
|
+
await new Promise((resolve21) => setTimeout(resolve21, delay2));
|
|
106109
106439
|
}
|
|
106110
106440
|
continue;
|
|
106111
106441
|
}
|
|
@@ -106116,7 +106446,7 @@ async function resolveSession(options) {
|
|
|
106116
106446
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
106117
106447
|
const delay2 = retryDelayMs * attempt;
|
|
106118
106448
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
106119
|
-
await new Promise((
|
|
106449
|
+
await new Promise((resolve21) => setTimeout(resolve21, delay2));
|
|
106120
106450
|
}
|
|
106121
106451
|
}
|
|
106122
106452
|
throw new Error("Failed to create session after all retries");
|
|
@@ -106155,7 +106485,7 @@ function createJsonOutputManager(options = {}) {
|
|
|
106155
106485
|
|
|
106156
106486
|
// packages/omo-opencode/src/cli/run/on-complete-hook.ts
|
|
106157
106487
|
init_spawn_with_windows_hide();
|
|
106158
|
-
|
|
106488
|
+
init_shell_env();
|
|
106159
106489
|
init_logger2();
|
|
106160
106490
|
var defaultDeps3 = {
|
|
106161
106491
|
spawnWithWindowsHide,
|
|
@@ -106175,15 +106505,15 @@ async function readOutput(stream, streamName, deps = defaultDeps3) {
|
|
|
106175
106505
|
return "";
|
|
106176
106506
|
}
|
|
106177
106507
|
}
|
|
106178
|
-
function resolveHookShellCommand(command) {
|
|
106179
|
-
const shellType = detectShellType();
|
|
106508
|
+
function resolveHookShellCommand(command, platform, env3) {
|
|
106509
|
+
const shellType = detectShellType(platform, env3);
|
|
106180
106510
|
switch (shellType) {
|
|
106181
106511
|
case "powershell": {
|
|
106182
|
-
const powershellExecutable =
|
|
106512
|
+
const powershellExecutable = platform === "win32" ? "powershell.exe" : "pwsh";
|
|
106183
106513
|
return [powershellExecutable, "-NoProfile", "-Command", command];
|
|
106184
106514
|
}
|
|
106185
106515
|
case "cmd":
|
|
106186
|
-
return [
|
|
106516
|
+
return [env3.ComSpec || "cmd.exe", "/d", "/s", "/c", command];
|
|
106187
106517
|
case "csh":
|
|
106188
106518
|
return ["csh", "-c", command];
|
|
106189
106519
|
case "unix":
|
|
@@ -106199,10 +106529,12 @@ async function executeOnCompleteHook(options, deps = defaultDeps3) {
|
|
|
106199
106529
|
}
|
|
106200
106530
|
deps.log("Running on-complete hook", { command: trimmedCommand });
|
|
106201
106531
|
try {
|
|
106202
|
-
const
|
|
106532
|
+
const platform = deps.platform ?? process.platform;
|
|
106533
|
+
const env3 = deps.env ?? process.env;
|
|
106534
|
+
const shellCommand = resolveHookShellCommand(trimmedCommand, platform, env3);
|
|
106203
106535
|
const proc = deps.spawnWithWindowsHide(shellCommand, {
|
|
106204
106536
|
env: {
|
|
106205
|
-
...
|
|
106537
|
+
...env3,
|
|
106206
106538
|
SESSION_ID: sessionId,
|
|
106207
106539
|
EXIT_CODE: String(exitCode),
|
|
106208
106540
|
DURATION_MS: String(durationMs),
|
|
@@ -106514,26 +106846,26 @@ function isClosingFence(line, fence) {
|
|
|
106514
106846
|
return run?.charAt(0) === fence.marker && run.length >= fence.length;
|
|
106515
106847
|
}
|
|
106516
106848
|
// packages/boulder-state/src/top-level-task.ts
|
|
106517
|
-
import { existsSync as
|
|
106849
|
+
import { existsSync as existsSync36, readFileSync as readFileSync17 } from "node:fs";
|
|
106518
106850
|
function readCurrentTopLevelTask(planPath) {
|
|
106519
|
-
if (!
|
|
106851
|
+
if (!existsSync36(planPath)) {
|
|
106520
106852
|
return null;
|
|
106521
106853
|
}
|
|
106522
106854
|
try {
|
|
106523
|
-
const content =
|
|
106855
|
+
const content = readFileSync17(planPath, "utf-8");
|
|
106524
106856
|
return parseCurrentTopLevelTask(content);
|
|
106525
106857
|
} catch {
|
|
106526
106858
|
return null;
|
|
106527
106859
|
}
|
|
106528
106860
|
}
|
|
106529
106861
|
// packages/boulder-state/src/storage/path.ts
|
|
106530
|
-
import { existsSync as
|
|
106531
|
-
import { isAbsolute as isAbsolute11, join as
|
|
106862
|
+
import { existsSync as existsSync37 } from "node:fs";
|
|
106863
|
+
import { isAbsolute as isAbsolute11, join as join67, relative as relative8, resolve as resolve21 } from "node:path";
|
|
106532
106864
|
function getBoulderFilePath(directory) {
|
|
106533
|
-
return
|
|
106865
|
+
return join67(directory, BOULDER_DIR, BOULDER_FILE);
|
|
106534
106866
|
}
|
|
106535
106867
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
106536
|
-
return isAbsolute11(trackedPath) ?
|
|
106868
|
+
return isAbsolute11(trackedPath) ? resolve21(trackedPath) : resolve21(baseDirectory, trackedPath);
|
|
106537
106869
|
}
|
|
106538
106870
|
function resolveBoulderPlanPath(directory, state) {
|
|
106539
106871
|
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
|
|
@@ -106541,26 +106873,26 @@ function resolveBoulderPlanPath(directory, state) {
|
|
|
106541
106873
|
if (!worktreePath) {
|
|
106542
106874
|
return absolutePlanPath;
|
|
106543
106875
|
}
|
|
106544
|
-
const absoluteDirectory =
|
|
106876
|
+
const absoluteDirectory = resolve21(directory);
|
|
106545
106877
|
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
|
|
106546
106878
|
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
|
|
106547
106879
|
return absolutePlanPath;
|
|
106548
106880
|
}
|
|
106549
106881
|
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
|
|
106550
|
-
const worktreePlanPath =
|
|
106551
|
-
return
|
|
106882
|
+
const worktreePlanPath = resolve21(absoluteWorktreePath, relativePlanPath);
|
|
106883
|
+
return existsSync37(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
|
|
106552
106884
|
}
|
|
106553
106885
|
function resolveBoulderPlanPathForWork(directory, work) {
|
|
106554
106886
|
return resolveBoulderPlanPath(directory, work);
|
|
106555
106887
|
}
|
|
106556
106888
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
106557
|
-
import { existsSync as
|
|
106889
|
+
import { existsSync as existsSync38, readFileSync as readFileSync18, readdirSync as readdirSync7, statSync as statSync4 } from "node:fs";
|
|
106558
106890
|
function getPlanProgress(planPath) {
|
|
106559
|
-
if (!
|
|
106891
|
+
if (!existsSync38(planPath)) {
|
|
106560
106892
|
return { total: 0, completed: 0, isComplete: false };
|
|
106561
106893
|
}
|
|
106562
106894
|
try {
|
|
106563
|
-
const content =
|
|
106895
|
+
const content = readFileSync18(planPath, "utf-8");
|
|
106564
106896
|
const checklist = parsePlanChecklist(content);
|
|
106565
106897
|
return {
|
|
106566
106898
|
total: checklist.total,
|
|
@@ -106639,14 +106971,14 @@ function selectMirrorWork(state) {
|
|
|
106639
106971
|
return sorted[0] ?? null;
|
|
106640
106972
|
}
|
|
106641
106973
|
// packages/boulder-state/src/storage/read-state.ts
|
|
106642
|
-
import { existsSync as
|
|
106974
|
+
import { existsSync as existsSync39, readFileSync as readFileSync19 } from "node:fs";
|
|
106643
106975
|
function readBoulderState(directory) {
|
|
106644
106976
|
const filePath = getBoulderFilePath(directory);
|
|
106645
|
-
if (!
|
|
106977
|
+
if (!existsSync39(filePath)) {
|
|
106646
106978
|
return null;
|
|
106647
106979
|
}
|
|
106648
106980
|
try {
|
|
106649
|
-
const content =
|
|
106981
|
+
const content = readFileSync19(filePath, "utf-8");
|
|
106650
106982
|
const parsed = JSON.parse(content);
|
|
106651
106983
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed) || Object.keys(parsed).length === 0) {
|
|
106652
106984
|
return null;
|
|
@@ -106712,17 +107044,17 @@ init_state();
|
|
|
106712
107044
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
106713
107045
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
106714
107046
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
106715
|
-
import { existsSync as
|
|
106716
|
-
import { join as
|
|
107047
|
+
import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "node:fs";
|
|
107048
|
+
import { join as join68 } from "node:path";
|
|
106717
107049
|
function getMarkerPath(directory, sessionID) {
|
|
106718
|
-
return
|
|
107050
|
+
return join68(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
106719
107051
|
}
|
|
106720
107052
|
function readContinuationMarker(directory, sessionID) {
|
|
106721
107053
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
106722
|
-
if (!
|
|
107054
|
+
if (!existsSync40(markerPath))
|
|
106723
107055
|
return null;
|
|
106724
107056
|
try {
|
|
106725
|
-
const raw =
|
|
107057
|
+
const raw = readFileSync20(markerPath, "utf-8");
|
|
106726
107058
|
const parsed = JSON.parse(raw);
|
|
106727
107059
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
106728
107060
|
return null;
|
|
@@ -106787,8 +107119,8 @@ async function isSessionInBoulderLineage(input) {
|
|
|
106787
107119
|
// packages/omo-opencode/src/hooks/atlas/session-last-agent.ts
|
|
106788
107120
|
init_shared();
|
|
106789
107121
|
init_compaction_marker();
|
|
106790
|
-
import { readFileSync as
|
|
106791
|
-
import { join as
|
|
107122
|
+
import { readFileSync as readFileSync21, readdirSync as readdirSync8 } from "node:fs";
|
|
107123
|
+
import { join as join69 } from "node:path";
|
|
106792
107124
|
var defaultSessionLastAgentDeps = {
|
|
106793
107125
|
getMessageDir,
|
|
106794
107126
|
isSqliteBackend,
|
|
@@ -106848,7 +107180,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
106848
107180
|
try {
|
|
106849
107181
|
const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
106850
107182
|
try {
|
|
106851
|
-
const content =
|
|
107183
|
+
const content = readFileSync21(join69(messageDir, fileName), "utf-8");
|
|
106852
107184
|
const parsed = JSON.parse(content);
|
|
106853
107185
|
return {
|
|
106854
107186
|
fileName,
|
|
@@ -106891,8 +107223,8 @@ init_agent_display_names();
|
|
|
106891
107223
|
|
|
106892
107224
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
106893
107225
|
init_frontmatter2();
|
|
106894
|
-
import { existsSync as
|
|
106895
|
-
import { dirname as
|
|
107226
|
+
import { existsSync as existsSync41, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "node:fs";
|
|
107227
|
+
import { dirname as dirname26, join as join70 } from "node:path";
|
|
106896
107228
|
|
|
106897
107229
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
106898
107230
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -106901,15 +107233,15 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
106901
107233
|
|
|
106902
107234
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
106903
107235
|
function getStateFilePath(directory, customPath) {
|
|
106904
|
-
return customPath ?
|
|
107236
|
+
return customPath ? join70(directory, customPath) : join70(directory, DEFAULT_STATE_FILE);
|
|
106905
107237
|
}
|
|
106906
107238
|
function readState(directory, customPath) {
|
|
106907
107239
|
const filePath = getStateFilePath(directory, customPath);
|
|
106908
|
-
if (!
|
|
107240
|
+
if (!existsSync41(filePath)) {
|
|
106909
107241
|
return null;
|
|
106910
107242
|
}
|
|
106911
107243
|
try {
|
|
106912
|
-
const content =
|
|
107244
|
+
const content = readFileSync22(filePath, "utf-8");
|
|
106913
107245
|
const { data, body } = parseFrontmatter(content);
|
|
106914
107246
|
const active = data.active;
|
|
106915
107247
|
const iteration = data.iteration;
|
|
@@ -107135,7 +107467,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
|
|
|
107135
107467
|
const secondaryMeaningfulWorkTimeoutMs = options.secondaryMeaningfulWorkTimeoutMs ?? DEFAULT_SECONDARY_MEANINGFUL_WORK_TIMEOUT_MS;
|
|
107136
107468
|
const requireMeaningfulWork = options.requireMeaningfulWork ?? false;
|
|
107137
107469
|
const now = options.now ?? Date.now;
|
|
107138
|
-
const sleep = options.sleep ?? ((ms) => new Promise((
|
|
107470
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve22) => setTimeout(resolve22, ms)));
|
|
107139
107471
|
let consecutiveCompleteChecks = 0;
|
|
107140
107472
|
let errorCycleCount = 0;
|
|
107141
107473
|
let firstWorkTimestamp = null;
|
|
@@ -107300,7 +107632,7 @@ function createAbortError() {
|
|
|
107300
107632
|
return error51;
|
|
107301
107633
|
}
|
|
107302
107634
|
function sleep(delayMs) {
|
|
107303
|
-
return new Promise((
|
|
107635
|
+
return new Promise((resolve22) => setTimeout(resolve22, delayMs));
|
|
107304
107636
|
}
|
|
107305
107637
|
function hasPromptStartEvidence(eventState) {
|
|
107306
107638
|
return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
|
|
@@ -107675,7 +108007,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
|
|
|
107675
108007
|
async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
|
|
107676
108008
|
const completed = await Promise.race([
|
|
107677
108009
|
eventProcessor.then(() => true),
|
|
107678
|
-
new Promise((
|
|
108010
|
+
new Promise((resolve22) => setTimeout(() => resolve22(false), timeoutMs))
|
|
107679
108011
|
]);
|
|
107680
108012
|
}
|
|
107681
108013
|
async function run(options) {
|
|
@@ -107738,10 +108070,10 @@ Interrupted. Shutting down...`));
|
|
|
107738
108070
|
abortController,
|
|
107739
108071
|
verbose: options.verbose ?? false
|
|
107740
108072
|
};
|
|
107741
|
-
const
|
|
108073
|
+
const events2 = await client3.event.subscribe({ query: { directory } });
|
|
107742
108074
|
const eventState = createEventState();
|
|
107743
108075
|
eventState.agentColorsByName = await loadAgentProfileColors(client3);
|
|
107744
|
-
const eventProcessor = processEvents(ctx,
|
|
108076
|
+
const eventProcessor = processEvents(ctx, events2.stream, eventState).catch(() => {});
|
|
107745
108077
|
const promptResult = await dispatchInternalPrompt({
|
|
107746
108078
|
mode: "async",
|
|
107747
108079
|
client: client3,
|
|
@@ -108001,14 +108333,14 @@ async function getLocalVersion(options = {}) {
|
|
|
108001
108333
|
}
|
|
108002
108334
|
}
|
|
108003
108335
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
108004
|
-
import { existsSync as
|
|
108336
|
+
import { existsSync as existsSync52, readFileSync as readFileSync32 } from "node:fs";
|
|
108005
108337
|
|
|
108006
108338
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
108007
108339
|
init_extract_semver();
|
|
108008
108340
|
init_bun_which_shim();
|
|
108009
|
-
import { existsSync as
|
|
108010
|
-
import { homedir as
|
|
108011
|
-
import { join as
|
|
108341
|
+
import { existsSync as existsSync49, accessSync as accessSync4, constants as constants11 } from "node:fs";
|
|
108342
|
+
import { homedir as homedir15 } from "node:os";
|
|
108343
|
+
import { join as join77 } from "node:path";
|
|
108012
108344
|
|
|
108013
108345
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
108014
108346
|
init_spawn_with_windows_hide();
|
|
@@ -108047,8 +108379,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
108047
108379
|
const stdoutPromise = readSpawnStream(proc.stdout);
|
|
108048
108380
|
const stderrPromise = readSpawnStream(proc.stderr);
|
|
108049
108381
|
let timer;
|
|
108050
|
-
const timeoutPromise = new Promise((
|
|
108051
|
-
timer = setTimeout(() =>
|
|
108382
|
+
const timeoutPromise = new Promise((resolve22) => {
|
|
108383
|
+
timer = setTimeout(() => resolve22("timeout"), timeoutMs);
|
|
108052
108384
|
});
|
|
108053
108385
|
const processPromise = (async () => {
|
|
108054
108386
|
await proc.exited;
|
|
@@ -108095,22 +108427,22 @@ function isExecutable2(path12) {
|
|
|
108095
108427
|
}
|
|
108096
108428
|
}
|
|
108097
108429
|
function getDesktopAppPaths(platform) {
|
|
108098
|
-
const home =
|
|
108430
|
+
const home = homedir15();
|
|
108099
108431
|
switch (platform) {
|
|
108100
108432
|
case "darwin":
|
|
108101
108433
|
return [
|
|
108102
108434
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
108103
|
-
|
|
108435
|
+
join77(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
108104
108436
|
];
|
|
108105
108437
|
case "win32": {
|
|
108106
108438
|
const programFiles = process.env.ProgramFiles;
|
|
108107
108439
|
const localAppData = process.env.LOCALAPPDATA;
|
|
108108
108440
|
const paths2 = [];
|
|
108109
108441
|
if (programFiles) {
|
|
108110
|
-
paths2.push(
|
|
108442
|
+
paths2.push(join77(programFiles, "OpenCode", "OpenCode.exe"));
|
|
108111
108443
|
}
|
|
108112
108444
|
if (localAppData) {
|
|
108113
|
-
paths2.push(
|
|
108445
|
+
paths2.push(join77(localAppData, "OpenCode", "OpenCode.exe"));
|
|
108114
108446
|
}
|
|
108115
108447
|
return paths2;
|
|
108116
108448
|
}
|
|
@@ -108118,8 +108450,8 @@ function getDesktopAppPaths(platform) {
|
|
|
108118
108450
|
return [
|
|
108119
108451
|
"/usr/bin/opencode",
|
|
108120
108452
|
"/usr/lib/opencode/opencode",
|
|
108121
|
-
|
|
108122
|
-
|
|
108453
|
+
join77(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
108454
|
+
join77(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
108123
108455
|
];
|
|
108124
108456
|
default:
|
|
108125
108457
|
return [];
|
|
@@ -108131,7 +108463,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
108131
108463
|
}
|
|
108132
108464
|
return [binaryPath, "--version"];
|
|
108133
108465
|
}
|
|
108134
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
108466
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync49) {
|
|
108135
108467
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
108136
108468
|
if (checkExists(desktopPath)) {
|
|
108137
108469
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -108139,7 +108471,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
108139
108471
|
}
|
|
108140
108472
|
return null;
|
|
108141
108473
|
}
|
|
108142
|
-
async function findOpenCodeBinary(platform = process.platform, checkExists =
|
|
108474
|
+
async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync49) {
|
|
108143
108475
|
for (const binary of OPENCODE_BINARIES2) {
|
|
108144
108476
|
const path12 = bunWhich(binary);
|
|
108145
108477
|
if (path12 && checkExists(path12)) {
|
|
@@ -108151,7 +108483,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
108151
108483
|
const candidates = getCommandCandidates2(platform);
|
|
108152
108484
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
108153
108485
|
for (const command of candidates) {
|
|
108154
|
-
const fullPath =
|
|
108486
|
+
const fullPath = join77(entry, command);
|
|
108155
108487
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
108156
108488
|
return { binary: command, path: fullPath };
|
|
108157
108489
|
}
|
|
@@ -108197,12 +108529,12 @@ function compareVersions3(current, minimum) {
|
|
|
108197
108529
|
|
|
108198
108530
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
108199
108531
|
init_shared();
|
|
108200
|
-
import { existsSync as
|
|
108532
|
+
import { existsSync as existsSync50, readFileSync as readFileSync30 } from "node:fs";
|
|
108201
108533
|
function detectConfigPath() {
|
|
108202
108534
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
108203
|
-
if (
|
|
108535
|
+
if (existsSync50(paths2.configJsonc))
|
|
108204
108536
|
return paths2.configJsonc;
|
|
108205
|
-
if (
|
|
108537
|
+
if (existsSync50(paths2.configJson))
|
|
108206
108538
|
return paths2.configJson;
|
|
108207
108539
|
return null;
|
|
108208
108540
|
}
|
|
@@ -108248,7 +108580,7 @@ function getPluginInfo() {
|
|
|
108248
108580
|
};
|
|
108249
108581
|
}
|
|
108250
108582
|
try {
|
|
108251
|
-
const content =
|
|
108583
|
+
const content = readFileSync30(configPath, "utf-8");
|
|
108252
108584
|
const parsedConfig = parseJsonc(content);
|
|
108253
108585
|
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
|
|
108254
108586
|
if (!pluginEntry) {
|
|
@@ -108290,39 +108622,39 @@ init_file_utils2();
|
|
|
108290
108622
|
init_checker();
|
|
108291
108623
|
init_auto_update_checker();
|
|
108292
108624
|
init_package_json_locator();
|
|
108293
|
-
import { existsSync as
|
|
108625
|
+
import { existsSync as existsSync51, readFileSync as readFileSync31, readdirSync as readdirSync10 } from "node:fs";
|
|
108294
108626
|
import { createRequire as createRequire3 } from "node:module";
|
|
108295
|
-
import { homedir as
|
|
108296
|
-
import { join as
|
|
108627
|
+
import { homedir as homedir16 } from "node:os";
|
|
108628
|
+
import { join as join78 } from "node:path";
|
|
108297
108629
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
108298
108630
|
init_shared();
|
|
108299
108631
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
108300
108632
|
if (platform === "darwin")
|
|
108301
|
-
return
|
|
108633
|
+
return join78(homedir16(), "Library", "Caches");
|
|
108302
108634
|
if (platform === "win32")
|
|
108303
|
-
return process.env.LOCALAPPDATA ??
|
|
108304
|
-
return
|
|
108635
|
+
return process.env.LOCALAPPDATA ?? join78(homedir16(), "AppData", "Local");
|
|
108636
|
+
return join78(homedir16(), ".cache");
|
|
108305
108637
|
}
|
|
108306
108638
|
function resolveOpenCodeCacheDir() {
|
|
108307
108639
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
108308
108640
|
if (xdgCacheHome)
|
|
108309
|
-
return
|
|
108641
|
+
return join78(xdgCacheHome, "opencode");
|
|
108310
108642
|
const fromShared = getOpenCodeCacheDir();
|
|
108311
|
-
const platformDefault =
|
|
108312
|
-
if (
|
|
108643
|
+
const platformDefault = join78(getPlatformDefaultCacheDir(), "opencode");
|
|
108644
|
+
if (existsSync51(fromShared) || !existsSync51(platformDefault))
|
|
108313
108645
|
return fromShared;
|
|
108314
108646
|
return platformDefault;
|
|
108315
108647
|
}
|
|
108316
108648
|
function resolveExistingDir(dirPath) {
|
|
108317
|
-
if (!
|
|
108649
|
+
if (!existsSync51(dirPath))
|
|
108318
108650
|
return dirPath;
|
|
108319
108651
|
return resolveSymlink(dirPath);
|
|
108320
108652
|
}
|
|
108321
108653
|
function readPackageJson(filePath) {
|
|
108322
|
-
if (!
|
|
108654
|
+
if (!existsSync51(filePath))
|
|
108323
108655
|
return null;
|
|
108324
108656
|
try {
|
|
108325
|
-
const content =
|
|
108657
|
+
const content = readFileSync31(filePath, "utf-8");
|
|
108326
108658
|
return parseJsonc(content);
|
|
108327
108659
|
} catch (error51) {
|
|
108328
108660
|
if (!(error51 instanceof Error)) {
|
|
@@ -108340,26 +108672,26 @@ function normalizeVersion(value) {
|
|
|
108340
108672
|
function createPackageCandidates(rootDir) {
|
|
108341
108673
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
108342
108674
|
packageName,
|
|
108343
|
-
installedPackagePath:
|
|
108675
|
+
installedPackagePath: join78(rootDir, "node_modules", packageName, "package.json")
|
|
108344
108676
|
}));
|
|
108345
108677
|
}
|
|
108346
108678
|
function createTaggedInstallCandidates(rootDir) {
|
|
108347
|
-
const packagesDir =
|
|
108348
|
-
if (!
|
|
108679
|
+
const packagesDir = join78(rootDir, "packages");
|
|
108680
|
+
if (!existsSync51(packagesDir))
|
|
108349
108681
|
return [];
|
|
108350
108682
|
const candidates = [];
|
|
108351
108683
|
for (const entryName of readdirSync10(packagesDir).sort()) {
|
|
108352
108684
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
108353
108685
|
if (packageName === undefined)
|
|
108354
108686
|
continue;
|
|
108355
|
-
const installDir =
|
|
108687
|
+
const installDir = join78(packagesDir, entryName);
|
|
108356
108688
|
candidates.push({
|
|
108357
108689
|
cacheDir: installDir,
|
|
108358
|
-
cachePackagePath:
|
|
108690
|
+
cachePackagePath: join78(installDir, "package.json"),
|
|
108359
108691
|
packageCandidates: [
|
|
108360
108692
|
{
|
|
108361
108693
|
packageName,
|
|
108362
|
-
installedPackagePath:
|
|
108694
|
+
installedPackagePath: join78(installDir, "node_modules", packageName, "package.json")
|
|
108363
108695
|
}
|
|
108364
108696
|
]
|
|
108365
108697
|
});
|
|
@@ -108367,7 +108699,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
108367
108699
|
return candidates;
|
|
108368
108700
|
}
|
|
108369
108701
|
function selectInstalledPackage(candidate2) {
|
|
108370
|
-
return candidate2.packageCandidates.find((packageCandidate) =>
|
|
108702
|
+
return candidate2.packageCandidates.find((packageCandidate) => existsSync51(packageCandidate.installedPackagePath)) ?? candidate2.packageCandidates[0];
|
|
108371
108703
|
}
|
|
108372
108704
|
function getExpectedVersion(cachePackage, packageName) {
|
|
108373
108705
|
return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
|
|
@@ -108378,7 +108710,7 @@ function resolveInstalledPackageJsonPath() {
|
|
|
108378
108710
|
for (const packageName of ACCEPTED_PACKAGE_NAMES) {
|
|
108379
108711
|
try {
|
|
108380
108712
|
const packageJsonPath = require2.resolve(`${packageName}/package.json`);
|
|
108381
|
-
if (
|
|
108713
|
+
if (existsSync51(packageJsonPath)) {
|
|
108382
108714
|
return { packageName, packageJsonPath };
|
|
108383
108715
|
}
|
|
108384
108716
|
} catch {
|
|
@@ -108404,22 +108736,22 @@ function getLoadedPluginVersion() {
|
|
|
108404
108736
|
const candidates = [
|
|
108405
108737
|
{
|
|
108406
108738
|
cacheDir: configDir,
|
|
108407
|
-
cachePackagePath:
|
|
108739
|
+
cachePackagePath: join78(configDir, "package.json"),
|
|
108408
108740
|
packageCandidates: createPackageCandidates(configDir)
|
|
108409
108741
|
},
|
|
108410
108742
|
...createTaggedInstallCandidates(configDir),
|
|
108411
108743
|
{
|
|
108412
108744
|
cacheDir,
|
|
108413
|
-
cachePackagePath:
|
|
108745
|
+
cachePackagePath: join78(cacheDir, "package.json"),
|
|
108414
108746
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
108415
108747
|
},
|
|
108416
108748
|
...createTaggedInstallCandidates(cacheDir)
|
|
108417
108749
|
];
|
|
108418
|
-
const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) =>
|
|
108750
|
+
const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) => existsSync51(packageCandidate.installedPackagePath))) ?? candidates[0];
|
|
108419
108751
|
const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
|
|
108420
108752
|
const selectedPackage = selectInstalledPackage(selectedCandidate);
|
|
108421
108753
|
const candidateInstalledPath = selectedPackage.installedPackagePath;
|
|
108422
|
-
const candidateExists =
|
|
108754
|
+
const candidateExists = existsSync51(candidateInstalledPath);
|
|
108423
108755
|
const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
|
|
108424
108756
|
const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
|
|
108425
108757
|
const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
|
|
@@ -108455,8 +108787,8 @@ var defaultDeps6 = {
|
|
|
108455
108787
|
getLoadedPluginVersion,
|
|
108456
108788
|
getLatestPluginVersion,
|
|
108457
108789
|
getSuggestedInstallTag,
|
|
108458
|
-
configExists:
|
|
108459
|
-
readConfigFile: (path12) =>
|
|
108790
|
+
configExists: existsSync52,
|
|
108791
|
+
readConfigFile: (path12) => readFileSync32(path12, "utf-8"),
|
|
108460
108792
|
parseConfigContent: (content) => parseJsonc(content)
|
|
108461
108793
|
};
|
|
108462
108794
|
var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
|
|
@@ -108601,26 +108933,26 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
108601
108933
|
|
|
108602
108934
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
108603
108935
|
init_shared();
|
|
108604
|
-
import { existsSync as
|
|
108605
|
-
import { homedir as
|
|
108606
|
-
import { join as
|
|
108936
|
+
import { existsSync as existsSync53, readFileSync as readFileSync33 } from "node:fs";
|
|
108937
|
+
import { homedir as homedir17 } from "node:os";
|
|
108938
|
+
import { join as join79 } from "node:path";
|
|
108607
108939
|
function getUserConfigDir2() {
|
|
108608
108940
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
108609
108941
|
if (xdgConfig)
|
|
108610
|
-
return
|
|
108611
|
-
return
|
|
108942
|
+
return join79(xdgConfig, "opencode");
|
|
108943
|
+
return join79(homedir17(), ".config", "opencode");
|
|
108612
108944
|
}
|
|
108613
108945
|
function loadCustomProviderNames() {
|
|
108614
108946
|
const configDir = getUserConfigDir2();
|
|
108615
108947
|
const candidatePaths = [
|
|
108616
|
-
|
|
108617
|
-
|
|
108948
|
+
join79(configDir, "opencode.json"),
|
|
108949
|
+
join79(configDir, "opencode.jsonc")
|
|
108618
108950
|
];
|
|
108619
108951
|
for (const configPath of candidatePaths) {
|
|
108620
|
-
if (!
|
|
108952
|
+
if (!existsSync53(configPath))
|
|
108621
108953
|
continue;
|
|
108622
108954
|
try {
|
|
108623
|
-
const content =
|
|
108955
|
+
const content = readFileSync33(configPath, "utf-8");
|
|
108624
108956
|
const data = parseJsonc(content);
|
|
108625
108957
|
if (data?.provider && typeof data.provider === "object") {
|
|
108626
108958
|
return Object.keys(data.provider);
|
|
@@ -108635,16 +108967,16 @@ function loadCustomProviderNames() {
|
|
|
108635
108967
|
return [];
|
|
108636
108968
|
}
|
|
108637
108969
|
function loadAvailableModelsFromCache() {
|
|
108638
|
-
const cacheFile =
|
|
108970
|
+
const cacheFile = join79(getOpenCodeCacheDir(), "models.json");
|
|
108639
108971
|
const customProviders = loadCustomProviderNames();
|
|
108640
|
-
if (!
|
|
108972
|
+
if (!existsSync53(cacheFile)) {
|
|
108641
108973
|
if (customProviders.length > 0) {
|
|
108642
108974
|
return { providers: customProviders, modelCount: 0, cacheExists: true };
|
|
108643
108975
|
}
|
|
108644
108976
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
108645
108977
|
}
|
|
108646
108978
|
try {
|
|
108647
|
-
const content =
|
|
108979
|
+
const content = readFileSync33(cacheFile, "utf-8");
|
|
108648
108980
|
const data = parseJsonc(content);
|
|
108649
108981
|
const cacheProviders = Object.keys(data);
|
|
108650
108982
|
let modelCount = 0;
|
|
@@ -108697,7 +109029,7 @@ function loadOmoConfig2() {
|
|
|
108697
109029
|
|
|
108698
109030
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
108699
109031
|
init_shared();
|
|
108700
|
-
import { join as
|
|
109032
|
+
import { join as join80 } from "node:path";
|
|
108701
109033
|
|
|
108702
109034
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
108703
109035
|
function formatModelWithVariant(model, variant) {
|
|
@@ -108739,7 +109071,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
108739
109071
|
}
|
|
108740
109072
|
function buildModelResolutionDetails(options) {
|
|
108741
109073
|
const details = [];
|
|
108742
|
-
const cacheFile =
|
|
109074
|
+
const cacheFile = join80(getOpenCodeCacheDir(), "models.json");
|
|
108743
109075
|
details.push("═══ Available Models (from cache) ═══");
|
|
108744
109076
|
details.push("");
|
|
108745
109077
|
if (options.available.cacheExists) {
|
|
@@ -109048,8 +109380,8 @@ async function checkConfig() {
|
|
|
109048
109380
|
|
|
109049
109381
|
// packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
|
|
109050
109382
|
init_main();
|
|
109051
|
-
import { existsSync as
|
|
109052
|
-
import { join as
|
|
109383
|
+
import { existsSync as existsSync54, readFileSync as readFileSync34 } from "node:fs";
|
|
109384
|
+
import { join as join81 } from "node:path";
|
|
109053
109385
|
var CANONICAL_REPLACEMENT = new Map([
|
|
109054
109386
|
["variant", "reasoning"],
|
|
109055
109387
|
["reasoningEffort", "reasoning"],
|
|
@@ -109104,16 +109436,16 @@ function userConfigPaths() {
|
|
|
109104
109436
|
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
109105
109437
|
if (home === undefined || home.length === 0)
|
|
109106
109438
|
return [];
|
|
109107
|
-
return [
|
|
109439
|
+
return [join81(home, ".omo", "omo.jsonc"), join81(home, ".omo", "omo.json")];
|
|
109108
109440
|
}
|
|
109109
109441
|
async function checkDeprecatedReasoningKeys() {
|
|
109110
109442
|
const issues = [];
|
|
109111
109443
|
const scanned = [];
|
|
109112
109444
|
for (const configPath of userConfigPaths()) {
|
|
109113
|
-
if (!
|
|
109445
|
+
if (!existsSync54(configPath))
|
|
109114
109446
|
continue;
|
|
109115
109447
|
scanned.push(configPath);
|
|
109116
|
-
const parsed = parse2(
|
|
109448
|
+
const parsed = parse2(readFileSync34(configPath, "utf-8"));
|
|
109117
109449
|
issues.push(...collectIssues(configPath, parsed, ""));
|
|
109118
109450
|
}
|
|
109119
109451
|
return {
|
|
@@ -109127,28 +109459,28 @@ async function checkDeprecatedReasoningKeys() {
|
|
|
109127
109459
|
|
|
109128
109460
|
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
109129
109461
|
init_src2();
|
|
109130
|
-
import { existsSync as
|
|
109462
|
+
import { existsSync as existsSync55 } from "node:fs";
|
|
109131
109463
|
import { createRequire as createRequire4 } from "node:module";
|
|
109132
|
-
import { homedir as
|
|
109133
|
-
import { dirname as
|
|
109464
|
+
import { homedir as homedir19 } from "node:os";
|
|
109465
|
+
import { dirname as dirname31, join as join83 } from "node:path";
|
|
109134
109466
|
|
|
109135
109467
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
109136
|
-
import { join as
|
|
109137
|
-
import { homedir as
|
|
109468
|
+
import { join as join82 } from "path";
|
|
109469
|
+
import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
|
|
109138
109470
|
init_binary_downloader();
|
|
109139
109471
|
init_logger2();
|
|
109140
109472
|
init_plugin_identity();
|
|
109141
109473
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
109142
|
-
var DEBUG_FILE =
|
|
109474
|
+
var DEBUG_FILE = join82(tmpdir4(), "comment-checker-debug.log");
|
|
109143
109475
|
function getCacheDir2() {
|
|
109144
109476
|
if (process.platform === "win32") {
|
|
109145
109477
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
109146
|
-
const base2 = localAppData ||
|
|
109147
|
-
return
|
|
109478
|
+
const base2 = localAppData || join82(homedir18(), "AppData", "Local");
|
|
109479
|
+
return join82(base2, CACHE_DIR_NAME, "bin");
|
|
109148
109480
|
}
|
|
109149
109481
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
109150
|
-
const base = xdgCache ||
|
|
109151
|
-
return
|
|
109482
|
+
const base = xdgCache || join82(homedir18(), ".cache");
|
|
109483
|
+
return join82(base, CACHE_DIR_NAME, "bin");
|
|
109152
109484
|
}
|
|
109153
109485
|
function getBinaryName() {
|
|
109154
109486
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -109198,7 +109530,7 @@ async function getBinaryVersion(binary) {
|
|
|
109198
109530
|
}
|
|
109199
109531
|
}
|
|
109200
109532
|
async function checkAstGrepCli() {
|
|
109201
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
109533
|
+
const runtimeDir = astGrepRuntimeDir(join83(homedir19(), ".omo"));
|
|
109202
109534
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
109203
109535
|
if (sgPath === null) {
|
|
109204
109536
|
return {
|
|
@@ -109227,12 +109559,12 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
109227
109559
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
109228
109560
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
109229
109561
|
try {
|
|
109230
|
-
const packageDir = baseDirOverride ??
|
|
109231
|
-
const vendorPath =
|
|
109232
|
-
if (
|
|
109562
|
+
const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
|
|
109563
|
+
const vendorPath = join83(packageDir, "vendor", platformKey, binaryName);
|
|
109564
|
+
if (existsSync55(vendorPath))
|
|
109233
109565
|
return vendorPath;
|
|
109234
|
-
const binPath =
|
|
109235
|
-
if (
|
|
109566
|
+
const binPath = join83(packageDir, "bin", binaryName);
|
|
109567
|
+
if (existsSync55(binPath))
|
|
109236
109568
|
return binPath;
|
|
109237
109569
|
} catch (error51) {
|
|
109238
109570
|
if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
|
|
@@ -109378,8 +109710,8 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
109378
109710
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
109379
109711
|
init_zod();
|
|
109380
109712
|
init_opencode_config_dir();
|
|
109381
|
-
import { existsSync as
|
|
109382
|
-
import { delimiter as delimiter3, dirname as
|
|
109713
|
+
import { existsSync as existsSync56, readFileSync as readFileSync35 } from "node:fs";
|
|
109714
|
+
import { delimiter as delimiter3, dirname as dirname32, resolve as resolve23 } from "node:path";
|
|
109383
109715
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
109384
109716
|
|
|
109385
109717
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -109426,7 +109758,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
|
|
|
109426
109758
|
}
|
|
109427
109759
|
|
|
109428
109760
|
// packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
|
|
109429
|
-
import { resolve as
|
|
109761
|
+
import { resolve as resolve22 } from "node:path";
|
|
109430
109762
|
function resolveJavaScriptRuntime(resolveExecutable) {
|
|
109431
109763
|
const node = resolveExecutable("node");
|
|
109432
109764
|
return node.available ? node : resolveExecutable("bun");
|
|
@@ -109434,9 +109766,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
|
|
|
109434
109766
|
function createAncestorCliCandidates(options) {
|
|
109435
109767
|
const candidates = [];
|
|
109436
109768
|
const seenPaths = new Set;
|
|
109437
|
-
let currentDirectory =
|
|
109769
|
+
let currentDirectory = resolve22(options.startDirectory);
|
|
109438
109770
|
while (true) {
|
|
109439
|
-
const distCliPath =
|
|
109771
|
+
const distCliPath = resolve22(currentDirectory, options.packageRel, options.distCliRel);
|
|
109440
109772
|
if (!seenPaths.has(distCliPath)) {
|
|
109441
109773
|
const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
|
|
109442
109774
|
seenPaths.add(distCliPath);
|
|
@@ -109448,7 +109780,7 @@ function createAncestorCliCandidates(options) {
|
|
|
109448
109780
|
runtimeAvailable: runtime5.available
|
|
109449
109781
|
});
|
|
109450
109782
|
}
|
|
109451
|
-
const sourceCliPath =
|
|
109783
|
+
const sourceCliPath = resolve22(currentDirectory, options.packageRel, options.sourceCliRel);
|
|
109452
109784
|
if (!seenPaths.has(sourceCliPath)) {
|
|
109453
109785
|
const runtime5 = options.resolveExecutable("bun");
|
|
109454
109786
|
const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
|
|
@@ -109465,7 +109797,7 @@ function createAncestorCliCandidates(options) {
|
|
|
109465
109797
|
runtimeAvailable: runtime5.available
|
|
109466
109798
|
});
|
|
109467
109799
|
}
|
|
109468
|
-
const parentDirectory =
|
|
109800
|
+
const parentDirectory = resolve22(currentDirectory, "..");
|
|
109469
109801
|
if (parentDirectory === currentDirectory)
|
|
109470
109802
|
return candidates;
|
|
109471
109803
|
currentDirectory = parentDirectory;
|
|
@@ -109510,7 +109842,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
109510
109842
|
].join(";");
|
|
109511
109843
|
function getModuleDirectory(moduleUrl) {
|
|
109512
109844
|
try {
|
|
109513
|
-
return
|
|
109845
|
+
return dirname32(fileURLToPath7(moduleUrl));
|
|
109514
109846
|
} catch (error51) {
|
|
109515
109847
|
if (!(error51 instanceof Error))
|
|
109516
109848
|
throw error51;
|
|
@@ -109518,11 +109850,11 @@ function getModuleDirectory(moduleUrl) {
|
|
|
109518
109850
|
}
|
|
109519
109851
|
}
|
|
109520
109852
|
function findBootstrapRoot(candidates, pathExists) {
|
|
109521
|
-
return candidates.find((candidate2) => pathExists(
|
|
109853
|
+
return candidates.find((candidate2) => pathExists(resolve23(candidate2.root, "package.json")))?.root ?? process.cwd();
|
|
109522
109854
|
}
|
|
109523
109855
|
function readDaemonPackageVersion(root) {
|
|
109524
109856
|
try {
|
|
109525
|
-
const packageJson = JSON.parse(
|
|
109857
|
+
const packageJson = JSON.parse(readFileSync35(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
109526
109858
|
return DaemonPackageSchema.parse(packageJson).version;
|
|
109527
109859
|
} catch (error51) {
|
|
109528
109860
|
if (!(error51 instanceof Error))
|
|
@@ -109534,17 +109866,17 @@ function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
|
109534
109866
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
109535
109867
|
const bun = resolveExecutable("bun");
|
|
109536
109868
|
const npm = resolveExecutable("npm");
|
|
109537
|
-
const packageManifestPath =
|
|
109869
|
+
const packageManifestPath = resolve23(root, PACKAGE_REL, "package.json");
|
|
109538
109870
|
return {
|
|
109539
109871
|
command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
|
|
109540
109872
|
root,
|
|
109541
|
-
path:
|
|
109873
|
+
path: resolve23(root, PACKAGE_REL, DIST_CLI_REL),
|
|
109542
109874
|
exists: runtime5.available && npm.available && pathExists(packageManifestPath),
|
|
109543
109875
|
runtimeAvailable: runtime5.available
|
|
109544
109876
|
};
|
|
109545
109877
|
}
|
|
109546
109878
|
function resolveLspCommand(options = {}) {
|
|
109547
|
-
const pathExists = options.exists ??
|
|
109879
|
+
const pathExists = options.exists ?? existsSync56;
|
|
109548
109880
|
const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
|
|
109549
109881
|
const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
|
|
109550
109882
|
const candidates = moduleDirectory ? createAncestorCliCandidates({
|
|
@@ -109554,7 +109886,7 @@ function resolveLspCommand(options = {}) {
|
|
|
109554
109886
|
sourceCliRel: SOURCE_CLI_REL,
|
|
109555
109887
|
pathExists,
|
|
109556
109888
|
resolveExecutable,
|
|
109557
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(
|
|
109889
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve23(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
|
|
109558
109890
|
}) : [];
|
|
109559
109891
|
const distCandidate = candidates.find((candidate2) => hasCliSuffix(candidate2.path, DIST_CLI_REL) && candidate2.exists);
|
|
109560
109892
|
if (distCandidate) {
|
|
@@ -109568,7 +109900,7 @@ function resolveLspCommand(options = {}) {
|
|
|
109568
109900
|
}
|
|
109569
109901
|
function createLspMcpConfig(options = {}) {
|
|
109570
109902
|
const resolvedCommand = resolveLspCommand(options);
|
|
109571
|
-
const cwd =
|
|
109903
|
+
const cwd = resolve23(options.cwd ?? process.cwd());
|
|
109572
109904
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
109573
109905
|
const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
|
|
109574
109906
|
return {
|
|
@@ -109577,9 +109909,9 @@ function createLspMcpConfig(options = {}) {
|
|
|
109577
109909
|
enabled: resolvedCommand.exists,
|
|
109578
109910
|
cwd,
|
|
109579
109911
|
environment: {
|
|
109580
|
-
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) =>
|
|
109581
|
-
LSP_TOOLS_MCP_USER_CONFIG:
|
|
109582
|
-
LSP_TOOLS_MCP_INSTALL_DECISIONS:
|
|
109912
|
+
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve23(cwd, configPath)).join(delimiter3),
|
|
109913
|
+
LSP_TOOLS_MCP_USER_CONFIG: resolve23(configDir, "lsp.json"),
|
|
109914
|
+
LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve23(configDir, "lsp-install-decisions.json"),
|
|
109583
109915
|
...sourceVersion ? {
|
|
109584
109916
|
[OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
|
|
109585
109917
|
[OMO_LSP_DAEMON_VERSION]: sourceVersion
|
|
@@ -109604,24 +109936,24 @@ function getInstalledLspServers(options = {}) {
|
|
|
109604
109936
|
|
|
109605
109937
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
109606
109938
|
init_shared();
|
|
109607
|
-
import { existsSync as
|
|
109608
|
-
import { homedir as
|
|
109609
|
-
import { join as
|
|
109939
|
+
import { existsSync as existsSync57, readFileSync as readFileSync36 } from "node:fs";
|
|
109940
|
+
import { homedir as homedir20 } from "node:os";
|
|
109941
|
+
import { join as join84 } from "node:path";
|
|
109610
109942
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
109611
109943
|
function getMcpConfigPaths() {
|
|
109612
109944
|
return [
|
|
109613
|
-
|
|
109614
|
-
|
|
109615
|
-
|
|
109945
|
+
join84(homedir20(), ".claude", ".mcp.json"),
|
|
109946
|
+
join84(process.cwd(), ".mcp.json"),
|
|
109947
|
+
join84(process.cwd(), ".claude", ".mcp.json")
|
|
109616
109948
|
];
|
|
109617
109949
|
}
|
|
109618
109950
|
function loadUserMcpConfig() {
|
|
109619
109951
|
const servers = {};
|
|
109620
109952
|
for (const configPath of getMcpConfigPaths()) {
|
|
109621
|
-
if (!
|
|
109953
|
+
if (!existsSync57(configPath))
|
|
109622
109954
|
continue;
|
|
109623
109955
|
try {
|
|
109624
|
-
const content =
|
|
109956
|
+
const content = readFileSync36(configPath, "utf-8");
|
|
109625
109957
|
const config4 = parseJsonc(content);
|
|
109626
109958
|
if (config4.mcpServers) {
|
|
109627
109959
|
Object.assign(servers, config4.mcpServers);
|
|
@@ -109756,17 +110088,17 @@ async function checkTools() {
|
|
|
109756
110088
|
|
|
109757
110089
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
109758
110090
|
init_src5();
|
|
109759
|
-
import { existsSync as
|
|
110091
|
+
import { existsSync as existsSync58, readFileSync as readFileSync37 } from "node:fs";
|
|
109760
110092
|
function isTelemetryState(value) {
|
|
109761
110093
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
109762
110094
|
}
|
|
109763
110095
|
function readLastActiveDay(stateFilePath) {
|
|
109764
|
-
if (!
|
|
110096
|
+
if (!existsSync58(stateFilePath)) {
|
|
109765
110097
|
return "never";
|
|
109766
110098
|
}
|
|
109767
110099
|
let parsed;
|
|
109768
110100
|
try {
|
|
109769
|
-
parsed = JSON.parse(
|
|
110101
|
+
parsed = JSON.parse(readFileSync37(stateFilePath, "utf-8"));
|
|
109770
110102
|
} catch (error51) {
|
|
109771
110103
|
if (error51 instanceof Error) {
|
|
109772
110104
|
return "unreadable";
|
|
@@ -109824,17 +110156,17 @@ async function probeBinary(cmd, args, spawnImpl) {
|
|
|
109824
110156
|
}
|
|
109825
110157
|
|
|
109826
110158
|
// packages/team-core/src/team-registry/paths.ts
|
|
109827
|
-
import { homedir as
|
|
110159
|
+
import { homedir as homedir21 } from "node:os";
|
|
109828
110160
|
import path12 from "node:path";
|
|
109829
110161
|
function resolveBaseDir(config4) {
|
|
109830
|
-
return expandHomeDirectory(config4.base_dir ?? path12.join(
|
|
110162
|
+
return expandHomeDirectory(config4.base_dir ?? path12.join(homedir21(), ".omo"));
|
|
109831
110163
|
}
|
|
109832
110164
|
function expandHomeDirectory(directoryPath3) {
|
|
109833
110165
|
if (directoryPath3 === "~") {
|
|
109834
|
-
return
|
|
110166
|
+
return homedir21();
|
|
109835
110167
|
}
|
|
109836
110168
|
if (directoryPath3.startsWith("~/") || directoryPath3.startsWith("~\\")) {
|
|
109837
|
-
return path12.join(
|
|
110169
|
+
return path12.join(homedir21(), directoryPath3.slice(2));
|
|
109838
110170
|
}
|
|
109839
110171
|
return directoryPath3;
|
|
109840
110172
|
}
|
|
@@ -109891,10 +110223,10 @@ async function pathExists(dir) {
|
|
|
109891
110223
|
|
|
109892
110224
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
109893
110225
|
init_src2();
|
|
109894
|
-
import { existsSync as
|
|
110226
|
+
import { existsSync as existsSync59 } from "node:fs";
|
|
109895
110227
|
import { lstat as lstat15, readdir as readdir14, readFile as readFile27 } from "node:fs/promises";
|
|
109896
|
-
import { homedir as
|
|
109897
|
-
import { basename as basename11, join as
|
|
110228
|
+
import { homedir as homedir22 } from "node:os";
|
|
110229
|
+
import { basename as basename11, join as join85, resolve as resolve24 } from "node:path";
|
|
109898
110230
|
// packages/omo-opencode/package.json
|
|
109899
110231
|
var package_default3 = {
|
|
109900
110232
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -109959,13 +110291,13 @@ var CODEX_BIN_NAMES = [
|
|
|
109959
110291
|
"omo-git-bash-hook"
|
|
109960
110292
|
];
|
|
109961
110293
|
async function gatherCodexSummary(deps = {}) {
|
|
109962
|
-
const codexHome =
|
|
110294
|
+
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join85(homedir22(), ".codex"));
|
|
109963
110295
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
109964
110296
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
109965
110297
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
109966
|
-
const manifest2 = pluginRoot === null ? null : await readJson(
|
|
109967
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
109968
|
-
const configPath =
|
|
110298
|
+
const manifest2 = pluginRoot === null ? null : await readJson(join85(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
110299
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join85(pluginRoot, "lazycodex-install.json"));
|
|
110300
|
+
const configPath = join85(codexHome, "config.toml");
|
|
109969
110301
|
const pluginVersion = stringField(manifest2, "version");
|
|
109970
110302
|
return {
|
|
109971
110303
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -110022,7 +110354,7 @@ function buildCodexIssues(summary) {
|
|
|
110022
110354
|
if (summary.pluginRoot === null) {
|
|
110023
110355
|
issues.push({
|
|
110024
110356
|
title: "OMO Codex plugin is not installed",
|
|
110025
|
-
description: `Expected cached plugin at ${
|
|
110357
|
+
description: `Expected cached plugin at ${join85("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
110026
110358
|
fix: "Run: npx lazycodex-ai install",
|
|
110027
110359
|
severity: "error",
|
|
110028
110360
|
affects: ["plugin loading"]
|
|
@@ -110087,15 +110419,15 @@ function buildCodexIssues(summary) {
|
|
|
110087
110419
|
return issues;
|
|
110088
110420
|
}
|
|
110089
110421
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
110090
|
-
const pluginRoot =
|
|
110091
|
-
if (!
|
|
110422
|
+
const pluginRoot = join85(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
110423
|
+
if (!existsSync59(pluginRoot))
|
|
110092
110424
|
return null;
|
|
110093
110425
|
const versions2 = await readdir14(pluginRoot, { withFileTypes: true });
|
|
110094
110426
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
110095
|
-
return candidates.length === 0 ? null :
|
|
110427
|
+
return candidates.length === 0 ? null : join85(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
110096
110428
|
}
|
|
110097
110429
|
async function readCodexConfigSummary(configPath) {
|
|
110098
|
-
if (!
|
|
110430
|
+
if (!existsSync59(configPath)) {
|
|
110099
110431
|
return {
|
|
110100
110432
|
exists: false,
|
|
110101
110433
|
marketplaceConfigured: false,
|
|
@@ -110120,14 +110452,14 @@ async function readCodexConfigSummary(configPath) {
|
|
|
110120
110452
|
async function readLinkedBins(binDir) {
|
|
110121
110453
|
const linked = [];
|
|
110122
110454
|
for (const name of CODEX_BIN_NAMES) {
|
|
110123
|
-
if (await pathExists2(
|
|
110455
|
+
if (await pathExists2(join85(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
110124
110456
|
linked.push(name);
|
|
110125
110457
|
}
|
|
110126
110458
|
return linked;
|
|
110127
110459
|
}
|
|
110128
110460
|
async function readLinkedAgents(codexHome) {
|
|
110129
|
-
const agentsDir =
|
|
110130
|
-
if (!
|
|
110461
|
+
const agentsDir = join85(codexHome, "agents");
|
|
110462
|
+
if (!existsSync59(agentsDir))
|
|
110131
110463
|
return [];
|
|
110132
110464
|
const entries = await readdir14(agentsDir, { withFileTypes: true });
|
|
110133
110465
|
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename11(entry.name, ".toml")).sort();
|
|
@@ -110173,16 +110505,16 @@ function formatCompanionPluginStatus(config4) {
|
|
|
110173
110505
|
return "none";
|
|
110174
110506
|
}
|
|
110175
110507
|
function readCompanionLifecycleHookStateEvents(content) {
|
|
110176
|
-
const
|
|
110508
|
+
const events2 = new Set;
|
|
110177
110509
|
for (const section of splitTomlSections(content)) {
|
|
110178
110510
|
if (section.header === null)
|
|
110179
110511
|
continue;
|
|
110180
110512
|
const key = parseHookStateHeaderKey(section.header);
|
|
110181
110513
|
const event = key === null ? null : companionLifecycleEventFromHookStateKey(key);
|
|
110182
110514
|
if (event !== null)
|
|
110183
|
-
|
|
110515
|
+
events2.add(event);
|
|
110184
110516
|
}
|
|
110185
|
-
return [...
|
|
110517
|
+
return [...events2].sort(compareCompanionLifecycleEvents);
|
|
110186
110518
|
}
|
|
110187
110519
|
function companionLifecycleEventFromHookStateKey(key) {
|
|
110188
110520
|
if (!key.startsWith(`${COMPANION_PLUGIN_KEY}:`))
|
|
@@ -110196,8 +110528,8 @@ function compareCompanionLifecycleEvents(left, right) {
|
|
|
110196
110528
|
function companionLifecycleEventOrder(event) {
|
|
110197
110529
|
return event === "session_start" ? 0 : event === "stop" ? 1 : 2;
|
|
110198
110530
|
}
|
|
110199
|
-
function formatCompanionLifecycleEvents(
|
|
110200
|
-
return
|
|
110531
|
+
function formatCompanionLifecycleEvents(events2) {
|
|
110532
|
+
return events2.map(formatCompanionLifecycleEvent).join(", ");
|
|
110201
110533
|
}
|
|
110202
110534
|
function formatCompanionLifecycleEvent(event) {
|
|
110203
110535
|
switch (event) {
|
|
@@ -110241,8 +110573,8 @@ async function pathExists2(path14) {
|
|
|
110241
110573
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
110242
110574
|
init_src2();
|
|
110243
110575
|
import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "node:fs/promises";
|
|
110244
|
-
import { homedir as
|
|
110245
|
-
import { dirname as
|
|
110576
|
+
import { homedir as homedir23 } from "node:os";
|
|
110577
|
+
import { dirname as dirname33, isAbsolute as isAbsolute12, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "node:path";
|
|
110246
110578
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
110247
110579
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
110248
110580
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -110252,7 +110584,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110252
110584
|
const env3 = deps.env ?? process.env;
|
|
110253
110585
|
const platform = deps.platform ?? process.platform;
|
|
110254
110586
|
const arch = deps.arch ?? process.arch;
|
|
110255
|
-
const codexHome =
|
|
110587
|
+
const codexHome = resolve25(deps.codexHome ?? env3["CODEX_HOME"] ?? join86(homedir23(), ".codex"));
|
|
110256
110588
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
110257
110589
|
if (summary.pluginRoot === null) {
|
|
110258
110590
|
return {
|
|
@@ -110277,7 +110609,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110277
110609
|
});
|
|
110278
110610
|
}
|
|
110279
110611
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
110280
|
-
const runtimeSgPath =
|
|
110612
|
+
const runtimeSgPath = join86(runtimeSgDir, sgBinaryName(platform));
|
|
110281
110613
|
const sg = findSgBinarySync({
|
|
110282
110614
|
arch,
|
|
110283
110615
|
env: env3,
|
|
@@ -110316,8 +110648,8 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110316
110648
|
const manifest2 = await readJson2(manifestPath);
|
|
110317
110649
|
if (manifest2 === null || !isRecord12(manifest2["mcpServers"]))
|
|
110318
110650
|
continue;
|
|
110319
|
-
const manifestRoot =
|
|
110320
|
-
const isRootManifest =
|
|
110651
|
+
const manifestRoot = dirname33(manifestPath);
|
|
110652
|
+
const isRootManifest = resolve25(manifestRoot) === resolve25(pluginRoot);
|
|
110321
110653
|
for (const server2 of Object.values(manifest2["mcpServers"])) {
|
|
110322
110654
|
if (!isRecord12(server2) || !Array.isArray(server2["args"]))
|
|
110323
110655
|
continue;
|
|
@@ -110337,7 +110669,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110337
110669
|
continue;
|
|
110338
110670
|
const commands2 = [];
|
|
110339
110671
|
collectHookCommands(manifest2, commands2);
|
|
110340
|
-
const hookPluginRoot =
|
|
110672
|
+
const hookPluginRoot = dirname33(dirname33(hookManifestPath));
|
|
110341
110673
|
for (const command of commands2) {
|
|
110342
110674
|
for (const relativePath of extractPluginRootPaths(command)) {
|
|
110343
110675
|
referencedCount += 1;
|
|
@@ -110359,8 +110691,8 @@ function recordBrokenTarget(broken, classified, origin) {
|
|
|
110359
110691
|
broken.push(entry);
|
|
110360
110692
|
}
|
|
110361
110693
|
async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
|
|
110362
|
-
const targetPath =
|
|
110363
|
-
const bundleRootPath =
|
|
110694
|
+
const targetPath = resolve25(baseRoot, relativePath);
|
|
110695
|
+
const bundleRootPath = resolve25(bundleRoot);
|
|
110364
110696
|
const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
|
|
110365
110697
|
if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
|
|
110366
110698
|
if (allowEscape)
|
|
@@ -110376,7 +110708,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
|
|
|
110376
110708
|
}
|
|
110377
110709
|
async function findHookManifestPaths(root) {
|
|
110378
110710
|
const paths3 = await findManifestPaths(root, "hooks.json");
|
|
110379
|
-
return paths3.filter((path14) =>
|
|
110711
|
+
return paths3.filter((path14) => dirname33(path14).endsWith(`${sep9}hooks`));
|
|
110380
110712
|
}
|
|
110381
110713
|
async function findManifestPaths(root, manifestName) {
|
|
110382
110714
|
let entries;
|
|
@@ -110389,7 +110721,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
110389
110721
|
for (const entry of entries) {
|
|
110390
110722
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
110391
110723
|
continue;
|
|
110392
|
-
const entryPath =
|
|
110724
|
+
const entryPath = join86(root, entry.name);
|
|
110393
110725
|
if (entry.isDirectory()) {
|
|
110394
110726
|
paths3.push(...await findManifestPaths(entryPath, manifestName));
|
|
110395
110727
|
continue;
|
|
@@ -110433,18 +110765,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
110433
110765
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
110434
110766
|
}
|
|
110435
110767
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
110436
|
-
return
|
|
110768
|
+
return join86(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
110437
110769
|
}
|
|
110438
110770
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
110439
110771
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
110440
110772
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
110441
110773
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
110442
|
-
if (sgPath ===
|
|
110774
|
+
if (sgPath === join86(runtimeSgDir, sgBinaryName(platform)))
|
|
110443
110775
|
return "runtime dir";
|
|
110444
110776
|
return "PATH";
|
|
110445
110777
|
}
|
|
110446
110778
|
async function readBootstrapStateSummary(codexHome) {
|
|
110447
|
-
const statePath =
|
|
110779
|
+
const statePath = join86(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
110448
110780
|
const raw = await readJson2(statePath);
|
|
110449
110781
|
if (raw === null)
|
|
110450
110782
|
return null;
|
|
@@ -110520,24 +110852,24 @@ function isRecord12(value) {
|
|
|
110520
110852
|
}
|
|
110521
110853
|
|
|
110522
110854
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
110523
|
-
import { existsSync as
|
|
110855
|
+
import { existsSync as existsSync60 } from "node:fs";
|
|
110524
110856
|
import { readFile as readFile29 } from "node:fs/promises";
|
|
110525
|
-
import { homedir as
|
|
110526
|
-
import { join as
|
|
110857
|
+
import { homedir as homedir24 } from "node:os";
|
|
110858
|
+
import { join as join87, resolve as resolve26 } from "node:path";
|
|
110527
110859
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
110528
110860
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
110529
110861
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
110530
110862
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
110531
|
-
const codexHome =
|
|
110863
|
+
const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join87(homedir24(), ".codex"));
|
|
110532
110864
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110533
110865
|
const platform = deps.platform ?? process.platform;
|
|
110534
|
-
const wrapperPath =
|
|
110535
|
-
const legacyWrapperPath =
|
|
110866
|
+
const wrapperPath = join87(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
|
|
110867
|
+
const legacyWrapperPath = join87(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
110536
110868
|
const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
|
|
110537
110869
|
const issues = [];
|
|
110538
110870
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
110539
110871
|
const targetPath = parseRuntimeTargetPath(wrapper);
|
|
110540
|
-
if (targetPath !== null && !
|
|
110872
|
+
if (targetPath !== null && !existsSync60(targetPath)) {
|
|
110541
110873
|
issues.push({
|
|
110542
110874
|
title: "omo-agent-toolkit runtime wrapper target is missing",
|
|
110543
110875
|
description: `Generated omo-agent-toolkit runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
|
|
@@ -111051,24 +111383,24 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
111051
111383
|
// packages/mcp-client-core/src/mcp-oauth/storage.ts
|
|
111052
111384
|
import { createHash as createHash6 } from "node:crypto";
|
|
111053
111385
|
import {
|
|
111054
|
-
chmodSync as
|
|
111055
|
-
existsSync as
|
|
111056
|
-
mkdirSync as
|
|
111386
|
+
chmodSync as chmodSync5,
|
|
111387
|
+
existsSync as existsSync63,
|
|
111388
|
+
mkdirSync as mkdirSync15,
|
|
111057
111389
|
readdirSync as readdirSync11,
|
|
111058
|
-
readFileSync as
|
|
111390
|
+
readFileSync as readFileSync39,
|
|
111059
111391
|
renameSync as renameSync7,
|
|
111060
111392
|
unlinkSync as unlinkSync9,
|
|
111061
|
-
writeFileSync as
|
|
111393
|
+
writeFileSync as writeFileSync12
|
|
111062
111394
|
} from "node:fs";
|
|
111063
|
-
import { basename as basename12, dirname as
|
|
111395
|
+
import { basename as basename12, dirname as dirname34, join as join90 } from "node:path";
|
|
111064
111396
|
|
|
111065
111397
|
// packages/mcp-client-core/src/config-dir.ts
|
|
111066
|
-
import { existsSync as
|
|
111067
|
-
import { homedir as
|
|
111068
|
-
import { join as
|
|
111398
|
+
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
|
|
111399
|
+
import { homedir as homedir25 } from "node:os";
|
|
111400
|
+
import { join as join88, resolve as resolve27 } from "node:path";
|
|
111069
111401
|
function resolveConfigPath2(pathValue) {
|
|
111070
|
-
const resolvedPath =
|
|
111071
|
-
if (!
|
|
111402
|
+
const resolvedPath = resolve27(pathValue);
|
|
111403
|
+
if (!existsSync61(resolvedPath))
|
|
111072
111404
|
return resolvedPath;
|
|
111073
111405
|
try {
|
|
111074
111406
|
return realpathSync8(resolvedPath);
|
|
@@ -111083,13 +111415,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
111083
111415
|
if (customConfigDir) {
|
|
111084
111416
|
return resolveConfigPath2(customConfigDir);
|
|
111085
111417
|
}
|
|
111086
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
111087
|
-
return resolveConfigPath2(
|
|
111418
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join88(homedir25(), ".config");
|
|
111419
|
+
return resolveConfigPath2(join88(xdgConfigDir, "opencode"));
|
|
111088
111420
|
}
|
|
111089
111421
|
|
|
111090
111422
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
111091
|
-
import { chmodSync as
|
|
111092
|
-
import { join as
|
|
111423
|
+
import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync38, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "node:fs";
|
|
111424
|
+
import { join as join89 } from "node:path";
|
|
111093
111425
|
var INDEX_FILE_NAME = "index.json";
|
|
111094
111426
|
function isTokenIndex(value) {
|
|
111095
111427
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -111097,14 +111429,14 @@ function isTokenIndex(value) {
|
|
|
111097
111429
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
111098
111430
|
}
|
|
111099
111431
|
function getIndexPath(storageDir) {
|
|
111100
|
-
return
|
|
111432
|
+
return join89(storageDir, INDEX_FILE_NAME);
|
|
111101
111433
|
}
|
|
111102
111434
|
function readTokenIndex(storageDir) {
|
|
111103
111435
|
const indexPath = getIndexPath(storageDir);
|
|
111104
|
-
if (!
|
|
111436
|
+
if (!existsSync62(indexPath))
|
|
111105
111437
|
return {};
|
|
111106
111438
|
try {
|
|
111107
|
-
const parsed = JSON.parse(
|
|
111439
|
+
const parsed = JSON.parse(readFileSync38(indexPath, "utf-8"));
|
|
111108
111440
|
return isTokenIndex(parsed) ? parsed : {};
|
|
111109
111441
|
} catch (readError) {
|
|
111110
111442
|
if (!(readError instanceof Error))
|
|
@@ -111116,8 +111448,8 @@ function writeTokenIndex(storageDir, index) {
|
|
|
111116
111448
|
try {
|
|
111117
111449
|
const indexPath = getIndexPath(storageDir);
|
|
111118
111450
|
const tempPath = `${indexPath}.tmp.${Date.now()}`;
|
|
111119
|
-
|
|
111120
|
-
|
|
111451
|
+
writeFileSync11(tempPath, JSON.stringify(index, null, 2), { encoding: "utf-8", mode: 384 });
|
|
111452
|
+
chmodSync4(tempPath, 384);
|
|
111121
111453
|
renameSync6(tempPath, indexPath);
|
|
111122
111454
|
return true;
|
|
111123
111455
|
} catch (writeError) {
|
|
@@ -111141,16 +111473,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
111141
111473
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
111142
111474
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
111143
111475
|
function getMcpOauthStorageDir() {
|
|
111144
|
-
return
|
|
111476
|
+
return join90(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
111145
111477
|
}
|
|
111146
111478
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
111147
111479
|
return createHash6("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
111148
111480
|
}
|
|
111149
111481
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
111150
|
-
return
|
|
111482
|
+
return join90(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
111151
111483
|
}
|
|
111152
111484
|
function getLegacyStoragePath() {
|
|
111153
|
-
return
|
|
111485
|
+
return join90(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
111154
111486
|
}
|
|
111155
111487
|
function normalizeHost2(serverHost) {
|
|
111156
111488
|
let host = serverHost.trim();
|
|
@@ -111211,10 +111543,10 @@ function isOAuthTokenData(value) {
|
|
|
111211
111543
|
return clientSecret === undefined || typeof clientSecret === "string";
|
|
111212
111544
|
}
|
|
111213
111545
|
function readTokenFile(filePath) {
|
|
111214
|
-
if (!
|
|
111546
|
+
if (!existsSync63(filePath))
|
|
111215
111547
|
return null;
|
|
111216
111548
|
try {
|
|
111217
|
-
const parsed = JSON.parse(
|
|
111549
|
+
const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
|
|
111218
111550
|
return isOAuthTokenData(parsed) ? parsed : null;
|
|
111219
111551
|
} catch (readError) {
|
|
111220
111552
|
if (!(readError instanceof Error))
|
|
@@ -111224,10 +111556,10 @@ function readTokenFile(filePath) {
|
|
|
111224
111556
|
}
|
|
111225
111557
|
function readLegacyStore() {
|
|
111226
111558
|
const filePath = getLegacyStoragePath();
|
|
111227
|
-
if (!
|
|
111559
|
+
if (!existsSync63(filePath))
|
|
111228
111560
|
return null;
|
|
111229
111561
|
try {
|
|
111230
|
-
const parsed = JSON.parse(
|
|
111562
|
+
const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
|
|
111231
111563
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
|
|
111232
111564
|
return null;
|
|
111233
111565
|
const result = {};
|
|
@@ -111244,13 +111576,13 @@ function readLegacyStore() {
|
|
|
111244
111576
|
}
|
|
111245
111577
|
function writeTokenFile(filePath, token) {
|
|
111246
111578
|
try {
|
|
111247
|
-
const dir =
|
|
111248
|
-
if (!
|
|
111249
|
-
|
|
111579
|
+
const dir = dirname34(filePath);
|
|
111580
|
+
if (!existsSync63(dir)) {
|
|
111581
|
+
mkdirSync15(dir, { recursive: true });
|
|
111250
111582
|
}
|
|
111251
111583
|
const tempPath = `${filePath}.tmp.${Date.now()}`;
|
|
111252
|
-
|
|
111253
|
-
|
|
111584
|
+
writeFileSync12(tempPath, JSON.stringify(token, null, 2), { encoding: "utf-8", mode: 384 });
|
|
111585
|
+
chmodSync5(tempPath, 384);
|
|
111254
111586
|
renameSync7(tempPath, filePath);
|
|
111255
111587
|
return true;
|
|
111256
111588
|
} catch (writeError) {
|
|
@@ -111269,7 +111601,7 @@ function saveToken(serverHost, resource, token) {
|
|
|
111269
111601
|
}
|
|
111270
111602
|
function deleteToken(serverHost, resource) {
|
|
111271
111603
|
const filePath = getMcpOauthStoragePath(serverHost, resource);
|
|
111272
|
-
if (!
|
|
111604
|
+
if (!existsSync63(filePath))
|
|
111273
111605
|
return deleteLegacyToken(serverHost, resource);
|
|
111274
111606
|
try {
|
|
111275
111607
|
unlinkSync9(filePath);
|
|
@@ -111291,7 +111623,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
111291
111623
|
if (Object.keys(store2).length === 0) {
|
|
111292
111624
|
try {
|
|
111293
111625
|
const filePath = getLegacyStoragePath();
|
|
111294
|
-
if (
|
|
111626
|
+
if (existsSync63(filePath))
|
|
111295
111627
|
unlinkSync9(filePath);
|
|
111296
111628
|
return true;
|
|
111297
111629
|
} catch (deleteError) {
|
|
@@ -111305,8 +111637,8 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
111305
111637
|
function writeLegacyStore(store2) {
|
|
111306
111638
|
try {
|
|
111307
111639
|
const filePath = getLegacyStoragePath();
|
|
111308
|
-
|
|
111309
|
-
|
|
111640
|
+
writeFileSync12(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
|
|
111641
|
+
chmodSync5(filePath, 384);
|
|
111310
111642
|
return true;
|
|
111311
111643
|
} catch (writeError) {
|
|
111312
111644
|
if (!(writeError instanceof Error))
|
|
@@ -111329,7 +111661,7 @@ function listTokensByHost(serverHost) {
|
|
|
111329
111661
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
111330
111662
|
if (!indexedKey.startsWith(prefix))
|
|
111331
111663
|
continue;
|
|
111332
|
-
const indexedToken = readTokenFile(
|
|
111664
|
+
const indexedToken = readTokenFile(join90(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
111333
111665
|
if (indexedToken)
|
|
111334
111666
|
result[indexedKey] = indexedToken;
|
|
111335
111667
|
}
|
|
@@ -111338,13 +111670,13 @@ function listTokensByHost(serverHost) {
|
|
|
111338
111670
|
function listAllTokens() {
|
|
111339
111671
|
const result = { ...readLegacyStore() ?? {} };
|
|
111340
111672
|
const dir = getMcpOauthStorageDir();
|
|
111341
|
-
if (!
|
|
111673
|
+
if (!existsSync63(dir))
|
|
111342
111674
|
return result;
|
|
111343
111675
|
const index = readTokenIndex(dir);
|
|
111344
111676
|
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
111345
111677
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
111346
111678
|
continue;
|
|
111347
|
-
const token = readTokenFile(
|
|
111679
|
+
const token = readTokenFile(join90(dir, entry.name));
|
|
111348
111680
|
const hash2 = basename12(entry.name, ".json");
|
|
111349
111681
|
if (token)
|
|
111350
111682
|
result[index[hash2] ?? hash2] = token;
|
|
@@ -111544,7 +111876,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
|
111544
111876
|
}
|
|
111545
111877
|
var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
111546
111878
|
function startCallbackServer(port) {
|
|
111547
|
-
return new Promise((
|
|
111879
|
+
return new Promise((resolve28, reject) => {
|
|
111548
111880
|
let timeoutId;
|
|
111549
111881
|
const server2 = createServer2((request, response) => {
|
|
111550
111882
|
clearTimeout(timeoutId);
|
|
@@ -111570,7 +111902,7 @@ function startCallbackServer(port) {
|
|
|
111570
111902
|
response.writeHead(200, { "content-type": "text/html" });
|
|
111571
111903
|
response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
|
|
111572
111904
|
server2.close();
|
|
111573
|
-
|
|
111905
|
+
resolve28({ code, state: state2 });
|
|
111574
111906
|
});
|
|
111575
111907
|
timeoutId = setTimeout(() => {
|
|
111576
111908
|
server2.close();
|
|
@@ -111910,7 +112242,7 @@ function createMcpOAuthCommand() {
|
|
|
111910
112242
|
}
|
|
111911
112243
|
|
|
111912
112244
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
111913
|
-
import { existsSync as
|
|
112245
|
+
import { existsSync as existsSync64 } from "node:fs";
|
|
111914
112246
|
|
|
111915
112247
|
// packages/omo-opencode/src/cli/boulder/formatter.ts
|
|
111916
112248
|
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
@@ -112047,10 +112379,10 @@ async function boulder(options) {
|
|
|
112047
112379
|
const boulderFilePath = getBoulderFilePath(directory);
|
|
112048
112380
|
const state2 = readBoulderState(directory);
|
|
112049
112381
|
if (!state2) {
|
|
112050
|
-
const message =
|
|
112382
|
+
const message = existsSync64(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
|
|
112051
112383
|
process.stderr.write(`${message}
|
|
112052
112384
|
`);
|
|
112053
|
-
return
|
|
112385
|
+
return existsSync64(boulderFilePath) ? 2 : 1;
|
|
112054
112386
|
}
|
|
112055
112387
|
const works = getBoulderWorks(state2);
|
|
112056
112388
|
const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
|
|
@@ -112068,12 +112400,12 @@ async function boulder(options) {
|
|
|
112068
112400
|
}
|
|
112069
112401
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
112070
112402
|
import { spawn as spawn5 } from "node:child_process";
|
|
112071
|
-
import { existsSync as
|
|
112072
|
-
import { homedir as
|
|
112403
|
+
import { existsSync as existsSync65, readFileSync as readFileSync40, realpathSync as realpathSync9 } from "node:fs";
|
|
112404
|
+
import { homedir as homedir26 } from "node:os";
|
|
112073
112405
|
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
|
|
112074
112406
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
112075
112407
|
const env3 = input.env ?? process.env;
|
|
112076
|
-
const homeDir = input.homeDir ??
|
|
112408
|
+
const homeDir = input.homeDir ?? homedir26();
|
|
112077
112409
|
const localComponentBin = resolveLocalUlwLoopBin(env3, homeDir);
|
|
112078
112410
|
if (localComponentBin !== null)
|
|
112079
112411
|
return { executable: localComponentBin, argsPrefix: [] };
|
|
@@ -112096,29 +112428,29 @@ async function codexUlwLoop(args) {
|
|
|
112096
112428
|
console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
|
|
112097
112429
|
return 1;
|
|
112098
112430
|
}
|
|
112099
|
-
const { promise: promise2, resolve:
|
|
112431
|
+
const { promise: promise2, resolve: resolve28 } = Promise.withResolvers();
|
|
112100
112432
|
const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
|
|
112101
112433
|
stdio: "inherit",
|
|
112102
112434
|
env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
|
|
112103
112435
|
});
|
|
112104
112436
|
child.on("error", (error51) => {
|
|
112105
112437
|
console.error(error51.message);
|
|
112106
|
-
|
|
112438
|
+
resolve28(1);
|
|
112107
112439
|
});
|
|
112108
|
-
child.on("close", (code) =>
|
|
112440
|
+
child.on("close", (code) => resolve28(code ?? 1));
|
|
112109
112441
|
return promise2;
|
|
112110
112442
|
}
|
|
112111
112443
|
function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
112112
112444
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
|
|
112113
|
-
return candidates.find((candidate2) =>
|
|
112445
|
+
return candidates.find((candidate2) => existsSync65(candidate2)) ?? null;
|
|
112114
112446
|
}
|
|
112115
112447
|
function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
112116
112448
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
|
|
112117
|
-
return candidates.find((candidate2) =>
|
|
112449
|
+
return candidates.find((candidate2) => existsSync65(candidate2) && !isCurrentExecutable(candidate2, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate2)) ?? null;
|
|
112118
112450
|
}
|
|
112119
112451
|
function isGeneratedRuntimeWrapper(candidate2) {
|
|
112120
112452
|
try {
|
|
112121
|
-
return
|
|
112453
|
+
return readFileSync40(candidate2, "utf8").includes(RUNTIME_WRAPPER_MARKER);
|
|
112122
112454
|
} catch (error51) {
|
|
112123
112455
|
if (error51 instanceof Error)
|
|
112124
112456
|
return false;
|