@aalis/plugin-cli 0.13.0 → 0.14.1

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.
@@ -0,0 +1,250 @@
1
+ // ════════════════════════════════════════════════════════════
2
+ // 终端的会话视图:经会话协议在进程内接到会话服务,传输只有 connect(peer, send) 这一处。握手之后跟着后台任务(收起规则要知道
3
+ // 任务还在不在跑),订阅终端的会话,把条目与增量交给聊天区。帧的规则同 WebUI 的会话客户端:请求按 id 配对;推送的 epoch 变了
4
+ // 重新订阅,seq 不大于快照的丢掉;收到 session/resync 重新订阅。快照里只取还没收尾的回合的条目:已收尾的历史不画,聊天区是这次
5
+ // 运行的记录。计划、用量与排着的输入不进聊天区。
6
+ // 进程内的帧是同步送达的:会话服务发出订阅的回应之后,紧接着在同一拍补发取快照期间攒着的推送,所以快照在回应到达的那一拍就交给
7
+ // 聊天区、写上位置,不等 Promise 的下一拍。握手出错(版本不合、取后台任务出错)时关掉这条连接,她的回复只整条写出。
8
+ // 审批经审批面直接接入,不走这条连接:连接不上报在场,收不到审批推送
9
+ // ════════════════════════════════════════════════════════════
10
+ import { SESSION_PROTOCOL_VERSION, } from '@aalis/api-session-protocol';
11
+ const inTimeline = (item) => item.kind !== 'plan' && item.kind !== 'usage' && item.kind !== 'queue';
12
+ /** 终端在进程内接入,没有单独发版的客户端:版本写它实现的协议版本 */
13
+ const CLIENT = { name: 'cli', version: SESSION_PROTOCOL_VERSION };
14
+ /** 会话服务回了错误;reason 是业务错误码 */
15
+ class RequestFailed extends Error {
16
+ reason;
17
+ constructor(message, reason) {
18
+ super(message);
19
+ this.reason = reason;
20
+ }
21
+ }
22
+ /** 请求所在的连接已断开(会话服务断开了它,或换了提供者):在途的作废,不算出错 */
23
+ class ConnectionLost extends Error {
24
+ }
25
+ export class SessionView {
26
+ sessionId;
27
+ peer;
28
+ sink;
29
+ logger;
30
+ conn;
31
+ /** 这次连接的握手与后台任务的首次取数 */
32
+ ready = Promise.resolve();
33
+ nextId = 0;
34
+ pending = new Map();
35
+ /** 最近一次快照的位置;没订上或正在订时为空,这期间的推送都丢掉 */
36
+ position;
37
+ /** 每次订阅加一,只认最后一次订阅回来的快照 */
38
+ generation = 0;
39
+ subscribing;
40
+ /** 后台任务的状态,按任务 id */
41
+ tasks = new Map();
42
+ /** 取后台任务列表期间到的增量,取完以后补上 */
43
+ listing;
44
+ constructor(sessionId, peer, sink, logger) {
45
+ this.sessionId = sessionId;
46
+ this.peer = peer;
47
+ this.sink = sink;
48
+ this.logger = logger;
49
+ }
50
+ /** 转到后台的调用的任务还在跑 */
51
+ taskRunning = (taskId) => this.tasks.get(taskId) === 'running';
52
+ /**
53
+ * 她回复的正文由条目画:订着终端的会话。握手或订阅在途时等到都落定再答:这期间推来的条目由会话服务攒着、回应之后补发,先整条
54
+ * 写出的话条目来了又画一遍。回应之后同一拍补发的 resync 会再订一次,所以等到没有在途的订阅
55
+ */
56
+ async drawsReplies() {
57
+ await this.ready;
58
+ while (this.subscribing)
59
+ await this.subscribing;
60
+ return this.position !== undefined;
61
+ }
62
+ /** 接到这一家会话服务(follow 的挂载):交回的清理关掉这条连接 */
63
+ attach(service) {
64
+ const conn = service.connect({ ...this.peer, disconnect: () => this.drop(conn) }, frame => {
65
+ if (this.conn === conn)
66
+ this.receive(frame);
67
+ });
68
+ this.conn = conn;
69
+ this.ready = this.handshake(conn);
70
+ return () => {
71
+ this.drop(conn);
72
+ conn.close();
73
+ };
74
+ }
75
+ /** 还没订上就订,等订阅落定;会话服务不在时立即返回。订不上不抛(照整条回复写) */
76
+ async ensureSubscribed() {
77
+ await this.ready;
78
+ if (this.conn && !this.position)
79
+ await (this.subscribing ?? this.subscribe());
80
+ }
81
+ /** 握手、跟上后台任务,再订阅;连接在这期间断开就停下 */
82
+ async handshake(conn) {
83
+ try {
84
+ await this.request(conn, 'initialize', { protocolVersion: SESSION_PROTOCOL_VERSION, client: CLIENT });
85
+ await this.request(conn, 'background/watch', {});
86
+ this.listing = [];
87
+ const listed = await this.request(conn, 'background/list', {}).then(({ tasks }) => tasks, (err) => {
88
+ // 没有后台任务登记:按没有任务
89
+ if (err instanceof RequestFailed && err.reason === 'unsupported')
90
+ return [];
91
+ throw err;
92
+ });
93
+ if (this.conn !== conn)
94
+ return;
95
+ this.tasks.clear();
96
+ for (const task of listed)
97
+ this.tasks.set(task.id, task.status);
98
+ for (const change of this.listing)
99
+ this.apply(change);
100
+ this.listing = undefined;
101
+ this.sink.tasks();
102
+ }
103
+ catch (err) {
104
+ if (err instanceof ConnectionLost)
105
+ return;
106
+ this.logger.warn('终端接入会话服务失败,聊天区只写整条回复:', err);
107
+ this.drop(conn);
108
+ conn.close();
109
+ return;
110
+ }
111
+ await this.subscribe();
112
+ }
113
+ subscribe() {
114
+ const conn = this.conn;
115
+ if (!conn)
116
+ return Promise.resolve();
117
+ const generation = ++this.generation;
118
+ this.position = undefined;
119
+ const done = new Promise(settled => {
120
+ const waiting = {
121
+ resolve: snapshot => {
122
+ if (generation === this.generation)
123
+ this.applySnapshot(snapshot);
124
+ settled();
125
+ },
126
+ reject: err => {
127
+ // 会话还没建档:第一条消息发出之前建档后再订
128
+ if (generation === this.generation && !(err instanceof RequestFailed && err.reason === 'not-found')) {
129
+ this.logger.warn(`终端订阅会话 ${this.sessionId} 失败,聊天区只写整条回复:`, err);
130
+ }
131
+ settled();
132
+ },
133
+ };
134
+ this.send(conn, 'session/subscribe', { sessionId: this.sessionId }, waiting);
135
+ }).finally(() => {
136
+ if (this.subscribing === done)
137
+ this.subscribing = undefined;
138
+ });
139
+ this.subscribing = done;
140
+ return done;
141
+ }
142
+ applySnapshot(snapshot) {
143
+ this.position = { epoch: snapshot.epoch, seq: snapshot.seq };
144
+ const open = new Set(snapshot.items.flatMap(item => (item.kind === 'turn' && item.outcome === undefined ? [item.turnId] : [])));
145
+ for (const item of snapshot.items) {
146
+ if (item.turnId !== undefined && open.has(item.turnId) && inTimeline(item))
147
+ this.sink.item(item);
148
+ }
149
+ }
150
+ /** 在 conn 上发一个请求,回应到达的那一拍交给 waiting;它已不是当前的连接时以 ConnectionLost 失败 */
151
+ send(conn, method, params, waiting) {
152
+ if (this.conn !== conn) {
153
+ waiting.reject(new ConnectionLost());
154
+ return;
155
+ }
156
+ const id = ++this.nextId;
157
+ this.pending.set(id, waiting);
158
+ void conn.receive(JSON.stringify({ jsonrpc: '2.0', id, method, params }));
159
+ }
160
+ /** {@link send} 的 Promise 写法:回应到达之后的下一拍落定 */
161
+ request(conn, method, params) {
162
+ return new Promise((resolve, reject) => this.send(conn, method, params, {
163
+ resolve: result => resolve(result),
164
+ reject,
165
+ }));
166
+ }
167
+ receive(text) {
168
+ const frame = JSON.parse(text);
169
+ if ('method' in frame) {
170
+ this.notify(frame.method, frame.params);
171
+ return;
172
+ }
173
+ if (frame.id === null) {
174
+ // id 为空的错误帧:会话服务认不出终端发的这一帧,只会是终端的缺陷
175
+ this.logger.warn('会话服务拒收了终端发的一帧:', frame.error.message);
176
+ return;
177
+ }
178
+ const waiting = this.pending.get(frame.id);
179
+ this.pending.delete(frame.id);
180
+ if ('error' in frame)
181
+ waiting.reject(new RequestFailed(frame.error.message, frame.error.data?.code));
182
+ else
183
+ waiting.resolve(frame.result);
184
+ }
185
+ notify(method, params) {
186
+ switch (method) {
187
+ case 'item/started':
188
+ case 'item/completed': {
189
+ const push = params;
190
+ if (this.accept(push) && inTimeline(push.item))
191
+ this.sink.item(push.item);
192
+ return;
193
+ }
194
+ case 'item/delta': {
195
+ const push = params;
196
+ if (this.accept(push))
197
+ this.sink.delta(push.itemId, push.text);
198
+ return;
199
+ }
200
+ case 'session/resync':
201
+ if (this.accept(params))
202
+ void this.subscribe();
203
+ return;
204
+ case 'background/changed': {
205
+ const change = params;
206
+ if (this.listing)
207
+ this.listing.push(change);
208
+ else {
209
+ this.apply(change);
210
+ this.sink.tasks();
211
+ }
212
+ return;
213
+ }
214
+ }
215
+ }
216
+ /** 推送是否该交给聊天区:快照之后、没见过的才交,epoch 变了(会话服务重启过)就重新订阅 */
217
+ accept({ sessionId, epoch, seq }) {
218
+ const position = this.position;
219
+ if (sessionId !== this.sessionId || !position)
220
+ return false;
221
+ if (epoch !== position.epoch) {
222
+ void this.subscribe();
223
+ return false;
224
+ }
225
+ if (seq <= position.seq)
226
+ return false;
227
+ position.seq = seq;
228
+ return true;
229
+ }
230
+ apply(change) {
231
+ for (const task of change.upserts)
232
+ this.tasks.set(task.id, task.status);
233
+ for (const id of change.removes)
234
+ this.tasks.delete(id);
235
+ }
236
+ /** 连接断开(会话服务断开它,或这次挂载清理):等着的请求失败,订阅作废 */
237
+ drop(conn) {
238
+ if (this.conn !== conn)
239
+ return;
240
+ this.conn = undefined;
241
+ this.position = undefined;
242
+ this.generation++;
243
+ this.listing = undefined;
244
+ this.tasks.clear();
245
+ for (const waiting of this.pending.values())
246
+ waiting.reject(new ConnectionLost());
247
+ this.pending.clear();
248
+ }
249
+ }
250
+ //# sourceMappingURL=session-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-view.js","sourceRoot":"","sources":["../src/session-view.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,0EAA0E;AAC1E,yEAAyE;AACzE,2EAA2E;AAC3E,0BAA0B;AAC1B,iEAAiE;AACjE,gEAAgE;AAChE,oCAAoC;AACpC,+DAA+D;AAE/D,OAAO,EAGL,wBAAwB,GASzB,MAAM,6BAA6B,CAAC;AAMrC,MAAM,UAAU,GAAG,CAAC,IAA4B,EAAwB,EAAE,CACxE,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;AAEzE,sCAAsC;AACtC,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAElE,6BAA6B;AAC7B,MAAM,aAAc,SAAQ,KAAK;IAGpB;IAFX,YACE,OAAe,EACN,MAAkB;QAE3B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AC,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,yCAAyC;IACjC,IAAI,CAAC,IAAuB;QAClC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;YAAE,OAAO;QAC/B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAAE,OAAO,CAAC,MAAM,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC;QAClF,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,207 @@
1
+ declare const SOURCE: {
2
+ readonly language: "zh-CN";
3
+ readonly displayName: "CLI 终端";
4
+ readonly sessionIdLabel: "默认会话 ID";
5
+ readonly sessionIdDescription: "CLI 聊天所在的会话标识。";
6
+ readonly lastViewLabel: "上次视图";
7
+ readonly lastViewDescription: "运行时自动写回;startupView=last 时启动恢复到这里记录的视图。";
8
+ readonly promptLabel: "提示符";
9
+ readonly promptDescription: "命令行输入提示符前缀";
10
+ readonly maxLogEntriesLabel: "日志内存缓冲上限(条)";
11
+ readonly maxLogEntriesDescription: "日志页内存驻留的最大条数,超出后从最旧成块丢弃;完整日志始终在家目录的 logs/latest.log";
12
+ readonly startupViewLabel: "启动视图";
13
+ readonly startupViewDescription: "CLI 接管终端后的默认视图。last 表示恢复上次视图";
14
+ readonly viewLast: "恢复上次";
15
+ readonly viewChat: "聊天";
16
+ readonly viewLogs: "日志";
17
+ readonly viewStatus: "状态";
18
+ readonly viewHelp: "帮助";
19
+ readonly welcome: "欢迎使用 {name}。按 {key} 查看快捷键。";
20
+ readonly unreadyDoctor: "有 {count, number} 个插件没起来,输入 {command} 查看原因与修法";
21
+ readonly unreadyLogs: "有 {count, number} 个插件没起来,按 {key} 看日志";
22
+ readonly settledApproved: "审批 {tool}:已批准";
23
+ readonly settledDenied: "审批 {tool}:已拒绝";
24
+ readonly settledExpired: "审批 {tool}:没有人应答,按拒绝处理";
25
+ readonly settledCancelled: "审批 {tool}:已撤销";
26
+ readonly answerRefused: "审批 {tool}:应答没有生效:{reason}";
27
+ readonly attachmentKind: "{kind, select, image {图片} audio {音频} video {视频} file {文件} other {附件}}";
28
+ readonly inlineData: "内联数据";
29
+ readonly size: "{bytes, size}";
30
+ readonly toolRun: "执行 {command}";
31
+ readonly toolRunClipped: "执行 {head}…(省略 {count, number} 字)…{tail}";
32
+ readonly toolWrite: "写入 {path}";
33
+ readonly toolEdit: "修改 {path}";
34
+ readonly toolCall: "调用 {tool}";
35
+ readonly generating: "正在生成";
36
+ readonly running: "运行中";
37
+ readonly waitingApproval: "等你批准";
38
+ readonly failed: "失败";
39
+ readonly exitCode: "退出码 {code}";
40
+ readonly stopped: "已停止";
41
+ readonly denied: "没批准";
42
+ readonly backgroundRunning: "转到后台 · 运行中";
43
+ readonly durationSeconds: "{seconds} 秒";
44
+ readonly durationMinutes: "{minutes, number} 分 {seconds, number} 秒";
45
+ readonly callKindCommand: "执行命令 {count, number}";
46
+ readonly callKindFileChange: "改动文件 {count, number}";
47
+ readonly callKindOther: "其他 {count, number}";
48
+ readonly callsMixed: "调用了 {count, number} 个工具:{kinds, list}";
49
+ readonly callsCommands: "执行了 {count, number} 条命令";
50
+ readonly callsFileChanges: "改动了 {count, number} 次文件";
51
+ readonly callsTools: "调用了 {count, number} 个工具";
52
+ readonly cardHeading: "需要批准";
53
+ readonly cardSubject: "{tool} · 会话 {session}";
54
+ readonly cardSubjectWaiting: "{tool} · 会话 {session} · 还有 {count, number} 张";
55
+ readonly factSubtask: "子任务";
56
+ readonly factCommand: "命令";
57
+ readonly factCwd: "目录";
58
+ readonly factFile: "文件";
59
+ readonly factPatch: "改动";
60
+ readonly factParams: "参数";
61
+ readonly linesOmitted: "…(省略 {count, number} 行)…";
62
+ readonly charsOmitted: "…(省略 {count, number} 字)…";
63
+ readonly approve: "批准";
64
+ readonly deny: "拒绝";
65
+ readonly cardKeys: "←/→ 选择 · Enter 确定 · Ctrl+Y 批准 · Ctrl+N 拒绝";
66
+ readonly statusRuntime: "运行时";
67
+ readonly logCount: "{count, number} 条";
68
+ readonly statusServices: "服务 ({count, number})";
69
+ readonly statusConnections: "平台连接 ({count, number})";
70
+ readonly noConnections: "— 无";
71
+ readonly helpViews: "视图切换";
72
+ readonly helpChat: "Chat · 聊天 / 命令输入";
73
+ readonly helpLogs: "Logs · 实时日志";
74
+ readonly helpStatus: "Status · 服务与平台状态";
75
+ readonly helpHelp: "Help · 当前页";
76
+ readonly helpExpand: "连续的工具调用:全部展开 / 全部收起";
77
+ readonly helpBack: "返回上一个视图";
78
+ readonly helpExit: "退出";
79
+ readonly helpScrolling: "滚动 (Logs / Status / Help)";
80
+ readonly helpLine: "逐行滚动";
81
+ readonly helpPage: "翻页";
82
+ readonly helpTop: "回到顶部";
83
+ readonly helpBottom: "到底部";
84
+ readonly helpWrap: "日志页:切换换行模式(多行完整展示)";
85
+ readonly helpEditing: "编辑";
86
+ readonly helpSubmit: "提交输入";
87
+ readonly helpNewline: "插入换行(macOS Ctrl+Enter)";
88
+ readonly helpShiftNewline: "插入换行(如终端支持)";
89
+ readonly helpHistory: "历史记录回溯(chat 视图)";
90
+ readonly helpCard: "审批卡(卡在时打字与回车不算应答,也不进输入框)";
91
+ readonly helpChoose: "选批准 / 拒绝,Enter 确定";
92
+ readonly helpTips: "提示";
93
+ readonly tipLogFile: "• 完整日志写入家目录的 logs/latest.log,每次启动时上一轮改名为 latest.1.log,保留 5 份;跨重启持续跟随用 tail -F。";
94
+ readonly tipRestore: "• 退出时自动恢复原终端内容(alternate screen)。";
95
+ readonly tipCommands: "• 输入以 / 开头会按命令解析,否则发给 agent。";
96
+ readonly tipKeys: "• ↑/↓、PgUp/PgDn、Home/End 滚动 Logs / Status / Help;选择 / 复制文本直接用终端原生操作。";
97
+ readonly viewLine: "{view} · {total, number} 行 · scroll {scroll} · 按 Ctrl+T 回到聊天";
98
+ readonly footerBack: "返回";
99
+ readonly footerWrap: "换行:{state}";
100
+ readonly wrapOn: "开";
101
+ readonly wrapOff: "关";
102
+ };
103
+ export type Source = typeof SOURCE;
104
+ export declare const t: import("@aalis/schema-i18n").TextFactory<{
105
+ readonly language: "zh-CN";
106
+ readonly displayName: "CLI 终端";
107
+ readonly sessionIdLabel: "默认会话 ID";
108
+ readonly sessionIdDescription: "CLI 聊天所在的会话标识。";
109
+ readonly lastViewLabel: "上次视图";
110
+ readonly lastViewDescription: "运行时自动写回;startupView=last 时启动恢复到这里记录的视图。";
111
+ readonly promptLabel: "提示符";
112
+ readonly promptDescription: "命令行输入提示符前缀";
113
+ readonly maxLogEntriesLabel: "日志内存缓冲上限(条)";
114
+ readonly maxLogEntriesDescription: "日志页内存驻留的最大条数,超出后从最旧成块丢弃;完整日志始终在家目录的 logs/latest.log";
115
+ readonly startupViewLabel: "启动视图";
116
+ readonly startupViewDescription: "CLI 接管终端后的默认视图。last 表示恢复上次视图";
117
+ readonly viewLast: "恢复上次";
118
+ readonly viewChat: "聊天";
119
+ readonly viewLogs: "日志";
120
+ readonly viewStatus: "状态";
121
+ readonly viewHelp: "帮助";
122
+ readonly welcome: "欢迎使用 {name}。按 {key} 查看快捷键。";
123
+ readonly unreadyDoctor: "有 {count, number} 个插件没起来,输入 {command} 查看原因与修法";
124
+ readonly unreadyLogs: "有 {count, number} 个插件没起来,按 {key} 看日志";
125
+ readonly settledApproved: "审批 {tool}:已批准";
126
+ readonly settledDenied: "审批 {tool}:已拒绝";
127
+ readonly settledExpired: "审批 {tool}:没有人应答,按拒绝处理";
128
+ readonly settledCancelled: "审批 {tool}:已撤销";
129
+ readonly answerRefused: "审批 {tool}:应答没有生效:{reason}";
130
+ readonly attachmentKind: "{kind, select, image {图片} audio {音频} video {视频} file {文件} other {附件}}";
131
+ readonly inlineData: "内联数据";
132
+ readonly size: "{bytes, size}";
133
+ readonly toolRun: "执行 {command}";
134
+ readonly toolRunClipped: "执行 {head}…(省略 {count, number} 字)…{tail}";
135
+ readonly toolWrite: "写入 {path}";
136
+ readonly toolEdit: "修改 {path}";
137
+ readonly toolCall: "调用 {tool}";
138
+ readonly generating: "正在生成";
139
+ readonly running: "运行中";
140
+ readonly waitingApproval: "等你批准";
141
+ readonly failed: "失败";
142
+ readonly exitCode: "退出码 {code}";
143
+ readonly stopped: "已停止";
144
+ readonly denied: "没批准";
145
+ readonly backgroundRunning: "转到后台 · 运行中";
146
+ readonly durationSeconds: "{seconds} 秒";
147
+ readonly durationMinutes: "{minutes, number} 分 {seconds, number} 秒";
148
+ readonly callKindCommand: "执行命令 {count, number}";
149
+ readonly callKindFileChange: "改动文件 {count, number}";
150
+ readonly callKindOther: "其他 {count, number}";
151
+ readonly callsMixed: "调用了 {count, number} 个工具:{kinds, list}";
152
+ readonly callsCommands: "执行了 {count, number} 条命令";
153
+ readonly callsFileChanges: "改动了 {count, number} 次文件";
154
+ readonly callsTools: "调用了 {count, number} 个工具";
155
+ readonly cardHeading: "需要批准";
156
+ readonly cardSubject: "{tool} · 会话 {session}";
157
+ readonly cardSubjectWaiting: "{tool} · 会话 {session} · 还有 {count, number} 张";
158
+ readonly factSubtask: "子任务";
159
+ readonly factCommand: "命令";
160
+ readonly factCwd: "目录";
161
+ readonly factFile: "文件";
162
+ readonly factPatch: "改动";
163
+ readonly factParams: "参数";
164
+ readonly linesOmitted: "…(省略 {count, number} 行)…";
165
+ readonly charsOmitted: "…(省略 {count, number} 字)…";
166
+ readonly approve: "批准";
167
+ readonly deny: "拒绝";
168
+ readonly cardKeys: "←/→ 选择 · Enter 确定 · Ctrl+Y 批准 · Ctrl+N 拒绝";
169
+ readonly statusRuntime: "运行时";
170
+ readonly logCount: "{count, number} 条";
171
+ readonly statusServices: "服务 ({count, number})";
172
+ readonly statusConnections: "平台连接 ({count, number})";
173
+ readonly noConnections: "— 无";
174
+ readonly helpViews: "视图切换";
175
+ readonly helpChat: "Chat · 聊天 / 命令输入";
176
+ readonly helpLogs: "Logs · 实时日志";
177
+ readonly helpStatus: "Status · 服务与平台状态";
178
+ readonly helpHelp: "Help · 当前页";
179
+ readonly helpExpand: "连续的工具调用:全部展开 / 全部收起";
180
+ readonly helpBack: "返回上一个视图";
181
+ readonly helpExit: "退出";
182
+ readonly helpScrolling: "滚动 (Logs / Status / Help)";
183
+ readonly helpLine: "逐行滚动";
184
+ readonly helpPage: "翻页";
185
+ readonly helpTop: "回到顶部";
186
+ readonly helpBottom: "到底部";
187
+ readonly helpWrap: "日志页:切换换行模式(多行完整展示)";
188
+ readonly helpEditing: "编辑";
189
+ readonly helpSubmit: "提交输入";
190
+ readonly helpNewline: "插入换行(macOS Ctrl+Enter)";
191
+ readonly helpShiftNewline: "插入换行(如终端支持)";
192
+ readonly helpHistory: "历史记录回溯(chat 视图)";
193
+ readonly helpCard: "审批卡(卡在时打字与回车不算应答,也不进输入框)";
194
+ readonly helpChoose: "选批准 / 拒绝,Enter 确定";
195
+ readonly helpTips: "提示";
196
+ readonly tipLogFile: "• 完整日志写入家目录的 logs/latest.log,每次启动时上一轮改名为 latest.1.log,保留 5 份;跨重启持续跟随用 tail -F。";
197
+ readonly tipRestore: "• 退出时自动恢复原终端内容(alternate screen)。";
198
+ readonly tipCommands: "• 输入以 / 开头会按命令解析,否则发给 agent。";
199
+ readonly tipKeys: "• ↑/↓、PgUp/PgDn、Home/End 滚动 Logs / Status / Help;选择 / 复制文本直接用终端原生操作。";
200
+ readonly viewLine: "{view} · {total, number} 行 · scroll {scroll} · 按 Ctrl+T 回到聊天";
201
+ readonly footerBack: "返回";
202
+ readonly footerWrap: "换行:{state}";
203
+ readonly wrapOn: "开";
204
+ readonly wrapOff: "关";
205
+ }>;
206
+ export {};
207
+ //# sourceMappingURL=texts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"texts.d.ts","sourceRoot":"","sources":["../src/texts.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsGF,CAAC;AACX,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA+F,CAAC"}
package/dist/texts.js ADDED
@@ -0,0 +1,108 @@
1
+ // 本插件自己的原文字典:配置项、聊天区的提示与审批结算行、附件说明、工具调用的一行与收起的一行、审批卡、状态页与帮助页、输入框位置的
2
+ // 视图说明、底栏的按键提示
3
+ import { defineTexts } from '@aalis/schema-i18n';
4
+ import en from './locales/en.js';
5
+ const SOURCE = {
6
+ language: 'zh-CN',
7
+ displayName: 'CLI 终端',
8
+ sessionIdLabel: '默认会话 ID',
9
+ sessionIdDescription: 'CLI 聊天所在的会话标识。',
10
+ lastViewLabel: '上次视图',
11
+ lastViewDescription: '运行时自动写回;startupView=last 时启动恢复到这里记录的视图。',
12
+ promptLabel: '提示符',
13
+ promptDescription: '命令行输入提示符前缀',
14
+ maxLogEntriesLabel: '日志内存缓冲上限(条)',
15
+ maxLogEntriesDescription: '日志页内存驻留的最大条数,超出后从最旧成块丢弃;完整日志始终在家目录的 logs/latest.log',
16
+ startupViewLabel: '启动视图',
17
+ startupViewDescription: 'CLI 接管终端后的默认视图。last 表示恢复上次视图',
18
+ viewLast: '恢复上次',
19
+ viewChat: '聊天',
20
+ viewLogs: '日志',
21
+ viewStatus: '状态',
22
+ viewHelp: '帮助',
23
+ welcome: '欢迎使用 {name}。按 {key} 查看快捷键。',
24
+ unreadyDoctor: '有 {count, number} 个插件没起来,输入 {command} 查看原因与修法',
25
+ unreadyLogs: '有 {count, number} 个插件没起来,按 {key} 看日志',
26
+ settledApproved: '审批 {tool}:已批准',
27
+ settledDenied: '审批 {tool}:已拒绝',
28
+ settledExpired: '审批 {tool}:没有人应答,按拒绝处理',
29
+ settledCancelled: '审批 {tool}:已撤销',
30
+ answerRefused: '审批 {tool}:应答没有生效:{reason}',
31
+ attachmentKind: '{kind, select, image {图片} audio {音频} video {视频} file {文件} other {附件}}',
32
+ inlineData: '内联数据',
33
+ size: '{bytes, size}',
34
+ toolRun: '执行 {command}',
35
+ toolRunClipped: '执行 {head}…(省略 {count, number} 字)…{tail}',
36
+ toolWrite: '写入 {path}',
37
+ toolEdit: '修改 {path}',
38
+ toolCall: '调用 {tool}',
39
+ generating: '正在生成',
40
+ running: '运行中',
41
+ waitingApproval: '等你批准',
42
+ failed: '失败',
43
+ exitCode: '退出码 {code}',
44
+ stopped: '已停止',
45
+ denied: '没批准',
46
+ backgroundRunning: '转到后台 · 运行中',
47
+ durationSeconds: '{seconds} 秒',
48
+ durationMinutes: '{minutes, number} 分 {seconds, number} 秒',
49
+ callKindCommand: '执行命令 {count, number}',
50
+ callKindFileChange: '改动文件 {count, number}',
51
+ callKindOther: '其他 {count, number}',
52
+ callsMixed: '调用了 {count, number} 个工具:{kinds, list}',
53
+ callsCommands: '执行了 {count, number} 条命令',
54
+ callsFileChanges: '改动了 {count, number} 次文件',
55
+ callsTools: '调用了 {count, number} 个工具',
56
+ cardHeading: '需要批准',
57
+ cardSubject: '{tool} · 会话 {session}',
58
+ cardSubjectWaiting: '{tool} · 会话 {session} · 还有 {count, number} 张',
59
+ factSubtask: '子任务',
60
+ factCommand: '命令',
61
+ factCwd: '目录',
62
+ factFile: '文件',
63
+ factPatch: '改动',
64
+ factParams: '参数',
65
+ linesOmitted: '…(省略 {count, number} 行)…',
66
+ charsOmitted: '…(省略 {count, number} 字)…',
67
+ approve: '批准',
68
+ deny: '拒绝',
69
+ cardKeys: '←/→ 选择 · Enter 确定 · Ctrl+Y 批准 · Ctrl+N 拒绝',
70
+ statusRuntime: '运行时',
71
+ logCount: '{count, number} 条',
72
+ statusServices: '服务 ({count, number})',
73
+ statusConnections: '平台连接 ({count, number})',
74
+ noConnections: '— 无',
75
+ helpViews: '视图切换',
76
+ helpChat: 'Chat · 聊天 / 命令输入',
77
+ helpLogs: 'Logs · 实时日志',
78
+ helpStatus: 'Status · 服务与平台状态',
79
+ helpHelp: 'Help · 当前页',
80
+ helpExpand: '连续的工具调用:全部展开 / 全部收起',
81
+ helpBack: '返回上一个视图',
82
+ helpExit: '退出',
83
+ helpScrolling: '滚动 (Logs / Status / Help)',
84
+ helpLine: '逐行滚动',
85
+ helpPage: '翻页',
86
+ helpTop: '回到顶部',
87
+ helpBottom: '到底部',
88
+ helpWrap: '日志页:切换换行模式(多行完整展示)',
89
+ helpEditing: '编辑',
90
+ helpSubmit: '提交输入',
91
+ helpNewline: '插入换行(macOS Ctrl+Enter)',
92
+ helpShiftNewline: '插入换行(如终端支持)',
93
+ helpHistory: '历史记录回溯(chat 视图)',
94
+ helpCard: '审批卡(卡在时打字与回车不算应答,也不进输入框)',
95
+ helpChoose: '选批准 / 拒绝,Enter 确定',
96
+ helpTips: '提示',
97
+ tipLogFile: '• 完整日志写入家目录的 logs/latest.log,每次启动时上一轮改名为 latest.1.log,保留 5 份;跨重启持续跟随用 tail -F。',
98
+ tipRestore: '• 退出时自动恢复原终端内容(alternate screen)。',
99
+ tipCommands: '• 输入以 / 开头会按命令解析,否则发给 agent。',
100
+ tipKeys: '• ↑/↓、PgUp/PgDn、Home/End 滚动 Logs / Status / Help;选择 / 复制文本直接用终端原生操作。',
101
+ viewLine: '{view} · {total, number} 行 · scroll {scroll} · 按 Ctrl+T 回到聊天',
102
+ footerBack: '返回',
103
+ footerWrap: '换行:{state}',
104
+ wrapOn: '开',
105
+ wrapOff: '关',
106
+ };
107
+ export const t = defineTexts({ ns: '@aalis/plugin-cli', language: 'zh-CN', source: SOURCE, locales: { en } });
108
+ //# sourceMappingURL=texts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"texts.js","sourceRoot":"","sources":["../src/texts.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEjC,MAAM,MAAM,GAAG;IACb,QAAQ,EAAE,OAAO;IACjB,WAAW,EAAE,QAAQ;IACrB,cAAc,EAAE,SAAS;IACzB,oBAAoB,EAAE,gBAAgB;IACtC,aAAa,EAAE,MAAM;IACrB,mBAAmB,EAAE,yCAAyC;IAC9D,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,YAAY;IAC/B,kBAAkB,EAAE,aAAa;IACjC,wBAAwB,EAAE,qDAAqD;IAC/E,gBAAgB,EAAE,MAAM;IACxB,sBAAsB,EAAE,8BAA8B;IACtD,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,4BAA4B;IACrC,aAAa,EAAE,+CAA+C;IAC9D,WAAW,EAAE,sCAAsC;IACnD,eAAe,EAAE,eAAe;IAChC,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,uBAAuB;IACvC,gBAAgB,EAAE,eAAe;IACjC,aAAa,EAAE,2BAA2B;IAC1C,cAAc,EAAE,uEAAuE;IACvF,UAAU,EAAE,MAAM;IAClB,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,cAAc;IACvB,cAAc,EAAE,yCAAyC;IACzD,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,WAAW;IACrB,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,KAAK;IACd,eAAe,EAAE,MAAM;IACvB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,YA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