@agenticmail/claudecode 0.1.0 → 0.1.1

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.
@@ -48,6 +48,16 @@ var DEFAULT_MAX_CONCURRENT = 10;
48
48
  var DEFAULT_SYNC_INTERVAL_MS = 6e4;
49
49
  var DEFAULT_RECONNECT_BASE_MS = 2e3;
50
50
  var DEFAULT_RECONNECT_MAX_MS = 6e4;
51
+ var TASK_MAIL_SUPPRESS_WINDOW_MS = 3e4;
52
+ var TASK_NOTIFICATION_SUBJECT_PREFIXES = ["[RPC]", "[Task]", "[Async-RPC]"];
53
+ function isTaskNotificationSubject(subject) {
54
+ if (!subject) return false;
55
+ const head = subject.trimStart();
56
+ for (const prefix of TASK_NOTIFICATION_SUBJECT_PREFIXES) {
57
+ if (head.toLowerCase().startsWith(prefix.toLowerCase())) return true;
58
+ }
59
+ return false;
60
+ }
51
61
  async function runWorker(query, persona, userPrompt, agent, mcpServerName, mcpCommand, mcpArgs, mcpEnv, log, abortSignal) {
52
62
  const opts = {
53
63
  systemPrompt: persona,
@@ -202,6 +212,11 @@ var Dispatcher = class {
202
212
  if (event.type === "new" && typeof event.uid === "number") {
203
213
  const ch = this.channels.get(account.id);
204
214
  if (ch?.seenUids.has(event.uid)) return;
215
+ if (ch && Date.now() < ch.suppressTaskMailUntilMs && isTaskNotificationSubject(event.subject)) {
216
+ this.log("info", `[dispatcher] suppressed task-notification mail wake for "${account.name}" (uid=${event.uid}, subject="${event.subject}") \u2014 task event already dispatched`);
217
+ if (ch) rememberBounded(ch.seenUids, event.uid);
218
+ return;
219
+ }
205
220
  if (ch) rememberBounded(ch.seenUids, event.uid);
206
221
  await this.spawnWorker(account, newMailPrompt(account, event), { kind: "new-mail", uid: event.uid });
207
222
  return;
@@ -210,7 +225,10 @@ var Dispatcher = class {
210
225
  if (typeof event.assignee === "string" && event.assignee.toLowerCase() !== account.name.toLowerCase()) return;
211
226
  const ch = this.channels.get(account.id);
212
227
  if (ch?.seenTaskIds.has(event.taskId)) return;
213
- if (ch) rememberBounded(ch.seenTaskIds, event.taskId);
228
+ if (ch) {
229
+ rememberBounded(ch.seenTaskIds, event.taskId);
230
+ ch.suppressTaskMailUntilMs = Date.now() + TASK_MAIL_SUPPRESS_WINDOW_MS;
231
+ }
214
232
  await this.spawnWorker(account, taskPrompt(account, event), { kind: "task", taskId: event.taskId });
215
233
  return;
216
234
  }
@@ -244,7 +262,8 @@ var Dispatcher = class {
244
262
  stopping: false,
245
263
  backoffMs: this.reconnectBaseMs,
246
264
  seenUids: /* @__PURE__ */ new Set(),
247
- seenTaskIds: /* @__PURE__ */ new Set()
265
+ seenTaskIds: /* @__PURE__ */ new Set(),
266
+ suppressTaskMailUntilMs: 0
248
267
  };
249
268
  this.channels.set(account.id, ch);
250
269
  this.log("info", `[dispatcher] opening SSE for "${account.name}" (${account.email})`);
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Dispatcher
4
- } from "./chunk-563BZ447.js";
4
+ } from "./chunk-ED6OXJRX.js";
5
5
  import "./chunk-XAW5NUNU.js";
6
6
 
7
7
  // src/dispatcher-bin.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Dispatcher
3
- } from "./chunk-563BZ447.js";
3
+ } from "./chunk-ED6OXJRX.js";
4
4
  import "./chunk-XAW5NUNU.js";
5
5
  export {
6
6
  Dispatcher
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Dispatcher,
3
3
  loadPersonaForAgent
4
- } from "./chunk-563BZ447.js";
4
+ } from "./chunk-ED6OXJRX.js";
5
5
  import {
6
6
  createIntegrationRoutes
7
7
  } from "./chunk-UPA2YLSM.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/claudecode",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Claude Code integration for AgenticMail — surfaces every AgenticMail agent as a native Claude Code subagent so any Claude Code session can delegate to them with the Agent tool",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",