@deveye/types 0.25.2 → 0.25.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deveye/types",
3
- "version": "0.25.2",
3
+ "version": "0.25.4",
4
4
  "description": "Shared contracts (types + zod schemas) for DevEye apps",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -15,6 +15,12 @@ export const SYNC_STORAGE_PATH_MAX = 1024;
15
15
  export const SYNC_CHUNK_MAX = 1_400_000;
16
16
  /** Nombre max d'entrées d'index par frame `sync.index`. */
17
17
  export const SYNC_INDEX_BATCH_MAX = 500;
18
+ /**
19
+ * Paths a `sync.scan` may ask the agent to restate (`paths`): the ones the
20
+ * server holds in error. Past this, it asks for none, and the fingerprint that
21
+ * follows forces the full walk.
22
+ */
23
+ export const SYNC_SCAN_PATHS_MAX = 2_000;
18
24
  /**
19
25
  * Blocks of an encrypted partial a resumed push can build on (1 MiB each). The
20
26
  * server keeps no more: their nonces must fit in one `sync.push` frame, and
@@ -32,11 +38,15 @@ export const SYNC_RESUME_NONCES_MAX = Math.ceil((SYNC_RESUME_MAX_BLOCKS * 12) /
32
38
  export const SYNC_FINGERPRINT_SEP = '\u0001';
33
39
  /**
34
40
  * Mode de scan demandé à l'agent.
35
- * - `auto` → l'agent a le droit de répondre « rien n'a bougé » sans parcourir
36
- * le disque, en se contentant d'annoncer l'empreinte de ce qu'il détient ;
41
+ * - `delta` → l'agent a le droit de répondre « rien n'a bougé » sans parcourir
42
+ * le disque, en se contentant d'annoncer l'empreinte de ce qu'il détient,
43
+ * ou de ne parcourir que ce que son watcher a vu bouger et de n'envoyer que
44
+ * ces entrées (`delta: true` sur `sync.index`) ;
37
45
  * - `full` → parcours complet obligatoire (filet de sécurité horaire).
46
+ * Un agent qui ignore `delta` parcourt tout : la dissymétrie de version
47
+ * dégrade vers « on parcourt », jamais vers « on saute ».
38
48
  */
39
- export const syncScanModeSchema = z.enum(['auto', 'full']);
49
+ export const syncScanModeSchema = z.enum(['delta', 'full']);
40
50
  export type SyncScanMode = z.infer<typeof syncScanModeSchema>;
41
51
  /**
42
52
  * Empreinte d'un index : `{nombre}.{octets}.{sha256hex}`. Le pli est un XOR des
@@ -102,11 +112,13 @@ export const cloudSyncProgressSchema = z.object({
102
112
  bytesTotal: z.number().int().nonnegative(),
103
113
  filesDone: z.number().int().nonnegative(),
104
114
  bytesDone: z.number().int().nonnegative(),
105
- /** Fichier en cours de transfert, pour la ligne discrète de l'UI. */
115
+ /** Fichier en cours de transfert, pour la ligne discrète de l'UI : le dernier commencé quand plusieurs passent à la fois. */
106
116
  currentPath: z.string().max(SYNC_REL_PATH_MAX).nullable(),
107
- /** Avancement dans le fichier en cours, pour qu'un gros fichier ne fige pas la barre. */
117
+ /** Avancement dans ce fichier, pour qu'un gros fichier ne fige pas la barre. */
108
118
  currentBytes: z.number().int().nonnegative(),
109
119
  currentTotal: z.number().int().nonnegative(),
120
+ /** Fichiers en transfert en même temps, `currentPath` compris. */
121
+ inFlight: z.number().int().nonnegative(),
110
122
  direction: syncDirectionSchema.nullable(),
111
123
  error: z.string().max(500).nullable()
112
124
  });
