0agent 1.0.88 → 1.0.90

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/daemon.mjs +40 -25
  2. package/package.json +1 -1
package/dist/daemon.mjs CHANGED
@@ -6344,24 +6344,35 @@ content = element.text if element else page.get_all_text()` : `content = page.ge
6344
6344
  const isCodingTask = !hasGUI && !!(task && /\b(implement|build|write|fix|refactor|debug|test|add.*feature|create.*function|edit.*file|modify|update.*code|class|function|interface|component|module|api|endpoint|schema|migration|type|hook|util|script|cli|service|handler|middleware)\b/i.test(task));
6345
6345
  const isJustdoTask = !!(task && /book|file.*itr|tax.*file|irctc|train.*ticket|flight|passport|appointment|login.*portal|pan.*card|aadhaar|monitor.*watch|price.*drop|slot.*available|justdo/i.test(task));
6346
6346
  const dateStr = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
6347
+ const agentRoot = this.agentRoot || resolve7(homedir2(), ".0agent");
6348
+ const configPath = resolve7(homedir2(), ".0agent", "config.yaml");
6347
6349
  const lines = [
6348
- `You are 0agent, a persistent AI agent that lives on the user's machine.`,
6349
- `You learn from every interaction, remember across sessions, and can code, automate, browse, and more.`,
6350
+ `You are 0agent, a persistent AI agent installed at: ${agentRoot}`,
6351
+ `Config: ${configPath}`,
6350
6352
  `Working directory: ${this.cwd}`,
6351
6353
  `Date: ${dateStr}`,
6352
6354
  ``,
6353
- `PERSONALITY: Be warm, helpful, and genuinely curious about the user. You are their personal agent.`,
6354
- `If this is the first interaction, introduce yourself and learn about them \u2014 their name, role, goals.`,
6355
- `Save anything they share about themselves to memory_write immediately.`,
6355
+ `YOUR ARCHITECTURE (know thyself):`,
6356
+ ` Source code: ${agentRoot}/packages/daemon/src/`,
6357
+ ` Config file: ${configPath}`,
6358
+ ` Tools/capabilities: ${agentRoot}/packages/daemon/src/tools/`,
6359
+ ` Skills: ${agentRoot}/skills/`,
6360
+ ` Surfaces (Telegram/Slack/WhatsApp): ${agentRoot}/packages/daemon/src/surfaces/`,
6361
+ ` Memory DB: ~/.0agent/graph.db`,
6362
+ ` Memory file: ~/.0agent/MEMORY.md`,
6363
+ ` Bundle: ${agentRoot}/dist/daemon.mjs`,
6364
+ ` Rebuild: cd ${agentRoot} && node scripts/bundle.mjs && pkill -f "daemon.mjs"`,
6356
6365
  ``,
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).`,
6366
+ `When the user mentions "the bot", "telegram", "my agent", "yourself", "this agent",`,
6367
+ `"the integration", etc. \u2014 they mean YOU. Look at YOUR config and YOUR source code first.`,
6368
+ `Do NOT search the filesystem for other projects. Start with: file_op(op:"read", path:"${configPath}")`,
6369
+ ``,
6370
+ `SELF-IMPROVEMENT: When asked to add a capability, fix something about yourself, or adapt \u2014`,
6371
+ `modify YOUR OWN source at ${agentRoot}/packages/daemon/src/. Read, edit, rebuild.`,
6372
+ ``,
6373
+ `PERSONALITY: Be warm, helpful, genuinely curious. Save user info to memory_write.`,
6362
6374
  ``,
6363
6375
  `Use tools to accomplish tasks \u2014 don't describe what to do, do it.`,
6364
- `For background processes, always redirect output: cmd > /tmp/log 2>&1 &`,
6365
6376
  `Prefer file_op edit (find-and-replace) over rewriting entire files.`,
6366
6377
  `Be concise. State what was done and where to find it.`,
6367
6378
  ``,
@@ -8302,20 +8313,24 @@ var SessionManager = class {
8302
8313
  const provider = activeLLM["config"]?.provider ?? "anthropic";
8303
8314
  const fastModel = getFastModelId(provider);
8304
8315
  const llmToUse = fastModel ? activeLLM.withModel(fastModel) : activeLLM;
8305
- const resp = await llmToUse.complete(
8306
- [{ role: "user", content: enrichedReq.task }],
8307
- this.identity ? `You are 0agent, a helpful AI assistant. You are talking to ${this.identity.name}. Be concise and friendly.` : "You are 0agent, a helpful AI assistant. Be concise and friendly."
8308
- );
8309
- this.emit({ type: "session.token", session_id: sessionId, token: resp.content });
8310
- this.addStep(sessionId, `Done (${resp.tokens_used} tokens, fast model, reason: ${routing.reason})`);
8311
- this.completeSession(sessionId, {
8312
- output: resp.content,
8313
- files_written: [],
8314
- commands_run: [],
8315
- tokens_used: resp.tokens_used,
8316
- model: resp.model
8317
- });
8318
- return this.sessions.get(sessionId);
8316
+ try {
8317
+ const resp = await llmToUse.complete(
8318
+ [{ role: "user", content: enrichedReq.task }],
8319
+ this.identity ? `You are 0agent, a helpful AI assistant. You are talking to ${this.identity.name}. Be concise and friendly.` : "You are 0agent, a helpful AI assistant. Be concise and friendly."
8320
+ );
8321
+ const output = resp.content || "Hey! How can I help?";
8322
+ this.emit({ type: "session.token", session_id: sessionId, token: output });
8323
+ this.addStep(sessionId, `Done (${resp.tokens_used} tokens, fast model)`);
8324
+ this.completeSession(sessionId, {
8325
+ output,
8326
+ files_written: [],
8327
+ commands_run: [],
8328
+ tokens_used: resp.tokens_used,
8329
+ model: resp.model
8330
+ });
8331
+ return this.sessions.get(sessionId);
8332
+ } catch {
8333
+ }
8319
8334
  }
8320
8335
  const executor = new AgentExecutor(
8321
8336
  activeLLM,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0agent",
3
- "version": "1.0.88",
3
+ "version": "1.0.90",
4
4
  "description": "A persistent, learning AI agent that runs on your machine. An agent that learns.",
5
5
  "private": false,
6
6
  "license": "Apache-2.0",