@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,7 +1,8 @@
1
- import type { RepositoryWriteResult } from "./durable-event.js";
2
- export declare const CONVERSATION_MESSAGE_STATES: readonly ["pending", "confirmed", "failed"];
1
+ /** @template {import("./durable-event.js").DurableEvent} [TEvent=import("./durable-event.js").DurableEvent] @typedef {import("./durable-event.js").RepositoryWriteResult<TEvent>} RepositoryWriteResult */
2
+ export const CONVERSATION_MESSAGE_STATES: readonly ["pending", "confirmed", "failed"];
3
+ export type RepositoryWriteResult<TEvent extends import("./durable-event.js").DurableEvent = import("./durable-event.js").DurableEvent> = import("./durable-event.js").RepositoryWriteResult<TEvent>;
3
4
  export type ConversationMessageState = (typeof CONVERSATION_MESSAGE_STATES)[number];
4
- export interface Conversation {
5
+ export type Conversation = {
5
6
  readonly id: string;
6
7
  readonly lastMessagePreview?: string;
7
8
  readonly lastMessageAt?: string;
@@ -9,8 +10,8 @@ export interface Conversation {
9
10
  readonly title: string;
10
11
  readonly unreadCount: number;
11
12
  readonly updatedAt: string;
12
- }
13
- export interface ConversationMessage {
13
+ };
14
+ export type ConversationMessage = {
14
15
  readonly body: string;
15
16
  readonly clientMessageId?: string;
16
17
  readonly conversationId: string;
@@ -20,8 +21,8 @@ export interface ConversationMessage {
20
21
  readonly senderId: string;
21
22
  readonly serverMessageId?: string;
22
23
  readonly state: ConversationMessageState;
23
- }
24
- export interface Notification {
24
+ };
25
+ export type Notification = {
25
26
  readonly body: string;
26
27
  readonly createdAt: string;
27
28
  readonly id: string;
@@ -29,7 +30,7 @@ export interface Notification {
29
30
  readonly referenceId?: string;
30
31
  readonly title: string;
31
32
  readonly type: string;
32
- }
33
+ };
33
34
  export type ConversationLogDelta = {
34
35
  readonly conversation: Conversation;
35
36
  readonly kind: "conversation.upsert";
@@ -54,19 +55,19 @@ export type ConversationLogDelta = {
54
55
  readonly notificationId: string;
55
56
  readonly readAt: string;
56
57
  };
57
- export interface ConversationListParams {
58
+ export type ConversationListParams = {
58
59
  readonly before?: string;
59
60
  readonly limit?: number;
60
- }
61
- export interface MessageListParams {
61
+ };
62
+ export type MessageListParams = {
62
63
  readonly before?: string;
63
64
  readonly limit?: number;
64
- }
65
- export interface NotificationListParams {
65
+ };
66
+ export type NotificationListParams = {
66
67
  readonly limit?: number;
67
68
  readonly unreadOnly?: boolean;
68
- }
69
- export interface ConversationRepositoryEvent {
69
+ };
70
+ export type ConversationRepositoryEvent = {
70
71
  readonly occurredAt: string;
71
72
  readonly payload: {
72
73
  readonly action: "created" | "updated";
@@ -74,7 +75,7 @@ export interface ConversationRepositoryEvent {
74
75
  readonly entityType: "conversation" | "message";
75
76
  };
76
77
  readonly type: "domain.entity-changed";
77
- }
78
+ };
78
79
  export type NotificationRepositoryEvent = {
79
80
  readonly occurredAt: string;
80
81
  readonly payload: {
@@ -85,7 +86,7 @@ export type NotificationRepositoryEvent = {
85
86
  readonly type: "domain.entity-changed";
86
87
  };
87
88
  export type RepositoryEvent = ConversationRepositoryEvent | NotificationRepositoryEvent;
88
- export interface ConversationRepository {
89
+ export type ConversationRepository = {
89
90
  acknowledgeMessage(input: {
90
91
  readonly acknowledgedAt: string;
91
92
  readonly messageId: string;
@@ -106,8 +107,8 @@ export interface ConversationRepository {
106
107
  }): Promise<RepositoryWriteResult<ConversationRepositoryEvent>>;
107
108
  listConversations(params?: ConversationListParams): Promise<readonly Conversation[]>;
108
109
  listMessages(conversationId: string, params?: MessageListParams): Promise<readonly ConversationMessage[]>;
109
- }
110
- export interface NotificationRepository {
110
+ };
111
+ export type NotificationRepository = {
111
112
  applyDelta(delta: ConversationLogDelta): {
112
113
  commit(): Promise<RepositoryWriteResult<RepositoryEvent>>;
113
114
  };
@@ -118,5 +119,5 @@ export interface NotificationRepository {
118
119
  }): {
119
120
  commit(): Promise<RepositoryWriteResult<NotificationRepositoryEvent>>;
120
121
  };
121
- }
122
+ };
122
123
  //# sourceMappingURL=conversation-repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-repository.d.ts","sourceRoot":"","sources":["../../src/repositories/conversation-repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,eAAO,MAAM,2BAA2B,6CAA8C,CAAC;AACvF,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ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E,CAAA;CAAE"}
@@ -1,21 +1,21 @@
1
- export interface DurableEvent {
1
+ export type DurableEvent = {
2
2
  readonly occurredAt: string;
3
3
  readonly payload: unknown;
4
4
  readonly type: string;
5
- }
6
- export interface DurableRepositoryEvent<TEvent extends DurableEvent = DurableEvent> {
5
+ };
6
+ export type DurableRepositoryEvent<TEvent extends DurableEvent = DurableEvent> = {
7
7
  readonly deliveredAt: string | undefined;
8
8
  readonly deliveryAttempts: number;
9
9
  readonly event: TEvent;
10
10
  readonly sequence: number;
11
- }
12
- export interface DurableRepositoryEventStore<TEvent extends DurableEvent = DurableEvent> {
11
+ };
12
+ export type DurableRepositoryEventStore<TEvent extends DurableEvent = DurableEvent> = {
13
13
  listUndelivered(): Promise<readonly DurableRepositoryEvent<TEvent>[]>;
14
14
  markDelivered(sequence: number, deliveredAt: string): Promise<void>;
15
15
  markDeliveryAttempt(sequence: number): Promise<void>;
16
- }
17
- export interface RepositoryWriteResult<TEvent extends DurableEvent = DurableEvent> {
16
+ };
17
+ export type RepositoryWriteResult<TEvent extends DurableEvent = DurableEvent> = {
18
18
  readonly eventSequences: readonly number[];
19
19
  readonly events: readonly TEvent[];
20
- }
20
+ };
21
21
  //# sourceMappingURL=durable-event.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"durable-event.d.ts","sourceRoot":"","sources":["../../src/repositories/durable-event.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB,CAAC,MAAM,SAAS,YAAY,GAAG,YAAY;IAChF,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;I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AC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE;kCACnO,MAAM,SAArB,YAAa,mBAAiC;IAAE,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE"}
@@ -0,0 +1,168 @@
1
+ export type NodeAppInstallSource = "local" | "registry" | "upload";
2
+ export type NodeAppMemoryAttribution = "aggregate_shared_host" | "exact_cgroup" | "exact_isolate" | "exact_process" | "mapped_partial" | "self_reported" | "unavailable";
3
+ export type NodeAppMemoryAvailability = "measured" | "stale" | "unavailable";
4
+ export type NodeAppMemorySource = "bun_heap_self_report" | "cgroup_v2" | "main_pid_smaps_rollup" | "main_pid_status_vm_rss" | "proc_smaps_mappings" | "proc_smaps_rollup" | "shared_host_residual";
5
+ export type NodeAppMemoryUnavailableReason = "cgroup_unavailable" | "non_linux" | "not_attributable" | "not_sampled" | "permission_denied" | "proc_unavailable" | "process_not_running" | "systemd_unavailable";
6
+ export type NodeAppRuntimeMode = "dedicated" | "shared";
7
+ export type NodeAppStatus = "active" | "consent_required" | "degraded" | "error" | "installed" | "lazy" | "restarting" | "stopped";
8
+ export type NodeAppType = "bun" | "native";
9
+ export type NodeAppMemoryReading = {
10
+ attribution: NodeAppMemoryAttribution;
11
+ availability: NodeAppMemoryAvailability;
12
+ observedAt: string;
13
+ reason?: NodeAppMemoryUnavailableReason;
14
+ source: NodeAppMemorySource;
15
+ valueKb: number | null;
16
+ };
17
+ export type NodeAppMemorySnapshot = {
18
+ heapTotal: NodeAppMemoryReading;
19
+ heapUsed: NodeAppMemoryReading;
20
+ external: NodeAppMemoryReading;
21
+ heapCapacity: NodeAppMemoryReading;
22
+ pss: NodeAppMemoryReading;
23
+ rss: NodeAppMemoryReading;
24
+ };
25
+ export type NodeAppMemoryApp = {
26
+ appType: NodeAppType;
27
+ author: string;
28
+ description: string;
29
+ id: string;
30
+ installSource: NodeAppInstallSource;
31
+ memory?: NodeAppMemorySnapshot;
32
+ name: string;
33
+ runtimeMode?: NodeAppRuntimeMode;
34
+ status: NodeAppStatus;
35
+ version: string;
36
+ };
37
+ export type NodeAppMemoryRepository = {
38
+ listApps: () => Promise<readonly NodeAppMemoryApp[]>;
39
+ readApp: (id: string) => Promise<NodeAppMemoryApp | undefined>;
40
+ readOverview: () => Promise<NodeAppMemoryOverview>;
41
+ captureMemorySnapshot: (id: string) => Promise<NodeAppHeapSnapshot>;
42
+ readMemorySnapshotStatus: (id: string) => Promise<NodeAppHeapSnapshot | null>;
43
+ downloadMemorySnapshot: (id: string, snapshotId: string) => Promise<NodeAppMemoryDownload>;
44
+ };
45
+ export type NodeAppMemoryDownload = {
46
+ arrayBuffer: () => Promise<ArrayBuffer>;
47
+ readonly size: number;
48
+ readonly type: string;
49
+ };
50
+ export type NodeAppHeapSnapshotState = "capturing" | "complete" | "failed";
51
+ export type NodeAppHeapObjectTypeCount = {
52
+ count: number;
53
+ objectType: string;
54
+ sizeBytes: number;
55
+ };
56
+ export type NodeAppHeapSnapshotSummary = {
57
+ objectCount: number;
58
+ objectTypes: readonly NodeAppHeapObjectTypeCount[];
59
+ };
60
+ export type NodeAppHeapSnapshot = {
61
+ appId: string;
62
+ completedAt: string | null;
63
+ createdAt: string;
64
+ error: string | null;
65
+ id: string;
66
+ sizeBytes: number | null;
67
+ state: NodeAppHeapSnapshotState;
68
+ summary: NodeAppHeapSnapshotSummary | null;
69
+ };
70
+ export type NodeAppLifecycleMemoryObservation = {
71
+ appId: string;
72
+ observedAt: string;
73
+ releasedKb: number;
74
+ };
75
+ export type NodeAppMemoryBudgetBasis = "heap_used" | "not_attributable" | "pss" | "rss";
76
+ export type NodeAppMemoryTrendVerdict = "flat" | "growing" | "ratcheting" | "sawtooth" | "unknown";
77
+ /**
78
+ * Growth classification over the trailing sample window. `slopeKbPerHour`,
79
+ * `fitQuality`, `ratchetRatio`, `heapFloorSlopeKbPerHour`, and
80
+ * `hoursToBudget` are each omitted (not `null`) when the host did not
81
+ * compute them — mirroring the Rust `#[serde(skip_serializing_if =
82
+ * "Option::is_none")]` wire contract.
83
+ */
84
+ export type NodeAppMemoryTrend = {
85
+ aggregate: boolean;
86
+ basis: NodeAppMemoryBudgetBasis;
87
+ computedAt: string;
88
+ fitQuality?: number;
89
+ heapFloorSlopeKbPerHour?: number;
90
+ hoursToBudget?: number;
91
+ ratchetRatio?: number;
92
+ sampleCount: number;
93
+ slopeKbPerHour?: number;
94
+ verdict: NodeAppMemoryTrendVerdict;
95
+ windowHours: number;
96
+ };
97
+ export type NodeAppMemoryCapabilityCallCount = {
98
+ capability: string;
99
+ invocations: number;
100
+ };
101
+ /**
102
+ * Capability call load over the same window as {@link NodeAppMemoryTrend}.
103
+ */
104
+ export type NodeAppMemoryActivityRollup = {
105
+ callsPerMinute: number;
106
+ computedAt: string;
107
+ errors: number;
108
+ invocations: number;
109
+ topCapabilities: readonly NodeAppMemoryCapabilityCallCount[];
110
+ windowHours: number;
111
+ };
112
+ export type NodeAppBudgetState = "not_attributable" | "ok" | "over";
113
+ export type NodeAppLaneKind = "evicted" | "idle_countdown" | "running" | "sleeping" | "warm";
114
+ export type NodeAppTerminationReason = "idle" | "pressure";
115
+ export type NodeAppPressureState = "evicting" | "ok" | "unknown";
116
+ export type NodeAppBudgetVerdict = {
117
+ aggregate: boolean;
118
+ basis: NodeAppMemoryBudgetBasis;
119
+ budgetKb: number | null;
120
+ overByKb: number | null;
121
+ state: NodeAppBudgetState;
122
+ valueKb: number | null;
123
+ };
124
+ export type NodeAppGovernorRow = {
125
+ appId: string;
126
+ appName: string;
127
+ eligibility: string;
128
+ idleSecs: number;
129
+ inFlight: number;
130
+ lane: NodeAppLaneKind;
131
+ lastStopAt?: string;
132
+ lastStopReason?: NodeAppTerminationReason;
133
+ lastWakeAt?: string;
134
+ minIdleSecs?: number;
135
+ secsRemaining?: number;
136
+ terminationReason?: NodeAppTerminationReason;
137
+ };
138
+ export type NodeAppDeviceMemory = {
139
+ highWaterKb: number;
140
+ lowWaterKb: number;
141
+ memAvailableKb: number | null;
142
+ memTotalKb: number | null;
143
+ psiSomeAvg10: number | null;
144
+ platformRssKb: number | null;
145
+ pressureState: NodeAppPressureState;
146
+ swapFreeKb: number | null;
147
+ swapTotalKb: number | null;
148
+ };
149
+ export type NodeAppMemoryOverviewApp = {
150
+ activity?: NodeAppMemoryActivityRollup;
151
+ budget: NodeAppBudgetVerdict;
152
+ governor?: NodeAppGovernorRow;
153
+ id: string;
154
+ memory?: Partial<NodeAppMemorySnapshot>;
155
+ capture?: NodeAppHeapSnapshot | null;
156
+ lifecycleObservation?: NodeAppLifecycleMemoryObservation | null;
157
+ name: string;
158
+ runtimeMode?: NodeAppRuntimeMode;
159
+ status: NodeAppStatus;
160
+ trend?: NodeAppMemoryTrend;
161
+ version: string;
162
+ };
163
+ export type NodeAppMemoryOverview = {
164
+ apps: readonly NodeAppMemoryOverviewApp[];
165
+ device: NodeAppDeviceMemory | null;
166
+ sharedHostResidual?: NodeAppMemoryReading;
167
+ };
168
+ //# sourceMappingURL=node-app-memory-repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-app-memory-repository.d.ts","sourceRoot":"","sources":["../../src/repositories/node-app-memory-repository.js"],"names":[],"mappings":"mCAEc,OAAO,GAAG,UAAU,GAAG,QAAQ;uCAE9B,uBAAuB,GAC/B,cAAc,GACd,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,aAAa;wCAEN,UAAU,GAAG,OAAO,GAAG,aAAa;kCAEnC,sBAAsB,GAC9B,WAAW,GACX,uBAAuB,GACvB,wBAAwB,GACxB,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB;6CAGd,oBAAoB,GAC5B,WAAW,GACX,kBAAkB,GAClB,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,qBAAqB,GACrB,qBAAqB;iCAEd,WAAW,GAAG,QAAQ;4BAErB,QAAQ,GAChB,kB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;YACb,kBAAkB;aAClB,MAAM;;;UAIN,SAAS,wBAAwB,EAAE;YACnC,mBAAmB,GAAG,IAAI;yBAC1B,oBAAoB"}
@@ -1,7 +1,24 @@
1
- import type { RepositoryWriteResult } from "./durable-event.js";
2
- import type { RepositoryJsonValue } from "./repository-mutation.js";
1
+ /** @template {import("./durable-event.js").DurableEvent} [TEvent=import("./durable-event.js").DurableEvent] @typedef {import("./durable-event.js").RepositoryWriteResult<TEvent>} RepositoryWriteResult */
2
+ /** @typedef {import("./repository-mutation.js").RepositoryJsonValue} RepositoryJsonValue */
3
+ /** @typedef {"acknowledged" | "conflict" | "failed" | "pending" | "replaying"} OutboxRecordState */
4
+ /** @typedef {{ readonly createdAt: string, readonly domain: string, readonly id: string, readonly idempotencyKey: string, readonly payload: RepositoryJsonValue, readonly state: OutboxRecordState, readonly updatedAt: string }} OutboxRecord */
5
+ /** @typedef {OutboxRecord & { readonly attemptCount: number, readonly leaseExpiresAt: string, readonly leaseToken: string, readonly state: "replaying" }} OutboxReplayClaim */
6
+ /** @typedef {{ readonly attemptCount: number, readonly createdAt: string, readonly domain: string, readonly id: string, readonly lastErrorCode?: string, readonly lastErrorMessage?: string, readonly nextAttemptAt?: string, readonly settledAt?: string, readonly state: OutboxRecordState, readonly terminalErrorCode?: string, readonly terminalErrorMessage?: string, readonly updatedAt: string }} OutboxReplayStatus */
7
+ /** @typedef {{ readonly id: string, readonly leaseToken: string, readonly outcome: "acknowledged" } | { readonly error: { readonly code: string, readonly message: string }, readonly id: string, readonly leaseToken: string, readonly outcome: "conflict" | "failed" } | { readonly error: { readonly code: string, readonly message: string }, readonly id: string, readonly leaseToken: string, readonly outcome: "retry", readonly retryAt: string }} OutboxSettleInput */
8
+ /** @typedef {{ readonly occurredAt: string, readonly payload: { readonly intent: OutboxRecord }, readonly type: "outbox.state-changed" }} OutboxStateChangedEvent */
9
+ /** @typedef {{ readonly occurredAt: string, readonly payload: { readonly action: "deleted", readonly entityId: string, readonly entityType: "outbox-intent" }, readonly type: "domain.entity-changed" }} OutboxDeletedEvent */
10
+ /** @typedef {OutboxDeletedEvent | OutboxStateChangedEvent} OutboxRepositoryEvent */
11
+ /** @typedef {{ readonly domain?: string, readonly state?: OutboxRecordState }} OutboxRepositoryFilter */
12
+ export class OutboxIdempotencyConflictError extends Error {
13
+ /** @param {string} idempotencyKey */
14
+ constructor(idempotencyKey: string);
15
+ /** @readonly @type {string} */
16
+ readonly idempotencyKey: string;
17
+ }
18
+ export type RepositoryWriteResult<TEvent extends import("./durable-event.js").DurableEvent = import("./durable-event.js").DurableEvent> = import("./durable-event.js").RepositoryWriteResult<TEvent>;
19
+ export type RepositoryJsonValue = import("./repository-mutation.js").RepositoryJsonValue;
3
20
  export type OutboxRecordState = "acknowledged" | "conflict" | "failed" | "pending" | "replaying";
4
- export interface OutboxRecord {
21
+ export type OutboxRecord = {
5
22
  readonly createdAt: string;
6
23
  readonly domain: string;
7
24
  readonly id: string;
@@ -9,14 +26,14 @@ export interface OutboxRecord {
9
26
  readonly payload: RepositoryJsonValue;
10
27
  readonly state: OutboxRecordState;
11
28
  readonly updatedAt: string;
12
- }
13
- export interface OutboxReplayClaim extends OutboxRecord {
29
+ };
30
+ export type OutboxReplayClaim = OutboxRecord & {
14
31
  readonly attemptCount: number;
15
32
  readonly leaseExpiresAt: string;
16
33
  readonly leaseToken: string;
17
34
  readonly state: "replaying";
18
- }
19
- export interface OutboxReplayStatus {
35
+ };
36
+ export type OutboxReplayStatus = {
20
37
  readonly attemptCount: number;
21
38
  readonly createdAt: string;
22
39
  readonly domain: string;
@@ -29,7 +46,7 @@ export interface OutboxReplayStatus {
29
46
  readonly terminalErrorCode?: string;
30
47
  readonly terminalErrorMessage?: string;
31
48
  readonly updatedAt: string;
32
- }
49
+ };
33
50
  export type OutboxSettleInput = {
34
51
  readonly id: string;
35
52
  readonly leaseToken: string;
@@ -52,14 +69,14 @@ export type OutboxSettleInput = {
52
69
  readonly outcome: "retry";
53
70
  readonly retryAt: string;
54
71
  };
55
- export interface OutboxStateChangedEvent {
72
+ export type OutboxStateChangedEvent = {
56
73
  readonly occurredAt: string;
57
74
  readonly payload: {
58
75
  readonly intent: OutboxRecord;
59
76
  };
60
77
  readonly type: "outbox.state-changed";
61
- }
62
- export interface OutboxDeletedEvent {
78
+ };
79
+ export type OutboxDeletedEvent = {
63
80
  readonly occurredAt: string;
64
81
  readonly payload: {
65
82
  readonly action: "deleted";
@@ -67,17 +84,13 @@ export interface OutboxDeletedEvent {
67
84
  readonly entityType: "outbox-intent";
68
85
  };
69
86
  readonly type: "domain.entity-changed";
70
- }
87
+ };
71
88
  export type OutboxRepositoryEvent = OutboxDeletedEvent | OutboxStateChangedEvent;
72
- export interface OutboxRepositoryFilter {
89
+ export type OutboxRepositoryFilter = {
73
90
  readonly domain?: string;
74
91
  readonly state?: OutboxRecordState;
75
- }
76
- export declare class OutboxIdempotencyConflictError extends Error {
77
- readonly idempotencyKey: string;
78
- constructor(idempotencyKey: string);
79
- }
80
- export interface OutboxRepository {
92
+ };
93
+ export type OutboxRepository = {
81
94
  claimHead?(input: {
82
95
  readonly domain: string;
83
96
  readonly leaseExpiresAt: string;
@@ -92,5 +105,5 @@ export interface OutboxRepository {
92
105
  }): Promise<readonly OutboxReplayStatus[]>;
93
106
  settle?(input: OutboxSettleInput): Promise<RepositoryWriteResult<OutboxRepositoryEvent>>;
94
107
  updateState(id: string, state: OutboxRecordState): Promise<RepositoryWriteResult<OutboxRepositoryEvent>>;
95
- }
108
+ };
96
109
  //# sourceMappingURL=outbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"outbox.d.ts","sourceRoot":"","sources":["../../src/repositories/outbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GA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U,CAAC,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,kBAAkB,EAAE,CAAC,CAAC;IAAC,MAAM,CAAC,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,CAAC,CAAA;CAAE"}
@@ -1,5 +1,7 @@
1
1
  export type RepositoryJsonPrimitive = boolean | null | number | string;
2
- export type RepositoryJsonValue = RepositoryJsonPrimitive | RepositoryJsonValue[] | {
2
+ export type RepositoryJsonValue = RepositoryJsonPrimitive | RepositoryJsonArray | RepositoryJsonObject;
3
+ export type RepositoryJsonArray = RepositoryJsonValue[];
4
+ export type RepositoryJsonObject = {
3
5
  readonly [key: string]: RepositoryJsonValue;
4
6
  };
5
7
  //# sourceMappingURL=repository-mutation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repository-mutation.d.ts","sourceRoot":"","sources":["../../src/repositories/repository-mutation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAC3B,uBAAuB,GACvB,mBAAmB,EAAE,GACrB;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"repository-mutation.d.ts","sourceRoot":"","sources":["../../src/repositories/repository-mutation.js"],"names":[],"mappings":"sCAEc,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM;kCAChC,uBAAuB,GAAG,mBAAmB,GAAG,oBAAoB;kCACpE,mBAAmB,EAAE;mCACrB;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAAE"}
@@ -1,26 +1,28 @@
1
- import type { RepositoryJsonValue } from "./repository-mutation.js";
2
- import type { RepositoryWriteResult } from "./durable-event.js";
3
- export declare const REVISIONED_REPOSITORY_DOMAINS: readonly ["agent", "settings", "graph"];
1
+ /** @typedef {import("./repository-mutation.js").RepositoryJsonValue} RepositoryJsonValue */
2
+ /** @template {import("./durable-event.js").DurableEvent} [TEvent=import("./durable-event.js").DurableEvent] @typedef {import("./durable-event.js").RepositoryWriteResult<TEvent>} RepositoryWriteResult */
3
+ export const REVISIONED_REPOSITORY_DOMAINS: readonly ["agent", "settings", "graph"];
4
+ export type RepositoryJsonValue = import("./repository-mutation.js").RepositoryJsonValue;
5
+ export type RepositoryWriteResult<TEvent extends import("./durable-event.js").DurableEvent = import("./durable-event.js").DurableEvent> = import("./durable-event.js").RepositoryWriteResult<TEvent>;
4
6
  export type RevisionedRepositoryDomain = (typeof REVISIONED_REPOSITORY_DOMAINS)[number];
5
- export interface RevisionedEntity<TValue extends RepositoryJsonValue = RepositoryJsonValue> {
7
+ export type RevisionedEntity<TValue extends RepositoryJsonValue = import("./repository-mutation.js").RepositoryJsonValue> = {
6
8
  readonly id: string;
7
9
  readonly rev: number;
8
10
  readonly value: TValue;
9
- }
10
- export interface RevisionCommand<TValue extends RepositoryJsonValue = RepositoryJsonValue> {
11
+ };
12
+ export type RevisionCommand<TValue extends RepositoryJsonValue = import("./repository-mutation.js").RepositoryJsonValue> = {
11
13
  readonly baseRev: number;
12
14
  readonly id: string;
13
15
  readonly idempotencyKey: string;
14
16
  readonly value: TValue;
15
- }
16
- export type RevisionCommandResult<TValue extends RepositoryJsonValue = RepositoryJsonValue> = {
17
+ };
18
+ export type RevisionCommandResult<TValue extends RepositoryJsonValue = import("./repository-mutation.js").RepositoryJsonValue> = {
17
19
  readonly entity: RevisionedEntity<TValue>;
18
20
  readonly status: "accepted";
19
21
  } | {
20
22
  readonly status: "conflict";
21
23
  readonly theirs: RevisionedEntity<TValue>;
22
24
  };
23
- export interface RevisionedRepositoryEvent {
25
+ export type RevisionedRepositoryEvent = {
24
26
  readonly occurredAt: string;
25
27
  readonly payload: {
26
28
  readonly action: "created" | "updated";
@@ -28,13 +30,13 @@ export interface RevisionedRepositoryEvent {
28
30
  readonly entityType: "agent" | "graph" | "setting";
29
31
  };
30
32
  readonly type: "domain.entity-changed";
31
- }
32
- export interface RevisionedRepository<TValue extends RepositoryJsonValue = RepositoryJsonValue> {
33
+ };
34
+ export type RevisionedRepository<TValue extends RepositoryJsonValue = import("./repository-mutation.js").RepositoryJsonValue> = {
33
35
  apply(entity: RevisionedEntity<TValue>): Promise<RepositoryWriteResult<RevisionedRepositoryEvent>>;
34
36
  command(input: RevisionCommand<TValue>): Promise<RevisionCommandResult<TValue>>;
35
37
  list(): Promise<readonly RevisionedEntity<TValue>[]>;
36
38
  read(id: string): Promise<RevisionedEntity<TValue> | undefined>;
37
- }
39
+ };
38
40
  export type AgentRepository = RevisionedRepository;
39
41
  export type RevisionedSettingsRepository = RevisionedRepository;
40
42
  export type GraphRepository = RevisionedRepository;
@@ -1 +1 @@
1
- {"version":3,"file":"revisioned-repository.d.ts","sourceRoot":"","sources":["../../src/repositories/revisioned-repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,eAAO,MAAM,6BAA6B,yCAA0C,CAAC;AACrF,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF,MAAM,WAAW,gBAAgB,CAAC,MAAM,SAAS,mBAAmB,GAAG,mBAAmB;IACxF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;C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CAAC,MAAM,CAAC,CAAA;CAAE;wCACpN;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;KAAE,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAA;CAAE;iCAC7L,MAAM,SAA5B,mBAAoB,6DAAwC;IAAE,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,CAAC,CAAC;IAAC,OAAO,CAAC,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;IAAC,IAAI,IAAI,OAAO,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAA;CAAE;8BAC3W,oBAAoB;2CACpB,oBAAoB;8BACpB,oBAAoB"}
@@ -1,15 +1,15 @@
1
- import type { RepositoryWriteResult } from "./durable-event.js";
2
- import type { RepositoryJsonValue } from "./repository-mutation.js";
3
- export interface SettingRecord {
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 RepositoryJsonValue = import("./repository-mutation.js").RepositoryJsonValue;
3
+ export type SettingRecord = {
4
4
  readonly key: string;
5
5
  readonly updatedAt: string;
6
6
  readonly value: RepositoryJsonValue;
7
- }
8
- export interface SettingInput {
7
+ };
8
+ export type SettingInput = {
9
9
  readonly key: string;
10
10
  readonly value: RepositoryJsonValue;
11
- }
12
- export interface SettingsRepositoryEvent {
11
+ };
12
+ export type SettingsRepositoryEvent = {
13
13
  readonly occurredAt: string;
14
14
  readonly payload: {
15
15
  readonly action: "created" | "deleted" | "updated";
@@ -17,11 +17,11 @@ export interface SettingsRepositoryEvent {
17
17
  readonly entityType: "setting";
18
18
  };
19
19
  readonly type: "domain.entity-changed";
20
- }
21
- export interface SettingsRepository {
20
+ };
21
+ export type SettingsRepository = {
22
22
  delete(key: string): Promise<RepositoryWriteResult<SettingsRepositoryEvent>>;
23
23
  list(): Promise<readonly SettingRecord[]>;
24
24
  read(key: string): Promise<SettingRecord | undefined>;
25
25
  set(input: SettingInput): Promise<RepositoryWriteResult<SettingsRepositoryEvent>>;
26
- }
26
+ };
27
27
  //# sourceMappingURL=settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/repositories/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;CACrC;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;CACrC;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;QACnD,QAAQ,CAAC,QAAQ,EAAE,MAAM,C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