@kontextmind/kxm 0.7.40 → 0.7.44
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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +45 -7
- package/docs/README.md +5 -3
- package/docs/agent-skills.md +1 -1
- package/docs/architecture.md +1 -1
- package/docs/configuration.md +28 -5
- package/docs/{vnext → contracts}/README.md +7 -7
- package/docs/{vnext → contracts}/architecture.md +2 -2
- package/docs/{vnext → contracts}/migration.md +25 -25
- package/docs/{vnext → contracts}/routing.md +2 -2
- package/docs/{vnext → contracts}/synchronization.md +1 -1
- package/docs/{vnext → contracts}/validation.md +7 -7
- package/docs/getting-started.md +1 -1
- package/docs/kb/qa-authentik-authentication.md +47 -0
- package/docs/kb/qa-extension-install-and-hub-bootstrap.md +68 -0
- package/docs/kb/qa-hub-on-a-public-host.md +31 -0
- package/docs/kb/qa-sqlite-vs-duckdb.md +18 -0
- package/docs/kb/qa-what-the-hub-stores.md +47 -0
- package/docs/packages.md +91 -0
- package/docs/templates/architecture.md +1 -1
- package/docs/test-matrix.md +6 -6
- package/docs/tui-components.md +131 -0
- package/examples/README.md +2 -2
- package/examples/{vnext → project}/.kxm/agents/critic-3.yaml +1 -1
- package/examples/{vnext → project}/README.md +4 -4
- package/package.json +18 -8
- package/packages/core/tui/CHANGELOG.md +19 -0
- package/packages/core/tui/LICENSE +21 -0
- package/packages/core/tui/README.md +45 -0
- package/packages/core/tui/dist/index.js +1439 -0
- package/packages/core/tui/src/adapters/pi.ts +73 -0
- package/packages/core/tui/src/adapters/terminal.ts +106 -0
- package/packages/core/tui/src/exports/index.ts +30 -0
- package/packages/core/tui/src/services/registry.ts +274 -0
- package/packages/core/tui/src/tui/keys.ts +130 -0
- package/packages/core/tui/src/tui/layout.ts +117 -0
- package/packages/core/tui/src/tui/panel.ts +435 -0
- package/packages/core/tui/src/tui/panelComponent.ts +208 -0
- package/packages/core/tui/src/tui/render.ts +309 -0
- package/packages/core/tui/src/tui/theme.ts +145 -0
- package/packages/core/tui/src/types/surface.ts +407 -0
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/dist/cli.js +681 -553
- package/plugins/kxm/dist/extension.js +18 -18
- package/plugins/kxm/dist/mcp-server.js +1 -1
- package/plugins/kxm/dist/{vnext-runtime-supervisor.js → runtime-supervisor.js} +553 -553
- package/plugins/kxm/dist/runtime.js +608 -608
- package/plugins/kxm/dist/server.js +13 -13
- package/plugins/kxm/package.json +2 -2
- package/plugins/kxm/skills/kxm-project-setup/SKILL.md +2 -2
- package/plugins/kxm/skills/kxm-runs/SKILL.md +3 -3
- package/plugins/kxm/skills/kxm-session/SKILL.md +1 -1
- package/plugins/kxm/skills/kxm-workflow/SKILL.md +1 -1
- package/plugins/kxm/src/autocomplete.ts +4 -4
- package/plugins/kxm/src/{vnext-bindings.ts → bindings.ts} +48 -48
- package/plugins/kxm/src/cli/hub.ts +3 -3
- package/plugins/kxm/src/cli/{vnext.ts → project.ts} +106 -106
- package/plugins/kxm/src/cli/roles.ts +9 -9
- package/plugins/kxm/src/cli/system.ts +2 -2
- package/plugins/kxm/src/cli/tasks.ts +8 -8
- package/plugins/kxm/src/cli/workflows.ts +8 -8
- package/plugins/kxm/src/cli.ts +47 -47
- package/plugins/kxm/src/config.ts +69 -14
- package/plugins/kxm/src/database.ts +4 -4
- package/plugins/kxm/src/{vnext-engine-artifacts.ts → engine-artifacts.ts} +7 -7
- package/plugins/kxm/src/{vnext-engine-command.ts → engine-command.ts} +40 -40
- package/plugins/kxm/src/{vnext-engine-compile.ts → engine-compile.ts} +64 -64
- package/plugins/kxm/src/{vnext-engine-evidence.ts → engine-evidence.ts} +26 -26
- package/plugins/kxm/src/{vnext-engine-fold.ts → engine-fold.ts} +99 -99
- package/plugins/kxm/src/{vnext-engine-gate-records.ts → engine-gate-records.ts} +105 -105
- package/plugins/kxm/src/{vnext-engine-plan.ts → engine-plan.ts} +69 -69
- package/plugins/kxm/src/{vnext-engine.ts → engine.ts} +502 -502
- package/plugins/kxm/src/gate-hash.ts +10 -0
- package/plugins/kxm/src/{vnext-harness.ts → harness.ts} +1 -1
- package/plugins/kxm/src/hub.ts +1 -1
- package/plugins/kxm/src/init-guide-setup.ts +3 -3
- package/plugins/kxm/src/{vnext-init.ts → init.ts} +93 -93
- package/plugins/kxm/src/kxm-install-kind.ts +1 -1
- package/plugins/kxm/src/kxm-update-config.ts +2 -2
- package/plugins/kxm/src/local-snapshot.ts +23 -23
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/plugins/kxm/src/{vnext-migrate.ts → migrate.ts} +123 -123
- package/plugins/kxm/src/model-inventory.ts +1 -1
- package/plugins/kxm/src/{vnext-oneshot-evidence.ts → oneshot-evidence.ts} +2 -2
- package/plugins/kxm/src/{vnext-oneshot-process.ts → oneshot-process.ts} +4 -4
- package/plugins/kxm/src/{vnext-oneshot-producer.ts → oneshot-producer.ts} +24 -24
- package/plugins/kxm/src/{vnext-permission.ts → permission.ts} +86 -86
- package/plugins/kxm/src/{vnext-pi-producer.ts → pi-producer.ts} +13 -13
- package/plugins/kxm/src/{vnext-config.ts → project-config.ts} +177 -177
- package/plugins/kxm/src/{vnext-repair.ts → repair.ts} +159 -159
- package/plugins/kxm/src/restricted-yaml.d.mts +3 -3
- package/plugins/kxm/src/restricted-yaml.mjs +4 -4
- package/plugins/kxm/src/{vnext-runtime-owner.ts → runtime-owner.ts} +35 -35
- package/plugins/kxm/src/{vnext-runtime.ts → runtime-service.ts} +136 -136
- package/plugins/kxm/src/{vnext-runtime-store.ts → runtime-store.ts} +145 -145
- package/plugins/kxm/src/{vnext-runtime-supervisor.ts → runtime-supervisor.ts} +80 -80
- package/plugins/kxm/src/runtime.ts +6 -6
- package/plugins/kxm/src/session-work.ts +3 -3
- package/plugins/kxm/src/studio-layout.ts +6 -6
- package/plugins/kxm/src/{vnext-template.ts → template.ts} +33 -33
- package/plugins/kxm/src/tui.ts +10 -24
- package/schemas/{vnext/README.md → README.md} +3 -3
- package/schemas/{vnext/agent.schema.json → agent.schema.json} +1 -1
- package/schemas/{vnext/assignment-result.schema.json → assignment-result.schema.json} +1 -1
- package/schemas/{vnext/backup-manifest.schema.json → backup-manifest.schema.json} +1 -1
- package/schemas/{vnext/candidate.schema.json → candidate.schema.json} +1 -1
- package/schemas/{vnext/common.schema.json → common.schema.json} +2 -2
- package/schemas/{vnext/context-candidate.schema.json → context-candidate.schema.json} +1 -1
- package/schemas/{vnext/context-packet.schema.json → context-packet.schema.json} +1 -1
- package/schemas/{vnext/delivery-manifest.schema.json → delivery-manifest.schema.json} +1 -1
- package/schemas/{vnext/drive-receipt.schema.json → drive-receipt.schema.json} +2 -2
- package/schemas/{vnext/environment.schema.json → environment.schema.json} +1 -1
- package/schemas/{vnext/gate-registry.schema.json → gate-registry.schema.json} +1 -1
- package/schemas/{vnext/handoff-manifest.schema.json → handoff-manifest.schema.json} +1 -1
- package/schemas/{vnext/init-operation.schema.json → init-operation.schema.json} +1 -1
- package/schemas/{vnext/local-repository-bindings.schema.json → local-repository-bindings.schema.json} +1 -1
- package/schemas/{vnext/memory-record.schema.json → memory-record.schema.json} +1 -1
- package/schemas/{vnext/migration-decision.schema.json → migration-decision.schema.json} +1 -1
- package/schemas/{vnext/migration-plan.schema.json → migration-plan.schema.json} +1 -1
- package/schemas/{vnext/migration-receipt.schema.json → migration-receipt.schema.json} +1 -1
- package/schemas/{vnext/model.schema.json → model.schema.json} +1 -1
- package/schemas/{vnext/modes.schema.json → modes.schema.json} +1 -1
- package/schemas/{vnext/permission-diff.schema.json → permission-diff.schema.json} +1 -1
- package/schemas/policy-draft/README.md +2 -2
- package/schemas/{vnext/prices.schema.json → prices.schema.json} +1 -1
- package/schemas/{vnext/project.schema.json → project.schema.json} +1 -1
- package/schemas/{vnext/repository.schema.json → repository.schema.json} +1 -1
- package/schemas/{vnext/role.schema.json → role.schema.json} +1 -1
- package/schemas/{vnext/run-event.schema.json → run-event.schema.json} +1 -1
- package/schemas/{vnext/session-brief.schema.json → session-brief.schema.json} +2 -2
- package/schemas/{vnext/sync-event.schema.json → sync-event.schema.json} +1 -1
- package/schemas/{vnext/template-provenance.schema.json → template-provenance.schema.json} +1 -1
- package/schemas/{vnext/workflow.schema.json → workflow.schema.json} +1 -1
- package/scripts/build-package.mjs +59 -0
- package/scripts/build-runtime.mjs +3 -2
- package/scripts/check-generated.mjs +2 -1
- package/scripts/check-versions.mjs +12 -1
- package/scripts/docker-install-smoke.mjs +268 -0
- package/scripts/emit-codex-artifacts.mjs +1 -1
- package/scripts/kxm-bump-version.mjs +53 -3
- package/scripts/kxm-hub.mjs +36 -0
- package/scripts/kxm-runtime-supervisor.mjs +3 -3
- package/scripts/package-surfaces.mjs +39 -0
- package/plugins/kxm/src/vnext-gate-hash.ts +0 -10
- /package/docs/{vnext → contracts}/effects-and-recovery.md +0 -0
- /package/docs/{vnext → contracts}/lifecycles.md +0 -0
- /package/docs/{vnext → contracts}/terminology.md +0 -0
- /package/examples/{vnext → project}/.kxm/agents/coordinator.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/critic-1.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/critic-2.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/implementer.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/planner.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/reproducer.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/reviewer.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/gates.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/models/critic-claude.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/models/critic-gemini.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/models/critic-grok.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/models/implementation.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/models/primary.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/prices.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/project/env.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/project.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/repo/repo.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/workflows/default.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/workflows/fix.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/workflows/improve.yaml +0 -0
- /package/examples/{vnext → project}/records/assignment-result-recorded.json +0 -0
- /package/examples/{vnext → project}/records/assignment-result.json +0 -0
- /package/examples/{vnext → project}/records/context-candidate.json +0 -0
- /package/examples/{vnext → project}/records/delivery-manifest.json +0 -0
- /package/examples/{vnext → project}/records/effect-uncertainty-resolved-sync.json +0 -0
- /package/examples/{vnext → project}/records/effect-uncertainty-resolved.json +0 -0
- /package/examples/{vnext → project}/records/run-created.json +0 -0
- /package/examples/{vnext → project}/records/sync-event.json +0 -0
- /package/examples/{vnext → project}/repositories/api/.kxm/repo/env.yaml +0 -0
- /package/examples/{vnext → project}/repositories/api/.kxm/repo/repo.yaml +0 -0
- /package/examples/{vnext → project}/repositories/web/.kxm/repo/repo.yaml +0 -0
package/plugins/kxm/src/tui.ts
CHANGED
|
@@ -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
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
-
|
|
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 !== "
|
|
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 = `
|
|
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: "
|
|
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
|
|
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
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
4
|
-
"title": "KXM
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
4
|
-
"title": "KXM
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
|
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
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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", "
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
}
|