@agenticmail/claudecode 0.1.7 → 0.1.8
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/{chunk-3ZBSRXAK.js → chunk-5HUEJNT5.js} +28 -22
- package/dist/{chunk-XGBVWZ3M.js → chunk-JVDPUO35.js} +1 -1
- package/dist/{chunk-YWSO3QOQ.js → chunk-M5HV2M67.js} +13 -37
- package/dist/{chunk-WP2ELPRM.js → chunk-V5LH4BNZ.js} +1 -1
- package/dist/{chunk-UC63VEBP.js → chunk-VYBBCFP5.js} +1 -1
- package/dist/{chunk-N43A7EQB.js → chunk-XHDRGX46.js} +4 -4
- package/dist/cli.js +4 -4
- package/dist/dispatcher-bin.js +2 -2
- package/dist/dispatcher.js +2 -2
- package/dist/http-routes.js +5 -5
- package/dist/index.js +6 -6
- package/dist/install.js +2 -2
- package/dist/status.js +2 -2
- package/dist/uninstall.js +2 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
listAccounts,
|
|
3
3
|
renderPersonaBody,
|
|
4
4
|
resolveConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-M5HV2M67.js";
|
|
6
6
|
|
|
7
7
|
// src/persona-loader.ts
|
|
8
8
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -82,25 +82,25 @@ async function runWorker(query, persona, userPrompt, agent, mcpServerName, mcpCo
|
|
|
82
82
|
env: mcpEnv
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
85
|
+
// No `allowedTools` restriction.
|
|
86
|
+
//
|
|
87
|
+
// Earlier versions of the dispatcher locked workers to MCP-only tools
|
|
88
|
+
// ("you operate an email account, not a developer environment"). That
|
|
89
|
+
// was the wrong design: AgenticMail agents are real Claude Code
|
|
90
|
+
// subagents running under the host's OAuth, and the work humans
|
|
91
|
+
// delegate to them (write code, run tests, do research, edit files)
|
|
92
|
+
// demands the full native toolset (Read, Write, Edit, Bash, Glob,
|
|
93
|
+
// Grep, WebFetch, WebSearch, NotebookEdit, …). Restricting them
|
|
94
|
+
// turned "Zephyr implements the game" into "Zephyr emails source
|
|
95
|
+
// code as plaintext and the human has to copy-paste it" — which
|
|
96
|
+
// defeats the point of having agents in the first place.
|
|
97
|
+
//
|
|
98
|
+
// Omitting allowedTools lets the SDK fall through to its defaults
|
|
99
|
+
// (all built-in tools + every tool exposed by the MCP servers we
|
|
100
|
+
// declare above). Outbound mail is still guarded by AgenticMail's
|
|
101
|
+
// own outbound guard (HIGH-severity sends held for owner approval)
|
|
102
|
+
// and the worker is sandboxed by Claude Code's permission system
|
|
103
|
+
// just like any other subagent.
|
|
104
104
|
permissionMode: "bypassPermissions",
|
|
105
105
|
abortController: abortSignal ? wrapSignal(abortSignal) : void 0
|
|
106
106
|
};
|
|
@@ -172,8 +172,14 @@ function newMailPrompt(agent, event) {
|
|
|
172
172
|
` When in doubt, stay silent \u2014 over-replying creates noise. Better to let`,
|
|
173
173
|
` the right teammate take the turn than to step on theirs.`,
|
|
174
174
|
``,
|
|
175
|
-
`5. **If it's your turn \u2014
|
|
176
|
-
`
|
|
175
|
+
`5. **If it's your turn \u2014 do the actual work, THEN reply-all about it.**`,
|
|
176
|
+
` You have full native tools: Read, Write, Edit, Bash, Glob, Grep, WebFetch,`,
|
|
177
|
+
` WebSearch, NotebookEdit, etc. If the task is "implement X", write the file`,
|
|
178
|
+
` with Write or Edit and verify with Bash \u2014 do NOT paste source code into an`,
|
|
179
|
+
` email body and call it shipped. The thread is for COORDINATION ("done,`,
|
|
180
|
+
` see ./foo.py, runs with \`python3 foo.py\`"); the filesystem is for`,
|
|
181
|
+
` DELIVERABLES. Then:`,
|
|
182
|
+
` reply_email({ uid: ${uid ?? "<uid>"}, replyAll: true, text: "...", _account: "${agent.name}" })`,
|
|
177
183
|
` Sign with your name. Be substantive but concise. If you are handing off`,
|
|
178
184
|
` to the next teammate, name them explicitly in your reply ("Orion \u2014 over to you, please \u2026").`,
|
|
179
185
|
``,
|
|
@@ -121,30 +121,6 @@ function resolveConfig(opts = {}) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
// src/subagent-template.ts
|
|
124
|
-
var ESSENTIAL_TOOL_NAMES = [
|
|
125
|
-
"whoami",
|
|
126
|
-
"list_inbox",
|
|
127
|
-
"read_email",
|
|
128
|
-
"send_email",
|
|
129
|
-
"reply_email",
|
|
130
|
-
"search_emails",
|
|
131
|
-
"list_agents",
|
|
132
|
-
"message_agent",
|
|
133
|
-
// call_agent is the one-shot RPC primitive — sync request, sync answer.
|
|
134
|
-
// For multi-step coordination use the thread pattern (send_email with
|
|
135
|
-
// CC + reply_email with replyAll) instead.
|
|
136
|
-
"call_agent",
|
|
137
|
-
// wait_for_email is the thread-coordination primitive: block until a
|
|
138
|
-
// specific reply lands in your inbox (filter by from / subject /
|
|
139
|
-
// inReplyTo / participants). Essential for delegate-then-wait flows;
|
|
140
|
-
// making subagents discover it via request_tools would be a usability
|
|
141
|
-
// disaster for the most common coordination pattern.
|
|
142
|
-
"wait_for_email",
|
|
143
|
-
"check_tasks",
|
|
144
|
-
// Meta-tools — these unlock the other ~50 tools on demand.
|
|
145
|
-
"request_tools",
|
|
146
|
-
"invoke"
|
|
147
|
-
];
|
|
148
124
|
var MANAGED_BY_MARKER = "@agenticmail/claudecode";
|
|
149
125
|
function yamlQuote(s) {
|
|
150
126
|
const cleaned = s.replace(/[\r\n]+/g, " ").replace(/\s+/g, " ").trim();
|
|
@@ -182,14 +158,15 @@ function renderPersonaBody(input) {
|
|
|
182
158
|
"",
|
|
183
159
|
"## Operating instructions",
|
|
184
160
|
"",
|
|
185
|
-
`You
|
|
161
|
+
`You have access to TWO complementary toolsets:`,
|
|
186
162
|
"",
|
|
187
|
-
|
|
188
|
-
`- \`${tool("invoke")}\` \u2014 Calls any AgenticMail tool by name with structured args. Example: \`${tool("invoke")}({ tool: "manage_signatures", args: { action: "create", name: "default", body: "\u2014\\n${agent.name}" }, _account: "${agent.name}" })\`.`,
|
|
163
|
+
`1. **AgenticMail MCP tools** (\`${tool("*")}\`) \u2014 your mailbox, contacts, tasks, signatures, drafts, SMS, agent coordination. The full ~62-tool surface; the most common ones (\`${tool("list_inbox")}\`, \`${tool("send_email")}\`, \`${tool("reply_email")}\`, \`${tool("search_emails")}\`, \`${tool("call_agent")}\`, \`${tool("wait_for_email")}\`, \u2026) are pre-loaded. Anything else is reachable via the meta-tools \`${tool("request_tools")}\` (discover) + \`${tool("invoke")}\` (call by name).`,
|
|
189
164
|
"",
|
|
190
|
-
|
|
165
|
+
`2. **Native Claude Code tools** \u2014 Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, NotebookEdit, and friends. The same toolset the host session has. Use them when the work actually involves files, code, the shell, or the web \u2014 DO NOT paste source code into an email when you could write the file yourself and tell the team "shipped to ./void_fall.py, runs with python3 void_fall.py". You are a real agent doing real work, not a paste-buffer.`,
|
|
191
166
|
"",
|
|
192
|
-
|
|
167
|
+
`**On EVERY MCP call you make \u2014 pre-loaded OR via \`invoke\` \u2014 you MUST pass \`_account: "${agent.name}"\`.** This tells the MCP server to authenticate as you, not as the integration's bridge identity. Without it, you'd be reading the bridge's empty inbox instead of your own, sending mail from the wrong address, and bypassing your owner's expectation that the agent named "${agent.name}" did the work. Native tools (Read/Write/Bash/etc.) don't need \`_account\` \u2014 they're not MCP.`,
|
|
168
|
+
"",
|
|
169
|
+
`Common MCP examples:`,
|
|
193
170
|
"",
|
|
194
171
|
"```",
|
|
195
172
|
`${tool("list_inbox")}({ _account: "${agent.name}", limit: 10 })`,
|
|
@@ -230,14 +207,16 @@ function renderPersonaBody(input) {
|
|
|
230
207
|
"",
|
|
231
208
|
"## What you can do",
|
|
232
209
|
"",
|
|
233
|
-
`Anything
|
|
210
|
+
`Anything a real Claude Code agent can do, scoped to your AgenticMail identity. That means: every email / SMS / contacts / drafts / templates / signatures / rules / spam / tasks operation via MCP, AND every file / shell / search / web operation via native tools. If the work involves code \u2014 write the file, run it, debug it, commit it. If the work involves research \u2014 fetch the URLs, read the pages, summarise. Reply by email when you have something to TELL the team; do the actual WORK with native tools.`,
|
|
211
|
+
"",
|
|
212
|
+
`If a specific AgenticMail tool isn't already loaded, call \`${tool("request_tools")}\` to find it, then \`${tool("invoke")}\` to call it. Never ask for permission to use a tool \u2014 just use it.`,
|
|
234
213
|
"",
|
|
235
214
|
"## Hard rules",
|
|
236
215
|
"",
|
|
237
|
-
`- **Always pass \`_account: "${agent.name}"\`** on every \`${tool("*")}\` call
|
|
238
|
-
`- **Do
|
|
216
|
+
`- **Always pass \`_account: "${agent.name}"\`** on every \`${tool("*")}\` MCP call. (Native tools \u2014 Read/Write/Bash/etc. \u2014 don't need it.)`,
|
|
217
|
+
`- **Do real work with the right tool.** If a teammate asks you to implement something, write the file with Write or Edit \u2014 do not paste source code into an email body and call it done. The mail thread is for coordination ("shipped at \`./void_fall.py\`, runs with \`python3 void_fall.py\`, here's a 2-line summary"); the filesystem is for deliverables.`,
|
|
239
218
|
`- **Do not invent email content.** If you didn't read a real message, do not summarise one. If you don't know the answer, check your inbox / contacts / tasks first.`,
|
|
240
|
-
`- **Do not impersonate other agents.** You are ${agent.name}, and only ${agent.name}. If the user asks you to also do something as "writer" or "researcher", suggest that they call those agents directly
|
|
219
|
+
`- **Do not impersonate other agents.** You are ${agent.name}, and only ${agent.name}. If the user asks you to also do something as "writer" or "researcher", suggest that they call those agents directly \u2014 don't pass \`_account: "writer"\` to act as writer; that would falsify the From: header in any outgoing mail.`,
|
|
241
220
|
`- **Respect outbound guard.** If a send is blocked by the AgenticMail outbound guard, tell the user in plain English \u2014 recipient, subject, the specific warnings \u2014 and ask them to approve. Do NOT rewrite the email to evade detection.`,
|
|
242
221
|
"",
|
|
243
222
|
"## Output style",
|
|
@@ -247,15 +226,12 @@ function renderPersonaBody(input) {
|
|
|
247
226
|
].filter((line) => line !== void 0).join("\n");
|
|
248
227
|
}
|
|
249
228
|
function renderSubagentMarkdown(input) {
|
|
250
|
-
const { name, agent
|
|
251
|
-
const tool = (n) => `mcp__${mcpServerName}__${n}`;
|
|
229
|
+
const { name, agent } = input;
|
|
252
230
|
const description = describeAgent(agent);
|
|
253
|
-
const allowedTools = ESSENTIAL_TOOL_NAMES.map((n) => tool(n)).join(", ");
|
|
254
231
|
const frontmatter = [
|
|
255
232
|
"---",
|
|
256
233
|
`name: ${name}`,
|
|
257
234
|
`description: ${yamlQuote(description)}`,
|
|
258
|
-
`tools: ${allowedTools}`,
|
|
259
235
|
`model: inherit`,
|
|
260
236
|
`# managed-by: ${MANAGED_BY_MARKER}`,
|
|
261
237
|
`# agenticmail-agent-id: ${agent.id}`,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
install
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V5LH4BNZ.js";
|
|
4
4
|
import {
|
|
5
5
|
status
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VYBBCFP5.js";
|
|
7
7
|
import {
|
|
8
8
|
uninstall
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JVDPUO35.js";
|
|
10
10
|
import {
|
|
11
11
|
AgenticMailApiError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M5HV2M67.js";
|
|
13
13
|
|
|
14
14
|
// src/http-routes.ts
|
|
15
15
|
import { Router } from "express";
|
package/dist/cli.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
install
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-V5LH4BNZ.js";
|
|
5
5
|
import {
|
|
6
6
|
status
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VYBBCFP5.js";
|
|
8
8
|
import {
|
|
9
9
|
uninstall
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JVDPUO35.js";
|
|
11
11
|
import "./chunk-US5FT2UB.js";
|
|
12
12
|
import {
|
|
13
13
|
AgenticMailApiError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-M5HV2M67.js";
|
|
15
15
|
|
|
16
16
|
// src/cli.ts
|
|
17
17
|
var GREEN = (s) => `\x1B[32m${s}\x1B[0m`;
|
package/dist/dispatcher-bin.js
CHANGED
package/dist/dispatcher.js
CHANGED
package/dist/http-routes.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createIntegrationRoutes
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XHDRGX46.js";
|
|
4
|
+
import "./chunk-V5LH4BNZ.js";
|
|
5
|
+
import "./chunk-VYBBCFP5.js";
|
|
6
|
+
import "./chunk-JVDPUO35.js";
|
|
7
7
|
import "./chunk-US5FT2UB.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-M5HV2M67.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-
|
|
4
|
+
} from "./chunk-5HUEJNT5.js";
|
|
5
5
|
import {
|
|
6
6
|
createIntegrationRoutes
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XHDRGX46.js";
|
|
8
8
|
import {
|
|
9
9
|
install
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-V5LH4BNZ.js";
|
|
11
11
|
import {
|
|
12
12
|
status
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VYBBCFP5.js";
|
|
14
14
|
import {
|
|
15
15
|
uninstall
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JVDPUO35.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-
|
|
29
|
+
} from "./chunk-M5HV2M67.js";
|
|
30
30
|
export {
|
|
31
31
|
AgenticMailApiError,
|
|
32
32
|
Dispatcher,
|
package/dist/install.js
CHANGED
package/dist/status.js
CHANGED
package/dist/uninstall.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticmail/claudecode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
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",
|