@kontextmind/kxm 0.7.150 → 0.7.151
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 +14 -0
- package/docs/architecture/agent-path.md +5 -0
- package/docs/operations/troubleshooting.md +1 -0
- package/docs/reference/cli-reference.md +4 -4
- package/docs/reference/config-reference.md +17 -4
- package/docs/reference/harness-routing.md +7 -1
- package/package.json +1 -1
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/dist/cli.js +153 -60
- package/plugins/kxm/dist/core.js +22 -3
- package/plugins/kxm/dist/mcp-server.js +1 -1
- package/plugins/kxm/dist/runtime-supervisor.js +676 -130
- package/plugins/kxm/dist/runtime.js +720 -164
- package/plugins/kxm/dist/server.js +1 -1
- package/plugins/kxm/package.json +1 -1
- package/plugins/kxm/src/cli/system.ts +4 -1
- package/plugins/kxm/src/engine-fold.ts +1 -0
- package/plugins/kxm/src/engine.ts +264 -22
- package/plugins/kxm/src/improve-sources.ts +17 -3
- package/plugins/kxm/src/improve.ts +14 -0
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/plugins/kxm/src/policy-draft.mjs +2 -2
- package/plugins/kxm/src/role.ts +1 -1
- package/plugins/kxm/src/route-fallback.ts +504 -0
- package/plugins/kxm/src/route-switch.ts +49 -0
- package/plugins/kxm/src/routing.ts +24 -1
- package/schemas/common.schema.json +2 -1
- package/schemas/role.schema.json +1 -1
- package/schemas/run-event.schema.json +20 -1
package/plugins/kxm/dist/core.js
CHANGED
|
@@ -573,12 +573,14 @@ function evaluateCircuitBreaker(records, route, config, now = Date.now()) {
|
|
|
573
573
|
}
|
|
574
574
|
function generateRoutingReport(records, options = {}) {
|
|
575
575
|
const generatedAt = options.now ? options.now() : (/* @__PURE__ */ new Date()).toISOString();
|
|
576
|
+
const routeSwitches = options.routeSwitches?.filter((item) => item.from && item.to) ?? [];
|
|
576
577
|
if (records.length === 0) {
|
|
577
578
|
return {
|
|
578
579
|
schema: ROUTING_REPORT_SCHEMA,
|
|
579
580
|
generatedAt,
|
|
580
581
|
totalAttempts: 0,
|
|
581
|
-
rows: []
|
|
582
|
+
rows: [],
|
|
583
|
+
...routeSwitches.length > 0 ? { routeSwitches: [...routeSwitches] } : {}
|
|
582
584
|
};
|
|
583
585
|
}
|
|
584
586
|
const groups = /* @__PURE__ */ new Map();
|
|
@@ -742,13 +744,22 @@ function generateRoutingReport(records, options = {}) {
|
|
|
742
744
|
schema: ROUTING_REPORT_SCHEMA,
|
|
743
745
|
generatedAt,
|
|
744
746
|
totalAttempts: records.length,
|
|
745
|
-
rows
|
|
747
|
+
rows,
|
|
748
|
+
...routeSwitches.length > 0 ? { routeSwitches: [...routeSwitches] } : {}
|
|
746
749
|
};
|
|
747
750
|
}
|
|
748
751
|
function formatRoutingReport(report, options = {}) {
|
|
749
|
-
if (report.rows.length === 0) {
|
|
752
|
+
if (report.rows.length === 0 && (!report.routeSwitches || report.routeSwitches.length === 0)) {
|
|
750
753
|
return "no routing records to report";
|
|
751
754
|
}
|
|
755
|
+
if (report.rows.length === 0) {
|
|
756
|
+
const lines2 = ["no routing records to report", "", `Route switches (${report.routeSwitches.length})`];
|
|
757
|
+
for (const item of report.routeSwitches) {
|
|
758
|
+
const effort = item.effort ? ` effort ${item.effort}` : "";
|
|
759
|
+
lines2.push(` ${item.from} -> ${item.to} (${item.reason}${effort}) step ${item.stepId}`);
|
|
760
|
+
}
|
|
761
|
+
return lines2.join("\n");
|
|
762
|
+
}
|
|
752
763
|
const showListCost = Boolean(options.equivalentListCost);
|
|
753
764
|
const headers = [
|
|
754
765
|
"Harness".padEnd(10),
|
|
@@ -804,6 +815,14 @@ function formatRoutingReport(report, options = {}) {
|
|
|
804
815
|
if (report.rows.some((r) => r.flagged)) {
|
|
805
816
|
lines.push("* = unknown-cost attempts present (never ranked cheapest)");
|
|
806
817
|
}
|
|
818
|
+
if (report.routeSwitches && report.routeSwitches.length > 0) {
|
|
819
|
+
lines.push("");
|
|
820
|
+
lines.push(`Route switches (${report.routeSwitches.length})`);
|
|
821
|
+
for (const item of report.routeSwitches) {
|
|
822
|
+
const effort = item.effort ? ` effort ${item.effort}` : "";
|
|
823
|
+
lines.push(` ${item.from} -> ${item.to} (${item.reason}${effort}) step ${item.stepId}`);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
807
826
|
return lines.join("\n");
|
|
808
827
|
}
|
|
809
828
|
|
|
@@ -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.151";
|
|
17317
17317
|
var CONFIGURE_PLUGIN = "/plugin configure kxm@kxm";
|
|
17318
17318
|
var inbox = /* @__PURE__ */ new Map();
|
|
17319
17319
|
var notifiedInbox = /* @__PURE__ */ new Set();
|