@ghostpaw/email 0.5.4 → 0.5.5

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
@@ -7,7 +7,7 @@
7
7
  **Agent email: IMAP and SMTP in-process, cached in SQLite, with reading and sending as separate tools.**
8
8
 
9
9
  ```bash
10
- npm install @ghostpaw/email
10
+ curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh
11
11
  ```
12
12
 
13
13
  A standalone email engine for Node.js, built on SQLite.
@@ -22,14 +22,15 @@ without writing any wiring code.
22
22
 
23
23
  ## MCP server
24
24
 
25
- Every client below starts the same stdio server: `npx -y @ghostpaw/email mcp`.
25
+ Every client below starts the same stdio server: `ghostpaw-email mcp`.
26
+ For npm-based environments, use `npx -y @ghostpaw/email mcp` instead.
26
27
  Cached messages live in `~/.ghostpaw/email.db` unless the `GHOSTPAW_EMAIL_DB`
27
28
  environment variable (absolute path) or `--db <path>` says otherwise.
28
29
 
29
30
  **Claude Code**
30
31
 
31
32
  ```bash
32
- claude mcp add ghostpaw-email -- npx -y @ghostpaw/email mcp
33
+ claude mcp add ghostpaw-email -- ghostpaw-email mcp
33
34
  ```
34
35
 
35
36
  or as a plugin, which also installs the skill:
@@ -43,8 +44,8 @@ or as a plugin, which also installs the skill:
43
44
 
44
45
  ```toml
45
46
  [mcp_servers.ghostpaw-email]
46
- command = "npx"
47
- args = ["-y", "@ghostpaw/email", "mcp"]
47
+ command = "ghostpaw-email"
48
+ args = ["mcp"]
48
49
  ```
49
50
 
50
51
  **Cursor** (`.cursor/mcp.json`), **Claude Desktop** (`claude_desktop_config.json`)
@@ -54,8 +55,8 @@ or a project `.mcp.json`:
54
55
  {
55
56
  "mcpServers": {
56
57
  "ghostpaw-email": {
57
- "command": "npx",
58
- "args": ["-y", "@ghostpaw/email", "mcp"]
58
+ "command": "ghostpaw-email",
59
+ "args": ["mcp"]
59
60
  }
60
61
  }
61
62
  }
@@ -104,7 +105,7 @@ Global flags for the new commands: `--db <path>`, `--json`, `--quiet`,
104
105
  `--compact`, `--help`/`-h`, `--version`/`-V`/`-v`, `--no-color`.
105
106
  Output is JSON when piped or when `--json` is set. `--quiet` suppresses stdout.
106
107
  `completions bash|zsh|fish` prints shell completion setup; `version` prints
107
- the package version. The existing `tools [--json]`, `describe <tool>`,
108
+ the version and installation variant. The existing `tools [--json]`, `describe <tool>`,
108
109
  `call <tool> [JSON|-]`, flat `mail_<tool> --parameter value`, `mcp` and `skill`
109
110
  forms remain available.
110
111
 
@@ -136,9 +137,9 @@ credentials. Network operations use `email account add` configuration or
136
137
  ## Tool CLI
137
138
 
138
139
  ```bash
139
- npx -y @ghostpaw/email tools
140
- npx -y @ghostpaw/email call mail_read '{"view":"folders"}' --db :memory:
141
- npx -y @ghostpaw/email call mail_search '{"query":"invoice"}'
140
+ ghostpaw-email tools
141
+ ghostpaw-email call mail_read '{"view":"folders"}' --db :memory:
142
+ ghostpaw-email call mail_search '{"query":"invoice"}'
142
143
  ```
143
144
 
144
145
  Both `email` and `ghostpaw-email` run the same CLI. Existing account, read,
@@ -146,29 +147,50 @@ search, compose, organize and sync commands remain available. The full guide
146
147
  is preserved in [skills/email/references/cli.md](skills/email/references/cli.md).
147
148
 
148
149
  Agent Skill: `SKILL.md` and `skills/email/` ship in the package; print the skill
