@ezychat/web 0.1.71 → 0.1.73

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 (27) hide show
  1. package/dist-lib/chunks/{admin-B6UI7hY7.js → admin-BTzz29_M.js} +30 -9
  2. package/dist-lib/chunks/{admin-CFtHolDh.js → admin-CYW5ewdl.js} +30 -9
  3. package/dist-lib/chunks/app-CQ2bZhrf.js +225 -0
  4. package/dist-lib/chunks/{app-BXBt4xNx.js → app-DeH3RXhX.js} +137 -10
  5. package/dist-lib/chunks/{common-0sL8O9KV.js → common-CjI5LeVc.js} +4 -2
  6. package/dist-lib/chunks/{common-CIXHivlt.js → common-DYK9ZVMh.js} +4 -2
  7. package/dist-lib/chunks/{inbox-JiKiTquN.js → inbox-BhNcoSW9.js} +23 -4
  8. package/dist-lib/chunks/{inbox-BHBl1foS.js → inbox-D0mcktjU.js} +23 -4
  9. package/dist-lib/ezychat-web.css +1 -1
  10. package/dist-lib/index.js +7789 -6294
  11. package/dist-lib/types/admin/AgentGroupsCard.d.ts +4 -4
  12. package/dist-lib/types/admin/connectors/SheetsSettingsCard.d.ts +5 -3
  13. package/dist-lib/types/admin/connectors/sheets-tabs.d.ts +24 -0
  14. package/dist-lib/types/api/ai-groups.d.ts +48 -1
  15. package/dist-lib/types/api/ai.d.ts +22 -0
  16. package/dist-lib/types/api/connectors.d.ts +34 -13
  17. package/dist-lib/types/components/app/FeedbackDialog.d.ts +35 -0
  18. package/dist-lib/types/create-app.d.ts +1 -1
  19. package/dist-lib/types/i18n/resources.d.ts +206 -20
  20. package/dist-lib/types/inbox/Composer.d.ts +2 -2
  21. package/dist-lib/types/inbox/GroupAiRow.d.ts +5 -3
  22. package/dist-lib/types/inbox/PdfViewer.d.ts +9 -0
  23. package/dist-lib/types/lib/links.d.ts +2 -6
  24. package/dist-lib/types/lib/pdf.d.ts +33 -0
  25. package/package.json +3 -2
  26. package/dist-lib/chunks/app-Zoharwle.js +0 -98
  27. package/dist-lib/types/components/app/FeatureRequestAction.d.ts +0 -7
@@ -1,10 +1,10 @@
1
1
  /** Lite's only inbox keeps the name migration 014 gave inbox 1 (a product name, never translated). */
2
2
  export declare const LITE_INBOX_NAME = "WhatsApp";
3
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.
4
+ * Agent page → Groups (designs docs/features/ai-groups/ and docs/features/group-agents/): the
5
+ * agent's "Answer in groups" switch and, when on, the groups given to this agent, each with its
6
+ * "Reads every message" switch and Remove. Add groups gives more groups of the inbox to it (a group
7
+ * another agent holds is shown but cannot be chosen). Group info shows the same for one group.
8
8
  */
