@takboo/dsh-session-bin 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +122 -2
  3. package/cordis.patch.yml +4 -0
  4. package/dist/client-model.js +1673 -0
  5. package/dist/client.js +17043 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/host/archive.d.ts +766 -0
  8. package/dist/host/lease.d.ts +4 -0
  9. package/dist/host/module.d.ts +705 -0
  10. package/dist/host/native-jsonl-files.d.ts +198 -0
  11. package/dist/host/native-retirement-admission.d.ts +33 -0
  12. package/dist/host/native-retirement-metadata.d.ts +109 -0
  13. package/dist/host/native-retirement-owner.d.ts +305 -0
  14. package/dist/host/native-retirement-persistence.d.ts +24 -0
  15. package/dist/host/native-retirement-sdk.d.ts +80 -0
  16. package/dist/host/native.d.ts +12 -0
  17. package/dist/host/platform-files.d.ts +19 -0
  18. package/dist/host/remote.d.ts +32 -0
  19. package/dist/host/retirement-owner-store.d.ts +124 -0
  20. package/dist/host/retirement-owner.d.ts +124 -0
  21. package/dist/host/retirement-store.d.ts +311 -0
  22. package/dist/host/retirement.d.ts +76 -0
  23. package/dist/host/store.d.ts +215 -0
  24. package/dist/index.d.ts +912 -0
  25. package/dist/index.js +4921 -0
  26. package/dist/index.js.map +7 -0
  27. package/dist/operations/archive.d.ts +82 -0
  28. package/dist/operations/index.d.ts +2 -0
  29. package/dist/operations/retirement-owner.d.ts +129 -0
  30. package/dist/operations/retirement.d.ts +821 -0
  31. package/dist/operations/schema.d.ts +115 -0
  32. package/dist/operations.js +130 -0
  33. package/dist/operations.js.map +7 -0
  34. package/dist/remote/contracts.d.ts +891 -0
  35. package/dist/remote.js +442 -0
  36. package/dist/remote.js.map +7 -0
  37. package/dist/types/client/components.d.ts +17 -0
  38. package/dist/types/client/index.d.ts +10 -0
  39. package/dist/types/client/locales.d.ts +116 -0
  40. package/dist/types/client/model.d.ts +137 -0
  41. package/dist/types/client/purge-batch.d.ts +45 -0
  42. package/dist/types/client/retirement-digest.d.ts +3 -0
  43. package/dist/types/operations/archive.d.ts +82 -0
  44. package/dist/types/operations/retirement.d.ts +821 -0
  45. package/dist/types/operations/schema.d.ts +115 -0
  46. package/dist/types/remote/contracts.d.ts +891 -0
  47. package/docs/client-interface.md +79 -0
  48. package/docs/host-lifecycle.md +158 -0
  49. package/locale/en.json +6 -0
  50. package/locale/zh.json +6 -0
  51. package/package.json +163 -4