149
- with `npx -y @ghostpaw/email skill`.
150
+ with `ghostpaw-email skill`. List guides with `ghostpaw-email skill --list`
151
+ and print one with `ghostpaw-email skill compose-and-send`.
150
152
 
151
153
  ## Install
152
154
 
153
- ```bash
154
- npm install @ghostpaw/email # as a library
155
- npm install -g @ghostpaw/email # as a global CLI
156
- npx @ghostpaw/email --help # one-off, no install needed
155
+ ### Release binary (default)
156
+
157
+ Each line downloads the latest release asset, checks it against the release's SHA256SUMS and installs it on the PATH (~/.local/bin on Linux/macOS; the Windows script adds its folder to the user PATH).
158
+
159
+ linux-x64:
160
+
161
+ ```sh
162
+ curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target linux-x64 && export PATH="$HOME/.local/bin:$PATH"
157
163
  ```
158
164
 
159
- Requires **Node.js 24+** (uses the built-in `node:sqlite` module).
165
+ linux-arm64:
160
166
 
161
- Standalone binaries are available from [GitHub Releases](https://github.com/GhostPawJS/email/releases)
162
- for linux-x64, linux-arm64, darwin-arm64, darwin-x64 and windows-x64.
167
+ ```sh
168
+ curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target linux-arm64 && export PATH="$HOME/.local/bin:$PATH"
169
+ ```
170
+
171
+ darwin-arm64:
163
172
 
164
173
  ```sh
165
- curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh
174
+ curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target darwin-arm64 && export PATH="$HOME/.local/bin:$PATH"
175
+ ```
176
+
177
+ darwin-x64:
178
+
179
+ ```sh
180
+ curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target darwin-x64 && export PATH="$HOME/.local/bin:$PATH"
166
181
  ```
167
182
 
183
+ windows-x64 (PowerShell):
184
+
168
185
  ```powershell
169
186
  irm https://raw.githubusercontent.com/GhostPawJS/email/main/install.ps1 | iex
170
187
  ```
171
188
 
189
+ ```text
190
+ $ ghostpaw-email --version
191
+ email 0.5.5 (binary, linux-x64)
192
+ ```
193
+
172
194
  A session with the 0.5.1 linux-x64 binary against a local GreenMail test server on 127.0.0.1 (throwaway user, no real account) and a fresh database (output piped through `jq` to keep it short):
173
195
 
174
196
  ![ghostpaw-email 0.5.1 against a local test server: version, account add and show, compose send, sync, read queue, search, organize star and the raw message](https://raw.githubusercontent.com/GhostPawJS/email/main/docs/assets/cli.png)
@@ -238,10 +260,31 @@ Sizes for 0.5.1 (Node 26.12.1 inside each binary):
238
260
  | darwin-x64 | 46.4 MB tar.gz | 149.8 MB |
239
261
  | windows-x64 | 38.5 MB zip | 105.8 MB |
240
262
 
241
- The npm package is 1711 KB unpacked and needs Node 24+.
242
-
243
263
  Release installation is checked on ubuntu-24.04, macos-15 and windows-2025.
244
264
 
265
+ ### npx / npm (for npm-based environments)
266
+
267
+ Requires **Node 24+** (uses the built-in `node:sqlite` module).
268
+ The npm package is 1711 KB unpacked.
269
+
270
+ ```sh
271
+ npm install @ghostpaw/email # as a library
272
+ npm install -g @ghostpaw/email # as a global CLI
273
+ npx @ghostpaw/email --help # one-off, no install needed
274
+ ```
275
+
276
+ ### Library (for harnesses embedding it in code)
277
+
278
+ ```sh
279
+ npm install @ghostpaw/email
280
+ ```
281
+
282
+ ```ts
283
+ import { Mailbox } from '@ghostpaw/email';
284
+ ```
285
+
286
+ See [library usage](#quick-start).
287
+
245
288
  ## Quick Start
246
289
 
247
290
  ```ts
