@abstractframework/observer 0.1.3
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/LICENSE +21 -0
- package/README.md +67 -0
- package/bin/cli.js +146 -0
- package/dist/assets/index-CvWzMSqL.css +1 -0
- package/dist/assets/index-DvFDLf0J.js +136 -0
- package/dist/assets/index-DvFDLf0J.js.map +1 -0
- package/dist/icon.svg +61 -0
- package/dist/index.html +28 -0
- package/dist/manifest.webmanifest +16 -0
- package/dist/sw.js +80 -0
- package/package.json +57 -0
package/dist/icon.svg
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="planet" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0" stop-color="#60a5fa" />
|
|
5
|
+
<stop offset="1" stop-color="#e94560" />
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="orbit" x1="0" y1="0" x2="1" y2="1">
|
|
8
|
+
<stop offset="0" stop-color="#60a5fa" stop-opacity="0.95" />
|
|
9
|
+
<stop offset="1" stop-color="#a78bfa" stop-opacity="0.95" />
|
|
10
|
+
</linearGradient>
|
|
11
|
+
<clipPath id="orbitFront">
|
|
12
|
+
<rect x="0" y="128" width="256" height="128" />
|
|
13
|
+
</clipPath>
|
|
14
|
+
</defs>
|
|
15
|
+
|
|
16
|
+
<rect width="256" height="256" rx="56" fill="#0b1220" />
|
|
17
|
+
|
|
18
|
+
<!-- subtle stars -->
|
|
19
|
+
<circle cx="56" cy="72" r="2" fill="#ffffff" opacity="0.22" />
|
|
20
|
+
<circle cx="208" cy="64" r="2" fill="#ffffff" opacity="0.18" />
|
|
21
|
+
<circle cx="196" cy="188" r="2" fill="#ffffff" opacity="0.16" />
|
|
22
|
+
<circle cx="70" cy="196" r="2" fill="#ffffff" opacity="0.18" />
|
|
23
|
+
|
|
24
|
+
<!-- orbit (behind) -->
|
|
25
|
+
<ellipse
|
|
26
|
+
cx="128"
|
|
27
|
+
cy="128"
|
|
28
|
+
rx="98"
|
|
29
|
+
ry="46"
|
|
30
|
+
transform="rotate(-18 128 128)"
|
|
31
|
+
fill="none"
|
|
32
|
+
stroke="url(#orbit)"
|
|
33
|
+
stroke-width="14"
|
|
34
|
+
stroke-linecap="round"
|
|
35
|
+
opacity="0.45"
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<!-- planet -->
|
|
39
|
+
<circle cx="128" cy="128" r="52" fill="url(#planet)" />
|
|
40
|
+
<circle cx="110" cy="112" r="18" fill="#ffffff" opacity="0.14" />
|
|
41
|
+
|
|
42
|
+
<!-- orbit (front) -->
|
|
43
|
+
<g clip-path="url(#orbitFront)">
|
|
44
|
+
<ellipse
|
|
45
|
+
cx="128"
|
|
46
|
+
cy="128"
|
|
47
|
+
rx="98"
|
|
48
|
+
ry="46"
|
|
49
|
+
transform="rotate(-18 128 128)"
|
|
50
|
+
fill="none"
|
|
51
|
+
stroke="url(#orbit)"
|
|
52
|
+
stroke-width="14"
|
|
53
|
+
stroke-linecap="round"
|
|
54
|
+
opacity="0.95"
|
|
55
|
+
/>
|
|
56
|
+
</g>
|
|
57
|
+
|
|
58
|
+
<!-- satellite -->
|
|
59
|
+
<circle cx="212" cy="146" r="9" fill="#f59e0b" />
|
|
60
|
+
</svg>
|
|
61
|
+
|
package/dist/index.html
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
|
|
7
|
+
<!-- PWA Manifest -->
|
|
8
|
+
<link rel="manifest" href="/manifest.webmanifest" />
|
|
9
|
+
|
|
10
|
+
<meta name="theme-color" content="#111827" />
|
|
11
|
+
<meta name="color-scheme" content="dark" />
|
|
12
|
+
|
|
13
|
+
<!-- iOS PWA / Home Screen -->
|
|
14
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
15
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
16
|
+
<meta name="apple-mobile-web-app-title" content="AbstractObserver" />
|
|
17
|
+
<link rel="apple-touch-icon" href="/icon.svg" />
|
|
18
|
+
|
|
19
|
+
<!-- Favicon -->
|
|
20
|
+
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
|
21
|
+
<title>AbstractObserver</title>
|
|
22
|
+
<script type="module" crossorigin src="/assets/index-DvFDLf0J.js"></script>
|
|
23
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CvWzMSqL.css">
|
|
24
|
+
</head>
|
|
25
|
+
<body>
|
|
26
|
+
<div id="root"></div>
|
|
27
|
+
</body>
|
|
28
|
+
</html>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "AbstractObserver",
|
|
3
|
+
"short_name": "Observer",
|
|
4
|
+
"start_url": "/",
|
|
5
|
+
"display": "standalone",
|
|
6
|
+
"background_color": "#111827",
|
|
7
|
+
"theme_color": "#111827",
|
|
8
|
+
"icons": [
|
|
9
|
+
{
|
|
10
|
+
"src": "/icon.svg",
|
|
11
|
+
"sizes": "any",
|
|
12
|
+
"type": "image/svg+xml"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
|
package/dist/sw.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Minimal service worker (PWA shell cache).
|
|
2
|
+
// Note: PWA on iOS requires HTTPS (except localhost) and has platform-specific limitations.
|
|
3
|
+
|
|
4
|
+
const CACHE_NAME = "abstractobserver-pwa-v1";
|
|
5
|
+
|
|
6
|
+
function isHtmlRequest(req) {
|
|
7
|
+
const accept = req.headers.get("accept") || "";
|
|
8
|
+
return req.mode === "navigate" || accept.includes("text/html");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
self.addEventListener("install", (event) => {
|
|
12
|
+
event.waitUntil(
|
|
13
|
+
(async () => {
|
|
14
|
+
const cache = await caches.open(CACHE_NAME);
|
|
15
|
+
// Cache only the root shell for offline fallback. Navigation requests are still network-first.
|
|
16
|
+
await cache.addAll(["/"]);
|
|
17
|
+
self.skipWaiting();
|
|
18
|
+
})()
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
self.addEventListener("activate", (event) => {
|
|
23
|
+
event.waitUntil(
|
|
24
|
+
(async () => {
|
|
25
|
+
const keys = await caches.keys();
|
|
26
|
+
await Promise.all(keys.map((k) => (k === CACHE_NAME ? Promise.resolve() : caches.delete(k))));
|
|
27
|
+
self.clients.claim();
|
|
28
|
+
})()
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
self.addEventListener("fetch", (event) => {
|
|
33
|
+
const req = event.request;
|
|
34
|
+
const url = new URL(req.url);
|
|
35
|
+
|
|
36
|
+
// Never cache API calls.
|
|
37
|
+
if (url.pathname.startsWith("/api/")) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Only handle same-origin GET requests.
|
|
42
|
+
if (req.method !== "GET" || url.origin !== self.location.origin) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
event.respondWith(
|
|
47
|
+
(async () => {
|
|
48
|
+
const cache = await caches.open(CACHE_NAME);
|
|
49
|
+
const cached = await cache.match(req);
|
|
50
|
+
|
|
51
|
+
// HTML (SPA navigations): network-first so UI updates on normal refresh.
|
|
52
|
+
if (isHtmlRequest(req)) {
|
|
53
|
+
try {
|
|
54
|
+
const resp = await fetch(req);
|
|
55
|
+
if (resp && resp.status === 200) cache.put(req, resp.clone());
|
|
56
|
+
return resp;
|
|
57
|
+
} catch {
|
|
58
|
+
return cached || (await cache.match("/")) || new Response("Offline", { status: 503 });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Other assets: stale-while-revalidate to avoid "sticky" old bundles.
|
|
63
|
+
const fetchPromise = fetch(req)
|
|
64
|
+
.then((resp) => {
|
|
65
|
+
if (resp && resp.status === 200) cache.put(req, resp.clone());
|
|
66
|
+
return resp;
|
|
67
|
+
})
|
|
68
|
+
.catch(() => undefined);
|
|
69
|
+
|
|
70
|
+
if (cached) {
|
|
71
|
+
event.waitUntil(fetchPromise);
|
|
72
|
+
return cached;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const resp = await fetchPromise;
|
|
76
|
+
return resp || new Response("Offline", { status: 503 });
|
|
77
|
+
})()
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@abstractframework/observer",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Gateway-only observability UI for AbstractFramework - connect to a Run Gateway, replay/stream the ledger, and submit durable commands",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": "Laurent-Philippe Albou",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"abstractframework",
|
|
10
|
+
"observability",
|
|
11
|
+
"workflow",
|
|
12
|
+
"gateway",
|
|
13
|
+
"ui",
|
|
14
|
+
"pwa",
|
|
15
|
+
"monitoring"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/lpalbou/abstractobserver.git"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/lpalbou/abstractobserver#readme",
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"bin": {
|
|
26
|
+
"abstractobserver": "./bin/cli.js"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"bin",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "vite --host --port 3001",
|
|
35
|
+
"build": "tsc && vite build",
|
|
36
|
+
"preview": "vite preview",
|
|
37
|
+
"start": "node ./bin/cli.js",
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"prepublishOnly": "npm run build"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"react": "^18.2.0",
|
|
43
|
+
"react-dom": "^18.2.0",
|
|
44
|
+
"reactflow": "^11.10.4"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/react": "^18.2.48",
|
|
48
|
+
"@types/react-dom": "^18.2.18",
|
|
49
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
50
|
+
"typescript": "^5.3.3",
|
|
51
|
+
"vite": "^6.4.1",
|
|
52
|
+
"vitest": "^3.2.4"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=18.0.0"
|
|
56
|
+
}
|
|
57
|
+
}
|