@celljs/ta-web 4.34.0 → 4.36.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/apps/app-icon.d.ts +23 -0
- package/esm/browser/apps/app-icon.js +98 -0
- package/esm/browser/apps/app-settings.d.ts +6 -0
- package/esm/browser/apps/app-settings.js +67 -0
- package/esm/browser/apps/app-window-util.d.ts +23 -0
- package/esm/browser/apps/app-window-util.js +27 -0
- package/esm/browser/apps/app-window.d.ts +9 -0
- package/esm/browser/apps/app-window.js +90 -0
- package/esm/browser/apps/web-apps.d.ts +29 -0
- package/esm/browser/apps/web-apps.js +57 -0
- package/esm/browser/assistant/assistant-thread.js +2 -2
- package/esm/browser/assistant/call-keeper.d.ts +2 -5
- package/esm/browser/assistant/call-keeper.js +7 -11
- package/esm/browser/assistant/mic-capture.d.ts +34 -0
- package/esm/browser/assistant/mic-capture.js +87 -0
- package/esm/browser/assistant/realtime-voice.d.ts +2 -2
- package/esm/browser/assistant/realtime-voice.js +6 -15
- package/esm/browser/components/access-settings.d.ts +6 -0
- package/esm/browser/components/access-settings.js +52 -0
- package/esm/browser/components/app-root.d.ts +6 -0
- package/esm/browser/components/app-root.js +34 -0
- package/esm/browser/components/app-view.d.ts +8 -2
- package/esm/browser/components/app-view.js +1 -25
- package/esm/browser/components/board.d.ts +2 -2
- package/esm/browser/components/board.js +2 -2
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-box-hooks.d.ts +12 -0
- package/esm/browser/components/composer-box-hooks.js +12 -0
- package/esm/browser/components/composer-box-protocol.d.ts +12 -1
- package/esm/browser/components/composer-box.js +14 -11
- package/esm/browser/components/composer.js +69 -3
- package/esm/browser/components/extension-settings.d.ts +7 -0
- package/esm/browser/components/extension-settings.js +32 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/message-list.js +3 -3
- package/esm/browser/components/message-steps.js +3 -3
- package/esm/browser/components/phone-shell.d.ts +2 -2
- package/esm/browser/components/request-error.d.ts +9 -0
- package/esm/browser/components/request-error.js +21 -0
- package/esm/browser/components/settings-more.js +13 -24
- package/esm/browser/components/storage-settings.d.ts +17 -0
- package/esm/browser/components/storage-settings.js +145 -0
- package/esm/browser/device/screen-awake.d.ts +16 -0
- package/esm/browser/device/screen-awake.js +37 -0
- package/esm/browser/device/sheet-swipe.js +4 -0
- package/esm/browser/extension/icons.js +2 -1
- package/esm/browser/extension/web-access.d.ts +16 -0
- package/esm/browser/extension/web-access.js +75 -0
- package/esm/browser/extension/web-api-contributions.d.ts +6 -7
- package/esm/browser/extension/web-api-desktop.d.ts +23 -0
- package/esm/browser/extension/web-api-spec.d.ts +70 -0
- package/esm/browser/extension/web-api-spec.js +225 -0
- package/esm/browser/extension/web-api-targets.d.ts +11 -0
- package/esm/browser/extension/web-api-targets.js +2 -0
- package/esm/browser/extension/web-extension-api.d.ts +11 -1
- package/esm/browser/extension/web-extension-context.d.ts +3 -2
- package/esm/browser/extension/web-extension-context.js +22 -17
- package/esm/browser/extension/web-extension-run.d.ts +8 -1
- package/esm/browser/extension/web-extension-run.js +37 -0
- package/esm/browser/extension/web-extensions-running.d.ts +20 -1
- package/esm/browser/extension/web-extensions-running.js +107 -9
- package/esm/browser/extension/web-extensions.js +1 -0
- package/esm/browser/extension/web-pages.d.ts +5 -0
- package/esm/browser/extension/web-pages.js +3 -0
- package/esm/browser/game/game-control.d.ts +6 -0
- package/esm/browser/game/game-control.js +28 -0
- package/esm/browser/game/game-host.d.ts +9 -2
- package/esm/browser/game/game-host.js +5 -1
- package/esm/browser/game/game-protocol.d.ts +8 -0
- package/esm/browser/game/game-runner.d.ts +7 -1
- package/esm/browser/game/game-runner.js +24 -2
- package/esm/browser/game/game-target.d.ts +22 -0
- package/esm/browser/game/game-target.js +84 -0
- package/esm/browser/game/game-util.d.ts +2 -0
- package/esm/browser/game/game-util.js +2 -0
- package/esm/browser/game/game-view.d.ts +5 -2
- package/esm/browser/game/game-view.js +4 -4
- package/esm/browser/game/game3d-protocol.d.ts +3 -1
- package/esm/browser/game/game3d-runner.d.ts +6 -1
- package/esm/browser/game/game3d-runner.js +26 -2
- package/esm/browser/i18n/en/chat.d.ts +4 -0
- package/esm/browser/i18n/en/chat.js +4 -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 +11 -0
- package/esm/browser/i18n/en/discover.js +11 -0
- package/esm/browser/i18n/en/settings.d.ts +43 -0
- package/esm/browser/i18n/en/settings.js +43 -0
- package/esm/browser/i18n/ja/chat.js +4 -0
- package/esm/browser/i18n/ja/common.js +1 -0
- package/esm/browser/i18n/ja/discover.js +11 -0
- package/esm/browser/i18n/ja/settings.js +43 -0
- package/esm/browser/i18n/locales.d.ts +60 -3
- package/esm/browser/i18n/messages.d.ts +59 -2
- package/esm/browser/i18n/zh/chat.js +4 -0
- package/esm/browser/i18n/zh/common.js +1 -0
- package/esm/browser/i18n/zh/discover.js +11 -0
- package/esm/browser/i18n/zh/settings.js +43 -0
- package/esm/browser/i18n/zh-tw/chat.js +4 -0
- package/esm/browser/i18n/zh-tw/common.js +1 -0
- package/esm/browser/i18n/zh-tw/discover.js +11 -0
- package/esm/browser/i18n/zh-tw/settings.js +43 -0
- package/esm/browser/index.d.ts +3 -0
- package/esm/browser/index.js +3 -0
- package/esm/browser/notices/notices.js +1 -0
- package/esm/browser/sandbox/channel/channel.d.ts +56 -0
- package/esm/browser/sandbox/channel/channel.js +124 -0
- package/esm/browser/sandbox/channel/codec.d.ts +80 -0
- package/esm/browser/sandbox/channel/codec.js +251 -0
- package/esm/browser/sandbox/hook-host.d.ts +23 -0
- package/esm/browser/sandbox/hook-host.js +61 -0
- package/esm/browser/sandbox/isolated-host.d.ts +105 -0
- package/esm/browser/sandbox/isolated-host.js +395 -0
- package/esm/browser/sandbox/remote/remote-copy.d.ts +57 -0
- package/esm/browser/sandbox/remote/remote-copy.js +318 -0
- package/esm/browser/sandbox/remote/remote-mirror.d.ts +61 -0
- package/esm/browser/sandbox/remote/remote-mirror.js +341 -0
- package/esm/browser/sandbox/remote/remote-protocol.d.ts +79 -0
- package/esm/browser/sandbox/remote/remote-protocol.js +54 -0
- package/esm/browser/sandbox/remote/remote-styles.d.ts +10 -0
- package/esm/browser/sandbox/remote/remote-styles.js +113 -0
- package/esm/browser/sandbox/remote-root.d.ts +11 -0
- package/esm/browser/sandbox/remote-root.js +81 -0
- package/esm/browser/sandbox/runtime/frame-api.d.ts +28 -0
- package/esm/browser/sandbox/runtime/frame-api.js +147 -0
- package/esm/browser/sandbox/runtime/frame-features.d.ts +6 -0
- package/esm/browser/sandbox/runtime/frame-features.js +50 -0
- package/esm/browser/sandbox/runtime/frame-parts.d.ts +36 -0
- package/esm/browser/sandbox/runtime/frame-parts.js +69 -0
- package/esm/browser/sandbox/runtime/frame-roots.d.ts +26 -0
- package/esm/browser/sandbox/runtime/frame-roots.js +76 -0
- package/esm/browser/sandbox/runtime/frame-store.d.ts +9 -0
- package/esm/browser/sandbox/runtime/frame-store.js +18 -0
- package/esm/browser/sandbox/runtime/sandbox-runtime.d.ts +11 -0
- package/esm/browser/sandbox/runtime/sandbox-runtime.js +45 -0
- package/esm/browser/sandbox/sandbox-features.d.ts +25 -0
- package/esm/browser/sandbox/sandbox-features.js +32 -0
- package/esm/browser/sandbox/sandbox-frame.d.ts +21 -0
- package/esm/browser/sandbox/sandbox-frame.js +75 -0
- package/esm/browser/sandbox/sandbox-guards.d.ts +19 -0
- package/esm/browser/sandbox/sandbox-guards.js +74 -0
- package/esm/browser/sandbox/sandbox-protocol.d.ts +57 -0
- package/esm/browser/sandbox/sandbox-protocol.js +49 -0
- package/esm/browser/sandbox/sandbox-runtime-code.d.ts +1 -0
- package/esm/browser/sandbox/sandbox-runtime-code.js +3 -0
- package/esm/browser/sandbox/web-sandbox.d.ts +28 -0
- package/esm/browser/sandbox/web-sandbox.js +44 -0
- package/esm/browser/settings/agent-settings.js +5 -1
- package/esm/browser/settings/settings-protocol.d.ts +2 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +2 -0
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +4 -0
- package/esm/browser/style/tints.d.ts +2 -0
- package/esm/browser/style/tints.js +10 -0
- package/esm/browser/targets/targets-protocol.d.ts +54 -0
- package/esm/browser/targets/targets-protocol.js +34 -0
- package/esm/browser/targets/targets.d.ts +13 -0
- package/esm/browser/targets/targets.js +64 -0
- package/esm/browser/util/composer.d.ts +4 -2
- package/esm/browser/util/composer.js +7 -1
- package/esm/browser/util/desktop.d.ts +31 -1
- package/esm/browser/util/desktop.js +20 -0
- package/esm/browser/util/message.d.ts +6 -0
- package/esm/browser/util/message.js +21 -0
- package/esm/browser/util/process.d.ts +1 -0
- package/esm/browser/util/process.js +6 -1
- package/esm/browser/util/progress.d.ts +2 -1
- package/esm/browser/util/progress.js +2 -11
- package/esm/browser/view.js +1 -1
- package/lib/browser/apps/app-icon.d.ts +24 -0
- package/lib/browser/apps/app-icon.js +134 -0
- package/lib/browser/apps/app-settings.d.ts +7 -0
- package/lib/browser/apps/app-settings.js +103 -0
- package/lib/browser/apps/app-window-util.d.ts +24 -0
- package/lib/browser/apps/app-window-util.js +30 -0
- package/lib/browser/apps/app-window.d.ts +10 -0
- package/lib/browser/apps/app-window.js +126 -0
- package/lib/browser/apps/web-apps.d.ts +30 -0
- package/lib/browser/apps/web-apps.js +61 -0
- package/lib/browser/assistant/assistant-thread.js +2 -2
- package/lib/browser/assistant/call-keeper.d.ts +2 -5
- package/lib/browser/assistant/call-keeper.js +6 -10
- package/lib/browser/assistant/mic-capture.d.ts +35 -0
- package/lib/browser/assistant/mic-capture.js +91 -0
- package/lib/browser/assistant/realtime-voice.d.ts +2 -2
- package/lib/browser/assistant/realtime-voice.js +6 -15
- package/lib/browser/components/access-settings.d.ts +7 -0
- package/lib/browser/components/access-settings.js +88 -0
- package/lib/browser/components/app-root.d.ts +7 -0
- package/lib/browser/components/app-root.js +70 -0
- package/lib/browser/components/app-view.d.ts +8 -2
- package/lib/browser/components/app-view.js +1 -25
- package/lib/browser/components/board.d.ts +2 -2
- package/lib/browser/components/board.js +2 -2
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-box-hooks.d.ts +12 -0
- package/lib/browser/components/composer-box-hooks.js +13 -0
- package/lib/browser/components/composer-box-protocol.d.ts +12 -1
- package/lib/browser/components/composer-box.js +13 -10
- package/lib/browser/components/composer.js +69 -3
- package/lib/browser/components/extension-settings.d.ts +8 -0
- package/lib/browser/components/extension-settings.js +69 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/message-list.js +3 -3
- package/lib/browser/components/message-steps.js +3 -3
- package/lib/browser/components/phone-shell.d.ts +2 -2
- package/lib/browser/components/request-error.d.ts +10 -0
- package/lib/browser/components/request-error.js +57 -0
- package/lib/browser/components/settings-more.js +12 -23
- package/lib/browser/components/storage-settings.d.ts +18 -0
- package/lib/browser/components/storage-settings.js +182 -0
- package/lib/browser/device/screen-awake.d.ts +16 -0
- package/lib/browser/device/screen-awake.js +39 -1
- package/lib/browser/device/sheet-swipe.js +4 -0
- package/lib/browser/extension/icons.js +1 -0
- package/lib/browser/extension/web-access.d.ts +17 -0
- package/lib/browser/extension/web-access.js +78 -0
- package/lib/browser/extension/web-api-contributions.d.ts +6 -7
- package/lib/browser/extension/web-api-desktop.d.ts +23 -0
- package/lib/browser/extension/web-api-spec.d.ts +71 -0
- package/lib/browser/extension/web-api-spec.js +228 -0
- package/lib/browser/extension/web-api-targets.d.ts +12 -0
- package/lib/browser/extension/web-api-targets.js +3 -0
- package/lib/browser/extension/web-extension-api.d.ts +11 -1
- package/lib/browser/extension/web-extension-context.d.ts +3 -2
- package/lib/browser/extension/web-extension-context.js +22 -17
- package/lib/browser/extension/web-extension-run.d.ts +8 -1
- package/lib/browser/extension/web-extension-run.js +37 -0
- package/lib/browser/extension/web-extensions-running.d.ts +20 -1
- package/lib/browser/extension/web-extensions-running.js +107 -9
- package/lib/browser/extension/web-extensions.js +1 -0
- package/lib/browser/extension/web-pages.d.ts +5 -0
- package/lib/browser/extension/web-pages.js +3 -0
- package/lib/browser/game/game-control.d.ts +6 -0
- package/lib/browser/game/game-control.js +28 -0
- package/lib/browser/game/game-host.d.ts +9 -2
- package/lib/browser/game/game-host.js +5 -1
- package/lib/browser/game/game-protocol.d.ts +8 -0
- package/lib/browser/game/game-runner.d.ts +7 -1
- package/lib/browser/game/game-runner.js +24 -2
- package/lib/browser/game/game-target.d.ts +23 -0
- package/lib/browser/game/game-target.js +87 -0
- package/lib/browser/game/game-util.d.ts +2 -0
- package/lib/browser/game/game-util.js +2 -0
- package/lib/browser/game/game-view.d.ts +5 -2
- package/lib/browser/game/game-view.js +4 -4
- package/lib/browser/game/game3d-protocol.d.ts +3 -1
- package/lib/browser/game/game3d-runner.d.ts +6 -1
- package/lib/browser/game/game3d-runner.js +26 -2
- package/lib/browser/i18n/en/chat.d.ts +4 -0
- package/lib/browser/i18n/en/chat.js +4 -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 +11 -0
- package/lib/browser/i18n/en/discover.js +11 -0
- package/lib/browser/i18n/en/settings.d.ts +43 -0
- package/lib/browser/i18n/en/settings.js +43 -0
- package/lib/browser/i18n/ja/chat.js +4 -0
- package/lib/browser/i18n/ja/common.js +1 -0
- package/lib/browser/i18n/ja/discover.js +11 -0
- package/lib/browser/i18n/ja/settings.js +43 -0
- package/lib/browser/i18n/locales.d.ts +60 -3
- package/lib/browser/i18n/messages.d.ts +59 -2
- package/lib/browser/i18n/zh/chat.js +4 -0
- package/lib/browser/i18n/zh/common.js +1 -0
- package/lib/browser/i18n/zh/discover.js +11 -0
- package/lib/browser/i18n/zh/settings.js +43 -0
- package/lib/browser/i18n/zh-tw/chat.js +4 -0
- package/lib/browser/i18n/zh-tw/common.js +1 -0
- package/lib/browser/i18n/zh-tw/discover.js +11 -0
- package/lib/browser/i18n/zh-tw/settings.js +43 -0
- package/lib/browser/index.d.ts +3 -0
- package/lib/browser/index.js +3 -0
- package/lib/browser/notices/notices.js +1 -0
- package/lib/browser/sandbox/channel/channel.d.ts +57 -0
- package/lib/browser/sandbox/channel/channel.js +128 -0
- package/lib/browser/sandbox/channel/codec.d.ts +81 -0
- package/lib/browser/sandbox/channel/codec.js +256 -0
- package/lib/browser/sandbox/hook-host.d.ts +24 -0
- package/lib/browser/sandbox/hook-host.js +98 -0
- package/lib/browser/sandbox/isolated-host.d.ts +106 -0
- package/lib/browser/sandbox/isolated-host.js +432 -0
- package/lib/browser/sandbox/remote/remote-copy.d.ts +58 -0
- package/lib/browser/sandbox/remote/remote-copy.js +322 -0
- package/lib/browser/sandbox/remote/remote-mirror.d.ts +62 -0
- package/lib/browser/sandbox/remote/remote-mirror.js +345 -0
- package/lib/browser/sandbox/remote/remote-protocol.d.ts +80 -0
- package/lib/browser/sandbox/remote/remote-protocol.js +57 -0
- package/lib/browser/sandbox/remote/remote-styles.d.ts +11 -0
- package/lib/browser/sandbox/remote/remote-styles.js +116 -0
- package/lib/browser/sandbox/remote-root.d.ts +12 -0
- package/lib/browser/sandbox/remote-root.js +117 -0
- package/lib/browser/sandbox/runtime/frame-api.d.ts +29 -0
- package/lib/browser/sandbox/runtime/frame-api.js +183 -0
- package/lib/browser/sandbox/runtime/frame-features.d.ts +7 -0
- package/lib/browser/sandbox/runtime/frame-features.js +53 -0
- package/lib/browser/sandbox/runtime/frame-parts.d.ts +37 -0
- package/lib/browser/sandbox/runtime/frame-parts.js +106 -0
- package/lib/browser/sandbox/runtime/frame-roots.d.ts +27 -0
- package/lib/browser/sandbox/runtime/frame-roots.js +113 -0
- package/lib/browser/sandbox/runtime/frame-store.d.ts +10 -0
- package/lib/browser/sandbox/runtime/frame-store.js +22 -0
- package/lib/browser/sandbox/runtime/sandbox-runtime.d.ts +12 -0
- package/lib/browser/sandbox/runtime/sandbox-runtime.js +47 -0
- package/lib/browser/sandbox/sandbox-features.d.ts +26 -0
- package/lib/browser/sandbox/sandbox-features.js +35 -0
- package/lib/browser/sandbox/sandbox-frame.d.ts +22 -0
- package/lib/browser/sandbox/sandbox-frame.js +79 -0
- package/lib/browser/sandbox/sandbox-guards.d.ts +20 -0
- package/lib/browser/sandbox/sandbox-guards.js +77 -0
- package/lib/browser/sandbox/sandbox-protocol.d.ts +58 -0
- package/lib/browser/sandbox/sandbox-protocol.js +52 -0
- package/lib/browser/sandbox/sandbox-runtime-code.d.ts +2 -0
- package/lib/browser/sandbox/sandbox-runtime-code.js +6 -0
- package/lib/browser/sandbox/web-sandbox.d.ts +29 -0
- package/lib/browser/sandbox/web-sandbox.js +47 -0
- package/lib/browser/settings/agent-settings.js +5 -1
- package/lib/browser/settings/settings-protocol.d.ts +2 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +2 -0
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +4 -0
- package/lib/browser/style/tints.d.ts +2 -0
- package/lib/browser/style/tints.js +10 -0
- package/lib/browser/targets/targets-protocol.d.ts +55 -0
- package/lib/browser/targets/targets-protocol.js +37 -0
- package/lib/browser/targets/targets.d.ts +14 -0
- package/lib/browser/targets/targets.js +67 -0
- package/lib/browser/util/composer.d.ts +4 -2
- package/lib/browser/util/composer.js +7 -1
- package/lib/browser/util/desktop.d.ts +31 -1
- package/lib/browser/util/desktop.js +20 -0
- package/lib/browser/util/message.d.ts +6 -0
- package/lib/browser/util/message.js +21 -0
- package/lib/browser/util/process.d.ts +1 -0
- package/lib/browser/util/process.js +6 -1
- package/lib/browser/util/progress.d.ts +2 -1
- package/lib/browser/util/progress.js +2 -11
- package/lib/browser/view.js +2 -2
- package/package.json +8 -8
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { TaExtensionAccess } from '@celljs/ta-protocol';
|
|
2
|
+
import type { WebExtensionAPI, WebExtensionUI } from './web-extension-api';
|
|
3
|
+
/**
|
|
4
|
+
* Where the components and the labels are in what crosses (docs/design/ta-extension-access.md 3.2): `C` a component,
|
|
5
|
+
* drawn where the page shows it; `L` a label, a string or a function read at once into one; `X` what the page would
|
|
6
|
+
* read without waiting and cannot from a sandbox, left out; or the fields of an object. Any other function is a
|
|
7
|
+
* callback, its result a promise; data is cloned as it is (a Blob too).
|
|
8
|
+
*/
|
|
9
|
+
export type WebApiShape = 'C' | 'L' | 'X' | WebApiFields;
|
|
10
|
+
export interface WebApiFields {
|
|
11
|
+
readonly fields?: Readonly<Record<string, WebApiShape>>;
|
|
12
|
+
/** Of every item of an array. */
|
|
13
|
+
readonly each?: WebApiShape;
|
|
14
|
+
/** Methods the page reads without waiting (`items()`): read where the extension runs, again whenever its `subscribe` says. */
|
|
15
|
+
readonly live?: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* How a member of the API crosses to an extension in a sandbox (3.2): `call` an async function; `fire` one that returns
|
|
19
|
+
* nothing; `hold` one that returns how to stop; `hook` a React hook whose value is data; `value` a property and `read`
|
|
20
|
+
* a method of no arguments, data both, read again as the page changes; `component` one of Ta, `components` a record of
|
|
21
|
+
* them; `group` an object of members of their own; `local` given by the sandbox itself; `page` only in the page, which is
|
|
22
|
+
* why it needs full access.
|
|
23
|
+
*/
|
|
24
|
+
export type WebApiForm = WebApiEntry['form'];
|
|
25
|
+
export type WebApiEntry = {
|
|
26
|
+
readonly form: 'page';
|
|
27
|
+
readonly access: 'full';
|
|
28
|
+
} | {
|
|
29
|
+
readonly form: 'local' | 'value' | 'read' | 'component' | 'components';
|
|
30
|
+
readonly access: TaExtensionAccess;
|
|
31
|
+
} | {
|
|
32
|
+
readonly form: 'fire' | 'hold';
|
|
33
|
+
readonly access: TaExtensionAccess;
|
|
34
|
+
readonly args?: readonly (WebApiShape | null)[];
|
|
35
|
+
}
|
|
36
|
+
/** `url`: it resolves with an address of the page, which a sandbox cannot load: what it holds crosses, a `blob:` there. */
|
|
37
|
+
| {
|
|
38
|
+
readonly form: 'call';
|
|
39
|
+
readonly access: TaExtensionAccess;
|
|
40
|
+
readonly args?: readonly (WebApiShape | null)[];
|
|
41
|
+
readonly returns?: 'url';
|
|
42
|
+
}
|
|
43
|
+
/** `peek`: a hook of no arguments, read before the extension starts, so that its first render has its value. */
|
|
44
|
+
| {
|
|
45
|
+
readonly form: 'hook';
|
|
46
|
+
readonly access: TaExtensionAccess;
|
|
47
|
+
readonly args?: readonly (WebApiShape | null)[];
|
|
48
|
+
readonly peek?: true;
|
|
49
|
+
} | {
|
|
50
|
+
readonly form: 'group';
|
|
51
|
+
readonly access: TaExtensionAccess;
|
|
52
|
+
readonly members: Readonly<Record<string, WebApiEntry>>;
|
|
53
|
+
};
|
|
54
|
+
/** An entry for every member: a member added to the API without one does not compile. */
|
|
55
|
+
export type WebApiSpec<T> = {
|
|
56
|
+
readonly [K in keyof Required<T>]: WebApiEntry;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* What each member of `pi.ui` needs and how it crosses. `browser`: what any page draws and asks. `app`: what Ta does
|
|
60
|
+
* for the extension as an app, in sight of the user. `full`: the computer, the conversations, the people, the other
|
|
61
|
+
* extensions, and what only the page can give (a page object, an element, an engine).
|
|
62
|
+
*/
|
|
63
|
+
export declare const WEB_UI_SPEC: WebApiSpec<WebExtensionUI>;
|
|
64
|
+
/** What each member of `pi` needs and how it crosses: one entry each, the only place it is said (3.2). */
|
|
65
|
+
export declare const WEB_API_SPEC: WebApiSpec<WebExtensionAPI>;
|
|
66
|
+
/** A member of the API by its path (`ui.voice.speak`), and every member with its path. */
|
|
67
|
+
export declare namespace WebApiSpecUtil {
|
|
68
|
+
function find(path: string): WebApiEntry | undefined;
|
|
69
|
+
function each(visit: (path: string, entry: WebApiEntry) => void, members?: Readonly<Record<string, WebApiEntry>>, prefix?: string): void;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=web-api-spec.d.ts.map
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebApiSpecUtil = exports.WEB_API_SPEC = exports.WEB_UI_SPEC = void 0;
|
|
4
|
+
const B = 'browser';
|
|
5
|
+
const A = 'app';
|
|
6
|
+
const page = { form: 'page', access: 'full' };
|
|
7
|
+
const local = (access) => ({ form: 'local', access });
|
|
8
|
+
const value = (access) => ({ form: 'value', access });
|
|
9
|
+
const read = (access) => ({ form: 'read', access });
|
|
10
|
+
const component = (access) => ({ form: 'component', access });
|
|
11
|
+
const call = (access, args) => ({ form: 'call', access, ...(args ? { args } : {}) });
|
|
12
|
+
const fire = (access, args) => ({ form: 'fire', access, ...(args ? { args } : {}) });
|
|
13
|
+
const hold = (access, args) => ({ form: 'hold', access, ...(args ? { args } : {}) });
|
|
14
|
+
const hook = (access, args) => ({ form: 'hook', access, ...(args ? { args } : {}) });
|
|
15
|
+
const peek = (access) => ({ form: 'hook', access, peek: true });
|
|
16
|
+
const group = (access, members) => ({ form: 'group', access, members });
|
|
17
|
+
/** A view, an editor tab: its components, its labels, and what the page reads of it without waiting. */
|
|
18
|
+
const VIEW = { fields: { title: 'L', render: 'C', head: 'C', mark: 'C', icon: 'C' }, live: ['menu', 'preview', 'busy'] };
|
|
19
|
+
const EDITOR = { fields: { title: 'L', tooltip: 'L', icon: 'C', render: 'C' } };
|
|
20
|
+
const SETTINGS = {
|
|
21
|
+
fields: {
|
|
22
|
+
title: 'L',
|
|
23
|
+
icon: 'C',
|
|
24
|
+
rows: { each: { fields: { label: 'L', search: 'L', description: 'L', render: 'C' } } },
|
|
25
|
+
signIn: { fields: { hint: 'L' } },
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const STORAGE = {
|
|
29
|
+
get: call(B),
|
|
30
|
+
set: call(B),
|
|
31
|
+
onChange: hold(B),
|
|
32
|
+
directory: page,
|
|
33
|
+
};
|
|
34
|
+
const APPS = {
|
|
35
|
+
installable: value(A),
|
|
36
|
+
list: call(A),
|
|
37
|
+
install: call(A),
|
|
38
|
+
remove: call(A),
|
|
39
|
+
open: call(A),
|
|
40
|
+
};
|
|
41
|
+
const VOICE = {
|
|
42
|
+
canListen: read(A),
|
|
43
|
+
canSpeak: read(A),
|
|
44
|
+
speak: fire(A),
|
|
45
|
+
hush: fire(A),
|
|
46
|
+
transcribe: call(A),
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* What each member of `pi.ui` needs and how it crosses. `browser`: what any page draws and asks. `app`: what Ta does
|
|
50
|
+
* for the extension as an app, in sight of the user. `full`: the computer, the conversations, the people, the other
|
|
51
|
+
* extensions, and what only the page can give (a page object, an element, an engine).
|
|
52
|
+
*/
|
|
53
|
+
exports.WEB_UI_SPEC = {
|
|
54
|
+
confirm: call(B),
|
|
55
|
+
input: call(B),
|
|
56
|
+
editor: call(B),
|
|
57
|
+
theme: value(B),
|
|
58
|
+
language: value(B),
|
|
59
|
+
supportsWebview: value(B),
|
|
60
|
+
doubleInChats: value(B),
|
|
61
|
+
useDevice: peek(B),
|
|
62
|
+
showView: call(B),
|
|
63
|
+
openSettings: fire(B),
|
|
64
|
+
showChats: fire(B),
|
|
65
|
+
custom: hold(B, ['C']),
|
|
66
|
+
openEditor: fire(B, [EDITOR]),
|
|
67
|
+
closeEditor: fire(B),
|
|
68
|
+
pinEditor: fire(B),
|
|
69
|
+
setEditorDirty: fire(B),
|
|
70
|
+
EditorActions: component(B),
|
|
71
|
+
Avatar: component(B),
|
|
72
|
+
Face: component(B),
|
|
73
|
+
GroupFace: component(B),
|
|
74
|
+
icons: { form: 'components', access: B },
|
|
75
|
+
CodeEditor: component(B),
|
|
76
|
+
DiffEditor: component(B),
|
|
77
|
+
FullScreen: component(B),
|
|
78
|
+
Stack: component(B),
|
|
79
|
+
Markdown: component(B),
|
|
80
|
+
Empty: component(B),
|
|
81
|
+
Loading: component(B),
|
|
82
|
+
Skeleton: component(B),
|
|
83
|
+
useBusy: local(B),
|
|
84
|
+
useBackLayer: hook(B),
|
|
85
|
+
Switch: component(B),
|
|
86
|
+
HostTag: component(B),
|
|
87
|
+
SwipeRow: component(B),
|
|
88
|
+
SelectCheck: component(B),
|
|
89
|
+
SelectBar: component(B),
|
|
90
|
+
TaskIcon: component(B),
|
|
91
|
+
Picture: component(B),
|
|
92
|
+
PictureCards: component(B),
|
|
93
|
+
ImageViewer: component(B),
|
|
94
|
+
ChatImages: component(B),
|
|
95
|
+
QrCode: component(B),
|
|
96
|
+
Dialog: component(B),
|
|
97
|
+
setWidget: fire(A, [null, 'C', { fields: { title: 'L' } }]),
|
|
98
|
+
notify: fire(A),
|
|
99
|
+
notifySession: fire(A),
|
|
100
|
+
usePages: peek(A),
|
|
101
|
+
scanCode: call(A),
|
|
102
|
+
scan: call(A),
|
|
103
|
+
saveFile: call(A),
|
|
104
|
+
shareExtension: fire(A),
|
|
105
|
+
stopExtension: fire(A),
|
|
106
|
+
forgetPage: fire(A),
|
|
107
|
+
useView: hook(A),
|
|
108
|
+
useScreenPart: hook(A),
|
|
109
|
+
useHomeShown: peek(A),
|
|
110
|
+
useActiveEditor: peek(A),
|
|
111
|
+
HoldToTalk: component(A),
|
|
112
|
+
voice: group(A, VOICE),
|
|
113
|
+
keepAwake: hold(A),
|
|
114
|
+
apps: group(A, APPS),
|
|
115
|
+
// An element, a node to draw, an answer at once, an engine: only in the page.
|
|
116
|
+
useContextMenu: page,
|
|
117
|
+
attachMenu: page,
|
|
118
|
+
useChatScroll: page,
|
|
119
|
+
fileDrag: page,
|
|
120
|
+
addToComposer: page,
|
|
121
|
+
Game: page,
|
|
122
|
+
Game3D: page,
|
|
123
|
+
// The computer, the conversations, the people, the other extensions.
|
|
124
|
+
useRoomAddons: page,
|
|
125
|
+
fileMenu: page,
|
|
126
|
+
pinChat: page,
|
|
127
|
+
desktop: page,
|
|
128
|
+
debugWebview: page,
|
|
129
|
+
useCwd: page,
|
|
130
|
+
useSessionId: page,
|
|
131
|
+
useSessions: page,
|
|
132
|
+
useSavedSessions: page,
|
|
133
|
+
useAsks: page,
|
|
134
|
+
answer: page,
|
|
135
|
+
screen: page,
|
|
136
|
+
openShared: page,
|
|
137
|
+
connect: page,
|
|
138
|
+
useTasks: page,
|
|
139
|
+
removeTasks: page,
|
|
140
|
+
createTerminal: page,
|
|
141
|
+
Composer: page,
|
|
142
|
+
Conversation: page,
|
|
143
|
+
ShareSheet: page,
|
|
144
|
+
FolderPicker: page,
|
|
145
|
+
ModelPicker: page,
|
|
146
|
+
useHomeItems: page,
|
|
147
|
+
openHome: page,
|
|
148
|
+
startGroup: page,
|
|
149
|
+
openPartner: page,
|
|
150
|
+
};
|
|
151
|
+
/** What each member of `pi` needs and how it crosses: one entry each, the only place it is said (3.2). */
|
|
152
|
+
exports.WEB_API_SPEC = {
|
|
153
|
+
React: local(B),
|
|
154
|
+
ui: group(B, exports.WEB_UI_SPEC),
|
|
155
|
+
storage: group(B, STORAGE),
|
|
156
|
+
fileUrl: { form: 'call', access: B, returns: 'url' },
|
|
157
|
+
openLink: call(B),
|
|
158
|
+
registerView: fire(B, [null, VIEW]),
|
|
159
|
+
registerMessageRenderer: fire(B, [null, 'C']),
|
|
160
|
+
registerCodeRenderer: fire(A, [null, 'C', { fields: { spoken: 'X' } }]),
|
|
161
|
+
registerAvatar: fire(A, ['C']),
|
|
162
|
+
registerHomeItems: fire(A, [{ live: ['items'] }]),
|
|
163
|
+
registerTasks: fire(A, [{ live: ['tasks'] }]),
|
|
164
|
+
registerSettings: fire(A, [SETTINGS]),
|
|
165
|
+
reloadExtensions: call(A),
|
|
166
|
+
// Drawn or answered at once, frame by frame: only in the page.
|
|
167
|
+
registerCallPartner: page,
|
|
168
|
+
registerCallMouth: page,
|
|
169
|
+
registerCallMoves: page,
|
|
170
|
+
registerChatIcon: page,
|
|
171
|
+
registerChatTag: page,
|
|
172
|
+
registerInitiative: page,
|
|
173
|
+
registerTool: page,
|
|
174
|
+
registerToolRenderer: page,
|
|
175
|
+
registerComposerAddon: page,
|
|
176
|
+
registerRoomAddon: page,
|
|
177
|
+
registerOpener: page,
|
|
178
|
+
registerSearch: page,
|
|
179
|
+
registerPartners: page,
|
|
180
|
+
registerSessionMenu: page,
|
|
181
|
+
registerFileMenu: page,
|
|
182
|
+
on: page,
|
|
183
|
+
sendUserMessage: page,
|
|
184
|
+
switchSession: page,
|
|
185
|
+
openChat: page,
|
|
186
|
+
callHost: page,
|
|
187
|
+
openTemporary: page,
|
|
188
|
+
onRoomEvent: page,
|
|
189
|
+
onTerminalData: page,
|
|
190
|
+
server: page,
|
|
191
|
+
workspace: page,
|
|
192
|
+
terminals: page,
|
|
193
|
+
packages: page,
|
|
194
|
+
files: page,
|
|
195
|
+
remote: page,
|
|
196
|
+
screenShare: page,
|
|
197
|
+
targets: page,
|
|
198
|
+
onScreenShareEvent: page,
|
|
199
|
+
settings: page,
|
|
200
|
+
rooms: page,
|
|
201
|
+
};
|
|
202
|
+
/** A member of the API by its path (`ui.voice.speak`), and every member with its path. */
|
|
203
|
+
var WebApiSpecUtil;
|
|
204
|
+
(function (WebApiSpecUtil) {
|
|
205
|
+
function find(path) {
|
|
206
|
+
let members = exports.WEB_API_SPEC;
|
|
207
|
+
let found;
|
|
208
|
+
for (const key of path.split('.')) {
|
|
209
|
+
found = Object.keys(members).includes(key) ? members[key] : undefined;
|
|
210
|
+
if (!found) {
|
|
211
|
+
return undefined;
|
|
212
|
+
}
|
|
213
|
+
members = found.form === 'group' ? found.members : {};
|
|
214
|
+
}
|
|
215
|
+
return found;
|
|
216
|
+
}
|
|
217
|
+
WebApiSpecUtil.find = find;
|
|
218
|
+
function each(visit, members = exports.WEB_API_SPEC, prefix = '') {
|
|
219
|
+
for (const [key, entry] of Object.entries(members)) {
|
|
220
|
+
visit(prefix + key, entry);
|
|
221
|
+
if (entry.form === 'group') {
|
|
222
|
+
each(visit, entry.members, `${prefix}${key}.`);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
WebApiSpecUtil.each = each;
|
|
227
|
+
})(WebApiSpecUtil || (exports.WebApiSpecUtil = WebApiSpecUtil = {}));
|
|
228
|
+
//# sourceMappingURL=web-api-spec.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Part of the web extension API (web-extension-api.ts, which exports it all): what a program may work on the page. */
|
|
2
|
+
import type { WebTargets } from '../targets/targets-protocol';
|
|
3
|
+
export type { TargetEvent, TargetSpec, WebTargets } from '../targets/targets-protocol';
|
|
4
|
+
export interface WebTargetsAPI {
|
|
5
|
+
/**
|
|
6
|
+
* What a program may work on its own clock (docs/design/ta-reflex.md): register a canvas, an editor, anything that
|
|
7
|
+
* says what is on it (`observe`) and takes actions (`act`), while it is there; the games of `ui.Game` and
|
|
8
|
+
* `ui.Game3D` are registered by the page. Newer than some Ta apps: `pi.targets?.…`.
|
|
9
|
+
*/
|
|
10
|
+
readonly targets?: WebTargets;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=web-api-targets.d.ts.map
|
|
@@ -14,6 +14,7 @@ import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home';
|
|
|
14
14
|
import type { WebFileRef, WebMenus } from './web-api-menus';
|
|
15
15
|
import type { WebServices } from './web-api-services';
|
|
16
16
|
import type { WebPackageStorage } from './web-api-storage';
|
|
17
|
+
import type { WebTargetsAPI } from './web-api-targets';
|
|
17
18
|
import type { WebTerminal, WebTerminalOptions } from './web-api-terminal';
|
|
18
19
|
import type { WebPageInfo } from './web-pages';
|
|
19
20
|
export type { Mood } from '../avatar/dino-avatar';
|
|
@@ -30,13 +31,14 @@ export type * from './web-api-home';
|
|
|
30
31
|
export type * from './web-api-menus';
|
|
31
32
|
export type * from './web-api-services';
|
|
32
33
|
export type * from './web-api-storage';
|
|
34
|
+
export type * from './web-api-targets';
|
|
33
35
|
export type * from './web-api-terminal';
|
|
34
36
|
export type { WebPageInfo, WebPageState } from './web-pages';
|
|
35
37
|
/**
|
|
36
38
|
* What a web extension gets: the web client's side of pi's extension API, its names where they mean the same. A web
|
|
37
39
|
* extension is one ES module without imports, the `web` part of a pi package (TaWebExtensionInfo): a {@link WebExtensionFactory}.
|
|
38
40
|
*/
|
|
39
|
-
export interface WebExtensionAPI extends WebServices, WebPartnersAPI, WebMenus, WebCallsAPI, WebChatTagsAPI {
|
|
41
|
+
export interface WebExtensionAPI extends WebServices, WebPartnersAPI, WebMenus, WebCallsAPI, WebChatTagsAPI, WebTargetsAPI {
|
|
40
42
|
/** The React of the page: an extension brings no React of its own. */
|
|
41
43
|
readonly React: typeof React;
|
|
42
44
|
readonly ui: WebExtensionUI;
|
|
@@ -316,6 +318,8 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
|
|
|
316
318
|
* The name of an extension alone opens its first page. Resolves whether there was such a view.
|
|
317
319
|
*/
|
|
318
320
|
showView(id: string): Promise<boolean>;
|
|
321
|
+
/** Opens the settings at a section of Ta's (`storage`, `navigation`) or none. Newer than some Ta apps: `pi.ui.openSettings?.(…)`. */
|
|
322
|
+
openSettings?(section?: string): void;
|
|
319
323
|
/**
|
|
320
324
|
* Shows the list of chats (on a phone its tab); with `busy`, only the conversations of the user's own going on
|
|
321
325
|
* (those that wait for them, answer now, or said something unseen), until the user clears it; on a phone these are
|
|
@@ -480,6 +484,12 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
|
|
|
480
484
|
readonly HoldToTalk: React.ComponentType<WebHoldToTalkProps>;
|
|
481
485
|
/** Listening and reading aloud as the conversations of the page do: its recognizer, the voice of the settings. */
|
|
482
486
|
readonly voice: WebVoice;
|
|
487
|
+
/**
|
|
488
|
+
* Keeps the device awake till the function it returns is called, as a call does: the screen does not lock (locked,
|
|
489
|
+
* a phone stops hearing), and Ta Desktop keeps the display on and does not restart. For what listens long (a
|
|
490
|
+
* meeting written down); let it go when it stops. Newer than some Ta apps: `pi.ui.keepAwake?.()`.
|
|
491
|
+
*/
|
|
492
|
+
readonly keepAwake?: () => () => void;
|
|
483
493
|
/** As the conversations show it; `inline`: in a line; `send`, `answer`: a group chat's, for taps in cards (newer). */
|
|
484
494
|
readonly Markdown: React.ComponentType<{
|
|
485
495
|
text: string;
|
|
@@ -7,6 +7,7 @@ import type { TaSessionNotices } from '../notices/session-notices';
|
|
|
7
7
|
import { type TaScreen } from '../screen/screen-protocol';
|
|
8
8
|
import type { TaSettings } from '../settings/settings-protocol';
|
|
9
9
|
import type { TaState } from '../state/state-protocol';
|
|
10
|
+
import { type TaTargets } from '../targets/targets-protocol';
|
|
10
11
|
import type { TaWorkbench } from '../workbench-protocol';
|
|
11
12
|
import type { WebCodeRendererProps } from './web-api-contributions';
|
|
12
13
|
import type { WebEditorTabs } from './web-editor-tabs';
|
|
@@ -29,6 +30,8 @@ export interface WebExtensionContextHost {
|
|
|
29
30
|
readonly persisted: TaState;
|
|
30
31
|
/** The parts of the screen and where the shell is (docs/design/ta-app-use.md 3). */
|
|
31
32
|
readonly screen: TaScreen;
|
|
33
|
+
/** What programs may work on the page (docs/design/ta-reflex.md 4). */
|
|
34
|
+
readonly targets: TaTargets;
|
|
32
35
|
/** What the extensions registered changed: the page shows it. */
|
|
33
36
|
publish(): void;
|
|
34
37
|
/** Runs what the extension gave, its failure logged rather than thrown. */
|
|
@@ -50,8 +53,6 @@ export declare class WebExtensionContext {
|
|
|
50
53
|
static marked(server: TaServer, mark: (text: string) => string): TaServer;
|
|
51
54
|
/** A renderer of code whose `send` (a choice tapped in it) says it came from the extension. */
|
|
52
55
|
static replying(Renderer: React.ComponentType<WebCodeRendererProps>, mark: (text: string) => string): React.ComponentType<WebCodeRendererProps>;
|
|
53
|
-
/** A path of a file of a package, relative to it and inside it (`./models/rex.glb`, `models\rex.glb`: `models/rex.glb`). */
|
|
54
|
-
static packagePath(path: string): string;
|
|
55
56
|
/** Monaco and the games in the theme and language of the settings, the same component for every extension. */
|
|
56
57
|
protected readonly codeEditor: (props: CodeEditorProps) => React.FunctionComponentElement<CodeEditorProps & {
|
|
57
58
|
settings: TaSettings;
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.WebExtensionContext = void 0;
|
|
37
37
|
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
38
38
|
const React = __importStar(require("react"));
|
|
39
|
+
const web_apps_1 = require("../apps/web-apps");
|
|
39
40
|
const task_views_1 = require("../assistant/task-views");
|
|
40
41
|
const web_voice_1 = require("../assistant/web-voice");
|
|
41
42
|
const busy_1 = require("../components/busy");
|
|
@@ -73,15 +74,18 @@ const back_stack_1 = require("../device/back-stack");
|
|
|
73
74
|
const code_scan_1 = require("../device/code-scan");
|
|
74
75
|
const device_1 = require("../device/device");
|
|
75
76
|
const file_save_1 = require("../device/file-save");
|
|
77
|
+
const screen_awake_1 = require("../device/screen-awake");
|
|
76
78
|
const drafts_protocol_1 = require("../drafts/drafts-protocol");
|
|
77
79
|
const game_view_1 = require("../game/game-view");
|
|
78
80
|
const messages_1 = require("../i18n/messages");
|
|
79
81
|
const use_t_1 = require("../i18n/use-t");
|
|
80
82
|
const screen_protocol_1 = require("../screen/screen-protocol");
|
|
83
|
+
const targets_protocol_1 = require("../targets/targets-protocol");
|
|
81
84
|
const web_terminal_1 = require("../terminal/web-terminal");
|
|
82
85
|
const desktop_1 = require("../util/desktop");
|
|
83
86
|
const file_drag_1 = require("../util/file-drag");
|
|
84
87
|
const icons_1 = require("./icons");
|
|
88
|
+
const web_access_1 = require("./web-access");
|
|
85
89
|
const web_extension_protocol_1 = require("./web-extension-protocol");
|
|
86
90
|
const web_extension_run_1 = require("./web-extension-run");
|
|
87
91
|
const web_home_1 = require("./web-home");
|
|
@@ -141,24 +145,13 @@ class WebExtensionContext {
|
|
|
141
145
|
return React.createElement(Renderer, { ...props, send: marked });
|
|
142
146
|
};
|
|
143
147
|
}
|
|
144
|
-
/** A path of a file of a package, relative to it and inside it (`./models/rex.glb`, `models\rex.glb`: `models/rex.glb`). */
|
|
145
|
-
static packagePath(path) {
|
|
146
|
-
const parts = path
|
|
147
|
-
.replace(/\\/g, '/')
|
|
148
|
-
.split('/')
|
|
149
|
-
.filter(part => part !== '' && part !== '.');
|
|
150
|
-
if (/^([a-z]:)?[\\/]/i.test(path) || parts.length === 0 || parts.includes('..')) {
|
|
151
|
-
throw new Error(`Not a file inside the package: ${path}`);
|
|
152
|
-
}
|
|
153
|
-
return parts.join('/');
|
|
154
|
-
}
|
|
155
148
|
/** The games of an extension, which Ta calls by its package's title on the screen unless they are given one. */
|
|
156
149
|
gamesOf(run) {
|
|
157
|
-
const { settings, screen } = this.host;
|
|
150
|
+
const { settings, screen, targets } = this.host;
|
|
158
151
|
const title = () => (run.loaded.info ? web_pages_1.WebPagesUtil.title(run.loaded.info, settings.state.language) : run.loaded.name);
|
|
159
152
|
return {
|
|
160
|
-
Game: (props) => { var _a; return React.createElement(game_view_1.GameView, { ...props, title: (_a = props.title) !== null && _a !== void 0 ? _a : title(), settings, screen }); },
|
|
161
|
-
Game3D: (props) => { var _a; return React.createElement(game_view_1.Game3DView, { ...props, title: (_a = props.title) !== null && _a !== void 0 ? _a : title(), settings, screen }); },
|
|
153
|
+
Game: (props) => { var _a; return React.createElement(game_view_1.GameView, { ...props, title: (_a = props.title) !== null && _a !== void 0 ? _a : title(), settings, screen, targets }); },
|
|
154
|
+
Game3D: (props) => { var _a; return React.createElement(game_view_1.Game3DView, { ...props, title: (_a = props.title) !== null && _a !== void 0 ? _a : title(), settings, screen, targets }); },
|
|
162
155
|
};
|
|
163
156
|
}
|
|
164
157
|
/** The message box of an extension: its drafts under its name, apart from those of the others. */
|
|
@@ -167,6 +160,7 @@ class WebExtensionContext {
|
|
|
167
160
|
return props => this.composer({ ...props, draft: props.draft === undefined ? undefined : drafts_protocol_1.DraftPlaces.extension(name, props.draft) });
|
|
168
161
|
}
|
|
169
162
|
create(run) {
|
|
163
|
+
var _a;
|
|
170
164
|
const { host } = this;
|
|
171
165
|
const { workbench, files } = host;
|
|
172
166
|
const register = (change) => {
|
|
@@ -184,7 +178,7 @@ class WebExtensionContext {
|
|
|
184
178
|
let server;
|
|
185
179
|
/** Listens while the extension runs, what it hears guarded as all it runs. */
|
|
186
180
|
const hear = (on, listener) => web_extension_run_1.WebExtensionRunUtil.track(run, () => on((...args) => host.guard(run, () => listener(...args))));
|
|
187
|
-
|
|
181
|
+
const api = {
|
|
188
182
|
React,
|
|
189
183
|
get server() {
|
|
190
184
|
if ((server === null || server === void 0 ? void 0 : server.of) !== workbench.server) {
|
|
@@ -210,7 +204,7 @@ class WebExtensionContext {
|
|
|
210
204
|
if (!root) {
|
|
211
205
|
throw new Error(`The web extension ${run.loaded.name} has no files of its own here.`);
|
|
212
206
|
}
|
|
213
|
-
return files.loadable(await workbench.workspace.fileUrl(
|
|
207
|
+
return files.loadable(await workbench.workspace.fileUrl(web_extension_run_1.WebExtensionRunUtil.packagePath(path), root));
|
|
214
208
|
}),
|
|
215
209
|
get remote() {
|
|
216
210
|
return workbench.remote;
|
|
@@ -218,6 +212,7 @@ class WebExtensionContext {
|
|
|
218
212
|
get screenShare() {
|
|
219
213
|
return workbench.screenShare;
|
|
220
214
|
},
|
|
215
|
+
targets: targets_protocol_1.TargetsUtil.forExtension(host.targets, () => run.stopped, subscribe => web_extension_run_1.WebExtensionRunUtil.track(run, subscribe)),
|
|
221
216
|
onScreenShareEvent: listener => hear(workbench.onScreenShareEvent.bind(workbench), listener),
|
|
222
217
|
get settings() {
|
|
223
218
|
return workbench.settings;
|
|
@@ -292,6 +287,8 @@ class WebExtensionContext {
|
|
|
292
287
|
callHost: (method, ...params) => live(() => workbench.packages.callPackageHost(run.loaded.name, method, params)),
|
|
293
288
|
reloadExtensions: () => live(() => host.extensions.reloadPackages()),
|
|
294
289
|
};
|
|
290
|
+
// As far as the user allowed this version of its package (docs/design/ta-extension-access.md); only an allowed one starts.
|
|
291
|
+
return web_access_1.WebAccessUtil.limit(api, (_a = web_access_1.WebAccessUtil.granted(run.loaded.info)) !== null && _a !== void 0 ? _a : 'browser', run.loaded.name);
|
|
295
292
|
}
|
|
296
293
|
ui(run, register) {
|
|
297
294
|
const { host } = this;
|
|
@@ -373,6 +370,11 @@ class WebExtensionContext {
|
|
|
373
370
|
},
|
|
374
371
|
useDevice: device_1.useDevice,
|
|
375
372
|
showView: id => (run.stopped ? Promise.resolve(false) : host.extensions.showView(id)),
|
|
373
|
+
openSettings: section => {
|
|
374
|
+
if (!run.stopped) {
|
|
375
|
+
host.extensions.openSettings(section);
|
|
376
|
+
}
|
|
377
|
+
},
|
|
376
378
|
showChats: options => {
|
|
377
379
|
if (!run.stopped) {
|
|
378
380
|
host.extensions.showChats(!!(options === null || options === void 0 ? void 0 : options.busy));
|
|
@@ -453,7 +455,10 @@ class WebExtensionContext {
|
|
|
453
455
|
GroupFace: face_1.GroupFace,
|
|
454
456
|
Composer: this.composerOf(run),
|
|
455
457
|
HoldToTalk: this.holdToTalk,
|
|
456
|
-
voice: this.voice,
|
|
458
|
+
voice: web_extension_run_1.WebExtensionRunUtil.voice(run, this.voice),
|
|
459
|
+
// Let go as the extension stops, whether or not it did; nothing held once stopped.
|
|
460
|
+
keepAwake: () => web_extension_run_1.WebExtensionRunUtil.track(run, () => screen_awake_1.KeepAwake.shared.hold()),
|
|
461
|
+
apps: web_apps_1.TaWebApps.of({ pages: () => host.extensions.pages(), settings, notices, fallbackIcon: icons_1.WEB_ICONS.Puzzle }),
|
|
457
462
|
Markdown: markdown_1.Markdown,
|
|
458
463
|
Conversation: conversation_view_1.ConversationView,
|
|
459
464
|
useChatScroll: (sent, key) => (0, conversation_scroll_hooks_1.useConversationScroll)(sent, { sentTo: 'bottom', key }),
|
|
@@ -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, WebComposerAddon, WebFileMenu, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WidgetOptions } from './web-extension-api';
|
|
3
|
+
import type { WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebComposerAddon, WebFileMenu, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebVoice, WidgetOptions } from './web-extension-api';
|
|
4
4
|
import type { LoadedWebExtension, WebExtensionsState } from './web-extension-protocol';
|
|
5
5
|
/** What an extension registered through its API: all of it goes when it stops. */
|
|
6
6
|
export interface WebRegistrations {
|
|
@@ -58,8 +58,15 @@ export declare namespace WebExtensionRunUtil {
|
|
|
58
58
|
function create(loaded: LoadedWebExtension, hash?: string): WebExtensionRun;
|
|
59
59
|
/** Stops what it registered and subscribed to; it registers nothing more. */
|
|
60
60
|
function clear(run: WebExtensionRun): void;
|
|
61
|
+
/** A path of a file of a package, relative to it and inside it (`./models/rex.glb`, `models\rex.glb`: `models/rex.glb`). */
|
|
62
|
+
function packagePath(path: string): string;
|
|
61
63
|
/** Subscribes for the extension: undone when it stops, or by the function returned. */
|
|
62
64
|
function track(run: WebExtensionRun, subscribe: () => () => void): () => void;
|
|
65
|
+
/**
|
|
66
|
+
* `ui.voice` of one extension: what it writes down ends as it stops, and once stopped it opens no microphone, as
|
|
67
|
+
* `ui.scanCode` opens no camera. Reading aloud stays: it does nothing for the user.
|
|
68
|
+
*/
|
|
69
|
+
function voice(run: WebExtensionRun, voice: WebVoice): WebVoice;
|
|
63
70
|
/** What the extensions that run registered, as the page shows it: the first of a message type or a tool name wins. */
|
|
64
71
|
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' | 'callGroup' | 'callMouth' | 'callMoves' | 'avatars' | 'chatIcons' | 'chatTags' | 'initiatives' | 'tools' | 'toolRenderers' | 'searches'>;
|
|
65
72
|
}
|
|
@@ -62,6 +62,18 @@ var WebExtensionRunUtil;
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
WebExtensionRunUtil.clear = clear;
|
|
65
|
+
/** A path of a file of a package, relative to it and inside it (`./models/rex.glb`, `models\rex.glb`: `models/rex.glb`). */
|
|
66
|
+
function packagePath(path) {
|
|
67
|
+
const parts = path
|
|
68
|
+
.replace(/\\/g, '/')
|
|
69
|
+
.split('/')
|
|
70
|
+
.filter(part => part !== '' && part !== '.');
|
|
71
|
+
if (/^([a-z]:)?[\\/]/i.test(path) || parts.length === 0 || parts.includes('..')) {
|
|
72
|
+
throw new Error(`Not a file inside the package: ${path}`);
|
|
73
|
+
}
|
|
74
|
+
return parts.join('/');
|
|
75
|
+
}
|
|
76
|
+
WebExtensionRunUtil.packagePath = packagePath;
|
|
65
77
|
/** Subscribes for the extension: undone when it stops, or by the function returned. */
|
|
66
78
|
function track(run, subscribe) {
|
|
67
79
|
if (run.stopped) {
|
|
@@ -75,6 +87,31 @@ var WebExtensionRunUtil;
|
|
|
75
87
|
};
|
|
76
88
|
}
|
|
77
89
|
WebExtensionRunUtil.track = track;
|
|
90
|
+
/**
|
|
91
|
+
* `ui.voice` of one extension: what it writes down ends as it stops, and once stopped it opens no microphone, as
|
|
92
|
+
* `ui.scanCode` opens no camera. Reading aloud stays: it does nothing for the user.
|
|
93
|
+
*/
|
|
94
|
+
function voice(run, voice) {
|
|
95
|
+
return {
|
|
96
|
+
...voice,
|
|
97
|
+
transcribe: async (listener) => {
|
|
98
|
+
const transcribing = run.stopped ? undefined : await voice.transcribe(listener);
|
|
99
|
+
if (!transcribing || run.stopped) {
|
|
100
|
+
transcribing === null || transcribing === void 0 ? void 0 : transcribing.stop();
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
let stopped = false;
|
|
104
|
+
const stop = () => {
|
|
105
|
+
if (!stopped) {
|
|
106
|
+
stopped = true;
|
|
107
|
+
transcribing.stop();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
return { service: transcribing.service, stop: track(run, () => stop) };
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
WebExtensionRunUtil.voice = voice;
|
|
78
115
|
/** What the extensions that run registered, as the page shows it: the first of a message type or a tool name wins. */
|
|
79
116
|
function collect(runs, onOpen) {
|
|
80
117
|
var _a;
|
|
@@ -6,6 +6,7 @@ import { TaSessionNotices } from '../notices/session-notices';
|
|
|
6
6
|
import { TaScreen } from '../screen/screen-protocol';
|
|
7
7
|
import { TaSettings } from '../settings/settings-protocol';
|
|
8
8
|
import { TaState } from '../state/state-protocol';
|
|
9
|
+
import { TaTargets } from '../targets/targets-protocol';
|
|
9
10
|
import { TaWorkbench } from '../workbench-protocol';
|
|
10
11
|
import { WebEditorTabs } from './web-editor-tabs';
|
|
11
12
|
import type { WebExtensionFactory } from './web-extension-api';
|
|
@@ -33,6 +34,7 @@ export declare abstract class WebExtensionsRunning {
|
|
|
33
34
|
protected readonly persisted: TaState;
|
|
34
35
|
protected readonly sessionNotices: TaSessionNotices;
|
|
35
36
|
protected readonly screen: TaScreen;
|
|
37
|
+
protected readonly targets: TaTargets;
|
|
36
38
|
readonly builtins: BuiltinWebExtension[];
|
|
37
39
|
readonly tasks: WebTaskBoard;
|
|
38
40
|
readonly home: WebHomeBoard;
|
|
@@ -55,6 +57,9 @@ export declare abstract class WebExtensionsRunning {
|
|
|
55
57
|
protected placeholders?: WebViewEntry[];
|
|
56
58
|
protected started?: WebOnDemand;
|
|
57
59
|
protected readonly pageList: WebPageList;
|
|
60
|
+
/** Versions the user did not allow in this page (`<id>:<hash>`): not asked again until it loads again or they change. */
|
|
61
|
+
protected readonly refused: Set<string>;
|
|
62
|
+
protected readonly asking: Map<string, Promise<boolean>>;
|
|
58
63
|
get state(): WebExtensionsState;
|
|
59
64
|
protected init(): void;
|
|
60
65
|
/** The extensions started on open (ta-launcher.md). */
|
|
@@ -62,7 +67,7 @@ export declare abstract class WebExtensionsRunning {
|
|
|
62
67
|
/** The kinds the pages of the extensions there are list (TaWebExtensionInfo.lists), started or not. */
|
|
63
68
|
protected listedKinds(): Set<string>;
|
|
64
69
|
/** Loads and starts an extension started on open, as reconcile starts the others. */
|
|
65
|
-
protected launch(
|
|
70
|
+
protected launch(asked: TaWebExtensionInfo): Promise<void>;
|
|
66
71
|
/** Stops one started on open: it is still listed, to start again; its page, if shown, gives way to the conversation. */
|
|
67
72
|
protected stopOnDemand(id: string): void;
|
|
68
73
|
protected reconcile(): Promise<boolean>;
|
|
@@ -73,6 +78,14 @@ export declare abstract class WebExtensionsRunning {
|
|
|
73
78
|
* still the same and stops the others.
|
|
74
79
|
*/
|
|
75
80
|
protected startKept(host: string | undefined): Promise<boolean>;
|
|
81
|
+
/** Whether what runs is that of the list: the same code, allowed as much. */
|
|
82
|
+
protected same(run: WebExtensionRun | undefined, info: TaWebExtensionInfo): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* It as it may start: allowed already, or allowed by the user now (docs/design/ta-extension-access.md); undefined
|
|
85
|
+
* when they did not allow it. Asked once at a time, and not again in this page once refused.
|
|
86
|
+
*/
|
|
87
|
+
protected allow(info: TaWebExtensionInfo): Promise<TaWebExtensionInfo | undefined>;
|
|
88
|
+
protected askAccess(info: TaWebExtensionInfo): Promise<boolean>;
|
|
76
89
|
/** Stops and forgets the extensions running that `keep` does not keep; whether there were any. */
|
|
77
90
|
protected stopUnless(keep: (run: WebExtensionRun) => boolean): boolean;
|
|
78
91
|
protected loadPackage(info: TaWebExtensionInfo): Promise<{
|
|
@@ -81,6 +94,11 @@ export declare abstract class WebExtensionsRunning {
|
|
|
81
94
|
} | {
|
|
82
95
|
error: string;
|
|
83
96
|
}>;
|
|
97
|
+
/**
|
|
98
|
+
* What starts an extension: its module, imported into the page; or, for one the user allowed less than all, its code
|
|
99
|
+
* to run in a sandbox, never imported here (docs/design/ta-extension-access.md 3).
|
|
100
|
+
*/
|
|
101
|
+
protected factoryOf(info: TaWebExtensionInfo, code: string): Promise<WebExtensionFactory>;
|
|
84
102
|
protected startPackage(info: TaWebExtensionInfo, load: {
|
|
85
103
|
factory: WebExtensionFactory;
|
|
86
104
|
hash: string;
|
|
@@ -92,6 +110,7 @@ export declare abstract class WebExtensionsRunning {
|
|
|
92
110
|
protected guard(run: WebExtensionRun, action: () => void): void;
|
|
93
111
|
protected publish(): void;
|
|
94
112
|
protected update(change: Partial<WebExtensionsState>): void;
|
|
113
|
+
abstract refresh(): Promise<boolean>;
|
|
95
114
|
abstract openView(id: string, preserveFocus?: boolean): void;
|
|
96
115
|
abstract showView(id: string): Promise<boolean>;
|
|
97
116
|
protected abstract get context(): WebExtensionContext;
|