The one and only agent harness for complex codebases. Project memory, planning, execution, and verified completion inside Codex.
JavaScript aiai-agentsclaudeclaude-codeclicodexdeveloper-toolslazylazycodexoh-my-openagentomoopenaiorchestrationtypescript
chore: sync Codex marketplace v5.1.30
YeonGyu-Kimea6fc8b31ef5
diff --git a/plugins/omo/.codex-plugin/plugin.json b/plugins/omo/.codex-plugin/plugin.jsonindex 084eec87..81fb1542 100644--- a/plugins/omo/.codex-plugin/plugin.json+++ b/plugins/omo/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "omo",- "version": "5.1.29",+ "version": "5.1.30","description": "One Codex plugin namespace for Yeongyu's local Codex components.","author": {"name": "Yeongyu Kim",diff --git a/plugins/omo/components/bootstrap/dist/cli.js b/plugins/omo/components/bootstrap/dist/cli.jsindex bb341931..d304e9c5 100755--- a/plugins/omo/components/bootstrap/dist/cli.js+++ b/plugins/omo/components/bootstrap/dist/cli.js@@ -846,7 +846,8 @@ function defaultVersionProbe(binaryPath) {return String(execFileSync(binaryPath, ["--version"], {encoding: "utf8",stdio: ["ignore", "pipe", "ignore"],- timeout: SG_VERSION_PROBE_TIMEOUT_MS+ timeout: SG_VERSION_PROBE_TIMEOUT_MS,+ windowsHide: true}));}function probePasses(binaryPath, deps) {@@ -12164,7 +12165,7 @@ function isKnownNonGitBashLauncher(path) {}function whereCommand(command) {try {- return execFileSync2("where", [command], { encoding: "utf8" }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);+ return execFileSync2("where", [command], { encoding: "utf8", windowsHide: true }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);} catch (error) {if (error instanceof Error)return [];diff --git a/plugins/omo/components/bootstrap/hooks/hooks.json b/plugins/omo/components/bootstrap/hooks/hooks.jsonindex 5f5cf811..7f7442a3 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.29) Checking Bootstrap Provisioning"+ "statusMessage": "(OmO 5.1.30) Checking Bootstrap Provisioning"}]}diff --git a/plugins/omo/components/bootstrap/package.json b/plugins/omo/components/bootstrap/package.jsonindex 30cb0330..1c960dca 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.29",+ "version": "5.1.30","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.jsonindex 26fab910..9e691202 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.29) Checking Comments"+ "statusMessage": "(OmO 5.1.30) Checking Comments"}]}diff --git a/plugins/omo/components/comment-checker/package.json b/plugins/omo/components/comment-checker/package.jsonindex 072659f6..8fa2e733 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.29",+ "version": "5.1.30","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-mcp/dist/cli.js b/plugins/omo/components/git-bash-mcp/dist/cli.jsindex 33139cf9..189108d1 100755--- a/plugins/omo/components/git-bash-mcp/dist/cli.js+++ b/plugins/omo/components/git-bash-mcp/dist/cli.js@@ -390,7 +390,7 @@ function isKnownNonGitBashLauncher(path) {}function whereCommand(command) {try {- return execFileSync("where", [command], { encoding: "utf8" }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);+ return execFileSync("where", [command], { encoding: "utf8", windowsHide: true }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);} catch (error) {if (error instanceof Error)return [];diff --git a/plugins/omo/components/git-bash/hooks/hooks.json b/plugins/omo/components/git-bash/hooks/hooks.jsonindex f6b99661..dd09d89f 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.29) Recommending Git Bash MCP"+ "statusMessage": "(OmO 5.1.30) 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.29) Resetting Git Bash MCP Reminder"+ "statusMessage": "(OmO 5.1.30) Resetting Git Bash MCP Reminder"}]}diff --git a/plugins/omo/components/git-bash/package.json b/plugins/omo/components/git-bash/package.jsonindex d88bb9b0..248f36f8 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.29",+ "version": "5.1.30","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.jsonindex 7c03c1a8..0490ab78 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.29) Verifying LazyCodex Executor Evidence"+ "statusMessage": "(OmO 5.1.30) Verifying LazyCodex Executor Evidence"}]}diff --git a/plugins/omo/components/lazycodex-executor-verify/package.json b/plugins/omo/components/lazycodex-executor-verify/package.jsonindex e28a1316..efe3027d 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.29",+ "version": "5.1.30","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.jsindex f046a016..02e2ac74 100644--- a/plugins/omo/components/lsp-daemon/dist/cli.js+++ b/plugins/omo/components/lsp-daemon/dist/cli.js@@ -3579,7 +3579,7 @@ class LspClient extends LspClientConnection {} catch (error) {if (this.isUnsupportedDiagnosticPullError(error)) {this.setDiagnosticPullSupported(false);- pushFallbackOnly = true;+ continue;} else if (error instanceof LspRequestTimeoutError) {pushFallbackOnly = true;} else {diff --git a/plugins/omo/components/lsp-daemon/dist/client.js b/plugins/omo/components/lsp-daemon/dist/client.jsindex 0c24751c..92496f8c 100644--- a/plugins/omo/components/lsp-daemon/dist/client.js+++ b/plugins/omo/components/lsp-daemon/dist/client.js@@ -3815,7 +3815,7 @@ class LspClient extends LspClientConnection {} catch (error) {if (this.isUnsupportedDiagnosticPullError(error)) {this.setDiagnosticPullSupported(false);- pushFallbackOnly = true;+ continue;} else if (error instanceof LspRequestTimeoutError) {pushFallbackOnly = true;} else {diff --git a/plugins/omo/components/lsp-daemon/dist/index.js b/plugins/omo/components/lsp-daemon/dist/index.jsindex 27f002a7..1cf25533 100644--- a/plugins/omo/components/lsp-daemon/dist/index.js+++ b/plugins/omo/components/lsp-daemon/dist/index.js@@ -2650,7 +2650,7 @@ class LspClient extends LspClientConnection {} catch (error) {if (this.isUnsupportedDiagnosticPullError(error)) {this.setDiagnosticPullSupported(false);- pushFallbackOnly = true;+ continue;} else if (error instanceof LspRequestTimeoutError) {pushFallbackOnly = true;} else {diff --git a/plugins/omo/components/lsp-tools-mcp/dist/cli.js b/plugins/omo/components/lsp-tools-mcp/dist/cli.jsindex c1f8c944..9e589695 100755--- a/plugins/omo/components/lsp-tools-mcp/dist/cli.js+++ b/plugins/omo/components/lsp-tools-mcp/dist/cli.js@@ -2655,7 +2655,7 @@ class LspClient extends LspClientConnection {} catch (error) {if (this.isUnsupportedDiagnosticPullError(error)) {this.setDiagnosticPullSupported(false);- pushFallbackOnly = true;+ continue;} else if (error instanceof LspRequestTimeoutError) {pushFallbackOnly = true;} else {diff --git a/plugins/omo/components/lsp-tools-mcp/dist/lsp/manager.js b/plugins/omo/components/lsp-tools-mcp/dist/lsp/manager.jsindex 226231fa..166b5532 100644--- a/plugins/omo/components/lsp-tools-mcp/dist/lsp/manager.js+++ b/plugins/omo/components/lsp-tools-mcp/dist/lsp/manager.js@@ -2650,7 +2650,7 @@ class LspClient extends LspClientConnection {} catch (error) {if (this.isUnsupportedDiagnosticPullError(error)) {this.setDiagnosticPullSupported(false);- pushFallbackOnly = true;+ continue;} else if (error instanceof LspRequestTimeoutError) {pushFallbackOnly = true;} else {diff --git a/plugins/omo/components/lsp-tools-mcp/dist/mcp.js b/plugins/omo/components/lsp-tools-mcp/dist/mcp.jsindex fecb4d89..f9a7d282 100644--- a/plugins/omo/components/lsp-tools-mcp/dist/mcp.js+++ b/plugins/omo/components/lsp-tools-mcp/dist/mcp.js@@ -3144,7 +3144,7 @@ class LspClient extends LspClientConnection {} catch (error) {if (this.isUnsupportedDiagnosticPullError(error)) {this.setDiagnosticPullSupported(false);- pushFallbackOnly = true;+ continue;} else if (error instanceof LspRequestTimeoutError) {pushFallbackOnly = true;} else {diff --git a/plugins/omo/components/lsp-tools-mcp/dist/tools.js b/plugins/omo/components/lsp-tools-mcp/dist/tools.jsindex a601df18..a9f5e504 100644--- a/plugins/omo/components/lsp-tools-mcp/dist/tools.js+++ b/plugins/omo/components/lsp-tools-mcp/dist/tools.js@@ -2832,7 +2832,7 @@ class LspClient extends LspClientConnection {} catch (error) {if (this.isUnsupportedDiagnosticPullError(error)) {this.setDiagnosticPullSupported(false);- pushFallbackOnly = true;+ continue;} else if (error instanceof LspRequestTimeoutError) {pushFallbackOnly = true;} else {diff --git a/plugins/omo/components/lsp/dist/.omo-runtime-manifest.json b/plugins/omo/components/lsp/dist/.omo-runtime-manifest.jsonindex 9959b28a..b53e7c25 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.29",- "inputDigest": "sha256:9d15a230eaff0c93de5a8ff0f469ff7fe066ca59ac92dfe7672fd8ff300fa085",+ "version": "5.1.30",+ "inputDigest": "sha256:cf776d8585ec0e86540cc12d9a01c22a20b3e13b24300062c7dae109304ad483","outputs": [{"path": "cli.d.ts",@@ -9,7 +9,7 @@},{"path": "cli.js",- "sha256": "f2776c0f9c2a893136e9e8e36c2e086172f10c0ab3566a730cff4443b712f956"+ "sha256": "e4d7664d4b1a19eb00e68e5a0f42ceae1195188a26e59217522c1d0de3854f54"},{"path": "codex-hook-cli.d.ts",diff --git a/plugins/omo/components/lsp/dist/cli.js b/plugins/omo/components/lsp/dist/cli.jsindex 4a1e4476..4fecf969 100644--- a/plugins/omo/components/lsp/dist/cli.js+++ b/plugins/omo/components/lsp/dist/cli.js@@ -3270,7 +3270,7 @@ class LspClient extends LspClientConnection {} catch (error) {if (this.isUnsupportedDiagnosticPullError(error)) {this.setDiagnosticPullSupported(false);- pushFallbackOnly = true;+ continue;} else if (error instanceof LspRequestTimeoutError) {pushFallbackOnly = true;} else {diff --git a/plugins/omo/components/lsp/hooks/hooks.json b/plugins/omo/components/lsp/hooks/hooks.jsonindex 0394c799..a0e385ea 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.29) Checking LSP Diagnostics"+ "statusMessage": "(OmO 5.1.30) 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.29) Resetting LSP Diagnostics Cache"+ "statusMessage": "(OmO 5.1.30) Resetting LSP Diagnostics Cache"}]}diff --git a/plugins/omo/components/lsp/package.json b/plugins/omo/components/lsp/package.jsonindex d08213a7..ddf3cdc6 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.29",+ "version": "5.1.30","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.jsonindex 3139ad49..7eb751bf 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.29) Loading Project Rules"+ "statusMessage": "(OmO 5.1.30) 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.29) Loading Project Rules"+ "statusMessage": "(OmO 5.1.30) 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.29) Matching Project Rules"+ "statusMessage": "(OmO 5.1.30) 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.29) Resetting Project Rule Cache"+ "statusMessage": "(OmO 5.1.30) Resetting Project Rule Cache"}]}diff --git a/plugins/omo/components/rules/package.json b/plugins/omo/components/rules/package.jsonindex 5539fc3b..96bf7c9c 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.29",+ "version": "5.1.30","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.jsonindex 831f2a69..965fe043 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.29) Checking Thread Title Hygiene"+ "statusMessage": "(OmO 5.1.30) Checking Thread Title Hygiene"}]}diff --git a/plugins/omo/components/teammode/package.json b/plugins/omo/components/teammode/package.jsonindex 225ccb20..e10854b1 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.29",+ "version": "5.1.30","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/hooks/hooks.json b/plugins/omo/components/telemetry/hooks/hooks.jsonindex 72dc205f..719be237 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.29) Recording Session Telemetry"+ "statusMessage": "(OmO 5.1.30) Recording Session Telemetry"}]}diff --git a/plugins/omo/components/telemetry/package.json b/plugins/omo/components/telemetry/package.jsonindex 61797c07..23b1e146 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.29",+ "version": "5.1.30","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.jsonindex a0abcd65..9ecc3415 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.29) Checking Ultrawork Trigger"+ "statusMessage": "(OmO 5.1.30) Checking Ultrawork Trigger"}]}diff --git a/plugins/omo/components/ultrawork/package.json b/plugins/omo/components/ultrawork/package.jsonindex a310fa89..1cc4e946 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.29",+ "version": "5.1.30","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.jsonindex 702a2696..a62594cc 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.29) Checking Ulw-Execute Continuation"+ "statusMessage": "(OmO 5.1.30) Checking Ulw-Execute Continuation"}]}diff --git a/plugins/omo/components/ulw-execute-continuation/package.json b/plugins/omo/components/ulw-execute-continuation/package.jsonindex 28b22c30..e4a68602 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.29",+ "version": "5.1.30","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.jsonindex 8e852667..15080a5a 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.29) Checking Ulw-Loop Steering"+ "statusMessage": "(OmO 5.1.30) 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.29) Recording Spawn Admission"+ "statusMessage": "(OmO 5.1.30) 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.29) Enforcing Unlimited Ulw-Loop Budget"+ "statusMessage": "(OmO 5.1.30) 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.29) Guarding Ulw-Loop Spawns"+ "statusMessage": "(OmO 5.1.30) 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.29) Checking Ulw-Loop Resume"+ "statusMessage": "(OmO 5.1.30) Checking Ulw-Loop Resume"}]}diff --git a/plugins/omo/components/ulw-loop/package.json b/plugins/omo/components/ulw-loop/package.jsonindex efdcd8d7..fbd48711 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.29",+ "version": "5.1.30","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.jsindex bc072e00..1fc21b8a 100755--- a/plugins/omo/dist/cli-node/index.js+++ b/plugins/omo/dist/cli-node/index.js@@ -65,7 +65,7 @@ var package_default;var init_package = __esm(() => {package_default = {name: "oh-my-opencode",- version: "5.1.29",+ version: "5.1.30",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",@@ -242,7 +242,7 @@ var init_package = __esm(() => {},devDependencies: {"@clack/prompts": "^1.8.1",- "@code-yeongyu/senpi": "2026.10.10-11",+ "@code-yeongyu/senpi": "2026.10.11","@modelcontextprotocol/sdk": "^1.30.0","@oh-my-opencode/agents-md-core": "workspace:*","@oh-my-opencode/ast-grep-mcp": "workspace:*",@@ -284,6 +284,7 @@ var init_package = __esm(() => {"@types/js-yaml": "^4.0.9","@types/picomatch": "^4.0.3","@typescript/native-preview": "7.0.0-dev.20260707.2",+ "@typescript/typescript6": "6.0.2","@xterm/addon-unicode11": "^0.9.0","@xterm/xterm": "^6.0.0","bun-types": "1.4.2",@@ -300,18 +301,18 @@ var init_package = __esm(() => {typescript: "^7.0.2"},optionalDependencies: {- "oh-my-opencode-darwin-arm64": "5.1.29",- "oh-my-opencode-darwin-x64": "5.1.29",- "oh-my-opencode-darwin-x64-baseline": "5.1.29",- "oh-my-opencode-linux-arm64": "5.1.29",- "oh-my-opencode-linux-arm64-musl": "5.1.29",- "oh-my-opencode-linux-x64": "5.1.29",- "oh-my-opencode-linux-x64-baseline": "5.1.29",- "oh-my-opencode-linux-x64-musl": "5.1.29",- "oh-my-opencode-linux-x64-musl-baseline": "5.1.29",- "oh-my-opencode-windows-arm64": "5.1.29",- "oh-my-opencode-windows-x64": "5.1.29",- "oh-my-opencode-windows-x64-baseline": "5.1.29"+ "oh-my-opencode-darwin-arm64": "5.1.30",+ "oh-my-opencode-darwin-x64": "5.1.30",+ "oh-my-opencode-darwin-x64-baseline": "5.1.30",+ "oh-my-opencode-linux-arm64": "5.1.30",+ "oh-my-opencode-linux-arm64-musl": "5.1.30",+ "oh-my-opencode-linux-x64": "5.1.30",+ "oh-my-opencode-linux-x64-baseline": "5.1.30",+ "oh-my-opencode-linux-x64-musl": "5.1.30",+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.30",+ "oh-my-opencode-windows-arm64": "5.1.30",+ "oh-my-opencode-windows-x64": "5.1.30",+ "oh-my-opencode-windows-x64-baseline": "5.1.30"},overrides: {hono: "^4.13.8",@@ -5084,6 +5085,9 @@ function resolveStdio(options) {}return [options.stdin ?? "ignore", options.stdout ?? "pipe", options.stderr ?? "inherit"];}+function createBunSpawnOptions(options) {+ return { ...options, windowsHide: true };+}function createNodeSpawnOptions(options, platform = process.platform) {const nodeOptions = {stdio: resolveStdio(options),@@ -5172,7 +5176,7 @@ function spawn(cmdOrOpts, opts) {const { cmd, opts: options } = resolveCommand(cmdOrOpts, opts);const bun = getBunRuntime();if (bun)- return wrapBunProcess(bun.spawn(cmd, options));+ return wrapBunProcess(bun.spawn(cmd, createBunSpawnOptions(options)));const [bin, ...args] = cmd;if (!bin)throw new Error("spawn requires a command");@@ -5317,7 +5321,7 @@ function isKnownNonGitBashLauncher(path) {}function whereCommand(command) {try {- return execFileSync("where", [command], { encoding: "utf8" }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);+ return execFileSync("where", [command], { encoding: "utf8", windowsHide: true }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);} catch (error) {if (error instanceof Error)return [];@@ -5760,7 +5764,8 @@ function defaultVersionProbe(binaryPath) {return String(execFileSync2(binaryPath, ["--version"], {encoding: "utf8",stdio: ["ignore", "pipe", "ignore"],- timeout: SG_VERSION_PROBE_TIMEOUT_MS+ timeout: SG_VERSION_PROBE_TIMEOUT_MS,+ windowsHide: true}));}function probePasses(binaryPath, deps) {@@ -7463,10 +7468,11 @@ var init_category_model_requirements = __esm(() => {},{ providers: ["xiaomi", "opencode-go"], model: "mimo-v2.6-pro", variant: "max" },{ providers: ["xai", "github-copilot", "opencode-go"], model: "grok-4.7", variant: "xhigh" },+ { providers: ["openai", "chatgpt-subscription"], model: "gpt-6.1-sol", variant: "medium" },{providers: ["openai", "chatgpt-subscription", "github-copilot", "opencode"],- model: "gpt-5.6-terra",- variant: "high"+ model: "gpt-5.6-sol",+ variant: "medium"},{providers: ["anthropic", "anthropic-api", "github-copilot", "opencode"],@@ -89973,7 +89979,7 @@ var package_default2;var init_package2 = __esm(() => {package_default2 = {name: "@oh-my-opencode/omo-codex",- version: "5.1.29",+ version: "5.1.30",type: "module",private: true,description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",@@ -110383,6 +110389,917 @@ function createMcpOAuthCommand() {return mcp;}+// packages/omo-opencode/src/cli/service-auth/browser.ts+import { execFile as execFile5 } from "node:child_process";+var execute = (file, args, env) => new Promise((resolve) => {+ execFile5(file, [...args], { env, timeout: 1e4, windowsHide: true }, (error) => resolve(error === null));+});+async function openSignInBrowser(url, executeBrowser = execute, platform = process.platform, environment = process.env) {+ const env = {};+ for (const key of ["PATH", "Path", "HOME", "USERPROFILE", "SystemRoot", "WINDIR", "DISPLAY", "WAYLAND_DISPLAY", "XDG_RUNTIME_DIR", "DBUS_SESSION_BUS_ADDRESS"]) {+ const value = environment[key];+ if (value !== undefined)+ env[key] = value;+ }+ if (platform === "darwin")+ return executeBrowser("/usr/bin/open", [url], env);+ if (platform === "win32")+ return executeBrowser("rundll32.exe", ["url.dll,FileProtocolHandler", url], env);+ if (platform === "linux" && (env.DISPLAY || env.WAYLAND_DISPLAY))+ return executeBrowser("xdg-open", [url], env);+ return false;+}++// packages/omo-opencode/src/cli/service-auth/device-name.ts+import { hostname } from "node:os";++// packages/omo-opencode/src/cli/service-auth/protocol.ts+init_zod();++// packages/omo-opencode/src/cli/service-auth/terminal-text.ts+import { stripVTControlCharacters as stripVTControlCharacters4 } from "node:util";+function terminalText(value) {+ return stripVTControlCharacters4(value).replace(/[\p{C}\p{Zl}\p{Zp}]/gu, "");+}++// packages/omo-opencode/src/cli/service-auth/protocol.ts+class SignInError extends Error {+ retryable;+ name = "SignInError";+ constructor(message, retryable = false) {+ super(message);+ this.retryable = retryable;+ }+}++class RequestFailure extends SignInError {+ notSent;+ constructor(notSent) {+ super("Unable to complete the service request. Check the connection and retry.", true);+ this.notSent = notSent;+ }+}+var platformSchema = _enum(["macos", "linux", "windows"]);+var nonempty = string2().min(1);+var timestamp = string2().datetime({ offset: true });+var tokenSchema = object({+ accessToken: nonempty,+ accessTokenExpiresAt: timestamp,+ refreshToken: nonempty+});+var grantSchema = tokenSchema.extend({+ device: object({ id: nonempty, name: nonempty }),+ offlineGrant: nonempty.optional()+});+var credentialSchema = grantSchema.extend({+ signingPrivateKey: nonempty,+ sealingPrivateKey: nonempty,+ refreshState: literal("uncertain").optional()+});+var deviceCodeSchema = object({+ deviceCode: string2().regex(/^dc\.[A-Za-z0-9_-]{43}$/),+ userCode: string2().regex(/^[BCDFGHJKLMNPQRSTVWXZ]{4}-[BCDFGHJKLMNPQRSTVWXZ]{4}$/),+ matchingCode: string2().regex(/^\d{3} \d{3}$/),+ verificationUri: string2().transform(terminalText).pipe(string2().url()),+ expiresAt: timestamp,+ intervalSeconds: number2().int().min(1).max(60)+});+var envelopeSchema = object({+ error: object({+ code: nonempty,+ message: string2(),+ retryable: boolean2(),+ requestId: string2(),+ detail: unknown().optional()+ })+});+var limitSchema = object({+ reason: literal("device_limit"),+ managementToken: nonempty,+ used: number2().int().nonnegative(),+ limit: number2().int().nonnegative()+});+var deviceListSchema = object({+ devices: array(object({ id: nonempty, name: nonempty, revokedAt: timestamp.nullable() }))+});++class ApiRefusal extends SignInError {+ status;+ code;+ #detail;+ #retryAfter;+ constructor(code, status, detail, retryAfter = null) {+ super("The service refused this request. Sign in again or check your account.", status === 429 || status >= 500);+ this.status = status;+ this.code = [+ "unauthorized",+ "account_deleted",+ "reauth_required",+ "invalid_grant",+ "entitlement_required",+ "authorization_pending",+ "slow_down",+ "access_denied",+ "expired_token",+ "rate_limited",+ "internal",+ "unavailable",+ "forbidden",+ "invalid_request",+ "not_found"+ ].includes(code) ? code : "unknown";+ this.#detail = detail;+ this.#retryAfter = retryAfter;+ }+ get detail() {+ return this.#detail;+ }+ retryDelay(now, fallback) {+ const raw = this.#retryAfter;+ const delay = raw === null ? Number.NaN : /^\d+$/.test(raw) ? Number(raw) * 1000 : Date.parse(raw) - now;+ return Math.min(60000, Math.max(fallback, Number.isFinite(delay) ? delay : fallback));+ }+}+function parseReply(schema, value) {+ const result = schema.safeParse(value);+ if (!result.success)+ throw new SignInError("The service returned an invalid response.");+ return result.data;+}+function serviceOrigin(value) {+ let url;+ try {+ url = new URL(value);+ } catch {+ throw new SignInError("Invalid service URL.");+ }+ const loopback = url.protocol === "http:" && url.hostname === "127.0.0.1" && url.port !== "";+ if (url.protocol !== "https:" && !loopback || url.username || url.password || url.search || url.hash || url.pathname !== "/") {+ throw new SignInError("Service URLs must be HTTPS origins, or http://127.0.0.1:<port> for local testing.");+ }+ return url.origin;+}+async function requestApi(api, path, init, signal) {+ let response;+ let body;+ try {+ response = await fetch(`${api}${path}`, {+ ...init,+ redirect: "error",+ signal: signal ? AbortSignal.any([signal, AbortSignal.timeout(30000)]) : AbortSignal.timeout(30000)+ });+ } catch (error) {+ const cause = error instanceof Error && error.cause instanceof Error ? error.cause : error;+ const code = cause instanceof Error ? Reflect.get(cause, "code") : undefined;+ throw new RequestFailure(typeof code === "string" && [+ "ENOTFOUND",+ "ECONNREFUSED",+ "ENETUNREACH",+ "EHOSTUNREACH",+ "EAI_AGAIN",+ "ConnectionRefused",+ "EADDRNOTAVAIL",+ "ENETDOWN",+ "EHOSTDOWN",+ "UND_ERR_CONNECT_TIMEOUT",+ "ERR_TLS_HANDSHAKE_TIMEOUT",+ "DEPTH_ZERO_SELF_SIGNED_CERT",+ "CERT_HAS_EXPIRED",+ "ERR_TLS_CERT_ALTNAME_INVALID",+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",+ "SELF_SIGNED_CERT_IN_CHAIN",+ "CERT_NOT_YET_VALID",+ "UNABLE_TO_GET_ISSUER_CERT",+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",+ "CERT_SIGNATURE_FAILURE",+ "CERT_UNTRUSTED",+ "CERT_REJECTED"+ ].includes(code));+ }+ if (response.status === 204)+ return null;+ try {+ body = await response.json();+ } catch {+ throw new RequestFailure(false);+ }+ if (response.ok)+ return body;+ const envelope = envelopeSchema.safeParse(body);+ if (!envelope.success)+ throw new SignInError("The service returned an invalid error response.");+ const error = envelope.data.error;+ const detail = limitSchema.safeParse(error.detail);+ throw new ApiRefusal(error.code, response.status, error.code === "entitlement_required" && detail.success ? detail.data : undefined, response.headers.get("retry-after"));+}+var jsonRequest = (body) => ({+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify(body)+});++// packages/omo-opencode/src/cli/service-auth/device-name.ts+function deviceName(host = hostname()) {+ const clean = `omo CLI on ${host}`.replace(/[\p{Cc}\p{Zl}\p{Zp}\p{Cf}\u3164\u115F\u1160\uFFA0]/gu, "").trim();+ return [...clean].slice(0, 64).join("").trim();+}+function devicePlatform() {+ switch (process.platform) {+ case "darwin":+ return "macos";+ case "linux":+ return "linux";+ case "win32":+ return "windows";+ default:+ throw new SignInError("This platform is not supported for OmO sign-in.");+ }+}++// packages/omo-opencode/src/cli/service-auth/device-flow.ts+import { setTimeout as setTimeout2 } from "node:timers/promises";++// packages/omo-opencode/src/cli/service-auth/device-keys.ts+import { generateKeyPairSync } from "node:crypto";+function generateDeviceKeys() {+ const signing = generateKeyPairSync("ed25519");+ const sealing = generateKeyPairSync("x25519");+ const signingKey = signing.publicKey.export({ format: "jwk" }).x;+ const sealingKey = sealing.publicKey.export({ format: "jwk" }).x;+ if (!signingKey || !sealingKey)+ throw new SignInError("Unable to generate device keys.");+ return {+ public: { signingKey, sealingKey },+ private: {+ signingPrivateKey: signing.privateKey.export({ format: "der", type: "pkcs8" }).toString("base64"),+ sealingPrivateKey: sealing.privateKey.export({ format: "der", type: "pkcs8" }).toString("base64")+ }+ };+}++// packages/omo-opencode/src/cli/service-auth/device-flow.ts+async function loginDevice(session, options) {+ await session.ready();+ const keys = generateDeviceKeys();+ const minted = parseReply(deviceCodeSchema, await session.request("/v1/device/code", jsonRequest({ client: { name: options.name, platform: options.platform } })));+ const uri = new URL(minted.verificationUri);+ if (uri.protocol !== "https:" && !(uri.protocol === "http:" && uri.hostname === "127.0.0.1" && uri.port !== "")) {+ throw new SignInError("The service returned an unsafe verification URL.");+ }+ options.show({ verificationUri: minted.verificationUri, userCode: minted.userCode, matchingCode: minted.matchingCode });+ const now = options.now ?? Date.now;+ const sleep = options.sleep ?? ((ms) => setTimeout2(ms, undefined, { signal: session.signal }));+ const expiresAt = Date.parse(minted.expiresAt);+ let interval = minted.intervalSeconds * 1000;+ while (now() < expiresAt) {+ await sleep(Math.min(interval, expiresAt - now()));+ session.signal?.throwIfAborted();+ if (now() >= expiresAt)+ break;+ try {+ const grant = parseReply(grantSchema, await session.request("/v1/device/token", jsonRequest({+ deviceCode: minted.deviceCode,+ ...keys.public+ })));+ await session.save({ ...grant, ...keys.private });+ return;+ } catch (error) {+ if (!(error instanceof ApiRefusal))+ throw error;+ if (error.status === 400 && error.code === "authorization_pending")+ continue;+ if (error.status === 400 && error.code === "slow_down") {+ interval += 5000;+ continue;+ }+ if (error.status === 429) {+ interval = error.retryDelay(now(), Math.min(60000, interval + 5000));+ continue;+ }+ if (error.detail !== undefined) {+ if (await session.removeForLimit(error, options.chooseDevice))+ continue;+ throw new SignInError("Sign-in cancelled. No device was removed.");+ }+ if (["access_denied", "expired_token", "invalid_grant"].includes(error.code)) {+ throw new SignInError("Device sign-in was denied or expired. Run omo login again for a new code.");+ }+ throw error;+ }+ }+ throw new SignInError("Device sign-in expired. Run omo login again for a new code.");+}++// packages/omo-opencode/src/cli/service-auth/keystore.ts+import { createHash as createHash9 } from "node:crypto";+function credentialId(api) {+ return createHash9("sha256").update(serviceOrigin(api)).digest("hex");+}+function createCredentialStore(api, secrets = typeof Bun === "undefined" ? null : Bun.secrets, platform = process.platform) {+ 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.`);+ return {+ async read() {+ let value;+ try {+ value = await secrets.get(key);+ } catch {+ throw unavailable();+ }+ if (value === null)+ return null;+ try {+ return credentialSchema.parse(JSON.parse(value));+ } catch {+ throw new SignInError("Stored sign-in data is invalid. Run omo logout, then omo login.");+ }+ },+ async write(value) {+ try {+ await secrets.set({ ...key, value: JSON.stringify(credentialSchema.parse(value)) });+ } catch {+ throw unavailable();+ }+ },+ async clear() {+ try {+ await secrets.delete(key);+ } catch {+ throw unavailable();+ }+ }+ };+}++// packages/omo-opencode/src/cli/service-auth/loopback.ts+import { createHash as createHash10, randomBytes as randomBytes3, timingSafeEqual } from "node:crypto";+import { createServer as createServer3 } from "node:http";+class BrowserUnavailable extends SignInError {+}+async function authorize(options) {+ const verifier = randomBytes3(32).toString("base64url");+ const state = randomBytes3(32).toString("base64url");+ const answer = Promise.withResolvers();+ const abort = () => answer.reject(new SignInError("Browser sign-in cancelled or timed out."));+ let accepted = false;+ let origin = "";+ const server = createServer3((request, response) => {+ response.setHeader("cache-control", "no-store");+ response.setHeader("referrer-policy", "no-referrer");+ response.setHeader("content-type", "text/plain; charset=utf-8");+ const url = new URL(request.url ?? "/", origin);+ if (request.method !== "GET" || request.headers.host !== new URL(origin).host || url.origin !== origin || url.pathname !== "/callback" || request.headers.forwarded || request.headers["x-forwarded-for"]) {+ response.writeHead(404).end("Not found");+ return;+ }+ const code = url.searchParams.get("code");+ const suppliedState = Buffer.from(url.searchParams.get("state") ?? "");+ const expectedState = Buffer.from(state);+ if (accepted || url.searchParams.getAll("state").length !== 1 || suppliedState.length !== expectedState.length || !timingSafeEqual(suppliedState, expectedState) || url.searchParams.getAll("code").length !== 1 || !code) {+ response.writeHead(400).end("Invalid sign-in response");+ return;+ }+ accepted = true;+ response.writeHead(200).end("Return to the terminal to finish signing in.");+ answer.resolve(code);+ });+ try {+ await new Promise((resolve, reject) => {+ server.once("error", reject);+ server.listen(0, "127.0.0.1", () => {+ server.off("error", reject);+ resolve();+ });+ });+ const address = server.address();+ if (!address || typeof address === "string")+ throw new SignInError("Unable to start the sign-in callback.");+ origin = `http://127.0.0.1:${address.port}`;+ const url = new URL(serviceOrigin(options.accounts));+ url.search = new URLSearchParams({+ redirect_uri: `${origin}/callback`,+ code_challenge: createHash10("sha256").update(verifier).digest("base64url"),+ code_challenge_method: "S256",+ state+ }).toString();+ const timer = setTimeout(abort, 5 * 60000);+ options.signal?.addEventListener("abort", abort, { once: true });+ try {+ options.signal?.throwIfAborted();+ const openerFailed = () => {+ if (!accepted)+ throw new BrowserUnavailable("No browser is available; use device sign-in.");+ };+ const [code] = await Promise.all([+ answer.promise,+ options.open(url.href).then((opened) => {+ if (!opened)+ openerFailed();+ }, openerFailed)+ ]);+ return { code, codeVerifier: verifier };+ } finally {+ clearTimeout(timer);+ options.signal?.removeEventListener("abort", abort);+ }+ } finally {+ server.closeAllConnections();+ await new Promise((resolve) => server.close(() => resolve()));+ }+}+async function loginLoopback(session, options) {+ await session.ready();+ const keys = generateDeviceKeys();+ for (;; ) {+ const authorization = await authorize({ accounts: options.accounts, open: options.open, signal: session.signal });+ try {+ const grant = parseReply(grantSchema, await session.request("/v1/session/exchange", jsonRequest({+ ...authorization,+ kind: "cli",+ deviceName: options.name,+ platform: options.platform,+ ...keys.public+ })));+ await session.save({ ...grant, ...keys.private });+ return;+ } catch (error) {+ if (await session.removeForLimit(error, options.chooseDevice))+ continue;+ throw new SignInError("Sign-in cancelled. No device was removed.");+ }+ }+}++// packages/omo-opencode/src/cli/service-auth/session.ts+import { mkdir as mkdir10 } from "node:fs/promises";+import { homedir as homedir27 } from "node:os";+import { join as join97 } from "node:path";++// packages/team-core/src/team-state-store/lock-publish.ts+import { access as access3, open as open2, unlink as unlink2 } from "node:fs/promises";+import { dirname as dirname38 } from "node:path";++// packages/team-core/src/team-state-store/lock-record.ts+import { randomUUID as randomUUID4 } from "node:crypto";+import { readFile as readFile33, stat as stat8 } from "node:fs/promises";+var lockOwnerInstanceId = randomUUID4();+var heldLockRecords = new Set;+function buildLockRecord(ownerTag) {+ return `${ownerTag} ${randomUUID4()}+${process.pid}+${Date.now()}+${lockOwnerInstanceId}+`;+}+function markLockRecordHeld(content) {+ heldLockRecords.add(content);+}+function markLockRecordReleased(content) {+ heldLockRecords.delete(content);+}+function errorCode(error) {+ if (!(error instanceof Error) || !("code" in error))+ return null;+ return typeof error.code === "string" ? error.code : null;+}+function isPathAbsenceError(error) {+ const code = errorCode(error);+ return code === "ENOENT" || code === "ENOTDIR";+}+function parseLockOwner(content) {+ const lines = content.split(/\r?\n/).filter((line) => line.length > 0);+ if (lines.length !== 3 && lines.length !== 4)+ return null;+ const ownerPid = Number.parseInt(lines[1] ?? "", 10);+ const acquiredAtEpochMs = Number.parseInt(lines[2] ?? "", 10);+ if (!Number.isInteger(ownerPid) || ownerPid <= 0)+ return null;+ if (!Number.isInteger(acquiredAtEpochMs) || acquiredAtEpochMs <= 0)+ return null;+ return {+ ownerPid,+ acquiredAtEpochMs,+ instanceId: lines.length === 4 ? lines[3] ?? null : null+ };+}+function isPidAlive(pid) {+ try {+ process.kill(pid, 0);+ return true;+ } catch (error) {+ if (!(error instanceof Error)) {+ throw error;+ }+ return false;+ }+}+async function readLockRecord(lockPath) {+ try {+ const content = await readFile33(lockPath, "utf8");+ const { mtimeMs } = await stat8(lockPath);+ return { content, modifiedAtEpochMs: mtimeMs };+ } catch (error) {+ if (!(error instanceof Error))+ throw error;+ return null;+ }+}+function isLockRecordStale(record, staleAfterMs) {+ const owner = parseLockOwner(record.content);+ if (owner === null)+ return Date.now() - record.modifiedAtEpochMs > staleAfterMs;+ if (owner.instanceId !== null && owner.ownerPid === process.pid) {+ return owner.instanceId !== lockOwnerInstanceId || !heldLockRecords.has(record.content);+ }+ if (isPidAlive(owner.ownerPid))+ return false;+ if (owner.instanceId !== null)+ return true;+ return Date.now() - owner.acquiredAtEpochMs > staleAfterMs;+}++// packages/team-core/src/team-state-store/lock-publish.ts+async function pathMayExist(path, deps = {}) {+ const accessPath = deps.access ?? access3;+ try {+ await accessPath(path);+ return true;+ } catch (error) {+ if (!(error instanceof Error))+ throw error;+ return !isPathAbsenceError(error);+ }+}+async function assertRetryableLockOpenError(lockPath, error, deps) {+ const code = errorCode(error);+ if (code === "EEXIST")+ return;+ if (code === "EPERM") {+ if (await pathMayExist(lockPath, deps))+ return;+ if ((deps?.platform ?? process.platform) === "win32" && await pathMayExist(dirname38(lockPath), deps))+ return;+ }+ throw error;+}+async function publishLockRecord(lockPath, record) {+ markLockRecordHeld(record);+ let fileHandle;+ try {+ fileHandle = await open2(lockPath, "wx");+ } catch (error) {+ markLockRecordReleased(record);+ await assertRetryableLockOpenError(lockPath, error);+ return false;+ }+ try {+ await fileHandle.writeFile(record);+ } catch (error) {+ markLockRecordReleased(record);+ await fileHandle.close();+ await unlink2(lockPath).catch(() => {+ return;+ });+ throw error;+ }+ await fileHandle.close();+ return true;+}++// packages/team-core/src/team-state-store/lock-reclaim.ts+import { createHash as createHash11 } from "node:crypto";+import { unlink as unlink3 } from "node:fs/promises";+var RECLAIM_UNLINK_ATTEMPTS = 3;+var RECLAIM_UNLINK_RETRY_MS = 25;+function delay2(ms) {+ return new Promise((resolve) => {+ setTimeout(resolve, ms);+ });+}+function reclaimGuardPath(lockPath, record) {+ return `${lockPath}.reclaim-${createHash11("sha256").update(record).digest("hex").slice(0, 16)}`;+}+async function unlinkWithRetry(path, deps) {+ const wait = deps.delay ?? delay2;+ const unlinkFile = deps.unlink ?? unlink3;+ for (let attempt = 1;; attempt += 1) {+ try {+ await unlinkFile(path);+ return "removed";+ } catch (error) {+ if (!(error instanceof Error))+ throw error;+ if (isPathAbsenceError(error))+ return "absent";+ const code = errorCode(error);+ if (code !== "EPERM" && code !== "EBUSY" || attempt === RECLAIM_UNLINK_ATTEMPTS)+ return "stuck";+ await wait(RECLAIM_UNLINK_RETRY_MS);+ }+ }+}+async function removeLockRecordIfUnchanged(lockPath, expectedRecord, staleAfterMs, deps = {}) {+ const guardPath = reclaimGuardPath(lockPath, expectedRecord);+ const guardRecord = buildLockRecord("lock-reclaim");+ if (!await publishLockRecord(guardPath, guardRecord)) {+ const guard = await readLockRecord(guardPath);+ if (guard !== null && isLockRecordStale(guard, staleAfterMs)) {+ await removeLockRecordIfUnchanged(guardPath, guard.content, staleAfterMs, deps);+ }+ return "busy";+ }+ try {+ const current = await readLockRecord(lockPath);+ if (current === null)+ return "absent";+ if (current.content !== expectedRecord || !isLockRecordStale(current, staleAfterMs))+ return "changed";+ const unlinked = await unlinkWithRetry(lockPath, deps);+ return unlinked === "absent" ? "absent" : unlinked;+ } finally {+ markLockRecordReleased(guardRecord);+ await unlinkWithRetry(guardPath, deps);+ }+}++// packages/team-core/src/team-state-store/locks.ts+var LOCK_RETRY_MS = 50;+var LOCK_WAIT_TIMEOUT_MS = 15000;+var DEFAULT_STALE_AFTER_MS = 300000;+function delay3(ms) {+ return new Promise((resolve) => {+ setTimeout(resolve, ms);+ });+}+async function acquireLock(lockPath, ownerTag, staleAfterMs) {+ const startedAt = Date.now();+ for (;; ) {+ if (Date.now() - startedAt > LOCK_WAIT_TIMEOUT_MS) {+ throw new Error(`Timed out acquiring lock: ${lockPath}`);+ }+ const record = buildLockRecord(ownerTag);+ if (await publishLockRecord(lockPath, record))+ return record;+ const outcome = await reapStaleLock(lockPath, staleAfterMs);+ if (outcome === "removed" || outcome === "absent")+ continue;+ await delay3(LOCK_RETRY_MS);+ }+}+async function withLock(lockPath, fn, opts) {+ const staleAfterMs = opts?.staleAfterMs ?? DEFAULT_STALE_AFTER_MS;+ const ownerTag = opts?.ownerTag ?? "owner";+ const record = await acquireLock(lockPath, ownerTag, staleAfterMs);+ try {+ return await fn();+ } finally {+ markLockRecordReleased(record);+ await removeLockRecordIfUnchanged(lockPath, record, staleAfterMs);+ }+}+async function reapStaleLock(lockPath, staleAfterMs = DEFAULT_STALE_AFTER_MS, deps = {}) {+ const observed = await readLockRecord(lockPath);+ if (observed === null)+ return "absent";+ if (!isLockRecordStale(observed, staleAfterMs))+ return "changed";+ return await removeLockRecordIfUnchanged(lockPath, observed.content, staleAfterMs, deps);+}++// packages/omo-opencode/src/cli/service-auth/session.ts+class SessionEnded extends SignInError {+ deviceRevoked;+ constructor(message, deviceRevoked) {+ super(message);+ this.deviceRevoked = deviceRevoked;+ }+}+var DEVICE_REVOKING_REFUSALS = new Set(["account_deleted", "reauth_required"]);+function createSession(options) {+ const api = serviceOrigin(options.api);+ const { store, signal } = options;+ const directory = join97(options.home ?? homedir27(), ".omo", "session-locks");+ const lockPath = join97(directory, `${credentialId(api)}.lock`);+ async function locked(action) {+ await mkdir10(directory, { recursive: true, mode: 448 });+ signal?.throwIfAborted();+ return withLock(lockPath, async () => {+ signal?.throwIfAborted();+ return action();+ }, { ownerTag: "cli-session", staleAfterMs: Number.POSITIVE_INFINITY });+ }+ const request = (path, init) => requestApi(api, path, init, signal);+ const uncertain = () => new SignInError("The refresh outcome is unknown. Saved credentials and keys were retained, but this refresh token will not be sent again. Retry sign-in with omo login.", true);+ async function refreshedAccess(current) {+ if (current.refreshState === "uncertain")+ throw uncertain();+ if (Date.parse(current.accessTokenExpiresAt) > Date.now() + 30000)+ return current.accessToken;+ await store.write({ ...current, refreshState: "uncertain" });+ try {+ const tokens = parseReply(tokenSchema, await request("/v1/session/refresh", jsonRequest({ refreshToken: current.refreshToken })));+ await store.write({ ...current, ...tokens });+ return tokens.accessToken;+ } 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));+ }+ if (error instanceof RequestFailure && error.notSent || error instanceof ApiRefusal && error.status === 429 && error.code === "rate_limited") {+ await store.write(current);+ throw error;+ }+ throw uncertain();+ }+ }+ return {+ request,+ signal,+ async ready() {+ await store.read();+ },+ async save(value) {+ await locked(() => store.write(value));+ },+ async logout() {+ return locked(async () => {+ try {+ const current = await store.read();+ if (current !== null) {+ if (current.refreshState === "uncertain")+ return false;+ const access = Date.parse(current.accessTokenExpiresAt) <= Date.now() ? await refreshedAccess(current) : current.accessToken;+ await request(`/v1/devices/${encodeURIComponent(current.device.id)}`, {+ method: "DELETE",+ headers: { authorization: `Bearer ${access}` }+ });+ }+ return true;+ } catch (error) {+ if (error instanceof SessionEnded)+ return error.deviceRevoked;+ if (error instanceof SignInError)+ return false;+ throw error;+ } finally {+ await store.clear();+ }+ });+ },+ async accessToken() {+ return locked(async () => {+ const current = await store.read();+ if (current === null)+ throw new SignInError("Not signed in. Run omo login.");+ return refreshedAccess(current);+ });+ },+ async removeForLimit(error, choose) {+ if (!(error instanceof ApiRefusal) || error.detail === undefined)+ throw error;+ const headers = { authorization: `Bearer ${error.detail.managementToken}` };+ const listed = parseReply(deviceListSchema, await request("/v1/devices", { headers }));+ const devices = listed.devices.filter((device) => device.revokedAt === null);+ const chosen = await choose(devices);+ if (chosen === null)+ return false;+ if (!devices.some((device) => device.id === chosen))+ throw new SignInError("No matching device was selected.");+ await request(`/v1/devices/${encodeURIComponent(chosen)}`, { method: "DELETE", headers });+ return true;+ }+ };+}++// packages/omo-opencode/src/cli/service-auth/commands.ts+async function ensureServiceAvailable(session, api) {+ try {+ await session.request("/v1/health", { method: "GET" });+ } catch (error) {+ if (!(error instanceof SignInError))+ throw error;+ if (error instanceof RequestFailure) {+ throw new SignInError(`Can't reach OmO accounts at ${api}. The service may not be available yet, or your network, proxy or certificate settings are blocking it.`);+ }+ throw new SignInError(`OmO accounts at ${api} aren't available right now. Try again later.`);+ }+}+function deviceChoices(devices) {+ return devices.map((device) => ({ value: device.id, label: terminalText(device.name) }));+}+var chooseDevice = async (devices) => {+ if (!process.stdin.isTTY || devices.length === 0) {+ console.error("Device limit reached. Run omo login in an interactive terminal to choose a device to remove.");+ return null;+ }+ const chosen = await select({+ message: "Device limit reached. Remove a device to sign in?",+ options: [{ value: "", label: "Cancel (keep all devices)" }, ...deviceChoices(devices)]+ });+ if (isCancel(chosen) || chosen === "")+ return null;+ const agreed = await confirm({ message: "Sign out the selected device?", initialValue: false });+ return agreed === true ? chosen : null;+};+async function run2(action, options) {+ const controller = new AbortController;+ const cancel = () => controller.abort();+ process.once("SIGINT", cancel);+ process.once("SIGTERM", cancel);+ try {+ const api = serviceOrigin(options.api ?? process.env.OMO_SERVICE_API_URL ?? "https://api.omo.dev");+ const store = createCredentialStore(api);+ const session = createSession({ api, store, signal: controller.signal });+ if (action === "logout") {+ const revoked = await session.logout();+ console.log("Signed out of OmO. Stored credentials and device keys were removed.");+ if (!revoked)+ console.error("Server device revocation could not be confirmed. Remove this device from the Devices page of your OmO account when connected.");+ return;+ }+ if (action === "whoami") {+ await session.accessToken();+ const saved = await store.read();+ console.log(saved ? `Signed in to ${api} as ${terminalText(saved.device.name)}.` : "Not signed in.");+ return;+ }+ await ensureServiceAvailable(session, api);+ const name = deviceName();+ const platform = devicePlatform();+ if (!options.device && options.browser !== false) {+ try {+ await loginLoopback(session, {+ accounts: serviceOrigin(options.accounts ?? process.env.OMO_SERVICE_ACCOUNTS_URL ?? "https://accounts.omo.dev"),+ name,+ platform,+ open: openSignInBrowser,+ chooseDevice+ });+ console.log("Signed in to OmO.");+ return;+ } catch (error) {+ if (!(error instanceof BrowserUnavailable))+ throw error;+ }+ }+ await loginDevice(session, {+ name,+ platform,+ chooseDevice,+ show: (code) => {+ console.log(`Open ${code.verificationUri}`);+ console.log(`User code: ${code.userCode}`);+ console.log(`Matching code: ${code.matchingCode}`);+ }+ });+ console.log("Signed in to OmO.");+ } catch (error) {+ console.error(controller.signal.aborted ? "Sign-in cancelled." : error instanceof SignInError ? error.message : "Unable to complete OmO sign-in. Check the OS credential store and try again.");+ process.exitCode = 1;+ } finally {+ process.removeListener("SIGINT", cancel);+ process.removeListener("SIGTERM", cancel);+ }+}+function configureServiceAuthCommands(program) {+ program.command("login").description("Sign in to OmO using the OS credential store").option("--device", "Use a device code instead of a browser callback").option("--no-browser", "Sign in by device code without opening a browser").option("--api <url>", "OmO API origin (or OMO_SERVICE_API_URL)").option("--accounts <url>", "OmO accounts origin (or OMO_SERVICE_ACCOUNTS_URL)").action((options) => run2("login", options));+ for (const action of ["logout", "whoami"]) {+ program.command(action).description(action === "logout" ? "Remove stored OmO credentials and device keys" : "Show the current OmO device sign-in").option("--api <url>", "OmO API origin (or OMO_SERVICE_API_URL)").action((options) => run2(action, options));+ }+}++// packages/omo-opencode/src/cli/install-command-options.ts+function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION_NAME) {+ const defaultPlatform = process.env.OMO_EDITION === "codex" || invocationName === "lazycodex" || invocationName === "lazycodex-ai" ? "codex" : undefined;+ const platform = options.platform ?? defaultPlatform;+ if (platform === "native-dev" && !isNativeDevPlatformEnabled()) {+ throw new Error(`The native-dev install platform is not available in this release. Set ${NATIVE_DEV_PLATFORM_ENV_FLAG}=1 to enable it from a source checkout.`);+ }+ return {+ tui: options.tui !== false,+ claude: options.claude,+ openai: options.openai,+ gemini: options.gemini,+ copilot: options.copilot,+ platform,+ opencodeZen: options.opencodeZen,+ zaiCodingPlan: options.zaiCodingPlan,+ kimiForCoding: options.kimiForCoding,+ opencodeGo: options.opencodeGo,+ bailianCodingPlan: options.bailianCodingPlan,+ minimaxCnCodingPlan: options.minimaxCnCodingPlan,+ minimaxCodingPlan: options.minimaxCodingPlan,+ vercelAiGateway: options.vercelAiGateway,+ codexAutonomous: options.codexAutonomous,+ skipAuth: options.skipAuth ?? false+ };+}+// packages/omo-opencode/src/cli/boulder/boulder.tsimport { existsSync as existsSync64 } from "node:fs";@@ -110543,11 +111460,11 @@ async function boulder(options) {// packages/omo-opencode/src/cli/codex-ulw-loop.tsimport { spawn as spawn5 } from "node:child_process";import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync11 } from "node:fs";-import { homedir as homedir27 } from "node:os";+import { homedir as homedir28 } from "node:os";var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";function resolveCodexUlwLoopCommand(input = {}) {const env = input.env ?? process.env;- const homeDir = input.homeDir ?? homedir27();+ const homeDir = input.homeDir ?? homedir28();const localComponentBin = resolveLocalUlwLoopBin(env, homeDir);if (localComponentBin !== null)return { executable: localComponentBin, argsPrefix: [] };@@ -110788,7 +111705,7 @@ function linkedWorktrees(records) {}// packages/omo-opencode/src/cli/worktree-sweep/sweep.tsimport { existsSync as existsSync66 } from "node:fs";-import { stat as stat8 } from "node:fs/promises";+import { stat as stat9 } from "node:fs/promises";import os7 from "node:os";import { normalize as normalize2 } from "node:path";@@ -110871,7 +111788,7 @@ async function isOlderThan(worktreePath, days, now) {if (days <= 0)return false;try {- const stats = await stat8(worktreePath);+ const stats = await stat9(worktreePath);return now - stats.mtimeMs > days * DAY_MS;} catch {return false;@@ -111088,31 +112005,6 @@ function runConfigMigrate(options = {}) {init_package();var VERSION3 = package_default.version;var program2 = new Command;-function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION_NAME) {- const defaultPlatform = process.env.OMO_EDITION === "codex" || invocationName === "lazycodex" || invocationName === "lazycodex-ai" ? "codex" : undefined;- const platform = options.platform ?? defaultPlatform;- if (platform === "native-dev" && !isNativeDevPlatformEnabled()) {- throw new Error(`The native-dev install platform is not available in this release. Set ${NATIVE_DEV_PLATFORM_ENV_FLAG}=1 to enable it from a source checkout.`);- }- return {- tui: options.tui !== false,- claude: options.claude,- openai: options.openai,- gemini: options.gemini,- copilot: options.copilot,- platform,- opencodeZen: options.opencodeZen,- zaiCodingPlan: options.zaiCodingPlan,- kimiForCoding: options.kimiForCoding,- opencodeGo: options.opencodeGo,- bailianCodingPlan: options.bailianCodingPlan,- minimaxCnCodingPlan: options.minimaxCnCodingPlan,- minimaxCodingPlan: options.minimaxCodingPlan,- vercelAiGateway: options.vercelAiGateway,- codexAutonomous: options.codexAutonomous,- skipAuth: options.skipAuth ?? false- };-}program2.name("oh-my-opencode").description("The ultimate OpenCode plugin - multi-model orchestration, LSP tools, and more").version(VERSION3, "-v, --version", "Show version number").helpOption("-h, --help", "Display help for command").addOption(new Option("--platform <platform>", `Install target platform: ${availableInstallPlatforms().join(", ")}`).choices(availableInstallPlatforms()).hideHelp()).enablePositionalOptions();program2.command("install").alias("setup").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").addOption(new Option("--platform <platform>", `Install target platform: ${availableInstallPlatforms().join(", ")}`).choices(availableInstallPlatforms())).option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--opencode-go <value>", "OpenCode Go subscription: no, yes (default: no)").option("--bailian-coding-plan <value>", "Bailian Coding Plan subscription: no, yes (default: no)").option("--minimax-cn-coding-plan <value>", "MiniMax Coding Plan (minimaxi.com) subscription: no, yes (default: no)").option("--minimax-coding-plan <value>", "MiniMax Coding Plan (minimax.io) subscription: no, yes (default: no)").option("--vercel-ai-gateway <value>", "Vercel AI Gateway: no, yes (default: no)").option("--codex-autonomous", "Configure Codex with approval never, full filesystem access, and network enabled").option("--no-codex-autonomous", "Leave existing Codex permission settings unchanged").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `Examples:@@ -111230,6 +112122,7 @@ program2.command("config").description("Manage unified OMO configuration").comma});configureRuntimeCommands(program2);program2.addCommand(createMcpOAuthCommand());+configureServiceAuthCommands(program2);function runCli() {program2.parse();}diff --git a/plugins/omo/dist/cli/index.js b/plugins/omo/dist/cli/index.jsindex 57e858d4..bec11460 100755--- a/plugins/omo/dist/cli/index.js+++ b/plugins/omo/dist/cli/index.js@@ -64,7 +64,7 @@ var package_default;var init_package = __esm(() => {package_default = {name: "oh-my-opencode",- version: "5.1.29",+ version: "5.1.30",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",@@ -241,7 +241,7 @@ var init_package = __esm(() => {},devDependencies: {"@clack/prompts": "^1.8.1",- "@code-yeongyu/senpi": "2026.10.10-11",+ "@code-yeongyu/senpi": "2026.10.11","@modelcontextprotocol/sdk": "^1.30.0","@oh-my-opencode/agents-md-core": "workspace:*","@oh-my-opencode/ast-grep-mcp": "workspace:*",@@ -283,6 +283,7 @@ var init_package = __esm(() => {"@types/js-yaml": "^4.0.9","@types/picomatch": "^4.0.3","@typescript/native-preview": "7.0.0-dev.20260707.2",+ "@typescript/typescript6": "6.0.2","@xterm/addon-unicode11": "^0.9.0","@xterm/xterm": "^6.0.0","bun-types": "1.4.2",@@ -299,18 +300,18 @@ var init_package = __esm(() => {typescript: "^7.0.2"},optionalDependencies: {- "oh-my-opencode-darwin-arm64": "5.1.29",- "oh-my-opencode-darwin-x64": "5.1.29",- "oh-my-opencode-darwin-x64-baseline": "5.1.29",- "oh-my-opencode-linux-arm64": "5.1.29",- "oh-my-opencode-linux-arm64-musl": "5.1.29",- "oh-my-opencode-linux-x64": "5.1.29",- "oh-my-opencode-linux-x64-baseline": "5.1.29",- "oh-my-opencode-linux-x64-musl": "5.1.29",- "oh-my-opencode-linux-x64-musl-baseline": "5.1.29",- "oh-my-opencode-windows-arm64": "5.1.29",- "oh-my-opencode-windows-x64": "5.1.29",- "oh-my-opencode-windows-x64-baseline": "5.1.29"+ "oh-my-opencode-darwin-arm64": "5.1.30",+ "oh-my-opencode-darwin-x64": "5.1.30",+ "oh-my-opencode-darwin-x64-baseline": "5.1.30",+ "oh-my-opencode-linux-arm64": "5.1.30",+ "oh-my-opencode-linux-arm64-musl": "5.1.30",+ "oh-my-opencode-linux-x64": "5.1.30",+ "oh-my-opencode-linux-x64-baseline": "5.1.30",+ "oh-my-opencode-linux-x64-musl": "5.1.30",+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.30",+ "oh-my-opencode-windows-arm64": "5.1.30",+ "oh-my-opencode-windows-x64": "5.1.30",+ "oh-my-opencode-windows-x64-baseline": "5.1.30"},overrides: {hono: "^4.13.8",@@ -5083,6 +5084,9 @@ function resolveStdio(options) {}return [options.stdin ?? "ignore", options.stdout ?? "pipe", options.stderr ?? "inherit"];}+function createBunSpawnOptions(options) {+ return { ...options, windowsHide: true };+}function createNodeSpawnOptions(options, platform = process.platform) {const nodeOptions = {stdio: resolveStdio(options),@@ -5171,7 +5175,7 @@ function spawn(cmdOrOpts, opts) {const { cmd, opts: options } = resolveCommand(cmdOrOpts, opts);const bun = getBunRuntime();if (bun)- return wrapBunProcess(bun.spawn(cmd, options));+ return wrapBunProcess(bun.spawn(cmd, createBunSpawnOptions(options)));const [bin, ...args] = cmd;if (!bin)throw new Error("spawn requires a command");@@ -5316,7 +5320,7 @@ function isKnownNonGitBashLauncher(path) {}function whereCommand(command) {try {- return execFileSync("where", [command], { encoding: "utf8" }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);+ return execFileSync("where", [command], { encoding: "utf8", windowsHide: true }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);} catch (error) {if (error instanceof Error)return [];@@ -5759,7 +5763,8 @@ function defaultVersionProbe(binaryPath) {return String(execFileSync2(binaryPath, ["--version"], {encoding: "utf8",stdio: ["ignore", "pipe", "ignore"],- timeout: SG_VERSION_PROBE_TIMEOUT_MS+ timeout: SG_VERSION_PROBE_TIMEOUT_MS,+ windowsHide: true}));}function probePasses(binaryPath, deps) {@@ -7462,10 +7467,11 @@ var init_category_model_requirements = __esm(() => {},{ providers: ["xiaomi", "opencode-go"], model: "mimo-v2.6-pro", variant: "max" },{ providers: ["xai", "github-copilot", "opencode-go"], model: "grok-4.7", variant: "xhigh" },+ { providers: ["openai", "chatgpt-subscription"], model: "gpt-6.1-sol", variant: "medium" },{providers: ["openai", "chatgpt-subscription", "github-copilot", "opencode"],- model: "gpt-5.6-terra",- variant: "high"+ model: "gpt-5.6-sol",+ variant: "medium"},{providers: ["anthropic", "anthropic-api", "github-copilot", "opencode"],@@ -89894,7 +89900,7 @@ var package_default2;var init_package2 = __esm(() => {package_default2 = {name: "@oh-my-opencode/omo-codex",- version: "5.1.29",+ version: "5.1.30",type: "module",private: true,description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",@@ -110304,6 +110310,917 @@ function createMcpOAuthCommand() {return mcp;}+// packages/omo-opencode/src/cli/service-auth/browser.ts+import { execFile as execFile5 } from "child_process";+var execute = (file, args, env) => new Promise((resolve) => {+ execFile5(file, [...args], { env, timeout: 1e4, windowsHide: true }, (error) => resolve(error === null));+});+async function openSignInBrowser(url, executeBrowser = execute, platform = process.platform, environment = process.env) {+ const env = {};+ for (const key of ["PATH", "Path", "HOME", "USERPROFILE", "SystemRoot", "WINDIR", "DISPLAY", "WAYLAND_DISPLAY", "XDG_RUNTIME_DIR", "DBUS_SESSION_BUS_ADDRESS"]) {+ const value = environment[key];+ if (value !== undefined)+ env[key] = value;+ }+ if (platform === "darwin")+ return executeBrowser("/usr/bin/open", [url], env);+ if (platform === "win32")+ return executeBrowser("rundll32.exe", ["url.dll,FileProtocolHandler", url], env);+ if (platform === "linux" && (env.DISPLAY || env.WAYLAND_DISPLAY))+ return executeBrowser("xdg-open", [url], env);+ return false;+}++// packages/omo-opencode/src/cli/service-auth/device-name.ts+import { hostname } from "os";++// packages/omo-opencode/src/cli/service-auth/protocol.ts+init_zod();++// packages/omo-opencode/src/cli/service-auth/terminal-text.ts+import { stripVTControlCharacters as stripVTControlCharacters4 } from "util";+function terminalText(value) {+ return stripVTControlCharacters4(value).replace(/[\p{C}\p{Zl}\p{Zp}]/gu, "");+}++// packages/omo-opencode/src/cli/service-auth/protocol.ts+class SignInError extends Error {+ retryable;+ name = "SignInError";+ constructor(message, retryable = false) {+ super(message);+ this.retryable = retryable;+ }+}++class RequestFailure extends SignInError {+ notSent;+ constructor(notSent) {+ super("Unable to complete the service request. Check the connection and retry.", true);+ this.notSent = notSent;+ }+}+var platformSchema = _enum(["macos", "linux", "windows"]);+var nonempty = string2().min(1);+var timestamp = string2().datetime({ offset: true });+var tokenSchema = object({+ accessToken: nonempty,+ accessTokenExpiresAt: timestamp,+ refreshToken: nonempty+});+var grantSchema = tokenSchema.extend({+ device: object({ id: nonempty, name: nonempty }),+ offlineGrant: nonempty.optional()+});+var credentialSchema = grantSchema.extend({+ signingPrivateKey: nonempty,+ sealingPrivateKey: nonempty,+ refreshState: literal("uncertain").optional()+});+var deviceCodeSchema = object({+ deviceCode: string2().regex(/^dc\.[A-Za-z0-9_-]{43}$/),+ userCode: string2().regex(/^[BCDFGHJKLMNPQRSTVWXZ]{4}-[BCDFGHJKLMNPQRSTVWXZ]{4}$/),+ matchingCode: string2().regex(/^\d{3} \d{3}$/),+ verificationUri: string2().transform(terminalText).pipe(string2().url()),+ expiresAt: timestamp,+ intervalSeconds: number2().int().min(1).max(60)+});+var envelopeSchema = object({+ error: object({+ code: nonempty,+ message: string2(),+ retryable: boolean2(),+ requestId: string2(),+ detail: unknown().optional()+ })+});+var limitSchema = object({+ reason: literal("device_limit"),+ managementToken: nonempty,+ used: number2().int().nonnegative(),+ limit: number2().int().nonnegative()+});+var deviceListSchema = object({+ devices: array(object({ id: nonempty, name: nonempty, revokedAt: timestamp.nullable() }))+});++class ApiRefusal extends SignInError {+ status;+ code;+ #detail;+ #retryAfter;+ constructor(code, status, detail, retryAfter = null) {+ super("The service refused this request. Sign in again or check your account.", status === 429 || status >= 500);+ this.status = status;+ this.code = [+ "unauthorized",+ "account_deleted",+ "reauth_required",+ "invalid_grant",+ "entitlement_required",+ "authorization_pending",+ "slow_down",+ "access_denied",+ "expired_token",+ "rate_limited",+ "internal",+ "unavailable",+ "forbidden",+ "invalid_request",+ "not_found"+ ].includes(code) ? code : "unknown";+ this.#detail = detail;+ this.#retryAfter = retryAfter;+ }+ get detail() {+ return this.#detail;+ }+ retryDelay(now, fallback) {+ const raw = this.#retryAfter;+ const delay = raw === null ? Number.NaN : /^\d+$/.test(raw) ? Number(raw) * 1000 : Date.parse(raw) - now;+ return Math.min(60000, Math.max(fallback, Number.isFinite(delay) ? delay : fallback));+ }+}+function parseReply(schema, value) {+ const result = schema.safeParse(value);+ if (!result.success)+ throw new SignInError("The service returned an invalid response.");+ return result.data;+}+function serviceOrigin(value) {+ let url;+ try {+ url = new URL(value);+ } catch {+ throw new SignInError("Invalid service URL.");+ }+ const loopback = url.protocol === "http:" && url.hostname === "127.0.0.1" && url.port !== "";+ if (url.protocol !== "https:" && !loopback || url.username || url.password || url.search || url.hash || url.pathname !== "/") {+ throw new SignInError("Service URLs must be HTTPS origins, or http://127.0.0.1:<port> for local testing.");+ }+ return url.origin;+}+async function requestApi(api, path, init, signal) {+ let response;+ let body;+ try {+ response = await fetch(`${api}${path}`, {+ ...init,+ redirect: "error",+ signal: signal ? AbortSignal.any([signal, AbortSignal.timeout(30000)]) : AbortSignal.timeout(30000)+ });+ } catch (error) {+ const cause = error instanceof Error && error.cause instanceof Error ? error.cause : error;+ const code = cause instanceof Error ? Reflect.get(cause, "code") : undefined;+ throw new RequestFailure(typeof code === "string" && [+ "ENOTFOUND",+ "ECONNREFUSED",+ "ENETUNREACH",+ "EHOSTUNREACH",+ "EAI_AGAIN",+ "ConnectionRefused",+ "EADDRNOTAVAIL",+ "ENETDOWN",+ "EHOSTDOWN",+ "UND_ERR_CONNECT_TIMEOUT",+ "ERR_TLS_HANDSHAKE_TIMEOUT",+ "DEPTH_ZERO_SELF_SIGNED_CERT",+ "CERT_HAS_EXPIRED",+ "ERR_TLS_CERT_ALTNAME_INVALID",+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",+ "SELF_SIGNED_CERT_IN_CHAIN",+ "CERT_NOT_YET_VALID",+ "UNABLE_TO_GET_ISSUER_CERT",+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",+ "CERT_SIGNATURE_FAILURE",+ "CERT_UNTRUSTED",+ "CERT_REJECTED"+ ].includes(code));+ }+ if (response.status === 204)+ return null;+ try {+ body = await response.json();+ } catch {+ throw new RequestFailure(false);+ }+ if (response.ok)+ return body;+ const envelope = envelopeSchema.safeParse(body);+ if (!envelope.success)+ throw new SignInError("The service returned an invalid error response.");+ const error = envelope.data.error;+ const detail = limitSchema.safeParse(error.detail);+ throw new ApiRefusal(error.code, response.status, error.code === "entitlement_required" && detail.success ? detail.data : undefined, response.headers.get("retry-after"));+}+var jsonRequest = (body) => ({+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify(body)+});++// packages/omo-opencode/src/cli/service-auth/device-name.ts+function deviceName(host = hostname()) {+ const clean = `omo CLI on ${host}`.replace(/[\p{Cc}\p{Zl}\p{Zp}\p{Cf}\u3164\u115F\u1160\uFFA0]/gu, "").trim();+ return [...clean].slice(0, 64).join("").trim();+}+function devicePlatform() {+ switch (process.platform) {+ case "darwin":+ return "macos";+ case "linux":+ return "linux";+ case "win32":+ return "windows";+ default:+ throw new SignInError("This platform is not supported for OmO sign-in.");+ }+}++// packages/omo-opencode/src/cli/service-auth/device-flow.ts+import { setTimeout as setTimeout2 } from "timers/promises";++// packages/omo-opencode/src/cli/service-auth/device-keys.ts+import { generateKeyPairSync } from "crypto";+function generateDeviceKeys() {+ const signing = generateKeyPairSync("ed25519");+ const sealing = generateKeyPairSync("x25519");+ const signingKey = signing.publicKey.export({ format: "jwk" }).x;+ const sealingKey = sealing.publicKey.export({ format: "jwk" }).x;+ if (!signingKey || !sealingKey)+ throw new SignInError("Unable to generate device keys.");+ return {+ public: { signingKey, sealingKey },+ private: {+ signingPrivateKey: signing.privateKey.export({ format: "der", type: "pkcs8" }).toString("base64"),+ sealingPrivateKey: sealing.privateKey.export({ format: "der", type: "pkcs8" }).toString("base64")+ }+ };+}++// packages/omo-opencode/src/cli/service-auth/device-flow.ts+async function loginDevice(session, options) {+ await session.ready();+ const keys = generateDeviceKeys();+ const minted = parseReply(deviceCodeSchema, await session.request("/v1/device/code", jsonRequest({ client: { name: options.name, platform: options.platform } })));+ const uri = new URL(minted.verificationUri);+ if (uri.protocol !== "https:" && !(uri.protocol === "http:" && uri.hostname === "127.0.0.1" && uri.port !== "")) {+ throw new SignInError("The service returned an unsafe verification URL.");+ }+ options.show({ verificationUri: minted.verificationUri, userCode: minted.userCode, matchingCode: minted.matchingCode });+ const now = options.now ?? Date.now;+ const sleep = options.sleep ?? ((ms) => setTimeout2(ms, undefined, { signal: session.signal }));+ const expiresAt = Date.parse(minted.expiresAt);+ let interval = minted.intervalSeconds * 1000;+ while (now() < expiresAt) {+ await sleep(Math.min(interval, expiresAt - now()));+ session.signal?.throwIfAborted();+ if (now() >= expiresAt)+ break;+ try {+ const grant = parseReply(grantSchema, await session.request("/v1/device/token", jsonRequest({+ deviceCode: minted.deviceCode,+ ...keys.public+ })));+ await session.save({ ...grant, ...keys.private });+ return;+ } catch (error) {+ if (!(error instanceof ApiRefusal))+ throw error;+ if (error.status === 400 && error.code === "authorization_pending")+ continue;+ if (error.status === 400 && error.code === "slow_down") {+ interval += 5000;+ continue;+ }+ if (error.status === 429) {+ interval = error.retryDelay(now(), Math.min(60000, interval + 5000));+ continue;+ }+ if (error.detail !== undefined) {+ if (await session.removeForLimit(error, options.chooseDevice))+ continue;+ throw new SignInError("Sign-in cancelled. No device was removed.");+ }+ if (["access_denied", "expired_token", "invalid_grant"].includes(error.code)) {+ throw new SignInError("Device sign-in was denied or expired. Run omo login again for a new code.");+ }+ throw error;+ }+ }+ throw new SignInError("Device sign-in expired. Run omo login again for a new code.");+}++// packages/omo-opencode/src/cli/service-auth/keystore.ts+import { createHash as createHash9 } from "crypto";+function credentialId(api) {+ return createHash9("sha256").update(serviceOrigin(api)).digest("hex");+}+function createCredentialStore(api, secrets = typeof Bun === "undefined" ? null : Bun.secrets, platform = process.platform) {+ 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.`);+ return {+ async read() {+ let value;+ try {+ value = await secrets.get(key);+ } catch {+ throw unavailable();+ }+ if (value === null)+ return null;+ try {+ return credentialSchema.parse(JSON.parse(value));+ } catch {+ throw new SignInError("Stored sign-in data is invalid. Run omo logout, then omo login.");+ }+ },+ async write(value) {+ try {+ await secrets.set({ ...key, value: JSON.stringify(credentialSchema.parse(value)) });+ } catch {+ throw unavailable();+ }+ },+ async clear() {+ try {+ await secrets.delete(key);+ } catch {+ throw unavailable();+ }+ }+ };+}++// packages/omo-opencode/src/cli/service-auth/loopback.ts+import { createHash as createHash10, randomBytes as randomBytes3, timingSafeEqual } from "crypto";+import { createServer as createServer3 } from "http";+class BrowserUnavailable extends SignInError {+}+async function authorize(options) {+ const verifier = randomBytes3(32).toString("base64url");+ const state = randomBytes3(32).toString("base64url");+ const answer = Promise.withResolvers();+ const abort = () => answer.reject(new SignInError("Browser sign-in cancelled or timed out."));+ let accepted = false;+ let origin = "";+ const server = createServer3((request, response) => {+ response.setHeader("cache-control", "no-store");+ response.setHeader("referrer-policy", "no-referrer");+ response.setHeader("content-type", "text/plain; charset=utf-8");+ const url = new URL(request.url ?? "/", origin);+ if (request.method !== "GET" || request.headers.host !== new URL(origin).host || url.origin !== origin || url.pathname !== "/callback" || request.headers.forwarded || request.headers["x-forwarded-for"]) {+ response.writeHead(404).end("Not found");+ return;+ }+ const code = url.searchParams.get("code");+ const suppliedState = Buffer.from(url.searchParams.get("state") ?? "");+ const expectedState = Buffer.from(state);+ if (accepted || url.searchParams.getAll("state").length !== 1 || suppliedState.length !== expectedState.length || !timingSafeEqual(suppliedState, expectedState) || url.searchParams.getAll("code").length !== 1 || !code) {+ response.writeHead(400).end("Invalid sign-in response");+ return;+ }+ accepted = true;+ response.writeHead(200).end("Return to the terminal to finish signing in.");+ answer.resolve(code);+ });+ try {+ await new Promise((resolve, reject) => {+ server.once("error", reject);+ server.listen(0, "127.0.0.1", () => {+ server.off("error", reject);+ resolve();+ });+ });+ const address = server.address();+ if (!address || typeof address === "string")+ throw new SignInError("Unable to start the sign-in callback.");+ origin = `http://127.0.0.1:${address.port}`;+ const url = new URL(serviceOrigin(options.accounts));+ url.search = new URLSearchParams({+ redirect_uri: `${origin}/callback`,+ code_challenge: createHash10("sha256").update(verifier).digest("base64url"),+ code_challenge_method: "S256",+ state+ }).toString();+ const timer = setTimeout(abort, 5 * 60000);+ options.signal?.addEventListener("abort", abort, { once: true });+ try {+ options.signal?.throwIfAborted();+ const openerFailed = () => {+ if (!accepted)+ throw new BrowserUnavailable("No browser is available; use device sign-in.");+ };+ const [code] = await Promise.all([+ answer.promise,+ options.open(url.href).then((opened) => {+ if (!opened)+ openerFailed();+ }, openerFailed)+ ]);+ return { code, codeVerifier: verifier };+ } finally {+ clearTimeout(timer);+ options.signal?.removeEventListener("abort", abort);+ }+ } finally {+ server.closeAllConnections();+ await new Promise((resolve) => server.close(() => resolve()));+ }+}+async function loginLoopback(session, options) {+ await session.ready();+ const keys = generateDeviceKeys();+ for (;; ) {+ const authorization = await authorize({ accounts: options.accounts, open: options.open, signal: session.signal });+ try {+ const grant = parseReply(grantSchema, await session.request("/v1/session/exchange", jsonRequest({+ ...authorization,+ kind: "cli",+ deviceName: options.name,+ platform: options.platform,+ ...keys.public+ })));+ await session.save({ ...grant, ...keys.private });+ return;+ } catch (error) {+ if (await session.removeForLimit(error, options.chooseDevice))+ continue;+ throw new SignInError("Sign-in cancelled. No device was removed.");+ }+ }+}++// packages/omo-opencode/src/cli/service-auth/session.ts+import { mkdir as mkdir10 } from "fs/promises";+import { homedir as homedir27 } from "os";+import { join as join97 } from "path";++// packages/team-core/src/team-state-store/lock-publish.ts+import { access as access3, open as open2, unlink as unlink2 } from "fs/promises";+import { dirname as dirname38 } from "path";++// packages/team-core/src/team-state-store/lock-record.ts+import { randomUUID as randomUUID4 } from "crypto";+import { readFile as readFile33, stat as stat8 } from "fs/promises";+var lockOwnerInstanceId = randomUUID4();+var heldLockRecords = new Set;+function buildLockRecord(ownerTag) {+ return `${ownerTag} ${randomUUID4()}+${process.pid}+${Date.now()}+${lockOwnerInstanceId}+`;+}+function markLockRecordHeld(content) {+ heldLockRecords.add(content);+}+function markLockRecordReleased(content) {+ heldLockRecords.delete(content);+}+function errorCode(error) {+ if (!(error instanceof Error) || !("code" in error))+ return null;+ return typeof error.code === "string" ? error.code : null;+}+function isPathAbsenceError(error) {+ const code = errorCode(error);+ return code === "ENOENT" || code === "ENOTDIR";+}+function parseLockOwner(content) {+ const lines = content.split(/\r?\n/).filter((line) => line.length > 0);+ if (lines.length !== 3 && lines.length !== 4)+ return null;+ const ownerPid = Number.parseInt(lines[1] ?? "", 10);+ const acquiredAtEpochMs = Number.parseInt(lines[2] ?? "", 10);+ if (!Number.isInteger(ownerPid) || ownerPid <= 0)+ return null;+ if (!Number.isInteger(acquiredAtEpochMs) || acquiredAtEpochMs <= 0)+ return null;+ return {+ ownerPid,+ acquiredAtEpochMs,+ instanceId: lines.length === 4 ? lines[3] ?? null : null+ };+}+function isPidAlive(pid) {+ try {+ process.kill(pid, 0);+ return true;+ } catch (error) {+ if (!(error instanceof Error)) {+ throw error;+ }+ return false;+ }+}+async function readLockRecord(lockPath) {+ try {+ const content = await readFile33(lockPath, "utf8");+ const { mtimeMs } = await stat8(lockPath);+ return { content, modifiedAtEpochMs: mtimeMs };+ } catch (error) {+ if (!(error instanceof Error))+ throw error;+ return null;+ }+}+function isLockRecordStale(record, staleAfterMs) {+ const owner = parseLockOwner(record.content);+ if (owner === null)+ return Date.now() - record.modifiedAtEpochMs > staleAfterMs;+ if (owner.instanceId !== null && owner.ownerPid === process.pid) {+ return owner.instanceId !== lockOwnerInstanceId || !heldLockRecords.has(record.content);+ }+ if (isPidAlive(owner.ownerPid))+ return false;+ if (owner.instanceId !== null)+ return true;+ return Date.now() - owner.acquiredAtEpochMs > staleAfterMs;+}++// packages/team-core/src/team-state-store/lock-publish.ts+async function pathMayExist(path, deps = {}) {+ const accessPath = deps.access ?? access3;+ try {+ await accessPath(path);+ return true;+ } catch (error) {+ if (!(error instanceof Error))+ throw error;+ return !isPathAbsenceError(error);+ }+}+async function assertRetryableLockOpenError(lockPath, error, deps) {+ const code = errorCode(error);+ if (code === "EEXIST")+ return;+ if (code === "EPERM") {+ if (await pathMayExist(lockPath, deps))+ return;+ if ((deps?.platform ?? process.platform) === "win32" && await pathMayExist(dirname38(lockPath), deps))+ return;+ }+ throw error;+}+async function publishLockRecord(lockPath, record) {+ markLockRecordHeld(record);+ let fileHandle;+ try {+ fileHandle = await open2(lockPath, "wx");+ } catch (error) {+ markLockRecordReleased(record);+ await assertRetryableLockOpenError(lockPath, error);+ return false;+ }+ try {+ await fileHandle.writeFile(record);+ } catch (error) {+ markLockRecordReleased(record);+ await fileHandle.close();+ await unlink2(lockPath).catch(() => {+ return;+ });+ throw error;+ }+ await fileHandle.close();+ return true;+}++// packages/team-core/src/team-state-store/lock-reclaim.ts+import { createHash as createHash11 } from "crypto";+import { unlink as unlink3 } from "fs/promises";+var RECLAIM_UNLINK_ATTEMPTS = 3;+var RECLAIM_UNLINK_RETRY_MS = 25;+function delay2(ms) {+ return new Promise((resolve) => {+ setTimeout(resolve, ms);+ });+}+function reclaimGuardPath(lockPath, record) {+ return `${lockPath}.reclaim-${createHash11("sha256").update(record).digest("hex").slice(0, 16)}`;+}+async function unlinkWithRetry(path, deps) {+ const wait = deps.delay ?? delay2;+ const unlinkFile = deps.unlink ?? unlink3;+ for (let attempt = 1;; attempt += 1) {+ try {+ await unlinkFile(path);+ return "removed";+ } catch (error) {+ if (!(error instanceof Error))+ throw error;+ if (isPathAbsenceError(error))+ return "absent";+ const code = errorCode(error);+ if (code !== "EPERM" && code !== "EBUSY" || attempt === RECLAIM_UNLINK_ATTEMPTS)+ return "stuck";+ await wait(RECLAIM_UNLINK_RETRY_MS);+ }+ }+}+async function removeLockRecordIfUnchanged(lockPath, expectedRecord, staleAfterMs, deps = {}) {+ const guardPath = reclaimGuardPath(lockPath, expectedRecord);+ const guardRecord = buildLockRecord("lock-reclaim");+ if (!await publishLockRecord(guardPath, guardRecord)) {+ const guard = await readLockRecord(guardPath);+ if (guard !== null && isLockRecordStale(guard, staleAfterMs)) {+ await removeLockRecordIfUnchanged(guardPath, guard.content, staleAfterMs, deps);+ }+ return "busy";+ }+ try {+ const current = await readLockRecord(lockPath);+ if (current === null)+ return "absent";+ if (current.content !== expectedRecord || !isLockRecordStale(current, staleAfterMs))+ return "changed";+ const unlinked = await unlinkWithRetry(lockPath, deps);+ return unlinked === "absent" ? "absent" : unlinked;+ } finally {+ markLockRecordReleased(guardRecord);+ await unlinkWithRetry(guardPath, deps);+ }+}++// packages/team-core/src/team-state-store/locks.ts+var LOCK_RETRY_MS = 50;+var LOCK_WAIT_TIMEOUT_MS = 15000;+var DEFAULT_STALE_AFTER_MS = 300000;+function delay3(ms) {+ return new Promise((resolve) => {+ setTimeout(resolve, ms);+ });+}+async function acquireLock(lockPath, ownerTag, staleAfterMs) {+ const startedAt = Date.now();+ for (;; ) {+ if (Date.now() - startedAt > LOCK_WAIT_TIMEOUT_MS) {+ throw new Error(`Timed out acquiring lock: ${lockPath}`);+ }+ const record = buildLockRecord(ownerTag);+ if (await publishLockRecord(lockPath, record))+ return record;+ const outcome = await reapStaleLock(lockPath, staleAfterMs);+ if (outcome === "removed" || outcome === "absent")+ continue;+ await delay3(LOCK_RETRY_MS);+ }+}+async function withLock(lockPath, fn, opts) {+ const staleAfterMs = opts?.staleAfterMs ?? DEFAULT_STALE_AFTER_MS;+ const ownerTag = opts?.ownerTag ?? "owner";+ const record = await acquireLock(lockPath, ownerTag, staleAfterMs);+ try {+ return await fn();+ } finally {+ markLockRecordReleased(record);+ await removeLockRecordIfUnchanged(lockPath, record, staleAfterMs);+ }+}+async function reapStaleLock(lockPath, staleAfterMs = DEFAULT_STALE_AFTER_MS, deps = {}) {+ const observed = await readLockRecord(lockPath);+ if (observed === null)+ return "absent";+ if (!isLockRecordStale(observed, staleAfterMs))+ return "changed";+ return await removeLockRecordIfUnchanged(lockPath, observed.content, staleAfterMs, deps);+}++// packages/omo-opencode/src/cli/service-auth/session.ts+class SessionEnded extends SignInError {+ deviceRevoked;+ constructor(message, deviceRevoked) {+ super(message);+ this.deviceRevoked = deviceRevoked;+ }+}+var DEVICE_REVOKING_REFUSALS = new Set(["account_deleted", "reauth_required"]);+function createSession(options) {+ const api = serviceOrigin(options.api);+ const { store, signal } = options;+ const directory = join97(options.home ?? homedir27(), ".omo", "session-locks");+ const lockPath = join97(directory, `${credentialId(api)}.lock`);+ async function locked(action) {+ await mkdir10(directory, { recursive: true, mode: 448 });+ signal?.throwIfAborted();+ return withLock(lockPath, async () => {+ signal?.throwIfAborted();+ return action();+ }, { ownerTag: "cli-session", staleAfterMs: Number.POSITIVE_INFINITY });+ }+ const request = (path, init) => requestApi(api, path, init, signal);+ const uncertain = () => new SignInError("The refresh outcome is unknown. Saved credentials and keys were retained, but this refresh token will not be sent again. Retry sign-in with omo login.", true);+ async function refreshedAccess(current) {+ if (current.refreshState === "uncertain")+ throw uncertain();+ if (Date.parse(current.accessTokenExpiresAt) > Date.now() + 30000)+ return current.accessToken;+ await store.write({ ...current, refreshState: "uncertain" });+ try {+ const tokens = parseReply(tokenSchema, await request("/v1/session/refresh", jsonRequest({ refreshToken: current.refreshToken })));+ await store.write({ ...current, ...tokens });+ return tokens.accessToken;+ } 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));+ }+ if (error instanceof RequestFailure && error.notSent || error instanceof ApiRefusal && error.status === 429 && error.code === "rate_limited") {+ await store.write(current);+ throw error;+ }+ throw uncertain();+ }+ }+ return {+ request,+ signal,+ async ready() {+ await store.read();+ },+ async save(value) {+ await locked(() => store.write(value));+ },+ async logout() {+ return locked(async () => {+ try {+ const current = await store.read();+ if (current !== null) {+ if (current.refreshState === "uncertain")+ return false;+ const access = Date.parse(current.accessTokenExpiresAt) <= Date.now() ? await refreshedAccess(current) : current.accessToken;+ await request(`/v1/devices/${encodeURIComponent(current.device.id)}`, {+ method: "DELETE",+ headers: { authorization: `Bearer ${access}` }+ });+ }+ return true;+ } catch (error) {+ if (error instanceof SessionEnded)+ return error.deviceRevoked;+ if (error instanceof SignInError)+ return false;+ throw error;+ } finally {+ await store.clear();+ }+ });+ },+ async accessToken() {+ return locked(async () => {+ const current = await store.read();+ if (current === null)+ throw new SignInError("Not signed in. Run omo login.");+ return refreshedAccess(current);+ });+ },+ async removeForLimit(error, choose) {+ if (!(error instanceof ApiRefusal) || error.detail === undefined)+ throw error;+ const headers = { authorization: `Bearer ${error.detail.managementToken}` };+ const listed = parseReply(deviceListSchema, await request("/v1/devices", { headers }));+ const devices = listed.devices.filter((device) => device.revokedAt === null);+ const chosen = await choose(devices);+ if (chosen === null)+ return false;+ if (!devices.some((device) => device.id === chosen))+ throw new SignInError("No matching device was selected.");+ await request(`/v1/devices/${encodeURIComponent(chosen)}`, { method: "DELETE", headers });+ return true;+ }+ };+}++// packages/omo-opencode/src/cli/service-auth/commands.ts+async function ensureServiceAvailable(session, api) {+ try {+ await session.request("/v1/health", { method: "GET" });+ } catch (error) {+ if (!(error instanceof SignInError))+ throw error;+ if (error instanceof RequestFailure) {+ throw new SignInError(`Can't reach OmO accounts at ${api}. The service may not be available yet, or your network, proxy or certificate settings are blocking it.`);+ }+ throw new SignInError(`OmO accounts at ${api} aren't available right now. Try again later.`);+ }+}+function deviceChoices(devices) {+ return devices.map((device) => ({ value: device.id, label: terminalText(device.name) }));+}+var chooseDevice = async (devices) => {+ if (!process.stdin.isTTY || devices.length === 0) {+ console.error("Device limit reached. Run omo login in an interactive terminal to choose a device to remove.");+ return null;+ }+ const chosen = await select({+ message: "Device limit reached. Remove a device to sign in?",+ options: [{ value: "", label: "Cancel (keep all devices)" }, ...deviceChoices(devices)]+ });+ if (isCancel(chosen) || chosen === "")+ return null;+ const agreed = await confirm({ message: "Sign out the selected device?", initialValue: false });+ return agreed === true ? chosen : null;+};+async function run2(action, options) {+ const controller = new AbortController;+ const cancel = () => controller.abort();+ process.once("SIGINT", cancel);+ process.once("SIGTERM", cancel);+ try {+ const api = serviceOrigin(options.api ?? process.env.OMO_SERVICE_API_URL ?? "https://api.omo.dev");+ const store = createCredentialStore(api);+ const session = createSession({ api, store, signal: controller.signal });+ if (action === "logout") {+ const revoked = await session.logout();+ console.log("Signed out of OmO. Stored credentials and device keys were removed.");+ if (!revoked)+ console.error("Server device revocation could not be confirmed. Remove this device from the Devices page of your OmO account when connected.");+ return;+ }+ if (action === "whoami") {+ await session.accessToken();+ const saved = await store.read();+ console.log(saved ? `Signed in to ${api} as ${terminalText(saved.device.name)}.` : "Not signed in.");+ return;+ }+ await ensureServiceAvailable(session, api);+ const name = deviceName();+ const platform = devicePlatform();+ if (!options.device && options.browser !== false) {+ try {+ await loginLoopback(session, {+ accounts: serviceOrigin(options.accounts ?? process.env.OMO_SERVICE_ACCOUNTS_URL ?? "https://accounts.omo.dev"),+ name,+ platform,+ open: openSignInBrowser,+ chooseDevice+ });+ console.log("Signed in to OmO.");+ return;+ } catch (error) {+ if (!(error instanceof BrowserUnavailable))+ throw error;+ }+ }+ await loginDevice(session, {+ name,+ platform,+ chooseDevice,+ show: (code) => {+ console.log(`Open ${code.verificationUri}`);+ console.log(`User code: ${code.userCode}`);+ console.log(`Matching code: ${code.matchingCode}`);+ }+ });+ console.log("Signed in to OmO.");+ } catch (error) {+ console.error(controller.signal.aborted ? "Sign-in cancelled." : error instanceof SignInError ? error.message : "Unable to complete OmO sign-in. Check the OS credential store and try again.");+ process.exitCode = 1;+ } finally {+ process.removeListener("SIGINT", cancel);+ process.removeListener("SIGTERM", cancel);+ }+}+function configureServiceAuthCommands(program) {+ program.command("login").description("Sign in to OmO using the OS credential store").option("--device", "Use a device code instead of a browser callback").option("--no-browser", "Sign in by device code without opening a browser").option("--api <url>", "OmO API origin (or OMO_SERVICE_API_URL)").option("--accounts <url>", "OmO accounts origin (or OMO_SERVICE_ACCOUNTS_URL)").action((options) => run2("login", options));+ for (const action of ["logout", "whoami"]) {+ program.command(action).description(action === "logout" ? "Remove stored OmO credentials and device keys" : "Show the current OmO device sign-in").option("--api <url>", "OmO API origin (or OMO_SERVICE_API_URL)").action((options) => run2(action, options));+ }+}++// packages/omo-opencode/src/cli/install-command-options.ts+function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION_NAME) {+ const defaultPlatform = process.env.OMO_EDITION === "codex" || invocationName === "lazycodex" || invocationName === "lazycodex-ai" ? "codex" : undefined;+ const platform = options.platform ?? defaultPlatform;+ if (platform === "native-dev" && !isNativeDevPlatformEnabled()) {+ throw new Error(`The native-dev install platform is not available in this release. Set ${NATIVE_DEV_PLATFORM_ENV_FLAG}=1 to enable it from a source checkout.`);+ }+ return {+ tui: options.tui !== false,+ claude: options.claude,+ openai: options.openai,+ gemini: options.gemini,+ copilot: options.copilot,+ platform,+ opencodeZen: options.opencodeZen,+ zaiCodingPlan: options.zaiCodingPlan,+ kimiForCoding: options.kimiForCoding,+ opencodeGo: options.opencodeGo,+ bailianCodingPlan: options.bailianCodingPlan,+ minimaxCnCodingPlan: options.minimaxCnCodingPlan,+ minimaxCodingPlan: options.minimaxCodingPlan,+ vercelAiGateway: options.vercelAiGateway,+ codexAutonomous: options.codexAutonomous,+ skipAuth: options.skipAuth ?? false+ };+}+// packages/omo-opencode/src/cli/boulder/boulder.tsimport { existsSync as existsSync64 } from "fs";@@ -110464,11 +111381,11 @@ async function boulder(options) {// packages/omo-opencode/src/cli/codex-ulw-loop.tsimport { spawn as spawn5 } from "child_process";import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync11 } from "fs";-import { homedir as homedir27 } from "os";+import { homedir as homedir28 } from "os";var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";function resolveCodexUlwLoopCommand(input = {}) {const env = input.env ?? process.env;- const homeDir = input.homeDir ?? homedir27();+ const homeDir = input.homeDir ?? homedir28();const localComponentBin = resolveLocalUlwLoopBin(env, homeDir);if (localComponentBin !== null)return { executable: localComponentBin, argsPrefix: [] };@@ -110709,7 +111626,7 @@ function linkedWorktrees(records) {}// packages/omo-opencode/src/cli/worktree-sweep/sweep.tsimport { existsSync as existsSync66 } from "fs";-import { stat as stat8 } from "fs/promises";+import { stat as stat9 } from "fs/promises";import os7 from "os";import { normalize as normalize2 } from "path";@@ -110792,7 +111709,7 @@ async function isOlderThan(worktreePath, days, now) {if (days <= 0)return false;try {- const stats = await stat8(worktreePath);+ const stats = await stat9(worktreePath);return now - stats.mtimeMs > days * DAY_MS;} catch {return false;@@ -111009,31 +111926,6 @@ function runConfigMigrate(options = {}) {init_package();var VERSION3 = package_default.version;var program2 = new Command;-function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION_NAME) {- const defaultPlatform = process.env.OMO_EDITION === "codex" || invocationName === "lazycodex" || invocationName === "lazycodex-ai" ? "codex" : undefined;- const platform = options.platform ?? defaultPlatform;- if (platform === "native-dev" && !isNativeDevPlatformEnabled()) {- throw new Error(`The native-dev install platform is not available in this release. Set ${NATIVE_DEV_PLATFORM_ENV_FLAG}=1 to enable it from a source checkout.`);- }- return {- tui: options.tui !== false,- claude: options.claude,- openai: options.openai,- gemini: options.gemini,- copilot: options.copilot,- platform,- opencodeZen: options.opencodeZen,- zaiCodingPlan: options.zaiCodingPlan,- kimiForCoding: options.kimiForCoding,- opencodeGo: options.opencodeGo,- bailianCodingPlan: options.bailianCodingPlan,- minimaxCnCodingPlan: options.minimaxCnCodingPlan,- minimaxCodingPlan: options.minimaxCodingPlan,- vercelAiGateway: options.vercelAiGateway,- codexAutonomous: options.codexAutonomous,- skipAuth: options.skipAuth ?? false- };-}program2.name("oh-my-opencode").description("The ultimate OpenCode plugin - multi-model orchestration, LSP tools, and more").version(VERSION3, "-v, --version", "Show version number").helpOption("-h, --help", "Display help for command").addOption(new Option("--platform <platform>", `Install target platform: ${availableInstallPlatforms().join(", ")}`).choices(availableInstallPlatforms()).hideHelp()).enablePositionalOptions();program2.command("install").alias("setup").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").addOption(new Option("--platform <platform>", `Install target platform: ${availableInstallPlatforms().join(", ")}`).choices(availableInstallPlatforms())).option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--opencode-go <value>", "OpenCode Go subscription: no, yes (default: no)").option("--bailian-coding-plan <value>", "Bailian Coding Plan subscription: no, yes (default: no)").option("--minimax-cn-coding-plan <value>", "MiniMax Coding Plan (minimaxi.com) subscription: no, yes (default: no)").option("--minimax-coding-plan <value>", "MiniMax Coding Plan (minimax.io) subscription: no, yes (default: no)").option("--vercel-ai-gateway <value>", "Vercel AI Gateway: no, yes (default: no)").option("--codex-autonomous", "Configure Codex with approval never, full filesystem access, and network enabled").option("--no-codex-autonomous", "Leave existing Codex permission settings unchanged").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `Examples:@@ -111151,6 +112043,7 @@ program2.command("config").description("Manage unified OMO configuration").comma});configureRuntimeCommands(program2);program2.addCommand(createMcpOAuthCommand());+configureServiceAuthCommands(program2);function runCli() {program2.parse();}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.jsonindex a146d3bd..7572fa7f 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.29) Resetting Git Bash MCP Reminder",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex e0c16e00..29e4d0f1 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.29) Resetting LSP Diagnostics Cache",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 8ad40d80..4b7f939e 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.29) Resetting Project Rule Cache",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex cd5b0fdd..797388b0 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.29) Checking Comments",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 8bb3fa87..47d6f310 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.29) Checking LSP Diagnostics",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 9ba572e2..19849d5b 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.29) Checking Thread Title Hygiene",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 93e5201b..de1a6122 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.29) Matching Project Rules",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex e274102a..e4f4cdbc 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.29) Recording Spawn Admission",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 1318aaa4..61ec31a3 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.29) Enforcing Unlimited Goal Budget",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 88b7b074..f95f4426 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.29) Guarding Ulw-Loop Spawns",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex a2a79557..fdd42da6 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.29) Recommending Git Bash MCP",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 16df2e72..aa30ff0e 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.29) Checking Auto Update",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 5f5cf811..7f7442a3 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.29) Checking Bootstrap Provisioning"+ "statusMessage": "(OmO 5.1.30) Checking Bootstrap Provisioning"}]}diff --git a/plugins/omo/hooks/session-start-loading-project-rules.json b/plugins/omo/hooks/session-start-loading-project-rules.jsonindex 5c663d23..6aa0ba40 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.29) Loading Project Rules",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex fdad58cc..1190a060 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.29) Recording Session Telemetry",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 7bbfe244..1e321c19 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.29) Checking Ulw-Execute Continuation",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex cbb91f78..56d3e4a2 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.29) Checking Ulw-Loop Resume",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 7e292d74..2f688e2b 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.29) Verifying LazyCodex Executor Evidence",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex f31ba7ac..0d8ecb75 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.29) Checking Ultrawork Trigger",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 0e366019..51817ccf 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.29) Checking Ulw-Loop Steering",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 79b77355..9c441a18 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.29) Loading Project Rules",+ "statusMessage": "(OmO 5.1.30) 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.jsonindex 4e304716..552bc021 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.29",+ "version": "5.1.30","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "@sisyphuslabs/omo-codex-plugin",- "version": "5.1.29",+ "version": "5.1.30","workspaces": ["components/comment-checker","components/git-bash",@@ -95,7 +95,7 @@},"components/comment-checker": {"name": "@code-yeongyu/codex-comment-checker",- "version": "5.1.29",+ "version": "5.1.30","license": "MIT","bin": {"omo-comment-checker": "dist/cli.js"@@ -117,7 +117,7 @@},"components/git-bash": {"name": "@sisyphuslabs/codex-git-bash-hook",- "version": "5.1.29",+ "version": "5.1.30","bin": {"omo-git-bash-hook": "dist/cli.js"},@@ -131,7 +131,7 @@},"components/lazycodex-executor-verify": {"name": "@code-yeongyu/codex-lazycodex-executor-verify",- "version": "5.1.29",+ "version": "5.1.30","license": "MIT","bin": {"lazycodex-executor-verify": "dist/cli.js"@@ -149,7 +149,7 @@},"components/lsp": {"name": "@code-yeongyu/codex-lsp",- "version": "5.1.29",+ "version": "5.1.30","license": "MIT","dependencies": {"@code-yeongyu/lsp-daemon": "file:../../../../lsp-daemon",@@ -171,7 +171,7 @@},"components/rules": {"name": "@code-yeongyu/codex-rules",- "version": "5.1.29",+ "version": "5.1.30","license": "MIT","dependencies": {"picomatch": "^4.0.7"@@ -194,7 +194,7 @@},"components/teammode": {"name": "@sisyphuslabs/codex-teammode",- "version": "5.1.29",+ "version": "5.1.30","devDependencies": {"@types/node": "^26.6.2","@vitest/coverage-v8": "5.0.1",@@ -208,7 +208,7 @@},"components/telemetry": {"name": "@code-yeongyu/codex-telemetry",- "version": "5.1.29",+ "version": "5.1.30","license": "MIT","bin": {"omo-telemetry": "dist/cli.js"@@ -227,7 +227,7 @@},"components/ultrawork": {"name": "@code-yeongyu/codex-ultrawork",- "version": "5.1.29",+ "version": "5.1.30","license": "MIT","bin": {"omo-ultrawork": "dist/cli.js"@@ -246,7 +246,7 @@},"components/ulw-execute-continuation": {"name": "@code-yeongyu/codex-ulw-execute-continuation",- "version": "5.1.29",+ "version": "5.1.30","license": "MIT","bin": {"omo-ulw-execute-continuation": "dist/cli.js"@@ -264,7 +264,7 @@},"components/ulw-loop": {"name": "@code-yeongyu/codex-ulw-loop",- "version": "5.1.29",+ "version": "5.1.30","license": "MIT","bin": {"omo-ulw-loop": "dist/cli.js",diff --git a/plugins/omo/package.json b/plugins/omo/package.jsonindex 6fc03b71..72c0c874 100644--- a/plugins/omo/package.json+++ b/plugins/omo/package.json@@ -1,6 +1,6 @@{"name": "@sisyphuslabs/omo-codex-plugin",- "version": "5.1.29",+ "version": "5.1.30","description": "Aggregate Codex plugin root for OMO components.","type": "module","packageManager": "[email protected]",diff --git a/plugins/omo/scripts/auto-update-plan.mjs b/plugins/omo/scripts/auto-update-plan.mjsindex cfdb43b1..140c5730 100644--- a/plugins/omo/scripts/auto-update-plan.mjs+++ b/plugins/omo/scripts/auto-update-plan.mjs@@ -83,6 +83,7 @@ export function resolveLatestVersion(env) {encoding: "utf8",stdio: ["ignore", "pipe", "ignore"],timeout,+ windowsHide: true,});if (result.status !== 0) return undefined;const version = result.stdout.trim();@@ -96,6 +97,7 @@ export function defaultRunCommandForManualUpdate(command, args, options) {cwd: options.cwd,env: options.env,stdio: "inherit",+ windowsHide: true,});child.once("error", reject);child.once("close", (code) => {diff --git a/plugins/omo/scripts/auto-update.mjs b/plugins/omo/scripts/auto-update.mjsindex 750e944e..e99dbc4f 100644--- a/plugins/omo/scripts/auto-update.mjs+++ b/plugins/omo/scripts/auto-update.mjs@@ -224,6 +224,7 @@ export async function runAutoUpdateCheck({const result = spawnSync(invocation.command, invocation.args, {env: plan.env,stdio: "ignore",+ windowsHide: true,});const status = result.status ?? (result.error === undefined ? 0 : 1);await appendUpdateLog(env, now, "finished", { status });@@ -241,6 +242,7 @@ export async function runAutoUpdateCheck({env: plan.env,stdio: "ignore",detached: true,+ windowsHide: true,});await writeState(statePath, { lastAttemptedAt: now, lastStatus: "started", pendingNotice });await recordUpdateStartedNotice({ env, now, notices, pendingNotice, releaseNotes, plan });diff --git a/plugins/omo/scripts/build-bundled-mcp-runtimes.mjs b/plugins/omo/scripts/build-bundled-mcp-runtimes.mjsindex f9c5140f..c5d04bf1 100644--- a/plugins/omo/scripts/build-bundled-mcp-runtimes.mjs+++ b/plugins/omo/scripts/build-bundled-mcp-runtimes.mjs@@ -46,6 +46,7 @@ function buildRuntime(runtime) {cwd: runtime.packageRoot,shell: process.platform === "win32",stdio: "inherit",+ windowsHide: true,});if (install.error !== undefined) throw install.error;if (install.status !== 0) process.exit(install.status ?? 1);@@ -55,6 +56,7 @@ function buildRuntime(runtime) {cwd: runtime.packageRoot,shell: process.platform === "win32",stdio: "inherit",+ windowsHide: true,});if (result.error !== undefined) throw result.error;if (result.status !== 0) process.exit(result.status ?? 1);diff --git a/plugins/omo/scripts/build-components.mjs b/plugins/omo/scripts/build-components.mjsindex 448f2238..bac2c04e 100644--- a/plugins/omo/scripts/build-components.mjs+++ b/plugins/omo/scripts/build-components.mjs@@ -104,6 +104,7 @@ function runCaptured(command, args, cwd, label) {cwd,shell: process.platform === "win32",stdio: ["ignore", "pipe", "pipe"],+ windowsHide: true,});const chunks = [];child.stdout.on("data", (chunk) => chunks.push(chunk));diff --git a/plugins/omo/scripts/materialize-shared-upstreams.mjs b/plugins/omo/scripts/materialize-shared-upstreams.mjsindex bd166b29..d5af36d0 100644--- a/plugins/omo/scripts/materialize-shared-upstreams.mjs+++ b/plugins/omo/scripts/materialize-shared-upstreams.mjs@@ -1,5 +1,6 @@import { execFileSync } from "node:child_process";import { dirname, join } from "node:path";+import { setTimeout as sleep } from "node:timers/promises";import { fileURLToPath, pathToFileURL } from "node:url";import { isCliEntry } from "./entry-guard.mjs";@@ -18,23 +19,54 @@ const upstreamPaths = ["packages/shared-skills/upstreams/designpowers",];-function initSubmodules({ strict }) {+function describePinnedSubmodules() {+ const pins = new Map();try {- execFileSync("git", ["submodule", "update", "--init", "--recursive", ...upstreamPaths], {+ // The index is the source of the gitlinks used by submodule update, not a+ // remote branch or the (possibly missing) submodule working directory.+ const entries = execFileSync("git", ["ls-files", "--stage", "-z", "--", ...upstreamPaths], {cwd: repoRoot,- stdio: "inherit",+ encoding: "utf8",+ stdio: ["ignore", "pipe", "pipe"],+ windowsHide: true,});- return true;- } catch (error) {- const message = `[materialize-shared-upstreams] git submodule init failed: ${error instanceof Error ? error.message : String(error)}`;- if (strict) throw new Error(message);- process.stderr.write(`${message} - continuing without submodule refresh\n`);- return false;+ for (const entry of entries.split("\0")) {+ const match = /^160000 ([0-9a-f]{40,64}) 0\t(.+)$/.exec(entry);+ if (match) pins.set(match[2], match[1]);+ }+ } catch {+ // A diagnostic failure must not replace the original fetch error.+ }+ return upstreamPaths.map((path) => `${path}@${pins.get(path) ?? "unknown (pinned SHA unavailable)"}`).join(", ");+}++async function initSubmodules({ strict }) {+ const maxAttempts = 3;+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {+ try {+ execFileSync("git", ["submodule", "update", "--init", "--recursive", ...upstreamPaths], {+ cwd: repoRoot,+ stdio: "inherit",+ windowsHide: true,+ });+ return true;+ } catch (error) {+ if (attempt < maxAttempts) {+ const delayMs = 1000 * 2 ** (attempt - 1);+ process.stderr.write(`[materialize-shared-upstreams] git submodule init failed (attempt ${attempt}/${maxAttempts}); retrying in ${delayMs}ms\n`);+ await sleep(delayMs);+ continue;+ }+ const message = `[materialize-shared-upstreams] git submodule init failed after ${maxAttempts} attempts: ${error instanceof Error ? error.message : String(error)}; pinned submodules: ${describePinnedSubmodules()}`;+ if (strict) throw new Error(message, { cause: error });+ process.stderr.write(`${message} - continuing without submodule refresh\n`);+ return false;+ }}}export async function materializeSharedUpstreams({ strict }) {- initSubmodules({ strict });+ await initSubmodules({ strict });const { materializeFrontendRefs } = await import(pathToFileURL(materializeScript).href);const result = await materializeFrontendRefs({ strict });const { stageOmowrightRuntime } = await import(pathToFileURL(stageOmowrightScript).href);diff --git a/plugins/omo/skills/browser/SKILL.md b/plugins/omo/skills/browser/SKILL.mdindex 5388b1a0..c8965254 100644--- a/plugins/omo/skills/browser/SKILL.md+++ b/plugins/omo/skills/browser/SKILL.md@@ -11,7 +11,7 @@ One library, two engines. omowright ships inside this skill; choose the engine b|---|---|---|| A site the user is signed into, their open tabs, a form, a click-through, a screenshot, web QA, an extension popup | **attached** — the user's own browser through BrowserSkill | `connectBrowserSkill()` || A throwaway profile, bot-scoring evasion, a CAPTCHA, network interception, a QA flight trace, coordinate control, headless runs | **owned** — a browser your code launches | `connectPipe()` / `connectCloakProfile()` — [references/owned-engine/README.md](references/owned-engine/README.md) |-| Text out of a URL, a 403 bypass, a platform that blocks fetchers | neither | the `ultimate-browsing` skill |+| A 403/WAF host the attached engine cannot open, a platform with a native reader, an archive snapshot | neither | the `ultimate-browsing` skill |**Attached is the default,** because it is the only engine carrying the user's logins and the onlyone where a human is a single call away. Never substitute one engine for the other silently: ifdiff --git a/plugins/omo/skills/browser/runtime/omowright/manifest.json b/plugins/omo/skills/browser/runtime/omowright/manifest.jsonindex 2bd34087..faf94949 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": "b6b064fab277031c6c51f5a58b84b31040f9960bf767bf646adc0540c1d25c1b","page-bundle.js": "bfd51e8383cf47200d57387bbbed258bce5a3a3d00c38fc108034d2888e23f0c"},- "stagedAtUtc": "2026-10-09T17:48:56.946Z"+ "stagedAtUtc": "2026-10-11T14:45:32.080Z"}diff --git a/plugins/omo/skills/ultimate-browsing/SKILL.md b/plugins/omo/skills/ultimate-browsing/SKILL.mdindex f20dfda7..fb660903 100644--- a/plugins/omo/skills/ultimate-browsing/SKILL.md+++ b/plugins/omo/skills/ultimate-browsing/SKILL.md@@ -1,11 +1,11 @@---name: ultimate-browsing-description: "Renders, drives, and screenshots web pages: JS-rendered sources, clicks and forms, persistent logins, WAF-blocked hosts (platform-native readers, stealth Chrome), and the browsing lane of a research run, with screenshots as provenance. Not for plain search or unblocked static fetch."+description: "Reaches web pages the user's browser cannot open: WAF-blocked and bot-scored hosts, platform-native readers (Chinese and social platforms), archive snapshots with provenance, and a browser you own for stealth or throwaway profiles. Not for plain search, an unblocked static fetch, or a page the user's browser can open."---# Ultimate Browsing-Web access for everything a plain fetch cannot finish: a page that renders in JS, a click or a form, a screenshot, a login that must persist across pages, or a host that blocks generic fetchers (WAF / 403 / Cloudflare). Start at the cheapest tier that can do the job and climb only when it cannot:+Web access for the hosts the user's browser cannot open (WAF / 403 / Cloudflare / bot-scored pages) and for platforms with a native reader. Reading and interaction on a page the user's browser can open belong to the `browser` skill's attached engine, not here. Start at the cheapest tier that can reach the blocked host and climb only when it cannot:**Tier 1 — insane-search** (headless extraction + WAF bypass) -> **Tier 1.5 — agent-reach** (platform-native APIs, esp. Chinese platforms) -> **Tier 2 — a real browser** through omowright from js eval: 2a the owned engine (a browser your code launches, CloakBrowser for stealth), 2b the attached engine (the user's own signed-in browser).@@ -14,29 +14,27 @@ Web access for everything a plain fetch cannot finish: a page that renders in JS```User request|- +- extract text/data from a URL --------------------- TIER 1 insane-search+ +- a page the user's browser can open (read, click, screenshot, QA, login) NOT this skill (browser skill, attached engine)+ +- simple search query ------------------------------ NOT this skill (use web-search)+ |+- URL blocked / 403 / Cloudflare / WAF ------------- TIER 1 insane-search+- YouTube/Vimeo/TikTok subtitles or metadata ------- TIER 1 insane-search (yt-dlp)- +- read an article / blog / Reddit / HN / arXiv ----- TIER 1 insane-search+ +- archive snapshot of a dead or changed page ------- TIER 1 insane-search (surrogates, provenance-tagged)|+- Chinese platform (xhs/douyin/weibo/bilibili/v2ex/wechat) TIER 1.5 agent-reach+- podcast transcript / stock forum ----------------- TIER 1.5 agent-reach+- Twitter feed / LinkedIn profile / GitHub via CLI - TIER 1.5 agent-reach|- +- Tier 1/1.5 returned empty or partial ------------- TIER 2 2a owned engine -> 2b attached engine- +- click / fill form / scroll / interact ------------ TIER 2 2a owned engine -> 2b attached engine- +- screenshot / render / play video ----------------- TIER 2 2a owned engine -> 2b attached engine- +- login session across pages / the user's account --- TIER 2 2b attached engine (their browser)- +- test web app / QA / dogfood ---------------------- TIER 2 2a owned engine -> 2b attached engine- |- +- simple search query ------------------------------ NOT this skill (use web-search)+ +- Tier 1/1.5 returned empty or partial ------------- TIER 2 2a owned engine (stealth)+ +- a blocked host that also needs a click, a scroll or a screenshot TIER 2 2a owned engine+ +- the user's account on a host the owned engine cannot pass TIER 2 2b attached engine (their browser)```Read the matching reference before acting: [`references/insane-search/README.md`](references/insane-search/README.md), [`references/agent-reach/README.md`](references/agent-reach/README.md), or [`references/chrome-stealth.md`](references/chrome-stealth.md).## Tier 1 — insane-search (headless extraction)-**When**: content extraction, blocked-URL bypass, media metadata — no browser UI needed.+**When**: blocked-URL bypass, media metadata, archive surrogates — no browser UI needed.**Why first**: ~10x faster than a browser, no process spin-up; handles most "fetch this blocked page" requests via curl_cffi TLS impersonation, yt-dlp (1858 sites), official public APIs, mobile URL transforms, **Phase-2.5 surrogate archives** (Wayback / archive.today snapshots, provenance-tagged — see [`references/insane-search/cache-archive.md`](references/insane-search/cache-archive.md)), a key-gated Jina Reader (`JINA_API_KEY`), and a Playwright real-Chrome fallback. The engine lives **inside this skill** at `engine/` and is invoked as a module. Surrogate results are dated COPIES: a result whose `provenance` is `snapshot` must be reported with its `snapshot_timestamp`, never presented as the live page.```bash@@ -56,7 +54,7 @@ The full engine harness (rules R1-R7, the Phase 0 official-API index, the no-sit### Escalate to Tier 1.5 or Tier 2 when- The target is a Chinese / social platform with a native reader -> Tier 1.5.-- insane-search returns empty/partial, or the page needs JS interaction, a screenshot, a persistent login, or media playback -> Tier 2.+- insane-search returns empty/partial, or the blocked page needs JS interaction, a screenshot, or media playback -> Tier 2.## Tier 1.5 — agent-reach (platform-native readers)@@ -82,7 +80,7 @@ Routing table, per-platform auth (set `TWITTER_*` env vars, `gh auth login`, a t## Tier 2 — a real browser (real interaction)-**When**: real interaction is needed (clicks, forms, screenshots, video, persistent login), or Tier 1/1.5 failed.+**When**: Tier 1/1.5 failed on a blocked host, or that host needs interaction (clicks, scroll, screenshots, video). A page the user's browser can open is the `browser` skill's job, attached engine first.Both tiers are omowright, staged inside the `browser` skill and loaded from js eval:@@ -110,9 +108,9 @@ try {The rest of the surface (CUA coordinates, captcha solving, routes, traces, frames, human handoff) is in the `browser` skill's `references/owned-engine/`. A stealth binary is not proof of access: inspect the rendered result and report challenges that remain.-### Tier 2b — attached engine (logged-in pages)+### Tier 2b — attached engine (the user's account on a blocked host)-When the page needs the user's account, drive the browser they are already signed into instead of cloning their profile: `connectBrowserSkill()` → `session.navigate` → `bskSnapshot(session)` / `session.observe()` → `session.click` → `session.stop()`. NEVER launch against or clear cookies/cache/site data from the user's live profile, and never fall back to the owned engine for an authenticated criterion: if no extension is connected, run the `browser` skill's onboarding script and relay its one human step. The full loop is the `browser` skill.+When the blocked flow needs the user's account, drive the browser they are already signed into instead of cloning their profile: `connectBrowserSkill()` → `session.navigate` → `bskSnapshot(session)` / `session.observe()` → `session.click` → `session.stop()`. NEVER launch against or clear cookies/cache/site data from the user's live profile, and never fall back to the owned engine for an authenticated criterion: if no extension is connected, run the `browser` skill's onboarding script and relay its one human step. The full loop is the `browser` skill.### Cookie login (cross-platform)diff --git a/plugins/omo/skills/ulw-research/SKILL.md b/plugins/omo/skills/ulw-research/SKILL.mdindex 83f4396c..64a90c36 100644--- a/plugins/omo/skills/ulw-research/SKILL.md+++ b/plugins/omo/skills/ulw-research/SKILL.md@@ -88,7 +88,7 @@ Saturation research defaults to teammode, not isolated fire-and-forget workers:## Worker ground rules-Research workers (explore, librarian, browsing) differ by harness, but assume:+Research workers (explore, web, repo-dive) differ by harness, but assume:- **Read-only.** Most research workers cannot write files. Never ask a worker to write the journal or any session file — every journal write is yours.- **No recursion — workers AND members.** Workers cannot spawn their own subagents, and team members must not re-orchestrate: a member researches its axis and reports; it never stands up its own team, loads this skill, or fans out a research swarm of its own. Depth comes from YOUR expansion waves. Say so in every spawn message — a member that starts its own research protocol burns the run's budget on duplicated orchestration and returns nothing you can cite.@@ -121,11 +121,13 @@ Before spawning anything, decompose the query. Start from "what must be true if<analysis>Core question: <the actual information need>Axes (3+ orthogonal): <axis — what to search, where, why> ...-Codebase relevant: <yes/no> · External: <yes/no> · Browsing: <yes/no> · Verification likely: <yes/no>+Codebase relevant: <yes/no> · External: <yes/no> · Collection: <search-only | browser> · Verification likely: <yes/no>Scale: <axis count, source territories, target document length> · Precision demand: <what a wrong claim costs here> → lifecycle: <single team | research team then refinement team></analysis>```+`Collection` is `search-only` only when a result snippet settles every axis (a date, a version, a spec value); anything that needs reading a source is `browser`.+Then create the session directory:```bash@@ -171,26 +173,23 @@ Otherwise launch the entire first wave in one turn — every axis at once, as teScaling floor — more angles always justify more workers:-| Query scope | explore | librarian | browsing | repo-dive | floor |-|---|---|---|---|---|---|-| Single topic, codebase only | 3 | 0 | 0 | 0 | 3 |-| Single topic, web only | 0 | 4 | 1 | 1 | 6 |-| Single topic, both | 2 | 3 | 1 | 1 | 7 |-| Multi-faceted | 4 | 6 | 2 | 2 | 14 |-| Full due diligence | 4 | 6 | 3 | 2 | 15 |--The browsing column is BINDING, not advisory: when the brief says `Browsing: yes`, the roster names a browsing-worker angle, armed with the `ultimate-browsing` skill, before the first wave launches, and that worker is spawned in the same turn as the rest of the wave. A run that reaches wave 2 with zero browsing workers on a `Browsing: yes` brief has silently downgraded every source to what plain fetch happened to return.+| Query scope | explore | web | repo-dive | floor |+|---|---|---|---|---|+| Single topic, codebase only | 3 | 0 | 0 | 3 |+| Single topic, web only | 0 | 5 | 1 | 6 |+| Single topic, both | 2 | 4 | 1 | 7 |+| Multi-faceted | 4 | 8 | 2 | 14 |+| Full due diligence | 4 | 9 | 2 | 15 |**Disambiguate before you expand.** When the topic names something that could resolve several ways — a product, a person, a codename, a version — the first wave settles WHICH entity before any worker researches its history, benchmarks, or controversies: canonical name, first-party URL or account, whether it exists in the claimed category, and a confidence line. An unresolved entity never becomes a premise in a later wave's spawn message; that is exactly how a run starts inventing facts about something that does not exist.Role protocols — embed the relevant one in each spawn message; every worker gets a unique angle:- **Codebase (explore), 2-4 workers.** Grep with 3+ keyword variations; structural/AST search; LSP definitions and references; file-name globs; `git log --all -S '<keyword>'` and `--grep` for history including deleted code. Cross-validate hits across tools. Report absolute file paths, patterns with `file:line`, and how findings connect.-- **Web (librarian), 3-6 workers.** At least 10 distinct websearch queries per worker, each with a different operator or angle (see Search craft); fetch the full page for every result that matters — snippets lie. Context7 with 3+ queries per known library. grep.app and `gh search code|repos|issues` for real-world usage. Official docs via sitemap discovery (`<base>/sitemap.xml`), then targeted pages.-- **Browsing, 1-3 workers on a `Browsing: yes` brief (0 otherwise), every one loaded with the `ultimate-browsing` skill.** The skill owns the routing — the harness's own browser first, then its extraction engine with archive surrogates, platform-native readers, and Chrome stealth as each source demands; the worker owns the deliverable. This worker RENDERS pages, it does not re-fetch them: its standing deliverable is a full-page screenshot of every top source plus the rendered text plain fetch could not reach; a worker that returns only fetched text has not done its job. JS-rendered, login-gated, WAF-blocked, and screenshot-bearing sources all belong here rather than in the web lane. **Provenance is part of the claim**: when a source came back with `provenance` of `snapshot` (an archive copy), cite it with its `snapshot_timestamp` and never state it as the current live page; content from a `proxy` route is `untrusted` and needs a second independent route before any claim rests on it. When one blocked territory hides many leads, fan out more browsing subagents in parallel for breadth instead of serializing one worker through them.+- **Web, 3-9 workers, every one loaded with the `browser` skill.** Search with 10+ websearch queries per worker, each with a different operator or angle (see Search craft); a result is a candidate, not a source. Read every candidate in the user's browser through the `browser` skill's attached engine: one named session per worker, one tab per source, several tabs open side by side while sources are compared — `session.tabCreate` / `tabSelect` / `tabClose` where the harness has a JS eval kernel, `bsk tab create --url <url>` / `tab select <id>` / `tab close <id>` / `tab list` on the CLI — the page scrolled to its end, a full-page screenshot of each top source saved as provenance, the tab closed once reported. A browser on another machine is reached through the `browser` skill's remote reference or a user-level skill that bridges to it, never replaced by a local headless one. `webfetch` is for raw files only: PDF, JSON, feeds, sitemaps. A host the browser cannot open (WAF, bot score, 403) goes to `ultimate-browsing`, whose provenance travels with the claim: a `snapshot` result cites its `snapshot_timestamp` and is never stated as the live page; a `proxy` result is `untrusted` until a second independent route agrees. Context7 with 3+ queries per known library; grep.app and `gh search code|repos|issues` for real-world usage; official docs via sitemap discovery (`<base>/sitemap.xml`), then targeted pages. A worker whose sources are all fetched text has searched, not read.- **Repo deep-dive (librarian), 0-2 workers.** Shallow-clone the most relevant repos to `${TMPDIR:-/tmp}`, pin the HEAD SHA, read core modules, follow call chains, return SHA-pinned permalinks.-Example spawn (codebase axis; librarian, browsing, and repo-dive follow the same contract with their own protocol):+Example spawn (codebase axis; web and repo-dive follow the same contract with their own protocol):```task(subagent_type="explore", run_in_background=true, prompt="TASK: act as a codebase researcher. AXIS: <specific angle>.@@ -209,9 +208,9 @@ This loop is what makes the mode research rather than search. Collect returns as3. Spawn an expansion worker immediately for each new unchecked lead:```-task(subagent_type="librarian", run_in_background=true, prompt="TASK: expansion wave <N> — investigate: <lead>.+task(category="deep-low", load_skills=["browser"], run_in_background=true, prompt="TASK: expansion wave <N> — investigate: <lead>.PARENT: <which return surfaced it>. This is an explicit exhaustive-research assignment; budgets do not apply.-<role protocol for the lead's territory — librarian protocol for external leads, explore protocol for codebase leads>+<role protocol for the lead's territory — web protocol for external leads, explore protocol for codebase leads>End your reply with the ## EXPAND tail.")```@@ -333,7 +332,7 @@ Asset workers (background, parallel, each fed `design-spec.md`) — visuals are- **Charts for every quantitative finding, computed from real data.** Pull the numbers into an actual table first (CSV/JSON under `$SESSION_DIR`), then plot from that table, never from prose. Follow the data-scientist tool doctrine — numpy always, Polars for filtering/sorting/transforms, DuckDB for joins/aggregations/window functions, never pandas — and load the `data-scientist` skill when this session has it: `uv run --with numpy --with polars --with duckdb --with pyarrow --with matplotlib python`. Keep `pyarrow` in that set — the DuckDB-to-Polars handoff (`.pl()`) fails without it, and `.df()` fails without pandas, so hand data across through `.pl()`, never `.df()`. Save to `$SESSION_DIR/assets/`.- **Mermaid graphs** for process, architecture, argument, timeline, and evidence-flow structure, themed to the spec's fonts and palette. Render each to SVG and confirm the file exists before the document references it.- **Generated visuals through the imagegen skill whenever the session has it:** a cover plus a concept illustration per major theme, prompted from the spec's style, palette, and mood — document-styled illustration, never generic stock art dropped into a designed page.-- **Full-page screenshots** of the top 5-10 sources (browsing worker) as provenance you can show.+- **Full-page screenshots** of the top 5-10 sources, saved by the web workers while reading, as provenance you can show.**Verify the asset manifest before rendering.** List every asset the document references, assert each file exists and is non-empty on disk, and re-render whatever is missing. A document that renders with three broken diagrams is a document you will publish twice.@@ -391,7 +390,7 @@ High-yield combinations: official docs (`site:<docs domain>`), GitHub implementa| Obeying a surrounding "stop exploring" rule mid-research | Authority section — those rules do not bind this mode || Asking a worker to write journal or session files | Workers are read-only; you journal every return || Two workers given the same angle | One unique angle per worker, always |-| A `Browsing: yes` run whose roster carries no browsing worker, or a browsing worker spawned without `ultimate-browsing` | The browsing column is binding — name the angle in the brief and spawn it, armed with the skill, in the first wave before any lead is chased |+| A web worker that returned only fetched text, or a `Collection: browser` run whose workers never opened a tab | Sources are read in the user's browser through the `browser` skill; `webfetch` is for raw files; every web worker carries the skill from the first wave || Contested claim settled by judgment | Phase 3 — run code, capture output, verdict || Deliverable claims without citations | Every claim cites a source or a verification artifact || Guessing the deliverable format | Derive it from the request and destination; ask the empty-info interview only for what is still missing, and record `answered_by` for every field |diff --git a/plugins/omo/test/materialize-shared-upstreams.test.mjs b/plugins/omo/test/materialize-shared-upstreams.test.mjsnew file mode 100644index 00000000..0f2d55ed--- /dev/null+++ b/plugins/omo/test/materialize-shared-upstreams.test.mjs@@ -0,0 +1,179 @@+import assert from "node:assert/strict";+import { spawnSync } from "node:child_process";+import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";+import { tmpdir } from "node:os";+import { dirname, join } from "node:path";+import test from "node:test";+import { fileURLToPath, pathToFileURL } from "node:url";++const scripts = join(dirname(fileURLToPath(import.meta.url)), "..", "scripts");++// Drive the shipped CLI in a disposable layout. Only external Git results and+// backoff time are controlled; no test-only export or option is added to it.+function runCli(t, { failures = 0, strict = true, strictEnv = false, skip = false, pins = "valid" } = {}) {+ const root = realpathSync(mkdtempSync(join(tmpdir(), "omo-materialize-retry-")));+ t.after(() => rmSync(root, { recursive: true, force: true }));+ const entry = join(root, "packages", "omo-codex", "plugin", "scripts");+ const shared = join(root, "packages", "shared-skills");+ mkdirSync(entry, { recursive: true });+ mkdirSync(join(shared, "scripts"), { recursive: true });+ for (const name of ["materialize-shared-upstreams.mjs", "entry-guard.mjs"]) {+ copyFileSync(join(scripts, name), join(entry, name));+ }+ writeFileSync(join(shared, "scripts", "materialize-frontend-refs.mjs"),+ 'export async function materializeFrontendRefs({ strict }) { globalThis.record({ op: "materialize", strict }); return { skipped: false }; }\n');+ writeFileSync(join(shared, "stage-omowright-runtime.mjs"),+ 'export async function stageOmowrightRuntime() { globalThis.record({ op: "stage" }); return { version: "fixture" }; }\n');+ const trace = join(root, "trace.json");+ writeFileSync(trace, "[]");+ const preload = join(root, "git-fixture.mjs");+ writeFileSync(preload, `+import childProcess from "node:child_process";+import timers from "node:timers/promises";+import { syncBuiltinESMExports } from "node:module";+import { writeFileSync } from "node:fs";+const events = [];+const realSleep = timers.setTimeout;+let attempts = 0;+let paths = [];+globalThis.record = (event) => {+ events.push(event);+ writeFileSync(${JSON.stringify(trace)}, JSON.stringify(events));+};+childProcess.execFileSync = (command, args, options) => {+ if (command !== "git") throw new Error("unexpected command: " + command);+ record({ op: args[0], args, cwd: options.cwd, windowsHide: options.windowsHide });+ if (args[0] === "submodule") {+ paths = args.slice(4);+ if (++attempts <= ${failures}) throw new Error("fixture fetch unavailable");+ return Buffer.alloc(0);+ }+ if (args[0] !== "ls-files") throw new Error("unexpected Git operation");+ if (${JSON.stringify(pins)} === "error") throw new Error("fixture index unavailable");+ return paths.map((path, i) => {+ const mode = ${JSON.stringify(pins)} === "invalid" ? "100644" : "160000";+ const stage = ${JSON.stringify(pins)} === "unmerged" ? "2" : "0";+ const sha = String(i + 1).repeat(${JSON.stringify(pins)} === "sha256" ? 64 : 40);+ return mode + " " + sha + " " + stage + "\\t" + path + "\\0";+ }).join("");+};+timers.setTimeout = async (ms) => {+ record({ op: "sleep", ms });+ await realSleep(15);+ record({ op: "wake", ms });+};+syncBuiltinESMExports();+`);+ const env = { ...process.env };+ delete env.NODE_OPTIONS;+ delete env.OMO_SKIP_MATERIALIZE;+ delete env.OMO_MATERIALIZE_STRICT;+ if (strictEnv) env.OMO_MATERIALIZE_STRICT = "1";+ if (skip) env.OMO_SKIP_MATERIALIZE = "1";+ const result = spawnSync(process.execPath, ["--import", pathToFileURL(preload).href, join(entry, "materialize-shared-upstreams.mjs"), ...(strict ? ["--strict"] : [])], {+ cwd: root, env, encoding: "utf8", windowsHide: true, timeout: 10000,+ });+ assert.ifError(result.error);+ assert.equal(result.signal, null, result.stderr);+ return { ...result, events: JSON.parse(readFileSync(trace, "utf8")), root };+}++const operations = (result) => result.events.map(({ op }) => op);+const attempts = (result) => result.events.filter(({ op }) => op === "submodule");+const delays = (result) => result.events.filter(({ op }) => op === "sleep").map(({ ms }) => ms);++function assertFetchContract(result, count) {+ assert.equal(attempts(result).length, count);+ for (const call of attempts(result)) {+ assert.deepEqual(call.args.slice(0, 4), ["submodule", "update", "--init", "--recursive"]);+ assert.equal(call.args.includes("--remote"), false);+ assert.equal(call.cwd, result.root);+ assert.equal(call.windowsHide, true);+ }+}++test("#given reachable pins #when strict materialization runs #then fetch once without backoff", (t) => {+ const r = runCli(t);+ assert.equal(r.status, 0, r.stderr);+ assertFetchContract(r, 1);+ assert.deepEqual(operations(r), ["submodule", "materialize", "stage"]);+});++test("#given one failed fetch #when strict materialization retries #then await recovery before staging", (t) => {+ const r = runCli(t, { failures: 1 });+ assert.equal(r.status, 0, r.stderr);+ assertFetchContract(r, 2);+ assert.deepEqual(delays(r), [1000]);+ assert.deepEqual(operations(r), ["submodule", "sleep", "wake", "submodule", "materialize", "stage"]);+});++test("#given two failed fetches #when the final attempt recovers #then stop retrying with bounded backoff", (t) => {+ const r = runCli(t, { failures: 2 });+ assert.equal(r.status, 0, r.stderr);+ assertFetchContract(r, 3);+ assert.deepEqual(delays(r), [1000, 2000]);+ assert.equal(r.events.filter(({ op }) => op === "materialize").length, 1);+ assert.equal(r.events.some(({ op }) => op === "ls-files"), false);+});++test("#given persistent fetch failure #when strict attempts exhaust #then fail with every path and pinned SHA", (t) => {+ const r = runCli(t, { failures: 9 });+ assert.equal(r.status, 1, r.stderr);+ assertFetchContract(r, 3);+ assert.deepEqual(delays(r), [1000, 2000]);+ assert.equal(r.events.some(({ op }) => op === "materialize" || op === "stage"), false);+ assert.match(r.stderr, /failed after 3 attempts/);+ assert.match(r.stderr, /fixture fetch unavailable/);+ const paths = attempts(r)[0].args.slice(4);+ paths.forEach((path, i) => assert.ok(r.stderr.includes(`${path}@${String(i + 1).repeat(40)}`), r.stderr));+ const lookup = r.events.find(({ op }) => op === "ls-files");+ assert.deepEqual(lookup.args, ["ls-files", "--stage", "-z", "--", ...paths]);+ assert.equal(lookup.cwd, r.root);+ assert.equal(lookup.windowsHide, true);+});++test("#given persistent fetch failure #when best-effort attempts exhaust #then warn and materialize once", (t) => {+ const r = runCli(t, { failures: 9, strict: false });+ assert.equal(r.status, 0, r.stderr);+ assertFetchContract(r, 3);+ assert.deepEqual(delays(r), [1000, 2000]);+ assert.deepEqual(operations(r).slice(-3), ["ls-files", "materialize", "stage"]);+ assert.match(r.stderr, /continuing without submodule refresh/);+ assert.equal(r.events.find(({ op }) => op === "materialize").strict, false);+});++test("#given an unreadable index #when retries exhaust #then preserve the original fetch failure and name paths", (t) => {+ const r = runCli(t, { failures: 9, pins: "error" });+ assert.equal(r.status, 1, r.stderr);+ assertFetchContract(r, 3);+ assert.match(r.stderr, /fixture fetch unavailable/);+ for (const path of attempts(r)[0].args.slice(4)) assert.ok(r.stderr.includes(`${path}@unknown`), r.stderr);+ assert.match(r.stderr, /pinned SHA unavailable/);+});++for (const pins of ["invalid", "unmerged"]) {+ test(`#given ${pins} index entries #when reporting failure #then do not invent resolved gitlink pins`, (t) => {+ const r = runCli(t, { failures: 9, pins });+ assert.equal(r.status, 1, r.stderr);+ for (const path of attempts(r)[0].args.slice(4)) assert.ok(r.stderr.includes(`${path}@unknown`), r.stderr);+ });+}++test("#given SHA-256 gitlinks #when retries exhaust #then retain complete pinned object IDs", (t) => {+ const r = runCli(t, { failures: 9, pins: "sha256" });+ assert.equal(r.status, 1, r.stderr);+ attempts(r)[0].args.slice(4).forEach((path, i) => assert.ok(r.stderr.includes(`${path}@${String(i + 1).repeat(64)}`), r.stderr));+});++test("#given strict mode from the environment #when retries exhaust #then fail before downstream materialization", (t) => {+ const r = runCli(t, { failures: 9, strict: false, strictEnv: true });+ assert.equal(r.status, 1, r.stderr);+ assertFetchContract(r, 3);+ assert.equal(r.events.some(({ op }) => op === "materialize"), false);+});++test("#given materialization was already performed #when skip is set #then perform no Git or materializer calls", (t) => {+ const r = runCli(t, { failures: 9, skip: true });+ assert.equal(r.status, 0, r.stderr);+ assert.deepEqual(r.events, []);+});diff --git a/plugins/omo/test/windows-console-hide.test.mjs b/plugins/omo/test/windows-console-hide.test.mjsnew file mode 100644index 00000000..8a8301dd--- /dev/null+++ b/plugins/omo/test/windows-console-hide.test.mjs@@ -0,0 +1,150 @@+import assert from "node:assert/strict";+import { readdirSync, readFileSync } from "node:fs";+import { dirname, join } from "node:path";+import test from "node:test";+import { fileURLToPath } from "node:url";++// Platform contract (#9838, same class as #7144 and #8501): plugin scripts run from Codex hooks, which+// have no console of their own. On Windows a console-subsystem child spawned there without windowsHide+// gets a FRESH console window; the detached `cmd.exe /c npm.cmd` auto-update got one on every update.+// This gate walks every plugin script and resolves the node:child_process entry points each file+// imports, so a new call site, or an exec*/fork call a spawn-only regex would miss, cannot ship+// unflagged. The flag is inert on posix, so the call text is the only place this is provable off Windows.+const ENTRY_POINTS = ["spawnSync", "spawn", "execFileSync", "execFile", "execSync", "exec", "fork"];++// Intentionally visible processes, or calls whose text cannot carry the literal flag, go here with a+// reason. None today.+const ALLOWLIST = [];++const scriptsDir = join(dirname(fileURLToPath(import.meta.url)), "..", "scripts");++// readdirSync returns backslash-separated entries on win32; matching on raw entries would silently+// find nothing there while the gate still looked green.+function toPosix(entry) {+ return entry.replaceAll("\\", "/");+}++function scriptSources() {+ return readdirSync(scriptsDir, { recursive: true, encoding: "utf8" })+ .map(toPosix)+ .filter((entry) => /\.(mjs|mts|js|cjs|ts)$/.test(entry))+ .sort();+}++function importedEntryPoints(source) {+ const locals = new Set();+ for (const [, clause] of source.matchAll(/import\s*\{([^}]*)\}\s*from\s*["'](?:node:)?child_process["']/g)) {+ for (const specifier of (clause ?? "").split(",")) {+ const [importedPart, aliasPart] = specifier.split(/\s+as\s+/);+ const imported = (importedPart ?? "").trim().replace(/^type\s+/, "");+ if (!ENTRY_POINTS.includes(imported)) continue;+ locals.add((aliasPart ?? imported).trim());+ }+ }+ return [...locals];+}++// A namespace, default or require import would hide calls from the named-import resolution above, so+// the gate refuses those forms instead of silently auditing nothing.+function unsupportedImportForms(source) {+ return [+ /import\s+\*\s+as\s+\w+\s+from\s*["'](?:node:)?child_process["']/,+ /import\s+\w+\s*(?:,\s*\{[^}]*\})?\s*from\s*["'](?:node:)?child_process["']/,+ /require\(\s*["'](?:node:)?child_process["']\s*\)/,+ ].filter((pattern) => pattern.test(source)).length;+}++function callText(source, openingParen) {+ let depth = 0;+ for (let index = openingParen; index < source.length; index += 1) {+ if (source[index] === "(") depth += 1;+ else if (source[index] === ")") {+ depth -= 1;+ if (depth === 0) return source.slice(openingParen, index + 1);+ }+ }+ return source.slice(openingParen);+}++// Comment prose names these functions too, so only the code spelling (identifier then `(`) on a+// non-comment line counts as a call.+function isCommentLine(source, offset) {+ const lineStart = source.lastIndexOf("\n", offset - 1) + 1;+ const lead = source.slice(lineStart, offset).trimStart();+ return lead.startsWith("//") || lead.startsWith("*") || lead.startsWith("/*");+}++function collectCalls(file, source) {+ const calls = [];+ for (const local of importedEntryPoints(source)) {+ for (const match of source.matchAll(new RegExp(String.raw`(?<![\w$.])${local}\(`, "g"))) {+ if (isCommentLine(source, match.index)) continue;+ calls.push({+ file,+ line: source.slice(0, match.index).split("\n").length,+ callee: local,+ text: `${local}${callText(source, match.index + match[0].length - 1)}`,+ });+ }+ }+ return calls;+}++function auditedCalls() {+ return scriptSources().flatMap((file) => collectCalls(file, readFileSync(join(scriptsDir, file), "utf8")));+}++function isAllowlisted(call) {+ return ALLOWLIST.some((entry) => entry.file === call.file && entry.callee === call.callee);+}++test("#given every plugin script child_process call #when inspected #then each passes windowsHide: true or is allowlisted with a reason", () => {+ const offenders = auditedCalls()+ .filter((call) => !/windowsHide:\s*true/.test(call.text) && !isAllowlisted(call))+ .map((call) => `${call.file}:${call.line} ${call.callee}`);++ assert.deepEqual(offenders, []);+});++test("#given every plugin script #when its child_process import is read #then it uses a form the gate can audit", () => {+ const unauditable = scriptSources().filter((file) => unsupportedImportForms(readFileSync(join(scriptsDir, file), "utf8")) > 0);++ assert.deepEqual(unauditable, []);+});++test("#given the audit #when it runs #then it still reaches the detached auto-update spawn it exists for", () => {+ const autoUpdate = auditedCalls().filter((call) => call.file === "auto-update.mjs" && call.callee === "spawn");++ assert.ok(autoUpdate.length > 0, "the gate no longer sees auto-update.mjs spawn calls");+});++test("#given the allowlist #when checked #then every entry has a reason and still matches a real call", () => {+ const calls = auditedCalls();+ const stale = ALLOWLIST.filter(+ (entry) => !entry.reason || !calls.some((call) => call.file === entry.file && call.callee === entry.callee),+ );++ assert.deepEqual(stale, []);+});++test("#given an aliased execFile import without the flag #when audited #then the call is reported, not skipped", () => {+ const source = ['import { execFile as run } from "node:child_process";', 'run("powershell.exe", args, { encoding: "utf8" }, callback);'].join("\n");++ const calls = collectCalls("fixture.mjs", source);++ assert.deepEqual(+ calls.map((call) => call.callee),+ ["run"],+ );+ assert.equal(/windowsHide:\s*true/.test(calls[0].text), false);+});++test("#given a namespace child_process import #when checked #then it is refused as unauditable", () => {+ assert.equal(unsupportedImportForms('import * as cp from "node:child_process";'), 1);+ assert.equal(unsupportedImportForms('const cp = require("child_process");'), 1);+ assert.equal(unsupportedImportForms('import { spawn } from "node:child_process";'), 0);+});++test("#given a win32 directory entry #when normalized #then it matches under POSIX separators", () => {+ assert.equal(toPosix("lib\\auto-update.mjs"), "lib/auto-update.mjs");+});