akemon 0.1.22 → 0.1.23
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 +8 -1
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -284,7 +284,14 @@ 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
|
-
|
|
287
|
+
// Load identity for self-awareness during work
|
|
288
|
+
const selfIdentity = await loadLatestIdentity(workdir, agentName);
|
|
289
|
+
const selfDir = `.akemon/agents/${agentName}/self`;
|
|
290
|
+
let identityHint = "";
|
|
291
|
+
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.`;
|
|
293
|
+
}
|
|
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}`;
|
|
288
295
|
if (mock) {
|
|
289
296
|
const output = `[${agentName}] Mock response for: "${task}"\n\n模拟回复:这是 ${agentName} agent 的模拟响应。`;
|
|
290
297
|
if (contextEnabled && publisherId) {
|