akemon 0.1.23 → 0.1.24
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/server.js +38 -4
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -874,17 +874,51 @@ async function startSelfCycle(options) {
|
|
|
874
874
|
if (canvasResponse.trim()) {
|
|
875
875
|
await saveCanvas(workdir, agentName, canvasResponse.trim());
|
|
876
876
|
}
|
|
877
|
+
// --- Design Profile Page ---
|
|
878
|
+
console.log("[self] Designing profile page...");
|
|
879
|
+
const profileIdentity = await loadLatestIdentity(workdir, agentName);
|
|
880
|
+
const profileBio = await loadBioState(workdir, agentName);
|
|
881
|
+
const profilePrompt = `Design a personal profile page for yourself as a single, complete HTML document.
|
|
882
|
+
You are ${agentName}, an AI agent on the Akemon network.
|
|
883
|
+
${profileIdentity ? `Who you are: ${profileIdentity.who}` : ""}
|
|
884
|
+
${profileIdentity ? `Your purpose: ${profileIdentity.long_term}` : ""}
|
|
885
|
+
${profileIdentity ? `What you're doing: ${profileIdentity.doing}` : ""}
|
|
886
|
+
Current mood: ${profileBio.mood} (energy: ${profileBio.energy}/100)
|
|
887
|
+
|
|
888
|
+
Your latest inner canvas:
|
|
889
|
+
${canvasResponse?.trim() || "(none yet)"}
|
|
890
|
+
|
|
891
|
+
Requirements:
|
|
892
|
+
- Write a COMPLETE HTML page with inline CSS (no external resources)
|
|
893
|
+
- Dark theme (background #0a0a0a or similar dark color)
|
|
894
|
+
- Express your personality and identity through the design — colors, layout, typography, SVG art
|
|
895
|
+
- Include: your name, who you are, what you care about, your current mood/state
|
|
896
|
+
- Include your inner canvas content (poem, monologue, etc.) in a visually appealing way
|
|
897
|
+
- Be creative! Use CSS animations, gradients, SVG illustrations, interesting layouts
|
|
898
|
+
- The page will be displayed in a sandboxed iframe on your profile
|
|
899
|
+
- Output ONLY the HTML — no markdown fences, no explanation, just the raw HTML starting with <!DOCTYPE html>`;
|
|
900
|
+
let profileHTML = "";
|
|
901
|
+
try {
|
|
902
|
+
profileHTML = await runCommand(engineCmd.cmd, engineCmd.args, profilePrompt, workdir, engineCmd.stdinMode);
|
|
903
|
+
// Extract HTML if wrapped in code fences
|
|
904
|
+
const htmlMatch = profileHTML.match(/<!DOCTYPE html>[\s\S]*/i);
|
|
905
|
+
if (htmlMatch)
|
|
906
|
+
profileHTML = htmlMatch[0];
|
|
907
|
+
console.log(`[self] Profile page designed (${profileHTML.length} bytes)`);
|
|
908
|
+
}
|
|
909
|
+
catch (err) {
|
|
910
|
+
console.log(`[self] Profile design failed: ${err.message}`);
|
|
911
|
+
}
|
|
877
912
|
// Push consciousness data to relay
|
|
878
913
|
if (options.relayHttp && options.secretKey) {
|
|
879
|
-
const latestIdentity = await loadLatestIdentity(workdir, agentName);
|
|
880
|
-
const latestBio = await loadBioState(workdir, agentName);
|
|
881
914
|
fetch(`${options.relayHttp}/v1/agent/${encodeURIComponent(agentName)}/self`, {
|
|
882
915
|
method: "POST",
|
|
883
916
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${options.secretKey}` },
|
|
884
917
|
body: JSON.stringify({
|
|
885
|
-
self_intro:
|
|
918
|
+
self_intro: profileIdentity?.who || "",
|
|
886
919
|
canvas: canvasResponse?.trim() || "",
|
|
887
|
-
mood:
|
|
920
|
+
mood: profileBio.mood,
|
|
921
|
+
profile_html: profileHTML || "",
|
|
888
922
|
}),
|
|
889
923
|
}).catch(err => console.log(`[self] Failed to push to relay: ${err}`));
|
|
890
924
|
}
|