mixdog 1.2.6 → 1.3.1

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 (294) hide show
  1. package/LICENSES/simple-icons-CC0-1.0.txt +30 -0
  2. package/NOTICE.md +71 -9
  3. package/package.json +4 -1
  4. package/scripts/check-model-recommendations.mjs +89 -0
  5. package/scripts/gate-local.mjs +7 -0
  6. package/scripts/lib/isolated-test-env.mjs +16 -0
  7. package/src/agents/reviewer/AGENT.md +4 -2
  8. package/src/agents/reviewer/agent.json +1 -1
  9. package/src/defaults/shipped-history.json +10 -0
  10. package/src/defaults/skills/browser-use/SKILL.md +5 -0
  11. package/src/defaults/skills/memory-management/SKILL.md +4 -1
  12. package/src/defaults/skills/setup/references/actions.md +14 -4
  13. package/src/defaults/skills/setup-guide/SKILL.md +178 -0
  14. package/src/defaults/skills/setup-guide/model-recommendations.json +333 -0
  15. package/src/lib/rules-builder.cjs +55 -6
  16. package/src/output-styles/common.md +13 -8
  17. package/src/rules/agent/AGENT.md +4 -0
  18. package/src/rules/agent-mode/AGENT_MODE.md +24 -0
  19. package/src/rules/agent-mode/MIXY.md +28 -0
  20. package/src/rules/agent-mode/ROUTINE.md +6 -0
  21. package/src/rules/lead/LEAD.md +7 -3
  22. package/src/rules/shared/70-delivery.md +3 -0
  23. package/src/runtime/agent/orchestrator/agent-runtime/room-supervisor-completion.mjs +86 -0
  24. package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +77 -14
  25. package/src/runtime/agent/orchestrator/context/role-instructions.mjs +241 -14
  26. package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +4 -2
  27. package/src/runtime/agent/orchestrator/mcp/agent-connectors.mjs +216 -0
  28. package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +5 -4
  29. package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +10 -1
  30. package/src/runtime/agent/orchestrator/mcp/client.mjs +115 -11
  31. package/src/runtime/agent/orchestrator/mcp/oauth-account.mjs +97 -0
  32. package/src/runtime/agent/orchestrator/mcp/oauth-client.mjs +49 -0
  33. package/src/runtime/agent/orchestrator/mcp/oauth-credentials.mjs +59 -9
  34. package/src/runtime/agent/orchestrator/mcp/oauth-login.mjs +32 -7
  35. package/src/runtime/agent/orchestrator/mcp/oauth-provider.mjs +45 -6
  36. package/src/runtime/agent/orchestrator/mcp/oauth.mjs +195 -6
  37. package/src/runtime/agent/orchestrator/mcp/server-connectors.mjs +17 -0
  38. package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
  39. package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +1 -0
  40. package/src/runtime/agent/orchestrator/providers/antigravity-oauth-catalog.mjs +7 -2
  41. package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +10 -3
  42. package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +4 -0
  43. package/src/runtime/agent/orchestrator/providers/auto-effort.mjs +7 -8
  44. package/src/runtime/agent/orchestrator/providers/cursor-client-version.mjs +1 -1
  45. package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +3 -1
  46. package/src/runtime/agent/orchestrator/providers/lib/tool-call-wire-ids.mjs +65 -0
  47. package/src/runtime/agent/orchestrator/providers/openai-compat-retry-profile.mjs +8 -2
  48. package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +9 -2
  49. package/src/runtime/agent/orchestrator/providers/openai-error-contract.mjs +17 -12
  50. package/src/runtime/agent/orchestrator/providers/openai-oauth-tokens.mjs +10 -0
  51. package/src/runtime/agent/orchestrator/providers/openai-responses-input.mjs +3 -1
  52. package/src/runtime/agent/orchestrator/providers/provider-error-kind.mjs +14 -2
  53. package/src/runtime/agent/orchestrator/providers/retry-executor.mjs +17 -0
  54. package/src/runtime/agent/orchestrator/runtime-core/ask-user-tool-defs.mjs +96 -1
  55. package/src/runtime/agent/orchestrator/runtime-core/context-status-shape.mjs +4 -0
  56. package/src/runtime/agent/orchestrator/runtime-core/extension-scopes.mjs +6 -4
  57. package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +14 -0
  58. package/src/runtime/agent/orchestrator/runtime-core/plugin-mcp.mjs +1 -0
  59. package/src/runtime/agent/orchestrator/runtime-core/tool-bridge.mjs +12 -6
  60. package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +32 -5
  61. package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +21 -5
  62. package/src/runtime/agent/orchestrator/runtime-core/workflow/agents.mjs +40 -7
  63. package/src/runtime/agent/orchestrator/runtime-core/workflow/context.mjs +52 -20
  64. package/src/runtime/agent/orchestrator/runtime-core/workflow-ids.mjs +2 -0
  65. package/src/runtime/agent/orchestrator/session/agent-home.d.mts +4 -0
  66. package/src/runtime/agent/orchestrator/session/agent-home.mjs +33 -0
  67. package/src/runtime/agent/orchestrator/session/agent-mode.mjs +62 -0
  68. package/src/runtime/agent/orchestrator/session/agent-room-supervisor.d.mts +31 -0
  69. package/src/runtime/agent/orchestrator/session/agent-room-supervisor.mjs +241 -0
  70. package/src/runtime/agent/orchestrator/session/agent-room.d.mts +166 -0
  71. package/src/runtime/agent/orchestrator/session/agent-room.mjs +650 -0
  72. package/src/runtime/agent/orchestrator/session/catalog-db/schema.mjs +7 -1
  73. package/src/runtime/agent/orchestrator/session/compact/user-message-kind.mjs +2 -0
  74. package/src/runtime/agent/orchestrator/session/compaction-archive-capture.mjs +6 -2
  75. package/src/runtime/agent/orchestrator/session/human-gate/gate.mjs +192 -0
  76. package/src/runtime/agent/orchestrator/session/human-gate/held-message.mjs +95 -0
  77. package/src/runtime/agent/orchestrator/session/human-gate/outbound-policy.mjs +221 -0
  78. package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +195 -0
  79. package/src/runtime/agent/orchestrator/session/human-gate/store.mjs +167 -0
  80. package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +3 -1
  81. package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +9 -0
  82. package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +10 -0
  83. package/src/runtime/agent/orchestrator/session/loop/route-fallback.mjs +108 -6
  84. package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +10 -1
  85. package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +74 -15
  86. package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +9 -1
  87. package/src/runtime/agent/orchestrator/session/loop/tool-exposure-migration.mjs +5 -4
  88. package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +13 -3
  89. package/src/runtime/agent/orchestrator/session/loop/usage.mjs +49 -0
  90. package/src/runtime/agent/orchestrator/session/manager/ask-turn-commit.mjs +18 -8
  91. package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +1 -0
  92. package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +3 -1
  93. package/src/runtime/agent/orchestrator/session/manager/ask-turn-prepare.mjs +6 -0
  94. package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +2 -0
  95. package/src/runtime/agent/orchestrator/session/manager/pending-lifecycle-epoch.mjs +0 -8
  96. package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +44 -16
  97. package/src/runtime/agent/orchestrator/session/manager/provider-replay.mjs +50 -0
  98. package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +22 -5
  99. package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +39 -4
  100. package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +33 -24
  101. package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +58 -8
  102. package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +16 -0
  103. package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +3 -2
  104. package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +7 -1
  105. package/src/runtime/agent/orchestrator/session/manager/usage-metrics.mjs +6 -0
  106. package/src/runtime/agent/orchestrator/session/manager/workflow-switch-notice.mjs +58 -0
  107. package/src/runtime/agent/orchestrator/session/mixy-name.mjs +27 -0
  108. package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +32 -5
  109. package/src/runtime/agent/orchestrator/session/routine-result.d.mts +86 -0
  110. package/src/runtime/agent/orchestrator/session/routine-result.mjs +329 -0
  111. package/src/runtime/agent/orchestrator/session/store/sweep/sweep-row.mjs +8 -0
  112. package/src/runtime/agent/orchestrator/session/store-record-strict-scan.mjs +28 -9
  113. package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +16 -2
  114. package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +44 -12
  115. package/src/runtime/agent/orchestrator/session/store-summary-last-message.mjs +46 -0
  116. package/src/runtime/agent/orchestrator/session/store-summary-visibility.mjs +0 -4
  117. package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +58 -10
  118. package/src/runtime/agent/orchestrator/session/transcript-restore/user-text.mjs +92 -15
  119. package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +12 -0
  120. package/src/runtime/agent/orchestrator/tools/builtin/native-search-client.mjs +113 -5
  121. package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +4 -0
  122. package/src/runtime/agent/orchestrator/tools/lib/shell-descendants.mjs +25 -1
  123. package/src/runtime/agent/orchestrator/tools/lib/shell-run-background/promote-job.mjs +8 -0
  124. package/src/runtime/agent/orchestrator/tools/lib/shell-run-settle.mjs +6 -0
  125. package/src/runtime/agent/orchestrator/tools/lib/shell-run-state.mjs +3 -0
  126. package/src/runtime/agent/orchestrator/tools/shell-command.mjs +75 -57
  127. package/src/runtime/attachments/store.mjs +6 -0
  128. package/src/runtime/browser-bridge/client.mjs +24 -0
  129. package/src/runtime/channels/lib/scheduler.mjs +40 -12
  130. package/src/runtime/channels/lib/schedules-db.mjs +71 -12
  131. package/src/runtime/channels/lib/webhook/session-dispatch.mjs +36 -16
  132. package/src/runtime/channels/lib/webhook.mjs +0 -1
  133. package/src/runtime/channels/lib/webhooks-db.mjs +100 -10
  134. package/src/runtime/channels/lib/worker-main.mjs +17 -20
  135. package/src/runtime/computer-bridge/client.mjs +28 -1
  136. package/src/runtime/connectors/gmail-app-password.mjs +690 -0
  137. package/src/runtime/connectors/google-mcp.mjs +446 -0
  138. package/src/runtime/effort-judge/judge-client.mjs +1 -1
  139. package/src/runtime/effort-judge/model-manifest.json +7 -7
  140. package/src/runtime/memory/lib/core-memory-access.mjs +69 -0
  141. package/src/runtime/memory/lib/core-memory-file.mjs +16 -8
  142. package/src/runtime/memory/lib/core-memory-index.mjs +15 -9
  143. package/src/runtime/memory/lib/core-memory-management.mjs +10 -4
  144. package/src/runtime/memory/lib/core-memory-store.mjs +53 -30
  145. package/src/runtime/memory/lib/core-memory-uniqueness.mjs +10 -6
  146. package/src/runtime/memory/lib/http-router/session-routes.mjs +3 -2
  147. package/src/runtime/memory/lib/memory-action-handlers/core-actions.mjs +44 -14
  148. package/src/runtime/memory/lib/memory-schema/core-and-meta.mjs +11 -0
  149. package/src/runtime/memory/lib/memory.mjs +7 -1
  150. package/src/runtime/memory/lib/query-core-recall.mjs +9 -1
  151. package/src/runtime/memory/lib/query-hybrid-search.mjs +2 -0
  152. package/src/runtime/memory/lib/tool-call-handler.mjs +2 -0
  153. package/src/runtime/memory/tool-defs.mjs +5 -0
  154. package/src/runtime/shared/agent-avatar-sprites.mjs +445 -0
  155. package/src/runtime/shared/agent-avatar.d.mts +64 -0
  156. package/src/runtime/shared/agent-avatar.mjs +320 -0
  157. package/src/runtime/shared/agent-kind.mjs +152 -0
  158. package/src/runtime/shared/agent-route-config.d.mts +4 -0
  159. package/src/runtime/shared/agent-route-config.mjs +30 -0
  160. package/src/runtime/shared/agent-store.mjs +132 -0
  161. package/src/runtime/shared/atomic-file.mjs +14 -1
  162. package/src/runtime/shared/bot-split-migration.mjs +457 -0
  163. package/src/runtime/shared/config-patch.mjs +20 -1
  164. package/src/runtime/shared/config.mjs +8 -1
  165. package/src/runtime/shared/connector-accounts.mjs +15 -0
  166. package/src/runtime/shared/connector-catalog.d.mts +51 -0
  167. package/src/runtime/shared/connector-catalog.mjs +228 -0
  168. package/src/runtime/shared/connector-triggers.d.mts +3 -0
  169. package/src/runtime/shared/connector-triggers.mjs +45 -0
  170. package/src/runtime/shared/err-text.mjs +3 -1
  171. package/src/runtime/shared/error-presentation.mjs +91 -6
  172. package/src/runtime/shared/google-oauth-client.mjs +24 -0
  173. package/src/runtime/shared/handoff-artifacts.d.mts +20 -0
  174. package/src/runtime/shared/handoff-artifacts.mjs +61 -0
  175. package/src/runtime/shared/held-request-host.d.mts +12 -0
  176. package/src/runtime/shared/held-request-host.mjs +71 -0
  177. package/src/runtime/shared/llm/provider-model-identities.mjs +6 -1
  178. package/src/runtime/shared/llm/usage-accounting.mjs +7 -1
  179. package/src/runtime/shared/model-route-fallback.mjs +79 -7
  180. package/src/runtime/shared/plain-preview.d.mts +1 -0
  181. package/src/runtime/shared/plain-preview.mjs +33 -0
  182. package/src/runtime/shared/routine-limits.d.mts +11 -0
  183. package/src/runtime/shared/routine-limits.mjs +21 -0
  184. package/src/runtime/shared/routine-trigger.d.mts +10 -0
  185. package/src/runtime/shared/routine-trigger.mjs +44 -0
  186. package/src/runtime/shared/schedule-model-ref.mjs +9 -10
  187. package/src/runtime/shared/sensitive-path-rules.d.mts +15 -0
  188. package/src/runtime/shared/sensitive-path-rules.mjs +256 -0
  189. package/src/runtime/shared/slow-span.mjs +4 -12
  190. package/src/runtime/shared/statusline/statusline-segments.mjs +13 -1
  191. package/src/runtime/shared/transcript-metadata.mjs +10 -0
  192. package/src/runtime/shared/turn-changes.mjs +0 -8
  193. package/src/runtime/shared/usage-readout-totals.mjs +58 -0
  194. package/src/runtime/shared/user-data-guard.mjs +119 -38
  195. package/src/session-runtime/agent-home-delivery.mjs +826 -0
  196. package/src/session-runtime/agent-profile-changes.mjs +21 -0
  197. package/src/session-runtime/agent-room-delivery.mjs +133 -0
  198. package/src/session-runtime/agent-task-sessions.mjs +460 -0
  199. package/src/session-runtime/boot/apis.mjs +63 -18
  200. package/src/session-runtime/boot/facade.mjs +5 -8
  201. package/src/session-runtime/boot/infrastructure.mjs +28 -17
  202. package/src/session-runtime/boot/providers.mjs +14 -4
  203. package/src/session-runtime/boot/tools.mjs +3 -0
  204. package/src/session-runtime/channel-config-api.mjs +53 -5
  205. package/src/session-runtime/config-lifecycle.mjs +43 -2
  206. package/src/session-runtime/cwd-plugins/core-memory-context.mjs +36 -20
  207. package/src/session-runtime/cwd-plugins/plugin-status.mjs +6 -1
  208. package/src/session-runtime/handoff-attachments.mjs +593 -0
  209. package/src/session-runtime/held-requests.mjs +228 -0
  210. package/src/session-runtime/internal-tool-executor/ask-user-tool.mjs +121 -0
  211. package/src/session-runtime/internal-tool-executor/feature-tools.mjs +5 -1
  212. package/src/session-runtime/internal-tool-executor/knowledge-tools.mjs +31 -2
  213. package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +56 -3
  214. package/src/session-runtime/internal-tool-executor.mjs +2 -0
  215. package/src/session-runtime/lifecycle/session-catalog.mjs +9 -0
  216. package/src/session-runtime/lifecycle/session-switch/resume.mjs +4 -0
  217. package/src/session-runtime/lifecycle/shared.mjs +6 -0
  218. package/src/session-runtime/mcp-glue/server-catalog.mjs +8 -0
  219. package/src/session-runtime/mcp-glue/server-input.mjs +3 -0
  220. package/src/session-runtime/mcp-oauth-login.mjs +112 -15
  221. package/src/session-runtime/model-route/route-persist.mjs +2 -2
  222. package/src/session-runtime/model-route/route-tuning.mjs +7 -1
  223. package/src/session-runtime/model-route/set-route.mjs +35 -4
  224. package/src/session-runtime/native-web-search.mjs +2 -2
  225. package/src/session-runtime/new-session-config.mjs +6 -1
  226. package/src/session-runtime/owned-automation-run.mjs +229 -0
  227. package/src/session-runtime/resource-api.mjs +5 -0
  228. package/src/session-runtime/resource-mcp-api.mjs +107 -13
  229. package/src/session-runtime/resource-skills-api.mjs +12 -0
  230. package/src/session-runtime/room-member-gate.mjs +48 -0
  231. package/src/session-runtime/route-resolution.mjs +5 -11
  232. package/src/session-runtime/routine-home-turn.mjs +156 -0
  233. package/src/session-runtime/routine-owner.mjs +48 -0
  234. package/src/session-runtime/schedule-session-run.mjs +30 -64
  235. package/src/session-runtime/services/agent-tool/helpers.mjs +30 -1
  236. package/src/session-runtime/services/agent-tool/send-flow.mjs +11 -3
  237. package/src/session-runtime/services/agent-tool/spawn-flow/spawn-plan.mjs +19 -4
  238. package/src/session-runtime/services/agent-tool/spawn-flow/spawn-prep.mjs +2 -0
  239. package/src/session-runtime/services/agent-tool/spawn-flow/spawn-run.mjs +4 -1
  240. package/src/session-runtime/services/agent-tool/spawn-preset.mjs +5 -8
  241. package/src/session-runtime/services/agent-tool/tool-def.mjs +7 -0
  242. package/src/session-runtime/services/channel-admin.mjs +93 -24
  243. package/src/session-runtime/services/memory-access.mjs +37 -0
  244. package/src/session-runtime/services/provider-admin.mjs +74 -39
  245. package/src/session-runtime/services/schedule-access.mjs +91 -0
  246. package/src/session-runtime/session-create/session-options.mjs +34 -7
  247. package/src/session-runtime/session-hooks.mjs +16 -8
  248. package/src/session-runtime/setup-tool/executor.mjs +79 -6
  249. package/src/session-runtime/setup-tool/extended-actions.mjs +90 -20
  250. package/src/session-runtime/setup-tool/settings-contract.mjs +14 -6
  251. package/src/session-runtime/setup-tool/tool-defs.mjs +8 -0
  252. package/src/session-runtime/skills-api.mjs +16 -1
  253. package/src/session-runtime/tool-policy-refresh.mjs +249 -29
  254. package/src/session-runtime/turn/session-ops.mjs +8 -1
  255. package/src/session-runtime/turn/turn-run/ask-callbacks.mjs +10 -2
  256. package/src/session-runtime/turn/turn-run/turn-prepare.mjs +14 -0
  257. package/src/session-runtime/webhook-session-run.mjs +49 -67
  258. package/src/session-runtime/workflow-agents-api/agent-connectors.mjs +239 -0
  259. package/src/session-runtime/workflow-agents-api/agent-editor.mjs +650 -25
  260. package/src/session-runtime/workflow-agents-api/agent-route.mjs +67 -7
  261. package/src/session-runtime/workflow-agents-api/onboarding.mjs +11 -4
  262. package/src/session-runtime/workflow-agents-api/workflow-packs.mjs +11 -1
  263. package/src/session-runtime/workflow-agents-api.mjs +4 -1
  264. package/src/standalone/daemon-agent-control.mjs +1 -8
  265. package/src/standalone/daemon-session-control.mjs +21 -4
  266. package/src/standalone/daemon.mjs +31 -5
  267. package/src/standalone/session-protocol.mjs +27 -0
  268. package/src/standalone/session-service/agent-tree/agent-turns.mjs +46 -3
  269. package/src/standalone/session-service/agent-tree.mjs +4 -3
  270. package/src/standalone/session-service/session-calls/session-turns.mjs +28 -0
  271. package/src/standalone/session-service.mjs +19 -0
  272. package/src/tui/app/slash-commands.mjs +20 -0
  273. package/src/tui/dist/index.mjs +234 -95
  274. package/src/tui/session/context-state.mjs +6 -1
  275. package/src/tui/session/notice-surface.mjs +34 -4
  276. package/src/tui/session/queue-helpers.mjs +2 -1
  277. package/src/tui/session/session-api/extensions.mjs +4 -0
  278. package/src/tui/session/session-api/intake/submission.mjs +5 -0
  279. package/src/tui/session/session-api/integrations.mjs +8 -0
  280. package/src/tui/session/session-api/lifecycle/session-reset.mjs +13 -3
  281. package/src/tui/session/session-api/lifecycle.mjs +17 -1
  282. package/src/tui/session/session-api/routes.mjs +61 -5
  283. package/src/tui/session/session-flow/drain.mjs +12 -3
  284. package/src/tui/session/session-flow/queue/entry-shape.mjs +2 -1
  285. package/src/tui/session/session-flow/queue/take-entries.mjs +3 -2
  286. package/src/tui/session/session-flow/steering.mjs +58 -24
  287. package/src/tui/session/tool-approval.mjs +26 -5
  288. package/src/tui/session/transcript-intake.mjs +8 -2
  289. package/src/tui/session/transcript-spill.mjs +5 -1
  290. package/src/tui/session/tui-steering-persist.mjs +65 -42
  291. package/src/tui/session/turn-live-call.mjs +64 -0
  292. package/src/tui/session/turn.mjs +34 -8
  293. package/src/session-runtime/automation-agents.mjs +0 -94
  294. package/src/session-runtime/automation-workflow.mjs +0 -59
