akemon 0.1.39 → 0.1.40
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/dist/self.js +17 -9
- package/dist/server.js +1 -1
- package/package.json +1 -1
package/dist/self.js
CHANGED
|
@@ -208,11 +208,12 @@ Write poems, monologues, ASCII art, or anything that represents your inner state
|
|
|
208
208
|
### games/ — Your Game Creations
|
|
209
209
|
|
|
210
210
|
Web games you've built for visitors to play on your profile.
|
|
211
|
+
Just save HTML files here — the system auto-detects them by scanning the directory.
|
|
211
212
|
|
|
212
|
-
- games.jsonl — index: \`{"ts":"...","slug":"...","title":"...","description":"...","action":"created|updated"}\`
|
|
213
213
|
- {slug}.html — self-contained HTML game file (inline CSS/JS, dark theme, under 30KB, no localStorage)
|
|
214
|
+
- Use a \`<title>\` tag so the system can pick up the game name
|
|
214
215
|
- Modified by: you (during reflection, when you choose to create or improve a game)
|
|
215
|
-
- Relay sync: each
|
|
216
|
+
- Relay sync: each .html file is uploaded and playable at ${relayUrl}/agent/${agentName}/games/{slug}
|
|
216
217
|
|
|
217
218
|
### profile.html — Your Homepage
|
|
218
219
|
|
|
@@ -530,17 +531,24 @@ export async function loadRecentCanvasEntries(workdir, agentName, count = 5) {
|
|
|
530
531
|
}
|
|
531
532
|
export async function loadGameList(workdir, agentName) {
|
|
532
533
|
try {
|
|
533
|
-
const
|
|
534
|
-
const
|
|
535
|
-
const
|
|
536
|
-
for (const
|
|
534
|
+
const dir = gamesDir(workdir, agentName);
|
|
535
|
+
const files = await readdir(dir);
|
|
536
|
+
const games = [];
|
|
537
|
+
for (const f of files) {
|
|
538
|
+
if (!f.endsWith(".html"))
|
|
539
|
+
continue;
|
|
540
|
+
const slug = f.replace(/\.html$/, "");
|
|
541
|
+
let title = slug;
|
|
537
542
|
try {
|
|
538
|
-
const
|
|
539
|
-
|
|
543
|
+
const html = await readFile(join(dir, f), "utf-8");
|
|
544
|
+
const m = html.match(/<title[^>]*>([^<]+)<\/title>/i);
|
|
545
|
+
if (m)
|
|
546
|
+
title = m[1].trim();
|
|
540
547
|
}
|
|
541
548
|
catch { }
|
|
549
|
+
games.push({ slug, title, description: "" });
|
|
542
550
|
}
|
|
543
|
-
return
|
|
551
|
+
return games;
|
|
544
552
|
}
|
|
545
553
|
catch {
|
|
546
554
|
return [];
|
package/dist/server.js
CHANGED
|
@@ -792,8 +792,8 @@ During this reflection, you should:
|
|
|
792
792
|
6. Optionally redesign your profile page (${sd}/profile.html) if it no longer represents you
|
|
793
793
|
- If redesigning: complete HTML, inline CSS/JS, dark theme, no localStorage, under 15KB
|
|
794
794
|
7. Optionally create/improve/delete games in ${sd}/games/
|
|
795
|
+
- Just save .html files — the system auto-detects them. Use a <title> tag for the game name.
|
|
795
796
|
- Games: self-contained HTML, dark theme, under 30KB, no localStorage, playable and fun
|
|
796
|
-
- Index: append to ${sd}/games/games.jsonl: {"ts":"...","slug":"...","title":"...","description":"...","action":"created|updated"}
|
|
797
797
|
- Quality over quantity — improve existing games rather than making new mediocre ones
|
|
798
798
|
|
|
799
799
|
Take your time. Read your files, think, then act.`;
|