desky-agent 0.3.9 → 0.3.11

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/electron/main.js CHANGED
@@ -17,6 +17,32 @@ const { Daemon, log } = require('../src/daemon');
17
17
  const autostart = require('../src/autostart');
18
18
  const { trayPngs, trayKind } = require('./icons');
19
19
  const ICO = path.join(__dirname, '..', 'assets', 'clawd.ico');
20
+ /** Windows draws a window's taskbar icon from the Start menu shortcut that carries the window's AppUserModelID.
21
+ * An old install left "Electron.lnk" with our ID and no icon, so the taskbar showed Electron: drop shortcuts with
22
+ * our ID that are not ours, and give ours the ID and the head. */
23
+ function winShortcuts() {
24
+ if (process.platform !== 'win32') return;
25
+ try {
26
+ const dir = path.join(process.env.APPDATA || '', 'Microsoft', 'Windows', 'Start Menu', 'Programs');
27
+ const ours = path.join(dir, 'Desky Agent.lnk');
28
+ for (const name of fs.readdirSync(dir)) {
29
+ const f = path.join(dir, name);
30
+ if (!name.toLowerCase().endsWith('.lnk') || f === ours) continue;
31
+ let l;
32
+ try { l = shell.readShortcutLink(f); } catch (e) { continue; }
33
+ if (l.appUserModelId === 'desk.clawd.app') { fs.rmSync(f, { force: true }); log('прибрав старий ярлик ' + name); }
34
+ }
35
+ const want = { target: process.execPath, cwd: path.dirname(process.execPath), icon: ICO, iconIndex: 0,
36
+ appUserModelId: 'desk.clawd.app', description: 'Desky Agent' };
37
+ let have = null;
38
+ try { have = shell.readShortcutLink(ours); } catch (e) {}
39
+ if (!have || have.appUserModelId !== want.appUserModelId || have.icon !== ICO
40
+ || path.resolve(have.target) !== path.resolve(want.target)) {
41
+ shell.writeShortcutLink(ours, have ? 'replace' : 'create', want);
42
+ }
43
+ } catch (e) { log('ярлик у меню «Пуск»: ' + e.message); }
44
+ }
45
+
20
46
  /** The app's own icon for the window and the taskbar (the head, all sizes); the tray keeps its live state icons. */
