@kontextmind/kxm 0.7.23 → 0.7.25
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/package.json +1 -1
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/dist/cli.js +59 -5
- package/plugins/kxm/dist/mcp-server.js +1 -1
- package/plugins/kxm/dist/runtime.js +507 -27
- package/plugins/kxm/dist/vnext-runtime-supervisor.js +500 -26
- package/plugins/kxm/package.json +1 -1
- package/plugins/kxm/src/cli/vnext.ts +65 -3
- package/plugins/kxm/src/cli.ts +1 -1
- package/plugins/kxm/src/database.ts +3 -1
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/plugins/kxm/src/vnext-config.ts +31 -0
- package/plugins/kxm/src/vnext-engine-fold.ts +87 -2
- package/plugins/kxm/src/vnext-engine-gate-records.ts +19 -6
- package/plugins/kxm/src/vnext-engine.ts +325 -9
- package/plugins/kxm/src/vnext-runtime-owner.ts +2 -0
- package/plugins/kxm/src/vnext-runtime-store.ts +158 -2
- package/plugins/kxm/src/vnext-runtime-supervisor.ts +24 -3
- package/plugins/kxm/src/vnext-runtime.ts +17 -3
- package/schemas/vnext/common.schema.json +1 -0
- package/schemas/vnext/drive-receipt.schema.json +95 -0
- package/schemas/vnext/run-event.schema.json +39 -0
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.25",
|
|
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",
|
package/plugins/kxm/dist/cli.js
CHANGED
|
@@ -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:
|
|
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,40 @@ ${RUN_ENGINE_NOTICE}`);
|
|
|
33630
33642
|
return 1;
|
|
33631
33643
|
}
|
|
33632
33644
|
}
|
|
33645
|
+
function formatCancelledStatus(reason) {
|
|
33646
|
+
return reason.length > 0 ? `cancelled (${reason})` : "cancelled";
|
|
33647
|
+
}
|
|
33648
|
+
function formatDriveStatusLine(runStatus, drive) {
|
|
33649
|
+
if (!drive || typeof drive.driveId !== "string" || drive.driveId.length === 0) return void 0;
|
|
33650
|
+
const receipt = drive.receipt ?? null;
|
|
33651
|
+
if (receipt === null) {
|
|
33652
|
+
if (runStatus === "running" || runStatus === "blocked_uncertain") {
|
|
33653
|
+
return `drive ${drive.driveId}: open`;
|
|
33654
|
+
}
|
|
33655
|
+
return `drive ${drive.driveId}: no receipt (orphaned)`;
|
|
33656
|
+
}
|
|
33657
|
+
const kind = receipt.settlement?.kind;
|
|
33658
|
+
const reason = typeof receipt.settlement?.reason === "string" ? receipt.settlement.reason : "";
|
|
33659
|
+
if (kind === "unsettled") {
|
|
33660
|
+
return `drive ${drive.driveId}: unsettled ${reason}`.trimEnd();
|
|
33661
|
+
}
|
|
33662
|
+
if (kind === "handoff") {
|
|
33663
|
+
return drive.verified === true ? `drive ${drive.driveId}: handoff (receipt verified)` : `drive ${drive.driveId}: handoff`;
|
|
33664
|
+
}
|
|
33665
|
+
if (receipt.settlement?.status === "cancelled") {
|
|
33666
|
+
const label = formatCancelledStatus(reason);
|
|
33667
|
+
return drive.verified === true ? `drive ${drive.driveId}: ${label} (receipt verified)` : `drive ${drive.driveId}: ${label}`;
|
|
33668
|
+
}
|
|
33669
|
+
if (drive.verified === true) {
|
|
33670
|
+
return `drive ${drive.driveId}: completed (receipt verified)`;
|
|
33671
|
+
}
|
|
33672
|
+
return `drive ${drive.driveId}: completed`;
|
|
33673
|
+
}
|
|
33674
|
+
function formatRunStatusLine(run, drive) {
|
|
33675
|
+
const reason = typeof drive?.receipt?.settlement?.reason === "string" ? drive.receipt.settlement.reason : "";
|
|
33676
|
+
const statusLabel = run.status === "cancelled" ? formatCancelledStatus(reason) : run.status;
|
|
33677
|
+
return `run ${run.runId}: ${statusLabel} (workflow ${run.workflowId}, updated ${run.updatedAt})`;
|
|
33678
|
+
}
|
|
33633
33679
|
async function cmdVnextRunStatus(runtime, runId) {
|
|
33634
33680
|
try {
|
|
33635
33681
|
const projectRoot = discoverVnextProjectRoot(runtime.cwd);
|
|
@@ -33637,10 +33683,18 @@ async function cmdVnextRunStatus(runtime, runId) {
|
|
|
33637
33683
|
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
33684
|
return 1;
|
|
33639
33685
|
}
|
|
33640
|
-
const supervisor = await ensureVnextSupervisor({ env: runtime.env });
|
|
33641
|
-
const result = await vnextRuntimeRequest(supervisor, "GET", `/v1/runs/${encodeURIComponent(runId)}?projectRoot=${encodeURIComponent(projectRoot)}`);
|
|
33686
|
+
const supervisor = await (vnextDriveCliSeams.ensureSupervisor ?? ensureVnextSupervisor)({ env: runtime.env });
|
|
33687
|
+
const result = await (vnextDriveCliSeams.runtimeRequest ?? vnextRuntimeRequest)(supervisor, "GET", `/v1/runs/${encodeURIComponent(runId)}?projectRoot=${encodeURIComponent(projectRoot)}`);
|
|
33642
33688
|
const run = result.run;
|
|
33643
|
-
|
|
33689
|
+
const drive = result.drive;
|
|
33690
|
+
const driveLine = formatDriveStatusLine(run.status, drive);
|
|
33691
|
+
print(
|
|
33692
|
+
runtime.io,
|
|
33693
|
+
runtime.json,
|
|
33694
|
+
{ ok: true, command: "runs status", run, ...drive !== void 0 ? { drive } : {} },
|
|
33695
|
+
`${formatRunStatusLine(run, drive)}${driveLine ? `
|
|
33696
|
+
${driveLine}` : ""}`
|
|
33697
|
+
);
|
|
33644
33698
|
return 0;
|
|
33645
33699
|
} catch (error) {
|
|
33646
33700
|
if (error instanceof VnextConfigError) {
|
|
@@ -48638,7 +48692,7 @@ function createProgram(ctx, result) {
|
|
|
48638
48692
|
}));
|
|
48639
48693
|
const runCmd = addGlobalOptions(program2.command("runs").description("Inspect vNext runs"));
|
|
48640
48694
|
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) {
|
|
48695
|
+
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
48696
|
result.code = await cmdVnextRunStatus(runtimeFrom(ctx, this), runId);
|
|
48643
48697
|
});
|
|
48644
48698
|
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.
|
|
17124
|
+
var VERSION = "0.7.25";
|
|
17125
17125
|
var inbox = /* @__PURE__ */ new Map();
|
|
17126
17126
|
var notifiedInbox = /* @__PURE__ */ new Set();
|
|
17127
17127
|
var meshClient;
|