mixdog 0.9.67 → 0.9.69

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 (73) hide show
  1. package/package.json +6 -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/session-lifecycle.mjs +3 -0
  11. package/src/runtime/agent/orchestrator/session/manager.mjs +0 -11
  12. package/src/runtime/agent/orchestrator/session/store/listing.mjs +613 -0
  13. package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +1 -0
  14. package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +10 -2
  15. package/src/runtime/agent/orchestrator/session/store.mjs +9 -575
  16. package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +41 -0
  17. package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-output.mjs +154 -0
  18. package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +78 -18
  19. package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +9 -144
  20. package/src/runtime/agent/orchestrator/tools/builtin/shell-job-paths.mjs +7 -3
  21. package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +40 -3
  22. package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +24 -8
  23. package/src/runtime/channels/lib/config.mjs +6 -5
  24. package/src/runtime/channels/lib/owned-runtime.mjs +65 -5
  25. package/src/runtime/channels/lib/scheduler.mjs +7 -15
  26. package/src/runtime/channels/lib/tool-dispatch.mjs +6 -1
  27. package/src/runtime/channels/lib/webhook/relay-tunnel.mjs +6 -2
  28. package/src/runtime/channels/lib/webhook.mjs +36 -46
  29. package/src/runtime/channels/lib/worker-main.mjs +45 -92
  30. package/src/runtime/shared/automation-attachments.mjs +72 -0
  31. package/src/runtime/shared/automation-workflow.mjs +41 -0
  32. package/src/runtime/shared/schedule-session-run.mjs +10 -1
  33. package/src/runtime/shared/schedules-db.mjs +18 -3
  34. package/src/runtime/shared/webhook-session-run.mjs +57 -0
  35. package/src/runtime/shared/webhooks-db.mjs +19 -3
  36. package/src/session-runtime/channel-config-api.mjs +8 -1
  37. package/src/session-runtime/lifecycle-api.mjs +7 -0
  38. package/src/session-runtime/memory-daemon-probe.mjs +61 -0
  39. package/src/session-runtime/model-capabilities.mjs +6 -4
  40. package/src/session-runtime/notification-bus.mjs +82 -0
  41. package/src/session-runtime/provider-auth-api.mjs +16 -1
  42. package/src/session-runtime/provider-usage.mjs +3 -0
  43. package/src/session-runtime/remote-control.mjs +166 -0
  44. package/src/session-runtime/remote-transcript.mjs +126 -0
  45. package/src/session-runtime/remote-transition-queue.mjs +14 -0
  46. package/src/session-runtime/runtime-core.mjs +184 -660
  47. package/src/session-runtime/runtime-tunables.mjs +57 -0
  48. package/src/session-runtime/self-update.mjs +129 -0
  49. package/src/session-runtime/skills-api.mjs +77 -0
  50. package/src/session-runtime/tool-surface.mjs +83 -0
  51. package/src/session-runtime/workflow-agents-api.mjs +206 -3
  52. package/src/session-runtime/workflow.mjs +84 -17
  53. package/src/standalone/agent-tool/worker-index.mjs +287 -0
  54. package/src/standalone/agent-tool.mjs +22 -346
  55. package/src/standalone/agent-watchdog-registry.mjs +101 -0
  56. package/src/standalone/channel-admin.mjs +36 -1
  57. package/src/standalone/channel-daemon-client.mjs +5 -1
  58. package/src/standalone/channel-daemon-transport.mjs +112 -20
  59. package/src/standalone/channel-daemon.mjs +6 -4
  60. package/src/standalone/channel-worker.mjs +7 -13
  61. package/src/tui/App.jsx +2 -32
  62. package/src/tui/app/channel-pickers.mjs +2 -143
  63. package/src/tui/app/slash-commands.mjs +1 -3
  64. package/src/tui/app/slash-dispatch.mjs +3 -3
  65. package/src/tui/components/StatusLine.jsx +6 -5
  66. package/src/tui/dist/index.mjs +162 -259
  67. package/src/tui/engine/labels.mjs +0 -8
  68. package/src/tui/engine/session-api-ext.mjs +45 -10
  69. package/src/tui/engine/turn-watchdog.mjs +92 -0
  70. package/src/tui/engine/turn.mjs +18 -70
  71. package/src/tui/engine.mjs +14 -1
  72. package/src/workflows/default/WORKFLOW.md +1 -1
  73. 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
  }
@@ -395,6 +395,9 @@ export function createSession(opts) {
395
395
  // scheduler/daily-standup, webhook/github-push, lead/worker.
396
396
  sourceType: opts.sourceType || null,
397
397
  sourceName: opts.sourceName || null,
398
+ // Automation delivery mode ('app' | 'channel' | 'both'): the desktop
399
+ // sidebar hides channel-only runner sessions from Automations.
400
+ sourceDelivery: opts.sourceDelivery || null,
398
401
  // Provider-scoped unified cache key — one shard per provider,
399
402
  // shared across all roles / sources (agent/maintenance/mcp/
400
403
  // scheduler/webhook). Role or source-specific context must be
@@ -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';