@celljs/ta-web 4.38.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 (191) hide show
  1. package/esm/browser/assistant/assistant-thread.d.ts +1 -1
  2. package/esm/browser/assistant/chat-task-source.js +2 -1
  3. package/esm/browser/components/app-contexts.js +11 -10
  4. package/esm/browser/components/chat-asks.d.ts +4 -1
  5. package/esm/browser/components/chat-asks.js +10 -0
  6. package/esm/browser/components/chat-list-row.js +5 -3
  7. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  8. package/esm/browser/components/composer-box-protocol.d.ts +5 -0
  9. package/esm/browser/components/composer-box.js +11 -14
  10. package/esm/browser/components/composer-media.d.ts +26 -0
  11. package/esm/browser/components/composer-media.js +37 -0
  12. package/esm/browser/components/composer-target.d.ts +2 -2
  13. package/esm/browser/components/composer-target.js +3 -3
  14. package/esm/browser/components/composer.js +1 -0
  15. package/esm/browser/components/host-view.d.ts +1 -1
  16. package/esm/browser/components/link.d.ts +7 -1
  17. package/esm/browser/components/link.js +24 -5
  18. package/esm/browser/components/markdown.d.ts +1 -1
  19. package/esm/browser/components/markdown.js +70 -4
  20. package/esm/browser/components/remote-hosts.d.ts +3 -1
  21. package/esm/browser/components/remote-hosts.js +10 -5
  22. package/esm/browser/components/session-view.js +10 -6
  23. package/esm/browser/components/web-composer.d.ts +1 -1
  24. package/esm/browser/components/web-composer.js +12 -3
  25. package/esm/browser/device/photo-picker.d.ts +11 -3
  26. package/esm/browser/device/photo-picker.js +26 -9
  27. package/esm/browser/device/video-picks.d.ts +24 -0
  28. package/esm/browser/device/video-picks.js +104 -0
  29. package/esm/browser/extension/icons.js +3 -1
  30. package/esm/browser/extension/web-access.js +4 -1
  31. package/esm/browser/extension/web-api-code.d.ts +36 -0
  32. package/esm/browser/extension/web-api-code.js +3 -0
  33. package/esm/browser/extension/web-api-components.d.ts +22 -0
  34. package/esm/browser/extension/web-api-contributions.d.ts +0 -31
  35. package/esm/browser/extension/web-api-menus.d.ts +17 -5
  36. package/esm/browser/extension/web-api-play.d.ts +29 -0
  37. package/esm/browser/extension/web-api-play.js +2 -0
  38. package/esm/browser/extension/web-api-spec.js +3 -0
  39. package/esm/browser/extension/web-api-terminal.d.ts +20 -0
  40. package/esm/browser/extension/web-extension-api.d.ts +12 -17
  41. package/esm/browser/extension/web-extension-context.d.ts +1 -1
  42. package/esm/browser/extension/web-extension-context.js +4 -3
  43. package/esm/browser/extension/web-extension-protocol.d.ts +2 -0
  44. package/esm/browser/extension/web-extension-protocol.js +1 -0
  45. package/esm/browser/extension/web-extension-run.d.ts +4 -3
  46. package/esm/browser/extension/web-extension-run.js +15 -8
  47. package/esm/browser/extension/web-extensions-running.js +38 -7
  48. package/esm/browser/extension/web-on-demand.d.ts +5 -0
  49. package/esm/browser/extension/web-on-demand.js +11 -0
  50. package/esm/browser/i18n/en/assistant.d.ts +3 -0
  51. package/esm/browser/i18n/en/assistant.js +3 -0
  52. package/esm/browser/i18n/en/chat.d.ts +1 -0
  53. package/esm/browser/i18n/en/chat.js +1 -0
  54. package/esm/browser/i18n/en/common.d.ts +1 -0
  55. package/esm/browser/i18n/en/common.js +1 -0
  56. package/esm/browser/i18n/en/discover.d.ts +2 -0
  57. package/esm/browser/i18n/en/discover.js +2 -0
  58. package/esm/browser/i18n/en/service.js +6 -6
  59. package/esm/browser/i18n/ja/assistant.js +3 -0
  60. package/esm/browser/i18n/ja/chat.js +1 -0
  61. package/esm/browser/i18n/ja/common.js +1 -0
  62. package/esm/browser/i18n/ja/discover.js +2 -0
  63. package/esm/browser/i18n/ja/service.js +6 -6
  64. package/esm/browser/i18n/locales.d.ts +8 -1
  65. package/esm/browser/i18n/messages.d.ts +7 -0
  66. package/esm/browser/i18n/zh/assistant.js +3 -0
  67. package/esm/browser/i18n/zh/chat.js +1 -0
  68. package/esm/browser/i18n/zh/common.js +1 -0
  69. package/esm/browser/i18n/zh/discover.js +2 -0
  70. package/esm/browser/i18n/zh/service.js +6 -6
  71. package/esm/browser/i18n/zh-tw/assistant.js +3 -0
  72. package/esm/browser/i18n/zh-tw/chat.js +1 -0
  73. package/esm/browser/i18n/zh-tw/common.js +1 -0
  74. package/esm/browser/i18n/zh-tw/discover.js +2 -0
  75. package/esm/browser/i18n/zh-tw/service.js +6 -6
  76. package/esm/browser/markdown/code-renderers.d.ts +3 -1
  77. package/esm/browser/markdown/code-renderers.js +2 -0
  78. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  79. package/esm/browser/sandbox/work/work-api.d.ts +113 -0
  80. package/esm/browser/sandbox/work/work-api.js +95 -0
  81. package/esm/browser/sandbox/work/work-docs.d.ts +18 -0
  82. package/esm/browser/sandbox/work/work-docs.js +66 -0
  83. package/esm/browser/sandbox/work/work-frame.d.ts +27 -0
  84. package/esm/browser/sandbox/work/work-frame.js +124 -0
  85. package/esm/browser/share/shared-extensions.d.ts +2 -1
  86. package/esm/browser/style/conversation.d.ts +1 -1
  87. package/esm/browser/style/conversation.js +10 -0
  88. package/esm/browser/style/pages.d.ts +1 -1
  89. package/esm/browser/style/pages.js +1 -0
  90. package/esm/browser/terminal/terminal-osc.d.ts +15 -0
  91. package/esm/browser/terminal/terminal-osc.js +91 -0
  92. package/esm/browser/terminal/web-terminal.d.ts +4 -7
  93. package/esm/browser/terminal/web-terminal.js +22 -26
  94. package/esm/browser/util/link.d.ts +6 -1
  95. package/esm/browser/util/link.js +11 -0
  96. package/lib/browser/assistant/assistant-thread.d.ts +1 -1
  97. package/lib/browser/assistant/chat-task-source.js +2 -1
  98. package/lib/browser/components/app-contexts.js +10 -9
  99. package/lib/browser/components/chat-asks.d.ts +4 -1
  100. package/lib/browser/components/chat-asks.js +10 -0
  101. package/lib/browser/components/chat-list-row.js +5 -3
  102. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  103. package/lib/browser/components/composer-box-protocol.d.ts +5 -0
  104. package/lib/browser/components/composer-box.js +9 -12
  105. package/lib/browser/components/composer-media.d.ts +27 -0
  106. package/lib/browser/components/composer-media.js +74 -0
  107. package/lib/browser/components/composer-target.d.ts +2 -2
  108. package/lib/browser/components/composer-target.js +3 -3
  109. package/lib/browser/components/composer.js +1 -0
  110. package/lib/browser/components/host-view.d.ts +1 -1
  111. package/lib/browser/components/link.d.ts +7 -1
  112. package/lib/browser/components/link.js +25 -6
  113. package/lib/browser/components/markdown.d.ts +1 -1
  114. package/lib/browser/components/markdown.js +68 -2
  115. package/lib/browser/components/remote-hosts.d.ts +3 -1
  116. package/lib/browser/components/remote-hosts.js +10 -5
  117. package/lib/browser/components/session-view.js +8 -4
  118. package/lib/browser/components/web-composer.d.ts +1 -1
  119. package/lib/browser/components/web-composer.js +12 -3
  120. package/lib/browser/device/photo-picker.d.ts +11 -3
  121. package/lib/browser/device/photo-picker.js +26 -9
  122. package/lib/browser/device/video-picks.d.ts +25 -0
  123. package/lib/browser/device/video-picks.js +107 -0
  124. package/lib/browser/extension/icons.js +2 -0
  125. package/lib/browser/extension/web-access.js +4 -1
  126. package/lib/browser/extension/web-api-code.d.ts +37 -0
  127. package/lib/browser/extension/web-api-code.js +4 -0
  128. package/lib/browser/extension/web-api-components.d.ts +22 -0
  129. package/lib/browser/extension/web-api-contributions.d.ts +0 -31
  130. package/lib/browser/extension/web-api-menus.d.ts +17 -5
  131. package/lib/browser/extension/web-api-play.d.ts +30 -0
  132. package/lib/browser/extension/web-api-play.js +3 -0
  133. package/lib/browser/extension/web-api-spec.js +3 -0
  134. package/lib/browser/extension/web-api-terminal.d.ts +20 -0
  135. package/lib/browser/extension/web-extension-api.d.ts +12 -17
  136. package/lib/browser/extension/web-extension-context.d.ts +1 -1
  137. package/lib/browser/extension/web-extension-context.js +4 -3
  138. package/lib/browser/extension/web-extension-protocol.d.ts +2 -0
  139. package/lib/browser/extension/web-extension-protocol.js +1 -0
  140. package/lib/browser/extension/web-extension-run.d.ts +4 -3
  141. package/lib/browser/extension/web-extension-run.js +15 -8
  142. package/lib/browser/extension/web-extensions-running.js +38 -7
  143. package/lib/browser/extension/web-on-demand.d.ts +5 -0
  144. package/lib/browser/extension/web-on-demand.js +11 -0
  145. package/lib/browser/i18n/en/assistant.d.ts +3 -0
  146. package/lib/browser/i18n/en/assistant.js +3 -0
  147. package/lib/browser/i18n/en/chat.d.ts +1 -0
  148. package/lib/browser/i18n/en/chat.js +1 -0
  149. package/lib/browser/i18n/en/common.d.ts +1 -0
  150. package/lib/browser/i18n/en/common.js +1 -0
  151. package/lib/browser/i18n/en/discover.d.ts +2 -0
  152. package/lib/browser/i18n/en/discover.js +2 -0
  153. package/lib/browser/i18n/en/service.js +6 -6
  154. package/lib/browser/i18n/ja/assistant.js +3 -0
  155. package/lib/browser/i18n/ja/chat.js +1 -0
  156. package/lib/browser/i18n/ja/common.js +1 -0
  157. package/lib/browser/i18n/ja/discover.js +2 -0
  158. package/lib/browser/i18n/ja/service.js +6 -6
  159. package/lib/browser/i18n/locales.d.ts +8 -1
  160. package/lib/browser/i18n/messages.d.ts +7 -0
  161. package/lib/browser/i18n/zh/assistant.js +3 -0
  162. package/lib/browser/i18n/zh/chat.js +1 -0
  163. package/lib/browser/i18n/zh/common.js +1 -0
  164. package/lib/browser/i18n/zh/discover.js +2 -0
  165. package/lib/browser/i18n/zh/service.js +6 -6
  166. package/lib/browser/i18n/zh-tw/assistant.js +3 -0
  167. package/lib/browser/i18n/zh-tw/chat.js +1 -0
  168. package/lib/browser/i18n/zh-tw/common.js +1 -0
  169. package/lib/browser/i18n/zh-tw/discover.js +2 -0
  170. package/lib/browser/i18n/zh-tw/service.js +6 -6
  171. package/lib/browser/markdown/code-renderers.d.ts +3 -1
  172. package/lib/browser/markdown/code-renderers.js +3 -1
  173. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  174. package/lib/browser/sandbox/work/work-api.d.ts +114 -0
  175. package/lib/browser/sandbox/work/work-api.js +99 -0
  176. package/lib/browser/sandbox/work/work-docs.d.ts +19 -0
  177. package/lib/browser/sandbox/work/work-docs.js +69 -0
  178. package/lib/browser/sandbox/work/work-frame.d.ts +28 -0
  179. package/lib/browser/sandbox/work/work-frame.js +160 -0
  180. package/lib/browser/share/shared-extensions.d.ts +2 -1
  181. package/lib/browser/style/conversation.d.ts +1 -1
  182. package/lib/browser/style/conversation.js +10 -0
  183. package/lib/browser/style/pages.d.ts +1 -1
  184. package/lib/browser/style/pages.js +1 -0
  185. package/lib/browser/terminal/terminal-osc.d.ts +16 -0
  186. package/lib/browser/terminal/terminal-osc.js +94 -0
  187. package/lib/browser/terminal/web-terminal.d.ts +4 -7
  188. package/lib/browser/terminal/web-terminal.js +25 -29
  189. package/lib/browser/util/link.d.ts +6 -1
  190. package/lib/browser/util/link.js +11 -0
  191. package/package.json +7 -7
