@ezychat/web 0.1.77 → 0.1.79

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 (52) hide show
  1. package/dist-lib/chunks/{admin-BKiB8_GE.js → admin-D4nMrYTV.js} +49 -6
  2. package/dist-lib/chunks/{admin-DM8CrZrZ.js → admin-SGy97Cay.js} +47 -6
  3. package/dist-lib/chunks/{common-BB_u0f7c.js → common-BE996sRJ.js} +26 -0
  4. package/dist-lib/chunks/{common-6IvDd1Hx.js → common-CBTam36M.js} +26 -0
  5. package/dist-lib/chunks/{inbox-C9xTxE6Y.js → inbox-RAdHANUD.js} +96 -5
  6. package/dist-lib/chunks/{inbox-D-koJMyr.js → inbox-iUbtLuDB.js} +96 -5
  7. package/dist-lib/ezychat-web.css +1 -1
  8. package/dist-lib/index.js +10485 -6680
  9. package/dist-lib/public/badge-96.png +0 -0
  10. package/dist-lib/sw.ts +2 -1
  11. package/dist-lib/types/admin/AgentScheduledTasksCard.d.ts +10 -0
  12. package/dist-lib/types/admin/MemberChatsField.d.ts +11 -0
  13. package/dist-lib/types/admin/NewChatSection.d.ts +7 -0
  14. package/dist-lib/types/admin/ScheduledRunsDialog.d.ts +12 -0
  15. package/dist-lib/types/admin/ScheduledTaskDialog.d.ts +18 -0
  16. package/dist-lib/types/admin/business-templates-data.d.ts +18 -0
  17. package/dist-lib/types/admin/business-templates.d.ts +3 -1
  18. package/dist-lib/types/admin/connectors/ConnectorDetailPage.d.ts +2 -1
  19. package/dist-lib/types/admin/connectors/ConnectorsGalleryPage.d.ts +2 -1
  20. package/dist-lib/types/admin/connectors/CreateSheetDialog.d.ts +29 -0
  21. package/dist-lib/types/admin/connectors/DriveSettingsCard.d.ts +14 -0
  22. package/dist-lib/types/admin/connectors/GoogleDriveAccountCard.d.ts +7 -0
  23. package/dist-lib/types/admin/connectors/SqlAccountCustomers.d.ts +4 -0
  24. package/dist-lib/types/admin/connectors/SqlAccountPage.d.ts +12 -0
  25. package/dist-lib/types/admin/connectors/SqlAccountSettings.d.ts +7 -0
  26. package/dist-lib/types/admin/connectors/catalog.d.ts +10 -7
  27. package/dist-lib/types/admin/connectors/connector-ui.d.ts +17 -1
  28. package/dist-lib/types/admin/connectors/google-connect.d.ts +5 -0
  29. package/dist-lib/types/admin/connectors/sheets-tabs.d.ts +4 -1
  30. package/dist-lib/types/admin/scheduled-format.d.ts +16 -0
  31. package/dist-lib/types/api/ai-templates.d.ts +24 -0
  32. package/dist-lib/types/api/ai.d.ts +8 -1
  33. package/dist-lib/types/api/connectors.d.ts +132 -0
  34. package/dist-lib/types/api/inbox-mutations.d.ts +2 -0
  35. package/dist-lib/types/api/message-changes.d.ts +10 -2
  36. package/dist-lib/types/api/new-chat.d.ts +55 -0
  37. package/dist-lib/types/api/queries.d.ts +63 -8
  38. package/dist-lib/types/api/scheduled-tasks.d.ts +145 -0
  39. package/dist-lib/types/api/sql-account.d.ts +105 -0
  40. package/dist-lib/types/api/templates.d.ts +5 -1
  41. package/dist-lib/types/askezy/AskEzyButton.d.ts +1 -1
  42. package/dist-lib/types/auth/chat-scope.d.ts +7 -0
  43. package/dist-lib/types/i18n/resources.d.ts +640 -0
  44. package/dist-lib/types/inbox/MessageBubble.d.ts +5 -1
  45. package/dist-lib/types/inbox/MessageList.d.ts +8 -1
  46. package/dist-lib/types/inbox/NewChatDialog.d.ts +2 -0
  47. package/dist-lib/types/inbox/ReplyWindow.d.ts +16 -0
  48. package/dist-lib/types/inbox/useDirectory.d.ts +3 -0
  49. package/dist-lib/types/inbox/useQuoteJump.d.ts +28 -0
  50. package/dist-lib/types/inbox/useSwipeReply.d.ts +1 -0
  51. package/dist-lib/types/lib/tips.d.ts +1 -1
  52. package/package.json +2 -2
