@copilotz/admin 0.9.33 → 0.9.35
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 +2949 -2855
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +345 -170
- package/dist/index.d.ts +345 -170
- package/dist/index.js +2913 -2854
- package/dist/index.js.map +1 -1
- package/dist/styles.css +222 -0
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React, { ReactNode, ComponentType } from 'react';
|
|
3
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
4
|
|
|
3
5
|
type RequestHeadersProvider = () => Record<string, string> | Promise<Record<string, string>>;
|
|
4
6
|
type AdminDatePreset = "24h" | "7d" | "30d";
|
|
@@ -7,12 +9,7 @@ type AdminUsageInterval = "minute" | "hour" | "day" | "week" | "month";
|
|
|
7
9
|
type AdminUsageMetricKind = "tokens" | "cost" | "calls";
|
|
8
10
|
type AdminUsageGroupBy = "thread" | "participant" | "namespace" | "provider" | "model";
|
|
9
11
|
type AdminUsageAttribution = "generatedBy" | "initiatedBy";
|
|
10
|
-
type
|
|
11
|
-
interface AdminRoute {
|
|
12
|
-
page: AdminPage;
|
|
13
|
-
resourceId?: string;
|
|
14
|
-
collection?: string;
|
|
15
|
-
}
|
|
12
|
+
type AdminUsageDimension = "total" | "input" | "output" | "reasoning" | "cacheRead" | "cacheWrite";
|
|
16
13
|
interface AdminUsageBreakdown {
|
|
17
14
|
inputTokens: number;
|
|
18
15
|
outputTokens: number;
|
|
@@ -85,6 +82,18 @@ interface AdminParticipantSummary {
|
|
|
85
82
|
threadCount: number;
|
|
86
83
|
lastActivityAt: string | null;
|
|
87
84
|
}
|
|
85
|
+
interface AdminAgentSummary extends AdminUsageTotals {
|
|
86
|
+
agentId: string;
|
|
87
|
+
displayName: string;
|
|
88
|
+
description: string | null;
|
|
89
|
+
isConfigured: boolean;
|
|
90
|
+
namespace: string;
|
|
91
|
+
isGlobal: boolean;
|
|
92
|
+
messageCount: number;
|
|
93
|
+
llmCallCount: number;
|
|
94
|
+
toolCallMessageCount: number;
|
|
95
|
+
lastActivityAt: string | null;
|
|
96
|
+
}
|
|
88
97
|
interface AdminUsagePoint extends AdminUsageTotals {
|
|
89
98
|
bucket: string;
|
|
90
99
|
groupKey: string;
|
|
@@ -109,30 +118,6 @@ interface AdminUsageFilters {
|
|
|
109
118
|
provider?: string;
|
|
110
119
|
model?: string;
|
|
111
120
|
}
|
|
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
121
|
interface AdminThreadDetail {
|
|
137
122
|
id: string;
|
|
138
123
|
name: string;
|
|
@@ -173,7 +158,17 @@ interface AdminMessagePage {
|
|
|
173
158
|
type AdminParticipantDetail = Record<string, unknown>;
|
|
174
159
|
type AdminCollectionItem = Record<string, unknown> & {
|
|
175
160
|
id?: string;
|
|
161
|
+
_id?: string;
|
|
176
162
|
};
|
|
163
|
+
interface AdminCollectionPage {
|
|
164
|
+
data: AdminCollectionItem[];
|
|
165
|
+
pageInfo?: {
|
|
166
|
+
hasNextPage?: boolean;
|
|
167
|
+
hasPreviousPage?: boolean;
|
|
168
|
+
startCursor?: string | null;
|
|
169
|
+
endCursor?: string | null;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
177
172
|
interface AdminQueueEvent {
|
|
178
173
|
id: string;
|
|
179
174
|
threadId: string;
|
|
@@ -188,164 +183,344 @@ interface AdminQueueEvent {
|
|
|
188
183
|
createdAt: string | null;
|
|
189
184
|
updatedAt: string | null;
|
|
190
185
|
}
|
|
191
|
-
|
|
186
|
+
|
|
187
|
+
interface AdminClientPaths {
|
|
188
|
+
adminBase: string;
|
|
189
|
+
collectionsBase: string;
|
|
190
|
+
threadsBase: string;
|
|
191
|
+
}
|
|
192
|
+
interface AdminClientOptions {
|
|
193
|
+
baseUrl?: string;
|
|
194
|
+
paths?: Partial<AdminClientPaths>;
|
|
195
|
+
getRequestHeaders?: RequestHeadersProvider;
|
|
196
|
+
}
|
|
197
|
+
interface AdminListOptions {
|
|
192
198
|
namespace?: string;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
199
|
+
search?: string;
|
|
200
|
+
limit?: number;
|
|
201
|
+
offset?: number;
|
|
202
|
+
before?: string;
|
|
203
|
+
after?: string;
|
|
204
|
+
filter?: Record<string, unknown>;
|
|
205
|
+
sort?: Record<string, "asc" | "desc">;
|
|
206
|
+
populate?: string[];
|
|
198
207
|
}
|
|
199
|
-
interface
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
208
|
+
interface CopilotzAdminClient {
|
|
209
|
+
paths: AdminClientPaths;
|
|
210
|
+
getOverview(options?: {
|
|
211
|
+
range?: AdminDatePreset;
|
|
212
|
+
namespace?: string;
|
|
213
|
+
}): Promise<AdminOverview>;
|
|
214
|
+
getActivity(options?: {
|
|
215
|
+
range?: AdminDatePreset;
|
|
216
|
+
interval?: AdminActivityInterval;
|
|
217
|
+
namespace?: string;
|
|
218
|
+
}): Promise<AdminActivityPoint[]>;
|
|
219
|
+
getUsage(filters?: AdminUsageFilters): Promise<AdminUsageResponse>;
|
|
220
|
+
listThreads(options?: AdminListOptions): Promise<AdminThreadSummary[]>;
|
|
221
|
+
listParticipants(options?: AdminListOptions): Promise<AdminParticipantSummary[]>;
|
|
222
|
+
listAgents(options?: AdminListOptions & {
|
|
223
|
+
range?: AdminDatePreset;
|
|
224
|
+
}): Promise<AdminAgentSummary[]>;
|
|
225
|
+
getThread(threadId: string): Promise<AdminThreadDetail>;
|
|
226
|
+
getThreadMessages(threadId: string, options?: {
|
|
227
|
+
limit?: number;
|
|
228
|
+
before?: string;
|
|
229
|
+
}): Promise<AdminMessagePage>;
|
|
230
|
+
getThreadEvent(threadId: string): Promise<AdminQueueEvent | undefined>;
|
|
231
|
+
listCollections(): Promise<string[]>;
|
|
232
|
+
listCollectionItems(collection: string, options?: AdminListOptions): Promise<AdminCollectionItem[]>;
|
|
233
|
+
getCollectionItem(collection: string, itemId: string, options?: {
|
|
234
|
+
namespace?: string;
|
|
235
|
+
populate?: string[];
|
|
236
|
+
}): Promise<AdminCollectionItem>;
|
|
237
|
+
createCollectionItem(collection: string, data: Record<string, unknown>, options?: {
|
|
238
|
+
namespace?: string;
|
|
239
|
+
}): Promise<AdminCollectionItem>;
|
|
240
|
+
updateCollectionItem(collection: string, itemId: string, data: Record<string, unknown>, options?: {
|
|
241
|
+
namespace?: string;
|
|
242
|
+
}): Promise<AdminCollectionItem>;
|
|
243
|
+
deleteCollectionItem(collection: string, itemId: string, options?: {
|
|
244
|
+
namespace?: string;
|
|
245
|
+
}): Promise<void>;
|
|
246
|
+
}
|
|
247
|
+
declare function createAdminClient(options?: AdminClientOptions): CopilotzAdminClient;
|
|
248
|
+
|
|
249
|
+
type AdminModuleGroup = "operate" | "configure" | "data" | "extensions";
|
|
250
|
+
interface AdminScope {
|
|
251
|
+
namespace?: string;
|
|
252
|
+
schema?: string;
|
|
253
|
+
availableNamespaces?: Array<{
|
|
254
|
+
id: string;
|
|
255
|
+
label?: string;
|
|
256
|
+
}>;
|
|
257
|
+
}
|
|
258
|
+
interface AdminBranding {
|
|
259
|
+
title?: string;
|
|
260
|
+
subtitle?: string;
|
|
261
|
+
logo?: ReactNode;
|
|
262
|
+
actions?: ReactNode;
|
|
263
|
+
}
|
|
264
|
+
interface AdminPermissions {
|
|
265
|
+
roles?: string[];
|
|
266
|
+
canAccess?: (permission: string, action?: string) => boolean;
|
|
267
|
+
}
|
|
268
|
+
interface AdminRouteState {
|
|
269
|
+
routeId: string;
|
|
270
|
+
params?: Record<string, string | undefined>;
|
|
271
|
+
}
|
|
272
|
+
interface AdminRouteDefinition {
|
|
273
|
+
id: string;
|
|
274
|
+
title: string;
|
|
275
|
+
permission?: string;
|
|
276
|
+
render: (context: AdminRuntimeContext) => ReactNode;
|
|
277
|
+
}
|
|
278
|
+
interface AdminNavItem {
|
|
279
|
+
id: string;
|
|
280
|
+
label: string;
|
|
281
|
+
routeId: string;
|
|
282
|
+
group?: AdminModuleGroup;
|
|
283
|
+
icon?: ComponentType<{
|
|
284
|
+
className?: string;
|
|
285
|
+
}>;
|
|
286
|
+
description?: string;
|
|
287
|
+
order?: number;
|
|
288
|
+
permission?: string;
|
|
289
|
+
}
|
|
290
|
+
interface CollectionEditorProps {
|
|
291
|
+
collection: string;
|
|
292
|
+
itemId: string | null;
|
|
293
|
+
value: AdminCollectionItem | null;
|
|
294
|
+
isNew: boolean;
|
|
295
|
+
context: AdminRuntimeContext;
|
|
296
|
+
onSaved?: (item: AdminCollectionItem) => void;
|
|
297
|
+
onDeleted?: () => void;
|
|
298
|
+
}
|
|
299
|
+
type CollectionEditor = ComponentType<CollectionEditorProps>;
|
|
300
|
+
interface AdminDetailPanel {
|
|
301
|
+
id: string;
|
|
302
|
+
label: string;
|
|
303
|
+
routeIds?: string[];
|
|
304
|
+
render: (context: AdminRuntimeContext) => ReactNode;
|
|
305
|
+
}
|
|
306
|
+
interface AdminModule {
|
|
307
|
+
id: string;
|
|
308
|
+
label: string;
|
|
309
|
+
group?: AdminModuleGroup;
|
|
310
|
+
icon?: ComponentType<{
|
|
311
|
+
className?: string;
|
|
312
|
+
}>;
|
|
313
|
+
routes: AdminRouteDefinition[];
|
|
314
|
+
navItems?: AdminNavItem[];
|
|
315
|
+
collectionEditors?: Record<string, CollectionEditor>;
|
|
316
|
+
detailPanels?: AdminDetailPanel[];
|
|
317
|
+
}
|
|
318
|
+
interface AdminRuntimeContext {
|
|
319
|
+
client: CopilotzAdminClient;
|
|
320
|
+
modules: AdminModule[];
|
|
321
|
+
route: AdminRouteState;
|
|
322
|
+
scope: AdminScope;
|
|
323
|
+
branding: Required<AdminBranding>;
|
|
324
|
+
permissions: AdminPermissions;
|
|
325
|
+
refreshKey: number;
|
|
326
|
+
collectionEditors: Record<string, CollectionEditor>;
|
|
327
|
+
navigate: (routeId: string, params?: Record<string, string | undefined>) => void;
|
|
328
|
+
setNamespace: (namespace: string) => void;
|
|
329
|
+
requestRefresh: () => void;
|
|
330
|
+
canAccess: (permission?: string, action?: string) => boolean;
|
|
331
|
+
}
|
|
332
|
+
interface AdminClientConfig {
|
|
333
|
+
baseUrl?: string;
|
|
334
|
+
paths?: Partial<AdminClientPaths>;
|
|
335
|
+
getRequestHeaders?: RequestHeadersProvider;
|
|
336
|
+
}
|
|
337
|
+
interface LegacyAdminConfig {
|
|
273
338
|
baseUrl?: string;
|
|
274
339
|
getRequestHeaders?: RequestHeadersProvider;
|
|
275
340
|
namespace?: string;
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
defaultPage?: AdminPage;
|
|
279
|
-
onNavigate?: (route: AdminRoute) => void;
|
|
280
|
-
}
|
|
281
|
-
interface ResolvedAdminConfig {
|
|
282
|
-
branding: Required<NonNullable<AdminConfig["branding"]>>;
|
|
283
|
-
labels: Required<NonNullable<AdminConfig["labels"]>>;
|
|
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;
|
|
341
|
+
branding?: AdminBranding;
|
|
342
|
+
defaultPage?: string;
|
|
294
343
|
}
|
|
295
|
-
interface
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
344
|
+
interface CopilotzAdminProps {
|
|
345
|
+
client?: CopilotzAdminClient;
|
|
346
|
+
clientConfig?: AdminClientConfig;
|
|
347
|
+
config?: LegacyAdminConfig;
|
|
348
|
+
scope?: AdminScope;
|
|
349
|
+
modules?: AdminModule[];
|
|
350
|
+
branding?: AdminBranding;
|
|
351
|
+
permissions?: AdminPermissions;
|
|
352
|
+
className?: string;
|
|
353
|
+
onNavigate?: (route: AdminRouteState) => void;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
declare function CopilotzAdmin({ branding: brandingProp, className, client, clientConfig, config, modules: modulesProp, onNavigate, permissions, scope: scopeProp, }: CopilotzAdminProps): react_jsx_runtime.JSX.Element;
|
|
357
|
+
|
|
358
|
+
declare function useAdmin(): AdminRuntimeContext;
|
|
359
|
+
|
|
360
|
+
declare const ADMIN_GROUP_LABELS: Record<AdminModuleGroup, string>;
|
|
361
|
+
declare const ADMIN_GROUP_ORDER: AdminModuleGroup[];
|
|
362
|
+
declare function canAccessAdminPermission(permissions: AdminPermissions | undefined, permission?: string, action?: string): boolean;
|
|
363
|
+
declare function collectAdminRoutes(modules: AdminModule[], permissions?: AdminPermissions): Map<string, AdminRouteDefinition>;
|
|
364
|
+
declare function collectAdminNavItems(modules: AdminModule[], permissions?: AdminPermissions): AdminNavItem[];
|
|
365
|
+
declare function collectCollectionEditors(modules: AdminModule[]): Record<string, CollectionEditor>;
|
|
366
|
+
declare function firstAccessibleRoute(modules: AdminModule[], permissions?: AdminPermissions): string;
|
|
367
|
+
|
|
368
|
+
declare function agentsModule(): AdminModule;
|
|
369
|
+
|
|
370
|
+
declare function collectionsModule(): AdminModule;
|
|
371
|
+
|
|
372
|
+
declare function eventsModule(): AdminModule;
|
|
373
|
+
|
|
374
|
+
declare function overviewModule(): AdminModule;
|
|
375
|
+
|
|
376
|
+
declare function participantsModule(): AdminModule;
|
|
377
|
+
|
|
378
|
+
declare function threadsModule(): AdminModule;
|
|
379
|
+
|
|
380
|
+
declare function usageModule(): AdminModule;
|
|
381
|
+
|
|
382
|
+
interface UsageChartSeries {
|
|
383
|
+
color: string;
|
|
384
|
+
id: string;
|
|
385
|
+
key: string;
|
|
386
|
+
label: string;
|
|
387
|
+
}
|
|
388
|
+
interface UsageChartState {
|
|
389
|
+
config: Record<string, {
|
|
390
|
+
color: string;
|
|
391
|
+
label: string;
|
|
392
|
+
}>;
|
|
393
|
+
data: Array<Record<string, number | string>>;
|
|
394
|
+
series: UsageChartSeries[];
|
|
395
|
+
}
|
|
396
|
+
interface AggregatedUsageRow extends AdminUsageTotals {
|
|
397
|
+
groupKey: string;
|
|
398
|
+
groupLabel: string;
|
|
399
|
+
value: number;
|
|
400
|
+
}
|
|
401
|
+
interface UsageCalculationOptions {
|
|
402
|
+
dimension: AdminUsageDimension;
|
|
403
|
+
interval: AdminUsageInterval;
|
|
404
|
+
metricKind: AdminUsageMetricKind;
|
|
405
|
+
points: AdminUsagePoint[];
|
|
301
406
|
}
|
|
302
|
-
|
|
407
|
+
|
|
408
|
+
declare const EMPTY_USAGE_TOTALS: AdminUsageTotals;
|
|
409
|
+
declare function addUsageTotals(target: AdminUsageTotals, source: AdminUsageTotals): void;
|
|
410
|
+
declare function getUsageTotalValue(totals: AdminUsageTotals, metricKind: AdminUsageMetricKind, dimension: AdminUsageDimension): number;
|
|
411
|
+
declare function aggregateUsageRows(points: AdminUsagePoint[], metricKind: AdminUsageMetricKind, dimension: AdminUsageDimension): AggregatedUsageRow[];
|
|
412
|
+
declare function buildUsageChartState(points: AdminUsagePoint[], metricKind: AdminUsageMetricKind, dimension: AdminUsageDimension, interval: AdminUsageInterval): UsageChartState;
|
|
413
|
+
declare function getUsageRange(period: "24h" | "7d" | "30d" | "custom", customFrom: string, customTo: string): {
|
|
414
|
+
from: string | undefined;
|
|
415
|
+
to: string | undefined;
|
|
416
|
+
};
|
|
417
|
+
declare function getUsageDimensionLabel(dimension: AdminUsageDimension): "Input" | "Output" | "Reasoning" | "Cache read" | "Cache write" | "Total";
|
|
418
|
+
declare function getUsageGroupLabel(groupBy: string): "Thread" | "Namespace" | "Provider" | "Model" | "Participant";
|
|
419
|
+
declare function formatUsageBucket(bucket: string, interval: AdminUsageInterval): string;
|
|
420
|
+
declare function formatNumber(value: number): string;
|
|
421
|
+
declare function formatPercent(value: number): string;
|
|
422
|
+
declare function formatMetricValue(value: number, metricKind: AdminUsageMetricKind): string;
|
|
423
|
+
declare function formatCompactMetric(value: number, metricKind: AdminUsageMetricKind): string;
|
|
424
|
+
|
|
425
|
+
declare function defaultCopilotzModules(): AdminModule[];
|
|
426
|
+
|
|
427
|
+
declare const defaultAdminConfig: LegacyAdminConfig;
|
|
428
|
+
declare function mergeAdminConfig(baseConfig?: LegacyAdminConfig, userConfig?: LegacyAdminConfig): LegacyAdminConfig;
|
|
429
|
+
|
|
430
|
+
interface UseCopilotzAdminOptions {
|
|
431
|
+
agentSearch?: string;
|
|
303
432
|
baseUrl?: string;
|
|
304
433
|
getRequestHeaders?: RequestHeadersProvider;
|
|
434
|
+
interval?: AdminActivityInterval;
|
|
435
|
+
namespace?: string;
|
|
436
|
+
participantSearch?: string;
|
|
437
|
+
range?: AdminDatePreset;
|
|
438
|
+
threadSearch?: string;
|
|
305
439
|
}
|
|
306
|
-
interface UseCopilotzAdminResult
|
|
307
|
-
|
|
308
|
-
|
|
440
|
+
interface UseCopilotzAdminResult {
|
|
441
|
+
activity: AdminActivityPoint[];
|
|
442
|
+
agents: AdminAgentSummary[];
|
|
309
443
|
error: Error | null;
|
|
444
|
+
filters: UseCopilotzAdminOptions & {
|
|
445
|
+
interval: AdminActivityInterval;
|
|
446
|
+
range: AdminDatePreset;
|
|
447
|
+
};
|
|
448
|
+
isLoading: boolean;
|
|
449
|
+
overview: AdminOverview | null;
|
|
450
|
+
participants: AdminParticipantSummary[];
|
|
310
451
|
refresh: () => Promise<void>;
|
|
311
|
-
setRange: (range: AdminDatePreset) => void;
|
|
312
452
|
setInterval: (interval: AdminActivityInterval) => void;
|
|
453
|
+
setRange: (range: AdminDatePreset) => void;
|
|
454
|
+
threads: AdminThreadSummary[];
|
|
313
455
|
}
|
|
456
|
+
/** @deprecated Prefer the module-based CopilotzAdmin shell and createAdminClient. */
|
|
457
|
+
declare function useCopilotzAdmin(options?: UseCopilotzAdminOptions): UseCopilotzAdminResult;
|
|
314
458
|
|
|
315
|
-
|
|
316
|
-
|
|
459
|
+
declare function EmptyState({ action, description, icon: Icon, title, }: {
|
|
460
|
+
action?: React.ReactNode;
|
|
461
|
+
description?: React.ReactNode;
|
|
462
|
+
icon?: LucideIcon;
|
|
463
|
+
title: React.ReactNode;
|
|
464
|
+
}): react_jsx_runtime.JSX.Element;
|
|
465
|
+
|
|
466
|
+
declare function FilterBar({ actions, children, onSearchChange, searchPlaceholder, searchValue, }: {
|
|
467
|
+
actions?: React.ReactNode;
|
|
468
|
+
children?: React.ReactNode;
|
|
469
|
+
onSearchChange?: (value: string) => void;
|
|
470
|
+
searchPlaceholder?: string;
|
|
471
|
+
searchValue?: string;
|
|
472
|
+
}): react_jsx_runtime.JSX.Element;
|
|
473
|
+
|
|
474
|
+
declare function InspectorPanel({ children, className, side, }: {
|
|
475
|
+
children: React.ReactNode;
|
|
317
476
|
className?: string;
|
|
477
|
+
side?: React.ReactNode;
|
|
478
|
+
}): react_jsx_runtime.JSX.Element;
|
|
479
|
+
|
|
480
|
+
declare function JsonPanel({ minHeight, onSave, title, value, }: {
|
|
481
|
+
minHeight?: number;
|
|
482
|
+
onSave?: (value: Record<string, unknown>) => Promise<void> | void;
|
|
483
|
+
title?: string;
|
|
484
|
+
value: unknown;
|
|
485
|
+
}): react_jsx_runtime.JSX.Element;
|
|
486
|
+
|
|
487
|
+
interface MetricStripItem {
|
|
488
|
+
label: string;
|
|
489
|
+
value: React.ReactNode;
|
|
490
|
+
detail?: React.ReactNode;
|
|
491
|
+
icon?: LucideIcon;
|
|
318
492
|
}
|
|
319
|
-
declare
|
|
493
|
+
declare function MetricStrip({ items }: {
|
|
494
|
+
items: MetricStripItem[];
|
|
495
|
+
}): react_jsx_runtime.JSX.Element;
|
|
320
496
|
|
|
321
|
-
declare function
|
|
497
|
+
declare function PageHeader({ actions, badges, description, title, }: {
|
|
498
|
+
actions?: React.ReactNode;
|
|
499
|
+
badges?: Array<{
|
|
500
|
+
label: string;
|
|
501
|
+
variant?: "default" | "secondary" | "outline" | "destructive";
|
|
502
|
+
}>;
|
|
503
|
+
description?: React.ReactNode;
|
|
504
|
+
title: React.ReactNode;
|
|
505
|
+
}): react_jsx_runtime.JSX.Element;
|
|
322
506
|
|
|
323
|
-
interface
|
|
324
|
-
|
|
325
|
-
|
|
507
|
+
interface ResourceTableColumn<T> {
|
|
508
|
+
id: string;
|
|
509
|
+
header: React.ReactNode;
|
|
510
|
+
align?: "left" | "right";
|
|
511
|
+
className?: string;
|
|
512
|
+
render: (row: T) => React.ReactNode;
|
|
326
513
|
}
|
|
327
|
-
declare function
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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;
|
|
338
|
-
namespace?: string;
|
|
339
|
-
limit?: number;
|
|
340
|
-
offset?: number;
|
|
341
|
-
}, options?: FetchOptions): Promise<AdminCollectionItem[]>;
|
|
342
|
-
declare function fetchCollectionItem(collection: string, itemId: string, _namespace?: string, options?: FetchOptions): Promise<AdminCollectionItem>;
|
|
343
|
-
declare function createCollectionItem(collection: string, data: Record<string, unknown>, _namespace?: string, options?: FetchOptions): Promise<AdminCollectionItem>;
|
|
344
|
-
declare function updateCollectionItem(collection: string, itemId: string, data: Record<string, unknown>, _namespace?: string, options?: FetchOptions): Promise<AdminCollectionItem>;
|
|
345
|
-
declare function deleteCollectionItem(collection: string, itemId: string, _namespace?: string, options?: FetchOptions): Promise<void>;
|
|
346
|
-
declare function fetchThreadEvents(threadId: string, options?: FetchOptions): Promise<AdminQueueEvent | undefined>;
|
|
514
|
+
declare function ResourceTable<T>({ columns, empty, getRowKey, onRowClick, rows, }: {
|
|
515
|
+
columns: Array<ResourceTableColumn<T>>;
|
|
516
|
+
empty?: React.ReactNode;
|
|
517
|
+
getRowKey: (row: T, index: number) => string;
|
|
518
|
+
onRowClick?: (row: T) => void;
|
|
519
|
+
rows: T[];
|
|
520
|
+
}): react_jsx_runtime.JSX.Element;
|
|
347
521
|
|
|
348
|
-
declare
|
|
349
|
-
|
|
522
|
+
declare function StatusBadge({ status }: {
|
|
523
|
+
status?: string | null;
|
|
524
|
+
}): react_jsx_runtime.JSX.Element;
|
|
350
525
|
|
|
351
|
-
export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminCollectionItem, type
|
|
526
|
+
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, EmptyState, FilterBar, InspectorPanel, JsonPanel, type LegacyAdminConfig, MetricStrip, type MetricStripItem, PageHeader, type RequestHeadersProvider, ResourceTable, type ResourceTableColumn, StatusBadge, 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 };
|