@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
@@ -73,6 +73,8 @@ exports.EN_MESSAGES = {
73
73
  'ta.connection.retry': 'Retry',
74
74
  '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.",
75
75
  'ta.connection.back': 'Connected again',
76
+ 'ta.connection.outdated': 'Ta was updated. Reload to show everything',
77
+ 'ta.connection.reload': 'Reload',
76
78
  'ta.connection.awayBrief': "Can't reach Ta on your computer",
77
79
  'ta.connection.unreachableBrief': 'The Ta service is not running',
78
80
  'ta.connection.notDone': 'Not done: the connection dropped for a moment. Try again',
@@ -84,6 +86,12 @@ exports.EN_MESSAGES = {
84
86
  'ta.error.nothingToCompact': 'The conversation is still short: nothing to compact yet',
85
87
  'ta.error.alreadyCompacted': 'Nothing new since the last compaction: nothing to compact yet',
86
88
  'ta.error.sessionBusy': 'Ta is still answering or compacting; try again once it is done',
89
+ 'ta.error.forbidden': 'You may not {action} here yet',
90
+ 'ta.error.forbiddenHint': 'The owner of this Ta or an admin can let you',
91
+ 'ta.error.forbiddenAsk': 'Ask',
92
+ 'ta.assistant.forbidden': 'In this Ta you use what was shared with you: find it under the double, or in Discover → Members',
93
+ 'ta.error.limit': 'Too many people are working in this Ta at once; try again in a moment',
94
+ 'ta.error.forbiddenNever': 'This is kept out of reach of everyone let in',
87
95
  'ta.notices': 'Notifications',
88
96
  'ta.notice.picture': 'Picture of the extension, such as a QR code to scan',
89
97
  'ta.packages.removeDetail': 'Its pages, cards and commands go with it.',
@@ -166,6 +174,11 @@ exports.EN_MESSAGES = {
166
174
  'ta.chat.unpin': 'Unpin',
167
175
  'ta.chat.pinned': 'Pinned',
168
176
  'ta.chat.unseen': 'New, not seen yet',
177
+ 'ta.chat.asking': 'Your call',
178
+ 'ta.chat.asks': 'Waiting for you',
179
+ 'ta.chat.asksCount': '{count} waiting for you to decide',
180
+ 'ta.chat.letGo': 'Skip this decision',
181
+ 'ta.chat.toAsk': 'Waiting for you: {question}',
169
182
  'ta.chat.removed': 'Removed ({count})',
170
183
  'ta.chat.olderCount': 'Over {days} days ({count})',
171
184
  'ta.chat.archived': 'Archived',
@@ -193,7 +206,6 @@ exports.EN_MESSAGES = {
193
206
  'ta.message.interrupted': 'Cut off before it was done: the service stopped, or the agent ended its turn with work not finished.',
194
207
  'ta.message.silent': 'Ended without a reply: the agent may have lost the connection to its model.',
195
208
  'ta.message.failedUnknown': 'The request failed, without saying why.',
196
- 'ta.message.retriedFailed': 'Retried automatically ({count}), still failing',
197
209
  'ta.message.resume': 'Continue',
198
210
  'ta.message.resumeText': 'Continue',
199
211
  'ta.message.thinking': 'Thinking',
@@ -201,6 +213,11 @@ exports.EN_MESSAGES = {
201
213
  'ta.message.showMore': 'Show more',
202
214
  'ta.message.showLess': 'Show less',
203
215
  'ta.message.compacted': 'Earlier messages were compacted',
216
+ 'ta.message.compactedFrom': 'from {tokens} tokens',
217
+ 'ta.message.steered': 'Said on the way',
218
+ 'ta.message.steeredTitle': 'Written while it worked: it read this after its tools and went on with it',
219
+ 'ta.message.queued': 'Waited for the reply',
220
+ 'ta.message.queuedTitle': 'Written while it worked: sent once it had answered',
204
221
  'ta.message.branch': 'Summary of the other branch',
205
222
  'ta.message.forkBefore': 'New conversation from here, beside',
206
223
  'ta.message.forkAt': 'New conversation from this reply, beside',
@@ -219,10 +236,16 @@ exports.EN_MESSAGES = {
219
236
  'ta.message.debugCopied': 'Debug info copied',
220
237
  'ta.message.used': 'Used',
221
238
  'ta.message.modelSwitched': 'Switched to {model}',
239
+ 'ta.message.resumed': 'Carried on after Ta restarted',
222
240
  'ta.message.usageTitle': '{input} tokens sent, {output} received',
223
241
  'ta.tool.earlier': '{count, plural, one {# earlier line} other {# earlier lines}}',
224
242
  'ta.tool.hideScript': 'Hide script',
225
243
  'ta.tool.showScript': 'Show the script',
244
+ 'ta.tool.printed': 'Printed',
245
+ 'ta.tool.failedCalls': '{count, plural, one {# call failed} other {# calls failed}}',
246
+ 'ta.tool.exitCode': 'Exit code {code}',
247
+ 'ta.tool.noOutput': 'Nothing returned',
248
+ 'ta.tool.moreEntries': '{count} more',
226
249
  'ta.tool.verb.bash': 'Run',
227
250
  'ta.tool.verb.read': 'Read',
228
251
  'ta.tool.verb.edit': 'Edit',
@@ -241,6 +264,13 @@ exports.EN_MESSAGES = {
241
264
  'ta.tool.verb.webSearch': 'Search the web',
242
265
  'ta.tool.verb.todo': 'Update todos',
243
266
  'ta.tool.verb.skill': 'Use skill',
267
+ 'ta.tool.verb.sendMessage': 'Send message',
268
+ 'ta.tool.verb.deleteTeam': 'Disband team',
269
+ 'ta.tool.verb.scheduleTask': 'Schedule',
270
+ 'ta.tool.verb.listScheduled': 'List scheduled tasks',
271
+ 'ta.tool.verb.deleteScheduled': 'Cancel scheduled task',
272
+ 'ta.tool.verb.publish': 'Publish',
273
+ 'ta.tool.verb.editImage': 'Edit image',
244
274
  'ta.assistant.me': 'My double',
245
275
  'ta.assistant.hello': 'Hi, I am Ta',
246
276
  'ta.assistant.showTasks': 'Show the tasks',
@@ -344,7 +374,7 @@ exports.EN_MESSAGES = {
344
374
  'ta.settings.taskModel': 'Model of its tasks',
345
375
  'ta.settings.taskModelHint': 'What does the work the double hands out; an external agent fits here',
346
376
  'ta.settings.confirmTasks': 'Ask before starting tasks',
347
- 'ta.settings.confirmTasksHint': 'The double says what it would hand out, tasks or a team of agents, and waits for your go',
377
+ '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)',
348
378
  'ta.settings.maxTasks': 'Tasks at once',
349
379
  'ta.settings.maxTasksHint': 'Beyond it, the double waits for one to end',
350
380
  'ta.settings.maxTasksAny': 'Any',
@@ -407,6 +437,40 @@ exports.EN_MESSAGES = {
407
437
  'ta.remote.addHint': 'A Host of ~/.ssh/config, user@host:port, or an ssh command',
408
438
  'ta.remote.connected': 'Connected',
409
439
  'ta.remote.failed': 'Cannot connect to {host}',
440
+ 'ta.relays.title': 'Relays',
441
+ 'ta.relays.feature.devices': 'Phones and other devices',
442
+ 'ta.relays.feature.devicesHint': 'What new devices reach this computer through. Paired ones stay on theirs.',
443
+ 'ta.relays.feature.share': 'Links you share',
444
+ '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.',
445
+ 'ta.relays.feature.rooms': 'Rooms and playing together',
446
+ '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.',
447
+ 'ta.relays.feature.sync': 'Sync',
448
+ '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).',
449
+ 'ta.relays.official': 'Official relay',
450
+ 'ta.relays.online': 'answers in {ms} ms',
451
+ 'ta.relays.onlineNoTime': 'answers',
452
+ 'ta.relays.offline': 'does not answer',
453
+ 'ta.relays.memory': 'keeps rooms in memory only',
454
+ 'ta.relays.limits': 'rooms of {members}, {state} MB',
455
+ 'ta.relays.remove': 'Remove {name}',
456
+ 'ta.relays.add': 'Add a relay',
457
+ '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.',
458
+ 'ta.relays.addButton': 'Add',
459
+ 'ta.relays.addPlaceholder': 'https://relay.example.com, or a folder ~/…',
460
+ 'ta.relays.folderOnly': 'a folder, for sync only',
461
+ 'ta.relays.drive': 'Sync in {name}',
462
+ 'ta.relays.driveHint': 'Sync through the folder {path}, which the drive keeps the same on your computers: no relay at all.',
463
+ 'ta.relays.driveUse': 'Use',
464
+ 'ta.relays.file': 'relays.json',
465
+ 'ta.relays.broken': 'relays.json does not parse',
466
+ 'ta.relays.storeType': 'Sync in {name}',
467
+ 'ta.relays.storeOpen': 'Set up',
468
+ 'ta.relays.storeName': 'Name',
469
+ 'ta.relays.optional': 'optional',
470
+ '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.',
471
+ 'ta.relays.storeAdd': 'Add and sync there',
472
+ 'ta.relays.storeOnly': 'for sync only',
473
+ 'ta.relays.unavailable': 'its extension is off',
410
474
  'ta.remote.title': 'Remote hosts',
411
475
  'ta.remote.description': 'Conversations can work in directories of these machines. Ta connects with the ssh of this computer and its ~/.ssh/config.',
412
476
  'ta.remote.none': 'No hosts yet',
@@ -501,7 +565,7 @@ exports.EN_MESSAGES = {
501
565
  'ta.process.thinking': 'Thinking',
502
566
  'ta.process.thought': 'Thought',
503
567
  'ta.process.failed': '{count} failed',
504
- 'ta.process.retried': 'Request failed, retried',
568
+ 'ta.process.requestFailed': 'Request failed',
505
569
  'ta.process.earlier': '{count, plural, one {# earlier step} other {# earlier steps}}',
506
570
  'ta.process.showAll': 'Show all',
507
571
  'ta.session.phase.thinking': 'Thinking',
@@ -799,6 +863,8 @@ exports.EN_MESSAGES = {
799
863
  'ta.relay.offline': 'Not connected · {relay}',
800
864
  'ta.relay.unpair': 'Unpair',
801
865
  'ta.relay.unpairConfirm': 'Unpair {name}? It can no longer reach this Ta.',
866
+ 'ta.relay.keepAwake': 'Keep this computer awake',
867
+ '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.',
802
868
  'ta.manage.relay': 'Use on your phone…',
803
869
  'ta.settings.relay': 'Phone',
804
870
  'ta.settings.relayDescription': 'Devices that reach this Ta through a relay',
@@ -906,6 +972,8 @@ exports.ZH_MESSAGES = {
906
972
  'ta.connection.retry': '重试',
907
973
  'ta.connection.away': '连不上电脑上的 Ta。请确认电脑开着、联网,并且 Ta 在运行;连上后会自动恢复。',
908
974
  'ta.connection.back': '已重新连接',
975
+ 'ta.connection.outdated': 'Ta 已更新,刷新后才能完整显示',
976
+ 'ta.connection.reload': '刷新',
909
977
  'ta.connection.awayBrief': '连不上电脑上的 Ta',
910
978
  'ta.connection.unreachableBrief': 'Ta 服务没有在运行',
911
979
  'ta.connection.notDone': '没有完成:连接断了一下,再试一次',
@@ -917,6 +985,12 @@ exports.ZH_MESSAGES = {
917
985
  'ta.error.nothingToCompact': '对话内容还很少,暂时不需要压缩',
918
986
  'ta.error.alreadyCompacted': '上次压缩后还没有新内容,暂时不需要压缩',
919
987
  'ta.error.sessionBusy': 'Ta 正在回复或压缩,请等它结束后再试',
988
+ 'ta.error.forbidden': '你在这里还不能「{action}」',
989
+ 'ta.error.forbiddenHint': '这台 Ta 的所有者或管理员可以给你这个权限',
990
+ 'ta.error.forbiddenAsk': '申请',
991
+ 'ta.assistant.forbidden': '在这台 Ta 里你只能使用分享给你的内容:在分身下方的列表或「发现 → 成员与权限」里找到它',
992
+ 'ta.error.limit': '这台 Ta 同时在跑的协作任务已满,请稍后再试',
993
+ 'ta.error.forbiddenNever': '这里对所有协作者都不开放',
920
994
  'ta.notices': '通知',
921
995
  'ta.notice.picture': '扩展给出的图像,如要扫描的二维码',
922
996
  'ta.packages.removeDetail': '它的页面、卡片和命令也会一起移除。',
@@ -997,6 +1071,11 @@ exports.ZH_MESSAGES = {
997
1071
  'ta.chat.unpin': '取消置顶',
998
1072
  'ta.chat.pinned': '置顶',
999
1073
  'ta.chat.unseen': '有新回复未查看',
1074
+ 'ta.chat.asking': '等你决定',
1075
+ 'ta.chat.asks': '待你决定',
1076
+ 'ta.chat.asksCount': '{count} 个待你决定',
1077
+ 'ta.chat.letGo': '不用决定了',
1078
+ 'ta.chat.toAsk': '等你决定:{question}',
1000
1079
  'ta.chat.removed': '已移除({count})',
1001
1080
  'ta.chat.olderCount': '{days} 天前({count})',
1002
1081
  'ta.chat.archived': '已归档',
@@ -1024,7 +1103,6 @@ exports.ZH_MESSAGES = {
1024
1103
  'ta.message.interrupted': '这一轮中途断了:Ta 服务停止,或智能体没做完就结束了这一轮。',
1025
1104
  'ta.message.silent': '这一轮没有回复就结束了:智能体可能和模型断了连接。',
1026
1105
  'ta.message.failedUnknown': '请求失败,没有给出原因。',
1027
- 'ta.message.retriedFailed': '已自动重试 {count} 次,仍然失败',
1028
1106
  'ta.message.resume': '继续',
1029
1107
  'ta.message.resumeText': '继续',
1030
1108
  'ta.message.thinking': '思考',
@@ -1032,6 +1110,11 @@ exports.ZH_MESSAGES = {
1032
1110
  'ta.message.showMore': '展开',
1033
1111
  'ta.message.showLess': '收起',
1034
1112
  'ta.message.compacted': '较早的消息已压缩',
1113
+ 'ta.message.compactedFrom': '压缩前 {tokens} tokens',
1114
+ 'ta.message.steered': '插话',
1115
+ 'ta.message.steeredTitle': '在它工作时发的:它跑完手头的工具后读到,接着按这句继续',
1116
+ 'ta.message.queued': '排队',
1117
+ 'ta.message.queuedTitle': '在它工作时发的:等它回复完才发出',
1035
1118
  'ta.message.branch': '另一分支的摘要',
1036
1119
  'ta.message.forkBefore': '从这里在侧边新开对话',
1037
1120
  'ta.message.forkAt': '从这条回复在侧边新开对话',
@@ -1050,10 +1133,16 @@ exports.ZH_MESSAGES = {
1050
1133
  'ta.message.debugCopied': '已复制调试信息',
1051
1134
  'ta.message.used': '共消耗',
1052
1135
  'ta.message.modelSwitched': '已切换到 {model}',
1136
+ 'ta.message.resumed': 'Ta 重启后接着做',
1053
1137
  'ta.message.usageTitle': '发送 {input} token,接收 {output} token',
1054
1138
  'ta.tool.earlier': '前面还有 {count} 行',
1055
1139
  'ta.tool.hideScript': '收起脚本',
1056
1140
  'ta.tool.showScript': '查看脚本',
1141
+ 'ta.tool.printed': '打印',
1142
+ 'ta.tool.failedCalls': '{count} 次调用失败',
1143
+ 'ta.tool.exitCode': '退出码 {code}',
1144
+ 'ta.tool.noOutput': '没有返回内容',
1145
+ 'ta.tool.moreEntries': '还有 {count} 项',
1057
1146
  'ta.tool.verb.bash': '运行',
1058
1147
  'ta.tool.verb.read': '读取',
1059
1148
  'ta.tool.verb.edit': '编辑',
@@ -1072,6 +1161,13 @@ exports.ZH_MESSAGES = {
1072
1161
  'ta.tool.verb.webSearch': '搜索网页',
1073
1162
  'ta.tool.verb.todo': '更新待办',
1074
1163
  'ta.tool.verb.skill': '使用技能',
1164
+ 'ta.tool.verb.sendMessage': '发送消息',
1165
+ 'ta.tool.verb.deleteTeam': '解散团队',
1166
+ 'ta.tool.verb.scheduleTask': '创建定时任务',
1167
+ 'ta.tool.verb.listScheduled': '查看定时任务',
1168
+ 'ta.tool.verb.deleteScheduled': '取消定时任务',
1169
+ 'ta.tool.verb.publish': '发布',
1170
+ 'ta.tool.verb.editImage': '编辑图片',
1075
1171
  'ta.assistant.me': '我的分身',
1076
1172
  'ta.assistant.hello': '你好,我是 Ta',
1077
1173
  'ta.assistant.showTasks': '查看任务',
@@ -1175,7 +1271,7 @@ exports.ZH_MESSAGES = {
1175
1271
  'ta.settings.taskModel': '任务的模型',
1176
1272
  'ta.settings.taskModelHint': '分身交出的任务由它来做,外部 Agent 适合放在这里',
1177
1273
  'ta.settings.confirmTasks': '开始任务前先问我',
1178
- 'ta.settings.confirmTasksHint': '分身先说明要交出的任务或要组建的团队,等你同意再开始',
1274
+ 'ta.settings.confirmTasksHint': '分身先说明要交出的任务或要组建的团队,等你同意再开始。开着“主动”时,你连续同意 3 次后它会直接开始(设置 → 主动)',
1179
1275
  'ta.settings.maxTasks': '同时进行的任务',
1180
1276
  'ta.settings.maxTasksHint': '超过时,分身会等前面的结束',
1181
1277
  'ta.settings.maxTasksAny': '不限',
@@ -1238,6 +1334,40 @@ exports.ZH_MESSAGES = {
1238
1334
  'ta.remote.addHint': '~/.ssh/config 里的主机、user@host:port,或 ssh 命令',
1239
1335
  'ta.remote.connected': '已连接',
1240
1336
  'ta.remote.failed': '连不上 {host}',
1337
+ 'ta.relays.title': '中继服务',
1338
+ 'ta.relays.feature.devices': '手机等设备',
1339
+ 'ta.relays.feature.devicesHint': '新配对的设备经它连回这台电脑;已配对的保持原来的中继。',
1340
+ 'ta.relays.feature.share': '分享链接',
1341
+ 'ta.relays.feature.shareHint': '分享扩展、对话的链接,电脑关机时可看的副本,以及链接在浏览器里打开的页面。',
1342
+ 'ta.relays.feature.rooms': '房间与联机',
1343
+ 'ta.relays.feature.roomsHint': '新建房间放在这里。房间建好后不随之变化;加入别人的房间用对方链接里的中继。',
1344
+ 'ta.relays.feature.sync': '设备同步',
1345
+ 'ta.relays.feature.syncHint': '开启同步时你的几台电脑经它同步:中继上的房间;或完全不经过中继,用网盘里的文件夹、你自己的 WebDAV、S3 存储或 git 仓库。',
1346
+ 'ta.relays.official': '官方中继',
1347
+ 'ta.relays.online': '{ms} 毫秒响应',
1348
+ 'ta.relays.onlineNoTime': '可用',
1349
+ 'ta.relays.offline': '连不上',
1350
+ 'ta.relays.memory': '房间只存在内存里',
1351
+ 'ta.relays.limits': '房间最多 {members} 人、{state} MB',
1352
+ 'ta.relays.remove': '移除 {name}',
1353
+ 'ta.relays.add': '添加中继',
1354
+ 'ta.relays.addHint': '你自己的中继(部署在自己的 Cloudflare 上,或在 HTTPS 后面运行 ta relay --data <目录>),它读不到经过的内容,但链接打开的网页由它提供;或者一个由网盘在几台电脑间保持一致的文件夹,用于设备同步。',
1355
+ 'ta.relays.addButton': '添加',
1356
+ 'ta.relays.addPlaceholder': 'https://relay.example.com,或文件夹 ~/…',
1357
+ 'ta.relays.folderOnly': '文件夹,仅用于设备同步',
1358
+ 'ta.relays.drive': '用 {name} 同步',
1359
+ 'ta.relays.driveHint': '设备同步经文件夹 {path},由网盘在你的几台电脑间保持一致,完全不经过中继。',
1360
+ 'ta.relays.driveUse': '使用',
1361
+ 'ta.relays.file': 'relays.json',
1362
+ 'ta.relays.broken': 'relays.json 格式不对',
1363
+ 'ta.relays.storeType': '用 {name} 同步',
1364
+ 'ta.relays.storeOpen': '设置',
1365
+ 'ta.relays.storeName': '名称',
1366
+ 'ta.relays.optional': '可不填',
1367
+ 'ta.relays.storeNote': 'Ta 会先试一下:写入再删掉一个小文件。同步放进去的内容在本机就已加密;密码只存在这台电脑的 relays.json 里。',
1368
+ 'ta.relays.storeAdd': '添加并用于同步',
1369
+ 'ta.relays.storeOnly': '仅用于设备同步',
1370
+ 'ta.relays.unavailable': '对应的扩展已关闭',
1241
1371
  'ta.remote.title': '远程主机',
1242
1372
  'ta.remote.description': '对话可以在这些机器的目录里工作。Ta 用本机的 ssh 和 ~/.ssh/config 连接。',
1243
1373
  'ta.remote.none': '还没有主机',
@@ -1332,7 +1462,7 @@ exports.ZH_MESSAGES = {
1332
1462
  'ta.process.thinking': '思考中',
1333
1463
  'ta.process.thought': '已思考',
1334
1464
  'ta.process.failed': '{count} 步失败',
1335
- 'ta.process.retried': '请求失败,已重试',
1465
+ 'ta.process.requestFailed': '请求失败',
1336
1466
  'ta.process.earlier': '前 {count} 步',
1337
1467
  'ta.process.showAll': '显示全部',
1338
1468
  'ta.session.phase.thinking': '思考中',
@@ -1629,6 +1759,8 @@ exports.ZH_MESSAGES = {
1629
1759
  'ta.relay.offline': '未连接 · {relay}',
1630
1760
  'ta.relay.unpair': '取消配对',
1631
1761
  'ta.relay.unpairConfirm': '取消配对 {name}?它将无法再连到这台电脑上的 Ta。',
1762
+ 'ta.relay.keepAwake': '让电脑保持唤醒',
1763
+ 'ta.relay.keepAwakeHint': '有任务在跑,或手机连过后的 30 分钟内,电脑闲置也不睡眠,手机随时连得上。屏幕照常熄灭,合上盖子仍会睡眠。',
1632
1764
  'ta.manage.relay': '在手机上使用…',
1633
1765
  'ta.settings.relay': '手机访问',
1634
1766
  'ta.settings.relayDescription': '经 Relay 连到这台电脑上 Ta 的设备',
@@ -2,4 +2,8 @@ import * as React from 'react';
2
2
  import type { WebCodeRendererProps } from '../extension/web-api-contributions';
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>;
5
9
  //# sourceMappingURL=code-renderers.d.ts.map
@@ -33,8 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.CodeRenderers = void 0;
36
+ exports.CodeAnswer = exports.CodeReply = exports.CodeRenderers = void 0;
37
37
  const React = __importStar(require("react"));
38
38
  /** What web extensions draw fenced blocks of their languages with (WebExtensionAPI.registerCodeRenderer), by language in lower case. */
39
39
  exports.CodeRenderers = React.createContext({});
40
+ /** Where the fenced blocks drawn by web extensions send what the user picks in them: the conversation they are in. */
41
+ exports.CodeReply = React.createContext(undefined);
42
+ /** What the user said after the turn of the blocks (WebCodeRendererProps.answer): none while they did not answer it. */
43
+ exports.CodeAnswer = React.createContext(undefined);
40
44
  //# sourceMappingURL=code-renderers.js.map
@@ -19,4 +19,12 @@ 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
+ }
22
30
  //# sourceMappingURL=lazy.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Recent = exports.Lazy = void 0;
3
+ exports.KeptRecent = exports.Recent = exports.Lazy = void 0;
4
4
  /**
5
5
  * A module loaded the first time it is needed, not with the page: formulas and diagrams bring large
6
6
  * libraries that most conversations never use. A load that failed is tried again the next time.
@@ -41,4 +41,40 @@ class Recent {
41
41
  }
42
42
  }
43
43
  exports.Recent = Recent;
44
+ /** A Recent kept on the device (localStorage, under `key`): what it was told is there again after the page loads again. */
45
+ class KeptRecent extends Recent {
46
+ constructor(key, limit) {
47
+ var _a;
48
+ var _b;
49
+ super(limit);
50
+ this.key = key;
51
+ try {
52
+ 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 : '[]')) {
53
+ super.set(entry, value);
54
+ }
55
+ }
56
+ catch (_c) {
57
+ // Kept by another version, or not at all: starts empty.
58
+ }
59
+ }
60
+ set(key, value) {
61
+ var _a;
62
+ super.set(key, value);
63
+ (_a = this.saving) !== null && _a !== void 0 ? _a : (this.saving = setTimeout(() => {
64
+ var _a;
65
+ this.saving = undefined;
66
+ try {
67
+ (_a = KeptRecent.storage()) === null || _a === void 0 ? void 0 : _a.setItem(this.key, JSON.stringify([...this.entries]));
68
+ }
69
+ catch (_b) {
70
+ // Full: kept for this page only.
71
+ }
72
+ }, 1000));
73
+ return value;
74
+ }
75
+ static storage() {
76
+ return typeof localStorage === 'undefined' ? undefined : localStorage;
77
+ }
78
+ }
79
+ exports.KeptRecent = KeptRecent;
44
80
  //# sourceMappingURL=lazy.js.map
@@ -1,6 +1,15 @@
1
1
  import type { Theme } from '../settings/settings-protocol';
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,10 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MermaidRenderer = exports.MermaidUtil = void 0;
4
+ const scroll_rest_1 = require("../util/scroll-rest");
4
5
  const lazy_1 = require("./lazy");
5
- /** What does not need the library: which code blocks are diagrams, and what a downloaded diagram is. */
6
+ /** What does not need the library: which code blocks are diagrams, how large one draws, and what a downloaded diagram is. */
6
7
  var MermaidUtil;
7
8
  (function (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) {
11
+ var _a, _b;
12
+ var _c;
13
+ const open = (_a = /<svg\b[^>]*>/.exec(svg)) === null || _a === void 0 ? void 0 : _a[0];
14
+ const box = open && /viewBox="[\d.-]+[\s,]+[\d.-]+[\s,]+([\d.]+)[\s,]+([\d.]+)"/.exec(open);
15
+ if (!open || !box) {
16
+ return undefined;
17
+ }
18
+ const [width, height] = [Number(box[1]), Number(box[2])];
19
+ 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);
20
+ return width > 0 && height > 0 && max > 0 ? { width: Math.round(max), height: Math.round((height * max) / width) } : undefined;
21
+ }
22
+ MermaidUtil.size = size;
23
+ /** What a source is known by on the device: short, for a key of localStorage. */
24
+ function hash(code) {
25
+ let hash = 0x811c9dc5;
26
+ for (let index = 0; index < code.length; index++) {
27
+ hash = Math.imul(hash ^ code.charCodeAt(index), 0x01000193);
28
+ }
29
+ return `${(hash >>> 0).toString(36)}.${code.length.toString(36)}`;
30
+ }
31
+ MermaidUtil.hash = hash;
8
32
  function isDiagram(language, code) {
9
33
  return (language === null || language === void 0 ? void 0 : language.trim().toLowerCase()) === 'mermaid' && code.trim().length > 0;
10
34
  }
@@ -32,13 +56,20 @@ var MermaidUtil;
32
56
  /**
33
57
  * Mermaid diagrams, drawn by the library loaded at the first one. A source that does not parse, as
34
58
  * while a reply streams it, draws nothing; what was drawn is kept per theme and source, so that a
35
- * diagram is not drawn again on each change of the conversation. Drawings run one at a time: the
36
- * library has one configuration.
59
+ * diagram is not drawn again on each change of the conversation, and its size on the device, so that
60
+ * one shown before has its place before it draws again. Drawings run one at a time, while the page
61
+ * does not scroll (ScrollRest): the library has one configuration.
37
62
  */
38
63
  var MermaidRenderer;
39
64
  (function (MermaidRenderer) {
40
65
  const mermaid = new lazy_1.Lazy(async () => (await import('mermaid')).default);
41
- const drawn = new lazy_1.Recent(32);
66
+ const drawn = new lazy_1.Recent(96);
67
+ const sizes = new lazy_1.KeptRecent('ta.diagram.sizes', 300);
68
+ /** The size the diagram of `code` drew at, the last time it did on this device. */
69
+ function size(code) {
70
+ return sizes.get(MermaidUtil.hash(code));
71
+ }
72
+ MermaidRenderer.size = size;
42
73
  let queue = Promise.resolve();
43
74
  let configured;
44
75
  let count = 0;
@@ -59,6 +90,7 @@ var MermaidRenderer;
59
90
  async function draw(theme, code) {
60
91
  var _a;
61
92
  const api = await mermaid.load();
93
+ await scroll_rest_1.ScrollRest.wait();
62
94
  if (configured !== theme) {
63
95
  api.initialize({
64
96
  startOnLoad: false,
@@ -74,7 +106,14 @@ var MermaidRenderer;
74
106
  const id = `ta-mermaid-${++count}`;
75
107
  try {
76
108
  const { svg } = await api.render(id, code);
77
- return svg ? drawn.set(MermaidUtil.key(theme, code), svg) : undefined;
109
+ if (!svg) {
110
+ return undefined;
111
+ }
112
+ const size = MermaidUtil.size(svg);
113
+ if (size) {
114
+ sizes.set(MermaidUtil.hash(code), size);
115
+ }
116
+ return drawn.set(MermaidUtil.key(theme, code), svg);
78
117
  }
79
118
  finally {
80
119
  // 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
@@ -3,6 +3,12 @@ import { TaSettings } from '../settings/settings-protocol';
3
3
  import { type ConfirmOptions, type ConfirmRequest, type InputOptions, type InputRequest, type Notice, type NoticeLevel, type NoticeOptions, type NoticesState, TaNotices } from './notices-protocol';
4
4
  /** Asks the page to open its sign-in to a provider of models: a call failed for want of one. */
5
5
  export declare const SIGN_IN_EVENT = "ta:sign-in";
6
+ /** Which build of Ta a page is: its entry module, whose name changes with each build. */
7
+ export declare namespace PageVersionUtil {
8
+ function entry(html: string): string | undefined;
9
+ /** Whether the page served now (`served`, its HTML) is another build than the one loaded (`loaded`, its entry). */
10
+ function outdated(loaded: string | undefined, served: string): boolean;
11
+ }
6
12
  type Question = {
7
13
  kind: 'confirm';
8
14
  request: ConfirmRequest;
@@ -34,10 +40,23 @@ export declare class TaNoticesImpl implements TaNotices {
34
40
  protected nextId: number;
35
41
  protected readonly questions: Question[];
36
42
  protected readonly listeners: Set<(state: NoticesState) => void>;
43
+ protected checking: boolean;
44
+ protected init(): void;
45
+ /**
46
+ * A part loaded on demand did not load: when ta serve now serves another build (Ta was updated while the
47
+ * page stayed open), the page is outdated. Offline is not: the row of the connection says that.
48
+ */
49
+ protected checkOutdated(): Promise<void>;
50
+ protected loadedEntry(): string | undefined;
37
51
  get state(): NoticesState;
38
52
  subscribe(listener: (state: NoticesState) => void): () => void;
39
53
  notify(text: string, options?: NoticeOptions): number;
40
54
  error(cause: unknown, options?: Omit<NoticeOptions, 'level'>): number;
55
+ /**
56
+ * A call of one let into another's Ta that they may not make (docs/design/ta-team.md 6): what it needs, in their words,
57
+ * and a button that asks for it (the package that lets people in hears TA_ACCESS_REQUEST_EVENT).
58
+ */
59
+ protected forbidden(cause: unknown, options: Omit<NoticeOptions, 'level'>): number;
41
60
  /** Not a notice over the page: the row of the connection says that it did not happen, and why. */
42
61
  protected notDone(): number;
43
62
  dismiss(id: number): void;