@kontextmind/kxm 0.7.122 → 0.7.123
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 +11 -0
- package/docs/architecture/access-schema.yaml +60 -0
- package/docs/architecture/access.md +33 -0
- package/docs/architecture/agent-path.md +36 -0
- package/docs/architecture/authentication.md +29 -0
- package/docs/architecture/hosted-direction.md +59 -0
- package/docs/architecture/index.md +19 -0
- package/docs/architecture/inventory.md +38 -0
- package/docs/architecture/platform.md +48 -0
- package/docs/assets/logo.png +0 -0
- package/docs/index.md +56 -0
- package/docs/javascripts/mermaid-init.js +83 -0
- package/docs/javascripts/mermaid.min.js +4376 -0
- package/docs/reference/cli-reference.md +56 -3
- package/docs/robots.txt +44 -0
- package/docs/stylesheets/extra.css +100 -0
- package/package.json +1 -1
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/dist/cli.js +241 -160
- package/plugins/kxm/dist/mcp-server.js +1 -1
- package/plugins/kxm/package.json +1 -1
- package/plugins/kxm/skills/kxm/SKILL.md +1 -2
- package/plugins/kxm/skills/kxm-runs/SKILL.md +7 -0
- package/plugins/kxm/src/cli/docs.ts +78 -0
- package/plugins/kxm/src/cli.ts +14 -0
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/schemas/roadmap-state.schema.json +147 -0
|
@@ -17313,7 +17313,7 @@ function sessionTokenFixHint(policy) {
|
|
|
17313
17313
|
}
|
|
17314
17314
|
|
|
17315
17315
|
// plugins/kxm/src/mcp-server.ts
|
|
17316
|
-
var VERSION = "0.7.
|
|
17316
|
+
var VERSION = "0.7.123";
|
|
17317
17317
|
var CONFIGURE_PLUGIN = "/plugin configure kxm@kxm";
|
|
17318
17318
|
var inbox = /* @__PURE__ */ new Map();
|
|
17319
17319
|
var notifiedInbox = /* @__PURE__ */ new Set();
|
package/plugins/kxm/package.json
CHANGED
|
@@ -20,8 +20,7 @@ writers, or replace `.kxm/roster.yaml` trusted policy.
|
|
|
20
20
|
| Delegate to or answer another agent | `kxm-peer` | `peer` (`peer await` is capped at 60 seconds) |
|
|
21
21
|
| Work inside a durable workflow run, gates, signed callbacks | `kxm-workflow` | `workflow`, `gate` |
|
|
22
22
|
| Role definitions, role hosts, model rosters | `kxm-definitions` | `role` |
|
|
23
|
-
| Create, drive, inspect, or cancel a run, use a worktree lane,
|
|
24
|
-
| Create, drive, inspect, or cancel a run, use a worktree lane, or run the developer assignment loop | `kxm-runs` | `run`, `runs`, `lane`, `assign` |
|
|
23
|
+
| Create, drive, inspect, or cancel a run, use a worktree lane, land a branch, run the developer assignment loop, or build and serve the docs site | `kxm-runs` | `run`, `runs`, `lane`, `land`, `assign`, `docs` |
|
|
25
24
|
| What we know or decided, recall, context footprint, Git memory | `kxm-context-memory` | `context`, `memory`, `explain` |
|
|
26
25
|
| Turn a repeated practice into a governed skill | `kxm-skill-lifecycle` | `skills` |
|
|
27
26
|
| What KXM learned, repeated asks, recorded route spend | `kxm-routing-improve` | `routing`, `improve` |
|
|
@@ -11,6 +11,11 @@ the Runtime supervisor. A created run stays `created` until
|
|
|
11
11
|
an admitted model; `--simulated` is the model-free producer. Do not invent get,
|
|
12
12
|
create, or logs verbs under `runs`.
|
|
13
13
|
|
|
14
|
+
`kxm docs build` regenerates the docs site from the roadmap state by running
|
|
15
|
+
`node plans/kxm-roadmap/update-dashboard.mjs` at the project root. `kxm docs
|
|
16
|
+
serve` serves that site with `python3 ops/docs-site/serve.py` and passes
|
|
17
|
+
`--port` through when it is set. Both require a KXM project.
|
|
18
|
+
|
|
14
19
|
## Commands
|
|
15
20
|
|
|
16
21
|
| Command | Purpose | Options / arguments |
|
|
@@ -34,6 +39,8 @@ create, or logs verbs under `runs`.
|
|
|
34
39
|
| `kxm assign observe-cost` | Import one cost-only observation | `--task-dir <path>`, `--input <path>` |
|
|
35
40
|
| `kxm assign accept` | Bind a witnessed commit and two critic records | `--task-dir <path>`, `--commit <sha>`, `--record-dir <path>`, `--critic <path>` twice, optional `--observed-pr <id>`, `--observed-ci <id>` |
|
|
36
41
|
| `kxm assign change-report` | Report attempts, rework, and spend | `--task-dir <path>` |
|
|
42
|
+
| `kxm docs build` | Regenerate the docs site from roadmap state | `--dry-run`, `--json` |
|
|
43
|
+
| `kxm docs serve` | Serve the built site on the tailnet address | `--port <port>`, `--dry-run`, `--json` |
|
|
37
44
|
|
|
38
45
|
The run record and its events keep only the prompt's hash, but the full
|
|
39
46
|
prompt text is kept in a local `run-events.db.run-prompts.json` file (mode
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { discoverKxmProjectRoot } from "../project-config.ts";
|
|
5
|
+
import { print, type Runtime } from "./types.ts";
|
|
6
|
+
|
|
7
|
+
const GENERATOR = "plans/kxm-roadmap/update-dashboard.mjs";
|
|
8
|
+
const SERVER = "ops/docs-site/serve.py";
|
|
9
|
+
|
|
10
|
+
function requireProject(runtime: Runtime, command: string): string | number {
|
|
11
|
+
const root = discoverKxmProjectRoot(runtime.cwd);
|
|
12
|
+
if (!root) {
|
|
13
|
+
print(
|
|
14
|
+
runtime.io,
|
|
15
|
+
runtime.json,
|
|
16
|
+
{ ok: false, command, error: "project_required" },
|
|
17
|
+
`kxm ${command} requires a KXM project (run kxm init first)`,
|
|
18
|
+
);
|
|
19
|
+
return 1;
|
|
20
|
+
}
|
|
21
|
+
return root;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function requireFile(runtime: Runtime, command: string, root: string, relative: string, error: string): string | number {
|
|
25
|
+
const file = join(root, relative);
|
|
26
|
+
if (existsSync(file)) return file;
|
|
27
|
+
print(
|
|
28
|
+
runtime.io,
|
|
29
|
+
runtime.json,
|
|
30
|
+
{ ok: false, command, error, path: relative },
|
|
31
|
+
`kxm ${command} requires ${relative}`,
|
|
32
|
+
);
|
|
33
|
+
return 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function printCommand(runtime: Runtime, command: string, line: string): number {
|
|
37
|
+
print(
|
|
38
|
+
runtime.io,
|
|
39
|
+
runtime.json,
|
|
40
|
+
{ ok: true, command, dryRun: true, detail: line },
|
|
41
|
+
line,
|
|
42
|
+
);
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function runInherited(command: string, args: readonly string[], cwd: string): Promise<number> {
|
|
47
|
+
return new Promise((resolveExit) => {
|
|
48
|
+
const child = spawn(command, [...args], { cwd, stdio: "inherit" });
|
|
49
|
+
child.once("error", () => resolveExit(1));
|
|
50
|
+
child.once("exit", (code) => resolveExit(code ?? 1));
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Regenerate the docs site from the roadmap state. */
|
|
55
|
+
export async function cmdDocsBuild(runtime: Runtime): Promise<number> {
|
|
56
|
+
const command = "docs build";
|
|
57
|
+
const root = requireProject(runtime, command);
|
|
58
|
+
if (typeof root === "number") return root;
|
|
59
|
+
const file = requireFile(runtime, command, root, GENERATOR, "docs_generator_missing");
|
|
60
|
+
if (typeof file === "number") return file;
|
|
61
|
+
const line = `node ${GENERATOR}`;
|
|
62
|
+
if (runtime.dryRun) return printCommand(runtime, command, line);
|
|
63
|
+
return runInherited(process.execPath, [file], root);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Serve the built site. `--port` is passed through when set. */
|
|
67
|
+
export async function cmdDocsServe(runtime: Runtime, options: { port?: string } = {}): Promise<number> {
|
|
68
|
+
const command = "docs serve";
|
|
69
|
+
const root = requireProject(runtime, command);
|
|
70
|
+
if (typeof root === "number") return root;
|
|
71
|
+
const file = requireFile(runtime, command, root, SERVER, "docs_server_missing");
|
|
72
|
+
if (typeof file === "number") return file;
|
|
73
|
+
const args = [file];
|
|
74
|
+
if (options.port !== undefined && options.port !== "") args.push("--port", options.port);
|
|
75
|
+
const line = ["python3", SERVER, ...args.slice(1)].join(" ");
|
|
76
|
+
if (runtime.dryRun) return printCommand(runtime, command, line);
|
|
77
|
+
return runInherited("python3", args, root);
|
|
78
|
+
}
|
package/plugins/kxm/src/cli.ts
CHANGED
|
@@ -120,6 +120,7 @@ cmdBackup,
|
|
|
120
120
|
} from "./cli/project.ts";
|
|
121
121
|
|
|
122
122
|
import { cmdPluginInstall } from "./cli/plugins.ts";
|
|
123
|
+
import { cmdDocsBuild, cmdDocsServe } from "./cli/docs.ts";
|
|
123
124
|
|
|
124
125
|
import {
|
|
125
126
|
applyLane,
|
|
@@ -227,6 +228,7 @@ const DRY_RUN_COMMANDS: ReadonlySet<string> = new Set([
|
|
|
227
228
|
"goal create", "goal list",
|
|
228
229
|
"task create", "task list", "task get", "task run", "task sync",
|
|
229
230
|
"studio layout", "studio serve",
|
|
231
|
+
"docs build", "docs serve",
|
|
230
232
|
]);
|
|
231
233
|
|
|
232
234
|
class DryRunRefused extends Error {
|
|
@@ -625,6 +627,18 @@ function createProgram(ctx: CliContext, result: { code: number }): Command {
|
|
|
625
627
|
result.code = await cmdKxmRunList(runtimeFrom(ctx, this));
|
|
626
628
|
});
|
|
627
629
|
|
|
630
|
+
const docsCmd = addGlobalOptions(program.command("docs").description("Build and serve the tailnet docs site"));
|
|
631
|
+
docsCmd.helpCommand("help", "Show docs help");
|
|
632
|
+
addGlobalOptions(docsCmd.command("build").description("Regenerate the docs site from the roadmap state"))
|
|
633
|
+
.action(async function docsBuildAction(this: Command) {
|
|
634
|
+
result.code = await cmdDocsBuild(runtimeFrom(ctx, this));
|
|
635
|
+
});
|
|
636
|
+
addGlobalOptions(docsCmd.command("serve").description("Serve the built docs site on this machine's tailnet address"))
|
|
637
|
+
.option("--port <port>", "Port passed through to the docs server")
|
|
638
|
+
.action(async function docsServeAction(this: Command, options: { port?: string }) {
|
|
639
|
+
result.code = await cmdDocsServe(runtimeFrom(ctx, this), options);
|
|
640
|
+
});
|
|
641
|
+
|
|
628
642
|
const tenantCmd = addGlobalOptions(program.command("tenant").description("Composed tenant reads for machine clients (portal)"));
|
|
629
643
|
tenantCmd.helpCommand("help", "Show tenant help");
|
|
630
644
|
addGlobalOptions(tenantCmd.command("status").description("Read hub metadata and authoritative Runtime run state as one labeled view"))
|
|
@@ -11,7 +11,7 @@ import { deliverInboxNotification } from "./inbox.ts";
|
|
|
11
11
|
import type { HubEvent, MessageRecord } from "./protocol.ts";
|
|
12
12
|
import { sessionTokenFixHint } from "./session-token-hint.ts";
|
|
13
13
|
|
|
14
|
-
const VERSION = "0.7.
|
|
14
|
+
const VERSION = "0.7.123";
|
|
15
15
|
const CONFIGURE_PLUGIN = "/plugin configure kxm@kxm";
|
|
16
16
|
const inbox = new Map<string, MessageRecord>();
|
|
17
17
|
const notifiedInbox = new Set<string>();
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kxm.dev/roadmap-state.schema.json",
|
|
4
|
+
"title": "KXM roadmap state",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema", "updated", "goal", "phases"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema": { "const": "kxm.roadmap.v1" },
|
|
10
|
+
"updated": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" },
|
|
11
|
+
"goal": { "type": "string", "minLength": 1 },
|
|
12
|
+
"constraints": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"items": { "type": "string" }
|
|
15
|
+
},
|
|
16
|
+
"contacts": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"items": { "$ref": "#/$defs/contact" }
|
|
19
|
+
},
|
|
20
|
+
"contacts_comment": { "type": "string" },
|
|
21
|
+
"history": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"description": "Oldest first. The generator keeps the newest 12 lines and drops the older ones (history_over_cap). That prune is not a schema refusal.",
|
|
24
|
+
"items": { "$ref": "#/$defs/historyLine" }
|
|
25
|
+
},
|
|
26
|
+
"architecture": { "$ref": "#/$defs/architecture" },
|
|
27
|
+
"improvements": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": { "type": "string" }
|
|
30
|
+
},
|
|
31
|
+
"phases": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": { "$ref": "#/$defs/phase" }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"$defs": {
|
|
37
|
+
"date": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" },
|
|
38
|
+
"historyLine": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["date", "line"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"date": { "$ref": "#/$defs/date" },
|
|
44
|
+
"line": { "type": "string", "minLength": 1, "maxLength": 240 }
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"contact": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"required": ["role", "confirmed"],
|
|
51
|
+
"properties": {
|
|
52
|
+
"role": { "type": "string", "minLength": 1 },
|
|
53
|
+
"name": { "type": "string", "minLength": 1 },
|
|
54
|
+
"confirmed": { "$ref": "#/$defs/date" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"architecture": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"properties": {
|
|
61
|
+
"verified": {
|
|
62
|
+
"anyOf": [
|
|
63
|
+
{ "type": "null" },
|
|
64
|
+
{ "$ref": "#/$defs/date" }
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"docs": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": { "type": "string" }
|
|
70
|
+
},
|
|
71
|
+
"drift": {
|
|
72
|
+
"type": "array",
|
|
73
|
+
"items": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"required": ["claim", "page", "status"],
|
|
77
|
+
"properties": {
|
|
78
|
+
"claim": { "type": "string" },
|
|
79
|
+
"page": { "type": "string" },
|
|
80
|
+
"status": { "type": "string" }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"phase": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"additionalProperties": false,
|
|
89
|
+
"required": ["id", "slug", "title", "goal", "source", "tasks"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"id": { "type": "string", "minLength": 1 },
|
|
92
|
+
"slug": { "type": "string", "minLength": 1 },
|
|
93
|
+
"title": { "type": "string", "minLength": 1 },
|
|
94
|
+
"goal": { "type": "string", "minLength": 1 },
|
|
95
|
+
"source": { "type": "string", "minLength": 1 },
|
|
96
|
+
"priority": { "const": "later" },
|
|
97
|
+
"horizon": {
|
|
98
|
+
"description": "Derived by the generator from phase order and priority (next, soon, or later). Not hand-set. A stored value is ignored.",
|
|
99
|
+
"enum": ["next", "soon", "later"]
|
|
100
|
+
},
|
|
101
|
+
"blockers": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": { "type": "string" }
|
|
104
|
+
},
|
|
105
|
+
"questions": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"items": { "type": "string" }
|
|
108
|
+
},
|
|
109
|
+
"tasks": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": { "$ref": "#/$defs/task" }
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"task": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"required": ["id", "title", "status"],
|
|
119
|
+
"properties": {
|
|
120
|
+
"id": { "type": "string", "minLength": 1 },
|
|
121
|
+
"title": { "type": "string", "minLength": 1 },
|
|
122
|
+
"status": { "enum": ["open", "done"] },
|
|
123
|
+
"evidence": { "type": "string" },
|
|
124
|
+
"planSection": { "type": "string", "minLength": 1 },
|
|
125
|
+
"doneCriterion": { "type": "string", "minLength": 1 },
|
|
126
|
+
"evidenceNeeded": { "type": "string", "minLength": 1 },
|
|
127
|
+
"template": {
|
|
128
|
+
"enum": [
|
|
129
|
+
"feature",
|
|
130
|
+
"research",
|
|
131
|
+
"bug-fix",
|
|
132
|
+
"architecture",
|
|
133
|
+
"adr",
|
|
134
|
+
"test-plan",
|
|
135
|
+
"test-report",
|
|
136
|
+
"review",
|
|
137
|
+
"handoff",
|
|
138
|
+
"runbook",
|
|
139
|
+
"postmortem",
|
|
140
|
+
"none"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"detail": { "enum": ["brief", "scoped", "ready"] }
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|