@agenticmail/openclaw 0.5.47 → 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
@@ -3115,16 +3115,26 @@ function activate(api) {
3115
3115
  const from = event.from ?? "unknown";
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
- try {
3119
- await fetch(`http://127.0.0.1:${gatewayPort}/api/cron/wake`, {
3120
- method: "POST",
3121
- headers: { "Content-Type": "application/json" },
3122
- body: JSON.stringify({ text: wakeText, mode: "now" }),
3123
- signal: AbortSignal.timeout(5e3)
3124
- });
3125
- console.log(`[agenticmail] Wake event sent for new email from ${from}: "${subject}"`);
3126
- } catch (wakeErr) {
3127
- console.warn(`[agenticmail] Failed to send wake event: ${wakeErr.message}`);
3118
+ const hooksToken = process.env.OPENCLAW_HOOKS_TOKEN;
3119
+ if (hooksToken) {
3120
+ try {
3121
+ const wakeUrl = `http://127.0.0.1:${gatewayPort}/hooks/wake`;
3122
+ const resp = await fetch(wakeUrl, {
3123
+ method: "POST",
3124
+ headers: {
3125
+ "Content-Type": "application/json",
3126
+ "Authorization": `Bearer ${hooksToken}`
3127
+ },
3128
+ body: JSON.stringify({ text: wakeText, mode: "now" }),
3129
+ signal: AbortSignal.timeout(5e3)
3130
+ });
3131
+ if (!resp.ok) {
3132
+ const errBody = await resp.text().catch(() => "");
3133
+ console.warn(`[agenticmail] email wake failed (${resp.status}): ${errBody}`);
3134
+ }
3135
+ } catch {
3136
+ }
3137
+ } else {
3128
3138
  }
3129
3139
  }
3130
3140
  } catch {
@@ -3139,10 +3149,7 @@ function activate(api) {
3139
3149
  } catch {
3140
3150
  }
3141
3151
  }
3142
- } catch (err) {
3143
- if (err.name !== "AbortError") {
3144
- console.warn(`[agenticmail] Main email watcher error: ${err.message}`);
3145
- }
3152
+ } catch {
3146
3153
  } finally {
3147
3154
  sseController = null;
3148
3155
  sseRetryMs = Math.min(sseRetryMs * 1.5, 6e4);
package/dist/index.js CHANGED
@@ -3079,16 +3079,26 @@ function activate(api) {
3079
3079
  const from = event.from ?? "unknown";
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
- try {
3083
- await fetch(`http://127.0.0.1:${gatewayPort}/api/cron/wake`, {
3084
- method: "POST",
3085
- headers: { "Content-Type": "application/json" },
3086
- body: JSON.stringify({ text: wakeText, mode: "now" }),
3087
- signal: AbortSignal.timeout(5e3)
3088
- });
3089
- console.log(`[agenticmail] Wake event sent for new email from ${from}: "${subject}"`);
3090
- } catch (wakeErr) {
3091
- console.warn(`[agenticmail] Failed to send wake event: ${wakeErr.message}`);
3082
+ const hooksToken = process.env.OPENCLAW_HOOKS_TOKEN;
3083
+ if (hooksToken) {
3084
+ try {
3085
+ const wakeUrl = `http://127.0.0.1:${gatewayPort}/hooks/wake`;
3086
+ const resp = await fetch(wakeUrl, {
3087
+ method: "POST",
3088
+ headers: {
3089
+ "Content-Type": "application/json",
3090
+ "Authorization": `Bearer ${hooksToken}`
3091
+ },
3092
+ body: JSON.stringify({ text: wakeText, mode: "now" }),
3093
+ signal: AbortSignal.timeout(5e3)
3094
+ });
3095
+ if (!resp.ok) {
3096
+ const errBody = await resp.text().catch(() => "");
3097
+ console.warn(`[agenticmail] email wake failed (${resp.status}): ${errBody}`);
3098
+ }
3099
+ } catch {
3100
+ }
3101
+ } else {
3092
3102
  }
3093
3103
  }
3094
3104
  } catch {
@@ -3103,10 +3113,7 @@ function activate(api) {
3103
3113
  } catch {
3104
3114
  }
3105
3115
  }
3106
- } catch (err) {
3107
- if (err.name !== "AbortError") {
3108
- console.warn(`[agenticmail] Main email watcher error: ${err.message}`);
3109
- }
3116
+ } catch {
3110
3117
  } finally {
3111
3118
  sseController = null;
3112
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.47",
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",