@celljs/ta-web 4.12.0 → 4.13.1

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 (229) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/assistant/assistant-extension.js +14 -0
  4. package/esm/browser/assistant/assistant-initiative.d.ts +27 -0
  5. package/esm/browser/assistant/assistant-initiative.js +76 -0
  6. package/esm/browser/assistant/assistant-task-source.d.ts +7 -0
  7. package/esm/browser/assistant/assistant-task-source.js +12 -2
  8. package/esm/browser/assistant/assistant-view.js +5 -4
  9. package/esm/browser/assistant/assistant.d.ts +5 -0
  10. package/esm/browser/assistant/assistant.js +25 -6
  11. package/esm/browser/components/app-nav.d.ts +3 -1
  12. package/esm/browser/components/app-nav.js +5 -2
  13. package/esm/browser/components/app-view.js +18 -9
  14. package/esm/browser/components/asks-badge.d.ts +5 -0
  15. package/esm/browser/components/asks-badge.js +8 -0
  16. package/esm/browser/components/chat-asks.d.ts +46 -0
  17. package/esm/browser/components/chat-asks.js +101 -0
  18. package/esm/browser/components/chat-list.d.ts +7 -1
  19. package/esm/browser/components/chat-list.js +46 -17
  20. package/esm/browser/components/composer-addon-util.d.ts +11 -0
  21. package/esm/browser/components/composer-addon-util.js +40 -0
  22. package/esm/browser/components/composer-addons.d.ts +1 -7
  23. package/esm/browser/components/composer-addons.js +1 -27
  24. package/esm/browser/components/composer.d.ts +7 -1
  25. package/esm/browser/components/composer.js +33 -20
  26. package/esm/browser/components/connection-bar.js +31 -12
  27. package/esm/browser/components/conversation-scroll-util.d.ts +5 -0
  28. package/esm/browser/components/conversation-scroll-util.js +18 -0
  29. package/esm/browser/components/conversation-scroll.d.ts +12 -2
  30. package/esm/browser/components/conversation-scroll.js +68 -5
  31. package/esm/browser/components/discover-view.js +5 -1
  32. package/esm/browser/components/earlier-messages.d.ts +10 -3
  33. package/esm/browser/components/earlier-messages.js +14 -8
  34. package/esm/browser/components/folder-picker.d.ts +2 -0
  35. package/esm/browser/components/folder-picker.js +7 -0
  36. package/esm/browser/components/host-view.d.ts +1 -1
  37. package/esm/browser/components/markdown.js +4 -2
  38. package/esm/browser/components/media.js +4 -39
  39. package/esm/browser/components/mermaid-view.js +45 -3
  40. package/esm/browser/components/message-footer.d.ts +2 -0
  41. package/esm/browser/components/message-footer.js +8 -1
  42. package/esm/browser/components/message-list.d.ts +12 -0
  43. package/esm/browser/components/message-list.js +156 -25
  44. package/esm/browser/components/phone-shell.d.ts +7 -2
  45. package/esm/browser/components/phone-shell.js +7 -3
  46. package/esm/browser/components/relay-services.d.ts +24 -0
  47. package/esm/browser/components/relay-services.js +249 -0
  48. package/esm/browser/components/relay-view.js +17 -1
  49. package/esm/browser/components/remote-hosts.js +1 -1
  50. package/esm/browser/components/session-view.js +16 -4
  51. package/esm/browser/components/settings-controls.js +3 -3
  52. package/esm/browser/components/settings-parts.js +13 -1
  53. package/esm/browser/components/ta-avatar.js +6 -0
  54. package/esm/browser/components/tool-result.d.ts +13 -0
  55. package/esm/browser/components/tool-result.js +138 -0
  56. package/esm/browser/components/tool-view.js +5 -15
  57. package/esm/browser/components/web-composer.js +2 -1
  58. package/esm/browser/extension/extension-view.d.ts +3 -1
  59. package/esm/browser/extension/extension-view.js +7 -0
  60. package/esm/browser/extension/icons.js +9 -1
  61. package/esm/browser/extension/web-api-components.d.ts +3 -3
  62. package/esm/browser/extension/web-api-contributions.d.ts +119 -0
  63. package/esm/browser/extension/web-extension-api.d.ts +23 -46
  64. package/esm/browser/extension/web-extension-context.d.ts +6 -1
  65. package/esm/browser/extension/web-extension-context.js +63 -6
  66. package/esm/browser/extension/web-extension-protocol.d.ts +5 -1
  67. package/esm/browser/extension/web-extension-protocol.js +1 -0
  68. package/esm/browser/extension/web-extension-run.d.ts +3 -2
  69. package/esm/browser/extension/web-extension-run.js +3 -0
  70. package/esm/browser/extension/web-extensions.d.ts +2 -8
  71. package/esm/browser/extension/web-extensions.js +9 -35
  72. package/esm/browser/extension/web-page-list.d.ts +25 -0
  73. package/esm/browser/extension/web-page-list.js +35 -0
  74. package/esm/browser/extension/web-session-notices.d.ts +6 -1
  75. package/esm/browser/extension/web-session-notices.js +30 -4
  76. package/esm/browser/extension/web-sharing.d.ts +5 -2
  77. package/esm/browser/extension/web-sharing.js +10 -1
  78. package/esm/browser/i18n/locales.d.ts +69 -3
  79. package/esm/browser/i18n/messages.d.ts +68 -2
  80. package/esm/browser/i18n/messages.js +138 -6
  81. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  82. package/esm/browser/markdown/code-renderers.js +4 -0
  83. package/esm/browser/markdown/lazy.d.ts +8 -0
  84. package/esm/browser/markdown/lazy.js +35 -0
  85. package/esm/browser/markdown/mermaid.d.ts +15 -3
  86. package/esm/browser/markdown/mermaid.js +45 -6
  87. package/esm/browser/notices/notices-protocol.d.ts +5 -0
  88. package/esm/browser/notices/notices.d.ts +19 -0
  89. package/esm/browser/notices/notices.js +85 -2
  90. package/esm/browser/notices/session-notices.d.ts +5 -2
  91. package/esm/browser/notices/session-notices.js +10 -1
  92. package/esm/browser/style/base.d.ts +1 -1
  93. package/esm/browser/style/base.js +2 -1
  94. package/esm/browser/style/conversation.d.ts +1 -1
  95. package/esm/browser/style/conversation.js +51 -0
  96. package/esm/browser/style/device.js +3 -0
  97. package/esm/browser/style/layout.d.ts +1 -1
  98. package/esm/browser/style/layout.js +24 -9
  99. package/esm/browser/style/pages.d.ts +1 -1
  100. package/esm/browser/style/pages.js +2 -0
  101. package/esm/browser/style/phone.d.ts +1 -1
  102. package/esm/browser/style/phone.js +2 -0
  103. package/esm/browser/style/shell.d.ts +1 -1
  104. package/esm/browser/style/shell.js +14 -3
  105. package/esm/browser/util/desktop.d.ts +18 -1
  106. package/esm/browser/util/desktop.js +13 -0
  107. package/esm/browser/util/process.d.ts +26 -1
  108. package/esm/browser/util/process.js +79 -5
  109. package/esm/browser/util/progress.d.ts +6 -1
  110. package/esm/browser/util/progress.js +11 -2
  111. package/esm/browser/util/scroll-rest.d.ts +10 -0
  112. package/esm/browser/util/scroll-rest.js +44 -0
  113. package/esm/browser/util/tool-result.d.ts +32 -0
  114. package/esm/browser/util/tool-result.js +85 -0
  115. package/esm/browser/util/tool.js +7 -0
  116. package/lib/browser/assistant/assistant-extension.js +14 -0
  117. package/lib/browser/assistant/assistant-initiative.d.ts +28 -0
  118. package/lib/browser/assistant/assistant-initiative.js +80 -0
  119. package/lib/browser/assistant/assistant-task-source.d.ts +7 -0
  120. package/lib/browser/assistant/assistant-task-source.js +12 -2
  121. package/lib/browser/assistant/assistant-view.js +3 -2
  122. package/lib/browser/assistant/assistant.d.ts +5 -0
  123. package/lib/browser/assistant/assistant.js +24 -5
  124. package/lib/browser/components/app-nav.d.ts +3 -1
  125. package/lib/browser/components/app-nav.js +5 -2
  126. package/lib/browser/components/app-view.js +17 -8
  127. package/lib/browser/components/asks-badge.d.ts +6 -0
  128. package/lib/browser/components/asks-badge.js +44 -0
  129. package/lib/browser/components/chat-asks.d.ts +47 -0
  130. package/lib/browser/components/chat-asks.js +104 -0
  131. package/lib/browser/components/chat-list.d.ts +7 -1
  132. package/lib/browser/components/chat-list.js +46 -17
  133. package/lib/browser/components/composer-addon-util.d.ts +12 -0
  134. package/lib/browser/components/composer-addon-util.js +76 -0
  135. package/lib/browser/components/composer-addons.d.ts +1 -7
  136. package/lib/browser/components/composer-addons.js +2 -29
  137. package/lib/browser/components/composer.d.ts +7 -1
  138. package/lib/browser/components/composer.js +33 -19
  139. package/lib/browser/components/connection-bar.js +30 -11
  140. package/lib/browser/components/conversation-scroll-util.d.ts +5 -0
  141. package/lib/browser/components/conversation-scroll-util.js +18 -0
  142. package/lib/browser/components/conversation-scroll.d.ts +12 -2
  143. package/lib/browser/components/conversation-scroll.js +68 -5
  144. package/lib/browser/components/discover-view.js +5 -1
  145. package/lib/browser/components/earlier-messages.d.ts +10 -3
  146. package/lib/browser/components/earlier-messages.js +16 -9
  147. package/lib/browser/components/folder-picker.d.ts +2 -0
  148. package/lib/browser/components/folder-picker.js +7 -0
  149. package/lib/browser/components/host-view.d.ts +1 -1
  150. package/lib/browser/components/markdown.js +3 -1
  151. package/lib/browser/components/media.js +3 -38
  152. package/lib/browser/components/mermaid-view.js +45 -3
  153. package/lib/browser/components/message-footer.d.ts +2 -0
  154. package/lib/browser/components/message-footer.js +8 -0
  155. package/lib/browser/components/message-list.d.ts +12 -0
  156. package/lib/browser/components/message-list.js +153 -20
  157. package/lib/browser/components/phone-shell.d.ts +7 -2
  158. package/lib/browser/components/phone-shell.js +7 -3
  159. package/lib/browser/components/relay-services.d.ts +25 -0
  160. package/lib/browser/components/relay-services.js +286 -0
  161. package/lib/browser/components/relay-view.js +17 -1
  162. package/lib/browser/components/remote-hosts.js +1 -1
  163. package/lib/browser/components/session-view.js +15 -3
  164. package/lib/browser/components/settings-controls.js +3 -3
  165. package/lib/browser/components/settings-parts.js +13 -1
  166. package/lib/browser/components/ta-avatar.js +6 -0
  167. package/lib/browser/components/tool-result.d.ts +14 -0
  168. package/lib/browser/components/tool-result.js +175 -0
  169. package/lib/browser/components/tool-view.js +10 -20
  170. package/lib/browser/components/web-composer.js +2 -1
  171. package/lib/browser/extension/extension-view.d.ts +3 -1
  172. package/lib/browser/extension/extension-view.js +8 -1
  173. package/lib/browser/extension/icons.js +8 -0
  174. package/lib/browser/extension/web-api-components.d.ts +3 -3
  175. package/lib/browser/extension/web-api-contributions.d.ts +119 -0
  176. package/lib/browser/extension/web-extension-api.d.ts +23 -46
  177. package/lib/browser/extension/web-extension-context.d.ts +6 -1
  178. package/lib/browser/extension/web-extension-context.js +63 -6
  179. package/lib/browser/extension/web-extension-protocol.d.ts +5 -1
  180. package/lib/browser/extension/web-extension-protocol.js +1 -0
  181. package/lib/browser/extension/web-extension-run.d.ts +3 -2
  182. package/lib/browser/extension/web-extension-run.js +3 -0
  183. package/lib/browser/extension/web-extensions.d.ts +2 -8
  184. package/lib/browser/extension/web-extensions.js +9 -35
  185. package/lib/browser/extension/web-page-list.d.ts +26 -0
  186. package/lib/browser/extension/web-page-list.js +39 -0
  187. package/lib/browser/extension/web-session-notices.d.ts +6 -1
  188. package/lib/browser/extension/web-session-notices.js +30 -4
  189. package/lib/browser/extension/web-sharing.d.ts +5 -2
  190. package/lib/browser/extension/web-sharing.js +10 -1
  191. package/lib/browser/i18n/locales.d.ts +69 -3
  192. package/lib/browser/i18n/messages.d.ts +68 -2
  193. package/lib/browser/i18n/messages.js +138 -6
  194. package/lib/browser/markdown/code-renderers.d.ts +4 -0
  195. package/lib/browser/markdown/code-renderers.js +5 -1
  196. package/lib/browser/markdown/lazy.d.ts +8 -0
  197. package/lib/browser/markdown/lazy.js +37 -1
  198. package/lib/browser/markdown/mermaid.d.ts +15 -3
  199. package/lib/browser/markdown/mermaid.js +44 -5
  200. package/lib/browser/notices/notices-protocol.d.ts +5 -0
  201. package/lib/browser/notices/notices.d.ts +19 -0
  202. package/lib/browser/notices/notices.js +84 -1
  203. package/lib/browser/notices/session-notices.d.ts +5 -2
  204. package/lib/browser/notices/session-notices.js +10 -1
  205. package/lib/browser/style/base.d.ts +1 -1
  206. package/lib/browser/style/base.js +2 -1
  207. package/lib/browser/style/conversation.d.ts +1 -1
  208. package/lib/browser/style/conversation.js +51 -0
  209. package/lib/browser/style/device.js +3 -0
  210. package/lib/browser/style/layout.d.ts +1 -1
  211. package/lib/browser/style/layout.js +24 -9
  212. package/lib/browser/style/pages.d.ts +1 -1
  213. package/lib/browser/style/pages.js +2 -0
  214. package/lib/browser/style/phone.d.ts +1 -1
  215. package/lib/browser/style/phone.js +2 -0
  216. package/lib/browser/style/shell.d.ts +1 -1
  217. package/lib/browser/style/shell.js +14 -3
  218. package/lib/browser/util/desktop.d.ts +18 -1
  219. package/lib/browser/util/desktop.js +13 -0
  220. package/lib/browser/util/process.d.ts +26 -1
  221. package/lib/browser/util/process.js +79 -5
  222. package/lib/browser/util/progress.d.ts +6 -1
  223. package/lib/browser/util/progress.js +11 -2
  224. package/lib/browser/util/scroll-rest.d.ts +11 -0
  225. package/lib/browser/util/scroll-rest.js +47 -0
  226. package/lib/browser/util/tool-result.d.ts +33 -0
  227. package/lib/browser/util/tool-result.js +88 -0
  228. package/lib/browser/util/tool.js +7 -0
  229. package/package.json +7 -7
