@xemahq/contracts 0.27.0 → 0.29.0

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.
Files changed (61) hide show
  1. package/dist/.source-stamp.json +2 -2
  2. package/dist/biome/index.d.ts +1 -0
  3. package/dist/biome/index.d.ts.map +1 -1
  4. package/dist/biome/index.js +1 -0
  5. package/dist/biome/index.js.map +1 -1
  6. package/dist/biome/lib/biome-component-process-facts.d.ts +11 -0
  7. package/dist/biome/lib/biome-component-process-facts.d.ts.map +1 -0
  8. package/dist/biome/lib/biome-component-process-facts.js +25 -0
  9. package/dist/biome/lib/biome-component-process-facts.js.map +1 -0
  10. package/dist/biome/lib/biome-component-vocabulary.d.ts +0 -6
  11. package/dist/biome/lib/biome-component-vocabulary.d.ts.map +1 -1
  12. package/dist/biome/lib/biome-component-vocabulary.js +1 -8
  13. package/dist/biome/lib/biome-component-vocabulary.js.map +1 -1
  14. package/dist/biome/lib/biome-component.d.ts +18 -5
  15. package/dist/biome/lib/biome-component.d.ts.map +1 -1
  16. package/dist/biome/lib/biome-component.js +11 -24
  17. package/dist/biome/lib/biome-component.js.map +1 -1
  18. package/dist/biome/lib/biome-manifest.d.ts +48 -6
  19. package/dist/biome/lib/biome-manifest.d.ts.map +1 -1
  20. package/dist/biome/xema-biome.schema.json +60 -14
  21. package/dist/distribution/index.d.ts +2 -0
  22. package/dist/distribution/index.d.ts.map +1 -1
  23. package/dist/distribution/index.js +2 -0
  24. package/dist/distribution/index.js.map +1 -1
  25. package/dist/distribution/lib/biome-closure.d.ts +136 -0
  26. package/dist/distribution/lib/biome-closure.d.ts.map +1 -0
  27. package/dist/distribution/lib/biome-closure.js +440 -0
  28. package/dist/distribution/lib/biome-closure.js.map +1 -0
  29. package/dist/distribution/lib/distribution-lock.d.ts +33 -2
  30. package/dist/distribution/lib/distribution-lock.d.ts.map +1 -1
  31. package/dist/distribution/lib/distribution-lock.js +85 -3
  32. package/dist/distribution/lib/distribution-lock.js.map +1 -1
  33. package/dist/distribution/lib/distribution-roots.d.ts +28 -0
  34. package/dist/distribution/lib/distribution-roots.d.ts.map +1 -0
  35. package/dist/distribution/lib/distribution-roots.js +45 -0
  36. package/dist/distribution/lib/distribution-roots.js.map +1 -0
  37. package/dist/distribution/lib/distribution.d.ts +4 -1
  38. package/dist/distribution/lib/distribution.d.ts.map +1 -1
  39. package/dist/distribution/lib/distribution.js +41 -1
  40. package/dist/distribution/lib/distribution.js.map +1 -1
  41. package/dist/distribution/lib/image-lock.d.ts +2 -1
  42. package/dist/distribution/lib/image-lock.d.ts.map +1 -1
  43. package/dist/distribution/lib/image-lock.js +1 -0
  44. package/dist/distribution/lib/image-lock.js.map +1 -1
  45. package/dist/process-topology/index.d.ts +1 -0
  46. package/dist/process-topology/index.d.ts.map +1 -1
  47. package/dist/process-topology/index.js +1 -0
  48. package/dist/process-topology/index.js.map +1 -1
  49. package/dist/process-topology/lib/composed-process-contract.d.ts +26 -0
  50. package/dist/process-topology/lib/composed-process-contract.d.ts.map +1 -0
  51. package/dist/process-topology/lib/composed-process-contract.js +46 -0
  52. package/dist/process-topology/lib/composed-process-contract.js.map +1 -0
  53. package/dist/process-topology/lib/process-topology.d.ts +23 -0
  54. package/dist/process-topology/lib/process-topology.d.ts.map +1 -1
  55. package/dist/process-topology/lib/process-topology.js +68 -1
  56. package/dist/process-topology/lib/process-topology.js.map +1 -1
  57. package/dist/process-topology/lib/resolve-process-topology.d.ts +29 -12
  58. package/dist/process-topology/lib/resolve-process-topology.d.ts.map +1 -1
  59. package/dist/process-topology/lib/resolve-process-topology.js +134 -86
  60. package/dist/process-topology/lib/resolve-process-topology.js.map +1 -1
  61. package/package.json +1 -1
