@ezychat/web 0.1.63 → 0.1.64

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,24 @@
1
+ import type { AskEzyBlock as AskBlock } from '@ezychat/shared';
2
+ /** Where the change card stands; kept by the panel so "Apply both" updates every card. */
3
+ export interface ChangeState {
4
+ status: 'proposed' | 'applied' | 'discarded';
5
+ version?: number;
6
+ busy?: boolean;
7
+ error?: string | null;
8
+ }
9
+ export interface BlockContext {
10
+ /** The chat the panel is scoped to (its summary shows "Back to chat" instead of "Open chat"). */
11
+ scopeJid: string | null;
12
+ /** Close the panel after following a link on a phone, so the chat is visible. */
13
+ onNavigate: () => void;
14
+ changes: Record<string, ChangeState>;
15
+ onChange: (id: string, action: 'apply' | 'discard' | 'undo') => void;
16
+ /** Sends the question of this answer again (after an Apply conflict). */
17
+ onAskAgain: () => void;
18
+ /** Wide screen: tests in change cards start open (on a phone they start folded). */
19
+ wide: boolean;
20
+ }
21
+ export declare function AskEzyBlock({ block, ctx }: {
22
+ block: AskBlock;
23
+ ctx: BlockContext;
24
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { type AskEzyRequest } from './AskEzyContext';
2
+ /** Opens Ask Ezy. `compact` shows only the icon (phone headers); the label stays for screen readers. */
3
+ export declare function AskEzyButton({ request, compact, variant, className, }: {
4
+ request?: AskEzyRequest;
5
+ compact?: boolean;
6
+ variant?: 'ghost' | 'outline';
7
+ className?: string;
8
+ }): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ /** What a button asks Ezy when it opens the panel (e.g. "Summarise this chat" from a conversation). */
2
+ export interface AskEzyRequest {
3
+ question: string;
4
+ chatJid?: string | null;
5
+ /** Shown above the box while the question is about one chat. */
6
+ chatName?: string | null;
7
+ }
8
+ interface AskEzyState {
9
+ open: boolean;
10
+ /** The question the panel sends as soon as it opens; cleared once sent. */
11
+ pending: AskEzyRequest | null;
12
+ openPanel: (request?: AskEzyRequest) => void;
13
+ closePanel: () => void;
14
+ takePending: () => AskEzyRequest | null;
15
+ }
16
+ export declare function AskEzyProvider({ children }: {
17
+ children: React.ReactNode;
18
+ }): import("react").JSX.Element;
19
+ export declare function useAskEzy(): AskEzyState;
20
+ export {};
@@ -0,0 +1 @@
1
+ export declare function AskEzyPanel(): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { type AskEzyAnswer, type AskEzyStep, type AskEzyTurn } from '@ezychat/shared';
2
+ export declare const getAskEzyStatus: () => Promise<{
3
+ connected: boolean;
4
+ }>;
5
+ export type AskEzyChangeAction = 'apply' | 'discard' | 'undo';
6
+ export declare const askEzyChange: (id: string, action: AskEzyChangeAction) => Promise<{
7
+ status: "proposed" | "applied" | "discarded";
8
+ version?: number | undefined;
9
+ }>;
10
+ /**
11
+ * Asks one question. The answer streams as NDJSON: `onStep` gets each tool Ezy used while it works; resolves
12
+ * with the answer, or throws an ApiError (`ai_not_connected`, `ai_unavailable`, `ai_timeout`, `ai_expired`,
13
+ * `rate_limited`, …) or an AbortError.
14
+ */
15
+ export declare function askEzy(input: {
16
+ question: string;
17
+ history: AskEzyTurn[];
18
+ chatJid: string | null;
19
+ }, onStep: (step: AskEzyStep) => void, signal: AbortSignal): Promise<AskEzyAnswer>;
@@ -979,6 +979,158 @@ export declare const enResources: {
979
979
  paused: string;
980
980
  };
981
981
  };
982
+ askEzy: {
983
+ button: string;
984
+ open: string;
985
+ aboutChat: string;
986
+ summariseChat: string;
987
+ title: string;
988
+ subtitleAdmin: string;
989
+ subtitleMember: string;
990
+ hello: string;
991
+ introAdmin: string;
992
+ introMember: string;
993
+ newChat: string;
994
+ close: string;
995
+ thinking: string;
996
+ steps: string;
997
+ placeholder: string;
998
+ send: string;
999
+ stop: string;
1000
+ scope: string;
1001
+ clearScope: string;
1002
+ footer: string;
1003
+ starters: {
1004
+ week: string;
1005
+ waiting: string;
1006
+ handoffs: string;
1007
+ fix: string;
1008
+ busy: string;
1009
+ latest: string;
1010
+ };
1011
+ errors: {
1012
+ noConnectionAdmin: string;
1013
+ noConnectionMember: string;
1014
+ openSettings: string;
1015
+ unavailable: string;
1016
+ stopped: string;
1017
+ retry: string;
1018
+ short: string;
1019
+ unavailableBody: string;
1020
+ timeout: string;
1021
+ timeoutBody: string;
1022
+ expired: string;
1023
+ expiredAdmin: string;
1024
+ expiredMember: string;
1025
+ busy: string;
1026
+ busyBody: string;
1027
+ stoppedBody: string;
1028
+ askAgain: string;
1029
+ editQuestion: string;
1030
+ checkSettings: string;
1031
+ };
1032
+ blocks: {
1033
+ waiting: string;
1034
+ assignee: string;
1035
+ unassigned: string;
1036
+ openChat: string;
1037
+ keyPoints: string;
1038
+ openQuestions: string;
1039
+ nextStep: string;
1040
+ removed: string;
1041
+ added: string;
1042
+ better: string;
1043
+ worse: string;
1044
+ busiest: string;
1045
+ conversations_one: string;
1046
+ conversations_other: string;
1047
+ heatmapLegend: string;
1048
+ unchanged_one: string;
1049
+ unchanged_other: string;
1050
+ backToChat: string;
1051
+ };
1052
+ change: {
1053
+ apply: string;
1054
+ discard: string;
1055
+ undo: string;
1056
+ appliedNote: string;
1057
+ discardedNote: string;
1058
+ status: {
1059
+ proposed: string;
1060
+ applied: string;
1061
+ discarded: string;
1062
+ };
1063
+ applyAll: string;
1064
+ appliedStatus: string;
1065
+ conflictTitle: string;
1066
+ conflict: string;
1067
+ showAgain: string;
1068
+ applyBoth: string;
1069
+ applyAllNote: string;
1070
+ history: string;
1071
+ adds_one: string;
1072
+ adds_other: string;
1073
+ removes_one: string;
1074
+ removes_other: string;
1075
+ target: {
1076
+ instructions: string;
1077
+ handoff_rules: string;
1078
+ context_text: string;
1079
+ };
1080
+ expired: string;
1081
+ };
1082
+ test: {
1083
+ title: string;
1084
+ now: string;
1085
+ after: string;
1086
+ note: string;
1087
+ question: string;
1088
+ show: string;
1089
+ };
1090
+ footerShort: string;
1091
+ placeholderMember: string;
1092
+ tryOne: string;
1093
+ ready: string;
1094
+ reading: string;
1095
+ noConnection: {
1096
+ title: string;
1097
+ admin: string;
1098
+ member: string;
1099
+ what: string;
1100
+ };
1101
+ working: string;
1102
+ copy: string;
1103
+ copyForAdmin: string;
1104
+ copied: string;
1105
+ copyFailed: string;
1106
+ newConfirm: {
1107
+ title: string;
1108
+ body: string;
1109
+ cancel: string;
1110
+ confirm: string;
1111
+ };
1112
+ read: {
1113
+ list_chats_one: string;
1114
+ list_chats_other: string;
1115
+ get_chat: string;
1116
+ get_messages_one: string;
1117
+ get_messages_other: string;
1118
+ get_stats: string;
1119
+ get_activity: string;
1120
+ list_ai_agents: string;
1121
+ get_ai_agent_setup: string;
1122
+ get_ai_context_item: string;
1123
+ get_ai_setup_history: string;
1124
+ get_ai_setup_version: string;
1125
+ try_ai_reply_one: string;
1126
+ try_ai_reply_other: string;
1127
+ propose_ai_setup_change: string;
1128
+ other: string;
1129
+ };
1130
+ summariseButton: string;
1131
+ readyWith: string;
1132
+ aboutChatSuffix: string;
1133
+ };
982
1134
  };
983
1135
  admin: {
984
1136
  title: string;
@@ -47,6 +47,11 @@ export interface ComposerProps {
47
47
  /** The team's phrase list, matched on every key (docs/features/ai-phrase-dictionary). */
48
48
  phrases?: readonly ReplyPhraseListItem[];
49
49
  } | null;
50
+ /** Ask Ezy (docs/features/ask-ezy/design.md): direct chats only; opens Ezy scoped to this chat. */
51
+ askEzy?: {
52
+ chatJid: string;
53
+ name: string;
54
+ } | null;
50
55
  /**
51
56
  * Fix English (docs/features/grammar-fix/design.md): spelling and grammar marks in this chat
52
57
  * (any chat type; null or a status with both checks off = nothing shown).
@@ -61,4 +66,4 @@ export interface ComposerProps {
61
66
  onAddWord(word: string): Promise<unknown>;
62
67
  } | null;
63
68
  }
64
- export declare function Composer({ quickReplies, onSend, onAttach, onVoiceNote, onTyping, confirmSend, disabled, placeholder, replyTo, onCancelReply, aiSuggest, fixEnglish, ref, }: ComposerProps): React.JSX.Element;
69
+ export declare function Composer({ quickReplies, onSend, onAttach, onVoiceNote, onTyping, confirmSend, disabled, placeholder, replyTo, onCancelReply, aiSuggest, askEzy, fixEnglish, ref, }: ComposerProps): React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezychat/web",
3
- "version": "0.1.63",
3
+ "version": "0.1.64",
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.63",
43
+ "@ezychat/shared": "0.1.64",
44
44
  "@fontsource-variable/inter": "^5.3.0",
45
45
  "@tanstack/react-query": "^5.104.5",
46
46
  "@types/react": "^19.3.0",