package/SKILL.md CHANGED
@@ -2,18 +2,34 @@
2
2
  name: email
3
3
  description: "Read, search, compose, organize and synchronize email with a local SQLite cache. Use when managing email or searching cached messages."
4
4
  license: "MIT"
5
- compatibility: "Node.js 24 or newer. MCP stdio or email CLI."
5
+ compatibility: "Release binary ghostpaw-email (no runtime needed); MCP stdio via ghostpaw-email mcp."
6
6
  ---
7
7
 
8
8
  # email
9
9
 
10
+ ## Install
11
+
12
+ Linux/macOS (checks SHA256SUMS and installs ~/.local/bin/ghostpaw-email):
13
+
14
+ ```sh
15
+ curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh
16
+ ```
17
+
18
+ Windows x64:
19
+
20
+ ```powershell
21
+ irm https://raw.githubusercontent.com/GhostPawJS/email/main/install.ps1 | iex
22
+ ```
23
+
24
+ Run tools as `ghostpaw-email ...`; use `~/.local/bin/ghostpaw-email` if it is not on PATH.
25
+
10
26
  Read and search cached email offline. Configure live accounts with email account add before network operations. Inspect messages before replying or changing folders. Confirm recipients and content before sending; trash and folder deletion can remove mail. Credentials use the existing email CLI account configuration or EMAIL_* environment variables.
11
27
 
12
28
  ## Calling tools
13
29
 
14
30
  MCP: connect to ghostpaw-email, then call a tool by name with its JSON arguments.
15
31
 
16
- CLI: `ghostpaw-email call <tool> '<JSON object>'` or `ghostpaw-email <tool> --parameter value` (without a global install: `npx -y @ghostpaw/email <tool> ...`).
32
+ CLI: `ghostpaw-email call <tool> '<JSON object>'` or `ghostpaw-email <tool> --parameter value`.
17
33
 
18
34
  Inspect schemas with `ghostpaw-email describe <tool>`. Use `--db <path>` to select a database.
19
35
 
@@ -27,6 +43,8 @@ Not for: Use mail_search to find messages by query or mail_organize to change th
27
43
 
28
44
  Writes: writes_state.
29
45
 
46
+ Nested requirements apply within the parent for the selected action.
47
+
30
48
  | Parameter | Type | Required | Values / description |
31
49
  | --- | --- | --- | --- |
32
50
  | view | string | yes | folders, queue, thread, message, attachment, eml. What to read. |
@@ -38,6 +56,12 @@ Writes: writes_state.
38
56
  | unreadOnly | boolean | no | Filter to unread messages only (queue view). |
39
57
  | refresh | boolean | no | Fetch live folder list from server before returning (folders/queue view). |
40
58
 
59
+ Examples:
60
+
61
+ ```sh
62
+ ghostpaw-email call mail_read '{"view":"folders"}'
63
+ ```
64
+
41
65
  ## mail_search
42
66
 
43
67
  Search for messages locally via FTS or remotely via IMAP SEARCH. Returns matching message references.
@@ -48,6 +72,8 @@ Not for: Use mail_read when the folder and message UID are already known.
48
72
 
49
73
  Writes: writes_state.
50
74
 
75
+ Nested requirements apply within the parent for the selected action.
76
+
51
77
  | Parameter | Type | Required | Values / description |
52
78
  | --- | --- | --- | --- |
53
79
  | query | string | yes | Free-text search query or FTS5 expression. |
@@ -59,6 +85,12 @@ Writes: writes_state.
59
85
  | unreadOnly | boolean | no | Filter to unread messages. |
60
86
  | limit | integer | no | Maximum number of results. |
61
87
 
88
+ Examples:
89
+
90
+ ```sh
91
+ ghostpaw-email call mail_search '{"query":"invoice"}'
92
+ ```
93
+
62
94
  ## mail_compose
63
95
 
64
96
  Compose and send email: send new message, reply, forward, save/update/send a draft.
