@celljs/ta-web 4.25.0 → 4.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/browser/account/account-side.js +3 -1
- package/esm/browser/assistant/assistant-task-source.js +3 -1
- package/esm/browser/assistant/assistant-thread.d.ts +5 -2
- package/esm/browser/assistant/assistant-thread.js +70 -46
- package/esm/browser/assistant/assistant-view.js +9 -3
- package/esm/browser/components/account-menu.d.ts +2 -1
- package/esm/browser/components/account-menu.js +7 -2
- package/esm/browser/components/app-nav.js +5 -5
- package/esm/browser/components/chat-asks.js +16 -1
- package/esm/browser/components/chat-home.d.ts +13 -6
- package/esm/browser/components/chat-home.js +9 -9
- package/esm/browser/components/chat-icon.d.ts +6 -1
- package/esm/browser/components/chat-icon.js +49 -4
- package/esm/browser/components/chat-list-hooks.d.ts +20 -0
- package/esm/browser/components/chat-list-hooks.js +21 -0
- package/esm/browser/components/chat-list-row.d.ts +7 -4
- package/esm/browser/components/chat-list-row.js +22 -10
- package/esm/browser/components/chat-list.js +11 -18
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-addon-util.d.ts +5 -0
- package/esm/browser/components/composer-addon-util.js +17 -0
- package/esm/browser/components/composer-addons.d.ts +3 -1
- package/esm/browser/components/composer-addons.js +5 -2
- package/esm/browser/components/editor-area.js +2 -2
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/message-footer.d.ts +2 -2
- package/esm/browser/components/message-footer.js +2 -2
- package/esm/browser/components/message-list.d.ts +12 -0
- package/esm/browser/components/message-list.js +31 -18
- package/esm/browser/components/nav-places.d.ts +2 -1
- package/esm/browser/components/nav-places.js +3 -2
- package/esm/browser/components/serve-restart.d.ts +11 -2
- package/esm/browser/components/serve-restart.js +64 -3
- package/esm/browser/components/session-view.js +3 -2
- package/esm/browser/components/settings-more.js +7 -4
- package/esm/browser/components/ta-avatar.js +34 -6
- package/esm/browser/extension/extension-view.d.ts +8 -0
- package/esm/browser/extension/extension-view.js +12 -1
- package/esm/browser/extension/icons.js +10 -1
- package/esm/browser/extension/web-api-contributions.d.ts +15 -2
- package/esm/browser/extension/web-api-partners.d.ts +6 -0
- package/esm/browser/extension/web-home.js +8 -0
- package/esm/browser/hosts.d.ts +2 -0
- package/esm/browser/hosts.js +22 -3
- package/esm/browser/i18n/locales.d.ts +8 -1
- package/esm/browser/i18n/messages-ja.js +7 -0
- package/esm/browser/i18n/messages-zh-tw.js +7 -0
- package/esm/browser/i18n/messages.d.ts +7 -0
- package/esm/browser/i18n/messages.js +14 -0
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +2 -2
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +7 -4
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +1 -1
- package/esm/browser/workbench-hosts.js +8 -4
- package/esm/browser/workbench-lists.d.ts +16 -1
- package/esm/browser/workbench-lists.js +38 -3
- package/esm/browser/workbench-protocol.d.ts +5 -0
- package/esm/browser/workbench.d.ts +1 -0
- package/esm/browser/workbench.js +20 -0
- package/lib/browser/account/account-side.js +3 -1
- package/lib/browser/assistant/assistant-task-source.js +3 -1
- package/lib/browser/assistant/assistant-thread.d.ts +5 -2
- package/lib/browser/assistant/assistant-thread.js +70 -46
- package/lib/browser/assistant/assistant-view.js +8 -2
- package/lib/browser/components/account-menu.d.ts +2 -1
- package/lib/browser/components/account-menu.js +6 -1
- package/lib/browser/components/app-nav.js +4 -4
- package/lib/browser/components/chat-asks.js +16 -1
- package/lib/browser/components/chat-home.d.ts +13 -6
- package/lib/browser/components/chat-home.js +10 -11
- package/lib/browser/components/chat-icon.d.ts +6 -1
- package/lib/browser/components/chat-icon.js +49 -4
- package/lib/browser/components/chat-list-hooks.d.ts +20 -0
- package/lib/browser/components/chat-list-hooks.js +22 -0
- package/lib/browser/components/chat-list-row.d.ts +7 -4
- package/lib/browser/components/chat-list-row.js +23 -12
- package/lib/browser/components/chat-list.js +10 -17
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-addon-util.d.ts +5 -0
- package/lib/browser/components/composer-addon-util.js +17 -0
- package/lib/browser/components/composer-addons.d.ts +3 -1
- package/lib/browser/components/composer-addons.js +5 -2
- package/lib/browser/components/editor-area.js +1 -1
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/message-footer.d.ts +2 -2
- package/lib/browser/components/message-footer.js +3 -4
- package/lib/browser/components/message-list.d.ts +12 -0
- package/lib/browser/components/message-list.js +32 -18
- package/lib/browser/components/nav-places.d.ts +2 -1
- package/lib/browser/components/nav-places.js +3 -2
- package/lib/browser/components/serve-restart.d.ts +11 -2
- package/lib/browser/components/serve-restart.js +64 -3
- package/lib/browser/components/session-view.js +3 -2
- package/lib/browser/components/settings-more.js +7 -4
- package/lib/browser/components/ta-avatar.js +34 -6
- package/lib/browser/extension/extension-view.d.ts +8 -0
- package/lib/browser/extension/extension-view.js +12 -0
- package/lib/browser/extension/icons.js +9 -0
- package/lib/browser/extension/web-api-contributions.d.ts +15 -2
- package/lib/browser/extension/web-api-partners.d.ts +6 -0
- package/lib/browser/extension/web-home.js +8 -0
- package/lib/browser/hosts.d.ts +2 -0
- package/lib/browser/hosts.js +22 -3
- package/lib/browser/i18n/locales.d.ts +8 -1
- package/lib/browser/i18n/messages-ja.js +7 -0
- package/lib/browser/i18n/messages-zh-tw.js +7 -0
- package/lib/browser/i18n/messages.d.ts +7 -0
- package/lib/browser/i18n/messages.js +14 -0
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +2 -2
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +7 -4
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +1 -1
- package/lib/browser/workbench-hosts.js +8 -4
- package/lib/browser/workbench-lists.d.ts +16 -1
- package/lib/browser/workbench-lists.js +38 -3
- package/lib/browser/workbench-protocol.d.ts +5 -0
- package/lib/browser/workbench.d.ts +1 -0
- package/lib/browser/workbench.js +20 -0
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SessionStore, type SessionStoreOptions, type TaConnection } from '@celljs/ta-client';
|
|
2
|
-
import type
|
|
2
|
+
import { type TaSavedSessionInfo, type TaSessionInfo } from '@celljs/ta-protocol';
|
|
3
3
|
import type { WorkbenchState } from './workbench-protocol';
|
|
4
4
|
import { WorkbenchServices } from './workbench-services';
|
|
5
5
|
/** The lists of the sessions of the computer, open, saved and archived, read and kept on the device. */
|
|
@@ -14,6 +14,16 @@ export declare abstract class WorkbenchLists extends WorkbenchServices {
|
|
|
14
14
|
protected archivedSince?: number;
|
|
15
15
|
/** Counts the lists of open sessions the server told: a read of the lists begun before one does not undo it. */
|
|
16
16
|
protected pushes: number;
|
|
17
|
+
/**
|
|
18
|
+
* The saved conversations as last read, with the version the server gave them (listSavedSessionChanges) and
|
|
19
|
+
* the connection they were read on: the next read is of what changed since. Unset for a Ta service of before.
|
|
20
|
+
*/
|
|
21
|
+
protected savedRead?: {
|
|
22
|
+
connection: TaConnection | undefined;
|
|
23
|
+
version: string;
|
|
24
|
+
list: TaSavedSessionInfo[];
|
|
25
|
+
};
|
|
26
|
+
protected savedChanges: boolean;
|
|
17
27
|
listOpened(info: TaSessionInfo): void;
|
|
18
28
|
/**
|
|
19
29
|
* One read of the lists at a time: asked again meanwhile, one more follows it for all who asked, so that
|
|
@@ -21,6 +31,11 @@ export declare abstract class WorkbenchLists extends WorkbenchServices {
|
|
|
21
31
|
*/
|
|
22
32
|
refresh(): Promise<void>;
|
|
23
33
|
protected readLists(): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* The saved conversations updated `since`: only what changed since the last read comes, not hundreds of them
|
|
36
|
+
* each time a conversation opens or the lists are read again.
|
|
37
|
+
*/
|
|
38
|
+
protected readSaved(since: number | undefined): Promise<TaSavedSessionInfo[]>;
|
|
24
39
|
setArchiveDays(days: number): void;
|
|
25
40
|
readArchived(): Promise<void>;
|
|
26
41
|
createStore(sessionId: string, options?: SessionStoreOptions): SessionStore;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WorkbenchLists = void 0;
|
|
4
4
|
const ta_client_1 = require("@celljs/ta-client");
|
|
5
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
5
6
|
const settings_protocol_1 = require("./settings/settings-protocol");
|
|
6
7
|
const workbench_services_1 = require("./workbench-services");
|
|
7
8
|
const workbench_util_1 = require("./workbench-util");
|
|
@@ -13,6 +14,7 @@ class WorkbenchLists extends workbench_services_1.WorkbenchServices {
|
|
|
13
14
|
this.archiveDays = settings_protocol_1.DEFAULT_SETTINGS.chatArchiveDays;
|
|
14
15
|
/** Counts the lists of open sessions the server told: a read of the lists begun before one does not undo it. */
|
|
15
16
|
this.pushes = 0;
|
|
17
|
+
this.savedChanges = true;
|
|
16
18
|
}
|
|
17
19
|
listOpened(info) {
|
|
18
20
|
if (this.current.sessions.some(session => session.sessionId === info.sessionId)) {
|
|
@@ -43,6 +45,7 @@ class WorkbenchLists extends workbench_services_1.WorkbenchServices {
|
|
|
43
45
|
return this.refreshAgain;
|
|
44
46
|
}
|
|
45
47
|
async readLists() {
|
|
48
|
+
var _a;
|
|
46
49
|
const pushes = this.pushes;
|
|
47
50
|
// A ta serve of before has no saved sessions to list: its list stays the open ones. The default
|
|
48
51
|
// directory comes along, as another device may have changed it. The archived are left out: a list
|
|
@@ -50,23 +53,55 @@ class WorkbenchLists extends workbench_services_1.WorkbenchServices {
|
|
|
50
53
|
const since = workbench_util_1.WorkbenchUtil.daysAgo(Date.now(), this.archiveDays);
|
|
51
54
|
const [sessions, saved, server] = await Promise.all([
|
|
52
55
|
this.server.listSessions(),
|
|
53
|
-
this.
|
|
56
|
+
this.readSaved(since).catch(() => []),
|
|
54
57
|
this.server.getServerInfo().catch(() => this.current.server),
|
|
55
58
|
]);
|
|
56
59
|
// A ta serve of before lists them all.
|
|
57
|
-
const recent = since === undefined ? saved : saved.filter(session => session.updatedAt >= since);
|
|
60
|
+
const recent = since === undefined || saved.every(session => session.updatedAt >= since) ? saved : saved.filter(session => session.updatedAt >= since);
|
|
58
61
|
// Read every few seconds and mostly the same: what shows them is not drawn again for nothing. A list
|
|
59
62
|
// the server told meanwhile is newer than this one, read before it.
|
|
60
63
|
this.update({
|
|
61
64
|
sessions: pushes === this.pushes ? workbench_util_1.WorkbenchUtil.same(this.current.sessions, workbench_util_1.WorkbenchUtil.sorted(sessions)) : this.current.sessions,
|
|
62
|
-
saved: workbench_util_1.WorkbenchUtil.same(this.current.saved, recent),
|
|
65
|
+
saved: recent === this.current.saved ? recent : workbench_util_1.WorkbenchUtil.same(this.current.saved, recent),
|
|
63
66
|
server: workbench_util_1.WorkbenchUtil.same(this.current.server, server),
|
|
64
67
|
});
|
|
68
|
+
if (((_a = this.savedRead) === null || _a === void 0 ? void 0 : _a.list) === saved) {
|
|
69
|
+
// Unchanged next time, the list shown is not compared again.
|
|
70
|
+
this.savedRead.list = this.current.saved;
|
|
71
|
+
}
|
|
65
72
|
// A day later, those that just grew old are in the archive read, not lost between the two lists.
|
|
66
73
|
if (this.current.archived && this.archivedSince !== since) {
|
|
67
74
|
void this.readArchived().catch(() => undefined);
|
|
68
75
|
}
|
|
69
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* The saved conversations updated `since`: only what changed since the last read comes, not hundreds of them
|
|
79
|
+
* each time a conversation opens or the lists are read again.
|
|
80
|
+
*/
|
|
81
|
+
async readSaved(since) {
|
|
82
|
+
var _a;
|
|
83
|
+
var _b;
|
|
84
|
+
const query = since === undefined ? undefined : { since };
|
|
85
|
+
const connection = this.connection;
|
|
86
|
+
if (this.savedChanges) {
|
|
87
|
+
try {
|
|
88
|
+
const before = ((_a = this.savedRead) === null || _a === void 0 ? void 0 : _a.connection) === connection ? this.savedRead : undefined;
|
|
89
|
+
const changes = await this.server.listSavedSessionChanges(query, before === null || before === void 0 ? void 0 : before.version);
|
|
90
|
+
const unchanged = before && !changes.whole && changes.version === before.version;
|
|
91
|
+
const list = unchanged ? before.list : ta_protocol_1.TaSavedSessionUtil.apply((_b = before === null || before === void 0 ? void 0 : before.list) !== null && _b !== void 0 ? _b : [], changes);
|
|
92
|
+
this.savedRead = { connection, version: changes.version, list };
|
|
93
|
+
return list;
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
if (!ta_client_1.TaRemoteError.isMethodNotFound(error)) {
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
this.savedChanges = false;
|
|
100
|
+
this.savedRead = undefined;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return this.server.listSavedSessions(query);
|
|
104
|
+
}
|
|
70
105
|
setArchiveDays(days) {
|
|
71
106
|
if (days === this.archiveDays) {
|
|
72
107
|
return;
|
|
@@ -175,6 +175,11 @@ export interface TaWorkbench {
|
|
|
175
175
|
* page is connected again, when it loads again if it was of the build before.
|
|
176
176
|
*/
|
|
177
177
|
restartServer(): Promise<void>;
|
|
178
|
+
/**
|
|
179
|
+
* Installs the newer version published (TaServerInfo.release), then restarts Ta to it (restartServer) where Ta can
|
|
180
|
+
* restart itself; else the server read again tells of it installed (TaServerInfo.update). Fails as the install did.
|
|
181
|
+
*/
|
|
182
|
+
installRelease(): Promise<void>;
|
|
178
183
|
/**
|
|
179
184
|
* A store of a session on this connection; the caller attaches and detaches it. It can be made before
|
|
180
185
|
* there is a connection, to show a conversation kept on the device (SessionStoreOptions.initial): it is
|
|
@@ -41,6 +41,7 @@ export declare class TaWorkbenchImpl extends WorkbenchHosts implements TaWorkben
|
|
|
41
41
|
protected readonly listeners: Set<(state: WorkbenchState) => void>;
|
|
42
42
|
get state(): WorkbenchState;
|
|
43
43
|
restartServer(): Promise<void>;
|
|
44
|
+
installRelease(): Promise<void>;
|
|
44
45
|
/** A restart that failed, or did not come back: no longer waited for. */
|
|
45
46
|
protected restarted(): void;
|
|
46
47
|
/**
|
package/lib/browser/workbench.js
CHANGED
|
@@ -97,6 +97,26 @@ let TaWorkbenchImpl = class TaWorkbenchImpl extends workbench_hosts_1.WorkbenchH
|
|
|
97
97
|
throw error;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
async installRelease() {
|
|
101
|
+
var _a;
|
|
102
|
+
const read = async () => {
|
|
103
|
+
const server = await this.server.getServerInfo();
|
|
104
|
+
this.update({ server: workbench_util_1.WorkbenchUtil.same(this.current.server, server) });
|
|
105
|
+
return server;
|
|
106
|
+
};
|
|
107
|
+
const installing = this.server.installRelease();
|
|
108
|
+
// Each page of the owner sees it installing, this one too.
|
|
109
|
+
await read().catch(() => undefined);
|
|
110
|
+
try {
|
|
111
|
+
await installing;
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
await read().catch(() => undefined);
|
|
115
|
+
}
|
|
116
|
+
if (((_a = this.current.server) === null || _a === void 0 ? void 0 : _a.update) && this.current.server.restartable && !this.current.server.member) {
|
|
117
|
+
await this.restartServer();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
100
120
|
/** A restart that failed, or did not come back: no longer waited for. */
|
|
101
121
|
restarted() {
|
|
102
122
|
if (this.restart) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-web",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.27.0",
|
|
4
4
|
"description": "The web client of ta serve: sessions, streaming messages, tool runs with diffs, and dialogs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cell-component"
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@celljs/core": "4.
|
|
37
|
-
"@celljs/react": "4.
|
|
38
|
-
"@celljs/ta-client": "4.
|
|
39
|
-
"@celljs/ta-protocol": "4.
|
|
40
|
-
"@celljs/ta-relay": "4.
|
|
41
|
-
"@celljs/widget": "4.
|
|
36
|
+
"@celljs/core": "4.27.0",
|
|
37
|
+
"@celljs/react": "4.27.0",
|
|
38
|
+
"@celljs/ta-client": "4.27.0",
|
|
39
|
+
"@celljs/ta-protocol": "4.27.0",
|
|
40
|
+
"@celljs/ta-relay": "4.27.0",
|
|
41
|
+
"@celljs/widget": "4.27.0",
|
|
42
42
|
"@types/three": "^0.187.0",
|
|
43
43
|
"@xterm/addon-fit": "^0.11.0",
|
|
44
44
|
"@xterm/addon-unicode11": "^0.9.0",
|