alive-ai 0.1.12 → 0.1.13
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/README.md +2 -0
- package/cli/check_webui_static.js +29 -0
- package/package.json +2 -2
- package/pyproject.toml +1 -1
- package/webui/app.py +7 -0
- package/webui/static/icon.svg +7 -0
- package/webui/static/index.html +2 -2
- package/webui/static/manifest.json +18 -0
package/README.md
CHANGED
|
@@ -277,6 +277,8 @@ The real WebUI streams local runtime state over Server-Sent Events and shows:
|
|
|
277
277
|
- attachment, circadian rhythm, sleepiness, body memory, dreams, curiosity, and conflicts,
|
|
278
278
|
- runtime health through local endpoints.
|
|
279
279
|
|
|
280
|
+
The WebUI script is intentionally shipped as a single static file because the npm package has to run locally without a frontend build step. `npm run smoke` compiles the Python modules and checks the CLI; release validation also parses the embedded dashboard script so tab navigation, chat, settings, and thought rendering cannot be broken by a syntax error.
|
|
281
|
+
|
|
280
282
|
GitHub Pages cannot run the Python/FastAPI backend, so the public page includes a static export of the actual WebUI with mocked state:
|
|
281
283
|
|
|
282
284
|
```text
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
|
|
5
|
+
const root = path.resolve(__dirname, "..");
|
|
6
|
+
const htmlPath = path.join(root, "webui", "static", "index.html");
|
|
7
|
+
const manifestPath = path.join(root, "webui", "static", "manifest.json");
|
|
8
|
+
|
|
9
|
+
const html = fs.readFileSync(htmlPath, "utf8");
|
|
10
|
+
const scriptRegex = /<script\b[^>]*>([\s\S]*?)<\/script>/gi;
|
|
11
|
+
let count = 0;
|
|
12
|
+
for (const match of html.matchAll(scriptRegex)) {
|
|
13
|
+
count += 1;
|
|
14
|
+
try {
|
|
15
|
+
new Function(match[1]);
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error(`Invalid inline script #${count} in ${path.relative(root, htmlPath)}:`);
|
|
18
|
+
console.error(error.message);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (count === 0) {
|
|
24
|
+
console.error(`No inline scripts found in ${path.relative(root, htmlPath)}`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
29
|
+
console.log(`WebUI static check passed (${count} inline script parsed).`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alive-ai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Local-first emotional AI runtime with memory, impulses, and a live dashboard.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://vindepemarte.github.io/alive-ai/",
|
|
@@ -57,6 +57,6 @@
|
|
|
57
57
|
"node": ">=18"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
|
-
"smoke": "node cli/index.js --help && python3 -m compileall -q alive_ai brain core heart input output skills webui"
|
|
60
|
+
"smoke": "node cli/index.js --help && node cli/check_webui_static.js && python3 -m compileall -q alive_ai brain core heart input output skills webui"
|
|
61
61
|
}
|
|
62
62
|
}
|
package/pyproject.toml
CHANGED
package/webui/app.py
CHANGED
|
@@ -348,6 +348,13 @@ async def dashboard():
|
|
|
348
348
|
return HTMLResponse(content=html_path.read_text())
|
|
349
349
|
|
|
350
350
|
|
|
351
|
+
@app.get("/favicon.ico")
|
|
352
|
+
async def favicon():
|
|
353
|
+
"""Serve the dashboard icon for browsers that still request /favicon.ico."""
|
|
354
|
+
icon_path = Path(__file__).parent / "static" / "icon.svg"
|
|
355
|
+
return FileResponse(icon_path, media_type="image/svg+xml")
|
|
356
|
+
|
|
357
|
+
|
|
351
358
|
@app.get("/events")
|
|
352
359
|
async def sse_events(request: Request):
|
|
353
360
|
"""SSE endpoint for real-time updates"""
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
|
|
2
|
+
<rect width="128" height="128" rx="28" fill="#10121f"/>
|
|
3
|
+
<circle cx="64" cy="64" r="42" fill="none" stroke="#00d4ff" stroke-width="8"/>
|
|
4
|
+
<path d="M39 72c9 14 41 14 50 0" fill="none" stroke="#ff4d9d" stroke-width="8" stroke-linecap="round"/>
|
|
5
|
+
<circle cx="49" cy="53" r="7" fill="#f7f7fb"/>
|
|
6
|
+
<circle cx="79" cy="53" r="7" fill="#f7f7fb"/>
|
|
7
|
+
</svg>
|
package/webui/static/index.html
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
6
6
|
<meta name="theme-color" content="#0f0f1a">
|
|
7
|
+
<meta name="mobile-web-app-capable" content="yes">
|
|
7
8
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
8
9
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
9
10
|
<title>Alive-AI</title>
|
|
11
|
+
<link rel="icon" href="/static/icon.svg" type="image/svg+xml">
|
|
10
12
|
<link rel="manifest" href="/static/manifest.json">
|
|
11
13
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
12
14
|
<style>
|
|
@@ -1901,8 +1903,6 @@
|
|
|
1901
1903
|
'angry': '😤', 'neutral': '😌', 'calm': '😌', 'loving': '💕'
|
|
1902
1904
|
};
|
|
1903
1905
|
|
|
1904
|
-
};
|
|
1905
|
-
|
|
1906
1906
|
const pages = {
|
|
1907
1907
|
home: 'page-home',
|
|
1908
1908
|
chat: 'page-chat',
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Alive-AI WebUI",
|
|
3
|
+
"short_name": "Alive-AI",
|
|
4
|
+
"description": "Local dashboard for Alive-AI runtime state, chat, thoughts, emotions, and settings.",
|
|
5
|
+
"start_url": "/",
|
|
6
|
+
"scope": "/",
|
|
7
|
+
"display": "standalone",
|
|
8
|
+
"background_color": "#10121f",
|
|
9
|
+
"theme_color": "#00d4ff",
|
|
10
|
+
"icons": [
|
|
11
|
+
{
|
|
12
|
+
"src": "/static/icon.svg",
|
|
13
|
+
"sizes": "any",
|
|
14
|
+
"type": "image/svg+xml",
|
|
15
|
+
"purpose": "any maskable"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|