@kontextmind/kxm 0.7.72 → 0.7.73
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/docs/contracts/synchronization.md +6 -3
- package/docs/operations.md +35 -4
- package/package.json +1 -1
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/dist/cli.js +307 -235
- package/plugins/kxm/dist/client.js +67 -36
- package/plugins/kxm/dist/core.js +2 -0
- package/plugins/kxm/dist/extension.js +40 -37
- package/plugins/kxm/dist/mcp-server.js +40 -37
- package/plugins/kxm/dist/runtime-supervisor.js +917 -141
- package/plugins/kxm/dist/runtime.js +977 -237
- package/plugins/kxm/dist/server.js +16206 -8256
- package/plugins/kxm/package.json +1 -1
- package/plugins/kxm/src/client.ts +85 -3
- package/plugins/kxm/src/database.ts +4 -4
- package/plugins/kxm/src/hub.ts +221 -0
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/plugins/kxm/src/project-config.ts +15 -0
- package/plugins/kxm/src/protocol.ts +27 -0
- package/plugins/kxm/src/runtime-store.ts +109 -1
- package/plugins/kxm/src/runtime-supervisor.ts +150 -0
- package/plugins/kxm/src/store.ts +207 -4
- package/plugins/kxm/src/sync-transform.ts +380 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Hub synchronization contract
|
|
2
2
|
|
|
3
|
-
> **Status.** `kxm.sync-event.v1` is a **schema-tested contract
|
|
4
|
-
>
|
|
5
|
-
>
|
|
3
|
+
> **Status.** `kxm.sync-event.v1` is a **schema-tested contract with an
|
|
4
|
+
> implementation** (cross-host P5): the event store `outbox` (v6), the
|
|
5
|
+
> `sync-transform.ts` derivation under the default policy, supervisor push to
|
|
6
|
+
> `POST /v1/sync/events`, and hub ingestion into `sync_events` (hub store v5).
|
|
7
|
+
> Custom project policies and on-demand content transfer remain unimplemented.
|
|
8
|
+
> Phase 8 gate: [implementation plan](../../plans/implementation-plan.md#phase-8-multi-project-hub-kxm).
|
|
6
9
|
|
|
7
10
|
Synchronization is summary-first, project-scoped, at-least-once, and
|
|
8
11
|
allowlist-based. The full local event is never placed directly in the outbox.
|
package/docs/operations.md
CHANGED
|
@@ -316,8 +316,9 @@ restore lands somewhere the running service will not look.
|
|
|
316
316
|
routing manifests and update configuration are not databases, so a snapshot-only backup
|
|
317
317
|
reproduces exactly the failure this section exists to remove. The hub's own backup path already writes a hashed manifest and records
|
|
318
318
|
a schema version ceiling; keep that manifest with the files. That ceiling is
|
|
319
|
-
**hub store
|
|
320
|
-
build records
|
|
319
|
+
**hub store v5 and event store v6** as of the sync-outbox release: a backup taken by
|
|
320
|
+
an earlier build records hub v4 or event store v5 and is refused by this one, because
|
|
321
|
+
there is no migration lane.
|
|
321
322
|
Restore such a backup with the release that produced it, or start fresh.
|
|
322
323
|
3. Record the package version, configuration revision and schema versions beside the copy.
|
|
323
324
|
A restore that cannot state which release produced it is not a restore path.
|
|
@@ -395,8 +396,9 @@ Broader deployments need shared state and coordination, external identity and fi
|
|
|
395
396
|
|
|
396
397
|
## v0.5 context/state storage
|
|
397
398
|
|
|
398
|
-
The hub database (schema version
|
|
399
|
-
alongside agents, messages, workflow runs,
|
|
399
|
+
The hub database (schema version 5) carries `context_items`, `leases`,
|
|
400
|
+
`sync_events` and `runtime_presence` alongside agents, messages, workflow runs,
|
|
401
|
+
and the journal. Temporal state,
|
|
400
402
|
knowledge records, and their audit trails live in the same SQLite file and
|
|
401
403
|
upgrade in place from v0.4 databases.
|
|
402
404
|
|
|
@@ -444,6 +446,35 @@ holder. `kxm_leases_granted_total`, `kxm_leases_refused_total` and
|
|
|
444
446
|
`lease_acquired`, `lease_renewed`, `lease_released`, `lease_denied` and
|
|
445
447
|
`lease_purged` are the structured log events.
|
|
446
448
|
|
|
449
|
+
### Runtime → hub run-fact sync
|
|
450
|
+
|
|
451
|
+
Every event the Runtime commits also writes one row to the event store's
|
|
452
|
+
`outbox` (event store v6), in the same transaction. The row holds only a derived
|
|
453
|
+
`kxm.sync-event.v1` object — allowlisted fields, registered secret values and
|
|
454
|
+
credential shapes replaced, absolute paths removed, text bounded, the default
|
|
455
|
+
sync policy revision recorded — never the local event. A field the allowlist
|
|
456
|
+
does not name is listed by name in `redaction.fieldsOmitted` and its value is
|
|
457
|
+
dropped.
|
|
458
|
+
|
|
459
|
+
The supervisor pushes outbound only: every `KXM_RUNTIME_SYNC_INTERVAL_MS` (10 s
|
|
460
|
+
by default) it posts `POST /v1/runtime/presence` for each open project, then
|
|
461
|
+
`POST /v1/sync/events` in outbox order, to `KXM_SERVER_URL` or the `kxm hub bind`
|
|
462
|
+
URL with that project's token. No bound hub means nothing is sent and rows stay
|
|
463
|
+
pending; local execution never waits on sync. The hub accepts each event once by
|
|
464
|
+
`{projectId, runId, sequence}`: the same bytes again are an idempotent
|
|
465
|
+
`duplicate`; different bytes under a used sequence, a run claimed by another
|
|
466
|
+
project, or a push for another Runtime's events are refused and logged as
|
|
467
|
+
`security_alert`. Out-of-order events are held, and the per-run cursor is the
|
|
468
|
+
gapless prefix, so a gap stays pending until it is filled.
|
|
469
|
+
|
|
470
|
+
`GET /v1/ops/snapshot` adds `homeRuntimes`: synchronized runs grouped by home
|
|
471
|
+
Runtime, each with its bounded title/status, `lastSequence`, `pendingGap`, and
|
|
472
|
+
`orphaned` once the Runtime's presence lease (`heartbeatAt + staleAfterMs`, hub
|
|
473
|
+
clock) has lapsed. Orphaned is view state; nothing is migrated.
|
|
474
|
+
`kxm_sync_events_accepted_total`, `kxm_sync_events_duplicate_total`,
|
|
475
|
+
`kxm_sync_events_refused_total`, `kxm_sync_conflicts_total` and
|
|
476
|
+
`kxm_runtime_heartbeats_total` are in `/metrics`.
|
|
477
|
+
|
|
447
478
|
## Hub Q&A / knowledge base
|
|
448
479
|
|
|
449
480
|
- [What is all stored on the hub?](kb/qa-what-the-hub-stores.md)
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
|
|
3
3
|
"name": "kxm",
|
|
4
4
|
"displayName": "KXM",
|
|
5
|
-
"version": "0.7.
|
|
5
|
+
"version": "0.7.73",
|
|
6
6
|
"description": "Headless multi-agent orchestration, durable workflows, and a live operator dashboard for Pi and Claude Code",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "KontextMind",
|