@agenticmail/openclaw 0.5.48 → 0.5.49

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/index.cjs CHANGED
@@ -3116,40 +3116,25 @@ function activate(api) {
3116
3116
  const subject = event.subject ?? "(no subject)";
3117
3117
  const wakeText = `New email received from ${from}: "${subject}". Read it with agenticmail_read(uid=${event.uid}), assess urgency, and decide: if urgent or time-sensitive, notify the user now. Otherwise, note it in memory and batch-notify later.`;
3118
3118
  const hooksToken = process.env.OPENCLAW_HOOKS_TOKEN;
3119
- let wakeSuccess = false;
3120
3119
  if (hooksToken) {
3121
3120
  try {
3122
- const hookUrl = `http://127.0.0.1:${gatewayPort}/hooks/agent`;
3123
- const resp = await fetch(hookUrl, {
3121
+ const wakeUrl = `http://127.0.0.1:${gatewayPort}/hooks/wake`;
3122
+ const resp = await fetch(wakeUrl, {
3124
3123
  method: "POST",
3125
3124
  headers: {
3126
3125
  "Content-Type": "application/json",
3127
3126
  "Authorization": `Bearer ${hooksToken}`
3128
3127
  },
3129
- body: JSON.stringify({
3130
- event: "system",
3131
- text: wakeText,
3132
- sessionTarget: "main"
3133
- }),
3128
+ body: JSON.stringify({ text: wakeText, mode: "now" }),
3134
3129
  signal: AbortSignal.timeout(5e3)
3135
3130
  });
3136
- if (resp.ok) {
3137
- wakeSuccess = true;
3138
- console.log(`[agenticmail] Wake event sent via webhook for new email from ${from}: "${subject}"`);
3131
+ if (!resp.ok) {
3132
+ const errBody = await resp.text().catch(() => "");
3133
+ console.warn(`[agenticmail] email wake failed (${resp.status}): ${errBody}`);
3139
3134
  }
3140
3135
  } catch {
3141
3136
  }
3142
- }
3143
- if (!wakeSuccess && api?.callTool) {
3144
- try {
3145
- await api.callTool("cron", { action: "wake", text: wakeText, mode: "now" });
3146
- wakeSuccess = true;
3147
- console.log(`[agenticmail] Wake event sent via cron tool for new email from ${from}: "${subject}"`);
3148
- } catch {
3149
- }
3150
- }
3151
- if (!wakeSuccess) {
3152
- console.warn(`[agenticmail] Could not send wake event for email from ${from}: "${subject}"`);
3137
+ } else {
3153
3138
  }
3154
3139
  }
3155
3140
  } catch {
@@ -3164,10 +3149,7 @@ function activate(api) {
3164
3149
  } catch {
3165
3150
  }
3166
3151
  }
3167
- } catch (err) {
3168
- if (err.name !== "AbortError") {
3169
- console.warn(`[agenticmail] Main email watcher error: ${err.message}`);
3170
- }
3152
+ } catch {
3171
3153
  } finally {
3172
3154
  sseController = null;
3173
3155
  sseRetryMs = Math.min(sseRetryMs * 1.5, 6e4);
package/dist/index.js CHANGED
@@ -3080,40 +3080,25 @@ function activate(api) {
3080
3080
  const subject = event.subject ?? "(no subject)";
3081
3081
  const wakeText = `New email received from ${from}: "${subject}". Read it with agenticmail_read(uid=${event.uid}), assess urgency, and decide: if urgent or time-sensitive, notify the user now. Otherwise, note it in memory and batch-notify later.`;
3082
3082
  const hooksToken = process.env.OPENCLAW_HOOKS_TOKEN;
3083
- let wakeSuccess = false;
3084
3083
  if (hooksToken) {
3085
3084
  try {
3086
- const hookUrl = `http://127.0.0.1:${gatewayPort}/hooks/agent`;
3087
- const resp = await fetch(hookUrl, {
3085
+ const wakeUrl = `http://127.0.0.1:${gatewayPort}/hooks/wake`;
3086
+ const resp = await fetch(wakeUrl, {
3088
3087
  method: "POST",
3089
3088
  headers: {
3090
3089
  "Content-Type": "application/json",
3091
3090
  "Authorization": `Bearer ${hooksToken}`
3092
3091
  },
3093
- body: JSON.stringify({
3094
- event: "system",
3095
- text: wakeText,
3096
- sessionTarget: "main"
3097
- }),
3092
+ body: JSON.stringify({ text: wakeText, mode: "now" }),
3098
3093
  signal: AbortSignal.timeout(5e3)
3099
3094
  });
3100
- if (resp.ok) {
3101
- wakeSuccess = true;
3102
- console.log(`[agenticmail] Wake event sent via webhook for new email from ${from}: "${subject}"`);
3095
+ if (!resp.ok) {
3096
+ const errBody = await resp.text().catch(() => "");
3097
+ console.warn(`[agenticmail] email wake failed (${resp.status}): ${errBody}`);
3103
3098
  }
3104
3099
  } catch {
3105
3100
  }
3106
- }
3107
- if (!wakeSuccess && api?.callTool) {
3108
- try {
3109
- await api.callTool("cron", { action: "wake", text: wakeText, mode: "now" });
3110
- wakeSuccess = true;
3111
- console.log(`[agenticmail] Wake event sent via cron tool for new email from ${from}: "${subject}"`);
3112
- } catch {
3113
- }
3114
- }
3115
- if (!wakeSuccess) {
3116
- console.warn(`[agenticmail] Could not send wake event for email from ${from}: "${subject}"`);
3101
+ } else {
3117
3102
  }
3118
3103
  }
3119
3104
  } catch {
@@ -3128,10 +3113,7 @@ function activate(api) {
3128
3113
  } catch {
3129
3114
  }
3130
3115
  }
3131
- } catch (err) {
3132
- if (err.name !== "AbortError") {
3133
- console.warn(`[agenticmail] Main email watcher error: ${err.message}`);
3134
- }
3116
+ } catch {
3135
3117
  } finally {
3136
3118
  sseController = null;
3137
3119
  sseRetryMs = Math.min(sseRetryMs * 1.5, 6e4);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/openclaw",
3
- "version": "0.5.48",
3
+ "version": "0.5.49",
4
4
  "description": "OpenClaw plugin for AgenticMail — email, SMS, and phone number access for OpenClaw agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",