9
9
  export declare function AgentGroupsCard({ agentId, name, agentEnabled, inboxName, }: Readonly<{
10
10
  agentId: number;
@@ -1,8 +1,10 @@
1
1
  import { type GoogleSheetsStatus } from '@ezychat/shared';
2
2
  /**
3
- * Connectors → Google Sheets → Settings, for one AI agent: the spreadsheet (picked in Google's
4
- * file picker), "Answer questions" with its tab (on by default) and "Save leads" with its tab (off until an
5
- * admin turns it on).
3
+ * Connectors → Google Sheets → Settings, for one AI agent (design
4
+ * docs/features/group-agents/design.md): the spreadsheet (picked in Google's file picker) and, per
5
+ * tab, Off / Read / Add rows with the tab's column names. The agent's instructions say when to use
6
+ * them. Refresh reads the tabs again and marks a new tab, changed columns and a tab Google no
7
+ * longer lists (its access is dropped on Save). Opening the card reads them once.
6
8
  */
7
9
  export declare function SheetsSettingsCard({ agentId, name, status, onConnect, }: Readonly<{
8
10
  agentId: number;
@@ -0,0 +1,24 @@
1
+ import { type SheetTabSetting, type SpreadsheetInfo } from '@ezychat/shared';
2
+ /** Column names are matched ignoring case and spacing (as the server does). */
3
+ export declare const columnKey: (column: string) => string;
4
+ /** EzyChat fills this column itself (date, name, WhatsApp number, group, agent, source). */
5
+ export declare const isAutoColumn: (column: string) => boolean;
6
+ /** What a Refresh found for one tab, compared with the tabs read before it. */
7
+ export interface TabMarks {
8
+ newTab: boolean;
9
+ changed: boolean;
10
+ /** Column names that were not in the tab's first row before (shown highlighted). */
11
+ added: ReadonlySet<string>;
12
+ }
13
+ /**
14
+ * Marks for each tab of `after` that is new or whose first row changed since `before`. Nothing is
15
+ * marked when there is nothing to compare with (first read, another spreadsheet).
16
+ */
17
+ export declare function diffTabs(before: SpreadsheetInfo | null, after: SpreadsheetInfo): Map<string, TabMarks>;
18
+ /** The tabs that are not off, sorted by title (a tab that is not listed is off). */
19
+ export declare const normalizeTabs: (tabs: readonly SheetTabSetting[]) => SheetTabSetting[];
20
+ /**
21
+ * The tabs to save: with the spreadsheet's tabs known, a tab Google no longer lists and a tab
22
+ * without column names lose their access; unknown (Google not read) keeps them as they are.
23
+ */
24
+ export declare function tabsToSave(tabs: readonly SheetTabSetting[], info: SpreadsheetInfo | null): SheetTabSetting[];
@@ -14,6 +14,9 @@ export declare function useAgentGroups(agentId: number): import("@tanstack/react
14
14
  memberCount: number | null;
15
15
  enabled: boolean;
16
16
  paused: boolean;
17
+ agentId: number | null;
18
+ agentName: string | null;
19
+ listen: boolean;
17
20
  }[];
18
21
  loopGuard: number;
19
22
  answerDirect: boolean;
@@ -29,6 +32,9 @@ export declare function useSetAnswerInGroups(agentId: number): import("@tanstack
29
32
  memberCount: number | null;
30
33
  enabled: boolean;
31
34
  paused: boolean;
35
+ agentId: number | null;
36
+ agentName: string | null;
37
+ listen: boolean;
32
38
  }[];
33
39
  loopGuard: number;
34
40
  answerDirect: boolean;
@@ -48,12 +54,41 @@ export declare function useSetAnswerDirect(agentId: number): import("@tanstack/r
48
54
  memberCount: number | null;
49
55
  enabled: boolean;
50
56
  paused: boolean;
57
+ agentId: number | null;
58
+ agentName: string | null;
59
+ listen: boolean;
51
60
  }[];
52
61
  loopGuard: number;
53
62
  answerDirect: boolean;
54
63
  directAvailable: boolean;
55
64
  heldDirect: number;
56
65
  }, Error, boolean, unknown>;
66
+ /**
67
+ * Gives groups of the agent's inbox to this agent (with or without "Reads every message") or takes
68
+ * them back. A group another agent holds answers 409 `group_has_agent`.
69
+ */
70
+ export declare function useSetAgentGroupChats(agentId: number): import("@tanstack/react-query").UseMutationResult<{
71
+ enabled: boolean;
72
+ inboxName: string | null;
73
+ groups: {
74
+ jid: string;
75
+ name: string;
76
+ memberCount: number | null;
77
+ enabled: boolean;
78
+ paused: boolean;
79
+ agentId: number | null;
80
+ agentName: string | null;
81
+ listen: boolean;
82
+ }[];
83
+ loopGuard: number;
84
+ answerDirect: boolean;
85
+ directAvailable: boolean;
86
+ heldDirect: number;
87
+ }, Error, {
88
+ jids: string[];
89
+ enabled: boolean;
90
+ listen?: boolean | undefined;
91
+ }, unknown>;
57
92
  /** Whether the AI answers tags and quotes in this group (anyone who may open the chat). */
58
93
  export declare function useGroupChatAi(jid: string | null): import("@tanstack/react-query").UseQueryResult<{
59
94
  enabled: boolean;
@@ -62,8 +97,13 @@ export declare function useGroupChatAi(jid: string | null): import("@tanstack/re
62
97
  agentEnabled: boolean;
63
98
  agentAnswersGroups: boolean;
64
99
  paused: boolean;
100
+ listen: boolean;
101
+ agents: {
102
+ id: number;
103
+ name: string;
104
+ }[];
65
105
  }, Error>;
66
- /** Admins: switch one group on or off (Group info and the agent page list). */
106
+ /** Admins: switch one group on or off, choose its agent and "Reads every message" (Group info). */
67
107
  export declare function useSetGroupChatAi(): import("@tanstack/react-query").UseMutationResult<{
68
108
  enabled: boolean;
69
109
  agentId: number | null;
@@ -71,8 +111,15 @@ export declare function useSetGroupChatAi(): import("@tanstack/react-query").Use
71
111
  agentEnabled: boolean;
72
112
  agentAnswersGroups: boolean;
73
113
  paused: boolean;
114
+ listen: boolean;
115
+ agents: {
116
+ id: number;
117
+ name: string;
118
+ }[];
74
119
  }, Error, {
75
120
  enabled: boolean;
121
+ agentId?: number | undefined;
122
+ listen?: boolean | undefined;
76
123
  } & {
77
124
  jid: string;
78
125
  }, unknown>;
@@ -52,6 +52,8 @@ export declare function useAiMember(): import("@tanstack/react-query").UseQueryR
52
52
  preset: "sales" | "custom" | "faq";
53
53
  inboxId: number | null;
54
54
  documentCount: number;
55
+ answerDirect: boolean;
56
+ groupCount: number;
55
57
  resolutionCheck?: boolean | undefined;
56
58
  }[];
57
59
  maxAgents: number;
@@ -111,6 +113,10 @@ export declare function useAiTry(): import("@tanstack/react-query").UseMutationR
111
113
  member: string | null;
112
114
  quoted?: boolean | undefined;
113
115
  } | undefined;
116
+ sheet?: {
117
+ action: "row_added";
118
+ tab: string;
119
+ } | undefined;
114
120
  notRun?: boolean | undefined;
115
121
  }[] | undefined;
116
122
  }, Error, {
@@ -221,6 +227,8 @@ export declare function useAiMemberAction(): import("@tanstack/react-query").Use
221
227
  preset: "sales" | "custom" | "faq";
222
228
  inboxId: number | null;
223
229
  documentCount: number;
230
+ answerDirect: boolean;
231
+ groupCount: number;
224
232
  resolutionCheck?: boolean | undefined;
225
233
  }[];
