@xemahq/kernel-contracts 0.23.0 → 0.23.2

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 (52) hide show
  1. package/LICENSE +176 -0
  2. package/dist/connector/index.d.ts +1 -0
  3. package/dist/connector/index.d.ts.map +1 -1
  4. package/dist/connector/index.js +1 -0
  5. package/dist/connector/index.js.map +1 -1
  6. package/dist/connector/lib/connector-descriptor.d.ts +18 -1
  7. package/dist/connector/lib/connector-descriptor.d.ts.map +1 -1
  8. package/dist/connector/lib/connector-descriptor.js +13 -0
  9. package/dist/connector/lib/connector-descriptor.js.map +1 -1
  10. package/dist/connector/lib/integration-provider-contribution.d.ts +66 -0
  11. package/dist/connector/lib/integration-provider-contribution.d.ts.map +1 -0
  12. package/dist/connector/lib/integration-provider-contribution.js +55 -0
  13. package/dist/connector/lib/integration-provider-contribution.js.map +1 -0
  14. package/dist/connector/lib/onboarding-manifest.d.ts +10 -0
  15. package/dist/connector/lib/onboarding-manifest.d.ts.map +1 -1
  16. package/dist/connector/lib/onboarding-manifest.js +11 -1
  17. package/dist/connector/lib/onboarding-manifest.js.map +1 -1
  18. package/dist/connector/lib/provider-descriptor.d.ts +75 -1
  19. package/dist/connector/lib/provider-descriptor.d.ts.map +1 -1
  20. package/dist/connector/lib/provider-descriptor.js +34 -1
  21. package/dist/connector/lib/provider-descriptor.js.map +1 -1
  22. package/dist/distribution/index.d.ts +1 -0
  23. package/dist/distribution/index.d.ts.map +1 -1
  24. package/dist/distribution/index.js +1 -0
  25. package/dist/distribution/index.js.map +1 -1
  26. package/dist/distribution/lib/distribution-lock.d.ts +3 -0
  27. package/dist/distribution/lib/distribution-lock.d.ts.map +1 -1
  28. package/dist/distribution/lib/distribution-lock.js +3 -0
  29. package/dist/distribution/lib/distribution-lock.js.map +1 -1
  30. package/dist/distribution/lib/distribution-selector.d.ts +3 -0
  31. package/dist/distribution/lib/distribution-selector.d.ts.map +1 -1
  32. package/dist/distribution/lib/distribution-selector.js +9 -1
  33. package/dist/distribution/lib/distribution-selector.js.map +1 -1
  34. package/dist/distribution/lib/distribution.d.ts +1 -0
  35. package/dist/distribution/lib/distribution.d.ts.map +1 -1
  36. package/dist/distribution/lib/distribution.js +9 -1
  37. package/dist/distribution/lib/distribution.js.map +1 -1
  38. package/dist/distribution/lib/install-policy.d.ts +13 -0
  39. package/dist/distribution/lib/install-policy.d.ts.map +1 -0
  40. package/dist/distribution/lib/install-policy.js +18 -0
  41. package/dist/distribution/lib/install-policy.js.map +1 -0
  42. package/package.json +20 -18
  43. package/src/connector/index.ts +1 -0
  44. package/src/connector/lib/connector-descriptor.ts +30 -1
  45. package/src/connector/lib/integration-provider-contribution.ts +118 -0
  46. package/src/connector/lib/onboarding-manifest.ts +19 -0
  47. package/src/connector/lib/provider-descriptor.ts +101 -1
  48. package/src/distribution/index.ts +1 -0
  49. package/src/distribution/lib/distribution-lock.ts +20 -0
  50. package/src/distribution/lib/distribution-selector.ts +28 -3
  51. package/src/distribution/lib/distribution.ts +19 -0
  52. package/src/distribution/lib/install-policy.ts +46 -0
@@ -5,6 +5,10 @@ import {
5
5
  type BiomeTier,
6
6
  type BiomeOrigin,
7
7
  } from '../../biome';
8
+ import {
9
+ BiomeInstallPolicySchema,
10
+ type BiomeInstallPolicy,
11
+ } from './install-policy';
8
12
 
9
13
  /**
10
14
  * A `DistributionSelector` declares which biomes an `include[]` entry pulls
@@ -26,22 +30,43 @@ import {
26
30
  * property a biome self-declares in its manifest — the same biome can be
27
31
  * force-on in one distribution and optional/installable in another.
28
32
  *
33
+ * **`installPolicy`** (on the `{ tier }` and `{ biome }` forms) stamps the
34
+ * package-model install policy per selector — e.g.
35
+ * `{ tier: "base", installPolicy: "default-selected" }` plus
36
+ * `{ biome: "backlog", installPolicy: "optional" }`. Resolution: kernel- and
37
+ * system-tier biomes are ALWAYS `required` (resolver invariant); otherwise the
38
+ * most specific matching selector wins (`{ biome }` beats `{ tier }`;
39
+ * conflicting policies at the same specificity fail-fast); no selector policy
40
+ * → `default-selected`. Like `mandatory`, never manifest-sourced.
41
+ *
29
42
  * Selector matching is resolved against the global biome index; the resolver,
30
43
  * not any consumer, applies these rules (the lockfile is the hard boundary).
31
44
  */
