@ezychat/web 0.1.60 → 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.
- package/dist-lib/chunks/{admin-DiuGyOP6.js → admin-DJH4L6VN.js} +31 -3
- package/dist-lib/chunks/{admin-DPSjgyl3.js → admin-i6F-0wNq.js} +31 -3
- package/dist-lib/chunks/{inbox-B0UJDCp0.js → inbox-DI6Z9gdw.js} +25 -3
- package/dist-lib/chunks/{inbox-42E4FML_.js → inbox-hT-ebVtf.js} +25 -3
- package/dist-lib/ezychat-web.css +1 -1
- package/dist-lib/index.js +5438 -5008
- package/dist-lib/types/admin/AgentGroupsCard.d.ts +16 -0
- package/dist-lib/types/admin/connectors/connector-ui.d.ts +11 -0
- package/dist-lib/types/api/ai-groups.d.ts +53 -0
- package/dist-lib/types/api/ai.d.ts +11 -5
- package/dist-lib/types/api/connector-list.d.ts +12 -0
- package/dist-lib/types/i18n/resources.d.ts +53 -0
- package/dist-lib/types/inbox/ConversationHeader.d.ts +4 -2
- package/dist-lib/types/inbox/GroupAiRow.d.ts +16 -0
- package/dist-lib/types/inbox/GroupPanel.d.ts +3 -1
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Lite's only inbox keeps the name migration 014 gave inbox 1 (a product name, never translated). */
|
|
2
|
+
export declare const LITE_INBOX_NAME = "WhatsApp";
|
|
3
|
+
/**
|
|
4
|
+
* Agent page → Groups (design docs/features/ai-groups/design.md): the agent's "Answer in groups
|
|
5
|
+
* (when tagged or quoted)" switch and, when on, the groups of the agent's inbox, each with its own
|
|
6
|
+
* switch (new groups start off) and a link to the group chat. The same per-group switch is in the
|
|
7
|
+
* group's info panel.
|
|
8
|
+
*/
|
|
9
|
+
export declare function AgentGroupsCard({ agentId, name, agentEnabled, inboxName, }: Readonly<{
|
|
10
|
+
agentId: number;
|
|
11
|
+
name: string;
|
|
12
|
+
/** The agent's saved on/off. */
|
|
13
|
+
agentEnabled: boolean;
|
|
14
|
+
/** The name of the agent's inbox; null = the agent answers no inbox. */
|
|
15
|
+
inboxName: string | null;
|
|
16
|
+
}>): import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type LucideIcon } from 'lucide-react';
|
|
2
|
+
import { type ConnectorEntry } from '@ezychat/shared';
|
|
2
3
|
import type { ConnectorStatus } from './catalog';
|
|
3
4
|
/** Connector pages that web extensions provide, by catalog id (the first extension wins). */
|
|
4
5
|
export declare function useConnectorLinks(): Partial<Record<string, string>>;
|
|
@@ -6,6 +7,16 @@ export declare function useConnectorLinks(): Partial<Record<string, string>>;
|
|
|
6
7
|
export declare function ConnectorStatusBadge({ status }: {
|
|
7
8
|
status: ConnectorStatus;
|
|
8
9
|
}): import("react").JSX.Element | null;
|
|
10
|
+
/** "Beta" next to the status on cards and page headers, when the connector list marks the entry. */
|
|
11
|
+
export declare function BetaBadge({ show }: Readonly<{
|
|
12
|
+
show: boolean;
|
|
13
|
+
}>): import("react").JSX.Element | null;
|
|
14
|
+
/** The entry's notice from the connector list, above Connect; titled Beta for a beta entry. */
|
|
15
|
+
export declare function ConnectorNotice({ entry }: Readonly<{
|
|
16
|
+
entry: ConnectorEntry | null;
|
|
17
|
+
}>): import("react").JSX.Element | null;
|
|
18
|
+
/** The connector list's entry for one of the app's own connectors (e.g. its Beta mark and notice). */
|
|
19
|
+
export declare function useBuiltinEntry(builtinId: string): ConnectorEntry | null;
|
|
9
20
|
/**
|
|
10
21
|
* The connector's icon in a calm tile: the icon file from the connector list (served by the
|
|
11
22
|
* server, checked against the list's hash) or a Lucide icon (no brand logos in the app).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI agents in WhatsApp groups (design docs/features/ai-groups/design.md): the agent's "Answer in
|
|
3
|
+
* groups" switch with the groups of its inbox (admins), and each group's own switch.
|
|
4
|
+
*/
|
|
5
|
+
export declare const aiGroupsKey: readonly ["ai-groups"];
|
|
6
|
+
export declare const agentGroupsKey: (agentId: number) => readonly ["ai-groups", "agent", number];
|
|
7
|
+
export declare const groupChatAiKey: (jid: string) => readonly ["ai-groups", "chat", string];
|
|
8
|
+
export declare function useAgentGroups(agentId: number): import("@tanstack/react-query").UseQueryResult<{
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
inboxName: string | null;
|
|
11
|
+
groups: {
|
|
12
|
+
jid: string;
|
|
13
|
+
name: string;
|
|
14
|
+
memberCount: number | null;
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
paused: boolean;
|
|
17
|
+
}[];
|
|
18
|
+
loopGuard: number;
|
|
19
|
+
}, Error>;
|
|
20
|
+
export declare function useSetAnswerInGroups(agentId: number): import("@tanstack/react-query").UseMutationResult<{
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
inboxName: string | null;
|
|
23
|
+
groups: {
|
|
24
|
+
jid: string;
|
|
25
|
+
name: string;
|
|
26
|
+
memberCount: number | null;
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
paused: boolean;
|
|
29
|
+
}[];
|
|
30
|
+
loopGuard: number;
|
|
31
|
+
}, Error, boolean, unknown>;
|
|
32
|
+
/** Whether the AI answers tags and quotes in this group (anyone who may open the chat). */
|
|
33
|
+
export declare function useGroupChatAi(jid: string | null): import("@tanstack/react-query").UseQueryResult<{
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
agentId: number | null;
|
|
36
|
+
agentName: string | null;
|
|
37
|
+
agentEnabled: boolean;
|
|
38
|
+
agentAnswersGroups: boolean;
|
|
39
|
+
paused: boolean;
|
|
40
|
+
}, Error>;
|
|
41
|
+
/** Admins: switch one group on or off (Group info and the agent page list). */
|
|
42
|
+
export declare function useSetGroupChatAi(): import("@tanstack/react-query").UseMutationResult<{
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
agentId: number | null;
|
|
45
|
+
agentName: string | null;
|
|
46
|
+
agentEnabled: boolean;
|
|
47
|
+
agentAnswersGroups: boolean;
|
|
48
|
+
paused: boolean;
|
|
49
|
+
}, Error, {
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
} & {
|
|
52
|
+
jid: string;
|
|
53
|
+
}, unknown>;
|
|
@@ -19,9 +19,9 @@ export declare function useAiMember(): import("@tanstack/react-query").UseQueryR
|
|
|
19
19
|
inboxIds?: number[] | undefined;
|
|
20
20
|
} | null;
|
|
21
21
|
settings: {
|
|
22
|
+
enabled: boolean;
|
|
22
23
|
displayName: string;
|
|
23
24
|
mode: "api" | "chatgpt" | "claude";
|
|
24
|
-
enabled: boolean;
|
|
25
25
|
model: string;
|
|
26
26
|
instructions: string;
|
|
27
27
|
handoffRules?: string | undefined;
|
|
@@ -105,6 +105,11 @@ export declare function useAiTry(): import("@tanstack/react-query").UseMutationR
|
|
|
105
105
|
start?: string | undefined;
|
|
106
106
|
end?: string | undefined;
|
|
107
107
|
} | undefined;
|
|
108
|
+
group?: {
|
|
109
|
+
kind: "paused" | "answered" | "handover";
|
|
110
|
+
member: string | null;
|
|
111
|
+
quoted?: boolean | undefined;
|
|
112
|
+
} | undefined;
|
|
108
113
|
notRun?: boolean | undefined;
|
|
109
114
|
}[] | undefined;
|
|
110
115
|
}, Error, {
|
|
@@ -115,6 +120,7 @@ export declare function useAiTry(): import("@tanstack/react-query").UseMutationR
|
|
|
115
120
|
handoffRules?: string | undefined;
|
|
116
121
|
};
|
|
117
122
|
agentId?: number | undefined;
|
|
123
|
+
group?: boolean | undefined;
|
|
118
124
|
}, unknown>;
|
|
119
125
|
/**
|
|
120
126
|
* Edit with AI: a suggested rewrite of one box; nothing is saved (the page's Save does that).
|
|
@@ -181,9 +187,9 @@ export declare function useAiMemberAction(): import("@tanstack/react-query").Use
|
|
|
181
187
|
inboxIds?: number[] | undefined;
|
|
182
188
|
} | null;
|
|
183
189
|
settings: {
|
|
190
|
+
enabled: boolean;
|
|
184
191
|
displayName: string;
|
|
185
192
|
mode: "api" | "chatgpt" | "claude";
|
|
186
|
-
enabled: boolean;
|
|
187
193
|
model: string;
|
|
188
194
|
instructions: string;
|
|
189
195
|
handoffRules?: string | undefined;
|
|
@@ -263,9 +269,9 @@ export declare function useAiAgent(agentId: number | null): import("@tanstack/re
|
|
|
263
269
|
documentCount: number;
|
|
264
270
|
};
|
|
265
271
|
settings: {
|
|
272
|
+
enabled: boolean;
|
|
266
273
|
displayName: string;
|
|
267
274
|
mode: "api" | "chatgpt" | "claude";
|
|
268
|
-
enabled: boolean;
|
|
269
275
|
model: string;
|
|
270
276
|
instructions: string;
|
|
271
277
|
handoffRules?: string | undefined;
|
|
@@ -350,9 +356,9 @@ export declare function useAiAgentAction(agentId: number | null): import("@tanst
|
|
|
350
356
|
documentCount: number;
|
|
351
357
|
};
|
|
352
358
|
settings: {
|
|
359
|
+
enabled: boolean;
|
|
353
360
|
displayName: string;
|
|
354
361
|
mode: "api" | "chatgpt" | "claude";
|
|
355
|
-
enabled: boolean;
|
|
356
362
|
model: string;
|
|
357
363
|
instructions: string;
|
|
358
364
|
handoffRules?: string | undefined;
|
|
@@ -383,9 +389,9 @@ export declare function useAddAgentText(): import("@tanstack/react-query").UseMu
|
|
|
383
389
|
documentCount: number;
|
|
384
390
|
};
|
|
385
391
|
settings: {
|
|
392
|
+
enabled: boolean;
|
|
386
393
|
displayName: string;
|
|
387
394
|
mode: "api" | "chatgpt" | "claude";
|
|
388
|
-
enabled: boolean;
|
|
389
395
|
model: string;
|
|
390
396
|
instructions: string;
|
|
391
397
|
handoffRules?: string | undefined;
|
|
@@ -159,6 +159,12 @@ export declare function useConnectorGallery(enabled?: boolean): import("@tanstac
|
|
|
159
159
|
ms?: string | undefined;
|
|
160
160
|
'zh-CN'?: string | undefined;
|
|
161
161
|
} | undefined;
|
|
162
|
+
stage?: "beta" | undefined;
|
|
163
|
+
notice?: {
|
|
164
|
+
en: string;
|
|
165
|
+
ms?: string | undefined;
|
|
166
|
+
'zh-CN'?: string | undefined;
|
|
167
|
+
} | undefined;
|
|
162
168
|
};
|
|
163
169
|
fit: "ok" | "enterprise" | "needsUpdate";
|
|
164
170
|
delisted: boolean;
|
|
@@ -324,6 +330,12 @@ export declare function useRefreshConnectorList(): import("@tanstack/react-query
|
|
|
324
330
|
ms?: string | undefined;
|
|
325
331
|
'zh-CN'?: string | undefined;
|
|
326
332
|
} | undefined;
|
|
333
|
+
stage?: "beta" | undefined;
|
|
334
|
+
notice?: {
|
|
335
|
+
en: string;
|
|
336
|
+
ms?: string | undefined;
|
|
337
|
+
'zh-CN'?: string | undefined;
|
|
338
|
+
} | undefined;
|
|
327
339
|
};
|
|
328
340
|
fit: "ok" | "enterprise" | "needsUpdate";
|
|
329
341
|
delisted: boolean;
|
|
@@ -588,6 +588,12 @@ export declare const enResources: {
|
|
|
588
588
|
calendarChecked: string;
|
|
589
589
|
calendarBooked: string;
|
|
590
590
|
calendarBookedNoTime: string;
|
|
591
|
+
aiGroupAnswered: string;
|
|
592
|
+
aiGroupQuoted: string;
|
|
593
|
+
aiGroupHandover: string;
|
|
594
|
+
aiGroupHandoverNoReason: string;
|
|
595
|
+
aiGroupPaused: string;
|
|
596
|
+
aiGroupMember: string;
|
|
591
597
|
};
|
|
592
598
|
messageList: {
|
|
593
599
|
label: string;
|
|
@@ -914,6 +920,22 @@ export declare const enResources: {
|
|
|
914
920
|
sync: string;
|
|
915
921
|
synced: string;
|
|
916
922
|
};
|
|
923
|
+
aiGroups: {
|
|
924
|
+
badge: string;
|
|
925
|
+
badgePaused: string;
|
|
926
|
+
info: {
|
|
927
|
+
title: string;
|
|
928
|
+
hint: string;
|
|
929
|
+
noAgent: string;
|
|
930
|
+
agentDisabled: string;
|
|
931
|
+
agentOff: string;
|
|
932
|
+
openAgent: string;
|
|
933
|
+
readOnly: string;
|
|
934
|
+
on: string;
|
|
935
|
+
off: string;
|
|
936
|
+
paused: string;
|
|
937
|
+
};
|
|
938
|
+
};
|
|
917
939
|
};
|
|
918
940
|
admin: {
|
|
919
941
|
title: string;
|
|
@@ -2371,6 +2393,7 @@ export declare const enResources: {
|
|
|
2371
2393
|
enterprise: string;
|
|
2372
2394
|
needsUpdate: string;
|
|
2373
2395
|
delisted: string;
|
|
2396
|
+
beta: string;
|
|
2374
2397
|
};
|
|
2375
2398
|
yours: string;
|
|
2376
2399
|
more: string;
|
|
@@ -2823,6 +2846,36 @@ export declare const enResources: {
|
|
|
2823
2846
|
colReplyTime: string;
|
|
2824
2847
|
hourRange: string;
|
|
2825
2848
|
};
|
|
2849
|
+
aiGroups: {
|
|
2850
|
+
title: string;
|
|
2851
|
+
description: string;
|
|
2852
|
+
switch: string;
|
|
2853
|
+
switchHint: string;
|
|
2854
|
+
offSummary_one: string;
|
|
2855
|
+
offSummary_other: string;
|
|
2856
|
+
listLabel: string;
|
|
2857
|
+
noneOn: string;
|
|
2858
|
+
noGroups: string;
|
|
2859
|
+
noInbox: string;
|
|
2860
|
+
loopGuard: string;
|
|
2861
|
+
lookupsOnly: string;
|
|
2862
|
+
agentOff: string;
|
|
2863
|
+
members_one: string;
|
|
2864
|
+
members_other: string;
|
|
2865
|
+
answers: string;
|
|
2866
|
+
off: string;
|
|
2867
|
+
paused: string;
|
|
2868
|
+
answerIn: string;
|
|
2869
|
+
openGroup: string;
|
|
2870
|
+
saveFailed: string;
|
|
2871
|
+
try: {
|
|
2872
|
+
group: string;
|
|
2873
|
+
groupHint: string;
|
|
2874
|
+
inGroup: string;
|
|
2875
|
+
lookupsOnly: string;
|
|
2876
|
+
notSent: string;
|
|
2877
|
+
};
|
|
2878
|
+
};
|
|
2826
2879
|
};
|
|
2827
2880
|
errors: {
|
|
2828
2881
|
generic: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Chat, Inbox } from '@ezychat/shared';
|
|
1
|
+
import type { AiGroupChat, Chat, Inbox } from '@ezychat/shared';
|
|
2
2
|
import type { Directory } from './useDirectory';
|
|
3
3
|
export interface ConversationHeaderProps {
|
|
4
4
|
chat: Chat;
|
|
@@ -22,6 +22,8 @@ export interface ConversationHeaderProps {
|
|
|
22
22
|
memberCount?: number | null;
|
|
23
23
|
/** The chat's inbox, only while the user sees two or more inboxes (replies leave from it). */
|
|
24
24
|
inbox?: Pick<Inbox, 'name' | 'tone'>;
|
|
25
|
+
/** Group chats: whether the AI agent answers when tagged or quoted (the header badge). */
|
|
26
|
+
groupAi?: AiGroupChat | null;
|
|
25
27
|
busy?: boolean;
|
|
26
28
|
}
|
|
27
|
-
export declare function ConversationHeader({ chat, directory, onBack, onAssign, onToggleStatus, notesOpen, notesCount, onToggleNotes, showCustomer, customerOpen, onToggleCustomer, onOpenInfo, memberCount, inbox, busy, }: ConversationHeaderProps): import("react").JSX.Element;
|
|
29
|
+
export declare function ConversationHeader({ chat, directory, onBack, onAssign, onToggleStatus, notesOpen, notesCount, onToggleNotes, showCustomer, customerOpen, onToggleCustomer, onOpenInfo, memberCount, inbox, groupAi, busy, }: ConversationHeaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AiGroupChat } from '@ezychat/shared';
|
|
2
|
+
/** The AI answers tags and quotes in this group now (its switch and the agent's are both on). */
|
|
3
|
+
export declare const groupAiActive: (ai: AiGroupChat | null | undefined) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Group info → "AI agent answers when tagged or quoted". Admins switch it; agents see the state.
|
|
6
|
+
* Disabled with a hint while the agent's "Answer in groups" is off. Hidden when the server does not
|
|
7
|
+
* answer (an older server, or no access).
|
|
8
|
+
*/
|
|
9
|
+
export declare function GroupAiRow({ jid, isAdmin }: Readonly<{
|
|
10
|
+
jid: string;
|
|
11
|
+
isAdmin: boolean;
|
|
12
|
+
}>): import("react").JSX.Element | null;
|
|
13
|
+
/** Chat header badge on a group where the AI answers when tagged or quoted (or is paused there). */
|
|
14
|
+
export declare function GroupAiBadge({ ai }: Readonly<{
|
|
15
|
+
ai: AiGroupChat | null | undefined;
|
|
16
|
+
}>): import("react").JSX.Element | null;
|
|
@@ -7,6 +7,8 @@ export interface GroupPanelProps {
|
|
|
7
7
|
jid: string;
|
|
8
8
|
open: boolean;
|
|
9
9
|
onClose(): void;
|
|
10
|
+
/** Admins switch whether the AI agent answers in this group; agents see the state. */
|
|
11
|
+
isAdmin?: boolean;
|
|
10
12
|
}
|
|
11
13
|
type T = ReturnType<typeof useTranslation<'inbox'>>['t'];
|
|
12
14
|
/** What the team can call a member: our name for them, else their number, else their WhatsApp ID. */
|
|
@@ -15,5 +17,5 @@ export declare function memberLabel(m: GroupMember, t: T): string;
|
|
|
15
17
|
* Group info: the members of a WhatsApp group (read from WhatsApp, view-only), with search, an
|
|
16
18
|
* admins filter and per-member details. Side panel on >= lg, full-height Sheet below.
|
|
17
19
|
*/
|
|
18
|
-
export declare function GroupPanel({ jid, open, onClose }: GroupPanelProps): React.JSX.Element | null;
|
|
20
|
+
export declare function GroupPanel({ jid, open, onClose, isAdmin }: GroupPanelProps): React.JSX.Element | null;
|
|
19
21
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezychat/web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.61",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "EzyChat core: the team inbox web app (React) as a library, with createInboxApp and its extension API.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"build:lib": "node ../../scripts/build-web-lib.mjs"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@ezychat/shared": "0.1.
|
|
43
|
+
"@ezychat/shared": "0.1.61",
|
|
44
44
|
"@fontsource-variable/inter": "^5.3.0",
|
|
45
45
|
"@tanstack/react-query": "^5.104.5",
|
|
46
46
|
"@types/react": "^19.3.0",
|