@kontextmind/kxm 0.7.17 → 0.7.18

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.
Files changed (30) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/package.json +8 -6
  3. package/plugins/kxm/.claude-plugin/plugin.json +1 -1
  4. package/plugins/kxm/dist/cli.js +43 -39
  5. package/plugins/kxm/dist/core.js +3 -2
  6. package/plugins/kxm/dist/extension.js +34472 -11328
  7. package/plugins/kxm/dist/mcp-server.js +1 -1
  8. package/plugins/kxm/dist/runtime.js +43 -39
  9. package/plugins/kxm/dist/server.js +43 -39
  10. package/plugins/kxm/dist/vnext-runtime-supervisor.js +40 -37
  11. package/plugins/kxm/package.json +4 -1
  12. package/plugins/kxm/src/extension.ts +9 -0
  13. package/plugins/kxm/src/mcp-server.ts +1 -1
  14. package/plugins/kxm/src/providers/claude-bridge/LICENSE +21 -0
  15. package/plugins/kxm/src/providers/claude-bridge/README.md +18 -0
  16. package/plugins/kxm/src/providers/claude-bridge/config.ts +53 -0
  17. package/plugins/kxm/src/providers/claude-bridge/convert.ts +180 -0
  18. package/plugins/kxm/src/providers/claude-bridge/index.ts +28 -0
  19. package/plugins/kxm/src/providers/claude-bridge/mcp-server.ts +59 -0
  20. package/plugins/kxm/src/providers/claude-bridge/models.ts +166 -0
  21. package/plugins/kxm/src/providers/claude-bridge/pi-compat.ts +215 -0
  22. package/plugins/kxm/src/providers/claude-bridge/prompt-stream.ts +89 -0
  23. package/plugins/kxm/src/providers/claude-bridge/provider.ts +286 -0
  24. package/plugins/kxm/src/providers/claude-bridge/query-state.ts +72 -0
  25. package/plugins/kxm/src/providers/claude-bridge/redact.ts +26 -0
  26. package/plugins/kxm/src/providers/claude-bridge/register.ts +124 -0
  27. package/plugins/kxm/src/providers/claude-bridge/stream.ts +390 -0
  28. package/plugins/kxm/src/providers/claude-bridge/tools.ts +140 -0
  29. package/plugins/kxm/src/redact.ts +3 -2
  30. package/scripts/build-runtime.mjs +5 -1
@@ -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.17",
14
+ "version": "0.7.18",
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.17",
3
+ "version": "0.7.18",
4
4
  "description": "KXM local-first multi-agent orchestration and operator dashboard",
5
5
  "type": "module",
6
6
  "author": "KontextMind",
@@ -69,6 +69,12 @@
69
69
  "./plugins/kxm/skills"
70
70
  ]
71
71
  },
72
+ "dependencies": {
73
+ "@anthropic-ai/claude-agent-sdk": "0.2.141",
74
+ "@earendil-works/pi-tui": "0.85.1",
75
+ "@modelcontextprotocol/sdk": "1.30.0",
76
+ "yaml": "^2.9.0"
77
+ },
72
78
  "peerDependencies": {
73
79
  "@earendil-works/pi-coding-agent": "*",
74
80
  "typebox": "*"
@@ -120,9 +126,5 @@
120
126
  "LICENSE",
121
127
  "SECURITY.md"
122
128
  ],
123
- "license": "MIT",
124
- "dependencies": {
125
- "@earendil-works/pi-tui": "0.85.1",
126
- "yaml": "^2.9.0"
127
- }
129
+ "license": "MIT"
128
130
  }
@@ -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.17",
5
+ "version": "0.7.18",
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",
@@ -8072,36 +8072,38 @@ var require_Alias = __commonJS({
8072
8072
  if (node.anchor === this.source)
8073
8073
  found = node;
8074
8074
  }
8075
+ if (found && ctx) {
8076
+ const { anchors: anchors2, doc: doc2, maxAliasCount } = ctx;
8077
+ let data = anchors2.get(found);
8078
+ if (!data) {
8079
+ toJS.toJS(found, null, ctx);
8080
+ data = anchors2.get(found);
8081
+ }
8082
+ if (data?.res === void 0) {
8083
+ const msg = "This should not happen: Alias anchor was not resolved?";
8084
+ throw new ReferenceError(msg);
8085
+ }
8086
+ if (maxAliasCount >= 0) {
8087
+ data.count += 1;
8088
+ if (data.aliasCount === 0)
8089
+ data.aliasCount = getAliasCount(doc2, found, anchors2);
8090
+ if (data.count * data.aliasCount > maxAliasCount) {
8091
+ const msg = "Excessive alias count indicates a resource exhaustion attack";
8092
+ throw new ReferenceError(msg);
8093
+ }
8094
+ }
8095
+ }
8075
8096
  return found;
8076
8097
  }
