@alwith/module-drive 0.0.0-stage → 0.1.0-rc.22

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 (107) hide show
  1. package/LICENSE +94 -0
  2. package/README.md +50 -2
  3. package/THIRD_PARTY_NOTICES.md +7 -0
  4. package/desktop-provenance.json +34 -0
  5. package/dist/badge-react.d.ts +9 -0
  6. package/dist/badge-react.js +1 -0
  7. package/dist/badge.d.ts +10 -0
  8. package/dist/badge.js +1 -0
  9. package/dist/browse.d.ts +33 -0
  10. package/dist/browse.js +1 -0
  11. package/dist/content/chat-condense.d.ts +22 -0
  12. package/dist/content/chat-condense.js +1 -0
  13. package/dist/content/collab.d.ts +34 -0
  14. package/dist/content/collab.js +1 -0
  15. package/dist/content/comment-anchors.d.ts +23 -0
  16. package/dist/content/comment-anchors.js +2 -0
  17. package/dist/content/comment-decorations.d.ts +23 -0
  18. package/dist/content/comment-decorations.js +3 -0
  19. package/dist/content/comment-drawer.d.ts +44 -0
  20. package/dist/content/comment-drawer.js +1 -0
  21. package/dist/content/comment-mentions.d.ts +18 -0
  22. package/dist/content/comment-mentions.js +1 -0
  23. package/dist/content/comment-surface.d.ts +25 -0
  24. package/dist/content/comment-surface.js +1 -0
  25. package/dist/content/condense-task.d.ts +44 -0
  26. package/dist/content/condense-task.js +1 -0
  27. package/dist/content/condense.d.ts +20 -0
  28. package/dist/content/condense.js +1 -0
  29. package/dist/content/editor.d.ts +5 -0
  30. package/dist/content/editor.js +1 -0
  31. package/dist/content/file-actions.d.ts +43 -0
  32. package/dist/content/file-actions.js +1 -0
  33. package/dist/content/file-link.d.ts +4 -0
  34. package/dist/content/file-link.js +1 -0
  35. package/dist/content/frontmatter-panel.d.ts +7 -0
  36. package/dist/content/frontmatter-panel.js +1 -0
  37. package/dist/content/frontmatter.d.ts +9 -0
  38. package/dist/content/frontmatter.js +7 -0
  39. package/dist/content/host.d.ts +49 -0
  40. package/dist/content/host.js +1 -0
  41. package/dist/content/html-bridge.d.ts +1 -0
  42. package/dist/content/html-bridge.js +187 -0
  43. package/dist/content/html-comments.d.ts +5 -0
  44. package/dist/content/html-comments.js +1 -0
  45. package/dist/content/markdown-comments.d.ts +4 -0
  46. package/dist/content/markdown-comments.js +2 -0
  47. package/dist/content/mention-picker.d.ts +10 -0
  48. package/dist/content/mention-picker.js +1 -0
  49. package/dist/content/save-version.d.ts +2 -0
  50. package/dist/content/save-version.js +1 -0
  51. package/dist/content/translations.d.ts +2 -0
  52. package/dist/content/translations.js +1 -0
  53. package/dist/content/use-file-comments.d.ts +12 -0
  54. package/dist/content/use-file-comments.js +1 -0
  55. package/dist/content/yuplink.d.ts +11 -0
  56. package/dist/content/yuplink.js +2 -0
  57. package/dist/content.css +64 -0
  58. package/dist/content.d.ts +10 -0
  59. package/dist/content.js +1 -0
  60. package/dist/contract.d.ts +780 -0
  61. package/dist/contract.js +0 -0
  62. package/dist/core.d.ts +22 -0
  63. package/dist/core.js +1 -0
  64. package/dist/files.d.ts +7 -0
  65. package/dist/files.js +1 -0
  66. package/dist/global-search.d.ts +34 -0
  67. package/dist/global-search.js +1 -0
  68. package/dist/icons.d.ts +5 -0
  69. package/dist/icons.js +1 -0
  70. package/dist/launcher.d.ts +15 -0
  71. package/dist/launcher.js +2 -0
  72. package/dist/locales.d.ts +983 -0
  73. package/dist/locales.js +1 -0
  74. package/dist/mass-delete.d.ts +9 -0
  75. package/dist/mass-delete.js +1 -0
  76. package/dist/notifications.d.ts +14 -0
  77. package/dist/notifications.js +1 -0
  78. package/dist/pinned-docs.d.ts +14 -0
  79. package/dist/pinned-docs.js +1 -0
  80. package/dist/pinned.d.ts +12 -0
  81. package/dist/pinned.js +1 -0
  82. package/dist/react.d.ts +29 -0
  83. package/dist/react.js +1 -0
  84. package/dist/roots.d.ts +10 -0
  85. package/dist/roots.js +1 -0
  86. package/dist/settings.d.ts +14 -0
  87. package/dist/settings.js +1 -0
  88. package/dist/sharing.d.ts +12 -0
  89. package/dist/sharing.js +1 -0
  90. package/dist/status.d.ts +16 -0
  91. package/dist/status.js +1 -0
  92. package/dist/styles.css +458 -0
  93. package/dist/summary.d.ts +10 -0
  94. package/dist/summary.js +1 -0
  95. package/dist/tauri.d.ts +6 -0
  96. package/dist/tauri.js +1 -0
  97. package/dist/transfer-feed.d.ts +36 -0
  98. package/dist/transfer-feed.js +1 -0
  99. package/dist/ui.d.ts +96 -0
  100. package/dist/ui.js +1 -0
  101. package/package.json +117 -4
  102. package/rust/Cargo.toml +14 -0
  103. package/rust/src/contract.rs +366 -0
  104. package/rust/src/lib.rs +5 -0
  105. package/rust/src/ownership.rs +4 -0
  106. package/rust/src/service.rs +140 -0
  107. package/rust/src/sync.rs +1602 -0
