oh-my-openagent 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
package/dist/cli/index.js CHANGED
@@ -2132,7 +2132,7 @@ var package_default;
2132
2132
  var init_package = __esm(() => {
2133
2133
  package_default = {
2134
2134
  name: "oh-my-opencode",
2135
- version: "5.1.78",
2135
+ version: "5.1.81",
2136
2136
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
2137
2137
  main: "./dist/index.js",
2138
2138
  types: "dist/index.d.ts",
@@ -2140,6 +2140,7 @@ var init_package = __esm(() => {
2140
2140
  workspaces: [
2141
2141
  "packages/rules-engine",
2142
2142
  "packages/delegate-core",
2143
+ "packages/thread-address-core",
2143
2144
  "packages/ast-grep-mcp",
2144
2145
  "packages/git-bash-mcp",
2145
2146
  "packages/mcp-stdio-core",
@@ -2284,8 +2285,8 @@ var init_package = __esm(() => {
2284
2285
  "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",
2285
2286
  "check:copy": "bun script/check-copy.ts",
2286
2287
  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",
2287
- "typecheck:skill-scripts": "bun check --no-script --all -p packages/shared-skills/skills/frontend/scripts/detect/tsconfig.json",
2288
- "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",
2288
+ "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",
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/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",
2289
2290
  "typecheck:script": "bun check --no-script --all -p script/tsconfig.json",
2290
2291
  test: "bun test --timeout 20000",
2291
2292
  "changelog:section": "bun script/changelog-section.ts",
@@ -2301,6 +2302,7 @@ var init_package = __esm(() => {
2301
2302
  "fmt:check": "bun fmt --no-script --check",
2302
2303
  "lint:ratchet": "bun script/lint-ratchet.ts",
2303
2304
  "knip:check": "knip --no-progress --no-config-hints",
2305
+ "qa:rpc-relay-parity": "bun script/qa/rpc-relay-parity-live.ts",
2304
2306
  "lint:ratchet:update": "bun script/lint-ratchet.ts --update",
2305
2307
  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"
2306
2308
  },
@@ -2330,7 +2332,7 @@ var init_package = __esm(() => {
2330
2332
  },
2331
2333
  devDependencies: {
2332
2334
  "@clack/prompts": "^1.8.1",
2333
- "@code-yeongyu/senpi": "2026.11.18-2",
2335
+ "@code-yeongyu/senpi": "2026.11.19-5",
2334
2336
  "@modelcontextprotocol/sdk": "^1.30.0",
2335
2337
  "@oh-my-opencode/agents-md-core": "workspace:*",
2336
2338
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
@@ -2339,6 +2341,7 @@ var init_package = __esm(() => {
2339
2341
  "@oh-my-opencode/claude-code-compat-core": "workspace:*",
2340
2342
  "@oh-my-opencode/comment-checker-core": "workspace:*",
2341
2343
  "@oh-my-opencode/delegate-core": "workspace:*",
2344
+ "@oh-my-opencode/thread-address-core": "workspace:*",
2342
2345
  "@oh-my-opencode/git-bash-mcp": "workspace:*",
2343
2346
  "@oh-my-opencode/hashline-core": "workspace:*",
2344
2347
  "@oh-my-opencode/isolation-core": "workspace:*",
@@ -2403,18 +2406,18 @@ var init_package = __esm(() => {
2403
2406
  typescript: "^7.0.2"
2404
2407
  },
2405
2408
  optionalDependencies: {
2406
- "oh-my-opencode-darwin-arm64": "5.1.78",
2407
- "oh-my-opencode-darwin-x64": "5.1.78",
2408
- "oh-my-opencode-darwin-x64-baseline": "5.1.78",
2409
- "oh-my-opencode-linux-arm64": "5.1.78",
2410
- "oh-my-opencode-linux-arm64-musl": "5.1.78",
2411
- "oh-my-opencode-linux-x64": "5.1.78",
2412
- "oh-my-opencode-linux-x64-baseline": "5.1.78",
2413
- "oh-my-opencode-linux-x64-musl": "5.1.78",
2414
- "oh-my-opencode-linux-x64-musl-baseline": "5.1.78",
2415
- "oh-my-opencode-windows-arm64": "5.1.78",
2416
- "oh-my-opencode-windows-x64": "5.1.78",
2417
- "oh-my-opencode-windows-x64-baseline": "5.1.78"
2409
+ "oh-my-opencode-darwin-arm64": "5.1.81",
2410
+ "oh-my-opencode-darwin-x64": "5.1.81",
2411
+ "oh-my-opencode-darwin-x64-baseline": "5.1.81",
2412
+ "oh-my-opencode-linux-arm64": "5.1.81",
2413
+ "oh-my-opencode-linux-arm64-musl": "5.1.81",
2414
+ "oh-my-opencode-linux-x64": "5.1.81",
2415
+ "oh-my-opencode-linux-x64-baseline": "5.1.81",
2416
+ "oh-my-opencode-linux-x64-musl": "5.1.81",
2417
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.81",
2418
+ "oh-my-opencode-windows-arm64": "5.1.81",
2419
+ "oh-my-opencode-windows-x64": "5.1.81",
2420
+ "oh-my-opencode-windows-x64-baseline": "5.1.81"
2418
2421
  },
2419
2422
  overrides: {
2420
2423
  hono: "^4.13.8",
@@ -9606,46 +9609,28 @@ var init_category_model_requirements = __esm(() => {
9606
9609
  ]
9607
9610
  },
9608
9611
  ultrabrain: {
9612
+ requiresAnyModel: true,
9609
9613
  fallbackChain: [
9610
- { providers: ["openai", "chatgpt-subscription"], model: LATEST_MODEL_BY_FAMILY.gptAstra, variant: "max" },
9611
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-6-astra", variant: "max" },
9612
- { providers: ["github-copilot"], model: "gpt-6-astra", variant: "max" },
9613
9614
  {
9614
9615
  providers: ["openai", "chatgpt-subscription", "opencode"],
9615
9616
  model: LATEST_MODEL_BY_FAMILY.gptAstra,
9616
9617
  variant: "max"
9617
- },
9618
- { providers: ["openai", "chatgpt-subscription", "opencode"], model: "gpt-6-astra", variant: "max" },
9619
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-5.6-sol", variant: "max" },
9620
- { providers: ["github-copilot"], model: "gpt-5.6-sol", variant: "max" },
9621
- { providers: ["openai", "chatgpt-subscription", "opencode"], model: "gpt-5.6-sol", variant: "max" }
9618
+ }
9622
9619
  ]
9623
9620
  },
9624
9621
  "deep-low": {
9622
+ requiresAnyModel: true,
9625
9623
  fallbackChain: [
9626
- { providers: ["openai", "chatgpt-subscription"], model: LATEST_MODEL_BY_FAMILY.gptSol, variant: "medium" },
9627
- { providers: ["openai", "chatgpt-subscription"], model: LATEST_MODEL_BY_FAMILY.gptSolFast, variant: "medium" },
9628
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-6.1-sol", variant: "medium" },
9629
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-6.1-sol-fast", variant: "medium" },
9630
- {
9631
- providers: ["openai", "chatgpt-subscription", "github-copilot", "opencode"],
9632
- model: "gpt-5.6-sol",
9633
- variant: "medium"
9634
- },
9635
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-5.6-sol-fast", variant: "medium" }
9624
+ { providers: ["openai", "chatgpt-subscription"], model: LATEST_MODEL_BY_FAMILY.gptSol, variant: "medium" }
9636
9625
  ]
9637
9626
  },
9638
9627
  "deep-high": {
9628
+ requiresAnyModel: true,
9639
9629
  fallbackChain: [
9640
9630
  {
9641
9631
  providers: ["openai", "chatgpt-subscription", "opencode"],
9642
9632
  model: LATEST_MODEL_BY_FAMILY.gptAstra,
9643
9633
  variant: "high"
9644
- },
9645
- {
9646
- providers: ["openai", "chatgpt-subscription", "github-copilot", "opencode"],
9647
- model: "gpt-6-astra",
9648
- variant: "high"
9649
9634
  }
9650
9635
  ]
9651
9636
  },
@@ -11536,6 +11521,14 @@ var init_agent_display_names = __esm(() => {
11536
11521
  "athena-junior (council)": "athena-junior"
11537
11522
  };
11538
11523
  });
11524
+ // packages/omo-opencode/src/shared/model-requirements.ts
11525
+ var init_model_requirements2 = __esm(() => {
11526
+ init_src2();
11527
+ });
11528
+
11529
+ // packages/omo-opencode/src/shared/provider-model-id-transform.ts
11530
+ var init_provider_model_id_transform2 = () => {};
11531
+
11539
11532
  // packages/omo-opencode/src/tools/delegate-task/google-categories.ts
11540
11533
  var VISUAL_CATEGORY_PROMPT_APPEND = `<Category_Context>
11541
11534
  You are working on VISUAL/UI tasks.
@@ -11828,26 +11821,20 @@ You are working on tasks that don't fit specific categories but require moderate
11828
11821
  </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>
11829
11822
  <Caller_Warning>Provide explicit must-do steps, forbidden scope, and concrete success criteria.</Caller_Warning>`, UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND = `<Category_Context>
11830
11823
  You are working on tasks that don't fit specific categories but require substantial effort.
11831
- </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;
11824
+ </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;
11832
11825
  var init_openai_categories = __esm(() => {
11833
11826
  init_types();
11834
11827
  init_latest_models();
11835
- DEEP_LOW_GATE_MODELS = [
11836
- LATEST_MODEL_BY_FAMILY.gptSol,
11837
- LATEST_MODEL_BY_FAMILY.gptSolFast,
11838
- "gpt-6.1-sol",
11839
- "gpt-6.1-sol-fast",
11840
- "gpt-5.6-sol-fast",
11841
- "gpt-5.6-sol"
11842
- ];
11843
- DEEP_HIGH_GATE_MODELS = [LATEST_MODEL_BY_FAMILY.gptAstra, "gpt-6-astra"];
11828
+ GPT_ASTRA_GATE_MODELS = [LATEST_MODEL_BY_FAMILY.gptAstra];
11829
+ DEEP_LOW_GATE_MODELS = [LATEST_MODEL_BY_FAMILY.gptSol];
11844
11830
  OPENAI_CATEGORIES = [
11845
11831
  {
11846
11832
  name: "ultrabrain",
11847
11833
  config: { model: `openai/${LATEST_MODEL_BY_FAMILY.gptAstra}`, variant: "max" },
11848
11834
  description: "Use ONLY for genuinely hard, logic-heavy tasks. Give clear goals only, not step-by-step instructions.",
11849
11835
  promptAppend: ULTRABRAIN_CATEGORY_PROMPT_APPEND,
11850
- resolvePromptAppend: resolveUltrabrainCategoryPromptAppend
11836
+ resolvePromptAppend: resolveUltrabrainCategoryPromptAppend,
11837
+ requiresModel: GPT_ASTRA_GATE_MODELS
11851
11838
  },
11852
11839
  {
11853
11840
  name: "deep-low",
@@ -11865,7 +11852,7 @@ var init_openai_categories = __esm(() => {
11865
11852
  callerGuidance: DEEP_HIGH_CATEGORY_CALLER_GUIDANCE,
11866
11853
  promptAppend: DEEP_HIGH_CATEGORY_PROMPT_APPEND,
11867
11854
  resolvePromptAppend: resolveDeepHighCategoryPromptAppend,
11868
- requiresModel: DEEP_HIGH_GATE_MODELS
11855
+ requiresModel: GPT_ASTRA_GATE_MODELS
11869
11856
  },
11870
11857
  {
11871
11858
  name: "quick",
@@ -11898,6 +11885,8 @@ function buildCategoryRecord(selector) {
11898
11885
  }
11899
11886
  var BUILTIN_CATEGORIES, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS, CATEGORY_DESCRIPTIONS, CATEGORY_CALLER_GUIDANCE, CATEGORY_PROMPT_APPEND_RESOLVERS, BUILTIN_CATEGORY_REQUIRES_MODEL;
11900
11887
  var init_builtin_categories = __esm(() => {
11888
+ init_model_requirements2();
11889
+ init_provider_model_id_transform2();
11901
11890
  init_google_categories();
11902
11891
  init_kimi_categories();
11903
11892
  init_openai_categories();
@@ -67561,11 +67550,6 @@ var init_model_capabilities2 = __esm(() => {
67561
67550
  init_model_capabilities_generated();
67562
67551
  });
67563
67552
 
67564
- // packages/omo-opencode/src/shared/model-requirements.ts
67565
- var init_model_requirements2 = __esm(() => {
67566
- init_src2();
67567
- });
67568
-
67569
67553
  // packages/omo-opencode/src/shared/agent-variant.ts
67570
67554
  var init_agent_variant = __esm(() => {
67571
67555
  init_agent_display_names();
@@ -77155,6 +77139,17 @@ var init_git_master = __esm(() => {
77155
77139
  }).strict();
77156
77140
  });
77157
77141
 
77142
+ // packages/omo-config-core/src/schema/keyword-detector.ts
77143
+ var KeywordTypeSchema, OmoKeywordDetectorSettingsSchema;
77144
+ var init_keyword_detector = __esm(() => {
77145
+ init_zod();
77146
+ KeywordTypeSchema = _enum(["ultrawork", "team", "hyperplan", "hyperplan-ultrawork"]);
77147
+ OmoKeywordDetectorSettingsSchema = object({
77148
+ enabled_expansions: array(KeywordTypeSchema).optional(),
77149
+ disabled_keywords: array(KeywordTypeSchema).optional()
77150
+ });
77151
+ });
77152
+
77158
77153
  // packages/omo-config-core/src/schema/harness.ts
77159
77154
  var HARNESS_IDS, OMO_CONFIG_HARNESS_IDS, OmoHarnessIdSchema, OMO_CONFIG_LEGACY_HARNESS_ALIASES, OMO_CONFIG_LEGACY_HARNESS_IDS;
77160
77155
  var init_harness = __esm(() => {
@@ -77818,6 +77813,20 @@ var init_session_wake = __esm(() => {
77818
77813
  }).strict();
77819
77814
  });
77820
77815
 
77816
+ // packages/omo-config-core/src/schema/operator-alerts.ts
77817
+ var OmoOperatorAlertsSettingsSchema;
77818
+ var init_operator_alerts = __esm(() => {
77819
+ init_zod();
77820
+ OmoOperatorAlertsSettingsSchema = object({
77821
+ error_streak: object({
77822
+ threshold: number2().int().min(1).optional(),
77823
+ realert_minutes: number2().min(0).optional(),
77824
+ threads: array(string2().trim().min(1)).optional(),
77825
+ webhook_url_env: string2().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).optional()
77826
+ }).strict().optional()
77827
+ }).strict();
77828
+ });
77829
+
77821
77830
  // packages/omo-config-core/src/schema/config.ts
77822
77831
  var OmoOpenCodeHarnessConfigSchema, OmoDisabledSkillsSchema, OmoExcludedModelsSchema, OmoTypedHarnessConfigSchema, OmoConfigProfileSchema, OmoConfigSchema, OmoConfigLayerSchema;
77823
77832
  var init_config = __esm(() => {
@@ -77826,6 +77835,7 @@ var init_config = __esm(() => {
77826
77835
  init_category();
77827
77836
  init_computer();
77828
77837
  init_git_master();
77838
+ init_keyword_detector();
77829
77839
  init_memory();
77830
77840
  init_model_catalog();
77831
77841
  init_model_pad();
@@ -77838,12 +77848,14 @@ var init_config = __esm(() => {
77838
77848
  init_format_on_mutation();
77839
77849
  init_provenance();
77840
77850
  init_session_wake();
77851
+ init_operator_alerts();
77841
77852
  OmoOpenCodeHarnessConfigSchema = record(string2(), unknown());
77842
77853
  OmoDisabledSkillsSchema = array(string2());
77843
77854
  OmoExcludedModelsSchema = array(string2());
77844
77855
  OmoTypedHarnessConfigSchema = object({
77845
77856
  provenance: OmoProvenanceSettingsSchema.optional(),
77846
77857
  session_wake: OmoSessionWakeSettingsSchema.optional(),
77858
+ operator_alerts: OmoOperatorAlertsSettingsSchema.optional(),
77847
77859
  formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
77848
77860
  categories: OmoCategoriesConfigSchema.optional(),
77849
77861
  agents: OmoAgentsConfigSchema.optional(),
@@ -77860,11 +77872,13 @@ var init_config = __esm(() => {
77860
77872
  side_panel: OmoSidePanelSettingsLayerSchema.optional(),
77861
77873
  computer: OmoComputerSettingsLayerSchema.optional(),
77862
77874
  disabled_skills: OmoDisabledSkillsSchema.optional(),
77875
+ keyword_detector: OmoKeywordDetectorSettingsSchema.optional(),
77863
77876
  exclude_models: OmoExcludedModelsSchema.optional()
77864
77877
  }).strict();
77865
77878
  OmoConfigProfileSchema = object({
77866
77879
  provenance: OmoProvenanceSettingsSchema.optional(),
77867
77880
  session_wake: OmoSessionWakeSettingsSchema.optional(),
77881
+ operator_alerts: OmoOperatorAlertsSettingsSchema.optional(),
77868
77882
  formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
77869
77883
  categories: OmoCategoriesConfigSchema.optional(),
77870
77884
  agents: OmoAgentsConfigSchema.optional(),
@@ -77881,6 +77895,7 @@ var init_config = __esm(() => {
77881
77895
  side_panel: OmoSidePanelSettingsLayerSchema.optional(),
77882
77896
  computer: OmoComputerSettingsLayerSchema.optional(),
77883
77897
  disabled_skills: OmoDisabledSkillsSchema.optional(),
77898
+ keyword_detector: OmoKeywordDetectorSettingsSchema.optional(),
77884
77899
  exclude_models: OmoExcludedModelsSchema.optional(),
77885
77900
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
77886
77901
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -77890,6 +77905,7 @@ var init_config = __esm(() => {
77890
77905
  OmoConfigSchema = object({
77891
77906
  provenance: OmoProvenanceSettingsSchema.optional(),
77892
77907
  session_wake: OmoSessionWakeSettingsSchema.optional(),
77908
+ operator_alerts: OmoOperatorAlertsSettingsSchema.optional(),
77893
77909
  formatOnMutation: OmoFormatOnMutationSchema.optional(),
77894
77910
  $schema: string2().optional(),
77895
77911
  categories: OmoCategoriesConfigSchema.optional(),
@@ -77907,6 +77923,7 @@ var init_config = __esm(() => {
77907
77923
  side_panel: OmoSidePanelSettingsSchema.optional(),
77908
77924
  computer: OmoComputerSettingsSchema.optional(),
77909
77925
  disabled_skills: OmoDisabledSkillsSchema.optional(),
77926
+ keyword_detector: OmoKeywordDetectorSettingsSchema.optional(),
77910
77927
  exclude_models: OmoExcludedModelsSchema.optional(),
77911
77928
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
77912
77929
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -77919,6 +77936,7 @@ var init_config = __esm(() => {
77919
77936
  OmoConfigLayerSchema = object({
77920
77937
  provenance: OmoProvenanceSettingsSchema.optional(),
77921
77938
  session_wake: OmoSessionWakeSettingsSchema.optional(),
77939
+ operator_alerts: OmoOperatorAlertsSettingsSchema.optional(),
77922
77940
  formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
77923
77941
  $schema: string2().optional(),
77924
77942
  categories: OmoCategoriesConfigSchema.optional(),
@@ -77936,6 +77954,7 @@ var init_config = __esm(() => {
77936
77954
  side_panel: OmoSidePanelSettingsLayerSchema.optional(),
77937
77955
  computer: OmoComputerSettingsLayerSchema.optional(),
77938
77956
  disabled_skills: OmoDisabledSkillsSchema.optional(),
77957
+ keyword_detector: OmoKeywordDetectorSettingsSchema.optional(),
77939
77958
  exclude_models: OmoExcludedModelsSchema.optional(),
77940
77959
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
77941
77960
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -78072,6 +78091,7 @@ var init_schema = __esm(() => {
78072
78091
  init_format_on_mutation();
78073
78092
  init_git_master();
78074
78093
  init_harness();
78094
+ init_keyword_detector();
78075
78095
  init_legacy_category_names();
78076
78096
  init_legacy_harness_names();
78077
78097
  init_memory();
@@ -78081,6 +78101,7 @@ var init_schema = __esm(() => {
78081
78101
  init_model_ref();
78082
78102
  init_provenance();
78083
78103
  init_session_wake();
78104
+ init_operator_alerts();
78084
78105
  init_side_panel();
78085
78106
  init_task();
78086
78107
  init_team();
@@ -81032,7 +81053,7 @@ var init_provider_availability = __esm(() => {
81032
81053
  });
81033
81054
 
81034
81055
  // packages/omo-opencode/src/cli/provider-model-id-transform.ts
81035
- var init_provider_model_id_transform2 = __esm(() => {
81056
+ var init_provider_model_id_transform3 = __esm(() => {
81036
81057
  init_src2();
81037
81058
  });
81038
81059
 
@@ -81069,7 +81090,7 @@ function isRequiredProviderAvailable(requiredProviders, availability) {
81069
81090
  var init_fallback_chain_resolution = __esm(() => {
81070
81091
  init_model_fallback_requirements();
81071
81092
  init_provider_availability();
81072
- init_provider_model_id_transform2();
81093
+ init_provider_model_id_transform3();
81073
81094
  });
81074
81095
 
81075
81096
  // packages/omo-opencode/src/cli/fallback-lane-policy.ts
@@ -81270,7 +81291,7 @@ var init_model_fallback = __esm(() => {
81270
81291
  init_openai_only_model_catalog();
81271
81292
  init_provider_availability();
81272
81293
  init_fallback_chain_resolution();
81273
- init_provider_model_id_transform2();
81294
+ init_provider_model_id_transform3();
81274
81295
  init_fallback_lane_policy();
81275
81296
  init_latest_models();
81276
81297
  });
@@ -92929,7 +92950,7 @@ var package_default2;
92929
92950
  var init_package2 = __esm(() => {
92930
92951
  package_default2 = {
92931
92952
  name: "@oh-my-opencode/omo-codex",
92932
- version: "5.1.78",
92953
+ version: "5.1.81",
92933
92954
  type: "module",
92934
92955
  private: true,
92935
92956
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -94243,8 +94264,8 @@ var init_bytes_encoding = __esm(() => {
94243
94264
  });
94244
94265
 
94245
94266
  // packages/device-service-core/src/local-api/proof.ts
94246
- import { createHmac as createHmac2, randomBytes as randomBytes7, timingSafeEqual as timingSafeEqual2 } from "crypto";
94247
- var NONCE_BYTES = 32, mintNonce = () => toBase64url(randomBytes7(NONCE_BYTES)), mintId = () => toBase64url(randomBytes7(16)), decodedBytes = (value, bytes, what) => {
94267
+ import { createHmac as createHmac2, randomBytes as randomBytes8, timingSafeEqual as timingSafeEqual2 } from "crypto";
94268
+ var NONCE_BYTES = 32, mintNonce = () => toBase64url(randomBytes8(NONCE_BYTES)), mintId = () => toBase64url(randomBytes8(16)), decodedBytes = (value, bytes, what) => {
94248
94269
  const violation = () => new LocalApiError("protocol_violation", `${what} is not ${bytes} base64url bytes`);
94249
94270
  let out;
94250
94271
  try {
@@ -94441,7 +94462,7 @@ import {
94441
94462
  rmSync as rmSync10,
94442
94463
  writeFileSync as writeFileSync18
94443
94464
  } from "fs";
94444
- import { join as join120 } from "path";
94465
+ import { join as join121 } from "path";
94445
94466
  var TOKEN_FILE = "token", TOKEN_BYTES = 32, SOCKET_FILE = "service.sock", insecure = (detail) => {
94446
94467
  throw new LocalApiError("insecure_state_dir", detail);
94447
94468
  }, 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) => {
@@ -94463,8 +94484,8 @@ var TOKEN_FILE = "token", TOKEN_BYTES = 32, SOCKET_FILE = "service.sock", insecu
94463
94484
  }, checkPosixAccess = (stateDir) => {
94464
94485
  const uid = currentUid();
94465
94486
  privateEntry(stateDir, "dir", uid);
94466
- privateEntry(join120(stateDir, SOCKET_FILE), "socket", uid);
94467
- privateEntry(join120(stateDir, TOKEN_FILE), "file", uid);
94487
+ privateEntry(join121(stateDir, SOCKET_FILE), "socket", uid);
94488
+ privateEntry(join121(stateDir, TOKEN_FILE), "file", uid);
94468
94489
  }, posixSecureFile = async (path, kind) => {
94469
94490
  const uid = currentUid();
94470
94491
  privateEntry(path, kind, uid, false);
@@ -94473,7 +94494,7 @@ var TOKEN_FILE = "token", TOKEN_BYTES = 32, SOCKET_FILE = "service.sock", insecu
94473
94494
  }, readToken = (stateDir) => {
94474
94495
  let value;
94475
94496
  try {
94476
- value = readFileSync46(join120(stateDir, TOKEN_FILE), "utf8");
94497
+ value = readFileSync46(join121(stateDir, TOKEN_FILE), "utf8");
94477
94498
  } catch (error) {
94478
94499
  if (isMissing(error))
94479
94500
  return insecure("the token is missing");
@@ -97298,7 +97319,7 @@ var init_client_open = __esm(() => {
97298
97319
  // packages/device-service-core/src/local-api/transport.ts
97299
97320
  import { lstatSync as lstatSync8, readFileSync as readFileSync47, unlinkSync as unlinkSync11 } from "fs";
97300
97321
  import { createConnection, createServer as createServer4 } from "net";
97301
- import { join as join121 } from "path";
97322
+ import { join as join122 } from "path";
97302
97323
  var ENDPOINT_FILE = "endpoint.json", wrap = (socket, endpoint) => {
97303
97324
  const closeListeners = [];
97304
97325
  let closed = false;
@@ -97331,7 +97352,7 @@ var ENDPOINT_FILE = "endpoint.json", wrap = (socket, endpoint) => {
97331
97352
  }
97332
97353
  };
97333
97354
  }, readEndpointPort = (stateDir) => {
97334
- const parsed = JSON.parse(readFileSync47(join121(stateDir, ENDPOINT_FILE), "utf8"));
97355
+ const parsed = JSON.parse(readFileSync47(join122(stateDir, ENDPOINT_FILE), "utf8"));
97335
97356
  const port = typeof parsed === "object" && parsed !== null ? Reflect.get(parsed, "port") : undefined;
97336
97357
  if (typeof port !== "number" || !Number.isInteger(port) || port < 1 || port > 65535)
97337
97358
  throw new LocalApiError("insecure_state_dir", "endpoint.json holds no port");
@@ -97339,7 +97360,7 @@ var ENDPOINT_FILE = "endpoint.json", wrap = (socket, endpoint) => {
97339
97360
  }, connectLocal = (stateDir) => new Promise((resolve, reject) => {
97340
97361
  const port = process.platform === "win32" ? readEndpointPort(stateDir) : undefined;
97341
97362
  const endpoint = port === undefined ? UNIX_ENDPOINT : tcpEndpoint(port);
97342
- const socket = port === undefined ? createConnection({ path: join121(stateDir, SOCKET_FILE) }) : createConnection({ host: "127.0.0.1", port });
97363
+ const socket = port === undefined ? createConnection({ path: join122(stateDir, SOCKET_FILE) }) : createConnection({ host: "127.0.0.1", port });
97343
97364
  socket.once("error", reject);
97344
97365
  socket.once("connect", () => {
97345
97366
  socket.off("error", reject);
@@ -97372,7 +97393,7 @@ var init_client4 = __esm(() => {
97372
97393
 
97373
97394
  // packages/device-service-core/src/background-transport.ts
97374
97395
  import { createConnection as createConnection2 } from "net";
97375
- import { join as join122 } from "path";
97396
+ import { join as join123 } from "path";
97376
97397
  var wrap2 = (socket, endpoint) => {
97377
97398
  const closeListeners = [];
97378
97399
  let closed = false;
@@ -97407,7 +97428,7 @@ var wrap2 = (socket, endpoint) => {
97407
97428
  }, connectLocalBackground = (stateDir) => new Promise((resolve, reject) => {
97408
97429
  const port = process.platform === "win32" ? readEndpointPort(stateDir) : undefined;
97409
97430
  const endpoint = port === undefined ? UNIX_ENDPOINT : tcpEndpoint(port);
97410
- const socket = port === undefined ? createConnection2({ path: join122(stateDir, SOCKET_FILE) }) : createConnection2({ host: "127.0.0.1", port });
97431
+ const socket = port === undefined ? createConnection2({ path: join123(stateDir, SOCKET_FILE) }) : createConnection2({ host: "127.0.0.1", port });
97411
97432
  socket.unref();
97412
97433
  socket.once("error", reject);
97413
97434
  socket.once("connect", () => {
@@ -97597,7 +97618,7 @@ var init_unsettled_command = __esm(() => {
97597
97618
  });
97598
97619
 
97599
97620
  // packages/device-service-core/src/remote-attach.ts
97600
- import { randomBytes as randomBytes8 } from "crypto";
97621
+ import { randomBytes as randomBytes9 } from "crypto";
97601
97622
  function openAttach(client, device, sessionId, timers = realTimers) {
97602
97623
  const early = [];
97603
97624
  const history = [];
@@ -97706,7 +97727,7 @@ function openAttach(client, device, sessionId, timers = realTimers) {
97706
97727
  if (ended)
97707
97728
  return reject(new Error("the attach has ended"));
97708
97729
  const { waitMs = ATTACH_COMMAND_WAIT_MS, accepts } = options;
97709
- const commandId = randomBytes8(16).toString("base64url");
97730
+ const commandId = randomBytes9(16).toString("base64url");
97710
97731
  let progress;
97711
97732
  const settle = () => {
97712
97733
  stopState();
@@ -97900,16 +97921,16 @@ var init_version2 = __esm(() => {
97900
97921
  // packages/device-service-core/src/state-dir.ts
97901
97922
  import { readFileSync as readFileSync48, statSync as statSync10 } from "fs";
97902
97923
  import { homedir as homedir36 } from "os";
97903
- import { dirname as dirname50, join as join123, posix as posix17, win32 as win3212 } from "path";
97924
+ import { dirname as dirname50, join as join124, posix as posix17, win32 as win3212 } from "path";
97904
97925
  function defaultStateDir(platform, env, home) {
97905
97926
  if (platform !== "win32")
97906
- return join123(home, ".omo", "device-service");
97907
- const localAppData = env.LOCALAPPDATA ?? join123(home, "AppData", "Local");
97908
- return join123(localAppData, "OmO", "device-service");
97927
+ return join124(home, ".omo", "device-service");
97928
+ const localAppData = env.LOCALAPPDATA ?? join124(home, "AppData", "Local");
97929
+ return join124(localAppData, "OmO", "device-service");
97909
97930
  }
97910
97931
  function discoveredStateDir(platform, defaultDir) {
97911
97932
  try {
97912
- const parsed = JSON.parse(readFileSync48(join123(dirname50(defaultDir), LOCATION_FILE), "utf8"));
97933
+ const parsed = JSON.parse(readFileSync48(join124(dirname50(defaultDir), LOCATION_FILE), "utf8"));
97913
97934
  if (typeof parsed !== "object" || parsed === null || !("v" in parsed) || !("state_dir" in parsed))
97914
97935
  return;
97915
97936
  const { v, state_dir: stateDir } = parsed;
@@ -97943,6 +97964,11 @@ async function engineEndpointOf(client, device) {
97943
97964
  return only;
97944
97965
  throw new NoPrimaryEndpointError(device, listed.endpoints.length);
97945
97966
  }
97967
+ async function engineEndpointsOf(client, device) {
97968
+ const asksPrimary = compareVersions4(client.welcome.service_version, ENDPOINT_PRIMARY_MIN_SERVICE_VERSION) >= 0;
97969
+ const listed = await client.request("session.endpoints", asksPrimary ? { device, primary: true } : { device });
97970
+ return { keys: listed.endpoints, ...listed.primary === undefined ? {} : { primary: listed.primary } };
97971
+ }
97946
97972
  var ENDPOINT_PRIMARY_MIN_SERVICE_VERSION = "0.1.11", NoPrimaryEndpointError;
97947
97973
  var init_engine_endpoint = __esm(() => {
97948
97974
  init_not_sent_error();
@@ -97962,8 +97988,8 @@ var init_protocol = __esm(() => {
97962
97988
  });
97963
97989
 
97964
97990
  // packages/device-service-core/src/device-service.ts
97965
- import { join as join124 } from "path";
97966
- import { randomBytes as randomBytes9 } from "crypto";
97991
+ import { join as join125 } from "path";
97992
+ import { randomBytes as randomBytes10 } from "crypto";
97967
97993
  function sendToEndpoint(client, device, endpoint, rpc, locate, timers, waitMs) {
97968
97994
  return followDelegatedCommand(client, device, timers, (commandId) => {
97969
97995
  const send = (asked) => client.commandTo({ device, endpoint }, rpc, commandId, asked ? { locate: true } : {});
@@ -97972,7 +97998,7 @@ function sendToEndpoint(client, device, endpoint, rpc, locate, timers, waitMs) {
97972
97998
  }
97973
97999
  function followDelegatedCommand(client, device, timers, send, waitMs = ENDPOINT_COMMAND_WAIT_MS) {
97974
98000
  return new Promise((resolve, reject) => {
97975
- const commandId = randomBytes9(16).toString("base64url");
98001
+ const commandId = randomBytes10(16).toString("base64url");
97976
98002
  const channel = followDelegatedChannel(device);
97977
98003
  let done = false;
97978
98004
  const settle = () => {
@@ -98008,7 +98034,7 @@ function followDelegatedCommand(client, device, timers, send, waitMs = ENDPOINT_
98008
98034
  });
98009
98035
  }
98010
98036
  function deviceServiceEndpointPath(stateDir, platform = process.platform) {
98011
- return join124(stateDir, platform === "win32" ? ENDPOINT_FILE : SOCKET_FILE);
98037
+ return join125(stateDir, platform === "win32" ? ENDPOINT_FILE : SOCKET_FILE);
98012
98038
  }
98013
98039
  async function connectDeviceService(options) {
98014
98040
  const stateDir = options.stateDir ?? deviceServiceStateDir();
@@ -98074,6 +98100,7 @@ async function connectDeviceService(options) {
98074
98100
  command: (rpc, options) => attached.command(rpc, options?.waitMs === undefined ? undefined : { waitMs: options.waitMs })
98075
98101
  };
98076
98102
  },
98103
+ engineEndpoints: async (device) => await engineEndpointsOf(client, device),
98077
98104
  endpointCommand: async (device, rpc, options) => {
98078
98105
  const started = timers.now();
98079
98106
  let endpoint = options?.endpoint;
@@ -98096,8 +98123,6 @@ async function connectDeviceService(options) {
98096
98123
  throw markNotSent(error);
98097
98124
  }
98098
98125
  }
98099
- if (endpoint === undefined)
98100
- throw new NotSentError("unsupported", "the device lists no engine endpoint");
98101
98126
  const waitMs = options?.waitMs === undefined ? undefined : options.waitMs - (timers.now() - started);
98102
98127
  if (waitMs !== undefined && waitMs <= 0)
98103
98128
  throw new NotSentError("request_timeout", "the wait ran out during the endpoint lookup; nothing was sent");
@@ -103636,7 +103661,7 @@ var init_bindings = __esm(() => {
103636
103661
  });
103637
103662
 
103638
103663
  // packages/omo-senpi/src/components/thread/contracts/fields.ts
103639
- 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([
103664
+ 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([
103640
103665
  Literal("off"),
103641
103666
  Literal("minimal"),
103642
103667
  Literal("low"),
@@ -103644,7 +103669,7 @@ var THREAD_MESSAGE_MAX_BYTES = 32768, THREAD_SUMMARY_MAX_LENGTH = 200, THREAD_RE
103644
103669
  Literal("high"),
103645
103670
  Literal("xhigh"),
103646
103671
  Literal("max")
103647
- ], { description }), BindingId, RelayText, ThreadDeliveryMode;
103672
+ ], { description }), BindingId, RelayText, DEFAULT_THREAD_DELIVERY = "auto", ThreadDeliveryMode;
103648
103673
  var init_fields = __esm(() => {
103649
103674
  init_build();
103650
103675
  init_bindings();
@@ -103657,6 +103682,11 @@ var init_fields = __esm(() => {
103657
103682
  IdempotencyKey = Optional(String2({
103658
103683
  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."
103659
103684
  }));
103685
+ CollapseKey = Optional(String2({
103686
+ minLength: 1,
103687
+ maxLength: 200,
103688
+ 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."
103689
+ }));
103660
103690
  ExpectedTurnId = Optional(String2({
103661
103691
  description: "Turn id the steer applies to; required with delivery steer, and a changed active turn returns turn_conflict with the message held undelivered."
103662
103692
  }));
@@ -103676,7 +103706,8 @@ var init_fields = __esm(() => {
103676
103706
  description: `Text relayed to or from the external thread; longer than ${RELAY_TEXT_MAX_BYTES} UTF-8 bytes returns message_too_large.`
103677
103707
  });
103678
103708
  ThreadDeliveryMode = Union([Literal("auto"), Literal("steer"), Literal("follow_up")], {
103679
- 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."
103709
+ default: DEFAULT_THREAD_DELIVERY,
103710
+ 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)."
103680
103711
  });
103681
103712
  });
103682
103713
 
@@ -103720,6 +103751,7 @@ var init_errors5 = __esm(() => {
103720
103751
  "idempotency_in_progress",
103721
103752
  "idempotency_uncertain",
103722
103753
  "delivered_unconfirmed",
103754
+ "prompt_not_started",
103723
103755
  "approval_unavailable",
103724
103756
  "approval_route_locked",
103725
103757
  "partial_commit",
@@ -103732,6 +103764,7 @@ var init_errors5 = __esm(() => {
103732
103764
  "model_ambiguous",
103733
103765
  "thinking_level_unsupported",
103734
103766
  "loop_detected",
103767
+ "pair_loop_guard",
103735
103768
  "chain_count_limit",
103736
103769
  "binding_conflict",
103737
103770
  "binding_mismatch",
@@ -103751,10 +103784,16 @@ var init_errors5 = __esm(() => {
103751
103784
  // packages/omo-senpi/src/components/thread/initial-skills.ts
103752
103785
  var init_initial_skills = () => {};
103753
103786
 
103787
+ // packages/omo-senpi/src/components/thread/gateway/result.ts
103788
+ var init_result2 = __esm(() => {
103789
+ init_errors5();
103790
+ });
103791
+
103754
103792
  // packages/omo-senpi/src/components/thread/remote/outcome.ts
103755
103793
  var READ_UNCERTAIN, UNANSWERED, NOT_SIGNED_IN;
103756
103794
  var init_outcome = __esm(() => {
103757
103795
  init_errors5();
103796
+ init_result2();
103758
103797
  READ_UNCERTAIN = {
103759
103798
  request_gone: "retry",
103760
103799
  no_receipt: "retry",
@@ -103786,57 +103825,47 @@ var init_outcome = __esm(() => {
103786
103825
  ]);
103787
103826
  NOT_SIGNED_IN = new Set(["sign_in_required", "signed_out"]);
103788
103827
  });
103789
- // packages/omo-senpi/src/components/thread/remote/remote-ops.ts
103790
- var init_remote_ops = __esm(() => {
103791
- init_errors5();
103792
- init_outcome();
103793
- });
103794
103828
 
103795
- // packages/omo-senpi/src/components/thread/control/port.ts
103796
- var REFUSAL;
103797
- var init_port = __esm(() => {
103829
+ // packages/omo-senpi/src/components/thread/address/refusals.ts
103830
+ var init_refusals = __esm(() => {
103798
103831
  init_errors5();
103799
- REFUSAL = Symbol.for("omo.thread.control.refusal");
103800
103832
  });
103801
103833
 
103802
- // packages/omo-senpi/src/components/thread/control/close-ladder.ts
103803
- var SESSION_GONE;
103804
- var init_close_ladder = __esm(() => {
103805
- init_port();
103806
- SESSION_GONE = new Set([
103807
- "unknown_session",
103808
- "session_identity_mismatch",
103809
- "session_not_attached",
103810
- "not_attached"
103811
- ]);
103834
+ // packages/omo-senpi/src/components/thread/remote/address-book.ts
103835
+ var REMOTE_NOT_SET_UP;
103836
+ var init_address_book = __esm(() => {
103837
+ REMOTE_NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
103812
103838
  });
103813
103839
 
103814
- // packages/omo-senpi/src/components/thread/worktree/failures.ts
103815
- var init_failures = __esm(() => {
103816
- init_errors5();
103840
+ // packages/omo-senpi/src/components/thread/address/account.ts
103841
+ var NOT_SET_UP, lastListed;
103842
+ var init_account = __esm(() => {
103843
+ init_remote_ops();
103844
+ init_address_book();
103845
+ NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
103846
+ lastListed = new WeakMap;
103817
103847
  });
103818
103848
 
103819
- // packages/omo-senpi/src/components/thread/control/open-reply.ts
103820
- var init_open_reply = __esm(() => {
103849
+ // packages/omo-senpi/src/components/thread/address/device.ts
103850
+ var init_device = __esm(() => {
103821
103851
  init_errors5();
103822
- init_outcome();
103823
- init_failures();
103852
+ init_account();
103853
+ init_refusals();
103824
103854
  });
103825
- // packages/omo-senpi/src/components/thread/worktree/remote-worktree.ts
103826
- var init_remote_worktree = __esm(() => {
103827
- init_close_ladder();
103828
- init_open_reply();
103829
- init_port();
103830
- init_errors5();
103855
+
103856
+ // packages/omo-senpi/src/components/thread/remote/remote-ops.ts
103857
+ var init_remote_ops = __esm(() => {
103858
+ init_refusals();
103859
+ init_device();
103860
+ init_account();
103831
103861
  init_outcome();
103832
- init_remote_ops();
103833
- init_failures();
103834
103862
  });
103835
103863
 
103836
- // packages/omo-senpi/src/components/thread/thread-link.ts
103837
- var THREAD_LINK_SCHEME = "omo-thread", PREFIX;
103838
- var init_thread_link = __esm(() => {
103839
- PREFIX = `${THREAD_LINK_SCHEME}://v1/`;
103864
+ // packages/omo-senpi/src/components/call-budget/call-deadline.ts
103865
+ import { AsyncLocalStorage as AsyncLocalStorage4 } from "async_hooks";
103866
+ var scope;
103867
+ var init_call_deadline = __esm(() => {
103868
+ scope = new AsyncLocalStorage4;
103840
103869
  });
103841
103870
 
103842
103871
  // packages/omo-senpi/src/components/thread/contracts/create-params.ts
@@ -103899,7 +103928,7 @@ var init_create_params = __esm(() => {
103899
103928
  prompt: Optional(String2({
103900
103929
  minLength: 1,
103901
103930
  maxLength: THREAD_MESSAGE_MAX_BYTES,
103902
- 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.`
103931
+ 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.`
103903
103932
  })),
103904
103933
  delivery: Optional(ThreadDeliveryMode),
103905
103934
  idempotency_key: IdempotencyKey
@@ -103919,7 +103948,8 @@ var init_params = __esm(() => {
103919
103948
  state: Optional(_Array_(Union([Literal("running"), Literal("idle"), Literal("inactive"), Literal("archived")]), {
103920
103949
  minItems: 1,
103921
103950
  description: "Thread states to list: running, idle, inactive (no engine holds it) or archived; the default lists every state but archived."
103922
- }))
103951
+ })),
103952
+ idempotency_key: IdempotencyKey
103923
103953
  });
103924
103954
  ThreadReadParams = _Object_({
103925
103955
  thread: ThreadAddress,
@@ -103936,7 +103966,8 @@ var init_params = __esm(() => {
103936
103966
  maximum: THREAD_READ_WAIT_MAX_MS,
103937
103967
  description: "Wait up to this many ms for the thread's turn to end, then read; see result.wait."
103938
103968
  })),
103939
- all_scope: AllScope
103969
+ all_scope: AllScope,
103970
+ idempotency_key: IdempotencyKey
103940
103971
  });
103941
103972
  ThreadSendParams = _Object_({
103942
103973
  thread: ThreadAddress,
@@ -103945,6 +103976,7 @@ var init_params = __esm(() => {
103945
103976
  expected_turn_id: ExpectedTurnId,
103946
103977
  summary: Summary,
103947
103978
  idempotency_key: IdempotencyKey,
103979
+ collapse_key: CollapseKey,
103948
103980
  all_scope: AllScope
103949
103981
  });
103950
103982
  ThreadInterruptParams = _Object_({
@@ -103952,7 +103984,8 @@ var init_params = __esm(() => {
103952
103984
  turn_id: Optional(String2({
103953
103985
  description: "Running turn to stop, defaulting to the newest running turn; interrupting an idle thread returns success with interrupted false."
103954
103986
  })),
103955
- all_scope: AllScope
103987
+ all_scope: AllScope,
103988
+ idempotency_key: IdempotencyKey
103956
103989
  });
103957
103990
  SelfOrThread = Optional(String2({
103958
103991
  minLength: 1,
@@ -103961,7 +103994,18 @@ var init_params = __esm(() => {
103961
103994
  ThreadCloseParams = _Object_({
103962
103995
  thread: SelfOrThread,
103963
103996
  idempotency_key: IdempotencyKey,
103964
- all_scope: AllScope
103997
+ all_scope: AllScope,
103998
+ force: Optional(Boolean2({
103999
+ description: "Close even when the thread has messages it has not read yet; they are dropped and listed in dropped_deliveries."
104000
+ })),
104001
+ graceful: Optional(Boolean2({
104002
+ 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."
104003
+ })),
104004
+ wait_ms: Optional(Integer({
104005
+ minimum: 1,
104006
+ maximum: 600000,
104007
+ description: "How long a graceful close waits for the turn (default 30000, cut to what the call has left)."
104008
+ }))
103965
104009
  });
103966
104010
  ThreadHandoffParams = _Object_({
103967
104011
  thread: String2({
@@ -103996,7 +104040,7 @@ var init_params = __esm(() => {
103996
104040
  thread: ThreadAddress,
103997
104041
  model: String2({
103998
104042
  minLength: 1,
103999
- 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."
104043
+ 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."
104000
104044
  }),
104001
104045
  provider: Optional(String2({
104002
104046
  description: "Restricts resolution to one provider when the fragment alone would match models from several providers."
@@ -104051,7 +104095,8 @@ var init_params = __esm(() => {
104051
104095
  minimum: 0,
104052
104096
  description: "Read rows after this cursor; unset continues after the binding's acknowledged cursor."
104053
104097
  })),
104054
- limit: Optional(Integer({ minimum: 1, maximum: 500, description: "Rows per read, default 100 and at most 500." }))
104098
+ limit: Optional(Integer({ minimum: 1, maximum: 500, description: "Rows per read, default 100 and at most 500." })),
104099
+ idempotency_key: IdempotencyKey
104055
104100
  });
104056
104101
  ThreadOutboxAckParams = _Object_({
104057
104102
  binding_id: BindingId,
@@ -104063,7 +104108,8 @@ var init_params = __esm(() => {
104063
104108
  minLength: 1,
104064
104109
  maxLength: 256,
104065
104110
  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."
104066
- }))
104111
+ })),
104112
+ idempotency_key: IdempotencyKey
104067
104113
  });
104068
104114
  ThreadAnswerParams = _Object_({
104069
104115
  binding_id: String2({
@@ -104071,7 +104117,8 @@ var init_params = __esm(() => {
104071
104117
  description: "Binding the answer arrived through; it must be the binding that asked the question."
104072
104118
  }),
104073
104119
  reply_token: String2({ minLength: 1, description: "reply_token of the question row being answered." }),
104074
- answer: RelayText
104120
+ answer: RelayText,
104121
+ idempotency_key: IdempotencyKey
104075
104122
  });
104076
104123
  });
104077
104124
 
@@ -108582,19 +108629,61 @@ var init_contracts = __esm(() => {
108582
108629
  });
108583
108630
 
108584
108631
  // packages/omo-senpi/src/components/thread/tools/thread-state.ts
108585
- var ACTIVITIES;
108632
+ var ACTIVITIES, RETRY_WAIT_KINDS;
108586
108633
  var init_thread_state = __esm(() => {
108587
108634
  init_contracts();
108588
108635
  ACTIVITIES = new Set(THREAD_ACTIVITIES);
108636
+ RETRY_WAIT_KINDS = new Set(["rate_limit", "retry"]);
108589
108637
  });
108590
108638
 
108591
- // packages/omo-senpi/src/components/thread/remote/address-book.ts
108592
- var lastListed, REMOTE_NOT_SET_UP;
108593
- var init_address_book = __esm(() => {
108639
+ // packages/omo-senpi/src/components/thread/control/port.ts
108640
+ var REFUSAL;
108641
+ var init_port = __esm(() => {
108642
+ init_errors5();
108643
+ init_thread_state();
108644
+ REFUSAL = Symbol.for("omo.thread.control.refusal");
108645
+ });
108646
+
108647
+ // packages/omo-senpi/src/components/thread/control/close-ladder.ts
108648
+ var SESSION_GONE;
108649
+ var init_close_ladder = __esm(() => {
108650
+ init_call_deadline();
108651
+ init_port();
108652
+ SESSION_GONE = new Set([
108653
+ "unknown_session",
108654
+ "route_unlisted",
108655
+ "session_identity_mismatch",
108656
+ "session_not_attached",
108657
+ "not_attached"
108658
+ ]);
108659
+ });
108660
+
108661
+ // packages/omo-senpi/src/components/thread/worktree/failures.ts
108662
+ var init_failures = __esm(() => {
108594
108663
  init_errors5();
108664
+ });
108665
+
108666
+ // packages/omo-senpi/src/components/thread/control/open-reply.ts
108667
+ var init_open_reply = __esm(() => {
108668
+ init_errors5();
108669
+ init_outcome();
108670
+ init_failures();
108671
+ });
108672
+ // packages/omo-senpi/src/components/thread/worktree/remote-worktree.ts
108673
+ var init_remote_worktree = __esm(() => {
108674
+ init_close_ladder();
108675
+ init_open_reply();
108676
+ init_port();
108677
+ init_errors5();
108678
+ init_outcome();
108595
108679
  init_remote_ops();
108596
- lastListed = new WeakMap;
108597
- REMOTE_NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
108680
+ init_failures();
108681
+ });
108682
+
108683
+ // packages/omo-senpi/src/components/thread/thread-link.ts
108684
+ var THREAD_LINK_SCHEME = "omo-thread", PREFIX;
108685
+ var init_thread_link = __esm(() => {
108686
+ PREFIX = `${THREAD_LINK_SCHEME}://v1/`;
108598
108687
  });
108599
108688
 
108600
108689
  // packages/omo-senpi/src/components/thread/addressing.ts
@@ -108652,7 +108741,7 @@ var init_metadata = __esm(() => {
108652
108741
  {
108653
108742
  name: "thread_close",
108654
108743
  label: "Close session",
108655
- 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,
108744
+ 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,
108656
108745
  exposure: THREAD_TOOL_EXPOSURE
108657
108746
  },
108658
108747
  {
@@ -108711,13 +108800,12 @@ var init_metadata = __esm(() => {
108711
108800
  }
108712
108801
  ];
108713
108802
  });
108803
+
108714
108804
  // packages/omo-senpi/src/components/thread/tools/internals.ts
108715
108805
  function failure3(code, message, next, details) {
108716
108806
  return { kind: "error", error: threadToolFailure(code, message, next, details) };
108717
108807
  }
108718
108808
  var init_internals = __esm(() => {
108719
- init_address_book();
108720
- init_remote_ops();
108721
108809
  init_address_book2();
108722
108810
  init_addressing();
108723
108811
  init_errors5();
@@ -108738,6 +108826,7 @@ var init_relay_session_host = __esm(() => {
108738
108826
  init_initial_skills();
108739
108827
  init_outcome();
108740
108828
  init_remote_ops();
108829
+ init_device();
108741
108830
  init_remote_worktree();
108742
108831
  init_open_reply();
108743
108832
  init_thread_link();
@@ -108758,13 +108847,6 @@ var init_operations = __esm(() => {
108758
108847
  init_port();
108759
108848
  NOT_LIVE = failure3("not_resumable", "The thread has no live owner.", "Retry when the target is live.");
108760
108849
  });
108761
-
108762
- // packages/omo-senpi/src/components/call-budget/call-deadline.ts
108763
- import { AsyncLocalStorage as AsyncLocalStorage4 } from "async_hooks";
108764
- var scope;
108765
- var init_call_deadline = __esm(() => {
108766
- scope = new AsyncLocalStorage4;
108767
- });
108768
108850
  // packages/omo-senpi/src/components/thread/reader.ts
108769
108851
  var init_reader = __esm(() => {
108770
108852
  init_contracts();
@@ -108772,10 +108854,12 @@ var init_reader = __esm(() => {
108772
108854
  });
108773
108855
 
108774
108856
  // packages/omo-senpi/src/components/thread/paged-reader.ts
108857
+ var RETIRED_CURSOR_VERSIONS;
108775
108858
  var init_paged_reader = __esm(() => {
108776
108859
  init_contracts();
108777
108860
  init_errors5();
108778
108861
  init_reader();
108862
+ RETIRED_CURSOR_VERSIONS = new Set(["t2"]);
108779
108863
  });
108780
108864
 
108781
108865
  // packages/omo-senpi/src/components/thread/remote/context-tail.ts
@@ -108837,6 +108921,7 @@ var init_relay_control = __esm(() => {
108837
108921
  init_transcript_tail();
108838
108922
  init_paged_reader();
108839
108923
  init_remote_ops();
108924
+ init_fields();
108840
108925
  init_close_ladder();
108841
108926
  init_port();
108842
108927
  init_wait_settled();
@@ -108845,7 +108930,10 @@ var init_relay_control = __esm(() => {
108845
108930
  });
108846
108931
 
108847
108932
  // packages/omo-senpi/src/components/thread/remote/attach-pool.ts
108848
- var init_attach_pool = () => {};
108933
+ var CATALOG_RECORD = "get_available_models", HELD_RECORDS;
108934
+ var init_attach_pool = __esm(() => {
108935
+ HELD_RECORDS = new Set([CATALOG_RECORD, "get_protocol_info"]);
108936
+ });
108849
108937
 
108850
108938
  // packages/omo-senpi/src/components/thread/remote/session-state.ts
108851
108939
  var ACCESS_ENDED, ACCESS_REFUSED, SESSION_LEFT, SESSION_GONE2;
@@ -108891,7 +108979,12 @@ var init_device_service3 = __esm(() => {
108891
108979
  init_attach_pool();
108892
108980
  init_remote_watch();
108893
108981
  init_call_deadline();
108894
- READ_ONLY_RECORDS = new Set(["get_state", "get_messages", "get_entries"]);
108982
+ READ_ONLY_RECORDS = new Set([
108983
+ "get_state",
108984
+ "get_messages",
108985
+ "get_entries",
108986
+ "get_protocol_info"
108987
+ ]);
108895
108988
  MARKED_RECORDS = new Set(["admit_external_message"]);
108896
108989
  LOOKUP_NONE = new Set(["session_not_found", "peer_not_found", "peer_not_session_client"]);
108897
108990
  });
@@ -108946,10 +109039,19 @@ var init_seams = __esm(() => {
108946
109039
  init_codes();
108947
109040
  });
108948
109041
 
109042
+ // packages/omo-senpi/src/components/remote/resolve.ts
109043
+ var init_resolve3 = __esm(() => {
109044
+ init_client5();
109045
+ init_deadlines();
109046
+ init_codes();
109047
+ init_seams();
109048
+ });
109049
+
108949
109050
  // packages/omo-senpi/src/components/remote/aliases.ts
108950
109051
  var init_aliases = __esm(() => {
108951
109052
  init_codes();
108952
109053
  init_deadlines();
109054
+ init_resolve3();
108953
109055
  init_seams();
108954
109056
  });
108955
109057
 
@@ -108962,6 +109064,7 @@ var init_attach = __esm(() => {
108962
109064
  init_codes();
108963
109065
  init_deadlines();
108964
109066
  init_device_service3();
109067
+ init_resolve3();
108965
109068
  init_seams();
108966
109069
  DIALOG_KINDS = new Set(["select", "confirm", "input", "editor", "question"]);
108967
109070
  });
@@ -108978,21 +109081,15 @@ var init_follow = __esm(() => {
108978
109081
  RUN_OVER = new Set(["waiting_children", "waiting_background", "done", "failed", "cancelled"]);
108979
109082
  });
108980
109083
 
108981
- // packages/omo-senpi/src/components/remote/resolve.ts
108982
- var init_resolve3 = __esm(() => {
108983
- init_addressing();
108984
- init_codes();
108985
- init_seams();
108986
- });
108987
-
108988
109084
  // packages/omo-senpi/src/components/thread/gateway/provenance-resolver.ts
108989
109085
  var init_provenance_resolver = () => {};
108990
109086
  // packages/omo-senpi/src/components/thread/gateway/constants.ts
108991
- var QUEUED_TTL_MS, ROOT_LIFETIME_MS, TARGET_MAX_BYTES, GATEWAY_RECEIPT_RETENTION_MS, DELIVERY_RETENTION_MS, RETENTION_SWEEP_INTERVAL_MS;
109087
+ var QUEUED_TTL_MS, ROOT_LIFETIME_MS, TARGET_MAX_BYTES, STEER_RESERVE_BYTES, GATEWAY_RECEIPT_RETENTION_MS, DELIVERY_RETENTION_MS, RETENTION_SWEEP_INTERVAL_MS;
108992
109088
  var init_constants6 = __esm(() => {
108993
109089
  QUEUED_TTL_MS = 24 * 60 * 60 * 1000;
108994
109090
  ROOT_LIFETIME_MS = 7 * 24 * 60 * 60 * 1000;
108995
109091
  TARGET_MAX_BYTES = 1024 * 1024;
109092
+ STEER_RESERVE_BYTES = 256 * 1024;
108996
109093
  GATEWAY_RECEIPT_RETENTION_MS = 30 * 24 * 60 * 60 * 1000;
108997
109094
  DELIVERY_RETENTION_MS = 30 * 24 * 60 * 60 * 1000;
108998
109095
  RETENTION_SWEEP_INTERVAL_MS = 60 * 60 * 1000;
@@ -109002,12 +109099,6 @@ var init_constants6 = __esm(() => {
109002
109099
  var init_provenance2 = __esm(() => {
109003
109100
  init_constants6();
109004
109101
  });
109005
-
109006
- // packages/omo-senpi/src/components/thread/gateway/result.ts
109007
- var init_result2 = __esm(() => {
109008
- init_errors5();
109009
- });
109010
-
109011
109102
  // packages/omo-senpi/src/components/thread/remote/find-session.ts
109012
109103
  var NO_FIND_SESSION;
109013
109104
  var init_find_session = __esm(() => {
@@ -109031,6 +109122,7 @@ var init_relay_transport = __esm(() => {
109031
109122
  init_provenance2();
109032
109123
  init_result2();
109033
109124
  init_remote_ops();
109125
+ init_device();
109034
109126
  init_outcome();
109035
109127
  init_find_session();
109036
109128
  init_call_deadline();
@@ -109048,6 +109140,7 @@ var init_relay_transport = __esm(() => {
109048
109140
  // packages/omo-senpi/src/components/thread/remote/this-device.ts
109049
109141
  var known2;
109050
109142
  var init_this_device = __esm(() => {
109143
+ init_account();
109051
109144
  known2 = new WeakMap;
109052
109145
  });
109053
109146
 
@@ -109056,6 +109149,7 @@ var init_client_message_id = () => {};
109056
109149
  // packages/omo-senpi/src/components/remote/sessions.ts
109057
109150
  var NO_SESSION;
109058
109151
  var init_sessions = __esm(() => {
109152
+ init_fields();
109059
109153
  init_permission_presets();
109060
109154
  init_operations();
109061
109155
  init_port();
@@ -109072,6 +109166,7 @@ var init_sessions = __esm(() => {
109072
109166
  init_codes();
109073
109167
  init_deadlines();
109074
109168
  init_device_service3();
109169
+ init_resolve3();
109075
109170
  init_seams();
109076
109171
  init_client_message_id();
109077
109172
  NO_SESSION = new Set(["unknown_session", "session_not_found"]);
@@ -109101,19 +109196,69 @@ var init_factories = __esm(() => {
109101
109196
  init_client5();
109102
109197
  });
109103
109198
 
109104
- // packages/omo-senpi/src/components/thread/remote/plan-create.ts
109105
- var ALIASES_UNAVAILABLE;
109106
- var init_plan_create = __esm(() => {
109199
+ // packages/omo-senpi/src/components/thread/address/holder.ts
109200
+ var init_holder = __esm(() => {
109201
+ init_account();
109202
+ init_outcome();
109203
+ init_refusals();
109204
+ });
109205
+
109206
+ // packages/omo-senpi/src/components/thread/address/ladder.ts
109207
+ var init_ladder = __esm(() => {
109107
109208
  init_addressing();
109108
- init_relay_session_host();
109109
109209
  init_errors5();
109110
- init_thread_row();
109111
- init_find_session();
109210
+ });
109211
+
109212
+ // packages/omo-senpi/src/components/thread/address/probe.ts
109213
+ var init_probe = __esm(() => {
109214
+ init_errors5();
109215
+ init_address_book();
109112
109216
  init_remote_ops();
109113
- ALIASES_UNAVAILABLE = {
109114
- kind: "error",
109115
- 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.")
109116
- };
109217
+ init_account();
109218
+ init_refusals();
109219
+ });
109220
+
109221
+ // packages/omo-senpi/src/components/thread/address/bare.ts
109222
+ var init_bare = __esm(() => {
109223
+ init_addressing();
109224
+ init_errors5();
109225
+ init_address_book();
109226
+ init_holder();
109227
+ init_ladder();
109228
+ init_probe();
109229
+ init_refusals();
109230
+ });
109231
+
109232
+ // packages/omo-senpi/src/components/thread/address/on-device.ts
109233
+ var init_on_device = __esm(() => {
109234
+ init_address_book();
109235
+ init_holder();
109236
+ init_bare();
109237
+ init_device();
109238
+ init_ladder();
109239
+ init_probe();
109240
+ init_refusals();
109241
+ });
109242
+
109243
+ // packages/omo-senpi/src/components/thread/address/resolve.ts
109244
+ var init_resolve4 = __esm(() => {
109245
+ init_errors5();
109246
+ init_address_book();
109247
+ init_remote_ops();
109248
+ init_account();
109249
+ init_bare();
109250
+ init_device();
109251
+ init_on_device();
109252
+ init_probe();
109253
+ init_refusals();
109254
+ });
109255
+
109256
+ // packages/omo-senpi/src/components/thread/address/index.ts
109257
+ var init_address = __esm(() => {
109258
+ init_account();
109259
+ init_device();
109260
+ init_refusals();
109261
+ init_resolve4();
109117
109262
  });
109118
109263
 
109119
109264
  // packages/omo-opencode/src/cli/cli-program.ts
@@ -111990,7 +112135,7 @@ function isRootSetting(line, key) {
111990
112135
  // packages/omo-codex/src/install/codex-model-catalog.ts
111991
112136
  import { readFile as readFile11 } from "fs/promises";
111992
112137
  import { join as join38 } from "path";
111993
- var CODEX_ASTRA_MODEL = "gpt-6-astra";
112138
+ var CODEX_ASTRA_MODEL = "gpt-6.2-astra";
111994
112139
  var FALLBACK_CODEX_MODEL_CATALOG = {
111995
112140
  current: {
111996
112141
  model: CODEX_ASTRA_MODEL,
@@ -112017,6 +112162,12 @@ var FALLBACK_CODEX_MODEL_CATALOG = {
112017
112162
  modelContextWindow: 650000,
112018
112163
  modelReasoningEffort: "high",
112019
112164
  planModeReasoningEffort: "xhigh"
112165
+ },
112166
+ {
112167
+ model: "gpt-6-astra",
112168
+ modelContextWindow: 600000,
112169
+ modelReasoningEffort: "high",
112170
+ planModeReasoningEffort: "xhigh"
112020
112171
  }
112021
112172
  ]
112022
112173
  };
@@ -112566,6 +112717,7 @@ import { lstat as lstat8, readFile as readFile14, readdir as readdir7, writeFile
112566
112717
  import { join as join42 } from "path";
112567
112718
 
112568
112719
  // packages/omo-codex/src/install/managed-agent-reasoning-defaults.ts
112720
+ var PREVIOUS_CODEX_ASTRA_MODEL = "gpt-6-astra";
112569
112721
  var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112570
112722
  [
112571
112723
  "explorer",
@@ -112580,7 +112732,11 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112580
112732
  },
112581
112733
  {
112582
112734
  previous: { model: "gpt-5.6-luna", effort: "low" },
112583
- current: { model: CODEX_ASTRA_MODEL, effort: "low" }
112735
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" }
112736
+ },
112737
+ {
112738
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" },
112739
+ current: { model: "gpt-6-luna", effort: "low" }
112584
112740
  }
112585
112741
  ]
112586
112742
  ],
@@ -112597,7 +112753,11 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112597
112753
  },
112598
112754
  {
112599
112755
  previous: { model: "gpt-5.6-luna", effort: "low" },
112600
- current: { model: CODEX_ASTRA_MODEL, effort: "low" }
112756
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" }
112757
+ },
112758
+ {
112759
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" },
112760
+ current: { model: "gpt-6-luna", effort: "low" }
112601
112761
  }
112602
112762
  ]
112603
112763
  ],
@@ -112606,6 +112766,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112606
112766
  [
112607
112767
  {
112608
112768
  previous: { model: "gpt-5.6-sol", effort: "high" },
112769
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112770
+ },
112771
+ {
112772
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112609
112773
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112610
112774
  }
112611
112775
  ]
@@ -112615,6 +112779,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112615
112779
  [
112616
112780
  {
112617
112781
  previous: { model: "gpt-5.6-luna", effort: "high" },
112782
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112783
+ },
112784
+ {
112785
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112618
112786
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112619
112787
  }
112620
112788
  ]
@@ -112632,6 +112800,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112632
112800
  },
112633
112801
  {
112634
112802
  previous: { model: "gpt-5.6-terra", effort: "high" },
112803
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112804
+ },
112805
+ {
112806
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112635
112807
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112636
112808
  }
112637
112809
  ]
@@ -112649,6 +112821,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112649
112821
  },
112650
112822
  {
112651
112823
  previous: { model: "gpt-5.6-sol", effort: "high" },
112824
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112825
+ },
112826
+ {
112827
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112652
112828
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112653
112829
  }
112654
112830
  ]
@@ -112666,6 +112842,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112666
112842
  },
112667
112843
  {
112668
112844
  previous: { model: "gpt-5.6-terra", effort: "high" },
112845
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112846
+ },
112847
+ {
112848
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112669
112849
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112670
112850
  }
112671
112851
  ]
@@ -112679,6 +112859,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112679
112859
  },
112680
112860
  {
112681
112861
  previous: { model: "gpt-5.6-sol", effort: "medium" },
112862
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "medium" }
112863
+ },
112864
+ {
112865
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "medium" },
112682
112866
  current: { model: CODEX_ASTRA_MODEL, effort: "medium" }
112683
112867
  }
112684
112868
  ]
@@ -112692,6 +112876,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112692
112876
  },
112693
112877
  {
112694
112878
  previous: { model: "gpt-5.6-terra", effort: "medium" },
112879
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "medium" }
112880
+ },
112881
+ {
112882
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "medium" },
112695
112883
  current: { model: CODEX_ASTRA_MODEL, effort: "medium" }
112696
112884
  }
112697
112885
  ]
@@ -112705,6 +112893,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112705
112893
  },
112706
112894
  {
112707
112895
  previous: { model: "gpt-5.6-terra", effort: "high" },
112896
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112897
+ },
112898
+ {
112899
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112708
112900
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112709
112901
  }
112710
112902
  ]
@@ -112718,6 +112910,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112718
112910
  },
112719
112911
  {
112720
112912
  previous: { model: "gpt-5.6-luna", effort: "high" },
112913
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" }
112914
+ },
112915
+ {
112916
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "high" },
112721
112917
  current: { model: CODEX_ASTRA_MODEL, effort: "high" }
112722
112918
  }
112723
112919
  ]
@@ -112735,6 +112931,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
112735
112931
  },
112736
112932
  {
112737
112933
  previous: { model: "gpt-5.6-sol", effort: "low" },
112934
+ current: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" }
112935
+ },
112936
+ {
112937
+ previous: { model: PREVIOUS_CODEX_ASTRA_MODEL, effort: "low" },
112738
112938
  current: { model: CODEX_ASTRA_MODEL, effort: "low" }
112739
112939
  }
112740
112940
  ]
@@ -115084,7 +115284,8 @@ const agentDir = process.env.OMO_CODING_AGENT_DIR ?? process.env.SENPI_CODING_AG
115084
115284
  ?? process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".omo", "agent")
115085
115285
  const env = {
115086
115286
  ...process.env,
115087
- SENPI_BRAND: JSON.stringify(brand),
115287
+ // The plugin this launcher prepends with --extension is the engine's own, never a user flag (#14465).
115288
+ SENPI_BRAND: JSON.stringify({ ...brand, extensions: [plugin] }),
115088
115289
  OMO_NATIVE: "1",
115089
115290
  OMO_CODING_AGENT_DIR: agentDir,
115090
115291
  SENPI_CODING_AGENT_DIR: agentDir,
@@ -115318,6 +115519,7 @@ var REQUIRED_PLUGIN_ARTIFACTS = [
115318
115519
  join66("skills-conditional", "x-search", "SKILL.md"),
115319
115520
  join66("runtime", "agent-toolkit-sdk", "sdk.js"),
115320
115521
  join66("runtime", "bunshin-ts", "sdk.js"),
115522
+ join66("runtime", "omo-sdk", "sdk.js"),
115321
115523
  join66("runtime", "thread-sdk", "sdk.js"),
115322
115524
  join66("runtime", "ast-grep-mcp", "cli.js"),
115323
115525
  join66("runtime", "lsp-daemon", "dist", "cli.js"),
@@ -119961,12 +120163,7 @@ var I18nConfigSchema = object({
119961
120163
  locale: string2().optional()
119962
120164
  });
119963
120165
  // packages/omo-opencode/src/config/schema/keyword-detector.ts
119964
- init_zod();
119965
- var KeywordTypeSchema = _enum(["ultrawork", "team", "hyperplan", "hyperplan-ultrawork"]);
119966
- var KeywordDetectorConfigSchema = object({
119967
- enabled_expansions: array(KeywordTypeSchema).optional(),
119968
- disabled_keywords: array(KeywordTypeSchema).optional()
119969
- });
120166
+ init_src4();
119970
120167
  // packages/omo-opencode/src/config/schema/model-capabilities.ts
119971
120168
  init_zod();
119972
120169
  var ModelCapabilitiesConfigSchema = object({
@@ -120198,7 +120395,7 @@ var OhMyOpenCodeConfigSchema = object({
120198
120395
  i18n: I18nConfigSchema.optional(),
120199
120396
  monitor: MonitorConfigSchema.optional(),
120200
120397
  team_mode: TeamModeConfigSchema.optional(),
120201
- keyword_detector: KeywordDetectorConfigSchema.optional(),
120398
+ keyword_detector: OmoKeywordDetectorSettingsSchema.optional(),
120202
120399
  babysitting: BabysittingConfigSchema.optional(),
120203
120400
  git_master: GitMasterConfigSchema.default({
120204
120401
  commit_footer: false,
@@ -124679,8 +124876,8 @@ var package_default3 = {
124679
124876
  },
124680
124877
  dependencies: {
124681
124878
  "@clack/prompts": "^1.8.1",
124682
- "@code-yeongyu/senpi": "2026.11.18-2",
124683
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.18-2",
124879
+ "@code-yeongyu/senpi": "2026.11.19-5",
124880
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.19-5",
124684
124881
  "@modelcontextprotocol/sdk": "^1.30.0",
124685
124882
  "@oh-my-opencode/agents-md-core": "workspace:*",
124686
124883
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -127914,9 +128111,9 @@ function deviceName(host = machineHost()) {
127914
128111
  const bounded = [...clean].slice(0, 64).join("").trim();
127915
128112
  return bounded === "" ? UNNAMED : bounded;
127916
128113
  }
127917
- var LEGACY_PREFIX = "omo CLI on ";
128114
+ var LEGACY_PREFIXES = ["omo CLI on ", "OmO Desktop on "];
127918
128115
  function isGeneratedDeviceName(name) {
127919
- return name.startsWith(LEGACY_PREFIX) || name === UNNAMED || name === deviceName(hostname());
128116
+ return LEGACY_PREFIXES.some((prefix) => name.startsWith(prefix)) || name === UNNAMED || name === deviceName(hostname());
127920
128117
  }
127921
128118
  function devicePlatform() {
127922
128119
  switch (process.platform) {
@@ -130146,12 +130343,16 @@ var parseLockedReply = (stdout) => {
130146
130343
  return null;
130147
130344
  return match[1] === "true" ? "locked" : "unlocked";
130148
130345
  };
130346
+ 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;
130347
+ var classifyProbeFailure = (stderr) => NO_SECRET_SERVICE.test(stderr) ? "absent" : "unknown";
130149
130348
  var finishedWithoutPrompt = (stdout) => /objectpath\s+'\/'\s*\)\s*$/.test(stdout);
130150
130349
  var gdbus = (args, timeoutMs) => new Promise((resolve) => {
130151
130350
  const child = spawn5("gdbus", ["call", "--session", "--dest", "org.freedesktop.secrets", ...args], {
130152
- stdio: ["ignore", "pipe", "ignore"]
130351
+ stdio: ["ignore", "pipe", "pipe"],
130352
+ env: { ...process.env, LC_ALL: "C" }
130153
130353
  });
130154
130354
  let stdout = "";
130355
+ let stderr = "";
130155
130356
  const timer = setTimeout(() => {
130156
130357
  child.kill();
130157
130358
  resolve({ kind: "unknown" });
@@ -130159,13 +130360,16 @@ var gdbus = (args, timeoutMs) => new Promise((resolve) => {
130159
130360
  child.stdout.on("data", (chunk) => {
130160
130361
  stdout += chunk.toString();
130161
130362
  });
130363
+ child.stderr.on("data", (chunk) => {
130364
+ stderr += chunk.toString();
130365
+ });
130162
130366
  child.on("error", () => {
130163
130367
  clearTimeout(timer);
130164
130368
  resolve({ kind: "unknown" });
130165
130369
  });
130166
130370
  child.on("close", (code) => {
130167
130371
  clearTimeout(timer);
130168
- resolve(code === 0 ? { kind: "reply", stdout } : { kind: "failed" });
130372
+ resolve(code === 0 ? { kind: "reply", stdout } : { kind: "failed", stderr });
130169
130373
  });
130170
130374
  });
130171
130375
  var readLocked = async (timeoutMs) => {
@@ -130179,7 +130383,7 @@ var readLocked = async (timeoutMs) => {
130179
130383
  ], timeoutMs);
130180
130384
  if (answer.kind === "unknown")
130181
130385
  return "unknown";
130182
- return answer.kind === "reply" ? parseLockedReply(answer.stdout) ?? "absent" : "absent";
130386
+ return answer.kind === "reply" ? parseLockedReply(answer.stdout) ?? "unknown" : classifyProbeFailure(answer.stderr);
130183
130387
  };
130184
130388
  var probeSecretServiceLock = async () => {
130185
130389
  const state = await readLocked(PROBE_TIMEOUT_MS2);
@@ -130266,6 +130470,218 @@ async function credentialLockBusy(error) {
130266
130470
  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.`);
130267
130471
  }
130268
130472
 
130473
+ // packages/omo-opencode/src/cli/service-auth/linux-store-route.ts
130474
+ var LIBSECRET_NOTICE = "omo: could not check whether the keyring is locked (gdbus or the Secret Service did not answer); using libsecret directly.";
130475
+ function routeLinuxStore(input) {
130476
+ const { keyring, file, notice } = input;
130477
+ let storage = "keyring";
130478
+ let libsecretNoticed = false;
130479
+ let keptNoticed = false;
130480
+ const underLock = (action) => withCredentialLock(input.api, action, input.home ?? accountHome());
130481
+ const migrate = () => underLock(async () => {
130482
+ const text = await file.text();
130483
+ if (text === null)
130484
+ return;
130485
+ const relation = await input.relation(text);
130486
+ if (relation === "empty" || relation === "older") {
130487
+ await input.moveToKeyring(text);
130488
+ await file.clear();
130489
+ return;
130490
+ }
130491
+ if (keptNoticed)
130492
+ return;
130493
+ keptNoticed = true;
130494
+ 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.`);
130495
+ });
130496
+ const choose = async () => {
130497
+ const answer = await input.probe();
130498
+ if (answer === "absent")
130499
+ return "file";
130500
+ if (await file.present()) {
130501
+ if (answer === "unknown")
130502
+ return "file";
130503
+ await migrate();
130504
+ return "keyring";
130505
+ }
130506
+ if (answer === "unknown" && !libsecretNoticed) {
130507
+ libsecretNoticed = true;
130508
+ notice(LIBSECRET_NOTICE);
130509
+ }
130510
+ return "keyring";
130511
+ };
130512
+ const target = async () => {
130513
+ storage = await choose();
130514
+ return storage === "file" ? file : keyring;
130515
+ };
130516
+ return {
130517
+ read: async () => (await target()).read(),
130518
+ readAuthoritative: async () => (await target()).readAuthoritative(),
130519
+ write: async (value, intent, beforeRetire) => {
130520
+ const store = await target();
130521
+ if (store === file)
130522
+ 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.`);
130523
+ await store.write(value, intent, beforeRetire);
130524
+ },
130525
+ clear: async () => {
130526
+ const answer = await input.probe();
130527
+ const present = await file.present();
130528
+ storage = answer === "absent" || answer === "unknown" && present ? "file" : "keyring";
130529
+ if (storage === "file")
130530
+ return file.clear();
130531
+ if (present)
130532
+ await underLock(async () => {
130533
+ const text = await file.text();
130534
+ if (text !== null && await input.relation(text) !== "other")
130535
+ await file.clear();
130536
+ });
130537
+ await keyring.clear();
130538
+ },
130539
+ storage: () => storage
130540
+ };
130541
+ }
130542
+
130543
+ // packages/omo-opencode/src/cli/service-auth/state-file-store.ts
130544
+ import { randomBytes as randomBytes5 } from "crypto";
130545
+ import { constants as constants15 } from "fs";
130546
+ import { lstat as lstat19, mkdir as mkdir14, open as open5, readdir as readdir19, rename as rename11, rm as rm19 } from "fs/promises";
130547
+ import { join as join115 } from "path";
130548
+ var ACCOUNT_STATE_DIR = "account-state";
130549
+ var { O_RDONLY, O_WRONLY, O_CREAT, O_EXCL, O_NOFOLLOW, O_NONBLOCK, O_DIRECTORY } = constants15;
130550
+ var GROUP_OR_WORLD = 63;
130551
+
130552
+ class StateFileRefused extends Error {
130553
+ refusal;
130554
+ constructor(refusal) {
130555
+ super(`the private sign-in file was refused (${refusal})`);
130556
+ this.refusal = refusal;
130557
+ }
130558
+ }
130559
+ var stateFileDirectory = (home) => join115(home, ".omo", ACCOUNT_STATE_DIR);
130560
+ var errnoCode = (error) => typeof error === "object" && error !== null && ("code" in error) && typeof error.code === "string" ? error.code : undefined;
130561
+ 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;
130562
+ var fileRefusal = (stat, uid) => !stat.isFile() ? "not-a-file" : stat.uid !== uid ? "other-owner" : (stat.mode & GROUP_OR_WORLD) !== 0 ? "open" : undefined;
130563
+ async function checkDir(dir, uid) {
130564
+ const stat = await lstat19(dir).catch((error) => {
130565
+ if (errnoCode(error) === "ENOENT")
130566
+ return null;
130567
+ throw error;
130568
+ });
130569
+ if (stat === null)
130570
+ return false;
130571
+ const refusal = dirRefusal(stat, uid);
130572
+ if (refusal !== undefined)
130573
+ throw new StateFileRefused(refusal);
130574
+ return true;
130575
+ }
130576
+ async function readStateFile(dir, name, uid) {
130577
+ if (!await checkDir(dir, uid))
130578
+ return null;
130579
+ const handle = await open5(join115(dir, name), O_RDONLY | O_NOFOLLOW | O_NONBLOCK).catch((error) => {
130580
+ const code = errnoCode(error);
130581
+ if (code === "ENOENT")
130582
+ return null;
130583
+ if (code === "ELOOP")
130584
+ throw new StateFileRefused("symlink");
130585
+ throw error;
130586
+ });
130587
+ if (handle === null)
130588
+ return null;
130589
+ try {
130590
+ const refusal = fileRefusal(await handle.stat(), uid);
130591
+ if (refusal !== undefined)
130592
+ throw new StateFileRefused(refusal);
130593
+ return await handle.readFile("utf8");
130594
+ } finally {
130595
+ await handle.close();
130596
+ }
130597
+ }
130598
+ async function removeTempLeftovers(dir, name) {
130599
+ const entries = await readdir19(dir).catch((error) => {
130600
+ if (errnoCode(error) === "ENOENT")
130601
+ return [];
130602
+ throw error;
130603
+ });
130604
+ for (const entry of entries)
130605
+ if (entry.startsWith(`.${name}.`) && entry.endsWith(".tmp"))
130606
+ await rm19(join115(dir, entry), { force: true });
130607
+ }
130608
+ async function writeStateFile(dir, name, contents, uid) {
130609
+ await mkdir14(dir, { recursive: true, mode: 448 });
130610
+ await checkDir(dir, uid);
130611
+ await removeTempLeftovers(dir, name);
130612
+ const temp = join115(dir, `.${name}.${randomBytes5(8).toString("hex")}.tmp`);
130613
+ try {
130614
+ const handle = await open5(temp, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW, 384);
130615
+ try {
130616
+ await handle.writeFile(contents, "utf8");
130617
+ await handle.sync();
130618
+ } finally {
130619
+ await handle.close();
130620
+ }
130621
+ await rename11(temp, join115(dir, name));
130622
+ } catch (error) {
130623
+ await rm19(temp, { force: true });
130624
+ throw error;
130625
+ }
130626
+ const directory = await open5(dir, O_RDONLY | O_DIRECTORY);
130627
+ try {
130628
+ await directory.sync().catch(() => {
130629
+ return;
130630
+ });
130631
+ } finally {
130632
+ await directory.close();
130633
+ }
130634
+ }
130635
+ async function removeStateFile(dir, name) {
130636
+ await removeTempLeftovers(dir, name);
130637
+ await rm19(join115(dir, name), { force: true });
130638
+ }
130639
+ function createStateFileStore(input) {
130640
+ const { api, name, codec, failure } = input;
130641
+ const log = input.log ?? ((line) => process.stderr.write(`${line}
130642
+ `));
130643
+ const uid = process.getuid?.() ?? -1;
130644
+ const directory = () => stateFileDirectory(input.home ?? accountHome());
130645
+ 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"}).`);
130646
+ const text = async () => {
130647
+ try {
130648
+ return await readStateFile(directory(), name, uid);
130649
+ } catch (error) {
130650
+ if (!(error instanceof StateFileRefused))
130651
+ throw failed("read", error);
130652
+ log(`omo: ${error.message} in ${directory()} and is not used; this computer reads as signed out.`);
130653
+ return null;
130654
+ }
130655
+ };
130656
+ const read = async () => {
130657
+ const stored = await text();
130658
+ return stored === null ? null : codec.parse(stored);
130659
+ };
130660
+ const locked = (action) => withCredentialLock(api, action, input.home ?? accountHome());
130661
+ return {
130662
+ read,
130663
+ readAuthoritative: read,
130664
+ text,
130665
+ directory,
130666
+ present: async () => await lstat19(join115(directory(), name)).catch(() => null) !== null,
130667
+ write: (value) => locked(async () => {
130668
+ const next = codec.amend === undefined ? value : codec.amend(await text(), value);
130669
+ try {
130670
+ await writeStateFile(directory(), name, codec.serialize(next), uid);
130671
+ } catch (error) {
130672
+ throw failed("write", error);
130673
+ }
130674
+ }),
130675
+ clear: () => locked(async () => {
130676
+ try {
130677
+ await removeStateFile(directory(), name);
130678
+ } catch (error) {
130679
+ throw failed("remove", error);
130680
+ }
130681
+ })
130682
+ };
130683
+ }
130684
+
130269
130685
  // packages/omo-opencode/src/cli/service-auth/keystore.ts
130270
130686
  class CredentialStoreError extends SignInError {
130271
130687
  }
@@ -130308,19 +130724,21 @@ var stderrNoticeOncePerProcess = (message) => {
130308
130724
  `);
130309
130725
  };
130310
130726
  var isLocked = (error) => error instanceof Error && (LOCKED.test(error.message) || LOCKED.test(String(error.code ?? "")));
130727
+ 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);
130728
+ 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";
130311
130729
  function credentialId(api) {
130312
130730
  return createHash14("sha256").update(serviceOrigin(api)).digest("hex");
130313
130731
  }
130314
130732
  function createCredentialStore(api, options = {}) {
130315
130733
  const store = createSealedStore(api, "omo-cli", credentialSchema, options.secrets, options.platform, options.lockProbe, options.notice, options.wait, (current, value) => {
130316
- 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);
130734
+ const sameIdentity = current !== null && sameCredentialIdentity(current, value);
130317
130735
  const accountId = value.accountId ?? (sameIdentity ? current?.accountId : undefined);
130318
130736
  return {
130319
130737
  ...value,
130320
130738
  ...accountId === undefined ? {} : { accountId },
130321
130739
  credentialGeneration: sameIdentity ? current?.credentialGeneration ?? randomUUID8() : randomUUID8()
130322
130740
  };
130323
- }, options.keychainHelper);
130741
+ }, options.keychainHelper, { ...options.home === undefined ? {} : { home: options.home }, relate: relateCredentials });
130324
130742
  const sections = new WeakMap;
130325
130743
  const underLock = (lease) => {
130326
130744
  const known = sections.get(lease);
@@ -130359,12 +130777,46 @@ function createCredentialStore(api, options = {}) {
130359
130777
  clear: () => locked((view) => view.clear(), store.clear),
130360
130778
  ...store.prepare === undefined ? {} : { prepare: store.prepare },
130361
130779
  underLock,
130362
- ...store.migrationPending === undefined ? {} : { migrationPending: store.migrationPending }
130780
+ ...store.migrationPending === undefined ? {} : { migrationPending: store.migrationPending },
130781
+ ...store.storage === undefined ? {} : { storage: store.storage }
130363
130782
  };
130364
130783
  }
130365
- 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) {
130366
- if (!secrets)
130784
+ 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 = {}) {
130785
+ const { home } = linux;
130786
+ const parseStored = (value) => {
130787
+ try {
130788
+ return schema.parse(JSON.parse(value));
130789
+ } catch {
130790
+ 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.");
130791
+ }
130792
+ };
130793
+ const previousOf = (raw) => {
130794
+ if (raw === null)
130795
+ return null;
130796
+ try {
130797
+ return schema.parse(JSON.parse(raw));
130798
+ } catch {
130799
+ return null;
130800
+ }
130801
+ };
130802
+ const codec = {
130803
+ parse: parseStored,
130804
+ serialize: (value) => JSON.stringify(schema.parse(value)),
130805
+ ...amendWrite === undefined ? {} : { amend: (raw, next) => amendWrite(previousOf(raw), next) }
130806
+ };
130807
+ const stateFile = platform === "linux" ? createStateFileStore({
130808
+ api,
130809
+ name: `${namespace}-${credentialId(api)}.json`,
130810
+ codec,
130811
+ failure: (message) => new CredentialStoreError(message),
130812
+ ...home === undefined ? {} : { home }
130813
+ }) : null;
130814
+ if (!secrets) {
130815
+ if (stateFile !== null)
130816
+ return { ...stateFile, storage: () => "file" };
130367
130817
  throw new SignInError("OmO sign-in needs Bun 1.4 or newer with OS credential storage. No file fallback is available.");
130818
+ }
130819
+ const neverInAFile = platform === "linux" ? "" : " Credentials are never saved to a file.";
130368
130820
  const platformName = platform === "darwin" ? "macOS Keychain" : platform === "linux" ? "Linux Secret Service (libsecret and an unlocked keyring)" : platform === "win32" ? "Windows Credential Manager" : null;
130369
130821
  if (platformName === null)
130370
130822
  throw new SignInError("This platform has no supported OS credential store.");
@@ -130420,7 +130872,7 @@ ${key.name}`;
130420
130872
  return await read;
130421
130873
  }
130422
130874
  const expired = new Promise((_, reject) => {
130423
- timer = setTimeout(() => reject(new KeychainApprovalPendingError(`${waitingFor}, then try again. Credentials are never saved to a file.`)), wait.deadlineMs);
130875
+ timer = setTimeout(() => reject(new KeychainApprovalPendingError(`${waitingFor}, then try again.${neverInAFile}`)), wait.deadlineMs);
130424
130876
  });
130425
130877
  return await Promise.race([read, expired]);
130426
130878
  } finally {
@@ -130428,42 +130880,19 @@ ${key.name}`;
130428
130880
  }
130429
130881
  };
130430
130882
  const lockedHint = platform === "darwin" ? " On an unattended Mac, omo account store enable keeps the sign-in in OmO's own keychain." : "";
130431
- 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.`);
130883
+ 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}`);
130432
130884
  let unlockedUntil = 0;
130433
- let noticed = false;
130434
- const assertUsable = async () => {
130435
- if (platform !== "linux" || Date.now() < unlockedUntil)
130436
- return;
130885
+ const keyringState = async () => {
130886
+ if (Date.now() < unlockedUntil)
130887
+ return "unlocked";
130437
130888
  const lock = await lockProbe();
130438
130889
  if (lock === "locked")
130439
- throw new KeychainLockedError(`${platformName} is locked. Unlock it, then try again. Credentials are never saved to a file.`);
130440
- if (lock === "unlocked") {
130890
+ throw new KeychainLockedError(`${platformName} is locked. Unlock it, then try again.`);
130891
+ if (lock === "unlocked")
130441
130892
  unlockedUntil = Date.now() + UNLOCKED_REUSE_MS;
130442
- return;
130443
- }
130444
- if (!noticed) {
130445
- noticed = true;
130446
- notice("omo: could not check whether the keyring is locked (gdbus or the Secret Service did not answer); using libsecret directly.");
130447
- }
130448
- };
130449
- const parseStored = (value) => {
130450
- try {
130451
- return schema.parse(JSON.parse(value));
130452
- } catch {
130453
- 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.");
130454
- }
130455
- };
130456
- const previousOf = (raw) => {
130457
- if (raw === null)
130458
- return null;
130459
- try {
130460
- return schema.parse(JSON.parse(raw));
130461
- } catch {
130462
- return null;
130463
- }
130893
+ return lock;
130464
130894
  };
130465
130895
  const rawRead = async (fresh) => {
130466
- await assertUsable();
130467
130896
  const backend = await helper.backend();
130468
130897
  try {
130469
130898
  if (backend === null)
@@ -130493,7 +130922,7 @@ ${key.name}`;
130493
130922
  return mapped;
130494
130923
  return unavailable(mapped);
130495
130924
  };
130496
- return {
130925
+ const keyring = {
130497
130926
  read: () => parsedRead(false),
130498
130927
  readAuthoritative: () => parsedRead(true),
130499
130928
  async prepare() {
@@ -130504,16 +130933,10 @@ ${key.name}`;
130504
130933
  const backend = await helper.backend();
130505
130934
  if (backend === null)
130506
130935
  return null;
130507
- const codec = {
130508
- parse: parseStored,
130509
- serialize: (value) => JSON.stringify(schema.parse(value)),
130510
- ...amendWrite === undefined ? {} : { amend: (raw, next) => amendWrite(previousOf(raw), next) }
130511
- };
130512
130936
  return lockedStoreView(backend, lease, codec, lockedFailure, () => forget(helper.reader(backend)));
130513
130937
  },
130514
130938
  migrationPending: async () => (await helper.backend())?.migrationPending() ?? false,
130515
130939
  async write(value) {
130516
- await assertUsable();
130517
130940
  if (await helper.backend() !== null)
130518
130941
  throw new Error("OmO's keychain helper writes only under the session lock.");
130519
130942
  try {
@@ -130525,7 +130948,6 @@ ${key.name}`;
130525
130948
  forget(secrets);
130526
130949
  },
130527
130950
  async clear() {
130528
- await assertUsable();
130529
130951
  if (await helper.backend() !== null)
130530
130952
  throw new Error("OmO's keychain helper deletes only under the session lock.");
130531
130953
  try {
@@ -130534,8 +130956,49 @@ ${key.name}`;
130534
130956
  throw unavailable(error);
130535
130957
  }
130536
130958
  forget(secrets);
130959
+ },
130960
+ storage: () => "keyring"
130961
+ };
130962
+ if (stateFile === null)
130963
+ return keyring;
130964
+ return routeLinuxStore({
130965
+ api,
130966
+ keyring,
130967
+ file: stateFile,
130968
+ probe: keyringState,
130969
+ notice,
130970
+ ...home === undefined ? {} : { home },
130971
+ async relation(text) {
130972
+ let stored;
130973
+ try {
130974
+ stored = await answered(secrets, true);
130975
+ } catch (error) {
130976
+ throw error instanceof CredentialStoreError ? error : unavailable(error);
130977
+ } finally {
130978
+ forget(secrets);
130979
+ }
130980
+ if (stored === null)
130981
+ return "empty";
130982
+ if (stored === text)
130983
+ return "older";
130984
+ const inKeyring = previousOf(stored);
130985
+ const inFile = previousOf(text);
130986
+ if (inKeyring === null || inFile === null || linux.relate === undefined)
130987
+ return "other";
130988
+ return linux.relate(inKeyring, inFile);
130989
+ },
130990
+ async moveToKeyring(text) {
130991
+ try {
130992
+ await secrets.set({ ...key, value: text });
130993
+ if (await answered(secrets, true) !== text)
130994
+ throw new CredentialStoreError(`${platformName} did not return the sign-in it was given; it stays in the private file until it does.`);
130995
+ } catch (error) {
130996
+ throw error instanceof CredentialStoreError ? error : unavailable(error);
130997
+ } finally {
130998
+ forget(secrets);
130999
+ }
130537
131000
  }
130538
- };
131001
+ });
130539
131002
  }
130540
131003
 
130541
131004
  // packages/omo-opencode/src/cli/service-auth/session.ts
@@ -130650,8 +131113,8 @@ async function requestApi(api, path, init, signal) {
130650
131113
 
130651
131114
  // packages/omo-opencode/src/cli/service-auth/machine-reconcile.ts
130652
131115
  import { createHash as createHash15, createPrivateKey as createPrivateKey3, sign } from "crypto";
130653
- import { mkdir as mkdir14, readFile as readFile39, rename as rename11, rm as rm19, writeFile as writeFile18 } from "fs/promises";
130654
- import { dirname as dirname48, join as join115 } from "path";
131116
+ import { mkdir as mkdir15, readFile as readFile39, rename as rename12, rm as rm20, writeFile as writeFile18 } from "fs/promises";
131117
+ import { dirname as dirname48, join as join116 } from "path";
130655
131118
  init_zod();
130656
131119
  var MACHINE_BIND_CONTEXT = "omo-machine-bind-v1";
130657
131120
  var DEVICE_FIXUP_BUDGET_MS = 5000;
@@ -130666,7 +131129,7 @@ var ownDeviceSchema = object({
130666
131129
  });
130667
131130
  var refusalNoteSchema = object({ key: string2(), at: number2() });
130668
131131
  var thisMachine = { digest: () => readMachineDigest(), name: () => deviceName() };
130669
- var machineRefusalPath = (home, credential) => join115(home, ".omo", "account-state", `${credential}.machine-exists.json`);
131132
+ var machineRefusalPath = (home, credential) => join116(home, ".omo", "account-state", `${credential}.machine-exists.json`);
130670
131133
  var describe4 = (error) => error instanceof Error ? error.message : String(error);
130671
131134
  var refusalKey = (deviceId, digest) => createHash15("sha256").update(`${deviceId}
130672
131135
  ${digest}`, "utf8").digest("hex");
@@ -130693,13 +131156,13 @@ async function refusedRecently(path, key, nowMs, signal) {
130693
131156
  return note.success && note.data.key === key && nowMs - note.data.at < MACHINE_EXISTS_RETRY_MS;
130694
131157
  }
130695
131158
  async function rememberRefusal(path, key, nowMs, signal) {
130696
- await mkdir14(dirname48(path), { recursive: true, mode: 448 });
131159
+ await mkdir15(dirname48(path), { recursive: true, mode: 448 });
130697
131160
  const staging = `${path}.${process.pid}.tmp`;
130698
131161
  await writeFile18(staging, JSON.stringify({ key, at: nowMs }), { mode: 384, signal });
130699
131162
  if (signal.aborted)
130700
- await rm19(staging, { force: true });
131163
+ await rm20(staging, { force: true });
130701
131164
  else
130702
- await rename11(staging, path);
131165
+ await rename12(staging, path);
130703
131166
  }
130704
131167
  async function reconcileDevice(options) {
130705
131168
  const { credentials, request, signal } = options;
@@ -130794,10 +131257,10 @@ async function bindOnce(options, auth, log) {
130794
131257
 
130795
131258
  // packages/omo-opencode/src/cli/service-auth/signed-out-marker.ts
130796
131259
  init_zod();
130797
- import { mkdir as mkdir15, readFile as readFile40, rename as rename12, rm as rm20, writeFile as writeFile19 } from "fs/promises";
130798
- import { dirname as dirname49, join as join116 } from "path";
131260
+ import { mkdir as mkdir16, readFile as readFile40, rename as rename13, rm as rm21, writeFile as writeFile19 } from "fs/promises";
131261
+ import { dirname as dirname49, join as join117 } from "path";
130799
131262
  var markerSchema = object({ device: string2().nullable(), at: string2() });
130800
- var signedOutMarkerPath = (home, credential) => join116(home, ".omo", "account-state", `${credential}.signed-out.json`);
131263
+ var signedOutMarkerPath = (home, credential) => join117(home, ".omo", "account-state", `${credential}.signed-out.json`);
130801
131264
  async function readSignedOutMarker(path) {
130802
131265
  const text = await readFile40(path, "utf8").catch(() => null);
130803
131266
  if (text === null)
@@ -130812,14 +131275,14 @@ async function readSignedOutMarker(path) {
130812
131275
  return parsed.success ? parsed.data : null;
130813
131276
  }
130814
131277
  async function writeSignedOutMarker(path, device) {
130815
- await mkdir15(dirname49(path), { recursive: true, mode: 448 });
131278
+ await mkdir16(dirname49(path), { recursive: true, mode: 448 });
130816
131279
  const staging = `${path}.${process.pid}.tmp`;
130817
131280
  await writeFile19(staging, JSON.stringify({ device, at: new Date().toISOString() }), {
130818
131281
  mode: 384
130819
131282
  });
130820
- await rename12(staging, path);
131283
+ await rename13(staging, path);
130821
131284
  }
130822
- var clearSignedOutMarker = (path) => rm20(path, { force: true });
131285
+ var clearSignedOutMarker = (path) => rm21(path, { force: true });
130823
131286
 
130824
131287
  // packages/omo-opencode/src/cli/service-auth/session.ts
130825
131288
  class SessionEnded extends SignInError {
@@ -130860,6 +131323,18 @@ function createSession(options) {
130860
131323
  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;
130861
131324
  return typeof id === "string" && id !== "" ? id : undefined;
130862
131325
  };
131326
+ const unstampedAccount = async (current, access) => {
131327
+ if (current.accountId !== undefined || current.owner !== undefined)
131328
+ return;
131329
+ if (await beforeKeysDiscarded.wantsAccount?.() !== true)
131330
+ return;
131331
+ const budget = AbortSignal.timeout(options.machine?.budgetMs ?? DEVICE_FIXUP_BUDGET_MS);
131332
+ return accountOf(access, signal === undefined ? budget : AbortSignal.any([signal, budget]));
131333
+ };
131334
+ async function discard(current, cause) {
131335
+ const account = Date.parse(current.accessTokenExpiresAt) > now() ? await unstampedAccount(current, current.accessToken) : undefined;
131336
+ await beforeKeysDiscarded(discardedOf(account === undefined ? current : { ...current, accountId: account }, cause));
131337
+ }
130863
131338
  async function refreshed(current) {
130864
131339
  if (current.refreshState === "uncertain" || current.refreshAttempt !== undefined) {
130865
131340
  throw new SessionEnded(`Refresh recovery can no longer be proved safe. ${signInHint("again")}`, false, "refresh_recovery_expired");
@@ -130877,7 +131352,7 @@ function createSession(options) {
130877
131352
  if (error instanceof CredentialStoreError)
130878
131353
  throw error;
130879
131354
  if (error instanceof ApiRefusal && error.status < 500 && ["unauthorized", "account_deleted", "reauth_required", "invalid_grant", "device_revoked"].includes(error.code)) {
130880
- await beforeKeysDiscarded(discardedOf(current, "refused"));
131355
+ await discard(current, "refused");
130881
131356
  await store.clear();
130882
131357
  await deviceService?.forget();
130883
131358
  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);
@@ -130986,7 +131461,7 @@ function createSession(options) {
130986
131461
  stored = null;
130987
131462
  }
130988
131463
  if (stored !== null && stored.device.id !== value.device.id)
130989
- await beforeKeysDiscarded(discardedOf(stored, "replaced"));
131464
+ await discard(stored, "replaced");
130990
131465
  await store.write(value, "fresh-sign-in", () => beforeKeysDiscarded({ kind: "unreadable" }));
130991
131466
  await clearSignedOutMarker(markerPath);
130992
131467
  });
@@ -131007,8 +131482,23 @@ function createSession(options) {
131007
131482
  return action(current);
131008
131483
  });
131009
131484
  },
131485
+ discard,
131010
131486
  async forget() {
131011
- await locked(() => store.clear());
131487
+ await locked(async () => {
131488
+ let current;
131489
+ try {
131490
+ current = await store.readAuthoritative();
131491
+ } catch (error) {
131492
+ if (!(error instanceof InvalidCredentialState || error instanceof CredentialStoreError))
131493
+ throw error;
131494
+ await store.clear();
131495
+ await beforeKeysDiscarded({ kind: "unreadable" });
131496
+ return;
131497
+ }
131498
+ if (current !== null)
131499
+ await discard(current, "forget");
131500
+ await store.clear();
131501
+ });
131012
131502
  await deviceService?.forget();
131013
131503
  },
131014
131504
  accessSnapshot: snapshot,
@@ -131024,9 +131514,7 @@ function createSession(options) {
131024
131514
  if (current.refreshState === "uncertain")
131025
131515
  return false;
131026
131516
  const access = Date.parse(current.accessTokenExpiresAt) <= now() ? (await refreshed(current)).accessToken : current.accessToken;
131027
- if (current.accountId === undefined && current.owner === undefined && await beforeKeysDiscarded.wantsAccount?.() === true) {
131028
- account = await accountOf(access);
131029
- }
131517
+ account = await unstampedAccount(current, access);
131030
131518
  await request(`/v1/devices/${encodeURIComponent(current.device.id)}`, {
131031
131519
  method: "DELETE",
131032
131520
  headers: syncRequestHeaders(access)
@@ -131122,6 +131610,26 @@ async function refuseSecondMachineDevice(session, deviceService) {
131122
131610
  }
131123
131611
  }
131124
131612
 
131613
+ // packages/omo-opencode/src/cli/service-auth/login-prelude.ts
131614
+ class AccountsUnreachable extends SignInError {
131615
+ }
131616
+ async function ensureServiceAvailable(session, api) {
131617
+ try {
131618
+ return await session.request("/v1/health", { method: "GET" });
131619
+ } catch (error) {
131620
+ if (!(error instanceof SignInError))
131621
+ throw error;
131622
+ if (error instanceof RequestFailure) {
131623
+ 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.`);
131624
+ }
131625
+ throw new AccountsUnreachable(`OmO accounts at ${api} aren't available right now. Try again later.`);
131626
+ }
131627
+ }
131628
+ async function beginLogin(session, deviceService, api) {
131629
+ await refuseSecondMachineDevice(session, deviceService);
131630
+ return ensureServiceAvailable(session, api);
131631
+ }
131632
+
131125
131633
  // packages/omo-opencode/src/cli/service-auth/device-flow.ts
131126
131634
  import { setTimeout as setTimeout2 } from "timers/promises";
131127
131635
 
@@ -131144,6 +131652,13 @@ function generateDeviceKeys() {
131144
131652
  }
131145
131653
 
131146
131654
  // packages/omo-opencode/src/cli/service-auth/device-flow.ts
131655
+ class DeviceSignInRefused extends SignInError {
131656
+ code;
131657
+ constructor(code, message) {
131658
+ super(message);
131659
+ this.code = code;
131660
+ }
131661
+ }
131147
131662
  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.";
131148
131663
  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.";
131149
131664
  async function loginDevice(session, options) {
@@ -131168,7 +131683,7 @@ async function replaceEarlierDevice(session, options, keys, existing) {
131168
131683
  });
131169
131684
  } catch (error) {
131170
131685
  if (error instanceof ApiRefusal && error.code === "machine_exists")
131171
- throw new SignInError(REPLACE_UNSUPPORTED);
131686
+ throw new DeviceSignInRefused("replace_unsupported", REPLACE_UNSUPPORTED);
131172
131687
  throw error;
131173
131688
  }
131174
131689
  }
@@ -131184,7 +131699,8 @@ async function authorizeDevice(session, options, keys, replace) {
131184
131699
  options.show({
131185
131700
  verificationUri: minted.verificationUri,
131186
131701
  userCode: minted.userCode,
131187
- matchingCode: minted.matchingCode
131702
+ matchingCode: minted.matchingCode,
131703
+ expiresAt: minted.expiresAt
131188
131704
  });
131189
131705
  const now = options.now ?? Date.now;
131190
131706
  const sleep = options.sleep ?? ((ms) => setTimeout2(ms, undefined, { signal: session.signal }));
@@ -131221,27 +131737,27 @@ async function authorizeDevice(session, options, keys, replace) {
131221
131737
  if (error.detail !== undefined) {
131222
131738
  if (await session.removeForLimit(error, options.chooseDevice))
131223
131739
  continue;
131224
- throw new SignInError("Sign-in cancelled. No device was removed.");
131740
+ throw new DeviceSignInRefused("device_limit", "Sign-in cancelled. No device was removed.");
131225
131741
  }
131226
131742
  if (error.replaceMismatch)
131227
- throw new SignInError(REPLACE_MISMATCH);
131743
+ throw new DeviceSignInRefused("replace_mismatch", REPLACE_MISMATCH);
131228
131744
  if (["access_denied", "expired_token", "invalid_grant"].includes(error.code)) {
131229
- throw new SignInError("Device sign-in was denied or expired. Run omo login again for a new code.");
131745
+ 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.");
131230
131746
  }
131231
131747
  throw error;
131232
131748
  }
131233
131749
  }
131234
- throw new SignInError("Device sign-in expired. Run omo login again for a new code.");
131750
+ throw new DeviceSignInRefused("approval_expired", "Device sign-in expired. Run omo login again for a new code.");
131235
131751
  }
131236
131752
 
131237
131753
  // packages/omo-opencode/src/cli/service-auth/loopback.ts
131238
- import { createHash as createHash16, randomBytes as randomBytes5, timingSafeEqual } from "crypto";
131754
+ import { createHash as createHash16, randomBytes as randomBytes6, timingSafeEqual } from "crypto";
131239
131755
  import { createServer as createServer3 } from "http";
131240
131756
  class BrowserUnavailable extends SignInError {
131241
131757
  }
131242
131758
  async function authorize(options) {
131243
- const verifier = randomBytes5(32).toString("base64url");
131244
- const state = randomBytes5(32).toString("base64url");
131759
+ const verifier = randomBytes6(32).toString("base64url");
131760
+ const state = randomBytes6(32).toString("base64url");
131245
131761
  const answer = Promise.withResolvers();
131246
131762
  const abort = () => answer.reject(new SignInError("Browser sign-in cancelled or timed out."));
131247
131763
  let accepted = false;
@@ -131379,15 +131895,15 @@ function decideReplace(options) {
131379
131895
  }
131380
131896
 
131381
131897
  // packages/memory-core/src/sync/device-retire.ts
131382
- import { createHash as createHash17, randomBytes as randomBytes6 } from "crypto";
131383
- import { join as join119 } from "path";
131898
+ import { createHash as createHash17, randomBytes as randomBytes7 } from "crypto";
131899
+ import { join as join120 } from "path";
131384
131900
 
131385
131901
  // packages/memory-core/src/identity/layout.ts
131386
131902
  import { homedir as homedir35 } from "os";
131387
- import { join as join117, resolve as resolve31 } from "path";
131903
+ import { join as join118, resolve as resolve31 } from "path";
131388
131904
  var MEMORY_ROOT_ENV_VAR = "OMO_MEMORY_HOME";
131389
131905
  function defaultMemoryRoot() {
131390
- return join117(homedir35(), ".omo", "memory");
131906
+ return join118(homedir35(), ".omo", "memory");
131391
131907
  }
131392
131908
  function resolveMemoryRoot(env, cwd) {
131393
131909
  const override = env[MEMORY_ROOT_ENV_VAR];
@@ -131397,13 +131913,13 @@ function resolveMemoryRoot(env, cwd) {
131397
131913
  return resolve31(cwd, override);
131398
131914
  }
131399
131915
  // packages/memory-core/src/sync/pin-dir.ts
131400
- import { join as join118 } from "path";
131401
- var syncPinDir = (memoryRoot) => join118(memoryRoot, "sync-device");
131916
+ import { join as join119 } from "path";
131917
+ var syncPinDir = (memoryRoot) => join119(memoryRoot, "sync-device");
131402
131918
 
131403
131919
  // packages/memory-core/src/sync/device-retire.ts
131404
- var trustAnchorRoot = (pinDir) => join119(pinDir, "trust-anchor");
131920
+ var trustAnchorRoot = (pinDir) => join120(pinDir, "trust-anchor");
131405
131921
  var trustAnchorKey = (account) => createHash17("sha256").update(account, "utf8").digest("base64url");
131406
- var trustAnchorDir = (pinDir, account) => join119(trustAnchorRoot(pinDir), trustAnchorKey(account));
131922
+ var trustAnchorDir = (pinDir, account) => join120(trustAnchorRoot(pinDir), trustAnchorKey(account));
131407
131923
  var hasLiveTrustAnchor = async (pinDir) => {
131408
131924
  try {
131409
131925
  return (await readdir17(trustAnchorRoot(pinDir))).some((name) => !name.includes(".retired-"));
@@ -131416,7 +131932,7 @@ var hasLiveTrustAnchor = async (pinDir) => {
131416
131932
  var retireSyncDevice = async (input) => {
131417
131933
  const dir = trustAnchorDir(input.pinDir, input.account);
131418
131934
  try {
131419
- await rename8(dir, `${dir}.retired-${Date.now()}-${randomBytes6(4).toString("hex")}`);
131935
+ await rename8(dir, `${dir}.retired-${Date.now()}-${randomBytes7(4).toString("hex")}`);
131420
131936
  } catch (error) {
131421
131937
  if (!(error instanceof Error && ("code" in error) && error.code === "ENOENT"))
131422
131938
  throw error;
@@ -131426,21 +131942,26 @@ var retireSyncDevice = async (input) => {
131426
131942
  // packages/omo-opencode/src/cli/service-auth/sync-pin-retire.ts
131427
131943
  var reason = (error) => error instanceof Error && ("code" in error) && typeof error.code === "string" ? error.code : "unknown";
131428
131944
  function retireSyncPinOnDiscard(options) {
131945
+ const livePin = () => hasLiveTrustAnchor(options.pinDir()).catch(() => false);
131429
131946
  const hook = async (discarded) => {
131430
131947
  if (discarded.kind === "unreadable") {
131431
- options.log("memory sync: a stored sign-in could not be read while it was replaced; its sync pin was left in place");
131948
+ if (await livePin())
131949
+ options.log("memory sync: a stored sign-in could not be read when its keys were discarded; its sync pin was left in place");
131432
131950
  return;
131433
131951
  }
131434
131952
  const account = discarded.owner?.accountId ?? discarded.accountId;
131435
- if (account === undefined)
131953
+ if (account === undefined) {
131954
+ if (await livePin())
131955
+ 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.");
131436
131956
  return;
131957
+ }
131437
131958
  try {
131438
131959
  await retireSyncDevice({ pinDir: options.pinDir(), account });
131439
131960
  } catch (error) {
131440
131961
  options.log(`memory sync: the sync pin could not be retired (${reason(error)}); it was left in place`);
131441
131962
  }
131442
131963
  };
131443
- return Object.assign(hook, { wantsAccount: () => hasLiveTrustAnchor(options.pinDir()).catch(() => false) });
131964
+ return Object.assign(hook, { wantsAccount: livePin });
131444
131965
  }
131445
131966
 
131446
131967
  // packages/omo-opencode/src/cli/service-auth/commands.ts
@@ -131448,22 +131969,6 @@ function noteDedicatedStore() {
131448
131969
  if (process.platform === "darwin" && dedicatedStoreState() === "active")
131449
131970
  console.log("The sign-in is kept in OmO's own keychain on this Mac (omo account store status).");
131450
131971
  }
131451
- async function ensureServiceAvailable(session, api) {
131452
- try {
131453
- return await session.request("/v1/health", { method: "GET" });
131454
- } catch (error) {
131455
- if (!(error instanceof SignInError))
131456
- throw error;
131457
- if (error instanceof RequestFailure) {
131458
- 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.`);
131459
- }
131460
- throw new SignInError(`OmO accounts at ${api} aren't available right now. Try again later.`);
131461
- }
131462
- }
131463
- async function beginLogin(session, deviceService, api) {
131464
- await refuseSecondMachineDevice(session, deviceService);
131465
- return ensureServiceAvailable(session, api);
131466
- }
131467
131972
  function deviceChoices(devices) {
131468
131973
  return devices.map((device) => ({ value: device.id, label: terminalText(device.name) }));
131469
131974
  }
@@ -131727,6 +132232,9 @@ var forgetDeviceService = async (options) => {
131727
132232
  }
131728
132233
  return "forgotten";
131729
132234
  };
132235
+ // packages/device-service-core/src/cold-wake/host.ts
132236
+ var UNREPAIRABLE = new Set(["EPERM", "EACCES", "EROFS"]);
132237
+
131730
132238
  // packages/device-service-core/src/cold-wake/service-table.ts
131731
132239
  var SERVICE_TABLE_ENV = "OMO_RELAYD_SERVICES";
131732
132240
 
@@ -131892,7 +132400,7 @@ init_timers();
131892
132400
  // packages/omo-native/package.json
131893
132401
  var package_default4 = {
131894
132402
  name: "omo-ai",
131895
- version: "5.1.78",
132403
+ version: "5.1.81",
131896
132404
  type: "module",
131897
132405
  description: "OmO Native - the standalone omo command with the OMO extension built in: bun add -g omo-ai",
131898
132406
  bin: {
@@ -131909,7 +132417,7 @@ var package_default4 = {
131909
132417
  postinstall: "node bin/senpi-patch.mjs"
131910
132418
  },
131911
132419
  dependencies: {
131912
- "@code-yeongyu/senpi": "2026.11.18-2"
132420
+ "@code-yeongyu/senpi": "2026.11.19-5"
131913
132421
  },
131914
132422
  repository: {
131915
132423
  type: "git",
@@ -132087,10 +132595,11 @@ init_device_service3();
132087
132595
  init_codes();
132088
132596
  init_factories();
132089
132597
  init_seams();
132598
+ init_address();
132090
132599
 
132091
132600
  // packages/omo-senpi/src/components/remote/device-address.ts
132092
- init_plan_create();
132093
- init_remote_ops();
132601
+ init_address();
132602
+ init_errors5();
132094
132603
  // packages/omo-senpi/src/components/thread/gateway/store.ts
132095
132604
  init_constants6();
132096
132605
  init_provenance_resolver();
@@ -132122,6 +132631,7 @@ init_relay_transport();
132122
132631
  // packages/omo-senpi/src/components/thread/gateway/engine.ts
132123
132632
  init_addressing();
132124
132633
  init_errors5();
132634
+ init_fields();
132125
132635
  init_constants6();
132126
132636
  init_result2();
132127
132637
  init_provenance_resolver();
@@ -132138,9 +132648,6 @@ init_thread_row();
132138
132648
  // packages/omo-native/bin/lib/package-paths.js
132139
132649
  import { fileURLToPath as fileURLToPath9 } from "url";
132140
132650
  var packageRoot = fileURLToPath9(new URL("../..", import.meta.url));
132141
- // packages/omo-native/remote-session-target.ts
132142
- init_errors5();
132143
- init_address_book();
132144
132651
 
132145
132652
  // packages/omo-native/remote-session-verbs.ts
132146
132653
  init_remote_ops();
@@ -132221,7 +132728,7 @@ var USAGE_ENTRIES = [
132221
132728
  },
132222
132729
  {
132223
132730
  verbs: ["close"],
132224
- text: " close <session> end the session; also takes <device>/<session>"
132731
+ text: " close <session> [--force] end the session; --force also drops messages it has not read"
132225
132732
  }
132226
132733
  ];
132227
132734
  var REMOTE_USAGE = [USAGE_HEAD, ...USAGE_ENTRIES.map((entry) => entry.text)].join(`