oh-my-opencode 5.0.0-beta.1 → 5.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/command/publish.md +44 -16
- package/.agents/skills/publish/SKILL.md +44 -16
- package/.agents/skills/work-with-pr/SKILL.md +37 -23
- package/.opencode/command/publish.md +44 -16
- package/.opencode/skills/work-with-pr/SKILL.md +37 -23
- package/README.md +12 -1
- package/dist/agents/atlas/agent.d.ts +0 -1
- package/dist/agents/sisyphus/grok-4.d.ts +20 -0
- package/dist/agents/sisyphus/index.d.ts +2 -0
- package/dist/agents/sisyphus-agent-config.d.ts +6 -0
- package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
- package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +15 -4
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/index.js +805 -534
- package/dist/cli/run/on-complete-hook.d.ts +2 -0
- package/dist/cli-node/index.js +805 -534
- package/dist/hooks/atlas/final-wave-approval-gate.test-support.d.ts +50 -0
- package/dist/hooks/atlas/system-reminder-templates.d.ts +0 -1
- package/dist/index.js +1566 -1217
- package/dist/shared/normalize-sdk-response.d.ts +1 -0
- package/dist/shared/shell-env.d.ts +1 -1
- package/dist/skills/coding-agent-sessions/SKILL.md +3 -2
- package/dist/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/dist/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/dist/skills/frontend/SKILL.md +10 -7
- package/dist/skills/frontend/references/design/_INDEX.md +1 -0
- package/dist/skills/frontend/references/design/stylegallery.md +80 -0
- package/dist/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/dist/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/dist/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
- package/dist/skills/ulw-plan/SKILL.md +2 -2
- package/dist/skills/ulw-plan/references/full-workflow.md +27 -3
- package/dist/skills/ulw-plan/references/intent-clear.md +2 -1
- package/dist/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/dist/tools/delegate-task/builtin-categories.d.ts +1 -0
- package/dist/tools/delegate-task/builtin-category-definition.d.ts +1 -0
- package/dist/tools/delegate-task/tool-description.d.ts +3 -1
- package/dist/tui.js +184 -83
- package/package.json +21 -19
- package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
- package/packages/lsp-core/src/lsp/client-wrapper-outside-cwd.test.ts +78 -0
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +66 -13
- package/packages/lsp-core/src/lsp/client-wrapper.ts +70 -18
- package/packages/lsp-core/src/lsp/outside-context-workspace.ts +33 -0
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
- package/packages/lsp-core/src/lsp/workspace-markers.ts +1 -0
- package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
- package/packages/lsp-core/src/tools/navigation.ts +4 -2
- package/packages/lsp-core/src/tools/rename.ts +4 -2
- package/packages/lsp-core/src/tools/symbols.ts +1 -1
- package/packages/lsp-daemon/dist/cli.js +160 -71
- package/packages/lsp-daemon/dist/client.js +135 -46
- package/packages/lsp-daemon/dist/index.js +143 -54
- package/packages/lsp-tools-mcp/dist/cli.js +131 -42
- package/packages/lsp-tools-mcp/dist/mcp.js +131 -42
- package/packages/lsp-tools-mcp/dist/tools.js +131 -42
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +118 -8
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +118 -8
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +3 -17
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +147 -64
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +16 -23
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
- package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
- package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +37 -69
- package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -15
- package/packages/omo-codex/plugin/components/start-work-continuation/AGENTS.md +3 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/test/cli.test.ts +0 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +2 -16
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +3 -9
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +24 -12
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +24 -12
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +6 -0
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +6 -0
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +27 -3
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
- package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +3 -2
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +0 -3
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +2 -35
- package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +20 -20
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +10 -7
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +6 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -0
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +27 -3
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -24
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
- package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
- package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
- package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
- package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
- package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
- package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
- package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
- package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
- package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
- package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
- package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +57 -19
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/packages/shared-skills/skills/frontend/SKILL.md +10 -7
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +2 -2
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +27 -3
- package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
- package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
|
@@ -3013,7 +3013,7 @@ async function disposeDefaultLspManager() {
|
|
|
3013
3013
|
// src/daemon-client.ts
|
|
3014
3014
|
import { connect } from "node:net";
|
|
3015
3015
|
import { homedir as homedir3 } from "node:os";
|
|
3016
|
-
import { join as
|
|
3016
|
+
import { join as join8 } from "node:path";
|
|
3017
3017
|
|
|
3018
3018
|
// ../lsp-core/src/request-context.ts
|
|
3019
3019
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -4153,18 +4153,55 @@ function createIdleTimer(idleTimeoutMs, log, onTimeout) {
|
|
|
4153
4153
|
};
|
|
4154
4154
|
}
|
|
4155
4155
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
4156
|
-
import { existsSync as
|
|
4157
|
-
import { dirname as
|
|
4156
|
+
import { existsSync as existsSync11, realpathSync as realpathSync5, statSync as statSync4 } from "node:fs";
|
|
4157
|
+
import { basename as basename3, dirname as dirname9, join as join5, resolve as resolve7 } from "node:path";
|
|
4158
|
+
|
|
4159
|
+
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
4160
|
+
import { existsSync as existsSync7, realpathSync as realpathSync4 } from "node:fs";
|
|
4161
|
+
import { dirname as dirname7, join as join3 } from "node:path";
|
|
4162
|
+
|
|
4163
|
+
// ../lsp-core/src/lsp/workspace-markers.ts
|
|
4164
|
+
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
4165
|
+
|
|
4166
|
+
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
4167
|
+
function findWorkspaceRootOutsideContext(directory) {
|
|
4168
|
+
const marked = nearestMarkedAncestor(directory);
|
|
4169
|
+
if (marked !== undefined)
|
|
4170
|
+
return marked;
|
|
4171
|
+
return realpathSync4(nearestExistingAncestor(directory));
|
|
4172
|
+
}
|
|
4173
|
+
function nearestMarkedAncestor(directory) {
|
|
4174
|
+
let current = directory;
|
|
4175
|
+
for (;; ) {
|
|
4176
|
+
if (existsSync7(current) && WORKSPACE_MARKERS.some((marker) => existsSync7(join3(current, marker)))) {
|
|
4177
|
+
return realpathSync4(current);
|
|
4178
|
+
}
|
|
4179
|
+
const parent = dirname7(current);
|
|
4180
|
+
if (parent === current)
|
|
4181
|
+
return;
|
|
4182
|
+
current = parent;
|
|
4183
|
+
}
|
|
4184
|
+
}
|
|
4185
|
+
function nearestExistingAncestor(directory) {
|
|
4186
|
+
let current = directory;
|
|
4187
|
+
while (!existsSync7(current)) {
|
|
4188
|
+
const parent = dirname7(current);
|
|
4189
|
+
if (parent === current)
|
|
4190
|
+
return current;
|
|
4191
|
+
current = parent;
|
|
4192
|
+
}
|
|
4193
|
+
return current;
|
|
4194
|
+
}
|
|
4158
4195
|
|
|
4159
4196
|
// ../lsp-core/src/lsp/server-install-state.ts
|
|
4160
|
-
import { existsSync as
|
|
4161
|
-
import { dirname as
|
|
4197
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
4198
|
+
import { dirname as dirname8 } from "node:path";
|
|
4162
4199
|
function getInstallDecisionsPath() {
|
|
4163
4200
|
return lspRequestContext().installDecisionsPath;
|
|
4164
4201
|
}
|
|
4165
4202
|
function loadInstallDecisions() {
|
|
4166
4203
|
const path2 = getInstallDecisionsPath();
|
|
4167
|
-
if (!
|
|
4204
|
+
if (!existsSync8(path2))
|
|
4168
4205
|
return {};
|
|
4169
4206
|
try {
|
|
4170
4207
|
const parsed = JSON.parse(readFileSync4(path2, "utf8"));
|
|
@@ -4186,7 +4223,7 @@ function isInstallDecision(value) {
|
|
|
4186
4223
|
}
|
|
4187
4224
|
function writeInstallDecisions(decisions) {
|
|
4188
4225
|
const path2 = getInstallDecisionsPath();
|
|
4189
|
-
mkdirSync3(
|
|
4226
|
+
mkdirSync3(dirname8(path2), { recursive: true });
|
|
4190
4227
|
const tmpPath = `${path2}.tmp`;
|
|
4191
4228
|
writeFileSync2(tmpPath, `${JSON.stringify(decisions, null, 2)}
|
|
4192
4229
|
`, "utf8");
|
|
@@ -4205,7 +4242,7 @@ function isRecord5(value) {
|
|
|
4205
4242
|
}
|
|
4206
4243
|
|
|
4207
4244
|
// ../lsp-core/src/lsp/config-loader.ts
|
|
4208
|
-
import { existsSync as
|
|
4245
|
+
import { existsSync as existsSync9, readFileSync as readFileSync5 } from "node:fs";
|
|
4209
4246
|
|
|
4210
4247
|
// ../lsp-core/src/lsp/server-definitions.ts
|
|
4211
4248
|
var LSP_INSTALL_HINTS = {
|
|
@@ -4362,7 +4399,7 @@ function getUserConfigPath() {
|
|
|
4362
4399
|
return lspRequestContext().userConfigPath;
|
|
4363
4400
|
}
|
|
4364
4401
|
function loadJsonFile(path2) {
|
|
4365
|
-
if (!
|
|
4402
|
+
if (!existsSync9(path2))
|
|
4366
4403
|
return null;
|
|
4367
4404
|
try {
|
|
4368
4405
|
const parsed = JSON.parse(readFileSync5(path2, "utf-8"));
|
|
@@ -4550,8 +4587,8 @@ function getDisabledServerIds() {
|
|
|
4550
4587
|
}
|
|
4551
4588
|
|
|
4552
4589
|
// ../lsp-core/src/lsp/server-installation.ts
|
|
4553
|
-
import { existsSync as
|
|
4554
|
-
import { delimiter as delimiter3, join as
|
|
4590
|
+
import { existsSync as existsSync10 } from "node:fs";
|
|
4591
|
+
import { delimiter as delimiter3, join as join4 } from "node:path";
|
|
4555
4592
|
function isServerInstalled(command, _workingDirectory) {
|
|
4556
4593
|
if (command.length === 0)
|
|
4557
4594
|
return false;
|
|
@@ -4559,7 +4596,7 @@ function isServerInstalled(command, _workingDirectory) {
|
|
|
4559
4596
|
if (!cmd)
|
|
4560
4597
|
return false;
|
|
4561
4598
|
if (cmd.includes("/") || cmd.includes("\\")) {
|
|
4562
|
-
if (
|
|
4599
|
+
if (existsSync10(cmd))
|
|
4563
4600
|
return true;
|
|
4564
4601
|
}
|
|
4565
4602
|
const isWindows = process.platform === "win32";
|
|
@@ -4580,7 +4617,7 @@ function isServerInstalled(command, _workingDirectory) {
|
|
|
4580
4617
|
const paths = pathEnv.split(delimiter3);
|
|
4581
4618
|
for (const p of paths) {
|
|
4582
4619
|
for (const suffix of exts) {
|
|
4583
|
-
if (
|
|
4620
|
+
if (existsSync10(join4(p, cmd + suffix))) {
|
|
4584
4621
|
return true;
|
|
4585
4622
|
}
|
|
4586
4623
|
}
|
|
@@ -4676,7 +4713,6 @@ function getAllServers() {
|
|
|
4676
4713
|
}
|
|
4677
4714
|
|
|
4678
4715
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
4679
|
-
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
4680
4716
|
function isDirectoryPath(filePath) {
|
|
4681
4717
|
try {
|
|
4682
4718
|
return statSync4(filePath).isDirectory();
|
|
@@ -4685,32 +4721,85 @@ function isDirectoryPath(filePath) {
|
|
|
4685
4721
|
}
|
|
4686
4722
|
}
|
|
4687
4723
|
function findWorkspaceRoot(filePath) {
|
|
4688
|
-
const
|
|
4724
|
+
const cwd = contextCwd();
|
|
4725
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4689
4726
|
let dir = abs;
|
|
4690
4727
|
if (!isDirectoryPath(dir)) {
|
|
4691
|
-
dir =
|
|
4692
|
-
}
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4728
|
+
dir = dirname9(dir);
|
|
4729
|
+
}
|
|
4730
|
+
if (!isPathInside(cwd, abs))
|
|
4731
|
+
return findWorkspaceRootOutsideContext(dir);
|
|
4732
|
+
const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
|
|
4733
|
+
while (isPathInside(cwd, dir)) {
|
|
4734
|
+
const canonicalDir = existingDirectoryInsideContext(dir, cwd);
|
|
4735
|
+
if (canonicalDir !== undefined) {
|
|
4736
|
+
for (const marker of WORKSPACE_MARKERS) {
|
|
4737
|
+
if (existsSync11(join5(dir, marker))) {
|
|
4738
|
+
return canonicalDir;
|
|
4739
|
+
}
|
|
4698
4740
|
}
|
|
4699
4741
|
}
|
|
4700
|
-
|
|
4701
|
-
|
|
4742
|
+
if (dir === cwd)
|
|
4743
|
+
break;
|
|
4744
|
+
dir = dirname9(dir);
|
|
4702
4745
|
}
|
|
4703
|
-
return
|
|
4746
|
+
return fallbackRoot;
|
|
4704
4747
|
}
|
|
4705
|
-
function
|
|
4748
|
+
function resolveReadablePathInsideContext(filePath) {
|
|
4706
4749
|
const cwd = contextCwd();
|
|
4707
4750
|
const abs = resolve7(cwd, filePath);
|
|
4751
|
+
if (isPathInside(cwd, abs))
|
|
4752
|
+
return abs;
|
|
4753
|
+
const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
|
|
4754
|
+
if (rebased !== undefined)
|
|
4755
|
+
return rebased;
|
|
4756
|
+
return canonicalizeExistingOrNearestAncestor(abs);
|
|
4757
|
+
}
|
|
4758
|
+
function resolvePathInsideContext(filePath) {
|
|
4759
|
+
const cwd = contextCwd();
|
|
4760
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4708
4761
|
const canonical = canonicalizeExistingOrNearestAncestor(abs);
|
|
4709
4762
|
if (!isPathInside(cwd, canonical)) {
|
|
4710
4763
|
throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
|
|
4711
4764
|
}
|
|
4712
4765
|
return canonical;
|
|
4713
4766
|
}
|
|
4767
|
+
function rebaseThroughCanonicalAncestor(path2, cwd) {
|
|
4768
|
+
let current = path2;
|
|
4769
|
+
const suffix = [];
|
|
4770
|
+
while (true) {
|
|
4771
|
+
if (existsSync11(current)) {
|
|
4772
|
+
const canonical = realpathSync5(current);
|
|
4773
|
+
if (isPathInside(cwd, canonical))
|
|
4774
|
+
return suffix.length === 0 ? canonical : join5(canonical, ...suffix);
|
|
4775
|
+
}
|
|
4776
|
+
const parent = dirname9(current);
|
|
4777
|
+
if (parent === current)
|
|
4778
|
+
return;
|
|
4779
|
+
suffix.unshift(basename3(current));
|
|
4780
|
+
current = parent;
|
|
4781
|
+
}
|
|
4782
|
+
}
|
|
4783
|
+
function existingDirectoryInsideContext(directory, cwd) {
|
|
4784
|
+
if (!existsSync11(directory))
|
|
4785
|
+
return;
|
|
4786
|
+
const canonical = realpathSync5(directory);
|
|
4787
|
+
if (!statSync4(canonical).isDirectory())
|
|
4788
|
+
return;
|
|
4789
|
+
return isPathInside(cwd, canonical) ? canonical : undefined;
|
|
4790
|
+
}
|
|
4791
|
+
function nearestExistingDirectoryInsideContext(directory, cwd) {
|
|
4792
|
+
let current = directory;
|
|
4793
|
+
while (isPathInside(cwd, current)) {
|
|
4794
|
+
const canonical = existingDirectoryInsideContext(current, cwd);
|
|
4795
|
+
if (canonical !== undefined)
|
|
4796
|
+
return canonical;
|
|
4797
|
+
if (current === cwd)
|
|
4798
|
+
return;
|
|
4799
|
+
current = dirname9(current);
|
|
4800
|
+
}
|
|
4801
|
+
return;
|
|
4802
|
+
}
|
|
4714
4803
|
function formatServerLookupError(result) {
|
|
4715
4804
|
if (result.status === "not_installed") {
|
|
4716
4805
|
return formatNotInstalled(result);
|
|
@@ -4781,7 +4870,7 @@ function formatNotInstalled(result) {
|
|
|
4781
4870
|
].join(`
|
|
4782
4871
|
`);
|
|
4783
4872
|
}
|
|
4784
|
-
var
|
|
4873
|
+
var READ_ONLY_TOOLS = new Set([
|
|
4785
4874
|
"diagnostics",
|
|
4786
4875
|
"definition",
|
|
4787
4876
|
"references",
|
|
@@ -4790,7 +4879,7 @@ var READ_ONLY_RETRY_TOOLS = new Set([
|
|
|
4790
4879
|
"prepareRename"
|
|
4791
4880
|
]);
|
|
4792
4881
|
async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
4793
|
-
const absPath = resolvePathInsideContext(filePath);
|
|
4882
|
+
const absPath = READ_ONLY_TOOLS.has(toolName) ? resolveReadablePathInsideContext(filePath) : resolvePathInsideContext(filePath);
|
|
4794
4883
|
if (isDirectoryPath(absPath)) {
|
|
4795
4884
|
throw new LspInvalidPathError("Directory paths are not supported by this LSP tool. " + "Use lsp.diagnostics with a directory path for directory diagnostics.");
|
|
4796
4885
|
}
|
|
@@ -4805,9 +4894,9 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4805
4894
|
const acquireAndCall = async (allowRetry) => {
|
|
4806
4895
|
const client = await manager.getClient(root, server2, options.signal);
|
|
4807
4896
|
try {
|
|
4808
|
-
return await fn(client, root);
|
|
4897
|
+
return await fn(client, root, absPath);
|
|
4809
4898
|
} catch (err) {
|
|
4810
|
-
if (allowRetry &&
|
|
4899
|
+
if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
|
|
4811
4900
|
manager.invalidateClient(root, server2.id, client);
|
|
4812
4901
|
return acquireAndCall(false);
|
|
4813
4902
|
}
|
|
@@ -4825,8 +4914,8 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4825
4914
|
}
|
|
4826
4915
|
|
|
4827
4916
|
// ../lsp-core/src/lsp/directory-diagnostics.ts
|
|
4828
|
-
import { existsSync as
|
|
4829
|
-
import { join as
|
|
4917
|
+
import { existsSync as existsSync12, lstatSync as lstatSync5, readdirSync as readdirSync3 } from "node:fs";
|
|
4918
|
+
import { join as join6, resolve as resolve8 } from "node:path";
|
|
4830
4919
|
|
|
4831
4920
|
// ../lsp-core/src/lsp/formatters.ts
|
|
4832
4921
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
@@ -4956,7 +5045,7 @@ function collectFilesWithExtension(dir, extension, maxFiles) {
|
|
|
4956
5045
|
for (const entry of entries) {
|
|
4957
5046
|
if (files.length >= maxFiles)
|
|
4958
5047
|
return;
|
|
4959
|
-
const fullPath =
|
|
5048
|
+
const fullPath = join6(currentDir, entry);
|
|
4960
5049
|
let stat;
|
|
4961
5050
|
try {
|
|
4962
5051
|
stat = lstatSync5(fullPath);
|
|
@@ -4982,7 +5071,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4982
5071
|
throw new LspInvalidPathError(`Extension must start with a dot (e.g., ".ts", not "${extension}"). Use ".${extension}" instead.`);
|
|
4983
5072
|
}
|
|
4984
5073
|
const absDir = resolve8(options.workspaceRoot ?? contextCwd(), directory);
|
|
4985
|
-
if (!
|
|
5074
|
+
if (!existsSync12(absDir)) {
|
|
4986
5075
|
throw new LspInvalidPathError(`Directory does not exist: ${absDir}`);
|
|
4987
5076
|
}
|
|
4988
5077
|
const serverResult = options.server === undefined ? findServerForExtension(extension) : { status: "found", server: options.server };
|
|
@@ -5069,7 +5158,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
5069
5158
|
|
|
5070
5159
|
// ../lsp-core/src/lsp/infer-extension.ts
|
|
5071
5160
|
import { lstatSync as lstatSync6, readdirSync as readdirSync4 } from "node:fs";
|
|
5072
|
-
import { join as
|
|
5161
|
+
import { join as join7 } from "node:path";
|
|
5073
5162
|
var SKIP_DIRECTORIES2 = new Set(["node_modules", ".git", "dist", "build", ".next", "out"]);
|
|
5074
5163
|
var MAX_SCAN_ENTRIES = 500;
|
|
5075
5164
|
function inferExtensionFromDirectory(directory) {
|
|
@@ -5087,7 +5176,7 @@ function inferExtensionFromDirectory(directory) {
|
|
|
5087
5176
|
for (const entry of entries) {
|
|
5088
5177
|
if (scanned >= MAX_SCAN_ENTRIES)
|
|
5089
5178
|
return;
|
|
5090
|
-
const fullPath =
|
|
5179
|
+
const fullPath = join7(dir, entry);
|
|
5091
5180
|
let stat;
|
|
5092
5181
|
try {
|
|
5093
5182
|
stat = lstatSync6(fullPath);
|
|
@@ -5262,7 +5351,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
5262
5351
|
const filePath = requireString(params, "filePath");
|
|
5263
5352
|
const severity = severityFilter(params);
|
|
5264
5353
|
try {
|
|
5265
|
-
const absPath =
|
|
5354
|
+
const absPath = resolveReadablePathInsideContext(filePath);
|
|
5266
5355
|
if (isDirectoryPath(absPath)) {
|
|
5267
5356
|
const extension = inferExtensionFromDirectory(absPath);
|
|
5268
5357
|
if (!extension) {
|
|
@@ -5291,7 +5380,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
5291
5380
|
};
|
|
5292
5381
|
return text(output2.output, details2);
|
|
5293
5382
|
}
|
|
5294
|
-
const result = await withLspClient(filePath, async (client) => client.diagnostics(
|
|
5383
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
|
|
5295
5384
|
if (result.transientError) {
|
|
5296
5385
|
const message = result.transientError.message;
|
|
5297
5386
|
const details2 = {
|
|
@@ -5366,7 +5455,7 @@ async function executeLspGotoDefinition(params, signal) {
|
|
|
5366
5455
|
const line = requireNumber(params, "line");
|
|
5367
5456
|
const character = requireNumber(params, "character");
|
|
5368
5457
|
try {
|
|
5369
|
-
const result = await withLspClient(filePath, async (client) => client.definition(
|
|
5458
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.definition(resolvedFilePath, line, character, signal), "definition", clientOptions(signal));
|
|
5370
5459
|
const locations = !result ? [] : Array.isArray(result) ? result : [result];
|
|
5371
5460
|
const details = { filePath, line, character, locations };
|
|
5372
5461
|
if (locations.length === 0)
|
|
@@ -5391,7 +5480,7 @@ async function executeLspFindReferences(params, signal) {
|
|
|
5391
5480
|
const character = requireNumber(params, "character");
|
|
5392
5481
|
const includeDeclaration = optionalBoolean(params, "includeDeclaration") ?? true;
|
|
5393
5482
|
try {
|
|
5394
|
-
const result = await withLspClient(filePath, async (client) => client.references(
|
|
5483
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.references(resolvedFilePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
|
|
5395
5484
|
const references = Array.isArray(result) ? result : [];
|
|
5396
5485
|
const total = references.length;
|
|
5397
5486
|
const truncated = total > DEFAULT_MAX_REFERENCES;
|
|
@@ -5433,7 +5522,7 @@ async function executeLspPrepareRename(params, signal) {
|
|
|
5433
5522
|
const line = requireNumber(params, "line");
|
|
5434
5523
|
const character = requireNumber(params, "character");
|
|
5435
5524
|
try {
|
|
5436
|
-
const result = await withLspClient(filePath, async (client) => client.prepareRename(
|
|
5525
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.prepareRename(resolvedFilePath, line, character, signal), "prepareRename", clientOptions(signal));
|
|
5437
5526
|
const details = { filePath, line, character, result };
|
|
5438
5527
|
return text(formatPrepareRenameResult(result), details);
|
|
5439
5528
|
} catch (error) {
|
|
@@ -5454,7 +5543,7 @@ async function executeLspRename(params, signal) {
|
|
|
5454
5543
|
const character = requireNumber(params, "character");
|
|
5455
5544
|
const newName = requireString(params, "newName");
|
|
5456
5545
|
try {
|
|
5457
|
-
const result = await withLspClient(filePath, async (client) => client.rename(
|
|
5546
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.rename(resolvedFilePath, line, character, newName, signal), "rename", clientOptions(signal));
|
|
5458
5547
|
const details = { filePath, line, character, newName, apply: result.apply, edit: result.edit };
|
|
5459
5548
|
return text(formatApplyResult(result.apply), details, !result.apply.success);
|
|
5460
5549
|
} catch (error) {
|
|
@@ -5534,7 +5623,7 @@ async function executeLspSymbols(params, signal) {
|
|
|
5534
5623
|
const symbols2 = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
|
|
5535
5624
|
return formatSymbolsResult(filePath, scope, symbols2, limit, query);
|
|
5536
5625
|
}
|
|
5537
|
-
const symbols = await withLspClient(filePath, async (client) => client.documentSymbols(
|
|
5626
|
+
const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
|
|
5538
5627
|
return formatSymbolsResult(filePath, scope, symbols, limit);
|
|
5539
5628
|
} catch (error) {
|
|
5540
5629
|
const query = optionalString(params, "query");
|
|
@@ -5891,9 +5980,9 @@ function currentRequestContext(env = process.env) {
|
|
|
5891
5980
|
const home = env["HOME"] ?? homedir3();
|
|
5892
5981
|
return parseLspRequestContext({
|
|
5893
5982
|
cwd,
|
|
5894
|
-
projectConfigPaths: [
|
|
5895
|
-
userConfigPath:
|
|
5896
|
-
installDecisionsPath:
|
|
5983
|
+
projectConfigPaths: [join8(cwd, ".codex", "lsp-client.json")],
|
|
5984
|
+
userConfigPath: join8(home, ".codex", "lsp-client.json"),
|
|
5985
|
+
installDecisionsPath: join8(home, ".codex", "lsp-install-decisions.json"),
|
|
5897
5986
|
capabilities: { installDecisionTool: true }
|
|
5898
5987
|
});
|
|
5899
5988
|
}
|
|
@@ -6025,8 +6114,8 @@ function isRetryableTool(name) {
|
|
|
6025
6114
|
return name !== "rename" && name !== "lsp_rename";
|
|
6026
6115
|
}
|
|
6027
6116
|
// src/proxy.ts
|
|
6028
|
-
import { existsSync as
|
|
6029
|
-
import { basename as
|
|
6117
|
+
import { existsSync as existsSync13, realpathSync as realpathSync6 } from "node:fs";
|
|
6118
|
+
import { basename as basename4, delimiter as delimiter4, dirname as dirname10, isAbsolute as isAbsolute5 } from "node:path";
|
|
6030
6119
|
var DEFAULT_STARTUP_TIMEOUT_MS = 1e4;
|
|
6031
6120
|
async function runMcpStdioProxy(options = {}) {
|
|
6032
6121
|
const input = options.input ?? process.stdin;
|
|
@@ -6149,18 +6238,18 @@ function canonicalizePathList(value) {
|
|
|
6149
6238
|
return value.split(delimiter4).map((entry) => canonicalizePath(entry) ?? entry).join(delimiter4);
|
|
6150
6239
|
}
|
|
6151
6240
|
function canonicalizePath(value) {
|
|
6152
|
-
if (value === undefined || !isAbsolute5(value) || !
|
|
6241
|
+
if (value === undefined || !isAbsolute5(value) || !existsSync13(value))
|
|
6153
6242
|
return value;
|
|
6154
|
-
return
|
|
6243
|
+
return realpathSync6(value);
|
|
6155
6244
|
}
|
|
6156
6245
|
function projectRootFromOpenCodeConfigPath(path2) {
|
|
6157
|
-
if (
|
|
6246
|
+
if (basename4(path2) !== "lsp.json" && basename4(path2) !== "lsp-client.json")
|
|
6158
6247
|
return;
|
|
6159
|
-
const configDir =
|
|
6160
|
-
const configDirName =
|
|
6248
|
+
const configDir = dirname10(path2);
|
|
6249
|
+
const configDirName = basename4(configDir);
|
|
6161
6250
|
if (configDirName !== ".opencode" && configDirName !== ".omo")
|
|
6162
6251
|
return;
|
|
6163
|
-
return
|
|
6252
|
+
return dirname10(configDir);
|
|
6164
6253
|
}
|
|
6165
6254
|
export {
|
|
6166
6255
|
validateDaemonVersion,
|