@treeseed/sdk 0.13.0-rc.25 → 0.13.0-rc.26
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.
- package/dist/agent-capacity/validation/agent-definition-schema.d.ts +362 -362
- package/dist/capacity-provider/client.d.ts +1 -1
- package/dist/content/validation/agent-operational-content-schemas.d.ts +50 -50
- package/dist/content/validation/auxiliary-content-schemas.d.ts +46 -46
- package/dist/content/validation/content-model-schemas.d.ts +875 -875
- package/dist/content/validation/portable-content-data.d.ts +99 -99
- package/dist/deployment/canonical.d.ts +2 -0
- package/dist/deployment/canonical.js +17 -0
- package/dist/deployment/catalog.d.ts +16 -0
- package/dist/deployment/catalog.js +38 -0
- package/dist/deployment/index.d.ts +3 -0
- package/dist/deployment/index.js +3 -0
- package/dist/deployment/schemas.d.ts +2743 -0
- package/dist/deployment/schemas.js +179 -0
- package/dist/operator-contracts/canonical-command-tree.js +35 -0
- package/dist/operator-contracts/catalog/communication-operations.d.ts +11 -11
- package/dist/operator-contracts/communication/contracts.d.ts +24 -24
- package/dist/operator-contracts/control-plane-operations.d.ts +11 -11
- package/package.json +5 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { componentReleaseSchema, hostConfigurationSchema, releaseCatalogSchema } from "./schemas.js";
|
|
2
|
+
function resolveMixedTrackCatalog(input) {
|
|
3
|
+
const host = hostConfigurationSchema.parse(input.host);
|
|
4
|
+
const stable = releaseCatalogSchema.parse(input.stable);
|
|
5
|
+
const development = input.development ? releaseCatalogSchema.parse(input.development) : void 0;
|
|
6
|
+
if (stable.track !== "stable" || stable.stableBase !== null) throw new Error("The base catalog must be stable and self-contained.");
|
|
7
|
+
if (development && (development.track !== "development" || development.stableBase?.catalogDigest !== stable.catalogDigest)) throw new Error("Development catalog is not bound to the selected stable catalog.");
|
|
8
|
+
const stableComponents = new Map(stable.components.map((component) => [component.componentId, component]));
|
|
9
|
+
const developmentComponents = new Map(development?.components.map((component) => [component.componentId, component]) ?? []);
|
|
10
|
+
const components = [];
|
|
11
|
+
const warnings = [];
|
|
12
|
+
for (const [componentId, selection] of Object.entries(host.components).sort(([left], [right]) => left.localeCompare(right))) {
|
|
13
|
+
if (!selection.enabled) continue;
|
|
14
|
+
const selected = selection.track === "development" ? developmentComponents.get(componentId) : stableComponents.get(componentId);
|
|
15
|
+
if (!selected) throw new Error(`No ${selection.track} release is available for enabled component ${componentId}.`);
|
|
16
|
+
componentReleaseSchema.parse(selected);
|
|
17
|
+
if (selected.track === "development" && selected.stableBase?.compatibilityId !== stable.compatibilityId) throw new Error(`Development component ${componentId} is incompatible with stable base ${stable.compatibilityId}.`);
|
|
18
|
+
components.push(selected);
|
|
19
|
+
if (selection.track === "development") warnings.push(`${componentId} follows the continuous development track.`);
|
|
20
|
+
}
|
|
21
|
+
return { components, warnings };
|
|
22
|
+
}
|
|
23
|
+
function collectHostAliases(components, overrides = {}) {
|
|
24
|
+
const aliases = /* @__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") continue;
|
|
27
|
+
const key = `${component.componentId}.${service.id}.${endpoint.id}`;
|
|
28
|
+
const alias = overrides[key] ?? endpoint.defaultAlias;
|
|
29
|
+
if (!alias?.endsWith(".localhost")) throw new Error(`Host endpoint ${key} requires a .localhost alias.`);
|
|
30
|
+
if (aliases.has(alias)) throw new Error(`Duplicate host alias ${alias}.`);
|
|
31
|
+
aliases.set(alias, { componentId: component.componentId, serviceId: service.id, endpointId: endpoint.id, port: endpoint.port });
|
|
32
|
+
}
|
|
33
|
+
return aliases;
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
collectHostAliases,
|
|
37
|
+
resolveMixedTrackCatalog
|
|
38
|
+
};
|