@treeseed/sdk 0.13.0-rc.111 → 0.13.0-rc.112
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-
|
|
1
|
+
{"completedAt":"2026-09-10T22:11:14.723Z"}
|
|
@@ -0,0 +1,344 @@
|
|
|
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>;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
export {
|
|
61
|
+
sourceCandidateReceiptSchema,
|
|
62
|
+
sourceWorkspaceAuthorizationSchema,
|
|
63
|
+
sourceWorkspaceKeySchema,
|
|
64
|
+
sourceWorkspaceLeaseSchema
|
|
65
|
+
};
|