@ezychat/web 0.1.58 → 0.1.59

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.
@@ -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;
@@ -15,6 +15,52 @@ export declare function fetchSuggestions(jid: string, signal: AbortSignal): Prom
15
15
  noAnswer: boolean;
16
16
  handoffRule: string | null;
17
17
  }>;
18
+ /** The chat's phrase list, matched in the composer on every key (empty while suggestions are off). */
19
+ export declare function usePhraseList(jid: string | null, enabled: boolean): import("@tanstack/react-query").UseQueryResult<{
20
+ phrases: {
21
+ text: string;
22
+ id: number;
23
+ language: "en" | "ms" | "zh";
24
+ }[];
25
+ }, Error>;
26
+ /** Tab / Accept (true) or Esc (false) on a phrase's grey text: it moves up or down the list. */
27
+ export declare function sendPhraseFeedback(jid: string, id: number, accepted: boolean): void;
28
+ export declare const phrasesAdminKey: readonly ["ai", "phrasesAdmin"];
29
+ /** Admins: the phrase list and its status for one agent (default: the agent of inbox 1). */
30
+ export declare function usePhrasesAdmin(agentId: number | null): import("@tanstack/react-query").UseQueryResult<{
31
+ agentId: number | null;
32
+ status: {
33
+ state: "error" | "ready" | "empty" | "building";
34
+ count: number;
35
+ languages: {
36
+ language: "en" | "ms" | "zh";
37
+ count: number;
38
+ }[];
39
+ updatedAt: number | null;
40
+ trigger: "context" | "manual" | "start" | "replies" | "weekly" | null;
41
+ newReplies: number;
42
+ nextAfterReplies: number;
43
+ aiCallsToday: number;
44
+ aiCallsLimit: number;
45
+ };
46
+ phrases: {
47
+ id: number;
48
+ text: string;
49
+ language: "en" | "ms" | "zh";
50
+ source: "admin" | "context" | "team";
51
+ uses: number;
52
+ fact: boolean;
53
+ }[];
54
+ }, Error>;
55
+ export declare const suggestModelKey: readonly ["ai", "suggestModel"];
56
+ /** Admins: the model for suggestions, its choices and what calls use now. */
57
+ export declare function useSuggestModel(enabled: boolean): import("@tanstack/react-query").UseQueryResult<{
58
+ model: string;
59
+ fastModel: string;
60
+ agentModel: string;
61
+ models: string[];
62
+ resolved: string;
63
+ }, Error>;
18
64
  /** The rest of the sentence being typed, or null. */
19
65
  export declare function fetchCompletion(jid: string, text: string, signal: AbortSignal): Promise<{
20
66
  completion: string | null;
@@ -1359,6 +1359,59 @@ export declare const enResources: {
1359
1359
  cost: string;
1360
1360
  noConnection: string;
1361
1361
  upgraded: string;
1362
+ model: string;
1363
+ modelFast: string;
1364
+ modelAgent: string;
1365
+ modelFastHint: string;
1366
+ modelSlowHint: string;
1367
+ };
1368
+ phrases: {
1369
+ title: string;
1370
+ description: string;
1371
+ agent: string;
1372
+ off: string;
1373
+ building: string;
1374
+ empty: string;
1375
+ error: string;
1376
+ count: string;
1377
+ updated: string;
1378
+ trigger: {
1379
+ start: string;
1380
+ context: string;
1381
+ replies: string;
1382
+ manual: string;
1383
+ weekly: string;
1384
+ };
1385
+ next: string;
1386
+ calls: string;
1387
+ view: string;
1388
+ build: string;
1389
+ rebuild: string;
1390
+ privacy: string;
1391
+ listTitle: string;
1392
+ listDescription: string;
1393
+ search: string;
1394
+ language: string;
1395
+ all: string;
1396
+ lang: {
1397
+ en: string;
1398
+ ms: string;
1399
+ zh: string;
1400
+ };
1401
+ add: string;
1402
+ edit: string;
1403
+ delete: string;
1404
+ cancel: string;
1405
+ save: string;
1406
+ text: string;
1407
+ noMatch: string;
1408
+ source: {
1409
+ context: string;
1410
+ team: string;
1411
+ admin: string;
1412
+ };
1413
+ uses: string;
1414
+ fact: string;
1362
1415
  };
1363
1416
  };
1364
1417
  resolveAll: {
@@ -1,5 +1,5 @@
1
1
  import type React from 'react';
2
- import { type QuickReply } from '@ezychat/shared';
2
+ import { type QuickReply, type ReplyPhraseListItem } from '@ezychat/shared';
3
3
  export interface ComposerProps {
4
4
  quickReplies: QuickReply[];
5
5
  onSend(text: string): void;
@@ -35,6 +35,8 @@ export interface ComposerProps {
35
35
  lastCustomerMessageId: string | null;
36
36
  isAdmin: boolean;
37
37
  state: 'on' | 'unavailable';
38
+ /** The team's phrase list, matched on every key (docs/features/ai-phrase-dictionary). */
39
+ phrases?: readonly ReplyPhraseListItem[];
38
40
  } | null;
39
41
  }
40
42
  export declare function Composer({ quickReplies, onSend, onAttach, onVoiceNote, onTyping, confirmSend, disabled, placeholder, replyTo, onCancelReply, aiSuggest, }: ComposerProps): React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezychat/web",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
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.58",
43
+ "@ezychat/shared": "0.1.59",
44
44
  "@fontsource-variable/inter": "^5.3.0",
45
45
  "@tanstack/react-query": "^5.104.5",
46
46
  "@types/react": "^19.3.0",