@celljs/ta-host 4.17.0 → 4.19.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/node/account-service.d.ts +73 -0
- package/esm/node/account-service.js +304 -0
- package/esm/node/app-commands.d.ts +1 -1
- package/esm/node/app-commands.js +46 -29
- package/esm/node/credentials.d.ts +12 -0
- package/esm/node/credentials.js +35 -0
- package/esm/node/host-protocol.d.ts +2 -0
- package/esm/node/host-protocol.js +2 -0
- package/esm/node/index.d.ts +3 -0
- package/esm/node/index.js +3 -0
- package/esm/node/keep-awake.d.ts +3 -0
- package/esm/node/keep-awake.js +6 -1
- package/esm/node/package-hosts.d.ts +4 -0
- package/esm/node/package-hosts.js +18 -1
- package/esm/node/relay-bridge.js +1 -1
- package/esm/node/rooms-bridge.d.ts +10 -1
- package/esm/node/rooms-bridge.js +25 -0
- package/esm/node/screen-share/desktop-picture.d.ts +51 -0
- package/esm/node/screen-share/desktop-picture.js +133 -0
- package/esm/node/screen-share/desktop-session.d.ts +128 -0
- package/esm/node/screen-share/desktop-session.js +437 -0
- package/esm/node/screen-share/desktop-targets.d.ts +24 -0
- package/esm/node/screen-share/desktop-targets.js +80 -0
- package/esm/node/screen-share/desktop-viewer.d.ts +146 -0
- package/esm/node/screen-share/desktop-viewer.js +339 -0
- package/esm/node/screen-share/index.d.ts +8 -0
- package/esm/node/screen-share/index.js +9 -0
- package/esm/node/screen-share/rfb-client.d.ts +54 -0
- package/esm/node/screen-share/rfb-client.js +179 -0
- package/esm/node/screen-share/rfb-des.d.ts +11 -0
- package/esm/node/screen-share/rfb-des.js +143 -0
- package/esm/node/screen-share/rfb-encodings.d.ts +71 -0
- package/esm/node/screen-share/rfb-encodings.js +288 -0
- package/esm/node/screen-share/rfb-framebuffer.d.ts +16 -0
- package/esm/node/screen-share/rfb-framebuffer.js +53 -0
- package/esm/node/screen-share/rfb-protocol.d.ts +90 -0
- package/esm/node/screen-share/rfb-protocol.js +36 -0
- package/esm/node/screen-share/rfb-reader.d.ts +34 -0
- package/esm/node/screen-share/rfb-reader.js +110 -0
- package/esm/node/screen-share/rfb-security.d.ts +30 -0
- package/esm/node/screen-share/rfb-security.js +136 -0
- package/esm/node/screen-share/rfb-test-server.d.ts +37 -0
- package/esm/node/screen-share/rfb-test-server.js +116 -0
- package/esm/node/screen-share/screen-share-server-impl.d.ts +37 -0
- package/esm/node/screen-share/screen-share-server-impl.js +76 -0
- package/esm/node/screen-share/screen-shares.d.ts +123 -0
- package/esm/node/screen-share/screen-shares.js +463 -0
- package/esm/node/session-info-util.d.ts +10 -11
- package/esm/node/session-info-util.js +16 -94
- package/esm/node/settings-store.d.ts +1 -1
- package/esm/node/settings-store.js +7 -4
- package/esm/node/sign-in/access-store.d.ts +1 -1
- package/esm/node/sign-in/access-store.js +4 -1
- package/esm/node/sign-in/index.d.ts +2 -0
- package/esm/node/sign-in/index.js +2 -0
- package/esm/node/sign-in/polled-sign-in.d.ts +50 -0
- package/esm/node/sign-in/polled-sign-in.js +83 -0
- package/esm/node/sign-in/sign-in-devices.d.ts +55 -0
- package/esm/node/sign-in/sign-in-devices.js +113 -0
- package/esm/node/sign-in/sign-in-flow.d.ts +38 -4
- package/esm/node/sign-in/sign-in-flow.js +79 -4
- package/esm/node/sign-in/sign-in-pages.d.ts +8 -0
- package/esm/node/sign-in/sign-in-pages.js +137 -8
- package/esm/node/sign-in/sign-in-provider.d.ts +6 -0
- package/esm/node/sign-in/sign-in-provider.js +15 -0
- package/esm/node/sources-extension.d.ts +10 -0
- package/esm/node/sources-extension.js +18 -0
- package/esm/node/ta-server-impl.js +3 -3
- package/esm/node/ta-session-factory.js +2 -0
- package/esm/node/team/team-calls.js +35 -0
- package/esm/node/voice-bridge.d.ts +3 -1
- package/esm/node/voice-bridge.js +10 -3
- package/esm/node/voices-file.d.ts +5 -0
- package/esm/node/voices-file.js +14 -3
- package/esm/node/working-directory.d.ts +8 -2
- package/esm/node/working-directory.js +7 -0
- package/lib/node/account-service.d.ts +74 -0
- package/lib/node/account-service.js +307 -0
- package/lib/node/app-commands.d.ts +1 -1
- package/lib/node/app-commands.js +46 -29
- package/lib/node/credentials.d.ts +13 -0
- package/lib/node/credentials.js +38 -0
- package/lib/node/host-protocol.d.ts +2 -0
- package/lib/node/host-protocol.js +3 -1
- package/lib/node/index.d.ts +3 -0
- package/lib/node/index.js +3 -0
- package/lib/node/keep-awake.d.ts +3 -0
- package/lib/node/keep-awake.js +6 -1
- package/lib/node/package-hosts.d.ts +4 -0
- package/lib/node/package-hosts.js +17 -0
- package/lib/node/relay-bridge.js +1 -1
- package/lib/node/rooms-bridge.d.ts +10 -1
- package/lib/node/rooms-bridge.js +25 -0
- package/lib/node/screen-share/desktop-picture.d.ts +52 -0
- package/lib/node/screen-share/desktop-picture.js +136 -0
- package/lib/node/screen-share/desktop-session.d.ts +129 -0
- package/lib/node/screen-share/desktop-session.js +442 -0
- package/lib/node/screen-share/desktop-targets.d.ts +25 -0
- package/lib/node/screen-share/desktop-targets.js +84 -0
- package/lib/node/screen-share/desktop-viewer.d.ts +147 -0
- package/lib/node/screen-share/desktop-viewer.js +343 -0
- package/lib/node/screen-share/index.d.ts +9 -0
- package/lib/node/screen-share/index.js +25 -0
- package/lib/node/screen-share/rfb-client.d.ts +55 -0
- package/lib/node/screen-share/rfb-client.js +183 -0
- package/lib/node/screen-share/rfb-des.d.ts +12 -0
- package/lib/node/screen-share/rfb-des.js +146 -0
- package/lib/node/screen-share/rfb-encodings.d.ts +72 -0
- package/lib/node/screen-share/rfb-encodings.js +295 -0
- package/lib/node/screen-share/rfb-framebuffer.d.ts +17 -0
- package/lib/node/screen-share/rfb-framebuffer.js +57 -0
- package/lib/node/screen-share/rfb-protocol.d.ts +91 -0
- package/lib/node/screen-share/rfb-protocol.js +39 -0
- package/lib/node/screen-share/rfb-reader.d.ts +35 -0
- package/lib/node/screen-share/rfb-reader.js +115 -0
- package/lib/node/screen-share/rfb-security.d.ts +31 -0
- package/lib/node/screen-share/rfb-security.js +141 -0
- package/lib/node/screen-share/rfb-test-server.d.ts +38 -0
- package/lib/node/screen-share/rfb-test-server.js +120 -0
- package/lib/node/screen-share/screen-share-server-impl.d.ts +38 -0
- package/lib/node/screen-share/screen-share-server-impl.js +79 -0
- package/lib/node/screen-share/screen-shares.d.ts +124 -0
- package/lib/node/screen-share/screen-shares.js +464 -0
- package/lib/node/session-info-util.d.ts +10 -11
- package/lib/node/session-info-util.js +15 -93
- package/lib/node/settings-store.d.ts +1 -1
- package/lib/node/settings-store.js +6 -3
- package/lib/node/sign-in/access-store.d.ts +1 -1
- package/lib/node/sign-in/access-store.js +4 -1
- package/lib/node/sign-in/index.d.ts +2 -0
- package/lib/node/sign-in/index.js +2 -0
- package/lib/node/sign-in/polled-sign-in.d.ts +51 -0
- package/lib/node/sign-in/polled-sign-in.js +87 -0
- package/lib/node/sign-in/sign-in-devices.d.ts +56 -0
- package/lib/node/sign-in/sign-in-devices.js +117 -0
- package/lib/node/sign-in/sign-in-flow.d.ts +38 -4
- package/lib/node/sign-in/sign-in-flow.js +80 -5
- package/lib/node/sign-in/sign-in-pages.d.ts +8 -0
- package/lib/node/sign-in/sign-in-pages.js +136 -7
- package/lib/node/sign-in/sign-in-provider.d.ts +6 -0
- package/lib/node/sign-in/sign-in-provider.js +15 -0
- package/lib/node/sources-extension.d.ts +11 -0
- package/lib/node/sources-extension.js +22 -0
- package/lib/node/ta-server-impl.js +2 -2
- package/lib/node/ta-session-factory.js +2 -0
- package/lib/node/team/team-calls.js +35 -0
- package/lib/node/voice-bridge.d.ts +3 -1
- package/lib/node/voice-bridge.js +9 -2
- package/lib/node/voices-file.d.ts +5 -0
- package/lib/node/voices-file.js +14 -3
- package/lib/node/working-directory.d.ts +8 -2
- package/lib/node/working-directory.js +7 -0
- package/package.json +14 -10
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { RpcConnection } from '@celljs/rpc/lib/node';
|
|
2
|
+
import { ExecEnvironmentFactory, type ExecSocket } from '@celljs/ta-exec';
|
|
3
|
+
import { type TaDesktopControl, type TaDesktopEvent, type TaDesktopFrames, type TaDesktopInfo, type TaDesktopInput, type TaDesktopPrompt, type TaDesktopScreen, type TaDesktopSignIn, type TaDesktopTarget, type TaDesktopView, type TaDesktopViewer } from '@celljs/ta-protocol';
|
|
4
|
+
import { TaCredentials } from '../credentials.js';
|
|
5
|
+
import { RemoteHosts } from '../remote/remote-protocol.js';
|
|
6
|
+
import { TaPrincipals } from '../team/team-protocol.js';
|
|
7
|
+
import { TaWorkingDirectory } from '../working-directory.js';
|
|
8
|
+
import { DesktopSession } from './desktop-session.js';
|
|
9
|
+
import { DesktopTargets } from './desktop-targets.js';
|
|
10
|
+
import { DesktopViewer } from './desktop-viewer.js';
|
|
11
|
+
import type { RfbCredentials } from './rfb-protocol.js';
|
|
12
|
+
interface Waiting {
|
|
13
|
+
prompt: TaDesktopPrompt;
|
|
14
|
+
settle(answer: TaDesktopSignIn | undefined, remember?: boolean): void;
|
|
15
|
+
}
|
|
16
|
+
/** What a desktop signs in with now: kept or forgotten once it tells whether it took it. */
|
|
17
|
+
interface Signing {
|
|
18
|
+
credential: RfbCredentials;
|
|
19
|
+
/** It came from the store. */
|
|
20
|
+
kept: boolean;
|
|
21
|
+
/** The user asked to keep it. */
|
|
22
|
+
remember: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface Entry {
|
|
25
|
+
viewer: DesktopViewer;
|
|
26
|
+
session: DesktopSession;
|
|
27
|
+
orphan?: ReturnType<typeof setTimeout>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The desktops ta serve shows and works for the owner's pages (docs/design/ta-desktop-remote.md): which there are,
|
|
31
|
+
* one DesktopSession for each one looked at, the viewers of the pages, and what a connection asks of whoever is there.
|
|
32
|
+
* Its connections go through the ExecEnvironment of the machine of the desktop, never a socket to a machine of its own
|
|
33
|
+
* choosing; only the desktops of the list are ever reached. In the first stage every call is the owner's
|
|
34
|
+
* (team-calls.ts), so there is no one else to check here.
|
|
35
|
+
*/
|
|
36
|
+
export declare class ScreenShares {
|
|
37
|
+
protected readonly environments: ExecEnvironmentFactory;
|
|
38
|
+
protected readonly hosts: RemoteHosts;
|
|
39
|
+
protected readonly workingDirectory: TaWorkingDirectory;
|
|
40
|
+
protected readonly principals: TaPrincipals;
|
|
41
|
+
protected readonly credentialStores: TaCredentials;
|
|
42
|
+
protected readonly sessions: Map<string, DesktopSession>;
|
|
43
|
+
protected readonly viewers: Map<string, Entry>;
|
|
44
|
+
protected readonly waiting: Map<string, Waiting>;
|
|
45
|
+
protected readonly watchers: Set<RpcConnection>;
|
|
46
|
+
protected readonly closing: WeakSet<RpcConnection>;
|
|
47
|
+
protected readonly signing: Map<string, Signing>;
|
|
48
|
+
/** Desktops that refused the sign-in kept for them: asked again until one is taken. */
|
|
49
|
+
protected readonly refused: Set<string>;
|
|
50
|
+
/** The account each desktop was signed in to last, put in the form next time. */
|
|
51
|
+
protected readonly users: Map<string, string>;
|
|
52
|
+
protected targetsOf?: DesktopTargets;
|
|
53
|
+
protected get targets(): DesktopTargets;
|
|
54
|
+
list(connection?: RpcConnection): TaDesktopInfo[];
|
|
55
|
+
add(target: TaDesktopTarget): TaDesktopInfo;
|
|
56
|
+
remove(desktopId: string): void;
|
|
57
|
+
open(connection: RpcConnection, options: {
|
|
58
|
+
target: TaDesktopTarget;
|
|
59
|
+
view: TaDesktopView;
|
|
60
|
+
clientMessageId: string;
|
|
61
|
+
device?: string;
|
|
62
|
+
}): TaDesktopViewer;
|
|
63
|
+
close(connection: RpcConnection, viewerId: string): void;
|
|
64
|
+
read(connection: RpcConnection, viewerId: string, want: number): Promise<TaDesktopFrames>;
|
|
65
|
+
setView(connection: RpcConnection, viewerId: string, view: TaDesktopView): void;
|
|
66
|
+
input(connection: RpcConnection, viewerId: string, batch: {
|
|
67
|
+
seq: number;
|
|
68
|
+
events: TaDesktopInput[];
|
|
69
|
+
}): void;
|
|
70
|
+
paste(connection: RpcConnection, viewerId: string, input: {
|
|
71
|
+
text: string;
|
|
72
|
+
press?: boolean;
|
|
73
|
+
clientMessageId: string;
|
|
74
|
+
}): void;
|
|
75
|
+
take(connection: RpcConnection, viewerId: string): {
|
|
76
|
+
control: TaDesktopControl | null;
|
|
77
|
+
asked: boolean;
|
|
78
|
+
};
|
|
79
|
+
release(connection: RpcConnection, viewerId: string): void;
|
|
80
|
+
/** Ends every viewer of every desktop, and their connections. */
|
|
81
|
+
endAll(): void;
|
|
82
|
+
/** The screens of a desktop: connecting to it for a while when no page does. */
|
|
83
|
+
screens(target: TaDesktopTarget): Promise<TaDesktopScreen[]>;
|
|
84
|
+
watch(connection: RpcConnection): TaDesktopPrompt[];
|
|
85
|
+
answer(promptId: string, answer: TaDesktopSignIn | null, remember?: boolean): boolean;
|
|
86
|
+
/** Whether anyone looks at a desktop now: the computer stays awake meanwhile. */
|
|
87
|
+
get watched(): boolean;
|
|
88
|
+
dispose(): void;
|
|
89
|
+
protected find(target: TaDesktopTarget | undefined): TaDesktopInfo;
|
|
90
|
+
protected connect(target: TaDesktopTarget): Promise<ExecSocket>;
|
|
91
|
+
static connectHere(port: number, host: string): Promise<ExecSocket>;
|
|
92
|
+
/**
|
|
93
|
+
* The account of the Screen Sharing of macOS, or the password of VNC: the one kept for the desktop, unless it
|
|
94
|
+
* refused it; else asked of every page of the owner in one form, who may have it kept.
|
|
95
|
+
*/
|
|
96
|
+
protected credentials(info: TaDesktopInfo, need: {
|
|
97
|
+
username: boolean;
|
|
98
|
+
refused?: boolean;
|
|
99
|
+
}): Promise<RfbCredentials | undefined>;
|
|
100
|
+
/** A desktop took the sign-in or refused it: one the user asked to keep is kept now, a kept one refused is asked again. */
|
|
101
|
+
protected signedIn(info: TaDesktopInfo, taken: boolean): void;
|
|
102
|
+
protected ask(prompt: TaDesktopPrompt): Promise<{
|
|
103
|
+
answer?: TaDesktopSignIn;
|
|
104
|
+
remember: boolean;
|
|
105
|
+
}>;
|
|
106
|
+
protected broadcast(event: TaDesktopEvent): void;
|
|
107
|
+
protected entryOf(connection: RpcConnection, viewerId: string): Entry | undefined;
|
|
108
|
+
protected require(connection: RpcConnection, viewerId: string): Entry;
|
|
109
|
+
/** A viewer belongs to the connection that calls for it last; when that one drops, it waits ORPHAN_MS for the page. */
|
|
110
|
+
protected adopt(entry: Entry, connection: RpcConnection): void;
|
|
111
|
+
protected drop(viewerId: string): void;
|
|
112
|
+
protected viewerOf(entry: Entry): TaDesktopViewer;
|
|
113
|
+
protected described(info: TaDesktopInfo, connection?: RpcConnection): TaDesktopInfo;
|
|
114
|
+
protected nameOf(principal: string): string;
|
|
115
|
+
/** What a page answered, checked: a password, and an account when one came. */
|
|
116
|
+
static signInOf(answer: unknown): TaDesktopSignIn | undefined;
|
|
117
|
+
/** The account of whoever runs ta serve: the one to sign in to this computer with. */
|
|
118
|
+
static localUser(): string | undefined;
|
|
119
|
+
/** The id of the sign-in of a desktop in the store. */
|
|
120
|
+
static credentialId(desktopId: string): string;
|
|
121
|
+
protected static device(device: unknown): string;
|
|
122
|
+
}
|
|
123
|
+
export {};
|
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import { createRequire as __cellCreateRequire } from "node:module";
|
|
2
|
+
const require = __cellCreateRequire(import.meta.url);
|
|
3
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8
|
+
};
|
|
9
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11
|
+
};
|
|
12
|
+
var ScreenShares_1;
|
|
13
|
+
import { randomBytes, randomUUID } from 'node:crypto';
|
|
14
|
+
import { connect as connectHere } from 'node:net';
|
|
15
|
+
import { hostname, userInfo } from 'node:os';
|
|
16
|
+
import { Autowired, Component } from '@celljs/core';
|
|
17
|
+
import { ExecEnvironmentFactory } from '@celljs/ta-exec';
|
|
18
|
+
import { TA_OWNER, TaClient, TaDesktopUtil, TaLocation, } from '@celljs/ta-protocol';
|
|
19
|
+
import { TaCredentials } from '../credentials.js';
|
|
20
|
+
import { RemoteHosts } from '../remote/remote-protocol.js';
|
|
21
|
+
import { TaErrors } from '../ta-errors.js';
|
|
22
|
+
import { TaPrincipals } from '../team/team-protocol.js';
|
|
23
|
+
import { TaWorkingDirectory } from '../working-directory.js';
|
|
24
|
+
import { DesktopSession } from './desktop-session.js';
|
|
25
|
+
import { DesktopTargets } from './desktop-targets.js';
|
|
26
|
+
import { DesktopViewer } from './desktop-viewer.js';
|
|
27
|
+
/** A prompt nobody answers is given up after this. */
|
|
28
|
+
const PROMPT_TIMEOUT_MS = 5 * 60000;
|
|
29
|
+
/** Pages that may look at one desktop at once (docs/design/ta-desktop-remote.md 8.3). */
|
|
30
|
+
const MAX_VIEWERS = 4;
|
|
31
|
+
/** What a viewer stays after its connection dropped: a page that comes back within it goes on. */
|
|
32
|
+
const ORPHAN_MS = 30000;
|
|
33
|
+
/** How long listDesktopScreens waits for a desktop to connect. */
|
|
34
|
+
const SCREENS_WAIT_MS = 15000;
|
|
35
|
+
/**
|
|
36
|
+
* The desktops ta serve shows and works for the owner's pages (docs/design/ta-desktop-remote.md): which there are,
|
|
37
|
+
* one DesktopSession for each one looked at, the viewers of the pages, and what a connection asks of whoever is there.
|
|
38
|
+
* Its connections go through the ExecEnvironment of the machine of the desktop, never a socket to a machine of its own
|
|
39
|
+
* choosing; only the desktops of the list are ever reached. In the first stage every call is the owner's
|
|
40
|
+
* (team-calls.ts), so there is no one else to check here.
|
|
41
|
+
*/
|
|
42
|
+
let ScreenShares = ScreenShares_1 = class ScreenShares {
|
|
43
|
+
constructor() {
|
|
44
|
+
this.sessions = new Map();
|
|
45
|
+
this.viewers = new Map();
|
|
46
|
+
this.waiting = new Map();
|
|
47
|
+
this.watchers = new Set();
|
|
48
|
+
this.closing = new WeakSet();
|
|
49
|
+
this.signing = new Map();
|
|
50
|
+
/** Desktops that refused the sign-in kept for them: asked again until one is taken. */
|
|
51
|
+
this.refused = new Set();
|
|
52
|
+
/** The account each desktop was signed in to last, put in the form next time. */
|
|
53
|
+
this.users = new Map();
|
|
54
|
+
}
|
|
55
|
+
get targets() {
|
|
56
|
+
var _a;
|
|
57
|
+
(_a = this.targetsOf) !== null && _a !== void 0 ? _a : (this.targetsOf = new DesktopTargets(this.workingDirectory));
|
|
58
|
+
return this.targetsOf;
|
|
59
|
+
}
|
|
60
|
+
list(connection) {
|
|
61
|
+
const hosts = this.hosts.list().filter(host => !TaLocation.isCloud(host.host));
|
|
62
|
+
return this.targets
|
|
63
|
+
.list(hostname(), hosts.map(host => host.host))
|
|
64
|
+
.map(info => this.described(info, connection));
|
|
65
|
+
}
|
|
66
|
+
add(target) {
|
|
67
|
+
return this.described(this.targets.add(target));
|
|
68
|
+
}
|
|
69
|
+
remove(desktopId) {
|
|
70
|
+
this.targets.remove(desktopId);
|
|
71
|
+
const session = this.sessions.get(desktopId);
|
|
72
|
+
if (session) {
|
|
73
|
+
for (const viewerId of [...session.viewers.keys()]) {
|
|
74
|
+
this.drop(viewerId);
|
|
75
|
+
}
|
|
76
|
+
session.close();
|
|
77
|
+
this.sessions.delete(desktopId);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
open(connection, options) {
|
|
81
|
+
const { view, clientMessageId } = options !== null && options !== void 0 ? options : {};
|
|
82
|
+
if (typeof clientMessageId !== 'string' || !clientMessageId || clientMessageId.length > 200) {
|
|
83
|
+
throw TaErrors.invalidArgument('openDesktop needs a clientMessageId.', 'Compute one from the page and the desktop.');
|
|
84
|
+
}
|
|
85
|
+
const info = this.find(options.target);
|
|
86
|
+
const principal = this.principals.of(connection);
|
|
87
|
+
// The same page asking again (a lost answer, a new connection after a drop): the same viewer while it lives.
|
|
88
|
+
for (const entry of this.viewers.values()) {
|
|
89
|
+
if (entry.viewer.clientMessageId === clientMessageId && entry.viewer.principal === principal && entry.session.id === info.id) {
|
|
90
|
+
this.adopt(entry, connection);
|
|
91
|
+
entry.viewer.setView(view, entry.session.framebuffer);
|
|
92
|
+
return this.viewerOf(entry);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
let session = this.sessions.get(info.id);
|
|
96
|
+
if (!session) {
|
|
97
|
+
const created = new DesktopSession(info.id, info.name, {
|
|
98
|
+
connect: () => this.connect(info.target),
|
|
99
|
+
credentials: need => this.credentials(info, need),
|
|
100
|
+
signedIn: taken => this.signedIn(info, taken),
|
|
101
|
+
nameOf: who => this.nameOf(who),
|
|
102
|
+
idle: () => {
|
|
103
|
+
if (this.sessions.get(info.id) === created) {
|
|
104
|
+
this.sessions.delete(info.id);
|
|
105
|
+
}
|
|
106
|
+
// What it asked and no one answered is asked no more.
|
|
107
|
+
for (const waiting of [...this.waiting.values()].filter(one => one.prompt.desktop === info.id)) {
|
|
108
|
+
waiting.settle(undefined);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
session = created;
|
|
113
|
+
this.sessions.set(info.id, created);
|
|
114
|
+
}
|
|
115
|
+
if (session.viewers.size >= MAX_VIEWERS) {
|
|
116
|
+
throw TaErrors.invalidArgument(`${MAX_VIEWERS} pages look at this computer already.`, 'Close one of them first.');
|
|
117
|
+
}
|
|
118
|
+
// Random and never used again: a viewer opened anew counts its frames from 1, and a claim of the old one is unknown.
|
|
119
|
+
const viewer = new DesktopViewer(randomBytes(16).toString('hex'), connection, principal, clientMessageId, ScreenShares_1.device(options.device), view);
|
|
120
|
+
const entry = { viewer, session };
|
|
121
|
+
this.viewers.set(viewer.id, entry);
|
|
122
|
+
this.adopt(entry, connection);
|
|
123
|
+
session.add(viewer);
|
|
124
|
+
// Opening is acting: the owner's page works the desktop at once, taking it from another page of theirs.
|
|
125
|
+
session.take(viewer, holder => holder.principal === TA_OWNER);
|
|
126
|
+
return this.viewerOf(entry);
|
|
127
|
+
}
|
|
128
|
+
close(connection, viewerId) {
|
|
129
|
+
if (this.entryOf(connection, viewerId)) {
|
|
130
|
+
this.drop(viewerId);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async read(connection, viewerId, want) {
|
|
134
|
+
const entry = this.entryOf(connection, viewerId);
|
|
135
|
+
if (!entry) {
|
|
136
|
+
return { seq: 0, unknown: true, waited: 0, tiles: [] };
|
|
137
|
+
}
|
|
138
|
+
this.adopt(entry, connection);
|
|
139
|
+
return entry.session.read(entry.viewer, Number(want));
|
|
140
|
+
}
|
|
141
|
+
setView(connection, viewerId, view) {
|
|
142
|
+
const { viewer, session } = this.require(connection, viewerId);
|
|
143
|
+
viewer.setView(view, session.framebuffer, session.screenOf(view === null || view === void 0 ? void 0 : view.screen));
|
|
144
|
+
}
|
|
145
|
+
input(connection, viewerId, batch) {
|
|
146
|
+
const { viewer, session } = this.require(connection, viewerId);
|
|
147
|
+
session.input(viewer, batch);
|
|
148
|
+
}
|
|
149
|
+
paste(connection, viewerId, input) {
|
|
150
|
+
var _a;
|
|
151
|
+
const { viewer, session } = this.require(connection, viewerId);
|
|
152
|
+
if (typeof (input === null || input === void 0 ? void 0 : input.text) !== 'string' || input.text.length > 64 * 1024) {
|
|
153
|
+
throw TaErrors.invalidArgument('The text to paste is too long.', 'Paste at most 64 KB at once.');
|
|
154
|
+
}
|
|
155
|
+
session.paste(viewer, input.text, !!input.press, String((_a = input.clientMessageId) !== null && _a !== void 0 ? _a : ''));
|
|
156
|
+
}
|
|
157
|
+
take(connection, viewerId) {
|
|
158
|
+
const { viewer, session } = this.require(connection, viewerId);
|
|
159
|
+
// Among the pages of one person, whoever takes it has it (docs/design/ta-desktop-remote.md 6.4).
|
|
160
|
+
return { control: session.take(viewer, holder => holder.principal === viewer.principal), asked: false };
|
|
161
|
+
}
|
|
162
|
+
release(connection, viewerId) {
|
|
163
|
+
const { viewer, session } = this.require(connection, viewerId);
|
|
164
|
+
session.release(viewer);
|
|
165
|
+
}
|
|
166
|
+
/** Ends every viewer of every desktop, and their connections. */
|
|
167
|
+
endAll() {
|
|
168
|
+
for (const viewerId of [...this.viewers.keys()]) {
|
|
169
|
+
this.drop(viewerId);
|
|
170
|
+
}
|
|
171
|
+
for (const session of this.sessions.values()) {
|
|
172
|
+
session.close();
|
|
173
|
+
}
|
|
174
|
+
this.sessions.clear();
|
|
175
|
+
}
|
|
176
|
+
/** The screens of a desktop: connecting to it for a while when no page does. */
|
|
177
|
+
async screens(target) {
|
|
178
|
+
const info = this.find(target);
|
|
179
|
+
const session = this.sessions.get(info.id);
|
|
180
|
+
if (session === null || session === void 0 ? void 0 : session.showing) {
|
|
181
|
+
return session.screensOf();
|
|
182
|
+
}
|
|
183
|
+
const probe = session !== null && session !== void 0 ? session : new DesktopSession(info.id, info.name, {
|
|
184
|
+
connect: () => this.connect(info.target),
|
|
185
|
+
credentials: need => this.credentials(info, need),
|
|
186
|
+
signedIn: taken => this.signedIn(info, taken),
|
|
187
|
+
nameOf: who => this.nameOf(who),
|
|
188
|
+
idle: () => undefined,
|
|
189
|
+
});
|
|
190
|
+
try {
|
|
191
|
+
await Promise.race([probe.start(), new Promise(resolve => setTimeout(resolve, SCREENS_WAIT_MS))]);
|
|
192
|
+
if (probe.link !== 'live') {
|
|
193
|
+
throw TaErrors.invalidArgument(`${info.name} did not connect${probe.error ? `: ${probe.error}` : ''}.`, 'Check that its screen sharing is on.');
|
|
194
|
+
}
|
|
195
|
+
return probe.screensOf();
|
|
196
|
+
}
|
|
197
|
+
finally {
|
|
198
|
+
if (!session) {
|
|
199
|
+
probe.close();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
watch(connection) {
|
|
204
|
+
if (!this.watchers.has(connection)) {
|
|
205
|
+
this.watchers.add(connection);
|
|
206
|
+
connection.onClose(() => this.watchers.delete(connection));
|
|
207
|
+
}
|
|
208
|
+
return [...this.waiting.values()].map(({ prompt }) => prompt);
|
|
209
|
+
}
|
|
210
|
+
answer(promptId, answer, remember = false) {
|
|
211
|
+
const waiting = this.waiting.get(promptId);
|
|
212
|
+
waiting === null || waiting === void 0 ? void 0 : waiting.settle(ScreenShares_1.signInOf(answer), remember);
|
|
213
|
+
return waiting !== undefined;
|
|
214
|
+
}
|
|
215
|
+
/** Whether anyone looks at a desktop now: the computer stays awake meanwhile. */
|
|
216
|
+
get watched() {
|
|
217
|
+
return this.viewers.size > 0;
|
|
218
|
+
}
|
|
219
|
+
dispose() {
|
|
220
|
+
for (const waiting of [...this.waiting.values()]) {
|
|
221
|
+
waiting.settle(undefined);
|
|
222
|
+
}
|
|
223
|
+
this.endAll();
|
|
224
|
+
}
|
|
225
|
+
find(target) {
|
|
226
|
+
const id = target ? TaDesktopUtil.id(target) : '';
|
|
227
|
+
const info = this.list().find(one => one.id === id);
|
|
228
|
+
if (!info) {
|
|
229
|
+
throw TaErrors.invalidArgument(`There is no desktop ${id || 'named'}.`, 'Pick one of listDesktops, or add it with addDesktop.');
|
|
230
|
+
}
|
|
231
|
+
return info;
|
|
232
|
+
}
|
|
233
|
+
async connect(target) {
|
|
234
|
+
const env = this.environments.create(target.via ? await this.environments.resolve(target.via) : await this.environments.defaultCwd());
|
|
235
|
+
const port = TaDesktopUtil.port(target);
|
|
236
|
+
const host = TaDesktopUtil.host(target);
|
|
237
|
+
if (env.connect) {
|
|
238
|
+
return env.connect(port, host);
|
|
239
|
+
}
|
|
240
|
+
if (!env.local) {
|
|
241
|
+
throw TaErrors.invalidArgument('This machine cannot open connections for Ta.', 'Update Ta on it.');
|
|
242
|
+
}
|
|
243
|
+
// This machine: an environment of it has no connect (PortForwards takes that for "nothing to forward").
|
|
244
|
+
return ScreenShares_1.connectHere(port, host);
|
|
245
|
+
}
|
|
246
|
+
static connectHere(port, host) {
|
|
247
|
+
return new Promise((resolve, reject) => {
|
|
248
|
+
const socket = connectHere({ port, host });
|
|
249
|
+
socket.once('error', reject);
|
|
250
|
+
socket.once('connect', () => {
|
|
251
|
+
socket.off('error', reject);
|
|
252
|
+
// Errors once connected end it; onClose tells.
|
|
253
|
+
socket.on('error', () => undefined);
|
|
254
|
+
socket.setNoDelay(true);
|
|
255
|
+
resolve({
|
|
256
|
+
write: data => void socket.write(data),
|
|
257
|
+
end: () => void socket.end(),
|
|
258
|
+
onData: listener => void socket.on('data', listener),
|
|
259
|
+
onClose: listener => (socket.destroyed ? listener() : void socket.once('close', () => listener())),
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* The account of the Screen Sharing of macOS, or the password of VNC: the one kept for the desktop, unless it
|
|
266
|
+
* refused it; else asked of every page of the owner in one form, who may have it kept.
|
|
267
|
+
*/
|
|
268
|
+
async credentials(info, need) {
|
|
269
|
+
var _a, _b;
|
|
270
|
+
const store = this.credentialStores.store;
|
|
271
|
+
let kept;
|
|
272
|
+
if (store) {
|
|
273
|
+
kept = await store.get(ScreenShares_1.credentialId(info.id)).catch(() => undefined);
|
|
274
|
+
if (!need.refused && !this.refused.has(info.id) && (kept === null || kept === void 0 ? void 0 : kept.password) && (!need.username || kept.username !== undefined)) {
|
|
275
|
+
this.signing.set(info.id, { credential: kept, kept: true, remember: false });
|
|
276
|
+
return kept;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const user = need.username ? ((_b = (_a = this.users.get(info.id)) !== null && _a !== void 0 ? _a : kept === null || kept === void 0 ? void 0 : kept.username) !== null && _b !== void 0 ? _b : (info.source === 'this' ? ScreenShares_1.localUser() : undefined)) : undefined;
|
|
280
|
+
const { answer, remember } = await this.ask({
|
|
281
|
+
promptId: randomUUID(),
|
|
282
|
+
desktop: info.id,
|
|
283
|
+
name: info.name,
|
|
284
|
+
account: need.username,
|
|
285
|
+
...(user ? { user } : {}),
|
|
286
|
+
...(need.refused || this.refused.has(info.id) ? { refused: true } : {}),
|
|
287
|
+
...(store ? { remember: true } : {}),
|
|
288
|
+
});
|
|
289
|
+
if (!answer || (need.username && !answer.username)) {
|
|
290
|
+
return undefined;
|
|
291
|
+
}
|
|
292
|
+
const credential = { password: answer.password, ...(need.username ? { username: answer.username } : {}) };
|
|
293
|
+
if (credential.username) {
|
|
294
|
+
this.users.set(info.id, credential.username);
|
|
295
|
+
}
|
|
296
|
+
this.signing.set(info.id, { credential, kept: false, remember: !!store && remember });
|
|
297
|
+
return credential;
|
|
298
|
+
}
|
|
299
|
+
/** A desktop took the sign-in or refused it: one the user asked to keep is kept now, a kept one refused is asked again. */
|
|
300
|
+
signedIn(info, taken) {
|
|
301
|
+
const signing = this.signing.get(info.id);
|
|
302
|
+
this.signing.delete(info.id);
|
|
303
|
+
const store = this.credentialStores.store;
|
|
304
|
+
if (!signing || !store) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
if (!taken) {
|
|
308
|
+
if (signing.kept) {
|
|
309
|
+
this.refused.add(info.id);
|
|
310
|
+
}
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
this.refused.delete(info.id);
|
|
314
|
+
if (signing.remember) {
|
|
315
|
+
store.set(ScreenShares_1.credentialId(info.id), signing.credential, { feature: 'desktop', name: info.name }).catch(error => {
|
|
316
|
+
console.error(`The sign-in of ${info.name} could not be kept: ${error instanceof Error ? error.message : error}`);
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
ask(prompt) {
|
|
321
|
+
return new Promise(resolve => {
|
|
322
|
+
const timer = setTimeout(() => settle(undefined), PROMPT_TIMEOUT_MS);
|
|
323
|
+
const settle = (answer, keep = false) => {
|
|
324
|
+
clearTimeout(timer);
|
|
325
|
+
if (this.waiting.delete(prompt.promptId)) {
|
|
326
|
+
this.broadcast({ type: 'prompt_closed', promptId: prompt.promptId });
|
|
327
|
+
resolve({ answer, remember: keep && answer !== undefined });
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
this.waiting.set(prompt.promptId, { prompt, settle });
|
|
331
|
+
this.broadcast({ type: 'prompt', prompt });
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
broadcast(event) {
|
|
335
|
+
for (const connection of this.watchers) {
|
|
336
|
+
// Only the owner's pages answer for the passwords of the owner's computers.
|
|
337
|
+
if (!connection.closed && this.principals.of(connection) === TA_OWNER) {
|
|
338
|
+
connection
|
|
339
|
+
.client(TaClient)
|
|
340
|
+
.onScreenShareEvent(event)
|
|
341
|
+
.catch(() => undefined);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
entryOf(connection, viewerId) {
|
|
346
|
+
const entry = this.viewers.get(String(viewerId !== null && viewerId !== void 0 ? viewerId : ''));
|
|
347
|
+
return entry && entry.viewer.principal === this.principals.of(connection) ? entry : undefined;
|
|
348
|
+
}
|
|
349
|
+
require(connection, viewerId) {
|
|
350
|
+
const entry = this.entryOf(connection, viewerId);
|
|
351
|
+
if (!entry) {
|
|
352
|
+
throw TaErrors.invalidArgument(`There is no desktop viewer ${viewerId}.`, 'Open the desktop again with openDesktop.');
|
|
353
|
+
}
|
|
354
|
+
// The page of a viewer orphaned by a drop calls on its new connection.
|
|
355
|
+
this.adopt(entry, connection);
|
|
356
|
+
return entry;
|
|
357
|
+
}
|
|
358
|
+
/** A viewer belongs to the connection that calls for it last; when that one drops, it waits ORPHAN_MS for the page. */
|
|
359
|
+
adopt(entry, connection) {
|
|
360
|
+
clearTimeout(entry.orphan);
|
|
361
|
+
entry.orphan = undefined;
|
|
362
|
+
entry.viewer.connection = connection;
|
|
363
|
+
if (!this.closing.has(connection)) {
|
|
364
|
+
this.closing.add(connection);
|
|
365
|
+
connection.onClose(() => {
|
|
366
|
+
for (const [viewerId, each] of this.viewers) {
|
|
367
|
+
if (each.viewer.connection === connection) {
|
|
368
|
+
each.orphan = setTimeout(() => this.drop(viewerId), ORPHAN_MS);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
drop(viewerId) {
|
|
375
|
+
const entry = this.viewers.get(viewerId);
|
|
376
|
+
if (entry) {
|
|
377
|
+
clearTimeout(entry.orphan);
|
|
378
|
+
this.viewers.delete(viewerId);
|
|
379
|
+
entry.session.remove(viewerId);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
viewerOf(entry) {
|
|
383
|
+
const { viewer, session } = entry;
|
|
384
|
+
const { width, height } = session.framebuffer;
|
|
385
|
+
return {
|
|
386
|
+
viewerId: viewer.id,
|
|
387
|
+
next: viewer.built + 1,
|
|
388
|
+
size: { width, height, screens: session.showing ? session.screensOf() : [] },
|
|
389
|
+
control: session.controlFor(viewer.id),
|
|
390
|
+
capabilities: session.capabilities(),
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
described(info, connection) {
|
|
394
|
+
const session = this.sessions.get(info.id);
|
|
395
|
+
if (!session) {
|
|
396
|
+
return info;
|
|
397
|
+
}
|
|
398
|
+
const mine = connection && [...session.viewers.values()].find(viewer => viewer.connection === connection);
|
|
399
|
+
const control = session.controlFor(mine === null || mine === void 0 ? void 0 : mine.id);
|
|
400
|
+
return {
|
|
401
|
+
...info,
|
|
402
|
+
state: session.link !== 'live' ? 'connecting' : session.controlled ? 'controlled' : 'viewing',
|
|
403
|
+
link: session.link,
|
|
404
|
+
...(session.showing ? { screens: session.screensOf(), capabilities: session.capabilities() } : {}),
|
|
405
|
+
control,
|
|
406
|
+
viewers: session.watchers(mine === null || mine === void 0 ? void 0 : mine.id),
|
|
407
|
+
...(mine ? { mine: { viewerId: mine.id, built: mine.built } } : {}),
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
nameOf(principal) {
|
|
411
|
+
return principal === TA_OWNER ? '' : principal;
|
|
412
|
+
}
|
|
413
|
+
/** What a page answered, checked: a password, and an account when one came. */
|
|
414
|
+
static signInOf(answer) {
|
|
415
|
+
const given = answer;
|
|
416
|
+
if (!given || typeof given !== 'object' || typeof given.password !== 'string' || given.password.length > 1024) {
|
|
417
|
+
return undefined;
|
|
418
|
+
}
|
|
419
|
+
const username = typeof given.username === 'string' ? given.username.trim().slice(0, 256) : undefined;
|
|
420
|
+
return { password: given.password, ...(username ? { username } : {}) };
|
|
421
|
+
}
|
|
422
|
+
/** The account of whoever runs ta serve: the one to sign in to this computer with. */
|
|
423
|
+
static localUser() {
|
|
424
|
+
try {
|
|
425
|
+
return userInfo().username || undefined;
|
|
426
|
+
}
|
|
427
|
+
catch (_a) {
|
|
428
|
+
return undefined;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
/** The id of the sign-in of a desktop in the store. */
|
|
432
|
+
static credentialId(desktopId) {
|
|
433
|
+
return `desktop:${desktopId}`;
|
|
434
|
+
}
|
|
435
|
+
static device(device) {
|
|
436
|
+
return device === 'phone' || device === 'tablet' ? device : 'computer';
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
__decorate([
|
|
440
|
+
Autowired(ExecEnvironmentFactory),
|
|
441
|
+
__metadata("design:type", Object)
|
|
442
|
+
], ScreenShares.prototype, "environments", void 0);
|
|
443
|
+
__decorate([
|
|
444
|
+
Autowired(RemoteHosts),
|
|
445
|
+
__metadata("design:type", Object)
|
|
446
|
+
], ScreenShares.prototype, "hosts", void 0);
|
|
447
|
+
__decorate([
|
|
448
|
+
Autowired(TaWorkingDirectory),
|
|
449
|
+
__metadata("design:type", Object)
|
|
450
|
+
], ScreenShares.prototype, "workingDirectory", void 0);
|
|
451
|
+
__decorate([
|
|
452
|
+
Autowired({ id: TaPrincipals, detached: true }),
|
|
453
|
+
__metadata("design:type", Object)
|
|
454
|
+
], ScreenShares.prototype, "principals", void 0);
|
|
455
|
+
__decorate([
|
|
456
|
+
Autowired(TaCredentials),
|
|
457
|
+
__metadata("design:type", TaCredentials)
|
|
458
|
+
], ScreenShares.prototype, "credentialStores", void 0);
|
|
459
|
+
ScreenShares = ScreenShares_1 = __decorate([
|
|
460
|
+
Component()
|
|
461
|
+
], ScreenShares);
|
|
462
|
+
export { ScreenShares };
|
|
463
|
+
//# sourceMappingURL=screen-shares.js.map
|
|
@@ -4,25 +4,24 @@ interface MessageLike {
|
|
|
4
4
|
content?: unknown;
|
|
5
5
|
timestamp?: number;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* What a list of conversations shows of one: its first message, as pi's session list does, and when it last changed.
|
|
9
|
+
* What was said is read by TaSaid, which leaves out every mark of the model.
|
|
10
|
+
*/
|
|
8
11
|
export declare namespace SessionInfoUtil {
|
|
9
12
|
/**
|
|
10
|
-
* The first line of the first message of the user that
|
|
11
|
-
* a skill
|
|
13
|
+
* The first line of the first message of the user that says something, cut to a title's length: what they typed
|
|
14
|
+
* (TaSaid.words), a skill they ran as `/skill:name` and what follows; never a notice of a part of Ta (TaSaid.notice).
|
|
12
15
|
*/
|
|
13
16
|
function firstMessage(messages: readonly MessageLike[]): string | undefined;
|
|
14
17
|
/**
|
|
15
|
-
* The
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* (TaTaskNote) says the task: how one ended is its title and what it said, one handed to the double its title,
|
|
20
|
-
* and a note of a new id, for the double only, is passed over.
|
|
18
|
+
* The last thing the user or the agent said, on one line and cut to a preview's length, as a messaging app shows
|
|
19
|
+
* it under the name of a chat (TaSaid.line of TaSaid.words): without the marks of the model and of Markdown, the
|
|
20
|
+
* thinking and tool calls of the agent; a notice of a part of Ta (TaSaid.notice) and a message that says nothing for a person (the summary an agent compacted
|
|
21
|
+
* its context to, a note of a task's new id) is passed over.
|
|
21
22
|
*/
|
|
22
23
|
function lastMessage(messages: readonly MessageLike[]): string | undefined;
|
|
23
24
|
/** The time of the last message that has one, else `fallback`. */
|
|
24
25
|
function updatedAt(messages: readonly MessageLike[], fallback: number): number;
|
|
25
|
-
/** The text of the content of a message. */
|
|
26
|
-
function text(content: unknown): string;
|
|
27
26
|
}
|
|
28
27
|
export {};
|