@@ -1825,8 +1825,8 @@ var require_react_reconciler_production = __commonJS({
1825
1825
  currentEntangledActionThenable = {
1826
1826
  status: "pending",
1827
1827
  value: void 0,
1828
- then: function(resolve7) {
1829
- entangledListeners.push(resolve7);
1828
+ then: function(resolve8) {
1829
+ entangledListeners.push(resolve8);
1830
1830
  }
1831
1831
  };
1832
1832
  }
@@ -1849,8 +1849,8 @@ var require_react_reconciler_production = __commonJS({
1849
1849
  status: "pending",
1850
1850
  value: null,
1851
1851
  reason: null,
1852
- then: function(resolve7) {
1853
- listeners.push(resolve7);
1852
+ then: function(resolve8) {
1853
+ listeners.push(resolve8);
1854
1854
  }
1855
1855
  };
1856
1856
  thenable.then(
@@ -11449,8 +11449,8 @@ var require_react_reconciler_development = __commonJS({
11449
11449
  currentEntangledActionThenable = {
11450
11450
  status: "pending",
11451
11451
  value: void 0,
11452
- then: function(resolve7) {
11453
- entangledListeners.push(resolve7);
11452
+ then: function(resolve8) {
11453
+ entangledListeners.push(resolve8);
11454
11454
  }
11455
11455
  };
11456
11456
  }
@@ -11473,8 +11473,8 @@ var require_react_reconciler_development = __commonJS({
11473
11473
  status: "pending",
11474
11474
  value: null,
11475
11475
  reason: null,
11476
- then: function(resolve7) {
11477
- listeners.push(resolve7);
11476
+ then: function(resolve8) {
11477
+ listeners.push(resolve8);
11478
11478
  }
11479
11479
  };
11480
11480
  thenable.then(
@@ -23486,7 +23486,7 @@ var init_keyed_serial_queue = __esm({
23486
23486
 
23487
23487
  // src/runtime/shared/sleep.mjs
23488
23488
  function sleep(ms) {
23489
- return new Promise((resolve7) => setTimeout(resolve7, ms));
23489
+ return new Promise((resolve8) => setTimeout(resolve8, ms));
23490
23490
  }
23491
23491
  function sleepSync(ms) {
23492
23492
  const buffer = new SharedArrayBuffer(4);
@@ -23951,7 +23951,8 @@ import {
23951
23951
  unlink as unlinkAsync2,
23952
23952
  writeFile as writeFileAsync2
23953
23953
  } from "node:fs/promises";
23954
- import { dirname as dirname5, basename as basename3, join as join5 } from "node:path";
23954
+ import { tmpdir as tmpdir2 } from "node:os";
23955
+ import { dirname as dirname5, basename as basename3, join as join5, relative, isAbsolute as isAbsolute2, resolve as resolve4 } from "node:path";
23955
23956
  import { randomBytes as randomBytes3 } from "node:crypto";
23956
23957
  function _drainAdaptiveFileIo() {
23957
23958
  while (_ioActive < _ioLimit && _ioQueue.length > 0) {
@@ -23978,8 +23979,8 @@ function _drainAdaptiveFileIo() {
23978
23979
  }
23979
23980
  }
23980
23981
  function _runAdaptiveFileIo(run) {
23981
- return new Promise((resolve7, reject) => {
23982
- _ioQueue.push({ run, resolve: resolve7, reject });
23982
+ return new Promise((resolve8, reject) => {
23983
+ _ioQueue.push({ run, resolve: resolve8, reject });
23983
23984
  _drainAdaptiveFileIo();
23984
23985
  });
23985
23986
  }
@@ -24051,7 +24052,14 @@ async function fsyncPathAsync(path2, tolerated) {
24051
24052
  }
24052
24053
  }
24053
24054
  }
24055
+ function assertTestSecretWriteSafe(filePath, opts) {
24056
+ if (opts.secret !== true || !process.env.NODE_TEST_CONTEXT) return;
24057
+ const rel = relative(resolve4(tmpdir2()).toLowerCase(), resolve4(filePath).toLowerCase());
24058
+ if (rel === "" || !rel.startsWith("..") && !isAbsolute2(rel)) return;
24059
+ throw new Error(`refusing to write a secret outside the temp dir under node --test: ${filePath}`);
24060
+ }
24054
24061
  function writeFileAtomicSync(filePath, data, opts = {}) {
24062
+ assertTestSecretWriteSafe(filePath, opts);
24055
24063
  const run = () => {
24056
24064
  const dir = dirname5(filePath);
24057
24065
  mkdirSync3(dir, { recursive: true });
@@ -24116,6 +24124,7 @@ function writeJsonAtomicSync(filePath, value, opts = {}) {
24116
24124
  `, opts);
24117
24125
  }
24118
24126
  async function writeFileAtomicAsync(filePath, data, opts = {}) {
24127
+ assertTestSecretWriteSafe(filePath, opts);
24119
24128
  const run = async () => {
24120
24129
  const dir = dirname5(filePath);
24121
24130
  await mkdirAsync2(dir, { recursive: true });
@@ -34090,8 +34099,8 @@ var App_default = App;
34090
34099
  var noop = () => {
34091
34100
  };
34092
34101
  var textEncoder = new TextEncoder();
34093
- var yieldImmediate = async () => new Promise((resolve7) => {
34094
- setImmediate(resolve7);
34102
+ var yieldImmediate = async () => new Promise((resolve8) => {
34103
+ setImmediate(resolve8);
34095
34104
  });
34096
34105
  var kittyQueryEscapeByte = 27;
34097
34106
  var kittyQueryOpenBracketByte = 91;
@@ -34346,8 +34355,8 @@ var Ink = class {
34346
34355
  };
34347
34356
  }
34348
34357
  this.initKittyKeyboard();
34349
- this.exitPromise = new Promise((resolve7, reject) => {
34350
- this.resolveExitPromise = resolve7;
34358
+ this.exitPromise = new Promise((resolve8, reject) => {
34359
+ this.resolveExitPromise = resolve8;
34351
34360
  this.rejectExitPromise = reject;
34352
34361
  });
34353
34362
  void this.exitPromise.catch(noop);
@@ -34787,9 +34796,9 @@ var Ink = class {
34787
34796
  settleThrottle(this.throttledOnRender, canWriteToStdout);
34788
34797
  settleThrottle(this.throttledLog, canWriteToStdout);
34789
34798
  if (canWriteToStdout && hasWritableState) {
34790
- await new Promise((resolve7) => {
34799
+ await new Promise((resolve8) => {
34791
34800
  this.options.stdout.write("", () => {
34792
- resolve7();
34801
+ resolve8();
34793
34802
  });
34794
34803
  });
34795
34804
  return;
@@ -34875,8 +34884,8 @@ var Ink = class {
34875
34884
  async awaitNextRender() {
34876
34885
  if (!this.nextRenderCommit) {
34877
34886
  let resolveRender;
34878
- const promise = new Promise((resolve7) => {
34879
- resolveRender = resolve7;
34887
+ const promise = new Promise((resolve8) => {
34888
+ resolveRender = resolve8;
34880
34889
  });
34881
34890
  this.nextRenderCommit = { promise, resolve: resolveRender };
34882
34891
  }
@@ -35328,7 +35337,7 @@ import { useState as useState5, useEffect as useEffect6, useCallback as useCallb
35328
35337
 
35329
35338
  // src/tui/index.jsx
35330
35339
  import { closeSync as closeSync3, constants as fsConstants, createWriteStream as createWriteStream3, mkdirSync as mkdirSync8, openSync as openSync3, readSync } from "node:fs";
35331
- import { tmpdir as tmpdir3 } from "node:os";
35340
+ import { tmpdir as tmpdir4 } from "node:os";
35332
35341
  import { dirname as dirname12, join as join17 } from "node:path";
35333
35342
  import { performance as performance2 } from "node:perf_hooks";
35334
35343
  import { format } from "node:util";
@@ -35347,12 +35356,12 @@ import { spawn } from "node:child_process";
35347
35356
  import path from "node:path";
35348
35357
  var DIALOG_TIMEOUT_MS = 5 * 60 * 1e3;
35349
35358
  function runCapture(cmd, args, { timeoutMs = DIALOG_TIMEOUT_MS } = {}) {
35350
- return new Promise((resolve7) => {
35359
+ return new Promise((resolve8) => {
35351
35360
  let child;
35352
35361
  try {
35353
35362
  child = spawn(cmd, args, { stdio: ["ignore", "pipe", "ignore"], windowsHide: true });
35354
35363
  } catch (error) {
35355
- resolve7({ ok: false, code: -1, stdout: "", error });
35364
+ resolve8({ ok: false, code: -1, stdout: "", error });
35356
35365
  return;
35357
35366
  }
35358
35367
  let stdout2 = "";
@@ -35364,7 +35373,7 @@ function runCapture(cmd, args, { timeoutMs = DIALOG_TIMEOUT_MS } = {}) {
35364
35373
  child.kill();
35365
35374
  } catch {
35366
35375
  }
35367
- resolve7({ ok: false, code: -1, stdout: "", error: new Error("dialog timed out") });
35376
+ resolve8({ ok: false, code: -1, stdout: "", error: new Error("dialog timed out") });
35368
35377
  }, timeoutMs);
35369
35378
  timer2.unref?.();
35370
35379
  child.stdout.on("data", (chunk) => {
@@ -35374,13 +35383,13 @@ function runCapture(cmd, args, { timeoutMs = DIALOG_TIMEOUT_MS } = {}) {
35374
35383
  if (settled) return;
35375
35384
  settled = true;
35376
35385
  clearTimeout(timer2);
35377
- resolve7({ ok: false, code: -1, stdout: "", error });
35386
+ resolve8({ ok: false, code: -1, stdout: "", error });
35378
35387
  });
35379
35388
  child.on("close", (code) => {
35380
35389
  if (settled) return;
35381
35390
  settled = true;
35382
35391
  clearTimeout(timer2);
35383
- resolve7({ ok: code === 0, code, stdout: stdout2 });
35392
+ resolve8({ ok: code === 0, code, stdout: stdout2 });
35384
35393
  });
35385
35394
  });
35386
35395
  }
@@ -35388,10 +35397,10 @@ function spawnFailed(result) {
35388
35397
  return !!result && result.code === -1;
35389
35398
  }
35390
35399
  function commandExists(cmd) {
35391
- return new Promise((resolve7) => {
35400
+ return new Promise((resolve8) => {
35392
35401
  const probe = process.platform === "win32" ? spawn("where", [cmd], { stdio: "ignore", windowsHide: true }) : spawn("which", [cmd], { stdio: "ignore" });
35393
- probe.on("error", () => resolve7(false));
35394
- probe.on("close", (code) => resolve7(code === 0));
35402
+ probe.on("error", () => resolve8(false));
35403
+ probe.on("close", (code) => resolve8(code === 0));
35395
35404
  });
35396
35405
  }
35397
35406
  function psSingleQuoted(value) {
@@ -42456,8 +42465,19 @@ var CODE_KINDS = new Map(
42456
42465
  quota_exhausted: ["quota_exceeded", "quota_exhausted", "usage_limit_reached", "provider_accounts_exhausted"],
42457
42466
  context_overflow: ["context_length_exceeded", "context_window_exceeded", "model_context_window_exceeded"],
42458
42467
  request_too_large: ["request_too_large", "payload_too_large", "request_entity_too_large"],
42459
- auth: ["invalid_api_key", "authentication_error", "unauthenticated", "unauthorized", "invalid_authentication"],
42460
- permission: ["permission_error", "permission_denied", "forbidden"],
42468
+ // Google names a rejected or expired key with an ErrorInfo reason on an
42469
+ // INVALID_ARGUMENT 400; the reason outranks the envelope status.
42470
+ auth: [
42471
+ "invalid_api_key",
42472
+ "authentication_error",
42473
+ "unauthenticated",
42474
+ "unauthorized",
42475
+ "invalid_authentication",
42476
+ "api_key_invalid",
42477
+ "api_key_expired",
42478
+ "access_token_expired"
42479
+ ],
42480
+ permission: ["permission_error", "permission_denied", "forbidden", "service_disabled", "api_key_service_blocked"],
42461
42481
  overloaded: [
42462
42482
  "server_is_overloaded",
42463
42483
  "overloaded_error",
@@ -42495,6 +42515,7 @@ var CODE_KINDS = new Map(
42495
42515
  "not_found",
42496
42516
  "not_found_error",
42497
42517
  "model_not_found",
42518
+ "model_not_supported",
42498
42519
  "unsupported_parameter"
42499
42520
  ]
42500
42521
  }).flatMap(([kind, codes]) => codes.map((code) => [code, kind]))
@@ -42845,6 +42866,42 @@ function resetLabel(resetAt) {
42845
42866
  const time = `${pad(reset.getHours())}:${pad(reset.getMinutes())}`;
42846
42867
  return reset.toDateString() === (/* @__PURE__ */ new Date()).toDateString() ? time : `${reset.getMonth() + 1}/${reset.getDate()} ${time}`;
42847
42868
  }
42869
+ var MODEL_REFUSAL_KINDS = /* @__PURE__ */ new Set(["invalid_request", "permission", "unknown"]);
42870
+ var MODEL_UNAVAILABLE_CODES = /* @__PURE__ */ new Set(["model_not_found", "model_not_supported"]);
42871
+ var MODEL_REFUSAL_PREDICATE = "(?:(?:is|was|has been)\\s+)?(?:not found|does not exist|doesn'?t exist|not (?:supported|available)|(?:currently\\s+)?unavailable|no longer (?:available|supported)|deprecated|retired|removed)\\b";
42872
+ var SENTENCE_START = "(?:^|[.:;!]\\s+)";
42873
+ var MODEL_UNAVAILABLE_RE = new RegExp(
42874
+ [
42875
+ // "The model `x` does not exist", "models/x is not found", Vertex
42876
+ // "Publisher Model `…` was not found", Ollama `model "x" not found`.
42877
+ `${SENTENCE_START}(?:(?:the|this|that|requested|selected|publisher)\\s+)*models?(?:\\/\\S+|\\s+[\`'"]?[\\w./:@-]+[\`'"]?)?\\s+${MODEL_REFUSAL_PREDICATE}`,
42878
+ // OpenAI "The 'gpt-x' model is not supported when using Codex …".
42879
+ `${SENTENCE_START}(?:the\\s+)?[\`'"][^\`'"\\n]+[\`'"]\\s+model\\s+${MODEL_REFUSAL_PREDICATE}`,
42880
+ `${SENTENCE_START}(?:unknown|invalid|unsupported) model\\b`,
42881
+ // OpenRouter: no provider serves this model id.
42882
+ `${SENTENCE_START}no endpoints found for [\\w.-]+\\/[\\w.:-]+`,
42883
+ "\\bis not a valid model\\b",
42884
+ "^model: \\S+$"
42885
+ ].join("|"),
42886
+ "im"
42887
+ );
42888
+ var MODEL_UNAVAILABLE_COPY = [
42889
+ "model-unavailable",
42890
+ "This model isn't available for this account.",
42891
+ "Choose another model, or check the model and endpoint in Providers."
42892
+ ];
42893
+ var NOT_FOUND_SUMMARY = "The provider couldn't find the requested model or endpoint.";
42894
+ var TOOL_SCHEMA_RE = /invalid schema for (?:function|tool)\b|\btools\.\d+\.(?:custom\.)?input_schema\b|\bfunction_declarations\[\d+\]\.parameters\b|\btools\[\d+\]\.function\.parameters\b|\binvalid (?:tool|function) (?:schema|parameters|definition)\b/i;
42895
+ var TOOL_SCHEMA_COPY = [
42896
+ "tool-schema",
42897
+ "The provider rejected a tool definition.",
42898
+ "Disable the tool or MCP server named in the details, then try again."
42899
+ ];
42900
+ function firstReadableLine(clean3) {
42901
+ const lines = clean3.split("\n").map((line) => line.trim()).filter(Boolean);
42902
+ const first = lines.find((line) => !/^at\s|^\{|^<!doctype|^<html/i.test(line)) || "";
42903
+ return first && !/^[{[]|^<|(?:API|HTTP)\s+[45]\d\d.*[<{]/i.test(first) ? first : "";
42904
+ }
42848
42905
  var LEGACY_TEXT_KINDS = [
42849
42906
  [/The provider usage limit was reached|quota.*(?:hit|exceed)|usage limit/i, "quota_exhausted"],
42850
42907
  [/rate[_ -]?limit|too many requests/i, "rate_limited"]
@@ -42912,6 +42969,14 @@ function describeError(value) {
42912
42969
  kind = "image-size";
42913
42970
  summary = "An attached image exceeds the provider limit.";
42914
42971
  recovery = "Reduce the image dimensions or number of images, then try again.";
42972
+ } else if (clean3 === MODEL_UNAVAILABLE_COPY[1] || MODEL_REFUSAL_KINDS.has(descriptor.kind) && (MODEL_UNAVAILABLE_CODES.has(code) || MODEL_UNAVAILABLE_RE.test(clean3))) {
42973
+ [kind, summary, recovery] = MODEL_UNAVAILABLE_COPY;
42974
+ } else if (clean3 === TOOL_SCHEMA_COPY[1] || ["invalid_request", "unknown"].includes(descriptor.kind) && TOOL_SCHEMA_RE.test(clean3)) {
42975
+ [kind, summary, recovery] = TOOL_SCHEMA_COPY;
42976
+ } else if (clean3 === NOT_FOUND_SUMMARY || MODEL_REFUSAL_KINDS.has(descriptor.kind) && (status === 404 || status === 410)) {
42977
+ kind = "not-found";
42978
+ summary = firstReadableLine(clean3) || NOT_FOUND_SUMMARY;
42979
+ recovery = MODEL_UNAVAILABLE_COPY[2];
42915
42980
  } else if (descriptor.kind === "unknown" && /payload too large|request (?:body )?too large|The request exceeds the size limit/i.test(clean3)) {
42916
42981
  [kind, summary, recovery] = KIND_COPY.request_too_large;
42917
42982
  } else if (copy) {
@@ -42934,9 +42999,7 @@ function describeError(value) {
42934
42999
  summary = "The provider rejected this request.";
42935
43000
  recovery = "Review the request details before trying again.";
42936
43001
  } else {
42937
- const lines = clean3.split("\n").map((line) => line.trim()).filter(Boolean);
42938
- const first = lines.find((line) => !/^at\s|^\{|^<!doctype|^<html/i.test(line)) || "";
42939
- summary = first && !/^[{[]|^<|(?:API|HTTP)\s+[45]\d\d.*[<{]/i.test(first) ? first : "Something went wrong.";
43002
+ summary = firstReadableLine(clean3) || "Something went wrong.";
42940
43003
  }
42941
43004
  summary = summary.replace(/\s+/g, " ").trim() || "Something went wrong.";
42942
43005
  if (summary.length > SUMMARY_LIMIT) summary = `${summary.slice(0, SUMMARY_LIMIT - 1).trimEnd()}\u2026`;
@@ -43148,7 +43211,9 @@ function typedStreamFailureText(error, text) {
43148
43211
  }
43149
43212
  function presentErrorText(error, options = {}) {
43150
43213
  const presentation = describeError(error);
43151
- if (["image-size", "payload-size", "request"].includes(presentation.kind)) return presentation.summary;
43214
+ if (["image-size", "payload-size", "request", "model-unavailable", "tool-schema"].includes(presentation.kind)) {
43215
+ return presentation.summary;
43216
+ }
43152
43217
  const kindLine = hasTypedEvidence(error) ? KIND_LINES[presentation.providerKind] : null;
43153
43218
  if (kindLine && presentation.kind !== "unknown") {
43154
43219
  return typeof kindLine === "function" ? kindLine(presentation) : kindLine;
@@ -46197,8 +46262,8 @@ var notifyRenderFrame = (seq) => {
46197
46262
  for (const ack of acks) ack(seq);
46198
46263
  };
46199
46264
  var yieldToRenderer = ({ frames = 1 } = {}) => {
46200
- if (!hasRenderFrameSource()) return new Promise((resolve7) => setImmediate(resolve7));
46201
- return new Promise((resolve7) => {
46265
+ if (!hasRenderFrameSource()) return new Promise((resolve8) => setImmediate(resolve8));
46266
+ return new Promise((resolve8) => {
46202
46267
  const minSeq = renderAckSeq;
46203
46268
  let remainingFrames = Math.max(1, Math.floor(Number(frames) || 1));
46204
46269
  let settled = false;
@@ -46213,7 +46278,7 @@ var yieldToRenderer = ({ frames = 1 } = {}) => {
46213
46278
  releaseClosedListener();
46214
46279
  const idx = pendingRenderAcks.indexOf(onFrame);
46215
46280
  if (idx !== -1) pendingRenderAcks.splice(idx, 1);
46216
- resolve7();
46281
+ resolve8();
46217
46282
  };
46218
46283
  releaseClosedListener = onRenderFrameSourcesClosed(finish);
46219
46284
  const onTimeout = () => {
@@ -47013,13 +47078,13 @@ function nativeClipboardCommand(text) {
47013
47078
  function copyToClipboard(text) {
47014
47079
  const value = String(text ?? "");
47015
47080
  const wroteOsc52 = writeOsc52Clipboard(value);
47016
- return new Promise((resolve7, reject) => {
47081
+ return new Promise((resolve8, reject) => {
47017
47082
  const { cmd, args, input } = nativeClipboardCommand(value);
47018
47083
  let child;
47019
47084
  try {
47020
47085
  child = spawn2(cmd, args, { stdio: ["pipe", "ignore", "ignore"], windowsHide: true });
47021
47086
  } catch (e) {
47022
- if (wroteOsc52) resolve7();
47087
+ if (wroteOsc52) resolve8();
47023
47088
  else reject(clipboardHelperError(cmd, e));
47024
47089
  return;
47025
47090
  }
@@ -47028,7 +47093,7 @@ function copyToClipboard(text) {
47028
47093
  });
47029
47094
  if (!wroteOsc52) {
47030
47095
  child.on("close", (code) => {
47031
- if (code === 0) resolve7();
47096
+ if (code === 0) resolve8();
47032
47097
  else reject(new Error(`${cmd} exited with code ${code}`));
47033
47098
  });
47034
47099
  }
@@ -47037,7 +47102,7 @@ function copyToClipboard(text) {
47037
47102
  child.stdin.end(input);
47038
47103
  if (wroteOsc52) {
47039
47104
  child.unref?.();
47040
- resolve7();
47105
+ resolve8();
47041
47106
  }
47042
47107
  });
47043
47108
  }
@@ -47341,7 +47406,7 @@ function mimeForPath(path2) {
47341
47406
  return IMAGE_MIME[extname(String(path2 || "")).toLowerCase()] || null;
47342
47407
  }
47343
47408
  function execFileBuffer(cmd, args, options = {}) {
47344
- return new Promise((resolve7) => {
47409
+ return new Promise((resolve8) => {
47345
47410
  execFile(
47346
47411
  cmd,
47347
47412
  args,
@@ -47353,7 +47418,7 @@ function execFileBuffer(cmd, args, options = {}) {
47353
47418
  ...options
47354
47419
  },
47355
47420
  (error, stdout2, stderr) => {
47356
- resolve7({ ok: !error, code: error?.code ?? 0, stdout: stdout2, stderr, error });
47421
+ resolve8({ ok: !error, code: error?.code ?? 0, stdout: stdout2, stderr, error });
47357
47422
  }
47358
47423
  );
47359
47424
  });
@@ -48749,7 +48814,7 @@ function completeOAuthCode(ctx, target, commandText) {
48749
48814
  }
48750
48815
  oauthSubmitRef.current = true;
48751
48816
  setProviderPrompt((prompt) => prompt === target ? { ...prompt, submitting: true } : prompt);
48752
- const completion = typeof target.login?.completeCode === "function" ? new Promise((resolve7) => resolve7(target.login.completeCode(commandText))) : Promise.reject(new Error("OAuth login is no longer active"));
48817
+ const completion = typeof target.login?.completeCode === "function" ? new Promise((resolve8) => resolve8(target.login.completeCode(commandText))) : Promise.reject(new Error("OAuth login is no longer active"));
48753
48818
  void completion.then(() => {
48754
48819
  const successReturn = target.successReturn;
48755
48820
  const afterSave = target.afterSave;
@@ -50757,7 +50822,12 @@ var ANTIGRAVITY_MODELS = Object.freeze([
50757
50822
  low: "gemini-3.1-pro-low",
50758
50823
  high: "gemini-3.1-pro-high"
50759
50824
  }),
50760
- fallbackModel("gemini-4-argon", "Gemini 4 Argon", "gemini-pro", 1048576, "gemini-4-argon", ["low", "medium", "high"]),
50825
+ // The gateway serves Argon only through per-tier ids; bare `gemini-4-argon` is a 404.
50826
+ fallbackModel("gemini-4-argon", "Gemini 4 Argon", "gemini-pro", 1048576, {
50827
+ low: "gemini-4-argon-low",
50828
+ medium: "gemini-4-argon-medium",
50829
+ high: "gemini-4-argon-high"
50830
+ }),
50761
50831
  fallbackModel("claude-opus-4-6-thinking", "Claude Opus 4.6 (Thinking)", null, 25e4, "claude-opus-4-6-thinking", [
50762
50832
  "low",
50763
50833
  "medium",
@@ -51323,11 +51393,11 @@ function isPidAlive(value) {
51323
51393
 
51324
51394
  // src/runtime/shared/worktrees/git-head.mjs
51325
51395
  import { readFileSync as readFileSync9, statSync as statSync2, watch } from "node:fs";
51326
- import { dirname as dirname8, resolve as resolve5 } from "node:path";
51396
+ import { dirname as dirname8, resolve as resolve6 } from "node:path";
51327
51397
 
51328
51398
  // src/runtime/shared/worktrees/paths.mjs
51329
51399
  import { existsSync as existsSync9, realpathSync as realpathSync2 } from "node:fs";
51330
- import { dirname as dirname7, isAbsolute as isAbsolute2, join as join9, relative, resolve as resolve4, sep } from "node:path";
51400
+ import { dirname as dirname7, isAbsolute as isAbsolute3, join as join9, relative as relative2, resolve as resolve5, sep } from "node:path";
51331
51401
 
51332
51402
  // src/runtime/shared/statusline/statusline-segments.mjs
51333
51403
  var DEFAULT_MIXDOG_HOME = process.env.MIXDOG_HOME || join10(homedir2(), ".mixdog");
@@ -51415,7 +51485,8 @@ async function refreshShellJobsStatus(ownerPid) {
51415
51485
  continue;
51416
51486
  }
51417
51487
  const unconfirmed = detail?.terminationUnconfirmed === true;
51418
- if (unconfirmed ? !isPidAlive(ownerByJob.get(id) || 0) : !await isShellJobAlive(detail, p, dir, id)) continue;
51488
+ if (unconfirmed ? !isHeldShellJobAlive(detail, ownerByJob.get(id)) : !await isShellJobAlive(detail, p, dir, id))
51489
+ continue;
51419
51490
  if (detail?.foreground === true && !unconfirmed) continue;
51420
51491
  const ownedByThisHost = ownerByJob.get(id) === ownerPid;
51421
51492
  if (ownedByThisHost) count++;
@@ -51504,6 +51575,12 @@ function summarizeShellJobs({ count, oldestMs, jobs, bySession }) {
51504
51575
  }
51505
51576
  return { count, elapsedLabel, jobs, sessions };
51506
51577
  }
51578
+ function isHeldShellJobAlive(detail, ownerPid) {
51579
+ if (!isPidAlive(ownerPid || 0)) return false;
51580
+ if (detail?.ownerSessionClosed !== true) return true;
51581
+ const survivors = Array.isArray(detail?.survivorPids) ? detail.survivorPids : [];
51582
+ return [detail?.pid, ...survivors].some((pid) => isPidAlive(positiveInt(pid)));
51583
+ }
51507
51584
  async function isShellJobAlive(detail, detailPath, dir, id) {
51508
51585
  const pid = positiveInt(detail?.pid);
51509
51586
  if (!pid) return false;
@@ -55872,7 +55949,7 @@ function renderToolApproval({ toolApproval, store, frameColumns, expandedOptionP
55872
55949
  toolApproval.id
55873
55950
  );
55874
55951
  }
55875
- const resolve7 = (approved) => {
55952
+ const resolve8 = (approved) => {
55876
55953
  store.resolveToolApproval?.(toolApproval.id, {
55877
55954
  approved,
55878
55955
  reason: approved ? "approved by user" : "denied by user"
@@ -55897,12 +55974,12 @@ function renderToolApproval({ toolApproval, store, frameColumns, expandedOptionP
55897
55974
  description: "run this tool call"
55898
55975
  }
55899
55976
  ],
55900
- onSelect: (value) => resolve7(value === "approve"),
55901
- onCancel: () => resolve7(false),
55977
+ onSelect: (value) => resolve8(value === "approve"),
55978
+ onCancel: () => resolve8(false),
55902
55979
  onKey: (input) => {
55903
55980
  const value = String(input || "").trim().toLowerCase();
55904
- if (value === "a" || value === "y") resolve7(true);
55905
- else if (value === "d" || value === "n") resolve7(false);
55981
+ if (value === "a" || value === "y") resolve8(true);
55982
+ else if (value === "d" || value === "n") resolve8(false);
55906
55983
  },
55907
55984
  title: "Tool approval",
55908
55985
  description: toolApprovalDescription(toolApproval),
@@ -60273,7 +60350,7 @@ function createProviderSetupPicker({
60273
60350
  }
60274
60351
  });
60275
60352
  try {
60276
- await new Promise((resolve7) => setTimeout(resolve7, 0));
60353
+ await new Promise((resolve8) => setTimeout(resolve8, 0));
60277
60354
  return await store.getProviderSetup(options.forceRefresh ? { force: true } : void 0);
60278
60355
  } catch (e) {
60279
60356
  store.pushNotice(`providers failed: ${e?.message || e}`, "error");
@@ -60395,7 +60472,7 @@ function createModelCatalog({ store, providerModelsCacheRef, webSearchModelsCach
60395
60472
  let renderedQuickModels = false;
60396
60473
  if (!providerModels.length || options.refreshModels === true) {
60397
60474
  paintLoading();
60398
- await new Promise((resolve7) => setTimeout(resolve7, 0));
60475
+ await new Promise((resolve8) => setTimeout(resolve8, 0));
60399
60476
  try {
60400
60477
  if (options.refreshModels !== true && options.cacheRef !== "webSearch") {
60401
60478
  refreshModelsPromise = Promise.resolve(loadModels({ force: false }));
@@ -61437,7 +61514,7 @@ import {
61437
61514
  rm as rmP,
61438
61515
  stat as statP
61439
61516
  } from "node:fs/promises";
61440
- import { basename as basename5, dirname as dirname9, join as join11, resolve as resolve6 } from "node:path";
61517
+ import { basename as basename5, dirname as dirname9, join as join11, resolve as resolve7 } from "node:path";
61441
61518
  import { homedir as homedir3 } from "node:os";
61442
61519
  import { createHash as createHash4, randomUUID } from "node:crypto";
61443
61520
  function getBackupRoot() {
@@ -61449,7 +61526,7 @@ var BACKUP_MANIFEST = "backup.json";
61449
61526
  var INIT_MARKER = ".mixdog-user-data.json";
61450
61527
  var SCOPE_PREFIX = "scope-";
61451
61528
  function normalizeDataDir(dataDir2) {
61452
- const full = resolve6(String(dataDir2));
61529
+ const full = resolve7(String(dataDir2));
61453
61530
  return process.platform === "win32" ? full.toLowerCase() : full;
61454
61531
  }
61455
61532
  function scopeDirFor(dataDir2) {
@@ -61458,20 +61535,67 @@ function scopeDirFor(dataDir2) {
61458
61535
  }
61459
61536
  var lastBackupMs = 0;
61460
61537
  var backupSeq = 0;
61538
+ var BACKUP_NAME_RE = /^(\d{4}-\d{2}-\d{2})T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z-(?:(\d{10})-)?/;
61539
+ function newestBackupOrder(names) {
61540
+ let ms = 0;
61541
+ let seq = -1;
61542
+ for (const name of names) {
61543
+ const match = BACKUP_NAME_RE.exec(name);
61544
+ if (!match) continue;
61545
+ const time = Date.parse(`${match[1]}T${match[2]}:${match[3]}:${match[4]}.${match[5]}Z`);
61546
+ if (!Number.isFinite(time)) continue;
61547
+ const order = match[6] === void 0 ? Number.POSITIVE_INFINITY : Number(match[6]);
61548
+ if (time > ms || time === ms && order > seq) {
61549
+ ms = time;
61550
+ seq = order;
61551
+ }
61552
+ }
61553
+ return { ms, seq };
61554
+ }
61555
+ function nextBackupName(names, reason) {
61556
+ const newest = newestBackupOrder(names);
61557
+ lastBackupMs = Math.max(Date.now(), lastBackupMs, newest.ms);
61558
+ if (lastBackupMs === newest.ms) {
61559
+ if (newest.seq === Number.POSITIVE_INFINITY) lastBackupMs += 1;
61560
+ else backupSeq = Math.max(backupSeq, newest.seq + 1);
61561
+ }
61562
+ const time = new Date(lastBackupMs).toISOString().replace(/[:.]/g, "-");
61563
+ return `${time}-${String(backupSeq++).padStart(10, "0")}-${safeReason(reason)}`;
61564
+ }
61565
+ function scopeBackupNames(entries) {
61566
+ return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
61567
+ }
61461
61568
  function reserveBackupDir(scopeDir, reason) {
61462
61569
  mkdirSync4(scopeDir, { recursive: true });
61570
+ const names = scopeBackupNames(readdirSync2(scopeDir, { withFileTypes: true }));
61571
+ for (; ; ) {
61572
+ const name = nextBackupName(names, reason);
61573
+ names.push(name);
61574
+ try {
61575
+ mkdirSync4(join11(scopeDir, name));
61576
+ return { backupDir: join11(scopeDir, name), names };
61577
+ } catch (error) {
61578
+ if (error?.code !== "EEXIST") throw error;
61579
+ }
61580
+ }
61581
+ }
61582
+ async function reserveBackupDirAsync(scopeDir, reason) {
61583
+ await mkdirP(scopeDir, { recursive: true });
61584
+ const names = scopeBackupNames(await readdirP(scopeDir, { withFileTypes: true }));
61463
61585
  for (; ; ) {
61464
- lastBackupMs = Math.max(Date.now(), lastBackupMs);
61465
- const time = new Date(lastBackupMs).toISOString().replace(/[:.]/g, "-");
61466
- const backupDir = join11(scopeDir, `${time}-${String(backupSeq++).padStart(10, "0")}-${safeReason(reason)}`);
61586
+ const name = nextBackupName(names, reason);
61587
+ names.push(name);
61467
61588
  try {
61468
- mkdirSync4(backupDir);
61469
- return backupDir;
61589
+ await mkdirP(join11(scopeDir, name));
61590
+ return { backupDir: join11(scopeDir, name), names };
61470
61591
  } catch (error) {
61471
61592
  if (error?.code !== "EEXIST") throw error;
61472
61593
  }
61473
61594
  }
61474
61595
  }
61596
+ function backupsToPrune(names, own, keep = 40) {
61597
+ return [...names].sort().reverse().slice(keep).filter((name) => name !== own);
61598
+ }
61475
61599
  function safeReason(reason) {
61476
61600
  return String(reason || "snapshot").replace(/[^a-z0-9_.-]+/gi, "-").slice(0, 48) || "snapshot";
61477
61601
  }
@@ -61502,7 +61626,7 @@ function manifestDataDirMatches(backupDir, dataDirKey) {
61502
61626
  }
61503
61627
  function legacyMarkersFor(root, dataDir2, dataDirKey) {
61504
61628
  const hashed = new Set(
61505
- [String(dataDir2), resolve6(String(dataDir2))].map(
61629
+ [String(dataDir2), resolve7(String(dataDir2))].map(
61506
61630
  (value) => `.initialized-${createHash4("sha256").update(value).digest("hex").slice(0, 16)}.json`
61507
61631
  )
61508
61632
  );
@@ -61556,9 +61680,20 @@ function isStructurallyCompleteMixdogConfigBackup(parsed) {
61556
61680
  if (!parsed.agent && !parsed.channels) return false;
61557
61681
  return true;
61558
61682
  }
61559
- function backupDirsNewestFirst(dir) {
61683
+ function isAbsentBackupError(error) {
61684
+ return error instanceof SyntaxError || error?.code === "ENOENT" || error?.code === "ENOTDIR";
61685
+ }
61686
+ function listBackupDirsNewestFirst(dir) {
61560
61687
  try {
61561
61688
  return readdirSync2(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort().reverse();
61689
+ } catch (error) {
61690
+ if (isAbsentBackupError(error)) return [];
61691
+ throw error;
61692
+ }
61693
+ }
61694
+ function backupDirsNewestFirst(dir) {
61695
+ try {
61696
+ return listBackupDirsNewestFirst(dir);
61562
61697
  } catch {
61563
61698
  return [];
61564
61699
  }
@@ -61570,19 +61705,20 @@ function readRestorableConfig(backupDir, dataDirKey, instanceId) {
61570
61705
  if (manifest.instanceId !== instanceId) return null;
61571
61706
  const parsed = JSON.parse(readFileSync11(join11(backupDir, "mixdog-config.json"), "utf8"));
61572
61707
  return isStructurallyCompleteMixdogConfigBackup(parsed) ? parsed : null;
61573
- } catch {
61574
- return null;
61708
+ } catch (error) {
61709
+ if (isAbsentBackupError(error)) return null;
61710
+ throw error;
61575
61711
  }
61576
61712
  }
61577
61713
  function findRestorableConfig(dataDir2, instanceId) {
61578
61714
  const key = normalizeDataDir(dataDir2);
61579
61715
  const scopeDir = scopeDirFor(dataDir2);
61580
- for (const name of backupDirsNewestFirst(scopeDir)) {
61716
+ for (const name of listBackupDirsNewestFirst(scopeDir)) {
61581
61717
  const parsed = readRestorableConfig(join11(scopeDir, name), key, instanceId);
61582
61718
  if (parsed) return parsed;
61583
61719
  }
61584
61720
  const root = getBackupRoot();
61585
- for (const name of backupDirsNewestFirst(root)) {
61721
+ for (const name of listBackupDirsNewestFirst(root)) {
61586
61722
  if (name.startsWith(SCOPE_PREFIX)) continue;
61587
61723
  const parsed = readRestorableConfig(join11(root, name), key, instanceId);
61588
61724
  if (parsed) return parsed;
@@ -61596,7 +61732,8 @@ function loadLatestMixdogConfigFromBackup(dataDir2, options) {
61596
61732
  const key = normalizeDataDir(dataDir2);
61597
61733
  const root = getBackupRoot();
61598
61734
  let hit = restoreLookupCache.get(key);
61599
- if (!hit || hit.root !== root || hit.instanceId !== instanceId) {
61735
+ if (options?.fresh || !hit || hit.root !== root || hit.instanceId !== instanceId) {
61736
+ restoreLookupCache.delete(key);
61600
61737
  hit = { root, instanceId, config: findRestorableConfig(dataDir2, instanceId) };
61601
61738
  restoreLookupCache.set(key, hit);
61602
61739
  }
@@ -61626,8 +61763,8 @@ function copyTree(src, dst, copied) {
61626
61763
  copyFileSync(src, dst);
61627
61764
  copied.push(dst);
61628
61765
  }
61629
- function pruneBackups(scopeDir, keep = 40) {
61630
- for (const name of backupDirsNewestFirst(scopeDir).slice(keep)) {
61766
+ function pruneBackups(scopeDir, names, own) {
61767
+ for (const name of backupsToPrune(names, own)) {
61631
61768
  try {
61632
61769
  rmSync(join11(scopeDir, name), { recursive: true, force: true });
61633
61770
  } catch {
@@ -61641,7 +61778,7 @@ function markUserDataInitialized(dataDir2) {
61641
61778
  writeFileSync4(
61642
61779
  join11(dataDir2, INIT_MARKER),
61643
61780
  `${JSON.stringify(
61644
- { instanceId: randomUUID(), dataDir: resolve6(dataDir2), createdAt: (/* @__PURE__ */ new Date()).toISOString() },
61781
+ { instanceId: randomUUID(), dataDir: resolve7(dataDir2), createdAt: (/* @__PURE__ */ new Date()).toISOString() },
61645
61782
  null,
61646
61783
  2
61647
61784
  )}
@@ -61669,7 +61806,7 @@ function finishBackup(dataDir2, backupDir, reason) {
61669
61806
  writeFileSync4(
61670
61807
  join11(backupDir, BACKUP_MANIFEST),
61671
61808
  `${JSON.stringify(
61672
- { dataDir: resolve6(dataDir2), instanceId, reason, createdAt: (/* @__PURE__ */ new Date()).toISOString() },
61809
+ { dataDir: resolve7(dataDir2), instanceId, reason, createdAt: (/* @__PURE__ */ new Date()).toISOString() },
61673
61810
  null,
61674
61811
  2
61675
61812
  )}
@@ -61679,23 +61816,23 @@ function finishBackup(dataDir2, backupDir, reason) {
61679
61816
  restoreLookupCache.delete(normalizeDataDir(dataDir2));
61680
61817
  legacyEvidenceCache.delete(normalizeDataDir(dataDir2));
61681
61818
  }
61682
- function backupUserData(dataDir2, reason = "snapshot") {
61819
+ function backupUserData(dataDir2, reason = "snapshot", { dirs = [] } = {}) {
61683
61820
  if (skipBackups()) return { dir: null, copied: [] };
61684
61821
  if (!dataDir2 || !existsSync10(dataDir2)) return { dir: null, copied: [] };
61685
61822
  const scopeDir = scopeDirFor(dataDir2);
61686
- const backupDir = reserveBackupDir(scopeDir, reason);
61823
+ const { backupDir, names } = reserveBackupDir(scopeDir, reason);
61687
61824
  const copied = [];
61688
61825
  for (const rel of USER_DATA_FILES) {
61689
61826
  const src = join11(dataDir2, rel);
61690
61827
  if (existsSync10(src)) copyTree(src, join11(backupDir, rel), copied);
61691
61828
  }
61692
- for (const rel of USER_DATA_DIRS) {
61829
+ for (const rel of [...USER_DATA_DIRS, ...dirs]) {
61693
61830
  const src = join11(dataDir2, rel);
61694
61831
  if (existsSync10(src)) copyTree(src, join11(backupDir, rel), copied);
61695
61832
  }
61696
61833
  if (copied.length > 0) {
61697
61834
  finishBackup(dataDir2, backupDir, reason);
61698
- pruneBackups(scopeDir);
61835
+ pruneBackups(scopeDir, names, basename5(backupDir));
61699
61836
  if (process.env.MIXDOG_SETUP_QUIET !== "1") {
61700
61837
  process.stderr.write(`[user-data-backup] ${reason}: copied ${copied.length} file(s) to ${backupDir}
61701
61838
  `);
@@ -61718,14 +61855,8 @@ async function copyTreeAsync(src, dst, copied) {
61718
61855
  await copyFileP(src, dst);
61719
61856
  copied.push(dst);
61720
61857
  }
61721
- async function pruneBackupsAsync(scopeDir, keep = 40) {
61722
- let entries = [];
61723
- try {
61724
- entries = (await readdirP(scopeDir, { withFileTypes: true })).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort().reverse();
61725
- } catch {
61726
- return;
61727
- }
61728
- for (const name of entries.slice(keep)) {
61858
+ async function pruneBackupsAsync(scopeDir, names, own) {
61859
+ for (const name of backupsToPrune(names, own)) {
61729
61860
  try {
61730
61861
  await rmP(join11(scopeDir, name), { recursive: true, force: true });
61731
61862
  } catch {
@@ -61736,7 +61867,7 @@ async function backupUserDataAsync(dataDir2, reason = "snapshot") {
61736
61867
  if (skipBackups()) return { dir: null, copied: [] };
61737
61868
  if (!dataDir2 || !existsSync10(dataDir2)) return { dir: null, copied: [] };
61738
61869
  const scopeDir = scopeDirFor(dataDir2);
61739
- const backupDir = reserveBackupDir(scopeDir, reason);
61870
+ const { backupDir, names } = await reserveBackupDirAsync(scopeDir, reason);
61740
61871
  const copied = [];
61741
61872
  for (const rel of USER_DATA_FILES) {
61742
61873
  const src = join11(dataDir2, rel);
@@ -61748,7 +61879,7 @@ async function backupUserDataAsync(dataDir2, reason = "snapshot") {
61748
61879
  }
61749
61880
  if (copied.length > 0) {
61750
61881
  finishBackup(dataDir2, backupDir, reason);
61751
- await pruneBackupsAsync(scopeDir);
61882
+ await pruneBackupsAsync(scopeDir, names, basename5(backupDir));
61752
61883
  if (process.env.MIXDOG_SETUP_QUIET !== "1") {
61753
61884
  process.stderr.write(`[user-data-backup] ${reason}: copied ${copied.length} file(s) to ${backupDir}
61754
61885
  `);
@@ -61970,7 +62101,13 @@ function readAll() {
61970
62101
  return canonicalizeUnifiedConfig(parsed);
61971
62102
  }
61972
62103
  if (isUserDataRecoveryExpected(resolvePluginData())) {
61973
- const restored = loadLatestMixdogConfigFromBackup(resolvePluginData());
62104
+ let restored = null;
62105
+ try {
62106
+ restored = loadLatestMixdogConfigFromBackup(resolvePluginData());
62107
+ } catch (err) {
62108
+ process.stderr.write(`[config] backup restore lookup failed: ${err.message}
62109
+ `);
62110
+ }
61974
62111
  if (restored && isPlainObject(restored)) {
61975
62112
  const config = canonicalizeUnifiedConfig(restored);
61976
62113
  persistRestoredConfig(config);
@@ -63563,8 +63700,8 @@ function usePromptQueueHistory({
63563
63700
  let timer2 = null;
63564
63701
  Promise.race([
63565
63702
  Promise.resolve(store.dispose?.("cli-react-exit", { detach: true })),
63566
- new Promise((resolve7) => {
63567
- timer2 = setTimeout(resolve7, 350);
63703
+ new Promise((resolve8) => {
63704
+ timer2 = setTimeout(resolve8, 350);
63568
63705
  })
63569
63706
  ]).finally(() => {
63570
63707
  if (timer2) clearTimeout(timer2);
@@ -63769,6 +63906,7 @@ function useTerminalChrome({ stdout: stdout2, isRawModeSupported, setResizeState
63769
63906
  import { useCallback as useCallback21, useEffect as useEffect27, useLayoutEffect as useLayoutEffect8 } from "react";
63770
63907
 
63771
63908
  // src/tui/session/transcript-spill.mjs
63909
+ import { randomBytes as randomBytes4 } from "node:crypto";
63772
63910
  import { readFileSync as readFileSync16 } from "node:fs";
63773
63911
  import { join as join16 } from "node:path";
63774
63912
  import { Worker as Worker2 } from "node:worker_threads";
@@ -63776,7 +63914,7 @@ import { Worker as Worker2 } from "node:worker_threads";
63776
63914
  // src/tui/session/transcript-spill/spill-dir.mjs
63777
63915
  import { randomUUID as randomUUID2 } from "node:crypto";
63778
63916
  import { mkdtempSync, readdirSync as readdirSync5, readFileSync as readFileSync15, rmSync as rmSync5, statSync as statSync6, writeFileSync as writeFileSync6 } from "node:fs";
63779
- import { tmpdir as tmpdir2 } from "node:os";
63917
+ import { tmpdir as tmpdir3 } from "node:os";
63780
63918
  import { join as join15 } from "node:path";
63781
63919
  var STALE_MS = 24 * 60 * 60 * 1e3;
63782
63920
  var PROCESS_NONCE = randomUUID2();
@@ -63786,6 +63924,7 @@ import { randomUUID as randomUUID3 } from "node:crypto";
63786
63924
 
63787
63925
  // src/tui/session/transcript-spill.mjs
63788
63926
  var TUI_DEBUG = /^(1|true|yes|on)$/i.test(String(process.env.MIXDOG_TUI_DEBUG || ""));
63927
+ var ID_PREFIX = `it_${randomBytes4(4).toString("hex")}_`;
63789
63928
 
63790
63929
  // src/tui/app/transcript-measure.mjs
63791
63930
  var HARVEST_BUMP_STREAK_LIMIT = 10;
@@ -66151,8 +66290,8 @@ function waitWithTimeout(promise, ms) {
66151
66290
  let timer2 = null;
66152
66291
  return Promise.race([
66153
66292
  Promise.resolve(promise).then(() => true),
66154
- new Promise((resolve7) => {
66155
- timer2 = setTimeout(() => resolve7(false), ms);
66293
+ new Promise((resolve8) => {
66294
+ timer2 = setTimeout(() => resolve8(false), ms);
66156
66295
  })
66157
66296
  ]).finally(() => {
66158
66297
  if (timer2) clearTimeout(timer2);
@@ -66171,7 +66310,7 @@ function scheduleHardExit(code = 0) {
66171
66310
  timer2.unref?.();
66172
66311
  }
66173
66312
  function resolveTuiStderrLogPath() {
66174
- return process.env.MIXDOG_TUI_STDERR_LOG || join17(process.env.MIXDOG_RUNTIME_ROOT || join17(tmpdir3(), "mixdog"), "mixdog-tui.stderr.log");
66313
+ return process.env.MIXDOG_TUI_STDERR_LOG || join17(process.env.MIXDOG_RUNTIME_ROOT || join17(tmpdir4(), "mixdog"), "mixdog-tui.stderr.log");
66175
66314
  }
66176
66315
  function ansiFg(rgb2) {
66177
66316
  const m = /rgb\((\d+),\s*(\d+),\s*(\d+)\)/.exec(String(rgb2 || ""));