← Commit history

0.5.55: widget helper quick retries; skill 1.5.4 (own-session launch)

John Lauer ·26489c3931 · ·parent 746de2e
4 files changed +10−6
bin/hydrogen-widget-lib.py+4−1
@@ -60,7 +60,10 @@ function postWidth(){try{const w=document.querySelector('.w');if(!w)return;   c.style.cssText='position:absolute;left:-10000px;top:0;width:max-content;height:100vh;visibility:hidden;pointer-events:none';   document.body.appendChild(c);const total=Math.ceil(c.getBoundingClientRect().width)+2;c.remove();   if(total>0&&window.parent!==window)window.parent.postMessage({hdWidget:{width:total}},'*');}catch(e){}}-async function tick(){try{const r=await fetch('/data.json',{cache:'no-store'});const d=await r.json();window.__last=d;render(d);}catch(e){document.getElementById('w').innerHTML='<span class="err">no data</span>';}}+/* A failed poll (the widget process restarting, the proxy between the page and it) shows the last+   data dimmed and tries again in 5 s, then 15, then 45, then the normal interval: never "no data"+   for three minutes over a blip (AdomLapper 2026-09-14). */+let fails=0;async function tick(){try{const r=await fetch('/data.json',{cache:'no-store'});if(!r.ok)throw new Error('http '+r.status);const d=await r.json();fails=0;window.__last=d;render(d);}catch(e){fails++;if(window.__last){render({error:'no answer from the widget',stale:window.__last});}else{document.getElementById('w').innerHTML='<span class="err">no data</span>';postWidth();}const back=[5000,15000,45000][fails-1];if(back)setTimeout(tick,back);}} /* align_ms: fire on the boundary (a clock ticks once per minute, on the minute) instead of every R ms. */ const A=%(align_ms)d;let tm=null;function arm(){if(tm)return;if(A){const ms=A-(Date.now()%%A)+50;tm=setTimeout(()=>{tm=null;tick();arm();},ms);}else tm=setInterval(tick,R);}function disarm(){if(tm){if(A)clearTimeout(tm);else clearInterval(tm);tm=null;}} document.addEventListener('visibilitychange',()=>{if(document.hidden)disarm();else{tick();arm();}});
package.json+1−1
@@ -4,7 +4,7 @@   "type": "bootstrap",   "title": "Adom Hydrogen (platform base)",   "brief": "Layer Hydrogen's workspace onto a standard Adom workstation.",-  "version": "0.5.54",+  "version": "0.5.55",   "description": "Hydrogen's PLATFORM-GENERIC workspace layer on top of adom/core. Installs adom/core for the full Adom ecosystem, then adds everything common to running inside Hydrogen on ANY platform: the runtime-neutral hydrogen-* skills and the generic editor configuration (Claude Code CLI + extension, VS Code settings, trusted domains). Platform-specific layers depend on THIS: adom/hydrogen-windows-bootstrap (WSL2), adom/hydrogen-mac-bootstrap, adom/hydrogen-ubuntu-bootstrap. The reference design other orgs copy to build their own bootstrap on adom/core.",   "org": "adom",   "tags": [
page.json+2−2
@@ -4,7 +4,7 @@   "type": "bootstrap",   "title": "Adom Hydrogen (platform base)",   "brief": "Layer Hydrogen's workspace onto a standard Adom workstation.",-  "version": "0.5.54",+  "version": "0.5.55",   "description": "Hydrogen's PLATFORM-GENERIC workspace layer on top of adom/core. Installs adom/core for the full Adom ecosystem, then adds everything common to running inside Hydrogen on ANY platform: the runtime-neutral hydrogen-* skills and the generic editor configuration (Claude Code CLI + extension, VS Code settings, trusted domains). Platform-specific layers depend on THIS: adom/hydrogen-windows-bootstrap (WSL2), adom/hydrogen-mac-bootstrap, adom/hydrogen-ubuntu-bootstrap. The reference design other orgs copy to build their own bootstrap on adom/core.",   "org": "adom",   "tags": [@@ -49,4 +49,4 @@     "hydrogen editor configuration",     "where do hydrogen skills come from"   ]-}\ No newline at end of file+}
skills/hydrogen-widget/SKILL.md+3−2
@@ -1,7 +1,7 @@ --- name: hydrogen-widget description: "Build, list, open and drive Hydrogen Widgets: small live panels in Hydrogen Desktop's Title Bar (Claude usage, Codex usage, a clock, or your own), each served by a binary inside the workspace and mounted in a sandboxed slot. Covers the hydrogen-widget.json facet a wiki repo carries (alone, or next to its dock manifest and project workspace), the per-widget page the pulldown links to, the launch contract (HYDROGEN_WIDGET_ID / _PORT / _SLOT / HYDROGEN_PROXY_PORT, the health URL, the explicit takeover, stop-first relaunch), the tall and compact layouts, vendor marks, private repos (read with the user's session), the curated list on adom/hydrogen-bootstrap, the Hydrogen Widgets pulldown, and the control API (GET /widgets, POST /widgets/open|close|navigate|refresh|menu, GET /widgets/status) so an AI can do all of it with no mouse. Trigger words: hydrogen widget, hydrogen-widget, title bar widget, widgets pulldown, widget slot, claude usage widget, codex usage widget, tokens left widget, usage meter in the title bar, hydrogen-widget.json, /widgets/open, make a widget, add a widget to hydrogen, private widget, widget SDK."-version: 1.5.3+version: 1.5.4 ---  # hydrogen-widget: small live panels in Hydrogen Desktop's Title Bar@@ -63,7 +63,8 @@ reason so the user can see it, and `/widgets/close` removes it. The launch log i 3. Any previous instance is stopped first (`launch.stop`, else a `pkill` on the command's first    word), so a new version actually gets the port. The slot's frame is remounted on the    placeholder for the same reason: a stale page never stays put.-4. `launch.command` runs backgrounded as the workspace user, from the repo folder when the widget+4. `launch.command` runs in its own session (`setsid -f nohup ...`, so an editor reload or an+   extension host restart cannot take it down) as the workspace user, from the repo folder when the widget    came from the checkout, with `HYDROGEN_WIDGET_ID`, `HYDROGEN_WIDGET_PORT`,    `HYDROGEN_WIDGET_SLOT` and `HYDROGEN_PROXY_PORT` in its environment plus the workspace env    every login shell has (`ADOM_HD_CONTROL_URL`, `ADOM_HYDROGEN_URL`).