oh-my-opencode 5.1.77 → 5.1.79

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 (63) hide show
  1. package/dist/agents/hephaestus/model-support.d.ts +1 -0
  2. package/dist/agents/native-prompt-frame.d.ts +9 -1
  3. package/dist/agents/refusal-rule.d.ts +4 -1
  4. package/dist/cli/index.js +624 -407
  5. package/dist/cli-node/index.js +624 -407
  6. package/dist/index.js +579 -339
  7. package/dist/skills/browser/runtime/omowright/manifest.json +1 -1
  8. package/dist/tui.js +18 -14
  9. package/package.json +14 -14
  10. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  11. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  12. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  13. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  14. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  15. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  16. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  17. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  18. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  19. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
  20. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  21. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  22. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  23. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  24. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  25. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  26. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  27. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  28. package/packages/omo-codex/plugin/components/ultrawork/README.md +1 -1
  29. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
  30. package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +1 -1
  31. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  32. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  33. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  34. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  35. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  36. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  37. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  38. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  39. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  40. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  41. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  42. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  43. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  44. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  45. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  46. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  47. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  48. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  49. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  50. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  51. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  52. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  53. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  54. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  55. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  56. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  57. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  58. package/packages/omo-codex/plugin/package-lock.json +12 -12
  59. package/packages/omo-codex/plugin/package.json +1 -1
  60. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
  61. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +2 -2
  62. package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
  63. package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
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.77",
2135
+ version: "5.1.79",
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",
@@ -2330,7 +2330,7 @@ var init_package = __esm(() => {
2330
2330
  },
2331
2331
  devDependencies: {
2332
2332
  "@clack/prompts": "^1.8.1",
2333
- "@code-yeongyu/senpi": "2026.11.18",
2333
+ "@code-yeongyu/senpi": "2026.11.18-3",
2334
2334
  "@modelcontextprotocol/sdk": "^1.30.0",
2335
2335
  "@oh-my-opencode/agents-md-core": "workspace:*",
2336
2336
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
@@ -2403,18 +2403,18 @@ var init_package = __esm(() => {
2403
2403
  typescript: "^7.0.2"
2404
2404
  },
2405
2405
  optionalDependencies: {
2406
- "oh-my-opencode-darwin-arm64": "5.1.77",
2407
- "oh-my-opencode-darwin-x64": "5.1.77",
2408
- "oh-my-opencode-darwin-x64-baseline": "5.1.77",
2409
- "oh-my-opencode-linux-arm64": "5.1.77",
2410
- "oh-my-opencode-linux-arm64-musl": "5.1.77",
2411
- "oh-my-opencode-linux-x64": "5.1.77",
2412
- "oh-my-opencode-linux-x64-baseline": "5.1.77",
2413
- "oh-my-opencode-linux-x64-musl": "5.1.77",
2414
- "oh-my-opencode-linux-x64-musl-baseline": "5.1.77",
2415
- "oh-my-opencode-windows-arm64": "5.1.77",
2416
- "oh-my-opencode-windows-x64": "5.1.77",
2417
- "oh-my-opencode-windows-x64-baseline": "5.1.77"
2406
+ "oh-my-opencode-darwin-arm64": "5.1.79",
2407
+ "oh-my-opencode-darwin-x64": "5.1.79",
2408
+ "oh-my-opencode-darwin-x64-baseline": "5.1.79",
2409
+ "oh-my-opencode-linux-arm64": "5.1.79",
2410
+ "oh-my-opencode-linux-arm64-musl": "5.1.79",
2411
+ "oh-my-opencode-linux-x64": "5.1.79",
2412
+ "oh-my-opencode-linux-x64-baseline": "5.1.79",
2413
+ "oh-my-opencode-linux-x64-musl": "5.1.79",
2414
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.79",
2415
+ "oh-my-opencode-windows-arm64": "5.1.79",
2416
+ "oh-my-opencode-windows-x64": "5.1.79",
2417
+ "oh-my-opencode-windows-x64-baseline": "5.1.79"
2418
2418
  },
2419
2419
  overrides: {
2420
2420
  hono: "^4.13.8",
@@ -2537,6 +2537,9 @@ var init_deep_merge = __esm(() => {
2537
2537
  DANGEROUS_KEYS = new Set(["__proto__", "constructor", "prototype"]);
2538
2538
  });
2539
2539
 
2540
+ // packages/utils/src/escape-for-display.ts
2541
+ var init_escape_for_display = () => {};
2542
+
2540
2543
  // packages/utils/src/config-merge.ts
2541
2544
  function mergeUniqueStrings(base, override) {
2542
2545
  return [...new Set([...base ?? [], ...override ?? []])];
@@ -9301,6 +9304,7 @@ var init_zip_entry_listing = () => {};
9301
9304
  // packages/utils/src/index.ts
9302
9305
  var init_src = __esm(() => {
9303
9306
  init_deep_merge();
9307
+ init_escape_for_display();
9304
9308
  init_config_section_parser();
9305
9309
  init_env_expansion();
9306
9310
  init_snake_case();
@@ -92925,7 +92929,7 @@ var package_default2;
92925
92929
  var init_package2 = __esm(() => {
92926
92930
  package_default2 = {
92927
92931
  name: "@oh-my-opencode/omo-codex",
92928
- version: "5.1.77",
92932
+ version: "5.1.79",
92929
92933
  type: "module",
92930
92934
  private: true,
92931
92935
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -94157,142 +94161,6 @@ var init_auto_update_checker = __esm(() => {
94157
94161
  init_cache();
94158
94162
  });
94159
94163
 
94160
- // packages/memory-core/src/fs/retry.ts
94161
- function fsErrorCode(error) {
94162
- if (!(error instanceof Error) || !("code" in error))
94163
- return;
94164
- return typeof error.code === "string" ? error.code : undefined;
94165
- }
94166
- async function retryOnEintr(operation) {
94167
- for (let attempt = 0;; attempt += 1) {
94168
- try {
94169
- return await operation();
94170
- } catch (error) {
94171
- if (fsErrorCode(error) !== "EINTR" || attempt >= EINTR_RETRY_CAP)
94172
- throw error;
94173
- }
94174
- }
94175
- }
94176
- function retryOnEintrSync(operation) {
94177
- for (let attempt = 0;; attempt += 1) {
94178
- try {
94179
- return operation();
94180
- } catch (error) {
94181
- if (fsErrorCode(error) !== "EINTR" || attempt >= EINTR_RETRY_CAP)
94182
- throw error;
94183
- }
94184
- }
94185
- }
94186
- var EINTR_RETRY_CAP = 128;
94187
-
94188
- // packages/memory-core/src/fs/rename-contention.ts
94189
- async function renameWithContentionRetry(from, to, deps) {
94190
- const delays = deps.platform === "win32" ? deps.delaysMs ?? CONTENTION_DELAYS_MS : [];
94191
- const sleep = deps.sleep ?? sleepFor;
94192
- for (let attempt = 0;; attempt += 1) {
94193
- try {
94194
- await retryOnEintr(() => deps.admit === undefined ? deps.rename(from, to) : deps.admit(() => deps.rename(from, to)));
94195
- return;
94196
- } catch (error) {
94197
- const delay = delays[attempt];
94198
- const code = fsErrorCode(error);
94199
- if (delay === undefined || code === undefined || !CONTENTION_CODES.has(code))
94200
- throw error;
94201
- await sleep(delay);
94202
- }
94203
- }
94204
- }
94205
- var CONTENTION_CODES, CONTENTION_DELAYS_MS, sleepFor = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
94206
- var init_rename_contention = __esm(() => {
94207
- CONTENTION_CODES = new Set(["EPERM", "EBUSY", "EACCES"]);
94208
- CONTENTION_DELAYS_MS = [10, 25, 50, 100, 200, 400];
94209
- });
94210
-
94211
- // packages/memory-core/src/fs/write-all.ts
94212
- var init_write_all = () => {};
94213
-
94214
- // packages/memory-core/src/fs/resilient.ts
94215
- import * as fsSync from "fs";
94216
- import * as fsp from "fs/promises";
94217
- function isFunction2(value) {
94218
- return typeof value === "function";
94219
- }
94220
- function withAsyncRetry(operation) {
94221
- return (...args) => retryOnEintr(async () => operation(...args));
94222
- }
94223
- function withSyncRetry(operation) {
94224
- return (...args) => retryOnEintrSync(() => operation(...args));
94225
- }
94226
- function resilientNamespace(namespace, kind) {
94227
- const wrapFunction = kind === "async" ? withAsyncRetry : withSyncRetry;
94228
- const cache = new Map;
94229
- return new Proxy(namespace, {
94230
- get(target, property) {
94231
- if (cache.has(property))
94232
- return cache.get(property);
94233
- const value = Reflect.get(target, property);
94234
- if (!isFunction2(value))
94235
- return value;
94236
- const wrapped = wrapFunction(value);
94237
- const native = Reflect.get(value, "native");
94238
- if (isFunction2(native))
94239
- Object.assign(wrapped, { native: wrapFunction(native) });
94240
- cache.set(property, wrapped);
94241
- return wrapped;
94242
- }
94243
- });
94244
- }
94245
- function rename8(from, to, admit) {
94246
- return renameWithContentionRetry(from, to, {
94247
- rename: (source, target) => fsp.rename(source, target),
94248
- platform: process.platform,
94249
- ...admit === undefined ? {} : { admit }
94250
- });
94251
- }
94252
- var IDEMPOTENT_HANDLE_METHODS, promises, sync, access4, chmod2, copyFile4, cp5, link, lstat18, mkdir10, mkdtemp2, readFile34, readdir17, readlink7, realpath2, rm16, rmdir2, stat8, statfs, unlink3, accessSync5, chmodSync7, fsyncSync3, linkSync, lstatSync5, mkdirSync19, readFileSync44, readdirSync14, realpathSync13, statSync8, unlinkSync10, writeFileSync17, writeSync;
94253
- var init_resilient = __esm(() => {
94254
- init_rename_contention();
94255
- init_write_all();
94256
- init_write_all();
94257
- IDEMPOTENT_HANDLE_METHODS = new Set(["stat", "sync", "datasync", "chmod", "chown", "utimes", "truncate"]);
94258
- promises = resilientNamespace(fsp, "async");
94259
- sync = resilientNamespace(fsSync, "sync");
94260
- ({
94261
- access: access4,
94262
- chmod: chmod2,
94263
- copyFile: copyFile4,
94264
- cp: cp5,
94265
- link,
94266
- lstat: lstat18,
94267
- mkdir: mkdir10,
94268
- mkdtemp: mkdtemp2,
94269
- readFile: readFile34,
94270
- readdir: readdir17,
94271
- readlink: readlink7,
94272
- realpath: realpath2,
94273
- rm: rm16,
94274
- rmdir: rmdir2,
94275
- stat: stat8,
94276
- statfs,
94277
- unlink: unlink3
94278
- } = promises);
94279
- ({
94280
- accessSync: accessSync5,
94281
- chmodSync: chmodSync7,
94282
- fsyncSync: fsyncSync3,
94283
- linkSync,
94284
- lstatSync: lstatSync5,
94285
- mkdirSync: mkdirSync19,
94286
- readFileSync: readFileSync44,
94287
- readdirSync: readdirSync14,
94288
- realpathSync: realpathSync13,
94289
- statSync: statSync8,
94290
- unlinkSync: unlinkSync10,
94291
- writeFileSync: writeFileSync17,
94292
- writeSync
94293
- } = sync);
94294
- });
94295
-
94296
94164
  // packages/device-service-core/src/local-api/errors.ts
94297
94165
  var LocalApiError, protocolViolation = (detail) => {
94298
94166
  throw new LocalApiError("protocol_violation", detail);
@@ -97553,14 +97421,21 @@ var init_background_transport = __esm(() => {
97553
97421
  });
97554
97422
 
97555
97423
  // packages/device-service-core/src/not-sent-error.ts
97556
- var NotSentError, markNotSent = (error) => error instanceof LocalApiError ? new NotSentError(error.code, error.reason, {
97557
- action: error.action,
97558
- ...error.limit_chars === undefined ? {} : { limit_chars: error.limit_chars },
97559
- ...error.path_refusal === undefined ? {} : { path_refusal: error.path_refusal },
97560
- ...error.candidates === undefined ? {} : { candidates: error.candidates },
97561
- ...error.incomplete === undefined ? {} : { incomplete: error.incomplete },
97562
- ...error.sign_in_reason === undefined ? {} : { sign_in_reason: error.sign_in_reason }
97563
- }) : error, olderThanWakeMinimum = (serviceVersion, minimum) => minimum === null ? new NotSentError("unsupported", "this omo build does not send the wake target") : new NotSentError("unsupported", `device service ${serviceVersion} is older than ${minimum}; update it`, {
97424
+ function markNotSent(error) {
97425
+ if (error instanceof NotSentError)
97426
+ return error;
97427
+ if (!(error instanceof LocalApiError))
97428
+ return error;
97429
+ return new NotSentError(error.code, error.reason, {
97430
+ action: error.action,
97431
+ ...error.limit_chars === undefined ? {} : { limit_chars: error.limit_chars },
97432
+ ...error.path_refusal === undefined ? {} : { path_refusal: error.path_refusal },
97433
+ ...error.candidates === undefined ? {} : { candidates: error.candidates },
97434
+ ...error.incomplete === undefined ? {} : { incomplete: error.incomplete },
97435
+ ...error.sign_in_reason === undefined ? {} : { sign_in_reason: error.sign_in_reason }
97436
+ });
97437
+ }
97438
+ var NotSentError, olderThanWakeMinimum = (serviceVersion, minimum) => minimum === null ? new NotSentError("unsupported", "this omo build does not send the wake target") : new NotSentError("unsupported", `device service ${serviceVersion} is older than ${minimum}; update it`, {
97564
97439
  action: `Run omo remote bootstrap to install device service ${minimum} or later.`
97565
97440
  });
97566
97441
  var init_not_sent_error = __esm(() => {
@@ -97701,6 +97576,26 @@ var init_timers = __esm(() => {
97701
97576
  };
97702
97577
  });
97703
97578
 
97579
+ // packages/device-service-core/src/unsettled-command.ts
97580
+ var DELIVERED, UnsettledCommandError;
97581
+ var init_unsettled_command = __esm(() => {
97582
+ init_errors4();
97583
+ DELIVERED = new Set(["transport_confirmed", "engine_dispatched"]);
97584
+ UnsettledCommandError = class UnsettledCommandError extends LocalApiError {
97585
+ progress;
97586
+ delivered;
97587
+ constructor(commandId, waitMs, progress) {
97588
+ const last = progress === undefined ? "" : ` (last state ${progress})`;
97589
+ super("request_timeout", `no final state for command ${commandId} within ${waitMs} ms${last}`, {
97590
+ command_id: commandId
97591
+ });
97592
+ this.name = "UnsettledCommandError";
97593
+ this.progress = progress;
97594
+ this.delivered = progress !== undefined && DELIVERED.has(progress);
97595
+ }
97596
+ };
97597
+ });
97598
+
97704
97599
  // packages/device-service-core/src/remote-attach.ts
97705
97600
  import { randomBytes as randomBytes8 } from "crypto";
97706
97601
  function openAttach(client, device, sessionId, timers = realTimers) {
@@ -97812,6 +97707,7 @@ function openAttach(client, device, sessionId, timers = realTimers) {
97812
97707
  return reject(new Error("the attach has ended"));
97813
97708
  const { waitMs = ATTACH_COMMAND_WAIT_MS, accepts } = options;
97814
97709
  const commandId = randomBytes8(16).toString("base64url");
97710
+ let progress;
97815
97711
  const settle = () => {
97816
97712
  stopState();
97817
97713
  cancelWait();
@@ -97826,8 +97722,10 @@ function openAttach(client, device, sessionId, timers = realTimers) {
97826
97722
  const stopState = client.onEvent((event) => {
97827
97723
  if (event.kind !== "session.command_state" || event.command_id !== commandId)
97828
97724
  return;
97829
- if (PROGRESS_STATES.has(event.state))
97725
+ if (PROGRESS_STATES.has(event.state)) {
97726
+ progress = event.state;
97830
97727
  return;
97728
+ }
97831
97729
  const response = delegated.takeReply(commandId);
97832
97730
  settle();
97833
97731
  resolve(response === undefined ? { outcome: event } : { outcome: event, response });
@@ -97835,9 +97733,7 @@ function openAttach(client, device, sessionId, timers = realTimers) {
97835
97733
  const cancelWait = timers.after(waitMs, () => {
97836
97734
  settle();
97837
97735
  delegated.forget(commandId);
97838
- reject(new LocalApiError("request_timeout", `no final state for command ${commandId} within ${waitMs} ms`, {
97839
- command_id: commandId
97840
- }));
97736
+ reject(new UnsettledCommandError(commandId, waitMs, progress));
97841
97737
  });
97842
97738
  commands.add(end);
97843
97739
  client.commandTo({ attach }, rpc, commandId, { delegated: true }, accepts === undefined ? undefined : { accepts }).catch((error) => {
@@ -97897,6 +97793,7 @@ var init_remote_attach = __esm(() => {
97897
97793
  init_delegated_channel();
97898
97794
  init_errors4();
97899
97795
  init_timers();
97796
+ init_unsettled_command();
97900
97797
  PROGRESS_STATES = new Set([
97901
97798
  "queued",
97902
97799
  "transport_confirmed",
@@ -97904,9 +97801,45 @@ var init_remote_attach = __esm(() => {
97904
97801
  ]);
97905
97802
  });
97906
97803
 
97804
+ // packages/device-service-core/src/refused-before-sending.ts
97805
+ var REFUSED_BEFORE_SENDING;
97806
+ var init_refused_before_sending = __esm(() => {
97807
+ REFUSED_BEFORE_SENDING = new Set([
97808
+ "unauthenticated",
97809
+ "client_proof_invalid",
97810
+ "invalid_request",
97811
+ "unknown_type",
97812
+ "forbidden",
97813
+ "owner_transfer",
97814
+ "signed_out",
97815
+ "device_mismatch",
97816
+ "device_changed",
97817
+ "account_changed",
97818
+ "device_key_invalid",
97819
+ "service_disabled",
97820
+ "sign_in_required",
97821
+ "plan_required",
97822
+ "activation_pending",
97823
+ "authorization_stale",
97824
+ "peer_not_found",
97825
+ "peer_not_session_client",
97826
+ "session_not_found",
97827
+ "engine_too_old",
97828
+ "not_attached",
97829
+ "command_id_conflict",
97830
+ "message_too_long",
97831
+ "upload_incomplete",
97832
+ "malformed",
97833
+ "method_unclassified",
97834
+ "method_local_only",
97835
+ "host_not_answering",
97836
+ "unsupported"
97837
+ ]);
97838
+ });
97839
+
97907
97840
  // packages/device-service-core/src/listing-rows.ts
97908
97841
  function newestRowsListing(client) {
97909
- let rows = 3;
97842
+ let rows = 4;
97910
97843
  return async function list(filter, onRevision) {
97911
97844
  for (;; ) {
97912
97845
  try {
@@ -97914,7 +97847,7 @@ function newestRowsListing(client) {
97914
97847
  } catch (error) {
97915
97848
  if (rows === undefined || !(error instanceof LocalApiError) || error.code !== "invalid_request")
97916
97849
  throw error;
97917
- rows = rows === 3 ? 2 : undefined;
97850
+ rows = rows === 4 ? 3 : rows === 3 ? 2 : undefined;
97918
97851
  }
97919
97852
  }
97920
97853
  };
@@ -97996,6 +97929,32 @@ function deviceServiceStateDir(platform = process.platform, env = process.env, h
97996
97929
  }
97997
97930
  var DEVICE_SERVICE_STATE_DIR_ENV = "OMO_DEVICE_SERVICE_STATE_DIR", LOCATION_FILE = "device-service.location.json", isAbsoluteOn = (platform, path) => (platform === "win32" ? win3212 : posix17).isAbsolute(path);
97998
97931
  var init_state_dir = () => {};
97932
+
97933
+ // packages/device-service-core/src/engine-endpoint.ts
97934
+ async function engineEndpointOf(client, device) {
97935
+ const asksPrimary = compareVersions4(client.welcome.service_version, ENDPOINT_PRIMARY_MIN_SERVICE_VERSION) >= 0;
97936
+ const listed = await client.request("session.endpoints", asksPrimary ? { device, primary: true } : { device });
97937
+ if (listed.primary !== undefined)
97938
+ return listed.primary;
97939
+ const [only, ...rest] = listed.endpoints;
97940
+ if (only === undefined)
97941
+ throw new NotSentError("unsupported", "the device lists no engine endpoint");
97942
+ if (!asksPrimary && rest.length === 0)
97943
+ return only;
97944
+ throw new NoPrimaryEndpointError(device, listed.endpoints.length);
97945
+ }
97946
+ var ENDPOINT_PRIMARY_MIN_SERVICE_VERSION = "0.1.11", NoPrimaryEndpointError;
97947
+ var init_engine_endpoint = __esm(() => {
97948
+ init_not_sent_error();
97949
+ init_version2();
97950
+ NoPrimaryEndpointError = class NoPrimaryEndpointError extends NotSentError {
97951
+ constructor(device, listed) {
97952
+ super("unsupported", `${device} lists ${listed} engine endpoint(s) and names none as its own engine; nothing was opened`, {
97953
+ action: `Start or restart omo on ${device}; if that does not help, update the device service on both devices.`
97954
+ });
97955
+ }
97956
+ };
97957
+ });
97999
97958
  // packages/device-service-core/src/local-api/protocol.ts
98000
97959
  var init_protocol = __esm(() => {
98001
97960
  init_vocabulary();
@@ -98005,13 +97964,13 @@ var init_protocol = __esm(() => {
98005
97964
  // packages/device-service-core/src/device-service.ts
98006
97965
  import { join as join124 } from "path";
98007
97966
  import { randomBytes as randomBytes9 } from "crypto";
98008
- function sendToEndpoint(client, device, endpoint, rpc, locate, timers) {
97967
+ function sendToEndpoint(client, device, endpoint, rpc, locate, timers, waitMs) {
98009
97968
  return followDelegatedCommand(client, device, timers, (commandId) => {
98010
97969
  const send = (asked) => client.commandTo({ device, endpoint }, rpc, commandId, asked ? { locate: true } : {});
98011
97970
  return send(locate).catch((error) => locate && error instanceof LocalApiError && error.code === "invalid_request" ? send(false) : Promise.reject(error));
98012
- });
97971
+ }, waitMs);
98013
97972
  }
98014
- function followDelegatedCommand(client, device, timers, send) {
97973
+ function followDelegatedCommand(client, device, timers, send, waitMs = ENDPOINT_COMMAND_WAIT_MS) {
98015
97974
  return new Promise((resolve, reject) => {
98016
97975
  const commandId = randomBytes9(16).toString("base64url");
98017
97976
  const channel = followDelegatedChannel(device);
@@ -98043,7 +98002,7 @@ function followDelegatedCommand(client, device, timers, send) {
98043
98002
  ...located === undefined ? {} : { located }
98044
98003
  });
98045
98004
  });
98046
- const cancelTimer = timers.after(ENDPOINT_COMMAND_WAIT_MS, () => fail(new Error(`no final state for endpoint command ${commandId} within ${ENDPOINT_COMMAND_WAIT_MS} ms`)));
98005
+ const cancelTimer = timers.after(waitMs, () => fail(new Error(`no final state for endpoint command ${commandId} within ${waitMs} ms`)));
98047
98006
  client.closed.then(() => fail(new Error("the connection closed before the endpoint command settled")));
98048
98007
  send(commandId).catch(fail);
98049
98008
  });
@@ -98116,16 +98075,38 @@ async function connectDeviceService(options) {
98116
98075
  };
98117
98076
  },
98118
98077
  endpointCommand: async (device, rpc, options) => {
98119
- let endpoint;
98120
- try {
98121
- endpoint = (await client.request("session.endpoints", { device })).endpoints[0];
98122
- } catch (error) {
98123
- throw markNotSent(error);
98078
+ const started = timers.now();
98079
+ let endpoint = options?.endpoint;
98080
+ if (endpoint === undefined) {
98081
+ const lookup = engineEndpointOf(client, device);
98082
+ const waitMs = options?.waitMs;
98083
+ const bounded = waitMs === undefined ? lookup : new Promise((resolve, reject) => {
98084
+ const cancel = timers.after(waitMs, () => reject(new NotSentError("request_timeout", "the wait ran out during the endpoint lookup; nothing was sent")));
98085
+ lookup.then((answer) => {
98086
+ cancel();
98087
+ resolve(answer);
98088
+ }, (error) => {
98089
+ cancel();
98090
+ reject(error);
98091
+ });
98092
+ });
98093
+ try {
98094
+ endpoint = await bounded;
98095
+ } catch (error) {
98096
+ throw markNotSent(error);
98097
+ }
98124
98098
  }
98125
- if (endpoint === undefined)
98126
- throw new NotSentError("unsupported", "the device lists no engine endpoint");
98127
- return await sendToEndpoint(client, device, endpoint, rpc, options?.locate === true, timers);
98099
+ const waitMs = options?.waitMs === undefined ? undefined : options.waitMs - (timers.now() - started);
98100
+ if (waitMs !== undefined && waitMs <= 0)
98101
+ throw new NotSentError("request_timeout", "the wait ran out during the endpoint lookup; nothing was sent");
98102
+ return {
98103
+ ...await sendToEndpoint(client, device, endpoint, rpc, options?.locate === true, timers, waitMs),
98104
+ endpoint
98105
+ };
98128
98106
  },
98107
+ sessionCommand: (device, key, rpc, options) => followDelegatedCommand(client, device, timers, (commandId) => client.commandTo({ session: `${device}.${key}` }, rpc, commandId).catch((error) => {
98108
+ throw error instanceof LocalApiError && error.command_id === undefined ? markNotSent(error) : error;
98109
+ }), options?.waitMs),
98129
98110
  close: () => client.close(),
98130
98111
  closed: client.closed,
98131
98112
  locate: (device, engineId, options) => client.request("session.locate", {
@@ -98133,16 +98114,16 @@ async function connectDeviceService(options) {
98133
98114
  engine_id: engineId,
98134
98115
  ...options?.single === true && takesSingleLocate ? { single: true } : {}
98135
98116
  }),
98136
- wakeCommand: async (device, durableId, rpc) => {
98117
+ wakeCommand: async (device, durableId, rpc, options) => {
98137
98118
  if (!carriesWakeMark)
98138
98119
  throw olderThanWakeMinimum(client.welcome.service_version, wakeMarkMinimum);
98139
98120
  return await followDelegatedCommand(client, device, timers, (commandId) => client.commandTo({ wake: { device, durable_id: durableId } }, rpc, commandId).catch((error) => {
98140
- throw error instanceof LocalApiError && error.command_id === undefined ? markNotSent(error) : error;
98141
- }));
98121
+ throw error instanceof LocalApiError && error.command_id === undefined && REFUSED_BEFORE_SENDING.has(error.code) ? markNotSent(error) : error;
98122
+ }), options?.waitMs);
98142
98123
  }
98143
98124
  };
98144
98125
  }
98145
- var ENDPOINT_COMMAND_WAIT_MS = 120000, ADOPT_ACCOUNT_MIN_SERVICE_VERSION = "0.1.3", acceptsAdoptAccount = (serviceVersion) => compareVersions4(serviceVersion, ADOPT_ACCOUNT_MIN_SERVICE_VERSION) >= 0, WAKE_MARK_MIN_SERVICE_VERSION = "0.1.31", LOCATE_SINGLE_MIN_SERVICE_VERSION = "0.1.13", serviceAtLeast = (serviceVersion, minimum) => minimum !== null && compareVersions4(serviceVersion, minimum) >= 0;
98126
+ var ENDPOINT_COMMAND_WAIT_MS = 120000, UPDATE_IN_FLIGHT_MAX_MS, UPDATE_IN_FLIGHT, ADOPT_ACCOUNT_MIN_SERVICE_VERSION = "0.1.3", acceptsAdoptAccount = (serviceVersion) => compareVersions4(serviceVersion, ADOPT_ACCOUNT_MIN_SERVICE_VERSION) >= 0, WAKE_MARK_MIN_SERVICE_VERSION = "0.1.31", LOCATE_SINGLE_MIN_SERVICE_VERSION = "0.1.13", serviceAtLeast = (serviceVersion, minimum) => minimum !== null && compareVersions4(serviceVersion, minimum) >= 0;
98146
98127
  var init_device_service2 = __esm(() => {
98147
98128
  init_access();
98148
98129
  init_client4();
@@ -98152,15 +98133,22 @@ var init_device_service2 = __esm(() => {
98152
98133
  init_remote_attach();
98153
98134
  init_delegated_channel();
98154
98135
  init_errors4();
98136
+ init_refused_before_sending();
98155
98137
  init_listing_rows();
98156
98138
  init_version2();
98157
98139
  init_state_dir();
98140
+ init_engine_endpoint();
98158
98141
  init_timers();
98159
98142
  init_errors4();
98143
+ init_refused_before_sending();
98160
98144
  init_not_sent_error();
98145
+ init_engine_endpoint();
98161
98146
  init_protocol();
98147
+ init_unsettled_command();
98162
98148
  init_state_dir();
98163
98149
  init_timers();
98150
+ UPDATE_IN_FLIGHT_MAX_MS = 15 * 60000;
98151
+ UPDATE_IN_FLIGHT = new Set(["pending", "trial"]);
98164
98152
  });
98165
98153
 
98166
98154
  // node_modules/.bun/typebox@1.3.34/node_modules/typebox/build/system/memory/metrics.mjs
@@ -103696,6 +103684,15 @@ var init_permission_presets = __esm(() => {
103696
103684
  PERMISSION_PRESETS = ["full-access", "workspace", "accept-edits", "auto", "read-only", "ask"];
103697
103685
  });
103698
103686
  // packages/omo-senpi/src/components/thread/errors.ts
103687
+ function isThreadErrorCode(value) {
103688
+ return typeof value === "string" && CODE_SET.has(value);
103689
+ }
103690
+ function threadToolFailure(code, message, nextAction, details) {
103691
+ if (!isThreadErrorCode(code)) {
103692
+ throw new Error(`unknown thread error code: ${String(code)}`);
103693
+ }
103694
+ return { code, message, next_action: nextAction, ...details === undefined ? {} : { details } };
103695
+ }
103699
103696
  var THREAD_ERROR_CODES, CODE_SET;
103700
103697
  var init_errors5 = __esm(() => {
103701
103698
  THREAD_ERROR_CODES = [
@@ -103711,6 +103708,7 @@ var init_errors5 = __esm(() => {
103711
103708
  "foreign_live_owner",
103712
103709
  "no_active_turn",
103713
103710
  "turn_conflict",
103711
+ "turn_active",
103714
103712
  "not_steerable",
103715
103713
  "message_too_large",
103716
103714
  "queue_full",
@@ -103719,6 +103717,7 @@ var init_errors5 = __esm(() => {
103719
103717
  "idempotency_conflict",
103720
103718
  "idempotency_in_progress",
103721
103719
  "idempotency_uncertain",
103720
+ "delivered_unconfirmed",
103722
103721
  "approval_unavailable",
103723
103722
  "approval_route_locked",
103724
103723
  "partial_commit",
@@ -103731,6 +103730,7 @@ var init_errors5 = __esm(() => {
103731
103730
  "model_ambiguous",
103732
103731
  "thinking_level_unsupported",
103733
103732
  "loop_detected",
103733
+ "chain_count_limit",
103734
103734
  "binding_conflict",
103735
103735
  "binding_mismatch",
103736
103736
  "binding_inactive",
@@ -103740,7 +103740,8 @@ var init_errors5 = __esm(() => {
103740
103740
  "answer_in_progress",
103741
103741
  "device_offline",
103742
103742
  "relay_requires_paid_plan",
103743
- "alias_taken"
103743
+ "alias_taken",
103744
+ "gateway_schema_too_new"
103744
103745
  ];
103745
103746
  CODE_SET = new Set(THREAD_ERROR_CODES);
103746
103747
  });
@@ -103749,7 +103750,7 @@ var init_errors5 = __esm(() => {
103749
103750
  var init_initial_skills = () => {};
103750
103751
 
103751
103752
  // packages/omo-senpi/src/components/thread/remote/outcome.ts
103752
- var READ_UNCERTAIN, UNANSWERED;
103753
+ var READ_UNCERTAIN, UNANSWERED, NOT_SIGNED_IN;
103753
103754
  var init_outcome = __esm(() => {
103754
103755
  init_errors5();
103755
103756
  READ_UNCERTAIN = {
@@ -103775,11 +103776,13 @@ var init_outcome = __esm(() => {
103775
103776
  "handshake_timeout",
103776
103777
  "attach_failed",
103777
103778
  "reply_lost",
103779
+ "delivered_unconfirmed",
103778
103780
  "host_not_answering",
103779
103781
  "peer_not_found",
103780
103782
  "engine_stale",
103781
103783
  ...Object.entries(READ_UNCERTAIN).filter(([, answer]) => answer === "retry").map(([reason]) => reason)
103782
103784
  ]);
103785
+ NOT_SIGNED_IN = new Set(["sign_in_required", "signed_out"]);
103783
103786
  });
103784
103787
  // packages/omo-senpi/src/components/thread/remote/remote-ops.ts
103785
103788
  var init_remote_ops = __esm(() => {
@@ -103800,6 +103803,7 @@ var init_close_ladder = __esm(() => {
103800
103803
  init_port();
103801
103804
  SESSION_GONE = new Set([
103802
103805
  "unknown_session",
103806
+ "route_unlisted",
103803
103807
  "session_identity_mismatch",
103804
103808
  "session_not_attached",
103805
103809
  "not_attached"
@@ -103834,162 +103838,6 @@ var init_thread_link = __esm(() => {
103834
103838
  PREFIX = `${THREAD_LINK_SCHEME}://v1/`;
103835
103839
  });
103836
103840
 
103837
- // packages/omo-senpi/src/components/thread/remote/address-book.ts
103838
- var REMOTE_NOT_SET_UP;
103839
- var init_address_book = __esm(() => {
103840
- init_remote_ops();
103841
- REMOTE_NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
103842
- });
103843
-
103844
- // packages/omo-senpi/src/components/thread/addressing.ts
103845
- var init_addressing = __esm(() => {
103846
- init_errors5();
103847
- });
103848
-
103849
- // packages/omo-senpi/src/components/thread/session-facts.ts
103850
- var SESSION_FACTS_WINDOW_BYTES, SESSION_FACTS_LAST_LINE_MAX_BYTES;
103851
- var init_session_facts = __esm(() => {
103852
- SESSION_FACTS_WINDOW_BYTES = 64 * 1024;
103853
- SESSION_FACTS_LAST_LINE_MAX_BYTES = SESSION_FACTS_WINDOW_BYTES * 4;
103854
- });
103855
-
103856
- // packages/omo-senpi/src/components/thread/address-book.ts
103857
- var init_address_book2 = __esm(() => {
103858
- init_addressing();
103859
- init_session_facts();
103860
- });
103861
-
103862
- // packages/omo-senpi/src/components/thread/metadata.ts
103863
- var THREAD_TOOL_EXPOSURE = "eval", ROUTE_TO_TASK = "; to spawn a child task instead, use task.", THREAD_TOOL_METADATA;
103864
- var init_metadata = __esm(() => {
103865
- THREAD_TOOL_METADATA = [
103866
- {
103867
- name: "thread_create",
103868
- label: "Create session",
103869
- description: "Starts a fresh agent session that runs alongside this one, for when the user wants a second session working in parallel" + ROUTE_TO_TASK,
103870
- exposure: THREAD_TOOL_EXPOSURE
103871
- },
103872
- {
103873
- name: "thread_list",
103874
- label: "List sessions",
103875
- description: "Shows every addressable session on this device and the account's other devices with its id, name, status and device, plus the account's devices, for when the user needs a valid target address before acting on a session" + ROUTE_TO_TASK,
103876
- exposure: THREAD_TOOL_EXPOSURE
103877
- },
103878
- {
103879
- name: "thread_read",
103880
- label: "Read session",
103881
- description: "Returns the transcript and latest output of another session, for when the user asks what another session said or produced" + ROUTE_TO_TASK,
103882
- exposure: THREAD_TOOL_EXPOSURE
103883
- },
103884
- {
103885
- name: "thread_send",
103886
- label: "Send message to session",
103887
- description: "Delivers a message into another session that is already running, for when the user wants to talk to that session mid-task; its reply comes back through thread_read, and a bound chat thread's replies through thread_report and thread_answer (in an eval cell: tool.thread_read(), tool.thread_report(), tool.thread_answer())" + ROUTE_TO_TASK,
103888
- exposure: THREAD_TOOL_EXPOSURE
103889
- },
103890
- {
103891
- name: "thread_interrupt",
103892
- label: "Interrupt session turn",
103893
- description: "Stops the turn running in another session, and the background jobs that turn started, for when the user wants to halt a session that is going down the wrong path; the result's background lists what was stopped" + ROUTE_TO_TASK,
103894
- exposure: THREAD_TOOL_EXPOSURE
103895
- },
103896
- {
103897
- name: "thread_close",
103898
- label: "Close session",
103899
- 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,
103900
- exposure: THREAD_TOOL_EXPOSURE
103901
- },
103902
- {
103903
- name: "thread_handoff",
103904
- label: "Hand off session",
103905
- description: "Moves the current request to an old session that has the context, for when the user says to hand this off or reopen that earlier conversation" + ROUTE_TO_TASK,
103906
- exposure: THREAD_TOOL_EXPOSURE
103907
- },
103908
- {
103909
- name: "thread_rename",
103910
- label: "Rename session",
103911
- description: "Renames a session's label, for when the user asks to call a session something clearer. Omit thread or pass self to rename 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; a miss names the thread value to pass",
103912
- exposure: THREAD_TOOL_EXPOSURE
103913
- },
103914
- {
103915
- name: "thread_set_model",
103916
- label: "Switch session model",
103917
- description: "Moves a session onto a different model, for when the user asks to switch that session to another model or a cheaper one",
103918
- exposure: THREAD_TOOL_EXPOSURE
103919
- },
103920
- {
103921
- name: "thread_set_reasoning",
103922
- label: "Set session reasoning level",
103923
- description: "Sets how much reasoning a session applies, for when the user asks to raise or lower the thinking effort of a session",
103924
- exposure: THREAD_TOOL_EXPOSURE
103925
- },
103926
- {
103927
- name: "thread_report",
103928
- label: "Report to chat thread",
103929
- description: "Posts a milestone, result, question or completion from this session to its bound chat thread, for when the user wants progress relayed to that chat; replies flow back through thread_read, thread_report and thread_answer (in an eval cell: tool.thread_read(), tool.thread_report(), tool.thread_answer())",
103930
- exposure: THREAD_TOOL_EXPOSURE
103931
- },
103932
- {
103933
- name: "thread_outbox",
103934
- label: "Read chat outbox",
103935
- description: "Returns the reports waiting for a bound chat thread with a cursor, for when a connector collects what sessions posted",
103936
- exposure: THREAD_TOOL_EXPOSURE
103937
- },
103938
- {
103939
- name: "thread_outbox_ack",
103940
- label: "Acknowledge chat outbox",
103941
- description: "Marks outbox rows up to a cursor as posted to the chat, for when a connector confirms delivery",
103942
- exposure: THREAD_TOOL_EXPOSURE
103943
- },
103944
- {
103945
- name: "thread_answer",
103946
- label: "Answer relayed question",
103947
- description: "Resolves a question a session relayed to a chat thread with the answer that arrived there, for when a connector hands back a chat user's reply",
103948
- exposure: THREAD_TOOL_EXPOSURE
103949
- }
103950
- ];
103951
- });
103952
- // packages/omo-senpi/src/components/thread/tools/internals.ts
103953
- var init_internals = __esm(() => {
103954
- init_address_book();
103955
- init_remote_ops();
103956
- init_address_book2();
103957
- init_addressing();
103958
- init_errors5();
103959
- init_metadata();
103960
- init_session_facts();
103961
- init_thread_link();
103962
- });
103963
-
103964
- // packages/omo-senpi/src/components/thread/control/session-host.ts
103965
- var init_session_host = __esm(() => {
103966
- init_internals();
103967
- });
103968
-
103969
- // packages/omo-senpi/src/components/thread/control/relay-session-host.ts
103970
- var init_relay_session_host = __esm(() => {
103971
- init_errors5();
103972
- init_initial_skills();
103973
- init_outcome();
103974
- init_remote_ops();
103975
- init_remote_worktree();
103976
- init_open_reply();
103977
- init_thread_link();
103978
- init_session_host();
103979
- });
103980
-
103981
- // packages/omo-senpi/src/components/thread/tools/model-match.ts
103982
- var init_model_match = __esm(() => {
103983
- init_internals();
103984
- });
103985
-
103986
- // packages/omo-senpi/src/components/thread/control/operations.ts
103987
- var init_operations = __esm(() => {
103988
- init_internals();
103989
- init_model_match();
103990
- init_port();
103991
- });
103992
-
103993
103841
  // packages/omo-senpi/src/components/thread/contracts/create-params.ts
103994
103842
  var ThreadCreateParams;
103995
103843
  var init_create_params = __esm(() => {
@@ -104058,7 +103906,7 @@ var init_create_params = __esm(() => {
104058
103906
  });
104059
103907
 
104060
103908
  // packages/omo-senpi/src/components/thread/contracts/params.ts
104061
- var ThreadListParams, THREAD_READ_WAIT_MAX_MS = 600000, ThreadReadParams, ThreadSendParams, ThreadInterruptParams, SelfOrThread, ThreadCloseParams, ThreadHandoffParams, ThreadRenameParams, ThreadSetModelParams, ThreadSetReasoningParams, ThreadReportParams, ThreadOutboxParams, ThreadOutboxAckParams, ThreadAnswerParams;
103909
+ var ThreadListParams, THREAD_READ_WAIT_MAX_MS = 600000, ThreadReadParams, ThreadSendParams, ThreadInterruptParams, SelfOrThread, ThreadCloseParams, ThreadHandoffParams, ThreadRenameParams, ThreadSetModelParams, ThreadSetReasoningParams, ThreadArchiveParams, ThreadReportParams, ThreadOutboxParams, ThreadOutboxAckParams, ThreadAnswerParams;
104062
103910
  var init_params = __esm(() => {
104063
103911
  init_build();
104064
103912
  init_fields();
@@ -104066,12 +103914,16 @@ var init_params = __esm(() => {
104066
103914
  ThreadListParams = _Object_({
104067
103915
  all_scope: Optional(Boolean2({
104068
103916
  description: "List this machine's threads from every workspace; the default returns only the caller's workspace here. The account's other devices' threads are always listed."
103917
+ })),
103918
+ state: Optional(_Array_(Union([Literal("running"), Literal("idle"), Literal("inactive"), Literal("archived")]), {
103919
+ minItems: 1,
103920
+ description: "Thread states to list: running, idle, inactive (no engine holds it) or archived; the default lists every state but archived."
104069
103921
  }))
104070
103922
  });
104071
103923
  ThreadReadParams = _Object_({
104072
103924
  thread: ThreadAddress,
104073
103925
  cursor: Optional(String2({
104074
- description: "Opaque cursor from an earlier thread_read (tool.thread_read() in an eval cell) to continue a truncated transcript; a transcript revision that moved past it returns cursor_stale."
103926
+ description: "Opaque cursor from an earlier thread_read (tool.thread_read() in an eval cell) to page the older messages of a truncated read (a read without one returns the newest messages that fit max_bytes); a transcript revision that moved past it returns cursor_stale."
104075
103927
  })),
104076
103928
  max_bytes: Optional(Integer({
104077
103929
  minimum: 1,
@@ -104108,7 +103960,10 @@ var init_params = __esm(() => {
104108
103960
  ThreadCloseParams = _Object_({
104109
103961
  thread: SelfOrThread,
104110
103962
  idempotency_key: IdempotencyKey,
104111
- all_scope: AllScope
103963
+ all_scope: AllScope,
103964
+ force: Optional(Boolean2({
103965
+ description: "Close even when the thread has messages it has not read yet; they are dropped and listed in dropped_deliveries."
103966
+ }))
104112
103967
  });
104113
103968
  ThreadHandoffParams = _Object_({
104114
103969
  thread: String2({
@@ -104160,6 +104015,14 @@ var init_params = __esm(() => {
104160
104015
  all_scope: AllScope,
104161
104016
  idempotency_key: IdempotencyKey
104162
104017
  });
104018
+ ThreadArchiveParams = _Object_({
104019
+ thread: ThreadAddress,
104020
+ archived: Optional(Boolean2({
104021
+ description: "true (the default) archives the thread, so thread_list (tool.thread_list() in an eval cell) hides it unless state includes archived; false unarchives it."
104022
+ })),
104023
+ all_scope: AllScope,
104024
+ idempotency_key: IdempotencyKey
104025
+ });
104163
104026
  ThreadReportParams = _Object_({
104164
104027
  binding_id: Optional(String2({
104165
104028
  minLength: 1,
@@ -108700,11 +108563,209 @@ var init_parse6 = __esm(() => {
108700
108563
  init_value2();
108701
108564
  init_errors5();
108702
108565
  });
108566
+
108567
+ // packages/omo-senpi/src/components/thread/contracts/state.ts
108568
+ var THREAD_ACTIVITIES;
108569
+ var init_state2 = __esm(() => {
108570
+ THREAD_ACTIVITIES = ["idle", "running", "awaiting_approval", "queued", "errored"];
108571
+ });
108572
+
108573
+ // packages/omo-senpi/src/components/thread/contracts/results.ts
108574
+ var init_results = __esm(() => {
108575
+ init_state2();
108576
+ });
108577
+
108703
108578
  // packages/omo-senpi/src/components/thread/contracts/index.ts
108704
108579
  var init_contracts = __esm(() => {
108705
108580
  init_fields();
108706
108581
  init_params();
108707
108582
  init_parse6();
108583
+ init_results();
108584
+ });
108585
+
108586
+ // packages/omo-senpi/src/components/thread/tools/thread-state.ts
108587
+ var ACTIVITIES;
108588
+ var init_thread_state = __esm(() => {
108589
+ init_contracts();
108590
+ ACTIVITIES = new Set(THREAD_ACTIVITIES);
108591
+ });
108592
+
108593
+ // packages/omo-senpi/src/components/thread/remote/address-book.ts
108594
+ var lastListed, REMOTE_NOT_SET_UP;
108595
+ var init_address_book = __esm(() => {
108596
+ init_errors5();
108597
+ init_remote_ops();
108598
+ lastListed = new WeakMap;
108599
+ REMOTE_NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
108600
+ });
108601
+
108602
+ // packages/omo-senpi/src/components/thread/addressing.ts
108603
+ var init_addressing = __esm(() => {
108604
+ init_errors5();
108605
+ });
108606
+
108607
+ // packages/omo-senpi/src/components/thread/session-facts.ts
108608
+ var SESSION_FACTS_WINDOW_BYTES, SESSION_FACTS_LAST_LINE_MAX_BYTES;
108609
+ var init_session_facts = __esm(() => {
108610
+ SESSION_FACTS_WINDOW_BYTES = 64 * 1024;
108611
+ SESSION_FACTS_LAST_LINE_MAX_BYTES = SESSION_FACTS_WINDOW_BYTES * 4;
108612
+ });
108613
+
108614
+ // packages/omo-senpi/src/components/thread/address-book.ts
108615
+ var init_address_book2 = __esm(() => {
108616
+ init_addressing();
108617
+ init_session_facts();
108618
+ });
108619
+
108620
+ // packages/omo-senpi/src/components/thread/metadata.ts
108621
+ var THREAD_TOOL_EXPOSURE = "eval", ROUTE_TO_TASK = "; to spawn a child task instead, use task.", THREAD_TOOL_METADATA;
108622
+ var init_metadata = __esm(() => {
108623
+ THREAD_TOOL_METADATA = [
108624
+ {
108625
+ name: "thread_create",
108626
+ label: "Create session",
108627
+ description: "Starts a fresh agent session that runs alongside this one, for when the user wants a second session working in parallel" + ROUTE_TO_TASK,
108628
+ exposure: THREAD_TOOL_EXPOSURE
108629
+ },
108630
+ {
108631
+ name: "thread_list",
108632
+ label: "List sessions",
108633
+ description: "Shows every addressable session on this device and the account's other devices with its id, name, status and device, plus the account's devices, for when the user needs a valid target address before acting on a session" + ROUTE_TO_TASK,
108634
+ exposure: THREAD_TOOL_EXPOSURE
108635
+ },
108636
+ {
108637
+ name: "thread_read",
108638
+ label: "Read session",
108639
+ description: "Returns the transcript and latest output of another session, for when the user asks what another session said or produced" + ROUTE_TO_TASK,
108640
+ exposure: THREAD_TOOL_EXPOSURE
108641
+ },
108642
+ {
108643
+ name: "thread_send",
108644
+ label: "Send message to session",
108645
+ description: "Delivers a message into another session that is already running, for when the user wants to talk to that session mid-task; its reply comes back through thread_read, and a bound chat thread's replies through thread_report and thread_answer (in an eval cell: tool.thread_read(), tool.thread_report(), tool.thread_answer())" + ROUTE_TO_TASK,
108646
+ exposure: THREAD_TOOL_EXPOSURE
108647
+ },
108648
+ {
108649
+ name: "thread_interrupt",
108650
+ label: "Interrupt session turn",
108651
+ description: "Stops the turn running in another session, and the background jobs that turn started, for when the user wants to halt a session that is going down the wrong path; the result's background lists what was stopped" + ROUTE_TO_TASK,
108652
+ exposure: THREAD_TOOL_EXPOSURE
108653
+ },
108654
+ {
108655
+ name: "thread_close",
108656
+ label: "Close session",
108657
+ 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,
108658
+ exposure: THREAD_TOOL_EXPOSURE
108659
+ },
108660
+ {
108661
+ name: "thread_handoff",
108662
+ label: "Hand off session",
108663
+ description: "Moves the current request to an old session that has the context, for when the user says to hand this off or reopen that earlier conversation" + ROUTE_TO_TASK,
108664
+ exposure: THREAD_TOOL_EXPOSURE
108665
+ },
108666
+ {
108667
+ name: "thread_rename",
108668
+ label: "Rename session",
108669
+ description: "Renames a session's label, for when the user asks to call a session something clearer. Omit thread or pass self to rename 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; a miss names the thread value to pass",
108670
+ exposure: THREAD_TOOL_EXPOSURE
108671
+ },
108672
+ {
108673
+ name: "thread_set_model",
108674
+ label: "Switch session model",
108675
+ description: "Moves a session onto a different model, for when the user asks to switch that session to another model or a cheaper one",
108676
+ exposure: THREAD_TOOL_EXPOSURE
108677
+ },
108678
+ {
108679
+ name: "thread_set_reasoning",
108680
+ label: "Set session reasoning level",
108681
+ description: "Sets how much reasoning a session applies, for when the user asks to raise or lower the thinking effort of a session",
108682
+ exposure: THREAD_TOOL_EXPOSURE
108683
+ },
108684
+ {
108685
+ name: "thread_archive",
108686
+ label: "Archive session",
108687
+ description: "Archives or unarchives a session so the session list hides or shows it again, for when the user is finished with a session but wants to keep it",
108688
+ exposure: THREAD_TOOL_EXPOSURE
108689
+ },
108690
+ {
108691
+ name: "thread_report",
108692
+ label: "Report to chat thread",
108693
+ description: "Posts a milestone, result, question or completion from this session to its bound chat thread, for when the user wants progress relayed to that chat; replies flow back through thread_read, thread_report and thread_answer (in an eval cell: tool.thread_read(), tool.thread_report(), tool.thread_answer())",
108694
+ exposure: THREAD_TOOL_EXPOSURE
108695
+ },
108696
+ {
108697
+ name: "thread_outbox",
108698
+ label: "Read chat outbox",
108699
+ description: "Returns the reports waiting for a bound chat thread with a cursor, for when a connector collects what sessions posted",
108700
+ exposure: THREAD_TOOL_EXPOSURE
108701
+ },
108702
+ {
108703
+ name: "thread_outbox_ack",
108704
+ label: "Acknowledge chat outbox",
108705
+ description: "Marks outbox rows up to a cursor as posted to the chat, for when a connector confirms delivery",
108706
+ exposure: THREAD_TOOL_EXPOSURE
108707
+ },
108708
+ {
108709
+ name: "thread_answer",
108710
+ label: "Answer relayed question",
108711
+ description: "Resolves a question a session relayed to a chat thread with the answer that arrived there, for when a connector hands back a chat user's reply",
108712
+ exposure: THREAD_TOOL_EXPOSURE
108713
+ }
108714
+ ];
108715
+ });
108716
+ // packages/omo-senpi/src/components/thread/tools/internals.ts
108717
+ function failure3(code, message, next, details) {
108718
+ return { kind: "error", error: threadToolFailure(code, message, next, details) };
108719
+ }
108720
+ var init_internals = __esm(() => {
108721
+ init_address_book();
108722
+ init_remote_ops();
108723
+ init_address_book2();
108724
+ init_addressing();
108725
+ init_errors5();
108726
+ init_metadata();
108727
+ init_session_facts();
108728
+ init_thread_link();
108729
+ init_thread_state();
108730
+ });
108731
+
108732
+ // packages/omo-senpi/src/components/thread/control/session-host.ts
108733
+ var init_session_host = __esm(() => {
108734
+ init_internals();
108735
+ });
108736
+
108737
+ // packages/omo-senpi/src/components/thread/control/relay-session-host.ts
108738
+ var init_relay_session_host = __esm(() => {
108739
+ init_errors5();
108740
+ init_initial_skills();
108741
+ init_outcome();
108742
+ init_remote_ops();
108743
+ init_remote_worktree();
108744
+ init_open_reply();
108745
+ init_thread_link();
108746
+ init_thread_state();
108747
+ init_session_host();
108748
+ });
108749
+
108750
+ // packages/omo-senpi/src/components/thread/tools/model-match.ts
108751
+ var init_model_match = __esm(() => {
108752
+ init_internals();
108753
+ });
108754
+
108755
+ // packages/omo-senpi/src/components/thread/control/operations.ts
108756
+ var NOT_LIVE;
108757
+ var init_operations = __esm(() => {
108758
+ init_internals();
108759
+ init_model_match();
108760
+ init_port();
108761
+ NOT_LIVE = failure3("not_resumable", "The thread has no live owner.", "Retry when the target is live.");
108762
+ });
108763
+
108764
+ // packages/omo-senpi/src/components/call-budget/call-deadline.ts
108765
+ import { AsyncLocalStorage as AsyncLocalStorage4 } from "async_hooks";
108766
+ var scope;
108767
+ var init_call_deadline = __esm(() => {
108768
+ scope = new AsyncLocalStorage4;
108708
108769
  });
108709
108770
  // packages/omo-senpi/src/components/thread/reader.ts
108710
108771
  var init_reader = __esm(() => {
@@ -108759,12 +108820,20 @@ var init_wait_settled = __esm(() => {
108759
108820
  "tool_execution_update",
108760
108821
  "tool_execution_end",
108761
108822
  "turn_end",
108762
- "agent_end"
108823
+ "agent_end",
108824
+ "auto_retry_start",
108825
+ "auto_retry_end"
108763
108826
  ]);
108764
108827
  });
108765
108828
 
108829
+ // packages/omo-senpi/src/components/thread/tools/thread-row.ts
108830
+ var init_thread_row = __esm(() => {
108831
+ init_thread_link();
108832
+ });
108833
+
108766
108834
  // packages/omo-senpi/src/components/thread/control/relay-control.ts
108767
108835
  var init_relay_control = __esm(() => {
108836
+ init_call_deadline();
108768
108837
  init_address_book();
108769
108838
  init_outcome();
108770
108839
  init_transcript_tail();
@@ -108773,10 +108842,15 @@ var init_relay_control = __esm(() => {
108773
108842
  init_close_ladder();
108774
108843
  init_port();
108775
108844
  init_wait_settled();
108845
+ init_relay_session_host();
108846
+ init_thread_row();
108776
108847
  });
108777
108848
 
108778
108849
  // packages/omo-senpi/src/components/thread/remote/attach-pool.ts
108779
- var init_attach_pool = () => {};
108850
+ var CATALOG_RECORD = "get_available_models", HELD_RECORDS;
108851
+ var init_attach_pool = __esm(() => {
108852
+ HELD_RECORDS = new Set([CATALOG_RECORD, "get_protocol_info"]);
108853
+ });
108780
108854
 
108781
108855
  // packages/omo-senpi/src/components/thread/remote/session-state.ts
108782
108856
  var ACCESS_ENDED, ACCESS_REFUSED, SESSION_LEFT, SESSION_GONE2;
@@ -108814,46 +108888,20 @@ var init_remote_watch = __esm(() => {
108814
108888
  init_device_service2();
108815
108889
  init_session_state();
108816
108890
  });
108817
-
108818
108891
  // packages/omo-senpi/src/components/remote/port/device-service.ts
108819
- var REFUSED_BEFORE_SENDING, READ_ONLY_RECORDS, MARKED_RECORDS, LOOKUP_NONE;
108892
+ var READ_ONLY_RECORDS, MARKED_RECORDS, LOOKUP_NONE;
108820
108893
  var init_device_service3 = __esm(() => {
108821
108894
  init_outcome();
108822
108895
  init_device_service2();
108823
108896
  init_attach_pool();
108824
108897
  init_remote_watch();
108825
- REFUSED_BEFORE_SENDING = new Set([
108826
- "unauthenticated",
108827
- "client_proof_invalid",
108828
- "invalid_request",
108829
- "unknown_type",
108830
- "forbidden",
108831
- "owner_transfer",
108832
- "signed_out",
108833
- "device_mismatch",
108834
- "device_changed",
108835
- "account_changed",
108836
- "device_key_invalid",
108837
- "service_disabled",
108838
- "sign_in_required",
108839
- "plan_required",
108840
- "activation_pending",
108841
- "authorization_stale",
108842
- "peer_not_found",
108843
- "peer_not_session_client",
108844
- "session_not_found",
108845
- "engine_too_old",
108846
- "not_attached",
108847
- "command_id_conflict",
108848
- "message_too_long",
108849
- "upload_incomplete",
108850
- "malformed",
108851
- "method_unclassified",
108852
- "method_local_only",
108853
- "host_not_answering",
108854
- "unsupported"
108898
+ init_call_deadline();
108899
+ READ_ONLY_RECORDS = new Set([
108900
+ "get_state",
108901
+ "get_messages",
108902
+ "get_entries",
108903
+ "get_protocol_info"
108855
108904
  ]);
108856
- READ_ONLY_RECORDS = new Set(["get_state", "get_messages", "get_entries"]);
108857
108905
  MARKED_RECORDS = new Set(["admit_external_message"]);
108858
108906
  LOOKUP_NONE = new Set(["session_not_found", "peer_not_found", "peer_not_session_client"]);
108859
108907
  });
@@ -108892,6 +108940,12 @@ var init_codes = __esm(() => {
108892
108940
  ]);
108893
108941
  });
108894
108942
 
108943
+ // packages/omo-senpi/src/components/remote/connection-of.ts
108944
+ var lenders;
108945
+ var init_connection_of = __esm(() => {
108946
+ lenders = new WeakMap;
108947
+ });
108948
+
108895
108949
  // packages/omo-senpi/src/components/remote/deadlines.ts
108896
108950
  var init_deadlines = __esm(() => {
108897
108951
  init_codes();
@@ -108964,6 +109018,21 @@ var init_result2 = __esm(() => {
108964
109018
  init_errors5();
108965
109019
  });
108966
109020
 
109021
+ // packages/omo-senpi/src/components/thread/remote/find-session.ts
109022
+ var NO_FIND_SESSION;
109023
+ var init_find_session = __esm(() => {
109024
+ init_errors5();
109025
+ init_outcome();
109026
+ init_remote_ops();
109027
+ NO_FIND_SESSION = new Set([
109028
+ "method_unclassified",
109029
+ "unknown_command",
109030
+ "unknown_type",
109031
+ "unsupported",
109032
+ "find_session_unsupported"
109033
+ ]);
109034
+ });
109035
+
108967
109036
  // packages/omo-senpi/src/components/thread/remote/relay-transport.ts
108968
109037
  var ADMIT_UNSUPPORTED, WAITS;
108969
109038
  var init_relay_transport = __esm(() => {
@@ -108973,6 +109042,8 @@ var init_relay_transport = __esm(() => {
108973
109042
  init_result2();
108974
109043
  init_remote_ops();
108975
109044
  init_outcome();
109045
+ init_find_session();
109046
+ init_call_deadline();
108976
109047
  ADMIT_UNSUPPORTED = new Set([
108977
109048
  "method_unclassified",
108978
109049
  "delegation_unclassified",
@@ -109022,6 +109093,7 @@ var init_unknown_device = __esm(() => {
109022
109093
 
109023
109094
  // packages/omo-senpi/src/components/remote/client.ts
109024
109095
  var init_client5 = __esm(() => {
109096
+ init_connection_of();
109025
109097
  init_device_service2();
109026
109098
  init_aliases();
109027
109099
  init_attach();
@@ -109034,9 +109106,24 @@ var init_client5 = __esm(() => {
109034
109106
  init_unknown_device();
109035
109107
  });
109036
109108
 
109037
- // packages/omo-senpi/src/components/thread/tools/thread-row.ts
109038
- var init_thread_row = __esm(() => {
109039
- init_thread_link();
109109
+ // packages/omo-senpi/src/components/remote/factories.ts
109110
+ var init_factories = __esm(() => {
109111
+ init_client5();
109112
+ });
109113
+
109114
+ // packages/omo-senpi/src/components/thread/remote/plan-create.ts
109115
+ var ALIASES_UNAVAILABLE;
109116
+ var init_plan_create = __esm(() => {
109117
+ init_addressing();
109118
+ init_relay_session_host();
109119
+ init_errors5();
109120
+ init_thread_row();
109121
+ init_find_session();
109122
+ init_remote_ops();
109123
+ ALIASES_UNAVAILABLE = {
109124
+ kind: "error",
109125
+ 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.")
109126
+ };
109040
109127
  });
109041
109128
 
109042
109129
  // packages/omo-opencode/src/cli/cli-program.ts
@@ -124602,8 +124689,8 @@ var package_default3 = {
124602
124689
  },
124603
124690
  dependencies: {
124604
124691
  "@clack/prompts": "^1.8.1",
124605
- "@code-yeongyu/senpi": "2026.11.18",
124606
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.18",
124692
+ "@code-yeongyu/senpi": "2026.11.18-3",
124693
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.18-3",
124607
124694
  "@modelcontextprotocol/sdk": "^1.30.0",
124608
124695
  "@oh-my-opencode/agents-md-core": "workspace:*",
124609
124696
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -127859,7 +127946,135 @@ import { createHash as createHash10 } from "crypto";
127859
127946
 
127860
127947
  // packages/memory-core/src/sync/item/machine-id.ts
127861
127948
  import { execFile as execFile7 } from "child_process";
127862
- init_resilient();
127949
+
127950
+ // packages/memory-core/src/fs/resilient.ts
127951
+ import * as fsSync from "fs";
127952
+ import * as fsp from "fs/promises";
127953
+
127954
+ // packages/memory-core/src/fs/retry.ts
127955
+ var EINTR_RETRY_CAP = 128;
127956
+ function fsErrorCode(error) {
127957
+ if (!(error instanceof Error) || !("code" in error))
127958
+ return;
127959
+ return typeof error.code === "string" ? error.code : undefined;
127960
+ }
127961
+ async function retryOnEintr(operation) {
127962
+ for (let attempt = 0;; attempt += 1) {
127963
+ try {
127964
+ return await operation();
127965
+ } catch (error) {
127966
+ if (fsErrorCode(error) !== "EINTR" || attempt >= EINTR_RETRY_CAP)
127967
+ throw error;
127968
+ }
127969
+ }
127970
+ }
127971
+ function retryOnEintrSync(operation) {
127972
+ for (let attempt = 0;; attempt += 1) {
127973
+ try {
127974
+ return operation();
127975
+ } catch (error) {
127976
+ if (fsErrorCode(error) !== "EINTR" || attempt >= EINTR_RETRY_CAP)
127977
+ throw error;
127978
+ }
127979
+ }
127980
+ }
127981
+
127982
+ // packages/memory-core/src/fs/rename-contention.ts
127983
+ var CONTENTION_CODES = new Set(["EPERM", "EBUSY", "EACCES"]);
127984
+ var CONTENTION_DELAYS_MS = [10, 25, 50, 100, 200, 400];
127985
+ var sleepFor = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
127986
+ async function renameWithContentionRetry(from, to, deps) {
127987
+ const delays = deps.platform === "win32" ? deps.delaysMs ?? CONTENTION_DELAYS_MS : [];
127988
+ const sleep = deps.sleep ?? sleepFor;
127989
+ for (let attempt = 0;; attempt += 1) {
127990
+ try {
127991
+ await retryOnEintr(() => deps.admit === undefined ? deps.rename(from, to) : deps.admit(() => deps.rename(from, to)));
127992
+ return;
127993
+ } catch (error) {
127994
+ const delay = delays[attempt];
127995
+ const code = fsErrorCode(error);
127996
+ if (delay === undefined || code === undefined || !CONTENTION_CODES.has(code))
127997
+ throw error;
127998
+ await sleep(delay);
127999
+ }
128000
+ }
128001
+ }
128002
+
128003
+ // packages/memory-core/src/fs/resilient.ts
128004
+ function isFunction2(value) {
128005
+ return typeof value === "function";
128006
+ }
128007
+ function withAsyncRetry(operation) {
128008
+ return (...args) => retryOnEintr(async () => operation(...args));
128009
+ }
128010
+ function withSyncRetry(operation) {
128011
+ return (...args) => retryOnEintrSync(() => operation(...args));
128012
+ }
128013
+ function resilientNamespace(namespace, kind) {
128014
+ const wrapFunction = kind === "async" ? withAsyncRetry : withSyncRetry;
128015
+ const cache = new Map;
128016
+ return new Proxy(namespace, {
128017
+ get(target, property) {
128018
+ if (cache.has(property))
128019
+ return cache.get(property);
128020
+ const value = Reflect.get(target, property);
128021
+ if (!isFunction2(value))
128022
+ return value;
128023
+ const wrapped = wrapFunction(value);
128024
+ const native = Reflect.get(value, "native");
128025
+ if (isFunction2(native))
128026
+ Object.assign(wrapped, { native: wrapFunction(native) });
128027
+ cache.set(property, wrapped);
128028
+ return wrapped;
128029
+ }
128030
+ });
128031
+ }
128032
+ var IDEMPOTENT_HANDLE_METHODS = new Set(["stat", "sync", "datasync", "chmod", "chown", "utimes", "truncate"]);
128033
+ var promises = resilientNamespace(fsp, "async");
128034
+ function rename8(from, to, admit) {
128035
+ return renameWithContentionRetry(from, to, {
128036
+ rename: (source, target) => fsp.rename(source, target),
128037
+ platform: process.platform,
128038
+ ...admit === undefined ? {} : { admit }
128039
+ });
128040
+ }
128041
+ var sync = resilientNamespace(fsSync, "sync");
128042
+ var {
128043
+ access: access4,
128044
+ chmod: chmod2,
128045
+ copyFile: copyFile4,
128046
+ cp: cp5,
128047
+ link,
128048
+ lstat: lstat18,
128049
+ mkdir: mkdir10,
128050
+ mkdtemp: mkdtemp2,
128051
+ readFile: readFile34,
128052
+ readdir: readdir17,
128053
+ readlink: readlink7,
128054
+ realpath: realpath2,
128055
+ rm: rm16,
128056
+ rmdir: rmdir2,
128057
+ stat: stat8,
128058
+ statfs,
128059
+ unlink: unlink3
128060
+ } = promises;
128061
+ var {
128062
+ accessSync: accessSync5,
128063
+ chmodSync: chmodSync7,
128064
+ fsyncSync: fsyncSync3,
128065
+ linkSync,
128066
+ lstatSync: lstatSync5,
128067
+ mkdirSync: mkdirSync19,
128068
+ readFileSync: readFileSync44,
128069
+ readdirSync: readdirSync14,
128070
+ realpathSync: realpathSync13,
128071
+ statSync: statSync8,
128072
+ unlinkSync: unlinkSync10,
128073
+ writeFileSync: writeFileSync17,
128074
+ writeSync
128075
+ } = sync;
128076
+
128077
+ // packages/memory-core/src/sync/item/machine-id.ts
127863
128078
  async function darwinPlatformUuid() {
127864
128079
  const out = await run2("/usr/sbin/ioreg", ["-rd1", "-c", "IOPlatformExpertDevice"]);
127865
128080
  return /"IOPlatformUUID" = "([^"]+)"/.exec(out ?? "")?.[1] ?? null;
@@ -128860,7 +129075,6 @@ import { randomUUID as randomUUID6 } from "crypto";
128860
129075
  import { readFile as readFile36, stat as stat11 } from "fs/promises";
128861
129076
 
128862
129077
  // packages/memory-core/src/locks/process-identity.ts
128863
- init_resilient();
128864
129078
  import { execFile as execFile8 } from "child_process";
128865
129079
 
128866
129080
  // packages/memory-core/src/locks/process-start-time.ts
@@ -130358,6 +130572,15 @@ function refuseIfLocalOnly(site) {
130358
130572
  throw new LocalOnlyNetworkRefused(site);
130359
130573
  }
130360
130574
 
130575
+ // packages/memory-core/src/sync/contract-version.ts
130576
+ var SYNC_CONTRACT_VERSION = "1.44.0";
130577
+ var SYNC_CAPABILITIES = "phrase";
130578
+ var syncRequestHeaders = (token) => ({
130579
+ "omo-contract-version": SYNC_CONTRACT_VERSION,
130580
+ "omo-sync-capabilities": SYNC_CAPABILITIES,
130581
+ authorization: `Bearer ${token}`
130582
+ });
130583
+
130361
130584
  // packages/omo-opencode/src/cli/service-auth/protocol-request.ts
130362
130585
  init_zod();
130363
130586
  class InvalidApiResponse extends SignInError {
@@ -130436,10 +130659,10 @@ async function requestApi(api, path, init, signal) {
130436
130659
  }
130437
130660
 
130438
130661
  // packages/omo-opencode/src/cli/service-auth/machine-reconcile.ts
130439
- init_zod();
130440
130662
  import { createHash as createHash15, createPrivateKey as createPrivateKey3, sign } from "crypto";
130441
130663
  import { mkdir as mkdir14, readFile as readFile39, rename as rename11, rm as rm19, writeFile as writeFile18 } from "fs/promises";
130442
130664
  import { dirname as dirname48, join as join115 } from "path";
130665
+ init_zod();
130443
130666
  var MACHINE_BIND_CONTEXT = "omo-machine-bind-v1";
130444
130667
  var DEVICE_FIXUP_BUDGET_MS = 5000;
130445
130668
  var MACHINE_EXISTS_RETRY_MS = 7 * 24 * 60 * 60 * 1000;
@@ -130494,7 +130717,7 @@ async function reconcileDevice(options) {
130494
130717
  if (!signal.aborted)
130495
130718
  options.log(line);
130496
130719
  };
130497
- const auth = { authorization: `Bearer ${credentials.accessToken}` };
130720
+ const auth = syncRequestHeaders(credentials.accessToken);
130498
130721
  let own;
130499
130722
  try {
130500
130723
  const listed = deviceListSchema2.safeParse(await request("/v1/devices", { headers: auth }));
@@ -130643,7 +130866,7 @@ function createSession(options) {
130643
130866
  }
130644
130867
  const request = (path, init) => requestApi(api, path, init, signal);
130645
130868
  const accountOf = async (access, stop = signal) => {
130646
- const body = await requestApi(api, "/v1/me", { headers: { authorization: `Bearer ${access}` } }, stop).catch(() => null);
130869
+ const body = await requestApi(api, "/v1/me", { headers: syncRequestHeaders(access) }, stop).catch(() => null);
130647
130870
  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;
130648
130871
  return typeof id === "string" && id !== "" ? id : undefined;
130649
130872
  };
@@ -130730,7 +130953,7 @@ function createSession(options) {
130730
130953
  });
130731
130954
  }
130732
130955
  async function emailOf(access) {
130733
- const body = await request("/v1/me", { headers: { authorization: `Bearer ${access}` } }).catch(() => null);
130956
+ const body = await request("/v1/me", { headers: syncRequestHeaders(access) }).catch(() => null);
130734
130957
  const user = typeof body === "object" && body !== null && "user" in body ? body.user : undefined;
130735
130958
  const email = typeof user === "object" && user !== null && "email" in user ? user.email : undefined;
130736
130959
  return typeof email === "string" && email !== "" ? email : undefined;
@@ -130816,7 +131039,7 @@ function createSession(options) {
130816
131039
  }
130817
131040
  await request(`/v1/devices/${encodeURIComponent(current.device.id)}`, {
130818
131041
  method: "DELETE",
130819
- headers: { authorization: `Bearer ${access}` }
131042
+ headers: syncRequestHeaders(access)
130820
131043
  });
130821
131044
  }
130822
131045
  return true;
@@ -130842,7 +131065,7 @@ function createSession(options) {
130842
131065
  async removeForLimit(error, choose) {
130843
131066
  if (!(error instanceof ApiRefusal) || error.detail === undefined)
130844
131067
  throw error;
130845
- const headers = { authorization: `Bearer ${error.detail.managementToken}` };
131068
+ const headers = syncRequestHeaders(error.detail.managementToken);
130846
131069
  const listed = parseReply(deviceListSchema, await request("/v1/devices", { headers }));
130847
131070
  const devices = listed.devices.filter((device) => device.revokedAt === null);
130848
131071
  const chosen = await choose(devices);
@@ -131166,7 +131389,6 @@ function decideReplace(options) {
131166
131389
  }
131167
131390
 
131168
131391
  // packages/memory-core/src/sync/device-retire.ts
131169
- init_resilient();
131170
131392
  import { createHash as createHash17, randomBytes as randomBytes6 } from "crypto";
131171
131393
  import { join as join119 } from "path";
131172
131394
 
@@ -131515,6 +131737,9 @@ var forgetDeviceService = async (options) => {
131515
131737
  }
131516
131738
  return "forgotten";
131517
131739
  };
131740
+ // packages/device-service-core/src/cold-wake/host.ts
131741
+ var UNREPAIRABLE = new Set(["EPERM", "EACCES", "EROFS"]);
131742
+
131518
131743
  // packages/device-service-core/src/cold-wake/service-table.ts
131519
131744
  var SERVICE_TABLE_ENV = "OMO_RELAYD_SERVICES";
131520
131745
 
@@ -131680,7 +131905,7 @@ init_timers();
131680
131905
  // packages/omo-native/package.json
131681
131906
  var package_default4 = {
131682
131907
  name: "omo-ai",
131683
- version: "5.1.77",
131908
+ version: "5.1.79",
131684
131909
  type: "module",
131685
131910
  description: "OmO Native - the standalone omo command with the OMO extension built in: bun add -g omo-ai",
131686
131911
  bin: {
@@ -131697,7 +131922,7 @@ var package_default4 = {
131697
131922
  postinstall: "node bin/senpi-patch.mjs"
131698
131923
  },
131699
131924
  dependencies: {
131700
- "@code-yeongyu/senpi": "2026.11.18"
131925
+ "@code-yeongyu/senpi": "2026.11.18-3"
131701
131926
  },
131702
131927
  repository: {
131703
131928
  type: "git",
@@ -131711,7 +131936,7 @@ async function accountOf(api, credentials, doFetch) {
131711
131936
  if (credentials.accountId !== undefined)
131712
131937
  return credentials.accountId;
131713
131938
  refuseIfLocalOnly("omo-native/device-service-handoff.ts accountOf");
131714
- const response = await doFetch(`${api}/v1/me`, { headers: { authorization: `Bearer ${credentials.accessToken}` } });
131939
+ const response = await doFetch(`${api}/v1/me`, { headers: syncRequestHeaders(credentials.accessToken) });
131715
131940
  if (!response.ok)
131716
131941
  throw new Error(`the account read failed (${response.status})`);
131717
131942
  const body = await response.json();
@@ -131785,11 +132010,7 @@ function cliDeviceServiceHandoff(options) {
131785
132010
  // packages/omo-native/remote-entry.ts
131786
132011
  init_device_service2();
131787
132012
 
131788
- // packages/memory-core/src/sync/crypto/trust-pin.ts
131789
- init_resilient();
131790
-
131791
132013
  // packages/memory-core/src/journal/fsync.ts
131792
- init_resilient();
131793
132014
  var SKIPPABLE_SYNC_CODES = new Set(["ENOENT", "EISDIR", "EPERM", "EACCES", "EINVAL"]);
131794
132015
 
131795
132016
  // packages/memory-core/src/sync/crypto/vendor/sync-format/keys.ts
@@ -131825,9 +132046,6 @@ var D2 = mod2(-121665n * power2(121666n, P2 - 2n));
131825
132046
  var SQRT_MINUS_ONE2 = power2(2n, (P2 - 1n) / 4n);
131826
132047
  var keyCache2 = new Map;
131827
132048
 
131828
- // packages/memory-core/src/sync/publication.ts
131829
- init_resilient();
131830
-
131831
132049
  // packages/memory-core/src/sync/crypto/trust-pin.ts
131832
132050
  var SOURCES = new Set(["pairing", "recovery", "creator"]);
131833
132051
 
@@ -131880,13 +132098,12 @@ init_device_service3();
131880
132098
 
131881
132099
  // packages/omo-senpi/src/components/remote/index.ts
131882
132100
  init_codes();
131883
-
131884
- // packages/omo-senpi/src/components/remote/factories.ts
131885
- init_client5();
131886
-
131887
- // packages/omo-senpi/src/components/remote/index.ts
132101
+ init_factories();
131888
132102
  init_seams();
131889
132103
 
132104
+ // packages/omo-senpi/src/components/remote/device-address.ts
132105
+ init_plan_create();
132106
+ init_remote_ops();
131890
132107
  // packages/omo-senpi/src/components/thread/gateway/store.ts
131891
132108
  init_constants6();
131892
132109
  init_provenance_resolver();
@@ -132017,7 +132234,7 @@ var USAGE_ENTRIES = [
132017
132234
  },
132018
132235
  {
132019
132236
  verbs: ["close"],
132020
- text: " close <session> end the session; also takes <device>/<session>"
132237
+ text: " close <session> [--force] end the session; --force also drops messages it has not read"
132021
132238
  }
132022
132239
  ];
132023
132240
  var REMOTE_USAGE = [USAGE_HEAD, ...USAGE_ENTRIES.map((entry) => entry.text)].join(`