@celljs/ta-web 4.37.0 → 4.39.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 (237) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/assistant/assistant-thread.d.ts +1 -1
  4. package/esm/browser/assistant/chat-task-source.js +2 -1
  5. package/esm/browser/components/app-contexts.js +11 -9
  6. package/esm/browser/components/chat-asks.d.ts +4 -1
  7. package/esm/browser/components/chat-asks.js +10 -0
  8. package/esm/browser/components/chat-list-row.js +5 -3
  9. package/esm/browser/components/cloud-network.d.ts +17 -0
  10. package/esm/browser/components/cloud-network.js +105 -0
  11. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  12. package/esm/browser/components/composer-box-protocol.d.ts +5 -0
  13. package/esm/browser/components/composer-box.js +11 -14
  14. package/esm/browser/components/composer-media.d.ts +26 -0
  15. package/esm/browser/components/composer-media.js +37 -0
  16. package/esm/browser/components/composer-target.d.ts +2 -2
  17. package/esm/browser/components/composer-target.js +3 -3
  18. package/esm/browser/components/composer.js +1 -0
  19. package/esm/browser/components/folder-picker.d.ts +3 -3
  20. package/esm/browser/components/folder-picker.js +5 -15
  21. package/esm/browser/components/host-view.d.ts +1 -1
  22. package/esm/browser/components/link.d.ts +7 -1
  23. package/esm/browser/components/link.js +24 -5
  24. package/esm/browser/components/markdown.d.ts +2 -2
  25. package/esm/browser/components/markdown.js +77 -5
  26. package/esm/browser/components/relay-services.d.ts +0 -2
  27. package/esm/browser/components/relay-services.js +1 -11
  28. package/esm/browser/components/remote-hosts.d.ts +11 -7
  29. package/esm/browser/components/remote-hosts.js +94 -50
  30. package/esm/browser/components/remote-machines.d.ts +21 -0
  31. package/esm/browser/components/remote-machines.js +56 -0
  32. package/esm/browser/components/remote-prompts.d.ts +2 -3
  33. package/esm/browser/components/remote-prompts.js +3 -15
  34. package/esm/browser/components/remote-steps.d.ts +19 -0
  35. package/esm/browser/components/remote-steps.js +26 -0
  36. package/esm/browser/components/session-view.js +10 -6
  37. package/esm/browser/components/settings-controls.d.ts +3 -1
  38. package/esm/browser/components/settings-controls.js +2 -2
  39. package/esm/browser/components/web-composer.d.ts +1 -1
  40. package/esm/browser/components/web-composer.js +12 -3
  41. package/esm/browser/device/photo-picker.d.ts +11 -3
  42. package/esm/browser/device/photo-picker.js +26 -9
  43. package/esm/browser/device/video-picks.d.ts +24 -0
  44. package/esm/browser/device/video-picks.js +104 -0
  45. package/esm/browser/extension/icons.js +3 -1
  46. package/esm/browser/extension/web-access.js +4 -1
  47. package/esm/browser/extension/web-api-code.d.ts +36 -0
  48. package/esm/browser/extension/web-api-code.js +3 -0
  49. package/esm/browser/extension/web-api-components.d.ts +22 -0
  50. package/esm/browser/extension/web-api-contributions.d.ts +0 -31
  51. package/esm/browser/extension/web-api-menus.d.ts +29 -3
  52. package/esm/browser/extension/web-api-play.d.ts +29 -0
  53. package/esm/browser/extension/web-api-play.js +2 -0
  54. package/esm/browser/extension/web-api-services.d.ts +6 -0
  55. package/esm/browser/extension/web-api-spec.js +5 -0
  56. package/esm/browser/extension/web-api-terminal.d.ts +20 -0
  57. package/esm/browser/extension/web-extension-api.d.ts +12 -17
  58. package/esm/browser/extension/web-extension-context.d.ts +1 -1
  59. package/esm/browser/extension/web-extension-context.js +6 -3
  60. package/esm/browser/extension/web-extension-protocol.d.ts +5 -1
  61. package/esm/browser/extension/web-extension-protocol.js +2 -0
  62. package/esm/browser/extension/web-extension-run.d.ts +6 -4
  63. package/esm/browser/extension/web-extension-run.js +18 -9
  64. package/esm/browser/extension/web-extensions-running.js +38 -7
  65. package/esm/browser/extension/web-on-demand.d.ts +5 -0
  66. package/esm/browser/extension/web-on-demand.js +11 -0
  67. package/esm/browser/i18n/en/assistant.d.ts +3 -0
  68. package/esm/browser/i18n/en/assistant.js +3 -0
  69. package/esm/browser/i18n/en/chat.d.ts +1 -0
  70. package/esm/browser/i18n/en/chat.js +1 -0
  71. package/esm/browser/i18n/en/common.d.ts +1 -0
  72. package/esm/browser/i18n/en/common.js +1 -0
  73. package/esm/browser/i18n/en/discover.d.ts +2 -0
  74. package/esm/browser/i18n/en/discover.js +2 -0
  75. package/esm/browser/i18n/en/service.d.ts +26 -2
  76. package/esm/browser/i18n/en/service.js +34 -10
  77. package/esm/browser/i18n/ja/assistant.js +3 -0
  78. package/esm/browser/i18n/ja/chat.js +1 -0
  79. package/esm/browser/i18n/ja/common.js +1 -0
  80. package/esm/browser/i18n/ja/discover.js +2 -0
  81. package/esm/browser/i18n/ja/service.js +34 -10
  82. package/esm/browser/i18n/locales.d.ts +34 -3
  83. package/esm/browser/i18n/messages.d.ts +33 -2
  84. package/esm/browser/i18n/zh/assistant.js +3 -0
  85. package/esm/browser/i18n/zh/chat.js +1 -0
  86. package/esm/browser/i18n/zh/common.js +1 -0
  87. package/esm/browser/i18n/zh/discover.js +2 -0
  88. package/esm/browser/i18n/zh/service.js +34 -10
  89. package/esm/browser/i18n/zh-tw/assistant.js +3 -0
  90. package/esm/browser/i18n/zh-tw/chat.js +1 -0
  91. package/esm/browser/i18n/zh-tw/common.js +1 -0
  92. package/esm/browser/i18n/zh-tw/discover.js +2 -0
  93. package/esm/browser/i18n/zh-tw/service.js +34 -10
  94. package/esm/browser/markdown/code-renderers.d.ts +6 -1
  95. package/esm/browser/markdown/code-renderers.js +4 -0
  96. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  97. package/esm/browser/sandbox/work/work-api.d.ts +113 -0
  98. package/esm/browser/sandbox/work/work-api.js +95 -0
  99. package/esm/browser/sandbox/work/work-docs.d.ts +18 -0
  100. package/esm/browser/sandbox/work/work-docs.js +66 -0
  101. package/esm/browser/sandbox/work/work-frame.d.ts +27 -0
  102. package/esm/browser/sandbox/work/work-frame.js +124 -0
  103. package/esm/browser/share/shared-extensions.d.ts +2 -1
  104. package/esm/browser/style/conversation.d.ts +1 -1
  105. package/esm/browser/style/conversation.js +10 -0
  106. package/esm/browser/style/dialogs.d.ts +1 -1
  107. package/esm/browser/style/dialogs.js +1 -4
  108. package/esm/browser/style/pages.d.ts +1 -1
  109. package/esm/browser/style/pages.js +10 -1
  110. package/esm/browser/terminal/terminal-osc.d.ts +15 -0
  111. package/esm/browser/terminal/terminal-osc.js +91 -0
  112. package/esm/browser/terminal/web-terminal.d.ts +4 -7
  113. package/esm/browser/terminal/web-terminal.js +22 -26
  114. package/esm/browser/util/link.d.ts +6 -1
  115. package/esm/browser/util/link.js +11 -0
  116. package/esm/browser/workbench-protocol.d.ts +2 -0
  117. package/esm/browser/workbench-services.d.ts +2 -0
  118. package/esm/browser/workbench-services.js +5 -0
  119. package/esm/browser/workbench.js +3 -0
  120. package/lib/browser/assistant/assistant-thread.d.ts +1 -1
  121. package/lib/browser/assistant/chat-task-source.js +2 -1
  122. package/lib/browser/components/app-contexts.js +10 -8
  123. package/lib/browser/components/chat-asks.d.ts +4 -1
  124. package/lib/browser/components/chat-asks.js +10 -0
  125. package/lib/browser/components/chat-list-row.js +5 -3
  126. package/lib/browser/components/cloud-network.d.ts +18 -0
  127. package/lib/browser/components/cloud-network.js +142 -0
  128. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  129. package/lib/browser/components/composer-box-protocol.d.ts +5 -0
  130. package/lib/browser/components/composer-box.js +9 -12
  131. package/lib/browser/components/composer-media.d.ts +27 -0
  132. package/lib/browser/components/composer-media.js +74 -0
  133. package/lib/browser/components/composer-target.d.ts +2 -2
  134. package/lib/browser/components/composer-target.js +3 -3
  135. package/lib/browser/components/composer.js +1 -0
  136. package/lib/browser/components/folder-picker.d.ts +3 -3
  137. package/lib/browser/components/folder-picker.js +5 -15
  138. package/lib/browser/components/host-view.d.ts +1 -1
  139. package/lib/browser/components/link.d.ts +7 -1
  140. package/lib/browser/components/link.js +25 -6
  141. package/lib/browser/components/markdown.d.ts +2 -2
  142. package/lib/browser/components/markdown.js +75 -3
  143. package/lib/browser/components/relay-services.d.ts +0 -2
  144. package/lib/browser/components/relay-services.js +1 -11
  145. package/lib/browser/components/remote-hosts.d.ts +11 -7
  146. package/lib/browser/components/remote-hosts.js +92 -48
  147. package/lib/browser/components/remote-machines.d.ts +22 -0
  148. package/lib/browser/components/remote-machines.js +59 -0
  149. package/lib/browser/components/remote-prompts.d.ts +2 -3
  150. package/lib/browser/components/remote-prompts.js +3 -15
  151. package/lib/browser/components/remote-steps.d.ts +20 -0
  152. package/lib/browser/components/remote-steps.js +63 -0
  153. package/lib/browser/components/session-view.js +8 -4
  154. package/lib/browser/components/settings-controls.d.ts +3 -1
  155. package/lib/browser/components/settings-controls.js +2 -2
  156. package/lib/browser/components/web-composer.d.ts +1 -1
  157. package/lib/browser/components/web-composer.js +12 -3
  158. package/lib/browser/device/photo-picker.d.ts +11 -3
  159. package/lib/browser/device/photo-picker.js +26 -9
  160. package/lib/browser/device/video-picks.d.ts +25 -0
  161. package/lib/browser/device/video-picks.js +107 -0
  162. package/lib/browser/extension/icons.js +2 -0
  163. package/lib/browser/extension/web-access.js +4 -1
  164. package/lib/browser/extension/web-api-code.d.ts +37 -0
  165. package/lib/browser/extension/web-api-code.js +4 -0
  166. package/lib/browser/extension/web-api-components.d.ts +22 -0
  167. package/lib/browser/extension/web-api-contributions.d.ts +0 -31
  168. package/lib/browser/extension/web-api-menus.d.ts +29 -3
  169. package/lib/browser/extension/web-api-play.d.ts +30 -0
  170. package/lib/browser/extension/web-api-play.js +3 -0
  171. package/lib/browser/extension/web-api-services.d.ts +6 -0
  172. package/lib/browser/extension/web-api-spec.js +5 -0
  173. package/lib/browser/extension/web-api-terminal.d.ts +20 -0
  174. package/lib/browser/extension/web-extension-api.d.ts +12 -17
  175. package/lib/browser/extension/web-extension-context.d.ts +1 -1
  176. package/lib/browser/extension/web-extension-context.js +6 -3
  177. package/lib/browser/extension/web-extension-protocol.d.ts +5 -1
  178. package/lib/browser/extension/web-extension-protocol.js +2 -0
  179. package/lib/browser/extension/web-extension-run.d.ts +6 -4
  180. package/lib/browser/extension/web-extension-run.js +18 -9
  181. package/lib/browser/extension/web-extensions-running.js +38 -7
  182. package/lib/browser/extension/web-on-demand.d.ts +5 -0
  183. package/lib/browser/extension/web-on-demand.js +11 -0
  184. package/lib/browser/i18n/en/assistant.d.ts +3 -0
  185. package/lib/browser/i18n/en/assistant.js +3 -0
  186. package/lib/browser/i18n/en/chat.d.ts +1 -0
  187. package/lib/browser/i18n/en/chat.js +1 -0
  188. package/lib/browser/i18n/en/common.d.ts +1 -0
  189. package/lib/browser/i18n/en/common.js +1 -0
  190. package/lib/browser/i18n/en/discover.d.ts +2 -0
  191. package/lib/browser/i18n/en/discover.js +2 -0
  192. package/lib/browser/i18n/en/service.d.ts +26 -2
  193. package/lib/browser/i18n/en/service.js +34 -10
  194. package/lib/browser/i18n/ja/assistant.js +3 -0
  195. package/lib/browser/i18n/ja/chat.js +1 -0
  196. package/lib/browser/i18n/ja/common.js +1 -0
  197. package/lib/browser/i18n/ja/discover.js +2 -0
  198. package/lib/browser/i18n/ja/service.js +34 -10
  199. package/lib/browser/i18n/locales.d.ts +34 -3
  200. package/lib/browser/i18n/messages.d.ts +33 -2
  201. package/lib/browser/i18n/zh/assistant.js +3 -0
  202. package/lib/browser/i18n/zh/chat.js +1 -0
  203. package/lib/browser/i18n/zh/common.js +1 -0
  204. package/lib/browser/i18n/zh/discover.js +2 -0
  205. package/lib/browser/i18n/zh/service.js +34 -10
  206. package/lib/browser/i18n/zh-tw/assistant.js +3 -0
  207. package/lib/browser/i18n/zh-tw/chat.js +1 -0
  208. package/lib/browser/i18n/zh-tw/common.js +1 -0
  209. package/lib/browser/i18n/zh-tw/discover.js +2 -0
  210. package/lib/browser/i18n/zh-tw/service.js +34 -10
  211. package/lib/browser/markdown/code-renderers.d.ts +6 -1
  212. package/lib/browser/markdown/code-renderers.js +5 -1
  213. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  214. package/lib/browser/sandbox/work/work-api.d.ts +114 -0
  215. package/lib/browser/sandbox/work/work-api.js +99 -0
  216. package/lib/browser/sandbox/work/work-docs.d.ts +19 -0
  217. package/lib/browser/sandbox/work/work-docs.js +69 -0
  218. package/lib/browser/sandbox/work/work-frame.d.ts +28 -0
  219. package/lib/browser/sandbox/work/work-frame.js +160 -0
  220. package/lib/browser/share/shared-extensions.d.ts +2 -1
  221. package/lib/browser/style/conversation.d.ts +1 -1
  222. package/lib/browser/style/conversation.js +10 -0
  223. package/lib/browser/style/dialogs.d.ts +1 -1
  224. package/lib/browser/style/dialogs.js +1 -4
  225. package/lib/browser/style/pages.d.ts +1 -1
  226. package/lib/browser/style/pages.js +10 -1
  227. package/lib/browser/terminal/terminal-osc.d.ts +16 -0
  228. package/lib/browser/terminal/terminal-osc.js +94 -0
  229. package/lib/browser/terminal/web-terminal.d.ts +4 -7
  230. package/lib/browser/terminal/web-terminal.js +25 -29
  231. package/lib/browser/util/link.d.ts +6 -1
  232. package/lib/browser/util/link.js +11 -0
  233. package/lib/browser/workbench-protocol.d.ts +2 -0
  234. package/lib/browser/workbench-services.d.ts +2 -0
  235. package/lib/browser/workbench-services.js +5 -0
  236. package/lib/browser/workbench.js +3 -0
  237. package/package.json +12 -12
