@econ-v1/ports 6.7.0 → 6.11.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 (182) hide show
  1. package/dist/app-data.d.ts +39 -0
  2. package/dist/app-data.d.ts.map +1 -0
  3. package/dist/client-ui-preference.d.ts +23 -0
  4. package/dist/client-ui-preference.d.ts.map +1 -0
  5. package/dist/clipboard.d.ts +41 -0
  6. package/dist/clipboard.d.ts.map +1 -0
  7. package/dist/clock.d.ts +8 -8
  8. package/dist/clock.d.ts.map +1 -1
  9. package/dist/credential-handoff.d.ts +57 -0
  10. package/dist/credential-handoff.d.ts.map +1 -0
  11. package/dist/crypto.d.ts +4 -4
  12. package/dist/crypto.d.ts.map +1 -1
  13. package/dist/id.d.ts +2 -2
  14. package/dist/id.d.ts.map +1 -1
  15. package/dist/identity.d.ts +31 -25
  16. package/dist/identity.d.ts.map +1 -1
  17. package/dist/index.d.ts +226 -30
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/install-environment.d.ts +22 -32
  20. package/dist/install-environment.d.ts.map +1 -1
  21. package/dist/lcd-tree-source.d.ts +54 -0
  22. package/dist/lcd-tree-source.d.ts.map +1 -0
  23. package/dist/legacy-credential.d.ts +30 -0
  24. package/dist/legacy-credential.d.ts.map +1 -0
  25. package/dist/media-preferences.d.ts +2 -44
  26. package/dist/media-preferences.d.ts.map +1 -1
  27. package/dist/network/certificate-trust.d.ts +31 -0
  28. package/dist/network/certificate-trust.d.ts.map +1 -0
  29. package/dist/network/client-node-origin.d.ts +3 -15
  30. package/dist/network/client-node-origin.d.ts.map +1 -1
  31. package/dist/network/home-node-candidate-store.d.ts +4 -32
  32. package/dist/network/home-node-candidate-store.d.ts.map +1 -1
  33. package/dist/network/home-node-candidate.d.ts +9 -7
  34. package/dist/network/home-node-candidate.d.ts.map +1 -1
  35. package/dist/network/l402-payment.d.ts +11 -28
  36. package/dist/network/l402-payment.d.ts.map +1 -1
  37. package/dist/network/node-discovery.d.ts +5 -16
  38. package/dist/network/node-discovery.d.ts.map +1 -1
  39. package/dist/network/webrtc-signaling.d.ts +36 -52
  40. package/dist/network/webrtc-signaling.d.ts.map +1 -1
  41. package/dist/network.d.ts +65 -40
  42. package/dist/network.d.ts.map +1 -1
  43. package/dist/offline-readiness.d.ts +122 -0
  44. package/dist/offline-readiness.d.ts.map +1 -0
  45. package/dist/onboarding-access-code.d.ts +30 -0
  46. package/dist/onboarding-access-code.d.ts.map +1 -0
  47. package/dist/onboarding-checkpoint.d.ts +26 -0
  48. package/dist/onboarding-checkpoint.d.ts.map +1 -0
  49. package/dist/onboarding-presence.d.ts +12 -0
  50. package/dist/onboarding-presence.d.ts.map +1 -0
  51. package/dist/owner-claim-session.d.ts +60 -0
  52. package/dist/owner-claim-session.d.ts.map +1 -0
  53. package/dist/owner-claim.d.ts +22 -0
  54. package/dist/owner-claim.d.ts.map +1 -0
  55. package/dist/repositories/conversation-repository.d.ts +21 -20
  56. package/dist/repositories/conversation-repository.d.ts.map +1 -1
  57. package/dist/repositories/durable-event.d.ts +8 -8
  58. package/dist/repositories/durable-event.d.ts.map +1 -1
  59. package/dist/repositories/node-app-memory-repository.d.ts +168 -0
  60. package/dist/repositories/node-app-memory-repository.d.ts.map +1 -0
  61. package/dist/repositories/outbox.d.ts +33 -20
  62. package/dist/repositories/outbox.d.ts.map +1 -1
  63. package/dist/repositories/repository-mutation.d.ts +3 -1
  64. package/dist/repositories/repository-mutation.d.ts.map +1 -1
  65. package/dist/repositories/revisioned-repository.d.ts +14 -12
  66. package/dist/repositories/revisioned-repository.d.ts.map +1 -1
  67. package/dist/repositories/settings.d.ts +10 -10
  68. package/dist/repositories/settings.d.ts.map +1 -1
  69. package/dist/repositories/sync-ledger.d.ts +11 -11
  70. package/dist/repositories/sync-ledger.d.ts.map +1 -1
  71. package/dist/repositories/wallet-mirror-repository.d.ts +22 -13
  72. package/dist/repositories/wallet-mirror-repository.d.ts.map +1 -1
  73. package/dist/repositories.d.ts +52 -17
  74. package/dist/repositories.d.ts.map +1 -1
  75. package/dist/scheduler.d.ts +4 -4
  76. package/dist/scheduler.d.ts.map +1 -1
  77. package/dist/session-flag.d.ts +48 -0
  78. package/dist/session-flag.d.ts.map +1 -0
  79. package/dist/shell-cache-reset.d.ts +4 -0
  80. package/dist/shell-cache-reset.d.ts.map +1 -0
  81. package/dist/shell-version.d.ts +8 -0
  82. package/dist/shell-version.d.ts.map +1 -0
  83. package/dist/storage.d.ts +76 -34
  84. package/dist/storage.d.ts.map +1 -1
  85. package/dist/theme.d.ts +2 -24
  86. package/dist/theme.d.ts.map +1 -1
  87. package/package.json +14 -10
  88. package/src/app-data.js +42 -0
  89. package/src/client-ui-preference.js +23 -0
  90. package/src/clipboard.js +41 -0
  91. package/src/clock.js +13 -0
  92. package/src/credential-handoff.js +68 -0
  93. package/src/crypto.js +9 -0
  94. package/src/id.js +5 -0
  95. package/src/identity.js +33 -0
  96. package/src/index.js +250 -0
  97. package/src/install-environment.js +44 -0
  98. package/src/lcd-tree-source.js +56 -0
  99. package/src/legacy-credential.js +30 -0
  100. package/src/media-preferences.js +40 -0
  101. package/src/network/certificate-trust.js +25 -0
  102. package/src/network/client-node-origin.js +7 -0
  103. package/src/network/home-node-candidate-store.js +6 -0
  104. package/src/network/home-node-candidate.js +9 -0
  105. package/src/network/l402-payment.js +20 -0
  106. package/src/network/node-discovery.js +13 -0
  107. package/src/network/webrtc-signaling.js +40 -0
  108. package/src/network.js +33 -0
  109. package/src/offline-readiness.js +65 -0
  110. package/src/onboarding-access-code.js +21 -0
  111. package/src/onboarding-checkpoint.js +26 -0
  112. package/src/onboarding-presence.js +15 -0
  113. package/src/owner-claim-session.js +55 -0
  114. package/src/owner-claim.js +22 -0
  115. package/src/repositories/conversation-repository.js +20 -0
  116. package/src/repositories/durable-event.js +8 -0
  117. package/src/repositories/node-app-memory-repository.js +221 -0
  118. package/src/repositories/outbox.js +27 -0
  119. package/src/repositories/repository-mutation.js +8 -0
  120. package/src/repositories/revisioned-repository.js +17 -0
  121. package/src/repositories/settings.js +10 -0
  122. package/src/repositories/sync-ledger.js +11 -0
  123. package/src/repositories/wallet-mirror-repository.js +73 -0
  124. package/src/repositories.js +22 -0
  125. package/src/scheduler.js +6 -0
  126. package/src/session-flag.js +48 -0
  127. package/src/shell-cache-reset.js +3 -0
  128. package/src/shell-version.js +4 -0
  129. package/src/storage.js +60 -0
  130. package/src/theme.js +21 -0
  131. package/dist/clock.js +0 -2
  132. package/dist/clock.js.map +0 -1
  133. package/dist/crypto.js +0 -2
  134. package/dist/crypto.js.map +0 -1
  135. package/dist/id.js +0 -2
  136. package/dist/id.js.map +0 -1
  137. package/dist/identity.js +0 -2
  138. package/dist/identity.js.map +0 -1
  139. package/dist/index.js +0 -9
  140. package/dist/index.js.map +0 -1
  141. package/dist/install-environment.js +0 -26
  142. package/dist/install-environment.js.map +0 -1
  143. package/dist/media-preferences.js +0 -2
  144. package/dist/media-preferences.js.map +0 -1
  145. package/dist/network/client-node-origin.js +0 -18
  146. package/dist/network/client-node-origin.js.map +0 -1
  147. package/dist/network/home-node-candidate-store.js +0 -2
  148. package/dist/network/home-node-candidate-store.js.map +0 -1
  149. package/dist/network/home-node-candidate.js +0 -2
  150. package/dist/network/home-node-candidate.js.map +0 -1
  151. package/dist/network/l402-payment.js +0 -2
  152. package/dist/network/l402-payment.js.map +0 -1
  153. package/dist/network/node-discovery.js +0 -13
  154. package/dist/network/node-discovery.js.map +0 -1
  155. package/dist/network/webrtc-signaling.js +0 -30
  156. package/dist/network/webrtc-signaling.js.map +0 -1
  157. package/dist/network.js +0 -2
  158. package/dist/network.js.map +0 -1
  159. package/dist/repositories/conversation-repository.js +0 -2
  160. package/dist/repositories/conversation-repository.js.map +0 -1
  161. package/dist/repositories/durable-event.js +0 -2
  162. package/dist/repositories/durable-event.js.map +0 -1
  163. package/dist/repositories/outbox.js +0 -9
  164. package/dist/repositories/outbox.js.map +0 -1
  165. package/dist/repositories/repository-mutation.js +0 -2
  166. package/dist/repositories/repository-mutation.js.map +0 -1
  167. package/dist/repositories/revisioned-repository.js +0 -2
  168. package/dist/repositories/revisioned-repository.js.map +0 -1
  169. package/dist/repositories/settings.js +0 -2
  170. package/dist/repositories/settings.js.map +0 -1
  171. package/dist/repositories/sync-ledger.js +0 -2
  172. package/dist/repositories/sync-ledger.js.map +0 -1
  173. package/dist/repositories/wallet-mirror-repository.js +0 -53
  174. package/dist/repositories/wallet-mirror-repository.js.map +0 -1
  175. package/dist/repositories.js +0 -2
  176. package/dist/repositories.js.map +0 -1
  177. package/dist/scheduler.js +0 -2
  178. package/dist/scheduler.js.map +0 -1
  179. package/dist/storage.js +0 -14
  180. package/dist/storage.js.map +0 -1
  181. package/dist/theme.js +0 -2
  182. package/dist/theme.js.map +0 -1
