@kontextmind/kxm 0.7.0 → 0.7.10
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/.kxm/roles/writer.yaml +2 -0
- package/docs/README.md +3 -0
- package/docs/adr/ADR-0002-browser-automation-steel-doks.md +103 -0
- package/docs/agent-skills.md +19 -2
- package/docs/browser-automation.md +116 -0
- package/docs/configuration.md +10 -1
- package/docs/getting-started.md +21 -0
- package/docs/kb/how-credentials-retrieved-safely.md +31 -0
- package/docs/kb/how-to-capture-and-annotate-section.md +60 -0
- package/docs/kb/how-to-connect-playwright-to-steel.md +54 -0
- package/docs/kb/how-to-recover-expired-session-or-orphan.md +54 -0
- package/docs/kb/how-to-resume-after-mfa.md +28 -0
- package/docs/kb/how-to-take-over-session.md +32 -0
- package/docs/kb/why-authentication-disappeared.md +32 -0
- package/docs/kb/why-automation-opened-different-browser.md +32 -0
- package/docs/kb/why-session-viewer-cannot-control.md +31 -0
- package/docs/operations.md +24 -0
- package/docs/prompts/browser-annotate-feedback.md +41 -0
- package/docs/prompts/browser-diagnose-recover.md +38 -0
- package/docs/prompts/browser-explore.md +42 -0
- package/docs/prompts/browser-repro-fix.md +48 -0
- package/docs/prompts/browser-start.md +41 -0
- package/docs/prompts/browser-takeover.md +50 -0
- package/docs/skills/repo-work-delivery.md +5 -0
- package/docs/skills.md +2 -0
- package/docs/troubleshooting.md +22 -1
- package/package.json +1 -1
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/dist/cli.js +41203 -38364
- package/plugins/kxm/dist/core.js +57 -0
- package/plugins/kxm/dist/extension.js +40 -3
- package/plugins/kxm/dist/mcp-server.js +1 -1
- package/plugins/kxm/dist/runtime.js +1582 -81
- package/plugins/kxm/dist/server.js +129 -4
- package/plugins/kxm/dist/vnext-runtime-supervisor.js +221 -41
- package/plugins/kxm/package.json +1 -1
- package/plugins/kxm/skills/hints.json +30 -0
- package/plugins/kxm/skills/kxm-browser-annotate/SKILL.md +90 -0
- package/plugins/kxm/skills/kxm-browser-auth/SKILL.md +47 -0
- package/plugins/kxm/skills/kxm-browser-diagnostics/SKILL.md +48 -0
- package/plugins/kxm/skills/kxm-browser-explore/SKILL.md +48 -0
- package/plugins/kxm/skills/kxm-browser-session/SKILL.md +94 -0
- package/plugins/kxm/skills/kxm-browser-takeover/SKILL.md +87 -0
- package/plugins/kxm/skills/kxm-browser-verify/SKILL.md +71 -0
- package/plugins/kxm/skills/kxm-hub-ops/SKILL.md +9 -0
- package/plugins/kxm/skills/kxm-project-setup/SKILL.md +9 -2
- package/plugins/kxm/src/autocomplete.ts +1 -1
- package/plugins/kxm/src/browser.ts +603 -0
- package/plugins/kxm/src/cli/context-skills.ts +373 -0
- package/plugins/kxm/src/cli/hub.ts +614 -0
- package/plugins/kxm/src/cli/roles.ts +615 -0
- package/plugins/kxm/src/cli/system.ts +906 -0
- package/plugins/kxm/src/cli/tasks.ts +364 -0
- package/plugins/kxm/src/cli/types.ts +270 -0
- package/plugins/kxm/src/cli/vnext.ts +698 -0
- package/plugins/kxm/src/cli/workflows.ts +699 -0
- package/plugins/kxm/src/cli.ts +238 -3791
- package/plugins/kxm/src/completion-install.ts +223 -0
- package/plugins/kxm/src/database.ts +1 -1
- package/plugins/kxm/src/external-effects.ts +1 -1
- package/plugins/kxm/src/hub-env.ts +193 -0
- package/plugins/kxm/src/init-guide-setup.ts +547 -0
- package/plugins/kxm/src/local-snapshot.ts +1 -1
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/plugins/kxm/src/model-inventory.ts +8 -8
- package/plugins/kxm/src/modes.ts +348 -0
- package/plugins/kxm/src/protocol.ts +111 -0
- package/plugins/kxm/src/role.ts +335 -0
- package/plugins/kxm/src/runtime.ts +4 -0
- package/plugins/kxm/src/safety-integrity.ts +76 -0
- package/plugins/kxm/src/sqlite.ts +76 -0
- package/plugins/kxm/src/ssh-remote.ts +560 -0
- package/plugins/kxm/src/store.ts +1 -1
- package/plugins/kxm/src/subagent-control.ts +312 -0
- package/plugins/kxm/src/vnext-bindings.ts +1 -1
- package/plugins/kxm/src/vnext-config.ts +38 -1
- package/plugins/kxm/src/vnext-engine-command.ts +2 -0
- package/plugins/kxm/src/vnext-engine.ts +16 -0
- package/plugins/kxm/src/vnext-harness.ts +92 -22
- package/plugins/kxm/src/vnext-oneshot-evidence.ts +39 -7
- package/plugins/kxm/src/vnext-oneshot-process.ts +46 -8
- package/plugins/kxm/src/vnext-oneshot-producer.ts +22 -1
- package/plugins/kxm/src/vnext-pi-producer.ts +11 -7
- package/plugins/kxm/src/vnext-runtime-store.ts +1 -1
- package/plugins/kxm/src/vnext-runtime-supervisor.ts +5 -3
- package/plugins/kxm/src/workflow-tui.ts +1 -1
- package/plugins/kxm/src/workflow.ts +144 -0
- package/schemas/vnext/modes.schema.json +56 -0
- package/scripts/kxm-bump-version.mjs +146 -0
- package/scripts/kxm-hub.mjs +145 -3
- package/scripts/kxm-publish-npm.mjs +3 -1
- package/scripts/kxm-release-github.mjs +3 -1
- package/scripts/kxm.mjs +0 -0
package/plugins/kxm/dist/core.js
CHANGED
|
@@ -59,6 +59,61 @@ function parseBoundedInteger(value, field, fallback, min, max) {
|
|
|
59
59
|
}
|
|
60
60
|
return value;
|
|
61
61
|
}
|
|
62
|
+
var TERMINAL_RECEIPT_SCHEMA = "kxm.terminal-receipt.v1";
|
|
63
|
+
var VALID_TERMINAL_STATUSES = /* @__PURE__ */ new Set(["accepted", "audit_escalation", "rejected", "error"]);
|
|
64
|
+
function validateTerminalReceipt(value) {
|
|
65
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
66
|
+
throw new ProtocolError(400, "terminal receipt must be an object", "invalid_terminal_receipt");
|
|
67
|
+
}
|
|
68
|
+
const record = value;
|
|
69
|
+
if (record.schema !== void 0 && record.schema !== TERMINAL_RECEIPT_SCHEMA) {
|
|
70
|
+
throw new ProtocolError(400, `terminal receipt schema must be ${TERMINAL_RECEIPT_SCHEMA}`, "invalid_terminal_receipt");
|
|
71
|
+
}
|
|
72
|
+
const status = record.status;
|
|
73
|
+
if (!status || !VALID_TERMINAL_STATUSES.has(status)) {
|
|
74
|
+
throw new ProtocolError(
|
|
75
|
+
400,
|
|
76
|
+
`terminal receipt status must be one of: ${Array.from(VALID_TERMINAL_STATUSES).join(", ")}`,
|
|
77
|
+
"invalid_terminal_receipt"
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
const seat = requireString(record.seat, "seat", { max: 64 });
|
|
81
|
+
const runId = requireString(record.runId, "runId", { max: 128 });
|
|
82
|
+
const stageId = requireString(record.stageId, "stageId", { max: 128 });
|
|
83
|
+
const timestamp = requireString(record.timestamp, "timestamp", { max: 64 });
|
|
84
|
+
const host = requireString(record.host, "host", { max: 64 });
|
|
85
|
+
const model = requireString(record.model, "model", { max: 128 });
|
|
86
|
+
let evidence;
|
|
87
|
+
if (record.evidence !== void 0) {
|
|
88
|
+
if (!record.evidence || typeof record.evidence !== "object" || Array.isArray(record.evidence)) {
|
|
89
|
+
throw new ProtocolError(400, "terminal receipt evidence must be an object", "invalid_terminal_receipt");
|
|
90
|
+
}
|
|
91
|
+
evidence = record.evidence;
|
|
92
|
+
}
|
|
93
|
+
let metrics;
|
|
94
|
+
if (record.metrics !== void 0) {
|
|
95
|
+
if (!record.metrics || typeof record.metrics !== "object" || Array.isArray(record.metrics)) {
|
|
96
|
+
throw new ProtocolError(400, "terminal receipt metrics must be an object", "invalid_terminal_receipt");
|
|
97
|
+
}
|
|
98
|
+
metrics = record.metrics;
|
|
99
|
+
}
|
|
100
|
+
const escalationReason = optionalString(record.escalationReason, "escalationReason", 1024);
|
|
101
|
+
const ruling = optionalString(record.ruling, "ruling", 2048);
|
|
102
|
+
return {
|
|
103
|
+
schema: TERMINAL_RECEIPT_SCHEMA,
|
|
104
|
+
status,
|
|
105
|
+
seat,
|
|
106
|
+
runId,
|
|
107
|
+
stageId,
|
|
108
|
+
timestamp,
|
|
109
|
+
host,
|
|
110
|
+
model,
|
|
111
|
+
...evidence ? { evidence } : {},
|
|
112
|
+
...metrics ? { metrics } : {},
|
|
113
|
+
...escalationReason ? { escalationReason } : {},
|
|
114
|
+
...ruling ? { ruling } : {}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
62
117
|
|
|
63
118
|
// plugins/kxm/src/routing.ts
|
|
64
119
|
import { createHash } from "node:crypto";
|
|
@@ -1957,6 +2012,7 @@ export {
|
|
|
1957
2012
|
ROUTING_RECORD_SCHEMA,
|
|
1958
2013
|
ROUTING_RECORD_V2_SCHEMA,
|
|
1959
2014
|
ROUTING_REPORT_SCHEMA,
|
|
2015
|
+
TERMINAL_RECEIPT_SCHEMA,
|
|
1960
2016
|
WORKER_RESULT_SCHEMA,
|
|
1961
2017
|
WORKER_SCHEMA,
|
|
1962
2018
|
agentWorker,
|
|
@@ -1999,5 +2055,6 @@ export {
|
|
|
1999
2055
|
rotateLogFiles,
|
|
2000
2056
|
sessionTokenPath,
|
|
2001
2057
|
timingSafeStringCompare,
|
|
2058
|
+
validateTerminalReceipt,
|
|
2002
2059
|
workerResult
|
|
2003
2060
|
};
|
|
@@ -9647,7 +9647,45 @@ import { join as join7 } from "node:path";
|
|
|
9647
9647
|
import { existsSync as existsSync2, readdirSync, readFileSync as readFileSync4 } from "node:fs";
|
|
9648
9648
|
import { homedir as homedir2 } from "node:os";
|
|
9649
9649
|
import { isAbsolute, join as join4, resolve as resolve2 } from "node:path";
|
|
9650
|
-
|
|
9650
|
+
|
|
9651
|
+
// plugins/kxm/src/sqlite.ts
|
|
9652
|
+
import { createRequire } from "node:module";
|
|
9653
|
+
var requireFromHere = createRequire(import.meta.url);
|
|
9654
|
+
function loadNative() {
|
|
9655
|
+
try {
|
|
9656
|
+
const mod = requireFromHere("node:sqlite");
|
|
9657
|
+
if (mod.DatabaseSync) return { Ctor: mod.DatabaseSync, bun: false };
|
|
9658
|
+
} catch {
|
|
9659
|
+
}
|
|
9660
|
+
try {
|
|
9661
|
+
const mod = requireFromHere("bun:sqlite");
|
|
9662
|
+
const Ctor = mod?.DatabaseSync ?? mod?.Database;
|
|
9663
|
+
if (Ctor) return { Ctor, bun: true };
|
|
9664
|
+
} catch {
|
|
9665
|
+
}
|
|
9666
|
+
throw new Error("kxm: no supported sqlite module found (need node:sqlite or bun:sqlite)");
|
|
9667
|
+
}
|
|
9668
|
+
var native = loadNative();
|
|
9669
|
+
var DatabaseSync = class {
|
|
9670
|
+
inner;
|
|
9671
|
+
constructor(path, options) {
|
|
9672
|
+
let normalized = options;
|
|
9673
|
+
if (native.bun && options) {
|
|
9674
|
+
const { readOnly, ...rest } = options;
|
|
9675
|
+
normalized = readOnly === void 0 ? rest : { ...rest, readonly: readOnly };
|
|
9676
|
+
}
|
|
9677
|
+
this.inner = normalized === void 0 ? new native.Ctor(path) : new native.Ctor(path, normalized);
|
|
9678
|
+
}
|
|
9679
|
+
prepare(sql) {
|
|
9680
|
+
return this.inner.prepare(sql);
|
|
9681
|
+
}
|
|
9682
|
+
exec(sql) {
|
|
9683
|
+
return this.inner.exec(sql);
|
|
9684
|
+
}
|
|
9685
|
+
close() {
|
|
9686
|
+
this.inner.close();
|
|
9687
|
+
}
|
|
9688
|
+
};
|
|
9651
9689
|
|
|
9652
9690
|
// plugins/kxm/src/telemetry.ts
|
|
9653
9691
|
import { appendFileSync, mkdirSync as mkdirSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
@@ -10469,7 +10507,6 @@ function kxmSlashCompletions(prefix) {
|
|
|
10469
10507
|
// plugins/kxm/src/workflow-tui.ts
|
|
10470
10508
|
import { existsSync as existsSync6, readFileSync as readFileSync8 } from "node:fs";
|
|
10471
10509
|
import { join as join9 } from "node:path";
|
|
10472
|
-
import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
|
|
10473
10510
|
|
|
10474
10511
|
// plugins/kxm/src/config.ts
|
|
10475
10512
|
var import_yaml = __toESM(require_dist(), 1);
|
|
@@ -10484,7 +10521,7 @@ function loadActiveWorkflowProgress(repoRoot = process.cwd(), targetRunId) {
|
|
|
10484
10521
|
if (!existsSync6(dbPath)) return void 0;
|
|
10485
10522
|
let db;
|
|
10486
10523
|
try {
|
|
10487
|
-
db = new
|
|
10524
|
+
db = new DatabaseSync(dbPath, { readOnly: true });
|
|
10488
10525
|
let row;
|
|
10489
10526
|
if (targetRunId) {
|
|
10490
10527
|
row = db.prepare("SELECT record FROM workflow_runs WHERE id = ?").get(targetRunId);
|
|
@@ -17036,7 +17036,7 @@ async function deliverInboxNotification(messageId, delivered, notify) {
|
|
|
17036
17036
|
}
|
|
17037
17037
|
|
|
17038
17038
|
// plugins/kxm/src/mcp-server.ts
|
|
17039
|
-
var VERSION = "0.7.
|
|
17039
|
+
var VERSION = "0.7.10";
|
|
17040
17040
|
var inbox = /* @__PURE__ */ new Map();
|
|
17041
17041
|
var notifiedInbox = /* @__PURE__ */ new Set();
|
|
17042
17042
|
var meshClient;
|