@@ -69,12 +101,24 @@ Not for: Use mail_read to inspect an existing message without sending or saving
69
101
 
70
102
  Writes: writes_state.
71
103
 
104
+ Nested requirements apply within the parent for the selected action.
105
+
72
106
  | Parameter | Type | Required | Values / description |
73
107
  | --- | --- | --- | --- |
74
108
  | action | string | yes | send, reply, forward, save_draft, update_draft, send_draft. |
75
109
  | folder | string | no | Source folder (required for reply/forward). |
76
110
  | uid | integer | no | Source message UID (required for reply/forward/update_draft/send_draft). |
77
111
  | input | object | no | ComposeInput / ReplyInput / ForwardInput payload. |
112
+ | input.to | array | yes | Recipient addresses. |
113
+ | input.subject | string | yes | Message subject. |
114
+
115
+ Examples:
116
+
117
+ ```sh
118
+ ghostpaw-email call mail_compose '{"action":"send","input":{"to":[{"address":"reader@example.com"}],"subject":"Hello"}}'
119
+ ghostpaw-email call mail_compose '{"action":"reply","input":{},"folder":"INBOX","uid":1}'
120
+ ghostpaw-email call mail_compose '{"action":"forward","input":{"to":[{"address":"reader@example.com"}]},"folder":"INBOX","uid":1}'
121
+ ```
78
122
 
79
123
  ## mail_organize
80
124
 
@@ -86,6 +130,8 @@ Not for: Use mail_read or mail_search when only inspection is requested.
86
130
 
87
131
  Writes: writes_state.
88
132
 
133
+ Nested requirements apply within the parent for the selected action.
134
+
89
135
  | Parameter | Type | Required | Values / description |
90
136
  | --- | --- | --- | --- |
91
137
  | action | string | yes | mark_read, mark_unread, star, unstar, mark_answered, copy, move, archive, trash, junk, not_junk, set_labels, add_labels, remove_labels, create_folder, rename_folder, delete_folder, subscribe_folder, unsubscribe_folder. |
@@ -97,6 +143,14 @@ Writes: writes_state.
97
143
  | oldPath | string | no | Old folder path (required for rename_folder). |
98
144
  | newPath | string | no | New folder path (required for rename_folder). |
99
145
 
146
+ Examples:
147
+
148
+ ```sh
149
+ ghostpaw-email call mail_organize '{"action":"mark_read","folder":"INBOX","uids":[1]}'
150
+ ghostpaw-email call mail_organize '{"action":"mark_unread","folder":"INBOX","uids":[1]}'
151
+ ghostpaw-email call mail_organize '{"action":"star","folder":"INBOX","uids":[1]}'
152
+ ```
153
+
100
154
  ## mail_sync
101
155
 
102
156
  Manage the IMAP connection lifecycle and sync local state: connect, disconnect, reconnect, sync folders, or refresh the folder list.
@@ -107,25 +161,41 @@ Not for: Use mail_read for cached content or the network watch stream for contin
107
161
 
108
162
  Writes: writes_state.
109
163
 
164
+ Nested requirements apply within the parent for the selected action.
165
+
110
166
  | Parameter | Type | Required | Values / description |
111
167
  | --- | --- | --- | --- |
112
168
  | action | string | yes | connect, disconnect, reconnect, sync, refresh_folders, watch. |
113
169
  | folders | array | no | Folders to sync or watch (optional — defaults to all subscribed folders). |
114
170
  | bodies | string | no | none, missing, all. Body fetch strategy for sync (default: missing). |
115
171
 
172
+ Examples:
173
+
174
+ ```sh
175
+ ghostpaw-email call mail_sync '{"action":"connect"}'
176
+ ghostpaw-email call mail_sync '{"action":"disconnect"}'
177
+ ghostpaw-email call mail_sync '{"action":"reconnect"}'
178
+ ```
179
+
116
180
  ## Workflow guides
117
181
 