@@ -0,0 +1,136 @@
1
+ import { z } from 'zod';
2
+ import type { BiomeTier } from '../../biome';
3
+ import { PeerRelationship, type BiomeDependencyContract } from '../../biome-dependency';
4
+ import type { ResourceInclusion, ResourceScope } from '../../resource-requirement';
5
+ import type { PlatformServiceTier } from './distribution';
6
+ export declare enum ClosureProvenanceKind {
7
+ ProductRoot = "product-root",
8
+ OwnerSelectedRoot = "owner-selected-root",
9
+ PlatformInvariant = "platform-invariant",
10
+ RuntimeInstallationRoot = "runtime-installation-root",
11
+ RequiredDependency = "required-dependency",
12
+ RequiredResourceProvider = "required-resource-provider"
13
+ }
14
+ export declare const ClosureProvenanceKindSchema: z.ZodEnum<typeof ClosureProvenanceKind>;
15
+ export declare const CLOSURE_PROVENANCE_RANK: Readonly<Record<ClosureProvenanceKind, number>>;
16
+ export declare enum ClosureEntityKind {
17
+ Biome = "biome",
18
+ PlatformService = "platform-service"
19
+ }
20
+ export declare const ClosureEntityKindSchema: z.ZodEnum<typeof ClosureEntityKind>;
21
+ export interface ClosureEntityRef {
22
+ readonly kind: ClosureEntityKind;
23
+ readonly id: string;
24
+ }
25
+ export declare const ClosureEntityRefSchema: z.ZodType<ClosureEntityRef>;
26
+ export type ClosureHop = {
27
+ readonly via: 'dependency';
28
+ readonly consumer: string;
29
+ readonly componentKey?: string;
30
+ readonly relationship: PeerRelationship;
31
+ readonly target: {
32
+ readonly serviceName: string;
33
+ } | {
34
+ readonly contributionKind: string;
35
+ };
36
+ } | {
37
+ readonly via: 'resource';
38
+ readonly consumer: string;
39
+ readonly consumerService: string;
40
+ readonly resource: {
41
+ readonly kind: string;
42
+ readonly logicalName: string;
43
+ };
44
+ };
45
+ export declare const ClosureHopSchema: z.ZodType<ClosureHop>;
46
+ export type ClosureProvenance = {
47
+ readonly kind: ClosureProvenanceKind.ProductRoot | ClosureProvenanceKind.OwnerSelectedRoot | ClosureProvenanceKind.RuntimeInstallationRoot;
48
+ } | {
49
+ readonly kind: ClosureProvenanceKind.PlatformInvariant;
50
+ readonly reason: string;
51
+ } | {
52
+ readonly kind: ClosureProvenanceKind.RequiredDependency | ClosureProvenanceKind.RequiredResourceProvider;
53
+ readonly root: ClosureEntityRef;
54
+ readonly chain: readonly ClosureHop[];
55
+ };
56
+ export declare const ClosureProvenanceSchema: z.ZodType<ClosureProvenance>;
57
+ export interface ClosureBiomeFacts {
58
+ readonly id: string;
59
+ readonly tier: BiomeTier;
60
+ readonly audience?: string;
61
+ readonly services: readonly string[];
62
+ readonly dependencyContract?: BiomeDependencyContract;
63
+ readonly serviceResources?: readonly {
64
+ readonly consumerService: string;
65
+ readonly kind: string;
66
+ readonly logicalName: string;
67
+ readonly scope: ResourceScope;
68
+ readonly inclusion: ResourceInclusion;
69
+ }[];
70
+ readonly providesResources?: readonly {
71
+ readonly service: string;
72
+ readonly kind: string;
73
+ }[];
74
+ }
75
+ export interface ClosurePlatformServiceFacts {
76
+ readonly name: string;
77
+ readonly tier: PlatformServiceTier;
78
+ }
79
+ export type ClosureRootProvenance = Extract<ClosureProvenance, {
80
+ readonly kind: ClosureProvenanceKind.ProductRoot | ClosureProvenanceKind.OwnerSelectedRoot | ClosureProvenanceKind.RuntimeInstallationRoot | ClosureProvenanceKind.PlatformInvariant;
81
+ }>;
82
+ export interface ClosureRoot {
83
+ readonly entity: ClosureEntityRef;
84
+ readonly provenance: ClosureRootProvenance;
85
+ }
86
+ export interface BiomeClosureFacts {
87
+ readonly biomes: readonly ClosureBiomeFacts[];
88
+ readonly platformServices: readonly ClosurePlatformServiceFacts[];
89
+ }
90
+ export interface BiomeClosureInput {
91
+ readonly roots: readonly ClosureRoot[];
92
+ readonly candidates: BiomeClosureFacts;
93
+ readonly present?: BiomeClosureFacts;
94
+ }
95
+ export interface ClosureEntry {
96
+ readonly entity: ClosureEntityRef;
97
+ readonly provenance: readonly ClosureProvenance[];
98
+ }
99
+ export interface ClosureResourceBinding {
100
+ readonly consumer: {
101
+ readonly biomeId: string;
102
+ readonly service: string;
103
+ };
104
+ readonly kind: string;
105
+ readonly logicalName: string;
106
+ readonly scope: ResourceScope;
107
+ readonly inclusion: ResourceInclusion;
108
+ readonly provider: {
109
+ readonly biomeId: string;
110
+ readonly serviceName: string;
111
+ };
112
+ }
113
+ export interface BiomeClosureResult {
114
+ readonly entries: readonly ClosureEntry[];
115
+ readonly resourceBindings: readonly ClosureResourceBinding[];
116
+ }
117
+ export declare enum BiomeClosureErrorCode {
118
+ UnknownRoot = "unknown-root",
119
+ ConflictingRootKind = "conflicting-root-kind",
120
+ MissingDependencyContract = "missing-dependency-contract",
121
+ UnresolvedPeer = "unresolved-peer",
122
+ AmbiguousPeer = "ambiguous-peer",
123
+ OperatorBiomeNotRoot = "operator-biome-not-root",
124
+ UnresolvedResourceProvider = "unresolved-resource-provider",
125
+ AmbiguousResourceProvider = "ambiguous-resource-provider"
126
+ }
127
+ export declare class BiomeClosureError extends Error {
128
+ readonly code: BiomeClosureErrorCode;
129
+ constructor(code: BiomeClosureErrorCode, message: string);
130
+ }
131
+ export declare const KERNEL_TIER_INVARIANT_REASON = "kernel-tier";
132
+ export declare function platformInvariantRoots(candidates: BiomeClosureFacts): readonly ClosureRoot[];
133
+ export declare function resolveBiomeClosure(input: BiomeClosureInput): BiomeClosureResult;
134
+ export declare function describeProvenance(provenance: ClosureProvenance): string;
135
+ export declare function describeHop(hop: ClosureHop): string;
136
+ //# sourceMappingURL=biome-closure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biome-closure.d.ts","sourceRoot":"","sources":["../../../src/distribution/lib/biome-closure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAEL,gBAAgB,EAChB,KAAK,uBAAuB,EAE7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAsC1D,oBAAY,qBAAqB;IAC/B,WAAW,iBAAiB;IAC5B,iBAAiB,wBAAwB;IACzC,iBAAiB,uBAAuB;IACxC,uBAAuB,8BAA8B;IACrD,kBAAkB,wBAA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C;IAC9B,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/E;AAED,MAAM,WAAW,kBAAkB;IAEjC,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAO1C,QAAQ,CAAC,gBAAgB,EAAE,SAAS,sBAAsB,EAAE,CAAC;CAC9D;AAED,oBAAY,qBAAqB;IAC/B,WAAW,iBAAiB;IAC5B,mBAAmB,0BAA0B;IAC7C,yBAAyB,gCAAgC;IACzD,cAAc,oBAAoB;IAClC,aAAa,mBAAmB;IAChC,oBAAoB,4BAA4B;IAChD,0BAA0B,iCAAiC;IAC3D,yBAAyB,gCAAgC;CAC1D;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;gBAEzB,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM;CAKzD;AAGD,eAAO,MAAM,4BAA4B,gBAAgB,CAAC;AAO1D,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,iBAAiB,GAC5B,SAAS,WAAW,EAAE,CAmBxB;AAgHD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,GACvB,kBAAkB,CAuUpB;AAGD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAcxE;AAGD,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CASnD"}
@@ -0,0 +1,440 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KERNEL_TIER_INVARIANT_REASON = exports.BiomeClosureError = exports.BiomeClosureErrorCode = exports.ClosureProvenanceSchema = exports.ClosureHopSchema = exports.ClosureEntityRefSchema = exports.ClosureEntityKindSchema = exports.ClosureEntityKind = exports.CLOSURE_PROVENANCE_RANK = exports.ClosureProvenanceKindSchema = exports.ClosureProvenanceKind = void 0;
4
+ exports.platformInvariantRoots = platformInvariantRoots;
5
+ exports.resolveBiomeClosure = resolveBiomeClosure;
6
+ exports.describeProvenance = describeProvenance;
7
+ exports.describeHop = describeHop;
8
+ const zod_1 = require("zod");
9
+ const biome_dependency_1 = require("../../biome-dependency");
10
+ var ClosureProvenanceKind;
11
+ (function (ClosureProvenanceKind) {
12
+ ClosureProvenanceKind["ProductRoot"] = "product-root";
13
+ ClosureProvenanceKind["OwnerSelectedRoot"] = "owner-selected-root";
14
+ ClosureProvenanceKind["PlatformInvariant"] = "platform-invariant";
15
+ ClosureProvenanceKind["RuntimeInstallationRoot"] = "runtime-installation-root";
16
+ ClosureProvenanceKind["RequiredDependency"] = "required-dependency";
17
+ ClosureProvenanceKind["RequiredResourceProvider"] = "required-resource-provider";
18
+ })(ClosureProvenanceKind || (exports.ClosureProvenanceKind = ClosureProvenanceKind = {}));
19
+ exports.ClosureProvenanceKindSchema = zod_1.z.nativeEnum(ClosureProvenanceKind);
20
+ exports.CLOSURE_PROVENANCE_RANK = {
21
+ [ClosureProvenanceKind.PlatformInvariant]: 0,
22
+ [ClosureProvenanceKind.ProductRoot]: 1,
23
+ [ClosureProvenanceKind.OwnerSelectedRoot]: 2,
24
+ [ClosureProvenanceKind.RuntimeInstallationRoot]: 3,
25
+ [ClosureProvenanceKind.RequiredDependency]: 4,
26
+ [ClosureProvenanceKind.RequiredResourceProvider]: 5,
27
+ };
28
+ var ClosureEntityKind;
29
+ (function (ClosureEntityKind) {
30
+ ClosureEntityKind["Biome"] = "biome";
31
+ ClosureEntityKind["PlatformService"] = "platform-service";
32
+ })(ClosureEntityKind || (exports.ClosureEntityKind = ClosureEntityKind = {}));
33
+ exports.ClosureEntityKindSchema = zod_1.z.nativeEnum(ClosureEntityKind);
34
+ exports.ClosureEntityRefSchema = zod_1.z
35
+ .object({ kind: exports.ClosureEntityKindSchema, id: zod_1.z.string().min(1) })
36
+ .strict();
37
+ exports.ClosureHopSchema = zod_1.z.discriminatedUnion('via', [
38
+ zod_1.z
39
+ .object({
40
+ via: zod_1.z.literal('dependency'),
41
+ consumer: zod_1.z.string().min(1),
42
+ componentKey: zod_1.z.string().min(1).optional(),
43
+ relationship: zod_1.z.nativeEnum(biome_dependency_1.PeerRelationship),
44
+ target: zod_1.z.union([
45
+ zod_1.z.object({ serviceName: zod_1.z.string().min(1) }).strict(),
46
+ zod_1.z.object({ contributionKind: zod_1.z.string().min(1) }).strict(),
47
+ ]),
48
+ })
49
+ .strict(),
50
+ zod_1.z
51
+ .object({
52
+ via: zod_1.z.literal('resource'),
53
+ consumer: zod_1.z.string().min(1),
54
+ consumerService: zod_1.z.string().min(1),
55
+ resource: zod_1.z
56
+ .object({ kind: zod_1.z.string().min(1), logicalName: zod_1.z.string().min(1) })
57
+ .strict(),
58
+ })
59
+ .strict(),
60
+ ]);
61
+ exports.ClosureProvenanceSchema = zod_1.z.union([
62
+ zod_1.z
63
+ .object({
64
+ kind: zod_1.z.enum([
65
+ ClosureProvenanceKind.ProductRoot,
66
+ ClosureProvenanceKind.OwnerSelectedRoot,
67
+ ClosureProvenanceKind.RuntimeInstallationRoot,
68
+ ]),
69
+ })
70
+ .strict(),
71
+ zod_1.z
72
+ .object({
73
+ kind: zod_1.z.literal(ClosureProvenanceKind.PlatformInvariant),
74
+ reason: zod_1.z.string().min(1),
75
+ })
76
+ .strict(),
77
+ zod_1.z
78
+ .object({
79
+ kind: zod_1.z.enum([
80
+ ClosureProvenanceKind.RequiredDependency,
81
+ ClosureProvenanceKind.RequiredResourceProvider,
82
+ ]),
83
+ root: exports.ClosureEntityRefSchema,
84
+ chain: zod_1.z.array(exports.ClosureHopSchema).min(1).readonly(),
85
+ })
86
+ .strict(),
87
+ ]);
88
+ var BiomeClosureErrorCode;
89
+ (function (BiomeClosureErrorCode) {
90
+ BiomeClosureErrorCode["UnknownRoot"] = "unknown-root";
91
+ BiomeClosureErrorCode["ConflictingRootKind"] = "conflicting-root-kind";
92
+ BiomeClosureErrorCode["MissingDependencyContract"] = "missing-dependency-contract";
93
+ BiomeClosureErrorCode["UnresolvedPeer"] = "unresolved-peer";
94
+ BiomeClosureErrorCode["AmbiguousPeer"] = "ambiguous-peer";
95
+ BiomeClosureErrorCode["OperatorBiomeNotRoot"] = "operator-biome-not-root";
96
+ BiomeClosureErrorCode["UnresolvedResourceProvider"] = "unresolved-resource-provider";
97
+ BiomeClosureErrorCode["AmbiguousResourceProvider"] = "ambiguous-resource-provider";
98
+ })(BiomeClosureErrorCode || (exports.BiomeClosureErrorCode = BiomeClosureErrorCode = {}));
99
+ class BiomeClosureError extends Error {
100
+ code;
101
+ constructor(code, message) {
102
+ super(message);
103
+ this.name = 'BiomeClosureError';
104
+ this.code = code;
105
+ }
106
+ }
107
+ exports.BiomeClosureError = BiomeClosureError;
108
+ exports.KERNEL_TIER_INVARIANT_REASON = 'kernel-tier';
109
+ function platformInvariantRoots(candidates) {
110
+ const provenance = {
111
+ kind: ClosureProvenanceKind.PlatformInvariant,
112
+ reason: exports.KERNEL_TIER_INVARIANT_REASON,
113
+ };
114
+ return [
115
+ ...candidates.biomes
116
+ .filter((biome) => biome.tier === 'kernel')
117
+ .map((biome) => ({
118
+ entity: { kind: ClosureEntityKind.Biome, id: biome.id },
119
+ provenance,
120
+ })),
121
+ ...candidates.platformServices
122
+ .filter((service) => service.tier === 'kernel')
123
+ .map((service) => ({
124
+ entity: { kind: ClosureEntityKind.PlatformService, id: service.name },
125
+ provenance,
126
+ })),
127
+ ];
128
+ }
129
+ const compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
130
+ const entityKey = (entity) => `${entity.kind}\u0000${entity.id}`;
131
+ function compareEntities(a, b) {
132
+ return a.kind === b.kind ? compare(a.id, b.id) : compare(a.kind, b.kind);
133
+ }
134
+ function describeEntity(entity) {
135
+ return entity.kind === ClosureEntityKind.Biome
136
+ ? `biome "${entity.id}"`
137
+ : `platform service "${entity.id}"`;
138
+ }
139
+ function edgeTargetKey(edge) {
140
+ return edge.relationship === biome_dependency_1.PeerRelationship.ContributionOwner
141
+ ? edge.target.contributionKind
142
+ : edge.target.serviceName;
143
+ }
144
+ function compareEdges(a, b) {
145
+ return (compare(a.relationship, b.relationship) ||
146
+ compare(edgeTargetKey(a), edgeTargetKey(b)) ||
147
+ compare(a.consumer.componentKey ?? '', b.consumer.componentKey ?? ''));
148
+ }
149
+ function indexBiomes(facts, label) {
150
+ const map = new Map();
151
+ for (const biome of facts?.biomes ?? []) {
152
+ if (map.has(biome.id)) {
153
+ throw new BiomeClosureError(BiomeClosureErrorCode.AmbiguousPeer, `${label} names biome "${biome.id}" twice — a closure over an ambiguous catalogue cannot choose`);
154
+ }
155
+ map.set(biome.id, biome);
156
+ }
157
+ return map;
158
+ }
159
+ function indexPlatformServices(facts) {
160
+ const map = new Map();
161
+ for (const service of facts?.platformServices ?? []) {
162
+ map.set(service.name, service);
163
+ }
164
+ return map;
165
+ }
166
+ function serviceOwners(serviceName, biomes, platformServices) {
167
+ const owners = [];
168
+ for (const biome of biomes.values()) {
169
+ if (biome.services.includes(serviceName)) {
170
+ owners.push({ kind: ClosureEntityKind.Biome, id: biome.id });
171
+ }
172
+ }
173
+ if (platformServices.has(serviceName)) {
174
+ owners.push({ kind: ClosureEntityKind.PlatformService, id: serviceName });
175
+ }
176
+ return owners.sort(compareEntities);
177
+ }
178
+ function contributionIngesters(contributionKind, biomes) {
179
+ const owners = [];
180
+ for (const biome of biomes.values()) {
181
+ const ingests = (biome.dependencyContract?.provides ?? []).some((fact) => fact.contributionKinds.includes(contributionKind));
182
+ if (ingests)
183
+ owners.push({ kind: ClosureEntityKind.Biome, id: biome.id });
184
+ }
185
+ return owners.sort(compareEntities);
186
+ }
187
+ function resourceProviders(kind, biomes) {
188
+ const providers = [];
189
+ for (const biome of biomes) {
190
+ for (const provision of biome.providesResources ?? []) {
191
+ if (provision.kind === kind) {
192
+ providers.push({ biomeId: biome.id, serviceName: provision.service });
193
+ }
194
+ }
195
+ }
196
+ return providers.sort((a, b) => compare(a.biomeId, b.biomeId) || compare(a.serviceName, b.serviceName));
197
+ }
198
+ function resolveBiomeClosure(input) {
199
+ const candidateBiomes = indexBiomes(input.candidates, 'the candidate catalogue');
200
+ const candidatePlatform = indexPlatformServices(input.candidates);
201
+ const presentBiomes = indexBiomes(input.present, 'the present installation');
202
+ const presentPlatform = indexPlatformServices(input.present);
203
+ const included = new Map();
204
+ const queue = [];
205
+ const facts = (id) => candidateBiomes.get(id);
206
+ const extend = (parent, kind, hop) => {
207
+ const inherited = parent.derived;
208
+ if (inherited !== undefined &&
209
+ (inherited.kind === ClosureProvenanceKind.RequiredDependency ||
210
+ inherited.kind === ClosureProvenanceKind.RequiredResourceProvider) &&
211
+ parent.rootReasons.length === 0) {
212
+ return { kind, root: inherited.root, chain: [...inherited.chain, hop] };
213
+ }
214
+ return { kind, root: parent.entity, chain: [hop] };
215
+ };
216
+ const add = (entity, reason) => {
217
+ const key = entityKey(entity);
218
+ let entry = included.get(key);
219
+ if (entry === undefined) {
220
+ entry = { entity, rootReasons: [] };
221
+ included.set(key, entry);
222
+ if (entity.kind === ClosureEntityKind.Biome)
223
+ queue.push(entity.id);
224
+ }
225
+ if ('root' in reason) {
226
+ entry.rootReasons.push(reason.root);
227
+ }
228
+ else if (entry.derived === undefined && entry.rootReasons.length === 0) {
229
+ entry.derived = reason.derived;
230
+ }
231
+ };
232
+ const roots = [...input.roots].sort((a, b) => compareEntities(a.entity, b.entity) ||
233
+ exports.CLOSURE_PROVENANCE_RANK[a.provenance.kind] -
234
+ exports.CLOSURE_PROVENANCE_RANK[b.provenance.kind]);
235
+ for (const root of roots) {
236
+ const known = root.entity.kind === ClosureEntityKind.Biome
237
+ ? candidateBiomes.has(root.entity.id)
238
+ : candidatePlatform.has(root.entity.id);
239
+ const alreadyPresent = root.entity.kind === ClosureEntityKind.Biome
240
+ ? presentBiomes.has(root.entity.id)
241
+ : presentPlatform.has(root.entity.id);
242
+ if (alreadyPresent)
243
+ continue;
244
+ if (!known) {
245
+ throw new BiomeClosureError(BiomeClosureErrorCode.UnknownRoot, `root ${describeEntity(root.entity)} (${root.provenance.kind}) is not in the candidate catalogue`);
246
+ }
247
+ add(root.entity, { root: root.provenance });
248
+ }
249
+ const resolveServiceTarget = (consumer, edge) => {
250
+ const serviceName = edge.target.serviceName;
251
+ if (serviceOwners(serviceName, presentBiomes, presentPlatform).length > 0) {
252
+ return;
253
+ }
254
+ const owners = serviceOwners(serviceName, candidateBiomes, candidatePlatform);
255
+ const where = `${describeEntity(consumer.entity)}${edge.consumer.componentKey ? ` component "${edge.consumer.componentKey}"` : ''} ` +
256
+ `REQUIRES ${edge.relationship} "${serviceName}"`;
257
+ if (owners.length === 0) {
258
+ throw new BiomeClosureError(BiomeClosureErrorCode.UnresolvedPeer, `${where}, and no candidate biome or platform service ships that service`);
259
+ }
260
+ if (owners.length > 1) {
261
+ throw new BiomeClosureError(BiomeClosureErrorCode.AmbiguousPeer, `${where}, and ${owners.length} candidates ship it: ${owners.map(describeEntity).join(', ')}`);
262
+ }
263
+ pull(consumer, owners[0], where, {
264
+ via: 'dependency',
265
+ consumer: consumer.entity.id,
266
+ ...(edge.consumer.componentKey === undefined
267
+ ? {}
268
+ : { componentKey: edge.consumer.componentKey }),
269
+ relationship: edge.relationship,
270
+ target: { serviceName },
271
+ });
272
+ };
273
+ const resolveContributionTarget = (consumer, edge) => {
274
+ const contributionKind = edge.target.contributionKind;
275
+ if (contributionIngesters(contributionKind, presentBiomes).length > 0)
276
+ return;
277
+ const owners = contributionIngesters(contributionKind, candidateBiomes);
278
+ const where = `${describeEntity(consumer.entity)} REQUIRES an ingester of contribution kind "${contributionKind}"`;
279
+ if (owners.length === 0) {
280
+ throw new BiomeClosureError(BiomeClosureErrorCode.UnresolvedPeer, `${where}, and no candidate biome's dependency contract ingests that kind`);
281
+ }
282
+ if (owners.length > 1) {
283
+ throw new BiomeClosureError(BiomeClosureErrorCode.AmbiguousPeer, `${where}, and ${owners.length} candidates ingest it: ${owners.map(describeEntity).join(', ')}`);
284
+ }
285
+ pull(consumer, owners[0], where, {
286
+ via: 'dependency',
287
+ consumer: consumer.entity.id,
288
+ ...(edge.consumer.componentKey === undefined
289
+ ? {}
290
+ : { componentKey: edge.consumer.componentKey }),
291
+ relationship: edge.relationship,
292
+ target: { contributionKind },
293
+ });
294
+ };
295
+ function pull(consumer, target, where, hop) {
296
+ if (target.kind === ClosureEntityKind.Biome &&
297
+ !included.has(entityKey(target)) &&
298
+ facts(target.id).audience === 'operator') {
299
+ throw new BiomeClosureError(BiomeClosureErrorCode.OperatorBiomeNotRoot, `${where}, owned by operator biome "${target.id}" — an operator biome is never pulled in by an edge; name it as a root`);
300
+ }
301
+ add(target, {
302
+ derived: extend(consumer, hop.via === 'resource'
303
+ ? ClosureProvenanceKind.RequiredResourceProvider
304
+ : ClosureProvenanceKind.RequiredDependency, hop),
305
+ });
306
+ }
307
+ const closeEdges = () => {
308
+ while (queue.length > 0) {
309
+ const id = queue.shift();
310
+ const entry = included.get(entityKey({ kind: ClosureEntityKind.Biome, id }));
311
+ const contract = facts(id).dependencyContract;
312
+ if (contract === undefined) {
313
+ const how = entry.rootReasons.length > 0
314
+ ? `a root (${entry.rootReasons.map((r) => r.kind).join(', ')})`
315
+ : `required (${describeProvenance(entry.derived)})`;
316
+ throw new BiomeClosureError(BiomeClosureErrorCode.MissingDependencyContract, `biome "${id}" is ${how} but carries no dependency contract — under positive closure ` +
317
+ 'every included biome must have adopted one; regenerate its xema-biome.index.json with ' +
318
+ 'a builder that derives the contract, or leave this edition on the selector model');
319
+ }
320
+ const edges = contract.peers
321
+ .filter((edge) => edge.inclusion.kind === biome_dependency_1.PeerInclusionKind.Required)
322
+ .sort(compareEdges);
323
+ for (const edge of edges) {
324
+ if (edge.relationship === biome_dependency_1.PeerRelationship.ContributionOwner) {
325
+ resolveContributionTarget(entry, edge);
326
+ }
327
+ else {
328
+ resolveServiceTarget(entry, edge);
329
+ }
330
+ }
331
+ }
332
+ };
333
+ const includedBiomeFacts = () => [...included.values()]
334
+ .filter((entry) => entry.entity.kind === ClosureEntityKind.Biome)
335
+ .map((entry) => facts(entry.entity.id));
336
+ for (;;) {
337
+ closeEdges();
338
+ let pulled = false;
339
+ const biomesNow = includedBiomeFacts().sort((a, b) => compare(a.id, b.id));
340
+ for (const consumer of biomesNow) {
341
+ const requirements = [...(consumer.serviceResources ?? [])]
342
+ .filter((r) => r.inclusion === biome_dependency_1.PeerInclusionKind.Required)
343
+ .sort((a, b) => compare(a.consumerService, b.consumerService) ||
344
+ compare(a.kind, b.kind) ||
345
+ compare(a.logicalName, b.logicalName));
346
+ for (const requirement of requirements) {
347
+ const satisfied = resourceProviders(requirement.kind, presentBiomes.values()).length > 0 ||
348
+ resourceProviders(requirement.kind, includedBiomeFacts()).length > 0;
349
+ if (satisfied)
350
+ continue;
351
+ const where = `biome "${consumer.id}" service "${requirement.consumerService}" REQUIRES ` +
352
+ `${requirement.kind} "${requirement.logicalName}"`;
353
+ const candidates = resourceProviders(requirement.kind, candidateBiomes.values());
354
+ const providerBiomes = [...new Set(candidates.map((p) => p.biomeId))];
355
+ if (providerBiomes.length === 0) {
356
+ throw new BiomeClosureError(BiomeClosureErrorCode.UnresolvedResourceProvider, `${where}, and no candidate biome provides ${requirement.kind}`);
357
+ }
358
+ if (candidates.length > 1) {
359
+ throw new BiomeClosureError(BiomeClosureErrorCode.AmbiguousResourceProvider, `${where}, and ${candidates.length} candidate services provide it: ` +
360
+ `${candidates.map((p) => `${p.biomeId}/${p.serviceName}`).join(', ')} — ` +
361
+ 'name the one you want as a root; the closure never chooses');
362
+ }
363
+ const consumerEntry = included.get(entityKey({ kind: ClosureEntityKind.Biome, id: consumer.id }));
364
+ pull(consumerEntry, {
365
+ kind: ClosureEntityKind.Biome,
366
+ id: candidates[0].biomeId,
367
+ }, where, {
368
+ via: 'resource',
369
+ consumer: consumer.id,
370
+ consumerService: requirement.consumerService,
371
+ resource: {
372
+ kind: requirement.kind,
373
+ logicalName: requirement.logicalName,
374
+ },
375
+ });
376
+ pulled = true;
377
+ }
378
+ }
379
+ if (!pulled)
380
+ break;
381
+ }
382
+ const bindable = [...includedBiomeFacts(), ...presentBiomes.values()];
383
+ const resourceBindings = [];
384
+ for (const consumer of includedBiomeFacts().sort((a, b) => compare(a.id, b.id))) {
385
+ for (const requirement of consumer.serviceResources ?? []) {
386
+ const providers = resourceProviders(requirement.kind, bindable);
387
+ if (providers.length > 1) {
388
+ throw new BiomeClosureError(BiomeClosureErrorCode.AmbiguousResourceProvider, `biome "${consumer.id}" service "${requirement.consumerService}" binds ` +
389
+ `${requirement.kind} "${requirement.logicalName}", and ${providers.length} included ` +
390
+ `services provide it: ${providers.map((p) => `${p.biomeId}/${p.serviceName}`).join(', ')}`);
391
+ }
392
+ if (providers.length === 0)
393
+ continue;
394
+ resourceBindings.push({
395
+ consumer: { biomeId: consumer.id, service: requirement.consumerService },
396
+ kind: requirement.kind,
397
+ logicalName: requirement.logicalName,
398
+ scope: requirement.scope,
399
+ inclusion: requirement.inclusion,
400
+ provider: providers[0],
401
+ });
402
+ }
403
+ }
404
+ const entries = [...included.values()]
405
+ .map((entry) => ({
406
+ entity: entry.entity,
407
+ provenance: [
408
+ ...[...entry.rootReasons].sort((a, b) => exports.CLOSURE_PROVENANCE_RANK[a.kind] - exports.CLOSURE_PROVENANCE_RANK[b.kind] ||
409
+ compare('reason' in a ? a.reason : '', 'reason' in b ? b.reason : '')),
410
+ ...(entry.derived === undefined ? [] : [entry.derived]),
411
+ ],
412
+ }))
413
+ .sort((a, b) => compareEntities(a.entity, b.entity));
414
+ return { entries, resourceBindings };
415
+ }
416
+ function describeProvenance(provenance) {
417
+ switch (provenance.kind) {
418
+ case ClosureProvenanceKind.ProductRoot:
419
+ case ClosureProvenanceKind.OwnerSelectedRoot:
420
+ case ClosureProvenanceKind.RuntimeInstallationRoot:
421
+ return provenance.kind;
422
+ case ClosureProvenanceKind.PlatformInvariant:
423
+ return `${provenance.kind}: ${provenance.reason}`;
424
+ case ClosureProvenanceKind.RequiredDependency:
425
+ case ClosureProvenanceKind.RequiredResourceProvider:
426
+ return `${provenance.kind} from ${describeEntity(provenance.root)} via ${provenance.chain
427
+ .map(describeHop)
428
+ .join(' -> ')}`;
429
+ }
430
+ }
431
+ function describeHop(hop) {
432
+ if (hop.via === 'resource') {
433
+ return `${hop.consumer}/${hop.consumerService} requires resource ${hop.resource.kind} "${hop.resource.logicalName}"`;
434
+ }
435
+ const target = 'serviceName' in hop.target
436
+ ? `service "${hop.target.serviceName}"`
437
+ : `contribution kind "${hop.target.contributionKind}"`;
438
+ return `${hop.consumer}${hop.componentKey ? `[${hop.componentKey}]` : ''} requires ${hop.relationship} ${target}`;
439
+ }
440
+ //# sourceMappingURL=biome-closure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biome-closure.js","sourceRoot":"","sources":["../../../src/distribution/lib/biome-closure.ts"],"names":[],"mappings":";;;AA6SA,wDAqBC;AAgHD,kDAyUC;AAGD,gDAcC;AAGD,kCASC;AAxxBD,6BAAwB;AAExB,6DAKgC;AA2ChC,IAAY,qBAOX;AAPD,WAAY,qBAAqB;IAC/B,qDAA4B,CAAA;IAC5B,kEAAyC,CAAA;IACzC,iEAAwC,CAAA;IACxC,8EAAqD,CAAA;IACrD,mEAA0C,CAAA;IAC1C,gFAAuD,CAAA;AACzD,CAAC,EAPW,qBAAqB,qCAArB,qBAAqB,QAOhC;AACY,QAAA,2BAA2B,GAAG,OAAC,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAGlE,QAAA,uBAAuB,GAEhC;IACF,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAC5C,CAAC,qBAAqB,CAAC,WAAW,CAAC,EAAE,CAAC;IACtC,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAC5C,CAAC,qBAAqB,CAAC,uBAAuB,CAAC,EAAE,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