@ezychat/web 0.1.59 → 0.1.61

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.
Files changed (39) hide show
  1. package/dist-lib/chunks/admin-DJH4L6VN.js +896 -0
  2. package/dist-lib/chunks/admin-i6F-0wNq.js +897 -0
  3. package/dist-lib/chunks/{inbox-Dn_zMX5x.js → inbox-DI6Z9gdw.js} +28 -3
  4. package/dist-lib/chunks/{inbox-CostSOFa.js → inbox-hT-ebVtf.js} +28 -3
  5. package/dist-lib/ezychat-web.css +1 -1
  6. package/dist-lib/index.js +12487 -8177
  7. package/dist-lib/types/admin/AdminLayout.d.ts +8 -0
  8. package/dist-lib/types/admin/AgentGroupsCard.d.ts +16 -0
  9. package/dist-lib/types/admin/ReportCharts.d.ts +48 -0
  10. package/dist-lib/types/admin/ReportsPage.d.ts +13 -0
  11. package/dist-lib/types/admin/connectors/AgentConnectorsCard.d.ts +8 -0
  12. package/dist-lib/types/admin/connectors/AgentPicker.d.ts +9 -0
  13. package/dist-lib/types/admin/connectors/BookingSettingsCard.d.ts +13 -0
  14. package/dist-lib/types/admin/connectors/ConnectorDetailPage.d.ts +8 -0
  15. package/dist-lib/types/admin/connectors/ConnectorsGalleryPage.d.ts +7 -0
  16. package/dist-lib/types/admin/connectors/GoogleCalendarAccountCard.d.ts +7 -0
  17. package/dist-lib/types/admin/connectors/PartnerConnectionCard.d.ts +10 -0
  18. package/dist-lib/types/admin/connectors/PartnerConnectorPage.d.ts +8 -0
  19. package/dist-lib/types/admin/connectors/PartnerSettingsCard.d.ts +18 -0
  20. package/dist-lib/types/admin/connectors/catalog.d.ts +41 -0
  21. package/dist-lib/types/admin/connectors/connector-ui.d.ts +49 -0
  22. package/dist-lib/types/admin/connectors/list.d.ts +14 -0
  23. package/dist-lib/types/api/ai-groups.d.ts +53 -0
  24. package/dist-lib/types/api/ai.d.ts +18 -6
  25. package/dist-lib/types/api/connector-list.d.ts +428 -0
  26. package/dist-lib/types/api/connectors.d.ts +106 -0
  27. package/dist-lib/types/api/queries.d.ts +60 -1
  28. package/dist-lib/types/api/reply-suggestions.d.ts +1 -1
  29. package/dist-lib/types/api/voice.d.ts +2 -2
  30. package/dist-lib/types/extensions/types.d.ts +7 -1
  31. package/dist-lib/types/i18n/resources.d.ts +539 -0
  32. package/dist-lib/types/inbox/ConversationHeader.d.ts +4 -2
  33. package/dist-lib/types/inbox/GroupAiRow.d.ts +16 -0
  34. package/dist-lib/types/inbox/GroupPanel.d.ts +3 -1
  35. package/dist-lib/types/lib/format.d.ts +5 -0
  36. package/dist-lib/types/lib/links.d.ts +9 -0
  37. package/package.json +2 -2
  38. package/dist-lib/chunks/admin-BfXPHTDq.js +0 -779
  39. package/dist-lib/chunks/admin-BzKDTnlu.js +0 -780
