@ezychat/web 0.1.85 → 0.1.87
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-Bcel7ZqO.js → admin-DA-ZeETJ.js} +126 -13
- package/dist-lib/chunks/{admin-BDciacjd.js → admin-PCeCUotx.js} +126 -13
- package/dist-lib/chunks/{auth-CQo75iLg.js → auth-DfAHhbd8.js} +10 -1
- package/dist-lib/chunks/{auth-Bc0bOKPN.js → auth-y6WyLxWX.js} +10 -1
- package/dist-lib/chunks/{common-BAoxGts5.js → common-5l92M5hP.js} +15 -3
- package/dist-lib/chunks/{common-C3KIPASu.js → common-BjtNhvrz.js} +15 -3
- package/dist-lib/chunks/{inbox-HnJhomm8.js → inbox-DpnmsGVa.js} +96 -2
- package/dist-lib/chunks/{inbox-wUMY4TKD.js → inbox-NBT3qYF9.js} +96 -2
- package/dist-lib/ezychat-web.css +1 -1
- package/dist-lib/index.js +10164 -8224
- package/dist-lib/types/admin/AiModelsSection.d.ts +6 -0
- package/dist-lib/types/admin/HiddenChats.d.ts +1 -1
- package/dist-lib/types/admin/LiveTranslateSection.d.ts +6 -0
- package/dist-lib/types/admin/ReplySuggestionsSection.d.ts +2 -1
- package/dist-lib/types/admin/SendPermissionFields.d.ts +13 -3
- package/dist-lib/types/admin/TokenPermissionsDialog.d.ts +7 -3
- package/dist-lib/types/admin/connectors/AgentPicker.d.ts +7 -0
- package/dist-lib/types/admin/connectors/GitHubAccountCard.d.ts +1 -1
- package/dist-lib/types/admin/connectors/connector-ui.d.ts +8 -0
- package/dist-lib/types/admin/connectors/google-connect.d.ts +1 -0
- package/dist-lib/types/api/ai-models.d.ts +50 -0
- package/dist-lib/types/api/ai.d.ts +1 -1
- package/dist-lib/types/api/chat-delete.d.ts +1 -1
- package/dist-lib/types/api/chat-hide.d.ts +1 -1
- package/dist-lib/types/api/connectors.d.ts +3 -0
- package/dist-lib/types/api/forward.d.ts +7 -0
- package/dist-lib/types/api/live-translate.d.ts +125 -0
- package/dist-lib/types/api/message-changes.d.ts +14 -0
- package/dist-lib/types/api/queries.d.ts +52 -2
- package/dist-lib/types/api/reply-suggestions.d.ts +0 -9
- package/dist-lib/types/api/templates.d.ts +7 -0
- package/dist-lib/types/auth/OAuthConsentPage.d.ts +5 -3
- package/dist-lib/types/i18n/resources.d.ts +237 -4
- package/dist-lib/types/inbox/ChatListItem.d.ts +3 -1
- package/dist-lib/types/inbox/ConversationHeader.d.ts +4 -1
- package/dist-lib/types/inbox/DeleteChatDialog.d.ts +1 -1
- package/dist-lib/types/inbox/LiveTranslate.d.ts +54 -0
- package/dist-lib/types/inbox/MessageBubble.d.ts +5 -1
- package/dist-lib/types/lib/tips.d.ts +1 -1
- package/dist-lib/types/nav/MemberAssistantCard.d.ts +1 -0
- package/dist-lib/types/nav/MyLanguageField.d.ts +5 -0
- package/package.json +2 -2
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings → AI → AI models (docs/ai-models.md, confirmed mock docs/features/ai-models-per-task/mock). One row per
|
|
3
|
+
* job an owner recognises; each picks Fast, Main model or a model the current connection lists, plus "Speed and
|
|
4
|
+
* quality" (Faster · Balanced · Smarter) when the model has a level. Each connection keeps its own choices.
|
|
5
|
+
*/
|
|
6
|
+
export declare function AiModelsSection(): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HiddenChatsInfo } from '@ezychat/shared';
|
|
2
2
|
/**
|
|
3
|
-
* Hide chats on Log out (docs/
|
|
3
|
+
* Hide chats on Log out (docs/chat-hide-delete.md Part A): the texts Admin → WhatsApp
|
|
4
4
|
* and Admin → Inboxes show around a Log out.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings → AI card. The team switch (on by default: all staff may use it; each person
|
|
3
|
+
* turns it on per chat) and a per-person daily limit (default 200). It uses the "Model for suggestions".
|
|
4
|
+
* Audited before/after as `settings.live_translate`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function LiveTranslateSection(): import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Settings → AI: the team-wide switch for AI reply suggestions. On by default on a new install with
|
|
3
|
-
* an AI connection, off after an update (a note says so); disabled without a connection.
|
|
3
|
+
* an AI connection, off after an update (a note says so); disabled without a connection. Which model
|
|
4
|
+
* writes them is AI models → Writing help (docs/ai-models.md).
|
|
4
5
|
*/
|
|
5
6
|
export declare function ReplySuggestionsSection(): import("react").JSX.Element;
|
|
@@ -2,13 +2,23 @@ export interface SendPermissions {
|
|
|
2
2
|
canSend: boolean;
|
|
3
3
|
/** Only meaningful while canSend is on; turning canSend off clears it. */
|
|
4
4
|
canNew: boolean;
|
|
5
|
+
/** Resolve and reopen chats (scope `inbox:manage`); independent of sending. */
|
|
6
|
+
canResolve: boolean;
|
|
5
7
|
}
|
|
6
8
|
/**
|
|
7
|
-
* "Can send WhatsApp messages" and, under it, "Can also message new numbers", each with its warning
|
|
8
|
-
* Shared by Create token and the Permissions dialog, so both show the same
|
|
9
|
+
* "Can send WhatsApp messages" and, under it, "Can also message new numbers", each with its warning,
|
|
10
|
+
* then "Can resolve chats". Shared by Create token and the Permissions dialog, so both show the same
|
|
11
|
+
* rules and texts.
|
|
9
12
|
*/
|
|
10
|
-
export declare function SendPermissionFields({ value, onChange, disabled, }: Readonly<{
|
|
13
|
+
export declare function SendPermissionFields({ value, onChange, disabled, newChatsBlocked, showResolve, }: Readonly<{
|
|
11
14
|
value: SendPermissions;
|
|
12
15
|
onChange: (next: SendPermissions) => void;
|
|
13
16
|
disabled: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* A team member who cannot start new chats in the app (mcp-for-members): "message new numbers" shows
|
|
19
|
+
* greyed with a tip, since the server refuses it for them anyway.
|
|
20
|
+
*/
|
|
21
|
+
newChatsBlocked?: boolean;
|
|
22
|
+
/** A team member's token never resolves chats (`inbox:manage` is admin-only), so the box is hidden. */
|
|
23
|
+
showResolve?: boolean;
|
|
14
24
|
}>): import("react").JSX.Element;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { ApiToken } from '@ezychat/shared';
|
|
2
2
|
/**
|
|
3
|
-
* The owner of a token changes whether its AI assistant may send,
|
|
4
|
-
* new token. The same options and warnings as Create token.
|
|
3
|
+
* The owner of a token changes whether its AI assistant may send, message new numbers and resolve
|
|
4
|
+
* chats, without a new token. The same options and warnings as Create token.
|
|
5
5
|
*/
|
|
6
|
-
export declare function TokenPermissionsDialog({ token, onClose, }: Readonly<{
|
|
6
|
+
export declare function TokenPermissionsDialog({ token, onClose, member, }: Readonly<{
|
|
7
7
|
token: ApiToken | null;
|
|
8
8
|
onClose: () => void;
|
|
9
|
+
/** A team member's own connected app (My AI assistants): their wording and new-chat rule. */
|
|
10
|
+
member?: {
|
|
11
|
+
canStartNewChats: boolean;
|
|
12
|
+
};
|
|
9
13
|
}>): import("react").JSX.Element;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { AiAgentSummary } from '@ezychat/shared';
|
|
3
|
+
/**
|
|
4
|
+
* The agent a connector page was opened from (Agent page → Connectors card), for "Back to AI agent".
|
|
5
|
+
* `from=agent` = the agent in `&agent=`; `from=agent:<id>` = the one it was opened from, kept when
|
|
6
|
+
* another agent is picked. Only an agent that still exists counts: a stale id gives null, so the
|
|
7
|
+
* breadcrumb and the picker never point back to an agent the page does not show.
|
|
8
|
+
*/
|
|
9
|
+
export declare function wayBackAgent(params: URLSearchParams, agents: readonly Pick<AiAgentSummary, 'id'>[] | undefined): number | null;
|
|
3
10
|
/**
|
|
4
11
|
* A connector's Settings tab: one AI agent at a time (`&agent=<id>` picks it; a picker shows with
|
|
5
12
|
* 2+ agents). `render` draws the chosen agent's settings.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The GitHub sign-in (one per install, design docs/
|
|
2
|
+
* The GitHub sign-in (one per install, design docs/github.md): Sign in with
|
|
3
3
|
* GitHub (Anchor Sprint's GitHub App, through GitHub's device flow) or a fine-grained token; the
|
|
4
4
|
* install step, the token expiry, problems and Disconnect. Repositories per agent are on Settings.
|
|
5
5
|
*/
|
|
@@ -69,6 +69,14 @@ export declare function ToolSwitchRow({ id, label, hint, badge, tip, checked, di
|
|
|
69
69
|
* While Google's file picker is open in another window (Google Sheets, Google Drive): what is
|
|
70
70
|
* happening, a link to open it again (the browser may have blocked the window) and Cancel.
|
|
71
71
|
*/
|
|
72
|
+
/**
|
|
73
|
+
* Google sign-in and file picking finish in a browser on the computer that runs EzyChat. From
|
|
74
|
+
* another device (the tunnel address or the LAN) they never start: this says so, in plain words.
|
|
75
|
+
*/
|
|
76
|
+
export declare function RemoteOnlyNotice({ testId, textKey, }: Readonly<{
|
|
77
|
+
testId: string;
|
|
78
|
+
textKey: 'connectors.gc.remoteSignIn' | 'connectors.sheets.remotePick' | 'connectors.drive.remotePick';
|
|
79
|
+
}>): import("react").JSX.Element;
|
|
72
80
|
export declare function PickerWaiting({ testId, title, hint, url, blocked, openLabel, sameComputer, onCancel, }: Readonly<{
|
|
73
81
|
testId: string;
|
|
74
82
|
title: string;
|
|
@@ -62,6 +62,7 @@ export declare function GoogleAccountCard({ testId, icon: Icon, query, flow, dis
|
|
|
62
62
|
query: UseQueryResult<{
|
|
63
63
|
state: GoogleCalendarState;
|
|
64
64
|
account: string | null;
|
|
65
|
+
onThisComputer?: boolean;
|
|
65
66
|
}>;
|
|
66
67
|
flow: GoogleConnectFlow;
|
|
67
68
|
disconnect: UseMutationResult<unknown, Error, void>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Settings → AI → AI models (docs/ai-models.md): the current connection's rows. Admins only. */
|
|
2
|
+
export declare const taskModelsKey: readonly ["ai", "taskModels"];
|
|
3
|
+
export declare function useTaskModels(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
|
|
4
|
+
mode: "api" | "chatgpt" | "claude";
|
|
5
|
+
mainModel: string;
|
|
6
|
+
fastModel: string;
|
|
7
|
+
models: {
|
|
8
|
+
id: string;
|
|
9
|
+
thinking: boolean;
|
|
10
|
+
tier: "balanced" | "fast" | "smart" | null;
|
|
11
|
+
}[];
|
|
12
|
+
tasks: Record<"translate" | "agentReplies" | "askEzy" | "writing" | "background", {
|
|
13
|
+
choice: string;
|
|
14
|
+
thinking: "high" | "medium" | "low" | null;
|
|
15
|
+
model: string;
|
|
16
|
+
effectiveThinking: "high" | "medium" | "low" | null;
|
|
17
|
+
unavailable: string | null;
|
|
18
|
+
isDefault: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
defaults: Record<"translate" | "agentReplies" | "askEzy" | "writing" | "background", {
|
|
21
|
+
choice: "main" | "fast";
|
|
22
|
+
}>;
|
|
23
|
+
}, Error>;
|
|
24
|
+
/** Saves the changed rows (null = back to the default); the current connection only. */
|
|
25
|
+
export declare function useSaveTaskModels(): import("@tanstack/react-query").UseMutationResult<{
|
|
26
|
+
mode: "api" | "chatgpt" | "claude";
|
|
27
|
+
mainModel: string;
|
|
28
|
+
fastModel: string;
|
|
29
|
+
models: {
|
|
30
|
+
id: string;
|
|
31
|
+
thinking: boolean;
|
|
32
|
+
tier: "balanced" | "fast" | "smart" | null;
|
|
33
|
+
}[];
|
|
34
|
+
tasks: Record<"translate" | "agentReplies" | "askEzy" | "writing" | "background", {
|
|
35
|
+
choice: string;
|
|
36
|
+
thinking: "high" | "medium" | "low" | null;
|
|
37
|
+
model: string;
|
|
38
|
+
effectiveThinking: "high" | "medium" | "low" | null;
|
|
39
|
+
unavailable: string | null;
|
|
40
|
+
isDefault: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
defaults: Record<"translate" | "agentReplies" | "askEzy" | "writing" | "background", {
|
|
43
|
+
choice: "main" | "fast";
|
|
44
|
+
}>;
|
|
45
|
+
}, Error, {
|
|
46
|
+
tasks: Partial<Record<"translate" | "agentReplies" | "askEzy" | "writing" | "background", {
|
|
47
|
+
choice: string;
|
|
48
|
+
thinking?: "high" | "medium" | "low" | undefined;
|
|
49
|
+
} | null>>;
|
|
50
|
+
}, unknown>;
|
|
@@ -268,7 +268,7 @@ export declare const aiAgentsKey: readonly ["ai-agents"];
|
|
|
268
268
|
export declare const aiAgentKey: (agentId: number) => readonly ["ai-agent", number];
|
|
269
269
|
/** One item with its text, under its agent (the agent is part of the key and of the path). */
|
|
270
270
|
export declare const aiAgentDocumentKey: (agentId: number, id: number) => readonly ["ai-document", number, number];
|
|
271
|
-
export declare function useAiAgents(): import("@tanstack/react-query").UseQueryResult<{
|
|
271
|
+
export declare function useAiAgents(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
|
|
272
272
|
agents: {
|
|
273
273
|
id: number;
|
|
274
274
|
userId: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type QueryClient } from '@tanstack/react-query';
|
|
2
2
|
/**
|
|
3
|
-
* Delete chat (admins, docs/
|
|
3
|
+
* Delete chat (admins, docs/chat-hide-delete.md Part B): the chat, its messages,
|
|
4
4
|
* notes and files go for good in EzyChat; the WhatsApp phone keeps its copy.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type QueryClient } from '@tanstack/react-query';
|
|
2
2
|
/**
|
|
3
|
-
* Hide chats on Log out (docs/
|
|
3
|
+
* Hide chats on Log out (docs/chat-hide-delete.md Part A): when a linked phone logs
|
|
4
4
|
* out, every chat of its inbox is hidden (never deleted) until the same number links again.
|
|
5
5
|
*/
|
|
6
6
|
/** Every read of one inbox's hidden-chat counts (any connection state). */
|
|
@@ -14,6 +14,7 @@ export declare function useGoogleCalendar(enabled?: boolean): import("@tanstack/
|
|
|
14
14
|
}[];
|
|
15
15
|
connectedAt: number | null;
|
|
16
16
|
problemSince: number | null;
|
|
17
|
+
onThisComputer: boolean;
|
|
17
18
|
}, Error>;
|
|
18
19
|
/** Starts Google's sign-in: the page opens `authorizationUrl` and polls the request. */
|
|
19
20
|
export declare function useGoogleCalendarConnect(): import("@tanstack/react-query").UseMutationResult<{
|
|
@@ -113,6 +114,7 @@ export declare function useGoogleSheets(enabled?: boolean): import("@tanstack/re
|
|
|
113
114
|
account: string | null;
|
|
114
115
|
connectedAt: number | null;
|
|
115
116
|
problemSince: number | null;
|
|
117
|
+
onThisComputer: boolean;
|
|
116
118
|
}, Error>;
|
|
117
119
|
/** Starts Google's sign-in for Google Sheets (its own sign-in, separate from the calendar's). */
|
|
118
120
|
export declare function useGoogleSheetsConnect(): import("@tanstack/react-query").UseMutationResult<{
|
|
@@ -249,6 +251,7 @@ export declare function useGoogleDrive(enabled?: boolean): import("@tanstack/rea
|
|
|
249
251
|
account: string | null;
|
|
250
252
|
connectedAt: number | null;
|
|
251
253
|
problemSince: number | null;
|
|
254
|
+
onThisComputer: boolean;
|
|
252
255
|
}, Error>;
|
|
253
256
|
/** Starts Google's sign-in for Google Drive (its own sign-in, separate from Calendar and Sheets). */
|
|
254
257
|
export declare function useGoogleDriveConnect(): import("@tanstack/react-query").UseMutationResult<{
|
|
@@ -69,6 +69,13 @@ export declare function useForwardMessage(): import("@tanstack/react-query").Use
|
|
|
69
69
|
deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
|
|
70
70
|
deletedByUserId?: number | null | undefined;
|
|
71
71
|
hidden?: boolean | undefined;
|
|
72
|
+
typed?: {
|
|
73
|
+
typedText: string;
|
|
74
|
+
typedLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
75
|
+
sentLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
76
|
+
edited: boolean;
|
|
77
|
+
} | null | undefined;
|
|
78
|
+
sentOriginal?: boolean | undefined;
|
|
72
79
|
}[];
|
|
73
80
|
}, Error, {
|
|
74
81
|
id: string;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { TRANSLATE_LANGUAGES, type ChatTranslateState, type Message, type TranslateLanguage } from '@ezychat/shared';
|
|
2
|
+
export { TRANSLATE_LANGUAGES };
|
|
3
|
+
export type { TranslateLanguage };
|
|
4
|
+
/** Each language in its own name (the pickers show these). */
|
|
5
|
+
export declare const NATIVE: Record<"en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko", string>;
|
|
6
|
+
export declare const statusKey: readonly ["live-translate", "status"];
|
|
7
|
+
export declare const chatStateKey: (jid: string) => readonly ["live-translate", "chat", string];
|
|
8
|
+
export declare const translationsKey: (jid: string, my: TranslateLanguage) => readonly ["live-translate", "translations", string, "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko"];
|
|
9
|
+
/** The admin switch, the limit, whether AI is connected and my use today. Refetched on focus: it is a counter. */
|
|
10
|
+
export declare function useLiveTranslateStatus(): import("@tanstack/react-query").UseQueryResult<{
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
dailyLimit: number;
|
|
13
|
+
connected: boolean;
|
|
14
|
+
usedToday: number;
|
|
15
|
+
peopleToday?: number | undefined;
|
|
16
|
+
translationsToday?: number | undefined;
|
|
17
|
+
}, Error>;
|
|
18
|
+
/** Admins: the switch and the daily limit (Settings → AI). */
|
|
19
|
+
export declare function useSetLiveTranslateSettings(): import("@tanstack/react-query").UseMutationResult<{
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
dailyLimit: number;
|
|
22
|
+
connected: boolean;
|
|
23
|
+
usedToday: number;
|
|
24
|
+
peopleToday?: number | undefined;
|
|
25
|
+
translationsToday?: number | undefined;
|
|
26
|
+
}, Error, Partial<{
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
dailyLimit: number;
|
|
29
|
+
}>, unknown>;
|
|
30
|
+
/** My language and "Send without preview", read from `/api/me`. */
|
|
31
|
+
export declare function useMyTranslate(): {
|
|
32
|
+
myLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
33
|
+
myLanguageSet: boolean;
|
|
34
|
+
sendWithoutPreview: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare function useSetMyTranslate(): import("@tanstack/react-query").UseMutationResult<unknown, Error, {
|
|
37
|
+
translateLanguage?: TranslateLanguage;
|
|
38
|
+
sendWithoutPreview?: boolean;
|
|
39
|
+
}, unknown>;
|
|
40
|
+
export declare function useChatTranslate(jid: string): import("@tanstack/react-query").UseQueryResult<{
|
|
41
|
+
on: boolean;
|
|
42
|
+
customerLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
43
|
+
detected: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
44
|
+
mixed: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
45
|
+
outgoingLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
46
|
+
outgoingDetected: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
47
|
+
}, Error>;
|
|
48
|
+
export declare function useSetChatTranslate(jid: string): import("@tanstack/react-query").UseMutationResult<{
|
|
49
|
+
on: boolean;
|
|
50
|
+
customerLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
51
|
+
detected: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
52
|
+
mixed: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
53
|
+
outgoingLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
54
|
+
outgoingDetected: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
55
|
+
}, Error, {
|
|
56
|
+
on?: boolean | undefined;
|
|
57
|
+
customerLanguage?: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null | undefined;
|
|
58
|
+
outgoingLanguage?: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null | undefined;
|
|
59
|
+
}, unknown>;
|
|
60
|
+
/** The customer's language: chosen by the team, else detected. */
|
|
61
|
+
export declare function customerLanguageOf(chat: ChatTranslateState | undefined): TranslateLanguage | null;
|
|
62
|
+
/** The language a reply goes out in: the customer's (a direct chat) or the group's one language. */
|
|
63
|
+
export declare function outgoingLanguageOf(chat: ChatTranslateState | undefined, isGroup: boolean): TranslateLanguage | null;
|
|
64
|
+
/** What a bubble shows for one message, from the server's answer (or why there is none). */
|
|
65
|
+
export type BubbleTranslation = {
|
|
66
|
+
kind: 'translated';
|
|
67
|
+
text: string;
|
|
68
|
+
from: TranslateLanguage;
|
|
69
|
+
} | {
|
|
70
|
+
kind: 'failed';
|
|
71
|
+
code: 'unsafe' | 'limit' | 'ai' | 'offline' | 'error';
|
|
72
|
+
from?: TranslateLanguage;
|
|
73
|
+
};
|
|
74
|
+
/** Everything a bubble needs, shared through the conversation. */
|
|
75
|
+
export interface ChatTranslateContextValue {
|
|
76
|
+
active: boolean;
|
|
77
|
+
my: TranslateLanguage;
|
|
78
|
+
showOriginals: boolean;
|
|
79
|
+
translations: Record<string, BubbleTranslation | null>;
|
|
80
|
+
pending: boolean;
|
|
81
|
+
retry(): void;
|
|
82
|
+
}
|
|
83
|
+
export declare const ChatTranslateContext: import("react").Context<ChatTranslateContextValue | null>;
|
|
84
|
+
export declare function useBubbleTranslation(m: Message): {
|
|
85
|
+
ctx: ChatTranslateContextValue;
|
|
86
|
+
tr: BubbleTranslation | null;
|
|
87
|
+
} | null;
|
|
88
|
+
/** Texts that need a translation: with a typed record the writer's own text is already known, so no call. */
|
|
89
|
+
export declare function needsTranslation(m: Message): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Translations of the loaded text messages, only while Live translate is on. The server caches them per message,
|
|
92
|
+
* revision and target language (a reload or a teammate with the same language costs nothing); here each answer is
|
|
93
|
+
* kept in the query cache so a message is asked for once. A failed ask is shown on the bubble and retried only by
|
|
94
|
+
* the person ("Try again"), never by itself.
|
|
95
|
+
*/
|
|
96
|
+
export declare function useChatTranslations(jid: string, messages: readonly Message[], my: TranslateLanguage, active: boolean): {
|
|
97
|
+
translations: Record<string, BubbleTranslation | null>;
|
|
98
|
+
pending: boolean;
|
|
99
|
+
retry: () => void;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* The translated last message of each listed chat where my switch is on, from what this tab already holds
|
|
103
|
+
* (chats opened here). The list never asks the AI. Works without a query client (then nothing is translated).
|
|
104
|
+
*/
|
|
105
|
+
export declare function useCachedLastTranslations(chats: readonly {
|
|
106
|
+
jid: string;
|
|
107
|
+
lastMessagePreview: string | null;
|
|
108
|
+
}[]): ReadonlyMap<string, string>;
|
|
109
|
+
/** The text for the customer, checked on the server (protected items kept). Nothing is stored or sent. */
|
|
110
|
+
export declare function translateDraft(jid: string, body: {
|
|
111
|
+
text: string;
|
|
112
|
+
target: TranslateLanguage;
|
|
113
|
+
}): Promise<{
|
|
114
|
+
status: "ok";
|
|
115
|
+
translation: string;
|
|
116
|
+
from: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
117
|
+
protected: string[];
|
|
118
|
+
draftId: string;
|
|
119
|
+
} | {
|
|
120
|
+
status: "refused";
|
|
121
|
+
item: string;
|
|
122
|
+
became: string;
|
|
123
|
+
}>;
|
|
124
|
+
/** Chat-level "Show originals", kept per chat for this browser tab. */
|
|
125
|
+
export declare function useShowOriginals(jid: string): readonly [boolean, import("react").Dispatch<import("react").SetStateAction<boolean>>];
|
|
@@ -79,6 +79,13 @@ export declare function useEditMessage(): import("@tanstack/react-query").UseMut
|
|
|
79
79
|
deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
|
|
80
80
|
deletedByUserId?: number | null | undefined;
|
|
81
81
|
hidden?: boolean | undefined;
|
|
82
|
+
typed?: {
|
|
83
|
+
typedText: string;
|
|
84
|
+
typedLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
85
|
+
sentLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
86
|
+
edited: boolean;
|
|
87
|
+
} | null | undefined;
|
|
88
|
+
sentOriginal?: boolean | undefined;
|
|
82
89
|
}, Error, {
|
|
83
90
|
id: string;
|
|
84
91
|
text: string;
|
|
@@ -148,6 +155,13 @@ export declare function useDeleteMessage(): import("@tanstack/react-query").UseM
|
|
|
148
155
|
deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
|
|
149
156
|
deletedByUserId?: number | null | undefined;
|
|
150
157
|
hidden?: boolean | undefined;
|
|
158
|
+
typed?: {
|
|
159
|
+
typedText: string;
|
|
160
|
+
typedLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
161
|
+
sentLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
162
|
+
edited: boolean;
|
|
163
|
+
} | null | undefined;
|
|
164
|
+
sentOriginal?: boolean | undefined;
|
|
151
165
|
}, Error, {
|
|
152
166
|
id: string;
|
|
153
167
|
scope: "everyone" | "me";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InfiniteData, type QueryClient } from '@tanstack/react-query';
|
|
2
|
-
import { type ReportPeriod, type CreateApiTokenBodyInput, type UpdateApiTokenBody, type Chat, type ChatListResponse, type ChatStatus, type DirectoryUser, type InboxStatusPayload, type SetMemberChatsBody, type Message, type MessageListResponse, type MessageLocateResponse, type PatchUserBody, type Settings, type WaStatus } from '@ezychat/shared';
|
|
2
|
+
import { type ReportPeriod, type CreateApiTokenBodyInput, type UpdateApiTokenBody, type Chat, type ChatListResponse, type ChatStatus, type DirectoryUser, type InboxStatusPayload, type SetMemberChatsBody, type Message, type MessageListResponse, type MessageLocateResponse, type PatchUserBody, type Settings, type SendTranslation, type TranslateLanguage, type WaStatus } from '@ezychat/shared';
|
|
3
3
|
export interface ChatFilters {
|
|
4
4
|
status?: ChatStatus;
|
|
5
5
|
assigned: 'me' | 'none' | 'any';
|
|
@@ -123,6 +123,8 @@ export declare function useSetMyLocale(): import("@tanstack/react-query").UseMut
|
|
|
123
123
|
disabled: boolean;
|
|
124
124
|
createdAt: number;
|
|
125
125
|
locale: "en" | "ms" | "zh-CN" | null;
|
|
126
|
+
translateLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko" | null;
|
|
127
|
+
sendWithoutPreview: boolean;
|
|
126
128
|
kind?: "ai" | "human" | undefined;
|
|
127
129
|
aiRole?: "sales" | undefined;
|
|
128
130
|
aiAgentId?: number | undefined;
|
|
@@ -337,6 +339,13 @@ export declare function useMessages(jid: string | null | undefined): import("@ta
|
|
|
337
339
|
deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
|
|
338
340
|
deletedByUserId?: number | null | undefined;
|
|
339
341
|
hidden?: boolean | undefined;
|
|
342
|
+
typed?: {
|
|
343
|
+
typedText: string;
|
|
344
|
+
typedLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
345
|
+
sentLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
346
|
+
edited: boolean;
|
|
347
|
+
} | null | undefined;
|
|
348
|
+
sentOriginal?: boolean | undefined;
|
|
340
349
|
}[];
|
|
341
350
|
nextBefore: string | null;
|
|
342
351
|
}, unknown>, Error>;
|
|
@@ -353,6 +362,12 @@ export interface SendTextInput {
|
|
|
353
362
|
shown?: string;
|
|
354
363
|
/** Generate with `newClientId()` (a random UUID). */
|
|
355
364
|
clientId: string;
|
|
365
|
+
/** Live translate: the checked translation being sent (the server keeps what was typed beside it). */
|
|
366
|
+
translation?: SendTranslation;
|
|
367
|
+
/** Live translate "Send original instead": the text goes out as typed. */
|
|
368
|
+
sentOriginal?: boolean;
|
|
369
|
+
/** Live translate: the language the text goes out in (for the pending bubble only). */
|
|
370
|
+
sentLanguage?: TranslateLanguage;
|
|
356
371
|
}
|
|
357
372
|
/** Optimistic text send: inserts a pending bubble immediately, reconciled by clientId. */
|
|
358
373
|
export declare function useSendText(jid: string): import("@tanstack/react-query").UseMutationResult<{
|
|
@@ -420,6 +435,13 @@ export declare function useSendText(jid: string): import("@tanstack/react-query"
|
|
|
420
435
|
deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
|
|
421
436
|
deletedByUserId?: number | null | undefined;
|
|
422
437
|
hidden?: boolean | undefined;
|
|
438
|
+
typed?: {
|
|
439
|
+
typedText: string;
|
|
440
|
+
typedLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
441
|
+
sentLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
442
|
+
edited: boolean;
|
|
443
|
+
} | null | undefined;
|
|
444
|
+
sentOriginal?: boolean | undefined;
|
|
423
445
|
}, Error, SendTextInput, {
|
|
424
446
|
clientId: string;
|
|
425
447
|
}>;
|
|
@@ -504,6 +526,13 @@ export declare function useSendMedia(jid: string): import("@tanstack/react-query
|
|
|
504
526
|
deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
|
|
505
527
|
deletedByUserId?: number | null | undefined;
|
|
506
528
|
hidden?: boolean | undefined;
|
|
529
|
+
typed?: {
|
|
530
|
+
typedText: string;
|
|
531
|
+
typedLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
532
|
+
sentLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
533
|
+
edited: boolean;
|
|
534
|
+
} | null | undefined;
|
|
535
|
+
sentOriginal?: boolean | undefined;
|
|
507
536
|
}, Error, SendMediaInput, void>;
|
|
508
537
|
export declare function useRetryMessage(): import("@tanstack/react-query").UseMutationResult<{
|
|
509
538
|
id: string;
|
|
@@ -570,6 +599,13 @@ export declare function useRetryMessage(): import("@tanstack/react-query").UseMu
|
|
|
570
599
|
deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
|
|
571
600
|
deletedByUserId?: number | null | undefined;
|
|
572
601
|
hidden?: boolean | undefined;
|
|
602
|
+
typed?: {
|
|
603
|
+
typedText: string;
|
|
604
|
+
typedLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
605
|
+
sentLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
606
|
+
edited: boolean;
|
|
607
|
+
} | null | undefined;
|
|
608
|
+
sentOriginal?: boolean | undefined;
|
|
573
609
|
}, Error, string, unknown>;
|
|
574
610
|
/**
|
|
575
611
|
* The linked number reacts to a message (`emoji` '' removes the reaction). The answer carries the
|
|
@@ -1032,14 +1068,21 @@ export declare function useMcpSettings(): import("@tanstack/react-query").UseQue
|
|
|
1032
1068
|
endpointPath: string;
|
|
1033
1069
|
publicUrl: string | null;
|
|
1034
1070
|
localUrl: string;
|
|
1071
|
+
membersEnabled: boolean;
|
|
1072
|
+
canConnect: boolean;
|
|
1073
|
+
canMessageNewNumbers: boolean;
|
|
1035
1074
|
}, Error>;
|
|
1036
1075
|
export declare function usePatchMcpSettings(): import("@tanstack/react-query").UseMutationResult<{
|
|
1037
1076
|
enabled: boolean;
|
|
1038
1077
|
endpointPath: string;
|
|
1039
1078
|
publicUrl: string | null;
|
|
1040
1079
|
localUrl: string;
|
|
1080
|
+
membersEnabled: boolean;
|
|
1081
|
+
canConnect: boolean;
|
|
1082
|
+
canMessageNewNumbers: boolean;
|
|
1041
1083
|
}, Error, {
|
|
1042
|
-
enabled
|
|
1084
|
+
enabled?: boolean | undefined;
|
|
1085
|
+
membersEnabled?: boolean | undefined;
|
|
1043
1086
|
}, unknown>;
|
|
1044
1087
|
/** The approval page of the MCP sign-in: which app asks, and where it returns to. */
|
|
1045
1088
|
export declare function useOAuthRequest(search: string): import("@tanstack/react-query").UseQueryResult<{
|
|
@@ -1059,6 +1102,7 @@ export declare function useOAuthDecision(): import("@tanstack/react-query").UseM
|
|
|
1059
1102
|
state?: string | undefined;
|
|
1060
1103
|
scope?: string | undefined;
|
|
1061
1104
|
resource?: string | undefined;
|
|
1105
|
+
canSend?: boolean | undefined;
|
|
1062
1106
|
}, unknown>;
|
|
1063
1107
|
export declare function useApiTokens(): import("@tanstack/react-query").UseQueryResult<{
|
|
1064
1108
|
id: number;
|
|
@@ -1071,7 +1115,9 @@ export declare function useApiTokens(): import("@tanstack/react-query").UseQuery
|
|
|
1071
1115
|
expiresAt: number | null;
|
|
1072
1116
|
canSend: boolean;
|
|
1073
1117
|
canMessageNewNumbers: boolean;
|
|
1118
|
+
canResolveChats: boolean;
|
|
1074
1119
|
connectedApp: boolean;
|
|
1120
|
+
memberToken: boolean;
|
|
1075
1121
|
}[], Error>;
|
|
1076
1122
|
export interface CreateApiTokenVars {
|
|
1077
1123
|
body: CreateApiTokenBodyInput;
|
|
@@ -1093,7 +1139,9 @@ export declare function useCreateApiToken(): import("@tanstack/react-query").Use
|
|
|
1093
1139
|
expiresAt: number | null;
|
|
1094
1140
|
canSend: boolean;
|
|
1095
1141
|
canMessageNewNumbers: boolean;
|
|
1142
|
+
canResolveChats: boolean;
|
|
1096
1143
|
connectedApp: boolean;
|
|
1144
|
+
memberToken: boolean;
|
|
1097
1145
|
}, Error, CreateApiTokenVars, unknown>;
|
|
1098
1146
|
/** Changes whether a token may send (and message new numbers); only its owner may. */
|
|
1099
1147
|
export declare function useUpdateApiToken(): import("@tanstack/react-query").UseMutationResult<{
|
|
@@ -1107,7 +1155,9 @@ export declare function useUpdateApiToken(): import("@tanstack/react-query").Use
|
|
|
1107
1155
|
expiresAt: number | null;
|
|
1108
1156
|
canSend: boolean;
|
|
1109
1157
|
canMessageNewNumbers: boolean;
|
|
1158
|
+
canResolveChats: boolean;
|
|
1110
1159
|
connectedApp: boolean;
|
|
1160
|
+
memberToken: boolean;
|
|
1111
1161
|
}, Error, {
|
|
1112
1162
|
id: number;
|
|
1113
1163
|
body: UpdateApiTokenBody;
|
|
@@ -52,15 +52,6 @@ export declare function usePhrasesAdmin(agentId: number | null): import("@tansta
|
|
|
52
52
|
fact: boolean;
|
|
53
53
|
}[];
|
|
54
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>;
|
|
64
55
|
/** The rest of the sentence being typed, or null. */
|
|
65
56
|
export declare function fetchCompletion(jid: string, text: string, signal: AbortSignal): Promise<{
|
|
66
57
|
completion: string | null;
|
|
@@ -93,6 +93,13 @@ export declare function useSendTemplate(jid: string): import("@tanstack/react-qu
|
|
|
93
93
|
deletedBy?: "phone" | "team" | "sender" | "group_admin" | null | undefined;
|
|
94
94
|
deletedByUserId?: number | null | undefined;
|
|
95
95
|
hidden?: boolean | undefined;
|
|
96
|
+
typed?: {
|
|
97
|
+
typedText: string;
|
|
98
|
+
typedLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
99
|
+
sentLanguage: "en" | "ms" | "id" | "zh" | "ta" | "th" | "vi" | "ar" | "ja" | "ko";
|
|
100
|
+
edited: boolean;
|
|
101
|
+
} | null | undefined;
|
|
102
|
+
sentOriginal?: boolean | undefined;
|
|
96
103
|
}, Error, {
|
|
97
104
|
name: string;
|
|
98
105
|
language: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* /oauth/authorize: an AI assistant app (claude.ai, ChatGPT, …) sent the
|
|
3
|
-
* connection to the inbox. Approve sends the browser back to the
|
|
4
|
-
* server never redirects an unchecked request (bad requests stay on this
|
|
2
|
+
* /oauth/authorize: an AI assistant app (claude.ai, ChatGPT, …) sent the signed-in person here to
|
|
3
|
+
* approve its connection to the inbox, always for themselves. Approve sends the browser back to the
|
|
4
|
+
* app with a one-time code; the server never redirects an unchecked request (bad requests stay on this
|
|
5
|
+
* page). A team member (while the admin lets members connect, docs/features/mcp-for-members) sees what
|
|
6
|
+
* the assistant reaches as them and may tick "Let it send" (off by default); admins keep their page.
|
|
5
7
|
*/
|
|
6
8
|
export declare function OAuthConsentPage(): import("react").JSX.Element;
|