@econ-v1/domain 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.
- package/dist/errors/index.d.ts +96 -25
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/events/index.d.ts +127 -20
- package/dist/events/index.d.ts.map +1 -1
- package/dist/index.d.ts +250 -47
- package/dist/index.d.ts.map +1 -1
- package/dist/models/agent.d.ts +25 -4
- package/dist/models/agent.d.ts.map +1 -1
- package/dist/models/app-data.d.ts +84 -0
- package/dist/models/app-data.d.ts.map +1 -0
- package/dist/models/conversation.d.ts +12 -2
- package/dist/models/conversation.d.ts.map +1 -1
- package/dist/models/delegation.d.ts +12 -3
- package/dist/models/delegation.d.ts.map +1 -1
- package/dist/models/device-boot-state.d.ts +12 -0
- package/dist/models/device-boot-state.d.ts.map +1 -0
- package/dist/models/device-identity.d.ts +11 -3
- package/dist/models/device-identity.d.ts.map +1 -1
- package/dist/models/graph.d.ts +26 -3
- package/dist/models/graph.d.ts.map +1 -1
- package/dist/models/index.d.ts +82 -14
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/json.d.ts +5 -5
- package/dist/models/json.d.ts.map +1 -1
- package/dist/models/l402.d.ts +4 -5
- package/dist/models/l402.d.ts.map +1 -1
- package/dist/models/live-query-definition.d.ts +15 -16
- package/dist/models/live-query-definition.d.ts.map +1 -1
- package/dist/models/node-app-memory.d.ts +107 -0
- package/dist/models/node-app-memory.d.ts.map +1 -0
- package/dist/models/outbox-intent.d.ts +3 -3
- package/dist/models/outbox-intent.d.ts.map +1 -1
- package/dist/models/outbox.d.ts +67 -15
- package/dist/models/outbox.d.ts.map +1 -1
- package/dist/models/owner-views.d.ts +28 -28
- package/dist/models/owner-views.d.ts.map +1 -1
- package/dist/models/payment.d.ts +28 -9
- package/dist/models/payment.d.ts.map +1 -1
- package/dist/models/query-diff.d.ts +2 -2
- package/dist/models/query-diff.d.ts.map +1 -1
- package/dist/models/release-manifest.d.ts +32 -47
- package/dist/models/release-manifest.d.ts.map +1 -1
- package/dist/models/repository-write.d.ts +3 -3
- package/dist/models/repository-write.d.ts.map +1 -1
- package/dist/models/revisioned-commands.d.ts +66 -13
- package/dist/models/revisioned-commands.d.ts.map +1 -1
- package/dist/models/revisioned.d.ts +50 -10
- package/dist/models/revisioned.d.ts.map +1 -1
- package/dist/models/settings.d.ts +2 -2
- package/dist/models/settings.d.ts.map +1 -1
- package/dist/models/sync.d.ts +18 -18
- package/dist/models/sync.d.ts.map +1 -1
- package/dist/models/wallet.d.ts +16 -16
- package/dist/models/wallet.d.ts.map +1 -1
- package/dist/queries/certificate-trust.d.ts +13 -0
- package/dist/queries/certificate-trust.d.ts.map +1 -0
- package/dist/queries/conversations.d.ts +38 -7
- package/dist/queries/conversations.d.ts.map +1 -1
- package/dist/queries/discovery.d.ts +10 -10
- package/dist/queries/discovery.d.ts.map +1 -1
- package/dist/queries/notifications.d.ts +24 -4
- package/dist/queries/notifications.d.ts.map +1 -1
- package/dist/queries/onboarding-flow.d.ts +25 -0
- package/dist/queries/onboarding-flow.d.ts.map +1 -0
- package/dist/queries/onboarding-lcd-screen.d.ts +56 -0
- package/dist/queries/onboarding-lcd-screen.d.ts.map +1 -0
- package/dist/queries/onboarding-status.d.ts +10 -10
- package/dist/queries/onboarding-status.d.ts.map +1 -1
- package/dist/queries/revisioned.d.ts +47 -13
- package/dist/queries/revisioned.d.ts.map +1 -1
- package/dist/queries/wallet.d.ts +40 -10
- package/dist/queries/wallet.d.ts.map +1 -1
- package/dist/services/abort-signal.d.ts +54 -0
- package/dist/services/abort-signal.d.ts.map +1 -0
- package/dist/services/certificate-trust-service.d.ts +42 -0
- package/dist/services/certificate-trust-service.d.ts.map +1 -0
- package/dist/services/conversation-service.d.ts +103 -15
- package/dist/services/conversation-service.d.ts.map +1 -1
- package/dist/services/conversation-sync.d.ts +9 -5
- package/dist/services/conversation-sync.d.ts.map +1 -1
- package/dist/services/device-boot-state-service.d.ts +17 -0
- package/dist/services/device-boot-state-service.d.ts.map +1 -0
- package/dist/services/device-cleanup-service.d.ts +47 -0
- package/dist/services/device-cleanup-service.d.ts.map +1 -0
- package/dist/services/discovery-probe-service.d.ts +37 -46
- package/dist/services/discovery-probe-service.d.ts.map +1 -1
- package/dist/services/gossip-service.d.ts +28 -13
- package/dist/services/gossip-service.d.ts.map +1 -1
- package/dist/services/invite-redemption-service.d.ts +43 -0
- package/dist/services/invite-redemption-service.d.ts.map +1 -0
- package/dist/services/lan-candidate-refresh-service.d.ts +22 -7
- package/dist/services/lan-candidate-refresh-service.d.ts.map +1 -1
- package/dist/services/lcd-decision-service.d.ts +58 -0
- package/dist/services/lcd-decision-service.d.ts.map +1 -0
- package/dist/services/onboarding-checkpoint-store.d.ts +54 -0
- package/dist/services/onboarding-checkpoint-store.d.ts.map +1 -0
- package/dist/services/onboarding-flow-service.d.ts +180 -0
- package/dist/services/onboarding-flow-service.d.ts.map +1 -0
- package/dist/services/onboarding-status-service.d.ts +21 -38
- package/dist/services/onboarding-status-service.d.ts.map +1 -1
- package/dist/services/outbox-service.d.ts +105 -29
- package/dist/services/outbox-service.d.ts.map +1 -1
- package/dist/services/owner-claim-service.d.ts +187 -0
- package/dist/services/owner-claim-service.d.ts.map +1 -0
- package/dist/services/owner-view-refresh-service.d.ts +40 -0
- package/dist/services/owner-view-refresh-service.d.ts.map +1 -0
- package/dist/services/owner-view-service.d.ts +49 -4
- package/dist/services/owner-view-service.d.ts.map +1 -1
- package/dist/services/peer-directory-service.d.ts +53 -17
- package/dist/services/peer-directory-service.d.ts.map +1 -1
- package/dist/services/release-manifest-verifier.d.ts +18 -20
- package/dist/services/release-manifest-verifier.d.ts.map +1 -1
- package/dist/services/revisioned-domain-service.d.ts +50 -17
- package/dist/services/revisioned-domain-service.d.ts.map +1 -1
- package/dist/services/runtime-globals.d.ts +39 -0
- package/dist/services/runtime-globals.d.ts.map +1 -0
- package/dist/services/session-service.d.ts +23 -3
- package/dist/services/session-service.d.ts.map +1 -1
- package/dist/services/sync/authoritative-mirror.d.ts +88 -15
- package/dist/services/sync/authoritative-mirror.d.ts.map +1 -1
- package/dist/services/sync/index.d.ts +17 -5
- package/dist/services/sync/index.d.ts.map +1 -1
- package/dist/services/sync/log-sync.d.ts +42 -8
- package/dist/services/sync/log-sync.d.ts.map +1 -1
- package/dist/services/sync/revision-merge.d.ts +80 -13
- package/dist/services/sync/revision-merge.d.ts.map +1 -1
- package/dist/services/sync/strategy.d.ts +11 -1
- package/dist/services/sync/strategy.d.ts.map +1 -1
- package/dist/services/transport-manager.d.ts +84 -29
- package/dist/services/transport-manager.d.ts.map +1 -1
- package/dist/services/wallet-mirror-service.d.ts +81 -18
- package/dist/services/wallet-mirror-service.d.ts.map +1 -1
- package/dist/services/wifi-provisioning-service.d.ts +146 -0
- package/dist/services/wifi-provisioning-service.d.ts.map +1 -0
- package/package.json +18 -12
- package/src/errors/index.js +126 -0
- package/src/events/index.js +124 -0
- package/src/index.js +566 -0
- package/src/models/agent.js +43 -0
- package/src/models/app-data.js +122 -0
- package/src/models/conversation.js +36 -0
- package/{dist → src}/models/delegation.js +18 -1
- package/src/models/device-boot-state.js +3 -0
- package/{dist → src}/models/device-identity.js +18 -2
- package/{dist → src}/models/graph.js +30 -3
- package/src/models/index.js +175 -0
- package/src/models/json.js +18 -0
- package/src/models/l402.js +9 -0
- package/src/models/live-query-definition.js +30 -0
- package/src/models/node-app-memory.js +130 -0
- package/src/models/outbox-intent.js +12 -0
- package/{dist → src}/models/outbox.js +102 -3
- package/src/models/owner-views.js +59 -0
- package/src/models/payment.js +24 -0
- package/src/models/query-diff.js +7 -0
- package/src/models/release-manifest.js +160 -0
- package/src/models/repository-write.js +10 -0
- package/src/models/revisioned-commands.js +92 -0
- package/src/models/revisioned.js +41 -0
- package/src/models/settings.js +16 -0
- package/src/models/sync.js +44 -0
- package/src/models/wallet.js +40 -0
- package/src/queries/certificate-trust.js +31 -0
- package/{dist → src}/queries/conversations.js +54 -3
- package/src/queries/discovery.js +34 -0
- package/{dist → src}/queries/notifications.js +25 -2
- package/src/queries/onboarding-flow.js +48 -0
- package/src/queries/onboarding-lcd-screen.js +100 -0
- package/src/queries/onboarding-status.js +34 -0
- package/src/queries/revisioned.js +128 -0
- package/{dist → src}/queries/wallet.js +35 -1
- package/src/services/abort-signal.js +69 -0
- package/src/services/certificate-trust-service.js +119 -0
- package/{dist → src}/services/conversation-service.js +108 -1
- package/src/services/conversation-sync.js +28 -0
- package/src/services/device-boot-state-service.js +45 -0
- package/src/services/device-cleanup-service.js +112 -0
- package/src/services/discovery-probe-service.js +196 -0
- package/{dist → src}/services/gossip-service.js +54 -4
- package/src/services/invite-redemption-service.js +64 -0
- package/src/services/lan-candidate-refresh-service.js +164 -0
- package/src/services/lcd-decision-service.js +93 -0
- package/src/services/onboarding-checkpoint-store.js +155 -0
- package/src/services/onboarding-flow-service.js +1096 -0
- package/src/services/onboarding-status-service.js +64 -0
- package/{dist → src}/services/outbox-service.js +132 -1
- package/src/services/owner-claim-service.js +347 -0
- package/src/services/owner-view-refresh-service.js +208 -0
- package/src/services/owner-view-service.js +87 -0
- package/{dist → src}/services/peer-directory-service.js +72 -3
- package/src/services/release-manifest-verifier.js +108 -0
- package/{dist → src}/services/revisioned-domain-service.js +189 -9
- package/src/services/runtime-globals.js +174 -0
- package/src/services/session-service.js +50 -0
- package/{dist → src}/services/sync/authoritative-mirror.js +90 -1
- package/src/services/sync/index.js +67 -0
- package/src/services/sync/log-sync.js +60 -0
- package/src/services/sync/revision-merge.js +119 -0
- package/src/services/sync/strategy.js +44 -0
- package/src/services/transport-manager.js +478 -0
- package/{dist → src}/services/wallet-mirror-service.js +226 -6
- package/src/services/wifi-provisioning-service.js +278 -0
- package/dist/errors/index.js +0 -45
- package/dist/errors/index.js.map +0 -1
- package/dist/events/index.js +0 -17
- package/dist/events/index.js.map +0 -1
- package/dist/index.js +0 -31
- package/dist/index.js.map +0 -1
- package/dist/models/agent.js +0 -17
- package/dist/models/agent.js.map +0 -1
- package/dist/models/conversation.js +0 -2
- package/dist/models/conversation.js.map +0 -1
- package/dist/models/delegation.js.map +0 -1
- package/dist/models/device-identity.js.map +0 -1
- package/dist/models/graph.js.map +0 -1
- package/dist/models/index.js +0 -8
- package/dist/models/index.js.map +0 -1
- package/dist/models/json.js +0 -2
- package/dist/models/json.js.map +0 -1
- package/dist/models/l402.js +0 -2
- package/dist/models/l402.js.map +0 -1
- package/dist/models/live-query-definition.js +0 -2
- package/dist/models/live-query-definition.js.map +0 -1
- package/dist/models/outbox-intent.js +0 -2
- package/dist/models/outbox-intent.js.map +0 -1
- package/dist/models/outbox.js.map +0 -1
- package/dist/models/owner-views.js +0 -7
- package/dist/models/owner-views.js.map +0 -1
- package/dist/models/payment.js +0 -3
- package/dist/models/payment.js.map +0 -1
- package/dist/models/query-diff.js +0 -2
- package/dist/models/query-diff.js.map +0 -1
- package/dist/models/release-manifest.js +0 -147
- package/dist/models/release-manifest.js.map +0 -1
- package/dist/models/repository-write.js +0 -2
- package/dist/models/repository-write.js.map +0 -1
- package/dist/models/revisioned-commands.js +0 -35
- package/dist/models/revisioned-commands.js.map +0 -1
- package/dist/models/revisioned.js +0 -2
- package/dist/models/revisioned.js.map +0 -1
- package/dist/models/settings.js +0 -2
- package/dist/models/settings.js.map +0 -1
- package/dist/models/sync.js +0 -2
- package/dist/models/sync.js.map +0 -1
- package/dist/models/wallet.js +0 -2
- package/dist/models/wallet.js.map +0 -1
- package/dist/queries/conversations.js.map +0 -1
- package/dist/queries/discovery.js +0 -27
- package/dist/queries/discovery.js.map +0 -1
- package/dist/queries/notifications.js.map +0 -1
- package/dist/queries/onboarding-status.js +0 -27
- package/dist/queries/onboarding-status.js.map +0 -1
- package/dist/queries/revisioned.js +0 -58
- package/dist/queries/revisioned.js.map +0 -1
- package/dist/queries/wallet.js.map +0 -1
- package/dist/services/conversation-service.js.map +0 -1
- package/dist/services/conversation-sync.js +0 -9
- package/dist/services/conversation-sync.js.map +0 -1
- package/dist/services/discovery-probe-service.js +0 -129
- package/dist/services/discovery-probe-service.js.map +0 -1
- package/dist/services/gossip-service.js.map +0 -1
- package/dist/services/lan-candidate-refresh-service.js +0 -79
- package/dist/services/lan-candidate-refresh-service.js.map +0 -1
- package/dist/services/onboarding-status-service.js +0 -32
- package/dist/services/onboarding-status-service.js.map +0 -1
- package/dist/services/outbox-service.js.map +0 -1
- package/dist/services/owner-view-service.js +0 -21
- package/dist/services/owner-view-service.js.map +0 -1
- package/dist/services/peer-directory-service.js.map +0 -1
- package/dist/services/release-manifest-verifier.js +0 -84
- package/dist/services/release-manifest-verifier.js.map +0 -1
- package/dist/services/revisioned-domain-service.js.map +0 -1
- package/dist/services/session-service.js +0 -20
- package/dist/services/session-service.js.map +0 -1
- package/dist/services/sync/authoritative-mirror.js.map +0 -1
- package/dist/services/sync/index.js +0 -4
- package/dist/services/sync/index.js.map +0 -1
- package/dist/services/sync/log-sync.js +0 -20
- package/dist/services/sync/log-sync.js.map +0 -1
- package/dist/services/sync/revision-merge.js +0 -46
- package/dist/services/sync/revision-merge.js.map +0 -1
- package/dist/services/sync/strategy.js +0 -2
- package/dist/services/sync/strategy.js.map +0 -1
- package/dist/services/transport-manager.js +0 -234
- package/dist/services/transport-manager.js.map +0 -1
- package/dist/services/wallet-mirror-service.js.map +0 -1
|
@@ -1,42 +1,130 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("@econ-v1/ports").Conversation} Conversation
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import("@econ-v1/ports").ConversationListParams} ConversationListParams
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {import("@econ-v1/ports").ConversationLogDelta} ConversationLogDelta
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("@econ-v1/ports").ConversationMessage} ConversationMessage
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {import("@econ-v1/ports").ConversationRepository} ConversationRepository
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @typedef {import("@econ-v1/ports").Notification} Notification
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {import("@econ-v1/ports").NotificationListParams} NotificationListParams
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* @typedef {import("@econ-v1/ports").NotificationRepository} NotificationRepository
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* @typedef {import("@econ-v1/ports").OutboxRecord} OutboxRecord
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* @typedef {import("@econ-v1/ports").OutboxRepository} OutboxRepository
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* @typedef {import("@econ-v1/ports").RepositoryEvent} RepositoryEvent
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* @typedef {{ readonly body: string; readonly conversationId: string; readonly idempotencyKey: string; readonly messageId?: string; readonly senderId: string; }} SendMessageInput
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* @typedef {{ readonly id: () => string; readonly now?: () => string; }} ConversationServiceOptions
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* @typedef {RepositoryEvent} ConversationRepositoryWrite
|
|
42
|
+
*/
|
|
43
|
+
export class ConversationService {
|
|
44
|
+
/**
|
|
45
|
+
* @param {{ readonly conversations: ConversationRepository; readonly notifications: NotificationRepository; readonly outbox: OutboxRepository; }} dependencies
|
|
46
|
+
* @param {ConversationServiceOptions} options
|
|
47
|
+
*/
|
|
16
48
|
constructor(dependencies: {
|
|
17
49
|
readonly conversations: ConversationRepository;
|
|
18
50
|
readonly notifications: NotificationRepository;
|
|
19
51
|
readonly outbox: OutboxRepository;
|
|
20
52
|
}, options: ConversationServiceOptions);
|
|
53
|
+
/**
|
|
54
|
+
* @param {SendMessageInput} input
|
|
55
|
+
* @returns {Promise<ConversationMessage>}
|
|
56
|
+
*/
|
|
21
57
|
sendMessage(input: SendMessageInput): Promise<ConversationMessage>;
|
|
58
|
+
/**
|
|
59
|
+
* @param {ConversationLogDelta} delta
|
|
60
|
+
* @returns {Promise<void>}
|
|
61
|
+
*/
|
|
22
62
|
applyDelta(delta: ConversationLogDelta): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* @param {{ readonly acknowledgedAt?: string; readonly messageId: string; readonly serverMessageId?: string; }} input
|
|
65
|
+
* @returns {Promise<void>}
|
|
66
|
+
*/
|
|
23
67
|
acknowledgeMessage(input: {
|
|
24
68
|
readonly acknowledgedAt?: string;
|
|
25
69
|
readonly messageId: string;
|
|
26
70
|
readonly serverMessageId?: string;
|
|
27
71
|
}): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* @param {{ readonly messageId: string; readonly reason: string; readonly failedAt?: string }} input
|
|
74
|
+
* @returns {Promise<void>}
|
|
75
|
+
*/
|
|
28
76
|
failMessage(input: {
|
|
29
77
|
readonly messageId: string;
|
|
30
78
|
readonly reason: string;
|
|
31
79
|
readonly failedAt?: string;
|
|
32
80
|
}): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* @param {ConversationListParams} [params]
|
|
83
|
+
* @returns {Promise<readonly Conversation[]>}
|
|
84
|
+
*/
|
|
33
85
|
listConversations(params?: ConversationListParams): Promise<readonly Conversation[]>;
|
|
86
|
+
/**
|
|
87
|
+
* @param {string} conversationId
|
|
88
|
+
* @param {{ readonly before?: string; readonly limit?: number }} [params]
|
|
89
|
+
* @returns {Promise<readonly ConversationMessage[]>}
|
|
90
|
+
*/
|
|
34
91
|
listMessages(conversationId: string, params?: {
|
|
35
92
|
readonly before?: string;
|
|
36
93
|
readonly limit?: number;
|
|
37
94
|
}): Promise<readonly ConversationMessage[]>;
|
|
95
|
+
/**
|
|
96
|
+
* @param {NotificationListParams} [params]
|
|
97
|
+
* @returns {Promise<readonly Notification[]>}
|
|
98
|
+
*/
|
|
38
99
|
listNotifications(params?: NotificationListParams): Promise<readonly Notification[]>;
|
|
100
|
+
/**
|
|
101
|
+
* @param {string} notificationId
|
|
102
|
+
* @returns {Promise<void>}
|
|
103
|
+
*/
|
|
39
104
|
markNotificationRead(notificationId: string, readAt?: string): Promise<void>;
|
|
105
|
+
#private;
|
|
40
106
|
}
|
|
107
|
+
export type Conversation = import("@econ-v1/ports").Conversation;
|
|
108
|
+
export type ConversationListParams = import("@econ-v1/ports").ConversationListParams;
|
|
109
|
+
export type ConversationLogDelta = import("@econ-v1/ports").ConversationLogDelta;
|
|
110
|
+
export type ConversationMessage = import("@econ-v1/ports").ConversationMessage;
|
|
111
|
+
export type ConversationRepository = import("@econ-v1/ports").ConversationRepository;
|
|
112
|
+
export type Notification = import("@econ-v1/ports").Notification;
|
|
113
|
+
export type NotificationListParams = import("@econ-v1/ports").NotificationListParams;
|
|
114
|
+
export type NotificationRepository = import("@econ-v1/ports").NotificationRepository;
|
|
115
|
+
export type OutboxRecord = import("@econ-v1/ports").OutboxRecord;
|
|
116
|
+
export type OutboxRepository = import("@econ-v1/ports").OutboxRepository;
|
|
117
|
+
export type RepositoryEvent = import("@econ-v1/ports").RepositoryEvent;
|
|
118
|
+
export type SendMessageInput = {
|
|
119
|
+
readonly body: string;
|
|
120
|
+
readonly conversationId: string;
|
|
121
|
+
readonly idempotencyKey: string;
|
|
122
|
+
readonly messageId?: string;
|
|
123
|
+
readonly senderId: string;
|
|
124
|
+
};
|
|
125
|
+
export type ConversationServiceOptions = {
|
|
126
|
+
readonly id: () => string;
|
|
127
|
+
readonly now?: () => string;
|
|
128
|
+
};
|
|
41
129
|
export type ConversationRepositoryWrite = RepositoryEvent;
|
|
42
130
|
//# sourceMappingURL=conversation-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-service.d.ts","sourceRoot":"","sources":["../../src/services/conversation-service.
|
|
1
|
+
{"version":3,"file":"conversation-service.d.ts","sourceRoot":"","sources":["../../src/services/conversation-service.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;IA0BI;;;KAGC;IACD,0BAHS;QAAE,QAAQ,CAAC,aAAa,EAAE,sBAAsB,CAAC;QAAC,QAAQ,CAAC,aAAa,EAAE,sBAAsB,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;KAAE,WACtI,0BAA0B,EAQlC;IACD;;;KAGC;IACD,mBAHS,gBAAgB,GACd,OAAO,CAAC,mBAAmB,CAAC,CAqCtC;IACD;;;KAGC;IACD,kBAHS,oBAAoB,GAClB,OAAO,CAAC,IAAI,CAAC,CAevB;IACD;;;KAGC;IACD,0BAHS;QAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;KAAE,GAClG,OAAO,CAAC,IAAI,CAAC,CAQvB;IACD;;;KAGC;IACD,mBAHS;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GACjF,OAAO,CAAC,IAAI,CAAC,CASvB;IACD;;;KAGC;IACD,2BAHS,sBAAsB,GACpB,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC,CAI1C;IACD;;;;KAIC;IACD,6BAJS,MAAM,WACN;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GACnD,OAAO,CAAC,SAAS,mBAAmB,EAAE,CAAC,CAIjD;IACD;;;KAGC;IACD,2BAHS,sBAAsB,GACpB,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC,CAI1C;IACD;;;KAGC;IACD,qCAHS,MAAM,oBACJ,OAAO,CAAC,IAAI,CAAC,CAKvB;;CACJ;2BA7LY,OAAO,gBAAgB,EAAE,YAAY;qCAGrC,OAAO,gBAAgB,EAAE,sBAAsB;mCAG/C,OAAO,gBAAgB,EAAE,oBAAoB;kCAG7C,OAAO,gBAAgB,EAAE,mBAAmB;qCAG5C,OAAO,gBAAgB,EAAE,sBAAsB;2BAG/C,OAAO,gBAAgB,EAAE,YAAY;qCAGrC,OAAO,gBAAgB,EAAE,sBAAsB;qCAG/C,OAAO,gBAAgB,EAAE,sBAAsB;2BAG/C,OAAO,gBAAgB,EAAE,YAAY;+BAGrC,OAAO,gBAAgB,EAAE,gBAAgB;8BAGzC,OAAO,gBAAgB,EAAE,eAAe;+BAGxC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAAE;yCAGpJ;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CAAE;0CAG3D,eAAe"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
1
|
+
/**
|
|
2
|
+
* @param {Pick<ConversationService, "applyDelta">} service
|
|
3
|
+
* @returns {LogSync<ConversationLogDelta>}
|
|
4
|
+
*/
|
|
5
|
+
export function createConversationLogSync(service: Pick<ConversationService, "applyDelta">): LogSync<ConversationLogDelta>;
|
|
6
|
+
export type ConversationLogDelta = import("../models/conversation.js").ConversationLogDelta;
|
|
7
|
+
export type SyncDeltaContext = import("../models/sync.js").SyncDeltaContext;
|
|
8
|
+
export type ConversationService = import("./conversation-service.js").ConversationService;
|
|
6
9
|
export type ConversationSyncContext = SyncDeltaContext;
|
|
10
|
+
import { LogSync } from "./sync/log-sync.js";
|
|
7
11
|
//# sourceMappingURL=conversation-sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-sync.d.ts","sourceRoot":"","sources":["../../src/services/conversation-sync.
|
|
1
|
+
{"version":3,"file":"conversation-sync.d.ts","sourceRoot":"","sources":["../../src/services/conversation-sync.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH,mDAHW,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,GACrC,OAAO,CAAC,oBAAoB,CAAC,CAUzC;mCAxBY,OAAO,2BAA2B,EAAE,oBAAoB;+BAGxD,OAAO,mBAAmB,EAAE,gBAAgB;kCAG5C,OAAO,2BAA2B,EAAE,mBAAmB;sCAGvD,gBAAgB;wBAEL,oBAAoB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @import { IdentityPort } from "@econ-v1/ports" */
|
|
2
|
+
/** @import { DeviceBootState } from "../models/device-boot-state.js" */
|
|
3
|
+
/** @typedef {{ readonly identity: Pick<IdentityPort, "loadDelegation" | "loadLifecycle">; readonly now: () => string; }} DeviceBootStateServiceOptions */
|
|
4
|
+
export class DeviceBootStateService {
|
|
5
|
+
/** @param {DeviceBootStateServiceOptions} options */
|
|
6
|
+
constructor(options: DeviceBootStateServiceOptions);
|
|
7
|
+
/** @returns {Promise<DeviceBootState>} */
|
|
8
|
+
state(): Promise<DeviceBootState>;
|
|
9
|
+
#private;
|
|
10
|
+
}
|
|
11
|
+
export type DeviceBootStateServiceOptions = {
|
|
12
|
+
readonly identity: Pick<IdentityPort, "loadDelegation" | "loadLifecycle">;
|
|
13
|
+
readonly now: () => string;
|
|
14
|
+
};
|
|
15
|
+
import type { DeviceBootState } from "../models/device-boot-state.js";
|
|
16
|
+
import type { IdentityPort } from "@econ-v1/ports";
|
|
17
|
+
//# sourceMappingURL=device-boot-state-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-boot-state-service.d.ts","sourceRoot":"","sources":["../../src/services/device-boot-state-service.js"],"names":[],"mappings":"AACA,qDAAqD;AACrD,wEAAwE;AACxE,2JAA2J;AAC3J;IAKI,qDAAqD;IACrD,qBADY,6BAA6B,EAIxC;IACD,0CAA0C;IAC1C,SADc,OAAO,CAAC,eAAe,CAAC,CA6BrC;;CACJ;4CAzCc;IAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAE,gBAAgB,GAAG,eAAe,CAAC,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;CAAE;qCADpF,gCAAgC;kCADnC,gBAAgB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export class DeviceCleanupService {
|
|
2
|
+
/** @param {DeviceCleanupServiceOptions} options */
|
|
3
|
+
constructor(options: DeviceCleanupServiceOptions);
|
|
4
|
+
/** The live-query-facing read: `undefined` while no ceremony has ever run for the current
|
|
5
|
+
* generation (nothing requested yet, or `cancel()` cleared it). */
|
|
6
|
+
state(): DeviceCleanupState | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Opens/resumes the node's one live cleanup session (`client-device.cleanup-request.v1`)
|
|
9
|
+
* and, if it comes back `pending`, starts the bounded-backoff poll loop. Safe to call again
|
|
10
|
+
* — each call invalidates whatever poll was previously in flight, matching the ceremony's
|
|
11
|
+
* original "Ask the owner" re-request behaviour.
|
|
12
|
+
*
|
|
13
|
+
* A `requestCleanup()` failure is deliberately NOT caught here: it propagates to the caller
|
|
14
|
+
* exactly as it did when `pairing-gate.ts` awaited the command directly, so the shell's own
|
|
15
|
+
* catch (which renders `cleanupState: "failed"` onto the still-locally-held device-limit
|
|
16
|
+
* card) keeps working unchanged — this service has no base error state to merge it onto.
|
|
17
|
+
*/
|
|
18
|
+
start(): Promise<{
|
|
19
|
+
readonly sessionId: string;
|
|
20
|
+
readonly state: DeviceCleanupState;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Cancels any in-flight poll and clears the ceremony state. Called from every point that
|
|
24
|
+
* used to invalidate the shell's own poll loop: a client change, suspension, `showRevoked()`,
|
|
25
|
+
* and disconnect (`pairing-gate.ts`'s `client-device.cleanup-cancel.v1` command, fired at
|
|
26
|
+
* exactly those four points).
|
|
27
|
+
*/
|
|
28
|
+
cancel(): void;
|
|
29
|
+
#private;
|
|
30
|
+
}
|
|
31
|
+
export type DelayPort = import("@econ-v1/ports").DelayPort;
|
|
32
|
+
export type DeviceCleanupState = "pending" | "approved" | "declined" | "expired" | "no_candidate" | "not_needed" | "failed";
|
|
33
|
+
export type DeviceCleanupPort = {
|
|
34
|
+
cleanupStatus: (sessionId: string) => Promise<{
|
|
35
|
+
readonly state: DeviceCleanupState;
|
|
36
|
+
}>;
|
|
37
|
+
requestCleanup: () => Promise<{
|
|
38
|
+
readonly sessionId: string;
|
|
39
|
+
readonly state: DeviceCleanupState;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
export type DeviceCleanupServiceOptions = {
|
|
43
|
+
cleanup: DeviceCleanupPort;
|
|
44
|
+
delay: Pick<DelayPort, "wait">;
|
|
45
|
+
publish: (state: DeviceCleanupState | undefined) => void;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=device-cleanup-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-cleanup-service.d.ts","sourceRoot":"","sources":["../../src/services/device-cleanup-service.js"],"names":[],"mappings":"AAeA;IAaI,mDAAmD;IACnD,qBADY,2BAA2B,EAKtC;IACD;uEACmE;IACnE,wCAEC;IACD;;;;;;;;;;OAUG;IACH;4BA/CuJ,MAAM;wBAAkB,kBAAkB;OA6DhM;IACD;;;;;OAKG;IACH,eAMC;;CAkCJ;wBA9Ga,OAAO,gBAAgB,EAAE,SAAS;iCAClC,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,cAAc,GAAG,YAAY,GAAG,QAAQ;gCAC1F;IAAE,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAAC,cAAc,EAAE,MAAM,OAAO,CAAC;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAA;CAAE;0CAC5L;IAAE,OAAO,EAAE,iBAAiB,CAAC;IAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,KAAK,IAAI,CAAA;CAAE"}
|
|
@@ -1,60 +1,51 @@
|
|
|
1
|
-
import type { HomeNodeDialer } from "@econ-v1/ports";
|
|
2
|
-
import type { LanCandidateRefreshService } from "./lan-candidate-refresh-service.js";
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* today; a signed bootstrap descriptor's `lan_candidates` in the Phase-2 follow-on), it
|
|
7
|
-
* dials each one through the injected `HomeNodeDialer` (the same port
|
|
8
|
-
* `TransportManager`/`probeLanCandidate` implement) and proves the responder's stable node
|
|
9
|
-
* identity before ever calling it "found" — reachability alone never promotes a candidate
|
|
10
|
-
* (fail-closed, per the umbrella spec's §7/§3).
|
|
2
|
+
* @param {string} address
|
|
3
|
+
* @returns {string | undefined}
|
|
11
4
|
*/
|
|
5
|
+
export function secureLanOrigin(address: string): string | undefined;
|
|
6
|
+
/** @typedef {"probing" | "reachable" | "verified" | "unreachable"} DiscoveryCandidateStatus */
|
|
7
|
+
/** @typedef {{ readonly displayName: string, readonly maskedNodeId: string }} DiscoveryFoundNode */
|
|
8
|
+
/** @typedef {{ readonly address: string, readonly node?: DiscoveryFoundNode, readonly status: DiscoveryCandidateStatus }} DiscoveryCandidateRow */
|
|
9
|
+
/** @typedef {{ readonly friendly_name?: unknown, readonly node_id?: unknown }} DiscoveryNodeIdentityWire */
|
|
10
|
+
/** @typedef {{ readonly dialer: HomeNodeDialer, readonly onChange?: (rows: readonly DiscoveryCandidateRow[]) => void, readonly refresh: Pick<LanCandidateRefreshService, "refresh"> }} DiscoveryProbeServiceOptions */
|
|
11
|
+
export class DiscoveryProbeService {
|
|
12
|
+
/** @param {DiscoveryProbeServiceOptions} options */
|
|
13
|
+
constructor(options: DiscoveryProbeServiceOptions);
|
|
14
|
+
/** @returns {readonly DiscoveryCandidateRow[]} */
|
|
15
|
+
snapshot(): readonly DiscoveryCandidateRow[];
|
|
16
|
+
/**
|
|
17
|
+
* @param {readonly string[]} addresses
|
|
18
|
+
* @returns {Promise<readonly DiscoveryCandidateRow[]>}
|
|
19
|
+
*/
|
|
20
|
+
probe(addresses: readonly string[]): Promise<readonly DiscoveryCandidateRow[]>;
|
|
21
|
+
/**
|
|
22
|
+
* @param {string} address
|
|
23
|
+
* @returns {Promise<void>}
|
|
24
|
+
*/
|
|
25
|
+
promote(address: string): Promise<void>;
|
|
26
|
+
#private;
|
|
27
|
+
}
|
|
28
|
+
export type HomeNodeCandidate = import("@econ-v1/ports").HomeNodeCandidate;
|
|
29
|
+
export type HomeNodeClient = import("@econ-v1/ports").HomeNodeClient;
|
|
30
|
+
export type HomeNodeDialer = import("@econ-v1/ports").HomeNodeDialer;
|
|
31
|
+
export type LanCandidateRefreshService = import("./lan-candidate-refresh-service.js").LanCandidateRefreshService;
|
|
12
32
|
export type DiscoveryCandidateStatus = "probing" | "reachable" | "verified" | "unreachable";
|
|
13
|
-
export
|
|
33
|
+
export type DiscoveryFoundNode = {
|
|
14
34
|
readonly displayName: string;
|
|
15
35
|
readonly maskedNodeId: string;
|
|
16
|
-
}
|
|
17
|
-
export
|
|
36
|
+
};
|
|
37
|
+
export type DiscoveryCandidateRow = {
|
|
18
38
|
readonly address: string;
|
|
19
39
|
readonly node?: DiscoveryFoundNode;
|
|
20
40
|
readonly status: DiscoveryCandidateStatus;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface DiscoveryNodeIdentityWire {
|
|
41
|
+
};
|
|
42
|
+
export type DiscoveryNodeIdentityWire = {
|
|
24
43
|
readonly friendly_name?: unknown;
|
|
25
44
|
readonly node_id?: unknown;
|
|
26
|
-
}
|
|
27
|
-
export
|
|
45
|
+
};
|
|
46
|
+
export type DiscoveryProbeServiceOptions = {
|
|
28
47
|
readonly dialer: HomeNodeDialer;
|
|
29
|
-
/** Notified with the full current snapshot after every candidate status transition. */
|
|
30
48
|
readonly onChange?: (rows: readonly DiscoveryCandidateRow[]) => void;
|
|
31
|
-
/**
|
|
32
|
-
* Persists a promoted candidate as the device's remembered home-node connection
|
|
33
|
-
* metadata. Reused rather than reimplemented — its `refresh()` already performs the
|
|
34
|
-
* same identity-proof read (`nodeMetadataCandidates` throws on a missing node id) this
|
|
35
|
-
* service uses for `probe()`, so promotion re-proves identity fail-closed too.
|
|
36
|
-
*/
|
|
37
49
|
readonly refresh: Pick<LanCandidateRefreshService, "refresh">;
|
|
38
|
-
}
|
|
39
|
-
export declare class DiscoveryProbeService {
|
|
40
|
-
#private;
|
|
41
|
-
constructor(options: DiscoveryProbeServiceOptions);
|
|
42
|
-
snapshot(): readonly DiscoveryCandidateRow[];
|
|
43
|
-
/** Probes every address in parallel, replacing the previous candidate set. */
|
|
44
|
-
probe(addresses: readonly string[]): Promise<readonly DiscoveryCandidateRow[]>;
|
|
45
|
-
/**
|
|
46
|
-
* Promotes a previously verified candidate as the device's home-node route. Fail-closed:
|
|
47
|
-
* throws (never silently accepts) unless `probe()` most recently reported this exact
|
|
48
|
-
* address as `"verified"` — "continue anyway" on an unverified or stale candidate is not
|
|
49
|
-
* offered.
|
|
50
|
-
*/
|
|
51
|
-
promote(address: string): Promise<void>;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Normalizes a user-typed (or metadata-sourced) LAN address into a strict HTTPS origin —
|
|
55
|
-
* the shape `probeLanCandidate`/`secureOrigin` (`@econ-v1/adapters-web`) require — or
|
|
56
|
-
* `undefined` if it is not a well-formed host[:port]. Mirrors
|
|
57
|
-
* `peer-directory-service.ts`'s `toSecureAddress`.
|
|
58
|
-
*/
|
|
59
|
-
export declare function secureLanOrigin(address: string): string | undefined;
|
|
50
|
+
};
|
|
60
51
|
//# sourceMappingURL=discovery-probe-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-probe-service.d.ts","sourceRoot":"","sources":["../../src/services/discovery-probe-service.
|
|
1
|
+
{"version":3,"file":"discovery-probe-service.d.ts","sourceRoot":"","sources":["../../src/services/discovery-probe-service.js"],"names":[],"mappings":"AAqLA;;;GAGG;AACH,yCAHW,MAAM,GACJ,MAAM,GAAG,SAAS,CAY9B;AAzLD,+FAA+F;AAC/F,oGAAoG;AACpG,mJAAmJ;AACnJ,4GAA4G;AAC5G,uNAAuN;AAEvN;IAWE,oDAAoD;IACpD,qBADY,4BAA4B,EAKvC;IAED,kDAAkD;IAClD,YADc,SAAS,qBAAqB,EAAE,CAG7C;IAED;;;OAGG;IACH,iBAHW,SAAS,MAAM,EAAE,GACf,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAUrD;IAED;;;OAGG;IACH,iBAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAYzB;;CA6EF;gCA9Ia,OAAO,gBAAgB,EAAE,iBAAiB;6BAC1C,OAAO,gBAAgB,EAAE,cAAc;6BACvC,OAAO,gBAAgB,EAAE,cAAc;yCACvC,OAAO,oCAAoC,EAAE,0BAA0B;uCAKvE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa;iCACpD;IAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE;oCAC/D;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAA;CAAE;wCAC3G;IAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE;2CAChE;IAAE,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,qBAAqB,EAAE,KAAK,IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;CAAE"}
|
|
@@ -1,18 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly version: typeof GOSSIP_VERSION;
|
|
6
|
-
}
|
|
7
|
-
export interface GossipServiceOptions {
|
|
8
|
-
readonly directory: PeerDirectoryService;
|
|
9
|
-
readonly transport: PeerTransportPort;
|
|
10
|
-
}
|
|
11
|
-
export declare class GossipService {
|
|
12
|
-
#private;
|
|
1
|
+
export class GossipService {
|
|
2
|
+
/**
|
|
3
|
+
* @param {GossipServiceOptions} options
|
|
4
|
+
*/
|
|
13
5
|
constructor(options: GossipServiceOptions);
|
|
6
|
+
/**
|
|
7
|
+
* @param {string} topic
|
|
8
|
+
* @param {PeerAdvertisement} advertisement
|
|
9
|
+
* @returns {Promise<void>}
|
|
10
|
+
*/
|
|
14
11
|
publishAdvertisement(topic: string, advertisement: PeerAdvertisement): Promise<void>;
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} topic
|
|
14
|
+
* @param {AbortSignalPort} [signal]
|
|
15
|
+
* @returns {AsyncIterable<GossipAdvertisement>}
|
|
16
|
+
*/
|
|
17
|
+
advertisements(topic: string, signal?: AbortSignalPort): AsyncIterable<GossipAdvertisement>;
|
|
18
|
+
#private;
|
|
16
19
|
}
|
|
20
|
+
export type PeerTransportPort = import("@econ-v1/ports").PeerTransportPort;
|
|
21
|
+
export type AbortSignalPort = import("./abort-signal.js").AbortSignalPort;
|
|
22
|
+
export type PeerAdvertisement = import("./peer-directory-service.js").PeerAdvertisement;
|
|
23
|
+
export type GossipAdvertisement = PeerAdvertisement & {
|
|
24
|
+
readonly version: typeof GOSSIP_VERSION;
|
|
25
|
+
};
|
|
26
|
+
export type GossipServiceOptions = {
|
|
27
|
+
readonly directory: PeerDirectoryService;
|
|
28
|
+
readonly transport: PeerTransportPort;
|
|
29
|
+
};
|
|
30
|
+
declare const GOSSIP_VERSION: 1;
|
|
31
|
+
import { PeerDirectoryService } from "./peer-directory-service.js";
|
|
17
32
|
export {};
|
|
18
33
|
//# sourceMappingURL=gossip-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gossip-service.d.ts","sourceRoot":"","sources":["../../src/services/gossip-service.
|
|
1
|
+
{"version":3,"file":"gossip-service.d.ts","sourceRoot":"","sources":["../../src/services/gossip-service.js"],"names":[],"mappings":"AAoBA;IAWI;;KAEC;IACD,qBAFS,oBAAoB,EAK5B;IACD;;;;KAIC;IACD,4BAJS,MAAM,iBACN,iBAAiB,GACf,OAAO,CAAC,IAAI,CAAC,CAOvB;IACD;;;;KAIC;IACD,sBAJS,MAAM,WACN,eAAe,GACb,aAAa,CAAC,mBAAmB,CAAC,CAc5C;;CACJ;gCAhEY,OAAO,gBAAgB,EAAE,iBAAiB;8BAG1C,OAAO,mBAAmB,EAAE,eAAe;gCAG3C,OAAO,6BAA6B,EAAE,iBAAiB;kCAGvD,iBAAiB,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,cAAc,CAAC;CAAE;mCAGhE;IAAE,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;CAAE;AAIjG,8BAAuB,CAAC,CAAC;qCAFqC,6BAA6B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** @typedef {import('@econ-v1/ports').HomeNodeClient} HomeNodeClient */
|
|
2
|
+
export class InviteRedemptionService {
|
|
3
|
+
/**
|
|
4
|
+
* @param {InviteRedemptionServiceOptions} options
|
|
5
|
+
*/
|
|
6
|
+
constructor(options: InviteRedemptionServiceOptions);
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} code
|
|
9
|
+
* @returns {Promise<InviteRedemptionOutcome>}
|
|
10
|
+
*/
|
|
11
|
+
redeem(code: string): Promise<InviteRedemptionOutcome>;
|
|
12
|
+
#private;
|
|
13
|
+
}
|
|
14
|
+
export type HomeNodeClient = import("@econ-v1/ports").HomeNodeClient;
|
|
15
|
+
/**
|
|
16
|
+
* Step 11's real action: redeem an invitation code against the node's PUBLIC
|
|
17
|
+
* `POST /api/v2/invite/redeem` (`core/adapters-network/src/http/server/invite.rs`), which
|
|
18
|
+
* takes `{ code }` or `{ token }` and needs no authentication — deliberately, because at step
|
|
19
|
+
* 11 the browser has no session at all.
|
|
20
|
+
*
|
|
21
|
+
* The response's `receiver_name` is the name the INVITER registered for this person. Prefilling
|
|
22
|
+
* step 12's display name with it (and locking it, see `OnboardingFlowService`) is what makes
|
|
23
|
+
* the invitation meaningful rather than decorative: the person who was invited as "Ada
|
|
24
|
+
* Lovelace" shows up on the inviter's node as Ada Lovelace. It is null for legacy
|
|
25
|
+
* token-shaped invites, which is a normal, non-error case.
|
|
26
|
+
*
|
|
27
|
+
* Outcomes are closed and text-free. `"rejected"` covers expired, already-used, unknown and
|
|
28
|
+
* malformed codes alike — the node's own message would tell an attacker which of those it was.
|
|
29
|
+
*/
|
|
30
|
+
export type InviteRedemptionOutcome = {
|
|
31
|
+
readonly kind: "redeemed";
|
|
32
|
+
readonly receiverName: string | undefined;
|
|
33
|
+
} | {
|
|
34
|
+
readonly kind: "rejected";
|
|
35
|
+
};
|
|
36
|
+
export type InviteRedemptionServiceOptions = {
|
|
37
|
+
node: Pick<HomeNodeClient, "invoke">;
|
|
38
|
+
};
|
|
39
|
+
export type InviteRedeemWire = {
|
|
40
|
+
ok?: unknown;
|
|
41
|
+
receiver_name?: unknown;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=invite-redemption-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invite-redemption-service.d.ts","sourceRoot":"","sources":["../../src/services/invite-redemption-service.js"],"names":[],"mappings":"AACA,wEAAwE;AACxE;IAKE;;OAEG;IACH,qBAFW,8BAA8B,EAIxC;IACD;;;OAGG;IACH,aAHW,MAAM,GACJ,OAAO,CAAC,uBAAuB,CAAC,CAoB5C;;CACF;6BAnCa,OAAO,gBAAgB,EAAE,cAAc;;;;;;;;;;;;;;;;sCAkDtC;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAChF;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE;;UAItB,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC;;;SAI9B,OAAO;oBACP,OAAO"}
|
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
readonly identity: IdentityPort;
|
|
4
|
-
readonly now?: () => string;
|
|
5
|
-
}
|
|
6
|
-
export declare class LanCandidateRefreshService {
|
|
7
|
-
#private;
|
|
1
|
+
export class LanCandidateRefreshService {
|
|
2
|
+
/** @param {LanCandidateRefreshServiceOptions} options */
|
|
8
3
|
constructor(options: LanCandidateRefreshServiceOptions);
|
|
4
|
+
/**
|
|
5
|
+
* @param {HomeNodeClient} home
|
|
6
|
+
* @returns {Promise<readonly HomeNodeCandidate[]>}
|
|
7
|
+
*/
|
|
9
8
|
refresh(home: HomeNodeClient): Promise<readonly HomeNodeCandidate[]>;
|
|
9
|
+
#private;
|
|
10
10
|
}
|
|
11
|
+
export type DeviceConnectionMetadata = import("@econ-v1/ports").DeviceConnectionMetadata;
|
|
12
|
+
export type HomeNodeCandidate = import("@econ-v1/ports").HomeNodeCandidate;
|
|
13
|
+
export type HomeNodeClient = import("@econ-v1/ports").HomeNodeClient;
|
|
14
|
+
export type HttpHomeNodeCandidate = import("@econ-v1/ports").HttpHomeNodeCandidate;
|
|
15
|
+
export type IdentityPort = import("@econ-v1/ports").IdentityPort;
|
|
16
|
+
export type ClientTransportCandidateWire = {
|
|
17
|
+
readonly version: 1;
|
|
18
|
+
readonly node_id: string;
|
|
19
|
+
readonly wan_origin: string;
|
|
20
|
+
readonly lan_origins: readonly string[];
|
|
21
|
+
};
|
|
22
|
+
export type LanCandidateRefreshServiceOptions = {
|
|
23
|
+
readonly identity: IdentityPort;
|
|
24
|
+
readonly now?: () => string;
|
|
25
|
+
};
|
|
11
26
|
//# sourceMappingURL=lan-candidate-refresh-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lan-candidate-refresh-service.d.ts","sourceRoot":"","sources":["../../src/services/lan-candidate-refresh-service.
|
|
1
|
+
{"version":3,"file":"lan-candidate-refresh-service.d.ts","sourceRoot":"","sources":["../../src/services/lan-candidate-refresh-service.js"],"names":[],"mappings":"AAgBA;IAME,yDAAyD;IACzD,qBADY,iCAAiC,EAI5C;IAED;;;OAGG;IACH,cAHW,cAAc,GACZ,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CA0BjD;;CACF;uCAvDa,OAAO,gBAAgB,EAAE,wBAAwB;gCACjD,OAAO,gBAAgB,EAAE,iBAAiB;6BAC1C,OAAO,gBAAgB,EAAE,cAAc;oCACvC,OAAO,gBAAgB,EAAE,qBAAqB;2BAC9C,OAAO,gBAAgB,EAAE,YAAY;2CAErC;IAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE;gDACvH;IAAE,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CAAE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** @typedef {import('@econ-v1/ports').HomeNodeClient} HomeNodeClient */
|
|
2
|
+
export class LcdDecisionService {
|
|
3
|
+
/**
|
|
4
|
+
* @param {LcdDecisionServiceOptions} options
|
|
5
|
+
*/
|
|
6
|
+
constructor(options: LcdDecisionServiceOptions);
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} operationHash
|
|
9
|
+
* @returns {Promise<LcdDecisionOutcome>}
|
|
10
|
+
*/
|
|
11
|
+
confirm(operationHash: string): Promise<LcdDecisionOutcome>;
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} operationHash
|
|
14
|
+
* @returns {Promise<LcdDecisionOutcome>}
|
|
15
|
+
*/
|
|
16
|
+
reject(operationHash: string): Promise<LcdDecisionOutcome>;
|
|
17
|
+
#private;
|
|
18
|
+
}
|
|
19
|
+
export type HomeNodeClient = import("@econ-v1/ports").HomeNodeClient;
|
|
20
|
+
/**
|
|
21
|
+
* Forwards an LCD-pane tap to the NODE's own public decision routes — the same
|
|
22
|
+
* `onboarding.device.confirm` / `…reject` capability a physical tap on the hardware drives
|
|
23
|
+
* (`core/adapters-network/src/http/server/device_management/proxy.rs:888-975`). Both routes
|
|
24
|
+
* are in `public_routes()` and need no JWT, which is exactly right: at step 10 the browser has
|
|
25
|
+
* no session at all, so this must be constructed over `prePairingNode`.
|
|
26
|
+
*
|
|
27
|
+
* WHAT THIS CLASS IS NOT. It is not an approval. `LcdDecisionOutcome` has two values and
|
|
28
|
+
* neither of them is "approved": `"forwarded"` means the node accepted the *request*, not
|
|
29
|
+
* that the claim is confirmed. Confirmation reaches the flow through exactly one path —
|
|
30
|
+
* `OwnerClaimService.awaitConfirmation`'s poll of `GET /node/operation-status/{hash}` — and
|
|
31
|
+
* nothing here shortcuts it. That is the property design §8.3 exists to protect: the node is
|
|
32
|
+
* the authority, and a browser tap can at most ask.
|
|
33
|
+
*
|
|
34
|
+
* WHY THE FAILURE SIDE IS ONE VALUE. `enforce_physical_presence` answers 403 when a hardware
|
|
35
|
+
* LCD is present and the pending operation is an `onboard` (the physical tap is then the only
|
|
36
|
+
* path), and 503 when it cannot determine presence. Both would ideally be distinguishable
|
|
37
|
+
* here — but `AppError::Forbidden` and `AppError::ServiceUnavailable` do NOT emit the node's
|
|
38
|
+
* `{ success: false, error: { code } }` envelope (`core/foundation/src/error.rs:145-148`,
|
|
39
|
+
* `:252-254`), so `PrePairingHomeNodeClient` collapses both — and a genuine network failure —
|
|
40
|
+
* into `TransportError{ code: "unavailable" }`. Inventing a distinction the wire does not
|
|
41
|
+
* carry would be a lie, and the pane's behaviour is identical for all three anyway: render
|
|
42
|
+
* the press, say "waiting for the node", keep waiting. The pane learns whether a hardware
|
|
43
|
+
* display exists from `OwnerClaimPrepareOutcome.lcdHardware`, which the node states outright
|
|
44
|
+
* at prepare time — see `OnboardingFlowService.lcdScreen()`'s `physicalTapOnly`.
|
|
45
|
+
*
|
|
46
|
+
* The optional `setup_token` field on both requests is deliberately never sent: it is read
|
|
47
|
+
* from a file on the node's own filesystem, which a browser cannot do. A headless node with
|
|
48
|
+
* the code-match gate armed therefore answers `"not-accepted"` here, and the operator confirms
|
|
49
|
+
* through a surface that can read the token. Recorded as a named gap, not papered over.
|
|
50
|
+
*/
|
|
51
|
+
export type LcdDecisionOutcome = "forwarded" | "not-accepted";
|
|
52
|
+
export type LcdDecisionServiceOptions = {
|
|
53
|
+
/**
|
|
54
|
+
* MUST be the pre-pairing client: step 10 runs on an unclaimed node with no session.
|
|
55
|
+
*/
|
|
56
|
+
node: Pick<HomeNodeClient, "invoke">;
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=lcd-decision-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lcd-decision-service.d.ts","sourceRoot":"","sources":["../../src/services/lcd-decision-service.js"],"names":[],"mappings":"AACA,wEAAwE;AACxE;IAKE;;OAEG;IACH,qBAFW,yBAAyB,EAInC;IACD;;;OAGG;IACH,uBAHW,MAAM,GACJ,OAAO,CAAC,kBAAkB,CAAC,CAOvC;IACD;;;OAGG;IACH,sBAHW,MAAM,GACJ,OAAO,CAAC,kBAAkB,CAAC,CAOvC;;CAuBF;6BAtDa,OAAO,gBAAgB,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAqFxC,WAAW,GAAG,cAAc;;;;;UAI3B,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** The default for compositions with no browser storage (tests, and the pre-existing
|
|
2
|
+
* `composition-root.test.ts` wiring): a real port whose slot simply dies with the process.
|
|
3
|
+
* @returns {OnboardingCheckpointStoragePort}
|
|
4
|
+
*/
|
|
5
|
+
export function createInMemoryOnboardingCheckpointStorage(): OnboardingCheckpointStoragePort;
|
|
6
|
+
/** @typedef {import('@econ-v1/ports').OnboardingCheckpointStoragePort} OnboardingCheckpointStoragePort */
|
|
7
|
+
export class OnboardingCheckpointStore {
|
|
8
|
+
/**
|
|
9
|
+
* @param {OnboardingCheckpointStoreOptions} options
|
|
10
|
+
*/
|
|
11
|
+
constructor(options: OnboardingCheckpointStoreOptions);
|
|
12
|
+
/**
|
|
13
|
+
* @returns {void}
|
|
14
|
+
*/
|
|
15
|
+
clear(): void;
|
|
16
|
+
/**
|
|
17
|
+
* @returns {OnboardingCheckpoint | undefined}
|
|
18
|
+
*/
|
|
19
|
+
read(): OnboardingCheckpoint | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* @param {OnboardingCheckpoint} checkpoint
|
|
22
|
+
* @returns {void}
|
|
23
|
+
*/
|
|
24
|
+
write(checkpoint: OnboardingCheckpoint): void;
|
|
25
|
+
#private;
|
|
26
|
+
}
|
|
27
|
+
export type OnboardingCheckpointStoragePort = import("@econ-v1/ports").OnboardingCheckpointStoragePort;
|
|
28
|
+
/**
|
|
29
|
+
* The onboarding flow's resume point (design §6.3).
|
|
30
|
+
*
|
|
31
|
+
* SECURITY — this type is the whole reason the store exists rather than a bare
|
|
32
|
+
* `JSON.stringify(state)`: it names EXACTLY the fields the step table's `resume` column
|
|
33
|
+
* allows, and `write()` copies field-by-field from this allow-list. A caller cannot smuggle a
|
|
34
|
+
* Wi-Fi password (or an invitation code, or the match-code digits) into durable storage by
|
|
35
|
+
* spreading extra properties into the argument — the extras are dropped before serialisation.
|
|
36
|
+
* If a Wi-Fi operation must be retried after a reload the owner re-enters the password; the
|
|
37
|
+
* step is re-shown, never replayed.
|
|
38
|
+
*/
|
|
39
|
+
export type OnboardingCheckpoint = {
|
|
40
|
+
/**
|
|
41
|
+
* ISO instant after which the in-flight operation is dead. A checkpoint past its own
|
|
42
|
+
* deadline is discarded on read so a stale run cannot strand a later one mid-flow.
|
|
43
|
+
*/
|
|
44
|
+
deadline?: string;
|
|
45
|
+
operationHash?: string;
|
|
46
|
+
stepId: string;
|
|
47
|
+
targetSsid?: string;
|
|
48
|
+
wifiOperationId?: string;
|
|
49
|
+
};
|
|
50
|
+
export type OnboardingCheckpointStoreOptions = {
|
|
51
|
+
now: () => string;
|
|
52
|
+
storage: OnboardingCheckpointStoragePort;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=onboarding-checkpoint-store.d.ts.map
|