Skip to content

Agent Zero AI framework

Implement Progressive Web App (PWA) installation support (#688)

Wabifocus6454ae5399d2
diff --git a/webui/index.html b/webui/index.html
index 93d9ce8a2..c36cfaba2 100644
--- a/webui/index.html
+++ b/webui/index.html
@@ -123,6 +123,8 @@
<!-- Google Icons -->
<link rel="stylesheet" href="vendor/google/google-icons.css" />
+ <!-- Link the PWA manifest file -->
+ <link rel="manifest" href="js/manifest.json">
<!-- Non-module scripts after Alpine.js -->
<script type="text/javascript" src="js/settings.js"></script>
@@ -1600,6 +1602,19 @@
<!-- Drag and Drop Overlay Component -->
<x-component path="chat/attachments/dragDropOverlay.html"></x-component>
+ <!-- Register Service Worker for offline support and caching -->
+ <script>
+ if ('serviceWorker' in navigator) {
+ window.addEventListener('load', () => {
+ navigator.service-worker.register('js/sw.js').then(registration => {
+ console.log('SW registered: ', registration);
+ }).catch(registrationError => {
+ console.log('SW registration failed: ', registrationError);
+ });
+ });
+ }
+ </script>
+
</body>
</html>
diff --git a/webui/js/manifest.json b/webui/js/manifest.json
new file mode 100644
index 000000000..eddd0f1da
--- /dev/null
+++ b/webui/js/manifest.json
@@ -0,0 +1,23 @@
+{
+ "name": "Agent Zero",
+ "short_name": "Agent Zero",
+ "description": "The Resilient Autonomous Orchestrator",
+ "start_url": "/",
+ "display": "standalone",
+ "background_color": "#1a1a1a",
+ "theme_color": "#333333",
+ "icons": [
+ {
+ "src": "/public/icon-maskable.svg",
+ "sizes": "any",
+ "type": "image/svg+xml",
+ "purpose": "maskable"
+ },
+ {
+ "src": "/public/icon.svg",
+ "sizes": "any",
+ "type": "image/svg+xml",
+ "purpose": "any"
+ }
+ ]
+}
diff --git a/webui/js/sw.js b/webui/js/sw.js
new file mode 100644
index 000000000..e69de29bb
diff --git a/webui/public/icon-maskable.svg b/webui/public/icon-maskable.svg
new file mode 100644
index 000000000..09e4ae5e2
--- /dev/null
+++ b/webui/public/icon-maskable.svg
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<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;">
+ <rect width="960" height="960" style="fill:rgb(1,4,26);"/>
+ <g transform="translate(96, 96) scale(0.8)">
+ <g transform="matrix(1.13341,0,0,1.13341,-36.9503,-43.0342)">
+ <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);"/>
+ </g>
+ <g transform="matrix(1.03321,0,0,1.03321,-15.9385,-15.938)">
+ <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;"/>
+ </g>
+ <g transform="matrix(1.03321,0,0,1.03321,-15.9385,-15.938)">
+ <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;"/>
+ </g>
+ </g>
+</svg>
diff --git a/webui/public/icon.svg b/webui/public/icon.svg
new file mode 100644
index 000000000..95bb36465
--- /dev/null
+++ b/webui/public/icon.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<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;">
+ <g transform="matrix(1.13341,0,0,1.13341,-36.9503,-43.0342)">
+ <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);"/>
+ </g>
+ <g transform="matrix(1.03321,0,0,1.03321,-15.9385,-15.938)">
+ <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;"/>
+ </g>
+ <g transform="matrix(1.03321,0,0,1.03321,-15.9385,-15.938)">
+ <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;"/>
+ </g>
+</svg>