@treeseed/sdk 0.13.0-rc.67 → 0.13.0-rc.69

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-01T06:11:25.862Z"}
1
+ {"completedAt":"2026-09-01T20:36:00.982Z"}
@@ -0,0 +1,255 @@
1
+ import { z } from 'zod';
2
+ export declare const providerRegistrationCodeStatusSchema: z.ZodObject<{
3
+ schemaVersion: z.ZodLiteral<"treeseed.provider-registration-code-status/v1">;
4
+ teamId: z.ZodString;
5
+ generation: z.ZodNumber;
6
+ codePrefix: z.ZodString;
7
+ rotatedAt: z.ZodString;
8
+ }, "strict", z.ZodTypeAny, {
9
+ schemaVersion: "treeseed.provider-registration-code-status/v1";
10
+ teamId: string;
11
+ rotatedAt: string;
12
+ generation: number;
13
+ codePrefix: string;
14
+ }, {
15
+ schemaVersion: "treeseed.provider-registration-code-status/v1";
16
+ teamId: string;
17
+ rotatedAt: string;
18
+ generation: number;
19
+ codePrefix: string;
20
+ }>;
21
+ export declare const providerRegistrationCodeReceiptSchema: z.ZodObject<{
22
+ schemaVersion: z.ZodLiteral<"treeseed.provider-registration-code-receipt/v1">;
23
+ teamId: z.ZodString;
24
+ generation: z.ZodNumber;
25
+ codePrefix: z.ZodString;
26
+ registrationCode: z.ZodString;
27
+ rotatedAt: z.ZodString;
28
+ }, "strict", z.ZodTypeAny, {
29
+ schemaVersion: "treeseed.provider-registration-code-receipt/v1";
30
+ teamId: string;
31
+ rotatedAt: string;
32
+ generation: number;
33
+ codePrefix: string;
34
+ registrationCode: string;
35
+ }, {
36
+ schemaVersion: "treeseed.provider-registration-code-receipt/v1";
37
+ teamId: string;
38
+ rotatedAt: string;
39
+ generation: number;
40
+ codePrefix: string;
41
+ registrationCode: string;
42
+ }>;
43
+ export declare const providerEnvironmentVariableDescriptorSchema: z.ZodObject<{
44
+ name: z.ZodString;
45
+ available: z.ZodBoolean;
46
+ rotatedAt: z.ZodOptional<z.ZodString>;
47
+ }, "strict", z.ZodTypeAny, {
48
+ name: string;
49
+ available: boolean;
50
+ rotatedAt?: string | undefined;
51
+ }, {
52
+ name: string;
53
+ available: boolean;
54
+ rotatedAt?: string | undefined;
55
+ }>;
56
+ export declare const providerEnvironmentProfileDescriptorSchema: z.ZodEffects<z.ZodObject<{
57
+ schemaVersion: z.ZodLiteral<"treeseed.provider-environment-profile/v1">;
58
+ id: z.ZodString;
59
+ generation: z.ZodNumber;
60
+ variables: z.ZodArray<z.ZodObject<{
61
+ name: z.ZodString;
62
+ available: z.ZodBoolean;
63
+ rotatedAt: z.ZodOptional<z.ZodString>;
64
+ }, "strict", z.ZodTypeAny, {
65
+ name: string;
66
+ available: boolean;
67
+ rotatedAt?: string | undefined;
68
+ }, {
69
+ name: string;
70
+ available: boolean;
71
+ rotatedAt?: string | undefined;
72
+ }>, "many">;
73
+ updatedAt: z.ZodString;
74
+ }, "strict", z.ZodTypeAny, {
75
+ schemaVersion: "treeseed.provider-environment-profile/v1";
76
+ id: string;
77
+ variables: {
78
+ name: string;
79
+ available: boolean;
80
+ rotatedAt?: string | undefined;
81
+ }[];
82
+ generation: number;
83
+ updatedAt: string;
84
+ }, {
85
+ schemaVersion: "treeseed.provider-environment-profile/v1";
86
+ id: string;
87
+ variables: {
88
+ name: string;
89
+ available: boolean;
90
+ rotatedAt?: string | undefined;
91
+ }[];
92
+ generation: number;
93
+ updatedAt: string;
94
+ }>, {
95
+ schemaVersion: "treeseed.provider-environment-profile/v1";
96
+ id: string;
97
+ variables: {
98
+ name: string;
99
+ available: boolean;
100
+ rotatedAt?: string | undefined;
101
+ }[];
102
+ generation: number;
103
+ updatedAt: string;
104
+ }, {
105
+ schemaVersion: "treeseed.provider-environment-profile/v1";
106
+ id: string;
107
+ variables: {
108
+ name: string;
109
+ available: boolean;
110
+ rotatedAt?: string | undefined;
111
+ }[];
112
+ generation: number;
113
+ updatedAt: string;
114
+ }>;
115
+ export declare const assignmentEnvironmentGrantSchema: z.ZodEffects<z.ZodObject<{
116
+ schemaVersion: z.ZodLiteral<"treeseed.assignment-environment-grant/v1">;
117
+ grantId: z.ZodString;
118
+ assignmentId: z.ZodString;
119
+ providerId: z.ZodString;
120
+ teamId: z.ZodString;
121
+ projectId: z.ZodString;
122
+ profileId: z.ZodString;
123
+ variables: z.ZodArray<z.ZodString, "many">;
124
+ network: z.ZodObject<{
125
+ allowed: z.ZodBoolean;
126
+ destinations: z.ZodArray<z.ZodString, "many">;
127
+ }, "strict", z.ZodTypeAny, {
128
+ allowed: boolean;
129
+ destinations: string[];
130
+ }, {
131
+ allowed: boolean;
132
+ destinations: string[];
133
+ }>;
134
+ policy: z.ZodObject<{
135
+ handlerDeclarationDigest: z.ZodString;
136
+ providerOfferDigest: z.ZodString;
137
+ providerPermissionDigest: z.ZodString;
138
+ teamApprovalDigest: z.ZodString;
139
+ assignmentGrantDigest: z.ZodString;
140
+ sandboxPolicyDigest: z.ZodString;
141
+ }, "strict", z.ZodTypeAny, {
142
+ handlerDeclarationDigest: string;
143
+ providerOfferDigest: string;
144
+ providerPermissionDigest: string;
145
+ teamApprovalDigest: string;
146
+ assignmentGrantDigest: string;
147
+ sandboxPolicyDigest: string;
148
+ }, {
149
+ handlerDeclarationDigest: string;
150
+ providerOfferDigest: string;
151
+ providerPermissionDigest: string;
152
+ teamApprovalDigest: string;
153
+ assignmentGrantDigest: string;
154
+ sandboxPolicyDigest: string;
155
+ }>;
156
+ issuedAt: z.ZodString;
157
+ expiresAt: z.ZodString;
158
+ }, "strict", z.ZodTypeAny, {
159
+ schemaVersion: "treeseed.assignment-environment-grant/v1";
160
+ projectId: string;
161
+ teamId: string;
162
+ providerId: string;
163
+ issuedAt: string;
164
+ expiresAt: string;
165
+ variables: string[];
166
+ assignmentId: string;
167
+ profileId: string;
168
+ network: {
169
+ allowed: boolean;
170
+ destinations: string[];
171
+ };
172
+ policy: {
173
+ handlerDeclarationDigest: string;
174
+ providerOfferDigest: string;
175
+ providerPermissionDigest: string;
176
+ teamApprovalDigest: string;
177
+ assignmentGrantDigest: string;
178
+ sandboxPolicyDigest: string;
179
+ };
180
+ grantId: string;
181
+ }, {
182
+ schemaVersion: "treeseed.assignment-environment-grant/v1";
183
+ projectId: string;
184
+ teamId: string;
185
+ providerId: string;
186
+ issuedAt: string;
187
+ expiresAt: string;
188
+ variables: string[];
189
+ assignmentId: string;
190
+ profileId: string;
191
+ network: {
192
+ allowed: boolean;
193
+ destinations: string[];
194
+ };
195
+ policy: {
196
+ handlerDeclarationDigest: string;
197
+ providerOfferDigest: string;
198
+ providerPermissionDigest: string;
199
+ teamApprovalDigest: string;
200
+ assignmentGrantDigest: string;
201
+ sandboxPolicyDigest: string;
202
+ };
203
+ grantId: string;
204
+ }>, {
205
+ schemaVersion: "treeseed.assignment-environment-grant/v1";
206
+ projectId: string;
207
+ teamId: string;
208
+ providerId: string;
209
+ issuedAt: string;
210
+ expiresAt: string;
211
+ variables: string[];
212
+ assignmentId: string;
213
+ profileId: string;
214
+ network: {
215
+ allowed: boolean;
216
+ destinations: string[];
217
+ };
218
+ policy: {
219
+ handlerDeclarationDigest: string;
220
+ providerOfferDigest: string;
221
+ providerPermissionDigest: string;
222
+ teamApprovalDigest: string;
223
+ assignmentGrantDigest: string;
224
+ sandboxPolicyDigest: string;
225
+ };
226
+ grantId: string;
227
+ }, {
228
+ schemaVersion: "treeseed.assignment-environment-grant/v1";
229
+ projectId: string;
230
+ teamId: string;
231
+ providerId: string;
232
+ issuedAt: string;
233
+ expiresAt: string;
234
+ variables: string[];
235
+ assignmentId: string;
236
+ profileId: string;
237
+ network: {
238
+ allowed: boolean;
239
+ destinations: string[];
240
+ };
241
+ policy: {
242
+ handlerDeclarationDigest: string;
243
+ providerOfferDigest: string;
244
+ providerPermissionDigest: string;
245
+ teamApprovalDigest: string;
246
+ assignmentGrantDigest: string;
247
+ sandboxPolicyDigest: string;
248
+ };
249
+ grantId: string;
250
+ }>;
251
+ export type ProviderRegistrationCodeStatus = z.infer<typeof providerRegistrationCodeStatusSchema>;
252
+ export type ProviderRegistrationCodeReceipt = z.infer<typeof providerRegistrationCodeReceiptSchema>;
253
+ export type ProviderEnvironmentVariableDescriptor = z.infer<typeof providerEnvironmentVariableDescriptorSchema>;
254
+ export type ProviderEnvironmentProfileDescriptor = z.infer<typeof providerEnvironmentProfileDescriptorSchema>;
255
+ export type AssignmentEnvironmentGrant = z.infer<typeof assignmentEnvironmentGrantSchema>;
@@ -0,0 +1,71 @@
1
+ import { z } from "zod";
2
+ const identifier = z.string().regex(/^[a-z][a-z0-9._-]{0,127}$/u);
3
+ const digest = z.string().regex(/^sha256:[a-f0-9]{64}$/u);
4
+ const variableName = z.string().regex(/^[A-Z_][A-Z0-9_]*$/u);
5
+ const maximumGrantLifetimeMs = 24 * 60 * 60 * 1e3;
6
+ const providerRegistrationCodeStatusSchema = z.object({
7
+ schemaVersion: z.literal("treeseed.provider-registration-code-status/v1"),
8
+ teamId: z.string().min(1),
9
+ generation: z.number().int().positive(),
10
+ codePrefix: z.string().min(1),
11
+ rotatedAt: z.string().datetime()
12
+ }).strict();
13
+ const providerRegistrationCodeReceiptSchema = z.object({
14
+ schemaVersion: z.literal("treeseed.provider-registration-code-receipt/v1"),
15
+ teamId: z.string().min(1),
16
+ generation: z.number().int().positive(),
17
+ codePrefix: z.string().min(1),
18
+ registrationCode: z.string().min(16),
19
+ rotatedAt: z.string().datetime()
20
+ }).strict();
21
+ const providerEnvironmentVariableDescriptorSchema = z.object({
22
+ name: variableName,
23
+ available: z.boolean(),
24
+ rotatedAt: z.string().datetime().optional()
25
+ }).strict();
26
+ const providerEnvironmentProfileDescriptorSchema = z.object({
27
+ schemaVersion: z.literal("treeseed.provider-environment-profile/v1"),
28
+ id: identifier,
29
+ generation: z.number().int().positive(),
30
+ variables: z.array(providerEnvironmentVariableDescriptorSchema),
31
+ updatedAt: z.string().datetime()
32
+ }).strict().superRefine((profile, context) => {
33
+ const names = /* @__PURE__ */ new Set();
34
+ for (const [index, variable] of profile.variables.entries()) {
35
+ if (names.has(variable.name)) context.addIssue({ code: z.ZodIssueCode.custom, path: ["variables", index, "name"], message: "Environment variable names must be unique within a profile." });
36
+ names.add(variable.name);
37
+ }
38
+ });
39
+ const assignmentEnvironmentGrantSchema = z.object({
40
+ schemaVersion: z.literal("treeseed.assignment-environment-grant/v1"),
41
+ grantId: identifier,
42
+ assignmentId: z.string().min(1),
43
+ providerId: z.string().min(1),
44
+ teamId: z.string().min(1),
45
+ projectId: z.string().min(1),
46
+ profileId: identifier,
47
+ variables: z.array(variableName).min(1),
48
+ network: z.object({ allowed: z.boolean(), destinations: z.array(z.string().min(1)) }).strict(),
49
+ policy: z.object({
50
+ handlerDeclarationDigest: digest,
51
+ providerOfferDigest: digest,
52
+ providerPermissionDigest: digest,
53
+ teamApprovalDigest: digest,
54
+ assignmentGrantDigest: digest,
55
+ sandboxPolicyDigest: digest
56
+ }).strict(),
57
+ issuedAt: z.string().datetime(),
58
+ expiresAt: z.string().datetime()
59
+ }).strict().superRefine((grant, context) => {
60
+ if (new Set(grant.variables).size !== grant.variables.length) context.addIssue({ code: z.ZodIssueCode.custom, path: ["variables"], message: "Granted environment variables must be unique." });
61
+ if (Date.parse(grant.expiresAt) <= Date.parse(grant.issuedAt)) context.addIssue({ code: z.ZodIssueCode.custom, path: ["expiresAt"], message: "Environment grants must expire after issuance." });
62
+ if (Date.parse(grant.expiresAt) - Date.parse(grant.issuedAt) > maximumGrantLifetimeMs) context.addIssue({ code: z.ZodIssueCode.custom, path: ["expiresAt"], message: "Environment grants cannot exceed 24 hours." });
63
+ if (!grant.network.allowed && grant.network.destinations.length) context.addIssue({ code: z.ZodIssueCode.custom, path: ["network", "destinations"], message: "Denied network authority cannot declare destinations." });
64
+ });
65
+ export {
66
+ assignmentEnvironmentGrantSchema,
67
+ providerEnvironmentProfileDescriptorSchema,
68
+ providerEnvironmentVariableDescriptorSchema,
69
+ providerRegistrationCodeReceiptSchema,
70
+ providerRegistrationCodeStatusSchema
71
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './capacity-facts.js';
2
+ export * from './environment-profiles.js';
2
3
  export * from './governance.js';
@@ -1,2 +1,3 @@
1
1
  export * from "./capacity-facts.js";
2
+ export * from "./environment-profiles.js";
2
3
  export * from "./governance.js";