@@ -118,6 +130,12 @@ export const cloudSyncShareStateSchema = z.object({
118
130
  /** Précision facultative (ex. nom de l'appareil hors ligne ou en erreur). */
119
131
  detail: z.string().max(200).nullable(),
120
132
  /** Volumétrie fraîche : l'en-tête de l'UI se met à jour sans re-fetch. */
121
- stats: cloudSyncShareStatsSchema
133
+ stats: cloudSyncShareStatsSchema,
134
+ /**
135
+ * The open problems already seen before the session in progress (all of
136
+ * them outside one): what the card shows during a synchronization, which
137
+ * hides only what the current pass may still settle.
138
+ */
139
+ settledProblems: z.number().int().nonnegative()
122
140
  });
123
141
  export type CloudSyncShareState = z.infer<typeof cloudSyncShareStateSchema>;
@@ -2,11 +2,13 @@ import { z } from 'zod';
2
2
 
3
3
  /**
4
4
  * La page « Tests et débogage », réservée à l'administrateur du site : essais
5
- * de bout en bout, mesures, testeur de mails et suivi d'usage de DevEye.
5
+ * de bout en bout, mesures, montée en charge, testeur de mails et suivi
6
+ * d'usage de DevEye.
6
7
  *
7
8
  * Toutes ces commandes déclarent `admin: true` côté serveur. Un essai dure
8
- * plus longtemps qu'une commande : `debug.e2eStart` et `debug.benchStart`
9
- * rendent aussitôt un identifiant, que la page suit par `debug.runGet`.
9
+ * plus longtemps qu'une commande : `debug.e2eStart`, `debug.benchStart` et
10
+ * `debug.loadStart` rendent aussitôt un identifiant, que la page suit par
11
+ * `debug.runGet`.
10
12
  */
11
13
 
12
14
  const authorSchema = z.object({ id: z.number().int().positive(), username: z.string() });
@@ -20,7 +22,7 @@ export const debugInstanceSchema = z.object({
20
22
  startedAt: z.number().int().nonnegative()
21
23
  });
22
24
 
23
- export const debugRunKindSchema = z.enum(['e2e', 'bench']);
25
+ export const debugRunKindSchema = z.enum(['e2e', 'bench', 'load']);
24
26
  export const debugRunStatusSchema = z.enum(['running', 'passed', 'failed', 'aborted']);
25
27
 
26
28
  /** L'état d'une étape ou d'un scénario ; `pending` tant que son tour n'est pas venu. */
@@ -90,6 +92,81 @@ export const debugBenchReportSchema = z.object({
90
92
  context: debugBenchContextSchema.nullable()
91
93
  });
92
94
 
