@copilotz/admin 0.9.33 → 0.9.34
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/dist/index.cjs +2933 -2855
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +280 -173
- package/dist/index.d.ts +280 -173
- package/dist/index.js +2905 -2854
- package/dist/index.js.map +1 -1
- package/dist/styles.css +222 -0
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, ComponentType } from 'react';
|
|
2
3
|
|
|
3
4
|
type RequestHeadersProvider = () => Record<string, string> | Promise<Record<string, string>>;
|
|
4
5
|
type AdminDatePreset = "24h" | "7d" | "30d";
|
|
@@ -7,12 +8,7 @@ type AdminUsageInterval = "minute" | "hour" | "day" | "week" | "month";
|
|
|
7
8
|
type AdminUsageMetricKind = "tokens" | "cost" | "calls";
|
|
8
9
|
type AdminUsageGroupBy = "thread" | "participant" | "namespace" | "provider" | "model";
|
|
9
10
|
type AdminUsageAttribution = "generatedBy" | "initiatedBy";
|
|
10
|
-
type
|
|
11
|
-
interface AdminRoute {
|
|
12
|
-
page: AdminPage;
|
|
13
|
-
resourceId?: string;
|
|
14
|
-
collection?: string;
|
|
15
|
-
}
|
|
11
|
+
type AdminUsageDimension = "total" | "input" | "output" | "reasoning" | "cacheRead" | "cacheWrite";
|
|
16
12
|
interface AdminUsageBreakdown {
|
|
17
13
|
inputTokens: number;
|
|
18
14
|
outputTokens: number;
|
|
@@ -85,6 +81,18 @@ interface AdminParticipantSummary {
|
|
|
85
81
|
threadCount: number;
|
|
86
82
|
lastActivityAt: string | null;
|
|
87
83
|
}
|
|
84
|
+
interface AdminAgentSummary extends AdminUsageTotals {
|
|
85
|
+
agentId: string;
|
|
86
|
+
displayName: string;
|
|
87
|
+
description: string | null;
|
|
88
|
+
isConfigured: boolean;
|
|
89
|
+
namespace: string;
|
|
90
|
+
isGlobal: boolean;
|
|
91
|
+
messageCount: number;
|
|
92
|
+
llmCallCount: number;
|
|
93
|
+
toolCallMessageCount: number;
|
|
94
|
+
lastActivityAt: string | null;
|
|
95
|
+
}
|
|
88
96
|
interface AdminUsagePoint extends AdminUsageTotals {
|
|
89
97
|
bucket: string;
|
|
90
98
|
groupKey: string;
|
|
@@ -109,30 +117,6 @@ interface AdminUsageFilters {
|
|
|
109
117
|
provider?: string;
|
|
110
118
|
model?: string;
|
|
111
119
|
}
|
|
112
|
-
interface AdminAgentSummary {
|
|
113
|
-
agentId: string;
|
|
114
|
-
displayName: string;
|
|
115
|
-
description: string | null;
|
|
116
|
-
isConfigured: boolean;
|
|
117
|
-
namespace: string;
|
|
118
|
-
isGlobal: boolean;
|
|
119
|
-
messageCount: number;
|
|
120
|
-
llmCallCount: number;
|
|
121
|
-
toolCallMessageCount: number;
|
|
122
|
-
inputTokens: AdminUsageBreakdown["inputTokens"];
|
|
123
|
-
outputTokens: AdminUsageBreakdown["outputTokens"];
|
|
124
|
-
reasoningTokens: AdminUsageBreakdown["reasoningTokens"];
|
|
125
|
-
cacheReadInputTokens: AdminUsageBreakdown["cacheReadInputTokens"];
|
|
126
|
-
cacheCreationInputTokens: AdminUsageBreakdown["cacheCreationInputTokens"];
|
|
127
|
-
totalTokens: AdminUsageBreakdown["totalTokens"];
|
|
128
|
-
inputCostUsd: AdminUsageBreakdown["inputCostUsd"];
|
|
129
|
-
outputCostUsd: AdminUsageBreakdown["outputCostUsd"];
|
|
130
|
-
reasoningCostUsd: AdminUsageBreakdown["reasoningCostUsd"];
|
|
131
|
-
cacheReadInputCostUsd: AdminUsageBreakdown["cacheReadInputCostUsd"];
|
|
132
|
-
cacheCreationInputCostUsd: AdminUsageBreakdown["cacheCreationInputCostUsd"];
|
|
133
|
-
totalCostUsd: AdminUsageBreakdown["totalCostUsd"];
|
|
134
|
-
lastActivityAt: string | null;
|
|
135
|
-
}
|
|
136
120
|
interface AdminThreadDetail {
|
|
137
121
|
id: string;
|
|
138
122
|
name: string;
|
|
@@ -173,7 +157,17 @@ interface AdminMessagePage {
|
|
|
173
157
|
type AdminParticipantDetail = Record<string, unknown>;
|
|
174
158
|
type AdminCollectionItem = Record<string, unknown> & {
|
|
175
159
|
id?: string;
|
|
160
|
+
_id?: string;
|
|
176
161
|
};
|
|
162
|
+
interface AdminCollectionPage {
|
|
163
|
+
data: AdminCollectionItem[];
|
|
164
|
+
pageInfo?: {
|
|
165
|
+
hasNextPage?: boolean;
|
|
166
|
+
hasPreviousPage?: boolean;
|
|
167
|
+
startCursor?: string | null;
|
|
168
|
+
endCursor?: string | null;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
177
171
|
interface AdminQueueEvent {
|
|
178
172
|
id: string;
|
|
179
173
|
threadId: string;
|
|
@@ -188,164 +182,277 @@ interface AdminQueueEvent {
|
|
|
188
182
|
createdAt: string | null;
|
|
189
183
|
updatedAt: string | null;
|
|
190
184
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
participantSearch?: string;
|
|
197
|
-
agentSearch?: string;
|
|
185
|
+
|
|
186
|
+
interface AdminClientPaths {
|
|
187
|
+
adminBase: string;
|
|
188
|
+
collectionsBase: string;
|
|
189
|
+
threadsBase: string;
|
|
198
190
|
}
|
|
199
|
-
interface
|
|
200
|
-
branding?: {
|
|
201
|
-
title?: string;
|
|
202
|
-
subtitle?: string;
|
|
203
|
-
logo?: ReactNode;
|
|
204
|
-
actions?: ReactNode;
|
|
205
|
-
};
|
|
206
|
-
labels?: {
|
|
207
|
-
overviewTitle?: string;
|
|
208
|
-
activityTitle?: string;
|
|
209
|
-
threadsTitle?: string;
|
|
210
|
-
participantsTitle?: string;
|
|
211
|
-
agentsTitle?: string;
|
|
212
|
-
range24h?: string;
|
|
213
|
-
range7d?: string;
|
|
214
|
-
range30d?: string;
|
|
215
|
-
intervalHour?: string;
|
|
216
|
-
intervalDay?: string;
|
|
217
|
-
refresh?: string;
|
|
218
|
-
retry?: string;
|
|
219
|
-
loading?: string;
|
|
220
|
-
emptyTitle?: string;
|
|
221
|
-
emptyDescription?: string;
|
|
222
|
-
threadSearchPlaceholder?: string;
|
|
223
|
-
participantSearchPlaceholder?: string;
|
|
224
|
-
agentSearchPlaceholder?: string;
|
|
225
|
-
messagesCard?: string;
|
|
226
|
-
activeThreadsCard?: string;
|
|
227
|
-
participantsCard?: string;
|
|
228
|
-
tokensCard?: string;
|
|
229
|
-
costCard?: string;
|
|
230
|
-
queueCard?: string;
|
|
231
|
-
llmUsageTitle?: string;
|
|
232
|
-
usageMetricLabel?: string;
|
|
233
|
-
usageDimensionLabel?: string;
|
|
234
|
-
usageMetricTokens?: string;
|
|
235
|
-
usageMetricCost?: string;
|
|
236
|
-
usageTotal?: string;
|
|
237
|
-
usageInput?: string;
|
|
238
|
-
usageOutput?: string;
|
|
239
|
-
usageReasoning?: string;
|
|
240
|
-
usageCacheRead?: string;
|
|
241
|
-
usageCacheWrite?: string;
|
|
242
|
-
usageCallsDetail?: string;
|
|
243
|
-
usageUnavailableDetail?: string;
|
|
244
|
-
statusActive?: string;
|
|
245
|
-
statusArchived?: string;
|
|
246
|
-
scopeGlobal?: string;
|
|
247
|
-
scopeScoped?: string;
|
|
248
|
-
configured?: string;
|
|
249
|
-
unconfigured?: string;
|
|
250
|
-
noResults?: string;
|
|
251
|
-
eventsTitle?: string;
|
|
252
|
-
dashboardTitle?: string;
|
|
253
|
-
collectionsTitle?: string;
|
|
254
|
-
collectionsEndpoint?: string;
|
|
255
|
-
};
|
|
256
|
-
features?: {
|
|
257
|
-
showOverview?: boolean;
|
|
258
|
-
showActivity?: boolean;
|
|
259
|
-
showThreads?: boolean;
|
|
260
|
-
showParticipants?: boolean;
|
|
261
|
-
showAgents?: boolean;
|
|
262
|
-
showEvents?: boolean;
|
|
263
|
-
showCollections?: boolean;
|
|
264
|
-
};
|
|
265
|
-
ui?: {
|
|
266
|
-
compact?: boolean;
|
|
267
|
-
maxActivityBars?: number;
|
|
268
|
-
};
|
|
269
|
-
sidebar?: {
|
|
270
|
-
defaultOpen?: boolean;
|
|
271
|
-
collapsible?: "icon" | "offcanvas" | "none";
|
|
272
|
-
};
|
|
191
|
+
interface AdminClientOptions {
|
|
273
192
|
baseUrl?: string;
|
|
193
|
+
paths?: Partial<AdminClientPaths>;
|
|
274
194
|
getRequestHeaders?: RequestHeadersProvider;
|
|
195
|
+
}
|
|
196
|
+
interface AdminListOptions {
|
|
275
197
|
namespace?: string;
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
features: Required<NonNullable<AdminConfig["features"]>>;
|
|
285
|
-
ui: Required<NonNullable<AdminConfig["ui"]>>;
|
|
286
|
-
sidebar: Required<NonNullable<AdminConfig["sidebar"]>>;
|
|
287
|
-
baseUrl: string;
|
|
288
|
-
getRequestHeaders: RequestHeadersProvider;
|
|
289
|
-
namespace: string;
|
|
290
|
-
initialRange: AdminDatePreset;
|
|
291
|
-
initialInterval: AdminActivityInterval;
|
|
292
|
-
defaultPage: AdminPage;
|
|
293
|
-
onNavigate: ((route: AdminRoute) => void) | null;
|
|
198
|
+
search?: string;
|
|
199
|
+
limit?: number;
|
|
200
|
+
offset?: number;
|
|
201
|
+
before?: string;
|
|
202
|
+
after?: string;
|
|
203
|
+
filter?: Record<string, unknown>;
|
|
204
|
+
sort?: Record<string, "asc" | "desc">;
|
|
205
|
+
populate?: string[];
|
|
294
206
|
}
|
|
295
|
-
interface
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
207
|
+
interface CopilotzAdminClient {
|
|
208
|
+
paths: AdminClientPaths;
|
|
209
|
+
getOverview(options?: {
|
|
210
|
+
range?: AdminDatePreset;
|
|
211
|
+
namespace?: string;
|
|
212
|
+
}): Promise<AdminOverview>;
|
|
213
|
+
getActivity(options?: {
|
|
214
|
+
range?: AdminDatePreset;
|
|
215
|
+
interval?: AdminActivityInterval;
|
|
216
|
+
namespace?: string;
|
|
217
|
+
}): Promise<AdminActivityPoint[]>;
|
|
218
|
+
getUsage(filters?: AdminUsageFilters): Promise<AdminUsageResponse>;
|
|
219
|
+
listThreads(options?: AdminListOptions): Promise<AdminThreadSummary[]>;
|
|
220
|
+
listParticipants(options?: AdminListOptions): Promise<AdminParticipantSummary[]>;
|
|
221
|
+
listAgents(options?: AdminListOptions & {
|
|
222
|
+
range?: AdminDatePreset;
|
|
223
|
+
}): Promise<AdminAgentSummary[]>;
|
|
224
|
+
getThread(threadId: string): Promise<AdminThreadDetail>;
|
|
225
|
+
getThreadMessages(threadId: string, options?: {
|
|
226
|
+
limit?: number;
|
|
227
|
+
before?: string;
|
|
228
|
+
}): Promise<AdminMessagePage>;
|
|
229
|
+
getThreadEvent(threadId: string): Promise<AdminQueueEvent | undefined>;
|
|
230
|
+
listCollections(): Promise<string[]>;
|
|
231
|
+
listCollectionItems(collection: string, options?: AdminListOptions): Promise<AdminCollectionItem[]>;
|
|
232
|
+
getCollectionItem(collection: string, itemId: string, options?: {
|
|
233
|
+
namespace?: string;
|
|
234
|
+
populate?: string[];
|
|
235
|
+
}): Promise<AdminCollectionItem>;
|
|
236
|
+
createCollectionItem(collection: string, data: Record<string, unknown>, options?: {
|
|
237
|
+
namespace?: string;
|
|
238
|
+
}): Promise<AdminCollectionItem>;
|
|
239
|
+
updateCollectionItem(collection: string, itemId: string, data: Record<string, unknown>, options?: {
|
|
240
|
+
namespace?: string;
|
|
241
|
+
}): Promise<AdminCollectionItem>;
|
|
242
|
+
deleteCollectionItem(collection: string, itemId: string, options?: {
|
|
243
|
+
namespace?: string;
|
|
244
|
+
}): Promise<void>;
|
|
245
|
+
}
|
|
246
|
+
declare function createAdminClient(options?: AdminClientOptions): CopilotzAdminClient;
|
|
247
|
+
|
|
248
|
+
type AdminModuleGroup = "operate" | "configure" | "data" | "extensions";
|
|
249
|
+
interface AdminScope {
|
|
250
|
+
namespace?: string;
|
|
251
|
+
schema?: string;
|
|
252
|
+
availableNamespaces?: Array<{
|
|
253
|
+
id: string;
|
|
254
|
+
label?: string;
|
|
255
|
+
}>;
|
|
256
|
+
}
|
|
257
|
+
interface AdminBranding {
|
|
258
|
+
title?: string;
|
|
259
|
+
subtitle?: string;
|
|
260
|
+
logo?: ReactNode;
|
|
261
|
+
actions?: ReactNode;
|
|
262
|
+
}
|
|
263
|
+
interface AdminPermissions {
|
|
264
|
+
roles?: string[];
|
|
265
|
+
canAccess?: (permission: string, action?: string) => boolean;
|
|
266
|
+
}
|
|
267
|
+
interface AdminRouteState {
|
|
268
|
+
routeId: string;
|
|
269
|
+
params?: Record<string, string | undefined>;
|
|
270
|
+
}
|
|
271
|
+
interface AdminRouteDefinition {
|
|
272
|
+
id: string;
|
|
273
|
+
title: string;
|
|
274
|
+
permission?: string;
|
|
275
|
+
render: (context: AdminRuntimeContext) => ReactNode;
|
|
276
|
+
}
|
|
277
|
+
interface AdminNavItem {
|
|
278
|
+
id: string;
|
|
279
|
+
label: string;
|
|
280
|
+
routeId: string;
|
|
281
|
+
group?: AdminModuleGroup;
|
|
282
|
+
icon?: ComponentType<{
|
|
283
|
+
className?: string;
|
|
284
|
+
}>;
|
|
285
|
+
description?: string;
|
|
286
|
+
order?: number;
|
|
287
|
+
permission?: string;
|
|
288
|
+
}
|
|
289
|
+
interface CollectionEditorProps {
|
|
290
|
+
collection: string;
|
|
291
|
+
itemId: string | null;
|
|
292
|
+
value: AdminCollectionItem | null;
|
|
293
|
+
isNew: boolean;
|
|
294
|
+
context: AdminRuntimeContext;
|
|
295
|
+
onSaved?: (item: AdminCollectionItem) => void;
|
|
296
|
+
onDeleted?: () => void;
|
|
297
|
+
}
|
|
298
|
+
type CollectionEditor = ComponentType<CollectionEditorProps>;
|
|
299
|
+
interface AdminDetailPanel {
|
|
300
|
+
id: string;
|
|
301
|
+
label: string;
|
|
302
|
+
routeIds?: string[];
|
|
303
|
+
render: (context: AdminRuntimeContext) => ReactNode;
|
|
301
304
|
}
|
|
302
|
-
interface
|
|
305
|
+
interface AdminModule {
|
|
306
|
+
id: string;
|
|
307
|
+
label: string;
|
|
308
|
+
group?: AdminModuleGroup;
|
|
309
|
+
icon?: ComponentType<{
|
|
310
|
+
className?: string;
|
|
311
|
+
}>;
|
|
312
|
+
routes: AdminRouteDefinition[];
|
|
313
|
+
navItems?: AdminNavItem[];
|
|
314
|
+
collectionEditors?: Record<string, CollectionEditor>;
|
|
315
|
+
detailPanels?: AdminDetailPanel[];
|
|
316
|
+
}
|
|
317
|
+
interface AdminRuntimeContext {
|
|
318
|
+
client: CopilotzAdminClient;
|
|
319
|
+
modules: AdminModule[];
|
|
320
|
+
route: AdminRouteState;
|
|
321
|
+
scope: AdminScope;
|
|
322
|
+
branding: Required<AdminBranding>;
|
|
323
|
+
permissions: AdminPermissions;
|
|
324
|
+
refreshKey: number;
|
|
325
|
+
collectionEditors: Record<string, CollectionEditor>;
|
|
326
|
+
navigate: (routeId: string, params?: Record<string, string | undefined>) => void;
|
|
327
|
+
setNamespace: (namespace: string) => void;
|
|
328
|
+
requestRefresh: () => void;
|
|
329
|
+
canAccess: (permission?: string, action?: string) => boolean;
|
|
330
|
+
}
|
|
331
|
+
interface AdminClientConfig {
|
|
303
332
|
baseUrl?: string;
|
|
333
|
+
paths?: Partial<AdminClientPaths>;
|
|
304
334
|
getRequestHeaders?: RequestHeadersProvider;
|
|
305
335
|
}
|
|
306
|
-
interface
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
setInterval: (interval: AdminActivityInterval) => void;
|
|
336
|
+
interface LegacyAdminConfig {
|
|
337
|
+
baseUrl?: string;
|
|
338
|
+
getRequestHeaders?: RequestHeadersProvider;
|
|
339
|
+
namespace?: string;
|
|
340
|
+
branding?: AdminBranding;
|
|
341
|
+
defaultPage?: string;
|
|
313
342
|
}
|
|
314
|
-
|
|
315
343
|
interface CopilotzAdminProps {
|
|
316
|
-
|
|
344
|
+
client?: CopilotzAdminClient;
|
|
345
|
+
clientConfig?: AdminClientConfig;
|
|
346
|
+
config?: LegacyAdminConfig;
|
|
347
|
+
scope?: AdminScope;
|
|
348
|
+
modules?: AdminModule[];
|
|
349
|
+
branding?: AdminBranding;
|
|
350
|
+
permissions?: AdminPermissions;
|
|
317
351
|
className?: string;
|
|
352
|
+
onNavigate?: (route: AdminRouteState) => void;
|
|
318
353
|
}
|
|
319
|
-
declare const CopilotzAdmin: React.FC<CopilotzAdminProps>;
|
|
320
354
|
|
|
321
|
-
declare function
|
|
355
|
+
declare function CopilotzAdmin({ branding: brandingProp, className, client, clientConfig, config, modules: modulesProp, onNavigate, permissions, scope: scopeProp, }: CopilotzAdminProps): react_jsx_runtime.JSX.Element;
|
|
356
|
+
|
|
357
|
+
declare function useAdmin(): AdminRuntimeContext;
|
|
358
|
+
|
|
359
|
+
declare const ADMIN_GROUP_LABELS: Record<AdminModuleGroup, string>;
|
|
360
|
+
declare const ADMIN_GROUP_ORDER: AdminModuleGroup[];
|
|
361
|
+
declare function canAccessAdminPermission(permissions: AdminPermissions | undefined, permission?: string, action?: string): boolean;
|
|
362
|
+
declare function collectAdminRoutes(modules: AdminModule[], permissions?: AdminPermissions): Map<string, AdminRouteDefinition>;
|
|
363
|
+
declare function collectAdminNavItems(modules: AdminModule[], permissions?: AdminPermissions): AdminNavItem[];
|
|
364
|
+
declare function collectCollectionEditors(modules: AdminModule[]): Record<string, CollectionEditor>;
|
|
365
|
+
declare function firstAccessibleRoute(modules: AdminModule[], permissions?: AdminPermissions): string;
|
|
322
366
|
|
|
323
|
-
|
|
367
|
+
declare function agentsModule(): AdminModule;
|
|
368
|
+
|
|
369
|
+
declare function collectionsModule(): AdminModule;
|
|
370
|
+
|
|
371
|
+
declare function eventsModule(): AdminModule;
|
|
372
|
+
|
|
373
|
+
declare function overviewModule(): AdminModule;
|
|
374
|
+
|
|
375
|
+
declare function participantsModule(): AdminModule;
|
|
376
|
+
|
|
377
|
+
declare function threadsModule(): AdminModule;
|
|
378
|
+
|
|
379
|
+
declare function usageModule(): AdminModule;
|
|
380
|
+
|
|
381
|
+
interface UsageChartSeries {
|
|
382
|
+
color: string;
|
|
383
|
+
id: string;
|
|
384
|
+
key: string;
|
|
385
|
+
label: string;
|
|
386
|
+
}
|
|
387
|
+
interface UsageChartState {
|
|
388
|
+
config: Record<string, {
|
|
389
|
+
color: string;
|
|
390
|
+
label: string;
|
|
391
|
+
}>;
|
|
392
|
+
data: Array<Record<string, number | string>>;
|
|
393
|
+
series: UsageChartSeries[];
|
|
394
|
+
}
|
|
395
|
+
interface AggregatedUsageRow extends AdminUsageTotals {
|
|
396
|
+
groupKey: string;
|
|
397
|
+
groupLabel: string;
|
|
398
|
+
value: number;
|
|
399
|
+
}
|
|
400
|
+
interface UsageCalculationOptions {
|
|
401
|
+
dimension: AdminUsageDimension;
|
|
402
|
+
interval: AdminUsageInterval;
|
|
403
|
+
metricKind: AdminUsageMetricKind;
|
|
404
|
+
points: AdminUsagePoint[];
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
declare const EMPTY_USAGE_TOTALS: AdminUsageTotals;
|
|
408
|
+
declare function addUsageTotals(target: AdminUsageTotals, source: AdminUsageTotals): void;
|
|
409
|
+
declare function getUsageTotalValue(totals: AdminUsageTotals, metricKind: AdminUsageMetricKind, dimension: AdminUsageDimension): number;
|
|
410
|
+
declare function aggregateUsageRows(points: AdminUsagePoint[], metricKind: AdminUsageMetricKind, dimension: AdminUsageDimension): AggregatedUsageRow[];
|
|
411
|
+
declare function buildUsageChartState(points: AdminUsagePoint[], metricKind: AdminUsageMetricKind, dimension: AdminUsageDimension, interval: AdminUsageInterval): UsageChartState;
|
|
412
|
+
declare function getUsageRange(period: "24h" | "7d" | "30d" | "custom", customFrom: string, customTo: string): {
|
|
413
|
+
from: string | undefined;
|
|
414
|
+
to: string | undefined;
|
|
415
|
+
};
|
|
416
|
+
declare function getUsageDimensionLabel(dimension: AdminUsageDimension): "Input" | "Output" | "Reasoning" | "Cache read" | "Cache write" | "Total";
|
|
417
|
+
declare function getUsageGroupLabel(groupBy: string): "Thread" | "Namespace" | "Provider" | "Model" | "Participant";
|
|
418
|
+
declare function formatUsageBucket(bucket: string, interval: AdminUsageInterval): string;
|
|
419
|
+
declare function formatNumber(value: number): string;
|
|
420
|
+
declare function formatPercent(value: number): string;
|
|
421
|
+
declare function formatMetricValue(value: number, metricKind: AdminUsageMetricKind): string;
|
|
422
|
+
declare function formatCompactMetric(value: number, metricKind: AdminUsageMetricKind): string;
|
|
423
|
+
|
|
424
|
+
declare function defaultCopilotzModules(): AdminModule[];
|
|
425
|
+
|
|
426
|
+
declare const defaultAdminConfig: LegacyAdminConfig;
|
|
427
|
+
declare function mergeAdminConfig(baseConfig?: LegacyAdminConfig, userConfig?: LegacyAdminConfig): LegacyAdminConfig;
|
|
428
|
+
|
|
429
|
+
interface UseCopilotzAdminOptions {
|
|
430
|
+
agentSearch?: string;
|
|
324
431
|
baseUrl?: string;
|
|
325
432
|
getRequestHeaders?: RequestHeadersProvider;
|
|
326
|
-
|
|
327
|
-
declare function fetchAdminOverview(range: AdminDatePreset, namespace?: string, options?: FetchOptions): Promise<AdminOverview>;
|
|
328
|
-
declare function fetchAdminActivity(range: AdminDatePreset, interval: AdminActivityInterval, namespace?: string, options?: FetchOptions): Promise<AdminActivityPoint[]>;
|
|
329
|
-
declare function fetchAdminThreads(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminThreadSummary[]>;
|
|
330
|
-
declare function fetchAdminParticipants(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminParticipantSummary[]>;
|
|
331
|
-
declare function fetchAdminAgents(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminAgentSummary[]>;
|
|
332
|
-
declare function fetchAdminUsage(filters: AdminUsageFilters, options?: FetchOptions): Promise<AdminUsageResponse>;
|
|
333
|
-
declare function fetchParticipantDetail(participantId: string, options?: FetchOptions): Promise<AdminParticipantDetail | null>;
|
|
334
|
-
declare function updateParticipant(participantId: string, data: Record<string, unknown>, options?: FetchOptions): Promise<AdminParticipantDetail>;
|
|
335
|
-
declare function fetchCollectionNames(options?: FetchOptions): Promise<string[]>;
|
|
336
|
-
declare function fetchCollectionItems(collection: string, queryOptions?: {
|
|
337
|
-
search?: string;
|
|
433
|
+
interval?: AdminActivityInterval;
|
|
338
434
|
namespace?: string;
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
435
|
+
participantSearch?: string;
|
|
436
|
+
range?: AdminDatePreset;
|
|
437
|
+
threadSearch?: string;
|
|
438
|
+
}
|
|
439
|
+
interface UseCopilotzAdminResult {
|
|
440
|
+
activity: AdminActivityPoint[];
|
|
441
|
+
agents: AdminAgentSummary[];
|
|
442
|
+
error: Error | null;
|
|
443
|
+
filters: UseCopilotzAdminOptions & {
|
|
444
|
+
interval: AdminActivityInterval;
|
|
445
|
+
range: AdminDatePreset;
|
|
446
|
+
};
|
|
447
|
+
isLoading: boolean;
|
|
448
|
+
overview: AdminOverview | null;
|
|
449
|
+
participants: AdminParticipantSummary[];
|
|
450
|
+
refresh: () => Promise<void>;
|
|
451
|
+
setInterval: (interval: AdminActivityInterval) => void;
|
|
452
|
+
setRange: (range: AdminDatePreset) => void;
|
|
453
|
+
threads: AdminThreadSummary[];
|
|
454
|
+
}
|
|
455
|
+
/** @deprecated Prefer the module-based CopilotzAdmin shell and createAdminClient. */
|
|
456
|
+
declare function useCopilotzAdmin(options?: UseCopilotzAdminOptions): UseCopilotzAdminResult;
|
|
350
457
|
|
|
351
|
-
export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminCollectionItem, type
|
|
458
|
+
export { ADMIN_GROUP_LABELS, ADMIN_GROUP_ORDER, type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminBranding, type AdminClientConfig, type AdminClientOptions, type AdminClientPaths, type AdminCollectionItem, type AdminCollectionPage, type AdminDatePreset, type AdminDetailPanel, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminModule, type AdminModuleGroup, type AdminNavItem, type AdminOverview, type AdminParticipantDetail, type AdminParticipantSummary, type AdminPermissions, type AdminQueueEvent, type AdminRouteDefinition, type AdminRouteState, type AdminRuntimeContext, type AdminScope, type AdminThreadDetail, type AdminThreadSummary, type AdminUsageAttribution, type AdminUsageBreakdown, type AdminUsageDimension, type AdminUsageFilters, type AdminUsageGroupBy, type AdminUsageInterval, type AdminUsageMetricKind, type AdminUsagePoint, type AdminUsageResponse, type AdminUsageTotals, type AggregatedUsageRow, type CollectionEditor, type CollectionEditorProps, CopilotzAdmin, type CopilotzAdminClient, type CopilotzAdminProps, EMPTY_USAGE_TOTALS, type LegacyAdminConfig, type RequestHeadersProvider, type UsageCalculationOptions, type UsageChartSeries, type UsageChartState, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, addUsageTotals, agentsModule, aggregateUsageRows, buildUsageChartState, canAccessAdminPermission, collectAdminNavItems, collectAdminRoutes, collectCollectionEditors, collectionsModule, createAdminClient, defaultAdminConfig, defaultCopilotzModules, eventsModule, firstAccessibleRoute, formatCompactMetric, formatMetricValue, formatNumber, formatPercent, formatUsageBucket, getUsageDimensionLabel, getUsageGroupLabel, getUsageRange, getUsageTotalValue, mergeAdminConfig, overviewModule, participantsModule, threadsModule, usageModule, useAdmin, useCopilotzAdmin };
|