@@ -0,0 +1,428 @@
1
+ import { ConnectorProblem } from '@ezychat/shared';
2
+ /**
3
+ * Admin → Connectors from the connector list (design docs/features/connector-list/design.md):
4
+ * the list the server keeps, and partner (MCP) connections. Admins only; keys, tokens and secrets
5
+ * never come back to the browser (only the key end).
6
+ */
7
+ export declare const connectorListKey: readonly ["connectors", "list"];
8
+ export declare const connectorAgentKey: (id: string, agentId: number) => readonly ["connectors", "mcp", string, "agent", number];
9
+ /** The list as the server keeps it (no download). */
10
+ export declare function useConnectorGallery(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
11
+ status: {
12
+ state: "offline" | "loaded" | "rejected" | "builtin";
13
+ generatedAt: string | null;
14
+ sequence: number | null;
15
+ checkedAt: number | null;
16
+ appVersion: string;
17
+ hidden: number;
18
+ };
19
+ connectors: {
20
+ entry: {
21
+ id: string;
22
+ schemaVersion: 1;
23
+ minAppVersion: string;
24
+ kind: "mcp" | "builtin" | "coming_soon";
25
+ editions: ("lite" | "enterprise")[];
26
+ name: string;
27
+ summary: {
28
+ en: string;
29
+ ms?: string | undefined;
30
+ 'zh-CN'?: string | undefined;
31
+ };
32
+ description: {
33
+ en: string;
34
+ ms?: string | undefined;
35
+ 'zh-CN'?: string | undefined;
36
+ };
37
+ category: "custom" | "other" | "calendar" | "accounting" | "crm" | "spreadsheets" | "payments" | "online_shop";
38
+ builtinId?: string | undefined;
39
+ icon?: {
40
+ file: string;
41
+ sha256: string;
42
+ size: number;
43
+ } | undefined;
44
+ publisher?: string | undefined;
45
+ homepage?: string | undefined;
46
+ privacy?: {
47
+ en: string;
48
+ ms?: string | undefined;
49
+ 'zh-CN'?: string | undefined;
50
+ } | undefined;
51
+ mcp?: {
52
+ url: string;
53
+ } | undefined;
54
+ auth?: {
55
+ type: "oauth";
56
+ scopes: string[];
57
+ clientId?: string | undefined;
58
+ } | {
59
+ type: "oauth_own_app";
60
+ scopes: string[];
61
+ help?: string | undefined;
62
+ } | {
63
+ type: "api_key";
64
+ label: {
65
+ en: string;
66
+ ms?: string | undefined;
67
+ 'zh-CN'?: string | undefined;
68
+ };
69
+ header: {
70
+ name: string;
71
+ value: string;
72
+ };
73
+ help?: string | undefined;
74
+ } | {
75
+ type: "credentials";
76
+ fields: {
77
+ id: string;
78
+ label: {
79
+ en: string;
80
+ ms?: string | undefined;
81
+ 'zh-CN'?: string | undefined;
82
+ };
83
+ secret: boolean;
84
+ hint?: {
85
+ en: string;
86
+ ms?: string | undefined;
87
+ 'zh-CN'?: string | undefined;
88
+ } | undefined;
89
+ }[];
90
+ headers: {
91
+ name: string;
92
+ value: string;
93
+ }[];
94
+ help?: string | undefined;
95
+ } | {
96
+ type: "none";
97
+ } | undefined;
98
+ tools?: {
99
+ name: string;
100
+ title: {
101
+ en: string;
102
+ ms?: string | undefined;
103
+ 'zh-CN'?: string | undefined;
104
+ };
105
+ description: {
106
+ en: string;
107
+ ms?: string | undefined;
108
+ 'zh-CN'?: string | undefined;
109
+ };
110
+ access: "read" | "write";
111
+ instructions?: {
112
+ en: string;
113
+ ms?: string | undefined;
114
+ 'zh-CN'?: string | undefined;
115
+ } | undefined;
116
+ guards?: {
117
+ confirmFirst?: boolean | undefined;
118
+ valueFrom?: Record<string, string> | undefined;
119
+ fromCustomer?: string[] | undefined;
120
+ within?: Record<string, string> | undefined;
121
+ limits?: {
122
+ perChat?: number | undefined;
123
+ perDay?: number | undefined;
124
+ } | undefined;
125
+ } | undefined;
126
+ }[] | undefined;
127
+ skill?: {
128
+ en: string;
129
+ ms?: string | undefined;
130
+ 'zh-CN'?: string | undefined;
131
+ } | undefined;
132
+ settings?: {
133
+ id: string;
134
+ type: "number" | "days" | "text" | "select" | "toggle" | "timeRange" | "calendarPicker";
135
+ label: {
136
+ en: string;
137
+ ms?: string | undefined;
138
+ 'zh-CN'?: string | undefined;
139
+ };
140
+ hint?: {
141
+ en: string;
142
+ ms?: string | undefined;
143
+ 'zh-CN'?: string | undefined;
144
+ } | undefined;
145
+ options?: {
146
+ value: string;
147
+ label: {
148
+ en: string;
149
+ ms?: string | undefined;
150
+ 'zh-CN'?: string | undefined;
151
+ };
152
+ }[] | undefined;
153
+ default?: unknown;
154
+ from?: string | undefined;
155
+ required?: boolean | undefined;
156
+ }[] | undefined;
157
+ vote?: {
158
+ en: string;
159
+ ms?: string | undefined;
160
+ 'zh-CN'?: string | undefined;
161
+ } | undefined;
162
+ stage?: "beta" | undefined;
163
+ notice?: {
164
+ en: string;
165
+ ms?: string | undefined;
166
+ 'zh-CN'?: string | undefined;
167
+ } | undefined;
168
+ };
169
+ fit: "ok" | "enterprise" | "needsUpdate";
170
+ delisted: boolean;
171
+ connection: {
172
+ state: "connected" | "waiting" | "disconnected" | "unreachable" | "needs_sign_in";
173
+ account: string | null;
174
+ keyEnd: string | null;
175
+ connectedAt: number | null;
176
+ fields: Record<string, string>;
177
+ } | null;
178
+ }[];
179
+ }, Error>;
180
+ /** Downloads and checks the list now (gallery open, Check for new connectors). */
181
+ export declare function useRefreshConnectorList(): import("@tanstack/react-query").UseMutationResult<{
182
+ status: {
183
+ state: "offline" | "loaded" | "rejected" | "builtin";
184
+ generatedAt: string | null;
185
+ sequence: number | null;
186
+ checkedAt: number | null;
187
+ appVersion: string;
188
+ hidden: number;
189
+ };
190
+ connectors: {
191
+ entry: {
192
+ id: string;
193
+ schemaVersion: 1;
194
+ minAppVersion: string;
195
+ kind: "mcp" | "builtin" | "coming_soon";
196
+ editions: ("lite" | "enterprise")[];
197
+ name: string;
198
+ summary: {
199
+ en: string;
200
+ ms?: string | undefined;
201
+ 'zh-CN'?: string | undefined;
202
+ };
203
+ description: {
204
+ en: string;
205
+ ms?: string | undefined;
206
+ 'zh-CN'?: string | undefined;
207
+ };
208
+ category: "custom" | "other" | "calendar" | "accounting" | "crm" | "spreadsheets" | "payments" | "online_shop";
209
+ builtinId?: string | undefined;
210
+ icon?: {
211
+ file: string;
212
+ sha256: string;
213
+ size: number;
214
+ } | undefined;
215
+ publisher?: string | undefined;
216
+ homepage?: string | undefined;
217
+ privacy?: {
218
+ en: string;
219
+ ms?: string | undefined;
220
+ 'zh-CN'?: string | undefined;
221
+ } | undefined;
222
+ mcp?: {
223
+ url: string;
224
+ } | undefined;
225
+ auth?: {
226
+ type: "oauth";
227
+ scopes: string[];
228
+ clientId?: string | undefined;
229
+ } | {
230
+ type: "oauth_own_app";
231
+ scopes: string[];
232
+ help?: string | undefined;
233
+ } | {
234
+ type: "api_key";
235
+ label: {
236
+ en: string;
237
+ ms?: string | undefined;
238
+ 'zh-CN'?: string | undefined;
239
+ };
240
+ header: {
241
+ name: string;
242
+ value: string;
243
+ };
244
+ help?: string | undefined;
245
+ } | {
246
+ type: "credentials";
247
+ fields: {
248
+ id: string;
249
+ label: {
250
+ en: string;
251
+ ms?: string | undefined;
252
+ 'zh-CN'?: string | undefined;
253
+ };
254
+ secret: boolean;
255
+ hint?: {
256
+ en: string;
257
+ ms?: string | undefined;
258
+ 'zh-CN'?: string | undefined;
259
+ } | undefined;
260
+ }[];
261
+ headers: {
262
+ name: string;
263
+ value: string;
264
+ }[];
265
+ help?: string | undefined;
266
+ } | {
267
+ type: "none";
268
+ } | undefined;
269
+ tools?: {
270
+ name: string;
271
+ title: {
272
+ en: string;
273
+ ms?: string | undefined;
274
+ 'zh-CN'?: string | undefined;
275
+ };
276
+ description: {
277
+ en: string;
278
+ ms?: string | undefined;
279
+ 'zh-CN'?: string | undefined;
280
+ };
281
+ access: "read" | "write";
282
+ instructions?: {
283
+ en: string;
284
+ ms?: string | undefined;
285
+ 'zh-CN'?: string | undefined;
286
+ } | undefined;
287
+ guards?: {
288
+ confirmFirst?: boolean | undefined;
289
+ valueFrom?: Record<string, string> | undefined;
290
+ fromCustomer?: string[] | undefined;
291
+ within?: Record<string, string> | undefined;
292
+ limits?: {
293
+ perChat?: number | undefined;
294
+ perDay?: number | undefined;
295
+ } | undefined;
296
+ } | undefined;
297
+ }[] | undefined;
298
+ skill?: {
299
+ en: string;
300
+ ms?: string | undefined;
301
+ 'zh-CN'?: string | undefined;
302
+ } | undefined;
303
+ settings?: {
304
+ id: string;
305
+ type: "number" | "days" | "text" | "select" | "toggle" | "timeRange" | "calendarPicker";
306
+ label: {
307
+ en: string;
308
+ ms?: string | undefined;
309
+ 'zh-CN'?: string | undefined;
310
+ };
311
+ hint?: {
312
+ en: string;
313
+ ms?: string | undefined;
314
+ 'zh-CN'?: string | undefined;
315
+ } | undefined;
316
+ options?: {
317
+ value: string;
318
+ label: {
319
+ en: string;
320
+ ms?: string | undefined;
321
+ 'zh-CN'?: string | undefined;
322
+ };
323
+ }[] | undefined;
324
+ default?: unknown;
325
+ from?: string | undefined;
326
+ required?: boolean | undefined;
327
+ }[] | undefined;
328
+ vote?: {
329
+ en: string;
330
+ ms?: string | undefined;
331
+ 'zh-CN'?: string | undefined;
332
+ } | undefined;
333
+ stage?: "beta" | undefined;
334
+ notice?: {
335
+ en: string;
336
+ ms?: string | undefined;
337
+ 'zh-CN'?: string | undefined;
338
+ } | undefined;
339
+ };
340
+ fit: "ok" | "enterprise" | "needsUpdate";
341
+ delisted: boolean;
342
+ connection: {
343
+ state: "connected" | "waiting" | "disconnected" | "unreachable" | "needs_sign_in";
344
+ account: string | null;
345
+ keyEnd: string | null;
346
+ connectedAt: number | null;
347
+ fields: Record<string, string>;
348
+ } | null;
349
+ }[];
350
+ }, Error, void, unknown>;
351
+ /**
352
+ * Connects: OAuth answers with `authorizationUrl` + `requestId` (open it, then poll); the key and
353
+ * form sign-ins send their `fields` and answer with the connection.
354
+ */
355
+ export declare function useConnectorConnect(id: string): import("@tanstack/react-query").UseMutationResult<{
356
+ authorizationUrl: string | null;
357
+ requestId: string | null;
358
+ connection: {
359
+ state: "connected" | "waiting" | "disconnected" | "unreachable" | "needs_sign_in";
360
+ account: string | null;
361
+ keyEnd: string | null;
362
+ connectedAt: number | null;
363
+ fields: Record<string, string>;
364
+ };
365
+ }, Error, {
366
+ fields: Record<string, string>;
367
+ }, unknown>;
368
+ /** Polls an OAuth sign-in every 2 s until the partner sent the person back or it failed. */
369
+ export declare function useConnectorConnectProgress(id: string, requestId: string | null): import("@tanstack/react-query").UseQueryResult<{
370
+ status: "pending" | "failed" | "done";
371
+ problem: "expired" | "unreachable" | "refused" | "cancelled" | "not_https" | "private_address" | "missing_tools" | null;
372
+ }, Error>;
373
+ /** The connector problem an API error carries as its code (refused, unreachable, …), if any. */
374
+ export declare function connectorProblemOf(error: unknown): ConnectorProblem | null;
375
+ /**
376
+ * Tests the typed fields (before Save) or, with no fields, the saved connection. A failure the
377
+ * server names (`{ error: { code: <problem> } }`) comes back as a result, like `ok: false`.
378
+ */
379
+ export declare function useConnectorTest(id: string): import("@tanstack/react-query").UseMutationResult<{
380
+ ok: boolean;
381
+ tools: string[];
382
+ problem: "expired" | "unreachable" | "refused" | "cancelled" | "not_https" | "private_address" | "missing_tools" | null;
383
+ }, Error, {
384
+ fields: Record<string, string>;
385
+ }, unknown>;
386
+ export declare function useConnectorDisconnect(id: string): import("@tanstack/react-query").UseMutationResult<{
387
+ state: "connected" | "waiting" | "disconnected" | "unreachable" | "needs_sign_in";
388
+ account: string | null;
389
+ keyEnd: string | null;
390
+ connectedAt: number | null;
391
+ fields: Record<string, string>;
392
+ }, Error, void, unknown>;
393
+ /** One AI agent's settings values and tool switches for a partner connector. */
394
+ export declare function useConnectorAgentSettings(id: string, agentId: number, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
395
+ settings: Record<string, unknown>;
396
+ tools: Record<string, boolean>;
397
+ }, Error>;
398
+ /** The same for several connectors at once (the agent page's Connectors card). */
399
+ export declare function useConnectorsAgentSettings(ids: readonly string[], agentId: number): import("@tanstack/react-query").UseQueryResult<{
400
+ settings: Record<string, unknown>;
401
+ tools: Record<string, boolean>;
402
+ }, Error>[];
403
+ export declare function useSaveConnectorAgentSettings(id: string, agentId: number): import("@tanstack/react-query").UseMutationResult<{
404
+ settings: Record<string, unknown>;
405
+ tools: Record<string, boolean>;
406
+ }, Error, {
407
+ settings: Record<string, unknown>;
408
+ tools: Record<string, boolean>;
409
+ }, unknown>;
410
+ /** What the AI looked up and did through the connector (never chat text). */
411
+ export declare function useConnectorActivity(id: string, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
412
+ activity: {
413
+ id: number;
414
+ at: number;
415
+ kind: "failed" | "done" | "checked" | "refused";
416
+ agentName: string;
417
+ customer: string;
418
+ tool: string;
419
+ reason: "limit" | "unreachable" | "needs_sign_in" | "within" | "confirm_first" | "value_from" | "from_customer" | "partner_error" | null;
420
+ }[];
421
+ }, Error>;
422
+ /** The choices of a picker setting, read from the partner through its look-up tool. */
423
+ export declare function useConnectorChoices(id: string, settingId: string, agentId: number, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
424
+ options: {
425
+ value: string;
426
+ label: string;
427
+ }[];
428
+ }, Error>;
@@ -0,0 +1,106 @@
1
+ /** Admin → Connectors → Google Calendar (admins only). Tokens never reach the browser. */
2
+ export declare const googleCalendarKey: readonly ["connectors", "google-calendar"];
3
+ export declare const bookingSettingsKey: (agentId: number) => readonly ["connectors", "google-calendar", "agent", number];
4
+ export declare const calendarActivityKey: readonly ["connectors", "google-calendar", "activity"];
5
+ export declare const calendarBookingsKey: readonly ["connectors", "google-calendar", "bookings"];
6
+ export declare function useGoogleCalendar(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
7
+ state: "unavailable" | "connected" | "expired" | "disconnected" | "not_configured";
8
+ account: string | null;
9
+ calendars: {
10
+ id: string;
11
+ name: string;
12
+ primary: boolean;
13
+ readOnly: boolean;
14
+ }[];
15
+ connectedAt: number | null;
16
+ problemSince: number | null;
17
+ }, Error>;
18
+ /** Starts Google's sign-in: the page opens `authorizationUrl` and polls the request. */
19
+ export declare function useGoogleCalendarConnect(): import("@tanstack/react-query").UseMutationResult<{
20
+ requestId: string;
21
+ authorizationUrl: string;
22
+ }, Error, void, unknown>;
23
+ /** Polls a sign-in every 2 s until Google sent the person back (done) or it failed. */
24
+ export declare function useGoogleCalendarProgress(requestId: string | null): import("@tanstack/react-query").UseQueryResult<{
25
+ status: "pending" | "failed" | "done";
26
+ error: "error" | "expired" | "denied" | null;
27
+ }, Error>;
28
+ export declare function useGoogleCalendarDisconnect(): import("@tanstack/react-query").UseMutationResult<unknown, Error, void, unknown>;
29
+ /** One AI agent's booking settings (the defaults until an admin saves them). */
30
+ export declare function useBookingSettings(agentId: number | null, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
31
+ calendarId: string | null;
32
+ checkFree: boolean;
33
+ book: boolean;
34
+ title: string;
35
+ lengthMin: number;
36
+ days: number[];
37
+ from: string;
38
+ to: string;
39
+ gapMin: number;
40
+ noticeHours: number;
41
+ maxDays: number;
42
+ }, Error>;
43
+ export declare function useSaveBookingSettings(agentId: number): import("@tanstack/react-query").UseMutationResult<{
44
+ calendarId: string | null;
45
+ checkFree: boolean;
46
+ book: boolean;
47
+ title: string;
48
+ lengthMin: number;
49
+ days: number[];
50
+ from: string;
51
+ to: string;
52
+ gapMin: number;
53
+ noticeHours: number;
54
+ maxDays: number;
55
+ }, Error, {
56
+ calendarId: string | null;
57
+ checkFree: boolean;
58
+ book: boolean;
59
+ title: string;
60
+ lengthMin: number;
61
+ days: number[];
62
+ from: string;
63
+ to: string;
64
+ gapMin: number;
65
+ noticeHours: number;
66
+ maxDays: number;
67
+ }, unknown>;
68
+ /** Bookings tab: the events the AI added (EzyChat's own records) and links into Google Calendar. */
69
+ export declare function useCalendarBookings(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
70
+ upcoming: {
71
+ id: number;
72
+ agentId: number;
73
+ agentName: string;
74
+ chatJid: string;
75
+ customer: string;
76
+ start: string;
77
+ end: string;
78
+ createdAt: number;
79
+ eventUrl: string;
80
+ }[];
81
+ past: {
82
+ id: number;
83
+ agentId: number;
84
+ agentName: string;
85
+ chatJid: string;
86
+ customer: string;
87
+ start: string;
88
+ end: string;
89
+ createdAt: number;
90
+ eventUrl: string;
91
+ }[];
92
+ calendarUrl: string | null;
93
+ }, Error>;
94
+ export declare function useCalendarActivity(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
95
+ activity: {
96
+ id: number;
97
+ at: number;
98
+ kind: "failed" | "checked" | "booked" | "handed_over";
99
+ agentId: number | null;
100
+ agentName: string;
101
+ chatJid: string | null;
102
+ customer: string;
103
+ start: string | null;
104
+ end: string | null;
105
+ }[];
106
+ }, Error>;
@@ -1,5 +1,5 @@
1
1
  import { type InfiniteData, type QueryClient } from '@tanstack/react-query';
