@agenticmail/claudecode 0.2.3 → 0.2.4

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.
@@ -13222,12 +13222,18 @@ var Dispatcher = class {
13222
13222
  let turnCount = 0;
13223
13223
  let lastTool = "";
13224
13224
  let lastUsage;
13225
+ const digestedUids = /* @__PURE__ */ new Set();
13225
13226
  const observer = {
13226
13227
  onMessage: (tag, summary) => {
13227
13228
  writeLog(`${tag} ${summary}`);
13228
13229
  if (tag === "tool_use") {
13229
13230
  lastTool = summary.split(" ")[0];
13230
13231
  turnCount++;
13232
+ const m = /read_email\b[^}]*"uid"\s*:\s*(\d+)/.exec(summary);
13233
+ if (m) {
13234
+ const uid = parseInt(m[1], 10);
13235
+ if (Number.isFinite(uid) && uid > 0) digestedUids.add(uid);
13236
+ }
13231
13237
  }
13232
13238
  if (tag === "usage") lastUsage = summary;
13233
13239
  }
@@ -13267,6 +13273,26 @@ var Dispatcher = class {
13267
13273
  } finally {
13268
13274
  clearInterval(heartbeatHandle);
13269
13275
  this.releaseSlot();
13276
+ if (digestedUids.size > 0) {
13277
+ const prefix = `${account.id}::`;
13278
+ for (const [key, entry] of this.wakeCoalesce.entries()) {
13279
+ if (!key.startsWith(prefix)) continue;
13280
+ const before = entry.events.length;
13281
+ entry.events = entry.events.filter((e) => !(typeof e.uid === "number" && digestedUids.has(e.uid)));
13282
+ if (entry.events.length < before) {
13283
+ this.log("info", `[dispatcher] dropped ${before - entry.events.length} queued wake(s) for "${account.name}" \u2014 UIDs already digested this turn`);
13284
+ }
13285
+ if (entry.events.length === 0) {
13286
+ try {
13287
+ clearTimeout(entry.timer);
13288
+ } catch {
13289
+ }
13290
+ this.wakeCoalesce.delete(key);
13291
+ }
13292
+ }
13293
+ const ch = this.channels.get(account.id);
13294
+ if (ch) for (const uid of digestedUids) rememberBounded(ch.seenUids, uid);
13295
+ }
13270
13296
  try {
13271
13297
  releaseAgentLock();
13272
13298
  } catch {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Dispatcher
4
- } from "./chunk-ZBDS3QNR.js";
4
+ } from "./chunk-V5R2D3QD.js";
5
5
  import "./chunk-DDJNA5HP.js";
6
6
  import "./chunk-B276KPVO.js";
7
7
  import "./chunk-RB5MGRT3.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Dispatcher
3
- } from "./chunk-ZBDS3QNR.js";
3
+ } from "./chunk-V5R2D3QD.js";
4
4
  import "./chunk-DDJNA5HP.js";
5
5
  import "./chunk-B276KPVO.js";
6
6
  import "./chunk-RB5MGRT3.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Dispatcher,
3
3
  loadPersonaForAgent
4
- } from "./chunk-ZBDS3QNR.js";
4
+ } from "./chunk-V5R2D3QD.js";
5
5
  import "./chunk-DDJNA5HP.js";
6
6
  import "./chunk-B276KPVO.js";
7
7
  import "./chunk-RB5MGRT3.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/claudecode",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
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",