Binary file
package/dist-lib/sw.ts CHANGED
@@ -77,7 +77,8 @@ self.addEventListener('push', (event) => {
77
77
  body: data.body ?? '',
78
78
  tag: data.tag,
79
79
  icon: '/icon-192.png',
80
- badge: '/icon-192.png',
80
+ // Android draws the badge from its alpha only: a full-colour icon becomes a white square.
81
+ badge: '/badge-96.png',
81
82
  data: { url: data.url ?? '/' },
82
83
  };
83
84
  event.waitUntil(self.registration.showNotification(title, options));
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Agent page → Scheduled tasks (design docs/features/scheduled-tasks/design.md): each task makes
3
+ * this agent send one message at a set time to one existing chat or group of its inbox, or nothing
4
+ * when there is nothing to tell. Paused while the agent is off, the AI or WhatsApp is not connected
5
+ * or the app is locked. Admins only.
6
+ */
7
+ export declare function AgentScheduledTasksCard({ agentId, name, }: Readonly<{
8
+ agentId: number;
9
+ name: string;
10
+ }>): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type MemberChat } from '@ezychat/shared';
2
+ /**
3
+ * "Chats this member can see" in Edit member, for agents only (design docs/features/partner-role):
4
+ * All chats (default, as today) or Only chosen chats, with the chosen list and a search to add more.
5
+ * The dialog saves it with `PUT /api/users/:id/chats`.
6
+ */
7
+ export declare function MemberChatsField({ scope, chats, onChange, }: {
8
+ scope: 'all' | 'chosen';
9
+ chats: MemberChat[];
10
+ onChange(scope: 'all' | 'chosen', chats: MemberChat[]): void;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Settings → General → New chats (docs/features/new-chat/design.md): admins can always start a chat with
3
+ * a new number; the switch lets team members do it too (off by default). The daily limit per linked
4
+ * WhatsApp number is the admin's choice (default 20, 0 = no limit), shared with AI assistants (MCP).
5
+ * Each change is audited with before/after.
6
+ */
7
+ export declare function NewChatSection(): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type ScheduledRun, type ScheduledTask } from '@ezychat/shared';
2
+ /** A run's result as a small badge (a run still going has no result yet). */
3
+ export declare function RunResultBadge({ run }: Readonly<{
4
+ run: Pick<ScheduledRun, 'result'>;
5
+ }>): import("react").JSX.Element;
6
+ /** History: the task's last runs, newest first, with why one sent nothing and a link to the chat. */
7
+ export declare function ScheduledRunsDialog({ agentId, task, timeZone, onClose, }: Readonly<{
8
+ agentId: number;
9
+ task: ScheduledTask;
10
+ timeZone: string;
11
+ onClose: () => void;
12
+ }>): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { type ScheduledTask, type ScheduledTaskChat } from '@ezychat/shared';
2
+ export declare function ChatIcon({ type, className, }: Readonly<{
3
+ type: ScheduledTaskChat['type'];
4
+ className?: string;
5
+ }>): import("react").JSX.Element;
6
+ /**
7
+ * Add or edit a scheduled task: name, Send to (one existing chat or group of the agent's inbox),
8
+ * time and days in the business time zone, the instruction, and Preview (one turn, nothing sent).
9
+ */
10
+ export declare function ScheduledTaskDialog({ agentId, agentName, task, inboxId, timeZone, max, onClose, }: Readonly<{
11
+ agentId: number;
12
+ agentName: string;
13
+ task: ScheduledTask | null;
14
+ inboxId: number;
15
+ timeZone: string;
16
+ max: number;
17
+ onClose: () => void;
18
+ }>): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import type { SheetLayoutInput } from '@ezychat/shared';
1
2
  /**
2
3
  * The templates built into this app (plain data, no React: `scripts/export-templates.mjs` reads it to
3
4
  * write the publishing repo's `templates/` folder). Texts live in the catalogs
@@ -15,6 +16,11 @@ export declare const GROUP_AGENT_DEFAULTS: {
15
16
  readonly answerGroups: true;
16
17
  readonly answerDirect: false;
17
18
  };
19
+ /**
20
+ * The Claims template's Google Sheets layout ("Create from Claims layout" on the Google Sheets
21
+ * page): one tab the agent adds claims to, with EzyChat's own columns where they help.
22
+ */
23
+ export declare const CLAIMS_SHEET_LAYOUT: SheetLayoutInput;
18
24
  export declare const BUSINESS_TEMPLATES: readonly [{
19
25
  readonly id: "clinic";
20
26
  readonly preset: "faq";
@@ -109,6 +115,18 @@ export declare const BUSINESS_TEMPLATES: readonly [{
109
115
  readonly answerGroups: true;
110
116
  readonly answerDirect: false;
111
117
  };
118
+ readonly sheet: {
119
+ name: string;
120
+ tabs: {
121
+ title: string;
122
+ columns: string[];
123
+ access?: "off" | "read" | "add" | undefined;
124
+ formulas?: {
125
+ cell: string;
126
+ formula: string;
127
+ }[] | undefined;
128
+ }[];
129
+ };
112
130
  }];
113
131
  export type BusinessTemplateId = (typeof BUSINESS_TEMPLATES)[number]['id'];
114
132
  /** The version of every built-in template (a list template replaces one only when higher). */
@@ -1,6 +1,6 @@
1
1
  import type { TFunction } from 'i18next';
2
2
  import { type LucideIcon } from 'lucide-react';
3
- import { type AgentTemplateCatalog, type AgentTemplateText, type AiAgentPreset, type AiContextTextBody } from '@ezychat/shared';
3
+ import { type AgentTemplateCatalog, type AgentTemplateText, type AiAgentPreset, type AiContextTextBody, type SheetLayoutInput } from '@ezychat/shared';
4
4
  export { BUSINESS_TEMPLATES, TEMPLATE_CATEGORIES, type BusinessTemplateId, type TemplateCategory, } from './business-templates-data';
5
5
  /**
6
6
  * Ready-made AI agents for common businesses. A template is the tested starting text of its agent
@@ -31,6 +31,8 @@ export interface GalleryTemplate {
31
31
  groupAgent: boolean;
32
32
  /** Names of the connectors the template recommends (list templates only). */
33
33
  connectors: string[];
34
+ /** Its Google Sheets layout ("Create from … layout" on the Google Sheets page), else null. */
35
+ sheet: SheetLayoutInput | null;
34
36
  }
35
37
  /** The app's own templates, texts from the catalogs. */
36
38
  export declare function builtinTemplates(t: TFunction<'admin'>): GalleryTemplate[];
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * `/admin/connectors/:id`: one page per connector. The app's own connectors come first: Google
3
3
  * Calendar has Overview (what it does, the Google account, your data), Settings (per AI agent),
4
- * Activity and Bookings tabs (`?tab=`, `&agent=`); Google Sheets the same without Bookings; the custom connector needs Enterprise. Every
4
+ * Activity and Bookings tabs (`?tab=`, `&agent=`); Google Sheets and Google Drive the same without Bookings;
5
+ * SQL Account has Overview, Connection, Settings, Customers and Activity; the custom connector needs Enterprise. Every
5
6
  * other page is built from the connector's entry in the connector list. A connector an extension
6
7
  * provides opens the extension's page.
7
8
  */
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Admin → Connectors: a gallery of connectors from the connector list the server keeps (refreshed
3
- * when the page opens), plus the app's own built-in Google Calendar and the custom MCP connector.
3
+ * when the page opens), plus the app's own built-in connectors (Google Calendar, Google Sheets, SQL
4
+ * Account) and the custom MCP connector.
4
5
  * Each card opens the connector's own page (details, settings, activity), or the page an extension
