@celljs/ta-web 4.24.1 → 4.26.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 (193) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/account/account-side.js +3 -1
  4. package/esm/browser/assistant/assistant-task-source.js +3 -1
  5. package/esm/browser/assistant/assistant-thread.d.ts +5 -2
  6. package/esm/browser/assistant/assistant-thread.js +70 -46
  7. package/esm/browser/assistant/assistant-view.js +9 -3
  8. package/esm/browser/components/account-menu.d.ts +2 -1
  9. package/esm/browser/components/account-menu.js +12 -3
  10. package/esm/browser/components/app-nav.js +5 -5
  11. package/esm/browser/components/chat-asks.js +16 -1
  12. package/esm/browser/components/chat-home.d.ts +7 -2
  13. package/esm/browser/components/chat-home.js +2 -2
  14. package/esm/browser/components/chat-icon.d.ts +6 -1
  15. package/esm/browser/components/chat-icon.js +45 -4
  16. package/esm/browser/components/chat-list-hooks.d.ts +10 -0
  17. package/esm/browser/components/chat-list-hooks.js +15 -0
  18. package/esm/browser/components/chat-list.js +7 -9
  19. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  20. package/esm/browser/components/composer-addon-util.d.ts +5 -0
  21. package/esm/browser/components/composer-addon-util.js +17 -0
  22. package/esm/browser/components/composer-addons.d.ts +3 -1
  23. package/esm/browser/components/composer-addons.js +5 -2
  24. package/esm/browser/components/editor-actions.d.ts +10 -0
  25. package/esm/browser/components/editor-actions.js +13 -0
  26. package/esm/browser/components/editor-area.js +8 -4
  27. package/esm/browser/components/fold-text.d.ts +4 -2
  28. package/esm/browser/components/fold-text.js +5 -4
  29. package/esm/browser/components/host-view.d.ts +1 -1
  30. package/esm/browser/components/image-swipe.d.ts +20 -0
  31. package/esm/browser/components/image-swipe.js +75 -0
  32. package/esm/browser/components/image-viewer.d.ts +2 -2
  33. package/esm/browser/components/image-viewer.js +2 -2
  34. package/esm/browser/components/message-footer.d.ts +2 -2
  35. package/esm/browser/components/message-footer.js +2 -2
  36. package/esm/browser/components/message-list.d.ts +12 -0
  37. package/esm/browser/components/message-list.js +31 -18
  38. package/esm/browser/components/message-user.js +5 -3
  39. package/esm/browser/components/nav-places.d.ts +2 -1
  40. package/esm/browser/components/nav-places.js +3 -2
  41. package/esm/browser/components/relay-services.d.ts +1 -1
  42. package/esm/browser/components/relay-services.js +11 -91
  43. package/esm/browser/components/said-text.d.ts +6 -2
  44. package/esm/browser/components/said-text.js +8 -2
  45. package/esm/browser/components/serve-restart.d.ts +11 -2
  46. package/esm/browser/components/serve-restart.js +64 -3
  47. package/esm/browser/components/session-view.js +3 -2
  48. package/esm/browser/components/settings-more.js +7 -4
  49. package/esm/browser/components/workbench-tabs.d.ts +4 -2
  50. package/esm/browser/components/workbench-tabs.js +5 -3
  51. package/esm/browser/extension/extension-view.d.ts +9 -1
  52. package/esm/browser/extension/extension-view.js +12 -1
  53. package/esm/browser/extension/icons.js +10 -1
  54. package/esm/browser/extension/web-api-contributions.d.ts +19 -14
  55. package/esm/browser/extension/web-api-editors.d.ts +32 -0
  56. package/esm/browser/extension/web-api-editors.js +2 -0
  57. package/esm/browser/extension/web-api-menus.d.ts +40 -0
  58. package/esm/browser/extension/web-api-menus.js +2 -0
  59. package/esm/browser/extension/web-api-partners.d.ts +6 -0
  60. package/esm/browser/extension/web-extension-api.d.ts +9 -26
  61. package/esm/browser/extension/web-extension-context.js +5 -9
  62. package/esm/browser/extension/web-extension-protocol.d.ts +3 -1
  63. package/esm/browser/extension/web-extension-protocol.js +1 -0
  64. package/esm/browser/extension/web-extension-run.d.ts +5 -2
  65. package/esm/browser/extension/web-extension-run.js +15 -0
  66. package/esm/browser/extension/web-home.js +8 -0
  67. package/esm/browser/extension/web-session-notices.js +8 -0
  68. package/esm/browser/i18n/locales.d.ts +12 -1
  69. package/esm/browser/i18n/messages-ja.js +13 -2
  70. package/esm/browser/i18n/messages-zh-tw.js +13 -2
  71. package/esm/browser/i18n/messages.d.ts +11 -0
  72. package/esm/browser/i18n/messages.js +27 -5
  73. package/esm/browser/notices/chime.d.ts +16 -0
  74. package/esm/browser/notices/chime.js +67 -0
  75. package/esm/browser/notices/session-notices.d.ts +8 -0
  76. package/esm/browser/notices/session-notices.js +23 -2
  77. package/esm/browser/share/shared-page.js +2 -1
  78. package/esm/browser/style/base.d.ts +1 -1
  79. package/esm/browser/style/base.js +5 -3
  80. package/esm/browser/style/conversation-column.d.ts +1 -1
  81. package/esm/browser/style/conversation-column.js +2 -2
  82. package/esm/browser/style/device.js +2 -2
  83. package/esm/browser/style/layout.d.ts +1 -1
  84. package/esm/browser/style/layout.js +9 -1
  85. package/esm/browser/style/shared.d.ts +1 -1
  86. package/esm/browser/style/shared.js +1 -0
  87. package/esm/browser/style/shell.d.ts +1 -1
  88. package/esm/browser/style/shell.js +7 -4
  89. package/esm/browser/style/tasks.d.ts +1 -1
  90. package/esm/browser/style/tasks.js +1 -1
  91. package/esm/browser/util/image-swipe.d.ts +14 -3
  92. package/esm/browser/util/image-swipe.js +26 -3
  93. package/esm/browser/util/process.d.ts +5 -0
  94. package/esm/browser/util/process.js +22 -1
  95. package/esm/browser/workbench-protocol.d.ts +5 -0
  96. package/esm/browser/workbench.d.ts +1 -0
  97. package/esm/browser/workbench.js +20 -0
  98. package/lib/browser/account/account-side.js +3 -1
  99. package/lib/browser/assistant/assistant-task-source.js +3 -1
  100. package/lib/browser/assistant/assistant-thread.d.ts +5 -2
  101. package/lib/browser/assistant/assistant-thread.js +70 -46
  102. package/lib/browser/assistant/assistant-view.js +8 -2
  103. package/lib/browser/components/account-menu.d.ts +2 -1
  104. package/lib/browser/components/account-menu.js +10 -1
  105. package/lib/browser/components/app-nav.js +4 -4
  106. package/lib/browser/components/chat-asks.js +16 -1
  107. package/lib/browser/components/chat-home.d.ts +7 -2
  108. package/lib/browser/components/chat-home.js +2 -2
  109. package/lib/browser/components/chat-icon.d.ts +6 -1
  110. package/lib/browser/components/chat-icon.js +45 -4
  111. package/lib/browser/components/chat-list-hooks.d.ts +10 -0
  112. package/lib/browser/components/chat-list-hooks.js +16 -0
  113. package/lib/browser/components/chat-list.js +6 -8
  114. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  115. package/lib/browser/components/composer-addon-util.d.ts +5 -0
  116. package/lib/browser/components/composer-addon-util.js +17 -0
  117. package/lib/browser/components/composer-addons.d.ts +3 -1
  118. package/lib/browser/components/composer-addons.js +5 -2
  119. package/lib/browser/components/editor-actions.d.ts +11 -0
  120. package/lib/browser/components/editor-actions.js +50 -0
  121. package/lib/browser/components/editor-area.js +7 -3
  122. package/lib/browser/components/fold-text.d.ts +4 -2
  123. package/lib/browser/components/fold-text.js +5 -4
  124. package/lib/browser/components/host-view.d.ts +1 -1
  125. package/lib/browser/components/image-swipe.d.ts +20 -0
  126. package/lib/browser/components/image-swipe.js +75 -0
  127. package/lib/browser/components/image-viewer.d.ts +2 -2
  128. package/lib/browser/components/image-viewer.js +2 -2
  129. package/lib/browser/components/message-footer.d.ts +2 -2
  130. package/lib/browser/components/message-footer.js +3 -4
  131. package/lib/browser/components/message-list.d.ts +12 -0
  132. package/lib/browser/components/message-list.js +32 -18
  133. package/lib/browser/components/message-user.js +5 -3
  134. package/lib/browser/components/nav-places.d.ts +2 -1
  135. package/lib/browser/components/nav-places.js +3 -2
  136. package/lib/browser/components/relay-services.d.ts +1 -1
  137. package/lib/browser/components/relay-services.js +9 -89
  138. package/lib/browser/components/said-text.d.ts +6 -2
  139. package/lib/browser/components/said-text.js +8 -2
  140. package/lib/browser/components/serve-restart.d.ts +11 -2
  141. package/lib/browser/components/serve-restart.js +64 -3
  142. package/lib/browser/components/session-view.js +3 -2
  143. package/lib/browser/components/settings-more.js +7 -4
  144. package/lib/browser/components/workbench-tabs.d.ts +4 -2
  145. package/lib/browser/components/workbench-tabs.js +5 -3
  146. package/lib/browser/extension/extension-view.d.ts +9 -1
  147. package/lib/browser/extension/extension-view.js +12 -0
  148. package/lib/browser/extension/icons.js +9 -0
  149. package/lib/browser/extension/web-api-contributions.d.ts +19 -14
  150. package/lib/browser/extension/web-api-editors.d.ts +33 -0
  151. package/lib/browser/extension/web-api-editors.js +3 -0
  152. package/lib/browser/extension/web-api-menus.d.ts +41 -0
  153. package/lib/browser/extension/web-api-menus.js +3 -0
  154. package/lib/browser/extension/web-api-partners.d.ts +6 -0
  155. package/lib/browser/extension/web-extension-api.d.ts +9 -26
  156. package/lib/browser/extension/web-extension-context.js +5 -9
  157. package/lib/browser/extension/web-extension-protocol.d.ts +3 -1
  158. package/lib/browser/extension/web-extension-protocol.js +1 -0
  159. package/lib/browser/extension/web-extension-run.d.ts +5 -2
  160. package/lib/browser/extension/web-extension-run.js +15 -0
  161. package/lib/browser/extension/web-home.js +8 -0
  162. package/lib/browser/extension/web-session-notices.js +8 -0
  163. package/lib/browser/i18n/locales.d.ts +12 -1
  164. package/lib/browser/i18n/messages-ja.js +13 -2
  165. package/lib/browser/i18n/messages-zh-tw.js +13 -2
  166. package/lib/browser/i18n/messages.d.ts +11 -0
  167. package/lib/browser/i18n/messages.js +27 -5
  168. package/lib/browser/notices/chime.d.ts +17 -0
  169. package/lib/browser/notices/chime.js +71 -0
  170. package/lib/browser/notices/session-notices.d.ts +8 -0
  171. package/lib/browser/notices/session-notices.js +23 -2
  172. package/lib/browser/share/shared-page.js +2 -1
  173. package/lib/browser/style/base.d.ts +1 -1
  174. package/lib/browser/style/base.js +5 -3
  175. package/lib/browser/style/conversation-column.d.ts +1 -1
  176. package/lib/browser/style/conversation-column.js +2 -2
  177. package/lib/browser/style/device.js +2 -2
  178. package/lib/browser/style/layout.d.ts +1 -1
  179. package/lib/browser/style/layout.js +9 -1
  180. package/lib/browser/style/shared.d.ts +1 -1
  181. package/lib/browser/style/shared.js +1 -0
  182. package/lib/browser/style/shell.d.ts +1 -1
  183. package/lib/browser/style/shell.js +7 -4
  184. package/lib/browser/style/tasks.d.ts +1 -1
  185. package/lib/browser/style/tasks.js +1 -1
  186. package/lib/browser/util/image-swipe.d.ts +14 -3
  187. package/lib/browser/util/image-swipe.js +26 -3
  188. package/lib/browser/util/process.d.ts +5 -0
  189. package/lib/browser/util/process.js +22 -1
  190. package/lib/browser/workbench-protocol.d.ts +5 -0
  191. package/lib/browser/workbench.d.ts +1 -0
  192. package/lib/browser/workbench.js +20 -0
  193. package/package.json +7 -7
