@treeseed/sdk 0.13.0-rc.111 → 0.13.0-rc.113

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.
@@ -1 +1 @@
1
- {"completedAt":"2026-09-10T19:06:46.811Z"}
1
+ {"completedAt":"2026-09-10T23:14:23.976Z"}
@@ -1 +1,2 @@
1
1
  export * from './sandbox-contracts.js';
2
+ export * from './source-workspace.js';
@@ -1 +1,2 @@
1
1
  export * from "./sandbox-contracts.js";
2
+ export * from "./source-workspace.js";
@@ -0,0 +1,721 @@
1
+ import { z } from 'zod';
2
+ /** Portable identity of canonical source. Physical storage belongs exclusively to Deployment. */
3
+ export declare const sourceWorkspaceKeySchema: z.ZodObject<{
4
+ controlPlaneId: z.ZodString;
5
+ teamId: z.ZodString;
6
+ projectId: z.ZodString;
7
+ repositoryId: z.ZodString;
8
+ commit: z.ZodString;
9
+ formatVersion: z.ZodLiteral<1>;
10
+ profile: z.ZodLiteral<"source-only">;
11
+ }, "strict", z.ZodTypeAny, {
12
+ commit: string;
13
+ projectId: string;
14
+ teamId: string;
15
+ profile: "source-only";
16
+ repositoryId: string;
17
+ controlPlaneId: string;
18
+ formatVersion: 1;
19
+ }, {
20
+ commit: string;
21
+ projectId: string;
22
+ teamId: string;
23
+ profile: "source-only";
24
+ repositoryId: string;
25
+ controlPlaneId: string;
26
+ formatVersion: 1;
27
+ }>;
28
+ /** Authorization is resolved again at lease acquisition; a READY cache entry grants no access. */
29
+ export declare const sourceWorkspaceAuthorizationSchema: z.ZodEffects<z.ZodObject<{
30
+ schemaVersion: z.ZodLiteral<"treeseed.source-workspace-authorization/v1">;
31
+ id: z.ZodString;
32
+ providerId: z.ZodString;
33
+ assignmentId: z.ZodString;
34
+ attempt: z.ZodNumber;
35
+ source: z.ZodObject<{
36
+ controlPlaneId: z.ZodString;
37
+ teamId: z.ZodString;
38
+ projectId: z.ZodString;
39
+ repositoryId: z.ZodString;
40
+ commit: z.ZodString;
41
+ formatVersion: z.ZodLiteral<1>;
42
+ profile: z.ZodLiteral<"source-only">;
43
+ }, "strict", z.ZodTypeAny, {
44
+ commit: string;
45
+ projectId: string;
46
+ teamId: string;
47
+ profile: "source-only";
48
+ repositoryId: string;
49
+ controlPlaneId: string;
50
+ formatVersion: 1;
51
+ }, {
52
+ commit: string;
53
+ projectId: string;
54
+ teamId: string;
55
+ profile: "source-only";
56
+ repositoryId: string;
57
+ controlPlaneId: string;
58
+ formatVersion: 1;
59
+ }>;
60
+ mode: z.ZodEnum<["analysis", "work"]>;
61
+ publication: z.ZodEnum<["denied", "candidate-only"]>;
62
+ credentialBindingId: z.ZodString;
63
+ issuedAt: z.ZodString;
64
+ expiresAt: z.ZodString;
65
+ }, "strict", z.ZodTypeAny, {
66
+ id: string;
67
+ expiresAt: string;
68
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
69
+ providerId: string;
70
+ issuedAt: string;
71
+ assignmentId: string;
72
+ source: {
73
+ commit: string;
74
+ projectId: string;
75
+ teamId: string;
76
+ profile: "source-only";
77
+ repositoryId: string;
78
+ controlPlaneId: string;
79
+ formatVersion: 1;
80
+ };
81
+ mode: "analysis" | "work";
82
+ attempt: number;
83
+ publication: "denied" | "candidate-only";
84
+ credentialBindingId: string;
85
+ }, {
86
+ id: string;
87
+ expiresAt: string;
88
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
89
+ providerId: string;
90
+ issuedAt: string;
91
+ assignmentId: string;
92
+ source: {
93
+ commit: string;
94
+ projectId: string;
95
+ teamId: string;
96
+ profile: "source-only";
97
+ repositoryId: string;
98
+ controlPlaneId: string;
99
+ formatVersion: 1;
100
+ };
101
+ mode: "analysis" | "work";
102
+ attempt: number;
103
+ publication: "denied" | "candidate-only";
104
+ credentialBindingId: string;
105
+ }>, {
106
+ id: string;
107
+ expiresAt: string;
108
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
109
+ providerId: string;
110
+ issuedAt: string;
111
+ assignmentId: string;
112
+ source: {
113
+ commit: string;
114
+ projectId: string;
115
+ teamId: string;
116
+ profile: "source-only";
117
+ repositoryId: string;
118
+ controlPlaneId: string;
119
+ formatVersion: 1;
120
+ };
121
+ mode: "analysis" | "work";
122
+ attempt: number;
123
+ publication: "denied" | "candidate-only";
124
+ credentialBindingId: string;
125
+ }, {
126
+ id: string;
127
+ expiresAt: string;
128
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
129
+ providerId: string;
130
+ issuedAt: string;
131
+ assignmentId: string;
132
+ source: {
133
+ commit: string;
134
+ projectId: string;
135
+ teamId: string;
136
+ profile: "source-only";
137
+ repositoryId: string;
138
+ controlPlaneId: string;
139
+ formatVersion: 1;
140
+ };
141
+ mode: "analysis" | "work";
142
+ attempt: number;
143
+ publication: "denied" | "candidate-only";
144
+ credentialBindingId: string;
145
+ }>;
146
+ export declare const sourceWorkspaceLeaseSchema: z.ZodObject<{
147
+ schemaVersion: z.ZodLiteral<"treeseed.source-workspace-lease/v1">;
148
+ id: z.ZodString;
149
+ authorizationId: z.ZodString;
150
+ providerId: z.ZodString;
151
+ assignmentId: z.ZodString;
152
+ attempt: z.ZodNumber;
153
+ source: z.ZodObject<{
154
+ controlPlaneId: z.ZodString;
155
+ teamId: z.ZodString;
156
+ projectId: z.ZodString;
157
+ repositoryId: z.ZodString;
158
+ commit: z.ZodString;
159
+ formatVersion: z.ZodLiteral<1>;
160
+ profile: z.ZodLiteral<"source-only">;
161
+ }, "strict", z.ZodTypeAny, {
162
+ commit: string;
163
+ projectId: string;
164
+ teamId: string;
165
+ profile: "source-only";
166
+ repositoryId: string;
167
+ controlPlaneId: string;
168
+ formatVersion: 1;
169
+ }, {
170
+ commit: string;
171
+ projectId: string;
172
+ teamId: string;
173
+ profile: "source-only";
174
+ repositoryId: string;
175
+ controlPlaneId: string;
176
+ formatVersion: 1;
177
+ }>;
178
+ workspaceDigest: z.ZodString;
179
+ mode: z.ZodEnum<["analysis", "work"]>;
180
+ publication: z.ZodEnum<["denied", "candidate-only"]>;
181
+ state: z.ZodEnum<["active", "exporting", "released", "quarantined"]>;
182
+ createdAt: z.ZodString;
183
+ expiresAt: z.ZodString;
184
+ }, "strict", z.ZodTypeAny, {
185
+ id: string;
186
+ state: "active" | "released" | "quarantined" | "exporting";
187
+ expiresAt: string;
188
+ schemaVersion: "treeseed.source-workspace-lease/v1";
189
+ createdAt: string;
190
+ providerId: string;
191
+ assignmentId: string;
192
+ source: {
193
+ commit: string;
194
+ projectId: string;
195
+ teamId: string;
196
+ profile: "source-only";
197
+ repositoryId: string;
198
+ controlPlaneId: string;
199
+ formatVersion: 1;
200
+ };
201
+ mode: "analysis" | "work";
202
+ attempt: number;
203
+ publication: "denied" | "candidate-only";
204
+ authorizationId: string;
205
+ workspaceDigest: string;
206
+ }, {
207
+ id: string;
208
+ state: "active" | "released" | "quarantined" | "exporting";
209
+ expiresAt: string;
210
+ schemaVersion: "treeseed.source-workspace-lease/v1";
211
+ createdAt: string;
212
+ providerId: string;
213
+ assignmentId: string;
214
+ source: {
215
+ commit: string;
216
+ projectId: string;
217
+ teamId: string;
218
+ profile: "source-only";
219
+ repositoryId: string;
220
+ controlPlaneId: string;
221
+ formatVersion: 1;
222
+ };
223
+ mode: "analysis" | "work";
224
+ attempt: number;
225
+ publication: "denied" | "candidate-only";
226
+ authorizationId: string;
227
+ workspaceDigest: string;
228
+ }>;
229
+ /** This receipt is durable before execution storage can be destroyed. It is not merge authority. */
230
+ export declare const sourceCandidateReceiptSchema: z.ZodObject<{
231
+ schemaVersion: z.ZodLiteral<"treeseed.source-candidate-receipt/v1">;
232
+ id: z.ZodString;
233
+ leaseId: z.ZodString;
234
+ source: z.ZodObject<{
235
+ controlPlaneId: z.ZodString;
236
+ teamId: z.ZodString;
237
+ projectId: z.ZodString;
238
+ repositoryId: z.ZodString;
239
+ commit: z.ZodString;
240
+ formatVersion: z.ZodLiteral<1>;
241
+ profile: z.ZodLiteral<"source-only">;
242
+ }, "strict", z.ZodTypeAny, {
243
+ commit: string;
244
+ projectId: string;
245
+ teamId: string;
246
+ profile: "source-only";
247
+ repositoryId: string;
248
+ controlPlaneId: string;
249
+ formatVersion: 1;
250
+ }, {
251
+ commit: string;
252
+ projectId: string;
253
+ teamId: string;
254
+ profile: "source-only";
255
+ repositoryId: string;
256
+ controlPlaneId: string;
257
+ formatVersion: 1;
258
+ }>;
259
+ parentCandidateId: z.ZodNullable<z.ZodString>;
260
+ commit: z.ZodString;
261
+ bundle: z.ZodObject<{
262
+ artifactId: z.ZodString;
263
+ digest: z.ZodString;
264
+ bytes: z.ZodNumber;
265
+ }, "strict", z.ZodTypeAny, {
266
+ digest: string;
267
+ bytes: number;
268
+ artifactId: string;
269
+ }, {
270
+ digest: string;
271
+ bytes: number;
272
+ artifactId: string;
273
+ }>;
274
+ verification: z.ZodObject<{
275
+ objectClosure: z.ZodLiteral<true>;
276
+ ancestry: z.ZodLiteral<true>;
277
+ authority: z.ZodLiteral<true>;
278
+ }, "strict", z.ZodTypeAny, {
279
+ authority: true;
280
+ objectClosure: true;
281
+ ancestry: true;
282
+ }, {
283
+ authority: true;
284
+ objectClosure: true;
285
+ ancestry: true;
286
+ }>;
287
+ persistedAt: z.ZodString;
288
+ }, "strict", z.ZodTypeAny, {
289
+ id: string;
290
+ schemaVersion: "treeseed.source-candidate-receipt/v1";
291
+ commit: string;
292
+ source: {
293
+ commit: string;
294
+ projectId: string;
295
+ teamId: string;
296
+ profile: "source-only";
297
+ repositoryId: string;
298
+ controlPlaneId: string;
299
+ formatVersion: 1;
300
+ };
301
+ verification: {
302
+ authority: true;
303
+ objectClosure: true;
304
+ ancestry: true;
305
+ };
306
+ bundle: {
307
+ digest: string;
308
+ bytes: number;
309
+ artifactId: string;
310
+ };
311
+ leaseId: string;
312
+ parentCandidateId: string | null;
313
+ persistedAt: string;
314
+ }, {
315
+ id: string;
316
+ schemaVersion: "treeseed.source-candidate-receipt/v1";
317
+ commit: string;
318
+ source: {
319
+ commit: string;
320
+ projectId: string;
321
+ teamId: string;
322
+ profile: "source-only";
323
+ repositoryId: string;
324
+ controlPlaneId: string;
325
+ formatVersion: 1;
326
+ };
327
+ verification: {
328
+ authority: true;
329
+ objectClosure: true;
330
+ ancestry: true;
331
+ };
332
+ bundle: {
333
+ digest: string;
334
+ bytes: number;
335
+ artifactId: string;
336
+ };
337
+ leaseId: string;
338
+ parentCandidateId: string | null;
339
+ persistedAt: string;
340
+ }>;
341
+ export type SourceWorkspaceKey = z.infer<typeof sourceWorkspaceKeySchema>;
342
+ export type SourceWorkspaceAuthorization = z.infer<typeof sourceWorkspaceAuthorizationSchema>;
343
+ export type SourceWorkspaceLease = z.infer<typeof sourceWorkspaceLeaseSchema>;
344
+ export type SourceCandidateReceipt = z.infer<typeof sourceCandidateReceiptSchema>;
345
+ /** Provider-manager transport only. Recipient is an ephemeral host key, never a guest key. */
346
+ export declare const sourceWorkspaceRequestSchema: z.ZodObject<{
347
+ runnerId: z.ZodString;
348
+ leaseToken: z.ZodString;
349
+ recipientPublicKey: z.ZodString;
350
+ }, "strict", z.ZodTypeAny, {
351
+ runnerId: string;
352
+ leaseToken: string;
353
+ recipientPublicKey: string;
354
+ }, {
355
+ runnerId: string;
356
+ leaseToken: string;
357
+ recipientPublicKey: string;
358
+ }>;
359
+ export declare const sourceCredentialDeliverySchema: z.ZodObject<{
360
+ schemaVersion: z.ZodLiteral<"treeseed.source-credential-delivery/v1">;
361
+ id: z.ZodString;
362
+ authorizationId: z.ZodString;
363
+ algorithm: z.ZodLiteral<"x25519-hkdf-sha256-chacha20-poly1305">;
364
+ ephemeralPublicKey: z.ZodString;
365
+ nonce: z.ZodString;
366
+ ciphertext: z.ZodString;
367
+ tag: z.ZodString;
368
+ expiresAt: z.ZodString;
369
+ }, "strict", z.ZodTypeAny, {
370
+ id: string;
371
+ nonce: string;
372
+ expiresAt: string;
373
+ schemaVersion: "treeseed.source-credential-delivery/v1";
374
+ algorithm: "x25519-hkdf-sha256-chacha20-poly1305";
375
+ ciphertext: string;
376
+ tag: string;
377
+ authorizationId: string;
378
+ ephemeralPublicKey: string;
379
+ }, {
380
+ id: string;
381
+ nonce: string;
382
+ expiresAt: string;
383
+ schemaVersion: "treeseed.source-credential-delivery/v1";
384
+ algorithm: "x25519-hkdf-sha256-chacha20-poly1305";
385
+ ciphertext: string;
386
+ tag: string;
387
+ authorizationId: string;
388
+ ephemeralPublicKey: string;
389
+ }>;
390
+ export declare const sourceWorkspaceResponseSchema: z.ZodEffects<z.ZodObject<{
391
+ authorization: z.ZodEffects<z.ZodObject<{
392
+ schemaVersion: z.ZodLiteral<"treeseed.source-workspace-authorization/v1">;
393
+ id: z.ZodString;
394
+ providerId: z.ZodString;
395
+ assignmentId: z.ZodString;
396
+ attempt: z.ZodNumber;
397
+ source: z.ZodObject<{
398
+ controlPlaneId: z.ZodString;
399
+ teamId: z.ZodString;
400
+ projectId: z.ZodString;
401
+ repositoryId: z.ZodString;
402
+ commit: z.ZodString;
403
+ formatVersion: z.ZodLiteral<1>;
404
+ profile: z.ZodLiteral<"source-only">;
405
+ }, "strict", z.ZodTypeAny, {
406
+ commit: string;
407
+ projectId: string;
408
+ teamId: string;
409
+ profile: "source-only";
410
+ repositoryId: string;
411
+ controlPlaneId: string;
412
+ formatVersion: 1;
413
+ }, {
414
+ commit: string;
415
+ projectId: string;
416
+ teamId: string;
417
+ profile: "source-only";
418
+ repositoryId: string;
419
+ controlPlaneId: string;
420
+ formatVersion: 1;
421
+ }>;
422
+ mode: z.ZodEnum<["analysis", "work"]>;
423
+ publication: z.ZodEnum<["denied", "candidate-only"]>;
424
+ credentialBindingId: z.ZodString;
425
+ issuedAt: z.ZodString;
426
+ expiresAt: z.ZodString;
427
+ }, "strict", z.ZodTypeAny, {
428
+ id: string;
429
+ expiresAt: string;
430
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
431
+ providerId: string;
432
+ issuedAt: string;
433
+ assignmentId: string;
434
+ source: {
435
+ commit: string;
436
+ projectId: string;
437
+ teamId: string;
438
+ profile: "source-only";
439
+ repositoryId: string;
440
+ controlPlaneId: string;
441
+ formatVersion: 1;
442
+ };
443
+ mode: "analysis" | "work";
444
+ attempt: number;
445
+ publication: "denied" | "candidate-only";
446
+ credentialBindingId: string;
447
+ }, {
448
+ id: string;
449
+ expiresAt: string;
450
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
451
+ providerId: string;
452
+ issuedAt: string;
453
+ assignmentId: string;
454
+ source: {
455
+ commit: string;
456
+ projectId: string;
457
+ teamId: string;
458
+ profile: "source-only";
459
+ repositoryId: string;
460
+ controlPlaneId: string;
461
+ formatVersion: 1;
462
+ };
463
+ mode: "analysis" | "work";
464
+ attempt: number;
465
+ publication: "denied" | "candidate-only";
466
+ credentialBindingId: string;
467
+ }>, {
468
+ id: string;
469
+ expiresAt: string;
470
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
471
+ providerId: string;
472
+ issuedAt: string;
473
+ assignmentId: string;
474
+ source: {
475
+ commit: string;
476
+ projectId: string;
477
+ teamId: string;
478
+ profile: "source-only";
479
+ repositoryId: string;
480
+ controlPlaneId: string;
481
+ formatVersion: 1;
482
+ };
483
+ mode: "analysis" | "work";
484
+ attempt: number;
485
+ publication: "denied" | "candidate-only";
486
+ credentialBindingId: string;
487
+ }, {
488
+ id: string;
489
+ expiresAt: string;
490
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
491
+ providerId: string;
492
+ issuedAt: string;
493
+ assignmentId: string;
494
+ source: {
495
+ commit: string;
496
+ projectId: string;
497
+ teamId: string;
498
+ profile: "source-only";
499
+ repositoryId: string;
500
+ controlPlaneId: string;
501
+ formatVersion: 1;
502
+ };
503
+ mode: "analysis" | "work";
504
+ attempt: number;
505
+ publication: "denied" | "candidate-only";
506
+ credentialBindingId: string;
507
+ }>;
508
+ repository: z.ZodObject<{
509
+ provider: z.ZodLiteral<"github">;
510
+ owner: z.ZodString;
511
+ name: z.ZodString;
512
+ cloneUrl: z.ZodString;
513
+ ref: z.ZodString;
514
+ }, "strict", z.ZodTypeAny, {
515
+ provider: "github";
516
+ name: string;
517
+ owner: string;
518
+ ref: string;
519
+ cloneUrl: string;
520
+ }, {
521
+ provider: "github";
522
+ name: string;
523
+ owner: string;
524
+ ref: string;
525
+ cloneUrl: string;
526
+ }>;
527
+ credential: z.ZodObject<{
528
+ schemaVersion: z.ZodLiteral<"treeseed.source-credential-delivery/v1">;
529
+ id: z.ZodString;
530
+ authorizationId: z.ZodString;
531
+ algorithm: z.ZodLiteral<"x25519-hkdf-sha256-chacha20-poly1305">;
532
+ ephemeralPublicKey: z.ZodString;
533
+ nonce: z.ZodString;
534
+ ciphertext: z.ZodString;
535
+ tag: z.ZodString;
536
+ expiresAt: z.ZodString;
537
+ }, "strict", z.ZodTypeAny, {
538
+ id: string;
539
+ nonce: string;
540
+ expiresAt: string;
541
+ schemaVersion: "treeseed.source-credential-delivery/v1";
542
+ algorithm: "x25519-hkdf-sha256-chacha20-poly1305";
543
+ ciphertext: string;
544
+ tag: string;
545
+ authorizationId: string;
546
+ ephemeralPublicKey: string;
547
+ }, {
548
+ id: string;
549
+ nonce: string;
550
+ expiresAt: string;
551
+ schemaVersion: "treeseed.source-credential-delivery/v1";
552
+ algorithm: "x25519-hkdf-sha256-chacha20-poly1305";
553
+ ciphertext: string;
554
+ tag: string;
555
+ authorizationId: string;
556
+ ephemeralPublicKey: string;
557
+ }>;
558
+ }, "strict", z.ZodTypeAny, {
559
+ repository: {
560
+ provider: "github";
561
+ name: string;
562
+ owner: string;
563
+ ref: string;
564
+ cloneUrl: string;
565
+ };
566
+ authorization: {
567
+ id: string;
568
+ expiresAt: string;
569
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
570
+ providerId: string;
571
+ issuedAt: string;
572
+ assignmentId: string;
573
+ source: {
574
+ commit: string;
575
+ projectId: string;
576
+ teamId: string;
577
+ profile: "source-only";
578
+ repositoryId: string;
579
+ controlPlaneId: string;
580
+ formatVersion: 1;
581
+ };
582
+ mode: "analysis" | "work";
583
+ attempt: number;
584
+ publication: "denied" | "candidate-only";
585
+ credentialBindingId: string;
586
+ };
587
+ credential: {
588
+ id: string;
589
+ nonce: string;
590
+ expiresAt: string;
591
+ schemaVersion: "treeseed.source-credential-delivery/v1";
592
+ algorithm: "x25519-hkdf-sha256-chacha20-poly1305";
593
+ ciphertext: string;
594
+ tag: string;
595
+ authorizationId: string;
596
+ ephemeralPublicKey: string;
597
+ };
598
+ }, {
599
+ repository: {
600
+ provider: "github";
601
+ name: string;
602
+ owner: string;
603
+ ref: string;
604
+ cloneUrl: string;
605
+ };
606
+ authorization: {
607
+ id: string;
608
+ expiresAt: string;
609
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
610
+ providerId: string;
611
+ issuedAt: string;
612
+ assignmentId: string;
613
+ source: {
614
+ commit: string;
615
+ projectId: string;
616
+ teamId: string;
617
+ profile: "source-only";
618
+ repositoryId: string;
619
+ controlPlaneId: string;
620
+ formatVersion: 1;
621
+ };
622
+ mode: "analysis" | "work";
623
+ attempt: number;
624
+ publication: "denied" | "candidate-only";
625
+ credentialBindingId: string;
626
+ };
627
+ credential: {
628
+ id: string;
629
+ nonce: string;
630
+ expiresAt: string;
631
+ schemaVersion: "treeseed.source-credential-delivery/v1";
632
+ algorithm: "x25519-hkdf-sha256-chacha20-poly1305";
633
+ ciphertext: string;
634
+ tag: string;
635
+ authorizationId: string;
636
+ ephemeralPublicKey: string;
637
+ };
638
+ }>, {
639
+ repository: {
640
+ provider: "github";
641
+ name: string;
642
+ owner: string;
643
+ ref: string;
644
+ cloneUrl: string;
645
+ };
646
+ authorization: {
647
+ id: string;
648
+ expiresAt: string;
649
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
650
+ providerId: string;
651
+ issuedAt: string;
652
+ assignmentId: string;
653
+ source: {
654
+ commit: string;
655
+ projectId: string;
656
+ teamId: string;
657
+ profile: "source-only";
658
+ repositoryId: string;
659
+ controlPlaneId: string;
660
+ formatVersion: 1;
661
+ };
662
+ mode: "analysis" | "work";
663
+ attempt: number;
664
+ publication: "denied" | "candidate-only";
665
+ credentialBindingId: string;
666
+ };
667
+ credential: {
668
+ id: string;
669
+ nonce: string;
670
+ expiresAt: string;
671
+ schemaVersion: "treeseed.source-credential-delivery/v1";
672
+ algorithm: "x25519-hkdf-sha256-chacha20-poly1305";
673
+ ciphertext: string;
674
+ tag: string;
675
+ authorizationId: string;
676
+ ephemeralPublicKey: string;
677
+ };
678
+ }, {
679
+ repository: {
680
+ provider: "github";
681
+ name: string;
682
+ owner: string;
683
+ ref: string;
684
+ cloneUrl: string;
685
+ };
686
+ authorization: {
687
+ id: string;
688
+ expiresAt: string;
689
+ schemaVersion: "treeseed.source-workspace-authorization/v1";
690
+ providerId: string;
691
+ issuedAt: string;
692
+ assignmentId: string;
693
+ source: {
694
+ commit: string;
695
+ projectId: string;
696
+ teamId: string;
697
+ profile: "source-only";
698
+ repositoryId: string;
699
+ controlPlaneId: string;
700
+ formatVersion: 1;
701
+ };
702
+ mode: "analysis" | "work";
703
+ attempt: number;
704
+ publication: "denied" | "candidate-only";
705
+ credentialBindingId: string;
706
+ };
707
+ credential: {
708
+ id: string;
709
+ nonce: string;
710
+ expiresAt: string;
711
+ schemaVersion: "treeseed.source-credential-delivery/v1";
712
+ algorithm: "x25519-hkdf-sha256-chacha20-poly1305";
713
+ ciphertext: string;
714
+ tag: string;
715
+ authorizationId: string;
716
+ ephemeralPublicKey: string;
717
+ };
718
+ }>;
719
+ export type SourceCredentialDelivery = z.infer<typeof sourceCredentialDeliverySchema>;
720
+ export type SourceWorkspaceRequest = z.infer<typeof sourceWorkspaceRequestSchema>;
721
+ export type SourceWorkspaceResponse = z.infer<typeof sourceWorkspaceResponseSchema>;
@@ -0,0 +1,102 @@
1
+ import { z } from "zod";
2
+ const id = z.string().min(1).max(256);
3
+ const digest = z.string().regex(/^sha256:[a-f0-9]{64}$/u);
4
+ const commit = z.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u);
5
+ const sourceWorkspaceKeySchema = z.object({
6
+ controlPlaneId: id,
7
+ teamId: id,
8
+ projectId: id,
9
+ repositoryId: id,
10
+ commit,
11
+ formatVersion: z.literal(1),
12
+ profile: z.literal("source-only")
13
+ }).strict();
14
+ const sourceWorkspaceAuthorizationSchema = z.object({
15
+ schemaVersion: z.literal("treeseed.source-workspace-authorization/v1"),
16
+ id,
17
+ providerId: id,
18
+ assignmentId: id,
19
+ attempt: z.number().int().positive(),
20
+ source: sourceWorkspaceKeySchema,
21
+ mode: z.enum(["analysis", "work"]),
22
+ publication: z.enum(["denied", "candidate-only"]),
23
+ credentialBindingId: id,
24
+ issuedAt: z.string().datetime(),
25
+ expiresAt: z.string().datetime()
26
+ }).strict().superRefine((value, context) => {
27
+ if (Date.parse(value.expiresAt) <= Date.parse(value.issuedAt)) {
28
+ context.addIssue({ code: z.ZodIssueCode.custom, path: ["expiresAt"], message: "Workspace authorization must have a positive lifetime." });
29
+ }
30
+ if (value.mode === "analysis" && value.publication !== "denied") {
31
+ context.addIssue({ code: z.ZodIssueCode.custom, path: ["publication"], message: "Analysis cannot publish source changes." });
32
+ }
33
+ });
34
+ const sourceWorkspaceLeaseSchema = z.object({
35
+ schemaVersion: z.literal("treeseed.source-workspace-lease/v1"),
36
+ id,
37
+ authorizationId: id,
38
+ providerId: id,
39
+ assignmentId: id,
40
+ attempt: z.number().int().positive(),
41
+ source: sourceWorkspaceKeySchema,
42
+ workspaceDigest: digest,
43
+ mode: z.enum(["analysis", "work"]),
44
+ publication: z.enum(["denied", "candidate-only"]),
45
+ state: z.enum(["active", "exporting", "released", "quarantined"]),
46
+ createdAt: z.string().datetime(),
47
+ expiresAt: z.string().datetime()
48
+ }).strict();
49
+ const sourceCandidateReceiptSchema = z.object({
50
+ schemaVersion: z.literal("treeseed.source-candidate-receipt/v1"),
51
+ id,
52
+ leaseId: id,
53
+ source: sourceWorkspaceKeySchema,
54
+ parentCandidateId: id.nullable(),
55
+ commit,
56
+ bundle: z.object({ artifactId: id, digest, bytes: z.number().int().positive().safe() }).strict(),
57
+ verification: z.object({ objectClosure: z.literal(true), ancestry: z.literal(true), authority: z.literal(true) }).strict(),
58
+ persistedAt: z.string().datetime()
59
+ }).strict();
60
+ const sourceWorkspaceRequestSchema = z.object({
61
+ runnerId: id,
62
+ leaseToken: z.string().min(1).max(4096),
63
+ recipientPublicKey: z.string().regex(/^[A-Za-z0-9+/]{43}=$/u)
64
+ }).strict();
65
+ const sourceCredentialDeliverySchema = z.object({
66
+ schemaVersion: z.literal("treeseed.source-credential-delivery/v1"),
67
+ id,
68
+ authorizationId: id,
69
+ algorithm: z.literal("x25519-hkdf-sha256-chacha20-poly1305"),
70
+ ephemeralPublicKey: z.string().regex(/^[A-Za-z0-9+/]{43}=$/u),
71
+ nonce: z.string().regex(/^[A-Za-z0-9+/]{16}$/u),
72
+ ciphertext: z.string().min(1).max(16384),
73
+ tag: z.string().regex(/^[A-Za-z0-9+/]{22}==$/u),
74
+ expiresAt: z.string().datetime()
75
+ }).strict();
76
+ const sourceWorkspaceResponseSchema = z.object({
77
+ authorization: sourceWorkspaceAuthorizationSchema,
78
+ repository: z.object({
79
+ provider: z.literal("github"),
80
+ owner: z.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9-]{0,99}$/u),
81
+ name: z.string().regex(/^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,99}$/u),
82
+ cloneUrl: z.string().url().startsWith("https://github.com/"),
83
+ ref: id
84
+ }).strict(),
85
+ credential: sourceCredentialDeliverySchema
86
+ }).strict().superRefine((value, context) => {
87
+ if (value.repository.cloneUrl !== `https://github.com/${value.repository.owner}/${value.repository.name}.git`) {
88
+ context.addIssue({ code: z.ZodIssueCode.custom, path: ["repository", "cloneUrl"], message: "Source transport must match its provider repository." });
89
+ }
90
+ if (value.credential.authorizationId !== value.authorization.id || value.credential.expiresAt !== value.authorization.expiresAt) {
91
+ context.addIssue({ code: z.ZodIssueCode.custom, path: ["credential"], message: "Source credential delivery must match exact authorization and lifetime." });
92
+ }
93
+ });
94
+ export {
95
+ sourceCandidateReceiptSchema,
96
+ sourceCredentialDeliverySchema,
97
+ sourceWorkspaceAuthorizationSchema,
98
+ sourceWorkspaceKeySchema,
99
+ sourceWorkspaceLeaseSchema,
100
+ sourceWorkspaceRequestSchema,
101
+ sourceWorkspaceResponseSchema
102
+ };
@@ -2567,6 +2567,12 @@ export declare const CONTROL_PLANE_OPERATIONS: {
2567
2567
  readonly assignmentExplanation: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
2568
2568
  assignmentId: string;
2569
2569
  }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
