mixdog 1.0.9 → 1.0.11

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 (165) hide show
  1. package/package.json +3 -3
  2. package/src/rules/agent/40-cycle1-agent.md +19 -23
  3. package/src/rules/lead/LEAD.md +5 -5
  4. package/src/rules/shared/05-tool-calls.md +6 -5
  5. package/src/rules/shared/60-verification.md +2 -2
  6. package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +37 -13
  7. package/src/runtime/agent/orchestrator/agent-runtime/title-completion.mjs +3 -0
  8. package/src/runtime/agent/orchestrator/cache-break-trace.mjs +6 -0
  9. package/src/runtime/agent/orchestrator/config-providers-merge.mjs +8 -0
  10. package/src/runtime/agent/orchestrator/mcp/client.mjs +234 -12
  11. package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/initial-status.mjs +22 -5
  12. package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +7 -8
  13. package/src/runtime/agent/orchestrator/providers/anthropic.mjs +6 -0
  14. package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +9 -7
  15. package/src/runtime/agent/orchestrator/providers/antigravity-oauth.mjs +2 -0
  16. package/src/runtime/agent/orchestrator/providers/antigravity-request.mjs +3 -2
  17. package/src/runtime/agent/orchestrator/providers/auto-effort.mjs +77 -0
  18. package/src/runtime/agent/orchestrator/providers/cursor.mjs +11 -5
  19. package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +165 -0
  20. package/src/runtime/agent/orchestrator/providers/effort-configuration.mjs +4 -2
  21. package/src/runtime/agent/orchestrator/providers/gemini-request-body.mjs +4 -6
  22. package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +7 -0
  23. package/src/runtime/agent/orchestrator/providers/gemini.mjs +2 -0
  24. package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +3 -2
  25. package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +2 -0
  26. package/src/runtime/agent/orchestrator/providers/lib/anthropic-image-input.mjs +34 -13
  27. package/src/runtime/agent/orchestrator/providers/lib/oauth-page.mjs +94 -0
  28. package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +670 -198
  29. package/src/runtime/agent/orchestrator/providers/mixdog-local.mjs +9 -3
  30. package/src/runtime/agent/orchestrator/providers/model-list-sanitize.mjs +23 -4
  31. package/src/runtime/agent/orchestrator/providers/openai-compat-chat-send.mjs +3 -1
  32. package/src/runtime/agent/orchestrator/providers/openai-compat-models.mjs +4 -3
  33. package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +4 -0
  34. package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +14 -8
  35. package/src/runtime/agent/orchestrator/providers/openai-compat-xai-send.mjs +7 -4
  36. package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +24 -9
  37. package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +3 -28
  38. package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +3 -2
  39. package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +2 -0
  40. package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +2 -0
  41. package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +4 -0
  42. package/src/runtime/agent/orchestrator/providers/provider-base-url.mjs +24 -0
  43. package/src/runtime/agent/orchestrator/providers/registry.mjs +24 -4
  44. package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +9 -1
  45. package/src/runtime/agent/orchestrator/runtime-core/config-helpers.mjs +3 -2
  46. package/src/runtime/agent/orchestrator/runtime-core/model-capabilities.mjs +13 -11
  47. package/src/runtime/agent/orchestrator/runtime-core/workflow.mjs +17 -9
  48. package/src/runtime/agent/orchestrator/session/cache/scoped-cache-outcome.mjs +23 -1
  49. package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +40 -71
  50. package/src/runtime/agent/orchestrator/session/cache/tool-result-reuse.mjs +27 -0
  51. package/src/runtime/agent/orchestrator/session/compact/runner.mjs +8 -7
  52. package/src/runtime/agent/orchestrator/session/compact/text-utils.mjs +54 -12
  53. package/src/runtime/agent/orchestrator/session/context-utils.mjs +27 -5
  54. package/src/runtime/agent/orchestrator/session/eager-dispatch/admission.mjs +8 -51
  55. package/src/runtime/agent/orchestrator/session/image-strip-recovery.mjs +55 -2
  56. package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +23 -5
  57. package/src/runtime/agent/orchestrator/session/loop/request-boundary.mjs +2 -0
  58. package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +62 -0
  59. package/src/runtime/agent/orchestrator/session/manager/ask-turn-auto-effort.mjs +79 -0
  60. package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +10 -2
  61. package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +8 -1
  62. package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +6 -3
  63. package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +10 -3
  64. package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +5 -1
  65. package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +21 -5
  66. package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +20 -4
  67. package/src/runtime/agent/orchestrator/session/store/live-state.mjs +7 -6
  68. package/src/runtime/agent/orchestrator/session/store/serialize.mjs +6 -3
  69. package/src/runtime/agent/orchestrator/session/task-wait-control.mjs +13 -0
  70. package/src/runtime/agent/orchestrator/session/tool-batch/execute-call.mjs +9 -19
  71. package/src/runtime/agent/orchestrator/session/tool-batch/finalize.mjs +85 -2
  72. package/src/runtime/agent/orchestrator/session/tool-batch/pre-dispatch.mjs +10 -6
  73. package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +3 -0
  74. package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +12 -1
  75. package/src/runtime/agent/orchestrator/tools/builtin/find-files-tool.mjs +3 -3
  76. package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-path-fanout.mjs +2 -1
  77. package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-pattern-fanout.mjs +2 -1
  78. package/src/runtime/agent/orchestrator/tools/builtin/lib/scoped-search-flight.mjs +20 -0
  79. package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +51 -28
  80. package/src/runtime/agent/orchestrator/tools/builtin/path-utils.mjs +3 -2
  81. package/src/runtime/agent/orchestrator/tools/builtin/pdf-test-fixtures.mjs +47 -0
  82. package/src/runtime/agent/orchestrator/tools/builtin/read-single-media.mjs +1 -1
  83. package/src/runtime/agent/orchestrator/tools/builtin/read-special-files.mjs +34 -30
  84. package/src/runtime/agent/orchestrator/tools/builtin/search-glob-tool.mjs +10 -5
  85. package/src/runtime/agent/orchestrator/tools/builtin/search-grep-tool.mjs +18 -7
  86. package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +1 -1
  87. package/src/runtime/agent/orchestrator/tools/builtin.mjs +9 -2
  88. package/src/runtime/agent/orchestrator/tools/code-graph/aggregate-roots.mjs +3 -1
  89. package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/federation.mjs +3 -1
  90. package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/work.mjs +11 -6
  91. package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +13 -1
  92. package/src/runtime/agent/orchestrator/tools/patch/native-server.mjs +15 -1
  93. package/src/runtime/attachments/limits.mjs +20 -0
  94. package/src/runtime/{agent/orchestrator/tools/builtin/read-office-files.mjs → attachments/office-extract.mjs} +356 -125
  95. package/src/runtime/attachments/pdf-extract.mjs +2 -2
  96. package/src/runtime/attachments/store.mjs +232 -72
  97. package/src/runtime/browser-bridge/client.mjs +3 -3
  98. package/src/runtime/effort-judge/compact-tokenizer.mjs +282 -0
  99. package/src/runtime/effort-judge/judge-client.mjs +194 -0
  100. package/src/runtime/effort-judge/judge-worker.mjs +106 -0
  101. package/src/runtime/local-provider/input-capabilities.mjs +30 -12
  102. package/src/runtime/media/jobs.mjs +0 -1
  103. package/src/runtime/media/media-usage.mjs +2 -1
  104. package/src/runtime/memory/lib/embedding-model-config.mjs +6 -6
  105. package/src/runtime/memory/lib/embedding-model-files.mjs +44 -0
  106. package/src/runtime/memory/lib/embedding-tokenizer.mjs +253 -0
  107. package/src/runtime/memory/lib/embedding-worker.mjs +97 -103
  108. package/src/runtime/memory/lib/memory-chunk-quality.mjs +40 -218
  109. package/src/runtime/memory/lib/memory-embed.mjs +0 -9
  110. package/src/runtime/memory/lib/memory.mjs +34 -23
  111. package/src/runtime/memory/tool-defs.mjs +2 -1
  112. package/src/runtime/shared/automation-attachments.mjs +9 -7
  113. package/src/runtime/shared/environment-error.mjs +14 -0
  114. package/src/runtime/shared/error-presentation.mjs +10 -2
  115. package/src/runtime/shared/inline-file-kind.mjs +28 -2
  116. package/src/runtime/shared/llm/model-catalog.mjs +17 -3
  117. package/src/runtime/shared/llm/quota-value-estimate.mjs +33 -18
  118. package/src/runtime/shared/llm/usage-accounting.mjs +8 -5
  119. package/src/runtime/shared/llm/usage-ledger-quota.mjs +29 -10
  120. package/src/runtime/shared/llm/usage-ledger-rollup.mjs +47 -4
  121. package/src/runtime/shared/model-alias.mjs +5 -0
  122. package/src/runtime/shared/read-image-resize.mjs +56 -0
  123. package/src/runtime/shared/tool-card-model/displayed-result.mjs +7 -5
  124. package/src/runtime/shared/tool-card-model.mjs +2 -1
  125. package/src/runtime/shared/tool-result-summary.mjs +120 -59
  126. package/src/runtime/shared/turn-review-reply.mjs +63 -0
  127. package/src/runtime/shared/turn-snapshot.mjs +8 -5
  128. package/src/runtime/shared/turn-worktree-snapshot.mjs +56 -19
  129. package/src/session-runtime/boot/apis.mjs +11 -0
  130. package/src/session-runtime/boot/providers.mjs +2 -0
  131. package/src/session-runtime/boot/session.mjs +5 -0
  132. package/src/session-runtime/boot/shared.mjs +2 -3
  133. package/src/session-runtime/native-web-search/tool-shape.mjs +8 -8
  134. package/src/session-runtime/native-web-search.mjs +6 -8
  135. package/src/session-runtime/provider-auth/login.mjs +26 -1
  136. package/src/session-runtime/provider-models/row-hydration.mjs +9 -0
  137. package/src/session-runtime/quick-model-rows/provider-rows.mjs +17 -2
  138. package/src/session-runtime/services/provider-admin.mjs +215 -3
  139. package/src/session-runtime/services/usage-stats-model.mjs +37 -2
  140. package/src/session-runtime/settings-builtin-tools-api.mjs +29 -4
  141. package/src/session-runtime/setup-tool/executor.mjs +10 -1
  142. package/src/session-runtime/webhook-session-run.mjs +0 -9
  143. package/src/standalone/daemon-stored-session-views.mjs +15 -0
  144. package/src/standalone/session-protocol.mjs +4 -0
  145. package/src/standalone/session-service/entries/session-loads.mjs +11 -3
  146. package/src/standalone/session-service/entries.mjs +1 -0
  147. package/src/standalone/session-service/session-calls/session-action.mjs +31 -3
  148. package/src/standalone/session-service/session-calls/session-turns.mjs +2 -1
  149. package/src/standalone/session-service.mjs +2 -0
  150. package/src/tui/app/model-options.mjs +10 -1
  151. package/src/tui/app/usage-context-panels/context-model.mjs +4 -1
  152. package/src/tui/app/usage-context-panels.mjs +3 -1
  153. package/src/tui/app/use-prompt-queue-history/restore-to-prompt.mjs +1 -0
  154. package/src/tui/components/ContextPanel.jsx +2 -0
  155. package/src/tui/dist/index.mjs +144 -70
  156. package/src/tui/paste-attachments.mjs +2 -1
  157. package/src/tui/session/session-api/intake/abort.mjs +35 -3
  158. package/src/tui/session/session-api/integrations.mjs +14 -59
  159. package/src/tui/session/session-api/media.mjs +1 -1
  160. package/src/tui/session/session-flow/queue/take-entries.mjs +21 -11
  161. package/src/tui/session/session-flow/steering.mjs +17 -3
  162. package/src/tui/session/session-flow.mjs +1 -0
  163. package/src/tui/session/turn.mjs +18 -4
  164. package/src/vendor/statusline/src/gateway/route-meta.mjs +2 -0
  165. package/scripts/memory-layer2-check.mjs +0 -186
