@ezychat/web 0.1.84 → 0.1.86

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.
Files changed (53) hide show
  1. package/dist-lib/assets/font-9f04f14429bb.woff2 +0 -0
  2. package/dist-lib/chunks/{admin-T9Qs91WR.js → admin-CGWT-MJA.js} +71 -59
  3. package/dist-lib/chunks/{admin-BSIc8-DD.js → admin-n8lWCbmd.js} +71 -59
  4. package/dist-lib/chunks/{common-BE996sRJ.js → common-BeKNf4n-.js} +43 -3
  5. package/dist-lib/chunks/{common-CBTam36M.js → common-jotvJJL9.js} +43 -3
  6. package/dist-lib/chunks/{inbox-C2IIv9Z3.js → inbox-D4VV1Cmg.js} +164 -59
  7. package/dist-lib/chunks/{inbox-BRsRaRZn.js → inbox-_dK6whtW.js} +164 -59
  8. package/dist-lib/ezychat-web.css +1 -1
  9. package/dist-lib/index.js +12065 -8683
  10. package/dist-lib/types/admin/AdminLayout.d.ts +21 -5
  11. package/dist-lib/types/admin/AgentDreamCard.d.ts +9 -0
  12. package/dist-lib/types/admin/AgentResolutionCard.d.ts +1 -1
  13. package/dist-lib/types/admin/DreamChangeDialog.d.ts +14 -0
  14. package/dist-lib/types/admin/HiddenChats.d.ts +16 -0
  15. package/dist-lib/types/admin/LiveTranslateSection.d.ts +6 -0
  16. package/dist-lib/types/admin/SendPermissionFields.d.ts +5 -2
  17. package/dist-lib/types/admin/TokenPermissionsDialog.d.ts +2 -2
  18. package/dist-lib/types/admin/connectors/ConnectorDetailPage.d.ts +1 -1
  19. package/dist-lib/types/admin/connectors/GitHubAccountCard.d.ts +8 -0
  20. package/dist-lib/types/admin/connectors/GitHubSettingsCard.d.ts +4 -0
  21. package/dist-lib/types/admin/connectors/catalog.d.ts +6 -6
  22. package/dist-lib/types/admin/connectors/connector-ui.d.ts +8 -0
  23. package/dist-lib/types/admin/connectors/google-connect.d.ts +1 -0
  24. package/dist-lib/types/api/chat-delete.d.ts +16 -0
  25. package/dist-lib/types/api/chat-hide.d.ts +21 -0
  26. package/dist-lib/types/api/connectors.d.ts +131 -0
  27. package/dist-lib/types/api/dream.d.ts +91 -0
  28. package/dist-lib/types/api/forward.d.ts +7 -0
  29. package/dist-lib/types/api/live-translate.d.ts +125 -0
  30. package/dist-lib/types/api/message-changes.d.ts +14 -0
  31. package/dist-lib/types/api/queries.d.ts +45 -1
  32. package/dist-lib/types/api/scheduled-tasks.d.ts +6 -6
  33. package/dist-lib/types/api/templates.d.ts +7 -0
  34. package/dist-lib/types/askezy/api.d.ts +2 -2
  35. package/dist-lib/types/auth/LoginPage.d.ts +1 -0
  36. package/dist-lib/types/auth/UserMenu.d.ts +2 -0
  37. package/dist-lib/types/extensions/index.d.ts +1 -1
  38. package/dist-lib/types/extensions/routes.d.ts +3 -1
  39. package/dist-lib/types/i18n/resources.d.ts +399 -8
  40. package/dist-lib/types/inbox/ChatListItem.d.ts +3 -1
  41. package/dist-lib/types/inbox/ConversationHeader.d.ts +6 -1
  42. package/dist-lib/types/inbox/DeleteChatDialog.d.ts +12 -0
  43. package/dist-lib/types/inbox/LiveTranslate.d.ts +54 -0
  44. package/dist-lib/types/lib/tips.d.ts +1 -1
  45. package/dist-lib/types/lib/version.d.ts +4 -0
  46. package/dist-lib/types/lite-import/steps.d.ts +7 -2
  47. package/dist-lib/types/nav/AccountPage.d.ts +2 -0
  48. package/dist-lib/types/nav/AppNav.d.ts +10 -0
  49. package/dist-lib/types/nav/MyLanguageField.d.ts +5 -0
  50. package/dist-lib/types/nav/PhoneBar.d.ts +14 -0
  51. package/dist-lib/types/nav/attention.d.ts +4 -0
  52. package/package.json +11 -10
  53. package/dist-lib/types/askezy/AskEzyButton.d.ts +0 -8
