oh-my-opencode 4.19.0 → 4.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/command/omomomo.md +1 -1
- package/.agents/skills/omomomo/SKILL.md +1 -1
- package/.opencode/command/omomomo.md +1 -1
- package/README.ja.md +6 -6
- package/README.ko.md +6 -6
- package/README.md +6 -6
- package/README.ru.md +6 -6
- package/README.zh-cn.md +6 -6
- package/dist/agents/atlas/agent.d.ts +1 -1
- package/dist/agents/gpt-prompt-identity.d.ts +3 -0
- package/dist/agents/sisyphus/gpt-5-5.d.ts +1 -1
- package/dist/agents/sisyphus/gpt-task-system-guide.d.ts +1 -0
- package/dist/agents/sisyphus-junior/gpt-5-5.d.ts +2 -2
- package/dist/cli/index.js +148 -94
- package/dist/cli-node/index.js +148 -94
- package/dist/config/schema/agent-overrides.d.ts +48 -48
- package/dist/config/schema/categories.d.ts +6 -6
- package/dist/config/schema/codegraph.d.ts +2 -0
- package/dist/config/schema/fallback-models.d.ts +5 -5
- package/dist/config/schema/oh-my-opencode-config.d.ts +50 -48
- package/dist/hooks/codegraph-bootstrap/hook.d.ts +3 -2
- package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +1 -1
- package/dist/hooks/start-work/notepad-scaffold.d.ts +10 -0
- package/dist/index.js +2612 -1473
- package/dist/oh-my-opencode.schema.json +11 -0
- package/dist/shared/omo-process-sweep.d.ts +18 -0
- package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.test.ts +87 -0
- package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.ts +35 -5
- package/dist/skills/ulw-plan/SKILL.md +20 -1
- package/dist/testing/create-plugin-module.d.ts +1 -0
- package/dist/tui.js +66 -56
- package/package.json +13 -13
- package/packages/git-bash-mcp/dist/cli.js +54 -8
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +60 -0
- package/packages/lsp-core/src/lsp/client.ts +14 -1
- package/packages/lsp-core/src/lsp/fixtures/diagnostics-freshness-contract-probe.ts +2 -2
- package/packages/lsp-core/src/mcp.ts +9 -0
- package/packages/lsp-daemon/dist/cli.js +319 -51
- package/packages/lsp-daemon/dist/client.js +136 -48
- package/packages/lsp-daemon/dist/daemon-client.d.ts +0 -10
- package/packages/lsp-daemon/dist/daemon-client.js +4 -34
- package/packages/lsp-daemon/dist/daemon-failure-result.d.ts +3 -0
- package/packages/lsp-daemon/dist/daemon-failure-result.js +38 -0
- package/packages/lsp-daemon/dist/daemon-request-error.d.ts +14 -0
- package/packages/lsp-daemon/dist/daemon-request-error.js +26 -0
- package/packages/lsp-daemon/dist/daemon-server.js +5 -1
- package/packages/lsp-daemon/dist/index.js +137 -48
- package/packages/lsp-daemon/dist/proxy.d.ts +2 -0
- package/packages/lsp-daemon/dist/proxy.js +1 -0
- package/packages/lsp-daemon/dist/version-reap.d.ts +26 -0
- package/packages/lsp-daemon/dist/version-reap.js +182 -0
- package/packages/lsp-tools-mcp/dist/cli.js +61 -10
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +6 -1
- package/packages/lsp-tools-mcp/dist/mcp.js +61 -10
- package/packages/lsp-tools-mcp/dist/tools.js +6 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +64 -8
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +22 -2
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +555 -251
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +178 -89
- package/packages/omo-codex/plugin/components/codegraph/package.json +2 -2
- package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +3 -1
- package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +3 -1
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +98 -32
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +5 -0
- package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +15 -6
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +6 -2
- package/packages/omo-codex/plugin/components/codegraph/src/sweep-cli.ts +1 -0
- package/packages/omo-codex/plugin/components/codegraph/test/hook-store-upgrade.test.ts +148 -0
- package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +31 -2
- package/packages/omo-codex/plugin/components/codegraph/test/package-runtime.test.ts +1 -1
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge-lifecycle.test.ts +65 -1
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +3 -7
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-facade.test.ts +1 -1
- package/packages/omo-codex/plugin/components/codegraph/test/serve-provision.test.ts +57 -3
- package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable.test.ts +41 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +109 -8
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-node-support.test.ts +2 -2
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +43 -0
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +80 -40
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +11 -0
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +11 -0
- package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +60 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +20 -1
- package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +42 -0
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +6 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.d.ts +21 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.js +64 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +15 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +3 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.d.ts +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +85 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.d.ts +0 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +13 -33
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +998 -593
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.d.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.js +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +10 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-verdicts.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-batch.d.ts +15 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-batch.js +84 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-mutations.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-mutations.js +81 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +7 -59
- package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +12 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/validation-batch.d.ts +9 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/validation-batch.js +122 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +8 -6
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-continuation.ts +84 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +13 -2
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-arg-parser.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +3 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +49 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +13 -45
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/constants.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +7 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/goal-status.ts +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +4 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +20 -2
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-verdicts.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-batch.ts +125 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-mutations.ts +59 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +6 -58
- package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +12 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/validation-batch.ts +122 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +76 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-checkpoint-continuation.test.ts +111 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-batch.test.ts +67 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-validation-batch.test.ts +57 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/paths.test.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering-batch.test.ts +152 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +29 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/validation-batch-checkpoint.test.ts +147 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/validation-batch.test.ts +73 -0
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +2 -2
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +2 -2
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +2 -2
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +41 -41
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +43 -0
- package/packages/omo-codex/plugin/skills/programming/scripts/typescript/check-no-excuse-rules.ts +35 -5
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +8 -6
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +20 -1
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +9 -9
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +26 -0
- package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +41 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +49 -5
- package/packages/omo-codex/scripts/install-marketplace-cache.test.mjs +4 -1
- package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.test.ts +87 -0
- package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.ts +35 -5
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +20 -1
|
@@ -158,16 +158,35 @@ function bufferFromChunk(chunk) {
|
|
|
158
158
|
|
|
159
159
|
// ../mcp-stdio-core/src/server.ts
|
|
160
160
|
var DEFAULT_IDLE_TIMEOUT_MS = 10 * 60000;
|
|
161
|
+
var DEFAULT_PARENT_POLL_INTERVAL_MS = 30000;
|
|
161
162
|
var noopLog = () => {};
|
|
163
|
+
function isProcessAlive(pid) {
|
|
164
|
+
try {
|
|
165
|
+
process.kill(pid, 0);
|
|
166
|
+
return true;
|
|
167
|
+
} catch (error) {
|
|
168
|
+
return !hasErrorCode(error, "ESRCH");
|
|
169
|
+
}
|
|
170
|
+
}
|
|
162
171
|
async function runJsonRpcStdioServer(config) {
|
|
163
172
|
const log = config.log ?? noopLog;
|
|
164
173
|
const idleTimeoutMs = config.idleTimeoutMs ?? DEFAULT_IDLE_TIMEOUT_MS;
|
|
165
|
-
|
|
174
|
+
let isClosed = false;
|
|
175
|
+
const idleTimer = createIdleTimer(idleTimeoutMs, log, () => {
|
|
176
|
+
isClosed = true;
|
|
177
|
+
config.onIdleTimeout?.();
|
|
178
|
+
});
|
|
179
|
+
const watchdog = createParentWatchdog(config.parentWatchdog, (parentPid, pollIntervalMs) => {
|
|
180
|
+
isClosed = true;
|
|
181
|
+
log("parent_exit", { parent_pid: parentPid, poll_interval_ms: pollIntervalMs });
|
|
182
|
+
config.onParentExit?.();
|
|
183
|
+
config.input.destroy();
|
|
184
|
+
});
|
|
166
185
|
log("stdio_started", { cwd: process.cwd(), idle_timeout_ms: idleTimeoutMs });
|
|
167
186
|
idleTimer.arm();
|
|
168
187
|
try {
|
|
169
188
|
for await (const message of readStdioJsonRpcMessages(config.input)) {
|
|
170
|
-
if (
|
|
189
|
+
if (isClosed)
|
|
171
190
|
break;
|
|
172
191
|
idleTimer.arm();
|
|
173
192
|
if (message.kind === "parse_error") {
|
|
@@ -178,8 +197,12 @@ async function runJsonRpcStdioServer(config) {
|
|
|
178
197
|
if (!await handleRequest(message, config, log))
|
|
179
198
|
break;
|
|
180
199
|
}
|
|
200
|
+
} catch (error) {
|
|
201
|
+
if (!(isClosed && hasErrorCode(error, "ERR_STREAM_PREMATURE_CLOSE")))
|
|
202
|
+
throw error;
|
|
181
203
|
} finally {
|
|
182
204
|
idleTimer.clear();
|
|
205
|
+
watchdog.clear();
|
|
183
206
|
log("stdio_stopped");
|
|
184
207
|
}
|
|
185
208
|
}
|
|
@@ -235,9 +258,33 @@ function isTerminalOutputError(error) {
|
|
|
235
258
|
return false;
|
|
236
259
|
return error.code === "EPIPE" || error.code === "ERR_STREAM_DESTROYED" || error.code === "ERR_STREAM_WRITE_AFTER_END";
|
|
237
260
|
}
|
|
238
|
-
function
|
|
261
|
+
function hasErrorCode(error, code) {
|
|
262
|
+
return error instanceof Error && "code" in error && error.code === code;
|
|
263
|
+
}
|
|
264
|
+
function createParentWatchdog(config, onDeadParent) {
|
|
265
|
+
if (config === undefined)
|
|
266
|
+
return { clear: () => {} };
|
|
267
|
+
const pollIntervalMs = config.pollIntervalMs ?? DEFAULT_PARENT_POLL_INTERVAL_MS;
|
|
268
|
+
if (pollIntervalMs <= 0)
|
|
269
|
+
return { clear: () => {} };
|
|
270
|
+
const parentPid = config.parentPid ?? process.ppid;
|
|
271
|
+
const probeAlive = config.probeAlive ?? isProcessAlive;
|
|
272
|
+
let fired = false;
|
|
273
|
+
const timer = setInterval(() => {
|
|
274
|
+
if (fired || probeAlive(parentPid))
|
|
275
|
+
return;
|
|
276
|
+
fired = true;
|
|
277
|
+
onDeadParent(parentPid, pollIntervalMs);
|
|
278
|
+
}, pollIntervalMs);
|
|
279
|
+
timer.unref();
|
|
280
|
+
return {
|
|
281
|
+
clear: () => {
|
|
282
|
+
clearInterval(timer);
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function createIdleTimer(idleTimeoutMs, log, onTimeout) {
|
|
239
287
|
let timer = null;
|
|
240
|
-
let isClosed = false;
|
|
241
288
|
return {
|
|
242
289
|
arm: () => {
|
|
243
290
|
if (timer !== null)
|
|
@@ -245,9 +292,8 @@ function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
|
|
|
245
292
|
if (idleTimeoutMs <= 0)
|
|
246
293
|
return;
|
|
247
294
|
timer = setTimeout(() => {
|
|
248
|
-
isClosed = true;
|
|
249
295
|
log("idle_timeout", { idle_timeout_ms: idleTimeoutMs });
|
|
250
|
-
|
|
296
|
+
onTimeout();
|
|
251
297
|
}, idleTimeoutMs);
|
|
252
298
|
timer.unref();
|
|
253
299
|
},
|
|
@@ -256,8 +302,7 @@ function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
|
|
|
256
302
|
return;
|
|
257
303
|
clearTimeout(timer);
|
|
258
304
|
timer = null;
|
|
259
|
-
}
|
|
260
|
-
closed: () => isClosed
|
|
305
|
+
}
|
|
261
306
|
};
|
|
262
307
|
}
|
|
263
308
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
@@ -3058,8 +3103,13 @@ class LspClient extends LspClientConnection {
|
|
|
3058
3103
|
if (!pushFallbackOnly)
|
|
3059
3104
|
continue;
|
|
3060
3105
|
const remainingMs = deadlineAt - Date.now();
|
|
3061
|
-
if (remainingMs <= 0)
|
|
3106
|
+
if (remainingMs <= 0) {
|
|
3107
|
+
if (!this.isDiagnosticPullSupported() && snapshot.publishGeneration === 0) {
|
|
3108
|
+
const cached = this.documents.getPullCache(snapshot);
|
|
3109
|
+
return { items: cached === null ? [] : [...cached.diagnostics] };
|
|
3110
|
+
}
|
|
3062
3111
|
return this.freshnessTimeout(absPath);
|
|
3112
|
+
}
|
|
3063
3113
|
const waitMs = push.status === "wait" ? Math.min(push.waitMs, remainingMs) : remainingMs;
|
|
3064
3114
|
await waitForDiagnosticsActivity(this.documents.waitForDiagnosticsActivity(snapshot, waitMs), signal);
|
|
3065
3115
|
}
|
|
@@ -5026,12 +5076,13 @@ async function handleLspMcpRequest(input, options = {}) {
|
|
|
5026
5076
|
}
|
|
5027
5077
|
return errorResponse(id, -32601, `Method not found: ${String(method)}`);
|
|
5028
5078
|
}
|
|
5029
|
-
async function runMcpStdioServer(input = process.stdin, output = process.stdout) {
|
|
5079
|
+
async function runMcpStdioServer(input = process.stdin, output = process.stdout, options = {}) {
|
|
5030
5080
|
const requestContext = createStandaloneMcpRequestContext();
|
|
5031
5081
|
await runJsonRpcStdioServer({
|
|
5032
5082
|
input,
|
|
5033
5083
|
output,
|
|
5034
5084
|
idleTimeoutMs: 0,
|
|
5085
|
+
parentWatchdog: options.parentWatchdog ?? {},
|
|
5035
5086
|
handler: (request) => runWithRequestContext(requestContext, () => handleLspMcpRequest(request)),
|
|
5036
5087
|
handlerOptions: undefined
|
|
5037
5088
|
});
|
|
@@ -2796,8 +2796,13 @@ class LspClient extends LspClientConnection {
|
|
|
2796
2796
|
if (!pushFallbackOnly)
|
|
2797
2797
|
continue;
|
|
2798
2798
|
const remainingMs = deadlineAt - Date.now();
|
|
2799
|
-
if (remainingMs <= 0)
|
|
2799
|
+
if (remainingMs <= 0) {
|
|
2800
|
+
if (!this.isDiagnosticPullSupported() && snapshot.publishGeneration === 0) {
|
|
2801
|
+
const cached = this.documents.getPullCache(snapshot);
|
|
2802
|
+
return { items: cached === null ? [] : [...cached.diagnostics] };
|
|
2803
|
+
}
|
|
2800
2804
|
return this.freshnessTimeout(absPath);
|
|
2805
|
+
}
|
|
2801
2806
|
const waitMs = push.status === "wait" ? Math.min(push.waitMs, remainingMs) : remainingMs;
|
|
2802
2807
|
await waitForDiagnosticsActivity(this.documents.waitForDiagnosticsActivity(snapshot, waitMs), signal);
|
|
2803
2808
|
}
|
|
@@ -438,7 +438,7 @@ async function readOptionalFile(path) {
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
// components/bootstrap/src/worker.ts
|
|
441
|
-
import { appendFile as appendFile2, mkdir as mkdir8, readFile as
|
|
441
|
+
import { appendFile as appendFile2, mkdir as mkdir8, readFile as readFile14 } from "node:fs/promises";
|
|
442
442
|
import { homedir as homedir4 } from "node:os";
|
|
443
443
|
import { dirname as dirname9, join as join22, resolve as resolve7 } from "node:path";
|
|
444
444
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
@@ -864,7 +864,7 @@ async function defaultVersionProbe2(binaryPath) {
|
|
|
864
864
|
}
|
|
865
865
|
|
|
866
866
|
// components/bootstrap/src/setup.ts
|
|
867
|
-
import { copyFile as copyFile2, mkdir as mkdir7, readdir as readdir5, rm as rm10, stat as stat5 } from "node:fs/promises";
|
|
867
|
+
import { copyFile as copyFile2, mkdir as mkdir7, readFile as readFile13, readdir as readdir5, rm as rm10, stat as stat5 } from "node:fs/promises";
|
|
868
868
|
import { join as join21 } from "node:path";
|
|
869
869
|
|
|
870
870
|
// ../src/install/link-cached-plugin-agents.ts
|
|
@@ -1457,6 +1457,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
1457
1457
|
{
|
|
1458
1458
|
previous: { model: "gpt-5.6-sol", effort: "xhigh" },
|
|
1459
1459
|
current: { model: "gpt-5.6-sol", effort: "max" }
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
previous: { model: "gpt-5.6-sol", effort: "max" },
|
|
1463
|
+
current: { model: "gpt-5.6-sol", effort: "high" }
|
|
1460
1464
|
}
|
|
1461
1465
|
]
|
|
1462
1466
|
],
|
|
@@ -1466,6 +1470,37 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
1466
1470
|
{
|
|
1467
1471
|
previous: { model: "gpt-5.6-sol", effort: "high" },
|
|
1468
1472
|
current: { model: "gpt-5.6-luna", effort: "max" }
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
previous: { model: "gpt-5.6-luna", effort: "max" },
|
|
1476
|
+
current: { model: "gpt-5.6-terra", effort: "high" }
|
|
1477
|
+
}
|
|
1478
|
+
]
|
|
1479
|
+
],
|
|
1480
|
+
[
|
|
1481
|
+
"lazycodex-worker-high",
|
|
1482
|
+
[
|
|
1483
|
+
{
|
|
1484
|
+
previous: { model: "gpt-5.6-sol", effort: "max" },
|
|
1485
|
+
current: { model: "gpt-5.6-sol", effort: "medium" }
|
|
1486
|
+
}
|
|
1487
|
+
]
|
|
1488
|
+
],
|
|
1489
|
+
[
|
|
1490
|
+
"lazycodex-code-reviewer",
|
|
1491
|
+
[
|
|
1492
|
+
{
|
|
1493
|
+
previous: { model: "gpt-5.6-sol", effort: "xhigh" },
|
|
1494
|
+
current: { model: "gpt-5.6-terra", effort: "medium" }
|
|
1495
|
+
}
|
|
1496
|
+
]
|
|
1497
|
+
],
|
|
1498
|
+
[
|
|
1499
|
+
"lazycodex-clone-fidelity-reviewer",
|
|
1500
|
+
[
|
|
1501
|
+
{
|
|
1502
|
+
previous: { model: "gpt-5.6-sol", effort: "xhigh" },
|
|
1503
|
+
current: { model: "gpt-5.6-terra", effort: "high" }
|
|
1469
1504
|
}
|
|
1470
1505
|
]
|
|
1471
1506
|
],
|
|
@@ -1484,6 +1519,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
1484
1519
|
{
|
|
1485
1520
|
previous: { model: "gpt-5.6-sol", effort: "xhigh" },
|
|
1486
1521
|
current: { model: "gpt-5.6-sol", effort: "high" }
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
previous: { model: "gpt-5.6-sol", effort: "high" },
|
|
1525
|
+
current: { model: "gpt-5.6-sol", effort: "low" }
|
|
1487
1526
|
}
|
|
1488
1527
|
]
|
|
1489
1528
|
]
|
|
@@ -2303,10 +2342,6 @@ async function existingNonSymlink(path) {
|
|
|
2303
2342
|
}
|
|
2304
2343
|
}
|
|
2305
2344
|
|
|
2306
|
-
// ../src/install/codex-config-toml.ts
|
|
2307
|
-
import { mkdir as mkdir6, readFile as readFile10 } from "node:fs/promises";
|
|
2308
|
-
import { dirname as dirname8 } from "node:path";
|
|
2309
|
-
|
|
2310
2345
|
// ../src/install/codex-config-agents.ts
|
|
2311
2346
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE = ["codex-ultrawork-reviewer"];
|
|
2312
2347
|
var CURRENT_MANAGED_CODEX_AGENT_NAMES = [
|
|
@@ -2336,6 +2371,12 @@ function removeStaleManagedAgentBlocks(config, keepAgentNames) {
|
|
|
2336
2371
|
|
|
2337
2372
|
`);
|
|
2338
2373
|
}
|
|
2374
|
+
function hasForeignAgentRegistration(config, agentConfig) {
|
|
2375
|
+
const section = findTomlSection(config, `agents.${tomlKeySegment(agentConfig.name)}`);
|
|
2376
|
+
if (!section)
|
|
2377
|
+
return false;
|
|
2378
|
+
return !section.text.includes(`config_file = ${JSON.stringify(agentConfig.configFile)}`);
|
|
2379
|
+
}
|
|
2339
2380
|
function ensureAgentConfig(config, agentConfig) {
|
|
2340
2381
|
const header = `agents.${tomlKeySegment(agentConfig.name)}`;
|
|
2341
2382
|
const section = findTomlSection(config, header);
|
|
@@ -2350,6 +2391,10 @@ function tomlKeySegment(value) {
|
|
|
2350
2391
|
return /^[A-Za-z0-9_-]+$/.test(value) ? value : JSON.stringify(value);
|
|
2351
2392
|
}
|
|
2352
2393
|
|
|
2394
|
+
// ../src/install/codex-config-toml.ts
|
|
2395
|
+
import { mkdir as mkdir6, readFile as readFile10 } from "node:fs/promises";
|
|
2396
|
+
import { dirname as dirname8 } from "node:path";
|
|
2397
|
+
|
|
2353
2398
|
// ../src/install/codex-config-atomic-write.ts
|
|
2354
2399
|
import { lstat as lstat8, readlink as readlink4, realpath, rename as rename3, unlink, writeFile as writeFile6 } from "node:fs/promises";
|
|
2355
2400
|
import { basename as basename5, dirname as dirname6, isAbsolute as isAbsolute4, join as join15, resolve as resolve5 } from "node:path";
|
|
@@ -3520,13 +3565,15 @@ async function updateConfigStep(options, inputs, degraded) {
|
|
|
3520
3565
|
const configPath = join21(options.codexHome, "config.toml");
|
|
3521
3566
|
try {
|
|
3522
3567
|
await assertWritableConfigIfPresent(configPath);
|
|
3568
|
+
const existingConfig = await readConfigIfPresent(configPath);
|
|
3569
|
+
const agentConfigs = inputs.agentConfigs.filter((agentConfig) => !hasForeignAgentRegistration(existingConfig, agentConfig));
|
|
3523
3570
|
const trustedHookStates = await trustedHookStatesForPlugin({
|
|
3524
3571
|
marketplaceName: SETUP_MARKETPLACE_NAME,
|
|
3525
3572
|
pluginName: SETUP_PLUGIN_NAME,
|
|
3526
3573
|
pluginRoot: options.pluginRoot
|
|
3527
3574
|
});
|
|
3528
3575
|
await updateCodexConfig({
|
|
3529
|
-
agentConfigs
|
|
3576
|
+
agentConfigs,
|
|
3530
3577
|
autonomousPermissions: false,
|
|
3531
3578
|
configPath,
|
|
3532
3579
|
gitBashEnabled: inputs.gitBashEnabled,
|
|
@@ -3559,6 +3606,15 @@ async function assertWritableConfigIfPresent(configPath) {
|
|
|
3559
3606
|
function errorCode(error) {
|
|
3560
3607
|
return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : undefined;
|
|
3561
3608
|
}
|
|
3609
|
+
async function readConfigIfPresent(configPath) {
|
|
3610
|
+
try {
|
|
3611
|
+
return await readFile13(configPath, "utf8");
|
|
3612
|
+
} catch (error) {
|
|
3613
|
+
if (errorCode(error) === "ENOENT")
|
|
3614
|
+
return "";
|
|
3615
|
+
throw error;
|
|
3616
|
+
}
|
|
3617
|
+
}
|
|
3562
3618
|
async function linkComponentBinsStep(options, degraded) {
|
|
3563
3619
|
const binDir = resolveCodexInstallerBinDir({ codexHome: options.codexHome, env: options.env });
|
|
3564
3620
|
try {
|
|
@@ -3678,7 +3734,7 @@ function resolvePluginDataRoot(env) {
|
|
|
3678
3734
|
}
|
|
3679
3735
|
async function readPluginVersion(pluginRoot) {
|
|
3680
3736
|
try {
|
|
3681
|
-
const parsed = JSON.parse(await
|
|
3737
|
+
const parsed = JSON.parse(await readFile14(join22(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"));
|
|
3682
3738
|
if (typeof parsed !== "object" || parsed === null)
|
|
3683
3739
|
return;
|
|
3684
3740
|
const version = parsed["version"];
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"command": "node \"${PLUGIN_ROOT}/components/bootstrap/dist/cli.js\" hook session-start",
|
|
9
9
|
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\bootstrap.ps1\"",
|
|
10
10
|
"timeout": 30,
|
|
11
|
-
"statusMessage": "(OmO 4.19.
|
|
11
|
+
"statusMessage": "(OmO 4.19.1) Checking Bootstrap Provisioning"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { copyFile, mkdir, readdir, rm, stat } from "node:fs/promises";
|
|
1
|
+
import { copyFile, mkdir, readFile, readdir, rm, stat } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
|
|
4
4
|
// These relative imports resolve at BUILD time in the monorepo; esbuild
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
linkCachedPluginAgents,
|
|
11
11
|
} from "../../../../src/install/link-cached-plugin-agents.ts";
|
|
12
12
|
import { linkCachedPluginBins, linkRootRuntimeBin } from "../../../../src/install/codex-cache-bins.ts";
|
|
13
|
+
import { hasForeignAgentRegistration } from "../../../../src/install/codex-config-agents.ts";
|
|
13
14
|
import { updateCodexConfig } from "../../../../src/install/codex-config-toml.ts";
|
|
14
15
|
import { stampGitBashMcpEnv } from "../../../../src/install/codex-git-bash-mcp-env.ts";
|
|
15
16
|
import { trustedHookStatesForPlugin } from "../../../../src/install/codex-hook-trust.ts";
|
|
@@ -141,6 +142,16 @@ async function updateConfigStep(
|
|
|
141
142
|
const configPath = join(options.codexHome, "config.toml");
|
|
142
143
|
try {
|
|
143
144
|
await assertWritableConfigIfPresent(configPath);
|
|
145
|
+
// Orca mirrors the system [agents.*] entries into its runtime CODEX_HOME
|
|
146
|
+
// without copying the agents directory. Re-stamping our own registration
|
|
147
|
+
// for such a role would collide with the mirrored entry once Codex
|
|
148
|
+
// discovers <codexHome>/agents/<name>.toml (two different file paths for
|
|
149
|
+
// one role name -> upstream warning), so foreign pre-existing blocks are
|
|
150
|
+
// left untouched; directory discovery still loads the linked toml.
|
|
151
|
+
const existingConfig = await readConfigIfPresent(configPath);
|
|
152
|
+
const agentConfigs = inputs.agentConfigs.filter(
|
|
153
|
+
(agentConfig) => !hasForeignAgentRegistration(existingConfig, agentConfig),
|
|
154
|
+
);
|
|
144
155
|
// Re-stamping trusted hook hashes after an upgrade is what makes the
|
|
145
156
|
// next session's hooks trusted again once the user re-approved the
|
|
146
157
|
// bootstrap hook itself.
|
|
@@ -150,7 +161,7 @@ async function updateConfigStep(
|
|
|
150
161
|
pluginRoot: options.pluginRoot,
|
|
151
162
|
});
|
|
152
163
|
await updateCodexConfig({
|
|
153
|
-
agentConfigs
|
|
164
|
+
agentConfigs,
|
|
154
165
|
// Hard invariant: the bootstrap worker NEVER writes permission keys
|
|
155
166
|
// (approval/sandbox/network policies stay installer-flag-only).
|
|
156
167
|
autonomousPermissions: false,
|
|
@@ -189,6 +200,15 @@ function errorCode(error: unknown): string | undefined {
|
|
|
189
200
|
return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : undefined;
|
|
190
201
|
}
|
|
191
202
|
|
|
203
|
+
async function readConfigIfPresent(configPath: string): Promise<string> {
|
|
204
|
+
try {
|
|
205
|
+
return await readFile(configPath, "utf8");
|
|
206
|
+
} catch (error) {
|
|
207
|
+
if (errorCode(error) === "ENOENT") return "";
|
|
208
|
+
throw error;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
192
212
|
async function linkComponentBinsStep(options: WorkerSetupOptions, degraded: BootstrapDegradedEntry[]): Promise<void> {
|
|
193
213
|
const binDir = resolveCodexInstallerBinDir({ codexHome: options.codexHome, env: options.env });
|
|
194
214
|
try {
|