@atomicmail/langchain 0.3.14

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.
Files changed (138) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -0
  3. package/esm/_dnt.polyfills.d.ts +101 -0
  4. package/esm/_dnt.polyfills.d.ts.map +1 -0
  5. package/esm/_dnt.polyfills.js +127 -0
  6. package/esm/langchain/mod.d.ts +23 -0
  7. package/esm/langchain/mod.d.ts.map +1 -0
  8. package/esm/langchain/mod.js +157 -0
  9. package/esm/lib/agent/auth/agent-auth-http.d.ts +26 -0
  10. package/esm/lib/agent/auth/agent-auth-http.d.ts.map +1 -0
  11. package/esm/lib/agent/auth/agent-auth-http.js +85 -0
  12. package/esm/lib/agent/auth/agent-jwt.d.ts +12 -0
  13. package/esm/lib/agent/auth/agent-jwt.d.ts.map +1 -0
  14. package/esm/lib/agent/auth/agent-jwt.js +27 -0
  15. package/esm/lib/agent/auth/agent-pow.d.ts +5 -0
  16. package/esm/lib/agent/auth/agent-pow.d.ts.map +1 -0
  17. package/esm/lib/agent/auth/agent-pow.js +49 -0
  18. package/esm/lib/agent/jmap/agent-help-content.d.ts +2 -0
  19. package/esm/lib/agent/jmap/agent-help-content.d.ts.map +1 -0
  20. package/esm/lib/agent/jmap/agent-help-content.js +2 -0
  21. package/esm/lib/agent/jmap/agent-jmap-blob-limits.d.ts +27 -0
  22. package/esm/lib/agent/jmap/agent-jmap-blob-limits.d.ts.map +1 -0
  23. package/esm/lib/agent/jmap/agent-jmap-blob-limits.js +166 -0
  24. package/esm/lib/agent/jmap/agent-jmap-blob-upload.d.ts +24 -0
  25. package/esm/lib/agent/jmap/agent-jmap-blob-upload.d.ts.map +1 -0
  26. package/esm/lib/agent/jmap/agent-jmap-blob-upload.js +104 -0
  27. package/esm/lib/agent/jmap/agent-jmap-email-charset.d.ts +8 -0
  28. package/esm/lib/agent/jmap/agent-jmap-email-charset.d.ts.map +1 -0
  29. package/esm/lib/agent/jmap/agent-jmap-email-charset.js +61 -0
  30. package/esm/lib/agent/jmap/agent-jmap-verify.d.ts +9 -0
  31. package/esm/lib/agent/jmap/agent-jmap-verify.d.ts.map +1 -0
  32. package/esm/lib/agent/jmap/agent-jmap-verify.js +50 -0
  33. package/esm/lib/agent/jmap/agent-jmap.d.ts +89 -0
  34. package/esm/lib/agent/jmap/agent-jmap.d.ts.map +1 -0
  35. package/esm/lib/agent/jmap/agent-jmap.js +373 -0
  36. package/esm/lib/agent/jmap/agent-vars.d.ts +30 -0
  37. package/esm/lib/agent/jmap/agent-vars.d.ts.map +1 -0
  38. package/esm/lib/agent/jmap/agent-vars.js +96 -0
  39. package/esm/lib/agent/jmap/help-content/auth.d.ts +2 -0
  40. package/esm/lib/agent/jmap/help-content/auth.d.ts.map +1 -0
  41. package/esm/lib/agent/jmap/help-content/auth.js +33 -0
  42. package/esm/lib/agent/jmap/help-content/cron.d.ts +6 -0
  43. package/esm/lib/agent/jmap/help-content/cron.d.ts.map +1 -0
  44. package/esm/lib/agent/jmap/help-content/cron.js +159 -0
  45. package/esm/lib/agent/jmap/help-content/index.d.ts +6 -0
  46. package/esm/lib/agent/jmap/help-content/index.d.ts.map +1 -0
  47. package/esm/lib/agent/jmap/help-content/index.js +61 -0
  48. package/esm/lib/agent/jmap/help-content/installation.d.ts +2 -0
  49. package/esm/lib/agent/jmap/help-content/installation.d.ts.map +1 -0
  50. package/esm/lib/agent/jmap/help-content/installation.js +47 -0
  51. package/esm/lib/agent/jmap/help-content/jmap-cheatsheet.d.ts +2 -0
  52. package/esm/lib/agent/jmap/help-content/jmap-cheatsheet.d.ts.map +1 -0
  53. package/esm/lib/agent/jmap/help-content/jmap-cheatsheet.js +230 -0
  54. package/esm/lib/agent/jmap/help-content/multi-account.d.ts +2 -0
  55. package/esm/lib/agent/jmap/help-content/multi-account.d.ts.map +1 -0
  56. package/esm/lib/agent/jmap/help-content/multi-account.js +49 -0
  57. package/esm/lib/agent/jmap/help-content/overview.d.ts +2 -0
  58. package/esm/lib/agent/jmap/help-content/overview.d.ts.map +1 -0
  59. package/esm/lib/agent/jmap/help-content/overview.js +49 -0
  60. package/esm/lib/agent/jmap/help-content/presets.d.ts +2 -0
  61. package/esm/lib/agent/jmap/help-content/presets.d.ts.map +1 -0
  62. package/esm/lib/agent/jmap/help-content/presets.js +51 -0
  63. package/esm/lib/agent/jmap/help-content/tools.d.ts +2 -0
  64. package/esm/lib/agent/jmap/help-content/tools.d.ts.map +1 -0
  65. package/esm/lib/agent/jmap/help-content/tools.js +49 -0
  66. package/esm/lib/agent/jmap/help-content/troubleshooting.d.ts +2 -0
  67. package/esm/lib/agent/jmap/help-content/troubleshooting.d.ts.map +1 -0
  68. package/esm/lib/agent/jmap/help-content/troubleshooting.js +65 -0
  69. package/esm/lib/agent/session/agent-credentials-store.d.ts +45 -0
  70. package/esm/lib/agent/session/agent-credentials-store.d.ts.map +1 -0
  71. package/esm/lib/agent/session/agent-credentials-store.js +121 -0
  72. package/esm/lib/agent/session/agent-resolve-config.d.ts +29 -0
  73. package/esm/lib/agent/session/agent-resolve-config.d.ts.map +1 -0
  74. package/esm/lib/agent/session/agent-resolve-config.js +71 -0
  75. package/esm/lib/agent/session/agent-session-for-dir.d.ts +8 -0
  76. package/esm/lib/agent/session/agent-session-for-dir.d.ts.map +1 -0
  77. package/esm/lib/agent/session/agent-session-for-dir.js +33 -0
  78. package/esm/lib/agent/session/agent-session.d.ts +89 -0
  79. package/esm/lib/agent/session/agent-session.d.ts.map +1 -0
  80. package/esm/lib/agent/session/agent-session.js +320 -0
  81. package/esm/lib/agent/session/inbox-id-to-mailbox-email.d.ts +6 -0
  82. package/esm/lib/agent/session/inbox-id-to-mailbox-email.d.ts.map +1 -0
  83. package/esm/lib/agent/session/inbox-id-to-mailbox-email.js +24 -0
  84. package/esm/lib/core/consts.d.ts +17 -0
  85. package/esm/lib/core/consts.d.ts.map +1 -0
  86. package/esm/lib/core/consts.js +28 -0
  87. package/esm/lib/core/messages.d.ts +6 -0
  88. package/esm/lib/core/messages.d.ts.map +1 -0
  89. package/esm/lib/core/messages.js +19 -0
  90. package/esm/lib/core/read-npm-package-readme.d.ts +6 -0
  91. package/esm/lib/core/read-npm-package-readme.d.ts.map +1 -0
  92. package/esm/lib/core/read-npm-package-readme.js +81 -0
  93. package/esm/lib/core/shared-assets.d.ts +6 -0
  94. package/esm/lib/core/shared-assets.d.ts.map +1 -0
  95. package/esm/lib/core/shared-assets.js +46 -0
  96. package/esm/lib/core/types.d.ts +2 -0
  97. package/esm/lib/core/types.d.ts.map +1 -0
  98. package/esm/lib/core/types.js +2 -0
  99. package/esm/lib/core/utils.d.ts +12 -0
  100. package/esm/lib/core/utils.d.ts.map +1 -0
  101. package/esm/lib/core/utils.js +29 -0
  102. package/esm/lib/mod.d.ts +20 -0
  103. package/esm/lib/mod.d.ts.map +1 -0
  104. package/esm/lib/mod.js +19 -0
  105. package/esm/lib/network/auth-client.d.ts +57 -0
  106. package/esm/lib/network/auth-client.d.ts.map +1 -0
  107. package/esm/lib/network/auth-client.js +210 -0
  108. package/esm/package.json +3 -0
  109. package/package.json +51 -0
  110. package/presets/list_inbox.json +46 -0
  111. package/presets/reply.json +97 -0
  112. package/presets/send_mail.json +70 -0
  113. package/presets/send_mail_attachment.json +92 -0
  114. package/presets/send_mail_blob_attachment.json +74 -0
  115. package/shared/consts.json +11 -0
  116. package/shared/fixtures/pow_vectors.json +32 -0
  117. package/shared/help/fragments/inbox_cron_agent_prompt.md +1 -0
  118. package/shared/help/fragments/post_register_cron_reminder.md +5 -0
  119. package/shared/help/readme_stub.md +3 -0
  120. package/shared/help/topics/auth.md +8 -0
  121. package/shared/help/topics/cron.md +217 -0
  122. package/shared/help/topics/installation.md +35 -0
  123. package/shared/help/topics/jmap_cheatsheet.md +19 -0
  124. package/shared/help/topics/multi_account.md +9 -0
  125. package/shared/help/topics/overview.md +27 -0
  126. package/shared/help/topics/presets.md +12 -0
  127. package/shared/help/topics/tools.md +16 -0
  128. package/shared/help/topics/troubleshooting.md +6 -0
  129. package/shared/manifest.json +31 -0
  130. package/shared/messages/errors.json +68 -0
  131. package/shared/messages/hints.json +8 -0
  132. package/shared/presets/list_inbox.json +46 -0
  133. package/shared/presets/reply.json +97 -0
  134. package/shared/presets/send_mail.json +70 -0
  135. package/shared/presets/send_mail_attachment.json +92 -0
  136. package/shared/presets/send_mail_blob_attachment.json +74 -0
  137. package/shared/skill/SKILL.template.md +202 -0
  138. package/shared/skill/manifest.json +89 -0