@@ -0,0 +1,24 @@
1
+ import type { WebPickedVideo } from '../extension/web-api-components.js';
2
+ /** A video as the Ta app on iOS hands it from its picker (TaVideos.swift): an address of the app to read it at. */
3
+ export interface NativeVideo {
4
+ url: string;
5
+ name?: string;
6
+ type?: string;
7
+ bytes?: number;
8
+ }
9
+ /**
10
+ * The videos the message box takes with the pictures (WebComposerProps.videos), as WeChat's album: a file of a
11
+ * field, or one the picker of the Ta app on iOS kept, which it also makes smaller there, as WeChat sends a video.
12
+ */
13
+ export declare namespace VideoPicks {
14
+ function isVideo(file: Pick<File, 'type'>): boolean;
15
+ /** What of the files pasted the box takes: the pictures, and the videos when it takes them. */
16
+ function pasted(files: FileList, videos: boolean): File[];
17
+ /** What a field of files takes: the pictures, and the videos when the box takes them. */
18
+ function accept(images: readonly string[], videos: boolean): string;
19
+ /** Hands the videos among `files` to `take` (none without it), and returns the rest. */
20
+ function take(files: FileList | readonly File[], take?: (videos: WebPickedVideo[]) => void): File[];
21
+ function ofFile(file: File): WebPickedVideo;
22
+ /** One kept by the app's picker: read at its address, made smaller by the app. */
23
+ function ofNative(video: NativeVideo): WebPickedVideo;
24
+ }
@@ -0,0 +1,104 @@
1
+ import { RecentShots } from './recent-shots.js';
2
+ /**
3
+ * The videos the message box takes with the pictures (WebComposerProps.videos), as WeChat's album: a file of a
4
+ * field, or one the picker of the Ta app on iOS kept, which it also makes smaller there, as WeChat sends a video.
5
+ */
6
+ export var VideoPicks;
7
+ (function (VideoPicks) {
8
+ let next = 0;
9
+ function isVideo(file) {
10
+ return file.type.startsWith('video/');
11
+ }
12
+ VideoPicks.isVideo = isVideo;
13
+ /** What of the files pasted the box takes: the pictures, and the videos when it takes them. */
14
+ function pasted(files, videos) {
15
+ return Array.from(files).filter(file => file.type.startsWith('image/') || (videos && isVideo(file)));
16
+ }
17
+ VideoPicks.pasted = pasted;
18
+ /** What a field of files takes: the pictures, and the videos when the box takes them. */
19
+ function accept(images, videos) {
20
+ return videos ? [...images, 'video/*'].join(',') : images.join(',');
21
+ }
22
+ VideoPicks.accept = accept;
23
+ /** Hands the videos among `files` to `take` (none without it), and returns the rest. */
24
+ function take(files, take) {
25
+ const all = Array.from(files);
26
+ const videos = take ? all.filter(isVideo) : [];
27
+ if (videos.length) {
28
+ take === null || take === void 0 ? void 0 : take(videos.map(ofFile));
29
+ }
30
+ return all.filter(file => !videos.includes(file));
31
+ }
32
+ VideoPicks.take = take;
33
+ function ofFile(file) {
34
+ return { name: file.name, type: file.type, bytes: file.size, read: async () => file };
35
+ }
36
+ VideoPicks.ofFile = ofFile;
37
+ /** One kept by the app's picker: read at its address, made smaller by the app. */
38
+ function ofNative(video) {
39
+ const read = async (url) => {
40
+ const response = await fetch(url);
41
+ if (!response.ok) {
42
+ throw new Error(`The video could not be read (${response.status}).`);
43
+ }
44
+ return response.blob();
45
+ };
46
+ return {
47
+ name: video.name || 'video.mov',
48
+ type: video.type || 'video/quicktime',
49
+ ...(typeof video.bytes === 'number' ? { bytes: video.bytes } : {}),
50
+ read: () => read(video.url),
51
+ shrink: (limit, progress, signal) => shrinkNative(video.url, limit, progress, signal).then(read),
52
+ };
53
+ }
54
+ VideoPicks.ofNative = ofNative;
55
+ function native() {
56
+ var _a, _b;
57
+ return (_b = (_a = globalThis.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0 ? void 0 : _b.taShots;
58
+ }
59
+ /** The app makes the video at `url` smaller: the address of what it wrote. */
60
+ function shrinkNative(url, limit, progress, signal) {
61
+ const videos = native();
62
+ if (!videos) {
63
+ return Promise.reject(new Error('Not in the Ta app.'));
64
+ }
65
+ const id = `v${++next}`;
66
+ return new Promise((resolve, reject) => {
67
+ const end = () => {
68
+ globalThis.removeEventListener(RecentShots.EVENT, onEvent);
69
+ signal.removeEventListener('abort', onAbort);
70
+ };
71
+ const onEvent = (event) => {
72
+ const detail = event.detail;
73
+ if ((detail === null || detail === void 0 ? void 0 : detail.id) !== id) {
74
+ return;
75
+ }
76
+ if (typeof detail.progress === 'number') {
77
+ progress(detail.progress);
78
+ }
79
+ else {
80
+ end();
81
+ if (detail.url) {
82
+ resolve(detail.url);
83
+ }
84
+ else {
85
+ reject(new Error(detail.error || 'The video could not be made smaller.'));
86
+ }
87
+ }
88
+ };
89
+ const onAbort = () => {
90
+ end();
91
+ videos.postMessage({ id, action: 'cancelShrink' });
92
+ reject(new DOMException('Aborted', 'AbortError'));
93
+ };
94
+ if (signal.aborted) {
95
+ onAbort();
96
+ return;
97
+ }
98
+ globalThis.addEventListener(RecentShots.EVENT, onEvent);
99
+ signal.addEventListener('abort', onAbort);
100
+ videos.postMessage({ id, action: 'shrinkVideo', url, limit });
101
+ });
102
+ }
103
+ })(VideoPicks || (VideoPicks = {}));
104
+ //# sourceMappingURL=video-picks.js.map
@@ -1,4 +1,4 @@
1
- import { AlarmClock, Aperture, AppWindow, Archive, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, Bell, BellOff, BookOpen, Bot, Box, Bug, Building2, Calendar, Camera, CaseSensitive, ChartColumn, ChartSpline, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsDownUp, ChevronsUpDown, ChevronUp, Circle, CircleAlert, CircleArrowRight, CircleHelp, Clipboard, ClipboardPaste, Clock, Cloud, CloudUpload, 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, FolderLock, FolderOpen, FolderPlus, FolderSearch, FolderTree, Forward, Gamepad2, Gauge, GitBranch, GitCommitHorizontal, Globe, Grip, HardDrive, Hash, Headphones, 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, Navigation, Package, PackageOpen, Paperclip, Pencil, Phone, Pin, PinOff, Play, Plus, Pointer, Power, Puzzle, QrCode, Quote, Radar, RefreshCw, Regex, Replace, ReplaceAll, Rocket, RotateCcw, Rows2, Save, Scan, ScanLine, ScrollText, Search, Send, Server, Share2, Shield, ShieldAlert, ShieldCheck, Shuffle, SlidersHorizontal, Smartphone, Sparkles, Square, SquareMinus, SquarePlus, SquareTerminal, Star, StarOff, Store, Target, Text, ThumbsDown, ThumbsUp, Timer, Trash2, TrendingDown, TrendingUp, Trophy, Undo2, Unplug, Upload, User, UserPlus, Users, Volume2, WholeWord, Wrench, X, Zap, } from 'lucide-react';
1
+ import { AlarmClock, Aperture, AppWindow, Archive, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, Bell, BellOff, BookOpen, Bot, Box, Bug, Building2, Calendar, Camera, CaseSensitive, ChartColumn, ChartSpline, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsDownUp, ChevronsUpDown, ChevronUp, Circle, CircleAlert, CircleArrowRight, CircleHelp, Clipboard, ClipboardPaste, Clock, Cloud, CloudUpload, 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, FolderLock, FolderOpen, FolderPlus, FolderSearch, FolderTree, Forward, Gamepad2, Gauge, GitBranch, GitCommitHorizontal, Globe, Grip, HardDrive, Hash, Headphones, 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, Navigation, Package, PackageOpen, Paperclip, Pencil, Phone, Pin, PinOff, Play, Plus, Pointer, Power, Presentation, Puzzle, QrCode, Quote, Radar, RefreshCw, Regex, Replace, ReplaceAll, Rocket, RotateCcw, Rows2, Save, Scan, ScanLine, ScrollText, Search, Send, Server, Share2, Sheet, Shield, ShieldAlert, ShieldCheck, Shuffle, SlidersHorizontal, Smartphone, Sparkles, Square, SquareMinus, SquarePlus, SquareTerminal, Star, StarOff, Store, Target, Text, ThumbsDown, ThumbsUp, 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,
@@ -125,6 +125,7 @@ export const WEB_ICONS = Object.freeze({
125
125
  Plus,
126
126
  Pointer,
127
127
  Power,
128
+ Presentation,
128
129
  Puzzle,
129
130
  Quote,
130
131
  QrCode,
@@ -144,6 +145,7 @@ export const WEB_ICONS = Object.freeze({
144
145
  Send,
145
146
  Server,
146
147
  Share2,
148
+ Sheet,
147
149
  Shield,
148
150
  ShieldAlert,
149
151
  ShieldCheck,
@@ -16,13 +16,16 @@ export var WebAccessUtil;
16
16
  WebAccessUtil.granted = granted;
17
17
  /** Where it came from, as the user knows it: never a link itself, whose key opens what it shares. */
18
18
  function source(info, say) {
19
- var _a, _b;
19
+ var _a, _b, _c;
20
20
  if (((_a = info.temporary) === null || _a === void 0 ? void 0 : _a.from) === 'link') {
21
21
  return say('ta.access.fromLink');
22
22
  }
23
23
  if (((_b = info.temporary) === null || _b === void 0 ? void 0 : _b.from) === 'market') {
24
24
  return say('ta.access.fromMarket');
25
25
  }
26
+ if (((_c = info.temporary) === null || _c === void 0 ? void 0 : _c.from) === 'agent') {
27
+ return say('ta.access.fromAgent');
28
+ }
26
29
  return info.source;
27
30
  }
28
31
  WebAccessUtil.source = source;
@@ -0,0 +1,36 @@
1
+ /** Part of the web extension API (web-extension-api.ts, which exports it all): the fenced blocks extensions draw. */
2
+ import type { TaWorkPoint } from '@celljs/ta-protocol';
3
+ /** What else a code renderer says of its blocks (WebExtensionAPI.registerCodeRenderer). */
4
+ export interface WebCodeRendererOptions {
5
+ /**
6
+ * What of a block is said aloud, in a call or a reply read out (SpokenReply), the rest being on the screen: what
7
+ * the user must hear (a choice to make, a failure, a risk), in a sentence or two; nothing for none. Its code is whole.
8
+ */
9
+ spoken?(code: string): string | undefined;
10
+ pointable?: boolean;
11
+ }
12
+ /** A fenced block of the language of a code renderer (WebExtensionAPI.registerCodeRenderer). */
13
+ export interface WebCodeRendererProps {
14
+ /** Its lines, as written. */
15
+ code: string;
16
+ /** As written after the fence. */
17
+ language: string;
18
+ /** False while the reply still streams it: the code may stop anywhere. */
19
+ closed: boolean;
20
+ /**
21
+ * Sends words as the user to the conversation the block is in (after its turn, if it works): a choice in it
22
+ * answered with a tap. None where no conversation holds the block (`ui.Markdown` of a page given none). Newer than some
23
+ * Ta apps, whose props have no `send`: there `pi.sendUserMessage` reaches the conversation shown.
24
+ */
25
+ send?: (text: string) => Promise<void>;
26
+ /**
27
+ * What the user said after the reply the block is in, once they did: a choice it offers was made (the words sent
28
+ * by `send`, or typed). None while they did not answer, and where no conversation holds the block. Newer than
29
+ * some Ta apps.
30
+ */
31
+ answer?: string;
32
+ conversation?: string;
33
+ embedded?: boolean;
34
+ point?: (point: TaWorkPoint) => void;
35
+ }
36
+ /** pi's custom message, as the conversation holds it. */
@@ -0,0 +1,3 @@
1
+ export {};
2
+ /** pi's custom message, as the conversation holds it. */
3
+ //# sourceMappingURL=web-api-code.js.map
@@ -329,6 +329,23 @@ export interface WebTranscribing {
329
329
  /** Ends it: the words heard so far come as final, then `onEnd`. */
330
330
  stop(): void;
331
331
  }
332
+ /**
333
+ * A video picked in the message box (WebComposerProps.videos), with the pictures as WeChat's album does: read as it
334
+ * is, or made smaller on the device where it can be (the Ta app on iOS).
335
+ */
336
+ export interface WebPickedVideo {
337
+ name: string;
338
+ type: string;
339
+ /** Its size in bytes, when known before it is read. */
340
+ bytes?: number;
341
+ /** Its bytes as they are. */
342
+ read(): Promise<Blob>;
343
+ /**
344
+ * Made smaller on the device to fit in `limit` bytes, `progress` from 0 to 1; rejects as `signal` aborts, or when
345
+ * it cannot. None where the device cannot: the computer makes it smaller, or it goes as it is.
346
+ */
347
+ shrink?(limit: number, progress: (done: number) => void, signal: AbortSignal): Promise<Blob>;
348
+ }
332
349
  export interface WebComposerProps {
333
350
  placeholder?: string;
334
351
  /**
@@ -342,6 +359,11 @@ export interface WebComposerProps {
342
359
  * Newer than some Ta apps, which take none.
343
360
  */
344
361
  images?: boolean | WebComposerImageLimits;
362
+ /**
363
+ * Videos are picked with the pictures (the album, the camera), pasted and dropped, and handed here as they come,
364
+ * never in the box. Newer than some Ta apps (`ui.composerVideos` says the box takes it).
365
+ */
366
+ videos?(videos: WebPickedVideo[]): void;
345
367
  /** An emoji button on the right of the field, as WeChat's: on a phone its panel takes the place of the keyboard. Newer than some Ta apps. */
346
368
  emoji?: boolean;
347
369
  /** The field takes the focus as the box shows (the keyboard comes up on a phone), as a box opened to comment. Newer than some Ta apps. */
@@ -482,37 +482,6 @@ export interface WebTaskEntry extends WebTask {
482
482
  /** The name of the extension it is of. */
483
483
  extension: string;
484
484
  }
485
- /** What else a code renderer says of its blocks (WebExtensionAPI.registerCodeRenderer). */
486
- export interface WebCodeRendererOptions {
487
- /**
488
- * What of a block is said aloud, in a call or a reply read out (SpokenReply), the rest being on the screen: what
489
- * the user must hear (a choice to make, a failure, a risk), in a sentence or two; nothing for none. Its code is whole.
490
- */
491
- spoken?(code: string): string | undefined;
492
- }
493
- /** A fenced block of the language of a code renderer (WebExtensionAPI.registerCodeRenderer). */
494
- export interface WebCodeRendererProps {
495
- /** Its lines, as written. */
496
- code: string;
497
- /** As written after the fence. */
498
- language: string;
499
- /** False while the reply still streams it: the code may stop anywhere. */
500
- closed: boolean;
501
- /**
502
- * Sends words as the user to the conversation the block is in (after its turn, if it works): a choice in it
503
- * answered with a tap. None where no conversation holds the block (`ui.Markdown` of a page given none). Newer than some
504
- * Ta apps, whose props have no `send`: there `pi.sendUserMessage` reaches the conversation shown.
505
- */
506
- send?: (text: string) => Promise<void>;
507
- /**
508
- * What the user said after the reply the block is in, once they did: a choice it offers was made (the words sent
509
- * by `send`, or typed). None while they did not answer, and where no conversation holds the block. Newer than
510
- * some Ta apps.
511
- */
512
- answer?: string;
513
- conversation?: string;
514
- embedded?: boolean;
515
- }
516
485
  /** pi's custom message, as the conversation holds it. */
517
486
  export interface WebCustomMessage {
518
487
  role: 'custom';
@@ -1,4 +1,5 @@
1
1
  /** Part of the web extension API (web-extension-api.ts, which exports it all): the entries extensions add to menus of the page. */
2
+ import type { TaWorkPoint } from '@celljs/ta-protocol';
2
3
  import type { WebMenuItem } from './web-api-contributions.js';
3
4
  /** A conversation as a list shows it: an open one has its session, one kept on the disk its file only. */
4
5
  export interface WebSessionRef {
@@ -12,11 +13,11 @@ export interface WebSessionRef {
12
13
  }
13
14
  /** The entries an extension adds to the menu of a conversation of a list (registerSessionMenu); none for some. */
14
15
  export type WebSessionMenu = (session: WebSessionRef) => WebMenuItem[];
15
- /** A file or a folder of a workspace, as a list of files (the explorer) shows it. */
16
+ /** A file or a folder of a workspace, as a list of files (the explorer) or a turn that changed it shows it. */
16
17
  export interface WebFileRef {
17
18
  /** The directory of the workspace: a path, or `ssh://…` (TaLocation). */
18
19
  cwd: string;
19
- /** Relative to `cwd`, with `/`. */
20
+ /** Relative to `cwd`, with `/`; absolute for a file a turn changed outside `cwd` (TaWorkspaceServer.fileUrl serves it alone). */
20
21
  path: string;
21
22
  name: string;
22
23
  kind: 'file' | 'directory';
@@ -24,6 +25,23 @@ export interface WebFileRef {
24
25
  }
25
26
  /** The entries an extension adds to the menu of a file or a folder of a list of files (registerFileMenu); none for some. */
26
27
  export type WebFileMenu = (file: WebFileRef) => WebMenuItem[];
28
+ /** A block of code as a reply shows it (a fenced block of Markdown, a command a tool ran). */
29
+ export interface WebCodeRef {
30
+ /** As the fence names it, in lower case; empty for none. */
31
+ language: string;
32
+ code: string;
33
+ /** Drawn by a renderer (registerCodeRenderer), once its fence ended: its actions are buttons with their words under it. */
34
+ drawn?: boolean;
35
+ /** The file of the conversation it is in, when it is drawn in one. */
36
+ conversation?: string;
37
+ /**
38
+ * Of a block drawn by a renderer that tells its parts apart (WebCodeRendererOptions.pointable): lets the user
39
+ * point at one, the page saying so above it; the part tapped, or undefined when they gave up.
40
+ */
41
+ point?: () => Promise<TaWorkPoint | undefined>;
42
+ }
43
+ /** The actions an extension adds to a block of code (registerCodeMenu); none for some. */
44
+ export type WebCodeMenu = (block: WebCodeRef) => WebMenuItem[];
27
45
  /** What a web extension adds to the menus of the page (WebExtensionAPI extends it). */
28
46
  export interface WebMenus {
29
47
  /**
@@ -33,8 +51,16 @@ export interface WebMenus {
33
51
  registerSessionMenu(menu: WebSessionMenu): void;
34
52
  /**
35
53
  * Entries of the menu of a file or a folder where a list of files shows it (the explorer: a right click or a held
36
- * finger on its row), in a section of their own: read each time the menu opens. Newer than some Ta apps:
54
+ * finger on its row; the files a turn changed; the tab of a file in the workbench), in a section of their own: read
55
+ * each time the menu opens. Newer than some Ta apps:
37
56
  * `pi.registerFileMenu?.(…)`.
38
57
  */
39
58
  registerFileMenu(menu: WebFileMenu): void;
59
+ /**
60
+ * Actions of a block of code (a fenced block of a reply, a command a tool ran): of one drawn as code, each a button
61
+ * by its icon beside Copy (one without an icon is not drawn); of one a renderer drew (`drawn`), a button with its
62
+ * words under it. Read each time the block is drawn.
63
+ * Newer than some Ta apps: `pi.registerCodeMenu?.(…)`.
64
+ */
65
+ registerCodeMenu(menu: WebCodeMenu): void;
40
66
  }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Part of the web extension API (web-extension-api.ts, which exports it all): what plays in the page, drawn by its own
3
+ * engines (docs/design/ta-games.md) or run in a frame of its own (a document a model wrote, docs/design/ta-works.md).
4
+ */
5
+ import type * as React from 'react';
6
+ import type { GameProps } from '../game/game-protocol.js';
7
+ import type { Game3DProps } from '../game/game3d-protocol.js';
8
+ import type { WorkFrameProps } from '../sandbox/work/work-frame.js';
9
+ export type { WorkEmit, WorkHost, WorkValues } from '../sandbox/work/work-api.js';
10
+ export type { WorkFrameProps } from '../sandbox/work/work-frame.js';
11
+ export interface WebPlayUI {
12
+ /**
13
+ * A game, drawn by Phaser, the game engine of the page (docs/design/ta-games.md): it fills its parent (a
14
+ * column of flex, or an element with a size), sleeps while out of sight and ends when it unmounts. Phaser
15
+ * loads the first time a game starts; an extension never brings an engine of its own.
16
+ */
17
+ readonly Game: React.ComponentType<GameProps>;
18
+ /**
19
+ * A 3D game, drawn by Three.js, the 3D engine of the page, with its OrbitControls: `setup` puts things in
20
+ * the scene it is given and returns what to do each frame. As `Game`, it fills its parent, sleeps while out
21
+ * of sight and ends when it unmounts, all of its scene disposed; Three.js loads the first time one starts.
22
+ */
23
+ readonly Game3D: React.ComponentType<Game3DProps>;
24
+ /**
25
+ * A document a model wrote (a game of a reply, a work) in a frame of its own, seen in the page: no origin, no network,
26
+ * nothing of Ta but its `window.ta` (WORK_API), each call checked and counted. Newer than some apps.
27
+ */
28
+ readonly WorkFrame?: React.ComponentType<WorkFrameProps>;
29
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=web-api-play.js.map
@@ -13,6 +13,12 @@ export interface WebServices {
13
13
  readonly workspace: TaWorkspaceServer;
14
14
  /** Shells; their output comes by {@link onTerminalData}. */
15
15
  readonly terminals: TaTerminalServer;
16
+ /**
17
+ * The page connected to Ta again after it was not (the network dropped, Ta restarted or updated): what it held on the
18
+ * server (terminals, subscriptions) may be gone, read it again. Stops when the extension unloads. Newer than some Ta
19
+ * apps: `pi.onReconnect?.(…)`.
20
+ */
21
+ onReconnect(listener: () => void): () => void;
16
22
  /** The packages pi loads; for the data of the extension's own package, {@link storage}. */
17
23
  readonly packages: TaPackageServer;
18
24
  /**
@@ -54,6 +54,7 @@ export const WEB_UI_SPEC = {
54
54
  theme: value(B),
55
55
  language: value(B),
56
56
  supportsWebview: value(B),
57
+ composerVideos: value(B),
57
58
  doubleInChats: value(B),
58
59
  useDevice: peek(B),
59
60
  showView: call(B),
@@ -90,6 +91,8 @@ export const WEB_UI_SPEC = {
90
91
  ImageViewer: component(B),
91
92
  ChatImages: component(B),
92
93
  QrCode: component(B),
94
+ // Its host is functions that take functions: only in the page, for now (docs/design/ta-works.md stage 2 opens it).
95
+ WorkFrame: page,
93
96
  Dialog: component(B),
94
97
  setWidget: fire(A, [null, 'C', { fields: { title: 'L' } }]),
95
98
  notify: fire(A),
@@ -176,6 +179,7 @@ export const WEB_API_SPEC = {
176
179
  registerPartners: page,
177
180
  registerSessionMenu: page,
178
181
  registerFileMenu: page,
182
+ registerCodeMenu: page,
179
183
  on: page,
180
184
  sendUserMessage: page,
181
185
  switchSession: page,
@@ -184,6 +188,7 @@ export const WEB_API_SPEC = {
184
188
  openTemporary: page,
185
189
  onRoomEvent: page,
186
190
  onTerminalData: page,
191
+ onReconnect: page,
187
192
  server: page,
188
193
  workspace: page,
189
194
  terminals: page,
@@ -1,3 +1,4 @@
1
+ import type { TaBlockedKind } from '@celljs/ta-protocol';
1
2
  /** Part of the web extension API (web-extension-api.ts, which exports it all): the terminals of `ui.createTerminal`. */
2
3
  export interface WebTerminalOptions {
3
4
  /** Its size until a view fits it: the size the program started with. Default: 80 × 24. */
@@ -18,6 +19,19 @@ export interface WebTerminalProgress {
18
19
  state: 'normal' | 'busy' | 'error' | 'paused';
19
20
  value?: number;
20
21
  }
22
+ /**
23
+ * What a terminal's program says it is doing (the Program Status Protocol, OSC 7501, which pi speaks): at work,
24
+ * waiting for the user and for what, done, or failed; none when it is idle or said nothing.
25
+ */
26
+ export interface WebTerminalStatus {
27
+ state: 'working' | 'blocked' | 'done' | 'error';
28
+ /** What a blocked program waits for. */
29
+ kind?: TaBlockedKind;
30
+ /** The one line it gave: its question, what it did. */
31
+ message?: string;
32
+ /** Its name, when it gave one (`pi`). */
33
+ app?: string;
34
+ }
21
35
  /** Keys a soft keyboard lacks, which a terminal sends as its program expects (arrows in the mode it set). */
22
36
  export type WebTerminalKey = 'Escape' | 'Tab' | 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';
23
37
  /**
@@ -51,6 +65,12 @@ export interface WebTerminal {
51
65
  /** The progress its program reports (OSC 9;4, as Windows Terminal, Ghostty and iTerm2 show it); undefined for none. */
52
66
  readonly progress?: WebTerminalProgress;
53
67
  onProgressChange(listener: (progress: WebTerminalProgress | undefined) => void): () => void;
68
+ /**
69
+ * What its program says it is doing (OSC 7501); undefined when it says nothing. The terminal answers the query
70
+ * of the protocol, so that programs know they may say it.
71
+ */
72
+ readonly status?: WebTerminalStatus;
73
+ onStatusChange(listener: (status: WebTerminalStatus | undefined) => void): () => void;
54
74
  /** Its program rang the bell or sent a notification (OSC 9 or OSC 777;notify), with the text of one. */
55
75
  onAttention(listener: (message: string | undefined) => void): () => void;
56
76
  /** Shows it in `element`, which it fills and follows in size; the function returned takes it out again. */
@@ -2,16 +2,16 @@ import type { TaEvent, TaRoomEvent, TaSavedSessionInfo, TaSessionInfo } from '@c
2
2
  import type * as React from 'react';
3
3
  import type { Mood } from '../avatar/dino-avatar.js';
4
4
  import type { DeviceState } from '../device/device-protocol.js';
5
- import type { GameProps } from '../game/game-protocol.js';
6
- import type { Game3DProps } from '../game/game3d-protocol.js';
7
5
  import type { ScreenPartSpec, TaScreen } from '../screen/screen-protocol.js';
8
6
  import type { Language, Theme } from '../settings/settings-protocol.js';
7
+ import type { WebCodeRendererOptions, WebCodeRendererProps } from './web-api-code.js';
9
8
  import type { CodeEditorProps, DiffEditorProps, WebAvatarProps, 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
- import type { WebAsk, WebCallsAPI, WebChatIconSource, WebChatTagsAPI, WebCodeRendererOptions, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebOpenerOptions, WebRoomAddon, WebRoomAddonEntry, WebSearchSource, WebSessionNotice, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions.js';
9
+ import type { WebAsk, WebCallsAPI, WebChatIconSource, WebChatTagsAPI, WebComposerAddon, WebCustomMessage, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebOpenerOptions, WebRoomAddon, WebRoomAddonEntry, WebSearchSource, WebSessionNotice, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions.js';
11
10
  import type { WebDesktop, WebDeviceUI, WebFileDrag } from './web-api-desktop.js';
12
11
  import type { WebEditorsUI } from './web-api-editors.js';
13
12
  import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home.js';
14
13
  import type { WebFileRef, WebMenus } from './web-api-menus.js';
14
+ import type { WebPlayUI } from './web-api-play.js';
15
15
  import type { WebServices } from './web-api-services.js';
16
16
  import type { WebPackageStorage } from './web-api-storage.js';
17
17
  import type { WebTargetsAPI } from './web-api-targets.js';
@@ -23,12 +23,14 @@ export type { TaFileBytes, TaFiles } from '../files/files-protocol.js';
23
23
  export type { GameColors, GameConfig, GameEngine, GameInstance, GamePage, GamePoint, GameProps, GameState } from '../game/game-protocol.js';
24
24
  export type { Game3DContext, Game3DEngine, Game3DLoop, Game3DProps } from '../game/game3d-protocol.js';
25
25
  export type { Language, Theme } from '../settings/settings-protocol.js';
26
+ export type * from './web-api-code.js';
26
27
  export type * from './web-api-components.js';
27
28
  export type * from './web-api-contributions.js';
28
29
  export type * from './web-api-desktop.js';
29
30
  export type * from './web-api-editors.js';
30
31
  export type * from './web-api-home.js';
31
32
  export type * from './web-api-menus.js';
33
+ export type * from './web-api-play.js';
32
34
  export type * from './web-api-services.js';
33
35
  export type * from './web-api-storage.js';
34
36
  export type * from './web-api-targets.js';
@@ -201,7 +203,7 @@ export interface WebNotifyOptions {
201
203
  export type { ScreenAction, ScreenItem, ScreenPartSpec, ScreenPartView, ScreenPlace, ScreenScrollable, ScreenScrollTo } from '../screen/screen-protocol.js';
202
204
  /** What web extensions see of TaScreen. */
203
205
  export type WebScreen = Pick<TaScreen, 'agent' | 'parts' | 'act' | 'element' | 'where' | 'places' | 'go' | 'pageScroll' | 'scroll'>;
204
- export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI, WebDeviceUI {
206
+ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI, WebDeviceUI, WebPlayUI {
205
207
  /** A widget around the message box, as pi's, or a card in the workbench on the right; `undefined` removes it. */
206
208
  setWidget(key: string, widget: React.ComponentType | undefined, options?: WidgetOptions): void;
207
209
  /**
@@ -254,6 +256,8 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
254
256
  * icon of the page as events and methods of the element (Electron's). Elsewhere, an iframe.
255
257
  */
256
258
  readonly supportsWebview: boolean;
259
+ /** The message box (`Composer`) takes `videos`, picked with the pictures. Newer than some Ta apps. */
260
+ readonly composerVideos?: boolean;
257
261
  /**
258
262
  * Ta Desktop's way to the file manager of the system (Finder, File Explorer, that of Linux), for paths of
259
263
  * this machine; undefined in a browser and the mobile app. A directory of `ssh://` is not of this machine.
@@ -273,7 +277,10 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
273
277
  * element's `loadURL`); the app refuses the rest.
274
278
  */
275
279
  readonly debugWebview?: (webContentsId: number, method: string, params?: Record<string, unknown>) => Promise<unknown>;
276
- /** Into the box of the conversation in front: `quote` before what it holds, `images` (base64) as if pasted; false when none shows. */
280
+ /**
281
+ * Into the message box in front (a conversation's, or `ui.Composer` of a page): `quote` before what it holds, `images`
282
+ * (base64) as if pasted; false when none shows.
283
+ */
277
284
  addToComposer(draft: {
278
285
  quote?: string;
279
286
  images?: {
@@ -447,18 +454,6 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
447
454
  * time one is made; what it shows stays while no view shows it (`attach` it to the next one).
448
455
  */
449
456
  createTerminal(options?: WebTerminalOptions): WebTerminal;
450
- /**
451
- * A game, drawn by Phaser, the game engine of the page (docs/design/ta-games.md): it fills its parent (a
452
- * column of flex, or an element with a size), sleeps while out of sight and ends when it unmounts. Phaser
453
- * loads the first time a game starts; an extension never brings an engine of its own.
454
- */
455
- readonly Game: React.ComponentType<GameProps>;
456
- /**
457
- * A 3D game, drawn by Three.js, the 3D engine of the page, with its OrbitControls: `setup` puts things in
458
- * the scene it is given and returns what to do each frame. As `Game`, it fills its parent, sleeps while out
459
- * of sight and ends when it unmounts, all of its scene disposed; Three.js loads the first time one starts.
460
- */
461
- readonly Game3D: React.ComponentType<Game3DProps>;
462
457
  /**
463
458
  * What covers all of the page while it is mounted: the shell, its head and side columns, under the notch and
464
459
  * the home bar (mind `env(safe-area-inset-*)`), below the title bar of the desktop app and above the keyboard.
@@ -9,7 +9,7 @@ import type { TaSettings } from '../settings/settings-protocol.js';
9
9
  import type { TaState } from '../state/state-protocol.js';
10
10
  import { type TaTargets } from '../targets/targets-protocol.js';
11
11
  import type { TaWorkbench } from '../workbench-protocol.js';
12
- import type { WebCodeRendererProps } from './web-api-contributions.js';
12
+ import type { WebCodeRendererProps } from './web-api-code.js';
13
13
  import type { WebEditorTabs } from './web-editor-tabs.js';
14
14
  import type { CodeEditorProps, DiffEditorProps, WebComposerProps, WebExtensionAPI, WebExtensionUI, WebFolderPickerProps, WebHoldToTalkProps, WebModelPickerProps, WebShareSheetProps, WebStorage, WebViewInfo, WebVoice } from './web-extension-api.js';
15
15
  import { type TaWebExtensions, type WebExtensionConversation, type WebSessionSwitcher } from './web-extension-protocol.js';
@@ -43,6 +43,7 @@ import { DraftPlaces } from '../drafts/drafts-protocol.js';
43
43
  import { Game3DView, GameView } from '../game/game-view.js';
44
44
  import { message as messageOf } from '../i18n/messages.js';
45
45
  import { translator } from '../i18n/use-t.js';
46
+ import { WorkFrame } from '../sandbox/work/work-frame.js';
46
47
  import { ScreenUtil } from '../screen/screen-protocol.js';
47
48
  import { TargetsUtil } from '../targets/targets-protocol.js';
48
49
  import { DefaultWebTerminal } from '../terminal/web-terminal.js';
@@ -187,15 +188,14 @@ export class WebExtensionContext {
187
188
  onRoomEvent: (listener, options) => hear(next => workbench.onRoomEvent(next, options), listener),
188
189
  ui: this.ui(run, register),
189
190
  onTerminalData: listener => hear(workbench.onTerminalData.bind(workbench), listener),
191
+ onReconnect: listener => hear(workbench.onReconnect.bind(workbench), listener),
190
192
  storage: { ...this.storage(run), directory: cwd => this.storage(run, cwd) },
191
193
  registerView: (name, view) => register(() => run.views.set(name, view)),
192
194
  registerMessageRenderer: (customType, renderer) => register(() => run.renderers.set(customType, renderer)),
193
195
  registerCodeRenderer: (language, renderer, options) => register(() => {
194
196
  const key = language.trim().toLowerCase();
195
197
  run.codeRenderers.set(key, WebExtensionContext.replying(renderer, mark));
196
- if (options === null || options === void 0 ? void 0 : options.spoken) {
197
- run.codeSpeech.set(key, options.spoken);
198
- }
198
+ run.codeOptions.set(key, options !== null && options !== void 0 ? options : {});
199
199
  }),
200
200
  registerCallPartner: partner => register(() => run.callPartners.push(partner)),
201
201
  registerCallMouth: mouth => register(() => run.callMouths.push(mouth)),
@@ -217,6 +217,7 @@ export class WebExtensionContext {
217
217
  registerSettings: section => register(() => run.settingsSections.push(section)),
218
218
  registerSessionMenu: menu => register(() => run.sessionMenus.push(WebExtensionRunUtil.menu(run, menu))),
219
219
  registerFileMenu: menu => register(() => run.fileMenus.push(WebExtensionRunUtil.menu(run, menu))),
220
+ registerCodeMenu: menu => register(() => run.codeMenus.push(WebExtensionRunUtil.menu(run, menu))),
220
221
  registerOpener: (opener, options) => register(() => ((options === null || options === void 0 ? void 0 : options.specific) ? run.specificOpeners : run.openers).push(async (link) => {
221
222
  // An opener that fails, or of an extension that stopped, leaves the link to the next one.
222
223
  try {
@@ -294,6 +295,7 @@ export class WebExtensionContext {
294
295
  return settings.state.language;
295
296
  },
296
297
  supportsWebview: DesktopUtil.has('webview'),
298
+ composerVideos: true,
297
299
  desktop: DesktopUtil.fileManager(),
298
300
  fileDrag: FILE_DRAG,
299
301
  debugWebview: DesktopUtil.debugWebview(),
@@ -442,6 +444,7 @@ export class WebExtensionContext {
442
444
  ImageViewer,
443
445
  ChatImages,
444
446
  QrCode: QrView,
447
+ WorkFrame,
445
448
  ShareSheet: this.shareSheet,
446
449
  Dialog: WebDialog,
447
450
  FolderPicker: this.folderPicker,