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
@@ -2133,7 +2133,7 @@ var package_default;
2133
2133
  var init_package = __esm(() => {
2134
2134
  package_default = {
2135
2135
  name: "oh-my-opencode",
2136
- version: "5.1.77",
2136
+ version: "5.1.79",
2137
2137
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
2138
2138
  main: "./dist/index.js",
2139
2139
  types: "dist/index.d.ts",
@@ -2331,7 +2331,7 @@ var init_package = __esm(() => {
2331
2331
  },
2332
2332
  devDependencies: {
2333
2333
  "@clack/prompts": "^1.8.1",
2334
- "@code-yeongyu/senpi": "2026.11.18",
2334
+ "@code-yeongyu/senpi": "2026.11.18-3",
2335
2335
  "@modelcontextprotocol/sdk": "^1.30.0",
2336
2336
  "@oh-my-opencode/agents-md-core": "workspace:*",
2337
2337
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
@@ -2404,18 +2404,18 @@ var init_package = __esm(() => {
2404
2404
  typescript: "^7.0.2"
2405
2405
  },
2406
2406
  optionalDependencies: {
2407
- "oh-my-opencode-darwin-arm64": "5.1.77",
2408
- "oh-my-opencode-darwin-x64": "5.1.77",
2409
- "oh-my-opencode-darwin-x64-baseline": "5.1.77",
2410
- "oh-my-opencode-linux-arm64": "5.1.77",
2411
- "oh-my-opencode-linux-arm64-musl": "5.1.77",
2412
- "oh-my-opencode-linux-x64": "5.1.77",
2413
- "oh-my-opencode-linux-x64-baseline": "5.1.77",
2414
- "oh-my-opencode-linux-x64-musl": "5.1.77",
2415
- "oh-my-opencode-linux-x64-musl-baseline": "5.1.77",
2416
- "oh-my-opencode-windows-arm64": "5.1.77",
2417
- "oh-my-opencode-windows-x64": "5.1.77",
2418
- "oh-my-opencode-windows-x64-baseline": "5.1.77"
2407
+ "oh-my-opencode-darwin-arm64": "5.1.79",
2408
+ "oh-my-opencode-darwin-x64": "5.1.79",
2409
+ "oh-my-opencode-darwin-x64-baseline": "5.1.79",
2410
+ "oh-my-opencode-linux-arm64": "5.1.79",
2411
+ "oh-my-opencode-linux-arm64-musl": "5.1.79",
2412
+ "oh-my-opencode-linux-x64": "5.1.79",
2413
+ "oh-my-opencode-linux-x64-baseline": "5.1.79",
2414
+ "oh-my-opencode-linux-x64-musl": "5.1.79",
2415
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.79",
2416
+ "oh-my-opencode-windows-arm64": "5.1.79",
2417
+ "oh-my-opencode-windows-x64": "5.1.79",
2418
+ "oh-my-opencode-windows-x64-baseline": "5.1.79"
2419
2419
  },
2420
2420
  overrides: {
2421
2421
  hono: "^4.13.8",
@@ -2538,6 +2538,9 @@ var init_deep_merge = __esm(() => {
2538
2538
  DANGEROUS_KEYS = new Set(["__proto__", "constructor", "prototype"]);
2539
2539
  });
2540
2540
 
2541
+ // packages/utils/src/escape-for-display.ts
2542
+ var init_escape_for_display = () => {};
2543
+
2541
2544
  // packages/utils/src/config-merge.ts
2542
2545
  function mergeUniqueStrings(base, override) {
2543
2546
  return [...new Set([...base ?? [], ...override ?? []])];
@@ -9302,6 +9305,7 @@ var init_zip_entry_listing = () => {};
9302
9305
  // packages/utils/src/index.ts
9303
9306
  var init_src = __esm(() => {
9304
9307
  init_deep_merge();
9308
+ init_escape_for_display();
9305
9309
  init_config_section_parser();
9306
9310
  init_env_expansion();
9307
9311
  init_snake_case();
@@ -93004,7 +93008,7 @@ var package_default2;
93004
93008
  var init_package2 = __esm(() => {
93005
93009
  package_default2 = {
93006
93010
  name: "@oh-my-opencode/omo-codex",
93007
- version: "5.1.77",
93011
+ version: "5.1.79",
93008
93012
  type: "module",
93009
93013
  private: true,
93010
93014
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -94236,142 +94240,6 @@ var init_auto_update_checker = __esm(() => {
94236
94240
  init_cache();
94237
94241
  });
94238
94242
 
94239
- // packages/memory-core/src/fs/retry.ts
94240
- function fsErrorCode(error) {
94241
- if (!(error instanceof Error) || !("code" in error))
94242
- return;
94243
- return typeof error.code === "string" ? error.code : undefined;
94244
- }
94245
- async function retryOnEintr(operation) {
94246
- for (let attempt = 0;; attempt += 1) {
94247
- try {
94248
- return await operation();
94249
- } catch (error) {
94250
- if (fsErrorCode(error) !== "EINTR" || attempt >= EINTR_RETRY_CAP)
94251
- throw error;
94252
- }
94253
- }
94254
- }
94255
- function retryOnEintrSync(operation) {
94256
- for (let attempt = 0;; attempt += 1) {
94257
- try {
94258
- return operation();
94259
- } catch (error) {
94260
- if (fsErrorCode(error) !== "EINTR" || attempt >= EINTR_RETRY_CAP)
94261
- throw error;
94262
- }
94263
- }
94264
- }
94265
- var EINTR_RETRY_CAP = 128;
94266
-
94267
- // packages/memory-core/src/fs/rename-contention.ts
94268
- async function renameWithContentionRetry(from, to, deps) {
94269
- const delays = deps.platform === "win32" ? deps.delaysMs ?? CONTENTION_DELAYS_MS : [];
94270
- const sleep = deps.sleep ?? sleepFor;
94271
- for (let attempt = 0;; attempt += 1) {
94272
- try {
94273
- await retryOnEintr(() => deps.admit === undefined ? deps.rename(from, to) : deps.admit(() => deps.rename(from, to)));
94274
- return;
94275
- } catch (error) {
94276
- const delay = delays[attempt];
94277
- const code = fsErrorCode(error);
94278
- if (delay === undefined || code === undefined || !CONTENTION_CODES.has(code))
94279
- throw error;
94280
- await sleep(delay);
94281
- }
94282
- }
94283
- }
94284
- var CONTENTION_CODES, CONTENTION_DELAYS_MS, sleepFor = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
94285
- var init_rename_contention = __esm(() => {
94286
- CONTENTION_CODES = new Set(["EPERM", "EBUSY", "EACCES"]);
94287
- CONTENTION_DELAYS_MS = [10, 25, 50, 100, 200, 400];
94288
- });
94289
-
94290
- // packages/memory-core/src/fs/write-all.ts
94291
- var init_write_all = () => {};
94292
-
94293
- // packages/memory-core/src/fs/resilient.ts
94294
- import * as fsSync from "node:fs";
94295
- import * as fsp from "node:fs/promises";
94296
- function isFunction2(value) {
94297
- return typeof value === "function";
94298
- }
94299
- function withAsyncRetry(operation) {
94300
- return (...args) => retryOnEintr(async () => operation(...args));
94301
- }
94302
- function withSyncRetry(operation) {
94303
- return (...args) => retryOnEintrSync(() => operation(...args));
94304
- }
94305
- function resilientNamespace(namespace, kind) {
94306
- const wrapFunction = kind === "async" ? withAsyncRetry : withSyncRetry;
94307
- const cache = new Map;
94308
- return new Proxy(namespace, {
94309
- get(target, property) {
94310
- if (cache.has(property))
94311
- return cache.get(property);
94312
- const value = Reflect.get(target, property);
94313
- if (!isFunction2(value))
94314
- return value;
94315
- const wrapped = wrapFunction(value);
94316
- const native = Reflect.get(value, "native");
94317
- if (isFunction2(native))
94318
- Object.assign(wrapped, { native: wrapFunction(native) });
94319
- cache.set(property, wrapped);
94320
- return wrapped;
94321
- }
94322
- });
94323
- }
94324
- function rename8(from, to, admit) {
94325
- return renameWithContentionRetry(from, to, {
94326
- rename: (source, target) => fsp.rename(source, target),
94327
- platform: process.platform,
94328
- ...admit === undefined ? {} : { admit }
94329
- });
94330
- }
94331
- 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;
94332
- var init_resilient = __esm(() => {
94333
- init_rename_contention();
94334
- init_write_all();
94335
- init_write_all();
94336
- IDEMPOTENT_HANDLE_METHODS = new Set(["stat", "sync", "datasync", "chmod", "chown", "utimes", "truncate"]);
94337
- promises = resilientNamespace(fsp, "async");
94338
- sync = resilientNamespace(fsSync, "sync");
94339
- ({
94340
- access: access4,
94341
- chmod: chmod2,
94342
- copyFile: copyFile4,
94343
- cp: cp5,
94344
- link,
94345
- lstat: lstat18,
94346
- mkdir: mkdir10,
94347
- mkdtemp: mkdtemp2,
94348
- readFile: readFile34,
94349
- readdir: readdir17,
94350
- readlink: readlink7,
94351
- realpath: realpath2,
94352
- rm: rm16,
94353
- rmdir: rmdir2,
94354
- stat: stat8,
94355
- statfs,
94356
- unlink: unlink3
94357
- } = promises);
94358
- ({
94359
- accessSync: accessSync5,
94360
- chmodSync: chmodSync7,
94361
- fsyncSync: fsyncSync3,
94362
- linkSync,
94363
- lstatSync: lstatSync5,
94364
- mkdirSync: mkdirSync19,
94365
- readFileSync: readFileSync44,
94366
- readdirSync: readdirSync14,
94367
- realpathSync: realpathSync13,
94368
- statSync: statSync8,
94369
- unlinkSync: unlinkSync10,
94370
- writeFileSync: writeFileSync17,
94371
- writeSync
94372
- } = sync);
94373
- });
94374
-
94375
94243
  // packages/device-service-core/src/local-api/errors.ts
94376
94244
  var LocalApiError, protocolViolation = (detail) => {
94377
94245
  throw new LocalApiError("protocol_violation", detail);
@@ -97632,14 +97500,21 @@ var init_background_transport = __esm(() => {
97632
97500
  });
97633
97501
 
97634
97502
  // packages/device-service-core/src/not-sent-error.ts
97635
- var NotSentError, markNotSent = (error) => error instanceof LocalApiError ? new NotSentError(error.code, error.reason, {
97636
- action: error.action,
97637
- ...error.limit_chars === undefined ? {} : { limit_chars: error.limit_chars },
97638
- ...error.path_refusal === undefined ? {} : { path_refusal: error.path_refusal },
97639
- ...error.candidates === undefined ? {} : { candidates: error.candidates },
97640
- ...error.incomplete === undefined ? {} : { incomplete: error.incomplete },
97641
- ...error.sign_in_reason === undefined ? {} : { sign_in_reason: error.sign_in_reason }
97642
- }) : 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`, {
97503
+ function markNotSent(error) {
97504
+ if (error instanceof NotSentError)
97505
+ return error;
97506
+ if (!(error instanceof LocalApiError))
97507
+ return error;
97508
+ return new NotSentError(error.code, error.reason, {
97509
+ action: error.action,
97510
+ ...error.limit_chars === undefined ? {} : { limit_chars: error.limit_chars },
97511
+ ...error.path_refusal === undefined ? {} : { path_refusal: error.path_refusal },
97512
+ ...error.candidates === undefined ? {} : { candidates: error.candidates },
97513
+ ...error.incomplete === undefined ? {} : { incomplete: error.incomplete },
97514
+ ...error.sign_in_reason === undefined ? {} : { sign_in_reason: error.sign_in_reason }
97515
+ });
97516
+ }
97517
+ 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`, {
97643
97518
  action: `Run omo remote bootstrap to install device service ${minimum} or later.`
97644
97519
  });
97645
97520
  var init_not_sent_error = __esm(() => {
@@ -97780,6 +97655,26 @@ var init_timers = __esm(() => {
97780
97655
  };
97781
97656
  });
97782
97657
 
97658
+ // packages/device-service-core/src/unsettled-command.ts
97659
+ var DELIVERED, UnsettledCommandError;
97660
+ var init_unsettled_command = __esm(() => {
97661
+ init_errors4();
97662
+ DELIVERED = new Set(["transport_confirmed", "engine_dispatched"]);
97663
+ UnsettledCommandError = class UnsettledCommandError extends LocalApiError {
97664
+ progress;
97665
+ delivered;
97666
+ constructor(commandId, waitMs, progress) {
97667
+ const last = progress === undefined ? "" : ` (last state ${progress})`;
97668
+ super("request_timeout", `no final state for command ${commandId} within ${waitMs} ms${last}`, {
97669
+ command_id: commandId
97670
+ });
97671
+ this.name = "UnsettledCommandError";
97672
+ this.progress = progress;
97673
+ this.delivered = progress !== undefined && DELIVERED.has(progress);
97674
+ }
97675
+ };
97676
+ });
97677
+
97783
97678
  // packages/device-service-core/src/remote-attach.ts
97784
97679
  import { randomBytes as randomBytes8 } from "node:crypto";
97785
97680
  function openAttach(client, device, sessionId, timers = realTimers) {
@@ -97891,6 +97786,7 @@ function openAttach(client, device, sessionId, timers = realTimers) {
97891
97786
  return reject(new Error("the attach has ended"));
97892
97787
  const { waitMs = ATTACH_COMMAND_WAIT_MS, accepts } = options;
97893
97788
  const commandId = randomBytes8(16).toString("base64url");
97789
+ let progress;
97894
97790
  const settle = () => {
97895
97791
  stopState();
97896
97792
  cancelWait();
@@ -97905,8 +97801,10 @@ function openAttach(client, device, sessionId, timers = realTimers) {
97905
97801
  const stopState = client.onEvent((event) => {
97906
97802
  if (event.kind !== "session.command_state" || event.command_id !== commandId)
97907
97803
  return;
97908
- if (PROGRESS_STATES.has(event.state))
97804
+ if (PROGRESS_STATES.has(event.state)) {
97805
+ progress = event.state;
97909
97806
  return;
97807
+ }
97910
97808
  const response = delegated.takeReply(commandId);
97911
97809
  settle();
97912
97810
  resolve(response === undefined ? { outcome: event } : { outcome: event, response });
@@ -97914,9 +97812,7 @@ function openAttach(client, device, sessionId, timers = realTimers) {
97914
97812
  const cancelWait = timers.after(waitMs, () => {
97915
97813
  settle();
97916
97814
  delegated.forget(commandId);
97917
- reject(new LocalApiError("request_timeout", `no final state for command ${commandId} within ${waitMs} ms`, {
97918
- command_id: commandId
97919
- }));
97815
+ reject(new UnsettledCommandError(commandId, waitMs, progress));
97920
97816
  });
97921
97817
  commands.add(end);
97922
97818
  client.commandTo({ attach }, rpc, commandId, { delegated: true }, accepts === undefined ? undefined : { accepts }).catch((error) => {
@@ -97976,6 +97872,7 @@ var init_remote_attach = __esm(() => {
97976
97872
  init_delegated_channel();
97977
97873
  init_errors4();
97978
97874
  init_timers();
97875
+ init_unsettled_command();
97979
97876
  PROGRESS_STATES = new Set([
97980
97877
  "queued",
97981
97878
  "transport_confirmed",
@@ -97983,9 +97880,45 @@ var init_remote_attach = __esm(() => {
97983
97880
  ]);
97984
97881
  });
97985
97882
 
97883
+ // packages/device-service-core/src/refused-before-sending.ts
97884
+ var REFUSED_BEFORE_SENDING;
97885
+ var init_refused_before_sending = __esm(() => {
97886
+ REFUSED_BEFORE_SENDING = new Set([
97887
+ "unauthenticated",
97888
+ "client_proof_invalid",
97889
+ "invalid_request",
97890
+ "unknown_type",
97891
+ "forbidden",
97892
+ "owner_transfer",
97893
+ "signed_out",
97894
+ "device_mismatch",
97895
+ "device_changed",
97896
+ "account_changed",
97897
+ "device_key_invalid",
97898
+ "service_disabled",
97899
+ "sign_in_required",
97900
+ "plan_required",
97901
+ "activation_pending",
97902
+ "authorization_stale",
97903
+ "peer_not_found",
97904
+ "peer_not_session_client",
97905
+ "session_not_found",
97906
+ "engine_too_old",
97907
+ "not_attached",
97908
+ "command_id_conflict",
97909
+ "message_too_long",
97910
+ "upload_incomplete",
97911
+ "malformed",
97912
+ "method_unclassified",
97913
+ "method_local_only",
97914
+ "host_not_answering",
97915
+ "unsupported"
97916
+ ]);
97917
+ });
97918
+
97986
97919
  // packages/device-service-core/src/listing-rows.ts
97987
97920
  function newestRowsListing(client) {
97988
- let rows = 3;
97921
+ let rows = 4;
97989
97922
  return async function list(filter, onRevision) {
97990
97923
  for (;; ) {
97991
97924
  try {
@@ -97993,7 +97926,7 @@ function newestRowsListing(client) {
97993
97926
  } catch (error) {
97994
97927
  if (rows === undefined || !(error instanceof LocalApiError) || error.code !== "invalid_request")
97995
97928
  throw error;
97996
- rows = rows === 3 ? 2 : undefined;
97929
+ rows = rows === 4 ? 3 : rows === 3 ? 2 : undefined;
97997
97930
  }
97998
97931
  }
97999
97932
  };
@@ -98075,6 +98008,32 @@ function deviceServiceStateDir(platform = process.platform, env = process.env, h
98075
98008
  }
98076
98009
  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);
98077
98010
  var init_state_dir = () => {};
98011
+
98012
+ // packages/device-service-core/src/engine-endpoint.ts
98013
+ async function engineEndpointOf(client, device) {
98014
+ const asksPrimary = compareVersions4(client.welcome.service_version, ENDPOINT_PRIMARY_MIN_SERVICE_VERSION) >= 0;
98015
+ const listed = await client.request("session.endpoints", asksPrimary ? { device, primary: true } : { device });
98016
+ if (listed.primary !== undefined)
98017
+ return listed.primary;
98018
+ const [only, ...rest] = listed.endpoints;
98019
+ if (only === undefined)
98020
+ throw new NotSentError("unsupported", "the device lists no engine endpoint");
98021
+ if (!asksPrimary && rest.length === 0)
98022
+ return only;
98023
+ throw new NoPrimaryEndpointError(device, listed.endpoints.length);
98024
+ }
98025
+ var ENDPOINT_PRIMARY_MIN_SERVICE_VERSION = "0.1.11", NoPrimaryEndpointError;
98026
+ var init_engine_endpoint = __esm(() => {
98027
+ init_not_sent_error();
98028
+ init_version2();
98029
+ NoPrimaryEndpointError = class NoPrimaryEndpointError extends NotSentError {
98030
+ constructor(device, listed) {
98031
+ super("unsupported", `${device} lists ${listed} engine endpoint(s) and names none as its own engine; nothing was opened`, {
98032
+ action: `Start or restart omo on ${device}; if that does not help, update the device service on both devices.`
98033
+ });
98034
+ }
98035
+ };
98036
+ });
98078
98037
  // packages/device-service-core/src/local-api/protocol.ts
98079
98038
  var init_protocol = __esm(() => {
98080
98039
  init_vocabulary();
@@ -98084,13 +98043,13 @@ var init_protocol = __esm(() => {
98084
98043
  // packages/device-service-core/src/device-service.ts
98085
98044
  import { join as join124 } from "node:path";
98086
98045
  import { randomBytes as randomBytes9 } from "node:crypto";
98087
- function sendToEndpoint(client, device, endpoint, rpc, locate, timers) {
98046
+ function sendToEndpoint(client, device, endpoint, rpc, locate, timers, waitMs) {
98088
98047
  return followDelegatedCommand(client, device, timers, (commandId) => {
98089
98048
  const send = (asked) => client.commandTo({ device, endpoint }, rpc, commandId, asked ? { locate: true } : {});
98090
98049
  return send(locate).catch((error) => locate && error instanceof LocalApiError && error.code === "invalid_request" ? send(false) : Promise.reject(error));
98091
- });
98050
+ }, waitMs);
98092
98051
  }
98093
- function followDelegatedCommand(client, device, timers, send) {
98052
+ function followDelegatedCommand(client, device, timers, send, waitMs = ENDPOINT_COMMAND_WAIT_MS) {
98094
98053
  return new Promise((resolve, reject) => {
98095
98054
  const commandId = randomBytes9(16).toString("base64url");
98096
98055
  const channel = followDelegatedChannel(device);
@@ -98122,7 +98081,7 @@ function followDelegatedCommand(client, device, timers, send) {
98122
98081
  ...located === undefined ? {} : { located }
98123
98082
  });
98124
98083
  });
98125
- const cancelTimer = timers.after(ENDPOINT_COMMAND_WAIT_MS, () => fail(new Error(`no final state for endpoint command ${commandId} within ${ENDPOINT_COMMAND_WAIT_MS} ms`)));
98084
+ const cancelTimer = timers.after(waitMs, () => fail(new Error(`no final state for endpoint command ${commandId} within ${waitMs} ms`)));
98126
98085
  client.closed.then(() => fail(new Error("the connection closed before the endpoint command settled")));
98127
98086
  send(commandId).catch(fail);
98128
98087
  });
@@ -98195,16 +98154,38 @@ async function connectDeviceService(options) {
98195
98154
  };
98196
98155
  },
98197
98156
  endpointCommand: async (device, rpc, options) => {
98198
- let endpoint;
98199
- try {
98200
- endpoint = (await client.request("session.endpoints", { device })).endpoints[0];
98201
- } catch (error) {
98202
- throw markNotSent(error);
98157
+ const started = timers.now();
98158
+ let endpoint = options?.endpoint;
98159
+ if (endpoint === undefined) {
98160
+ const lookup = engineEndpointOf(client, device);
98161
+ const waitMs = options?.waitMs;
98162
+ const bounded = waitMs === undefined ? lookup : new Promise((resolve, reject) => {
98163
+ const cancel = timers.after(waitMs, () => reject(new NotSentError("request_timeout", "the wait ran out during the endpoint lookup; nothing was sent")));
98164
+ lookup.then((answer) => {
98165
+ cancel();
98166
+ resolve(answer);
98167
+ }, (error) => {
98168
+ cancel();
98169
+ reject(error);
98170
+ });
98171
+ });
98172
+ try {
98173
+ endpoint = await bounded;
98174
+ } catch (error) {
98175
+ throw markNotSent(error);
98176
+ }
98203
98177
  }
98204
- if (endpoint === undefined)
98205
- throw new NotSentError("unsupported", "the device lists no engine endpoint");
98206
- return await sendToEndpoint(client, device, endpoint, rpc, options?.locate === true, timers);
98178
+ const waitMs = options?.waitMs === undefined ? undefined : options.waitMs - (timers.now() - started);
98179
+ if (waitMs !== undefined && waitMs <= 0)
98180
+ throw new NotSentError("request_timeout", "the wait ran out during the endpoint lookup; nothing was sent");
98181
+ return {
98182
+ ...await sendToEndpoint(client, device, endpoint, rpc, options?.locate === true, timers, waitMs),
98183
+ endpoint
98184
+ };
98207
98185
  },
98186
+ sessionCommand: (device, key, rpc, options) => followDelegatedCommand(client, device, timers, (commandId) => client.commandTo({ session: `${device}.${key}` }, rpc, commandId).catch((error) => {
98187
+ throw error instanceof LocalApiError && error.command_id === undefined ? markNotSent(error) : error;
98188
+ }), options?.waitMs),
98208
98189
  close: () => client.close(),
98209
98190
  closed: client.closed,
98210
98191
  locate: (device, engineId, options) => client.request("session.locate", {
@@ -98212,16 +98193,16 @@ async function connectDeviceService(options) {
98212
98193
  engine_id: engineId,
98213
98194
  ...options?.single === true && takesSingleLocate ? { single: true } : {}
98214
98195
  }),
98215
- wakeCommand: async (device, durableId, rpc) => {
98196
+ wakeCommand: async (device, durableId, rpc, options) => {
98216
98197
  if (!carriesWakeMark)
98217
98198
  throw olderThanWakeMinimum(client.welcome.service_version, wakeMarkMinimum);
98218
98199
  return await followDelegatedCommand(client, device, timers, (commandId) => client.commandTo({ wake: { device, durable_id: durableId } }, rpc, commandId).catch((error) => {
98219
- throw error instanceof LocalApiError && error.command_id === undefined ? markNotSent(error) : error;
98220
- }));
98200
+ throw error instanceof LocalApiError && error.command_id === undefined && REFUSED_BEFORE_SENDING.has(error.code) ? markNotSent(error) : error;
98201
+ }), options?.waitMs);
98221
98202
  }
98222
98203
  };
98223
98204
  }
98224
- 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;
98205
+ 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;
98225
98206
  var init_device_service2 = __esm(() => {
98226
98207
  init_access();
98227
98208
  init_client4();
@@ -98231,15 +98212,22 @@ var init_device_service2 = __esm(() => {
98231
98212
  init_remote_attach();
98232
98213
  init_delegated_channel();
98233
98214
  init_errors4();
98215
+ init_refused_before_sending();
98234
98216
  init_listing_rows();
98235
98217
  init_version2();
98236
98218
  init_state_dir();
98219
+ init_engine_endpoint();
98237
98220
  init_timers();
98238
98221
  init_errors4();
98222
+ init_refused_before_sending();
98239
98223
  init_not_sent_error();
98224
+ init_engine_endpoint();
98240
98225
  init_protocol();
98226
+ init_unsettled_command();
98241
98227
  init_state_dir();
98242
98228
  init_timers();
98229
+ UPDATE_IN_FLIGHT_MAX_MS = 15 * 60000;
98230
+ UPDATE_IN_FLIGHT = new Set(["pending", "trial"]);
98243
98231
  });
98244
98232
 
98245
98233
  // node_modules/.bun/typebox@1.3.34/node_modules/typebox/build/system/memory/metrics.mjs
@@ -103775,6 +103763,15 @@ var init_permission_presets = __esm(() => {
103775
103763
  PERMISSION_PRESETS = ["full-access", "workspace", "accept-edits", "auto", "read-only", "ask"];
103776
103764
  });
103777
103765
  // packages/omo-senpi/src/components/thread/errors.ts
103766
+ function isThreadErrorCode(value) {
103767
+ return typeof value === "string" && CODE_SET.has(value);
103768
+ }
103769
+ function threadToolFailure(code, message, nextAction, details) {
103770
+ if (!isThreadErrorCode(code)) {
103771
+ throw new Error(`unknown thread error code: ${String(code)}`);
103772
+ }
103773
+ return { code, message, next_action: nextAction, ...details === undefined ? {} : { details } };
103774
+ }
103778
103775
  var THREAD_ERROR_CODES, CODE_SET;
103779
103776
  var init_errors5 = __esm(() => {
103780
103777
  THREAD_ERROR_CODES = [
@@ -103790,6 +103787,7 @@ var init_errors5 = __esm(() => {
103790
103787
  "foreign_live_owner",
103791
103788
  "no_active_turn",
103792
103789
  "turn_conflict",
103790
+ "turn_active",
103793
103791
  "not_steerable",
103794
103792
  "message_too_large",
103795
103793
  "queue_full",
@@ -103798,6 +103796,7 @@ var init_errors5 = __esm(() => {
103798
103796
  "idempotency_conflict",
103799
103797
  "idempotency_in_progress",
103800
103798
  "idempotency_uncertain",
103799
+ "delivered_unconfirmed",
103801
103800
  "approval_unavailable",
103802
103801
  "approval_route_locked",
103803
103802
  "partial_commit",
@@ -103810,6 +103809,7 @@ var init_errors5 = __esm(() => {
103810
103809
  "model_ambiguous",
103811
103810
  "thinking_level_unsupported",
103812
103811
  "loop_detected",
103812
+ "chain_count_limit",
103813
103813
  "binding_conflict",
103814
103814
  "binding_mismatch",
103815
103815
  "binding_inactive",
@@ -103819,7 +103819,8 @@ var init_errors5 = __esm(() => {
103819
103819
  "answer_in_progress",
103820
103820
  "device_offline",
103821
103821
  "relay_requires_paid_plan",
103822
- "alias_taken"
103822
+ "alias_taken",
103823
+ "gateway_schema_too_new"
103823
103824
  ];
103824
103825
  CODE_SET = new Set(THREAD_ERROR_CODES);
103825
103826
  });
@@ -103828,7 +103829,7 @@ var init_errors5 = __esm(() => {
103828
103829
  var init_initial_skills = () => {};
103829
103830
 
103830
103831
  // packages/omo-senpi/src/components/thread/remote/outcome.ts
103831
- var READ_UNCERTAIN, UNANSWERED;
103832
+ var READ_UNCERTAIN, UNANSWERED, NOT_SIGNED_IN;
103832
103833
  var init_outcome = __esm(() => {
103833
103834
  init_errors5();
103834
103835
  READ_UNCERTAIN = {
@@ -103854,11 +103855,13 @@ var init_outcome = __esm(() => {
103854
103855
  "handshake_timeout",
103855
103856
  "attach_failed",
103856
103857
  "reply_lost",
103858
+ "delivered_unconfirmed",
103857
103859
  "host_not_answering",
103858
103860
  "peer_not_found",
103859
103861
  "engine_stale",
103860
103862
  ...Object.entries(READ_UNCERTAIN).filter(([, answer]) => answer === "retry").map(([reason]) => reason)
103861
103863
  ]);
103864
+ NOT_SIGNED_IN = new Set(["sign_in_required", "signed_out"]);
103862
103865
  });
103863
103866
  // packages/omo-senpi/src/components/thread/remote/remote-ops.ts
103864
103867
  var init_remote_ops = __esm(() => {
@@ -103879,6 +103882,7 @@ var init_close_ladder = __esm(() => {
103879
103882
  init_port();
103880
103883
  SESSION_GONE = new Set([
103881
103884
  "unknown_session",
103885
+ "route_unlisted",
103882
103886
  "session_identity_mismatch",
103883
103887
  "session_not_attached",
103884
103888
  "not_attached"
@@ -103913,162 +103917,6 @@ var init_thread_link = __esm(() => {
103913
103917
  PREFIX = `${THREAD_LINK_SCHEME}://v1/`;
103914
103918
  });
103915
103919
 
103916
- // packages/omo-senpi/src/components/thread/remote/address-book.ts
103917
- var REMOTE_NOT_SET_UP;
103918
- var init_address_book = __esm(() => {
103919
- init_remote_ops();
103920
- REMOTE_NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
103921
- });
103922
-
103923
- // packages/omo-senpi/src/components/thread/addressing.ts
103924
- var init_addressing = __esm(() => {
103925
- init_errors5();
103926
- });
103927
-
103928
- // packages/omo-senpi/src/components/thread/session-facts.ts
103929
- var SESSION_FACTS_WINDOW_BYTES, SESSION_FACTS_LAST_LINE_MAX_BYTES;
103930
- var init_session_facts = __esm(() => {
103931
- SESSION_FACTS_WINDOW_BYTES = 64 * 1024;
103932
- SESSION_FACTS_LAST_LINE_MAX_BYTES = SESSION_FACTS_WINDOW_BYTES * 4;
103933
- });
103934
-
103935
- // packages/omo-senpi/src/components/thread/address-book.ts
103936
- var init_address_book2 = __esm(() => {
103937
- init_addressing();
103938
- init_session_facts();
103939
- });
103940
-
103941
- // packages/omo-senpi/src/components/thread/metadata.ts
103942
- var THREAD_TOOL_EXPOSURE = "eval", ROUTE_TO_TASK = "; to spawn a child task instead, use task.", THREAD_TOOL_METADATA;
103943
- var init_metadata = __esm(() => {
103944
- THREAD_TOOL_METADATA = [
103945
- {
103946
- name: "thread_create",
103947
- label: "Create session",
103948
- 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,
103949
- exposure: THREAD_TOOL_EXPOSURE
103950
- },
103951
- {
103952
- name: "thread_list",
103953
- label: "List sessions",
103954
- 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,
103955
- exposure: THREAD_TOOL_EXPOSURE
103956
- },
103957
- {
103958
- name: "thread_read",
103959
- label: "Read session",
103960
- description: "Returns the transcript and latest output of another session, for when the user asks what another session said or produced" + ROUTE_TO_TASK,
103961
- exposure: THREAD_TOOL_EXPOSURE
103962
- },
103963
- {
103964
- name: "thread_send",
103965
- label: "Send message to session",
103966
- 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,
103967
- exposure: THREAD_TOOL_EXPOSURE
103968
- },
103969
- {
103970
- name: "thread_interrupt",
103971
- label: "Interrupt session turn",
103972
- 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,
103973
- exposure: THREAD_TOOL_EXPOSURE
103974
- },
103975
- {
103976
- name: "thread_close",
103977
- label: "Close session",
103978
- 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,
103979
- exposure: THREAD_TOOL_EXPOSURE
103980
- },
103981
- {
103982
- name: "thread_handoff",
103983
- label: "Hand off session",
103984
- 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,
103985
- exposure: THREAD_TOOL_EXPOSURE
103986
- },
103987
- {
103988
- name: "thread_rename",
103989
- label: "Rename session",
103990
- 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",
103991
- exposure: THREAD_TOOL_EXPOSURE
103992
- },
103993
- {
103994
- name: "thread_set_model",
103995
- label: "Switch session model",
103996
- description: "Moves a session onto a different model, for when the user asks to switch that session to another model or a cheaper one",
103997
- exposure: THREAD_TOOL_EXPOSURE
103998
- },
103999
- {
104000
- name: "thread_set_reasoning",
104001
- label: "Set session reasoning level",
104002
- description: "Sets how much reasoning a session applies, for when the user asks to raise or lower the thinking effort of a session",
104003
- exposure: THREAD_TOOL_EXPOSURE
104004
- },
104005
- {
104006
- name: "thread_report",
104007
- label: "Report to chat thread",
104008
- 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())",
104009
- exposure: THREAD_TOOL_EXPOSURE
104010
- },
104011
- {
104012
- name: "thread_outbox",
104013
- label: "Read chat outbox",
104014
- description: "Returns the reports waiting for a bound chat thread with a cursor, for when a connector collects what sessions posted",
104015
- exposure: THREAD_TOOL_EXPOSURE
104016
- },
104017
- {
104018
- name: "thread_outbox_ack",
104019
- label: "Acknowledge chat outbox",
104020
- description: "Marks outbox rows up to a cursor as posted to the chat, for when a connector confirms delivery",
104021
- exposure: THREAD_TOOL_EXPOSURE
104022
- },
104023
- {
104024
- name: "thread_answer",
104025
- label: "Answer relayed question",
104026
- 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",
104027
- exposure: THREAD_TOOL_EXPOSURE
104028
- }
104029
- ];
104030
- });
104031
- // packages/omo-senpi/src/components/thread/tools/internals.ts
104032
- var init_internals = __esm(() => {
104033
- init_address_book();
104034
- init_remote_ops();
104035
- init_address_book2();
104036
- init_addressing();
104037
- init_errors5();
104038
- init_metadata();
104039
- init_session_facts();
104040
- init_thread_link();
104041
- });
104042
-
104043
- // packages/omo-senpi/src/components/thread/control/session-host.ts
104044
- var init_session_host = __esm(() => {
104045
- init_internals();
104046
- });
104047
-
104048
- // packages/omo-senpi/src/components/thread/control/relay-session-host.ts
104049
- var init_relay_session_host = __esm(() => {
104050
- init_errors5();
104051
- init_initial_skills();
104052
- init_outcome();
104053
- init_remote_ops();
104054
- init_remote_worktree();
104055
- init_open_reply();
104056
- init_thread_link();
104057
- init_session_host();
104058
- });
104059
-
104060
- // packages/omo-senpi/src/components/thread/tools/model-match.ts
104061
- var init_model_match = __esm(() => {
104062
- init_internals();
104063
- });
104064
-
104065
- // packages/omo-senpi/src/components/thread/control/operations.ts
104066
- var init_operations = __esm(() => {
104067
- init_internals();
104068
- init_model_match();
104069
- init_port();
104070
- });
104071
-
104072
103920
  // packages/omo-senpi/src/components/thread/contracts/create-params.ts
104073
103921
  var ThreadCreateParams;
104074
103922
  var init_create_params = __esm(() => {
@@ -104137,7 +103985,7 @@ var init_create_params = __esm(() => {
104137
103985
  });
104138
103986
 
104139
103987
  // packages/omo-senpi/src/components/thread/contracts/params.ts
104140
- var ThreadListParams, THREAD_READ_WAIT_MAX_MS = 600000, ThreadReadParams, ThreadSendParams, ThreadInterruptParams, SelfOrThread, ThreadCloseParams, ThreadHandoffParams, ThreadRenameParams, ThreadSetModelParams, ThreadSetReasoningParams, ThreadReportParams, ThreadOutboxParams, ThreadOutboxAckParams, ThreadAnswerParams;
103988
+ var ThreadListParams, THREAD_READ_WAIT_MAX_MS = 600000, ThreadReadParams, ThreadSendParams, ThreadInterruptParams, SelfOrThread, ThreadCloseParams, ThreadHandoffParams, ThreadRenameParams, ThreadSetModelParams, ThreadSetReasoningParams, ThreadArchiveParams, ThreadReportParams, ThreadOutboxParams, ThreadOutboxAckParams, ThreadAnswerParams;
104141
103989
  var init_params = __esm(() => {
104142
103990
  init_build();
104143
103991
  init_fields();
@@ -104145,12 +103993,16 @@ var init_params = __esm(() => {
104145
103993
  ThreadListParams = _Object_({
104146
103994
  all_scope: Optional(Boolean2({
104147
103995
  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."
103996
+ })),
103997
+ state: Optional(_Array_(Union([Literal("running"), Literal("idle"), Literal("inactive"), Literal("archived")]), {
103998
+ minItems: 1,
103999
+ description: "Thread states to list: running, idle, inactive (no engine holds it) or archived; the default lists every state but archived."
104148
104000
  }))
104149
104001
  });
104150
104002
  ThreadReadParams = _Object_({
104151
104003
  thread: ThreadAddress,
104152
104004
  cursor: Optional(String2({
104153
- 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."
104005
+ 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."
104154
104006
  })),
104155
104007
  max_bytes: Optional(Integer({
104156
104008
  minimum: 1,
@@ -104187,7 +104039,10 @@ var init_params = __esm(() => {
104187
104039
  ThreadCloseParams = _Object_({
104188
104040
  thread: SelfOrThread,
104189
104041
  idempotency_key: IdempotencyKey,
104190
- all_scope: AllScope
104042
+ all_scope: AllScope,
104043
+ force: Optional(Boolean2({
104044
+ description: "Close even when the thread has messages it has not read yet; they are dropped and listed in dropped_deliveries."
104045
+ }))
104191
104046
  });
104192
104047
  ThreadHandoffParams = _Object_({
104193
104048
  thread: String2({
@@ -104239,6 +104094,14 @@ var init_params = __esm(() => {
104239
104094
  all_scope: AllScope,
104240
104095
  idempotency_key: IdempotencyKey
104241
104096
  });
104097
+ ThreadArchiveParams = _Object_({
104098
+ thread: ThreadAddress,
104099
+ archived: Optional(Boolean2({
104100
+ 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."
104101
+ })),
104102
+ all_scope: AllScope,
104103
+ idempotency_key: IdempotencyKey
104104
+ });
104242
104105
  ThreadReportParams = _Object_({
104243
104106
  binding_id: Optional(String2({
104244
104107
  minLength: 1,
@@ -108779,11 +108642,209 @@ var init_parse6 = __esm(() => {
108779
108642
  init_value2();
108780
108643
  init_errors5();
108781
108644
  });
108645
+
108646
+ // packages/omo-senpi/src/components/thread/contracts/state.ts
108647
+ var THREAD_ACTIVITIES;
108648
+ var init_state2 = __esm(() => {
108649
+ THREAD_ACTIVITIES = ["idle", "running", "awaiting_approval", "queued", "errored"];
108650
+ });
108651
+
108652
+ // packages/omo-senpi/src/components/thread/contracts/results.ts
108653
+ var init_results = __esm(() => {
108654
+ init_state2();
108655
+ });
108656
+
108782
108657
  // packages/omo-senpi/src/components/thread/contracts/index.ts
108783
108658
  var init_contracts = __esm(() => {
108784
108659
  init_fields();
108785
108660
  init_params();
108786
108661
  init_parse6();
108662
+ init_results();
108663
+ });
108664
+
108665
+ // packages/omo-senpi/src/components/thread/tools/thread-state.ts
108666
+ var ACTIVITIES;
108667
+ var init_thread_state = __esm(() => {
108668
+ init_contracts();
108669
+ ACTIVITIES = new Set(THREAD_ACTIVITIES);
108670
+ });
108671
+
108672
+ // packages/omo-senpi/src/components/thread/remote/address-book.ts
108673
+ var lastListed, REMOTE_NOT_SET_UP;
108674
+ var init_address_book = __esm(() => {
108675
+ init_errors5();
108676
+ init_remote_ops();
108677
+ lastListed = new WeakMap;
108678
+ REMOTE_NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
108679
+ });
108680
+
108681
+ // packages/omo-senpi/src/components/thread/addressing.ts
108682
+ var init_addressing = __esm(() => {
108683
+ init_errors5();
108684
+ });
108685
+
108686
+ // packages/omo-senpi/src/components/thread/session-facts.ts
108687
+ var SESSION_FACTS_WINDOW_BYTES, SESSION_FACTS_LAST_LINE_MAX_BYTES;
108688
+ var init_session_facts = __esm(() => {
108689
+ SESSION_FACTS_WINDOW_BYTES = 64 * 1024;
108690
+ SESSION_FACTS_LAST_LINE_MAX_BYTES = SESSION_FACTS_WINDOW_BYTES * 4;
108691
+ });
108692
+
108693
+ // packages/omo-senpi/src/components/thread/address-book.ts
108694
+ var init_address_book2 = __esm(() => {
108695
+ init_addressing();
108696
+ init_session_facts();
108697
+ });
108698
+
108699
+ // packages/omo-senpi/src/components/thread/metadata.ts
108700
+ var THREAD_TOOL_EXPOSURE = "eval", ROUTE_TO_TASK = "; to spawn a child task instead, use task.", THREAD_TOOL_METADATA;
108701
+ var init_metadata = __esm(() => {
108702
+ THREAD_TOOL_METADATA = [
108703
+ {
108704
+ name: "thread_create",
108705
+ label: "Create session",
108706
+ 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,
108707
+ exposure: THREAD_TOOL_EXPOSURE
108708
+ },
108709
+ {
108710
+ name: "thread_list",
108711
+ label: "List sessions",
108712
+ 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,
108713
+ exposure: THREAD_TOOL_EXPOSURE
108714
+ },
108715
+ {
108716
+ name: "thread_read",
108717
+ label: "Read session",
108718
+ description: "Returns the transcript and latest output of another session, for when the user asks what another session said or produced" + ROUTE_TO_TASK,
108719
+ exposure: THREAD_TOOL_EXPOSURE
108720
+ },
108721
+ {
108722
+ name: "thread_send",
108723
+ label: "Send message to session",
108724
+ 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,
108725
+ exposure: THREAD_TOOL_EXPOSURE
108726
+ },
108727
+ {
108728
+ name: "thread_interrupt",
108729
+ label: "Interrupt session turn",
108730
+ 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,
108731
+ exposure: THREAD_TOOL_EXPOSURE
108732
+ },
108733
+ {
108734
+ name: "thread_close",
108735
+ label: "Close session",
108736
+ 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,
108737
+ exposure: THREAD_TOOL_EXPOSURE
108738
+ },
108739
+ {
108740
+ name: "thread_handoff",
108741
+ label: "Hand off session",
108742
+ 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,
108743
+ exposure: THREAD_TOOL_EXPOSURE
108744
+ },
108745
+ {
108746
+ name: "thread_rename",
108747
+ label: "Rename session",
108748
+ 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",
108749
+ exposure: THREAD_TOOL_EXPOSURE
108750
+ },
108751
+ {
108752
+ name: "thread_set_model",
108753
+ label: "Switch session model",
108754
+ description: "Moves a session onto a different model, for when the user asks to switch that session to another model or a cheaper one",
108755
+ exposure: THREAD_TOOL_EXPOSURE
108756
+ },
108757
+ {
108758
+ name: "thread_set_reasoning",
108759
+ label: "Set session reasoning level",
108760
+ description: "Sets how much reasoning a session applies, for when the user asks to raise or lower the thinking effort of a session",
108761
+ exposure: THREAD_TOOL_EXPOSURE
108762
+ },
108763
+ {
108764
+ name: "thread_archive",
108765
+ label: "Archive session",
108766
+ 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",
108767
+ exposure: THREAD_TOOL_EXPOSURE
108768
+ },
108769
+ {
108770
+ name: "thread_report",
108771
+ label: "Report to chat thread",
108772
+ 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())",
108773
+ exposure: THREAD_TOOL_EXPOSURE
108774
+ },
108775
+ {
108776
+ name: "thread_outbox",
108777
+ label: "Read chat outbox",
108778
+ description: "Returns the reports waiting for a bound chat thread with a cursor, for when a connector collects what sessions posted",
108779
+ exposure: THREAD_TOOL_EXPOSURE
108780
+ },
108781
+ {
108782
+ name: "thread_outbox_ack",
108783
+ label: "Acknowledge chat outbox",
108784
+ description: "Marks outbox rows up to a cursor as posted to the chat, for when a connector confirms delivery",
108785
+ exposure: THREAD_TOOL_EXPOSURE
108786
+ },
108787
+ {
108788
+ name: "thread_answer",
108789
+ label: "Answer relayed question",
108790
+ 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",
108791
+ exposure: THREAD_TOOL_EXPOSURE
108792
+ }
108793
+ ];
108794
+ });
108795
+ // packages/omo-senpi/src/components/thread/tools/internals.ts
108796
+ function failure3(code, message, next, details) {
108797
+ return { kind: "error", error: threadToolFailure(code, message, next, details) };
108798
+ }
108799
+ var init_internals = __esm(() => {
108800
+ init_address_book();
108801
+ init_remote_ops();
108802
+ init_address_book2();
108803
+ init_addressing();
108804
+ init_errors5();
108805
+ init_metadata();
108806
+ init_session_facts();
108807
+ init_thread_link();
108808
+ init_thread_state();
108809
+ });
108810
+
108811
+ // packages/omo-senpi/src/components/thread/control/session-host.ts
108812
+ var init_session_host = __esm(() => {
108813
+ init_internals();
108814
+ });
108815
+
108816
+ // packages/omo-senpi/src/components/thread/control/relay-session-host.ts
108817
+ var init_relay_session_host = __esm(() => {
108818
+ init_errors5();
108819
+ init_initial_skills();
108820
+ init_outcome();
108821
+ init_remote_ops();
108822
+ init_remote_worktree();
108823
+ init_open_reply();
108824
+ init_thread_link();
108825
+ init_thread_state();
108826
+ init_session_host();
108827
+ });
108828
+
108829
+ // packages/omo-senpi/src/components/thread/tools/model-match.ts
108830
+ var init_model_match = __esm(() => {
108831
+ init_internals();
108832
+ });
108833
+
108834
+ // packages/omo-senpi/src/components/thread/control/operations.ts
108835
+ var NOT_LIVE;
108836
+ var init_operations = __esm(() => {
108837
+ init_internals();
108838
+ init_model_match();
108839
+ init_port();
108840
+ NOT_LIVE = failure3("not_resumable", "The thread has no live owner.", "Retry when the target is live.");
108841
+ });
108842
+
108843
+ // packages/omo-senpi/src/components/call-budget/call-deadline.ts
108844
+ import { AsyncLocalStorage as AsyncLocalStorage4 } from "node:async_hooks";
108845
+ var scope;
108846
+ var init_call_deadline = __esm(() => {
108847
+ scope = new AsyncLocalStorage4;
108787
108848
  });
108788
108849
  // packages/omo-senpi/src/components/thread/reader.ts
108789
108850
  var init_reader = __esm(() => {
@@ -108838,12 +108899,20 @@ var init_wait_settled = __esm(() => {
108838
108899
  "tool_execution_update",
108839
108900
  "tool_execution_end",
108840
108901
  "turn_end",
108841
- "agent_end"
108902
+ "agent_end",
108903
+ "auto_retry_start",
108904
+ "auto_retry_end"
108842
108905
  ]);
108843
108906
  });
108844
108907
 
108908
+ // packages/omo-senpi/src/components/thread/tools/thread-row.ts
108909
+ var init_thread_row = __esm(() => {
108910
+ init_thread_link();
108911
+ });
108912
+
108845
108913
  // packages/omo-senpi/src/components/thread/control/relay-control.ts
108846
108914
  var init_relay_control = __esm(() => {
108915
+ init_call_deadline();
108847
108916
  init_address_book();
108848
108917
  init_outcome();
108849
108918
  init_transcript_tail();
@@ -108852,10 +108921,15 @@ var init_relay_control = __esm(() => {
108852
108921
  init_close_ladder();
108853
108922
  init_port();
108854
108923
  init_wait_settled();
108924
+ init_relay_session_host();
108925
+ init_thread_row();
108855
108926
  });
108856
108927
 
108857
108928
  // packages/omo-senpi/src/components/thread/remote/attach-pool.ts
108858
- var init_attach_pool = () => {};
108929
+ var CATALOG_RECORD = "get_available_models", HELD_RECORDS;
108930
+ var init_attach_pool = __esm(() => {
108931
+ HELD_RECORDS = new Set([CATALOG_RECORD, "get_protocol_info"]);
108932
+ });
108859
108933
 
108860
108934
  // packages/omo-senpi/src/components/thread/remote/session-state.ts
108861
108935
  var ACCESS_ENDED, ACCESS_REFUSED, SESSION_LEFT, SESSION_GONE2;
@@ -108893,46 +108967,20 @@ var init_remote_watch = __esm(() => {
108893
108967
  init_device_service2();
108894
108968
  init_session_state();
108895
108969
  });
108896
-
108897
108970
  // packages/omo-senpi/src/components/remote/port/device-service.ts
108898
- var REFUSED_BEFORE_SENDING, READ_ONLY_RECORDS, MARKED_RECORDS, LOOKUP_NONE;
108971
+ var READ_ONLY_RECORDS, MARKED_RECORDS, LOOKUP_NONE;
108899
108972
  var init_device_service3 = __esm(() => {
108900
108973
  init_outcome();
108901
108974
  init_device_service2();
108902
108975
  init_attach_pool();
108903
108976
  init_remote_watch();
108904
- REFUSED_BEFORE_SENDING = new Set([
108905
- "unauthenticated",
108906
- "client_proof_invalid",
108907
- "invalid_request",
108908
- "unknown_type",
108909
- "forbidden",
108910
- "owner_transfer",
108911
- "signed_out",
108912
- "device_mismatch",
108913
- "device_changed",
108914
- "account_changed",
108915
- "device_key_invalid",
108916
- "service_disabled",
108917
- "sign_in_required",
108918
- "plan_required",
108919
- "activation_pending",
108920
- "authorization_stale",
108921
- "peer_not_found",
108922
- "peer_not_session_client",
108923
- "session_not_found",
108924
- "engine_too_old",
108925
- "not_attached",
108926
- "command_id_conflict",
108927
- "message_too_long",
108928
- "upload_incomplete",
108929
- "malformed",
108930
- "method_unclassified",
108931
- "method_local_only",
108932
- "host_not_answering",
108933
- "unsupported"
108977
+ init_call_deadline();
108978
+ READ_ONLY_RECORDS = new Set([
108979
+ "get_state",
108980
+ "get_messages",
108981
+ "get_entries",
108982
+ "get_protocol_info"
108934
108983
  ]);
108935
- READ_ONLY_RECORDS = new Set(["get_state", "get_messages", "get_entries"]);
108936
108984
  MARKED_RECORDS = new Set(["admit_external_message"]);
108937
108985
  LOOKUP_NONE = new Set(["session_not_found", "peer_not_found", "peer_not_session_client"]);
108938
108986
  });
@@ -108971,6 +109019,12 @@ var init_codes = __esm(() => {
108971
109019
  ]);
108972
109020
  });
108973
109021
 
109022
+ // packages/omo-senpi/src/components/remote/connection-of.ts
109023
+ var lenders;
109024
+ var init_connection_of = __esm(() => {
109025
+ lenders = new WeakMap;
109026
+ });
109027
+
108974
109028
  // packages/omo-senpi/src/components/remote/deadlines.ts
108975
109029
  var init_deadlines = __esm(() => {
108976
109030
  init_codes();
@@ -109043,6 +109097,21 @@ var init_result2 = __esm(() => {
109043
109097
  init_errors5();
109044
109098
  });
109045
109099
 
109100
+ // packages/omo-senpi/src/components/thread/remote/find-session.ts
109101
+ var NO_FIND_SESSION;
109102
+ var init_find_session = __esm(() => {
109103
+ init_errors5();
109104
+ init_outcome();
109105
+ init_remote_ops();
109106
+ NO_FIND_SESSION = new Set([
109107
+ "method_unclassified",
109108
+ "unknown_command",
109109
+ "unknown_type",
109110
+ "unsupported",
109111
+ "find_session_unsupported"
109112
+ ]);
109113
+ });
109114
+
109046
109115
  // packages/omo-senpi/src/components/thread/remote/relay-transport.ts
109047
109116
  var ADMIT_UNSUPPORTED, WAITS;
109048
109117
  var init_relay_transport = __esm(() => {
@@ -109052,6 +109121,8 @@ var init_relay_transport = __esm(() => {
109052
109121
  init_result2();
109053
109122
  init_remote_ops();
109054
109123
  init_outcome();
109124
+ init_find_session();
109125
+ init_call_deadline();
109055
109126
  ADMIT_UNSUPPORTED = new Set([
109056
109127
  "method_unclassified",
109057
109128
  "delegation_unclassified",
@@ -109101,6 +109172,7 @@ var init_unknown_device = __esm(() => {
109101
109172
 
109102
109173
  // packages/omo-senpi/src/components/remote/client.ts
109103
109174
  var init_client5 = __esm(() => {
109175
+ init_connection_of();
109104
109176
  init_device_service2();
109105
109177
  init_aliases();
109106
109178
  init_attach();
@@ -109113,9 +109185,24 @@ var init_client5 = __esm(() => {
109113
109185
  init_unknown_device();
109114
109186
  });
109115
109187
 
109116
- // packages/omo-senpi/src/components/thread/tools/thread-row.ts
109117
- var init_thread_row = __esm(() => {
109118
- init_thread_link();
109188
+ // packages/omo-senpi/src/components/remote/factories.ts
109189
+ var init_factories = __esm(() => {
109190
+ init_client5();
109191
+ });
109192
+
109193
+ // packages/omo-senpi/src/components/thread/remote/plan-create.ts
109194
+ var ALIASES_UNAVAILABLE;
109195
+ var init_plan_create = __esm(() => {
109196
+ init_addressing();
109197
+ init_relay_session_host();
109198
+ init_errors5();
109199
+ init_thread_row();
109200
+ init_find_session();
109201
+ init_remote_ops();
109202
+ ALIASES_UNAVAILABLE = {
109203
+ kind: "error",
109204
+ 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.")
109205
+ };
109119
109206
  });
109120
109207
 
109121
109208
  // packages/omo-opencode/src/cli/cli-program.ts
@@ -124681,8 +124768,8 @@ var package_default3 = {
124681
124768
  },
124682
124769
  dependencies: {
124683
124770
  "@clack/prompts": "^1.8.1",
124684
- "@code-yeongyu/senpi": "2026.11.18",
124685
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.18",
124771
+ "@code-yeongyu/senpi": "2026.11.18-3",
124772
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.18-3",
124686
124773
  "@modelcontextprotocol/sdk": "^1.30.0",
124687
124774
  "@oh-my-opencode/agents-md-core": "workspace:*",
124688
124775
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -127938,7 +128025,135 @@ import { createHash as createHash10 } from "node:crypto";
127938
128025
 
127939
128026
  // packages/memory-core/src/sync/item/machine-id.ts
127940
128027
  import { execFile as execFile7 } from "node:child_process";
127941
- init_resilient();
128028
+
128029
+ // packages/memory-core/src/fs/resilient.ts
128030
+ import * as fsSync from "node:fs";
128031
+ import * as fsp from "node:fs/promises";
128032
+
128033
+ // packages/memory-core/src/fs/retry.ts
128034
+ var EINTR_RETRY_CAP = 128;
128035
+ function fsErrorCode(error) {
128036
+ if (!(error instanceof Error) || !("code" in error))
128037
+ return;
128038
+ return typeof error.code === "string" ? error.code : undefined;
128039
+ }
128040
+ async function retryOnEintr(operation) {
128041
+ for (let attempt = 0;; attempt += 1) {
128042
+ try {
128043
+ return await operation();
128044
+ } catch (error) {
128045
+ if (fsErrorCode(error) !== "EINTR" || attempt >= EINTR_RETRY_CAP)
128046
+ throw error;
128047
+ }
128048
+ }
128049
+ }
128050
+ function retryOnEintrSync(operation) {
128051
+ for (let attempt = 0;; attempt += 1) {
128052
+ try {
128053
+ return operation();
128054
+ } catch (error) {
128055
+ if (fsErrorCode(error) !== "EINTR" || attempt >= EINTR_RETRY_CAP)
128056
+ throw error;
128057
+ }
128058
+ }
128059
+ }
128060
+
128061
+ // packages/memory-core/src/fs/rename-contention.ts
128062
+ var CONTENTION_CODES = new Set(["EPERM", "EBUSY", "EACCES"]);
128063
+ var CONTENTION_DELAYS_MS = [10, 25, 50, 100, 200, 400];
128064
+ var sleepFor = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
128065
+ async function renameWithContentionRetry(from, to, deps) {
128066
+ const delays = deps.platform === "win32" ? deps.delaysMs ?? CONTENTION_DELAYS_MS : [];
128067
+ const sleep = deps.sleep ?? sleepFor;
128068
+ for (let attempt = 0;; attempt += 1) {
128069
+ try {
128070
+ await retryOnEintr(() => deps.admit === undefined ? deps.rename(from, to) : deps.admit(() => deps.rename(from, to)));
128071
+ return;
128072
+ } catch (error) {
128073
+ const delay = delays[attempt];
128074
+ const code = fsErrorCode(error);
128075
+ if (delay === undefined || code === undefined || !CONTENTION_CODES.has(code))
128076
+ throw error;
128077
+ await sleep(delay);
128078
+ }
128079
+ }
128080
+ }
128081
+
128082
+ // packages/memory-core/src/fs/resilient.ts
128083
+ function isFunction2(value) {
128084
+ return typeof value === "function";
128085
+ }
128086
+ function withAsyncRetry(operation) {
128087
+ return (...args) => retryOnEintr(async () => operation(...args));
128088
+ }
128089
+ function withSyncRetry(operation) {
128090
+ return (...args) => retryOnEintrSync(() => operation(...args));
128091
+ }
128092
+ function resilientNamespace(namespace, kind) {
128093
+ const wrapFunction = kind === "async" ? withAsyncRetry : withSyncRetry;
128094
+ const cache = new Map;
128095
+ return new Proxy(namespace, {
128096
+ get(target, property) {
128097
+ if (cache.has(property))
128098
+ return cache.get(property);
128099
+ const value = Reflect.get(target, property);
128100
+ if (!isFunction2(value))
128101
+ return value;
128102
+ const wrapped = wrapFunction(value);
128103
+ const native = Reflect.get(value, "native");
128104
+ if (isFunction2(native))
128105
+ Object.assign(wrapped, { native: wrapFunction(native) });
128106
+ cache.set(property, wrapped);
128107
+ return wrapped;
128108
+ }
128109
+ });
128110
+ }
128111
+ var IDEMPOTENT_HANDLE_METHODS = new Set(["stat", "sync", "datasync", "chmod", "chown", "utimes", "truncate"]);
128112
+ var promises = resilientNamespace(fsp, "async");
128113
+ function rename8(from, to, admit) {
128114
+ return renameWithContentionRetry(from, to, {
128115
+ rename: (source, target) => fsp.rename(source, target),
128116
+ platform: process.platform,
128117
+ ...admit === undefined ? {} : { admit }
128118
+ });
128119
+ }
128120
+ var sync = resilientNamespace(fsSync, "sync");
128121
+ var {
128122
+ access: access4,
128123
+ chmod: chmod2,
128124
+ copyFile: copyFile4,
128125
+ cp: cp5,
128126
+ link,
128127
+ lstat: lstat18,
128128
+ mkdir: mkdir10,
128129
+ mkdtemp: mkdtemp2,
128130
+ readFile: readFile34,
128131
+ readdir: readdir17,
128132
+ readlink: readlink7,
128133
+ realpath: realpath2,
128134
+ rm: rm16,
128135
+ rmdir: rmdir2,
128136
+ stat: stat8,
128137
+ statfs,
128138
+ unlink: unlink3
128139
+ } = promises;
128140
+ var {
128141
+ accessSync: accessSync5,
128142
+ chmodSync: chmodSync7,
128143
+ fsyncSync: fsyncSync3,
128144
+ linkSync,
128145
+ lstatSync: lstatSync5,
128146
+ mkdirSync: mkdirSync19,
128147
+ readFileSync: readFileSync44,
128148
+ readdirSync: readdirSync14,
128149
+ realpathSync: realpathSync13,
128150
+ statSync: statSync8,
128151
+ unlinkSync: unlinkSync10,
128152
+ writeFileSync: writeFileSync17,
128153
+ writeSync
128154
+ } = sync;
128155
+
128156
+ // packages/memory-core/src/sync/item/machine-id.ts
127942
128157
  async function darwinPlatformUuid() {
127943
128158
  const out = await run2("/usr/sbin/ioreg", ["-rd1", "-c", "IOPlatformExpertDevice"]);
127944
128159
  return /"IOPlatformUUID" = "([^"]+)"/.exec(out ?? "")?.[1] ?? null;
@@ -128939,7 +129154,6 @@ import { randomUUID as randomUUID6 } from "node:crypto";
128939
129154
  import { readFile as readFile36, stat as stat11 } from "node:fs/promises";
128940
129155
 
128941
129156
  // packages/memory-core/src/locks/process-identity.ts
128942
- init_resilient();
128943
129157
  import { execFile as execFile8 } from "node:child_process";
128944
129158
 
128945
129159
  // packages/memory-core/src/locks/process-start-time.ts
@@ -130437,6 +130651,15 @@ function refuseIfLocalOnly(site) {
130437
130651
  throw new LocalOnlyNetworkRefused(site);
130438
130652
  }
130439
130653
 
130654
+ // packages/memory-core/src/sync/contract-version.ts
130655
+ var SYNC_CONTRACT_VERSION = "1.44.0";
130656
+ var SYNC_CAPABILITIES = "phrase";
130657
+ var syncRequestHeaders = (token) => ({
130658
+ "omo-contract-version": SYNC_CONTRACT_VERSION,
130659
+ "omo-sync-capabilities": SYNC_CAPABILITIES,
130660
+ authorization: `Bearer ${token}`
130661
+ });
130662
+
130440
130663
  // packages/omo-opencode/src/cli/service-auth/protocol-request.ts
130441
130664
  init_zod();
130442
130665
  class InvalidApiResponse extends SignInError {
@@ -130515,10 +130738,10 @@ async function requestApi(api, path, init, signal) {
130515
130738
  }
130516
130739
 
130517
130740
  // packages/omo-opencode/src/cli/service-auth/machine-reconcile.ts
130518
- init_zod();
130519
130741
  import { createHash as createHash15, createPrivateKey as createPrivateKey3, sign } from "node:crypto";
130520
130742
  import { mkdir as mkdir14, readFile as readFile39, rename as rename11, rm as rm19, writeFile as writeFile18 } from "node:fs/promises";
130521
130743
  import { dirname as dirname48, join as join115 } from "node:path";
130744
+ init_zod();
130522
130745
  var MACHINE_BIND_CONTEXT = "omo-machine-bind-v1";
130523
130746
  var DEVICE_FIXUP_BUDGET_MS = 5000;
130524
130747
  var MACHINE_EXISTS_RETRY_MS = 7 * 24 * 60 * 60 * 1000;
@@ -130573,7 +130796,7 @@ async function reconcileDevice(options) {
130573
130796
  if (!signal.aborted)
130574
130797
  options.log(line);
130575
130798
  };
130576
- const auth = { authorization: `Bearer ${credentials.accessToken}` };
130799
+ const auth = syncRequestHeaders(credentials.accessToken);
130577
130800
  let own;
130578
130801
  try {
130579
130802
  const listed = deviceListSchema2.safeParse(await request("/v1/devices", { headers: auth }));
@@ -130722,7 +130945,7 @@ function createSession(options) {
130722
130945
  }
130723
130946
  const request = (path, init) => requestApi(api, path, init, signal);
130724
130947
  const accountOf = async (access, stop = signal) => {
130725
- const body = await requestApi(api, "/v1/me", { headers: { authorization: `Bearer ${access}` } }, stop).catch(() => null);
130948
+ const body = await requestApi(api, "/v1/me", { headers: syncRequestHeaders(access) }, stop).catch(() => null);
130726
130949
  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;
130727
130950
  return typeof id === "string" && id !== "" ? id : undefined;
130728
130951
  };
@@ -130809,7 +131032,7 @@ function createSession(options) {
130809
131032
  });
130810
131033
  }
130811
131034
  async function emailOf(access) {
130812
- const body = await request("/v1/me", { headers: { authorization: `Bearer ${access}` } }).catch(() => null);
131035
+ const body = await request("/v1/me", { headers: syncRequestHeaders(access) }).catch(() => null);
130813
131036
  const user = typeof body === "object" && body !== null && "user" in body ? body.user : undefined;
130814
131037
  const email = typeof user === "object" && user !== null && "email" in user ? user.email : undefined;
130815
131038
  return typeof email === "string" && email !== "" ? email : undefined;
@@ -130895,7 +131118,7 @@ function createSession(options) {
130895
131118
  }
130896
131119
  await request(`/v1/devices/${encodeURIComponent(current.device.id)}`, {
130897
131120
  method: "DELETE",
130898
- headers: { authorization: `Bearer ${access}` }
131121
+ headers: syncRequestHeaders(access)
130899
131122
  });
130900
131123
  }
130901
131124
  return true;
@@ -130921,7 +131144,7 @@ function createSession(options) {
130921
131144
  async removeForLimit(error, choose) {
130922
131145
  if (!(error instanceof ApiRefusal) || error.detail === undefined)
130923
131146
  throw error;
130924
- const headers = { authorization: `Bearer ${error.detail.managementToken}` };
131147
+ const headers = syncRequestHeaders(error.detail.managementToken);
130925
131148
  const listed = parseReply(deviceListSchema, await request("/v1/devices", { headers }));
130926
131149
  const devices = listed.devices.filter((device) => device.revokedAt === null);
130927
131150
  const chosen = await choose(devices);
@@ -131245,7 +131468,6 @@ function decideReplace(options) {
131245
131468
  }
131246
131469
 
131247
131470
  // packages/memory-core/src/sync/device-retire.ts
131248
- init_resilient();
131249
131471
  import { createHash as createHash17, randomBytes as randomBytes6 } from "node:crypto";
131250
131472
  import { join as join119 } from "node:path";
131251
131473
 
@@ -131594,6 +131816,9 @@ var forgetDeviceService = async (options) => {
131594
131816
  }
131595
131817
  return "forgotten";
131596
131818
  };
131819
+ // packages/device-service-core/src/cold-wake/host.ts
131820
+ var UNREPAIRABLE = new Set(["EPERM", "EACCES", "EROFS"]);
131821
+
131597
131822
  // packages/device-service-core/src/cold-wake/service-table.ts
131598
131823
  var SERVICE_TABLE_ENV = "OMO_RELAYD_SERVICES";
131599
131824
 
@@ -131759,7 +131984,7 @@ init_timers();
131759
131984
  // packages/omo-native/package.json
131760
131985
  var package_default4 = {
131761
131986
  name: "omo-ai",
131762
- version: "5.1.77",
131987
+ version: "5.1.79",
131763
131988
  type: "module",
131764
131989
  description: "OmO Native - the standalone omo command with the OMO extension built in: bun add -g omo-ai",
131765
131990
  bin: {
@@ -131776,7 +132001,7 @@ var package_default4 = {
131776
132001
  postinstall: "node bin/senpi-patch.mjs"
131777
132002
  },
131778
132003
  dependencies: {
131779
- "@code-yeongyu/senpi": "2026.11.18"
132004
+ "@code-yeongyu/senpi": "2026.11.18-3"
131780
132005
  },
131781
132006
  repository: {
131782
132007
  type: "git",
@@ -131790,7 +132015,7 @@ async function accountOf(api, credentials, doFetch) {
131790
132015
  if (credentials.accountId !== undefined)
131791
132016
  return credentials.accountId;
131792
132017
  refuseIfLocalOnly("omo-native/device-service-handoff.ts accountOf");
131793
- const response = await doFetch(`${api}/v1/me`, { headers: { authorization: `Bearer ${credentials.accessToken}` } });
132018
+ const response = await doFetch(`${api}/v1/me`, { headers: syncRequestHeaders(credentials.accessToken) });
131794
132019
  if (!response.ok)
131795
132020
  throw new Error(`the account read failed (${response.status})`);
131796
132021
  const body = await response.json();
@@ -131864,11 +132089,7 @@ function cliDeviceServiceHandoff(options) {
131864
132089
  // packages/omo-native/remote-entry.ts
131865
132090
  init_device_service2();
131866
132091
 
131867
- // packages/memory-core/src/sync/crypto/trust-pin.ts
131868
- init_resilient();
131869
-
131870
132092
  // packages/memory-core/src/journal/fsync.ts
131871
- init_resilient();
131872
132093
  var SKIPPABLE_SYNC_CODES = new Set(["ENOENT", "EISDIR", "EPERM", "EACCES", "EINVAL"]);
131873
132094
 
131874
132095
  // packages/memory-core/src/sync/crypto/vendor/sync-format/keys.ts
@@ -131904,9 +132125,6 @@ var D2 = mod2(-121665n * power2(121666n, P2 - 2n));
131904
132125
  var SQRT_MINUS_ONE2 = power2(2n, (P2 - 1n) / 4n);
131905
132126
  var keyCache2 = new Map;
131906
132127
 
131907
- // packages/memory-core/src/sync/publication.ts
131908
- init_resilient();
131909
-
131910
132128
  // packages/memory-core/src/sync/crypto/trust-pin.ts
131911
132129
  var SOURCES = new Set(["pairing", "recovery", "creator"]);
131912
132130
 
@@ -131959,13 +132177,12 @@ init_device_service3();
131959
132177
 
131960
132178
  // packages/omo-senpi/src/components/remote/index.ts
131961
132179
  init_codes();
131962
-
131963
- // packages/omo-senpi/src/components/remote/factories.ts
131964
- init_client5();
131965
-
131966
- // packages/omo-senpi/src/components/remote/index.ts
132180
+ init_factories();
131967
132181
  init_seams();
131968
132182
 
132183
+ // packages/omo-senpi/src/components/remote/device-address.ts
132184
+ init_plan_create();
132185
+ init_remote_ops();
131969
132186
  // packages/omo-senpi/src/components/thread/gateway/store.ts
131970
132187
  init_constants6();
131971
132188
  init_provenance_resolver();
@@ -132096,7 +132313,7 @@ var USAGE_ENTRIES = [
132096
132313
  },
132097
132314
  {
132098
132315
  verbs: ["close"],
132099
- text: " close <session> end the session; also takes <device>/<session>"
132316
+ text: " close <session> [--force] end the session; --force also drops messages it has not read"
132100
132317
  }
132101
132318
  ];
132102
132319
  var REMOTE_USAGE = [USAGE_HEAD, ...USAGE_ENTRIES.map((entry) => entry.text)].join(`