@@ -0,0 +1,912 @@
1
+ import { Context, Service } from '@deepseek-ai/cordis';
2
+ import schema from '@deepseek-ai/schemastery';
3
+ import type { PreparePurgeRequest, PurgePlan } from './operations/retirement.js';
4
+ import { NativeRetirementOwner } from './host/native-retirement-owner.js';
5
+ import type { BinPlan } from './operations/schema.js';
6
+ import type { ArchivePlan, ArchivePrepareRequest } from './operations/archive.js';
7
+ export * from './host/platform-files.js';
8
+ export * from './host/native-retirement-owner.js';
9
+ export * from './host/native-jsonl-files.js';
10
+ export * from './host/native-retirement-metadata.js';
11
+ export * from './host/native-retirement-admission.js';
12
+ export * from './host/native-retirement-persistence.js';
13
+ export { acquireBinLease, BinLeaseError } from './host/lease.js';
14
+ export { DshBinPort } from './host/native.js';
15
+ export { binDomainSpec, DomainBinStore, archiveDomainSpec, DomainArchiveStore } from './host/store.js';
16
+ export type { BinStore, ArchiveStore } from './host/store.js';
17
+ export { SessionBinModule, SessionBinError } from './host/module.js';
18
+ export { ArchiveModule } from './host/archive.js';
19
+ export type { NativeArchivePort, ArchiveOptions } from './host/archive.js';
20
+ export * from './operations/archive.js';
21
+ export { SessionBinRemote, installSessionBinRemote } from './host/remote.js';
22
+ export type { NativeBinPort, NativeSessionState, ReconcileReport } from './host/module.js';
23
+ export type { BinEntry, BinPlan, BinResult, BinOperation, PrepareRequest } from './operations/schema.js';
24
+ export * from './operations/retirement.js';
25
+ export * from './host/retirement-store.js';
26
+ export { retirementManifestDigest } from './host/retirement.js';
27
+ export type { SessionRetirementOwnerV1, RetirementOptions, PurgeReconcileReport } from './host/retirement.js';
28
+ export * from './operations/retirement-owner.js';
29
+ export * from './host/retirement-owner-store.js';
30
+ export { RetirementOwnerCoordinator, RetirementOwnerError } from './host/retirement-owner.js';
31
+ export type { RetirementOwnerGuards, RetirementLifecycleScope, RetirementLifecyclePort, RetirementResourceParticipant, RetirementOwnerCoordinatorOptions, RetirementOwnerCheckpoint, RetirementResource, RetirementResourceReceipt, } from './host/retirement-owner.js';
32
+ export interface Config {
33
+ coordinationDirectory?: string;
34
+ permanentDeletion?: boolean;
35
+ }
36
+ export declare const Config: schema<Schemastery.ObjectS<NoInfer<{
37
+ permanentDeletion: schema<boolean, boolean, "defined">;
38
+ coordinationDirectory: schema<string, string, "plain">;
39
+ }>>, Schemastery.ObjectT<NoInfer<{
40
+ permanentDeletion: schema<boolean, boolean, "defined">;
41
+ coordinationDirectory: schema<string, string, "plain">;
42
+ }>>, "plain">;
43
+ export declare const name = "session-bin";
44
+ export declare const inject: string[];
45
+ declare module '@deepseek-ai/cordis' {
46
+ interface Context {
47
+ sessionBin: SessionBin;
48
+ }
49
+ }
50
+ /** Production native archive interface; v1 core is confined to compatibility. */
51
+ export declare class SessionBin extends Service {
52
+ private readonly config;
53
+ private readonly createNativeOwner;
54
+ static inject: string[];
55
+ private module;
56
+ private legacy;
57
+ private archiveStore;
58
+ private nativeOwner;
59
+ private ready;
60
+ constructor(ctx: Context, config?: Config, createNativeOwner?: (ctx: Context) => Promise<NativeRetirementOwner | undefined>);
61
+ [Service.init](): Promise<void>;
62
+ private requireModule;
63
+ private checkLegacyClaim;
64
+ prepare(request: ArchivePrepareRequest): Promise<{
65
+ schemaVersion: 2;
66
+ operationId: string;
67
+ action: "unarchive";
68
+ sessionId: string;
69
+ expected: {
70
+ archived: boolean;
71
+ entryId: string | null;
72
+ };
73
+ blockers: {
74
+ code: string;
75
+ activity?: string[] | undefined;
76
+ }[];
77
+ }>;
78
+ preparePurge(request: PreparePurgeRequest): Promise<{
79
+ schemaVersion: 1 | 2;
80
+ action: "purge";
81
+ operationId: string;
82
+ sessionId: string;
83
+ expectedEntryId: string | null;
84
+ binding: {
85
+ schemaVersion: 1;
86
+ entryId: string;
87
+ entryVersion: 1;
88
+ lifecycle: {
89
+ storeId: string;
90
+ sessionId: string;
91
+ lifecycleId: string;
92
+ };
93
+ capabilities: {
94
+ protocolVersion: 1;
95
+ ownerId: string;
96
+ hostVersion: string;
97
+ providerId: string;
98
+ storeId: string;
99
+ participants: {
100
+ id: string;
101
+ version: string;
102
+ }[];
103
+ };
104
+ } | {
105
+ schemaVersion: 2;
106
+ target: "native-archive";
107
+ entryId: string;
108
+ entryVersion: 2;
109
+ lifecycle: {
110
+ storeId: string;
111
+ sessionId: string;
112
+ lifecycleId: string;
113
+ };
114
+ capabilities: {
115
+ protocolVersion: 1;
116
+ ownerId: string;
117
+ hostVersion: string;
118
+ providerId: string;
119
+ storeId: string;
120
+ participants: {
121
+ id: string;
122
+ version: string;
123
+ }[];
124
+ };
125
+ } | null;
126
+ manifest: {
127
+ schemaVersion: 1;
128
+ lifecycle: {
129
+ storeId: string;
130
+ sessionId: string;
131
+ lifecycleId: string;
132
+ };
133
+ capabilities: {
134
+ protocolVersion: 1;
135
+ ownerId: string;
136
+ hostVersion: string;
137
+ providerId: string;
138
+ storeId: string;
139
+ participants: {
140
+ id: string;
141
+ version: string;
142
+ }[];
143
+ };
144
+ resources: {
145
+ ownerId: string;
146
+ resourceId: string;
147
+ revision: string;
148
+ kind: "transcript" | "workspace" | "index" | "cache" | "attachment" | "spill" | "coordination";
149
+ disposition: "erase" | "release-reference" | "retain-shared" | "retain-coordination";
150
+ retention: {
151
+ reason: "shared-reference" | "coordination-identity";
152
+ retainedBy: {
153
+ storeId: string;
154
+ sessionId: string;
155
+ lifecycleId: string;
156
+ }[];
157
+ } | null;
158
+ }[];
159
+ } | null;
160
+ blockers: {
161
+ code: string;
162
+ activity?: string[] | undefined;
163
+ }[];
164
+ }>;
165
+ executePurge(input: PurgePlan): Promise<{
166
+ action: "purge";
167
+ operationId: string;
168
+ sessionId: string;
169
+ entryId: string | null;
170
+ status: "success" | "rejected" | "conflict" | "pending-recovery" | "partial-failure";
171
+ reason: string | null;
172
+ ownerState: {
173
+ schemaVersion: 1;
174
+ request: {
175
+ operationId: string;
176
+ expected: {
177
+ storeId: string;
178
+ sessionId: string;
179
+ lifecycleId: string;
180
+ };
181
+ bin: {
182
+ entryId: string;
183
+ entryVersion: 1;
184
+ } | {
185
+ kind: "native-archive";
186
+ entryId: string;
187
+ entryVersion: 2;
188
+ };
189
+ manifestDigest: string;
190
+ };
191
+ manifest: {
192
+ schemaVersion: 1;
193
+ lifecycle: {
194
+ storeId: string;
195
+ sessionId: string;
196
+ lifecycleId: string;
197
+ };
198
+ capabilities: {
199
+ protocolVersion: 1;
200
+ ownerId: string;
201
+ hostVersion: string;
202
+ providerId: string;
203
+ storeId: string;
204
+ participants: {
205
+ id: string;
206
+ version: string;
207
+ }[];
208
+ };
209
+ resources: {
210
+ ownerId: string;
211
+ resourceId: string;
212
+ revision: string;
213
+ kind: "transcript" | "workspace" | "index" | "cache" | "attachment" | "spill" | "coordination";
214
+ disposition: "erase" | "release-reference" | "retain-shared" | "retain-coordination";
215
+ retention: {
216
+ reason: "shared-reference" | "coordination-identity";
217
+ retainedBy: {
218
+ storeId: string;
219
+ sessionId: string;
220
+ lifecycleId: string;
221
+ }[];
222
+ } | null;
223
+ }[];
224
+ };
225
+ authorizationId: string | null;
226
+ phase: "rejected" | "conflict" | "done" | "fenced" | "quiesced" | "erasing" | "converging";
227
+ reason: string | null;
228
+ resources: {
229
+ ownerId: string;
230
+ resourceId: string;
231
+ status: "erased" | "reference-released" | "retained" | "failed";
232
+ reason: string | null;
233
+ }[];
234
+ } | null;
235
+ }>;
236
+ getPurgeOperation(operationId: string): Promise<{
237
+ schemaVersion: 1 | 2;
238
+ plan: {
239
+ schemaVersion: 1 | 2;
240
+ action: "purge";
241
+ operationId: string;
242
+ sessionId: string;
243
+ expectedEntryId: string | null;
244
+ binding: {
245
+ schemaVersion: 1;
246
+ entryId: string;
247
+ entryVersion: 1;
248
+ lifecycle: {
249
+ storeId: string;
250
+ sessionId: string;
251
+ lifecycleId: string;
252
+ };
253
+ capabilities: {
254
+ protocolVersion: 1;
255
+ ownerId: string;
256
+ hostVersion: string;
257
+ providerId: string;
258
+ storeId: string;
259
+ participants: {
260
+ id: string;
261
+ version: string;
262
+ }[];
263
+ };
264
+ } | {
265
+ schemaVersion: 2;
266
+ target: "native-archive";
267
+ entryId: string;
268
+ entryVersion: 2;
269
+ lifecycle: {
270
+ storeId: string;
271
+ sessionId: string;
272
+ lifecycleId: string;
273
+ };
274
+ capabilities: {
275
+ protocolVersion: 1;
276
+ ownerId: string;
277
+ hostVersion: string;
278
+ providerId: string;
279
+ storeId: string;
280
+ participants: {
281
+ id: string;
282
+ version: string;
283
+ }[];
284
+ };
285
+ } | null;
286
+ manifest: {
287
+ schemaVersion: 1;
288
+ lifecycle: {
289
+ storeId: string;
290
+ sessionId: string;
291
+ lifecycleId: string;
292
+ };
293
+ capabilities: {
294
+ protocolVersion: 1;
295
+ ownerId: string;
296
+ hostVersion: string;
297
+ providerId: string;
298
+ storeId: string;
299
+ participants: {
300
+ id: string;
301
+ version: string;
302
+ }[];
303
+ };
304
+ resources: {
305
+ ownerId: string;
306
+ resourceId: string;
307
+ revision: string;
308
+ kind: "transcript" | "workspace" | "index" | "cache" | "attachment" | "spill" | "coordination";
309
+ disposition: "erase" | "release-reference" | "retain-shared" | "retain-coordination";
310
+ retention: {
311
+ reason: "shared-reference" | "coordination-identity";
312
+ retainedBy: {
313
+ storeId: string;
314
+ sessionId: string;
315
+ lifecycleId: string;
316
+ }[];
317
+ } | null;
318
+ }[];
319
+ } | null;
320
+ blockers: {
321
+ code: string;
322
+ activity?: string[] | undefined;
323
+ }[];
324
+ };
325
+ createdAt: string;
326
+ phase: "intent" | "done" | "authorizing" | "owner-pending";
327
+ entry: {
328
+ schemaVersion: 1;
329
+ sessionId: string;
330
+ entryId: string;
331
+ operationId: string;
332
+ binnedAt: string;
333
+ workspaceIdAtBin: string | null;
334
+ wasArchived: boolean;
335
+ } | {
336
+ schemaVersion: 2;
337
+ sessionId: string;
338
+ entryId: string;
339
+ } | null;
340
+ authorizationId: string | null;
341
+ ownerState: {
342
+ schemaVersion: 1;
343
+ request: {
344
+ operationId: string;
345
+ expected: {
346
+ storeId: string;
347
+ sessionId: string;
348
+ lifecycleId: string;
349
+ };
350
+ bin: {
351
+ entryId: string;
352
+ entryVersion: 1;
353
+ } | {
354
+ kind: "native-archive";
355
+ entryId: string;
356
+ entryVersion: 2;
357
+ };
358
+ manifestDigest: string;
359
+ };
360
+ manifest: {
361
+ schemaVersion: 1;
362
+ lifecycle: {
363
+ storeId: string;
364
+ sessionId: string;
365
+ lifecycleId: string;
366
+ };
367
+ capabilities: {
368
+ protocolVersion: 1;
369
+ ownerId: string;
370
+ hostVersion: string;
371
+ providerId: string;
372
+ storeId: string;
373
+ participants: {
374
+ id: string;
375
+ version: string;
376
+ }[];
377
+ };
378
+ resources: {
379
+ ownerId: string;
380
+ resourceId: string;
381
+ revision: string;
382
+ kind: "transcript" | "workspace" | "index" | "cache" | "attachment" | "spill" | "coordination";
383
+ disposition: "erase" | "release-reference" | "retain-shared" | "retain-coordination";
384
+ retention: {
385
+ reason: "shared-reference" | "coordination-identity";
386
+ retainedBy: {
387
+ storeId: string;
388
+ sessionId: string;
389
+ lifecycleId: string;
390
+ }[];
391
+ } | null;
392
+ }[];
393
+ };
394
+ authorizationId: string | null;
395
+ phase: "rejected" | "conflict" | "done" | "fenced" | "quiesced" | "erasing" | "converging";
396
+ reason: string | null;
397
+ resources: {
398
+ ownerId: string;
399
+ resourceId: string;
400
+ status: "erased" | "reference-released" | "retained" | "failed";
401
+ reason: string | null;
402
+ }[];
403
+ } | null;
404
+ result: {
405
+ action: "purge";
406
+ operationId: string;
407
+ sessionId: string;
408
+ entryId: string | null;
409
+ status: "success" | "rejected" | "conflict" | "pending-recovery" | "partial-failure";
410
+ reason: string | null;
411
+ ownerState: {
412
+ schemaVersion: 1;
413
+ request: {
414
+ operationId: string;
415
+ expected: {
416
+ storeId: string;
417
+ sessionId: string;
418
+ lifecycleId: string;
419
+ };
420
+ bin: {
421
+ entryId: string;
422
+ entryVersion: 1;
423
+ } | {
424
+ kind: "native-archive";
425
+ entryId: string;
426
+ entryVersion: 2;
427
+ };
428
+ manifestDigest: string;
429
+ };
430
+ manifest: {
431
+ schemaVersion: 1;
432
+ lifecycle: {
433
+ storeId: string;
434
+ sessionId: string;
435
+ lifecycleId: string;
436
+ };
437
+ capabilities: {
438
+ protocolVersion: 1;
439
+ ownerId: string;
440
+ hostVersion: string;
441
+ providerId: string;
442
+ storeId: string;
443
+ participants: {
444
+ id: string;
445
+ version: string;
446
+ }[];
447
+ };
448
+ resources: {
449
+ ownerId: string;
450
+ resourceId: string;
451
+ revision: string;
452
+ kind: "transcript" | "workspace" | "index" | "cache" | "attachment" | "spill" | "coordination";
453
+ disposition: "erase" | "release-reference" | "retain-shared" | "retain-coordination";
454
+ retention: {
455
+ reason: "shared-reference" | "coordination-identity";
456
+ retainedBy: {
457
+ storeId: string;
458
+ sessionId: string;
459
+ lifecycleId: string;
460
+ }[];
461
+ } | null;
462
+ }[];
463
+ };
464
+ authorizationId: string | null;
465
+ phase: "rejected" | "conflict" | "done" | "fenced" | "quiesced" | "erasing" | "converging";
466
+ reason: string | null;
467
+ resources: {
468
+ ownerId: string;
469
+ resourceId: string;
470
+ status: "erased" | "reference-released" | "retained" | "failed";
471
+ reason: string | null;
472
+ }[];
473
+ } | null;
474
+ } | null;
475
+ } | undefined>;
476
+ purgeOperations(): Promise<{
477
+ schemaVersion: 1 | 2;
478
+ plan: {
479
+ schemaVersion: 1 | 2;
480
+ action: "purge";
481
+ operationId: string;
482
+ sessionId: string;
483
+ expectedEntryId: string | null;
484
+ binding: {
485
+ schemaVersion: 1;
486
+ entryId: string;
487
+ entryVersion: 1;
488
+ lifecycle: {
489
+ storeId: string;
490
+ sessionId: string;
491
+ lifecycleId: string;
492
+ };
493
+ capabilities: {
494
+ protocolVersion: 1;
495
+ ownerId: string;
496
+ hostVersion: string;
497
+ providerId: string;
498
+ storeId: string;
499
+ participants: {
500
+ id: string;
501
+ version: string;
502
+ }[];
503
+ };
504
+ } | {
505
+ schemaVersion: 2;
506
+ target: "native-archive";
507
+ entryId: string;
508
+ entryVersion: 2;
509
+ lifecycle: {
510
+ storeId: string;
511
+ sessionId: string;
512
+ lifecycleId: string;
513
+ };
514
+ capabilities: {
515
+ protocolVersion: 1;
516
+ ownerId: string;
517
+ hostVersion: string;
518
+ providerId: string;
519
+ storeId: string;
520
+ participants: {
521
+ id: string;
522
+ version: string;
523
+ }[];
524
+ };
525
+ } | null;
526
+ manifest: {
527
+ schemaVersion: 1;
528
+ lifecycle: {
529
+ storeId: string;
530
+ sessionId: string;
531
+ lifecycleId: string;
532
+ };
533
+ capabilities: {
534
+ protocolVersion: 1;
535
+ ownerId: string;
536
+ hostVersion: string;
537
+ providerId: string;
538
+ storeId: string;
539
+ participants: {
540
+ id: string;
541
+ version: string;
542
+ }[];
543
+ };
544
+ resources: {
545
+ ownerId: string;
546
+ resourceId: string;
547
+ revision: string;
548
+ kind: "transcript" | "workspace" | "index" | "cache" | "attachment" | "spill" | "coordination";
549
+ disposition: "erase" | "release-reference" | "retain-shared" | "retain-coordination";
550
+ retention: {
551
+ reason: "shared-reference" | "coordination-identity";
552
+ retainedBy: {
553
+ storeId: string;
554
+ sessionId: string;
555
+ lifecycleId: string;
556
+ }[];
557
+ } | null;
558
+ }[];
559
+ } | null;
560
+ blockers: {
561
+ code: string;
562
+ activity?: string[] | undefined;
563
+ }[];
564
+ };
565
+ createdAt: string;
566
+ phase: "intent" | "done" | "authorizing" | "owner-pending";
567
+ entry: {
568
+ schemaVersion: 1;
569
+ sessionId: string;
570
+ entryId: string;
571
+ operationId: string;
572
+ binnedAt: string;
573
+ workspaceIdAtBin: string | null;
574
+ wasArchived: boolean;
575
+ } | {
576
+ schemaVersion: 2;
577
+ sessionId: string;
578
+ entryId: string;
579
+ } | null;
580
+ authorizationId: string | null;
581
+ ownerState: {
582
+ schemaVersion: 1;
583
+ request: {
584
+ operationId: string;
585
+ expected: {
586
+ storeId: string;
587
+ sessionId: string;
588
+ lifecycleId: string;
589
+ };
590
+ bin: {
591
+ entryId: string;
592
+ entryVersion: 1;
593
+ } | {
594
+ kind: "native-archive";
595
+ entryId: string;
596
+ entryVersion: 2;
597
+ };
598
+ manifestDigest: string;
599
+ };
600
+ manifest: {
601
+ schemaVersion: 1;
602
+ lifecycle: {
603
+ storeId: string;
604
+ sessionId: string;
605
+ lifecycleId: string;
606
+ };
607
+ capabilities: {
608
+ protocolVersion: 1;
609
+ ownerId: string;
610
+ hostVersion: string;
611
+ providerId: string;
612
+ storeId: string;
613
+ participants: {
614
+ id: string;
615
+ version: string;
616
+ }[];
617
+ };
618
+ resources: {
619
+ ownerId: string;
620
+ resourceId: string;
621
+ revision: string;
622
+ kind: "transcript" | "workspace" | "index" | "cache" | "attachment" | "spill" | "coordination";
623
+ disposition: "erase" | "release-reference" | "retain-shared" | "retain-coordination";
624
+ retention: {
625
+ reason: "shared-reference" | "coordination-identity";
626
+ retainedBy: {
627
+ storeId: string;
628
+ sessionId: string;
629
+ lifecycleId: string;
630
+ }[];
631
+ } | null;
632
+ }[];
633
+ };
634
+ authorizationId: string | null;
635
+ phase: "rejected" | "conflict" | "done" | "fenced" | "quiesced" | "erasing" | "converging";
636
+ reason: string | null;
637
+ resources: {
638
+ ownerId: string;
639
+ resourceId: string;
640
+ status: "erased" | "reference-released" | "retained" | "failed";
641
+ reason: string | null;
642
+ }[];
643
+ } | null;
644
+ result: {
645
+ action: "purge";
646
+ operationId: string;
647
+ sessionId: string;
648
+ entryId: string | null;
649
+ status: "success" | "rejected" | "conflict" | "pending-recovery" | "partial-failure";
650
+ reason: string | null;
651
+ ownerState: {
652
+ schemaVersion: 1;
653
+ request: {
654
+ operationId: string;
655
+ expected: {
656
+ storeId: string;
657
+ sessionId: string;
658
+ lifecycleId: string;
659
+ };
660
+ bin: {
661
+ entryId: string;
662
+ entryVersion: 1;
663
+ } | {
664
+ kind: "native-archive";
665
+ entryId: string;
666
+ entryVersion: 2;
667
+ };
668
+ manifestDigest: string;
669
+ };
670
+ manifest: {
671
+ schemaVersion: 1;
672
+ lifecycle: {
673
+ storeId: string;
674
+ sessionId: string;
675
+ lifecycleId: string;
676
+ };
677
+ capabilities: {
678
+ protocolVersion: 1;
679
+ ownerId: string;
680
+ hostVersion: string;
681
+ providerId: string;
682
+ storeId: string;
683
+ participants: {
684
+ id: string;
685
+ version: string;
686
+ }[];
687
+ };
688
+ resources: {
689
+ ownerId: string;
690
+ resourceId: string;
691
+ revision: string;
692
+ kind: "transcript" | "workspace" | "index" | "cache" | "attachment" | "spill" | "coordination";
693
+ disposition: "erase" | "release-reference" | "retain-shared" | "retain-coordination";
694
+ retention: {
695
+ reason: "shared-reference" | "coordination-identity";
696
+ retainedBy: {
697
+ storeId: string;
698
+ sessionId: string;
699
+ lifecycleId: string;
700
+ }[];
701
+ } | null;
702
+ }[];
703
+ };
704
+ authorizationId: string | null;
705
+ phase: "rejected" | "conflict" | "done" | "fenced" | "quiesced" | "erasing" | "converging";
706
+ reason: string | null;
707
+ resources: {
708
+ ownerId: string;
709
+ resourceId: string;
710
+ status: "erased" | "reference-released" | "retained" | "failed";
711
+ reason: string | null;
712
+ }[];
713
+ } | null;
714
+ } | null;
715
+ }[]>;
716
+ reconcilePurge(): Promise<{
717
+ completed: {
718
+ action: "purge";
719
+ operationId: string;
720
+ sessionId: string;
721
+ entryId: string | null;
722
+ status: "success" | "rejected" | "conflict" | "pending-recovery" | "partial-failure";
723
+ reason: string | null;
724
+ ownerState: {
725
+ schemaVersion: 1;
726
+ request: {
727
+ operationId: string;
728
+ expected: {
729
+ storeId: string;
730
+ sessionId: string;
731
+ lifecycleId: string;
732
+ };
733
+ bin: {
734
+ entryId: string;
735
+ entryVersion: 1;
736
+ } | {
737
+ kind: "native-archive";
738
+ entryId: string;
739
+ entryVersion: 2;
740
+ };
741
+ manifestDigest: string;
742
+ };
743
+ manifest: {
744
+ schemaVersion: 1;
745
+ lifecycle: {
746
+ storeId: string;
747
+ sessionId: string;
748
+ lifecycleId: string;
749
+ };
750
+ capabilities: {
751
+ protocolVersion: 1;
752
+ ownerId: string;
753
+ hostVersion: string;
754
+ providerId: string;
755
+ storeId: string;
756
+ participants: {
757
+ id: string;
758
+ version: string;
759
+ }[];
760
+ };
761
+ resources: {
762
+ ownerId: string;
763
+ resourceId: string;
764
+ revision: string;
765
+ kind: "transcript" | "workspace" | "index" | "cache" | "attachment" | "spill" | "coordination";
766
+ disposition: "erase" | "release-reference" | "retain-shared" | "retain-coordination";
767
+ retention: {
768
+ reason: "shared-reference" | "coordination-identity";
769
+ retainedBy: {
770
+ storeId: string;
771
+ sessionId: string;
772
+ lifecycleId: string;
773
+ }[];
774
+ } | null;
775
+ }[];
776
+ };
777
+ authorizationId: string | null;
778
+ phase: "rejected" | "conflict" | "done" | "fenced" | "quiesced" | "erasing" | "converging";
779
+ reason: string | null;
780
+ resources: {
781
+ ownerId: string;
782
+ resourceId: string;
783
+ status: "erased" | "reference-released" | "retained" | "failed";
784
+ reason: string | null;
785
+ }[];
786
+ } | null;
787
+ }[];
788
+ pending: string[];
789
+ }>;
790
+ execute(input: ArchivePlan | BinPlan): Promise<{
791
+ operationId: string;
792
+ action: "bin" | "restore";
793
+ sessionId: string;
794
+ status: "success" | "rejected" | "conflict";
795
+ reason: string | null;
796
+ entryId: string | null;
797
+ }> | Promise<{
798
+ operationId: string;
799
+ action: "unarchive";
800
+ sessionId: string;
801
+ status: "success" | "rejected" | "conflict";
802
+ reason: string | null;
803
+ entryId: string | null;
804
+ }>;
805
+ list(): Promise<{
806
+ schemaVersion: 2;
807
+ sessionId: string;
808
+ entryId: string;
809
+ }[]>;
810
+ operations(): Promise<{
811
+ schemaVersion: 2;
812
+ plan: {
813
+ schemaVersion: 2;
814
+ operationId: string;
815
+ action: "unarchive";
816
+ sessionId: string;
817
+ expected: {
818
+ archived: boolean;
819
+ entryId: string | null;
820
+ };
821
+ blockers: {
822
+ code: string;
823
+ activity?: string[] | undefined;
824
+ }[];
825
+ };
826
+ createdAt: string;
827
+ phase: "intent" | "applied" | "done";
828
+ entry: {
829
+ schemaVersion: 2;
830
+ sessionId: string;
831
+ entryId: string;
832
+ } | null;
833
+ result: {
834
+ operationId: string;
835
+ action: "unarchive";
836
+ sessionId: string;
837
+ status: "success" | "rejected" | "conflict";
838
+ reason: string | null;
839
+ entryId: string | null;
840
+ } | null;
841
+ }[]>;
842
+ getOperation(operationId: string): Promise<{
843
+ schemaVersion: 1;
844
+ plan: {
845
+ schemaVersion: 1;
846
+ operationId: string;
847
+ action: "bin" | "restore";
848
+ sessionId: string;
849
+ expected: {
850
+ archived: boolean;
851
+ entryId: string | null;
852
+ };
853
+ blockers: {
854
+ code: string;
855
+ activity?: string[] | undefined;
856
+ }[];
857
+ };
858
+ createdAt: string;
859
+ phase: "intent" | "applied" | "done";
860
+ ownershipInvalidated: boolean;
861
+ entry: {
862
+ schemaVersion: 1;
863
+ sessionId: string;
864
+ entryId: string;
865
+ operationId: string;
866
+ binnedAt: string;
867
+ workspaceIdAtBin: string | null;
868
+ wasArchived: boolean;
869
+ } | null;
870
+ result: {
871
+ operationId: string;
872
+ action: "bin" | "restore";
873
+ sessionId: string;
874
+ status: "success" | "rejected" | "conflict";
875
+ reason: string | null;
876
+ entryId: string | null;
877
+ } | null;
878
+ } | {
879
+ schemaVersion: 2;
880
+ plan: {
881
+ schemaVersion: 2;
882
+ operationId: string;
883
+ action: "unarchive";
884
+ sessionId: string;
885
+ expected: {
886
+ archived: boolean;
887
+ entryId: string | null;
888
+ };
889
+ blockers: {
890
+ code: string;
891
+ activity?: string[] | undefined;
892
+ }[];
893
+ };
894
+ createdAt: string;
895
+ phase: "intent" | "applied" | "done";
896
+ entry: {
897
+ schemaVersion: 2;
898
+ sessionId: string;
899
+ entryId: string;
900
+ } | null;
901
+ result: {
902
+ operationId: string;
903
+ action: "unarchive";
904
+ sessionId: string;
905
+ status: "success" | "rejected" | "conflict";
906
+ reason: string | null;
907
+ entryId: string | null;
908
+ } | null;
909
+ } | undefined>;
910
+ reconcile(): Promise<void>;
911
+ }
912
+ export declare function apply(ctx: Context, config?: Config): Promise<void>;