@xemahq/xema 0.1.4 → 0.2.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 (133) hide show
  1. package/README.md +64 -15
  2. package/dist/assets/boot-graph.json +72 -0
  3. package/dist/assets/core/distribution.lock.json +1244 -0
  4. package/dist/assets/core/images.lock.json +428 -0
  5. package/dist/assets/oss/distribution.lock.json +1978 -0
  6. package/dist/assets/oss/images.lock.json +594 -0
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +9 -1
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/dev.d.ts.map +1 -1
  11. package/dist/commands/dev.js +36 -14
  12. package/dist/commands/dev.js.map +1 -1
  13. package/dist/commands/doctor.js +1 -1
  14. package/dist/commands/doctor.js.map +1 -1
  15. package/dist/commands/down.d.ts +3 -0
  16. package/dist/commands/down.d.ts.map +1 -0
  17. package/dist/commands/down.js +54 -0
  18. package/dist/commands/down.js.map +1 -0
  19. package/dist/commands/logs.d.ts +3 -0
  20. package/dist/commands/logs.d.ts.map +1 -0
  21. package/dist/commands/logs.js +61 -0
  22. package/dist/commands/logs.js.map +1 -0
  23. package/dist/commands/serve.d.ts.map +1 -1
  24. package/dist/commands/serve.js +38 -8
  25. package/dist/commands/serve.js.map +1 -1
  26. package/dist/commands/status.d.ts +3 -0
  27. package/dist/commands/status.d.ts.map +1 -0
  28. package/dist/commands/status.js +41 -0
  29. package/dist/commands/status.js.map +1 -0
  30. package/dist/commands/up.d.ts +3 -0
  31. package/dist/commands/up.d.ts.map +1 -0
  32. package/dist/commands/up.js +44 -0
  33. package/dist/commands/up.js.map +1 -0
  34. package/dist/dev/infra-preflight.js +1 -1
  35. package/dist/dev/infra-preflight.js.map +1 -1
  36. package/dist/lib/command-registry.d.ts +1 -1
  37. package/dist/lib/command-registry.d.ts.map +1 -1
  38. package/dist/lib/command-registry.js +4 -0
  39. package/dist/lib/command-registry.js.map +1 -1
  40. package/dist/runtime/boot-graph-loader.d.ts +17 -0
  41. package/dist/runtime/boot-graph-loader.d.ts.map +1 -0
  42. package/dist/runtime/boot-graph-loader.js +40 -0
  43. package/dist/runtime/boot-graph-loader.js.map +1 -0
  44. package/dist/runtime/config/loader.d.ts +11 -0
  45. package/dist/runtime/config/loader.d.ts.map +1 -0
  46. package/dist/runtime/config/loader.js +38 -0
  47. package/dist/runtime/config/loader.js.map +1 -0
  48. package/dist/runtime/config/schema.d.ts +202 -0
  49. package/dist/runtime/config/schema.d.ts.map +1 -0
  50. package/dist/runtime/config/schema.js +125 -0
  51. package/dist/runtime/config/schema.js.map +1 -0
  52. package/dist/runtime/env-seeder.d.ts +17 -0
  53. package/dist/runtime/env-seeder.d.ts.map +1 -0
  54. package/dist/runtime/env-seeder.js +80 -0
  55. package/dist/runtime/env-seeder.js.map +1 -0
  56. package/dist/runtime/foreground.d.ts +8 -0
  57. package/dist/runtime/foreground.d.ts.map +1 -0
  58. package/dist/runtime/foreground.js +71 -0
  59. package/dist/runtime/foreground.js.map +1 -0
  60. package/dist/runtime/infra/infra-catalog.d.ts +19 -0
  61. package/dist/runtime/infra/infra-catalog.d.ts.map +1 -0
  62. package/dist/runtime/infra/infra-catalog.js +128 -0
  63. package/dist/runtime/infra/infra-catalog.js.map +1 -0
  64. package/dist/runtime/infra/infra-plan.d.ts +16 -0
  65. package/dist/runtime/infra/infra-plan.d.ts.map +1 -0
  66. package/dist/runtime/infra/infra-plan.js +44 -0
  67. package/dist/runtime/infra/infra-plan.js.map +1 -0
  68. package/dist/runtime/infra/infra-runner.d.ts +26 -0
  69. package/dist/runtime/infra/infra-runner.d.ts.map +1 -0
  70. package/dist/runtime/infra/infra-runner.js +135 -0
  71. package/dist/runtime/infra/infra-runner.js.map +1 -0
  72. package/dist/runtime/launch.d.ts +24 -0
  73. package/dist/runtime/launch.d.ts.map +1 -0
  74. package/dist/runtime/launch.js +116 -0
  75. package/dist/runtime/launch.js.map +1 -0
  76. package/dist/runtime/lock-loader.d.ts +26 -0
  77. package/dist/runtime/lock-loader.d.ts.map +1 -0
  78. package/dist/runtime/lock-loader.js +61 -0
  79. package/dist/runtime/lock-loader.js.map +1 -0
  80. package/dist/runtime/paths.d.ts +14 -0
  81. package/dist/runtime/paths.d.ts.map +1 -0
  82. package/dist/runtime/paths.js +109 -0
  83. package/dist/runtime/paths.js.map +1 -0
  84. package/dist/runtime/platform-services.d.ts +2 -0
  85. package/dist/runtime/platform-services.d.ts.map +1 -0
  86. package/dist/runtime/platform-services.js +8 -0
  87. package/dist/runtime/platform-services.js.map +1 -0
  88. package/dist/runtime/port-map.d.ts +3 -0
  89. package/dist/runtime/port-map.d.ts.map +1 -0
  90. package/dist/runtime/port-map.js +25 -0
  91. package/dist/runtime/port-map.js.map +1 -0
  92. package/dist/runtime/roster.d.ts +32 -0
  93. package/dist/runtime/roster.d.ts.map +1 -0
  94. package/dist/runtime/roster.js +106 -0
  95. package/dist/runtime/roster.js.map +1 -0
  96. package/dist/runtime/runner/container-runner.d.ts +14 -0
  97. package/dist/runtime/runner/container-runner.d.ts.map +1 -0
  98. package/dist/runtime/runner/container-runner.js +61 -0
  99. package/dist/runtime/runner/container-runner.js.map +1 -0
  100. package/dist/runtime/runner/docker-cli.d.ts +11 -0
  101. package/dist/runtime/runner/docker-cli.d.ts.map +1 -0
  102. package/dist/runtime/runner/docker-cli.js +53 -0
  103. package/dist/runtime/runner/docker-cli.js.map +1 -0
  104. package/dist/runtime/runner/health-probe.d.ts +2 -0
  105. package/dist/runtime/runner/health-probe.d.ts.map +1 -0
  106. package/dist/runtime/runner/health-probe.js +38 -0
  107. package/dist/runtime/runner/health-probe.js.map +1 -0
  108. package/dist/runtime/runner/helm-runner.d.ts +19 -0
  109. package/dist/runtime/runner/helm-runner.d.ts.map +1 -0
  110. package/dist/runtime/runner/helm-runner.js +70 -0
  111. package/dist/runtime/runner/helm-runner.js.map +1 -0
  112. package/dist/runtime/runner/native-runner.d.ts +9 -0
  113. package/dist/runtime/runner/native-runner.d.ts.map +1 -0
  114. package/dist/runtime/runner/native-runner.js +85 -0
  115. package/dist/runtime/runner/native-runner.js.map +1 -0
  116. package/dist/runtime/runner/service-runner.d.ts +23 -0
  117. package/dist/runtime/runner/service-runner.d.ts.map +1 -0
  118. package/dist/runtime/runner/service-runner.js +10 -0
  119. package/dist/runtime/runner/service-runner.js.map +1 -0
  120. package/dist/runtime/supervisor.d.ts +46 -0
  121. package/dist/runtime/supervisor.d.ts.map +1 -0
  122. package/dist/runtime/supervisor.js +77 -0
  123. package/dist/runtime/supervisor.js.map +1 -0
  124. package/dist/runtime/unit-type.d.ts +9 -0
  125. package/dist/runtime/unit-type.d.ts.map +1 -0
  126. package/dist/runtime/unit-type.js +19 -0
  127. package/dist/runtime/unit-type.js.map +1 -0
  128. package/dist/runtime/waves.d.ts +15 -0
  129. package/dist/runtime/waves.d.ts.map +1 -0
  130. package/dist/runtime/waves.js +77 -0
  131. package/dist/runtime/waves.js.map +1 -0
  132. package/package.json +9 -10
  133. package/xema.config.example.yaml +45 -0
