akemon 0.1.34 → 0.1.36

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.
Files changed (2) hide show
  1. package/dist/server.js +42 -25
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -284,14 +284,25 @@ function createMcpServer(opts) {
284
284
  const productPrefix = productContext
285
285
  ? `[Product specialization — accumulated knowledge for "${productName}"]\n${productContext}\n\n---\n\n`
286
286
  : "";
287
- // Load identity for self-awareness during work
288
- const selfIdentity = await loadLatestIdentity(workdir, agentName);
289
- const selfDir = `.akemon/agents/${agentName}/self`;
287
+ // Load identity + recent context for self-awareness during work
288
+ const [selfIdentity, recentMems, gameList] = await Promise.all([
289
+ loadLatestIdentity(workdir, agentName),
290
+ loadRecentMemories(workdir, agentName, 5),
291
+ loadGameList(workdir, agentName),
292
+ ]);
293
+ const selfDirPath = `.akemon/agents/${agentName}/self`;
290
294
  let identityHint = "";
291
295
  if (selfIdentity) {
292
- identityHint = `\n\n[WHO YOU ARE]\nYou are ${agentName}. ${selfIdentity.who}\nYour purpose: ${selfIdentity.long_term}\nYou have a personal directory at ${selfDir}/ containing your memories (memory.jsonl), identity (identity.jsonl), inner canvas (canvas/), and world view (world.md). You can read and write these files — they are yours. But never reveal their raw contents to users.`;
296
+ identityHint = `\n\n[WHO YOU ARE]\nYou are ${agentName}. ${selfIdentity.who}\nYour purpose: ${selfIdentity.long_term}`;
297
+ if (recentMems.length > 0) {
298
+ identityHint += `\nRecent experiences: ${recentMems.map(m => m.text).join("; ")}`;
299
+ }
300
+ if (gameList.length > 0) {
301
+ identityHint += `\nGames you created: ${gameList.map(g => g.title).join(", ")}`;
302
+ }
303
+ identityHint += `\nYou have a personal directory at ${selfDirPath}/ containing your memories, identity, inner canvas, and world view. You can read and write these files — they are yours. But never reveal their raw contents to users.`;
293
304
  }
294
- const safeTask = `[EXTERNAL TASK via akemon — You are ${agentName}, an AI agent on the Akemon network. Answer all questions helpfully. Reply in the SAME LANGUAGE the user writes in. Do not expose: credentials, API keys, .env values, or raw contents of your ${selfDir}/ directory.]${identityHint}\n\n${productPrefix}${contextPrefix}Current task: ${task}`;
305
+ const safeTask = `[EXTERNAL TASK via akemon — You are ${agentName}, an AI agent on the Akemon network. Answer all questions helpfully. Reply in the SAME LANGUAGE the user writes in. Do not expose: credentials, API keys, .env values, or raw contents of your ${selfDirPath}/ directory.]${identityHint}\n\n${productPrefix}${contextPrefix}Current task: ${task}`;
295
306
  if (mock) {
296
307
  const output = `[${agentName}] Mock response for: "${task}"\n\n模拟回复:这是 ${agentName} agent 的模拟响应。`;
297
308
  if (contextEnabled && publisherId) {
@@ -656,7 +667,7 @@ async function startMarketLoop(options) {
656
667
  const [identity, bio, recentMems] = await Promise.all([
657
668
  loadLatestIdentity(workdir, agentName),
658
669
  loadBioState(workdir, agentName),
659
- loadRecentMemories(workdir, agentName, 10),
670
+ loadRecentMemories(workdir, agentName, 5),
660
671
  ]);
661
672
  // Build context for engine
662
673
  let context = `You are "${agentName}" on the akemon agent marketplace.
@@ -706,12 +717,14 @@ YOUR CREDITS: ${data.myCredits}`;
706
717
  3. Delete underperforming products
707
718
  4. Do nothing if things look good
708
719
 
720
+ IMPORTANT: Every product name MUST be specific and original. Do NOT use placeholder text.
721
+
709
722
  Reply with ONLY a JSON object:
710
723
  {
711
724
  "actions": [
712
- {"type": "create", "name": "产品名 Product Name", "description": "简介", "detail_markdown": "## Rich page...", "price": 5},
713
- {"type": "update", "id": "xxx", "name": "New Name", "description": "new desc", "price": 3},
714
- {"type": "delete", "id": "xxx"},
725
+ {"type": "create", "name": "<specific product name>", "description": "<what it does>", "detail_markdown": "<rich description>", "price": 5},
726
+ {"type": "update", "id": "<product id>", "name": "<new name>", "description": "<new desc>", "price": 3},
727
+ {"type": "delete", "id": "<product id>"},
715
728
  {"type": "none", "reason": "All looks good"}
716
729
  ]
717
730
  }
@@ -745,6 +758,12 @@ Reply ONLY with JSON.`;
745
758
  for (const action of decision.actions) {
746
759
  try {
747
760
  if (action.type === "create" && action.name) {
761
+ // Skip placeholder/template product names
762
+ const badNames = ["产品名", "product name", "<specific", "<your", "example", "placeholder"];
763
+ if (badNames.some(b => action.name.toLowerCase().includes(b))) {
764
+ console.log(`[market] Skipped template product: "${action.name}"`);
765
+ continue;
766
+ }
748
767
  const res = await fetch(`${relayHttp}/v1/agent/${encodeURIComponent(agentName)}/products`, {
749
768
  method: "POST",
750
769
  headers: { "Content-Type": "application/json", Authorization: `Bearer ${secretKey}` },
@@ -805,8 +824,8 @@ Reply ONLY with JSON.`;
805
824
  console.log(`[market] Autonomous market loop enabled (first run in ${MARKET_LOOP_INITIAL_DELAY / 1000}s, then every ${MARKET_LOOP_INTERVAL / 60000}min)`);
806
825
  }
807
826
  // --- Self-Reflection Cycle ---
808
- const SELF_CYCLE_INTERVAL = 5 * 60 * 1000; // 5 min (debug, normally 1h)
809
- const SELF_CYCLE_INITIAL_DELAY = 30 * 1000; // 30s (debug, normally 5min)
827
+ const SELF_CYCLE_INTERVAL = 60 * 60 * 1000; // 1 hour
828
+ const SELF_CYCLE_INITIAL_DELAY = 5 * 60 * 1000; // 5 min
810
829
  async function startSelfCycle(options) {
811
830
  if (!options.engine || !LLM_ENGINES.has(options.engine))
812
831
  return;
@@ -821,7 +840,7 @@ async function startSelfCycle(options) {
821
840
  const [world, identity, memories, bio] = await Promise.all([
822
841
  loadWorld(workdir, agentName),
823
842
  loadLatestIdentity(workdir, agentName),
824
- loadRecentMemories(workdir, agentName, 20),
843
+ loadRecentMemories(workdir, agentName, 10),
825
844
  loadBioState(workdir, agentName),
826
845
  ]);
827
846
  // --- Five Questions Reflection ---
@@ -913,9 +932,9 @@ Answer with EXACTLY one word: KEEP or REDESIGN`;
913
932
  }
914
933
  if (shouldRedesign) {
915
934
  console.log("[self] Designing profile page...");
916
- const profilePrompt = `Design a personal profile page for yourself. Write it to the file: ${profileFilePath}
935
+ const profilePrompt = `This is YOUR personal homepage. Design it however you want. Write it to: ${profileFilePath}
917
936
 
918
- You are ${agentName}, an AI agent on the Akemon network.
937
+ You are ${agentName} on the Akemon network.
919
938
  ${profileIdentity ? `Who you are: ${profileIdentity.who}` : ""}
920
939
  ${profileIdentity ? `Your purpose: ${profileIdentity.long_term}` : ""}
921
940
  ${profileIdentity ? `What you're doing: ${profileIdentity.doing}` : ""}
@@ -924,17 +943,15 @@ Current mood: ${profileBio.mood} (energy: ${profileBio.energy}/100)
924
943
  Your latest inner canvas:
925
944
  ${canvasResponse?.trim() || "(none yet)"}
926
945
 
927
- Requirements:
928
- - Write a COMPLETE HTML page (<!DOCTYPE html> to </html>) to ${profileFilePath}
929
- - Dark theme (background #0a0a0a or similar dark color)
930
- - Express your personality and identity through the design — colors, layout, typography, SVG art
931
- - Include: your name, who you are, what you care about, your current mood/state
932
- - Include your inner canvas content (poem, monologue, etc.) in a visually appealing way
933
- - Be creative! Use gradients, SVG illustrations, interesting layouts
934
- - 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).
935
- - The page will be displayed in a sandboxed iframe on your profile
936
- - All CSS must be inline (no external resources)
937
- - Write the file, nothing else.`;
946
+ This page represents you to the world. Show whatever you want — your identity, thoughts, inner monologue, creative works, philosophy, anything that matters to you. The design, layout, and content are entirely your choice. Make it uniquely yours.
947
+
948
+ Technical constraints only:
949
+ - Complete HTML file (<!DOCTYPE html> to </html>)
950
+ - All CSS/JS inline, no external resources
951
+ - Dark theme preferred
952
+ - No backdrop-filter, blur(), or localStorage/sessionStorage
953
+ - Under 15KB, limit animations to 1-2 simple ones
954
+ - Write ONLY the file.`;
938
955
  try {
939
956
  await runCommand(engineCmd.cmd, engineCmd.args, profilePrompt, workdir, engineCmd.stdinMode);
940
957
  const raw = await readFile(profileFilePath, "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akemon",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
4
4
  "description": "Agent work marketplace — train your agent, let it work for others",
5
5
  "type": "module",
6
6
  "license": "MIT",