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.
- package/package.json +2 -2
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +4 -2
- package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +125 -16
- package/src/runtime/agent/orchestrator/session/manager.mjs +3 -0
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +9 -2
- package/src/runtime/agent/orchestrator/tools/env-scrub.mjs +8 -0
- package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +4 -3
- package/src/runtime/agent/orchestrator/tools/token-manifest.json +23 -2
- package/src/runtime/memory/lib/memory-action-handlers.mjs +4 -1
- package/src/runtime/memory/tool-defs.mjs +19 -3
- package/src/session-runtime/lifecycle-api.mjs +15 -0
- package/src/session-runtime/provider-auth-api.mjs +8 -0
- package/src/session-runtime/provider-usage.mjs +30 -5
- package/src/session-runtime/runtime-core.mjs +267 -481
- package/src/session-runtime/session-lifecycle.mjs +378 -0
- package/src/standalone/agent-shard/shard-pool.mjs +6 -5
- package/src/standalone/agent-tool/job-views.mjs +329 -0
- package/src/standalone/agent-tool/spawn-flow.mjs +629 -0
- package/src/standalone/agent-tool/tag-registry.mjs +340 -0
- package/src/standalone/agent-tool.mjs +100 -1151
- package/src/standalone/usage-dashboard.mjs +23 -1
- package/src/tui/App.jsx +362 -2576
- package/src/tui/app/app-view.jsx +504 -0
- package/src/tui/app/create-app-pickers.mjs +313 -0
- package/src/tui/app/prompt-submit.mjs +501 -0
- package/src/tui/app/shell-layout.mjs +563 -0
- package/src/tui/app/usage-context-panels.mjs +288 -0
- package/src/tui/app/use-copy-selection.mjs +56 -0
- package/src/tui/app/use-global-key-input.mjs +151 -0
- package/src/tui/app/use-pasted-buffers.mjs +115 -0
- package/src/tui/app/use-prompt-draft-flow.mjs +167 -0
- package/src/tui/app/use-prompt-hint.mjs +58 -0
- package/src/tui/app/use-prompt-queue-history.mjs +100 -0
- package/src/tui/app/use-terminal-chrome.mjs +72 -0
- package/src/tui/app/use-transcript-activity.mjs +131 -0
- package/src/tui/app/use-welcome-prompt-hint.mjs +96 -0
- package/src/tui/dist/index.mjs +9802 -9024
- 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)
|
|
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 });
|