95
+ export const debugLoadPhaseSchema = z.enum(['prepare', 'ramp', 'hold', 'cleanup', 'done']);
96
+
97
+ /** Le temps passé par une fonctionnalité : commandes et tâches de fond, attente de la base comprise. */
98
+ const featureTimeSchema = z.object({
99
+ calls: z.number().int().nonnegative(),
100
+ /** Millisecondes écoulées, pas du CPU. */
101
+ ms: z.number().nonnegative()
102
+ });
103
+
104
+ /** Un seau de temps de la montée en charge. Durées en millisecondes. */
105
+ export const debugLoadSampleSchema = z.object({
106
+ /** Secondes depuis le début de la montée, à la fin du seau. */
107
+ t: z.number().nonnegative(),
108
+ /** Utilisateurs simulés connectés à la fin du seau. */
109
+ users: z.number().int().nonnegative(),
110
+ /** Toutes les sockets du serveur, vrais navigateurs compris. */
111
+ sockets: z.number().int().nonnegative(),
112
+ commands: z.number().int().nonnegative(),
113
+ /** Refus du serveur (droit, quota, validation) : il a répondu. */
114
+ refused: z.number().int().nonnegative(),
115
+ /** Échecs internes, délais dépassés, sockets perdues. */
116
+ errors: z.number().int().nonnegative(),
117
+ p50: z.number().nonnegative().nullable(),
118
+ p95: z.number().nonnegative().nullable(),
119
+ max: z.number().nonnegative().nullable(),
120
+ /** Utilisateurs arrivés pendant le seau. */
121
+ arrivals: z.number().int().nonnegative(),
122
+ cpuPct: z.number(),
123
+ loopP99: z.number(),
124
+ rssMb: z.number(),
125
+ /** Par clé de fonctionnalité (voir `features` du rapport), toutes sources confondues. */
126
+ features: z.record(z.string(), featureTimeSchema)
127
+ });
128
+
129
+ export const debugLoadFeatureSchema = featureTimeSchema.extend({
130
+ key: z.string(),
131
+ label: z.string()
132
+ });
133
+
134
+ /** Le moment d'un seuil : secondes depuis le début, et utilisateurs connectés alors. */
135
+ const loadMarkSchema = z.object({
136
+ t: z.number().nonnegative(),
137
+ users: z.number().int().nonnegative()
138
+ });
139
+
140
+ export const debugLoadReportSchema = z.object({
141
+ kind: z.literal('load'),
142
+ settings: z.object({
143
+ users: z.number().int().positive(),
144
+ durationMin: z.number().int().positive()
145
+ }),
146
+ phase: debugLoadPhaseSchema,
147
+ bucketS: z.number().int().positive(),
148
+ /** Les utilisateurs écrivent aussi (des notes) ; `false` sans le module Notes. */
149
+ writes: z.boolean(),
150
+ samples: z.array(debugLoadSampleSchema),
151
+ /** Les totaux de l'essai, du plus occupé au moins occupé. */
152
+ features: z.array(debugLoadFeatureSchema),
153
+ /** L'arrivée d'un utilisateur : connexion, session, socket et accueil. */
154
+ arrivals: z.object({
155
+ n: z.number().int().nonnegative(),
156
+ failed: z.number().int().nonnegative(),
157
+ p50: z.number().nonnegative().nullable(),
158
+ p95: z.number().nonnegative().nullable()
159
+ }),
160
+ /** Le p95 des premiers seaux, à peu d'utilisateurs : la référence des seuils. */
161
+ baselineP95: z.number().nonnegative().nullable(),
162
+ /** Le p95 a nettement dépassé la référence, deux seaux de suite. */
163
+ degradedAt: loadMarkSchema.nullable(),
164
+ /** Le garde-fou a arrêté la montée : le serveur ne suivait plus. */
165
+ saturatedAt: loadMarkSchema.extend({ reason: z.string() }).nullable(),
166
+ /** Comptes de test encore présents après le ménage final ; `null` tant qu'il n'a pas eu lieu. */
167
+ residueAfter: z.number().int().nonnegative().nullable()
168
+ });
169
+
93
170
  export const debugRunSchema = z.object({
94
171
  id: z.number().int().positive(),
95
172
  status: debugRunStatusSchema,
@@ -97,7 +174,11 @@ export const debugRunSchema = z.object({
97
174
  startedAt: z.number().int().nonnegative(),
98
175
  finishedAt: z.number().int().nonnegative().nullable(),
99
176
  launchedBy: authorSchema.nullable(),
100
- report: z.discriminatedUnion('kind', [debugE2eReportSchema, debugBenchReportSchema])
177
+ report: z.discriminatedUnion('kind', [
178
+ debugE2eReportSchema,
179
+ debugBenchReportSchema,
180
+ debugLoadReportSchema
181
+ ])
101
182
  });
102
183
 
103
184
  export type DebugE2eStep = z.infer<typeof debugE2eStepSchema>;
@@ -106,6 +187,10 @@ export type DebugE2eReport = z.infer<typeof debugE2eReportSchema>;
106
187
  export type DebugProbeResult = z.infer<typeof debugProbeResultSchema>;
107
188
  export type DebugBenchContext = z.infer<typeof debugBenchContextSchema>;
108
189
  export type DebugBenchReport = z.infer<typeof debugBenchReportSchema>;
190
+ export type DebugLoadSample = z.infer<typeof debugLoadSampleSchema>;
191
+ export type DebugLoadFeature = z.infer<typeof debugLoadFeatureSchema>;
192
+ export type DebugLoadReport = z.infer<typeof debugLoadReportSchema>;
193
+ export type DebugLoadPhase = z.infer<typeof debugLoadPhaseSchema>;
109
194
  export type DebugRun = z.infer<typeof debugRunSchema>;
110
195
  export type DebugRunKind = z.infer<typeof debugRunKindSchema>;
111
196
  export type DebugBenchProfile = z.infer<typeof debugBenchProfileSchema>;
@@ -213,6 +298,19 @@ export const debugPing = {
213
298
  output: z.object({ at: z.number().int().nonnegative() })
214
299
  };
215
300
 
301
+ /**
302
+ * Ajoute des utilisateurs simulés, un compte jetable chacun, jusqu'à `users`
303
+ * sur `durationMin` minutes, puis les supprime avec tout ce qu'ils ont créé.
304
+ */
305
+ export const debugLoadStart = {
306
+ command: 'debug.loadStart' as const,
307
+ input: z.object({
308
+ users: z.number().int().min(10).max(500),
309
+ durationMin: z.number().int().min(1).max(30)
310
+ }),
311
+ output: z.object({ runId: z.number().int().positive() })
312
+ };
313
+
216
314
  export const debugMailSenderKindSchema = z.enum(['server', 'workspace']);
217
315
 
218
316
  export const debugMailSampleSchema = z.object({
@@ -391,6 +489,7 @@ export const debugCommands = [
391
489
  debugBenchCatalog,
392
490
  debugBenchStart,
393
491
  debugPing,
492
+ debugLoadStart,
394
493
  debugMailCatalog,
395
494
  debugMailPreview,
396
495
  debugMailSend,
package/src/index.ts CHANGED
@@ -81,6 +81,7 @@ export {
81
81
  AGENT_SYNC_CONFIG,
82
82
  AGENT_SYNC_DELETE,
83
83
  AGENT_SYNC_MOVE,
84
+ AGENT_SYNC_RENAME,
84
85
  AGENT_SYNC_INDEX,
85
86
  AGENT_SYNC_OP_RESULT,
86
87
  AGENT_SYNC_DEVICE_KEY,
@@ -160,6 +161,7 @@ export {
160
161
  agentSyncConfigPayloadSchema,
161
162
  agentSyncDeletePayloadSchema,
162
163
  agentSyncMovePayloadSchema,
164
+ agentSyncRenamePayloadSchema,
163
165
  agentSyncIndexPayloadSchema,
164
166
  agentSyncOpResultPayloadSchema,
165
167
  agentSyncDeviceKeyPayloadSchema,
@@ -241,6 +243,7 @@ export {
241
243
  syncIndexEntrySchema,
242
244
  syncIndexLineSchema,
243
245
  syncIndexSkippedEntrySchema,
246
+ syncIndexGoneEntrySchema,
244
247
  syncShareAssignmentSchema
245
248
  } from './protocol/agent';
246
249
  export type {
@@ -281,6 +284,7 @@ export type {
281
284
  AgentSyncDeletePayload,
282
285
  AgentSyncIndexPayload,
283
286
  AgentSyncMovePayload,
287
+ AgentSyncRenamePayload,
284
288
  AgentSyncOpResultPayload,
285
289
  AgentSyncDeviceKeyPayload,
286
290
  AgentSyncPushPayload,
@@ -328,6 +332,7 @@ export type {
328
332
  SyncIndexEntry,
329
333
  SyncIndexLine,
330
334
  SyncIndexSkippedEntry,
335
+ SyncIndexGoneEntry,
331
336
  SyncShareAssignment
332
337
  } from './protocol/agent';
333
338
 
@@ -452,6 +457,7 @@ export {
452
457
  SYNC_RESUME_MAX_BLOCKS,
453
458
  SYNC_RESUME_NONCES_MAX,
454
459
  SYNC_REL_PATH_MAX,
460
+ SYNC_SCAN_PATHS_MAX,
455
461
  SYNC_STORAGE_PATH_MAX,
456
462
  syncDirectionSchema,
457
463
  syncEntryKindSchema,
@@ -985,6 +991,11 @@ export {
985
991
  debugE2eStepSchema,
986
992
  debugE2eSweep,
987
993
  debugInstanceSchema,
994
+ debugLoadFeatureSchema,
995
+ debugLoadPhaseSchema,
996
+ debugLoadReportSchema,
997
+ debugLoadSampleSchema,
998
+ debugLoadStart,
988
999
  debugMailCatalog,
989
1000
  debugMailPreview,
990
1001
  debugMailPreviewSchema,
@@ -1019,6 +1030,10 @@ export type {
1019
1030
  DebugE2eScenario,
1020
1031
  DebugE2eScenarioReport,
1021
1032
  DebugE2eStep,
1033
+ DebugLoadFeature,
1034
+ DebugLoadPhase,
1035
+ DebugLoadReport,
1036
+ DebugLoadSample,
1022
1037
  DebugMailPreview,
1023
1038
  DebugMailSample,
1024
1039
  DebugProbe,
@@ -7,6 +7,7 @@ import {
7
7
  SYNC_RESUME_NONCES_MAX,
8
8
  SYNC_INDEX_BATCH_MAX,
9
9
  SYNC_REL_PATH_MAX,
10
+ SYNC_SCAN_PATHS_MAX,
10
11
  SYNC_STORAGE_PATH_MAX,
11
12
  syncEntryKindSchema,
12
13
  syncSkipReasonSchema,
@@ -438,10 +439,18 @@ export const syncIndexSkippedEntrySchema = z.object({
438
439
  });
439
440
  export type SyncIndexSkippedEntry = z.infer<typeof syncIndexSkippedEntrySchema>;
440
441
 
441
- /** One line of a `sync.index` batch: an indexed entry, or a skipped path. */
442
+ /** A path the agent no longer holds, in a `delta: true` reply only. */
443
+ export const syncIndexGoneEntrySchema = z.object({
444
+ relPath: syncRelPath,
445
+ kind: z.literal('gone')
446
+ });
447
+ export type SyncIndexGoneEntry = z.infer<typeof syncIndexGoneEntrySchema>;
448
+
449
+ /** One line of a `sync.index` batch: an indexed entry, a skipped path, or a path gone since the last scan. */
442
450
  export const syncIndexLineSchema = z.discriminatedUnion('kind', [
443
451
  syncIndexEntrySchema,
444
- syncIndexSkippedEntrySchema
452
+ syncIndexSkippedEntrySchema,
453
+ syncIndexGoneEntrySchema
445
454
  ]);
446
455
  export type SyncIndexLine = z.infer<typeof syncIndexLineSchema>;
447
456
 
@@ -454,14 +463,25 @@ export const agentSyncIndexPayloadSchema = z.object({
454
463
  entries: z.array(syncIndexLineSchema).max(SYNC_INDEX_BATCH_MAX),
455
464
  done: z.boolean(),
456
465
  /**
457
- * L'agent a-t-il réellement parcouru le disque ? `false` répond à un
458
- * `sync.scan` en mode `auto` sur un partage que le watcher sait intact :
459
- * aucune entrée, seule `fingerprint` est renseignée, et le serveur VÉRIFIE
460
- * qu'elle correspond à sa baseline (une vérification fausse coûte un scan
461
- * complet, jamais une divergence). Le défaut `true` rend un vieil agent
462
- * inoffensif.
466
+ * L'agent a-t-il parcouru le disque en entier ? `false` sans `delta`
467
+ * répond à un `sync.scan` en mode `delta` sur un partage que le watcher
468
+ * sait intact : aucune entrée, seule `fingerprint` est renseignée, et le
469
+ * serveur VÉRIFIE qu'elle correspond à sa baseline (une vérification
470
+ * fausse coûte un scan complet, jamais une divergence). `false` avec
471
+ * `delta` : seuls les dossiers touchés ont été relus, les chemins écartés
472
+ * ne sont pas tous là. Le défaut `true` rend un vieil agent inoffensif.
463
473
  */
464
474
  scanned: z.boolean().default(true),
475
+ /**
476
+ * Les entrées ne sont que ce qui a changé depuis le dernier scan (celles
477
+ * `gone` ont disparu) : l'index de l'appareil est la baseline du serveur
478
+ * corrigée de ces lignes, et `fingerprint` décrit cet index entier. Le
479
+ * serveur VÉRIFIE l'empreinte avant d'y croire, comme pour une réponse
480
+ * rapide. Jamais envoyé sans un `sync.scan` en mode `delta`, ou avec une
481
+ * empreinte `expected` que le parcours complet a retrouvée (`scanned`
482
+ * reste alors `true`).
483
+ */
484
+ delta: z.boolean().default(false),
465
485
  /** Empreinte de l'index détenu par l'agent, quand il sait la calculer. */
466
486
  fingerprint: syncIndexFingerprintSchema.nullable().default(null),
467
487
  /**
@@ -532,13 +552,22 @@ export type AgentSyncBusyPayload = z.infer<typeof agentSyncBusyPayloadSchema>;
532
552
  * Issue d'une op locale : install atomique (`apply`), création de dossier vide
533
553
  * (`applyDir`), copie locale d'un contenu déjà présent (`applyLocal`), amorce
534
554
  * de download avec offset de reprise (`applyReady`), corbeille (`delete`),
535
- * upload (`push`).
555
+ * upload (`push`), renommage d'un nom non portable (`rename`).
536
556
  */
537
557
  export const AGENT_SYNC_OP_RESULT = 'sync.opResult' as const;
538
558
  export const agentSyncOpResultPayloadSchema = z.object({
539
559
  deviceId: z.uuid(),
540
560
  opId: syncOpId,
541
- op: z.enum(['apply', 'applyDir', 'applyLocal', 'applyReady', 'delete', 'move', 'push']),
561
+ op: z.enum([
562
+ 'apply',
563
+ 'applyDir',
564
+ 'applyLocal',
565
+ 'applyReady',
566
+ 'delete',
567
+ 'move',
568
+ 'push',
569
+ 'rename'
570
+ ]),
542
571
  ok: z.boolean(),
543
572
  /** `applyReady` seulement : octets de clair déjà détenus pour ce hash. */
544
573
  resumeFrom: z.number().int().nonnegative().optional(),
@@ -1095,7 +1124,22 @@ export const agentSyncScanPayloadSchema = z.object({
1095
1124
  * dissymétrie de version dégradent vers « scan complet », jamais vers
1096
1125
  * « saut ».
1097
1126
  */
1098
- mode: syncScanModeSchema.default('full')
1127
+ mode: syncScanModeSchema.default('full'),
1128
+ /**
1129
+ * The fingerprint of the baseline the server holds for this device. A full
1130
+ * walk that finds it again replies without its entries (`delta: true`,
1131
+ * nothing changed): the server then has nothing to reload. With `paths`,
1132
+ * it leaves their lines out, and the walk compares it to the fingerprint
1133
+ * of its index outside those paths.
1134
+ */
1135
+ expected: syncIndexFingerprintSchema.optional(),
1136
+ /**
1137
+ * Paths whose present state the reply must give even when unchanged for
1138
+ * the agent: an entry, `gone`, or a `skipped` line. The server sends the
1139
+ * ones it holds in error, where its baseline may not describe the device.
1140
+ * No fast reply while the list is not empty.
1141
+ */
1142
+ paths: z.array(syncRelPath).max(SYNC_SCAN_PATHS_MAX).optional()
1099
1143
  });
1100
1144
  export type AgentSyncScanPayload = z.infer<typeof agentSyncScanPayloadSchema>;
1101
1145
 
@@ -1280,6 +1324,22 @@ export const agentSyncDeletePayloadSchema = z.object({
1280
1324
  });
1281
1325
  export type AgentSyncDeletePayload = z.infer<typeof agentSyncDeletePayloadSchema>;
1282
1326
 
1327
+ /**
1328
+ * Renames, on the device, a path whose name keeps it out of the share (one
1329
+ * Windows cannot hold): the agent renames it in place, in the same folder,
1330
+ * and replies `sync.opResult` (`op: 'rename'`); the next scan sees it under
1331
+ * its new name. `fromRelPath` is, by definition, not portable: the agent only
1332
+ * requires it to stay inside the share. `relPath` must be portable.
1333
+ */
1334
+ export const AGENT_SYNC_RENAME = 'sync.rename' as const;
1335
+ export const agentSyncRenamePayloadSchema = z.object({
1336
+ opId: syncOpId,
1337
+ shareId: z.number().int().positive(),
1338
+ fromRelPath: syncRelPath,
1339
+ relPath: syncRelPath
1340
+ });
1341
+ export type AgentSyncRenamePayload = z.infer<typeof agentSyncRenamePayloadSchema>;
1342
+
1283
1343
  /** Collection config the server pushes to an agent (on connect + on change). */
1284
1344
  export const agentConfigPayloadSchema = z.object({
1285
1345
  /**
@@ -1513,6 +1573,7 @@ export const SIGNED_AGENT_COMMANDS: ReadonlySet<string> = new Set([
1513
1573
  AGENT_SYNC_APPLY_LOCAL,
1514
1574
  AGENT_SYNC_MOVE,
1515
1575
  AGENT_SYNC_DELETE,
1576
+ AGENT_SYNC_RENAME,
1516
1577
  AGENT_SERVICE,
1517
1578
  AGENT_POWER,
1518
1579
  AGENT_DESTROY,
@@ -105,6 +105,12 @@ declare module 'deveye-sdk-client' {
105
105
  }
106
106
  /** Copies `value` to the clipboard and confirms through its icon for two seconds; a refused clipboard stays silent. */
107
107
  export const CopyButton: ComponentType<CopyButtonProps>;
108
+ /**
109
+ * A block that only makes sense in one state (rows under the switch that
110
+ * commands them, an action bar while a selection exists): it unfolds when
111
+ * `open` turns true and folds back when it turns false, instead of popping.
112
+ */
113
+ export const Reveal: ComponentType<{ open: boolean; children: ReactNode }>;
108
114
  export interface LoadingVeilProps {
109
115
  /** Read by screen readers, and shown under the spinner when given. */
110
116
  label?: string;
@@ -172,7 +178,7 @@ declare module 'deveye-sdk-client' {
172
178
  export const LogOutput: ComponentType<LogOutputProps>;
173
179
  export const Checkbox: ComponentType<{
174
180
  checked: boolean;
175
- /** Receives the state AFTER the click — no event to unwrap. */
181
+ /** Receives the state AFTER the click: no event to unwrap. */
176
182
  onChange: (checked: boolean) => void;
177
183
  children?: ReactNode;
178
184
  disabled?: boolean;
@@ -459,7 +465,7 @@ declare module 'deveye-sdk-client' {
459
465
  children: ReactNode;
460
466
  className?: string;
461
467
  }>;
462
- /** One confirmation dialog for the whole app — see ConfirmDialog. */
468
+ /** One confirmation dialog for the whole app (see ConfirmDialog). */
463
469
  export interface ConfirmRequest {
464
470
  title: string;
465
471
  description?: ReactNode;
@@ -772,7 +778,7 @@ declare module 'deveye-sdk-client' {
772
778
  /**
773
779
  * A resource key an EXTERNAL module may own: `x-<slug>.<name>`, as listed
774
780
  * in its manifest `resources`. The app's bus is typed on the closed union
775
- * of native keys plus this shape — an arbitrary string is refused there,
781
+ * of native keys plus this shape: an arbitrary string is refused there,
776
782
  * so it is refused here too.
777
783
  */
778
784
  export type ExternalResourceKey = `x-${string}.${string}`;
package/src/sdk/client.ts CHANGED
@@ -95,6 +95,13 @@ export interface FeatureClient {
95
95
  * (`'notifications'`, `'permissions'`) need no panel.
96
96
  */
97
97
  settingsPanels?: Readonly<Record<string, ComponentType<SettingsPanelProps>>>;
98
+ /**
99
+ * Whether a custom tab applies to this scope, for a tab that only means
100
+ * something to some items (Mail's Access tab, for a mailbox the Mail
101
+ * server hosts). Asked when the settings open, the tab hidden until the
102
+ * answer. Omitted, every declared tab shows.
103
+ */
104
+ settingsTabApplies?(tabId: string, scope: SdkSettingsScope): Promise<boolean>;
98
105
  /**
99
106
  * The compact topbar widget declared by `manifest.topbarWidget`. Rendered
100
107
  * with NO props: everything it shows must come through YOUR feature's
@@ -521,3 +528,15 @@ export interface MailClientProvider {
521
528
  prefill?: MailAccountPrefill;
522
529
  }>;
523
530
  }
531
+
532
+ /**
533
+ * What the Mail server module offers under `MAILSERVER_CLIENT_PROVIDER`: Mail
534
+ * shows, on an account whose address the server hosts, the mailbox's own
535
+ * Access tab (its application passwords) and the way to its sheet.
536
+ */
537
+ export interface MailserverClientProvider {
538
+ /** The hosted mailbox holding this address among those the caller can read, or null. */
539
+ findByAddress(address: string): Promise<{ id: number } | null>;
540
+ /** The mailbox's Access settings panel, to mount under a scope naming that mailbox. */
541
+ AccessPanel: ComponentType<SettingsPanelProps>;
542
+ }
@@ -288,6 +288,13 @@ export interface MailTransportMessage {
288
288
  */
289
289
  export const MAIL_CLIENT_PROVIDER = 'mail.client' as const;
290
290
 
291
+ /**
292
+ * Key under `FeatureClient.providers` for what the Mail server offers Mail's
293
+ * screens: whether an address is hosted there, and the Access tab of its
294
+ * mailbox. The contract type lives in `@deveye/types/sdk/client`.
295
+ */
296
+ export const MAILSERVER_CLIENT_PROVIDER = 'mailserver.client' as const;
297
+
291
298
  /**
292
299
  * Key under `FeatureService.providers` for the Audience sites the app's
293
300
  * Projects feature links to: same shape and same reason as
package/src/sdk/server.ts CHANGED
@@ -32,6 +32,7 @@ import type {
32
32
  AgentSyncDeletePayload,
33
33
  AgentSyncIndexPayload,
34
34
  AgentSyncMovePayload,
35
+ AgentSyncRenamePayload,
35
36
  AgentSyncOpResultPayload,
36
37
  AgentSyncPushPayload,
37
38
  AgentSyncPushAckPayload,
@@ -728,6 +729,7 @@ export interface AgentsFacade {
728
729
  requestSyncApplyLocal(deviceId: string, payload: AgentSyncApplyLocalPayload): boolean;
729
730
  requestSyncMove(deviceId: string, payload: AgentSyncMovePayload): boolean;
730
731
  requestSyncDelete(deviceId: string, payload: AgentSyncDeletePayload): boolean;
732
+ requestSyncRename(deviceId: string, payload: AgentSyncRenamePayload): boolean;
731
733
  /** Fan-out to the browsers subscribed to the payload's share. */
732
734
  publishSyncProgress(payload: CloudSyncProgressPush): void;
733
735
  publishSyncState(payload: CloudSyncStatePush): void;
@@ -318,6 +318,7 @@ function recordingAgents(recorded: RecordedCalls, docker: TestAgents = {}): DevE
318
318
  requestSyncApplyLocal: req('requestSyncApplyLocal'),
319
319
  requestSyncMove: req('requestSyncMove'),
320
320
  requestSyncDelete: req('requestSyncDelete'),
321
+ requestSyncRename: req('requestSyncRename'),
321
322
  publishSyncProgress: () => undefined,
322
323
  publishSyncState: () => undefined,
323
324
  requestDestroy: req('requestDestroy'),