@kontextmind/kxm 0.7.39 → 0.7.43

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 (178) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +41 -7
  3. package/docs/README.md +5 -3
  4. package/docs/agent-skills.md +1 -1
  5. package/docs/architecture.md +1 -1
  6. package/docs/configuration.md +28 -5
  7. package/docs/{vnext → contracts}/README.md +7 -7
  8. package/docs/{vnext → contracts}/architecture.md +2 -2
  9. package/docs/{vnext → contracts}/migration.md +25 -25
  10. package/docs/{vnext → contracts}/routing.md +2 -2
  11. package/docs/{vnext → contracts}/synchronization.md +1 -1
  12. package/docs/{vnext → contracts}/validation.md +7 -7
  13. package/docs/getting-started.md +1 -1
  14. package/docs/kb/qa-authentik-authentication.md +47 -0
  15. package/docs/kb/qa-extension-install-and-hub-bootstrap.md +68 -0
  16. package/docs/kb/qa-hub-on-a-public-host.md +31 -0
  17. package/docs/kb/qa-sqlite-vs-duckdb.md +18 -0
  18. package/docs/kb/qa-what-the-hub-stores.md +47 -0
  19. package/docs/packages.md +91 -0
  20. package/docs/templates/architecture.md +1 -1
  21. package/docs/test-matrix.md +6 -6
  22. package/docs/tui-components.md +131 -0
  23. package/examples/README.md +2 -2
  24. package/examples/{vnext → project}/.kxm/agents/critic-3.yaml +1 -1
  25. package/examples/{vnext → project}/README.md +4 -4
  26. package/package.json +18 -8
  27. package/packages/core/tui/CHANGELOG.md +19 -0
  28. package/packages/core/tui/LICENSE +21 -0
  29. package/packages/core/tui/README.md +45 -0
  30. package/packages/core/tui/dist/index.js +1439 -0
  31. package/packages/core/tui/src/adapters/pi.ts +73 -0
  32. package/packages/core/tui/src/adapters/terminal.ts +106 -0
  33. package/packages/core/tui/src/exports/index.ts +30 -0
  34. package/packages/core/tui/src/services/registry.ts +274 -0
  35. package/packages/core/tui/src/tui/keys.ts +130 -0
  36. package/packages/core/tui/src/tui/layout.ts +117 -0
  37. package/packages/core/tui/src/tui/panel.ts +435 -0
  38. package/packages/core/tui/src/tui/panelComponent.ts +208 -0
  39. package/packages/core/tui/src/tui/render.ts +309 -0
  40. package/packages/core/tui/src/tui/theme.ts +145 -0
  41. package/packages/core/tui/src/types/surface.ts +407 -0
  42. package/plugins/kxm/.claude-plugin/plugin.json +1 -1
  43. package/plugins/kxm/dist/cli.js +681 -553
  44. package/plugins/kxm/dist/extension.js +18 -18
  45. package/plugins/kxm/dist/mcp-server.js +1 -1
  46. package/plugins/kxm/dist/{vnext-runtime-supervisor.js → runtime-supervisor.js} +553 -553
  47. package/plugins/kxm/dist/runtime.js +608 -608
  48. package/plugins/kxm/dist/server.js +13 -13
  49. package/plugins/kxm/package.json +2 -2
  50. package/plugins/kxm/skills/kxm-project-setup/SKILL.md +2 -2
  51. package/plugins/kxm/skills/kxm-runs/SKILL.md +3 -3
  52. package/plugins/kxm/skills/kxm-session/SKILL.md +1 -1
  53. package/plugins/kxm/skills/kxm-workflow/SKILL.md +1 -1
  54. package/plugins/kxm/src/autocomplete.ts +4 -4
  55. package/plugins/kxm/src/{vnext-bindings.ts → bindings.ts} +48 -48
  56. package/plugins/kxm/src/cli/hub.ts +3 -3
  57. package/plugins/kxm/src/cli/{vnext.ts → project.ts} +106 -106
  58. package/plugins/kxm/src/cli/roles.ts +9 -9
  59. package/plugins/kxm/src/cli/system.ts +2 -2
  60. package/plugins/kxm/src/cli/tasks.ts +8 -8
  61. package/plugins/kxm/src/cli/workflows.ts +8 -8
  62. package/plugins/kxm/src/cli.ts +47 -47
  63. package/plugins/kxm/src/config.ts +69 -14
  64. package/plugins/kxm/src/database.ts +4 -4
  65. package/plugins/kxm/src/{vnext-engine-artifacts.ts → engine-artifacts.ts} +7 -7
  66. package/plugins/kxm/src/{vnext-engine-command.ts → engine-command.ts} +40 -40
  67. package/plugins/kxm/src/{vnext-engine-compile.ts → engine-compile.ts} +64 -64
  68. package/plugins/kxm/src/{vnext-engine-evidence.ts → engine-evidence.ts} +26 -26
  69. package/plugins/kxm/src/{vnext-engine-fold.ts → engine-fold.ts} +99 -99
  70. package/plugins/kxm/src/{vnext-engine-gate-records.ts → engine-gate-records.ts} +105 -105
  71. package/plugins/kxm/src/{vnext-engine-plan.ts → engine-plan.ts} +69 -69
  72. package/plugins/kxm/src/{vnext-engine.ts → engine.ts} +502 -502
  73. package/plugins/kxm/src/gate-hash.ts +10 -0
  74. package/plugins/kxm/src/{vnext-harness.ts → harness.ts} +1 -1
  75. package/plugins/kxm/src/hub.ts +1 -1
  76. package/plugins/kxm/src/init-guide-setup.ts +3 -3
  77. package/plugins/kxm/src/{vnext-init.ts → init.ts} +93 -93
  78. package/plugins/kxm/src/kxm-install-kind.ts +1 -1
  79. package/plugins/kxm/src/kxm-update-config.ts +2 -2
  80. package/plugins/kxm/src/local-snapshot.ts +23 -23
  81. package/plugins/kxm/src/mcp-server.ts +1 -1
  82. package/plugins/kxm/src/{vnext-migrate.ts → migrate.ts} +123 -123
  83. package/plugins/kxm/src/model-inventory.ts +1 -1
  84. package/plugins/kxm/src/{vnext-oneshot-evidence.ts → oneshot-evidence.ts} +2 -2
  85. package/plugins/kxm/src/{vnext-oneshot-process.ts → oneshot-process.ts} +4 -4
  86. package/plugins/kxm/src/{vnext-oneshot-producer.ts → oneshot-producer.ts} +24 -24
  87. package/plugins/kxm/src/{vnext-permission.ts → permission.ts} +86 -86
  88. package/plugins/kxm/src/{vnext-pi-producer.ts → pi-producer.ts} +13 -13
  89. package/plugins/kxm/src/{vnext-config.ts → project-config.ts} +177 -177
  90. package/plugins/kxm/src/{vnext-repair.ts → repair.ts} +159 -159
  91. package/plugins/kxm/src/restricted-yaml.d.mts +3 -3
  92. package/plugins/kxm/src/restricted-yaml.mjs +4 -4
  93. package/plugins/kxm/src/{vnext-runtime-owner.ts → runtime-owner.ts} +35 -35
  94. package/plugins/kxm/src/{vnext-runtime.ts → runtime-service.ts} +136 -136
  95. package/plugins/kxm/src/{vnext-runtime-store.ts → runtime-store.ts} +145 -145
  96. package/plugins/kxm/src/{vnext-runtime-supervisor.ts → runtime-supervisor.ts} +80 -80
  97. package/plugins/kxm/src/runtime.ts +6 -6
  98. package/plugins/kxm/src/session-work.ts +3 -3
  99. package/plugins/kxm/src/studio-layout.ts +6 -6
  100. package/plugins/kxm/src/{vnext-template.ts → template.ts} +33 -33
  101. package/plugins/kxm/src/tui.ts +10 -24
  102. package/schemas/{vnext/README.md → README.md} +3 -3
  103. package/schemas/{vnext/agent.schema.json → agent.schema.json} +1 -1
  104. package/schemas/{vnext/assignment-result.schema.json → assignment-result.schema.json} +1 -1
  105. package/schemas/{vnext/backup-manifest.schema.json → backup-manifest.schema.json} +1 -1
  106. package/schemas/{vnext/candidate.schema.json → candidate.schema.json} +1 -1
  107. package/schemas/{vnext/common.schema.json → common.schema.json} +2 -2
  108. package/schemas/{vnext/context-candidate.schema.json → context-candidate.schema.json} +1 -1
  109. package/schemas/{vnext/context-packet.schema.json → context-packet.schema.json} +1 -1
  110. package/schemas/{vnext/delivery-manifest.schema.json → delivery-manifest.schema.json} +1 -1
  111. package/schemas/{vnext/drive-receipt.schema.json → drive-receipt.schema.json} +2 -2
  112. package/schemas/{vnext/environment.schema.json → environment.schema.json} +1 -1
  113. package/schemas/{vnext/gate-registry.schema.json → gate-registry.schema.json} +1 -1
  114. package/schemas/{vnext/handoff-manifest.schema.json → handoff-manifest.schema.json} +1 -1
  115. package/schemas/{vnext/init-operation.schema.json → init-operation.schema.json} +1 -1
  116. package/schemas/{vnext/local-repository-bindings.schema.json → local-repository-bindings.schema.json} +1 -1
  117. package/schemas/{vnext/memory-record.schema.json → memory-record.schema.json} +1 -1
  118. package/schemas/{vnext/migration-decision.schema.json → migration-decision.schema.json} +1 -1
  119. package/schemas/{vnext/migration-plan.schema.json → migration-plan.schema.json} +1 -1
  120. package/schemas/{vnext/migration-receipt.schema.json → migration-receipt.schema.json} +1 -1
  121. package/schemas/{vnext/model.schema.json → model.schema.json} +1 -1
  122. package/schemas/{vnext/modes.schema.json → modes.schema.json} +1 -1
  123. package/schemas/{vnext/permission-diff.schema.json → permission-diff.schema.json} +1 -1
  124. package/schemas/policy-draft/README.md +2 -2
  125. package/schemas/{vnext/prices.schema.json → prices.schema.json} +1 -1
  126. package/schemas/{vnext/project.schema.json → project.schema.json} +1 -1
  127. package/schemas/{vnext/repository.schema.json → repository.schema.json} +1 -1
  128. package/schemas/{vnext/role.schema.json → role.schema.json} +1 -1
  129. package/schemas/{vnext/run-event.schema.json → run-event.schema.json} +1 -1
  130. package/schemas/{vnext/session-brief.schema.json → session-brief.schema.json} +2 -2
  131. package/schemas/{vnext/sync-event.schema.json → sync-event.schema.json} +1 -1
  132. package/schemas/{vnext/template-provenance.schema.json → template-provenance.schema.json} +1 -1
  133. package/schemas/{vnext/workflow.schema.json → workflow.schema.json} +1 -1
  134. package/scripts/build-package.mjs +59 -0
  135. package/scripts/build-runtime.mjs +3 -2
  136. package/scripts/check-generated.mjs +2 -1
  137. package/scripts/check-versions.mjs +12 -1
  138. package/scripts/docker-install-smoke.mjs +268 -0
  139. package/scripts/emit-codex-artifacts.mjs +1 -1
  140. package/scripts/kxm-bump-version.mjs +53 -3
  141. package/scripts/kxm-runtime-supervisor.mjs +3 -3
  142. package/scripts/package-surfaces.mjs +39 -0
  143. package/scripts/roster-policy.mjs +1 -1
  144. package/plugins/kxm/src/vnext-gate-hash.ts +0 -10
  145. /package/docs/{vnext → contracts}/effects-and-recovery.md +0 -0
  146. /package/docs/{vnext → contracts}/lifecycles.md +0 -0
  147. /package/docs/{vnext → contracts}/terminology.md +0 -0
  148. /package/examples/{vnext → project}/.kxm/agents/coordinator.yaml +0 -0
  149. /package/examples/{vnext → project}/.kxm/agents/critic-1.yaml +0 -0
  150. /package/examples/{vnext → project}/.kxm/agents/critic-2.yaml +0 -0
  151. /package/examples/{vnext → project}/.kxm/agents/implementer.yaml +0 -0
  152. /package/examples/{vnext → project}/.kxm/agents/planner.yaml +0 -0
  153. /package/examples/{vnext → project}/.kxm/agents/reproducer.yaml +0 -0
  154. /package/examples/{vnext → project}/.kxm/agents/reviewer.yaml +0 -0
  155. /package/examples/{vnext → project}/.kxm/gates.yaml +0 -0
  156. /package/examples/{vnext → project}/.kxm/models/critic-claude.yaml +0 -0
  157. /package/examples/{vnext → project}/.kxm/models/critic-gemini.yaml +0 -0
  158. /package/examples/{vnext → project}/.kxm/models/critic-grok.yaml +0 -0
  159. /package/examples/{vnext → project}/.kxm/models/implementation.yaml +0 -0
  160. /package/examples/{vnext → project}/.kxm/models/primary.yaml +0 -0
  161. /package/examples/{vnext → project}/.kxm/prices.yaml +0 -0
  162. /package/examples/{vnext → project}/.kxm/project/env.yaml +0 -0
  163. /package/examples/{vnext → project}/.kxm/project.yaml +0 -0
  164. /package/examples/{vnext → project}/.kxm/repo/repo.yaml +0 -0
  165. /package/examples/{vnext → project}/.kxm/workflows/default.yaml +0 -0
  166. /package/examples/{vnext → project}/.kxm/workflows/fix.yaml +0 -0
  167. /package/examples/{vnext → project}/.kxm/workflows/improve.yaml +0 -0
  168. /package/examples/{vnext → project}/records/assignment-result-recorded.json +0 -0
  169. /package/examples/{vnext → project}/records/assignment-result.json +0 -0
  170. /package/examples/{vnext → project}/records/context-candidate.json +0 -0
  171. /package/examples/{vnext → project}/records/delivery-manifest.json +0 -0
  172. /package/examples/{vnext → project}/records/effect-uncertainty-resolved-sync.json +0 -0
  173. /package/examples/{vnext → project}/records/effect-uncertainty-resolved.json +0 -0
  174. /package/examples/{vnext → project}/records/run-created.json +0 -0
  175. /package/examples/{vnext → project}/records/sync-event.json +0 -0
  176. /package/examples/{vnext → project}/repositories/api/.kxm/repo/env.yaml +0 -0
  177. /package/examples/{vnext → project}/repositories/api/.kxm/repo/repo.yaml +0 -0
  178. /package/examples/{vnext → project}/repositories/web/.kxm/repo/repo.yaml +0 -0