@@ -67,6 +67,8 @@ export declare const EN_MESSAGES: {
67
67
  'ta.connection.retry': string;
68
68
  'ta.connection.away': string;
69
69
  'ta.connection.back': string;
70
+ 'ta.connection.outdated': string;
71
+ 'ta.connection.reload': string;
70
72
  'ta.connection.awayBrief': string;
71
73
  'ta.connection.unreachableBrief': string;
72
74
  'ta.connection.notDone': string;
@@ -78,6 +80,12 @@ export declare const EN_MESSAGES: {
78
80
  'ta.error.nothingToCompact': string;
79
81
  'ta.error.alreadyCompacted': string;
80
82
  'ta.error.sessionBusy': string;
83
+ 'ta.error.forbidden': string;
84
+ 'ta.error.forbiddenHint': string;
85
+ 'ta.error.forbiddenAsk': string;
86
+ 'ta.assistant.forbidden': string;
87
+ 'ta.error.limit': string;
88
+ 'ta.error.forbiddenNever': string;
81
89
  'ta.notices': string;
82
90
  'ta.notice.picture': string;
83
91
  'ta.packages.removeDetail': string;
@@ -158,6 +166,11 @@ export declare const EN_MESSAGES: {
158
166
  'ta.chat.unpin': string;
159
167
  'ta.chat.pinned': string;
160
168
  'ta.chat.unseen': string;
169
+ 'ta.chat.asking': string;
170
+ 'ta.chat.asks': string;
171
+ 'ta.chat.asksCount': string;
172
+ 'ta.chat.letGo': string;
173
+ 'ta.chat.toAsk': string;
161
174
  'ta.chat.removed': string;
162
175
  'ta.chat.olderCount': string;
163
176
  'ta.chat.archived': string;
@@ -185,7 +198,6 @@ export declare const EN_MESSAGES: {
185
198
  'ta.message.interrupted': string;
186
199
  'ta.message.silent': string;
187
200
  'ta.message.failedUnknown': string;
188
- 'ta.message.retriedFailed': string;
189
201
  'ta.message.resume': string;
190
202
  'ta.message.resumeText': string;
191
203
  'ta.message.thinking': string;
@@ -193,6 +205,11 @@ export declare const EN_MESSAGES: {
193
205
  'ta.message.showMore': string;
194
206
  'ta.message.showLess': string;
195
207
  'ta.message.compacted': string;
208
+ 'ta.message.compactedFrom': string;
209
+ 'ta.message.steered': string;
210
+ 'ta.message.steeredTitle': string;
211
+ 'ta.message.queued': string;
212
+ 'ta.message.queuedTitle': string;
196
213
  'ta.message.branch': string;
197
214
  'ta.message.forkBefore': string;
198
215
  'ta.message.forkAt': string;
@@ -211,10 +228,16 @@ export declare const EN_MESSAGES: {
211
228
  'ta.message.debugCopied': string;
212
229
  'ta.message.used': string;
213
230
  'ta.message.modelSwitched': string;
231
+ 'ta.message.resumed': string;
214
232
  'ta.message.usageTitle': string;
215
233
  'ta.tool.earlier': string;
216
234
  'ta.tool.hideScript': string;
217
235
  'ta.tool.showScript': string;
236
+ 'ta.tool.printed': string;
237
+ 'ta.tool.failedCalls': string;
238
+ 'ta.tool.exitCode': string;
239
+ 'ta.tool.noOutput': string;
240
+ 'ta.tool.moreEntries': string;
218
241
  'ta.tool.verb.bash': string;
219
242
  'ta.tool.verb.read': string;
220
243
  'ta.tool.verb.edit': string;
@@ -233,6 +256,13 @@ export declare const EN_MESSAGES: {
233
256
  'ta.tool.verb.webSearch': string;
234
257
  'ta.tool.verb.todo': string;
235
258
  'ta.tool.verb.skill': string;
259
+ 'ta.tool.verb.sendMessage': string;
260
+ 'ta.tool.verb.deleteTeam': string;
261
+ 'ta.tool.verb.scheduleTask': string;
262
+ 'ta.tool.verb.listScheduled': string;
263
+ 'ta.tool.verb.deleteScheduled': string;
264
+ 'ta.tool.verb.publish': string;
265
+ 'ta.tool.verb.editImage': string;
236
266
  'ta.assistant.me': string;
237
267
  'ta.assistant.hello': string;
238
268
  'ta.assistant.showTasks': string;
@@ -399,6 +429,40 @@ export declare const EN_MESSAGES: {
399
429
  'ta.remote.addHint': string;
400
430
  'ta.remote.connected': string;
401
431
  'ta.remote.failed': string;
432
+ 'ta.relays.title': string;
433
+ 'ta.relays.feature.devices': string;
434
+ 'ta.relays.feature.devicesHint': string;
435
+ 'ta.relays.feature.share': string;
436
+ 'ta.relays.feature.shareHint': string;
437
+ 'ta.relays.feature.rooms': string;
438
+ 'ta.relays.feature.roomsHint': string;
439
+ 'ta.relays.feature.sync': string;
440
+ 'ta.relays.feature.syncHint': string;
441
+ 'ta.relays.official': string;
442
+ 'ta.relays.online': string;
443
+ 'ta.relays.onlineNoTime': string;
444
+ 'ta.relays.offline': string;
445
+ 'ta.relays.memory': string;
446
+ 'ta.relays.limits': string;
447
+ 'ta.relays.remove': string;
448
+ 'ta.relays.add': string;
449
+ 'ta.relays.addHint': string;
450
+ 'ta.relays.addButton': string;
451
+ 'ta.relays.addPlaceholder': string;
452
+ 'ta.relays.folderOnly': string;
453
+ 'ta.relays.drive': string;
454
+ 'ta.relays.driveHint': string;
455
+ 'ta.relays.driveUse': string;
456
+ 'ta.relays.file': string;
457
+ 'ta.relays.broken': string;
458
+ 'ta.relays.storeType': string;
459
+ 'ta.relays.storeOpen': string;
460
+ 'ta.relays.storeName': string;
461
+ 'ta.relays.optional': string;
462
+ 'ta.relays.storeNote': string;
463
+ 'ta.relays.storeAdd': string;
464
+ 'ta.relays.storeOnly': string;
465
+ 'ta.relays.unavailable': string;
402
466
  'ta.remote.title': string;
403
467
  'ta.remote.description': string;
404
468
  'ta.remote.none': string;
@@ -492,7 +556,7 @@ export declare const EN_MESSAGES: {
492
556
  'ta.process.thinking': string;
493
557
  'ta.process.thought': string;
494
558
  'ta.process.failed': string;
495
- 'ta.process.retried': string;
559
+ 'ta.process.requestFailed': string;
496
560
  'ta.process.earlier': string;
497
561
  'ta.process.showAll': string;
498
562
  'ta.session.phase.thinking': string;
@@ -788,6 +852,8 @@ export declare const EN_MESSAGES: {
788
852
  'ta.relay.offline': string;
789
853
  'ta.relay.unpair': string;
790
854
  'ta.relay.unpairConfirm': string;
855
+ 'ta.relay.keepAwake': string;
856
+ 'ta.relay.keepAwakeHint': string;
791
857
  'ta.manage.relay': string;
792
858
  'ta.settings.relay': string;
793
859
  'ta.settings.relayDescription': string;
@@ -69,6 +69,8 @@ export const EN_MESSAGES = {
69
69
  'ta.connection.retry': 'Retry',
70
70
  'ta.connection.away': "Can't reach Ta on your computer. Make sure the computer is on and online, with Ta running; this reconnects by itself.",
71
71
  'ta.connection.back': 'Connected again',
72
+ 'ta.connection.outdated': 'Ta was updated. Reload to show everything',
73
+ 'ta.connection.reload': 'Reload',
72
74
  'ta.connection.awayBrief': "Can't reach Ta on your computer",
73
75
  'ta.connection.unreachableBrief': 'The Ta service is not running',
74
76
  'ta.connection.notDone': 'Not done: the connection dropped for a moment. Try again',
@@ -80,6 +82,12 @@ export const EN_MESSAGES = {
80
82
  'ta.error.nothingToCompact': 'The conversation is still short: nothing to compact yet',
81
83
  'ta.error.alreadyCompacted': 'Nothing new since the last compaction: nothing to compact yet',
82
84
  'ta.error.sessionBusy': 'Ta is still answering or compacting; try again once it is done',
85
+ 'ta.error.forbidden': 'You may not {action} here yet',
86
+ 'ta.error.forbiddenHint': 'The owner of this Ta or an admin can let you',
87
+ 'ta.error.forbiddenAsk': 'Ask',
88
+ 'ta.assistant.forbidden': 'In this Ta you use what was shared with you: find it under the double, or in Discover → Members',
89
+ 'ta.error.limit': 'Too many people are working in this Ta at once; try again in a moment',
90
+ 'ta.error.forbiddenNever': 'This is kept out of reach of everyone let in',
83
91
  'ta.notices': 'Notifications',
84
92
  'ta.notice.picture': 'Picture of the extension, such as a QR code to scan',
85
93
  'ta.packages.removeDetail': 'Its pages, cards and commands go with it.',
@@ -162,6 +170,11 @@ export const EN_MESSAGES = {
162
170
  'ta.chat.unpin': 'Unpin',
163
171
  'ta.chat.pinned': 'Pinned',
164
172
  'ta.chat.unseen': 'New, not seen yet',
173
+ 'ta.chat.asking': 'Your call',
174
+ 'ta.chat.asks': 'Waiting for you',
175
+ 'ta.chat.asksCount': '{count} waiting for you to decide',
176
+ 'ta.chat.letGo': 'Skip this decision',
177
+ 'ta.chat.toAsk': 'Waiting for you: {question}',
165
178
  'ta.chat.removed': 'Removed ({count})',
166
179
  'ta.chat.olderCount': 'Over {days} days ({count})',
167
180
  'ta.chat.archived': 'Archived',
@@ -189,7 +202,6 @@ export const EN_MESSAGES = {
189
202
  'ta.message.interrupted': 'Cut off before it was done: the service stopped, or the agent ended its turn with work not finished.',
190
203
  'ta.message.silent': 'Ended without a reply: the agent may have lost the connection to its model.',
191
204
  'ta.message.failedUnknown': 'The request failed, without saying why.',
192
- 'ta.message.retriedFailed': 'Retried automatically ({count}), still failing',
193
205
  'ta.message.resume': 'Continue',
194
206
  'ta.message.resumeText': 'Continue',
195
207
  'ta.message.thinking': 'Thinking',
@@ -197,6 +209,11 @@ export const EN_MESSAGES = {
197
209
  'ta.message.showMore': 'Show more',
198
210
  'ta.message.showLess': 'Show less',
199
211
  'ta.message.compacted': 'Earlier messages were compacted',
212
+ 'ta.message.compactedFrom': 'from {tokens} tokens',
213
+ 'ta.message.steered': 'Said on the way',
214
+ 'ta.message.steeredTitle': 'Written while it worked: it read this after its tools and went on with it',
215
+ 'ta.message.queued': 'Waited for the reply',
216
+ 'ta.message.queuedTitle': 'Written while it worked: sent once it had answered',
200
217
  'ta.message.branch': 'Summary of the other branch',
201
218
  'ta.message.forkBefore': 'New conversation from here, beside',
202
219
  'ta.message.forkAt': 'New conversation from this reply, beside',
@@ -215,10 +232,16 @@ export const EN_MESSAGES = {
215
232
  'ta.message.debugCopied': 'Debug info copied',
216
233
  'ta.message.used': 'Used',
217
234
  'ta.message.modelSwitched': 'Switched to {model}',
235
+ 'ta.message.resumed': 'Carried on after Ta restarted',
218
236
  'ta.message.usageTitle': '{input} tokens sent, {output} received',
219
237
  'ta.tool.earlier': '{count, plural, one {# earlier line} other {# earlier lines}}',
220
238
  'ta.tool.hideScript': 'Hide script',
221
239
  'ta.tool.showScript': 'Show the script',
240
+ 'ta.tool.printed': 'Printed',
241
+ 'ta.tool.failedCalls': '{count, plural, one {# call failed} other {# calls failed}}',
242
+ 'ta.tool.exitCode': 'Exit code {code}',
243
+ 'ta.tool.noOutput': 'Nothing returned',
244
+ 'ta.tool.moreEntries': '{count} more',
222
245
  'ta.tool.verb.bash': 'Run',
223
246
  'ta.tool.verb.read': 'Read',
224
247
  'ta.tool.verb.edit': 'Edit',
@@ -237,6 +260,13 @@ export const EN_MESSAGES = {
237
260
  'ta.tool.verb.webSearch': 'Search the web',
238
261
  'ta.tool.verb.todo': 'Update todos',
239
262
  'ta.tool.verb.skill': 'Use skill',
263
+ 'ta.tool.verb.sendMessage': 'Send message',
264
+ 'ta.tool.verb.deleteTeam': 'Disband team',
265
+ 'ta.tool.verb.scheduleTask': 'Schedule',
266
+ 'ta.tool.verb.listScheduled': 'List scheduled tasks',
267
+ 'ta.tool.verb.deleteScheduled': 'Cancel scheduled task',
268
+ 'ta.tool.verb.publish': 'Publish',
269
+ 'ta.tool.verb.editImage': 'Edit image',
240
270
  'ta.assistant.me': 'My double',
241
271
  'ta.assistant.hello': 'Hi, I am Ta',
242
272
  'ta.assistant.showTasks': 'Show the tasks',
@@ -340,7 +370,7 @@ export const EN_MESSAGES = {
340
370
  'ta.settings.taskModel': 'Model of its tasks',
341
371
  'ta.settings.taskModelHint': 'What does the work the double hands out; an external agent fits here',
342
372
  'ta.settings.confirmTasks': 'Ask before starting tasks',
343
- 'ta.settings.confirmTasksHint': 'The double says what it would hand out, tasks or a team of agents, and waits for your go',
373
+ 'ta.settings.confirmTasksHint': 'The double says what it would hand out, tasks or a team of agents, and waits for your go. With Initiative on, it starts by itself once you said yes 3 times in a row (Settings → Initiative)',
344
374
  'ta.settings.maxTasks': 'Tasks at once',
345
375
  'ta.settings.maxTasksHint': 'Beyond it, the double waits for one to end',
346
376
  'ta.settings.maxTasksAny': 'Any',
@@ -403,6 +433,40 @@ export const EN_MESSAGES = {
403
433
  'ta.remote.addHint': 'A Host of ~/.ssh/config, user@host:port, or an ssh command',
404
434
  'ta.remote.connected': 'Connected',
405
435
  'ta.remote.failed': 'Cannot connect to {host}',
436
+ 'ta.relays.title': 'Relays',
437
+ 'ta.relays.feature.devices': 'Phones and other devices',
438
+ 'ta.relays.feature.devicesHint': 'What new devices reach this computer through. Paired ones stay on theirs.',
439
+ 'ta.relays.feature.share': 'Links you share',
440
+ 'ta.relays.feature.shareHint': 'Extensions and conversations shared by a link, their copies for while this computer is off, and the pages they open in.',
441
+ 'ta.relays.feature.rooms': 'Rooms and playing together',
442
+ 'ta.relays.feature.roomsHint': 'Where new rooms are made. A room stays on its relay; one you join is on the relay of its link.',
443
+ 'ta.relays.feature.sync': 'Sync',
444
+ 'ta.relays.feature.syncHint': 'Where your computers sync when it is turned on: a room of a relay; or with no relay at all, a folder of a cloud drive or storage of your own (WebDAV, S3, a git repository).',
445
+ 'ta.relays.official': 'Official relay',
446
+ 'ta.relays.online': 'answers in {ms} ms',
447
+ 'ta.relays.onlineNoTime': 'answers',
448
+ 'ta.relays.offline': 'does not answer',
449
+ 'ta.relays.memory': 'keeps rooms in memory only',
450
+ 'ta.relays.limits': 'rooms of {members}, {state} MB',
451
+ 'ta.relays.remove': 'Remove {name}',
452
+ 'ta.relays.add': 'Add a relay',
453
+ 'ta.relays.addHint': 'A relay of your own (on your Cloudflare, or ta relay --data <dir> behind HTTPS), which reads none of what goes through it but serves the pages of links; or a folder a cloud drive keeps the same on your computers, for sync.',
454
+ 'ta.relays.addButton': 'Add',
455
+ 'ta.relays.addPlaceholder': 'https://relay.example.com, or a folder ~/…',
456
+ 'ta.relays.folderOnly': 'a folder, for sync only',
457
+ 'ta.relays.drive': 'Sync in {name}',
458
+ 'ta.relays.driveHint': 'Sync through the folder {path}, which the drive keeps the same on your computers: no relay at all.',
459
+ 'ta.relays.driveUse': 'Use',
460
+ 'ta.relays.file': 'relays.json',
461
+ 'ta.relays.broken': 'relays.json does not parse',
462
+ 'ta.relays.storeType': 'Sync in {name}',
463
+ 'ta.relays.storeOpen': 'Set up',
464
+ 'ta.relays.storeName': 'Name',
465
+ 'ta.relays.optional': 'optional',
466
+ 'ta.relays.storeNote': 'Ta tries it first, writing and removing a small file. What sync puts there is sealed on this computer; the password stays in relays.json here.',
467
+ 'ta.relays.storeAdd': 'Add and sync there',
468
+ 'ta.relays.storeOnly': 'for sync only',
469
+ 'ta.relays.unavailable': 'its extension is off',
406
470
  'ta.remote.title': 'Remote hosts',
407
471
  'ta.remote.description': 'Conversations can work in directories of these machines. Ta connects with the ssh of this computer and its ~/.ssh/config.',
408
472
  'ta.remote.none': 'No hosts yet',
@@ -497,7 +561,7 @@ export const EN_MESSAGES = {
497
561
  'ta.process.thinking': 'Thinking',
498
562
  'ta.process.thought': 'Thought',
499
563
  'ta.process.failed': '{count} failed',
500
- 'ta.process.retried': 'Request failed, retried',
564
+ 'ta.process.requestFailed': 'Request failed',
501
565
  'ta.process.earlier': '{count, plural, one {# earlier step} other {# earlier steps}}',
502
566
  'ta.process.showAll': 'Show all',
503
567
  'ta.session.phase.thinking': 'Thinking',
@@ -795,6 +859,8 @@ export const EN_MESSAGES = {
795
859
  'ta.relay.offline': 'Not connected · {relay}',
796
860
  'ta.relay.unpair': 'Unpair',
797
861
  'ta.relay.unpairConfirm': 'Unpair {name}? It can no longer reach this Ta.',
862
+ 'ta.relay.keepAwake': 'Keep this computer awake',
863
+ 'ta.relay.keepAwakeHint': 'While a task runs, or for 30 minutes after a device was connected, the computer does not sleep when idle, so your phone can reach it. The display still turns off; closing the lid still puts it to sleep.',
798
864
  'ta.manage.relay': 'Use on your phone…',
799
865
  'ta.settings.relay': 'Phone',
800
866
  'ta.settings.relayDescription': 'Devices that reach this Ta through a relay',
@@ -902,6 +968,8 @@ export const ZH_MESSAGES = {
902
968
  'ta.connection.retry': '重试',
903
969
  'ta.connection.away': '连不上电脑上的 Ta。请确认电脑开着、联网,并且 Ta 在运行;连上后会自动恢复。',
904
970
  'ta.connection.back': '已重新连接',
971
+ 'ta.connection.outdated': 'Ta 已更新,刷新后才能完整显示',
972
+ 'ta.connection.reload': '刷新',
905
973
  'ta.connection.awayBrief': '连不上电脑上的 Ta',
906
974
  'ta.connection.unreachableBrief': 'Ta 服务没有在运行',
907
975
  'ta.connection.notDone': '没有完成:连接断了一下,再试一次',
@@ -913,6 +981,12 @@ export const ZH_MESSAGES = {
913
981
  'ta.error.nothingToCompact': '对话内容还很少,暂时不需要压缩',
914
982
  'ta.error.alreadyCompacted': '上次压缩后还没有新内容,暂时不需要压缩',
915
983
  'ta.error.sessionBusy': 'Ta 正在回复或压缩,请等它结束后再试',
984
+ 'ta.error.forbidden': '你在这里还不能「{action}」',
985
+ 'ta.error.forbiddenHint': '这台 Ta 的所有者或管理员可以给你这个权限',
986
+ 'ta.error.forbiddenAsk': '申请',
987
+ 'ta.assistant.forbidden': '在这台 Ta 里你只能使用分享给你的内容:在分身下方的列表或「发现 → 成员与权限」里找到它',
988
+ 'ta.error.limit': '这台 Ta 同时在跑的协作任务已满,请稍后再试',
989
+ 'ta.error.forbiddenNever': '这里对所有协作者都不开放',
916
990
  'ta.notices': '通知',
917
991
  'ta.notice.picture': '扩展给出的图像,如要扫描的二维码',
918
992
  'ta.packages.removeDetail': '它的页面、卡片和命令也会一起移除。',
@@ -993,6 +1067,11 @@ export const ZH_MESSAGES = {
993
1067
  'ta.chat.unpin': '取消置顶',
994
1068
  'ta.chat.pinned': '置顶',
995
1069
  'ta.chat.unseen': '有新回复未查看',
1070
+ 'ta.chat.asking': '等你决定',
1071
+ 'ta.chat.asks': '待你决定',
1072
+ 'ta.chat.asksCount': '{count} 个待你决定',
1073
+ 'ta.chat.letGo': '不用决定了',
1074
+ 'ta.chat.toAsk': '等你决定:{question}',
996
1075
  'ta.chat.removed': '已移除({count})',
997
1076
  'ta.chat.olderCount': '{days} 天前({count})',
998
1077
  'ta.chat.archived': '已归档',
@@ -1020,7 +1099,6 @@ export const ZH_MESSAGES = {
1020
1099
  'ta.message.interrupted': '这一轮中途断了:Ta 服务停止,或智能体没做完就结束了这一轮。',
1021
1100
  'ta.message.silent': '这一轮没有回复就结束了:智能体可能和模型断了连接。',
1022
1101
  'ta.message.failedUnknown': '请求失败,没有给出原因。',
1023
- 'ta.message.retriedFailed': '已自动重试 {count} 次,仍然失败',
1024
1102
  'ta.message.resume': '继续',
1025
1103
  'ta.message.resumeText': '继续',
1026
1104
  'ta.message.thinking': '思考',
@@ -1028,6 +1106,11 @@ export const ZH_MESSAGES = {
1028
1106
  'ta.message.showMore': '展开',
1029
1107
  'ta.message.showLess': '收起',
1030
1108
  'ta.message.compacted': '较早的消息已压缩',
1109
+ 'ta.message.compactedFrom': '压缩前 {tokens} tokens',
1110
+ 'ta.message.steered': '插话',
1111
+ 'ta.message.steeredTitle': '在它工作时发的:它跑完手头的工具后读到,接着按这句继续',
1112
+ 'ta.message.queued': '排队',
1113
+ 'ta.message.queuedTitle': '在它工作时发的:等它回复完才发出',
1031
1114
  'ta.message.branch': '另一分支的摘要',
1032
1115
  'ta.message.forkBefore': '从这里在侧边新开对话',
1033
1116
  'ta.message.forkAt': '从这条回复在侧边新开对话',
@@ -1046,10 +1129,16 @@ export const ZH_MESSAGES = {
1046
1129
  'ta.message.debugCopied': '已复制调试信息',
1047
1130
  'ta.message.used': '共消耗',
1048
1131
  'ta.message.modelSwitched': '已切换到 {model}',
1132
+ 'ta.message.resumed': 'Ta 重启后接着做',
1049
1133
  'ta.message.usageTitle': '发送 {input} token,接收 {output} token',
1050
1134
  'ta.tool.earlier': '前面还有 {count} 行',
1051
1135
  'ta.tool.hideScript': '收起脚本',
1052
1136
  'ta.tool.showScript': '查看脚本',
1137
+ 'ta.tool.printed': '打印',
1138
+ 'ta.tool.failedCalls': '{count} 次调用失败',
1139
+ 'ta.tool.exitCode': '退出码 {code}',
1140
+ 'ta.tool.noOutput': '没有返回内容',
1141
+ 'ta.tool.moreEntries': '还有 {count} 项',
1053
1142
  'ta.tool.verb.bash': '运行',
1054
1143
  'ta.tool.verb.read': '读取',
1055
1144
  'ta.tool.verb.edit': '编辑',
@@ -1068,6 +1157,13 @@ export const ZH_MESSAGES = {
1068
1157
  'ta.tool.verb.webSearch': '搜索网页',
1069
1158
  'ta.tool.verb.todo': '更新待办',
1070
1159
  'ta.tool.verb.skill': '使用技能',
1160
+ 'ta.tool.verb.sendMessage': '发送消息',
1161
+ 'ta.tool.verb.deleteTeam': '解散团队',
1162
+ 'ta.tool.verb.scheduleTask': '创建定时任务',
1163
+ 'ta.tool.verb.listScheduled': '查看定时任务',
1164
+ 'ta.tool.verb.deleteScheduled': '取消定时任务',
1165
+ 'ta.tool.verb.publish': '发布',
1166
+ 'ta.tool.verb.editImage': '编辑图片',
1071
1167
  'ta.assistant.me': '我的分身',
1072
1168
  'ta.assistant.hello': '你好,我是 Ta',
1073
1169
  'ta.assistant.showTasks': '查看任务',
@@ -1171,7 +1267,7 @@ export const ZH_MESSAGES = {
1171
1267
  'ta.settings.taskModel': '任务的模型',
1172
1268
  'ta.settings.taskModelHint': '分身交出的任务由它来做,外部 Agent 适合放在这里',
1173
1269
  'ta.settings.confirmTasks': '开始任务前先问我',
1174
- 'ta.settings.confirmTasksHint': '分身先说明要交出的任务或要组建的团队,等你同意再开始',
1270
+ 'ta.settings.confirmTasksHint': '分身先说明要交出的任务或要组建的团队,等你同意再开始。开着“主动”时,你连续同意 3 次后它会直接开始(设置 → 主动)',
1175
1271
  'ta.settings.maxTasks': '同时进行的任务',
1176
1272
  'ta.settings.maxTasksHint': '超过时,分身会等前面的结束',
1177
1273
  'ta.settings.maxTasksAny': '不限',
@@ -1234,6 +1330,40 @@ export const ZH_MESSAGES = {
1234
1330
  'ta.remote.addHint': '~/.ssh/config 里的主机、user@host:port,或 ssh 命令',
1235
1331
  'ta.remote.connected': '已连接',
1236
1332
  'ta.remote.failed': '连不上 {host}',
1333
+ 'ta.relays.title': '中继服务',
1334
+ 'ta.relays.feature.devices': '手机等设备',
1335
+ 'ta.relays.feature.devicesHint': '新配对的设备经它连回这台电脑;已配对的保持原来的中继。',
1336
+ 'ta.relays.feature.share': '分享链接',
1337
+ 'ta.relays.feature.shareHint': '分享扩展、对话的链接,电脑关机时可看的副本,以及链接在浏览器里打开的页面。',
1338
+ 'ta.relays.feature.rooms': '房间与联机',
1339
+ 'ta.relays.feature.roomsHint': '新建房间放在这里。房间建好后不随之变化;加入别人的房间用对方链接里的中继。',
1340
+ 'ta.relays.feature.sync': '设备同步',
1341
+ 'ta.relays.feature.syncHint': '开启同步时你的几台电脑经它同步:中继上的房间;或完全不经过中继,用网盘里的文件夹、你自己的 WebDAV、S3 存储或 git 仓库。',
1342
+ 'ta.relays.official': '官方中继',
1343
+ 'ta.relays.online': '{ms} 毫秒响应',
1344
+ 'ta.relays.onlineNoTime': '可用',
1345
+ 'ta.relays.offline': '连不上',
1346
+ 'ta.relays.memory': '房间只存在内存里',
1347
+ 'ta.relays.limits': '房间最多 {members} 人、{state} MB',
1348
+ 'ta.relays.remove': '移除 {name}',
1349
+ 'ta.relays.add': '添加中继',
1350
+ 'ta.relays.addHint': '你自己的中继(部署在自己的 Cloudflare 上,或在 HTTPS 后面运行 ta relay --data <目录>),它读不到经过的内容,但链接打开的网页由它提供;或者一个由网盘在几台电脑间保持一致的文件夹,用于设备同步。',
1351
+ 'ta.relays.addButton': '添加',
1352
+ 'ta.relays.addPlaceholder': 'https://relay.example.com,或文件夹 ~/…',
1353
+ 'ta.relays.folderOnly': '文件夹,仅用于设备同步',
1354
+ 'ta.relays.drive': '用 {name} 同步',
1355
+ 'ta.relays.driveHint': '设备同步经文件夹 {path},由网盘在你的几台电脑间保持一致,完全不经过中继。',
1356
+ 'ta.relays.driveUse': '使用',
1357
+ 'ta.relays.file': 'relays.json',
1358
+ 'ta.relays.broken': 'relays.json 格式不对',
1359
+ 'ta.relays.storeType': '用 {name} 同步',
1360
+ 'ta.relays.storeOpen': '设置',
1361
+ 'ta.relays.storeName': '名称',
1362
+ 'ta.relays.optional': '可不填',
1363
+ 'ta.relays.storeNote': 'Ta 会先试一下:写入再删掉一个小文件。同步放进去的内容在本机就已加密;密码只存在这台电脑的 relays.json 里。',
1364
+ 'ta.relays.storeAdd': '添加并用于同步',
1365
+ 'ta.relays.storeOnly': '仅用于设备同步',
1366
+ 'ta.relays.unavailable': '对应的扩展已关闭',
1237
1367
  'ta.remote.title': '远程主机',
1238
1368
  'ta.remote.description': '对话可以在这些机器的目录里工作。Ta 用本机的 ssh 和 ~/.ssh/config 连接。',
1239
1369
  'ta.remote.none': '还没有主机',
@@ -1328,7 +1458,7 @@ export const ZH_MESSAGES = {
1328
1458
  'ta.process.thinking': '思考中',
1329
1459
  'ta.process.thought': '已思考',
1330
1460
  'ta.process.failed': '{count} 步失败',
1331
- 'ta.process.retried': '请求失败,已重试',
1461
+ 'ta.process.requestFailed': '请求失败',
1332
1462
  'ta.process.earlier': '前 {count} 步',
1333
1463
  'ta.process.showAll': '显示全部',
1334
1464
  'ta.session.phase.thinking': '思考中',
@@ -1625,6 +1755,8 @@ export const ZH_MESSAGES = {
1625
1755
  'ta.relay.offline': '未连接 · {relay}',
1626
1756
  'ta.relay.unpair': '取消配对',
1627
1757
  'ta.relay.unpairConfirm': '取消配对 {name}?它将无法再连到这台电脑上的 Ta。',
1758
+ 'ta.relay.keepAwake': '让电脑保持唤醒',
1759
+ 'ta.relay.keepAwakeHint': '有任务在跑,或手机连过后的 30 分钟内,电脑闲置也不睡眠,手机随时连得上。屏幕照常熄灭,合上盖子仍会睡眠。',
1628
1760
  'ta.manage.relay': '在手机上使用…',
1629
1761
  'ta.settings.relay': '手机访问',
1630
1762
  'ta.settings.relayDescription': '经 Relay 连到这台电脑上 Ta 的设备',
@@ -2,3 +2,7 @@ import * as React from 'react';
2
2
  import type { WebCodeRendererProps } from '../extension/web-api-contributions.js';
3
3
  /** What web extensions draw fenced blocks of their languages with (WebExtensionAPI.registerCodeRenderer), by language in lower case. */
4
4
  export declare const CodeRenderers: React.Context<Readonly<Record<string, React.ComponentType<WebCodeRendererProps>>>>;
5
+ /** Where the fenced blocks drawn by web extensions send what the user picks in them: the conversation they are in. */
6
+ export declare const CodeReply: React.Context<((text: string) => Promise<void>) | undefined>;
7
+ /** What the user said after the turn of the blocks (WebCodeRendererProps.answer): none while they did not answer it. */
8
+ export declare const CodeAnswer: React.Context<string | undefined>;
@@ -1,4 +1,8 @@
1
1
  import * as React from 'react';
2
2
  /** What web extensions draw fenced blocks of their languages with (WebExtensionAPI.registerCodeRenderer), by language in lower case. */
3
3
  export const CodeRenderers = React.createContext({});
4
+ /** Where the fenced blocks drawn by web extensions send what the user picks in them: the conversation they are in. */
5
+ export const CodeReply = React.createContext(undefined);
6
+ /** What the user said after the turn of the blocks (WebCodeRendererProps.answer): none while they did not answer it. */
7
+ export const CodeAnswer = React.createContext(undefined);
4
8
  //# sourceMappingURL=code-renderers.js.map
@@ -19,3 +19,11 @@ export declare class Recent<V> {
19
19
  has(key: string): boolean;
20
20
  set(key: string, value: V): V;
21
21
  }
22
+ /** A Recent kept on the device (localStorage, under `key`): what it was told is there again after the page loads again. */
23
+ export declare class KeptRecent<V> extends Recent<V> {
24
+ private readonly key;
25
+ private saving;
26
+ constructor(key: string, limit: number);
27
+ set(key: string, value: V): V;
28
+ private static storage;
29
+ }
@@ -36,4 +36,39 @@ export class Recent {
36
36
  return value;
37
37
  }
38
38
  }
39
+ /** A Recent kept on the device (localStorage, under `key`): what it was told is there again after the page loads again. */
40
+ export class KeptRecent extends Recent {
41
+ constructor(key, limit) {
42
+ var _a;
43
+ var _b;
44
+ super(limit);
45
+ this.key = key;
46
+ try {
47
+ for (const [entry, value] of JSON.parse((_b = (_a = KeptRecent.storage()) === null || _a === void 0 ? void 0 : _a.getItem(key)) !== null && _b !== void 0 ? _b : '[]')) {
48
+ super.set(entry, value);
49
+ }
50
+ }
51
+ catch (_c) {
52
+ // Kept by another version, or not at all: starts empty.
53
+ }
54
+ }
55
+ set(key, value) {
56
+ var _a;
57
+ super.set(key, value);
58
+ (_a = this.saving) !== null && _a !== void 0 ? _a : (this.saving = setTimeout(() => {
59
+ var _a;
60
+ this.saving = undefined;
61
+ try {
62
+ (_a = KeptRecent.storage()) === null || _a === void 0 ? void 0 : _a.setItem(this.key, JSON.stringify([...this.entries]));
63
+ }
64
+ catch (_b) {
65
+ // Full: kept for this page only.
66
+ }
67
+ }, 1000));
68
+ return value;
69
+ }
70
+ static storage() {
71
+ return typeof localStorage === 'undefined' ? undefined : localStorage;
72
+ }
73
+ }
39
74
  //# sourceMappingURL=lazy.js.map
@@ -1,6 +1,15 @@
1
1
  import type { Theme } from '../settings/settings-protocol.js';
2
- /** What does not need the library: which code blocks are diagrams, and what a downloaded diagram is. */
2
+ /** How large a diagram draws: as wide as its width at most, as high as its width makes it. */
3
+ export interface DiagramSize {
4
+ width: number;
5
+ height: number;
6
+ }
7
+ /** What does not need the library: which code blocks are diagrams, how large one draws, and what a downloaded diagram is. */
3
8
  export declare namespace MermaidUtil {
9
+ /** The size of a drawing: the width it draws at most (its max-width), and its height at that width (its viewBox). */
10
+ function size(svg: string): DiagramSize | undefined;
11
+ /** What a source is known by on the device: short, for a key of localStorage. */
12
+ function hash(code: string): string;
4
13
  function isDiagram(language: string | undefined, code: string): boolean;
5
14
  function key(theme: Theme, code: string): string;
6
15
  /** `diagram-<yyyyMMdd-HHmmss>.svg`. */
@@ -11,10 +20,13 @@ export declare namespace MermaidUtil {
11
20
  /**
12
21
  * Mermaid diagrams, drawn by the library loaded at the first one. A source that does not parse, as
13
22
  * while a reply streams it, draws nothing; what was drawn is kept per theme and source, so that a
14
- * diagram is not drawn again on each change of the conversation. Drawings run one at a time: the
15
- * library has one configuration.
23
+ * diagram is not drawn again on each change of the conversation, and its size on the device, so that
24
+ * one shown before has its place before it draws again. Drawings run one at a time, while the page
25
+ * does not scroll (ScrollRest): the library has one configuration.
16
26
  */
17
27
  export declare namespace MermaidRenderer {
28
+ /** The size the diagram of `code` drew at, the last time it did on this device. */
29
+ function size(code: string): DiagramSize | undefined;
18
30
  function cached(theme: Theme, code: string): string | undefined;
19
31
  function render(theme: Theme, code: string): Promise<string | undefined>;
20
32
  }
@@ -1,7 +1,31 @@
1
- import { Lazy, Recent } from './lazy.js';
2
- /** What does not need the library: which code blocks are diagrams, and what a downloaded diagram is. */
1
+ import { ScrollRest } from '../util/scroll-rest.js';
2
+ import { KeptRecent, Lazy, Recent } from './lazy.js';
3
+ /** What does not need the library: which code blocks are diagrams, how large one draws, and what a downloaded diagram is. */
3
4
  export var MermaidUtil;
4
5
  (function (MermaidUtil) {
6
+ /** The size of a drawing: the width it draws at most (its max-width), and its height at that width (its viewBox). */
7
+ function size(svg) {
8
+ var _a, _b;
9
+ var _c;
10
+ const open = (_a = /<svg\b[^>]*>/.exec(svg)) === null || _a === void 0 ? void 0 : _a[0];
11
+ const box = open && /viewBox="[\d.-]+[\s,]+[\d.-]+[\s,]+([\d.]+)[\s,]+([\d.]+)"/.exec(open);
12
+ if (!open || !box) {
13
+ return undefined;
14
+ }
15
+ const [width, height] = [Number(box[1]), Number(box[2])];
16
+ const max = Number((_c = (_b = /max-width:\s*([\d.]+)px/.exec(open)) === null || _b === void 0 ? void 0 : _b[1]) !== null && _c !== void 0 ? _c : width);
17
+ return width > 0 && height > 0 && max > 0 ? { width: Math.round(max), height: Math.round((height * max) / width) } : undefined;
18
+ }
19
+ MermaidUtil.size = size;
20
+ /** What a source is known by on the device: short, for a key of localStorage. */
21
+ function hash(code) {
22
+ let hash = 0x811c9dc5;
23
+ for (let index = 0; index < code.length; index++) {
24
+ hash = Math.imul(hash ^ code.charCodeAt(index), 0x01000193);
25
+ }
26
+ return `${(hash >>> 0).toString(36)}.${code.length.toString(36)}`;
27
+ }
28
+ MermaidUtil.hash = hash;
5
29
  function isDiagram(language, code) {
6
30
  return (language === null || language === void 0 ? void 0 : language.trim().toLowerCase()) === 'mermaid' && code.trim().length > 0;
7
31
  }
@@ -29,13 +53,20 @@ export var MermaidUtil;
29
53
  /**
30
54
  * Mermaid diagrams, drawn by the library loaded at the first one. A source that does not parse, as
31
55
  * while a reply streams it, draws nothing; what was drawn is kept per theme and source, so that a
32
- * diagram is not drawn again on each change of the conversation. Drawings run one at a time: the
33
- * library has one configuration.
56
+ * diagram is not drawn again on each change of the conversation, and its size on the device, so that
57
+ * one shown before has its place before it draws again. Drawings run one at a time, while the page
58
+ * does not scroll (ScrollRest): the library has one configuration.
34
59
  */
35
60
  export var MermaidRenderer;
36
61
  (function (MermaidRenderer) {
37
62
  const mermaid = new Lazy(async () => (await import('mermaid')).default);
38
- const drawn = new Recent(32);
63
+ const drawn = new Recent(96);
64
+ const sizes = new KeptRecent('ta.diagram.sizes', 300);
65
+ /** The size the diagram of `code` drew at, the last time it did on this device. */
66
+ function size(code) {
67
+ return sizes.get(MermaidUtil.hash(code));
68
+ }
69
+ MermaidRenderer.size = size;
39
70
  let queue = Promise.resolve();
40
71
  let configured;
41
72
  let count = 0;
@@ -56,6 +87,7 @@ export var MermaidRenderer;
56
87
  async function draw(theme, code) {
57
88
  var _a;
58
89
  const api = await mermaid.load();
90
+ await ScrollRest.wait();
59
91
  if (configured !== theme) {
60
92
  api.initialize({
61
93
  startOnLoad: false,
@@ -71,7 +103,14 @@ export var MermaidRenderer;
71
103
  const id = `ta-mermaid-${++count}`;
72
104
  try {
73
105
  const { svg } = await api.render(id, code);
74
- return svg ? drawn.set(MermaidUtil.key(theme, code), svg) : undefined;
106
+ if (!svg) {
107
+ return undefined;
108
+ }
109
+ const size = MermaidUtil.size(svg);
110
+ if (size) {
111
+ sizes.set(MermaidUtil.hash(code), size);
112
+ }
113
+ return drawn.set(MermaidUtil.key(theme, code), svg);
75
114
  }
76
115
  finally {
77
116
  // What the library leaves in the page when a drawing fails.
@@ -83,6 +83,11 @@ export interface NoticesState {
83
83
  * that, the row of the connection says it for a moment (ConnectionBar, ConnectionBanner).
84
84
  */
85
85
  notDoneAt?: number;
86
+ /**
87
+ * The page is of an older Ta than ta serve now serves: a part loaded on demand (a diagram, a formula,
88
+ * the editor) was replaced with the new build, and did not load. The row of the connection offers to reload.
89
+ */
90
+ outdated?: boolean;
86
91
  }
87
92
  /**
88
93
  * The notices of the page, from ta and its web extensions alike: short-lived messages in a corner, and