oh-my-opencode 5.0.0-beta.1 → 5.0.0-beta.11
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 +805 -534
- package/dist/cli/run/on-complete-hook.d.ts +2 -0
- package/dist/cli-node/index.js +805 -534
- 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 +1566 -1217
- 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/tools/delegate-task/builtin-categories.d.ts +1 -0
- package/dist/tools/delegate-task/builtin-category-definition.d.ts +1 -0
- package/dist/tools/delegate-task/tool-description.d.ts +3 -1
- package/dist/tui.js +184 -83
- 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-outside-cwd.test.ts +78 -0
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +66 -13
- package/packages/lsp-core/src/lsp/client-wrapper.ts +70 -18
- package/packages/lsp-core/src/lsp/outside-context-workspace.ts +33 -0
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
- package/packages/lsp-core/src/lsp/workspace-markers.ts +1 -0
- 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 +160 -71
- package/packages/lsp-daemon/dist/client.js +135 -46
- package/packages/lsp-daemon/dist/index.js +143 -54
- package/packages/lsp-tools-mcp/dist/cli.js +131 -42
- package/packages/lsp-tools-mcp/dist/mcp.js +131 -42
- package/packages/lsp-tools-mcp/dist/tools.js +131 -42
- 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 +147 -64
- 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/index.js
CHANGED
|
@@ -1019,7 +1019,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1019
1019
|
this._exitCallback = (err) => {
|
|
1020
1020
|
if (err.code !== "commander.executeSubCommandAsync") {
|
|
1021
1021
|
throw err;
|
|
1022
|
-
}
|
|
1022
|
+
}
|
|
1023
1023
|
};
|
|
1024
1024
|
}
|
|
1025
1025
|
return this;
|
|
@@ -2145,7 +2145,7 @@ var package_default;
|
|
|
2145
2145
|
var init_package = __esm(() => {
|
|
2146
2146
|
package_default = {
|
|
2147
2147
|
name: "oh-my-opencode",
|
|
2148
|
-
version: "5.0.0-beta.
|
|
2148
|
+
version: "5.0.0-beta.11",
|
|
2149
2149
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
2150
2150
|
main: "./dist/index.js",
|
|
2151
2151
|
types: "dist/index.d.ts",
|
|
@@ -2281,6 +2281,7 @@ var init_package = __esm(() => {
|
|
|
2281
2281
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
2282
2282
|
test: "bun test",
|
|
2283
2283
|
"test:codex": "bun run build:codex-install && bun run build:git-bash-mcp && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && npm --prefix packages/lsp-tools-mcp test && npm --prefix packages/omo-codex/plugin ci && npm --prefix packages/omo-codex/plugin/components/ulw-loop test && bun run --cwd packages/omo-codex/plugin build && npm --prefix packages/omo-codex/plugin/components/codegraph run typecheck && npm --prefix packages/omo-codex/plugin/components/codegraph test && node scripts/check-third-party-notices.mjs --ship && bun test packages/omo-opencode/src/cli/cli-installer.platform.test.ts packages/omo-codex/src/install/codex-cache.test.ts packages/omo-codex/src/install/codex-cleanup.test.ts packages/omo-codex/src/install/codex-config-agent-cleanup.test.ts packages/omo-codex/src/install/codex-config-autonomous-features.test.ts packages/omo-codex/src/install/codex-config-reasoning.test.ts packages/omo-codex/src/install/codex-config-toml.test.ts packages/omo-codex/src/install/codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex.test.ts packages/omo-codex/src/install/install-codex-packaged.test.ts packages/omo-codex/src/install/link-cached-plugin-agents.test.ts packages/omo-codex/src/**/*.test.ts packages/utils/src/jsonc-parser.test.ts packages/utils/src/frontmatter.test.ts packages/hashline-core/src/hash-computation.test.ts packages/hashline-core/src/smoke-untested-modules.test.ts packages/rules-engine/src/index.test.ts packages/rules-engine/src/security-boundary.test.ts packages/agents-md-core/src/injector.test.ts packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts && node --test packages/omo-codex/plugin/test/*.test.mjs packages/omo-codex/scripts/install-cache-copy.test.mjs packages/omo-codex/scripts/install-cli-args.test.mjs packages/omo-codex/scripts/install-delegated-command.test.mjs packages/omo-codex/scripts/install-config-autonomous-features.test.mjs packages/omo-codex/scripts/install-config-autonomous.test.mjs packages/omo-codex/scripts/install-config-reasoning.test.mjs packages/omo-codex/scripts/install-config.test.mjs packages/omo-codex/scripts/install-hook-targets.test.mjs packages/omo-codex/scripts/install-project-local-cleanup.test.mjs packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs packages/omo-codex/scripts/install-local-entrypoint.test.mjs packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs packages/omo-codex/scripts/install-local.test.mjs packages/omo-codex/scripts/install-marketplace-cache.test.mjs packages/omo-codex/scripts/install-mcp-context7-runtime.test.mjs packages/omo-codex/scripts/install-mcp-runtime.test.mjs packages/omo-codex/scripts/install-packaged-local.test.mjs packages/omo-codex/scripts/install-generated-bundle.test.mjs packages/omo-codex/scripts/install-agent-links.test.mjs packages/omo-codex/scripts/install-bin-links.test.mjs",
|
|
2284
|
+
"test:fast": "bun run script/test-fast.ts",
|
|
2284
2285
|
"test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test packages/omo-senpi",
|
|
2285
2286
|
"test:windows-codex": "bun run test:codex",
|
|
2286
2287
|
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
|
|
@@ -2325,7 +2326,7 @@ var init_package = __esm(() => {
|
|
|
2325
2326
|
zod: "^4.4.3"
|
|
2326
2327
|
},
|
|
2327
2328
|
devDependencies: {
|
|
2328
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
2329
|
+
"@code-yeongyu/senpi": "2026.8.18-3",
|
|
2329
2330
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
2330
2331
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
2331
2332
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
@@ -2341,6 +2342,7 @@ var init_package = __esm(() => {
|
|
|
2341
2342
|
"@oh-my-opencode/model-core": "workspace:*",
|
|
2342
2343
|
"@oh-my-opencode/omo-codex": "workspace:*",
|
|
2343
2344
|
"@oh-my-opencode/omo-config-core": "workspace:*",
|
|
2345
|
+
"@oh-my-opencode/omo-opencode": "workspace:*",
|
|
2344
2346
|
"@oh-my-opencode/omo-senpi": "workspace:*",
|
|
2345
2347
|
"@oh-my-opencode/openclaw-core": "workspace:*",
|
|
2346
2348
|
"@oh-my-opencode/pi-goal": "workspace:*",
|
|
@@ -2356,7 +2358,7 @@ var init_package = __esm(() => {
|
|
|
2356
2358
|
"@oh-my-opencode/utils": "workspace:*",
|
|
2357
2359
|
"@types/js-yaml": "^4.0.9",
|
|
2358
2360
|
"@types/picomatch": "^4.0.3",
|
|
2359
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
2361
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
2360
2362
|
"@xterm/addon-unicode11": "^0.9.0",
|
|
2361
2363
|
"@xterm/xterm": "^6.0.0",
|
|
2362
2364
|
"bun-types": "1.3.14",
|
|
@@ -2365,24 +2367,24 @@ var init_package = __esm(() => {
|
|
|
2365
2367
|
typescript: "^7.0.2"
|
|
2366
2368
|
},
|
|
2367
2369
|
optionalDependencies: {
|
|
2368
|
-
"oh-my-opencode-darwin-arm64": "5.0.0-beta.
|
|
2369
|
-
"oh-my-opencode-darwin-x64": "5.0.0-beta.
|
|
2370
|
-
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.
|
|
2371
|
-
"oh-my-opencode-linux-arm64": "5.0.0-beta.
|
|
2372
|
-
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.
|
|
2373
|
-
"oh-my-opencode-linux-x64": "5.0.0-beta.
|
|
2374
|
-
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.
|
|
2375
|
-
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.
|
|
2376
|
-
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.
|
|
2377
|
-
"oh-my-opencode-windows-arm64": "5.0.0-beta.
|
|
2378
|
-
"oh-my-opencode-windows-x64": "5.0.0-beta.
|
|
2379
|
-
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.
|
|
2370
|
+
"oh-my-opencode-darwin-arm64": "5.0.0-beta.11",
|
|
2371
|
+
"oh-my-opencode-darwin-x64": "5.0.0-beta.11",
|
|
2372
|
+
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.11",
|
|
2373
|
+
"oh-my-opencode-linux-arm64": "5.0.0-beta.11",
|
|
2374
|
+
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.11",
|
|
2375
|
+
"oh-my-opencode-linux-x64": "5.0.0-beta.11",
|
|
2376
|
+
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.11",
|
|
2377
|
+
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.11",
|
|
2378
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.11",
|
|
2379
|
+
"oh-my-opencode-windows-arm64": "5.0.0-beta.11",
|
|
2380
|
+
"oh-my-opencode-windows-x64": "5.0.0-beta.11",
|
|
2381
|
+
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.11"
|
|
2380
2382
|
},
|
|
2381
2383
|
overrides: {
|
|
2382
|
-
"@earendil-works/pi-agent-core": "0.
|
|
2383
|
-
"@earendil-works/pi-ai": "0.
|
|
2384
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
2385
|
-
"@earendil-works/pi-tui": "0.
|
|
2384
|
+
"@earendil-works/pi-agent-core": "0.84.2",
|
|
2385
|
+
"@earendil-works/pi-ai": "0.84.2",
|
|
2386
|
+
"@earendil-works/pi-coding-agent": "0.84.2",
|
|
2387
|
+
"@earendil-works/pi-tui": "0.84.2",
|
|
2386
2388
|
hono: "^4.12.18",
|
|
2387
2389
|
"@hono/node-server": "^1.19.13",
|
|
2388
2390
|
"express-rate-limit": "^8.5.1",
|
|
@@ -18761,7 +18763,7 @@ function finalize(ctx, schema) {
|
|
|
18761
18763
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
18762
18764
|
} else if (ctx.target === "draft-04") {
|
|
18763
18765
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
18764
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
18766
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
18765
18767
|
if (ctx.external?.uri) {
|
|
18766
18768
|
const id = ctx.external.registry.get(schema)?.id;
|
|
18767
18769
|
if (!id)
|
|
@@ -19022,7 +19024,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
19022
19024
|
if (val === undefined) {
|
|
19023
19025
|
if (ctx.unrepresentable === "throw") {
|
|
19024
19026
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
19025
|
-
}
|
|
19027
|
+
}
|
|
19026
19028
|
} else if (typeof val === "bigint") {
|
|
19027
19029
|
if (ctx.unrepresentable === "throw") {
|
|
19028
19030
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -22404,15 +22406,16 @@ var init_codegraph = __esm(() => {
|
|
|
22404
22406
|
});
|
|
22405
22407
|
|
|
22406
22408
|
// packages/omo-config-core/src/schema/memory.ts
|
|
22407
|
-
var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
|
|
22409
|
+
var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryNudgeSchema, OmoMemoryFactsSchema, OmoMemoryDreamSchema, OmoMemoryPeopleSchema, OmoMemorySoulSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryNudgeLayerSchema, OmoMemoryFactsLayerSchema, OmoMemoryDreamLayerSchema, OmoMemoryPeopleLayerSchema, OmoMemorySoulLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
|
|
22408
22410
|
var init_memory = __esm(() => {
|
|
22409
22411
|
init_zod();
|
|
22410
22412
|
OmoMemoryReflectionTriggerSchema = object({
|
|
22411
|
-
step_count: number2().int().nonnegative().default(
|
|
22413
|
+
step_count: number2().int().nonnegative().default(25),
|
|
22412
22414
|
on_compaction: boolean2().default(true)
|
|
22413
22415
|
}).strict();
|
|
22414
22416
|
OmoMemoryReflectionSchema = object({
|
|
22415
|
-
|
|
22417
|
+
enabled: boolean2().default(true),
|
|
22418
|
+
trigger: OmoMemoryReflectionTriggerSchema.default({ step_count: 25, on_compaction: true }),
|
|
22416
22419
|
merge: _enum2(["auto", "integration"]).default("auto"),
|
|
22417
22420
|
category: string2().min(1).default("quick"),
|
|
22418
22421
|
timeout_minutes: number2().int().positive().default(15),
|
|
@@ -22425,11 +22428,36 @@ var init_memory = __esm(() => {
|
|
|
22425
22428
|
OmoMemorySearchSchema = object({
|
|
22426
22429
|
enabled: boolean2().default(true)
|
|
22427
22430
|
}).strict();
|
|
22431
|
+
OmoMemoryNudgeSchema = object({
|
|
22432
|
+
enabled: boolean2().default(true),
|
|
22433
|
+
every_user_turns: number2().int().min(1).default(10)
|
|
22434
|
+
}).strict();
|
|
22435
|
+
OmoMemoryFactsSchema = object({
|
|
22436
|
+
enabled: boolean2().default(true),
|
|
22437
|
+
debounce_settles: number2().int().min(1).default(4)
|
|
22438
|
+
}).strict();
|
|
22439
|
+
OmoMemoryDreamSchema = object({
|
|
22440
|
+
enabled: boolean2().default(true),
|
|
22441
|
+
idle_minutes: number2().int().min(0).default(30),
|
|
22442
|
+
min_hours_between: number2().int().min(1).default(24),
|
|
22443
|
+
shutdown_launch: boolean2().default(true),
|
|
22444
|
+
auto_select_max: number2().int().min(1).max(10).default(5),
|
|
22445
|
+
auto_select_max_chars: number2().int().min(1e4).default(150000)
|
|
22446
|
+
}).strict();
|
|
22447
|
+
OmoMemoryPeopleSchema = object({
|
|
22448
|
+
enabled: boolean2().default(true),
|
|
22449
|
+
max_entries: number2().int().min(1).max(100).default(40),
|
|
22450
|
+
max_entry_chars: number2().int().min(50).max(500).default(200)
|
|
22451
|
+
}).strict();
|
|
22452
|
+
OmoMemorySoulSchema = object({
|
|
22453
|
+
edit_notice: boolean2().default(true)
|
|
22454
|
+
}).strict();
|
|
22428
22455
|
OmoMemoryReflectionTriggerLayerSchema = object({
|
|
22429
22456
|
step_count: number2().int().nonnegative().optional(),
|
|
22430
22457
|
on_compaction: boolean2().optional()
|
|
22431
22458
|
}).strict();
|
|
22432
22459
|
OmoMemoryReflectionLayerSchema = object({
|
|
22460
|
+
enabled: boolean2().optional(),
|
|
22433
22461
|
trigger: OmoMemoryReflectionTriggerLayerSchema.optional(),
|
|
22434
22462
|
merge: _enum2(["auto", "integration"]).optional(),
|
|
22435
22463
|
category: string2().min(1).optional(),
|
|
@@ -22443,10 +22471,39 @@ var init_memory = __esm(() => {
|
|
|
22443
22471
|
OmoMemorySearchLayerSchema = object({
|
|
22444
22472
|
enabled: boolean2().optional()
|
|
22445
22473
|
}).strict();
|
|
22474
|
+
OmoMemoryNudgeLayerSchema = object({
|
|
22475
|
+
enabled: boolean2().optional(),
|
|
22476
|
+
every_user_turns: number2().int().min(1).optional()
|
|
22477
|
+
}).strict();
|
|
22478
|
+
OmoMemoryFactsLayerSchema = object({
|
|
22479
|
+
enabled: boolean2().optional(),
|
|
22480
|
+
debounce_settles: number2().int().min(1).optional()
|
|
22481
|
+
}).strict();
|
|
22482
|
+
OmoMemoryDreamLayerSchema = object({
|
|
22483
|
+
enabled: boolean2().optional(),
|
|
22484
|
+
idle_minutes: number2().int().min(0).optional(),
|
|
22485
|
+
min_hours_between: number2().int().min(1).optional(),
|
|
22486
|
+
shutdown_launch: boolean2().optional(),
|
|
22487
|
+
auto_select_max: number2().int().min(1).max(10).optional(),
|
|
22488
|
+
auto_select_max_chars: number2().int().min(1e4).optional()
|
|
22489
|
+
}).strict();
|
|
22490
|
+
OmoMemoryPeopleLayerSchema = object({
|
|
22491
|
+
enabled: boolean2().optional(),
|
|
22492
|
+
max_entries: number2().int().min(1).max(100).optional(),
|
|
22493
|
+
max_entry_chars: number2().int().min(50).max(500).optional()
|
|
22494
|
+
}).strict();
|
|
22495
|
+
OmoMemorySoulLayerSchema = object({
|
|
22496
|
+
edit_notice: boolean2().optional()
|
|
22497
|
+
}).strict();
|
|
22446
22498
|
OmoMemoryAgentOverridesSchema = object({
|
|
22447
22499
|
enabled: boolean2().optional(),
|
|
22448
22500
|
agent: string2().min(1).optional(),
|
|
22449
22501
|
reflection: OmoMemoryReflectionLayerSchema.optional(),
|
|
22502
|
+
nudge: OmoMemoryNudgeLayerSchema.optional(),
|
|
22503
|
+
facts: OmoMemoryFactsLayerSchema.optional(),
|
|
22504
|
+
dream: OmoMemoryDreamLayerSchema.optional(),
|
|
22505
|
+
people: OmoMemoryPeopleLayerSchema.optional(),
|
|
22506
|
+
soul: OmoMemorySoulLayerSchema.optional(),
|
|
22450
22507
|
sync: OmoMemorySyncLayerSchema.optional(),
|
|
22451
22508
|
search: OmoMemorySearchLayerSchema.optional(),
|
|
22452
22509
|
compile_warn_tokens: number2().int().positive().optional()
|
|
@@ -22454,13 +22511,27 @@ var init_memory = __esm(() => {
|
|
|
22454
22511
|
OmoMemorySettingsSchema = object({
|
|
22455
22512
|
enabled: boolean2().default(true),
|
|
22456
22513
|
agent: string2().min(1).default("auto"),
|
|
22514
|
+
tool_exposure: _enum2(["direct", "search"]).default("direct"),
|
|
22457
22515
|
reflection: OmoMemoryReflectionSchema.default({
|
|
22458
|
-
|
|
22516
|
+
enabled: true,
|
|
22517
|
+
trigger: { step_count: 25, on_compaction: true },
|
|
22459
22518
|
merge: "auto",
|
|
22460
22519
|
category: "quick",
|
|
22461
22520
|
timeout_minutes: 15,
|
|
22462
22521
|
sandbox: "auto"
|
|
22463
22522
|
}),
|
|
22523
|
+
nudge: OmoMemoryNudgeSchema.default({ enabled: true, every_user_turns: 10 }),
|
|
22524
|
+
facts: OmoMemoryFactsSchema.default({ enabled: true, debounce_settles: 4 }),
|
|
22525
|
+
dream: OmoMemoryDreamSchema.default({
|
|
22526
|
+
enabled: true,
|
|
22527
|
+
idle_minutes: 30,
|
|
22528
|
+
min_hours_between: 24,
|
|
22529
|
+
shutdown_launch: true,
|
|
22530
|
+
auto_select_max: 5,
|
|
22531
|
+
auto_select_max_chars: 150000
|
|
22532
|
+
}),
|
|
22533
|
+
people: OmoMemoryPeopleSchema.default({ enabled: true, max_entries: 40, max_entry_chars: 200 }),
|
|
22534
|
+
soul: OmoMemorySoulSchema.default({ edit_notice: true }),
|
|
22464
22535
|
sync: OmoMemorySyncSchema.default({ enabled: true }),
|
|
22465
22536
|
search: OmoMemorySearchSchema.default({ enabled: true }),
|
|
22466
22537
|
compile_warn_tokens: number2().int().positive().default(30000),
|
|
@@ -22469,7 +22540,13 @@ var init_memory = __esm(() => {
|
|
|
22469
22540
|
OmoMemorySettingsLayerSchema = object({
|
|
22470
22541
|
enabled: boolean2().optional(),
|
|
22471
22542
|
agent: string2().min(1).optional(),
|
|
22543
|
+
tool_exposure: _enum2(["direct", "search"]).optional(),
|
|
22472
22544
|
reflection: OmoMemoryReflectionLayerSchema.optional(),
|
|
22545
|
+
nudge: OmoMemoryNudgeLayerSchema.optional(),
|
|
22546
|
+
facts: OmoMemoryFactsLayerSchema.optional(),
|
|
22547
|
+
dream: OmoMemoryDreamLayerSchema.optional(),
|
|
22548
|
+
people: OmoMemoryPeopleLayerSchema.optional(),
|
|
22549
|
+
soul: OmoMemorySoulLayerSchema.optional(),
|
|
22473
22550
|
sync: OmoMemorySyncLayerSchema.optional(),
|
|
22474
22551
|
search: OmoMemorySearchLayerSchema.optional(),
|
|
22475
22552
|
compile_warn_tokens: number2().int().positive().optional(),
|
|
@@ -22508,7 +22585,7 @@ function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism
|
|
|
22508
22585
|
residency_max_children: record2["residency_max_children"] ?? Math.max(8, resolveParallelism() * 3)
|
|
22509
22586
|
});
|
|
22510
22587
|
}
|
|
22511
|
-
var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskSettingsSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
|
|
22588
|
+
var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
|
|
22512
22589
|
var init_task = __esm(() => {
|
|
22513
22590
|
init_zod();
|
|
22514
22591
|
ResidencyMaxChildrenInputSchema = union([number2().int().positive(), literal("unlimited")]);
|
|
@@ -22525,6 +22602,16 @@ var init_task = __esm(() => {
|
|
|
22525
22602
|
OmoTaskWarningsSchema = object({
|
|
22526
22603
|
unavailable_categories: boolean2().default(true)
|
|
22527
22604
|
}).strict();
|
|
22605
|
+
OmoTaskDagSettingsSchema = object({
|
|
22606
|
+
max_nodes_per_run: number2().int().positive().default(64),
|
|
22607
|
+
max_runs_per_session: number2().int().positive().default(16),
|
|
22608
|
+
subscriber_ring: number2().int().positive().default(1000),
|
|
22609
|
+
heartbeat_ms: number2().int().positive().default(15000),
|
|
22610
|
+
history_default_limit: number2().int().positive().default(256),
|
|
22611
|
+
history_max_limit: number2().int().positive().default(1000),
|
|
22612
|
+
retention_days: number2().int().positive().default(7),
|
|
22613
|
+
max_prompt_bytes: number2().int().positive().default(262144)
|
|
22614
|
+
}).strict();
|
|
22528
22615
|
OmoTaskSettingsSchema = object({
|
|
22529
22616
|
default_execution_mode: _enum2(["in-process", "process"]).default("in-process"),
|
|
22530
22617
|
default_concurrency: number2().int().positive().default(5),
|
|
@@ -22542,7 +22629,18 @@ var init_task = __esm(() => {
|
|
|
22542
22629
|
max_members: 8,
|
|
22543
22630
|
max_parallel_members: 4,
|
|
22544
22631
|
max_wall_clock_minutes: 120
|
|
22545
|
-
})
|
|
22632
|
+
}),
|
|
22633
|
+
dag: OmoTaskDagSettingsSchema.optional()
|
|
22634
|
+
}).strict();
|
|
22635
|
+
OmoTaskDagSettingsLayerSchema = object({
|
|
22636
|
+
max_nodes_per_run: number2().int().positive().optional(),
|
|
22637
|
+
max_runs_per_session: number2().int().positive().optional(),
|
|
22638
|
+
subscriber_ring: number2().int().positive().optional(),
|
|
22639
|
+
heartbeat_ms: number2().int().positive().optional(),
|
|
22640
|
+
history_default_limit: number2().int().positive().optional(),
|
|
22641
|
+
history_max_limit: number2().int().positive().optional(),
|
|
22642
|
+
retention_days: number2().int().positive().optional(),
|
|
22643
|
+
max_prompt_bytes: number2().int().positive().optional()
|
|
22546
22644
|
}).strict();
|
|
22547
22645
|
OmoTaskWaitLayerSchema = object({
|
|
22548
22646
|
min_ms: number2().int().positive().optional(),
|
|
@@ -22570,7 +22668,8 @@ var init_task = __esm(() => {
|
|
|
22570
22668
|
resume_children: boolean2().optional(),
|
|
22571
22669
|
warnings: OmoTaskWarningsLayerSchema.optional(),
|
|
22572
22670
|
wait: OmoTaskWaitLayerSchema.optional(),
|
|
22573
|
-
team: OmoTaskTeamSettingsLayerSchema.optional()
|
|
22671
|
+
team: OmoTaskTeamSettingsLayerSchema.optional(),
|
|
22672
|
+
dag: OmoTaskDagSettingsLayerSchema.optional()
|
|
22574
22673
|
}).strict();
|
|
22575
22674
|
});
|
|
22576
22675
|
|
|
@@ -22625,6 +22724,19 @@ var init_team = __esm(() => {
|
|
|
22625
22724
|
OmoTeamsConfigLayerSchema = record(string2(), OmoTeamSpecLayerSchema);
|
|
22626
22725
|
});
|
|
22627
22726
|
|
|
22727
|
+
// packages/omo-config-core/src/schema/telemetry.ts
|
|
22728
|
+
var OmoTelemetrySettingsShape, OmoTelemetrySettingsLayerSchema, OmoTelemetrySettingsSchema;
|
|
22729
|
+
var init_telemetry = __esm(() => {
|
|
22730
|
+
init_zod();
|
|
22731
|
+
OmoTelemetrySettingsShape = {
|
|
22732
|
+
enabled: boolean2()
|
|
22733
|
+
};
|
|
22734
|
+
OmoTelemetrySettingsLayerSchema = object(OmoTelemetrySettingsShape).partial().strict();
|
|
22735
|
+
OmoTelemetrySettingsSchema = OmoTelemetrySettingsLayerSchema.extend({
|
|
22736
|
+
enabled: boolean2().default(true)
|
|
22737
|
+
}).strict();
|
|
22738
|
+
});
|
|
22739
|
+
|
|
22628
22740
|
// packages/omo-config-core/src/schema/config.ts
|
|
22629
22741
|
var OmoOpenCodeHarnessConfigSchema, OmoTypedHarnessConfigSchema, OmoConfigProfileSchema, OmoConfigSchema, OmoConfigLayerSchema;
|
|
22630
22742
|
var init_config = __esm(() => {
|
|
@@ -22636,6 +22748,7 @@ var init_config = __esm(() => {
|
|
|
22636
22748
|
init_model_catalog();
|
|
22637
22749
|
init_task();
|
|
22638
22750
|
init_team();
|
|
22751
|
+
init_telemetry();
|
|
22639
22752
|
OmoOpenCodeHarnessConfigSchema = record(string2(), unknown());
|
|
22640
22753
|
OmoTypedHarnessConfigSchema = object({
|
|
22641
22754
|
categories: OmoCategoriesConfigSchema.optional(),
|
|
@@ -22644,7 +22757,8 @@ var init_config = __esm(() => {
|
|
|
22644
22757
|
task: OmoTaskSettingsLayerSchema.optional(),
|
|
22645
22758
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
22646
22759
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
22647
|
-
memory: OmoMemorySettingsLayerSchema.optional()
|
|
22760
|
+
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
22761
|
+
telemetry: OmoTelemetrySettingsLayerSchema.optional()
|
|
22648
22762
|
}).strict();
|
|
22649
22763
|
OmoConfigProfileSchema = object({
|
|
22650
22764
|
categories: OmoCategoriesConfigSchema.optional(),
|
|
@@ -22654,6 +22768,7 @@ var init_config = __esm(() => {
|
|
|
22654
22768
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
22655
22769
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
22656
22770
|
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
22771
|
+
telemetry: OmoTelemetrySettingsLayerSchema.optional(),
|
|
22657
22772
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
22658
22773
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
22659
22774
|
"[codex]": OmoTypedHarnessConfigSchema.optional()
|
|
@@ -22667,6 +22782,7 @@ var init_config = __esm(() => {
|
|
|
22667
22782
|
teams: OmoTeamsConfigSchema.optional(),
|
|
22668
22783
|
models: OmoModelCatalogSchema.optional(),
|
|
22669
22784
|
memory: OmoMemorySettingsSchema.optional(),
|
|
22785
|
+
telemetry: OmoTelemetrySettingsSchema.optional(),
|
|
22670
22786
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
22671
22787
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
22672
22788
|
"[codex]": OmoTypedHarnessConfigSchema.optional(),
|
|
@@ -22683,6 +22799,7 @@ var init_config = __esm(() => {
|
|
|
22683
22799
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
22684
22800
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
22685
22801
|
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
22802
|
+
telemetry: OmoTelemetrySettingsLayerSchema.optional(),
|
|
22686
22803
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
22687
22804
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
22688
22805
|
"[codex]": OmoTypedHarnessConfigSchema.optional(),
|
|
@@ -22705,6 +22822,7 @@ var init_schema = __esm(() => {
|
|
|
22705
22822
|
init_model_ref();
|
|
22706
22823
|
init_task();
|
|
22707
22824
|
init_team();
|
|
22825
|
+
init_telemetry();
|
|
22708
22826
|
});
|
|
22709
22827
|
|
|
22710
22828
|
// packages/omo-config-core/src/loader/merge.ts
|
|
@@ -24267,16 +24385,30 @@ function invocationsForPlatform(scriptPath, platform) {
|
|
|
24267
24385
|
async function runInvocation(input) {
|
|
24268
24386
|
const child = input.spawnProcess(input.invocation.command, input.invocation.args, { cwd: input.skillDir, env: input.env });
|
|
24269
24387
|
let timedOut = false;
|
|
24388
|
+
let terminateDeadline;
|
|
24389
|
+
let terminateDeadlineGrace;
|
|
24390
|
+
const killIgnored = new Promise((_, reject) => {
|
|
24391
|
+
terminateDeadline = () => reject(new Error("ast-grep install child ignored termination"));
|
|
24392
|
+
});
|
|
24270
24393
|
const timeout = setTimeout(() => {
|
|
24271
24394
|
timedOut = true;
|
|
24272
24395
|
child.kill();
|
|
24396
|
+
terminateDeadlineGrace = setTimeout(() => terminateDeadline?.(), KILL_GRACE_MS);
|
|
24273
24397
|
}, input.timeoutMs);
|
|
24274
|
-
timeout.unref?.();
|
|
24275
24398
|
try {
|
|
24276
|
-
const outcome = await child.outcome;
|
|
24277
|
-
|
|
24399
|
+
const outcome = await Promise.race([child.outcome, killIgnored]);
|
|
24400
|
+
if (timedOut)
|
|
24401
|
+
return { kind: "timed-out" };
|
|
24402
|
+
return outcome;
|
|
24403
|
+
} catch (error51) {
|
|
24404
|
+
if (error51 instanceof Error && error51.message.includes("ignored termination")) {
|
|
24405
|
+
return { kind: "spawn-error", error: error51, missingExecutable: false };
|
|
24406
|
+
}
|
|
24407
|
+
throw error51;
|
|
24278
24408
|
} finally {
|
|
24279
24409
|
clearTimeout(timeout);
|
|
24410
|
+
if (terminateDeadlineGrace !== undefined)
|
|
24411
|
+
clearTimeout(terminateDeadlineGrace);
|
|
24280
24412
|
}
|
|
24281
24413
|
}
|
|
24282
24414
|
function failedReason(outcome) {
|
|
@@ -24313,7 +24445,7 @@ async function runAstGrepSkillInstall(options) {
|
|
|
24313
24445
|
return { kind: "failed", reason: String(error51) };
|
|
24314
24446
|
}
|
|
24315
24447
|
}
|
|
24316
|
-
var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR", AST_GREP_INSTALL_TIMEOUT_MS = 30000;
|
|
24448
|
+
var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR", KILL_GRACE_MS = 1000, AST_GREP_INSTALL_TIMEOUT_MS = 30000;
|
|
24317
24449
|
var init_install_script = __esm(() => {
|
|
24318
24450
|
init_sg_manifest();
|
|
24319
24451
|
});
|
|
@@ -26376,10 +26508,10 @@ var init_category_model_requirements = __esm(() => {
|
|
|
26376
26508
|
quick: {
|
|
26377
26509
|
fallbackChain: [
|
|
26378
26510
|
{ providers: ["kimi-for-coding"], model: "kimi-for-coding-highspeed" },
|
|
26379
|
-
{ providers: ["
|
|
26511
|
+
{ providers: ["openai-codex"], model: "gpt-5.6-luna-fast", variant: "low" },
|
|
26380
26512
|
{ providers: ["deepseek"], model: "deepseek-v4-flash", variant: "off" },
|
|
26381
26513
|
{
|
|
26382
|
-
providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "
|
|
26514
|
+
providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "vercel"],
|
|
26383
26515
|
model: "qwen3.6-flash",
|
|
26384
26516
|
variant: "low"
|
|
26385
26517
|
},
|
|
@@ -26395,6 +26527,11 @@ var init_category_model_requirements = __esm(() => {
|
|
|
26395
26527
|
},
|
|
26396
26528
|
"unspecified-low": {
|
|
26397
26529
|
fallbackChain: [
|
|
26530
|
+
{
|
|
26531
|
+
providers: ["xai", "github-copilot", "opencode", "vercel"],
|
|
26532
|
+
model: "grok-4.6",
|
|
26533
|
+
variant: "xhigh"
|
|
26534
|
+
},
|
|
26398
26535
|
{
|
|
26399
26536
|
providers: ["openai", "quotio-openai", "github-copilot", "opencode", "vercel"],
|
|
26400
26537
|
model: "gpt-5.6-terra",
|
|
@@ -27629,6 +27766,7 @@ var init_context_limit_resolver2 = () => {};
|
|
|
27629
27766
|
|
|
27630
27767
|
// packages/omo-opencode/src/shared/normalize-sdk-response.ts
|
|
27631
27768
|
function normalizeSDKResponse(response, fallback, options) {
|
|
27769
|
+
const fallbackIsArray = Array.isArray(fallback);
|
|
27632
27770
|
if (response == null) {
|
|
27633
27771
|
return fallback;
|
|
27634
27772
|
}
|
|
@@ -27638,14 +27776,17 @@ function normalizeSDKResponse(response, fallback, options) {
|
|
|
27638
27776
|
if (typeof response === "object" && "data" in response) {
|
|
27639
27777
|
const data = response.data;
|
|
27640
27778
|
if (data != null) {
|
|
27779
|
+
if (fallbackIsArray && !Array.isArray(data)) {
|
|
27780
|
+
return fallback;
|
|
27781
|
+
}
|
|
27641
27782
|
return data;
|
|
27642
27783
|
}
|
|
27643
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
27784
|
+
if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
|
|
27644
27785
|
return response;
|
|
27645
27786
|
}
|
|
27646
27787
|
return fallback;
|
|
27647
27788
|
}
|
|
27648
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
27789
|
+
if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
|
|
27649
27790
|
return response;
|
|
27650
27791
|
}
|
|
27651
27792
|
return fallback;
|
|
@@ -27800,24 +27941,14 @@ var init_agent_display_names = __esm(() => {
|
|
|
27800
27941
|
// packages/omo-opencode/src/tools/delegate-task/anthropic-categories.ts
|
|
27801
27942
|
var UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
27802
27943
|
You are working on tasks that don't fit specific categories but require substantial effort.
|
|
27803
|
-
|
|
27804
|
-
<Selection_Gate>
|
|
27805
|
-
BEFORE selecting this category, VERIFY ALL conditions:
|
|
27806
|
-
1. Task does NOT fit: quick (trivial), visual-engineering (UI), ultrabrain (deep logic), artistry (creative), writing (docs)
|
|
27807
|
-
2. Task requires substantial effort across multiple systems/modules
|
|
27808
|
-
3. Changes have broad impact or require careful coordination
|
|
27809
|
-
4. NOT just "complex" - must be genuinely unclassifiable AND high-effort
|
|
27810
|
-
|
|
27811
|
-
If task fits ANY other category, DO NOT select unspecified-high.
|
|
27812
|
-
If task is unclassifiable but moderate-effort, use unspecified-low instead.
|
|
27813
|
-
</Selection_Gate>
|
|
27814
|
-
</Category_Context>`, ANTHROPIC_CATEGORIES;
|
|
27944
|
+
</Category_Context>`, UNSPECIFIED_HIGH_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Use only when no specialist category fits and substantial effort spans systems/modules with broad impact. Use unspecified-low for contained moderate work.</Selection_Gate>`, ANTHROPIC_CATEGORIES;
|
|
27815
27945
|
var init_anthropic_categories = __esm(() => {
|
|
27816
27946
|
ANTHROPIC_CATEGORIES = [
|
|
27817
27947
|
{
|
|
27818
27948
|
name: "unspecified-high",
|
|
27819
27949
|
config: { model: "kimi-for-coding/k3", variant: "max" },
|
|
27820
27950
|
description: "Tasks that don't fit other categories, high effort required",
|
|
27951
|
+
callerGuidance: UNSPECIFIED_HIGH_CATEGORY_CALLER_GUIDANCE,
|
|
27821
27952
|
promptAppend: UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND
|
|
27822
27953
|
}
|
|
27823
27954
|
];
|
|
@@ -28074,64 +28205,10 @@ Approach:
|
|
|
28074
28205
|
- Minimal viable implementation
|
|
28075
28206
|
- Skip unnecessary abstractions
|
|
28076
28207
|
- Direct and concise
|
|
28077
|
-
</Category_Context>
|
|
28078
|
-
|
|
28079
|
-
<Caller_Warning>
|
|
28080
|
-
THIS CATEGORY USES A SMALLER/FASTER MODEL (gpt-5.6-luna-fast).
|
|
28081
|
-
|
|
28082
|
-
The model executing this task is optimized for speed over depth. Your prompt MUST be:
|
|
28083
|
-
|
|
28084
|
-
**EXHAUSTIVELY EXPLICIT** - Leave NOTHING to interpretation:
|
|
28085
|
-
1. MUST DO: List every required action as atomic, numbered steps
|
|
28086
|
-
2. MUST NOT DO: Explicitly forbid likely mistakes and deviations
|
|
28087
|
-
3. EXPECTED OUTPUT: Describe exact success criteria with concrete examples
|
|
28088
|
-
|
|
28089
|
-
**WHY THIS MATTERS:**
|
|
28090
|
-
- Smaller models benefit from explicit guardrails
|
|
28091
|
-
- Vague instructions may lead to unpredictable results
|
|
28092
|
-
- Implicit expectations may be missed
|
|
28093
|
-
**PROMPT STRUCTURE (MANDATORY):**
|
|
28094
|
-
\`\`\`
|
|
28095
|
-
TASK: [One-sentence goal]
|
|
28096
|
-
|
|
28097
|
-
MUST DO:
|
|
28098
|
-
1. [Specific action with exact details]
|
|
28099
|
-
2. [Another specific action]
|
|
28100
|
-
...
|
|
28101
|
-
|
|
28102
|
-
MUST NOT DO:
|
|
28103
|
-
- [Forbidden action + why]
|
|
28104
|
-
- [Another forbidden action]
|
|
28105
|
-
...
|
|
28106
|
-
|
|
28107
|
-
EXPECTED OUTPUT:
|
|
28108
|
-
- [Exact deliverable description]
|
|
28109
|
-
- [Success criteria / verification method]
|
|
28110
|
-
\`\`\`
|
|
28111
|
-
|
|
28112
|
-
If your prompt lacks this structure, REWRITE IT before delegating.
|
|
28113
|
-
</Caller_Warning>`, UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
28208
|
+
</Category_Context>`, QUICK_CATEGORY_CALLER_GUIDANCE = `<Caller_Warning>Small/fast model: before delegating, write an explicit prompt with numbered must-do steps, forbidden deviations, and concrete success criteria.</Caller_Warning>`, UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
28114
28209
|
You are working on tasks that don't fit specific categories but require moderate effort.
|
|
28115
|
-
|
|
28116
|
-
<
|
|
28117
|
-
BEFORE selecting this category, VERIFY ALL conditions:
|
|
28118
|
-
1. Task does NOT fit: quick (trivial), visual-engineering (UI), ultrabrain (deep logic), artistry (creative), writing (docs)
|
|
28119
|
-
2. Task requires more than trivial effort but is NOT system-wide
|
|
28120
|
-
3. Scope is contained within a few files/modules
|
|
28121
|
-
|
|
28122
|
-
If task fits ANY other category, DO NOT select unspecified-low.
|
|
28123
|
-
This is NOT a default choice - it's for genuinely unclassifiable moderate-effort work.
|
|
28124
|
-
</Selection_Gate>
|
|
28125
|
-
</Category_Context>
|
|
28126
|
-
|
|
28127
|
-
<Caller_Warning>
|
|
28128
|
-
THIS CATEGORY USES A LIGHTWEIGHT MODEL (gpt-5.6-luna).
|
|
28129
|
-
|
|
28130
|
-
**PROVIDE CLEAR STRUCTURE:**
|
|
28131
|
-
1. MUST DO: Enumerate required actions explicitly
|
|
28132
|
-
2. MUST NOT DO: State forbidden actions to prevent scope creep
|
|
28133
|
-
3. EXPECTED OUTPUT: Define concrete success criteria
|
|
28134
|
-
</Caller_Warning>`, OPENAI_CATEGORIES;
|
|
28210
|
+
</Category_Context>`, UNSPECIFIED_LOW_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Use only when no specialist category fits, effort is moderate, and scope stays within a few files/modules. Prefer any matching specialist category.</Selection_Gate>
|
|
28211
|
+
<Caller_Warning>Provide explicit must-do steps, forbidden scope, and concrete success criteria.</Caller_Warning>`, OPENAI_CATEGORIES;
|
|
28135
28212
|
var init_openai_categories = __esm(() => {
|
|
28136
28213
|
init_types4();
|
|
28137
28214
|
OPENAI_CATEGORIES = [
|
|
@@ -28153,12 +28230,14 @@ var init_openai_categories = __esm(() => {
|
|
|
28153
28230
|
name: "quick",
|
|
28154
28231
|
config: { model: "kimi-for-coding/kimi-for-coding-highspeed" },
|
|
28155
28232
|
description: "Trivial tasks - single file changes, typo fixes, simple modifications",
|
|
28233
|
+
callerGuidance: QUICK_CATEGORY_CALLER_GUIDANCE,
|
|
28156
28234
|
promptAppend: QUICK_CATEGORY_PROMPT_APPEND
|
|
28157
28235
|
},
|
|
28158
28236
|
{
|
|
28159
28237
|
name: "unspecified-low",
|
|
28160
|
-
config: { model: "
|
|
28238
|
+
config: { model: "xai/grok-4.6", variant: "xhigh" },
|
|
28161
28239
|
description: "Tasks that don't fit other categories, low effort required",
|
|
28240
|
+
callerGuidance: UNSPECIFIED_LOW_CATEGORY_CALLER_GUIDANCE,
|
|
28162
28241
|
promptAppend: UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND
|
|
28163
28242
|
}
|
|
28164
28243
|
];
|
|
@@ -28168,7 +28247,7 @@ var init_openai_categories = __esm(() => {
|
|
|
28168
28247
|
function buildCategoryRecord(selector) {
|
|
28169
28248
|
return Object.fromEntries(BUILTIN_CATEGORIES.map((definition) => [definition.name, selector(definition)]));
|
|
28170
28249
|
}
|
|
28171
|
-
var BUILTIN_CATEGORIES, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS, CATEGORY_DESCRIPTIONS, CATEGORY_PROMPT_APPEND_RESOLVERS, BUILTIN_CATEGORY_REQUIRES_MODEL;
|
|
28250
|
+
var BUILTIN_CATEGORIES, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS, CATEGORY_DESCRIPTIONS, CATEGORY_CALLER_GUIDANCE, CATEGORY_PROMPT_APPEND_RESOLVERS, BUILTIN_CATEGORY_REQUIRES_MODEL;
|
|
28172
28251
|
var init_builtin_categories = __esm(() => {
|
|
28173
28252
|
init_anthropic_categories();
|
|
28174
28253
|
init_google_categories();
|
|
@@ -28183,6 +28262,7 @@ var init_builtin_categories = __esm(() => {
|
|
|
28183
28262
|
DEFAULT_CATEGORIES = buildCategoryRecord((definition) => definition.config);
|
|
28184
28263
|
CATEGORY_PROMPT_APPENDS = buildCategoryRecord((definition) => definition.promptAppend);
|
|
28185
28264
|
CATEGORY_DESCRIPTIONS = buildCategoryRecord((definition) => definition.description);
|
|
28265
|
+
CATEGORY_CALLER_GUIDANCE = buildCategoryRecord((definition) => definition.callerGuidance);
|
|
28186
28266
|
CATEGORY_PROMPT_APPEND_RESOLVERS = Object.fromEntries(BUILTIN_CATEGORIES.filter((definition) => definition.resolvePromptAppend !== undefined).map((definition) => [definition.name, definition.resolvePromptAppend]));
|
|
28187
28267
|
BUILTIN_CATEGORY_REQUIRES_MODEL = Object.fromEntries(BUILTIN_CATEGORIES.filter((definition) => definition.requiresModel !== undefined).map((definition) => [definition.name, definition.requiresModel]));
|
|
28188
28268
|
});
|
|
@@ -83054,6 +83134,47 @@ var init_model_capabilities_generated = __esm(() => {
|
|
|
83054
83134
|
input: 272000,
|
|
83055
83135
|
output: 128000
|
|
83056
83136
|
}
|
|
83137
|
+
},
|
|
83138
|
+
"grok-4.6": {
|
|
83139
|
+
id: "grok-4.6",
|
|
83140
|
+
family: "grok",
|
|
83141
|
+
reasoning: true,
|
|
83142
|
+
temperature: true,
|
|
83143
|
+
toolCall: true,
|
|
83144
|
+
modalities: {
|
|
83145
|
+
input: [
|
|
83146
|
+
"text",
|
|
83147
|
+
"image"
|
|
83148
|
+
],
|
|
83149
|
+
output: [
|
|
83150
|
+
"text"
|
|
83151
|
+
]
|
|
83152
|
+
},
|
|
83153
|
+
limit: {
|
|
83154
|
+
context: 500000,
|
|
83155
|
+
output: 500000
|
|
83156
|
+
}
|
|
83157
|
+
},
|
|
83158
|
+
"xai/grok-4.6": {
|
|
83159
|
+
id: "xai/grok-4.6",
|
|
83160
|
+
family: "grok",
|
|
83161
|
+
reasoning: true,
|
|
83162
|
+
temperature: true,
|
|
83163
|
+
toolCall: true,
|
|
83164
|
+
modalities: {
|
|
83165
|
+
input: [
|
|
83166
|
+
"text",
|
|
83167
|
+
"image",
|
|
83168
|
+
"pdf"
|
|
83169
|
+
],
|
|
83170
|
+
output: [
|
|
83171
|
+
"text"
|
|
83172
|
+
]
|
|
83173
|
+
},
|
|
83174
|
+
limit: {
|
|
83175
|
+
context: 500000,
|
|
83176
|
+
output: 500000
|
|
83177
|
+
}
|
|
83057
83178
|
}
|
|
83058
83179
|
}
|
|
83059
83180
|
};
|
|
@@ -83095,21 +83216,21 @@ var init_session_cursor = __esm(() => {
|
|
|
83095
83216
|
});
|
|
83096
83217
|
|
|
83097
83218
|
// packages/omo-opencode/src/shared/shell-env.ts
|
|
83098
|
-
function detectShellType() {
|
|
83099
|
-
if (
|
|
83100
|
-
const shell =
|
|
83219
|
+
function detectShellType(platform = process.platform, env2 = process.env) {
|
|
83220
|
+
if (env2.SHELL) {
|
|
83221
|
+
const shell = env2.SHELL;
|
|
83101
83222
|
if (shell.includes("csh") || shell.includes("tcsh")) {
|
|
83102
83223
|
return "csh";
|
|
83103
83224
|
}
|
|
83104
83225
|
return "unix";
|
|
83105
83226
|
}
|
|
83106
|
-
if (
|
|
83227
|
+
if (platform === "win32" && (env2.BASH_VERSION || env2.MSYSTEM || env2.WSL_DISTRO_NAME)) {
|
|
83107
83228
|
return "unix";
|
|
83108
83229
|
}
|
|
83109
|
-
if (
|
|
83230
|
+
if (env2.PSModulePath) {
|
|
83110
83231
|
return "powershell";
|
|
83111
83232
|
}
|
|
83112
|
-
return
|
|
83233
|
+
return platform === "win32" ? "cmd" : "unix";
|
|
83113
83234
|
}
|
|
83114
83235
|
var init_shell_env = () => {};
|
|
83115
83236
|
|
|
@@ -88712,7 +88833,7 @@ var init_activity_state = __esm(() => {
|
|
|
88712
88833
|
});
|
|
88713
88834
|
|
|
88714
88835
|
// packages/telemetry-core/src/constants.ts
|
|
88715
|
-
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
|
|
88836
|
+
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74", UNCONFIGURED_POSTHOG_API_KEY = "phc_REPLACE_ME_OMO_NATIVE";
|
|
88716
88837
|
|
|
88717
88838
|
// packages/telemetry-core/src/diagnostics.ts
|
|
88718
88839
|
import { appendFileSync as appendFileSync2, existsSync as existsSync27, mkdirSync as mkdirSync9, readFileSync as readFileSync13 } from "fs";
|
|
@@ -88850,6 +88971,9 @@ function shouldDisableTelemetry(input) {
|
|
|
88850
88971
|
const env2 = input.env ?? process.env;
|
|
88851
88972
|
const globalPrefix = input.globalEnvPrefix ?? "OMO";
|
|
88852
88973
|
const prefixes = Array.from(new Set([globalPrefix, input.productEnvPrefix]));
|
|
88974
|
+
if (isDisableFlag(env2["DO_NOT_TRACK"])) {
|
|
88975
|
+
return true;
|
|
88976
|
+
}
|
|
88853
88977
|
for (const prefix of prefixes) {
|
|
88854
88978
|
if (isDisableFlag(env2[`${prefix}_DISABLE_POSTHOG`])) {
|
|
88855
88979
|
return true;
|
|
@@ -88863,6 +88987,13 @@ function shouldDisableTelemetry(input) {
|
|
|
88863
88987
|
function getTelemetryApiKey(env2 = process.env, defaultApiKey = DEFAULT_POSTHOG_API_KEY) {
|
|
88864
88988
|
return env2["POSTHOG_API_KEY"]?.trim() ?? defaultApiKey;
|
|
88865
88989
|
}
|
|
88990
|
+
function isConfiguredTelemetryApiKey(apiKey) {
|
|
88991
|
+
const normalized = apiKey.trim();
|
|
88992
|
+
return normalized.length > 0 && normalized !== UNCONFIGURED_POSTHOG_API_KEY;
|
|
88993
|
+
}
|
|
88994
|
+
function hasTelemetryApiKey(env2, defaultApiKey) {
|
|
88995
|
+
return isConfiguredTelemetryApiKey(getTelemetryApiKey(env2, defaultApiKey));
|
|
88996
|
+
}
|
|
88866
88997
|
function getTelemetryHost(env2 = process.env, defaultHost = DEFAULT_POSTHOG_HOST) {
|
|
88867
88998
|
return env2["POSTHOG_HOST"]?.trim() || defaultHost;
|
|
88868
88999
|
}
|
|
@@ -88872,17 +89003,6 @@ var init_env2 = __esm(() => {
|
|
|
88872
89003
|
SEND_OPT_OUT_VALUES = ["0", "false", "no", "yes"];
|
|
88873
89004
|
});
|
|
88874
89005
|
|
|
88875
|
-
// packages/telemetry-core/src/machine-id.ts
|
|
88876
|
-
import { createHash as createHash4 } from "crypto";
|
|
88877
|
-
import os4 from "os";
|
|
88878
|
-
function getDefaultTelemetryOsProvider() {
|
|
88879
|
-
return os4;
|
|
88880
|
-
}
|
|
88881
|
-
function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
|
|
88882
|
-
return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
|
|
88883
|
-
}
|
|
88884
|
-
var init_machine_id = () => {};
|
|
88885
|
-
|
|
88886
89006
|
// node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
88887
89007
|
import { dirname as dirname17, posix as posix7, sep as sep7 } from "path";
|
|
88888
89008
|
function createModulerModifier() {
|
|
@@ -94257,6 +94377,17 @@ var init_index_node = __esm(() => {
|
|
|
94257
94377
|
};
|
|
94258
94378
|
});
|
|
94259
94379
|
|
|
94380
|
+
// packages/telemetry-core/src/machine-id.ts
|
|
94381
|
+
import { createHash as createHash4 } from "crypto";
|
|
94382
|
+
import os4 from "os";
|
|
94383
|
+
function getDefaultTelemetryOsProvider() {
|
|
94384
|
+
return os4;
|
|
94385
|
+
}
|
|
94386
|
+
function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
|
|
94387
|
+
return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
|
|
94388
|
+
}
|
|
94389
|
+
var init_machine_id = () => {};
|
|
94390
|
+
|
|
94260
94391
|
// packages/telemetry-core/src/posthog-client.ts
|
|
94261
94392
|
class PostHogTelemetryTransport {
|
|
94262
94393
|
#client;
|
|
@@ -94278,7 +94409,7 @@ function createDefaultPostHogTransport(apiKey, options) {
|
|
|
94278
94409
|
}
|
|
94279
94410
|
function isTelemetryClientEnabled(input) {
|
|
94280
94411
|
const env2 = input.env ?? process.env;
|
|
94281
|
-
return !shouldDisableTelemetry({ env: env2, productEnvPrefix: input.product.productEnvPrefix }) &&
|
|
94412
|
+
return !shouldDisableTelemetry({ env: env2, productEnvPrefix: input.product.productEnvPrefix }) && hasTelemetryApiKey(env2, input.product.defaultApiKey);
|
|
94282
94413
|
}
|
|
94283
94414
|
function createTelemetryClient(input) {
|
|
94284
94415
|
if (!isTelemetryClientEnabled(input)) {
|
|
@@ -94344,7 +94475,8 @@ function createTransport(input) {
|
|
|
94344
94475
|
flushAt: 1,
|
|
94345
94476
|
flushInterval: 0,
|
|
94346
94477
|
host: getTelemetryHost(env2, input.product.defaultHost),
|
|
94347
|
-
disableGeoip: false
|
|
94478
|
+
disableGeoip: input.product.disableGeoip ?? false,
|
|
94479
|
+
...input.product.transportOptions
|
|
94348
94480
|
});
|
|
94349
94481
|
} catch (error51) {
|
|
94350
94482
|
input.diagnostics?.({
|
|
@@ -94421,6 +94553,17 @@ var init_posthog_client = __esm(() => {
|
|
|
94421
94553
|
};
|
|
94422
94554
|
});
|
|
94423
94555
|
|
|
94556
|
+
// packages/telemetry-core/src/events.ts
|
|
94557
|
+
var ALLOWED_DOLLAR_KEYS;
|
|
94558
|
+
var init_events = __esm(() => {
|
|
94559
|
+
ALLOWED_DOLLAR_KEYS = new Set([
|
|
94560
|
+
"$os",
|
|
94561
|
+
"$os_version",
|
|
94562
|
+
"$process_person_profile",
|
|
94563
|
+
"$session_id"
|
|
94564
|
+
]);
|
|
94565
|
+
});
|
|
94566
|
+
|
|
94424
94567
|
// packages/telemetry-core/src/record-daily-active.ts
|
|
94425
94568
|
var init_record_daily_active = () => {};
|
|
94426
94569
|
|
|
@@ -94429,6 +94572,7 @@ var init_src5 = __esm(() => {
|
|
|
94429
94572
|
init_activity_state();
|
|
94430
94573
|
init_diagnostics();
|
|
94431
94574
|
init_env2();
|
|
94575
|
+
init_events();
|
|
94432
94576
|
init_machine_id();
|
|
94433
94577
|
init_posthog_client();
|
|
94434
94578
|
init_record_daily_active();
|
|
@@ -94439,7 +94583,7 @@ var package_default2;
|
|
|
94439
94583
|
var init_package2 = __esm(() => {
|
|
94440
94584
|
package_default2 = {
|
|
94441
94585
|
name: "@oh-my-opencode/omo-codex",
|
|
94442
|
-
version: "5.0.0-beta.
|
|
94586
|
+
version: "5.0.0-beta.11",
|
|
94443
94587
|
type: "module",
|
|
94444
94588
|
private: true,
|
|
94445
94589
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -94653,7 +94797,7 @@ __export(exports_telemetry, {
|
|
|
94653
94797
|
__resetOsProviderForTesting: () => __resetOsProviderForTesting,
|
|
94654
94798
|
__resetActivityStateProviderForTesting: () => __resetActivityStateProviderForTesting
|
|
94655
94799
|
});
|
|
94656
|
-
var
|
|
94800
|
+
var init_telemetry2 = __esm(() => {
|
|
94657
94801
|
init_posthog();
|
|
94658
94802
|
});
|
|
94659
94803
|
|
|
@@ -95408,20 +95552,20 @@ var init_update_toasts = __esm(() => {
|
|
|
95408
95552
|
});
|
|
95409
95553
|
|
|
95410
95554
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
95411
|
-
import { existsSync as
|
|
95412
|
-
import { dirname as
|
|
95555
|
+
import { existsSync as existsSync48 } from "fs";
|
|
95556
|
+
import { dirname as dirname30, join as join76 } from "path";
|
|
95413
95557
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
95414
95558
|
function defaultGetModuleHostingWorkspace() {
|
|
95415
95559
|
try {
|
|
95416
|
-
const currentDir =
|
|
95560
|
+
const currentDir = dirname30(fileURLToPath5(import.meta.url));
|
|
95417
95561
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
95418
95562
|
if (!pkgJsonPath)
|
|
95419
95563
|
return null;
|
|
95420
|
-
const pkgDir =
|
|
95421
|
-
const nodeModulesDir =
|
|
95564
|
+
const pkgDir = dirname30(pkgJsonPath);
|
|
95565
|
+
const nodeModulesDir = dirname30(pkgDir);
|
|
95422
95566
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
95423
95567
|
return null;
|
|
95424
|
-
return
|
|
95568
|
+
return dirname30(nodeModulesDir);
|
|
95425
95569
|
} catch (error51) {
|
|
95426
95570
|
if (error51 instanceof Error) {
|
|
95427
95571
|
return null;
|
|
@@ -95562,8 +95706,8 @@ var init_background_update_check = __esm(() => {
|
|
|
95562
95706
|
init_package_json_locator();
|
|
95563
95707
|
init_update_toasts();
|
|
95564
95708
|
defaultDeps4 = {
|
|
95565
|
-
existsSync:
|
|
95566
|
-
join:
|
|
95709
|
+
existsSync: existsSync48,
|
|
95710
|
+
join: join76,
|
|
95567
95711
|
runBunInstallWithDetails,
|
|
95568
95712
|
log: log2,
|
|
95569
95713
|
getOpenCodeCacheDir,
|
|
@@ -95726,7 +95870,7 @@ async function showSpinnerToast(ctx, version3, message) {
|
|
|
95726
95870
|
duration: frameInterval + 50
|
|
95727
95871
|
}
|
|
95728
95872
|
}).catch(ignoreToastError);
|
|
95729
|
-
await new Promise((
|
|
95873
|
+
await new Promise((resolve22) => setTimeout(resolve22, frameInterval));
|
|
95730
95874
|
}
|
|
95731
95875
|
}
|
|
95732
95876
|
var SISYPHUS_SPINNER;
|
|
@@ -100518,7 +100662,7 @@ async function installAstGrepForCodex(options) {
|
|
|
100518
100662
|
// packages/omo-codex/src/install/codex-install-telemetry.ts
|
|
100519
100663
|
async function trackCodexInstallTelemetry() {
|
|
100520
100664
|
try {
|
|
100521
|
-
const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (
|
|
100665
|
+
const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (init_telemetry2(), exports_telemetry));
|
|
100522
100666
|
const posthog = createInstallPostHog2();
|
|
100523
100667
|
posthog.trackActive(getPostHogDistinctId2(), "install_completed");
|
|
100524
100668
|
await posthog.shutdown();
|
|
@@ -101338,22 +101482,136 @@ function nodeErrorCode6(error51) {
|
|
|
101338
101482
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
101339
101483
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101340
101484
|
import { execFile as execFile4 } from "child_process";
|
|
101341
|
-
import {
|
|
101342
|
-
import {
|
|
101343
|
-
import {
|
|
101344
|
-
import { homedir as homedir9 } from "os";
|
|
101345
|
-
import { dirname as dirname22, join as join60, resolve as resolve18 } from "path";
|
|
101485
|
+
import { existsSync as existsSync32 } from "fs";
|
|
101486
|
+
import { homedir as homedir11 } from "os";
|
|
101487
|
+
import { dirname as dirname24, join as join63, resolve as resolve20 } from "path";
|
|
101346
101488
|
import { fileURLToPath } from "url";
|
|
101347
101489
|
import { promisify as promisify2 } from "util";
|
|
101348
101490
|
|
|
101491
|
+
// packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
|
|
101492
|
+
import { existsSync as existsSync30 } from "fs";
|
|
101493
|
+
import { homedir as homedir9 } from "os";
|
|
101494
|
+
import { join as join59, resolve as resolve17 } from "path";
|
|
101495
|
+
var AGENT_DIR_ENV_NAMES = [
|
|
101496
|
+
"OMO_CODING_AGENT_DIR",
|
|
101497
|
+
"SENPI_CODING_AGENT_DIR",
|
|
101498
|
+
"PI_CODING_AGENT_DIR"
|
|
101499
|
+
];
|
|
101500
|
+
var AGENT_HOME_SENTINEL = "settings.json";
|
|
101501
|
+
function resolveAgentHome(options) {
|
|
101502
|
+
const { env: env3, homeDir = homedir9(), exists: exists7 = existsSync30 } = options;
|
|
101503
|
+
for (const name of AGENT_DIR_ENV_NAMES) {
|
|
101504
|
+
const configured = env3[name]?.trim();
|
|
101505
|
+
if (configured)
|
|
101506
|
+
return resolve17(configured);
|
|
101507
|
+
}
|
|
101508
|
+
const brandedHome = join59(homeDir, ".omo");
|
|
101509
|
+
const canonical = join59(brandedHome, "agent");
|
|
101510
|
+
if (exists7(join59(canonical, AGENT_HOME_SENTINEL)))
|
|
101511
|
+
return canonical;
|
|
101512
|
+
if (exists7(join59(brandedHome, AGENT_HOME_SENTINEL)))
|
|
101513
|
+
return brandedHome;
|
|
101514
|
+
return join59(homeDir, ".senpi", "agent");
|
|
101515
|
+
}
|
|
101516
|
+
|
|
101517
|
+
// packages/omo-senpi/src/install/local-launcher.ts
|
|
101518
|
+
import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync, writeFileSync as writeFileSync6 } from "fs";
|
|
101519
|
+
import { homedir as homedir10 } from "os";
|
|
101520
|
+
import { dirname as dirname21, join as join60, resolve as resolve18 } from "path";
|
|
101521
|
+
var MARKER = "omo-local-launcher";
|
|
101522
|
+
function localLauncherPath(homeDir = homedir10()) {
|
|
101523
|
+
return join60(homeDir, ".local", "bin", "omo");
|
|
101524
|
+
}
|
|
101525
|
+
function localLauncherCmdPath(homeDir = homedir10()) {
|
|
101526
|
+
return join60(homeDir, ".local", "bin", "omo.cmd");
|
|
101527
|
+
}
|
|
101528
|
+
function renderLocalLauncher(options) {
|
|
101529
|
+
const brand = {
|
|
101530
|
+
name: "omo",
|
|
101531
|
+
displayVersion: options.version ?? "local",
|
|
101532
|
+
configDir: ".omo",
|
|
101533
|
+
flatLayout: false,
|
|
101534
|
+
envPrefix: "OMO",
|
|
101535
|
+
userAgent: "omo",
|
|
101536
|
+
originator: "omo",
|
|
101537
|
+
update: {
|
|
101538
|
+
packageName: "omo-ai",
|
|
101539
|
+
distTag: "beta",
|
|
101540
|
+
command: "npm i -g omo-ai@beta",
|
|
101541
|
+
changelogUrl: "https://github.com/code-yeongyu/oh-my-openagent/releases"
|
|
101542
|
+
}
|
|
101543
|
+
};
|
|
101544
|
+
return `#!/usr/bin/env node
|
|
101545
|
+
// ${MARKER}: generated by the omo-senpi installer. Delete this file to remove the local launcher.
|
|
101546
|
+
import { spawn } from "node:child_process"
|
|
101547
|
+
import { homedir } from "node:os"
|
|
101548
|
+
import { join } from "node:path"
|
|
101549
|
+
|
|
101550
|
+
const brand = ${JSON.stringify(brand)}
|
|
101551
|
+
const cli = process.env.OMO_SENPI_CLI_PATH ?? ${JSON.stringify(options.senpiCliPath)}
|
|
101552
|
+
const plugin = process.env.OMO_PLUGIN_ROOT ?? ${JSON.stringify(options.pluginPath)}
|
|
101553
|
+
// The same directory the published launcher pins, so a local install shares one state location
|
|
101554
|
+
// with the published one and with anything either of them spawns.
|
|
101555
|
+
const agentDir = process.env.OMO_CODING_AGENT_DIR ?? process.env.SENPI_CODING_AGENT_DIR
|
|
101556
|
+
?? process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".omo", "agent")
|
|
101557
|
+
const env = {
|
|
101558
|
+
...process.env,
|
|
101559
|
+
SENPI_BRAND: JSON.stringify(brand),
|
|
101560
|
+
OMO_NATIVE: "1",
|
|
101561
|
+
OMO_CODING_AGENT_DIR: agentDir,
|
|
101562
|
+
SENPI_CODING_AGENT_DIR: agentDir,
|
|
101563
|
+
}
|
|
101564
|
+
// Anything resolving the product by name must re-enter through this launcher, never the engine.
|
|
101565
|
+
env.OMO_BIN = process.argv[1]
|
|
101566
|
+
const selfUpdate = process.argv[2] === "update"
|
|
101567
|
+
&& process.argv.slice(3).every((arg) => arg.startsWith("-") || ["self", "senpi", "omo"].includes(arg))
|
|
101568
|
+
&& !process.argv.slice(3).some((arg) => arg === "--extensions" || arg === "--models")
|
|
101569
|
+
if (selfUpdate) {
|
|
101570
|
+
console.log("omo is updated via npm: npm i -g omo-ai@beta")
|
|
101571
|
+
process.exit(0)
|
|
101572
|
+
}
|
|
101573
|
+
const child = spawn(process.execPath, [cli, "--extension", plugin, ...process.argv.slice(2)], {
|
|
101574
|
+
env,
|
|
101575
|
+
stdio: "inherit",
|
|
101576
|
+
})
|
|
101577
|
+
child.on("close", (code, signal) => {
|
|
101578
|
+
if (signal) {
|
|
101579
|
+
process.kill(process.pid, signal)
|
|
101580
|
+
return
|
|
101581
|
+
}
|
|
101582
|
+
process.exitCode = code ?? 1
|
|
101583
|
+
})
|
|
101584
|
+
`;
|
|
101585
|
+
}
|
|
101586
|
+
function installLocalLauncher(options) {
|
|
101587
|
+
const path6 = localLauncherPath(options.homeDir);
|
|
101588
|
+
if (existsSync31(path6) && !readFileSync14(path6, "utf8").includes(MARKER))
|
|
101589
|
+
return;
|
|
101590
|
+
mkdirSync10(dirname21(path6), { recursive: true });
|
|
101591
|
+
writeFileSync6(path6, renderLocalLauncher(options));
|
|
101592
|
+
chmodSync3(path6, 493);
|
|
101593
|
+
if ((options.platform ?? process.platform) === "win32") {
|
|
101594
|
+
writeFileSync6(localLauncherCmdPath(options.homeDir), `@echo off\r
|
|
101595
|
+
node "%~dp0omo" %*\r
|
|
101596
|
+
`);
|
|
101597
|
+
}
|
|
101598
|
+
return path6;
|
|
101599
|
+
}
|
|
101600
|
+
|
|
101601
|
+
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101602
|
+
import { createHash as createHash5 } from "crypto";
|
|
101603
|
+
import { constants as constants8 } from "fs";
|
|
101604
|
+
import { access as access2, readFile as readFile26, stat as stat6 } from "fs/promises";
|
|
101605
|
+
import { dirname as dirname23, join as join62 } from "path";
|
|
101606
|
+
|
|
101349
101607
|
// packages/omo-senpi/src/install/senpi-settings.ts
|
|
101350
101608
|
import { constants as constants7 } from "fs";
|
|
101351
101609
|
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "fs/promises";
|
|
101352
|
-
import { dirname as
|
|
101610
|
+
import { dirname as dirname22, join as join61, resolve as resolve19 } from "path";
|
|
101353
101611
|
var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
|
|
101354
101612
|
var LEGACY_BUILTIN_SHADOW_PACKAGES = [
|
|
101355
|
-
|
|
101356
|
-
|
|
101613
|
+
join61("packages", "pi-goal"),
|
|
101614
|
+
join61("packages", "pi-webfetch")
|
|
101357
101615
|
];
|
|
101358
101616
|
async function readSettings(settingsPath) {
|
|
101359
101617
|
let raw;
|
|
@@ -101382,13 +101640,13 @@ function dedupePackages(packages) {
|
|
|
101382
101640
|
return [...new Set(packages)];
|
|
101383
101641
|
}
|
|
101384
101642
|
function removeLegacyBuiltinShadows(packages, repoRoot, agentDir) {
|
|
101385
|
-
const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) =>
|
|
101386
|
-
return packages.filter((entry) => !shadowPaths.has(
|
|
101643
|
+
const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) => resolve19(repoRoot, path6)));
|
|
101644
|
+
return packages.filter((entry) => !shadowPaths.has(resolve19(agentDir, entry)));
|
|
101387
101645
|
}
|
|
101388
101646
|
async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir) {
|
|
101389
|
-
const currentPath =
|
|
101647
|
+
const currentPath = resolve19(currentPluginPath);
|
|
101390
101648
|
const entries = await Promise.all(packages.map(async (entry) => {
|
|
101391
|
-
const packagePath =
|
|
101649
|
+
const packagePath = resolve19(agentDir, entry);
|
|
101392
101650
|
if (packagePath === currentPath)
|
|
101393
101651
|
return currentPath;
|
|
101394
101652
|
return await readPackageName(packagePath) === OMO_SENPI_PACKAGE_NAME ? undefined : entry;
|
|
@@ -101396,7 +101654,7 @@ async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir
|
|
|
101396
101654
|
return entries.filter((entry) => entry !== undefined);
|
|
101397
101655
|
}
|
|
101398
101656
|
async function writeSettingsAtomically(settingsPath, settings) {
|
|
101399
|
-
await mkdir9(
|
|
101657
|
+
await mkdir9(dirname22(settingsPath), { recursive: true });
|
|
101400
101658
|
const backupPath = await nextBackupPath(settingsPath);
|
|
101401
101659
|
if (await fileExists(settingsPath)) {
|
|
101402
101660
|
await copyFile3(settingsPath, backupPath);
|
|
@@ -101428,7 +101686,7 @@ function isRecord10(value) {
|
|
|
101428
101686
|
async function readPackageName(packagePath) {
|
|
101429
101687
|
let raw;
|
|
101430
101688
|
try {
|
|
101431
|
-
raw = await readFile25(
|
|
101689
|
+
raw = await readFile25(join61(packagePath, "package.json"), "utf8");
|
|
101432
101690
|
} catch (error51) {
|
|
101433
101691
|
if (isErrno(error51, "ENOENT") || isErrno(error51, "ENOTDIR"))
|
|
101434
101692
|
return;
|
|
@@ -101451,89 +101709,56 @@ function isErrno(error51, code) {
|
|
|
101451
101709
|
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101452
101710
|
}
|
|
101453
101711
|
|
|
101454
|
-
// packages/omo-senpi/src/install/
|
|
101455
|
-
var execFileAsync2 = promisify2(execFile4);
|
|
101712
|
+
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101456
101713
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
101457
|
-
|
|
101458
|
-
|
|
101459
|
-
|
|
101460
|
-
|
|
101461
|
-
|
|
101462
|
-
|
|
101463
|
-
|
|
101464
|
-
|
|
101465
|
-
|
|
101466
|
-
|
|
101467
|
-
|
|
101468
|
-
|
|
101469
|
-
|
|
101470
|
-
|
|
101471
|
-
|
|
101472
|
-
|
|
101473
|
-
|
|
101474
|
-
|
|
101475
|
-
|
|
101476
|
-
|
|
101477
|
-
|
|
101478
|
-
|
|
101479
|
-
|
|
101480
|
-
|
|
101481
|
-
|
|
101482
|
-
|
|
101483
|
-
|
|
101484
|
-
|
|
101485
|
-
|
|
101486
|
-
|
|
101487
|
-
|
|
101488
|
-
|
|
101489
|
-
|
|
101714
|
+
join62("extensions", "omo.js"),
|
|
101715
|
+
join62("extensions", "omo-task.js"),
|
|
101716
|
+
join62("extensions", "omo-member.js"),
|
|
101717
|
+
join62("extensions", "memory-run-supervisor.mjs"),
|
|
101718
|
+
join62("extensions", "reflection-persona.md"),
|
|
101719
|
+
join62("extensions", "dream-persona.md"),
|
|
101720
|
+
join62("extensions", "facts-persona.md"),
|
|
101721
|
+
join62("skills", "ast-grep", "SKILL.md"),
|
|
101722
|
+
join62("skills", "coding-agent-sessions", "SKILL.md"),
|
|
101723
|
+
join62("skills", "debugging", "SKILL.md"),
|
|
101724
|
+
join62("skills", "frontend", "SKILL.md"),
|
|
101725
|
+
join62("skills", "git-master", "SKILL.md"),
|
|
101726
|
+
join62("skills", "init-deep", "SKILL.md"),
|
|
101727
|
+
join62("skills", "lsp-setup", "SKILL.md"),
|
|
101728
|
+
join62("skills", "programming", "SKILL.md"),
|
|
101729
|
+
join62("skills", "refactor", "SKILL.md"),
|
|
101730
|
+
join62("skills", "remove-ai-slops", "SKILL.md"),
|
|
101731
|
+
join62("skills", "review-work", "SKILL.md"),
|
|
101732
|
+
join62("skills", "start-work", "SKILL.md"),
|
|
101733
|
+
join62("skills", "ultimate-browsing", "SKILL.md"),
|
|
101734
|
+
join62("skills", "ultrawork", "SKILL.md"),
|
|
101735
|
+
join62("skills", "ulw-loop", "SKILL.md"),
|
|
101736
|
+
join62("skills", "ulw-plan", "SKILL.md"),
|
|
101737
|
+
join62("skills", "ulw-research", "SKILL.md"),
|
|
101738
|
+
join62("skills", "visual-qa", "SKILL.md"),
|
|
101739
|
+
join62("runtime", "ast-grep-mcp", "cli.js"),
|
|
101740
|
+
join62("runtime", "agent-toolkit", "cli.js"),
|
|
101741
|
+
join62("runtime", "agent-toolkit", "ulw-loop", "cli.js"),
|
|
101742
|
+
join62("runtime", "agent-toolkit", "omo-agent-toolkit"),
|
|
101743
|
+
join62("runtime", "agent-toolkit", "omo-agent-toolkit.cmd"),
|
|
101744
|
+
join62("runtime", "lsp-daemon", "dist", "cli.js"),
|
|
101745
|
+
join62("runtime", "lsp-daemon", "dist", "index.js"),
|
|
101746
|
+
join62("runtime", "lsp-daemon", "dist", "index.d.ts"),
|
|
101747
|
+
join62("runtime", "lsp-daemon", "dist", "daemon-client.js"),
|
|
101748
|
+
join62("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
|
|
101749
|
+
join62("runtime", "lsp-daemon", "dist", "package.json"),
|
|
101750
|
+
join62("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
101751
|
+
join62("scripts", "install.mjs")
|
|
101490
101752
|
];
|
|
101491
|
-
async function runSenpiInstaller(options = {}) {
|
|
101492
|
-
const context = resolveInstallContext(options);
|
|
101493
|
-
await ensurePluginArtifacts(context);
|
|
101494
|
-
const settings = await readSettings(context.settingsPath);
|
|
101495
|
-
const before = JSON.stringify(settings);
|
|
101496
|
-
const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
|
|
101497
|
-
if (!packages.includes(context.pluginPath))
|
|
101498
|
-
packages.push(context.pluginPath);
|
|
101499
|
-
settings.packages = packages;
|
|
101500
|
-
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101501
|
-
return {
|
|
101502
|
-
ok: true,
|
|
101503
|
-
action: "install",
|
|
101504
|
-
agentDir: context.agentDir,
|
|
101505
|
-
settingsPath: context.settingsPath,
|
|
101506
|
-
pluginPath: context.pluginPath,
|
|
101507
|
-
changed: JSON.stringify(settings) !== before,
|
|
101508
|
-
backupPath
|
|
101509
|
-
};
|
|
101510
|
-
}
|
|
101511
|
-
function resolveInstallContext(options) {
|
|
101512
|
-
const env3 = options.env ?? process.env;
|
|
101513
|
-
const allowBuild = options.pluginPath === undefined;
|
|
101514
|
-
const repoRoot = resolve18(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname22(fileURLToPath(import.meta.url))) : dirname22(resolve18(options.pluginPath))));
|
|
101515
|
-
const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join60(homedir9(), ".senpi", "agent"));
|
|
101516
|
-
const pluginPath = resolve18(options.pluginPath ?? join60(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101517
|
-
return {
|
|
101518
|
-
env: env3,
|
|
101519
|
-
repoRoot,
|
|
101520
|
-
agentDir,
|
|
101521
|
-
settingsPath: join60(agentDir, "settings.json"),
|
|
101522
|
-
pluginPath,
|
|
101523
|
-
platform: options.platform ?? process.platform,
|
|
101524
|
-
allowBuild,
|
|
101525
|
-
runCommand: options.runCommand ?? defaultRunCommand3
|
|
101526
|
-
};
|
|
101527
|
-
}
|
|
101528
101753
|
async function ensurePluginArtifacts(context) {
|
|
101529
101754
|
if (context.allowBuild) {
|
|
101530
|
-
await context.runCommand("node", [
|
|
101531
|
-
await context.runCommand("node", [
|
|
101532
|
-
await context.runCommand("node", [
|
|
101533
|
-
await context.runCommand("node", [
|
|
101534
|
-
await context.runCommand("node", [
|
|
101535
|
-
await context.runCommand("node", [
|
|
101536
|
-
await context.runCommand("node", [
|
|
101755
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
101756
|
+
await context.runCommand("node", [join62("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
|
|
101757
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
101758
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
|
|
101759
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
|
|
101760
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
|
|
101761
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-agent-toolkit.mjs")], { cwd: context.repoRoot });
|
|
101537
101762
|
}
|
|
101538
101763
|
if (await hasMissingPluginArtifact(context.pluginPath)) {
|
|
101539
101764
|
throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
|
|
@@ -101542,14 +101767,14 @@ async function ensurePluginArtifacts(context) {
|
|
|
101542
101767
|
}
|
|
101543
101768
|
async function hasMissingPluginArtifact(pluginPath) {
|
|
101544
101769
|
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
101545
|
-
if (!await fileExists2(
|
|
101770
|
+
if (!await fileExists2(join62(pluginPath, artifact)))
|
|
101546
101771
|
return true;
|
|
101547
101772
|
}
|
|
101548
101773
|
return false;
|
|
101549
101774
|
}
|
|
101550
101775
|
async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
|
|
101551
|
-
const runtimeEntry =
|
|
101552
|
-
const manifestPath =
|
|
101776
|
+
const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
|
|
101777
|
+
const manifestPath = join62(dirname23(runtimeEntry), "manifest.json");
|
|
101553
101778
|
let runtimeStat;
|
|
101554
101779
|
try {
|
|
101555
101780
|
runtimeStat = await stat6(runtimeEntry);
|
|
@@ -101596,6 +101821,63 @@ function astGrepIntegrityError(runtimeEntry, reason) {
|
|
|
101596
101821
|
function messageOf(error51) {
|
|
101597
101822
|
return error51 instanceof Error ? error51.message : String(error51);
|
|
101598
101823
|
}
|
|
101824
|
+
async function fileExists2(path6) {
|
|
101825
|
+
try {
|
|
101826
|
+
await access2(path6, constants8.F_OK);
|
|
101827
|
+
return true;
|
|
101828
|
+
} catch (error51) {
|
|
101829
|
+
if (isErrno2(error51, "ENOENT"))
|
|
101830
|
+
return false;
|
|
101831
|
+
throw error51;
|
|
101832
|
+
}
|
|
101833
|
+
}
|
|
101834
|
+
function isErrno2(error51, code) {
|
|
101835
|
+
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101836
|
+
}
|
|
101837
|
+
|
|
101838
|
+
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101839
|
+
var execFileAsync2 = promisify2(execFile4);
|
|
101840
|
+
async function runSenpiInstaller(options = {}) {
|
|
101841
|
+
const context = resolveInstallContext(options);
|
|
101842
|
+
await ensurePluginArtifacts(context);
|
|
101843
|
+
const settings = await readSettings(context.settingsPath);
|
|
101844
|
+
const before = JSON.stringify(settings);
|
|
101845
|
+
const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
|
|
101846
|
+
if (!packages.includes(context.pluginPath))
|
|
101847
|
+
packages.push(context.pluginPath);
|
|
101848
|
+
settings.packages = packages;
|
|
101849
|
+
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101850
|
+
installLocalLauncher({
|
|
101851
|
+
pluginPath: context.pluginPath,
|
|
101852
|
+
senpiCliPath: join63(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
|
|
101853
|
+
});
|
|
101854
|
+
return {
|
|
101855
|
+
ok: true,
|
|
101856
|
+
action: "install",
|
|
101857
|
+
agentDir: context.agentDir,
|
|
101858
|
+
settingsPath: context.settingsPath,
|
|
101859
|
+
pluginPath: context.pluginPath,
|
|
101860
|
+
changed: JSON.stringify(settings) !== before,
|
|
101861
|
+
backupPath
|
|
101862
|
+
};
|
|
101863
|
+
}
|
|
101864
|
+
function resolveInstallContext(options) {
|
|
101865
|
+
const env3 = options.env ?? process.env;
|
|
101866
|
+
const allowBuild = options.pluginPath === undefined;
|
|
101867
|
+
const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve20(options.pluginPath))));
|
|
101868
|
+
const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env: env3, homeDir: env3.HOME ?? homedir11() }));
|
|
101869
|
+
const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101870
|
+
return {
|
|
101871
|
+
env: env3,
|
|
101872
|
+
repoRoot,
|
|
101873
|
+
agentDir,
|
|
101874
|
+
settingsPath: join63(agentDir, "settings.json"),
|
|
101875
|
+
pluginPath,
|
|
101876
|
+
platform: options.platform ?? process.platform,
|
|
101877
|
+
allowBuild,
|
|
101878
|
+
runCommand: options.runCommand ?? defaultRunCommand3
|
|
101879
|
+
};
|
|
101880
|
+
}
|
|
101599
101881
|
async function defaultRunCommand3(command, args, options) {
|
|
101600
101882
|
const result = await execFileAsync2(command, [...args], { cwd: options.cwd });
|
|
101601
101883
|
if (result.stderr.trim().length > 0)
|
|
@@ -101606,27 +101888,14 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
101606
101888
|
function findRepoRoot2(importerDir) {
|
|
101607
101889
|
let current = importerDir;
|
|
101608
101890
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
101609
|
-
if (fileExistsSync(
|
|
101891
|
+
if (fileExistsSync(join63(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
101610
101892
|
return current;
|
|
101611
|
-
current =
|
|
101893
|
+
current = resolve20(current, "..");
|
|
101612
101894
|
}
|
|
101613
101895
|
throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
|
|
101614
101896
|
}
|
|
101615
|
-
async function fileExists2(path6) {
|
|
101616
|
-
try {
|
|
101617
|
-
await access2(path6, constants8.F_OK);
|
|
101618
|
-
return true;
|
|
101619
|
-
} catch (error51) {
|
|
101620
|
-
if (isErrno2(error51, "ENOENT"))
|
|
101621
|
-
return false;
|
|
101622
|
-
throw error51;
|
|
101623
|
-
}
|
|
101624
|
-
}
|
|
101625
101897
|
function fileExistsSync(path6) {
|
|
101626
|
-
return
|
|
101627
|
-
}
|
|
101628
|
-
function isErrno2(error51, code) {
|
|
101629
|
-
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101898
|
+
return existsSync32(path6);
|
|
101630
101899
|
}
|
|
101631
101900
|
// packages/omo-opencode/src/cli/star-request.ts
|
|
101632
101901
|
import { execFile as execFile5 } from "child_process";
|
|
@@ -101662,26 +101931,26 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
|
|
|
101662
101931
|
init_provider_availability();
|
|
101663
101932
|
|
|
101664
101933
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
101665
|
-
import { existsSync as
|
|
101666
|
-
import { join as
|
|
101934
|
+
import { existsSync as existsSync34, mkdirSync as mkdirSync11, readFileSync as readFileSync16 } from "fs";
|
|
101935
|
+
import { join as join65 } from "path";
|
|
101667
101936
|
|
|
101668
101937
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
101669
101938
|
init_shared();
|
|
101670
|
-
import { existsSync as
|
|
101671
|
-
import { join as
|
|
101939
|
+
import { existsSync as existsSync33, readFileSync as readFileSync15 } from "fs";
|
|
101940
|
+
import { join as join64 } from "path";
|
|
101672
101941
|
var TUI_SUBPATH = "tui";
|
|
101673
101942
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
101674
101943
|
function fileEntryPackageJsonPath(entry) {
|
|
101675
101944
|
let path6 = entry.slice("file:".length);
|
|
101676
101945
|
if (path6.startsWith("//"))
|
|
101677
101946
|
path6 = path6.slice(2);
|
|
101678
|
-
return
|
|
101947
|
+
return join64(path6, "package.json");
|
|
101679
101948
|
}
|
|
101680
101949
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
101681
|
-
if (!
|
|
101950
|
+
if (!existsSync33(pkgJsonPath))
|
|
101682
101951
|
return null;
|
|
101683
101952
|
try {
|
|
101684
|
-
const parsed = JSON.parse(
|
|
101953
|
+
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
101685
101954
|
if (parsed.exports === undefined)
|
|
101686
101955
|
return null;
|
|
101687
101956
|
if (typeof parsed.exports === "string")
|
|
@@ -101713,16 +101982,16 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
101713
101982
|
const packageName = packageNameFromServerEntry(entry);
|
|
101714
101983
|
if (packageName === null)
|
|
101715
101984
|
return null;
|
|
101716
|
-
return packageJsonExportsTui(
|
|
101985
|
+
return packageJsonExportsTui(join64(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
101717
101986
|
}
|
|
101718
101987
|
function isOurFilePluginEntry(entry) {
|
|
101719
101988
|
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
101720
101989
|
return false;
|
|
101721
101990
|
try {
|
|
101722
101991
|
const pkgJsonPath = fileEntryPackageJsonPath(entry);
|
|
101723
|
-
if (!
|
|
101992
|
+
if (!existsSync33(pkgJsonPath))
|
|
101724
101993
|
return false;
|
|
101725
|
-
const parsed = JSON.parse(
|
|
101994
|
+
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
101726
101995
|
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
|
|
101727
101996
|
} catch (error51) {
|
|
101728
101997
|
log2("[tui-plugin-config] Failed to inspect file plugin package", {
|
|
@@ -101755,12 +102024,12 @@ function isCanonicalNamedTuiPluginEntry(entry) {
|
|
|
101755
102024
|
}
|
|
101756
102025
|
function detectServerPluginRegistration() {
|
|
101757
102026
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
101758
|
-
const configPath =
|
|
102027
|
+
const configPath = existsSync33(paths2.configJsonc) ? paths2.configJsonc : existsSync33(paths2.configJson) ? paths2.configJson : null;
|
|
101759
102028
|
if (!configPath) {
|
|
101760
102029
|
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
|
|
101761
102030
|
}
|
|
101762
102031
|
try {
|
|
101763
|
-
const parsed = parseJsonc(
|
|
102032
|
+
const parsed = parseJsonc(readFileSync15(configPath, "utf-8"));
|
|
101764
102033
|
const plugins = parsed.plugin ?? [];
|
|
101765
102034
|
const serverEntry = plugins.find(isServerPluginEntry);
|
|
101766
102035
|
return {
|
|
@@ -101778,8 +102047,8 @@ function detectServerPluginRegistration() {
|
|
|
101778
102047
|
}
|
|
101779
102048
|
}
|
|
101780
102049
|
function detectTuiPluginRegistration() {
|
|
101781
|
-
const tuiJsonPath =
|
|
101782
|
-
if (!
|
|
102050
|
+
const tuiJsonPath = join64(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
102051
|
+
if (!existsSync33(tuiJsonPath)) {
|
|
101783
102052
|
return {
|
|
101784
102053
|
registered: false,
|
|
101785
102054
|
configPath: tuiJsonPath,
|
|
@@ -101790,7 +102059,7 @@ function detectTuiPluginRegistration() {
|
|
|
101790
102059
|
};
|
|
101791
102060
|
}
|
|
101792
102061
|
try {
|
|
101793
|
-
const parsed = parseJsonc(
|
|
102062
|
+
const parsed = parseJsonc(readFileSync15(tuiJsonPath, "utf-8"));
|
|
101794
102063
|
const plugins = parsed.plugin ?? [];
|
|
101795
102064
|
return {
|
|
101796
102065
|
registered: plugins.some(isTuiPluginEntry),
|
|
@@ -101923,7 +102192,7 @@ init_shared();
|
|
|
101923
102192
|
init_write_file_atomically();
|
|
101924
102193
|
function readConfig(path6) {
|
|
101925
102194
|
try {
|
|
101926
|
-
const parsed = parseJsonc(
|
|
102195
|
+
const parsed = parseJsonc(readFileSync16(path6, "utf-8"));
|
|
101927
102196
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
101928
102197
|
return parsed;
|
|
101929
102198
|
}
|
|
@@ -101934,11 +102203,11 @@ function readConfig(path6) {
|
|
|
101934
102203
|
return null;
|
|
101935
102204
|
}
|
|
101936
102205
|
function readServerConfig(configDir) {
|
|
101937
|
-
const jsoncPath =
|
|
101938
|
-
if (
|
|
102206
|
+
const jsoncPath = join65(configDir, "opencode.jsonc");
|
|
102207
|
+
if (existsSync34(jsoncPath))
|
|
101939
102208
|
return readConfig(jsoncPath);
|
|
101940
|
-
const jsonPath =
|
|
101941
|
-
if (
|
|
102209
|
+
const jsonPath = join65(configDir, "opencode.json");
|
|
102210
|
+
if (existsSync34(jsonPath))
|
|
101942
102211
|
return readConfig(jsonPath);
|
|
101943
102212
|
return null;
|
|
101944
102213
|
}
|
|
@@ -101958,7 +102227,7 @@ function desiredTuiEntry(serverEntry) {
|
|
|
101958
102227
|
return null;
|
|
101959
102228
|
}
|
|
101960
102229
|
function readTuiConfig(tuiJsonPath) {
|
|
101961
|
-
if (!
|
|
102230
|
+
if (!existsSync34(tuiJsonPath)) {
|
|
101962
102231
|
return { config: {}, malformed: false };
|
|
101963
102232
|
}
|
|
101964
102233
|
const config3 = readConfig(tuiJsonPath);
|
|
@@ -101979,7 +102248,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
101979
102248
|
if (!desiredEntry) {
|
|
101980
102249
|
return { changed: false, reason: "no-server-entry" };
|
|
101981
102250
|
}
|
|
101982
|
-
const tuiJsonPath =
|
|
102251
|
+
const tuiJsonPath = join65(configDir, "tui.json");
|
|
101983
102252
|
const { config: config3, malformed } = readTuiConfig(tuiJsonPath);
|
|
101984
102253
|
if (malformed) {
|
|
101985
102254
|
return { changed: false, reason: "malformed" };
|
|
@@ -101988,22 +102257,22 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
101988
102257
|
if (plugins.includes(desiredEntry)) {
|
|
101989
102258
|
return { changed: false, reason: "already-present" };
|
|
101990
102259
|
}
|
|
101991
|
-
|
|
102260
|
+
mkdirSync11(configDir, { recursive: true });
|
|
101992
102261
|
writeFileAtomically2(tuiJsonPath, formatConfig({ ...config3, plugin: [...plugins, desiredEntry] }));
|
|
101993
102262
|
return { changed: true, reason: "added" };
|
|
101994
102263
|
}
|
|
101995
102264
|
|
|
101996
102265
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
101997
|
-
import { homedir as
|
|
101998
|
-
import { join as
|
|
102266
|
+
import { homedir as homedir12 } from "os";
|
|
102267
|
+
import { join as join66 } from "path";
|
|
101999
102268
|
|
|
102000
102269
|
// packages/shared-skills/index.mjs
|
|
102001
|
-
import { existsSync as
|
|
102270
|
+
import { existsSync as existsSync35 } from "fs";
|
|
102002
102271
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
102003
102272
|
var SKILLS_PROBE_SPECIFIERS = ["./skills/", "../skills/", "../../skills/"];
|
|
102004
102273
|
function sharedSkillsRootPath() {
|
|
102005
102274
|
const candidates = SKILLS_PROBE_SPECIFIERS.map((specifier) => fileURLToPath2(new URL(specifier, import.meta.url)));
|
|
102006
|
-
return candidates.find((candidate2) =>
|
|
102275
|
+
return candidates.find((candidate2) => existsSync35(candidate2)) ?? candidates[0];
|
|
102007
102276
|
}
|
|
102008
102277
|
|
|
102009
102278
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
@@ -102017,9 +102286,9 @@ function describeResult2(result) {
|
|
|
102017
102286
|
}
|
|
102018
102287
|
async function installAstGrepForOpenCode(options = {}) {
|
|
102019
102288
|
const platform = options.platform ?? process.platform;
|
|
102020
|
-
const baseDir =
|
|
102289
|
+
const baseDir = join66(options.homeDir ?? homedir12(), ".omo");
|
|
102021
102290
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
102022
|
-
const skillDir =
|
|
102291
|
+
const skillDir = join66(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
102023
102292
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
102024
102293
|
try {
|
|
102025
102294
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -105822,7 +106091,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
105822
106091
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
105823
106092
|
init_bun_which_shim();
|
|
105824
106093
|
init_spawn_with_windows_hide();
|
|
105825
|
-
import { delimiter as delimiter2, dirname as
|
|
106094
|
+
import { delimiter as delimiter2, dirname as dirname25, posix as posix9, win32 as win325 } from "path";
|
|
105826
106095
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
105827
106096
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
105828
106097
|
function getCommandCandidates(platform) {
|
|
@@ -105880,7 +106149,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
105880
106149
|
return null;
|
|
105881
106150
|
}
|
|
105882
106151
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
105883
|
-
const preferredDir =
|
|
106152
|
+
const preferredDir = dirname25(binaryPath);
|
|
105884
106153
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
105885
106154
|
return [preferredDir, ...existing].join(delimiter2);
|
|
105886
106155
|
}
|
|
@@ -106049,7 +106318,7 @@ async function resolveSession(options) {
|
|
|
106049
106318
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
106050
106319
|
const delay2 = retryDelayMs * attempt;
|
|
106051
106320
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
106052
|
-
await new Promise((
|
|
106321
|
+
await new Promise((resolve21) => setTimeout(resolve21, delay2));
|
|
106053
106322
|
}
|
|
106054
106323
|
continue;
|
|
106055
106324
|
}
|
|
@@ -106060,7 +106329,7 @@ async function resolveSession(options) {
|
|
|
106060
106329
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
106061
106330
|
const delay2 = retryDelayMs * attempt;
|
|
106062
106331
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
106063
|
-
await new Promise((
|
|
106332
|
+
await new Promise((resolve21) => setTimeout(resolve21, delay2));
|
|
106064
106333
|
}
|
|
106065
106334
|
}
|
|
106066
106335
|
throw new Error("Failed to create session after all retries");
|
|
@@ -106099,7 +106368,7 @@ function createJsonOutputManager(options = {}) {
|
|
|
106099
106368
|
|
|
106100
106369
|
// packages/omo-opencode/src/cli/run/on-complete-hook.ts
|
|
106101
106370
|
init_spawn_with_windows_hide();
|
|
106102
|
-
|
|
106371
|
+
init_shell_env();
|
|
106103
106372
|
init_logger2();
|
|
106104
106373
|
var defaultDeps3 = {
|
|
106105
106374
|
spawnWithWindowsHide,
|
|
@@ -106119,15 +106388,15 @@ async function readOutput(stream, streamName, deps = defaultDeps3) {
|
|
|
106119
106388
|
return "";
|
|
106120
106389
|
}
|
|
106121
106390
|
}
|
|
106122
|
-
function resolveHookShellCommand(command) {
|
|
106123
|
-
const shellType = detectShellType();
|
|
106391
|
+
function resolveHookShellCommand(command, platform, env3) {
|
|
106392
|
+
const shellType = detectShellType(platform, env3);
|
|
106124
106393
|
switch (shellType) {
|
|
106125
106394
|
case "powershell": {
|
|
106126
|
-
const powershellExecutable =
|
|
106395
|
+
const powershellExecutable = platform === "win32" ? "powershell.exe" : "pwsh";
|
|
106127
106396
|
return [powershellExecutable, "-NoProfile", "-Command", command];
|
|
106128
106397
|
}
|
|
106129
106398
|
case "cmd":
|
|
106130
|
-
return [
|
|
106399
|
+
return [env3.ComSpec || "cmd.exe", "/d", "/s", "/c", command];
|
|
106131
106400
|
case "csh":
|
|
106132
106401
|
return ["csh", "-c", command];
|
|
106133
106402
|
case "unix":
|
|
@@ -106143,10 +106412,12 @@ async function executeOnCompleteHook(options, deps = defaultDeps3) {
|
|
|
106143
106412
|
}
|
|
106144
106413
|
deps.log("Running on-complete hook", { command: trimmedCommand });
|
|
106145
106414
|
try {
|
|
106146
|
-
const
|
|
106415
|
+
const platform = deps.platform ?? process.platform;
|
|
106416
|
+
const env3 = deps.env ?? process.env;
|
|
106417
|
+
const shellCommand = resolveHookShellCommand(trimmedCommand, platform, env3);
|
|
106147
106418
|
const proc = deps.spawnWithWindowsHide(shellCommand, {
|
|
106148
106419
|
env: {
|
|
106149
|
-
...
|
|
106420
|
+
...env3,
|
|
106150
106421
|
SESSION_ID: sessionId,
|
|
106151
106422
|
EXIT_CODE: String(exitCode),
|
|
106152
106423
|
DURATION_MS: String(durationMs),
|
|
@@ -106458,26 +106729,26 @@ function isClosingFence(line, fence) {
|
|
|
106458
106729
|
return run?.charAt(0) === fence.marker && run.length >= fence.length;
|
|
106459
106730
|
}
|
|
106460
106731
|
// packages/boulder-state/src/top-level-task.ts
|
|
106461
|
-
import { existsSync as
|
|
106732
|
+
import { existsSync as existsSync36, readFileSync as readFileSync17 } from "fs";
|
|
106462
106733
|
function readCurrentTopLevelTask(planPath) {
|
|
106463
|
-
if (!
|
|
106734
|
+
if (!existsSync36(planPath)) {
|
|
106464
106735
|
return null;
|
|
106465
106736
|
}
|
|
106466
106737
|
try {
|
|
106467
|
-
const content =
|
|
106738
|
+
const content = readFileSync17(planPath, "utf-8");
|
|
106468
106739
|
return parseCurrentTopLevelTask(content);
|
|
106469
106740
|
} catch {
|
|
106470
106741
|
return null;
|
|
106471
106742
|
}
|
|
106472
106743
|
}
|
|
106473
106744
|
// packages/boulder-state/src/storage/path.ts
|
|
106474
|
-
import { existsSync as
|
|
106475
|
-
import { isAbsolute as isAbsolute11, join as
|
|
106745
|
+
import { existsSync as existsSync37 } from "fs";
|
|
106746
|
+
import { isAbsolute as isAbsolute11, join as join67, relative as relative8, resolve as resolve21 } from "path";
|
|
106476
106747
|
function getBoulderFilePath(directory) {
|
|
106477
|
-
return
|
|
106748
|
+
return join67(directory, BOULDER_DIR, BOULDER_FILE);
|
|
106478
106749
|
}
|
|
106479
106750
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
106480
|
-
return isAbsolute11(trackedPath) ?
|
|
106751
|
+
return isAbsolute11(trackedPath) ? resolve21(trackedPath) : resolve21(baseDirectory, trackedPath);
|
|
106481
106752
|
}
|
|
106482
106753
|
function resolveBoulderPlanPath(directory, state) {
|
|
106483
106754
|
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
|
|
@@ -106485,26 +106756,26 @@ function resolveBoulderPlanPath(directory, state) {
|
|
|
106485
106756
|
if (!worktreePath) {
|
|
106486
106757
|
return absolutePlanPath;
|
|
106487
106758
|
}
|
|
106488
|
-
const absoluteDirectory =
|
|
106759
|
+
const absoluteDirectory = resolve21(directory);
|
|
106489
106760
|
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
|
|
106490
106761
|
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
|
|
106491
106762
|
return absolutePlanPath;
|
|
106492
106763
|
}
|
|
106493
106764
|
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
|
|
106494
|
-
const worktreePlanPath =
|
|
106495
|
-
return
|
|
106765
|
+
const worktreePlanPath = resolve21(absoluteWorktreePath, relativePlanPath);
|
|
106766
|
+
return existsSync37(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
|
|
106496
106767
|
}
|
|
106497
106768
|
function resolveBoulderPlanPathForWork(directory, work) {
|
|
106498
106769
|
return resolveBoulderPlanPath(directory, work);
|
|
106499
106770
|
}
|
|
106500
106771
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
106501
|
-
import { existsSync as
|
|
106772
|
+
import { existsSync as existsSync38, readFileSync as readFileSync18, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
106502
106773
|
function getPlanProgress(planPath) {
|
|
106503
|
-
if (!
|
|
106774
|
+
if (!existsSync38(planPath)) {
|
|
106504
106775
|
return { total: 0, completed: 0, isComplete: false };
|
|
106505
106776
|
}
|
|
106506
106777
|
try {
|
|
106507
|
-
const content =
|
|
106778
|
+
const content = readFileSync18(planPath, "utf-8");
|
|
106508
106779
|
const checklist = parsePlanChecklist(content);
|
|
106509
106780
|
return {
|
|
106510
106781
|
total: checklist.total,
|
|
@@ -106583,14 +106854,14 @@ function selectMirrorWork(state) {
|
|
|
106583
106854
|
return sorted[0] ?? null;
|
|
106584
106855
|
}
|
|
106585
106856
|
// packages/boulder-state/src/storage/read-state.ts
|
|
106586
|
-
import { existsSync as
|
|
106857
|
+
import { existsSync as existsSync39, readFileSync as readFileSync19 } from "fs";
|
|
106587
106858
|
function readBoulderState(directory) {
|
|
106588
106859
|
const filePath = getBoulderFilePath(directory);
|
|
106589
|
-
if (!
|
|
106860
|
+
if (!existsSync39(filePath)) {
|
|
106590
106861
|
return null;
|
|
106591
106862
|
}
|
|
106592
106863
|
try {
|
|
106593
|
-
const content =
|
|
106864
|
+
const content = readFileSync19(filePath, "utf-8");
|
|
106594
106865
|
const parsed = JSON.parse(content);
|
|
106595
106866
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed) || Object.keys(parsed).length === 0) {
|
|
106596
106867
|
return null;
|
|
@@ -106656,17 +106927,17 @@ init_state();
|
|
|
106656
106927
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
106657
106928
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
106658
106929
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
106659
|
-
import { existsSync as
|
|
106660
|
-
import { join as
|
|
106930
|
+
import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
106931
|
+
import { join as join68 } from "path";
|
|
106661
106932
|
function getMarkerPath(directory, sessionID) {
|
|
106662
|
-
return
|
|
106933
|
+
return join68(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
106663
106934
|
}
|
|
106664
106935
|
function readContinuationMarker(directory, sessionID) {
|
|
106665
106936
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
106666
|
-
if (!
|
|
106937
|
+
if (!existsSync40(markerPath))
|
|
106667
106938
|
return null;
|
|
106668
106939
|
try {
|
|
106669
|
-
const raw =
|
|
106940
|
+
const raw = readFileSync20(markerPath, "utf-8");
|
|
106670
106941
|
const parsed = JSON.parse(raw);
|
|
106671
106942
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
106672
106943
|
return null;
|
|
@@ -106731,8 +107002,8 @@ async function isSessionInBoulderLineage(input) {
|
|
|
106731
107002
|
// packages/omo-opencode/src/hooks/atlas/session-last-agent.ts
|
|
106732
107003
|
init_shared();
|
|
106733
107004
|
init_compaction_marker();
|
|
106734
|
-
import { readFileSync as
|
|
106735
|
-
import { join as
|
|
107005
|
+
import { readFileSync as readFileSync21, readdirSync as readdirSync8 } from "fs";
|
|
107006
|
+
import { join as join69 } from "path";
|
|
106736
107007
|
var defaultSessionLastAgentDeps = {
|
|
106737
107008
|
getMessageDir,
|
|
106738
107009
|
isSqliteBackend,
|
|
@@ -106792,7 +107063,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
106792
107063
|
try {
|
|
106793
107064
|
const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
106794
107065
|
try {
|
|
106795
|
-
const content =
|
|
107066
|
+
const content = readFileSync21(join69(messageDir, fileName), "utf-8");
|
|
106796
107067
|
const parsed = JSON.parse(content);
|
|
106797
107068
|
return {
|
|
106798
107069
|
fileName,
|
|
@@ -106835,8 +107106,8 @@ init_agent_display_names();
|
|
|
106835
107106
|
|
|
106836
107107
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
106837
107108
|
init_frontmatter2();
|
|
106838
|
-
import { existsSync as
|
|
106839
|
-
import { dirname as
|
|
107109
|
+
import { existsSync as existsSync41, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
|
|
107110
|
+
import { dirname as dirname26, join as join70 } from "path";
|
|
106840
107111
|
|
|
106841
107112
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
106842
107113
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -106845,15 +107116,15 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
106845
107116
|
|
|
106846
107117
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
106847
107118
|
function getStateFilePath(directory, customPath) {
|
|
106848
|
-
return customPath ?
|
|
107119
|
+
return customPath ? join70(directory, customPath) : join70(directory, DEFAULT_STATE_FILE);
|
|
106849
107120
|
}
|
|
106850
107121
|
function readState(directory, customPath) {
|
|
106851
107122
|
const filePath = getStateFilePath(directory, customPath);
|
|
106852
|
-
if (!
|
|
107123
|
+
if (!existsSync41(filePath)) {
|
|
106853
107124
|
return null;
|
|
106854
107125
|
}
|
|
106855
107126
|
try {
|
|
106856
|
-
const content =
|
|
107127
|
+
const content = readFileSync22(filePath, "utf-8");
|
|
106857
107128
|
const { data, body } = parseFrontmatter(content);
|
|
106858
107129
|
const active = data.active;
|
|
106859
107130
|
const iteration = data.iteration;
|
|
@@ -107079,7 +107350,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
|
|
|
107079
107350
|
const secondaryMeaningfulWorkTimeoutMs = options.secondaryMeaningfulWorkTimeoutMs ?? DEFAULT_SECONDARY_MEANINGFUL_WORK_TIMEOUT_MS;
|
|
107080
107351
|
const requireMeaningfulWork = options.requireMeaningfulWork ?? false;
|
|
107081
107352
|
const now = options.now ?? Date.now;
|
|
107082
|
-
const sleep = options.sleep ?? ((ms) => new Promise((
|
|
107353
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve22) => setTimeout(resolve22, ms)));
|
|
107083
107354
|
let consecutiveCompleteChecks = 0;
|
|
107084
107355
|
let errorCycleCount = 0;
|
|
107085
107356
|
let firstWorkTimestamp = null;
|
|
@@ -107244,7 +107515,7 @@ function createAbortError() {
|
|
|
107244
107515
|
return error51;
|
|
107245
107516
|
}
|
|
107246
107517
|
function sleep(delayMs) {
|
|
107247
|
-
return new Promise((
|
|
107518
|
+
return new Promise((resolve22) => setTimeout(resolve22, delayMs));
|
|
107248
107519
|
}
|
|
107249
107520
|
function hasPromptStartEvidence(eventState) {
|
|
107250
107521
|
return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
|
|
@@ -107619,7 +107890,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
|
|
|
107619
107890
|
async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
|
|
107620
107891
|
const completed = await Promise.race([
|
|
107621
107892
|
eventProcessor.then(() => true),
|
|
107622
|
-
new Promise((
|
|
107893
|
+
new Promise((resolve22) => setTimeout(() => resolve22(false), timeoutMs))
|
|
107623
107894
|
]);
|
|
107624
107895
|
}
|
|
107625
107896
|
async function run(options) {
|
|
@@ -107682,10 +107953,10 @@ Interrupted. Shutting down...`));
|
|
|
107682
107953
|
abortController,
|
|
107683
107954
|
verbose: options.verbose ?? false
|
|
107684
107955
|
};
|
|
107685
|
-
const
|
|
107956
|
+
const events2 = await client3.event.subscribe({ query: { directory } });
|
|
107686
107957
|
const eventState = createEventState();
|
|
107687
107958
|
eventState.agentColorsByName = await loadAgentProfileColors(client3);
|
|
107688
|
-
const eventProcessor = processEvents(ctx,
|
|
107959
|
+
const eventProcessor = processEvents(ctx, events2.stream, eventState).catch(() => {});
|
|
107689
107960
|
const promptResult = await dispatchInternalPrompt({
|
|
107690
107961
|
mode: "async",
|
|
107691
107962
|
client: client3,
|
|
@@ -107945,14 +108216,14 @@ async function getLocalVersion(options = {}) {
|
|
|
107945
108216
|
}
|
|
107946
108217
|
}
|
|
107947
108218
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
107948
|
-
import { existsSync as
|
|
108219
|
+
import { existsSync as existsSync52, readFileSync as readFileSync32 } from "fs";
|
|
107949
108220
|
|
|
107950
108221
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
107951
108222
|
init_extract_semver();
|
|
107952
108223
|
init_bun_which_shim();
|
|
107953
|
-
import { existsSync as
|
|
107954
|
-
import { homedir as
|
|
107955
|
-
import { join as
|
|
108224
|
+
import { existsSync as existsSync49, accessSync as accessSync4, constants as constants11 } from "fs";
|
|
108225
|
+
import { homedir as homedir15 } from "os";
|
|
108226
|
+
import { join as join77 } from "path";
|
|
107956
108227
|
|
|
107957
108228
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
107958
108229
|
init_spawn_with_windows_hide();
|
|
@@ -107991,8 +108262,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
107991
108262
|
const stdoutPromise = readSpawnStream(proc.stdout);
|
|
107992
108263
|
const stderrPromise = readSpawnStream(proc.stderr);
|
|
107993
108264
|
let timer;
|
|
107994
|
-
const timeoutPromise = new Promise((
|
|
107995
|
-
timer = setTimeout(() =>
|
|
108265
|
+
const timeoutPromise = new Promise((resolve22) => {
|
|
108266
|
+
timer = setTimeout(() => resolve22("timeout"), timeoutMs);
|
|
107996
108267
|
});
|
|
107997
108268
|
const processPromise = (async () => {
|
|
107998
108269
|
await proc.exited;
|
|
@@ -108039,22 +108310,22 @@ function isExecutable2(path12) {
|
|
|
108039
108310
|
}
|
|
108040
108311
|
}
|
|
108041
108312
|
function getDesktopAppPaths(platform) {
|
|
108042
|
-
const home =
|
|
108313
|
+
const home = homedir15();
|
|
108043
108314
|
switch (platform) {
|
|
108044
108315
|
case "darwin":
|
|
108045
108316
|
return [
|
|
108046
108317
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
108047
|
-
|
|
108318
|
+
join77(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
108048
108319
|
];
|
|
108049
108320
|
case "win32": {
|
|
108050
108321
|
const programFiles = process.env.ProgramFiles;
|
|
108051
108322
|
const localAppData = process.env.LOCALAPPDATA;
|
|
108052
108323
|
const paths2 = [];
|
|
108053
108324
|
if (programFiles) {
|
|
108054
|
-
paths2.push(
|
|
108325
|
+
paths2.push(join77(programFiles, "OpenCode", "OpenCode.exe"));
|
|
108055
108326
|
}
|
|
108056
108327
|
if (localAppData) {
|
|
108057
|
-
paths2.push(
|
|
108328
|
+
paths2.push(join77(localAppData, "OpenCode", "OpenCode.exe"));
|
|
108058
108329
|
}
|
|
108059
108330
|
return paths2;
|
|
108060
108331
|
}
|
|
@@ -108062,8 +108333,8 @@ function getDesktopAppPaths(platform) {
|
|
|
108062
108333
|
return [
|
|
108063
108334
|
"/usr/bin/opencode",
|
|
108064
108335
|
"/usr/lib/opencode/opencode",
|
|
108065
|
-
|
|
108066
|
-
|
|
108336
|
+
join77(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
108337
|
+
join77(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
108067
108338
|
];
|
|
108068
108339
|
default:
|
|
108069
108340
|
return [];
|
|
@@ -108075,7 +108346,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
108075
108346
|
}
|
|
108076
108347
|
return [binaryPath, "--version"];
|
|
108077
108348
|
}
|
|
108078
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
108349
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync49) {
|
|
108079
108350
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
108080
108351
|
if (checkExists(desktopPath)) {
|
|
108081
108352
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -108083,7 +108354,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
108083
108354
|
}
|
|
108084
108355
|
return null;
|
|
108085
108356
|
}
|
|
108086
|
-
async function findOpenCodeBinary(platform = process.platform, checkExists =
|
|
108357
|
+
async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync49) {
|
|
108087
108358
|
for (const binary of OPENCODE_BINARIES2) {
|
|
108088
108359
|
const path12 = bunWhich(binary);
|
|
108089
108360
|
if (path12 && checkExists(path12)) {
|
|
@@ -108095,7 +108366,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
108095
108366
|
const candidates = getCommandCandidates2(platform);
|
|
108096
108367
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
108097
108368
|
for (const command of candidates) {
|
|
108098
|
-
const fullPath =
|
|
108369
|
+
const fullPath = join77(entry, command);
|
|
108099
108370
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
108100
108371
|
return { binary: command, path: fullPath };
|
|
108101
108372
|
}
|
|
@@ -108141,12 +108412,12 @@ function compareVersions3(current, minimum) {
|
|
|
108141
108412
|
|
|
108142
108413
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
108143
108414
|
init_shared();
|
|
108144
|
-
import { existsSync as
|
|
108415
|
+
import { existsSync as existsSync50, readFileSync as readFileSync30 } from "fs";
|
|
108145
108416
|
function detectConfigPath() {
|
|
108146
108417
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
108147
|
-
if (
|
|
108418
|
+
if (existsSync50(paths2.configJsonc))
|
|
108148
108419
|
return paths2.configJsonc;
|
|
108149
|
-
if (
|
|
108420
|
+
if (existsSync50(paths2.configJson))
|
|
108150
108421
|
return paths2.configJson;
|
|
108151
108422
|
return null;
|
|
108152
108423
|
}
|
|
@@ -108192,7 +108463,7 @@ function getPluginInfo() {
|
|
|
108192
108463
|
};
|
|
108193
108464
|
}
|
|
108194
108465
|
try {
|
|
108195
|
-
const content =
|
|
108466
|
+
const content = readFileSync30(configPath, "utf-8");
|
|
108196
108467
|
const parsedConfig = parseJsonc(content);
|
|
108197
108468
|
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
|
|
108198
108469
|
if (!pluginEntry) {
|
|
@@ -108234,39 +108505,39 @@ init_file_utils2();
|
|
|
108234
108505
|
init_checker();
|
|
108235
108506
|
init_auto_update_checker();
|
|
108236
108507
|
init_package_json_locator();
|
|
108237
|
-
import { existsSync as
|
|
108508
|
+
import { existsSync as existsSync51, readFileSync as readFileSync31, readdirSync as readdirSync10 } from "fs";
|
|
108238
108509
|
import { createRequire as createRequire2 } from "module";
|
|
108239
|
-
import { homedir as
|
|
108240
|
-
import { join as
|
|
108510
|
+
import { homedir as homedir16 } from "os";
|
|
108511
|
+
import { join as join78 } from "path";
|
|
108241
108512
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
108242
108513
|
init_shared();
|
|
108243
108514
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
108244
108515
|
if (platform === "darwin")
|
|
108245
|
-
return
|
|
108516
|
+
return join78(homedir16(), "Library", "Caches");
|
|
108246
108517
|
if (platform === "win32")
|
|
108247
|
-
return process.env.LOCALAPPDATA ??
|
|
108248
|
-
return
|
|
108518
|
+
return process.env.LOCALAPPDATA ?? join78(homedir16(), "AppData", "Local");
|
|
108519
|
+
return join78(homedir16(), ".cache");
|
|
108249
108520
|
}
|
|
108250
108521
|
function resolveOpenCodeCacheDir() {
|
|
108251
108522
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
108252
108523
|
if (xdgCacheHome)
|
|
108253
|
-
return
|
|
108524
|
+
return join78(xdgCacheHome, "opencode");
|
|
108254
108525
|
const fromShared = getOpenCodeCacheDir();
|
|
108255
|
-
const platformDefault =
|
|
108256
|
-
if (
|
|
108526
|
+
const platformDefault = join78(getPlatformDefaultCacheDir(), "opencode");
|
|
108527
|
+
if (existsSync51(fromShared) || !existsSync51(platformDefault))
|
|
108257
108528
|
return fromShared;
|
|
108258
108529
|
return platformDefault;
|
|
108259
108530
|
}
|
|
108260
108531
|
function resolveExistingDir(dirPath) {
|
|
108261
|
-
if (!
|
|
108532
|
+
if (!existsSync51(dirPath))
|
|
108262
108533
|
return dirPath;
|
|
108263
108534
|
return resolveSymlink(dirPath);
|
|
108264
108535
|
}
|
|
108265
108536
|
function readPackageJson(filePath) {
|
|
108266
|
-
if (!
|
|
108537
|
+
if (!existsSync51(filePath))
|
|
108267
108538
|
return null;
|
|
108268
108539
|
try {
|
|
108269
|
-
const content =
|
|
108540
|
+
const content = readFileSync31(filePath, "utf-8");
|
|
108270
108541
|
return parseJsonc(content);
|
|
108271
108542
|
} catch (error51) {
|
|
108272
108543
|
if (!(error51 instanceof Error)) {
|
|
@@ -108284,26 +108555,26 @@ function normalizeVersion(value) {
|
|
|
108284
108555
|
function createPackageCandidates(rootDir) {
|
|
108285
108556
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
108286
108557
|
packageName,
|
|
108287
|
-
installedPackagePath:
|
|
108558
|
+
installedPackagePath: join78(rootDir, "node_modules", packageName, "package.json")
|
|
108288
108559
|
}));
|
|
108289
108560
|
}
|
|
108290
108561
|
function createTaggedInstallCandidates(rootDir) {
|
|
108291
|
-
const packagesDir =
|
|
108292
|
-
if (!
|
|
108562
|
+
const packagesDir = join78(rootDir, "packages");
|
|
108563
|
+
if (!existsSync51(packagesDir))
|
|
108293
108564
|
return [];
|
|
108294
108565
|
const candidates = [];
|
|
108295
108566
|
for (const entryName of readdirSync10(packagesDir).sort()) {
|
|
108296
108567
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
108297
108568
|
if (packageName === undefined)
|
|
108298
108569
|
continue;
|
|
108299
|
-
const installDir =
|
|
108570
|
+
const installDir = join78(packagesDir, entryName);
|
|
108300
108571
|
candidates.push({
|
|
108301
108572
|
cacheDir: installDir,
|
|
108302
|
-
cachePackagePath:
|
|
108573
|
+
cachePackagePath: join78(installDir, "package.json"),
|
|
108303
108574
|
packageCandidates: [
|
|
108304
108575
|
{
|
|
108305
108576
|
packageName,
|
|
108306
|
-
installedPackagePath:
|
|
108577
|
+
installedPackagePath: join78(installDir, "node_modules", packageName, "package.json")
|
|
108307
108578
|
}
|
|
108308
108579
|
]
|
|
108309
108580
|
});
|
|
@@ -108311,7 +108582,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
108311
108582
|
return candidates;
|
|
108312
108583
|
}
|
|
108313
108584
|
function selectInstalledPackage(candidate2) {
|
|
108314
|
-
return candidate2.packageCandidates.find((packageCandidate) =>
|
|
108585
|
+
return candidate2.packageCandidates.find((packageCandidate) => existsSync51(packageCandidate.installedPackagePath)) ?? candidate2.packageCandidates[0];
|
|
108315
108586
|
}
|
|
108316
108587
|
function getExpectedVersion(cachePackage, packageName) {
|
|
108317
108588
|
return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
|
|
@@ -108322,7 +108593,7 @@ function resolveInstalledPackageJsonPath() {
|
|
|
108322
108593
|
for (const packageName of ACCEPTED_PACKAGE_NAMES) {
|
|
108323
108594
|
try {
|
|
108324
108595
|
const packageJsonPath = require2.resolve(`${packageName}/package.json`);
|
|
108325
|
-
if (
|
|
108596
|
+
if (existsSync51(packageJsonPath)) {
|
|
108326
108597
|
return { packageName, packageJsonPath };
|
|
108327
108598
|
}
|
|
108328
108599
|
} catch {
|
|
@@ -108348,22 +108619,22 @@ function getLoadedPluginVersion() {
|
|
|
108348
108619
|
const candidates = [
|
|
108349
108620
|
{
|
|
108350
108621
|
cacheDir: configDir,
|
|
108351
|
-
cachePackagePath:
|
|
108622
|
+
cachePackagePath: join78(configDir, "package.json"),
|
|
108352
108623
|
packageCandidates: createPackageCandidates(configDir)
|
|
108353
108624
|
},
|
|
108354
108625
|
...createTaggedInstallCandidates(configDir),
|
|
108355
108626
|
{
|
|
108356
108627
|
cacheDir,
|
|
108357
|
-
cachePackagePath:
|
|
108628
|
+
cachePackagePath: join78(cacheDir, "package.json"),
|
|
108358
108629
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
108359
108630
|
},
|
|
108360
108631
|
...createTaggedInstallCandidates(cacheDir)
|
|
108361
108632
|
];
|
|
108362
|
-
const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) =>
|
|
108633
|
+
const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) => existsSync51(packageCandidate.installedPackagePath))) ?? candidates[0];
|
|
108363
108634
|
const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
|
|
108364
108635
|
const selectedPackage = selectInstalledPackage(selectedCandidate);
|
|
108365
108636
|
const candidateInstalledPath = selectedPackage.installedPackagePath;
|
|
108366
|
-
const candidateExists =
|
|
108637
|
+
const candidateExists = existsSync51(candidateInstalledPath);
|
|
108367
108638
|
const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
|
|
108368
108639
|
const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
|
|
108369
108640
|
const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
|
|
@@ -108399,8 +108670,8 @@ var defaultDeps6 = {
|
|
|
108399
108670
|
getLoadedPluginVersion,
|
|
108400
108671
|
getLatestPluginVersion,
|
|
108401
108672
|
getSuggestedInstallTag,
|
|
108402
|
-
configExists:
|
|
108403
|
-
readConfigFile: (path12) =>
|
|
108673
|
+
configExists: existsSync52,
|
|
108674
|
+
readConfigFile: (path12) => readFileSync32(path12, "utf-8"),
|
|
108404
108675
|
parseConfigContent: (content) => parseJsonc(content)
|
|
108405
108676
|
};
|
|
108406
108677
|
var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
|
|
@@ -108545,26 +108816,26 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
108545
108816
|
|
|
108546
108817
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
108547
108818
|
init_shared();
|
|
108548
|
-
import { existsSync as
|
|
108549
|
-
import { homedir as
|
|
108550
|
-
import { join as
|
|
108819
|
+
import { existsSync as existsSync53, readFileSync as readFileSync33 } from "fs";
|
|
108820
|
+
import { homedir as homedir17 } from "os";
|
|
108821
|
+
import { join as join79 } from "path";
|
|
108551
108822
|
function getUserConfigDir2() {
|
|
108552
108823
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
108553
108824
|
if (xdgConfig)
|
|
108554
|
-
return
|
|
108555
|
-
return
|
|
108825
|
+
return join79(xdgConfig, "opencode");
|
|
108826
|
+
return join79(homedir17(), ".config", "opencode");
|
|
108556
108827
|
}
|
|
108557
108828
|
function loadCustomProviderNames() {
|
|
108558
108829
|
const configDir = getUserConfigDir2();
|
|
108559
108830
|
const candidatePaths = [
|
|
108560
|
-
|
|
108561
|
-
|
|
108831
|
+
join79(configDir, "opencode.json"),
|
|
108832
|
+
join79(configDir, "opencode.jsonc")
|
|
108562
108833
|
];
|
|
108563
108834
|
for (const configPath of candidatePaths) {
|
|
108564
|
-
if (!
|
|
108835
|
+
if (!existsSync53(configPath))
|
|
108565
108836
|
continue;
|
|
108566
108837
|
try {
|
|
108567
|
-
const content =
|
|
108838
|
+
const content = readFileSync33(configPath, "utf-8");
|
|
108568
108839
|
const data = parseJsonc(content);
|
|
108569
108840
|
if (data?.provider && typeof data.provider === "object") {
|
|
108570
108841
|
return Object.keys(data.provider);
|
|
@@ -108579,16 +108850,16 @@ function loadCustomProviderNames() {
|
|
|
108579
108850
|
return [];
|
|
108580
108851
|
}
|
|
108581
108852
|
function loadAvailableModelsFromCache() {
|
|
108582
|
-
const cacheFile =
|
|
108853
|
+
const cacheFile = join79(getOpenCodeCacheDir(), "models.json");
|
|
108583
108854
|
const customProviders = loadCustomProviderNames();
|
|
108584
|
-
if (!
|
|
108855
|
+
if (!existsSync53(cacheFile)) {
|
|
108585
108856
|
if (customProviders.length > 0) {
|
|
108586
108857
|
return { providers: customProviders, modelCount: 0, cacheExists: true };
|
|
108587
108858
|
}
|
|
108588
108859
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
108589
108860
|
}
|
|
108590
108861
|
try {
|
|
108591
|
-
const content =
|
|
108862
|
+
const content = readFileSync33(cacheFile, "utf-8");
|
|
108592
108863
|
const data = parseJsonc(content);
|
|
108593
108864
|
const cacheProviders = Object.keys(data);
|
|
108594
108865
|
let modelCount = 0;
|
|
@@ -108641,7 +108912,7 @@ function loadOmoConfig2() {
|
|
|
108641
108912
|
|
|
108642
108913
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
108643
108914
|
init_shared();
|
|
108644
|
-
import { join as
|
|
108915
|
+
import { join as join80 } from "path";
|
|
108645
108916
|
|
|
108646
108917
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
108647
108918
|
function formatModelWithVariant(model, variant) {
|
|
@@ -108683,7 +108954,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
108683
108954
|
}
|
|
108684
108955
|
function buildModelResolutionDetails(options) {
|
|
108685
108956
|
const details = [];
|
|
108686
|
-
const cacheFile =
|
|
108957
|
+
const cacheFile = join80(getOpenCodeCacheDir(), "models.json");
|
|
108687
108958
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
108688
108959
|
details.push("");
|
|
108689
108960
|
if (options.available.cacheExists) {
|
|
@@ -108992,8 +109263,8 @@ async function checkConfig() {
|
|
|
108992
109263
|
|
|
108993
109264
|
// packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
|
|
108994
109265
|
init_main();
|
|
108995
|
-
import { existsSync as
|
|
108996
|
-
import { join as
|
|
109266
|
+
import { existsSync as existsSync54, readFileSync as readFileSync34 } from "fs";
|
|
109267
|
+
import { join as join81 } from "path";
|
|
108997
109268
|
var CANONICAL_REPLACEMENT = new Map([
|
|
108998
109269
|
["variant", "reasoning"],
|
|
108999
109270
|
["reasoningEffort", "reasoning"],
|
|
@@ -109048,16 +109319,16 @@ function userConfigPaths() {
|
|
|
109048
109319
|
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
109049
109320
|
if (home === undefined || home.length === 0)
|
|
109050
109321
|
return [];
|
|
109051
|
-
return [
|
|
109322
|
+
return [join81(home, ".omo", "omo.jsonc"), join81(home, ".omo", "omo.json")];
|
|
109052
109323
|
}
|
|
109053
109324
|
async function checkDeprecatedReasoningKeys() {
|
|
109054
109325
|
const issues = [];
|
|
109055
109326
|
const scanned = [];
|
|
109056
109327
|
for (const configPath of userConfigPaths()) {
|
|
109057
|
-
if (!
|
|
109328
|
+
if (!existsSync54(configPath))
|
|
109058
109329
|
continue;
|
|
109059
109330
|
scanned.push(configPath);
|
|
109060
|
-
const parsed = parse2(
|
|
109331
|
+
const parsed = parse2(readFileSync34(configPath, "utf-8"));
|
|
109061
109332
|
issues.push(...collectIssues(configPath, parsed, ""));
|
|
109062
109333
|
}
|
|
109063
109334
|
return {
|
|
@@ -109071,28 +109342,28 @@ async function checkDeprecatedReasoningKeys() {
|
|
|
109071
109342
|
|
|
109072
109343
|
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
109073
109344
|
init_src2();
|
|
109074
|
-
import { existsSync as
|
|
109345
|
+
import { existsSync as existsSync55 } from "fs";
|
|
109075
109346
|
import { createRequire as createRequire3 } from "module";
|
|
109076
|
-
import { homedir as
|
|
109077
|
-
import { dirname as
|
|
109347
|
+
import { homedir as homedir19 } from "os";
|
|
109348
|
+
import { dirname as dirname31, join as join83 } from "path";
|
|
109078
109349
|
|
|
109079
109350
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
109080
|
-
import { join as
|
|
109081
|
-
import { homedir as
|
|
109351
|
+
import { join as join82 } from "path";
|
|
109352
|
+
import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
|
|
109082
109353
|
init_binary_downloader();
|
|
109083
109354
|
init_logger2();
|
|
109084
109355
|
init_plugin_identity();
|
|
109085
109356
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
109086
|
-
var DEBUG_FILE =
|
|
109357
|
+
var DEBUG_FILE = join82(tmpdir4(), "comment-checker-debug.log");
|
|
109087
109358
|
function getCacheDir2() {
|
|
109088
109359
|
if (process.platform === "win32") {
|
|
109089
109360
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
109090
|
-
const base2 = localAppData ||
|
|
109091
|
-
return
|
|
109361
|
+
const base2 = localAppData || join82(homedir18(), "AppData", "Local");
|
|
109362
|
+
return join82(base2, CACHE_DIR_NAME, "bin");
|
|
109092
109363
|
}
|
|
109093
109364
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
109094
|
-
const base = xdgCache ||
|
|
109095
|
-
return
|
|
109365
|
+
const base = xdgCache || join82(homedir18(), ".cache");
|
|
109366
|
+
return join82(base, CACHE_DIR_NAME, "bin");
|
|
109096
109367
|
}
|
|
109097
109368
|
function getBinaryName() {
|
|
109098
109369
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -109142,7 +109413,7 @@ async function getBinaryVersion(binary) {
|
|
|
109142
109413
|
}
|
|
109143
109414
|
}
|
|
109144
109415
|
async function checkAstGrepCli() {
|
|
109145
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
109416
|
+
const runtimeDir = astGrepRuntimeDir(join83(homedir19(), ".omo"));
|
|
109146
109417
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
109147
109418
|
if (sgPath === null) {
|
|
109148
109419
|
return {
|
|
@@ -109171,12 +109442,12 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
109171
109442
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
109172
109443
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
109173
109444
|
try {
|
|
109174
|
-
const packageDir = baseDirOverride ??
|
|
109175
|
-
const vendorPath =
|
|
109176
|
-
if (
|
|
109445
|
+
const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
|
|
109446
|
+
const vendorPath = join83(packageDir, "vendor", platformKey, binaryName);
|
|
109447
|
+
if (existsSync55(vendorPath))
|
|
109177
109448
|
return vendorPath;
|
|
109178
|
-
const binPath =
|
|
109179
|
-
if (
|
|
109449
|
+
const binPath = join83(packageDir, "bin", binaryName);
|
|
109450
|
+
if (existsSync55(binPath))
|
|
109180
109451
|
return binPath;
|
|
109181
109452
|
} catch (error51) {
|
|
109182
109453
|
if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
|
|
@@ -109322,8 +109593,8 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
109322
109593
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
109323
109594
|
init_zod();
|
|
109324
109595
|
init_opencode_config_dir();
|
|
109325
|
-
import { existsSync as
|
|
109326
|
-
import { delimiter as delimiter3, dirname as
|
|
109596
|
+
import { existsSync as existsSync56, readFileSync as readFileSync35 } from "fs";
|
|
109597
|
+
import { delimiter as delimiter3, dirname as dirname32, resolve as resolve23 } from "path";
|
|
109327
109598
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
109328
109599
|
|
|
109329
109600
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -109370,7 +109641,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
|
|
|
109370
109641
|
}
|
|
109371
109642
|
|
|
109372
109643
|
// packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
|
|
109373
|
-
import { resolve as
|
|
109644
|
+
import { resolve as resolve22 } from "path";
|
|
109374
109645
|
function resolveJavaScriptRuntime(resolveExecutable) {
|
|
109375
109646
|
const node = resolveExecutable("node");
|
|
109376
109647
|
return node.available ? node : resolveExecutable("bun");
|
|
@@ -109378,9 +109649,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
|
|
|
109378
109649
|
function createAncestorCliCandidates(options) {
|
|
109379
109650
|
const candidates = [];
|
|
109380
109651
|
const seenPaths = new Set;
|
|
109381
|
-
let currentDirectory =
|
|
109652
|
+
let currentDirectory = resolve22(options.startDirectory);
|
|
109382
109653
|
while (true) {
|
|
109383
|
-
const distCliPath =
|
|
109654
|
+
const distCliPath = resolve22(currentDirectory, options.packageRel, options.distCliRel);
|
|
109384
109655
|
if (!seenPaths.has(distCliPath)) {
|
|
109385
109656
|
const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
|
|
109386
109657
|
seenPaths.add(distCliPath);
|
|
@@ -109392,7 +109663,7 @@ function createAncestorCliCandidates(options) {
|
|
|
109392
109663
|
runtimeAvailable: runtime5.available
|
|
109393
109664
|
});
|
|
109394
109665
|
}
|
|
109395
|
-
const sourceCliPath =
|
|
109666
|
+
const sourceCliPath = resolve22(currentDirectory, options.packageRel, options.sourceCliRel);
|
|
109396
109667
|
if (!seenPaths.has(sourceCliPath)) {
|
|
109397
109668
|
const runtime5 = options.resolveExecutable("bun");
|
|
109398
109669
|
const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
|
|
@@ -109409,7 +109680,7 @@ function createAncestorCliCandidates(options) {
|
|
|
109409
109680
|
runtimeAvailable: runtime5.available
|
|
109410
109681
|
});
|
|
109411
109682
|
}
|
|
109412
|
-
const parentDirectory =
|
|
109683
|
+
const parentDirectory = resolve22(currentDirectory, "..");
|
|
109413
109684
|
if (parentDirectory === currentDirectory)
|
|
109414
109685
|
return candidates;
|
|
109415
109686
|
currentDirectory = parentDirectory;
|
|
@@ -109454,7 +109725,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
109454
109725
|
].join(";");
|
|
109455
109726
|
function getModuleDirectory(moduleUrl) {
|
|
109456
109727
|
try {
|
|
109457
|
-
return
|
|
109728
|
+
return dirname32(fileURLToPath7(moduleUrl));
|
|
109458
109729
|
} catch (error51) {
|
|
109459
109730
|
if (!(error51 instanceof Error))
|
|
109460
109731
|
throw error51;
|
|
@@ -109462,11 +109733,11 @@ function getModuleDirectory(moduleUrl) {
|
|
|
109462
109733
|
}
|
|
109463
109734
|
}
|
|
109464
109735
|
function findBootstrapRoot(candidates, pathExists) {
|
|
109465
|
-
return candidates.find((candidate2) => pathExists(
|
|
109736
|
+
return candidates.find((candidate2) => pathExists(resolve23(candidate2.root, "package.json")))?.root ?? process.cwd();
|
|
109466
109737
|
}
|
|
109467
109738
|
function readDaemonPackageVersion(root) {
|
|
109468
109739
|
try {
|
|
109469
|
-
const packageJson = JSON.parse(
|
|
109740
|
+
const packageJson = JSON.parse(readFileSync35(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
109470
109741
|
return DaemonPackageSchema.parse(packageJson).version;
|
|
109471
109742
|
} catch (error51) {
|
|
109472
109743
|
if (!(error51 instanceof Error))
|
|
@@ -109478,17 +109749,17 @@ function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
|
109478
109749
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
109479
109750
|
const bun = resolveExecutable("bun");
|
|
109480
109751
|
const npm = resolveExecutable("npm");
|
|
109481
|
-
const packageManifestPath =
|
|
109752
|
+
const packageManifestPath = resolve23(root, PACKAGE_REL, "package.json");
|
|
109482
109753
|
return {
|
|
109483
109754
|
command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
|
|
109484
109755
|
root,
|
|
109485
|
-
path:
|
|
109756
|
+
path: resolve23(root, PACKAGE_REL, DIST_CLI_REL),
|
|
109486
109757
|
exists: runtime5.available && npm.available && pathExists(packageManifestPath),
|
|
109487
109758
|
runtimeAvailable: runtime5.available
|
|
109488
109759
|
};
|
|
109489
109760
|
}
|
|
109490
109761
|
function resolveLspCommand(options = {}) {
|
|
109491
|
-
const pathExists = options.exists ??
|
|
109762
|
+
const pathExists = options.exists ?? existsSync56;
|
|
109492
109763
|
const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
|
|
109493
109764
|
const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
|
|
109494
109765
|
const candidates = moduleDirectory ? createAncestorCliCandidates({
|
|
@@ -109498,7 +109769,7 @@ function resolveLspCommand(options = {}) {
|
|
|
109498
109769
|
sourceCliRel: SOURCE_CLI_REL,
|
|
109499
109770
|
pathExists,
|
|
109500
109771
|
resolveExecutable,
|
|
109501
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(
|
|
109772
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve23(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
|
|
109502
109773
|
}) : [];
|
|
109503
109774
|
const distCandidate = candidates.find((candidate2) => hasCliSuffix(candidate2.path, DIST_CLI_REL) && candidate2.exists);
|
|
109504
109775
|
if (distCandidate) {
|
|
@@ -109512,7 +109783,7 @@ function resolveLspCommand(options = {}) {
|
|
|
109512
109783
|
}
|
|
109513
109784
|
function createLspMcpConfig(options = {}) {
|
|
109514
109785
|
const resolvedCommand = resolveLspCommand(options);
|
|
109515
|
-
const cwd =
|
|
109786
|
+
const cwd = resolve23(options.cwd ?? process.cwd());
|
|
109516
109787
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
109517
109788
|
const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
|
|
109518
109789
|
return {
|
|
@@ -109521,9 +109792,9 @@ function createLspMcpConfig(options = {}) {
|
|
|
109521
109792
|
enabled: resolvedCommand.exists,
|
|
109522
109793
|
cwd,
|
|
109523
109794
|
environment: {
|
|
109524
|
-
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) =>
|
|
109525
|
-
LSP_TOOLS_MCP_USER_CONFIG:
|
|
109526
|
-
LSP_TOOLS_MCP_INSTALL_DECISIONS:
|
|
109795
|
+
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve23(cwd, configPath)).join(delimiter3),
|
|
109796
|
+
LSP_TOOLS_MCP_USER_CONFIG: resolve23(configDir, "lsp.json"),
|
|
109797
|
+
LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve23(configDir, "lsp-install-decisions.json"),
|
|
109527
109798
|
...sourceVersion ? {
|
|
109528
109799
|
[OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
|
|
109529
109800
|
[OMO_LSP_DAEMON_VERSION]: sourceVersion
|
|
@@ -109548,24 +109819,24 @@ function getInstalledLspServers(options = {}) {
|
|
|
109548
109819
|
|
|
109549
109820
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
109550
109821
|
init_shared();
|
|
109551
|
-
import { existsSync as
|
|
109552
|
-
import { homedir as
|
|
109553
|
-
import { join as
|
|
109822
|
+
import { existsSync as existsSync57, readFileSync as readFileSync36 } from "fs";
|
|
109823
|
+
import { homedir as homedir20 } from "os";
|
|
109824
|
+
import { join as join84 } from "path";
|
|
109554
109825
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
109555
109826
|
function getMcpConfigPaths() {
|
|
109556
109827
|
return [
|
|
109557
|
-
|
|
109558
|
-
|
|
109559
|
-
|
|
109828
|
+
join84(homedir20(), ".claude", ".mcp.json"),
|
|
109829
|
+
join84(process.cwd(), ".mcp.json"),
|
|
109830
|
+
join84(process.cwd(), ".claude", ".mcp.json")
|
|
109560
109831
|
];
|
|
109561
109832
|
}
|
|
109562
109833
|
function loadUserMcpConfig() {
|
|
109563
109834
|
const servers = {};
|
|
109564
109835
|
for (const configPath of getMcpConfigPaths()) {
|
|
109565
|
-
if (!
|
|
109836
|
+
if (!existsSync57(configPath))
|
|
109566
109837
|
continue;
|
|
109567
109838
|
try {
|
|
109568
|
-
const content =
|
|
109839
|
+
const content = readFileSync36(configPath, "utf-8");
|
|
109569
109840
|
const config4 = parseJsonc(content);
|
|
109570
109841
|
if (config4.mcpServers) {
|
|
109571
109842
|
Object.assign(servers, config4.mcpServers);
|
|
@@ -109700,17 +109971,17 @@ async function checkTools() {
|
|
|
109700
109971
|
|
|
109701
109972
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
109702
109973
|
init_src5();
|
|
109703
|
-
import { existsSync as
|
|
109974
|
+
import { existsSync as existsSync58, readFileSync as readFileSync37 } from "fs";
|
|
109704
109975
|
function isTelemetryState(value) {
|
|
109705
109976
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
109706
109977
|
}
|
|
109707
109978
|
function readLastActiveDay(stateFilePath) {
|
|
109708
|
-
if (!
|
|
109979
|
+
if (!existsSync58(stateFilePath)) {
|
|
109709
109980
|
return "never";
|
|
109710
109981
|
}
|
|
109711
109982
|
let parsed;
|
|
109712
109983
|
try {
|
|
109713
|
-
parsed = JSON.parse(
|
|
109984
|
+
parsed = JSON.parse(readFileSync37(stateFilePath, "utf-8"));
|
|
109714
109985
|
} catch (error51) {
|
|
109715
109986
|
if (error51 instanceof Error) {
|
|
109716
109987
|
return "unreadable";
|
|
@@ -109768,17 +110039,17 @@ async function probeBinary(cmd, args, spawnImpl) {
|
|
|
109768
110039
|
}
|
|
109769
110040
|
|
|
109770
110041
|
// packages/team-core/src/team-registry/paths.ts
|
|
109771
|
-
import { homedir as
|
|
110042
|
+
import { homedir as homedir21 } from "os";
|
|
109772
110043
|
import path12 from "path";
|
|
109773
110044
|
function resolveBaseDir(config4) {
|
|
109774
|
-
return expandHomeDirectory(config4.base_dir ?? path12.join(
|
|
110045
|
+
return expandHomeDirectory(config4.base_dir ?? path12.join(homedir21(), ".omo"));
|
|
109775
110046
|
}
|
|
109776
110047
|
function expandHomeDirectory(directoryPath3) {
|
|
109777
110048
|
if (directoryPath3 === "~") {
|
|
109778
|
-
return
|
|
110049
|
+
return homedir21();
|
|
109779
110050
|
}
|
|
109780
110051
|
if (directoryPath3.startsWith("~/") || directoryPath3.startsWith("~\\")) {
|
|
109781
|
-
return path12.join(
|
|
110052
|
+
return path12.join(homedir21(), directoryPath3.slice(2));
|
|
109782
110053
|
}
|
|
109783
110054
|
return directoryPath3;
|
|
109784
110055
|
}
|
|
@@ -109835,10 +110106,10 @@ async function pathExists(dir) {
|
|
|
109835
110106
|
|
|
109836
110107
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
109837
110108
|
init_src2();
|
|
109838
|
-
import { existsSync as
|
|
110109
|
+
import { existsSync as existsSync59 } from "fs";
|
|
109839
110110
|
import { lstat as lstat15, readdir as readdir14, readFile as readFile27 } from "fs/promises";
|
|
109840
|
-
import { homedir as
|
|
109841
|
-
import { basename as basename11, join as
|
|
110111
|
+
import { homedir as homedir22 } from "os";
|
|
110112
|
+
import { basename as basename11, join as join85, resolve as resolve24 } from "path";
|
|
109842
110113
|
// packages/omo-opencode/package.json
|
|
109843
110114
|
var package_default3 = {
|
|
109844
110115
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -109903,13 +110174,13 @@ var CODEX_BIN_NAMES = [
|
|
|
109903
110174
|
"omo-git-bash-hook"
|
|
109904
110175
|
];
|
|
109905
110176
|
async function gatherCodexSummary(deps = {}) {
|
|
109906
|
-
const codexHome =
|
|
110177
|
+
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join85(homedir22(), ".codex"));
|
|
109907
110178
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
109908
110179
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
109909
110180
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
109910
|
-
const manifest2 = pluginRoot === null ? null : await readJson(
|
|
109911
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
109912
|
-
const configPath =
|
|
110181
|
+
const manifest2 = pluginRoot === null ? null : await readJson(join85(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
110182
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join85(pluginRoot, "lazycodex-install.json"));
|
|
110183
|
+
const configPath = join85(codexHome, "config.toml");
|
|
109913
110184
|
const pluginVersion = stringField(manifest2, "version");
|
|
109914
110185
|
return {
|
|
109915
110186
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -109966,7 +110237,7 @@ function buildCodexIssues(summary) {
|
|
|
109966
110237
|
if (summary.pluginRoot === null) {
|
|
109967
110238
|
issues.push({
|
|
109968
110239
|
title: "OMO Codex plugin is not installed",
|
|
109969
|
-
description: `Expected cached plugin at ${
|
|
110240
|
+
description: `Expected cached plugin at ${join85("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
109970
110241
|
fix: "Run: npx lazycodex-ai install",
|
|
109971
110242
|
severity: "error",
|
|
109972
110243
|
affects: ["plugin loading"]
|
|
@@ -110031,15 +110302,15 @@ function buildCodexIssues(summary) {
|
|
|
110031
110302
|
return issues;
|
|
110032
110303
|
}
|
|
110033
110304
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
110034
|
-
const pluginRoot =
|
|
110035
|
-
if (!
|
|
110305
|
+
const pluginRoot = join85(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
110306
|
+
if (!existsSync59(pluginRoot))
|
|
110036
110307
|
return null;
|
|
110037
110308
|
const versions2 = await readdir14(pluginRoot, { withFileTypes: true });
|
|
110038
110309
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
110039
|
-
return candidates.length === 0 ? null :
|
|
110310
|
+
return candidates.length === 0 ? null : join85(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
110040
110311
|
}
|
|
110041
110312
|
async function readCodexConfigSummary(configPath) {
|
|
110042
|
-
if (!
|
|
110313
|
+
if (!existsSync59(configPath)) {
|
|
110043
110314
|
return {
|
|
110044
110315
|
exists: false,
|
|
110045
110316
|
marketplaceConfigured: false,
|
|
@@ -110064,14 +110335,14 @@ async function readCodexConfigSummary(configPath) {
|
|
|
110064
110335
|
async function readLinkedBins(binDir) {
|
|
110065
110336
|
const linked = [];
|
|
110066
110337
|
for (const name of CODEX_BIN_NAMES) {
|
|
110067
|
-
if (await pathExists2(
|
|
110338
|
+
if (await pathExists2(join85(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
110068
110339
|
linked.push(name);
|
|
110069
110340
|
}
|
|
110070
110341
|
return linked;
|
|
110071
110342
|
}
|
|
110072
110343
|
async function readLinkedAgents(codexHome) {
|
|
110073
|
-
const agentsDir =
|
|
110074
|
-
if (!
|
|
110344
|
+
const agentsDir = join85(codexHome, "agents");
|
|
110345
|
+
if (!existsSync59(agentsDir))
|
|
110075
110346
|
return [];
|
|
110076
110347
|
const entries = await readdir14(agentsDir, { withFileTypes: true });
|
|
110077
110348
|
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename11(entry.name, ".toml")).sort();
|
|
@@ -110117,16 +110388,16 @@ function formatCompanionPluginStatus(config4) {
|
|
|
110117
110388
|
return "none";
|
|
110118
110389
|
}
|
|
110119
110390
|
function readCompanionLifecycleHookStateEvents(content) {
|
|
110120
|
-
const
|
|
110391
|
+
const events2 = new Set;
|
|
110121
110392
|
for (const section of splitTomlSections(content)) {
|
|
110122
110393
|
if (section.header === null)
|
|
110123
110394
|
continue;
|
|
110124
110395
|
const key = parseHookStateHeaderKey(section.header);
|
|
110125
110396
|
const event = key === null ? null : companionLifecycleEventFromHookStateKey(key);
|
|
110126
110397
|
if (event !== null)
|
|
110127
|
-
|
|
110398
|
+
events2.add(event);
|
|
110128
110399
|
}
|
|
110129
|
-
return [...
|
|
110400
|
+
return [...events2].sort(compareCompanionLifecycleEvents);
|
|
110130
110401
|
}
|
|
110131
110402
|
function companionLifecycleEventFromHookStateKey(key) {
|
|
110132
110403
|
if (!key.startsWith(`${COMPANION_PLUGIN_KEY}:`))
|
|
@@ -110140,8 +110411,8 @@ function compareCompanionLifecycleEvents(left, right) {
|
|
|
110140
110411
|
function companionLifecycleEventOrder(event) {
|
|
110141
110412
|
return event === "session_start" ? 0 : event === "stop" ? 1 : 2;
|
|
110142
110413
|
}
|
|
110143
|
-
function formatCompanionLifecycleEvents(
|
|
110144
|
-
return
|
|
110414
|
+
function formatCompanionLifecycleEvents(events2) {
|
|
110415
|
+
return events2.map(formatCompanionLifecycleEvent).join(", ");
|
|
110145
110416
|
}
|
|
110146
110417
|
function formatCompanionLifecycleEvent(event) {
|
|
110147
110418
|
switch (event) {
|
|
@@ -110185,8 +110456,8 @@ async function pathExists2(path14) {
|
|
|
110185
110456
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
110186
110457
|
init_src2();
|
|
110187
110458
|
import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "fs/promises";
|
|
110188
|
-
import { homedir as
|
|
110189
|
-
import { dirname as
|
|
110459
|
+
import { homedir as homedir23 } from "os";
|
|
110460
|
+
import { dirname as dirname33, isAbsolute as isAbsolute12, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "path";
|
|
110190
110461
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
110191
110462
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
110192
110463
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -110196,7 +110467,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110196
110467
|
const env3 = deps.env ?? process.env;
|
|
110197
110468
|
const platform = deps.platform ?? process.platform;
|
|
110198
110469
|
const arch = deps.arch ?? process.arch;
|
|
110199
|
-
const codexHome =
|
|
110470
|
+
const codexHome = resolve25(deps.codexHome ?? env3["CODEX_HOME"] ?? join86(homedir23(), ".codex"));
|
|
110200
110471
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
110201
110472
|
if (summary.pluginRoot === null) {
|
|
110202
110473
|
return {
|
|
@@ -110221,7 +110492,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110221
110492
|
});
|
|
110222
110493
|
}
|
|
110223
110494
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
110224
|
-
const runtimeSgPath =
|
|
110495
|
+
const runtimeSgPath = join86(runtimeSgDir, sgBinaryName(platform));
|
|
110225
110496
|
const sg = findSgBinarySync({
|
|
110226
110497
|
arch,
|
|
110227
110498
|
env: env3,
|
|
@@ -110260,8 +110531,8 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110260
110531
|
const manifest2 = await readJson2(manifestPath);
|
|
110261
110532
|
if (manifest2 === null || !isRecord12(manifest2["mcpServers"]))
|
|
110262
110533
|
continue;
|
|
110263
|
-
const manifestRoot =
|
|
110264
|
-
const isRootManifest =
|
|
110534
|
+
const manifestRoot = dirname33(manifestPath);
|
|
110535
|
+
const isRootManifest = resolve25(manifestRoot) === resolve25(pluginRoot);
|
|
110265
110536
|
for (const server2 of Object.values(manifest2["mcpServers"])) {
|
|
110266
110537
|
if (!isRecord12(server2) || !Array.isArray(server2["args"]))
|
|
110267
110538
|
continue;
|
|
@@ -110281,7 +110552,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110281
110552
|
continue;
|
|
110282
110553
|
const commands2 = [];
|
|
110283
110554
|
collectHookCommands(manifest2, commands2);
|
|
110284
|
-
const hookPluginRoot =
|
|
110555
|
+
const hookPluginRoot = dirname33(dirname33(hookManifestPath));
|
|
110285
110556
|
for (const command of commands2) {
|
|
110286
110557
|
for (const relativePath of extractPluginRootPaths(command)) {
|
|
110287
110558
|
referencedCount += 1;
|
|
@@ -110303,8 +110574,8 @@ function recordBrokenTarget(broken, classified, origin) {
|
|
|
110303
110574
|
broken.push(entry);
|
|
110304
110575
|
}
|
|
110305
110576
|
async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
|
|
110306
|
-
const targetPath =
|
|
110307
|
-
const bundleRootPath =
|
|
110577
|
+
const targetPath = resolve25(baseRoot, relativePath);
|
|
110578
|
+
const bundleRootPath = resolve25(bundleRoot);
|
|
110308
110579
|
const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
|
|
110309
110580
|
if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
|
|
110310
110581
|
if (allowEscape)
|
|
@@ -110320,7 +110591,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
|
|
|
110320
110591
|
}
|
|
110321
110592
|
async function findHookManifestPaths(root) {
|
|
110322
110593
|
const paths3 = await findManifestPaths(root, "hooks.json");
|
|
110323
|
-
return paths3.filter((path14) =>
|
|
110594
|
+
return paths3.filter((path14) => dirname33(path14).endsWith(`${sep9}hooks`));
|
|
110324
110595
|
}
|
|
110325
110596
|
async function findManifestPaths(root, manifestName) {
|
|
110326
110597
|
let entries;
|
|
@@ -110333,7 +110604,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
110333
110604
|
for (const entry of entries) {
|
|
110334
110605
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
110335
110606
|
continue;
|
|
110336
|
-
const entryPath =
|
|
110607
|
+
const entryPath = join86(root, entry.name);
|
|
110337
110608
|
if (entry.isDirectory()) {
|
|
110338
110609
|
paths3.push(...await findManifestPaths(entryPath, manifestName));
|
|
110339
110610
|
continue;
|
|
@@ -110377,18 +110648,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
110377
110648
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
110378
110649
|
}
|
|
110379
110650
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
110380
|
-
return
|
|
110651
|
+
return join86(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
110381
110652
|
}
|
|
110382
110653
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
110383
110654
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
110384
110655
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
110385
110656
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
110386
|
-
if (sgPath ===
|
|
110657
|
+
if (sgPath === join86(runtimeSgDir, sgBinaryName(platform)))
|
|
110387
110658
|
return "runtime dir";
|
|
110388
110659
|
return "PATH";
|
|
110389
110660
|
}
|
|
110390
110661
|
async function readBootstrapStateSummary(codexHome) {
|
|
110391
|
-
const statePath =
|
|
110662
|
+
const statePath = join86(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
110392
110663
|
const raw = await readJson2(statePath);
|
|
110393
110664
|
if (raw === null)
|
|
110394
110665
|
return null;
|
|
@@ -110464,24 +110735,24 @@ function isRecord12(value) {
|
|
|
110464
110735
|
}
|
|
110465
110736
|
|
|
110466
110737
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
110467
|
-
import { existsSync as
|
|
110738
|
+
import { existsSync as existsSync60 } from "fs";
|
|
110468
110739
|
import { readFile as readFile29 } from "fs/promises";
|
|
110469
|
-
import { homedir as
|
|
110470
|
-
import { join as
|
|
110740
|
+
import { homedir as homedir24 } from "os";
|
|
110741
|
+
import { join as join87, resolve as resolve26 } from "path";
|
|
110471
110742
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
110472
110743
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
110473
110744
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
110474
110745
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
110475
|
-
const codexHome =
|
|
110746
|
+
const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join87(homedir24(), ".codex"));
|
|
110476
110747
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110477
110748
|
const platform = deps.platform ?? process.platform;
|
|
110478
|
-
const wrapperPath =
|
|
110479
|
-
const legacyWrapperPath =
|
|
110749
|
+
const wrapperPath = join87(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
|
|
110750
|
+
const legacyWrapperPath = join87(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
110480
110751
|
const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
|
|
110481
110752
|
const issues = [];
|
|
110482
110753
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
110483
110754
|
const targetPath = parseRuntimeTargetPath(wrapper);
|
|
110484
|
-
if (targetPath !== null && !
|
|
110755
|
+
if (targetPath !== null && !existsSync60(targetPath)) {
|
|
110485
110756
|
issues.push({
|
|
110486
110757
|
title: "omo-agent-toolkit runtime wrapper target is missing",
|
|
110487
110758
|
description: `Generated omo-agent-toolkit runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
|
|
@@ -110995,24 +111266,24 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
110995
111266
|
// packages/mcp-client-core/src/mcp-oauth/storage.ts
|
|
110996
111267
|
import { createHash as createHash6 } from "crypto";
|
|
110997
111268
|
import {
|
|
110998
|
-
chmodSync as
|
|
110999
|
-
existsSync as
|
|
111000
|
-
mkdirSync as
|
|
111269
|
+
chmodSync as chmodSync5,
|
|
111270
|
+
existsSync as existsSync63,
|
|
111271
|
+
mkdirSync as mkdirSync15,
|
|
111001
111272
|
readdirSync as readdirSync11,
|
|
111002
|
-
readFileSync as
|
|
111273
|
+
readFileSync as readFileSync39,
|
|
111003
111274
|
renameSync as renameSync7,
|
|
111004
111275
|
unlinkSync as unlinkSync9,
|
|
111005
|
-
writeFileSync as
|
|
111276
|
+
writeFileSync as writeFileSync12
|
|
111006
111277
|
} from "fs";
|
|
111007
|
-
import { basename as basename12, dirname as
|
|
111278
|
+
import { basename as basename12, dirname as dirname34, join as join90 } from "path";
|
|
111008
111279
|
|
|
111009
111280
|
// packages/mcp-client-core/src/config-dir.ts
|
|
111010
|
-
import { existsSync as
|
|
111011
|
-
import { homedir as
|
|
111012
|
-
import { join as
|
|
111281
|
+
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
|
|
111282
|
+
import { homedir as homedir25 } from "os";
|
|
111283
|
+
import { join as join88, resolve as resolve27 } from "path";
|
|
111013
111284
|
function resolveConfigPath2(pathValue) {
|
|
111014
|
-
const resolvedPath =
|
|
111015
|
-
if (!
|
|
111285
|
+
const resolvedPath = resolve27(pathValue);
|
|
111286
|
+
if (!existsSync61(resolvedPath))
|
|
111016
111287
|
return resolvedPath;
|
|
111017
111288
|
try {
|
|
111018
111289
|
return realpathSync8(resolvedPath);
|
|
@@ -111027,13 +111298,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
111027
111298
|
if (customConfigDir) {
|
|
111028
111299
|
return resolveConfigPath2(customConfigDir);
|
|
111029
111300
|
}
|
|
111030
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
111031
|
-
return resolveConfigPath2(
|
|
111301
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join88(homedir25(), ".config");
|
|
111302
|
+
return resolveConfigPath2(join88(xdgConfigDir, "opencode"));
|
|
111032
111303
|
}
|
|
111033
111304
|
|
|
111034
111305
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
111035
|
-
import { chmodSync as
|
|
111036
|
-
import { join as
|
|
111306
|
+
import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync38, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "fs";
|
|
111307
|
+
import { join as join89 } from "path";
|
|
111037
111308
|
var INDEX_FILE_NAME = "index.json";
|
|
111038
111309
|
function isTokenIndex(value) {
|
|
111039
111310
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -111041,14 +111312,14 @@ function isTokenIndex(value) {
|
|
|
111041
111312
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
111042
111313
|
}
|
|
111043
111314
|
function getIndexPath(storageDir) {
|
|
111044
|
-
return
|
|
111315
|
+
return join89(storageDir, INDEX_FILE_NAME);
|
|
111045
111316
|
}
|
|
111046
111317
|
function readTokenIndex(storageDir) {
|
|
111047
111318
|
const indexPath = getIndexPath(storageDir);
|
|
111048
|
-
if (!
|
|
111319
|
+
if (!existsSync62(indexPath))
|
|
111049
111320
|
return {};
|
|
111050
111321
|
try {
|
|
111051
|
-
const parsed = JSON.parse(
|
|
111322
|
+
const parsed = JSON.parse(readFileSync38(indexPath, "utf-8"));
|
|
111052
111323
|
return isTokenIndex(parsed) ? parsed : {};
|
|
111053
111324
|
} catch (readError) {
|
|
111054
111325
|
if (!(readError instanceof Error))
|
|
@@ -111060,8 +111331,8 @@ function writeTokenIndex(storageDir, index) {
|
|
|
111060
111331
|
try {
|
|
111061
111332
|
const indexPath = getIndexPath(storageDir);
|
|
111062
111333
|
const tempPath = `${indexPath}.tmp.${Date.now()}`;
|
|
111063
|
-
|
|
111064
|
-
|
|
111334
|
+
writeFileSync11(tempPath, JSON.stringify(index, null, 2), { encoding: "utf-8", mode: 384 });
|
|
111335
|
+
chmodSync4(tempPath, 384);
|
|
111065
111336
|
renameSync6(tempPath, indexPath);
|
|
111066
111337
|
return true;
|
|
111067
111338
|
} catch (writeError) {
|
|
@@ -111085,16 +111356,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
111085
111356
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
111086
111357
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
111087
111358
|
function getMcpOauthStorageDir() {
|
|
111088
|
-
return
|
|
111359
|
+
return join90(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
111089
111360
|
}
|
|
111090
111361
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
111091
111362
|
return createHash6("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
111092
111363
|
}
|
|
111093
111364
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
111094
|
-
return
|
|
111365
|
+
return join90(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
111095
111366
|
}
|
|
111096
111367
|
function getLegacyStoragePath() {
|
|
111097
|
-
return
|
|
111368
|
+
return join90(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
111098
111369
|
}
|
|
111099
111370
|
function normalizeHost2(serverHost) {
|
|
111100
111371
|
let host = serverHost.trim();
|
|
@@ -111155,10 +111426,10 @@ function isOAuthTokenData(value) {
|
|
|
111155
111426
|
return clientSecret === undefined || typeof clientSecret === "string";
|
|
111156
111427
|
}
|
|
111157
111428
|
function readTokenFile(filePath) {
|
|
111158
|
-
if (!
|
|
111429
|
+
if (!existsSync63(filePath))
|
|
111159
111430
|
return null;
|
|
111160
111431
|
try {
|
|
111161
|
-
const parsed = JSON.parse(
|
|
111432
|
+
const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
|
|
111162
111433
|
return isOAuthTokenData(parsed) ? parsed : null;
|
|
111163
111434
|
} catch (readError) {
|
|
111164
111435
|
if (!(readError instanceof Error))
|
|
@@ -111168,10 +111439,10 @@ function readTokenFile(filePath) {
|
|
|
111168
111439
|
}
|
|
111169
111440
|
function readLegacyStore() {
|
|
111170
111441
|
const filePath = getLegacyStoragePath();
|
|
111171
|
-
if (!
|
|
111442
|
+
if (!existsSync63(filePath))
|
|
111172
111443
|
return null;
|
|
111173
111444
|
try {
|
|
111174
|
-
const parsed = JSON.parse(
|
|
111445
|
+
const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
|
|
111175
111446
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
|
|
111176
111447
|
return null;
|
|
111177
111448
|
const result = {};
|
|
@@ -111188,13 +111459,13 @@ function readLegacyStore() {
|
|
|
111188
111459
|
}
|
|
111189
111460
|
function writeTokenFile(filePath, token) {
|
|
111190
111461
|
try {
|
|
111191
|
-
const dir =
|
|
111192
|
-
if (!
|
|
111193
|
-
|
|
111462
|
+
const dir = dirname34(filePath);
|
|
111463
|
+
if (!existsSync63(dir)) {
|
|
111464
|
+
mkdirSync15(dir, { recursive: true });
|
|
111194
111465
|
}
|
|
111195
111466
|
const tempPath = `${filePath}.tmp.${Date.now()}`;
|
|
111196
|
-
|
|
111197
|
-
|
|
111467
|
+
writeFileSync12(tempPath, JSON.stringify(token, null, 2), { encoding: "utf-8", mode: 384 });
|
|
111468
|
+
chmodSync5(tempPath, 384);
|
|
111198
111469
|
renameSync7(tempPath, filePath);
|
|
111199
111470
|
return true;
|
|
111200
111471
|
} catch (writeError) {
|
|
@@ -111213,7 +111484,7 @@ function saveToken(serverHost, resource, token) {
|
|
|
111213
111484
|
}
|
|
111214
111485
|
function deleteToken(serverHost, resource) {
|
|
111215
111486
|
const filePath = getMcpOauthStoragePath(serverHost, resource);
|
|
111216
|
-
if (!
|
|
111487
|
+
if (!existsSync63(filePath))
|
|
111217
111488
|
return deleteLegacyToken(serverHost, resource);
|
|
111218
111489
|
try {
|
|
111219
111490
|
unlinkSync9(filePath);
|
|
@@ -111235,7 +111506,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
111235
111506
|
if (Object.keys(store2).length === 0) {
|
|
111236
111507
|
try {
|
|
111237
111508
|
const filePath = getLegacyStoragePath();
|
|
111238
|
-
if (
|
|
111509
|
+
if (existsSync63(filePath))
|
|
111239
111510
|
unlinkSync9(filePath);
|
|
111240
111511
|
return true;
|
|
111241
111512
|
} catch (deleteError) {
|
|
@@ -111249,8 +111520,8 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
111249
111520
|
function writeLegacyStore(store2) {
|
|
111250
111521
|
try {
|
|
111251
111522
|
const filePath = getLegacyStoragePath();
|
|
111252
|
-
|
|
111253
|
-
|
|
111523
|
+
writeFileSync12(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
|
|
111524
|
+
chmodSync5(filePath, 384);
|
|
111254
111525
|
return true;
|
|
111255
111526
|
} catch (writeError) {
|
|
111256
111527
|
if (!(writeError instanceof Error))
|
|
@@ -111273,7 +111544,7 @@ function listTokensByHost(serverHost) {
|
|
|
111273
111544
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
111274
111545
|
if (!indexedKey.startsWith(prefix))
|
|
111275
111546
|
continue;
|
|
111276
|
-
const indexedToken = readTokenFile(
|
|
111547
|
+
const indexedToken = readTokenFile(join90(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
111277
111548
|
if (indexedToken)
|
|
111278
111549
|
result[indexedKey] = indexedToken;
|
|
111279
111550
|
}
|
|
@@ -111282,13 +111553,13 @@ function listTokensByHost(serverHost) {
|
|
|
111282
111553
|
function listAllTokens() {
|
|
111283
111554
|
const result = { ...readLegacyStore() ?? {} };
|
|
111284
111555
|
const dir = getMcpOauthStorageDir();
|
|
111285
|
-
if (!
|
|
111556
|
+
if (!existsSync63(dir))
|
|
111286
111557
|
return result;
|
|
111287
111558
|
const index = readTokenIndex(dir);
|
|
111288
111559
|
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
111289
111560
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
111290
111561
|
continue;
|
|
111291
|
-
const token = readTokenFile(
|
|
111562
|
+
const token = readTokenFile(join90(dir, entry.name));
|
|
111292
111563
|
const hash2 = basename12(entry.name, ".json");
|
|
111293
111564
|
if (token)
|
|
111294
111565
|
result[index[hash2] ?? hash2] = token;
|
|
@@ -111488,7 +111759,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
|
111488
111759
|
}
|
|
111489
111760
|
var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
111490
111761
|
function startCallbackServer(port) {
|
|
111491
|
-
return new Promise((
|
|
111762
|
+
return new Promise((resolve28, reject) => {
|
|
111492
111763
|
let timeoutId;
|
|
111493
111764
|
const server2 = createServer2((request, response) => {
|
|
111494
111765
|
clearTimeout(timeoutId);
|
|
@@ -111514,7 +111785,7 @@ function startCallbackServer(port) {
|
|
|
111514
111785
|
response.writeHead(200, { "content-type": "text/html" });
|
|
111515
111786
|
response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
|
|
111516
111787
|
server2.close();
|
|
111517
|
-
|
|
111788
|
+
resolve28({ code, state: state2 });
|
|
111518
111789
|
});
|
|
111519
111790
|
timeoutId = setTimeout(() => {
|
|
111520
111791
|
server2.close();
|
|
@@ -111854,7 +112125,7 @@ function createMcpOAuthCommand() {
|
|
|
111854
112125
|
}
|
|
111855
112126
|
|
|
111856
112127
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
111857
|
-
import { existsSync as
|
|
112128
|
+
import { existsSync as existsSync64 } from "fs";
|
|
111858
112129
|
|
|
111859
112130
|
// packages/omo-opencode/src/cli/boulder/formatter.ts
|
|
111860
112131
|
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
@@ -111991,10 +112262,10 @@ async function boulder(options) {
|
|
|
111991
112262
|
const boulderFilePath = getBoulderFilePath(directory);
|
|
111992
112263
|
const state2 = readBoulderState(directory);
|
|
111993
112264
|
if (!state2) {
|
|
111994
|
-
const message =
|
|
112265
|
+
const message = existsSync64(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
|
|
111995
112266
|
process.stderr.write(`${message}
|
|
111996
112267
|
`);
|
|
111997
|
-
return
|
|
112268
|
+
return existsSync64(boulderFilePath) ? 2 : 1;
|
|
111998
112269
|
}
|
|
111999
112270
|
const works = getBoulderWorks(state2);
|
|
112000
112271
|
const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
|
|
@@ -112012,12 +112283,12 @@ async function boulder(options) {
|
|
|
112012
112283
|
}
|
|
112013
112284
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
112014
112285
|
import { spawn as spawn5 } from "child_process";
|
|
112015
|
-
import { existsSync as
|
|
112016
|
-
import { homedir as
|
|
112286
|
+
import { existsSync as existsSync65, readFileSync as readFileSync40, realpathSync as realpathSync9 } from "fs";
|
|
112287
|
+
import { homedir as homedir26 } from "os";
|
|
112017
112288
|
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
|
|
112018
112289
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
112019
112290
|
const env3 = input.env ?? process.env;
|
|
112020
|
-
const homeDir = input.homeDir ??
|
|
112291
|
+
const homeDir = input.homeDir ?? homedir26();
|
|
112021
112292
|
const localComponentBin = resolveLocalUlwLoopBin(env3, homeDir);
|
|
112022
112293
|
if (localComponentBin !== null)
|
|
112023
112294
|
return { executable: localComponentBin, argsPrefix: [] };
|
|
@@ -112040,29 +112311,29 @@ async function codexUlwLoop(args) {
|
|
|
112040
112311
|
console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
|
|
112041
112312
|
return 1;
|
|
112042
112313
|
}
|
|
112043
|
-
const { promise: promise2, resolve:
|
|
112314
|
+
const { promise: promise2, resolve: resolve28 } = Promise.withResolvers();
|
|
112044
112315
|
const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
|
|
112045
112316
|
stdio: "inherit",
|
|
112046
112317
|
env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
|
|
112047
112318
|
});
|
|
112048
112319
|
child.on("error", (error51) => {
|
|
112049
112320
|
console.error(error51.message);
|
|
112050
|
-
|
|
112321
|
+
resolve28(1);
|
|
112051
112322
|
});
|
|
112052
|
-
child.on("close", (code) =>
|
|
112323
|
+
child.on("close", (code) => resolve28(code ?? 1));
|
|
112053
112324
|
return promise2;
|
|
112054
112325
|
}
|
|
112055
112326
|
function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
112056
112327
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
|
|
112057
|
-
return candidates.find((candidate2) =>
|
|
112328
|
+
return candidates.find((candidate2) => existsSync65(candidate2)) ?? null;
|
|
112058
112329
|
}
|
|
112059
112330
|
function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
112060
112331
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
|
|
112061
|
-
return candidates.find((candidate2) =>
|
|
112332
|
+
return candidates.find((candidate2) => existsSync65(candidate2) && !isCurrentExecutable(candidate2, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate2)) ?? null;
|
|
112062
112333
|
}
|
|
112063
112334
|
function isGeneratedRuntimeWrapper(candidate2) {
|
|
112064
112335
|
try {
|
|
112065
|
-
return
|
|
112336
|
+
return readFileSync40(candidate2, "utf8").includes(RUNTIME_WRAPPER_MARKER);
|
|
112066
112337
|
} catch (error51) {
|
|
112067
112338
|
if (error51 instanceof Error)
|
|
112068
112339
|
return false;
|