oh-my-opencode 5.1.77 → 5.1.78

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 +606 -402
  5. package/dist/cli-node/index.js +606 -402
  6. package/dist/index.js +571 -331
  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.78",
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-2",
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.78",
2408
+ "oh-my-opencode-darwin-x64": "5.1.78",
2409
+ "oh-my-opencode-darwin-x64-baseline": "5.1.78",
2410
+ "oh-my-opencode-linux-arm64": "5.1.78",
2411
+ "oh-my-opencode-linux-arm64-musl": "5.1.78",
2412
+ "oh-my-opencode-linux-x64": "5.1.78",
2413
+ "oh-my-opencode-linux-x64-baseline": "5.1.78",
2414
+ "oh-my-opencode-linux-x64-musl": "5.1.78",
2415
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.78",
2416
+ "oh-my-opencode-windows-arm64": "5.1.78",
2417
+ "oh-my-opencode-windows-x64": "5.1.78",
2418
+ "oh-my-opencode-windows-x64-baseline": "5.1.78"
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.78",
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,40 @@ 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
98178
  if (endpoint === undefined)
98205
98179
  throw new NotSentError("unsupported", "the device lists no engine endpoint");
98206
- return await sendToEndpoint(client, device, endpoint, rpc, options?.locate === true, timers);
98180
+ const waitMs = options?.waitMs === undefined ? undefined : options.waitMs - (timers.now() - started);
98181
+ if (waitMs !== undefined && waitMs <= 0)
98182
+ throw new NotSentError("request_timeout", "the wait ran out during the endpoint lookup; nothing was sent");
98183
+ return {
98184
+ ...await sendToEndpoint(client, device, endpoint, rpc, options?.locate === true, timers, waitMs),
98185
+ endpoint
98186
+ };
98207
98187
  },
98188
+ sessionCommand: (device, key, rpc, options) => followDelegatedCommand(client, device, timers, (commandId) => client.commandTo({ session: `${device}.${key}` }, rpc, commandId).catch((error) => {
98189
+ throw error instanceof LocalApiError && error.command_id === undefined ? markNotSent(error) : error;
98190
+ }), options?.waitMs),
98208
98191
  close: () => client.close(),
98209
98192
  closed: client.closed,
98210
98193
  locate: (device, engineId, options) => client.request("session.locate", {
@@ -98212,16 +98195,16 @@ async function connectDeviceService(options) {
98212
98195
  engine_id: engineId,
98213
98196
  ...options?.single === true && takesSingleLocate ? { single: true } : {}
98214
98197
  }),
98215
- wakeCommand: async (device, durableId, rpc) => {
98198
+ wakeCommand: async (device, durableId, rpc, options) => {
98216
98199
  if (!carriesWakeMark)
98217
98200
  throw olderThanWakeMinimum(client.welcome.service_version, wakeMarkMinimum);
98218
98201
  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
- }));
98202
+ throw error instanceof LocalApiError && error.command_id === undefined && REFUSED_BEFORE_SENDING.has(error.code) ? markNotSent(error) : error;
98203
+ }), options?.waitMs);
98221
98204
  }
98222
98205
  };