226
234
  maxAgents: number;
@@ -240,6 +248,8 @@ export declare const AiAgentList: z.ZodObject<{
240
248
  inboxId: z.ZodNullable<z.ZodNumber>;
241
249
  documentCount: z.ZodNumber;
242
250
  resolutionCheck: z.ZodOptional<z.ZodBoolean>;
251
+ answerDirect: z.ZodDefault<z.ZodBoolean>;
252
+ groupCount: z.ZodDefault<z.ZodNumber>;
243
253
  }, z.core.$strip>>;
244
254
  maxAgents: z.ZodNumber;
245
255
  }, z.core.$strip>;
@@ -257,6 +267,8 @@ export declare function useAiAgents(): import("@tanstack/react-query").UseQueryR
257
267
  preset: "sales" | "custom" | "faq";
258
268
  inboxId: number | null;
259
269
  documentCount: number;
270
+ answerDirect: boolean;
271
+ groupCount: number;
260
272
  resolutionCheck?: boolean | undefined;
261
273
  }[];
262
274
  maxAgents: number;
@@ -271,6 +283,8 @@ export declare function useAiAgent(agentId: number | null): import("@tanstack/re
271
283
  preset: "sales" | "custom" | "faq";
272
284
  inboxId: number | null;
273
285
  documentCount: number;
286
+ answerDirect: boolean;
287
+ groupCount: number;
274
288
  resolutionCheck?: boolean | undefined;
275
289
  };
