@kontextmind/kxm 0.7.96 → 0.7.98

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 (68) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.kxm/workflows/default.yaml +2 -0
  3. package/CHANGELOG.md +61 -2
  4. package/docs/concepts/architecture.md +1 -1
  5. package/docs/concepts/data-and-storage.md +1 -1
  6. package/docs/concepts/trust-model.md +3 -2
  7. package/docs/contracts/routing.md +1 -1
  8. package/docs/contributing/test-matrix.md +6 -5
  9. package/docs/glossary.md +1 -1
  10. package/docs/guides/peer-messaging.md +2 -2
  11. package/docs/guides/pi-workers.md +1 -1
  12. package/docs/guides/webhook-workflows.md +53 -18
  13. package/docs/operations/backup-and-restore.md +43 -24
  14. package/docs/operations/deploy.md +2 -2
  15. package/docs/operations/troubleshooting.md +3 -2
  16. package/docs/reference/cli-reference.md +65 -30
  17. package/docs/reference/config-reference.md +24 -13
  18. package/docs/reference/configuration.md +2 -2
  19. package/docs/reference/harness-routing.md +3 -3
  20. package/docs/reference/http-api.md +7 -7
  21. package/docs/reference/tools.md +1 -1
  22. package/docs/reference/workflow-definitions.md +2 -2
  23. package/docs/start/first-workflow.md +4 -4
  24. package/docs/start/quickstart-claude-code.md +2 -2
  25. package/docs/start/quickstart-pi.md +1 -1
  26. package/examples/workflow-signal.ts +4 -5
  27. package/package.json +1 -1
  28. package/plugins/kxm/.claude-plugin/plugin.json +1 -1
  29. package/plugins/kxm/dist/claude-hook.js +11 -1
  30. package/plugins/kxm/dist/cli.js +552 -228
  31. package/plugins/kxm/dist/client.js +3 -1
  32. package/plugins/kxm/dist/core.js +16 -3
  33. package/plugins/kxm/dist/extension.js +45 -13
  34. package/plugins/kxm/dist/mcp-server.js +20 -4
  35. package/plugins/kxm/dist/runtime-supervisor.js +232 -51
  36. package/plugins/kxm/dist/runtime.js +432 -95
  37. package/plugins/kxm/dist/server.js +122 -20
  38. package/plugins/kxm/package.json +1 -1
  39. package/plugins/kxm/skills/kxm-hub-ops/SKILL.md +4 -3
  40. package/plugins/kxm/skills/kxm-project-setup/SKILL.md +3 -2
  41. package/plugins/kxm/skills/kxm-routing-improve/SKILL.md +3 -0
  42. package/plugins/kxm/skills/kxm-runs/SKILL.md +8 -7
  43. package/plugins/kxm/src/cli/project.ts +22 -13
  44. package/plugins/kxm/src/cli/system.ts +22 -1
  45. package/plugins/kxm/src/cli/workflows.ts +12 -7
  46. package/plugins/kxm/src/cli.ts +30 -8
  47. package/plugins/kxm/src/client.ts +4 -0
  48. package/plugins/kxm/src/commands.ts +23 -1
  49. package/plugins/kxm/src/database.ts +210 -36
  50. package/plugins/kxm/src/engine.ts +117 -2
  51. package/plugins/kxm/src/extension.ts +20 -14
  52. package/plugins/kxm/src/github-watch.ts +8 -5
  53. package/plugins/kxm/src/harness.ts +29 -0
  54. package/plugins/kxm/src/hub-env.ts +19 -1
  55. package/plugins/kxm/src/hub.ts +105 -21
  56. package/plugins/kxm/src/improve-sources.ts +2 -7
  57. package/plugins/kxm/src/init-guide-setup.ts +43 -28
  58. package/plugins/kxm/src/mcp-server.ts +9 -2
  59. package/plugins/kxm/src/oneshot-producer.ts +16 -8
  60. package/plugins/kxm/src/prices.ts +33 -2
  61. package/plugins/kxm/src/routing.ts +13 -7
  62. package/plugins/kxm/src/runtime-store.ts +23 -0
  63. package/plugins/kxm/src/studio-layout.ts +5 -4
  64. package/plugins/kxm/src/template.ts +31 -0
  65. package/plugins/kxm/src/workflow.ts +70 -1
  66. package/plugins/kxm/src/worktree-witness.ts +71 -0
  67. package/schemas/backup-manifest.schema.json +33 -0
  68. package/scripts/smoke-multi-pi.mjs +5 -1
@@ -8913,6 +8913,7 @@ __export(commands_exports, {
8913
8913
  AGENT_COMMANDS_MAP: () => AGENT_COMMANDS_MAP,
8914
8914
  clearSessionTokenFromDisk: () => clearSessionTokenFromDisk,
8915
8915
  enforceToolPolicy: () => enforceToolPolicy,
8916
+ forwardedHops: () => forwardedHops,
8916
8917
  getCliAgentCommands: () => getCliAgentCommands,
8917
8918
  getMcpTools: () => getMcpTools,
8918
8919
  getPiToolDefinitions: () => getPiToolDefinitions,
@@ -8932,6 +8933,13 @@ import { createHash, randomUUID as randomUUID3, timingSafeEqual } from "node:cry
8932
8933
  import { chmodSync, existsSync as existsSync7, mkdirSync as mkdirSync6, readFileSync as readFileSync8, unlinkSync, writeFileSync as writeFileSync5 } from "node:fs";
8933
8934
  import { homedir as homedir3 } from "node:os";
8934
8935
  import { dirname as dirname3, join as join7, resolve as resolve5 } from "node:path";
8936
+ function forwardedHops(handling) {
8937
+ if (!handling?.length) return void 0;
8938
+ return {
8939
+ hops: Math.max(...handling.map((message) => message.hops)) + 1,
8940
+ maxHops: Math.min(...handling.map((message) => message.maxHops))
8941
+ };
8942
+ }
8935
8943
  function requiredString(value, name) {
8936
8944
  if (typeof value !== "string" || value.trim() === "") throw new Error(`${name} is required`);
8937
8945
  return value.trim();
@@ -9336,12 +9344,13 @@ var init_commands = __esm({
9336
9344
  required: ["target", "content"],
9337
9345
  additionalProperties: false
9338
9346
  },
9339
- async execute(client, args) {
9347
+ async execute(client, args, context) {
9340
9348
  const delivery = optionalString(args.delivery);
9341
9349
  const correlationId = optionalString(args.correlationId);
9342
9350
  const idempotencyKey = optionalString(args.idempotencyKey);
9343
9351
  const workflowContext = optionalWorkflowContext(args.workflowContext);
9344
9352
  const message = await client.send({
9353
+ ...forwardedHops(context?.handling),
9345
9354
  target: requiredString(args.target, "target"),
9346
9355
  content: requiredString(args.content, "content"),
9347
9356
  ...delivery ? { delivery } : {},
@@ -9419,6 +9428,7 @@ var init_commands = __esm({
9419
9428
  const targets = Array.isArray(args.targets) ? args.targets.map((t) => requiredString(t, "target")) : [];
9420
9429
  return {
9421
9430
  responses: await client.fanout({
9431
+ ...forwardedHops(context?.handling),
9422
9432
  targets,
9423
9433
  content: requiredString(args.content, "content"),
9424
9434
  ...optionalString(args.correlationId) ? { correlationId: optionalString(args.correlationId) } : {},