@agenticmail/claudecode 0.1.16 → 0.2.0

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/README.md CHANGED
@@ -16,7 +16,32 @@ Agent { subagent_type: "agenticmail-fola", prompt: "draft a reply to my last ema
16
16
 
17
17
  This package is to Claude Code what `@agenticmail/openclaw` is to OpenClaw: an integration package that wires AgenticMail into the host AI runtime. It mirrors that package's layout 1:1, so if you know one, you know the other.
18
18
 
19
- ## ✨ What's new in 0.1.14
19
+ ## ✨ What's new in 0.2.0
20
+
21
+ The wake-context release for the dispatcher.
22
+
23
+ - **🧠 `## Thread context` block prepended to every wake prompt.** Two layers compose: **ThreadCache** (`@agenticmail/core`) — the dispatcher's per-thread ring buffer of the last K envelopes + previews, built passively on every SSE new-mail event regardless of whether anyone actually wakes — and **AgentMemoryStore** (`@agenticmail/core`) — per-`(agent, thread)` markdown files agents write at end-of-wake via `save_thread_memory`. The dispatcher reads both before spawning a worker and injects them as a "you've seen this thread before, here's what you know" header. Cuts rehydration cost from linear-in-thread-length to roughly flat.
24
+ - **⏱ Wake coalescing (30 s debounce per agent + thread).** A burst of back-to-back replies on the same thread now collapses into ONE Claude turn that sees the union of new messages in a `newMailPromptForBatch` shape. Wake-budget charges once for the batch. Configurable via `wakeCoalesceMs` (set to 0 to disable). Safety valve at 5× the window prevents indefinite extension on a continuous reply stream.
25
+ - **`[FINAL]` cleanup widened.** Thread-close markers now drop both the ThreadCache entry AND this agent's memory for the closed thread.
26
+
27
+ ## ✨ Earlier — 0.1.17
28
+
29
+ - **⏱ Compact-and-continue (0.1.17)** — workers can now run across multiple SDK turns when one isn't enough to finish a task. `runWorker` is wrapped by `runWorkerWithCompaction`, which on a context-overflow error (`prompt is too long`, `context_length_exceeded`, etc.) synthesises a breadcrumb checkpoint from the captured tool-call log + last assistant text, builds a continuation prompt prefixed with "Resuming after context reset / do NOT redo these steps", and loops. Capped at 4 iterations by default so cost is bounded; on cap exhaustion the worker exits with `compaction budget exhausted` so the host sees what happened.
30
+ - **🪝 Mail-hook resolves with absolute path (0.1.16)** — the hook command registered in `~/.claude/settings.json` is now `node "<abs-path>/mail-hook.js"` instead of the bare bin name. `import.meta.url` + a 3-step filesystem probe (`dist/` sibling → `dist/` alongside `src/` → `../dist/`) handle both published builds and dev checkouts (`tsx`-loaded `src/install.ts` no longer points at a non-existent `src/mail-hook.js`). The `command not found` and `MODULE_NOT_FOUND` errors are gone. Existing installs auto-heal on the next `agenticmail claudecode` run because the upserter rewrites the command with the freshly-resolved path.
31
+ - **📨 Stop hook output rewritten (0.1.15 / 0.1.16)** — the Stop hook's `reason` is printed to the user in the transcript. The original text was written assuming only the model would see it; phrases like "you do NOT need to ping the user" and "surface them to the user" read as awkward instruction-leakage. New shape:
32
+ ```
33
+ 🎀 New AgenticMail (bridge inbox) — N messages since the last check:
34
+
35
+ · UID 2 — vesper · Re: Audit assignment…
36
+ > <up to 180 chars of preview body>
37
+
38
+ Full body: mcp__agenticmail__read_email. Reply: mcp__agenticmail__reply_email (replyAll: true).
39
+ ```
40
+ Same body for both UserPromptSubmit and Stop. Hard wall-time bound (1.5 s global timeout, 800 ms per fetch) and proper stdin listener cleanup so the hook never holds the harness REPL.
41
+ - **🤖 Autonomous-mode awareness via Stop hook (0.1.14)** — the mail hook now registers on `Stop` in addition to `UserPromptSubmit`. Long headless Claude Code runs (no user prompts firing for hours) finally see teammate replies: when bridge mail is unread at a turn boundary, the hook returns `{decision: 'block', reason: '…'}` forcing Claude to continue with the new-mail summary in context. This is the schema-correct supported way to inject context at Stop, unlike the 0.8.22 PreToolUse attempt which used the wrong output shape.
42
+ - **📥 Long-running workers (0.1.14)** — dropped the 30-min hard timeout. Per-worker log file at `~/.agenticmail/worker-logs/<id>.log` capturing every SDK tool call / result / assistant chunk. 30 s heartbeats POSTed to the API so `check_activity` shows real progress. Per-worker scratch cwd at `~/.agenticmail/worker-cwds/<id>/` prevents parallel agents from clobbering each other's output. Tail via the MCP `tail_worker` tool.
43
+
44
+ ## ✨ Earlier — 0.1.14
20
45
 
21
46
  - **Workers run for hours** — dropped the 30-min hard timeout. Per-worker log file at `~/.agenticmail/worker-logs/<id>.log` capturing every SDK tool call + result + assistant chunk as a one-liner. Heartbeats POSTed to the API every 30 s so `check_activity` sees real progress. Per-worker scratch cwd at `~/.agenticmail/worker-cwds/<id>/` prevents parallel agents from clobbering each other's output. Tail via the new MCP tool `tail_worker`.
22
47
  - **Autonomous-mode awareness via Stop hook** — the mail hook now registers on the **Stop** Claude Code event too. Long headless runs (no user prompts) finally see teammate replies: when bridge mail is unread at a turn boundary, the hook returns `{decision: 'block', reason: '...'}`, forcing Claude to continue with the new-mail summary in context. This is the schema-correct supported way to inject context at Stop, unlike the 0.8.22 PreToolUse attempt.
@@ -0,0 +1,48 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __esm = (fn, res) => function __init() {
14
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
+ };
16
+ var __commonJS = (cb, mod) => function __require2() {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ };
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, { get: all[name], enumerable: true });
22
+ };
23
+ var __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from === "object" || typeof from === "function") {
25
+ for (let key of __getOwnPropNames(from))
26
+ if (!__hasOwnProp.call(to, key) && key !== except)
27
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
+ }
29
+ return to;
30
+ };
31
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
32
+ // If the importer is in node compatibility mode or this is not an ESM
33
+ // file that has been converted to a CommonJS file using a Babel-
34
+ // compatible transform (i.e. "__esModule" has not been set), then set
35
+ // "default" to the CommonJS "module.exports" for node compatibility.
36
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
+ mod
38
+ ));
39
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40
+
41
+ export {
42
+ __require,
43
+ __esm,
44
+ __commonJS,
45
+ __export,
46
+ __toESM,
47
+ __toCommonJS
48
+ };