276
290
  settings: {
@@ -302,6 +316,8 @@ export declare function useSetResolutionCheck(agentId: number): import("@tanstac
302
316
  preset: "sales" | "custom" | "faq";
303
317
  inboxId: number | null;
304
318
  documentCount: number;
319
+ answerDirect: boolean;
320
+ groupCount: number;
305
321
  resolutionCheck?: boolean | undefined;
306
322
  };
307
323
  settings: {
@@ -379,6 +395,8 @@ export declare function useAiAgentAction(agentId: number | null): import("@tanst
379
395
  preset: "sales" | "custom" | "faq";
380
396
  inboxId: number | null;
381
397
  documentCount: number;
398
+ answerDirect: boolean;
399
+ groupCount: number;
382
400
  resolutionCheck?: boolean | undefined;
383
401
  }[];
384
402
  maxAgents: number;
@@ -391,6 +409,8 @@ export declare function useAiAgentAction(agentId: number | null): import("@tanst
391
409
  preset: "sales" | "custom" | "faq";
392
410
  inboxId: number | null;
393
411
  documentCount: number;
412
+ answerDirect: boolean;
413
+ groupCount: number;
394
414
  resolutionCheck?: boolean | undefined;
395
415
  };
396
416
  settings: {
@@ -425,6 +445,8 @@ export declare function useAddAgentText(): import("@tanstack/react-query").UseMu
425
445
  preset: "sales" | "custom" | "faq";
426
446
  inboxId: number | null;
427
447
  documentCount: number;
448
+ answerDirect: boolean;
449
+ groupCount: number;
428
450
  resolutionCheck?: boolean | undefined;
429
451
  };
430
452
  settings: {
@@ -132,42 +132,61 @@ export declare function useSpreadsheetLookup(): import("@tanstack/react-query").
132
132
  tabs: {
133
133
  title: string;
134
134
  rows: number;
135
+ columns: string[];
135
136
  }[];
137
+ checkedAt: number | null;
136
138
  url: string;
137
139
  }, Error, string, unknown>;
138
140
  /** One AI agent's Google Sheets settings (the defaults until an admin saves them). */
139
141
  export declare function useSheetsSettings(agentId: number | null, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
140
142
  spreadsheetId: string | null;
141
143
  spreadsheetName: string | null;
142
- lookupTab: string | null;
143
- lookup: boolean;
144
- leadsTab: string | null;
145
- addLeads: boolean;
144
+ tabs: {
145
+ title: string;
146
+ access: "off" | "read" | "add";
147
+ }[];
146
148
  }, Error>;
147
149
  export declare function useSaveSheetsSettings(agentId: number): import("@tanstack/react-query").UseMutationResult<{
148
150
  spreadsheetId: string | null;
149
151
  spreadsheetName: string | null;
150
- lookupTab: string | null;
151
- lookup: boolean;
152
- leadsTab: string | null;
153
- addLeads: boolean;
152
+ tabs: {
153
+ title: string;
154
+ access: "off" | "read" | "add";
155
+ }[];
154
156
  }, Error, {
155
157
  spreadsheetId: string | null;
156
158
  spreadsheetName: string | null;
157
- lookupTab: string | null;
158
- lookup: boolean;
159
- leadsTab: string | null;
160
- addLeads: boolean;
159
+ tabs: {
160
+ title: string;
161
+ access: "off" | "read" | "add";
162
+ }[];
161
163
  }, unknown>;
164
+ /**
165
+ * Reads the agent's spreadsheet again from Google (tab names and first rows) and clears the AI's
166
+ * column cache. One a 10 s per install (429 `rate_limited`).
167
+ */
168
+ export declare function useRefreshSheetTabs(agentId: number): import("@tanstack/react-query").UseMutationResult<{
169
+ id: string;
170
+ name: string;
171
+ tabs: {
172
+ title: string;
173
+ rows: number;
174
+ columns: string[];
175
+ }[];
176
+ checkedAt: number | null;
177
+ url: string;
178
+ }, Error, void, unknown>;
162
179
  export declare function useSheetsActivity(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
163
180
  activity: {
164
181
  id: number;
165
182
  at: number;
166
- kind: "failed" | "looked_up" | "lead_added";
183
+ kind: "failed" | "row_added" | "looked_up" | "lead_added";
167
184
  agentId: number | null;
168
185
  agentName: string;
169
186
  chatJid: string | null;
170
187
  customer: string;
188
+ tab: string | null;
189
+ group: string | null;
171
190
  }[];
172
191
  }, Error>;
173
192
  /** Opens Google's file picker (a page on the computer that runs EzyChat). */
@@ -184,7 +203,9 @@ export declare function useSheetsPickerProgress(requestId: string | null): impor
184
203
  tabs: {
185
204
  title: string;
186
205
  rows: number;
206
+ columns: string[];
187
207
  }[];
208
+ checkedAt: number | null;
188
209
  url: string;
189
210
  } | null;
190
211
  }, Error>;