@@ -1,5 +1,4 @@
1
1
  import { type LucideIcon } from 'lucide-react';
2
- import { type WebExtension, type WebExtensionAdminSection } from '../extensions';
3
2
  /**
4
3
  * Every core admin section. `labelKey` is a translation key in the `admin` namespace. WhatsApp and
5
4
  * Inboxes never show together: see `visibleAdminNav`.
@@ -51,11 +50,28 @@ export type AdminNavItem = (typeof ADMIN_NAV)[number];
51
50
  * one WhatsApp number (Lite allows one, so it keeps WhatsApp).
52
51
  */
53
52
  export declare function visibleAdminNav(multiInbox: boolean): AdminNavItem[];
54
- /** The core section an extension admin route declares for this path (e.g. `members`). */
55
- export declare function extensionSectionOf(extensions: readonly WebExtension[], pathname: string): WebExtensionAdminSection | undefined;
56
53
  /**
57
- * Admin shell. Side nav on >= md; on phones a top bar with a Sheet menu.
58
- * Mounted by App.tsx at `/admin/*`; non-admins are redirected to `/`.
54
+ * The groups of the phone Settings list. A section in no group (a new `ADMIN_NAV` entry) is returned as
55
+ * `ungrouped` and shows under More: phones have no other menu. Reports is left out (it has its own tab).
56
+ */
57
+ export declare function settingsHomeGroups<T extends {
58
+ to: string;
59
+ }>(nav: readonly T[]): {
60
+ groups: readonly [{
61
+ readonly titleKey: "common:appNav.team";
62
+ readonly items: T[];
63
+ }, {
64
+ readonly titleKey: "common:appNav.business";
65
+ readonly items: T[];
66
+ }, {
67
+ readonly titleKey: "common:appNav.app";
68
+ readonly items: T[];
69
+ }];
70
+ ungrouped: T[];
71
+ };
72
+ /**
73
+ * Admin area inside the app shell (rail on desktop, bottom tabs on phones). Reports and Members are full-width rail
74
+ * places; every other admin page keeps the Settings side menu on desktop. Non-admins are redirected to `/`.
59
75
  */
60
76
  export declare function AdminLayout(): import("react").JSX.Element;
61
77
  export default AdminLayout;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Agent page → Dream mode (design docs/superpowers/specs/2026-11-14-dream-mode-design.md, confirmed quick mock
3
+ * docs/features/dream-mode/mock): the switch, the nightly time, Apply by itself, and the history of nights with each
4
+ * change's state and actions. Settings save at once, like the other agent switches.
5
+ */
6
+ export declare function AgentDreamCard({ agentId, name }: Readonly<{
7
+ agentId: number;
8
+ name: string;
9
+ }>): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Agent page → "Ask if the question is answered": on, the agent ends an answer with a resolution
3
3
  * question and may close the chat on a clear "yes"; off (sales default), it adds no check-in line
4
- * and never closes a chat. Saves at once, like the Groups switch.
4
+ * and closes a chat only on a plain "thanks" (with a 👍). Saves at once, like the Groups switch.
5
5
  */
