@kraki/head 0.19.4 → 0.20.1

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/server.d.ts CHANGED
@@ -52,7 +52,7 @@ export declare class HeadServer {
52
52
  private options;
53
53
  private static readonly PING_INTERVAL;
54
54
  private connections;
55
- private pairingTokens;
55
+ private authBackend;
56
56
  private userByDevice;
57
57
  private clients;
58
58
  private pingTimer;
@@ -76,9 +76,6 @@ export declare class HeadServer {
76
76
  private linkProgressing;
77
77
  /** Test hook: force a liveness sweep without waiting for the timer. */
78
78
  forceLivenessSweep(): void;
79
- private getAuthProvider;
80
- private getAuthProviderForMode;
81
- private getGitHubClientId;
82
79
  private getVapidPublicKey;
83
80
  /**
84
81
  * Build the voice capability advertisement for `auth_ok` from this head's
@@ -91,7 +88,6 @@ export declare class HeadServer {
91
88
  * single helper.
92
89
  */
93
90
  private getVoiceCapability;
94
- private findGitHubProvider;
95
91
  attach(server: Server): void;
96
92
  acceptConnection(ws: WebSocket): void;
97
93
  /** (Re)start the deadline for this socket to authenticate (G1). */
@@ -126,6 +122,10 @@ export declare class HeadServer {
126
122
  /** Persist a preferences update and echo the merged result to the sender + the
127
123
  * user's other online devices. */
128
124
  private handleUpdatePreferences;
125
+ /** Account data, not session data: no tentacle is involved. The sender
126
+ * always gets the resulting list back (its acknowledgement); other online
127
+ * apps of the account get it only when something was applied. */
128
+ private handleUpdateVoiceVocabulary;
129
129
  /** Fan-out targets for a pulse broadcast from `fromDevice`: all OTHER
130
130
  * ONLINE devices of the same user. Offline devices are excluded because
131
131
  * broadcasts (user_message / agent_message / delta / active / idle /
@@ -146,7 +146,10 @@ export declare class HeadServer {
146
146
  private removeConnection;
147
147
  private sendAuthError;
148
148
  private handleAuth;
149
- private handlePairingAuth;
149
+ /** After an awaited auth step: is this socket still open, still ours and
150
+ * still unauthenticated? The auth deadline may have closed it meanwhile;
151
+ * registering a dead socket would evict the device's live connection. */
152
+ private socketStillAuthenticating;
150
153
  private handleChallengeResponse;
151
154
  /**
152
155
  * Handle a result from AuthBackend — registers connection state and sends response.
@@ -184,10 +187,18 @@ export declare class HeadServer {
184
187
  * Must be called BEFORE `connections.set(deviceId, ws)`.
185
188
  */
186
189
  private evictPreviousConnection;
187
- private completeAuth;
188
190
  private handleCreatePairingToken;
189
191
  private handleRequestPairingToken;
190
192
  private handleRemoveDevice;
193
+ /** Users whose deletion is in flight (a double tap must not run it twice). */
194
+ private deletingAccounts;
195
+ /**
196
+ * Delete the requesting user's account: at the account store (the account
197
+ * service in edge mode) and in this relay's own storage and pulse state.
198
+ * Then tell every connected device and close it. Devices that were offline
199
+ * get `auth_error` code `account_deleted` when they next connect.
200
+ */
201
+ private handleDeleteAccount;
191
202
  private handleRegisterPushToken;
192
203
  private handleUnregisterPushToken;
193
204
  private broadcastDeviceRemoved;