@copilotz/admin 0.9.23 → 0.9.25

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.d.cts CHANGED
@@ -3,6 +3,9 @@ import React, { ReactNode } from 'react';
3
3
  type RequestHeadersProvider = () => Record<string, string> | Promise<Record<string, string>>;
4
4
  type AdminDatePreset = "24h" | "7d" | "30d";
5
5
  type AdminActivityInterval = "hour" | "day";
6
+ type AdminUsageInterval = "minute" | "hour" | "day" | "week" | "month";
7
+ type AdminUsageMetricKind = "tokens" | "cost" | "calls";
8
+ type AdminUsageGroupBy = "thread" | "participant" | "namespace" | "provider" | "model";
6
9
  type AdminPage = "dashboard" | "threads" | "thread-detail" | "participants" | "participant-detail" | "agents" | "agent-detail" | "collection-items" | "collection-item-detail" | "events";
7
10
  interface AdminRoute {
8
11
  page: AdminPage;
@@ -49,6 +52,7 @@ interface AdminOverview {
49
52
  total: number;
50
53
  humans: number;
51
54
  agents: number;
55
+ jobs?: number;
52
56
  };
53
57
  llmTotals: AdminUsageTotals;
54
58
  }
@@ -73,13 +77,36 @@ interface AdminThreadSummary {
73
77
  interface AdminParticipantSummary {
74
78
  externalId: string;
75
79
  displayName: string;
76
- participantType: "human" | "agent";
80
+ participantType: "human" | "agent" | "job";
77
81
  namespace: string;
78
82
  isGlobal: boolean;
79
83
  messageCount: number;
80
84
  threadCount: number;
81
85
  lastActivityAt: string | null;
82
86
  }
87
+ interface AdminUsagePoint extends AdminUsageTotals {
88
+ bucket: string;
89
+ groupKey: string;
90
+ groupLabel: string;
91
+ }
92
+ interface AdminUsageResponse {
93
+ points: AdminUsagePoint[];
94
+ rows: AdminUsagePoint[];
95
+ totals: AdminUsageTotals;
96
+ }
97
+ interface AdminUsageFilters {
98
+ from?: string;
99
+ to?: string;
100
+ interval?: AdminUsageInterval;
101
+ metric?: AdminUsageMetricKind;
102
+ groupBy?: AdminUsageGroupBy;
103
+ threadId?: string;
104
+ participantId?: string;
105
+ participantType?: "all" | "human" | "agent" | "job";
106
+ namespace?: string;
107
+ provider?: string;
108
+ model?: string;
109
+ }
83
110
  interface AdminAgentSummary {
84
111
  agentId: string;
85
112
  displayName: string;
@@ -300,6 +327,7 @@ declare function fetchAdminActivity(range: AdminDatePreset, interval: AdminActiv
300
327
  declare function fetchAdminThreads(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminThreadSummary[]>;
301
328
  declare function fetchAdminParticipants(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminParticipantSummary[]>;
302
329
  declare function fetchAdminAgents(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminAgentSummary[]>;
330
+ declare function fetchAdminUsage(filters: AdminUsageFilters, options?: FetchOptions): Promise<AdminUsageResponse>;
303
331
  declare function fetchParticipantDetail(participantId: string, options?: FetchOptions): Promise<AdminParticipantDetail | null>;
304
332
  declare function updateParticipant(participantId: string, data: Record<string, unknown>, options?: FetchOptions): Promise<AdminParticipantDetail>;
305
333
  declare function fetchCollectionNames(options?: FetchOptions): Promise<string[]>;
@@ -318,4 +346,4 @@ declare function fetchThreadEvents(threadId: string, options?: FetchOptions): Pr
318
346
  declare const defaultAdminConfig: ResolvedAdminConfig;
319
347
  declare function mergeAdminConfig(_baseConfig: ResolvedAdminConfig, userConfig?: Partial<AdminConfig>): ResolvedAdminConfig;
320
348
 
321
- export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminCollectionItem, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminOverview, type AdminPage, type AdminParticipantDetail, type AdminParticipantSummary, type AdminQueueEvent, type AdminRoute, type AdminSectionState, type AdminThreadDetail, type AdminThreadSummary, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, createCollectionItem, defaultAdminConfig, deleteCollectionItem, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, fetchCollectionItem, fetchCollectionItems, fetchCollectionNames, fetchParticipantDetail, fetchThreadEvents, mergeAdminConfig, updateCollectionItem, updateParticipant, useCopilotzAdmin };
349
+ export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminCollectionItem, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminOverview, type AdminPage, type AdminParticipantDetail, type AdminParticipantSummary, type AdminQueueEvent, type AdminRoute, type AdminSectionState, type AdminThreadDetail, type AdminThreadSummary, type AdminUsageFilters, type AdminUsageGroupBy, type AdminUsageInterval, type AdminUsagePoint, type AdminUsageResponse, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, createCollectionItem, defaultAdminConfig, deleteCollectionItem, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, fetchAdminUsage, fetchCollectionItem, fetchCollectionItems, fetchCollectionNames, fetchParticipantDetail, fetchThreadEvents, mergeAdminConfig, updateCollectionItem, updateParticipant, useCopilotzAdmin };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,9 @@ import React, { ReactNode } from 'react';
3
3
  type RequestHeadersProvider = () => Record<string, string> | Promise<Record<string, string>>;
4
4
  type AdminDatePreset = "24h" | "7d" | "30d";
5
5
  type AdminActivityInterval = "hour" | "day";
6
+ type AdminUsageInterval = "minute" | "hour" | "day" | "week" | "month";
7
+ type AdminUsageMetricKind = "tokens" | "cost" | "calls";
8
+ type AdminUsageGroupBy = "thread" | "participant" | "namespace" | "provider" | "model";
6
9
  type AdminPage = "dashboard" | "threads" | "thread-detail" | "participants" | "participant-detail" | "agents" | "agent-detail" | "collection-items" | "collection-item-detail" | "events";
7
10
  interface AdminRoute {
8
11
  page: AdminPage;
@@ -49,6 +52,7 @@ interface AdminOverview {
49
52
  total: number;
50
53
  humans: number;
51
54
  agents: number;
55
+ jobs?: number;
52
56
  };
53
57
  llmTotals: AdminUsageTotals;
54
58
  }
@@ -73,13 +77,36 @@ interface AdminThreadSummary {
73
77
  interface AdminParticipantSummary {
74
78
  externalId: string;
75
79
  displayName: string;
76
- participantType: "human" | "agent";
80
+ participantType: "human" | "agent" | "job";
77
81
  namespace: string;
78
82
  isGlobal: boolean;
79
83
  messageCount: number;
80
84
  threadCount: number;
81
85
  lastActivityAt: string | null;
82
86
  }
87
+ interface AdminUsagePoint extends AdminUsageTotals {
88
+ bucket: string;
89
+ groupKey: string;
90
+ groupLabel: string;
91
+ }
92
+ interface AdminUsageResponse {
93
+ points: AdminUsagePoint[];
94
+ rows: AdminUsagePoint[];
95
+ totals: AdminUsageTotals;
96
+ }
97
+ interface AdminUsageFilters {
98
+ from?: string;
99
+ to?: string;
100
+ interval?: AdminUsageInterval;
101
+ metric?: AdminUsageMetricKind;
102
+ groupBy?: AdminUsageGroupBy;
103
+ threadId?: string;
104
+ participantId?: string;
105
+ participantType?: "all" | "human" | "agent" | "job";
106
+ namespace?: string;
107
+ provider?: string;
108
+ model?: string;
109
+ }
83
110
  interface AdminAgentSummary {
84
111
  agentId: string;
85
112
  displayName: string;
@@ -300,6 +327,7 @@ declare function fetchAdminActivity(range: AdminDatePreset, interval: AdminActiv
300
327
  declare function fetchAdminThreads(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminThreadSummary[]>;
301
328
  declare function fetchAdminParticipants(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminParticipantSummary[]>;
302
329
  declare function fetchAdminAgents(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminAgentSummary[]>;
330
+ declare function fetchAdminUsage(filters: AdminUsageFilters, options?: FetchOptions): Promise<AdminUsageResponse>;
303
331
  declare function fetchParticipantDetail(participantId: string, options?: FetchOptions): Promise<AdminParticipantDetail | null>;
304
332
  declare function updateParticipant(participantId: string, data: Record<string, unknown>, options?: FetchOptions): Promise<AdminParticipantDetail>;
305
333
  declare function fetchCollectionNames(options?: FetchOptions): Promise<string[]>;
@@ -318,4 +346,4 @@ declare function fetchThreadEvents(threadId: string, options?: FetchOptions): Pr
318
346
  declare const defaultAdminConfig: ResolvedAdminConfig;
319
347
  declare function mergeAdminConfig(_baseConfig: ResolvedAdminConfig, userConfig?: Partial<AdminConfig>): ResolvedAdminConfig;
320
348
 
321
- export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminCollectionItem, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminOverview, type AdminPage, type AdminParticipantDetail, type AdminParticipantSummary, type AdminQueueEvent, type AdminRoute, type AdminSectionState, type AdminThreadDetail, type AdminThreadSummary, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, createCollectionItem, defaultAdminConfig, deleteCollectionItem, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, fetchCollectionItem, fetchCollectionItems, fetchCollectionNames, fetchParticipantDetail, fetchThreadEvents, mergeAdminConfig, updateCollectionItem, updateParticipant, useCopilotzAdmin };
349
+ export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminCollectionItem, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminOverview, type AdminPage, type AdminParticipantDetail, type AdminParticipantSummary, type AdminQueueEvent, type AdminRoute, type AdminSectionState, type AdminThreadDetail, type AdminThreadSummary, type AdminUsageFilters, type AdminUsageGroupBy, type AdminUsageInterval, type AdminUsagePoint, type AdminUsageResponse, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, createCollectionItem, defaultAdminConfig, deleteCollectionItem, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, fetchAdminUsage, fetchCollectionItem, fetchCollectionItems, fetchCollectionNames, fetchParticipantDetail, fetchThreadEvents, mergeAdminConfig, updateCollectionItem, updateParticipant, useCopilotzAdmin };