fluxy-bot 0.5.13 → 0.5.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/dist-fluxy/fluxy.html +14 -1
- package/package.json +1 -1
- package/supervisor/chat/fluxy.html +14 -1
- package/supervisor/index.ts +8 -0
- package/workspace/client/index.html +14 -1
package/dist-fluxy/fluxy.html
CHANGED
|
@@ -10,6 +10,19 @@
|
|
|
10
10
|
</head>
|
|
11
11
|
<body class="bg-background text-foreground">
|
|
12
12
|
<div id="root"></div>
|
|
13
|
-
<script>
|
|
13
|
+
<script>
|
|
14
|
+
if('serviceWorker' in navigator){
|
|
15
|
+
navigator.serviceWorker.register('/sw.js',{scope:'/'}).then(function(r){
|
|
16
|
+
r.update();
|
|
17
|
+
if(r.waiting){r.waiting.postMessage({type:'SKIP_WAITING'})}
|
|
18
|
+
r.addEventListener('updatefound',function(){
|
|
19
|
+
var w=r.installing;
|
|
20
|
+
if(w)w.addEventListener('statechange',function(){
|
|
21
|
+
if(w.state==='installed'&&navigator.serviceWorker.controller)w.postMessage({type:'SKIP_WAITING'});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
14
27
|
</body>
|
|
15
28
|
</html>
|
package/package.json
CHANGED
|
@@ -8,6 +8,19 @@
|
|
|
8
8
|
<body class="bg-background text-foreground">
|
|
9
9
|
<div id="root"></div>
|
|
10
10
|
<script type="module" src="/fluxy-main.tsx"></script>
|
|
11
|
-
<script>
|
|
11
|
+
<script>
|
|
12
|
+
if('serviceWorker' in navigator){
|
|
13
|
+
navigator.serviceWorker.register('/sw.js',{scope:'/'}).then(function(r){
|
|
14
|
+
r.update();
|
|
15
|
+
if(r.waiting){r.waiting.postMessage({type:'SKIP_WAITING'})}
|
|
16
|
+
r.addEventListener('updatefound',function(){
|
|
17
|
+
var w=r.installing;
|
|
18
|
+
if(w)w.addEventListener('statechange',function(){
|
|
19
|
+
if(w.state==='installed'&&navigator.serviceWorker.controller)w.postMessage({type:'SKIP_WAITING'});
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
12
25
|
</body>
|
|
13
26
|
</html>
|
package/supervisor/index.ts
CHANGED
|
@@ -170,6 +170,14 @@ export async function startSupervisor() {
|
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
// Service worker — served directly with no-cache to ensure push handler updates
|
|
174
|
+
if (req.url === '/sw.js') {
|
|
175
|
+
const swPath = path.join(PKG_DIR, 'workspace', 'client', 'public', 'sw.js');
|
|
176
|
+
res.writeHead(200, { 'Content-Type': 'application/javascript', 'Cache-Control': 'no-cache' });
|
|
177
|
+
res.end(fs.readFileSync(swPath));
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
173
181
|
// App API routes → proxy to user's backend server
|
|
174
182
|
if (req.url?.startsWith('/app/api')) {
|
|
175
183
|
const backendPath = req.url.replace(/^\/app\/api/, '') || '/';
|
|
@@ -30,7 +30,20 @@
|
|
|
30
30
|
});
|
|
31
31
|
</script>
|
|
32
32
|
<script type="module" src="/src/main.tsx"></script>
|
|
33
|
-
<script>
|
|
33
|
+
<script>
|
|
34
|
+
if('serviceWorker' in navigator){
|
|
35
|
+
navigator.serviceWorker.register('/sw.js').then(function(r){
|
|
36
|
+
r.update();
|
|
37
|
+
if(r.waiting){r.waiting.postMessage({type:'SKIP_WAITING'})}
|
|
38
|
+
r.addEventListener('updatefound',function(){
|
|
39
|
+
var w=r.installing;
|
|
40
|
+
if(w)w.addEventListener('statechange',function(){
|
|
41
|
+
if(w.state==='installed'&&navigator.serviceWorker.controller)w.postMessage({type:'SKIP_WAITING'});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
34
47
|
<script src="/fluxy/widget.js"></script>
|
|
35
48
|
</body>
|
|
36
49
|
</html>
|