@ezychat/web 0.1.72 → 0.1.75
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-CFtHolDh.js → admin-CwS6ahLc.js} +30 -9
- package/dist-lib/chunks/{admin-B6UI7hY7.js → admin-p6QRa2DG.js} +30 -9
- package/dist-lib/chunks/app-CQ2bZhrf.js +225 -0
- package/dist-lib/chunks/{app-BXBt4xNx.js → app-DeH3RXhX.js} +137 -10
- package/dist-lib/chunks/{common-0sL8O9KV.js → common-CjI5LeVc.js} +4 -2
- package/dist-lib/chunks/{common-CIXHivlt.js → common-DYK9ZVMh.js} +4 -2
- package/dist-lib/chunks/{inbox-JiKiTquN.js → inbox-C9xTxE6Y.js} +145 -6
- package/dist-lib/chunks/{inbox-BHBl1foS.js → inbox-D-koJMyr.js} +145 -6
- package/dist-lib/ezychat-web.css +1 -1
- package/dist-lib/index.js +9133 -6502
- package/dist-lib/types/admin/AgentGroupsCard.d.ts +4 -4
- package/dist-lib/types/admin/BusinessTemplateCard.d.ts +11 -3
- package/dist-lib/types/admin/business-templates-data.d.ts +117 -0
- package/dist-lib/types/admin/business-templates.d.ts +48 -93
- package/dist-lib/types/admin/connectors/SheetsSettingsCard.d.ts +5 -3
- package/dist-lib/types/admin/connectors/sheets-tabs.d.ts +24 -0
- package/dist-lib/types/api/ai-groups.d.ts +70 -1
- package/dist-lib/types/api/ai-templates.d.ts +145 -0
- package/dist-lib/types/api/ai.d.ts +22 -0
- package/dist-lib/types/api/connectors.d.ts +34 -13
- package/dist-lib/types/api/group-admin.d.ts +77 -0
- package/dist-lib/types/components/app/FeedbackDialog.d.ts +35 -0
- package/dist-lib/types/create-app.d.ts +1 -1
- package/dist-lib/types/i18n/resources.d.ts +351 -21
- package/dist-lib/types/inbox/Composer.d.ts +2 -2
- package/dist-lib/types/inbox/FixEnglish.d.ts +27 -0
- package/dist-lib/types/inbox/GroupAdmin.d.ts +16 -0
- package/dist-lib/types/inbox/GroupAdminDialogs.d.ts +23 -0
- package/dist-lib/types/inbox/GroupAdminShared.d.ts +60 -0
- package/dist-lib/types/inbox/GroupAiRow.d.ts +5 -3
- package/dist-lib/types/inbox/PdfViewer.d.ts +9 -0
- package/dist-lib/types/lib/links.d.ts +2 -6
- package/dist-lib/types/lib/pdf.d.ts +33 -0
- package/package.json +3 -2
- package/dist-lib/chunks/app-Zoharwle.js +0 -98
- 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 (
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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,10 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AgentTemplateCatalog } from '@ezychat/shared';
|
|
2
|
+
import { type GalleryTemplate } from './business-templates';
|
|
2
3
|
/**
|
|
3
4
|
* "Start from a business template": opens the template gallery. Apply fills the page's draft (the
|
|
4
5
|
* admin checks it and saves); `pendingItem` names the Business context item the next Save adds.
|
|
6
|
+
* `groupSetup` follows a group-agent template (Claims): what Save does for a new agent, or what the
|
|
7
|
+
* admin still switches on an existing one, then the remaining steps. `catalog` is the signed
|
|
8
|
+
* template list (none while loading or offline: the app's own templates show); `onBrowse` asks the
|
|
9
|
+
* server to check for new templates when the gallery opens.
|
|
5
10
|
*/
|
|
6
|
-
export declare function BusinessTemplateCard({ disabled, pendingItem, onApply, }: {
|
|
11
|
+
export declare function BusinessTemplateCard({ disabled, pendingItem, groupSetup, catalog, onBrowse, onApply, }: {
|
|
7
12
|
disabled: boolean;
|
|
8
13
|
pendingItem: string | null;
|
|
9
|
-
|
|
14
|
+
groupSetup?: 'new' | 'existing' | null;
|
|
15
|
+
catalog?: AgentTemplateCatalog;
|
|
16
|
+
onBrowse?: () => void;
|
|
17
|
+
onApply: (template: GalleryTemplate) => void;
|
|
10
18
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The templates built into this app (plain data, no React: `scripts/export-templates.mjs` reads it to
|
|
3
|
+
* write the publishing repo's `templates/` folder). Texts live in the catalogs
|
|
4
|
+
* (`ai.businessTemplates.<id>.*`). Each is version 1: a template of the signed template list
|
|
5
|
+
* replaces one only with a higher version (docs/features/template-store/design.md).
|
|
6
|
+
*/
|
|
7
|
+
export declare const TEMPLATE_CATEGORIES: readonly ["health", "food", "services", "shops", "education", "operations"];
|
|
8
|
+
export type TemplateCategory = (typeof TEMPLATE_CATEGORIES)[number];
|
|
9
|
+
/** `answerGroups` on and `answerDirect` off: an agent that works in WhatsApp groups only. */
|
|
10
|
+
export interface TemplateDefaults {
|
|
11
|
+
answerDirect?: boolean;
|
|
12
|
+
answerGroups?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const GROUP_AGENT_DEFAULTS: {
|
|
15
|
+
readonly answerGroups: true;
|
|
16
|
+
readonly answerDirect: false;
|
|
17
|
+
};
|
|
18
|
+
export declare const BUSINESS_TEMPLATES: readonly [{
|
|
19
|
+
readonly id: "clinic";
|
|
20
|
+
readonly preset: "faq";
|
|
21
|
+
readonly category: "health";
|
|
22
|
+
readonly icon: "stethoscope";
|
|
23
|
+
}, {
|
|
24
|
+
readonly id: "dental";
|
|
25
|
+
readonly preset: "faq";
|
|
26
|
+
readonly category: "health";
|
|
27
|
+
readonly icon: "smile";
|
|
28
|
+
}, {
|
|
29
|
+
readonly id: "salon";
|
|
30
|
+
readonly preset: "sales";
|
|
31
|
+
readonly category: "health";
|
|
32
|
+
readonly icon: "scissors";
|
|
33
|
+
}, {
|
|
34
|
+
readonly id: "gym";
|
|
35
|
+
readonly preset: "sales";
|
|
36
|
+
readonly category: "health";
|
|
37
|
+
readonly icon: "dumbbell";
|
|
38
|
+
}, {
|
|
39
|
+
readonly id: "vet";
|
|
40
|
+
readonly preset: "faq";
|
|
41
|
+
readonly category: "health";
|
|
42
|
+
readonly icon: "paw-print";
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "restaurant";
|
|
45
|
+
readonly preset: "sales";
|
|
46
|
+
readonly category: "food";
|
|
47
|
+
readonly icon: "utensils-crossed";
|
|
48
|
+
}, {
|
|
49
|
+
readonly id: "bakery";
|
|
50
|
+
readonly preset: "sales";
|
|
51
|
+
readonly category: "food";
|
|
52
|
+
readonly icon: "cake-slice";
|
|
53
|
+
}, {
|
|
54
|
+
readonly id: "catering";
|
|
55
|
+
readonly preset: "sales";
|
|
56
|
+
readonly category: "food";
|
|
57
|
+
readonly icon: "chef-hat";
|
|
58
|
+
}, {
|
|
59
|
+
readonly id: "carWorkshop";
|
|
60
|
+
readonly preset: "sales";
|
|
61
|
+
readonly category: "services";
|
|
62
|
+
readonly icon: "car";
|
|
63
|
+
}, {
|
|
64
|
+
readonly id: "homeServices";
|
|
65
|
+
readonly preset: "sales";
|
|
66
|
+
readonly category: "services";
|
|
67
|
+
readonly icon: "house";
|
|
68
|
+
}, {
|
|
69
|
+
readonly id: "property";
|
|
70
|
+
readonly preset: "sales";
|
|
71
|
+
readonly category: "services";
|
|
72
|
+
readonly icon: "building-2";
|
|
73
|
+
}, {
|
|
74
|
+
readonly id: "insurance";
|
|
75
|
+
readonly preset: "faq";
|
|
76
|
+
readonly category: "services";
|
|
77
|
+
readonly icon: "shield-check";
|
|
78
|
+
}, {
|
|
79
|
+
readonly id: "travel";
|
|
80
|
+
readonly preset: "sales";
|
|
81
|
+
readonly category: "services";
|
|
82
|
+
readonly icon: "plane";
|
|
83
|
+
}, {
|
|
84
|
+
readonly id: "onlineShop";
|
|
85
|
+
readonly preset: "sales";
|
|
86
|
+
readonly category: "shops";
|
|
87
|
+
readonly icon: "shopping-bag";
|
|
88
|
+
}, {
|
|
89
|
+
readonly id: "retail";
|
|
90
|
+
readonly preset: "sales";
|
|
91
|
+
readonly category: "shops";
|
|
92
|
+
readonly icon: "store";
|
|
93
|
+
}, {
|
|
94
|
+
readonly id: "phoneRepair";
|
|
95
|
+
readonly preset: "sales";
|
|
96
|
+
readonly category: "shops";
|
|
97
|
+
readonly icon: "smartphone";
|
|
98
|
+
}, {
|
|
99
|
+
readonly id: "tuition";
|
|
100
|
+
readonly preset: "sales";
|
|
101
|
+
readonly category: "education";
|
|
102
|
+
readonly icon: "graduation-cap";
|
|
103
|
+
}, {
|
|
104
|
+
readonly id: "claims";
|
|
105
|
+
readonly preset: "custom";
|
|
106
|
+
readonly category: "operations";
|
|
107
|
+
readonly icon: "receipt-text";
|
|
108
|
+
readonly defaults: {
|
|
109
|
+
readonly answerGroups: true;
|
|
110
|
+
readonly answerDirect: false;
|
|
111
|
+
};
|
|
112
|
+
}];
|
|
113
|
+
export type BusinessTemplateId = (typeof BUSINESS_TEMPLATES)[number]['id'];
|
|
114
|
+
/** The version of every built-in template (a list template replaces one only when higher). */
|
|
115
|
+
export declare const BUILTIN_TEMPLATE_VERSION = 1;
|
|
116
|
+
/** True for the group-only defaults (switched on a new agent; an existing one gets a note). */
|
|
117
|
+
export declare function isGroupAgent(defaults: TemplateDefaults | undefined): boolean;
|
|
@@ -1,111 +1,66 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
2
|
import { type LucideIcon } from 'lucide-react';
|
|
3
|
-
import type
|
|
3
|
+
import { type AgentTemplateCatalog, type AgentTemplateText, type AiAgentPreset, type AiContextTextBody } from '@ezychat/shared';
|
|
4
|
+
export { BUSINESS_TEMPLATES, TEMPLATE_CATEGORIES, type BusinessTemplateId, type TemplateCategory, } from './business-templates-data';
|
|
4
5
|
/**
|
|
5
6
|
* Ready-made AI agents for common businesses. A template is the tested starting text of its agent
|
|
6
7
|
* type plus a short business part, its own hand-off rules and one Business context item of
|
|
7
8
|
* fill-in lines (a blank line gives the AI no fact, so it hands the chat over instead of guessing).
|
|
8
|
-
*
|
|
9
|
+
* The app's own templates read their texts from the catalogs (`ai.businessTemplates.<id>.*`); the
|
|
10
|
+
* signed template list (`GET /api/ai/templates`, docs/features/template-store/design.md) adds new
|
|
11
|
+
* ones and replaces one only with a higher version.
|
|
9
12
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
readonly id: "catering";
|
|
49
|
-
readonly preset: "sales";
|
|
50
|
-
readonly category: "food";
|
|
51
|
-
readonly icon: LucideIcon;
|
|
52
|
-
}, {
|
|
53
|
-
readonly id: "carWorkshop";
|
|
54
|
-
readonly preset: "sales";
|
|
55
|
-
readonly category: "services";
|
|
56
|
-
readonly icon: LucideIcon;
|
|
57
|
-
}, {
|
|
58
|
-
readonly id: "homeServices";
|
|
59
|
-
readonly preset: "sales";
|
|
60
|
-
readonly category: "services";
|
|
61
|
-
readonly icon: LucideIcon;
|
|
62
|
-
}, {
|
|
63
|
-
readonly id: "property";
|
|
64
|
-
readonly preset: "sales";
|
|
65
|
-
readonly category: "services";
|
|
66
|
-
readonly icon: LucideIcon;
|
|
67
|
-
}, {
|
|
68
|
-
readonly id: "insurance";
|
|
69
|
-
readonly preset: "faq";
|
|
70
|
-
readonly category: "services";
|
|
71
|
-
readonly icon: LucideIcon;
|
|
72
|
-
}, {
|
|
73
|
-
readonly id: "travel";
|
|
74
|
-
readonly preset: "sales";
|
|
75
|
-
readonly category: "services";
|
|
76
|
-
readonly icon: LucideIcon;
|
|
77
|
-
}, {
|
|
78
|
-
readonly id: "onlineShop";
|
|
79
|
-
readonly preset: "sales";
|
|
80
|
-
readonly category: "shops";
|
|
81
|
-
readonly icon: LucideIcon;
|
|
82
|
-
}, {
|
|
83
|
-
readonly id: "retail";
|
|
84
|
-
readonly preset: "sales";
|
|
85
|
-
readonly category: "shops";
|
|
86
|
-
readonly icon: LucideIcon;
|
|
87
|
-
}, {
|
|
88
|
-
readonly id: "phoneRepair";
|
|
89
|
-
readonly preset: "sales";
|
|
90
|
-
readonly category: "shops";
|
|
91
|
-
readonly icon: LucideIcon;
|
|
92
|
-
}, {
|
|
93
|
-
readonly id: "tuition";
|
|
94
|
-
readonly preset: "sales";
|
|
95
|
-
readonly category: "education";
|
|
96
|
-
readonly icon: LucideIcon;
|
|
97
|
-
}];
|
|
98
|
-
export type BusinessTemplateId = (typeof BUSINESS_TEMPLATES)[number]['id'];
|
|
13
|
+
/**
|
|
14
|
+
* The icons a template may name (bundled with the app: a list never sends an image). An unknown
|
|
15
|
+
* name shows `FALLBACK_ICON`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const TEMPLATE_ICONS: Readonly<Record<string, LucideIcon>>;
|
|
18
|
+
export declare const FALLBACK_ICON: LucideIcon;
|
|
19
|
+
export declare const templateIcon: (name: string) => LucideIcon;
|
|
20
|
+
/** One template as the gallery shows it, in the admin's language, from either source. */
|
|
21
|
+
export interface GalleryTemplate {
|
|
22
|
+
id: string;
|
|
23
|
+
version: number;
|
|
24
|
+
/** `app`: built into this version; `list`: from the signed template list. */
|
|
25
|
+
source: 'app' | 'list';
|
|
26
|
+
preset: AiAgentPreset;
|
|
27
|
+
category: string;
|
|
28
|
+
icon: LucideIcon;
|
|
29
|
+
texts: AgentTemplateText;
|
|
30
|
+
/** Works in WhatsApp groups only (switched on a new agent; an existing one gets a note). */
|
|
31
|
+
groupAgent: boolean;
|
|
32
|
+
/** Names of the connectors the template recommends (list templates only). */
|
|
33
|
+
connectors: string[];
|
|
34
|
+
}
|
|
35
|
+
/** The app's own templates, texts from the catalogs. */
|
|
36
|
+
export declare function builtinTemplates(t: TFunction<'admin'>): GalleryTemplate[];
|
|
37
|
+
/**
|
|
38
|
+
* The gallery: the app's own templates, each replaced by a list template with the same id only when
|
|
39
|
+
* the list's version is higher, then the list's new templates. Without a list (loading, offline,
|
|
40
|
+
* an error) the app's own templates show.
|
|
41
|
+
*/
|
|
42
|
+
export declare function galleryTemplates(t: TFunction<'admin'>, language: string, catalog: AgentTemplateCatalog | undefined): GalleryTemplate[];
|
|
43
|
+
/**
|
|
44
|
+
* The category chips: the app's own (catalog names), then categories only the list defines and a
|
|
45
|
+
* shown template uses (the list's name for them).
|
|
46
|
+
*/
|
|
47
|
+
export declare function galleryCategories(t: TFunction<'admin'>, language: string, catalog: AgentTemplateCatalog | undefined, templates: readonly GalleryTemplate[]): Array<{
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
}>;
|
|
99
51
|
export interface BusinessTemplateTexts {
|
|
100
52
|
preset: AiAgentPreset;
|
|
101
53
|
agentName: string;
|
|
102
54
|
instructions: string;
|
|
103
55
|
handoffRules: string;
|
|
104
56
|
contextItem: AiContextTextBody;
|
|
57
|
+
/** Works in WhatsApp groups only. */
|
|
58
|
+
groupAgent: boolean;
|
|
105
59
|
}
|
|
106
|
-
|
|
60
|
+
/** What Apply puts in the editor: the agent type's starting text, then the business part. */
|
|
61
|
+
export declare function businessTemplate(tpl: GalleryTemplate, t: TFunction<'admin'>): BusinessTemplateTexts;
|
|
107
62
|
/**
|
|
108
63
|
* True when every word of `query` appears in the template's name, description or search words
|
|
109
64
|
* (the catalogs keep English words beside the translated ones, so either language finds it).
|
|
110
65
|
*/
|
|
111
|
-
export declare function templateMatches(
|
|
66
|
+
export declare function templateMatches(tpl: GalleryTemplate, query: string): boolean;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type GoogleSheetsStatus } from '@ezychat/shared';
|
|
2
2
|
/**
|
|
3
|
-
* Connectors → Google Sheets → Settings, for one AI agent
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
|
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,37 @@ 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>;
|
|
126
|
+
/**
|
|
127
|
+
* Makes a newly created agent a group agent (a template such as Claims): Answer in groups on, then
|
|
128
|
+
* Answer direct chats off. Only for an agent that holds no chats yet, so nothing is released.
|
|
129
|
+
*/
|
|
130
|
+
export declare function useMakeGroupAgent(): import("@tanstack/react-query").UseMutationResult<{
|
|
131
|
+
enabled: boolean;
|
|
132
|
+
inboxName: string | null;
|
|
133
|
+
groups: {
|
|
134
|
+
jid: string;
|
|
135
|
+
name: string;
|
|
136
|
+
memberCount: number | null;
|
|
137
|
+
enabled: boolean;
|
|
138
|
+
paused: boolean;
|
|
139
|
+
agentId: number | null;
|
|
140
|
+
agentName: string | null;
|
|
141
|
+
listen: boolean;
|
|
142
|
+
}[];
|
|
143
|
+
loopGuard: number;
|
|
144
|
+
answerDirect: boolean;
|
|
145
|
+
directAvailable: boolean;
|
|
146
|
+
heldDirect: number;
|
|
147
|
+
}, Error, number, unknown>;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI agent templates from the signed template list (docs/features/template-store/design.md),
|
|
3
|
+
* admins only. The gallery falls back to the app's own templates while these load or fail.
|
|
4
|
+
*/
|
|
5
|
+
export declare const templateCatalogKey: readonly ["ai", "templates"];
|
|
6
|
+
/** The list as the server keeps it (no download). */
|
|
7
|
+
export declare function useTemplateCatalog(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
|
|
8
|
+
status: {
|
|
9
|
+
state: "offline" | "loaded" | "rejected" | "builtin";
|
|
10
|
+
generatedAt: string | null;
|
|
11
|
+
sequence: number | null;
|
|
12
|
+
checkedAt: number | null;
|
|
13
|
+
};
|
|
14
|
+
categories: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: {
|
|
17
|
+
en: string;
|
|
18
|
+
ms?: string | undefined;
|
|
19
|
+
'zh-CN'?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
}[];
|
|
22
|
+
templates: {
|
|
23
|
+
entry: {
|
|
24
|
+
id: string;
|
|
25
|
+
version: number;
|
|
26
|
+
schemaVersion: 1;
|
|
27
|
+
minAppVersion: string;
|
|
28
|
+
editions: ("lite" | "enterprise")[];
|
|
29
|
+
category: string;
|
|
30
|
+
icon: string;
|
|
31
|
+
preset: "sales" | "custom" | "faq";
|
|
32
|
+
texts: {
|
|
33
|
+
en: {
|
|
34
|
+
agentName: string;
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
keywords: string;
|
|
38
|
+
focus: string;
|
|
39
|
+
handoffRules: string;
|
|
40
|
+
contextName: string;
|
|
41
|
+
contextText: string;
|
|
42
|
+
};
|
|
43
|
+
ms?: {
|
|
44
|
+
agentName: string;
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
keywords: string;
|
|
48
|
+
focus: string;
|
|
49
|
+
handoffRules: string;
|
|
50
|
+
contextName: string;
|
|
51
|
+
contextText: string;
|
|
52
|
+
} | undefined;
|
|
53
|
+
'zh-CN'?: {
|
|
54
|
+
agentName: string;
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
keywords: string;
|
|
58
|
+
focus: string;
|
|
59
|
+
handoffRules: string;
|
|
60
|
+
contextName: string;
|
|
61
|
+
contextText: string;
|
|
62
|
+
} | undefined;
|
|
63
|
+
};
|
|
64
|
+
defaults?: {
|
|
65
|
+
answerDirect?: boolean | undefined;
|
|
66
|
+
answerGroups?: boolean | undefined;
|
|
67
|
+
} | undefined;
|
|
68
|
+
recommendedConnectors?: string[] | undefined;
|
|
69
|
+
};
|
|
70
|
+
connectors: {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
}[];
|
|
74
|
+
}[];
|
|
75
|
+
}, Error>;
|
|
76
|
+
/** Downloads and checks the list now (the gallery opens). */
|
|
77
|
+
export declare function useRefreshTemplates(): import("@tanstack/react-query").UseMutationResult<{
|
|
78
|
+
status: {
|
|
79
|
+
state: "offline" | "loaded" | "rejected" | "builtin";
|
|
80
|
+
generatedAt: string | null;
|
|
81
|
+
sequence: number | null;
|
|
82
|
+
checkedAt: number | null;
|
|
83
|
+
};
|
|
84
|
+
categories: {
|
|
85
|
+
id: string;
|
|
86
|
+
name: {
|
|
87
|
+
en: string;
|
|
88
|
+
ms?: string | undefined;
|
|
89
|
+
'zh-CN'?: string | undefined;
|
|
90
|
+
};
|
|
91
|
+
}[];
|
|
92
|
+
templates: {
|
|
93
|
+
entry: {
|
|
94
|
+
id: string;
|
|
95
|
+
version: number;
|
|
96
|
+
schemaVersion: 1;
|
|
97
|
+
minAppVersion: string;
|
|
98
|
+
editions: ("lite" | "enterprise")[];
|
|
99
|
+
category: string;
|
|
100
|
+
icon: string;
|
|
101
|
+
preset: "sales" | "custom" | "faq";
|
|
102
|
+
texts: {
|
|
103
|
+
en: {
|
|
104
|
+
agentName: string;
|
|
105
|
+
name: string;
|
|
106
|
+
description: string;
|
|
107
|
+
keywords: string;
|
|
108
|
+
focus: string;
|
|
109
|
+
handoffRules: string;
|
|
110
|
+
contextName: string;
|
|
111
|
+
contextText: string;
|
|
112
|
+
};
|
|
113
|
+
ms?: {
|
|
114
|
+
agentName: string;
|
|
115
|
+
name: string;
|
|
116
|
+
description: string;
|
|
117
|
+
keywords: string;
|
|
118
|
+
focus: string;
|
|
119
|
+
handoffRules: string;
|
|
120
|
+
contextName: string;
|
|
121
|
+
contextText: string;
|
|
122
|
+
} | undefined;
|
|
123
|
+
'zh-CN'?: {
|
|
124
|
+
agentName: string;
|
|
125
|
+
name: string;
|
|
126
|
+
description: string;
|
|
127
|
+
keywords: string;
|
|
128
|
+
focus: string;
|
|
129
|
+
handoffRules: string;
|
|
130
|
+
contextName: string;
|
|
131
|
+
contextText: string;
|
|
132
|
+
} | undefined;
|
|
133
|
+
};
|
|
134
|
+
defaults?: {
|
|
135
|
+
answerDirect?: boolean | undefined;
|
|
136
|
+
answerGroups?: boolean | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
recommendedConnectors?: string[] | undefined;
|
|
139
|
+
};
|
|
140
|
+
connectors: {
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
}[];
|
|
144
|
+
}[];
|
|
145
|
+
}, Error, void, unknown>;
|