@kontextmind/kxm 0.7.182 → 0.7.183

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.182",
14
+ "version": "0.7.183",
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.182",
3
+ "version": "0.7.183",
4
4
  "description": "KXM local-first multi-agent orchestration and operator dashboard",
5
5
  "type": "module",
6
6
  "author": "KontextMind",
@@ -77,9 +77,9 @@
77
77
  ]
78
78
  },
79
79
  "dependencies": {
80
- "@anthropic-ai/claude-agent-sdk": "0.3.289",
81
- "@earendil-works/pi-tui": "1.0.2",
82
- "@modelcontextprotocol/sdk": "1.32.0",
80
+ "@anthropic-ai/claude-agent-sdk": "0.3.296",
81
+ "@earendil-works/pi-tui": "1.1.0",
82
+ "@modelcontextprotocol/sdk": "1.32.1",
83
83
  "yaml": "^2.9.0"
84
84
  },
85
85
  "peerDependencies": {
@@ -95,17 +95,17 @@
95
95
  }
96
96
  },
97
97
  "devDependencies": {
98
- "@earendil-works/pi-coding-agent": "1.0.2",
99
- "@modelcontextprotocol/sdk": "1.32.0",
100
- "@playwright/test": "1.63.0",
101
- "@types/node": "26.6.4",
98
+ "@earendil-works/pi-coding-agent": "1.1.0",
99
+ "@modelcontextprotocol/sdk": "1.32.1",
100
+ "@playwright/test": "1.64.0",
101
+ "@types/node": "26.6.5",
102
102
  "ajv": "8.20.0",
103
103
  "commander": "15.0.0",
104
104
  "esbuild": "0.28.2",
105
105
  "markdownlint-cli2": "0.23.3",
106
- "nx": "23.2.1",
106
+ "nx": "23.3.0",
107
107
  "tsx": "^4.23.13",
108
- "typebox": "1.3.34",
108
+ "typebox": "1.3.36",
109
109
  "typescript": "7.0.2"
110
110
  },
