oh-my-opencode 5.1.78 → 5.1.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.de.md +0 -6
  2. package/README.es.md +0 -6
  3. package/README.fr.md +0 -6
  4. package/README.it.md +0 -6
  5. package/README.ja.md +0 -6
  6. package/README.ko.md +0 -5
  7. package/README.md +0 -6
  8. package/README.pt-br.md +0 -6
  9. package/README.ru.md +0 -6
  10. package/README.zh-cn.md +0 -6
  11. package/dist/cli/index.js +809 -302
  12. package/dist/cli/service-auth/commands.d.ts +3 -6
  13. package/dist/cli/service-auth/device-flow.d.ts +9 -1
  14. package/dist/cli/service-auth/device-name.d.ts +3 -3
  15. package/dist/cli/service-auth/devices.d.ts +17 -0
  16. package/dist/cli/service-auth/index.d.ts +5 -3
  17. package/dist/cli/service-auth/keychain-helper/fake-keychain.test-support.d.ts +1 -0
  18. package/dist/cli/service-auth/keystore.d.ts +10 -1
  19. package/dist/cli/service-auth/linux-store-route.d.ts +28 -0
  20. package/dist/cli/service-auth/login-prelude.d.ts +10 -0
  21. package/dist/cli/service-auth/secret-service-lock.d.ts +1 -0
  22. package/dist/cli/service-auth/session.d.ts +6 -5
  23. package/dist/cli/service-auth/state-file-cli.fixture.d.ts +1 -0
  24. package/dist/cli/service-auth/state-file-store.d.ts +38 -0
  25. package/dist/cli-node/index.js +809 -302
  26. package/dist/config/schema/keyword-detector.d.ts +1 -23
  27. package/dist/features/builtin-commands/templates/ulw-execute.d.ts +1 -1
  28. package/dist/hooks/ulw-execute/parse-user-request.d.ts +1 -0
  29. package/dist/hooks/ulw-execute/worktree-block.d.ts +2 -0
  30. package/dist/index.js +1786 -1753
  31. package/dist/skills/browser/runtime/omowright/manifest.json +1 -1
  32. package/dist/skills/programming/SKILL.md +1 -0
  33. package/dist/skills/ulw-execute/SKILL.md +15 -5
  34. package/dist/tools/delegate-task/builtin-categories.d.ts +1 -0
  35. package/dist/tools/delegate-task/categories.d.ts +2 -0
  36. package/dist/tools/delegate-task/category-prompt-append.d.ts +1 -0
  37. package/dist/tools/delegate-task/category-resolution-result.d.ts +15 -0
  38. package/dist/tools/delegate-task/category-resolver.d.ts +1 -14
  39. package/dist/tools/delegate-task/constants.d.ts +1 -1
  40. package/dist/tools/delegate-task/executor.d.ts +1 -1
  41. package/dist/tui.js +82 -67
  42. package/package.json +19 -16
  43. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  44. package/packages/omo-codex/plugin/README.md +1 -1
  45. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +83 -3
  46. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  47. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  48. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  49. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  50. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  51. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  52. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  53. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  54. package/packages/omo-codex/plugin/components/lcx/skills/lcx-doctor/SKILL.md +3 -3
  55. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
  56. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  57. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  58. package/packages/omo-codex/plugin/components/rules/README.md +1 -1
  59. package/packages/omo-codex/plugin/components/rules/dist/cli.js +6 -0
  60. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  61. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  62. package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +6 -0
  63. package/packages/omo-codex/plugin/components/rules/test/hephaestus-model-variant.test.ts +2 -2
  64. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +14 -23
  65. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  66. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  67. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  68. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  69. package/packages/omo-codex/plugin/components/ultrawork/README.md +1 -1
  70. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +1 -1
  71. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +1 -1
  72. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
  73. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +1 -1
  74. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +1 -1
  75. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-low.toml +1 -1
  76. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +1 -1
  77. package/packages/omo-codex/plugin/components/ultrawork/agents/metis.toml +1 -1
  78. package/packages/omo-codex/plugin/components/ultrawork/agents/momus.toml +1 -1
  79. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
  80. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  81. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  82. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +1 -1
  83. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  84. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  85. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  86. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  87. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  88. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  89. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  90. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  91. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  92. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  93. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  94. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  95. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  96. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  97. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  98. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  99. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  100. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  101. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  102. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  103. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  104. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  105. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  106. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  107. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  108. package/packages/omo-codex/plugin/model-catalog.json +14 -5
  109. package/packages/omo-codex/plugin/package-lock.json +12 -12
  110. package/packages/omo-codex/plugin/package.json +1 -1
  111. package/packages/omo-codex/plugin/scripts/migrate-codex-config/catalog.mjs +14 -5
  112. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
  113. package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +3 -3
  114. package/packages/omo-codex/plugin/skills/programming/SKILL.md +1 -0
  115. package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +15 -5
  116. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +10 -10
  117. package/packages/omo-codex/plugin/test/aggregate-model-catalog.test.mjs +7 -7
  118. package/packages/omo-codex/plugin/test/auto-update.test.mjs +2 -2
  119. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +44 -7
  120. package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +3 -3
  121. package/packages/omo-codex/scripts/install-dist/install-local.mjs +85 -5
  122. package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
  123. package/packages/shared-skills/skills/programming/SKILL.md +1 -0
  124. package/packages/shared-skills/skills/ulw-execute/SKILL.md +15 -5
