lody 0.114.1 → 0.115.0

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 (86) hide show
  1. package/README.md +2 -0
  2. package/dist/{session-access-DBWXcozo.js → access-Sut1_1-c.js} +263 -130
  3. package/dist/{acp-http-proxy-CEqdfPIb.js → acp-http-proxy-BeNRWwOZ.js} +2 -2
  4. package/dist/{acp-interaction-owner-C9DnwDek.js → acp-interaction-owner-uSfNzpiU.js} +14 -13
  5. package/dist/{agent-execution-KNblr7op.js → agent-execution-D1-dEIN6.js} +5 -5
  6. package/dist/{analytics-events-DgubpwYf.js → analytics-events-BQIrmfJp.js} +2 -2
  7. package/dist/{app-DO6nxrTQ.js → app-J2sTmsZo.js} +15 -14
  8. package/dist/{auth-BzBqWcHJ.js → auth-CTegS0TL.js} +2 -2
  9. package/dist/{automation-CaVyvwqU.js → automation-BL7x_nUm.js} +15 -14
  10. package/dist/chunks/{vendor-loro-repo-KiPOxZ47.js → vendor-loro-repo-B1zdQ8Qd.js} +3 -2
  11. package/dist/chunks/{vendor-undici-D9lUGEXQ.js → vendor-undici-Cm00wA7x.js} +3 -2
  12. package/dist/chunks/{vendor-undici-Dkj-EYtJ.js → vendor-undici-aSjjVk9-.js} +4 -3
  13. package/dist/claude-acp.js +3 -2
  14. package/dist/{cli-presence-application-BPo9zPWo.js → cli-presence-application-D2Dn0fPM.js} +7 -6
  15. package/dist/{client-CG7iYu4O.js → client-BsIzN-iC.js} +14 -13
  16. package/dist/codex-acp.js +3 -2
  17. package/dist/{command-runtime-CU9xs2mb.js → command-runtime-C7EPuHLe.js} +283 -153
  18. package/dist/{control-IZGSPxqh.js → control-CgRxpxvc.js} +18 -17
  19. package/dist/{fs-atomic-sI-5rfuh.js → cross-workspace-D6-aE1-w.js} +67 -7
  20. package/dist/{daemon-ChBsVK29.js → daemon-DWm2IzH9.js} +11 -10
  21. package/dist/{daemon-runner-Czhapxd-.js → daemon-runner-Bn8O9-a0.js} +9 -8
  22. package/dist/{daemon-session-tools-BkNAXJte.js → daemon-session-tools-BSAgq4O1.js} +25 -24
  23. package/dist/{daemon-shared-lCH0JHQD.js → daemon-shared-NcwWGSEj.js} +2 -2
  24. package/dist/{device-preview-rocdCptj.js → device-preview-BjqAbZ9g.js} +50 -25
  25. package/dist/devin-acp.js +3 -2
  26. package/dist/{discovery-query-hcHHutEn.js → discovery-query-C_7lyBI8.js} +2 -2
  27. package/dist/{dsh-BBMJN1_w.js → dsh-DVyIAYZ9.js} +5 -5
  28. package/dist/{dsh-plugins-DyDJ4nyX.js → dsh-plugins-Dfsqsiu7.js} +5 -4
  29. package/dist/{e2ee-Rp-kqqRV.js → e2ee-CslOKVIM.js} +2 -2
  30. package/dist/{e2ee-execution-intent-kcGw6188.js → e2ee-execution-intent-DYBEG410.js} +4 -4
  31. package/dist/{export-CW3tgEh5.js → export-C-zeWP1i.js} +19 -18
  32. package/dist/{feedback-DXHiE_SV.js → feedback-Dde39k5W.js} +15 -14
  33. package/dist/{feedback-wAp0AIne.js → feedback-jvl2Dz8w.js} +2 -2
  34. package/dist/{github-Ds3oR20B.js → github-BtMkInqL.js} +14 -13
  35. package/dist/grok-acp.js +3 -2
  36. package/dist/{http-transport-DDAJ_zUL.js → http-transport-C1f1XEnB.js} +3 -3
  37. package/dist/{index-BR78_63y.js → index-BTgKuz44.js} +7 -7
  38. package/dist/{index-cUL6BMen.js → index-BUam8GIX.js} +15 -14
  39. package/dist/{index-Z-zMjsvr.js → index-BsfKnSuo.js} +629 -731
  40. package/dist/{index-vrW0djgm.js → index-Ce9khNjj.js} +29 -28
  41. package/dist/{index-DNfm72S8.js → index-Dy-FYtdl.js} +20 -19
  42. package/dist/index.js +7 -6
  43. package/dist/{internal-BlRJVTRc.js → internal-BPOwohVc.js} +25 -24
  44. package/dist/{local-ipc-BQZPuSjl.js → local-ipc-B8vySppK.js} +12 -3
  45. package/dist/{local-project-control-client-vC7RtUIF.js → local-project-control-client-CIBpaXbo.js} +3 -3
  46. package/dist/{lody-mcp-http-protocol-d_6zEbk9.js → lody-mcp-http-protocol-DBLKn7SZ.js} +4 -4
  47. package/dist/{lody-mcp-server-DOkbYw6c.js → lody-mcp-server-B4OeNPT4.js} +22 -19
  48. package/dist/{login-Nwpcfzb7.js → login-Df1IkdeV.js} +7 -6
  49. package/dist/{login-shell-env-DiOZ-bog.js → login-shell-env-HKDW5zwx.js} +2 -2
  50. package/dist/{logout-C13Nc5pT.js → logout-gDuSiB0l.js} +7 -6
  51. package/dist/{machine-DJ0Pn0js.js → machine-bjdZ1hmy.js} +23 -22
  52. package/dist/{machine-protocol-capabilities-LN7bzFSN.js → machine-protocol-capabilities-DEhAj9SH.js} +80 -77
  53. package/dist/{mcp-z0JBqqIQ.js → mcp-DTnh_PAT.js} +20 -19
  54. package/dist/{migrate-DxEEhXQ9.js → migrate-CUdZ3XBR.js} +231 -73
  55. package/dist/{operation-CuFKC3x2.js → operation-CzLcjV3W.js} +16 -15
  56. package/dist/{operation-store-D1TdJgBc.js → operation-store-rllAX2mr.js} +3 -3
  57. package/dist/{presence-BGW-7JQJ.js → presence-CZco7UQH.js} +4 -4
  58. package/dist/{presence-legacy-BI0h0kBA.js → presence-legacy-DIYBtj5j.js} +3 -3
  59. package/dist/{project-BPuPcKZT.js → project-C_EZ2dLN.js} +21 -20
  60. package/dist/{register-hqq68K_S.js → register-VLBUVPh5.js} +26 -26
  61. package/dist/{remote-pairing-BixLRGZN.js → remote-pairing-D24xSpRh.js} +19 -18
  62. package/dist/{reset-identity-Arhv456z.js → reset-identity-DVubJrt0.js} +19 -18
  63. package/dist/{review-DDMytOEX.js → review-6aCgWEdv.js} +2 -2
  64. package/dist/{review-viewer-CkjhHGL8.js → review-viewer-CRYK94SE.js} +3 -3
  65. package/dist/{schedule-C2ooWjeY.js → schedule-CGTbG70S.js} +20 -19
  66. package/dist/{schedule-command-client-Dp2K-GDf.js → schedule-command-client-C6matZWn.js} +19 -18
  67. package/dist/{schedule-command-service-D7OwaAhZ.js → schedule-command-service-2gToipBI.js} +20 -19
  68. package/dist/{schedule-documents-7GqM7IcI.js → schedule-documents-DRc0byQm.js} +3 -3
  69. package/dist/{schedule-recurrence-CGZIb0Pu.js → schedule-recurrence-BVxMRfp4.js} +3 -3
  70. package/dist/{schedule-repository-D8Ui2jvb.js → schedule-repository-dz9iwR0x.js} +3 -3
  71. package/dist/{schedule-run-preparation-BEKS3RjW.js → schedule-run-preparation-1oSQ5i-A.js} +5 -5
  72. package/dist/{schedule-types-DTul4K9c.js → schedule-types-BquxGfza.js} +537 -391
  73. package/dist/{service-CTj21Cv2.js → service-D9xJKmI-.js} +4 -58
  74. package/dist/{session-file-blob-store-bjZk_Pby.js → session-file-blob-store-CBHDgf4e.js} +2 -2
  75. package/dist/{session-image-download-Bz47jmHy.js → session-image-download-DUwc2Fb4.js} +3 -3
  76. package/dist/{session-input-Bm4DZ_ah.js → session-input-MeZheBJ0.js} +2 -2
  77. package/dist/{session-link-CZ1z8J8d.js → session-link-demCF_Y_.js} +2 -2
  78. package/dist/{session-link-export-CF0aLI3O.js → session-link-export-BM1zZQRs.js} +3 -3
  79. package/dist/{session-p5D9mnGA.js → session-npaRR-y3.js} +170 -39
  80. package/dist/{session-operation-targets-yk7bQTAn.js → session-operation-targets-lq3rsTnV.js} +3 -3
  81. package/dist/{setting-CO0xphaD.js → setting-Cq6nKJgF.js} +8 -6
  82. package/dist/{start-DjcjoPvR.js → start-BolVcMOA.js} +391 -142
  83. package/dist/{sync-CUa0QP_M.js → sync-BrDYKZ4H.js} +15 -14
  84. package/dist/{workspace-DA-wPD10.js → workspace-Bthb-nhu.js} +17 -16
  85. package/dist/{workspace-legacy-UCwDS1Zb.js → workspace-legacy-jZ0D5Xl-.js} +184 -66
  86. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { P as Point$1, v as verify, h as hashes, g as getPublicKey, s as sign } from "./chunks/vendor-@noble-ed25519-Ds7aTPMa.js";
