feat(server,web): page the cost center's error table, abbreviate the source, drop command-tool noise (#103)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -63,6 +63,7 @@ import type {
|
||||
UiPrefs,
|
||||
UpdateCheckResponse,
|
||||
UpdateRunResponse,
|
||||
UsageErrorsPage,
|
||||
UsageGroupBy,
|
||||
UsageResponse,
|
||||
VaultResponse,
|
||||
@@ -360,6 +361,26 @@ export const importAgentTrace = (projectId: string, agentId: string, body: Trace
|
||||
|
||||
// Usage statistics ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* One page of the cost center's error table (newest first). The dashboard response already
|
||||
* carries the first page; this is for paging back to earlier ones without refetching the
|
||||
* whole aggregate. Takes the dashboard's date/agent filter only — the model filter never
|
||||
* applied to errors.
|
||||
*/
|
||||
export const getUsageErrors = (
|
||||
projectId: string,
|
||||
params: { offset: number; limit: number; from?: string; to?: string; agentId?: string },
|
||||
) =>
|
||||
apiFetch<UsageErrorsPage>(`/api/projects/${encodeURIComponent(projectId)}/usage/errors`, {
|
||||
query: {
|
||||
offset: String(params.offset),
|
||||
limit: String(params.limit),
|
||||
from: params.from,
|
||||
to: params.to,
|
||||
agentId: params.agentId,
|
||||
},
|
||||
});
|
||||
|
||||
export const getUsage = (
|
||||
projectId: string,
|
||||
params: {
|
||||
|
||||
Reference in New Issue
Block a user