@wendongfly/myhi 1.3.219 → 1.3.220

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,5 @@
1
+ {
2
+ "version": "1.3.220",
3
+ "commit": "0b70266",
4
+ "builtAt": "2026-11-15T12:58:40.667Z"
5
+ }
package/dist/index.html CHANGED
@@ -233,7 +233,12 @@
233
233
  body.ws .hd-actions > :not(#conn-dot) { display: none !important; }
234
234
  body.ws #ws-collapse { display: block; }
235
235
  body.ws #view-controls { position: static; background: var(--surface); padding-top: 0 !important; }
236
- body.ws #view-controls > div:first-child { flex-direction: column-reverse; align-items: stretch; }
236
+ body.ws #view-controls > #search-row { flex-direction: column-reverse; align-items: stretch; }
237
+ #main-nav { display: flex; gap: 3px; padding: 3px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
238
+ #main-nav button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.15rem; background: none; border: none; border-radius: 7px; color: var(--text2); font-size: 0.8rem; padding: 0.42rem 0.2rem; cursor: pointer; white-space: nowrap; }
239
+ #main-nav button:hover { color: var(--text); }
240
+ #main-nav button.on { background: var(--accent); color: #fff; font-weight: 600; }
241
+ body.ws #main-nav { background: var(--surface); }
237
242
  body.ws #new-btn { display: block !important; width: 100%; padding: 0.55rem; }
238
243
  body.ws #search-count { display: none; }
239
244
  body.ws #sess-search { flex: none; width: 100%; }
@@ -284,6 +289,7 @@
284
289
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
285
290
  #ws-rail .rb:hover { background: var(--bg); color: var(--text); }
286
291
  #ws-rail .rb.new { background: var(--accent); color: #fff; font-size: 1.3rem; }
292
+ #ws-rail .rb.on { background: var(--bg); color: var(--accent); }
287
293
  #ws-rail .rb.has-dot::after { content: ''; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
288
294
  #ws-rail .rail-sep { width: 28px; border-top: 1px solid var(--border); margin: 0.2rem 0; flex-shrink: 0; }
289
295
  #ws-rail .rail-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.1rem 0; }
@@ -798,8 +804,14 @@
798
804
  <div id="ai-banner" class="ai-banner" style="display:none"></div>
799
805
 
800
806
  <div id="view-controls" style="display:flex;flex-direction:column;gap:0.5rem;padding:0.75rem 0.75rem 0">
807
+ <!-- 一级导航:任务(AI 对话任务)/ 出图 / 语音处理。电脑在右侧打开,手机进对应页面 -->
808
+ <div id="main-nav">
809
+ <button data-nav="tasks" class="on" onclick="mainNav('tasks')">💬 任务</button>
810
+ <button data-nav="studio" onclick="mainNav('studio')">🖼 出图</button>
811
+ <button data-nav="voice" onclick="mainNav('voice')">🎤 语音处理</button>
812
+ </div>
801
813
  <!-- 会话搜索:任务多了光看标题认不出,连首条消息/目录/标签一起搜 -->
802
- <div style="display:flex;align-items:center;gap:0.4rem">
814
+ <div id="search-row" style="display:flex;align-items:center;gap:0.4rem">
803
815
  <input id="sess-search" type="search" placeholder="搜任务:标题 / 首条需求 / 目录 / 标签"
804
816
  autocomplete="off" spellcheck="false"
805
817
  style="flex:1;background:var(--bg,var(--bg));border:1px solid var(--border,var(--border));border-radius:8px;color:var(--text,var(--text));font-size:0.8rem;padding:0.4rem 0.7rem;outline:none">
@@ -842,6 +854,8 @@
842
854
  <div id="ws-rail">
843
855
  <button class="rb" onclick="wsSetCollapsed(false)" data-tip="展开任务栏">☰</button>
844
856
  <button class="rb new" onclick="openSheet()" data-tip="新建任务">+</button>
857
+ <button class="rb" data-nav="studio" onclick="mainNav('studio')" data-tip="出图">🖼</button>
858
+ <button class="rb" data-nav="voice" onclick="mainNav('voice')" data-tip="语音处理">🎤</button>
845
859
  <div class="rail-sep"></div>
846
860
  <div class="rail-list" id="rail-list"></div>
847
861
  <div class="rail-sep"></div>
@@ -1474,7 +1488,8 @@
1474
1488
  _homeVer = await r.json();
1475
1489
  const sub = document.getElementById('set-ver-sub'), btn = document.getElementById('set-up-btn');
1476
1490
  if (!sub) return;
1477
- sub.textContent = `当前 v${_homeVer.current}` + (_homeVer.updateAvailable ? ` · 有新版 v${_homeVer.latest}` : ' · 已是最新');
1491
+ sub.textContent = `当前 v${_homeVer.current}${_homeVer.build?.commit ? '(' + _homeVer.build.commit + ')' : ''}` + (_homeVer.updateAvailable ? ` · 有新版 v${_homeVer.latest}` : ' · 已是最新');
1492
+ if (_homeVer.build?.stale) { sub.textContent += `。⚠ 程序文件其实是 v${_homeVer.build.version} 的(发布时没重新构建),新功能不会生效,请发布方重新构建后发布`; sub.style.color = 'var(--red)'; }
1478
1493
  btn.style.display = _homeVer.updateAvailable ? '' : 'none';
1479
1494
  btn.textContent = '升级到 v' + _homeVer.latest;
1480
1495
  document.getElementById('settings-btn').classList.toggle('has-dot', !!_homeVer.updateAvailable);
@@ -1541,6 +1556,8 @@
1541
1556
  ask: '「问一问」和解释,建议选便宜快速的;留空 = sonnet',
1542
1557
  voice: '语音转成书面文字,建议选便宜的;留空 = 同问一问',
1543
1558
  vision: '配了就用:聊天框发的图片先用它转成文字再交给主模型(多花几秒,聊天里可点开核对);主模型看不了图时一定要配,如本地的 m1-vision。留空 = 图片直接发给主模型。提示用户:截图标注尽量配文字,红框 / 箭头的指向看图模型常认错',
1559
+ minutes: '整理会议纪要用的模型(逐字稿长,选上下文大、中文好的);留空 = 跟主任务一样',
1560
+ image: '「出图」页默认用的出图模型(如 glm-image、cogview-4、image-01);留空 = 网关上的第一个出图模型',
1544
1561
  visionPro: '可选:重要截图(复杂标注的 bug 单、设计稿评审)发送时点「🔍 高精度」改用它,如网关上的 Claude 等云端多模态模型;留空 = 不显示这个开关',
1545
1562
  };
