@wendongfly/myhi 1.0.108 → 1.0.110

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 CHANGED
@@ -193,6 +193,8 @@
193
193
  .action-sheet-item .desc { font-size: 0.72rem; color: #8b949e; }
194
194
  .action-sheet-item .check { color: #3fb950; font-size: 0.9rem; }
195
195
  .action-sheet-cancel { display: block; width: 100%; margin-top: 0.5rem; padding: 0.65rem; background: #21262d; border: none; border-radius: 10px; color: #8b949e; font-size: 0.85rem; cursor: pointer; text-align: center; }
196
+ .slash-inp { width: 100%; padding: 0.65rem 0.8rem; background: #0d1117; border: 1px solid #30363d; border-radius: 10px; color: #e6edf3; font-size: 0.9rem; outline: none; }
197
+ .slash-inp:focus { border-color: #7c3aed; }
196
198
 
197
199
  /* ── QR弹窗 / 状态遮罩 ──────────────── */
198
200
  #qr-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; align-items: center; justify-content: center; }
@@ -287,7 +289,7 @@
287
289
  <button class="sk sk-claude" onclick="doSlashCmd('/compact')">压缩</button>
288
290
  <button class="sk sk-claude" onclick="openResumeSheet()">恢复</button>
289
291
  <button class="sk sk-claude" onclick="doClear()">清除</button>
290
- <button class="sk sk-claude" onclick="doRename()">命名</button>
292
+ <button class="sk sk-claude" onclick="doSlashCmd('/rename')">命名</button>
291
293
  </div>
292
294
  </div>
293
295
 
@@ -332,6 +334,19 @@
332
334
  </div>
333
335
  </div>
334
336
 
337
+ <!-- 斜杠命令面板 -->
338
+ <div id="slash-sheet" class="action-sheet">
339
+ <div class="action-sheet-backdrop" onclick="closeSlashSheet()"></div>
340
+ <div class="action-sheet-box">
341
+ <div class="action-sheet-title" id="slash-title">命令</div>
342
+ <div style="padding:0.3rem 0.2rem">
343
+ <input id="slash-input" class="slash-inp" placeholder="输入参数(可选)" autocomplete="off">
344
+ </div>
345
+ <button class="action-sheet-cancel" style="background:#7c3aed;color:#fff;font-weight:600;margin-bottom:0.4rem" onclick="submitSlashCmd()">发送</button>
346
+ <button class="action-sheet-cancel" onclick="closeSlashSheet()">取消</button>
347
+ </div>
348
+ </div>
349
+
335
350
  <div id="status-overlay">连接中...</div>
336
351
 
337
352
  <script type="module">
@@ -1470,16 +1485,36 @@
1470
1485
  };
1471
1486
 
1472
1487
  // ── 会话命名 ──────────────────────────────────
1488
+ let _slashCmd = null;
1489
+ const _slashTitles = { '/plan': '计划模式', '/compact': '压缩上下文', '/rename': '重命名会话' };
1490
+ const _slashHints = { '/plan': '输入计划描述...', '/compact': '输入压缩提示...', '/rename': '输入新名称...' };
1473
1491
  window.doSlashCmd = function(cmd) {
1474
- const hints = { '/plan': '输入计划描述(可选)', '/compact': '输入压缩提示(可选)' };
1475
- const input = prompt(hints[cmd] || cmd);
1476
- if (input === null) return; // 取消
1477
- const prompt_text = input.trim() ? `${cmd} ${input.trim()}` : cmd;
1492
+ _slashCmd = cmd;
1493
+ document.getElementById('slash-title').textContent = _slashTitles[cmd] || cmd;
1494
+ const inp = document.getElementById('slash-input');
1495
+ inp.placeholder = _slashHints[cmd] || '输入参数(可选)';
1496
+ inp.value = '';
1497
+ document.getElementById('slash-sheet').classList.add('open');
1498
+ setTimeout(() => inp.focus(), 100);
1499
+ };
1500
+ window.closeSlashSheet = function() {
1501
+ document.getElementById('slash-sheet').classList.remove('open');
1502
+ _slashCmd = null;
1503
+ };
1504
+ window.submitSlashCmd = function() {
1505
+ if (!_slashCmd) return;
1506
+ const input = document.getElementById('slash-input').value.trim();
1507
+ const prompt_text = input ? `${_slashCmd} ${input}` : _slashCmd;
1508
+ closeSlashSheet();
1478
1509
  if (!isController && canTakeControl()) socket.emit('take-control', { sessionId: SESSION_ID });
1479
1510
  socket.emit('agent:query', { prompt: prompt_text });
1480
1511
  addInputMessage(prompt_text);
1481
1512
  showThinking();
1482
1513
  };
1514
+ // Enter 键提交
1515
+ document.getElementById('slash-input')?.addEventListener('keydown', (e) => {
1516
+ if (e.key === 'Enter') { e.preventDefault(); submitSlashCmd(); }
1517
+ });
1483
1518
 
1484
1519
  window.doRename = function() {
1485
1520
  const current = document.getElementById('session-title').textContent;
package/dist/package.json CHANGED
@@ -1 +1 @@
1
- {"type":"module","version":"1.0.108"}
1
+ {"type":"module","version":"1.0.110"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wendongfly/myhi",
3
- "version": "1.0.108",
3
+ "version": "1.0.110",
4
4
  "description": "Web-based terminal sharing with chat UI — control your terminal from phone via LAN/Tailscale",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",