@@ -0,0 +1,159 @@
1
+ // Help topic: post-register inbox polling (agent invocation, not raw CLI cron).
2
+ /** Prompt for hourly inbox jobs — agent fetches mail and stays available for follow-up. */
3
+ export const INBOX_CRON_AGENT_PROMPT = "Use Atomic Mail to fetch my inbox (MCP jmap_request with ops_file " +
4
+ "list_inbox.json, or atomicmail jmap_request --ops-file list_inbox.json). " +
5
+ "Summarize new messages, highlight what needs a reply, and stay available — " +
6
+ "I may ask you to reply, forward, search, or dig into something important.";
7
+ /** Short block — embed in MCP instructions, register tool text, overview workflow. */
8
+ export const postRegisterCronReminder = `\
9
+ AFTER REGISTER — INBOX POLLING
10
+ Choose the path that matches your runtime (help topic "cron"):
11
+ • Native cron (OpenClaw, Hermes, atomic-agent, …): schedule an hourly AGENT turn with list_inbox.json in the prompt; wire MCP or AgentSkill into that agent. Do NOT cron atomicmail jmap_request alone.
12
+ • No native cron (Claude, Pi, Cursor, …): do NOT work around this (no wrapper scripts, OS crontab/LaunchAgent, or cross-platform scheduling). Ask your operator to set up polling on a capable host, or remind them to fetch mail manually when needed.
13
+ • Forbidden: register in one runtime and schedule the cron job on another.`;
14
+ export const helpTopicCron = `\
15
+ # Inbox polling (after register)
16
+
17
+ Registration only creates credentials. For a useful inbox integration, inbound
18
+ mail should be fetched and triaged about once per hour between interactive
19
+ sessions.
20
+
21
+ **Choose the path that matches your runtime — do not mix platforms.**
22
+
23
+ ## If your host supports scheduled jobs
24
+
25
+ If you have a **native** way to enable cron or recurring agent turns (OpenClaw,
26
+ Hermes, atomic-agent, and similar hosts), set up an hourly **agent** job after
27
+ the first successful \`register\`. The job must **invoke an AI agent** (not just the
28
+ Atomic Mail CLI) to fetch and triage mail. Wire Atomic Mail MCP or AgentSkill
29
+ into that agent before scheduling.
30
+
31
+ The scheduled turn should call preset **list_inbox.json** (\`Email/query\` +
32
+ \`Email/get\`, latest 50; built-ins \`$ACCOUNT_ID\`, \`$INBOX_MAILBOX_ID\` — no extra
33
+ \`vars\`).
34
+
35
+ ## If your host does **not** support scheduled jobs
36
+
37
+ Examples: Claude, Pi, Cursor, and other chat or terminal agents without a cron
38
+ API.
39
+
40
+ **Do not spend tokens trying to work around this** — no wrapper scripts, OS
41
+ crontab/LaunchAgent setup, or scheduling on a different platform on the agent's
42
+ behalf.
43
+
44
+ After a successful \`register\`, do one of the following:
45
+
46
+ 1. **Ask your operator** to set up hourly inbox polling on a host that supports
47
+ it (share the examples below), **or**
48
+ 2. **Remind your operator** to fetch mail manually when they need updates
49
+ (\`jmap_request\` with \`list_inbox.json\`, or \`atomicmail jmap_request
50
+ --ops-file list_inbox.json\`).
51
+
52
+ ## Forbidden: cross-platform scheduling
53
+
54
+ Do **not** register in one runtime and schedule the cron job on another. Example
55
+ of forbidden behavior: Pi runs \`register\`, then creates an OpenClaw cron job.
56
+ Either the same runtime that registered schedules polling, or the operator
57
+ schedules it themselves on a capable host.
58
+
59
+ ## What not to do (any runtime)
60
+
61
+ - **Raw CLI in crontab** — \`atomicmail jmap_request --ops-file list_inbox.json\`
62
+ alone only fetches JSON; no agent runs and nothing prompts the operator to
63
+ reply.
64
+ - **Headless one-shot CLIs** — \`claude -p\`, \`pi -p\`, \`agent -p\`, \`codex exec\`,
65
+ \`gemini -p\` print and exit; the operator cannot continue the thread to reply
66
+ or forward.
67
+
68
+ ## Agent prompt (use in scheduled jobs or manual fetches)
69
+
70
+ \`\`\`text
71
+ ${INBOX_CRON_AGENT_PROMPT}
72
+ \`\`\`
73
+
74
+ ## Scheduling examples (for capable hosts or operators)
75
+
76
+ | Your setup | Recommended approach |
77
+ | --- | --- |
78
+ | OpenClaw gateway | Built-in \`openclaw cron\` |
79
+ | Hermes Agent | Install skill → \`/suggestions\` blueprint after \`register\` (or manual \`hermes cron\`) |
80
+ | Atomic Bot (atomicbot.ai) | Same as OpenClaw or Hermes host |
81
+ | atomic-agent | Built-in \`atomic-agent task create\` |
82
+ | No native cron (Claude, Pi, Cursor, …) | Ask operator to schedule on a capable host, or remind them to fetch manually |
83
+
84
+ ### OpenClaw
85
+
86
+ Docs: https://docs.openclaw.ai/automation/cron-jobs
87
+
88
+ \`\`\`bash
89
+ openclaw cron add \\
90
+ --name "atomicmail-inbox" \\
91
+ --cron "0 * * * *" \\
92
+ --session isolated \\
93
+ --message "${INBOX_CRON_AGENT_PROMPT}" \\
94
+ --announce
95
+ \`\`\`
96
+
97
+ Manage: \`openclaw cron list\` · test: \`openclaw cron run <job-id>\`
98
+
99
+ ### Hermes Agent
100
+
101
+ Skill blueprints: https://hermes-agent.nousresearch.com/docs/developer-guide/creating-skills
102
+
103
+ Cron (manual fallback): https://hermes-agent.nousresearch.com/docs/user-guide/features/cron
104
+
105
+ **Recommended:** Install the Atomic Mail Hermes skill → after \`register\`, accept
106
+ the hourly inbox blueprint via \`/suggestions\` (\`no_agent: false\`,
107
+ \`list_inbox.json\`, \`deliver: origin\`). Do not cron raw \`jmap_request\` or use
108
+ \`--no-agent\`.
109
+
110
+ **Credentials:** Default \`~/.hermes/atomicmail\` (not \`~/.atomicmail\`). The skill
111
+ launcher sets \`ATOMIC_MAIL_CREDENTIALS_DIR\` when unset; override via env or
112
+ \`atomicmail.credentials_dir\` config. Use \`--credentials-dir\` only for
113
+ multi-account setups.
114
+
115
+ **Manual fallback:**
116
+
117
+ \`\`\`bash
118
+ hermes cron create "0 * * * *" \\
119
+ "${INBOX_CRON_AGENT_PROMPT}" \\
120
+ --name "atomicmail-inbox" \\
121
+ --deliver origin
122
+ \`\`\`
123
+
124
+ Manage: \`hermes cron list\` · test: \`hermes cron run <job-id>\`
125
+
126
+ ### atomic-agent
127
+
128
+ \`\`\`bash
129
+ atomic-agent task create \\
130
+ --cron "0 * * * *" \\
131
+ --message "${INBOX_CRON_AGENT_PROMPT}"
132
+ \`\`\`
133
+
134
+ Manage: \`atomic-agent task list\`
135
+
136
+ ## Verify setup
137
+
138
+ 1. \`register\` succeeded; Atomic Mail MCP or AgentSkill is available to the agent.
139
+ 2. Run the agent prompt **once manually**; confirm inbox fetch and follow-up work.
140
+ 3. Confirm the job is registered (\`openclaw cron list\`, \`hermes cron list\`,
141
+ \`atomic-agent task list\`).
142
+
143
+ ## For operators: OS scheduling on terminal hosts
144
+
145
+ This section is **operator documentation**, not an agent obligation. Chat agents
146
+ without native cron should **not** attempt OS scheduling themselves.
147
+
148
+ If you (the operator) run a **terminal CLI agent** without OpenClaw, Hermes, or
149
+ similar, the scheduler must **start an interactive session** with the agent
150
+ prompt — not call \`atomicmail\` directly.
151
+
152
+ | Agent | Start interactively | Avoid for inbox polling |
153
+ | --- | --- | --- |
154
+ | Claude Code | \`claude "prompt"\` | \`claude -p\` |
155
+ | Pi | \`pi "prompt"\` | \`pi -p\` |
156
+ | Cursor CLI | \`agent "prompt"\` | \`agent -p\` |
157
+
158
+ OS options: wrapper script + user crontab, macOS LaunchAgent, or Linux systemd
159
+ user timer — launching a terminal emulator with an interactive agent session.`;
@@ -0,0 +1,6 @@
1
+ export declare const HELP_TOPICS: Record<string, string>;
2
+ export declare const HELP_TOPIC_LIST: string[];
3
+ export declare function normalizeHelpTopic(topic: string): string;
4
+ export type HelpRuntime = "mcp" | "skill";
5
+ export declare function getHelp(topic?: string, runtime?: HelpRuntime): Promise<string>;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/agent/jmap/help-content/index.ts"],"names":[],"mappings":"AAiDA,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQ7B,CAAC;AAEnB,eAAO,MAAM,eAAe,UAEG,CAAC;AAMhC,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,CAAC;AAE1C,wBAAsB,OAAO,CAC3B,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,GAAE,WAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAgBjB"}
@@ -0,0 +1,61 @@
1
+ // Assembled help topics for MCP `help` and AgentSkill `help`.
2
+ import { readNpmPackageReadme } from "../../../core/read-npm-package-readme.js";
3
+ import { tryReadSharedJson, tryReadSharedText, } from "../../../core/shared-assets.js";
4
+ import { helpTopicAuth } from "./auth.js";
5
+ import { helpTopicCron } from "./cron.js";
6
+ import { helpTopicInstallation } from "./installation.js";
7
+ import { helpTopicJmapCheatsheet } from "./jmap-cheatsheet.js";
8
+ import { helpTopicMultiAccount } from "./multi-account.js";
9
+ import { helpTopicOverview } from "./overview.js";
10
+ import { helpTopicPresets } from "./presets.js";
11
+ import { helpTopicTools } from "./tools.js";
12
+ import { helpTopicTroubleshooting } from "./troubleshooting.js";
13
+ const manifest = tryReadSharedJson("manifest.json");
14
+ const errors = tryReadSharedJson("messages/errors.json");
15
+ const fallbackTopics = {
16
+ overview: helpTopicOverview,
17
+ installation: helpTopicInstallation,
18
+ auth: helpTopicAuth,
19
+ jmap_cheatsheet: helpTopicJmapCheatsheet,
20
+ tools: helpTopicTools,
21
+ presets: helpTopicPresets,
22
+ cron: helpTopicCron,
23
+ multi_account: helpTopicMultiAccount,
24
+ troubleshooting: helpTopicTroubleshooting,
25
+ };
26
+ const DEFAULT_README_STUB = 'Topic "readme" returns a built-in stub in AgentSkill runtimes. From MCP, topic "readme" returns the package README.md.';
27
+ const DEFAULT_UNKNOWN_TOPIC = "Unknown topic \"{topic}\". Available topics: {topics}, readme";
28
+ export const HELP_TOPICS = manifest
29
+ ? Object.fromEntries(manifest.help.topic_order.map((topic) => {
30
+ const text = tryReadSharedText(`${manifest.help.topics_dir}/${topic}.md`) ??
31
+ fallbackTopics[topic];
32
+ return [topic, text];
33
+ }))
34
+ : fallbackTopics;
35
+ export const HELP_TOPIC_LIST = manifest
36
+ ? [...manifest.help.topic_order]
37
+ : Object.keys(fallbackTopics);
38
+ const HELP_README_STUB = manifest
39
+ ? (tryReadSharedText(manifest.help.readme_stub_path) ?? DEFAULT_README_STUB)
40
+ .trim()
41
+ : DEFAULT_README_STUB;
42
+ export function normalizeHelpTopic(topic) {
43
+ return topic.toLowerCase().replace(/[\s-]/g, "_");
44
+ }
45
+ export async function getHelp(topic, runtime = "skill") {
46
+ if (!topic) {
47
+ return HELP_TOPICS["overview"];
48
+ }
49
+ const key = normalizeHelpTopic(topic);
50
+ if (key === "readme") {
51
+ if (runtime === "mcp") {
52
+ return await readNpmPackageReadme();
53
+ }
54
+ return HELP_README_STUB;
55
+ }
56
+ const unknownTemplate = errors?.help_unknown_topic_template ??
57
+ DEFAULT_UNKNOWN_TOPIC;
58
+ return (HELP_TOPICS[key] ?? unknownTemplate)
59
+ .replace("{topic}", topic)
60
+ .replace("{topics}", HELP_TOPIC_LIST.join(", "));
61
+ }
@@ -0,0 +1,2 @@
1
+ export declare const helpTopicInstallation = "# Atomic Mail \u2014 Installation\n\n## MCP (stdio)\n\n```json\n{\n \"mcpServers\": {\n \"atomicmail\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@atomicmail/mcp\"]\n }\n }\n}\n```\n\n## AgentSkill (shell)\n\n```bash\nnpx --package=@atomicmail/agent-skill atomicmail register --username \"myagent\"\nnpx --package=@atomicmail/agent-skill atomicmail jmap_request \\\n --ops-file list_inbox.json\nnpx --package=@atomicmail/agent-skill atomicmail help\n```\n\n## After register: hourly inbox polling\n\nRegistration only creates credentials. Arrange hourly inbox polling per your\nruntime (see **cron** topic): native cron hosts schedule an hourly **agent**\nturn with `list_inbox.json`; hosts without native cron should ask the operator\nto set up polling on a capable host or remind manual fetch. Do not cron\n`atomicmail jmap_request` alone.\n\n## Shared credentials\n\nMCP and the skill use the same directory layout (default `~/.atomicmail/`):\n\n- `credentials.json`, `session.jwt`, `capability.jwt`\n\n## Overriding defaults\n\n- Endpoints: `ATOMIC_MAIL_AUTH_URL`, `ATOMIC_MAIL_API_URL`\n- Default credentials path: `ATOMIC_MAIL_CREDENTIALS_DIR` (MCP host `env`),\n `--credentials-dir` (skill), or per-call `credentials_dir` (MCP) /\n `--credentials-dir` (skill) \u2014 see **multi_account** topic\n- Optional PoW salt: `ATOMIC_MAIL_SCRYPT_SALT`";
2
+ //# sourceMappingURL=installation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../../../src/lib/agent/jmap/help-content/installation.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,s2CA6Ce,CAAC"}
@@ -0,0 +1,47 @@
1
+ // Help topic: installation (MCP help / AgentSkill help).
2
+ export const helpTopicInstallation = `\
3
+ # Atomic Mail — Installation
4
+
5
+ ## MCP (stdio)
6
+
7
+ \`\`\`json
8
+ {
9
+ "mcpServers": {
10
+ "atomicmail": {
11
+ "command": "npx",
12
+ "args": ["-y", "@atomicmail/mcp"]
13
+ }
14
+ }
15
+ }
16
+ \`\`\`
17
+
18
+ ## AgentSkill (shell)
19
+
20
+ \`\`\`bash
21
+ npx --package=@atomicmail/agent-skill atomicmail register --username "myagent"
22
+ npx --package=@atomicmail/agent-skill atomicmail jmap_request \\
23
+ --ops-file list_inbox.json
24
+ npx --package=@atomicmail/agent-skill atomicmail help
25
+ \`\`\`
26
+
27
+ ## After register: hourly inbox polling
28
+
29
+ Registration only creates credentials. Arrange hourly inbox polling per your
30
+ runtime (see **cron** topic): native cron hosts schedule an hourly **agent**
31
+ turn with \`list_inbox.json\`; hosts without native cron should ask the operator
32
+ to set up polling on a capable host or remind manual fetch. Do not cron
33
+ \`atomicmail jmap_request\` alone.
34
+
35
+ ## Shared credentials
36
+
37
+ MCP and the skill use the same directory layout (default \`~/.atomicmail/\`):
38
+
39
+ - \`credentials.json\`, \`session.jwt\`, \`capability.jwt\`
40
+
41
+ ## Overriding defaults
42
+
43
+ - Endpoints: \`ATOMIC_MAIL_AUTH_URL\`, \`ATOMIC_MAIL_API_URL\`
44
+ - Default credentials path: \`ATOMIC_MAIL_CREDENTIALS_DIR\` (MCP host \`env\`),
45
+ \`--credentials-dir\` (skill), or per-call \`credentials_dir\` (MCP) /
46
+ \`--credentials-dir\` (skill) — see **multi_account** topic
47
+ - Optional PoW salt: \`ATOMIC_MAIL_SCRYPT_SALT\``;
@@ -0,0 +1,2 @@
1
+ export declare const helpTopicJmapCheatsheet = "# JMAP cheatsheet\n\n## Capabilities (`using`)\n\nCommon URNs:\n\n- urn:ietf:params:jmap:core\n- urn:ietf:params:jmap:mail\n- urn:ietf:params:jmap:submission \u2014 required for `EmailSubmission/set`\n- urn:ietf:params:jmap:blob \u2014 required for `Blob/upload`, `Blob/get`, and\n `Blob/lookup` (see RFC 9404 \u00A74.3 for reverse blob references).\n\n## Session blob limits\n\nPer-account limits live under\n`accounts[accountId].accountCapabilities[\"urn:ietf:params:jmap:blob\"]` (see\n[RFC 9404 \u00A73.1](https://www.rfc-editor.org/rfc/rfc9404#section-3.1)):\n`maxSizeBlobSet`, `maxDataSources`, etc. MCP and AgentSkill **reject before\nPOST** when a computable `Blob/upload` payload or an `attachments` file would\nexceed advertised `maxSizeBlobSet` or `maxDataSources` (`maxSizeBlobSet:\nnull` means no client octet cap). Literal (non-`#`) `blobId` slices are not\npre-sized on the client.\n\n## `Blob/upload` shape (RFC 9404)\n\nEach `Blob/upload` `create` value is an **UploadObject**: required `data` is\nan **array** of **DataSourceObject**; each array element uses **exactly one** of\n`data:asText`, `data:asBase64`, or `blobId` (+ optional `offset` /\n`length`). Optional `type` is a media-type hint. In one batch, reference a\ncreated blob as `\"#b1\"` when the create key was `b1`.\n\n**Invalid shapes** (do not expect servers to fix these): `data` as a plain\nstring; `data:asBase64` / `data:asText` on the upload object instead of\ninside an element of the `data` array; more than one of the allowed forms inside\na single array element.\n\n**Further reading:** [RFC 9404 \u00A74.1](https://www.rfc-editor.org/rfc/rfc9404#section-4.1).\n\n**Email parts:** in `Email/set`, `attachments[]` references the blob with\n`blobId` (e.g. `\"#b1\"` for create key `b1`), plus `type` / `name` per\nRFC 8621.\n\n**Out-of-band:** RFC 8620 `POST` to `uploadUrl` (MCP `attachments` / skill\n`--attachment`) then use `$ATTACHMENT_N_BLOB_ID` in the same JMAP JSON.\n\n## Placeholders\n\n- `$ACCOUNT_ID`, `$INBOX` (full mailbox **email** for `From` / envelope; from\n `inboxId`, appending `@atomicmail.ai` or `ATOMIC_MAIL_INBOX_DOMAIN` when\n needed), `$INBOX_MAILBOX_ID` (JMAP mailbox id \u2014 use for `Email/query` \u2192\n `inMailbox` and `Email/set` \u2192 `mailboxIds`), `$UPLOAD_URL`,\n `$DOWNLOAD_URL` resolve from the session.\n- Pass `$TO`, `$SUBJECT`, `$BODY`, etc. via MCP `vars` or skill `--vars`\n (object of strings).\n\n## Bare methodCalls vs full envelope\n\nIf `ops` is **only** a methodCalls array, the default `using` is **core + mail**\nonly. For submission or blob methods, pass a full `{ \"using\", \"methodCalls\" }`\nobject (or use bundled presets, which include the right `using`).\n\n## Mailboxes\n\n```json\n[\"Mailbox/get\", {\"accountId\": \"$ACCOUNT_ID\"}, \"m0\"]\n```\n\n## Query + fetch latest inbox mail\n\n`inMailbox` must be a **mailbox id**, not the email address \u2014 use\n`$INBOX_MAILBOX_ID`.\n\n```json\n{\n \"using\": [\"urn:ietf:params:jmap:core\", \"urn:ietf:params:jmap:mail\"],\n \"methodCalls\": [\n [\"Email/query\", {\n \"accountId\": \"$ACCOUNT_ID\",\n \"filter\": {\"inMailbox\": \"$INBOX_MAILBOX_ID\"},\n \"sort\": [{\"property\": \"receivedAt\", \"isAscending\": false}],\n \"limit\": 25\n }, \"q0\"],\n [\"Email/get\", {\n \"accountId\": \"$ACCOUNT_ID\",\n \"#ids\": {\"resultOf\": \"q0\", \"name\": \"Email/query\", \"path\": \"/ids\"},\n \"properties\": [\"id\", \"threadId\", \"receivedAt\", \"from\", \"to\", \"subject\", \"preview\"]\n }, \"g0\"]\n ]\n}\n```\n\n## Send one email (draft + submit)\n\nSame pattern as bundled `send_mail.json`: `Email/set` includes\n`mailboxIds` with `$INBOX_MAILBOX_ID` as the mailbox id key, then\n`EmailSubmission/set` with `envelope`.\n\n```json\n{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\",\n \"urn:ietf:params:jmap:submission\"\n ],\n \"methodCalls\": [\n [\"Email/set\", {\n \"accountId\": \"$ACCOUNT_ID\",\n \"create\": {\n \"d1\": {\n \"mailboxIds\": {\"$INBOX_MAILBOX_ID\": true},\n \"from\": [{\"email\": \"$INBOX\"}],\n \"to\": [{\"email\": \"$TO\"}],\n \"subject\": \"$SUBJECT\",\n \"textBody\": [{\"partId\": \"b\", \"type\": \"text/plain\"}],\n \"bodyValues\": {\"b\": {\"value\": \"$BODY\"}},\n \"keywords\": {\"$draft\": true}\n }\n }\n }, \"c0\"],\n [\"EmailSubmission/set\", {\n \"accountId\": \"$ACCOUNT_ID\",\n \"create\": {\n \"s1\": {\n \"emailId\": \"#d1\",\n \"envelope\": {\n \"mailFrom\": {\"email\": \"$INBOX\"},\n \"rcptTo\": [{\"email\": \"$TO\"}]\n }\n }\n }\n }, \"c1\"]\n ]\n}\n```\n\n## Attachment in one batch (`Blob/upload` + send)\n\n`Blob/upload` must follow RFC 9404 (see **`Blob/upload` shape** above). The\nbundled preset `send_mail_attachment.json` uses base64 parts:\n`\"data\": [{ \"data:asBase64\": \"$ATTACHMENT_BASE64\" }]` plus `type`. Vars:\n`TO`, `SUBJECT`, `BODY`, `ATTACHMENT_BASE64`, `ATTACHMENT_TYPE`,\n`ATTACHMENT_NAME`.\n\nMinimal inline example (base64 for UTF-8 `Hello`; replace addresses):\n\n```json\n{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\",\n \"urn:ietf:params:jmap:submission\",\n \"urn:ietf:params:jmap:blob\"\n ],\n \"methodCalls\": [\n [\"Blob/upload\", {\n \"accountId\": \"$ACCOUNT_ID\",\n \"create\": {\"b1\": {\"data\": [{ \"data:asBase64\": \"SGVsbG8=\" }], \"type\": \"text/plain\"}}\n }, \"b0\"],\n [\"Email/set\", {\n \"accountId\": \"$ACCOUNT_ID\",\n \"create\": {\n \"m1\": {\n \"mailboxIds\": {\"$INBOX_MAILBOX_ID\": true},\n \"from\": [{\"email\": \"$INBOX\"}],\n \"to\": [{\"email\": \"$TO\"}],\n \"subject\": \"With attachment\",\n \"bodyValues\": {\"body1\": {\"value\": \"See attachment.\"}},\n \"textBody\": [{\"partId\": \"body1\", \"type\": \"text/plain\"}],\n \"attachments\": [{\"blobId\": \"#b1\", \"type\": \"text/plain\", \"name\": \"note.txt\"}]\n }\n }\n }, \"m0\"],\n [\"EmailSubmission/set\", {\n \"accountId\": \"$ACCOUNT_ID\",\n \"create\": {\n \"s1\": {\n \"emailId\": \"#m1\",\n \"envelope\": {\n \"mailFrom\": {\"email\": \"$INBOX\"},\n \"rcptTo\": [{\"email\": \"$TO\"}]\n }\n }\n }\n }, \"s0\"]\n ]\n}\n```\n\n## Attachment via RFC 8620 (`uploadUrl`) \u2014 still standard JMAP\n\nKeep `Email/set` / `EmailSubmission/set` exactly as in RFC 8621; only the blob\nbytes go out-of-band: pass MCP `attachments` or skill `--attachment PATH`\n(repeatable). The client `POST`s each file to the session `uploadUrl`, then\nsubstitutes `$ATTACHMENT_0_BLOB_ID`, `$ATTACHMENT_0_NAME`, `$ATTACHMENT_0_TYPE`\ninto your `ops` / preset before the `/jmap/` batch. Bundled\n`send_mail_blob_attachment.json` is a minimal one-file example; for several\nparts, add more objects under `attachments` referencing `$ATTACHMENT_1_BLOB_ID`, etc.\nBefore POST, the client adds `charset` (default `utf-8`) to any `Email/set`\n`text/*` body part that uses `blobId` without `charset`, per RFC 8621.\n\n## Blob/get\n\nUse only property names allowed by [RFC 9404 \u00A74.2](https://www.rfc-editor.org/rfc/rfc9404#section-4.2)\n(for example `data:asBase64`, `size`). Do not list `id` or `type` in\n`properties` \u2014 `id` is still returned on each result object.\n\n```json\n{\n \"using\": [\"urn:ietf:params:jmap:core\", \"urn:ietf:params:jmap:blob\"],\n \"methodCalls\": [\n [\"Blob/get\", {\n \"accountId\": \"$ACCOUNT_ID\",\n \"ids\": [\"$BLOB_ID\"],\n \"properties\": [\"data:asBase64\", \"size\"]\n }, \"g0\"]\n ]\n}\n```\n\n## Blob/lookup\n\nReverse lookup: which mail objects reference a blob. Parameters `typeNames`,\n`ids`; errors include `unknownDataType`. See RFC 9404 \u00A74.3.\n\n## Tips\n\n- Back-references (`#b1`, `#m1`, `#draft`) chain calls in one batch.\n- Save reusable JSON as preset files and pass `ops_file`.";
2
+ //# sourceMappingURL=jmap-cheatsheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jmap-cheatsheet.d.ts","sourceRoot":"","sources":["../../../../../src/lib/agent/jmap/help-content/jmap-cheatsheet.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,q+PAoOwB,CAAC"}
@@ -0,0 +1,230 @@
1
+ // Help topic: jmap_cheatsheet (MCP help / AgentSkill help).
2
+ export const helpTopicJmapCheatsheet = `\
3
+ # JMAP cheatsheet
4
+
5
+ ## Capabilities (\`using\`)
6
+
7
+ Common URNs:
8
+
9
+ - urn:ietf:params:jmap:core
10
+ - urn:ietf:params:jmap:mail
11
+ - urn:ietf:params:jmap:submission — required for \`EmailSubmission/set\`
12
+ - urn:ietf:params:jmap:blob — required for \`Blob/upload\`, \`Blob/get\`, and
13
+ \`Blob/lookup\` (see RFC 9404 §4.3 for reverse blob references).
14
+
15
+ ## Session blob limits
16
+
17
+ Per-account limits live under
18
+ \`accounts[accountId].accountCapabilities["urn:ietf:params:jmap:blob"]\` (see
19
+ [RFC 9404 §3.1](https://www.rfc-editor.org/rfc/rfc9404#section-3.1)):
20
+ \`maxSizeBlobSet\`, \`maxDataSources\`, etc. MCP and AgentSkill **reject before
21
+ POST** when a computable \`Blob/upload\` payload or an \`attachments\` file would
22
+ exceed advertised \`maxSizeBlobSet\` or \`maxDataSources\` (\`maxSizeBlobSet:
23
+ null\` means no client octet cap). Literal (non-\`#\`) \`blobId\` slices are not
24
+ pre-sized on the client.
25
+
26
+ ## \`Blob/upload\` shape (RFC 9404)
27
+
28
+ Each \`Blob/upload\` \`create\` value is an **UploadObject**: required \`data\` is
29
+ an **array** of **DataSourceObject**; each array element uses **exactly one** of
30
+ \`data:asText\`, \`data:asBase64\`, or \`blobId\` (+ optional \`offset\` /
31
+ \`length\`). Optional \`type\` is a media-type hint. In one batch, reference a
32
+ created blob as \`"#b1"\` when the create key was \`b1\`.
33
+
34
+ **Invalid shapes** (do not expect servers to fix these): \`data\` as a plain
35
+ string; \`data:asBase64\` / \`data:asText\` on the upload object instead of
36
+ inside an element of the \`data\` array; more than one of the allowed forms inside
37
+ a single array element.
38
+
39
+ **Further reading:** [RFC 9404 §4.1](https://www.rfc-editor.org/rfc/rfc9404#section-4.1).
40
+
41
+ **Email parts:** in \`Email/set\`, \`attachments[]\` references the blob with
42
+ \`blobId\` (e.g. \`"#b1"\` for create key \`b1\`), plus \`type\` / \`name\` per
43
+ RFC 8621.
44
+
45
+ **Out-of-band:** RFC 8620 \`POST\` to \`uploadUrl\` (MCP \`attachments\` / skill
46
+ \`--attachment\`) then use \`$ATTACHMENT_N_BLOB_ID\` in the same JMAP JSON.
47
+
48
+ ## Placeholders
49
+
50
+ - \`$ACCOUNT_ID\`, \`$INBOX\` (full mailbox **email** for \`From\` / envelope; from
51
+ \`inboxId\`, appending \`@atomicmail.ai\` or \`ATOMIC_MAIL_INBOX_DOMAIN\` when
52
+ needed), \`$INBOX_MAILBOX_ID\` (JMAP mailbox id — use for \`Email/query\` →
53
+ \`inMailbox\` and \`Email/set\` → \`mailboxIds\`), \`$UPLOAD_URL\`,
54
+ \`$DOWNLOAD_URL\` resolve from the session.
55
+ - Pass \`$TO\`, \`$SUBJECT\`, \`$BODY\`, etc. via MCP \`vars\` or skill \`--vars\`
56
+ (object of strings).
57
+
58
+ ## Bare methodCalls vs full envelope
59
+
60
+ If \`ops\` is **only** a methodCalls array, the default \`using\` is **core + mail**
61
+ only. For submission or blob methods, pass a full \`{ "using", "methodCalls" }\`
62
+ object (or use bundled presets, which include the right \`using\`).
63
+
64
+ ## Mailboxes
65
+
66
+ \`\`\`json
67
+ ["Mailbox/get", {"accountId": "$ACCOUNT_ID"}, "m0"]
68
+ \`\`\`
69
+
70
+ ## Query + fetch latest inbox mail
71
+
72
+ \`inMailbox\` must be a **mailbox id**, not the email address — use
73
+ \`$INBOX_MAILBOX_ID\`.
74
+
75
+ \`\`\`json
76
+ {
77
+ "using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail"],
78
+ "methodCalls": [
79
+ ["Email/query", {
80
+ "accountId": "$ACCOUNT_ID",
81
+ "filter": {"inMailbox": "$INBOX_MAILBOX_ID"},
82
+ "sort": [{"property": "receivedAt", "isAscending": false}],
83
+ "limit": 25
84
+ }, "q0"],
85
+ ["Email/get", {
86
+ "accountId": "$ACCOUNT_ID",
87
+ "#ids": {"resultOf": "q0", "name": "Email/query", "path": "/ids"},
88
+ "properties": ["id", "threadId", "receivedAt", "from", "to", "subject", "preview"]
89
+ }, "g0"]
90
+ ]
91
+ }
92
+ \`\`\`
93
+
94
+ ## Send one email (draft + submit)
95
+
96
+ Same pattern as bundled \`send_mail.json\`: \`Email/set\` includes
97
+ \`mailboxIds\` with \`$INBOX_MAILBOX_ID\` as the mailbox id key, then
98
+ \`EmailSubmission/set\` with \`envelope\`.
99
+
100
+ \`\`\`json
101
+ {
102
+ "using": [
103
+ "urn:ietf:params:jmap:core",
104
+ "urn:ietf:params:jmap:mail",
105
+ "urn:ietf:params:jmap:submission"
106
+ ],
107
+ "methodCalls": [
108
+ ["Email/set", {
109
+ "accountId": "$ACCOUNT_ID",
110
+ "create": {
111
+ "d1": {
112
+ "mailboxIds": {"$INBOX_MAILBOX_ID": true},
113
+ "from": [{"email": "$INBOX"}],
114
+ "to": [{"email": "$TO"}],
115
+ "subject": "$SUBJECT",
116
+ "textBody": [{"partId": "b", "type": "text/plain"}],
117
+ "bodyValues": {"b": {"value": "$BODY"}},
118
+ "keywords": {"$draft": true}
119
+ }
120
+ }
121
+ }, "c0"],
122
+ ["EmailSubmission/set", {
123
+ "accountId": "$ACCOUNT_ID",
124
+ "create": {
125
+ "s1": {
126
+ "emailId": "#d1",
127
+ "envelope": {
128
+ "mailFrom": {"email": "$INBOX"},
129
+ "rcptTo": [{"email": "$TO"}]
130
+ }
131
+ }
132
+ }
133
+ }, "c1"]
134
+ ]
135
+ }
136
+ \`\`\`
137
+
138
+ ## Attachment in one batch (\`Blob/upload\` + send)
139
+
140
+ \`Blob/upload\` must follow RFC 9404 (see **\`Blob/upload\` shape** above). The
141
+ bundled preset \`send_mail_attachment.json\` uses base64 parts:
142
+ \`"data": [{ "data:asBase64": "$ATTACHMENT_BASE64" }]\` plus \`type\`. Vars:
143
+ \`TO\`, \`SUBJECT\`, \`BODY\`, \`ATTACHMENT_BASE64\`, \`ATTACHMENT_TYPE\`,
144
+ \`ATTACHMENT_NAME\`.
145
+
146
+ Minimal inline example (base64 for UTF-8 \`Hello\`; replace addresses):
147
+
148
+ \`\`\`json
149
+ {
150
+ "using": [
151
+ "urn:ietf:params:jmap:core",
152
+ "urn:ietf:params:jmap:mail",
153
+ "urn:ietf:params:jmap:submission",
154
+ "urn:ietf:params:jmap:blob"
155
+ ],
156
+ "methodCalls": [
157
+ ["Blob/upload", {
158
+ "accountId": "$ACCOUNT_ID",
159
+ "create": {"b1": {"data": [{ "data:asBase64": "SGVsbG8=" }], "type": "text/plain"}}
160
+ }, "b0"],
161
+ ["Email/set", {
162
+ "accountId": "$ACCOUNT_ID",
163
+ "create": {
164
+ "m1": {
165
+ "mailboxIds": {"$INBOX_MAILBOX_ID": true},
166
+ "from": [{"email": "$INBOX"}],
167
+ "to": [{"email": "$TO"}],
168
+ "subject": "With attachment",
169
+ "bodyValues": {"body1": {"value": "See attachment."}},
170
+ "textBody": [{"partId": "body1", "type": "text/plain"}],
171
+ "attachments": [{"blobId": "#b1", "type": "text/plain", "name": "note.txt"}]
172
+ }
173
+ }
174
+ }, "m0"],
175
+ ["EmailSubmission/set", {
176
+ "accountId": "$ACCOUNT_ID",
177
+ "create": {
178
+ "s1": {
179
+ "emailId": "#m1",
180
+ "envelope": {
181
+ "mailFrom": {"email": "$INBOX"},
182
+ "rcptTo": [{"email": "$TO"}]
183
+ }
184
+ }
185
+ }
186
+ }, "s0"]
187
+ ]
188
+ }
189
+ \`\`\`
190
+
191
+ ## Attachment via RFC 8620 (\`uploadUrl\`) — still standard JMAP
192
+
193
+ Keep \`Email/set\` / \`EmailSubmission/set\` exactly as in RFC 8621; only the blob
194
+ bytes go out-of-band: pass MCP \`attachments\` or skill \`--attachment PATH\`
195
+ (repeatable). The client \`POST\`s each file to the session \`uploadUrl\`, then
196
+ substitutes \`$ATTACHMENT_0_BLOB_ID\`, \`$ATTACHMENT_0_NAME\`, \`$ATTACHMENT_0_TYPE\`
197
+ into your \`ops\` / preset before the \`/jmap/\` batch. Bundled
198
+ \`send_mail_blob_attachment.json\` is a minimal one-file example; for several
199
+ parts, add more objects under \`attachments\` referencing \`$ATTACHMENT_1_BLOB_ID\`, etc.
200
+ Before POST, the client adds \`charset\` (default \`utf-8\`) to any \`Email/set\`
201
+ \`text/*\` body part that uses \`blobId\` without \`charset\`, per RFC 8621.
202
+
203
+ ## Blob/get
204
+
205
+ Use only property names allowed by [RFC 9404 §4.2](https://www.rfc-editor.org/rfc/rfc9404#section-4.2)
206
+ (for example \`data:asBase64\`, \`size\`). Do not list \`id\` or \`type\` in
207
+ \`properties\` — \`id\` is still returned on each result object.
208
+
209
+ \`\`\`json
210
+ {
211
+ "using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:blob"],
212
+ "methodCalls": [
213
+ ["Blob/get", {
214
+ "accountId": "$ACCOUNT_ID",
215
+ "ids": ["$BLOB_ID"],
216
+ "properties": ["data:asBase64", "size"]
217
+ }, "g0"]
218
+ ]
219
+ }
220
+ \`\`\`
221
+
222
+ ## Blob/lookup
223
+
224
+ Reverse lookup: which mail objects reference a blob. Parameters \`typeNames\`,
225
+ \`ids\`; errors include \`unknownDataType\`. See RFC 9404 §4.3.
226
+
227
+ ## Tips
228
+
229
+ - Back-references (\`#b1\`, \`#m1\`, \`#draft\`) chain calls in one batch.
230
+ - Save reusable JSON as preset files and pass \`ops_file\`.`;
@@ -0,0 +1,2 @@
1
+ export declare const helpTopicMultiAccount = "# Multiple accounts and agents\n\nOne MCP server or CLI install can manage **several isolated inboxes** by using a\n**separate credential directory per account**. Each directory holds its own\n`credentials.json`, `session.jwt`, and `capability.jwt` (mode `0600`).\n\n## MCP (per tool call)\n\nPass optional `credentials_dir` on `register` and `jmap_request`:\n\n```json\n{ \"username\": \"alice\", \"credentials_dir\": \"~/.atomicmail/alice\" }\n{ \"ops_file\": \"list_inbox.json\", \"credentials_dir\": \"~/.atomicmail/bob\" }\n```\n\nWhen omitted, the default directory applies (`ATOMIC_MAIL_CREDENTIALS_DIR` or\n`~/.atomicmail`).\n\n## AgentSkill (per command)\n\n```bash\natomicmail register --username alice --credentials-dir ~/.atomicmail/alice\natomicmail jmap_request --credentials-dir ~/.atomicmail/bob --ops-file list_inbox.json\n```\n\n## Default vs per-call\n\n- **Default directory:** set once via `ATOMIC_MAIL_CREDENTIALS_DIR` (MCP host\n `env`) or by omitting `credentials_dir` / `--credentials-dir`.\n- **Per-call override:** use a different path on each `register` or\n `jmap_request` when the agent should act as another inbox.\n\nYou no longer need multiple MCP server entries with different `env` blocks\nunless you prefer that layout.\n\n## Register: forced vs separate directory\n\nIf the default directory already has an account and you want a **second**\ninbox, pass a **new** `credentials_dir` / `--credentials-dir` instead of\n`forced: true` / `--forced`. Use `forced` only when you intend to\n**replace** credentials in the **same** directory (after backing up).\n\n## Concurrency\n\nDo not run parallel `register` or `jmap_request` calls against the **same**\ncredential directory. JWT files are rewritten without locking (same caveat as\nthe CLI). Different directories are independent.";
2
+ //# sourceMappingURL=multi-account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-account.d.ts","sourceRoot":"","sources":["../../../../../src/lib/agent/jmap/help-content/multi-account.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,8xDA+Ce,CAAC"}
@@ -0,0 +1,49 @@
1
+ // Help topic: multi_account (MCP help / AgentSkill help).
2
+ export const helpTopicMultiAccount = `\
3
+ # Multiple accounts and agents
4
+
5
+ One MCP server or CLI install can manage **several isolated inboxes** by using a
6
+ **separate credential directory per account**. Each directory holds its own
7
+ \`credentials.json\`, \`session.jwt\`, and \`capability.jwt\` (mode \`0600\`).
8
+
9
+ ## MCP (per tool call)
10
+
11
+ Pass optional \`credentials_dir\` on \`register\` and \`jmap_request\`:
12
+
13
+ \`\`\`json
14
+ { "username": "alice", "credentials_dir": "~/.atomicmail/alice" }
15
+ { "ops_file": "list_inbox.json", "credentials_dir": "~/.atomicmail/bob" }
16
+ \`\`\`
17
+
18
+ When omitted, the default directory applies (\`ATOMIC_MAIL_CREDENTIALS_DIR\` or
19
+ \`~/.atomicmail\`).
20
+
21
+ ## AgentSkill (per command)
22
+
23
+ \`\`\`bash
24
+ atomicmail register --username alice --credentials-dir ~/.atomicmail/alice
25
+ atomicmail jmap_request --credentials-dir ~/.atomicmail/bob --ops-file list_inbox.json
26
+ \`\`\`
27
+
28
+ ## Default vs per-call
29
+
30
+ - **Default directory:** set once via \`ATOMIC_MAIL_CREDENTIALS_DIR\` (MCP host
31
+ \`env\`) or by omitting \`credentials_dir\` / \`--credentials-dir\`.
32
+ - **Per-call override:** use a different path on each \`register\` or
33
+ \`jmap_request\` when the agent should act as another inbox.
34
+
35
+ You no longer need multiple MCP server entries with different \`env\` blocks
36
+ unless you prefer that layout.
37
+
38
+ ## Register: forced vs separate directory
39
+
40
+ If the default directory already has an account and you want a **second**
41
+ inbox, pass a **new** \`credentials_dir\` / \`--credentials-dir\` instead of
42
+ \`forced: true\` / \`--forced\`. Use \`forced\` only when you intend to
43
+ **replace** credentials in the **same** directory (after backing up).
44
+
45
+ ## Concurrency
46
+
47
+ Do not run parallel \`register\` or \`jmap_request\` calls against the **same**
48
+ credential directory. JWT files are rewritten without locking (same caveat as
49
+ the CLI). Different directories are independent.`;
@@ -0,0 +1,2 @@
1
+ export declare const helpTopicOverview = "# Atomic Mail \u2014 Overview\n\nAtomic Mail is an email service provider (ESP) designed for AI agents. You\nmanage mail over JMAP (RFC 8620 + RFC 8621).\n\n## Public surface (identical for MCP and AgentSkill)\n\nThree operations only:\n\n1. **register** \u2014 Proof-of-work signup (or idempotent replay when the same\n username matches the inbox already on disk). Usernames are 5\u201321 characters\n (local-part of `@atomicmail.ai`). When a different username is\n requested and credentials already exist, register fails unless you use a\n separate `credentials_dir` / `--credentials-dir` or pass `forced: true`\n / `--forced` to replace the current directory. Persists\n credentials and returns `{ inbox, accountId }` (and `apiKey` on first\n signup).\n2. **jmap_request** \u2014 Send a JMAP method-call batch; auth and JWT rotation are\n automatic. Pass inline `ops` JSON or an `ops_file` preset (same\n substitution for both). Session-backed tokens (`$ACCOUNT_ID`, `$INBOX`,\n `$INBOX_MAILBOX_ID`, `$UPLOAD_URL`, `$DOWNLOAD_URL`) resolve from\n credentials and JMAP session (`$INBOX` is always a full mailbox address;\n `$INBOX_MAILBOX_ID` is the inbox **mailbox id** for filters and\n `mailboxIds` \u2014 see **presets** topic). Pass any other `$NAME` via MCP\n `vars` or `--vars`. Optional **attachments** (MCP `attachments`, skill\n `--attachment`): each file is uploaded to `uploadUrl` (RFC 8620), then\n `$ATTACHMENT_0_BLOB_ID`, \u2026 are substituted into your JMAP JSON.\n3. **help** \u2014 This documentation (optional `topic` / `--topic`), or the\n published package README (`topic` / `--topic` `readme`).\n\n## Typical workflow\n\n1. `register` with a username (5\u201321 characters).\n2. After register, arrange hourly inbox polling per your runtime (see **cron**\n topic \u2014 native scheduler if available; otherwise ask your operator or remind\n manual fetch). Do not cron `atomicmail jmap_request` alone.\n3. `jmap_request` with JMAP method calls (presets may use `$VAR_NAME`; pass\n custom values in `vars` / `--vars`).\n4. Call `help` early and often \u2014 before guessing JMAP or preset details, not\n only when stuck. Prefer `help` over general JMAP knowledge; topics match\n this package version.\n\nAFTER REGISTER \u2014 INBOX POLLING\n Choose the path that matches your runtime (help topic \"cron\"):\n \u2022 Native cron (OpenClaw, Hermes, atomic-agent, \u2026): schedule an hourly AGENT turn with list_inbox.json in the prompt; wire MCP or AgentSkill into that agent. Do NOT cron atomicmail jmap_request alone.\n \u2022 No native cron (Claude, Pi, Cursor, \u2026): do NOT work around this (no wrapper scripts, OS crontab/LaunchAgent, or cross-platform scheduling). Ask your operator to set up polling on a capable host, or remind them to fetch mail manually when needed.\n \u2022 Forbidden: register in one runtime and schedule the cron job on another.\n\nAvailable topics: overview, installation, auth, jmap_cheatsheet, tools,\npresets, cron, multi_account, troubleshooting. Use `readme` for the npm package `README.md`.";
2
+ //# sourceMappingURL=overview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../../../src/lib/agent/jmap/help-content/overview.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,kiGA8CmE,CAAC"}