mixdog 0.9.19 → 0.9.20

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 (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -29
  3. package/package.json +3 -2
  4. package/scripts/build-runtime-windows.ps1 +242 -242
  5. package/scripts/build-tui.mjs +6 -0
  6. package/scripts/hook-bus-test.mjs +8 -0
  7. package/scripts/log-writer-guard-smoke.mjs +131 -0
  8. package/scripts/reactive-compact-persist-smoke.mjs +22 -6
  9. package/scripts/recall-bench-cases.json +0 -1
  10. package/scripts/recall-quality-cases.json +1 -2
  11. package/scripts/recall-usecase-cases.json +1 -1
  12. package/scripts/session-ingest-compaction-smoke.mjs +241 -0
  13. package/scripts/smoke-runtime-negative.ps1 +106 -106
  14. package/scripts/tool-efficiency-diag.mjs +1 -1
  15. package/scripts/tool-smoke.mjs +150 -45
  16. package/src/help.mjs +2 -5
  17. package/src/lib/mixdog-debug.cjs +13 -0
  18. package/src/mixdog-session-runtime.mjs +7 -3328
  19. package/src/rules/lead/02-channels.md +3 -3
  20. package/src/runtime/agent/orchestrator/context/collect.mjs +33 -9
  21. package/src/runtime/agent/orchestrator/session/agent-loop.mjs +663 -0
  22. package/src/runtime/agent/orchestrator/session/compact/engine.mjs +6 -0
  23. package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +153 -0
  24. package/src/runtime/agent/orchestrator/session/loop/recall-fasttrack.mjs +49 -0
  25. package/src/runtime/agent/orchestrator/session/loop/stored-tool-args.mjs +9 -1
  26. package/src/runtime/agent/orchestrator/session/loop.mjs +8 -1860
  27. package/src/runtime/agent/orchestrator/session/manager/agent-runtime-singleton.mjs +29 -0
  28. package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +686 -0
  29. package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +60 -12
  30. package/src/runtime/agent/orchestrator/session/manager/env-utils.mjs +8 -0
  31. package/src/runtime/agent/orchestrator/session/manager/idle-cleanup.mjs +159 -0
  32. package/src/runtime/agent/orchestrator/session/manager/message-sanitize.mjs +143 -0
  33. package/src/runtime/agent/orchestrator/session/manager/prefetch-bridge.mjs +268 -0
  34. package/src/runtime/agent/orchestrator/session/manager/provider-cache-key.mjs +22 -0
  35. package/src/runtime/agent/orchestrator/session/manager/runtime-loaders.mjs +26 -0
  36. package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +124 -0
  37. package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +258 -0
  38. package/src/runtime/agent/orchestrator/session/manager/session-errors.mjs +20 -0
  39. package/src/runtime/agent/orchestrator/session/manager/session-id.mjs +9 -0
  40. package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +475 -0
  41. package/src/runtime/agent/orchestrator/session/manager/session-lock.mjs +23 -0
  42. package/src/runtime/agent/orchestrator/session/manager.mjs +88 -2285
  43. package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +440 -0
  44. package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +153 -0
  45. package/src/runtime/agent/orchestrator/session/store.mjs +4 -1
  46. package/src/runtime/agent/orchestrator/session/tool-batch.mjs +642 -0
  47. package/src/runtime/agent/orchestrator/tools/bash-session.mjs +23 -3
  48. package/src/runtime/agent/orchestrator/tools/builtin/shell-job-paths.mjs +108 -2
  49. package/src/runtime/agent/orchestrator/tools/builtin/shell-job-process.mjs +15 -3
  50. package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +7 -0
  51. package/src/runtime/agent/orchestrator/tools/builtin/shell-runtime.mjs +24 -2
  52. package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +2 -2
  53. package/src/runtime/agent/orchestrator/tools/patch/parsing.mjs +72 -8
  54. package/src/runtime/agent/orchestrator/tools/shell-policy-danger-target.mjs +5 -1
  55. package/src/runtime/channels/index.mjs +6 -2183
  56. package/src/runtime/channels/lib/inbound-handler.mjs +328 -0
  57. package/src/runtime/channels/lib/interaction-handlers.mjs +260 -0
  58. package/src/runtime/channels/lib/network-retry.mjs +23 -0
  59. package/src/runtime/channels/lib/owned-runtime.mjs +547 -0
  60. package/src/runtime/channels/lib/transcript-binding.mjs +336 -0
  61. package/src/runtime/channels/lib/voice-runtime-fetcher.mjs +39 -2
  62. package/src/runtime/channels/lib/worker-bootstrap.mjs +97 -0
  63. package/src/runtime/channels/lib/worker-ipc.mjs +201 -0
  64. package/src/runtime/channels/lib/worker-main.mjs +771 -0
  65. package/src/runtime/memory/index.mjs +73 -1725
  66. package/src/runtime/memory/lib/embedding-provider.mjs +4 -2
  67. package/src/runtime/memory/lib/embedding-worker.mjs +47 -6
  68. package/src/runtime/memory/lib/http-router.mjs +772 -0
  69. package/src/runtime/memory/lib/memory-action-handlers.mjs +901 -0
  70. package/src/runtime/memory/lib/memory-embed.mjs +28 -7
  71. package/src/runtime/memory/lib/memory-recall-store.mjs +4 -4
  72. package/src/runtime/memory/lib/query-handlers.mjs +2 -2
  73. package/src/runtime/memory/lib/session-ingest-runtime.mjs +401 -0
  74. package/src/session-runtime/boot-profile.mjs +36 -0
  75. package/src/session-runtime/channel-config-api.mjs +70 -0
  76. package/src/session-runtime/context-status.mjs +181 -0
  77. package/src/session-runtime/env.mjs +17 -0
  78. package/src/session-runtime/lifecycle-api.mjs +242 -0
  79. package/src/session-runtime/model-route-api.mjs +198 -0
  80. package/src/session-runtime/provider-auth-api.mjs +135 -0
  81. package/src/session-runtime/resource-api.mjs +282 -0
  82. package/src/session-runtime/runtime-core.mjs +2046 -0
  83. package/src/session-runtime/session-turn-api.mjs +274 -0
  84. package/src/session-runtime/tool-catalog.mjs +18 -264
  85. package/src/session-runtime/tool-defs.mjs +2 -2
  86. package/src/session-runtime/workflow-agents-api.mjs +238 -0
  87. package/src/standalone/agent-tool.mjs +2 -2
  88. package/src/standalone/channel-worker.mjs +4 -0
  89. package/src/standalone/memory-runtime-proxy.mjs +56 -6
  90. package/src/tui/App.jsx +39 -28
  91. package/src/tui/app/core-memory-picker.mjs +1 -1
  92. package/src/tui/app/use-mouse-input.mjs +6 -0
  93. package/src/tui/app/use-transcript-scroll.mjs +77 -3
  94. package/src/tui/dist/index.mjs +1990 -1527
  95. package/src/tui/engine/context-state.mjs +145 -0
  96. package/src/tui/engine/prompt-history.mjs +27 -0
  97. package/src/tui/engine/session-api-ext.mjs +478 -0
  98. package/src/tui/engine/session-api.mjs +545 -0
  99. package/src/tui/engine/session-flow.mjs +485 -0
  100. package/src/tui/engine/turn.mjs +1078 -0
  101. package/src/tui/engine.mjs +68 -2620
  102. package/src/tui/index.jsx +7 -0
  103. package/vendor/ink/build/ink.js +16 -1
  104. package/vendor/ink/build/output.js +30 -4
  105. package/vendor/ink/build/render.js +5 -0
  106. package/src/workflows/sequential/WORKFLOW.md +0 -51
@@ -1,3 +1,3 @@
1
- # Channels
2
-
3
- - Channel features are handled by the runtime.
1
+ # Channels
2
+
3
+ - Channel features are handled by the runtime.
@@ -319,16 +319,34 @@ export function bp1HasDeferredToolManifestBlock(text) {
319
319
  }
320
320
 
321
321
  /**
322
- * Names-only manifest for tools in the deferred pool (catalog minus active wire tools).
322
+ * Skill-style manifest for tools in the deferred pool (catalog minus active
323
+ * wire tools). Each entry is either a bare name string or `{ name, description }`;
324
+ * output lines are `- name: description` (description omitted when absent),
325
+ * mirroring the available-skills manifest so the model calls deferred tools
326
+ * directly. Descriptions are compacted and stripped of `<`/`>`.
323
327
  * Empty pool → '' (caller omits the block).
324
328
  */
325
- export function buildDeferredToolManifest(names) {
326
- const list = [...new Set((Array.isArray(names) ? names : [])
327
- .map((name) => sanitizeDeferredToolManifestName(name))
328
- .filter(Boolean))]
329
- .sort((a, b) => a.localeCompare(b));
329
+ export function buildDeferredToolManifest(entries) {
330
+ const list = [];
331
+ const seen = new Set();
332
+ for (const entry of Array.isArray(entries) ? entries : []) {
333
+ const rawName = typeof entry === 'string' ? entry : entry?.name;
334
+ const name = sanitizeDeferredToolManifestName(rawName);
335
+ if (!name || seen.has(name)) continue;
336
+ seen.add(name);
337
+ const description = typeof entry === 'string'
338
+ ? ''
339
+ : compactSkillManifestText(String(entry?.description || '').replace(/[<>]/g, ''));
340
+ list.push({ name, description });
341
+ }
330
342
  if (!list.length) return '';
331
- return ['<available-deferred-tools>', ...list, '</available-deferred-tools>'].join('\n');
343
+ list.sort((a, b) => a.name.localeCompare(b.name));
344
+ return [
345
+ '<available-deferred-tools>',
346
+ 'You may call any tool listed below directly by name with its arguments; it auto-loads on first call.',
347
+ ...list.map((entry) => (entry.description ? `- ${entry.name}: ${entry.description}` : `- ${entry.name}`)),
348
+ '</available-deferred-tools>',
349
+ ].join('\n');
332
350
  }
333
351
 
334
352
  function sanitizeMcpManifestServerName(name) {
@@ -389,12 +407,18 @@ export function stripDeferredToolManifestBlock(text) {
389
407
  .trimEnd();
390
408
  }
391
409
 
392
- /** Inject names-only deferred pool into BP1 once at session start; never rewrite BP1 after. */
410
+ /** Inject the skill-style deferred pool (name + description) into BP1 once at session start; never rewrite BP1 after. */
393
411
  export function applyInitialDeferredToolManifestToBp1(session, poolNames) {
394
412
  if (!session || !Array.isArray(session.messages) || session.deferredToolBp1Applied) return false;
395
413
  const pool = Array.isArray(poolNames) ? poolNames : [];
414
+ const descByName = new Map();
415
+ for (const tool of Array.isArray(session?.deferredToolCatalog) ? session.deferredToolCatalog : []) {
416
+ const name = String(tool?.name || '').trim();
417
+ if (name && !descByName.has(name)) descByName.set(name, String(tool?.description || ''));
418
+ }
419
+ const entries = pool.map((name) => ({ name, description: descByName.get(String(name).trim()) || '' }));
396
420
  const parts = [];
397
- const deferredManifest = buildDeferredToolManifest(pool);
421
+ const deferredManifest = buildDeferredToolManifest(entries);
398
422
  if (deferredManifest) parts.push(deferredManifest);
399
423
  const mcpManifest = buildMcpInstructionsManifest(session.mcpServerInstructions, pool);
400
424
  if (mcpManifest) parts.push(mcpManifest);