@wendongfly/myhi 1.0.109 → 1.0.111

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; }
@@ -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': '输入压缩提示(可选)', '/rename': '输入新名称(可选)' };
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/index.html CHANGED
@@ -407,10 +407,6 @@
407
407
  min-width: 3rem; text-align: center;
408
408
  }
409
409
  .drive-btn:active, .drive-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(124,58,237,0.12); }
410
- #update-banner { display: none; margin: 0.5rem 0.75rem; padding: 0.6rem 0.75rem; background: rgba(210,153,34,0.12); border: 1px solid rgba(210,153,34,0.3); border-radius: 8px; font-size: 0.8rem; color: var(--yellow); align-items: center; gap: 0.5rem; }
411
- #update-banner.show { display: flex; }
412
- #update-banner .update-text { flex: 1; }
413
- #update-banner .update-ver { font-weight: 600; }
414
410
  #update-btn { background: var(--yellow); color: #000; border: none; border-radius: 6px; padding: 0.35rem 0.75rem; font-size: 0.75rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
415
411
  #update-btn:active { opacity: 0.7; }
416
412
  #update-btn:disabled { opacity: 0.5; cursor: not-allowed; }
@@ -421,7 +417,6 @@
421
417
  <div id="header">
422
418
  <div class="logo">my<span>hi</span></div>
423
419
  <div style="display:flex;align-items:center;gap:0.6rem">
424
- <span id="current-version" style="font-size:0.7rem;color:var(--border)"></span>
425
420
  <span id="user-name" style="font-size:0.8rem;color:var(--muted)"></span>
426
421
  <button id="usage-btn" onclick="showUsage()" style="background:none;border:1px solid var(--border);color:var(--muted);font-size:0.75rem;padding:0.3rem 0.6rem;border-radius:6px;cursor:pointer;width:auto">用量</button>
427
422
  <button id="logout-btn" onclick="doLogout()" style="display:none;background:none;border:1px solid var(--border);color:var(--muted);font-size:0.75rem;padding:0.3rem 0.6rem;border-radius:6px;cursor:pointer;width:auto">退出</button>
@@ -966,17 +961,6 @@
966
961
  }
967
962
 
968
963
  // ── 版本更新 ──────────────────────────────────────────────
969
- async function checkUpdate() {
970
- try {
971
- const resp = await fetch('/api/version');
972
- if (!resp.ok) return;
973
- const data = await resp.json();
974
- const verEl = document.getElementById('current-version');
975
- if (verEl) verEl.textContent = 'v' + data.current;
976
- } catch {}
977
- }
978
- checkUpdate();
979
- setInterval(checkUpdate, 10 * 60 * 1000);
980
964
  </script>
981
965
  </body>
982
966
  </html>
package/dist/package.json CHANGED
@@ -1 +1 @@
1
- {"type":"module","version":"1.0.109"}
1
+ {"type":"module","version":"1.0.111"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wendongfly/myhi",
3
- "version": "1.0.109",
3
+ "version": "1.0.111",
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",