@celljs/ta-web 4.9.1 → 4.10.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 +4 -3
- package/README.md +4 -3
- package/esm/browser/assistant/assistant-chat-list.js +8 -2
- package/esm/browser/assistant/assistant-extension.d.ts +8 -1
- package/esm/browser/assistant/assistant-extension.js +20 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +3 -1
- package/esm/browser/assistant/assistant-task-util.d.ts +2 -0
- package/esm/browser/assistant/assistant-task-util.js +5 -3
- package/esm/browser/assistant/assistant-view.js +81 -56
- package/esm/browser/assistant/assistant.d.ts +10 -1
- package/esm/browser/assistant/assistant.js +44 -5
- package/esm/browser/chat/chat-packages.d.ts +39 -0
- package/esm/browser/chat/chat-packages.js +70 -0
- package/esm/browser/chat/chat-protocol.d.ts +23 -1
- package/esm/browser/chat/chat-stores.d.ts +59 -0
- package/esm/browser/chat/chat-stores.js +121 -0
- package/esm/browser/chat/chat-util.d.ts +17 -0
- package/esm/browser/chat/chat-util.js +61 -0
- package/esm/browser/chat/chat-view.js +33 -12
- package/esm/browser/chat/chat.d.ts +31 -39
- package/esm/browser/chat/chat.js +226 -175
- package/esm/browser/components/app-nav.d.ts +6 -3
- package/esm/browser/components/app-nav.js +19 -10
- package/esm/browser/components/app-shell-hooks.d.ts +2 -2
- package/esm/browser/components/app-shell-hooks.js +7 -3
- package/esm/browser/components/app-view.js +75 -21
- package/esm/browser/components/chat-list.d.ts +20 -2
- package/esm/browser/components/chat-list.js +138 -22
- package/esm/browser/components/composer-box.d.ts +5 -5
- package/esm/browser/components/composer-box.js +111 -4
- package/esm/browser/components/composer.d.ts +7 -0
- package/esm/browser/components/composer.js +5 -4
- package/esm/browser/components/connection-bar.js +50 -17
- package/esm/browser/components/context-menu.d.ts +30 -4
- package/esm/browser/components/context-menu.js +199 -37
- package/esm/browser/components/conversation-scroll.d.ts +129 -6
- package/esm/browser/components/conversation-scroll.js +429 -109
- package/esm/browser/components/earlier-messages.d.ts +2 -1
- package/esm/browser/components/earlier-messages.js +2 -17
- package/esm/browser/components/editor-area.d.ts +3 -1
- package/esm/browser/components/editor-area.js +6 -5
- package/esm/browser/components/empty-pictures.d.ts +0 -2
- package/esm/browser/components/empty-pictures.js +0 -16
- package/esm/browser/components/folder-picker.d.ts +5 -2
- package/esm/browser/components/folder-picker.js +26 -8
- package/esm/browser/components/held-talk.d.ts +28 -0
- package/esm/browser/components/held-talk.js +76 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/icon.d.ts +2 -2
- package/esm/browser/components/icon.js +5 -6
- package/esm/browser/components/image-viewer.d.ts +124 -0
- package/esm/browser/components/image-viewer.js +397 -0
- package/esm/browser/components/lightbox.d.ts +11 -0
- package/esm/browser/components/lightbox.js +24 -0
- package/esm/browser/components/markdown.d.ts +6 -2
- package/esm/browser/components/markdown.js +24 -10
- package/esm/browser/components/media.js +1 -10
- package/esm/browser/components/message-footer.d.ts +16 -2
- package/esm/browser/components/message-footer.js +29 -12
- package/esm/browser/components/message-list.d.ts +24 -3
- package/esm/browser/components/message-list.js +149 -20
- package/esm/browser/components/message-menu.d.ts +3 -1
- package/esm/browser/components/message-menu.js +18 -3
- package/esm/browser/components/nav-places.d.ts +16 -1
- package/esm/browser/components/nav-places.js +12 -3
- package/esm/browser/components/phone-shell.d.ts +4 -1
- package/esm/browser/components/phone-shell.js +3 -1
- package/esm/browser/components/run-status.js +3 -3
- package/esm/browser/components/session-settings.d.ts +6 -0
- package/esm/browser/components/session-settings.js +14 -1
- package/esm/browser/components/session-view.js +8 -4
- package/esm/browser/components/settings-parts.d.ts +2 -2
- package/esm/browser/components/settings-parts.js +24 -1
- package/esm/browser/components/swipe-row.d.ts +2 -2
- package/esm/browser/components/swipe-row.js +7 -3
- package/esm/browser/components/tool-view.js +14 -12
- package/esm/browser/components/voice-button.d.ts +1 -1
- package/esm/browser/components/voice-button.js +1 -1
- package/esm/browser/components/voice-talk.d.ts +43 -0
- package/esm/browser/components/voice-talk.js +222 -0
- package/esm/browser/device/device.d.ts +3 -0
- package/esm/browser/device/device.js +11 -1
- package/esm/browser/device/hold.d.ts +42 -0
- package/esm/browser/device/hold.js +136 -0
- package/esm/browser/device/launch-screen.d.ts +1 -1
- package/esm/browser/device/launch-screen.js +1 -1
- package/esm/browser/device/long-press.d.ts +2 -0
- package/esm/browser/device/long-press.js +16 -1
- package/esm/browser/device/pull-down.d.ts +4 -2
- package/esm/browser/device/pull-down.js +64 -76
- package/esm/browser/device/row-swipe.d.ts +35 -10
- package/esm/browser/device/row-swipe.js +149 -71
- package/esm/browser/device/shake-undo.d.ts +16 -0
- package/esm/browser/device/shake-undo.js +59 -0
- package/esm/browser/device/sheet-swipe.d.ts +118 -18
- package/esm/browser/device/sheet-swipe.js +406 -107
- package/esm/browser/extension/web-extension-api.d.ts +97 -1
- package/esm/browser/extension/web-extension-code.d.ts +6 -0
- package/esm/browser/extension/web-extension-code.js +24 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +23 -1
- package/esm/browser/extension/web-extension-protocol.js +8 -0
- package/esm/browser/extension/web-extensions.d.ts +14 -1
- package/esm/browser/extension/web-extensions.js +122 -23
- package/esm/browser/files/files-protocol.d.ts +25 -0
- package/esm/browser/files/files-protocol.js +2 -0
- package/esm/browser/files/files.d.ts +35 -0
- package/esm/browser/files/files.js +119 -0
- package/esm/browser/i18n/locales.d.ts +24 -2
- package/esm/browser/i18n/messages.d.ts +23 -1
- package/esm/browser/i18n/messages.js +48 -4
- package/esm/browser/index.d.ts +6 -0
- package/esm/browser/index.js +6 -0
- package/esm/browser/notices/notices-protocol.d.ts +9 -1
- package/esm/browser/notices/notices.d.ts +2 -0
- package/esm/browser/notices/notices.js +20 -10
- package/esm/browser/offline/device-values.d.ts +55 -0
- package/esm/browser/offline/device-values.js +142 -0
- package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
- package/esm/browser/offline/kept-chats-protocol.js +2 -0
- package/esm/browser/offline/kept-chats.d.ts +47 -0
- package/esm/browser/offline/kept-chats.js +146 -0
- package/esm/browser/offline/offline-reads.d.ts +44 -0
- package/esm/browser/offline/offline-reads.js +107 -0
- package/esm/browser/settings/settings-protocol.d.ts +2 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +57 -17
- package/esm/browser/style/device.js +27 -4
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +67 -15
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +2 -1
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +46 -3
- package/esm/browser/util/frame.d.ts +5 -4
- package/esm/browser/util/frame.js +5 -4
- package/esm/browser/util/markdown.d.ts +18 -1
- package/esm/browser/util/markdown.js +119 -5
- package/esm/browser/util/process.d.ts +21 -0
- package/esm/browser/util/process.js +45 -1
- package/esm/browser/util/voice.d.ts +5 -2
- package/esm/browser/util/voice.js +6 -3
- package/esm/browser/util/zoom.d.ts +46 -0
- package/esm/browser/util/zoom.js +96 -0
- package/esm/browser/workbench-calls.d.ts +59 -0
- package/esm/browser/workbench-calls.js +141 -0
- package/esm/browser/workbench-protocol.d.ts +5 -1
- package/esm/browser/workbench-util.d.ts +7 -0
- package/esm/browser/workbench-util.js +9 -2
- package/esm/browser/workbench.d.ts +14 -5
- package/esm/browser/workbench.js +51 -31
- package/lib/browser/assistant/assistant-chat-list.js +8 -2
- package/lib/browser/assistant/assistant-extension.d.ts +8 -1
- package/lib/browser/assistant/assistant-extension.js +20 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +3 -1
- package/lib/browser/assistant/assistant-task-util.d.ts +2 -0
- package/lib/browser/assistant/assistant-task-util.js +5 -3
- package/lib/browser/assistant/assistant-view.js +78 -53
- package/lib/browser/assistant/assistant.d.ts +10 -1
- package/lib/browser/assistant/assistant.js +44 -5
- package/lib/browser/chat/chat-packages.d.ts +40 -0
- package/lib/browser/chat/chat-packages.js +74 -0
- package/lib/browser/chat/chat-protocol.d.ts +23 -1
- package/lib/browser/chat/chat-stores.d.ts +60 -0
- package/lib/browser/chat/chat-stores.js +125 -0
- package/lib/browser/chat/chat-util.d.ts +18 -0
- package/lib/browser/chat/chat-util.js +64 -0
- package/lib/browser/chat/chat-view.js +33 -12
- package/lib/browser/chat/chat.d.ts +31 -39
- package/lib/browser/chat/chat.js +227 -176
- package/lib/browser/components/app-nav.d.ts +6 -3
- package/lib/browser/components/app-nav.js +17 -8
- package/lib/browser/components/app-shell-hooks.d.ts +2 -2
- package/lib/browser/components/app-shell-hooks.js +7 -3
- package/lib/browser/components/app-view.js +74 -20
- package/lib/browser/components/chat-list.d.ts +20 -2
- package/lib/browser/components/chat-list.js +137 -21
- package/lib/browser/components/composer-box.d.ts +5 -5
- package/lib/browser/components/composer-box.js +111 -4
- package/lib/browser/components/composer.d.ts +7 -0
- package/lib/browser/components/composer.js +5 -4
- package/lib/browser/components/connection-bar.js +48 -15
- package/lib/browser/components/context-menu.d.ts +30 -4
- package/lib/browser/components/context-menu.js +198 -36
- package/lib/browser/components/conversation-scroll.d.ts +129 -6
- package/lib/browser/components/conversation-scroll.js +431 -110
- package/lib/browser/components/earlier-messages.d.ts +2 -1
- package/lib/browser/components/earlier-messages.js +2 -17
- package/lib/browser/components/editor-area.d.ts +3 -1
- package/lib/browser/components/editor-area.js +5 -4
- package/lib/browser/components/empty-pictures.d.ts +0 -2
- package/lib/browser/components/empty-pictures.js +0 -17
- package/lib/browser/components/folder-picker.d.ts +5 -2
- package/lib/browser/components/folder-picker.js +26 -8
- package/lib/browser/components/held-talk.d.ts +29 -0
- package/lib/browser/components/held-talk.js +79 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/icon.d.ts +2 -2
- package/lib/browser/components/icon.js +7 -6
- package/lib/browser/components/image-viewer.d.ts +125 -0
- package/lib/browser/components/image-viewer.js +435 -0
- package/lib/browser/components/lightbox.d.ts +12 -0
- package/lib/browser/components/lightbox.js +60 -0
- package/lib/browser/components/markdown.d.ts +6 -2
- package/lib/browser/components/markdown.js +24 -10
- package/lib/browser/components/media.js +2 -11
- package/lib/browser/components/message-footer.d.ts +16 -2
- package/lib/browser/components/message-footer.js +31 -12
- package/lib/browser/components/message-list.d.ts +24 -3
- package/lib/browser/components/message-list.js +146 -16
- package/lib/browser/components/message-menu.d.ts +3 -1
- package/lib/browser/components/message-menu.js +17 -2
- package/lib/browser/components/nav-places.d.ts +16 -1
- package/lib/browser/components/nav-places.js +13 -3
- package/lib/browser/components/phone-shell.d.ts +4 -1
- package/lib/browser/components/phone-shell.js +3 -1
- package/lib/browser/components/run-status.js +3 -3
- package/lib/browser/components/session-settings.d.ts +6 -0
- package/lib/browser/components/session-settings.js +14 -1
- package/lib/browser/components/session-view.js +7 -3
- package/lib/browser/components/settings-parts.d.ts +2 -2
- package/lib/browser/components/settings-parts.js +24 -1
- package/lib/browser/components/swipe-row.d.ts +2 -2
- package/lib/browser/components/swipe-row.js +7 -3
- package/lib/browser/components/tool-view.js +14 -12
- package/lib/browser/components/voice-button.d.ts +1 -1
- package/lib/browser/components/voice-button.js +1 -1
- package/lib/browser/components/voice-talk.d.ts +44 -0
- package/lib/browser/components/voice-talk.js +260 -0
- package/lib/browser/device/device.d.ts +3 -0
- package/lib/browser/device/device.js +11 -1
- package/lib/browser/device/hold.d.ts +43 -0
- package/lib/browser/device/hold.js +173 -0
- package/lib/browser/device/launch-screen.d.ts +1 -1
- package/lib/browser/device/launch-screen.js +1 -1
- package/lib/browser/device/long-press.d.ts +2 -0
- package/lib/browser/device/long-press.js +16 -1
- package/lib/browser/device/pull-down.d.ts +4 -2
- package/lib/browser/device/pull-down.js +63 -75
- package/lib/browser/device/row-swipe.d.ts +35 -10
- package/lib/browser/device/row-swipe.js +148 -70
- package/lib/browser/device/shake-undo.d.ts +17 -0
- package/lib/browser/device/shake-undo.js +63 -0
- package/lib/browser/device/sheet-swipe.d.ts +118 -18
- package/lib/browser/device/sheet-swipe.js +410 -108
- package/lib/browser/extension/web-extension-api.d.ts +97 -1
- package/lib/browser/extension/web-extension-code.d.ts +6 -0
- package/lib/browser/extension/web-extension-code.js +24 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +23 -1
- package/lib/browser/extension/web-extension-protocol.js +9 -1
- package/lib/browser/extension/web-extensions.d.ts +14 -1
- package/lib/browser/extension/web-extensions.js +120 -21
- package/lib/browser/files/files-protocol.d.ts +26 -0
- package/lib/browser/files/files-protocol.js +5 -0
- package/lib/browser/files/files.d.ts +36 -0
- package/lib/browser/files/files.js +122 -0
- package/lib/browser/i18n/locales.d.ts +24 -2
- package/lib/browser/i18n/messages.d.ts +23 -1
- package/lib/browser/i18n/messages.js +48 -4
- package/lib/browser/index.d.ts +6 -0
- package/lib/browser/index.js +6 -0
- package/lib/browser/notices/notices-protocol.d.ts +9 -1
- package/lib/browser/notices/notices.d.ts +2 -0
- package/lib/browser/notices/notices.js +20 -10
- package/lib/browser/offline/device-values.d.ts +56 -0
- package/lib/browser/offline/device-values.js +148 -0
- package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
- package/lib/browser/offline/kept-chats-protocol.js +5 -0
- package/lib/browser/offline/kept-chats.d.ts +48 -0
- package/lib/browser/offline/kept-chats.js +149 -0
- package/lib/browser/offline/offline-reads.d.ts +45 -0
- package/lib/browser/offline/offline-reads.js +111 -0
- package/lib/browser/settings/settings-protocol.d.ts +2 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +57 -17
- package/lib/browser/style/device.js +27 -4
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +67 -15
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +2 -1
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +46 -3
- package/lib/browser/util/frame.d.ts +5 -4
- package/lib/browser/util/frame.js +5 -4
- package/lib/browser/util/markdown.d.ts +18 -1
- package/lib/browser/util/markdown.js +119 -5
- package/lib/browser/util/process.d.ts +21 -0
- package/lib/browser/util/process.js +46 -2
- package/lib/browser/util/voice.d.ts +5 -2
- package/lib/browser/util/voice.js +6 -3
- package/lib/browser/util/zoom.d.ts +47 -0
- package/lib/browser/util/zoom.js +99 -0
- package/lib/browser/workbench-calls.d.ts +60 -0
- package/lib/browser/workbench-calls.js +145 -0
- package/lib/browser/workbench-protocol.d.ts +5 -1
- package/lib/browser/workbench-util.d.ts +7 -0
- package/lib/browser/workbench-util.js +10 -3
- package/lib/browser/workbench.d.ts +14 -5
- package/lib/browser/workbench.js +51 -31
- package/package.json +10 -10
- package/public/launch.svg +46 -42
|
@@ -2,6 +2,7 @@ import type { TaEvent, TaPackageServer, TaRemoteServer, TaServer, TaSessionInfo,
|
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
import type { Mood } from '../avatar/dino-avatar';
|
|
4
4
|
import type { DeviceState } from '../device/device-protocol';
|
|
5
|
+
import type { TaFiles } from '../files/files-protocol';
|
|
5
6
|
import type { Language, Theme } from '../settings/settings-protocol';
|
|
6
7
|
import type { WebPageInfo } from './web-pages';
|
|
7
8
|
export type { WebPageInfo, WebPageState } from './web-pages';
|
|
@@ -21,6 +22,12 @@ export interface WebExtensionAPI {
|
|
|
21
22
|
readonly terminals: TaTerminalServer;
|
|
22
23
|
/** The packages pi loads; for the data of the extension's own package, {@link storage}. */
|
|
23
24
|
readonly packages: TaPackageServer;
|
|
25
|
+
/**
|
|
26
|
+
* The bytes of the files of the workspace, for what the page cannot load by their URL
|
|
27
|
+
* (`workspace.fileUrl`): behind a relay, and in the app on a phone, only the calls on the WebSocket reach
|
|
28
|
+
* ta serve. `byUrl` says which way it is; the bytes come sealed, end to end, when it is not.
|
|
29
|
+
*/
|
|
30
|
+
readonly files: TaFiles;
|
|
24
31
|
/** The other machines of `ssh://` directories (TaLocation): their ports, for a page served there. */
|
|
25
32
|
readonly remote: TaRemoteServer;
|
|
26
33
|
/** pi's settings of ta (`settings.json`): `getSettings(cwd)` also lists the models with credentials, for a model picker. */
|
|
@@ -49,6 +56,12 @@ export interface WebExtensionAPI {
|
|
|
49
56
|
* entries of its + menu and something above it, each given the conversation it is drawn for.
|
|
50
57
|
*/
|
|
51
58
|
registerComposerAddon(addon: WebComposerAddon): void;
|
|
59
|
+
/**
|
|
60
|
+
* A section of the settings, after those of Ta: what the user sets once for the extension (a model it
|
|
61
|
+
* uses, a choice it makes), kept with `storage`. Its rows look like Ta's, each with a control the
|
|
62
|
+
* extension draws.
|
|
63
|
+
*/
|
|
64
|
+
registerSettings(section: WebSettingsSection): void;
|
|
52
65
|
/**
|
|
53
66
|
* Opens what links of replies point to: files (at the lines they name), directories, pages of the web.
|
|
54
67
|
* Openers are asked in the order they were registered; the first that returns true has opened it.
|
|
@@ -123,6 +136,8 @@ export type WebOpener = (link: WebLink) => boolean | Promise<boolean>;
|
|
|
123
136
|
export interface WebSessionOpening {
|
|
124
137
|
title?: string;
|
|
125
138
|
cwd?: string;
|
|
139
|
+
/** Its session file, when known: what the device kept of the conversation shows while it opens, and while the computer cannot be reached. */
|
|
140
|
+
sessionFile?: string;
|
|
126
141
|
}
|
|
127
142
|
export interface WebStorage {
|
|
128
143
|
get<T = unknown>(key: string): Promise<T | undefined>;
|
|
@@ -222,7 +237,10 @@ export interface WebExtensionUI {
|
|
|
222
237
|
setEditorDirty(id: string, dirty: boolean): void;
|
|
223
238
|
/** A React hook: the id of the tab shown in the workbench, whoever opened it. */
|
|
224
239
|
useActiveEditor(): string | undefined;
|
|
225
|
-
/**
|
|
240
|
+
/**
|
|
241
|
+
* A React hook: the directory of the conversation (or agent) in front, as it changes; the default directory
|
|
242
|
+
* of the server when none is: a page, the settings, the lists of a phone. What opens now (a terminal) opens there.
|
|
243
|
+
*/
|
|
226
244
|
useCwd(): string;
|
|
227
245
|
/**
|
|
228
246
|
* A React hook: the device the page runs on, as it changes: the layout (`compact`: the navigation is a
|
|
@@ -233,6 +251,11 @@ export interface WebExtensionUI {
|
|
|
233
251
|
useDevice(): DeviceState;
|
|
234
252
|
/** A React hook: the session of the conversation shown (TaSessionInfo.sessionId). */
|
|
235
253
|
useSessionId(): string | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* A React hook: the open sessions of ta serve, as the page reads them again: whether each answers now
|
|
256
|
+
* (`isStreaming`), what was said last. The same array until one changes.
|
|
257
|
+
*/
|
|
258
|
+
useSessions(): readonly TaSessionInfo[];
|
|
236
259
|
/**
|
|
237
260
|
* Shows a view of any web extension by its id, `<extension name>/<view name>` (`assistant/assistant`
|
|
238
261
|
* for the double): a page in the main area, a tool of the workbench as its tab; `''` the conversation again.
|
|
@@ -250,6 +273,21 @@ export interface WebExtensionUI {
|
|
|
250
273
|
* screen): the menu to render, and `open` for `onContextMenu`, with sections set apart by a line.
|
|
251
274
|
*/
|
|
252
275
|
useContextMenu(): [React.ReactNode, (event: React.MouseEvent, sections: WebMenuItem[][]) => void];
|
|
276
|
+
/**
|
|
277
|
+
* For a menu of your own (`position: fixed`, its entries `role="menuitem"`), from a layout effect: places it
|
|
278
|
+
* where it was `opened` as the menus of the page go (at the pointer; under a finger, out from under it and the
|
|
279
|
+
* row it pressed, `around`), and on a touch screen lets the finger have it as the menus of the page do: slide
|
|
280
|
+
* onto an entry and let go to choose it, slide off and let go to `close` it, a tap outside only closing it.
|
|
281
|
+
* Returns how to stop. Prefer `useContextMenu`, which does this.
|
|
282
|
+
*/
|
|
283
|
+
attachMenu(menu: HTMLElement, opened: {
|
|
284
|
+
x: number;
|
|
285
|
+
y: number;
|
|
286
|
+
around?: {
|
|
287
|
+
top: number;
|
|
288
|
+
bottom: number;
|
|
289
|
+
};
|
|
290
|
+
}, close: () => void): () => void;
|
|
253
291
|
/**
|
|
254
292
|
* In the Ta app: the camera of the system scans a QR code; resolves with its text, or undefined when the user
|
|
255
293
|
* cancelled. Undefined elsewhere (a browser has no scanner of its own).
|
|
@@ -303,6 +341,14 @@ export interface WebExtensionUI {
|
|
|
303
341
|
readonly Markdown: React.ComponentType<{
|
|
304
342
|
text: string;
|
|
305
343
|
}>;
|
|
344
|
+
/**
|
|
345
|
+
* A React hook: a chat that scrolls as the conversations of the page do, the element of the returned ref
|
|
346
|
+
* being what scrolls and its first child (positioned) holding a row for each message. At the bottom it
|
|
347
|
+
* follows what comes in; scrolled up, what the user reads stays where it is (the message box growing, rows
|
|
348
|
+
* changing their height); a part opened by a click stays where it was. `sent`: how many messages the user
|
|
349
|
+
* sent, one more of which goes to the bottom; another `key` (another chat in the same view) too.
|
|
350
|
+
*/
|
|
351
|
+
useChatScroll(sent: number, key?: string): React.RefObject<HTMLDivElement | null>;
|
|
306
352
|
/** What a list or a view shows while it has nothing, as the lists of the page show it: centered in the space it has. */
|
|
307
353
|
readonly Empty: React.ComponentType<WebEmptyProps>;
|
|
308
354
|
/** What a list shows while its rows are on their way (its data not read yet), as the lists of the page show it: after a moment, never for a list that comes at once. */
|
|
@@ -329,6 +375,13 @@ export interface WebExtensionUI {
|
|
|
329
375
|
readonly Picture: React.ComponentType<WebPictureProps>;
|
|
330
376
|
/** Choices as pictures in a row, as the suggestions of an empty conversation: a click picks one. */
|
|
331
377
|
readonly PictureCards: React.ComponentType<WebPictureCardsProps>;
|
|
378
|
+
/**
|
|
379
|
+
* A picture to look at closely, as the viewers of pictures: all of it at first (never larger than its own
|
|
380
|
+
* pixels), pinched by two fingers or a trackpad, zoomed by a wheel with Ctrl or ⌘ and by a double tap or
|
|
381
|
+
* click, dragged or scrolled once zoomed; with − / the scale / + / 1:1 below it. It fills its parent (a
|
|
382
|
+
* column of flex).
|
|
383
|
+
*/
|
|
384
|
+
readonly ImageViewer: React.ComponentType<WebImageViewerProps>;
|
|
332
385
|
/** A QR code of a text (a link to scan with a phone), black on white whatever the theme; `label` for a screen reader. */
|
|
333
386
|
readonly QrCode: React.ComponentType<{
|
|
334
387
|
text: string;
|
|
@@ -600,6 +653,19 @@ export interface WebPictureCard {
|
|
|
600
653
|
disabled?: boolean;
|
|
601
654
|
onPick(): void;
|
|
602
655
|
}
|
|
656
|
+
export interface WebImageViewerProps {
|
|
657
|
+
src: string;
|
|
658
|
+
alt?: string;
|
|
659
|
+
/** On its root, for the background behind the picture (a checkerboard for transparency). */
|
|
660
|
+
className?: string;
|
|
661
|
+
/** Once it loaded: its size in pixels. */
|
|
662
|
+
onLoad?(size: {
|
|
663
|
+
width: number;
|
|
664
|
+
height: number;
|
|
665
|
+
}): void;
|
|
666
|
+
/** A click or tap beside the picture. */
|
|
667
|
+
onBackground?(): void;
|
|
668
|
+
}
|
|
603
669
|
export interface WebPictureCardsProps {
|
|
604
670
|
cards: readonly WebPictureCard[];
|
|
605
671
|
/** Default as many as there are cards. */
|
|
@@ -660,6 +726,22 @@ export interface WebConversation {
|
|
|
660
726
|
/** As the page names it: the name of the session, or of the double. */
|
|
661
727
|
title?: string;
|
|
662
728
|
}
|
|
729
|
+
/** A section an extension adds to the settings (WebExtensionAPI.registerSettings). */
|
|
730
|
+
export interface WebSettingsSection {
|
|
731
|
+
title: WebLabel;
|
|
732
|
+
/** Beside its title in the list of the sections; default: a puzzle piece. */
|
|
733
|
+
icon?: WebIcon;
|
|
734
|
+
rows: WebSettingRow[];
|
|
735
|
+
}
|
|
736
|
+
/** A row of the settings of an extension: a label and a description as Ta's rows have, and its control. */
|
|
737
|
+
export interface WebSettingRow {
|
|
738
|
+
key: string;
|
|
739
|
+
label: WebLabel;
|
|
740
|
+
description?: WebLabel;
|
|
741
|
+
/** The control, beside the label; with `stacked`, under it, for a wide one (a model picker, a list). */
|
|
742
|
+
render: React.ComponentType;
|
|
743
|
+
stacked?: boolean;
|
|
744
|
+
}
|
|
663
745
|
/** What an extension adds to the message box of every conversation (WebExtensionAPI.registerComposerAddon). */
|
|
664
746
|
export interface WebComposerAddon {
|
|
665
747
|
/** Entries of the + menu, a section of their own; read each time the conversation is drawn, and when `subscribe` says. */
|
|
@@ -723,6 +805,16 @@ export interface WebView {
|
|
|
723
805
|
* navigation, instead of taking a place there by itself.
|
|
724
806
|
*/
|
|
725
807
|
discover?: boolean;
|
|
808
|
+
/** A page: the line a list shows under its name, as a messenger does — the last thing said there, and when. */
|
|
809
|
+
preview?(): WebViewPreview | undefined;
|
|
810
|
+
/** A page: whoever is there answers now; a list that shows it marks it so, as a conversation answering. */
|
|
811
|
+
busy?(): boolean;
|
|
812
|
+
/** What `preview` or `busy` gives changed: the lists read it again. */
|
|
813
|
+
subscribe?(listener: () => void): () => void;
|
|
814
|
+
}
|
|
815
|
+
export interface WebViewPreview {
|
|
816
|
+
text: string;
|
|
817
|
+
at: number;
|
|
726
818
|
}
|
|
727
819
|
/** What `ui.shareExtension` hands on. */
|
|
728
820
|
export interface WebShareTarget {
|
|
@@ -792,6 +884,10 @@ export interface WebViewInfo {
|
|
|
792
884
|
shown: boolean;
|
|
793
885
|
/** WebView.menu: the list that shows the page draws a … with it. */
|
|
794
886
|
menu?(): WebMenuItem[][];
|
|
887
|
+
/** WebView.preview. */
|
|
888
|
+
preview?: WebViewPreview;
|
|
889
|
+
/** WebView.busy. */
|
|
890
|
+
busy: boolean;
|
|
795
891
|
}
|
|
796
892
|
export interface WebTool {
|
|
797
893
|
/** Letters, digits, `_` and `-`, starting with a letter. */
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import type { TaWebExtensionInfo } from '@celljs/ta-protocol';
|
|
1
2
|
/**
|
|
2
3
|
* The code of the web extensions of packages, kept in this browser by its hash (`TaWebExtensionInfo.hash`,
|
|
3
4
|
* of the code itself): a start reads from ta serve only what changed. A phone over the relay read some 230 KB
|
|
4
5
|
* at every start before its double's list could show.
|
|
5
6
|
* What the last list of a ta serve does not name goes; switching to another computer reads its own again.
|
|
7
|
+
* The list itself is kept for each computer too, for the extensions to start before it answers.
|
|
6
8
|
*/
|
|
7
9
|
export declare class WebExtensionCode {
|
|
8
10
|
protected readonly storage: () => Storage | undefined;
|
|
9
11
|
static readonly PREFIX = "ta.web-extension ";
|
|
12
|
+
static readonly LIST = "web-extensions";
|
|
10
13
|
constructor(storage: () => Storage | undefined);
|
|
11
14
|
get(hash: string): string | undefined;
|
|
12
15
|
set(hash: string, code: string): void;
|
|
16
|
+
/** The list the computer `host` gave last (with the values it keeps for the page, forgotten with them). */
|
|
17
|
+
list(host: string): TaWebExtensionInfo[];
|
|
18
|
+
keepList(host: string, infos: TaWebExtensionInfo[]): void;
|
|
13
19
|
/** Only the code of `hashes`, those of the list of now. */
|
|
14
20
|
keepOnly(hashes: Iterable<string>): void;
|
|
15
21
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebExtensionCode = void 0;
|
|
4
|
+
const state_protocol_1 = require("../state/state-protocol");
|
|
4
5
|
/**
|
|
5
6
|
* The code of the web extensions of packages, kept in this browser by its hash (`TaWebExtensionInfo.hash`,
|
|
6
7
|
* of the code itself): a start reads from ta serve only what changed. A phone over the relay read some 230 KB
|
|
7
8
|
* at every start before its double's list could show.
|
|
8
9
|
* What the last list of a ta serve does not name goes; switching to another computer reads its own again.
|
|
10
|
+
* The list itself is kept for each computer too, for the extensions to start before it answers.
|
|
9
11
|
*/
|
|
10
12
|
class WebExtensionCode {
|
|
11
13
|
constructor(storage) {
|
|
@@ -30,6 +32,27 @@ class WebExtensionCode {
|
|
|
30
32
|
// Full, or a browser that keeps nothing: read again next time.
|
|
31
33
|
}
|
|
32
34
|
}
|
|
35
|
+
/** The list the computer `host` gave last (with the values it keeps for the page, forgotten with them). */
|
|
36
|
+
list(host) {
|
|
37
|
+
var _a;
|
|
38
|
+
var _b;
|
|
39
|
+
try {
|
|
40
|
+
const kept = JSON.parse((_b = (_a = this.storage()) === null || _a === void 0 ? void 0 : _a.getItem(state_protocol_1.StateUtil.localKey(WebExtensionCode.LIST, 'user', host))) !== null && _b !== void 0 ? _b : 'null');
|
|
41
|
+
return Array.isArray(kept) ? kept : [];
|
|
42
|
+
}
|
|
43
|
+
catch (_c) {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
keepList(host, infos) {
|
|
48
|
+
var _a;
|
|
49
|
+
try {
|
|
50
|
+
(_a = this.storage()) === null || _a === void 0 ? void 0 : _a.setItem(state_protocol_1.StateUtil.localKey(WebExtensionCode.LIST, 'user', host), JSON.stringify(infos));
|
|
51
|
+
}
|
|
52
|
+
catch (_b) {
|
|
53
|
+
// Full: the extensions start once the computer answers.
|
|
54
|
+
}
|
|
55
|
+
}
|
|
33
56
|
/** Only the code of `hashes`, those of the list of now. */
|
|
34
57
|
keepOnly(hashes) {
|
|
35
58
|
const storage = this.storage();
|
|
@@ -56,4 +79,5 @@ class WebExtensionCode {
|
|
|
56
79
|
}
|
|
57
80
|
exports.WebExtensionCode = WebExtensionCode;
|
|
58
81
|
WebExtensionCode.PREFIX = 'ta.web-extension ';
|
|
82
|
+
WebExtensionCode.LIST = 'web-extensions';
|
|
59
83
|
//# sourceMappingURL=web-extension-code.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TaEvent, TaTemporaryFrom, TaWebExtensionInfo } from '@celljs/ta-protocol';
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
import type { MessageId } from '../i18n/messages';
|
|
4
|
-
import type { WebAvatarProps, WebComposerAddon, WebCustomMessage, WebEditor, WebExtensionFactory, WebIcon, WebLabel, WebMenuItem, WebOpener, WebSearchSource, WebSessionOpening, WebShareTarget, WebTool, WidgetOptions } from './web-extension-api';
|
|
4
|
+
import type { WebAvatarProps, WebComposerAddon, WebCustomMessage, WebEditor, WebExtensionFactory, WebIcon, WebLabel, WebMenuItem, WebOpener, WebSearchSource, WebSessionOpening, WebSettingsSection, WebShareTarget, WebTool, WebViewPreview, WidgetOptions } from './web-extension-api';
|
|
5
5
|
import type { PageUsage, WebPageInfo } from './web-pages';
|
|
6
6
|
import type { WebTaskBoard } from './web-tasks';
|
|
7
7
|
export declare const TaWebExtensions: unique symbol;
|
|
@@ -38,6 +38,12 @@ export interface WebComposerAddonEntry {
|
|
|
38
38
|
extension: string;
|
|
39
39
|
addon: WebComposerAddon;
|
|
40
40
|
}
|
|
41
|
+
export interface WebSettingsEntry {
|
|
42
|
+
/** `<extension id>/<index>`. */
|
|
43
|
+
id: string;
|
|
44
|
+
extension: string;
|
|
45
|
+
section: WebSettingsSection;
|
|
46
|
+
}
|
|
41
47
|
export interface WebViewEntry {
|
|
42
48
|
/** `<extension name>/<view name>`. */
|
|
43
49
|
id: string;
|
|
@@ -54,6 +60,9 @@ export interface WebViewEntry {
|
|
|
54
60
|
/** Under Discover until the user pins it (WebView.discover). */
|
|
55
61
|
discover?: boolean;
|
|
56
62
|
menu?(): WebMenuItem[][];
|
|
63
|
+
preview?(): WebViewPreview | undefined;
|
|
64
|
+
busy?(): boolean;
|
|
65
|
+
subscribePreview?(listener: () => void): () => void;
|
|
57
66
|
/** Kept from before (WebViewUtil.placeholders): its place, until its extension registers it again. */
|
|
58
67
|
pending?: boolean;
|
|
59
68
|
}
|
|
@@ -87,6 +96,8 @@ export interface WebExtensionsState {
|
|
|
87
96
|
widgets: WebWidgetEntry[];
|
|
88
97
|
/** What extensions add to the message box of every conversation (WebExtensionAPI.registerComposerAddon). */
|
|
89
98
|
composerAddons: WebComposerAddonEntry[];
|
|
99
|
+
/** The sections extensions add to the settings (WebExtensionAPI.registerSettings). */
|
|
100
|
+
settingsSections: WebSettingsEntry[];
|
|
90
101
|
renderers: Record<string, React.ComponentType<{
|
|
91
102
|
message: WebCustomMessage;
|
|
92
103
|
}>>;
|
|
@@ -103,6 +114,11 @@ export interface WebExtensionsState {
|
|
|
103
114
|
focus: number;
|
|
104
115
|
/** The directory of the conversation shown. */
|
|
105
116
|
cwd?: string;
|
|
117
|
+
/**
|
|
118
|
+
* The conversation is in front, not a page, the settings, Discover or the lists of a phone
|
|
119
|
+
* (setConversationShown): `ui.useCwd` gives its directory only then, else the default one.
|
|
120
|
+
*/
|
|
121
|
+
conversationShown: boolean;
|
|
106
122
|
/** The session of the conversation shown. */
|
|
107
123
|
sessionId?: string;
|
|
108
124
|
/** The view of the page shown in the main area; `''` for the conversation. */
|
|
@@ -122,6 +138,10 @@ export interface WebExtensionsState {
|
|
|
122
138
|
/** An extension handed on: its dialog shows (WebExtensionUI.shareExtension). */
|
|
123
139
|
sharing?: WebShareTarget;
|
|
124
140
|
}
|
|
141
|
+
export declare namespace WebCwdUtil {
|
|
142
|
+
/** The directory of the conversation while it is in front; else none, and the workbench is in the default directory. */
|
|
143
|
+
function shown(state: Pick<WebExtensionsState, 'cwd' | 'conversationShown'>): string | undefined;
|
|
144
|
+
}
|
|
125
145
|
export declare namespace WebLabelUtil {
|
|
126
146
|
function text(label: WebLabel | undefined): string;
|
|
127
147
|
}
|
|
@@ -191,6 +211,8 @@ export interface TaWebExtensions {
|
|
|
191
211
|
pinEditor(id: string): void;
|
|
192
212
|
/** The conversation shown, while there is one. */
|
|
193
213
|
connect(conversation: WebExtensionConversation | undefined): void;
|
|
214
|
+
/** Whether the conversation is what the main area shows: the shell says so as it changes. */
|
|
215
|
+
setConversationShown(shown: boolean): void;
|
|
194
216
|
/** An event of the conversation shown, for the handlers of `on`. */
|
|
195
217
|
emit(event: TaEvent): void;
|
|
196
218
|
/** What `switchSession` of web extensions does: the page shows that session; `undefined` until it can. */
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebLabelUtil = exports.BuiltinWebExtension = exports.TaWebExtensions = void 0;
|
|
3
|
+
exports.WebLabelUtil = exports.WebCwdUtil = exports.BuiltinWebExtension = exports.TaWebExtensions = void 0;
|
|
4
4
|
exports.TaWebExtensions = Symbol('TaWebExtensions');
|
|
5
5
|
exports.BuiltinWebExtension = Symbol('BuiltinWebExtension');
|
|
6
|
+
var WebCwdUtil;
|
|
7
|
+
(function (WebCwdUtil) {
|
|
8
|
+
/** The directory of the conversation while it is in front; else none, and the workbench is in the default directory. */
|
|
9
|
+
function shown(state) {
|
|
10
|
+
return state.conversationShown ? state.cwd : undefined;
|
|
11
|
+
}
|
|
12
|
+
WebCwdUtil.shown = shown;
|
|
13
|
+
})(WebCwdUtil || (exports.WebCwdUtil = WebCwdUtil = {}));
|
|
6
14
|
var WebLabelUtil;
|
|
7
15
|
(function (WebLabelUtil) {
|
|
8
16
|
function text(label) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { TaEvent, TaSettingsServer, TaTemporaryFrom, TaWebExtensionInfo } from '@celljs/ta-protocol';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { TaFiles } from '../files/files-protocol';
|
|
3
4
|
import { TaLinks } from '../links/links-protocol';
|
|
4
5
|
import { TaNotices } from '../notices/notices-protocol';
|
|
5
6
|
import { TaSettings } from '../settings/settings-protocol';
|
|
6
7
|
import { TaState } from '../state/state-protocol';
|
|
7
8
|
import { TaWorkbench } from '../workbench-protocol';
|
|
8
|
-
import type { CodeEditorProps, DiffEditorProps, WebComposerAddon, WebComposerProps, WebEditor, WebExtensionAPI, WebExtensionFactory, WebFolderPickerProps, WebModelPickerProps, WebOpener, WebSearchSource, WebShareTarget, WebStorage, WebTaskSource, WebTool, WebView, WidgetOptions } from './web-extension-api';
|
|
9
|
+
import type { CodeEditorProps, DiffEditorProps, WebComposerAddon, WebComposerProps, WebEditor, WebExtensionAPI, WebExtensionFactory, WebFolderPickerProps, WebModelPickerProps, WebOpener, WebSearchSource, WebSettingsSection, WebShareTarget, WebStorage, WebTaskSource, WebTool, WebView, WidgetOptions } from './web-extension-api';
|
|
9
10
|
import { WebExtensionCode } from './web-extension-code';
|
|
10
11
|
import { BuiltinWebExtension, type LoadedWebExtension, TaWebExtensions, type WebEditorEntry, type WebExtensionConversation, type WebExtensionsState, type WebSessionSwitcher, type WebViewEntry } from './web-extension-protocol';
|
|
11
12
|
import { WebOnDemand } from './web-on-demand';
|
|
@@ -32,6 +33,7 @@ interface Running {
|
|
|
32
33
|
taskSources: WebTaskSource[];
|
|
33
34
|
searches: WebSearchSource[];
|
|
34
35
|
composerAddons: WebComposerAddon[];
|
|
36
|
+
settingsSections: WebSettingsSection[];
|
|
35
37
|
handlers: {
|
|
36
38
|
type: string;
|
|
37
39
|
handler: (event: TaEvent) => void;
|
|
@@ -43,6 +45,7 @@ interface Running {
|
|
|
43
45
|
export declare class TaWebExtensionsImpl implements TaWebExtensions {
|
|
44
46
|
protected readonly workbench: TaWorkbench;
|
|
45
47
|
protected readonly settings: TaSettings;
|
|
48
|
+
protected readonly taFiles: TaFiles;
|
|
46
49
|
/** Detached: TaLinks asks the openers of the extensions. */
|
|
47
50
|
protected readonly links: TaLinks;
|
|
48
51
|
protected readonly notices: TaNotices;
|
|
@@ -59,6 +62,8 @@ export declare class TaWebExtensionsImpl implements TaWebExtensions {
|
|
|
59
62
|
protected refreshing: Promise<boolean>;
|
|
60
63
|
/** The tabs of before are open again: from now on, what is open is kept. */
|
|
61
64
|
protected restored: boolean;
|
|
65
|
+
/** The extensions of the list of the last time have started (startKept), once. */
|
|
66
|
+
protected keptStarted: boolean;
|
|
62
67
|
/** The tab shown before the page loaded, until it opens again or the user shows another. */
|
|
63
68
|
protected pendingActive?: string;
|
|
64
69
|
/** The views of the navigation kept from before (WebViewUtil.KEPT), in their places until the extensions have loaded once. */
|
|
@@ -111,9 +116,17 @@ export declare class TaWebExtensionsImpl implements TaWebExtensions {
|
|
|
111
116
|
protected dropEditor(editor: WebEditorEntry): void;
|
|
112
117
|
protected setDirty(run: Running, id: string, dirty: boolean): void;
|
|
113
118
|
connect(conversation: WebExtensionConversation | undefined): void;
|
|
119
|
+
setConversationShown(shown: boolean): void;
|
|
114
120
|
setSessionSwitcher(switcher: WebSessionSwitcher | undefined): void;
|
|
115
121
|
emit(event: TaEvent): void;
|
|
116
122
|
protected reconcile(): Promise<boolean>;
|
|
123
|
+
/**
|
|
124
|
+
* The first time, before the computer has answered: the extensions of its list of the last time whose code
|
|
125
|
+
* this browser keeps. What they read goes with the first calls of the page, not a round trip after the list
|
|
126
|
+
* (a phone over the relay waited for it before its double's list could show). The list then keeps those
|
|
127
|
+
* still the same and stops the others.
|
|
128
|
+
*/
|
|
129
|
+
protected startKept(host: string | undefined): Promise<boolean>;
|
|
117
130
|
/** The tools open before, behind what is shown; the tab shown before, once it is open again. */
|
|
118
131
|
protected restoreTabs(): Promise<void>;
|
|
119
132
|
protected keepTabs(): void;
|