mixdog 0.9.68 → 0.9.70

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 (64) hide show
  1. package/package.json +8 -4
  2. package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +1 -6
  3. package/src/runtime/agent/orchestrator/context/collect.mjs +42 -27
  4. package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +1 -1
  5. package/src/runtime/agent/orchestrator/providers/gemini.mjs +0 -6
  6. package/src/runtime/agent/orchestrator/providers/openai-codex-metadata.mjs +161 -0
  7. package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +8 -204
  8. package/src/runtime/agent/orchestrator/session/cache/prefetch-cache.mjs +26 -0
  9. package/src/runtime/agent/orchestrator/session/loop/stored-tool-args.mjs +25 -13
  10. package/src/runtime/agent/orchestrator/session/manager.mjs +0 -11
  11. package/src/runtime/agent/orchestrator/session/store/listing.mjs +613 -0
  12. package/src/runtime/agent/orchestrator/session/store.mjs +9 -575
  13. package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +41 -0
  14. package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-output.mjs +154 -0
  15. package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +78 -18
  16. package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +9 -144
  17. package/src/runtime/agent/orchestrator/tools/builtin/shell-job-paths.mjs +7 -3
  18. package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +40 -3
  19. package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +24 -8
  20. package/src/runtime/channels/lib/owned-runtime.mjs +8 -1
  21. package/src/runtime/channels/lib/webhook/relay-tunnel.mjs +6 -2
  22. package/src/runtime/channels/lib/webhook.mjs +13 -1
  23. package/src/runtime/media/adapters/codex-image.mjs +109 -0
  24. package/src/runtime/media/adapters/gemini-image.mjs +68 -0
  25. package/src/runtime/media/adapters/gemini-video.mjs +119 -0
  26. package/src/runtime/media/adapters/xai-media.mjs +116 -0
  27. package/src/runtime/media/auth.mjs +51 -0
  28. package/src/runtime/media/index.mjs +17 -0
  29. package/src/runtime/media/jobs.mjs +174 -0
  30. package/src/runtime/media/lanes.mjs +230 -0
  31. package/src/runtime/media/store.mjs +164 -0
  32. package/src/runtime/media/upstream-error.mjs +39 -0
  33. package/src/session-runtime/channel-config-api.mjs +12 -1
  34. package/src/session-runtime/media-api.mjs +47 -0
  35. package/src/session-runtime/memory-daemon-probe.mjs +61 -0
  36. package/src/session-runtime/model-capabilities.mjs +6 -4
  37. package/src/session-runtime/model-route-api.mjs +4 -1
  38. package/src/session-runtime/notification-bus.mjs +82 -0
  39. package/src/session-runtime/provider-auth-api.mjs +16 -1
  40. package/src/session-runtime/provider-usage.mjs +3 -0
  41. package/src/session-runtime/remote-control.mjs +166 -0
  42. package/src/session-runtime/remote-transcript.mjs +126 -0
  43. package/src/session-runtime/remote-transition-queue.mjs +14 -0
  44. package/src/session-runtime/runtime-core.mjs +160 -706
  45. package/src/session-runtime/runtime-tunables.mjs +57 -0
  46. package/src/session-runtime/self-update.mjs +129 -0
  47. package/src/session-runtime/skills-api.mjs +77 -0
  48. package/src/session-runtime/tool-surface.mjs +83 -0
  49. package/src/session-runtime/warmup-schedulers.mjs +14 -1
  50. package/src/session-runtime/workflow-agents-api.mjs +235 -7
  51. package/src/session-runtime/workflow.mjs +84 -17
  52. package/src/standalone/agent-tool/worker-index.mjs +287 -0
  53. package/src/standalone/agent-tool.mjs +22 -346
  54. package/src/standalone/agent-watchdog-registry.mjs +101 -0
  55. package/src/standalone/channel-worker.mjs +7 -13
  56. package/src/tui/components/StatusLine.jsx +6 -5
  57. package/src/tui/dist/index.mjs +144 -95
  58. package/src/tui/engine/labels.mjs +0 -8
  59. package/src/tui/engine/session-api-ext.mjs +31 -8
  60. package/src/tui/engine/turn-watchdog.mjs +92 -0
  61. package/src/tui/engine/turn.mjs +18 -70
  62. package/src/tui/engine.mjs +39 -1
  63. package/src/workflows/default/WORKFLOW.md +1 -1
  64. package/src/workflows/solo/WORKFLOW.md +1 -1
@@ -1,12 +1,16 @@
1
1
  // Stored tool-call argument compaction/restoration, extracted from loop.mjs.
2
2
  // Long body/command args are truncated with a sha256-tagged head/tail preview
