@kontextmind/kxm 0.6.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.
- package/.claude-plugin/marketplace.json +19 -0
- package/.kxm/README.md +14 -0
- package/.kxm/assets/README.md +5 -0
- package/.kxm/assets/retrospectives/README.md +5 -0
- package/.kxm/config/README.md +5 -0
- package/.kxm/config/agents.json +43 -0
- package/.kxm/config/env.example +56 -0
- package/.kxm/config/update.example.yaml +9 -0
- package/.kxm/config/workflows/fix.json +160 -0
- package/.kxm/config/workflows/jira-development.json +116 -0
- package/.kxm/config/workflows/provenance-quorum.json +150 -0
- package/.kxm/config/workflows/v04-dogfood.json +72 -0
- package/CHANGELOG.md +465 -0
- package/LICENSE +21 -0
- package/README.md +306 -0
- package/SECURITY.md +72 -0
- package/docs/README.md +48 -0
- package/docs/agent-communication-envelopes-and-gates.md +553 -0
- package/docs/architecture.md +242 -0
- package/docs/assignment-runner.md +241 -0
- package/docs/configuration.md +361 -0
- package/docs/continuous-improvement.md +114 -0
- package/docs/getting-started.md +253 -0
- package/docs/kxm-handbook.md +1090 -0
- package/docs/operations.md +205 -0
- package/docs/provenance-gates.md +291 -0
- package/docs/skills.md +45 -0
- package/docs/templates/README.md +95 -0
- package/docs/templates/adr.md +88 -0
- package/docs/templates/architecture.md +120 -0
- package/docs/templates/bug-fix.md +109 -0
- package/docs/templates/feature.md +108 -0
- package/docs/templates/handoff.md +72 -0
- package/docs/templates/postmortem.md +77 -0
- package/docs/templates/research.md +100 -0
- package/docs/templates/review.md +85 -0
- package/docs/templates/runbook.md +73 -0
- package/docs/templates/test-plan.md +87 -0
- package/docs/templates/test-report.md +72 -0
- package/docs/test-matrix.md +121 -0
- package/docs/troubleshooting.md +249 -0
- package/docs/vnext/README.md +62 -0
- package/docs/vnext/architecture.md +185 -0
- package/docs/vnext/effects-and-recovery.md +172 -0
- package/docs/vnext/lifecycles.md +235 -0
- package/docs/vnext/migration.md +220 -0
- package/docs/vnext/routing.md +184 -0
- package/docs/vnext/synchronization.md +172 -0
- package/docs/vnext/terminology.md +240 -0
- package/docs/vnext/validation.md +335 -0
- package/docs/webhook-workflows.md +240 -0
- package/docs/workflow-guide.md +1150 -0
- package/examples/README.md +102 -0
- package/examples/provenance-workflow.json +40 -0
- package/examples/requester.ts +30 -0
- package/examples/reviewer-agent.ts +29 -0
- package/examples/roundtrip.ts +46 -0
- package/examples/vnext/.kxm/agents/coordinator.yaml +16 -0
- package/examples/vnext/.kxm/agents/critic-1.yaml +16 -0
- package/examples/vnext/.kxm/agents/critic-2.yaml +15 -0
- package/examples/vnext/.kxm/agents/critic-3.yaml +15 -0
- package/examples/vnext/.kxm/agents/implementer.yaml +15 -0
- package/examples/vnext/.kxm/agents/planner.yaml +13 -0
- package/examples/vnext/.kxm/agents/reproducer.yaml +15 -0
- package/examples/vnext/.kxm/agents/reviewer.yaml +15 -0
- package/examples/vnext/.kxm/gates.yaml +8 -0
- package/examples/vnext/.kxm/models/critic-claude.yaml +11 -0
- package/examples/vnext/.kxm/models/critic-gemini.yaml +11 -0
- package/examples/vnext/.kxm/models/critic-grok.yaml +12 -0
- package/examples/vnext/.kxm/models/implementation.yaml +14 -0
- package/examples/vnext/.kxm/models/primary.yaml +17 -0
- package/examples/vnext/.kxm/prices.yaml +111 -0
- package/examples/vnext/.kxm/project/env.yaml +7 -0
- package/examples/vnext/.kxm/project.yaml +32 -0
- package/examples/vnext/.kxm/repo/repo.yaml +8 -0
- package/examples/vnext/.kxm/workflows/default.yaml +92 -0
- package/examples/vnext/.kxm/workflows/fix.yaml +376 -0
- package/examples/vnext/.kxm/workflows/improve.yaml +57 -0
- package/examples/vnext/README.md +53 -0
- package/examples/vnext/records/assignment-result-recorded.json +63 -0
- package/examples/vnext/records/assignment-result.json +46 -0
- package/examples/vnext/records/context-candidate.json +42 -0
- package/examples/vnext/records/delivery-manifest.json +66 -0
- package/examples/vnext/records/effect-uncertainty-resolved-sync.json +67 -0
- package/examples/vnext/records/effect-uncertainty-resolved.json +62 -0
- package/examples/vnext/records/run-created.json +54 -0
- package/examples/vnext/records/sync-event.json +65 -0
- package/examples/vnext/repositories/api/.kxm/repo/env.yaml +7 -0
- package/examples/vnext/repositories/api/.kxm/repo/repo.yaml +8 -0
- package/examples/vnext/repositories/web/.kxm/repo/repo.yaml +8 -0
- package/examples/workflow-signal.ts +63 -0
- package/package.json +129 -0
- package/plugins/kxm/.claude-plugin/plugin.json +73 -0
- package/plugins/kxm/.mcp.json +19 -0
- package/plugins/kxm/README.md +93 -0
- package/plugins/kxm/dist/cli.js +42853 -0
- package/plugins/kxm/dist/client.js +416 -0
- package/plugins/kxm/dist/core.js +1823 -0
- package/plugins/kxm/dist/extension.js +3797 -0
- package/plugins/kxm/dist/mcp-server.js +17104 -0
- package/plugins/kxm/dist/runtime.js +23361 -0
- package/plugins/kxm/dist/server.js +13640 -0
- package/plugins/kxm/dist/vnext-runtime-supervisor.js +21109 -0
- package/plugins/kxm/package.json +12 -0
- package/plugins/kxm/skills/kxm/SKILL.md +97 -0
- package/plugins/kxm/skills/kxm/references/protocol.md +103 -0
- package/plugins/kxm/skills/kxm-session/SKILL.md +53 -0
- package/plugins/kxm/src/arbiter.ts +355 -0
- package/plugins/kxm/src/artifacts-exist.ts +62 -0
- package/plugins/kxm/src/autocomplete.ts +236 -0
- package/plugins/kxm/src/cli.ts +3707 -0
- package/plugins/kxm/src/client.ts +614 -0
- package/plugins/kxm/src/commands.ts +1063 -0
- package/plugins/kxm/src/config.ts +290 -0
- package/plugins/kxm/src/context/providers.ts +101 -0
- package/plugins/kxm/src/context-packet.ts +332 -0
- package/plugins/kxm/src/context.ts +499 -0
- package/plugins/kxm/src/core.ts +6 -0
- package/plugins/kxm/src/database.ts +563 -0
- package/plugins/kxm/src/diagnostics.ts +184 -0
- package/plugins/kxm/src/envelope.ts +118 -0
- package/plugins/kxm/src/extension.ts +895 -0
- package/plugins/kxm/src/external-effects.ts +299 -0
- package/plugins/kxm/src/github-watch.ts +255 -0
- package/plugins/kxm/src/hub-binding.ts +160 -0
- package/plugins/kxm/src/hub.ts +2502 -0
- package/plugins/kxm/src/improve.ts +383 -0
- package/plugins/kxm/src/inbox.ts +10 -0
- package/plugins/kxm/src/kxm-install-kind.ts +113 -0
- package/plugins/kxm/src/kxm-update-config.ts +39 -0
- package/plugins/kxm/src/kxm-update.ts +238 -0
- package/plugins/kxm/src/local-snapshot.ts +406 -0
- package/plugins/kxm/src/logger.ts +198 -0
- package/plugins/kxm/src/mcp-server.ts +143 -0
- package/plugins/kxm/src/memory.ts +385 -0
- package/plugins/kxm/src/nous-pi.ts +287 -0
- package/plugins/kxm/src/nous-provider.ts +729 -0
- package/plugins/kxm/src/price-calc.ts +87 -0
- package/plugins/kxm/src/prices.ts +121 -0
- package/plugins/kxm/src/protocol.ts +172 -0
- package/plugins/kxm/src/recovery.ts +211 -0
- package/plugins/kxm/src/redact.ts +26 -0
- package/plugins/kxm/src/retrospective.ts +400 -0
- package/plugins/kxm/src/routing.ts +830 -0
- package/plugins/kxm/src/runtime.ts +9 -0
- package/plugins/kxm/src/server.ts +117 -0
- package/plugins/kxm/src/session-work.ts +571 -0
- package/plugins/kxm/src/session.ts +184 -0
- package/plugins/kxm/src/skills.ts +535 -0
- package/plugins/kxm/src/state.ts +326 -0
- package/plugins/kxm/src/store.ts +637 -0
- package/plugins/kxm/src/studio-layout.ts +268 -0
- package/plugins/kxm/src/suggest.ts +162 -0
- package/plugins/kxm/src/task-manager.ts +244 -0
- package/plugins/kxm/src/telemetry.ts +116 -0
- package/plugins/kxm/src/tui.ts +1046 -0
- package/plugins/kxm/src/vnext-bindings.ts +403 -0
- package/plugins/kxm/src/vnext-config.ts +1646 -0
- package/plugins/kxm/src/vnext-engine-artifacts.ts +86 -0
- package/plugins/kxm/src/vnext-engine-command.ts +533 -0
- package/plugins/kxm/src/vnext-engine-compile.ts +722 -0
- package/plugins/kxm/src/vnext-engine-evidence.ts +273 -0
- package/plugins/kxm/src/vnext-engine-fold.ts +1400 -0
- package/plugins/kxm/src/vnext-engine-gate-records.ts +583 -0
- package/plugins/kxm/src/vnext-engine-plan.ts +717 -0
- package/plugins/kxm/src/vnext-engine.ts +2458 -0
- package/plugins/kxm/src/vnext-gate-hash.ts +10 -0
- package/plugins/kxm/src/vnext-harness.ts +1142 -0
- package/plugins/kxm/src/vnext-init.ts +430 -0
- package/plugins/kxm/src/vnext-migrate.ts +1848 -0
- package/plugins/kxm/src/vnext-oneshot-producer.ts +424 -0
- package/plugins/kxm/src/vnext-permission.ts +936 -0
- package/plugins/kxm/src/vnext-pi-producer.ts +628 -0
- package/plugins/kxm/src/vnext-repair.ts +1094 -0
- package/plugins/kxm/src/vnext-runtime-owner.ts +320 -0
- package/plugins/kxm/src/vnext-runtime-store.ts +1560 -0
- package/plugins/kxm/src/vnext-runtime-supervisor.ts +586 -0
- package/plugins/kxm/src/vnext-runtime.ts +663 -0
- package/plugins/kxm/src/vnext-template.ts +247 -0
- package/plugins/kxm/src/wiki.ts +313 -0
- package/plugins/kxm/src/workflow.ts +1548 -0
- package/schemas/vnext/README.md +46 -0
- package/schemas/vnext/agent.schema.json +40 -0
- package/schemas/vnext/assignment-result.schema.json +66 -0
- package/schemas/vnext/backup-manifest.schema.json +89 -0
- package/schemas/vnext/candidate.schema.json +109 -0
- package/schemas/vnext/common.schema.json +422 -0
- package/schemas/vnext/context-candidate.schema.json +76 -0
- package/schemas/vnext/context-packet.schema.json +192 -0
- package/schemas/vnext/delivery-manifest.schema.json +159 -0
- package/schemas/vnext/environment.schema.json +66 -0
- package/schemas/vnext/gate-registry.schema.json +109 -0
- package/schemas/vnext/handoff-manifest.schema.json +146 -0
- package/schemas/vnext/init-operation.schema.json +61 -0
- package/schemas/vnext/local-repository-bindings.schema.json +30 -0
- package/schemas/vnext/memory-record.schema.json +45 -0
- package/schemas/vnext/migration-decision.schema.json +26 -0
- package/schemas/vnext/migration-plan.schema.json +123 -0
- package/schemas/vnext/migration-receipt.schema.json +52 -0
- package/schemas/vnext/model.schema.json +42 -0
- package/schemas/vnext/permission-diff.schema.json +57 -0
- package/schemas/vnext/prices.schema.json +115 -0
- package/schemas/vnext/project.schema.json +85 -0
- package/schemas/vnext/repository.schema.json +24 -0
- package/schemas/vnext/run-event.schema.json +460 -0
- package/schemas/vnext/session-brief.schema.json +153 -0
- package/schemas/vnext/sync-event.schema.json +234 -0
- package/schemas/vnext/template-provenance.schema.json +38 -0
- package/schemas/vnext/workflow.schema.json +248 -0
- package/scripts/assignment-run.d.mts +354 -0
- package/scripts/assignment-run.mjs +4451 -0
- package/scripts/build-runtime.mjs +56 -0
- package/scripts/check-generated.mjs +77 -0
- package/scripts/check-versions.mjs +34 -0
- package/scripts/emit-codex-artifacts.d.mts +9 -0
- package/scripts/emit-codex-artifacts.mjs +91 -0
- package/scripts/harness-run.d.mts +83 -0
- package/scripts/harness-run.mjs +2095 -0
- package/scripts/kxm-hub.mjs +105 -0
- package/scripts/kxm-publish-npm.mjs +327 -0
- package/scripts/kxm-release-github.mjs +472 -0
- package/scripts/kxm-runtime-supervisor.mjs +7 -0
- package/scripts/kxm-worker.mjs +1127 -0
- package/scripts/kxm.mjs +27 -0
- package/scripts/roster-policy.d.mts +20 -0
- package/scripts/roster-policy.mjs +161 -0
- package/scripts/smoke-multi-pi.mjs +479 -0
package/README.md
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# KXM
|
|
2
|
+
|
|
3
|
+
[](https://github.com/kontextmind/kxm/actions/workflows/ci.yml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
|
|
7
|
+
Give running coding agents a small, dependable communication plane.
|
|
8
|
+
|
|
9
|
+
**KXM** lets Pi and Claude Code agents discover one another, send focused requests, continue working independently, and collect replies without sharing an oversized conversation. It provides communication primitives—not an autonomous swarm manager—so each agent keeps its own context and safety controls.
|
|
10
|
+
|
|
11
|
+
> **Project status:** Production candidate (`0.4.x`) for a single hub serving local or trusted-team agents. Durable delivery, signed webhook workflows, operator CLI, security controls, observability, and recovery are tested. It is not a horizontally scaled or multi-tenant orchestration service. See [Production boundaries](#production-boundaries).
|
|
12
|
+
|
|
13
|
+
## Why use it?
|
|
14
|
+
|
|
15
|
+
- **Delegate deliberately.** Route a bounded task to a peer selected by name and purpose.
|
|
16
|
+
- **Stay productive.** Poll for a result or wait only when the reply blocks progress.
|
|
17
|
+
- **Mix harnesses.** Connect native Pi sessions and Claude Code through the same hub.
|
|
18
|
+
- **Keep control.** Authentication, project isolation, message limits, and normal agent approval rules remain in place.
|
|
19
|
+
- **Install using native formats.** One repository packages a Pi extension, an Agent Skill, and a Claude Code marketplace plugin.
|
|
20
|
+
- **Start from real events.** Signed Jira, GitHub, or generic webhooks can prompt durable, long-lived coordinators.
|
|
21
|
+
- **Release idle turns.** Coordinators can wait durably for signed CI, review, merge, or Jira callbacks and resume only when work remains.
|
|
22
|
+
- **Verify peer provenance.** Per-requirement quorum gates count unique eligible producers from immutable, attempt-bound replied messages rather than coordinator-authored claims.
|
|
23
|
+
- **Learn from every run.** Capture plans, decisions, contradictions, errors, and lessons without turning unreviewed opinions into policy.
|
|
24
|
+
|
|
25
|
+
## First run
|
|
26
|
+
|
|
27
|
+
You need Node.js 22.19 or newer on the 22.x line, or Node.js 24 or newer, plus Git, GitHub CLI, Pi, and two terminal windows. Six steps take you from install to `kxm session brief` and `/kxm hub`.
|
|
28
|
+
|
|
29
|
+
### 1. Install
|
|
30
|
+
|
|
31
|
+
Download the packed release through an authenticated GitHub CLI session. Run `gh auth login` first if necessary. Pi's Git package install supplies the extension and Agent Skill; it does not place `kxm` on `PATH`.
|
|
32
|
+
|
|
33
|
+
PowerShell:
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
$version = "<release-version>"
|
|
37
|
+
$asset = "kxm-$version.tgz"
|
|
38
|
+
$releaseDir = Join-Path $PWD ".kxm-release"
|
|
39
|
+
New-Item -ItemType Directory -Force -Path $releaseDir | Out-Null
|
|
40
|
+
gh release download "v$version" --repo kontextmind/kxm --pattern $asset --dir $releaseDir --clobber
|
|
41
|
+
npm install --global --omit=peer (Join-Path $releaseDir $asset)
|
|
42
|
+
pi install git:github.com/kontextmind/kxm@main
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Bash:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
version='<release-version>'
|
|
49
|
+
asset="kxm-${version}.tgz"
|
|
50
|
+
mkdir -p .kxm-release
|
|
51
|
+
gh release download "v${version}" --repo kontextmind/kxm \
|
|
52
|
+
--pattern "$asset" --dir .kxm-release --clobber
|
|
53
|
+
npm install --global --omit=peer ".kxm-release/$asset"
|
|
54
|
+
pi install git:github.com/kontextmind/kxm@main
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
From a clone, run `npm ci` and use `node scripts/kxm.mjs` in place of `kxm`. Do not use `npm install --global git+https://github.com/kontextmind/kxm.git`.
|
|
58
|
+
|
|
59
|
+
### 2. Initialize the project
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
kxm init
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. Start the hub in another terminal
|
|
66
|
+
|
|
67
|
+
`kxm hub start` is foreground. Keep that terminal running.
|
|
68
|
+
|
|
69
|
+
PowerShell:
|
|
70
|
+
|
|
71
|
+
```powershell
|
|
72
|
+
$env:KXM_AUTH_TOKEN = "replace-with-an-admin-token"
|
|
73
|
+
$env:KXM_PROJECT_TOKENS = '{"demo":"replace-with-a-demo-project-token"}'
|
|
74
|
+
kxm hub start
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Bash:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
export KXM_AUTH_TOKEN="replace-with-an-admin-token"
|
|
81
|
+
export KXM_PROJECT_TOKENS='{"demo":"replace-with-a-demo-project-token"}'
|
|
82
|
+
kxm hub start
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The hub listens on `http://127.0.0.1:7331`.
|
|
86
|
+
|
|
87
|
+
### 4. Bind this machine to the hub
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
kxm hub bind http://127.0.0.1:7331
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 5. Confirm the session
|
|
94
|
+
|
|
95
|
+
```text
|
|
96
|
+
kxm session brief
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 6. Open Pi and check the hub
|
|
100
|
+
|
|
101
|
+
Give agents the project token, not the administrative token.
|
|
102
|
+
|
|
103
|
+
PowerShell:
|
|
104
|
+
|
|
105
|
+
```powershell
|
|
106
|
+
$env:KXM_SERVER_URL = "http://127.0.0.1:7331"
|
|
107
|
+
$env:KXM_AUTH_TOKEN = "replace-with-a-demo-project-token"
|
|
108
|
+
$env:KXM_PROJECT = "demo"
|
|
109
|
+
$env:KXM_AGENT_NAME = "planner"
|
|
110
|
+
$env:KXM_AGENT_PURPOSE = "Plans work and coordinates handoffs"
|
|
111
|
+
pi
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Bash:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
export KXM_SERVER_URL=http://127.0.0.1:7331
|
|
118
|
+
export KXM_AUTH_TOKEN="replace-with-a-demo-project-token"
|
|
119
|
+
export KXM_PROJECT=demo
|
|
120
|
+
export KXM_AGENT_NAME=planner
|
|
121
|
+
export KXM_AGENT_PURPOSE="Plans work and coordinates handoffs"
|
|
122
|
+
pi
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
In Pi, run `/kxm hub`. For a second agent or Claude Code, follow [Getting started](docs/getting-started.md).
|
|
126
|
+
|
|
127
|
+
## Command-first operation
|
|
128
|
+
|
|
129
|
+
The `kxm` entry point manages one project. Tools are `init`, `hub`, `dash`, `session`, `agent`, `workflow`, and `gate`. Runtime configuration, logs, durable state, and generated retrospectives stay under `.kxm`.
|
|
130
|
+
|
|
131
|
+
After the first-run path above, load a reviewed Jira definition with distinct administrative, project, workflow-start, and callback credentials:
|
|
132
|
+
|
|
133
|
+
```powershell
|
|
134
|
+
# Create or copy a reviewed definition to .kxm/config/workflows/jira-development.json.
|
|
135
|
+
$env:KXM_AUTH_TOKEN = "replace-with-the-admin-token"
|
|
136
|
+
$env:KXM_PROJECT_TOKENS = '{"product":"replace-with-the-project-token"}'
|
|
137
|
+
$env:JIRA_WEBHOOK_SECRET = "replace-with-the-workflow-start-secret"
|
|
138
|
+
$env:WORKFLOW_SIGNAL_SECRET = "replace-with-the-callback-secret"
|
|
139
|
+
$env:KXM_WEBHOOK_WORKFLOWS_FILE = ".kxm/config/workflows/jira-development.json"
|
|
140
|
+
kxm gate validate --file .kxm/config/workflows/jira-development.json
|
|
141
|
+
kxm hub start
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
In a separately supervised coordinator terminal, give the single writer only
|
|
145
|
+
the project credential and the tools required by the full Jira lifecycle. This
|
|
146
|
+
PowerShell example uses the Windows shell tool; replace `powershell` with `bash`
|
|
147
|
+
on macOS or Linux.
|
|
148
|
+
|
|
149
|
+
```powershell
|
|
150
|
+
$env:KXM_AUTH_TOKEN = "replace-with-the-project-token"
|
|
151
|
+
$coordinatorTools = @(
|
|
152
|
+
"read", "powershell", "edit", "write", "grep", "find", "ls",
|
|
153
|
+
"kxm_list", "kxm_send", "kxm_fanout", "kxm_get", "kxm_await",
|
|
154
|
+
"kxm_workflow_get", "kxm_workflow_checkpoint", "kxm_workflow_wait",
|
|
155
|
+
"kxm_workflow_record", "kxm_improvement_report"
|
|
156
|
+
) -join ","
|
|
157
|
+
kxm agent worker --name coordinator --project product --model xai/grok-4.6 `
|
|
158
|
+
--fallback-models antigravity/gemini-3.1-pro --tools $coordinatorTools `
|
|
159
|
+
--session-isolation workflow --fresh-start
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Give review-only peers `read,grep,find,ls`; do not copy the coordinator's shell
|
|
163
|
+
or write capabilities to them. In an operator terminal, start and inspect work,
|
|
164
|
+
then run external watchers with the separate callback secret:
|
|
165
|
+
|
|
166
|
+
```powershell
|
|
167
|
+
$env:KXM_WORKFLOW_SECRET = "replace-with-the-workflow-start-secret"
|
|
168
|
+
$env:KXM_WORKFLOW_ID = "jira-development"
|
|
169
|
+
$env:KXM_WORKFLOW_SIGNAL_SECRET = "replace-with-the-callback-secret"
|
|
170
|
+
$env:GITHUB_TOKEN = "replace-with-a-checks-read-token"
|
|
171
|
+
kxm workflow start jira-development --payload '@ticket.json'
|
|
172
|
+
kxm workflow list
|
|
173
|
+
kxm workflow get run_123
|
|
174
|
+
kxm gate github watch --run-id run_123 --stage-id push-watch `
|
|
175
|
+
--signal-key pr-42-checks --repo org/repo --pr 42 --required ci
|
|
176
|
+
kxm workflow export run_123
|
|
177
|
+
kxm hub stop
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Use `--dry-run --json` to inspect mutation plans without exposing configured
|
|
181
|
+
token or secret values. Terminal workflows export proposed Markdown and JSON
|
|
182
|
+
retrospectives automatically; review them before adopting any improvement as
|
|
183
|
+
policy. Provenance quorum degradation is a separate admin-only operation; use
|
|
184
|
+
the [provenance runbook](docs/provenance-gates.md#degrade-only-through-an-explicit-admin-decision)
|
|
185
|
+
only for a workflow whose evidence policy declares a lower minimum.
|
|
186
|
+
|
|
187
|
+
## What is included?
|
|
188
|
+
|
|
189
|
+
| Component | What it does | Packaging |
|
|
190
|
+
|---|---|---|
|
|
191
|
+
| KXM hub | Persists presence and routes authenticated HTTP/SSE messages | Node.js executable + SQLite |
|
|
192
|
+
| Pi extension | Adds communication, workflow, journal, and improvement tools | `pi.extensions` |
|
|
193
|
+
| Agent Skill | Teaches agents a safe, efficient coordination workflow | `pi.skills` and `SKILL.md` |
|
|
194
|
+
| Claude bridge | Exposes the same workflow plane through MCP and optional channel events | Claude Code plugin |
|
|
195
|
+
| Marketplace | Makes the Claude plugin installable from this repository | Claude marketplace catalog |
|
|
196
|
+
|
|
197
|
+
## How it works
|
|
198
|
+
|
|
199
|
+
```text
|
|
200
|
+
Pi planner ──HTTP──┐
|
|
201
|
+
├── KXM hub ──SSE──> addressed inbound requests
|
|
202
|
+
Pi reviewer ─HTTP──┤ │
|
|
203
|
+
│ └── presence, heartbeats, message state
|
|
204
|
+
Claude Code ─MCP───┘
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
The hub routes messages; it does not merge contexts, choose tasks, or bypass tool permissions. A typical request moves through `queued` → `delivered` → `replied`. It may instead end as `cancelled`, `expired`, or `error`. The sender can check it with `kxm_get`, wait with `kxm_await`, or stop pending work with `kxm_cancel`. A local `kxm_fanout` wait ending is nonterminal: it returns a durable pending handle that can be checked with `kxm_get` or retried with the same correlation and idempotency prefix.
|
|
208
|
+
|
|
209
|
+
## Documentation
|
|
210
|
+
|
|
211
|
+
| If you want to… | Read |
|
|
212
|
+
|---|---|
|
|
213
|
+
| Install, configure, and use every KXM surface | [KXM Handbook](docs/kxm-handbook.md) |
|
|
214
|
+
| Complete a Pi-to-Pi or Pi-to-Claude setup | [Getting started](docs/getting-started.md) |
|
|
215
|
+
| Configure the hub or an agent | [Configuration reference](docs/configuration.md) |
|
|
216
|
+
| Understand components and message flow | [Architecture](docs/architecture.md) |
|
|
217
|
+
| Run the hub responsibly | [Operations guide](docs/operations.md) |
|
|
218
|
+
| Fix connection or delivery problems | [Troubleshooting](docs/troubleshooting.md) |
|
|
219
|
+
| See which behaviors and examples are verified | [Test matrix](docs/test-matrix.md) |
|
|
220
|
+
| Start work from Jira or another webhook | [Webhook workflows](docs/webhook-workflows.md) |
|
|
221
|
+
| Require verified replies from eligible peers | [Peer provenance and quorum gates](docs/provenance-gates.md) |
|
|
222
|
+
| Improve the harness and delivery process from evidence | [Continuous improvement](docs/continuous-improvement.md) |
|
|
223
|
+
| Navigate Area → Workflow → Stage → Role taxonomy | [Workflow guide](docs/workflow-guide.md) |
|
|
224
|
+
| Develop or submit a change | [Contributing](CONTRIBUTING.md) |
|
|
225
|
+
| Report a vulnerability | [Security policy](SECURITY.md) |
|
|
226
|
+
| Review user-facing changes | [Changelog](CHANGELOG.md) |
|
|
227
|
+
|
|
228
|
+
The [documentation index](docs/README.md) describes the intended audience and scope of each guide.
|
|
229
|
+
|
|
230
|
+
## Claude Code installation
|
|
231
|
+
|
|
232
|
+
Inside Claude Code:
|
|
233
|
+
|
|
234
|
+
```text
|
|
235
|
+
/plugin marketplace add kontextmind/kxm
|
|
236
|
+
/plugin install kxm
|
|
237
|
+
/reload-plugins
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
The plugin provides peer messaging plus workflow listing, checkpoints, structured journal capture, and project improvement reports. See the [plugin tool table](plugins/kxm/README.md#tools).
|
|
241
|
+
|
|
242
|
+
Pushed Claude channel delivery is a research-preview feature. Community channels currently require an explicit development-channel launch:
|
|
243
|
+
|
|
244
|
+
```text
|
|
245
|
+
claude --dangerously-load-development-channels plugin:kxm
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Without channel mode, ordinary MCP tools still work; use `kxm_inbox` and `kxm_reply` for inbound requests. See [Getting started](docs/getting-started.md#connect-claude-code) for the complete flow.
|
|
249
|
+
|
|
250
|
+
## Production boundaries
|
|
251
|
+
|
|
252
|
+
The codebase is structured, typed, persisted, tested, packaged, and CI-gated. The current hub is suitable for production use on one workstation or a controlled trusted-team host, with these deliberate limits:
|
|
253
|
+
|
|
254
|
+
- One process owns one SQLite database; there is no clustering, leader election, or shared-state failover.
|
|
255
|
+
- Project tokens isolate hub access by project, but there are no per-user roles or external identity provider.
|
|
256
|
+
- Peer quorum proves durable message provenance only within the shared project-credential boundary; it does not prove truth, model independence, non-collusion, or human approval.
|
|
257
|
+
- Delivery is durable and retry-safe when callers supply an idempotency key, but it is not exactly-once execution.
|
|
258
|
+
- Rate-limit counters reset after restart, and capacity depends on the host and SQLite workload.
|
|
259
|
+
- The hub does not coordinate filesystem ownership; use separate worktrees or a single-writer rule.
|
|
260
|
+
- A non-loopback deployment requires authentication, TLS termination, process supervision, and network access controls.
|
|
261
|
+
|
|
262
|
+
The [operations guide](docs/operations.md) explains backup, recovery, monitoring, upgrade, and the safe deployment envelope.
|
|
263
|
+
|
|
264
|
+
## Package standards
|
|
265
|
+
|
|
266
|
+
This repository follows the native package structures for:
|
|
267
|
+
|
|
268
|
+
- [Pi package discovery](https://pi.dev/docs/latest/packages) through the `pi-package` keyword and `pi.extensions` / `pi.skills` manifests;
|
|
269
|
+
- portable [Pi Agent Skills](https://pi.dev/docs/latest/skills) using `<skill-name>/SKILL.md`;
|
|
270
|
+
- [Claude Code plugins](https://code.claude.com/docs/en/plugins-reference) through `.claude-plugin/plugin.json`;
|
|
271
|
+
- [Claude marketplaces](https://code.claude.com/docs/en/plugin-marketplaces) through `.claude-plugin/marketplace.json`;
|
|
272
|
+
- standard MCP stdio tools and the optional [Claude channel](https://code.claude.com/docs/en/channels-reference) capability.
|
|
273
|
+
|
|
274
|
+
## Development
|
|
275
|
+
|
|
276
|
+
```powershell
|
|
277
|
+
npm ci
|
|
278
|
+
npm run verify
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
`npm run verify` includes `check:generated`. CI also runs `validate:ci` and
|
|
282
|
+
plugin validation (`claude plugin validate`) as a hosted job. See
|
|
283
|
+
[Contributing](CONTRIBUTING.md) before changing the protocol or generated
|
|
284
|
+
runtimes.
|
|
285
|
+
|
|
286
|
+
## Repository layout
|
|
287
|
+
|
|
288
|
+
```text
|
|
289
|
+
.kxm/ Workspace configuration, logs, assets, and state
|
|
290
|
+
.claude-plugin/ Claude marketplace catalog
|
|
291
|
+
.github/ CI and contribution templates
|
|
292
|
+
docs/ User, operator, and architecture guides
|
|
293
|
+
plugins/kxm/
|
|
294
|
+
├── .claude-plugin/ Claude plugin manifest
|
|
295
|
+
├── dist/ Generated self-contained CLI, hub, and MCP runtimes
|
|
296
|
+
├── skills/ Portable Agent Skill
|
|
297
|
+
└── src/ Pi extension, hub, client, and MCP source
|
|
298
|
+
scripts/ Build and consistency helpers
|
|
299
|
+
test/ Integration tests
|
|
300
|
+
examples/ Executable transport scenarios and callback sender
|
|
301
|
+
scripts/kxm-worker.mjs Restarting headless Pi RPC worker
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## License
|
|
305
|
+
|
|
306
|
+
[MIT](LICENSE) © KontextMind contributors.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Supported versions
|
|
4
|
+
|
|
5
|
+
Security fixes are applied to the latest published release and the default branch. Older snapshots are not supported.
|
|
6
|
+
|
|
7
|
+
## Report a vulnerability
|
|
8
|
+
|
|
9
|
+
Please do not open a public issue for a suspected vulnerability. Use [GitHub private vulnerability reporting](https://github.com/kontextmind/kxm/security/advisories/new) and include:
|
|
10
|
+
|
|
11
|
+
- affected version or commit;
|
|
12
|
+
- impact and realistic attack scenario;
|
|
13
|
+
- minimal reproduction steps;
|
|
14
|
+
- any proposed mitigation;
|
|
15
|
+
- whether the issue is already public.
|
|
16
|
+
|
|
17
|
+
Do not include real credentials, private prompts, personal data, or unrelated repository contents. You should receive an acknowledgement through GitHub's advisory workflow. Public disclosure should wait until a fix and release plan are agreed.
|
|
18
|
+
|
|
19
|
+
## Security model
|
|
20
|
+
|
|
21
|
+
The current hub provides:
|
|
22
|
+
|
|
23
|
+
- an administrative bearer token and optional per-project bearer tokens;
|
|
24
|
+
- ephemeral per-agent keys for agent-specific operations;
|
|
25
|
+
- project-scoped discovery and message visibility;
|
|
26
|
+
- loopback binding by default;
|
|
27
|
+
- refusal to bind beyond localhost without a token;
|
|
28
|
+
- bounded request bodies, message content, and hop counts;
|
|
29
|
+
- per-agent request rate limiting and stable request IDs;
|
|
30
|
+
- security response headers and generic public responses for internal errors;
|
|
31
|
+
- SHA-256 HMAC verification and stable-delivery deduplication for webhook workflows;
|
|
32
|
+
- attempt-bound peer-message provenance, unique-producer quorum, and explicit admin-only degradation for configured workflow requirements;
|
|
33
|
+
- structured hub logs that omit prompt and reply bodies.
|
|
34
|
+
|
|
35
|
+
It does not currently provide:
|
|
36
|
+
|
|
37
|
+
- per-user roles or external identity-provider integration;
|
|
38
|
+
- durable encrypted storage;
|
|
39
|
+
- end-to-end message encryption;
|
|
40
|
+
- public-internet hardening;
|
|
41
|
+
- distributed denial-of-service protection;
|
|
42
|
+
- guarantees that peer-provided content is safe or correct.
|
|
43
|
+
|
|
44
|
+
Peer quorum proves that the hub observed durable replies from the configured
|
|
45
|
+
producer identities for one exact workflow run, stage, requirement, and
|
|
46
|
+
attempt. It does not prove truth, response quality, model identity, independent
|
|
47
|
+
inference, non-collusion, or human approval. A project-token holder can register
|
|
48
|
+
a new agent or reclaim an offline agent name and its durable ID in that project,
|
|
49
|
+
so every holder of one shared project credential belongs to the same fully
|
|
50
|
+
trusted provenance domain.
|
|
51
|
+
|
|
52
|
+
Authentication does not make a mesh message trustworthy. Agents must retain their normal permission, tool, filesystem, and secret-handling controls.
|
|
53
|
+
|
|
54
|
+
## Operator responsibilities
|
|
55
|
+
|
|
56
|
+
- Keep the hub on loopback whenever possible.
|
|
57
|
+
- Use a long random token and load it from a secret manager or protected environment.
|
|
58
|
+
- Use distinct project tokens when different teams share one hub.
|
|
59
|
+
- Reserve a distinct administrative token for admin routes; give agents only their explicit project token. Never give a workflow callback or peer the admin token.
|
|
60
|
+
- Protect and back up `.kxm/state/kxm.db` because it contains messages and agent credentials.
|
|
61
|
+
- Protect `.kxm/logs`; raw long-lived Pi process logs can contain model output, tool output, paths, and other sensitive operational data.
|
|
62
|
+
- Keep secrets out of tracked `.kxm/config` and `.kxm/assets`; runtime logs, generated assets, and state must remain uncommitted.
|
|
63
|
+
- Store webhook secrets in dedicated environment variables through `secretEnv`; do not commit them in workflow JSON.
|
|
64
|
+
- Use a separate `signalSecretEnv` for callbacks and never put credentials, private prompts, or sensitive incident details in a degradation reason.
|
|
65
|
+
- Review every quorum degradation as a security-relevant decision. It must be declared by policy, limited to the current attempt, and followed by enough verified replies to meet the approved minimum.
|
|
66
|
+
- Enforce read-only reviewer and single-writer coordinator roles with `KXM_WORKER_TOOLS`; prompt instructions do not remove shell, edit, or write capabilities.
|
|
67
|
+
- Treat verified evidence snapshots as sensitive metadata. They omit message bodies but retain agent names/IDs, workflow scope, timestamps, and content hashes beyond normal terminal-message retention.
|
|
68
|
+
- Restrict webhook ingress by TLS, network policy, and provider configuration even when signatures are enabled.
|
|
69
|
+
- Put TLS and network access controls in front of any non-loopback deployment.
|
|
70
|
+
- Rotate the token after suspected disclosure.
|
|
71
|
+
- Never expose the hub directly to the public internet.
|
|
72
|
+
- Keep Node.js, Pi, Claude Code, and this package updated.
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Documentation
|
|
2
|
+
|
|
3
|
+
This documentation is organized by task. Start with the guide that matches what you are trying to accomplish.
|
|
4
|
+
|
|
5
|
+
| Guide | Audience | Purpose |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| [KXM Handbook](kxm-handbook.md) | Operators, Pi users, and Claude Code users | Wiki-ready installation, configuration, and complete feature guide |
|
|
8
|
+
| [Getting started](getting-started.md) | Pi and Claude Code users | Complete the first successful multi-agent exchange |
|
|
9
|
+
| [Configuration](configuration.md) | Users and operators | Understand every supported setting and default |
|
|
10
|
+
| [Architecture](architecture.md) | Maintainers and integrators | Learn the component boundaries and message lifecycle |
|
|
11
|
+
| [Operations](operations.md) | Hub operators | Run, monitor, secure, and recover the service |
|
|
12
|
+
| [Troubleshooting](troubleshooting.md) | Everyone | Diagnose common installation and delivery failures |
|
|
13
|
+
| [Test matrix](test-matrix.md) | Users and maintainers | Map features and use cases to automated evidence |
|
|
14
|
+
| [Webhook workflows](webhook-workflows.md) | Automation owners | Start durable work from Jira or another signed webhook |
|
|
15
|
+
| [Peer provenance and quorum gates](provenance-gates.md) | Workflow authors and security reviewers | Require durable replies from eligible peer identities without overstating the trust guarantee |
|
|
16
|
+
| [Continuous improvement](continuous-improvement.md) | Product and engineering leads | Turn run evidence into reviewed workflow improvements |
|
|
17
|
+
| [Workflow guide](workflow-guide.md) | Workflow designers and operators | Area -> Workflow -> Stage -> Role taxonomy with documentation slugs, dated research candidates, and selection policy |
|
|
18
|
+
| [Agent Envelopes & Quality Gates](agent-communication-envelopes-and-gates.md) | Multi-agent workflow engineers | Production communication envelopes, quality gates, and work loops |
|
|
19
|
+
| [Assignment runner](assignment-runner.md) | Maintainers and developers | Native developer assignments, deterministic witness verification, and multi-vendor dual-critic acceptance |
|
|
20
|
+
| [vNext contract package](vnext/README.md) | Maintainers and reviewers | Review the accepted local-first target architecture and implementation contracts |
|
|
21
|
+
|
|
22
|
+
Project-level policies live at the repository root:
|
|
23
|
+
|
|
24
|
+
- [Contributing](../CONTRIBUTING.md)
|
|
25
|
+
- [Security](../SECURITY.md)
|
|
26
|
+
- [Changelog](../CHANGELOG.md)
|
|
27
|
+
|
|
28
|
+
## Documentation principles
|
|
29
|
+
|
|
30
|
+
- Put the shortest successful path before optional details.
|
|
31
|
+
- Use the product terms **hub**, **agent**, **peer**, **project**, **request**, and **reply** consistently.
|
|
32
|
+
- Distinguish verified behavior from planned behavior; `docs/vnext` is a planned normative target until activation.
|
|
33
|
+
- Distinguish durable single-node delivery from clustering and exactly-once execution.
|
|
34
|
+
- Update the relevant guide in the same change that modifies user-visible behavior.
|
|
35
|
+
|
|
36
|
+
## Which docs each workflow relies on
|
|
37
|
+
|
|
38
|
+
Cross-reference only. Guide slugs imply no runtime config, admission, schema, or
|
|
39
|
+
CLI behavior.
|
|
40
|
+
|
|
41
|
+
| Workflow slug | Primary docs |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `build-feature` | [Getting started](getting-started.md), [Configuration](configuration.md), [Architecture](architecture.md), [Test matrix](test-matrix.md) |
|
|
44
|
+
| `refactor-repair-regressions` | [Architecture](architecture.md), [Test matrix](test-matrix.md), [Troubleshooting](troubleshooting.md), [Provenance gates](provenance-gates.md) |
|
|
45
|
+
| `stabilize-flaky-tests` | [Test matrix](test-matrix.md), [Operations](operations.md), [Troubleshooting](troubleshooting.md) |
|
|
46
|
+
| `design-software-system` | [Architecture](architecture.md), [Configuration](configuration.md), [vNext contracts](vnext/README.md) |
|
|
47
|
+
| `investigate-incident` | [Operations](operations.md), [Troubleshooting](troubleshooting.md), [Webhook workflows](webhook-workflows.md) |
|
|
48
|
+
| `patch-vulnerability` | [Provenance gates](provenance-gates.md), [Operations](operations.md), [Configuration](configuration.md) |
|