Implement Progressive Web App (PWA) installation support (#688)
Co-authored-by: Wabifocus <Wabifocus@Wabifocus-Mac-Studio.local>
Wabifocus committed
Aug 19, 2025 at 23:27 UTC
6454ae5399d228efffda99f5d735e8cbbeaab62b
5 files changed
+67
webui/index.html
+15
@@ -123,6 +123,8 @@
123
<!-- Google Icons -->
124
<link rel="stylesheet" href="vendor/google/google-icons.css" />
125
126
+ <!-- Link the PWA manifest file -->
127
+ <link rel="manifest" href="js/manifest.json">
128
129
<!-- Non-module scripts after Alpine.js -->
130
<script type="text/javascript" src="js/settings.js"></script>
@@ -1600,6 +1602,19 @@
1602
<!-- Drag and Drop Overlay Component -->
1603
<x-component path="chat/attachments/dragDropOverlay.html"></x-component>
1604
1605
+ <!-- Register Service Worker for offline support and caching -->
1606
+ <script>
1607
+ if ('serviceWorker' in navigator) {
1608
+ window.addEventListener('load', () => {
1609
+ navigator.service-worker.register('js/sw.js').then(registration => {
1610
+ console.log('SW registered: ', registration);
1611
+ }).catch(registrationError => {
1612
+ console.log('SW registration failed: ', registrationError);
1613
+ });
1614
+ });
1615
+ }
1616
+ </script>
1617
+
1618
</body>
1619
1620
</html>
webui/js/manifest.json
new
+23
@@ -0,0 +1,23 @@
1
+{
2
+ "name": "Agent Zero",
3
+ "short_name": "Agent Zero",
4
+ "description": "The Resilient Autonomous Orchestrator",
5
+ "start_url": "/",
6
+ "display": "standalone",
7
+ "background_color": "#1a1a1a",
8
+ "theme_color": "#333333",
9
+ "icons": [
10
+ {
11
+ "src": "/public/icon-maskable.svg",
12
+ "sizes": "any",
13
+ "type": "image/svg+xml",
14
+ "purpose": "maskable"
15
+ },
16
+ {
17
+ "src": "/public/icon.svg",
18
+ "sizes": "any",
19
+ "type": "image/svg+xml",
20
+ "purpose": "any"
21
+ }
22
+ ]
23
+}
webui/js/sw.js
webui/public/icon-maskable.svg
new
+16
@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+<svg width="100%" height="100%" viewBox="0 0 960 960" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
4
+ <rect width="960" height="960" style="fill:rgb(1,4,26);"/>
5
+ <g transform="translate(96, 96) scale(0.8)">
6
+ <g transform="matrix(1.13341,0,0,1.13341,-36.9503,-43.0342)">
7
+ <path d="M878.621,178.762C878.621,101.597 815.973,38.95 738.808,38.95L173.394,38.95C96.23,38.95 33.582,101.597 33.582,178.762L33.582,744.176C33.582,821.34 96.23,883.988 173.394,883.988L738.808,883.988C815.973,883.988 878.621,821.34 878.621,744.176L878.621,178.762Z" style="fill:rgb(1,4,26);"/>
8
+ </g>
9
+ <g transform="matrix(1.03321,0,0,1.03321,-15.9385,-15.938)">
10
+ <path d="M717.77,788.27C638.99,652.89 559.87,516.92 479.15,378.22C399.29,516.59 320.58,652.95 241.99,789.12L120,789.12C239.91,581.87 479.49,170.89 479.49,170.89C479.49,170.89 720.12,580.92 840,788.27L717.77,788.27Z" style="fill:white;fill-rule:nonzero;"/>
11
+ </g>
12
+ <g transform="matrix(1.03321,0,0,1.03321,-15.9385,-15.938)">
13
+ <path d="M633.08,788.85L323.54,788.85C344.15,753.01 364.09,718.33 383.88,683.93L574.1,683.93C593.38,718.23 612.57,752.36 633.08,788.85Z" style="fill:white;fill-rule:nonzero;"/>
14
+ </g>
15
+ </g>
16
+</svg>
webui/public/icon.svg
new
+13
@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+<svg width="100%" height="100%" viewBox="0 0 960 960" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
4
+ <g transform="matrix(1.13341,0,0,1.13341,-36.9503,-43.0342)">
5
+ <path d="M878.621,178.762C878.621,101.597 815.973,38.95 738.808,38.95L173.394,38.95C96.23,38.95 33.582,101.597 33.582,178.762L33.582,744.176C33.582,821.34 96.23,883.988 173.394,883.988L738.808,883.988C815.973,883.988 878.621,821.34 878.621,744.176L878.621,178.762Z" style="fill:rgb(1,4,26);"/>
6
+ </g>
7
+ <g transform="matrix(1.03321,0,0,1.03321,-15.9385,-15.938)">
8
+ <path d="M717.77,788.27C638.99,652.89 559.87,516.92 479.15,378.22C399.29,516.59 320.58,652.95 241.99,789.12L120,789.12C239.91,581.87 479.49,170.89 479.49,170.89C479.49,170.89 720.12,580.92 840,788.27L717.77,788.27Z" style="fill:white;fill-rule:nonzero;"/>
9
+ </g>
10
+ <g transform="matrix(1.03321,0,0,1.03321,-15.9385,-15.938)">
11
+ <path d="M633.08,788.85L323.54,788.85C344.15,753.01 364.09,718.33 383.88,683.93L574.1,683.93C593.38,718.23 612.57,752.36 633.08,788.85Z" style="fill:white;fill-rule:nonzero;"/>
12
+ </g>
13
+</svg>