@@ -1,17 +1,17 @@
1
- import type { RepositoryWriteResult } from "./durable-event.js";
2
- export interface SyncLedgerInput {
1
+ export type RepositoryWriteResult<TEvent extends import("./durable-event.js").DurableEvent = import("./durable-event.js").DurableEvent> = import("./durable-event.js").RepositoryWriteResult<TEvent>;
2
+ export type SyncLedgerInput = {
3
3
  readonly cursor: string;
4
4
  readonly domain: string;
5
- }
6
- export interface SyncLedgerRecord extends SyncLedgerInput {
5
+ };
6
+ export type SyncLedgerRecord = SyncLedgerInput & {
7
7
  readonly updatedAt: string;
8
- }
9
- export interface SyncDeltaAppliedEvent {
8
+ };
9
+ export type SyncDeltaAppliedEvent = {
10
10
  readonly occurredAt: string;
11
11
  readonly payload: SyncLedgerInput;
12
12
  readonly type: "sync.delta-applied";
13
- }
14
- export interface SyncCursorDeletedEvent {
13
+ };
14
+ export type SyncCursorDeletedEvent = {
15
15
  readonly occurredAt: string;
16
16
  readonly payload: {
17
17
  readonly action: "deleted";
@@ -19,12 +19,12 @@ export interface SyncCursorDeletedEvent {
19
19
  readonly entityType: "sync-cursor";
20
20
  };
21
21
  readonly type: "domain.entity-changed";
22
- }
22
+ };
23
23
  export type SyncLedgerRepositoryEvent = SyncCursorDeletedEvent | SyncDeltaAppliedEvent;
24
- export interface SyncLedgerRepository {
24
+ export type SyncLedgerRepository = {
25
25
  delete(domain: string): Promise<RepositoryWriteResult<SyncLedgerRepositoryEvent>>;
26
26
  list(): Promise<readonly SyncLedgerRecord[]>;
27
27
  read(domain: string): Promise<SyncLedgerRecord | undefined>;
28
28
  setCursor(input: SyncLedgerInput): Promise<RepositoryWriteResult<SyncLedgerRepositoryEvent>>;
29
- }
29
+ };
30
30
  //# sourceMappingURL=sync-ledger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync-ledger.d.ts","sourceRoot":"","sources":["../../src/repositories/sync-ledger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;QAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;KACpC,CAAC;IACF,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;CACxC;AAED,MAAM,MAAM,yBAAyB,GAAG,sBAAsB,GAAG,qBAAqB,CAAC;AAEvF,MAAM,WAAW,oBAAoB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AAC,yBAAyB,CAAC,CAAC,CAAC;IAAC,IAAI,IAAI,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAAC;IAAC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;IAAC,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,CAAC,CAAA;CAAE"}
@@ -1,4 +1,16 @@
1
- export interface WalletPaymentRecord {
1
+ /** @typedef {{ readonly amountMsat: number, readonly createdAt: string, readonly direction: "incoming" | "outgoing", readonly failureCode?: string, readonly id: string, readonly paymentHash?: string, readonly status: "pending" | "succeeded" | "failed" | "expired", readonly updatedAt: string }} WalletPaymentRecord */
2
+ /** @typedef {{ readonly amountMsat: number, readonly paidAt: string, readonly paymentHash?: string, readonly receiptId: string, readonly resource: string }} WalletL402Receipt */
3
+ /** @typedef {{ readonly balanceMsat: number, readonly l402: readonly WalletL402Receipt[], readonly payments: readonly WalletPaymentRecord[], readonly spendableMsat: number }} WalletSnapshotValue */
4
+ /** @typedef {{ readonly observedAt: string, readonly staleAt: string, readonly value: WalletSnapshotValue }} WalletAuthoritativeSnapshot */
5
+ /** @typedef {{ readonly amountMsat: number, readonly invoiceId: string, readonly kind: "invoice-created", readonly paymentHash?: string, readonly paymentRequest: string, readonly status: "created" } | { readonly amountMsat: number, readonly kind: "payment-submitted", readonly paymentHash?: string, readonly paymentId: string, readonly status: "pending" | "succeeded" | "failed" }} WalletCommandResult */
6
+ /** @typedef {{ readCommandResult(idempotencyKey: string): Promise<WalletCommandResult | undefined>, readSnapshot(): Promise<WalletAuthoritativeSnapshot | undefined>, writeCommandResult(idempotencyKey: string, result: WalletCommandResult): Promise<void>, writeSnapshot(snapshot: WalletAuthoritativeSnapshot): Promise<void> }} WalletMirrorRepository */
7
+ /** @param {unknown} value @returns {value is WalletSnapshotValue} */
8
+ export function isWalletSnapshotValue(value: unknown): value is WalletSnapshotValue;
9
+ /** @param {unknown} value @returns {value is WalletAuthoritativeSnapshot} */
10
+ export function isWalletAuthoritativeSnapshot(value: unknown): value is WalletAuthoritativeSnapshot;
11
+ /** @param {unknown} value @returns {value is WalletCommandResult} */
12
+ export function isWalletCommandResult(value: unknown): value is WalletCommandResult;
13
+ export type WalletPaymentRecord = {
2
14
  readonly amountMsat: number;
3
15
  readonly createdAt: string;
4
16
  readonly direction: "incoming" | "outgoing";
@@ -7,25 +19,25 @@ export interface WalletPaymentRecord {
7
19
  readonly paymentHash?: string;
8
20
  readonly status: "pending" | "succeeded" | "failed" | "expired";
9
21
  readonly updatedAt: string;
10
- }
11
- export interface WalletL402Receipt {
22
+ };
23
+ export type WalletL402Receipt = {
12
24
  readonly amountMsat: number;
13
25
  readonly paidAt: string;
14
26
  readonly paymentHash?: string;
15
27
  readonly receiptId: string;
16
28
  readonly resource: string;
17
- }
18
- export interface WalletSnapshotValue {
29
+ };
30
+ export type WalletSnapshotValue = {
19
31
  readonly balanceMsat: number;
20
32
  readonly l402: readonly WalletL402Receipt[];
21
33
  readonly payments: readonly WalletPaymentRecord[];
22
34
  readonly spendableMsat: number;
23
- }
24
- export interface WalletAuthoritativeSnapshot {
35
+ };
36
+ export type WalletAuthoritativeSnapshot = {
25
37
  readonly observedAt: string;
26
38
  readonly staleAt: string;
27
39
  readonly value: WalletSnapshotValue;
28
- }
40
+ };
29
41
  export type WalletCommandResult = {
30
42
  readonly amountMsat: number;
31
43
  readonly invoiceId: string;
@@ -40,13 +52,10 @@ export type WalletCommandResult = {
40
52
  readonly paymentId: string;
41
53
  readonly status: "pending" | "succeeded" | "failed";
42
54
  };
43
- export interface WalletMirrorRepository {
55
+ export type WalletMirrorRepository = {
44
56
  readCommandResult(idempotencyKey: string): Promise<WalletCommandResult | undefined>;
45
57
  readSnapshot(): Promise<WalletAuthoritativeSnapshot | undefined>;
46
58
  writeCommandResult(idempotencyKey: string, result: WalletCommandResult): Promise<void>;
47
59
  writeSnapshot(snapshot: WalletAuthoritativeSnapshot): Promise<void>;
48
- }
49
- export declare function isWalletSnapshotValue(value: unknown): value is WalletSnapshotValue;
50
- export declare function isWalletAuthoritativeSnapshot(value: unknown): value is WalletAuthoritativeSnapshot;
51
- export declare function isWalletCommandResult(value: unknown): value is WalletCommandResult;
60
+ };
52
61
  //# sourceMappingURL=wallet-mirror-repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-mirror-repository.d.ts","sourceRoot":"","sources":["../../src/repositories/wallet-mirror-repository.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,CAAC;IAC5C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;IAChE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EA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AAE"}
@@ -1,44 +1,79 @@
1
- export interface StageManifest {
1
+ export type StageManifest = {
2
2
  readonly entry: string;
3
3
  readonly integrity: Readonly<Record<string, string>>;
4
4
  readonly requires: readonly string[];
5
5
  readonly version: string;
6
- }
6
+ };
7
+ export type AppDataOfflinePolicy = "last-known" | "online-only";
8
+ export type AppDataQueryKind = "collection" | "detail" | "snapshot";
9
+ export type AppDataStreamKind = "changes" | "events";
10
+ export type AppDataSyncKind = "cursor" | "snapshot";
11
+ export type AppDataSyncPolicy = {
12
+ readonly cursorTtlSecs?: number;
13
+ readonly fullRefreshIntervalSecs?: number;
14
+ readonly kind: AppDataSyncKind;
15
+ readonly retentionSecs?: number;
16
+ };
17
+ export type AppDataQueryDeclaration = {
18
+ readonly capability: string;
19
+ readonly kind: AppDataQueryKind;
20
+ readonly name: string;
21
+ };
22
+ export type AppDataStreamDeclaration = {
23
+ readonly kind: AppDataStreamKind;
24
+ readonly name: string;
25
+ };
26
+ export type AppDataManifest = {
27
+ readonly namespace: string;
28
+ readonly offline: AppDataOfflinePolicy;
29
+ readonly queries: readonly AppDataQueryDeclaration[];
30
+ readonly streams: readonly AppDataStreamDeclaration[];
31
+ readonly sync: AppDataSyncPolicy;
32
+ };
7
33
  export type StageUiKind = "stage" | "widget";
8
- export interface StageUiNav {
34
+ export type StageUiNav = {
9
35
  readonly order: number;
10
36
  readonly section: string;
11
- }
12
- export interface StageUiMetadata {
37
+ };
38
+ export type StageUiRequirements = {
39
+ readonly capabilities: readonly string[];
40
+ readonly queries: readonly string[];
41
+ readonly streams: readonly string[];
42
+ };
43
+ export type StageUiMetadata = {
13
44
  readonly composes: readonly string[];
14
45
  readonly icon?: string;
15
46
  readonly kind: StageUiKind;
16
47
  readonly nav?: StageUiNav;
48
+ readonly requires?: StageUiRequirements;
17
49
  readonly title: string;
18
- readonly uiApi: 1;
19
- }
20
- export interface StageCatalogEntry {
50
+ readonly uiApi: 1 | 2;
51
+ };
52
+ export type StageCatalogEntry = {
21
53
  readonly appName: string;
22
54
  readonly assetBase: string;
55
+ readonly data?: AppDataManifest;
56
+ readonly description?: string;
57
+ readonly keywords?: readonly string[];
23
58
  readonly manifest: StageManifest;
24
59
  readonly manifestSha256: string;
25
60
  readonly ui: StageUiMetadata;
26
- }
27
- export interface StageRegistrySnapshot {
61
+ };
62
+ export type StageRegistrySnapshot = {
28
63
  readonly entries: readonly StageCatalogEntry[];
29
64
  readonly revision: string;
30
- }
31
- export interface StageRegistryPort {
65
+ };
66
+ export type StageRegistryPort = {
32
67
  read(): Promise<StageRegistrySnapshot | undefined>;
33
68
  write(snapshot: StageRegistrySnapshot): Promise<void>;
34
- }
35
- export interface PreparedStageAsset {
69
+ };
70
+ export type PreparedStageAsset = {
36
71
  readonly appName: string;
37
72
  readonly entryUrl: string;
38
73
  readonly manifestSha256: string;
39
74
  readonly version: string;
40
- }
41
- export interface StageAssetPort {
75
+ };
76
+ export type StageAssetPort = {
42
77
  prepare(appName: string, manifest: StageManifest): Promise<PreparedStageAsset>;
43
- }
78
+ };
44
79
  //# sourceMappingURL=repositories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repositories.d.ts","sourceRoot":"","sources":["../src/repositories.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ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OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE;6BAClH;IAAE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAAE"}
@@ -1,12 +1,12 @@
1
- export interface ScheduledJob {
1
+ export type ScheduledJob = {
2
2
  readonly cadenceMs?: number;
3
3
  readonly dueAt: string;
4
4
  readonly name: string;
5
5
  run(): Promise<void>;
6
- }
7
- export interface SchedulerPort {
6
+ };
7
+ export type SchedulerPort = {
8
8
  cancel(name: string): void;
9
9
  register(job: ScheduledJob): void;
10
10
  shutdown(): Promise<void>;
11
- }
11
+ };
12
12
  //# sourceMappingURL=scheduler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../src/scheduler.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B"}
1
+ {"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../src/scheduler.js"],"names":[],"mappings":"2BAEc;IAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE;4BACpG;IAAE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC;IAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Boundary port for the one boolean flag `system/pwa/src/main.ts` needs out of
3
+ * `sessionStorage` before the shell exists: the "Continue in browser" escape hatch
4
+ * (`CONTINUE_IN_BROWSER_KEY`, `system/pwa/src/boot-gate.ts`) that the install landing's
5
+ * "Continue in browser" button sets, and that the top-level boot-gate computation reads back
6
+ * on the next navigation this session.
7
+ *
8
+ * The composition root (`system/pwa/src/main.ts`) may not name `sessionStorage` directly
9
+ * (boundary rules B3/B4, `client/scripts/check-boundaries.mjs`) — this is the narrow surface
10
+ * `client/adapters-web`'s `createBrowserSessionFlag()` implements against the real global,
11
+ * constructed and called directly from `main.ts`, mirroring `ClipboardPort`'s and
12
+ * `MediaPreferencesPort`'s seams.
13
+ *
14
+ * Deliberately NOT routed through one of `client/ui`'s `configureX`/`currentX()` module-level
15
+ * slots the way `ClipboardPort`/`MediaPreferencesPort` are: those ports back calls made FROM
16
+ * `client/ui` (an onboarding screen's paste button, the shell's hover/motion checks), so
17
+ * `client/ui` needs somewhere to read an injected implementation from. Both call sites for
18
+ * this flag — `renderInstallLanding()`'s `onContinue` handler and the top-level
19
+ * `bootShellNow` computation — live in `main.ts` itself, before `<node-app-shell>` or
20
+ * `<node-install-landing>` ever mounts, so there is no `client/ui` consumer to inject into;
21
+ * the composition root simply constructs the adapter and calls it directly, the same way it
22
+ * already does for `InstallEnvironmentPort`'s `installEnv.isStandalone()`.
23
+ *
24
+ * Deliberately synchronous: the read backs `bootShellNow`, a top-level, synchronous
25
+ * computation in `main.ts` made before the kernel/RPC bridge exists (see `boot-gate.ts`'s own
26
+ * doc comment on `BootGateInputs`) — turning it async would restructure the whole boot path
27
+ * for a nicer port shape, which is not this port's job. `MediaPreferencesPort`'s two methods
28
+ * are synchronous for the identical reason: both are read before any RPC bridge exists.
29
+ *
30
+ * Both methods degrade to the SAME safe default the pre-extraction inline `try`/`catch`
31
+ * blocks in `main.ts` documented — reading or writing `sessionStorage` can throw under
32
+ * strict privacy modes (Safari private browsing, some content blockers), AND merely
33
+ * accessing the `sessionStorage` property itself can throw a `SecurityError` in other
34
+ * locked-down embedders (Firefox/Chrome "block all cookies", an `<iframe sandbox>` without
35
+ * `allow-same-origin`) — the adapter constructor guards the latter the same way its
36
+ * `getItem`/`setItem` calls guard the former, so losing the flag must never block booting
37
+ * the shell, nor may it ever throw and abort evaluation of the composition root:
38
+ * - `read()` returns `false` both when the flag was never set AND when the read itself
39
+ * failed — the "the flag never stuck" outcome, which simply shows the install landing
40
+ * again next time, exactly the pre-existing behavior.
41
+ * - `set()` swallows a failed write silently; the visitor already asked to continue in the
42
+ * browser and a storage failure must not stand in the way of that.
43
+ */
44
+ export type SessionFlagPort = {
45
+ read: (key: string) => boolean;
46
+ set: (key: string) => void;
47
+ };
48
+ //# sourceMappingURL=session-flag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-flag.d.ts","sourceRoot":"","sources":["../src/session-flag.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6Cc,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO;SACxB,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI"}
@@ -0,0 +1,4 @@
1
+ export type ShellCacheResetPort = {
2
+ reset(): void;
3
+ };
4
+ //# sourceMappingURL=shell-cache-reset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-cache-reset.d.ts","sourceRoot":"","sources":["../src/shell-cache-reset.js"],"names":[],"mappings":"kCACc;IAAE,KAAK,IAAI,IAAI,CAAA;CAAE"}
@@ -0,0 +1,8 @@
1
+ export type ShellVersionReport = {
2
+ readonly available: string | undefined;
3
+ readonly running: string | undefined;
4
+ };
5
+ export type ShellVersionPort = {
6
+ read(): Promise<ShellVersionReport>;
7
+ };
8
+ //# sourceMappingURL=shell-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-version.d.ts","sourceRoot":"","sources":["../src/shell-version.js"],"names":[],"mappings":"iCACc;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE;+BAChF;IAAE,IAAI,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAAE"}
package/dist/storage.d.ts CHANGED
@@ -1,14 +1,25 @@
1
- import type { StageRegistryPort } from "./repositories.js";
2
- import type { DurableRepositoryEventStore } from "./repositories/durable-event.js";
3
- import type { ConversationRepository, NotificationRepository, RepositoryEvent } from "./repositories/conversation-repository.js";
4
- import type { OutboxRepository, OutboxRepositoryEvent } from "./repositories/outbox.js";
5
- import type { SettingsRepository, SettingsRepositoryEvent } from "./repositories/settings.js";
6
- import type { SyncLedgerRepository, SyncLedgerRepositoryEvent } from "./repositories/sync-ledger.js";
7
- import type { AgentRepository, GraphRepository, RevisionedRepositoryEvent, RevisionedSettingsRepository } from "./repositories/revisioned-repository.js";
8
- import type { WalletMirrorRepository } from "./repositories/wallet-mirror-repository.js";
9
- export declare const RESET_LOCAL_STORAGE_CONFIRMATION = "RESET LOCAL CLIENT DATA";
10
- export type StorageRecoveryCode = "checksum-drift" | "corrupt" | "diagnostic-failed" | "identity-source-unavailable" | "migration-failed" | "opfs-unavailable" | "quota-exceeded" | "worker-operation-timeout" | "worker-preparation-timeout" | "writer-conflict";
11
- export declare const STORAGE_RECOVERY_MESSAGES: {
1
+ /** @typedef {import("./repositories.js").StageRegistryPort} StageRegistryPort */
2
+ /** @typedef {import("./repositories/conversation-repository.js").ConversationRepository} ConversationRepository */
3
+ /** @typedef {import("./repositories/conversation-repository.js").NotificationRepository} NotificationRepository */
4
+ /** @typedef {import("./repositories/conversation-repository.js").RepositoryEvent} RepositoryEvent */
5
+ /** @typedef {import("./repositories/outbox.js").OutboxRepository} OutboxRepository */
6
+ /** @typedef {import("./repositories/outbox.js").OutboxRepositoryEvent} OutboxRepositoryEvent */
7
+ /** @typedef {import("./repositories/settings.js").SettingsRepository} SettingsRepository */
8
+ /** @typedef {import("./repositories/settings.js").SettingsRepositoryEvent} SettingsRepositoryEvent */
9
+ /** @typedef {import("./repositories/sync-ledger.js").SyncLedgerRepository} SyncLedgerRepository */
10
+ /** @typedef {import("./repositories/sync-ledger.js").SyncLedgerRepositoryEvent} SyncLedgerRepositoryEvent */
11
+ /** @typedef {import("./repositories/revisioned-repository.js").AgentRepository} AgentRepository */
12
+ /** @typedef {import("./repositories/revisioned-repository.js").GraphRepository} GraphRepository */
13
+ /** @typedef {import("./repositories/revisioned-repository.js").RevisionedRepositoryEvent} RevisionedRepositoryEvent */
14
+ /** @typedef {import("./repositories/revisioned-repository.js").RevisionedSettingsRepository} RevisionedSettingsRepository */
15
+ /** @typedef {import("./repositories/wallet-mirror-repository.js").WalletMirrorRepository} WalletMirrorRepository */
16
+ /** @typedef {import("./offline-readiness.js").OfflineProjectionRepository} OfflineProjectionRepository */
17
+ /** @typedef {import("./offline-readiness.js").OfflineIdentityScope} OfflineIdentityScope */
18
+ /** @typedef {import("./offline-readiness.js").OfflineStageRepository} OfflineStageRepository */
19
+ export const RESET_LOCAL_STORAGE_CONFIRMATION: "RESET LOCAL CLIENT DATA";
20
+ /** @typedef {"checksum-drift" | "corrupt" | "diagnostic-failed" | "identity-source-unavailable" | "migration-failed" | "opfs-unavailable" | "quota-exceeded" | "worker-operation-timeout" | "worker-preparation-timeout" | "writer-conflict"} StorageRecoveryCode */
21
+ /** @satisfies {Readonly<Record<StorageRecoveryCode, string>>} */
22
+ export const STORAGE_RECOVERY_MESSAGES: {
12
23
  readonly "checksum-drift": "Local schema history does not match this client build";
13
24
  readonly corrupt: "Local SQLite data failed its integrity check";
14
25
  readonly "diagnostic-failed": "Encrypted storage diagnostic creation failed";
@@ -20,18 +31,44 @@ export declare const STORAGE_RECOVERY_MESSAGES: {
20
31
  readonly "worker-preparation-timeout": "Protected storage request preparation timed out";
21
32
  readonly "writer-conflict": "Another client-node storage writer is active";
22
33
  };
23
- export interface StorageReadyState {
34
+ export class StorageOperationError extends Error {
35
+ /**
36
+ * @param {StorageRecoveryCode} code
37
+ */
38
+ constructor(code: StorageRecoveryCode);
39
+ /** @readonly */
40
+ readonly code: StorageRecoveryCode;
41
+ }
42
+ export type StageRegistryPort = import("./repositories.js").StageRegistryPort;
43
+ export type ConversationRepository = import("./repositories/conversation-repository.js").ConversationRepository;
44
+ export type NotificationRepository = import("./repositories/conversation-repository.js").NotificationRepository;
45
+ export type RepositoryEvent = import("./repositories/conversation-repository.js").RepositoryEvent;
46
+ export type OutboxRepository = import("./repositories/outbox.js").OutboxRepository;
47
+ export type OutboxRepositoryEvent = import("./repositories/outbox.js").OutboxRepositoryEvent;
48
+ export type SettingsRepository = import("./repositories/settings.js").SettingsRepository;
49
+ export type SettingsRepositoryEvent = import("./repositories/settings.js").SettingsRepositoryEvent;
50
+ export type SyncLedgerRepository = import("./repositories/sync-ledger.js").SyncLedgerRepository;
51
+ export type SyncLedgerRepositoryEvent = import("./repositories/sync-ledger.js").SyncLedgerRepositoryEvent;
52
+ export type AgentRepository = import("./repositories/revisioned-repository.js").AgentRepository;
53
+ export type GraphRepository = import("./repositories/revisioned-repository.js").GraphRepository;
54
+ export type RevisionedRepositoryEvent = import("./repositories/revisioned-repository.js").RevisionedRepositoryEvent;
55
+ export type RevisionedSettingsRepository = import("./repositories/revisioned-repository.js").RevisionedSettingsRepository;
56
+ export type WalletMirrorRepository = import("./repositories/wallet-mirror-repository.js").WalletMirrorRepository;
57
+ export type OfflineProjectionRepository = import("./offline-readiness.js").OfflineProjectionRepository;
58
+ export type OfflineIdentityScope = import("./offline-readiness.js").OfflineIdentityScope;
59
+ export type OfflineStageRepository = import("./offline-readiness.js").OfflineStageRepository;
60
+ export type StorageRecoveryCode = "checksum-drift" | "corrupt" | "diagnostic-failed" | "identity-source-unavailable" | "migration-failed" | "opfs-unavailable" | "quota-exceeded" | "worker-operation-timeout" | "worker-preparation-timeout" | "writer-conflict";
61
+ export type StorageReadyState = {
24
62
  readonly schemaVersion: number;
25
- /** Changes only after a destructive local-storage replacement. */
26
63
  readonly storageGeneration?: number;
27
64
  readonly status: "ready";
28
- }
29
- export interface StorageStartingState {
65
+ };
66
+ export type StorageStartingState = {
30
67
  readonly schemaVersion: number;
31
68
  readonly storageGeneration?: number;
32
69
  readonly status: "starting";
33
- }
34
- export interface StorageRecoveryRequiredState {
70
+ };
71
+ export type StorageRecoveryRequiredState = {
35
72
  readonly actions: {
36
73
  readonly exportDiagnostic: boolean;
37
74
  readonly reset: true;
@@ -42,9 +79,9 @@ export interface StorageRecoveryRequiredState {
42
79
  readonly schemaVersion: number;
43
80
  readonly storageGeneration?: number;
44
81
  readonly status: "recovery-required";
45
- }
82
+ };
46
83
  export type StorageRecoveryState = StorageReadyState | StorageRecoveryRequiredState | StorageStartingState;
47
- export interface EncryptedStorageDiagnostic {
84
+ export type EncryptedStorageDiagnostic = {
48
85
  readonly algorithm: "AES-GCM";
49
86
  readonly ciphertextBase64: string;
50
87
  readonly createdAt: string;
@@ -52,46 +89,51 @@ export interface EncryptedStorageDiagnostic {
52
89
  readonly ivBase64: string;
53
90
  readonly kdf: {
54
91
  readonly hash: "SHA-256";
55
- readonly iterations: 310_000;
92
+ readonly iterations: 310000;
56
93
  readonly name: "PBKDF2";
57
94
  readonly saltBase64: string;
58
95
  };
59
- }
60
- export interface StorageDatabasePort {
96
+ };
97
+ export type IdentityScopedStorageRepositoryPort = {
98
+ readonly offlineProjections: OfflineProjectionRepository;
99
+ readonly offlineStages: OfflineStageRepository;
100
+ readonly outbox: OutboxRepository;
101
+ readonly syncLedger: SyncLedgerRepository;
102
+ };
103
+ export type StorageDatabasePort = {
61
104
  readonly repositories: StorageRepositoryPort;
105
+ clearActiveIdentityProjections(): Promise<void>;
106
+ clearScope(scope: OfflineIdentityScope): Promise<void>;
62
107
  close(): Promise<void>;
63
108
  exportEncryptedDiagnostic(options: {
64
109
  readonly passphrase: string;
65
110
  }): Promise<EncryptedStorageDiagnostic>;
66
111
  initialize(): Promise<StorageRecoveryState>;
112
+ reactivateEmptyScope(scope: OfflineIdentityScope): Promise<boolean>;
113
+ referencedAssetRevisions(): Promise<readonly string[]>;
67
114
  refreshIdentityMetadata(): Promise<void>;
68
115
  recoveryState(): Promise<StorageRecoveryState>;
69
116
  reset(options: {
70
117
  readonly confirmation: string;
71
118
  }): Promise<StorageRecoveryState>;
72
119
  retry(): Promise<StorageRecoveryState>;
120
+ scopedRepositories(scope: OfflineIdentityScope): IdentityScopedStorageRepositoryPort;
73
121
  subscribeRecoveryState(listener: (state: StorageRecoveryState) => void): () => void;
74
- }
122
+ };
75
123
  export type StorageRepositoryEvent = OutboxRepositoryEvent | RepositoryEvent | RevisionedRepositoryEvent | SettingsRepositoryEvent | SyncLedgerRepositoryEvent;
76
- export interface StorageRepositoryPort {
77
- /** Optional for compatibility with storage implementations predating P4 domain repositories. */
124
+ export type StorageRepositoryPort = {
78
125
  readonly conversations?: ConversationRepository;
79
- readonly events: DurableRepositoryEventStore<StorageRepositoryEvent>;
80
- /** Optional for compatibility with storage implementations predating P4 domain repositories. */
126
+ readonly events: import("./repositories/durable-event.js").DurableRepositoryEventStore<StorageRepositoryEvent>;
81
127
  readonly notifications?: NotificationRepository;
82
- /** Optional for compatibility with storage implementations predating Task 26 repositories. */
83
128
  readonly agents?: AgentRepository;
84
- /** Optional for compatibility with storage implementations predating Task 26 repositories. */
85
129
  readonly graphs?: GraphRepository;
86
130
  readonly outbox: OutboxRepository;
87
- /** Optional for compatibility with storage implementations predating Task 26 repositories. */
88
131
  readonly revisionedSettings?: RevisionedSettingsRepository;
89
- /** Optional for compatibility with storage implementations predating Task 27 repositories. */
90
132
  readonly wallet?: WalletMirrorRepository;
91
133
  readonly settings: SettingsRepository;
92
134
  readonly syncLedger: SyncLedgerRepository;
93
- }
94
- export interface StoragePort extends StorageDatabasePort {
135
+ };
136
+ export type StoragePort = StorageDatabasePort & {
95
137
  readonly stages: StageRegistryPort;
96
- }
138
+ };
97
139
  //# sourceMappingURL=storage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EAChB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,4BAA4B,EAC7B,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEzF,eAAO,MAAM,gCAAgC,4BAA4B,CAAC;AAE1E,MAAM,MAAM,mBAAmB,GAC3B,gBAAgB,GAChB,SAAS,GACT,mBAAmB,GACnB,6BAA6B,GAC7B,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,0BAA0B,GAC1B,4BAA4B,GAC5B,iBAAiB,CAAC;AAEtB,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAW4B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/ui` may never call `localStorage` or `matchMedia` directly (boundary rules
6
- * B2/B3, `client/scripts/check-boundaries.mjs`) — this is the narrow surface
7
- * `client/adapters-web`'s `createBrowserThemeEnvironment()` implements against the real
8
- * globals, and the composition root (`system/pwa/src/main.ts`) registers it (via
9
- * `client/ui`'s `configureThemeEnvironment`) before the shell's first paint. Every method is
10
- * synchronous and side-effect-free beyond the read/write it names — `theme-init.ts`'s
11
- * anti-FOUC contract requires resolving the initial theme before the shadow tree's first
12
- * paint, which is before the kernel connection (`KernelRpcClient`, itself an async
13
- * `SharedWorker`/leader-tab bridge) even exists, so this can never be mediated through
14
- * `@econ-v1/rpc` the way ordinary UI reads/writes are (rule S4).
15
- */
16
- export interface ThemeEnvironmentPort {
17
- /** Reads the persisted preference, or `undefined` if unset or storage is unavailable
18
- * (private browsing, quota). */
2
+ export type ThemeEnvironmentPort = {
19
3
  getStoredTheme(): ThemePreference | undefined;
20
- /** Persists a preference. Implementations MUST swallow storage failures (private
21
- * browsing, quota) rather than throwing. */
22
4
  setStoredTheme(preference: ThemePreference): void;
23
- /** Current `(prefers-color-scheme: dark)` match; `false` if the environment doesn't
24
- * support media queries. */
25
5
  prefersDarkColorScheme(): boolean;
26
- /** Subscribes to live `(prefers-color-scheme: dark)` changes. Returns an unsubscribe
27
- * function, or `undefined` if the environment doesn't support live media queries. */
28
6
  watchDarkColorScheme(onChange: (matches: boolean) => void): (() => void) | undefined;
29
- }
7
+ };
30
8
  //# sourceMappingURL=theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB;IACnC;oCACgC;IAChC,cAAc,IAAI,eAAe,GAAG,SAAS,CAAC;IAC9C;gDAC4C;IAC5C,cAAc,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC;IAClD;gCAC4B;IAC5B,sBAAsB,IAAI,OAAO,CAAC;IAClC;yFACqF;IACrF,oBAAoB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;CACtF"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.js"],"names":[],"mappings":"8BAEc,OAAO,GAAG,MAAM;mCAgBhB;IAAE,cAAc,IAAI,eAAe,GAAG,SAAS,CAAC;IAAC,cAAc,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC;IAAC,sBAAsB,IAAI,OAAO,CAAC;IAAC,oBAAoB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;CAAE"}