2
- import { av as TaggedError, dC as fail$v, dD as succeed, dE as gen, dF as nominal, dG as try_, cJ as isSuccess, cL as isFailure, dH as map$1, dI as mapError, dJ as flatMap, aQ as acquireUseRelease, d as sync, q as suspend, v as void_, j as fail$w, dK as fromResult, af as andThen, bd as uninterruptible, B as tryPromise, a2 as gen$1, aF as mapError$1, dL as getOrThrow, R as fnUntraced, C as acquireRelease, aG as promise, L as try_$1, aK as ensuring, b as flatMap$1, dM as getOrUndefined, dN as get, dO as get$1, dP as of, dQ as fromIterable, dR as empty, dS as fromIterable$1, dT as empty$1, dU as has, dV as has$1, dW as add, dX as set, dY as union, dZ as remove$1, d_ as remove$2, d$ as fromIterable$2, e0 as keys$3, b9 as yieldNow, bc as catch_, e1 as append, e2 as some, ad as isFailure$1, bC as String$1, e3 as isPattern, bN as Struct, bP as ArraySchema, e4 as Uint8Array$1, e5 as decodeUnknownResult, bQ as Int, aL as addFinalizer, as as _await, aj as doneUnsafe, a6 as make, ac as tap, bB as TaggedError$1, e6 as optional, bE as Defect, c1 as Literals, c2 as Number$1, c4 as Literal, aw as Service, ax as succeed$1, bx as catchTag, s as succeed$2, e7 as Tuple, bO as NullOr, e8 as instanceOf, aC as make$1, c3 as Boolean$1, y as map$2, ar as forEach, e9 as ignore, aH as makeUnsafe, a9 as exit, ao as isSuccess$1, bD as optionalKey, am as catchIf, ba as currentTimeMillis, cE as scope, a4 as provide, cW as fn, aA as Clock, cl as scoped, aJ as all, aq as join, b5 as forkIn, aP as onExit, cI as result, ea as monotonicTimeNanos, E as orDie, eb as dropping, bk as take, aM as catchCause, al as interrupt, ec as hasInterrupts, dw as retry, ds as spaced, aE as sleep, ag as succeed$3, T as offerUnsafe, ed as interrupt$1, cN as interrupt$2, d2 as timeout, ee as orElseSucceed, n as as, ef as take$1, eg as onError, eh as release, ah as asVoid, bJ as decodeUnknownSync, x as effect, aU as failCause, cm as map$3, d3 as tapError, a_ as provideService, z as serviceOption, c$ as make$2, cT as isSome, cU as get$2, cc as set$1, ei as makeUnsafe$1, cZ as mergeAll, cf as provideMerge, ej as map$4, ek as getOrElse, d0 as isNone, aT as withSpan, el as isMinLength, em as isMaxLength, en as declare, eo as isResult, be as makeUnsafe$2, aa as close, aN as done, d4 as fromReasons, bl as Scope, a3 as make$3, a7 as cached, ep as build, bg as provide$1, eq as get$3, ab as void_$1, cV as runPromise, cH as isDieReason, aB as die, c0 as isInterruptReason, ap as hasInterruptsOnly, er as buildWithScope, cY as provide$2, cF as fork, es as succeedContext, d9 as ignoreCause, bM as squash, bb as isTimeoutError, ay as uninterruptibleMask, au as interruptible, b0 as Reference, dx as runSync, dp as match, b8 as never, df as tapCause, aO as failCause$1 } from "./chunks/vendor-effect-CNM-5PoN.js";
2
+ import { av as TaggedError, dC as fail$v, dD as succeed, dE as gen, dF as nominal, dG as try_, cJ as isSuccess, cL as isFailure, dH as map$1, dI as mapError, dJ as flatMap, aQ as acquireUseRelease, d as sync, q as suspend, v as void_, j as fail$w, dK as fromResult, af as andThen, bd as uninterruptible, B as tryPromise, a2 as gen$1, aF as mapError$1, dL as getOrThrow, R as fnUntraced, C as acquireRelease, aG as promise, L as try_$1, aK as ensuring, b as flatMap$1, dM as getOrUndefined, dN as get, dO as get$1, dP as of, dQ as fromIterable, dR as empty, dS as fromIterable$1, dT as empty$1, dU as has, dV as has$1, dW as add, dX as set, dY as union, dZ as remove$1, d_ as remove$2, d$ as fromIterable$2, e0 as keys$3, b9 as yieldNow, bc as catch_, e1 as append, e2 as some, ad as isFailure$1, bC as String$1, e3 as isPattern, bN as Struct, bP as ArraySchema, e4 as Uint8Array$1, e5 as decodeUnknownResult, bQ as Int, aL as addFinalizer, as as _await, aj as doneUnsafe, a6 as make, ac as tap, bB as TaggedError$1, e6 as optional, bE as Defect, c1 as Literals, c2 as Number$1, c4 as Literal, aw as Service, ax as succeed$1, bx as catchTag, s as succeed$2, e7 as Tuple, bO as NullOr, e8 as instanceOf, aC as make$1, c3 as Boolean$1, y as map$2, ar as forEach, e9 as ignore, aH as makeUnsafe, a9 as exit, ao as isSuccess$1, bD as optionalKey, am as catchIf, ba as currentTimeMillis, cE as scope, a4 as provide, cW as fn, aA as Clock, cl as scoped, aJ as all, aq as join, b5 as forkIn, aP as onExit, cI as result, ea as monotonicTimeNanos, E as orDie, eb as dropping, bk as take, aM as catchCause, al as interrupt, ec as hasInterrupts, dw as retry, ds as spaced, aE as sleep, ag as succeed$3, T as offerUnsafe, ed as interrupt$1, cN as interrupt$2, d2 as timeout, ee as orElseSucceed, n as as, ef as take$1, eg as onError, eh as release, ah as asVoid, bJ as decodeUnknownSync, x as effect, aU as failCause, cm as map$3, d3 as tapError, a_ as provideService, z as serviceOption, c$ as make$2, cT as isSome, cU as get$2, cc as set$1, ei as makeUnsafe$1, cZ as mergeAll, cf as provideMerge, ej as map$4, ek as getOrElse, d0 as isNone, aT as withSpan, el as isMinLength, em as isMaxLength, en as declare, eo as isResult, be as makeUnsafe$2, aa as close, aN as done, d4 as fromReasons, bl as Scope, a3 as make$3, a7 as cached, ep as build, bg as provide$1, eq as get$3, ab as void_$1, cV as runPromise, cH as isDieReason, aB as die, c0 as isInterruptReason, ap as hasInterruptsOnly, er as buildWithScope, cY as provide$2, cF as fork, es as succeedContext, d9 as ignoreCause, bM as squash, bb as isTimeoutError, ay as uninterruptibleMask, au as interruptible, b0 as Reference, dx as runSync, b8 as never, dp as match, df as tapCause, aO as failCause$1 } from "./chunks/vendor-effect-CNM-5PoN.js";
3
3
  import { d as decode$2, e as encode$1 } from "./chunks/vendor-@ipld-dag-cbor-BNII2wZN.js";
