@ezychat/web 0.1.83 → 0.1.84
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-SGy97Cay.js → admin-BSIc8-DD.js} +23 -0
- package/dist-lib/chunks/{admin-D4nMrYTV.js → admin-T9Qs91WR.js} +23 -0
- package/dist-lib/chunks/{inbox-iKAC249b.js → inbox-BRsRaRZn.js} +44 -2
- package/dist-lib/chunks/{inbox-DB-xoUgi.js → inbox-C2IIv9Z3.js} +44 -2
- package/dist-lib/ezychat-web.css +1 -1
- package/dist-lib/index.js +7372 -6698
- package/dist-lib/types/admin/AskEzySettingsSection.d.ts +5 -0
- package/dist-lib/types/admin/ReportsPage.d.ts +6 -0
- package/dist-lib/types/api/ai.d.ts +3 -0
- package/dist-lib/types/api/queries.d.ts +11 -1
- package/dist-lib/types/askezy/AskEzyBlocks.d.ts +15 -0
- package/dist-lib/types/askezy/AskEzySetupBlocks.d.ts +31 -0
- package/dist-lib/types/askezy/api.d.ts +12 -0
- package/dist-lib/types/i18n/resources.d.ts +70 -0
- package/dist-lib/types/lib/random-id.d.ts +8 -0
- package/package.json +2 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings → AI: how long Ask Ezy may work on one question (5, 10, 15 or 30 minutes; default 15). Customer
|
|
3
|
+
* replies keep their own limit; the person can always press Stop in the panel.
|
|
4
|
+
*/
|
|
5
|
+
export declare function AskEzySettingsSection(): import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import type { ReportTotals } from '@ezychat/shared';
|
|
2
3
|
/**
|
|
3
4
|
* Admin → Reports (design: docs/features/reports/design.md): how busy the WhatsApp numbers are
|
|
4
5
|
* (busy days, busy times, new customers) and how fast the team and the AI answer, for 7, 30 or 90
|
|
@@ -6,6 +7,11 @@ import type React from 'react';
|
|
|
6
7
|
* WhatsApp numbers the admin sees them all together or picks one.
|
|
7
8
|
*/
|
|
8
9
|
export declare function ReportsPage(): React.JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Whole percent of closed AI chats the AI completed; null when none closed. Never rounds to 100 % while the team
|
|
12
|
+
* helped in one, or to 0 % while the AI completed one, so the headline never contradicts the parts below it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function completionRate(totals: ReportTotals): number | null;
|
|
9
15
|
/** The two hours in a row with the most messages from customers; null when there are none. */
|
|
10
16
|
export declare function busiestBlock(hours: number[][]): {
|
|
11
17
|
wd: number;
|
|
@@ -122,6 +122,9 @@ export declare function useAiTry(): import("@tanstack/react-query").UseMutationR
|
|
|
122
122
|
drive?: {
|
|
123
123
|
action: "saved";
|
|
124
124
|
} | undefined;
|
|
125
|
+
silent?: {
|
|
126
|
+
kind: "no_reply" | "finished";
|
|
127
|
+
} | undefined;
|
|
125
128
|
notRun?: boolean | undefined;
|
|
126
129
|
}[] | undefined;
|
|
127
130
|
}, Error, {
|
|
@@ -57,6 +57,7 @@ export declare function patchMessageInCache(qc: QueryClient, chatJid: string, ma
|
|
|
57
57
|
export declare function removeMessageFromCache(qc: QueryClient, chatJid: string, clientId: string): void;
|
|
58
58
|
/** Replace a chat in every cached chat list and in its detail entry. */
|
|
59
59
|
export declare function upsertChatInCache(qc: QueryClient, chat: Chat): void;
|
|
60
|
+
/** A random UUID, also on a plain-http LAN page (see `randomUuid`). */
|
|
60
61
|
export declare function newClientId(): string;
|
|
61
62
|
/** Current user, or `null` when not logged in (401 is not an error here). */
|
|
62
63
|
export declare function useMe(): import("@tanstack/react-query").UseQueryResult<{
|
|
@@ -207,6 +208,10 @@ export declare function useReport(days: ReportPeriod, inbox?: number | null): im
|
|
|
207
208
|
aiAnswered: number;
|
|
208
209
|
aiResolved: number;
|
|
209
210
|
aiHandoffs: number;
|
|
211
|
+
aiClosed: number;
|
|
212
|
+
aiCompleted: number;
|
|
213
|
+
aiClosedAfterHandoff: number;
|
|
214
|
+
aiClosedAfterReply: number;
|
|
210
215
|
};
|
|
211
216
|
previous: {
|
|
212
217
|
newCustomers: number;
|
|
@@ -218,11 +223,16 @@ export declare function useReport(days: ReportPeriod, inbox?: number | null): im
|
|
|
218
223
|
aiAnswered: number;
|
|
219
224
|
aiResolved: number;
|
|
220
225
|
aiHandoffs: number;
|
|
226
|
+
aiClosed: number;
|
|
227
|
+
aiCompleted: number;
|
|
228
|
+
aiClosedAfterHandoff: number;
|
|
229
|
+
aiClosedAfterReply: number;
|
|
221
230
|
} | null;
|
|
222
231
|
waitingAfterHandoff: {
|
|
223
232
|
count: number;
|
|
224
233
|
oldestAt: number | null;
|
|
225
234
|
};
|
|
235
|
+
aiOpen: number;
|
|
226
236
|
daily: {
|
|
227
237
|
date: string;
|
|
228
238
|
inbound: number;
|
|
@@ -336,7 +346,7 @@ export interface SendTextInput {
|
|
|
336
346
|
mentions?: string[];
|
|
337
347
|
/** The text as the box showed it (`@Name`), for the pending bubble until the server answers. */
|
|
338
348
|
shown?: string;
|
|
339
|
-
/** Generate with `newClientId()` (
|
|
349
|
+
/** Generate with `newClientId()` (a random UUID). */
|
|
340
350
|
clientId: string;
|
|
341
351
|
}
|
|
342
352
|
/** Optimistic text send: inserts a pending bubble immediately, reconciled by clientId. */
|
|
@@ -5,6 +5,11 @@ export interface ChangeState {
|
|
|
5
5
|
version?: number;
|
|
6
6
|
busy?: boolean;
|
|
7
7
|
error?: string | null;
|
|
8
|
+
/** New agent and scheduled task cards: what Apply made. */
|
|
9
|
+
agentId?: number;
|
|
10
|
+
taskId?: number;
|
|
11
|
+
nextRunAt?: number | null;
|
|
12
|
+
agentOn?: boolean;
|
|
8
13
|
}
|
|
9
14
|
export interface BlockContext {
|
|
10
15
|
/** The chat the panel is scoped to (its summary shows "Back to chat" instead of "Open chat"). */
|
|
@@ -17,6 +22,16 @@ export interface BlockContext {
|
|
|
17
22
|
onAskAgain: () => void;
|
|
18
23
|
/** Wide screen: tests in change cards start open (on a phone they start folded). */
|
|
19
24
|
wide: boolean;
|
|
25
|
+
/** Sends a question choice as the person's next message. */
|
|
26
|
+
onAsk: (text: string) => void;
|
|
27
|
+
/** The person's next message after this answer (a question's chosen choice), null while unanswered. */
|
|
28
|
+
answered: string | null;
|
|
29
|
+
/** Ezy is answering: choices wait. */
|
|
30
|
+
busy: boolean;
|
|
31
|
+
/** Cards whose Apply and Discard are the "Apply both" buttons under them. */
|
|
32
|
+
paired: ReadonlySet<string>;
|
|
33
|
+
/** A new agent and its task shown together: the task card's Undo removes both. */
|
|
34
|
+
linked: ReadonlySet<string>;
|
|
20
35
|
}
|
|
21
36
|
export declare function AskEzyBlock({ block, ctx }: {
|
|
22
37
|
block: AskBlock;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AskEzyBlock as AskBlock } from '@ezychat/shared';
|
|
2
|
+
import type { BlockContext } from './AskEzyBlocks';
|
|
3
|
+
type Question = Extract<AskBlock, {
|
|
4
|
+
type: 'question';
|
|
5
|
+
}>;
|
|
6
|
+
type AgentCard = Extract<AskBlock, {
|
|
7
|
+
type: 'agent_proposal';
|
|
8
|
+
}>;
|
|
9
|
+
type TaskCard = Extract<AskBlock, {
|
|
10
|
+
type: 'task_proposal';
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Ask Ezy sets up agents and scheduled tasks (design docs/features/ask-ezy-setup/design.md): the question
|
|
14
|
+
* with choices, the New agent card and the Scheduled task card. Nothing is saved until Apply.
|
|
15
|
+
*/
|
|
16
|
+
/** A note the server adds: a new agent came without its scheduled task, so Ezy asks what it should send. */
|
|
17
|
+
export declare function SetupNoteBlock(): import("react").JSX.Element;
|
|
18
|
+
/** One question with tappable choices; a tap sends the choice as the person's next message. */
|
|
19
|
+
export declare function QuestionBlock({ block, ctx }: {
|
|
20
|
+
block: Question;
|
|
21
|
+
ctx: BlockContext;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
export declare function AgentProposalBlock({ block, ctx }: {
|
|
24
|
+
block: AgentCard;
|
|
25
|
+
ctx: BlockContext;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
export declare function TaskProposalBlock({ block, ctx }: {
|
|
28
|
+
block: TaskCard;
|
|
29
|
+
ctx: BlockContext;
|
|
30
|
+
}): import("react").JSX.Element;
|
|
31
|
+
export {};
|
|
@@ -6,6 +6,18 @@ export type AskEzyChangeAction = 'apply' | 'discard' | 'undo';
|
|
|
6
6
|
export declare const askEzyChange: (id: string, action: AskEzyChangeAction) => Promise<{
|
|
7
7
|
status: "proposed" | "applied" | "discarded";
|
|
8
8
|
version?: number | undefined;
|
|
9
|
+
related?: {
|
|
10
|
+
id: string;
|
|
11
|
+
status: "proposed" | "applied" | "discarded";
|
|
12
|
+
}[] | undefined;
|
|
13
|
+
agentId?: number | undefined;
|
|
14
|
+
taskId?: number | undefined;
|
|
15
|
+
nextRunAt?: number | null | undefined;
|
|
16
|
+
agentOn?: boolean | undefined;
|
|
17
|
+
failed?: {
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
} | undefined;
|
|
9
21
|
}>;
|
|
10
22
|
/**
|
|
11
23
|
* Asks one question. The answer streams as NDJSON: `onStep` gets each tool Ezy used while it works; resolves
|
|
@@ -912,6 +912,8 @@ export declare const enResources: {
|
|
|
912
912
|
aiGroupHandover: string;
|
|
913
913
|
aiGroupHandoverNoReason: string;
|
|
914
914
|
aiGroupPaused: string;
|
|
915
|
+
aiSilent: string;
|
|
916
|
+
aiSilentFinished: string;
|
|
915
917
|
aiGroupMember: string;
|
|
916
918
|
};
|
|
917
919
|
messageList: {
|
|
@@ -1471,14 +1473,54 @@ export declare const enResources: {
|
|
|
1471
1473
|
get_ai_context_item: string;
|
|
1472
1474
|
get_ai_setup_history: string;
|
|
1473
1475
|
get_ai_setup_version: string;
|
|
1476
|
+
edit_ai_setup_text: string;
|
|
1474
1477
|
try_ai_reply_one: string;
|
|
1475
1478
|
try_ai_reply_other: string;
|
|
1476
1479
|
propose_ai_setup_change: string;
|
|
1477
1480
|
other: string;
|
|
1481
|
+
list_scheduled_tasks_one: string;
|
|
1482
|
+
list_scheduled_tasks_other: string;
|
|
1483
|
+
propose_agent: string;
|
|
1484
|
+
propose_scheduled_task: string;
|
|
1485
|
+
propose_scheduled_task_edit: string;
|
|
1478
1486
|
};
|
|
1479
1487
|
summariseButton: string;
|
|
1480
1488
|
readyWith: string;
|
|
1481
1489
|
aboutChatSuffix: string;
|
|
1490
|
+
setup: {
|
|
1491
|
+
newAgent: string;
|
|
1492
|
+
scheduledTask: string;
|
|
1493
|
+
changeTag: string;
|
|
1494
|
+
type: string;
|
|
1495
|
+
number: string;
|
|
1496
|
+
does: string;
|
|
1497
|
+
agent: string;
|
|
1498
|
+
sendTo: string;
|
|
1499
|
+
when: string;
|
|
1500
|
+
instruction: string;
|
|
1501
|
+
preset: {
|
|
1502
|
+
sales: string;
|
|
1503
|
+
faq: string;
|
|
1504
|
+
custom: string;
|
|
1505
|
+
};
|
|
1506
|
+
startsOff: string;
|
|
1507
|
+
newSuffix: string;
|
|
1508
|
+
chatWithEnding: string;
|
|
1509
|
+
whenZone: string;
|
|
1510
|
+
whenNext: string;
|
|
1511
|
+
preview: string;
|
|
1512
|
+
applyBoth: string;
|
|
1513
|
+
created: string;
|
|
1514
|
+
saved: string;
|
|
1515
|
+
savedOff: string;
|
|
1516
|
+
openAgent: string;
|
|
1517
|
+
openTasks: string;
|
|
1518
|
+
chatUnnamed: string;
|
|
1519
|
+
chatNoName: string;
|
|
1520
|
+
agentStays: string;
|
|
1521
|
+
agentNeedsTask: string;
|
|
1522
|
+
previewNotReady: string;
|
|
1523
|
+
};
|
|
1482
1524
|
};
|
|
1483
1525
|
safety: {
|
|
1484
1526
|
title: {
|
|
@@ -2309,6 +2351,16 @@ export declare const enResources: {
|
|
|
2309
2351
|
modelFastHint: string;
|
|
2310
2352
|
modelSlowHint: string;
|
|
2311
2353
|
};
|
|
2354
|
+
askEzy: {
|
|
2355
|
+
title: string;
|
|
2356
|
+
description: string;
|
|
2357
|
+
timeout: string;
|
|
2358
|
+
timeoutHint: string;
|
|
2359
|
+
minutes_one: string;
|
|
2360
|
+
minutes_other: string;
|
|
2361
|
+
minutesDefault_one: string;
|
|
2362
|
+
minutesDefault_other: string;
|
|
2363
|
+
};
|
|
2312
2364
|
phrases: {
|
|
2313
2365
|
title: string;
|
|
2314
2366
|
description: string;
|
|
@@ -4326,6 +4378,24 @@ export declare const enResources: {
|
|
|
4326
4378
|
deltaDown_other: string;
|
|
4327
4379
|
same_one: string;
|
|
4328
4380
|
same_other: string;
|
|
4381
|
+
aiRateTitle: string;
|
|
4382
|
+
aiRateFinding: string;
|
|
4383
|
+
aiRateTipTitle: string;
|
|
4384
|
+
aiRateTipBody: string;
|
|
4385
|
+
aiRateTipStep1: string;
|
|
4386
|
+
aiRateTipStep2: string;
|
|
4387
|
+
aiRateTipStep3: string;
|
|
4388
|
+
aiRatePct: string;
|
|
4389
|
+
aiRateUp_one: string;
|
|
4390
|
+
aiRateUp_other: string;
|
|
4391
|
+
aiRateDown_one: string;
|
|
4392
|
+
aiRateDown_other: string;
|
|
4393
|
+
aiRateBar: string;
|
|
4394
|
+
aiRateCompleted: string;
|
|
4395
|
+
aiRateHelped: string;
|
|
4396
|
+
aiRateOpen: string;
|
|
4397
|
+
aiRateNone_one: string;
|
|
4398
|
+
aiRateNone_other: string;
|
|
4329
4399
|
underMinute: string;
|
|
4330
4400
|
minutes_one: string;
|
|
4331
4401
|
minutes_other: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A random RFC 4122 version 4 UUID, for request and client ids the server checks with `z.uuid()`.
|
|
3
|
+
*
|
|
4
|
+
* `crypto.randomUUID` exists only in a secure context (https, localhost). The app is also opened over
|
|
5
|
+
* plain http on the LAN (`http://192.168.x.x:7420`), where browsers leave it out; `getRandomValues`
|
|
6
|
+
* is available there, so the UUID is built from it. Never `Math.random`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function randomUuid(): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezychat/web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.84",
|
|
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.84",
|
|
44
44
|
"@fontsource-variable/inter": "^5.3.0",
|
|
45
45
|
"@tanstack/react-query": "^5.105.0",
|
|
46
46
|
"@types/react": "^19.3.0",
|