oh-my-opencode 4.18.0 → 4.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/codex-qa/scripts/lsp-e2e.sh +3677 -0
- package/.agents/skills/opencode-qa/scripts/lsp-e2e.sh +3154 -0
- package/.agents/skills/work-with-pr/SKILL.md +16 -37
- package/.agents/skills/work-with-pr-workspace/evals/evals.json +3 -3
- package/.opencode/skills/work-with-pr/SKILL.md +16 -37
- package/.opencode/skills/work-with-pr-workspace/evals/evals.json +3 -3
- package/bin/AGENTS.md +33 -0
- package/dist/cli/index.js +500 -158
- package/dist/cli-node/index.js +500 -158
- package/dist/hooks/anthropic-context-window-limit-recovery/empty-content-recovery-sdk.d.ts +6 -0
- package/dist/hooks/category-skill-reminder/hook.d.ts +9 -1
- package/dist/hooks/comment-checker/hook.d.ts +8 -1
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +3 -0
- package/dist/index.js +956 -702
- package/dist/plugin/messages-transform.d.ts +1 -0
- package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +2 -0
- package/dist/tui.js +43 -4
- package/package.json +16 -16
- package/packages/git-bash-mcp/dist/cli.js +81 -19
- package/packages/lsp-core/package.json +4 -0
- package/packages/lsp-core/src/index.ts +1 -0
- package/packages/lsp-core/src/lsp/cleanup-errors.test.ts +18 -0
- package/packages/lsp-core/src/lsp/cleanup-errors.ts +12 -3
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +261 -0
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +63 -0
- package/packages/lsp-core/src/lsp/client-wrapper.ts +35 -5
- package/packages/lsp-core/src/lsp/client.ts +262 -80
- package/packages/lsp-core/src/lsp/config-loader.ts +5 -17
- package/packages/lsp-core/src/lsp/connection.ts +12 -6
- package/packages/lsp-core/src/lsp/directory-diagnostics.test.ts +221 -0
- package/packages/lsp-core/src/lsp/directory-diagnostics.ts +61 -28
- package/packages/lsp-core/src/lsp/errors.ts +11 -0
- package/packages/lsp-core/src/lsp/fixtures/diagnostics-freshness-contract-probe.ts +283 -0
- package/packages/lsp-core/src/lsp/fixtures/workspace-edit-contract-probe.ts +196 -0
- package/packages/lsp-core/src/lsp/fixtures/workspace-edit-server.mjs +215 -0
- package/packages/lsp-core/src/lsp/formatters.ts +3 -0
- package/packages/lsp-core/src/lsp/json-rpc-connection-cancellation.test.ts +97 -0
- package/packages/lsp-core/src/lsp/json-rpc-connection.ts +73 -5
- package/packages/lsp-core/src/lsp/server-install-state.ts +3 -6
- package/packages/lsp-core/src/lsp/transport-protocol.ts +52 -0
- package/packages/lsp-core/src/lsp/transport.ts +96 -70
- package/packages/lsp-core/src/lsp/workspace-apply-edit-failure.ts +19 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-lease.integration.test.ts +214 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-sync.integration.test.ts +113 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-test-support.ts +163 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit.integration.test.ts +163 -0
- package/packages/lsp-core/src/lsp/workspace-document-state.test.ts +67 -0
- package/packages/lsp-core/src/lsp/workspace-document-state.ts +368 -0
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +113 -0
- package/packages/lsp-core/src/lsp/workspace-edit-commit.test.ts +140 -0
- package/packages/lsp-core/src/lsp/workspace-edit-commit.ts +220 -0
- package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.test.ts +56 -0
- package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.ts +30 -0
- package/packages/lsp-core/src/lsp/workspace-edit-fingerprint.ts +44 -0
- package/packages/lsp-core/src/lsp/workspace-edit-options.test.ts +147 -0
- package/packages/lsp-core/src/lsp/workspace-edit-parse-helpers.ts +59 -0
- package/packages/lsp-core/src/lsp/workspace-edit-parser.ts +130 -0
- package/packages/lsp-core/src/lsp/workspace-edit-path.ts +98 -0
- package/packages/lsp-core/src/lsp/workspace-edit-plan-types.ts +60 -0
- package/packages/lsp-core/src/lsp/workspace-edit-plan.ts +73 -0
- package/packages/lsp-core/src/lsp/workspace-edit-prevalidation.test.ts +174 -0
- package/packages/lsp-core/src/lsp/workspace-edit-resource-parser.ts +89 -0
- package/packages/lsp-core/src/lsp/workspace-edit-simulation.ts +183 -0
- package/packages/lsp-core/src/lsp/workspace-edit-snapshot.ts +53 -0
- package/packages/lsp-core/src/lsp/workspace-edit-text.ts +125 -0
- package/packages/lsp-core/src/lsp/workspace-edit-types.ts +121 -0
- package/packages/lsp-core/src/lsp/workspace-edit.characterization.test.ts +95 -0
- package/packages/lsp-core/src/lsp/workspace-edit.ts +49 -200
- package/packages/lsp-core/src/lsp/workspace-mutation-controller.ts +182 -0
- package/packages/lsp-core/src/mcp.ts +18 -7
- package/packages/lsp-core/src/missing-dependency-result.test.ts +105 -0
- package/packages/lsp-core/src/missing-dependency-result.ts +57 -0
- package/packages/lsp-core/src/post-edit/index.ts +1 -0
- package/packages/lsp-core/src/post-edit/orchestration.test.ts +157 -0
- package/packages/lsp-core/src/post-edit/orchestration.ts +178 -0
- package/packages/lsp-core/src/request-context.test.ts +171 -0
- package/packages/lsp-core/src/request-context.ts +222 -9
- package/packages/lsp-core/src/tool-surface.test.ts +4 -1
- package/packages/lsp-core/src/tools/diagnostics.ts +32 -13
- package/packages/lsp-core/src/tools/navigation.ts +12 -12
- package/packages/lsp-core/src/tools/rename.ts +10 -15
- package/packages/lsp-core/src/tools/symbols.ts +11 -11
- package/packages/lsp-core/src/tools/types.ts +2 -1
- package/packages/lsp-daemon/dist/cli.js +3330 -764
- package/packages/lsp-daemon/dist/client.d.ts +105 -0
- package/packages/lsp-daemon/dist/client.js +5995 -0
- package/packages/lsp-daemon/dist/daemon-client.d.ts +12 -7
- package/packages/lsp-daemon/dist/daemon-client.js +139 -32
- package/packages/lsp-daemon/dist/daemon-server.d.ts +1 -0
- package/packages/lsp-daemon/dist/daemon-server.js +40 -15
- package/packages/lsp-daemon/dist/ensure-daemon.d.ts +10 -8
- package/packages/lsp-daemon/dist/ensure-daemon.js +135 -51
- package/packages/lsp-daemon/dist/index.d.ts +2 -2
- package/packages/lsp-daemon/dist/index.js +3093 -786
- package/packages/lsp-daemon/dist/ipc-protocol.d.ts +46 -0
- package/packages/lsp-daemon/dist/ipc-protocol.js +187 -0
- package/packages/lsp-daemon/dist/lock.js +14 -4
- package/packages/lsp-daemon/dist/ownership.d.ts +49 -0
- package/packages/lsp-daemon/dist/ownership.js +168 -0
- package/packages/lsp-daemon/dist/paths.d.ts +33 -9
- package/packages/lsp-daemon/dist/paths.js +72 -33
- package/packages/lsp-daemon/dist/proxy.d.ts +5 -0
- package/packages/lsp-daemon/dist/proxy.js +123 -16
- package/packages/lsp-daemon/dist/request-routing.d.ts +7 -2
- package/packages/lsp-daemon/dist/request-routing.js +71 -22
- package/packages/lsp-daemon/dist/run-daemon.js +9 -2
- package/packages/lsp-daemon/dist/runtime-contract.d.ts +21 -0
- package/packages/lsp-daemon/dist/runtime-contract.js +58 -0
- package/packages/lsp-daemon/dist/socket-jsonrpc.js +6 -1
- package/packages/lsp-daemon/package.json +12 -3
- package/packages/lsp-tools-mcp/dist/cli.js +2189 -454
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +1741 -148
- package/packages/lsp-tools-mcp/dist/mcp.js +2206 -471
- package/packages/lsp-tools-mcp/dist/request-context.js +176 -6
- package/packages/lsp-tools-mcp/dist/tools.js +2119 -447
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/.mcp.json +2 -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 +100 -28
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +100 -28
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +21 -9
- package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +35 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge-lifecycle.test.ts +69 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +57 -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/lsp/.mcp.json +2 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +55 -0
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +3033 -936
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +0 -4
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.d.ts +5 -2
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.js +41 -62
- package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.d.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.js +24 -15
- package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.d.ts +3 -7
- package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +23 -49
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +3 -2
- package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.mjs +31 -1
- package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.test.mjs +76 -0
- package/packages/omo-codex/plugin/components/lsp/scripts/build-runtime.mjs +201 -0
- package/packages/omo-codex/plugin/components/lsp/scripts/build-runtime.test.mjs +55 -0
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +0 -4
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +49 -71
- package/packages/omo-codex/plugin/components/lsp/src/daemon-cli-path.ts +26 -15
- package/packages/omo-codex/plugin/components/lsp/src/lsp-session-state.ts +26 -64
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +16 -17
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook.test.ts +30 -4
- package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +20 -5
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.5.md +1 -1
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.6.md +5 -3
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/README.md +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +3 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/src/boulder-reader.ts +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/src/codex-hook.ts +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/test/boulder-reader.test.ts +15 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +20 -0
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/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 +50 -33
- 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 +50 -33
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +50 -33
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +3 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +5 -6
- 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 +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +6 -5
- package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +5 -6
- package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +2 -2
- 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 +26 -14
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +2 -3
- package/packages/omo-codex/plugin/scripts/build-components.mjs +13 -1
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +9 -1
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +7 -0
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +2 -1
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +50 -33
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +6 -5
- package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +8 -0
- package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +128 -15
- package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +10 -0
- package/packages/omo-codex/plugin/test/lsp-prebuild-layouts.test.mjs +2 -0
- package/packages/omo-codex/plugin/test/mcp-research-servers.test.mjs +1 -0
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +7 -0
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +34 -3
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +328 -63
package/dist/cli/index.js
CHANGED
|
@@ -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: "4.18.
|
|
2148
|
+
version: "4.18.2",
|
|
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",
|
|
@@ -2254,7 +2254,8 @@ var init_package = __esm(() => {
|
|
|
2254
2254
|
"build:codex-install": "bun run script/build-codex-install.ts",
|
|
2255
2255
|
"install:codex-dev": "bun run script/build-codex-install.ts && bun run script/install-codex-dev.ts",
|
|
2256
2256
|
"build:codex-plugin": "npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build",
|
|
2257
|
-
"build:senpi-plugin": "
|
|
2257
|
+
"build:senpi-plugin": "bun run build:lsp-daemon && bun run build:senpi-plugin:stage",
|
|
2258
|
+
"build:senpi-plugin:stage": "node packages/omo-senpi/plugin/scripts/stage-lsp-daemon-runtime.mjs && node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check && node packages/omo-senpi/plugin/scripts/build-install.mjs",
|
|
2258
2259
|
"build:materialize-frontend": "node packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs --strict",
|
|
2259
2260
|
"build:shared-skills-assets": "bun run build:materialize-frontend && rm -rf dist/skills && cp -R packages/shared-skills/skills dist/skills",
|
|
2260
2261
|
"build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
|
|
@@ -2276,7 +2277,7 @@ var init_package = __esm(() => {
|
|
|
2276
2277
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
2277
2278
|
test: "bun test",
|
|
2278
2279
|
"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",
|
|
2279
|
-
"test:senpi": "
|
|
2280
|
+
"test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test packages/omo-senpi",
|
|
2280
2281
|
"test:windows-codex": "bun run test:codex",
|
|
2281
2282
|
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
|
|
2282
2283
|
},
|
|
@@ -2316,7 +2317,6 @@ var init_package = __esm(() => {
|
|
|
2316
2317
|
picocolors: "^1.1.1",
|
|
2317
2318
|
picomatch: "^4.0.4",
|
|
2318
2319
|
"posthog-node": "^5.34.3",
|
|
2319
|
-
"vscode-jsonrpc": "^8.2.1",
|
|
2320
2320
|
zod: "^4.4.3"
|
|
2321
2321
|
},
|
|
2322
2322
|
devDependencies: {
|
|
@@ -2357,18 +2357,18 @@ var init_package = __esm(() => {
|
|
|
2357
2357
|
typescript: "^6.0.3"
|
|
2358
2358
|
},
|
|
2359
2359
|
optionalDependencies: {
|
|
2360
|
-
"oh-my-opencode-darwin-arm64": "4.18.
|
|
2361
|
-
"oh-my-opencode-darwin-x64": "4.18.
|
|
2362
|
-
"oh-my-opencode-darwin-x64-baseline": "4.18.
|
|
2363
|
-
"oh-my-opencode-linux-arm64": "4.18.
|
|
2364
|
-
"oh-my-opencode-linux-arm64-musl": "4.18.
|
|
2365
|
-
"oh-my-opencode-linux-x64": "4.18.
|
|
2366
|
-
"oh-my-opencode-linux-x64-baseline": "4.18.
|
|
2367
|
-
"oh-my-opencode-linux-x64-musl": "4.18.
|
|
2368
|
-
"oh-my-opencode-linux-x64-musl-baseline": "4.18.
|
|
2369
|
-
"oh-my-opencode-windows-arm64": "4.18.
|
|
2370
|
-
"oh-my-opencode-windows-x64": "4.18.
|
|
2371
|
-
"oh-my-opencode-windows-x64-baseline": "4.18.
|
|
2360
|
+
"oh-my-opencode-darwin-arm64": "4.18.2",
|
|
2361
|
+
"oh-my-opencode-darwin-x64": "4.18.2",
|
|
2362
|
+
"oh-my-opencode-darwin-x64-baseline": "4.18.2",
|
|
2363
|
+
"oh-my-opencode-linux-arm64": "4.18.2",
|
|
2364
|
+
"oh-my-opencode-linux-arm64-musl": "4.18.2",
|
|
2365
|
+
"oh-my-opencode-linux-x64": "4.18.2",
|
|
2366
|
+
"oh-my-opencode-linux-x64-baseline": "4.18.2",
|
|
2367
|
+
"oh-my-opencode-linux-x64-musl": "4.18.2",
|
|
2368
|
+
"oh-my-opencode-linux-x64-musl-baseline": "4.18.2",
|
|
2369
|
+
"oh-my-opencode-windows-arm64": "4.18.2",
|
|
2370
|
+
"oh-my-opencode-windows-x64": "4.18.2",
|
|
2371
|
+
"oh-my-opencode-windows-x64-baseline": "4.18.2"
|
|
2372
2372
|
},
|
|
2373
2373
|
overrides: {
|
|
2374
2374
|
"@earendil-works/pi-agent-core": "0.80.3",
|
|
@@ -9222,7 +9222,7 @@ var init_agent_model_requirements = __esm(() => {
|
|
|
9222
9222
|
hephaestus: {
|
|
9223
9223
|
fallbackChain: [
|
|
9224
9224
|
{
|
|
9225
|
-
providers: ["openai", "vercel"],
|
|
9225
|
+
providers: ["openai", "github-copilot", "vercel"],
|
|
9226
9226
|
model: "gpt-5.6-sol",
|
|
9227
9227
|
variant: "high"
|
|
9228
9228
|
},
|
|
@@ -9333,6 +9333,11 @@ var init_agent_model_requirements = __esm(() => {
|
|
|
9333
9333
|
model: "gpt-5.6-sol",
|
|
9334
9334
|
variant: "xhigh"
|
|
9335
9335
|
},
|
|
9336
|
+
{
|
|
9337
|
+
providers: ["github-copilot"],
|
|
9338
|
+
model: "gpt-5.6-sol",
|
|
9339
|
+
variant: "high"
|
|
9340
|
+
},
|
|
9336
9341
|
{
|
|
9337
9342
|
providers: ["openai", "github-copilot", "opencode", "vercel"],
|
|
9338
9343
|
model: "gpt-5.5",
|
|
@@ -9411,6 +9416,11 @@ var init_category_model_requirements = __esm(() => {
|
|
|
9411
9416
|
model: "gpt-5.6-sol",
|
|
9412
9417
|
variant: "xhigh"
|
|
9413
9418
|
},
|
|
9419
|
+
{
|
|
9420
|
+
providers: ["github-copilot"],
|
|
9421
|
+
model: "gpt-5.6-sol",
|
|
9422
|
+
variant: "high"
|
|
9423
|
+
},
|
|
9414
9424
|
{
|
|
9415
9425
|
providers: ["openai", "opencode", "vercel"],
|
|
9416
9426
|
model: "gpt-5.5",
|
|
@@ -9437,7 +9447,12 @@ var init_category_model_requirements = __esm(() => {
|
|
|
9437
9447
|
variant: "xhigh"
|
|
9438
9448
|
},
|
|
9439
9449
|
{
|
|
9440
|
-
providers: ["
|
|
9450
|
+
providers: ["github-copilot"],
|
|
9451
|
+
model: "gpt-5.6-terra",
|
|
9452
|
+
variant: "high"
|
|
9453
|
+
},
|
|
9454
|
+
{
|
|
9455
|
+
providers: ["openai", "github-copilot", "vercel"],
|
|
9441
9456
|
model: "gpt-5.6-sol",
|
|
9442
9457
|
variant: "high"
|
|
9443
9458
|
},
|
|
@@ -9504,6 +9519,11 @@ var init_category_model_requirements = __esm(() => {
|
|
|
9504
9519
|
model: "gpt-5.6-luna",
|
|
9505
9520
|
variant: "xhigh"
|
|
9506
9521
|
},
|
|
9522
|
+
{
|
|
9523
|
+
providers: ["github-copilot"],
|
|
9524
|
+
model: "gpt-5.6-luna",
|
|
9525
|
+
variant: "high"
|
|
9526
|
+
},
|
|
9507
9527
|
{
|
|
9508
9528
|
providers: ["anthropic", "github-copilot", "opencode", "vercel"],
|
|
9509
9529
|
model: "claude-sonnet-4-6"
|
|
@@ -9593,9 +9613,12 @@ function stripProviderPrefixForAliasLookup(normalizedModelID) {
|
|
|
9593
9613
|
}
|
|
9594
9614
|
return normalizedModelID.slice(slashIndex + 1);
|
|
9595
9615
|
}
|
|
9596
|
-
function resolveModelIDAlias(modelID) {
|
|
9616
|
+
function resolveModelIDAlias(modelID, providerID) {
|
|
9597
9617
|
const requestedModelID = normalizeLookupModelID(modelID);
|
|
9598
9618
|
const aliasLookupModelID = stripProviderPrefixForAliasLookup(requestedModelID);
|
|
9619
|
+
const normalizedProviderID = providerID ? normalizeLookupModelID(providerID) : undefined;
|
|
9620
|
+
const providerPrefixEnd = requestedModelID.indexOf("/");
|
|
9621
|
+
const embeddedProviderID = providerPrefixEnd > 0 ? requestedModelID.slice(0, providerPrefixEnd) : undefined;
|
|
9599
9622
|
const exactRule = EXACT_ALIAS_RULES_BY_MODEL.get(aliasLookupModelID);
|
|
9600
9623
|
if (exactRule) {
|
|
9601
9624
|
return {
|
|
@@ -9606,6 +9629,13 @@ function resolveModelIDAlias(modelID) {
|
|
|
9606
9629
|
};
|
|
9607
9630
|
}
|
|
9608
9631
|
for (const rule of PATTERN_ALIAS_RULES) {
|
|
9632
|
+
if (rule.providerIDs) {
|
|
9633
|
+
const matchesProviderID = normalizedProviderID !== undefined && rule.providerIDs.includes(normalizedProviderID);
|
|
9634
|
+
const matchesEmbeddedProviderID = normalizedProviderID !== undefined && rule.allowedSubproviderHosts?.includes(normalizedProviderID) === true && embeddedProviderID !== undefined && rule.providerIDs.includes(embeddedProviderID);
|
|
9635
|
+
if (!matchesProviderID && !matchesEmbeddedProviderID) {
|
|
9636
|
+
continue;
|
|
9637
|
+
}
|
|
9638
|
+
}
|
|
9609
9639
|
if (!rule.match(aliasLookupModelID)) {
|
|
9610
9640
|
continue;
|
|
9611
9641
|
}
|
|
@@ -9646,6 +9676,14 @@ var init_model_capability_aliases = __esm(() => {
|
|
|
9646
9676
|
];
|
|
9647
9677
|
EXACT_ALIAS_RULES_BY_MODEL = new Map(EXACT_ALIAS_RULES.map((rule) => [rule.aliasModelID, rule]));
|
|
9648
9678
|
PATTERN_ALIAS_RULES = [
|
|
9679
|
+
{
|
|
9680
|
+
ruleID: "openai-gpt-5.6-fast-service-tier-alias",
|
|
9681
|
+
description: "Normalizes OpenCode's OpenAI GPT-5.6 fast service-tier IDs to canonical snapshot IDs.",
|
|
9682
|
+
providerIDs: ["openai"],
|
|
9683
|
+
allowedSubproviderHosts: ["vercel"],
|
|
9684
|
+
match: (normalizedModelID) => /^gpt-5\.6-(?:sol|terra|luna)-fast$/.test(normalizedModelID),
|
|
9685
|
+
canonicalize: (normalizedModelID) => normalizedModelID.slice(0, -"-fast".length)
|
|
9686
|
+
},
|
|
9649
9687
|
{
|
|
9650
9688
|
ruleID: "claude-thinking-legacy-alias",
|
|
9651
9689
|
description: "Normalizes the legacy claude-opus-4-7-thinking id to the canonical snapshot ID.",
|
|
@@ -10313,7 +10351,7 @@ function getProviderOverride(providerID, modelID) {
|
|
|
10313
10351
|
return GITHUB_COPILOT_GPT5_MODEL.test(normalizeLookupModelID2(modelID)) ? GITHUB_COPILOT_GPT5_OVERRIDE : undefined;
|
|
10314
10352
|
}
|
|
10315
10353
|
function getModelCapabilities(input) {
|
|
10316
|
-
const canonicalization = resolveModelIDAlias(input.modelID);
|
|
10354
|
+
const canonicalization = resolveModelIDAlias(input.modelID, input.providerID);
|
|
10317
10355
|
const override = getOverride(input.modelID);
|
|
10318
10356
|
const providerOverride = getProviderOverride(input.providerID, canonicalization.canonicalModelID);
|
|
10319
10357
|
const runtimeModel = readRuntimeModel(input.runtimeModel ?? input.providerCache?.findProviderModelMetadata(input.providerID, input.modelID));
|
|
@@ -11418,6 +11456,7 @@ var init_opencode_storage_detection = __esm(() => {
|
|
|
11418
11456
|
var opencodePluginsCache;
|
|
11419
11457
|
var init_load_opencode_plugins = __esm(() => {
|
|
11420
11458
|
init_jsonc_parser2();
|
|
11459
|
+
init_opencode_config_dir();
|
|
11421
11460
|
opencodePluginsCache = new Map;
|
|
11422
11461
|
});
|
|
11423
11462
|
|
|
@@ -66795,14 +66834,14 @@ var init_config_manager = __esm(() => {
|
|
|
66795
66834
|
|
|
66796
66835
|
// packages/telemetry-core/src/activity-state.ts
|
|
66797
66836
|
import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync14 } from "fs";
|
|
66798
|
-
import { basename as
|
|
66837
|
+
import { basename as basename11, join as join53 } from "path";
|
|
66799
66838
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
66800
66839
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
66801
66840
|
env: options.env,
|
|
66802
66841
|
osProvider: options.osProvider
|
|
66803
66842
|
});
|
|
66804
66843
|
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join53(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
66805
|
-
if (dataDir === xdgStateDir || xdgStateDir === undefined &&
|
|
66844
|
+
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename11(dataDir) === product.cacheDirName) {
|
|
66806
66845
|
return dataDir;
|
|
66807
66846
|
}
|
|
66808
66847
|
return join53(dataDir, product.cacheDirName);
|
|
@@ -67036,18 +67075,18 @@ var init_env2 = __esm(() => {
|
|
|
67036
67075
|
});
|
|
67037
67076
|
|
|
67038
67077
|
// packages/telemetry-core/src/machine-id.ts
|
|
67039
|
-
import { createHash as
|
|
67078
|
+
import { createHash as createHash4 } from "crypto";
|
|
67040
67079
|
import os4 from "os";
|
|
67041
67080
|
function getDefaultTelemetryOsProvider() {
|
|
67042
67081
|
return os4;
|
|
67043
67082
|
}
|
|
67044
67083
|
function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
|
|
67045
|
-
return
|
|
67084
|
+
return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
|
|
67046
67085
|
}
|
|
67047
67086
|
var init_machine_id = () => {};
|
|
67048
67087
|
|
|
67049
67088
|
// node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
67050
|
-
import { dirname as dirname18, posix as
|
|
67089
|
+
import { dirname as dirname18, posix as posix3, sep as sep7 } from "path";
|
|
67051
67090
|
function createModulerModifier() {
|
|
67052
67091
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
67053
67092
|
return async (frames) => {
|
|
@@ -67062,7 +67101,7 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(proc
|
|
|
67062
67101
|
if (!filename)
|
|
67063
67102
|
return;
|
|
67064
67103
|
const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
|
|
67065
|
-
let { dir, base: file2, ext } =
|
|
67104
|
+
let { dir, base: file2, ext } = posix3.parse(normalizedFilename);
|
|
67066
67105
|
if (ext === ".js" || ext === ".mjs" || ext === ".cjs")
|
|
67067
67106
|
file2 = file2.slice(0, -1 * ext.length);
|
|
67068
67107
|
const decodedFile = decodeURIComponent(file2);
|
|
@@ -72602,7 +72641,7 @@ var package_default2;
|
|
|
72602
72641
|
var init_package2 = __esm(() => {
|
|
72603
72642
|
package_default2 = {
|
|
72604
72643
|
name: "@oh-my-opencode/omo-codex",
|
|
72605
|
-
version: "4.18.
|
|
72644
|
+
version: "4.18.2",
|
|
72606
72645
|
type: "module",
|
|
72607
72646
|
private: true,
|
|
72608
72647
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -73421,18 +73460,18 @@ function removeFromTextBunLock(lockPath, packageNames) {
|
|
|
73421
73460
|
try {
|
|
73422
73461
|
const content = fs12.readFileSync(lockPath, "utf-8");
|
|
73423
73462
|
const lock = JSON.parse(stripTrailingCommas(content));
|
|
73424
|
-
let
|
|
73463
|
+
let removed2 = false;
|
|
73425
73464
|
for (const packageName of packageNames) {
|
|
73426
73465
|
if (lock.packages?.[packageName]) {
|
|
73427
73466
|
delete lock.packages[packageName];
|
|
73428
73467
|
log2(`[auto-update-checker] Removed from bun.lock: ${packageName}`);
|
|
73429
|
-
|
|
73468
|
+
removed2 = true;
|
|
73430
73469
|
}
|
|
73431
73470
|
}
|
|
73432
|
-
if (
|
|
73471
|
+
if (removed2) {
|
|
73433
73472
|
fs12.writeFileSync(lockPath, JSON.stringify(lock, null, 2));
|
|
73434
73473
|
}
|
|
73435
|
-
return
|
|
73474
|
+
return removed2;
|
|
73436
73475
|
} catch (error51) {
|
|
73437
73476
|
if (!(error51 instanceof Error)) {
|
|
73438
73477
|
throw error51;
|
|
@@ -73472,7 +73511,7 @@ function getInvalidationPackageNames(packageName, defaultPackageName, acceptedPa
|
|
|
73472
73511
|
function removeSpecifierRootDirs(cacheDir, packageNames) {
|
|
73473
73512
|
const parentDirs = [cacheDir, path13.join(cacheDir, "packages")];
|
|
73474
73513
|
const prefixes = packageNames.map((packageName) => `${packageName}@`);
|
|
73475
|
-
let
|
|
73514
|
+
let removed2 = false;
|
|
73476
73515
|
for (const parentDir of parentDirs) {
|
|
73477
73516
|
if (!fs12.existsSync(parentDir)) {
|
|
73478
73517
|
continue;
|
|
@@ -73484,10 +73523,10 @@ function removeSpecifierRootDirs(cacheDir, packageNames) {
|
|
|
73484
73523
|
const specifierDir = path13.join(parentDir, entry.name);
|
|
73485
73524
|
fs12.rmSync(specifierDir, { recursive: true, force: true });
|
|
73486
73525
|
log2(`[auto-update-checker] Specifier cache removed: ${specifierDir}`);
|
|
73487
|
-
|
|
73526
|
+
removed2 = true;
|
|
73488
73527
|
}
|
|
73489
73528
|
}
|
|
73490
|
-
return
|
|
73529
|
+
return removed2;
|
|
73491
73530
|
}
|
|
73492
73531
|
function invalidatePackage(packageName, options = {}) {
|
|
73493
73532
|
try {
|
|
@@ -77787,65 +77826,297 @@ function formatUnknownError(error) {
|
|
|
77787
77826
|
}
|
|
77788
77827
|
|
|
77789
77828
|
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
|
|
77790
|
-
import {
|
|
77829
|
+
import { createHash as createHash3 } from "crypto";
|
|
77830
|
+
import { lstat as lstat11, readFile as readFile19, readdir as readdir10, rm as rm10 } from "fs/promises";
|
|
77831
|
+
import { tmpdir as tmpdir3 } from "os";
|
|
77832
|
+
import { join as join48, posix as posix2 } from "path";
|
|
77833
|
+
|
|
77834
|
+
// packages/omo-codex/src/install/lsp-daemon-reaper-attestation.ts
|
|
77835
|
+
import { execFile as execFile2 } from "child_process";
|
|
77836
|
+
import { readFile as readFile18, readdir as readdir9, readlink as readlink5 } from "fs/promises";
|
|
77791
77837
|
import { connect } from "net";
|
|
77792
|
-
import {
|
|
77793
|
-
|
|
77794
|
-
|
|
77795
|
-
|
|
77796
|
-
|
|
77797
|
-
|
|
77798
|
-
|
|
77838
|
+
import { basename as basename10 } from "path";
|
|
77839
|
+
var PROBE_TIMEOUT_MS = 500;
|
|
77840
|
+
async function probeLegacyJsonRpcEndpoint(endpoint, timeoutMs = PROBE_TIMEOUT_MS) {
|
|
77841
|
+
return await new Promise((resolve14) => {
|
|
77842
|
+
const socket = connect(endpoint);
|
|
77843
|
+
let settled = false;
|
|
77844
|
+
let buffer = "";
|
|
77845
|
+
const finish = (value) => {
|
|
77846
|
+
if (settled)
|
|
77847
|
+
return;
|
|
77848
|
+
settled = true;
|
|
77849
|
+
clearTimeout(timer);
|
|
77850
|
+
socket.destroy();
|
|
77851
|
+
resolve14(value);
|
|
77852
|
+
};
|
|
77853
|
+
const timer = setTimeout(() => finish(false), timeoutMs);
|
|
77854
|
+
timer.unref?.();
|
|
77855
|
+
socket.once("connect", () => {
|
|
77856
|
+
socket.write(`${JSON.stringify(legacyStatusRequest())}
|
|
77857
|
+
`);
|
|
77858
|
+
});
|
|
77859
|
+
socket.on("data", (chunk) => {
|
|
77860
|
+
buffer += chunk.toString("utf8");
|
|
77861
|
+
const newlineIndex = buffer.indexOf(`
|
|
77862
|
+
`);
|
|
77863
|
+
if (newlineIndex < 0)
|
|
77864
|
+
return;
|
|
77865
|
+
finish(isJsonRpcResponse(buffer.slice(0, newlineIndex).trim()));
|
|
77866
|
+
});
|
|
77867
|
+
socket.once("error", () => finish(false));
|
|
77868
|
+
});
|
|
77869
|
+
}
|
|
77870
|
+
async function attestLegacyDaemonOwnership(input, deps = {}) {
|
|
77871
|
+
if (input.platform === "linux")
|
|
77872
|
+
return await attestLinuxOwnership(input, deps);
|
|
77873
|
+
if (input.platform === "darwin")
|
|
77874
|
+
return await attestMacOwnership(input, deps);
|
|
77875
|
+
return false;
|
|
77876
|
+
}
|
|
77877
|
+
async function attestLinuxOwnership(input, deps) {
|
|
77878
|
+
const readFileImpl = deps.readFile ?? readFile18;
|
|
77879
|
+
const readDirImpl = deps.readDir ?? readdir9;
|
|
77880
|
+
const readLinkImpl = deps.readLink ?? readlink5;
|
|
77881
|
+
const procNetUnix = await readText(readFileImpl, "/proc/net/unix");
|
|
77882
|
+
if (procNetUnix === null)
|
|
77883
|
+
return false;
|
|
77884
|
+
const inode = inodeForEndpoint(procNetUnix, input.endpoint);
|
|
77885
|
+
if (inode === null)
|
|
77886
|
+
return false;
|
|
77887
|
+
const fdEntries = await readDirImpl(`/proc/${input.pid}/fd`).catch(() => null);
|
|
77888
|
+
if (fdEntries === null)
|
|
77889
|
+
return false;
|
|
77890
|
+
let ownsEndpoint = false;
|
|
77891
|
+
for (const fdEntry of fdEntries) {
|
|
77892
|
+
const target = await readLinkImpl(`/proc/${input.pid}/fd/${fdEntry}`).catch(() => null);
|
|
77893
|
+
if (target !== `socket:[${inode}]`)
|
|
77894
|
+
continue;
|
|
77895
|
+
ownsEndpoint = true;
|
|
77896
|
+
break;
|
|
77897
|
+
}
|
|
77898
|
+
if (!ownsEndpoint)
|
|
77899
|
+
return false;
|
|
77900
|
+
const cmdline = await readBinary(readFileImpl, `/proc/${input.pid}/cmdline`);
|
|
77901
|
+
if (cmdline === null)
|
|
77902
|
+
return false;
|
|
77903
|
+
return isNodeCliDaemonArgv(splitCmdline(cmdline));
|
|
77904
|
+
}
|
|
77905
|
+
async function attestMacOwnership(input, deps) {
|
|
77906
|
+
const executeFileImpl = deps.executeFile ?? execFile2;
|
|
77907
|
+
const filteredLsofOutput = await executeForStdout(executeFileImpl, "/usr/sbin/lsof", [
|
|
77908
|
+
"-a",
|
|
77909
|
+
"-n",
|
|
77910
|
+
"-P",
|
|
77911
|
+
"-p",
|
|
77912
|
+
String(input.pid),
|
|
77913
|
+
"-U",
|
|
77914
|
+
"-Fn",
|
|
77915
|
+
"--",
|
|
77916
|
+
input.endpoint
|
|
77917
|
+
]);
|
|
77918
|
+
const lsofOutput = filteredLsofOutput ?? await executeForStdout(executeFileImpl, "/usr/sbin/lsof", [
|
|
77919
|
+
"-a",
|
|
77920
|
+
"-n",
|
|
77921
|
+
"-P",
|
|
77922
|
+
"-p",
|
|
77923
|
+
String(input.pid),
|
|
77924
|
+
"-U",
|
|
77925
|
+
"-Fn"
|
|
77926
|
+
]);
|
|
77927
|
+
if (lsofOutput === null || !lsofShowsUnixEndpoint(lsofOutput, input.pid, input.endpoint))
|
|
77928
|
+
return false;
|
|
77929
|
+
const commandOutput = await executeForStdout(executeFileImpl, "/bin/ps", ["-p", String(input.pid), "-o", "command="]);
|
|
77930
|
+
if (commandOutput === null)
|
|
77931
|
+
return false;
|
|
77932
|
+
return isNodeCliDaemonCommand(commandOutput.trim());
|
|
77933
|
+
}
|
|
77934
|
+
function legacyStatusRequest() {
|
|
77935
|
+
return {
|
|
77936
|
+
jsonrpc: "2.0",
|
|
77937
|
+
id: 1,
|
|
77938
|
+
method: "tools/call",
|
|
77939
|
+
params: { name: "status", arguments: {} }
|
|
77940
|
+
};
|
|
77941
|
+
}
|
|
77942
|
+
function isJsonRpcResponse(line) {
|
|
77943
|
+
if (line.length === 0)
|
|
77944
|
+
return false;
|
|
77799
77945
|
try {
|
|
77800
|
-
|
|
77946
|
+
const parsed = JSON.parse(line);
|
|
77947
|
+
return parsed.jsonrpc === "2.0" && parsed.id === 1 && (Object.hasOwn(parsed, "result") || Object.hasOwn(parsed, "error"));
|
|
77801
77948
|
} catch {
|
|
77802
|
-
return
|
|
77949
|
+
return false;
|
|
77803
77950
|
}
|
|
77804
|
-
|
|
77805
|
-
|
|
77806
|
-
|
|
77807
|
-
const
|
|
77808
|
-
if (
|
|
77809
|
-
|
|
77951
|
+
}
|
|
77952
|
+
function inodeForEndpoint(procNetUnix, endpoint) {
|
|
77953
|
+
for (const line of procNetUnix.split(/\r?\n/)) {
|
|
77954
|
+
const trimmed = line.trim();
|
|
77955
|
+
if (trimmed.length === 0 || trimmed.startsWith("Num"))
|
|
77956
|
+
continue;
|
|
77957
|
+
const fields = trimmed.split(/\s+/);
|
|
77958
|
+
if (fields.length < 8 || fields[7] !== endpoint)
|
|
77959
|
+
continue;
|
|
77960
|
+
return fields[6] ?? null;
|
|
77961
|
+
}
|
|
77962
|
+
return null;
|
|
77963
|
+
}
|
|
77964
|
+
function splitCmdline(buffer) {
|
|
77965
|
+
return buffer.toString("utf8").split("\x00").filter((value) => value.length > 0);
|
|
77966
|
+
}
|
|
77967
|
+
function isNodeCliDaemonArgv(argv) {
|
|
77968
|
+
if (argv.length < 2 || !argv.includes("daemon"))
|
|
77969
|
+
return false;
|
|
77970
|
+
const executable = basename10(argv[0] ?? "");
|
|
77971
|
+
if (!/^node(?:\.exe)?$/i.test(executable))
|
|
77972
|
+
return false;
|
|
77973
|
+
return argv.some((value) => value === "cli.js" || value.endsWith("/cli.js") || value.endsWith("\\cli.js"));
|
|
77974
|
+
}
|
|
77975
|
+
function lsofShowsUnixEndpoint(output, pid, endpoint) {
|
|
77976
|
+
const lines = output.split(/\r?\n/).filter((line) => line.length > 0);
|
|
77977
|
+
const endpointName = basename10(endpoint);
|
|
77978
|
+
return lines.includes(`p${pid}`) && lines.some((line) => line === `n${endpoint}` || line === `n${endpointName}`);
|
|
77979
|
+
}
|
|
77980
|
+
function isNodeCliDaemonCommand(command) {
|
|
77981
|
+
return /\bnode(?:\.exe)?\b/i.test(command) && /\bcli\.js\b/.test(command) && /\bdaemon\b/.test(command);
|
|
77982
|
+
}
|
|
77983
|
+
async function executeForStdout(executeFileImpl, file2, args) {
|
|
77984
|
+
return await new Promise((resolve14) => {
|
|
77985
|
+
executeFileImpl(file2, [...args], { encoding: "utf8", maxBuffer: 1024 * 1024, timeout: 1000 }, (error, stdout) => {
|
|
77986
|
+
if (error !== null) {
|
|
77987
|
+
resolve14(null);
|
|
77988
|
+
return;
|
|
77989
|
+
}
|
|
77990
|
+
resolve14(stdout);
|
|
77991
|
+
});
|
|
77992
|
+
});
|
|
77993
|
+
}
|
|
77994
|
+
async function readText(readFileImpl, path7) {
|
|
77995
|
+
return await readFileImpl(path7, "utf8").catch(() => null);
|
|
77996
|
+
}
|
|
77997
|
+
async function readBinary(readFileImpl, path7) {
|
|
77998
|
+
return await readFileImpl(path7).catch(() => null);
|
|
77999
|
+
}
|
|
78000
|
+
|
|
78001
|
+
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
|
|
78002
|
+
var LEGACY_EXIT_WAIT_TIMEOUT_MS = 5000;
|
|
78003
|
+
var LEGACY_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
|
|
78004
|
+
async function reapLspDaemons(codexHome, deps = {}) {
|
|
78005
|
+
const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
|
|
78006
|
+
const platform = deps.platform ?? process.platform;
|
|
78007
|
+
const tmpDir = deps.tmpDir ?? tmpdir3();
|
|
78008
|
+
const probe2 = deps.probeLegacyJsonRpc ?? probeLegacyJsonRpcEndpoint;
|
|
78009
|
+
const attest = deps.attestLegacyDaemonOwnership ?? ((input) => attestLegacyDaemonOwnership(input));
|
|
78010
|
+
const killProcess = deps.killProcess ?? sendSigterm;
|
|
78011
|
+
const waitForProcessExit = deps.waitForProcessExit ?? defaultWaitForProcessExit;
|
|
78012
|
+
const entries = await readdir10(daemonRoot, { withFileTypes: true }).catch(() => []);
|
|
78013
|
+
const results = [];
|
|
78014
|
+
for (const entry of [...entries].sort((left, right) => left.name.localeCompare(right.name))) {
|
|
78015
|
+
const versionPath = join48(daemonRoot, entry.name);
|
|
78016
|
+
const parsedVersion = parseVersionEntry(entry.name);
|
|
78017
|
+
if (parsedVersion === null || !entry.isDirectory()) {
|
|
78018
|
+
await removeVersionDir(versionPath);
|
|
78019
|
+
results.push(removed(entry.name, "removed invalid legacy version entry"));
|
|
78020
|
+
continue;
|
|
78021
|
+
}
|
|
78022
|
+
const metadata = await readLegacyMetadata({ versionPath, version: parsedVersion, codexHome, platform, tmpDir });
|
|
78023
|
+
if (metadata.kind === "remove") {
|
|
78024
|
+
await removeVersionDir(versionPath);
|
|
78025
|
+
results.push(removed(parsedVersion, metadata.reason));
|
|
78026
|
+
continue;
|
|
78027
|
+
}
|
|
78028
|
+
if (!await probe2(metadata.endpoint)) {
|
|
78029
|
+
await removeVersionDir(versionPath);
|
|
78030
|
+
results.push(removed(parsedVersion, "removed stale legacy daemon state"));
|
|
78031
|
+
continue;
|
|
78032
|
+
}
|
|
78033
|
+
if (platform === "win32") {
|
|
78034
|
+
results.push(deferred(parsedVersion, "legacy named pipe responded but Windows cannot prove pid ownership safely"));
|
|
78035
|
+
continue;
|
|
77810
78036
|
}
|
|
77811
|
-
await
|
|
78037
|
+
const owned = await attest({ pid: metadata.pid, endpoint: metadata.endpoint, platform });
|
|
78038
|
+
if (!owned) {
|
|
78039
|
+
results.push(deferred(parsedVersion, "legacy endpoint responded but pid ownership was not proven"));
|
|
78040
|
+
continue;
|
|
78041
|
+
}
|
|
78042
|
+
if (!killProcess(metadata.pid)) {
|
|
78043
|
+
await removeVersionDir(versionPath);
|
|
78044
|
+
results.push(removed(parsedVersion, "removed stale legacy daemon state"));
|
|
78045
|
+
continue;
|
|
78046
|
+
}
|
|
78047
|
+
if (!await waitForProcessExit(metadata.pid, LEGACY_EXIT_WAIT_TIMEOUT_MS)) {
|
|
78048
|
+
results.push(deferred(parsedVersion, `timed out waiting ${LEGACY_EXIT_WAIT_TIMEOUT_MS}ms for the proven legacy daemon to exit`));
|
|
78049
|
+
continue;
|
|
78050
|
+
}
|
|
78051
|
+
await removeVersionDir(versionPath);
|
|
78052
|
+
results.push(terminated(parsedVersion, "terminated proven owned legacy daemon"));
|
|
77812
78053
|
}
|
|
77813
|
-
return
|
|
78054
|
+
return results;
|
|
77814
78055
|
}
|
|
77815
|
-
|
|
77816
|
-
|
|
77817
|
-
const content = (await readFile18(path7, "utf8")).trim();
|
|
77818
|
-
return content.length > 0 ? content : null;
|
|
77819
|
-
} catch {
|
|
78056
|
+
function parseVersionEntry(entryName) {
|
|
78057
|
+
if (!entryName.startsWith("v"))
|
|
77820
78058
|
return null;
|
|
78059
|
+
const version = entryName.slice(1);
|
|
78060
|
+
return LEGACY_VERSION_PATTERN.test(version) ? version : null;
|
|
78061
|
+
}
|
|
78062
|
+
async function readLegacyMetadata(input) {
|
|
78063
|
+
const pidText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.pid"));
|
|
78064
|
+
if (pidText === "non_regular")
|
|
78065
|
+
return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
|
|
78066
|
+
if (pidText === null)
|
|
78067
|
+
return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
|
|
78068
|
+
const pid = Number.parseInt(pidText, 10);
|
|
78069
|
+
if (!Number.isInteger(pid) || pid <= 0)
|
|
78070
|
+
return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
|
|
78071
|
+
const endpointText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.endpoint"));
|
|
78072
|
+
if (endpointText === "non_regular")
|
|
78073
|
+
return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
|
|
78074
|
+
if (endpointText === null)
|
|
78075
|
+
return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
|
|
78076
|
+
const allowedEndpoints = legacyEndpointCandidates({
|
|
78077
|
+
version: input.version,
|
|
78078
|
+
versionPath: input.versionPath,
|
|
78079
|
+
platform: input.platform,
|
|
78080
|
+
tmpDir: input.tmpDir
|
|
78081
|
+
});
|
|
78082
|
+
if (!allowedEndpoints.includes(endpointText)) {
|
|
78083
|
+
return { kind: "remove", reason: "removed legacy daemon state with an endpoint outside the frozen vectors" };
|
|
77821
78084
|
}
|
|
78085
|
+
return { kind: "valid", pid, endpoint: endpointText };
|
|
77822
78086
|
}
|
|
77823
|
-
|
|
77824
|
-
|
|
77825
|
-
const
|
|
77826
|
-
|
|
77827
|
-
|
|
77828
|
-
return null;
|
|
78087
|
+
function legacyEndpointCandidates(input) {
|
|
78088
|
+
if (input.platform === "win32") {
|
|
78089
|
+
const normalizedVersionPath = input.versionPath.replaceAll("/", "\\");
|
|
78090
|
+
const digest = shortDigest(normalizedVersionPath);
|
|
78091
|
+
return [`\\\\.\\pipe\\omo-lsp-${input.version}-${digest}`];
|
|
77829
78092
|
}
|
|
78093
|
+
const natural = posix2.join(input.versionPath, "daemon.sock");
|
|
78094
|
+
const hashed = posix2.join(input.tmpDir, `omo-lsp-${input.version}-${shortDigest(input.versionPath)}.sock`);
|
|
78095
|
+
return [natural, hashed];
|
|
77830
78096
|
}
|
|
77831
|
-
function
|
|
77832
|
-
|
|
77833
|
-
|
|
77834
|
-
|
|
77835
|
-
|
|
77836
|
-
|
|
77837
|
-
|
|
77838
|
-
|
|
77839
|
-
|
|
77840
|
-
|
|
77841
|
-
|
|
77842
|
-
|
|
77843
|
-
|
|
77844
|
-
|
|
77845
|
-
|
|
77846
|
-
|
|
77847
|
-
|
|
77848
|
-
|
|
78097
|
+
async function readRegularTrimmedFile(path7) {
|
|
78098
|
+
const stats = await lstat11(path7).catch(() => null);
|
|
78099
|
+
if (stats === null)
|
|
78100
|
+
return null;
|
|
78101
|
+
if (!stats.isFile())
|
|
78102
|
+
return "non_regular";
|
|
78103
|
+
const content = (await readFile19(path7, "utf8")).trim();
|
|
78104
|
+
return content.length > 0 ? content : null;
|
|
78105
|
+
}
|
|
78106
|
+
function shortDigest(value) {
|
|
78107
|
+
return createHash3("sha256").update(value).digest("hex").slice(0, 16);
|
|
78108
|
+
}
|
|
78109
|
+
async function removeVersionDir(path7) {
|
|
78110
|
+
await rm10(path7, { recursive: true, force: true });
|
|
78111
|
+
}
|
|
78112
|
+
function removed(version, reason) {
|
|
78113
|
+
return { version, status: "removed", reason };
|
|
78114
|
+
}
|
|
78115
|
+
function terminated(version, reason) {
|
|
78116
|
+
return { version, status: "terminated", reason };
|
|
78117
|
+
}
|
|
78118
|
+
function deferred(version, reason) {
|
|
78119
|
+
return { version, status: "deferred", reason };
|
|
77849
78120
|
}
|
|
77850
78121
|
function sendSigterm(pid) {
|
|
77851
78122
|
try {
|
|
@@ -77855,6 +78126,24 @@ function sendSigterm(pid) {
|
|
|
77855
78126
|
return false;
|
|
77856
78127
|
}
|
|
77857
78128
|
}
|
|
78129
|
+
async function defaultWaitForProcessExit(pid, timeoutMs) {
|
|
78130
|
+
const deadline = Date.now() + timeoutMs;
|
|
78131
|
+
for (;; ) {
|
|
78132
|
+
if (!processIsRunning(pid))
|
|
78133
|
+
return true;
|
|
78134
|
+
if (Date.now() >= deadline)
|
|
78135
|
+
return false;
|
|
78136
|
+
await new Promise((resolve14) => setTimeout(resolve14, 100));
|
|
78137
|
+
}
|
|
78138
|
+
}
|
|
78139
|
+
function processIsRunning(pid) {
|
|
78140
|
+
try {
|
|
78141
|
+
process.kill(pid, 0);
|
|
78142
|
+
return true;
|
|
78143
|
+
} catch {
|
|
78144
|
+
return false;
|
|
78145
|
+
}
|
|
78146
|
+
}
|
|
77858
78147
|
|
|
77859
78148
|
// packages/omo-codex/src/install/codex-installer-bin-dir.ts
|
|
77860
78149
|
import { homedir as homedir5 } from "os";
|
|
@@ -77872,7 +78161,7 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
77872
78161
|
}
|
|
77873
78162
|
|
|
77874
78163
|
// packages/omo-codex/src/install/codex-git-bash-hooks.ts
|
|
77875
|
-
import { readFile as
|
|
78164
|
+
import { readFile as readFile20, writeFile as writeFile11 } from "fs/promises";
|
|
77876
78165
|
import { join as join50 } from "path";
|
|
77877
78166
|
var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
|
|
77878
78167
|
"./hooks/pre-tool-use-recommending-git-bash-mcp.json",
|
|
@@ -77882,7 +78171,7 @@ async function removeGitBashHooksOffWindows(input) {
|
|
|
77882
78171
|
if (input.platform === "win32")
|
|
77883
78172
|
return;
|
|
77884
78173
|
const manifestPath = join50(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
77885
|
-
const parsed = JSON.parse(await
|
|
78174
|
+
const parsed = JSON.parse(await readFile20(manifestPath, "utf8"));
|
|
77886
78175
|
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
|
|
77887
78176
|
return;
|
|
77888
78177
|
const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
|
|
@@ -78076,7 +78365,16 @@ async function runCodexInstaller(options = {}) {
|
|
|
78076
78365
|
pluginNames: marketplace.plugins.map((plugin) => plugin.name)
|
|
78077
78366
|
});
|
|
78078
78367
|
}
|
|
78079
|
-
await reapLspDaemons(codexHome).catch(() =>
|
|
78368
|
+
const legacyDaemonCleanup = await reapLspDaemons(codexHome).catch((error) => {
|
|
78369
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
78370
|
+
log4(`Warning: skipped legacy Codex LSP daemon cleanup: ${message}`);
|
|
78371
|
+
return [];
|
|
78372
|
+
});
|
|
78373
|
+
for (const cleanup of legacyDaemonCleanup) {
|
|
78374
|
+
if (cleanup.status !== "deferred")
|
|
78375
|
+
continue;
|
|
78376
|
+
log4(`Warning: deferred legacy Codex LSP daemon cleanup for v${cleanup.version}: ${cleanup.reason}`);
|
|
78377
|
+
}
|
|
78080
78378
|
const marketplaceRoot = join55(codexHome, "plugins", "cache", marketplace.name);
|
|
78081
78379
|
await writeCachedMarketplaceManifest({
|
|
78082
78380
|
marketplaceName: marketplace.name,
|
|
@@ -78168,10 +78466,10 @@ function codexMarketplaceSource(marketplaceRoot) {
|
|
|
78168
78466
|
}
|
|
78169
78467
|
// packages/omo-codex/src/install/codex-installation-detection.ts
|
|
78170
78468
|
init_bun_which_shim();
|
|
78171
|
-
import { execFile as
|
|
78469
|
+
import { execFile as execFile3 } from "child_process";
|
|
78172
78470
|
import { existsSync as existsSync31 } from "fs";
|
|
78173
78471
|
import { homedir as homedir7 } from "os";
|
|
78174
|
-
import { posix as
|
|
78472
|
+
import { posix as posix4, win32 as win323 } from "path";
|
|
78175
78473
|
var CODEX_PATH_CHECK_LABEL = "codex (PATH)";
|
|
78176
78474
|
var WINDOWS_START_APPS_ARGS = [
|
|
78177
78475
|
"-NoProfile",
|
|
@@ -78248,11 +78546,11 @@ async function findWindowsCodexStartApp(runCommand) {
|
|
|
78248
78546
|
}
|
|
78249
78547
|
}
|
|
78250
78548
|
function macCodexAppPaths(homeDir) {
|
|
78251
|
-
return ["/Applications/Codex.app",
|
|
78549
|
+
return ["/Applications/Codex.app", posix4.join(homeDir, "Applications", "Codex.app")];
|
|
78252
78550
|
}
|
|
78253
78551
|
function macCodexDmgPaths(homeDir) {
|
|
78254
|
-
const downloads =
|
|
78255
|
-
return [
|
|
78552
|
+
const downloads = posix4.join(homeDir, "Downloads");
|
|
78553
|
+
return [posix4.join(downloads, "codex.dmg"), posix4.join(downloads, "Codex.dmg")];
|
|
78256
78554
|
}
|
|
78257
78555
|
function windowsCodexCliPaths(env3) {
|
|
78258
78556
|
const candidates = [];
|
|
@@ -78290,18 +78588,18 @@ function dedupe(values) {
|
|
|
78290
78588
|
}
|
|
78291
78589
|
function defaultRunCommand2(command, args) {
|
|
78292
78590
|
return new Promise((resolve16) => {
|
|
78293
|
-
|
|
78591
|
+
execFile3(command, [...args], { encoding: "utf8", windowsHide: true }, (error, stdout) => {
|
|
78294
78592
|
resolve16({ success: error === null, stdout });
|
|
78295
78593
|
});
|
|
78296
78594
|
});
|
|
78297
78595
|
}
|
|
78298
78596
|
// packages/omo-codex/src/install/codex-cleanup.ts
|
|
78299
|
-
import { lstat as
|
|
78597
|
+
import { lstat as lstat13, readFile as readFile22, readdir as readdir11, rm as rm11, rmdir } from "fs/promises";
|
|
78300
78598
|
import { homedir as homedir8 } from "os";
|
|
78301
78599
|
import { isAbsolute as isAbsolute11, join as join57, relative as relative7, resolve as resolve17 } from "path";
|
|
78302
78600
|
|
|
78303
78601
|
// packages/omo-codex/src/install/codex-cleanup-config.ts
|
|
78304
|
-
import { lstat as
|
|
78602
|
+
import { lstat as lstat12, mkdir as mkdir8, readFile as readFile21, writeFile as writeFile12 } from "fs/promises";
|
|
78305
78603
|
import { dirname as dirname19 } from "path";
|
|
78306
78604
|
var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
|
|
78307
78605
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
|
|
@@ -78334,7 +78632,7 @@ function cleanupCodexLightConfigText(config) {
|
|
|
78334
78632
|
async function cleanupCodexConfig(configPath, now) {
|
|
78335
78633
|
if (!await configExists(configPath))
|
|
78336
78634
|
return { changed: false };
|
|
78337
|
-
const original = await
|
|
78635
|
+
const original = await readFile21(configPath, "utf8");
|
|
78338
78636
|
const next = cleanupCodexLightConfigText(original);
|
|
78339
78637
|
if (next === original)
|
|
78340
78638
|
return { changed: false };
|
|
@@ -78403,7 +78701,7 @@ function formatBackupTimestamp2(date) {
|
|
|
78403
78701
|
}
|
|
78404
78702
|
async function configExists(path7) {
|
|
78405
78703
|
try {
|
|
78406
|
-
await
|
|
78704
|
+
await lstat12(path7);
|
|
78407
78705
|
return true;
|
|
78408
78706
|
} catch (error) {
|
|
78409
78707
|
if (nodeErrorCode5(error) === "ENOENT")
|
|
@@ -78521,7 +78819,7 @@ async function collectBootstrapDataDirsByGlob(codexHome) {
|
|
|
78521
78819
|
async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
78522
78820
|
if (depth > BOOTSTRAP_DATA_GLOB_MAX_DEPTH)
|
|
78523
78821
|
return;
|
|
78524
|
-
const entries = await
|
|
78822
|
+
const entries = await readdir11(directory, { withFileTypes: true }).catch(() => null);
|
|
78525
78823
|
if (entries === null)
|
|
78526
78824
|
return;
|
|
78527
78825
|
for (const entry of entries) {
|
|
@@ -78553,7 +78851,7 @@ async function removeManagedPathBestEffort(path7, seams) {
|
|
|
78553
78851
|
}
|
|
78554
78852
|
async function attemptRemove(path7) {
|
|
78555
78853
|
try {
|
|
78556
|
-
if (await
|
|
78854
|
+
if (await lstat13(path7).catch(() => null) === null)
|
|
78557
78855
|
return false;
|
|
78558
78856
|
await rm11(path7, { recursive: true, force: true });
|
|
78559
78857
|
return true;
|
|
@@ -78579,7 +78877,7 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
|
78579
78877
|
];
|
|
78580
78878
|
const versionRoot = join57(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
|
|
78581
78879
|
if (await exists6(versionRoot)) {
|
|
78582
|
-
const entries = await
|
|
78880
|
+
const entries = await readdir11(versionRoot, { withFileTypes: true });
|
|
78583
78881
|
for (const entry of entries) {
|
|
78584
78882
|
if (entry.isDirectory())
|
|
78585
78883
|
manifestPaths.push(join57(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
|
|
@@ -78599,20 +78897,20 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
|
78599
78897
|
async function readManagedAgentPathsFromConfig(codexHome, configPath) {
|
|
78600
78898
|
if (!await exists6(configPath))
|
|
78601
78899
|
return [];
|
|
78602
|
-
const config = await
|
|
78900
|
+
const config = await readFile22(configPath, "utf8");
|
|
78603
78901
|
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join57(codexHome, "agents", `${agentName}.toml`));
|
|
78604
78902
|
}
|
|
78605
78903
|
async function readInstalledAgentManifest(manifestPath) {
|
|
78606
78904
|
if (!await exists6(manifestPath))
|
|
78607
78905
|
return [];
|
|
78608
|
-
const parsed = JSON.parse(await
|
|
78906
|
+
const parsed = JSON.parse(await readFile22(manifestPath, "utf8"));
|
|
78609
78907
|
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
|
|
78610
78908
|
return [];
|
|
78611
78909
|
return parsed.agents.filter((path7) => typeof path7 === "string");
|
|
78612
78910
|
}
|
|
78613
78911
|
async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
78614
78912
|
const agentsDir = join57(codexHome, "agents");
|
|
78615
|
-
const
|
|
78913
|
+
const removed2 = [];
|
|
78616
78914
|
const skipped2 = [];
|
|
78617
78915
|
for (const path7 of paths) {
|
|
78618
78916
|
if (!isSafeManagedAgentPath(agentsDir, path7)) {
|
|
@@ -78627,9 +78925,9 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
|
78627
78925
|
continue;
|
|
78628
78926
|
}
|
|
78629
78927
|
await rm11(path7, { force: true });
|
|
78630
|
-
|
|
78928
|
+
removed2.push(path7);
|
|
78631
78929
|
}
|
|
78632
|
-
return { removed, skipped: skipped2 };
|
|
78930
|
+
return { removed: removed2, skipped: skipped2 };
|
|
78633
78931
|
}
|
|
78634
78932
|
function isSafeManagedAgentPath(agentsDir, path7) {
|
|
78635
78933
|
if (!isAbsolute11(path7))
|
|
@@ -78647,7 +78945,7 @@ async function exists6(path7) {
|
|
|
78647
78945
|
}
|
|
78648
78946
|
async function maybeLstat2(path7) {
|
|
78649
78947
|
try {
|
|
78650
|
-
return await
|
|
78948
|
+
return await lstat13(path7);
|
|
78651
78949
|
} catch (error) {
|
|
78652
78950
|
if (nodeErrorCode6(error) === "ENOENT")
|
|
78653
78951
|
return null;
|
|
@@ -78662,18 +78960,26 @@ function nodeErrorCode6(error) {
|
|
|
78662
78960
|
// packages/omo-codex/src/install/codex-git-bash-mcp-env.ts
|
|
78663
78961
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
78664
78962
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
78665
|
-
import { execFile as
|
|
78963
|
+
import { execFile as execFile4 } from "child_process";
|
|
78666
78964
|
import { constants as constants7, existsSync as existsSync32 } from "fs";
|
|
78667
|
-
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as
|
|
78965
|
+
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile23, rename as rename5, writeFile as writeFile13 } from "fs/promises";
|
|
78668
78966
|
import { homedir as homedir9 } from "os";
|
|
78669
78967
|
import { dirname as dirname21, join as join58, resolve as resolve18 } from "path";
|
|
78670
78968
|
import { fileURLToPath } from "url";
|
|
78671
78969
|
import { promisify as promisify2 } from "util";
|
|
78672
|
-
var execFileAsync2 = promisify2(
|
|
78970
|
+
var execFileAsync2 = promisify2(execFile4);
|
|
78673
78971
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
78674
78972
|
join58("extensions", "omo.js"),
|
|
78675
78973
|
join58("skills", "ultrawork", "SKILL.md"),
|
|
78676
|
-
join58("skills", "ulw-loop", "SKILL.md")
|
|
78974
|
+
join58("skills", "ulw-loop", "SKILL.md"),
|
|
78975
|
+
join58("runtime", "lsp-daemon", "dist", "cli.js"),
|
|
78976
|
+
join58("runtime", "lsp-daemon", "dist", "index.js"),
|
|
78977
|
+
join58("runtime", "lsp-daemon", "dist", "index.d.ts"),
|
|
78978
|
+
join58("runtime", "lsp-daemon", "dist", "daemon-client.js"),
|
|
78979
|
+
join58("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
|
|
78980
|
+
join58("runtime", "lsp-daemon", "dist", "package.json"),
|
|
78981
|
+
join58("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
78982
|
+
join58("scripts", "install.mjs")
|
|
78677
78983
|
];
|
|
78678
78984
|
async function runSenpiInstaller(options = {}) {
|
|
78679
78985
|
const context = resolveInstallContext(options);
|
|
@@ -78697,7 +79003,8 @@ async function runSenpiInstaller(options = {}) {
|
|
|
78697
79003
|
}
|
|
78698
79004
|
function resolveInstallContext(options) {
|
|
78699
79005
|
const env3 = options.env ?? process.env;
|
|
78700
|
-
const
|
|
79006
|
+
const allowBuild = options.pluginPath === undefined;
|
|
79007
|
+
const repoRoot = resolve18(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname21(fileURLToPath(import.meta.url))) : dirname21(resolve18(options.pluginPath))));
|
|
78701
79008
|
const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join58(homedir9(), ".senpi", "agent"));
|
|
78702
79009
|
const pluginPath = resolve18(options.pluginPath ?? join58(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
78703
79010
|
return {
|
|
@@ -78706,6 +79013,7 @@ function resolveInstallContext(options) {
|
|
|
78706
79013
|
agentDir,
|
|
78707
79014
|
settingsPath: join58(agentDir, "settings.json"),
|
|
78708
79015
|
pluginPath,
|
|
79016
|
+
allowBuild,
|
|
78709
79017
|
runCommand: options.runCommand ?? defaultRunCommand3
|
|
78710
79018
|
};
|
|
78711
79019
|
}
|
|
@@ -78713,8 +79021,13 @@ async function ensurePluginArtifacts(context) {
|
|
|
78713
79021
|
const missing = await hasMissingPluginArtifact(context.pluginPath);
|
|
78714
79022
|
if (!missing)
|
|
78715
79023
|
return;
|
|
79024
|
+
if (!context.allowBuild) {
|
|
79025
|
+
throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
|
|
79026
|
+
}
|
|
78716
79027
|
await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
78717
79028
|
await context.runCommand("node", [join58(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
79029
|
+
await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
|
|
79030
|
+
await context.runCommand("node", [join58(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
|
|
78718
79031
|
}
|
|
78719
79032
|
async function hasMissingPluginArtifact(pluginPath) {
|
|
78720
79033
|
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
@@ -78733,7 +79046,7 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
78733
79046
|
async function readSettings(settingsPath) {
|
|
78734
79047
|
let raw;
|
|
78735
79048
|
try {
|
|
78736
|
-
raw = await
|
|
79049
|
+
raw = await readFile23(settingsPath, "utf8");
|
|
78737
79050
|
} catch (error) {
|
|
78738
79051
|
if (isErrno(error, "ENOENT"))
|
|
78739
79052
|
return {};
|
|
@@ -78812,7 +79125,7 @@ function isErrno(error, code) {
|
|
|
78812
79125
|
return error instanceof Error && "code" in error && error.code === code;
|
|
78813
79126
|
}
|
|
78814
79127
|
// packages/omo-opencode/src/cli/star-request.ts
|
|
78815
|
-
import { execFile as
|
|
79128
|
+
import { execFile as execFile5 } from "child_process";
|
|
78816
79129
|
import { promisify as promisify3 } from "util";
|
|
78817
79130
|
var STAR_REPOSITORIES = [
|
|
78818
79131
|
"code-yeongyu/oh-my-openagent",
|
|
@@ -78824,7 +79137,7 @@ var PLATFORM_REPOSITORIES = {
|
|
|
78824
79137
|
both: STAR_REPOSITORIES,
|
|
78825
79138
|
senpi: STAR_REPOSITORIES
|
|
78826
79139
|
};
|
|
78827
|
-
var execFileAsync3 = promisify3(
|
|
79140
|
+
var execFileAsync3 = promisify3(execFile5);
|
|
78828
79141
|
async function runGitHubStarCommand(repository) {
|
|
78829
79142
|
await execFileAsync3("gh", ["api", "--silent", "--method", "PUT", `/user/starred/${repository}`]);
|
|
78830
79143
|
}
|
|
@@ -97194,7 +97507,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
97194
97507
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
97195
97508
|
init_bun_which_shim();
|
|
97196
97509
|
init_spawn_with_windows_hide();
|
|
97197
|
-
import { delimiter as delimiter2, dirname as dirname23, posix as
|
|
97510
|
+
import { delimiter as delimiter2, dirname as dirname23, posix as posix5, win32 as win324 } from "path";
|
|
97198
97511
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
97199
97512
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
97200
97513
|
function getCommandCandidates(platform) {
|
|
@@ -97205,7 +97518,7 @@ function getCommandCandidates(platform) {
|
|
|
97205
97518
|
function getPathTools(platform) {
|
|
97206
97519
|
if (platform === "win32")
|
|
97207
97520
|
return win324;
|
|
97208
|
-
return
|
|
97521
|
+
return posix5;
|
|
97209
97522
|
}
|
|
97210
97523
|
function collectCandidateBinaryPaths(pathEnv, which2 = bunWhich, platform = process.platform) {
|
|
97211
97524
|
const seen = new Set;
|
|
@@ -100364,12 +100677,12 @@ import { dirname as dirname30, join as join79 } from "path";
|
|
|
100364
100677
|
|
|
100365
100678
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
100366
100679
|
import { join as join78 } from "path";
|
|
100367
|
-
import { homedir as homedir18, tmpdir as
|
|
100680
|
+
import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
|
|
100368
100681
|
init_binary_downloader();
|
|
100369
100682
|
init_logger2();
|
|
100370
100683
|
init_plugin_identity();
|
|
100371
100684
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
100372
|
-
var DEBUG_FILE = join78(
|
|
100685
|
+
var DEBUG_FILE = join78(tmpdir4(), "comment-checker-debug.log");
|
|
100373
100686
|
function getCacheDir2() {
|
|
100374
100687
|
if (process.platform === "win32") {
|
|
100375
100688
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
@@ -100606,13 +100919,14 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
100606
100919
|
}
|
|
100607
100920
|
|
|
100608
100921
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
100609
|
-
import { readFileSync as
|
|
100922
|
+
import { readFileSync as readFileSync39 } from "fs";
|
|
100610
100923
|
import { join as join80 } from "path";
|
|
100611
100924
|
|
|
100612
100925
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
100613
|
-
import { existsSync as existsSync56 } from "fs";
|
|
100926
|
+
import { existsSync as existsSync56, readFileSync as readFileSync38 } from "fs";
|
|
100614
100927
|
import { delimiter as delimiter3, dirname as dirname31, resolve as resolve21 } from "path";
|
|
100615
100928
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
100929
|
+
init_opencode_config_dir();
|
|
100616
100930
|
|
|
100617
100931
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
100618
100932
|
function normalizeCliPath(path14) {
|
|
@@ -100624,7 +100938,7 @@ function hasCliSuffix(candidatePath, suffix) {
|
|
|
100624
100938
|
|
|
100625
100939
|
// packages/omo-opencode/src/mcp/runtime-executable.ts
|
|
100626
100940
|
init_bun_which_shim();
|
|
100627
|
-
import { basename as
|
|
100941
|
+
import { basename as basename13 } from "path";
|
|
100628
100942
|
var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
|
|
100629
100943
|
function isUnsafeCommandName2(commandName) {
|
|
100630
100944
|
if (commandName.length === 0)
|
|
@@ -100640,7 +100954,7 @@ function isUnsafeCommandName2(commandName) {
|
|
|
100640
100954
|
return false;
|
|
100641
100955
|
}
|
|
100642
100956
|
function isNodeExecPath(execPath) {
|
|
100643
|
-
return NODE_EXECUTABLE_NAMES.has(
|
|
100957
|
+
return NODE_EXECUTABLE_NAMES.has(basename13(execPath).toLowerCase());
|
|
100644
100958
|
}
|
|
100645
100959
|
function resolveRuntimeExecutable(commandName, options = {}) {
|
|
100646
100960
|
if (isUnsafeCommandName2(commandName)) {
|
|
@@ -100710,8 +101024,15 @@ var LSP_TOOLS_PACKAGE_REL = "packages/lsp-tools-mcp";
|
|
|
100710
101024
|
var DIST_CLI_REL = "dist/cli.js";
|
|
100711
101025
|
var SOURCE_CLI_REL = "src/cli.ts";
|
|
100712
101026
|
var PROJECT_LSP_CONFIGS = [".opencode/lsp.json", ".omo/lsp.json", ".omo/lsp-client.json"];
|
|
101027
|
+
var DAEMON_PACKAGE_NAME = "@code-yeongyu/lsp-daemon";
|
|
101028
|
+
var OMO_LSP_DAEMON_CLI = "OMO_LSP_DAEMON_CLI";
|
|
101029
|
+
var OMO_LSP_DAEMON_VERSION = "OMO_LSP_DAEMON_VERSION";
|
|
101030
|
+
var DaemonPackageSchema = exports_external.object({
|
|
101031
|
+
version: exports_external.string().min(1)
|
|
101032
|
+
});
|
|
100713
101033
|
var LSP_BOOTSTRAP_SCRIPT = [
|
|
100714
101034
|
"const { existsSync } = require('node:fs')",
|
|
101035
|
+
"const { createRequire } = require('node:module')",
|
|
100715
101036
|
"const { join } = require('node:path')",
|
|
100716
101037
|
"const { spawnSync } = require('node:child_process')",
|
|
100717
101038
|
"const root = process.argv[1]",
|
|
@@ -100720,16 +101041,18 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
100720
101041
|
`const toolsPackage = join(root, '${LSP_TOOLS_PACKAGE_REL}')`,
|
|
100721
101042
|
`const daemonPackage = join(root, '${PACKAGE_REL}')`,
|
|
100722
101043
|
"const toolsDist = join(toolsPackage, 'dist/cli.js')",
|
|
100723
|
-
"const
|
|
101044
|
+
"const daemonPackageJson = join(daemonPackage, 'package.json')",
|
|
100724
101045
|
"const daemonSource = join(daemonPackage, 'src/cli.ts')",
|
|
100725
101046
|
"const run = (command, args, stdio) => spawnSync(command, args, { cwd: root, env: process.env, stdio })",
|
|
100726
101047
|
"const finish = (result) => { if (result.error) { console.error(result.error.message); process.exit(1) } process.exit(result.status ?? 1) }",
|
|
100727
101048
|
"const runIfAvailable = (command, args) => { const result = run(command, args, 'inherit'); if (result.error) return false; finish(result); return true }",
|
|
100728
|
-
|
|
100729
|
-
"
|
|
101049
|
+
`const resolveDaemonCli = () => { try { return createRequire(daemonPackageJson).resolve('${DAEMON_PACKAGE_NAME}/cli') } catch (error) { if (error instanceof Error) return null; throw error } }`,
|
|
101050
|
+
"const daemonCli = existsSync(daemonPackageJson) ? resolveDaemonCli() : null",
|
|
101051
|
+
"if (daemonCli) finish(run(process.execPath, [daemonCli, 'mcp'], 'inherit'))",
|
|
101052
|
+
`if (existsSync(daemonSource) && existsSync(toolsDist)) { const pkg = require(daemonPackageJson); process.env.${OMO_LSP_DAEMON_CLI} = daemonSource; process.env.${OMO_LSP_DAEMON_VERSION} = pkg.version; runIfAvailable(bun, [daemonSource, 'mcp']) }`,
|
|
100730
101053
|
"const steps = [[npm, ['--prefix', toolsPackage, 'install', '--no-package-lock', '--no-audit', '--no-fund']], [npm, ['--prefix', toolsPackage, 'run', 'build']], [npm, ['--prefix', daemonPackage, 'install', '--no-package-lock', '--no-audit', '--no-fund']], [npm, ['--prefix', daemonPackage, 'run', 'build']]]",
|
|
100731
101054
|
"for (const [command, args] of steps) { const result = run(command, args, ['ignore', 'ignore', 'inherit']); if (result.error || result.status !== 0) finish(result) }",
|
|
100732
|
-
"finish(run(process.execPath, [
|
|
101055
|
+
"finish(run(process.execPath, [resolveDaemonCli(), 'mcp'], 'inherit'))"
|
|
100733
101056
|
].join(";");
|
|
100734
101057
|
function getModuleDirectory(moduleUrl) {
|
|
100735
101058
|
try {
|
|
@@ -100743,6 +101066,16 @@ function getModuleDirectory(moduleUrl) {
|
|
|
100743
101066
|
function findBootstrapRoot(candidates, pathExists) {
|
|
100744
101067
|
return candidates.find((candidate) => pathExists(resolve21(candidate.root, "package.json")))?.root ?? process.cwd();
|
|
100745
101068
|
}
|
|
101069
|
+
function readDaemonPackageVersion(root) {
|
|
101070
|
+
try {
|
|
101071
|
+
const packageJson = JSON.parse(readFileSync38(resolve21(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
101072
|
+
return DaemonPackageSchema.parse(packageJson).version;
|
|
101073
|
+
} catch (error51) {
|
|
101074
|
+
if (!(error51 instanceof Error))
|
|
101075
|
+
throw error51;
|
|
101076
|
+
return null;
|
|
101077
|
+
}
|
|
101078
|
+
}
|
|
100746
101079
|
function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
100747
101080
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
100748
101081
|
const bun = resolveExecutable("bun");
|
|
@@ -100767,7 +101100,7 @@ function resolveLspCommand(options = {}) {
|
|
|
100767
101100
|
sourceCliRel: SOURCE_CLI_REL,
|
|
100768
101101
|
pathExists,
|
|
100769
101102
|
resolveExecutable,
|
|
100770
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL))
|
|
101103
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
|
|
100771
101104
|
}) : [];
|
|
100772
101105
|
const distCandidate = candidates.find((candidate) => hasCliSuffix(candidate.path, DIST_CLI_REL) && candidate.exists);
|
|
100773
101106
|
if (distCandidate) {
|
|
@@ -100781,12 +101114,21 @@ function resolveLspCommand(options = {}) {
|
|
|
100781
101114
|
}
|
|
100782
101115
|
function createLspMcpConfig(options = {}) {
|
|
100783
101116
|
const resolvedCommand = resolveLspCommand(options);
|
|
101117
|
+
const cwd = resolve21(options.cwd ?? process.cwd());
|
|
101118
|
+
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
101119
|
+
const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
|
|
100784
101120
|
return {
|
|
100785
101121
|
type: "local",
|
|
100786
101122
|
command: resolvedCommand.command,
|
|
100787
101123
|
enabled: resolvedCommand.exists,
|
|
100788
101124
|
environment: {
|
|
100789
|
-
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.join(delimiter3)
|
|
101125
|
+
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve21(cwd, configPath)).join(delimiter3),
|
|
101126
|
+
LSP_TOOLS_MCP_USER_CONFIG: resolve21(configDir, "lsp.json"),
|
|
101127
|
+
LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve21(configDir, "lsp-install-decisions.json"),
|
|
101128
|
+
...sourceVersion ? {
|
|
101129
|
+
[OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
|
|
101130
|
+
[OMO_LSP_DAEMON_VERSION]: sourceVersion
|
|
101131
|
+
} : {}
|
|
100790
101132
|
}
|
|
100791
101133
|
};
|
|
100792
101134
|
}
|
|
@@ -100803,7 +101145,7 @@ function readOmoConfig(configDirectory) {
|
|
|
100803
101145
|
return null;
|
|
100804
101146
|
}
|
|
100805
101147
|
try {
|
|
100806
|
-
const content =
|
|
101148
|
+
const content = readFileSync39(detected.path, "utf-8");
|
|
100807
101149
|
return parseJsonc(content);
|
|
100808
101150
|
} catch (error51) {
|
|
100809
101151
|
if (!(error51 instanceof Error)) {
|
|
@@ -100833,7 +101175,7 @@ function getInstalledLspServers(options = {}) {
|
|
|
100833
101175
|
|
|
100834
101176
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
100835
101177
|
init_shared();
|
|
100836
|
-
import { existsSync as existsSync57, readFileSync as
|
|
101178
|
+
import { existsSync as existsSync57, readFileSync as readFileSync40 } from "fs";
|
|
100837
101179
|
import { homedir as homedir20 } from "os";
|
|
100838
101180
|
import { join as join81 } from "path";
|
|
100839
101181
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
@@ -100850,7 +101192,7 @@ function loadUserMcpConfig() {
|
|
|
100850
101192
|
if (!existsSync57(configPath))
|
|
100851
101193
|
continue;
|
|
100852
101194
|
try {
|
|
100853
|
-
const content =
|
|
101195
|
+
const content = readFileSync40(configPath, "utf-8");
|
|
100854
101196
|
const config3 = parseJsonc(content);
|
|
100855
101197
|
if (config3.mcpServers) {
|
|
100856
101198
|
Object.assign(servers, config3.mcpServers);
|
|
@@ -100985,7 +101327,7 @@ async function checkTools() {
|
|
|
100985
101327
|
|
|
100986
101328
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
100987
101329
|
init_src4();
|
|
100988
|
-
import { existsSync as existsSync58, readFileSync as
|
|
101330
|
+
import { existsSync as existsSync58, readFileSync as readFileSync41 } from "fs";
|
|
100989
101331
|
function isTelemetryState(value) {
|
|
100990
101332
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
100991
101333
|
}
|
|
@@ -100995,7 +101337,7 @@ function readLastActiveDay(stateFilePath) {
|
|
|
100995
101337
|
}
|
|
100996
101338
|
let parsed;
|
|
100997
101339
|
try {
|
|
100998
|
-
parsed = JSON.parse(
|
|
101340
|
+
parsed = JSON.parse(readFileSync41(stateFilePath, "utf-8"));
|
|
100999
101341
|
} catch (error51) {
|
|
101000
101342
|
if (error51 instanceof Error) {
|
|
101001
101343
|
return "unreadable";
|
|
@@ -101070,7 +101412,7 @@ function expandHomeDirectory(directoryPath) {
|
|
|
101070
101412
|
// packages/omo-opencode/src/cli/doctor/checks/team-mode.ts
|
|
101071
101413
|
init_shared();
|
|
101072
101414
|
init_plugin_identity();
|
|
101073
|
-
import { readFileSync as
|
|
101415
|
+
import { readFileSync as readFileSync42, promises as fs13 } from "fs";
|
|
101074
101416
|
import path15 from "path";
|
|
101075
101417
|
async function checkTeamMode() {
|
|
101076
101418
|
const config3 = loadTeamModeConfig();
|
|
@@ -101107,7 +101449,7 @@ function loadTeamModeConfig() {
|
|
|
101107
101449
|
if (!configPath)
|
|
101108
101450
|
return { team_mode: undefined };
|
|
101109
101451
|
try {
|
|
101110
|
-
return parseJsonc(
|
|
101452
|
+
return parseJsonc(readFileSync42(configPath, "utf-8"));
|
|
101111
101453
|
} catch (error51) {
|
|
101112
101454
|
if (error51 instanceof Error) {
|
|
101113
101455
|
return { team_mode: undefined };
|
|
@@ -101141,9 +101483,9 @@ async function pathExists(dir) {
|
|
|
101141
101483
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
101142
101484
|
init_src();
|
|
101143
101485
|
import { existsSync as existsSync59 } from "fs";
|
|
101144
|
-
import { lstat as
|
|
101486
|
+
import { lstat as lstat14, readdir as readdir12, readFile as readFile24 } from "fs/promises";
|
|
101145
101487
|
import { homedir as homedir22 } from "os";
|
|
101146
|
-
import { basename as
|
|
101488
|
+
import { basename as basename14, join as join82, resolve as resolve22 } from "path";
|
|
101147
101489
|
// packages/omo-opencode/package.json
|
|
101148
101490
|
var package_default3 = {
|
|
101149
101491
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -101332,7 +101674,7 @@ async function resolveInstalledPluginRoot(codexHome) {
|
|
|
101332
101674
|
const pluginRoot = join82(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
101333
101675
|
if (!existsSync59(pluginRoot))
|
|
101334
101676
|
return null;
|
|
101335
|
-
const versions2 = await
|
|
101677
|
+
const versions2 = await readdir12(pluginRoot, { withFileTypes: true });
|
|
101336
101678
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
101337
101679
|
return candidates.length === 0 ? null : join82(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
101338
101680
|
}
|
|
@@ -101348,7 +101690,7 @@ async function readCodexConfigSummary(configPath) {
|
|
|
101348
101690
|
companionLifecycleHookStateEvents: []
|
|
101349
101691
|
};
|
|
101350
101692
|
}
|
|
101351
|
-
const content = await
|
|
101693
|
+
const content = await readFile24(configPath, "utf8");
|
|
101352
101694
|
return {
|
|
101353
101695
|
exists: true,
|
|
101354
101696
|
marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
|
|
@@ -101371,12 +101713,12 @@ async function readLinkedAgents(codexHome) {
|
|
|
101371
101713
|
const agentsDir = join82(codexHome, "agents");
|
|
101372
101714
|
if (!existsSync59(agentsDir))
|
|
101373
101715
|
return [];
|
|
101374
|
-
const entries = await
|
|
101375
|
-
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) =>
|
|
101716
|
+
const entries = await readdir12(agentsDir, { withFileTypes: true });
|
|
101717
|
+
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename14(entry.name, ".toml")).sort();
|
|
101376
101718
|
}
|
|
101377
101719
|
async function readJson(path16) {
|
|
101378
101720
|
try {
|
|
101379
|
-
const parsed = JSON.parse(await
|
|
101721
|
+
const parsed = JSON.parse(await readFile24(path16, "utf8"));
|
|
101380
101722
|
return isPlainRecord(parsed) ? parsed : null;
|
|
101381
101723
|
} catch (error51) {
|
|
101382
101724
|
if (error51 instanceof Error)
|
|
@@ -101471,7 +101813,7 @@ function compareVersionsDescending(left, right) {
|
|
|
101471
101813
|
}
|
|
101472
101814
|
async function pathExists2(path16) {
|
|
101473
101815
|
try {
|
|
101474
|
-
await
|
|
101816
|
+
await lstat14(path16);
|
|
101475
101817
|
return true;
|
|
101476
101818
|
} catch (error51) {
|
|
101477
101819
|
if (error51 instanceof Error)
|
|
@@ -101482,7 +101824,7 @@ async function pathExists2(path16) {
|
|
|
101482
101824
|
|
|
101483
101825
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
101484
101826
|
init_src();
|
|
101485
|
-
import { readdir as
|
|
101827
|
+
import { readdir as readdir13, readFile as readFile25, stat as stat6 } from "fs/promises";
|
|
101486
101828
|
import { homedir as homedir23 } from "os";
|
|
101487
101829
|
import { dirname as dirname32, isAbsolute as isAbsolute13, join as join83, relative as relative10, resolve as resolve23, sep as sep9 } from "path";
|
|
101488
101830
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
@@ -101623,7 +101965,7 @@ async function findHookManifestPaths(root) {
|
|
|
101623
101965
|
async function findManifestPaths(root, manifestName) {
|
|
101624
101966
|
let entries;
|
|
101625
101967
|
try {
|
|
101626
|
-
entries = await
|
|
101968
|
+
entries = await readdir13(root, { withFileTypes: true });
|
|
101627
101969
|
} catch {
|
|
101628
101970
|
return [];
|
|
101629
101971
|
}
|
|
@@ -101735,7 +102077,7 @@ function degradedDetailLines(entries) {
|
|
|
101735
102077
|
}
|
|
101736
102078
|
async function readJson2(path16) {
|
|
101737
102079
|
try {
|
|
101738
|
-
const parsed = JSON.parse(await
|
|
102080
|
+
const parsed = JSON.parse(await readFile25(path16, "utf8"));
|
|
101739
102081
|
return isRecord6(parsed) ? parsed : null;
|
|
101740
102082
|
} catch (error51) {
|
|
101741
102083
|
if (error51 instanceof Error)
|
|
@@ -101763,7 +102105,7 @@ function isRecord6(value) {
|
|
|
101763
102105
|
|
|
101764
102106
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
101765
102107
|
import { existsSync as existsSync60 } from "fs";
|
|
101766
|
-
import { readFile as
|
|
102108
|
+
import { readFile as readFile26 } from "fs/promises";
|
|
101767
102109
|
import { homedir as homedir24 } from "os";
|
|
101768
102110
|
import { join as join84, resolve as resolve24 } from "path";
|
|
101769
102111
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
@@ -101798,7 +102140,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
|
|
|
101798
102140
|
}
|
|
101799
102141
|
async function readRuntimeWrapper(path16) {
|
|
101800
102142
|
try {
|
|
101801
|
-
return await
|
|
102143
|
+
return await readFile26(path16, "utf8");
|
|
101802
102144
|
} catch (error51) {
|
|
101803
102145
|
if (error51 instanceof Error)
|
|
101804
102146
|
return null;
|
|
@@ -102274,18 +102616,18 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
102274
102616
|
}
|
|
102275
102617
|
|
|
102276
102618
|
// packages/mcp-client-core/src/mcp-oauth/storage.ts
|
|
102277
|
-
import { createHash as
|
|
102619
|
+
import { createHash as createHash5 } from "crypto";
|
|
102278
102620
|
import {
|
|
102279
102621
|
chmodSync as chmodSync4,
|
|
102280
102622
|
existsSync as existsSync63,
|
|
102281
102623
|
mkdirSync as mkdirSync14,
|
|
102282
102624
|
readdirSync as readdirSync9,
|
|
102283
|
-
readFileSync as
|
|
102625
|
+
readFileSync as readFileSync44,
|
|
102284
102626
|
renameSync as renameSync7,
|
|
102285
102627
|
unlinkSync as unlinkSync8,
|
|
102286
102628
|
writeFileSync as writeFileSync11
|
|
102287
102629
|
} from "fs";
|
|
102288
|
-
import { basename as
|
|
102630
|
+
import { basename as basename15, dirname as dirname33, join as join87 } from "path";
|
|
102289
102631
|
|
|
102290
102632
|
// packages/mcp-client-core/src/config-dir.ts
|
|
102291
102633
|
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
|
|
@@ -102313,7 +102655,7 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
102313
102655
|
}
|
|
102314
102656
|
|
|
102315
102657
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
102316
|
-
import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as
|
|
102658
|
+
import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync43, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "fs";
|
|
102317
102659
|
import { join as join86 } from "path";
|
|
102318
102660
|
var INDEX_FILE_NAME = "index.json";
|
|
102319
102661
|
function isTokenIndex(value) {
|
|
@@ -102329,7 +102671,7 @@ function readTokenIndex(storageDir) {
|
|
|
102329
102671
|
if (!existsSync62(indexPath))
|
|
102330
102672
|
return {};
|
|
102331
102673
|
try {
|
|
102332
|
-
const parsed = JSON.parse(
|
|
102674
|
+
const parsed = JSON.parse(readFileSync43(indexPath, "utf-8"));
|
|
102333
102675
|
return isTokenIndex(parsed) ? parsed : {};
|
|
102334
102676
|
} catch (readError) {
|
|
102335
102677
|
if (!(readError instanceof Error))
|
|
@@ -102369,7 +102711,7 @@ function getMcpOauthStorageDir() {
|
|
|
102369
102711
|
return join87(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
102370
102712
|
}
|
|
102371
102713
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
102372
|
-
return
|
|
102714
|
+
return createHash5("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
102373
102715
|
}
|
|
102374
102716
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
102375
102717
|
return join87(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
@@ -102439,7 +102781,7 @@ function readTokenFile(filePath) {
|
|
|
102439
102781
|
if (!existsSync63(filePath))
|
|
102440
102782
|
return null;
|
|
102441
102783
|
try {
|
|
102442
|
-
const parsed = JSON.parse(
|
|
102784
|
+
const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
|
|
102443
102785
|
return isOAuthTokenData(parsed) ? parsed : null;
|
|
102444
102786
|
} catch (readError) {
|
|
102445
102787
|
if (!(readError instanceof Error))
|
|
@@ -102452,7 +102794,7 @@ function readLegacyStore() {
|
|
|
102452
102794
|
if (!existsSync63(filePath))
|
|
102453
102795
|
return null;
|
|
102454
102796
|
try {
|
|
102455
|
-
const parsed = JSON.parse(
|
|
102797
|
+
const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
|
|
102456
102798
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
|
|
102457
102799
|
return null;
|
|
102458
102800
|
const result = {};
|
|
@@ -102570,7 +102912,7 @@ function listAllTokens() {
|
|
|
102570
102912
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
102571
102913
|
continue;
|
|
102572
102914
|
const token = readTokenFile(join87(dir, entry.name));
|
|
102573
|
-
const hash2 =
|
|
102915
|
+
const hash2 = basename15(entry.name, ".json");
|
|
102574
102916
|
if (token)
|
|
102575
102917
|
result[index[hash2] ?? hash2] = token;
|
|
102576
102918
|
}
|
|
@@ -102743,13 +103085,13 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
|
|
|
102743
103085
|
|
|
102744
103086
|
// packages/mcp-client-core/src/mcp-oauth/oauth-authorization-flow.ts
|
|
102745
103087
|
import { spawn as spawn4 } from "child_process";
|
|
102746
|
-
import { createHash as
|
|
103088
|
+
import { createHash as createHash6, randomBytes as randomBytes2 } from "crypto";
|
|
102747
103089
|
import { createServer as createServer2 } from "http";
|
|
102748
103090
|
function generateCodeVerifier() {
|
|
102749
103091
|
return randomBytes2(32).toString("base64url");
|
|
102750
103092
|
}
|
|
102751
103093
|
function generateCodeChallenge(verifier) {
|
|
102752
|
-
return
|
|
103094
|
+
return createHash6("sha256").update(verifier).digest("base64url");
|
|
102753
103095
|
}
|
|
102754
103096
|
function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
102755
103097
|
const url2 = new URL(authorizationEndpoint);
|
|
@@ -103293,7 +103635,7 @@ async function boulder(options) {
|
|
|
103293
103635
|
}
|
|
103294
103636
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
103295
103637
|
import { spawn as spawn5 } from "child_process";
|
|
103296
|
-
import { existsSync as existsSync65, readFileSync as
|
|
103638
|
+
import { existsSync as existsSync65, readFileSync as readFileSync45, realpathSync as realpathSync9 } from "fs";
|
|
103297
103639
|
import { homedir as homedir26 } from "os";
|
|
103298
103640
|
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
|
|
103299
103641
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
@@ -103343,7 +103685,7 @@ function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
|
103343
103685
|
}
|
|
103344
103686
|
function isGeneratedRuntimeWrapper(candidate) {
|
|
103345
103687
|
try {
|
|
103346
|
-
return
|
|
103688
|
+
return readFileSync45(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
|
|
103347
103689
|
} catch (error51) {
|
|
103348
103690
|
if (error51 instanceof Error)
|
|
103349
103691
|
return false;
|