@agenticmail/claudecode 0.1.1 → 0.1.3

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.
@@ -2,7 +2,7 @@ import {
2
2
  listAccounts,
3
3
  renderPersonaBody,
4
4
  resolveConfig
5
- } from "./chunk-XAW5NUNU.js";
5
+ } from "./chunk-W2R3GH54.js";
6
6
 
7
7
  // src/persona-loader.ts
8
8
  import { existsSync, readFileSync } from "fs";
@@ -36,6 +36,20 @@ function loadPersonaForAgent(opts) {
36
36
  }
37
37
 
38
38
  // src/dispatcher.ts
39
+ function extractSubject(event) {
40
+ if (typeof event.subject === "string") return event.subject;
41
+ if (event.message && typeof event.message.subject === "string") return event.message.subject;
42
+ return void 0;
43
+ }
44
+ function extractFrom(event) {
45
+ if (typeof event.from === "string") return event.from;
46
+ if (event.message && Array.isArray(event.message.from)) {
47
+ const first = event.message.from[0];
48
+ if (first?.address) return first.address;
49
+ if (first?.name) return first.name;
50
+ }
51
+ return void 0;
52
+ }
39
53
  var SEEN_CAP = 1024;
40
54
  function rememberBounded(set, item) {
41
55
  set.add(item);
@@ -119,8 +133,8 @@ function wrapSignal(signal) {
119
133
  return c;
120
134
  }
121
135
  function newMailPrompt(agent, event) {
122
- const from = event.from ?? "unknown sender";
123
- const subject = event.subject ?? "(no subject)";
136
+ const from = extractFrom(event) ?? "unknown sender";
137
+ const subject = extractSubject(event) ?? "(no subject)";
124
138
  const uid = event.uid;
125
139
  return [
126
140
  `You have new mail.`,
@@ -212,9 +226,10 @@ var Dispatcher = class {
212
226
  if (event.type === "new" && typeof event.uid === "number") {
213
227
  const ch = this.channels.get(account.id);
214
228
  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);
229
+ const subject = extractSubject(event);
230
+ if (ch && Date.now() < ch.suppressTaskMailUntilMs && isTaskNotificationSubject(subject)) {
231
+ this.log("info", `[dispatcher] suppressed task-notification mail wake for "${account.name}" (uid=${event.uid}, subject="${subject}") \u2014 task event already dispatched`);
232
+ rememberBounded(ch.seenUids, event.uid);
218
233
  return;
219
234
  }
220
235
  if (ch) rememberBounded(ch.seenUids, event.uid);
@@ -9,7 +9,7 @@ import {
9
9
  listAccounts,
10
10
  renderSubagentMarkdown,
11
11
  resolveConfig
12
- } from "./chunk-XAW5NUNU.js";
12
+ } from "./chunk-W2R3GH54.js";
13
13
 
14
14
  // src/install.ts
15
15
  import { existsSync, mkdirSync, readdirSync, writeFileSync, readFileSync, unlinkSync } from "fs";
@@ -7,7 +7,7 @@ import {
7
7
  deleteAccount,
8
8
  getAccountByName,
9
9
  resolveConfig
10
- } from "./chunk-XAW5NUNU.js";
10
+ } from "./chunk-W2R3GH54.js";
11
11
 
12
12
  // src/uninstall.ts
13
13
  import { existsSync, readdirSync, readFileSync, unlinkSync } from "fs";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  install
3
- } from "./chunk-P2DXF7DO.js";
3
+ } from "./chunk-4JURQ6QD.js";
4
4
  import {
5
5
  status
6
- } from "./chunk-RI4USTMC.js";
6
+ } from "./chunk-UZZNLWBR.js";
7
7
  import {
8
8
  uninstall
9
- } from "./chunk-ULKJ773Y.js";
9
+ } from "./chunk-5S377IWV.js";
10
10
  import {
11
11
  AgenticMailApiError
12
- } from "./chunk-XAW5NUNU.js";
12
+ } from "./chunk-W2R3GH54.js";
13
13
 
14
14
  // src/http-routes.ts
15
15
  import { Router } from "express";
@@ -7,7 +7,7 @@ import {
7
7
  MANAGED_BY_MARKER,
8
8
  getAccountByName,
9
9
  resolveConfig
10
- } from "./chunk-XAW5NUNU.js";
10
+ } from "./chunk-W2R3GH54.js";
11
11
 
12
12
  // src/status.ts
13
13
  import { existsSync, readFileSync, readdirSync } from "fs";
@@ -103,7 +103,7 @@ function resolveConfig(opts = {}) {
103
103
  const amConfigPath = opts.agenticmailConfigPath ?? AGENTICMAIL_CONFIG_PATH;
104
104
  const onDisk = readAgenticMailConfig(amConfigPath);
105
105
  const apiHost = onDisk.api?.host ?? "127.0.0.1";
106
- const apiPort = onDisk.api?.port ?? 3200;
106
+ const apiPort = onDisk.api?.port ?? 3829;
107
107
  const defaultApiUrl = `http://${apiHost}:${apiPort}`;
108
108
  const defaultInvocation = defaultMcpInvocation();
109
109
  const masterKey = opts.masterKey ?? onDisk.masterKey ?? "";
package/dist/cli.js CHANGED
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  install
4
- } from "./chunk-P2DXF7DO.js";
4
+ } from "./chunk-4JURQ6QD.js";
5
5
  import {
6
6
  status
7
- } from "./chunk-RI4USTMC.js";
7
+ } from "./chunk-UZZNLWBR.js";
8
8
  import {
9
9
  uninstall
10
- } from "./chunk-ULKJ773Y.js";
10
+ } from "./chunk-5S377IWV.js";
11
11
  import "./chunk-US5FT2UB.js";