8077
8098
  toJSON(_arg, ctx) {
8078
8099
  if (!ctx)
8079
8100
  return { source: this.source };
8080
- const { anchors: anchors2, doc, maxAliasCount } = ctx;
8081
- const source = this.resolve(doc, ctx);
8101
+ const source = this.resolve(ctx.doc, ctx);
8082
8102
  if (!source) {
8083
8103
  const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
8084
8104
  throw new ReferenceError(msg);
8085
8105
  }
8086
- let data = anchors2.get(source);
8087
- if (!data) {
8088
- toJS.toJS(source, null, ctx);
8089
- data = anchors2.get(source);
8090
- }
8091
- if (data?.res === void 0) {
8092
- const msg = "This should not happen: Alias anchor was not resolved?";
8093
- throw new ReferenceError(msg);
8094
- }
8095
- if (maxAliasCount >= 0) {
8096
- data.count += 1;
8097
- if (data.aliasCount === 0)
8098
- data.aliasCount = getAliasCount(doc, source, anchors2);
8099
- if (data.count * data.aliasCount > maxAliasCount) {
8100
- const msg = "Excessive alias count indicates a resource exhaustion attack";
8101
- throw new ReferenceError(msg);
8102
- }
8103
- }
8104
- return data.res;
8106
+ return ctx.anchors.get(source).res;
8105
8107
  }
