@agenticmail/api 0.5.34 → 0.5.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/index.js +9 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2796,15 +2796,20 @@ function createTaskRoutes(db, accountManager, config) {
2796
2796
  db.prepare(
2797
2797
  "INSERT INTO agent_tasks (id, assigner_id, assignee_id, task_type, payload, expires_at) VALUES (?, ?, ?, ?, ?, ?)"
2798
2798
  ).run(id, assignerId, target.id, taskType || "generic", JSON.stringify(payload || {}), expiresAt);
2799
- const taskEvent = {
2799
+ const taskDescription = payload?.task || payload?.description || JSON.stringify(payload || {});
2800
+ const spawnEvent = {
2800
2801
  type: "task",
2801
2802
  taskId: id,
2802
- taskType: taskType || "generic",
2803
+ taskType: "rpc",
2804
+ task: `You have a pending task (ID: ${id}). Check your pending tasks, claim it, process it, and submit the result.
2805
+
2806
+ Type: ${taskType || "generic"}
2807
+ Task: ${taskDescription}`,
2803
2808
  assignee: target.name,
2804
2809
  from: req.agent?.name ?? "system"
2805
2810
  };
2806
- if (!pushEventToAgent(target.id, taskEvent)) {
2807
- broadcastEvent(taskEvent);
2811
+ if (!pushEventToAgent(target.id, spawnEvent)) {
2812
+ broadcastEvent(spawnEvent);
2808
2813
  }
2809
2814
  if (req.agent) {
2810
2815
  const notifSender = new MailSender4({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/api",
3
- "version": "0.5.34",
3
+ "version": "0.5.36",
4
4
  "description": "REST API server for AgenticMail \u2014 email and SMS endpoints for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",