@celljs/ta-host 4.19.0 → 4.20.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/package-hosts.d.ts +8 -1
- package/esm/node/package-hosts.js +22 -5
- package/esm/node/rooms-bridge.d.ts +12 -3
- package/esm/node/rooms-bridge.js +29 -6
- package/esm/node/team/team-calls.js +2 -0
- package/lib/node/package-hosts.d.ts +8 -1
- package/lib/node/package-hosts.js +22 -5
- package/lib/node/rooms-bridge.d.ts +12 -3
- package/lib/node/rooms-bridge.js +28 -5
- package/lib/node/team/team-calls.js +2 -0
- package/package.json +10 -10
|
@@ -70,7 +70,14 @@ export declare class PackageHostsImpl implements PackageHosts, ApplicationLifecy
|
|
|
70
70
|
protected readonly teamProvider: TaHostTeamProvider;
|
|
71
71
|
protected readonly running: Map<string, Running>;
|
|
72
72
|
protected extensionHost?: TaExtensionHost;
|
|
73
|
-
|
|
73
|
+
/** The first {@link sync}, begun once the server listens: what asks a host waits for it. */
|
|
74
|
+
protected starting: Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Not awaited: importing two dozen hosts took half of the start of ta serve (60 of 115 ms), and nothing the server
|
|
77
|
+
* answers first needs them. They start after it listens, one a turn of the event loop, so that the first page comes
|
|
78
|
+
* between; {@link answer} and {@link call} wait for them.
|
|
79
|
+
*/
|
|
80
|
+
onStart(): void;
|
|
74
81
|
onStop(): void;
|
|
75
82
|
sync(): Promise<void>;
|
|
76
83
|
answer(name: string): Promise<Omit<TaHostAnswer, 'files'>>;
|
|
@@ -93,9 +93,18 @@ export var PackageHostUtil;
|
|
|
93
93
|
let PackageHostsImpl = class PackageHostsImpl {
|
|
94
94
|
constructor() {
|
|
95
95
|
this.running = new Map();
|
|
96
|
+
/** The first {@link sync}, begun once the server listens: what asks a host waits for it. */
|
|
97
|
+
this.starting = Promise.resolve();
|
|
96
98
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Not awaited: importing two dozen hosts took half of the start of ta serve (60 of 115 ms), and nothing the server
|
|
101
|
+
* answers first needs them. They start after it listens, one a turn of the event loop, so that the first page comes
|
|
102
|
+
* between; {@link answer} and {@link call} wait for them.
|
|
103
|
+
*/
|
|
104
|
+
onStart() {
|
|
105
|
+
this.starting = new Promise(resolve => setImmediate(resolve))
|
|
106
|
+
.then(() => this.sync())
|
|
107
|
+
.catch(error => console.error(`The hosts of the packages failed to start: ${error instanceof Error ? error.message : error}`));
|
|
99
108
|
}
|
|
100
109
|
onStop() {
|
|
101
110
|
for (const name of [...this.running.keys()]) {
|
|
@@ -109,18 +118,23 @@ let PackageHostsImpl = class PackageHostsImpl {
|
|
|
109
118
|
await this.stop(name);
|
|
110
119
|
}
|
|
111
120
|
}
|
|
112
|
-
|
|
121
|
+
const started = [];
|
|
122
|
+
for (const [name, file] of on) {
|
|
113
123
|
if (file && !this.running.has(name)) {
|
|
114
|
-
|
|
124
|
+
started.push(this.start(name, file).service);
|
|
125
|
+
await new Promise(resolve => setImmediate(resolve));
|
|
115
126
|
}
|
|
116
|
-
}
|
|
127
|
+
}
|
|
128
|
+
await Promise.all(started);
|
|
117
129
|
}
|
|
118
130
|
async answer(name) {
|
|
119
131
|
var _a;
|
|
132
|
+
await this.starting;
|
|
120
133
|
return { host: this.hostOf(name), service: await ((_a = this.running.get(name)) === null || _a === void 0 ? void 0 : _a.service) };
|
|
121
134
|
}
|
|
122
135
|
async call(name, method, params) {
|
|
123
136
|
var _a;
|
|
137
|
+
await this.starting;
|
|
124
138
|
const service = (await ((_a = this.running.get(name)) === null || _a === void 0 ? void 0 : _a.service));
|
|
125
139
|
if (!service) {
|
|
126
140
|
throw TaErrors.invalidArgument(`The package ${name} has no host running.`, 'Only packages that come with Ta and are on have one, under ta serve; turn it on, or see the log of ta serve for why it failed.');
|
|
@@ -217,11 +231,14 @@ let PackageHostsImpl = class PackageHostsImpl {
|
|
|
217
231
|
openSession: options => server.openSession(options),
|
|
218
232
|
closeSession: sessionId => server.closeSession(sessionId),
|
|
219
233
|
setSessionName: (sessionId, name) => server.setSessionName(sessionId, name),
|
|
234
|
+
setModel: (sessionId, provider, modelId) => server.setModel(sessionId, provider, modelId),
|
|
220
235
|
prompt: (sessionId, input) => server.prompt(sessionId, input),
|
|
221
236
|
followUp: (sessionId, input) => server.followUp(sessionId, input),
|
|
222
237
|
abort: sessionId => server.abort(sessionId),
|
|
223
238
|
getState: sessionId => server.getState(sessionId),
|
|
224
239
|
getLastAssistantText: sessionId => server.getLastAssistantText(sessionId),
|
|
240
|
+
getSessionStats: sessionId => server.getSessionStats(sessionId),
|
|
241
|
+
getEntries: (sessionId, since) => server.getEntries(sessionId, since),
|
|
225
242
|
relocateDirectory: (from, to) => server.relocateDirectory(from, to),
|
|
226
243
|
getExtensionData: (name, key, cwd) => packages.getExtensionData(name, key, cwd),
|
|
227
244
|
setExtensionData: (name, key, value, cwd) => packages.setExtensionData(name, key, value, cwd),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Application, ApplicationLifecycle } from '@celljs/core';
|
|
2
2
|
import { type RpcConnection } from '@celljs/rpc/lib/node';
|
|
3
|
-
import { type TaFriend, type TaFriendRequest, type TaFriendShare, type TaGroupInvite, type TaIdentity, type TaRoomEvent, type TaRoomInfo, type TaRoomRequest, TaRoomServer, type TaRooms, type TaRoomValue, type TaRoomWatch } from '@celljs/ta-protocol';
|
|
3
|
+
import { type TaFriend, type TaFriendRequest, type TaFriendShare, type TaGroupInvite, type TaIdentity, type TaPictures, type TaRoomEvent, type TaRoomInfo, type TaRoomRequest, TaRoomServer, type TaRooms, type TaRoomValue, type TaRoomWatch } from '@celljs/ta-protocol';
|
|
4
4
|
import type { RelayHubs } from '@celljs/ta-relay/lib/node';
|
|
5
5
|
import { ExtensionDataStore } from './extension-data.js';
|
|
6
6
|
import { type RelayBridge } from './relay-bridge.js';
|
|
@@ -21,12 +21,19 @@ export declare class RoomsBridge implements ApplicationLifecycle<Application> {
|
|
|
21
21
|
readonly rooms: TaRooms;
|
|
22
22
|
onStart(): void;
|
|
23
23
|
onStop(): void;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The look of this Ta others see is the double's, as the user picked it on a page (TA_DOUBLE_LOOK); till then the
|
|
26
|
+
* kind its identity is given, kept there for the pages to draw the double as (setting it comes back here).
|
|
27
|
+
*/
|
|
25
28
|
protected keepLook(): Promise<void>;
|
|
26
29
|
/** `watch` undefined: no more. */
|
|
27
30
|
watch(connection: RpcConnection, watch: TaRoomWatch | undefined): void;
|
|
28
31
|
protected broadcast(event: TaRoomEvent): void;
|
|
29
|
-
|
|
32
|
+
/** The picture of this Ta, for what is said of it after a change that does not give it. */
|
|
33
|
+
protected picture(): Promise<{
|
|
34
|
+
picture?: string;
|
|
35
|
+
}>;
|
|
36
|
+
protected static identity({ id, name, look, shared, picture }: TaIdentity): TaIdentity;
|
|
30
37
|
}
|
|
31
38
|
/** The rooms for clients (TaRoomServer): those of RoomsBridge, what goes wrong said as the errors of Ta. */
|
|
32
39
|
export declare class TaRoomServerImpl implements TaRoomServer {
|
|
@@ -34,6 +41,8 @@ export declare class TaRoomServerImpl implements TaRoomServer {
|
|
|
34
41
|
protected get rooms(): TaRooms;
|
|
35
42
|
getIdentity(): Promise<TaIdentity>;
|
|
36
43
|
setName(name: string): Promise<TaIdentity>;
|
|
44
|
+
setPicture(picture: string | null): Promise<TaIdentity>;
|
|
45
|
+
listPictures(): Promise<TaPictures>;
|
|
37
46
|
listRooms(): Promise<TaRoomInfo[]>;
|
|
38
47
|
createRoom(input: {
|
|
39
48
|
kind: string;
|
package/esm/node/rooms-bridge.js
CHANGED
|
@@ -11,7 +11,7 @@ var RoomsBridge_1;
|
|
|
11
11
|
import { ApplicationLifecycle, Autowired, Component } from '@celljs/core';
|
|
12
12
|
import { Rpc } from '@celljs/rpc';
|
|
13
13
|
import { RpcContext } from '@celljs/rpc/lib/node';
|
|
14
|
-
import { TA_DOUBLE_LOOK, TaClient, TaRoomServer, TaRoomWatchUtil, } from '@celljs/ta-protocol';
|
|
14
|
+
import { TA_DOUBLE_LOOK, TaClient, TaDoubleLookUtil, TaRoomServer, TaRoomWatchUtil, } from '@celljs/ta-protocol';
|
|
15
15
|
import { ExtensionDataStore } from './extension-data.js';
|
|
16
16
|
import { RELAY_BRIDGE } from './relay-bridge.js';
|
|
17
17
|
import { TaErrors } from './ta-errors.js';
|
|
@@ -28,7 +28,9 @@ let RoomsBridge = RoomsBridge_1 = class RoomsBridge {
|
|
|
28
28
|
this.watchers = new Map();
|
|
29
29
|
this.rooms = {
|
|
30
30
|
getIdentity: async () => RoomsBridge_1.identity(await this.hubs.identity()),
|
|
31
|
-
setName: async (name) => RoomsBridge_1.identity(await this.hubs.setName(name)),
|
|
31
|
+
setName: async (name) => RoomsBridge_1.identity({ ...(await this.hubs.setName(name)), ...(await this.picture()) }),
|
|
32
|
+
setPicture: async (picture) => RoomsBridge_1.identity(await this.hubs.setPicture(picture)),
|
|
33
|
+
listPictures: () => this.hubs.pictures(),
|
|
32
34
|
listRooms: async () => this.hubs.list(),
|
|
33
35
|
createRoom: input => this.hubs.create(input),
|
|
34
36
|
invite: (room, options) => this.hubs.invite(room, options !== null && options !== void 0 ? options : {}),
|
|
@@ -82,10 +84,20 @@ let RoomsBridge = RoomsBridge_1 = class RoomsBridge {
|
|
|
82
84
|
(_a = this.stopLook) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
83
85
|
this.hubs.stop();
|
|
84
86
|
}
|
|
85
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* The look of this Ta others see is the double's, as the user picked it on a page (TA_DOUBLE_LOOK); till then the
|
|
89
|
+
* kind its identity is given, kept there for the pages to draw the double as (setting it comes back here).
|
|
90
|
+
*/
|
|
86
91
|
async keepLook() {
|
|
87
92
|
const look = await this.data.get(TA_DOUBLE_LOOK.name, TA_DOUBLE_LOOK.key).catch(() => undefined);
|
|
88
|
-
|
|
93
|
+
if (typeof look === 'string' && look) {
|
|
94
|
+
await this.hubs.setLook(look).catch(() => undefined);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const identity = await this.hubs.identity().catch(() => undefined);
|
|
98
|
+
if (identity) {
|
|
99
|
+
await this.data.set(TA_DOUBLE_LOOK.name, TA_DOUBLE_LOOK.key, TaDoubleLookUtil.given(identity.id)).catch(() => undefined);
|
|
100
|
+
}
|
|
89
101
|
}
|
|
90
102
|
/** `watch` undefined: no more. */
|
|
91
103
|
watch(connection, watch) {
|
|
@@ -108,8 +120,13 @@ let RoomsBridge = RoomsBridge_1 = class RoomsBridge {
|
|
|
108
120
|
}
|
|
109
121
|
}
|
|
110
122
|
}
|
|
111
|
-
|
|
112
|
-
|
|
123
|
+
/** The picture of this Ta, for what is said of it after a change that does not give it. */
|
|
124
|
+
async picture() {
|
|
125
|
+
const { picture } = await this.hubs.identity();
|
|
126
|
+
return picture ? { picture } : {};
|
|
127
|
+
}
|
|
128
|
+
static identity({ id, name, look, shared, picture }) {
|
|
129
|
+
return { id, name, ...(look ? { look } : {}), ...(shared ? { shared } : {}), ...(picture ? { picture } : {}) };
|
|
113
130
|
}
|
|
114
131
|
};
|
|
115
132
|
__decorate([
|
|
@@ -135,6 +152,12 @@ let TaRoomServerImpl = class TaRoomServerImpl {
|
|
|
135
152
|
setName(name) {
|
|
136
153
|
return TaErrors.guard(() => this.rooms.setName(name));
|
|
137
154
|
}
|
|
155
|
+
setPicture(picture) {
|
|
156
|
+
return TaErrors.guard(() => this.rooms.setPicture(picture));
|
|
157
|
+
}
|
|
158
|
+
listPictures() {
|
|
159
|
+
return TaErrors.guard(() => this.rooms.listPictures());
|
|
160
|
+
}
|
|
138
161
|
listRooms() {
|
|
139
162
|
return TaErrors.guard(() => this.rooms.listRooms());
|
|
140
163
|
}
|
|
@@ -70,7 +70,14 @@ export declare class PackageHostsImpl implements PackageHosts, ApplicationLifecy
|
|
|
70
70
|
protected readonly teamProvider: TaHostTeamProvider;
|
|
71
71
|
protected readonly running: Map<string, Running>;
|
|
72
72
|
protected extensionHost?: TaExtensionHost;
|
|
73
|
-
|
|
73
|
+
/** The first {@link sync}, begun once the server listens: what asks a host waits for it. */
|
|
74
|
+
protected starting: Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Not awaited: importing two dozen hosts took half of the start of ta serve (60 of 115 ms), and nothing the server
|
|
77
|
+
* answers first needs them. They start after it listens, one a turn of the event loop, so that the first page comes
|
|
78
|
+
* between; {@link answer} and {@link call} wait for them.
|
|
79
|
+
*/
|
|
80
|
+
onStart(): void;
|
|
74
81
|
onStop(): void;
|
|
75
82
|
sync(): Promise<void>;
|
|
76
83
|
answer(name: string): Promise<Omit<TaHostAnswer, 'files'>>;
|
|
@@ -96,9 +96,18 @@ var PackageHostUtil;
|
|
|
96
96
|
let PackageHostsImpl = class PackageHostsImpl {
|
|
97
97
|
constructor() {
|
|
98
98
|
this.running = new Map();
|
|
99
|
+
/** The first {@link sync}, begun once the server listens: what asks a host waits for it. */
|
|
100
|
+
this.starting = Promise.resolve();
|
|
99
101
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Not awaited: importing two dozen hosts took half of the start of ta serve (60 of 115 ms), and nothing the server
|
|
104
|
+
* answers first needs them. They start after it listens, one a turn of the event loop, so that the first page comes
|
|
105
|
+
* between; {@link answer} and {@link call} wait for them.
|
|
106
|
+
*/
|
|
107
|
+
onStart() {
|
|
108
|
+
this.starting = new Promise(resolve => setImmediate(resolve))
|
|
109
|
+
.then(() => this.sync())
|
|
110
|
+
.catch(error => console.error(`The hosts of the packages failed to start: ${error instanceof Error ? error.message : error}`));
|
|
102
111
|
}
|
|
103
112
|
onStop() {
|
|
104
113
|
for (const name of [...this.running.keys()]) {
|
|
@@ -112,18 +121,23 @@ let PackageHostsImpl = class PackageHostsImpl {
|
|
|
112
121
|
await this.stop(name);
|
|
113
122
|
}
|
|
114
123
|
}
|
|
115
|
-
|
|
124
|
+
const started = [];
|
|
125
|
+
for (const [name, file] of on) {
|
|
116
126
|
if (file && !this.running.has(name)) {
|
|
117
|
-
|
|
127
|
+
started.push(this.start(name, file).service);
|
|
128
|
+
await new Promise(resolve => setImmediate(resolve));
|
|
118
129
|
}
|
|
119
|
-
}
|
|
130
|
+
}
|
|
131
|
+
await Promise.all(started);
|
|
120
132
|
}
|
|
121
133
|
async answer(name) {
|
|
122
134
|
var _a;
|
|
135
|
+
await this.starting;
|
|
123
136
|
return { host: this.hostOf(name), service: await ((_a = this.running.get(name)) === null || _a === void 0 ? void 0 : _a.service) };
|
|
124
137
|
}
|
|
125
138
|
async call(name, method, params) {
|
|
126
139
|
var _a;
|
|
140
|
+
await this.starting;
|
|
127
141
|
const service = (await ((_a = this.running.get(name)) === null || _a === void 0 ? void 0 : _a.service));
|
|
128
142
|
if (!service) {
|
|
129
143
|
throw ta_errors_1.TaErrors.invalidArgument(`The package ${name} has no host running.`, 'Only packages that come with Ta and are on have one, under ta serve; turn it on, or see the log of ta serve for why it failed.');
|
|
@@ -220,11 +234,14 @@ let PackageHostsImpl = class PackageHostsImpl {
|
|
|
220
234
|
openSession: options => server.openSession(options),
|
|
221
235
|
closeSession: sessionId => server.closeSession(sessionId),
|
|
222
236
|
setSessionName: (sessionId, name) => server.setSessionName(sessionId, name),
|
|
237
|
+
setModel: (sessionId, provider, modelId) => server.setModel(sessionId, provider, modelId),
|
|
223
238
|
prompt: (sessionId, input) => server.prompt(sessionId, input),
|
|
224
239
|
followUp: (sessionId, input) => server.followUp(sessionId, input),
|
|
225
240
|
abort: sessionId => server.abort(sessionId),
|
|
226
241
|
getState: sessionId => server.getState(sessionId),
|
|
227
242
|
getLastAssistantText: sessionId => server.getLastAssistantText(sessionId),
|
|
243
|
+
getSessionStats: sessionId => server.getSessionStats(sessionId),
|
|
244
|
+
getEntries: (sessionId, since) => server.getEntries(sessionId, since),
|
|
228
245
|
relocateDirectory: (from, to) => server.relocateDirectory(from, to),
|
|
229
246
|
getExtensionData: (name, key, cwd) => packages.getExtensionData(name, key, cwd),
|
|
230
247
|
setExtensionData: (name, key, value, cwd) => packages.setExtensionData(name, key, value, cwd),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Application, ApplicationLifecycle } from '@celljs/core';
|
|
2
2
|
import { type RpcConnection } from '@celljs/rpc/lib/node';
|
|
3
|
-
import { type TaFriend, type TaFriendRequest, type TaFriendShare, type TaGroupInvite, type TaIdentity, type TaRoomEvent, type TaRoomInfo, type TaRoomRequest, TaRoomServer, type TaRooms, type TaRoomValue, type TaRoomWatch } from '@celljs/ta-protocol';
|
|
3
|
+
import { type TaFriend, type TaFriendRequest, type TaFriendShare, type TaGroupInvite, type TaIdentity, type TaPictures, type TaRoomEvent, type TaRoomInfo, type TaRoomRequest, TaRoomServer, type TaRooms, type TaRoomValue, type TaRoomWatch } from '@celljs/ta-protocol';
|
|
4
4
|
import type { RelayHubs } from '@celljs/ta-relay/lib/node';
|
|
5
5
|
import { ExtensionDataStore } from './extension-data';
|
|
6
6
|
import { type RelayBridge } from './relay-bridge';
|
|
@@ -21,12 +21,19 @@ export declare class RoomsBridge implements ApplicationLifecycle<Application> {
|
|
|
21
21
|
readonly rooms: TaRooms;
|
|
22
22
|
onStart(): void;
|
|
23
23
|
onStop(): void;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The look of this Ta others see is the double's, as the user picked it on a page (TA_DOUBLE_LOOK); till then the
|
|
26
|
+
* kind its identity is given, kept there for the pages to draw the double as (setting it comes back here).
|
|
27
|
+
*/
|
|
25
28
|
protected keepLook(): Promise<void>;
|
|
26
29
|
/** `watch` undefined: no more. */
|
|
27
30
|
watch(connection: RpcConnection, watch: TaRoomWatch | undefined): void;
|
|
28
31
|
protected broadcast(event: TaRoomEvent): void;
|
|
29
|
-
|
|
32
|
+
/** The picture of this Ta, for what is said of it after a change that does not give it. */
|
|
33
|
+
protected picture(): Promise<{
|
|
34
|
+
picture?: string;
|
|
35
|
+
}>;
|
|
36
|
+
protected static identity({ id, name, look, shared, picture }: TaIdentity): TaIdentity;
|
|
30
37
|
}
|
|
31
38
|
/** The rooms for clients (TaRoomServer): those of RoomsBridge, what goes wrong said as the errors of Ta. */
|
|
32
39
|
export declare class TaRoomServerImpl implements TaRoomServer {
|
|
@@ -34,6 +41,8 @@ export declare class TaRoomServerImpl implements TaRoomServer {
|
|
|
34
41
|
protected get rooms(): TaRooms;
|
|
35
42
|
getIdentity(): Promise<TaIdentity>;
|
|
36
43
|
setName(name: string): Promise<TaIdentity>;
|
|
44
|
+
setPicture(picture: string | null): Promise<TaIdentity>;
|
|
45
|
+
listPictures(): Promise<TaPictures>;
|
|
37
46
|
listRooms(): Promise<TaRoomInfo[]>;
|
|
38
47
|
createRoom(input: {
|
|
39
48
|
kind: string;
|
package/lib/node/rooms-bridge.js
CHANGED
|
@@ -31,7 +31,9 @@ let RoomsBridge = RoomsBridge_1 = class RoomsBridge {
|
|
|
31
31
|
this.watchers = new Map();
|
|
32
32
|
this.rooms = {
|
|
33
33
|
getIdentity: async () => RoomsBridge_1.identity(await this.hubs.identity()),
|
|
34
|
-
setName: async (name) => RoomsBridge_1.identity(await this.hubs.setName(name)),
|
|
34
|
+
setName: async (name) => RoomsBridge_1.identity({ ...(await this.hubs.setName(name)), ...(await this.picture()) }),
|
|
35
|
+
setPicture: async (picture) => RoomsBridge_1.identity(await this.hubs.setPicture(picture)),
|
|
36
|
+
listPictures: () => this.hubs.pictures(),
|
|
35
37
|
listRooms: async () => this.hubs.list(),
|
|
36
38
|
createRoom: input => this.hubs.create(input),
|
|
37
39
|
invite: (room, options) => this.hubs.invite(room, options !== null && options !== void 0 ? options : {}),
|
|
@@ -85,10 +87,20 @@ let RoomsBridge = RoomsBridge_1 = class RoomsBridge {
|
|
|
85
87
|
(_a = this.stopLook) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
86
88
|
this.hubs.stop();
|
|
87
89
|
}
|
|
88
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* The look of this Ta others see is the double's, as the user picked it on a page (TA_DOUBLE_LOOK); till then the
|
|
92
|
+
* kind its identity is given, kept there for the pages to draw the double as (setting it comes back here).
|
|
93
|
+
*/
|
|
89
94
|
async keepLook() {
|
|
90
95
|
const look = await this.data.get(ta_protocol_1.TA_DOUBLE_LOOK.name, ta_protocol_1.TA_DOUBLE_LOOK.key).catch(() => undefined);
|
|
91
|
-
|
|
96
|
+
if (typeof look === 'string' && look) {
|
|
97
|
+
await this.hubs.setLook(look).catch(() => undefined);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const identity = await this.hubs.identity().catch(() => undefined);
|
|
101
|
+
if (identity) {
|
|
102
|
+
await this.data.set(ta_protocol_1.TA_DOUBLE_LOOK.name, ta_protocol_1.TA_DOUBLE_LOOK.key, ta_protocol_1.TaDoubleLookUtil.given(identity.id)).catch(() => undefined);
|
|
103
|
+
}
|
|
92
104
|
}
|
|
93
105
|
/** `watch` undefined: no more. */
|
|
94
106
|
watch(connection, watch) {
|
|
@@ -111,8 +123,13 @@ let RoomsBridge = RoomsBridge_1 = class RoomsBridge {
|
|
|
111
123
|
}
|
|
112
124
|
}
|
|
113
125
|
}
|
|
114
|
-
|
|
115
|
-
|
|
126
|
+
/** The picture of this Ta, for what is said of it after a change that does not give it. */
|
|
127
|
+
async picture() {
|
|
128
|
+
const { picture } = await this.hubs.identity();
|
|
129
|
+
return picture ? { picture } : {};
|
|
130
|
+
}
|
|
131
|
+
static identity({ id, name, look, shared, picture }) {
|
|
132
|
+
return { id, name, ...(look ? { look } : {}), ...(shared ? { shared } : {}), ...(picture ? { picture } : {}) };
|
|
116
133
|
}
|
|
117
134
|
};
|
|
118
135
|
exports.RoomsBridge = RoomsBridge;
|
|
@@ -138,6 +155,12 @@ let TaRoomServerImpl = class TaRoomServerImpl {
|
|
|
138
155
|
setName(name) {
|
|
139
156
|
return ta_errors_1.TaErrors.guard(() => this.rooms.setName(name));
|
|
140
157
|
}
|
|
158
|
+
setPicture(picture) {
|
|
159
|
+
return ta_errors_1.TaErrors.guard(() => this.rooms.setPicture(picture));
|
|
160
|
+
}
|
|
161
|
+
listPictures() {
|
|
162
|
+
return ta_errors_1.TaErrors.guard(() => this.rooms.listPictures());
|
|
163
|
+
}
|
|
141
164
|
listRooms() {
|
|
142
165
|
return ta_errors_1.TaErrors.guard(() => this.rooms.listRooms());
|
|
143
166
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-host",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.20.0",
|
|
4
4
|
"description": "ta serve: pi sessions for many clients over WebSocket",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cell-component"
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@celljs/ai-agent": "4.
|
|
38
|
-
"@celljs/ai-coding-agent": "4.
|
|
39
|
-
"@celljs/core": "4.
|
|
40
|
-
"@celljs/rpc": "4.
|
|
41
|
-
"@celljs/ta-exec": "4.
|
|
42
|
-
"@celljs/ta-harness": "4.
|
|
43
|
-
"@celljs/ta-protocol": "4.
|
|
44
|
-
"@celljs/ta-relay": "4.
|
|
45
|
-
"@celljs/web": "4.
|
|
37
|
+
"@celljs/ai-agent": "4.20.0",
|
|
38
|
+
"@celljs/ai-coding-agent": "4.20.0",
|
|
39
|
+
"@celljs/core": "4.20.0",
|
|
40
|
+
"@celljs/rpc": "4.20.0",
|
|
41
|
+
"@celljs/ta-exec": "4.20.0",
|
|
42
|
+
"@celljs/ta-harness": "4.20.0",
|
|
43
|
+
"@celljs/ta-protocol": "4.20.0",
|
|
44
|
+
"@celljs/ta-relay": "4.20.0",
|
|
45
|
+
"@celljs/web": "4.20.0",
|
|
46
46
|
"@earendil-works/pi-coding-agent": "^1.5.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|