@wendongfly/myhi 1.3.223 → 1.3.224

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/minutes.html CHANGED
@@ -44,13 +44,14 @@
44
44
  body.embed #hd { display: none; }
45
45
  body.embed #wrap { max-width: none; height: 100vh; padding: 0; gap: 0; grid-template-columns: 360px 1fr; }
46
46
  body.embed #lcol { height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); min-width: 0; }
47
- body.embed #lscroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0.75rem 0.75rem 1.2rem; }
47
+ body.embed #emb-nav { flex-shrink: 0; padding: 0.75rem 0.75rem 0; }
48
+ body.embed #lscroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 0.75rem 1.2rem; scrollbar-width: thin; }
48
49
  body.embed #emb-foot { display: flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.6rem 0.6rem 0.9rem; }
49
50
  #emb-user { flex: 1; min-width: 0; font-size: 0.8rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
50
51
  #emb-set { background: none; border: none; color: var(--text2); font-size: 1.05rem; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; }
51
52
  #emb-set:hover { background: var(--bg); color: var(--text); }
52
53
  body.embed #wrap > div:first-child .card { background: var(--bg); padding: 0.8rem; }
53
- body.embed #result { height: 100vh; overflow-y: auto; border: none; border-radius: 0; background: var(--bg); padding: 1rem 1.4rem; }
54
+ body.embed #result { height: 100vh; overflow-y: auto; scrollbar-width: thin; border: none; border-radius: 0; background: var(--bg); padding: 1rem 1.4rem; }
54
55
  #emb-nav .top { display: flex; align-items: center; margin: 0.05rem 0.2rem 0.6rem; }
55
56
  #emb-nav .logo { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
56
57
  #emb-nav .logo span { color: var(--accent); }
@@ -126,11 +127,10 @@
126
127
  <script>if (new URLSearchParams(location.search).get('embed')) document.body.classList.add('embed');</script>
127
128
  <div id="hd"><a class="back" href="/">‹ myhi</a><h1 data-ico>🎤 语音 <span style="font-weight:400;color:var(--muted);font-size:0.85rem">· 会议纪要</span></h1></div>
128
129
  <div id="wrap">
129
- <div id="lcol"><div id="lscroll">
130
- <div id="emb-nav" class="emb-only">
130
+ <div id="lcol"><div id="emb-nav" class="emb-only">
131
131
  <div class="top"><a class="logo" onclick="navTo('tasks')" style="cursor:pointer">my<span>hi</span></a></div>
132
132
  <div class="nav3"><button data-ico onclick="navTo('tasks')">💬 任务</button><button data-ico onclick="navTo('studio')">🖼 出图</button><button data-ico class="on">🎤 语音</button></div>
133
- </div>
133
+ </div><div id="lscroll">
134
134
  <div class="card">
135
135
  <label class="lbl">会议录音</label>
136
136
  <div class="file" id="drop" onclick="$('file').click()"><b>点这里选录音文件</b>,或拖进来<br><small>mp3、m4a、wav、aac、amr、webm、mp4 等,最大 1GB</small></div>
Binary file
package/dist/studio.html CHANGED
@@ -47,13 +47,14 @@
47
47
  body.embed #hd { display: none; }
48
48
  body.embed #wrap { max-width: none; height: 100vh; padding: 0; gap: 0; grid-template-columns: 360px 1fr; }
49
49
  body.embed #lcol { height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); min-width: 0; }
50
- body.embed #lscroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0.75rem 0.75rem 1.2rem; }
50
+ body.embed #emb-nav { flex-shrink: 0; padding: 0.75rem 0.75rem 0; }
51
+ body.embed #lscroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 0.75rem 1.2rem; scrollbar-width: thin; }
51
52
  body.embed #emb-foot { display: flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.6rem 0.6rem 0.9rem; }
52
53
  #emb-user { flex: 1; min-width: 0; font-size: 0.8rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