@@ -19,6 +19,7 @@ import { mkdirSync } from "node:fs";
19
19
  import { join, resolve, dirname } from "node:path";
20
20
  import { spawnSync } from "node:child_process";
21
21
  import type { AgentRecord } from "./protocol.ts";
22
+ import { createKxmTuiAnsiTheme, type KxmTuiTheme } from "@kontextmind/tui";
22
23
  import { slugifyBranchPart } from "./external-effects.ts";
23
24
  import {
24
25
  loadLocalMeshSnapshot,
@@ -295,33 +296,18 @@ function stageMark(status: string, theme: MeshTuiTheme): string {
295
296
  return theme.dim("[ ]");
296
297
  }
297
298
 
298
- type MeshTuiStyle = (text: string) => string;
299
-
300
- interface MeshTuiTheme {
301
- accent: MeshTuiStyle;
302
- dim: MeshTuiStyle;
303
- error: MeshTuiStyle;
304
- success: MeshTuiStyle;
305
- warning: MeshTuiStyle;
306
- headerBg: MeshTuiStyle;
307
- panelBg: MeshTuiStyle;
308
- }
299
+ /**
300
+ * The dashboard palette lives in `tui/theme.ts` so a config surface and the
301
+ * live screens cannot drift to different meanings for the same colour.
302
+ */
303
+ type MeshTuiTheme = Pick<KxmTuiTheme, "accent" | "dim" | "error" | "success" | "warning" | "headerBg" | "panelBg">;
309
304
 
310
305
  function meshTuiTheme(color: boolean): MeshTuiTheme {
311
- const ansi = (code: string): MeshTuiStyle => color ? (text) => `\u001b[${code}m${text}\u001b[0m` : (text) => text;
312
- return {
313
- accent: ansi("1;36"),
314
- dim: ansi("2"),
315
- error: ansi("1;31"),
316
- success: ansi("1;32"),
317
- warning: ansi("1;33"),
318
- headerBg: ansi("1;97;44"),
319
- panelBg: ansi("48;5;236"),
320
- };
306
+ return createKxmTuiAnsiTheme(color);
321
307
  }
322
308
 
323
309
  function visibleAgents(snapshot: MeshTuiSnapshot): AgentRecord[] {
324
- return snapshot.agents.filter((agent) => agent.model !== "kxm-tui");
310
+ return snapshot.agents.filter((agent) => agent.model !== "tui");
325
311
  }
326
312
 
327
313
  function panelMetric(snapshot: MeshTuiSnapshot, panel: MeshTuiPanel): string {
@@ -820,7 +806,7 @@ export async function runMeshTui(input: {
820
806
  let identity: { id: string; key: string } | undefined;
821
807
  let useOpsStream = true;
822
808
  let interactive: { tui: TUI; dashboard: KxmDashboard } | undefined;
823
- const name = `kxm-tui-${process.pid}`;
809
+ const name = `tui-${process.pid}`;
824
810
  const view = defaultMeshTuiView(input.screen);
825
811
 
826
812
  const paint = (snapshot: MeshTuiSnapshot) => {
@@ -927,7 +913,7 @@ export async function runMeshTui(input: {
927
913
  name,
928
914
  purpose: "Read-only mesh observer TUI",
929
915
  project: input.project,
930
- model: "kxm-tui",
916
+ model: "tui",
931
917
  }),
932
918
  });
933
919
  if (!registration.ok) throw new Error(`observer registration failed with HTTP ${registration.status}`);
@@ -1,7 +1,7 @@
1
- # KXM vNext schemas
1
+ # KXM schemas
2
2
 
3
3
  These draft 2020-12 JSON Schemas validate parsed YAML configuration, bounded
4
- Runtime-local records, and JSON events/results for the planned vNext contract.
4
+ Runtime-local records, and JSON events/results for the planned KXM contract.
5
5
 
6
6
  | Schema | Identity |
7
7
  |---|---|
@@ -29,7 +29,7 @@ Runtime-local records, and JSON events/results for the planned vNext contract.
29
29
  one validation layer; cross-file references, state-machine semantics,
30
30
  permission diffs, model diversity, path portability, and snapshot reproduction
31
31
  are deterministic semantic checks described in
32
- [`docs/vnext/validation.md`](../../docs/vnext/validation.md).
32
+ [`docs/contracts/validation.md`](../../docs/contracts/validation.md).
33
33
 
34
34
  Unknown fields fail closed. A new field requires a reviewed schema revision;
35
35
  do not add generic metadata escape hatches to event or synchronization payloads.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/agent.schema.json",
3
+ "$id": "https://schemas.kxm.dev/agent.schema.json",
4
4
  "title": "KXM agent definition",
5
5
  "description": "The filename determines the agent identity.",
6
6
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/assignment-result.schema.json",
3
+ "$id": "https://schemas.kxm.dev/assignment-result.schema.json",
4
4
  "title": "KXM structured assignment result",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/backup-manifest.schema.json",
3
+ "$id": "https://schemas.kxm.dev/backup-manifest.schema.json",
4
4
  "title": "KXM SQLite stores backup manifest",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/candidate.schema.json",
3
+ "$id": "https://schemas.kxm.dev/candidate.schema.json",
4
4
  "title": "KXM coded-repeat improvement candidate",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/common.schema.json",
4
- "title": "KXM vNext common definitions",
3
+ "$id": "https://schemas.kxm.dev/common.schema.json",
4
+ "title": "KXM common definitions",
5
5
  "$defs": {
6
6
  "identifier": {
7
7
  "type": "string",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/context-candidate.schema.json",
3
+ "$id": "https://schemas.kxm.dev/context-candidate.schema.json",
4
4
  "title": "KXM evidence-linked improvement candidate",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/context-packet.schema.json",
3
+ "$id": "https://schemas.kxm.dev/context-packet.schema.json",
4
4
  "title": "KXM formal context packet v2",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/delivery-manifest.schema.json",
3
+ "$id": "https://schemas.kxm.dev/delivery-manifest.schema.json",
4
4
  "title": "KXM non-atomic multi-repository delivery manifest",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/drive-receipt.schema.json",
4
- "title": "KXM vNext drive session receipt",
3
+ "$id": "https://schemas.kxm.dev/drive-receipt.schema.json",
4
+ "title": "KXM drive session receipt",
5
5
  "type": "object",
6
6
  "required": [
7
7
  "schema",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/environment.schema.json",
3
+ "$id": "https://schemas.kxm.dev/environment.schema.json",
4
4
  "title": "KXM portable environment overrides",
5
5
  "type": "object",
6
6
  "required": ["schema"],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/gate-registry.schema.json",
3
+ "$id": "https://schemas.kxm.dev/gate-registry.schema.json",
4
4
  "title": "KXM gate registry",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/handoff-manifest.schema.json",
3
+ "$id": "https://schemas.kxm.dev/handoff-manifest.schema.json",
4
4
  "title": "KXM structured handoff manifest v1",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/init-operation.schema.json",
3
+ "$id": "https://schemas.kxm.dev/init-operation.schema.json",
4
4
  "title": "KXM Runtime-local initialization operation v1",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/local-repository-bindings.schema.json",
3
+ "$id": "https://schemas.kxm.dev/local-repository-bindings.schema.json",
4
4
  "title": "KXM Runtime-local repository bindings",
5
5
  "type": "object",
6
6
  "required": ["schema", "projectId", "projectRoot", "repositories"],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/memory-record.schema.json",
3
+ "$id": "https://schemas.kxm.dev/memory-record.schema.json",
4
4
  "title": "KXM harness-agnostic memory record",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/migration-decision.schema.json",
3
+ "$id": "https://schemas.kxm.dev/migration-decision.schema.json",
4
4
  "title": "KXM reviewed legacy configuration migration decisions",
5
5
  "type": "object",
6
6
  "required": ["schema", "projectId", "projectName", "sourceDigest", "resolutions"],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/migration-plan.schema.json",
3
+ "$id": "https://schemas.kxm.dev/migration-plan.schema.json",
4
4
  "title": "KXM legacy configuration migration plan",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/migration-receipt.schema.json",
3
+ "$id": "https://schemas.kxm.dev/migration-receipt.schema.json",
4
4
  "title": "KXM verified legacy configuration migration receipt",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/model.schema.json",
3
+ "$id": "https://schemas.kxm.dev/model.schema.json",
4
4
  "title": "KXM model profile",
5
5
  "description": "The filename determines the profile identity.",
6
6
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/modes.schema.json",
3
+ "$id": "https://schemas.kxm.dev/modes.schema.json",
4
4
  "title": "KXM Modes Configuration",
5
5
  "description": "Declarative major modes and domain modules for selective tool loading and context scoping",
6
6
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/permission-diff.schema.json",
3
+ "$id": "https://schemas.kxm.dev/permission-diff.schema.json",
4
4
  "title": "KXM permission-diff trust report",
5
5
  "description": "Structured, deterministic diff of authority-bearing fields between a trusted base bundle and a candidate bundle.",
6
6
  "type": "object",
@@ -3,10 +3,10 @@
3
3
  `kxm.model.v2` and `kxm.role.v2` here are **passive scaffolding**. They are not
4
4
  operator settings, live registry identities, or admission.
5
5
 
6
- - Live project models remain `kxm.model.v1` under `schemas/vnext/`.
6
+ - Live project models remain `kxm.model.v1` under `schemas/`.
7
7
  - Live CLI roles remain `kxm.role.v1`.
8
8
  - Runner admission remains `.kxm/roster.yaml` via the trusted control Git loader.
9
- - This directory is not discovered as a vNext project resource.
9
+ - This directory is not discovered as a KXM project resource.
10
10
 
11
11
  Pure validation lives in `plugins/kxm/src/policy-draft.mjs`
12
12
  (`validatePolicyDraft`). Callers must supply draft documents, evidence bytes,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/prices.schema.json",
3
+ "$id": "https://schemas.kxm.dev/prices.schema.json",
4
4
  "title": "KXM price catalog",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/project.schema.json",
3
+ "$id": "https://schemas.kxm.dev/project.schema.json",
4
4
  "title": "KXM project definition",
5
5
  "type": "object",
6
6
  "required": ["schema", "id", "name", "repositories"],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/repository.schema.json",
3
+ "$id": "https://schemas.kxm.dev/repository.schema.json",
4
4
  "title": "KXM repository-scoped definition",
5
5
  "type": "object",
6
6
  "required": ["schema", "projectId", "repositoryId"],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/role.schema.json",
3
+ "$id": "https://schemas.kxm.dev/role.schema.json",
4
4
  "title": "KXM role definition",
5
5
  "description": "The filename determines the role identity unless explicitly declared.",
6
6
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/run-event.schema.json",
3
+ "$id": "https://schemas.kxm.dev/run-event.schema.json",
4
4
  "title": "KXM local run event",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/session-brief.schema.json",
3
+ "$id": "https://schemas.kxm.dev/session-brief.schema.json",
4
4
  "title": "KXM session brief",
5
5
  "type": "object",
6
6
  "required": [
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "source": {
30
30
  "type": "string",
31
- "enum": ["legacy", "vnext", "both"]
31
+ "enum": ["legacy", "runtime", "both"]
32
32
  },
33
33
  "hub": {
34
34
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/sync-event.schema.json",
3
+ "$id": "https://schemas.kxm.dev/sync-event.schema.json",
4
4
  "title": "KXM sync-safe run event",
5
5
  "type": "object",
6
6
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/template-provenance.schema.json",
3
+ "$id": "https://schemas.kxm.dev/template-provenance.schema.json",
4
4
  "title": "KXM managed-template provenance v1",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.kxm.dev/vnext/workflow.schema.json",
3
+ "$id": "https://schemas.kxm.dev/workflow.schema.json",
4
4
  "title": "KXM ordered workflow definition",
5
5
  "description": "The filename determines the workflow identity.",
6
6
  "type": "object",
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Build one workspace package to `dist/`.
3
+ *
4
+ * The repo bundles with esbuild everywhere — the CLI, the hub, the extension,
5
+ * and the MCP server — so a package builds with the same bundler and the same
6
+ * Node target. That keeps CI on one toolchain and makes a built package
7
+ * reproducible from the committed sources.
8
+ *
9
+ * Usage: node scripts/build-package.mjs packages/core/kxm-tui
10
+ */
11
+ import { dirname, resolve } from "node:path";
12
+ import { fileURLToPath } from "node:url";
13
+
14
+ const REPOSITORY = resolve(dirname(fileURLToPath(import.meta.url)), "..");
15
+ import { build } from "esbuild";
16
+
17
+ const EXTERNAL = Object.freeze([
18
+ "@earendil-works/pi-tui",
19
+ "@earendil-works/pi-coding-agent",
20
+ "@anthropic-ai/claude-agent-sdk",
21
+ "typebox",
22
+ ]);
23
+
24
+ export async function buildPackage(projectDir, repository = REPOSITORY) {
25
+ const root = resolve(repository);
26
+ const project = resolve(root, projectDir);
27
+ await build({
28
+ absWorkingDir: root,
29
+ entryPoints: [resolve(project, "src/exports/index.ts")],
30
+ bundle: true,
31
+ platform: "node",
32
+ format: "esm",
33
+ target: "node22",
34
+ outfile: resolve(project, "dist/index.js"),
35
+ external: EXTERNAL,
36
+ sourcemap: false,
37
+ });
38
+ return resolve(project, "dist/index.js");
39
+ }
40
+
41
+ // A package script runs with its own directory as cwd, so accept a bare
42
+ // "packages/..." path as well and resolve it against the repository.
43
+ function normalizeProjectPath(value) {
44
+ return value.startsWith("packages/") || value.startsWith("plugins/")
45
+ ? resolve(REPOSITORY, value)
46
+ : resolve(value);
47
+ }
48
+
49
+ const invoked = process.argv[1] ? resolve(process.argv[1]) === fileURLToPath(import.meta.url) : false;
50
+ if (invoked) {
51
+ const target = process.argv[2];
52
+ if (!target) {
53
+ process.stderr.write("usage: node scripts/build-package.mjs <project-dir>\n");
54
+ process.exitCode = 2;
55
+ } else {
56
+ const written = await buildPackage(normalizeProjectPath(target));
57
+ process.stdout.write(`built ${dirname(written).split("/").slice(-2).join("/")}/index.js\n`);
58
+ }
59
+ }
@@ -1,8 +1,9 @@
1
1
  import { readFileSync, writeFileSync } from "node:fs";
2
2
  import { build } from "esbuild";
3
3
 
4
+
4
5
  await build({
5
- entryPoints: ["plugins/kxm/src/cli.ts", "plugins/kxm/src/server.ts", "plugins/kxm/src/vnext-runtime-supervisor.ts"],
6
+ entryPoints: ["plugins/kxm/src/cli.ts", "plugins/kxm/src/server.ts", "plugins/kxm/src/runtime-supervisor.ts"],
6
7
  bundle: true,
7
8
  platform: "node",
8
9
  format: "esm",
@@ -39,7 +40,7 @@ const createRequire = "import { createRequire as __kxmCreateRequire } from 'node
39
40
  for (const bundlePath of [
40
41
  "plugins/kxm/dist/cli.js",
41
42
  "plugins/kxm/dist/server.js",
42
- "plugins/kxm/dist/vnext-runtime-supervisor.js",
43
+ "plugins/kxm/dist/runtime-supervisor.js",
43
44
  ]) {
44
45
  const bundled = readFileSync(bundlePath, "utf8");
45
46
  if (!bundled.startsWith(shebang)) throw new Error(`runtime bundle is missing its executable shebang: ${bundlePath}`);
@@ -10,11 +10,12 @@ export const STATIC_GENERATED_ARTIFACTS = Object.freeze([
10
10
  "plugins/kxm/dist/cli.js",
11
11
  "plugins/kxm/dist/server.js",
12
12
  "plugins/kxm/dist/mcp-server.js",
13
- "plugins/kxm/dist/vnext-runtime-supervisor.js",
13
+ "plugins/kxm/dist/runtime-supervisor.js",
14
14
  "plugins/kxm/dist/core.js",
15
15
  "plugins/kxm/dist/runtime.js",
16
16
  "plugins/kxm/dist/client.js",
17
17
  "plugins/kxm/dist/extension.js",
18
+ "packages/core/tui/dist/index.js",
18
19
  "AGENTS.md",
19
20
  "CLAUDE.md",
20
21
  "GEMINI.md",
@@ -1,4 +1,6 @@
1
1
  import { readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { workspaceManifestPaths } from "./package-surfaces.mjs";
2
4
 
3
5
  async function json(path) {
4
6
  return JSON.parse(await readFile(path, "utf8"));
@@ -23,6 +25,15 @@ const versions = new Map([
23
25
  ["MCP server", mcpVersion],
24
26
  ]);
25
27
 
28
+ // Which directories count as packages is shared with scripts/kxm-bump-version.mjs
29
+ // on purpose: the gate and the release writer must not disagree. Paths come
30
+ // back POSIX-style, which is also how package-lock.json keys its `packages` map.
31
+ for (const relativePath of workspaceManifestPaths(".")) {
32
+ const manifest = await json(join(relativePath, "package.json"));
33
+ versions.set(`${manifest.name} package`, manifest.version);
34
+ versions.set(`${manifest.name} lock entry`, lock.packages?.[relativePath]?.version);
35
+ }
36
+
26
37
  const failures = [...versions].filter(([, version]) => version !== root.version);
27
38
  if (failures.length > 0) {
28
39
  for (const [name, version] of failures) {
@@ -30,5 +41,5 @@ if (failures.length > 0) {
30
41
  }
31
42
  process.exitCode = 1;
32
43
  } else {
33
- process.stdout.write(`all package surfaces use version ${root.version}\n`);
44
+ process.stdout.write(`all package surfaces use version ${root.version} (${versions.size} checked)\n`);
34
45
  }