4
4
  import { v as sha512, w as extract, x as sha256, y as expand, z as hmac, A as hkdf, B as argon2idAsync } from "./chunks/vendor-@noble-hashes-BHLu0eWO.js";
5
5
  import { X as X25519, H as HkdfSha256, D as DhkemX25519HkdfSha256$1 } from "./chunks/vendor-@hpke-dhkem-x25519-BavO0sqB.js";
@@ -8,19 +8,20 @@ import { C as Chacha20Poly1305 } from "./chunks/vendor-@hpke-chacha20poly1305-CU
8
8
  import { O as OpenError } from "./chunks/vendor-@hpke-common-CfGjdxIH.js";
9
9
  import { x as xchacha20poly1305 } from "./chunks/vendor-@noble-ciphers-DL-K0bMl.js";
10
10
  import { w as withinAuthorityLimit, a as authorityStamp } from "./authority-clock-CbOcllMG.js";
11
- import { cJ as sharingReplySchemas, cK as sharingChangeSchema, cL as id$2, cM as requestId$1, cN as isE2eeReadQuery, cO as e2eeFeatureTarget, bB as decodeE2eeRpcRequestBody, cP as isE2eeFeatureMethod, bG as encodeE2eeRpcRequestBody, bC as decodeE2eeRpcResponseBody, cQ as E2eeFeatureInputSchema, ap as E2EE_RPC_MAX_FRAME_BYTES, bH as encodeE2eeRpcResponseBody, cR as CloudE2eeLedgerOutage, ak as cliE2eeIdentityDirectory, cS as isCloudE2eeDeviceRevoked, cT as createWorkspaceEpochTransitionLegacy, cU as encryptedWorkspaceResolver, cV as encryptedWorkspaceNamespace, cW as isCloudE2eeMemberRemoved, cX as encryptedWorkspaceRoom, bx as createLoroStreamsJsonStreamClient } from "./command-runtime-CU9xs2mb.js";
11
+ import { cM as sharingReplySchemas, cN as sharingChangeSchema, cO as id$2, cP as requestId$1, cQ as isE2eeReadQuery, cR as e2eeFeatureTarget, bB as decodeE2eeRpcRequestBody, cS as isE2eeFeatureMethod, bG as encodeE2eeRpcRequestBody, bC as decodeE2eeRpcResponseBody, cT as E2eeFeatureInputSchema, ap as E2EE_RPC_MAX_FRAME_BYTES, bH as encodeE2eeRpcResponseBody, cU as CloudE2eeLedgerOutage, ak as cliE2eeIdentityDirectory, cV as createWorkspaceEpochTransitionLegacy, cW as encryptedWorkspaceResolver, c8 as encryptedWorkspaceNamespace, cX as isCloudE2eeMemberRemoved, cY as isCloudE2eeDeviceRevoked, cZ as encryptedWorkspaceRoom, bx as createLoroStreamsJsonStreamClient } from "./command-runtime-C7EPuHLe.js";
12
12
  import { DatabaseSync } from "node:sqlite";
13
- import { c as captureScheduleAuthorization, r as readScheduleAuthorization, s as scheduleDocumentFromMirrorState, a as ScheduleAuthorizationRequestSchema } from "./schedule-repository-D8Ui2jvb.js";
14
- import { g as scheduleDeclarationSubject, e as decodeE2eeIntentRecord, E as E2EE_INTENT_KIND, b as E2EE_INTENT_RECORD_PATTERN, i as isMemberSignableInput, t as turnExecutionDigest, f as encodeE2eeIntentRecord } from "./e2ee-execution-intent-kcGw6188.js";
15
- import { I as ScheduleDefinitionSchema } from "./schedule-types-DTul4K9c.js";
13
+ import { c as captureScheduleAuthorization, r as readScheduleAuthorization, s as scheduleDocumentFromMirrorState, a as ScheduleAuthorizationRequestSchema } from "./schedule-repository-dz9iwR0x.js";
14
+ import { g as scheduleDeclarationSubject, e as decodeE2eeIntentRecord, E as E2EE_INTENT_KIND, b as E2EE_INTENT_RECORD_PATTERN, i as isMemberSignableInput, t as turnExecutionDigest, f as encodeE2eeIntentRecord } from "./e2ee-execution-intent-DYBEG410.js";
15
+ import { I as ScheduleDefinitionSchema } from "./schedule-types-BquxGfza.js";
16
16
  import { o as object, c as string, h as unknown, f as _enum, d as boolean, a as literal, C as custom, n as number, D as ZodError } from "./chunks/vendor-zod-DAcQjQuC.js";
