@celljs/ta-web 4.38.0 → 4.40.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/esm/browser/assistant/assistant-thread.d.ts +1 -1
- package/esm/browser/assistant/chat-task-source.js +2 -1
- package/esm/browser/chat/chat-shown.js +2 -2
- package/esm/browser/components/app-contexts.js +11 -10
- package/esm/browser/components/busy.d.ts +5 -0
- package/esm/browser/components/busy.js +17 -0
- package/esm/browser/components/chat-asks.d.ts +4 -1
- package/esm/browser/components/chat-asks.js +10 -0
- package/esm/browser/components/chat-list-row.js +5 -3
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-box-protocol.d.ts +5 -0
- package/esm/browser/components/composer-box.js +11 -14
- package/esm/browser/components/composer-media.d.ts +26 -0
- package/esm/browser/components/composer-media.js +37 -0
- package/esm/browser/components/composer-target.d.ts +2 -2
- package/esm/browser/components/composer-target.js +3 -3
- package/esm/browser/components/composer.js +1 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/link.d.ts +7 -1
- package/esm/browser/components/link.js +24 -5
- package/esm/browser/components/markdown.d.ts +1 -1
- package/esm/browser/components/markdown.js +70 -4
- package/esm/browser/components/remote-hosts.d.ts +3 -1
- package/esm/browser/components/remote-hosts.js +10 -5
- package/esm/browser/components/session-view.js +10 -6
- package/esm/browser/components/web-composer.d.ts +1 -1
- package/esm/browser/components/web-composer.js +12 -3
- package/esm/browser/device/photo-picker.d.ts +11 -3
- package/esm/browser/device/photo-picker.js +26 -9
- package/esm/browser/device/video-picks.d.ts +24 -0
- package/esm/browser/device/video-picks.js +104 -0
- package/esm/browser/extension/icons.js +17 -1
- package/esm/browser/extension/web-access.js +4 -1
- package/esm/browser/extension/web-api-code.d.ts +36 -0
- package/esm/browser/extension/web-api-code.js +3 -0
- package/esm/browser/extension/web-api-components.d.ts +22 -0
- package/esm/browser/extension/web-api-contributions.d.ts +0 -31
- package/esm/browser/extension/web-api-hosts.d.ts +22 -0
- package/esm/browser/extension/web-api-hosts.js +2 -0
- package/esm/browser/extension/web-api-menus.d.ts +17 -5
- package/esm/browser/extension/web-api-play.d.ts +29 -0
- package/esm/browser/extension/web-api-play.js +2 -0
- package/esm/browser/extension/web-api-spec.js +5 -0
- package/esm/browser/extension/web-api-terminal.d.ts +20 -0
- package/esm/browser/extension/web-extension-api.d.ts +19 -17
- package/esm/browser/extension/web-extension-context.d.ts +1 -1
- package/esm/browser/extension/web-extension-context.js +8 -6
- package/esm/browser/extension/web-extension-protocol.d.ts +2 -0
- package/esm/browser/extension/web-extension-protocol.js +1 -0
- package/esm/browser/extension/web-extension-run.d.ts +4 -3
- package/esm/browser/extension/web-extension-run.js +15 -8
- package/esm/browser/extension/web-extensions-running.js +38 -7
- package/esm/browser/extension/web-file-drag.d.ts +3 -0
- package/esm/browser/extension/web-file-drag.js +4 -0
- package/esm/browser/extension/web-hosts.d.ts +7 -0
- package/esm/browser/extension/web-hosts.js +29 -0
- package/esm/browser/extension/web-on-demand.d.ts +5 -0
- package/esm/browser/extension/web-on-demand.js +11 -0
- package/esm/browser/hosts.d.ts +2 -0
- package/esm/browser/hosts.js +9 -0
- package/esm/browser/i18n/en/assistant.d.ts +3 -0
- package/esm/browser/i18n/en/assistant.js +3 -0
- package/esm/browser/i18n/en/chat.d.ts +1 -0
- package/esm/browser/i18n/en/chat.js +1 -0
- package/esm/browser/i18n/en/common.d.ts +1 -0
- package/esm/browser/i18n/en/common.js +1 -0
- package/esm/browser/i18n/en/discover.d.ts +2 -0
- package/esm/browser/i18n/en/discover.js +2 -0
- package/esm/browser/i18n/en/service.js +6 -6
- package/esm/browser/i18n/ja/assistant.js +3 -0
- package/esm/browser/i18n/ja/chat.js +1 -0
- package/esm/browser/i18n/ja/common.js +1 -0
- package/esm/browser/i18n/ja/discover.js +2 -0
- package/esm/browser/i18n/ja/service.js +6 -6
- package/esm/browser/i18n/locales.d.ts +8 -1
- package/esm/browser/i18n/messages.d.ts +7 -0
- package/esm/browser/i18n/zh/assistant.js +3 -0
- package/esm/browser/i18n/zh/chat.js +1 -0
- package/esm/browser/i18n/zh/common.js +1 -0
- package/esm/browser/i18n/zh/discover.js +2 -0
- package/esm/browser/i18n/zh/service.js +6 -6
- package/esm/browser/i18n/zh-tw/assistant.js +3 -0
- package/esm/browser/i18n/zh-tw/chat.js +1 -0
- package/esm/browser/i18n/zh-tw/common.js +1 -0
- package/esm/browser/i18n/zh-tw/discover.js +2 -0
- package/esm/browser/i18n/zh-tw/service.js +6 -6
- package/esm/browser/markdown/code-renderers.d.ts +3 -1
- package/esm/browser/markdown/code-renderers.js +2 -0
- package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/esm/browser/sandbox/work/work-api.d.ts +113 -0
- package/esm/browser/sandbox/work/work-api.js +95 -0
- package/esm/browser/sandbox/work/work-docs.d.ts +18 -0
- package/esm/browser/sandbox/work/work-docs.js +66 -0
- package/esm/browser/sandbox/work/work-frame.d.ts +27 -0
- package/esm/browser/sandbox/work/work-frame.js +124 -0
- package/esm/browser/share/shared-extensions.d.ts +2 -1
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +10 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +1 -0
- package/esm/browser/terminal/terminal-osc.d.ts +15 -0
- package/esm/browser/terminal/terminal-osc.js +91 -0
- package/esm/browser/terminal/web-terminal.d.ts +4 -7
- package/esm/browser/terminal/web-terminal.js +22 -26
- package/esm/browser/util/link.d.ts +6 -1
- package/esm/browser/util/link.js +11 -0
- package/esm/browser/workbench-hosts.d.ts +1 -0
- package/esm/browser/workbench-hosts.js +9 -0
- package/esm/browser/workbench-protocol.d.ts +5 -0
- package/lib/browser/assistant/assistant-thread.d.ts +1 -1
- package/lib/browser/assistant/chat-task-source.js +2 -1
- package/lib/browser/chat/chat-shown.js +2 -2
- package/lib/browser/components/app-contexts.js +10 -9
- package/lib/browser/components/busy.d.ts +5 -0
- package/lib/browser/components/busy.js +17 -0
- package/lib/browser/components/chat-asks.d.ts +4 -1
- package/lib/browser/components/chat-asks.js +10 -0
- package/lib/browser/components/chat-list-row.js +5 -3
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-box-protocol.d.ts +5 -0
- package/lib/browser/components/composer-box.js +9 -12
- package/lib/browser/components/composer-media.d.ts +27 -0
- package/lib/browser/components/composer-media.js +74 -0
- package/lib/browser/components/composer-target.d.ts +2 -2
- package/lib/browser/components/composer-target.js +3 -3
- package/lib/browser/components/composer.js +1 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/link.d.ts +7 -1
- package/lib/browser/components/link.js +25 -6
- package/lib/browser/components/markdown.d.ts +1 -1
- package/lib/browser/components/markdown.js +68 -2
- package/lib/browser/components/remote-hosts.d.ts +3 -1
- package/lib/browser/components/remote-hosts.js +10 -5
- package/lib/browser/components/session-view.js +8 -4
- package/lib/browser/components/web-composer.d.ts +1 -1
- package/lib/browser/components/web-composer.js +12 -3
- package/lib/browser/device/photo-picker.d.ts +11 -3
- package/lib/browser/device/photo-picker.js +26 -9
- package/lib/browser/device/video-picks.d.ts +25 -0
- package/lib/browser/device/video-picks.js +107 -0
- package/lib/browser/extension/icons.js +16 -0
- package/lib/browser/extension/web-access.js +4 -1
- package/lib/browser/extension/web-api-code.d.ts +37 -0
- package/lib/browser/extension/web-api-code.js +4 -0
- package/lib/browser/extension/web-api-components.d.ts +22 -0
- package/lib/browser/extension/web-api-contributions.d.ts +0 -31
- package/lib/browser/extension/web-api-hosts.d.ts +23 -0
- package/lib/browser/extension/web-api-hosts.js +3 -0
- package/lib/browser/extension/web-api-menus.d.ts +17 -5
- package/lib/browser/extension/web-api-play.d.ts +30 -0
- package/lib/browser/extension/web-api-play.js +3 -0
- package/lib/browser/extension/web-api-spec.js +5 -0
- package/lib/browser/extension/web-api-terminal.d.ts +20 -0
- package/lib/browser/extension/web-extension-api.d.ts +19 -17
- package/lib/browser/extension/web-extension-context.d.ts +1 -1
- package/lib/browser/extension/web-extension-context.js +8 -6
- package/lib/browser/extension/web-extension-protocol.d.ts +2 -0
- package/lib/browser/extension/web-extension-protocol.js +1 -0
- package/lib/browser/extension/web-extension-run.d.ts +4 -3
- package/lib/browser/extension/web-extension-run.js +15 -8
- package/lib/browser/extension/web-extensions-running.js +38 -7
- package/lib/browser/extension/web-file-drag.d.ts +4 -0
- package/lib/browser/extension/web-file-drag.js +7 -0
- package/lib/browser/extension/web-hosts.d.ts +8 -0
- package/lib/browser/extension/web-hosts.js +32 -0
- package/lib/browser/extension/web-on-demand.d.ts +5 -0
- package/lib/browser/extension/web-on-demand.js +11 -0
- package/lib/browser/hosts.d.ts +2 -0
- package/lib/browser/hosts.js +9 -0
- package/lib/browser/i18n/en/assistant.d.ts +3 -0
- package/lib/browser/i18n/en/assistant.js +3 -0
- package/lib/browser/i18n/en/chat.d.ts +1 -0
- package/lib/browser/i18n/en/chat.js +1 -0
- package/lib/browser/i18n/en/common.d.ts +1 -0
- package/lib/browser/i18n/en/common.js +1 -0
- package/lib/browser/i18n/en/discover.d.ts +2 -0
- package/lib/browser/i18n/en/discover.js +2 -0
- package/lib/browser/i18n/en/service.js +6 -6
- package/lib/browser/i18n/ja/assistant.js +3 -0
- package/lib/browser/i18n/ja/chat.js +1 -0
- package/lib/browser/i18n/ja/common.js +1 -0
- package/lib/browser/i18n/ja/discover.js +2 -0
- package/lib/browser/i18n/ja/service.js +6 -6
- package/lib/browser/i18n/locales.d.ts +8 -1
- package/lib/browser/i18n/messages.d.ts +7 -0
- package/lib/browser/i18n/zh/assistant.js +3 -0
- package/lib/browser/i18n/zh/chat.js +1 -0
- package/lib/browser/i18n/zh/common.js +1 -0
- package/lib/browser/i18n/zh/discover.js +2 -0
- package/lib/browser/i18n/zh/service.js +6 -6
- package/lib/browser/i18n/zh-tw/assistant.js +3 -0
- package/lib/browser/i18n/zh-tw/chat.js +1 -0
- package/lib/browser/i18n/zh-tw/common.js +1 -0
- package/lib/browser/i18n/zh-tw/discover.js +2 -0
- package/lib/browser/i18n/zh-tw/service.js +6 -6
- package/lib/browser/markdown/code-renderers.d.ts +3 -1
- package/lib/browser/markdown/code-renderers.js +3 -1
- package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/lib/browser/sandbox/work/work-api.d.ts +114 -0
- package/lib/browser/sandbox/work/work-api.js +99 -0
- package/lib/browser/sandbox/work/work-docs.d.ts +19 -0
- package/lib/browser/sandbox/work/work-docs.js +69 -0
- package/lib/browser/sandbox/work/work-frame.d.ts +28 -0
- package/lib/browser/sandbox/work/work-frame.js +160 -0
- package/lib/browser/share/shared-extensions.d.ts +2 -1
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +10 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +1 -0
- package/lib/browser/terminal/terminal-osc.d.ts +16 -0
- package/lib/browser/terminal/terminal-osc.js +94 -0
- package/lib/browser/terminal/web-terminal.d.ts +4 -7
- package/lib/browser/terminal/web-terminal.js +25 -29
- package/lib/browser/util/link.d.ts +6 -1
- package/lib/browser/util/link.js +11 -0
- package/lib/browser/workbench-hosts.d.ts +1 -0
- package/lib/browser/workbench-hosts.js +9 -0
- package/lib/browser/workbench-protocol.d.ts +5 -0
- package/package.json +7 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TaBlockedKind } from '@celljs/ta-protocol';
|
|
1
2
|
/** Part of the web extension API (web-extension-api.ts, which exports it all): the terminals of `ui.createTerminal`. */
|
|
2
3
|
export interface WebTerminalOptions {
|
|
3
4
|
/** Its size until a view fits it: the size the program started with. Default: 80 × 24. */
|
|
@@ -18,6 +19,19 @@ export interface WebTerminalProgress {
|
|
|
18
19
|
state: 'normal' | 'busy' | 'error' | 'paused';
|
|
19
20
|
value?: number;
|
|
20
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* What a terminal's program says it is doing (the Program Status Protocol, OSC 7501, which pi speaks): at work,
|
|
24
|
+
* waiting for the user and for what, done, or failed; none when it is idle or said nothing.
|
|
25
|
+
*/
|
|
26
|
+
export interface WebTerminalStatus {
|
|
27
|
+
state: 'working' | 'blocked' | 'done' | 'error';
|
|
28
|
+
/** What a blocked program waits for. */
|
|
29
|
+
kind?: TaBlockedKind;
|
|
30
|
+
/** The one line it gave: its question, what it did. */
|
|
31
|
+
message?: string;
|
|
32
|
+
/** Its name, when it gave one (`pi`). */
|
|
33
|
+
app?: string;
|
|
34
|
+
}
|
|
21
35
|
/** Keys a soft keyboard lacks, which a terminal sends as its program expects (arrows in the mode it set). */
|
|
22
36
|
export type WebTerminalKey = 'Escape' | 'Tab' | 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';
|
|
23
37
|
/**
|
|
@@ -51,6 +65,12 @@ export interface WebTerminal {
|
|
|
51
65
|
/** The progress its program reports (OSC 9;4, as Windows Terminal, Ghostty and iTerm2 show it); undefined for none. */
|
|
52
66
|
readonly progress?: WebTerminalProgress;
|
|
53
67
|
onProgressChange(listener: (progress: WebTerminalProgress | undefined) => void): () => void;
|
|
68
|
+
/**
|
|
69
|
+
* What its program says it is doing (OSC 7501); undefined when it says nothing. The terminal answers the query
|
|
70
|
+
* of the protocol, so that programs know they may say it.
|
|
71
|
+
*/
|
|
72
|
+
readonly status?: WebTerminalStatus;
|
|
73
|
+
onStatusChange(listener: (status: WebTerminalStatus | undefined) => void): () => void;
|
|
54
74
|
/** Its program rang the bell or sent a notification (OSC 9 or OSC 777;notify), with the text of one. */
|
|
55
75
|
onAttention(listener: (message: string | undefined) => void): () => void;
|
|
56
76
|
/** Shows it in `element`, which it fills and follows in size; the function returned takes it out again. */
|
|
@@ -2,16 +2,17 @@ import type { TaEvent, TaRoomEvent, TaSavedSessionInfo, TaSessionInfo } from '@c
|
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
import type { Mood } from '../avatar/dino-avatar.js';
|
|
4
4
|
import type { DeviceState } from '../device/device-protocol.js';
|
|
5
|
-
import type { GameProps } from '../game/game-protocol.js';
|
|
6
|
-
import type { Game3DProps } from '../game/game3d-protocol.js';
|
|
7
5
|
import type { ScreenPartSpec, TaScreen } from '../screen/screen-protocol.js';
|
|
8
6
|
import type { Language, Theme } from '../settings/settings-protocol.js';
|
|
7
|
+
import type { WebCodeRendererOptions, WebCodeRendererProps } from './web-api-code.js';
|
|
9
8
|
import type { CodeEditorProps, DiffEditorProps, WebAvatarProps, 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, WebCallsAPI, WebChatIconSource, WebChatTagsAPI,
|
|
9
|
+
import type { WebAsk, WebCallsAPI, WebChatIconSource, WebChatTagsAPI, 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
10
|
import type { WebDesktop, WebDeviceUI, WebFileDrag } from './web-api-desktop.js';
|
|
12
11
|
import type { WebEditorsUI } from './web-api-editors.js';
|
|
13
12
|
import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home.js';
|
|
13
|
+
import type { WebHosts } from './web-api-hosts.js';
|
|
14
14
|
import type { WebFileRef, WebMenus } from './web-api-menus.js';
|
|
15
|
+
import type { WebPlayUI } from './web-api-play.js';
|
|
15
16
|
import type { WebServices } from './web-api-services.js';
|
|
16
17
|
import type { WebPackageStorage } from './web-api-storage.js';
|
|
17
18
|
import type { WebTargetsAPI } from './web-api-targets.js';
|
|
@@ -23,12 +24,15 @@ export type { TaFileBytes, TaFiles } from '../files/files-protocol.js';
|
|
|
23
24
|
export type { GameColors, GameConfig, GameEngine, GameInstance, GamePage, GamePoint, GameProps, GameState } from '../game/game-protocol.js';
|
|
24
25
|
export type { Game3DContext, Game3DEngine, Game3DLoop, Game3DProps } from '../game/game3d-protocol.js';
|
|
25
26
|
export type { Language, Theme } from '../settings/settings-protocol.js';
|
|
27
|
+
export type * from './web-api-code.js';
|
|
26
28
|
export type * from './web-api-components.js';
|
|
27
29
|
export type * from './web-api-contributions.js';
|
|
28
30
|
export type * from './web-api-desktop.js';
|
|
29
31
|
export type * from './web-api-editors.js';
|
|
30
32
|
export type * from './web-api-home.js';
|
|
33
|
+
export type * from './web-api-hosts.js';
|
|
31
34
|
export type * from './web-api-menus.js';
|
|
35
|
+
export type * from './web-api-play.js';
|
|
32
36
|
export type * from './web-api-services.js';
|
|
33
37
|
export type * from './web-api-storage.js';
|
|
34
38
|
export type * from './web-api-targets.js';
|
|
@@ -153,6 +157,11 @@ export interface WebExtensionAPI extends WebServices, WebPartnersAPI, WebMenus,
|
|
|
153
157
|
* whole of this API. `from` says where it came from.
|
|
154
158
|
*/
|
|
155
159
|
openTemporary(source: string, from: 'market' | 'link' | 'agent'): Promise<string>;
|
|
160
|
+
/**
|
|
161
|
+
* The computers this device reaches (docs/design/ta-cloud-handoff.md 15.3): the one the page shows, keeping another
|
|
162
|
+
* one's way in, and moving to it. Newer than some Ta apps: `pi.hosts?.…`.
|
|
163
|
+
*/
|
|
164
|
+
readonly hosts?: WebHosts;
|
|
156
165
|
/** Small JSON values the package keeps on the server, so they stay across browsers. */
|
|
157
166
|
readonly storage: WebPackageStorage;
|
|
158
167
|
/**
|
|
@@ -201,7 +210,7 @@ export interface WebNotifyOptions {
|
|
|
201
210
|
export type { ScreenAction, ScreenItem, ScreenPartSpec, ScreenPartView, ScreenPlace, ScreenScrollable, ScreenScrollTo } from '../screen/screen-protocol.js';
|
|
202
211
|
/** What web extensions see of TaScreen. */
|
|
203
212
|
export type WebScreen = Pick<TaScreen, 'agent' | 'parts' | 'act' | 'element' | 'where' | 'places' | 'go' | 'pageScroll' | 'scroll'>;
|
|
204
|
-
export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI, WebDeviceUI {
|
|
213
|
+
export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI, WebDeviceUI, WebPlayUI {
|
|
205
214
|
/** A widget around the message box, as pi's, or a card in the workbench on the right; `undefined` removes it. */
|
|
206
215
|
setWidget(key: string, widget: React.ComponentType | undefined, options?: WidgetOptions): void;
|
|
207
216
|
/**
|
|
@@ -254,6 +263,8 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
|
|
|
254
263
|
* icon of the page as events and methods of the element (Electron's). Elsewhere, an iframe.
|
|
255
264
|
*/
|
|
256
265
|
readonly supportsWebview: boolean;
|
|
266
|
+
/** The message box (`Composer`) takes `videos`, picked with the pictures. Newer than some Ta apps. */
|
|
267
|
+
readonly composerVideos?: boolean;
|
|
257
268
|
/**
|
|
258
269
|
* Ta Desktop's way to the file manager of the system (Finder, File Explorer, that of Linux), for paths of
|
|
259
270
|
* this machine; undefined in a browser and the mobile app. A directory of `ssh://` is not of this machine.
|
|
@@ -273,7 +284,10 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
|
|
|
273
284
|
* element's `loadURL`); the app refuses the rest.
|
|
274
285
|
*/
|
|
275
286
|
readonly debugWebview?: (webContentsId: number, method: string, params?: Record<string, unknown>) => Promise<unknown>;
|
|
276
|
-
/**
|
|
287
|
+
/**
|
|
288
|
+
* Into the message box in front (a conversation's, or `ui.Composer` of a page): `quote` before what it holds, `images`
|
|
289
|
+
* (base64) as if pasted; false when none shows.
|
|
290
|
+
*/
|
|
277
291
|
addToComposer(draft: {
|
|
278
292
|
quote?: string;
|
|
279
293
|
images?: {
|
|
@@ -447,18 +461,6 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
|
|
|
447
461
|
* time one is made; what it shows stays while no view shows it (`attach` it to the next one).
|
|
448
462
|
*/
|
|
449
463
|
createTerminal(options?: WebTerminalOptions): WebTerminal;
|
|
450
|
-
/**
|
|
451
|
-
* A game, drawn by Phaser, the game engine of the page (docs/design/ta-games.md): it fills its parent (a
|
|
452
|
-
* column of flex, or an element with a size), sleeps while out of sight and ends when it unmounts. Phaser
|
|
453
|
-
* loads the first time a game starts; an extension never brings an engine of its own.
|
|
454
|
-
*/
|
|
455
|
-
readonly Game: React.ComponentType<GameProps>;
|
|
456
|
-
/**
|
|
457
|
-
* A 3D game, drawn by Three.js, the 3D engine of the page, with its OrbitControls: `setup` puts things in
|
|
458
|
-
* the scene it is given and returns what to do each frame. As `Game`, it fills its parent, sleeps while out
|
|
459
|
-
* of sight and ends when it unmounts, all of its scene disposed; Three.js loads the first time one starts.
|
|
460
|
-
*/
|
|
461
|
-
readonly Game3D: React.ComponentType<Game3DProps>;
|
|
462
464
|
/**
|
|
463
465
|
* What covers all of the page while it is mounted: the shell, its head and side columns, under the notch and
|
|
464
466
|
* the home bar (mind `env(safe-area-inset-*)`), below the title bar of the desktop app and above the keyboard.
|
|
@@ -9,7 +9,7 @@ import type { TaSettings } from '../settings/settings-protocol.js';
|
|
|
9
9
|
import type { TaState } from '../state/state-protocol.js';
|
|
10
10
|
import { type TaTargets } from '../targets/targets-protocol.js';
|
|
11
11
|
import type { TaWorkbench } from '../workbench-protocol.js';
|
|
12
|
-
import type { WebCodeRendererProps } from './web-api-
|
|
12
|
+
import type { WebCodeRendererProps } from './web-api-code.js';
|
|
13
13
|
import type { WebEditorTabs } from './web-editor-tabs.js';
|
|
14
14
|
import type { CodeEditorProps, DiffEditorProps, WebComposerProps, WebExtensionAPI, WebExtensionUI, WebFolderPickerProps, WebHoldToTalkProps, WebModelPickerProps, WebShareSheetProps, WebStorage, WebViewInfo, WebVoice } from './web-extension-api.js';
|
|
15
15
|
import { type TaWebExtensions, type WebExtensionConversation, type WebSessionSwitcher } from './web-extension-protocol.js';
|
|
@@ -43,19 +43,20 @@ import { DraftPlaces } from '../drafts/drafts-protocol.js';
|
|
|
43
43
|
import { Game3DView, GameView } from '../game/game-view.js';
|
|
44
44
|
import { message as messageOf } from '../i18n/messages.js';
|
|
45
45
|
import { translator } from '../i18n/use-t.js';
|
|
46
|
+
import { WorkFrame } from '../sandbox/work/work-frame.js';
|
|
46
47
|
import { ScreenUtil } from '../screen/screen-protocol.js';
|
|
47
48
|
import { TargetsUtil } from '../targets/targets-protocol.js';
|
|
48
49
|
import { DefaultWebTerminal } from '../terminal/web-terminal.js';
|
|
49
50
|
import { DesktopUtil } from '../util/desktop.js';
|
|
50
|
-
import { FileDragUtil } from '../util/file-drag.js';
|
|
51
51
|
import { WEB_ICONS } from './icons.js';
|
|
52
52
|
import { WebAccessUtil } from './web-access.js';
|
|
53
53
|
import { WebCwdUtil, WebLabelUtil } from './web-extension-protocol.js';
|
|
54
54
|
import { WebExtensionRunUtil } from './web-extension-run.js';
|
|
55
|
+
import { WEB_FILE_DRAG } from './web-file-drag.js';
|
|
55
56
|
import { WebHomeUtil } from './web-home.js';
|
|
57
|
+
import { WebHostsUtil } from './web-hosts.js';
|
|
56
58
|
import { WebPagesUtil } from './web-pages.js';
|
|
57
59
|
import { WebTaskUtil } from './web-tasks.js';
|
|
58
|
-
const FILE_DRAG = Object.freeze({ set: FileDragUtil.set, has: FileDragUtil.has, get: FileDragUtil.get, paths: FileDragUtil.paths });
|
|
59
60
|
/**
|
|
60
61
|
* The API each web extension gets: what it registers is its own and goes when it stops, and once it stopped (turned off, removed,
|
|
61
62
|
* a timer of it left behind) it neither shows nor does anything more: its dialogs answer no, and what would act for the user fails.
|
|
@@ -194,9 +195,7 @@ export class WebExtensionContext {
|
|
|
194
195
|
registerCodeRenderer: (language, renderer, options) => register(() => {
|
|
195
196
|
const key = language.trim().toLowerCase();
|
|
196
197
|
run.codeRenderers.set(key, WebExtensionContext.replying(renderer, mark));
|
|
197
|
-
|
|
198
|
-
run.codeSpeech.set(key, options.spoken);
|
|
199
|
-
}
|
|
198
|
+
run.codeOptions.set(key, options !== null && options !== void 0 ? options : {});
|
|
200
199
|
}),
|
|
201
200
|
registerCallPartner: partner => register(() => run.callPartners.push(partner)),
|
|
202
201
|
registerCallMouth: mouth => register(() => run.callMouths.push(mouth)),
|
|
@@ -250,6 +249,7 @@ export class WebExtensionContext {
|
|
|
250
249
|
openChat: sessionFile => live(() => host.links.openConversation(sessionFile)),
|
|
251
250
|
openLink: (url, options) => live(() => host.links.open({ type: 'url', url }, { onlyTa: options === null || options === void 0 ? void 0 : options.onlyTa })),
|
|
252
251
|
openTemporary: (source, from) => live(() => host.extensions.openTemporary(source, from)),
|
|
252
|
+
hosts: WebHostsUtil.of(() => host.workbench),
|
|
253
253
|
callHost: (method, ...params) => live(() => workbench.packages.callPackageHost(run.loaded.name, method, params)),
|
|
254
254
|
reloadExtensions: () => live(() => host.extensions.reloadPackages()),
|
|
255
255
|
};
|
|
@@ -296,8 +296,9 @@ export class WebExtensionContext {
|
|
|
296
296
|
return settings.state.language;
|
|
297
297
|
},
|
|
298
298
|
supportsWebview: DesktopUtil.has('webview'),
|
|
299
|
+
composerVideos: true,
|
|
299
300
|
desktop: DesktopUtil.fileManager(),
|
|
300
|
-
fileDrag:
|
|
301
|
+
fileDrag: WEB_FILE_DRAG,
|
|
301
302
|
debugWebview: DesktopUtil.debugWebview(),
|
|
302
303
|
addToComposer: draft => !run.stopped && ComposerTarget.add(draft),
|
|
303
304
|
// An extension opens, closes and marks only tabs of its own.
|
|
@@ -444,6 +445,7 @@ export class WebExtensionContext {
|
|
|
444
445
|
ImageViewer,
|
|
445
446
|
ChatImages,
|
|
446
447
|
QrCode: QrView,
|
|
448
|
+
WorkFrame,
|
|
447
449
|
ShareSheet: this.shareSheet,
|
|
448
450
|
Dialog: WebDialog,
|
|
449
451
|
FolderPicker: this.folderPicker,
|
|
@@ -126,6 +126,8 @@ export interface WebExtensionsState {
|
|
|
126
126
|
codeRenderers: Record<string, React.ComponentType<WebCodeRendererProps>>;
|
|
127
127
|
/** By language, in lower case, how its blocks are said aloud (WebCodeRendererOptions.spoken): SpokenReply. */
|
|
128
128
|
codeSpeech: BlockSpeech;
|
|
129
|
+
/** The languages whose renderers tell the parts of a block apart (WebCodeRendererOptions.pointable). */
|
|
130
|
+
codePointable: Readonly<Record<string, true>>;
|
|
129
131
|
/** Who answers in calls in place of the conversation (WebExtensionAPI.registerCallPartner): the first registered. */
|
|
130
132
|
callPartner?: WebCallPartner;
|
|
131
133
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TaEvent } from '@celljs/ta-protocol';
|
|
2
2
|
import type * as React from 'react';
|
|
3
|
-
import type { WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebCodeMenu, WebComposerAddon, WebFileMenu, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebVoice, WidgetOptions } from './web-extension-api.js';
|
|
3
|
+
import type { WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebCodeMenu, WebCodeRendererOptions, WebComposerAddon, WebFileMenu, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebVoice, WidgetOptions } from './web-extension-api.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 {
|
|
@@ -11,7 +11,8 @@ export interface WebRegistrations {
|
|
|
11
11
|
}>;
|
|
12
12
|
renderers: Map<string, WebExtensionsState['renderers'][string]>;
|
|
13
13
|
codeRenderers: Map<string, WebExtensionsState['codeRenderers'][string]>;
|
|
14
|
-
|
|
14
|
+
/** By language, in lower case (WebCodeRendererOptions): how its blocks are said aloud, whether they can be pointed at. */
|
|
15
|
+
codeOptions: Map<string, WebCodeRendererOptions>;
|
|
15
16
|
callPartners: WebCallPartner[];
|
|
16
17
|
callMouths: WebCallMouth[];
|
|
17
18
|
callMoves: WebCallMoves[];
|
|
@@ -69,5 +70,5 @@ export declare namespace WebExtensionRunUtil {
|
|
|
69
70
|
*/
|
|
70
71
|
function voice(run: WebExtensionRun, voice: WebVoice): WebVoice;
|
|
71
72
|
/** What the extensions that run registered, as the page shows it: the first of a message type or a tool name wins. */
|
|
72
|
-
function collect(runs: readonly WebExtensionRun[], onOpen: (id: string) => boolean): Pick<WebExtensionsState, 'openers' | 'specificOpeners' | 'sessionMenus' | 'fileMenus' | 'codeMenus' | 'extensions' | 'views' | 'widgets' | 'composerAddons' | 'roomAddons' | 'settingsSections' | 'renderers' | 'codeRenderers' | 'codeSpeech' | 'callPartner' | 'callGroup' | 'callMouth' | 'callMoves' | 'avatars' | 'chatIcons' | 'chatTags' | 'initiatives' | 'tools' | 'toolRenderers' | 'searches'>;
|
|
73
|
+
function collect(runs: readonly WebExtensionRun[], onOpen: (id: string) => boolean): Pick<WebExtensionsState, 'openers' | 'specificOpeners' | 'sessionMenus' | 'fileMenus' | 'codeMenus' | 'extensions' | 'views' | 'widgets' | 'composerAddons' | 'roomAddons' | 'settingsSections' | 'renderers' | 'codeRenderers' | 'codeSpeech' | 'codePointable' | 'callPartner' | 'callGroup' | 'callMouth' | 'callMoves' | 'avatars' | 'chatIcons' | 'chatTags' | 'initiatives' | 'tools' | 'toolRenderers' | 'searches'>;
|
|
73
74
|
}
|
|
@@ -21,7 +21,7 @@ export var WebExtensionRunUtil;
|
|
|
21
21
|
widgets: new Map(),
|
|
22
22
|
renderers: new Map(),
|
|
23
23
|
codeRenderers: new Map(),
|
|
24
|
-
|
|
24
|
+
codeOptions: new Map(),
|
|
25
25
|
callPartners: [],
|
|
26
26
|
callMouths: [],
|
|
27
27
|
callMoves: [],
|
|
@@ -112,11 +112,12 @@ export var WebExtensionRunUtil;
|
|
|
112
112
|
WebExtensionRunUtil.voice = voice;
|
|
113
113
|
/** What the extensions that run registered, as the page shows it: the first of a message type or a tool name wins. */
|
|
114
114
|
function collect(runs, onOpen) {
|
|
115
|
-
var _a;
|
|
116
|
-
var
|
|
115
|
+
var _a, _b;
|
|
116
|
+
var _c, _d, _e;
|
|
117
117
|
const renderers = {};
|
|
118
118
|
const codeRenderers = {};
|
|
119
119
|
const codeSpeech = {};
|
|
120
|
+
const codePointable = {};
|
|
120
121
|
const avatars = {};
|
|
121
122
|
const tools = [];
|
|
122
123
|
for (const run of runs) {
|
|
@@ -124,13 +125,18 @@ export var WebExtensionRunUtil;
|
|
|
124
125
|
avatars[run.loaded.name] = run.avatar;
|
|
125
126
|
}
|
|
126
127
|
for (const [type, renderer] of run.renderers) {
|
|
127
|
-
(
|
|
128
|
+
(_c = renderers[type]) !== null && _c !== void 0 ? _c : (renderers[type] = renderer);
|
|
128
129
|
}
|
|
129
130
|
for (const [language, renderer] of run.codeRenderers) {
|
|
130
|
-
(
|
|
131
|
+
if (!codeRenderers[language] && ((_a = run.codeOptions.get(language)) === null || _a === void 0 ? void 0 : _a.pointable)) {
|
|
132
|
+
codePointable[language] = true;
|
|
133
|
+
}
|
|
134
|
+
(_d = codeRenderers[language]) !== null && _d !== void 0 ? _d : (codeRenderers[language] = renderer);
|
|
131
135
|
}
|
|
132
|
-
for (const [language,
|
|
133
|
-
|
|
136
|
+
for (const [language, options] of run.codeOptions) {
|
|
137
|
+
if (options.spoken) {
|
|
138
|
+
(_e = codeSpeech[language]) !== null && _e !== void 0 ? _e : (codeSpeech[language] = options.spoken);
|
|
139
|
+
}
|
|
134
140
|
}
|
|
135
141
|
for (const tool of run.tools) {
|
|
136
142
|
if (!tools.some(other => other.name === tool.name)) {
|
|
@@ -179,8 +185,9 @@ export var WebExtensionRunUtil;
|
|
|
179
185
|
renderers,
|
|
180
186
|
codeRenderers,
|
|
181
187
|
codeSpeech,
|
|
188
|
+
codePointable,
|
|
182
189
|
callPartner: runs.flatMap(run => run.callPartners)[0],
|
|
183
|
-
callGroup: (
|
|
190
|
+
callGroup: (_b = runs.find(run => run.callPartners.length)) === null || _b === void 0 ? void 0 : _b.loaded.name,
|
|
184
191
|
callMouth: runs.flatMap(run => run.callMouths)[0],
|
|
185
192
|
callMoves: runs.flatMap(run => run.callMoves),
|
|
186
193
|
avatars,
|
|
@@ -172,6 +172,15 @@ export class WebExtensionsRunning {
|
|
|
172
172
|
void this.allow(info).then(allowed => allowed && this.refresh());
|
|
173
173
|
}
|
|
174
174
|
const loads = await Promise.all(starting.map(info => this.loadPackage(info)));
|
|
175
|
+
// The tabs of the views of one that starts again (a new version of a work) open again once it has: its page
|
|
176
|
+
// drawn anew beside the conversation, not closed under the user. One started on open starts again for them.
|
|
177
|
+
const prefix = WebViewUtil.editorId('');
|
|
178
|
+
const renewed = (id) => {
|
|
179
|
+
const info = fresh.get(id);
|
|
180
|
+
return !!info && this.running.has(id) && !this.same(this.running.get(id), info) && (info.activation === 'open' || starting.includes(info));
|
|
181
|
+
};
|
|
182
|
+
const reopen = this.current.editors.filter(editor => editor.id.startsWith(prefix) && renewed(editor.extension));
|
|
183
|
+
const active = reopen.some(editor => editor.id === this.current.activeEditor) ? this.current.activeEditor : undefined;
|
|
175
184
|
// Stopped only now, just before the new code starts: the views of the old one stay drawn until the next
|
|
176
185
|
// publish, and stopped while the new code is read (after an update, over the relay) they would show
|
|
177
186
|
// without the styles it took away.
|
|
@@ -194,6 +203,26 @@ export class WebExtensionsRunning {
|
|
|
194
203
|
this.placeholders = undefined;
|
|
195
204
|
// The list of those started on open may have changed too.
|
|
196
205
|
this.publish();
|
|
206
|
+
if (reopen.length > 0) {
|
|
207
|
+
// One in a sandbox registers its views as it starts: they are there to open once it did.
|
|
208
|
+
const ready = [...new Set(reopen.map(editor => editor.extension))].map(id => {
|
|
209
|
+
var _a;
|
|
210
|
+
const index = starting.findIndex(info => info.id === id);
|
|
211
|
+
const load = loads[index];
|
|
212
|
+
if (!load) {
|
|
213
|
+
return this.onDemand.ensure(fresh.get(id)).catch(() => undefined);
|
|
214
|
+
}
|
|
215
|
+
return 'factory' in load ? (_a = load.factory.ready) === null || _a === void 0 ? void 0 : _a.catch(() => undefined) : undefined;
|
|
216
|
+
});
|
|
217
|
+
void Promise.all(ready).then(() => {
|
|
218
|
+
for (const editor of reopen) {
|
|
219
|
+
this.openView(editor.id.slice(prefix.length), true);
|
|
220
|
+
}
|
|
221
|
+
if (active) {
|
|
222
|
+
this.tabs.show(active);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
197
226
|
changed = changed || stopped || starting.length > 0;
|
|
198
227
|
await this.tabs.restore();
|
|
199
228
|
return changed;
|
|
@@ -209,9 +238,10 @@ export class WebExtensionsRunning {
|
|
|
209
238
|
return false;
|
|
210
239
|
}
|
|
211
240
|
this.keptStarted = true;
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
241
|
+
const kept = this.code.list(host).filter(info => info.enabled !== false);
|
|
242
|
+
// Those started on open, in Quick open and on their links before the computer answers, or while it cannot.
|
|
243
|
+
const seeded = this.onDemand.seed(kept.filter(info => info.activation === 'open'));
|
|
244
|
+
const infos = kept.filter(info => info.activation !== 'open' && !this.running.has(info.id) && WebAccessUtil.granted(info) !== undefined);
|
|
215
245
|
const loads = await Promise.all(infos.map(async (info) => {
|
|
216
246
|
const code = await this.code.get(info.hash);
|
|
217
247
|
return code === undefined ? undefined : this.factoryOf(info, code).catch(() => undefined);
|
|
@@ -224,10 +254,10 @@ export class WebExtensionsRunning {
|
|
|
224
254
|
started = true;
|
|
225
255
|
}
|
|
226
256
|
}
|
|
227
|
-
if (started) {
|
|
257
|
+
if (started || seeded) {
|
|
228
258
|
this.publish();
|
|
229
259
|
}
|
|
230
|
-
return started;
|
|
260
|
+
return started || seeded;
|
|
231
261
|
}
|
|
232
262
|
/** Whether what runs is that of the list: the same code, allowed as much. */
|
|
233
263
|
same(run, info) {
|
|
@@ -253,13 +283,14 @@ export class WebExtensionsRunning {
|
|
|
253
283
|
}
|
|
254
284
|
async askAccess(info) {
|
|
255
285
|
var _a;
|
|
286
|
+
var _b;
|
|
256
287
|
const language = this.settings.state.language;
|
|
257
288
|
const say = (id) => message(language, id);
|
|
258
|
-
const access = (
|
|
289
|
+
const access = (_b = info.access) !== null && _b !== void 0 ? _b : 'full';
|
|
259
290
|
const yes = await this.notices.confirm({
|
|
260
291
|
title: say('ta.access.ask').replace('{name}', WebPagesUtil.title(info, language)),
|
|
261
292
|
message: [
|
|
262
|
-
say(info.regrant ? 'ta.access.updated' : 'ta.access.new'),
|
|
293
|
+
say(info.regrant ? 'ta.access.updated' : ((_a = info.temporary) === null || _a === void 0 ? void 0 : _a.from) === 'agent' ? 'ta.access.agent' : 'ta.access.new'),
|
|
263
294
|
say(`ta.access.${access}`),
|
|
264
295
|
say('ta.access.from').replace('{source}', WebAccessUtil.source(info, say)),
|
|
265
296
|
].join('\n'),
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FileDragUtil } from '../util/file-drag.js';
|
|
2
|
+
/** The files dragged in the page, as extensions read and set them (WebExtensionUI.fileDrag): one for all of them. */
|
|
3
|
+
export const WEB_FILE_DRAG = Object.freeze({ set: FileDragUtil.set, has: FileDragUtil.has, get: FileDragUtil.get, paths: FileDragUtil.paths });
|
|
4
|
+
//# sourceMappingURL=web-file-drag.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SavedHost, TaWorkbench } from '../workbench-protocol.js';
|
|
2
|
+
import type { WebHost, WebHosts } from './web-api-hosts.js';
|
|
3
|
+
/** The computers of the device as extensions see them (WebExtensionAPI.hosts): never their ways in. */
|
|
4
|
+
export declare namespace WebHostsUtil {
|
|
5
|
+
function of(workbench: () => TaWorkbench): WebHosts;
|
|
6
|
+
function hostOf(saved: SavedHost): WebHost;
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HostUtil } from '../hosts.js';
|
|
2
|
+
/** The computers of the device as extensions see them (WebExtensionAPI.hosts): never their ways in. */
|
|
3
|
+
export var WebHostsUtil;
|
|
4
|
+
(function (WebHostsUtil) {
|
|
5
|
+
function of(workbench) {
|
|
6
|
+
return {
|
|
7
|
+
current: () => {
|
|
8
|
+
const { hosts, host } = workbench().state;
|
|
9
|
+
const saved = hosts.find(one => one.id === host);
|
|
10
|
+
return saved && hostOf(saved);
|
|
11
|
+
},
|
|
12
|
+
list: () => workbench().state.hosts.map(hostOf),
|
|
13
|
+
keep: (link, name) => workbench().keepHost(link, name),
|
|
14
|
+
switchTo: id => workbench().switchTo(id),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
WebHostsUtil.of = of;
|
|
18
|
+
function hostOf(saved) {
|
|
19
|
+
var _a;
|
|
20
|
+
return {
|
|
21
|
+
id: saved.id,
|
|
22
|
+
name: HostUtil.label(saved),
|
|
23
|
+
...(((_a = saved.server) === null || _a === void 0 ? void 0 : _a.host) ? { machine: saved.server.host } : {}),
|
|
24
|
+
relay: 'pairing' in saved.credential,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
WebHostsUtil.hostOf = hostOf;
|
|
28
|
+
})(WebHostsUtil || (WebHostsUtil = {}));
|
|
29
|
+
//# sourceMappingURL=web-hosts.js.map
|
|
@@ -42,6 +42,11 @@ export declare class WebOnDemand {
|
|
|
42
42
|
get(id: string): TaWebExtensionInfo | undefined;
|
|
43
43
|
/** Those of the server's list now; one an agent just made for the user is told of, with a way to open it. */
|
|
44
44
|
set(infos: readonly TaWebExtensionInfo[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* Those of the list of the last time, before the computer answers (or while it cannot): their pages open from the
|
|
47
|
+
* code the device keeps, as those started with the page do. The list of the computer replaces them.
|
|
48
|
+
*/
|
|
49
|
+
seed(infos: readonly TaWebExtensionInfo[]): boolean;
|
|
45
50
|
/** The extension started on open that a view id is of: its name, or `<its name>/<view>`. */
|
|
46
51
|
find(viewId: string): TaWebExtensionInfo | undefined;
|
|
47
52
|
/** Starts it unless it runs, once however often asked meanwhile. */
|
|
@@ -58,6 +58,17 @@ export class WebOnDemand {
|
|
|
58
58
|
}
|
|
59
59
|
this.listed = true;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Those of the list of the last time, before the computer answers (or while it cannot): their pages open from the
|
|
63
|
+
* code the device keeps, as those started with the page do. The list of the computer replaces them.
|
|
64
|
+
*/
|
|
65
|
+
seed(infos) {
|
|
66
|
+
if (this.listed || this.infos.size > 0 || infos.length === 0) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
this.infos = new Map(infos.map(info => [info.id, info]));
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
61
72
|
/** The extension started on open that a view id is of: its name, or `<its name>/<view>`. */
|
|
62
73
|
find(viewId) {
|
|
63
74
|
for (const info of this.infos.values()) {
|
package/esm/browser/hosts.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export declare namespace HostUtil {
|
|
|
21
21
|
* keeps its place, name and use.
|
|
22
22
|
*/
|
|
23
23
|
function keep(list: HostList, id: string, credential: Credential, account: string, now: number): HostList;
|
|
24
|
+
/** A computer kept, not used yet: its way in the one given, its name kept when it has one. */
|
|
25
|
+
function add(list: HostList, id: string, credential: Credential, name: string | undefined, now: number): HostList;
|
|
24
26
|
function select(list: HostList, id: string, now: number): HostList;
|
|
25
27
|
/** None in use, all kept: the sign-in shows them to pick from. */
|
|
26
28
|
function leave(list: HostList): HostList;
|
package/esm/browser/hosts.js
CHANGED
|
@@ -91,6 +91,15 @@ export var HostUtil;
|
|
|
91
91
|
return { ...list, hosts: known ? list.hosts.map(one => (one === known ? next : one)) : [...list.hosts, next] };
|
|
92
92
|
}
|
|
93
93
|
HostUtil.keep = keep;
|
|
94
|
+
/** A computer kept, not used yet: its way in the one given, its name kept when it has one. */
|
|
95
|
+
function add(list, id, credential, name, now) {
|
|
96
|
+
const known = list.hosts.find(one => one.id === id);
|
|
97
|
+
const next = known
|
|
98
|
+
? { ...known, credential, ...(known.name || !name ? {} : { name }) }
|
|
99
|
+
: { id, credential, ...(name ? { name } : {}), addedAt: now, usedAt: 0 };
|
|
100
|
+
return { ...list, hosts: known ? list.hosts.map(one => (one === known ? next : one)) : [...list.hosts, next] };
|
|
101
|
+
}
|
|
102
|
+
HostUtil.add = add;
|
|
94
103
|
function select(list, id, now) {
|
|
95
104
|
return list.hosts.some(one => one.id === id) ? { current: id, hosts: list.hosts.map(one => (one.id === id ? { ...one, usedAt: now } : one)) } : list;
|
|
96
105
|
}
|
|
@@ -79,6 +79,9 @@ export declare const ASSISTANT_EN: {
|
|
|
79
79
|
'ta.task.branch': string;
|
|
80
80
|
'ta.task.stopped': string;
|
|
81
81
|
'ta.task.waiting': string;
|
|
82
|
+
'ta.task.waitingPermission': string;
|
|
83
|
+
'ta.task.waitingQuestion': string;
|
|
84
|
+
'ta.task.waitingAuth': string;
|
|
82
85
|
'ta.task.takenOver': string;
|
|
83
86
|
'ta.task.takeOver': string;
|
|
84
87
|
'ta.task.takeOverHint': string;
|
|
@@ -79,6 +79,9 @@ export const ASSISTANT_EN = {
|
|
|
79
79
|
'ta.task.branch': 'Branch {branch}',
|
|
80
80
|
'ta.task.stopped': 'Stopped',
|
|
81
81
|
'ta.task.waiting': 'Waiting for you',
|
|
82
|
+
'ta.task.waitingPermission': 'Waiting for you to allow',
|
|
83
|
+
'ta.task.waitingQuestion': 'Waiting for your answer',
|
|
84
|
+
'ta.task.waitingAuth': 'Waiting for you to sign in',
|
|
82
85
|
'ta.task.takenOver': 'You took it over',
|
|
83
86
|
'ta.task.takeOver': 'Take over',
|
|
84
87
|
'ta.task.takeOverHint': 'Go on with it yourself in the main area; the double stops following it',
|
|
@@ -180,6 +180,7 @@ export declare const CHAT_EN: {
|
|
|
180
180
|
'ta.composer.keyboard': string;
|
|
181
181
|
'ta.composer.steerTitle': string;
|
|
182
182
|
'ta.composer.addImage': string;
|
|
183
|
+
'ta.composer.addMedia': string;
|
|
183
184
|
'ta.composer.album': string;
|
|
184
185
|
'ta.composer.camera': string;
|
|
185
186
|
'ta.composer.more': string;
|
|
@@ -180,6 +180,7 @@ export const CHAT_EN = {
|
|
|
180
180
|
'ta.composer.keyboard': 'Type instead',
|
|
181
181
|
'ta.composer.steerTitle': 'Steer Ta (Enter); Alt+Enter queues a follow-up',
|
|
182
182
|
'ta.composer.addImage': 'Add images',
|
|
183
|
+
'ta.composer.addMedia': 'Add images or videos',
|
|
183
184
|
'ta.composer.album': 'Album',
|
|
184
185
|
'ta.composer.camera': 'Camera',
|
|
185
186
|
'ta.composer.more': 'Add and settings',
|
|
@@ -10,6 +10,7 @@ export const COMMON_EN = {
|
|
|
10
10
|
'ta.stop': 'Stop',
|
|
11
11
|
'ta.copy': 'Copy',
|
|
12
12
|
'ta.copied': 'Copied',
|
|
13
|
+
'ta.point.hint': 'Tap the part Ta should change',
|
|
13
14
|
'ta.markdown.source': 'Source',
|
|
14
15
|
'ta.markdown.diagram': 'Diagram',
|
|
15
16
|
'ta.markdown.download': 'Download SVG',
|
|
@@ -60,6 +60,7 @@ export declare const DISCOVER_EN: {
|
|
|
60
60
|
'ta.open.failed': string;
|
|
61
61
|
'ta.access.ask': string;
|
|
62
62
|
'ta.access.new': string;
|
|
63
|
+
'ta.access.agent': string;
|
|
63
64
|
'ta.access.updated': string;
|
|
64
65
|
'ta.access.full': string;
|
|
65
66
|
'ta.access.app': string;
|
|
@@ -67,6 +68,7 @@ export declare const DISCOVER_EN: {
|
|
|
67
68
|
'ta.access.from': string;
|
|
68
69
|
'ta.access.fromLink': string;
|
|
69
70
|
'ta.access.fromMarket': string;
|
|
71
|
+
'ta.access.fromAgent': string;
|
|
70
72
|
'ta.access.allow': string;
|
|
71
73
|
'ta.access.failed': string;
|
|
72
74
|
'ta.search.pages': string;
|
|
@@ -61,6 +61,7 @@ export const DISCOVER_EN = {
|
|
|
61
61
|
'ta.open.failed': 'Could not open it',
|
|
62
62
|
'ta.access.ask': 'Allow {name} to run?',
|
|
63
63
|
'ta.access.new': 'It is not one you made: it runs once you allow it.',
|
|
64
|
+
'ta.access.agent': 'Ta made it for you; it asks for more than a web page has, so it runs once you allow it.',
|
|
64
65
|
'ta.access.updated': 'It changed since you allowed it: this version runs once you allow it again.',
|
|
65
66
|
'ta.access.full': 'It asks for all Ta can do: read and write the files of this computer, run commands, read your conversations. Allow only what you trust.',
|
|
66
67
|
'ta.access.app': 'It asks for its own pages and the notices, widgets and voice of Ta, not for your files or conversations.',
|
|
@@ -68,6 +69,7 @@ export const DISCOVER_EN = {
|
|
|
68
69
|
'ta.access.from': 'From: {source}.',
|
|
69
70
|
'ta.access.fromLink': 'a link someone shared',
|
|
70
71
|
'ta.access.fromMarket': 'the market',
|
|
72
|
+
'ta.access.fromAgent': 'made by Ta for you',
|
|
71
73
|
'ta.access.allow': 'Allow',
|
|
72
74
|
'ta.access.failed': 'Could not allow it',
|
|
73
75
|
'ta.search.pages': 'Pages',
|