53
54
  #emb-set { background: none; border: none; color: var(--text2); font-size: 1.05rem; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; }
54
55
  #emb-set:hover { background: var(--bg); color: var(--text); }
55
56
  body.embed #wrap > div:first-child .card { background: var(--bg); padding: 0.8rem; }
56
- body.embed #result { height: 100vh; overflow-y: auto; border: none; border-radius: 0; background: var(--bg); padding: 1rem 1.4rem; }
57
+ body.embed #result { height: 100vh; overflow-y: auto; scrollbar-width: thin; border: none; border-radius: 0; background: var(--bg); padding: 1rem 1.4rem; }
57
58
  #emb-nav .top { display: flex; align-items: center; margin: 0.05rem 0.2rem 0.6rem; }
58
59
  #emb-nav .logo { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
59
60
  #emb-nav .logo span { color: var(--accent); }
@@ -143,11 +144,10 @@
143
144
  <span class="quota" id="quota"></span>
144
145
  </div>
145
146
  <div id="wrap">
146
- <div id="lcol"><div id="lscroll">
147
- <div id="emb-nav" class="emb-only">
147
+ <div id="lcol"><div id="emb-nav" class="emb-only">
148
148
  <div class="top"><a class="logo" onclick="navTo('tasks')" style="cursor:pointer">my<span>hi</span></a></div>
149
149
  <div class="nav3"><button data-ico onclick="navTo('tasks')">💬 任务</button><button data-ico class="on">🖼 出图</button><button data-ico onclick="navTo('voice')">🎤 语音</button></div>
150
- </div>
150
+ </div><div id="lscroll">
151
151
  <div class="card" id="form">
152
152
  <label class="lbl" for="need">要一张什么样的图</label>
153
153
  <textarea id="need" rows="4" placeholder="例如:双十一促销海报,红色喜庆背景,中间是一台笔记本电脑,突出「全场 5 折」"></textarea>
@@ -186,6 +186,10 @@
186
186
  </div>
187
187
  <div id="zoom" onclick="this.classList.remove('on')"><img alt=""></div>
188
188
  <script>