@@ -0,0 +1,780 @@
1
+ export type AccessRequestOutcome = "submitted" | "alreadyPending";
2
+ export type AccessRequestType = "FILE_ACCESS" | "PROJECT_JOIN";
3
+ export type ArchiveStatus = {
4
+ enabled: boolean;
5
+ syncing: boolean;
6
+ lastRunAt: string | null;
7
+ lastUploadAt: string | null;
8
+ synced: number;
9
+ lastUploaded: number;
10
+ lastError: string | null;
11
+ mode: string | null;
12
+ };
13
+ export type CleanupEntry = {
14
+ projectId: RemoteId;
15
+ name: string;
16
+ drivePath: string;
17
+ localPath: string;
18
+ files: number;
19
+ };
20
+ export type CleanupReport = {
21
+ stagingDir: string;
22
+ candidates: CleanupEntry[];
23
+ skipped: CleanupSkipped[];
24
+ moved: CleanupEntry[];
25
+ failed: string[];
26
+ };
27
+ export type CleanupSkipReason = "pinned" | "pendingChanges";
28
+ export type CleanupSkipped = {
29
+ name: string;
30
+ drivePath: string;
31
+ localPath: string;
32
+ reason: CleanupSkipReason;
33
+ };
34
+ export type ClientConfig = {
35
+ collabRelayUrl?: string | null;
36
+ webBaseUrl?: string | null;
37
+ serverVersion?: string | null;
38
+ largeFileThresholdBytes?: number | null;
39
+ maxUploadBytes?: number | null;
40
+ features?: {
41
+ [key in string]: boolean;
42
+ };
43
+ };
44
+ export type CloudFolder = {
45
+ path: string;
46
+ folderId: RemoteId;
47
+ };
48
+ export type CollabSession = {
49
+ fileId: RemoteId;
50
+ serverUrl: string;
51
+ room: string;
52
+ token: string;
53
+ canWrite: boolean;
54
+ };
55
+ export type CommentContext = {
56
+ fileId: RemoteId;
57
+ currentUserId: RemoteId;
58
+ isOwner: boolean;
59
+ };
60
+ export type CommentEvent = {
61
+ fileId: RemoteId;
62
+ commentId: RemoteId;
63
+ action: string;
64
+ actorId: RemoteId | null;
65
+ at: string | null;
66
+ };
67
+ export type CondenseResult = {
68
+ knowledgeFileId: RemoteId;
69
+ knowledgeTitle?: string | null;
70
+ sourcesLinked?: number | null;
71
+ humanUrl?: string | null;
72
+ };
73
+ export type Configuration = {
74
+ deviceId: string | null;
75
+ userName: string | null;
76
+ userId: string | null;
77
+ clientConfig: ClientConfig | null;
78
+ };
79
+ export type ConflictRecord = {
80
+ projectId: RemoteId;
81
+ path: string;
82
+ localPath: string;
83
+ conflictCopyPath: string | null;
84
+ remoteUpdatedBy: string | null;
85
+ at: string;
86
+ };
87
+ export type CreateCommentRequest = {
88
+ body: string;
89
+ mentionedUserIds: RemoteId[] | null;
90
+ parentId: RemoteId | null;
91
+ quote: string | null;
92
+ quoteOffset: number | null;
93
+ suggestedReplacement: string | null;
94
+ };
95
+ export type CreateProjectFromTemplateRequest = {
96
+ templateId: RemoteId;
97
+ name: string;
98
+ scope: ProjectScope;
99
+ departmentId?: RemoteId | null;
100
+ topicId?: RemoteId | null;
101
+ };
102
+ export type Department = {
103
+ id: RemoteId;
104
+ code?: string | null;
105
+ name: string;
106
+ parentId?: RemoteId | null;
107
+ type?: string | null;
108
+ path?: string | null;
109
+ };
110
+ export type DiskUsage = {
111
+ totalBytes: number;
112
+ totalFiles: number;
113
+ projects: DiskUsageProject[];
114
+ files: DiskUsageFile[];
115
+ };
116
+ export type DiskUsageFile = {
117
+ projectId: RemoteId;
118
+ projectName: string;
119
+ path: string;
120
+ localPath: string;
121
+ bytes: number;
122
+ };
123
+ export type DiskUsageProject = {
124
+ projectId: RemoteId;
125
+ name: string;
126
+ drivePath: string;
127
+ localPath: string;
128
+ bytes: number;
129
+ files: number;
130
+ };
131
+ export type DriveEvent = {
132
+ version: number;
133
+ generation: number;
134
+ sequence: number;
135
+ payload: Payload;
136
+ };
137
+ export type DriveRequest = {
138
+ type: "preferences";
139
+ } | {
140
+ type: "archivePrivateSessions";
141
+ } | {
142
+ type: "setArchivePrivate";
143
+ sessionId: string;
144
+ private: boolean;
145
+ } | {
146
+ type: "setPreferences";
147
+ sessionArchive: boolean;
148
+ knowledgeInject: boolean;
149
+ } | {
150
+ type: "archiveSession";
151
+ expectedGeneration: number;
152
+ sessionId: string;
153
+ cwd: string;
154
+ title: string;
155
+ updatedAt: string;
156
+ content: string;
157
+ } | {
158
+ type: "configuration";
159
+ } | {
160
+ type: "reconfigure";
161
+ localRoot: string;
162
+ userName: string;
163
+ } | {
164
+ type: "refreshClientConfig";
165
+ } | {
166
+ type: "mcpSessionConfig";
167
+ } | {
168
+ type: "retryUpload";
169
+ projectId: RemoteId;
170
+ path: string;
171
+ } | {
172
+ type: "cloudFolders";
173
+ projectId: RemoteId;
174
+ } | {
175
+ type: "fileRemoteId";
176
+ path: string;
177
+ } | {
178
+ type: "commentContext";
179
+ path: string;
180
+ } | {
181
+ type: "comments";
182
+ fileId: RemoteId;
183
+ } | {
184
+ type: "commentCreate";
185
+ fileId: RemoteId;
186
+ request: CreateCommentRequest;
187
+ } | {
188
+ type: "commentUpdate";
189
+ commentId: RemoteId;
190
+ body: string;
191
+ } | {
192
+ type: "commentDelete";
193
+ commentId: RemoteId;
194
+ } | {
195
+ type: "commentApply";
196
+ commentId: RemoteId;
197
+ } | {
198
+ type: "commentWatch";
199
+ ownerId: string;
200
+ fileIds: RemoteId[];
201
+ } | {
202
+ type: "collabSession";
203
+ path: string;
204
+ ownerId: string;
205
+ } | {
206
+ type: "collabEnd";
207
+ path: string;
208
+ ownerId: string;
209
+ } | {
210
+ type: "condensePreflight";
211
+ projectId: RemoteId;
212
+ scopePath: string | null;
213
+ } | {
214
+ type: "condenseStart";
215
+ projectId: RemoteId;
216
+ scopePath: string | null;
217
+ } | {
218
+ type: "job";
219
+ jobId: RemoteId;
220
+ } | {
221
+ type: "proposedCondense";
222
+ projectId: RemoteId;
223
+ } | {
224
+ type: "approveJob";
225
+ jobId: RemoteId;
226
+ } | {
227
+ type: "cancelJob";
228
+ jobId: RemoteId;
229
+ } | {
230
+ type: "knowledgeContext";
231
+ cwd: string;
232
+ } | {
233
+ type: "skillMirrors";
234
+ } | {
235
+ type: "archiveStatus";
236
+ } | {
237
+ type: "syncProject";
238
+ projectId: RemoteId;
239
+ } | {
240
+ type: "snapshot";
241
+ } | {
242
+ type: "moveBetweenProjects";
243
+ source: string;
244
+ destination: string;
245
+ } | {
246
+ type: "login";
247
+ baseUrl: string;
248
+ token: string;
249
+ localRoot: string;
250
+ } | {
251
+ type: "ssoConfig";
252
+ baseUrl: string;
253
+ } | {
254
+ type: "ssoLogin";
255
+ baseUrl: string;
256
+ localRoot: string;
257
+ } | {
258
+ type: "resolveRootOwnership";
259
+ generation: number;
260
+ accept: boolean;
261
+ } | {
262
+ type: "logout";
263
+ } | {
264
+ type: "start";
265
+ } | {
266
+ type: "stop";
267
+ } | {
268
+ type: "maxAutoDownloadMb";
269
+ } | {
270
+ type: "setMaxAutoDownloadMb";
271
+ megabytes: number;
272
+ } | {
273
+ type: "pause";
274
+ paused: boolean;
275
+ } | {
276
+ type: "sync";
277
+ } | {
278
+ type: "roots";
279
+ } | {
280
+ type: "pin";
281
+ projectId: RemoteId;
282
+ pinned: boolean;
283
+ } | {
284
+ type: "land";
285
+ projectId: RemoteId;
286
+ } | {
287
+ type: "file";
288
+ path: string;
289
+ } | {
290
+ type: "download";
291
+ projectId: RemoteId;
292
+ path: string;
293
+ } | {
294
+ type: "confirmDeletes";
295
+ projectId: RemoteId;
296
+ } | {
297
+ type: "cancelDeletes";
298
+ projectId: RemoteId;
299
+ } | {
300
+ type: "templates";
301
+ } | {
302
+ type: "departments";
303
+ } | {
304
+ type: "createProject";
305
+ request: CreateProjectFromTemplateRequest;
306
+ } | {
307
+ type: "shared";
308
+ } | {
309
+ type: "failedUploads";
310
+ } | {
311
+ type: "retryUploads";
312
+ } | {
313
+ type: "reconcile";
314
+ projectId: RemoteId | null;
315
+ } | {
316
+ type: "recheckCloudOnly";
317
+ } | {
318
+ type: "diskUsage";
319
+ limit: number;
320
+ } | {
321
+ type: "cleanupScan";
322
+ } | {
323
+ type: "cleanup";
324
+ paths: string[];
325
+ } | {
326
+ type: "ownershipGuard";
327
+ } | {
328
+ type: "syncAllPersonal";
329
+ enabled: boolean;
330
+ } | {
331
+ type: "grantTarget";
332
+ path: string;
333
+ } | {
334
+ type: "grants";
335
+ target: GrantTarget;
336
+ } | {
337
+ type: "setGrant";
338
+ target: GrantTarget;
339
+ request: SetGrantRequest;
340
+ } | {
341
+ type: "removeGrant";
342
+ target: GrantTarget;
343
+ subjectType: string;
344
+ subjectId: RemoteId;
345
+ } | {
346
+ type: "searchUsers";
347
+ query: string;
348
+ } | {
349
+ type: "searchDepartments";
350
+ query: string;
351
+ } | {
352
+ type: "requestAccess";
353
+ requestType: AccessRequestType;
354
+ targetId: RemoteId;
355
+ message: string | null;
356
+ } | {
357
+ type: "saveVersion";
358
+ path: string;
359
+ } | {
360
+ type: "localPath";
361
+ fileId: RemoteId;
362
+ };
363
+ export type DriveResponse = {
364
+ type: "rootOwnershipConfirmation";
365
+ data: {
366
+ generation: number;
367
+ localRoot: string;
368
+ };
369
+ } | {
370
+ type: "archivePrivateSessions";
371
+ data: string[];
372
+ } | {
373
+ type: "preferences";
374
+ data: Preferences;
375
+ } | {
376
+ type: "configuration";
377
+ data: Configuration;
378
+ } | {
379
+ type: "clientConfig";
380
+ data: ClientConfig;
381
+ } | {
382
+ type: "mcpSessionConfig";
383
+ data: McpSessionConfig | null;
384
+ } | {
385
+ type: "cloudFolders";
386
+ data: CloudFolder[];
387
+ } | {
388
+ type: "commentContext";
389
+ data: CommentContext | null;
390
+ } | {
391
+ type: "comments";
392
+ data: FileComment[];
393
+ } | {
394
+ type: "comment";
395
+ data: FileComment;
396
+ } | {
397
+ type: "collabSession";
398
+ data: CollabSession | null;
399
+ } | {
400
+ type: "unsynced";
401
+ data: UnsyncedSummary;
402
+ } | {
403
+ type: "job";
404
+ data: Job;
405
+ } | {
406
+ type: "jobs";
407
+ data: Job[];
408
+ } | {
409
+ type: "text";
410
+ data: string | null;
411
+ } | {
412
+ type: "skillMirrors";
413
+ data: SkillMirror[];
414
+ } | {
415
+ type: "archiveStatus";
416
+ data: ArchiveStatus;
417
+ } | {
418
+ type: "count";
419
+ data: number;
420
+ } | {
421
+ type: "maxAutoDownloadMb";
422
+ data: number;
423
+ } | {
424
+ type: "snapshot";
425
+ data: Snapshot;
426
+ } | {
427
+ type: "ssoConfig";
428
+ data: SsoConfig;
429
+ } | {
430
+ type: "roots";
431
+ data: RootInfo[];
432
+ } | {
433
+ type: "root";
434
+ data: RootInfo;
435
+ } | {
436
+ type: "file";
437
+ data: FileStateEvent | null;
438
+ } | {
439
+ type: "templates";
440
+ data: ProjectTemplate[];
441
+ } | {
442
+ type: "departments";
443
+ data: Department[];
444
+ } | {
445
+ type: "shared";
446
+ data: SharedItem[];
447
+ } | {
448
+ type: "failedUploads";
449
+ data: FailedUpload[];
450
+ } | {
451
+ type: "diskUsage";
452
+ data: DiskUsage;
453
+ } | {
454
+ type: "cleanup";
455
+ data: CleanupReport;
456
+ } | {
457
+ type: "ownershipGuard";
458
+ data: OwnershipGuard;
459
+ } | {
460
+ type: "grantTarget";
461
+ data: GrantTarget | null;
462
+ } | {
463
+ type: "grants";
464
+ data: GrantList;
465
+ } | {
466
+ type: "grantWrite";
467
+ data: GrantWriteOutcome;
468
+ } | {
469
+ type: "users";
470
+ data: UserBrief[];
471
+ } | {
472
+ type: "accessRequest";
473
+ data: AccessRequestOutcome;
474
+ } | {
475
+ type: "id";
476
+ data: RemoteId | null;
477
+ } | {
478
+ type: "path";
479
+ data: string | null;
480
+ } | {
481
+ type: "done";
482
+ };
483
+ export type EngineState = {
484
+ kind: "idle";
485
+ } | {
486
+ kind: "scanning";
487
+ } | {
488
+ kind: "syncing";
489
+ } | {
490
+ kind: "paused";
491
+ } | {
492
+ kind: "error";
493
+ message: string;
494
+ };
495
+ export type FailedUpload = {
496
+ projectId: RemoteId;
497
+ path: string;
498
+ localPath: string;
499
+ name: string;
500
+ state: FileState;
501
+ message: string;
502
+ attempts: number;
503
+ direction: SyncDirection;
504
+ firstAt: string;
505
+ lastAt: string;
506
+ nextAttemptAt: string;
507
+ retryable: boolean;
508
+ };
509
+ export type FileComment = {
510
+ id: RemoteId;
511
+ fileId: RemoteId;
512
+ parentId?: RemoteId | null;
513
+ authorId: RemoteId;
514
+ authorName?: string | null;
515
+ authorEmployeeNo?: string | null;
516
+ body?: string | null;
517
+ quote?: string | null;
518
+ quoteOffset?: number | null;
519
+ isAi?: boolean;
520
+ mentions?: UserBrief[] | null;
521
+ deleted?: boolean;
522
+ createdAt: string;
523
+ updatedAt?: string | null;
524
+ replies?: FileComment[];
525
+ suggestedReplacement?: string | null;
526
+ appliedAt?: string | null;
527
+ appliedBy?: UserBrief | null;
528
+ appliedVersionId?: RemoteId | null;
529
+ };
530
+ export type FileState = "synced" | "pending" | "uploading" | "conflict" | "cloudOnly" | "ignored" | "skippedTooLarge" | "notDownloaded" | "downloading" | "forbidden" | "readOnly" | "error" | "collab";
531
+ export type FileStateEvent = {
532
+ projectId: RemoteId;
533
+ path: string;
534
+ localPath: string;
535
+ state: FileState;
536
+ size?: number;
537
+ };
538
+ export type Grant = {
539
+ subjectType: string;
540
+ subjectId: RemoteId;
541
+ subjectDisplay?: string | null;
542
+ level: GrantLevel;
543
+ actions?: string[];
544
+ source?: GrantSource | null;
545
+ sourceResourceId?: RemoteId | null;
546
+ sourceDisplay?: string | null;
547
+ inherited?: boolean;
548
+ editable?: boolean;
549
+ };
550
+ export type GrantLevel = "VIEW" | "EDIT" | "MANAGE" | "CUSTOM";
551
+ export type GrantList = {
552
+ grants?: Grant[];
553
+ implicit?: ImplicitGrant[];
554
+ callerLevel?: GrantLevel | null;
555
+ };
556
+ export type GrantResourceKind = "FILE" | "FOLDER";
557
+ export type GrantSource = "FILE" | "FOLDER" | "SPACE";
558
+ export type GrantSubjectType = "USER" | "DEPT" | "ALL";
559
+ export type GrantTarget = {
560
+ kind: GrantResourceKind;
561
+ id: RemoteId;
562
+ };
563
+ export type GrantWriteOutcome = {
564
+ kind: "applied";
565
+ list: GrantList;
566
+ } | {
567
+ kind: "inherited";
568
+ inheritedFrom: InheritedFrom;
569
+ } | {
570
+ kind: "custom";
571
+ };
572
+ export type ImplicitGrant = {
573
+ subjectDisplay?: string | null;
574
+ level: GrantLevel;
575
+ reason?: string | null;
576
+ };
577
+ export type InheritedFrom = {
578
+ source?: GrantSource | null;
579
+ resourceId?: RemoteId | null;
580
+ projectKey?: string | null;
581
+ display?: string | null;
582
+ };
583
+ export type Job = {
584
+ id: RemoteId;
585
+ type?: string | null;
586
+ status: JobStatus;
587
+ projectId?: RemoteId | null;
588
+ progress?: number | null;
589
+ message?: string | null;
590
+ error?: string | null;
591
+ result?: CondenseResult | null;
592
+ };
593
+ export type JobStatus = "PENDING" | "CLAIMED" | "RUNNING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "PROPOSED";
594
+ export type McpHeader = {
595
+ name: string;
596
+ value: string;
597
+ };
598
+ export type McpSessionConfig = {
599
+ url: string;
600
+ headers: McpHeader[];
601
+ };
602
+ export type OwnershipGuard = {
603
+ unknownPersonalRoots: number;
604
+ threshold: number;
605
+ syncAllPersonal: boolean;
606
+ active: boolean;
607
+ };
608
+ export type Payload = {
609
+ type: "snapshot";
610
+ data: Snapshot;
611
+ } | {
612
+ type: "status";
613
+ data: StatusSnapshot;
614
+ } | {
615
+ type: "file";
616
+ data: FileStateEvent;
617
+ } | {
618
+ type: "project";
619
+ data: ProjectProgress;
620
+ } | {
621
+ type: "conflict";
622
+ data: ConflictRecord;
623
+ } | {
624
+ type: "readOnly";
625
+ data: ReadOnlyChange;
626
+ } | {
627
+ type: "changed";
628
+ data: string[];
629
+ } | {
630
+ type: "reconcile";
631
+ } | {
632
+ type: "comment";
633
+ data: CommentEvent;
634
+ } | {
635
+ type: "error";
636
+ data: string;
637
+ };
638
+ export type PendingDeletes = {
639
+ projectId: RemoteId;
640
+ drivePath: string;
641
+ count: number;
642
+ };
643
+ export type Preferences = {
644
+ sessionArchive: boolean;
645
+ knowledgeInject: boolean;
646
+ };
647
+ export type ProjectKind = "MATERIAL" | "KNOWLEDGE" | "SKILL";
648
+ export type ProjectPhase = "queued" | "syncing" | "done" | "failed";
649
+ export type ProjectProgress = {
650
+ projectId: RemoteId;
651
+ phase: ProjectPhase;
652
+ done: number;
653
+ total: number;
654
+ failed: number;
655
+ message: string | null;
656
+ at: string;
657
+ };
658
+ export type ProjectScope = "PERSONAL" | "DEPT" | "TEAM" | "COMPANY";
659
+ export type ProjectTemplate = {
660
+ id: RemoteId;
661
+ code?: string | null;
662
+ name: string;
663
+ description?: string | null;
664
+ kind?: string | null;
665
+ icon?: string | null;
666
+ builtin?: boolean;
667
+ };
668
+ export type ReadOnlyChange = {
669
+ projectId: RemoteId;
670
+ path: string;
671
+ localPath: string;
672
+ name: string;
673
+ fileId: RemoteId | null;
674
+ };
675
+ export type RemoteId = number | string;
676
+ export type RootInfo = {
677
+ projectId: RemoteId;
678
+ projectKey: string;
679
+ name: string;
680
+ kind: ProjectKind;
681
+ scope: ProjectScope;
682
+ deptName: string | null;
683
+ drivePath: string;
684
+ node: string | null;
685
+ container: string | null;
686
+ nodePath: string | null;
687
+ skillsPath: string | null;
688
+ syncEnabled: boolean;
689
+ canWrite: boolean;
690
+ cloudOnly: boolean;
691
+ cursor: string | null;
692
+ pinned: boolean;
693
+ departmentId: RemoteId | null;
694
+ ownerId: RemoteId | null;
695
+ isMine: boolean | null;
696
+ localPath: string;
697
+ selected: boolean;
698
+ };
699
+ export type SetGrantRequest = {
700
+ subjectType: GrantSubjectType;
701
+ subjectId: RemoteId;
702
+ level: GrantLevel;
703
+ };
704
+ export type SharedItem = {
705
+ resourceType: GrantResourceKind;
706
+ resourceId: RemoteId;
707
+ name: string;
708
+ projectId?: RemoteId | null;
709
+ projectName?: string | null;
710
+ level: GrantLevel;
711
+ grantedByName?: string | null;
712
+ grantedAt?: string | null;
713
+ folderPath?: string | null;
714
+ localPath?: string | null;
715
+ };
716
+ export type SkillMirror = {
717
+ projectId: RemoteId;
718
+ projectKey: string;
719
+ name: string;
720
+ autoInstalled: boolean;
721
+ pinned: boolean;
722
+ deptName: string | null;
723
+ localPath: string;
724
+ skillsPath: string | null;
725
+ installed: boolean;
726
+ };
727
+ export type Snapshot = {
728
+ version: number;
729
+ generation: number;
730
+ sequence: number;
731
+ configured: boolean;
732
+ running: boolean;
733
+ baseUrl: string;
734
+ localRoot: string;
735
+ webBaseUrl: string | null;
736
+ status: StatusSnapshot | null;
737
+ roots: RootInfo[];
738
+ pendingDeletes: PendingDeletes[];
739
+ files: FileStateEvent[];
740
+ projects: ProjectProgress[];
741
+ error: string | null;
742
+ };
743
+ export type SsoConfig = {
744
+ enabled: boolean;
745
+ issuer?: string | null;
746
+ clientId?: string | null;
747
+ authorizationEndpoint?: string | null;
748
+ tokenEndpoint?: string | null;
749
+ redirectUris?: string[];
750
+ scopes?: string[];
751
+ };
752
+ export type StatusSnapshot = {
753
+ state: EngineState;
754
+ pending: number;
755
+ uploading: number;
756
+ downloading: number;
757
+ synced: number;
758
+ failed: number;
759
+ conflicts: ConflictRecord[];
760
+ errors: SyncError[];
761
+ lastSyncAt: string | null;
762
+ pushConnected: boolean;
763
+ };
764
+ export type SyncDirection = "upload" | "download";
765
+ export type SyncError = {
766
+ projectId: RemoteId | null;
767
+ path: string | null;
768
+ message: string;
769
+ at: string;
770
+ };
771
+ export type UnsyncedSummary = {
772
+ pending: number;
773
+ failed: number;
774
+ paths: string[];
775
+ };
776
+ export type UserBrief = {
777
+ id: RemoteId;
778
+ employeeNo?: string | null;
779
+ name?: string | null;
780
+ };