2570
+ readonly sourceWorkspace: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
2571
+ assignmentId: string;
2572
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
2573
+ readonly sourceCandidate: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
2574
+ assignmentId: string;
2575
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
2570
2576
  readonly renewAssignment: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
2571
2577
  assignmentId: string;
2572
2578
  }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
@@ -481,6 +481,8 @@ const CONTROL_PLANE_OPERATIONS = {
481
481
  nextAssignment: noPathProvider("providers.assignments.next", "POST", "/v1/provider/assignments/next"),
482
482
  assignment: providerPath("providers.assignments.show", "GET", "/v1/provider/assignments/{assignmentId}", { assignmentId: z.string().min(1) }, { read: true }),
483
483
  assignmentExplanation: providerPath("providers.assignments.explain", "GET", "/v1/provider/assignments/{assignmentId}/explanation", { assignmentId: z.string().min(1) }, { read: true }),
484
+ sourceWorkspace: providerPath("providers.assignments.source.authorize", "POST", "/v1/provider/assignments/{assignmentId}/source-workspace", { assignmentId: z.string().min(1) }, { redactedPaths: ["body.leaseToken", "output.credential.ciphertext"] }),
485
+ sourceCandidate: providerPath("providers.assignments.source.candidate", "POST", "/v1/provider/assignments/{assignmentId}/source-candidates", { assignmentId: z.string().min(1) }, { redactedPaths: ["body.leaseToken"] }),
484
486
  renewAssignment: providerPath("providers.assignments.renew", "POST", "/v1/provider/assignments/{assignmentId}/renew", { assignmentId: z.string().min(1) }),
485
487
  startExecution: providerPath("providers.assignments.execution.start", "POST", "/v1/provider/assignments/{assignmentId}/execution-start", { assignmentId: z.string().min(1) }),
486
488
  startCloseout: providerPath("providers.assignments.closeout.start", "POST", "/v1/provider/assignments/{assignmentId}/closeout-start", { assignmentId: z.string().min(1) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/sdk",
3
- "version": "0.13.0-rc.111",
3
+ "version": "0.13.0-rc.113",
4
4
  "description": "Portable TreeSeed contracts, standards, and typed remote control-plane clients.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {