@ezychat/web 0.1.58 → 0.1.60

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 (36) hide show
  1. package/dist-lib/chunks/admin-DPSjgyl3.js +869 -0
  2. package/dist-lib/chunks/admin-DiuGyOP6.js +868 -0
  3. package/dist-lib/chunks/{inbox-CostSOFa.js → inbox-42E4FML_.js} +4 -1
  4. package/dist-lib/chunks/{inbox-Dn_zMX5x.js → inbox-B0UJDCp0.js} +4 -1
  5. package/dist-lib/ezychat-web.css +1 -1
  6. package/dist-lib/index.js +12112 -7762
  7. package/dist-lib/types/admin/AdminLayout.d.ts +8 -0
  8. package/dist-lib/types/admin/PhraseDictionarySection.d.ts +6 -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 +38 -0
  22. package/dist-lib/types/admin/connectors/list.d.ts +14 -0
  23. package/dist-lib/types/api/ai.d.ts +7 -1
  24. package/dist-lib/types/api/connector-list.d.ts +416 -0
  25. package/dist-lib/types/api/connectors.d.ts +106 -0
  26. package/dist-lib/types/api/queries.d.ts +60 -1
  27. package/dist-lib/types/api/reply-suggestions.d.ts +46 -0
  28. package/dist-lib/types/api/voice.d.ts +2 -2
  29. package/dist-lib/types/extensions/types.d.ts +7 -1
  30. package/dist-lib/types/i18n/resources.d.ts +539 -0
  31. package/dist-lib/types/inbox/Composer.d.ts +3 -1
  32. package/dist-lib/types/lib/format.d.ts +5 -0
  33. package/dist-lib/types/lib/links.d.ts +9 -0
  34. package/package.json +2 -2
  35. package/dist-lib/chunks/admin-B2CqmbDY.js +0 -727
  36. package/dist-lib/chunks/admin-BPz8x80r.js +0 -726
@@ -5,6 +5,10 @@ import { type WebExtension, type WebExtensionAdminSection } from '../extensions'
5
5
  * Inboxes never show together: see `visibleAdminNav`.
6
6
  */