@@ -64,6 +64,12 @@ export interface WebComposerAddon {
64
64
  above?: React.ComponentType<{
65
65
  conversation: WebConversation;
66
66
  }>;
67
+ /**
68
+ * What a conversation of the extension's own shows before anything is said in it, in place of Ta's (an assistant's
69
+ * face, what it does, what to start with); undefined for the others. Asked as the conversation is drawn: answer at
70
+ * once. Newer than some Ta apps, which show their own.
71
+ */
72
+ empty?(conversation: WebConversation): React.ReactNode | undefined;
67
73
  }
68
74
  /**
69
75
  * An app of the rooms of Ta (WebExtensionAPI.registerRoomAddon), which the Rooms page draws as its own: a tile among the
@@ -102,6 +108,8 @@ export interface WebRoomAddonEntry {
102
108
  export interface WebEditor {
103
109
  id: string;
104
110
  title: WebLabel;
111
+ /** What its tab says under a pointer, such as the path of a file; its title when none. */
112
+ tooltip?: WebLabel;
105
113
  icon?: WebIcon;
106
114
  render: React.ComponentType;
107
115
  /** The user closed the tab. */
@@ -125,7 +133,12 @@ export type WebViewLocation = 'page' | 'sidebar' | 'panel' | 'launcher' | 'board
125
133
  * what they post), `work` (what Ta does for the user: scheduled tasks, its proposals, bots), `share` (what the user
126
134
  * shares, who is let in), `more` (the rest).