3
- // when persisted into assistant history. Failed command/script calls may
4
- // restore their full text, but mutation bodies stay compacted so stale patches
5
- // cannot be replayed from history.
3
+ // when persisted into assistant history. A FAILED call restores its full text
4
+ // (command/script AND mutation bodies): the failed mutation rolled back, so its
5
+ // patch text is the model's own draft, and leaving only the marker made models
6
+ // copy `[mixdog compacted …]` back as literal patch input. Bodies of calls that
7
+ // did NOT fail stay compacted so an already-applied patch cannot be replayed.
6
8
  import { createHash } from 'crypto';
7
9
 
8
10
  const STORED_TOOL_ARG_BODY_KEY_RE = /^(?:content|old_string|new_string|patch|rewrite)$/i;
9
11
  const STORED_TOOL_ARG_LONG_KEY_RE = /^(?:command|script)$/i;
12
+ // Marker-alone value produced by compactStoredToolArgString for body keys.
13
+ const STORED_TOOL_ARG_MARKER_RE = /^\[mixdog compacted\b[^\]\n]*\]$/;
10
14
  const STORED_TOOL_ARG_BODY_LIMIT = 2_000;
11
15
  const STORED_TOOL_ARG_LONG_LIMIT = 8_000;
12
16
  const STORED_TOOL_ARG_PREVIEW_HEAD = 360;
@@ -60,13 +64,15 @@ export function compactToolCallsForHistory(calls) {
60
64
 
61
65
  // Restore retry-safe long command/script text for ONE failed tool call inside a
62
66
  // history assistant message whose toolCalls were compacted at push time.
63
- // Mutation bodies (patch, old_string, new_string, content, rewrite) deliberately
64
- // remain compacted: replaying their stale pre-failure text can repeat partial
65
- // writes or overwrite newer state. Must run BEFORE the message is first
66
- // transmitted so it never mutates an already-cached prefix.
67
+ // Mutation bodies (patch, old_string, new_string, content, rewrite) are restored
68
+ // too: this call failed, so nothing it described is on disk (sections roll back)
69
+ // and the body is the model's own draft to correct. Only a value that is still
70
+ // the marker is replaced, so a body already carrying real text is never
71
+ // overwritten. Must run BEFORE the message is first transmitted so it never
72
+ // mutates an already-cached prefix.
67
73
  //
68
- // Only command/script keys are restored, at ANY depth. Every body key and every
69
- // other field is taken from the compacted snapshot captured at push time.
74
+ // Restoration reaches command/script and body keys at ANY depth. Every other
75
+ // field is taken from the compacted snapshot captured at push time.
70
76
  export function restoreToolCallBodyForId(assistantMsg, originalCalls, callId) {
71
77
  if (!assistantMsg || !Array.isArray(assistantMsg.toolCalls) || !callId) return;
72
78
  if (!Array.isArray(originalCalls)) return;
@@ -78,11 +84,17 @@ export function restoreToolCallBodyForId(assistantMsg, originalCalls, callId) {
78
84
  tc.arguments = _restoreCompactedBodies(tc.arguments, orig.arguments, '');
79
85
  }
80
86
 
81
- // Recursively rebuild a compacted args tree: replace ONLY retry-safe long
82
- // command/script fields with their full originals and keep mutation bodies plus
83
- // every other field from the compacted snapshot.
87
+ // Recursively rebuild a compacted args tree: replace retry-safe long
88
+ // command/script fields and still-compacted mutation bodies with their full
89
+ // originals; every other field stays as captured in the compacted snapshot.
84
90
  function _restoreCompactedBodies(tcVal, origVal, key) {
85
- if (STORED_TOOL_ARG_BODY_KEY_RE.test(key)) return tcVal;
91
+ if (STORED_TOOL_ARG_BODY_KEY_RE.test(key)) {
92
+ if (typeof tcVal === 'string' && typeof origVal === 'string'
93
+ && STORED_TOOL_ARG_MARKER_RE.test(tcVal.trim())) {
94
+ return origVal;
95
+ }
96
+ return tcVal;
97
+ }
86
98
  if (STORED_TOOL_ARG_LONG_KEY_RE.test(key) && typeof origVal === 'string') {
87
99
  return origVal;
88
100
  }
@@ -98,17 +98,6 @@ export {
98
98
  _buildAgentSpecific,
99
99
  } from './manager/rules-cache.mjs';
100
100
 
101
- // ── Test-only aliases for the legacy auto-compact-limit migration +
102
- // buffer-config preservation (scripts/compact-trigger-migration-smoke.mjs). ─
103
- import {
104
- resolveSessionContextMeta,
105
- compactTriggerForSession,
106
- preserveBufferConfigFields,
107
- } from './manager/context-meta.mjs';
108
- export const _resolveSessionContextMeta = resolveSessionContextMeta;
109
- export const _compactTriggerForSession = compactTriggerForSession;
110
- export const _preserveBufferConfigFields = preserveBufferConfigFields;
111
-
112
101
  // ── Session lifecycle / ask / crud / close / cleanup ──────────────────────
113
102
  export { SessionClosedError } from './manager/session-errors.mjs';
114
103
  export { setAgentRuntime } from './manager/agent-runtime-singleton.mjs';