118
- - [triage-inbox](skills/email/references/triage-inbox.md): Process a full inbox from scratch: sync to get latest state, read message queue, selectively fetch bodies for decisions, then bulk-organize by priority.
119
- - [read-and-reply](skills/email/references/read-and-reply.md): Read a message with full thread context, then compose and send a properly-threaded reply with quoted attribution.
120
- - [connect-and-sync](skills/email/references/connect-and-sync.md): Establish or restore an IMAP connection, refresh the folder list, and pull new messages — handling first-run vs incremental scenarios.
121
- - [search-and-act](skills/email/references/search-and-act.md): Find messages matching criteria (local FTS first, remote IMAP SEARCH as fallback), verify targets, then act — organize, reply, or present.
122
- - [compose-and-send](skills/email/references/compose-and-send.md): Full draft lifecycle — save, review, update, then send — plus direct send, reply, and forward with proper threading and forwarded-header blocks.
123
- - [organize-bulk](skills/email/references/organize-bulk.md): Bulk organize messages across folders — flagging, moving, archiving, labelling — and manage the folder hierarchy as part of the flow.
124
- - [attachment-workflow](skills/email/references/attachment-workflow.md): Discover, inspect, and fetch email attachments on demand; embed attachments in outbound messages; and export or import full .eml files.
125
- - [recover-from-disruption](skills/email/references/recover-from-disruption.md): Detect and recover from connection loss or IMAP/SMTP failures — reconnect with back-off, re-sync to reconcile state, and handle auth vs transient errors distinctly.
126
- - [cli](skills/email/references/cli.md): Complete existing email CLI guide.
182
+ - `ghostpaw-email skill triage-inbox` ([triage-inbox](skills/email/references/triage-inbox.md)): Process a full inbox from scratch: sync to get latest state, read message queue, selectively fetch bodies for decisions, then bulk-organize by priority.
183
+ - `ghostpaw-email skill read-and-reply` ([read-and-reply](skills/email/references/read-and-reply.md)): Read a message with full thread context, then compose and send a properly-threaded reply with quoted attribution.
184
+ - `ghostpaw-email skill connect-and-sync` ([connect-and-sync](skills/email/references/connect-and-sync.md)): Establish or restore an IMAP connection, refresh the folder list, and pull new messages — handling first-run vs incremental scenarios.
185
+ - `ghostpaw-email skill search-and-act` ([search-and-act](skills/email/references/search-and-act.md)): Find messages matching criteria (local FTS first, remote IMAP SEARCH as fallback), verify targets, then act — organize, reply, or present.
186
+ - `ghostpaw-email skill compose-and-send` ([compose-and-send](skills/email/references/compose-and-send.md)): Full draft lifecycle — save, review, update, then send — plus direct send, reply, and forward with proper threading and forwarded-header blocks.
187
+ - `ghostpaw-email skill organize-bulk` ([organize-bulk](skills/email/references/organize-bulk.md)): Bulk organize messages across folders — flagging, moving, archiving, labelling — and manage the folder hierarchy as part of the flow.
188
+ - `ghostpaw-email skill attachment-workflow` ([attachment-workflow](skills/email/references/attachment-workflow.md)): Discover, inspect, and fetch email attachments on demand; embed attachments in outbound messages; and export or import full .eml files.
189
+ - `ghostpaw-email skill recover-from-disruption` ([recover-from-disruption](skills/email/references/recover-from-disruption.md)): Detect and recover from connection loss or IMAP/SMTP failures — reconnect with back-off, re-sync to reconcile state, and handle auth vs transient errors distinctly.
190
+ - `ghostpaw-email skill cli` ([cli](skills/email/references/cli.md)): Complete existing email CLI guide.
127
191
 
128
192
  ## Principles
129
193
 
130
194
  - Inspect before changing messages.
131
195
  - Confirm recipients and content before sending.
196
+
197
+ ## Without the binary
198
+
199
+ For npm-based environments (Node 24+): `npx -y @ghostpaw/email ...`.
200
+
201
+ Harnesses that embed it in code can import `@ghostpaw/email` as a library.