5
6
  * provides. Connected ones come first; search and a category filter narrow the list.
6
7
  */
@@ -0,0 +1,29 @@
1
+ import { SheetLayout, type SheetLayoutTab, type SheetTabAccess } from '@ezychat/shared';
2
+ interface DraftTab {
3
+ key: number;
4
+ title: string;
5
+ /** Column names as typed, separated by commas. */
6
+ columns: string;
7
+ access: SheetTabAccess;
8
+ /** A template layout's formulas (kept as they are; not edited here). */
9
+ formulas?: SheetLayoutTab['formulas'];
10
+ }
11
+ interface Draft {
12
+ name: string;
13
+ tabs: DraftTab[];
14
+ }
15
+ /** The draft as the server's layout, or null when a box is missing or a tab name is repeated. */
16
+ export declare function draftLayout(draft: Draft): SheetLayout | null;
17
+ /**
18
+ * Connectors → Google Sheets → Settings → "Create a new sheet" (docs/connector-design.md, Part E): a new
19
+ * spreadsheet in the connected Google account, blank or from a template's layout, saved as the
20
+ * agent's spreadsheet with each tab's access. Admins only; the AI never creates a sheet.
21
+ */
22
+ export declare function CreateSheetDialog({ agentId, name, open, onOpenChange, onCreated, }: Readonly<{
23
+ agentId: number;
24
+ name: string;
25
+ open: boolean;
26
+ onOpenChange: (open: boolean) => void;
27
+ onCreated: () => void;
28
+ }>): import("react").JSX.Element;
29
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type GoogleDriveStatus } from '@ezychat/shared';
2
+ /**
3
+ * Connectors → Google Drive → Settings, for one AI agent (design
4
+ * docs/features/google-drive/design.md): the folder (picked in Google's file picker), Save files,
5
+ * Read files with the files the admin picked. The connector only grants access: what to save or
6
+ * read, and when, is in the agent's instructions (docs/connector-design.md), linked at the end.
7
+ */
8
+ export declare function DriveSettingsCard({ agentId, name, status, onConnect, }: Readonly<{
9
+ agentId: number;
10
+ name: string;
11
+ status: GoogleDriveStatus;
12
+ /** Shows the account card (Overview tab). */
13
+ onConnect: () => void;
14
+ }>): import("react").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The Google account Google Drive uses (one per install, its own sign-in): connect, its state and
3
+ * Disconnect. Each AI agent's folder and files live on the Settings tab.
4
+ */
5
+ export declare function GoogleDriveAccountCard({ onOpenSettings, }: Readonly<{
6
+ onOpenSettings?: () => void;
7
+ }>): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /** Customers tab: each direct chat and the SQL Account customer it is matched to. */
2
+ export declare function SqlCustomers(): import("react").JSX.Element;
3
+ /** Activity tab: what the AI did with SQL Account (who and when, never amounts or documents). */
4
+ export declare function SqlActivityList(): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type ConnectorEntry, type SqlAccountProblem, type SqlAccountState } from '@ezychat/shared';
2
+ /** A state that is neither connected nor disconnected: what went wrong. */
3
+ export declare function sqlProblem(state: SqlAccountState | null | undefined): SqlAccountProblem | null;
4
+ /**
5
+ * `/admin/connectors/sql-account` (design docs/features/sql-accounting/design.md): built into the
6
+ * app. Works only with SQL Account's API service (API Link); each AI agent's access is chosen per
7
+ * SQL Account object (Off / Read / Read + create). Tabs: Overview, Connection, Settings, Customers,
8
+ * Activity (`?tab=`, `&agent=`).
9
+ */
10
+ export declare function SqlAccountTabs({ entry }: Readonly<{
11
+ entry: ConnectorEntry | null;
12
+ }>): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type SqlAccountStatus } from '@ezychat/shared';
2
+ /** Settings tab: one AI agent at a time (`&agent=<id>`), like Google Calendar and Sheets. */
3
+ export declare function SqlAgentsSettings(): import("react").JSX.Element;
4
+ /** "Who is this customer in SQL Account?": the match rules and Match by phone number. */
5
+ export declare function SqlMatchCard({ status }: Readonly<{
6
+ status: SqlAccountStatus;
7
+ }>): import("react").JSX.Element;
@@ -1,10 +1,10 @@
1
1
  import { type LucideIcon } from 'lucide-react';
2
- import type { ConnectorEntry, GoogleCalendarState } from '@ezychat/shared';
2
+ import type { ConnectorEntry, GoogleCalendarState, SqlAccountState } from '@ezychat/shared';
3
3
  /**
4
4
  * Admin → Connectors: what the app itself provides next to the connector list (design
5
5
  * docs/features/connector-list/design.md). The list (server, `GET /api/connectors/list`) gives
6
6
  * every partner and coming-soon connector; the app keeps only its own features here: the built-in
7
- * Google Calendar and Google Sheets (their pages and tabs live in the app) and the custom MCP connector (Enterprise,
7
+ * Google Calendar, Google Sheets, Google Drive and SQL Account (their pages and tabs live in the app) and the custom MCP connector (Enterprise,
8
8
  * linked by its web extension through `connectorLinks`). Texts are catalog keys under
9
9
  * `connectors.items.<id>` and `connectors.tools.<tool>` (admin namespace).
10
10
  */
@@ -14,9 +14,9 @@ export type ConnectorCategory = (typeof CONNECTOR_CATEGORIES)[number];
14
14
  export declare const LIST_CATEGORY: Record<ConnectorEntry['category'], ConnectorCategory>;
15
15
  /** The icon of a list entry without its own icon file. */
16
16
  export declare const CATEGORY_ICON: Record<ConnectorCategory, LucideIcon>;
