@celljs/ta-protocol 4.13.1 → 4.15.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/common/access-protocol.d.ts +38 -0
- package/esm/common/auth-protocol.d.ts +64 -0
- package/esm/common/auth-protocol.js +1 -0
- package/esm/common/index.d.ts +2 -0
- package/esm/common/index.js +2 -0
- package/esm/common/language.d.ts +25 -0
- package/esm/common/language.js +50 -0
- package/esm/common/package-protocol.d.ts +6 -1
- package/esm/common/package-protocol.js +8 -3
- package/esm/common/presence-protocol.d.ts +60 -0
- package/esm/common/presence-protocol.js +48 -0
- package/esm/common/room-protocol.d.ts +10 -0
- package/esm/common/ta-extension-host.d.ts +53 -0
- package/esm/common/ta-extension-host.js +6 -0
- package/esm/common/ta-protocol.d.ts +6 -0
- package/esm/common/team-protocol.d.ts +2 -0
- package/esm/common/team-protocol.js +48 -37
- package/lib/common/access-protocol.d.ts +38 -0
- package/lib/common/auth-protocol.d.ts +64 -0
- package/lib/common/auth-protocol.js +2 -1
- package/lib/common/index.d.ts +2 -0
- package/lib/common/index.js +2 -0
- package/lib/common/language.d.ts +26 -0
- package/lib/common/language.js +53 -0
- package/lib/common/package-protocol.d.ts +6 -1
- package/lib/common/package-protocol.js +8 -3
- package/lib/common/presence-protocol.d.ts +61 -0
- package/lib/common/presence-protocol.js +51 -0
- package/lib/common/room-protocol.d.ts +10 -0
- package/lib/common/ta-extension-host.d.ts +53 -0
- package/lib/common/ta-extension-host.js +7 -1
- package/lib/common/ta-protocol.d.ts +6 -0
- package/lib/common/team-protocol.d.ts +2 -0
- package/lib/common/team-protocol.js +48 -37
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaAskUtil = exports.TA_ASK_ENTRY = exports.TA_BRIEF_SOURCE = exports.TA_KEEP_MARK = exports.TA_WITH_OTHERS_MARK = exports.TA_NOTICES = exports.TA_DOUBLE_TASKS = exports.TA_DOUBLE_FILE = exports.TA_FILE_WRITE_EVENT = exports.TaHostUtil = exports.TA_HOST_EVENT = void 0;
|
|
3
|
+
exports.TaAskUtil = exports.TA_ASK_ENTRY = exports.TA_BRIEF_SOURCE = exports.TA_KEEP_MARK = exports.TA_WITH_OTHERS_MARK = exports.TA_NOTICES = exports.TA_DOUBLE_TASKS = exports.TA_DOUBLE_LOOK = exports.TA_DOUBLE_FILE = exports.TA_FILE_WRITE_EVENT = exports.TaHostUtil = exports.TA_HOST_EVENT = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* The event of pi's `pi.events` by which a pi extension asks for the host of its package:
|
|
6
6
|
* `pi.events.emit(TA_HOST_EVENT, { name, resolve, heard })`. Under `ta serve` `heard` is called as the event
|
|
@@ -83,6 +83,12 @@ exports.TA_FILE_WRITE_EVENT = 'ta:file-write';
|
|
|
83
83
|
* double first opened. The server side of a package that sends to the double reads it there.
|
|
84
84
|
*/
|
|
85
85
|
exports.TA_DOUBLE_FILE = { name: '@celljs/ta-web', key: 'assistant.file' };
|
|
86
|
+
/**
|
|
87
|
+
* Where the web client keeps the kind of dinosaur the double is (`trex` till the user picks another): in the data of
|
|
88
|
+
* packages, under this name and key, a JSON string. It is the look of this Ta that others see (TaIdentity.look): the
|
|
89
|
+
* rooms of ta serve tell it to the Ta of friends and rooms.
|
|
90
|
+
*/
|
|
91
|
+
exports.TA_DOUBLE_LOOK = { name: '@celljs/ta-web', key: 'assistant.species', initial: 'trex' };
|
|
86
92
|
/**
|
|
87
93
|
* Where the web client keeps the tasks the double handed out: in the data of packages, under this name and key; an
|
|
88
94
|
* array of `{ sessionId, sessionFile?, takenOver?, removed? }` among other fields. The double tells the user of these
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TaAuthEvent } from './auth-protocol';
|
|
2
2
|
import type { ImageContent, JsonAgentSessionEvent, RpcCommand, RpcExtensionUIRequest, RpcExtensionUIResponse, RpcResponse, ThinkingLevel } from './pi-types';
|
|
3
|
+
import type { TaSessionPerson } from './presence-protocol';
|
|
3
4
|
import type { TaRemoteEvent } from './remote-protocol';
|
|
4
5
|
import type { TaRoomEvent } from './room-protocol';
|
|
5
6
|
import type { TaAsking } from './ta-extension-host';
|
|
@@ -185,6 +186,11 @@ export interface TaSessionInfo {
|
|
|
185
186
|
updatedAt: number;
|
|
186
187
|
/** TaOpenSessionOptions.group. */
|
|
187
188
|
group?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Others at it now, as this page is told: who looks at it, types in it, or asked its run (TaPresenceServer); never
|
|
191
|
+
* the page's own principal. None in a Ta its user alone is in.
|
|
192
|
+
*/
|
|
193
|
+
people?: TaSessionPerson[];
|
|
188
194
|
}
|
|
189
195
|
/**
|
|
190
196
|
* A conversation in a session file of pi that no session has open: the service closed it while idle, or
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.TaActionUtil = exports.TA_ACTIONS = exports.TA_ACCESS_REQUEST_EVENT = exports.TaPermissionUtil = exports.TA_UNDECLARED = exports.TA_INVITE_PREFIX = exports.TA_OWNER = void 0;
|
|
10
|
+
const language_1 = require("./language");
|
|
10
11
|
/** The user of the Ta: its own pages, devices and token. Everyone else is let in by a package. */
|
|
11
12
|
exports.TA_OWNER = 'owner';
|
|
12
13
|
/** A principal that holds a link of invitation only: `invite:<id>`. It may only ask to be let in. */
|
|
@@ -40,47 +41,47 @@ var TaPermissionUtil;
|
|
|
40
41
|
* `detail` is the TaDenial): the notice of a refused call has a button for it.
|
|
41
42
|
*/
|
|
42
43
|
exports.TA_ACCESS_REQUEST_EVENT = 'ta:access-request';
|
|
43
|
-
const action = (id, en, zh, more = {}) => ({
|
|
44
|
+
const action = (id, en, zh, tw, ja, more = {}) => ({
|
|
44
45
|
id,
|
|
45
46
|
area: id.split('.')[0],
|
|
46
|
-
title: { en, 'zh-CN': zh },
|
|
47
|
+
title: { en, 'zh-CN': zh, ...(tw ? { 'zh-TW': tw } : {}), ...(ja ? { 'ja-JP': ja } : {}) },
|
|
47
48
|
...more,
|
|
48
49
|
});
|
|
49
50
|
/** Every action of Ta itself; packages add their own (`pi.permissions` of their package.json). */
|
|
50
51
|
exports.TA_ACTIONS = [
|
|
51
|
-
action('chat.view', 'See conversations', '查看对话'),
|
|
52
|
-
action('chat.send', 'Send in conversations', '在对话里发消息'),
|
|
53
|
-
action('chat.create', 'Start conversations', '新建对话'),
|
|
54
|
-
action('chat.stop', 'Stop a reply', '停止回复'),
|
|
55
|
-
action('chat.manage', 'Rename, archive and close conversations', '改名、归档、关闭对话'),
|
|
56
|
-
action('chat.share', 'Share by a link', '生成分享链接'),
|
|
57
|
-
action('agent.view', 'See agents', '查看智能体'),
|
|
58
|
-
action('agent.use', 'Talk with agents', '和智能体对话'),
|
|
59
|
-
action('agent.edit', 'Create, change and remove agents', '新建、修改、删除智能体'),
|
|
60
|
-
action('channel.view', 'See channels', '查看频道'),
|
|
61
|
-
action('channel.post', 'Post in channels', '在频道里发言'),
|
|
62
|
-
action('channel.manage', 'Create and change channels', '新建、管理频道'),
|
|
63
|
-
action('task.view', 'See tasks', '查看任务'),
|
|
64
|
-
action('task.create', 'Hand out tasks', '派任务'),
|
|
65
|
-
action('task.manage', 'Take over and stop tasks', '接管、停止任务'),
|
|
66
|
-
action('files.read', 'Read files', '读文件', { scoped: true }),
|
|
67
|
-
action('files.write', 'Change files', '改文件', { scoped: true }),
|
|
68
|
-
action('commands.run', 'Let Ta run commands', '让 Ta 运行命令', { scoped: true, risky: true }),
|
|
69
|
-
action('commands.terminal', 'Open terminals', '打开终端', { scoped: true, risky: true }),
|
|
70
|
-
action('hosts.use', 'Use remote hosts', '使用远程主机', { risky: true }),
|
|
71
|
-
action('models.use', 'Use the models', '使用模型'),
|
|
72
|
-
action('models.manage', 'Sign in to models', '登录和更换模型账号'),
|
|
73
|
-
action('cron.view', 'See scheduled tasks', '查看定时任务'),
|
|
74
|
-
action('cron.manage', 'Change scheduled tasks', '管理定时任务'),
|
|
75
|
-
action('extensions.use', 'Use extensions', '使用扩展'),
|
|
76
|
-
action('extensions.install', 'Install and turn off extensions', '安装、停用扩展'),
|
|
77
|
-
action('settings.view', 'See settings', '查看设置'),
|
|
78
|
-
action('settings.manage', 'Change settings', '修改设置'),
|
|
79
|
-
action('members.view', 'See members', '查看成员'),
|
|
80
|
-
action('members.invite', 'Invite people', '邀请别人'),
|
|
81
|
-
action('members.approve', 'Answer requests', '处理申请'),
|
|
82
|
-
action('members.roles', 'Change roles and members', '管理角色和成员'),
|
|
83
|
-
action('audit.view', 'See the record', '查看记录'),
|
|
52
|
+
action('chat.view', 'See conversations', '查看对话', '檢視對話', '会話を確認'),
|
|
53
|
+
action('chat.send', 'Send in conversations', '在对话里发消息', '在對話裡發訊息', '会話にメッセージを送信'),
|
|
54
|
+
action('chat.create', 'Start conversations', '新建对话', '新建對話', '新しい会話を開始'),
|
|
55
|
+
action('chat.stop', 'Stop a reply', '停止回复', '停止回覆', '返信を停止'),
|
|
56
|
+
action('chat.manage', 'Rename, archive and close conversations', '改名、归档、关闭对话', '改名、歸檔、關閉對話', '会話の名前変更、アーカイブ、クローズ'),
|
|
57
|
+
action('chat.share', 'Share by a link', '生成分享链接', '生成分享連結', '共有リンクで共有'),
|
|
58
|
+
action('agent.view', 'See agents', '查看智能体', '檢視智慧體', 'エージェントを確認'),
|
|
59
|
+
action('agent.use', 'Talk with agents', '和智能体对话', '和智慧體對話', 'エージェントと対話'),
|
|
60
|
+
action('agent.edit', 'Create, change and remove agents', '新建、修改、删除智能体', '新建、修改、刪除智慧體', 'エージェントを作成・変更・削除'),
|
|
61
|
+
action('channel.view', 'See channels', '查看频道', '檢視頻道', 'チャネルを確認'),
|
|
62
|
+
action('channel.post', 'Post in channels', '在频道里发言', '在頻道里發言', 'チャネルに投稿'),
|
|
63
|
+
action('channel.manage', 'Create and change channels', '新建、管理频道', '新建、管理頻道', 'チャネルを作成・管理'),
|
|
64
|
+
action('task.view', 'See tasks', '查看任务', '檢視任務', 'タスクを確認'),
|
|
65
|
+
action('task.create', 'Hand out tasks', '派任务', '派任務', 'タスクを割り当て'),
|
|
66
|
+
action('task.manage', 'Take over and stop tasks', '接管、停止任务', '接管、停止任務', 'タスクを引き継ぎ・停止'),
|
|
67
|
+
action('files.read', 'Read files', '读文件', '讀檔案', 'ファイルを読取', { scoped: true }),
|
|
68
|
+
action('files.write', 'Change files', '改文件', '改檔案', 'ファイルを変更', { scoped: true }),
|
|
69
|
+
action('commands.run', 'Let Ta run commands', '让 Ta 运行命令', '讓 Ta 執行命令', 'Ta にコマンド実行を許可', { scoped: true, risky: true }),
|
|
70
|
+
action('commands.terminal', 'Open terminals', '打开终端', '開啟終端機', 'ターミナルを開く', { scoped: true, risky: true }),
|
|
71
|
+
action('hosts.use', 'Use remote hosts', '使用远程主机', '使用遠端主機', 'リモートホストを使用', { risky: true }),
|
|
72
|
+
action('models.use', 'Use the models', '使用模型', '使用模型', 'モデルを使用'),
|
|
73
|
+
action('models.manage', 'Sign in to models', '登录和更换模型账号', '登入和更換模型帳號', 'モデルアカウントにサインイン・変更'),
|
|
74
|
+
action('cron.view', 'See scheduled tasks', '查看定时任务', '檢視定時任務', 'スケジュールタスクを確認'),
|
|
75
|
+
action('cron.manage', 'Change scheduled tasks', '管理定时任务', '管理定時任務', 'スケジュールタスクを管理'),
|
|
76
|
+
action('extensions.use', 'Use extensions', '使用扩展', '使用擴充功能', '拡張機能を使用'),
|
|
77
|
+
action('extensions.install', 'Install and turn off extensions', '安装、停用扩展', '安裝、停用擴充功能', '拡張機能をインストール・無効化'),
|
|
78
|
+
action('settings.view', 'See settings', '查看设置', '檢視設定', '設定を確認'),
|
|
79
|
+
action('settings.manage', 'Change settings', '修改设置', '修改設定', '設定を変更'),
|
|
80
|
+
action('members.view', 'See members', '查看成员', '檢視成員', 'メンバーを確認'),
|
|
81
|
+
action('members.invite', 'Invite people', '邀请别人', '邀請別人', 'メンバーを招待'),
|
|
82
|
+
action('members.approve', 'Answer requests', '处理申请', '處理申請', 'リクエストに対応'),
|
|
83
|
+
action('members.roles', 'Change roles and members', '管理角色和成员', '管理角色和成員', 'ロールとメンバーを管理'),
|
|
84
|
+
action('audit.view', 'See the record', '查看记录', '檢視記錄', 'レコードを確認'),
|
|
84
85
|
];
|
|
85
86
|
var TaActionUtil;
|
|
86
87
|
(function (TaActionUtil) {
|
|
@@ -91,8 +92,18 @@ var TaActionUtil;
|
|
|
91
92
|
TaActionUtil.info = info;
|
|
92
93
|
/** Its title in a language such as `zh-CN`; the id for an action of no catalog. */
|
|
93
94
|
function title(id, language) {
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
var _a;
|
|
96
|
+
var _b, _c;
|
|
97
|
+
const title = (_a = byId.get(id)) === null || _a === void 0 ? void 0 : _a.title;
|
|
98
|
+
if (!title) {
|
|
99
|
+
return id;
|
|
100
|
+
}
|
|
101
|
+
return language_1.TaLanguageUtil.pick(language, {
|
|
102
|
+
'zh-CN': title['zh-CN'],
|
|
103
|
+
'zh-TW': (_b = title['zh-TW']) !== null && _b !== void 0 ? _b : title['zh-CN'],
|
|
104
|
+
'en-US': title.en,
|
|
105
|
+
'ja-JP': (_c = title['ja-JP']) !== null && _c !== void 0 ? _c : title.en,
|
|
106
|
+
});
|
|
96
107
|
}
|
|
97
108
|
TaActionUtil.title = title;
|
|
98
109
|
/** Whether `path` is `dir` or inside it; both absolute, `/` separated. */
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-protocol",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"description": "The protocol between ta serve and its clients",
|
|
5
|
-
"homepage": "https://github.com/cellbang/
|
|
5
|
+
"homepage": "https://github.com/cellbang/ta",
|
|
6
6
|
"bugs": {
|
|
7
|
-
"url": "https://github.com/cellbang/
|
|
7
|
+
"url": "https://github.com/cellbang/ta/issues"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|