98223
98206
  }
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;
98207
+ 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
98208
  var init_device_service2 = __esm(() => {
98226
98209
  init_access();
98227
98210
  init_client4();
@@ -98231,15 +98214,22 @@ var init_device_service2 = __esm(() => {
98231
98214
  init_remote_attach();
98232
98215
  init_delegated_channel();
98233
98216
  init_errors4();
98217
+ init_refused_before_sending();
98234
98218
  init_listing_rows();
98235
98219
  init_version2();
98236
98220
  init_state_dir();
98221
+ init_engine_endpoint();
98237
98222
  init_timers();
98238
98223
  init_errors4();
98224
+ init_refused_before_sending();
98239
98225
  init_not_sent_error();
98226
+ init_engine_endpoint();
98240
98227
  init_protocol();
98228
+ init_unsettled_command();
98241
98229
  init_state_dir();
98242
98230
  init_timers();
98231
+ UPDATE_IN_FLIGHT_MAX_MS = 15 * 60000;
98232
+ UPDATE_IN_FLIGHT = new Set(["pending", "trial"]);
98243
98233
  });
98244
98234
 
98245
98235
  // node_modules/.bun/typebox@1.3.34/node_modules/typebox/build/system/memory/metrics.mjs
@@ -103775,6 +103765,15 @@ var init_permission_presets = __esm(() => {
103775
103765
  PERMISSION_PRESETS = ["full-access", "workspace", "accept-edits", "auto", "read-only", "ask"];
103776
103766
  });
103777
103767
  // packages/omo-senpi/src/components/thread/errors.ts
103768
+ function isThreadErrorCode(value) {
103769
+ return typeof value === "string" && CODE_SET.has(value);
103770
+ }
103771
+ function threadToolFailure(code, message, nextAction, details) {
103772
+ if (!isThreadErrorCode(code)) {
103773
+ throw new Error(`unknown thread error code: ${String(code)}`);
103774
+ }
103775
+ return { code, message, next_action: nextAction, ...details === undefined ? {} : { details } };
103776
+ }
103778
103777
  var THREAD_ERROR_CODES, CODE_SET;
103779
103778
  var init_errors5 = __esm(() => {
103780
103779
  THREAD_ERROR_CODES = [
@@ -103790,6 +103789,7 @@ var init_errors5 = __esm(() => {
103790
103789
  "foreign_live_owner",
103791
103790
  "no_active_turn",
103792
103791
  "turn_conflict",
103792
+ "turn_active",
103793
103793
  "not_steerable",
103794
103794
  "message_too_large",
103795
103795
  "queue_full",
@@ -103798,6 +103798,7 @@ var init_errors5 = __esm(() => {
103798
103798
  "idempotency_conflict",
103799
103799
  "idempotency_in_progress",
103800
103800
  "idempotency_uncertain",
103801
+ "delivered_unconfirmed",
103801
103802
  "approval_unavailable",
103802
103803
  "approval_route_locked",
103803
103804
  "partial_commit",
@@ -103810,6 +103811,7 @@ var init_errors5 = __esm(() => {
103810
103811
  "model_ambiguous",
103811
103812
  "thinking_level_unsupported",
103812
103813
  "loop_detected",
103814
+ "chain_count_limit",
103813
103815
  "binding_conflict",
103814
103816
  "binding_mismatch",
103815
103817
  "binding_inactive",
@@ -103819,7 +103821,8 @@ var init_errors5 = __esm(() => {
103819
103821
  "answer_in_progress",
103820
103822
  "device_offline",
103821
103823
  "relay_requires_paid_plan",
103822
- "alias_taken"
103824
+ "alias_taken",
103825
+ "gateway_schema_too_new"
103823
103826
  ];
103824
103827
  CODE_SET = new Set(THREAD_ERROR_CODES);
103825
103828
  });
@@ -103828,7 +103831,7 @@ var init_errors5 = __esm(() => {
103828
103831
  var init_initial_skills = () => {};
103829
103832
 
103830
103833
  // packages/omo-senpi/src/components/thread/remote/outcome.ts
103831
- var READ_UNCERTAIN, UNANSWERED;
103834
+ var READ_UNCERTAIN, UNANSWERED, NOT_SIGNED_IN;
103832
103835
  var init_outcome = __esm(() => {
103833
103836
  init_errors5();
103834
103837
  READ_UNCERTAIN = {
@@ -103854,11 +103857,13 @@ var init_outcome = __esm(() => {
103854
103857
  "handshake_timeout",
103855
103858
  "attach_failed",
103856
103859
  "reply_lost",
103860
+ "delivered_unconfirmed",
103857
103861
  "host_not_answering",
103858
103862
  "peer_not_found",
103859
103863
  "engine_stale",
103860
103864
  ...Object.entries(READ_UNCERTAIN).filter(([, answer]) => answer === "retry").map(([reason]) => reason)
103861
103865
  ]);
103866
+ NOT_SIGNED_IN = new Set(["sign_in_required", "signed_out"]);
103862
103867
  });
103863
103868
  // packages/omo-senpi/src/components/thread/remote/remote-ops.ts
103864
103869
  var init_remote_ops = __esm(() => {
@@ -103913,162 +103918,6 @@ var init_thread_link = __esm(() => {
103913
103918
  PREFIX = `${THREAD_LINK_SCHEME}://v1/`;
103914
103919
  });
103915
103920
 
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
103921
  // packages/omo-senpi/src/components/thread/contracts/create-params.ts
104073
103922
  var ThreadCreateParams;
104074
103923
  var init_create_params = __esm(() => {
@@ -104137,7 +103986,7 @@ var init_create_params = __esm(() => {
104137
103986
  });
104138
103987
 
104139
103988
  // 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;
103989
+ var ThreadListParams, THREAD_READ_WAIT_MAX_MS = 600000, ThreadReadParams, ThreadSendParams, ThreadInterruptParams, SelfOrThread, ThreadCloseParams, ThreadHandoffParams, ThreadRenameParams, ThreadSetModelParams, ThreadSetReasoningParams, ThreadArchiveParams, ThreadReportParams, ThreadOutboxParams, ThreadOutboxAckParams, ThreadAnswerParams;
104141
103990
  var init_params = __esm(() => {
104142
103991
  init_build();
104143
103992
  init_fields();
@@ -104145,12 +103994,16 @@ var init_params = __esm(() => {
104145
103994
  ThreadListParams = _Object_({
104146
103995
  all_scope: Optional(Boolean2({
104147
103996
  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."
103997
+ })),
103998
+ state: Optional(_Array_(Union([Literal("running"), Literal("idle"), Literal("inactive"), Literal("archived")]), {
103999
+ minItems: 1,
104000
+ description: "Thread states to list: running, idle, inactive (no engine holds it) or archived; the default lists every state but archived."
104148
104001
  }))
104149
104002
  });
104150
104003
  ThreadReadParams = _Object_({
104151
104004
  thread: ThreadAddress,
104152
104005
  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."
104006
+ 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
104007
  })),
104155
104008
  max_bytes: Optional(Integer({
104156
104009
  minimum: 1,
@@ -104239,6 +104092,14 @@ var init_params = __esm(() => {
104239
104092
  all_scope: AllScope,
104240
104093
  idempotency_key: IdempotencyKey
104241
104094
  });
104095
+ ThreadArchiveParams = _Object_({
104096
+ thread: ThreadAddress,
104097
+ archived: Optional(Boolean2({
104098
+ 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."
104099
+ })),
104100
+ all_scope: AllScope,
104101
+ idempotency_key: IdempotencyKey
104102
+ });
104242
104103
  ThreadReportParams = _Object_({
104243
104104
  binding_id: Optional(String2({
104244
104105
  minLength: 1,
@@ -108779,11 +108640,209 @@ var init_parse6 = __esm(() => {
108779
108640
  init_value2();
108780
108641
  init_errors5();
108781
108642
  });
108643
+
108644
+ // packages/omo-senpi/src/components/thread/contracts/state.ts
108645
+ var THREAD_ACTIVITIES;
108646
+ var init_state2 = __esm(() => {
108647
+ THREAD_ACTIVITIES = ["idle", "running", "awaiting_approval", "queued", "errored"];
108648
+ });
108649
+
108650
+ // packages/omo-senpi/src/components/thread/contracts/results.ts
108651
+ var init_results = __esm(() => {
108652
+ init_state2();
108653
+ });
108654
+
108782
108655
  // packages/omo-senpi/src/components/thread/contracts/index.ts
108783
108656
  var init_contracts = __esm(() => {
108784
108657
  init_fields();
108785
108658
  init_params();
108786
108659
  init_parse6();
108660
+ init_results();
108661
+ });
108662
+
108663
+ // packages/omo-senpi/src/components/thread/tools/thread-state.ts
108664
+ var ACTIVITIES;
108665
+ var init_thread_state = __esm(() => {
108666
+ init_contracts();
108667
+ ACTIVITIES = new Set(THREAD_ACTIVITIES);
108668
+ });
108669
+
108670
+ // packages/omo-senpi/src/components/thread/remote/address-book.ts
108671
+ var lastListed, REMOTE_NOT_SET_UP;
108672
+ var init_address_book = __esm(() => {
108673
+ init_errors5();
108674
+ init_remote_ops();
108675
+ lastListed = new WeakMap;
108676
+ REMOTE_NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
108677
+ });
108678
+
108679
+ // packages/omo-senpi/src/components/thread/addressing.ts
108680
+ var init_addressing = __esm(() => {
108681
+ init_errors5();
108682
+ });
108683
+
108684
+ // packages/omo-senpi/src/components/thread/session-facts.ts
108685
+ var SESSION_FACTS_WINDOW_BYTES, SESSION_FACTS_LAST_LINE_MAX_BYTES;
108686
+ var init_session_facts = __esm(() => {
108687
+ SESSION_FACTS_WINDOW_BYTES = 64 * 1024;
108688
+ SESSION_FACTS_LAST_LINE_MAX_BYTES = SESSION_FACTS_WINDOW_BYTES * 4;
108689
+ });
108690
+
108691
+ // packages/omo-senpi/src/components/thread/address-book.ts
108692
+ var init_address_book2 = __esm(() => {
108693
+ init_addressing();
108694
+ init_session_facts();
108695
+ });
108696
+
108697
+ // packages/omo-senpi/src/components/thread/metadata.ts
108698
+ var THREAD_TOOL_EXPOSURE = "eval", ROUTE_TO_TASK = "; to spawn a child task instead, use task.", THREAD_TOOL_METADATA;
108699
+ var init_metadata = __esm(() => {
108700
+ THREAD_TOOL_METADATA = [
108701
+ {
108702
+ name: "thread_create",
108703
+ label: "Create session",
108704
+ 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,
108705
+ exposure: THREAD_TOOL_EXPOSURE
108706
+ },
108707
+ {
108708
+ name: "thread_list",
108709
+ label: "List sessions",
108710
+ 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,
108711
+ exposure: THREAD_TOOL_EXPOSURE
108712
+ },
108713
+ {
108714
+ name: "thread_read",
108715
+ label: "Read session",
108716
+ description: "Returns the transcript and latest output of another session, for when the user asks what another session said or produced" + ROUTE_TO_TASK,
108717
+ exposure: THREAD_TOOL_EXPOSURE
108718
+ },
108719
+ {
108720
+ name: "thread_send",
108721
+ label: "Send message to session",
108722
+ 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,
108723
+ exposure: THREAD_TOOL_EXPOSURE
108724
+ },
108725
+ {
108726
+ name: "thread_interrupt",
108727
+ label: "Interrupt session turn",
108728
+ 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,
108729
+ exposure: THREAD_TOOL_EXPOSURE
108730
+ },
108731
+ {
108732
+ name: "thread_close",
108733
+ label: "Close session",
108734
+ description: "Closes a session. Omit thread or pass self to close this session. thread accepts the thread value of a thread_list row (tool.thread_list() in an eval cell), an alias, or a unique name; the result is closed true or false plus a reason" + ROUTE_TO_TASK,
108735
+ exposure: THREAD_TOOL_EXPOSURE
108736
+ },
108737
+ {
108738
+ name: "thread_handoff",
108739
+ label: "Hand off session",
108740
+ 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,
108741
+ exposure: THREAD_TOOL_EXPOSURE
108742
+ },
108743
+ {
108744
+ name: "thread_rename",
108745
+ label: "Rename session",
108746
+ 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",
108747
+ exposure: THREAD_TOOL_EXPOSURE
108748
+ },
108749
+ {
108750
+ name: "thread_set_model",
108751
+ label: "Switch session model",
108752
+ description: "Moves a session onto a different model, for when the user asks to switch that session to another model or a cheaper one",
108753
+ exposure: THREAD_TOOL_EXPOSURE
108754
+ },
108755
+ {
108756
+ name: "thread_set_reasoning",
108757
+ label: "Set session reasoning level",
108758
+ description: "Sets how much reasoning a session applies, for when the user asks to raise or lower the thinking effort of a session",
108759
+ exposure: THREAD_TOOL_EXPOSURE
108760
+ },
108761
+ {
108762
+ name: "thread_archive",
108763
+ label: "Archive session",
108764
+ 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",
108765
+ exposure: THREAD_TOOL_EXPOSURE
108766
+ },
108767
+ {
108768
+ name: "thread_report",
108769
+ label: "Report to chat thread",
108770
+ 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())",
108771
+ exposure: THREAD_TOOL_EXPOSURE
108772
+ },
108773
+ {
108774
+ name: "thread_outbox",
108775
+ label: "Read chat outbox",
108776
+ description: "Returns the reports waiting for a bound chat thread with a cursor, for when a connector collects what sessions posted",
108777
+ exposure: THREAD_TOOL_EXPOSURE
108778
+ },
108779
+ {
108780
+ name: "thread_outbox_ack",
108781
+ label: "Acknowledge chat outbox",
108782
+ description: "Marks outbox rows up to a cursor as posted to the chat, for when a connector confirms delivery",
108783
+ exposure: THREAD_TOOL_EXPOSURE
108784
+ },
108785
+ {
108786
+ name: "thread_answer",
108787
+ label: "Answer relayed question",
108788
+ 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",
108789
+ exposure: THREAD_TOOL_EXPOSURE
108790
+ }
108791
+ ];
108792
+ });
108793
+ // packages/omo-senpi/src/components/thread/tools/internals.ts
108794
+ function failure3(code, message, next, details) {
108795
+ return { kind: "error", error: threadToolFailure(code, message, next, details) };
108796
+ }
108797
+ var init_internals = __esm(() => {
108798
+ init_address_book();
108799
+ init_remote_ops();
108800
+ init_address_book2();
108801
+ init_addressing();
108802
+ init_errors5();
108803
+ init_metadata();
108804
+ init_session_facts();
108805
+ init_thread_link();
108806
+ init_thread_state();
108807
+ });
108808
+
108809
+ // packages/omo-senpi/src/components/thread/control/session-host.ts
108810
+ var init_session_host = __esm(() => {
108811
+ init_internals();
108812
+ });
108813
+
108814
+ // packages/omo-senpi/src/components/thread/control/relay-session-host.ts
108815
+ var init_relay_session_host = __esm(() => {
108816
+ init_errors5();
108817
+ init_initial_skills();
108818
+ init_outcome();
108819
+ init_remote_ops();
108820
+ init_remote_worktree();
108821
+ init_open_reply();
108822
+ init_thread_link();
108823
+ init_thread_state();
108824
+ init_session_host();
108825
+ });
108826
+
108827
+ // packages/omo-senpi/src/components/thread/tools/model-match.ts
108828
+ var init_model_match = __esm(() => {
108829
+ init_internals();
108830
+ });
108831
+
108832
+ // packages/omo-senpi/src/components/thread/control/operations.ts
108833
+ var NOT_LIVE;
108834
+ var init_operations = __esm(() => {
108835
+ init_internals();
108836
+ init_model_match();
108837
+ init_port();
108838
+ NOT_LIVE = failure3("not_resumable", "The thread has no live owner.", "Retry when the target is live.");
108839
+ });
108840
+
108841
+ // packages/omo-senpi/src/components/call-budget/call-deadline.ts
108842
+ import { AsyncLocalStorage as AsyncLocalStorage4 } from "node:async_hooks";
108843
+ var scope;
108844
+ var init_call_deadline = __esm(() => {
108845
+ scope = new AsyncLocalStorage4;
108787
108846
  });
108788
108847
  // packages/omo-senpi/src/components/thread/reader.ts
108789
108848
  var init_reader = __esm(() => {
@@ -108838,12 +108897,20 @@ var init_wait_settled = __esm(() => {
108838
108897
  "tool_execution_update",
108839
108898
  "tool_execution_end",
108840
108899
  "turn_end",
108841
- "agent_end"
108900
+ "agent_end",
108901
+ "auto_retry_start",
108902
+ "auto_retry_end"
108842
108903
  ]);
108843
108904
  });
108844
108905
 
108906
+ // packages/omo-senpi/src/components/thread/tools/thread-row.ts
108907
+ var init_thread_row = __esm(() => {
108908
+ init_thread_link();
108909
+ });
108910
+
108845
108911
  // packages/omo-senpi/src/components/thread/control/relay-control.ts
108846
108912
  var init_relay_control = __esm(() => {
108913
+ init_call_deadline();
108847
108914
  init_address_book();
108848
108915
  init_outcome();
108849
108916
  init_transcript_tail();
@@ -108852,6 +108919,8 @@ var init_relay_control = __esm(() => {
108852
108919
  init_close_ladder();
108853
108920
  init_port();
108854
108921
  init_wait_settled();
108922
+ init_relay_session_host();
108923
+ init_thread_row();
108855
108924
  });
108856
108925
 
108857
108926
  // packages/omo-senpi/src/components/thread/remote/attach-pool.ts
@@ -108893,45 +108962,14 @@ var init_remote_watch = __esm(() => {
108893
108962
  init_device_service2();
108894
108963
  init_session_state();
108895
108964
  });
108896
-
108897
108965
  // packages/omo-senpi/src/components/remote/port/device-service.ts
108898
- var REFUSED_BEFORE_SENDING, READ_ONLY_RECORDS, MARKED_RECORDS, LOOKUP_NONE;
108966
+ var READ_ONLY_RECORDS, MARKED_RECORDS, LOOKUP_NONE;
108899
108967
  var init_device_service3 = __esm(() => {
108900
108968
  init_outcome();
108901
108969
  init_device_service2();
108902
108970
  init_attach_pool();
108903
108971
  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"
108934
- ]);
108972
+ init_call_deadline();
108935
108973
  READ_ONLY_RECORDS = new Set(["get_state", "get_messages", "get_entries"]);
108936
108974
  MARKED_RECORDS = new Set(["admit_external_message"]);
108937
108975
  LOOKUP_NONE = new Set(["session_not_found", "peer_not_found", "peer_not_session_client"]);
@@ -108971,6 +109009,12 @@ var init_codes = __esm(() => {
108971
109009
  ]);
108972
109010
  });
108973
109011
 
109012
+ // packages/omo-senpi/src/components/remote/connection-of.ts
109013
+ var lenders;
109014
+ var init_connection_of = __esm(() => {
109015
+ lenders = new WeakMap;
109016
+ });
109017
+
108974
109018
  // packages/omo-senpi/src/components/remote/deadlines.ts
108975
109019
  var init_deadlines = __esm(() => {
108976
109020
  init_codes();
@@ -109043,6 +109087,21 @@ var init_result2 = __esm(() => {
109043
109087
  init_errors5();
109044
109088
  });
109045
109089
 
109090
+ // packages/omo-senpi/src/components/thread/remote/find-session.ts
109091
+ var NO_FIND_SESSION;
109092
+ var init_find_session = __esm(() => {
109093
+ init_errors5();
109094
+ init_outcome();
109095
+ init_remote_ops();
109096
+ NO_FIND_SESSION = new Set([
109097
+ "method_unclassified",
109098
+ "unknown_command",
109099
+ "unknown_type",
109100
+ "unsupported",
109101
+ "find_session_unsupported"
109102
+ ]);
109103
+ });
109104
+
109046
109105
  // packages/omo-senpi/src/components/thread/remote/relay-transport.ts
109047
109106
  var ADMIT_UNSUPPORTED, WAITS;
109048
109107
  var init_relay_transport = __esm(() => {
@@ -109052,6 +109111,8 @@ var init_relay_transport = __esm(() => {
109052
109111
  init_result2();
109053
109112
  init_remote_ops();
109054
109113
  init_outcome();
109114
+ init_find_session();
109115
+ init_call_deadline();
109055
109116
  ADMIT_UNSUPPORTED = new Set([
109056
109117
  "method_unclassified",
109057
109118
  "delegation_unclassified",
@@ -109101,6 +109162,7 @@ var init_unknown_device = __esm(() => {
109101
109162
 
109102
109163
  // packages/omo-senpi/src/components/remote/client.ts
109103
109164
  var init_client5 = __esm(() => {
109165
+ init_connection_of();
109104
109166
  init_device_service2();
109105
109167
  init_aliases();
109106
109168
  init_attach();
@@ -109113,9 +109175,24 @@ var init_client5 = __esm(() => {
109113
109175
  init_unknown_device();
109114
109176
  });
109115
109177
 
109116
- // packages/omo-senpi/src/components/thread/tools/thread-row.ts
109117
- var init_thread_row = __esm(() => {
109118
- init_thread_link();
109178
+ // packages/omo-senpi/src/components/remote/factories.ts
109179
+ var init_factories = __esm(() => {
109180
+ init_client5();
109181
+ });
109182
+
109183
+ // packages/omo-senpi/src/components/thread/remote/plan-create.ts
109184
+ var ALIASES_UNAVAILABLE;
109185
+ var init_plan_create = __esm(() => {
109186
+ init_addressing();
109187
+ init_relay_session_host();
109188
+ init_errors5();
109189
+ init_thread_row();
109190
+ init_find_session();
109191
+ init_remote_ops();
109192
+ ALIASES_UNAVAILABLE = {
109193
+ kind: "error",
109194
+ error: threadToolFailure("host_unavailable", "Thread aliases need the account's alias registry, which this device cannot reach.", "Create or address the thread by its id; retry the alias later.")
109195
+ };
109119
109196
  });
109120
109197
 
109121
109198
  // packages/omo-opencode/src/cli/cli-program.ts
@@ -124681,8 +124758,8 @@ var package_default3 = {
124681
124758
  },
124682
124759
  dependencies: {
124683
124760
  "@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",
124761
+ "@code-yeongyu/senpi": "2026.11.18-2",
124762
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.18-2",
124686
124763
  "@modelcontextprotocol/sdk": "^1.30.0",
124687
124764
  "@oh-my-opencode/agents-md-core": "workspace:*",
124688
124765
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -127938,7 +128015,135 @@ import { createHash as createHash10 } from "node:crypto";
127938
128015
 
127939
128016
  // packages/memory-core/src/sync/item/machine-id.ts
127940
128017
  import { execFile as execFile7 } from "node:child_process";
127941
- init_resilient();
128018
+
128019
+ // packages/memory-core/src/fs/resilient.ts
128020
+ import * as fsSync from "node:fs";
128021
+ import * as fsp from "node:fs/promises";
128022
+
128023
+ // packages/memory-core/src/fs/retry.ts
128024
+ var EINTR_RETRY_CAP = 128;
128025
+ function fsErrorCode(error) {
128026
+ if (!(error instanceof Error) || !("code" in error))
128027
+ return;
128028
+ return typeof error.code === "string" ? error.code : undefined;
128029
+ }
128030
+ async function retryOnEintr(operation) {
128031
+ for (let attempt = 0;; attempt += 1) {
128032
+ try {
128033
+ return await operation();
128034
+ } catch (error) {
128035
+ if (fsErrorCode(error) !== "EINTR" || attempt >= EINTR_RETRY_CAP)
128036
+ throw error;
128037
+ }
128038
+ }
128039
+ }
128040
+ function retryOnEintrSync(operation) {
128041
+ for (let attempt = 0;; attempt += 1) {
128042
+ try {
128043
+ return operation();
128044
+ } catch (error) {
128045
+ if (fsErrorCode(error) !== "EINTR" || attempt >= EINTR_RETRY_CAP)
128046
+ throw error;
128047
+ }
128048
+ }
128049
+ }
128050
+
128051
+ // packages/memory-core/src/fs/rename-contention.ts
128052
+ var CONTENTION_CODES = new Set(["EPERM", "EBUSY", "EACCES"]);
128053
+ var CONTENTION_DELAYS_MS = [10, 25, 50, 100, 200, 400];
128054
+ var sleepFor = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
128055
+ async function renameWithContentionRetry(from, to, deps) {
128056
+ const delays = deps.platform === "win32" ? deps.delaysMs ?? CONTENTION_DELAYS_MS : [];
128057
+ const sleep = deps.sleep ?? sleepFor;
128058
+ for (let attempt = 0;; attempt += 1) {
128059
+ try {
128060
+ await retryOnEintr(() => deps.admit === undefined ? deps.rename(from, to) : deps.admit(() => deps.rename(from, to)));
128061
+ return;
128062
+ } catch (error) {
128063
+ const delay = delays[attempt];
128064
+ const code = fsErrorCode(error);
128065
+ if (delay === undefined || code === undefined || !CONTENTION_CODES.has(code))
128066
+ throw error;
128067
+ await sleep(delay);
128068
+ }
128069
+ }
128070
+ }
128071
+
128072
+ // packages/memory-core/src/fs/resilient.ts
128073
+ function isFunction2(value) {
128074
+ return typeof value === "function";
128075
+ }
128076
+ function withAsyncRetry(operation) {
128077
+ return (...args) => retryOnEintr(async () => operation(...args));
128078
+ }
128079
+ function withSyncRetry(operation) {
128080
+ return (...args) => retryOnEintrSync(() => operation(...args));
128081
+ }
128082
+ function resilientNamespace(namespace, kind) {
128083
+ const wrapFunction = kind === "async" ? withAsyncRetry : withSyncRetry;
128084
+ const cache = new Map;
128085
+ return new Proxy(namespace, {
128086
+ get(target, property) {
128087
+ if (cache.has(property))
128088
+ return cache.get(property);
128089
+ const value = Reflect.get(target, property);
128090
+ if (!isFunction2(value))
128091
+ return value;
128092
+ const wrapped = wrapFunction(value);
128093
+ const native = Reflect.get(value, "native");
128094
+ if (isFunction2(native))
128095
+ Object.assign(wrapped, { native: wrapFunction(native) });
128096
+ cache.set(property, wrapped);
128097
+ return wrapped;
128098
+ }
128099
+ });
128100
+ }
128101
+ var IDEMPOTENT_HANDLE_METHODS = new Set(["stat", "sync", "datasync", "chmod", "chown", "utimes", "truncate"]);
128102
+ var promises = resilientNamespace(fsp, "async");
128103
+ function rename8(from, to, admit) {
128104
+ return renameWithContentionRetry(from, to, {
128105
+ rename: (source, target) => fsp.rename(source, target),
128106
+ platform: process.platform,
128107
+ ...admit === undefined ? {} : { admit }
128108
+ });
128109
+ }
128110
+ var sync = resilientNamespace(fsSync, "sync");
128111
+ var {
128112
+ access: access4,
128113
+ chmod: chmod2,
128114
+ copyFile: copyFile4,
128115
+ cp: cp5,
128116
+ link,
128117
+ lstat: lstat18,
128118
+ mkdir: mkdir10,
128119
+ mkdtemp: mkdtemp2,
128120
+ readFile: readFile34,
128121
+ readdir: readdir17,
128122
+ readlink: readlink7,
128123
+ realpath: realpath2,
128124
+ rm: rm16,
128125
+ rmdir: rmdir2,
128126
+ stat: stat8,
128127
+ statfs,
128128
+ unlink: unlink3
128129
+ } = promises;
128130
+ var {
128131
+ accessSync: accessSync5,
128132
+ chmodSync: chmodSync7,
128133
+ fsyncSync: fsyncSync3,
128134
+ linkSync,
128135
+ lstatSync: lstatSync5,
128136
+ mkdirSync: mkdirSync19,
128137
+ readFileSync: readFileSync44,
128138
+ readdirSync: readdirSync14,
128139
+ realpathSync: realpathSync13,
128140
+ statSync: statSync8,
128141
+ unlinkSync: unlinkSync10,
128142
+ writeFileSync: writeFileSync17,
128143
+ writeSync
128144
+ } = sync;
128145
+
128146
+ // packages/memory-core/src/sync/item/machine-id.ts
127942
128147
  async function darwinPlatformUuid() {
127943
128148
  const out = await run2("/usr/sbin/ioreg", ["-rd1", "-c", "IOPlatformExpertDevice"]);
127944
128149
  return /"IOPlatformUUID" = "([^"]+)"/.exec(out ?? "")?.[1] ?? null;
@@ -128939,7 +129144,6 @@ import { randomUUID as randomUUID6 } from "node:crypto";
128939
129144
  import { readFile as readFile36, stat as stat11 } from "node:fs/promises";
128940
129145
 
128941
129146
  // packages/memory-core/src/locks/process-identity.ts
128942
- init_resilient();
128943
129147
  import { execFile as execFile8 } from "node:child_process";
128944
129148
 
128945
129149
  // packages/memory-core/src/locks/process-start-time.ts
@@ -130437,6 +130641,15 @@ function refuseIfLocalOnly(site) {
130437
130641
  throw new LocalOnlyNetworkRefused(site);
130438
130642
  }
130439
130643
 
130644
+ // packages/memory-core/src/sync/contract-version.ts
130645
+ var SYNC_CONTRACT_VERSION = "1.44.0";
130646
+ var SYNC_CAPABILITIES = "phrase";
130647
+ var syncRequestHeaders = (token) => ({
130648
+ "omo-contract-version": SYNC_CONTRACT_VERSION,
130649
+ "omo-sync-capabilities": SYNC_CAPABILITIES,
130650
+ authorization: `Bearer ${token}`
130651
+ });
130652
+
130440
130653
  // packages/omo-opencode/src/cli/service-auth/protocol-request.ts
130441
130654
  init_zod();
130442
130655
  class InvalidApiResponse extends SignInError {
@@ -130515,10 +130728,10 @@ async function requestApi(api, path, init, signal) {
130515
130728
  }
130516
130729
 
130517
130730
  // packages/omo-opencode/src/cli/service-auth/machine-reconcile.ts
130518
- init_zod();
130519
130731
  import { createHash as createHash15, createPrivateKey as createPrivateKey3, sign } from "node:crypto";
130520
130732
  import { mkdir as mkdir14, readFile as readFile39, rename as rename11, rm as rm19, writeFile as writeFile18 } from "node:fs/promises";
130521
130733
  import { dirname as dirname48, join as join115 } from "node:path";
130734
+ init_zod();
130522
130735
  var MACHINE_BIND_CONTEXT = "omo-machine-bind-v1";
130523
130736
  var DEVICE_FIXUP_BUDGET_MS = 5000;
130524
130737
  var MACHINE_EXISTS_RETRY_MS = 7 * 24 * 60 * 60 * 1000;
@@ -130573,7 +130786,7 @@ async function reconcileDevice(options) {
130573
130786
  if (!signal.aborted)
130574
130787
  options.log(line);
130575
130788
  };
130576
- const auth = { authorization: `Bearer ${credentials.accessToken}` };
130789
+ const auth = syncRequestHeaders(credentials.accessToken);
130577
130790
  let own;
130578
130791
  try {
130579
130792
  const listed = deviceListSchema2.safeParse(await request("/v1/devices", { headers: auth }));
@@ -130722,7 +130935,7 @@ function createSession(options) {
130722
130935
  }
130723
130936
  const request = (path, init) => requestApi(api, path, init, signal);
130724
130937
  const accountOf = async (access, stop = signal) => {
130725
- const body = await requestApi(api, "/v1/me", { headers: { authorization: `Bearer ${access}` } }, stop).catch(() => null);
130938
+ const body = await requestApi(api, "/v1/me", { headers: syncRequestHeaders(access) }, stop).catch(() => null);
130726
130939
  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
130940
  return typeof id === "string" && id !== "" ? id : undefined;
130728
130941
  };
@@ -130809,7 +131022,7 @@ function createSession(options) {
130809
131022
  });
130810
131023
  }
130811
131024
  async function emailOf(access) {
130812
- const body = await request("/v1/me", { headers: { authorization: `Bearer ${access}` } }).catch(() => null);
131025
+ const body = await request("/v1/me", { headers: syncRequestHeaders(access) }).catch(() => null);
130813
131026
  const user = typeof body === "object" && body !== null && "user" in body ? body.user : undefined;
130814
131027
  const email = typeof user === "object" && user !== null && "email" in user ? user.email : undefined;
130815
131028
  return typeof email === "string" && email !== "" ? email : undefined;
@@ -130895,7 +131108,7 @@ function createSession(options) {
130895
131108
  }
130896
131109
  await request(`/v1/devices/${encodeURIComponent(current.device.id)}`, {
130897
131110
  method: "DELETE",
130898
- headers: { authorization: `Bearer ${access}` }
131111
+ headers: syncRequestHeaders(access)
130899
131112
  });
130900
131113
  }
130901
131114
  return true;
@@ -130921,7 +131134,7 @@ function createSession(options) {
130921
131134
  async removeForLimit(error, choose) {
130922
131135
  if (!(error instanceof ApiRefusal) || error.detail === undefined)
130923
131136
  throw error;
130924
- const headers = { authorization: `Bearer ${error.detail.managementToken}` };
131137
+ const headers = syncRequestHeaders(error.detail.managementToken);
130925
131138
  const listed = parseReply(deviceListSchema, await request("/v1/devices", { headers }));
130926
131139
  const devices = listed.devices.filter((device) => device.revokedAt === null);
130927
131140
  const chosen = await choose(devices);
@@ -131245,7 +131458,6 @@ function decideReplace(options) {
131245
131458
  }
131246
131459
 
131247
131460
  // packages/memory-core/src/sync/device-retire.ts
131248
- init_resilient();
131249
131461
  import { createHash as createHash17, randomBytes as randomBytes6 } from "node:crypto";
131250
131462
  import { join as join119 } from "node:path";
131251
131463
 
@@ -131759,7 +131971,7 @@ init_timers();
131759
131971
  // packages/omo-native/package.json
131760
131972
  var package_default4 = {
131761
131973
  name: "omo-ai",
131762
- version: "5.1.77",
131974
+ version: "5.1.78",
131763
131975
  type: "module",
131764
131976
  description: "OmO Native - the standalone omo command with the OMO extension built in: bun add -g omo-ai",
131765
131977
  bin: {
@@ -131776,7 +131988,7 @@ var package_default4 = {
131776
131988
  postinstall: "node bin/senpi-patch.mjs"
131777
131989
  },
131778
131990
  dependencies: {
131779
- "@code-yeongyu/senpi": "2026.11.18"
131991
+ "@code-yeongyu/senpi": "2026.11.18-2"
131780
131992
  },
131781
131993
  repository: {
131782
131994
  type: "git",
@@ -131790,7 +132002,7 @@ async function accountOf(api, credentials, doFetch) {
131790
132002
  if (credentials.accountId !== undefined)
131791
132003
  return credentials.accountId;
131792
132004
  refuseIfLocalOnly("omo-native/device-service-handoff.ts accountOf");
131793
- const response = await doFetch(`${api}/v1/me`, { headers: { authorization: `Bearer ${credentials.accessToken}` } });
132005
+ const response = await doFetch(`${api}/v1/me`, { headers: syncRequestHeaders(credentials.accessToken) });
131794
132006
  if (!response.ok)
131795
132007
  throw new Error(`the account read failed (${response.status})`);
131796
132008
  const body = await response.json();
@@ -131864,11 +132076,7 @@ function cliDeviceServiceHandoff(options) {
131864
132076
  // packages/omo-native/remote-entry.ts
131865
132077
  init_device_service2();
131866
132078
 
131867
- // packages/memory-core/src/sync/crypto/trust-pin.ts
131868
- init_resilient();
131869
-
131870
132079
  // packages/memory-core/src/journal/fsync.ts
131871
- init_resilient();
131872
132080
  var SKIPPABLE_SYNC_CODES = new Set(["ENOENT", "EISDIR", "EPERM", "EACCES", "EINVAL"]);
131873
132081
 
131874
132082
  // packages/memory-core/src/sync/crypto/vendor/sync-format/keys.ts
@@ -131904,9 +132112,6 @@ var D2 = mod2(-121665n * power2(121666n, P2 - 2n));
131904
132112
  var SQRT_MINUS_ONE2 = power2(2n, (P2 - 1n) / 4n);
131905
132113
  var keyCache2 = new Map;
131906
132114
 
131907
- // packages/memory-core/src/sync/publication.ts
131908
- init_resilient();
131909
-
131910
132115
  // packages/memory-core/src/sync/crypto/trust-pin.ts
131911
132116
  var SOURCES = new Set(["pairing", "recovery", "creator"]);
131912
132117
 
@@ -131959,13 +132164,12 @@ init_device_service3();
131959
132164
 
131960
132165
  // packages/omo-senpi/src/components/remote/index.ts
131961
132166
  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
132167
+ init_factories();
131967
132168
  init_seams();
131968
132169
 
132170
+ // packages/omo-senpi/src/components/remote/device-address.ts
132171
+ init_plan_create();
132172
+ init_remote_ops();
131969
132173
  // packages/omo-senpi/src/components/thread/gateway/store.ts
131970
132174
  init_constants6();
131971
132175
  init_provenance_resolver();