Skip to content

The one and only agent harness for complex codebases. Project memory, planning, execution, and verified completion inside Codex.

chore: sync Codex marketplace v5.1.43

YeonGyu-Kimdc83a37ff5bb
diff --git a/plugins/omo/.codex-plugin/plugin.json b/plugins/omo/.codex-plugin/plugin.json
index 49013dd0..3bfcc228 100644
--- a/plugins/omo/.codex-plugin/plugin.json
+++ b/plugins/omo/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "omo",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "One Codex plugin namespace for Yeongyu's local Codex components.",
"author": {
"name": "Yeongyu Kim",
diff --git a/plugins/omo/components/bootstrap/hooks/hooks.json b/plugins/omo/components/bootstrap/hooks/hooks.json
index 1c04d51b..7d6c28d8 100644
--- a/plugins/omo/components/bootstrap/hooks/hooks.json
+++ b/plugins/omo/components/bootstrap/hooks/hooks.json
@@ -8,7 +8,7 @@
"command": "node \"${PLUGIN_ROOT}/components/bootstrap/dist/cli.js\" hook session-start",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\bootstrap.ps1\"",
"timeout": 30,
- "statusMessage": "(OmO 5.1.42) Checking Bootstrap Provisioning"
+ "statusMessage": "(OmO 5.1.43) Checking Bootstrap Provisioning"
}
]
}
diff --git a/plugins/omo/components/bootstrap/package.json b/plugins/omo/components/bootstrap/package.json
index 1dc6fdb5..1f88de7d 100644
--- a/plugins/omo/components/bootstrap/package.json
+++ b/plugins/omo/components/bootstrap/package.json
@@ -1,6 +1,6 @@
{
"name": "@sisyphuslabs/codex-bootstrap",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex SessionStart bootstrap component that provisions LazyCodex runtime dependencies from a detached worker.",
"type": "module",
"private": true,
diff --git a/plugins/omo/components/comment-checker/hooks/hooks.json b/plugins/omo/components/comment-checker/hooks/hooks.json
index 971031f8..d0f3efb9 100644
--- a/plugins/omo/components/comment-checker/hooks/hooks.json
+++ b/plugins/omo/components/comment-checker/hooks/hooks.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
"timeout": 30,
- "statusMessage": "(OmO 5.1.42) Checking Comments"
+ "statusMessage": "(OmO 5.1.43) Checking Comments"
}
]
}
diff --git a/plugins/omo/components/comment-checker/package.json b/plugins/omo/components/comment-checker/package.json
index 6ca4afbe..05f20d9e 100644
--- a/plugins/omo/components/comment-checker/package.json
+++ b/plugins/omo/components/comment-checker/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-comment-checker",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex plugin that runs comment-checker after edit-like PostToolUse hooks.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/git-bash/hooks/hooks.json b/plugins/omo/components/git-bash/hooks/hooks.json
index 281d3ef4..f1603eb3 100644
--- a/plugins/omo/components/git-bash/hooks/hooks.json
+++ b/plugins/omo/components/git-bash/hooks/hooks.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook pre-tool-use",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Recommending Git Bash MCP"
+ "statusMessage": "(OmO 5.1.43) Recommending Git Bash MCP"
}
]
}
@@ -20,7 +20,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Resetting Git Bash MCP Reminder"
+ "statusMessage": "(OmO 5.1.43) Resetting Git Bash MCP Reminder"
}
]
}
diff --git a/plugins/omo/components/git-bash/package.json b/plugins/omo/components/git-bash/package.json
index f221c505..d1b254da 100644
--- a/plugins/omo/components/git-bash/package.json
+++ b/plugins/omo/components/git-bash/package.json
@@ -1,6 +1,6 @@
{
"name": "@sisyphuslabs/codex-git-bash-hook",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex hook component that reminds Windows sessions to prefer the OMO git_bash MCP.",
"type": "module",
"private": true,
diff --git a/plugins/omo/components/lazycodex-executor-verify/hooks/hooks.json b/plugins/omo/components/lazycodex-executor-verify/hooks/hooks.json
index a4618ab1..bbec1c6d 100644
--- a/plugins/omo/components/lazycodex-executor-verify/hooks/hooks.json
+++ b/plugins/omo/components/lazycodex-executor-verify/hooks/hooks.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/lazycodex-executor-verify/dist/cli.js\" hook subagent-stop",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Verifying LazyCodex Executor Evidence"
+ "statusMessage": "(OmO 5.1.43) Verifying LazyCodex Executor Evidence"
}
]
}
diff --git a/plugins/omo/components/lazycodex-executor-verify/package.json b/plugins/omo/components/lazycodex-executor-verify/package.json
index 4da1e2e6..4419e1e7 100644
--- a/plugins/omo/components/lazycodex-executor-verify/package.json
+++ b/plugins/omo/components/lazycodex-executor-verify/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-lazycodex-executor-verify",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex SubagentStop evidence verifier for LazyCodex executor completions.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/lsp-daemon/dist/cli.js b/plugins/omo/components/lsp-daemon/dist/cli.js
index c267465a..d30c7270 100644
--- a/plugins/omo/components/lsp-daemon/dist/cli.js
+++ b/plugins/omo/components/lsp-daemon/dist/cli.js
@@ -445,8 +445,8 @@ function parseEndpoint(value) {
}
// src/proxy.ts
-import { existsSync as existsSync14, realpathSync as realpathSync6 } from "node:fs";
-import { basename as basename4, delimiter as delimiter4, dirname as dirname13, isAbsolute as isAbsolute6 } from "node:path";
+import { existsSync as existsSync15, realpathSync as realpathSync6 } from "node:fs";
+import { basename as basename4, delimiter as delimiter4, dirname as dirname14, isAbsolute as isAbsolute6 } from "node:path";
// ../mcp-stdio-core/src/responses.ts
function successResponse(id, result) {
return { jsonrpc: "2.0", id, result };
@@ -5370,6 +5370,321 @@ function missingDependencyAvailability(error) {
}
}
+// ../lsp-core/src/lsp/bun-command-output.ts
+import { resolve as resolve10 } from "node:path";
+var TSC_LINE = /^(.+?)\((\d+),(\d+)\): (error|warning|message) (TS\d+): (.*)$/;
+var TSC_SEVERITY = { error: 1, warning: 2, message: 3 };
+function parseBunCheckOutput(stdout, cwd) {
+ const results = [];
+ for (const line of stdout.split(/\r?\n/)) {
+ const match = TSC_LINE.exec(line);
+ if (match) {
+ const [, path, lineNumber, column, severity, code, message] = match;
+ const start = { line: Number(lineNumber) - 1, character: Number(column) - 1 };
+ results.push({
+ file: resolve10(cwd, path ?? ""),
+ diagnostic: {
+ range: { start, end: start },
+ severity: TSC_SEVERITY[severity ?? "error"] ?? 1,
+ code: code ?? "",
+ source: "bun check",
+ message: message ?? ""
+ }
+ });
+ continue;
+ }
+ const previous = results[results.length - 1];
+ if (previous !== undefined && /^\s+\S/.test(line)) {
+ previous.diagnostic.message = `${previous.diagnostic.message}
+${line.trim()}`;
+ }
+ }
+ return results;
+}
+function parseBunLintJson(stdout) {
+ let parsed;
+ try {
+ parsed = JSON.parse(stdout);
+ } catch {
+ return;
+ }
+ if (!Array.isArray(parsed))
+ return;
+ const results = [];
+ for (const entry of parsed) {
+ if (entry === null || typeof entry !== "object")
+ continue;
+ const filePath = entry.filePath;
+ const messages = entry.messages;
+ if (typeof filePath !== "string" || !Array.isArray(messages))
+ continue;
+ for (const raw of messages) {
+ const start = { line: Math.max(0, (raw.line ?? 1) - 1), character: Math.max(0, (raw.column ?? 1) - 1) };
+ const end = {
+ line: raw.endLine === undefined ? start.line : Math.max(0, raw.endLine - 1),
+ character: raw.endColumn === undefined ? start.character : Math.max(0, raw.endColumn - 1)
+ };
+ results.push({
+ file: filePath,
+ diagnostic: {
+ range: { start, end },
+ severity: raw.severity === 2 ? 1 : 2,
+ ...raw.ruleId ? { code: raw.ruleId } : {},
+ source: "bun lint",
+ message: raw.message ?? ""
+ }
+ });
+ }
+ }
+ return results;
+}
+
+// ../lsp-core/src/lsp/bun-project-checks.ts
+import { spawn as spawn2 } from "node:child_process";
+import { existsSync as existsSync13, mkdtempSync, readFileSync as readFileSync8, rmSync as rmSync2, statSync as statSync5, writeFileSync as writeFileSync3 } from "node:fs";
+import { homedir as homedir2, tmpdir } from "node:os";
+import { dirname as dirname12, join as join8, resolve as resolve11 } from "node:path";
+var BUN_LOCKFILES = ["bun.lock", "bun.lockb", "bunfig.toml"];
+var RUNNABLE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".cts", ".cjs", ".js", ".mjs", ".mts"];
+var BIN_SUFFIXES = process.platform === "win32" ? [".exe", ".bunx", ".cmd", ""] : [""];
+var PROBE_TIMEOUT_MS = 1e4;
+var UNFORMATTED_PROBE = `const a=1
+`;
+var probeCache = new Map;
+function findBunProjectRoot(start, home = homedir2()) {
+ const stopAt = resolve11(home);
+ let dir = resolve11(start);
+ for (;; ) {
+ if (dir === stopAt)
+ return;
+ if (BUN_LOCKFILES.some((name) => existsSync13(join8(dir, name))))
+ return dir;
+ if (packageManagerIsBun(join8(dir, "package.json")))
+ return dir;
+ if (existsSync13(join8(dir, ".git")))
+ return;
+ const parent = dirname12(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function packageManagerIsBun(packageJsonPath) {
+ const manifest = readJsonObject(packageJsonPath);
+ const packageManager = manifest?.["packageManager"];
+ return typeof packageManager === "string" && packageManager.startsWith("bun@");
+}
+function readJsonObject(path) {
+ if (!existsSync13(path))
+ return;
+ try {
+ const parsed = JSON.parse(readFileSync8(path, "utf8"));
+ return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
+ } catch {
+ return;
+ }
+}
+function isFile(path) {
+ try {
+ return statSync5(path).isFile();
+ } catch {
+ return false;
+ }
+}
+function isDirectory(path) {
+ try {
+ return statSync5(path).isDirectory();
+ } catch {
+ return false;
+ }
+}
+function projectShadowsBunCommand(command, cwd) {
+ const packageJsonDir = nearestPackageJsonDir(cwd);
+ if (packageJsonDir !== undefined) {
+ const scripts = readJsonObject(join8(packageJsonDir, "package.json"))?.["scripts"];
+ if (scripts !== null && typeof scripts === "object" && typeof scripts[command] === "string") {
+ return true;
+ }
+ }
+ if (command === "check")
+ return false;
+ const base = join8(cwd, command);
+ if (isFile(base) || RUNNABLE_EXTENSIONS.some((extension) => isFile(`${base}${extension}`)))
+ return true;
+ if (isDirectory(base) && (isFile(join8(base, "package.json")) || RUNNABLE_EXTENSIONS.some((extension) => isFile(join8(base, `index${extension}`))))) {
+ return true;
+ }
+ let dir = resolve11(cwd);
+ for (;; ) {
+ if (BIN_SUFFIXES.some((suffix) => existsSync13(join8(dir, "node_modules", ".bin", `${command}${suffix}`))))
+ return true;
+ const parent = dirname12(dir);
+ if (parent === dir)
+ return false;
+ dir = parent;
+ }
+}
+function nearestPackageJsonDir(start) {
+ let dir = resolve11(start);
+ for (;; ) {
+ if (existsSync13(join8(dir, "package.json")))
+ return dir;
+ const parent = dirname12(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function binaryIdentity(bunPath) {
+ try {
+ const stats = statSync5(bunPath);
+ return `${stats.mtimeMs}:${stats.size}`;
+ } catch {
+ return "missing";
+ }
+}
+function bunHasCommand(bunPath, command, timeoutMs = PROBE_TIMEOUT_MS) {
+ const key = `${bunPath}\x00${binaryIdentity(bunPath)}\x00${command}`;
+ const cached = probeCache.get(key);
+ if (cached !== undefined)
+ return cached;
+ const probe = probeOnce(bunPath, command, timeoutMs).then((answer) => {
+ if (answer === undefined)
+ probeCache.delete(key);
+ return answer === true;
+ });
+ probeCache.set(key, probe);
+ return probe;
+}
+async function probeOnce(bunPath, command, timeoutMs) {
+ const emptyDir = mkdtempSync(join8(tmpdir(), "omo-bun-probe-"));
+ const timeout = AbortSignal.timeout(timeoutMs);
+ try {
+ const help = await runBunCommand(bunPath, [command, "--help"], emptyDir, timeout);
+ if (help.exitCode === null)
+ return;
+ if (help.exitCode !== 0)
+ return false;
+ if (command !== "format")
+ return true;
+ const probeFile = join8(emptyDir, "probe.ts");
+ writeFileSync3(probeFile, UNFORMATTED_PROBE);
+ const write = await runBunCommand(bunPath, ["format", "--write", "probe.ts"], emptyDir, timeout);
+ if (write.exitCode === null)
+ return;
+ return write.exitCode === 0 && readFileSync8(probeFile, "utf8") !== UNFORMATTED_PROBE;
+ } catch {
+ return;
+ } finally {
+ rmSync2(emptyDir, { recursive: true, force: true });
+ }
+}
+async function resolveBunProjectCommand(command, cwd, options = {}) {
+ if (findBunProjectRoot(cwd, options.homeDir) === undefined)
+ return;
+ if (projectShadowsBunCommand(command, cwd))
+ return;
+ const bunPath = (options.resolveBun ?? defaultResolveBun)(cwd);
+ if (!bunPath)
+ return;
+ return await bunHasCommand(bunPath, command) ? bunPath : undefined;
+}
+function defaultResolveBun(cwd) {
+ return resolveServerBinary(["bun"], cwd);
+}
+function runBunCommand(bunPath, args, cwd, signal) {
+ signal?.throwIfAborted();
+ const prepared = createSpawnCommand([bunPath, ...args]);
+ return new Promise((resolvePromise, reject) => {
+ const child = spawn2(prepared.command, prepared.args, {
+ cwd,
+ stdio: ["ignore", "pipe", "pipe"],
+ shell: prepared.shell,
+ windowsHide: true,
+ detached: process.platform !== "win32"
+ });
+ const stdout = [];
+ const stderr = [];
+ const onAbort = () => killProcessTree(child, "SIGKILL");
+ signal?.addEventListener("abort", onAbort, { once: true });
+ child.stdout?.on("data", (chunk) => stdout.push(chunk));
+ child.stderr?.on("data", (chunk) => stderr.push(chunk));
+ child.once("error", (error) => {
+ signal?.removeEventListener("abort", onAbort);
+ reject(error);
+ });
+ child.once("close", (exitCode) => {
+ signal?.removeEventListener("abort", onAbort);
+ if (signal?.aborted) {
+ reject(signal.reason);
+ return;
+ }
+ resolvePromise({
+ exitCode,
+ stdout: Buffer.concat(stdout).toString("utf8"),
+ stderr: Buffer.concat(stderr).toString("utf8")
+ });
+ });
+ });
+}
+
+// ../lsp-core/src/tools/bun-directory-diagnostics.ts
+var TYPESCRIPT_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts"]);
+async function runBunDirectoryDiagnostics(absDir, extension, severity, signal, options = {}) {
+ if (!TYPESCRIPT_EXTENSIONS.has(extension))
+ return;
+ const checkBun = await resolveBunProjectCommand("check", absDir, options);
+ if (checkBun === undefined)
+ return;
+ let typecheck;
+ try {
+ const run = await runBunCommand(checkBun, ["check", "--no-pretty", "."], absDir, signal);
+ typecheck = parseBunCheckOutput(run.stdout, absDir);
+ const failedWithoutDiagnostics = run.exitCode === 1 && typecheck.length === 0;
+ if (run.exitCode !== 0 && run.exitCode !== 1 || failedWithoutDiagnostics)
+ return;
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return;
+ }
+ const header = [`Directory: ${absDir}`, "Typecheck: bun check (files in this directory and everything they import)"];
+ const projectCommands = ["bun check"];
+ const collected = [...typecheck];
+ const lintBun = await resolveBunProjectCommand("lint", absDir, options);
+ if (lintBun !== undefined) {
+ const lint = await runBunLint(lintBun, absDir, signal);
+ header.push(lint.status);
+ projectCommands.push("bun lint");
+ collected.push(...lint.diagnostics);
+ }
+ const diagnostics = collected.filter(({ diagnostic }) => filterDiagnosticsBySeverity([diagnostic], severity).length > 0);
+ const lines = [...header, `Total diagnostics: ${diagnostics.length}`];
+ const shown = diagnostics.slice(0, DEFAULT_MAX_DIAGNOSTICS);
+ if (shown.length > 0) {
+ lines.push("", ...shown.map(({ file, diagnostic }) => `${file}: ${formatDiagnostic(diagnostic)}`));
+ if (diagnostics.length > shown.length) {
+ lines.push("", `... (${diagnostics.length - shown.length} more diagnostics not shown)`);
+ }
+ }
+ return { output: lines.join(`
+`), diagnostics, projectCommands };
+}
+async function runBunLint(bunPath, absDir, signal) {
+ try {
+ const run = await runBunCommand(bunPath, ["lint", "-f", "json", "."], absDir, signal);
+ const diagnostics = run.exitCode === 0 || run.exitCode === 1 ? parseBunLintJson(run.stdout) : undefined;
+ if (diagnostics !== undefined)
+ return { status: "Lint: bun lint", diagnostics };
+ const reason = run.stderr.trim().split(/\r?\n/)[0] ?? "";
+ return { status: `Lint: bun lint could not lint (exit ${run.exitCode ?? "signal"})${reason ? `: ${reason}` : ""}`, diagnostics: [] };
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return { status: `Lint: bun lint could not run: ${error instanceof Error ? error.message : String(error)}`, diagnostics: [] };
+ }
+}
+
// ../lsp-core/src/tools/parameters.ts
function isRecord7(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -5424,7 +5739,7 @@ function asDiagnosticArray(result) {
return result;
return result.items ?? [];
}
-async function executeLspDiagnostics(params, signal) {
+async function executeLspDiagnostics(params, signal, bunOptions = {}) {
const filePath = requireString(params, "filePath");
const severity = severityFilter(params);
try {
@@ -5445,6 +5760,19 @@ async function executeLspDiagnostics(params, signal) {
};
return text(message, details);
}
+ const bun = await runBunDirectoryDiagnostics(absPath, extension, severity, signal, bunOptions);
+ if (bun !== undefined) {
+ const details = {
+ filePath,
+ severity,
+ mode: "directory",
+ diagnostics: [...bun.diagnostics],
+ totalDiagnostics: bun.diagnostics.length,
+ truncated: bun.diagnostics.length > DEFAULT_MAX_DIAGNOSTICS,
+ projectCommands: [...bun.projectCommands]
+ };
+ return text(bun.output, details);
+ }
const output = await aggregateDiagnosticsForDirectory(absPath, extension, severity, undefined, signal === undefined ? {} : { signal });
const details = {
filePath,
@@ -5505,7 +5833,7 @@ async function executeLspDiagnostics(params, signal) {
}
}
// ../lsp-core/src/lsp/format-document.ts
-import { readFileSync as readFileSync8, renameSync as renameSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
+import { readFileSync as readFileSync9, renameSync as renameSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync4 } from "node:fs";
var DEFAULT_FORMATTING_OPTIONS = {
tabSize: 4,
insertSpaces: false,
@@ -5520,7 +5848,7 @@ async function formatDocumentWithClient(client, filePath, options = {}) {
return { status: "unavailable", reason: "capability_not_advertised" };
if (edits.length === 0)
return UNCHANGED;
- const before = readFileSync8(filePath, "utf-8");
+ const before = readFileSync9(filePath, "utf-8");
const normalized = normalizeTextEdits(before, edits, 0);
if (normalized.text === before)
return UNCHANGED;
@@ -5543,7 +5871,7 @@ function lineDelta(edits) {
}
function writeAtomically(filePath, content) {
const tempPath = `${filePath}.omo-format.tmp`;
- writeFileSync3(tempPath, content, "utf-8");
+ writeFileSync4(tempPath, content, "utf-8");
try {
renameSync3(tempPath, filePath);
} catch (error) {
@@ -5848,7 +6176,7 @@ var LSP_MCP_TOOLS = [
name: "diagnostics",
aliases: ["lsp_diagnostics"],
title: "LSP Diagnostics",
- description: "Get errors, warnings, and hints for a source file or directory.",
+ description: "Get errors, warnings, and hints for a source file or directory. In a Bun project, a TypeScript directory is typechecked with `bun check`, plus `bun lint` when the installed Bun has it.",
inputSchema: objectSchema({
filePath: { type: "string", description: "File or directory path to check." },
severity: {
@@ -6034,8 +6362,8 @@ function requestedProtocolVersion(params) {
// src/daemon-client.ts
import { connect } from "node:net";
-import { homedir as homedir3 } from "node:os";
-import { join as join8 } from "node:path";
+import { homedir as homedir4 } from "node:os";
+import { join as join9 } from "node:path";
import { setTimeout as delay } from "node:timers/promises";
// src/daemon-request-error.ts
@@ -6112,21 +6440,21 @@ function errorText(error) {
}
// src/ensure-daemon.ts
-import { spawn as spawn2 } from "node:child_process";
-import { closeSync as closeSync3, existsSync as existsSync13, mkdirSync as mkdirSync4, openSync as openSync3, writeSync as writeSync3 } from "node:fs";
+import { spawn as spawn3 } from "node:child_process";
+import { closeSync as closeSync3, existsSync as existsSync14, mkdirSync as mkdirSync4, openSync as openSync3, writeSync as writeSync3 } from "node:fs";
import { Socket } from "node:net";
-import { dirname as dirname12, isAbsolute as isAbsolute5 } from "node:path";
+import { dirname as dirname13, isAbsolute as isAbsolute5 } from "node:path";
import { argv0, execPath } from "node:process";
// src/paths.ts
import { createHash as createHash2 } from "node:crypto";
import { createRequire } from "node:module";
-import { homedir as homedir2, tmpdir, userInfo } from "node:os";
+import { homedir as homedir3, tmpdir as tmpdir2, userInfo } from "node:os";
import * as path from "node:path";
import { fileURLToPath as fileURLToPath3 } from "node:url";
// src/runtime-contract.ts
-import { statSync as statSync5 } from "node:fs";
+import { statSync as statSync6 } from "node:fs";
import { isAbsolute as isAbsolute4 } from "node:path";
var OMO_LSP_DAEMON_DIR = "OMO_LSP_DAEMON_DIR";
var OMO_LSP_DAEMON_CLI = "OMO_LSP_DAEMON_CLI";
@@ -6174,7 +6502,7 @@ function resolveDaemonRuntime(env, defaults) {
}
let cliStats;
try {
- cliStats = statSync5(cliOverride);
+ cliStats = statSync6(cliOverride);
} catch (error) {
if (!(error instanceof Error))
throw error;
@@ -6251,8 +6579,8 @@ function daemonPaths(env = process.env, runtimeDefaults = packagedRuntimeDefault
function defaultDaemonPlatform() {
return {
platform: process.platform,
- homedir: homedir2,
- tmpdir,
+ homedir: homedir3,
+ tmpdir: tmpdir2,
getuid: () => typeof process.getuid === "function" ? process.getuid() : undefined,
username: () => userInfo().username,
path
@@ -6308,7 +6636,7 @@ function createLineDecoder(onMessage, onParseError) {
}
// src/ensure-daemon.ts
-var PROBE_TIMEOUT_MS = 2000;
+var PROBE_TIMEOUT_MS2 = 2000;
var DEFAULT_READY_TIMEOUT_MS = 5000;
var DEFAULT_POLL_INTERVAL_MS = 100;
var FAILED_SPAWN_COOLDOWN_MS = 5000;
@@ -6353,13 +6681,13 @@ async function waitUntilReachable(paths, deps, readyTimeoutMs, pollIntervalMs, s
await awaitWithSignal2(deps.sleep(pollIntervalMs, signal), signal);
}
}
-async function probeDaemon(paths, timeoutMs = PROBE_TIMEOUT_MS, signal) {
+async function probeDaemon(paths, timeoutMs = PROBE_TIMEOUT_MS2, signal) {
const token = readAuthToken(paths);
if (!token)
return false;
return await pingDaemon(paths, token, timeoutMs, signal) !== null;
}
-function pingDaemon(paths, token, timeoutMs = PROBE_TIMEOUT_MS, signal) {
+function pingDaemon(paths, token, timeoutMs = PROBE_TIMEOUT_MS2, signal) {
return new Promise((resolve) => {
const socket = new Socket;
let settled = false;
@@ -6396,10 +6724,10 @@ function pingDaemon(paths, token, timeoutMs = PROBE_TIMEOUT_MS, signal) {
});
}
function spawnDaemonProcess(paths, deps = {}) {
- mkdirSync4(dirname12(paths.log), { recursive: true });
+ mkdirSync4(dirname13(paths.log), { recursive: true });
const logFd = openSync3(paths.log, "a");
try {
- const spawnDaemonChild = deps.spawn ?? spawn2;
+ const spawnDaemonChild = deps.spawn ?? spawn3;
const executable = deps.resolveExecutable?.() ?? resolveDaemonNodeExecutable();
const child = spawnDaemonChild(executable, [paths.cliPath, "daemon"], {
detached: true,
@@ -6419,7 +6747,7 @@ function spawnDaemonProcess(paths, deps = {}) {
throw error;
}
}
-function resolveDaemonNodeExecutable(cachedExecPath = execPath, originalArgv0 = argv0, pathExists = existsSync13) {
+function resolveDaemonNodeExecutable(cachedExecPath = execPath, originalArgv0 = argv0, pathExists = existsSync14) {
if (pathExists(cachedExecPath))
return cachedExecPath;
if (isAbsolute5(originalArgv0) && pathExists(originalArgv0))
@@ -6428,7 +6756,7 @@ function resolveDaemonNodeExecutable(cachedExecPath = execPath, originalArgv0 =
}
function defaultEnsureDaemonDeps() {
return {
- probe: (paths, signal) => probeDaemon(paths, PROBE_TIMEOUT_MS, signal),
+ probe: (paths, signal) => probeDaemon(paths, PROBE_TIMEOUT_MS2, signal),
spawnDaemon: (paths) => spawnDaemonProcess(paths),
sleep: (ms, signal) => sleepWithSignal(ms, signal),
now: () => Date.now()
@@ -6657,12 +6985,12 @@ function callFormatViaDaemon(filePath, options) {
}
function currentRequestContext(env = process.env) {
const cwd = process.cwd();
- const home = env["HOME"] ?? homedir3();
+ const home = env["HOME"] ?? homedir4();
return parseLspRequestContext({
cwd,
- projectConfigPaths: [join8(cwd, ".codex", "lsp-client.json")],
- userConfigPath: join8(home, ".codex", "lsp-client.json"),
- installDecisionsPath: join8(home, ".codex", "lsp-install-decisions.json"),
+ projectConfigPaths: [join9(cwd, ".codex", "lsp-client.json")],
+ userConfigPath: join9(home, ".codex", "lsp-client.json"),
+ installDecisionsPath: join9(home, ".codex", "lsp-install-decisions.json"),
capabilities: { installDecisionTool: true }
});
}
@@ -6917,18 +7245,18 @@ function canonicalizePathList(value) {
return value.split(delimiter4).map((entry) => canonicalizePath(entry) ?? entry).join(delimiter4);
}
function canonicalizePath(value) {
- if (value === undefined || !isAbsolute6(value) || !existsSync14(value))
+ if (value === undefined || !isAbsolute6(value) || !existsSync15(value))
return value;
return realpathSync6(value);
}
function projectRootFromOpenCodeConfigPath(path) {
if (basename4(path) !== "lsp.json" && basename4(path) !== "lsp-client.json")
return;
- const configDir = dirname13(path);
+ const configDir = dirname14(path);
const configDirName = basename4(configDir);
if (configDirName !== ".opencode" && configDirName !== ".omo")
return;
- return dirname13(configDir);
+ return dirname14(configDir);
}
// src/daemon-server.ts
@@ -6938,7 +7266,7 @@ import { createServer as createServer2 } from "node:net";
// src/version-reap.ts
import { execFile } from "node:child_process";
import { readdir, readFile, rm } from "node:fs/promises";
-import { basename as basename5, dirname as dirname14, join as join9 } from "node:path";
+import { basename as basename5, dirname as dirname15, join as join10 } from "node:path";
var TERM_GRACE_MS = 5000;
var KILL_GRACE_MS = 1000;
var VERSION_ENTRY_PATTERN = /^v([A-Za-z0-9][A-Za-z0-9._+-]{0,127})$/;
@@ -6959,7 +7287,7 @@ async function attestDaemonCliProcess(pid, platform, deps = {}) {
return isNodeCliDaemonCommand(command.trim());
}
async function reapStaleDaemonVersions(ownPaths, deps = {}) {
- const baseDir = dirname14(ownPaths.dir);
+ const baseDir = dirname15(ownPaths.dir);
const platform = deps.platform ?? process.platform;
const isAlive = deps.isAlive ?? isProcessAlive;
const attest = deps.attest ?? ((pid) => attestDaemonCliProcess(pid, platform));
@@ -6978,7 +7306,7 @@ async function reapStaleDaemonVersions(ownPaths, deps = {}) {
const version = parseVersionEntry(entry.name);
if (version === null || !entry.isDirectory())
continue;
- const versionDir = join9(baseDir, entry.name);
+ const versionDir = join10(baseDir, entry.name);
const siblingPaths = daemonPaths({ [OMO_LSP_DAEMON_DIR]: baseDir }, { cliPath: ownPaths.cliPath, version });
results.push(await reapOneVersion({
version,
@@ -7002,7 +7330,7 @@ async function reapOneVersion(context) {
const { version, versionDir } = context;
const owner = context.readOwner(context.siblingPaths);
if (!owner) {
- const lockPid = readLockPid(join9(versionDir, "daemon.lock"));
+ const lockPid = readLockPid(join10(versionDir, "daemon.lock"));
if (lockPid !== null && context.isAlive(lockPid)) {
context.log(`reap: sparing v${version}: owner metadata missing but daemon.lock is held by live pid ${lockPid}`);
return { version, status: "spared", reason: `owner metadata missing but lock held by live pid ${lockPid}` };
diff --git a/plugins/omo/components/lsp-daemon/dist/client.js b/plugins/omo/components/lsp-daemon/dist/client.js
index f680d3bc..a28f9960 100644
--- a/plugins/omo/components/lsp-daemon/dist/client.js
+++ b/plugins/omo/components/lsp-daemon/dist/client.js
@@ -1,11 +1,11 @@
// src/client.ts
-import { statSync as statSync5 } from "node:fs";
+import { statSync as statSync6 } from "node:fs";
import { isAbsolute as isAbsolute6 } from "node:path";
// src/daemon-client.ts
import { connect } from "node:net";
-import { homedir as homedir3 } from "node:os";
-import { join as join8 } from "node:path";
+import { homedir as homedir4 } from "node:os";
+import { join as join9 } from "node:path";
import { setTimeout as delay } from "node:timers/promises";
// ../lsp-core/src/request-context.ts
@@ -5606,6 +5606,321 @@ function missingDependencyAvailability(error) {
}
}
+// ../lsp-core/src/lsp/bun-command-output.ts
+import { resolve as resolve10 } from "node:path";
+var TSC_LINE = /^(.+?)\((\d+),(\d+)\): (error|warning|message) (TS\d+): (.*)$/;
+var TSC_SEVERITY = { error: 1, warning: 2, message: 3 };
+function parseBunCheckOutput(stdout, cwd) {
+ const results = [];
+ for (const line of stdout.split(/\r?\n/)) {
+ const match = TSC_LINE.exec(line);
+ if (match) {
+ const [, path, lineNumber, column, severity, code, message] = match;
+ const start = { line: Number(lineNumber) - 1, character: Number(column) - 1 };
+ results.push({
+ file: resolve10(cwd, path ?? ""),
+ diagnostic: {
+ range: { start, end: start },
+ severity: TSC_SEVERITY[severity ?? "error"] ?? 1,
+ code: code ?? "",
+ source: "bun check",
+ message: message ?? ""
+ }
+ });
+ continue;
+ }
+ const previous = results[results.length - 1];
+ if (previous !== undefined && /^\s+\S/.test(line)) {
+ previous.diagnostic.message = `${previous.diagnostic.message}
+${line.trim()}`;
+ }
+ }
+ return results;
+}
+function parseBunLintJson(stdout) {
+ let parsed;
+ try {
+ parsed = JSON.parse(stdout);
+ } catch {
+ return;
+ }
+ if (!Array.isArray(parsed))
+ return;
+ const results = [];
+ for (const entry of parsed) {
+ if (entry === null || typeof entry !== "object")
+ continue;
+ const filePath = entry.filePath;
+ const messages = entry.messages;
+ if (typeof filePath !== "string" || !Array.isArray(messages))
+ continue;
+ for (const raw of messages) {
+ const start = { line: Math.max(0, (raw.line ?? 1) - 1), character: Math.max(0, (raw.column ?? 1) - 1) };
+ const end = {
+ line: raw.endLine === undefined ? start.line : Math.max(0, raw.endLine - 1),
+ character: raw.endColumn === undefined ? start.character : Math.max(0, raw.endColumn - 1)
+ };
+ results.push({
+ file: filePath,
+ diagnostic: {
+ range: { start, end },
+ severity: raw.severity === 2 ? 1 : 2,
+ ...raw.ruleId ? { code: raw.ruleId } : {},
+ source: "bun lint",
+ message: raw.message ?? ""
+ }
+ });
+ }
+ }
+ return results;
+}
+
+// ../lsp-core/src/lsp/bun-project-checks.ts
+import { spawn as spawn3 } from "node:child_process";
+import { existsSync as existsSync13, mkdtempSync, readFileSync as readFileSync6, rmSync as rmSync2, statSync as statSync5, writeFileSync as writeFileSync3 } from "node:fs";
+import { homedir as homedir3, tmpdir as tmpdir2 } from "node:os";
+import { dirname as dirname11, join as join8, resolve as resolve11 } from "node:path";
+var BUN_LOCKFILES = ["bun.lock", "bun.lockb", "bunfig.toml"];
+var RUNNABLE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".cts", ".cjs", ".js", ".mjs", ".mts"];
+var BIN_SUFFIXES = process.platform === "win32" ? [".exe", ".bunx", ".cmd", ""] : [""];
+var PROBE_TIMEOUT_MS2 = 1e4;
+var UNFORMATTED_PROBE = `const a=1
+`;
+var probeCache = new Map;
+function findBunProjectRoot(start, home = homedir3()) {
+ const stopAt = resolve11(home);
+ let dir = resolve11(start);
+ for (;; ) {
+ if (dir === stopAt)
+ return;
+ if (BUN_LOCKFILES.some((name) => existsSync13(join8(dir, name))))
+ return dir;
+ if (packageManagerIsBun(join8(dir, "package.json")))
+ return dir;
+ if (existsSync13(join8(dir, ".git")))
+ return;
+ const parent = dirname11(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function packageManagerIsBun(packageJsonPath) {
+ const manifest = readJsonObject(packageJsonPath);
+ const packageManager = manifest?.["packageManager"];
+ return typeof packageManager === "string" && packageManager.startsWith("bun@");
+}
+function readJsonObject(path) {
+ if (!existsSync13(path))
+ return;
+ try {
+ const parsed = JSON.parse(readFileSync6(path, "utf8"));
+ return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
+ } catch {
+ return;
+ }
+}
+function isFile(path) {
+ try {
+ return statSync5(path).isFile();
+ } catch {
+ return false;
+ }
+}
+function isDirectory(path) {
+ try {
+ return statSync5(path).isDirectory();
+ } catch {
+ return false;
+ }
+}
+function projectShadowsBunCommand(command, cwd) {
+ const packageJsonDir = nearestPackageJsonDir(cwd);
+ if (packageJsonDir !== undefined) {
+ const scripts = readJsonObject(join8(packageJsonDir, "package.json"))?.["scripts"];
+ if (scripts !== null && typeof scripts === "object" && typeof scripts[command] === "string") {
+ return true;
+ }
+ }
+ if (command === "check")
+ return false;
+ const base = join8(cwd, command);
+ if (isFile(base) || RUNNABLE_EXTENSIONS.some((extension) => isFile(`${base}${extension}`)))
+ return true;
+ if (isDirectory(base) && (isFile(join8(base, "package.json")) || RUNNABLE_EXTENSIONS.some((extension) => isFile(join8(base, `index${extension}`))))) {
+ return true;
+ }
+ let dir = resolve11(cwd);
+ for (;; ) {
+ if (BIN_SUFFIXES.some((suffix) => existsSync13(join8(dir, "node_modules", ".bin", `${command}${suffix}`))))
+ return true;
+ const parent = dirname11(dir);
+ if (parent === dir)
+ return false;
+ dir = parent;
+ }
+}
+function nearestPackageJsonDir(start) {
+ let dir = resolve11(start);
+ for (;; ) {
+ if (existsSync13(join8(dir, "package.json")))
+ return dir;
+ const parent = dirname11(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function binaryIdentity(bunPath) {
+ try {
+ const stats = statSync5(bunPath);
+ return `${stats.mtimeMs}:${stats.size}`;
+ } catch {
+ return "missing";
+ }
+}
+function bunHasCommand(bunPath, command, timeoutMs = PROBE_TIMEOUT_MS2) {
+ const key = `${bunPath}\x00${binaryIdentity(bunPath)}\x00${command}`;
+ const cached = probeCache.get(key);
+ if (cached !== undefined)
+ return cached;
+ const probe = probeOnce(bunPath, command, timeoutMs).then((answer) => {
+ if (answer === undefined)
+ probeCache.delete(key);
+ return answer === true;
+ });
+ probeCache.set(key, probe);
+ return probe;
+}
+async function probeOnce(bunPath, command, timeoutMs) {
+ const emptyDir = mkdtempSync(join8(tmpdir2(), "omo-bun-probe-"));
+ const timeout = AbortSignal.timeout(timeoutMs);
+ try {
+ const help = await runBunCommand(bunPath, [command, "--help"], emptyDir, timeout);
+ if (help.exitCode === null)
+ return;
+ if (help.exitCode !== 0)
+ return false;
+ if (command !== "format")
+ return true;
+ const probeFile = join8(emptyDir, "probe.ts");
+ writeFileSync3(probeFile, UNFORMATTED_PROBE);
+ const write = await runBunCommand(bunPath, ["format", "--write", "probe.ts"], emptyDir, timeout);
+ if (write.exitCode === null)
+ return;
+ return write.exitCode === 0 && readFileSync6(probeFile, "utf8") !== UNFORMATTED_PROBE;
+ } catch {
+ return;
+ } finally {
+ rmSync2(emptyDir, { recursive: true, force: true });
+ }
+}
+async function resolveBunProjectCommand(command, cwd, options = {}) {
+ if (findBunProjectRoot(cwd, options.homeDir) === undefined)
+ return;
+ if (projectShadowsBunCommand(command, cwd))
+ return;
+ const bunPath = (options.resolveBun ?? defaultResolveBun)(cwd);
+ if (!bunPath)
+ return;
+ return await bunHasCommand(bunPath, command) ? bunPath : undefined;
+}
+function defaultResolveBun(cwd) {
+ return resolveServerBinary(["bun"], cwd);
+}
+function runBunCommand(bunPath, args, cwd, signal) {
+ signal?.throwIfAborted();
+ const prepared = createSpawnCommand([bunPath, ...args]);
+ return new Promise((resolvePromise, reject) => {
+ const child = spawn3(prepared.command, prepared.args, {
+ cwd,
+ stdio: ["ignore", "pipe", "pipe"],
+ shell: prepared.shell,
+ windowsHide: true,
+ detached: process.platform !== "win32"
+ });
+ const stdout = [];
+ const stderr = [];
+ const onAbort = () => killProcessTree(child, "SIGKILL");
+ signal?.addEventListener("abort", onAbort, { once: true });
+ child.stdout?.on("data", (chunk) => stdout.push(chunk));
+ child.stderr?.on("data", (chunk) => stderr.push(chunk));
+ child.once("error", (error) => {
+ signal?.removeEventListener("abort", onAbort);
+ reject(error);
+ });
+ child.once("close", (exitCode) => {
+ signal?.removeEventListener("abort", onAbort);
+ if (signal?.aborted) {
+ reject(signal.reason);
+ return;
+ }
+ resolvePromise({
+ exitCode,
+ stdout: Buffer.concat(stdout).toString("utf8"),
+ stderr: Buffer.concat(stderr).toString("utf8")
+ });
+ });
+ });
+}
+
+// ../lsp-core/src/tools/bun-directory-diagnostics.ts
+var TYPESCRIPT_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts"]);
+async function runBunDirectoryDiagnostics(absDir, extension, severity, signal, options = {}) {
+ if (!TYPESCRIPT_EXTENSIONS.has(extension))
+ return;
+ const checkBun = await resolveBunProjectCommand("check", absDir, options);
+ if (checkBun === undefined)
+ return;
+ let typecheck;
+ try {
+ const run = await runBunCommand(checkBun, ["check", "--no-pretty", "."], absDir, signal);
+ typecheck = parseBunCheckOutput(run.stdout, absDir);
+ const failedWithoutDiagnostics = run.exitCode === 1 && typecheck.length === 0;
+ if (run.exitCode !== 0 && run.exitCode !== 1 || failedWithoutDiagnostics)
+ return;
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return;
+ }
+ const header = [`Directory: ${absDir}`, "Typecheck: bun check (files in this directory and everything they import)"];
+ const projectCommands = ["bun check"];
+ const collected = [...typecheck];
+ const lintBun = await resolveBunProjectCommand("lint", absDir, options);
+ if (lintBun !== undefined) {
+ const lint = await runBunLint(lintBun, absDir, signal);
+ header.push(lint.status);
+ projectCommands.push("bun lint");
+ collected.push(...lint.diagnostics);
+ }
+ const diagnostics = collected.filter(({ diagnostic }) => filterDiagnosticsBySeverity([diagnostic], severity).length > 0);
+ const lines = [...header, `Total diagnostics: ${diagnostics.length}`];
+ const shown = diagnostics.slice(0, DEFAULT_MAX_DIAGNOSTICS);
+ if (shown.length > 0) {
+ lines.push("", ...shown.map(({ file, diagnostic }) => `${file}: ${formatDiagnostic(diagnostic)}`));
+ if (diagnostics.length > shown.length) {
+ lines.push("", `... (${diagnostics.length - shown.length} more diagnostics not shown)`);
+ }
+ }
+ return { output: lines.join(`
+`), diagnostics, projectCommands };
+}
+async function runBunLint(bunPath, absDir, signal) {
+ try {
+ const run = await runBunCommand(bunPath, ["lint", "-f", "json", "."], absDir, signal);
+ const diagnostics = run.exitCode === 0 || run.exitCode === 1 ? parseBunLintJson(run.stdout) : undefined;
+ if (diagnostics !== undefined)
+ return { status: "Lint: bun lint", diagnostics };
+ const reason = run.stderr.trim().split(/\r?\n/)[0] ?? "";
+ return { status: `Lint: bun lint could not lint (exit ${run.exitCode ?? "signal"})${reason ? `: ${reason}` : ""}`, diagnostics: [] };
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return { status: `Lint: bun lint could not run: ${error instanceof Error ? error.message : String(error)}`, diagnostics: [] };
+ }
+}
+
// ../lsp-core/src/tools/parameters.ts
function isRecord7(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -5660,7 +5975,7 @@ function asDiagnosticArray(result) {
return result;
return result.items ?? [];
}
-async function executeLspDiagnostics(params, signal) {
+async function executeLspDiagnostics(params, signal, bunOptions = {}) {
const filePath = requireString(params, "filePath");
const severity = severityFilter(params);
try {
@@ -5681,6 +5996,19 @@ async function executeLspDiagnostics(params, signal) {
};
return text(message, details);
}
+ const bun = await runBunDirectoryDiagnostics(absPath, extension, severity, signal, bunOptions);
+ if (bun !== undefined) {
+ const details = {
+ filePath,
+ severity,
+ mode: "directory",
+ diagnostics: [...bun.diagnostics],
+ totalDiagnostics: bun.diagnostics.length,
+ truncated: bun.diagnostics.length > DEFAULT_MAX_DIAGNOSTICS,
+ projectCommands: [...bun.projectCommands]
+ };
+ return text(bun.output, details);
+ }
const output = await aggregateDiagnosticsForDirectory(absPath, extension, severity, undefined, signal === undefined ? {} : { signal });
const details = {
filePath,
@@ -5741,7 +6069,7 @@ async function executeLspDiagnostics(params, signal) {
}
}
// ../lsp-core/src/lsp/format-document.ts
-import { readFileSync as readFileSync6, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "node:fs";
+import { readFileSync as readFileSync7, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync4 } from "node:fs";
var DEFAULT_FORMATTING_OPTIONS = {
tabSize: 4,
insertSpaces: false,
@@ -5756,7 +6084,7 @@ async function formatDocumentWithClient(client, filePath, options = {}) {
return { status: "unavailable", reason: "capability_not_advertised" };
if (edits.length === 0)
return UNCHANGED;
- const before = readFileSync6(filePath, "utf-8");
+ const before = readFileSync7(filePath, "utf-8");
const normalized = normalizeTextEdits(before, edits, 0);
if (normalized.text === before)
return UNCHANGED;
@@ -5779,7 +6107,7 @@ function lineDelta(edits) {
}
function writeAtomically(filePath, content) {
const tempPath = `${filePath}.omo-format.tmp`;
- writeFileSync3(tempPath, content, "utf-8");
+ writeFileSync4(tempPath, content, "utf-8");
try {
renameSync3(tempPath, filePath);
} catch (error) {
@@ -6084,7 +6412,7 @@ var LSP_MCP_TOOLS = [
name: "diagnostics",
aliases: ["lsp_diagnostics"],
title: "LSP Diagnostics",
- description: "Get errors, warnings, and hints for a source file or directory.",
+ description: "Get errors, warnings, and hints for a source file or directory. In a Bun project, a TypeScript directory is typechecked with `bun check`, plus `bun lint` when the installed Bun has it.",
inputSchema: objectSchema({
filePath: { type: "string", description: "File or directory path to check." },
severity: {
@@ -6411,12 +6739,12 @@ function callFormatViaDaemon(filePath, options) {
}
function currentRequestContext(env = process.env) {
const cwd = process.cwd();
- const home = env["HOME"] ?? homedir3();
+ const home = env["HOME"] ?? homedir4();
return parseLspRequestContext({
cwd,
- projectConfigPaths: [join8(cwd, ".codex", "lsp-client.json")],
- userConfigPath: join8(home, ".codex", "lsp-client.json"),
- installDecisionsPath: join8(home, ".codex", "lsp-install-decisions.json"),
+ projectConfigPaths: [join9(cwd, ".codex", "lsp-client.json")],
+ userConfigPath: join9(home, ".codex", "lsp-client.json"),
+ installDecisionsPath: join9(home, ".codex", "lsp-install-decisions.json"),
capabilities: { installDecisionTool: true }
});
}
@@ -6585,7 +6913,7 @@ function resolveDaemonRuntime2(env, defaults) {
if (!isAbsolute6(cliOverride)) {
throw new InvalidRuntimeOverrideError2("cli_must_be_absolute", `${OMO_LSP_DAEMON_CLI2} must be an absolute path to an existing regular file`);
}
- const stat = statSync5(cliOverride, { throwIfNoEntry: false });
+ const stat = statSync6(cliOverride, { throwIfNoEntry: false });
if (!stat) {
throw new InvalidRuntimeOverrideError2("cli_not_found", `${OMO_LSP_DAEMON_CLI2} points to a missing file`);
}
diff --git a/plugins/omo/components/lsp-daemon/dist/index.js b/plugins/omo/components/lsp-daemon/dist/index.js
index 7eb037e6..8bc592ef 100644
--- a/plugins/omo/components/lsp-daemon/dist/index.js
+++ b/plugins/omo/components/lsp-daemon/dist/index.js
@@ -3158,8 +3158,8 @@ async function disposeDefaultLspManager() {
}
// src/daemon-client.ts
import { connect } from "node:net";
-import { homedir as homedir3 } from "node:os";
-import { join as join8 } from "node:path";
+import { homedir as homedir4 } from "node:os";
+import { join as join9 } from "node:path";
import { setTimeout as delay } from "node:timers/promises";
// ../lsp-core/src/request-context.ts
@@ -5601,6 +5601,321 @@ function missingDependencyAvailability(error) {
}
}
+// ../lsp-core/src/lsp/bun-command-output.ts
+import { resolve as resolve10 } from "node:path";
+var TSC_LINE = /^(.+?)\((\d+),(\d+)\): (error|warning|message) (TS\d+): (.*)$/;
+var TSC_SEVERITY = { error: 1, warning: 2, message: 3 };
+function parseBunCheckOutput(stdout, cwd) {
+ const results = [];
+ for (const line of stdout.split(/\r?\n/)) {
+ const match = TSC_LINE.exec(line);
+ if (match) {
+ const [, path, lineNumber, column, severity, code, message] = match;
+ const start = { line: Number(lineNumber) - 1, character: Number(column) - 1 };
+ results.push({
+ file: resolve10(cwd, path ?? ""),
+ diagnostic: {
+ range: { start, end: start },
+ severity: TSC_SEVERITY[severity ?? "error"] ?? 1,
+ code: code ?? "",
+ source: "bun check",
+ message: message ?? ""
+ }
+ });
+ continue;
+ }
+ const previous = results[results.length - 1];
+ if (previous !== undefined && /^\s+\S/.test(line)) {
+ previous.diagnostic.message = `${previous.diagnostic.message}
+${line.trim()}`;
+ }
+ }
+ return results;
+}
+function parseBunLintJson(stdout) {
+ let parsed;
+ try {
+ parsed = JSON.parse(stdout);
+ } catch {
+ return;
+ }
+ if (!Array.isArray(parsed))
+ return;
+ const results = [];
+ for (const entry of parsed) {
+ if (entry === null || typeof entry !== "object")
+ continue;
+ const filePath = entry.filePath;
+ const messages = entry.messages;
+ if (typeof filePath !== "string" || !Array.isArray(messages))
+ continue;
+ for (const raw of messages) {
+ const start = { line: Math.max(0, (raw.line ?? 1) - 1), character: Math.max(0, (raw.column ?? 1) - 1) };
+ const end = {
+ line: raw.endLine === undefined ? start.line : Math.max(0, raw.endLine - 1),
+ character: raw.endColumn === undefined ? start.character : Math.max(0, raw.endColumn - 1)
+ };
+ results.push({
+ file: filePath,
+ diagnostic: {
+ range: { start, end },
+ severity: raw.severity === 2 ? 1 : 2,
+ ...raw.ruleId ? { code: raw.ruleId } : {},
+ source: "bun lint",
+ message: raw.message ?? ""
+ }
+ });
+ }
+ }
+ return results;
+}
+
+// ../lsp-core/src/lsp/bun-project-checks.ts
+import { spawn as spawn3 } from "node:child_process";
+import { existsSync as existsSync13, mkdtempSync, readFileSync as readFileSync6, rmSync as rmSync2, statSync as statSync5, writeFileSync as writeFileSync3 } from "node:fs";
+import { homedir as homedir3, tmpdir as tmpdir2 } from "node:os";
+import { dirname as dirname11, join as join8, resolve as resolve11 } from "node:path";
+var BUN_LOCKFILES = ["bun.lock", "bun.lockb", "bunfig.toml"];
+var RUNNABLE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".cts", ".cjs", ".js", ".mjs", ".mts"];
+var BIN_SUFFIXES = process.platform === "win32" ? [".exe", ".bunx", ".cmd", ""] : [""];
+var PROBE_TIMEOUT_MS2 = 1e4;
+var UNFORMATTED_PROBE = `const a=1
+`;
+var probeCache = new Map;
+function findBunProjectRoot(start, home = homedir3()) {
+ const stopAt = resolve11(home);
+ let dir = resolve11(start);
+ for (;; ) {
+ if (dir === stopAt)
+ return;
+ if (BUN_LOCKFILES.some((name) => existsSync13(join8(dir, name))))
+ return dir;
+ if (packageManagerIsBun(join8(dir, "package.json")))
+ return dir;
+ if (existsSync13(join8(dir, ".git")))
+ return;
+ const parent = dirname11(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function packageManagerIsBun(packageJsonPath) {
+ const manifest = readJsonObject(packageJsonPath);
+ const packageManager = manifest?.["packageManager"];
+ return typeof packageManager === "string" && packageManager.startsWith("bun@");
+}
+function readJsonObject(path) {
+ if (!existsSync13(path))
+ return;
+ try {
+ const parsed = JSON.parse(readFileSync6(path, "utf8"));
+ return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
+ } catch {
+ return;
+ }
+}
+function isFile(path) {
+ try {
+ return statSync5(path).isFile();
+ } catch {
+ return false;
+ }
+}
+function isDirectory(path) {
+ try {
+ return statSync5(path).isDirectory();
+ } catch {
+ return false;
+ }
+}
+function projectShadowsBunCommand(command, cwd) {
+ const packageJsonDir = nearestPackageJsonDir(cwd);
+ if (packageJsonDir !== undefined) {
+ const scripts = readJsonObject(join8(packageJsonDir, "package.json"))?.["scripts"];
+ if (scripts !== null && typeof scripts === "object" && typeof scripts[command] === "string") {
+ return true;
+ }
+ }
+ if (command === "check")
+ return false;
+ const base = join8(cwd, command);
+ if (isFile(base) || RUNNABLE_EXTENSIONS.some((extension) => isFile(`${base}${extension}`)))
+ return true;
+ if (isDirectory(base) && (isFile(join8(base, "package.json")) || RUNNABLE_EXTENSIONS.some((extension) => isFile(join8(base, `index${extension}`))))) {
+ return true;
+ }
+ let dir = resolve11(cwd);
+ for (;; ) {
+ if (BIN_SUFFIXES.some((suffix) => existsSync13(join8(dir, "node_modules", ".bin", `${command}${suffix}`))))
+ return true;
+ const parent = dirname11(dir);
+ if (parent === dir)
+ return false;
+ dir = parent;
+ }
+}
+function nearestPackageJsonDir(start) {
+ let dir = resolve11(start);
+ for (;; ) {
+ if (existsSync13(join8(dir, "package.json")))
+ return dir;
+ const parent = dirname11(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function binaryIdentity(bunPath) {
+ try {
+ const stats = statSync5(bunPath);
+ return `${stats.mtimeMs}:${stats.size}`;
+ } catch {
+ return "missing";
+ }
+}
+function bunHasCommand(bunPath, command, timeoutMs = PROBE_TIMEOUT_MS2) {
+ const key = `${bunPath}\x00${binaryIdentity(bunPath)}\x00${command}`;
+ const cached = probeCache.get(key);
+ if (cached !== undefined)
+ return cached;
+ const probe = probeOnce(bunPath, command, timeoutMs).then((answer) => {
+ if (answer === undefined)
+ probeCache.delete(key);
+ return answer === true;
+ });
+ probeCache.set(key, probe);
+ return probe;
+}
+async function probeOnce(bunPath, command, timeoutMs) {
+ const emptyDir = mkdtempSync(join8(tmpdir2(), "omo-bun-probe-"));
+ const timeout = AbortSignal.timeout(timeoutMs);
+ try {
+ const help = await runBunCommand(bunPath, [command, "--help"], emptyDir, timeout);
+ if (help.exitCode === null)
+ return;
+ if (help.exitCode !== 0)
+ return false;
+ if (command !== "format")
+ return true;
+ const probeFile = join8(emptyDir, "probe.ts");
+ writeFileSync3(probeFile, UNFORMATTED_PROBE);
+ const write = await runBunCommand(bunPath, ["format", "--write", "probe.ts"], emptyDir, timeout);
+ if (write.exitCode === null)
+ return;
+ return write.exitCode === 0 && readFileSync6(probeFile, "utf8") !== UNFORMATTED_PROBE;
+ } catch {
+ return;
+ } finally {
+ rmSync2(emptyDir, { recursive: true, force: true });
+ }
+}
+async function resolveBunProjectCommand(command, cwd, options = {}) {
+ if (findBunProjectRoot(cwd, options.homeDir) === undefined)
+ return;
+ if (projectShadowsBunCommand(command, cwd))
+ return;
+ const bunPath = (options.resolveBun ?? defaultResolveBun)(cwd);
+ if (!bunPath)
+ return;
+ return await bunHasCommand(bunPath, command) ? bunPath : undefined;
+}
+function defaultResolveBun(cwd) {
+ return resolveServerBinary(["bun"], cwd);
+}
+function runBunCommand(bunPath, args, cwd, signal) {
+ signal?.throwIfAborted();
+ const prepared = createSpawnCommand([bunPath, ...args]);
+ return new Promise((resolvePromise, reject) => {
+ const child = spawn3(prepared.command, prepared.args, {
+ cwd,
+ stdio: ["ignore", "pipe", "pipe"],
+ shell: prepared.shell,
+ windowsHide: true,
+ detached: process.platform !== "win32"
+ });
+ const stdout = [];
+ const stderr = [];
+ const onAbort = () => killProcessTree(child, "SIGKILL");
+ signal?.addEventListener("abort", onAbort, { once: true });
+ child.stdout?.on("data", (chunk) => stdout.push(chunk));
+ child.stderr?.on("data", (chunk) => stderr.push(chunk));
+ child.once("error", (error) => {
+ signal?.removeEventListener("abort", onAbort);
+ reject(error);
+ });
+ child.once("close", (exitCode) => {
+ signal?.removeEventListener("abort", onAbort);
+ if (signal?.aborted) {
+ reject(signal.reason);
+ return;
+ }
+ resolvePromise({
+ exitCode,
+ stdout: Buffer.concat(stdout).toString("utf8"),
+ stderr: Buffer.concat(stderr).toString("utf8")
+ });
+ });
+ });
+}
+
+// ../lsp-core/src/tools/bun-directory-diagnostics.ts
+var TYPESCRIPT_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts"]);
+async function runBunDirectoryDiagnostics(absDir, extension, severity, signal, options = {}) {
+ if (!TYPESCRIPT_EXTENSIONS.has(extension))
+ return;
+ const checkBun = await resolveBunProjectCommand("check", absDir, options);
+ if (checkBun === undefined)
+ return;
+ let typecheck;
+ try {
+ const run = await runBunCommand(checkBun, ["check", "--no-pretty", "."], absDir, signal);
+ typecheck = parseBunCheckOutput(run.stdout, absDir);
+ const failedWithoutDiagnostics = run.exitCode === 1 && typecheck.length === 0;
+ if (run.exitCode !== 0 && run.exitCode !== 1 || failedWithoutDiagnostics)
+ return;
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return;
+ }
+ const header = [`Directory: ${absDir}`, "Typecheck: bun check (files in this directory and everything they import)"];
+ const projectCommands = ["bun check"];
+ const collected = [...typecheck];
+ const lintBun = await resolveBunProjectCommand("lint", absDir, options);
+ if (lintBun !== undefined) {
+ const lint = await runBunLint(lintBun, absDir, signal);
+ header.push(lint.status);
+ projectCommands.push("bun lint");
+ collected.push(...lint.diagnostics);
+ }
+ const diagnostics = collected.filter(({ diagnostic }) => filterDiagnosticsBySeverity([diagnostic], severity).length > 0);
+ const lines = [...header, `Total diagnostics: ${diagnostics.length}`];
+ const shown = diagnostics.slice(0, DEFAULT_MAX_DIAGNOSTICS);
+ if (shown.length > 0) {
+ lines.push("", ...shown.map(({ file, diagnostic }) => `${file}: ${formatDiagnostic(diagnostic)}`));
+ if (diagnostics.length > shown.length) {
+ lines.push("", `... (${diagnostics.length - shown.length} more diagnostics not shown)`);
+ }
+ }
+ return { output: lines.join(`
+`), diagnostics, projectCommands };
+}
+async function runBunLint(bunPath, absDir, signal) {
+ try {
+ const run = await runBunCommand(bunPath, ["lint", "-f", "json", "."], absDir, signal);
+ const diagnostics = run.exitCode === 0 || run.exitCode === 1 ? parseBunLintJson(run.stdout) : undefined;
+ if (diagnostics !== undefined)
+ return { status: "Lint: bun lint", diagnostics };
+ const reason = run.stderr.trim().split(/\r?\n/)[0] ?? "";
+ return { status: `Lint: bun lint could not lint (exit ${run.exitCode ?? "signal"})${reason ? `: ${reason}` : ""}`, diagnostics: [] };
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return { status: `Lint: bun lint could not run: ${error instanceof Error ? error.message : String(error)}`, diagnostics: [] };
+ }
+}
+
// ../lsp-core/src/tools/parameters.ts
function isRecord7(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -5655,7 +5970,7 @@ function asDiagnosticArray(result) {
return result;
return result.items ?? [];
}
-async function executeLspDiagnostics(params, signal) {
+async function executeLspDiagnostics(params, signal, bunOptions = {}) {
const filePath = requireString(params, "filePath");
const severity = severityFilter(params);
try {
@@ -5676,6 +5991,19 @@ async function executeLspDiagnostics(params, signal) {
};
return text(message, details);
}
+ const bun = await runBunDirectoryDiagnostics(absPath, extension, severity, signal, bunOptions);
+ if (bun !== undefined) {
+ const details = {
+ filePath,
+ severity,
+ mode: "directory",
+ diagnostics: [...bun.diagnostics],
+ totalDiagnostics: bun.diagnostics.length,
+ truncated: bun.diagnostics.length > DEFAULT_MAX_DIAGNOSTICS,
+ projectCommands: [...bun.projectCommands]
+ };
+ return text(bun.output, details);
+ }
const output = await aggregateDiagnosticsForDirectory(absPath, extension, severity, undefined, signal === undefined ? {} : { signal });
const details = {
filePath,
@@ -5736,7 +6064,7 @@ async function executeLspDiagnostics(params, signal) {
}
}
// ../lsp-core/src/lsp/format-document.ts
-import { readFileSync as readFileSync6, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "node:fs";
+import { readFileSync as readFileSync7, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync4 } from "node:fs";
var DEFAULT_FORMATTING_OPTIONS = {
tabSize: 4,
insertSpaces: false,
@@ -5751,7 +6079,7 @@ async function formatDocumentWithClient(client, filePath, options = {}) {
return { status: "unavailable", reason: "capability_not_advertised" };
if (edits.length === 0)
return UNCHANGED;
- const before = readFileSync6(filePath, "utf-8");
+ const before = readFileSync7(filePath, "utf-8");
const normalized = normalizeTextEdits(before, edits, 0);
if (normalized.text === before)
return UNCHANGED;
@@ -5774,7 +6102,7 @@ function lineDelta(edits) {
}
function writeAtomically(filePath, content) {
const tempPath = `${filePath}.omo-format.tmp`;
- writeFileSync3(tempPath, content, "utf-8");
+ writeFileSync4(tempPath, content, "utf-8");
try {
renameSync3(tempPath, filePath);
} catch (error) {
@@ -6079,7 +6407,7 @@ var LSP_MCP_TOOLS = [
name: "diagnostics",
aliases: ["lsp_diagnostics"],
title: "LSP Diagnostics",
- description: "Get errors, warnings, and hints for a source file or directory.",
+ description: "Get errors, warnings, and hints for a source file or directory. In a Bun project, a TypeScript directory is typechecked with `bun check`, plus `bun lint` when the installed Bun has it.",
inputSchema: objectSchema({
filePath: { type: "string", description: "File or directory path to check." },
severity: {
@@ -6406,12 +6734,12 @@ function callFormatViaDaemon(filePath, options) {
}
function currentRequestContext(env = process.env) {
const cwd = process.cwd();
- const home = env["HOME"] ?? homedir3();
+ const home = env["HOME"] ?? homedir4();
return parseLspRequestContext({
cwd,
- projectConfigPaths: [join8(cwd, ".codex", "lsp-client.json")],
- userConfigPath: join8(home, ".codex", "lsp-client.json"),
- installDecisionsPath: join8(home, ".codex", "lsp-install-decisions.json"),
+ projectConfigPaths: [join9(cwd, ".codex", "lsp-client.json")],
+ userConfigPath: join9(home, ".codex", "lsp-client.json"),
+ installDecisionsPath: join9(home, ".codex", "lsp-install-decisions.json"),
capabilities: { installDecisionTool: true }
});
}
@@ -6543,8 +6871,8 @@ function isRetryableTool(name) {
return name !== "rename" && name !== "lsp_rename";
}
// src/proxy.ts
-import { existsSync as existsSync13, realpathSync as realpathSync6 } from "node:fs";
-import { basename as basename4, delimiter as delimiter4, dirname as dirname11, isAbsolute as isAbsolute6 } from "node:path";
+import { existsSync as existsSync14, realpathSync as realpathSync6 } from "node:fs";
+import { basename as basename4, delimiter as delimiter4, dirname as dirname12, isAbsolute as isAbsolute6 } from "node:path";
var DEFAULT_STARTUP_TIMEOUT_MS = 1e4;
async function runMcpStdioProxy(options = {}) {
const input = options.input ?? process.stdin;
@@ -6667,18 +6995,18 @@ function canonicalizePathList(value) {
return value.split(delimiter4).map((entry) => canonicalizePath(entry) ?? entry).join(delimiter4);
}
function canonicalizePath(value) {
- if (value === undefined || !isAbsolute6(value) || !existsSync13(value))
+ if (value === undefined || !isAbsolute6(value) || !existsSync14(value))
return value;
return realpathSync6(value);
}
function projectRootFromOpenCodeConfigPath(path) {
if (basename4(path) !== "lsp.json" && basename4(path) !== "lsp-client.json")
return;
- const configDir = dirname11(path);
+ const configDir = dirname12(path);
const configDirName = basename4(configDir);
if (configDirName !== ".opencode" && configDirName !== ".omo")
return;
- return dirname11(configDir);
+ return dirname12(configDir);
}
export {
InvalidDaemonDirectoryError,
diff --git a/plugins/omo/components/lsp-tools-mcp/dist/cli.js b/plugins/omo/components/lsp-tools-mcp/dist/cli.js
index 7774d5c7..8925ede1 100755
--- a/plugins/omo/components/lsp-tools-mcp/dist/cli.js
+++ b/plugins/omo/components/lsp-tools-mcp/dist/cli.js
@@ -4939,6 +4939,321 @@ function missingDependencyAvailability(error) {
}
}
+// ../lsp-core/src/lsp/bun-command-output.ts
+import { resolve as resolve10 } from "node:path";
+var TSC_LINE = /^(.+?)\((\d+),(\d+)\): (error|warning|message) (TS\d+): (.*)$/;
+var TSC_SEVERITY = { error: 1, warning: 2, message: 3 };
+function parseBunCheckOutput(stdout, cwd) {
+ const results = [];
+ for (const line of stdout.split(/\r?\n/)) {
+ const match = TSC_LINE.exec(line);
+ if (match) {
+ const [, path, lineNumber, column, severity, code, message] = match;
+ const start = { line: Number(lineNumber) - 1, character: Number(column) - 1 };
+ results.push({
+ file: resolve10(cwd, path ?? ""),
+ diagnostic: {
+ range: { start, end: start },
+ severity: TSC_SEVERITY[severity ?? "error"] ?? 1,
+ code: code ?? "",
+ source: "bun check",
+ message: message ?? ""
+ }
+ });
+ continue;
+ }
+ const previous = results[results.length - 1];
+ if (previous !== undefined && /^\s+\S/.test(line)) {
+ previous.diagnostic.message = `${previous.diagnostic.message}
+${line.trim()}`;
+ }
+ }
+ return results;
+}
+function parseBunLintJson(stdout) {
+ let parsed;
+ try {
+ parsed = JSON.parse(stdout);
+ } catch {
+ return;
+ }
+ if (!Array.isArray(parsed))
+ return;
+ const results = [];
+ for (const entry of parsed) {
+ if (entry === null || typeof entry !== "object")
+ continue;
+ const filePath = entry.filePath;
+ const messages = entry.messages;
+ if (typeof filePath !== "string" || !Array.isArray(messages))
+ continue;
+ for (const raw of messages) {
+ const start = { line: Math.max(0, (raw.line ?? 1) - 1), character: Math.max(0, (raw.column ?? 1) - 1) };
+ const end = {
+ line: raw.endLine === undefined ? start.line : Math.max(0, raw.endLine - 1),
+ character: raw.endColumn === undefined ? start.character : Math.max(0, raw.endColumn - 1)
+ };
+ results.push({
+ file: filePath,
+ diagnostic: {
+ range: { start, end },
+ severity: raw.severity === 2 ? 1 : 2,
+ ...raw.ruleId ? { code: raw.ruleId } : {},
+ source: "bun lint",
+ message: raw.message ?? ""
+ }
+ });
+ }
+ }
+ return results;
+}
+
+// ../lsp-core/src/lsp/bun-project-checks.ts
+import { spawn as spawn2 } from "node:child_process";
+import { existsSync as existsSync12, mkdtempSync, readFileSync as readFileSync5, rmSync as rmSync2, statSync as statSync4, writeFileSync as writeFileSync3 } from "node:fs";
+import { homedir as homedir2, tmpdir } from "node:os";
+import { dirname as dirname9, join as join8, resolve as resolve11 } from "node:path";
+var BUN_LOCKFILES = ["bun.lock", "bun.lockb", "bunfig.toml"];
+var RUNNABLE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".cts", ".cjs", ".js", ".mjs", ".mts"];
+var BIN_SUFFIXES = process.platform === "win32" ? [".exe", ".bunx", ".cmd", ""] : [""];
+var PROBE_TIMEOUT_MS = 1e4;
+var UNFORMATTED_PROBE = `const a=1
+`;
+var probeCache = new Map;
+function findBunProjectRoot(start, home = homedir2()) {
+ const stopAt = resolve11(home);
+ let dir = resolve11(start);
+ for (;; ) {
+ if (dir === stopAt)
+ return;
+ if (BUN_LOCKFILES.some((name) => existsSync12(join8(dir, name))))
+ return dir;
+ if (packageManagerIsBun(join8(dir, "package.json")))
+ return dir;
+ if (existsSync12(join8(dir, ".git")))
+ return;
+ const parent = dirname9(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function packageManagerIsBun(packageJsonPath) {
+ const manifest = readJsonObject(packageJsonPath);
+ const packageManager = manifest?.["packageManager"];
+ return typeof packageManager === "string" && packageManager.startsWith("bun@");
+}
+function readJsonObject(path) {
+ if (!existsSync12(path))
+ return;
+ try {
+ const parsed = JSON.parse(readFileSync5(path, "utf8"));
+ return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
+ } catch {
+ return;
+ }
+}
+function isFile(path) {
+ try {
+ return statSync4(path).isFile();
+ } catch {
+ return false;
+ }
+}
+function isDirectory(path) {
+ try {
+ return statSync4(path).isDirectory();
+ } catch {
+ return false;
+ }
+}
+function projectShadowsBunCommand(command, cwd) {
+ const packageJsonDir = nearestPackageJsonDir(cwd);
+ if (packageJsonDir !== undefined) {
+ const scripts = readJsonObject(join8(packageJsonDir, "package.json"))?.["scripts"];
+ if (scripts !== null && typeof scripts === "object" && typeof scripts[command] === "string") {
+ return true;
+ }
+ }
+ if (command === "check")
+ return false;
+ const base = join8(cwd, command);
+ if (isFile(base) || RUNNABLE_EXTENSIONS.some((extension) => isFile(`${base}${extension}`)))
+ return true;
+ if (isDirectory(base) && (isFile(join8(base, "package.json")) || RUNNABLE_EXTENSIONS.some((extension) => isFile(join8(base, `index${extension}`))))) {
+ return true;
+ }
+ let dir = resolve11(cwd);
+ for (;; ) {
+ if (BIN_SUFFIXES.some((suffix) => existsSync12(join8(dir, "node_modules", ".bin", `${command}${suffix}`))))
+ return true;
+ const parent = dirname9(dir);
+ if (parent === dir)
+ return false;
+ dir = parent;
+ }
+}
+function nearestPackageJsonDir(start) {
+ let dir = resolve11(start);
+ for (;; ) {
+ if (existsSync12(join8(dir, "package.json")))
+ return dir;
+ const parent = dirname9(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function binaryIdentity(bunPath) {
+ try {
+ const stats = statSync4(bunPath);
+ return `${stats.mtimeMs}:${stats.size}`;
+ } catch {
+ return "missing";
+ }
+}
+function bunHasCommand(bunPath, command, timeoutMs = PROBE_TIMEOUT_MS) {
+ const key = `${bunPath}\x00${binaryIdentity(bunPath)}\x00${command}`;
+ const cached = probeCache.get(key);
+ if (cached !== undefined)
+ return cached;
+ const probe = probeOnce(bunPath, command, timeoutMs).then((answer) => {
+ if (answer === undefined)
+ probeCache.delete(key);
+ return answer === true;
+ });
+ probeCache.set(key, probe);
+ return probe;
+}
+async function probeOnce(bunPath, command, timeoutMs) {
+ const emptyDir = mkdtempSync(join8(tmpdir(), "omo-bun-probe-"));
+ const timeout = AbortSignal.timeout(timeoutMs);
+ try {
+ const help = await runBunCommand(bunPath, [command, "--help"], emptyDir, timeout);
+ if (help.exitCode === null)
+ return;
+ if (help.exitCode !== 0)
+ return false;
+ if (command !== "format")
+ return true;
+ const probeFile = join8(emptyDir, "probe.ts");
+ writeFileSync3(probeFile, UNFORMATTED_PROBE);
+ const write = await runBunCommand(bunPath, ["format", "--write", "probe.ts"], emptyDir, timeout);
+ if (write.exitCode === null)
+ return;
+ return write.exitCode === 0 && readFileSync5(probeFile, "utf8") !== UNFORMATTED_PROBE;
+ } catch {
+ return;
+ } finally {
+ rmSync2(emptyDir, { recursive: true, force: true });
+ }
+}
+async function resolveBunProjectCommand(command, cwd, options = {}) {
+ if (findBunProjectRoot(cwd, options.homeDir) === undefined)
+ return;
+ if (projectShadowsBunCommand(command, cwd))
+ return;
+ const bunPath = (options.resolveBun ?? defaultResolveBun)(cwd);
+ if (!bunPath)
+ return;
+ return await bunHasCommand(bunPath, command) ? bunPath : undefined;
+}
+function defaultResolveBun(cwd) {
+ return resolveServerBinary(["bun"], cwd);
+}
+function runBunCommand(bunPath, args, cwd, signal) {
+ signal?.throwIfAborted();
+ const prepared = createSpawnCommand([bunPath, ...args]);
+ return new Promise((resolvePromise, reject) => {
+ const child = spawn2(prepared.command, prepared.args, {
+ cwd,
+ stdio: ["ignore", "pipe", "pipe"],
+ shell: prepared.shell,
+ windowsHide: true,
+ detached: process.platform !== "win32"
+ });
+ const stdout = [];
+ const stderr = [];
+ const onAbort = () => killProcessTree(child, "SIGKILL");
+ signal?.addEventListener("abort", onAbort, { once: true });
+ child.stdout?.on("data", (chunk) => stdout.push(chunk));
+ child.stderr?.on("data", (chunk) => stderr.push(chunk));
+ child.once("error", (error) => {
+ signal?.removeEventListener("abort", onAbort);
+ reject(error);
+ });
+ child.once("close", (exitCode) => {
+ signal?.removeEventListener("abort", onAbort);
+ if (signal?.aborted) {
+ reject(signal.reason);
+ return;
+ }
+ resolvePromise({
+ exitCode,
+ stdout: Buffer.concat(stdout).toString("utf8"),
+ stderr: Buffer.concat(stderr).toString("utf8")
+ });
+ });
+ });
+}
+
+// ../lsp-core/src/tools/bun-directory-diagnostics.ts
+var TYPESCRIPT_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts"]);
+async function runBunDirectoryDiagnostics(absDir, extension, severity, signal, options = {}) {
+ if (!TYPESCRIPT_EXTENSIONS.has(extension))
+ return;
+ const checkBun = await resolveBunProjectCommand("check", absDir, options);
+ if (checkBun === undefined)
+ return;
+ let typecheck;
+ try {
+ const run = await runBunCommand(checkBun, ["check", "--no-pretty", "."], absDir, signal);
+ typecheck = parseBunCheckOutput(run.stdout, absDir);
+ const failedWithoutDiagnostics = run.exitCode === 1 && typecheck.length === 0;
+ if (run.exitCode !== 0 && run.exitCode !== 1 || failedWithoutDiagnostics)
+ return;
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return;
+ }
+ const header = [`Directory: ${absDir}`, "Typecheck: bun check (files in this directory and everything they import)"];
+ const projectCommands = ["bun check"];
+ const collected = [...typecheck];
+ const lintBun = await resolveBunProjectCommand("lint", absDir, options);
+ if (lintBun !== undefined) {
+ const lint = await runBunLint(lintBun, absDir, signal);
+ header.push(lint.status);
+ projectCommands.push("bun lint");
+ collected.push(...lint.diagnostics);
+ }
+ const diagnostics = collected.filter(({ diagnostic }) => filterDiagnosticsBySeverity([diagnostic], severity).length > 0);
+ const lines = [...header, `Total diagnostics: ${diagnostics.length}`];
+ const shown = diagnostics.slice(0, DEFAULT_MAX_DIAGNOSTICS);
+ if (shown.length > 0) {
+ lines.push("", ...shown.map(({ file, diagnostic }) => `${file}: ${formatDiagnostic(diagnostic)}`));
+ if (diagnostics.length > shown.length) {
+ lines.push("", `... (${diagnostics.length - shown.length} more diagnostics not shown)`);
+ }
+ }
+ return { output: lines.join(`
+`), diagnostics, projectCommands };
+}
+async function runBunLint(bunPath, absDir, signal) {
+ try {
+ const run = await runBunCommand(bunPath, ["lint", "-f", "json", "."], absDir, signal);
+ const diagnostics = run.exitCode === 0 || run.exitCode === 1 ? parseBunLintJson(run.stdout) : undefined;
+ if (diagnostics !== undefined)
+ return { status: "Lint: bun lint", diagnostics };
+ const reason = run.stderr.trim().split(/\r?\n/)[0] ?? "";
+ return { status: `Lint: bun lint could not lint (exit ${run.exitCode ?? "signal"})${reason ? `: ${reason}` : ""}`, diagnostics: [] };
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return { status: `Lint: bun lint could not run: ${error instanceof Error ? error.message : String(error)}`, diagnostics: [] };
+ }
+}
+
// ../lsp-core/src/tools/parameters.ts
function isRecord7(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -4993,7 +5308,7 @@ function asDiagnosticArray(result) {
return result;
return result.items ?? [];
}
-async function executeLspDiagnostics(params, signal) {
+async function executeLspDiagnostics(params, signal, bunOptions = {}) {
const filePath = requireString(params, "filePath");
const severity = severityFilter(params);
try {
@@ -5014,6 +5329,19 @@ async function executeLspDiagnostics(params, signal) {
};
return text(message, details);
}
+ const bun = await runBunDirectoryDiagnostics(absPath, extension, severity, signal, bunOptions);
+ if (bun !== undefined) {
+ const details = {
+ filePath,
+ severity,
+ mode: "directory",
+ diagnostics: [...bun.diagnostics],
+ totalDiagnostics: bun.diagnostics.length,
+ truncated: bun.diagnostics.length > DEFAULT_MAX_DIAGNOSTICS,
+ projectCommands: [...bun.projectCommands]
+ };
+ return text(bun.output, details);
+ }
const output = await aggregateDiagnosticsForDirectory(absPath, extension, severity, undefined, signal === undefined ? {} : { signal });
const details = {
filePath,
@@ -5074,7 +5402,7 @@ async function executeLspDiagnostics(params, signal) {
}
}
// ../lsp-core/src/lsp/format-document.ts
-import { readFileSync as readFileSync5, renameSync as renameSync3, unlinkSync, writeFileSync as writeFileSync3 } from "node:fs";
+import { readFileSync as readFileSync6, renameSync as renameSync3, unlinkSync, writeFileSync as writeFileSync4 } from "node:fs";
var DEFAULT_FORMATTING_OPTIONS = {
tabSize: 4,
insertSpaces: false,
@@ -5089,7 +5417,7 @@ async function formatDocumentWithClient(client, filePath, options = {}) {
return { status: "unavailable", reason: "capability_not_advertised" };
if (edits.length === 0)
return UNCHANGED;
- const before = readFileSync5(filePath, "utf-8");
+ const before = readFileSync6(filePath, "utf-8");
const normalized = normalizeTextEdits(before, edits, 0);
if (normalized.text === before)
return UNCHANGED;
@@ -5112,7 +5440,7 @@ function lineDelta(edits) {
}
function writeAtomically(filePath, content) {
const tempPath = `${filePath}.omo-format.tmp`;
- writeFileSync3(tempPath, content, "utf-8");
+ writeFileSync4(tempPath, content, "utf-8");
try {
renameSync3(tempPath, filePath);
} catch (error) {
@@ -5417,7 +5745,7 @@ var LSP_MCP_TOOLS = [
name: "diagnostics",
aliases: ["lsp_diagnostics"],
title: "LSP Diagnostics",
- description: "Get errors, warnings, and hints for a source file or directory.",
+ description: "Get errors, warnings, and hints for a source file or directory. In a Bun project, a TypeScript directory is typechecked with `bun check`, plus `bun lint` when the installed Bun has it.",
inputSchema: objectSchema({
filePath: { type: "string", description: "File or directory path to check." },
severity: {
diff --git a/plugins/omo/components/lsp-tools-mcp/dist/mcp.js b/plugins/omo/components/lsp-tools-mcp/dist/mcp.js
index 785519a3..7a245e38 100644
--- a/plugins/omo/components/lsp-tools-mcp/dist/mcp.js
+++ b/plugins/omo/components/lsp-tools-mcp/dist/mcp.js
@@ -4935,6 +4935,321 @@ function missingDependencyAvailability(error) {
}
}
+// ../lsp-core/src/lsp/bun-command-output.ts
+import { resolve as resolve10 } from "node:path";
+var TSC_LINE = /^(.+?)\((\d+),(\d+)\): (error|warning|message) (TS\d+): (.*)$/;
+var TSC_SEVERITY = { error: 1, warning: 2, message: 3 };
+function parseBunCheckOutput(stdout, cwd) {
+ const results = [];
+ for (const line of stdout.split(/\r?\n/)) {
+ const match = TSC_LINE.exec(line);
+ if (match) {
+ const [, path, lineNumber, column, severity, code, message] = match;
+ const start = { line: Number(lineNumber) - 1, character: Number(column) - 1 };
+ results.push({
+ file: resolve10(cwd, path ?? ""),
+ diagnostic: {
+ range: { start, end: start },
+ severity: TSC_SEVERITY[severity ?? "error"] ?? 1,
+ code: code ?? "",
+ source: "bun check",
+ message: message ?? ""
+ }
+ });
+ continue;
+ }
+ const previous = results[results.length - 1];
+ if (previous !== undefined && /^\s+\S/.test(line)) {
+ previous.diagnostic.message = `${previous.diagnostic.message}
+${line.trim()}`;
+ }
+ }
+ return results;
+}
+function parseBunLintJson(stdout) {
+ let parsed;
+ try {
+ parsed = JSON.parse(stdout);
+ } catch {
+ return;
+ }
+ if (!Array.isArray(parsed))
+ return;
+ const results = [];
+ for (const entry of parsed) {
+ if (entry === null || typeof entry !== "object")
+ continue;
+ const filePath = entry.filePath;
+ const messages = entry.messages;
+ if (typeof filePath !== "string" || !Array.isArray(messages))
+ continue;
+ for (const raw of messages) {
+ const start = { line: Math.max(0, (raw.line ?? 1) - 1), character: Math.max(0, (raw.column ?? 1) - 1) };
+ const end = {
+ line: raw.endLine === undefined ? start.line : Math.max(0, raw.endLine - 1),
+ character: raw.endColumn === undefined ? start.character : Math.max(0, raw.endColumn - 1)
+ };
+ results.push({
+ file: filePath,
+ diagnostic: {
+ range: { start, end },
+ severity: raw.severity === 2 ? 1 : 2,
+ ...raw.ruleId ? { code: raw.ruleId } : {},
+ source: "bun lint",
+ message: raw.message ?? ""
+ }
+ });
+ }
+ }
+ return results;
+}
+
+// ../lsp-core/src/lsp/bun-project-checks.ts
+import { spawn as spawn2 } from "node:child_process";
+import { existsSync as existsSync12, mkdtempSync, readFileSync as readFileSync5, rmSync as rmSync2, statSync as statSync4, writeFileSync as writeFileSync3 } from "node:fs";
+import { homedir as homedir2, tmpdir } from "node:os";
+import { dirname as dirname9, join as join8, resolve as resolve11 } from "node:path";
+var BUN_LOCKFILES = ["bun.lock", "bun.lockb", "bunfig.toml"];
+var RUNNABLE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".cts", ".cjs", ".js", ".mjs", ".mts"];
+var BIN_SUFFIXES = process.platform === "win32" ? [".exe", ".bunx", ".cmd", ""] : [""];
+var PROBE_TIMEOUT_MS = 1e4;
+var UNFORMATTED_PROBE = `const a=1
+`;
+var probeCache = new Map;
+function findBunProjectRoot(start, home = homedir2()) {
+ const stopAt = resolve11(home);
+ let dir = resolve11(start);
+ for (;; ) {
+ if (dir === stopAt)
+ return;
+ if (BUN_LOCKFILES.some((name) => existsSync12(join8(dir, name))))
+ return dir;
+ if (packageManagerIsBun(join8(dir, "package.json")))
+ return dir;
+ if (existsSync12(join8(dir, ".git")))
+ return;
+ const parent = dirname9(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function packageManagerIsBun(packageJsonPath) {
+ const manifest = readJsonObject(packageJsonPath);
+ const packageManager = manifest?.["packageManager"];
+ return typeof packageManager === "string" && packageManager.startsWith("bun@");
+}
+function readJsonObject(path) {
+ if (!existsSync12(path))
+ return;
+ try {
+ const parsed = JSON.parse(readFileSync5(path, "utf8"));
+ return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
+ } catch {
+ return;
+ }
+}
+function isFile(path) {
+ try {
+ return statSync4(path).isFile();
+ } catch {
+ return false;
+ }
+}
+function isDirectory(path) {
+ try {
+ return statSync4(path).isDirectory();
+ } catch {
+ return false;
+ }
+}
+function projectShadowsBunCommand(command, cwd) {
+ const packageJsonDir = nearestPackageJsonDir(cwd);
+ if (packageJsonDir !== undefined) {
+ const scripts = readJsonObject(join8(packageJsonDir, "package.json"))?.["scripts"];
+ if (scripts !== null && typeof scripts === "object" && typeof scripts[command] === "string") {
+ return true;
+ }
+ }
+ if (command === "check")
+ return false;
+ const base = join8(cwd, command);
+ if (isFile(base) || RUNNABLE_EXTENSIONS.some((extension) => isFile(`${base}${extension}`)))
+ return true;
+ if (isDirectory(base) && (isFile(join8(base, "package.json")) || RUNNABLE_EXTENSIONS.some((extension) => isFile(join8(base, `index${extension}`))))) {
+ return true;
+ }
+ let dir = resolve11(cwd);
+ for (;; ) {
+ if (BIN_SUFFIXES.some((suffix) => existsSync12(join8(dir, "node_modules", ".bin", `${command}${suffix}`))))
+ return true;
+ const parent = dirname9(dir);
+ if (parent === dir)
+ return false;
+ dir = parent;
+ }
+}
+function nearestPackageJsonDir(start) {
+ let dir = resolve11(start);
+ for (;; ) {
+ if (existsSync12(join8(dir, "package.json")))
+ return dir;
+ const parent = dirname9(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function binaryIdentity(bunPath) {
+ try {
+ const stats = statSync4(bunPath);
+ return `${stats.mtimeMs}:${stats.size}`;
+ } catch {
+ return "missing";
+ }
+}
+function bunHasCommand(bunPath, command, timeoutMs = PROBE_TIMEOUT_MS) {
+ const key = `${bunPath}\x00${binaryIdentity(bunPath)}\x00${command}`;
+ const cached = probeCache.get(key);
+ if (cached !== undefined)
+ return cached;
+ const probe = probeOnce(bunPath, command, timeoutMs).then((answer) => {
+ if (answer === undefined)
+ probeCache.delete(key);
+ return answer === true;
+ });
+ probeCache.set(key, probe);
+ return probe;
+}
+async function probeOnce(bunPath, command, timeoutMs) {
+ const emptyDir = mkdtempSync(join8(tmpdir(), "omo-bun-probe-"));
+ const timeout = AbortSignal.timeout(timeoutMs);
+ try {
+ const help = await runBunCommand(bunPath, [command, "--help"], emptyDir, timeout);
+ if (help.exitCode === null)
+ return;
+ if (help.exitCode !== 0)
+ return false;
+ if (command !== "format")
+ return true;
+ const probeFile = join8(emptyDir, "probe.ts");
+ writeFileSync3(probeFile, UNFORMATTED_PROBE);
+ const write = await runBunCommand(bunPath, ["format", "--write", "probe.ts"], emptyDir, timeout);
+ if (write.exitCode === null)
+ return;
+ return write.exitCode === 0 && readFileSync5(probeFile, "utf8") !== UNFORMATTED_PROBE;
+ } catch {
+ return;
+ } finally {
+ rmSync2(emptyDir, { recursive: true, force: true });
+ }
+}
+async function resolveBunProjectCommand(command, cwd, options = {}) {
+ if (findBunProjectRoot(cwd, options.homeDir) === undefined)
+ return;
+ if (projectShadowsBunCommand(command, cwd))
+ return;
+ const bunPath = (options.resolveBun ?? defaultResolveBun)(cwd);
+ if (!bunPath)
+ return;
+ return await bunHasCommand(bunPath, command) ? bunPath : undefined;
+}
+function defaultResolveBun(cwd) {
+ return resolveServerBinary(["bun"], cwd);
+}
+function runBunCommand(bunPath, args, cwd, signal) {
+ signal?.throwIfAborted();
+ const prepared = createSpawnCommand([bunPath, ...args]);
+ return new Promise((resolvePromise, reject) => {
+ const child = spawn2(prepared.command, prepared.args, {
+ cwd,
+ stdio: ["ignore", "pipe", "pipe"],
+ shell: prepared.shell,
+ windowsHide: true,
+ detached: process.platform !== "win32"
+ });
+ const stdout = [];
+ const stderr = [];
+ const onAbort = () => killProcessTree(child, "SIGKILL");
+ signal?.addEventListener("abort", onAbort, { once: true });
+ child.stdout?.on("data", (chunk) => stdout.push(chunk));
+ child.stderr?.on("data", (chunk) => stderr.push(chunk));
+ child.once("error", (error) => {
+ signal?.removeEventListener("abort", onAbort);
+ reject(error);
+ });
+ child.once("close", (exitCode) => {
+ signal?.removeEventListener("abort", onAbort);
+ if (signal?.aborted) {
+ reject(signal.reason);
+ return;
+ }
+ resolvePromise({
+ exitCode,
+ stdout: Buffer.concat(stdout).toString("utf8"),
+ stderr: Buffer.concat(stderr).toString("utf8")
+ });
+ });
+ });
+}
+
+// ../lsp-core/src/tools/bun-directory-diagnostics.ts
+var TYPESCRIPT_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts"]);
+async function runBunDirectoryDiagnostics(absDir, extension, severity, signal, options = {}) {
+ if (!TYPESCRIPT_EXTENSIONS.has(extension))
+ return;
+ const checkBun = await resolveBunProjectCommand("check", absDir, options);
+ if (checkBun === undefined)
+ return;
+ let typecheck;
+ try {
+ const run = await runBunCommand(checkBun, ["check", "--no-pretty", "."], absDir, signal);
+ typecheck = parseBunCheckOutput(run.stdout, absDir);
+ const failedWithoutDiagnostics = run.exitCode === 1 && typecheck.length === 0;
+ if (run.exitCode !== 0 && run.exitCode !== 1 || failedWithoutDiagnostics)
+ return;
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return;
+ }
+ const header = [`Directory: ${absDir}`, "Typecheck: bun check (files in this directory and everything they import)"];
+ const projectCommands = ["bun check"];
+ const collected = [...typecheck];
+ const lintBun = await resolveBunProjectCommand("lint", absDir, options);
+ if (lintBun !== undefined) {
+ const lint = await runBunLint(lintBun, absDir, signal);
+ header.push(lint.status);
+ projectCommands.push("bun lint");
+ collected.push(...lint.diagnostics);
+ }
+ const diagnostics = collected.filter(({ diagnostic }) => filterDiagnosticsBySeverity([diagnostic], severity).length > 0);
+ const lines = [...header, `Total diagnostics: ${diagnostics.length}`];
+ const shown = diagnostics.slice(0, DEFAULT_MAX_DIAGNOSTICS);
+ if (shown.length > 0) {
+ lines.push("", ...shown.map(({ file, diagnostic }) => `${file}: ${formatDiagnostic(diagnostic)}`));
+ if (diagnostics.length > shown.length) {
+ lines.push("", `... (${diagnostics.length - shown.length} more diagnostics not shown)`);
+ }
+ }
+ return { output: lines.join(`
+`), diagnostics, projectCommands };
+}
+async function runBunLint(bunPath, absDir, signal) {
+ try {
+ const run = await runBunCommand(bunPath, ["lint", "-f", "json", "."], absDir, signal);
+ const diagnostics = run.exitCode === 0 || run.exitCode === 1 ? parseBunLintJson(run.stdout) : undefined;
+ if (diagnostics !== undefined)
+ return { status: "Lint: bun lint", diagnostics };
+ const reason = run.stderr.trim().split(/\r?\n/)[0] ?? "";
+ return { status: `Lint: bun lint could not lint (exit ${run.exitCode ?? "signal"})${reason ? `: ${reason}` : ""}`, diagnostics: [] };
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return { status: `Lint: bun lint could not run: ${error instanceof Error ? error.message : String(error)}`, diagnostics: [] };
+ }
+}
+
// ../lsp-core/src/tools/parameters.ts
function isRecord7(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -4989,7 +5304,7 @@ function asDiagnosticArray(result) {
return result;
return result.items ?? [];
}
-async function executeLspDiagnostics(params, signal) {
+async function executeLspDiagnostics(params, signal, bunOptions = {}) {
const filePath = requireString(params, "filePath");
const severity = severityFilter(params);
try {
@@ -5010,6 +5325,19 @@ async function executeLspDiagnostics(params, signal) {
};
return text(message, details);
}
+ const bun = await runBunDirectoryDiagnostics(absPath, extension, severity, signal, bunOptions);
+ if (bun !== undefined) {
+ const details = {
+ filePath,
+ severity,
+ mode: "directory",
+ diagnostics: [...bun.diagnostics],
+ totalDiagnostics: bun.diagnostics.length,
+ truncated: bun.diagnostics.length > DEFAULT_MAX_DIAGNOSTICS,
+ projectCommands: [...bun.projectCommands]
+ };
+ return text(bun.output, details);
+ }
const output = await aggregateDiagnosticsForDirectory(absPath, extension, severity, undefined, signal === undefined ? {} : { signal });
const details = {
filePath,
@@ -5070,7 +5398,7 @@ async function executeLspDiagnostics(params, signal) {
}
}
// ../lsp-core/src/lsp/format-document.ts
-import { readFileSync as readFileSync5, renameSync as renameSync3, unlinkSync, writeFileSync as writeFileSync3 } from "node:fs";
+import { readFileSync as readFileSync6, renameSync as renameSync3, unlinkSync, writeFileSync as writeFileSync4 } from "node:fs";
var DEFAULT_FORMATTING_OPTIONS = {
tabSize: 4,
insertSpaces: false,
@@ -5085,7 +5413,7 @@ async function formatDocumentWithClient(client, filePath, options = {}) {
return { status: "unavailable", reason: "capability_not_advertised" };
if (edits.length === 0)
return UNCHANGED;
- const before = readFileSync5(filePath, "utf-8");
+ const before = readFileSync6(filePath, "utf-8");
const normalized = normalizeTextEdits(before, edits, 0);
if (normalized.text === before)
return UNCHANGED;
@@ -5108,7 +5436,7 @@ function lineDelta(edits) {
}
function writeAtomically(filePath, content) {
const tempPath = `${filePath}.omo-format.tmp`;
- writeFileSync3(tempPath, content, "utf-8");
+ writeFileSync4(tempPath, content, "utf-8");
try {
renameSync3(tempPath, filePath);
} catch (error) {
@@ -5413,7 +5741,7 @@ var LSP_MCP_TOOLS = [
name: "diagnostics",
aliases: ["lsp_diagnostics"],
title: "LSP Diagnostics",
- description: "Get errors, warnings, and hints for a source file or directory.",
+ description: "Get errors, warnings, and hints for a source file or directory. In a Bun project, a TypeScript directory is typechecked with `bun check`, plus `bun lint` when the installed Bun has it.",
inputSchema: objectSchema({
filePath: { type: "string", description: "File or directory path to check." },
severity: {
diff --git a/plugins/omo/components/lsp-tools-mcp/dist/tools.js b/plugins/omo/components/lsp-tools-mcp/dist/tools.js
index 5653f646..96e641d8 100644
--- a/plugins/omo/components/lsp-tools-mcp/dist/tools.js
+++ b/plugins/omo/components/lsp-tools-mcp/dist/tools.js
@@ -4623,6 +4623,321 @@ function missingDependencyAvailability(error) {
}
}
+// ../lsp-core/src/lsp/bun-command-output.ts
+import { resolve as resolve10 } from "node:path";
+var TSC_LINE = /^(.+?)\((\d+),(\d+)\): (error|warning|message) (TS\d+): (.*)$/;
+var TSC_SEVERITY = { error: 1, warning: 2, message: 3 };
+function parseBunCheckOutput(stdout, cwd) {
+ const results = [];
+ for (const line of stdout.split(/\r?\n/)) {
+ const match = TSC_LINE.exec(line);
+ if (match) {
+ const [, path, lineNumber, column, severity, code, message] = match;
+ const start = { line: Number(lineNumber) - 1, character: Number(column) - 1 };
+ results.push({
+ file: resolve10(cwd, path ?? ""),
+ diagnostic: {
+ range: { start, end: start },
+ severity: TSC_SEVERITY[severity ?? "error"] ?? 1,
+ code: code ?? "",
+ source: "bun check",
+ message: message ?? ""
+ }
+ });
+ continue;
+ }
+ const previous = results[results.length - 1];
+ if (previous !== undefined && /^\s+\S/.test(line)) {
+ previous.diagnostic.message = `${previous.diagnostic.message}
+${line.trim()}`;
+ }
+ }
+ return results;
+}
+function parseBunLintJson(stdout) {
+ let parsed;
+ try {
+ parsed = JSON.parse(stdout);
+ } catch {
+ return;
+ }
+ if (!Array.isArray(parsed))
+ return;
+ const results = [];
+ for (const entry of parsed) {
+ if (entry === null || typeof entry !== "object")
+ continue;
+ const filePath = entry.filePath;
+ const messages = entry.messages;
+ if (typeof filePath !== "string" || !Array.isArray(messages))
+ continue;
+ for (const raw of messages) {
+ const start = { line: Math.max(0, (raw.line ?? 1) - 1), character: Math.max(0, (raw.column ?? 1) - 1) };
+ const end = {
+ line: raw.endLine === undefined ? start.line : Math.max(0, raw.endLine - 1),
+ character: raw.endColumn === undefined ? start.character : Math.max(0, raw.endColumn - 1)
+ };
+ results.push({
+ file: filePath,
+ diagnostic: {
+ range: { start, end },
+ severity: raw.severity === 2 ? 1 : 2,
+ ...raw.ruleId ? { code: raw.ruleId } : {},
+ source: "bun lint",
+ message: raw.message ?? ""
+ }
+ });
+ }
+ }
+ return results;
+}
+
+// ../lsp-core/src/lsp/bun-project-checks.ts
+import { spawn as spawn2 } from "node:child_process";
+import { existsSync as existsSync12, mkdtempSync, readFileSync as readFileSync5, rmSync as rmSync2, statSync as statSync4, writeFileSync as writeFileSync3 } from "node:fs";
+import { homedir as homedir2, tmpdir } from "node:os";
+import { dirname as dirname9, join as join8, resolve as resolve11 } from "node:path";
+var BUN_LOCKFILES = ["bun.lock", "bun.lockb", "bunfig.toml"];
+var RUNNABLE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".cts", ".cjs", ".js", ".mjs", ".mts"];
+var BIN_SUFFIXES = process.platform === "win32" ? [".exe", ".bunx", ".cmd", ""] : [""];
+var PROBE_TIMEOUT_MS = 1e4;
+var UNFORMATTED_PROBE = `const a=1
+`;
+var probeCache = new Map;
+function findBunProjectRoot(start, home = homedir2()) {
+ const stopAt = resolve11(home);
+ let dir = resolve11(start);
+ for (;; ) {
+ if (dir === stopAt)
+ return;
+ if (BUN_LOCKFILES.some((name) => existsSync12(join8(dir, name))))
+ return dir;
+ if (packageManagerIsBun(join8(dir, "package.json")))
+ return dir;
+ if (existsSync12(join8(dir, ".git")))
+ return;
+ const parent = dirname9(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function packageManagerIsBun(packageJsonPath) {
+ const manifest = readJsonObject(packageJsonPath);
+ const packageManager = manifest?.["packageManager"];
+ return typeof packageManager === "string" && packageManager.startsWith("bun@");
+}
+function readJsonObject(path) {
+ if (!existsSync12(path))
+ return;
+ try {
+ const parsed = JSON.parse(readFileSync5(path, "utf8"));
+ return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
+ } catch {
+ return;
+ }
+}
+function isFile(path) {
+ try {
+ return statSync4(path).isFile();
+ } catch {
+ return false;
+ }
+}
+function isDirectory(path) {
+ try {
+ return statSync4(path).isDirectory();
+ } catch {
+ return false;
+ }
+}
+function projectShadowsBunCommand(command, cwd) {
+ const packageJsonDir = nearestPackageJsonDir(cwd);
+ if (packageJsonDir !== undefined) {
+ const scripts = readJsonObject(join8(packageJsonDir, "package.json"))?.["scripts"];
+ if (scripts !== null && typeof scripts === "object" && typeof scripts[command] === "string") {
+ return true;
+ }
+ }
+ if (command === "check")
+ return false;
+ const base = join8(cwd, command);
+ if (isFile(base) || RUNNABLE_EXTENSIONS.some((extension) => isFile(`${base}${extension}`)))
+ return true;
+ if (isDirectory(base) && (isFile(join8(base, "package.json")) || RUNNABLE_EXTENSIONS.some((extension) => isFile(join8(base, `index${extension}`))))) {
+ return true;
+ }
+ let dir = resolve11(cwd);
+ for (;; ) {
+ if (BIN_SUFFIXES.some((suffix) => existsSync12(join8(dir, "node_modules", ".bin", `${command}${suffix}`))))
+ return true;
+ const parent = dirname9(dir);
+ if (parent === dir)
+ return false;
+ dir = parent;
+ }
+}
+function nearestPackageJsonDir(start) {
+ let dir = resolve11(start);
+ for (;; ) {
+ if (existsSync12(join8(dir, "package.json")))
+ return dir;
+ const parent = dirname9(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function binaryIdentity(bunPath) {
+ try {
+ const stats = statSync4(bunPath);
+ return `${stats.mtimeMs}:${stats.size}`;
+ } catch {
+ return "missing";
+ }
+}
+function bunHasCommand(bunPath, command, timeoutMs = PROBE_TIMEOUT_MS) {
+ const key = `${bunPath}\x00${binaryIdentity(bunPath)}\x00${command}`;
+ const cached = probeCache.get(key);
+ if (cached !== undefined)
+ return cached;
+ const probe = probeOnce(bunPath, command, timeoutMs).then((answer) => {
+ if (answer === undefined)
+ probeCache.delete(key);
+ return answer === true;
+ });
+ probeCache.set(key, probe);
+ return probe;
+}
+async function probeOnce(bunPath, command, timeoutMs) {
+ const emptyDir = mkdtempSync(join8(tmpdir(), "omo-bun-probe-"));
+ const timeout = AbortSignal.timeout(timeoutMs);
+ try {
+ const help = await runBunCommand(bunPath, [command, "--help"], emptyDir, timeout);
+ if (help.exitCode === null)
+ return;
+ if (help.exitCode !== 0)
+ return false;
+ if (command !== "format")
+ return true;
+ const probeFile = join8(emptyDir, "probe.ts");
+ writeFileSync3(probeFile, UNFORMATTED_PROBE);
+ const write = await runBunCommand(bunPath, ["format", "--write", "probe.ts"], emptyDir, timeout);
+ if (write.exitCode === null)
+ return;
+ return write.exitCode === 0 && readFileSync5(probeFile, "utf8") !== UNFORMATTED_PROBE;
+ } catch {
+ return;
+ } finally {
+ rmSync2(emptyDir, { recursive: true, force: true });
+ }
+}
+async function resolveBunProjectCommand(command, cwd, options = {}) {
+ if (findBunProjectRoot(cwd, options.homeDir) === undefined)
+ return;
+ if (projectShadowsBunCommand(command, cwd))
+ return;
+ const bunPath = (options.resolveBun ?? defaultResolveBun)(cwd);
+ if (!bunPath)
+ return;
+ return await bunHasCommand(bunPath, command) ? bunPath : undefined;
+}
+function defaultResolveBun(cwd) {
+ return resolveServerBinary(["bun"], cwd);
+}
+function runBunCommand(bunPath, args, cwd, signal) {
+ signal?.throwIfAborted();
+ const prepared = createSpawnCommand([bunPath, ...args]);
+ return new Promise((resolvePromise, reject) => {
+ const child = spawn2(prepared.command, prepared.args, {
+ cwd,
+ stdio: ["ignore", "pipe", "pipe"],
+ shell: prepared.shell,
+ windowsHide: true,
+ detached: process.platform !== "win32"
+ });
+ const stdout = [];
+ const stderr = [];
+ const onAbort = () => killProcessTree(child, "SIGKILL");
+ signal?.addEventListener("abort", onAbort, { once: true });
+ child.stdout?.on("data", (chunk) => stdout.push(chunk));
+ child.stderr?.on("data", (chunk) => stderr.push(chunk));
+ child.once("error", (error) => {
+ signal?.removeEventListener("abort", onAbort);
+ reject(error);
+ });
+ child.once("close", (exitCode) => {
+ signal?.removeEventListener("abort", onAbort);
+ if (signal?.aborted) {
+ reject(signal.reason);
+ return;
+ }
+ resolvePromise({
+ exitCode,
+ stdout: Buffer.concat(stdout).toString("utf8"),
+ stderr: Buffer.concat(stderr).toString("utf8")
+ });
+ });
+ });
+}
+
+// ../lsp-core/src/tools/bun-directory-diagnostics.ts
+var TYPESCRIPT_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts"]);
+async function runBunDirectoryDiagnostics(absDir, extension, severity, signal, options = {}) {
+ if (!TYPESCRIPT_EXTENSIONS.has(extension))
+ return;
+ const checkBun = await resolveBunProjectCommand("check", absDir, options);
+ if (checkBun === undefined)
+ return;
+ let typecheck;
+ try {
+ const run = await runBunCommand(checkBun, ["check", "--no-pretty", "."], absDir, signal);
+ typecheck = parseBunCheckOutput(run.stdout, absDir);
+ const failedWithoutDiagnostics = run.exitCode === 1 && typecheck.length === 0;
+ if (run.exitCode !== 0 && run.exitCode !== 1 || failedWithoutDiagnostics)
+ return;
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return;
+ }
+ const header = [`Directory: ${absDir}`, "Typecheck: bun check (files in this directory and everything they import)"];
+ const projectCommands = ["bun check"];
+ const collected = [...typecheck];
+ const lintBun = await resolveBunProjectCommand("lint", absDir, options);
+ if (lintBun !== undefined) {
+ const lint = await runBunLint(lintBun, absDir, signal);
+ header.push(lint.status);
+ projectCommands.push("bun lint");
+ collected.push(...lint.diagnostics);
+ }
+ const diagnostics = collected.filter(({ diagnostic }) => filterDiagnosticsBySeverity([diagnostic], severity).length > 0);
+ const lines = [...header, `Total diagnostics: ${diagnostics.length}`];
+ const shown = diagnostics.slice(0, DEFAULT_MAX_DIAGNOSTICS);
+ if (shown.length > 0) {
+ lines.push("", ...shown.map(({ file, diagnostic }) => `${file}: ${formatDiagnostic(diagnostic)}`));
+ if (diagnostics.length > shown.length) {
+ lines.push("", `... (${diagnostics.length - shown.length} more diagnostics not shown)`);
+ }
+ }
+ return { output: lines.join(`
+`), diagnostics, projectCommands };
+}
+async function runBunLint(bunPath, absDir, signal) {
+ try {
+ const run = await runBunCommand(bunPath, ["lint", "-f", "json", "."], absDir, signal);
+ const diagnostics = run.exitCode === 0 || run.exitCode === 1 ? parseBunLintJson(run.stdout) : undefined;
+ if (diagnostics !== undefined)
+ return { status: "Lint: bun lint", diagnostics };
+ const reason = run.stderr.trim().split(/\r?\n/)[0] ?? "";
+ return { status: `Lint: bun lint could not lint (exit ${run.exitCode ?? "signal"})${reason ? `: ${reason}` : ""}`, diagnostics: [] };
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return { status: `Lint: bun lint could not run: ${error instanceof Error ? error.message : String(error)}`, diagnostics: [] };
+ }
+}
+
// ../lsp-core/src/tools/parameters.ts
function isRecord7(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -4677,7 +4992,7 @@ function asDiagnosticArray(result) {
return result;
return result.items ?? [];
}
-async function executeLspDiagnostics(params, signal) {
+async function executeLspDiagnostics(params, signal, bunOptions = {}) {
const filePath = requireString(params, "filePath");
const severity = severityFilter(params);
try {
@@ -4698,6 +5013,19 @@ async function executeLspDiagnostics(params, signal) {
};
return text(message, details);
}
+ const bun = await runBunDirectoryDiagnostics(absPath, extension, severity, signal, bunOptions);
+ if (bun !== undefined) {
+ const details = {
+ filePath,
+ severity,
+ mode: "directory",
+ diagnostics: [...bun.diagnostics],
+ totalDiagnostics: bun.diagnostics.length,
+ truncated: bun.diagnostics.length > DEFAULT_MAX_DIAGNOSTICS,
+ projectCommands: [...bun.projectCommands]
+ };
+ return text(bun.output, details);
+ }
const output = await aggregateDiagnosticsForDirectory(absPath, extension, severity, undefined, signal === undefined ? {} : { signal });
const details = {
filePath,
@@ -4758,7 +5086,7 @@ async function executeLspDiagnostics(params, signal) {
}
}
// ../lsp-core/src/lsp/format-document.ts
-import { readFileSync as readFileSync5, renameSync as renameSync3, unlinkSync, writeFileSync as writeFileSync3 } from "node:fs";
+import { readFileSync as readFileSync6, renameSync as renameSync3, unlinkSync, writeFileSync as writeFileSync4 } from "node:fs";
var DEFAULT_FORMATTING_OPTIONS = {
tabSize: 4,
insertSpaces: false,
@@ -4773,7 +5101,7 @@ async function formatDocumentWithClient(client, filePath, options = {}) {
return { status: "unavailable", reason: "capability_not_advertised" };
if (edits.length === 0)
return UNCHANGED;
- const before = readFileSync5(filePath, "utf-8");
+ const before = readFileSync6(filePath, "utf-8");
const normalized = normalizeTextEdits(before, edits, 0);
if (normalized.text === before)
return UNCHANGED;
@@ -4796,7 +5124,7 @@ function lineDelta(edits) {
}
function writeAtomically(filePath, content) {
const tempPath = `${filePath}.omo-format.tmp`;
- writeFileSync3(tempPath, content, "utf-8");
+ writeFileSync4(tempPath, content, "utf-8");
try {
renameSync3(tempPath, filePath);
} catch (error) {
@@ -5101,7 +5429,7 @@ var LSP_MCP_TOOLS = [
name: "diagnostics",
aliases: ["lsp_diagnostics"],
title: "LSP Diagnostics",
- description: "Get errors, warnings, and hints for a source file or directory.",
+ description: "Get errors, warnings, and hints for a source file or directory. In a Bun project, a TypeScript directory is typechecked with `bun check`, plus `bun lint` when the installed Bun has it.",
inputSchema: objectSchema({
filePath: { type: "string", description: "File or directory path to check." },
severity: {
diff --git a/plugins/omo/components/lsp/dist/.omo-runtime-manifest.json b/plugins/omo/components/lsp/dist/.omo-runtime-manifest.json
index df375d11..01bd858c 100644
--- a/plugins/omo/components/lsp/dist/.omo-runtime-manifest.json
+++ b/plugins/omo/components/lsp/dist/.omo-runtime-manifest.json
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
- "version": "5.1.42",
- "inputDigest": "sha256:67783401245cfd4a937dfd08ba04aa96bff6ea9816e0f6caeca4d98722b2baec",
+ "version": "5.1.43",
+ "inputDigest": "sha256:a83a1a725be4b46b073412ce13e9872277ac52be27fc4e32b8dd2f21354a937f",
"outputs": [
{
"path": "cli.d.ts",
@@ -9,7 +9,7 @@
},
{
"path": "cli.js",
- "sha256": "0775d5a52628cc6aeed25d5ff10fdf42f236b8058428d5120f278ce5157ad76a"
+ "sha256": "a2b1db4d57a57bb19cad2ec6ba19694dcc0e0231903c010c0e845821af6dfeae"
},
{
"path": "codex-hook-cli.d.ts",
diff --git a/plugins/omo/components/lsp/dist/cli.js b/plugins/omo/components/lsp/dist/cli.js
index 4b2de793..17055c89 100644
--- a/plugins/omo/components/lsp/dist/cli.js
+++ b/plugins/omo/components/lsp/dist/cli.js
@@ -1,19 +1,19 @@
#!/usr/bin/env node
// src/cli.ts
-import { spawn as spawn3 } from "node:child_process";
+import { spawn as spawn4 } from "node:child_process";
import { argv, execPath as execPath2, stderr } from "node:process";
// src/codex-hook-cli.ts
import { stdin as processStdin } from "node:process";
// src/codex-hook.ts
-import { readFileSync as readFileSync9, realpathSync as realpathSync7 } from "node:fs";
-import { homedir as homedir3 } from "node:os";
-import { join as join11, resolve as resolve11 } from "node:path";
+import { readFileSync as readFileSync10, realpathSync as realpathSync7 } from "node:fs";
+import { homedir as homedir4 } from "node:os";
+import { join as join12, resolve as resolve13 } from "node:path";
// ../../../../lsp-daemon/dist/client.js
-import { statSync as statSync5 } from "node:fs";
+import { statSync as statSync6 } from "node:fs";
import { isAbsolute as isAbsolute6 } from "node:path";
import { connect } from "node:net";
import { setTimeout as delay } from "node:timers/promises";
@@ -77,7 +77,12 @@ import { join as join6, resolve as resolve9 } from "node:path";
import { fileURLToPath as fileURLToPath3 } from "node:url";
import { lstatSync as lstatSync6, readdirSync as readdirSync4 } from "node:fs";
import { join as join7 } from "node:path";
-import { readFileSync as readFileSync6, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "node:fs";
+import { resolve as resolve10 } from "node:path";
+import { spawn as spawn3 } from "node:child_process";
+import { existsSync as existsSync13, mkdtempSync, readFileSync as readFileSync6, rmSync as rmSync2, statSync as statSync5, writeFileSync as writeFileSync3 } from "node:fs";
+import { homedir as homedir3, tmpdir as tmpdir2 } from "node:os";
+import { dirname as dirname11, join as join8, resolve as resolve11 } from "node:path";
+import { readFileSync as readFileSync7, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync4 } from "node:fs";
class LspRequestContextParseError extends Error {
constructor(code, message) {
@@ -5008,6 +5013,310 @@ function missingDependencyAvailability(error) {
}
}
}
+var TSC_LINE = /^(.+?)\((\d+),(\d+)\): (error|warning|message) (TS\d+): (.*)$/;
+var TSC_SEVERITY = { error: 1, warning: 2, message: 3 };
+function parseBunCheckOutput(stdout, cwd) {
+ const results = [];
+ for (const line of stdout.split(/\r?\n/)) {
+ const match = TSC_LINE.exec(line);
+ if (match) {
+ const [, path, lineNumber, column, severity, code, message] = match;
+ const start = { line: Number(lineNumber) - 1, character: Number(column) - 1 };
+ results.push({
+ file: resolve10(cwd, path ?? ""),
+ diagnostic: {
+ range: { start, end: start },
+ severity: TSC_SEVERITY[severity ?? "error"] ?? 1,
+ code: code ?? "",
+ source: "bun check",
+ message: message ?? ""
+ }
+ });
+ continue;
+ }
+ const previous = results[results.length - 1];
+ if (previous !== undefined && /^\s+\S/.test(line)) {
+ previous.diagnostic.message = `${previous.diagnostic.message}
+${line.trim()}`;
+ }
+ }
+ return results;
+}
+function parseBunLintJson(stdout) {
+ let parsed;
+ try {
+ parsed = JSON.parse(stdout);
+ } catch {
+ return;
+ }
+ if (!Array.isArray(parsed))
+ return;
+ const results = [];
+ for (const entry of parsed) {
+ if (entry === null || typeof entry !== "object")
+ continue;
+ const filePath = entry.filePath;
+ const messages = entry.messages;
+ if (typeof filePath !== "string" || !Array.isArray(messages))
+ continue;
+ for (const raw of messages) {
+ const start = { line: Math.max(0, (raw.line ?? 1) - 1), character: Math.max(0, (raw.column ?? 1) - 1) };
+ const end = {
+ line: raw.endLine === undefined ? start.line : Math.max(0, raw.endLine - 1),
+ character: raw.endColumn === undefined ? start.character : Math.max(0, raw.endColumn - 1)
+ };
+ results.push({
+ file: filePath,
+ diagnostic: {
+ range: { start, end },
+ severity: raw.severity === 2 ? 1 : 2,
+ ...raw.ruleId ? { code: raw.ruleId } : {},
+ source: "bun lint",
+ message: raw.message ?? ""
+ }
+ });
+ }
+ }
+ return results;
+}
+var BUN_LOCKFILES = ["bun.lock", "bun.lockb", "bunfig.toml"];
+var RUNNABLE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".cts", ".cjs", ".js", ".mjs", ".mts"];
+var BIN_SUFFIXES = process.platform === "win32" ? [".exe", ".bunx", ".cmd", ""] : [""];
+var PROBE_TIMEOUT_MS2 = 1e4;
+var UNFORMATTED_PROBE = `const a=1
+`;
+var probeCache = new Map;
+function findBunProjectRoot(start, home = homedir3()) {
+ const stopAt = resolve11(home);
+ let dir = resolve11(start);
+ for (;; ) {
+ if (dir === stopAt)
+ return;
+ if (BUN_LOCKFILES.some((name) => existsSync13(join8(dir, name))))
+ return dir;
+ if (packageManagerIsBun(join8(dir, "package.json")))
+ return dir;
+ if (existsSync13(join8(dir, ".git")))
+ return;
+ const parent = dirname11(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function packageManagerIsBun(packageJsonPath) {
+ const manifest = readJsonObject(packageJsonPath);
+ const packageManager = manifest?.["packageManager"];
+ return typeof packageManager === "string" && packageManager.startsWith("bun@");
+}
+function readJsonObject(path) {
+ if (!existsSync13(path))
+ return;
+ try {
+ const parsed = JSON.parse(readFileSync6(path, "utf8"));
+ return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
+ } catch {
+ return;
+ }
+}
+function isFile(path) {
+ try {
+ return statSync5(path).isFile();
+ } catch {
+ return false;
+ }
+}
+function isDirectory(path) {
+ try {
+ return statSync5(path).isDirectory();
+ } catch {
+ return false;
+ }
+}
+function projectShadowsBunCommand(command, cwd) {
+ const packageJsonDir = nearestPackageJsonDir(cwd);
+ if (packageJsonDir !== undefined) {
+ const scripts = readJsonObject(join8(packageJsonDir, "package.json"))?.["scripts"];
+ if (scripts !== null && typeof scripts === "object" && typeof scripts[command] === "string") {
+ return true;
+ }
+ }
+ if (command === "check")
+ return false;
+ const base = join8(cwd, command);
+ if (isFile(base) || RUNNABLE_EXTENSIONS.some((extension) => isFile(`${base}${extension}`)))
+ return true;
+ if (isDirectory(base) && (isFile(join8(base, "package.json")) || RUNNABLE_EXTENSIONS.some((extension) => isFile(join8(base, `index${extension}`))))) {
+ return true;
+ }
+ let dir = resolve11(cwd);
+ for (;; ) {
+ if (BIN_SUFFIXES.some((suffix) => existsSync13(join8(dir, "node_modules", ".bin", `${command}${suffix}`))))
+ return true;
+ const parent = dirname11(dir);
+ if (parent === dir)
+ return false;
+ dir = parent;
+ }
+}
+function nearestPackageJsonDir(start) {
+ let dir = resolve11(start);
+ for (;; ) {
+ if (existsSync13(join8(dir, "package.json")))
+ return dir;
+ const parent = dirname11(dir);
+ if (parent === dir)
+ return;
+ dir = parent;
+ }
+}
+function binaryIdentity(bunPath) {
+ try {
+ const stats = statSync5(bunPath);
+ return `${stats.mtimeMs}:${stats.size}`;
+ } catch {
+ return "missing";
+ }
+}
+function bunHasCommand(bunPath, command, timeoutMs = PROBE_TIMEOUT_MS2) {
+ const key = `${bunPath}\x00${binaryIdentity(bunPath)}\x00${command}`;
+ const cached = probeCache.get(key);
+ if (cached !== undefined)
+ return cached;
+ const probe = probeOnce(bunPath, command, timeoutMs).then((answer) => {
+ if (answer === undefined)
+ probeCache.delete(key);
+ return answer === true;
+ });
+ probeCache.set(key, probe);
+ return probe;
+}
+async function probeOnce(bunPath, command, timeoutMs) {
+ const emptyDir = mkdtempSync(join8(tmpdir2(), "omo-bun-probe-"));
+ const timeout = AbortSignal.timeout(timeoutMs);
+ try {
+ const help = await runBunCommand(bunPath, [command, "--help"], emptyDir, timeout);
+ if (help.exitCode === null)
+ return;
+ if (help.exitCode !== 0)
+ return false;
+ if (command !== "format")
+ return true;
+ const probeFile = join8(emptyDir, "probe.ts");
+ writeFileSync3(probeFile, UNFORMATTED_PROBE);
+ const write = await runBunCommand(bunPath, ["format", "--write", "probe.ts"], emptyDir, timeout);
+ if (write.exitCode === null)
+ return;
+ return write.exitCode === 0 && readFileSync6(probeFile, "utf8") !== UNFORMATTED_PROBE;
+ } catch {
+ return;
+ } finally {
+ rmSync2(emptyDir, { recursive: true, force: true });
+ }
+}
+async function resolveBunProjectCommand(command, cwd, options = {}) {
+ if (findBunProjectRoot(cwd, options.homeDir) === undefined)
+ return;
+ if (projectShadowsBunCommand(command, cwd))
+ return;
+ const bunPath = (options.resolveBun ?? defaultResolveBun)(cwd);
+ if (!bunPath)
+ return;
+ return await bunHasCommand(bunPath, command) ? bunPath : undefined;
+}
+function defaultResolveBun(cwd) {
+ return resolveServerBinary(["bun"], cwd);
+}
+function runBunCommand(bunPath, args, cwd, signal) {
+ signal?.throwIfAborted();
+ const prepared = createSpawnCommand([bunPath, ...args]);
+ return new Promise((resolvePromise, reject) => {
+ const child = spawn3(prepared.command, prepared.args, {
+ cwd,
+ stdio: ["ignore", "pipe", "pipe"],
+ shell: prepared.shell,
+ windowsHide: true,
+ detached: process.platform !== "win32"
+ });
+ const stdout = [];
+ const stderr = [];
+ const onAbort = () => killProcessTree(child, "SIGKILL");
+ signal?.addEventListener("abort", onAbort, { once: true });
+ child.stdout?.on("data", (chunk) => stdout.push(chunk));
+ child.stderr?.on("data", (chunk) => stderr.push(chunk));
+ child.once("error", (error) => {
+ signal?.removeEventListener("abort", onAbort);
+ reject(error);
+ });
+ child.once("close", (exitCode) => {
+ signal?.removeEventListener("abort", onAbort);
+ if (signal?.aborted) {
+ reject(signal.reason);
+ return;
+ }
+ resolvePromise({
+ exitCode,
+ stdout: Buffer.concat(stdout).toString("utf8"),
+ stderr: Buffer.concat(stderr).toString("utf8")
+ });
+ });
+ });
+}
+var TYPESCRIPT_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts"]);
+async function runBunDirectoryDiagnostics(absDir, extension, severity, signal, options = {}) {
+ if (!TYPESCRIPT_EXTENSIONS.has(extension))
+ return;
+ const checkBun = await resolveBunProjectCommand("check", absDir, options);
+ if (checkBun === undefined)
+ return;
+ let typecheck;
+ try {
+ const run = await runBunCommand(checkBun, ["check", "--no-pretty", "."], absDir, signal);
+ typecheck = parseBunCheckOutput(run.stdout, absDir);
+ const failedWithoutDiagnostics = run.exitCode === 1 && typecheck.length === 0;
+ if (run.exitCode !== 0 && run.exitCode !== 1 || failedWithoutDiagnostics)
+ return;
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return;
+ }
+ const header = [`Directory: ${absDir}`, "Typecheck: bun check (files in this directory and everything they import)"];
+ const projectCommands = ["bun check"];
+ const collected = [...typecheck];
+ const lintBun = await resolveBunProjectCommand("lint", absDir, options);
+ if (lintBun !== undefined) {
+ const lint = await runBunLint(lintBun, absDir, signal);
+ header.push(lint.status);
+ projectCommands.push("bun lint");
+ collected.push(...lint.diagnostics);
+ }
+ const diagnostics = collected.filter(({ diagnostic }) => filterDiagnosticsBySeverity([diagnostic], severity).length > 0);
+ const lines = [...header, `Total diagnostics: ${diagnostics.length}`];
+ const shown = diagnostics.slice(0, DEFAULT_MAX_DIAGNOSTICS);
+ if (shown.length > 0) {
+ lines.push("", ...shown.map(({ file, diagnostic }) => `${file}: ${formatDiagnostic(diagnostic)}`));
+ if (diagnostics.length > shown.length) {
+ lines.push("", `... (${diagnostics.length - shown.length} more diagnostics not shown)`);
+ }
+ }
+ return { output: lines.join(`
+`), diagnostics, projectCommands };
+}
+async function runBunLint(bunPath, absDir, signal) {
+ try {
+ const run = await runBunCommand(bunPath, ["lint", "-f", "json", "."], absDir, signal);
+ const diagnostics = run.exitCode === 0 || run.exitCode === 1 ? parseBunLintJson(run.stdout) : undefined;
+ if (diagnostics !== undefined)
+ return { status: "Lint: bun lint", diagnostics };
+ const reason = run.stderr.trim().split(/\r?\n/)[0] ?? "";
+ return { status: `Lint: bun lint could not lint (exit ${run.exitCode ?? "signal"})${reason ? `: ${reason}` : ""}`, diagnostics: [] };
+ } catch (error) {
+ if (signal?.aborted)
+ throw error;
+ return { status: `Lint: bun lint could not run: ${error instanceof Error ? error.message : String(error)}`, diagnostics: [] };
+ }
+}
function requireString(params, key) {
const value = params[key];
if (typeof value !== "string" || value.length === 0) {
@@ -5054,7 +5363,7 @@ function asDiagnosticArray(result) {
return result;
return result.items ?? [];
}
-async function executeLspDiagnostics(params, signal) {
+async function executeLspDiagnostics(params, signal, bunOptions = {}) {
const filePath = requireString(params, "filePath");
const severity = severityFilter(params);
try {
@@ -5075,6 +5384,19 @@ async function executeLspDiagnostics(params, signal) {
};
return text(message, details);
}
+ const bun = await runBunDirectoryDiagnostics(absPath, extension, severity, signal, bunOptions);
+ if (bun !== undefined) {
+ const details = {
+ filePath,
+ severity,
+ mode: "directory",
+ diagnostics: [...bun.diagnostics],
+ totalDiagnostics: bun.diagnostics.length,
+ truncated: bun.diagnostics.length > DEFAULT_MAX_DIAGNOSTICS,
+ projectCommands: [...bun.projectCommands]
+ };
+ return text(bun.output, details);
+ }
const output = await aggregateDiagnosticsForDirectory(absPath, extension, severity, undefined, signal === undefined ? {} : { signal });
const details = {
filePath,
@@ -5148,7 +5470,7 @@ async function formatDocumentWithClient(client, filePath, options = {}) {
return { status: "unavailable", reason: "capability_not_advertised" };
if (edits.length === 0)
return UNCHANGED;
- const before = readFileSync6(filePath, "utf-8");
+ const before = readFileSync7(filePath, "utf-8");
const normalized = normalizeTextEdits(before, edits, 0);
if (normalized.text === before)
return UNCHANGED;
@@ -5171,7 +5493,7 @@ function lineDelta(edits) {
}
function writeAtomically(filePath, content) {
const tempPath = `${filePath}.omo-format.tmp`;
- writeFileSync3(tempPath, content, "utf-8");
+ writeFileSync4(tempPath, content, "utf-8");
try {
renameSync3(tempPath, filePath);
} catch (error) {
@@ -5460,7 +5782,7 @@ var LSP_MCP_TOOLS = [
name: "diagnostics",
aliases: ["lsp_diagnostics"],
title: "LSP Diagnostics",
- description: "Get errors, warnings, and hints for a source file or directory.",
+ description: "Get errors, warnings, and hints for a source file or directory. In a Bun project, a TypeScript directory is typechecked with `bun check`, plus `bun lint` when the installed Bun has it.",
inputSchema: objectSchema({
filePath: { type: "string", description: "File or directory path to check." },
severity: {
@@ -5780,7 +6102,7 @@ function resolveDaemonRuntime2(env, defaults) {
if (!isAbsolute6(cliOverride)) {
throw new InvalidRuntimeOverrideError2("cli_must_be_absolute", `${OMO_LSP_DAEMON_CLI2} must be an absolute path to an existing regular file`);
}
- const stat = statSync5(cliOverride, { throwIfNoEntry: false });
+ const stat = statSync6(cliOverride, { throwIfNoEntry: false });
if (!stat) {
throw new InvalidRuntimeOverrideError2("cli_not_found", `${OMO_LSP_DAEMON_CLI2} points to a missing file`);
}
@@ -5807,8 +6129,8 @@ var WORKSPACE_MARKERS2 = [GIT_WORKSPACE_MARKER2, ...PROJECT_WORKSPACE_MARKERS2];
// ../../../../lsp-core/src/request-context.ts
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
-import { existsSync as existsSync13, realpathSync as realpathSync6, statSync as statSync6 } from "node:fs";
-import { basename as basename4, delimiter as delimiter4, dirname as dirname2, isAbsolute as isAbsolute7, join as join8, relative as relative5, resolve as resolve10 } from "node:path";
+import { existsSync as existsSync14, realpathSync as realpathSync6, statSync as statSync7 } from "node:fs";
+import { basename as basename4, delimiter as delimiter4, dirname as dirname2, isAbsolute as isAbsolute7, join as join9, relative as relative5, resolve as resolve12 } from "node:path";
class LspRequestContextParseError2 extends Error {
constructor(code, message) {
@@ -5849,19 +6171,19 @@ function parseLspRequestContext2(value) {
};
}
function canonicalCwd2(cwd) {
- const resolved = resolve10(cwd);
- if (!existsSync13(resolved) || !statSync6(resolved).isDirectory()) {
+ const resolved = resolve12(cwd);
+ if (!existsSync14(resolved) || !statSync7(resolved).isDirectory()) {
throw new LspRequestContextParseError2("invalid_cwd", `LSP request cwd must be an existing directory: ${cwd}`);
}
return realpathSync6(resolved);
}
function canonicalizeExistingOrNearestAncestor2(path) {
- let current = resolve10(path);
+ let current = resolve12(path);
const suffix = [];
while (true) {
try {
const existing = realpathSync6(current);
- return suffix.length === 0 ? existing : join8(existing, ...suffix);
+ return suffix.length === 0 ? existing : join9(existing, ...suffix);
} catch (error) {
if (!isMissingPathError2(error))
throw error;
@@ -5904,7 +6226,7 @@ function requireAbsolutePath2(path, field) {
}
}
function isPathInside2(parent, child) {
- const childPath = resolve10(child);
+ const childPath = resolve12(child);
const relativePath = relative5(parent, childPath);
return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute7(relativePath);
}
@@ -6057,9 +6379,9 @@ function extensionKey(filePath) {
return extension.length === 0 ? undefined : extension;
}
// src/daemon-cli-path.ts
-import { existsSync as existsSync14, readFileSync as readFileSync7 } from "node:fs";
+import { existsSync as existsSync15, readFileSync as readFileSync8 } from "node:fs";
import { createRequire as createRequire2 } from "node:module";
-import { dirname as dirname11, join as join9 } from "node:path";
+import { dirname as dirname12, join as join10 } from "node:path";
import { fileURLToPath as fileURLToPath4 } from "node:url";
var requireFromHere2 = createRequire2(import.meta.url);
var PACKAGE_LSP_DAEMON_CLI = "@code-yeongyu/lsp-daemon/cli";
@@ -6081,7 +6403,7 @@ function resolveLspDaemonCli() {
if (packageCli !== null)
return resolveConfiguredLspDaemonCli(packageCli);
const bundledCli = fileURLToPath4(new URL("../../lsp-daemon/dist/cli.js", import.meta.url));
- if (existsSync14(bundledCli))
+ if (existsSync15(bundledCli))
return resolveConfiguredLspDaemonCli(bundledCli);
return resolveConfiguredLspDaemonCli(bundledCli);
}
@@ -6106,7 +6428,7 @@ function resolveConfiguredLspDaemonCli(cliPath) {
}
function readDaemonPackageVersion(cliPath) {
try {
- const parsed = JSON.parse(readFileSync7(join9(dirname11(cliPath), "package.json"), "utf8"));
+ const parsed = JSON.parse(readFileSync8(join10(dirname12(cliPath), "package.json"), "utf8"));
if (isRecord8(parsed) && typeof parsed["version"] === "string" && parsed["version"].length > 0) {
return parsed["version"];
}
@@ -6121,9 +6443,9 @@ function isRecord8(value) {
}
// src/lsp-session-state.ts
-import { mkdirSync as mkdirSync4, readFileSync as readFileSync8, writeFileSync as writeFileSync4 } from "node:fs";
+import { mkdirSync as mkdirSync4, readFileSync as readFileSync9, writeFileSync as writeFileSync5 } from "node:fs";
import { homedir } from "node:os";
-import { dirname as dirname12, join as join10 } from "node:path";
+import { dirname as dirname13, join as join11 } from "node:path";
function sessionIdFrom(input) {
return typeof input.session_id === "string" && input.session_id.length > 0 ? input.session_id : undefined;
}
@@ -6149,12 +6471,12 @@ function isLspDaemonUnreachableDiagnostics(diagnostics) {
return diagnostics.includes("LSP daemon unreachable");
}
function sessionStatePath(sessionId) {
- const root = process.env["PLUGIN_DATA"] ?? join10(homedir(), ".codex", "codex-lsp");
- return join10(root, "sessions", `${safePathSegment(sessionId)}.json`);
+ const root = process.env["PLUGIN_DATA"] ?? join11(homedir(), ".codex", "codex-lsp");
+ return join11(root, "sessions", `${safePathSegment(sessionId)}.json`);
}
function readSessionState(path) {
try {
- const parsed = JSON.parse(readFileSync8(path, "utf8"));
+ const parsed = JSON.parse(readFileSync9(path, "utf8"));
if (isRecord9(parsed) && isLspSessionState(parsed))
return normalizeSessionState(parsed);
return emptyState();
@@ -6165,8 +6487,8 @@ function readSessionState(path) {
}
}
function writeSessionState(path, state) {
- mkdirSync4(dirname12(path), { recursive: true });
- writeFileSync4(path, `${JSON.stringify(state)}
+ mkdirSync4(dirname13(path), { recursive: true });
+ writeFileSync5(path, `${JSON.stringify(state)}
`);
}
function emptyState() {
@@ -6320,13 +6642,13 @@ function notInstalledOutcome(availability, text) {
return decision === "declined" || decision === "allowed" ? { ...base, decision } : base;
}
function codexLspRequestContext(env = process.env, cwd = process.cwd()) {
- const canonicalCwd = realpathSync7(resolve11(cwd));
- const codexHome = resolve11(env["CODEX_HOME"]?.trim() || join11(homedir3(), ".codex"));
+ const canonicalCwd = realpathSync7(resolve13(cwd));
+ const codexHome = resolve13(env["CODEX_HOME"]?.trim() || join12(homedir4(), ".codex"));
return parseLspRequestContext2({
cwd: canonicalCwd,
- projectConfigPaths: [join11(canonicalCwd, ".codex", "lsp-client.json")],
- userConfigPath: join11(codexHome, "lsp-client.json"),
- installDecisionsPath: join11(codexHome, "lsp-install-decisions.json"),
+ projectConfigPaths: [join12(canonicalCwd, ".codex", "lsp-client.json")],
+ userConfigPath: join12(codexHome, "lsp-client.json"),
+ installDecisionsPath: join12(codexHome, "lsp-install-decisions.json"),
capabilities: { installDecisionTool: true }
});
}
@@ -6419,7 +6741,7 @@ function isContextPressureTranscript(transcriptPath) {
if (typeof transcriptPath !== "string")
return false;
try {
- return hasContextPressureMarker(readFileSync9(transcriptPath, "utf8"));
+ return hasContextPressureMarker(readFileSync10(transcriptPath, "utf8"));
} catch (error) {
if (error instanceof Error)
return false;
@@ -6501,7 +6823,7 @@ main().catch((error) => {
});
async function runPackageLspMcpCli() {
const cliPath = resolveLspDaemonCliPath();
- const child = spawn3(execPath2, [cliPath, "mcp"], { stdio: "inherit", windowsHide: true });
+ const child = spawn4(execPath2, [cliPath, "mcp"], { stdio: "inherit", windowsHide: true });
await new Promise((resolve, reject) => {
child.once("error", reject);
child.once("exit", (code, signal) => {
diff --git a/plugins/omo/components/lsp/hooks/hooks.json b/plugins/omo/components/lsp/hooks/hooks.json
index 1865cd95..93166e79 100644
--- a/plugins/omo/components/lsp/hooks/hooks.json
+++ b/plugins/omo/components/lsp/hooks/hooks.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
"timeout": 60,
- "statusMessage": "(OmO 5.1.42) Checking LSP Diagnostics"
+ "statusMessage": "(OmO 5.1.43) Checking LSP Diagnostics"
}
]
}
@@ -21,7 +21,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Resetting LSP Diagnostics Cache"
+ "statusMessage": "(OmO 5.1.43) Resetting LSP Diagnostics Cache"
}
]
}
diff --git a/plugins/omo/components/lsp/package.json b/plugins/omo/components/lsp/package.json
index 398a1f9e..144ee5bb 100644
--- a/plugins/omo/components/lsp/package.json
+++ b/plugins/omo/components/lsp/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-lsp",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex plugin that exposes Language Server Protocol tools and post-edit diagnostics.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/rules/hooks/hooks.json b/plugins/omo/components/rules/hooks/hooks.json
index 5a7c240d..313e1e4f 100644
--- a/plugins/omo/components/rules/hooks/hooks.json
+++ b/plugins/omo/components/rules/hooks/hooks.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook session-start",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Loading Project Rules"
+ "statusMessage": "(OmO 5.1.43) Loading Project Rules"
}
]
}
@@ -19,7 +19,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook user-prompt-submit",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Loading Project Rules"
+ "statusMessage": "(OmO 5.1.43) Loading Project Rules"
}
]
}
@@ -32,7 +32,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Matching Project Rules"
+ "statusMessage": "(OmO 5.1.43) Matching Project Rules"
}
]
}
@@ -45,7 +45,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Resetting Project Rule Cache"
+ "statusMessage": "(OmO 5.1.43) Resetting Project Rule Cache"
}
]
}
diff --git a/plugins/omo/components/rules/package.json b/plugins/omo/components/rules/package.json
index 01f8a144..2d202f81 100644
--- a/plugins/omo/components/rules/package.json
+++ b/plugins/omo/components/rules/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-rules",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex plugin that injects project rule files into model context through lifecycle hooks.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/teammode/hooks/hooks.json b/plugins/omo/components/teammode/hooks/hooks.json
index b9087a42..1b0d5988 100644
--- a/plugins/omo/components/teammode/hooks/hooks.json
+++ b/plugins/omo/components/teammode/hooks/hooks.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Checking Thread Title Hygiene"
+ "statusMessage": "(OmO 5.1.43) Checking Thread Title Hygiene"
}
]
}
diff --git a/plugins/omo/components/teammode/package.json b/plugins/omo/components/teammode/package.json
index 071a2044..c79f0541 100644
--- a/plugins/omo/components/teammode/package.json
+++ b/plugins/omo/components/teammode/package.json
@@ -1,6 +1,6 @@
{
"name": "@sisyphuslabs/codex-teammode",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex team-mode hook component that keeps background thread titles descriptive after create_thread.",
"type": "module",
"private": true,
diff --git a/plugins/omo/components/telemetry/dist/cli.js b/plugins/omo/components/telemetry/dist/cli.js
index 64b86f9a..e776efb6 100755
--- a/plugins/omo/components/telemetry/dist/cli.js
+++ b/plugins/omo/components/telemetry/dist/cli.js
@@ -270,6 +270,8 @@ function toDiagnosticRecord(input, now) {
timestamp: now.toISOString(),
event: input.event,
source: input.source,
+ ...input.entryKind === undefined ? {} : { entry_kind: input.entryKind },
+ ...input.errorCode === undefined ? {} : { error_code: input.errorCode },
...input.count === undefined ? {} : { count: input.count },
...serializeError(input.error, input.errorKind)
};
diff --git a/plugins/omo/components/telemetry/dist/posthog.js b/plugins/omo/components/telemetry/dist/posthog.js
index 7a62100e..364aed02 100644
--- a/plugins/omo/components/telemetry/dist/posthog.js
+++ b/plugins/omo/components/telemetry/dist/posthog.js
@@ -265,6 +265,8 @@ function toDiagnosticRecord(input, now) {
timestamp: now.toISOString(),
event: input.event,
source: input.source,
+ ...input.entryKind === undefined ? {} : { entry_kind: input.entryKind },
+ ...input.errorCode === undefined ? {} : { error_code: input.errorCode },
...input.count === undefined ? {} : { count: input.count },
...serializeError(input.error, input.errorKind)
};
diff --git a/plugins/omo/components/telemetry/hooks/hooks.json b/plugins/omo/components/telemetry/hooks/hooks.json
index 04dee90b..ae83286f 100644
--- a/plugins/omo/components/telemetry/hooks/hooks.json
+++ b/plugins/omo/components/telemetry/hooks/hooks.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook session-start",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Recording Session Telemetry"
+ "statusMessage": "(OmO 5.1.43) Recording Session Telemetry"
}
]
}
diff --git a/plugins/omo/components/telemetry/package.json b/plugins/omo/components/telemetry/package.json
index 3a65aca8..bc2eb3a6 100644
--- a/plugins/omo/components/telemetry/package.json
+++ b/plugins/omo/components/telemetry/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-telemetry",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex plugin component that emits omo-codex anonymous daily-active telemetry on SessionStart.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/ultrawork/hooks/hooks.json b/plugins/omo/components/ultrawork/hooks/hooks.json
index 12f4a506..03f5d6b5 100644
--- a/plugins/omo/components/ultrawork/hooks/hooks.json
+++ b/plugins/omo/components/ultrawork/hooks/hooks.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook user-prompt-submit",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Checking Ultrawork Trigger"
+ "statusMessage": "(OmO 5.1.43) Checking Ultrawork Trigger"
}
]
}
diff --git a/plugins/omo/components/ultrawork/package.json b/plugins/omo/components/ultrawork/package.json
index 81569887..b99e9aac 100644
--- a/plugins/omo/components/ultrawork/package.json
+++ b/plugins/omo/components/ultrawork/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-ultrawork",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex plugin that injects the ultrawork orchestration directive and ships LazyCodex planning, review, QA, and gate agent roles.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/ulw-execute-continuation/hooks/hooks.json b/plugins/omo/components/ulw-execute-continuation/hooks/hooks.json
index 41d23185..21ba9c79 100644
--- a/plugins/omo/components/ulw-execute-continuation/hooks/hooks.json
+++ b/plugins/omo/components/ulw-execute-continuation/hooks/hooks.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ulw-execute-continuation/dist/cli.js\" hook stop",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Checking Ulw-Execute Continuation"
+ "statusMessage": "(OmO 5.1.43) Checking Ulw-Execute Continuation"
}
]
}
diff --git a/plugins/omo/components/ulw-execute-continuation/package.json b/plugins/omo/components/ulw-execute-continuation/package.json
index e0eeaf08..1d4641e2 100644
--- a/plugins/omo/components/ulw-execute-continuation/package.json
+++ b/plugins/omo/components/ulw-execute-continuation/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-ulw-execute-continuation",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex Stop hook continuation injector for omo-codex ulw-execute plans.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/ulw-loop/hooks/hooks.json b/plugins/omo/components/ulw-loop/hooks/hooks.json
index c80c5073..a83397cb 100644
--- a/plugins/omo/components/ulw-loop/hooks/hooks.json
+++ b/plugins/omo/components/ulw-loop/hooks/hooks.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook user-prompt-submit --with-ultrawork",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Checking Ulw-Loop Steering"
+ "statusMessage": "(OmO 5.1.43) Checking Ulw-Loop Steering"
}
]
}
@@ -20,7 +20,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use-spawn",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Recording Spawn Admission"
+ "statusMessage": "(OmO 5.1.43) Recording Spawn Admission"
}
]
}
@@ -33,7 +33,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook pre-tool-use",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Enforcing Unlimited Ulw-Loop Budget"
+ "statusMessage": "(OmO 5.1.43) Enforcing Unlimited Ulw-Loop Budget"
}
]
},
@@ -44,7 +44,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook pre-tool-use-spawn",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Guarding Ulw-Loop Spawns"
+ "statusMessage": "(OmO 5.1.43) Guarding Ulw-Loop Spawns"
}
]
}
@@ -56,7 +56,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook stop",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Checking Ulw-Loop Resume"
+ "statusMessage": "(OmO 5.1.43) Checking Ulw-Loop Resume"
}
]
}
diff --git a/plugins/omo/components/ulw-loop/package.json b/plugins/omo/components/ulw-loop/package.json
index dc6c2d17..4277f0d6 100644
--- a/plugins/omo/components/ulw-loop/package.json
+++ b/plugins/omo/components/ulw-loop/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-ulw-loop",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Codex plugin: durable repo-native multi-goal orchestration with embedded success criteria and observable evidence audit.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/dist/cli-node/index.js b/plugins/omo/dist/cli-node/index.js
index b482a8cb..6c476261 100755
--- a/plugins/omo/dist/cli-node/index.js
+++ b/plugins/omo/dist/cli-node/index.js
@@ -2133,7 +2133,7 @@ var package_default;
var init_package = __esm(() => {
package_default = {
name: "oh-my-opencode",
- version: "5.1.42",
+ version: "5.1.43",
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
main: "./dist/index.js",
types: "dist/index.d.ts",
@@ -2371,18 +2371,18 @@ var init_package = __esm(() => {
typescript: "^7.0.2"
},
optionalDependencies: {
- "oh-my-opencode-darwin-arm64": "5.1.42",
- "oh-my-opencode-darwin-x64": "5.1.42",
- "oh-my-opencode-darwin-x64-baseline": "5.1.42",
- "oh-my-opencode-linux-arm64": "5.1.42",
- "oh-my-opencode-linux-arm64-musl": "5.1.42",
- "oh-my-opencode-linux-x64": "5.1.42",
- "oh-my-opencode-linux-x64-baseline": "5.1.42",
- "oh-my-opencode-linux-x64-musl": "5.1.42",
- "oh-my-opencode-linux-x64-musl-baseline": "5.1.42",
- "oh-my-opencode-windows-arm64": "5.1.42",
- "oh-my-opencode-windows-x64": "5.1.42",
- "oh-my-opencode-windows-x64-baseline": "5.1.42"
+ "oh-my-opencode-darwin-arm64": "5.1.43",
+ "oh-my-opencode-darwin-x64": "5.1.43",
+ "oh-my-opencode-darwin-x64-baseline": "5.1.43",
+ "oh-my-opencode-linux-arm64": "5.1.43",
+ "oh-my-opencode-linux-arm64-musl": "5.1.43",
+ "oh-my-opencode-linux-x64": "5.1.43",
+ "oh-my-opencode-linux-x64-baseline": "5.1.43",
+ "oh-my-opencode-linux-x64-musl": "5.1.43",
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.43",
+ "oh-my-opencode-windows-arm64": "5.1.43",
+ "oh-my-opencode-windows-x64": "5.1.43",
+ "oh-my-opencode-windows-x64-baseline": "5.1.43"
},
overrides: {
hono: "^4.13.8",
@@ -82527,6 +82527,8 @@ function toDiagnosticRecord(input, now) {
timestamp: now.toISOString(),
event: input.event,
source: input.source,
+ ...input.entryKind === undefined ? {} : { entry_kind: input.entryKind },
+ ...input.errorCode === undefined ? {} : { error_code: input.errorCode },
...input.count === undefined ? {} : { count: input.count },
...serializeError(input.error, input.errorKind)
};
@@ -92280,7 +92282,7 @@ var package_default2;
var init_package2 = __esm(() => {
package_default2 = {
name: "@oh-my-opencode/omo-codex",
- version: "5.1.42",
+ version: "5.1.43",
type: "module",
private: true,
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -111647,24 +111649,98 @@ async function loginDevice(session, options) {
// packages/omo-opencode/src/cli/service-auth/keystore.ts
import { createHash as createHash9 } from "node:crypto";
+
+// packages/omo-opencode/src/cli/service-auth/secret-service-lock.ts
+import { spawn as spawn5 } from "node:child_process";
+var DEFAULT_COLLECTION = "/org/freedesktop/secrets/aliases/default";
+var PROBE_TIMEOUT_MS2 = 1e4;
+var parseLockedReply = (stdout) => {
+ const match = /<\s*(true|false)\s*>/.exec(stdout);
+ if (match === null)
+ return null;
+ return match[1] === "true" ? "locked" : "unlocked";
+};
+var probeSecretServiceLock = () => new Promise((resolve) => {
+ const child = spawn5("gdbus", [
+ "call",
+ "--session",
+ "--dest",
+ "org.freedesktop.secrets",
+ "--object-path",
+ DEFAULT_COLLECTION,
+ "--method",
+ "org.freedesktop.DBus.Properties.Get",
+ "org.freedesktop.Secret.Collection",
+ "Locked"
+ ], { stdio: ["ignore", "pipe", "ignore"] });
+ let stdout = "";
+ const timer = setTimeout(() => {
+ child.kill();
+ resolve("unknown");
+ }, PROBE_TIMEOUT_MS2);
+ child.stdout.on("data", (chunk) => {
+ stdout += chunk.toString();
+ });
+ child.on("error", () => {
+ clearTimeout(timer);
+ resolve("unknown");
+ });
+ child.on("close", (code) => {
+ clearTimeout(timer);
+ resolve(code === 0 ? parseLockedReply(stdout) ?? "absent" : "absent");
+ });
+});
+
+// packages/omo-opencode/src/cli/service-auth/keystore.ts
+class KeychainLockedError extends SignInError {
+}
+var LOCKED = /-25308|errSecInteractionNotAllowed|interaction is not allowed|locked collection/i;
+var UNLOCKED_REUSE_MS = 30000;
+var fallbackNoticed = false;
+var stderrNoticeOncePerProcess = (message) => {
+ if (fallbackNoticed)
+ return;
+ fallbackNoticed = true;
+ process.stderr.write(`${message}
+`);
+};
+var isLocked = (error) => error instanceof Error && (LOCKED.test(error.message) || LOCKED.test(String(error.code ?? "")));
function credentialId(api) {
return createHash9("sha256").update(serviceOrigin(api)).digest("hex");
}
-function createCredentialStore(api, secrets = typeof Bun === "undefined" ? null : Bun.secrets, platform = process.platform) {
+function createCredentialStore(api, secrets = typeof Bun === "undefined" ? null : Bun.secrets, platform = process.platform, lockProbe = probeSecretServiceLock, notice = stderrNoticeOncePerProcess) {
if (!secrets)
throw new SignInError("OmO sign-in needs Bun 1.4 or newer with OS credential storage. No file fallback is available.");
const platformName = platform === "darwin" ? "macOS Keychain" : platform === "linux" ? "Linux Secret Service (libsecret and an unlocked keyring)" : platform === "win32" ? "Windows Credential Manager" : null;
if (platformName === null)
throw new SignInError("This platform has no supported OS credential store.");
const key = { service: "omo-cli", name: credentialId(api) };
- const unavailable = () => new SignInError(`Cannot access ${platformName}. Unlock or enable the OS credential store and try again. Credentials are never saved to a file.`);
+ const unavailable = (error) => isLocked(error) ? new KeychainLockedError(`${platformName} is locked. Unlock it, then try again. Credentials are never saved to a file.`) : new SignInError(`Cannot access ${platformName}. Unlock or enable the OS credential store and try again. Credentials are never saved to a file.`);
+ let unlockedUntil = 0;
+ let noticed = false;
+ const assertUsable = async () => {
+ if (platform !== "linux" || Date.now() < unlockedUntil)
+ return;
+ const lock = await lockProbe();
+ if (lock === "locked")
+ throw new KeychainLockedError(`${platformName} is locked. Unlock it, then try again. Credentials are never saved to a file.`);
+ if (lock === "unlocked") {
+ unlockedUntil = Date.now() + UNLOCKED_REUSE_MS;
+ return;
+ }
+ if (!noticed) {
+ noticed = true;
+ notice("omo: could not check whether the keyring is locked (gdbus or the Secret Service did not answer); using libsecret directly.");
+ }
+ };
return {
async read() {
+ await assertUsable();
let value;
try {
value = await secrets.get(key);
- } catch {
- throw unavailable();
+ } catch (error) {
+ throw unavailable(error);
}
if (value === null)
return null;
@@ -111675,17 +111751,19 @@ function createCredentialStore(api, secrets = typeof Bun === "undefined" ? null
}
},
async write(value) {
+ await assertUsable();
try {
await secrets.set({ ...key, value: JSON.stringify(credentialSchema.parse(value)) });
- } catch {
- throw unavailable();
+ } catch (error) {
+ throw unavailable(error);
}
},
async clear() {
+ await assertUsable();
try {
await secrets.delete(key);
- } catch {
- throw unavailable();
+ } catch (error) {
+ throw unavailable(error);
}
}
};
@@ -112029,9 +112107,11 @@ async function reapStaleLock(lockPath, staleAfterMs = DEFAULT_STALE_AFTER_MS, de
// packages/omo-opencode/src/cli/service-auth/session.ts
class SessionEnded extends SignInError {
deviceRevoked;
- constructor(message, deviceRevoked) {
+ code;
+ constructor(message, deviceRevoked, code) {
super(message);
this.deviceRevoked = deviceRevoked;
+ this.code = code;
}
}
var DEVICE_REVOKING_REFUSALS = new Set(["account_deleted", "reauth_required"]);
@@ -112063,7 +112143,7 @@ function createSession(options) {
} catch (error) {
if (error instanceof ApiRefusal && error.status < 500 && ["unauthorized", "account_deleted", "reauth_required", "invalid_grant"].includes(error.code)) {
await store.clear();
- throw new SessionEnded(error.code === "reauth_required" ? "This session was ended because its refresh token was reused. Sign in again with omo login." : "Sign in again with omo login.", DEVICE_REVOKING_REFUSALS.has(error.code));
+ throw new SessionEnded(error.code === "reauth_required" ? "This session was ended because its refresh token was reused. Sign in again with omo login." : "Sign in again with omo login.", DEVICE_REVOKING_REFUSALS.has(error.code), error.code);
}
if (error instanceof RequestFailure && error.notSent || error instanceof ApiRefusal && error.status === 429 && error.code === "rate_limited") {
await store.write(current);
@@ -112081,6 +112161,9 @@ function createSession(options) {
async save(value) {
await locked(() => store.write(value));
},
+ async update(action) {
+ return locked(async () => action(await store.read()));
+ },
async logout() {
return locked(async () => {
try {
@@ -112444,7 +112527,7 @@ async function boulder(options) {
return 0;
}
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
-import { spawn as spawn5 } from "node:child_process";
+import { spawn as spawn6 } from "node:child_process";
import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync11 } from "node:fs";
import { homedir as homedir29 } from "node:os";
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
@@ -112474,7 +112557,7 @@ async function codexUlwLoop(args) {
return 1;
}
const { promise, resolve } = Promise.withResolvers();
- const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
+ const child = spawn6(command.executable, [...command.argsPrefix, ...args], {
stdio: "inherit",
env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
});
diff --git a/plugins/omo/dist/cli/index.js b/plugins/omo/dist/cli/index.js
index 2147acc0..4839cc09 100755
--- a/plugins/omo/dist/cli/index.js
+++ b/plugins/omo/dist/cli/index.js
@@ -2132,7 +2132,7 @@ var package_default;
var init_package = __esm(() => {
package_default = {
name: "oh-my-opencode",
- version: "5.1.42",
+ version: "5.1.43",
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
main: "./dist/index.js",
types: "dist/index.d.ts",
@@ -2370,18 +2370,18 @@ var init_package = __esm(() => {
typescript: "^7.0.2"
},
optionalDependencies: {
- "oh-my-opencode-darwin-arm64": "5.1.42",
- "oh-my-opencode-darwin-x64": "5.1.42",
- "oh-my-opencode-darwin-x64-baseline": "5.1.42",
- "oh-my-opencode-linux-arm64": "5.1.42",
- "oh-my-opencode-linux-arm64-musl": "5.1.42",
- "oh-my-opencode-linux-x64": "5.1.42",
- "oh-my-opencode-linux-x64-baseline": "5.1.42",
- "oh-my-opencode-linux-x64-musl": "5.1.42",
- "oh-my-opencode-linux-x64-musl-baseline": "5.1.42",
- "oh-my-opencode-windows-arm64": "5.1.42",
- "oh-my-opencode-windows-x64": "5.1.42",
- "oh-my-opencode-windows-x64-baseline": "5.1.42"
+ "oh-my-opencode-darwin-arm64": "5.1.43",
+ "oh-my-opencode-darwin-x64": "5.1.43",
+ "oh-my-opencode-darwin-x64-baseline": "5.1.43",
+ "oh-my-opencode-linux-arm64": "5.1.43",
+ "oh-my-opencode-linux-arm64-musl": "5.1.43",
+ "oh-my-opencode-linux-x64": "5.1.43",
+ "oh-my-opencode-linux-x64-baseline": "5.1.43",
+ "oh-my-opencode-linux-x64-musl": "5.1.43",
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.43",
+ "oh-my-opencode-windows-arm64": "5.1.43",
+ "oh-my-opencode-windows-x64": "5.1.43",
+ "oh-my-opencode-windows-x64-baseline": "5.1.43"
},
overrides: {
hono: "^4.13.8",
@@ -82448,6 +82448,8 @@ function toDiagnosticRecord(input, now) {
timestamp: now.toISOString(),
event: input.event,
source: input.source,
+ ...input.entryKind === undefined ? {} : { entry_kind: input.entryKind },
+ ...input.errorCode === undefined ? {} : { error_code: input.errorCode },
...input.count === undefined ? {} : { count: input.count },
...serializeError(input.error, input.errorKind)
};
@@ -92201,7 +92203,7 @@ var package_default2;
var init_package2 = __esm(() => {
package_default2 = {
name: "@oh-my-opencode/omo-codex",
- version: "5.1.42",
+ version: "5.1.43",
type: "module",
private: true,
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -111568,24 +111570,98 @@ async function loginDevice(session, options) {
// packages/omo-opencode/src/cli/service-auth/keystore.ts
import { createHash as createHash9 } from "crypto";
+
+// packages/omo-opencode/src/cli/service-auth/secret-service-lock.ts
+import { spawn as spawn5 } from "child_process";
+var DEFAULT_COLLECTION = "/org/freedesktop/secrets/aliases/default";
+var PROBE_TIMEOUT_MS2 = 1e4;
+var parseLockedReply = (stdout) => {
+ const match = /<\s*(true|false)\s*>/.exec(stdout);
+ if (match === null)
+ return null;
+ return match[1] === "true" ? "locked" : "unlocked";
+};
+var probeSecretServiceLock = () => new Promise((resolve) => {
+ const child = spawn5("gdbus", [
+ "call",
+ "--session",
+ "--dest",
+ "org.freedesktop.secrets",
+ "--object-path",
+ DEFAULT_COLLECTION,
+ "--method",
+ "org.freedesktop.DBus.Properties.Get",
+ "org.freedesktop.Secret.Collection",
+ "Locked"
+ ], { stdio: ["ignore", "pipe", "ignore"] });
+ let stdout = "";
+ const timer = setTimeout(() => {
+ child.kill();
+ resolve("unknown");
+ }, PROBE_TIMEOUT_MS2);
+ child.stdout.on("data", (chunk) => {
+ stdout += chunk.toString();
+ });
+ child.on("error", () => {
+ clearTimeout(timer);
+ resolve("unknown");
+ });
+ child.on("close", (code) => {
+ clearTimeout(timer);
+ resolve(code === 0 ? parseLockedReply(stdout) ?? "absent" : "absent");
+ });
+});
+
+// packages/omo-opencode/src/cli/service-auth/keystore.ts
+class KeychainLockedError extends SignInError {
+}
+var LOCKED = /-25308|errSecInteractionNotAllowed|interaction is not allowed|locked collection/i;
+var UNLOCKED_REUSE_MS = 30000;
+var fallbackNoticed = false;
+var stderrNoticeOncePerProcess = (message) => {
+ if (fallbackNoticed)
+ return;
+ fallbackNoticed = true;
+ process.stderr.write(`${message}
+`);
+};
+var isLocked = (error) => error instanceof Error && (LOCKED.test(error.message) || LOCKED.test(String(error.code ?? "")));
function credentialId(api) {
return createHash9("sha256").update(serviceOrigin(api)).digest("hex");
}
-function createCredentialStore(api, secrets = typeof Bun === "undefined" ? null : Bun.secrets, platform = process.platform) {
+function createCredentialStore(api, secrets = typeof Bun === "undefined" ? null : Bun.secrets, platform = process.platform, lockProbe = probeSecretServiceLock, notice = stderrNoticeOncePerProcess) {
if (!secrets)
throw new SignInError("OmO sign-in needs Bun 1.4 or newer with OS credential storage. No file fallback is available.");
const platformName = platform === "darwin" ? "macOS Keychain" : platform === "linux" ? "Linux Secret Service (libsecret and an unlocked keyring)" : platform === "win32" ? "Windows Credential Manager" : null;
if (platformName === null)
throw new SignInError("This platform has no supported OS credential store.");
const key = { service: "omo-cli", name: credentialId(api) };
- const unavailable = () => new SignInError(`Cannot access ${platformName}. Unlock or enable the OS credential store and try again. Credentials are never saved to a file.`);
+ const unavailable = (error) => isLocked(error) ? new KeychainLockedError(`${platformName} is locked. Unlock it, then try again. Credentials are never saved to a file.`) : new SignInError(`Cannot access ${platformName}. Unlock or enable the OS credential store and try again. Credentials are never saved to a file.`);
+ let unlockedUntil = 0;
+ let noticed = false;
+ const assertUsable = async () => {
+ if (platform !== "linux" || Date.now() < unlockedUntil)
+ return;
+ const lock = await lockProbe();
+ if (lock === "locked")
+ throw new KeychainLockedError(`${platformName} is locked. Unlock it, then try again. Credentials are never saved to a file.`);
+ if (lock === "unlocked") {
+ unlockedUntil = Date.now() + UNLOCKED_REUSE_MS;
+ return;
+ }
+ if (!noticed) {
+ noticed = true;
+ notice("omo: could not check whether the keyring is locked (gdbus or the Secret Service did not answer); using libsecret directly.");
+ }
+ };
return {
async read() {
+ await assertUsable();
let value;
try {
value = await secrets.get(key);
- } catch {
- throw unavailable();
+ } catch (error) {
+ throw unavailable(error);
}
if (value === null)
return null;
@@ -111596,17 +111672,19 @@ function createCredentialStore(api, secrets = typeof Bun === "undefined" ? null
}
},
async write(value) {
+ await assertUsable();
try {
await secrets.set({ ...key, value: JSON.stringify(credentialSchema.parse(value)) });
- } catch {
- throw unavailable();
+ } catch (error) {
+ throw unavailable(error);
}
},
async clear() {
+ await assertUsable();
try {
await secrets.delete(key);
- } catch {
- throw unavailable();
+ } catch (error) {
+ throw unavailable(error);
}
}
};
@@ -111950,9 +112028,11 @@ async function reapStaleLock(lockPath, staleAfterMs = DEFAULT_STALE_AFTER_MS, de
// packages/omo-opencode/src/cli/service-auth/session.ts
class SessionEnded extends SignInError {
deviceRevoked;
- constructor(message, deviceRevoked) {
+ code;
+ constructor(message, deviceRevoked, code) {
super(message);
this.deviceRevoked = deviceRevoked;
+ this.code = code;
}
}
var DEVICE_REVOKING_REFUSALS = new Set(["account_deleted", "reauth_required"]);
@@ -111984,7 +112064,7 @@ function createSession(options) {
} catch (error) {
if (error instanceof ApiRefusal && error.status < 500 && ["unauthorized", "account_deleted", "reauth_required", "invalid_grant"].includes(error.code)) {
await store.clear();
- throw new SessionEnded(error.code === "reauth_required" ? "This session was ended because its refresh token was reused. Sign in again with omo login." : "Sign in again with omo login.", DEVICE_REVOKING_REFUSALS.has(error.code));
+ throw new SessionEnded(error.code === "reauth_required" ? "This session was ended because its refresh token was reused. Sign in again with omo login." : "Sign in again with omo login.", DEVICE_REVOKING_REFUSALS.has(error.code), error.code);
}
if (error instanceof RequestFailure && error.notSent || error instanceof ApiRefusal && error.status === 429 && error.code === "rate_limited") {
await store.write(current);
@@ -112002,6 +112082,9 @@ function createSession(options) {
async save(value) {
await locked(() => store.write(value));
},
+ async update(action) {
+ return locked(async () => action(await store.read()));
+ },
async logout() {
return locked(async () => {
try {
@@ -112365,7 +112448,7 @@ async function boulder(options) {
return 0;
}
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
-import { spawn as spawn5 } from "child_process";
+import { spawn as spawn6 } from "child_process";
import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync11 } from "fs";
import { homedir as homedir29 } from "os";
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
@@ -112395,7 +112478,7 @@ async function codexUlwLoop(args) {
return 1;
}
const { promise, resolve } = Promise.withResolvers();
- const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
+ const child = spawn6(command.executable, [...command.argsPrefix, ...args], {
stdio: "inherit",
env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
});
diff --git a/plugins/omo/hooks/post-compact-resetting-git-bash-mcp-reminder.json b/plugins/omo/hooks/post-compact-resetting-git-bash-mcp-reminder.json
index 3afcbc27..87760a24 100644
--- a/plugins/omo/hooks/post-compact-resetting-git-bash-mcp-reminder.json
+++ b/plugins/omo/hooks/post-compact-resetting-git-bash-mcp-reminder.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/git-bash/dist/cli.js\" hook post-compact",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Resetting Git Bash MCP Reminder",
+ "statusMessage": "(OmO 5.1.43) Resetting Git Bash MCP Reminder",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\git-bash\\dist\\cli.js\" hook post-compact"
}
],
diff --git a/plugins/omo/hooks/post-compact-resetting-lsp-diagnostics-cache.json b/plugins/omo/hooks/post-compact-resetting-lsp-diagnostics-cache.json
index fb74ae84..2ff90778 100644
--- a/plugins/omo/hooks/post-compact-resetting-lsp-diagnostics-cache.json
+++ b/plugins/omo/hooks/post-compact-resetting-lsp-diagnostics-cache.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/lsp/dist/cli.js\" hook post-compact",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Resetting LSP Diagnostics Cache",
+ "statusMessage": "(OmO 5.1.43) Resetting LSP Diagnostics Cache",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\lsp\\dist\\cli.js\" hook post-compact"
}
],
diff --git a/plugins/omo/hooks/post-compact-resetting-project-rule-cache.json b/plugins/omo/hooks/post-compact-resetting-project-rule-cache.json
index a0905a11..37192468 100644
--- a/plugins/omo/hooks/post-compact-resetting-project-rule-cache.json
+++ b/plugins/omo/hooks/post-compact-resetting-project-rule-cache.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook post-compact",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Resetting Project Rule Cache",
+ "statusMessage": "(OmO 5.1.43) Resetting Project Rule Cache",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\rules\\dist\\cli.js\" hook post-compact"
}
],
diff --git a/plugins/omo/hooks/post-tool-use-checking-comments.json b/plugins/omo/hooks/post-tool-use-checking-comments.json
index 9080d1c5..dc7653d9 100644
--- a/plugins/omo/hooks/post-tool-use-checking-comments.json
+++ b/plugins/omo/hooks/post-tool-use-checking-comments.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/comment-checker/dist/cli.js\" hook post-tool-use",
"timeout": 30,
- "statusMessage": "(OmO 5.1.42) Checking Comments",
+ "statusMessage": "(OmO 5.1.43) Checking Comments",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\comment-checker\\dist\\cli.js\" hook post-tool-use"
}
],
diff --git a/plugins/omo/hooks/post-tool-use-checking-lsp-diagnostics.json b/plugins/omo/hooks/post-tool-use-checking-lsp-diagnostics.json
index 3d46eaa4..659d3606 100644
--- a/plugins/omo/hooks/post-tool-use-checking-lsp-diagnostics.json
+++ b/plugins/omo/hooks/post-tool-use-checking-lsp-diagnostics.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/lsp/dist/cli.js\" hook post-tool-use",
"timeout": 60,
- "statusMessage": "(OmO 5.1.42) Checking LSP Diagnostics",
+ "statusMessage": "(OmO 5.1.43) Checking LSP Diagnostics",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\lsp\\dist\\cli.js\" hook post-tool-use"
}
],
diff --git a/plugins/omo/hooks/post-tool-use-checking-thread-title-hygiene.json b/plugins/omo/hooks/post-tool-use-checking-thread-title-hygiene.json
index 46e92e6a..25141a85 100644
--- a/plugins/omo/hooks/post-tool-use-checking-thread-title-hygiene.json
+++ b/plugins/omo/hooks/post-tool-use-checking-thread-title-hygiene.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/teammode/dist/cli.js\" hook post-tool-use",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Checking Thread Title Hygiene",
+ "statusMessage": "(OmO 5.1.43) Checking Thread Title Hygiene",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\teammode\\dist\\cli.js\" hook post-tool-use"
}
]
diff --git a/plugins/omo/hooks/post-tool-use-matching-project-rules.json b/plugins/omo/hooks/post-tool-use-matching-project-rules.json
index 062494f6..4a2d5929 100644
--- a/plugins/omo/hooks/post-tool-use-matching-project-rules.json
+++ b/plugins/omo/hooks/post-tool-use-matching-project-rules.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook post-tool-use",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Matching Project Rules",
+ "statusMessage": "(OmO 5.1.43) Matching Project Rules",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\rules\\dist\\cli.js\" hook post-tool-use"
}
],
diff --git a/plugins/omo/hooks/post-tool-use-recording-spawn-admission.json b/plugins/omo/hooks/post-tool-use-recording-spawn-admission.json
index d40ab64d..4926733a 100644
--- a/plugins/omo/hooks/post-tool-use-recording-spawn-admission.json
+++ b/plugins/omo/hooks/post-tool-use-recording-spawn-admission.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ulw-loop/dist/cli.js\" hook post-tool-use-spawn",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Recording Spawn Admission",
+ "statusMessage": "(OmO 5.1.43) Recording Spawn Admission",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\ulw-loop\\dist\\cli.js\" hook post-tool-use-spawn"
}
]
diff --git a/plugins/omo/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json b/plugins/omo/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json
index 90e12fa8..f494f2ee 100644
--- a/plugins/omo/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json
+++ b/plugins/omo/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ulw-loop/dist/cli.js\" hook pre-tool-use",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Enforcing Unlimited Goal Budget",
+ "statusMessage": "(OmO 5.1.43) Enforcing Unlimited Goal Budget",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\ulw-loop\\dist\\cli.js\" hook pre-tool-use"
}
],
diff --git a/plugins/omo/hooks/pre-tool-use-guarding-ulw-loop-spawns.json b/plugins/omo/hooks/pre-tool-use-guarding-ulw-loop-spawns.json
index 35e947c0..a84a8493 100644
--- a/plugins/omo/hooks/pre-tool-use-guarding-ulw-loop-spawns.json
+++ b/plugins/omo/hooks/pre-tool-use-guarding-ulw-loop-spawns.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ulw-loop/dist/cli.js\" hook pre-tool-use-spawn",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Guarding Ulw-Loop Spawns",
+ "statusMessage": "(OmO 5.1.43) Guarding Ulw-Loop Spawns",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\ulw-loop\\dist\\cli.js\" hook pre-tool-use-spawn"
}
]
diff --git a/plugins/omo/hooks/pre-tool-use-recommending-git-bash-mcp.json b/plugins/omo/hooks/pre-tool-use-recommending-git-bash-mcp.json
index 93b3097b..6fd6817a 100644
--- a/plugins/omo/hooks/pre-tool-use-recommending-git-bash-mcp.json
+++ b/plugins/omo/hooks/pre-tool-use-recommending-git-bash-mcp.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/git-bash/dist/cli.js\" hook pre-tool-use",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Recommending Git Bash MCP",
+ "statusMessage": "(OmO 5.1.43) Recommending Git Bash MCP",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\git-bash\\dist\\cli.js\" hook pre-tool-use"
}
],
diff --git a/plugins/omo/hooks/session-start-checking-auto-update.json b/plugins/omo/hooks/session-start-checking-auto-update.json
index ec8a4f0a..79646f79 100644
--- a/plugins/omo/hooks/session-start-checking-auto-update.json
+++ b/plugins/omo/hooks/session-start-checking-auto-update.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/scripts/auto-update.mjs\" hook session-start",
"timeout": 15,
- "statusMessage": "(OmO 5.1.42) Checking Auto Update",
+ "statusMessage": "(OmO 5.1.43) Checking Auto Update",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\scripts\\auto-update.mjs\" hook session-start"
}
],
diff --git a/plugins/omo/hooks/session-start-checking-bootstrap-provisioning.json b/plugins/omo/hooks/session-start-checking-bootstrap-provisioning.json
index 1c04d51b..7d6c28d8 100644
--- a/plugins/omo/hooks/session-start-checking-bootstrap-provisioning.json
+++ b/plugins/omo/hooks/session-start-checking-bootstrap-provisioning.json
@@ -8,7 +8,7 @@
"command": "node \"${PLUGIN_ROOT}/components/bootstrap/dist/cli.js\" hook session-start",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\bootstrap.ps1\"",
"timeout": 30,
- "statusMessage": "(OmO 5.1.42) Checking Bootstrap Provisioning"
+ "statusMessage": "(OmO 5.1.43) Checking Bootstrap Provisioning"
}
]
}
diff --git a/plugins/omo/hooks/session-start-loading-project-rules.json b/plugins/omo/hooks/session-start-loading-project-rules.json
index 631e4c39..09414e8c 100644
--- a/plugins/omo/hooks/session-start-loading-project-rules.json
+++ b/plugins/omo/hooks/session-start-loading-project-rules.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook session-start",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Loading Project Rules",
+ "statusMessage": "(OmO 5.1.43) Loading Project Rules",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\rules\\dist\\cli.js\" hook session-start"
}
]
diff --git a/plugins/omo/hooks/session-start-recording-session-telemetry.json b/plugins/omo/hooks/session-start-recording-session-telemetry.json
index 80d9be91..52ded93f 100644
--- a/plugins/omo/hooks/session-start-recording-session-telemetry.json
+++ b/plugins/omo/hooks/session-start-recording-session-telemetry.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/telemetry/dist/cli.js\" hook session-start",
"timeout": 15,
- "statusMessage": "(OmO 5.1.42) Recording Session Telemetry",
+ "statusMessage": "(OmO 5.1.43) Recording Session Telemetry",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\telemetry\\dist\\cli.js\" hook session-start"
}
]
diff --git a/plugins/omo/hooks/stop-checking-ulw-execute-continuation.json b/plugins/omo/hooks/stop-checking-ulw-execute-continuation.json
index c0fca5d7..8bc85e07 100644
--- a/plugins/omo/hooks/stop-checking-ulw-execute-continuation.json
+++ b/plugins/omo/hooks/stop-checking-ulw-execute-continuation.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ulw-execute-continuation/dist/cli.js\" hook stop",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Checking Ulw-Execute Continuation",
+ "statusMessage": "(OmO 5.1.43) Checking Ulw-Execute Continuation",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\ulw-execute-continuation\\dist\\cli.js\" hook stop"
}
]
diff --git a/plugins/omo/hooks/stop-checking-ulw-loop-resume.json b/plugins/omo/hooks/stop-checking-ulw-loop-resume.json
index 2bf59cc4..8b82af2f 100644
--- a/plugins/omo/hooks/stop-checking-ulw-loop-resume.json
+++ b/plugins/omo/hooks/stop-checking-ulw-loop-resume.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ulw-loop/dist/cli.js\" hook stop",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Checking Ulw-Loop Resume",
+ "statusMessage": "(OmO 5.1.43) Checking Ulw-Loop Resume",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\ulw-loop\\dist\\cli.js\" hook stop"
}
]
diff --git a/plugins/omo/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json b/plugins/omo/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json
index 40878959..6586aa24 100644
--- a/plugins/omo/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json
+++ b/plugins/omo/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/lazycodex-executor-verify/dist/cli.js\" hook subagent-stop",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Verifying LazyCodex Executor Evidence",
+ "statusMessage": "(OmO 5.1.43) Verifying LazyCodex Executor Evidence",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\lazycodex-executor-verify\\dist\\cli.js\" hook subagent-stop"
}
],
diff --git a/plugins/omo/hooks/user-prompt-submit-checking-ultrawork-trigger.json b/plugins/omo/hooks/user-prompt-submit-checking-ultrawork-trigger.json
index 4881b495..2ec6c519 100644
--- a/plugins/omo/hooks/user-prompt-submit-checking-ultrawork-trigger.json
+++ b/plugins/omo/hooks/user-prompt-submit-checking-ultrawork-trigger.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ultrawork/dist/cli.js\" hook user-prompt-submit",
"timeout": 5,
- "statusMessage": "(OmO 5.1.42) Checking Ultrawork Trigger",
+ "statusMessage": "(OmO 5.1.43) Checking Ultrawork Trigger",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\ultrawork\\dist\\cli.js\" hook user-prompt-submit"
}
]
diff --git a/plugins/omo/hooks/user-prompt-submit-checking-ulw-loop-steering.json b/plugins/omo/hooks/user-prompt-submit-checking-ulw-loop-steering.json
index 1c11e7a6..447f3532 100644
--- a/plugins/omo/hooks/user-prompt-submit-checking-ulw-loop-steering.json
+++ b/plugins/omo/hooks/user-prompt-submit-checking-ulw-loop-steering.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ulw-loop/dist/cli.js\" hook user-prompt-submit",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Checking Ulw-Loop Steering",
+ "statusMessage": "(OmO 5.1.43) Checking Ulw-Loop Steering",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\ulw-loop\\dist\\cli.js\" hook user-prompt-submit"
}
]
diff --git a/plugins/omo/hooks/user-prompt-submit-loading-project-rules.json b/plugins/omo/hooks/user-prompt-submit-loading-project-rules.json
index eea79f29..8be5c687 100644
--- a/plugins/omo/hooks/user-prompt-submit-loading-project-rules.json
+++ b/plugins/omo/hooks/user-prompt-submit-loading-project-rules.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook user-prompt-submit",
"timeout": 10,
- "statusMessage": "(OmO 5.1.42) Loading Project Rules",
+ "statusMessage": "(OmO 5.1.43) Loading Project Rules",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\rules\\dist\\cli.js\" hook user-prompt-submit"
}
]
diff --git a/plugins/omo/package-lock.json b/plugins/omo/package-lock.json
index 435f1164..d4524c36 100644
--- a/plugins/omo/package-lock.json
+++ b/plugins/omo/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@sisyphuslabs/omo-codex-plugin",
- "version": "5.1.42",
+ "version": "5.1.43",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@sisyphuslabs/omo-codex-plugin",
- "version": "5.1.42",
+ "version": "5.1.43",
"workspaces": [
"components/comment-checker",
"components/git-bash",
@@ -89,13 +89,18 @@
"version": "0.1.0",
"dev": true,
"dependencies": {
+ "@bufbuild/protobuf": "2.16.0",
"@oh-my-opencode/utils": "workspace:*",
+ "@opentelemetry/api": "1.9.1",
+ "@opentelemetry/api-logs": "0.223.0",
+ "@opentelemetry/context-async-hooks": "2.12.0",
+ "@opentelemetry/core": "2.12.0",
"posthog-node": "^5.52.4"
}
},
"components/comment-checker": {
"name": "@code-yeongyu/codex-comment-checker",
- "version": "5.1.42",
+ "version": "5.1.43",
"license": "MIT",
"bin": {
"omo-comment-checker": "dist/cli.js"
@@ -117,7 +122,7 @@
},
"components/git-bash": {
"name": "@sisyphuslabs/codex-git-bash-hook",
- "version": "5.1.42",
+ "version": "5.1.43",
"bin": {
"omo-git-bash-hook": "dist/cli.js"
},
@@ -131,7 +136,7 @@
},
"components/lazycodex-executor-verify": {
"name": "@code-yeongyu/codex-lazycodex-executor-verify",
- "version": "5.1.42",
+ "version": "5.1.43",
"license": "MIT",
"bin": {
"lazycodex-executor-verify": "dist/cli.js"
@@ -149,7 +154,7 @@
},
"components/lsp": {
"name": "@code-yeongyu/codex-lsp",
- "version": "5.1.42",
+ "version": "5.1.43",
"license": "MIT",
"dependencies": {
"@code-yeongyu/lsp-daemon": "file:../../../../lsp-daemon",
@@ -171,7 +176,7 @@
},
"components/rules": {
"name": "@code-yeongyu/codex-rules",
- "version": "5.1.42",
+ "version": "5.1.43",
"license": "MIT",
"dependencies": {
"picomatch": "^4.0.7"
@@ -194,7 +199,7 @@
},
"components/teammode": {
"name": "@sisyphuslabs/codex-teammode",
- "version": "5.1.42",
+ "version": "5.1.43",
"devDependencies": {
"@types/node": "^26.6.2",
"@vitest/coverage-v8": "5.0.1",
@@ -208,7 +213,7 @@
},
"components/telemetry": {
"name": "@code-yeongyu/codex-telemetry",
- "version": "5.1.42",
+ "version": "5.1.43",
"license": "MIT",
"bin": {
"omo-telemetry": "dist/cli.js"
@@ -227,7 +232,7 @@
},
"components/ultrawork": {
"name": "@code-yeongyu/codex-ultrawork",
- "version": "5.1.42",
+ "version": "5.1.43",
"license": "MIT",
"bin": {
"omo-ultrawork": "dist/cli.js"
@@ -246,7 +251,7 @@
},
"components/ulw-execute-continuation": {
"name": "@code-yeongyu/codex-ulw-execute-continuation",
- "version": "5.1.42",
+ "version": "5.1.43",
"license": "MIT",
"bin": {
"omo-ulw-execute-continuation": "dist/cli.js"
@@ -264,7 +269,7 @@
},
"components/ulw-loop": {
"name": "@code-yeongyu/codex-ulw-loop",
- "version": "5.1.42",
+ "version": "5.1.43",
"license": "MIT",
"bin": {
"omo-ulw-loop": "dist/cli.js",
diff --git a/plugins/omo/package.json b/plugins/omo/package.json
index e685f182..ca4ef8ac 100644
--- a/plugins/omo/package.json
+++ b/plugins/omo/package.json
@@ -1,6 +1,6 @@
{
"name": "@sisyphuslabs/omo-codex-plugin",
- "version": "5.1.42",
+ "version": "5.1.43",
"description": "Aggregate Codex plugin root for OMO components.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/skills/browser/runtime/omowright/manifest.json b/plugins/omo/skills/browser/runtime/omowright/manifest.json
index 07969062..b0f6f6e2 100644
--- a/plugins/omo/skills/browser/runtime/omowright/manifest.json
+++ b/plugins/omo/skills/browser/runtime/omowright/manifest.json
@@ -5,5 +5,5 @@
"index.js": "d67d3a847fe0bbc43e824feded48b280890d31879538309e671cd5f671133995",
"page-bundle.js": "bfd51e8383cf47200d57387bbbed258bce5a3a3d00c38fc108034d2888e23f0c"
},
- "stagedAtUtc": "2026-10-22T17:54:40.191Z"
+ "stagedAtUtc": "2026-10-22T23:39:44.377Z"
}