127
135
  */
128
- export type WebPageGroup = 'people' | 'work' | 'share' | 'more';
136
+ /**
137
+ * Where a page is listed: a group of Discover (`people`, `work`, `share`, `more`), or `me`, among the entries of Me (the
138
+ * last tab of a phone; the menu of the account elsewhere), for what is the user's own (their feedback), never in the
139
+ * navigation nor under Discover. Older Ta apps list a page of `me` under Discover's `more`.
140
+ */
141
+ export type WebPageGroup = 'people' | 'work' | 'share' | 'more' | 'me';
129
142
  export interface WebView {
130
143
  title: WebLabel;
131
144
  render: React.ComponentType;
@@ -157,7 +170,7 @@ export interface WebView {
157
170
  * which the navigation then leaves out, since the view lists them.
158
171
  */
159
172
  pages?: string[];
160
- /** A page under Discover: the group it is listed in there; default `more`. Newer than some Ta apps. */
173
+ /** A page under Discover: the group it is listed in there, default `more`; `me`, an entry of Me instead. Newer than some Ta apps. */
161
174
  group?: WebPageGroup;
162
175
  /**
163
176
  * `false`: a page only shown by something else (a room of its kind, a link, a row of its settings), never in the
@@ -332,6 +345,8 @@ export interface WebMenuItem {
332
345
  disabled?: boolean;
333
346
  /** Cannot be undone, as delete: drawn in red. */
334
347
  danger?: boolean;
348
+ /** One of a choice (a status, a sort): the one chosen is checked on the right. Newer than some Ta apps. */
349
+ checked?: boolean;
335
350
  run(): void;
336
351
  }
337
352
  /** A view of any web extension, as `ui.useView` sees it. */
@@ -540,6 +555,8 @@ export interface WebSessionNotice {
540
555
  * extension shows it on the page itself, so the page tells of it only by a notice of the system while away.
541
556
  */
542
557
  view?: string;
558
+ /** The user wants to hear it: the page plays a short tone, not of what they look at (SessionNoticeUtil.audible). */
559
+ sound?: boolean;
543
560
  }
544
561
  /** Lines and columns of a file, from 1: a line, a place in it, or a range. */
545
562
  export interface TextSelection {
@@ -574,16 +591,4 @@ export interface WebOpenerOptions {
574
591
  */
575
592
  specific?: boolean;
576
593
  }
577
- /** A conversation as a list shows it: an open one has its session, one kept on the disk its file only. */
578
- export interface WebSessionRef {
579
- sessionId?: string;
580
- sessionFile?: string;
581
- cwd: string;
582
- /** As the list names it. */
583
- title: string;
584
- /** TaSessionInfo.group. */
585
- group?: string;
586
- }
587
- /** The entries an extension adds to the menu of a conversation of a list (registerSessionMenu); none for some. */
588
- export type WebSessionMenu = (session: WebSessionRef) => WebMenuItem[];
589
594
  //# sourceMappingURL=web-api-contributions.d.ts.map
@@ -0,0 +1,33 @@
1
+ import type * as React from 'react';
2
+ import type { WebEditor } from './web-api-contributions';
3
+ /** The tabs of the workbench beside the conversation, as an extension opens them and draws their tools. */
4
+ export interface WebEditorsUI {
5
+ /**
6
+ * A tab in the editor area beside the conversation (a file, a diff, a browser); an open id is shown
7
+ * again. With `preserveFocus`, it opens behind the tab shown, and the workbench is not revealed: for
8
+ * tabs opened again when the page loads. With `preview`, as a single click in an IDE: its title is in
9
+ * italics, and the next tab opened as a preview takes its place, until it is pinned (`pinEditor`, or a
10
+ * double click on it); opening it again without `preview` pins it too.
11
+ */
12
+ openEditor(editor: WebEditor, options?: {
13
+ preserveFocus?: boolean;
14
+ preview?: boolean;
15
+ }): void;
16
+ closeEditor(id: string): void;
17
+ /** Keeps a tab opened as a preview: the next preview opens beside it. */
18
+ pinEditor(id: string): void;
19
+ /** Marks a tab as changed and not saved: a dot in place of its close button, and the user is asked before closing it. Dirty tabs are pinned. */
20
+ setEditorDirty(id: string, dirty: boolean): void;
21
+ /** A React hook: the id of the tab shown in the workbench, whoever opened it. */
22
+ useActiveEditor(): string | undefined;
23
+ /**
24
+ * The tools of the tab it is drawn in (by the `render` of `openEditor`): put in the head of the workbench beside
25
+ * the tabs while the tab is shown, as the actions of an editor's title in an IDE: a few icon buttons (a preview or
26
+ * its text, saving, going through the changes of a diff) and a short note. A tab needs no head of its own over
27
+ * what it shows: its tab already names it. Nothing elsewhere.
28
+ */
29
+ readonly EditorActions: React.ComponentType<{
30
+ children?: React.ReactNode;
31
+ }>;
32
+ }
33
+ //# sourceMappingURL=web-api-editors.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=web-api-editors.js.map
@@ -0,0 +1,41 @@
1
+ /** Part of the web extension API (web-extension-api.ts, which exports it all): the entries extensions add to menus of the page. */
2
+ import type { WebMenuItem } from './web-api-contributions';
3
+ /** A conversation as a list shows it: an open one has its session, one kept on the disk its file only. */
4
+ export interface WebSessionRef {
5
+ sessionId?: string;
6
+ sessionFile?: string;
7
+ cwd: string;
8
+ /** As the list names it. */
9
+ title: string;
10
+ /** TaSessionInfo.group. */
11
+ group?: string;
12
+ }
13
+ /** The entries an extension adds to the menu of a conversation of a list (registerSessionMenu); none for some. */
14
+ export type WebSessionMenu = (session: WebSessionRef) => WebMenuItem[];
15
+ /** A file or a folder of a workspace, as a list of files (the explorer) shows it. */
16
+ export interface WebFileRef {
17
+ /** The directory of the workspace: a path, or `ssh://…` (TaLocation). */
18
+ cwd: string;
19
+ /** Relative to `cwd`, with `/`. */
20
+ path: string;
21
+ name: string;
22
+ kind: 'file' | 'directory';
23
+ size?: number;
24
+ }
25
+ /** The entries an extension adds to the menu of a file or a folder of a list of files (registerFileMenu); none for some. */
26
+ export type WebFileMenu = (file: WebFileRef) => WebMenuItem[];
27
+ /** What a web extension adds to the menus of the page (WebExtensionAPI extends it). */
28
+ export interface WebMenus {
29
+ /**
30
+ * Entries of the menu of a conversation where a list shows it (a right click or a held finger on its row), in a
31
+ * section of their own after Ta's: read each time the menu opens.
32
+ */
33
+ registerSessionMenu(menu: WebSessionMenu): void;
34
+ /**
35
+ * Entries of the menu of a file or a folder where a list of files shows it (the explorer: a right click or a held
36
+ * finger on its row), in a section of their own: read each time the menu opens. Newer than some Ta apps:
37
+ * `pi.registerFileMenu?.(…)`.
38
+ */
39
+ registerFileMenu(menu: WebFileMenu): void;
40
+ }
41
+ //# sourceMappingURL=web-api-menus.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=web-api-menus.js.map
@@ -109,6 +109,12 @@ export interface WebPartnersUI {
109
109
  * partners picked already (the friend of a chat of two). Newer than some Ta apps: `pi.ui.startGroup?.(…)`.
110
110
  */
111
111
  startGroup(partner?: string): void;
112
+ /**
113
+ * Opens a partner of any extension by its id (a group chat's: its room id), as its row does: false when there is none
114
+ * (its extension not loaded). For an extension that works in a group chat it did not make (a class's). Newer than some
115
+ * Ta apps: `pi.ui.openPartner?.(…)`.
116
+ */
117
+ openPartner(id: string, kind?: WebPartnerKind): Promise<boolean>;
112
118
  }
113
119
  /** A partner as the page lists it. */
114
120
  export interface WebPartnerEntry extends WebPartner {
@@ -7,9 +7,11 @@ import type { Game3DProps } from '../game/game3d-protocol';
7
7
  import type { ScreenPartSpec, TaScreen } from '../screen/screen-protocol';
8
8
  import type { Language, Theme } from '../settings/settings-protocol';
9
9
  import type { CodeEditorProps, DiffEditorProps, WebChatImagesProps, WebComposerProps, WebConversationViewProps, WebDialogProps, WebEmptyProps, WebFaceProps, WebFolderPickerProps, WebFullScreenProps, WebGroupFaceProps, WebHoldToTalkProps, WebImageViewerProps, WebLoadingProps, WebModelPickerProps, WebPictureCardsProps, WebPictureProps, WebSelectBarProps, WebSelectCheckProps, WebShareSheetProps, WebStackProps, WebSwipeRowProps, WebSwitchProps, WebTaskIconProps, WebVoice } from './web-api-components';
10
- import type { WebAsk, WebCallPartner, WebChatIconSource, WebCodeRendererOptions, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebEditor, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebOpenerOptions, WebRoomAddon, WebRoomAddonEntry, WebSearchSource, WebSessionMenu, WebSessionNotice, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions';
10
+ import type { WebAsk, WebCallPartner, WebChatIconSource, WebCodeRendererOptions, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebOpenerOptions, WebRoomAddon, WebRoomAddonEntry, WebSearchSource, WebSessionNotice, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions';
11
11
  import type { WebDesktop, WebFileDrag } from './web-api-desktop';
12
+ import type { WebEditorsUI } from './web-api-editors';
12
13
  import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home';
14
+ import type { WebFileRef, WebMenus } from './web-api-menus';
13
15
  import type { WebServices } from './web-api-services';
14
16
  import type { WebTerminal, WebTerminalOptions } from './web-api-terminal';
15
17
  import type { WebPageInfo } from './web-pages';
@@ -22,7 +24,9 @@ export type { Language, Theme } from '../settings/settings-protocol';
22
24
  export type * from './web-api-components';
23
25
  export type * from './web-api-contributions';
24
26
  export type * from './web-api-desktop';
27
+ export type * from './web-api-editors';
25
28
  export type * from './web-api-home';
29
+ export type * from './web-api-menus';
26
30
  export type * from './web-api-services';
27
31
  export type * from './web-api-terminal';
28
32
  export type { WebPageInfo, WebPageState } from './web-pages';
@@ -31,7 +35,7 @@ export type { WebPageInfo, WebPageState } from './web-pages';
31
35
  * the two mean the same. A web extension is one ES module without imports, the `web` part of a pi
32
36
  * package (see TaWebExtensionInfo); it exports a {@link WebExtensionFactory}.
33
37
  */
34
- export interface WebExtensionAPI extends WebServices, WebPartnersAPI {
38
+ export interface WebExtensionAPI extends WebServices, WebPartnersAPI, WebMenus {
35
39
  /** The React of the page: an extension brings no React of its own. */
36
40
  readonly React: typeof React;
37
41
  readonly ui: WebExtensionUI;
@@ -105,11 +109,6 @@ export interface WebExtensionAPI extends WebServices, WebPartnersAPI {
105
109
  * Without one, a page opens in the browser of the system after the user said so.
106
110
  */
107
111
  registerOpener(opener: WebOpener, options?: WebOpenerOptions): void;
108
- /**
109
- * Entries of the menu of a conversation where a list shows it (a right click or a held finger on its row), in a
110
- * section of their own after Ta's: read each time the menu opens.
111
- */
112
- registerSessionMenu(menu: WebSessionMenu): void;
113
112
  /** The events of the conversation shown. */
114
113
  on<T extends TaEvent['type']>(type: T, handler: (event: Extract<TaEvent, {
115
114
  type: T;
@@ -230,7 +229,7 @@ export interface WebNotifyOptions {
230
229
  export type { ScreenAction, ScreenItem, ScreenPartSpec, ScreenPartView, ScreenPlace, ScreenScrollable, ScreenScrollTo } from '../screen/screen-protocol';
231
230
  /** What web extensions see of TaScreen. */
232
231
  export type WebScreen = Pick<TaScreen, 'agent' | 'parts' | 'act' | 'element' | 'where' | 'places' | 'go' | 'pageScroll' | 'scroll'>;
233
- export interface WebExtensionUI extends WebHomeUI, WebPartnersUI {
232
+ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI {
234
233
  /** A widget around the message box, as pi's, or a card in the workbench on the right; `undefined` removes it. */
235
234
  setWidget(key: string, widget: React.ComponentType | undefined, options?: WidgetOptions): void;
236
235
  /**
@@ -253,6 +252,8 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI {
253
252
  readonly doubleInChats?: boolean;
254
253
  /** A React hook: what extensions add to the rooms (registerRoomAddon), in the order they loaded. Newer than some Ta apps. */
255
254
  useRoomAddons(): readonly WebRoomAddonEntry[];
255
+ /** What extensions add to the menu of a file or a folder (registerFileMenu), read as a list of files opens it. Newer than some Ta apps. */
256
+ fileMenu?(file: WebFileRef): WebMenuItem[];
256
257
  /**
257
258
  * Pins a conversation to the top of the lists (or unpins it), by its session file, as the user does with Pin: for
258
259
  * one the extension made that the user looks at each day. Pin it once; the user may unpin it. Newer than some Ta
@@ -308,24 +309,6 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI {
308
309
  mimeType: string;
309
310
  }[];
310
311
  }): boolean;
311
- /**
312
- * A tab in the editor area beside the conversation (a file, a diff, a browser); an open id is shown
313
- * again. With `preserveFocus`, it opens behind the tab shown, and the workbench is not revealed: for
314
- * tabs opened again when the page loads. With `preview`, as a single click in an IDE: its title is in
315
- * italics, and the next tab opened as a preview takes its place, until it is pinned (`pinEditor`, or a
316
- * double click on it); opening it again without `preview` pins it too.
317
- */
318
- openEditor(editor: WebEditor, options?: {
319
- preserveFocus?: boolean;
320
- preview?: boolean;
321
- }): void;
322
- closeEditor(id: string): void;
323
- /** Keeps a tab opened as a preview: the next preview opens beside it. */
324
- pinEditor(id: string): void;
325
- /** Marks a tab as changed and not saved: a dot in place of its close button, and the user is asked before closing it. Dirty tabs are pinned. */
326
- setEditorDirty(id: string, dirty: boolean): void;
327
- /** A React hook: the id of the tab shown in the workbench, whoever opened it. */
328
- useActiveEditor(): string | undefined;
329
312
  /**
330
313
  * A React hook: the directory of the conversation (or agent) in front, as it changes; the default directory
331
314
  * of the server when none is: a page, the settings, the lists of a phone. What opens now (a terminal) opens there.
@@ -47,6 +47,7 @@ const context_menu_1 = require("../components/context-menu");
47
47
  const conversation_scroll_hooks_1 = require("../components/conversation-scroll-hooks");
48
48
  const conversation_view_1 = require("../components/conversation-view");
49
49
  const diff_editor_1 = require("../components/diff-editor");
50
+ const editor_actions_1 = require("../components/editor-actions");
50
51
  const empty_state_1 = require("../components/empty-state");
51
52
  const face_1 = require("../components/face");
52
53
  const folder_picker_1 = require("../components/folder-picker");
@@ -257,15 +258,8 @@ class WebExtensionContext {
257
258
  registerComposerAddon: addon => register(() => run.composerAddons.push(addon)),
258
259
  registerRoomAddon: addon => register(() => run.roomAddons.push(addon)),
259
260
  registerSettings: section => register(() => run.settingsSections.push(section)),
260
- registerSessionMenu: menu => register(() => run.sessionMenus.push(session => {
261
- try {
262
- return run.stopped ? [] : menu(session);
263
- }
264
- catch (error) {
265
- console.error(`The web extension ${run.loaded.name} failed:`, error);
266
- return [];
267
- }
268
- })),
261
+ registerSessionMenu: menu => register(() => run.sessionMenus.push(web_extension_run_1.WebExtensionRunUtil.menu(run, menu))),
262
+ registerFileMenu: menu => register(() => run.fileMenus.push(web_extension_run_1.WebExtensionRunUtil.menu(run, menu))),
269
263
  registerOpener: (opener, options) => register(() => ((options === null || options === void 0 ? void 0 : options.specific) ? run.specificOpeners : run.openers).push(async (link) => {
270
264
  // An opener that fails, or of an extension that stopped, leaves the link to the next one.
271
265
  try {
@@ -431,6 +425,7 @@ class WebExtensionContext {
431
425
  forgetPage: id => !run.stopped && host.extensions.forgetPage(id),
432
426
  ...web_home_1.WebHomeUtil.ui(host.extensions, () => run.stopped, run.loaded.name),
433
427
  doubleInChats: true,
428
+ fileMenu: file => (run.stopped ? [] : host.extensions.state.fileMenus.flatMap(menu => menu(file))),
434
429
  useRoomAddons: () => {
435
430
  const read = () => host.extensions.state.roomAddons;
436
431
  const subscribe = React.useCallback((listener) => host.extensions.subscribe(listener), []);
@@ -442,6 +437,7 @@ class WebExtensionContext {
442
437
  icons: icons_1.WEB_ICONS,
443
438
  CodeEditor: this.codeEditor,
444
439
  DiffEditor: this.diffEditor,
440
+ EditorActions: editor_actions_1.EditorActions,
445
441
  // Ends with the extension: one made after it stopped is ended at once.
446
442
  createTerminal: (options) => {
447
443
  const terminal = new web_terminal_1.DefaultWebTerminal(settings, (target, open) => void host.links.open(target, open), options);
@@ -2,7 +2,7 @@ import type { TaEvent, TaTemporaryFrom, TaWebExtensionInfo } from '@celljs/ta-pr
2
2
  import type * as React from 'react';
3
3
  import type { MessageId } from '../i18n/messages';
4
4
  import type { BlockSpeech } from '../util/spoken';
5
- import type { WebAvatarProps, WebCallPartner, WebChatIconSource, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebEditor, WebExtensionFactory, WebHomeEntry, WebIcon, WebImage, WebInitiative, WebLabel, WebMenuItem, WebOpener, WebPageGroup, WebRoomAddonEntry, WebSearchSource, WebSessionMenu, WebSessionOpening, WebSettingsSection, WebShareTarget, WebTool, WebToolRendererResolver, WebViewLocation, WebViewPreview, WidgetOptions } from './web-extension-api';
5
+ import type { WebAvatarProps, WebCallPartner, WebChatIconSource, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebEditor, WebExtensionFactory, WebFileMenu, WebHomeEntry, WebIcon, WebImage, WebInitiative, WebLabel, WebMenuItem, WebOpener, WebPageGroup, WebRoomAddonEntry, WebSearchSource, WebSessionMenu, WebSessionOpening, WebSettingsSection, WebShareTarget, WebTool, WebToolRendererResolver, WebViewLocation, WebViewPreview, WidgetOptions } from './web-extension-api';
6
6
  import type { WebHomeBoard } from './web-home';
7
7
  import type { PageUsage, WebPageInfo } from './web-pages';
8
8
  import type { WebPartnerBoard } from './web-partners';
@@ -139,6 +139,8 @@ export interface WebExtensionsState {
139
139
  specificOpeners: WebOpener[];
140
140
  /** Entries of the menu of a conversation of a list (WebExtensionAPI.registerSessionMenu). */
141
141
  sessionMenus: WebSessionMenu[];
142
+ /** Entries of the menu of a file or a folder of a list of files (WebExtensionAPI.registerFileMenu). */
143
+ fileMenus: WebFileMenu[];
142
144
  /** The tabs of the editor area (the workbench), in the order they opened. */
143
145
  editors: WebEditorEntry[];
144
146
  activeEditor?: string;
@@ -25,6 +25,7 @@ var WebExtensionsStateUtil;
25
25
  openers: [],
26
26
  specificOpeners: [],
27
27
  sessionMenus: [],
28
+ fileMenus: [],
28
29
  customs: [],
29
30
  editors: [],
30
31
  focus: 0,
@@ -1,6 +1,6 @@
1
1
  import type { TaEvent } from '@celljs/ta-protocol';
2
2
  import type * as React from 'react';
3
- import type { WebCallPartner, WebChatIconSource, WebComposerAddon, WebHomeSource, WebInitiative, WebOpener, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WidgetOptions } from './web-extension-api';
3
+ import type { WebCallPartner, WebChatIconSource, WebComposerAddon, WebFileMenu, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebTaskSource, WebTool, WebToolRendererResolver, WebView, 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 {
@@ -24,6 +24,7 @@ export interface WebRegistrations {
24
24
  /** Openers of some links only (WebOpenerOptions.specific): asked first. */
25
25
  specificOpeners: WebOpener[];
26
26
  sessionMenus: WebSessionMenu[];
27
+ fileMenus: WebFileMenu[];
27
28
  taskSources: WebTaskSource[];
28
29
  searches: WebSearchSource[];
29
30
  composerAddons: WebComposerAddon[];
@@ -47,6 +48,8 @@ export interface WebExtensionRun extends WebRegistrations {
47
48
  dispose?: () => void;
48
49
  }
49
50
  export declare namespace WebExtensionRunUtil {
51
+ /** A menu of the extension (registerSessionMenu, registerFileMenu): none once it stopped, nor when it throws. */
52
+ function menu<T>(run: WebExtensionRun, menu: (target: T) => WebMenuItem[]): (target: T) => WebMenuItem[];
50
53
  /** Nothing registered: the one list of what a run holds, so that a stop clears every kind of it. */
51
54
  function registrations(): WebRegistrations;
52
55
  function create(loaded: LoadedWebExtension, hash?: string): WebExtensionRun;
@@ -55,6 +58,6 @@ export declare namespace WebExtensionRunUtil {
55
58
  /** Subscribes for the extension: undone when it stops, or by the function returned. */
56
59
  function track(run: WebExtensionRun, subscribe: () => () => void): () => void;
57
60
  /** What the extensions that run registered, as the page shows it: the first of a message type or a tool name wins. */
58
- function collect(runs: readonly WebExtensionRun[], onOpen: (id: string) => boolean): Pick<WebExtensionsState, 'openers' | 'specificOpeners' | 'sessionMenus' | 'extensions' | 'views' | 'widgets' | 'composerAddons' | 'roomAddons' | 'settingsSections' | 'renderers' | 'codeRenderers' | 'codeSpeech' | 'callPartner' | 'avatars' | 'chatIcons' | 'initiatives' | 'tools' | 'toolRenderers' | 'searches'>;
61
+ function collect(runs: readonly WebExtensionRun[], onOpen: (id: string) => boolean): Pick<WebExtensionsState, 'openers' | 'specificOpeners' | 'sessionMenus' | 'fileMenus' | 'extensions' | 'views' | 'widgets' | 'composerAddons' | 'roomAddons' | 'settingsSections' | 'renderers' | 'codeRenderers' | 'codeSpeech' | 'callPartner' | 'avatars' | 'chatIcons' | 'initiatives' | 'tools' | 'toolRenderers' | 'searches'>;
59
62
  }
60
63
  //# sourceMappingURL=web-extension-run.d.ts.map
@@ -4,6 +4,19 @@ exports.WebExtensionRunUtil = void 0;
4
4
  const DEFAULT_ORDER = 100;
5
5
  var WebExtensionRunUtil;
6
6
  (function (WebExtensionRunUtil) {
7
+ /** A menu of the extension (registerSessionMenu, registerFileMenu): none once it stopped, nor when it throws. */
8
+ function menu(run, menu) {
9
+ return target => {
10
+ try {
11
+ return run.stopped ? [] : menu(target);
12
+ }
13
+ catch (error) {
14
+ console.error(`The web extension ${run.loaded.name} failed:`, error);
15
+ return [];
16
+ }
17
+ };
18
+ }
19
+ WebExtensionRunUtil.menu = menu;
7
20
  /** Nothing registered: the one list of what a run holds, so that a stop clears every kind of it. */
8
21
  function registrations() {
9
22
  return {
@@ -23,6 +36,7 @@ var WebExtensionRunUtil;
23
36
  openers: [],
24
37
  specificOpeners: [],
25
38
  sessionMenus: [],
39
+ fileMenus: [],
26
40
  taskSources: [],
27
41
  searches: [],
28
42
  composerAddons: [],
@@ -109,6 +123,7 @@ var WebExtensionRunUtil;
109
123
  openers: [...runs.flatMap(run => run.specificOpeners), ...runs.flatMap(run => run.openers)],
110
124
  specificOpeners: runs.flatMap(run => run.specificOpeners),
111
125
  sessionMenus: runs.flatMap(run => run.sessionMenus),
126
+ fileMenus: runs.flatMap(run => run.fileMenus),
112
127
  extensions: runs.map(run => run.loaded),
113
128
  views,
114
129
  widgets: runs.flatMap(run => [...run.widgets].map(([key, { component, options }]) => { var _a; return ({
@@ -57,6 +57,14 @@ var WebHomeUtil;
57
57
  useHomeShown: () => React.useSyncExternalStore(subscribe, read, read),
58
58
  useTasks: () => React.useSyncExternalStore(extensions.tasks.subscribe, extensions.tasks.tasks, extensions.tasks.tasks),
59
59
  startGroup: partner => (0, group_picker_1.openGroupPicker)(extensions, partner === undefined ? undefined : extensions.partners.partners().find(each => each.key === `${extension}/${partner}`)),
60
+ openPartner: async (id, kind) => {
61
+ const partner = extensions.partners.partners().find(each => each.id === id && (!kind || each.kind === kind));
62
+ if (!partner || stopped()) {
63
+ return false;
64
+ }
65
+ await partner.open();
66
+ return true;
67
+ },
60
68
  };
61
69
  }
62
70
  WebHomeUtil.ui = ui;
@@ -16,6 +16,7 @@ const chat_list_util_1 = require("../components/chat-list-util");
16
16
  const side_lists_1 = require("../components/side-lists");
17
17
  const device_1 = require("../device/device");
18
18
  const use_t_1 = require("../i18n/use-t");
19
+ const chime_1 = require("../notices/chime");
19
20
  const notices_protocol_1 = require("../notices/notices-protocol");
20
21
  const session_notices_1 = require("../notices/session-notices");
21
22
  const settings_protocol_1 = require("../settings/settings-protocol");
@@ -135,6 +136,7 @@ var WebSessionNoticeUtil;
135
136
  }
136
137
  return (await deps.workbench.server.openSession({ cwd: (_a = notice.cwd) !== null && _a !== void 0 ? _a : '.', sessionFile: notice.sessionFile })).sessionId;
137
138
  };
139
+ const tone = new chime_1.Chime();
138
140
  return {
139
141
  notices: deps.notices,
140
142
  scene: notice => scene(notice, deps),
@@ -193,6 +195,12 @@ var WebSessionNoticeUtil;
193
195
  console.warn('A notice of the system failed:', error);
194
196
  }
195
197
  },
198
+ chime: (level, way) => {
199
+ // Ta Desktop's notice of the system, from its main process, sounds of its own but for an answer.
200
+ if (way !== 'system' || !desktop_1.DesktopUtil.notices() || level === 'done') {
201
+ tone.play(level);
202
+ }
203
+ },
196
204
  };
197
205
  }
198
206
  WebSessionNoticeUtil.host = host;