7
7
  export declare const ADMIN_NAV: readonly [{
8
+ readonly to: "reports";
9
+ readonly labelKey: "nav.reports";
10
+ readonly icon: LucideIcon;
11
+ }, {
8
12
  readonly to: "members";
9
13
  readonly labelKey: "nav.members";
10
14
  readonly icon: LucideIcon;
@@ -12,6 +16,10 @@ export declare const ADMIN_NAV: readonly [{
12
16
  readonly to: "quick-replies";
13
17
  readonly labelKey: "nav.quickReplies";
14
18
  readonly icon: LucideIcon;
19
+ }, {
20
+ readonly to: "connectors";
21
+ readonly labelKey: "nav.connectors";
22
+ readonly icon: LucideIcon;
15
23
  }, {
16
24
  readonly to: "whatsapp";
17
25
  readonly labelKey: "nav.whatsapp";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Settings → AI: the team's phrase list for instant grey text (design:
3
+ * docs/features/ai-phrase-dictionary/design.md). The AI builds it in the background; admins see its
4
+ * state, rebuild it and add, edit or delete phrases. With several AI agents, one list per agent.
5
+ */
6
+ export declare function PhraseDictionarySection(): import("react").JSX.Element;
@@ -0,0 +1,48 @@
1
+ import type React from 'react';
2
+ import type { Report, ReportDay } from '@ezychat/shared';
3
+ export declare function useReportFormat(): {
4
+ weekday: (wd: number, width?: "short" | "long") => string;
5
+ day: (date: string, withWeekday?: boolean) => string;
6
+ hour: (h: number) => string;
7
+ number: (n: number) => string;
8
+ };
9
+ /** 0 = Monday … 6 = Sunday of a `YYYY-MM-DD`. */
10
+ export declare function weekdayOf(date: string): number;
11
+ /** A report card: title, one-line finding and a Chart / Table switch. */
12
+ export declare function ChartCard({ title, finding, table, children, testId, }: {
13
+ title: string;
14
+ finding?: React.ReactNode;
15
+ table?: React.ReactNode;
16
+ children: React.ReactNode;
17
+ testId?: string;
18
+ }): React.JSX.Element;
19
+ /** The table behind every "Show as table" (first column text, the rest numbers). */
20
+ export declare function NumberTable({ head, rows }: {
21
+ head: string[];
22
+ rows: React.ReactNode[][];
23
+ }): React.JSX.Element;
24
+ /** Messages from customers per day; weekends lighter, the busiest day named until another is picked. */
25
+ export declare function DailyChart({ daily }: {
26
+ daily: ReportDay[];
27
+ }): React.JSX.Element;
28
+ /** Average messages from customers per weekday, Monday first; the busiest weekday stands out. */
29
+ export declare function WeekdayChart({ weekdays }: {
30
+ weekdays: Report['weekdays'];
31
+ }): React.JSX.Element;
32
+ /** Busy times: weekday rows × 24 hours, darker = more messages from customers. */
33
+ export declare function HoursHeatmap({ hours }: {
34
+ hours: number[][];
35
+ }): React.JSX.Element;
36
+ /** New customers per day: a line with the area under it. */
37
+ export declare function NewCustomersChart({ daily }: {
38
+ daily: ReportDay[];
39
+ }): React.JSX.Element;
40
+ /** Horizontal bars, largest first, with count and share. */
41
+ export declare function RankedBars({ rows, }: {
42
+ rows: Array<{
43
+ key: string;
44
+ label: string;
45
+ count: number;
46
+ action?: React.ReactNode;
47
+ }>;
48
+ }): React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type React from 'react';
2
+ /**
3
+ * Admin → Reports (design: docs/features/reports/design.md): how busy the WhatsApp numbers are
4
+ * (busy days, busy times, new customers) and how fast the team and the AI answer, for 7, 30 or 90
5
+ * days. Counted from this computer's database only; nothing is sent anywhere.
6
+ */
7
+ export declare function ReportsPage(): React.JSX.Element;
8
+ /** The two hours in a row with the most messages from customers; null when there are none. */
9
+ export declare function busiestBlock(hours: number[][]): {
10
+ wd: number;
11
+ h: number;
12
+ v: number;
13
+ } | null;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Agent page → Connectors: one summary row per connected connector (what this agent may do there)
3
+ * that opens the connector's Settings tab for this agent. Settings live on the connector's page.
4
+ */
5
+ export declare function AgentConnectorsCard({ agentId, name, }: Readonly<{
6
+ agentId: number;
7
+ name: string;
8
+ }>): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { AiAgentSummary } from '@ezychat/shared';
3
+ /**
4
+ * A connector's Settings tab: one AI agent at a time (`&agent=<id>` picks it; a picker shows with
5
+ * 2+ agents). `render` draws the chosen agent's settings.
6
+ */
7
+ export declare function AgentPicker({ render }: {
8
+ render: (agent: AiAgentSummary) => ReactNode;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { type GoogleCalendarStatus } from '@ezychat/shared';
2
+ /**
3
+ * Connectors → Google Calendar → Settings, for one AI agent: the calendar it uses, Check free
4
+ * times (on by default), Book appointments (off until an admin turns it on) and the booking rules
5
+ * the server enforces.
6
+ */
7
+ export declare function BookingSettingsCard({ agentId, name, status, onConnect, }: Readonly<{
8
+ agentId: number;
9
+ name: string;
10
+ status: GoogleCalendarStatus;
11
+ /** Shows the account card (Overview tab) to connect. */
12
+ onConnect: () => void;
13
+ }>): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `/admin/connectors/:id`: one page per connector. The app's own connectors come first: Google
3
+ * Calendar has Overview (what it does, the Google account, your data), Settings (per AI agent),
4
+ * Activity and Bookings tabs (`?tab=`, `&agent=`); the custom connector needs Enterprise. Every
5
+ * other page is built from the connector's entry in the connector list. A connector an extension
6
+ * provides opens the extension's page.
7
+ */
8
+ export declare function ConnectorDetailPage(): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /**
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.
4
+ * Each card opens the connector's own page (details, settings, activity), or the page an extension
5
+ * provides. Connected ones come first; search and a category filter narrow the list.
6
+ */
7
+ export declare function ConnectorsGalleryPage(): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The Google account EzyChat uses (one per install): connect, its state, its calendars and
3
+ * Disconnect. Which calendar each AI agent uses lives on the Settings tab.
4
+ */
5
+ export declare function GoogleCalendarAccountCard({ onOpenSettings, }: Readonly<{
6
+ onOpenSettings?: () => void;
7
+ }>): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type GalleryConnector } from '@ezychat/shared';
2
+ /**
3
+ * Overview → Connection of a partner connector: Connect for its sign-in type (the partner's page,
4
+ * an API key, a form or nothing), the waiting card while the partner's page is open, the account
5
+ * or key end once connected, Test connection and Disconnect.
6
+ */
7
+ export declare function PartnerConnectionCard({ g, onOpenSettings, }: {
8
+ g: GalleryConnector;
9
+ onOpenSettings: () => void;
10
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `/admin/connectors/:id` for a connector from the connector list: a partner (MCP) connector gets
3
+ * Overview, Settings per AI agent and Activity; a coming-soon one its texts and Vote; one that
4
+ * needs a newer EzyChat or Enterprise its texts only.
5
+ */
6
+ export declare function ListConnectorPage({ id }: {
7
+ id: string;
8
+ }): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { type ConnectorAgentSettings, type ConnectorEntry } from '@ezychat/shared';
2
+ /** Saved values over the entry's defaults; Look-ups start on, tools that change data off. */
3
+ export declare function withDefaults(entry: ConnectorEntry, saved: ConnectorAgentSettings): ConnectorAgentSettings;
4
+ /**
5
+ * Settings tab of a partner connector, for one AI agent: the entry's settings form, one switch per
6
+ * tool (tools that change data start off) and the rules the AI always follows (the core rules plus
7
+ * each tool's declared guards in plain words). Save stores both for this agent.
8
+ */
9
+ export declare function PartnerSettingsCard({ entry, agentId, agentName, }: {
10
+ entry: ConnectorEntry;
11
+ agentId: number;
12
+ agentName: string;
13
+ }): import("react").JSX.Element;
14
+ /** "Rules the AI always follows": the core rules and each tool's declared guards in plain words. */
15
+ export declare function GuardRules({ entry, language }: {
16
+ entry: ConnectorEntry;
17
+ language: string;
18
+ }): import("react").JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { type LucideIcon } from 'lucide-react';
2
+ import type { ConnectorEntry, GoogleCalendarState } from '@ezychat/shared';
3
+ /**
4
+ * Admin → Connectors: what the app itself provides next to the connector list (design
5
+ * docs/features/connector-list/design.md). The list (server, `GET /api/connectors/list`) gives
6
+ * every partner and coming-soon connector; the app keeps only its own features here: the built-in
7
+ * Google Calendar (its pages and tabs live in the app) and the custom MCP connector (Enterprise,
8
+ * linked by its web extension through `connectorLinks`). Texts are catalog keys under
9
+ * `connectors.items.<id>` and `connectors.tools.<tool>` (admin namespace).
10
+ */
11
+ export declare const CONNECTOR_CATEGORIES: readonly ["booking", "accounting", "crm", "data", "payments", "commerce", "custom", "other"];
12
+ export type ConnectorCategory = (typeof CONNECTOR_CATEGORIES)[number];
13
+ /** The gallery filter of each list category (the list's names differ from the app's keys). */
14
+ export declare const LIST_CATEGORY: Record<ConnectorEntry['category'], ConnectorCategory>;
15
+ /** The icon of a list entry without its own icon file. */
16
+ export declare const CATEGORY_ICON: Record<ConnectorCategory, LucideIcon>;
17
+ /** What the AI may do with the built-in Google Calendar. */
18
+ export type ConnectorTool = 'checkFree' | 'book';
19
+ export declare const CONNECTOR_IDS: readonly ["google-calendar", "custom-mcp"];
20
+ export type ConnectorId = (typeof CONNECTOR_IDS)[number];
21
+ export interface CatalogConnector {
22
+ id: ConnectorId;
23
+ icon: LucideIcon;
24
+ category: ConnectorCategory;
25
+ /** `core`: every edition. `enterprise`: greyed out unless an extension links it. */
26
+ edition: 'core' | 'enterprise';
27
+ /** Look-ups (read) and actions that change data. */
28
+ tools: readonly {
29
+ key: ConnectorTool;
30
+ access: 'read' | 'write';
31
+ }[];
32
+ }
33
+ export declare const CONNECTORS: readonly CatalogConnector[];
34
+ export declare function findConnector(id: string | undefined): CatalogConnector | undefined;
35
+ /**
36
+ * What a gallery card shows. `linked`: an extension provides the connector's page (no badge here;
37
+ * that page shows its own state). `needsUpdate`: the list entry asks for a newer EzyChat;
38
+ * `delisted`: connected, but no longer in the connector list (it keeps working).
39
+ */
40
+ export type ConnectorStatus = 'connected' | 'attention' | 'notConnected' | 'comingSoon' | 'enterprise' | 'linked' | 'needsUpdate' | 'delisted';
41
+ export declare function connectorStatus(c: CatalogConnector, google: GoogleCalendarState | undefined, extensionLink: string | undefined): ConnectorStatus;
@@ -0,0 +1,38 @@
1
+ import { type LucideIcon } from 'lucide-react';
2
+ import type { ConnectorStatus } from './catalog';
3
+ /** Connector pages that web extensions provide, by catalog id (the first extension wins). */
4
+ export declare function useConnectorLinks(): Partial<Record<string, string>>;
5
+ /** Status badge on gallery cards and the connector page header (none for `linked`). */
6
+ export declare function ConnectorStatusBadge({ status }: {
7
+ status: ConnectorStatus;
8
+ }): import("react").JSX.Element | null;
9
+ /**
10
+ * The connector's icon in a calm tile: the icon file from the connector list (served by the
11
+ * server, checked against the list's hash) or a Lucide icon (no brand logos in the app).
12
+ */
13
+ export declare function ConnectorIcon({ c, size, muted, }: {
14
+ c: {
15
+ icon: LucideIcon;
16
+ image?: string;
17
+ };
18
+ size?: 'md' | 'lg';
19
+ muted?: boolean;
20
+ }): import("react").JSX.Element;
21
+ /** "Connectors › <name>" above a connector page. */
22
+ export declare function ConnectorBreadcrumb({ name }: {
23
+ name: string;
24
+ }): import("react").JSX.Element;
25
+ /**
26
+ * "Vote for this connector": opens a ready message to the EzyChat team (WhatsApp in Lite). Nothing
27
+ * is counted in the app (no tracking in Lite); hidden when the product sets the link to null.
28
+ */
29
+ export declare function VoteButton({ name, size }: {
30
+ name: string;
31
+ size?: 'sm' | 'touch';
32
+ }): import("react").JSX.Element | null;
33
+ /** "Open Google Calendar" / "Open in Google Calendar": opens Google in the browser (outside the app). */
34
+ export declare function GoogleCalendarLink({ href, label, variant, }: {
35
+ href: string;
36
+ label: string;
37
+ variant?: 'outline' | 'ghost';
38
+ }): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type { ConnectorConnectionView, ConnectorEntry, ConnectorTool, GalleryConnector } from '@ezychat/shared';
3
+ import { type ConnectorStatus } from './catalog';
4
+ /** A partner connection that exists (working or not): it has settings, activity and Disconnect. */
5
+ export declare function isLinked(connection: ConnectorConnectionView | null | undefined): boolean;
6
+ /** The card and header status of a connector from the list. */
7
+ export declare function listStatus(g: GalleryConnector): ConnectorStatus;
8
+ /** Saved tool switches over the defaults: look-ups start on, tools that change data off. */
9
+ export declare function withToolDefaults(tools: readonly ConnectorTool[], saved: Record<string, boolean>): Record<string, boolean>;
10
+ /** The icon tile of an entry: its own icon file from the list, else its category's icon. */
11
+ export declare function entryIcon(entry: ConnectorEntry): {
12
+ icon: LucideIcon;
13
+ image?: string;
14
+ };
@@ -100,6 +100,12 @@ export declare function useAiTry(): import("@tanstack/react-query").UseMutationR
100
100
  source: string;
101
101
  ok: boolean;
102
102
  ms: number;
103
+ calendar?: {
104
+ action: "checked" | "booked";
105
+ start?: string | undefined;
106
+ end?: string | undefined;
107
+ } | undefined;
108
+ notRun?: boolean | undefined;
103
109
  }[] | undefined;
104
110
  }, Error, {
105
111
  question: string;
@@ -219,8 +225,8 @@ export declare const AiAgentList: z.ZodObject<{
219
225
  displayName: z.ZodString;
220
226
  enabled: z.ZodBoolean;
221
227
  preset: z.ZodEnum<{
222
- sales: "sales";
223
228
  custom: "custom";
229
+ sales: "sales";
224
230
  faq: "faq";
225
231
  }>;
226
232
  inboxId: z.ZodNullable<z.ZodNumber>;