8106
8108
  toString(ctx, _onComment, _onChompKeep) {
8107
8109
  const src = `*${this.source}`;
@@ -12103,37 +12105,38 @@ var require_resolve_flow_scalar = __commonJS({
12103
12105
  }
12104
12106
  if (badChar)
12105
12107
  onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
12106
- return foldLines(source);
12108
+ return unfoldLines(source);
12107
12109
  }
12108
12110
  function singleQuotedValue(source, onError) {
12109
12111
  if (source[source.length - 1] !== "'" || source.length === 1)
12110
12112
  onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
12111
- return foldLines(source.slice(1, -1)).replace(/''/g, "'");
12113
+ return unfoldLines(source.slice(1, -1)).replace(/''/g, "'");
12112
12114
  }
12113
- function foldLines(source) {
12114
- let first, line;
12115
+ function unfoldLines(source) {
12116
+ const line = /(.*?)\r?\n/sy;
12117
+ let match = line.exec(source);
12118
+ if (!match)
12119
+ return source;
12120
+ let trimEnd, trimBoth;
12115
12121
  try {
12116
- first = new RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy");
12117
- line = new RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
12122
+ trimEnd = new RegExp("(?<![ ])[ ]+$");
12123
+ trimBoth = new RegExp("^[ ]+|(?<![ ])[ ]+$", "g");
12118
12124
  } catch {
12119
- first = /(.*?)[ \t]*\r?\n/sy;
12120
- line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
12125
+ trimEnd = /[ \t]+$/;
12126
+ trimBoth = /^[ \t]+|[ \t]+$/g;
12121
12127
  }
12122
- let match = first.exec(source);
12123
- if (!match)
12124
- return source;
12125
- let res = match[1];
12128
+ let res = match[1].replace(trimEnd, "");
12126
12129
  let sep4 = " ";
12127
- let pos = first.lastIndex;
12128
- line.lastIndex = pos;
12130
+ let pos = line.lastIndex;
12129
12131
  while (match = line.exec(source)) {
12130
- if (match[1] === "") {
12132
+ const lm = match[1].replace(trimBoth, "");
12133
+ if (lm === "") {
12131
12134
  if (sep4 === "\n")
12132
12135
  res += sep4;
12133
12136
  else
12134
12137
  sep4 = "\n";
12135
12138
  } else {
12136
- res += sep4 + match[1];
12139
+ res += sep4 + lm;
12137
12140
  sep4 = " ";
12138
12141
  }
12139
12142
  pos = line.lastIndex;
@@ -25690,6 +25693,7 @@ import { fileURLToPath as fileURLToPath3 } from "node:url";
25690
25693
  // plugins/kxm/src/redact.ts
25691
25694
  var SECRET_PATTERNS = [
25692
25695
  /\bsk-[A-Za-z0-9_-]{8,}\b/g,
25696
+ /\bsk-ant-[A-Za-z0-9_-]{8,}\b/g,
25693
25697
  /\bghp_[A-Za-z0-9_]{20,}\b/g,
25694
25698
  /\bgithub_pat_[A-Za-z0-9_]{20,}\b/g,
25695
25699
  /\bxox[baprs]-[A-Za-z0-9-]{10,}\b/gi,
@@ -25697,9 +25701,9 @@ var SECRET_PATTERNS = [
25697
25701
  /\bya29\.[A-Za-z0-9._~+/-]+=*/g,
25698
25702
  /\b1\/\/[A-Za-z0-9_-]+/g,
25699
25703
  /\b1\/[A-Za-z0-9_-]{20,}/g,
25700
- /("?(?:access_token|refresh_token|id_token)"?\s*[:=]\s*")[^"]*(")/gi,
25704
+ /("?(?:access_token|refresh_token|id_token|sessionKey|session_key|claude_oauth_token|anthropicApiKey)"?\s*[:=]\s*")[^"]*(")/gi,
25701
25705
  /\bKXM_[A-Z0-9_]*(TOKEN|SECRET|KEY)[A-Z0-9_]*=\S+/gi,
25702
- /\b(GITHUB_TOKEN|GH_TOKEN|KXM_AUTH_TOKEN|KXM_WORKFLOW_SIGNAL_SECRET)=\S+/gi,
25706
+ /\b(GITHUB_TOKEN|GH_TOKEN|KXM_AUTH_TOKEN|KXM_WORKFLOW_SIGNAL_SECRET|ANTHROPIC_API_KEY|ANTHROPIC_AUTH_TOKEN|CLAUDE_API_KEY)=\S+/gi,
25703
25707
  /\b[A-Fa-f0-9]{64}\b/g
25704
25708
  ];
25705
25709
  function redactSecrets(value) {
@@ -828,6 +828,7 @@ function workerResult(worker, payload) {
828
828
  // plugins/kxm/src/redact.ts
829
829
  var SECRET_PATTERNS = [
830
830
  /\bsk-[A-Za-z0-9_-]{8,}\b/g,
831
+ /\bsk-ant-[A-Za-z0-9_-]{8,}\b/g,
831
832
  /\bghp_[A-Za-z0-9_]{20,}\b/g,
832
833
  /\bgithub_pat_[A-Za-z0-9_]{20,}\b/g,
833
834
  /\bxox[baprs]-[A-Za-z0-9-]{10,}\b/gi,
@@ -835,9 +836,9 @@ var SECRET_PATTERNS = [
835
836
  /\bya29\.[A-Za-z0-9._~+/-]+=*/g,
836
837
  /\b1\/\/[A-Za-z0-9_-]+/g,
837
838
  /\b1\/[A-Za-z0-9_-]{20,}/g,
838
- /("?(?:access_token|refresh_token|id_token)"?\s*[:=]\s*")[^"]*(")/gi,
839
+ /("?(?:access_token|refresh_token|id_token|sessionKey|session_key|claude_oauth_token|anthropicApiKey)"?\s*[:=]\s*")[^"]*(")/gi,
839
840
  /\bKXM_[A-Z0-9_]*(TOKEN|SECRET|KEY)[A-Z0-9_]*=\S+/gi,
840
- /\b(GITHUB_TOKEN|GH_TOKEN|KXM_AUTH_TOKEN|KXM_WORKFLOW_SIGNAL_SECRET)=\S+/gi,
841
+ /\b(GITHUB_TOKEN|GH_TOKEN|KXM_AUTH_TOKEN|KXM_WORKFLOW_SIGNAL_SECRET|ANTHROPIC_API_KEY|ANTHROPIC_AUTH_TOKEN|CLAUDE_API_KEY)=\S+/gi,
841
842
  /\b[A-Fa-f0-9]{64}\b/g
842
843
  ];
843
844
  function redactSecrets(value) {