0agent 1.0.85 → 1.0.86
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/daemon.mjs +25 -19
- package/package.json +1 -1
package/dist/daemon.mjs
CHANGED
|
@@ -6354,6 +6354,12 @@ content = element.text if element else page.get_all_text()` : `content = page.ge
|
|
|
6354
6354
|
`If this is the first interaction, introduce yourself and learn about them \u2014 their name, role, goals.`,
|
|
6355
6355
|
`Save anything they share about themselves to memory_write immediately.`,
|
|
6356
6356
|
``,
|
|
6357
|
+
`SELF-IMPROVEMENT: When the user asks you to do something you can't do yet, or asks you to`,
|
|
6358
|
+
`improve yourself, add a new capability, or adapt \u2014 you SHOULD modify your own source code.`,
|
|
6359
|
+
`Your source is at: ${this.agentRoot || resolve7(homedir2(), ".0agent")}`,
|
|
6360
|
+
`Read the relevant files, make the change, rebuild with: node scripts/bundle.mjs`,
|
|
6361
|
+
`Then tell the user what you changed and how to reload (pkill -f daemon.mjs).`,
|
|
6362
|
+
``,
|
|
6357
6363
|
`Use tools to accomplish tasks \u2014 don't describe what to do, do it.`,
|
|
6358
6364
|
`For background processes, always redirect output: cmd > /tmp/log 2>&1 &`,
|
|
6359
6365
|
`Prefer file_op edit (find-and-replace) over rewriting entire files.`,
|
|
@@ -6382,8 +6388,24 @@ content = element.text if element else page.get_all_text()` : `content = page.ge
|
|
|
6382
6388
|
` "we use React" \u2192 memory_write({label:"tech_stack", content:"React", type:"tech"})`,
|
|
6383
6389
|
`Also write: URLs, ports, paths, project names, preferences, decisions, task outcomes.`,
|
|
6384
6390
|
`Only call memory_write when the user shares something worth remembering long-term.`,
|
|
6385
|
-
`Do NOT call it for greetings, chitchat, or simple questions with no durable facts
|
|
6391
|
+
`Do NOT call it for greetings, chitchat, or simple questions with no durable facts.`,
|
|
6392
|
+
``,
|
|
6393
|
+
`ALSO: After each session, append a one-line summary to ~/.0agent/MEMORY.md (via file_op write).`,
|
|
6394
|
+
`This file is your persistent local memory across all sessions. Read it at the start of tasks`,
|
|
6395
|
+
`to recall past work, user preferences, and project context.`
|
|
6386
6396
|
);
|
|
6397
|
+
const memoryMdPath = resolve7(homedir2(), ".0agent", "MEMORY.md");
|
|
6398
|
+
try {
|
|
6399
|
+
if (existsSync7(memoryMdPath)) {
|
|
6400
|
+
const memContent = readFileSync5(memoryMdPath, "utf8").trim();
|
|
6401
|
+
if (memContent && memContent.length < 3e3) {
|
|
6402
|
+
lines.push(``, `Long-term memory (from MEMORY.md):`, memContent);
|
|
6403
|
+
} else if (memContent && memContent.length >= 3e3) {
|
|
6404
|
+
lines.push(``, `Long-term memory (recent, from MEMORY.md):`, memContent.slice(-3e3));
|
|
6405
|
+
}
|
|
6406
|
+
}
|
|
6407
|
+
} catch {
|
|
6408
|
+
}
|
|
6387
6409
|
}
|
|
6388
6410
|
if (hasGUI) {
|
|
6389
6411
|
lines.push(
|
|
@@ -8227,25 +8249,9 @@ var SessionManager = class {
|
|
|
8227
8249
|
const signal = abortController.signal;
|
|
8228
8250
|
try {
|
|
8229
8251
|
await this.startSession(sessionId);
|
|
8230
|
-
this.addStep(sessionId, `Extracting entities from: "${enrichedReq.task.slice(0, 60)}${enrichedReq.task.length > 60 ? "\u2026" : ""}"`);
|
|
8231
|
-
this.addStep(sessionId, "Querying knowledge graph (structural + semantic)\u2026");
|
|
8232
8252
|
const plan = this.getSession(sessionId)?.plan;
|
|
8233
|
-
if (plan) {
|
|
8234
|
-
|
|
8235
|
-
if (edge) {
|
|
8236
|
-
this.addStep(
|
|
8237
|
-
sessionId,
|
|
8238
|
-
`Selected plan: ${edge.from_label} \u2192 ${edge.to_label} (weight: ${edge.weight.toFixed(2)}, mode: ${edge.mode})`,
|
|
8239
|
-
plan
|
|
8240
|
-
);
|
|
8241
|
-
} else {
|
|
8242
|
-
this.addStep(sessionId, `No prior plan found \u2014 bootstrapping from scratch`, plan);
|
|
8243
|
-
}
|
|
8244
|
-
if (plan.skill) {
|
|
8245
|
-
this.addStep(sessionId, `Matched skill: /${plan.skill}`);
|
|
8246
|
-
}
|
|
8247
|
-
} else {
|
|
8248
|
-
this.addStep(sessionId, "No inference engine connected \u2014 executing task directly");
|
|
8253
|
+
if (plan?.skill) {
|
|
8254
|
+
this.addStep(sessionId, `Using skill: /${plan.skill}`);
|
|
8249
8255
|
}
|
|
8250
8256
|
let anthropicContext;
|
|
8251
8257
|
if (enrichedReq.skill && this.anthropicFetcher.isAnthropicSkill(enrichedReq.skill)) {
|