package/README.md CHANGED
@@ -28,16 +28,17 @@
28
28
 
29
29
  ## Overview
30
30
 
31
- The single global binary for Xema. Install it once to boot the local stack,
32
- author and ship biomes, and invoke capabilities from your terminal. It scaffolds,
33
- installs, publishes, and lints biomes; runs capabilities by name; and ships a
34
- `doctor` check for diagnosing your environment. It works as a standalone tool —
35
- no monorepo checkout required.
31
+ The single global binary for Xema. Install it once to **launch the whole
32
+ platform with one command**, author and ship biomes, and invoke capabilities
33
+ from your terminal.
36
34
 
37
- ## When to use it
38
-
39
- - Use it for day-0 onboarding and everyday authoring: boot the stack, scaffold a
40
- biome, and run a capability without wiring up tooling by hand.
35
+ `xema up` resolves the platform's distribution lock into an effective service
36
+ roster, brings up the backing infrastructure you don't already run, and
37
+ supervises every service to readiness over a **container** substrate
38
+ (customers) or a **native** substrate (contributors). It is a thin bring-up
39
+ coordinator: it resolves topology and sequences startup, delegating process
40
+ lifecycle (restart, health, resource limits) to the substrate beneath it
41
+ (Docker/Podman, or your own infra). It never becomes a second orchestrator.
41
42
 
