@treeseed/sdk 0.13.0-rc.26 → 0.13.0-rc.28

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.
@@ -21,6 +21,16 @@ function resolveMixedTrackCatalog(input) {
21
21
  return { components, warnings };
22
22
  }
23
23
  function collectHostAliases(components, overrides = {}) {
24
+ const endpoints = /* @__PURE__ */ new Map();
25
+ for (const component of components) for (const service of component.runtime.services) for (const endpoint of service.endpoints) {
26
+ if (endpoint.visibility === "host") endpoints.set(`${component.componentId}.${service.id}.${endpoint.id}`, endpoint);
27
+ }
28
+ for (const [key, alias] of Object.entries(overrides)) {
29
+ const endpoint = endpoints.get(key);
30
+ if (!endpoint) throw new Error(`Alias override ${key} does not identify an accepted host endpoint.`);
31
+ if (!endpoint.aliasOverride) throw new Error(`Host endpoint ${key} does not permit alias overrides.`);
32
+ if (!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*\.localhost$/u.test(alias)) throw new Error(`Alias override ${key} must use the .localhost namespace.`);
33
+ }
24
34
  const aliases = /* @__PURE__ */ new Map();
25
35
  for (const component of components) for (const service of component.runtime.services) for (const endpoint of service.endpoints) {
26
36
  if (endpoint.visibility !== "host") continue;
@@ -671,15 +671,15 @@ export declare const componentReleaseSchema: z.ZodEffects<z.ZodObject<{
671
671
  stableBase: z.ZodNullable<z.ZodObject<{
672
672
  releaseRange: z.ZodString;
673
673
  compatibilityId: z.ZodString;
674
- catalogDigest: z.ZodString;
674
+ catalogDigest: z.ZodNullable<z.ZodString>;
675
675
  }, "strict", z.ZodTypeAny, {
676
676
  releaseRange: string;
677
677
  compatibilityId: string;
678
- catalogDigest: string;
678
+ catalogDigest: string | null;
679
679
  }, {
680
680
  releaseRange: string;
681
681
  compatibilityId: string;
682
- catalogDigest: string;
682
+ catalogDigest: string | null;
683
683
  }>>;
684
684
  packages: z.ZodArray<z.ZodObject<{
685
685
  name: z.ZodString;
@@ -1107,7 +1107,7 @@ export declare const componentReleaseSchema: z.ZodEffects<z.ZodObject<{
1107
1107
  stableBase: {
1108
1108
  releaseRange: string;
1109
1109
  compatibilityId: string;
1110
- catalogDigest: string;
1110
+ catalogDigest: string | null;
1111
1111
  } | null;
1112
1112
  packages: {
1113
1113
  architecture: "amd64" | "all";
@@ -1184,7 +1184,7 @@ export declare const componentReleaseSchema: z.ZodEffects<z.ZodObject<{
1184
1184
  stableBase: {
1185
1185
  releaseRange: string;
1186
1186
  compatibilityId: string;
1187
- catalogDigest: string;
1187
+ catalogDigest: string | null;
1188
1188
  } | null;
1189
1189
  packages: {
1190
1190
  architecture: "amd64" | "all";
@@ -1261,7 +1261,7 @@ export declare const componentReleaseSchema: z.ZodEffects<z.ZodObject<{
1261
1261
  stableBase: {
1262
1262
  releaseRange: string;
1263
1263
  compatibilityId: string;
1264
- catalogDigest: string;
1264
+ catalogDigest: string | null;
1265
1265
  } | null;
1266
1266
  packages: {
1267
1267
  architecture: "amd64" | "all";
@@ -1338,7 +1338,7 @@ export declare const componentReleaseSchema: z.ZodEffects<z.ZodObject<{
1338
1338
  stableBase: {
1339
1339
  releaseRange: string;
1340
1340
  compatibilityId: string;
1341
- catalogDigest: string;
1341
+ catalogDigest: string | null;
1342
1342
  } | null;
1343
1343
  packages: {
1344
1344
  architecture: "amd64" | "all";
@@ -1365,7 +1365,7 @@ export declare const componentReleaseSchema: z.ZodEffects<z.ZodObject<{
1365
1365
  vulnerabilities: string[];
1366
1366
  };
1367
1367
  }>;
1368
- export declare const releaseCatalogSchema: z.ZodObject<{
1368
+ export declare const releaseCatalogSchema: z.ZodEffects<z.ZodObject<{
1369
1369
  schemaVersion: z.ZodLiteral<"treeseed.release-catalog/v1">;
1370
1370
  release: z.ZodString;
1371
1371
  generation: z.ZodNumber;
@@ -1400,15 +1400,15 @@ export declare const releaseCatalogSchema: z.ZodObject<{
1400
1400
  stableBase: z.ZodNullable<z.ZodObject<{
1401
1401
  releaseRange: z.ZodString;
1402
1402
  compatibilityId: z.ZodString;
1403
- catalogDigest: z.ZodString;
1403
+ catalogDigest: z.ZodNullable<z.ZodString>;
1404
1404
  }, "strict", z.ZodTypeAny, {
1405
1405
  releaseRange: string;
1406
1406
  compatibilityId: string;
1407
- catalogDigest: string;
1407
+ catalogDigest: string | null;
1408
1408
  }, {
1409
1409
  releaseRange: string;
1410
1410
  compatibilityId: string;
1411
- catalogDigest: string;
1411
+ catalogDigest: string | null;
1412
1412
  }>>;
1413
1413
  packages: z.ZodArray<z.ZodObject<{
1414
1414
  name: z.ZodString;
@@ -1836,7 +1836,7 @@ export declare const releaseCatalogSchema: z.ZodObject<{
1836
1836
  stableBase: {
1837
1837
  releaseRange: string;
1838
1838
  compatibilityId: string;
1839
- catalogDigest: string;
1839
+ catalogDigest: string | null;
1840
1840
  } | null;
1841
1841
  packages: {
1842
1842
  architecture: "amd64" | "all";
@@ -1913,7 +1913,7 @@ export declare const releaseCatalogSchema: z.ZodObject<{
1913
1913
  stableBase: {
1914
1914
  releaseRange: string;
1915
1915
  compatibilityId: string;
1916
- catalogDigest: string;
1916
+ catalogDigest: string | null;
1917
1917
  } | null;
1918
1918
  packages: {
1919
1919
  architecture: "amd64" | "all";
@@ -1990,7 +1990,7 @@ export declare const releaseCatalogSchema: z.ZodObject<{
1990
1990
  stableBase: {
1991
1991
  releaseRange: string;
1992
1992
  compatibilityId: string;
1993
- catalogDigest: string;
1993
+ catalogDigest: string | null;
1994
1994
  } | null;
1995
1995
  packages: {
1996
1996
  architecture: "amd64" | "all";
@@ -2067,7 +2067,7 @@ export declare const releaseCatalogSchema: z.ZodObject<{
2067
2067
  stableBase: {
2068
2068
  releaseRange: string;
2069
2069
  compatibilityId: string;
2070
- catalogDigest: string;
2070
+ catalogDigest: string | null;
2071
2071
  } | null;
2072
2072
  packages: {
2073
2073
  architecture: "amd64" | "all";
@@ -2150,7 +2150,187 @@ export declare const releaseCatalogSchema: z.ZodObject<{
2150
2150
  stableBase: {
2151
2151
  releaseRange: string;
2152
2152
  compatibilityId: string;
2153
- catalogDigest: string;
2153
+ catalogDigest: string | null;
2154
+ } | null;
2155
+ packages: {
2156
+ architecture: "amd64" | "all";
2157
+ version: string;
2158
+ order: number;
2159
+ name: string;
2160
+ origin: "TreeSeed Deployment";
2161
+ }[];
2162
+ images: {
2163
+ role: string;
2164
+ repository: string;
2165
+ digest: string;
2166
+ platforms: ("linux/amd64" | "linux/arm64")[];
2167
+ consumers: string[];
2168
+ }[];
2169
+ runtimeDigest: string;
2170
+ rollback: {
2171
+ compatible: boolean;
2172
+ requiresBackup: boolean;
2173
+ };
2174
+ evidence: {
2175
+ provenance: string[];
2176
+ sboms: string[];
2177
+ vulnerabilities: string[];
2178
+ };
2179
+ }[];
2180
+ release: string;
2181
+ compatibilityId: string;
2182
+ catalogDigest: string;
2183
+ stableBase: {
2184
+ release: string;
2185
+ catalogDigest: string;
2186
+ } | null;
2187
+ createdAt: string;
2188
+ }, {
2189
+ track: "stable" | "development";
2190
+ schemaVersion: "treeseed.release-catalog/v1";
2191
+ generation: number;
2192
+ components: {
2193
+ track: "stable" | "development";
2194
+ schemaVersion: "treeseed.component-release/v1";
2195
+ runtime: {
2196
+ schemaVersion: "treeseed.package-runtime/v1";
2197
+ componentId: string;
2198
+ version: string;
2199
+ compose: {
2200
+ projectName: string;
2201
+ files: string[];
2202
+ };
2203
+ services: {
2204
+ id: string;
2205
+ composeService: string;
2206
+ endpoints: {
2207
+ id: string;
2208
+ protocol: "http" | "https" | "tcp";
2209
+ port: number;
2210
+ visibility: "host" | "private";
2211
+ tls: "passthrough" | "edge" | "none";
2212
+ authentication: "none" | "application" | "mtls";
2213
+ defaultAlias?: string | undefined;
2214
+ aliasOverride?: boolean | undefined;
2215
+ healthGate?: {
2216
+ protocol: "http" | "https" | "tcp";
2217
+ timeoutSeconds: number;
2218
+ path?: string | undefined;
2219
+ } | undefined;
2220
+ }[];
2221
+ }[];
2222
+ stateVolumes: {
2223
+ id: string;
2224
+ volume: string;
2225
+ backup: "required" | "none" | "optional";
2226
+ }[];
2227
+ migrations: {
2228
+ id: string;
2229
+ order: number;
2230
+ backupRequired: boolean;
2231
+ }[];
2232
+ requiredCapabilities: string[];
2233
+ };
2234
+ componentId: string;
2235
+ release: string;
2236
+ source: {
2237
+ repository: string;
2238
+ commit: string;
2239
+ };
2240
+ stableBase: {
2241
+ releaseRange: string;
2242
+ compatibilityId: string;
2243
+ catalogDigest: string | null;
2244
+ } | null;
2245
+ packages: {
2246
+ architecture: "amd64" | "all";
2247
+ version: string;
2248
+ order: number;
2249
+ name: string;
2250
+ origin: "TreeSeed Deployment";
2251
+ }[];
2252
+ images: {
2253
+ role: string;
2254
+ repository: string;
2255
+ digest: string;
2256
+ platforms: ("linux/amd64" | "linux/arm64")[];
2257
+ consumers: string[];
2258
+ }[];
2259
+ runtimeDigest: string;
2260
+ rollback: {
2261
+ compatible: boolean;
2262
+ requiresBackup: boolean;
2263
+ };
2264
+ evidence: {
2265
+ provenance: string[];
2266
+ sboms: string[];
2267
+ vulnerabilities: string[];
2268
+ };
2269
+ }[];
2270
+ release: string;
2271
+ compatibilityId: string;
2272
+ catalogDigest: string;
2273
+ stableBase: {
2274
+ release: string;
2275
+ catalogDigest: string;
2276
+ } | null;
2277
+ createdAt: string;
2278
+ }>, {
2279
+ track: "stable" | "development";
2280
+ schemaVersion: "treeseed.release-catalog/v1";
2281
+ generation: number;
2282
+ components: {
2283
+ track: "stable" | "development";
2284
+ schemaVersion: "treeseed.component-release/v1";
2285
+ runtime: {
2286
+ schemaVersion: "treeseed.package-runtime/v1";
2287
+ componentId: string;
2288
+ version: string;
2289
+ compose: {
2290
+ projectName: string;
2291
+ files: string[];
2292
+ };
2293
+ services: {
2294
+ id: string;
2295
+ composeService: string;
2296
+ endpoints: {
2297
+ id: string;
2298
+ protocol: "http" | "https" | "tcp";
2299
+ port: number;
2300
+ visibility: "host" | "private";
2301
+ aliasOverride: boolean;
2302
+ tls: "passthrough" | "edge" | "none";
2303
+ authentication: "none" | "application" | "mtls";
2304
+ defaultAlias?: string | undefined;
2305
+ healthGate?: {
2306
+ protocol: "http" | "https" | "tcp";
2307
+ timeoutSeconds: number;
2308
+ path?: string | undefined;
2309
+ } | undefined;
2310
+ }[];
2311
+ }[];
2312
+ stateVolumes: {
2313
+ id: string;
2314
+ volume: string;
2315
+ backup: "required" | "none" | "optional";
2316
+ }[];
2317
+ migrations: {
2318
+ id: string;
2319
+ order: number;
2320
+ backupRequired: boolean;
2321
+ }[];
2322
+ requiredCapabilities: string[];
2323
+ };
2324
+ componentId: string;
2325
+ release: string;
2326
+ source: {
2327
+ repository: string;
2328
+ commit: string;
2329
+ };
2330
+ stableBase: {
2331
+ releaseRange: string;
2332
+ compatibilityId: string;
2333
+ catalogDigest: string | null;
2154
2334
  } | null;
2155
2335
  packages: {
2156
2336
  architecture: "amd64" | "all";
@@ -2240,7 +2420,7 @@ export declare const releaseCatalogSchema: z.ZodObject<{
2240
2420
  stableBase: {
2241
2421
  releaseRange: string;
2242
2422
  compatibilityId: string;
2243
- catalogDigest: string;
2423
+ catalogDigest: string | null;
2244
2424
  } | null;
2245
2425
  packages: {
2246
2426
  architecture: "amd64" | "all";
@@ -83,7 +83,7 @@ const componentReleaseSchema = z.object({
83
83
  release: packageVersion,
84
84
  track: deploymentTrackSchema,
85
85
  source: z.object({ repository: z.string().regex(/^treeseed-ai\/[a-z0-9-]+$/u), commit: gitCommit }).strict(),
86
- stableBase: z.object({ releaseRange: z.string().min(1), compatibilityId: identifier, catalogDigest: digest }).strict().nullable(),
86
+ stableBase: z.object({ releaseRange: z.string().min(1), compatibilityId: identifier, catalogDigest: digest.nullable() }).strict().nullable(),
87
87
  packages: z.array(catalogPackageSchema).min(1),
88
88
  images: z.array(catalogImageSchema),
89
89
  runtime: packageRuntimeSchema,
@@ -105,7 +105,13 @@ const releaseCatalogSchema = z.object({
105
105
  stableBase: z.object({ release: packageVersion, catalogDigest: digest }).strict().nullable(),
106
106
  components: z.array(componentReleaseSchema).min(1),
107
107
  createdAt: z.string().datetime()
108
- }).strict();
108
+ }).strict().superRefine((catalog, context) => {
109
+ if (catalog.track === "development" && !catalog.stableBase) context.addIssue({ code: z.ZodIssueCode.custom, path: ["stableBase"], message: "Development catalogs require an exact stable base." });
110
+ if (catalog.track === "stable" && catalog.stableBase) context.addIssue({ code: z.ZodIssueCode.custom, path: ["stableBase"], message: "Stable catalogs cannot bind another stable base." });
111
+ if (catalog.track === "development" && catalog.stableBase) for (const [index, component] of catalog.components.entries()) {
112
+ if (component.track !== "development" || component.stableBase?.catalogDigest !== catalog.stableBase.catalogDigest) context.addIssue({ code: z.ZodIssueCode.custom, path: ["components", index, "stableBase", "catalogDigest"], message: "Catalog ingestion must bind every development component to the exact selected stable base." });
113
+ }
114
+ });
109
115
  const hostPlanSchema = z.object({ schemaVersion: z.literal("treeseed.host-plan/v1"), planId: identifier, configurationDigest: digest, catalogDigest: digest, changes: z.array(z.object({ componentId: identifier, action: z.enum(["install", "upgrade", "reconfigure", "remove", "noop"]), from: packageVersion.nullable(), to: packageVersion.nullable() }).strict()), blockers: z.array(z.object({ code: identifier, message: z.string().min(1) }).strict()) }).strict();
110
116
  const hostBootstrapSchema = z.object({
111
117
  schemaVersion: z.literal("treeseed.host-bootstrap/v1"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/sdk",
3
- "version": "0.13.0-rc.26",
3
+ "version": "0.13.0-rc.28",
4
4
  "description": "Portable TreeSeed contracts, standards, and typed remote control-plane clients.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {