@celljs/ta-web 4.22.0 → 4.24.0

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 (177) hide show
  1. package/esm/browser/assistant/assistant-chat-list.js +3 -1
  2. package/esm/browser/assistant/assistant-conversation.js +1 -1
  3. package/esm/browser/assistant/assistant-initiative.d.ts +5 -1
  4. package/esm/browser/assistant/assistant-initiative.js +11 -3
  5. package/esm/browser/assistant/call-keeper.d.ts +2 -1
  6. package/esm/browser/assistant/call-keeper.js +4 -2
  7. package/esm/browser/assistant/call-screen.d.ts +1 -1
  8. package/esm/browser/assistant/call-turn-end.d.ts +11 -2
  9. package/esm/browser/assistant/call-turn-end.js +21 -5
  10. package/esm/browser/assistant/read-aloud.d.ts +1 -1
  11. package/esm/browser/assistant/realtime-voice.d.ts +1 -1
  12. package/esm/browser/assistant/voice-call-bar.d.ts +5 -2
  13. package/esm/browser/assistant/voice-call-bar.js +12 -0
  14. package/esm/browser/assistant/voice-call-protocol.d.ts +78 -0
  15. package/esm/browser/assistant/voice-call-protocol.js +2 -0
  16. package/esm/browser/assistant/voice-call.d.ts +17 -65
  17. package/esm/browser/assistant/voice-call.js +45 -1
  18. package/esm/browser/assistant/voice-reopen.d.ts +1 -1
  19. package/esm/browser/components/account-menu.js +28 -7
  20. package/esm/browser/components/app-shell-state.js +2 -1
  21. package/esm/browser/components/app-view.js +15 -7
  22. package/esm/browser/components/chat-home-util.d.ts +7 -0
  23. package/esm/browser/components/chat-home-util.js +10 -0
  24. package/esm/browser/components/chat-home.d.ts +3 -1
  25. package/esm/browser/components/chat-home.js +3 -2
  26. package/esm/browser/components/chat-list-util.d.ts +15 -3
  27. package/esm/browser/components/chat-list-util.js +26 -4
  28. package/esm/browser/components/chat-list.js +4 -3
  29. package/esm/browser/components/chat-seen.d.ts +4 -3
  30. package/esm/browser/components/chat-seen.js +6 -5
  31. package/esm/browser/components/chats-dot.d.ts +30 -0
  32. package/esm/browser/components/chats-dot.js +32 -0
  33. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  34. package/esm/browser/components/earlier-messages.d.ts +4 -0
  35. package/esm/browser/components/earlier-messages.js +10 -2
  36. package/esm/browser/components/host-view.d.ts +1 -1
  37. package/esm/browser/components/message-footer.d.ts +0 -2
  38. package/esm/browser/components/message-footer.js +1 -8
  39. package/esm/browser/components/message-images.d.ts +22 -0
  40. package/esm/browser/components/message-images.js +90 -1
  41. package/esm/browser/components/message-steps.js +9 -0
  42. package/esm/browser/components/message-user.js +8 -1
  43. package/esm/browser/components/partner-row-util.d.ts +28 -0
  44. package/esm/browser/components/partner-row-util.js +45 -0
  45. package/esm/browser/components/partner-row.d.ts +4 -3
  46. package/esm/browser/components/partner-row.js +21 -9
  47. package/esm/browser/components/profile-view.d.ts +2 -2
  48. package/esm/browser/components/profile-view.js +6 -3
  49. package/esm/browser/components/settings-files.d.ts +7 -0
  50. package/esm/browser/components/settings-files.js +61 -0
  51. package/esm/browser/components/settings-more.js +2 -0
  52. package/esm/browser/components/tool-view.js +23 -7
  53. package/esm/browser/components/web-composer.d.ts +5 -2
  54. package/esm/browser/components/web-composer.js +10 -5
  55. package/esm/browser/extension/extension-view.js +2 -2
  56. package/esm/browser/extension/icons.js +4 -1
  57. package/esm/browser/extension/web-api-call.d.ts +45 -0
  58. package/esm/browser/extension/web-api-call.js +2 -0
  59. package/esm/browser/extension/web-api-components.d.ts +37 -2
  60. package/esm/browser/extension/web-api-contributions.d.ts +4 -32
  61. package/esm/browser/extension/web-api-partners.d.ts +27 -2
  62. package/esm/browser/extension/web-extension-api.d.ts +9 -12
  63. package/esm/browser/extension/web-extension-context.d.ts +2 -3
  64. package/esm/browser/extension/web-extension-context.js +5 -5
  65. package/esm/browser/extension/web-view-util.d.ts +5 -0
  66. package/esm/browser/extension/web-view-util.js +8 -0
  67. package/esm/browser/i18n/locales.d.ts +18 -1
  68. package/esm/browser/i18n/messages-ja.js +17 -0
  69. package/esm/browser/i18n/messages-zh-tw.js +17 -0
  70. package/esm/browser/i18n/messages.d.ts +17 -0
  71. package/esm/browser/i18n/messages.js +34 -0
  72. package/esm/browser/partners/partners-extension.js +17 -0
  73. package/esm/browser/partners/partners-util.d.ts +6 -0
  74. package/esm/browser/partners/partners-util.js +9 -0
  75. package/esm/browser/style/chat-list.d.ts +1 -1
  76. package/esm/browser/style/chat-list.js +3 -0
  77. package/esm/browser/style/conversation-column.d.ts +1 -1
  78. package/esm/browser/style/conversation-column.js +21 -0
  79. package/esm/browser/style/conversation.d.ts +1 -1
  80. package/esm/browser/style/conversation.js +3 -2
  81. package/esm/browser/style/pages.d.ts +1 -1
  82. package/esm/browser/style/pages.js +8 -0
  83. package/esm/browser/style/shell.d.ts +1 -1
  84. package/esm/browser/style/shell.js +1 -1
  85. package/esm/browser/util/image-shrink.d.ts +26 -0
  86. package/esm/browser/util/image-shrink.js +60 -0
  87. package/esm/browser/util/process.d.ts +10 -4
  88. package/esm/browser/util/process.js +45 -18
  89. package/lib/browser/assistant/assistant-chat-list.js +3 -1
  90. package/lib/browser/assistant/assistant-conversation.js +1 -1
  91. package/lib/browser/assistant/assistant-initiative.d.ts +5 -1
  92. package/lib/browser/assistant/assistant-initiative.js +11 -3
  93. package/lib/browser/assistant/call-keeper.d.ts +2 -1
  94. package/lib/browser/assistant/call-keeper.js +4 -2
  95. package/lib/browser/assistant/call-screen.d.ts +1 -1
  96. package/lib/browser/assistant/call-turn-end.d.ts +11 -2
  97. package/lib/browser/assistant/call-turn-end.js +22 -6
  98. package/lib/browser/assistant/read-aloud.d.ts +1 -1
  99. package/lib/browser/assistant/realtime-voice.d.ts +1 -1
  100. package/lib/browser/assistant/voice-call-bar.d.ts +5 -2
  101. package/lib/browser/assistant/voice-call-bar.js +12 -0
  102. package/lib/browser/assistant/voice-call-protocol.d.ts +79 -0
  103. package/lib/browser/assistant/voice-call-protocol.js +3 -0
  104. package/lib/browser/assistant/voice-call.d.ts +17 -65
  105. package/lib/browser/assistant/voice-call.js +45 -1
  106. package/lib/browser/assistant/voice-reopen.d.ts +1 -1
  107. package/lib/browser/components/account-menu.js +27 -6
  108. package/lib/browser/components/app-shell-state.js +2 -1
  109. package/lib/browser/components/app-view.js +15 -7
  110. package/lib/browser/components/chat-home-util.d.ts +7 -0
  111. package/lib/browser/components/chat-home-util.js +10 -0
  112. package/lib/browser/components/chat-home.d.ts +3 -1
  113. package/lib/browser/components/chat-home.js +3 -2
  114. package/lib/browser/components/chat-list-util.d.ts +15 -3
  115. package/lib/browser/components/chat-list-util.js +26 -4
  116. package/lib/browser/components/chat-list.js +4 -3
  117. package/lib/browser/components/chat-seen.d.ts +4 -3
  118. package/lib/browser/components/chat-seen.js +6 -5
  119. package/lib/browser/components/chats-dot.d.ts +31 -0
  120. package/lib/browser/components/chats-dot.js +68 -0
  121. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  122. package/lib/browser/components/earlier-messages.d.ts +4 -0
  123. package/lib/browser/components/earlier-messages.js +10 -2
  124. package/lib/browser/components/host-view.d.ts +1 -1
  125. package/lib/browser/components/message-footer.d.ts +0 -2
  126. package/lib/browser/components/message-footer.js +0 -8
  127. package/lib/browser/components/message-images.d.ts +22 -0
  128. package/lib/browser/components/message-images.js +92 -2
  129. package/lib/browser/components/message-steps.js +9 -0
  130. package/lib/browser/components/message-user.js +7 -0
  131. package/lib/browser/components/partner-row-util.d.ts +29 -0
  132. package/lib/browser/components/partner-row-util.js +48 -0
  133. package/lib/browser/components/partner-row.d.ts +4 -3
  134. package/lib/browser/components/partner-row.js +21 -9
  135. package/lib/browser/components/profile-view.d.ts +2 -2
  136. package/lib/browser/components/profile-view.js +6 -3
  137. package/lib/browser/components/settings-files.d.ts +8 -0
  138. package/lib/browser/components/settings-files.js +97 -0
  139. package/lib/browser/components/settings-more.js +2 -0
  140. package/lib/browser/components/tool-view.js +23 -7
  141. package/lib/browser/components/web-composer.d.ts +5 -2
  142. package/lib/browser/components/web-composer.js +10 -5
  143. package/lib/browser/extension/extension-view.js +2 -2
  144. package/lib/browser/extension/icons.js +3 -0
  145. package/lib/browser/extension/web-api-call.d.ts +46 -0
  146. package/lib/browser/extension/web-api-call.js +3 -0
  147. package/lib/browser/extension/web-api-components.d.ts +37 -2
  148. package/lib/browser/extension/web-api-contributions.d.ts +4 -32
  149. package/lib/browser/extension/web-api-partners.d.ts +27 -2
  150. package/lib/browser/extension/web-extension-api.d.ts +9 -12
  151. package/lib/browser/extension/web-extension-context.d.ts +2 -3
  152. package/lib/browser/extension/web-extension-context.js +5 -5
  153. package/lib/browser/extension/web-view-util.d.ts +5 -0
  154. package/lib/browser/extension/web-view-util.js +8 -0
  155. package/lib/browser/i18n/locales.d.ts +18 -1
  156. package/lib/browser/i18n/messages-ja.js +17 -0
  157. package/lib/browser/i18n/messages-zh-tw.js +17 -0
  158. package/lib/browser/i18n/messages.d.ts +17 -0
  159. package/lib/browser/i18n/messages.js +34 -0
  160. package/lib/browser/partners/partners-extension.js +17 -0
  161. package/lib/browser/partners/partners-util.d.ts +6 -0
  162. package/lib/browser/partners/partners-util.js +9 -0
  163. package/lib/browser/style/chat-list.d.ts +1 -1
  164. package/lib/browser/style/chat-list.js +3 -0
  165. package/lib/browser/style/conversation-column.d.ts +1 -1
  166. package/lib/browser/style/conversation-column.js +21 -0
  167. package/lib/browser/style/conversation.d.ts +1 -1
  168. package/lib/browser/style/conversation.js +3 -2
  169. package/lib/browser/style/pages.d.ts +1 -1
  170. package/lib/browser/style/pages.js +8 -0
  171. package/lib/browser/style/shell.d.ts +1 -1
  172. package/lib/browser/style/shell.js +1 -1
  173. package/lib/browser/util/image-shrink.d.ts +27 -0
  174. package/lib/browser/util/image-shrink.js +63 -0
  175. package/lib/browser/util/process.d.ts +10 -4
  176. package/lib/browser/util/process.js +45 -18
  177. package/package.json +7 -7
@@ -1,4 +1,4 @@
1
- import { AlarmClock, Aperture, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, Bell, BellOff, BookOpen, Bot, Box, Bug, Building2, Calendar, CaseSensitive, ChartSpline, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsDownUp, ChevronsUpDown, ChevronUp, Circle, CircleAlert, CircleArrowRight, CircleHelp, Clipboard, ClipboardPaste, Clock, Cloud, Code, Coins, Columns2, Contact, Copy, CopyMinus, CornerDownRight, CornerUpLeft, Cpu, Crown, Database, Download, Ellipsis, ExternalLink, Eye, File, FileArchive, FileDiff, FilePlus, Files, FileText, Film, FlaskConical, Folder, FolderInput, FolderOpen, FolderPlus, FolderSearch, FolderTree, Forward, Gamepad2, Gauge, GitBranch, GitCommitHorizontal, Globe, Grip, HardDrive, Hash, Heart, House, Image, ImagePlus, Info, Keyboard, KeyRound, Laptop, LayoutDashboard, Lightbulb, Link, List, ListChecks, ListTodo, ListTree, ListX, LoaderCircle, LocateFixed, Lock, MapIcon, Maximize, Megaphone, MemoryStick, MessageCircle, MessageSquareDot, MessageSquareText, MessagesSquare, Mic, Minus, Monitor, MonitorSmartphone, MousePointer2, MousePointerClick, Package, PackageOpen, Paperclip, Pencil, Phone, Pin, PinOff, Play, Plus, Pointer, Power, Puzzle, QrCode, Radar, RefreshCw, Regex, Replace, ReplaceAll, Rocket, RotateCcw, Rows2, Save, ScanLine, ScrollText, Search, Send, Server, Share2, Shield, ShieldCheck, SlidersHorizontal, Smartphone, Sparkles, Square, SquareMinus, SquarePlus, SquareTerminal, Star, StarOff, Store, Target, Text, Timer, Trash2, TrendingDown, TrendingUp, Trophy, Undo2, Unplug, Upload, User, UserPlus, Users, Volume2, WholeWord, Wrench, X, Zap, } from 'lucide-react';
1
+ import { AlarmClock, Aperture, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, Bell, BellOff, BookOpen, Bot, Box, Bug, Building2, Calendar, CaseSensitive, ChartSpline, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsDownUp, ChevronsUpDown, ChevronUp, Circle, CircleAlert, CircleArrowRight, CircleHelp, Clipboard, ClipboardPaste, Clock, Cloud, Code, Coins, Columns2, Contact, Copy, CopyMinus, CornerDownRight, CornerUpLeft, Cpu, Crown, Database, Download, Ellipsis, ExternalLink, Eye, File, FileArchive, FileDiff, FilePlus, Files, FileText, Film, FlaskConical, Folder, FolderInput, FolderOpen, FolderPlus, FolderSearch, FolderTree, Forward, Gamepad2, Gauge, GitBranch, GitCommitHorizontal, Globe, Grip, HardDrive, Hash, Heart, House, Image, ImagePlus, Info, Keyboard, KeyRound, Laptop, LayoutDashboard, Lightbulb, Link, List, ListChecks, ListTodo, ListTree, ListX, LoaderCircle, LocateFixed, Lock, MapIcon, Maximize, Maximize2, Megaphone, MemoryStick, MessageCircle, MessageSquareDot, MessageSquareText, MessagesSquare, Mic, Minimize2, Minus, Monitor, MonitorSmartphone, MousePointer2, MousePointerClick, Package, PackageOpen, Paperclip, Pencil, Phone, Pin, PinOff, Play, Plus, Pointer, Power, Puzzle, QrCode, Radar, RefreshCw, Regex, Replace, ReplaceAll, Rocket, RotateCcw, Rows2, Save, Scan, ScanLine, ScrollText, Search, Send, Server, Share2, Shield, ShieldCheck, SlidersHorizontal, Smartphone, Sparkles, Square, SquareMinus, SquarePlus, SquareTerminal, Star, StarOff, Store, Target, Text, Timer, Trash2, TrendingDown, TrendingUp, Trophy, Undo2, Unplug, Upload, User, UserPlus, Users, Volume2, WholeWord, Wrench, X, Zap, } from 'lucide-react';
2
2
  /** The icons a web extension gets as `pi.ui.icons`; names are lucide's. Only add: removing one breaks extensions. */
3
3
  export const WEB_ICONS = Object.freeze({
4
4
  AlarmClock,
@@ -92,6 +92,7 @@ export const WEB_ICONS = Object.freeze({
92
92
  Lock,
93
93
  Map: MapIcon,
94
94
  Maximize,
95
+ Maximize2,
95
96
  Megaphone,
96
97
  MemoryStick,
97
98
  MessageCircle,
@@ -99,6 +100,7 @@ export const WEB_ICONS = Object.freeze({
99
100
  MessageSquareText,
100
101
  MessagesSquare,
101
102
  Mic,
103
+ Minimize2,
102
104
  Minus,
103
105
  Monitor,
104
106
  MonitorSmartphone,
@@ -126,6 +128,7 @@ export const WEB_ICONS = Object.freeze({
126
128
  RotateCcw,
127
129
  Rows2,
128
130
  Save,
131
+ Scan,
129
132
  ScanLine,
130
133
  ScrollText,
131
134
  Search,
@@ -0,0 +1,45 @@
1
+ /** The conversation a call is with (WebCallPartner.open). */
2
+ export interface WebCallTarget {
3
+ sessionId: string;
4
+ sessionFile?: string;
5
+ cwd?: string;
6
+ /** The conversation of the double, which hands out tasks of its own. */
7
+ double: boolean;
8
+ /** The language the user speaks in the call. */
9
+ language: string;
10
+ }
11
+ /**
12
+ * Who answers in a call in place of the conversation (WebExtensionAPI.registerCallPartner): a front that talks at
13
+ * once, whatever the conversation does, and hands it the work (docs/design/ta-call.md).
14
+ */
15
+ export interface WebCallPartner {
16
+ /** Its side of a call with the conversation; undefined to leave the call to the conversation itself. */
17
+ open(target: WebCallTarget): Promise<WebCallSession | undefined>;
18
+ }
19
+ /** A call as its partner answers it, from when it starts until it ends. */
20
+ export interface WebCallSession {
21
+ /** What the user said; the reply to say. `sent`: it went to the conversation already, as it began the call. */
22
+ say(text: string, options?: {
23
+ sent?: boolean;
24
+ }): Promise<string | undefined>;
25
+ /**
26
+ * What the user said so far, as they paused where they may be done: the partner answers it at once, to be said only
27
+ * if they were done (`keep`), dropped as they say more (`drop`), doing nothing until kept (docs/design/ta-call.md
28
+ * 10). Newer than some partners.
29
+ */
30
+ draft?(text: string): WebCallDraft;
31
+ /** Whether the partner ended the call (asked to hang up): it ends once its last reply is said. */
32
+ ending?(): boolean;
33
+ /** What the partner says by itself (news of the work), asked again and again in a call; undefined after a while. */
34
+ next?(): Promise<string | undefined>;
35
+ close(): void;
36
+ }
37
+ /** An answer begun before the user was known to be done (WebCallSession.draft). */
38
+ export interface WebCallDraft {
39
+ /** The reply to say, as `say` gives it; undefined once dropped. */
40
+ reply: Promise<string | undefined>;
41
+ /** The user was done with these words: its reply is said, and what it does is done. */
42
+ keep(): void;
43
+ /** The user said more: it stops and does nothing. */
44
+ drop(): void;
45
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=web-api-call.js.map
@@ -197,6 +197,18 @@ export interface WebPictureCard {
197
197
  disabled?: boolean;
198
198
  onPick(): void;
199
199
  }
200
+ /** WebExtensionUI.ChatImages: the pictures of one message. */
201
+ export interface WebChatImagesProps {
202
+ images: readonly {
203
+ key: string;
204
+ src?: string;
205
+ thumb?: string;
206
+ width: number;
207
+ height: number;
208
+ }[];
209
+ /** What they are, for who cannot see them. */
210
+ alt?: string;
211
+ }
200
212
  export interface WebImageViewerProps {
201
213
  src: string;
202
214
  alt?: string;
@@ -298,8 +310,17 @@ export interface WebVoice {
298
310
  }
299
311
  export interface WebComposerProps {
300
312
  placeholder?: string;
301
- /** Sends what was typed; when it fails, the text comes back into the box and the reason is a notice of the page. */
302
- onSend(text: string): Promise<void> | void;
313
+ /**
314
+ * Sends what was typed, and the pictures added when the box takes them (`images`), the text empty for pictures
315
+ * alone; when it fails, both come back into the box and the reason is a notice of the page.
316
+ */
317
+ onSend(text: string, images: WebComposerImage[]): Promise<void> | void;
318
+ /**
319
+ * Pictures can be added, as in a conversation: the album and the camera in the + (a picture on a computer), pasted,
320
+ * dropped. With limits, each comes shrunk within them (a JPEG, unless it fits as it is), its size in pixels said.
321
+ * Newer than some Ta apps, which take none.
322
+ */
323
+ images?: boolean | WebComposerImageLimits;
303
324
  /** What `@` lists, by name; and the + menu entry that starts an `@`. */
304
325
  mentions?: {
305
326
  name: string;
@@ -335,6 +356,20 @@ export interface WebComposerProps {
335
356
  */
336
357
  draft?: string;
337
358
  }
359
+ /** A picture sent from the message box (WebComposerProps.images): JPEG, PNG, GIF or WebP, in base64. */
360
+ export interface WebComposerImage {
361
+ type: 'image';
362
+ data: string;
363
+ mimeType: string;
364
+ /** In pixels, when the box shrank it (`images` with limits). */
365
+ width?: number;
366
+ height?: number;
367
+ }
368
+ /** How the message box shrinks the pictures it hands on: their longest side in pixels, their bytes at most. */
369
+ export interface WebComposerImageLimits {
370
+ side: number;
371
+ bytes: number;
372
+ }
338
373
  /** An entry of the + menu of the message box. */
339
374
  export interface WebComposerAction {
340
375
  key: string;
@@ -3,6 +3,7 @@ import type { TaRoomInfo } from '@celljs/ta-protocol';
3
3
  import type * as React from 'react';
4
4
  import type { WebComposerAction } from './web-api-components.js';
5
5
  import type { WebIcon } from './web-extension-api.js';
6
+ export type * from './web-api-call.js';
6
7
  export type * from './web-api-chats.js';
7
8
  /** A conversation as its message box knows it. */
8
9
  export interface WebConversation {
@@ -160,7 +161,8 @@ export interface WebView {
160
161
  group?: WebPageGroup;
161
162
  /**
162
163
  * `false`: a page only shown by something else (a room of its kind, a link, a row of its settings), never in the
163
- * navigation nor under Discover. Newer than some Ta apps.
164
+ * navigation nor under Discover; a panel only opened by something else (the info of the chat shown), never among
165
+ * the tools the workbench's + lists. Newer than some Ta apps.
164
166
  */
165
167
  navigation?: boolean;
166
168
  /** A page: the line a list shows under its name, as a messenger does — the last thing said there, and when. */
@@ -467,37 +469,6 @@ export interface WebTaskEntry extends WebTask {
467
469
  /** The name of the extension it is of. */
468
470
  extension: string;
469
471
  }
470
- /** pi's custom message, as the conversation holds it. */
471
- /** The conversation a call is with (WebCallPartner.open). */
472
- export interface WebCallTarget {
473
- sessionId: string;
474
- sessionFile?: string;
475
- cwd?: string;
476
- /** The conversation of the double, which hands out tasks of its own. */
477
- double: boolean;
478
- /** The language the user speaks in the call. */
479
- language: string;
480
- }
481
- /**
482
- * Who answers in a call in place of the conversation (WebExtensionAPI.registerCallPartner): a front that talks at
483
- * once, whatever the conversation does, and hands it the work (docs/design/ta-call.md).
484
- */
485
- export interface WebCallPartner {
486
- /** Its side of a call with the conversation; undefined to leave the call to the conversation itself. */
487
- open(target: WebCallTarget): Promise<WebCallSession | undefined>;
488
- }
489
- /** A call as its partner answers it, from when it starts until it ends. */
490
- export interface WebCallSession {
491
- /** What the user said; the reply to say. `sent`: it went to the conversation already, as it began the call. */
492
- say(text: string, options?: {
493
- sent?: boolean;
494
- }): Promise<string | undefined>;
495
- /** Whether the partner ended the call (asked to hang up): it ends once its last reply is said. */
496
- ending?(): boolean;
497
- /** What the partner says by itself (news of the work), asked again and again in a call; undefined after a while. */
498
- next?(): Promise<string | undefined>;
499
- close(): void;
500
- }
501
472
  /** What else a code renderer says of its blocks (WebExtensionAPI.registerCodeRenderer). */
502
473
  export interface WebCodeRendererOptions {
503
474
  /**
@@ -527,6 +498,7 @@ export interface WebCodeRendererProps {
527
498
  */
528
499
  answer?: string;
529
500
  }
501
+ /** pi's custom message, as the conversation holds it. */
530
502
  export interface WebCustomMessage {
531
503
  role: 'custom';
532
504
  customType: string;
@@ -31,17 +31,37 @@ export interface WebPartner {
31
31
  chat?: WebPartnerChat;
32
32
  /** A friend online now: the green dot of a contact. */
33
33
  online?: boolean;
34
+ /** A group chat with friends in it, not of the user's agents alone: a small label after its name. */
35
+ friends?: boolean;
34
36
  /** Where it works (an agent's directory): a remote one is marked by its host. */
35
37
  location?: string;
36
38
  /** Opens its conversation (or, while not a partner yet, what to answer). A promise keeps the row busy. */
37
39
  open(): unknown;
38
- /** Its menu (stop, delete…), after Open. */
40
+ /**
41
+ * Opens who it is and its settings, as a messenger's profile of a contact or info of a group: an agent's name, model,
42
+ * role and directory, what a friend may do, a group chat's members. In its menu after Open, and behind its row.
43
+ */
44
+ info?(): unknown;
45
+ /** What else it does (stop, share, export…), in its menu between Open and {@link remove}. */
39
46
  menu?(): WebMenuItem[][];
47
+ /**
48
+ * Takes it off the user's partners (delete an agent, remove a friend, leave a group chat): last in its menu, in red,
49
+ * and behind its row on the page of the partners. It asks the user first itself.
50
+ */
51
+ remove?: WebMenuItem;
40
52
  }
41
53
  /** The conversation with a partner. */
42
54
  export interface WebPartnerChat {
43
- /** A conversation of pi (an agent's): the double's list has its row already, this only names whose it is. */
55
+ /**
56
+ * A conversation of pi (an agent's): the double's list has its row, once its session closed too; this names whose
57
+ * it is.
58
+ */
44
59
  sessionFile?: string;
60
+ /**
61
+ * With {@link sessionFile}, `Date.now()` time up to which what it said there was seen elsewhere (an agent's answers
62
+ * in a group chat, which the user read there): no amber dot for it in the double's list. Newer than some Ta apps.
63
+ */
64
+ seenAt?: number;
45
65
  /** What was said last, with who said it where it is not the partner. */
46
66
  last?: string;
47
67
  /** `Date.now()` time of it: where the conversation is in the double's list. */
@@ -52,6 +72,11 @@ export interface WebPartnerChat {
52
72
  busy?: boolean;
53
73
  /** Waits for the user to answer: the blue ?. */
54
74
  asks?: boolean;
75
+ /**
76
+ * Takes the conversation off the double's list, the partner kept (delete a chat of two): behind its row there; without
77
+ * it, the row of a group chat there takes it off with {@link WebPartner.remove}.
78
+ */
79
+ close?: WebMenuItem;
55
80
  }
56
81
  /** The partners of an extension (WebExtensionAPI.registerPartners). */
57
82
  export interface WebPartnerSource {
@@ -6,7 +6,7 @@ import type { GameProps } from '../game/game-protocol.js';
6
6
  import type { Game3DProps } from '../game/game3d-protocol.js';
7
7
  import type { ScreenPartSpec, TaScreen } from '../screen/screen-protocol.js';
8
8
  import type { Language, Theme } from '../settings/settings-protocol.js';
9
- import type { CodeEditorProps, DiffEditorProps, WebComposerProps, WebConversationViewProps, WebDialogProps, WebEmptyProps, WebFaceProps, WebFolderPickerProps, WebFullScreenProps, WebGroupFaceProps, WebHoldToTalkProps, WebImageViewerProps, WebLoadingProps, WebModelPickerProps, WebPictureCardsProps, WebPictureProps, WebSelectBarProps, WebSelectCheckProps, WebShareSheetProps, WebStackProps, WebSwipeRowProps, WebSwitchProps, WebTaskIconProps, WebVoice } from './web-api-components.js';
9
+ import type { CodeEditorProps, DiffEditorProps, WebChatImagesProps, WebComposerProps, WebConversationViewProps, WebDialogProps, WebEmptyProps, WebFaceProps, WebFolderPickerProps, WebFullScreenProps, WebGroupFaceProps, WebHoldToTalkProps, WebImageViewerProps, WebLoadingProps, WebModelPickerProps, WebPictureCardsProps, WebPictureProps, WebSelectBarProps, WebSelectCheckProps, WebShareSheetProps, WebStackProps, WebSwipeRowProps, WebSwitchProps, WebTaskIconProps, WebVoice } from './web-api-components.js';
10
10
  import type { WebAsk, WebCallPartner, WebChatIconSource, WebCodeRendererOptions, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebEditor, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebOpenerOptions, WebRoomAddon, WebRoomAddonEntry, WebSearchSource, WebSessionMenu, WebSessionNotice, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions.js';
11
11
  import type { WebDesktop, WebFileDrag } from './web-api-desktop.js';
12
12
  import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home.js';
@@ -322,10 +322,7 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI {
322
322
  closeEditor(id: string): void;
323
323
  /** Keeps a tab opened as a preview: the next preview opens beside it. */
324
324
  pinEditor(id: string): void;
325
- /**
326
- * Marks a tab as changed and not saved: a dot in place of its close button, and the user is asked
327
- * before closing it. Dirty tabs are pinned.
328
- */
325
+ /** Marks a tab as changed and not saved: a dot in place of its close button, and the user is asked before closing it. Dirty tabs are pinned. */
329
326
  setEditorDirty(id: string, dirty: boolean): void;
330
327
  /** A React hook: the id of the tab shown in the workbench, whoever opened it. */
331
328
  useActiveEditor(): string | undefined;
@@ -593,9 +590,8 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI {
593
590
  readonly SelectCheck: React.ComponentType<WebSelectCheckProps>;
594
591
  readonly SelectBar: React.ComponentType<WebSelectBarProps>;
595
592
  /**
596
- * The face of a task, as every list of tasks draws it: who does it (`WebTask.icon`), else its glyph on the tile
597
- * of tasks, a rounded square tinted green while it goes on and grey once it ended. Newer than some Ta apps:
598
- * `pi.ui.TaskIcon ?? fallback`.
593
+ * The face of a task, as every list of tasks draws it: who does it (`WebTask.icon`), else its glyph on the tile of tasks, a rounded
594
+ * square tinted green while it goes on and grey once it ended. Newer than some Ta apps: `pi.ui.TaskIcon ?? fallback`.
599
595
  */
600
596
  readonly TaskIcon: React.ComponentType<WebTaskIconProps>;
601
597
  /** A small picture as the pictures of Ta: an SVG whose shapes take the classes `ta-pic-*` (WebPictureProps). */
@@ -603,12 +599,13 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI {
603
599
  /** Choices as pictures in a row, as the suggestions of an empty conversation: a click picks one. */
604
600
  readonly PictureCards: React.ComponentType<WebPictureCardsProps>;
605
601
  /**
606
- * A picture to look at closely, as the viewers of pictures: all of it at first (never larger than its own
607
- * pixels), pinched by two fingers or a trackpad, zoomed by a wheel with Ctrl or ⌘ and by a double tap or
608
- * click, dragged or scrolled once zoomed; with − / the scale / + / fit / actual size below it, and the
609
- * pictures beside it at its sides when given (`onPrevious` / `onNext`). It fills its parent (a column of flex).
602
+ * A picture to look at closely, as the viewers of pictures: all of it at first (never larger than its own pixels), pinched by two fingers
603
+ * or a trackpad, zoomed by a wheel with Ctrl or ⌘ and by a double tap or click, dragged or scrolled once zoomed; with − / the scale / + /
604
+ * fit / actual size below it, and the pictures beside it at its sides when given (`onPrevious` / `onNext`). It fills its parent (a column of flex).
610
605
  */
611
606
  readonly ImageViewer: React.ComponentType<WebImageViewerProps>;
607
+ /** The pictures of a message of a chat the extension draws, as a conversation shows the user's (`thumb` blurred till `src`). Newer than some apps. */
608
+ readonly ChatImages?: React.ComponentType<WebChatImagesProps>;
612
609
  /** A QR code of a text (a link to scan with a phone), black on white whatever the theme; `label` for a screen reader. */
613
610
  readonly QrCode: React.ComponentType<{
614
611
  text: string;
@@ -40,9 +40,8 @@ export interface WebExtensionContextHost {
40
40
  switcher(): WebSessionSwitcher | undefined;
41
41
  }
42
42
  /**
43
- * The API each web extension gets: what it registers is its own and goes when it stops, and once it stopped
44
- * (turned off, removed, a timer of it left behind) it neither shows nor does anything more: its dialogs answer
45
- * no, and what would act for the user (send a message, switch the conversation, open or reload packages) fails.
43
+ * The API each web extension gets: what it registers is its own and goes when it stops, and once it stopped (turned off, removed,
44
+ * a timer of it left behind) it neither shows nor does anything more: its dialogs answer no, and what would act for the user fails.
46
45
  */
47
46
  export declare class WebExtensionContext {
48
47
  protected readonly host: WebExtensionContextHost;
@@ -20,6 +20,7 @@ import { HostTag } from '../components/host-tag.js';
20
20
  import { ImageViewer } from '../components/image-viewer.js';
21
21
  import { Loading } from '../components/loading.js';
22
22
  import { Markdown } from '../components/markdown.js';
23
+ import { ChatImages } from '../components/message-images.js';
23
24
  import { SettingsModelPicker } from '../components/model-picker.js';
24
25
  import { PhoneStack } from '../components/phone-shell.js';
25
26
  import { Picture, PictureCards } from '../components/picture.js';
@@ -51,9 +52,8 @@ import { WebPagesUtil } from './web-pages.js';
51
52
  import { WebTaskUtil } from './web-tasks.js';
52
53
  const FILE_DRAG = Object.freeze({ set: FileDragUtil.set, has: FileDragUtil.has, get: FileDragUtil.get, paths: FileDragUtil.paths });
53
54
  /**
54
- * The API each web extension gets: what it registers is its own and goes when it stops, and once it stopped
55
- * (turned off, removed, a timer of it left behind) it neither shows nor does anything more: its dialogs answer
56
- * no, and what would act for the user (send a message, switch the conversation, open or reload packages) fails.
55
+ * The API each web extension gets: what it registers is its own and goes when it stops, and once it stopped (turned off, removed,
56
+ * a timer of it left behind) it neither shows nor does anything more: its dialogs answer no, and what would act for the user fails.
57
57
  */
58
58
  export class WebExtensionContext {
59
59
  constructor(host) {
@@ -440,6 +440,7 @@ export class WebExtensionContext {
440
440
  Picture,
441
441
  PictureCards,
442
442
  ImageViewer,
443
+ ChatImages,
443
444
  QrCode: QrView,
444
445
  ShareSheet: this.shareSheet,
445
446
  Dialog: WebDialog,
@@ -455,9 +456,8 @@ export class WebExtensionContext {
455
456
  const isShown = () => host.isShown(id);
456
457
  const view = React.useSyncExternalStore(subscribe, find, find);
457
458
  const shown = React.useSyncExternalStore(subscribe, isShown, isShown);
458
- // The title is read again in another language: a string, so that the same words stay the same value.
459
+ // The title (read again in another language) and the preview as strings, so that the same words stay the same value.
459
460
  const title = view ? WebLabelUtil.text(view.title) : undefined;
460
- // The preview as one string, so that the same line stays the same value.
461
461
  const watch = React.useCallback((listener) => { var _a; var _b; return (_b = (_a = view === null || view === void 0 ? void 0 : view.subscribePreview) === null || _a === void 0 ? void 0 : _a.call(view, listener)) !== null && _b !== void 0 ? _b : (() => undefined); }, [view]);
462
462
  const read = () => {
463
463
  var _a;
@@ -10,6 +10,11 @@ export declare namespace WebExtensionUtil {
10
10
  export declare namespace WebViewUtil {
11
11
  /** The tab a `panel` view opens as. */
12
12
  function editorId(viewId: string): string;
13
+ /**
14
+ * The tools the workbench's + and its empty state list: its `panel` views, but those only opened by something else
15
+ * (`navigation: false`, as the info of the chat shown), which would be there twice or with nothing to show.
16
+ */
17
+ function tools<T extends Pick<WebViewEntry, 'location' | 'navigation'>>(views: readonly T[]): T[];
13
18
  /** The page shown last in this tab of the browser: another tab may show another. */
14
19
  const PAGE: StateSpec<string>;
15
20
  /** The tools open in the workbench, for the user in any browser: the workbench is one for the whole page. */
@@ -36,6 +36,14 @@ export var WebViewUtil;
36
36
  return `view:${viewId}`;
37
37
  }
38
38
  WebViewUtil.editorId = editorId;
39
+ /**
40
+ * The tools the workbench's + and its empty state list: its `panel` views, but those only opened by something else
41
+ * (`navigation: false`, as the info of the chat shown), which would be there twice or with nothing to show.
42
+ */
43
+ function tools(views) {
44
+ return views.filter(view => view.location === 'panel' && view.navigation !== false);
45
+ }
46
+ WebViewUtil.tools = tools;
39
47
  /** The page shown last in this tab of the browser: another tab may show another. */
40
48
  WebViewUtil.PAGE = { key: 'page', tier: 'tab', initial: '', parse: StateUtil.string };
41
49
  /** The tools open in the workbench, for the user in any browser: the workbench is one for the whole page. */