32
45
  export type DistributionSelector =
33
- | { tier: BiomeTier; mandatory?: boolean }
46
+ | { tier: BiomeTier; mandatory?: boolean; installPolicy?: BiomeInstallPolicy }
34
47
  | { origin: BiomeOrigin }
35
- | { biome: string; version?: string; mandatory?: boolean };
48
+ | {
49
+ biome: string;
50
+ version?: string;
51
+ mandatory?: boolean;
52
+ installPolicy?: BiomeInstallPolicy;
53
+ };
36
54
 
37
55
  export const DistributionSelectorSchema = z.union([
38
- z.object({ tier: BiomeTierSchema, mandatory: z.boolean().optional() }).strict(),
56
+ z
57
+ .object({
58
+ tier: BiomeTierSchema,
59
+ mandatory: z.boolean().optional(),
60
+ installPolicy: BiomeInstallPolicySchema.optional(),
61
+ })
62
+ .strict(),
39
63
  z.object({ origin: BiomeOriginSchema }).strict(),
40
64
  z
41
65
  .object({
42
66
  biome: z.string().min(1),
43
67
  version: z.string().min(1).optional(),
44
68
  mandatory: z.boolean().optional(),
69
+ installPolicy: BiomeInstallPolicySchema.optional(),
45
70
  })
46
71
  .strict(),
47
72
  ]) as z.ZodType<DistributionSelector>;
@@ -24,6 +24,25 @@ export const PlatformServiceTierSchema = z.union([
24
24
  z.literal('edge'),
25
25
  ]) as z.ZodType<PlatformServiceTier>;
26
26
 
27
+ /**
28
+ * Canonical boot/wave rank of every tier token — THE single vocabulary source
29
+ * for tier ordering across the boot graph, the CLI launcher's wave derivation,
30
+ * and the deploy-roster generators. Lower boots first. `infra` (-1) is the
31
+ * pre-wave: submodules + the external generic plane (identity, event-hub,
32
+ * secrets, llm-gateway, keycloak, postgres, etcd) that always boot before the
33
+ * Xema service mesh. Do NOT redeclare local tier-rank maps in consumers.
34
+ */
35
+ export const PLATFORM_SERVICE_TIER_RANK: Readonly<
36
+ Record<PlatformServiceTier | 'infra', number>
37
+ > = {
38
+ infra: -1,
39
+ kernel: 0,
40
+ system: 1,
41
+ base: 2,
42
+ platform: 3,
43
+ edge: 4,
44
+ };
45
+
27
46
  /**
28
47
  * Schema-versioning seed for `xema-distribution.json`. Bumped via a coordinated
29
48
  * PR on an incompatible shape change; consumers refuse versions they do not
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * `BiomeInstallPolicy` — the package-model install policy a DISTRIBUTION stamps
5
+ * on every resolved biome (never manifest-sourced; the same biome can be
6
+ * `required` in one edition and `optional` in another).
7
+ *
8
+ * - `required` — always installed AND always launched. Kernel- and
9
+ * system-tier biomes are forced to this by the resolver
10
+ * (a platform invariant, regardless of selectors).
11
+ * - `default-selected` — shipped and launched by default; a deployment may
12
+ * opt out.
13
+ * - `optional` — shipped in the lock (catalog-visible, image built)
14
+ * but launched only when explicitly selected.
15
+ *
16
+ * Orthogonal to `LockedBiome.mandatory`, which is the org-DISABLE governance
17
+ * flag (may the org switch it off once shipped) — installPolicy decides what
18
+ * comes up by default; mandatory decides what can be turned off.
19
+ */
20
+ export enum BiomeInstallPolicy {
21
+ Required = 'required',
22
+ DefaultSelected = 'default-selected',
23
+ Optional = 'optional',
24
+ }
25
+
26
+ export const BiomeInstallPolicySchema = z.nativeEnum(BiomeInstallPolicy);
27
+
28
+ /**
29
+ * `BiomeLaunchMode` — WHERE/HOW a biome's services are launched. A distribution
30
+ * decision applied at resolve time (never manifest-sourced — the biome only
31
+ * declares WHAT it is).
32
+ *
33
+ * - `static` — launched as regular services in the static roster
34
+ * (dev launcher waves + prod services.yaml). The default
35
+ * semantics when the lock field is absent.
36
+ * - `per-installation` — a sidecar-host template instantiated dynamically by
37
+ * biome-host-api once a biome is installed; NOT a
38
+ * statically-launched service, so static rosters must
39
+ * not boot it standalone.
40
+ */
41
+ export enum BiomeLaunchMode {
42
+ Static = 'static',
43
+ PerInstallation = 'per-installation',
44
+ }
45
+
46
+ export const BiomeLaunchModeSchema = z.nativeEnum(BiomeLaunchMode);