17
- /** What the AI may do with the built-in Google Calendar and Google Sheets. */
18
- export type ConnectorTool = 'checkFree' | 'book' | 'readRows' | 'addLead';
19
- export declare const CONNECTOR_IDS: readonly ["google-calendar", "google-sheets", "custom-mcp"];
17
+ /** What the AI may do with the built-in Google Calendar, Google Sheets and Google Drive. */
18
+ export type ConnectorTool = 'checkFree' | 'book' | 'readRows' | 'addLead' | 'save' | 'find' | 'read';
19
+ export declare const CONNECTOR_IDS: readonly ["google-calendar", "google-sheets", "sql-account", "google-drive", "custom-mcp"];
20
20
  export type ConnectorId = (typeof CONNECTOR_IDS)[number];
21
21
  export interface CatalogConnector {
22
22
  id: ConnectorId;
@@ -38,5 +38,8 @@ export declare function findConnector(id: string | undefined): CatalogConnector
38
38
  * `delisted`: connected, but no longer in the connector list (it keeps working).
39
39
  */
40
40
  export type ConnectorStatus = 'connected' | 'attention' | 'notConnected' | 'comingSoon' | 'enterprise' | 'linked' | 'needsUpdate' | 'delisted';
41
- /** `google`: the sign-in state of this connector (Google Calendar's or Google Sheets'). */
42
- export declare function connectorStatus(c: CatalogConnector, google: GoogleCalendarState | undefined, extensionLink: string | undefined): ConnectorStatus;
41
+ /**
42
+ * `state`: the connection state of this connector (Google Calendar's, Sheets' or Drive's sign-in, or
43
+ * SQL Account's connection).
44
+ */
45
+ export declare function connectorStatus(c: CatalogConnector, state: GoogleCalendarState | SqlAccountState | undefined, extensionLink: string | undefined): ConnectorStatus;
@@ -53,13 +53,29 @@ export declare function GoogleCalendarLink({ href, label, variant, }: {
53
53
  * optional badge (e.g. "Changes your calendar"), a hint and a 44 px switch target; `children` shows
54
54
  * under it (e.g. the tab to read).
55
55
  */
56
- export declare function ToolSwitchRow({ id, label, hint, badge, checked, disabled, onCheckedChange, children, }: Readonly<{
56
+ export declare function ToolSwitchRow({ id, label, hint, badge, tip, checked, disabled, onCheckedChange, children, }: Readonly<{
57
57
  id: string;
58
58
  label: string;
59
59
  hint: string;
60
60
  badge?: string;
61
+ /** An InfoTip after the label (what a risky switch does). */
62
+ tip?: ReactNode;
61
63
  checked: boolean;
62
64
  disabled?: boolean;
63
65
  onCheckedChange: (checked: boolean) => void;
64
66
  children?: ReactNode;
65
67
  }>): import("react").JSX.Element;
68
+ /**
69
+ * While Google's file picker is open in another window (Google Sheets, Google Drive): what is
70
+ * happening, a link to open it again (the browser may have blocked the window) and Cancel.
71
+ */
72
+ export declare function PickerWaiting({ testId, title, hint, url, blocked, openLabel, sameComputer, onCancel, }: Readonly<{
73
+ testId: string;
74
+ title: string;
75
+ hint: string;
76
+ url: string;
77
+ blocked: boolean;
78
+ openLabel: string;
79
+ sameComputer: string;
80
+ onCancel: () => void;
81
+ }>): import("react").JSX.Element;
@@ -46,6 +46,11 @@ export interface GoogleAccountTexts {
46
46
  disconnectBody: string;
47
47
  disconnected: string;
48
48
  }
49
+ /**
50
+ * The account card texts of a Google connector whose catalog keys follow one pattern
51
+ * (`connectors.<prefix>.description`, `what1`–`what3`, …): Google Sheets `gs`, Google Drive `gd`.
52
+ */
53
+ export declare function googleAccountTexts(t: (key: string) => string, prefix: 'gs' | 'gd'): GoogleAccountTexts;
49
54
  /**
50
55
  * The Google account one core connector uses (one per install): connect, its state, the problem
51
56
  * banners and Disconnect. `children` adds what only that connector shows while signed in (Google
@@ -15,7 +15,10 @@ export interface TabMarks {
15
15
  * marked when there is nothing to compare with (first read, another spreadsheet).
16
16
  */
17
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). */
18
+ /**
19
+ * The tabs that are not off, sorted by title (a tab that is not listed is off). The permission
20
+ * switches are kept only on Add rows and only when on (as the server saves them).
21
+ */
19
22
  export declare const normalizeTabs: (tabs: readonly SheetTabSetting[]) => SheetTabSetting[];
20
23
  /**
21
24
  * The tabs to save: with the spreadsheet's tabs known, a tab Google no longer lists and a tab
@@ -0,0 +1,16 @@
1
+ import { type ScheduledTask } from '@ezychat/shared';
2
+ /** Monday first, as the business week reads. */
3
+ export declare const WEEK: readonly [1, 2, 3, 4, 5, 6, 0];
4
+ /** Rows the card shows before "Show all". */
5
+ export declare const FOLDED_ROWS = 5;
6
+ /**
7
+ * Dates and times of scheduled tasks in the page's language. Task times are wall-clock times of the
8
+ * business time zone (`timeZone`), so run times are shown in that zone too; an unknown zone falls
9
+ * back to the device's own.
10
+ */
11
+ export declare function useScheduledFormat(timeZone: string): {
12
+ time: (hhmm: string) => string;
13
+ when: (ms: number) => string;
14
+ day: (d: number) => string;
15
+ schedule: (task: Pick<ScheduledTask, "dayRule" | "days" | "time">) => string;
16
+ };
@@ -66,6 +66,18 @@ export declare function useTemplateCatalog(enabled?: boolean): import("@tanstack
66
66
  answerGroups?: boolean | undefined;
67
67
  } | undefined;
68
68
  recommendedConnectors?: string[] | undefined;
69
+ sheet?: {
70
+ name: string;
71
+ tabs: {
72
+ title: string;
73
+ columns: string[];
74
+ access: "off" | "read" | "add";
75
+ formulas?: {
76
+ cell: string;
77
+ formula: string;
78
+ }[] | undefined;
79
+ }[];
80
+ } | undefined;
69
81
  };
70
82
  connectors: {
71
83
  id: string;
@@ -136,6 +148,18 @@ export declare function useRefreshTemplates(): import("@tanstack/react-query").U
136
148
  answerGroups?: boolean | undefined;
137
149
  } | undefined;
138
150
  recommendedConnectors?: string[] | undefined;
151
+ sheet?: {
152
+ name: string;
153
+ tabs: {
154
+ title: string;
155
+ columns: string[];
156
+ access: "off" | "read" | "add";
157
+ formulas?: {
158
+ cell: string;
159
+ formula: string;
160
+ }[] | undefined;
161
+ }[];
162
+ } | undefined;
139
163
  };
140
164
  connectors: {
141
165
  id: string;
@@ -17,6 +17,8 @@ export declare function useAiMember(): import("@tanstack/react-query").UseQueryR
17
17
  aiAgentId?: number | undefined;
18
18
  aiDeleted?: boolean | undefined;
19
19
  inboxIds?: number[] | undefined;
20
+ chatScope?: "all" | "chosen" | undefined;
21
+ chatJids?: string[] | undefined;
20
22
  } | null;
21
23
  settings: {
22
24
  enabled: boolean;
@@ -95,7 +97,7 @@ export declare function useAiTry(): import("@tanstack/react-query").UseMutationR
95
97
  action: "handoff" | "answer" | "ask_resolution" | "resolve" | "no_reply" | null;
96
98
  model: string | null;
97
99
  error: string | null;
98
- handoffReason?: "asked_for_human" | "missing_facts" | "sensitive" | "needs_action" | "business_rule" | "unsupported_message" | "ai_unavailable" | "lookup_failed" | "confidential_leak" | "window_closed" | null | undefined;
100
+ handoffReason?: "window_closed" | "confidential_leak" | "ai_unavailable" | "lookup_failed" | "asked_for_human" | "missing_facts" | "sensitive" | "needs_action" | "business_rule" | "unsupported_message" | null | undefined;
99
101
  lookups?: {
100
102
  title: string;
101
103
  sourceLabel: string;
@@ -117,6 +119,9 @@ export declare function useAiTry(): import("@tanstack/react-query").UseMutationR
117
119
  action: "row_added";
118
120
  tab: string;
119
121
  } | undefined;
122
+ drive?: {
123
+ action: "saved";
124
+ } | undefined;
120
125
  notRun?: boolean | undefined;
121
126
  }[] | undefined;
122
127
  }, Error, {
@@ -192,6 +197,8 @@ export declare function useAiMemberAction(): import("@tanstack/react-query").Use
192
197
  aiAgentId?: number | undefined;
193
198
  aiDeleted?: boolean | undefined;
194
199
  inboxIds?: number[] | undefined;
200
+ chatScope?: "all" | "chosen" | undefined;
201
+ chatJids?: string[] | undefined;
195
202
  } | null;
196
203
  settings: {
197
204
  enabled: boolean;
@@ -144,6 +144,8 @@ export declare function useSheetsSettings(agentId: number | null, enabled?: bool
144
144
  tabs: {
145
145
  title: string;
146
146
  access: "off" | "read" | "add";
147
+ aiValues?: boolean | undefined;
148
+ formulas?: boolean | undefined;
147
149
  }[];
148
150
  }, Error>;
149
151
  export declare function useSaveSheetsSettings(agentId: number): import("@tanstack/react-query").UseMutationResult<{
@@ -152,6 +154,8 @@ export declare function useSaveSheetsSettings(agentId: number): import("@tanstac
152
154
  tabs: {
153
155
  title: string;
154
156
  access: "off" | "read" | "add";
157
+ aiValues?: boolean | undefined;
158
+ formulas?: boolean | undefined;
155
159
  }[];
156
160
  }, Error, {
157
161
  spreadsheetId: string | null;
@@ -159,6 +163,33 @@ export declare function useSaveSheetsSettings(agentId: number): import("@tanstac
159
163
  tabs: {
160
164
  title: string;
161
165
  access: "off" | "read" | "add";
166
+ aiValues?: boolean | undefined;
167
+ formulas?: boolean | undefined;
168
+ }[];
169
+ }, unknown>;
170
+ /**
171
+ * Creates a new spreadsheet in the connected Google account from `layout` and saves it as the
172
+ * agent's (admins). 400 `formula_blocked` when a formula reaches outside the sheet.
173
+ */
174
+ export declare function useCreateSheet(agentId: number): import("@tanstack/react-query").UseMutationResult<{
175
+ spreadsheetId: string | null;
176
+ spreadsheetName: string | null;
177
+ tabs: {
178
+ title: string;
179
+ access: "off" | "read" | "add";
180
+ aiValues?: boolean | undefined;
181
+ formulas?: boolean | undefined;
182
+ }[];
183
+ }, Error, {
184
+ name: string;
185
+ tabs: {
186
+ title: string;
187
+ columns: string[];
188
+ access: "off" | "read" | "add";
189
+ formulas?: {
190
+ cell: string;
191
+ formula: string;
192
+ }[] | undefined;
162
193
  }[];
163
194
  }, unknown>;
164
195
  /**
@@ -209,3 +240,104 @@ export declare function useSheetsPickerProgress(requestId: string | null): impor
209
240
  url: string;
210
241
  } | null;
211
242
  }, Error>;
243
+ /** Admin → Connectors → Google Drive (admins only). Tokens never reach the browser. */
244
+ export declare const googleDriveKey: readonly ["connectors", "google-drive"];
245
+ export declare const driveSettingsKey: (agentId: number) => readonly ["connectors", "google-drive", "agent", number];
246
+ export declare const driveActivityKey: readonly ["connectors", "google-drive", "activity"];
247
+ export declare function useGoogleDrive(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
248
+ state: "unavailable" | "connected" | "expired" | "disconnected" | "not_configured";
249
+ account: string | null;
250
+ connectedAt: number | null;
251
+ problemSince: number | null;
252
+ }, Error>;
253
+ /** Starts Google's sign-in for Google Drive (its own sign-in, separate from Calendar and Sheets). */
254
+ export declare function useGoogleDriveConnect(): import("@tanstack/react-query").UseMutationResult<{
255
+ requestId: string;
256
+ authorizationUrl: string;
257
+ }, Error, void, unknown>;
258
+ /** Polls a Google Drive sign-in every 2 s until it is done or failed. */
259
+ export declare function useGoogleDriveProgress(requestId: string | null): import("@tanstack/react-query").UseQueryResult<{
260
+ status: "pending" | "failed" | "done";
261
+ error: "error" | "expired" | "denied" | null;
262
+ }, Error>;
263
+ export declare function useGoogleDriveDisconnect(): import("@tanstack/react-query").UseMutationResult<unknown, Error, void, unknown>;
264
+ /** One AI agent's Google Drive settings (the defaults until an admin saves them). */
265
+ export declare function useDriveSettings(agentId: number | null, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
266
+ folder: {
267
+ id: string;
268
+ name: string;
269
+ } | null;
270
+ save: boolean;
271
+ read: boolean;
272
+ files: {
273
+ id: string;
274
+ name: string;
275
+ mimeType: string;
276
+ kind: "text" | "pdf" | "other" | "sheet" | "word" | "doc";
277
+ }[];
278
+ }, Error>;
279
+ export declare function useSaveDriveSettings(agentId: number): import("@tanstack/react-query").UseMutationResult<{
280
+ folder: {
281
+ id: string;
282
+ name: string;
283
+ } | null;
284
+ save: boolean;
285
+ read: boolean;
286
+ files: {
287
+ id: string;
288
+ name: string;
289
+ mimeType: string;
290
+ kind: "text" | "pdf" | "other" | "sheet" | "word" | "doc";
291
+ }[];
292
+ }, Error, {
293
+ folder: {
294
+ id: string;
295
+ name: string;
296
+ } | null;
297
+ save: boolean;
298
+ read: boolean;
299
+ files: {
300
+ id: string;
301
+ name: string;
302
+ mimeType: string;
303
+ kind: "text" | "pdf" | "other" | "sheet" | "word" | "doc";
304
+ }[];
305
+ }, unknown>;
306
+ export declare function useDriveActivity(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
307
+ activity: {
308
+ id: number;
309
+ at: number;
310
+ kind: "failed" | "read" | "skipped" | "saved";
311
+ agentId: number | null;
312
+ agentName: string;
313
+ chatJid: string | null;
314
+ customer: string;
315
+ group: string | null;
316
+ reason: "unavailable" | "safety" | "size" | null;
317
+ }[];
318
+ }, Error>;
319
+ /**
320
+ * Opens Google's file picker (a page on the computer that runs EzyChat): one folder, or files
321
+ * (opened in the agent's folder).
322
+ */
323
+ export declare function useDrivePicker(): import("@tanstack/react-query").UseMutationResult<{
324
+ requestId: string;
325
+ pickerUrl: string;
326
+ }, Error, {
327
+ kind: "files" | "folder";
328
+ folderId?: string | undefined;
329
+ }, unknown>;
330
+ /** Polls the picker every 2 s until the admin picked, cancelled, or it expired. */
331
+ export declare function useDrivePickerProgress(requestId: string | null): import("@tanstack/react-query").UseQueryResult<{
332
+ status: "expired" | "pending" | "failed" | "done" | "cancelled";
333
+ folder: {
334
+ id: string;
335
+ name: string;
336
+ } | null;
337
+ files: {
338
+ id: string;
339
+ name: string;
340
+ mimeType: string;
341
+ kind: "text" | "pdf" | "other" | "sheet" | "word" | "doc";
342
+ }[];
343
+ }, Error>;
@@ -93,4 +93,6 @@ export declare function useSetUserInboxes(userId: number): import("@tanstack/rea
93
93
  aiAgentId?: number | undefined;
94
94
  aiDeleted?: boolean | undefined;
95
95
  inboxIds?: number[] | undefined;
96
+ chatScope?: "all" | "chosen" | undefined;
97
+ chatJids?: string[] | undefined;
96
98
  }, Error, number[], unknown>;
@@ -46,9 +46,13 @@ export declare function useEditMessage(): import("@tanstack/react-query").UseMut
46
46
  language: string;
47
47
  } | null | undefined;
48
48
  viaAssistant?: boolean | undefined;
49
+ scheduledTask?: {
50
+ id: number;
51
+ name: string | null;
52
+ } | null | undefined;
49
53
  transcript?: string | null | undefined;
50
54
  transcriptLang?: string | null | undefined;
51
- transcriptStatus?: "pending" | "failed" | "ok" | "too_long" | "unsupported" | "skipped" | null | undefined;
55
+ transcriptStatus?: "pending" | "failed" | "ok" | "skipped" | "too_long" | "unsupported" | null | undefined;
52
56
  senderProfile?: {
53
57
  chatJid: string;
54
58
  name: string;
@@ -104,9 +108,13 @@ export declare function useDeleteMessage(): import("@tanstack/react-query").UseM
104
108
  language: string;
105
109
  } | null | undefined;
106
110
  viaAssistant?: boolean | undefined;
111
+ scheduledTask?: {
112
+ id: number;
113
+ name: string | null;
114
+ } | null | undefined;
107
115
  transcript?: string | null | undefined;
108
116
  transcriptLang?: string | null | undefined;
109
- transcriptStatus?: "pending" | "failed" | "ok" | "too_long" | "unsupported" | "skipped" | null | undefined;
117
+ transcriptStatus?: "pending" | "failed" | "ok" | "skipped" | "too_long" | "unsupported" | null | undefined;
110
118
  senderProfile?: {
111
119
  chatJid: string;
112
120
  name: string;