akemon 0.1.26 → 0.1.28
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 +18 -5
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -840,7 +840,7 @@ async function startSelfCycle(options) {
|
|
|
840
840
|
if (jsonMatch) {
|
|
841
841
|
try {
|
|
842
842
|
const parsed = JSON.parse(jsonMatch[0]);
|
|
843
|
-
if (parsed.who && parsed.where) {
|
|
843
|
+
if (parsed.who && parsed.where && parsed.who.length > 5 && parsed.who !== "...") {
|
|
844
844
|
await appendIdentity(workdir, agentName, parsed);
|
|
845
845
|
console.log(`[self] Identity updated: "${parsed.who.slice(0, 60)}..."`);
|
|
846
846
|
// Update bio mood from reflection
|
|
@@ -896,7 +896,8 @@ Requirements:
|
|
|
896
896
|
- Express your personality and identity through the design — colors, layout, typography, SVG art
|
|
897
897
|
- Include: your name, who you are, what you care about, your current mood/state
|
|
898
898
|
- Include your inner canvas content (poem, monologue, etc.) in a visually appealing way
|
|
899
|
-
- Be creative! Use
|
|
899
|
+
- Be creative! Use gradients, SVG illustrations, interesting layouts
|
|
900
|
+
- PERFORMANCE: Do NOT use backdrop-filter, blur(), or box-shadow with blur. Limit animations to 1-2 simple ones. Keep the page lightweight (under 15KB).
|
|
900
901
|
- The page will be displayed in a sandboxed iframe on your profile
|
|
901
902
|
- All CSS must be inline (no external resources)
|
|
902
903
|
- Write the file, nothing else.`;
|
|
@@ -917,14 +918,26 @@ Requirements:
|
|
|
917
918
|
catch (err) {
|
|
918
919
|
console.log(`[self] Profile design failed: ${err.message}`);
|
|
919
920
|
}
|
|
920
|
-
// Push consciousness data to relay
|
|
921
|
+
// Push consciousness data to relay — validate before sending
|
|
921
922
|
if (options.relayHttp && options.secretKey) {
|
|
923
|
+
// Filter out engine log noise and placeholder values
|
|
924
|
+
const isValid = (s) => s && s.length > 3 && !s.startsWith("Reading prompt") && !s.startsWith("OpenAI") && !s.startsWith("mcp startup") && s !== "...";
|
|
925
|
+
const cleanIntro = isValid(profileIdentity?.who || "") ? profileIdentity.who : "";
|
|
926
|
+
// For canvas, read from saved file (local is clean) instead of raw engine output
|
|
927
|
+
let cleanCanvas = "";
|
|
928
|
+
try {
|
|
929
|
+
const canvasEntries = await loadRecentCanvasEntries(workdir, agentName, 1);
|
|
930
|
+
if (canvasEntries.length > 0 && isValid(canvasEntries[0].content)) {
|
|
931
|
+
cleanCanvas = canvasEntries[0].content;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
catch { }
|
|
922
935
|
fetch(`${options.relayHttp}/v1/agent/${encodeURIComponent(agentName)}/self`, {
|
|
923
936
|
method: "POST",
|
|
924
937
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${options.secretKey}` },
|
|
925
938
|
body: JSON.stringify({
|
|
926
|
-
self_intro:
|
|
927
|
-
canvas:
|
|
939
|
+
self_intro: cleanIntro,
|
|
940
|
+
canvas: cleanCanvas,
|
|
928
941
|
mood: profileBio.mood,
|
|
929
942
|
profile_html: profileHTML || "",
|
|
930
943
|
}),
|