2
- import { type CreateApiTokenBodyInput, type UpdateApiTokenBody, type Chat, type ChatListResponse, type ChatStatus, type DirectoryUser, type InboxStatusPayload, type Message, type MessageListResponse, type PatchUserBody, type Settings, type WaStatus } from '@ezychat/shared';
2
+ import { type ReportPeriod, type CreateApiTokenBodyInput, type UpdateApiTokenBody, type Chat, type ChatListResponse, type ChatStatus, type DirectoryUser, type InboxStatusPayload, type Message, type MessageListResponse, type PatchUserBody, type Settings, type WaStatus } from '@ezychat/shared';
3
3
  export interface ChatFilters {
4
4
  status?: ChatStatus;
5
5
  assigned: 'me' | 'none' | 'any';
@@ -15,6 +15,7 @@ export declare const qk: {
15
15
  chats: (f: ChatFilters) => readonly ["chats", ChatFilters];
16
16
  chatsAll: readonly ["chats"];
17
17
  openChatCount: readonly ["open-chat-count"];
18
+ report: (days: number) => readonly ["report", number];
18
19
  chat: (jid: string) => readonly ["chat", string];
19
20
  messages: (jid: string) => readonly ["messages", string];
20
21
  notes: (jid: string) => readonly ["notes", string];
@@ -174,6 +175,64 @@ export declare function useChat(jid: string | null | undefined): import("@tansta
174
175
  at: number;
175
176
  }[];
176
177
  }, Error>;
178
+ /** Admin → Reports for the last 7, 30 or 90 days (admins only). */
179
+ export declare function useReport(days: ReportPeriod): import("@tanstack/react-query").UseQueryResult<{
180
+ days: 7 | 30 | 90;
181
+ timeZone: string;
182
+ firstDate: string | null;
183
+ linkedDate: string | null;
184
+ totals: {
185
+ newCustomers: number;
186
+ messagesIn: number;
187
+ messagesOut: number;
188
+ activeChats: number;
189
+ medianFirstReplyMinutes: number | null;
190
+ missedLeads: number;
191
+ aiAnswered: number;
192
+ aiResolved: number;
193
+ aiHandoffs: number;
194
+ };
195
+ previous: {
196
+ newCustomers: number;
197
+ messagesIn: number;
198
+ messagesOut: number;
199
+ activeChats: number;
200
+ medianFirstReplyMinutes: number | null;
201
+ missedLeads: number;
202
+ aiAnswered: number;
203
+ aiResolved: number;
204
+ aiHandoffs: number;
205
+ } | null;
206
+ waitingAfterHandoff: {
207
+ count: number;
208
+ oldestAt: number | null;
209
+ };
210
+ daily: {
211
+ date: string;
212
+ inbound: number;
213
+ outbound: number;
214
+ newCustomers: number;
215
+ activeChats: number;
216
+ }[];
217
+ weekdays: {
218
+ weekday: number;
219
+ avgInbound: number;
220
+ avgChats: number;
221
+ }[];
222
+ hours: number[][];
223
+ handoffReasons: {
224
+ reason: string;
225
+ count: number;
226
+ }[];
227
+ team: {
228
+ userId: number | null;
229
+ name: string;
230
+ kind: "phone" | "human" | "ai";
231
+ chats: number;
232
+ replies: number;
233
+ medianReplyMinutes: number | null;
234
+ }[];
235
+ }, Error>;
177
236
  export declare function useOpenChatCount(): import("@tanstack/react-query").UseQueryResult<{
178
237
  openCount: number;
179
238
  }, Error>;
@@ -18,8 +18,8 @@ export declare function fetchSuggestions(jid: string, signal: AbortSignal): Prom
18
18
  /** The chat's phrase list, matched in the composer on every key (empty while suggestions are off). */
19
19
  export declare function usePhraseList(jid: string | null, enabled: boolean): import("@tanstack/react-query").UseQueryResult<{
20
20
  phrases: {
21
- text: string;
22
21
  id: number;
22
+ text: string;
23
23
  language: "en" | "ms" | "zh";
24
24
  }[];
25
25
  }, Error>;
@@ -7,7 +7,7 @@ export declare function useVoiceStatus(): import("@tanstack/react-query").UseQue
7
7
  state: "error" | "not_installed" | "downloading" | "installed";
8
8
  receivedBytes: number;
9
9
  totalBytes: number;
10
- error: "network" | "unknown" | "disk_space" | "verification" | "redirect" | "write" | null;
10
+ error: "network" | "unknown" | "write" | "disk_space" | "verification" | "redirect" | null;
11
11
  };
