mixdog 0.9.86 → 0.9.87

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 (38) hide show
  1. package/package.json +2 -2
  2. package/src/runtime/agent/orchestrator/agent-trace-format.mjs +4 -2
  3. package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +125 -16
  4. package/src/runtime/agent/orchestrator/session/manager.mjs +3 -0
  5. package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +9 -2
  6. package/src/runtime/agent/orchestrator/tools/env-scrub.mjs +8 -0
  7. package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +4 -3
  8. package/src/runtime/agent/orchestrator/tools/token-manifest.json +23 -2
  9. package/src/runtime/memory/lib/memory-action-handlers.mjs +4 -1
  10. package/src/runtime/memory/tool-defs.mjs +19 -3
  11. package/src/session-runtime/lifecycle-api.mjs +15 -0
  12. package/src/session-runtime/provider-auth-api.mjs +8 -0
  13. package/src/session-runtime/provider-usage.mjs +30 -5
  14. package/src/session-runtime/runtime-core.mjs +267 -481
  15. package/src/session-runtime/session-lifecycle.mjs +378 -0
  16. package/src/standalone/agent-shard/shard-pool.mjs +6 -5
  17. package/src/standalone/agent-tool/job-views.mjs +329 -0
  18. package/src/standalone/agent-tool/spawn-flow.mjs +629 -0
  19. package/src/standalone/agent-tool/tag-registry.mjs +340 -0
  20. package/src/standalone/agent-tool.mjs +100 -1151
  21. package/src/standalone/usage-dashboard.mjs +23 -1
  22. package/src/tui/App.jsx +362 -2576
  23. package/src/tui/app/app-view.jsx +504 -0
  24. package/src/tui/app/create-app-pickers.mjs +313 -0
  25. package/src/tui/app/prompt-submit.mjs +501 -0
  26. package/src/tui/app/shell-layout.mjs +563 -0
  27. package/src/tui/app/usage-context-panels.mjs +288 -0
  28. package/src/tui/app/use-copy-selection.mjs +56 -0
  29. package/src/tui/app/use-global-key-input.mjs +151 -0
  30. package/src/tui/app/use-pasted-buffers.mjs +115 -0
  31. package/src/tui/app/use-prompt-draft-flow.mjs +167 -0
  32. package/src/tui/app/use-prompt-hint.mjs +58 -0
  33. package/src/tui/app/use-prompt-queue-history.mjs +100 -0
  34. package/src/tui/app/use-terminal-chrome.mjs +72 -0
  35. package/src/tui/app/use-transcript-activity.mjs +131 -0
  36. package/src/tui/app/use-welcome-prompt-hint.mjs +96 -0
  37. package/src/tui/dist/index.mjs +9802 -9024
  38. package/src/tui/engine/session-api-ext.mjs +23 -0
@@ -82,6 +82,19 @@ function normaliseWindows(value, source = 'config') {
82
82
  }).filter(Boolean);
83
83
  }
84
84
 
85
+ function normaliseResetCredits(value) {
86
+ if (!value || typeof value !== 'object') return null;
87
+ const availableCount = num(value.availableCount ?? value.available_count, null);
88
+ const offerRevision = clean(value.offerRevision ?? value.offer_revision);
89
+ if (availableCount === null || !offerRevision) return null;
90
+ const nextExpiresAt = num(value.nextExpiresAt ?? value.next_expires_at, null);
91
+ return {
92
+ availableCount: Math.max(0, Math.floor(availableCount)),
93
+ offerRevision,
94
+ ...(nextExpiresAt && nextExpiresAt > 0 ? { nextExpiresAt } : {}),
95
+ };
96
+ }
97
+
85
98
  function localBudget(providerCfg = {}) {
86
99
  const limitUsd = num(
87
100
  providerCfg.limitUsd ?? providerCfg.limit_usd ?? providerCfg.budgetUsd ?? providerCfg.budget_usd
@@ -224,7 +237,14 @@ async function oauthSnapshot(providerId, { refresh, getProvider, log }) {
224
237
  if (typeof getProvider === 'function') {
225
238
  try {
226
239
  const providerObj = getProvider(providerId);
227
- if (providerObj) return await fetchOAuthUsageSnapshot({ provider: providerId, model: '' }, providerObj, log);
240
+ if (providerObj) {
241
+ return await fetchOAuthUsageSnapshot(
242
+ { provider: providerId, model: '' },
243
+ providerObj,
244
+ log,
245
+ { force: refresh === true },
246
+ );
247
+ }
228
248
  } catch {
229
249
  return null;
230
250
  }
@@ -544,7 +564,9 @@ export async function createUsageDashboard(config = {}, options = {}) {
544
564
  const snapshot = await oauthSnapshot(item.id, options);
545
565
  const known = snapshotRemaining(snapshot);
546
566
  const windows = normaliseWindows(snapshot?.quotaWindows, clean(snapshot?.source) || 'provider-api');
567
+ const resetCredits = normaliseResetCredits(snapshot?.resetCredits);
547
568
  row.windows = windows;
569
+ if (resetCredits) row.resetCredits = resetCredits;
548
570
  row.updatedAt = num(snapshot?.cachedAt, null);
549
571
  if (known) {
550
572
  applyKnownRemaining(row, known, { estimated: false });