@@ -0,0 +1,94 @@
1
+ // Shared browser pages for the loopback OAuth callbacks (success / failure).
2
+
3
+ const LOGO_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="44 44 168 168" aria-hidden="true">
4
+ <defs>
5
+ <linearGradient id="titanium-a" x1="0%" y1="0%" x2="100%" y2="100%">
6
+ <stop offset="0%" stop-color="#ffffff"/><stop offset="50%" stop-color="#94a3b8"/><stop offset="100%" stop-color="#ffffff"/>
7
+ </linearGradient>
8
+ <linearGradient id="titanium-b" x1="0%" y1="0%" x2="100%" y2="100%">
9
+ <stop offset="0%" stop-color="#cbd5e1"/><stop offset="50%" stop-color="#475569"/><stop offset="100%" stop-color="#cbd5e1"/>
10
+ </linearGradient>
11
+ <linearGradient id="titanium-c" x1="0%" y1="0%" x2="100%" y2="100%">
12
+ <stop offset="0%" stop-color="#94a3b8"/><stop offset="50%" stop-color="#334155"/><stop offset="100%" stop-color="#94a3b8"/>
13
+ </linearGradient>
14
+ </defs>
15
+ <g fill="none" stroke-width="22" stroke-linecap="round">
16
+ <path d="M116.2 61A68 68 0 0 1 191.9 104.7" stroke="url(#titanium-a)"/>
17
+ <path d="M116.2 61A68 68 0 0 1 191.9 104.7" transform="rotate(120 128 128)" stroke="url(#titanium-b)"/>
18
+ <path d="M116.2 61A68 68 0 0 1 191.9 104.7" transform="rotate(240 128 128)" stroke="url(#titanium-c)"/>
19
+ </g>
20
+ <polygon points="128,112 133,123 144,128 133,133 128,144 123,133 112,128 123,123" fill="#cbd5e1"/>
21
+ <circle cx="128" cy="128" r="3.5" fill="#07080b"/>
22
+ <circle cx="128" cy="128" r="1.5" fill="#ffffff"/>
23
+ </svg>`;
24
+
25
+ function escapeHtml(value) {
26
+ return String(value)
27
+ .replaceAll('&', '&amp;')
28
+ .replaceAll('<', '&lt;')
29
+ .replaceAll('>', '&gt;')
30
+ .replaceAll('"', '&quot;')
31
+ .replaceAll("'", '&#39;');
32
+ }
33
+
34
+ function renderPage({ heading, message, details }) {
35
+ const title = escapeHtml(heading);
36
+ return `<!doctype html>
37
+ <html lang="en">
38
+ <head>
39
+ <meta charset="utf-8" />
40
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
41
+ <title>${title} · Mixdog</title>
42
+ <style>
43
+ * { box-sizing: border-box; }
44
+ html { color-scheme: dark; }
45
+ body {
46
+ margin: 0;
47
+ min-height: 100vh;
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ padding: 24px;
52
+ background: #07080b;
53
+ color: #f8fafc;
54
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
55
+ text-align: center;
56
+ }
57
+ main { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; }
58
+ .logo { width: 72px; height: 72px; margin-bottom: 24px; }
59
+ .logo svg { width: 100%; height: 100%; display: block; }
60
+ h1 { margin: 0 0 10px; font-size: 28px; line-height: 1.15; font-weight: 650; }
61
+ p { margin: 0; line-height: 1.7; color: #94a3b8; font-size: 15px; }
62
+ .details {
63
+ margin-top: 16px;
64
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
65
+ font-size: 13px;
66
+ color: #94a3b8;
67
+ white-space: pre-wrap;
68
+ word-break: break-word;
69
+ }
70
+ </style>
71
+ </head>
72
+ <body>
73
+ <main>
74
+ <div class="logo">${LOGO_SVG}</div>
75
+ <h1>${title}</h1>
76
+ <p>${escapeHtml(message)}</p>
77
+ ${details ? `<div class="details">${escapeHtml(details)}</div>` : ''}
78
+ </main>
79
+ </body>
80
+ </html>`;
81
+ }
82
+
83
+ export const OAUTH_PAGE_CONTENT_TYPE = 'text/html; charset=utf-8';
84
+
85
+ export function oauthSuccessHtml(providerName) {
86
+ return renderPage({
87
+ heading: 'Authentication successful',
88
+ message: `Signed in to ${providerName}. You can close this tab and return to Mixdog.`,
89
+ });
90
+ }
91
+
92
+ export function oauthErrorHtml(message, details) {
93
+ return renderPage({ heading: 'Authentication failed', message, details });
94
+ }