@ezychat/web 0.1.53 → 0.1.55
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--JrgNbTg.js → admin-BWSRMpRB.js} +24 -16
- package/dist-lib/chunks/{admin-DW7w-AN8.js → admin-Dcn_7ECh.js} +24 -16
- package/dist-lib/ezychat-web.css +1 -1
- package/dist-lib/index.js +4072 -3691
- package/dist-lib/types/admin/BusinessTemplateCard.d.ts +10 -0
- package/dist-lib/types/admin/business-templates.d.ts +111 -0
- package/dist-lib/types/api/ai.d.ts +36 -0
- package/dist-lib/types/api/queries.d.ts +3 -0
- package/dist-lib/types/components/app/UpgradeEnterprise.d.ts +1 -1
- package/dist-lib/types/i18n/resources.d.ts +205 -2
- package/dist-lib/types/lib/links.d.ts +5 -2
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type BusinessTemplateId } from './business-templates';
|
|
2
|
+
/**
|
|
3
|
+
* "Start from a business template": opens the template gallery. Apply fills the page's draft (the
|
|
4
|
+
* admin checks it and saves); `pendingItem` names the Business context item the next Save adds.
|
|
5
|
+
*/
|
|
6
|
+
export declare function BusinessTemplateCard({ disabled, pendingItem, onApply, }: {
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
pendingItem: string | null;
|
|
9
|
+
onApply: (id: BusinessTemplateId) => void;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import { type LucideIcon } from 'lucide-react';
|
|
3
|
+
import type { AiAgentPreset, AiContextTextBody } from '@ezychat/shared';
|
|
4
|
+
/**
|
|
5
|
+
* Ready-made AI agents for common businesses. A template is the tested starting text of its agent
|
|
6
|
+
* type plus a short business part, its own hand-off rules and one Business context item of
|
|
7
|
+
* fill-in lines (a blank line gives the AI no fact, so it hands the chat over instead of guessing).
|
|
8
|
+
* Texts live in the catalogs (`ai.businessTemplates.<id>.*`), so each language gets its own copy.
|
|
9
|
+
*/
|
|
10
|
+
export declare const TEMPLATE_CATEGORIES: readonly ["health", "food", "services", "shops", "education"];
|
|
11
|
+
export type TemplateCategory = (typeof TEMPLATE_CATEGORIES)[number];
|
|
12
|
+
export declare const BUSINESS_TEMPLATES: readonly [{
|
|
13
|
+
readonly id: "clinic";
|
|
14
|
+
readonly preset: "faq";
|
|
15
|
+
readonly category: "health";
|
|
16
|
+
readonly icon: LucideIcon;
|
|
17
|
+
}, {
|
|
18
|
+
readonly id: "dental";
|
|
19
|
+
readonly preset: "faq";
|
|
20
|
+
readonly category: "health";
|
|
21
|
+
readonly icon: LucideIcon;
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "salon";
|
|
24
|
+
readonly preset: "sales";
|
|
25
|
+
readonly category: "health";
|
|
26
|
+
readonly icon: LucideIcon;
|
|
27
|
+
}, {
|
|
28
|
+
readonly id: "gym";
|
|
29
|
+
readonly preset: "sales";
|
|
30
|
+
readonly category: "health";
|
|
31
|
+
readonly icon: LucideIcon;
|
|
32
|
+
}, {
|
|
33
|
+
readonly id: "vet";
|
|
34
|
+
readonly preset: "faq";
|
|
35
|
+
readonly category: "health";
|
|
36
|
+
readonly icon: LucideIcon;
|
|
37
|
+
}, {
|
|
38
|
+
readonly id: "restaurant";
|
|
39
|
+
readonly preset: "sales";
|
|
40
|
+
readonly category: "food";
|
|
41
|
+
readonly icon: LucideIcon;
|
|
42
|
+
}, {
|
|
43
|
+
readonly id: "bakery";
|
|
44
|
+
readonly preset: "sales";
|
|
45
|
+
readonly category: "food";
|
|
46
|
+
readonly icon: LucideIcon;
|
|
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'];
|
|
99
|
+
export interface BusinessTemplateTexts {
|
|
100
|
+
preset: AiAgentPreset;
|
|
101
|
+
agentName: string;
|
|
102
|
+
instructions: string;
|
|
103
|
+
handoffRules: string;
|
|
104
|
+
contextItem: AiContextTextBody;
|
|
105
|
+
}
|
|
106
|
+
export declare function businessTemplate(id: BusinessTemplateId, t: TFunction<'admin'>): BusinessTemplateTexts;
|
|
107
|
+
/**
|
|
108
|
+
* True when every word of `query` appears in the template's name, description or search words
|
|
109
|
+
* (the catalogs keep English words beside the translated ones, so either language finds it).
|
|
110
|
+
*/
|
|
111
|
+
export declare function templateMatches(id: BusinessTemplateId, query: string, t: TFunction<'admin'>): boolean;
|
|
@@ -362,3 +362,39 @@ export declare function useAiAgentAction(agentId: number | null): import("@tanst
|
|
|
362
362
|
internal: boolean;
|
|
363
363
|
}[];
|
|
364
364
|
}, Error, AiAgentAction, unknown>;
|
|
365
|
+
/**
|
|
366
|
+
* Adds a Business context text item to an agent by id: a business template's item, sent once the
|
|
367
|
+
* agent exists (right after create, or after the Save that applies the template).
|
|
368
|
+
*/
|
|
369
|
+
export declare function useAddAgentText(): import("@tanstack/react-query").UseMutationResult<{
|
|
370
|
+
agent: {
|
|
371
|
+
id: number;
|
|
372
|
+
userId: number;
|
|
373
|
+
displayName: string;
|
|
374
|
+
enabled: boolean;
|
|
375
|
+
preset: "sales" | "custom" | "faq";
|
|
376
|
+
inboxId: number | null;
|
|
377
|
+
documentCount: number;
|
|
378
|
+
};
|
|
379
|
+
settings: {
|
|
380
|
+
displayName: string;
|
|
381
|
+
mode: "api" | "chatgpt" | "claude";
|
|
382
|
+
enabled: boolean;
|
|
383
|
+
model: string;
|
|
384
|
+
instructions: string;
|
|
385
|
+
handoffRules?: string | undefined;
|
|
386
|
+
};
|
|
387
|
+
documents: {
|
|
388
|
+
id: number;
|
|
389
|
+
name: string;
|
|
390
|
+
kind: "text" | "file";
|
|
391
|
+
size: number;
|
|
392
|
+
characters: number;
|
|
393
|
+
createdAt: number;
|
|
394
|
+
updatedAt: number;
|
|
395
|
+
internal: boolean;
|
|
396
|
+
}[];
|
|
397
|
+
}, Error, {
|
|
398
|
+
agentId: number;
|
|
399
|
+
body: AiContextTextBody;
|
|
400
|
+
}, unknown>;
|
|
@@ -792,6 +792,7 @@ export declare function useApiTokens(): import("@tanstack/react-query").UseQuery
|
|
|
792
792
|
expiresAt: number | null;
|
|
793
793
|
canSend: boolean;
|
|
794
794
|
canMessageNewNumbers: boolean;
|
|
795
|
+
connectedApp: boolean;
|
|
795
796
|
}[], Error>;
|
|
796
797
|
export interface CreateApiTokenVars {
|
|
797
798
|
body: CreateApiTokenBodyInput;
|
|
@@ -813,6 +814,7 @@ export declare function useCreateApiToken(): import("@tanstack/react-query").Use
|
|
|
813
814
|
expiresAt: number | null;
|
|
814
815
|
canSend: boolean;
|
|
815
816
|
canMessageNewNumbers: boolean;
|
|
817
|
+
connectedApp: boolean;
|
|
816
818
|
}, Error, CreateApiTokenVars, unknown>;
|
|
817
819
|
/** Changes whether a token may send (and message new numbers); only its owner may. */
|
|
818
820
|
export declare function useUpdateApiToken(): import("@tanstack/react-query").UseMutationResult<{
|
|
@@ -826,6 +828,7 @@ export declare function useUpdateApiToken(): import("@tanstack/react-query").Use
|
|
|
826
828
|
expiresAt: number | null;
|
|
827
829
|
canSend: boolean;
|
|
828
830
|
canMessageNewNumbers: boolean;
|
|
831
|
+
connectedApp: boolean;
|
|
829
832
|
}, Error, {
|
|
830
833
|
id: number;
|
|
831
834
|
body: UpdateApiTokenBody;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The "Upgrade to Enterprise" address, or null when the product hides it: Lite links
|
|
3
|
-
* ezychat.ai/#enterprise, another product passes `createInboxApp({ links: { upgrade: null } })`.
|
|
3
|
+
* ezychat.ai/#enterprise (with a campaign tag), another product passes `createInboxApp({ links: { upgrade: null } })`.
|
|
4
4
|
*/
|
|
5
5
|
export declare function useUpgradeUrl(): string | null;
|
|
6
6
|
/** An outline button that opens the Enterprise page in the browser; nothing when hidden. */
|
|
@@ -1153,10 +1153,16 @@ export declare const enResources: {
|
|
|
1153
1153
|
};
|
|
1154
1154
|
connectApp: {
|
|
1155
1155
|
title: string;
|
|
1156
|
-
|
|
1157
|
-
|
|
1156
|
+
recommended: string;
|
|
1157
|
+
apps: string;
|
|
1158
|
+
step1: string;
|
|
1159
|
+
step2: string;
|
|
1160
|
+
step3: string;
|
|
1161
|
+
noToken: string;
|
|
1158
1162
|
copy: string;
|
|
1159
1163
|
needsTunnel: string;
|
|
1164
|
+
developerToggle: string;
|
|
1165
|
+
developerBody: string;
|
|
1160
1166
|
};
|
|
1161
1167
|
noTunnel: {
|
|
1162
1168
|
title: string;
|
|
@@ -1182,6 +1188,8 @@ export declare const enResources: {
|
|
|
1182
1188
|
revoked: string;
|
|
1183
1189
|
canSendBadge: string;
|
|
1184
1190
|
canNewBadge: string;
|
|
1191
|
+
signedInBadge: string;
|
|
1192
|
+
tokenBadge: string;
|
|
1185
1193
|
};
|
|
1186
1194
|
create: {
|
|
1187
1195
|
title: string;
|
|
@@ -1901,6 +1909,201 @@ export declare const enResources: {
|
|
|
1901
1909
|
rule4: string;
|
|
1902
1910
|
};
|
|
1903
1911
|
openAgents: string;
|
|
1912
|
+
businessTemplates: {
|
|
1913
|
+
title: string;
|
|
1914
|
+
hint: string;
|
|
1915
|
+
applyHint: string;
|
|
1916
|
+
apply: string;
|
|
1917
|
+
applied: string;
|
|
1918
|
+
pendingItem: string;
|
|
1919
|
+
confirmTitle: string;
|
|
1920
|
+
confirmBody: string;
|
|
1921
|
+
clinic: {
|
|
1922
|
+
name: string;
|
|
1923
|
+
description: string;
|
|
1924
|
+
agentName: string;
|
|
1925
|
+
focus: string;
|
|
1926
|
+
handoffRules: string;
|
|
1927
|
+
contextName: string;
|
|
1928
|
+
contextText: string;
|
|
1929
|
+
keywords: string;
|
|
1930
|
+
};
|
|
1931
|
+
carWorkshop: {
|
|
1932
|
+
name: string;
|
|
1933
|
+
description: string;
|
|
1934
|
+
agentName: string;
|
|
1935
|
+
focus: string;
|
|
1936
|
+
handoffRules: string;
|
|
1937
|
+
contextName: string;
|
|
1938
|
+
contextText: string;
|
|
1939
|
+
keywords: string;
|
|
1940
|
+
};
|
|
1941
|
+
tuition: {
|
|
1942
|
+
name: string;
|
|
1943
|
+
description: string;
|
|
1944
|
+
agentName: string;
|
|
1945
|
+
focus: string;
|
|
1946
|
+
handoffRules: string;
|
|
1947
|
+
contextName: string;
|
|
1948
|
+
contextText: string;
|
|
1949
|
+
keywords: string;
|
|
1950
|
+
};
|
|
1951
|
+
browse: string;
|
|
1952
|
+
galleryTitle: string;
|
|
1953
|
+
galleryHint: string;
|
|
1954
|
+
search: string;
|
|
1955
|
+
searchPlaceholder: string;
|
|
1956
|
+
categories: string;
|
|
1957
|
+
category: {
|
|
1958
|
+
all: string;
|
|
1959
|
+
health: string;
|
|
1960
|
+
food: string;
|
|
1961
|
+
services: string;
|
|
1962
|
+
shops: string;
|
|
1963
|
+
education: string;
|
|
1964
|
+
};
|
|
1965
|
+
noMatch: string;
|
|
1966
|
+
dental: {
|
|
1967
|
+
name: string;
|
|
1968
|
+
description: string;
|
|
1969
|
+
keywords: string;
|
|
1970
|
+
agentName: string;
|
|
1971
|
+
focus: string;
|
|
1972
|
+
handoffRules: string;
|
|
1973
|
+
contextName: string;
|
|
1974
|
+
contextText: string;
|
|
1975
|
+
};
|
|
1976
|
+
salon: {
|
|
1977
|
+
name: string;
|
|
1978
|
+
description: string;
|
|
1979
|
+
keywords: string;
|
|
1980
|
+
agentName: string;
|
|
1981
|
+
focus: string;
|
|
1982
|
+
handoffRules: string;
|
|
1983
|
+
contextName: string;
|
|
1984
|
+
contextText: string;
|
|
1985
|
+
};
|
|
1986
|
+
gym: {
|
|
1987
|
+
name: string;
|
|
1988
|
+
description: string;
|
|
1989
|
+
keywords: string;
|
|
1990
|
+
agentName: string;
|
|
1991
|
+
focus: string;
|
|
1992
|
+
handoffRules: string;
|
|
1993
|
+
contextName: string;
|
|
1994
|
+
contextText: string;
|
|
1995
|
+
};
|
|
1996
|
+
vet: {
|
|
1997
|
+
name: string;
|
|
1998
|
+
description: string;
|
|
1999
|
+
keywords: string;
|
|
2000
|
+
agentName: string;
|
|
2001
|
+
focus: string;
|
|
2002
|
+
handoffRules: string;
|
|
2003
|
+
contextName: string;
|
|
2004
|
+
contextText: string;
|
|
2005
|
+
};
|
|
2006
|
+
restaurant: {
|
|
2007
|
+
name: string;
|
|
2008
|
+
description: string;
|
|
2009
|
+
keywords: string;
|
|
2010
|
+
agentName: string;
|
|
2011
|
+
focus: string;
|
|
2012
|
+
handoffRules: string;
|
|
2013
|
+
contextName: string;
|
|
2014
|
+
contextText: string;
|
|
2015
|
+
};
|
|
2016
|
+
bakery: {
|
|
2017
|
+
name: string;
|
|
2018
|
+
description: string;
|
|
2019
|
+
keywords: string;
|
|
2020
|
+
agentName: string;
|
|
2021
|
+
focus: string;
|
|
2022
|
+
handoffRules: string;
|
|
2023
|
+
contextName: string;
|
|
2024
|
+
contextText: string;
|
|
2025
|
+
};
|
|
2026
|
+
catering: {
|
|
2027
|
+
name: string;
|
|
2028
|
+
description: string;
|
|
2029
|
+
keywords: string;
|
|
2030
|
+
agentName: string;
|
|
2031
|
+
focus: string;
|
|
2032
|
+
handoffRules: string;
|
|
2033
|
+
contextName: string;
|
|
2034
|
+
contextText: string;
|
|
2035
|
+
};
|
|
2036
|
+
homeServices: {
|
|
2037
|
+
name: string;
|
|
2038
|
+
description: string;
|
|
2039
|
+
keywords: string;
|
|
2040
|
+
agentName: string;
|
|
2041
|
+
focus: string;
|
|
2042
|
+
handoffRules: string;
|
|
2043
|
+
contextName: string;
|
|
2044
|
+
contextText: string;
|
|
2045
|
+
};
|
|
2046
|
+
property: {
|
|
2047
|
+
name: string;
|
|
2048
|
+
description: string;
|
|
2049
|
+
keywords: string;
|
|
2050
|
+
agentName: string;
|
|
2051
|
+
focus: string;
|
|
2052
|
+
handoffRules: string;
|
|
2053
|
+
contextName: string;
|
|
2054
|
+
contextText: string;
|
|
2055
|
+
};
|
|
2056
|
+
insurance: {
|
|
2057
|
+
name: string;
|
|
2058
|
+
description: string;
|
|
2059
|
+
keywords: string;
|
|
2060
|
+
agentName: string;
|
|
2061
|
+
focus: string;
|
|
2062
|
+
handoffRules: string;
|
|
2063
|
+
contextName: string;
|
|
2064
|
+
contextText: string;
|
|
2065
|
+
};
|
|
2066
|
+
travel: {
|
|
2067
|
+
name: string;
|
|
2068
|
+
description: string;
|
|
2069
|
+
keywords: string;
|
|
2070
|
+
agentName: string;
|
|
2071
|
+
focus: string;
|
|
2072
|
+
handoffRules: string;
|
|
2073
|
+
contextName: string;
|
|
2074
|
+
contextText: string;
|
|
2075
|
+
};
|
|
2076
|
+
onlineShop: {
|
|
2077
|
+
name: string;
|
|
2078
|
+
description: string;
|
|
2079
|
+
keywords: string;
|
|
2080
|
+
agentName: string;
|
|
2081
|
+
focus: string;
|
|
2082
|
+
handoffRules: string;
|
|
2083
|
+
contextName: string;
|
|
2084
|
+
contextText: string;
|
|
2085
|
+
};
|
|
2086
|
+
retail: {
|
|
2087
|
+
name: string;
|
|
2088
|
+
description: string;
|
|
2089
|
+
keywords: string;
|
|
2090
|
+
agentName: string;
|
|
2091
|
+
focus: string;
|
|
2092
|
+
handoffRules: string;
|
|
2093
|
+
contextName: string;
|
|
2094
|
+
contextText: string;
|
|
2095
|
+
};
|
|
2096
|
+
phoneRepair: {
|
|
2097
|
+
name: string;
|
|
2098
|
+
description: string;
|
|
2099
|
+
keywords: string;
|
|
2100
|
+
agentName: string;
|
|
2101
|
+
focus: string;
|
|
2102
|
+
handoffRules: string;
|
|
2103
|
+
contextName: string;
|
|
2104
|
+
contextText: string;
|
|
2105
|
+
};
|
|
2106
|
+
};
|
|
1904
2107
|
};
|
|
1905
2108
|
enrichment: {
|
|
1906
2109
|
title: string;
|
|
@@ -30,8 +30,11 @@ export interface AppLinks {
|
|
|
30
30
|
/** "Upgrade to Enterprise" page (Lite's limits, account menu, About); null hides every upgrade link. */
|
|
31
31
|
upgrade: string | null;
|
|
32
32
|
}
|
|
33
|
-
/**
|
|
34
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The EzyChat Enterprise section of the website. The campaign tag lets the website count upgrade
|
|
35
|
+
* visits from the app; the app itself sends nothing (no tracking in Lite).
|
|
36
|
+
*/
|
|
37
|
+
export declare const ENTERPRISE_UPGRADE_URL = "https://ezychat.ai/?utm_source=ezychat-lite&utm_medium=app&utm_campaign=upgrade#enterprise";
|
|
35
38
|
/** Lite's links: GitHub repository and issues, feedback on ezychat.ai. */
|
|
36
39
|
export declare const LITE_APP_LINKS: Readonly<AppLinks>;
|
|
37
40
|
/** Lite's links with the given overrides (an explicit `null` hides that link). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezychat/web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "EzyChat core: the team inbox web app (React) as a library, with createInboxApp and its extension API.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"build:lib": "node ../../scripts/build-web-lib.mjs"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@ezychat/shared": "0.1.
|
|
43
|
+
"@ezychat/shared": "0.1.55",
|
|
44
44
|
"@fontsource-variable/inter": "^5.3.0",
|
|
45
45
|
"@tanstack/react-query": "^5.104.5",
|
|
46
46
|
"@types/react": "^19.3.0",
|