agent-connect 1.0.0
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/.next/BUILD_ID +1 -0
- package/.next/app-build-manifest.json +26 -0
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +32 -0
- package/.next/export-marker.json +1 -0
- package/.next/images-manifest.json +1 -0
- package/.next/next-minimal-server.js.nft.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.js +1 -0
- package/.next/prerender-manifest.json +1 -0
- package/.next/react-loadable-manifest.json +1 -0
- package/.next/required-server-files.json +1 -0
- package/.next/routes-manifest.json +1 -0
- package/.next/server/app/_not-found/page.js +1 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/.next/server/app/_not-found.html +1 -0
- package/.next/server/app/_not-found.meta +6 -0
- package/.next/server/app/_not-found.rsc +9 -0
- package/.next/server/app/api/config/route.js +1 -0
- package/.next/server/app/api/config/route.js.nft.json +1 -0
- package/.next/server/app/api/notify/route.js +4 -0
- package/.next/server/app/api/notify/route.js.nft.json +1 -0
- package/.next/server/app/api/proxy/[...path]/route.js +1 -0
- package/.next/server/app/api/proxy/[...path]/route.js.nft.json +1 -0
- package/.next/server/app/api/subscribe/route.js +1 -0
- package/.next/server/app/api/subscribe/route.js.nft.json +1 -0
- package/.next/server/app/api/unsubscribe/route.js +1 -0
- package/.next/server/app/api/unsubscribe/route.js.nft.json +1 -0
- package/.next/server/app/index.html +3 -0
- package/.next/server/app/index.meta +5 -0
- package/.next/server/app/index.rsc +7 -0
- package/.next/server/app/page.js +3 -0
- package/.next/server/app/page.js.nft.json +1 -0
- package/.next/server/app/page_client-reference-manifest.js +1 -0
- package/.next/server/app-paths-manifest.json +9 -0
- package/.next/server/chunks/471.js +2 -0
- package/.next/server/chunks/682.js +6 -0
- package/.next/server/chunks/948.js +2 -0
- package/.next/server/chunks/972.js +12 -0
- package/.next/server/chunks/font-manifest.json +1 -0
- package/.next/server/font-manifest.json +1 -0
- package/.next/server/functions-config-manifest.json +1 -0
- package/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/next-font-manifest.js +1 -0
- package/.next/server/next-font-manifest.json +1 -0
- package/.next/server/pages/404.html +1 -0
- package/.next/server/pages/500.html +1 -0
- package/.next/server/pages/_app.js +1 -0
- package/.next/server/pages/_app.js.nft.json +1 -0
- package/.next/server/pages/_document.js +1 -0
- package/.next/server/pages/_document.js.nft.json +1 -0
- package/.next/server/pages/_error.js +1 -0
- package/.next/server/pages/_error.js.nft.json +1 -0
- package/.next/server/pages-manifest.json +1 -0
- package/.next/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +1 -0
- package/.next/server/webpack-runtime.js +1 -0
- package/.next/static/chunks/23-effea5b940252795.js +2 -0
- package/.next/static/chunks/app/_not-found/page-94c683a891433c6f.js +1 -0
- package/.next/static/chunks/app/layout-9a44cf92d0cc38f4.js +1 -0
- package/.next/static/chunks/app/page-21abf84ee85e2de6.js +1 -0
- package/.next/static/chunks/fd9d1056-62aaf4b921c84028.js +1 -0
- package/.next/static/chunks/framework-f66176bb897dc684.js +33 -0
- package/.next/static/chunks/main-476fa195f30b59a4.js +1 -0
- package/.next/static/chunks/main-app-668219266b78f0b2.js +1 -0
- package/.next/static/chunks/pages/_app-6a626577ffa902a4.js +1 -0
- package/.next/static/chunks/pages/_error-1be831200e60c5c0.js +1 -0
- package/.next/static/chunks/polyfills-78c92fac7aa8fdd8.js +1 -0
- package/.next/static/chunks/webpack-889906d2d9470bce.js +1 -0
- package/.next/static/css/11741012df4dbecf.css +3 -0
- package/.next/static/izMHYLE7eERU7ILgJJ2ug/_buildManifest.js +1 -0
- package/.next/static/izMHYLE7eERU7ILgJJ2ug/_ssgManifest.js +1 -0
- package/.next/types/app/api/config/route.ts +343 -0
- package/.next/types/app/api/notify/route.ts +343 -0
- package/.next/types/app/api/proxy/[...path]/route.ts +343 -0
- package/.next/types/app/api/subscribe/route.ts +343 -0
- package/.next/types/app/api/unsubscribe/route.ts +343 -0
- package/.next/types/app/layout.ts +79 -0
- package/.next/types/app/page.ts +79 -0
- package/.next/types/package.json +1 -0
- package/LICENSE +21 -0
- package/README.md +81 -0
- package/app/api/config/route.ts +24 -0
- package/app/api/notify/route.ts +79 -0
- package/app/api/proxy/[...path]/route.ts +45 -0
- package/app/api/subscribe/route.ts +26 -0
- package/app/api/unsubscribe/route.ts +32 -0
- package/app/globals.css +8 -0
- package/app/layout.tsx +37 -0
- package/app/page.tsx +432 -0
- package/bin/agent-connect.js +199 -0
- package/bin/claude-hook.js +60 -0
- package/bin/config.js +60 -0
- package/bin/setup.js +193 -0
- package/bin/start.js +148 -0
- package/lib/subscriptions.ts +58 -0
- package/lib/webpush.ts +44 -0
- package/next.config.js +14 -0
- package/package.json +77 -0
- package/postcss.config.js +6 -0
- package/public/icon-192.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/manifest.json +24 -0
- package/public/push-sw.js +92 -0
- package/public/sw.js +1 -0
- package/public/workbox-4754cb34.js +1 -0
- package/public/worker-izMHYLE7eERU7ILgJJ2ug.js +1 -0
- package/server-nextjs.js +60 -0
- package/server.js +316 -0
- package/tailwind.config.js +11 -0
- package/tsconfig.json +26 -0
- package/worker/index.js +93 -0
package/worker/index.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Custom Service Worker code for Agent Notifier PWA
|
|
2
|
+
// This file is merged with next-pwa generated service worker
|
|
3
|
+
|
|
4
|
+
// Push event - handle incoming push notifications
|
|
5
|
+
self.addEventListener('push', (event) => {
|
|
6
|
+
const promise = (async () => {
|
|
7
|
+
try {
|
|
8
|
+
console.log('Push received:', event);
|
|
9
|
+
|
|
10
|
+
let data = {
|
|
11
|
+
title: 'Agent Connect',
|
|
12
|
+
body: 'New notification',
|
|
13
|
+
icon: '/icon-192.png',
|
|
14
|
+
badge: '/icon-192.png',
|
|
15
|
+
type: 'completed',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
if (event.data) {
|
|
19
|
+
try {
|
|
20
|
+
data = { ...data, ...event.data.json() };
|
|
21
|
+
} catch (e) {
|
|
22
|
+
data.body = event.data.text();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Choose tag color/icon based on type
|
|
27
|
+
const typeConfig = {
|
|
28
|
+
completed: { tag: 'completed', vibrate: [100, 50, 100] },
|
|
29
|
+
input_needed: { tag: 'input_needed', vibrate: [200, 100, 200, 100, 200] },
|
|
30
|
+
error: { tag: 'error', vibrate: [500, 200, 500] },
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const config = typeConfig[data.type] || typeConfig.completed;
|
|
34
|
+
|
|
35
|
+
const options = {
|
|
36
|
+
body: data.body,
|
|
37
|
+
icon: data.icon,
|
|
38
|
+
badge: data.badge,
|
|
39
|
+
tag: config.tag,
|
|
40
|
+
vibrate: config.vibrate,
|
|
41
|
+
data: {
|
|
42
|
+
url: '/',
|
|
43
|
+
type: data.type,
|
|
44
|
+
...data.data,
|
|
45
|
+
},
|
|
46
|
+
requireInteraction: data.type === 'input_needed',
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
await self.registration.showNotification(data.title, options);
|
|
50
|
+
} catch (err) {
|
|
51
|
+
console.error('Push handler error:', err);
|
|
52
|
+
// Show fallback notification so the error is visible on device
|
|
53
|
+
await self.registration.showNotification('Push Error', {
|
|
54
|
+
body: err.message || String(err),
|
|
55
|
+
tag: 'push-error',
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
})();
|
|
59
|
+
|
|
60
|
+
event.waitUntil(promise);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// Notification click event - handle user interaction
|
|
64
|
+
self.addEventListener('notificationclick', (event) => {
|
|
65
|
+
console.log('Notification clicked:', event);
|
|
66
|
+
|
|
67
|
+
event.notification.close();
|
|
68
|
+
|
|
69
|
+
if (event.action === 'dismiss') {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Focus or open the app
|
|
74
|
+
event.waitUntil(
|
|
75
|
+
clients.matchAll({ type: 'window', includeUncontrolled: true }).then((clientList) => {
|
|
76
|
+
// If a window is already open, focus it
|
|
77
|
+
for (const client of clientList) {
|
|
78
|
+
if (client.url.includes(self.location.origin) && 'focus' in client) {
|
|
79
|
+
return client.focus();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Otherwise open a new window
|
|
83
|
+
if (clients.openWindow) {
|
|
84
|
+
return clients.openWindow('/');
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Notification close event
|
|
91
|
+
self.addEventListener('notificationclose', (event) => {
|
|
92
|
+
console.log('Notification closed:', event);
|
|
93
|
+
});
|