1546
1563
  // ── 大模型网关 ────────────────────────────────────────────
@@ -1664,9 +1681,11 @@
1664
1681
  tools: ms.filter(m => !m.fit?.main).map(item),
1665
1682
  all: cheapFirst.map(item),
1666
1683
  vision: cheapFirst.filter(m => (m.caps || []).includes('vision')).map(item),
1684
+ // 出图模型:网关标了 image_generation,或名字像出图模型(旧网关没标能力时)
1685
+ image: ms.filter(m => (m.caps || []).includes('image_generation') || m.image || (/(^|[-_/.])(image|cogview|seedream|wanx|flux|jimeng)/i.test(m.id) && !/vision|[-_]vl\b|ocr/i.test(m.id))).map(item),
1667
1686
  };
1668
1687
  const TOOL_SCENES = { main: 1, plan: 1, subagent: 1, vision: 1, visionPro: 1 };
1669
- const DL = (k) => k === 'vision' || k === 'visionPro' ? 'vision' : TOOL_SCENES[k] ? 'tools' : 'all';
1688
+ const DL = (k) => k === 'image' ? 'image' : k === 'vision' || k === 'visionPro' ? 'vision' : TOOL_SCENES[k] ? 'tools' : 'all';
1670
1689
  document.getElementById('set-models-rows').innerHTML = Object.entries(d.sceneLabels || {}).map(([k, label]) =>
1671
1690
  `<div class="set-item inp"><div class="set-lbl">${esc(label)}<small>${esc(SCENE_HINT[k] || '')}</small></div>
1672
1691
  <div class="set-ctl"><div class="mp-wrap"><input class="set-inp" data-scene="${esc(k)}" data-mp="${DL(k)}" value="${esc(d.scenes?.[k] || '')}" placeholder="默认" autocomplete="off" spellcheck="false"><button type="button" class="mp-caret" tabindex="-1" data-mp-caret aria-label="选择模型">▾</button></div></div>
@@ -2372,7 +2391,46 @@
2372
2391
  const WS_MQ = matchMedia('(min-width: 1024px)');
2373
2392
  const WS_KEEP = 5;
2374
2393
  function wsOn() { return document.body.classList.contains('ws'); }
2394
+ // ── 一级导航:出图 / 语音处理 在工作台右侧打开(和任务一样留在后台,来回切不重载);手机直接进页面 ──
2395
+ const TOOL_URL = { studio: '/studio', voice: '/minutes' };
2396
+ const TOOL_TITLE = { studio: '出图', voice: '语音处理' };
2397
+ const _toolFrames = new Map();
2398
+ let _tool = null, _lastTask = null;
2399
+ let _toolPending = new URLSearchParams(location.search).get('tool'); // 刷新后回到上次的工具页
2400
+ function setNavActive(k) {
2401
+ document.querySelectorAll('#main-nav [data-nav]').forEach(b => b.classList.toggle('on', b.dataset.nav === k));
2402
+ document.querySelectorAll('#ws-rail [data-nav]').forEach(b => b.classList.toggle('on', b.dataset.nav === k));
2403
+ }
2404
+ function hideTools() { for (const f of _toolFrames.values()) f.style.display = 'none'; _tool = null; setNavActive('tasks'); }
2405
+ window.mainNav = function(k) {
2406
+ if (k === 'tasks') {
2407
+ if (!_tool) return;
2408
+ const back = _lastTask && _allSessions.some(x => x.id === _lastTask) ? _lastTask : null;
2409
+ hideTools();
2410
+ return back ? wsOpen(back) : wsShowWelcome();
2411
+ }
2412
+ if (!TOOL_URL[k]) return;
2413
+ if (!wsOn()) { location.href = TOOL_URL[k]; return; }
2414
+ if (_wsCur) _lastTask = _wsCur;
2415
+ let f = _toolFrames.get(k);
2416
+ if (!f) {
2417
+ f = document.createElement('iframe');
2418
+ f.src = TOOL_URL[k] + '?embed=ws';
2419
+ f.setAttribute('allow', 'microphone; clipboard-read; clipboard-write');
2420
+ document.getElementById('ws-main').appendChild(f);
2421
+ _toolFrames.set(k, f);
2422
+ }
2423
+ for (const fr of _wsFrames.values()) fr.style.display = 'none';
2424
+ for (const [n, fr] of _toolFrames) fr.style.display = n === k ? '' : 'none';
2425
+ document.getElementById('ws-welcome').style.display = 'none';
2426
+ _wsCur = null; _tool = k;
2427
+ history.replaceState(null, '', '/?tool=' + k);
2428
+ document.title = TOOL_TITLE[k] + ' — myhi';
2429
+ setNavActive(k);
2430
+ wsMarkActive();
2431
+ };
2375
2432
  function wsOpen(id) {
2433
+ if (_tool) hideTools();
2376
2434
  _wsCur = id;
2377
2435
  let f = _wsFrames.get(id);
2378
2436
  if (f) _wsFrames.delete(id);
@@ -2393,6 +2451,7 @@
2393
2451
  setTimeout(() => f.contentWindow?.focus(), 50);
2394
2452
  }
2395
2453
  function wsShowWelcome() {
2454
+ if (_tool) hideTools();
2396
2455
  _wsCur = null;
2397
2456
  for (const fr of _wsFrames.values()) fr.style.display = 'none';
2398
2457
  document.getElementById('ws-welcome').style.display = '';
@@ -2428,6 +2487,7 @@
2428
2487
  // 每次列表重绘后:刷新前打开的任务等列表到了再打开;当前任务被删了就回欢迎页、回收它的会话页
2429
2488
  function wsAfterRender() {
2430
2489
  if (!wsOn()) return;
2490
+ if (_toolPending) { const k = _toolPending; _toolPending = null; mainNav(k); }
2431
2491
  if (_wsPending && _allSessions.some(x => x.id === _wsPending)) { const id = _wsPending; _wsPending = null; wsOpen(id); return; }
2432
2492
  for (const [k, fr] of _wsFrames) if (!_allSessions.some(x => x.id === k)) { fr.remove(); _wsFrames.delete(k); if (k === _wsCur) wsShowWelcome(); }
2433
2493
  renderRail();
@@ -2464,6 +2524,7 @@
2464
2524
  const banner = document.getElementById('ai-banner');
2465
2525
  const target = on ? document.getElementById('ws-welcome') : document.getElementById('view-controls');
2466
2526
  if (on) target.appendChild(banner); else target.parentNode.insertBefore(banner, target);
2527
+ if (!on && _tool) { location.href = TOOL_URL[_tool]; return; } // 窗口拉窄:进工具的独立页面
2467
2528
  if (!on && _wsCur) { location.href = '/terminal/' + encodeURIComponent(_wsCur); return; } // 窗口拉窄:直接进当前任务的会话页
2468
2529
  fitHeader();
2469
2530
  }
Binary file