17
17
  import { createRequire } from "node:module";
18
18
  import { existsSync, mkdirSync, chmodSync, closeSync, openSync, constants } from "node:fs";
19
19
  import path__default, { dirname, isAbsolute, join as join$1 } from "node:path";
20
20
  import { pathToFileURL } from "node:url";
21
21
  import { g as getLogger } from "./logger-C-G7jpWR.js";
22
- import { lazyExecutionJournal, encryptedMemberRequester } from "./agent-execution-KNblr7op.js";
23
- import { aI as LocalMachineRpcResponseSchema, bx as LocalE2eePrepareRequestSchema, w as LocalE2eePrepareResponseSchema } from "./local-ipc-BQZPuSjl.js";
22
+ import { lazyExecutionJournal, encryptedMemberRequester } from "./agent-execution-D1-dEIN6.js";
23
+ import { aI as LocalMachineRpcResponseSchema, B as AndroidEmulatorResponseSchema, bx as LocalE2eePrepareRequestSchema, w as LocalE2eePrepareResponseSchema } from "./local-ipc-B8vySppK.js";
24
+ import { a as IosSimulatorResponseSchema } from "./ios-simulator-BduF_qia.js";
24
25
  import { createHash, randomUUID, timingSafeEqual, randomBytes, createDecipheriv, createCipheriv } from "node:crypto";
25
26
  import { i as isContainer } from "./chunks/vendor-loro-crdt-2CFvB1HS.js";
26
27
  import { mkdir, open as open$1, rename, lstat, readFile, readdir, unlink, link, rm } from "node:fs/promises";
@@ -28,7 +29,7 @@ import { getCliNodeExecutable } from "./managed-daemon-release-CwkvVtSj.js";
28
29
  import { b as runCommandOk, d as squashProcessFailure } from "./process-DrX1wZZk.js";
29
30
  import { p as platformLayer } from "./process-options-DNYWY_s6.js";
30
31
  import Database from "better-sqlite3";
31
- import { D as isSessionDocRoomId, aI as getScheduleIdFromRoomId } from "./presence-BGW-7JQJ.js";
32
+ import { D as isSessionDocRoomId, aI as getScheduleIdFromRoomId } from "./presence-CZco7UQH.js";
32
33
  class ValidationError extends TaggedError("ValidationError") {
33
34
  }
34
35
  class ContentError extends TaggedError("ContentError") {
@@ -6153,10 +6154,12 @@ const createRecoveryVaultWithPassword = fnUntraced(function* (input) {
6153
6154
  );
6154
6155
  });