@@ -9,7 +9,7 @@ import type { TaSettings } from '../settings/settings-protocol';
9
9
  import type { TaState } from '../state/state-protocol';
10
10
  import { type TaTargets } from '../targets/targets-protocol';
11
11
  import type { TaWorkbench } from '../workbench-protocol';
12
- import type { WebCodeRendererProps } from './web-api-contributions';
12
+ import type { WebCodeRendererProps } from './web-api-code';
13
13
  import type { WebEditorTabs } from './web-editor-tabs';
14
14
  import type { CodeEditorProps, DiffEditorProps, WebComposerProps, WebExtensionAPI, WebExtensionUI, WebFolderPickerProps, WebHoldToTalkProps, WebModelPickerProps, WebShareSheetProps, WebStorage, WebViewInfo, WebVoice } from './web-extension-api';
15
15
  import { type TaWebExtensions, type WebExtensionConversation, type WebSessionSwitcher } from './web-extension-protocol';
@@ -79,6 +79,7 @@ const drafts_protocol_1 = require("../drafts/drafts-protocol");
79
79
  const game_view_1 = require("../game/game-view");
80
80
  const messages_1 = require("../i18n/messages");
81
81
  const use_t_1 = require("../i18n/use-t");
82
+ const work_frame_1 = require("../sandbox/work/work-frame");
82
83
  const screen_protocol_1 = require("../screen/screen-protocol");