111
111
  "files": [
@@ -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.182",
5
+ "version": "0.7.183",
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",
@@ -45242,6 +45242,9 @@ function detectCapabilitiesFromEnvironment(tmuxForwardsHyperlink) {
45242
45242
  if (term.startsWith("screen")) {
45243
45243
  return { images: null, trueColor: hasTrueColorHint, hyperlinks: false };
45244
45244
  }
45245
+ if (termProgram === "herdr") {
45246
+ return { images: null, trueColor: hasTrueColorHint, hyperlinks: true };
45247
+ }
45245
45248
  if (process.env.KITTY_WINDOW_ID || termProgram === "kitty") {
45246
45249
  return { images: "kitty", trueColor: true, hyperlinks: true };
45247
45250
  }
@@ -46397,6 +46400,10 @@ var Box = class {
46397
46400
  setBgFn(bgFn) {
46398
46401
  this.bgFn = bgFn;
46399
46402
  }
46403
+ setPaddingX(paddingX) {
46404
+ this.paddingX = paddingX;
46405
+ this.invalidateCache();
46406
+ }
46400
46407
  invalidateCache() {
46401
46408
  this.cache = void 0;
46402
46409
  }
@@ -46506,11 +46513,11 @@ var TUI_KEYBINDINGS = {
46506
46513
  description: "Move cursor word right"
46507
46514
  },
46508
46515
  "tui.editor.cursorLineStart": {
46509
- defaultKeys: ["home", "ctrl+home", "ctrl+a"],
46516
+ defaultKeys: ["home", "ctrl+a"],
46510
46517
  description: "Move to line start"
46511
46518
  },
46512
46519
  "tui.editor.cursorLineEnd": {
46513
- defaultKeys: ["end", "ctrl+end", "ctrl+e"],
46520
+ defaultKeys: ["end", "ctrl+e"],
46514
46521
  description: "Move to line end"
46515
46522
  },
46516
46523
  "tui.editor.jumpForward": {
@@ -46615,8 +46622,8 @@ var TUI_KEYBINDINGS = {
46615
46622
  defaultKeys: "escape",
46616
46623
  description: "Close transcript search"
46617
46624
  },
46618
- "tui.altScreen.top": { defaultKeys: "home", description: "Scroll viewport to top" },
46619
- "tui.altScreen.bottom": { defaultKeys: "end", description: "Scroll viewport to bottom" }
46625
+ "tui.altScreen.top": { defaultKeys: "ctrl+home", description: "Scroll viewport to top" },
46626
+ "tui.altScreen.bottom": { defaultKeys: "ctrl+end", description: "Scroll viewport to bottom" }
46620
46627
  };
46621
46628
  function normalizeKeys(keys) {
46622
46629
  if (keys === void 0)
@@ -46737,6 +46744,10 @@ var Text = class {
46737
46744
  this.cachedWidth = void 0;
46738
46745
  this.cachedLines = void 0;
46739
46746
  }
46747
+ setPaddingX(paddingX) {
46748
+ this.paddingX = paddingX;
46749
+ this.invalidate();
46750
+ }
46740
46751
  invalidate() {
46741
46752
  this.cachedText = void 0;
46742
46753
  this.cachedWidth = void 0;
@@ -47850,6 +47861,40 @@ function getNativePlatformHelper() {
47850
47861
  return loadNativePlatformHelper(process.platform);
47851
47862
  }
47852
47863
 
47864
+ // node_modules/@earendil-works/pi-tui/dist/program-status.js
47865
+ var PROGRAM_STATUS_QUERY = "\x1B]7501;?\x1B\\";
47866
+ function isProgramStatusReply(sequence) {
47867
+ return /^\x1b\]7501;\?[^\x07\x1b]*(?:\x07|\x1b\\)$/.test(sequence);
47868
+ }
47869
+ var APP_PATTERN = /^[A-Za-z0-9_.+-]{1,32}$/;
47870
+ var CONTROL_CHARACTERS2 = /[\u0000-\u001f\u007f-\u009f]+/g;
47871
+ var MAX_MESSAGE_BYTES = 2048;
47872
+ function truncateUtf8(text, maxBytes) {
47873
+ if (Buffer.byteLength(text, "utf8") <= maxBytes)
47874
+ return text;
47875
+ let bytes = 0;
47876
+ let end = 0;
47877
+ for (const char of text) {
47878
+ const size = Buffer.byteLength(char, "utf8");
47879
+ if (bytes + size > maxBytes)
47880
+ break;
47881
+ bytes += size;
47882
+ end += char.length;
47883
+ }
47884
+ return text.slice(0, end);
47885
+ }
47886
+ function formatProgramStatus(status) {
47887
+ const pairs = [`state=${status.state}`];
47888
+ if (status.app !== void 0 && APP_PATTERN.test(status.app))
47889
+ pairs.push(`app=${status.app}`);
47890
+ if (status.state === "blocked" && status.kind)
47891
+ pairs.push(`kind=${status.kind}`);
47892
+ const message = truncateUtf8((status.message ?? "").replace(CONTROL_CHARACTERS2, " ").trim(), MAX_MESSAGE_BYTES);
47893
+ if (message)
47894
+ pairs.push(`msg=${Buffer.from(message, "utf8").toString("base64")}`);
47895
+ return `\x1B]7501;${pairs.join(":")}\x1B\\`;
47896
+ }
47897
+
47853
47898
  // node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js
47854
47899
  import { EventEmitter as EventEmitter2 } from "events";
47855
47900
  var ESC = "\x1B";
@@ -48151,7 +48196,8 @@ var TERMINAL_PROGRESS_CLEAR_SEQUENCE = "\x1B]9;4;0\x07";
48151
48196
  var NATIVE_SHIFT_ENTER_SEQUENCE = "\x1B[13;2u";
48152
48197
  var DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS = 7;
48153
48198
  var KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS = 150;
48154
- var KITTY_KEYBOARD_PROTOCOL_QUERY = `\x1B[>${DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS}u\x1B[?u\x1B[c`;
48199
+ var KITTY_KEYBOARD_PROTOCOL_QUERY = `\x1B[>${DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS}u\x1B[?u`;
48200
+ var DEVICE_ATTRIBUTES_QUERY = "\x1B[c";
48155
48201
  function parseKeyboardProtocolNegotiationSequence(sequence) {
48156
48202
  const kittyFlags = sequence.match(/^\x1b\[\?(\d+)u$/);
48157
48203
  if (kittyFlags) {
@@ -48207,6 +48253,12 @@ var ProcessTerminal = class {
48207
48253
  stdinBuffer;
48208
48254
  stdinDataHandler;
48209
48255
  progressInterval;
48256
+ /** Latest program status, kept across stop() so start() can report it again. */
48257
+ programStatus;
48258
+ /** Whether the terminal confirmed OSC 7501 support since the last start(), or `PI_PROGRAM_STATUS=1`. */
48259
+ programStatusSupported = false;
48260
+ /** The support query was sent and its DA1 sentinel has not arrived yet. */
48261
+ programStatusQueryPending = false;
48210
48262
  writeLogPath = (() => {
48211
48263
  const env = process.env.PI_TUI_WRITE_LOG || "";
48212
48264
  if (!env)
@@ -48253,6 +48305,14 @@ var ProcessTerminal = class {
48253
48305
  setupStdinBuffer() {
48254
48306
  this.stdinBuffer = new StdinBuffer({ escapeTimeout: resolveEscapeTimeoutMs() });
48255
48307
  this.stdinBuffer.on("data", (sequence) => {
48308
+ if (isProgramStatusReply(sequence)) {
48309
+ if (this.programStatusQueryPending) {
48310
+ this.programStatusQueryPending = false;
48311
+ this.programStatusSupported = true;
48312
+ this.writeProgramStatus();
48313
+ }
48314
+ return;
48315
+ }
48256
48316
  const negotiation = this.readKeyboardProtocolNegotiationSequence(sequence);
48257
48317
  if (negotiation === "pending") {
48258
48318
  this.scheduleKeyboardProtocolNegotiationBufferFlush();
@@ -48284,6 +48344,9 @@ var ProcessTerminal = class {
48284
48344
  * - 1 = disambiguate escape codes
48285
48345
  * - 2 = report event types (press/repeat/release)
48286
48346
  * - 4 = report alternate keys (shifted key, base layout key)
48347
+ *
48348
+ * The OSC 7501 program status query shares the DA sentinel: a terminal that supports it replies
48349
+ * before DA. `PI_PROGRAM_STATUS=1` or `0` skips the query.
48287
48350
  */
48288
48351
  queryAndEnableKittyProtocol() {
48289
48352
  this.setupStdinBuffer();
@@ -48291,7 +48354,12 @@ var ProcessTerminal = class {
48291
48354
  this.keyboardProtocolPushed = true;
48292
48355
  this.pendingKeyboardProtocolDeviceAttributes += 1;
48293
48356
  this.clearKeyboardProtocolNegotiationBuffer();
48294
- process.stdout.write(KITTY_KEYBOARD_PROTOCOL_QUERY);
48357
+ const programStatusOverride = process.env.PI_PROGRAM_STATUS;
48358
+ this.programStatusSupported = programStatusOverride === "1";
48359
+ this.programStatusQueryPending = programStatusOverride !== "1" && programStatusOverride !== "0";
48360
+ const programStatusQuery = this.programStatusQueryPending ? PROGRAM_STATUS_QUERY : "";
48361
+ process.stdout.write(`${KITTY_KEYBOARD_PROTOCOL_QUERY}${programStatusQuery}${DEVICE_ATTRIBUTES_QUERY}`);
48362
+ this.writeProgramStatus();
48295
48363
  }
48296
48364
  handleKeyboardProtocolNegotiationSequence(negotiationSequence) {
48297
48365
  this.clearKeyboardProtocolNegotiationBuffer();
@@ -48299,6 +48367,8 @@ var ProcessTerminal = class {
48299
48367
  if (this.pendingKeyboardProtocolDeviceAttributes === 0)
48300
48368
  return false;
48301
48369
  this.pendingKeyboardProtocolDeviceAttributes -= 1;
48370
+ if (this.pendingKeyboardProtocolDeviceAttributes === 0)
48371
+ this.programStatusQueryPending = false;
48302
48372
  }
48303
48373
  if (negotiationSequence.type === "kitty-flags") {
48304
48374
  if (negotiationSequence.flags !== 0) {
@@ -48440,6 +48510,11 @@ var ProcessTerminal = class {
48440
48510
  if (this.clearProgressInterval()) {
48441
48511
  process.stdout.write(TERMINAL_PROGRESS_CLEAR_SEQUENCE);
48442
48512
  }
48513
+ if (this.programStatusSupported && this.programStatus) {
48514
+ process.stdout.write(formatProgramStatus({ state: "clear" }));
48515
+ }
48516
+ this.programStatusSupported = false;
48517
+ this.programStatusQueryPending = false;
48443
48518
  process.stdout.write("\x1B[?2004l");
48444
48519
  const shouldDisableKittyProtocol = this.keyboardProtocolPushed || this._kittyProtocolActive;
48445
48520
  this.clearKeyboardProtocolNegotiationBuffer();
@@ -48508,6 +48583,16 @@ var ProcessTerminal = class {
48508
48583
  setTitle(title) {
48509
48584
  process.stdout.write(`\x1B]0;${title}\x07`);
48510
48585
  }
48586
+ setProgramStatus(status) {
48587
+ this.programStatus = status.state === "clear" ? void 0 : status;
48588
+ if (this.programStatusSupported)
48589
+ process.stdout.write(formatProgramStatus(status));
48590
+ }
48591
+ writeProgramStatus() {
48592
+ if (this.programStatusSupported && this.programStatus) {
48593
+ process.stdout.write(formatProgramStatus(this.programStatus));
48594
+ }
48595
+ }
48511
48596
  setProgress(active) {
48512
48597
  if (active) {
48513
48598
  process.stdout.write(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);
@@ -49325,6 +49410,11 @@ var TuiAltScreen = class extends TuiBase {
49325
49410
  return false;
49326
49411
  return this.copyTextToClipboard(text);
49327
49412
  }
49413
+ /** Drop the text selection and multi-click history, e.g. before the host replaces the transcript. */
49414
+ resetTextSelection() {
49415
+ this.clearTextSelection();
49416
+ this.lastClick = void 0;
49417
+ }
49328
49418
  /** The lines of the last rendered frame, one per terminal row, as written to the terminal. */
49329
49419
  getScreenLines() {
49330
49420
  return [...this.previousScreen];
@@ -41853,6 +41853,9 @@ function detectCapabilitiesFromEnvironment(tmuxForwardsHyperlink) {
41853
41853
  if (term.startsWith("screen")) {
41854
41854
  return { images: null, trueColor: hasTrueColorHint, hyperlinks: false };
41855
41855
  }
41856
+ if (termProgram === "herdr") {
41857
+ return { images: null, trueColor: hasTrueColorHint, hyperlinks: true };
41858
+ }
41856
41859
  if (process.env.KITTY_WINDOW_ID || termProgram === "kitty") {
41857
41860
  return { images: "kitty", trueColor: true, hyperlinks: true };
41858
41861
  }
@@ -43008,6 +43011,10 @@ var Box = class {
43008
43011
  setBgFn(bgFn) {
43009
43012
  this.bgFn = bgFn;
43010
43013
  }
43014
+ setPaddingX(paddingX) {
43015
+ this.paddingX = paddingX;
43016
+ this.invalidateCache();
43017
+ }
43011
43018
  invalidateCache() {
43012
43019
  this.cache = void 0;
43013
43020
  }
@@ -43117,11 +43124,11 @@ var TUI_KEYBINDINGS = {
43117
43124
  description: "Move cursor word right"
43118
43125
  },
43119
43126
  "tui.editor.cursorLineStart": {
43120
- defaultKeys: ["home", "ctrl+home", "ctrl+a"],
43127
+ defaultKeys: ["home", "ctrl+a"],
43121
43128
  description: "Move to line start"
43122
43129
  },
43123
43130
  "tui.editor.cursorLineEnd": {
43124
- defaultKeys: ["end", "ctrl+end", "ctrl+e"],
43131
+ defaultKeys: ["end", "ctrl+e"],
43125
43132
  description: "Move to line end"
43126
43133
  },
43127
43134
  "tui.editor.jumpForward": {
@@ -43226,8 +43233,8 @@ var TUI_KEYBINDINGS = {
43226
43233
  defaultKeys: "escape",
43227
43234
  description: "Close transcript search"
43228
43235
  },
43229
- "tui.altScreen.top": { defaultKeys: "home", description: "Scroll viewport to top" },
43230
- "tui.altScreen.bottom": { defaultKeys: "end", description: "Scroll viewport to bottom" }
43236
+ "tui.altScreen.top": { defaultKeys: "ctrl+home", description: "Scroll viewport to top" },
43237
+ "tui.altScreen.bottom": { defaultKeys: "ctrl+end", description: "Scroll viewport to bottom" }
43231
43238
  };
43232
43239
  function normalizeKeys(keys) {
43233
43240
  if (keys === void 0)
@@ -43348,6 +43355,10 @@ var Text = class {
43348
43355
  this.cachedWidth = void 0;
43349
43356
  this.cachedLines = void 0;
43350
43357
  }
43358
+ setPaddingX(paddingX) {
43359
+ this.paddingX = paddingX;
43360
+ this.invalidate();
43361
+ }
43351
43362
  invalidate() {
43352
43363
  this.cachedText = void 0;
43353
43364
  this.cachedWidth = void 0;
@@ -44422,7 +44433,7 @@ var cjsRequire = createRequire4(import.meta.url);
44422
44433
 
44423
44434
  // node_modules/@earendil-works/pi-tui/dist/terminal.js
44424
44435
  var DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS = 7;
44425
- var KITTY_KEYBOARD_PROTOCOL_QUERY = `\x1B[>${DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS}u\x1B[?u\x1B[c`;
44436
+ var KITTY_KEYBOARD_PROTOCOL_QUERY = `\x1B[>${DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS}u\x1B[?u`;
44426
44437
 
44427
44438
  // node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js
44428
44439
  var segmenter2 = getGraphemeSegmenter();
@@ -45219,6 +45230,11 @@ var TuiAltScreen = class extends TuiBase {
45219
45230
  return false;
45220
45231
  return this.copyTextToClipboard(text);
45221
45232
  }
45233
+ /** Drop the text selection and multi-click history, e.g. before the host replaces the transcript. */
45234
+ resetTextSelection() {
45235
+ this.clearTextSelection();
45236
+ this.lastClick = void 0;
45237
+ }
45222
45238
  /** The lines of the last rendered frame, one per terminal row, as written to the terminal. */
45223
45239
  getScreenLines() {
45224
45240
  return [...this.previousScreen];
@@ -25462,7 +25462,7 @@ function sessionTokenFixHint(policy) {
25462
25462
  }
25463
25463
 
25464
25464
  // plugins/kxm/src/mcp-server.ts
25465
- var VERSION = "0.7.182";
25465
+ var VERSION = "0.7.183";
25466
25466
  var CONFIGURE_PLUGIN = "/plugin configure kxm@kxm";
25467
25467
  var inbox = /* @__PURE__ */ new Map();
25468
25468
  var notifiedInbox = /* @__PURE__ */ new Set();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-plugin",
3
- "version": "0.7.182",
3
+ "version": "0.7.183",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "engines": {
@@ -11,7 +11,7 @@ import { deliverInboxNotification } from "./inbox.ts";
11
11
  import type { HubEvent, MessageRecord } from "./protocol.ts";
12
12
  import { sessionTokenFixHint } from "./session-token-hint.ts";
13
13
 
14
- const VERSION = "0.7.182";
14
+ const VERSION = "0.7.183";
15
15
  const CONFIGURE_PLUGIN = "/plugin configure kxm@kxm";
16
16
  const inbox = new Map<string, MessageRecord>();
17
17
  const notifiedInbox = new Set<string>();