@galda/cli 0.10.14 → 0.10.15
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/app/index.html +19 -15
- package/package.json +1 -1
package/app/index.html
CHANGED
|
@@ -5792,7 +5792,7 @@ function bootDisconnected(info){
|
|
|
5792
5792
|
+ '<p>Galda runs on your own machine. Run this where you use Claude Code or Codex — this board comes alive the moment it connects, no refresh needed:</p>'
|
|
5793
5793
|
+ '<div class="cg-cmd"><code>npx @galda/cli</code><button class="cg-copy">Copy</button></div>'
|
|
5794
5794
|
+ '<p class="cg-who">Signed in as <b></b></p>'
|
|
5795
|
-
+ '<p class="cg-switch">
|
|
5795
|
+
+ '<p class="cg-switch">Already running Galda under a different account? Run <code>npx @galda/cli --signin</code> and pick this one. Or <a href="/logout">switch this browser →</a></p>'
|
|
5796
5796
|
+ '<div class="cg-wait"><i></i>WAITING FOR THIS DEVICE</div></div>';
|
|
5797
5797
|
document.body.appendChild(ov);
|
|
5798
5798
|
ov.querySelector('.cg-who b').textContent = email || 'your account';
|
|
@@ -5814,20 +5814,24 @@ function bootDisconnected(info){
|
|
|
5814
5814
|
const cw = document.getElementById('composerWrap');
|
|
5815
5815
|
if (cw) cw.addEventListener('mousedown', (e) => { if (e.target.closest('#appsel, #modelsel, #effortsel')) return; gate(e); });
|
|
5816
5816
|
|
|
5817
|
-
// Come alive automatically
|
|
5818
|
-
//
|
|
5819
|
-
//
|
|
5820
|
-
//
|
|
5821
|
-
//
|
|
5822
|
-
//
|
|
5823
|
-
//
|
|
5824
|
-
//
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
.
|
|
5830
|
-
|
|
5817
|
+
// Come alive automatically — WITHOUT polling-and-reloading (Masa 2026-07-16).
|
|
5818
|
+
// The relay pushes a 'connected' event over SSE the instant THIS account's agent
|
|
5819
|
+
// is STABLY online (debounced on the relay side), and we reload exactly once on
|
|
5820
|
+
// that edge. Event-driven + debounced makes a reload loop structurally
|
|
5821
|
+
// impossible: a flapping agent never reaches the stable-connect edge, so it
|
|
5822
|
+
// shows "reconnecting" instead of triggering reloads. This replaces the old
|
|
5823
|
+
// `setInterval` + `if (status !== 503) reload` poll, which amplified any agent
|
|
5824
|
+
// flap into an infinite reload (the ~10-failure "無限ループ").
|
|
5825
|
+
const cgWait = ov.querySelector('.cg-wait');
|
|
5826
|
+
try {
|
|
5827
|
+
const es = new EventSource('/presence');
|
|
5828
|
+
es.addEventListener('presence', (e) => {
|
|
5829
|
+
let d; try { d = JSON.parse(e.data); } catch { return; }
|
|
5830
|
+
if (d.state === 'connected') { es.close(); location.reload(); } // one reload, only on a stable connect
|
|
5831
|
+
else if (cgWait) cgWait.innerHTML = '<i></i>WAITING FOR THIS DEVICE';
|
|
5832
|
+
});
|
|
5833
|
+
window.addEventListener('beforeunload', () => { try { es.close(); } catch {} });
|
|
5834
|
+
} catch { /* no EventSource (ancient browser) → stay on the gate; never loops */ }
|
|
5831
5835
|
}
|
|
5832
5836
|
|
|
5833
5837
|
async function boot(){
|
package/package.json
CHANGED