12
12
  cloudAvailable: boolean;
13
13
  }, Error>;
@@ -27,7 +27,7 @@ export declare function useVoiceAction(): import("@tanstack/react-query").UseMut
27
27
  state: "error" | "not_installed" | "downloading" | "installed";
28
28
  receivedBytes: number;
29
29
  totalBytes: number;
30
- error: "network" | "unknown" | "disk_space" | "verification" | "redirect" | "write" | null;
30
+ error: "network" | "unknown" | "write" | "disk_space" | "verification" | "redirect" | null;
31
31
  };
32
32
  cloudAvailable: boolean;
33
33
  }, Error, VoiceAction, unknown>;
@@ -36,7 +36,7 @@ export interface WebExtensionRoute {
36
36
  section?: WebExtensionAdminSection;
37
37
  }
38
38
  /** Core admin sections an extension admin route may sit under (the `ADMIN_NAV` paths). */
39
- export declare const WEB_EXTENSION_ADMIN_SECTIONS: readonly ["members", "quick-replies", "whatsapp", "inboxes", "tunnel", "settings", "audit"];
39
+ export declare const WEB_EXTENSION_ADMIN_SECTIONS: readonly ["reports", "members", "quick-replies", "connectors", "whatsapp", "inboxes", "tunnel", "settings", "audit"];
40
40
  export type WebExtensionAdminSection = (typeof WEB_EXTENSION_ADMIN_SECTIONS)[number];
41
41
  /** A small badge on an admin nav link: a count, or a dot that asks for attention. */
42
42
  export interface WebExtensionNavBadge {
@@ -152,6 +152,12 @@ export interface WebExtension {
152
152
  lockScreen?: ComponentType<WebExtensionLockScreenProps>;
153
153
  /** Inbox connection types (Admin → Inboxes, setup wizard); the first extension wins a duplicate. */
154
154
  inboxTypes?: WebExtensionInboxType[];
155
+ /**
156
+ * Admin → Connectors: connectors this extension provides, by catalog id (e.g. `custom-mcp`), each
157
+ * pointing at one of its admin pages (`/admin/ext/<name>/…`). The gallery card and the
158
+ * connector's page then open that page; the first extension wins a duplicate id.
159
+ */
160
+ connectorLinks?: Partial<Record<string, string>>;
155
161
  catalogs?: WebExtensionCatalogs;
156
162
  }
157
163
  export declare const EXTENSION_NAME_PATTERN: RegExp;