@copilotz/admin 0.3.5 → 0.3.7
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 +1526 -295
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -20
- package/dist/index.d.ts +63 -20
- package/dist/index.js +1543 -297
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1432 -111
- package/package.json +5 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,11 @@ 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 AdminPage = "dashboard" | "threads" | "thread-detail" | "participants" | "agents" | "events";
|
|
7
|
+
interface AdminRoute {
|
|
8
|
+
page: AdminPage;
|
|
9
|
+
resourceId?: string;
|
|
10
|
+
}
|
|
6
11
|
interface AdminOverview {
|
|
7
12
|
threadTotals: {
|
|
8
13
|
total: number;
|
|
@@ -84,6 +89,43 @@ interface AdminAgentSummary {
|
|
|
84
89
|
totalTokens: number;
|
|
85
90
|
lastActivityAt: string | null;
|
|
86
91
|
}
|
|
92
|
+
interface AdminThreadDetail {
|
|
93
|
+
id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
externalId: string | null;
|
|
96
|
+
description: string | null;
|
|
97
|
+
participants: string[] | null;
|
|
98
|
+
status: string;
|
|
99
|
+
summary: string | null;
|
|
100
|
+
mode: string | null;
|
|
101
|
+
metadata: Record<string, unknown> | null;
|
|
102
|
+
createdAt: string | null;
|
|
103
|
+
updatedAt: string | null;
|
|
104
|
+
}
|
|
105
|
+
interface AdminMessage {
|
|
106
|
+
id: string;
|
|
107
|
+
threadId: string;
|
|
108
|
+
senderUserId: string | null;
|
|
109
|
+
senderId: string | null;
|
|
110
|
+
senderType: "agent" | "user" | "system" | "tool";
|
|
111
|
+
targetId: string | null;
|
|
112
|
+
content: string | null;
|
|
113
|
+
toolCallId: string | null;
|
|
114
|
+
toolCalls: unknown[] | null;
|
|
115
|
+
reasoning: string | null;
|
|
116
|
+
metadata: Record<string, unknown> | null;
|
|
117
|
+
createdAt: string | null;
|
|
118
|
+
updatedAt: string | null;
|
|
119
|
+
}
|
|
120
|
+
interface AdminMessagePageInfo {
|
|
121
|
+
hasMoreBefore: boolean;
|
|
122
|
+
oldestMessageId: string | null;
|
|
123
|
+
newestMessageId: string | null;
|
|
124
|
+
}
|
|
125
|
+
interface AdminMessagePage {
|
|
126
|
+
data: AdminMessage[];
|
|
127
|
+
pageInfo: AdminMessagePageInfo;
|
|
128
|
+
}
|
|
87
129
|
interface AdminFilters {
|
|
88
130
|
namespace?: string;
|
|
89
131
|
range?: AdminDatePreset;
|
|
@@ -130,6 +172,8 @@ interface AdminConfig {
|
|
|
130
172
|
configured?: string;
|
|
131
173
|
unconfigured?: string;
|
|
132
174
|
noResults?: string;
|
|
175
|
+
eventsTitle?: string;
|
|
176
|
+
dashboardTitle?: string;
|
|
133
177
|
};
|
|
134
178
|
features?: {
|
|
135
179
|
showOverview?: boolean;
|
|
@@ -137,27 +181,37 @@ interface AdminConfig {
|
|
|
137
181
|
showThreads?: boolean;
|
|
138
182
|
showParticipants?: boolean;
|
|
139
183
|
showAgents?: boolean;
|
|
184
|
+
showEvents?: boolean;
|
|
140
185
|
};
|
|
141
186
|
ui?: {
|
|
142
187
|
compact?: boolean;
|
|
143
188
|
maxActivityBars?: number;
|
|
144
189
|
};
|
|
190
|
+
sidebar?: {
|
|
191
|
+
defaultOpen?: boolean;
|
|
192
|
+
collapsible?: "icon" | "offcanvas" | "none";
|
|
193
|
+
};
|
|
145
194
|
baseUrl?: string;
|
|
146
195
|
getRequestHeaders?: RequestHeadersProvider;
|
|
147
196
|
namespace?: string;
|
|
148
197
|
initialRange?: AdminDatePreset;
|
|
149
198
|
initialInterval?: AdminActivityInterval;
|
|
199
|
+
defaultPage?: AdminPage;
|
|
200
|
+
onNavigate?: (route: AdminRoute) => void;
|
|
150
201
|
}
|
|
151
202
|
interface ResolvedAdminConfig {
|
|
152
203
|
branding: Required<NonNullable<AdminConfig["branding"]>>;
|
|
153
204
|
labels: Required<NonNullable<AdminConfig["labels"]>>;
|
|
154
205
|
features: Required<NonNullable<AdminConfig["features"]>>;
|
|
155
206
|
ui: Required<NonNullable<AdminConfig["ui"]>>;
|
|
207
|
+
sidebar: Required<NonNullable<AdminConfig["sidebar"]>>;
|
|
156
208
|
baseUrl: string;
|
|
157
209
|
getRequestHeaders: RequestHeadersProvider;
|
|
158
210
|
namespace: string;
|
|
159
211
|
initialRange: AdminDatePreset;
|
|
160
212
|
initialInterval: AdminActivityInterval;
|
|
213
|
+
defaultPage: AdminPage;
|
|
214
|
+
onNavigate: ((route: AdminRoute) => void) | null;
|
|
161
215
|
}
|
|
162
216
|
interface AdminSectionState {
|
|
163
217
|
overview: AdminOverview | null;
|
|
@@ -187,28 +241,17 @@ declare const CopilotzAdmin: React.FC<CopilotzAdminProps>;
|
|
|
187
241
|
|
|
188
242
|
declare function useCopilotzAdmin(options?: UseCopilotzAdminOptions): UseCopilotzAdminResult;
|
|
189
243
|
|
|
190
|
-
|
|
191
|
-
baseUrl?: string;
|
|
192
|
-
getRequestHeaders?: RequestHeadersProvider;
|
|
193
|
-
}): Promise<AdminOverview>;
|
|
194
|
-
declare function fetchAdminActivity(range: AdminDatePreset, interval: AdminActivityInterval, namespace?: string, options?: {
|
|
195
|
-
baseUrl?: string;
|
|
196
|
-
getRequestHeaders?: RequestHeadersProvider;
|
|
197
|
-
}): Promise<AdminActivityPoint[]>;
|
|
198
|
-
declare function fetchAdminThreads(search?: string, namespace?: string, options?: {
|
|
199
|
-
baseUrl?: string;
|
|
200
|
-
getRequestHeaders?: RequestHeadersProvider;
|
|
201
|
-
}): Promise<AdminThreadSummary[]>;
|
|
202
|
-
declare function fetchAdminParticipants(search?: string, namespace?: string, options?: {
|
|
244
|
+
interface FetchOptions {
|
|
203
245
|
baseUrl?: string;
|
|
204
246
|
getRequestHeaders?: RequestHeadersProvider;
|
|
205
|
-
}
|
|
206
|
-
declare function
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
247
|
+
}
|
|
248
|
+
declare function fetchAdminOverview(range: AdminDatePreset, namespace?: string, options?: FetchOptions): Promise<AdminOverview>;
|
|
249
|
+
declare function fetchAdminActivity(range: AdminDatePreset, interval: AdminActivityInterval, namespace?: string, options?: FetchOptions): Promise<AdminActivityPoint[]>;
|
|
250
|
+
declare function fetchAdminThreads(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminThreadSummary[]>;
|
|
251
|
+
declare function fetchAdminParticipants(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminParticipantSummary[]>;
|
|
252
|
+
declare function fetchAdminAgents(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminAgentSummary[]>;
|
|
210
253
|
|
|
211
254
|
declare const defaultAdminConfig: ResolvedAdminConfig;
|
|
212
|
-
declare function mergeAdminConfig(_baseConfig:
|
|
255
|
+
declare function mergeAdminConfig(_baseConfig: ResolvedAdminConfig, userConfig?: Partial<AdminConfig>): ResolvedAdminConfig;
|
|
213
256
|
|
|
214
|
-
export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminOverview, type AdminParticipantSummary, type AdminSectionState, type AdminThreadSummary, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, defaultAdminConfig, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, mergeAdminConfig, useCopilotzAdmin };
|
|
257
|
+
export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminOverview, type AdminPage, type AdminParticipantSummary, type AdminRoute, type AdminSectionState, type AdminThreadDetail, type AdminThreadSummary, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, defaultAdminConfig, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, mergeAdminConfig, useCopilotzAdmin };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ 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 AdminPage = "dashboard" | "threads" | "thread-detail" | "participants" | "agents" | "events";
|
|
7
|
+
interface AdminRoute {
|
|
8
|
+
page: AdminPage;
|
|
9
|
+
resourceId?: string;
|
|
10
|
+
}
|
|
6
11
|
interface AdminOverview {
|
|
7
12
|
threadTotals: {
|
|
8
13
|
total: number;
|
|
@@ -84,6 +89,43 @@ interface AdminAgentSummary {
|
|
|
84
89
|
totalTokens: number;
|
|
85
90
|
lastActivityAt: string | null;
|
|
86
91
|
}
|
|
92
|
+
interface AdminThreadDetail {
|
|
93
|
+
id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
externalId: string | null;
|
|
96
|
+
description: string | null;
|
|
97
|
+
participants: string[] | null;
|
|
98
|
+
status: string;
|
|
99
|
+
summary: string | null;
|
|
100
|
+
mode: string | null;
|
|
101
|
+
metadata: Record<string, unknown> | null;
|
|
102
|
+
createdAt: string | null;
|
|
103
|
+
updatedAt: string | null;
|
|
104
|
+
}
|
|
105
|
+
interface AdminMessage {
|
|
106
|
+
id: string;
|
|
107
|
+
threadId: string;
|
|
108
|
+
senderUserId: string | null;
|
|
109
|
+
senderId: string | null;
|
|
110
|
+
senderType: "agent" | "user" | "system" | "tool";
|
|
111
|
+
targetId: string | null;
|
|
112
|
+
content: string | null;
|
|
113
|
+
toolCallId: string | null;
|
|
114
|
+
toolCalls: unknown[] | null;
|
|
115
|
+
reasoning: string | null;
|
|
116
|
+
metadata: Record<string, unknown> | null;
|
|
117
|
+
createdAt: string | null;
|
|
118
|
+
updatedAt: string | null;
|
|
119
|
+
}
|
|
120
|
+
interface AdminMessagePageInfo {
|
|
121
|
+
hasMoreBefore: boolean;
|
|
122
|
+
oldestMessageId: string | null;
|
|
123
|
+
newestMessageId: string | null;
|
|
124
|
+
}
|
|
125
|
+
interface AdminMessagePage {
|
|
126
|
+
data: AdminMessage[];
|
|
127
|
+
pageInfo: AdminMessagePageInfo;
|
|
128
|
+
}
|
|
87
129
|
interface AdminFilters {
|
|
88
130
|
namespace?: string;
|
|
89
131
|
range?: AdminDatePreset;
|
|
@@ -130,6 +172,8 @@ interface AdminConfig {
|
|
|
130
172
|
configured?: string;
|
|
131
173
|
unconfigured?: string;
|
|
132
174
|
noResults?: string;
|
|
175
|
+
eventsTitle?: string;
|
|
176
|
+
dashboardTitle?: string;
|
|
133
177
|
};
|
|
134
178
|
features?: {
|
|
135
179
|
showOverview?: boolean;
|
|
@@ -137,27 +181,37 @@ interface AdminConfig {
|
|
|
137
181
|
showThreads?: boolean;
|
|
138
182
|
showParticipants?: boolean;
|
|
139
183
|
showAgents?: boolean;
|
|
184
|
+
showEvents?: boolean;
|
|
140
185
|
};
|
|
141
186
|
ui?: {
|
|
142
187
|
compact?: boolean;
|
|
143
188
|
maxActivityBars?: number;
|
|
144
189
|
};
|
|
190
|
+
sidebar?: {
|
|
191
|
+
defaultOpen?: boolean;
|
|
192
|
+
collapsible?: "icon" | "offcanvas" | "none";
|
|
193
|
+
};
|
|
145
194
|
baseUrl?: string;
|
|
146
195
|
getRequestHeaders?: RequestHeadersProvider;
|
|
147
196
|
namespace?: string;
|
|
148
197
|
initialRange?: AdminDatePreset;
|
|
149
198
|
initialInterval?: AdminActivityInterval;
|
|
199
|
+
defaultPage?: AdminPage;
|
|
200
|
+
onNavigate?: (route: AdminRoute) => void;
|
|
150
201
|
}
|
|
151
202
|
interface ResolvedAdminConfig {
|
|
152
203
|
branding: Required<NonNullable<AdminConfig["branding"]>>;
|
|
153
204
|
labels: Required<NonNullable<AdminConfig["labels"]>>;
|
|
154
205
|
features: Required<NonNullable<AdminConfig["features"]>>;
|
|
155
206
|
ui: Required<NonNullable<AdminConfig["ui"]>>;
|
|
207
|
+
sidebar: Required<NonNullable<AdminConfig["sidebar"]>>;
|
|
156
208
|
baseUrl: string;
|
|
157
209
|
getRequestHeaders: RequestHeadersProvider;
|
|
158
210
|
namespace: string;
|
|
159
211
|
initialRange: AdminDatePreset;
|
|
160
212
|
initialInterval: AdminActivityInterval;
|
|
213
|
+
defaultPage: AdminPage;
|
|
214
|
+
onNavigate: ((route: AdminRoute) => void) | null;
|
|
161
215
|
}
|
|
162
216
|
interface AdminSectionState {
|
|
163
217
|
overview: AdminOverview | null;
|
|
@@ -187,28 +241,17 @@ declare const CopilotzAdmin: React.FC<CopilotzAdminProps>;
|
|
|
187
241
|
|
|
188
242
|
declare function useCopilotzAdmin(options?: UseCopilotzAdminOptions): UseCopilotzAdminResult;
|
|
189
243
|
|
|
190
|
-
|
|
191
|
-
baseUrl?: string;
|
|
192
|
-
getRequestHeaders?: RequestHeadersProvider;
|
|
193
|
-
}): Promise<AdminOverview>;
|
|
194
|
-
declare function fetchAdminActivity(range: AdminDatePreset, interval: AdminActivityInterval, namespace?: string, options?: {
|
|
195
|
-
baseUrl?: string;
|
|
196
|
-
getRequestHeaders?: RequestHeadersProvider;
|
|
197
|
-
}): Promise<AdminActivityPoint[]>;
|
|
198
|
-
declare function fetchAdminThreads(search?: string, namespace?: string, options?: {
|
|
199
|
-
baseUrl?: string;
|
|
200
|
-
getRequestHeaders?: RequestHeadersProvider;
|
|
201
|
-
}): Promise<AdminThreadSummary[]>;
|
|
202
|
-
declare function fetchAdminParticipants(search?: string, namespace?: string, options?: {
|
|
244
|
+
interface FetchOptions {
|
|
203
245
|
baseUrl?: string;
|
|
204
246
|
getRequestHeaders?: RequestHeadersProvider;
|
|
205
|
-
}
|
|
206
|
-
declare function
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
247
|
+
}
|
|
248
|
+
declare function fetchAdminOverview(range: AdminDatePreset, namespace?: string, options?: FetchOptions): Promise<AdminOverview>;
|
|
249
|
+
declare function fetchAdminActivity(range: AdminDatePreset, interval: AdminActivityInterval, namespace?: string, options?: FetchOptions): Promise<AdminActivityPoint[]>;
|
|
250
|
+
declare function fetchAdminThreads(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminThreadSummary[]>;
|
|
251
|
+
declare function fetchAdminParticipants(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminParticipantSummary[]>;
|
|
252
|
+
declare function fetchAdminAgents(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminAgentSummary[]>;
|
|
210
253
|
|
|
211
254
|
declare const defaultAdminConfig: ResolvedAdminConfig;
|
|
212
|
-
declare function mergeAdminConfig(_baseConfig:
|
|
255
|
+
declare function mergeAdminConfig(_baseConfig: ResolvedAdminConfig, userConfig?: Partial<AdminConfig>): ResolvedAdminConfig;
|
|
213
256
|
|
|
214
|
-
export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminOverview, type AdminParticipantSummary, type AdminSectionState, type AdminThreadSummary, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, defaultAdminConfig, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, mergeAdminConfig, useCopilotzAdmin };
|
|
257
|
+
export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminOverview, type AdminPage, type AdminParticipantSummary, type AdminRoute, type AdminSectionState, type AdminThreadDetail, type AdminThreadSummary, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, defaultAdminConfig, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, mergeAdminConfig, useCopilotzAdmin };
|