@@ -0,0 +1,35 @@
1
+ import { type FeedbackArea, type FeedbackType } from '@ezychat/shared';
2
+ /**
3
+ * Send feedback (docs/features/in-app-feedback/design.md). Anyone signed in can send a problem, an
4
+ * idea, a question or anything else, with up to 3 files. The local server adds the app details and
5
+ * forwards it to Anchor Sprint's licence portal; nothing is sent until the user presses Send. Opened
6
+ * from the account menu, Admin → Help & feedback, About and the error panel (`openFeedback`); the
7
+ * draft survives closing the dialog.
8
+ */
9
+ declare global {
10
+ interface Window {
11
+ /** Desktop app only (inbox-preload): a PNG of this window, or null. */
12
+ watiCapture?: {
13
+ captureWindow(): Promise<Uint8Array | null>;
14
+ };
15
+ }
16
+ }
17
+ export declare const OPEN_FEEDBACK_EVENT = "ezychat:feedback";
18
+ export interface FeedbackPrefill {
19
+ type?: FeedbackType;
20
+ details?: string;
21
+ }
22
+ /** Opens the Send feedback dialog from anywhere (menu, About, error panel). */
23
+ export declare function openFeedback(prefill?: FeedbackPrefill): void;
24
+ /** The part of the app a screen belongs to, so the report starts with the right one. */
25
+ /** "en" → "English" in the UI language; the code itself when the browser cannot name it. */
26
+ export declare function languageName(code: string, uiLanguage?: string): string;
27
+ export declare function areaForPath(path: string): FeedbackArea;
28
+ export declare function FeedbackHost(): import("react").JSX.Element | null;
29
+ export declare function FeedbackDialog({ open, onOpenChange, prefill, }: {
30
+ open: boolean;
31
+ onOpenChange: (open: boolean) => void;
32
+ prefill: FeedbackPrefill & {
33
+ n: number;
34
+ };
35
+ }): import("react").JSX.Element;
@@ -8,7 +8,7 @@ export interface CreateInboxAppOptions {
8
8
  /** Product name shown wherever the UI names the app; defaults to "EzyChat Lite". */
9
9
  productName?: string;
10
10
  /**
11
- * Outside links (About, Report an issue, release notes, feedback, support email). Missing
11
+ * Outside links (About, Report an issue, release notes, support email). Missing
12
12
  * entries keep Lite's links; an explicit `null` hides that link.
13
13
  */
14
14
  links?: Partial<AppLinks>;