189
+ // 内联事件属性 onclick="f('${jsq(x)}')" 专用:先按 JS 单引号字符串转义,再按 HTML 属性转义。
190
+ // 只做 HTML 转义不够 —— 浏览器先把 &#39; 解码回 ' 再交给 JS,文件名 / 技能名里带 ' 就能跳出字符串执行代码
191
+ function jsq(s) { return String(s ?? '').replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/\r?\n/g, '\\n').replace(/[\u2028\u2029]/g, '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); }
192
+
189
193
  const $ = (id) => document.getElementById(id);
190
194
  // 嵌在首页工作台时:左栏导航 / ⚙ 交给首页切换(同源 postMessage);单独打开时就是普通链接
191
195
  // 底部 ⚙:让首页在这个按钮上方弹出和任务栏同一个「设置与更多」菜单;在本页点别处 / Esc 就收起
@@ -338,9 +342,9 @@
338
342
  : s.status === 'needs_review' ? '<span class="badge b-review">需人工确认</span>' : `<span class="badge b-fail">${job.status === 'cancelled' ? '已取消' : '失败'}</span>`;
339
343
  const files = s.attempts.filter((a) => a.file);
340
344
  return `<div class="slot"><div class="pic">${shown ? `<img src="${imgUrl(job, shown)}" alt="" onclick="zoom(this.src)">` : `<div class="wait">${running ? esc(STATUS[s.status] || '') + '<br><small>出一张图通常要 20~75 秒</small>' : '没有出图'}</div>`}${badge}</div>
341
- <div class="body">${files.length > 1 ? `<div class="thumbs">${files.map((a) => `<img src="${imgUrl(job, a.file)}" class="${a.file === shown ? 'on' : ''}" title="第 ${a.n} 次" onclick="viewAtt('${esc(job.id)}',${s.index},'${esc(a.file)}')">`).join('')}</div>` : ''}
345
+ <div class="body">${files.length > 1 ? `<div class="thumbs">${files.map((a) => `<img src="${imgUrl(job, a.file)}" class="${a.file === shown ? 'on' : ''}" title="第 ${a.n} 次" onclick="viewAtt('${jsq(job.id)}',${s.index},'${jsq(a.file)}')">`).join('')}</div>` : ''}
342
346
  ${s.attempts.map((a) => attHtml(a, job)).join('')}</div>
343
- ${shown ? `<div class="acts"><a class="btn" href="${imgUrl(job, shown, 1)}" download>下载</a>${CFG?.projects?.length ? `<button class="btn" onclick="saveOne('${esc(shown)}')">保存到项目</button>` : ''}<button class="btn" onclick="useAsRef('${esc(shown)}')" title="用这张当参考图,改需求再出">当参考图</button></div>` : ''}</div>`;
347
+ ${shown ? `<div class="acts"><a class="btn" href="${imgUrl(job, shown, 1)}" download>下载</a>${CFG?.projects?.length ? `<button class="btn" onclick="saveOne('${jsq(shown)}')">保存到项目</button>` : ''}<button class="btn" onclick="useAsRef('${jsq(shown)}')" title="用这张当参考图,改需求再出">当参考图</button></div>` : ''}</div>`;
344
348
  }
345
349
  function showJob(job) {
346
350
  CUR = job;
Binary file
@@ -460,9 +460,7 @@
460
460
 
461
461
  socket.on('disconnect', () => {
462
462
  // 显示断连提示
463
- term.write('
464
- [myhi] 连接已断开,正在重连...
465
- ');
463
+ term.write('\r\n\x1b[33m[myhi] 连接已断开,正在重连...\x1b[0m\r\n');
466
464
  });
467
465
 
468
466
  // 终端输入
@@ -601,6 +599,9 @@
601
599
  d.textContent = s;
602
600
  return d.innerHTML;
603
601
  }
602
+ // 内联事件属性 onclick="f('${jsq(x)}')" 专用:先按 JS 单引号字符串转义,再按 HTML 属性转义。
603
+ // 只做 HTML 转义不够 —— 浏览器先把 &#39; 解码回 ' 再交给 JS,文件名 / 技能名里带 ' 就能跳出字符串执行代码
604
+ function jsq(s) { return String(s ?? '').replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/\r?\n/g, '\\n').replace(/[\u2028\u2029]/g, '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); }
604
605
 
605
606
  // 窗口 resize 时 fit 当前 tab
606
607
  window.addEventListener('resize', () => {
@@ -759,12 +760,12 @@
759
760
  }
760
761
  let html = '';
761
762
  if (data.parent != null) {
762
- html += `<div class="fp-item" onclick="fpNav('${esc(data.parent)}')"><span class="fp-icon">📁</span><span class="fp-name">..</span></div>`;
763
+ html += `<div class="fp-item" onclick="fpNav('${jsq(data.parent)}')"><span class="fp-icon">📁</span><span class="fp-name">..</span></div>`;
763
764
  }
764
765
  for (const e of data.entries) {
765
766
  const rel = fpCurrentPath ? fpCurrentPath + '/' + e.name : e.name;
766
767
  if (e.isDir) {
767
- html += `<div class="fp-item" onclick="fpNav('${esc(rel)}')"><span class="fp-icon">📁</span><span class="fp-name">${esc(e.name)}</span></div>`;
768
+ html += `<div class="fp-item" onclick="fpNav('${jsq(rel)}')"><span class="fp-icon">📁</span><span class="fp-name">${esc(e.name)}</span></div>`;
768
769
  } else {
769
770
  html += `<div class="fp-item">
770
771
  <span class="fp-icon">📄</span>
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wendongfly/myhi",
3
- "version": "1.3.223",
3
+ "version": "1.3.224",
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",