42
43
  ## Installation
43
44
 
@@ -45,14 +46,62 @@ no monorepo checkout required.
45
46
  npm i -g @xemahq/xema
46
47
  ```
47
48
 
48
- ## Usage
49
+ ## Launch the platform
50
+
51
+ ```bash
52
+ xema up # boot the backend (infra + services) as one supervised process
53
+ xema up --web # also start the host-shell frontend
54
+ xema up --all # everything, including the frontend
55
+ xema up --detach # leave container workloads running and return
56
+ xema down # stop everything (xema down --purge also deletes data volumes)
57
+ xema status # show launcher-owned workloads + health
58
+ xema logs <service> -f # stream a service's logs
59
+ ```
60
+
61
+ ### Topology — `xema.config.yaml`
62
+
63
+ The launcher reads an optional `xema.config.yaml` (or `~/.xema/config.yaml`)
64
+ declaring **which infrastructure you own** and **what to run**. Every backing
65
+ component is `managed` (the launcher starts it), `external` (you already run it —
66
+ provide the URL), or `disabled`:
67
+
68
+ ```yaml
69
+ edition: oss
70
+ infra:
71
+ postgres: { mode: managed }
72
+ redis: { mode: managed }
73
+ etcd: { mode: managed }
74
+ keycloak: { mode: external, url: https://sso.corp/realms/xema, realm: xema }
75
+ objectStore: { mode: external, url: https://s3.corp }
76
+ search: { mode: managed }
77
+ temporal: { mode: managed }
78
+ app:
79
+ substrate: container # container | native
80
+ include: [ all ] # all | <tier> | [service ...]
81
+ features: [] # curated capability bundles
82
+ web: { enabled: true }
83
+ ```
84
+
85
+ - **`container`** (recommended): pulls content-addressed service images
86
+ (`imageRef:contentHash`) and runs them on a shared network, after bringing up
87
+ and bootstrapping managed infra — works without a monorepo checkout.
88
+ - **`native`**: runs services as host processes against a built monorepo (the
89
+ contributor inner loop). Equivalent: `xema serve --profile single-instance`.
90
+ - **`helm`**: deploys to Kubernetes via `helm upgrade --install` (the appliance /
91
+ cluster target). Equivalent: `xema serve --profile appliance`.
92
+
93
+ `xema up` fails fast on a missing required secret, an unreachable `external`
94
+ dependency, or a disabled-but-mandatory infra component — never a silent
95
+ degradation.
96
+
97
+ ## Author biomes & run capabilities
49
98
 
50
99
  ```bash
51
- xema dev # boot the local stack
52
- xema biome scaffold <name> # author a new biome
53
- xema biome publish <path> # ship a biome
54
- xema run <capability> # invoke a capability by name
55
- xema doctor # diagnose your environment
100
+ xema dev # lock-driven native dev boot (contributors)
101
+ xema biome scaffold <name> # author a new biome
102
+ xema biome publish <path> # ship a biome
103
+ xema run <capability> # invoke a capability by name
104
+ xema doctor # diagnose your environment
56
105
  ```
57
106
 
58
107
  ## License
@@ -0,0 +1,72 @@
1
+ {
2
+ "$comment": "Declarative source of truth for system-authority STARTUP dependencies (Gate A, plan .claude/plans/federated-crunching-thompson.md Phase 1.5). Consumed by tooling/boundaries/check-boot-graph.mjs. Human-prose rationale + degraded behavior lives in docs/architecture/system-boot-graph.md — keep the two in lockstep. INVARIANT: no service may HARD-REQUIRE a higher- or same-boot-tier service at startup; the hard-require graph must be acyclic. 'startupRequires' lists ONLY hard boot-blocking deps (the service refuses to come up / crash-loops until each is reachable). Lazy/at-request-time deps are NOT listed here — they are captured as 'degraded' prose in the doc. Boot tiers (lower boots first): infra(-1) < kernel(0) < system(1) < base(2) < platform(3) < third-party(4). 'infra' = submodules + external generic plane (identity-api, event-hub, secrets, llm-gateway, keycloak, postgres, valkey, kernel-state/etcd) which always boot before the Xema service mesh and can never participate in a service-mesh cycle.",
3
+ "tiers": {
4
+ "infra": -1,
5
+ "kernel": 0,
6
+ "system": 1,
7
+ "base": 2,
8
+ "platform": 3,
9
+ "third-party": 4
10
+ },
11
+ "infraServices": [
12
+ "identity-api",
13
+ "event-hub-api",
14
+ "secrets-api",
15
+ "llm-gateway-api",
16
+ "kernel-state"
17
+ ],
18
+ "services": {
19
+ "authorization-api": {
20
+ "tier": "system",
21
+ "startupRequires": ["identity-api"]
22
+ },
23
+ "object-registry-api": {
24
+ "tier": "system",
25
+ "startupRequires": ["identity-api"]
26
+ },
27
+ "capability-registry-api": {
28
+ "tier": "system",
29
+ "startupRequires": ["identity-api"]
30
+ },
31
+ "user-hub-api": {
32
+ "tier": "system",
33
+ "startupRequires": ["identity-api"]
34
+ },
35
+ "public-gateway-api": {
36
+ "tier": "system",
37
+ "startupRequires": ["identity-api"]
38
+ },
39
+ "xema-shell-api": {
40
+ "tier": "system",
41
+ "startupRequires": ["identity-api"]
42
+ },
43
+ "xema-capability-router": {
44
+ "tier": "system",
45
+ "startupRequires": []
46
+ },
47
+ "biome-host-api": {
48
+ "tier": "system",
49
+ "startupRequires": ["identity-api"]
50
+ },
51
+ "workload-runtime-api": {
52
+ "tier": "system",
53
+ "startupRequires": ["identity-api"]
54
+ },
55
+ "xema-biome-runner": {
56
+ "tier": "system",
57
+ "startupRequires": ["identity-api"]
58
+ },
59
+ "project-registry-api": {
60
+ "tier": "base",
61
+ "startupRequires": ["identity-api"]
62
+ },
63
+ "space-registry-api": {
64
+ "tier": "system",
65
+ "startupRequires": ["identity-api"]
66
+ },
67
+ "xema-kernel-server": {
68
+ "tier": "kernel",
69
+ "startupRequires": []
70
+ }
71
+ }
72
+ }