@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.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/esm/browser/account/account-side.js +3 -1
- package/esm/browser/assistant/assistant-task-source.js +3 -1
- package/esm/browser/assistant/assistant-thread.d.ts +5 -2
- package/esm/browser/assistant/assistant-thread.js +70 -46
- package/esm/browser/assistant/assistant-view.js +9 -3
- package/esm/browser/components/account-menu.d.ts +2 -1
- package/esm/browser/components/account-menu.js +12 -3
- package/esm/browser/components/app-nav.js +5 -5
- package/esm/browser/components/chat-asks.js +16 -1
- package/esm/browser/components/chat-home.d.ts +7 -2
- package/esm/browser/components/chat-home.js +2 -2
- package/esm/browser/components/chat-icon.d.ts +6 -1
- package/esm/browser/components/chat-icon.js +45 -4
- package/esm/browser/components/chat-list-hooks.d.ts +10 -0
- package/esm/browser/components/chat-list-hooks.js +15 -0
- package/esm/browser/components/chat-list.js +7 -9
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-addon-util.d.ts +5 -0
- package/esm/browser/components/composer-addon-util.js +17 -0
- package/esm/browser/components/composer-addons.d.ts +3 -1
- package/esm/browser/components/composer-addons.js +5 -2
- package/esm/browser/components/editor-actions.d.ts +10 -0
- package/esm/browser/components/editor-actions.js +13 -0
- package/esm/browser/components/editor-area.js +8 -4
- package/esm/browser/components/fold-text.d.ts +4 -2
- package/esm/browser/components/fold-text.js +5 -4
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/image-swipe.d.ts +20 -0
- package/esm/browser/components/image-swipe.js +75 -0
- package/esm/browser/components/image-viewer.d.ts +2 -2
- package/esm/browser/components/image-viewer.js +2 -2
- package/esm/browser/components/message-footer.d.ts +2 -2
- package/esm/browser/components/message-footer.js +2 -2
- package/esm/browser/components/message-list.d.ts +12 -0
- package/esm/browser/components/message-list.js +31 -18
- package/esm/browser/components/message-user.js +5 -3
- package/esm/browser/components/nav-places.d.ts +2 -1
- package/esm/browser/components/nav-places.js +3 -2
- package/esm/browser/components/relay-services.d.ts +1 -1
- package/esm/browser/components/relay-services.js +11 -91
- package/esm/browser/components/said-text.d.ts +6 -2
- package/esm/browser/components/said-text.js +8 -2
- package/esm/browser/components/serve-restart.d.ts +11 -2
- package/esm/browser/components/serve-restart.js +64 -3
- package/esm/browser/components/session-view.js +3 -2
- package/esm/browser/components/settings-more.js +7 -4
- package/esm/browser/components/workbench-tabs.d.ts +4 -2
- package/esm/browser/components/workbench-tabs.js +5 -3
- package/esm/browser/extension/extension-view.d.ts +9 -1
- package/esm/browser/extension/extension-view.js +12 -1
- package/esm/browser/extension/icons.js +10 -1
- package/esm/browser/extension/web-api-contributions.d.ts +19 -14
- package/esm/browser/extension/web-api-editors.d.ts +32 -0
- package/esm/browser/extension/web-api-editors.js +2 -0
- package/esm/browser/extension/web-api-menus.d.ts +40 -0
- package/esm/browser/extension/web-api-menus.js +2 -0
- package/esm/browser/extension/web-api-partners.d.ts +6 -0
- package/esm/browser/extension/web-extension-api.d.ts +9 -26
- package/esm/browser/extension/web-extension-context.js +5 -9
- package/esm/browser/extension/web-extension-protocol.d.ts +3 -1
- package/esm/browser/extension/web-extension-protocol.js +1 -0
- package/esm/browser/extension/web-extension-run.d.ts +5 -2
- package/esm/browser/extension/web-extension-run.js +15 -0
- package/esm/browser/extension/web-home.js +8 -0
- package/esm/browser/extension/web-session-notices.js +8 -0
- package/esm/browser/i18n/locales.d.ts +12 -1
- package/esm/browser/i18n/messages-ja.js +13 -2
- package/esm/browser/i18n/messages-zh-tw.js +13 -2
- package/esm/browser/i18n/messages.d.ts +11 -0
- package/esm/browser/i18n/messages.js +27 -5
- package/esm/browser/notices/chime.d.ts +16 -0
- package/esm/browser/notices/chime.js +67 -0
- package/esm/browser/notices/session-notices.d.ts +8 -0
- package/esm/browser/notices/session-notices.js +23 -2
- package/esm/browser/share/shared-page.js +2 -1
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +5 -3
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +2 -2
- package/esm/browser/style/device.js +2 -2
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +9 -1
- package/esm/browser/style/shared.d.ts +1 -1
- package/esm/browser/style/shared.js +1 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +7 -4
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +1 -1
- package/esm/browser/util/image-swipe.d.ts +14 -3
- package/esm/browser/util/image-swipe.js +26 -3
- package/esm/browser/util/process.d.ts +5 -0
- package/esm/browser/util/process.js +22 -1
- package/esm/browser/workbench-protocol.d.ts +5 -0
- package/esm/browser/workbench.d.ts +1 -0
- package/esm/browser/workbench.js +20 -0
- package/lib/browser/account/account-side.js +3 -1
- package/lib/browser/assistant/assistant-task-source.js +3 -1
- package/lib/browser/assistant/assistant-thread.d.ts +5 -2
- package/lib/browser/assistant/assistant-thread.js +70 -46
- package/lib/browser/assistant/assistant-view.js +8 -2
- package/lib/browser/components/account-menu.d.ts +2 -1
- package/lib/browser/components/account-menu.js +10 -1
- package/lib/browser/components/app-nav.js +4 -4
- package/lib/browser/components/chat-asks.js +16 -1
- package/lib/browser/components/chat-home.d.ts +7 -2
- package/lib/browser/components/chat-home.js +2 -2
- package/lib/browser/components/chat-icon.d.ts +6 -1
- package/lib/browser/components/chat-icon.js +45 -4
- package/lib/browser/components/chat-list-hooks.d.ts +10 -0
- package/lib/browser/components/chat-list-hooks.js +16 -0
- package/lib/browser/components/chat-list.js +6 -8
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-addon-util.d.ts +5 -0
- package/lib/browser/components/composer-addon-util.js +17 -0
- package/lib/browser/components/composer-addons.d.ts +3 -1
- package/lib/browser/components/composer-addons.js +5 -2
- package/lib/browser/components/editor-actions.d.ts +11 -0
- package/lib/browser/components/editor-actions.js +50 -0
- package/lib/browser/components/editor-area.js +7 -3
- package/lib/browser/components/fold-text.d.ts +4 -2
- package/lib/browser/components/fold-text.js +5 -4
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/image-swipe.d.ts +20 -0
- package/lib/browser/components/image-swipe.js +75 -0
- package/lib/browser/components/image-viewer.d.ts +2 -2
- package/lib/browser/components/image-viewer.js +2 -2
- package/lib/browser/components/message-footer.d.ts +2 -2
- package/lib/browser/components/message-footer.js +3 -4
- package/lib/browser/components/message-list.d.ts +12 -0
- package/lib/browser/components/message-list.js +32 -18
- package/lib/browser/components/message-user.js +5 -3
- package/lib/browser/components/nav-places.d.ts +2 -1
- package/lib/browser/components/nav-places.js +3 -2
- package/lib/browser/components/relay-services.d.ts +1 -1
- package/lib/browser/components/relay-services.js +9 -89
- package/lib/browser/components/said-text.d.ts +6 -2
- package/lib/browser/components/said-text.js +8 -2
- package/lib/browser/components/serve-restart.d.ts +11 -2
- package/lib/browser/components/serve-restart.js +64 -3
- package/lib/browser/components/session-view.js +3 -2
- package/lib/browser/components/settings-more.js +7 -4
- package/lib/browser/components/workbench-tabs.d.ts +4 -2
- package/lib/browser/components/workbench-tabs.js +5 -3
- package/lib/browser/extension/extension-view.d.ts +9 -1
- package/lib/browser/extension/extension-view.js +12 -0
- package/lib/browser/extension/icons.js +9 -0
- package/lib/browser/extension/web-api-contributions.d.ts +19 -14
- package/lib/browser/extension/web-api-editors.d.ts +33 -0
- package/lib/browser/extension/web-api-editors.js +3 -0
- package/lib/browser/extension/web-api-menus.d.ts +41 -0
- package/lib/browser/extension/web-api-menus.js +3 -0
- package/lib/browser/extension/web-api-partners.d.ts +6 -0
- package/lib/browser/extension/web-extension-api.d.ts +9 -26
- package/lib/browser/extension/web-extension-context.js +5 -9
- package/lib/browser/extension/web-extension-protocol.d.ts +3 -1
- package/lib/browser/extension/web-extension-protocol.js +1 -0
- package/lib/browser/extension/web-extension-run.d.ts +5 -2
- package/lib/browser/extension/web-extension-run.js +15 -0
- package/lib/browser/extension/web-home.js +8 -0
- package/lib/browser/extension/web-session-notices.js +8 -0
- package/lib/browser/i18n/locales.d.ts +12 -1
- package/lib/browser/i18n/messages-ja.js +13 -2
- package/lib/browser/i18n/messages-zh-tw.js +13 -2
- package/lib/browser/i18n/messages.d.ts +11 -0
- package/lib/browser/i18n/messages.js +27 -5
- package/lib/browser/notices/chime.d.ts +17 -0
- package/lib/browser/notices/chime.js +71 -0
- package/lib/browser/notices/session-notices.d.ts +8 -0
- package/lib/browser/notices/session-notices.js +23 -2
- package/lib/browser/share/shared-page.js +2 -1
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +5 -3
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +2 -2
- package/lib/browser/style/device.js +2 -2
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +9 -1
- package/lib/browser/style/shared.d.ts +1 -1
- package/lib/browser/style/shared.js +1 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +7 -4
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +1 -1
- package/lib/browser/util/image-swipe.d.ts +14 -3
- package/lib/browser/util/image-swipe.js +26 -3
- package/lib/browser/util/process.d.ts +5 -0
- package/lib/browser/util/process.js +22 -1
- package/lib/browser/workbench-protocol.d.ts +5 -0
- package/lib/browser/workbench.d.ts +1 -0
- package/lib/browser/workbench.js +20 -0
- 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
|
-
|
|
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
|
|
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,15 +591,3 @@ 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[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { WebEditor } from './web-api-contributions.js';
|
|
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
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.js';
|
|
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
|
+
}
|
|
@@ -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.js';
|
|
|
7
7
|
import type { ScreenPartSpec, TaScreen } from '../screen/screen-protocol.js';
|
|
8
8
|
import type { Language, Theme } from '../settings/settings-protocol.js';
|
|
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.js';
|
|
10
|
-
import type { WebAsk, WebCallPartner, WebChatIconSource, WebCodeRendererOptions, WebCodeRendererProps, WebComposerAddon, WebCustomMessage,
|
|
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.js';
|
|
11
11
|
import type { WebDesktop, WebFileDrag } from './web-api-desktop.js';
|
|
12
|
+
import type { WebEditorsUI } from './web-api-editors.js';
|
|
12
13
|
import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home.js';
|
|
14
|
+
import type { WebFileRef, WebMenus } from './web-api-menus.js';
|
|
13
15
|
import type { WebServices } from './web-api-services.js';
|
|
14
16
|
import type { WebTerminal, WebTerminalOptions } from './web-api-terminal.js';
|
|
15
17
|
import type { WebPageInfo } from './web-pages.js';
|
|
@@ -22,7 +24,9 @@ export type { Language, Theme } from '../settings/settings-protocol.js';
|
|
|
22
24
|
export type * from './web-api-components.js';
|
|
23
25
|
export type * from './web-api-contributions.js';
|
|
24
26
|
export type * from './web-api-desktop.js';
|
|
27
|
+
export type * from './web-api-editors.js';
|
|
25
28
|
export type * from './web-api-home.js';
|
|
29
|
+
export type * from './web-api-menus.js';
|
|
26
30
|
export type * from './web-api-services.js';
|
|
27
31
|
export type * from './web-api-terminal.js';
|
|
28
32
|
export type { WebPageInfo, WebPageState } from './web-pages.js';
|
|
@@ -31,7 +35,7 @@ export type { WebPageInfo, WebPageState } from './web-pages.js';
|
|
|
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.js';
|
|
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.
|
|
@@ -11,6 +11,7 @@ import { ContextMenuUtil, useContextMenu } from '../components/context-menu.js';
|
|
|
11
11
|
import { useConversationScroll } from '../components/conversation-scroll-hooks.js';
|
|
12
12
|
import { ConversationView } from '../components/conversation-view.js';
|
|
13
13
|
import { DiffEditor } from '../components/diff-editor.js';
|
|
14
|
+
import { EditorActions } from '../components/editor-actions.js';
|
|
14
15
|
import { EmptyState } from '../components/empty-state.js';
|
|
15
16
|
import { Face, GroupFace } from '../components/face.js';
|
|
16
17
|
import { FolderPicker } from '../components/folder-picker.js';
|
|
@@ -221,15 +222,8 @@ export class WebExtensionContext {
|
|
|
221
222
|
registerComposerAddon: addon => register(() => run.composerAddons.push(addon)),
|
|
222
223
|
registerRoomAddon: addon => register(() => run.roomAddons.push(addon)),
|
|
223
224
|
registerSettings: section => register(() => run.settingsSections.push(section)),
|
|
224
|
-
registerSessionMenu: menu => register(() => run.sessionMenus.push(
|
|
225
|
-
|
|
226
|
-
return run.stopped ? [] : menu(session);
|
|
227
|
-
}
|
|
228
|
-
catch (error) {
|
|
229
|
-
console.error(`The web extension ${run.loaded.name} failed:`, error);
|
|
230
|
-
return [];
|
|
231
|
-
}
|
|
232
|
-
})),
|
|
225
|
+
registerSessionMenu: menu => register(() => run.sessionMenus.push(WebExtensionRunUtil.menu(run, menu))),
|
|
226
|
+
registerFileMenu: menu => register(() => run.fileMenus.push(WebExtensionRunUtil.menu(run, menu))),
|
|
233
227
|
registerOpener: (opener, options) => register(() => ((options === null || options === void 0 ? void 0 : options.specific) ? run.specificOpeners : run.openers).push(async (link) => {
|
|
234
228
|
// An opener that fails, or of an extension that stopped, leaves the link to the next one.
|
|
235
229
|
try {
|
|
@@ -395,6 +389,7 @@ export class WebExtensionContext {
|
|
|
395
389
|
forgetPage: id => !run.stopped && host.extensions.forgetPage(id),
|
|
396
390
|
...WebHomeUtil.ui(host.extensions, () => run.stopped, run.loaded.name),
|
|
397
391
|
doubleInChats: true,
|
|
392
|
+
fileMenu: file => (run.stopped ? [] : host.extensions.state.fileMenus.flatMap(menu => menu(file))),
|
|
398
393
|
useRoomAddons: () => {
|
|
399
394
|
const read = () => host.extensions.state.roomAddons;
|
|
400
395
|
const subscribe = React.useCallback((listener) => host.extensions.subscribe(listener), []);
|
|
@@ -406,6 +401,7 @@ export class WebExtensionContext {
|
|
|
406
401
|
icons: WEB_ICONS,
|
|
407
402
|
CodeEditor: this.codeEditor,
|
|
408
403
|
DiffEditor: this.diffEditor,
|
|
404
|
+
EditorActions,
|
|
409
405
|
// Ends with the extension: one made after it stopped is ended at once.
|
|
410
406
|
createTerminal: (options) => {
|
|
411
407
|
const terminal = new 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.js';
|
|
4
4
|
import type { BlockSpeech } from '../util/spoken.js';
|
|
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.js';
|
|
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.js';
|
|
6
6
|
import type { WebHomeBoard } from './web-home.js';
|
|
7
7
|
import type { PageUsage, WebPageInfo } from './web-pages.js';
|
|
8
8
|
import type { WebPartnerBoard } from './web-partners.js';
|
|
@@ -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;
|
|
@@ -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.js';
|
|
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.js';
|
|
4
4
|
import type { LoadedWebExtension, WebExtensionsState } from './web-extension-protocol.js';
|
|
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,5 +58,5 @@ 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
|
}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
const DEFAULT_ORDER = 100;
|
|
2
2
|
export var WebExtensionRunUtil;
|
|
3
3
|
(function (WebExtensionRunUtil) {
|
|
4
|
+
/** A menu of the extension (registerSessionMenu, registerFileMenu): none once it stopped, nor when it throws. */
|
|
5
|
+
function menu(run, menu) {
|
|
6
|
+
return target => {
|
|
7
|
+
try {
|
|
8
|
+
return run.stopped ? [] : menu(target);
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
console.error(`The web extension ${run.loaded.name} failed:`, error);
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
WebExtensionRunUtil.menu = menu;
|
|
4
17
|
/** Nothing registered: the one list of what a run holds, so that a stop clears every kind of it. */
|
|
5
18
|
function registrations() {
|
|
6
19
|
return {
|
|
@@ -20,6 +33,7 @@ export var WebExtensionRunUtil;
|
|
|
20
33
|
openers: [],
|
|
21
34
|
specificOpeners: [],
|
|
22
35
|
sessionMenus: [],
|
|
36
|
+
fileMenus: [],
|
|
23
37
|
taskSources: [],
|
|
24
38
|
searches: [],
|
|
25
39
|
composerAddons: [],
|
|
@@ -106,6 +120,7 @@ export var WebExtensionRunUtil;
|
|
|
106
120
|
openers: [...runs.flatMap(run => run.specificOpeners), ...runs.flatMap(run => run.openers)],
|
|
107
121
|
specificOpeners: runs.flatMap(run => run.specificOpeners),
|
|
108
122
|
sessionMenus: runs.flatMap(run => run.sessionMenus),
|
|
123
|
+
fileMenus: runs.flatMap(run => run.fileMenus),
|
|
109
124
|
extensions: runs.map(run => run.loaded),
|
|
110
125
|
views,
|
|
111
126
|
widgets: runs.flatMap(run => [...run.widgets].map(([key, { component, options }]) => { var _a; return ({
|
|
@@ -21,6 +21,14 @@ export var WebHomeUtil;
|
|
|
21
21
|
useHomeShown: () => React.useSyncExternalStore(subscribe, read, read),
|
|
22
22
|
useTasks: () => React.useSyncExternalStore(extensions.tasks.subscribe, extensions.tasks.tasks, extensions.tasks.tasks),
|
|
23
23
|
startGroup: partner => openGroupPicker(extensions, partner === undefined ? undefined : extensions.partners.partners().find(each => each.key === `${extension}/${partner}`)),
|
|
24
|
+
openPartner: async (id, kind) => {
|
|
25
|
+
const partner = extensions.partners.partners().find(each => each.id === id && (!kind || each.kind === kind));
|
|
26
|
+
if (!partner || stopped()) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
await partner.open();
|
|
30
|
+
return true;
|
|
31
|
+
},
|
|
24
32
|
};
|
|
25
33
|
}
|
|
26
34
|
WebHomeUtil.ui = ui;
|
|
@@ -13,6 +13,7 @@ import { ChatListUtil } from '../components/chat-list-util.js';
|
|
|
13
13
|
import { DOUBLE_PAGE } from '../components/side-lists.js';
|
|
14
14
|
import { Device } from '../device/device.js';
|
|
15
15
|
import { translator } from '../i18n/use-t.js';
|
|
16
|
+
import { Chime } from '../notices/chime.js';
|
|
16
17
|
import { TaNotices } from '../notices/notices-protocol.js';
|
|
17
18
|
import { SessionNotices, TaSessionNotices } from '../notices/session-notices.js';
|
|
18
19
|
import { TaSettings } from '../settings/settings-protocol.js';
|
|
@@ -132,6 +133,7 @@ export var WebSessionNoticeUtil;
|
|
|
132
133
|
}
|
|
133
134
|
return (await deps.workbench.server.openSession({ cwd: (_a = notice.cwd) !== null && _a !== void 0 ? _a : '.', sessionFile: notice.sessionFile })).sessionId;
|
|
134
135
|
};
|
|
136
|
+
const tone = new Chime();
|
|
135
137
|
return {
|
|
136
138
|
notices: deps.notices,
|
|
137
139
|
scene: notice => scene(notice, deps),
|
|
@@ -190,6 +192,12 @@ export var WebSessionNoticeUtil;
|
|
|
190
192
|
console.warn('A notice of the system failed:', error);
|
|
191
193
|
}
|
|
192
194
|
},
|
|
195
|
+
chime: (level, way) => {
|
|
196
|
+
// Ta Desktop's notice of the system, from its main process, sounds of its own but for an answer.
|
|
197
|
+
if (way !== 'system' || !DesktopUtil.notices() || level === 'done') {
|
|
198
|
+
tone.play(level);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
193
201
|
};
|
|
194
202
|
}
|
|
195
203
|
WebSessionNoticeUtil.host = host;
|