oh-my-opencode 4.17.1 → 4.18.1
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/SKILL.md +2 -0
- package/.agents/skills/codex-qa/scripts/lsp-e2e.sh +3654 -0
- package/.agents/skills/opencode-qa/scripts/lsp-e2e.sh +3071 -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/dist/cli/get-local-version/types.d.ts +1 -1
- package/dist/cli/index.js +498 -165
- package/dist/cli-node/index.js +498 -165
- package/dist/index.js +425 -392
- package/dist/skills/frontend/SKILL.md +1 -1
- package/dist/skills/frontend/references/design/README.md +9 -0
- package/dist/skills/frontend/references/design/design-system-architecture.md +4 -2
- package/dist/skills/frontend/references/design/layout-skill.md +107 -0
- package/dist/skills/programming/SKILL.md +12 -2
- package/package.json +17 -16
- 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 +104 -0
- package/packages/lsp-core/src/lsp/directory-diagnostics.ts +60 -27
- 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 +3114 -747
- package/packages/lsp-daemon/dist/client.d.ts +105 -0
- package/packages/lsp-daemon/dist/client.js +5851 -0
- package/packages/lsp-daemon/dist/daemon-client.d.ts +11 -6
- package/packages/lsp-daemon/dist/daemon-client.js +113 -30
- 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 +8 -7
- package/packages/lsp-daemon/dist/ensure-daemon.js +67 -44
- package/packages/lsp-daemon/dist/index.d.ts +2 -2
- package/packages/lsp-daemon/dist/index.js +2862 -754
- 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 +3 -0
- package/packages/lsp-daemon/dist/proxy.js +54 -3
- 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 +2115 -442
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +1741 -148
- package/packages/lsp-tools-mcp/dist/mcp.js +2127 -454
- package/packages/lsp-tools-mcp/dist/request-context.js +176 -6
- package/packages/lsp-tools-mcp/dist/tools.js +2118 -446
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +55 -0
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +2959 -944
- 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 +19 -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 +8 -6
- 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/directive.md +1 -1
- 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/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 +37 -10
- 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 +37 -10
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +37 -10
- 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 +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +10 -9
- 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 +1 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +9 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +4 -2
- package/packages/omo-codex/plugin/skills/frontend/references/design/layout-skill.md +107 -0
- package/packages/omo-codex/plugin/skills/programming/SKILL.md +12 -2
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +37 -10
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +10 -9
- 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/sync-skills-test-support.mjs +1 -1
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +351 -74
- package/packages/shared-skills/skills/frontend/SKILL.md +1 -1
- package/packages/shared-skills/skills/frontend/references/design/README.md +9 -0
- package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +4 -2
- package/packages/shared-skills/skills/frontend/references/design/layout-skill.md +107 -0
- package/packages/shared-skills/skills/programming/SKILL.md +12 -2
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.
|
|
2148
|
+
version: "4.18.1",
|
|
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",
|
|
@@ -2252,8 +2252,10 @@ var init_package = __esm(() => {
|
|
|
2252
2252
|
build: "bun run script/build.ts",
|
|
2253
2253
|
"build:cli-node": "bun run script/build-cli-node.ts",
|
|
2254
2254
|
"build:codex-install": "bun run script/build-codex-install.ts",
|
|
2255
|
+
"install:codex-dev": "bun run script/build-codex-install.ts && bun run script/install-codex-dev.ts",
|
|
2255
2256
|
"build:codex-plugin": "npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build",
|
|
2256
|
-
"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",
|
|
2257
2259
|
"build:materialize-frontend": "node packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs --strict",
|
|
2258
2260
|
"build:shared-skills-assets": "bun run build:materialize-frontend && rm -rf dist/skills && cp -R packages/shared-skills/skills dist/skills",
|
|
2259
2261
|
"build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
|
|
@@ -2275,7 +2277,7 @@ var init_package = __esm(() => {
|
|
|
2275
2277
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
|
2276
2278
|
test: "bun test",
|
|
2277
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",
|
|
2278
|
-
"test:senpi": "
|
|
2280
|
+
"test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test packages/omo-senpi",
|
|
2279
2281
|
"test:windows-codex": "bun run test:codex",
|
|
2280
2282
|
"build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
|
|
2281
2283
|
},
|
|
@@ -2315,7 +2317,6 @@ var init_package = __esm(() => {
|
|
|
2315
2317
|
picocolors: "^1.1.1",
|
|
2316
2318
|
picomatch: "^4.0.4",
|
|
2317
2319
|
"posthog-node": "^5.34.3",
|
|
2318
|
-
"vscode-jsonrpc": "^8.2.1",
|
|
2319
2320
|
zod: "^4.4.3"
|
|
2320
2321
|
},
|
|
2321
2322
|
devDependencies: {
|
|
@@ -2356,18 +2357,18 @@ var init_package = __esm(() => {
|
|
|
2356
2357
|
typescript: "^6.0.3"
|
|
2357
2358
|
},
|
|
2358
2359
|
optionalDependencies: {
|
|
2359
|
-
"oh-my-opencode-darwin-arm64": "4.
|
|
2360
|
-
"oh-my-opencode-darwin-x64": "4.
|
|
2361
|
-
"oh-my-opencode-darwin-x64-baseline": "4.
|
|
2362
|
-
"oh-my-opencode-linux-arm64": "4.
|
|
2363
|
-
"oh-my-opencode-linux-arm64-musl": "4.
|
|
2364
|
-
"oh-my-opencode-linux-x64": "4.
|
|
2365
|
-
"oh-my-opencode-linux-x64-baseline": "4.
|
|
2366
|
-
"oh-my-opencode-linux-x64-musl": "4.
|
|
2367
|
-
"oh-my-opencode-linux-x64-musl-baseline": "4.
|
|
2368
|
-
"oh-my-opencode-windows-arm64": "4.
|
|
2369
|
-
"oh-my-opencode-windows-x64": "4.
|
|
2370
|
-
"oh-my-opencode-windows-x64-baseline": "4.
|
|
2360
|
+
"oh-my-opencode-darwin-arm64": "4.18.1",
|
|
2361
|
+
"oh-my-opencode-darwin-x64": "4.18.1",
|
|
2362
|
+
"oh-my-opencode-darwin-x64-baseline": "4.18.1",
|
|
2363
|
+
"oh-my-opencode-linux-arm64": "4.18.1",
|
|
2364
|
+
"oh-my-opencode-linux-arm64-musl": "4.18.1",
|
|
2365
|
+
"oh-my-opencode-linux-x64": "4.18.1",
|
|
2366
|
+
"oh-my-opencode-linux-x64-baseline": "4.18.1",
|
|
2367
|
+
"oh-my-opencode-linux-x64-musl": "4.18.1",
|
|
2368
|
+
"oh-my-opencode-linux-x64-musl-baseline": "4.18.1",
|
|
2369
|
+
"oh-my-opencode-windows-arm64": "4.18.1",
|
|
2370
|
+
"oh-my-opencode-windows-x64": "4.18.1",
|
|
2371
|
+
"oh-my-opencode-windows-x64-baseline": "4.18.1"
|
|
2371
2372
|
},
|
|
2372
2373
|
overrides: {
|
|
2373
2374
|
"@earendil-works/pi-agent-core": "0.80.3",
|
|
@@ -66794,14 +66795,14 @@ var init_config_manager = __esm(() => {
|
|
|
66794
66795
|
|
|
66795
66796
|
// packages/telemetry-core/src/activity-state.ts
|
|
66796
66797
|
import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync14 } from "fs";
|
|
66797
|
-
import { basename as
|
|
66798
|
+
import { basename as basename11, join as join53 } from "path";
|
|
66798
66799
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
66799
66800
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
66800
66801
|
env: options.env,
|
|
66801
66802
|
osProvider: options.osProvider
|
|
66802
66803
|
});
|
|
66803
66804
|
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join53(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
66804
|
-
if (dataDir === xdgStateDir || xdgStateDir === undefined &&
|
|
66805
|
+
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename11(dataDir) === product.cacheDirName) {
|
|
66805
66806
|
return dataDir;
|
|
66806
66807
|
}
|
|
66807
66808
|
return join53(dataDir, product.cacheDirName);
|
|
@@ -67035,18 +67036,18 @@ var init_env2 = __esm(() => {
|
|
|
67035
67036
|
});
|
|
67036
67037
|
|
|
67037
67038
|
// packages/telemetry-core/src/machine-id.ts
|
|
67038
|
-
import { createHash as
|
|
67039
|
+
import { createHash as createHash4 } from "crypto";
|
|
67039
67040
|
import os4 from "os";
|
|
67040
67041
|
function getDefaultTelemetryOsProvider() {
|
|
67041
67042
|
return os4;
|
|
67042
67043
|
}
|
|
67043
67044
|
function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
|
|
67044
|
-
return
|
|
67045
|
+
return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
|
|
67045
67046
|
}
|
|
67046
67047
|
var init_machine_id = () => {};
|
|
67047
67048
|
|
|
67048
67049
|
// node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
67049
|
-
import { dirname as dirname18, posix as
|
|
67050
|
+
import { dirname as dirname18, posix as posix3, sep as sep7 } from "path";
|
|
67050
67051
|
function createModulerModifier() {
|
|
67051
67052
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
67052
67053
|
return async (frames) => {
|
|
@@ -67061,7 +67062,7 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(proc
|
|
|
67061
67062
|
if (!filename)
|
|
67062
67063
|
return;
|
|
67063
67064
|
const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
|
|
67064
|
-
let { dir, base: file2, ext } =
|
|
67065
|
+
let { dir, base: file2, ext } = posix3.parse(normalizedFilename);
|
|
67065
67066
|
if (ext === ".js" || ext === ".mjs" || ext === ".cjs")
|
|
67066
67067
|
file2 = file2.slice(0, -1 * ext.length);
|
|
67067
67068
|
const decodedFile = decodeURIComponent(file2);
|
|
@@ -72601,7 +72602,7 @@ var package_default2;
|
|
|
72601
72602
|
var init_package2 = __esm(() => {
|
|
72602
72603
|
package_default2 = {
|
|
72603
72604
|
name: "@oh-my-opencode/omo-codex",
|
|
72604
|
-
version: "4.
|
|
72605
|
+
version: "4.18.1",
|
|
72605
72606
|
type: "module",
|
|
72606
72607
|
private: true,
|
|
72607
72608
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -73420,18 +73421,18 @@ function removeFromTextBunLock(lockPath, packageNames) {
|
|
|
73420
73421
|
try {
|
|
73421
73422
|
const content = fs12.readFileSync(lockPath, "utf-8");
|
|
73422
73423
|
const lock = JSON.parse(stripTrailingCommas(content));
|
|
73423
|
-
let
|
|
73424
|
+
let removed2 = false;
|
|
73424
73425
|
for (const packageName of packageNames) {
|
|
73425
73426
|
if (lock.packages?.[packageName]) {
|
|
73426
73427
|
delete lock.packages[packageName];
|
|
73427
73428
|
log2(`[auto-update-checker] Removed from bun.lock: ${packageName}`);
|
|
73428
|
-
|
|
73429
|
+
removed2 = true;
|
|
73429
73430
|
}
|
|
73430
73431
|
}
|
|
73431
|
-
if (
|
|
73432
|
+
if (removed2) {
|
|
73432
73433
|
fs12.writeFileSync(lockPath, JSON.stringify(lock, null, 2));
|
|
73433
73434
|
}
|
|
73434
|
-
return
|
|
73435
|
+
return removed2;
|
|
73435
73436
|
} catch (error51) {
|
|
73436
73437
|
if (!(error51 instanceof Error)) {
|
|
73437
73438
|
throw error51;
|
|
@@ -73471,7 +73472,7 @@ function getInvalidationPackageNames(packageName, defaultPackageName, acceptedPa
|
|
|
73471
73472
|
function removeSpecifierRootDirs(cacheDir, packageNames) {
|
|
73472
73473
|
const parentDirs = [cacheDir, path13.join(cacheDir, "packages")];
|
|
73473
73474
|
const prefixes = packageNames.map((packageName) => `${packageName}@`);
|
|
73474
|
-
let
|
|
73475
|
+
let removed2 = false;
|
|
73475
73476
|
for (const parentDir of parentDirs) {
|
|
73476
73477
|
if (!fs12.existsSync(parentDir)) {
|
|
73477
73478
|
continue;
|
|
@@ -73483,10 +73484,10 @@ function removeSpecifierRootDirs(cacheDir, packageNames) {
|
|
|
73483
73484
|
const specifierDir = path13.join(parentDir, entry.name);
|
|
73484
73485
|
fs12.rmSync(specifierDir, { recursive: true, force: true });
|
|
73485
73486
|
log2(`[auto-update-checker] Specifier cache removed: ${specifierDir}`);
|
|
73486
|
-
|
|
73487
|
+
removed2 = true;
|
|
73487
73488
|
}
|
|
73488
73489
|
}
|
|
73489
|
-
return
|
|
73490
|
+
return removed2;
|
|
73490
73491
|
}
|
|
73491
73492
|
function invalidatePackage(packageName, options = {}) {
|
|
73492
73493
|
try {
|
|
@@ -75325,9 +75326,11 @@ function collectCommands(value, commands) {
|
|
|
75325
75326
|
|
|
75326
75327
|
// packages/omo-codex/src/install/codex-cache-install.ts
|
|
75327
75328
|
async function installCachedPlugin(input) {
|
|
75329
|
+
const env2 = input.env ?? process.env;
|
|
75330
|
+
const npmInstallEnv = sanitizeNpmInstallEnv(env2);
|
|
75328
75331
|
if (input.buildSource !== false) {
|
|
75329
|
-
await maybeRunNpmInstall(input.sourcePath, input.runCommand);
|
|
75330
|
-
await maybeRunNpmBuild(input.sourcePath, input.runCommand);
|
|
75332
|
+
await maybeRunNpmInstall(input.sourcePath, input.runCommand, npmInstallEnv);
|
|
75333
|
+
await maybeRunNpmBuild(input.sourcePath, input.runCommand, env2);
|
|
75331
75334
|
}
|
|
75332
75335
|
const targetPath = join33(input.codexHome, "plugins", "cache", input.marketplaceName, input.name, input.version);
|
|
75333
75336
|
const tempPath = createTempSiblingPath(targetPath);
|
|
@@ -75337,10 +75340,10 @@ async function installCachedPlugin(input) {
|
|
|
75337
75340
|
await rewriteCachedPackageLocalFileDependencies(tempPath, input.sourcePath);
|
|
75338
75341
|
await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: input.sourcePath });
|
|
75339
75342
|
await copyRootRuntimeDists({ pluginRoot: tempPath, sourcePath: input.sourcePath });
|
|
75340
|
-
await maybeRunNpmInstall(tempPath, input.runCommand, ["ci", "--omit=dev"]);
|
|
75343
|
+
await maybeRunNpmInstall(tempPath, input.runCommand, npmInstallEnv, ["ci", "--omit=dev"]);
|
|
75341
75344
|
await removeCachedManagedNpmBinShims(tempPath);
|
|
75342
75345
|
if (input.buildSource === false)
|
|
75343
|
-
await maybeRunNpmSyncSkills(tempPath, input.runCommand);
|
|
75346
|
+
await maybeRunNpmSyncSkills(tempPath, input.runCommand, env2);
|
|
75344
75347
|
await assertNoRemovedSparkshellPromptReferences(tempPath);
|
|
75345
75348
|
await rewriteCachedMcpManifest(tempPath, input.sourcePath);
|
|
75346
75349
|
await rewriteCachedManifestRoot(tempPath, tempPath, targetPath);
|
|
@@ -75352,12 +75355,12 @@ async function installCachedPlugin(input) {
|
|
|
75352
75355
|
}
|
|
75353
75356
|
return { name: input.name, version: input.version, path: targetPath };
|
|
75354
75357
|
}
|
|
75355
|
-
async function maybeRunNpmInstall(cwd, runCommand, args = ["install"]) {
|
|
75358
|
+
async function maybeRunNpmInstall(cwd, runCommand, env2, args = ["install"]) {
|
|
75356
75359
|
if (!await fileExistsStrict(join33(cwd, "package.json")))
|
|
75357
75360
|
return;
|
|
75358
|
-
await runCommand("npm", args, { cwd });
|
|
75361
|
+
await runCommand("npm", args, { cwd, env: env2 });
|
|
75359
75362
|
}
|
|
75360
|
-
async function maybeRunNpmBuild(cwd, runCommand) {
|
|
75363
|
+
async function maybeRunNpmBuild(cwd, runCommand, env2) {
|
|
75361
75364
|
if (!await fileExistsStrict(join33(cwd, "package.json")))
|
|
75362
75365
|
return;
|
|
75363
75366
|
const packageJson = JSON.parse(await readFile8(join33(cwd, "package.json"), "utf8"));
|
|
@@ -75366,9 +75369,9 @@ async function maybeRunNpmBuild(cwd, runCommand) {
|
|
|
75366
75369
|
const scripts = packageJson.scripts;
|
|
75367
75370
|
if (!isPlainRecord3(scripts) || typeof scripts.build !== "string")
|
|
75368
75371
|
return;
|
|
75369
|
-
await runCommand("npm", ["run", "build"], { cwd });
|
|
75372
|
+
await runCommand("npm", ["run", "build"], { cwd, env: env2 });
|
|
75370
75373
|
}
|
|
75371
|
-
async function maybeRunNpmSyncSkills(cwd, runCommand) {
|
|
75374
|
+
async function maybeRunNpmSyncSkills(cwd, runCommand, env2) {
|
|
75372
75375
|
if (!await fileExistsStrict(join33(cwd, "package.json")))
|
|
75373
75376
|
return;
|
|
75374
75377
|
const packageJson = JSON.parse(await readFile8(join33(cwd, "package.json"), "utf8"));
|
|
@@ -75377,7 +75380,10 @@ async function maybeRunNpmSyncSkills(cwd, runCommand) {
|
|
|
75377
75380
|
const scripts = packageJson.scripts;
|
|
75378
75381
|
if (!isPlainRecord3(scripts) || typeof scripts["sync:skills"] !== "string")
|
|
75379
75382
|
return;
|
|
75380
|
-
await runCommand("npm", ["run", "sync:skills"], { cwd });
|
|
75383
|
+
await runCommand("npm", ["run", "sync:skills"], { cwd, env: env2 });
|
|
75384
|
+
}
|
|
75385
|
+
function sanitizeNpmInstallEnv(env2) {
|
|
75386
|
+
return Object.fromEntries(Object.entries(env2).filter(([key]) => key.toLowerCase() !== "npm_config_allow_scripts"));
|
|
75381
75387
|
}
|
|
75382
75388
|
function createTempSiblingPath(targetPath) {
|
|
75383
75389
|
return join33(dirname13(targetPath), `.tmp-${basename7(targetPath)}-${process.pid}-${Date.now()}`);
|
|
@@ -77407,6 +77413,10 @@ async function readDistributionManifest(repoRoot) {
|
|
|
77407
77413
|
}
|
|
77408
77414
|
}
|
|
77409
77415
|
function resolveLazyCodexPluginVersion(input) {
|
|
77416
|
+
const override = input.versionOverride?.trim();
|
|
77417
|
+
if (override !== undefined && override.length > 0) {
|
|
77418
|
+
return override;
|
|
77419
|
+
}
|
|
77410
77420
|
if (input.marketplaceName === "sisyphuslabs" && input.pluginName === "omo" && input.distributionManifest !== undefined) {
|
|
77411
77421
|
return input.distributionManifest.version;
|
|
77412
77422
|
}
|
|
@@ -77777,65 +77787,297 @@ function formatUnknownError(error) {
|
|
|
77777
77787
|
}
|
|
77778
77788
|
|
|
77779
77789
|
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
|
|
77780
|
-
import {
|
|
77790
|
+
import { createHash as createHash3 } from "crypto";
|
|
77791
|
+
import { lstat as lstat11, readFile as readFile19, readdir as readdir10, rm as rm10 } from "fs/promises";
|
|
77792
|
+
import { tmpdir as tmpdir3 } from "os";
|
|
77793
|
+
import { join as join48, posix as posix2 } from "path";
|
|
77794
|
+
|
|
77795
|
+
// packages/omo-codex/src/install/lsp-daemon-reaper-attestation.ts
|
|
77796
|
+
import { execFile as execFile2 } from "child_process";
|
|
77797
|
+
import { readFile as readFile18, readdir as readdir9, readlink as readlink5 } from "fs/promises";
|
|
77781
77798
|
import { connect } from "net";
|
|
77782
|
-
import {
|
|
77783
|
-
|
|
77784
|
-
|
|
77785
|
-
|
|
77786
|
-
|
|
77787
|
-
|
|
77788
|
-
|
|
77799
|
+
import { basename as basename10 } from "path";
|
|
77800
|
+
var PROBE_TIMEOUT_MS = 500;
|
|
77801
|
+
async function probeLegacyJsonRpcEndpoint(endpoint, timeoutMs = PROBE_TIMEOUT_MS) {
|
|
77802
|
+
return await new Promise((resolve14) => {
|
|
77803
|
+
const socket = connect(endpoint);
|
|
77804
|
+
let settled = false;
|
|
77805
|
+
let buffer = "";
|
|
77806
|
+
const finish = (value) => {
|
|
77807
|
+
if (settled)
|
|
77808
|
+
return;
|
|
77809
|
+
settled = true;
|
|
77810
|
+
clearTimeout(timer);
|
|
77811
|
+
socket.destroy();
|
|
77812
|
+
resolve14(value);
|
|
77813
|
+
};
|
|
77814
|
+
const timer = setTimeout(() => finish(false), timeoutMs);
|
|
77815
|
+
timer.unref?.();
|
|
77816
|
+
socket.once("connect", () => {
|
|
77817
|
+
socket.write(`${JSON.stringify(legacyStatusRequest())}
|
|
77818
|
+
`);
|
|
77819
|
+
});
|
|
77820
|
+
socket.on("data", (chunk) => {
|
|
77821
|
+
buffer += chunk.toString("utf8");
|
|
77822
|
+
const newlineIndex = buffer.indexOf(`
|
|
77823
|
+
`);
|
|
77824
|
+
if (newlineIndex < 0)
|
|
77825
|
+
return;
|
|
77826
|
+
finish(isJsonRpcResponse(buffer.slice(0, newlineIndex).trim()));
|
|
77827
|
+
});
|
|
77828
|
+
socket.once("error", () => finish(false));
|
|
77829
|
+
});
|
|
77830
|
+
}
|
|
77831
|
+
async function attestLegacyDaemonOwnership(input, deps = {}) {
|
|
77832
|
+
if (input.platform === "linux")
|
|
77833
|
+
return await attestLinuxOwnership(input, deps);
|
|
77834
|
+
if (input.platform === "darwin")
|
|
77835
|
+
return await attestMacOwnership(input, deps);
|
|
77836
|
+
return false;
|
|
77837
|
+
}
|
|
77838
|
+
async function attestLinuxOwnership(input, deps) {
|
|
77839
|
+
const readFileImpl = deps.readFile ?? readFile18;
|
|
77840
|
+
const readDirImpl = deps.readDir ?? readdir9;
|
|
77841
|
+
const readLinkImpl = deps.readLink ?? readlink5;
|
|
77842
|
+
const procNetUnix = await readText(readFileImpl, "/proc/net/unix");
|
|
77843
|
+
if (procNetUnix === null)
|
|
77844
|
+
return false;
|
|
77845
|
+
const inode = inodeForEndpoint(procNetUnix, input.endpoint);
|
|
77846
|
+
if (inode === null)
|
|
77847
|
+
return false;
|
|
77848
|
+
const fdEntries = await readDirImpl(`/proc/${input.pid}/fd`).catch(() => null);
|
|
77849
|
+
if (fdEntries === null)
|
|
77850
|
+
return false;
|
|
77851
|
+
let ownsEndpoint = false;
|
|
77852
|
+
for (const fdEntry of fdEntries) {
|
|
77853
|
+
const target = await readLinkImpl(`/proc/${input.pid}/fd/${fdEntry}`).catch(() => null);
|
|
77854
|
+
if (target !== `socket:[${inode}]`)
|
|
77855
|
+
continue;
|
|
77856
|
+
ownsEndpoint = true;
|
|
77857
|
+
break;
|
|
77858
|
+
}
|
|
77859
|
+
if (!ownsEndpoint)
|
|
77860
|
+
return false;
|
|
77861
|
+
const cmdline = await readBinary(readFileImpl, `/proc/${input.pid}/cmdline`);
|
|
77862
|
+
if (cmdline === null)
|
|
77863
|
+
return false;
|
|
77864
|
+
return isNodeCliDaemonArgv(splitCmdline(cmdline));
|
|
77865
|
+
}
|
|
77866
|
+
async function attestMacOwnership(input, deps) {
|
|
77867
|
+
const executeFileImpl = deps.executeFile ?? execFile2;
|
|
77868
|
+
const filteredLsofOutput = await executeForStdout(executeFileImpl, "/usr/sbin/lsof", [
|
|
77869
|
+
"-a",
|
|
77870
|
+
"-n",
|
|
77871
|
+
"-P",
|
|
77872
|
+
"-p",
|
|
77873
|
+
String(input.pid),
|
|
77874
|
+
"-U",
|
|
77875
|
+
"-Fn",
|
|
77876
|
+
"--",
|
|
77877
|
+
input.endpoint
|
|
77878
|
+
]);
|
|
77879
|
+
const lsofOutput = filteredLsofOutput ?? await executeForStdout(executeFileImpl, "/usr/sbin/lsof", [
|
|
77880
|
+
"-a",
|
|
77881
|
+
"-n",
|
|
77882
|
+
"-P",
|
|
77883
|
+
"-p",
|
|
77884
|
+
String(input.pid),
|
|
77885
|
+
"-U",
|
|
77886
|
+
"-Fn"
|
|
77887
|
+
]);
|
|
77888
|
+
if (lsofOutput === null || !lsofShowsUnixEndpoint(lsofOutput, input.pid, input.endpoint))
|
|
77889
|
+
return false;
|
|
77890
|
+
const commandOutput = await executeForStdout(executeFileImpl, "/bin/ps", ["-p", String(input.pid), "-o", "command="]);
|
|
77891
|
+
if (commandOutput === null)
|
|
77892
|
+
return false;
|
|
77893
|
+
return isNodeCliDaemonCommand(commandOutput.trim());
|
|
77894
|
+
}
|
|
77895
|
+
function legacyStatusRequest() {
|
|
77896
|
+
return {
|
|
77897
|
+
jsonrpc: "2.0",
|
|
77898
|
+
id: 1,
|
|
77899
|
+
method: "tools/call",
|
|
77900
|
+
params: { name: "status", arguments: {} }
|
|
77901
|
+
};
|
|
77902
|
+
}
|
|
77903
|
+
function isJsonRpcResponse(line) {
|
|
77904
|
+
if (line.length === 0)
|
|
77905
|
+
return false;
|
|
77789
77906
|
try {
|
|
77790
|
-
|
|
77907
|
+
const parsed = JSON.parse(line);
|
|
77908
|
+
return parsed.jsonrpc === "2.0" && parsed.id === 1 && (Object.hasOwn(parsed, "result") || Object.hasOwn(parsed, "error"));
|
|
77791
77909
|
} catch {
|
|
77792
|
-
return
|
|
77910
|
+
return false;
|
|
77793
77911
|
}
|
|
77794
|
-
|
|
77795
|
-
|
|
77796
|
-
|
|
77797
|
-
const
|
|
77798
|
-
if (
|
|
77799
|
-
|
|
77912
|
+
}
|
|
77913
|
+
function inodeForEndpoint(procNetUnix, endpoint) {
|
|
77914
|
+
for (const line of procNetUnix.split(/\r?\n/)) {
|
|
77915
|
+
const trimmed = line.trim();
|
|
77916
|
+
if (trimmed.length === 0 || trimmed.startsWith("Num"))
|
|
77917
|
+
continue;
|
|
77918
|
+
const fields = trimmed.split(/\s+/);
|
|
77919
|
+
if (fields.length < 8 || fields[7] !== endpoint)
|
|
77920
|
+
continue;
|
|
77921
|
+
return fields[6] ?? null;
|
|
77922
|
+
}
|
|
77923
|
+
return null;
|
|
77924
|
+
}
|
|
77925
|
+
function splitCmdline(buffer) {
|
|
77926
|
+
return buffer.toString("utf8").split("\x00").filter((value) => value.length > 0);
|
|
77927
|
+
}
|
|
77928
|
+
function isNodeCliDaemonArgv(argv) {
|
|
77929
|
+
if (argv.length < 2 || !argv.includes("daemon"))
|
|
77930
|
+
return false;
|
|
77931
|
+
const executable = basename10(argv[0] ?? "");
|
|
77932
|
+
if (!/^node(?:\.exe)?$/i.test(executable))
|
|
77933
|
+
return false;
|
|
77934
|
+
return argv.some((value) => value === "cli.js" || value.endsWith("/cli.js") || value.endsWith("\\cli.js"));
|
|
77935
|
+
}
|
|
77936
|
+
function lsofShowsUnixEndpoint(output, pid, endpoint) {
|
|
77937
|
+
const lines = output.split(/\r?\n/).filter((line) => line.length > 0);
|
|
77938
|
+
const endpointName = basename10(endpoint);
|
|
77939
|
+
return lines.includes(`p${pid}`) && lines.some((line) => line === `n${endpoint}` || line === `n${endpointName}`);
|
|
77940
|
+
}
|
|
77941
|
+
function isNodeCliDaemonCommand(command) {
|
|
77942
|
+
return /\bnode(?:\.exe)?\b/i.test(command) && /\bcli\.js\b/.test(command) && /\bdaemon\b/.test(command);
|
|
77943
|
+
}
|
|
77944
|
+
async function executeForStdout(executeFileImpl, file2, args) {
|
|
77945
|
+
return await new Promise((resolve14) => {
|
|
77946
|
+
executeFileImpl(file2, [...args], { encoding: "utf8", maxBuffer: 1024 * 1024, timeout: 1000 }, (error, stdout) => {
|
|
77947
|
+
if (error !== null) {
|
|
77948
|
+
resolve14(null);
|
|
77949
|
+
return;
|
|
77950
|
+
}
|
|
77951
|
+
resolve14(stdout);
|
|
77952
|
+
});
|
|
77953
|
+
});
|
|
77954
|
+
}
|
|
77955
|
+
async function readText(readFileImpl, path7) {
|
|
77956
|
+
return await readFileImpl(path7, "utf8").catch(() => null);
|
|
77957
|
+
}
|
|
77958
|
+
async function readBinary(readFileImpl, path7) {
|
|
77959
|
+
return await readFileImpl(path7).catch(() => null);
|
|
77960
|
+
}
|
|
77961
|
+
|
|
77962
|
+
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
|
|
77963
|
+
var LEGACY_EXIT_WAIT_TIMEOUT_MS = 5000;
|
|
77964
|
+
var LEGACY_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
|
|
77965
|
+
async function reapLspDaemons(codexHome, deps = {}) {
|
|
77966
|
+
const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
|
|
77967
|
+
const platform = deps.platform ?? process.platform;
|
|
77968
|
+
const tmpDir = deps.tmpDir ?? tmpdir3();
|
|
77969
|
+
const probe2 = deps.probeLegacyJsonRpc ?? probeLegacyJsonRpcEndpoint;
|
|
77970
|
+
const attest = deps.attestLegacyDaemonOwnership ?? ((input) => attestLegacyDaemonOwnership(input));
|
|
77971
|
+
const killProcess = deps.killProcess ?? sendSigterm;
|
|
77972
|
+
const waitForProcessExit = deps.waitForProcessExit ?? defaultWaitForProcessExit;
|
|
77973
|
+
const entries = await readdir10(daemonRoot, { withFileTypes: true }).catch(() => []);
|
|
77974
|
+
const results = [];
|
|
77975
|
+
for (const entry of [...entries].sort((left, right) => left.name.localeCompare(right.name))) {
|
|
77976
|
+
const versionPath = join48(daemonRoot, entry.name);
|
|
77977
|
+
const parsedVersion = parseVersionEntry(entry.name);
|
|
77978
|
+
if (parsedVersion === null || !entry.isDirectory()) {
|
|
77979
|
+
await removeVersionDir(versionPath);
|
|
77980
|
+
results.push(removed(entry.name, "removed invalid legacy version entry"));
|
|
77981
|
+
continue;
|
|
77982
|
+
}
|
|
77983
|
+
const metadata = await readLegacyMetadata({ versionPath, version: parsedVersion, codexHome, platform, tmpDir });
|
|
77984
|
+
if (metadata.kind === "remove") {
|
|
77985
|
+
await removeVersionDir(versionPath);
|
|
77986
|
+
results.push(removed(parsedVersion, metadata.reason));
|
|
77987
|
+
continue;
|
|
77800
77988
|
}
|
|
77801
|
-
await
|
|
77989
|
+
if (!await probe2(metadata.endpoint)) {
|
|
77990
|
+
await removeVersionDir(versionPath);
|
|
77991
|
+
results.push(removed(parsedVersion, "removed stale legacy daemon state"));
|
|
77992
|
+
continue;
|
|
77993
|
+
}
|
|
77994
|
+
if (platform === "win32") {
|
|
77995
|
+
results.push(deferred(parsedVersion, "legacy named pipe responded but Windows cannot prove pid ownership safely"));
|
|
77996
|
+
continue;
|
|
77997
|
+
}
|
|
77998
|
+
const owned = await attest({ pid: metadata.pid, endpoint: metadata.endpoint, platform });
|
|
77999
|
+
if (!owned) {
|
|
78000
|
+
results.push(deferred(parsedVersion, "legacy endpoint responded but pid ownership was not proven"));
|
|
78001
|
+
continue;
|
|
78002
|
+
}
|
|
78003
|
+
if (!killProcess(metadata.pid)) {
|
|
78004
|
+
await removeVersionDir(versionPath);
|
|
78005
|
+
results.push(removed(parsedVersion, "removed stale legacy daemon state"));
|
|
78006
|
+
continue;
|
|
78007
|
+
}
|
|
78008
|
+
if (!await waitForProcessExit(metadata.pid, LEGACY_EXIT_WAIT_TIMEOUT_MS)) {
|
|
78009
|
+
results.push(deferred(parsedVersion, `timed out waiting ${LEGACY_EXIT_WAIT_TIMEOUT_MS}ms for the proven legacy daemon to exit`));
|
|
78010
|
+
continue;
|
|
78011
|
+
}
|
|
78012
|
+
await removeVersionDir(versionPath);
|
|
78013
|
+
results.push(terminated(parsedVersion, "terminated proven owned legacy daemon"));
|
|
77802
78014
|
}
|
|
77803
|
-
return
|
|
78015
|
+
return results;
|
|
77804
78016
|
}
|
|
77805
|
-
|
|
77806
|
-
|
|
77807
|
-
const content = (await readFile18(path7, "utf8")).trim();
|
|
77808
|
-
return content.length > 0 ? content : null;
|
|
77809
|
-
} catch {
|
|
78017
|
+
function parseVersionEntry(entryName) {
|
|
78018
|
+
if (!entryName.startsWith("v"))
|
|
77810
78019
|
return null;
|
|
78020
|
+
const version = entryName.slice(1);
|
|
78021
|
+
return LEGACY_VERSION_PATTERN.test(version) ? version : null;
|
|
78022
|
+
}
|
|
78023
|
+
async function readLegacyMetadata(input) {
|
|
78024
|
+
const pidText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.pid"));
|
|
78025
|
+
if (pidText === "non_regular")
|
|
78026
|
+
return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
|
|
78027
|
+
if (pidText === null)
|
|
78028
|
+
return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
|
|
78029
|
+
const pid = Number.parseInt(pidText, 10);
|
|
78030
|
+
if (!Number.isInteger(pid) || pid <= 0)
|
|
78031
|
+
return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
|
|
78032
|
+
const endpointText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.endpoint"));
|
|
78033
|
+
if (endpointText === "non_regular")
|
|
78034
|
+
return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
|
|
78035
|
+
if (endpointText === null)
|
|
78036
|
+
return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
|
|
78037
|
+
const allowedEndpoints = legacyEndpointCandidates({
|
|
78038
|
+
version: input.version,
|
|
78039
|
+
versionPath: input.versionPath,
|
|
78040
|
+
platform: input.platform,
|
|
78041
|
+
tmpDir: input.tmpDir
|
|
78042
|
+
});
|
|
78043
|
+
if (!allowedEndpoints.includes(endpointText)) {
|
|
78044
|
+
return { kind: "remove", reason: "removed legacy daemon state with an endpoint outside the frozen vectors" };
|
|
77811
78045
|
}
|
|
78046
|
+
return { kind: "valid", pid, endpoint: endpointText };
|
|
77812
78047
|
}
|
|
77813
|
-
|
|
77814
|
-
|
|
77815
|
-
const
|
|
77816
|
-
|
|
77817
|
-
|
|
77818
|
-
return null;
|
|
78048
|
+
function legacyEndpointCandidates(input) {
|
|
78049
|
+
if (input.platform === "win32") {
|
|
78050
|
+
const normalizedVersionPath = input.versionPath.replaceAll("/", "\\");
|
|
78051
|
+
const digest = shortDigest(normalizedVersionPath);
|
|
78052
|
+
return [`\\\\.\\pipe\\omo-lsp-${input.version}-${digest}`];
|
|
77819
78053
|
}
|
|
78054
|
+
const natural = posix2.join(input.versionPath, "daemon.sock");
|
|
78055
|
+
const hashed = posix2.join(input.tmpDir, `omo-lsp-${input.version}-${shortDigest(input.versionPath)}.sock`);
|
|
78056
|
+
return [natural, hashed];
|
|
77820
78057
|
}
|
|
77821
|
-
function
|
|
77822
|
-
|
|
77823
|
-
|
|
77824
|
-
|
|
77825
|
-
|
|
77826
|
-
|
|
77827
|
-
|
|
77828
|
-
|
|
77829
|
-
|
|
77830
|
-
|
|
77831
|
-
|
|
77832
|
-
|
|
77833
|
-
|
|
77834
|
-
|
|
77835
|
-
|
|
77836
|
-
|
|
77837
|
-
|
|
77838
|
-
|
|
78058
|
+
async function readRegularTrimmedFile(path7) {
|
|
78059
|
+
const stats = await lstat11(path7).catch(() => null);
|
|
78060
|
+
if (stats === null)
|
|
78061
|
+
return null;
|
|
78062
|
+
if (!stats.isFile())
|
|
78063
|
+
return "non_regular";
|
|
78064
|
+
const content = (await readFile19(path7, "utf8")).trim();
|
|
78065
|
+
return content.length > 0 ? content : null;
|
|
78066
|
+
}
|
|
78067
|
+
function shortDigest(value) {
|
|
78068
|
+
return createHash3("sha256").update(value).digest("hex").slice(0, 16);
|
|
78069
|
+
}
|
|
78070
|
+
async function removeVersionDir(path7) {
|
|
78071
|
+
await rm10(path7, { recursive: true, force: true });
|
|
78072
|
+
}
|
|
78073
|
+
function removed(version, reason) {
|
|
78074
|
+
return { version, status: "removed", reason };
|
|
78075
|
+
}
|
|
78076
|
+
function terminated(version, reason) {
|
|
78077
|
+
return { version, status: "terminated", reason };
|
|
78078
|
+
}
|
|
78079
|
+
function deferred(version, reason) {
|
|
78080
|
+
return { version, status: "deferred", reason };
|
|
77839
78081
|
}
|
|
77840
78082
|
function sendSigterm(pid) {
|
|
77841
78083
|
try {
|
|
@@ -77845,6 +78087,24 @@ function sendSigterm(pid) {
|
|
|
77845
78087
|
return false;
|
|
77846
78088
|
}
|
|
77847
78089
|
}
|
|
78090
|
+
async function defaultWaitForProcessExit(pid, timeoutMs) {
|
|
78091
|
+
const deadline = Date.now() + timeoutMs;
|
|
78092
|
+
for (;; ) {
|
|
78093
|
+
if (!processIsRunning(pid))
|
|
78094
|
+
return true;
|
|
78095
|
+
if (Date.now() >= deadline)
|
|
78096
|
+
return false;
|
|
78097
|
+
await new Promise((resolve14) => setTimeout(resolve14, 100));
|
|
78098
|
+
}
|
|
78099
|
+
}
|
|
78100
|
+
function processIsRunning(pid) {
|
|
78101
|
+
try {
|
|
78102
|
+
process.kill(pid, 0);
|
|
78103
|
+
return true;
|
|
78104
|
+
} catch {
|
|
78105
|
+
return false;
|
|
78106
|
+
}
|
|
78107
|
+
}
|
|
77848
78108
|
|
|
77849
78109
|
// packages/omo-codex/src/install/codex-installer-bin-dir.ts
|
|
77850
78110
|
import { homedir as homedir5 } from "os";
|
|
@@ -77862,7 +78122,7 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
77862
78122
|
}
|
|
77863
78123
|
|
|
77864
78124
|
// packages/omo-codex/src/install/codex-git-bash-hooks.ts
|
|
77865
|
-
import { readFile as
|
|
78125
|
+
import { readFile as readFile20, writeFile as writeFile11 } from "fs/promises";
|
|
77866
78126
|
import { join as join50 } from "path";
|
|
77867
78127
|
var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
|
|
77868
78128
|
"./hooks/pre-tool-use-recommending-git-bash-mcp.json",
|
|
@@ -77872,7 +78132,7 @@ async function removeGitBashHooksOffWindows(input) {
|
|
|
77872
78132
|
if (input.platform === "win32")
|
|
77873
78133
|
return;
|
|
77874
78134
|
const manifestPath = join50(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
77875
|
-
const parsed = JSON.parse(await
|
|
78135
|
+
const parsed = JSON.parse(await readFile20(manifestPath, "utf8"));
|
|
77876
78136
|
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
|
|
77877
78137
|
return;
|
|
77878
78138
|
const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
|
|
@@ -77957,6 +78217,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
77957
78217
|
return;
|
|
77958
78218
|
});
|
|
77959
78219
|
const buildSource = await shouldBuildSourcePackages(repoRoot);
|
|
78220
|
+
const versionOverride = env3.LAZYCODEX_DEV_VERSION?.trim() || undefined;
|
|
77960
78221
|
const gitBashResolution = await prepareGitBashForInstall({
|
|
77961
78222
|
platform,
|
|
77962
78223
|
env: env3,
|
|
@@ -77983,13 +78244,15 @@ async function runCodexInstaller(options = {}) {
|
|
|
77983
78244
|
manifestVersion: manifest.version,
|
|
77984
78245
|
marketplaceName: marketplace.name,
|
|
77985
78246
|
pluginName: entry.name,
|
|
77986
|
-
distributionManifest
|
|
78247
|
+
distributionManifest,
|
|
78248
|
+
versionOverride
|
|
77987
78249
|
});
|
|
77988
78250
|
validatePathSegment(version2, "plugin version");
|
|
77989
78251
|
log4(`Building ${entry.name}@${version2}`);
|
|
77990
78252
|
const plugin = await installCachedPlugin({
|
|
77991
78253
|
buildSource,
|
|
77992
78254
|
codexHome,
|
|
78255
|
+
env: env3,
|
|
77993
78256
|
marketplaceName: marketplace.name,
|
|
77994
78257
|
name: entry.name,
|
|
77995
78258
|
runCommand,
|
|
@@ -78063,7 +78326,16 @@ async function runCodexInstaller(options = {}) {
|
|
|
78063
78326
|
pluginNames: marketplace.plugins.map((plugin) => plugin.name)
|
|
78064
78327
|
});
|
|
78065
78328
|
}
|
|
78066
|
-
await reapLspDaemons(codexHome).catch(() =>
|
|
78329
|
+
const legacyDaemonCleanup = await reapLspDaemons(codexHome).catch((error) => {
|
|
78330
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
78331
|
+
log4(`Warning: skipped legacy Codex LSP daemon cleanup: ${message}`);
|
|
78332
|
+
return [];
|
|
78333
|
+
});
|
|
78334
|
+
for (const cleanup of legacyDaemonCleanup) {
|
|
78335
|
+
if (cleanup.status !== "deferred")
|
|
78336
|
+
continue;
|
|
78337
|
+
log4(`Warning: deferred legacy Codex LSP daemon cleanup for v${cleanup.version}: ${cleanup.reason}`);
|
|
78338
|
+
}
|
|
78067
78339
|
const marketplaceRoot = join55(codexHome, "plugins", "cache", marketplace.name);
|
|
78068
78340
|
await writeCachedMarketplaceManifest({
|
|
78069
78341
|
marketplaceName: marketplace.name,
|
|
@@ -78155,10 +78427,10 @@ function codexMarketplaceSource(marketplaceRoot) {
|
|
|
78155
78427
|
}
|
|
78156
78428
|
// packages/omo-codex/src/install/codex-installation-detection.ts
|
|
78157
78429
|
init_bun_which_shim();
|
|
78158
|
-
import { execFile as
|
|
78430
|
+
import { execFile as execFile3 } from "child_process";
|
|
78159
78431
|
import { existsSync as existsSync31 } from "fs";
|
|
78160
78432
|
import { homedir as homedir7 } from "os";
|
|
78161
|
-
import { posix as
|
|
78433
|
+
import { posix as posix4, win32 as win323 } from "path";
|
|
78162
78434
|
var CODEX_PATH_CHECK_LABEL = "codex (PATH)";
|
|
78163
78435
|
var WINDOWS_START_APPS_ARGS = [
|
|
78164
78436
|
"-NoProfile",
|
|
@@ -78235,11 +78507,11 @@ async function findWindowsCodexStartApp(runCommand) {
|
|
|
78235
78507
|
}
|
|
78236
78508
|
}
|
|
78237
78509
|
function macCodexAppPaths(homeDir) {
|
|
78238
|
-
return ["/Applications/Codex.app",
|
|
78510
|
+
return ["/Applications/Codex.app", posix4.join(homeDir, "Applications", "Codex.app")];
|
|
78239
78511
|
}
|
|
78240
78512
|
function macCodexDmgPaths(homeDir) {
|
|
78241
|
-
const downloads =
|
|
78242
|
-
return [
|
|
78513
|
+
const downloads = posix4.join(homeDir, "Downloads");
|
|
78514
|
+
return [posix4.join(downloads, "codex.dmg"), posix4.join(downloads, "Codex.dmg")];
|
|
78243
78515
|
}
|
|
78244
78516
|
function windowsCodexCliPaths(env3) {
|
|
78245
78517
|
const candidates = [];
|
|
@@ -78277,18 +78549,18 @@ function dedupe(values) {
|
|
|
78277
78549
|
}
|
|
78278
78550
|
function defaultRunCommand2(command, args) {
|
|
78279
78551
|
return new Promise((resolve16) => {
|
|
78280
|
-
|
|
78552
|
+
execFile3(command, [...args], { encoding: "utf8", windowsHide: true }, (error, stdout) => {
|
|
78281
78553
|
resolve16({ success: error === null, stdout });
|
|
78282
78554
|
});
|
|
78283
78555
|
});
|
|
78284
78556
|
}
|
|
78285
78557
|
// packages/omo-codex/src/install/codex-cleanup.ts
|
|
78286
|
-
import { lstat as
|
|
78558
|
+
import { lstat as lstat13, readFile as readFile22, readdir as readdir11, rm as rm11, rmdir } from "fs/promises";
|
|
78287
78559
|
import { homedir as homedir8 } from "os";
|
|
78288
78560
|
import { isAbsolute as isAbsolute11, join as join57, relative as relative7, resolve as resolve17 } from "path";
|
|
78289
78561
|
|
|
78290
78562
|
// packages/omo-codex/src/install/codex-cleanup-config.ts
|
|
78291
|
-
import { lstat as
|
|
78563
|
+
import { lstat as lstat12, mkdir as mkdir8, readFile as readFile21, writeFile as writeFile12 } from "fs/promises";
|
|
78292
78564
|
import { dirname as dirname19 } from "path";
|
|
78293
78565
|
var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
|
|
78294
78566
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
|
|
@@ -78321,7 +78593,7 @@ function cleanupCodexLightConfigText(config) {
|
|
|
78321
78593
|
async function cleanupCodexConfig(configPath, now) {
|
|
78322
78594
|
if (!await configExists(configPath))
|
|
78323
78595
|
return { changed: false };
|
|
78324
|
-
const original = await
|
|
78596
|
+
const original = await readFile21(configPath, "utf8");
|
|
78325
78597
|
const next = cleanupCodexLightConfigText(original);
|
|
78326
78598
|
if (next === original)
|
|
78327
78599
|
return { changed: false };
|
|
@@ -78390,7 +78662,7 @@ function formatBackupTimestamp2(date) {
|
|
|
78390
78662
|
}
|
|
78391
78663
|
async function configExists(path7) {
|
|
78392
78664
|
try {
|
|
78393
|
-
await
|
|
78665
|
+
await lstat12(path7);
|
|
78394
78666
|
return true;
|
|
78395
78667
|
} catch (error) {
|
|
78396
78668
|
if (nodeErrorCode5(error) === "ENOENT")
|
|
@@ -78508,7 +78780,7 @@ async function collectBootstrapDataDirsByGlob(codexHome) {
|
|
|
78508
78780
|
async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
78509
78781
|
if (depth > BOOTSTRAP_DATA_GLOB_MAX_DEPTH)
|
|
78510
78782
|
return;
|
|
78511
|
-
const entries = await
|
|
78783
|
+
const entries = await readdir11(directory, { withFileTypes: true }).catch(() => null);
|
|
78512
78784
|
if (entries === null)
|
|
78513
78785
|
return;
|
|
78514
78786
|
for (const entry of entries) {
|
|
@@ -78540,7 +78812,7 @@ async function removeManagedPathBestEffort(path7, seams) {
|
|
|
78540
78812
|
}
|
|
78541
78813
|
async function attemptRemove(path7) {
|
|
78542
78814
|
try {
|
|
78543
|
-
if (await
|
|
78815
|
+
if (await lstat13(path7).catch(() => null) === null)
|
|
78544
78816
|
return false;
|
|
78545
78817
|
await rm11(path7, { recursive: true, force: true });
|
|
78546
78818
|
return true;
|
|
@@ -78566,7 +78838,7 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
|
78566
78838
|
];
|
|
78567
78839
|
const versionRoot = join57(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
|
|
78568
78840
|
if (await exists6(versionRoot)) {
|
|
78569
|
-
const entries = await
|
|
78841
|
+
const entries = await readdir11(versionRoot, { withFileTypes: true });
|
|
78570
78842
|
for (const entry of entries) {
|
|
78571
78843
|
if (entry.isDirectory())
|
|
78572
78844
|
manifestPaths.push(join57(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
|
|
@@ -78586,20 +78858,20 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
|
78586
78858
|
async function readManagedAgentPathsFromConfig(codexHome, configPath) {
|
|
78587
78859
|
if (!await exists6(configPath))
|
|
78588
78860
|
return [];
|
|
78589
|
-
const config = await
|
|
78861
|
+
const config = await readFile22(configPath, "utf8");
|
|
78590
78862
|
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join57(codexHome, "agents", `${agentName}.toml`));
|
|
78591
78863
|
}
|
|
78592
78864
|
async function readInstalledAgentManifest(manifestPath) {
|
|
78593
78865
|
if (!await exists6(manifestPath))
|
|
78594
78866
|
return [];
|
|
78595
|
-
const parsed = JSON.parse(await
|
|
78867
|
+
const parsed = JSON.parse(await readFile22(manifestPath, "utf8"));
|
|
78596
78868
|
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
|
|
78597
78869
|
return [];
|
|
78598
78870
|
return parsed.agents.filter((path7) => typeof path7 === "string");
|
|
78599
78871
|
}
|
|
78600
78872
|
async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
78601
78873
|
const agentsDir = join57(codexHome, "agents");
|
|
78602
|
-
const
|
|
78874
|
+
const removed2 = [];
|
|
78603
78875
|
const skipped2 = [];
|
|
78604
78876
|
for (const path7 of paths) {
|
|
78605
78877
|
if (!isSafeManagedAgentPath(agentsDir, path7)) {
|
|
@@ -78614,9 +78886,9 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
|
78614
78886
|
continue;
|
|
78615
78887
|
}
|
|
78616
78888
|
await rm11(path7, { force: true });
|
|
78617
|
-
|
|
78889
|
+
removed2.push(path7);
|
|
78618
78890
|
}
|
|
78619
|
-
return { removed, skipped: skipped2 };
|
|
78891
|
+
return { removed: removed2, skipped: skipped2 };
|
|
78620
78892
|
}
|
|
78621
78893
|
function isSafeManagedAgentPath(agentsDir, path7) {
|
|
78622
78894
|
if (!isAbsolute11(path7))
|
|
@@ -78634,7 +78906,7 @@ async function exists6(path7) {
|
|
|
78634
78906
|
}
|
|
78635
78907
|
async function maybeLstat2(path7) {
|
|
78636
78908
|
try {
|
|
78637
|
-
return await
|
|
78909
|
+
return await lstat13(path7);
|
|
78638
78910
|
} catch (error) {
|
|
78639
78911
|
if (nodeErrorCode6(error) === "ENOENT")
|
|
78640
78912
|
return null;
|
|
@@ -78649,18 +78921,26 @@ function nodeErrorCode6(error) {
|
|
|
78649
78921
|
// packages/omo-codex/src/install/codex-git-bash-mcp-env.ts
|
|
78650
78922
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
78651
78923
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
78652
|
-
import { execFile as
|
|
78924
|
+
import { execFile as execFile4 } from "child_process";
|
|
78653
78925
|
import { constants as constants7, existsSync as existsSync32 } from "fs";
|
|
78654
|
-
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as
|
|
78926
|
+
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile23, rename as rename5, writeFile as writeFile13 } from "fs/promises";
|
|
78655
78927
|
import { homedir as homedir9 } from "os";
|
|
78656
78928
|
import { dirname as dirname21, join as join58, resolve as resolve18 } from "path";
|
|
78657
78929
|
import { fileURLToPath } from "url";
|
|
78658
78930
|
import { promisify as promisify2 } from "util";
|
|
78659
|
-
var execFileAsync2 = promisify2(
|
|
78931
|
+
var execFileAsync2 = promisify2(execFile4);
|
|
78660
78932
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
78661
78933
|
join58("extensions", "omo.js"),
|
|
78662
78934
|
join58("skills", "ultrawork", "SKILL.md"),
|
|
78663
|
-
join58("skills", "ulw-loop", "SKILL.md")
|
|
78935
|
+
join58("skills", "ulw-loop", "SKILL.md"),
|
|
78936
|
+
join58("runtime", "lsp-daemon", "dist", "cli.js"),
|
|
78937
|
+
join58("runtime", "lsp-daemon", "dist", "index.js"),
|
|
78938
|
+
join58("runtime", "lsp-daemon", "dist", "index.d.ts"),
|
|
78939
|
+
join58("runtime", "lsp-daemon", "dist", "daemon-client.js"),
|
|
78940
|
+
join58("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
|
|
78941
|
+
join58("runtime", "lsp-daemon", "dist", "package.json"),
|
|
78942
|
+
join58("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
78943
|
+
join58("scripts", "install.mjs")
|
|
78664
78944
|
];
|
|
78665
78945
|
async function runSenpiInstaller(options = {}) {
|
|
78666
78946
|
const context = resolveInstallContext(options);
|
|
@@ -78684,7 +78964,8 @@ async function runSenpiInstaller(options = {}) {
|
|
|
78684
78964
|
}
|
|
78685
78965
|
function resolveInstallContext(options) {
|
|
78686
78966
|
const env3 = options.env ?? process.env;
|
|
78687
|
-
const
|
|
78967
|
+
const allowBuild = options.pluginPath === undefined;
|
|
78968
|
+
const repoRoot = resolve18(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname21(fileURLToPath(import.meta.url))) : dirname21(resolve18(options.pluginPath))));
|
|
78688
78969
|
const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join58(homedir9(), ".senpi", "agent"));
|
|
78689
78970
|
const pluginPath = resolve18(options.pluginPath ?? join58(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
78690
78971
|
return {
|
|
@@ -78693,6 +78974,7 @@ function resolveInstallContext(options) {
|
|
|
78693
78974
|
agentDir,
|
|
78694
78975
|
settingsPath: join58(agentDir, "settings.json"),
|
|
78695
78976
|
pluginPath,
|
|
78977
|
+
allowBuild,
|
|
78696
78978
|
runCommand: options.runCommand ?? defaultRunCommand3
|
|
78697
78979
|
};
|
|
78698
78980
|
}
|
|
@@ -78700,8 +78982,13 @@ async function ensurePluginArtifacts(context) {
|
|
|
78700
78982
|
const missing = await hasMissingPluginArtifact(context.pluginPath);
|
|
78701
78983
|
if (!missing)
|
|
78702
78984
|
return;
|
|
78985
|
+
if (!context.allowBuild) {
|
|
78986
|
+
throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
|
|
78987
|
+
}
|
|
78703
78988
|
await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
78704
78989
|
await context.runCommand("node", [join58(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
78990
|
+
await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
|
|
78991
|
+
await context.runCommand("node", [join58(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
|
|
78705
78992
|
}
|
|
78706
78993
|
async function hasMissingPluginArtifact(pluginPath) {
|
|
78707
78994
|
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
@@ -78720,7 +79007,7 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
78720
79007
|
async function readSettings(settingsPath) {
|
|
78721
79008
|
let raw;
|
|
78722
79009
|
try {
|
|
78723
|
-
raw = await
|
|
79010
|
+
raw = await readFile23(settingsPath, "utf8");
|
|
78724
79011
|
} catch (error) {
|
|
78725
79012
|
if (isErrno(error, "ENOENT"))
|
|
78726
79013
|
return {};
|
|
@@ -78799,7 +79086,7 @@ function isErrno(error, code) {
|
|
|
78799
79086
|
return error instanceof Error && "code" in error && error.code === code;
|
|
78800
79087
|
}
|
|
78801
79088
|
// packages/omo-opencode/src/cli/star-request.ts
|
|
78802
|
-
import { execFile as
|
|
79089
|
+
import { execFile as execFile5 } from "child_process";
|
|
78803
79090
|
import { promisify as promisify3 } from "util";
|
|
78804
79091
|
var STAR_REPOSITORIES = [
|
|
78805
79092
|
"code-yeongyu/oh-my-openagent",
|
|
@@ -78811,7 +79098,7 @@ var PLATFORM_REPOSITORIES = {
|
|
|
78811
79098
|
both: STAR_REPOSITORIES,
|
|
78812
79099
|
senpi: STAR_REPOSITORIES
|
|
78813
79100
|
};
|
|
78814
|
-
var execFileAsync3 = promisify3(
|
|
79101
|
+
var execFileAsync3 = promisify3(execFile5);
|
|
78815
79102
|
async function runGitHubStarCommand(repository) {
|
|
78816
79103
|
await execFileAsync3("gh", ["api", "--silent", "--method", "PUT", `/user/starred/${repository}`]);
|
|
78817
79104
|
}
|
|
@@ -97181,7 +97468,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
97181
97468
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
97182
97469
|
init_bun_which_shim();
|
|
97183
97470
|
init_spawn_with_windows_hide();
|
|
97184
|
-
import { delimiter as delimiter2, dirname as dirname23, posix as
|
|
97471
|
+
import { delimiter as delimiter2, dirname as dirname23, posix as posix5, win32 as win324 } from "path";
|
|
97185
97472
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
97186
97473
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
97187
97474
|
function getCommandCandidates(platform) {
|
|
@@ -97192,7 +97479,7 @@ function getCommandCandidates(platform) {
|
|
|
97192
97479
|
function getPathTools(platform) {
|
|
97193
97480
|
if (platform === "win32")
|
|
97194
97481
|
return win324;
|
|
97195
|
-
return
|
|
97482
|
+
return posix5;
|
|
97196
97483
|
}
|
|
97197
97484
|
function collectCandidateBinaryPaths(pathEnv, which2 = bunWhich, platform = process.platform) {
|
|
97198
97485
|
const seen = new Set;
|
|
@@ -99070,6 +99357,10 @@ function formatVersionOutput(info) {
|
|
|
99070
99357
|
lines.push(` ${SYMBOLS3.dev} ${import_picocolors17.default.cyan("Running in local development mode")}`);
|
|
99071
99358
|
lines.push(` ${import_picocolors17.default.dim("Using file:// protocol from config")}`);
|
|
99072
99359
|
break;
|
|
99360
|
+
case "dev":
|
|
99361
|
+
lines.push(` ${SYMBOLS3.dev} ${import_picocolors17.default.cyan("Running a local dev build")}`);
|
|
99362
|
+
lines.push(` ${import_picocolors17.default.dim("Installed from source; update checks are skipped")}`);
|
|
99363
|
+
break;
|
|
99073
99364
|
case "pinned":
|
|
99074
99365
|
lines.push(` ${SYMBOLS3.pin} ${import_picocolors17.default.magenta(`Version pinned to ${info.pinnedVersion}`)}`);
|
|
99075
99366
|
lines.push(` ${import_picocolors17.default.dim("Update check skipped for pinned versions")}`);
|
|
@@ -99142,6 +99433,19 @@ async function getLocalVersion(options = {}) {
|
|
|
99142
99433
|
console.log(options.json ? formatJsonOutput(info2) : formatVersionOutput(info2));
|
|
99143
99434
|
return 1;
|
|
99144
99435
|
}
|
|
99436
|
+
if (!/^\d+\.\d+\.\d+/.test(currentVersion)) {
|
|
99437
|
+
const info2 = {
|
|
99438
|
+
currentVersion,
|
|
99439
|
+
latestVersion: null,
|
|
99440
|
+
isUpToDate: false,
|
|
99441
|
+
isLocalDev: true,
|
|
99442
|
+
isPinned: false,
|
|
99443
|
+
pinnedVersion: null,
|
|
99444
|
+
status: "dev"
|
|
99445
|
+
};
|
|
99446
|
+
console.log(options.json ? formatJsonOutput(info2) : formatVersionOutput(info2));
|
|
99447
|
+
return 0;
|
|
99448
|
+
}
|
|
99145
99449
|
const { extractChannel: extractChannel2 } = await Promise.resolve().then(() => (init_auto_update_checker(), exports_auto_update_checker));
|
|
99146
99450
|
const channel = extractChannel2(pluginInfo?.pinnedVersion ?? currentVersion);
|
|
99147
99451
|
const latestVersion = await getLatestVersion(channel);
|
|
@@ -100334,12 +100638,12 @@ import { dirname as dirname30, join as join79 } from "path";
|
|
|
100334
100638
|
|
|
100335
100639
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
100336
100640
|
import { join as join78 } from "path";
|
|
100337
|
-
import { homedir as homedir18, tmpdir as
|
|
100641
|
+
import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
|
|
100338
100642
|
init_binary_downloader();
|
|
100339
100643
|
init_logger2();
|
|
100340
100644
|
init_plugin_identity();
|
|
100341
100645
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
100342
|
-
var DEBUG_FILE = join78(
|
|
100646
|
+
var DEBUG_FILE = join78(tmpdir4(), "comment-checker-debug.log");
|
|
100343
100647
|
function getCacheDir2() {
|
|
100344
100648
|
if (process.platform === "win32") {
|
|
100345
100649
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
@@ -100576,13 +100880,14 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
100576
100880
|
}
|
|
100577
100881
|
|
|
100578
100882
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
100579
|
-
import { readFileSync as
|
|
100883
|
+
import { readFileSync as readFileSync39 } from "fs";
|
|
100580
100884
|
import { join as join80 } from "path";
|
|
100581
100885
|
|
|
100582
100886
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
100583
|
-
import { existsSync as existsSync56 } from "fs";
|
|
100887
|
+
import { existsSync as existsSync56, readFileSync as readFileSync38 } from "fs";
|
|
100584
100888
|
import { delimiter as delimiter3, dirname as dirname31, resolve as resolve21 } from "path";
|
|
100585
100889
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
100890
|
+
init_opencode_config_dir();
|
|
100586
100891
|
|
|
100587
100892
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
100588
100893
|
function normalizeCliPath(path14) {
|
|
@@ -100594,7 +100899,7 @@ function hasCliSuffix(candidatePath, suffix) {
|
|
|
100594
100899
|
|
|
100595
100900
|
// packages/omo-opencode/src/mcp/runtime-executable.ts
|
|
100596
100901
|
init_bun_which_shim();
|
|
100597
|
-
import { basename as
|
|
100902
|
+
import { basename as basename13 } from "path";
|
|
100598
100903
|
var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
|
|
100599
100904
|
function isUnsafeCommandName2(commandName) {
|
|
100600
100905
|
if (commandName.length === 0)
|
|
@@ -100610,7 +100915,7 @@ function isUnsafeCommandName2(commandName) {
|
|
|
100610
100915
|
return false;
|
|
100611
100916
|
}
|
|
100612
100917
|
function isNodeExecPath(execPath) {
|
|
100613
|
-
return NODE_EXECUTABLE_NAMES.has(
|
|
100918
|
+
return NODE_EXECUTABLE_NAMES.has(basename13(execPath).toLowerCase());
|
|
100614
100919
|
}
|
|
100615
100920
|
function resolveRuntimeExecutable(commandName, options = {}) {
|
|
100616
100921
|
if (isUnsafeCommandName2(commandName)) {
|
|
@@ -100680,8 +100985,15 @@ var LSP_TOOLS_PACKAGE_REL = "packages/lsp-tools-mcp";
|
|
|
100680
100985
|
var DIST_CLI_REL = "dist/cli.js";
|
|
100681
100986
|
var SOURCE_CLI_REL = "src/cli.ts";
|
|
100682
100987
|
var PROJECT_LSP_CONFIGS = [".opencode/lsp.json", ".omo/lsp.json", ".omo/lsp-client.json"];
|
|
100988
|
+
var DAEMON_PACKAGE_NAME = "@code-yeongyu/lsp-daemon";
|
|
100989
|
+
var OMO_LSP_DAEMON_CLI = "OMO_LSP_DAEMON_CLI";
|
|
100990
|
+
var OMO_LSP_DAEMON_VERSION = "OMO_LSP_DAEMON_VERSION";
|
|
100991
|
+
var DaemonPackageSchema = exports_external.object({
|
|
100992
|
+
version: exports_external.string().min(1)
|
|
100993
|
+
});
|
|
100683
100994
|
var LSP_BOOTSTRAP_SCRIPT = [
|
|
100684
100995
|
"const { existsSync } = require('node:fs')",
|
|
100996
|
+
"const { createRequire } = require('node:module')",
|
|
100685
100997
|
"const { join } = require('node:path')",
|
|
100686
100998
|
"const { spawnSync } = require('node:child_process')",
|
|
100687
100999
|
"const root = process.argv[1]",
|
|
@@ -100690,16 +101002,18 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
100690
101002
|
`const toolsPackage = join(root, '${LSP_TOOLS_PACKAGE_REL}')`,
|
|
100691
101003
|
`const daemonPackage = join(root, '${PACKAGE_REL}')`,
|
|
100692
101004
|
"const toolsDist = join(toolsPackage, 'dist/cli.js')",
|
|
100693
|
-
"const
|
|
101005
|
+
"const daemonPackageJson = join(daemonPackage, 'package.json')",
|
|
100694
101006
|
"const daemonSource = join(daemonPackage, 'src/cli.ts')",
|
|
100695
101007
|
"const run = (command, args, stdio) => spawnSync(command, args, { cwd: root, env: process.env, stdio })",
|
|
100696
101008
|
"const finish = (result) => { if (result.error) { console.error(result.error.message); process.exit(1) } process.exit(result.status ?? 1) }",
|
|
100697
101009
|
"const runIfAvailable = (command, args) => { const result = run(command, args, 'inherit'); if (result.error) return false; finish(result); return true }",
|
|
100698
|
-
|
|
100699
|
-
"
|
|
101010
|
+
`const resolveDaemonCli = () => { try { return createRequire(daemonPackageJson).resolve('${DAEMON_PACKAGE_NAME}/cli') } catch (error) { if (error instanceof Error) return null; throw error } }`,
|
|
101011
|
+
"const daemonCli = existsSync(daemonPackageJson) ? resolveDaemonCli() : null",
|
|
101012
|
+
"if (daemonCli) finish(run(process.execPath, [daemonCli, 'mcp'], 'inherit'))",
|
|
101013
|
+
`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']) }`,
|
|
100700
101014
|
"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']]]",
|
|
100701
101015
|
"for (const [command, args] of steps) { const result = run(command, args, ['ignore', 'ignore', 'inherit']); if (result.error || result.status !== 0) finish(result) }",
|
|
100702
|
-
"finish(run(process.execPath, [
|
|
101016
|
+
"finish(run(process.execPath, [resolveDaemonCli(), 'mcp'], 'inherit'))"
|
|
100703
101017
|
].join(";");
|
|
100704
101018
|
function getModuleDirectory(moduleUrl) {
|
|
100705
101019
|
try {
|
|
@@ -100713,6 +101027,16 @@ function getModuleDirectory(moduleUrl) {
|
|
|
100713
101027
|
function findBootstrapRoot(candidates, pathExists) {
|
|
100714
101028
|
return candidates.find((candidate) => pathExists(resolve21(candidate.root, "package.json")))?.root ?? process.cwd();
|
|
100715
101029
|
}
|
|
101030
|
+
function readDaemonPackageVersion(root) {
|
|
101031
|
+
try {
|
|
101032
|
+
const packageJson = JSON.parse(readFileSync38(resolve21(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
101033
|
+
return DaemonPackageSchema.parse(packageJson).version;
|
|
101034
|
+
} catch (error51) {
|
|
101035
|
+
if (!(error51 instanceof Error))
|
|
101036
|
+
throw error51;
|
|
101037
|
+
return null;
|
|
101038
|
+
}
|
|
101039
|
+
}
|
|
100716
101040
|
function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
100717
101041
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
100718
101042
|
const bun = resolveExecutable("bun");
|
|
@@ -100737,7 +101061,7 @@ function resolveLspCommand(options = {}) {
|
|
|
100737
101061
|
sourceCliRel: SOURCE_CLI_REL,
|
|
100738
101062
|
pathExists,
|
|
100739
101063
|
resolveExecutable,
|
|
100740
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL))
|
|
101064
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
|
|
100741
101065
|
}) : [];
|
|
100742
101066
|
const distCandidate = candidates.find((candidate) => hasCliSuffix(candidate.path, DIST_CLI_REL) && candidate.exists);
|
|
100743
101067
|
if (distCandidate) {
|
|
@@ -100751,12 +101075,21 @@ function resolveLspCommand(options = {}) {
|
|
|
100751
101075
|
}
|
|
100752
101076
|
function createLspMcpConfig(options = {}) {
|
|
100753
101077
|
const resolvedCommand = resolveLspCommand(options);
|
|
101078
|
+
const cwd = resolve21(options.cwd ?? process.cwd());
|
|
101079
|
+
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
101080
|
+
const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
|
|
100754
101081
|
return {
|
|
100755
101082
|
type: "local",
|
|
100756
101083
|
command: resolvedCommand.command,
|
|
100757
101084
|
enabled: resolvedCommand.exists,
|
|
100758
101085
|
environment: {
|
|
100759
|
-
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.join(delimiter3)
|
|
101086
|
+
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve21(cwd, configPath)).join(delimiter3),
|
|
101087
|
+
LSP_TOOLS_MCP_USER_CONFIG: resolve21(configDir, "lsp.json"),
|
|
101088
|
+
LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve21(configDir, "lsp-install-decisions.json"),
|
|
101089
|
+
...sourceVersion ? {
|
|
101090
|
+
[OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
|
|
101091
|
+
[OMO_LSP_DAEMON_VERSION]: sourceVersion
|
|
101092
|
+
} : {}
|
|
100760
101093
|
}
|
|
100761
101094
|
};
|
|
100762
101095
|
}
|
|
@@ -100773,7 +101106,7 @@ function readOmoConfig(configDirectory) {
|
|
|
100773
101106
|
return null;
|
|
100774
101107
|
}
|
|
100775
101108
|
try {
|
|
100776
|
-
const content =
|
|
101109
|
+
const content = readFileSync39(detected.path, "utf-8");
|
|
100777
101110
|
return parseJsonc(content);
|
|
100778
101111
|
} catch (error51) {
|
|
100779
101112
|
if (!(error51 instanceof Error)) {
|
|
@@ -100803,7 +101136,7 @@ function getInstalledLspServers(options = {}) {
|
|
|
100803
101136
|
|
|
100804
101137
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
100805
101138
|
init_shared();
|
|
100806
|
-
import { existsSync as existsSync57, readFileSync as
|
|
101139
|
+
import { existsSync as existsSync57, readFileSync as readFileSync40 } from "fs";
|
|
100807
101140
|
import { homedir as homedir20 } from "os";
|
|
100808
101141
|
import { join as join81 } from "path";
|
|
100809
101142
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
@@ -100820,7 +101153,7 @@ function loadUserMcpConfig() {
|
|
|
100820
101153
|
if (!existsSync57(configPath))
|
|
100821
101154
|
continue;
|
|
100822
101155
|
try {
|
|
100823
|
-
const content =
|
|
101156
|
+
const content = readFileSync40(configPath, "utf-8");
|
|
100824
101157
|
const config3 = parseJsonc(content);
|
|
100825
101158
|
if (config3.mcpServers) {
|
|
100826
101159
|
Object.assign(servers, config3.mcpServers);
|
|
@@ -100955,7 +101288,7 @@ async function checkTools() {
|
|
|
100955
101288
|
|
|
100956
101289
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
100957
101290
|
init_src4();
|
|
100958
|
-
import { existsSync as existsSync58, readFileSync as
|
|
101291
|
+
import { existsSync as existsSync58, readFileSync as readFileSync41 } from "fs";
|
|
100959
101292
|
function isTelemetryState(value) {
|
|
100960
101293
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
100961
101294
|
}
|
|
@@ -100965,7 +101298,7 @@ function readLastActiveDay(stateFilePath) {
|
|
|
100965
101298
|
}
|
|
100966
101299
|
let parsed;
|
|
100967
101300
|
try {
|
|
100968
|
-
parsed = JSON.parse(
|
|
101301
|
+
parsed = JSON.parse(readFileSync41(stateFilePath, "utf-8"));
|
|
100969
101302
|
} catch (error51) {
|
|
100970
101303
|
if (error51 instanceof Error) {
|
|
100971
101304
|
return "unreadable";
|
|
@@ -101040,7 +101373,7 @@ function expandHomeDirectory(directoryPath) {
|
|
|
101040
101373
|
// packages/omo-opencode/src/cli/doctor/checks/team-mode.ts
|
|
101041
101374
|
init_shared();
|
|
101042
101375
|
init_plugin_identity();
|
|
101043
|
-
import { readFileSync as
|
|
101376
|
+
import { readFileSync as readFileSync42, promises as fs13 } from "fs";
|
|
101044
101377
|
import path15 from "path";
|
|
101045
101378
|
async function checkTeamMode() {
|
|
101046
101379
|
const config3 = loadTeamModeConfig();
|
|
@@ -101077,7 +101410,7 @@ function loadTeamModeConfig() {
|
|
|
101077
101410
|
if (!configPath)
|
|
101078
101411
|
return { team_mode: undefined };
|
|
101079
101412
|
try {
|
|
101080
|
-
return parseJsonc(
|
|
101413
|
+
return parseJsonc(readFileSync42(configPath, "utf-8"));
|
|
101081
101414
|
} catch (error51) {
|
|
101082
101415
|
if (error51 instanceof Error) {
|
|
101083
101416
|
return { team_mode: undefined };
|
|
@@ -101111,9 +101444,9 @@ async function pathExists(dir) {
|
|
|
101111
101444
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
101112
101445
|
init_src();
|
|
101113
101446
|
import { existsSync as existsSync59 } from "fs";
|
|
101114
|
-
import { lstat as
|
|
101447
|
+
import { lstat as lstat14, readdir as readdir12, readFile as readFile24 } from "fs/promises";
|
|
101115
101448
|
import { homedir as homedir22 } from "os";
|
|
101116
|
-
import { basename as
|
|
101449
|
+
import { basename as basename14, join as join82, resolve as resolve22 } from "path";
|
|
101117
101450
|
// packages/omo-opencode/package.json
|
|
101118
101451
|
var package_default3 = {
|
|
101119
101452
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -101302,7 +101635,7 @@ async function resolveInstalledPluginRoot(codexHome) {
|
|
|
101302
101635
|
const pluginRoot = join82(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
101303
101636
|
if (!existsSync59(pluginRoot))
|
|
101304
101637
|
return null;
|
|
101305
|
-
const versions2 = await
|
|
101638
|
+
const versions2 = await readdir12(pluginRoot, { withFileTypes: true });
|
|
101306
101639
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
101307
101640
|
return candidates.length === 0 ? null : join82(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
101308
101641
|
}
|
|
@@ -101318,7 +101651,7 @@ async function readCodexConfigSummary(configPath) {
|
|
|
101318
101651
|
companionLifecycleHookStateEvents: []
|
|
101319
101652
|
};
|
|
101320
101653
|
}
|
|
101321
|
-
const content = await
|
|
101654
|
+
const content = await readFile24(configPath, "utf8");
|
|
101322
101655
|
return {
|
|
101323
101656
|
exists: true,
|
|
101324
101657
|
marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
|
|
@@ -101341,12 +101674,12 @@ async function readLinkedAgents(codexHome) {
|
|
|
101341
101674
|
const agentsDir = join82(codexHome, "agents");
|
|
101342
101675
|
if (!existsSync59(agentsDir))
|
|
101343
101676
|
return [];
|
|
101344
|
-
const entries = await
|
|
101345
|
-
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) =>
|
|
101677
|
+
const entries = await readdir12(agentsDir, { withFileTypes: true });
|
|
101678
|
+
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename14(entry.name, ".toml")).sort();
|
|
101346
101679
|
}
|
|
101347
101680
|
async function readJson(path16) {
|
|
101348
101681
|
try {
|
|
101349
|
-
const parsed = JSON.parse(await
|
|
101682
|
+
const parsed = JSON.parse(await readFile24(path16, "utf8"));
|
|
101350
101683
|
return isPlainRecord(parsed) ? parsed : null;
|
|
101351
101684
|
} catch (error51) {
|
|
101352
101685
|
if (error51 instanceof Error)
|
|
@@ -101441,7 +101774,7 @@ function compareVersionsDescending(left, right) {
|
|
|
101441
101774
|
}
|
|
101442
101775
|
async function pathExists2(path16) {
|
|
101443
101776
|
try {
|
|
101444
|
-
await
|
|
101777
|
+
await lstat14(path16);
|
|
101445
101778
|
return true;
|
|
101446
101779
|
} catch (error51) {
|
|
101447
101780
|
if (error51 instanceof Error)
|
|
@@ -101452,7 +101785,7 @@ async function pathExists2(path16) {
|
|
|
101452
101785
|
|
|
101453
101786
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
101454
101787
|
init_src();
|
|
101455
|
-
import { readdir as
|
|
101788
|
+
import { readdir as readdir13, readFile as readFile25, stat as stat6 } from "fs/promises";
|
|
101456
101789
|
import { homedir as homedir23 } from "os";
|
|
101457
101790
|
import { dirname as dirname32, isAbsolute as isAbsolute13, join as join83, relative as relative10, resolve as resolve23, sep as sep9 } from "path";
|
|
101458
101791
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
@@ -101593,7 +101926,7 @@ async function findHookManifestPaths(root) {
|
|
|
101593
101926
|
async function findManifestPaths(root, manifestName) {
|
|
101594
101927
|
let entries;
|
|
101595
101928
|
try {
|
|
101596
|
-
entries = await
|
|
101929
|
+
entries = await readdir13(root, { withFileTypes: true });
|
|
101597
101930
|
} catch {
|
|
101598
101931
|
return [];
|
|
101599
101932
|
}
|
|
@@ -101705,7 +102038,7 @@ function degradedDetailLines(entries) {
|
|
|
101705
102038
|
}
|
|
101706
102039
|
async function readJson2(path16) {
|
|
101707
102040
|
try {
|
|
101708
|
-
const parsed = JSON.parse(await
|
|
102041
|
+
const parsed = JSON.parse(await readFile25(path16, "utf8"));
|
|
101709
102042
|
return isRecord6(parsed) ? parsed : null;
|
|
101710
102043
|
} catch (error51) {
|
|
101711
102044
|
if (error51 instanceof Error)
|
|
@@ -101733,7 +102066,7 @@ function isRecord6(value) {
|
|
|
101733
102066
|
|
|
101734
102067
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
101735
102068
|
import { existsSync as existsSync60 } from "fs";
|
|
101736
|
-
import { readFile as
|
|
102069
|
+
import { readFile as readFile26 } from "fs/promises";
|
|
101737
102070
|
import { homedir as homedir24 } from "os";
|
|
101738
102071
|
import { join as join84, resolve as resolve24 } from "path";
|
|
101739
102072
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
@@ -101768,7 +102101,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
|
|
|
101768
102101
|
}
|
|
101769
102102
|
async function readRuntimeWrapper(path16) {
|
|
101770
102103
|
try {
|
|
101771
|
-
return await
|
|
102104
|
+
return await readFile26(path16, "utf8");
|
|
101772
102105
|
} catch (error51) {
|
|
101773
102106
|
if (error51 instanceof Error)
|
|
101774
102107
|
return null;
|
|
@@ -102244,18 +102577,18 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
102244
102577
|
}
|
|
102245
102578
|
|
|
102246
102579
|
// packages/mcp-client-core/src/mcp-oauth/storage.ts
|
|
102247
|
-
import { createHash as
|
|
102580
|
+
import { createHash as createHash5 } from "crypto";
|
|
102248
102581
|
import {
|
|
102249
102582
|
chmodSync as chmodSync4,
|
|
102250
102583
|
existsSync as existsSync63,
|
|
102251
102584
|
mkdirSync as mkdirSync14,
|
|
102252
102585
|
readdirSync as readdirSync9,
|
|
102253
|
-
readFileSync as
|
|
102586
|
+
readFileSync as readFileSync44,
|
|
102254
102587
|
renameSync as renameSync7,
|
|
102255
102588
|
unlinkSync as unlinkSync8,
|
|
102256
102589
|
writeFileSync as writeFileSync11
|
|
102257
102590
|
} from "fs";
|
|
102258
|
-
import { basename as
|
|
102591
|
+
import { basename as basename15, dirname as dirname33, join as join87 } from "path";
|
|
102259
102592
|
|
|
102260
102593
|
// packages/mcp-client-core/src/config-dir.ts
|
|
102261
102594
|
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
|
|
@@ -102283,7 +102616,7 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
102283
102616
|
}
|
|
102284
102617
|
|
|
102285
102618
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
102286
|
-
import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as
|
|
102619
|
+
import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync43, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "fs";
|
|
102287
102620
|
import { join as join86 } from "path";
|
|
102288
102621
|
var INDEX_FILE_NAME = "index.json";
|
|
102289
102622
|
function isTokenIndex(value) {
|
|
@@ -102299,7 +102632,7 @@ function readTokenIndex(storageDir) {
|
|
|
102299
102632
|
if (!existsSync62(indexPath))
|
|
102300
102633
|
return {};
|
|
102301
102634
|
try {
|
|
102302
|
-
const parsed = JSON.parse(
|
|
102635
|
+
const parsed = JSON.parse(readFileSync43(indexPath, "utf-8"));
|
|
102303
102636
|
return isTokenIndex(parsed) ? parsed : {};
|
|
102304
102637
|
} catch (readError) {
|
|
102305
102638
|
if (!(readError instanceof Error))
|
|
@@ -102339,7 +102672,7 @@ function getMcpOauthStorageDir() {
|
|
|
102339
102672
|
return join87(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
102340
102673
|
}
|
|
102341
102674
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
102342
|
-
return
|
|
102675
|
+
return createHash5("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
102343
102676
|
}
|
|
102344
102677
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
102345
102678
|
return join87(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
@@ -102409,7 +102742,7 @@ function readTokenFile(filePath) {
|
|
|
102409
102742
|
if (!existsSync63(filePath))
|
|
102410
102743
|
return null;
|
|
102411
102744
|
try {
|
|
102412
|
-
const parsed = JSON.parse(
|
|
102745
|
+
const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
|
|
102413
102746
|
return isOAuthTokenData(parsed) ? parsed : null;
|
|
102414
102747
|
} catch (readError) {
|
|
102415
102748
|
if (!(readError instanceof Error))
|
|
@@ -102422,7 +102755,7 @@ function readLegacyStore() {
|
|
|
102422
102755
|
if (!existsSync63(filePath))
|
|
102423
102756
|
return null;
|
|
102424
102757
|
try {
|
|
102425
|
-
const parsed = JSON.parse(
|
|
102758
|
+
const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
|
|
102426
102759
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
|
|
102427
102760
|
return null;
|
|
102428
102761
|
const result = {};
|
|
@@ -102540,7 +102873,7 @@ function listAllTokens() {
|
|
|
102540
102873
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
102541
102874
|
continue;
|
|
102542
102875
|
const token = readTokenFile(join87(dir, entry.name));
|
|
102543
|
-
const hash2 =
|
|
102876
|
+
const hash2 = basename15(entry.name, ".json");
|
|
102544
102877
|
if (token)
|
|
102545
102878
|
result[index[hash2] ?? hash2] = token;
|
|
102546
102879
|
}
|
|
@@ -102713,13 +103046,13 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
|
|
|
102713
103046
|
|
|
102714
103047
|
// packages/mcp-client-core/src/mcp-oauth/oauth-authorization-flow.ts
|
|
102715
103048
|
import { spawn as spawn4 } from "child_process";
|
|
102716
|
-
import { createHash as
|
|
103049
|
+
import { createHash as createHash6, randomBytes as randomBytes2 } from "crypto";
|
|
102717
103050
|
import { createServer as createServer2 } from "http";
|
|
102718
103051
|
function generateCodeVerifier() {
|
|
102719
103052
|
return randomBytes2(32).toString("base64url");
|
|
102720
103053
|
}
|
|
102721
103054
|
function generateCodeChallenge(verifier) {
|
|
102722
|
-
return
|
|
103055
|
+
return createHash6("sha256").update(verifier).digest("base64url");
|
|
102723
103056
|
}
|
|
102724
103057
|
function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
102725
103058
|
const url2 = new URL(authorizationEndpoint);
|
|
@@ -103263,7 +103596,7 @@ async function boulder(options) {
|
|
|
103263
103596
|
}
|
|
103264
103597
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
103265
103598
|
import { spawn as spawn5 } from "child_process";
|
|
103266
|
-
import { existsSync as existsSync65, readFileSync as
|
|
103599
|
+
import { existsSync as existsSync65, readFileSync as readFileSync45, realpathSync as realpathSync9 } from "fs";
|
|
103267
103600
|
import { homedir as homedir26 } from "os";
|
|
103268
103601
|
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
|
|
103269
103602
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
@@ -103313,7 +103646,7 @@ function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
|
103313
103646
|
}
|
|
103314
103647
|
function isGeneratedRuntimeWrapper(candidate) {
|
|
103315
103648
|
try {
|
|
103316
|
-
return
|
|
103649
|
+
return readFileSync45(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
|
|
103317
103650
|
} catch (error51) {
|
|
103318
103651
|
if (error51 instanceof Error)
|
|
103319
103652
|
return false;
|