6155
6156
  const openRecoveryVault = fnUntraced(function* (input) {
6157
+ if (!input.locator || input.locator.length > 2048) return yield* vaultError("invalid-input");
6156
6158
  const file = yield* attempt$5(() => parseRecoveryFile(input.recoveryFile));
6157
6159
  return yield* acquireUseRelease(
6158
6160
  succeed$2(file),
6159
6161
  (owned) => gen$1(function* () {
6162
+ if (owned.locator !== input.locator) return yield* vaultError("locator-mismatch");
6160
6163
  const entry = yield* input.store.readEntry(owned.vaultId, owned.vaultId);
6161
6164
  if (!entry || entry.revision !== 0) return yield* vaultError("authentication");
6162
6165
  const master = yield* attempt$5(
@@ -8521,10 +8524,13 @@ function makeEncryptedFeatureAuthorization(options) {
8521
8524
  };
8522
8525
  }
8523
8526
  const attempt$4 = (body) => try_$1({ try: body, catch: (cause) => cause });
8527
+ const featureAdmission = /* @__PURE__ */ new WeakMap();
8524
8528
  const featureWrites = /* @__PURE__ */ new WeakMap();
8525
8529
  const makeEncryptedFeatureReceiver = fnUntraced(function* (options) {
8526
8530
  const scope$1 = yield* scope;
8527
8531
  const delivery = options.client ? makeEncryptedStreamsEnvelopeDelivery(options.client) : null;
8532
+ const admission = featureAdmission.get(options.native) ?? { reads: 0, writes: 0 };
8533
+ featureAdmission.set(options.native, admission);
8528
8534
  const reads = /* @__PURE__ */ new Set(), writes = /* @__PURE__ */ new Set();
8529
8535
  const receive = fnUntraced(function* (envelope, sink, state) {
8530
8536
  if (!options.isOpen()) return true;
@@ -8535,9 +8541,12 @@ const makeEncryptedFeatureReceiver = fnUntraced(function* (options) {
8535
8541
  return yield* fail$w(new Error("e2ee_rpc_request_binding"));
8536
8542
  const read2 = isE2eeReadQuery(opened.input.request.method, opened.input.request.params);
8537
8543
  const active = read2 ? reads : writes;
8538
- if (active.has(envelope.id) || active.size >= 32) return true;
8544
+ const lane = read2 ? "reads" : "writes";
8545
+ if (active.has(envelope.id) || admission[lane] >= 32) return true;
8546
+ admission[lane]++;
8539
8547
  active.add(envelope.id);
8540
8548
  const target = e2eeFeatureTarget(opened.input.request);
8549
+ const devicePreview = opened.input.request.method === "ios-simulator/control" || opened.input.request.method === "android-emulator/control";
8541
8550
  const sharedWork = target.kind === "session" || target.kind === "project";
8542
8551
  const refused2 = succeed$2({ _tag: "Denied", reason: "not-authorized" });
8543
8552
  const authorize = target.kind === "session-read" ? (workspaceId, requesterDevice) => options.authorizeHistoryRead?.(workspaceId, requesterDevice, target.sessionId) ?? refused2 : target.kind === "session" ? (workspaceId, requesterDevice) => options.authorizeSessionExecution?.(workspaceId, requesterDevice, target.sessionId) ?? refused2 : target.kind === "project" ? (workspaceId, requesterDevice) => options.authorizeProjectExecution?.(
@@ -8553,14 +8562,18 @@ const makeEncryptedFeatureReceiver = fnUntraced(function* (options) {
8553
8562
  })),
8554
8563
  (owner) => {
8555
8564
  const work = tryPromise({
8556
- try: () => owner.raw = options.handle(opened.input.request, {
8557
- requestId: opened.requestId,
8558
- requesterDevice: opened.requesterDevice,
8559
- expiresAt: opened.expiresAt,
8560
- signal: owner.controller.signal,
8561
- authority,
8562
- ...requester ? { requester } : {}
8563
- }),
8565
+ try: () => {
8566
+ if (devicePreview && (!authority || authority.signal.aborted || !authority.isCurrent()))
8567
+ throw new Error("e2ee_feature_authority_withdrawn");
8568
+ return owner.raw = options.handle(opened.input.request, {
8569
+ requestId: opened.requestId,
8570
+ requesterDevice: opened.requesterDevice,
8571
+ expiresAt: opened.expiresAt,
8572
+ signal: owner.controller.signal,
8573
+ authority,
8574
+ ...requester ? { requester } : {}
8575
+ });
8576
+ },
8564
8577
  catch: (cause) => cause
8565
8578
  });
8566
8579
  return read2 ? gen$1(function* () {
@@ -8610,7 +8623,7 @@ const makeEncryptedFeatureReceiver = fnUntraced(function* (options) {
8610
8623
  }
8611
8624
  return yield* void_;
8612
8625
  }
8613
- if (authority._tag !== "Authorized" || (opened.input.request.method === "machine/acp-interaction" || target.kind === "session-read") && (!authority.isCurrent || !authoritySignal || authoritySignal.aborted || !authority.isCurrent()) || !options.isOpen() || (yield* currentTimeMillis) >= opened.expiresAt)
8626
+ if (authority._tag !== "Authorized" || (devicePreview || opened.input.request.method === "machine/acp-interaction" || opened.input.request.method === "session/history-write" || target.kind === "session-read") && (!authority.isCurrent || !authoritySignal || authoritySignal.aborted || !authority.isCurrent()) || !options.isOpen() || (yield* currentTimeMillis) >= opened.expiresAt)
8614
8627
  return yield* void_;
8615
8628
  const admittedAuthority = authority.isCurrent && authoritySignal ? { isCurrent: authority.isCurrent, signal: authoritySignal } : void 0;
8616
8629
  const currentAdmission = () => !admittedAuthority || !admittedAuthority.signal.aborted && admittedAuthority.isCurrent();
@@ -8680,21 +8693,21 @@ const makeEncryptedFeatureReceiver = fnUntraced(function* (options) {
8680
8693
  permit: owned?.permit ?? (claim?.state === "claimed" ? claim.permit : void 0)
8681
8694
  };
8682
8695
  }),
8683
- (admission) => gen$1(function* () {
8684
- if (admission.kind === "busy") return void 0;
8685
- if (admission.kind === "uncertain") return yield* uncertain();
8686
- if (admission.kind === "join") {
8687
- const completed = yield* _await(admission.done).pipe(
8696
+ (admission2) => gen$1(function* () {
8697
+ if (admission2.kind === "busy") return void 0;
8698
+ if (admission2.kind === "uncertain") return yield* uncertain();
8699
+ if (admission2.kind === "join") {
8700
+ const completed = yield* _await(admission2.done).pipe(
8688
8701
  as(true),
8689
8702
  timeout(Math.max(1, opened.expiresAt - (yield* currentTimeMillis))),
8690
8703
  catch_(() => succeed$2(false))
8691
8704
  );
8692
8705
  if (!completed) return void 0;
8693
8706
  }
8694
- if (admission.kind === "owner") {
8695
- if (!options.isOpen() || !admission.permit) return void 0;
8696
- const owned = admission.owned ?? {
8697
- permit: admission.permit,
8707
+ if (admission2.kind === "owner") {
8708
+ if (!options.isOpen() || !admission2.permit) return void 0;
8709
+ const owned = admission2.owned ?? {
8710
+ permit: admission2.permit,
8698
8711
  frames: yield* options.native.sealFeatureResult(
8699
8712
  options.machineId,
8700
8713
  opened,
@@ -8724,10 +8737,10 @@ const makeEncryptedFeatureReceiver = fnUntraced(function* (options) {
8724
8737
  }
8725
8738
  return frames2;
8726
8739
  }),
8727
- (admission) => sync(() => {
8728
- if (admission.kind !== "owner") return;
8740
+ (admission2) => sync(() => {
8741
+ if (admission2.kind !== "owner") return;
8729
8742
  active2.delete(writeKey);
8730
- doneUnsafe(admission.done, void_);
8743
+ doneUnsafe(admission2.done, void_);
8731
8744
  })
8732
8745
  );
8733
8746
  if (!response) return yield* void_;
@@ -8764,7 +8777,10 @@ const makeEncryptedFeatureReceiver = fnUntraced(function* (options) {
8764
8777
  }).pipe(
8765
8778
  catch_(() => void_),
8766
8779
  ensuring(
8767
- sync(() => active.delete(envelope.id)).pipe(
8780
+ sync(() => {
8781
+ active.delete(envelope.id);
8782
+ admission[lane]--;
8783
+ }).pipe(
8768
8784
  andThen(
8769
8785
  sink ? promise(() => sink.end().catch(() => void 0)) : void_
8770
8786
  )
@@ -10377,7 +10393,9 @@ class SubmissionError extends TaggedError$1()("SubmissionError", {
10377
10393
  "ordinary-only",
10378
10394
  "corrupt",
10379
10395
  "unconfirmed"
10380
- ])
10396
+ ]),
10397
+ /** The failed append, for allowlisted diagnostics only; it never proves an outcome. */
10398
+ cause: optional(Defect())
10381
10399
  }) {
10382
10400
  }
10383
10401
  const fail$c = (reason) => new SubmissionError({ reason });
@@ -10497,7 +10515,11 @@ class LedgerSubmission extends Service()("@lody/e2ee-core/LedgerSubmission") {
10497
10515
  return yield* appended.failure;
10498
10516
  }
10499
10517
  checked = yield* inspect(record, checked.checkpoint);
10500
- if (!checked.outcome) return yield* fail$c("unconfirmed");
10518
+ if (!checked.outcome)
10519
+ return yield* new SubmissionError({
10520
+ reason: "unconfirmed",
10521
+ ...isFailure(appended) ? { cause: appended.failure } : {}
10522
+ });
10501
10523
  const observed = yield* store(journal.load(anchor));
10502
10524
  yield* store(
10503
10525
  journal.finish(anchor, record, checked.outcome, observed.checkpoint, checked.checkpoint)
@@ -12952,6 +12974,17 @@ const frameSchema = string().min(286).max(2 * E2EE_RPC_MAX_FRAME_BYTES).regex(/^
12952
12974
  const digest$1 = (frame) => sha256(frame);
12953
12975
  const key$1 = (input) => `feature:${input.requestId}`;
12954
12976
  const canonical = (input) => E2eeFeatureInputSchema.parse(JSON.parse(JSON.stringify(input)));
12977
+ const parseFeatureOutcome = (input, value) => {
12978
+ const outcome = LocalMachineRpcResponseSchema.parse(value);
12979
+ const request = input.request;
12980
+ if (outcome.ok && (request.method === "ios-simulator/control" || request.method === "android-emulator/control")) {
12981
+ const result2 = request.method === "ios-simulator/control" ? IosSimulatorResponseSchema.parse(outcome.result) : AndroidEmulatorResponseSchema.parse(outcome.result);
12982
+ if (result2.sessionId !== request.params.sessionId)
12983
+ throw new Error("e2ee_feature_session_binding");
12984
+ return { ok: true, result: result2 };
12985
+ }
12986
+ return outcome;
12987
+ };
12955
12988
  function makeE2eeFeatureRpcClient(options) {
12956
12989
  options = Object.freeze({
12957
12990
  ...options,
@@ -13143,6 +13176,7 @@ function makeE2eeFeatureRpcClient(options) {
13143
13176
  if (bytes2.length > E2EE_FEATURE_MAX_REQUEST_BYTES)
13144
13177
  return yield* fail$w(new Error("e2ee_feature_size"));
13145
13178
  const count = Math.ceil(bytes2.length / E2EE_FEATURE_CHUNK_BYTES);
13179
+ if (count > 128) return yield* fail$w(new Error("e2ee_feature_size"));
13146
13180
  const binding = yield* options.binding(e2eeRpcResource(machineId));
13147
13181
  for (let index = 0; index < count; index++) {
13148
13182
  const chunk = bytes2.subarray(index * E2EE_FEATURE_CHUNK_BYTES, (index + 1) * E2EE_FEATURE_CHUNK_BYTES);
@@ -13261,7 +13295,8 @@ function makeE2eeFeatureRpcClient(options) {
13261
13295
  }
13262
13296
  if (offset !== bytes2.length) return yield* fail$w(new Error("e2ee_feature_page"));
13263
13297
  const outcome = yield* attempt$1(
13264
- () => LocalMachineRpcResponseSchema.parse(
13298
+ () => parseFeatureOutcome(
13299
+ request.input,
13265
13300
  JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes2))
13266
13301
  )
13267
13302
  );
@@ -13307,7 +13342,7 @@ function makeE2eeFeatureRpcClient(options) {
13307
13342
  }
13308
13343
  }
13309
13344
  if (pending.size >= 32) return yield* fail$w(new Error("e2ee_feature_busy"));
13310
- let outcome = yield* attempt$1(() => LocalMachineRpcResponseSchema.parse(result2));
13345
+ let outcome = yield* attempt$1(() => parseFeatureOutcome(request.input, result2));
13311
13346
  let bytes2 = yield* attempt$1(() => new TextEncoder().encode(JSON.stringify(outcome)));
13312
13347
  if (bytes2.length > E2EE_FEATURE_MAX_RESULT_BYTES) {
13313
13348
  const totalBytes = bytes2.length;
@@ -13357,7 +13392,10 @@ function makeE2eeFeatureRpcClient(options) {
13357
13392
  const args = yield* attempt$1(() => canonical(input));
13358
13393
  yield* options.authorizeRequest(args);
13359
13394
  const saved = yield* options.originals.read("sent", key$1(args));
13360
- if (!saved || saved.target !== args.request.machineId || saved.signer !== (yield* options.targetSigner(saved.target, e2eeFeatureTarget(args.request).kind !== "machine")))
13395
+ if (!saved || saved.target !== args.request.machineId || saved.signer !== (yield* options.targetSigner(
13396
+ saved.target,
13397
+ e2eeFeatureTarget(args.request).kind !== "machine"
13398
+ )))
13361
13399
  return yield* fail$w(new Error("e2ee_rpc_original_missing"));
13362
13400
  const original = yield* openFrames(saved.target, unpackFrames(saved.frame));
13363
13401
  if (original.requesterDevice !== options.requesterDevice || !equalJson(original.input, args))
@@ -13903,12 +13941,12 @@ function findUserTurn(doc, userTurnId) {
13903
13941
  return void 0;
13904
13942
  }
13905
13943
  function makeVerifiedExecutionIntent(options) {
13906
- return (intent, doc, lookup = {}) => gen$1(function* () {
13944
+ return (intent, source, lookup = {}) => gen$1(function* () {
13907
13945
  if (options.isClosed() || intent.workspaceId !== options.workspaceId) return void 0;
13908
13946
  let state = (yield* options.ledger()).inspectState();
13909
13947
  const machineId = state.devices.get(options.selfDevice)?.machineId;
13910
13948
  if (!machineId) return refused("e2ee_machine_not_member");
13911
- const row = doc ? findUserTurn(doc, intent.userTurnId) : void 0;
13949
+ const row = source && "readUserTurn" in source ? yield* tryPromise(() => source.readUserTurn(intent.userTurnId)) : source ? findUserTurn(source, intent.userTurnId) : void 0;
13912
13950
  let record;
13913
13951
  let content;
13914
13952
  if (row) {
@@ -18095,21 +18133,48 @@ async function readRemoval(directory) {
18095
18133
  }
18096
18134
  }
18097
18135
  const RevokedDevice = Removed.omit({ membershipId: true });
18136
+ async function readRevokedDevice(directory) {
18137
+ try {
18138
+ return RevokedDevice.parse(
18139
+ JSON.parse(await readFile(join$1(directory, "revoked-device.json"), "utf8"))
18140
+ );
18141
+ } catch (cause) {
18142
+ if (cause.code === "ENOENT") return null;
18143
+ throw cause;
18144
+ }
18145
+ }
18146
+ async function roostDirectoryExists(path) {
18147
+ try {
18148
+ await lstat(path);
18149
+ return true;
18150
+ } catch (cause) {
18151
+ if (cause.code === "ENOENT") return false;
18152
+ throw cause;
18153
+ }
18154
+ }
18155
+ async function wipeRevokedRoost(directory, receipt) {
18156
+ const path = join$1(
18157
+ repositoryDirectory(directory, receipt.genesisHash, receipt.signingPublicKey),
18158
+ "roost"
18159
+ );
18160
+ if (!await roostDirectoryExists(path)) return;
18161
+ await runPromise(
18162
+ scoped(
18163
+ gen$1(function* () {
18164
+ yield* leaseE2eeIdentity(directory, true);
18165
+ yield* tryPromise(() => rm(path, { recursive: true, force: true }));
18166
+ })
18167
+ )
18168
+ );
18169
+ }
18098
18170
  const machineDevicePath = (directory, genesisHash2) => join$1(directory, "custody", `${genesisHash2}.machine.device`);
18099
- async function retireRevokedMachineIdentity(options) {
18171
+ const roostWipeRequiresExclusiveLease = Symbol();
18172
+ async function retireRevokedMachineIdentity(options, exclusive) {
18100
18173
  const directory = cliE2eeIdentityDirectory(options.accountId, options.workspaceId);
18101
18174
  const device = machineDevicePath(directory, options.genesisHash);
18102
18175
  if (!existsSync(device)) return;
18103
18176
  const cloud = options.cloud;
18104
- const receipt = await (async () => {
18105
- try {
18106
- return RevokedDevice.parse(
18107
- JSON.parse(await readFile(join$1(directory, "revoked-device.json"), "utf8"))
18108
- );
18109
- } catch {
18110
- return null;
18111
- }
18112
- })();
18177
+ const receipt = await readRevokedDevice(directory);
18113
18178
  const matchingReceipt = receipt?.genesisHash === options.genesisHash ? receipt : null;
18114
18179
  if (!matchingReceipt && !cloud) return;
18115
18180
  const revoked = await runPromise(
@@ -18120,7 +18185,7 @@ async function retireRevokedMachineIdentity(options) {
18120
18185
  requireOsProtection: existsSync(`${directory}.require-os`),
18121
18186
  keyring: options.keyring
18122
18187
  });
18123
- const { Bytes } = yield* promise(() => import("./index-DNfm72S8.js"));
18188
+ const { Bytes } = yield* promise(() => import("./index-Dy-FYtdl.js"));
18124
18189
  const genesis = yield* fromResult(Bytes.genesisHash(bytes(options.genesisHash)));
18125
18190
  const current = yield* custody.openDevice(genesis);
18126
18191
  const key2 = hex(current.publicKey.toBytes());
@@ -18141,10 +18206,16 @@ async function retireRevokedMachineIdentity(options) {
18141
18206
  ).pipe(catch_(() => succeed$2(void 0)))
18142
18207
  );
18143
18208
  if (!revoked) return;
18209
+ const roost = join$1(repositoryDirectory(directory, options.genesisHash, revoked), "roost");
18210
+ if (await roostDirectoryExists(roost)) {
18211
+ if (!exclusive) return roostWipeRequiresExclusiveLease;
18212
+ await rm(roost, { recursive: true, force: true });
18213
+ }
18144
18214
  await rename(
18145
18215
  device,
18146
18216
  join$1(directory, "custody", `${options.genesisHash}-${revoked}.machine-revoked.device`)
18147
18217
  );
18218
+ return void 0;
18148
18219
  }
18149
18220
  async function eraseRemovedWorkspace(options) {
18150
18221
  const directory = cliE2eeIdentityDirectory(options.accountId, options.workspaceId);
@@ -18179,7 +18250,7 @@ async function eraseRemovedWorkspace(options) {
18179
18250
  directory: join$1(directory, "custody"),
18180
18251
  keyring: options.keyring
18181
18252
  });
18182
- const { Bytes } = yield* promise(() => import("./index-DNfm72S8.js"));
18253
+ const { Bytes } = yield* promise(() => import("./index-Dy-FYtdl.js"));
18183
18254
  const genesis = yield* fromResult(
18184
18255
  Bytes.genesisHash(bytes(removal.genesisHash))
18185
18256
  );
@@ -18295,13 +18366,17 @@ async function prepareCliE2eeMachineLegacy(options) {
18295
18366
  join$1(cliE2eeIdentityDirectory(options.accountId, options.workspaceId), "removed.json")
18296
18367
  );
18297
18368
  }
18298
- return runPromise(
18369
+ const prepare = (exclusive) => runPromise(
18299
18370
  scoped(
18300
18371
  gen$1(function* () {
18301
- yield* leaseE2eeIdentity(cliE2eeIdentityDirectory(options.accountId, options.workspaceId));
18372
+ yield* leaseE2eeIdentity(
18373
+ cliE2eeIdentityDirectory(options.accountId, options.workspaceId),
18374
+ exclusive
18375
+ );
18302
18376
  return yield* tryPromise({
18303
18377
  try: async () => {
18304
- await retireRevokedMachineIdentity(options);
18378
+ if (await retireRevokedMachineIdentity(options, exclusive) === roostWipeRequiresExclusiveLease)
18379
+ return roostWipeRequiresExclusiveLease;
18305
18380
  return prepareMachine(options);
18306
18381
  },
18307
18382
  catch: (error2) => error2
@@ -18309,9 +18384,14 @@ async function prepareCliE2eeMachineLegacy(options) {
18309
18384
  })
18310
18385
  )
18311
18386
  );
18387
+ const result2 = await prepare(false);
18388
+ if (typeof result2 !== "symbol") return result2;
18389
+ const retried = await prepare(true);
18390
+ if (typeof retried === "symbol") throw new Error("e2ee_identity_busy");
18391
+ return retried;
18312
18392
  }
18313
18393
  async function prepareMachine(options) {
18314
- const { Bytes, hashRecordBytes: hashRecordBytes2, verifyLedgerEffect: verifyLedgerEffect2 } = await import("./index-DNfm72S8.js");
18394
+ const { Bytes, hashRecordBytes: hashRecordBytes2, verifyLedgerEffect: verifyLedgerEffect2 } = await import("./index-Dy-FYtdl.js");
18315
18395
  const binding = Binding.parse({
18316
18396
  workspaceId: options.workspaceId,
18317
18397
  genesisHash: options.genesisHash,
@@ -18477,13 +18557,12 @@ async function activateAndPromoteCliE2eeWorkspaceLegacy(options) {
18477
18557
  }
18478
18558
  async function openWorkspace(options, requireActivation, pairing, localLedger) {
18479
18559
  if (await eraseRemovedWorkspace(options)) throw new Error("e2ee_member_removed");
18560
+ const directory = cliE2eeIdentityDirectory(options.accountId, options.workspaceId);
18561
+ const revoked = await readRevokedDevice(directory);
18562
+ if (revoked) await wipeRevokedRoost(directory, revoked);
18480
18563
  const scope2 = runSync(make$3());
18481
18564
  try {
18482
- await runPromise(
18483
- leaseE2eeIdentity(cliE2eeIdentityDirectory(options.accountId, options.workspaceId)).pipe(
18484
- provide(scope2)
18485
- )
18486
- );
18565
+ await runPromise(leaseE2eeIdentity(directory).pipe(provide(scope2)));
18487
18566
  return await openWorkspaceOwned(scope2, options, requireActivation, pairing, localLedger);
18488
18567
  } catch (error2) {
18489
18568
  await runPromise(close(scope2, void_$1));
@@ -18555,7 +18634,7 @@ async function openWorkspaceOwned(scope$1, options, openedActive, openedPairing,
18555
18634
  keyring: options.keyring
18556
18635
  });
18557
18636
  const { Bytes, hashRecordBytes: hashRecordBytes2 } = yield* promise(
18558
- () => import("./index-DNfm72S8.js")
18637
+ () => import("./index-Dy-FYtdl.js")
18559
18638
  );
18560
18639
  const genesis = yield* fromResult(Bytes.genesisHash(bytes(binding.genesisHash)));
18561
18640
  if (hex(hashRecordBytes2(bytes(binding.genesisRecordHex)).toBytes()) !== binding.genesisHash)
@@ -18563,6 +18642,9 @@ async function openWorkspaceOwned(scope$1, options, openedActive, openedPairing,
18563
18642
  const device = yield* custody.openDevice(genesis);
18564
18643
  if (activation && activation.signingPublicKey !== hex(device.publicKey.toBytes()))
18565
18644
  throw new Error("e2ee_binding_conflict");
18645
+ const revoked = yield* tryPromise(() => readRevokedDevice(directory));
18646
+ if (revoked?.genesisHash === binding.genesisHash && revoked.signingPublicKey === hex(device.publicKey.toBytes()))
18647
+ throw new Error("e2ee_device_revoked");
18566
18648
  const credential = yield* custody.deviceCredential(genesis, device.publicKey);
18567
18649
  const readEpochGroup = options.cloud.readEpochGroup?.bind(options.cloud);
18568
18650
  const runtime = yield* makeCliE2eeRuntime({
@@ -18990,7 +19072,7 @@ async function openWorkspaceOwned(scope$1, options, openedActive, openedPairing,
18990
19072
  scoped(
18991
19073
  gen$1(function* () {
18992
19074
  yield* openMachinePairingJournal(directory);
18993
- const { Bytes } = yield* promise(() => import("./index-DNfm72S8.js"));
19075
+ const { Bytes } = yield* promise(() => import("./index-Dy-FYtdl.js"));
18994
19076
  const genesis = yield* fromResult(Bytes.genesisHash(bytes(options.genesisHash)));
18995
19077
  const current = yield* opened.custody.openDevice(genesis);
18996
19078
  if (hex(current.publicKey.toBytes()) !== opened.signingPublicKey || (yield* opened.custody.deviceCredential(genesis, current.publicKey)) !== opened.credential)
@@ -19047,6 +19129,11 @@ async function openWorkspaceOwned(scope$1, options, openedActive, openedPairing,
19047
19129
  }
19048
19130
  if (failures.length === 1) throw failures[0];
19049
19131
  if (failures.length > 1) throw new AggregateError(failures, "e2ee_removal_failed");
19132
+ if (deviceRevoked && recorded)
19133
+ await wipeRevokedRoost(directory, {
19134
+ genesisHash: options.genesisHash,
19135
+ signingPublicKey: opened.signingPublicKey
19136
+ });
19050
19137
  if (memberRemoved)
19051
19138
  await eraseRemovedWorkspace({
19052
19139
  ...options,
@@ -19070,7 +19157,7 @@ async function openWorkspaceOwned(scope$1, options, openedActive, openedPairing,
19070
19157
  const intent = pairing;
19071
19158
  if (!seed || !intent || closed) return false;
19072
19159
  try {
19073
- const { hashRecordBytes: hashRecordBytes2 } = await import("./index-DNfm72S8.js");
19160
+ const { hashRecordBytes: hashRecordBytes2 } = await import("./index-Dy-FYtdl.js");
19074
19161
  const last = seed.recordsHex.at(-1);
19075
19162
  if (!last) return false;
19076
19163
  const status = await run(
@@ -19328,6 +19415,37 @@ async function openWorkspaceOwned(scope$1, options, openedActive, openedPairing,
19328
19415
  })
19329
19416
  );
19330
19417
  return {
19418
+ /** OSS import requires this account's admitted machine and the installed current epoch. */
19419
+ authorizeImport: async () => {
19420
+ await refreshInBackground();
19421
+ await run(
19422
+ gen$1(function* () {
19423
+ if (closed || ledgerBlocked || !requireActivation)
19424
+ return yield* fail$w(
19425
+ new Error(
19426
+ "e2ee_import_unauthorized: Migration requires this account’s active approved non-guest CLI machine in the target workspace."
19427
+ )
19428
+ );
19429
+ const state = (yield* opened.runtime.executionLedger()).inspectState();
19430
+ const device = state.devices.get(opened.signingPublicKey);
19431
+ const member = device && state.members.get(hex(device.membershipId.toBytes()));
19432
+ const account = member && accountIdFromUserId(member.userId);
19433
+ if (!device || device.kind !== "machine" || device.machineId !== options.machineId || !member || member.role === "guest" || !account || isFailure(account) || account.success !== options.accountId)
19434
+ return yield* fail$w(
19435
+ new Error(
19436
+ "e2ee_import_unauthorized: Migration requires this account’s active approved non-guest CLI machine in the target workspace."
19437
+ )
19438
+ );
19439
+ const status = yield* opened.runtime.status();
19440
+ if (!status.hasCurrentKey || status.position === null)
19441
+ return yield* fail$w(
19442
+ new Error(
19443
+ "e2ee_import_current_key_required: Install the current workspace epoch key on this paired CLI machine, then retry."
19444
+ )
19445
+ );
19446
+ })
19447
+ );
19448
+ },
19331
19449
  attachmentToken: async () => {
19332
19450
  if (closed) throw new Error("e2ee_closed");
19333
19451
  const result2 = await options.cloud.getContentToken({
@@ -19515,7 +19633,7 @@ async function openWorkspaceOwned(scope$1, options, openedActive, openedPairing,
19515
19633
  irohFiber = yield* forkIn(
19516
19634
  scoped(
19517
19635
  gen$1(function* () {
19518
- const { Bytes } = yield* promise(() => import("./index-DNfm72S8.js"));
19636
+ const { Bytes } = yield* promise(() => import("./index-Dy-FYtdl.js"));
19519
19637
  const genesis = yield* fromResult(
19520
19638
  Bytes.genesisHash(bytes(binding.genesisHash))
19521
19639
  );
@@ -19707,7 +19825,7 @@ async function retainMachineBootstrap(input, keyring) {
19707
19825
  keyring
19708
19826
  });
19709
19827
  const { Bytes, signVerified: signVerified2 } = yield* promise(
19710
- () => import("./index-DNfm72S8.js")
19828
+ () => import("./index-Dy-FYtdl.js")
19711
19829
  );
19712
19830
  const device = yield* custody.openDevice(
19713
19831
  getOrThrow(Bytes.genesisHash(bytes(unsigned.genesisHash)))
@@ -19778,7 +19896,7 @@ async function loadMachineBootstrap(reference, machineId, keyring) {
19778
19896
  keyring
19779
19897
  });
19780
19898
  const { Bytes, verifySignature: verifySignature2 } = yield* promise(
19781
- () => import("./index-DNfm72S8.js")
19899
+ () => import("./index-Dy-FYtdl.js")
19782
19900
  );
19783
19901
  const genesis = getOrThrow(Bytes.genesisHash(bytes(bootstrap.genesisHash)));
19784
19902
  const device = yield* custody.openDevice(genesis);
@@ -19994,4 +20112,4 @@ export {
19994
20112
  checkInstallationContext as y,
19995
20113
  checkLocalPublication as z
19996
20114
  };
19997
- //# sourceMappingURL=workspace-legacy-UCwDS1Zb.js.map
20115
+ //# sourceMappingURL=workspace-legacy-jZ0D5Xl-.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lody",
3
- "version": "0.114.1",
3
+ "version": "0.115.0",
4
4
  "description": "Lody Agent CLI tool for managing remote command execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",