@wendongfly/myhi 1.0.105 → 1.0.107
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/dist/chat.html +4 -30
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/chat.html
CHANGED
|
@@ -1236,17 +1236,6 @@
|
|
|
1236
1236
|
const text = cmdInput.value.trim();
|
|
1237
1237
|
if (!text && !_pendingImage) return;
|
|
1238
1238
|
|
|
1239
|
-
// 命名模式:发送的是新会话名称
|
|
1240
|
-
if (window._renameMode) {
|
|
1241
|
-
const { prev } = window._renameMode;
|
|
1242
|
-
window._renameMode = null;
|
|
1243
|
-
cmdInput.value = '';
|
|
1244
|
-
cmdInput.style.height = 'auto';
|
|
1245
|
-
cmdInput.placeholder = currentSession?.mode === 'agent' ? '输入消息...' : '输入命令...';
|
|
1246
|
-
socket.emit('rename', { sessionId: SESSION_ID, title: text });
|
|
1247
|
-
return;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
1239
|
if (!isController) {
|
|
1251
1240
|
if (canTakeControl()) { socket.emit('take-control', { sessionId: SESSION_ID }); }
|
|
1252
1241
|
else { addStatusMessage('其他用户控制中,无法发送'); return; }
|
|
@@ -1280,19 +1269,9 @@
|
|
|
1280
1269
|
cmdInput.focus();
|
|
1281
1270
|
}
|
|
1282
1271
|
|
|
1283
|
-
function cancelRenameMode() {
|
|
1284
|
-
if (!window._renameMode) return;
|
|
1285
|
-
const { prev } = window._renameMode;
|
|
1286
|
-
window._renameMode = null;
|
|
1287
|
-
cmdInput.value = prev || '';
|
|
1288
|
-
cmdInput.style.height = 'auto';
|
|
1289
|
-
cmdInput.placeholder = currentSession?.mode === 'agent' ? '输入消息...' : '输入命令...';
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
1272
|
cmdInput.addEventListener('keydown', (e) => {
|
|
1293
1273
|
if (e.key === 'Escape') {
|
|
1294
1274
|
e.preventDefault();
|
|
1295
|
-
if (window._renameMode) { cancelRenameMode(); return; }
|
|
1296
1275
|
if (currentSession?.mode === 'agent' && workState !== 'idle') {
|
|
1297
1276
|
socket.emit('agent:interrupt', { sessionId: SESSION_ID });
|
|
1298
1277
|
return;
|
|
@@ -1303,7 +1282,6 @@
|
|
|
1303
1282
|
else if (e.key === 'ArrowUp' && !cmdInput.value) { if (historyIdx < cmdHistory.length - 1) { historyIdx++; cmdInput.value = cmdHistory[historyIdx]; } e.preventDefault(); }
|
|
1304
1283
|
else if (e.key === 'ArrowDown' && !cmdInput.value) { if (historyIdx > 0) { historyIdx--; cmdInput.value = cmdHistory[historyIdx]; } else if (historyIdx === 0) { historyIdx = -1; cmdInput.value = ''; } e.preventDefault(); }
|
|
1305
1284
|
});
|
|
1306
|
-
cmdInput.addEventListener('blur', () => { setTimeout(() => cancelRenameMode(), 200); });
|
|
1307
1285
|
|
|
1308
1286
|
// ── 快捷键 ──────────────────────────────────
|
|
1309
1287
|
const SEQ = { 'ctrl-c': '\x03', 'ctrl-d': '\x04', 'tab': '\t', 'up': '\x1b[A', 'down': '\x1b[B', 'right': '\x1b[C', 'left': '\x1b[D', 'esc': '\x1b', 'ctrl-a': '\x01', 'ctrl-e': '\x05', 'ctrl-k': '\x0b', 'ctrl-u': '\x15', 'ctrl-r': '\x12', 'alt-.': '\x1b.' };
|
|
@@ -1494,14 +1472,10 @@
|
|
|
1494
1472
|
// ── 会话命名 ──────────────────────────────────
|
|
1495
1473
|
window.doRename = function() {
|
|
1496
1474
|
const current = document.getElementById('session-title').textContent;
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
cmdInput.focus();
|
|
1502
|
-
cmdInput.select();
|
|
1503
|
-
// 临时劫持发送行为
|
|
1504
|
-
window._renameMode = { prev };
|
|
1475
|
+
const newName = prompt('输入新名称', current);
|
|
1476
|
+
if (newName && newName.trim() && newName.trim() !== current) {
|
|
1477
|
+
socket.emit('rename', { sessionId: SESSION_ID, title: newName.trim() });
|
|
1478
|
+
}
|
|
1505
1479
|
};
|
|
1506
1480
|
socket.on('session-renamed', ({ sessionId, title }) => {
|
|
1507
1481
|
if (sessionId !== SESSION_ID) return;
|
package/dist/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"1.0.
|
|
1
|
+
{"type":"module","version":"1.0.107"}
|
package/package.json
CHANGED