83
84
  const targets_protocol_1 = require("../targets/targets-protocol");
84
85
  const web_terminal_1 = require("../terminal/web-terminal");
@@ -230,9 +231,7 @@ class WebExtensionContext {
230
231
  registerCodeRenderer: (language, renderer, options) => register(() => {
231
232
  const key = language.trim().toLowerCase();
232
233
  run.codeRenderers.set(key, WebExtensionContext.replying(renderer, mark));
233
- if (options === null || options === void 0 ? void 0 : options.spoken) {
234
- run.codeSpeech.set(key, options.spoken);
235
- }
234
+ run.codeOptions.set(key, options !== null && options !== void 0 ? options : {});
236
235
  }),
237
236
  registerCallPartner: partner => register(() => run.callPartners.push(partner)),
238
237
  registerCallMouth: mouth => register(() => run.callMouths.push(mouth)),
@@ -332,6 +331,7 @@ class WebExtensionContext {
332
331
  return settings.state.language;
333
332
  },
334
333
  supportsWebview: desktop_1.DesktopUtil.has('webview'),
334
+ composerVideos: true,
335
335
  desktop: desktop_1.DesktopUtil.fileManager(),
336
336
  fileDrag: FILE_DRAG,
337
337
  debugWebview: desktop_1.DesktopUtil.debugWebview(),
@@ -480,6 +480,7 @@ class WebExtensionContext {
480
480
  ImageViewer: image_viewer_1.ImageViewer,
481
481
  ChatImages: message_images_1.ChatImages,
482
482
  QrCode: qr_view_1.QrView,
483
+ WorkFrame: work_frame_1.WorkFrame,
483
484
  ShareSheet: this.shareSheet,
484
485
  Dialog: web_dialog_1.WebDialog,
485
486
  FolderPicker: this.folderPicker,
@@ -126,6 +126,8 @@ export interface WebExtensionsState {
126
126
  codeRenderers: Record<string, React.ComponentType<WebCodeRendererProps>>;
127
127
  /** By language, in lower case, how its blocks are said aloud (WebCodeRendererOptions.spoken): SpokenReply. */
128
128
  codeSpeech: BlockSpeech;
129
+ /** The languages whose renderers tell the parts of a block apart (WebCodeRendererOptions.pointable). */
130
+ codePointable: Readonly<Record<string, true>>;
129
131
  /** Who answers in calls in place of the conversation (WebExtensionAPI.registerCallPartner): the first registered. */
130
132
  callPartner?: WebCallPartner;
131
133
  /**
@@ -17,6 +17,7 @@ var WebExtensionsStateUtil;
17
17
  renderers: {},
18
18
  codeRenderers: {},
19
19
  codeSpeech: {},
20
+ codePointable: {},
20
21
  avatars: {},
21
22
  callMoves: [],
22
23
  chatIcons: [],
@@ -1,6 +1,6 @@
1
1
  import type { TaEvent } from '@celljs/ta-protocol';
2
2
  import type * as React from 'react';
3
- import type { WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebCodeMenu, WebComposerAddon, WebFileMenu, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebVoice, WidgetOptions } from './web-extension-api';
3
+ import type { WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebCodeMenu, WebCodeRendererOptions, WebComposerAddon, WebFileMenu, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebVoice, WidgetOptions } from './web-extension-api';
4
4
  import type { LoadedWebExtension, WebExtensionsState } from './web-extension-protocol';
5
5
  /** What an extension registered through its API: all of it goes when it stops. */
6
6
  export interface WebRegistrations {
@@ -11,7 +11,8 @@ export interface WebRegistrations {
11
11
  }>;
12
12
  renderers: Map<string, WebExtensionsState['renderers'][string]>;
13
13
  codeRenderers: Map<string, WebExtensionsState['codeRenderers'][string]>;
14
- codeSpeech: Map<string, WebExtensionsState['codeSpeech'][string]>;
14
+ /** By language, in lower case (WebCodeRendererOptions): how its blocks are said aloud, whether they can be pointed at. */
15
+ codeOptions: Map<string, WebCodeRendererOptions>;
15
16
  callPartners: WebCallPartner[];
16
17
  callMouths: WebCallMouth[];
17
18
  callMoves: WebCallMoves[];
@@ -69,6 +70,6 @@ export declare namespace WebExtensionRunUtil {
69
70
  */
70
71
  function voice(run: WebExtensionRun, voice: WebVoice): WebVoice;
71
72
  /** What the extensions that run registered, as the page shows it: the first of a message type or a tool name wins. */
72
- function collect(runs: readonly WebExtensionRun[], onOpen: (id: string) => boolean): Pick<WebExtensionsState, 'openers' | 'specificOpeners' | 'sessionMenus' | 'fileMenus' | 'codeMenus' | 'extensions' | 'views' | 'widgets' | 'composerAddons' | 'roomAddons' | 'settingsSections' | 'renderers' | 'codeRenderers' | 'codeSpeech' | 'callPartner' | 'callGroup' | 'callMouth' | 'callMoves' | 'avatars' | 'chatIcons' | 'chatTags' | 'initiatives' | 'tools' | 'toolRenderers' | 'searches'>;
73
+ function collect(runs: readonly WebExtensionRun[], onOpen: (id: string) => boolean): Pick<WebExtensionsState, 'openers' | 'specificOpeners' | 'sessionMenus' | 'fileMenus' | 'codeMenus' | 'extensions' | 'views' | 'widgets' | 'composerAddons' | 'roomAddons' | 'settingsSections' | 'renderers' | 'codeRenderers' | 'codeSpeech' | 'codePointable' | 'callPartner' | 'callGroup' | 'callMouth' | 'callMoves' | 'avatars' | 'chatIcons' | 'chatTags' | 'initiatives' | 'tools' | 'toolRenderers' | 'searches'>;
73
74
  }
74
75
  //# sourceMappingURL=web-extension-run.d.ts.map
@@ -24,7 +24,7 @@ var WebExtensionRunUtil;
24
24
  widgets: new Map(),
25
25
  renderers: new Map(),
26
26
  codeRenderers: new Map(),
27
- codeSpeech: new Map(),
27
+ codeOptions: new Map(),
28
28
  callPartners: [],
29
29
  callMouths: [],
30
30
  callMoves: [],
@@ -115,11 +115,12 @@ var WebExtensionRunUtil;
115
115
  WebExtensionRunUtil.voice = voice;
116
116
  /** What the extensions that run registered, as the page shows it: the first of a message type or a tool name wins. */
117
117
  function collect(runs, onOpen) {
118
- var _a;
119
- var _b, _c, _d;
118
+ var _a, _b;
119
+ var _c, _d, _e;
120
120
  const renderers = {};
121
121
  const codeRenderers = {};
122
122
  const codeSpeech = {};
123
+ const codePointable = {};
123
124
  const avatars = {};
124
125
  const tools = [];
125
126
  for (const run of runs) {
@@ -127,13 +128,18 @@ var WebExtensionRunUtil;
127
128
  avatars[run.loaded.name] = run.avatar;
128
129
  }
129
130
  for (const [type, renderer] of run.renderers) {
130
- (_b = renderers[type]) !== null && _b !== void 0 ? _b : (renderers[type] = renderer);
131
+ (_c = renderers[type]) !== null && _c !== void 0 ? _c : (renderers[type] = renderer);
131
132
  }
132
133
  for (const [language, renderer] of run.codeRenderers) {
133
- (_c = codeRenderers[language]) !== null && _c !== void 0 ? _c : (codeRenderers[language] = renderer);
134
+ if (!codeRenderers[language] && ((_a = run.codeOptions.get(language)) === null || _a === void 0 ? void 0 : _a.pointable)) {
135
+ codePointable[language] = true;
136
+ }
137
+ (_d = codeRenderers[language]) !== null && _d !== void 0 ? _d : (codeRenderers[language] = renderer);
134
138
  }
135
- for (const [language, spoken] of run.codeSpeech) {
136
- (_d = codeSpeech[language]) !== null && _d !== void 0 ? _d : (codeSpeech[language] = spoken);
139
+ for (const [language, options] of run.codeOptions) {
140
+ if (options.spoken) {
141
+ (_e = codeSpeech[language]) !== null && _e !== void 0 ? _e : (codeSpeech[language] = options.spoken);
142
+ }
137
143
  }
138
144
  for (const tool of run.tools) {
139
145
  if (!tools.some(other => other.name === tool.name)) {
@@ -182,8 +188,9 @@ var WebExtensionRunUtil;
182
188
  renderers,
183
189
  codeRenderers,
184
190
  codeSpeech,
191
+ codePointable,
185
192
  callPartner: runs.flatMap(run => run.callPartners)[0],
186
- callGroup: (_a = runs.find(run => run.callPartners.length)) === null || _a === void 0 ? void 0 : _a.loaded.name,
193
+ callGroup: (_b = runs.find(run => run.callPartners.length)) === null || _b === void 0 ? void 0 : _b.loaded.name,
187
194
  callMouth: runs.flatMap(run => run.callMouths)[0],
188
195
  callMoves: runs.flatMap(run => run.callMoves),
189
196
  avatars,
@@ -175,6 +175,15 @@ class WebExtensionsRunning {
175
175
  void this.allow(info).then(allowed => allowed && this.refresh());
176
176
  }
177
177
  const loads = await Promise.all(starting.map(info => this.loadPackage(info)));
178
+ // The tabs of the views of one that starts again (a new version of a work) open again once it has: its page
179
+ // drawn anew beside the conversation, not closed under the user. One started on open starts again for them.
180
+ const prefix = web_view_util_1.WebViewUtil.editorId('');
181
+ const renewed = (id) => {
182
+ const info = fresh.get(id);
183
+ return !!info && this.running.has(id) && !this.same(this.running.get(id), info) && (info.activation === 'open' || starting.includes(info));
184
+ };
185
+ const reopen = this.current.editors.filter(editor => editor.id.startsWith(prefix) && renewed(editor.extension));
186
+ const active = reopen.some(editor => editor.id === this.current.activeEditor) ? this.current.activeEditor : undefined;
178
187
  // Stopped only now, just before the new code starts: the views of the old one stay drawn until the next
179
188
  // publish, and stopped while the new code is read (after an update, over the relay) they would show
180
189
  // without the styles it took away.
@@ -197,6 +206,26 @@ class WebExtensionsRunning {
197
206
  this.placeholders = undefined;
198
207
  // The list of those started on open may have changed too.
199
208
  this.publish();
209
+ if (reopen.length > 0) {
210
+ // One in a sandbox registers its views as it starts: they are there to open once it did.
211
+ const ready = [...new Set(reopen.map(editor => editor.extension))].map(id => {
212
+ var _a;
213
+ const index = starting.findIndex(info => info.id === id);
214
+ const load = loads[index];
215
+ if (!load) {
216
+ return this.onDemand.ensure(fresh.get(id)).catch(() => undefined);
217
+ }
218
+ return 'factory' in load ? (_a = load.factory.ready) === null || _a === void 0 ? void 0 : _a.catch(() => undefined) : undefined;
219
+ });
220
+ void Promise.all(ready).then(() => {
221
+ for (const editor of reopen) {
222
+ this.openView(editor.id.slice(prefix.length), true);
223
+ }
224
+ if (active) {
225
+ this.tabs.show(active);
226
+ }
227
+ });
228
+ }
200
229
  changed = changed || stopped || starting.length > 0;
201
230
  await this.tabs.restore();
202
231
  return changed;
@@ -212,9 +241,10 @@ class WebExtensionsRunning {
212
241
  return false;
213
242
  }
214
243
  this.keptStarted = true;
215
- const infos = this.code
216
- .list(host)
217
- .filter(info => info.enabled !== false && info.activation !== 'open' && !this.running.has(info.id) && web_access_1.WebAccessUtil.granted(info) !== undefined);
244
+ const kept = this.code.list(host).filter(info => info.enabled !== false);
245
+ // Those started on open, in Quick open and on their links before the computer answers, or while it cannot.
246
+ const seeded = this.onDemand.seed(kept.filter(info => info.activation === 'open'));
247
+ const infos = kept.filter(info => info.activation !== 'open' && !this.running.has(info.id) && web_access_1.WebAccessUtil.granted(info) !== undefined);
218
248
  const loads = await Promise.all(infos.map(async (info) => {
219
249
  const code = await this.code.get(info.hash);
220
250
  return code === undefined ? undefined : this.factoryOf(info, code).catch(() => undefined);
@@ -227,10 +257,10 @@ class WebExtensionsRunning {
227
257
  started = true;
228
258
  }
229
259
  }
230
- if (started) {
260
+ if (started || seeded) {
231
261
  this.publish();
232
262
  }
233
- return started;
263
+ return started || seeded;
234
264
  }
235
265
  /** Whether what runs is that of the list: the same code, allowed as much. */
236
266
  same(run, info) {
@@ -256,13 +286,14 @@ class WebExtensionsRunning {
256
286
  }
257
287
  async askAccess(info) {
258
288
  var _a;
289
+ var _b;
259
290
  const language = this.settings.state.language;
260
291
  const say = (id) => (0, messages_1.message)(language, id);
261
- const access = (_a = info.access) !== null && _a !== void 0 ? _a : 'full';
292
+ const access = (_b = info.access) !== null && _b !== void 0 ? _b : 'full';
262
293
  const yes = await this.notices.confirm({
263
294
  title: say('ta.access.ask').replace('{name}', web_pages_1.WebPagesUtil.title(info, language)),
264
295
  message: [
265
- say(info.regrant ? 'ta.access.updated' : 'ta.access.new'),
296
+ say(info.regrant ? 'ta.access.updated' : ((_a = info.temporary) === null || _a === void 0 ? void 0 : _a.from) === 'agent' ? 'ta.access.agent' : 'ta.access.new'),
266
297
  say(`ta.access.${access}`),
267
298
  say('ta.access.from').replace('{source}', web_access_1.WebAccessUtil.source(info, say)),
268
299
  ].join('\n'),
@@ -42,6 +42,11 @@ export declare class WebOnDemand {
42
42
  get(id: string): TaWebExtensionInfo | undefined;
43
43
  /** Those of the server's list now; one an agent just made for the user is told of, with a way to open it. */
44
44
  set(infos: readonly TaWebExtensionInfo[]): void;
45
+ /**
46
+ * Those of the list of the last time, before the computer answers (or while it cannot): their pages open from the
47
+ * code the device keeps, as those started with the page do. The list of the computer replaces them.
48
+ */
49
+ seed(infos: readonly TaWebExtensionInfo[]): boolean;
45
50
  /** The extension started on open that a view id is of: its name, or `<its name>/<view>`. */
46
51
  find(viewId: string): TaWebExtensionInfo | undefined;
47
52
  /** Starts it unless it runs, once however often asked meanwhile. */
@@ -61,6 +61,17 @@ class WebOnDemand {
61
61
  }
62
62
  this.listed = true;
63
63
  }
64
+ /**
65
+ * Those of the list of the last time, before the computer answers (or while it cannot): their pages open from the
66
+ * code the device keeps, as those started with the page do. The list of the computer replaces them.
67
+ */
68
+ seed(infos) {
69
+ if (this.listed || this.infos.size > 0 || infos.length === 0) {
70
+ return false;
71
+ }
72
+ this.infos = new Map(infos.map(info => [info.id, info]));
73
+ return true;
74
+ }
64
75
  /** The extension started on open that a view id is of: its name, or `<its name>/<view>`. */
65
76
  find(viewId) {
66
77
  for (const info of this.infos.values()) {
@@ -79,6 +79,9 @@ export declare const ASSISTANT_EN: {
79
79
  'ta.task.branch': string;
80
80
  'ta.task.stopped': string;
81
81
  'ta.task.waiting': string;
82
+ 'ta.task.waitingPermission': string;
83
+ 'ta.task.waitingQuestion': string;
84
+ 'ta.task.waitingAuth': string;
82
85
  'ta.task.takenOver': string;
83
86
  'ta.task.takeOver': string;
84
87
  'ta.task.takeOverHint': string;
@@ -82,6 +82,9 @@ exports.ASSISTANT_EN = {
82
82
  'ta.task.branch': 'Branch {branch}',
83
83
  'ta.task.stopped': 'Stopped',
84
84
  'ta.task.waiting': 'Waiting for you',
85
+ 'ta.task.waitingPermission': 'Waiting for you to allow',
86
+ 'ta.task.waitingQuestion': 'Waiting for your answer',
87
+ 'ta.task.waitingAuth': 'Waiting for you to sign in',
85
88
  'ta.task.takenOver': 'You took it over',
86
89
  'ta.task.takeOver': 'Take over',
87
90
  'ta.task.takeOverHint': 'Go on with it yourself in the main area; the double stops following it',
@@ -180,6 +180,7 @@ export declare const CHAT_EN: {
180
180
  'ta.composer.keyboard': string;
181
181
  'ta.composer.steerTitle': string;
182
182
  'ta.composer.addImage': string;
183
+ 'ta.composer.addMedia': string;
183
184
  'ta.composer.album': string;
184
185
  'ta.composer.camera': string;
185
186
  'ta.composer.more': string;
@@ -183,6 +183,7 @@ exports.CHAT_EN = {
183
183
  'ta.composer.keyboard': 'Type instead',
184
184
  'ta.composer.steerTitle': 'Steer Ta (Enter); Alt+Enter queues a follow-up',
185
185
  'ta.composer.addImage': 'Add images',
186
+ 'ta.composer.addMedia': 'Add images or videos',
186
187
  'ta.composer.album': 'Album',
187
188
  'ta.composer.camera': 'Camera',
188
189
  'ta.composer.more': 'Add and settings',
@@ -10,6 +10,7 @@ export declare const COMMON_EN: {
10
10
  'ta.stop': string;
11
11
  'ta.copy': string;
12
12
  'ta.copied': string;
13
+ 'ta.point.hint': string;
13
14
  'ta.markdown.source': string;
14
15
  'ta.markdown.diagram': string;
15
16
  'ta.markdown.download': string;
@@ -13,6 +13,7 @@ exports.COMMON_EN = {
13
13
  'ta.stop': 'Stop',
14
14
  'ta.copy': 'Copy',
15
15
  'ta.copied': 'Copied',
16
+ 'ta.point.hint': 'Tap the part Ta should change',
16
17
  'ta.markdown.source': 'Source',
17
18
  'ta.markdown.diagram': 'Diagram',
18
19
  'ta.markdown.download': 'Download SVG',
@@ -60,6 +60,7 @@ export declare const DISCOVER_EN: {
60
60
  'ta.open.failed': string;
61
61
  'ta.access.ask': string;
62
62
  'ta.access.new': string;
63
+ 'ta.access.agent': string;
63
64
  'ta.access.updated': string;
64
65
  'ta.access.full': string;
65
66
  'ta.access.app': string;
@@ -67,6 +68,7 @@ export declare const DISCOVER_EN: {
67
68
  'ta.access.from': string;
68
69
  'ta.access.fromLink': string;
69
70
  'ta.access.fromMarket': string;
71
+ 'ta.access.fromAgent': string;
70
72
  'ta.access.allow': string;
71
73
  'ta.access.failed': string;
72
74
  'ta.search.pages': string;
@@ -64,6 +64,7 @@ exports.DISCOVER_EN = {
64
64
  'ta.open.failed': 'Could not open it',
65
65
  'ta.access.ask': 'Allow {name} to run?',
66
66
  'ta.access.new': 'It is not one you made: it runs once you allow it.',
67
+ 'ta.access.agent': 'Ta made it for you; it asks for more than a web page has, so it runs once you allow it.',
67
68
  'ta.access.updated': 'It changed since you allowed it: this version runs once you allow it again.',
68
69
  'ta.access.full': 'It asks for all Ta can do: read and write the files of this computer, run commands, read your conversations. Allow only what you trust.',
69
70
  'ta.access.app': 'It asks for its own pages and the notices, widgets and voice of Ta, not for your files or conversations.',
@@ -71,6 +72,7 @@ exports.DISCOVER_EN = {
71
72
  'ta.access.from': 'From: {source}.',
72
73
  'ta.access.fromLink': 'a link someone shared',
73
74
  'ta.access.fromMarket': 'the market',
75
+ 'ta.access.fromAgent': 'made by Ta for you',
74
76
  'ta.access.allow': 'Allow',
75
77
  'ta.access.failed': 'Could not allow it',
76
78
  'ta.search.pages': 'Pages',
@@ -70,7 +70,7 @@ exports.SERVICE_EN = {
70
70
  'ta.environment.stopDetail': 'It starts again when they connect; what runs in it stops now.',
71
71
  'ta.remote.addCloud': 'Enter the gateway',
72
72
  'ta.remote.cloudTitle': "Your company's Ta gateway",
73
- 'ta.remote.cloudDescription': 'Only when your company runs a Ta gateway. Without one, add a machine you reach by ssh above and turn on handover.',
73
+ 'ta.remote.cloudDescription': 'Only when your company runs a Ta gateway; otherwise, skip it.',
74
74
  'ta.remote.cloudUrl': 'Gateway address',
75
75
  'ta.remote.cloudToken': 'Access token',
76
76
  'ta.remote.cloudHint': 'The address is that of the web page of the gateway; make the token there in Settings, Environment, Use it from another Ta.',
@@ -78,15 +78,15 @@ exports.SERVICE_EN = {
78
78
  'ta.remote.cloudAdded': '{name} added: pick it in the folder picker',
79
79
  'ta.remote.openCloud': 'Open its Ta',
80
80
  'ta.remote.openCloudHint': 'The whole Ta there, its agent in the cloud too',
81
- 'ta.remote.madeCloud': 'Handover is on: while this computer is away, conversations go on on {host}',
81
+ 'ta.remote.madeCloud': 'On: while this computer is away, conversations go on on {host}',
82
82
  'ta.remote.network': 'Network',
83
83
  'ta.remote.portLocal': 'Forwarded to localhost:{port} here',
84
84
  'ta.remote.relay': 'Go on here while this computer is away',
85
85
  'ta.remote.relay.off': 'Keeps Ta running here: when this computer closes its lid or runs low, conversations go on here.',
86
86
  'ta.remote.relay.on': 'When the lid closes, the computer sleeps or its battery runs low, running conversations go on here, and come back when it returns.',
87
- 'ta.remote.relay.stopTitle': 'Stop handing over to {host}?',
87
+ 'ta.remote.relay.stopTitle': 'Stop moving conversations to {host}?',
88
88
  'ta.remote.relay.stopHint': 'Ta stays installed there. Take back the conversations that went there first.',
89
- 'ta.remote.relay.stop': 'Turn off handover',
89
+ 'ta.remote.relay.stop': 'Turn off',
90
90
  'ta.remote.network.off': 'Off (recommended)',
91
91
  'ta.remote.network.common': 'Package sources only',
92
92
  'ta.remote.network.open': 'Anywhere',
@@ -117,7 +117,7 @@ exports.SERVICE_EN = {
117
117
  'ta.remote.local': 'This computer',
118
118
  'ta.remote.add': 'Add a host',
119
119
  'ta.remote.addConfirm': 'Add',
120
- 'ta.remote.addHint': 'A Host of ~/.ssh/config, user@host:port, or an ssh command',
120
+ 'ta.remote.addHint': 'Host name, user@host, or ssh command',
121
121
  'ta.remote.connected': 'Connected',
122
122
  'ta.remote.failed': 'Cannot connect to {host}',
123
123
  'ta.relays.title': 'Relays',
@@ -211,7 +211,7 @@ exports.SERVICE_EN = {
211
211
  '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.',
212
212
  'ta.relays.storeAdd': 'Add and sync there',
213
213
  'ta.remote.title': 'Remote hosts',
214
- 'ta.remote.description': 'Conversations can work in directories of these machines. On one with handover on, they go on there while this computer is away.',
214
+ 'ta.remote.description': 'Conversations can work in directories of these machines, and move there to go on when this computer closes its lid or runs out of power.',
215
215
  'ta.remote.none': 'No hosts yet',
216
216
  'ta.remote.noneHint': 'Add one above: conversations then work in its directories over ssh',
217
217
  'ta.remote.invalid': '{host} names no host: write a Host of ~/.ssh/config, user@host:port, or ssh user@host -p port.',
@@ -81,6 +81,9 @@ exports.ASSISTANT_JA = {
81
81
  'ta.task.branch': 'ブランチ {branch}',
82
82
  'ta.task.stopped': '停止',
83
83
  'ta.task.waiting': 'あなたの対応が必要',
84
+ 'ta.task.waitingPermission': '許可を待っています',
85
+ 'ta.task.waitingQuestion': '回答を待っています',
86
+ 'ta.task.waitingAuth': 'サインインを待っています',
84
87
  'ta.task.takenOver': 'あなたが対応しました',
85
88
  'ta.task.takeOver': '対応する',
86
89
  'ta.task.takeOverHint': 'メインエリアで対応し続けます。分身は追従を中止します。',
@@ -182,6 +182,7 @@ exports.CHAT_JA = {
182
182
  'ta.composer.keyboard': 'キーボードに切り替え',
183
183
  'ta.composer.steerTitle': 'Ta を操舵(Enter)。Alt+Enter でフォローアップをキューに入れます',
184
184
  'ta.composer.addImage': '画像を追加',
185
+ 'ta.composer.addMedia': '画像・動画を追加',
185
186
  'ta.composer.album': 'アルバム',
186
187
  'ta.composer.camera': 'カメラ',
187
188
  'ta.composer.more': '追加と設定',
@@ -12,6 +12,7 @@ exports.COMMON_JA = {
12
12
  'ta.stop': '停止',
13
13
  'ta.copy': 'コピー',
14
14
  'ta.copied': 'コピーしました',
15
+ 'ta.point.hint': 'Ta に直してほしい所をタップ',
15
16
  'ta.markdown.source': 'ソースコード',
16
17
  'ta.markdown.diagram': '図',
17
18
  'ta.markdown.download': 'SVG をダウンロード',
@@ -62,6 +62,7 @@ exports.DISCOVER_JA = {
62
62
  'ta.open.failed': '開けませんでした',
63
63
  'ta.access.ask': '「{name}」の実行を許可しますか?',
64
64
  'ta.access.new': 'あなたが作ったものではないため、許可すると実行されます。',
65
+ 'ta.access.agent': 'Ta があなたのために作ったものですが、ウェブページ以上の機能を求めているため、許可すると実行されます。',
65
66
  'ta.access.updated': '許可した後に更新されました。この版は再度許可すると実行されます。',
66
67
  'ta.access.full': 'Ta のすべての機能を求めています:このパソコンのファイルの読み書き、コマンドの実行、会話の閲覧。信頼できるものだけ許可してください。',
67
68
  'ta.access.app': '自分のページと、Ta の通知・ウィジェット・音声だけを求めています。ファイルや会話は求めていません。',
@@ -69,6 +70,7 @@ exports.DISCOVER_JA = {
69
70
  'ta.access.from': '提供元:{source}。',
70
71
  'ta.access.fromLink': '誰かが共有したリンク',
71
72
  'ta.access.fromMarket': 'マーケット',
73
+ 'ta.access.fromAgent': 'Ta があなたのために作ったもの',
72
74
  'ta.access.allow': '許可',
73
75
  'ta.access.failed': '許可できませんでした',
74
76
  'ta.search.pages': 'ページ',
@@ -67,7 +67,7 @@ exports.SERVICE_JA = {
67
67
  'ta.environment.stopDetail': '再び接続すると再び起動します。実行中のものはすぐに停止します。',
68
68
  'ta.remote.addCloud': 'ゲートウェイを入力',
69
69
  'ta.remote.cloudTitle': '会社の Ta ゲートウェイ',
70
- 'ta.remote.cloudDescription': '会社が Ta ゲートウェイを運用している場合だけ必要です。ない場合は、上で ssh できるマシンを追加して引き継ぎをオンにします。',
70
+ 'ta.remote.cloudDescription': '会社が Ta ゲートウェイを運用している場合だけ必要です。なければ不要です。',
71
71
  'ta.remote.cloudUrl': 'ゲートウェイのアドレス',
72
72
  'ta.remote.cloudToken': 'アクセストークン',
73
73
  'ta.remote.cloudHint': 'アドレスはゲートウェイの Web ページのアドレスです。トークンはそのページの 設定 → 実行環境 → 他の Ta から使う で作成します。',
@@ -75,15 +75,15 @@ exports.SERVICE_JA = {
75
75
  'ta.remote.cloudAdded': '{name} を追加しました。フォルダ選択で選べます',
76
76
  'ta.remote.openCloud': 'クラウドの Ta を開く',
77
77
  'ta.remote.openCloudHint': 'エージェントも含めて Ta 全体がクラウドで動きます',
78
- 'ta.remote.madeCloud': '引き継ぎをオンにしました:パソコンを離れている間、会話は {host} で続きます',
78
+ 'ta.remote.madeCloud': 'オンにしました:パソコンを離れている間、会話は {host} で続きます',
79
79
  'ta.remote.network': 'ネットワーク',
80
80
  'ta.remote.portLocal': 'このパソコンの localhost:{port} に転送済み',
81
81
  'ta.remote.relay': 'パソコンを離れている間ここで続ける',
82
82
  'ta.remote.relay.off': 'ここに Ta を常駐させます。パソコンを閉じたり電池が少なくなったりすると、会話はここで続きます。',
83
83
  'ta.remote.relay.on': 'ふたを閉じた、スリープした、電池が少ないときに、実行中の会話はここで続き、戻ると自動で引き戻します。',
84
- 'ta.remote.relay.stopTitle': '{host} への引き継ぎをやめますか?',
84
+ 'ta.remote.relay.stopTitle': '{host} で続けるのをやめますか?',
85
85
  'ta.remote.relay.stopHint': 'そのマシンの Ta はそのまま残ります。そちらに移った会話は、先にこのパソコンへ引き戻してください。',
86
- 'ta.remote.relay.stop': '引き継ぎをオフ',
86
+ 'ta.remote.relay.stop': 'オフにする',
87
87
  'ta.remote.network.off': 'オフ(おすすめ)',
88
88
  'ta.remote.network.common': 'パッケージ配布元のみ',
89
89
  'ta.remote.network.open': '制限なし',
@@ -114,7 +114,7 @@ exports.SERVICE_JA = {
114
114
  'ta.remote.local': 'このコンピュータ',
115
115
  'ta.remote.add': 'ホストを追加',
116
116
  'ta.remote.addConfirm': '追加',
117
- 'ta.remote.addHint': '~/.ssh/config のホスト、user@host:port、または ssh コマンド',
117
+ 'ta.remote.addHint': 'ホスト名、user@host、ssh コマンド',
118
118
  'ta.remote.connected': '接続済み',
119
119
  'ta.remote.failed': '{host} に接続できません',
120
120
  'ta.relays.title': 'リレー',
@@ -208,7 +208,7 @@ exports.SERVICE_JA = {
208
208
  'ta.relays.storeNote': 'Ta が先に試します:小さいファイルを書き込んで削除します。同期が保存する内容はこのパソコンで既に暗号化されています。パスワードはこのパソコンの relays.json にのみ保存されます。',
209
209
  'ta.relays.storeAdd': '追加して同期に使用',
210
210
  'ta.remote.title': 'リモートホスト',
211
- 'ta.remote.description': '会話はこれらのマシンのディレクトリで動作できます。引き継ぎをオンにしたマシンでは、パソコンを離れている間も会話が続きます。',
211
+ 'ta.remote.description': '会話はこれらのマシンのディレクトリで動作できます。パソコンを閉じたり電池が切れたりしたときは、そこへ移って続けることもできます。',
212
212
  'ta.remote.none': 'ホストはまだありません',
213
213
  'ta.remote.noneHint': '上で追加するとホストのディレクトリで ssh 経由で会話が動作します',
214
214
  'ta.remote.invalid': '{host} はホストではありません:~/.ssh/config の Host、user@host:port、または ssh user@host -p ポート を入力してください。',