@kontextmind/kxm 0.7.23 → 0.7.24

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.
@@ -11,7 +11,7 @@
11
11
  "name": "kxm",
12
12
  "source": "./plugins/kxm",
13
13
  "description": "Durable workflows, peer agents, and kxm tui",
14
- "version": "0.7.23",
14
+ "version": "0.7.24",
15
15
  "category": "development",
16
16
  "tags": ["kxm", "multi-agent", "workflows", "mcp"]
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontextmind/kxm",
3
- "version": "0.7.23",
3
+ "version": "0.7.24",
4
4
  "description": "KXM local-first multi-agent orchestration and operator dashboard",
5
5
  "type": "module",
6
6
  "author": "KontextMind",
@@ -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.23",
5
+ "version": "0.7.24",
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",
@@ -22050,6 +22050,7 @@ var VnextSchemaRegistry = class {
22050
22050
  migrationReceiptValidator;
22051
22051
  permissionDiffValidator;
22052
22052
  runEventValidator;
22053
+ driveReceiptValidator;
22053
22054
  constructor(schemasDir = DEFAULT_SCHEMA_DIR) {
22054
22055
  this.schemasDir = resolve3(schemasDir);
22055
22056
  this.ajv = new import__.Ajv2020({ allErrors: true, strict: true, strictRequired: false });
@@ -22066,6 +22067,7 @@ var VnextSchemaRegistry = class {
22066
22067
  const migrationReceiptFile = "migration-receipt.schema.json";
22067
22068
  const permissionDiffFile = "permission-diff.schema.json";
22068
22069
  const runEventFile = "run-event.schema.json";
22070
+ const driveReceiptFile = "drive-receipt.schema.json";
22069
22071
  this.ajv.addSchema(readJsonObject(join6(this.schemasDir, localBindingsFile)));
22070
22072
  this.ajv.addSchema(readJsonObject(join6(this.schemasDir, templateProvenanceFile)));
22071
22073
  this.ajv.addSchema(readJsonObject(join6(this.schemasDir, initOperationFile)));
@@ -22074,6 +22076,7 @@ var VnextSchemaRegistry = class {
22074
22076
  this.ajv.addSchema(readJsonObject(join6(this.schemasDir, migrationReceiptFile)));
22075
22077
  this.ajv.addSchema(readJsonObject(join6(this.schemasDir, permissionDiffFile)));
22076
22078
  this.ajv.addSchema(readJsonObject(join6(this.schemasDir, runEventFile)));
22079
+ this.ajv.addSchema(readJsonObject(join6(this.schemasDir, driveReceiptFile)));
22077
22080
  for (const [kind, definition] of Object.entries(RESOURCE_SCHEMA)) {
22078
22081
  const validator = this.ajv.getSchema(`https://schemas.kxm.dev/vnext/${definition.file}`);
22079
22082
  if (!validator) throw new Error(`schema did not compile: ${definition.file}`);
@@ -22087,6 +22090,7 @@ var VnextSchemaRegistry = class {
22087
22090
  const migrationReceiptValidator = this.ajv.getSchema(`https://schemas.kxm.dev/vnext/${migrationReceiptFile}`);
22088
22091
  const permissionDiffValidator = this.ajv.getSchema(`https://schemas.kxm.dev/vnext/${permissionDiffFile}`);
22089
22092
  const runEventValidator = this.ajv.getSchema(`https://schemas.kxm.dev/vnext/${runEventFile}`);
22093
+ const driveReceiptValidator = this.ajv.getSchema(`https://schemas.kxm.dev/vnext/${driveReceiptFile}`);
22090
22094
  if (!localBindingsValidator) throw new Error(`schema did not compile: ${localBindingsFile}`);
22091
22095
  if (!templateProvenanceValidator) throw new Error(`schema did not compile: ${templateProvenanceFile}`);
22092
22096
  if (!initOperationValidator) throw new Error(`schema did not compile: ${initOperationFile}`);
@@ -22095,6 +22099,7 @@ var VnextSchemaRegistry = class {
22095
22099
  if (!migrationReceiptValidator) throw new Error(`schema did not compile: ${migrationReceiptFile}`);
22096
22100
  if (!permissionDiffValidator) throw new Error(`schema did not compile: ${permissionDiffFile}`);
22097
22101
  if (!runEventValidator) throw new Error(`schema did not compile: ${runEventFile}`);
22102
+ if (!driveReceiptValidator) throw new Error(`schema did not compile: ${driveReceiptFile}`);
22098
22103
  this.localBindingsValidator = localBindingsValidator;
22099
22104
  this.templateProvenanceValidator = templateProvenanceValidator;
22100
22105
  this.initOperationValidator = initOperationValidator;
@@ -22103,6 +22108,7 @@ var VnextSchemaRegistry = class {
22103
22108
  this.migrationReceiptValidator = migrationReceiptValidator;
22104
22109
  this.permissionDiffValidator = permissionDiffValidator;
22105
22110
  this.runEventValidator = runEventValidator;
22111
+ this.driveReceiptValidator = driveReceiptValidator;
22106
22112
  }
22107
22113
  validate(kind, value, file) {
22108
22114
  const definition = RESOURCE_SCHEMA[kind];
@@ -22135,6 +22141,9 @@ var VnextSchemaRegistry = class {
22135
22141
  validatePermissionDiff(value, file) {
22136
22142
  return this.validateAuxiliary(value, file, "kxm.permission-diff.v1", this.permissionDiffValidator);
22137
22143
  }
22144
+ validateDriveReceipt(value, file) {
22145
+ return this.validateAuxiliary(value, file, "kxm.drive-receipt.v1", this.driveReceiptValidator);
22146
+ }
22138
22147
  validateAuxiliary(value, file, identity, validator) {
22139
22148
  if (value.schema !== identity) {
22140
22149
  return [issue2("schema", "schema_identity_mismatch", file, `expected ${identity}, received ${String(value.schema)}`)];
@@ -23918,7 +23927,7 @@ function discoverProjectStores(projectRoot, options = {}) {
23918
23927
  stores.push({
23919
23928
  storeId: `events:${key}`,
23920
23929
  sourcePath: join8(eventsDir, entry.name),
23921
- maxSupportedVersion: 3
23930
+ maxSupportedVersion: 4
23922
23931
  });
23923
23932
  }
23924
23933
  }
@@ -24008,6 +24017,8 @@ function restoreBackup(manifestPathOrDir, options = {}) {
24008
24017
  let maxSupported = 3;
24009
24018
  if (store.storeId === "registry" || store.storeId === "binding-store") {
24010
24019
  maxSupported = 1;
24020
+ } else if (store.storeId.startsWith("events:")) {
24021
+ maxSupported = 4;
24011
24022
  }
24012
24023
  let targetPath = store.sourcePath;
24013
24024
  if (options.projectRoot && manifest.projectRoot && targetPath.startsWith(manifest.projectRoot)) {
@@ -24248,6 +24259,7 @@ var VnextRuntimeRegistry = class {
24248
24259
  } : void 0;
24249
24260
  }
24250
24261
  };
24262
+ var DRIVE_RECEIPT_MAX_BYTES = 8 * 1024;
24251
24263
 
24252
24264
  // plugins/kxm/src/vnext-engine-compile.ts
24253
24265
  var VNEXT_COMPILED_WORKFLOW_SCHEMA = "kxm.compiled-workflow.v1";
@@ -33630,6 +33642,28 @@ ${RUN_ENGINE_NOTICE}`);
33630
33642
  return 1;
33631
33643
  }
33632
33644
  }
33645
+ function formatDriveStatusLine(runStatus, drive) {
33646
+ if (!drive || typeof drive.driveId !== "string" || drive.driveId.length === 0) return void 0;
33647
+ const receipt = drive.receipt ?? null;
33648
+ if (receipt === null) {
33649
+ if (runStatus === "running" || runStatus === "blocked_uncertain") {
33650
+ return `drive ${drive.driveId}: open`;
33651
+ }
33652
+ return `drive ${drive.driveId}: no receipt (orphaned)`;
33653
+ }
33654
+ const kind = receipt.settlement?.kind;
33655
+ const reason = typeof receipt.settlement?.reason === "string" ? receipt.settlement.reason : "";
33656
+ if (kind === "unsettled") {
33657
+ return `drive ${drive.driveId}: unsettled ${reason}`.trimEnd();
33658
+ }
33659
+ if (kind === "handoff") {
33660
+ return drive.verified === true ? `drive ${drive.driveId}: handoff (receipt verified)` : `drive ${drive.driveId}: handoff`;
33661
+ }
33662
+ if (drive.verified === true) {
33663
+ return `drive ${drive.driveId}: completed (receipt verified)`;
33664
+ }
33665
+ return `drive ${drive.driveId}: completed`;
33666
+ }
33633
33667
  async function cmdVnextRunStatus(runtime, runId) {
33634
33668
  try {
33635
33669
  const projectRoot = discoverVnextProjectRoot(runtime.cwd);
@@ -33637,10 +33671,18 @@ async function cmdVnextRunStatus(runtime, runId) {
33637
33671
  print(runtime.io, runtime.json, { ok: false, command: "runs status", error: "project_required" }, "kxm runs status requires a vNext project (run kxm init first)");
33638
33672
  return 1;
33639
33673
  }
33640
- const supervisor = await ensureVnextSupervisor({ env: runtime.env });
33641
- const result = await vnextRuntimeRequest(supervisor, "GET", `/v1/runs/${encodeURIComponent(runId)}?projectRoot=${encodeURIComponent(projectRoot)}`);
33674
+ const supervisor = await (vnextDriveCliSeams.ensureSupervisor ?? ensureVnextSupervisor)({ env: runtime.env });
33675
+ const result = await (vnextDriveCliSeams.runtimeRequest ?? vnextRuntimeRequest)(supervisor, "GET", `/v1/runs/${encodeURIComponent(runId)}?projectRoot=${encodeURIComponent(projectRoot)}`);
33642
33676
  const run = result.run;
33643
- print(runtime.io, runtime.json, { ok: true, command: "runs status", run }, `run ${run.runId}: ${run.status} (workflow ${run.workflowId}, updated ${run.updatedAt})`);
33677
+ const drive = result.drive;
33678
+ const driveLine = formatDriveStatusLine(run.status, drive);
33679
+ print(
33680
+ runtime.io,
33681
+ runtime.json,
33682
+ { ok: true, command: "runs status", run, ...drive !== void 0 ? { drive } : {} },
33683
+ `run ${run.runId}: ${run.status} (workflow ${run.workflowId}, updated ${run.updatedAt})${driveLine ? `
33684
+ ${driveLine}` : ""}`
33685
+ );
33644
33686
  return 0;
33645
33687
  } catch (error) {
33646
33688
  if (error instanceof VnextConfigError) {
@@ -48638,7 +48680,7 @@ function createProgram(ctx, result) {
48638
48680
  }));
48639
48681
  const runCmd = addGlobalOptions(program2.command("runs").description("Inspect vNext runs"));
48640
48682
  runCmd.helpCommand("help", "Show runs help");
48641
- addGlobalOptions(runCmd.command("status").description("Show the projected status of a run")).argument("<runId>", "Run id").action(async function runStatusAction(runId) {
48683
+ addGlobalOptions(runCmd.command("status").description("Show the projected status of a run, including durable drive receipt state (open / receipt verified / unsettled / orphaned)")).argument("<runId>", "Run id").action(async function runStatusAction(runId) {
48642
48684
  result.code = await cmdVnextRunStatus(runtimeFrom(ctx, this), runId);
48643
48685
  });
48644
48686
  addGlobalOptions(runCmd.command("drive").description("Drive a run with an explicit model-free simulation")).argument("<runId>", "Run id").option("--simulated", "Use the model-free simulation producer").action(async function runDriveAction(runId, options) {
@@ -17121,7 +17121,7 @@ async function deliverInboxNotification(messageId, delivered, notify) {
17121
17121
  }
17122
17122
 
17123
17123
  // plugins/kxm/src/mcp-server.ts
17124
- var VERSION = "0.7.23";
17124
+ var VERSION = "0.7.24";
17125
17125
  var inbox = /* @__PURE__ */ new Map();
17126
17126
  var notifiedInbox = /* @__PURE__ */ new Set();
17127
17127
  var meshClient;