@@ -2133,7 +2133,7 @@ var package_default;
2133
2133
  var init_package = __esm(() => {
2134
2134
  package_default = {
2135
2135
  name: "oh-my-opencode",
2136
- version: "5.1.78",
2136
+ version: "5.1.81",
2137
2137
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
2138
2138
  main: "./dist/index.js",
2139
2139
  types: "dist/index.d.ts",
@@ -2141,6 +2141,7 @@ var init_package = __esm(() => {
2141
2141
  workspaces: [
2142
2142
  "packages/rules-engine",
2143
2143
  "packages/delegate-core",
2144
+ "packages/thread-address-core",
2144
2145
  "packages/ast-grep-mcp",
2145
2146
  "packages/git-bash-mcp",
2146
2147
  "packages/mcp-stdio-core",
@@ -2285,8 +2286,8 @@ var init_package = __esm(() => {
2285
2286
  "test:model-capabilities": "bun test --timeout 20000 packages/model-core/src/model-capability-aliases.test.ts packages/model-core/src/model-capability-guardrails.test.ts packages/model-core/src/model-capabilities.test.ts packages/omo-opencode/src/cli/doctor/checks/model-resolution.test.ts --bail",
2286
2287
  "check:copy": "bun script/check-copy.ts",
2287
2288
  typecheck: "bun run check:copy && bun check --no-script --all -p tsconfig.json && bun run typecheck:script && bun run typecheck:packages && bun run typecheck:skill-scripts",
2288
- "typecheck:skill-scripts": "bun check --no-script --all -p packages/shared-skills/skills/frontend/scripts/detect/tsconfig.json",
2289
- "typecheck:packages": "bun check --no-script --all -p packages/rules-engine/tsconfig.json && bun check --no-script --all -p packages/delegate-core/tsconfig.json && bun check --no-script --all -p packages/mcp-stdio-core/tsconfig.json && bun check --no-script --all -p packages/mcp-client-core/tsconfig.json && bun check --no-script --all -p packages/git-bash-mcp/tsconfig.json && bun check --no-script --all -p packages/ast-grep-mcp/tsconfig.json && bun check --no-script --all -p packages/lsp-core/tsconfig.json && bun check --no-script --all -p packages/utils/tsconfig.json && bun check --no-script --all -p packages/device-service-core/tsconfig.json && bun check --no-script --all -p packages/model-core/tsconfig.json && bun check --no-script --all -p packages/omo-config-core/tsconfig.json && bun check --no-script --all -p packages/prompts-core/tsconfig.json && bun check --no-script --all -p packages/comment-checker-core/tsconfig.json && bun check --no-script --all -p packages/hashline-core/tsconfig.json && bun check --no-script --all -p packages/tmux-core/tsconfig.json && bun check --no-script --all -p packages/team-core/tsconfig.json && bun check --no-script --all -p packages/openclaw-core/tsconfig.json && bun check --no-script --all -p packages/boulder-state/tsconfig.json && bun check --no-script --all -p packages/isolation-core/tsconfig.json && bun check --no-script --all -p packages/memory-core/tsconfig.json && bun check --no-script --all -p packages/telemetry-core/tsconfig.json && bun check --no-script --all -p packages/claude-code-compat-core/tsconfig.json && bun check --no-script --all -p packages/skills-loader-core/tsconfig.json && bun check --no-script --all -p packages/agents-md-core/tsconfig.json && bun check --no-script --all -p packages/omo-codex/plugin/shared/tsconfig.json && bun check --no-script --all -p packages/omo-codex/tsconfig.json && bun check --no-script --all -p packages/omo-senpi/tsconfig.json && bun check --no-script --all -p packages/senpi-task/tsconfig.json && bun check --no-script --all -p packages/omo-opencode/tsconfig.json && bun check --no-script --all -p packages/omo-native/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-protocol/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-engine/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-prelude/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-sdk/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-service/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-tool/tsconfig.json && bun check --no-script --all -p packages/omo-computer-protocol/tsconfig.json && bun check --no-script --all -p packages/omo-computer-sdk/tsconfig.json && bun check --no-script --all -p packages/omo-computer-engine/tsconfig.json && bun check --no-script --all -p packages/omo-computer-hand/tsconfig.json && bun check --no-script --all -p packages/omo-computer-carriers/tsconfig.json && bun check --no-script --all -p packages/omo-computer-tool/tsconfig.json && bun check --no-script --all -p packages/omo-computer-prelude/tsconfig.json",
2289
+ "typecheck:skill-scripts": "bun check --no-script --all -p packages/shared-skills/skills/frontend/scripts/detect/tsconfig.json && bun check --no-script --all -p packages/omo-senpi/skills/omo-relay/scripts/sdk/tsconfig.json",
2290
+ "typecheck:packages": "bun check --no-script --all -p packages/rules-engine/tsconfig.json && bun check --no-script --all -p packages/delegate-core/tsconfig.json && bun check --no-script --all -p packages/thread-address-core/tsconfig.json && bun check --no-script --all -p packages/thread-address-core/tsconfig.test.json && bun check --no-script --all -p packages/mcp-stdio-core/tsconfig.json && bun check --no-script --all -p packages/mcp-client-core/tsconfig.json && bun check --no-script --all -p packages/git-bash-mcp/tsconfig.json && bun check --no-script --all -p packages/ast-grep-mcp/tsconfig.json && bun check --no-script --all -p packages/lsp-core/tsconfig.json && bun check --no-script --all -p packages/utils/tsconfig.json && bun check --no-script --all -p packages/device-service-core/tsconfig.json && bun check --no-script --all -p packages/model-core/tsconfig.json && bun check --no-script --all -p packages/omo-config-core/tsconfig.json && bun check --no-script --all -p packages/prompts-core/tsconfig.json && bun check --no-script --all -p packages/comment-checker-core/tsconfig.json && bun check --no-script --all -p packages/hashline-core/tsconfig.json && bun check --no-script --all -p packages/tmux-core/tsconfig.json && bun check --no-script --all -p packages/team-core/tsconfig.json && bun check --no-script --all -p packages/openclaw-core/tsconfig.json && bun check --no-script --all -p packages/boulder-state/tsconfig.json && bun check --no-script --all -p packages/isolation-core/tsconfig.json && bun check --no-script --all -p packages/memory-core/tsconfig.json && bun check --no-script --all -p packages/telemetry-core/tsconfig.json && bun check --no-script --all -p packages/claude-code-compat-core/tsconfig.json && bun check --no-script --all -p packages/skills-loader-core/tsconfig.json && bun check --no-script --all -p packages/agents-md-core/tsconfig.json && bun check --no-script --all -p packages/omo-codex/plugin/shared/tsconfig.json && bun check --no-script --all -p packages/omo-codex/tsconfig.json && bun check --no-script --all -p packages/omo-senpi/tsconfig.json && bun check --no-script --all -p packages/senpi-task/tsconfig.json && bun check --no-script --all -p packages/omo-opencode/tsconfig.json && bun check --no-script --all -p packages/omo-native/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-protocol/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-engine/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-prelude/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-sdk/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-service/tsconfig.json && bun check --no-script --all -p packages/senpi-desktop-tool/tsconfig.json && bun check --no-script --all -p packages/omo-computer-protocol/tsconfig.json && bun check --no-script --all -p packages/omo-computer-sdk/tsconfig.json && bun check --no-script --all -p packages/omo-computer-engine/tsconfig.json && bun check --no-script --all -p packages/omo-computer-hand/tsconfig.json && bun check --no-script --all -p packages/omo-computer-carriers/tsconfig.json && bun check --no-script --all -p packages/omo-computer-tool/tsconfig.json && bun check --no-script --all -p packages/omo-computer-prelude/tsconfig.json",
2290
2291
  "typecheck:script": "bun check --no-script --all -p script/tsconfig.json",
2291
2292
  test: "bun test --timeout 20000",
2292
2293
  "changelog:section": "bun script/changelog-section.ts",
@@ -2302,6 +2303,7 @@ var init_package = __esm(() => {
2302
2303
  "fmt:check": "bun fmt --no-script --check",
2303
2304
  "lint:ratchet": "bun script/lint-ratchet.ts",
2304
2305
  "knip:check": "knip --no-progress --no-config-hints",
2306
+ "qa:rpc-relay-parity": "bun script/qa/rpc-relay-parity-live.ts",
2305
2307
  "lint:ratchet:update": "bun script/lint-ratchet.ts --update",
2306
2308
  lint: "bun run check:copy && bun run fmt:check && oxlint packages/lsp-tools-mcp packages/lsp-daemon packages/web packages/omo-codex/plugin/components/comment-checker packages/omo-codex/plugin/components/lazycodex-executor-verify packages/omo-codex/plugin/components/lsp packages/omo-codex/plugin/components/rules packages/omo-codex/plugin/components/telemetry packages/omo-codex/plugin/components/ultrawork packages/omo-codex/plugin/components/ulw-execute-continuation packages/omo-codex/plugin/components/ulw-loop"
2307
2309
  },
@@ -2331,7 +2333,7 @@ var init_package = __esm(() => {
2331
2333
  },
2332
2334
  devDependencies: {
2333
2335
  "@clack/prompts": "^1.8.1",
2334
- "@code-yeongyu/senpi": "2026.11.18-2",
2336
+ "@code-yeongyu/senpi": "2026.11.19-5",
2335
2337
  "@modelcontextprotocol/sdk": "^1.30.0",
2336
2338
  "@oh-my-opencode/agents-md-core": "workspace:*",
2337
2339
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
@@ -2340,6 +2342,7 @@ var init_package = __esm(() => {
2340
2342
  "@oh-my-opencode/claude-code-compat-core": "workspace:*",
2341
2343
  "@oh-my-opencode/comment-checker-core": "workspace:*",
2342
2344
  "@oh-my-opencode/delegate-core": "workspace:*",
2345
+ "@oh-my-opencode/thread-address-core": "workspace:*",
2343
2346
  "@oh-my-opencode/git-bash-mcp": "workspace:*",
2344
2347
  "@oh-my-opencode/hashline-core": "workspace:*",
2345
2348
  "@oh-my-opencode/isolation-core": "workspace:*",
@@ -2404,18 +2407,18 @@ var init_package = __esm(() => {
2404
2407
  typescript: "^7.0.2"
2405
2408
  },
2406
2409
  optionalDependencies: {
2407
- "oh-my-opencode-darwin-arm64": "5.1.78",
2408
- "oh-my-opencode-darwin-x64": "5.1.78",
2409
- "oh-my-opencode-darwin-x64-baseline": "5.1.78",
2410
- "oh-my-opencode-linux-arm64": "5.1.78",
2411
- "oh-my-opencode-linux-arm64-musl": "5.1.78",
2412
- "oh-my-opencode-linux-x64": "5.1.78",
2413
- "oh-my-opencode-linux-x64-baseline": "5.1.78",
2414
- "oh-my-opencode-linux-x64-musl": "5.1.78",
2415
- "oh-my-opencode-linux-x64-musl-baseline": "5.1.78",
2416
- "oh-my-opencode-windows-arm64": "5.1.78",
2417
- "oh-my-opencode-windows-x64": "5.1.78",
2418
- "oh-my-opencode-windows-x64-baseline": "5.1.78"
2410
+ "oh-my-opencode-darwin-arm64": "5.1.81",
2411
+ "oh-my-opencode-darwin-x64": "5.1.81",
2412
+ "oh-my-opencode-darwin-x64-baseline": "5.1.81",
2413
+ "oh-my-opencode-linux-arm64": "5.1.81",
2414
+ "oh-my-opencode-linux-arm64-musl": "5.1.81",
2415
+ "oh-my-opencode-linux-x64": "5.1.81",
2416
+ "oh-my-opencode-linux-x64-baseline": "5.1.81",
2417
+ "oh-my-opencode-linux-x64-musl": "5.1.81",
2418
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.81",
2419
+ "oh-my-opencode-windows-arm64": "5.1.81",
2420
+ "oh-my-opencode-windows-x64": "5.1.81",
2421
+ "oh-my-opencode-windows-x64-baseline": "5.1.81"
2419
2422
  },
2420
2423
  overrides: {
2421
2424
  hono: "^4.13.8",
@@ -9607,46 +9610,28 @@ var init_category_model_requirements = __esm(() => {
9607
9610
  ]
9608
9611
  },
9609
9612
  ultrabrain: {
9613
+ requiresAnyModel: true,
9610
9614
  fallbackChain: [
9611
- { providers: ["openai", "chatgpt-subscription"], model: LATEST_MODEL_BY_FAMILY.gptAstra, variant: "max" },
9612
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-6-astra", variant: "max" },
9613
- { providers: ["github-copilot"], model: "gpt-6-astra", variant: "max" },
9614
9615
  {
9615
9616
  providers: ["openai", "chatgpt-subscription", "opencode"],
9616
9617
  model: LATEST_MODEL_BY_FAMILY.gptAstra,
9617
9618
  variant: "max"
9618
- },
9619
- { providers: ["openai", "chatgpt-subscription", "opencode"], model: "gpt-6-astra", variant: "max" },
9620
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-5.6-sol", variant: "max" },
9621
- { providers: ["github-copilot"], model: "gpt-5.6-sol", variant: "max" },
9622
- { providers: ["openai", "chatgpt-subscription", "opencode"], model: "gpt-5.6-sol", variant: "max" }
9619
+ }
9623
9620
  ]
9624
9621
  },
9625
9622
  "deep-low": {
9623
+ requiresAnyModel: true,
9626
9624
  fallbackChain: [
9627
- { providers: ["openai", "chatgpt-subscription"], model: LATEST_MODEL_BY_FAMILY.gptSol, variant: "medium" },
9628
- { providers: ["openai", "chatgpt-subscription"], model: LATEST_MODEL_BY_FAMILY.gptSolFast, variant: "medium" },
9629
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-6.1-sol", variant: "medium" },
9630
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-6.1-sol-fast", variant: "medium" },
9631
- {
9632
- providers: ["openai", "chatgpt-subscription", "github-copilot", "opencode"],
9633
- model: "gpt-5.6-sol",
9634
- variant: "medium"
9635
- },
9636
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-5.6-sol-fast", variant: "medium" }
9625
+ { providers: ["openai", "chatgpt-subscription"], model: LATEST_MODEL_BY_FAMILY.gptSol, variant: "medium" }
9637
9626
  ]
9638
9627
  },
9639
9628
  "deep-high": {
9629
+ requiresAnyModel: true,
9640
9630
  fallbackChain: [
9641
9631
  {
9642
9632
  providers: ["openai", "chatgpt-subscription", "opencode"],
9643
9633
  model: LATEST_MODEL_BY_FAMILY.gptAstra,
9644
9634
  variant: "high"
9645
- },
9646
- {
9647
- providers: ["openai", "chatgpt-subscription", "github-copilot", "opencode"],
9648
- model: "gpt-6-astra",
9649
- variant: "high"
9650
9635
  }
9651
9636
  ]
9652
9637
  },
@@ -11537,6 +11522,14 @@ var init_agent_display_names = __esm(() => {
11537
11522
  "athena-junior (council)": "athena-junior"
11538
11523
  };
11539
11524
  });
11525
+ // packages/omo-opencode/src/shared/model-requirements.ts
11526
+ var init_model_requirements2 = __esm(() => {
11527
+ init_src2();
11528
+ });
11529
+
11530
+ // packages/omo-opencode/src/shared/provider-model-id-transform.ts
11531
+ var init_provider_model_id_transform2 = () => {};
11532
+
11540
11533
  // packages/omo-opencode/src/tools/delegate-task/google-categories.ts
11541
11534
  var VISUAL_CATEGORY_PROMPT_APPEND = `<Category_Context>
11542
11535
  You are working on VISUAL/UI tasks.
@@ -11829,26 +11822,20 @@ You are working on tasks that don't fit specific categories but require moderate
11829
11822
  </Category_Context>`, UNSPECIFIED_LOW_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Use only when no specialist category fits, effort is moderate, and scope stays within a few files/modules. Prefer any matching specialist category.</Selection_Gate>
11830
11823
  <Caller_Warning>Provide explicit must-do steps, forbidden scope, and concrete success criteria.</Caller_Warning>`, UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND = `<Category_Context>
11831
11824
  You are working on tasks that don't fit specific categories but require substantial effort.
11832
- </Category_Context>`, UNSPECIFIED_HIGH_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Use only when no specialist category fits and substantial effort spans systems/modules with broad impact. Use unspecified-low for contained moderate work.</Selection_Gate>`, DEEP_LOW_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Of the two deep lanes this is the default: the child settles its decisions from what it reads. When unsure, choose deep-low; a misrouted child returns \`ESCALATE: deep-high\` after one cheap attempt, and you re-spawn the same brief as deep-high with its findings.</Selection_Gate>`, DEEP_HIGH_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Route here only when you can name the decision evidence cannot settle: a trade-off with no single right answer, a contract change crossing a package or process boundary, a mechanism with no in-repo pattern to copy, or correctness argued from invariants rather than observed in a test. Wide scope with easy decisions is deep-low or unspecified-high; reasoning as the deliverable is ultrabrain.</Selection_Gate>`, DEEP_LOW_GATE_MODELS, DEEP_HIGH_GATE_MODELS, OPENAI_CATEGORIES;
11825
+ </Category_Context>`, UNSPECIFIED_HIGH_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Use only when no specialist category fits and substantial effort spans systems/modules with broad impact. Use unspecified-low for contained moderate work.</Selection_Gate>`, DEEP_LOW_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Of the two deep lanes this is the default: the child settles its decisions from what it reads. When unsure, choose deep-low; a misrouted child returns \`ESCALATE: deep-high\` after one cheap attempt, and you re-spawn the same brief as deep-high with its findings.</Selection_Gate>`, DEEP_HIGH_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Route here only when you can name the decision evidence cannot settle: a trade-off with no single right answer, a contract change crossing a package or process boundary, a mechanism with no in-repo pattern to copy, or correctness argued from invariants rather than observed in a test. Wide scope with easy decisions is deep-low or unspecified-high; reasoning as the deliverable is ultrabrain.</Selection_Gate>`, GPT_ASTRA_GATE_MODELS, DEEP_LOW_GATE_MODELS, OPENAI_CATEGORIES;
11833
11826
  var init_openai_categories = __esm(() => {
11834
11827
  init_types();
11835
11828
  init_latest_models();
11836
- DEEP_LOW_GATE_MODELS = [
11837
- LATEST_MODEL_BY_FAMILY.gptSol,
11838
- LATEST_MODEL_BY_FAMILY.gptSolFast,
11839
- "gpt-6.1-sol",
11840
- "gpt-6.1-sol-fast",
11841
- "gpt-5.6-sol-fast",
11842
- "gpt-5.6-sol"
11843
- ];
11844
- DEEP_HIGH_GATE_MODELS = [LATEST_MODEL_BY_FAMILY.gptAstra, "gpt-6-astra"];
11829
+ GPT_ASTRA_GATE_MODELS = [LATEST_MODEL_BY_FAMILY.gptAstra];
11830
+ DEEP_LOW_GATE_MODELS = [LATEST_MODEL_BY_FAMILY.gptSol];
11845
11831
  OPENAI_CATEGORIES = [
11846
11832
  {
11847
11833
  name: "ultrabrain",
11848
11834
  config: { model: `openai/${LATEST_MODEL_BY_FAMILY.gptAstra}`, variant: "max" },
11849
11835
  description: "Use ONLY for genuinely hard, logic-heavy tasks. Give clear goals only, not step-by-step instructions.",
11850
11836
  promptAppend: ULTRABRAIN_CATEGORY_PROMPT_APPEND,
11851
- resolvePromptAppend: resolveUltrabrainCategoryPromptAppend
11837
+ resolvePromptAppend: resolveUltrabrainCategoryPromptAppend,
11838
+ requiresModel: GPT_ASTRA_GATE_MODELS
11852
11839
  },
11853
11840
  {
11854
11841
  name: "deep-low",
@@ -11866,7 +11853,7 @@ var init_openai_categories = __esm(() => {
11866
11853
  callerGuidance: DEEP_HIGH_CATEGORY_CALLER_GUIDANCE,
11867
11854
  promptAppend: DEEP_HIGH_CATEGORY_PROMPT_APPEND,
11868
11855
  resolvePromptAppend: resolveDeepHighCategoryPromptAppend,
11869
- requiresModel: DEEP_HIGH_GATE_MODELS
11856
+ requiresModel: GPT_ASTRA_GATE_MODELS
11870
11857
  },
11871
11858
  {
11872
11859
  name: "quick",
@@ -11899,6 +11886,8 @@ function buildCategoryRecord(selector) {
11899
11886
  }
11900
11887
  var BUILTIN_CATEGORIES, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS, CATEGORY_DESCRIPTIONS, CATEGORY_CALLER_GUIDANCE, CATEGORY_PROMPT_APPEND_RESOLVERS, BUILTIN_CATEGORY_REQUIRES_MODEL;
11901
11888
  var init_builtin_categories = __esm(() => {
11889
+ init_model_requirements2();
11890
+ init_provider_model_id_transform2();
11902
11891
  init_google_categories();
11903
11892
  init_kimi_categories();
11904
11893
  init_openai_categories();
@@ -67562,11 +67551,6 @@ var init_model_capabilities2 = __esm(() => {
67562
67551
  init_model_capabilities_generated();
67563
67552
  });
67564
67553
 
67565
- // packages/omo-opencode/src/shared/model-requirements.ts
67566
- var init_model_requirements2 = __esm(() => {
67567
- init_src2();
67568
- });
67569
-
67570
67554
  // packages/omo-opencode/src/shared/agent-variant.ts
67571
67555
  var init_agent_variant = __esm(() => {
67572
67556
  init_agent_display_names();
@@ -77234,6 +77218,17 @@ var init_git_master = __esm(() => {
77234
77218
  }).strict();
77235
77219
  });
77236
77220
 
77221
+ // packages/omo-config-core/src/schema/keyword-detector.ts
77222
+ var KeywordTypeSchema, OmoKeywordDetectorSettingsSchema;
77223
+ var init_keyword_detector = __esm(() => {
77224
+ init_zod();
77225
+ KeywordTypeSchema = _enum(["ultrawork", "team", "hyperplan", "hyperplan-ultrawork"]);
77226
+ OmoKeywordDetectorSettingsSchema = object({
77227
+ enabled_expansions: array(KeywordTypeSchema).optional(),
77228
+ disabled_keywords: array(KeywordTypeSchema).optional()
77229
+ });
77230
+ });
77231
+
77237
77232
  // packages/omo-config-core/src/schema/harness.ts
77238
77233
  var HARNESS_IDS, OMO_CONFIG_HARNESS_IDS, OmoHarnessIdSchema, OMO_CONFIG_LEGACY_HARNESS_ALIASES, OMO_CONFIG_LEGACY_HARNESS_IDS;
77239
77234
  var init_harness = __esm(() => {
@@ -77897,6 +77892,20 @@ var init_session_wake = __esm(() => {
77897
77892
  }).strict();
77898
77893
  });
77899
77894
 
77895
+ // packages/omo-config-core/src/schema/operator-alerts.ts
77896
+ var OmoOperatorAlertsSettingsSchema;
77897
+ var init_operator_alerts = __esm(() => {
77898
+ init_zod();
77899
+ OmoOperatorAlertsSettingsSchema = object({
77900
+ error_streak: object({
77901
+ threshold: number2().int().min(1).optional(),
77902
+ realert_minutes: number2().min(0).optional(),
77903
+ threads: array(string2().trim().min(1)).optional(),
77904
+ webhook_url_env: string2().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).optional()
77905
+ }).strict().optional()
77906
+ }).strict();
77907
+ });
77908
+
77900
77909
  // packages/omo-config-core/src/schema/config.ts
77901
77910
  var OmoOpenCodeHarnessConfigSchema, OmoDisabledSkillsSchema, OmoExcludedModelsSchema, OmoTypedHarnessConfigSchema, OmoConfigProfileSchema, OmoConfigSchema, OmoConfigLayerSchema;
77902
77911
  var init_config = __esm(() => {
@@ -77905,6 +77914,7 @@ var init_config = __esm(() => {
77905
77914
  init_category();
77906
77915
  init_computer();
77907
77916
  init_git_master();
77917
+ init_keyword_detector();
77908
77918
  init_memory();
77909
77919
  init_model_catalog();
77910
77920
  init_model_pad();
@@ -77917,12 +77927,14 @@ var init_config = __esm(() => {
77917
77927
  init_format_on_mutation();
77918
77928
  init_provenance();
77919
77929
  init_session_wake();
77930
+ init_operator_alerts();
77920
77931
  OmoOpenCodeHarnessConfigSchema = record(string2(), unknown());
77921
77932
  OmoDisabledSkillsSchema = array(string2());
77922
77933
  OmoExcludedModelsSchema = array(string2());
77923
77934
  OmoTypedHarnessConfigSchema = object({
77924
77935
  provenance: OmoProvenanceSettingsSchema.optional(),
77925
77936
  session_wake: OmoSessionWakeSettingsSchema.optional(),
77937
+ operator_alerts: OmoOperatorAlertsSettingsSchema.optional(),
77926
77938
  formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
77927
77939
  categories: OmoCategoriesConfigSchema.optional(),
77928
77940
  agents: OmoAgentsConfigSchema.optional(),
@@ -77939,11 +77951,13 @@ var init_config = __esm(() => {
77939
77951
  side_panel: OmoSidePanelSettingsLayerSchema.optional(),
77940
77952
  computer: OmoComputerSettingsLayerSchema.optional(),
77941
77953
  disabled_skills: OmoDisabledSkillsSchema.optional(),
77954
+ keyword_detector: OmoKeywordDetectorSettingsSchema.optional(),
77942
77955
  exclude_models: OmoExcludedModelsSchema.optional()
77943
77956
  }).strict();
77944
77957
  OmoConfigProfileSchema = object({
77945
77958
  provenance: OmoProvenanceSettingsSchema.optional(),
77946
77959
  session_wake: OmoSessionWakeSettingsSchema.optional(),
77960
+ operator_alerts: OmoOperatorAlertsSettingsSchema.optional(),
77947
77961
  formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
77948
77962
  categories: OmoCategoriesConfigSchema.optional(),
77949
77963
  agents: OmoAgentsConfigSchema.optional(),
@@ -77960,6 +77974,7 @@ var init_config = __esm(() => {
77960
77974
  side_panel: OmoSidePanelSettingsLayerSchema.optional(),
77961
77975
  computer: OmoComputerSettingsLayerSchema.optional(),
77962
77976
  disabled_skills: OmoDisabledSkillsSchema.optional(),
77977
+ keyword_detector: OmoKeywordDetectorSettingsSchema.optional(),
77963
77978
  exclude_models: OmoExcludedModelsSchema.optional(),
77964
77979
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
77965
77980
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -77969,6 +77984,7 @@ var init_config = __esm(() => {
77969
77984
  OmoConfigSchema = object({
77970
77985
  provenance: OmoProvenanceSettingsSchema.optional(),
77971
77986
  session_wake: OmoSessionWakeSettingsSchema.optional(),
77987
+ operator_alerts: OmoOperatorAlertsSettingsSchema.optional(),
77972
77988
  formatOnMutation: OmoFormatOnMutationSchema.optional(),
77973
77989
  $schema: string2().optional(),
77974
77990
  categories: OmoCategoriesConfigSchema.optional(),
@@ -77986,6 +78002,7 @@ var init_config = __esm(() => {
77986
78002
  side_panel: OmoSidePanelSettingsSchema.optional(),
77987
78003
  computer: OmoComputerSettingsSchema.optional(),
77988
78004
  disabled_skills: OmoDisabledSkillsSchema.optional(),
78005
+ keyword_detector: OmoKeywordDetectorSettingsSchema.optional(),
77989
78006
  exclude_models: OmoExcludedModelsSchema.optional(),
77990
78007
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
77991
78008
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -77998,6 +78015,7 @@ var init_config = __esm(() => {
77998
78015
  OmoConfigLayerSchema = object({
77999
78016
  provenance: OmoProvenanceSettingsSchema.optional(),
78000
78017
  session_wake: OmoSessionWakeSettingsSchema.optional(),
78018
+ operator_alerts: OmoOperatorAlertsSettingsSchema.optional(),
78001
78019
  formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
78002
78020
  $schema: string2().optional(),
78003
78021
  categories: OmoCategoriesConfigSchema.optional(),
@@ -78015,6 +78033,7 @@ var init_config = __esm(() => {
78015
78033
  side_panel: OmoSidePanelSettingsLayerSchema.optional(),
78016
78034
  computer: OmoComputerSettingsLayerSchema.optional(),
78017
78035
  disabled_skills: OmoDisabledSkillsSchema.optional(),
78036
+ keyword_detector: OmoKeywordDetectorSettingsSchema.optional(),
78018
78037
  exclude_models: OmoExcludedModelsSchema.optional(),
78019
78038
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
78020
78039
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -78151,6 +78170,7 @@ var init_schema = __esm(() => {
78151
78170
  init_format_on_mutation();
78152
78171
  init_git_master();
78153
78172
  init_harness();
78173
+ init_keyword_detector();
78154
78174
  init_legacy_category_names();
78155
78175
  init_legacy_harness_names();
78156
78176
  init_memory();
@@ -78160,6 +78180,7 @@ var init_schema = __esm(() => {
78160
78180
  init_model_ref();
78161
78181
  init_provenance();
78162
78182
  init_session_wake();
78183
+ init_operator_alerts();
78163
78184
  init_side_panel();
78164
78185
  init_task();
78165
78186
  init_team();
@@ -81111,7 +81132,7 @@ var init_provider_availability = __esm(() => {
81111
81132
  });
81112
81133
 
81113
81134
  // packages/omo-opencode/src/cli/provider-model-id-transform.ts
81114
- var init_provider_model_id_transform2 = __esm(() => {
81135
+ var init_provider_model_id_transform3 = __esm(() => {
81115
81136
  init_src2();
81116
81137
  });
81117
81138
 
@@ -81148,7 +81169,7 @@ function isRequiredProviderAvailable(requiredProviders, availability) {
81148
81169
  var init_fallback_chain_resolution = __esm(() => {
81149
81170
  init_model_fallback_requirements();
81150
81171
  init_provider_availability();
81151
- init_provider_model_id_transform2();
81172
+ init_provider_model_id_transform3();
81152
81173
  });
81153
81174
 
81154
81175
  // packages/omo-opencode/src/cli/fallback-lane-policy.ts
@@ -81349,7 +81370,7 @@ var init_model_fallback = __esm(() => {
81349
81370
  init_openai_only_model_catalog();
81350
81371
  init_provider_availability();
81351
81372
  init_fallback_chain_resolution();
81352
- init_provider_model_id_transform2();
81373
+ init_provider_model_id_transform3();
81353
81374
  init_fallback_lane_policy();
81354
81375
  init_latest_models();
81355
81376
  });
@@ -93008,7 +93029,7 @@ var package_default2;
93008
93029
  var init_package2 = __esm(() => {
93009
93030
  package_default2 = {
93010
93031
  name: "@oh-my-opencode/omo-codex",
93011
- version: "5.1.78",
93032
+ version: "5.1.81",
93012
93033
  type: "module",
93013
93034
  private: true,
93014
93035
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -94322,8 +94343,8 @@ var init_bytes_encoding = __esm(() => {
94322
94343
  });
94323
94344
 
94324
94345
  // packages/device-service-core/src/local-api/proof.ts
94325
- import { createHmac as createHmac2, randomBytes as randomBytes7, timingSafeEqual as timingSafeEqual2 } from "node:crypto";
94326
- var NONCE_BYTES = 32, mintNonce = () => toBase64url(randomBytes7(NONCE_BYTES)), mintId = () => toBase64url(randomBytes7(16)), decodedBytes = (value, bytes, what) => {
94346
+ import { createHmac as createHmac2, randomBytes as randomBytes8, timingSafeEqual as timingSafeEqual2 } from "node:crypto";
94347
+ var NONCE_BYTES = 32, mintNonce = () => toBase64url(randomBytes8(NONCE_BYTES)), mintId = () => toBase64url(randomBytes8(16)), decodedBytes = (value, bytes, what) => {
94327
94348
  const violation = () => new LocalApiError("protocol_violation", `${what} is not ${bytes} base64url bytes`);
94328
94349
  let out;
94329
94350
  try {
@@ -94520,7 +94541,7 @@ import {
94520
94541
  rmSync as rmSync10,
94521
94542
  writeFileSync as writeFileSync18
94522
94543
  } from "node:fs";
94523
- import { join as join120 } from "node:path";
94544
+ import { join as join121 } from "node:path";
94524
94545
  var TOKEN_FILE = "token", TOKEN_BYTES = 32, SOCKET_FILE = "service.sock", insecure = (detail) => {
94525
94546
  throw new LocalApiError("insecure_state_dir", detail);
94526
94547
  }, UNIX_ENDPOINT = "unix", tcpEndpoint = (port) => `tcp:${port}`, isMissing = (error) => typeof error === "object" && error !== null && ("code" in error) && (error.code === "ENOENT" || error.code === "ENOTDIR"), currentUid = () => process.getuid?.() ?? insecure("this platform has no uid"), privateEntry = (path, kind, uid, checkMode = true) => {
@@ -94542,8 +94563,8 @@ var TOKEN_FILE = "token", TOKEN_BYTES = 32, SOCKET_FILE = "service.sock", insecu
94542
94563
  }, checkPosixAccess = (stateDir) => {
94543
94564
  const uid = currentUid();
94544
94565
  privateEntry(stateDir, "dir", uid);
94545
- privateEntry(join120(stateDir, SOCKET_FILE), "socket", uid);
94546
- privateEntry(join120(stateDir, TOKEN_FILE), "file", uid);
94566
+ privateEntry(join121(stateDir, SOCKET_FILE), "socket", uid);
94567
+ privateEntry(join121(stateDir, TOKEN_FILE), "file", uid);
94547
94568
  }, posixSecureFile = async (path, kind) => {
94548
94569
  const uid = currentUid();
94549
94570
  privateEntry(path, kind, uid, false);
@@ -94552,7 +94573,7 @@ var TOKEN_FILE = "token", TOKEN_BYTES = 32, SOCKET_FILE = "service.sock", insecu
94552
94573
  }, readToken = (stateDir) => {
94553
94574
  let value;
94554
94575
  try {
94555
- value = readFileSync46(join120(stateDir, TOKEN_FILE), "utf8");
94576
+ value = readFileSync46(join121(stateDir, TOKEN_FILE), "utf8");
94556
94577
  } catch (error) {
94557
94578
  if (isMissing(error))
94558
94579
  return insecure("the token is missing");
@@ -97377,7 +97398,7 @@ var init_client_open = __esm(() => {
97377
97398
  // packages/device-service-core/src/local-api/transport.ts
97378
97399
  import { lstatSync as lstatSync8, readFileSync as readFileSync47, unlinkSync as unlinkSync11 } from "node:fs";
97379
97400
  import { createConnection, createServer as createServer4 } from "node:net";
97380
- import { join as join121 } from "node:path";
97401
+ import { join as join122 } from "node:path";
97381
97402
  var ENDPOINT_FILE = "endpoint.json", wrap = (socket, endpoint) => {
97382
97403
  const closeListeners = [];
97383
97404
  let closed = false;
@@ -97410,7 +97431,7 @@ var ENDPOINT_FILE = "endpoint.json", wrap = (socket, endpoint) => {
97410
97431
  }
97411
97432
  };
97412
97433
  }, readEndpointPort = (stateDir) => {
97413
- const parsed = JSON.parse(readFileSync47(join121(stateDir, ENDPOINT_FILE), "utf8"));
97434
+ const parsed = JSON.parse(readFileSync47(join122(stateDir, ENDPOINT_FILE), "utf8"));
97414
97435
  const port = typeof parsed === "object" && parsed !== null ? Reflect.get(parsed, "port") : undefined;
97415
97436
  if (typeof port !== "number" || !Number.isInteger(port) || port < 1 || port > 65535)
97416
97437
  throw new LocalApiError("insecure_state_dir", "endpoint.json holds no port");
@@ -97418,7 +97439,7 @@ var ENDPOINT_FILE = "endpoint.json", wrap = (socket, endpoint) => {
97418
97439
  }, connectLocal = (stateDir) => new Promise((resolve, reject) => {
97419
97440
  const port = process.platform === "win32" ? readEndpointPort(stateDir) : undefined;
97420
97441
  const endpoint = port === undefined ? UNIX_ENDPOINT : tcpEndpoint(port);
97421
- const socket = port === undefined ? createConnection({ path: join121(stateDir, SOCKET_FILE) }) : createConnection({ host: "127.0.0.1", port });
97442
+ const socket = port === undefined ? createConnection({ path: join122(stateDir, SOCKET_FILE) }) : createConnection({ host: "127.0.0.1", port });
97422
97443
  socket.once("error", reject);
97423
97444
  socket.once("connect", () => {
97424
97445
  socket.off("error", reject);
@@ -97451,7 +97472,7 @@ var init_client4 = __esm(() => {
97451
97472
 
97452
97473
  // packages/device-service-core/src/background-transport.ts
97453
97474
  import { createConnection as createConnection2 } from "node:net";
97454
- import { join as join122 } from "node:path";
97475
+ import { join as join123 } from "node:path";
97455
97476
  var wrap2 = (socket, endpoint) => {
97456
97477
  const closeListeners = [];
97457
97478
  let closed = false;
@@ -97486,7 +97507,7 @@ var wrap2 = (socket, endpoint) => {
97486
97507
  }, connectLocalBackground = (stateDir) => new Promise((resolve, reject) => {
97487
97508
  const port = process.platform === "win32" ? readEndpointPort(stateDir) : undefined;
97488
97509
  const endpoint = port === undefined ? UNIX_ENDPOINT : tcpEndpoint(port);
97489
- const socket = port === undefined ? createConnection2({ path: join122(stateDir, SOCKET_FILE) }) : createConnection2({ host: "127.0.0.1", port });
97510
+ const socket = port === undefined ? createConnection2({ path: join123(stateDir, SOCKET_FILE) }) : createConnection2({ host: "127.0.0.1", port });
97490
97511
  socket.unref();
97491
97512
  socket.once("error", reject);
97492
97513
  socket.once("connect", () => {
@@ -97676,7 +97697,7 @@ var init_unsettled_command = __esm(() => {
97676
97697
  });
97677
97698
 
97678
97699
  // packages/device-service-core/src/remote-attach.ts
97679
- import { randomBytes as randomBytes8 } from "node:crypto";
97700
+ import { randomBytes as randomBytes9 } from "node:crypto";
97680
97701
  function openAttach(client, device, sessionId, timers = realTimers) {
97681
97702
  const early = [];
97682
97703
  const history = [];
@@ -97785,7 +97806,7 @@ function openAttach(client, device, sessionId, timers = realTimers) {
97785
97806
  if (ended)
97786
97807
  return reject(new Error("the attach has ended"));
97787
97808
  const { waitMs = ATTACH_COMMAND_WAIT_MS, accepts } = options;
97788
- const commandId = randomBytes8(16).toString("base64url");
97809
+ const commandId = randomBytes9(16).toString("base64url");
97789
97810
  let progress;
97790
97811
  const settle = () => {
97791
97812
  stopState();
@@ -97979,16 +98000,16 @@ var init_version2 = __esm(() => {
97979
98000
  // packages/device-service-core/src/state-dir.ts
97980
98001
  import { readFileSync as readFileSync48, statSync as statSync10 } from "node:fs";
97981
98002
  import { homedir as homedir36 } from "node:os";
97982
- import { dirname as dirname50, join as join123, posix as posix17, win32 as win3212 } from "node:path";
98003
+ import { dirname as dirname50, join as join124, posix as posix17, win32 as win3212 } from "node:path";
97983
98004
  function defaultStateDir(platform, env, home) {
97984
98005
  if (platform !== "win32")
97985
- return join123(home, ".omo", "device-service");
97986
- const localAppData = env.LOCALAPPDATA ?? join123(home, "AppData", "Local");
97987
- return join123(localAppData, "OmO", "device-service");
98006
+ return join124(home, ".omo", "device-service");
98007
+ const localAppData = env.LOCALAPPDATA ?? join124(home, "AppData", "Local");
98008
+ return join124(localAppData, "OmO", "device-service");
97988
98009
  }
97989
98010
  function discoveredStateDir(platform, defaultDir) {
97990
98011
  try {
97991
- const parsed = JSON.parse(readFileSync48(join123(dirname50(defaultDir), LOCATION_FILE), "utf8"));
98012
+ const parsed = JSON.parse(readFileSync48(join124(dirname50(defaultDir), LOCATION_FILE), "utf8"));
97992
98013
  if (typeof parsed !== "object" || parsed === null || !("v" in parsed) || !("state_dir" in parsed))
97993
98014
  return;
97994
98015
  const { v, state_dir: stateDir } = parsed;
@@ -98022,6 +98043,11 @@ async function engineEndpointOf(client, device) {
98022
98043
  return only;
98023
98044
  throw new NoPrimaryEndpointError(device, listed.endpoints.length);
98024
98045
  }
98046
+ async function engineEndpointsOf(client, device) {
98047
+ const asksPrimary = compareVersions4(client.welcome.service_version, ENDPOINT_PRIMARY_MIN_SERVICE_VERSION) >= 0;
98048
+ const listed = await client.request("session.endpoints", asksPrimary ? { device, primary: true } : { device });
98049
+ return { keys: listed.endpoints, ...listed.primary === undefined ? {} : { primary: listed.primary } };
98050
+ }
98025
98051
  var ENDPOINT_PRIMARY_MIN_SERVICE_VERSION = "0.1.11", NoPrimaryEndpointError;
98026
98052
  var init_engine_endpoint = __esm(() => {
98027
98053
  init_not_sent_error();
@@ -98041,8 +98067,8 @@ var init_protocol = __esm(() => {
98041
98067
  });
98042
98068
 
98043
98069
  // packages/device-service-core/src/device-service.ts
98044
- import { join as join124 } from "node:path";
98045
- import { randomBytes as randomBytes9 } from "node:crypto";
98070
+ import { join as join125 } from "node:path";
98071
+ import { randomBytes as randomBytes10 } from "node:crypto";
98046
98072
  function sendToEndpoint(client, device, endpoint, rpc, locate, timers, waitMs) {
98047
98073
  return followDelegatedCommand(client, device, timers, (commandId) => {
98048
98074
  const send = (asked) => client.commandTo({ device, endpoint }, rpc, commandId, asked ? { locate: true } : {});
@@ -98051,7 +98077,7 @@ function sendToEndpoint(client, device, endpoint, rpc, locate, timers, waitMs) {
98051
98077
  }
98052
98078
  function followDelegatedCommand(client, device, timers, send, waitMs = ENDPOINT_COMMAND_WAIT_MS) {
98053
98079
  return new Promise((resolve, reject) => {
98054
- const commandId = randomBytes9(16).toString("base64url");
98080
+ const commandId = randomBytes10(16).toString("base64url");
98055
98081
  const channel = followDelegatedChannel(device);
98056
98082
  let done = false;
98057
98083
  const settle = () => {
@@ -98087,7 +98113,7 @@ function followDelegatedCommand(client, device, timers, send, waitMs = ENDPOINT_
98087
98113
  });
98088
98114
  }
98089
98115
  function deviceServiceEndpointPath(stateDir, platform = process.platform) {
98090
- return join124(stateDir, platform === "win32" ? ENDPOINT_FILE : SOCKET_FILE);
98116
+ return join125(stateDir, platform === "win32" ? ENDPOINT_FILE : SOCKET_FILE);
98091
98117
  }
98092
98118
  async function connectDeviceService(options) {
98093
98119
  const stateDir = options.stateDir ?? deviceServiceStateDir();
@@ -98153,6 +98179,7 @@ async function connectDeviceService(options) {
98153
98179
  command: (rpc, options) => attached.command(rpc, options?.waitMs === undefined ? undefined : { waitMs: options.waitMs })
98154
98180
  };
98155
98181
  },
98182
+ engineEndpoints: async (device) => await engineEndpointsOf(client, device),
98156
98183
  endpointCommand: async (device, rpc, options) => {
98157
98184
  const started = timers.now();
98158
98185
  let endpoint = options?.endpoint;
@@ -98175,8 +98202,6 @@ async function connectDeviceService(options) {
98175
98202
  throw markNotSent(error);
98176
98203
  }
98177
98204
  }
98178
- if (endpoint === undefined)
98179
- throw new NotSentError("unsupported", "the device lists no engine endpoint");
98180
98205
  const waitMs = options?.waitMs === undefined ? undefined : options.waitMs - (timers.now() - started);
98181
98206
  if (waitMs !== undefined && waitMs <= 0)
98182
98207
  throw new NotSentError("request_timeout", "the wait ran out during the endpoint lookup; nothing was sent");
@@ -103715,7 +103740,7 @@ var init_bindings = __esm(() => {
103715
103740
  });
103716
103741
 
103717
103742
  // packages/omo-senpi/src/components/thread/contracts/fields.ts
103718
- var THREAD_MESSAGE_MAX_BYTES = 32768, THREAD_SUMMARY_MAX_LENGTH = 200, THREAD_READ_DEFAULT_BYTES = 131072, THREAD_READ_MAX_BYTES = 1048576, ThreadAddress, AllScope, IdempotencyKey, ExpectedTurnId, Summary, Message2, thinkingLevel = (description) => Union([
103743
+ var THREAD_MESSAGE_MAX_BYTES = 32768, THREAD_SUMMARY_MAX_LENGTH = 200, THREAD_READ_DEFAULT_BYTES = 131072, THREAD_READ_MAX_BYTES = 1048576, ThreadAddress, AllScope, IdempotencyKey, CollapseKey, ExpectedTurnId, Summary, Message2, thinkingLevel = (description) => Union([
103719
103744
  Literal("off"),
103720
103745
  Literal("minimal"),
103721
103746
  Literal("low"),
@@ -103723,7 +103748,7 @@ var THREAD_MESSAGE_MAX_BYTES = 32768, THREAD_SUMMARY_MAX_LENGTH = 200, THREAD_RE
103723
103748
  Literal("high"),
103724
103749
  Literal("xhigh"),
103725
103750
  Literal("max")
103726
- ], { description }), BindingId, RelayText, ThreadDeliveryMode;
103751
+ ], { description }), BindingId, RelayText, DEFAULT_THREAD_DELIVERY = "auto", ThreadDeliveryMode;
103727
103752
  var init_fields = __esm(() => {
103728
103753
  init_build();
103729
103754
  init_bindings();
@@ -103736,6 +103761,11 @@ var init_fields = __esm(() => {
103736
103761
  IdempotencyKey = Optional(String2({
103737
103762
  description: "Caller-chosen key that makes a retried call return the earlier result instead of repeating the side effect; reusing the key with different arguments returns idempotency_conflict."
103738
103763
  }));
103764
+ CollapseKey = Optional(String2({
103765
+ minLength: 1,
103766
+ maxLength: 200,
103767
+ description: "Caller-chosen key for a repeating message (an alert re-sent each minute): a send replaces this sender's earlier message with the same key that the target has not taken yet, and is answered deduplicated and collapsed: true with the earlier delivery_id when the target already holds that one (this text is then not delivered), so one key never leaves more than one undelivered message. Reaches sessions on this device only."
103768
+ }));
103739
103769
  ExpectedTurnId = Optional(String2({
103740
103770
  description: "Turn id the steer applies to; required with delivery steer, and a changed active turn returns turn_conflict with the message held undelivered."
103741
103771
  }));
@@ -103755,7 +103785,8 @@ var init_fields = __esm(() => {
103755
103785
  description: `Text relayed to or from the external thread; longer than ${RELAY_TEXT_MAX_BYTES} UTF-8 bytes returns message_too_large.`
103756
103786
  });
103757
103787
  ThreadDeliveryMode = Union([Literal("auto"), Literal("steer"), Literal("follow_up")], {
103758
- description: "auto steers the running turn when one is active and starts a new turn otherwise; steer requires expected_turn_id and becomes turn_conflict when the active turn changed; follow_up queues the message behind the running turn."
103788
+ default: DEFAULT_THREAD_DELIVERY,
103789
+ description: "Omitted: auto. auto steers the running turn when one is active and starts a new turn otherwise; steer requires expected_turn_id and becomes turn_conflict when the active turn changed; follow_up queues the message behind the running turn (pass it only when the message must wait for that turn to end)."
103759
103790
  });
103760
103791
  });
103761
103792
 
@@ -103799,6 +103830,7 @@ var init_errors5 = __esm(() => {
103799
103830
  "idempotency_in_progress",
103800
103831
  "idempotency_uncertain",
103801
103832
  "delivered_unconfirmed",
103833
+ "prompt_not_started",
103802
103834
  "approval_unavailable",
103803
103835
  "approval_route_locked",
103804
103836
  "partial_commit",
@@ -103811,6 +103843,7 @@ var init_errors5 = __esm(() => {
103811
103843
  "model_ambiguous",
103812
103844
  "thinking_level_unsupported",
103813
103845
  "loop_detected",
103846
+ "pair_loop_guard",
103814
103847
  "chain_count_limit",
103815
103848
  "binding_conflict",
103816
103849
  "binding_mismatch",
@@ -103830,10 +103863,16 @@ var init_errors5 = __esm(() => {
103830
103863
  // packages/omo-senpi/src/components/thread/initial-skills.ts
103831
103864
  var init_initial_skills = () => {};
103832
103865
 
103866
+ // packages/omo-senpi/src/components/thread/gateway/result.ts
103867
+ var init_result2 = __esm(() => {
103868
+ init_errors5();
103869
+ });
103870
+
103833
103871
  // packages/omo-senpi/src/components/thread/remote/outcome.ts
103834
103872
  var READ_UNCERTAIN, UNANSWERED, NOT_SIGNED_IN;
103835
103873
  var init_outcome = __esm(() => {
103836
103874
  init_errors5();
103875
+ init_result2();
103837
103876
  READ_UNCERTAIN = {
103838
103877
  request_gone: "retry",
103839
103878
  no_receipt: "retry",
@@ -103865,57 +103904,47 @@ var init_outcome = __esm(() => {
103865
103904
  ]);
103866
103905
  NOT_SIGNED_IN = new Set(["sign_in_required", "signed_out"]);
103867
103906
  });
103868
- // packages/omo-senpi/src/components/thread/remote/remote-ops.ts
103869
- var init_remote_ops = __esm(() => {
103870
- init_errors5();
103871
- init_outcome();
103872
- });
103873
103907
 
103874
- // packages/omo-senpi/src/components/thread/control/port.ts
103875
- var REFUSAL;
103876
- var init_port = __esm(() => {
103908
+ // packages/omo-senpi/src/components/thread/address/refusals.ts
103909
+ var init_refusals = __esm(() => {
103877
103910
  init_errors5();
103878
- REFUSAL = Symbol.for("omo.thread.control.refusal");
103879
103911
  });
103880
103912
 
103881
- // packages/omo-senpi/src/components/thread/control/close-ladder.ts
103882
- var SESSION_GONE;
103883
- var init_close_ladder = __esm(() => {
103884
- init_port();
103885
- SESSION_GONE = new Set([
103886
- "unknown_session",
103887
- "session_identity_mismatch",
103888
- "session_not_attached",
103889
- "not_attached"
103890
- ]);
103913
+ // packages/omo-senpi/src/components/thread/remote/address-book.ts
103914
+ var REMOTE_NOT_SET_UP;
103915
+ var init_address_book = __esm(() => {
103916
+ REMOTE_NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
103891
103917
  });
103892
103918
 
103893
- // packages/omo-senpi/src/components/thread/worktree/failures.ts
103894
- var init_failures = __esm(() => {
103895
- init_errors5();
103919
+ // packages/omo-senpi/src/components/thread/address/account.ts
103920
+ var NOT_SET_UP, lastListed;
103921
+ var init_account = __esm(() => {
103922
+ init_remote_ops();
103923
+ init_address_book();
103924
+ NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
103925
+ lastListed = new WeakMap;
103896
103926
  });
103897
103927
 
103898
- // packages/omo-senpi/src/components/thread/control/open-reply.ts
103899
- var init_open_reply = __esm(() => {
103928
+ // packages/omo-senpi/src/components/thread/address/device.ts
103929
+ var init_device = __esm(() => {
103900
103930
  init_errors5();
103901
- init_outcome();
103902
- init_failures();
103931
+ init_account();
103932
+ init_refusals();
103903
103933
  });
103904
- // packages/omo-senpi/src/components/thread/worktree/remote-worktree.ts
103905
- var init_remote_worktree = __esm(() => {
103906
- init_close_ladder();
103907
- init_open_reply();
103908
- init_port();
103909
- init_errors5();
103934
+
103935
+ // packages/omo-senpi/src/components/thread/remote/remote-ops.ts
103936
+ var init_remote_ops = __esm(() => {
103937
+ init_refusals();
103938
+ init_device();
103939
+ init_account();
103910
103940
  init_outcome();
103911
- init_remote_ops();
103912
- init_failures();
103913
103941
  });
103914
103942
 
103915
- // packages/omo-senpi/src/components/thread/thread-link.ts
103916
- var THREAD_LINK_SCHEME = "omo-thread", PREFIX;
103917
- var init_thread_link = __esm(() => {
103918
- PREFIX = `${THREAD_LINK_SCHEME}://v1/`;
103943
+ // packages/omo-senpi/src/components/call-budget/call-deadline.ts
103944
+ import { AsyncLocalStorage as AsyncLocalStorage4 } from "node:async_hooks";
103945
+ var scope;
103946
+ var init_call_deadline = __esm(() => {
103947
+ scope = new AsyncLocalStorage4;
103919
103948
  });
103920
103949
 
103921
103950
  // packages/omo-senpi/src/components/thread/contracts/create-params.ts
@@ -103978,7 +104007,7 @@ var init_create_params = __esm(() => {
103978
104007
  prompt: Optional(String2({
103979
104008
  minLength: 1,
103980
104009
  maxLength: THREAD_MESSAGE_MAX_BYTES,
103981
- description: `First message for the new thread, delivered as thread_send (tool.thread_send() in an eval cell) delivers it once the thread exists (delivery picks its mode); the result's prompt field names that delivery, or its failure while the thread stays created. Covered by the same idempotency_key as the create. Longer than ${THREAD_MESSAGE_MAX_BYTES} UTF-8 bytes returns message_too_large. Only for a new thread.`
104010
+ description: `First message for the new thread, delivered as thread_send (tool.thread_send() in an eval cell) delivers it once the thread exists (delivery picks its mode); the result's prompt field names that delivery, or its failure while the thread stays created. Covered by the same idempotency_key as the create. Also sent when thread opens an existing thread: it goes to that thread (#14335). Longer than ${THREAD_MESSAGE_MAX_BYTES} UTF-8 bytes returns message_too_large.`
103982
104011
  })),
103983
104012
  delivery: Optional(ThreadDeliveryMode),
103984
104013
  idempotency_key: IdempotencyKey
@@ -103998,7 +104027,8 @@ var init_params = __esm(() => {
103998
104027
  state: Optional(_Array_(Union([Literal("running"), Literal("idle"), Literal("inactive"), Literal("archived")]), {
103999
104028
  minItems: 1,
104000
104029
  description: "Thread states to list: running, idle, inactive (no engine holds it) or archived; the default lists every state but archived."
104001
- }))
104030
+ })),
104031
+ idempotency_key: IdempotencyKey
104002
104032
  });
104003
104033
  ThreadReadParams = _Object_({
104004
104034
  thread: ThreadAddress,
@@ -104015,7 +104045,8 @@ var init_params = __esm(() => {
104015
104045
  maximum: THREAD_READ_WAIT_MAX_MS,
104016
104046
  description: "Wait up to this many ms for the thread's turn to end, then read; see result.wait."
104017
104047
  })),
104018
- all_scope: AllScope
104048
+ all_scope: AllScope,
104049
+ idempotency_key: IdempotencyKey
104019
104050
  });
104020
104051
  ThreadSendParams = _Object_({
104021
104052
  thread: ThreadAddress,
@@ -104024,6 +104055,7 @@ var init_params = __esm(() => {
104024
104055
  expected_turn_id: ExpectedTurnId,
104025
104056
  summary: Summary,
104026
104057
  idempotency_key: IdempotencyKey,
104058
+ collapse_key: CollapseKey,
104027
104059
  all_scope: AllScope
104028
104060
  });
104029
104061
  ThreadInterruptParams = _Object_({
@@ -104031,7 +104063,8 @@ var init_params = __esm(() => {
104031
104063
  turn_id: Optional(String2({
104032
104064
  description: "Running turn to stop, defaulting to the newest running turn; interrupting an idle thread returns success with interrupted false."
104033
104065
  })),
104034
- all_scope: AllScope
104066
+ all_scope: AllScope,
104067
+ idempotency_key: IdempotencyKey
104035
104068
  });
104036
104069
  SelfOrThread = Optional(String2({
104037
104070
  minLength: 1,
@@ -104040,7 +104073,18 @@ var init_params = __esm(() => {
104040
104073
  ThreadCloseParams = _Object_({
104041
104074
  thread: SelfOrThread,
104042
104075
  idempotency_key: IdempotencyKey,
104043
- all_scope: AllScope
104076
+ all_scope: AllScope,
104077
+ force: Optional(Boolean2({
104078
+ description: "Close even when the thread has messages it has not read yet; they are dropped and listed in dropped_deliveries."
104079
+ })),
104080
+ graceful: Optional(Boolean2({
104081
+ description: "Let the running turn end instead of stopping it; new messages are refused and unread ones go back to their senders. Monitors, loops and the goal stop cleanly. Also closes a terminal's thread, which then exits."
104082
+ })),
104083
+ wait_ms: Optional(Integer({
104084
+ minimum: 1,
104085
+ maximum: 600000,
104086
+ description: "How long a graceful close waits for the turn (default 30000, cut to what the call has left)."
104087
+ }))
104044
104088
  });
104045
104089
  ThreadHandoffParams = _Object_({
104046
104090
  thread: String2({
@@ -104075,7 +104119,7 @@ var init_params = __esm(() => {
104075
104119
  thread: ThreadAddress,
104076
104120
  model: String2({
104077
104121
  minLength: 1,
104078
- description: "Model to switch the thread to, as provider/id, an exact model id, or a case-insensitive fragment of the id or display name resolved against the host's model catalog; no match returns model_not_found with the available list, several matches return model_ambiguous with candidates."
104122
+ description: "Model to switch the thread to, as provider/id, an exact model id, or a case-insensitive fragment of the id or display name, resolved against the target's catalog. Append a thinking level such as :max to apply it after switching. No match returns model_not_found with the available list; an absent provider adds details.reason = provider_not_configured and lists the target's available providers. Several matches return model_ambiguous with candidates."
104079
104123
  }),
104080
104124
  provider: Optional(String2({
104081
104125
  description: "Restricts resolution to one provider when the fragment alone would match models from several providers."
@@ -104130,7 +104174,8 @@ var init_params = __esm(() => {
104130
104174
  minimum: 0,
104131
104175
  description: "Read rows after this cursor; unset continues after the binding's acknowledged cursor."
104132
104176
  })),
104133
- limit: Optional(Integer({ minimum: 1, maximum: 500, description: "Rows per read, default 100 and at most 500." }))
104177
+ limit: Optional(Integer({ minimum: 1, maximum: 500, description: "Rows per read, default 100 and at most 500." })),
104178
+ idempotency_key: IdempotencyKey
104134
104179
  });
104135
104180
  ThreadOutboxAckParams = _Object_({
104136
104181
  binding_id: BindingId,
@@ -104142,7 +104187,8 @@ var init_params = __esm(() => {
104142
104187
  minLength: 1,
104143
104188
  maxLength: 256,
104144
104189
  description: "Platform id of the message posted for the row at cursor; the first one for a milestone becomes the progress message later milestones edit."
104145
- }))
104190
+ })),
104191
+ idempotency_key: IdempotencyKey
104146
104192
  });
104147
104193
  ThreadAnswerParams = _Object_({
104148
104194
  binding_id: String2({
@@ -104150,7 +104196,8 @@ var init_params = __esm(() => {
104150
104196
  description: "Binding the answer arrived through; it must be the binding that asked the question."
104151
104197
  }),
104152
104198
  reply_token: String2({ minLength: 1, description: "reply_token of the question row being answered." }),
104153
- answer: RelayText
104199
+ answer: RelayText,
104200
+ idempotency_key: IdempotencyKey
104154
104201
  });
104155
104202
  });
104156
104203
 
@@ -108661,19 +108708,61 @@ var init_contracts = __esm(() => {
108661
108708
  });
108662
108709
 
108663
108710
  // packages/omo-senpi/src/components/thread/tools/thread-state.ts
108664
- var ACTIVITIES;
108711
+ var ACTIVITIES, RETRY_WAIT_KINDS;
108665
108712
  var init_thread_state = __esm(() => {
108666
108713
  init_contracts();
108667
108714
  ACTIVITIES = new Set(THREAD_ACTIVITIES);
108715
+ RETRY_WAIT_KINDS = new Set(["rate_limit", "retry"]);
108668
108716
  });
108669
108717
 
108670
- // packages/omo-senpi/src/components/thread/remote/address-book.ts
108671
- var lastListed, REMOTE_NOT_SET_UP;
108672
- var init_address_book = __esm(() => {
108718
+ // packages/omo-senpi/src/components/thread/control/port.ts
108719
+ var REFUSAL;
108720
+ var init_port = __esm(() => {
108721
+ init_errors5();
108722
+ init_thread_state();
108723
+ REFUSAL = Symbol.for("omo.thread.control.refusal");
108724
+ });
108725
+
108726
+ // packages/omo-senpi/src/components/thread/control/close-ladder.ts
108727
+ var SESSION_GONE;
108728
+ var init_close_ladder = __esm(() => {
108729
+ init_call_deadline();
108730
+ init_port();
108731
+ SESSION_GONE = new Set([
108732
+ "unknown_session",
108733
+ "route_unlisted",
108734
+ "session_identity_mismatch",
108735
+ "session_not_attached",
108736
+ "not_attached"
108737
+ ]);
108738
+ });
108739
+
108740
+ // packages/omo-senpi/src/components/thread/worktree/failures.ts
108741
+ var init_failures = __esm(() => {
108673
108742
  init_errors5();
108743
+ });
108744
+
108745
+ // packages/omo-senpi/src/components/thread/control/open-reply.ts
108746
+ var init_open_reply = __esm(() => {
108747
+ init_errors5();
108748
+ init_outcome();
108749
+ init_failures();
108750
+ });
108751
+ // packages/omo-senpi/src/components/thread/worktree/remote-worktree.ts
108752
+ var init_remote_worktree = __esm(() => {
108753
+ init_close_ladder();
108754
+ init_open_reply();
108755
+ init_port();
108756
+ init_errors5();
108757
+ init_outcome();
108674
108758
  init_remote_ops();
108675
- lastListed = new WeakMap;
108676
- REMOTE_NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
108759
+ init_failures();
108760
+ });
108761
+
108762
+ // packages/omo-senpi/src/components/thread/thread-link.ts
108763
+ var THREAD_LINK_SCHEME = "omo-thread", PREFIX;
108764
+ var init_thread_link = __esm(() => {
108765
+ PREFIX = `${THREAD_LINK_SCHEME}://v1/`;
108677
108766
  });
108678
108767
 
108679
108768
  // packages/omo-senpi/src/components/thread/addressing.ts
@@ -108731,7 +108820,7 @@ var init_metadata = __esm(() => {
108731
108820
  {
108732
108821
  name: "thread_close",
108733
108822
  label: "Close session",
108734
- description: "Closes a session. Omit thread or pass self to close this session. thread accepts the thread value of a thread_list row (tool.thread_list() in an eval cell), an alias, or a unique name; the result is closed true or false plus a reason" + ROUTE_TO_TASK,
108823
+ description: "Closes a session. Omit thread or pass self to close this session. thread accepts the thread value of a thread_list row (tool.thread_list() in an eval cell), an alias, or a unique name; the result is closed true or false plus a reason. A thread with messages it has not read is refused, naming them; pass force: true to close it anyway (dropped_deliveries lists them)" + ROUTE_TO_TASK,
108735
108824
  exposure: THREAD_TOOL_EXPOSURE
108736
108825
  },
108737
108826
  {
@@ -108790,13 +108879,12 @@ var init_metadata = __esm(() => {
108790
108879
  }
108791
108880
  ];
108792
108881
  });
108882
+
108793
108883
  // packages/omo-senpi/src/components/thread/tools/internals.ts
108794
108884
  function failure3(code, message, next, details) {
108795
108885
  return { kind: "error", error: threadToolFailure(code, message, next, details) };
108796
108886
  }
108797
108887
  var init_internals = __esm(() => {
108798
- init_address_book();
108799
- init_remote_ops();
108800
108888
  init_address_book2();
108801
108889
  init_addressing();
108802
108890
  init_errors5();
@@ -108817,6 +108905,7 @@ var init_relay_session_host = __esm(() => {
108817
108905
  init_initial_skills();
108818
108906
  init_outcome();
108819
108907
  init_remote_ops();
108908
+ init_device();
108820
108909
  init_remote_worktree();
108821
108910
  init_open_reply();
108822
108911
  init_thread_link();
@@ -108837,13 +108926,6 @@ var init_operations = __esm(() => {
108837
108926
  init_port();
108838
108927
  NOT_LIVE = failure3("not_resumable", "The thread has no live owner.", "Retry when the target is live.");
108839
108928
  });
108840
-
108841
- // packages/omo-senpi/src/components/call-budget/call-deadline.ts
108842
- import { AsyncLocalStorage as AsyncLocalStorage4 } from "node:async_hooks";
108843
- var scope;
108844
- var init_call_deadline = __esm(() => {
108845
- scope = new AsyncLocalStorage4;
108846
- });
108847
108929
  // packages/omo-senpi/src/components/thread/reader.ts
108848
108930
  var init_reader = __esm(() => {
108849
108931
  init_contracts();
@@ -108851,10 +108933,12 @@ var init_reader = __esm(() => {
108851
108933
  });
108852
108934
 
108853
108935
  // packages/omo-senpi/src/components/thread/paged-reader.ts
108936
+ var RETIRED_CURSOR_VERSIONS;
108854
108937
  var init_paged_reader = __esm(() => {
108855
108938
  init_contracts();
108856
108939
  init_errors5();
108857
108940
  init_reader();
108941
+ RETIRED_CURSOR_VERSIONS = new Set(["t2"]);
108858
108942
  });
108859
108943
 
108860
108944
  // packages/omo-senpi/src/components/thread/remote/context-tail.ts
@@ -108916,6 +109000,7 @@ var init_relay_control = __esm(() => {
108916
109000
  init_transcript_tail();
108917
109001
  init_paged_reader();
108918
109002
  init_remote_ops();
109003
+ init_fields();
108919
109004
  init_close_ladder();
108920
109005
  init_port();
108921
109006
  init_wait_settled();
@@ -108924,7 +109009,10 @@ var init_relay_control = __esm(() => {
108924
109009
  });
108925
109010
 
108926
109011
  // packages/omo-senpi/src/components/thread/remote/attach-pool.ts
108927
- var init_attach_pool = () => {};
109012
+ var CATALOG_RECORD = "get_available_models", HELD_RECORDS;
109013
+ var init_attach_pool = __esm(() => {
109014
+ HELD_RECORDS = new Set([CATALOG_RECORD, "get_protocol_info"]);
109015
+ });
108928
109016
 
108929
109017
  // packages/omo-senpi/src/components/thread/remote/session-state.ts
108930
109018
  var ACCESS_ENDED, ACCESS_REFUSED, SESSION_LEFT, SESSION_GONE2;
@@ -108970,7 +109058,12 @@ var init_device_service3 = __esm(() => {
108970
109058
  init_attach_pool();
108971
109059
  init_remote_watch();
108972
109060
  init_call_deadline();
108973
- READ_ONLY_RECORDS = new Set(["get_state", "get_messages", "get_entries"]);
109061
+ READ_ONLY_RECORDS = new Set([
109062
+ "get_state",
109063
+ "get_messages",
109064
+ "get_entries",
109065
+ "get_protocol_info"
109066
+ ]);
108974
109067
  MARKED_RECORDS = new Set(["admit_external_message"]);
108975
109068
  LOOKUP_NONE = new Set(["session_not_found", "peer_not_found", "peer_not_session_client"]);
108976
109069
  });
@@ -109025,10 +109118,19 @@ var init_seams = __esm(() => {
109025
109118
  init_codes();
109026
109119
  });
109027
109120
 
109121
+ // packages/omo-senpi/src/components/remote/resolve.ts
109122
+ var init_resolve3 = __esm(() => {
109123
+ init_client5();
109124
+ init_deadlines();
109125
+ init_codes();
109126
+ init_seams();
109127
+ });
109128
+
109028
109129
  // packages/omo-senpi/src/components/remote/aliases.ts
109029
109130
  var init_aliases = __esm(() => {
109030
109131
  init_codes();
109031
109132
  init_deadlines();
109133
+ init_resolve3();
109032
109134
  init_seams();
109033
109135
  });
109034
109136
 
@@ -109041,6 +109143,7 @@ var init_attach = __esm(() => {
109041
109143
  init_codes();
109042
109144
  init_deadlines();
109043
109145
  init_device_service3();
109146
+ init_resolve3();
109044
109147
  init_seams();
109045
109148
  DIALOG_KINDS = new Set(["select", "confirm", "input", "editor", "question"]);
109046
109149
  });
@@ -109057,21 +109160,15 @@ var init_follow = __esm(() => {
109057
109160
  RUN_OVER = new Set(["waiting_children", "waiting_background", "done", "failed", "cancelled"]);
109058
109161
  });
109059
109162
 
109060
- // packages/omo-senpi/src/components/remote/resolve.ts
109061
- var init_resolve3 = __esm(() => {
109062
- init_addressing();
109063
- init_codes();
109064
- init_seams();
109065
- });
109066
-
109067
109163
  // packages/omo-senpi/src/components/thread/gateway/provenance-resolver.ts
109068
109164
  var init_provenance_resolver = () => {};
109069
109165
  // packages/omo-senpi/src/components/thread/gateway/constants.ts
109070
- var QUEUED_TTL_MS, ROOT_LIFETIME_MS, TARGET_MAX_BYTES, GATEWAY_RECEIPT_RETENTION_MS, DELIVERY_RETENTION_MS, RETENTION_SWEEP_INTERVAL_MS;
109166
+ var QUEUED_TTL_MS, ROOT_LIFETIME_MS, TARGET_MAX_BYTES, STEER_RESERVE_BYTES, GATEWAY_RECEIPT_RETENTION_MS, DELIVERY_RETENTION_MS, RETENTION_SWEEP_INTERVAL_MS;
109071
109167
  var init_constants6 = __esm(() => {
109072
109168
  QUEUED_TTL_MS = 24 * 60 * 60 * 1000;
109073
109169
  ROOT_LIFETIME_MS = 7 * 24 * 60 * 60 * 1000;
109074
109170
  TARGET_MAX_BYTES = 1024 * 1024;
109171
+ STEER_RESERVE_BYTES = 256 * 1024;
109075
109172
  GATEWAY_RECEIPT_RETENTION_MS = 30 * 24 * 60 * 60 * 1000;
109076
109173
  DELIVERY_RETENTION_MS = 30 * 24 * 60 * 60 * 1000;
109077
109174
  RETENTION_SWEEP_INTERVAL_MS = 60 * 60 * 1000;
@@ -109081,12 +109178,6 @@ var init_constants6 = __esm(() => {
109081
109178
  var init_provenance2 = __esm(() => {
109082
109179
  init_constants6();
109083
109180
  });
109084
-
109085
- // packages/omo-senpi/src/components/thread/gateway/result.ts
109086
- var init_result2 = __esm(() => {
109087
- init_errors5();
109088
- });
109089
-
109090
109181
  // packages/omo-senpi/src/components/thread/remote/find-session.ts
109091
109182
  var NO_FIND_SESSION;
109092
109183
  var init_find_session = __esm(() => {
@@ -109110,6 +109201,7 @@ var init_relay_transport = __esm(() => {
109110
109201
  init_provenance2();
109111
109202
  init_result2();
109112
109203
  init_remote_ops();
109204
+ init_device();
109113
109205
  init_outcome();
109114
109206
  init_find_session();
109115
109207
  init_call_deadline();
@@ -109127,6 +109219,7 @@ var init_relay_transport = __esm(() => {
109127
109219
  // packages/omo-senpi/src/components/thread/remote/this-device.ts
109128
109220
  var known2;
109129
109221
  var init_this_device = __esm(() => {
109222
+ init_account();
109130
109223
  known2 = new WeakMap;
109131
109224
  });
109132
109225
 
@@ -109135,6 +109228,7 @@ var init_client_message_id = () => {};
109135
109228
  // packages/omo-senpi/src/components/remote/sessions.ts
109136
109229
  var NO_SESSION;
109137
109230
  var init_sessions = __esm(() => {
109231
+ init_fields();
109138
109232
  init_permission_presets();
109139
109233
  init_operations();
109140
109234
  init_port();
@@ -109151,6 +109245,7 @@ var init_sessions = __esm(() => {
109151
109245
  init_codes();
109152
109246
  init_deadlines();
109153
109247
  init_device_service3();
109248
+ init_resolve3();
109154
109249
  init_seams();
109155
109250
  init_client_message_id();
109156
109251
  NO_SESSION = new Set(["unknown_session", "session_not_found"]);
@@ -109180,19 +109275,69 @@ var init_factories = __esm(() => {
109180
109275
  init_client5();
109181
109276
  });
109182
109277
 
109183
- // packages/omo-senpi/src/components/thread/remote/plan-create.ts
109184
- var ALIASES_UNAVAILABLE;
109185
- var init_plan_create = __esm(() => {
109278
+ // packages/omo-senpi/src/components/thread/address/holder.ts
109279
+ var init_holder = __esm(() => {
109280
+ init_account();
109281
+ init_outcome();
109282
+ init_refusals();
109283
+ });
109284
+
109285
+ // packages/omo-senpi/src/components/thread/address/ladder.ts
109286
+ var init_ladder = __esm(() => {
109186
109287
  init_addressing();
109187
- init_relay_session_host();
109188
109288
  init_errors5();
109189
- init_thread_row();
109190
- init_find_session();
109289
+ });
109290
+
109291
+ // packages/omo-senpi/src/components/thread/address/probe.ts
109292
+ var init_probe = __esm(() => {
109293
+ init_errors5();
109294
+ init_address_book();
109191
109295
  init_remote_ops();
109192
- ALIASES_UNAVAILABLE = {
109193
- kind: "error",
109194
- error: threadToolFailure("host_unavailable", "Thread aliases need the account's alias registry, which this device cannot reach.", "Create or address the thread by its id; retry the alias later.")
109195
- };
109296
+ init_account();
109297
+ init_refusals();
109298
+ });
109299
+
109300
+ // packages/omo-senpi/src/components/thread/address/bare.ts
109301
+ var init_bare = __esm(() => {
109302
+ init_addressing();
109303
+ init_errors5();
109304
+ init_address_book();
109305
+ init_holder();
109306
+ init_ladder();
109307
+ init_probe();
109308
+ init_refusals();
109309
+ });
109310
+
109311
+ // packages/omo-senpi/src/components/thread/address/on-device.ts
109312
+ var init_on_device = __esm(() => {
109313
+ init_address_book();
109314
+ init_holder();
109315
+ init_bare();
109316
+ init_device();
109317
+ init_ladder();
109318
+ init_probe();
109319
+ init_refusals();
109320
+ });
109321
+
109322
+ // packages/omo-senpi/src/components/thread/address/resolve.ts
109323
+ var init_resolve4 = __esm(() => {
109324
+ init_errors5();
109325
+ init_address_book();
109326
+ init_remote_ops();
109327
+ init_account();
109328
+ init_bare();
109329
+ init_device();
109330
+ init_on_device();
109331
+ init_probe();
109332
+ init_refusals();
109333
+ });
109334
+
109335
+ // packages/omo-senpi/src/components/thread/address/index.ts
109336
+ var init_address = __esm(() => {
109337
+ init_account();
109338
+ init_device();
109339
+ init_refusals();
109340
+ init_resolve4();
109196
109341
  });
109197
109342
 
109198
109343
  // packages/omo-opencode/src/cli/cli-program.ts
@@ -112069,7 +112214,7 @@ function isRootSetting(line, key) {
112069
112214
  // packages/omo-codex/src/install/codex-model-catalog.ts
112070
112215
  import { readFile as readFile11 } from "node:fs/promises";
112071
112216
  import { join as join38 } from "node:path";
112072
- var CODEX_ASTRA_MODEL = "gpt-6-astra";
112217
+ var CODEX_ASTRA_MODEL = "gpt-6.2-astra";
112073
112218
  var FALLBACK_CODEX_MODEL_CATALOG = {
112074
112219
  current: {
112075
112220
  model: CODEX_ASTRA_MODEL,
@@ -112096,6 +112241,12 @@ var FALLBACK_CODEX_MODEL_CATALOG = {
112096
112241
  modelContextWindow: 650000,
112097
112242
  modelReasoningEffort: "high",
112098
112243
  planModeReasoningEffort: "xhigh"
112244
+ },
112245
+ {
112246
+ model: "gpt-6-astra",
112247
+ modelContextWindow: 600000,
112248
+ modelReasoningEffort: "high",
112249
+ planModeReasoningEffort: "xhigh"
112099
112250
  }
112100
112251
  ]
112101
112252
  };
@@ -112645,6 +112796,7 @@ import { lstat as lstat8, readFile as readFile14, readdir as readdir7, writeFile
112645
112796
  import { join as join42 } from "node:path";
112646
112797
 
112647
112798
  // packages/omo-codex/src/install/managed-agent-reasoning-defaults.ts
112799
+ var PREVIOUS_CODEX_ASTRA_MODEL = "gpt-6-astra";
112648
112800
  var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112649
112801
  [
112650
112802
  "explorer",
@@ -112659,7 +112811,11 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112659
112811
  },
112660
112812
  {
112661
112813
  previous: { model: "gpt-5.6-luna", effort: "low" },
112662
- current: { model: CODEX_ASTRA_MODEL, effort: "low" }
112814
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" }
112815
+ },
112816
+ {
112817
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" },
112818
+ current: { model: "gpt-6-luna", effort: "low" }
112663
112819
  }
112664
112820
  ]
112665
112821
  ],
@@ -112676,7 +112832,11 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112676
112832
  },
112677
112833
  {
112678
112834
  previous: { model: "gpt-5.6-luna", effort: "low" },
112679
- current: { model: CODEX_ASTRA_MODEL, effort: "low" }
112835
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" }
112836
+ },
112837
+ {
112838
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" },
112839
+ current: { model: "gpt-6-luna", effort: "low" }
112680
112840
  }
112681
112841
  ]
112682
112842
  ],
@@ -112685,6 +112845,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112685
112845
  [
112686
112846
  {
112687
112847
  previous: { model: "gpt-5.6-sol", effort: "high" },
112848
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112849
+ },
112850
+ {
112851
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112688
112852
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112689
112853
  }
112690
112854
  ]
@@ -112694,6 +112858,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112694
112858
  [
112695
112859
  {
112696
112860
  previous: { model: "gpt-5.6-luna", effort: "high" },
112861
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112862
+ },
112863
+ {
112864
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112697
112865
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112698
112866
  }
112699
112867
  ]
@@ -112711,6 +112879,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112711
112879
  },
112712
112880
  {
112713
112881
  previous: { model: "gpt-5.6-terra", effort: "high" },
112882
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112883
+ },
112884
+ {
112885
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112714
112886
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112715
112887
  }
112716
112888
  ]
@@ -112728,6 +112900,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112728
112900
  },
112729
112901
  {
112730
112902
  previous: { model: "gpt-5.6-sol", effort: "high" },
112903
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112904
+ },
112905
+ {
112906
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112731
112907
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112732
112908
  }
112733
112909
  ]
@@ -112745,6 +112921,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112745
112921
  },
112746
112922
  {
112747
112923
  previous: { model: "gpt-5.6-terra", effort: "high" },
112924
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112925
+ },
112926
+ {
112927
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112748
112928
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112749
112929
  }
112750
112930
  ]
@@ -112758,6 +112938,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112758
112938
  },
112759
112939
  {
112760
112940
  previous: { model: "gpt-5.6-sol", effort: "medium" },
112941
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "medium" }
112942
+ },
112943
+ {
112944
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "medium" },
112761
112945
  current: { model: CODEX_ASTRA_MODEL, effort: "medium" }
112762
112946
  }
112763
112947
  ]
@@ -112771,6 +112955,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112771
112955
  },
112772
112956
  {
112773
112957
  previous: { model: "gpt-5.6-terra", effort: "medium" },
112958
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "medium" }
112959
+ },
112960
+ {
112961
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "medium" },
112774
112962
  current: { model: CODEX_ASTRA_MODEL, effort: "medium" }
112775
112963
  }
112776
112964
  ]
@@ -112784,6 +112972,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112784
112972
  },
112785
112973
  {
112786
112974
  previous: { model: "gpt-5.6-terra", effort: "high" },
112975
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112976
+ },
112977
+ {
112978
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112787
112979
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112788
112980
  }
112789
112981
  ]
@@ -112797,6 +112989,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112797
112989
  },
112798
112990
  {
112799
112991
  previous: { model: "gpt-5.6-luna", effort: "high" },
112992
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112993
+ },
112994
+ {
112995
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112800
112996
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112801
112997
  }
112802
112998
  ]
@@ -112814,6 +113010,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112814
113010
  },
112815
113011
  {
112816
113012
  previous: { model: "gpt-5.6-sol", effort: "low" },
113013
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" }
113014
+ },
113015
+ {
113016
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" },
112817
113017
  current: { model: CODEX_ASTRA_MODEL, effort: "low" }
112818
113018
  }
112819
113019
  ]
@@ -115163,7 +115363,8 @@ const agentDir = process.env.OMO_CODING_AGENT_DIR ?? process.env.SENPI_CODING_AG
115163
115363
  ?? process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".omo", "agent")
115164
115364
  const env = {
115165
115365
  ...process.env,
115166
- SENPI_BRAND: JSON.stringify(brand),
115366
+ // The plugin this launcher prepends with --extension is the engine's own, never a user flag (#14465).
115367
+ SENPI_BRAND: JSON.stringify({ ...brand, extensions: [plugin] }),
115167
115368
  OMO_NATIVE: "1",
115168
115369
  OMO_CODING_AGENT_DIR: agentDir,
115169
115370
  SENPI_CODING_AGENT_DIR: agentDir,
@@ -115397,6 +115598,7 @@ var REQUIRED_PLUGIN_ARTIFACTS = [
115397
115598
  join66("skills-conditional", "x-search", "SKILL.md"),
115398
115599
  join66("runtime", "agent-toolkit-sdk", "sdk.js"),
115399
115600
  join66("runtime", "bunshin-ts", "sdk.js"),
115601
+ join66("runtime", "omo-sdk", "sdk.js"),
115400
115602
  join66("runtime", "thread-sdk", "sdk.js"),
115401
115603
  join66("runtime", "ast-grep-mcp", "cli.js"),
115402
115604
  join66("runtime", "lsp-daemon", "dist", "cli.js"),
@@ -120040,12 +120242,7 @@ var I18nConfigSchema = object({
120040
120242
  locale: string2().optional()
120041
120243
  });
120042
120244
  // packages/omo-opencode/src/config/schema/keyword-detector.ts
120043
- init_zod();
120044
- var KeywordTypeSchema = _enum(["ultrawork", "team", "hyperplan", "hyperplan-ultrawork"]);
120045
- var KeywordDetectorConfigSchema = object({
120046
- enabled_expansions: array(KeywordTypeSchema).optional(),
120047
- disabled_keywords: array(KeywordTypeSchema).optional()
120048
- });
120245
+ init_src4();
120049
120246
  // packages/omo-opencode/src/config/schema/model-capabilities.ts
120050
120247
  init_zod();
120051
120248
  var ModelCapabilitiesConfigSchema = object({
@@ -120277,7 +120474,7 @@ var OhMyOpenCodeConfigSchema = object({
120277
120474
  i18n: I18nConfigSchema.optional(),
120278
120475
  monitor: MonitorConfigSchema.optional(),
120279
120476
  team_mode: TeamModeConfigSchema.optional(),
120280
- keyword_detector: KeywordDetectorConfigSchema.optional(),
120477
+ keyword_detector: OmoKeywordDetectorSettingsSchema.optional(),
120281
120478
  babysitting: BabysittingConfigSchema.optional(),
120282
120479
  git_master: GitMasterConfigSchema.default({
120283
120480
  commit_footer: false,
@@ -124758,8 +124955,8 @@ var package_default3 = {
124758
124955
  },
124759
124956
  dependencies: {
124760
124957
  "@clack/prompts": "^1.8.1",
124761
- "@code-yeongyu/senpi": "2026.11.18-2",
124762
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.18-2",
124958
+ "@code-yeongyu/senpi": "2026.11.19-5",
124959
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.19-5",
124763
124960
  "@modelcontextprotocol/sdk": "^1.30.0",
124764
124961
  "@oh-my-opencode/agents-md-core": "workspace:*",
124765
124962
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -127993,9 +128190,9 @@ function deviceName(host = machineHost()) {
127993
128190
  const bounded = [...clean].slice(0, 64).join("").trim();
127994
128191
  return bounded === "" ? UNNAMED : bounded;
127995
128192
  }
127996
- var LEGACY_PREFIX = "omo CLI on ";
128193
+ var LEGACY_PREFIXES = ["omo CLI on ", "OmO Desktop on "];
127997
128194
  function isGeneratedDeviceName(name) {
127998
- return name.startsWith(LEGACY_PREFIX) || name === UNNAMED || name === deviceName(hostname());
128195
+ return LEGACY_PREFIXES.some((prefix) => name.startsWith(prefix)) || name === UNNAMED || name === deviceName(hostname());
127999
128196
  }
128000
128197
  function devicePlatform() {
128001
128198
  switch (process.platform) {
@@ -130225,12 +130422,16 @@ var parseLockedReply = (stdout) => {
130225
130422
  return null;
130226
130423
  return match[1] === "true" ? "locked" : "unlocked";
130227
130424
  };
130425
+ var NO_SECRET_SERVICE = /^Error connecting: (?:Could not connect: No such file or directory|Cannot autolaunch D-Bus without X11 \$DISPLAY|Failed to execute child process .dbus-launch. \(No such file or directory\))|org\.freedesktop\.DBus\.Error\.(?:ServiceUnknown|NameHasNoOwner)\b/m;
130426
+ var classifyProbeFailure = (stderr) => NO_SECRET_SERVICE.test(stderr) ? "absent" : "unknown";
130228
130427
  var finishedWithoutPrompt = (stdout) => /objectpath\s+'\/'\s*\)\s*$/.test(stdout);
130229
130428
  var gdbus = (args, timeoutMs) => new Promise((resolve) => {
130230
130429
  const child = spawn5("gdbus", ["call", "--session", "--dest", "org.freedesktop.secrets", ...args], {
130231
- stdio: ["ignore", "pipe", "ignore"]
130430
+ stdio: ["ignore", "pipe", "pipe"],
130431
+ env: { ...process.env, LC_ALL: "C" }
130232
130432
  });
130233
130433
  let stdout = "";
130434
+ let stderr = "";
130234
130435
  const timer = setTimeout(() => {
130235
130436
  child.kill();
130236
130437
  resolve({ kind: "unknown" });
@@ -130238,13 +130439,16 @@ var gdbus = (args, timeoutMs) => new Promise((resolve) => {
130238
130439
  child.stdout.on("data", (chunk) => {
130239
130440
  stdout += chunk.toString();
130240
130441
  });
130442
+ child.stderr.on("data", (chunk) => {
130443
+ stderr += chunk.toString();
130444
+ });
130241
130445
  child.on("error", () => {
130242
130446
  clearTimeout(timer);
130243
130447
  resolve({ kind: "unknown" });
130244
130448
  });
130245
130449
  child.on("close", (code) => {
130246
130450
  clearTimeout(timer);
130247
- resolve(code === 0 ? { kind: "reply", stdout } : { kind: "failed" });
130451
+ resolve(code === 0 ? { kind: "reply", stdout } : { kind: "failed", stderr });
130248
130452
  });
130249
130453
  });
130250
130454
  var readLocked = async (timeoutMs) => {
@@ -130258,7 +130462,7 @@ var readLocked = async (timeoutMs) => {
130258
130462
  ], timeoutMs);
130259
130463
  if (answer.kind === "unknown")
130260
130464
  return "unknown";
130261
- return answer.kind === "reply" ? parseLockedReply(answer.stdout) ?? "absent" : "absent";
130465
+ return answer.kind === "reply" ? parseLockedReply(answer.stdout) ?? "unknown" : classifyProbeFailure(answer.stderr);
130262
130466
  };
130263
130467
  var probeSecretServiceLock = async () => {
130264
130468
  const state = await readLocked(PROBE_TIMEOUT_MS2);
@@ -130345,6 +130549,218 @@ async function credentialLockBusy(error) {
130345
130549
  return new SignInError(`Another process (pid ${pid}, ${name}) ${held}. Wait for it to finish, or end it with \`${endCommand(pid, false)}\`, then run the command again.`);
130346
130550
  }
130347
130551
 
130552
+ // packages/omo-opencode/src/cli/service-auth/linux-store-route.ts
130553
+ var LIBSECRET_NOTICE = "omo: could not check whether the keyring is locked (gdbus or the Secret Service did not answer); using libsecret directly.";
130554
+ function routeLinuxStore(input) {
130555
+ const { keyring, file, notice } = input;
130556
+ let storage = "keyring";
130557
+ let libsecretNoticed = false;
130558
+ let keptNoticed = false;
130559
+ const underLock = (action) => withCredentialLock(input.api, action, input.home ?? accountHome());
130560
+ const migrate = () => underLock(async () => {
130561
+ const text = await file.text();
130562
+ if (text === null)
130563
+ return;
130564
+ const relation = await input.relation(text);
130565
+ if (relation === "empty" || relation === "older") {
130566
+ await input.moveToKeyring(text);
130567
+ await file.clear();
130568
+ return;
130569
+ }
130570
+ if (keptNoticed)
130571
+ return;
130572
+ keptNoticed = true;
130573
+ notice(`omo: the keyring already holds ${relation === "newer" ? "a newer copy of this" : "another"} OmO sign-in, which stays in use; the private sign-in file in ${file.directory()} is left as it is.`);
130574
+ });
130575
+ const choose = async () => {
130576
+ const answer = await input.probe();
130577
+ if (answer === "absent")
130578
+ return "file";
130579
+ if (await file.present()) {
130580
+ if (answer === "unknown")
130581
+ return "file";
130582
+ await migrate();
130583
+ return "keyring";
130584
+ }
130585
+ if (answer === "unknown" && !libsecretNoticed) {
130586
+ libsecretNoticed = true;
130587
+ notice(LIBSECRET_NOTICE);
130588
+ }
130589
+ return "keyring";
130590
+ };
130591
+ const target = async () => {
130592
+ storage = await choose();
130593
+ return storage === "file" ? file : keyring;
130594
+ };
130595
+ return {
130596
+ read: async () => (await target()).read(),
130597
+ readAuthoritative: async () => (await target()).readAuthoritative(),
130598
+ write: async (value, intent, beforeRetire) => {
130599
+ const store = await target();
130600
+ if (store === file)
130601
+ notice(`omo: No keyring is running; OmO keeps this sign-in in a private file in ${file.directory()}, readable only by you. Start a keyring to keep it there instead.`);
130602
+ await store.write(value, intent, beforeRetire);
130603
+ },
130604
+ clear: async () => {
130605
+ const answer = await input.probe();
130606
+ const present = await file.present();
130607
+ storage = answer === "absent" || answer === "unknown" && present ? "file" : "keyring";
130608
+ if (storage === "file")
130609
+ return file.clear();
130610
+ if (present)
130611
+ await underLock(async () => {
130612
+ const text = await file.text();
130613
+ if (text !== null && await input.relation(text) !== "other")
130614
+ await file.clear();
130615
+ });
130616
+ await keyring.clear();
130617
+ },
130618
+ storage: () => storage
130619
+ };
130620
+ }
130621
+
130622
+ // packages/omo-opencode/src/cli/service-auth/state-file-store.ts
130623
+ import { randomBytes as randomBytes5 } from "node:crypto";
130624
+ import { constants as constants15 } from "node:fs";
130625
+ import { lstat as lstat19, mkdir as mkdir14, open as open5, readdir as readdir19, rename as rename11, rm as rm19 } from "node:fs/promises";
130626
+ import { join as join115 } from "node:path";
130627
+ var ACCOUNT_STATE_DIR = "account-state";
130628
+ var { O_RDONLY, O_WRONLY, O_CREAT, O_EXCL, O_NOFOLLOW, O_NONBLOCK, O_DIRECTORY } = constants15;
130629
+ var GROUP_OR_WORLD = 63;
130630
+
130631
+ class StateFileRefused extends Error {
130632
+ refusal;
130633
+ constructor(refusal) {
130634
+ super(`the private sign-in file was refused (${refusal})`);
130635
+ this.refusal = refusal;
130636
+ }
130637
+ }
130638
+ var stateFileDirectory = (home) => join115(home, ".omo", ACCOUNT_STATE_DIR);
130639
+ var errnoCode = (error) => typeof error === "object" && error !== null && ("code" in error) && typeof error.code === "string" ? error.code : undefined;
130640
+ var dirRefusal = (stat, uid) => !stat.isDirectory() ? "dir-not-a-directory" : stat.uid !== uid ? "dir-other-owner" : (stat.mode & GROUP_OR_WORLD) !== 0 ? "dir-open" : undefined;
130641
+ var fileRefusal = (stat, uid) => !stat.isFile() ? "not-a-file" : stat.uid !== uid ? "other-owner" : (stat.mode & GROUP_OR_WORLD) !== 0 ? "open" : undefined;
130642
+ async function checkDir(dir, uid) {
130643
+ const stat = await lstat19(dir).catch((error) => {
130644
+ if (errnoCode(error) === "ENOENT")
130645
+ return null;
130646
+ throw error;
130647
+ });
130648
+ if (stat === null)
130649
+ return false;
130650
+ const refusal = dirRefusal(stat, uid);
130651
+ if (refusal !== undefined)
130652
+ throw new StateFileRefused(refusal);
130653
+ return true;
130654
+ }
130655
+ async function readStateFile(dir, name, uid) {
130656
+ if (!await checkDir(dir, uid))
130657
+ return null;
130658
+ const handle = await open5(join115(dir, name), O_RDONLY | O_NOFOLLOW | O_NONBLOCK).catch((error) => {
130659
+ const code = errnoCode(error);
130660
+ if (code === "ENOENT")
130661
+ return null;
130662
+ if (code === "ELOOP")
130663
+ throw new StateFileRefused("symlink");
130664
+ throw error;
130665
+ });
130666
+ if (handle === null)
130667
+ return null;
130668
+ try {
130669
+ const refusal = fileRefusal(await handle.stat(), uid);
130670
+ if (refusal !== undefined)
130671
+ throw new StateFileRefused(refusal);
130672
+ return await handle.readFile("utf8");
130673
+ } finally {
130674
+ await handle.close();
130675
+ }
130676
+ }
130677
+ async function removeTempLeftovers(dir, name) {
130678
+ const entries = await readdir19(dir).catch((error) => {
130679
+ if (errnoCode(error) === "ENOENT")
130680
+ return [];
130681
+ throw error;
130682
+ });
130683
+ for (const entry of entries)
130684
+ if (entry.startsWith(`.${name}.`) && entry.endsWith(".tmp"))
130685
+ await rm19(join115(dir, entry), { force: true });
130686
+ }
130687
+ async function writeStateFile(dir, name, contents, uid) {
130688
+ await mkdir14(dir, { recursive: true, mode: 448 });
130689
+ await checkDir(dir, uid);
130690
+ await removeTempLeftovers(dir, name);
130691
+ const temp = join115(dir, `.${name}.${randomBytes5(8).toString("hex")}.tmp`);
130692
+ try {
130693
+ const handle = await open5(temp, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW, 384);
130694
+ try {
130695
+ await handle.writeFile(contents, "utf8");
130696
+ await handle.sync();
130697
+ } finally {
130698
+ await handle.close();
130699
+ }
130700
+ await rename11(temp, join115(dir, name));
130701
+ } catch (error) {
130702
+ await rm19(temp, { force: true });
130703
+ throw error;
130704
+ }
130705
+ const directory = await open5(dir, O_RDONLY | O_DIRECTORY);
130706
+ try {
130707
+ await directory.sync().catch(() => {
130708
+ return;
130709
+ });
130710
+ } finally {
130711
+ await directory.close();
130712
+ }
130713
+ }
130714
+ async function removeStateFile(dir, name) {
130715
+ await removeTempLeftovers(dir, name);
130716
+ await rm19(join115(dir, name), { force: true });
130717
+ }
130718
+ function createStateFileStore(input) {
130719
+ const { api, name, codec, failure } = input;
130720
+ const log = input.log ?? ((line) => process.stderr.write(`${line}
130721
+ `));
130722
+ const uid = process.getuid?.() ?? -1;
130723
+ const directory = () => stateFileDirectory(input.home ?? accountHome());
130724
+ const failed = (operation, error) => error instanceof StateFileRefused ? failure(`omo: cannot ${operation} the private sign-in file in ${directory()}: ${error.message}.`) : failure(`omo: cannot ${operation} the private sign-in file in ${directory()} (${errnoCode(error) ?? "unknown"}).`);
130725
+ const text = async () => {
130726
+ try {
130727
+ return await readStateFile(directory(), name, uid);
130728
+ } catch (error) {
130729
+ if (!(error instanceof StateFileRefused))
130730
+ throw failed("read", error);
130731
+ log(`omo: ${error.message} in ${directory()} and is not used; this computer reads as signed out.`);
130732
+ return null;
130733
+ }
130734
+ };
130735
+ const read = async () => {
130736
+ const stored = await text();
130737
+ return stored === null ? null : codec.parse(stored);
130738
+ };
130739
+ const locked = (action) => withCredentialLock(api, action, input.home ?? accountHome());
130740
+ return {
130741
+ read,
130742
+ readAuthoritative: read,
130743
+ text,
130744
+ directory,
130745
+ present: async () => await lstat19(join115(directory(), name)).catch(() => null) !== null,
130746
+ write: (value) => locked(async () => {
130747
+ const next = codec.amend === undefined ? value : codec.amend(await text(), value);
130748
+ try {
130749
+ await writeStateFile(directory(), name, codec.serialize(next), uid);
130750
+ } catch (error) {
130751
+ throw failed("write", error);
130752
+ }
130753
+ }),
130754
+ clear: () => locked(async () => {
130755
+ try {
130756
+ await removeStateFile(directory(), name);
130757
+ } catch (error) {
130758
+ throw failed("remove", error);
130759
+ }
130760
+ })
130761
+ };
130762
+ }
130763
+
130348
130764
  // packages/omo-opencode/src/cli/service-auth/keystore.ts
130349
130765
  class CredentialStoreError extends SignInError {
130350
130766
  }
@@ -130387,19 +130803,21 @@ var stderrNoticeOncePerProcess = (message) => {
130387
130803
  `);
130388
130804
  };
130389
130805
  var isLocked = (error) => error instanceof Error && (LOCKED.test(error.message) || LOCKED.test(String(error.code ?? "")));
130806
+ var sameCredentialIdentity = (current, value) => current.device.id === value.device.id && current.signingPrivateKey === value.signingPrivateKey && current.sealingPrivateKey === value.sealingPrivateKey && (value.accountId === undefined || current.accountId === undefined || current.accountId === value.accountId);
130807
+ var relateCredentials = (keyring, file) => !sameCredentialIdentity(keyring, file) || keyring.credentialGeneration !== undefined && file.credentialGeneration !== undefined && keyring.credentialGeneration !== file.credentialGeneration ? "other" : Date.parse(keyring.accessTokenExpiresAt) <= Date.parse(file.accessTokenExpiresAt) ? "older" : "newer";
130390
130808
  function credentialId(api) {
130391
130809
  return createHash14("sha256").update(serviceOrigin(api)).digest("hex");
130392
130810
  }
130393
130811
  function createCredentialStore(api, options = {}) {
130394
130812
  const store = createSealedStore(api, "omo-cli", credentialSchema, options.secrets, options.platform, options.lockProbe, options.notice, options.wait, (current, value) => {
130395
- const sameIdentity = current !== null && current.device.id === value.device.id && current.signingPrivateKey === value.signingPrivateKey && current.sealingPrivateKey === value.sealingPrivateKey && (value.accountId === undefined || current.accountId === undefined || current.accountId === value.accountId);
130813
+ const sameIdentity = current !== null && sameCredentialIdentity(current, value);
130396
130814
  const accountId = value.accountId ?? (sameIdentity ? current?.accountId : undefined);
130397
130815
  return {
130398
130816
  ...value,
130399
130817
  ...accountId === undefined ? {} : { accountId },
130400
130818
  credentialGeneration: sameIdentity ? current?.credentialGeneration ?? randomUUID8() : randomUUID8()
130401
130819
  };
130402
- }, options.keychainHelper);
130820
+ }, options.keychainHelper, { ...options.home === undefined ? {} : { home: options.home }, relate: relateCredentials });
130403
130821
  const sections = new WeakMap;
130404
130822
  const underLock = (lease) => {
130405
130823
  const known = sections.get(lease);
@@ -130438,12 +130856,46 @@ function createCredentialStore(api, options = {}) {
130438
130856
  clear: () => locked((view) => view.clear(), store.clear),
130439
130857
  ...store.prepare === undefined ? {} : { prepare: store.prepare },
130440
130858
  underLock,
130441
- ...store.migrationPending === undefined ? {} : { migrationPending: store.migrationPending }
130859
+ ...store.migrationPending === undefined ? {} : { migrationPending: store.migrationPending },
130860
+ ...store.storage === undefined ? {} : { storage: store.storage }
130442
130861
  };
130443
130862
  }
130444
- function createSealedStore(api, namespace, schema, secrets = typeof Bun === "undefined" ? null : Bun.secrets, platform = process.platform, lockProbe = probeSecretServiceLock, notice = stderrNoticeOncePerProcess, wait = SESSION_READ_WAIT, amendWrite, keychainHelper) {
130445
- if (!secrets)
130863
+ function createSealedStore(api, namespace, schema, secrets = typeof Bun === "undefined" ? null : Bun.secrets, platform = process.platform, lockProbe = probeSecretServiceLock, notice = stderrNoticeOncePerProcess, wait = SESSION_READ_WAIT, amendWrite, keychainHelper, linux = {}) {
130864
+ const { home } = linux;
130865
+ const parseStored = (value) => {
130866
+ try {
130867
+ return schema.parse(JSON.parse(value));
130868
+ } catch {
130869
+ throw new InvalidCredentialState(signInRoute() === "cli" ? "Stored sign-in data is invalid. Run omo account forget, then omo login." : "The OmO sign-in saved on this computer can't be read. Run omo account forget to remove it, then sign in again from the OmO desktop app on this computer, or with omo login in a terminal.");
130870
+ }
130871
+ };
130872
+ const previousOf = (raw) => {
130873
+ if (raw === null)
130874
+ return null;
130875
+ try {
130876
+ return schema.parse(JSON.parse(raw));
130877
+ } catch {
130878
+ return null;
130879
+ }
130880
+ };
130881
+ const codec = {
130882
+ parse: parseStored,
130883
+ serialize: (value) => JSON.stringify(schema.parse(value)),
130884
+ ...amendWrite === undefined ? {} : { amend: (raw, next) => amendWrite(previousOf(raw), next) }
130885
+ };
130886
+ const stateFile = platform === "linux" ? createStateFileStore({
130887
+ api,
130888
+ name: `${namespace}-${credentialId(api)}.json`,
130889
+ codec,
130890
+ failure: (message) => new CredentialStoreError(message),
130891
+ ...home === undefined ? {} : { home }
130892
+ }) : null;
130893
+ if (!secrets) {
130894
+ if (stateFile !== null)
130895
+ return { ...stateFile, storage: () => "file" };
130446
130896
  throw new SignInError("OmO sign-in needs Bun 1.4 or newer with OS credential storage. No file fallback is available.");
130897
+ }
130898
+ const neverInAFile = platform === "linux" ? "" : " Credentials are never saved to a file.";
130447
130899
  const platformName = platform === "darwin" ? "macOS Keychain" : platform === "linux" ? "Linux Secret Service (libsecret and an unlocked keyring)" : platform === "win32" ? "Windows Credential Manager" : null;
130448
130900
  if (platformName === null)
130449
130901
  throw new SignInError("This platform has no supported OS credential store.");
@@ -130499,7 +130951,7 @@ ${key.name}`;
130499
130951
  return await read;
130500
130952
  }
130501
130953
  const expired = new Promise((_, reject) => {
130502
- timer = setTimeout(() => reject(new KeychainApprovalPendingError(`${waitingFor}, then try again. Credentials are never saved to a file.`)), wait.deadlineMs);
130954
+ timer = setTimeout(() => reject(new KeychainApprovalPendingError(`${waitingFor}, then try again.${neverInAFile}`)), wait.deadlineMs);
130503
130955
  });
130504
130956
  return await Promise.race([read, expired]);
130505
130957
  } finally {
@@ -130507,42 +130959,19 @@ ${key.name}`;
130507
130959
  }
130508
130960
  };
130509
130961
  const lockedHint = platform === "darwin" ? " On an unattended Mac, omo account store enable keeps the sign-in in OmO's own keychain." : "";
130510
- const unavailable = (error) => isLocked(error) ? new KeychainLockedError(`${platformName} is locked. Unlock it, then try again. Credentials are never saved to a file.${lockedHint}`) : new CredentialStoreError(`Cannot access ${platformName}. Unlock or enable the OS credential store and try again. Credentials are never saved to a file.`);
130962
+ const unavailable = (error) => isLocked(error) ? new KeychainLockedError(`${platformName} is locked. Unlock it, then try again.${neverInAFile}${lockedHint}`) : new CredentialStoreError(`Cannot access ${platformName}. Unlock or enable the OS credential store and try again.${neverInAFile}`);
130511
130963
  let unlockedUntil = 0;
130512
- let noticed = false;
130513
- const assertUsable = async () => {
130514
- if (platform !== "linux" || Date.now() < unlockedUntil)
130515
- return;
130964
+ const keyringState = async () => {
130965
+ if (Date.now() < unlockedUntil)
130966
+ return "unlocked";
130516
130967
  const lock = await lockProbe();
130517
130968
  if (lock === "locked")
130518
- throw new KeychainLockedError(`${platformName} is locked. Unlock it, then try again. Credentials are never saved to a file.`);
130519
- if (lock === "unlocked") {
130969
+ throw new KeychainLockedError(`${platformName} is locked. Unlock it, then try again.`);
130970
+ if (lock === "unlocked")
130520
130971
  unlockedUntil = Date.now() + UNLOCKED_REUSE_MS;
130521
- return;
130522
- }
130523
- if (!noticed) {
130524
- noticed = true;
130525
- notice("omo: could not check whether the keyring is locked (gdbus or the Secret Service did not answer); using libsecret directly.");
130526
- }
130527
- };
130528
- const parseStored = (value) => {
130529
- try {
130530
- return schema.parse(JSON.parse(value));
130531
- } catch {
130532
- throw new InvalidCredentialState(signInRoute() === "cli" ? "Stored sign-in data is invalid. Run omo account forget, then omo login." : "The OmO sign-in saved on this computer can't be read. Run omo account forget to remove it, then sign in again from the OmO desktop app on this computer, or with omo login in a terminal.");
130533
- }
130534
- };
130535
- const previousOf = (raw) => {
130536
- if (raw === null)
130537
- return null;
130538
- try {
130539
- return schema.parse(JSON.parse(raw));
130540
- } catch {
130541
- return null;
130542
- }
130972
+ return lock;
130543
130973
  };
130544
130974
  const rawRead = async (fresh) => {
130545
- await assertUsable();
130546
130975
  const backend = await helper.backend();
130547
130976
  try {
130548
130977
  if (backend === null)
@@ -130572,7 +131001,7 @@ ${key.name}`;
130572
131001
  return mapped;
130573
131002
  return unavailable(mapped);
130574
131003
  };
130575
- return {
131004
+ const keyring = {
130576
131005
  read: () => parsedRead(false),
130577
131006
  readAuthoritative: () => parsedRead(true),
130578
131007
  async prepare() {
@@ -130583,16 +131012,10 @@ ${key.name}`;
130583
131012
  const backend = await helper.backend();
130584
131013
  if (backend === null)
130585
131014
  return null;
130586
- const codec = {
130587
- parse: parseStored,
130588
- serialize: (value) => JSON.stringify(schema.parse(value)),
130589
- ...amendWrite === undefined ? {} : { amend: (raw, next) => amendWrite(previousOf(raw), next) }
130590
- };
130591
131015
  return lockedStoreView(backend, lease, codec, lockedFailure, () => forget(helper.reader(backend)));
130592
131016
  },
130593
131017
  migrationPending: async () => (await helper.backend())?.migrationPending() ?? false,
130594
131018
  async write(value) {
130595
- await assertUsable();
130596
131019
  if (await helper.backend() !== null)
130597
131020
  throw new Error("OmO's keychain helper writes only under the session lock.");
130598
131021
  try {
@@ -130604,7 +131027,6 @@ ${key.name}`;
130604
131027
  forget(secrets);
130605
131028
  },
130606
131029
  async clear() {
130607
- await assertUsable();
130608
131030
  if (await helper.backend() !== null)
130609
131031
  throw new Error("OmO's keychain helper deletes only under the session lock.");
130610
131032
  try {
@@ -130613,8 +131035,49 @@ ${key.name}`;
130613
131035
  throw unavailable(error);
130614
131036
  }
130615
131037
  forget(secrets);
131038
+ },
131039
+ storage: () => "keyring"
131040
+ };
131041
+ if (stateFile === null)
131042
+ return keyring;
131043
+ return routeLinuxStore({
131044
+ api,
131045
+ keyring,
131046
+ file: stateFile,
131047
+ probe: keyringState,
131048
+ notice,
131049
+ ...home === undefined ? {} : { home },
131050
+ async relation(text) {
131051
+ let stored;
131052
+ try {
131053
+ stored = await answered(secrets, true);
131054
+ } catch (error) {
131055
+ throw error instanceof CredentialStoreError ? error : unavailable(error);
131056
+ } finally {
131057
+ forget(secrets);
131058
+ }
131059
+ if (stored === null)
131060
+ return "empty";
131061
+ if (stored === text)
131062
+ return "older";
131063
+ const inKeyring = previousOf(stored);
131064
+ const inFile = previousOf(text);
131065
+ if (inKeyring === null || inFile === null || linux.relate === undefined)
131066
+ return "other";
131067
+ return linux.relate(inKeyring, inFile);
131068
+ },
131069
+ async moveToKeyring(text) {
131070
+ try {
131071
+ await secrets.set({ ...key, value: text });
131072
+ if (await answered(secrets, true) !== text)
131073
+ throw new CredentialStoreError(`${platformName} did not return the sign-in it was given; it stays in the private file until it does.`);
131074
+ } catch (error) {
131075
+ throw error instanceof CredentialStoreError ? error : unavailable(error);
131076
+ } finally {
131077
+ forget(secrets);
131078
+ }
130616
131079
  }
130617
- };
131080
+ });
130618
131081
  }
130619
131082
 
130620
131083
  // packages/omo-opencode/src/cli/service-auth/session.ts
@@ -130729,8 +131192,8 @@ async function requestApi(api, path, init, signal) {
130729
131192
 
130730
131193
  // packages/omo-opencode/src/cli/service-auth/machine-reconcile.ts
130731
131194
  import { createHash as createHash15, createPrivateKey as createPrivateKey3, sign } from "node:crypto";
130732
- import { mkdir as mkdir14, readFile as readFile39, rename as rename11, rm as rm19, writeFile as writeFile18 } from "node:fs/promises";
130733
- import { dirname as dirname48, join as join115 } from "node:path";
131195
+ import { mkdir as mkdir15, readFile as readFile39, rename as rename12, rm as rm20, writeFile as writeFile18 } from "node:fs/promises";
131196
+ import { dirname as dirname48, join as join116 } from "node:path";
130734
131197
  init_zod();
130735
131198
  var MACHINE_BIND_CONTEXT = "omo-machine-bind-v1";
130736
131199
  var DEVICE_FIXUP_BUDGET_MS = 5000;
@@ -130745,7 +131208,7 @@ var ownDeviceSchema = object({
130745
131208
  });
130746
131209
  var refusalNoteSchema = object({ key: string2(), at: number2() });
130747
131210
  var thisMachine = { digest: () => readMachineDigest(), name: () => deviceName() };
130748
- var machineRefusalPath = (home, credential) => join115(home, ".omo", "account-state", `${credential}.machine-exists.json`);
131211
+ var machineRefusalPath = (home, credential) => join116(home, ".omo", "account-state", `${credential}.machine-exists.json`);
130749
131212
  var describe4 = (error) => error instanceof Error ? error.message : String(error);
130750
131213
  var refusalKey = (deviceId, digest) => createHash15("sha256").update(`${deviceId}
130751
131214
  ${digest}`, "utf8").digest("hex");
@@ -130772,13 +131235,13 @@ async function refusedRecently(path, key, nowMs, signal) {
130772
131235
  return note.success && note.data.key === key && nowMs - note.data.at < MACHINE_EXISTS_RETRY_MS;
130773
131236
  }
130774
131237
  async function rememberRefusal(path, key, nowMs, signal) {
130775
- await mkdir14(dirname48(path), { recursive: true, mode: 448 });
131238
+ await mkdir15(dirname48(path), { recursive: true, mode: 448 });
130776
131239
  const staging = `${path}.${process.pid}.tmp`;
130777
131240
  await writeFile18(staging, JSON.stringify({ key, at: nowMs }), { mode: 384, signal });
130778
131241
  if (signal.aborted)
130779
- await rm19(staging, { force: true });
131242
+ await rm20(staging, { force: true });
130780
131243
  else
130781
- await rename11(staging, path);
131244
+ await rename12(staging, path);
130782
131245
  }
130783
131246
  async function reconcileDevice(options) {
130784
131247
  const { credentials, request, signal } = options;
@@ -130873,10 +131336,10 @@ async function bindOnce(options, auth, log) {
130873
131336
 
130874
131337
  // packages/omo-opencode/src/cli/service-auth/signed-out-marker.ts
130875
131338
  init_zod();
130876
- import { mkdir as mkdir15, readFile as readFile40, rename as rename12, rm as rm20, writeFile as writeFile19 } from "node:fs/promises";
130877
- import { dirname as dirname49, join as join116 } from "node:path";
131339
+ import { mkdir as mkdir16, readFile as readFile40, rename as rename13, rm as rm21, writeFile as writeFile19 } from "node:fs/promises";
131340
+ import { dirname as dirname49, join as join117 } from "node:path";
130878
131341
  var markerSchema = object({ device: string2().nullable(), at: string2() });
130879
- var signedOutMarkerPath = (home, credential) => join116(home, ".omo", "account-state", `${credential}.signed-out.json`);
131342
+ var signedOutMarkerPath = (home, credential) => join117(home, ".omo", "account-state", `${credential}.signed-out.json`);
130880
131343
  async function readSignedOutMarker(path) {
130881
131344
  const text = await readFile40(path, "utf8").catch(() => null);
130882
131345
  if (text === null)
@@ -130891,14 +131354,14 @@ async function readSignedOutMarker(path) {
130891
131354
  return parsed.success ? parsed.data : null;
130892
131355
  }
130893
131356
  async function writeSignedOutMarker(path, device) {
130894
- await mkdir15(dirname49(path), { recursive: true, mode: 448 });
131357
+ await mkdir16(dirname49(path), { recursive: true, mode: 448 });
130895
131358
  const staging = `${path}.${process.pid}.tmp`;
130896
131359
  await writeFile19(staging, JSON.stringify({ device, at: new Date().toISOString() }), {
130897
131360
  mode: 384
130898
131361
  });
130899
- await rename12(staging, path);
131362
+ await rename13(staging, path);
130900
131363
  }
130901
- var clearSignedOutMarker = (path) => rm20(path, { force: true });
131364
+ var clearSignedOutMarker = (path) => rm21(path, { force: true });
130902
131365
 
130903
131366
  // packages/omo-opencode/src/cli/service-auth/session.ts
130904
131367
  class SessionEnded extends SignInError {
@@ -130939,6 +131402,18 @@ function createSession(options) {
130939
131402
  const id = typeof body === "object" && body !== null && "account" in body && typeof body.account === "object" && body.account !== null && "id" in body.account ? body.account.id : undefined;
130940
131403
  return typeof id === "string" && id !== "" ? id : undefined;
130941
131404
  };
131405
+ const unstampedAccount = async (current, access) => {
131406
+ if (current.accountId !== undefined || current.owner !== undefined)
131407
+ return;
131408
+ if (await beforeKeysDiscarded.wantsAccount?.() !== true)
131409
+ return;
131410
+ const budget = AbortSignal.timeout(options.machine?.budgetMs ?? DEVICE_FIXUP_BUDGET_MS);
131411
+ return accountOf(access, signal === undefined ? budget : AbortSignal.any([signal, budget]));
131412
+ };
131413
+ async function discard(current, cause) {
131414
+ const account = Date.parse(current.accessTokenExpiresAt) > now() ? await unstampedAccount(current, current.accessToken) : undefined;
131415
+ await beforeKeysDiscarded(discardedOf(account === undefined ? current : { ...current, accountId: account }, cause));
131416
+ }
130942
131417
  async function refreshed(current) {
130943
131418
  if (current.refreshState === "uncertain" || current.refreshAttempt !== undefined) {
130944
131419
  throw new SessionEnded(`Refresh recovery can no longer be proved safe. ${signInHint("again")}`, false, "refresh_recovery_expired");
@@ -130956,7 +131431,7 @@ function createSession(options) {
130956
131431
  if (error instanceof CredentialStoreError)
130957
131432
  throw error;
130958
131433
  if (error instanceof ApiRefusal && error.status < 500 && ["unauthorized", "account_deleted", "reauth_required", "invalid_grant", "device_revoked"].includes(error.code)) {
130959
- await beforeKeysDiscarded(discardedOf(current, "refused"));
131434
+ await discard(current, "refused");
130960
131435
  await store.clear();
130961
131436
  await deviceService?.forget();
130962
131437
  throw new SessionEnded(error.code === "reauth_required" ? `This session was ended because its refresh token was reused. ${signInHint("again")}` : refusalMessage(refusalGuidance(error.code, error.status)), DEVICE_REVOKING_REFUSALS.has(error.code), error.code);
@@ -131065,7 +131540,7 @@ function createSession(options) {
131065
131540
  stored = null;
131066
131541
  }
131067
131542
  if (stored !== null && stored.device.id !== value.device.id)
131068
- await beforeKeysDiscarded(discardedOf(stored, "replaced"));
131543
+ await discard(stored, "replaced");
131069
131544
  await store.write(value, "fresh-sign-in", () => beforeKeysDiscarded({ kind: "unreadable" }));
131070
131545
  await clearSignedOutMarker(markerPath);
131071
131546
  });
@@ -131086,8 +131561,23 @@ function createSession(options) {
131086
131561
  return action(current);
131087
131562
  });
131088
131563
  },
131564
+ discard,
131089
131565
  async forget() {
131090
- await locked(() => store.clear());
131566
+ await locked(async () => {
131567
+ let current;
131568
+ try {
131569
+ current = await store.readAuthoritative();
131570
+ } catch (error) {
131571
+ if (!(error instanceof InvalidCredentialState || error instanceof CredentialStoreError))
131572
+ throw error;
131573
+ await store.clear();
131574
+ await beforeKeysDiscarded({ kind: "unreadable" });
131575
+ return;
131576
+ }
131577
+ if (current !== null)
131578
+ await discard(current, "forget");
131579
+ await store.clear();
131580
+ });
131091
131581
  await deviceService?.forget();
131092
131582
  },
131093
131583
  accessSnapshot: snapshot,
@@ -131103,9 +131593,7 @@ function createSession(options) {
131103
131593
  if (current.refreshState === "uncertain")
131104
131594
  return false;
131105
131595
  const access = Date.parse(current.accessTokenExpiresAt) <= now() ? (await refreshed(current)).accessToken : current.accessToken;
131106
- if (current.accountId === undefined && current.owner === undefined && await beforeKeysDiscarded.wantsAccount?.() === true) {
131107
- account = await accountOf(access);
131108
- }
131596
+ account = await unstampedAccount(current, access);
131109
131597
  await request(`/v1/devices/${encodeURIComponent(current.device.id)}`, {
131110
131598
  method: "DELETE",
131111
131599
  headers: syncRequestHeaders(access)
@@ -131201,6 +131689,26 @@ async function refuseSecondMachineDevice(session, deviceService) {
131201
131689
  }
131202
131690
  }
131203
131691
 
131692
+ // packages/omo-opencode/src/cli/service-auth/login-prelude.ts
131693
+ class AccountsUnreachable extends SignInError {
131694
+ }
131695
+ async function ensureServiceAvailable(session, api) {
131696
+ try {
131697
+ return await session.request("/v1/health", { method: "GET" });
131698
+ } catch (error) {
131699
+ if (!(error instanceof SignInError))
131700
+ throw error;
131701
+ if (error instanceof RequestFailure) {
131702
+ throw new AccountsUnreachable(`Can't reach OmO accounts at ${api}. The service may not be available yet, or your network, proxy or certificate settings are blocking it.`);
131703
+ }
131704
+ throw new AccountsUnreachable(`OmO accounts at ${api} aren't available right now. Try again later.`);
131705
+ }
131706
+ }
131707
+ async function beginLogin(session, deviceService, api) {
131708
+ await refuseSecondMachineDevice(session, deviceService);
131709
+ return ensureServiceAvailable(session, api);
131710
+ }
131711
+
131204
131712
  // packages/omo-opencode/src/cli/service-auth/device-flow.ts
131205
131713
  import { setTimeout as setTimeout2 } from "node:timers/promises";
131206
131714
 
@@ -131223,6 +131731,13 @@ function generateDeviceKeys() {
131223
131731
  }
131224
131732
 
131225
131733
  // packages/omo-opencode/src/cli/service-auth/device-flow.ts
131734
+ class DeviceSignInRefused extends SignInError {
131735
+ code;
131736
+ constructor(code, message) {
131737
+ super(message);
131738
+ this.code = code;
131739
+ }
131740
+ }
131226
131741
  var REPLACE_UNSUPPORTED = "This OmO service can't replace a computer's earlier device yet. Remove that device on the Devices page of your OmO account, then run omo login again.";
131227
131742
  var REPLACE_MISMATCH = "The device chosen on the approval page is not this computer's earlier device, so nothing was replaced or saved. Run omo login again to start over, and choose this computer's device when replacing.";
131228
131743
  async function loginDevice(session, options) {
@@ -131247,7 +131762,7 @@ async function replaceEarlierDevice(session, options, keys, existing) {
131247
131762
  });
131248
131763
  } catch (error) {
131249
131764
  if (error instanceof ApiRefusal && error.code === "machine_exists")
131250
- throw new SignInError(REPLACE_UNSUPPORTED);
131765
+ throw new DeviceSignInRefused("replace_unsupported", REPLACE_UNSUPPORTED);
131251
131766
  throw error;
131252
131767
  }
131253
131768
  }
@@ -131263,7 +131778,8 @@ async function authorizeDevice(session, options, keys, replace) {
131263
131778
  options.show({
131264
131779
  verificationUri: minted.verificationUri,
131265
131780
  userCode: minted.userCode,
131266
- matchingCode: minted.matchingCode
131781
+ matchingCode: minted.matchingCode,
131782
+ expiresAt: minted.expiresAt
131267
131783
  });
131268
131784
  const now = options.now ?? Date.now;
131269
131785
  const sleep = options.sleep ?? ((ms) => setTimeout2(ms, undefined, { signal: session.signal }));
@@ -131300,27 +131816,27 @@ async function authorizeDevice(session, options, keys, replace) {
131300
131816
  if (error.detail !== undefined) {
131301
131817
  if (await session.removeForLimit(error, options.chooseDevice))
131302
131818
  continue;
131303
- throw new SignInError("Sign-in cancelled. No device was removed.");
131819
+ throw new DeviceSignInRefused("device_limit", "Sign-in cancelled. No device was removed.");
131304
131820
  }
131305
131821
  if (error.replaceMismatch)
131306
- throw new SignInError(REPLACE_MISMATCH);
131822
+ throw new DeviceSignInRefused("replace_mismatch", REPLACE_MISMATCH);
131307
131823
  if (["access_denied", "expired_token", "invalid_grant"].includes(error.code)) {
131308
- throw new SignInError("Device sign-in was denied or expired. Run omo login again for a new code.");
131824
+ throw new DeviceSignInRefused(error.code === "access_denied" ? "approval_denied" : "approval_expired", "Device sign-in was denied or expired. Run omo login again for a new code.");
131309
131825
  }
131310
131826
  throw error;
131311
131827
  }
131312
131828
  }
131313
- throw new SignInError("Device sign-in expired. Run omo login again for a new code.");
131829
+ throw new DeviceSignInRefused("approval_expired", "Device sign-in expired. Run omo login again for a new code.");
131314
131830
  }
131315
131831
 
131316
131832
  // packages/omo-opencode/src/cli/service-auth/loopback.ts
131317
- import { createHash as createHash16, randomBytes as randomBytes5, timingSafeEqual } from "node:crypto";
131833
+ import { createHash as createHash16, randomBytes as randomBytes6, timingSafeEqual } from "node:crypto";
131318
131834
  import { createServer as createServer3 } from "node:http";
131319
131835
  class BrowserUnavailable extends SignInError {
131320
131836
  }
131321
131837
  async function authorize(options) {
131322
- const verifier = randomBytes5(32).toString("base64url");
131323
- const state = randomBytes5(32).toString("base64url");
131838
+ const verifier = randomBytes6(32).toString("base64url");
131839
+ const state = randomBytes6(32).toString("base64url");
131324
131840
  const answer = Promise.withResolvers();
131325
131841
  const abort = () => answer.reject(new SignInError("Browser sign-in cancelled or timed out."));
131326
131842
  let accepted = false;
@@ -131458,15 +131974,15 @@ function decideReplace(options) {
131458
131974
  }
131459
131975
 
131460
131976
  // packages/memory-core/src/sync/device-retire.ts
131461
- import { createHash as createHash17, randomBytes as randomBytes6 } from "node:crypto";
131462
- import { join as join119 } from "node:path";
131977
+ import { createHash as createHash17, randomBytes as randomBytes7 } from "node:crypto";
131978
+ import { join as join120 } from "node:path";
131463
131979
 
131464
131980
  // packages/memory-core/src/identity/layout.ts
131465
131981
  import { homedir as homedir35 } from "node:os";
131466
- import { join as join117, resolve as resolve31 } from "node:path";
131982
+ import { join as join118, resolve as resolve31 } from "node:path";
131467
131983
  var MEMORY_ROOT_ENV_VAR = "OMO_MEMORY_HOME";
131468
131984
  function defaultMemoryRoot() {
131469
- return join117(homedir35(), ".omo", "memory");
131985
+ return join118(homedir35(), ".omo", "memory");
131470
131986
  }
131471
131987
  function resolveMemoryRoot(env, cwd) {
131472
131988
  const override = env[MEMORY_ROOT_ENV_VAR];
@@ -131476,13 +131992,13 @@ function resolveMemoryRoot(env, cwd) {
131476
131992
  return resolve31(cwd, override);
131477
131993
  }
131478
131994
  // packages/memory-core/src/sync/pin-dir.ts
131479
- import { join as join118 } from "node:path";
131480
- var syncPinDir = (memoryRoot) => join118(memoryRoot, "sync-device");
131995
+ import { join as join119 } from "node:path";
131996
+ var syncPinDir = (memoryRoot) => join119(memoryRoot, "sync-device");
131481
131997
 
131482
131998
  // packages/memory-core/src/sync/device-retire.ts
131483
- var trustAnchorRoot = (pinDir) => join119(pinDir, "trust-anchor");
131999
+ var trustAnchorRoot = (pinDir) => join120(pinDir, "trust-anchor");
131484
132000
  var trustAnchorKey = (account) => createHash17("sha256").update(account, "utf8").digest("base64url");
131485
- var trustAnchorDir = (pinDir, account) => join119(trustAnchorRoot(pinDir), trustAnchorKey(account));
132001
+ var trustAnchorDir = (pinDir, account) => join120(trustAnchorRoot(pinDir), trustAnchorKey(account));
131486
132002
  var hasLiveTrustAnchor = async (pinDir) => {
131487
132003
  try {
131488
132004
  return (await readdir17(trustAnchorRoot(pinDir))).some((name) => !name.includes(".retired-"));
@@ -131495,7 +132011,7 @@ var hasLiveTrustAnchor = async (pinDir) => {
131495
132011
  var retireSyncDevice = async (input) => {
131496
132012
  const dir = trustAnchorDir(input.pinDir, input.account);
131497
132013
  try {
131498
- await rename8(dir, `${dir}.retired-${Date.now()}-${randomBytes6(4).toString("hex")}`);
132014
+ await rename8(dir, `${dir}.retired-${Date.now()}-${randomBytes7(4).toString("hex")}`);
131499
132015
  } catch (error) {
131500
132016
  if (!(error instanceof Error && ("code" in error) && error.code === "ENOENT"))
131501
132017
  throw error;
@@ -131505,21 +132021,26 @@ var retireSyncDevice = async (input) => {
131505
132021
  // packages/omo-opencode/src/cli/service-auth/sync-pin-retire.ts
131506
132022
  var reason = (error) => error instanceof Error && ("code" in error) && typeof error.code === "string" ? error.code : "unknown";
131507
132023
  function retireSyncPinOnDiscard(options) {
132024
+ const livePin = () => hasLiveTrustAnchor(options.pinDir()).catch(() => false);
131508
132025
  const hook = async (discarded) => {
131509
132026
  if (discarded.kind === "unreadable") {
131510
- options.log("memory sync: a stored sign-in could not be read while it was replaced; its sync pin was left in place");
132027
+ if (await livePin())
132028
+ options.log("memory sync: a stored sign-in could not be read when its keys were discarded; its sync pin was left in place");
131511
132029
  return;
131512
132030
  }
131513
132031
  const account = discarded.owner?.accountId ?? discarded.accountId;
131514
- if (account === undefined)
132032
+ if (account === undefined) {
132033
+ if (await livePin())
132034
+ options.log("memory sync: the account of this sign-in is unknown, so a sync pin was kept; if it belongs to this sign-in's account, clear it with `omo account retire-sync --account <id>`. Do not retire the pin of an account that is still signed in here, such as the desktop's.");
131515
132035
  return;
132036
+ }
131516
132037
  try {
131517
132038
  await retireSyncDevice({ pinDir: options.pinDir(), account });
131518
132039
  } catch (error) {
131519
132040
  options.log(`memory sync: the sync pin could not be retired (${reason(error)}); it was left in place`);
131520
132041
  }
131521
132042
  };
131522
- return Object.assign(hook, { wantsAccount: () => hasLiveTrustAnchor(options.pinDir()).catch(() => false) });
132043
+ return Object.assign(hook, { wantsAccount: livePin });
131523
132044
  }
131524
132045
 
131525
132046
  // packages/omo-opencode/src/cli/service-auth/commands.ts
@@ -131527,22 +132048,6 @@ function noteDedicatedStore() {
131527
132048
  if (process.platform === "darwin" && dedicatedStoreState() === "active")
131528
132049
  console.log("The sign-in is kept in OmO's own keychain on this Mac (omo account store status).");
131529
132050
  }
131530
- async function ensureServiceAvailable(session, api) {
131531
- try {
131532
- return await session.request("/v1/health", { method: "GET" });
131533
- } catch (error) {
131534
- if (!(error instanceof SignInError))
131535
- throw error;
131536
- if (error instanceof RequestFailure) {
131537
- 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.`);
131538
- }
131539
- throw new SignInError(`OmO accounts at ${api} aren't available right now. Try again later.`);
131540
- }
131541
- }
131542
- async function beginLogin(session, deviceService, api) {
131543
- await refuseSecondMachineDevice(session, deviceService);
131544
- return ensureServiceAvailable(session, api);
131545
- }
131546
132051
  function deviceChoices(devices) {
131547
132052
  return devices.map((device) => ({ value: device.id, label: terminalText(device.name) }));
131548
132053
  }
@@ -131806,6 +132311,9 @@ var forgetDeviceService = async (options) => {
131806
132311
  }
131807
132312
  return "forgotten";
131808
132313
  };
132314
+ // packages/device-service-core/src/cold-wake/host.ts
132315
+ var UNREPAIRABLE = new Set(["EPERM", "EACCES", "EROFS"]);
132316
+
131809
132317
  // packages/device-service-core/src/cold-wake/service-table.ts
131810
132318
  var SERVICE_TABLE_ENV = "OMO_RELAYD_SERVICES";
131811
132319
 
@@ -131971,7 +132479,7 @@ init_timers();
131971
132479
  // packages/omo-native/package.json
131972
132480
  var package_default4 = {
131973
132481
  name: "omo-ai",
131974
- version: "5.1.78",
132482
+ version: "5.1.81",
131975
132483
  type: "module",
131976
132484
  description: "OmO Native - the standalone omo command with the OMO extension built in: bun add -g omo-ai",
131977
132485
  bin: {
@@ -131988,7 +132496,7 @@ var package_default4 = {
131988
132496
  postinstall: "node bin/senpi-patch.mjs"
131989
132497
  },
131990
132498
  dependencies: {
131991
- "@code-yeongyu/senpi": "2026.11.18-2"
132499
+ "@code-yeongyu/senpi": "2026.11.19-5"
131992
132500
  },
131993
132501
  repository: {
131994
132502
  type: "git",
@@ -132166,10 +132674,11 @@ init_device_service3();
132166
132674
  init_codes();
132167
132675
  init_factories();
132168
132676
  init_seams();
132677
+ init_address();
132169
132678
 
132170
132679
  // packages/omo-senpi/src/components/remote/device-address.ts
132171
- init_plan_create();
132172
- init_remote_ops();
132680
+ init_address();
132681
+ init_errors5();
132173
132682
  // packages/omo-senpi/src/components/thread/gateway/store.ts
132174
132683
  init_constants6();
132175
132684
  init_provenance_resolver();
@@ -132201,6 +132710,7 @@ init_relay_transport();
132201
132710
  // packages/omo-senpi/src/components/thread/gateway/engine.ts
132202
132711
  init_addressing();
132203
132712
  init_errors5();
132713
+ init_fields();
132204
132714
  init_constants6();
132205
132715
  init_result2();
132206
132716
  init_provenance_resolver();
@@ -132217,9 +132727,6 @@ init_thread_row();
132217
132727
  // packages/omo-native/bin/lib/package-paths.js
132218
132728
  import { fileURLToPath as fileURLToPath9 } from "node:url";
132219
132729
  var packageRoot = fileURLToPath9(new URL("../..", import.meta.url));
132220
- // packages/omo-native/remote-session-target.ts
132221
- init_errors5();
132222
- init_address_book();
132223
132730
 
132224
132731
  // packages/omo-native/remote-session-verbs.ts
132225
132732
  init_remote_ops();
@@ -132300,7 +132807,7 @@ var USAGE_ENTRIES = [
132300
132807
  },
132301
132808
  {
132302
132809
  verbs: ["close"],
132303
- text: " close <session> end the session; also takes <device>/<session>"
132810
+ text: " close <session> [--force] end the session; --force also drops messages it has not read"
132304
132811
  }
132305
132812
  ];
132306
132813
  var REMOTE_USAGE = [USAGE_HEAD, ...USAGE_ENTRIES.map((entry) => entry.text)].join(`