12
12
  import {
13
13
  AgenticMailApiError
14
- } from "./chunk-XAW5NUNU.js";
14
+ } from "./chunk-W2R3GH54.js";
15
15
 
16
16
  // src/cli.ts
17
17
  var GREEN = (s) => `\x1B[32m${s}\x1B[0m`;
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Dispatcher
4
- } from "./chunk-ED6OXJRX.js";
5
- import "./chunk-XAW5NUNU.js";
4
+ } from "./chunk-3ULRGCUI.js";
5
+ import "./chunk-W2R3GH54.js";
6
6
 
7
7
  // src/dispatcher-bin.ts
8
8
  async function main() {
@@ -45,7 +45,19 @@ interface SSEEvent {
45
45
  type?: string;
46
46
  uid?: number;
47
47
  from?: string;
48
+ /**
49
+ * Subject MAY appear at top-level on some code paths AND nested under
50
+ * `message.subject` on others (the master API enriches new-mail events
51
+ * with the full IMAP envelope, which lands under `message`). Always use
52
+ * `extractSubject(event)` rather than reading either path directly.
53
+ */
48
54
  subject?: string;
55
+ message?: {
56
+ subject?: string;
57
+ from?: unknown;
58
+ to?: unknown;
59
+ messageId?: string;
60
+ };
49
61
  taskId?: string;
50
62
  taskType?: string;
51
63
  task?: string;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Dispatcher
3
- } from "./chunk-ED6OXJRX.js";
4
- import "./chunk-XAW5NUNU.js";
3
+ } from "./chunk-3ULRGCUI.js";
4
+ import "./chunk-W2R3GH54.js";
5
5
  export {
6
6
  Dispatcher
7
7
  };
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createIntegrationRoutes
3
- } from "./chunk-UPA2YLSM.js";
4
- import "./chunk-P2DXF7DO.js";
5
- import "./chunk-RI4USTMC.js";
6
- import "./chunk-ULKJ773Y.js";
3
+ } from "./chunk-OZPRB336.js";
4
+ import "./chunk-4JURQ6QD.js";
5
+ import "./chunk-UZZNLWBR.js";
6
+ import "./chunk-5S377IWV.js";
7
7
  import "./chunk-US5FT2UB.js";
8
- import "./chunk-XAW5NUNU.js";
8
+ import "./chunk-W2R3GH54.js";
9
9
  export {
10
10
  createIntegrationRoutes
11
11
  };
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  Dispatcher,
3
3
  loadPersonaForAgent
4
- } from "./chunk-ED6OXJRX.js";
4
+ } from "./chunk-3ULRGCUI.js";
5
5
  import {
6
6
  createIntegrationRoutes
7
- } from "./chunk-UPA2YLSM.js";
7
+ } from "./chunk-OZPRB336.js";
8
8
  import {
9
9
  install
10
- } from "./chunk-P2DXF7DO.js";
10
+ } from "./chunk-4JURQ6QD.js";
11
11
  import {
12
12
  status
13
- } from "./chunk-RI4USTMC.js";
13
+ } from "./chunk-UZZNLWBR.js";
14
14
  import {
15
15
  uninstall
16
- } from "./chunk-ULKJ773Y.js";
16
+ } from "./chunk-5S377IWV.js";
17
17
  import "./chunk-US5FT2UB.js";
18
18
  import {
19
19
  AgenticMailApiError,
@@ -26,7 +26,7 @@ import {
26
26
  renderPersonaBody,
27
27
  renderSubagentMarkdown,
28
28
  resolveConfig
29
- } from "./chunk-XAW5NUNU.js";
29
+ } from "./chunk-W2R3GH54.js";
30
30
  export {
31
31
  AgenticMailApiError,
32
32
  Dispatcher,
package/dist/install.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  install,
3
3
  selectExposableAgents
4
- } from "./chunk-P2DXF7DO.js";
4
+ } from "./chunk-4JURQ6QD.js";
5
5
  import "./chunk-US5FT2UB.js";
6
- import "./chunk-XAW5NUNU.js";
6
+ import "./chunk-W2R3GH54.js";
7
7
  export {
8
8
  install,
9
9
  selectExposableAgents
package/dist/status.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  status
3
- } from "./chunk-RI4USTMC.js";
3
+ } from "./chunk-UZZNLWBR.js";
4
4
  import "./chunk-US5FT2UB.js";
5
- import "./chunk-XAW5NUNU.js";
5
+ import "./chunk-W2R3GH54.js";
6
6
  export {
7
7
  status
8
8
  };
package/dist/uninstall.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  uninstall
3
- } from "./chunk-ULKJ773Y.js";
3
+ } from "./chunk-5S377IWV.js";
4
4
  import "./chunk-US5FT2UB.js";
5
- import "./chunk-XAW5NUNU.js";
5
+ import "./chunk-W2R3GH54.js";
6
6
  export {
7
7
  uninstall
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/claudecode",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
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",
@@ -46,7 +46,7 @@
46
46
  "prepublishOnly": "npm run build"
47
47
  },
48
48
  "dependencies": {
49
- "@agenticmail/mcp": "^0.6.0",
49
+ "@agenticmail/mcp": "^0.6.1",
50
50
  "@anthropic-ai/claude-agent-sdk": "^0.2.140"
51
51
  },
52
52
  "peerDependencies": {