pi-web-ui 0.105.0 → 0.106.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/CHANGELOG.md +58 -1
- package/README.md +193 -797
- package/README.zh-CN.md +186 -625
- package/README.zh-TW.md +781 -0
- package/bin/frp-manager.mjs +1488 -0
- package/bin/pi-web-ui.mjs +27 -0
- package/deploy/nginx-subpath.conf +16 -1
- package/dist/server/agent-service-daemon.js +34 -0
- package/dist/server/agent-service.js +227 -44
- package/dist/server/claim-files-tool.js +8 -1
- package/dist/server/client-state.js +146 -32
- package/dist/server/conversation-read-tool.js +12 -4
- package/dist/server/delegate-task.js +9 -1
- package/dist/server/dispatch-domain-handlers.js +15 -0
- package/dist/server/dsh/dsh-agent-service.js +838 -241
- package/dist/server/dsh/dsh-client.js +59 -18
- package/dist/server/dsh/dsh-market-service.js +233 -0
- package/dist/server/dsh/dsh-serialize.js +11 -3
- package/dist/server/dsh/dsh-sessions.js +64 -2
- package/dist/server/dsh/preset-clones.js +12 -1
- package/dist/server/dsh/runtime/goal-rpc.mjs +183 -45
- package/dist/server/engine-capabilities.js +72 -0
- package/dist/server/engine-probe.js +243 -0
- package/dist/server/goal-service.js +23 -12
- package/dist/server/i18n.js +20 -1
- package/dist/server/index.js +171 -66
- package/dist/server/locales.js +1 -0
- package/dist/server/mcp-agent-tool.js +10 -7
- package/dist/server/mcp-bridge.js +428 -24
- package/dist/server/model-admin.js +172 -74
- package/dist/server/model-resolver.js +221 -0
- package/dist/server/plugin-installer.js +4 -2
- package/dist/server/plugins.js +71 -11
- package/dist/server/present-files-tool.js +10 -2
- package/dist/server/preset-fields.js +14 -0
- package/dist/server/preset-share.js +2 -0
- package/dist/server/protocol-version.js +1 -1
- package/dist/server/schedule-agent-tool.js +2 -1
- package/dist/server/scm-commitmsg.js +3 -2
- package/dist/server/settings-service.js +10 -2
- package/dist/server/skill-discovery.js +161 -0
- package/dist/server/skill-tool.js +2 -1
- package/dist/server/slash-commands.js +154 -73
- package/dist/server/subagent-templates-hant.js +215 -0
- package/dist/server/subagent-templates.js +49 -2
- package/dist/server/subagents.js +22 -12
- package/dist/server/terminals.js +2 -2
- package/dist/server/tool-manager.js +3 -0
- package/dist/server/universal/driver-base.js +56 -0
- package/dist/server/universal/drivers/claude-code.js +462 -0
- package/dist/server/universal/drivers/dsh-driver.js +376 -0
- package/dist/server/universal/drivers/mock-driver.js +103 -0
- package/dist/server/universal/index.js +10 -0
- package/dist/server/universal/session-store.js +100 -0
- package/dist/server/universal/universal-attachments.js +175 -0
- package/dist/server/universal/universal-service.js +149 -0
- package/dist/server/universal/universal-session.js +2610 -0
- package/dist/server/universal/universal-types.js +4 -0
- package/dist/server/update-check.js +4 -1
- package/dist/server/worktree-service.js +1 -1
- package/dist/server/worktree-tool.js +9 -7
- package/package.json +3 -2
- package/plugin-sdk/index.d.ts +12 -2
- package/plugins/catalog.json +39 -5
- package/themes/dark-teal.css +20 -23
- package/themes/md-preview.css +1 -2
- package/themes/wallpaper-obsidian.css +693 -0
- package/web/dist/assets/{TerminalPanel-B9exeXrl.js → TerminalPanel-CfxKLDW9.js} +2 -2
- package/web/dist/assets/index-BtcP6BDk.css +1 -0
- package/web/dist/assets/index-XVtCzcHR.js +690 -0
- package/web/dist/index.html +2 -2
- package/web/dist/sw.js +1 -1
- package/web/dist/assets/index-BQC6lADz.css +0 -1
- package/web/dist/assets/index-D79IKG33.js +0 -690
|
@@ -376,8 +376,16 @@ export function normalizePathKey(p) {
|
|
|
376
376
|
return p;
|
|
377
377
|
}
|
|
378
378
|
try {
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
if (process.platform === "win32") {
|
|
380
|
+
return resolve(p).toLowerCase();
|
|
381
|
+
}
|
|
382
|
+
// 在非 Windows 平台(如 Linux CI 或容器)处理 Windows 盘符路径时做跨平台归一化
|
|
383
|
+
if (/^[a-zA-Z]:[\\/]/.test(p)) {
|
|
384
|
+
const drive = p.slice(0, 2).toLowerCase();
|
|
385
|
+
const rest = p.slice(2).replace(/\\/g, "/").replace(/\/+/g, "/");
|
|
386
|
+
return (drive + rest).toLowerCase();
|
|
387
|
+
}
|
|
388
|
+
return resolve(p);
|
|
381
389
|
}
|
|
382
390
|
catch {
|
|
383
391
|
return process.platform === "win32" ? p.toLowerCase() : p;
|
|
@@ -840,6 +848,7 @@ export class ClientStateStore {
|
|
|
840
848
|
keepRecentMessages: normalizeKeepRecentMessages(stored?.keepRecentMessages),
|
|
841
849
|
showForkedParentSessions: stored?.showForkedParentSessions ?? false,
|
|
842
850
|
retainFinishedConversations: stored?.retainFinishedConversations ?? false,
|
|
851
|
+
openRecentSessionOnProjectSwitch: stored?.openRecentSessionOnProjectSwitch ?? true,
|
|
843
852
|
skillsFullText: normalizeSkillList(stored?.skillsFullText),
|
|
844
853
|
visionBridgeEnabled: stored?.visionBridgeEnabled ?? true,
|
|
845
854
|
visionBridgeModel: stored?.visionBridgeModel ?? null,
|
|
@@ -855,6 +864,7 @@ export class ClientStateStore {
|
|
|
855
864
|
softCapByModel: normalizeSoftCapByModel(stored?.softCapByModel),
|
|
856
865
|
quickPhrases: stored?.quickPhrases ?? [],
|
|
857
866
|
quickPhrasesEnabled: stored?.quickPhrasesEnabled ?? true,
|
|
867
|
+
minimalNewChat: stored?.minimalNewChat ?? false,
|
|
858
868
|
reviewPrompt: stored?.reviewPrompt ?? "",
|
|
859
869
|
reviewDisabledSkills: stored?.reviewDisabledSkills ?? [],
|
|
860
870
|
disabledPlugins: stored?.disabledPlugins ?? [],
|
|
@@ -905,6 +915,7 @@ export class ClientStateStore {
|
|
|
905
915
|
keepRecentMessages: normalizeKeepRecentMessages(settings.keepRecentMessages ?? cur.keepRecentMessages ?? DEFAULT_KEEP_RECENT_MESSAGES),
|
|
906
916
|
showForkedParentSessions: settings.showForkedParentSessions ?? cur.showForkedParentSessions ?? false,
|
|
907
917
|
retainFinishedConversations: settings.retainFinishedConversations ?? cur.retainFinishedConversations ?? false,
|
|
918
|
+
openRecentSessionOnProjectSwitch: settings.openRecentSessionOnProjectSwitch ?? cur.openRecentSessionOnProjectSwitch ?? true,
|
|
908
919
|
skillsFullText: normalizeSkillList(settings.skillsFullText ?? cur.skillsFullText),
|
|
909
920
|
visionBridgeEnabled: settings.visionBridgeEnabled ?? cur.visionBridgeEnabled ?? true,
|
|
910
921
|
// 按键存在性合并:null 是合法值(清除语义),`null ?? cur` 会把旧值
|
|
@@ -929,6 +940,7 @@ export class ClientStateStore {
|
|
|
929
940
|
uiLayout: normalizeUiLayout(settings.uiLayout ?? cur.uiLayout),
|
|
930
941
|
quickPhrases: settings.quickPhrases ?? cur.quickPhrases ?? [],
|
|
931
942
|
quickPhrasesEnabled: settings.quickPhrasesEnabled ?? cur.quickPhrasesEnabled ?? true,
|
|
943
|
+
minimalNewChat: settings.minimalNewChat ?? cur.minimalNewChat ?? false,
|
|
932
944
|
defaultAgentPreset: settings.defaultAgentPreset ?? cur.defaultAgentPreset ?? "standard",
|
|
933
945
|
defaultPermissionPreset: settings.defaultPermissionPreset ?? cur.defaultPermissionPreset ?? "workspace-write-never",
|
|
934
946
|
};
|
|
@@ -1066,17 +1078,43 @@ export class ClientStateStore {
|
|
|
1066
1078
|
return touched;
|
|
1067
1079
|
}
|
|
1068
1080
|
/** Get the model the user last selected in a project, or undefined. */
|
|
1069
|
-
getProjectModel(clientId, cwd) {
|
|
1081
|
+
getProjectModel(clientId, cwd, engine) {
|
|
1070
1082
|
const all = this.load();
|
|
1071
|
-
|
|
1083
|
+
const eng = engine?.trim();
|
|
1084
|
+
// 1. 如果指定了引擎,优先查找按引擎隔离的项目模型记录
|
|
1085
|
+
if (eng) {
|
|
1086
|
+
const globalEngHit = all[ClientStateStore.GLOBAL_SETTINGS_KEY]?.engineProjectModels?.[eng]?.[cwd];
|
|
1087
|
+
if (globalEngHit)
|
|
1088
|
+
return globalEngHit;
|
|
1089
|
+
const directEng = all[clientId]?.engineProjectModels?.[eng]?.[cwd];
|
|
1090
|
+
if (directEng)
|
|
1091
|
+
return directEng;
|
|
1092
|
+
const engCandidates = [];
|
|
1093
|
+
for (const [id, state] of Object.entries(all)) {
|
|
1094
|
+
if (id === clientId || id === ClientStateStore.GLOBAL_SETTINGS_KEY)
|
|
1095
|
+
continue;
|
|
1096
|
+
const m = state.engineProjectModels?.[eng]?.[cwd];
|
|
1097
|
+
if (m) {
|
|
1098
|
+
const p = state.projects?.find((proj) => proj.path === cwd);
|
|
1099
|
+
engCandidates.push({ model: m, lastUsed: p?.lastUsed ?? 0 });
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
if (engCandidates.length > 0) {
|
|
1103
|
+
engCandidates.sort((a, b) => b.lastUsed - a.lastUsed);
|
|
1104
|
+
return engCandidates[0].model;
|
|
1105
|
+
}
|
|
1106
|
+
// 非 pi 引擎不向旧有的全局 projectModels 回退,保持严格隔离
|
|
1107
|
+
if (eng !== "pi") {
|
|
1108
|
+
return undefined;
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
// 2. 回退到旧有的通用项目模型记录(向后兼容)
|
|
1072
1112
|
const globalHit = all[ClientStateStore.GLOBAL_SETTINGS_KEY]?.projectModels?.[cwd];
|
|
1073
1113
|
if (globalHit)
|
|
1074
1114
|
return globalHit;
|
|
1075
|
-
// 2. 本客户端记忆
|
|
1076
1115
|
const direct = all[clientId]?.projectModels?.[cwd];
|
|
1077
1116
|
if (direct)
|
|
1078
1117
|
return direct;
|
|
1079
|
-
// 3. 其他客户端按最近活跃时间倒序查找兜底
|
|
1080
1118
|
const candidates = [];
|
|
1081
1119
|
for (const [id, state] of Object.entries(all)) {
|
|
1082
1120
|
if (id === clientId || id === ClientStateStore.GLOBAL_SETTINGS_KEY)
|
|
@@ -1094,44 +1132,81 @@ export class ClientStateStore {
|
|
|
1094
1132
|
return undefined;
|
|
1095
1133
|
}
|
|
1096
1134
|
/** Remember the model last selected in a project (immediate, not after a turn). */
|
|
1097
|
-
saveProjectModel(clientId, cwd, modelId) {
|
|
1135
|
+
saveProjectModel(clientId, cwd, modelId, engine) {
|
|
1098
1136
|
const all = this.load();
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1137
|
+
const eng = engine?.trim();
|
|
1138
|
+
if (eng) {
|
|
1139
|
+
const globalState = (all[ClientStateStore.GLOBAL_SETTINGS_KEY] ??= { projects: [] });
|
|
1140
|
+
((globalState.engineProjectModels ??= {})[eng] ??= {})[cwd] = modelId;
|
|
1141
|
+
const state = (all[clientId] ??= { projects: [] });
|
|
1142
|
+
this.touchClient(all, clientId);
|
|
1143
|
+
((state.engineProjectModels ??= {})[eng] ??= {})[cwd] = modelId;
|
|
1144
|
+
}
|
|
1145
|
+
// 若为 pi 引擎或未传 engine,同步维护旧字段 projectModels 保持向后兼容
|
|
1146
|
+
if (!eng || eng === "pi") {
|
|
1147
|
+
const globalState = (all[ClientStateStore.GLOBAL_SETTINGS_KEY] ??= { projects: [] });
|
|
1148
|
+
(globalState.projectModels ??= {})[cwd] = modelId;
|
|
1149
|
+
const state = (all[clientId] ??= { projects: [] });
|
|
1150
|
+
this.touchClient(all, clientId);
|
|
1151
|
+
(state.projectModels ??= {})[cwd] = modelId;
|
|
1152
|
+
}
|
|
1106
1153
|
this.save();
|
|
1107
1154
|
}
|
|
1108
1155
|
/** Drop the per-project model memory for a project (e.g. when the model is
|
|
1109
1156
|
* removed from the catalog). */
|
|
1110
|
-
deleteProjectModel(clientId, cwd) {
|
|
1157
|
+
deleteProjectModel(clientId, cwd, engine) {
|
|
1111
1158
|
const all = this.load();
|
|
1112
|
-
const
|
|
1113
|
-
if (
|
|
1114
|
-
|
|
1115
|
-
if (
|
|
1116
|
-
delete
|
|
1159
|
+
const eng = engine?.trim();
|
|
1160
|
+
if (eng) {
|
|
1161
|
+
const gEng = all[ClientStateStore.GLOBAL_SETTINGS_KEY]?.engineProjectModels?.[eng];
|
|
1162
|
+
if (gEng && cwd in gEng) {
|
|
1163
|
+
delete gEng[cwd];
|
|
1164
|
+
}
|
|
1165
|
+
const cEng = all[clientId]?.engineProjectModels?.[eng];
|
|
1166
|
+
if (cEng && cwd in cEng) {
|
|
1167
|
+
delete cEng[cwd];
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
if (!eng || eng === "pi") {
|
|
1171
|
+
const gMap = all[ClientStateStore.GLOBAL_SETTINGS_KEY]?.projectModels;
|
|
1172
|
+
if (gMap && cwd in gMap) {
|
|
1173
|
+
delete gMap[cwd];
|
|
1174
|
+
if (Object.keys(gMap).length === 0)
|
|
1175
|
+
delete all[ClientStateStore.GLOBAL_SETTINGS_KEY].projectModels;
|
|
1176
|
+
}
|
|
1177
|
+
const map = all[clientId]?.projectModels;
|
|
1178
|
+
if (map && cwd in map) {
|
|
1179
|
+
delete map[cwd];
|
|
1180
|
+
if (Object.keys(map).length === 0)
|
|
1181
|
+
delete all[clientId].projectModels;
|
|
1182
|
+
}
|
|
1117
1183
|
}
|
|
1118
|
-
const map = all[clientId]?.projectModels;
|
|
1119
|
-
if (!map || !(cwd in map))
|
|
1120
|
-
return;
|
|
1121
|
-
delete map[cwd];
|
|
1122
|
-
if (Object.keys(map).length === 0)
|
|
1123
|
-
delete all[clientId].projectModels;
|
|
1124
1184
|
this.save();
|
|
1125
1185
|
}
|
|
1126
1186
|
/** 全局默认模型(跨客户端共享,存 __settings__ 键)。缺省 = 未设置。 */
|
|
1127
|
-
getDefaultModel() {
|
|
1128
|
-
|
|
1187
|
+
getDefaultModel(engine) {
|
|
1188
|
+
const eng = engine?.trim();
|
|
1189
|
+
const globalSettings = this.load()[ClientStateStore.GLOBAL_SETTINGS_KEY];
|
|
1190
|
+
if (eng) {
|
|
1191
|
+
const engDef = globalSettings?.defaultModels?.[eng];
|
|
1192
|
+
if (engDef)
|
|
1193
|
+
return engDef;
|
|
1194
|
+
if (eng !== "pi")
|
|
1195
|
+
return undefined;
|
|
1196
|
+
}
|
|
1197
|
+
return globalSettings?.defaultModel;
|
|
1129
1198
|
}
|
|
1130
1199
|
/** 设置全局默认模型("provider/id")。 */
|
|
1131
|
-
saveDefaultModel(modelId) {
|
|
1200
|
+
saveDefaultModel(modelId, engine) {
|
|
1132
1201
|
const all = this.load();
|
|
1133
1202
|
const state = (all[ClientStateStore.GLOBAL_SETTINGS_KEY] ??= { projects: [] });
|
|
1134
|
-
|
|
1203
|
+
const eng = engine?.trim();
|
|
1204
|
+
if (eng) {
|
|
1205
|
+
(state.defaultModels ??= {})[eng] = modelId;
|
|
1206
|
+
}
|
|
1207
|
+
if (!eng || eng === "pi") {
|
|
1208
|
+
state.defaultModel = modelId;
|
|
1209
|
+
}
|
|
1135
1210
|
this.save();
|
|
1136
1211
|
}
|
|
1137
1212
|
/** 清除全局默认模型(连带其 key 记忆)。 */
|
|
@@ -1276,7 +1351,7 @@ export class ClientStateStore {
|
|
|
1276
1351
|
/** 读取某客户端(标签页)上次使用的引擎(未设置返回 undefined)。 */
|
|
1277
1352
|
getClientEngine(clientId) {
|
|
1278
1353
|
const eng = this.load()[clientId]?.engine;
|
|
1279
|
-
return eng === "dsh" || eng === "pi" ? eng : undefined;
|
|
1354
|
+
return eng === "dsh" || eng === "pi" || eng === "claude" ? eng : undefined;
|
|
1280
1355
|
}
|
|
1281
1356
|
/** 保存某客户端(标签页)当前使用的引擎。 */
|
|
1282
1357
|
saveClientEngine(clientId, engine) {
|
|
@@ -1289,7 +1364,7 @@ export class ClientStateStore {
|
|
|
1289
1364
|
/** 读取全局默认引擎(存在 __settings__ 下,新标签页及服务重启后默认跟随)。 */
|
|
1290
1365
|
getDefaultEngine() {
|
|
1291
1366
|
const eng = this.load()[ClientStateStore.GLOBAL_SETTINGS_KEY]?.defaultEngine;
|
|
1292
|
-
return eng === "dsh" || eng === "pi" ? eng : undefined;
|
|
1367
|
+
return eng === "dsh" || eng === "pi" || eng === "claude" ? eng : undefined;
|
|
1293
1368
|
}
|
|
1294
1369
|
/** 保存全局默认引擎。 */
|
|
1295
1370
|
saveDefaultEngine(engine) {
|
|
@@ -1298,4 +1373,43 @@ export class ClientStateStore {
|
|
|
1298
1373
|
state.defaultEngine = engine;
|
|
1299
1374
|
this.save();
|
|
1300
1375
|
}
|
|
1376
|
+
/** 保存指定会话的自定义标题(按 cwd + sessionKey 索引,跨重启存活) */
|
|
1377
|
+
saveSessionTitle(cwd, sessionKey, title) {
|
|
1378
|
+
const all = this.load();
|
|
1379
|
+
const state = (all[ClientStateStore.GLOBAL_SETTINGS_KEY] ??= { projects: [] });
|
|
1380
|
+
const map = (state.sessionTitles ??= {});
|
|
1381
|
+
const normCwd = normalizePathKey(cwd);
|
|
1382
|
+
const normKey = normalizePathKey(sessionKey);
|
|
1383
|
+
const cwdMap = (map[normCwd] ??= {});
|
|
1384
|
+
cwdMap[normKey] = title.trim();
|
|
1385
|
+
this.save();
|
|
1386
|
+
}
|
|
1387
|
+
/** 读取指定会话的自定义标题(若未自定义过返回 undefined) */
|
|
1388
|
+
getSessionTitle(cwd, sessionKey) {
|
|
1389
|
+
const all = this.load();
|
|
1390
|
+
const map = all[ClientStateStore.GLOBAL_SETTINGS_KEY]?.sessionTitles;
|
|
1391
|
+
if (!map)
|
|
1392
|
+
return undefined;
|
|
1393
|
+
const normCwd = normalizePathKey(cwd);
|
|
1394
|
+
const normKey = normalizePathKey(sessionKey);
|
|
1395
|
+
return map[normCwd]?.[normKey] || map[normCwd]?.[sessionKey];
|
|
1396
|
+
}
|
|
1397
|
+
/** 删除指定会话的自定义标题记忆 */
|
|
1398
|
+
deleteSessionTitle(cwd, sessionKey) {
|
|
1399
|
+
const all = this.load();
|
|
1400
|
+
const map = all[ClientStateStore.GLOBAL_SETTINGS_KEY]?.sessionTitles;
|
|
1401
|
+
if (!map)
|
|
1402
|
+
return;
|
|
1403
|
+
const normCwd = normalizePathKey(cwd);
|
|
1404
|
+
const normKey = normalizePathKey(sessionKey);
|
|
1405
|
+
if (map[normCwd]) {
|
|
1406
|
+
delete map[normCwd][normKey];
|
|
1407
|
+
delete map[normCwd][sessionKey];
|
|
1408
|
+
if (Object.keys(map[normCwd]).length === 0)
|
|
1409
|
+
delete map[normCwd];
|
|
1410
|
+
if (Object.keys(map).length === 0)
|
|
1411
|
+
delete all[ClientStateStore.GLOBAL_SETTINGS_KEY].sessionTitles;
|
|
1412
|
+
this.save();
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1301
1415
|
}
|
|
@@ -429,13 +429,14 @@ export function makeConversationReadTool(host, lang, extras) {
|
|
|
429
429
|
runLines.push(pick(L, `… 还有 ${running.length - shownRunning.length} 条运行中(用 query 或 limit 收窄)。`, `… ${running.length - shownRunning.length} more running (narrow with query or limit).`, "convread.list.running.more", { n: running.length - shownRunning.length }));
|
|
430
430
|
}
|
|
431
431
|
if (history.length > shownHistory.length) {
|
|
432
|
-
|
|
432
|
+
const n = history.length - shownHistory.length;
|
|
433
|
+
histLines.push(pick(L, `… 还有 ${n} 条历史(用 query 或 limit 收窄;默认只给 ${HISTORY_LIST_DEFAULT} 条)。`, `… ${n} more history (narrow with query or limit; default shows ${HISTORY_LIST_DEFAULT}).`, "convread.list.history.more", { n, def: HISTORY_LIST_DEFAULT }));
|
|
433
434
|
}
|
|
434
435
|
const head = kind === "running"
|
|
435
436
|
? pick(L, `运行中对话(${running.length}):`, `Running conversations (${running.length}):`, "convread.list.head.running", { n: running.length })
|
|
436
437
|
: kind === "history"
|
|
437
|
-
? pick(L, `历史会话(${history.length},scope=${scope}):`, `History sessions (${history.length}, scope=${scope}):`, "convread.list.head.history", { n: history.length })
|
|
438
|
-
: pick(L, `运行中对话(${running.length})+ 历史会话(${history.length},scope=${scope}):`, `Running conversations (${running.length}) + history sessions (${history.length}, scope=${scope}):`, "convread.list.head.all", { running: running.length, history: history.length });
|
|
438
|
+
? pick(L, `历史会话(${history.length},scope=${scope}):`, `History sessions (${history.length}, scope=${scope}):`, "convread.list.head.history", { n: history.length, scope })
|
|
439
|
+
: pick(L, `运行中对话(${running.length})+ 历史会话(${history.length},scope=${scope}):`, `Running conversations (${running.length}) + history sessions (${history.length}, scope=${scope}):`, "convread.list.head.all", { running: running.length, history: history.length, scope });
|
|
439
440
|
const runHead = L === "zh" ? "【运行中】" : "[running]";
|
|
440
441
|
const histHead = L === "zh" ? "【历史】" : "[history]";
|
|
441
442
|
const empty = L === "zh" ? "(无)" : "(none)";
|
|
@@ -638,8 +639,15 @@ export function makeConversationReadTool(host, lang, extras) {
|
|
|
638
639
|
? `\n${pick(L, `⚠ 转录显示它在等用户回答问卷(先回它,再干别的)。`, `⚠ The transcript shows it waiting for a question answer (answer first).`, "convread.status.waiting")}`
|
|
639
640
|
: "";
|
|
640
641
|
// 认领只在有的时候占一行(没有就不提,省 token)。
|
|
642
|
+
const linesZh = formatClaimLines(statusClaims, 3, "inline").join("、");
|
|
643
|
+
const linesEn = formatClaimLines(statusClaims, 3, "inline").join("; ");
|
|
641
644
|
const claimLine = statusClaims.length > 0
|
|
642
|
-
? `\n- ${pick(L, `认领:${
|
|
645
|
+
? `\n- ${pick(L, `认领:${linesZh}。`, `Claims: ${linesEn}.`, "convread.status.claims", {
|
|
646
|
+
total: statusClaims.length,
|
|
647
|
+
lines: linesEn,
|
|
648
|
+
linesZh,
|
|
649
|
+
linesEn,
|
|
650
|
+
})}`
|
|
643
651
|
: "";
|
|
644
652
|
return text(`${head}\n- ${toolLine}\n- ${sayLine}\n- ${touchLine}${claimLine}${waitLine}`, {
|
|
645
653
|
...where,
|
|
@@ -179,7 +179,15 @@ export function makeDelegateTaskTool(host, lang) {
|
|
|
179
179
|
`追问请在同一子代理会话里继续(subagent(action="steer")),不要重复派单。拿到结果后必须验证再汇报。`, `Delegated: ${convId}\nTemplate: ${input.agent} · Title: ${title}${modelLineEn}` +
|
|
180
180
|
`\nThe subagent is in the left running list. Use subagent(action="wait_all") to wait for all at once (no polling), ` +
|
|
181
181
|
`subagent(action="get_result") for a single result; continue follow-ups in the SAME subagent session (subagent(action="steer")), ` +
|
|
182
|
-
`do not delegate again. Verify the result before reporting.`, "delegate.started", {
|
|
182
|
+
`do not delegate again. Verify the result before reporting.`, "delegate.started", {
|
|
183
|
+
convId: convId,
|
|
184
|
+
agent: input.agent,
|
|
185
|
+
title: title,
|
|
186
|
+
"input.model": input.model,
|
|
187
|
+
modelLine: modelLineEn,
|
|
188
|
+
modelLineZh,
|
|
189
|
+
modelLineEn,
|
|
190
|
+
}), { convId, agent: input.agent, template: input.agent, model: input.model });
|
|
183
191
|
},
|
|
184
192
|
});
|
|
185
193
|
}
|
|
@@ -182,6 +182,18 @@ export function handlePresetAndDshMessage(msg, cs) {
|
|
|
182
182
|
case "dsh_patches_rescan":
|
|
183
183
|
void cs.rescanDshPatches?.();
|
|
184
184
|
return true;
|
|
185
|
+
case "dsh_patch_install":
|
|
186
|
+
void cs.installDshPatch?.(msg.spec, msg.id);
|
|
187
|
+
return true;
|
|
188
|
+
case "dsh_patch_toggle":
|
|
189
|
+
void cs.toggleDshPatch?.(msg.name, msg.enabled);
|
|
190
|
+
return true;
|
|
191
|
+
case "dsh_patch_delete":
|
|
192
|
+
void cs.deleteDshPatch?.(msg.name);
|
|
193
|
+
return true;
|
|
194
|
+
case "dsh_market_fetch":
|
|
195
|
+
void cs.fetchDshMarket?.(msg.force);
|
|
196
|
+
return true;
|
|
185
197
|
case "save_preset":
|
|
186
198
|
void cs.savePreset(msg.name);
|
|
187
199
|
return true;
|
|
@@ -583,6 +595,8 @@ export function handleSettingsMessage(msg, cs) {
|
|
|
583
595
|
toolImagesEnabled: msg.toolImagesEnabled,
|
|
584
596
|
keepRecentMessages: msg.keepRecentMessages,
|
|
585
597
|
showForkedParentSessions: msg.showForkedParentSessions,
|
|
598
|
+
retainFinishedConversations: msg.retainFinishedConversations,
|
|
599
|
+
openRecentSessionOnProjectSwitch: msg.openRecentSessionOnProjectSwitch,
|
|
586
600
|
devNoCache: msg.devNoCache,
|
|
587
601
|
autoReload: msg.autoReload,
|
|
588
602
|
skillsFullText: msg.skillsFullText,
|
|
@@ -600,6 +614,7 @@ export function handleSettingsMessage(msg, cs) {
|
|
|
600
614
|
disabledMarkers: msg.disabledMarkers,
|
|
601
615
|
quickPhrases: msg.quickPhrases,
|
|
602
616
|
quickPhrasesEnabled: msg.quickPhrasesEnabled,
|
|
617
|
+
minimalNewChat: msg.minimalNewChat,
|
|
603
618
|
quickPhrasesSeeded: msg.quickPhrasesSeeded,
|
|
604
619
|
uiLayout: msg.uiLayout,
|
|
605
620
|
});
|