6
6
  export declare function AgentResolutionCard({ agentId, name, enabled, }: Readonly<{
7
7
  agentId: number;
@@ -0,0 +1,14 @@
1
+ import type { DreamChange } from '@ezychat/shared';
2
+ import { type DreamAction } from '../api/dream';
3
+ /**
4
+ * Dream mode → See change: the old and the new text, the team replies (and the customer questions) it came from,
5
+ * read live from the chat, and the checks it passed. A waiting change can be applied or dismissed here.
6
+ */
7
+ export declare function DreamChangeDialog({ agentId, change, when, busy, onAction, onClose, }: Readonly<{
8
+ agentId: number;
9
+ change: DreamChange;
10
+ when: string;
11
+ busy: boolean;
12
+ onAction: (action: DreamAction) => void;
13
+ onClose: () => void;
14
+ }>): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import type { HiddenChatsInfo } from '@ezychat/shared';
2
+ /**
3
+ * Hide chats on Log out (docs/features/chat-hide-delete/design.md Part A): the texts Admin → WhatsApp
4
+ * and Admin → Inboxes show around a Log out.
5
+ */
6
+ /**
7
+ * The Log out (or Link again) confirmation's line: how many chats leave the inbox. Without counts yet
8
+ * it says so without a number; with no chat to hide it says nothing.
9
+ */
10
+ export declare function HidesLine({ info }: Readonly<{
11
+ info: HiddenChatsInfo | undefined;
12
+ }>): import("react").JSX.Element | null;
13
+ /** The logged-out note: the chats of the old number are hidden until that number links again. */
14
+ export declare function HiddenChatsNote({ info }: Readonly<{
15
+ info: HiddenChatsInfo | undefined;
16
+ }>): import("react").JSX.Element | null;
@@ -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;
@@ -2,10 +2,13 @@ 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 rules and texts.
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
13
  export declare function SendPermissionFields({ value, onChange, disabled, }: Readonly<{
11
14
  value: SendPermissions;
@@ -1,7 +1,7 @@
1
1
  import type { ApiToken } from '@ezychat/shared';
2
2
  /**
3
- * The owner of a token changes whether its AI assistant may send, and message new numbers, without a
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
6
  export declare function TokenPermissionsDialog({ token, onClose, }: Readonly<{
7
7
  token: ApiToken | null;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * `/admin/connectors/:id`: one page per connector. The app's own connectors come first: Google
3
3
  * Calendar has Overview (what it does, the Google account, your data), Settings (per AI agent),
4
- * Activity and Bookings tabs (`?tab=`, `&agent=`); Google Sheets and Google Drive the same without Bookings;
4
+ * Activity and Bookings tabs (`?tab=`, `&agent=`); Google Sheets, Google Drive and GitHub (Lite only) the same without Bookings;
5
5
  * SQL Account has Overview, Connection, Settings, Customers and Activity; the custom connector needs Enterprise. Every
6
6
  * other page is built from the connector's entry in the connector list. A connector an extension
7
7
  * provides opens the extension's page.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The GitHub sign-in (one per install, design docs/features/github/design.md): Sign in with
3
+ * GitHub (Anchor Sprint's GitHub App, through GitHub's device flow) or a fine-grained token; the
4
+ * install step, the token expiry, problems and Disconnect. Repositories per agent are on Settings.
5
+ */
6
+ export declare function GitHubAccountCard({ onOpenSettings }: Readonly<{
7
+ onOpenSettings?: () => void;
8
+ }>): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /** GitHub Settings tab: sign in first (and install the App), then one AI agent at a time. */
2
+ export declare function GitHubSettingsTab({ onConnect }: Readonly<{
3
+ onConnect: () => void;
4
+ }>): import("react").JSX.Element;
@@ -1,10 +1,10 @@
1
1
  import { type LucideIcon } from 'lucide-react';
2
- import type { ConnectorEntry, GoogleCalendarState, SqlAccountState } from '@ezychat/shared';
2
+ import type { ConnectorEntry, GitHubState, GoogleCalendarState, SqlAccountState } from '@ezychat/shared';
3
3
  /**
4
4
  * Admin → Connectors: what the app itself provides next to the connector list (design
5
5
  * docs/features/connector-list/design.md). The list (server, `GET /api/connectors/list`) gives
6
6
  * every partner and coming-soon connector; the app keeps only its own features here: the built-in
7
- * Google Calendar, Google Sheets, Google Drive and SQL Account (their pages and tabs live in the app) and the custom MCP connector (Enterprise,
7
+ * Google Calendar, Google Sheets, Google Drive, SQL Account and GitHub (their pages and tabs live in the app) and the custom MCP connector (Enterprise,
8
8
  * linked by its web extension through `connectorLinks`). Texts are catalog keys under
9
9
  * `connectors.items.<id>` and `connectors.tools.<tool>` (admin namespace).
10
10
  */
@@ -14,9 +14,9 @@ export type ConnectorCategory = (typeof CONNECTOR_CATEGORIES)[number];
14
14
  export declare const LIST_CATEGORY: Record<ConnectorEntry['category'], ConnectorCategory>;
15
15
  /** The icon of a list entry without its own icon file. */
16
16
  export declare const CATEGORY_ICON: Record<ConnectorCategory, LucideIcon>;
17
- /** What the AI may do with the built-in Google Calendar, Google Sheets and Google Drive. */
18
- export type ConnectorTool = 'checkFree' | 'book' | 'readRows' | 'addLead' | 'save' | 'find' | 'read';
19
- export declare const CONNECTOR_IDS: readonly ["google-calendar", "google-sheets", "sql-account", "google-drive", "custom-mcp"];
17
+ /** What the AI may do with the built-in Google Calendar, Google Sheets, Google Drive and GitHub. */
18
+ export type ConnectorTool = 'checkFree' | 'book' | 'readRows' | 'addLead' | 'save' | 'find' | 'read' | 'searchIssues' | 'listIssues' | 'readIssue' | 'searchPulls';
19
+ export declare const CONNECTOR_IDS: readonly ["google-calendar", "google-sheets", "sql-account", "google-drive", "github", "custom-mcp"];
20
20
  export type ConnectorId = (typeof CONNECTOR_IDS)[number];
21
21
  export interface CatalogConnector {
22
22
  id: ConnectorId;
@@ -42,4 +42,4 @@ export type ConnectorStatus = 'connected' | 'attention' | 'notConnected' | 'comi
42
42
  * `state`: the connection state of this connector (Google Calendar's, Sheets' or Drive's sign-in, or
43
43
  * SQL Account's connection).
44
44
  */
45
- export declare function connectorStatus(c: CatalogConnector, state: GoogleCalendarState | SqlAccountState | undefined, extensionLink: string | undefined): ConnectorStatus;
45
+ export declare function connectorStatus(c: CatalogConnector, state: GoogleCalendarState | SqlAccountState | GitHubState | undefined, extensionLink: string | undefined): ConnectorStatus;
@@ -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,16 @@
1
+ import { type QueryClient } from '@tanstack/react-query';
2
+ /**
3
+ * Delete chat (admins, docs/features/chat-hide-delete/design.md Part B): the chat, its messages,
4
+ * notes and files go for good in EzyChat; the WhatsApp phone keeps its copy.
5
+ */
6
+ /**
7
+ * Drops a deleted chat from every cache: the chat lists (the saved copy on this device follows on
8
+ * its next save), the chat, its messages, notes, profile and group members.
9
+ */
10
+ export declare function removeChatFromCache(qc: QueryClient, jid: string): void;
11
+ /** What a delete removes (messages and files), for the confirmation; admins only. */
12
+ export declare function useChatDeletePreview(jid: string, enabled: boolean): import("@tanstack/react-query").UseQueryResult<{
13
+ messages: number;
14
+ files: number;
15
+ }, Error>;
16
+ export declare function useDeleteChat(): import("@tanstack/react-query").UseMutationResult<undefined, Error, string, unknown>;
@@ -0,0 +1,21 @@
1
+ import { type QueryClient } from '@tanstack/react-query';
2
+ /**
3
+ * Hide chats on Log out (docs/features/chat-hide-delete/design.md Part A): when a linked phone logs
4
+ * out, every chat of its inbox is hidden (never deleted) until the same number links again.
5
+ */
6
+ /** Every read of one inbox's hidden-chat counts (any connection state). */
7
+ export declare const hiddenChatsKey: (inboxId: number) => readonly ["hidden-chats", number];
8
+ /**
9
+ * Admins: how many chats Log out hides (`visible`) and how many are hidden for the inbox's number.
10
+ * `state` (the connection state) is part of the key, so the counts are read again when it changes.
11
+ */
12
+ export declare function useHiddenChats(inboxId: number, state: string, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
13
+ visible: number;
14
+ hidden: number;
15
+ number: string | null;
16
+ }, Error>;
17
+ /**
18
+ * The inbox's phone logged out: its chats leave every cache (the chat lists, each chat and its
19
+ * messages; the saved copy on this device follows on its next save), and the lists load again.
20
+ */
21
+ export declare function removeInboxChatsFromCache(qc: QueryClient, inboxId: number): void;
@@ -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<{
@@ -341,3 +344,131 @@ export declare function useDrivePickerProgress(requestId: string | null): import
341
344
  kind: "text" | "pdf" | "other" | "sheet" | "word" | "doc";
342
345
  }[];
343
346
  }, Error>;
347
+ /** Admin → Connectors → GitHub (admins only, Lite). Tokens never reach the browser. */
348
+ export declare const githubKey: readonly ["connectors", "github"];
349
+ export declare const githubAgentKey: (agentId: number) => readonly ["connectors", "github", "agent", number];
350
+ export declare const githubReposKey: readonly ["connectors", "github", "repos"];
351
+ export declare const githubActivityKey: readonly ["connectors", "github", "activity"];
352
+ export declare function useGitHub(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
353
+ state: "unavailable" | "connected" | "expired" | "not_connected" | "no_installation" | "expiring";
354
+ method: "app" | "token" | null;
355
+ login: string | null;
356
+ connectedAt: number | null;
357
+ tokenExpiresAt: number | null;
358
+ problemSince: number | null;
359
+ manageUrl: string | null;
360
+ }, Error>;
361
+ /** Starts the GitHub App sign-in (device flow): the page shows `userCode` and polls the request. */
362
+ export declare function useGitHubDeviceStart(): import("@tanstack/react-query").UseMutationResult<{
363
+ requestId: string;
364
+ userCode: string;
365
+ verificationUri: string;
366
+ expiresAt: number;
367
+ }, Error, void, unknown>;
368
+ /** Polls a device sign-in every 3 s until the admin approved, cancelled or the code expired. */
369
+ export declare function useGitHubDeviceProgress(requestId: string | null): import("@tanstack/react-query").UseQueryResult<{
370
+ status: "expired" | "denied" | "pending" | "failed" | "done";
371
+ github: {
372
+ state: "unavailable" | "connected" | "expired" | "not_connected" | "no_installation" | "expiring";
373
+ method: "app" | "token" | null;
374
+ login: string | null;
375
+ connectedAt: number | null;
376
+ tokenExpiresAt: number | null;
377
+ problemSince: number | null;
378
+ manageUrl: string | null;
379
+ } | null;
380
+ }, Error>;
381
+ /** Stops the server polling GitHub for a code nobody waits for any more. */
382
+ export declare function cancelGitHubDevice(requestId: string): Promise<unknown>;
383
+ /** Signs in with a fine-grained token; 400 `classic` / `invalid` / `no_repos` when refused. */
384
+ export declare function useGitHubToken(): import("@tanstack/react-query").UseMutationResult<{
385
+ state: "unavailable" | "connected" | "expired" | "not_connected" | "no_installation" | "expiring";
386
+ method: "app" | "token" | null;
387
+ login: string | null;
388
+ connectedAt: number | null;
389
+ tokenExpiresAt: number | null;
390
+ problemSince: number | null;
391
+ manageUrl: string | null;
392
+ }, Error, string, unknown>;
393
+ /** "Check again" after installing the App on GitHub. */
394
+ export declare function useGitHubCheck(): import("@tanstack/react-query").UseMutationResult<{
395
+ state: "unavailable" | "connected" | "expired" | "not_connected" | "no_installation" | "expiring";
396
+ method: "app" | "token" | null;
397
+ login: string | null;
398
+ connectedAt: number | null;
399
+ tokenExpiresAt: number | null;
400
+ problemSince: number | null;
401
+ manageUrl: string | null;
402
+ }, Error, void, unknown>;
403
+ export declare function useGitHubDisconnect(): import("@tanstack/react-query").UseMutationResult<{
404
+ state: "unavailable" | "connected" | "expired" | "not_connected" | "no_installation" | "expiring";
405
+ method: "app" | "token" | null;
406
+ login: string | null;
407
+ connectedAt: number | null;
408
+ tokenExpiresAt: number | null;
409
+ problemSince: number | null;
410
+ manageUrl: string | null;
411
+ }, Error, void, unknown>;
412
+ /** The repositories GitHub lets EzyChat reach (the server caches them). */
413
+ export declare function useGitHubRepos(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
414
+ repos: {
415
+ id: number;
416
+ fullName: string;
417
+ private: boolean;
418
+ }[];
419
+ checkedAt: number;
420
+ }, Error>;
421
+ /** Reads the list again from GitHub ("Refresh"). */
422
+ export declare function useRefreshGitHubRepos(): import("@tanstack/react-query").UseMutationResult<{
423
+ repos: {
424
+ id: number;
425
+ fullName: string;
426
+ private: boolean;
427
+ }[];
428
+ checkedAt: number;
429
+ }, Error, void, unknown>;
430
+ /** One AI agent's GitHub settings and which of its repos GitHub no longer shares. */
431
+ export declare function useGitHubAgent(agentId: number | null, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
432
+ settings: {
433
+ repos: {
434
+ id: number;
435
+ fullName: string;
436
+ private: boolean;
437
+ }[];
438
+ issues: boolean;
439
+ pulls: boolean;
440
+ };
441
+ unavailableRepoIds: number[];
442
+ }, Error>;
443
+ export declare function useSaveGitHubAgent(agentId: number): import("@tanstack/react-query").UseMutationResult<{
444
+ settings: {
445
+ repos: {
446
+ id: number;
447
+ fullName: string;
448
+ private: boolean;
449
+ }[];
450
+ issues: boolean;
451
+ pulls: boolean;
452
+ };
453
+ unavailableRepoIds: number[];
454
+ }, Error, {
455
+ repos: {
456
+ id: number;
457
+ fullName: string;
458
+ private: boolean;
459
+ }[];
460
+ issues: boolean;
461
+ pulls: boolean;
462
+ }, unknown>;
463
+ export declare function useGitHubActivity(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
464
+ activity: {
465
+ id: number;
466
+ at: number;
467
+ kind: "failed" | "read" | "refused" | "searched";
468
+ agentId: number | null;
469
+ agentName: string;
470
+ chatJid: string | null;
471
+ customer: string;
472
+ group: string | null;
473
+ }[];
474
+ }, Error>;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Dream mode of one AI agent (design docs/superpowers/specs/2026-11-14-dream-mode-design.md, admins only): settings,
3
+ * the nightly history, one change and Apply / Dismiss / Undo. Every change reads the history (and the agent) again.
4
+ */
5
+ export declare const dreamKey: (agentId: number) => readonly ["dream", number];
6
+ export declare const dreamChangeKey: (agentId: number, id: number) => readonly ["dream", number, "change", number];
7
+ export declare function useDream(agentId: number): import("@tanstack/react-query").UseQueryResult<{
8
+ settings: {
9
+ enabled: boolean;
10
+ runTime: string;
11
+ autoApply: boolean;
12
+ };
13
+ runs: {
14
+ id: number;
15
+ slot: number;
16
+ status: "failed" | "skipped" | "running" | "done" | "missed";
17
+ reason: "ai_unavailable" | "agent_off" | "access_closed" | null;
18
+ chatsRead: number;
19
+ takeovers: number;
20
+ saved: number;
21
+ dropped: number;
22
+ changes: {
23
+ id: number;
24
+ runId: number;
25
+ target: "instructions" | "handoff_rules" | "context_text";
26
+ itemId: number | null;
27
+ itemName: string | null;
28
+ summary: string;
29
+ status: "expired" | "waiting" | "applied" | "dismissed" | "undone" | "stale";
30
+ auto: boolean;
31
+ sourceCount: number;
32
+ createdAt: number;
33
+ decidedAt: number | null;
34
+ }[];
35
+ }[];
36
+ nextBefore: number | null;
37
+ aiReady: boolean;
38
+ }, Error>;
39
+ export declare function useSaveDream(agentId: number): import("@tanstack/react-query").UseMutationResult<{
40
+ enabled: boolean;
41
+ runTime: string;
42
+ autoApply: boolean;
43
+ }, Error, {
44
+ enabled?: boolean | undefined;
45
+ runTime?: string | undefined;
46
+ autoApply?: boolean | undefined;
47
+ }, unknown>;
48
+ export declare function useDreamChange(agentId: number, id: number): import("@tanstack/react-query").UseQueryResult<{
49
+ id: number;
50
+ runId: number;
51
+ target: "instructions" | "handoff_rules" | "context_text";
52
+ itemId: number | null;
53
+ itemName: string | null;
54
+ summary: string;
55
+ status: "expired" | "waiting" | "applied" | "dismissed" | "undone" | "stale";
56
+ auto: boolean;
57
+ sourceCount: number;
58
+ createdAt: number;
59
+ decidedAt: number | null;
60
+ before: string;
61
+ after: string;
62
+ checks: {
63
+ name: "privacy" | "leak" | "grounding" | "replay" | "regression";
64
+ ok: boolean;
65
+ detail?: string | undefined;
66
+ }[];
67
+ sources: {
68
+ role: "team" | "customer";
69
+ name: string | null;
70
+ at: number;
71
+ text: string;
72
+ }[];
73
+ }, Error>;
74
+ export type DreamAction = 'apply' | 'dismiss' | 'undo';
75
+ /** Apply / Dismiss / Undo (409 `setup_changed`: the text changed since the night, the change is outdated). */
76
+ export declare function useDreamAction(agentId: number): import("@tanstack/react-query").UseMutationResult<{
77
+ id: number;
78
+ runId: number;
79
+ target: "instructions" | "handoff_rules" | "context_text";
80
+ itemId: number | null;
81
+ itemName: string | null;
82
+ summary: string;
83
+ status: "expired" | "waiting" | "applied" | "dismissed" | "undone" | "stale";
84
+ auto: boolean;
85
+ sourceCount: number;
86
+ createdAt: number;
87
+ decidedAt: number | null;
88
+ }, Error, {
89
+ id: number;
90
+ action: DreamAction;
91
+ }, unknown>;
@@ -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>>];