21
47
  function appIcon() {
22
48
  const img = nativeImage.createFromPath(process.platform === 'win32' ? ICO : path.join(__dirname, '..', 'assets', 'clawd.png'));
@@ -58,6 +84,7 @@ if (!app.requestSingleInstanceLock()) {
58
84
 
59
85
  async function boot() {
60
86
  if (MAC && app.dock) app.dock.hide();
87
+ winShortcuts();
61
88
  if (!quietLaunch(process.argv) || process.argv.includes('--login')) paths.markStopped(false);
62
89
  menu();
63
90
 
Binary file
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawd-desk",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "chip": "esp32s3",
5
5
  "board": "waveshare-esp32-s3-zero",
6
6
  "flash_size": "4MB",
@@ -26,8 +26,8 @@
26
26
  {
27
27
  "file": "firmware.bin",
28
28
  "address": "0x10000",
29
- "size": 339200,
30
- "sha256": "fb4ad11378b8599b03013f1f1582ea3168d40e1722d2d9045116b9cfe1443add"
29
+ "size": 340496,
30
+ "sha256": "857d6f456af745b32e42e5df3bcd892c5e08083b8d8fa80bc49f169110b8a4fc"
31
31
  }
32
32
  ]
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "desky-agent",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "description": "Desky Agent: Desky, a desk robot that acts out what Claude Code or Codex is doing. Tray app, hooks and installer in one npx command",
5
5
  "keywords": [
6
6
  "claude-code",
package/src/board.js CHANGED
@@ -5,13 +5,13 @@
5
5
  const PKG_VERSION = require('../package.json').version;
6
6
  const PROTO = 3; // the command set this package speaks
7
7
 
8
- /** "clawd-desk 3 fw=0.2.0 chip=esp32s3 sn=CD-0007" -> { proto, fw, chip, sn }; null when the line is not Desky's.
8
+ /** "clawd-desk 3 fw=0.2.0 chip=esp32s3 sn=DSK-0007 id=d83bda1a2b3c" -> { proto, fw, chip, sn, id }; null when the line is not Desky's.
9
9
  * Protocol 2 boards say only "clawd-desk 2": fw, chip and sn come back null. Unknown fields are kept, order is free. */
10
10
  function parseWho(line) {
11
11
  const parts = String(line || '').trim().split(/\s+/);
12
12
  if (parts[0] !== 'clawd-desk') return null;
13
13
  const proto = Number.parseInt(parts[1], 10);
14
- const info = { proto: Number.isFinite(proto) ? proto : null, fw: null, chip: null, sn: null };
14
+ const info = { proto: Number.isFinite(proto) ? proto : null, fw: null, chip: null, sn: null, id: null }; // id: firmware 0.3.11+
15
15
  for (const p of parts.slice(2)) {
16
16
  const eq = p.indexOf('=');
17
17
  if (eq > 0) info[p.slice(0, eq)] = p.slice(eq + 1);
package/src/link.js CHANGED
@@ -186,6 +186,8 @@ class Link {
186
186
  parser.on('data', ln => {
187
187
  ln = String(ln).trim();
188
188
  if (ln) {
189
+ const who = parseWho(ln); // a later "who" (after "sn") updates the board's numbers
190
+ if (who && this.port === port) this.info = who;
189
191
  try { this.onLine(ln); } catch (e) { /* the daemon's problem, not the port's */ }
190
192
  }
191
193
  });
package/ui/app.html CHANGED
@@ -441,7 +441,7 @@ svg.alive .eye { transform-box: fill-box; transform-origin: center; animation: b
441
441
  </nav>
442
442
  <button type="button" class="wizlink" id="openWiz"><svg viewBox="0 0 24 24"><path d="M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z"/><path d="M19 16l.7 2 2 .7-2 .7-.7 2-.7-2-2-.7 2-.7z"/></svg>Майстер налаштування</button>
443
443
  <div class="links">
444
- <div class="lk"><span class="dot" id="dC3"></span><span>Плата</span><span id="sC3">…</span></div>
444
+ <button type="button" class="lk btn" id="boardRow" title="плата Desky"><span class="dot" id="dC3"></span><span>Плата</span><span id="sC3">…</span></button>
445
445
  <div class="lk" id="rowServo" hidden><span class="dot" id="dServo"></span><span>Серво</span><span id="health">—</span></div>
446
446
  <button type="button" class="lk btn" id="verRow" title="версія програми Desky Agent" disabled><span class="dot on" id="dVer"></span><span>Версія</span><span id="sVer" class="mono">—</span></button>
447
447
  </div>
@@ -657,7 +657,11 @@ svg.alive .eye { transform-box: fill-box; transform-origin: center; animation: b
657
657
  blue: { name: 'Блакитний', body: '#6FA3D8', eye: '#000000', a: ['#3B7BC2', '#2D66A8', '#FFFFFF'], d: ['#6FA7E0', '#8BBAEA', '#0D1824'] },
658
658
  graphite: { name: 'Графіт', body: '#3D3B39', eye: '#F2EFEA', a: ['#3D3B39', '#2A2826', '#FFFFFF'], d: ['#BDB7AF', '#D3CDC5', '#1A1917'] },
659
659
  };
660
- let COLOR = 'orange', boardColor = null, boardFw = null, colorAsked = false;
660
+ let COLOR = 'orange', boardColor = null, boardFw = null, colorAsked = false, boardText = '';
661
+ $('boardRow').onclick = async () => {
662
+ if (!boardText) return;
663
+ try { await navigator.clipboard.writeText(boardText); toast('Скопійовано: ' + boardText); } catch (e) {}
664
+ };
661
665
  const canColor = () => { const v = String(boardFw || '').split('.').map(Number); return v.length === 3 && (v[0] > 0 || v[1] > 2 || (v[1] === 2 && v[2] >= 4)); };
662
666
  let CFG = null;
663
667
 
@@ -794,7 +798,12 @@ svg.alive .eye { transform-box: fill-box; transform-origin: center; animation: b
794
798
  boardFw = connected && st.board ? st.board.fw : null;
795
799
  if (connected && canColor() && !colorAsked) { colorAsked = true; send('color', true); }
796
800
  $('dC3').className = 'dot ' + (connected ? 'on' : 'bad');
797
- $('sC3').textContent = connected ? st.port : 'немає';
801
+ const bd = connected && st.board ? st.board : {};
802
+ $('sC3').textContent = connected ? (bd.sn || st.port) : 'немає';
803
+ boardText = connected ? ['Desky ' + (bd.sn || 'без серійного номера'), bd.id && 'ID ' + bd.id, bd.fw && 'прошивка ' + bd.fw, st.port]
804
+ .filter(Boolean).join(' · ') : '';
805
+ $('boardRow').title = connected ? boardText + '\nнатисни, щоб скопіювати (для підтримки)' : 'плату не під\'єднано';
806
+ $('boardRow').disabled = !connected;
798
807
  $('nocbox').hidden = connected;
799
808
  $('rowServo').hidden = !connected;
800
809
  beat = connected && st.heartbeat && st.heartbeat_age < 8 ? st.heartbeat : null;