mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
feat(panel): add project/workspace cost attribution, Projects ranking tab, and session project tags
This commit is contained in:
@@ -481,26 +481,50 @@ export function readLocalSummarySnapshot(productRoots = PRODUCT_DATA_ROOTS, { fo
|
||||
withReadOnlySqliteDb(dbPath, (db) => {
|
||||
let rows = [];
|
||||
try {
|
||||
rows = db
|
||||
.prepare(
|
||||
`SELECT
|
||||
conversation_id,
|
||||
title,
|
||||
preview,
|
||||
status,
|
||||
source,
|
||||
parent_conversation_id,
|
||||
nesting_depth,
|
||||
agent_name,
|
||||
not_fully_idle,
|
||||
killed,
|
||||
step_count,
|
||||
last_modified_time,
|
||||
app_data_dir,
|
||||
raw_summary
|
||||
FROM conversation_summaries`
|
||||
)
|
||||
.all();
|
||||
try {
|
||||
rows = db
|
||||
.prepare(
|
||||
`SELECT
|
||||
conversation_id,
|
||||
title,
|
||||
preview,
|
||||
status,
|
||||
source,
|
||||
parent_conversation_id,
|
||||
nesting_depth,
|
||||
agent_name,
|
||||
not_fully_idle,
|
||||
killed,
|
||||
step_count,
|
||||
last_modified_time,
|
||||
app_data_dir,
|
||||
workspace_uris,
|
||||
raw_summary
|
||||
FROM conversation_summaries`
|
||||
)
|
||||
.all();
|
||||
} catch {
|
||||
rows = db
|
||||
.prepare(
|
||||
`SELECT
|
||||
conversation_id,
|
||||
title,
|
||||
preview,
|
||||
status,
|
||||
source,
|
||||
parent_conversation_id,
|
||||
nesting_depth,
|
||||
agent_name,
|
||||
not_fully_idle,
|
||||
killed,
|
||||
step_count,
|
||||
last_modified_time,
|
||||
app_data_dir,
|
||||
raw_summary
|
||||
FROM conversation_summaries`
|
||||
)
|
||||
.all();
|
||||
}
|
||||
} catch {
|
||||
rows = db
|
||||
.prepare(
|
||||
@@ -587,6 +611,22 @@ export function readLocalSummarySnapshot(productRoots = PRODUCT_DATA_ROOTS, { fo
|
||||
? decoded.annotations.sideQuestionCascadeIds
|
||||
: [];
|
||||
const sideQuestionTitles = decoded?.annotations?.sideQuestionTitles || {};
|
||||
let workspaceUri = '';
|
||||
const rawWsCol = String(row?.workspace_uris || '').trim();
|
||||
if (rawWsCol) {
|
||||
if (rawWsCol.startsWith('[')) {
|
||||
try {
|
||||
const parsedWs = JSON.parse(rawWsCol);
|
||||
if (Array.isArray(parsedWs)) {
|
||||
workspaceUri = String(parsedWs.find((u) => String(u || '').trim()) || '').trim();
|
||||
}
|
||||
} catch {
|
||||
workspaceUri = rawWsCol;
|
||||
}
|
||||
} else {
|
||||
workspaceUri = rawWsCol;
|
||||
}
|
||||
}
|
||||
|
||||
const entry = {
|
||||
cascadeId: cidLower,
|
||||
@@ -605,6 +645,7 @@ export function readLocalSummarySnapshot(productRoots = PRODUCT_DATA_ROOTS, { fo
|
||||
trajectoryType,
|
||||
isSideQuestion,
|
||||
forkParentConversationId,
|
||||
...(workspaceUri ? { workspaceUri } : {}),
|
||||
};
|
||||
|
||||
const summaryRpcShape = {
|
||||
@@ -620,6 +661,9 @@ export function readLocalSummarySnapshot(productRoots = PRODUCT_DATA_ROOTS, { fo
|
||||
trajectoryType,
|
||||
isSideQuestion,
|
||||
forkParentConversationId,
|
||||
...(workspaceUri
|
||||
? { workspaces: [{ workspaceFolderAbsoluteUri: workspaceUri }] }
|
||||
: {}),
|
||||
annotations: {
|
||||
title,
|
||||
archived: Boolean(decoded?.annotations?.archived),
|
||||
|
||||
@@ -1707,6 +1707,18 @@ export async function enumerateAndSyncConversations({
|
||||
? 'CASCADE_RUN_STATUS_RUNNING'
|
||||
: 'IDLE';
|
||||
|
||||
const rawWsList = Array.isArray(item?.workspaces) ? item.workspaces : [];
|
||||
const rpcWorkspaceUri = String(
|
||||
rawWsList[0]?.workspaceFolderAbsoluteUri ||
|
||||
rawWsList[0]?.gitRootAbsoluteUri ||
|
||||
item?.workspaceFolderAbsoluteUri ||
|
||||
item?.workspaceUri ||
|
||||
''
|
||||
).trim();
|
||||
const workspaceUri = String(
|
||||
rpcWorkspaceUri || localSum?.workspaceUri || cached?.workspaceUri || ''
|
||||
).trim();
|
||||
|
||||
if (item) {
|
||||
const lastModifiedMs =
|
||||
summaryMtimeMs || diskMtimeMs || cached?.lastModifiedMs || 0;
|
||||
@@ -1736,6 +1748,7 @@ export async function enumerateAndSyncConversations({
|
||||
dbPath,
|
||||
diskFileSig,
|
||||
appSource,
|
||||
...(workspaceUri ? { workspaceUri } : {}),
|
||||
inSummaries: true,
|
||||
isSubagent,
|
||||
isSideQuestion,
|
||||
@@ -1773,6 +1786,7 @@ export async function enumerateAndSyncConversations({
|
||||
dbPath,
|
||||
diskFileSig,
|
||||
appSource,
|
||||
...(workspaceUri ? { workspaceUri } : {}),
|
||||
inSummaries: false,
|
||||
isSubagent,
|
||||
isSideQuestion,
|
||||
@@ -1802,6 +1816,7 @@ export async function enumerateAndSyncConversations({
|
||||
dbPath,
|
||||
diskFileSig,
|
||||
appSource,
|
||||
...(workspaceUri ? { workspaceUri } : {}),
|
||||
inSummaries: false,
|
||||
needsInitialLoad: true,
|
||||
isSubagent,
|
||||
@@ -2109,6 +2124,7 @@ export async function enumerateAndSyncConversations({
|
||||
if (rpcSwarmMeta) cacheEntry.swarmMeta = rpcSwarmMeta;
|
||||
if (isParkedSwarm) cacheEntry.parkedOnSwarmWait = true;
|
||||
if (conv.diskFileSig) cacheEntry.diskFileSig = conv.diskFileSig;
|
||||
if (conv.workspaceUri) cacheEntry.workspaceUri = conv.workspaceUri;
|
||||
if (conv.appSource && conv.appSource !== 'standalone') {
|
||||
cacheEntry.appSource = conv.appSource;
|
||||
}
|
||||
@@ -2200,6 +2216,7 @@ export async function enumerateAndSyncConversations({
|
||||
accountName: offlineAccountName,
|
||||
title: offlineFallback.title,
|
||||
...(offlineFallback.appSource ? { appSource: offlineFallback.appSource } : {}),
|
||||
...(conv.workspaceUri ? { workspaceUri: conv.workspaceUri } : {}),
|
||||
lastModifiedMs: offlineFallback.lastModifiedMs,
|
||||
diskMtimeMs: resolvedDiskMtime,
|
||||
wasRunning: isRunning,
|
||||
@@ -2764,6 +2781,11 @@ export async function enumerateAndSyncConversations({
|
||||
}
|
||||
}
|
||||
}
|
||||
const latestRootCached = getEntry(rootConv.cascadeId);
|
||||
if (rootConv.workspaceUri && latestRootCached && latestRootCached.workspaceUri !== rootConv.workspaceUri) {
|
||||
setEntry(rootConv.cascadeId, { ...latestRootCached, workspaceUri: rootConv.workspaceUri });
|
||||
titleBackfillDirty = true;
|
||||
}
|
||||
if (swarmManifest?.coordinator?.killed || rootConv.killed) {
|
||||
rootConv.status = 'IDLE';
|
||||
rootConv.liveActivity = null;
|
||||
|
||||
@@ -54,6 +54,7 @@ import {
|
||||
buildScopedModelBreakdown,
|
||||
clearUsageAggregatorMemo,
|
||||
getNextMondayResetIso,
|
||||
normalizeWorkspaceBucket,
|
||||
} from './usage-aggregator.mjs';
|
||||
|
||||
const MAX_RECENT_QUICK_STATS = 30;
|
||||
@@ -1661,6 +1662,7 @@ export async function buildTelemetryPayloadInternal(
|
||||
quotaWeekBucket,
|
||||
modelBreakdown,
|
||||
topConversations,
|
||||
topWorkspaces,
|
||||
poolCycleStats,
|
||||
poolsWeeklySummary,
|
||||
} = aggregateMultiWindowUsage({
|
||||
@@ -2107,10 +2109,14 @@ export async function buildTelemetryPayloadInternal(
|
||||
const cSwarmCount = Number(c.swarmCount ?? rawSubs.filter((s) => s.isSwarmWorker).length);
|
||||
const cSideCount = rawSubs.filter((s) => s.isSideQuestion).length;
|
||||
const cNormalSubCount = Math.max(0, rawSubs.length - cSwarmCount - cSideCount);
|
||||
const wsInfo = normalizeWorkspaceBucket(
|
||||
c.workspaceUri || findTrajectoryCacheEntry(c.cascadeId, cacheStore)?.workspaceUri || ''
|
||||
);
|
||||
return {
|
||||
cascadeId: c.cascadeId,
|
||||
title: c.title,
|
||||
...(c.swarmTitle ? { swarmTitle: c.swarmTitle } : {}),
|
||||
...(wsInfo ? { workspaceName: wsInfo.label, workspacePath: wsInfo.workspacePath } : {}),
|
||||
stepCount: c.stepCount,
|
||||
subagentCount: c.subagentCount || 0,
|
||||
swarmCount: cSwarmCount,
|
||||
@@ -2150,6 +2156,7 @@ export async function buildTelemetryPayloadInternal(
|
||||
trendSeries,
|
||||
sourcesBreakdown,
|
||||
topConversations: enrichTopConversationTitles(topConversations, conversations),
|
||||
topWorkspaces: enrichTopWorkspaces(topWorkspaces, conversations),
|
||||
monthlyYear: currentYear,
|
||||
monthlySeries,
|
||||
},
|
||||
@@ -2403,6 +2410,25 @@ function enrichTopConversationTitles(topList, convSummaries) {
|
||||
});
|
||||
}
|
||||
|
||||
function enrichTopWorkspaces(wsList, convSummaries) {
|
||||
if (!Array.isArray(wsList) || wsList.length === 0) return [];
|
||||
const jumpableIds = new Set();
|
||||
if (Array.isArray(convSummaries)) {
|
||||
for (const c of convSummaries) {
|
||||
const cid = String(c?.cascadeId || '').toLowerCase();
|
||||
if (cid) jumpableIds.add(cid);
|
||||
}
|
||||
}
|
||||
return wsList.map((item) => {
|
||||
if (!item || typeof item !== 'object') return item;
|
||||
const latestCid = String(item.latestCascadeId || '').toLowerCase();
|
||||
return {
|
||||
...item,
|
||||
canJump: Boolean(latestCid && (jumpableIds.size === 0 || jumpableIds.has(latestCid))),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function tryBuildFastConsumptionPayload(filterOpts = {}) {
|
||||
const endpoint = filterOpts?.endpoint && filterOpts.endpoint.isRemote ? filterOpts.endpoint : null;
|
||||
const snap = resolveValidFastSnapshot(endpoint);
|
||||
@@ -2434,6 +2460,7 @@ function tryBuildFastConsumptionPayload(filterOpts = {}) {
|
||||
agg.topConversations,
|
||||
snap.sessions?.conversations
|
||||
),
|
||||
topWorkspaces: enrichTopWorkspaces(agg.topWorkspaces, snap.sessions?.conversations),
|
||||
},
|
||||
modelBreakdown: agg.modelBreakdown,
|
||||
};
|
||||
@@ -2455,6 +2482,7 @@ function tryBuildConsumptionPresetsPayload(filterOpts = {}) {
|
||||
entry?.topConversations,
|
||||
snap.sessions?.conversations
|
||||
),
|
||||
topWorkspaces: enrichTopWorkspaces(entry?.topWorkspaces, snap.sessions?.conversations),
|
||||
};
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -536,11 +536,15 @@ function collectUsageEntriesToAggregate(familySet, endpoint = null) {
|
||||
const entryTitle = String(
|
||||
rootLive?.title || entry?.title || extMatch?.title || ''
|
||||
).trim();
|
||||
const entryWorkspaceUri = String(
|
||||
rootLive?.workspaceUri || entry?.workspaceUri || extMatch?.workspaceUri || ''
|
||||
).trim();
|
||||
allEntriesToAggregate.push({
|
||||
cascadeId: groupCascadeId,
|
||||
title: entryTitle,
|
||||
appSource: isRemote ? 'ssh' : entry?.appSource || 'standalone',
|
||||
accountName: entry?.accountName || extMatch?.accountName || '',
|
||||
workspaceUri: entryWorkspaceUri,
|
||||
steps: entry?.steps || [],
|
||||
isCurrentConv: familySet.has(cidLower),
|
||||
});
|
||||
@@ -556,6 +560,7 @@ function collectUsageEntriesToAggregate(familySet, endpoint = null) {
|
||||
title: String(ext.title || liveEntry?.title || '').trim(),
|
||||
appSource: ext.appSource || 'ide',
|
||||
accountName: ext.accountName || liveEntry?.accountName || '',
|
||||
workspaceUri: String(ext.workspaceUri || liveEntry?.workspaceUri || '').trim(),
|
||||
steps: ext.steps || [],
|
||||
isCurrentConv: familySet.has(extCidLower),
|
||||
});
|
||||
@@ -565,6 +570,136 @@ function collectUsageEntriesToAggregate(familySet, endpoint = null) {
|
||||
}
|
||||
|
||||
const MAX_TOP_CONVERSATIONS_LIMIT = 10;
|
||||
const MAX_TOP_WORKSPACES_LIMIT = 12;
|
||||
const UNBOUND_WORKSPACE_KEY = '__unbound__';
|
||||
|
||||
/**
|
||||
* 将 `file://` URI 或本地文件系统路径归一化为稳定的工作区聚合键、项目短名及可读路径。
|
||||
*
|
||||
* @param {string} rawUri
|
||||
* @returns {{ workspaceKey: string, label: string, workspacePath: string }|null}
|
||||
*/
|
||||
export function normalizeWorkspaceBucket(rawUri) {
|
||||
const raw = String(rawUri || '').trim();
|
||||
if (!raw) return null;
|
||||
let decoded = raw;
|
||||
if (/^file:\/\//i.test(decoded)) {
|
||||
decoded = decoded.replace(/^file:\/\//i, '');
|
||||
try {
|
||||
decoded = decodeURIComponent(decoded);
|
||||
} catch {
|
||||
decoded = decoded.replace(/%3A/gi, ':');
|
||||
}
|
||||
// Windows `file:///F:/...` 解码后形如 `/F:/...`,剥离盘符前多余斜杠;POSIX `/Users/...` 保留前导 `/`
|
||||
if (/^\/[A-Za-z]:/.test(decoded)) {
|
||||
decoded = decoded.slice(1);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
decoded = decodeURIComponent(decoded);
|
||||
} catch {
|
||||
// 保留原始文本
|
||||
}
|
||||
}
|
||||
decoded = decoded.replace(/\\/g, '/').replace(/\/+$/, '');
|
||||
if (!decoded) return null;
|
||||
const parts = decoded.split('/').filter(Boolean);
|
||||
const label = parts.length > 0 ? parts[parts.length - 1] : decoded;
|
||||
return {
|
||||
workspaceKey: decoded.toLowerCase(),
|
||||
label,
|
||||
workspacePath: decoded,
|
||||
};
|
||||
}
|
||||
|
||||
function accumulateStepIntoWorkspaceMap(
|
||||
perWorkspaceMap,
|
||||
entry,
|
||||
stepUsage,
|
||||
tMs,
|
||||
st = null,
|
||||
mInfo = null,
|
||||
stepCost = null
|
||||
) {
|
||||
const norm = normalizeWorkspaceBucket(entry?.workspaceUri);
|
||||
const key = norm ? norm.workspaceKey : UNBOUND_WORKSPACE_KEY;
|
||||
let acc = perWorkspaceMap.get(key);
|
||||
if (!acc) {
|
||||
acc = {
|
||||
workspaceKey: key,
|
||||
label: norm ? norm.label : '',
|
||||
workspacePath: norm ? norm.workspacePath : '',
|
||||
isUnbound: !norm,
|
||||
sessionIds: new Set(),
|
||||
calls: 0,
|
||||
inputTokens: 0,
|
||||
cacheReadTokens: 0,
|
||||
responseTokens: 0,
|
||||
thinkingTokens: 0,
|
||||
totalTokens: 0,
|
||||
costUsd: 0,
|
||||
unpricedCalls: 0,
|
||||
lastTimestampMs: 0,
|
||||
latestCascadeId: '',
|
||||
perModelStats: new Map(),
|
||||
};
|
||||
perWorkspaceMap.set(key, acc);
|
||||
}
|
||||
const cid = String(entry?.cascadeId || '').trim();
|
||||
if (cid) acc.sessionIds.add(cid);
|
||||
acc.calls += 1;
|
||||
acc.inputTokens += stepUsage.inTok;
|
||||
acc.cacheReadTokens += stepUsage.cacheTok;
|
||||
acc.responseTokens += stepUsage.respTok;
|
||||
acc.thinkingTokens += stepUsage.thinkTok;
|
||||
acc.totalTokens += stepUsage.stepTotalTokens;
|
||||
acc.costUsd += stepUsage.resolvedCost;
|
||||
acc.unpricedCalls += stepUsage.unpriced;
|
||||
if (tMs >= acc.lastTimestampMs) {
|
||||
acc.lastTimestampMs = tMs;
|
||||
if (cid) acc.latestCascadeId = cid;
|
||||
}
|
||||
if (st && mInfo) {
|
||||
accumulateStepIntoModelMap(acc.perModelStats, st, mInfo, stepCost);
|
||||
}
|
||||
}
|
||||
|
||||
function finalizeTopWorkspacesMap(perWorkspaceMap, maxItems = MAX_TOP_WORKSPACES_LIMIT) {
|
||||
let hasRealWorkspace = false;
|
||||
for (const w of perWorkspaceMap.values()) {
|
||||
if (!w.isUnbound && (w.totalTokens > 0 || w.calls > 0)) {
|
||||
hasRealWorkspace = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasRealWorkspace) return [];
|
||||
return Array.from(perWorkspaceMap.values())
|
||||
.filter((w) => w.totalTokens > 0 || w.calls > 0)
|
||||
.sort((a, b) => b.costUsd - a.costUsd || b.totalTokens - a.totalTokens || b.calls - a.calls)
|
||||
.slice(0, maxItems)
|
||||
.map((w) => {
|
||||
const promptTokens = w.inputTokens + w.cacheReadTokens;
|
||||
return {
|
||||
workspaceKey: w.workspaceKey,
|
||||
label: w.label,
|
||||
workspacePath: w.workspacePath,
|
||||
isUnbound: w.isUnbound,
|
||||
sessionCount: w.sessionIds.size,
|
||||
calls: w.calls,
|
||||
inputTokens: w.inputTokens,
|
||||
cacheReadTokens: w.cacheReadTokens,
|
||||
responseTokens: w.responseTokens,
|
||||
thinkingTokens: w.thinkingTokens,
|
||||
totalTokens: w.totalTokens,
|
||||
costUsd: +w.costUsd.toFixed(6),
|
||||
unpricedCalls: w.unpricedCalls,
|
||||
cacheHitPct: promptTokens > 0 ? +((w.cacheReadTokens / promptTokens) * 100).toFixed(1) : 0,
|
||||
lastTimestampMs: w.lastTimestampMs,
|
||||
latestCascadeId: w.latestCascadeId,
|
||||
models: finalizeModelBreakdownMap(w.perModelStats),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function accumulateStepIntoConversationMap(
|
||||
perConvMap,
|
||||
@@ -975,7 +1110,8 @@ function sameUsageEntries(previous, current) {
|
||||
return previous.length === current.length && current.every((entry, index) => {
|
||||
const before = previous[index];
|
||||
return entry.steps === before.steps && entry.cascadeId === before.cascadeId &&
|
||||
entry.appSource === before.appSource && entry.accountName === before.accountName;
|
||||
entry.appSource === before.appSource && entry.accountName === before.accountName &&
|
||||
entry.workspaceUri === before.workspaceUri;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1254,6 +1390,7 @@ export function aggregateMultiWindowUsage({
|
||||
const selectedSessionBucket = sessionBuckets[selectedWindow.key] || createUsageBucket();
|
||||
const perModelStats = new Map();
|
||||
const perConvStats = new Map();
|
||||
const perWorkspaceStats = new Map();
|
||||
const selectedWindowSteps = [];
|
||||
let earliestSelectedStepMs = Infinity;
|
||||
let latestSelectedStepMs = 0;
|
||||
@@ -1550,6 +1687,15 @@ export function aggregateMultiWindowUsage({
|
||||
mInfo,
|
||||
stepCost
|
||||
);
|
||||
accumulateStepIntoWorkspaceMap(
|
||||
perWorkspaceStats,
|
||||
entry,
|
||||
stepUsage,
|
||||
tMs,
|
||||
st,
|
||||
mInfo,
|
||||
stepCost
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1607,6 +1753,7 @@ export function aggregateMultiWindowUsage({
|
||||
const finalizedQuotaWeekBucket = finalizeUsageBucket(quotaWeekBucket);
|
||||
const modelBreakdown = finalizeModelBreakdownMap(perModelStats);
|
||||
const topConversations = finalizeTopConversationsMap(perConvStats);
|
||||
const topWorkspaces = finalizeTopWorkspacesMap(perWorkspaceStats);
|
||||
|
||||
const formatCycleSummary = (b) => {
|
||||
const fin = finalizeUsageBucket(b);
|
||||
@@ -1693,6 +1840,7 @@ export function aggregateMultiWindowUsage({
|
||||
quotaWeekBucket: finalizedQuotaWeekBucket,
|
||||
modelBreakdown,
|
||||
topConversations,
|
||||
topWorkspaces,
|
||||
poolCycleStats,
|
||||
poolsWeeklySummary,
|
||||
};
|
||||
@@ -1835,6 +1983,7 @@ export function aggregateSelectedWindowUsage({
|
||||
sourcesBreakdown: res.sourcesBreakdown,
|
||||
modelBreakdown: res.modelBreakdown,
|
||||
topConversations: res.topConversations || [],
|
||||
topWorkspaces: res.topWorkspaces || [],
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1876,6 +2025,7 @@ export function aggregateSelectedWindowUsage({
|
||||
const perModelStats = new Map();
|
||||
const perSourceStats = new Map();
|
||||
const perConvStats = new Map();
|
||||
const perWorkspaceStats = new Map();
|
||||
const selectedWindowSteps = [];
|
||||
let earliestSelectedStepMs = Infinity;
|
||||
let latestSelectedStepMs = 0;
|
||||
@@ -2044,6 +2194,15 @@ export function aggregateSelectedWindowUsage({
|
||||
mInfo,
|
||||
stepCost
|
||||
);
|
||||
accumulateStepIntoWorkspaceMap(
|
||||
perWorkspaceStats,
|
||||
entry,
|
||||
stepUsage,
|
||||
tMs,
|
||||
st,
|
||||
mInfo,
|
||||
stepCost
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2078,6 +2237,7 @@ export function aggregateSelectedWindowUsage({
|
||||
.sort((a, b) => b.totalTokens - a.totalTokens || b.calls - a.calls);
|
||||
const modelBreakdown = finalizeModelBreakdownMap(perModelStats);
|
||||
const topConversations = finalizeTopConversationsMap(perConvStats);
|
||||
const topWorkspaces = finalizeTopWorkspacesMap(perWorkspaceStats);
|
||||
|
||||
const sliceResult = {
|
||||
usageRevision: sameSnapshot ? snapshot.revision : usageSnapshotRevisionSeq,
|
||||
@@ -2090,6 +2250,7 @@ export function aggregateSelectedWindowUsage({
|
||||
sourcesBreakdown,
|
||||
modelBreakdown,
|
||||
topConversations,
|
||||
topWorkspaces,
|
||||
};
|
||||
|
||||
if (sameSnapshot) {
|
||||
@@ -2218,6 +2379,7 @@ export function aggregateConsumptionPresetBundle(params) {
|
||||
sourcesBreakdown: agg.sourcesBreakdown,
|
||||
modelBreakdown: agg.modelBreakdown,
|
||||
topConversations: agg.topConversations || [],
|
||||
topWorkspaces: agg.topWorkspaces || [],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user