@openmail/openclaw 0.1.6 → 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/README.md +25 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -2
- package/skills/openmail/SKILL.md +78 -1
package/README.md
CHANGED
|
@@ -215,3 +215,28 @@ generated from `src/config-schema.ts` and `src/setup.ts`. Edit those, then run
|
|
|
215
215
|
|
|
216
216
|
Compiles against `openclaw@2026.9.2` (pinned in `devDependencies`); the
|
|
217
217
|
generated `compat` and `install.minHostVersion` follow that pin.
|
|
218
|
+
|
|
219
|
+
## Draft workflow
|
|
220
|
+
|
|
221
|
+
OpenClaw plugin 0.1.8 bundles [OpenMail CLI 0.9.1](https://github.com/openmailsh/cli/releases/tag/v0.9.1), including HTML-only draft creation and editing plus version-checked deletion.
|
|
222
|
+
|
|
223
|
+
Read a draft with `openclaw openmail -- drafts get --draft-id "<id>" --json`, then discard it using `openclaw openmail -- drafts delete --draft-id "<id>" --updated-at "<saved updatedAt>" --json`. The wrapper forwards the version unchanged with the channel credentials. Deletion permanently removes the draft and files without sending. Stale versions and pending or accepted sends block it; it cannot cancel delivery. Never automatically replace the version and retry deletion.
|
|
224
|
+
|
|
225
|
+
Use `openclaw openmail -- drafts create|list|get|edit|send|delete` with the channel's credentials.
|
|
226
|
+
Select a sending inbox with `--inbox-id` at creation. You can save an incomplete
|
|
227
|
+
draft, add HTML and files, or associate it with a thread. Use `--thread-id` for
|
|
228
|
+
a reply and `--source-thread-id` for a forward that starts a new conversation.
|
|
229
|
+
Both creation and editing accept only `--body-html`; the API generates plain text.
|
|
230
|
+
To edit, read the draft and pass its exact `updatedAt` via `--updated-at` plus
|
|
231
|
+
only the requested changes. Stale versions require reading and reconciling
|
|
232
|
+
the current draft; edits never send mail.
|
|
233
|
+
|
|
234
|
+
The console shows drafts in their owning inbox, in the main Drafts page, and
|
|
235
|
+
in their source thread when present. The CLI lists drafts across the inboxes
|
|
236
|
+
the channel can access and can combine inbox, pod, source thread, and text
|
|
237
|
+
filters. To send, pass the draft ID and the exact `--updated-at` you reviewed.
|
|
238
|
+
The saved inbox, content, and attachments carry through to delivery.
|
|
239
|
+
|
|
240
|
+
See the [bundled skill](skills/openmail/SKILL.md#drafts) for command examples.
|
|
241
|
+
The wrapper already passes draft arguments through with channel credentials;
|
|
242
|
+
no separate OpenClaw draft API implementation is needed.
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmail/openclaw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "OpenMail channel plugin for OpenClaw: give your agent an email address.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prepublishOnly": "pnpm check"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@openmail/cli": "^0.
|
|
30
|
+
"@openmail/cli": "^0.9.1",
|
|
31
31
|
"ws": "^8.18.0",
|
|
32
32
|
"zod": "4.4.3"
|
|
33
33
|
},
|
package/skills/openmail/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: openmail
|
|
3
|
-
description: The agent has its own email address via OpenMail. Use this skill to send email, reply in a thread, read a thread, check for unread mail, or read an attachment. Also use it when the user says things like "reach out to them", "contact support", "sign up", "wait for their reply", "check if they responded", or "what did that PDF say" — even without the word "email".
|
|
3
|
+
description: The agent has its own email address via OpenMail. Use this skill to create, find, review, edit, send or delete saved drafts, send email, reply in a thread, read a thread, check for unread mail, or read an attachment. Also use it when the user says things like "reach out to them", "contact support", "sign up", "wait for their reply", "check if they responded", or "what did that PDF say" — even without the word "email".
|
|
4
4
|
metadata: {"openclaw":{"emoji":"📬","requires":{"bins":["openclaw"]}}}
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -83,6 +83,83 @@ The response has `messageId` and `threadId`; keep `threadId` to continue later.
|
|
|
83
83
|
If a send is rejected by an outbound policy rule, tell the user; do not work
|
|
84
84
|
around it.
|
|
85
85
|
|
|
86
|
+
## Drafts
|
|
87
|
+
|
|
88
|
+
To discard a draft when requested, read it with `openclaw openmail -- drafts get --draft-id "<draft-id>" --json`, then use:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
openclaw openmail -- drafts delete --draft-id "<draft-id>" --updated-at "<reviewed updatedAt>" --json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Deletion permanently removes the unsent draft and its attachments. Optional `--inbox-id` checks ownership. On `draft_changed`, review the current draft and verify it is still the one to discard; never automatically fetch a new version and retry. Pending or accepted sends block deletion, which cannot cancel sending. Missing drafts may already have been sent or deleted; do not claim this request deleted them. No email is sent by deletion.
|
|
95
|
+
|
|
96
|
+
The bundled CLI 0.9.1 supports `drafts edit` and `drafts delete`. On an older plugin, check `openclaw openmail -- help drafts` and update the plugin if those commands are unavailable; do not claim an edit or deletion succeeded when the command did not run.
|
|
97
|
+
|
|
98
|
+
Every draft belongs to the inbox that will send it. Choose an accessible inbox with
|
|
99
|
+
`inbox list` and pass its ID explicitly when creating a draft. The sender is the
|
|
100
|
+
only required field, so you can save a partial message for review.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
openclaw openmail -- inbox list --json
|
|
104
|
+
openclaw openmail -- drafts create --inbox-id "<inbox-id>" --to "person@example.com" --subject "Proposal" --body-html "<p>Please review.</p>" --json
|
|
105
|
+
openclaw openmail -- drafts list --json
|
|
106
|
+
openclaw openmail -- drafts list --inbox-id "<inbox-id>" --pod-id "<pod-id>" --query Proposal --json
|
|
107
|
+
openclaw openmail -- drafts get --draft-id "<draft-id>" --json
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
List returns drafts across the inboxes the channel can access. Combine
|
|
111
|
+
`--inbox-id`, `--pod-id`, `--source-thread-id`, and `--query` to narrow the list.
|
|
112
|
+
Use `--limit` and `--offset` for pagination. The console also shows each draft in
|
|
113
|
+
its inbox and in the main Drafts page.
|
|
114
|
+
|
|
115
|
+
For a reply, use `--thread-id` and the inbox that owns the thread. The server
|
|
116
|
+
sets the reply subject and records the thread as the source. For a forward,
|
|
117
|
+
supply only `--source-thread-id` as the thread reference and compose the
|
|
118
|
+
recipient, subject and content to forward. Both drafts appear in the source
|
|
119
|
+
conversation. Sending the reply continues that conversation. Sending the
|
|
120
|
+
forward starts a new one.
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
openclaw openmail -- drafts create --inbox-id "<inbox-id>" --thread-id "<thread-id>" --to "person@example.com" --body-html "<p>Thanks for the proposal.</p>" --json
|
|
124
|
+
openclaw openmail -- drafts create --inbox-id "<inbox-id>" --source-thread-id "<thread-id>" --to "reviewer@example.com" --subject "Fwd: Proposal" --body-html "<p>Please review the attached proposal.</p>" --attach ./proposal.pdf --json
|
|
125
|
+
openclaw openmail -- drafts list --source-thread-id "<thread-id>" --json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`--cc`, `--bcc`, and `--attach` are repeatable. Both draft creation and editing accept only `--body-html` for body content.
|
|
129
|
+
The API generates plain text automatically; do not use `--body`. OpenMail imports supported embedded or remote images in the HTML and
|
|
130
|
+
stores them with the draft. On creation, for a local inline image, pass
|
|
131
|
+
`--inline-image "inline-<UUID>@openmail=./photo.png"` and use the same content ID
|
|
132
|
+
in an HTML image source, such as `src="cid:inline-<UUID>@openmail"`.
|
|
133
|
+
|
|
134
|
+
To revise a saved draft, read it first and pass its exact `updatedAt`:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
openclaw openmail -- drafts edit --draft-id "<draft-id>" --updated-at "<current updatedAt>" --body-html "<p>Revised proposal.</p>" --json
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Only supplied fields change. Use `--clear-to`, `--clear-cc`, or `--clear-bcc`
|
|
141
|
+
to clear recipients, and `--subject ""` or `--body-html ""` to clear content.
|
|
142
|
+
Keep inline `cid:` references for images that should remain. The original
|
|
143
|
+
sending inbox and reply context stay fixed. On `draft_changed`, read the
|
|
144
|
+
current draft and reconcile the requested changes before another edit; never
|
|
145
|
+
refresh the version and overwrite newer edits automatically. Pending or
|
|
146
|
+
accepted sends block edits. Editing does not authorize sending.
|
|
147
|
+
|
|
148
|
+
Before sending, review the saved inbox, To/Cc/Bcc, subject, full body, files
|
|
149
|
+
and thread context returned by `drafts get`. When the user asks to send that
|
|
150
|
+
version, pass its exact `updatedAt`. The draft sends from its owning inbox with
|
|
151
|
+
its saved content and attachments.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
openclaw openmail -- drafts send --draft-id "<draft-id>" --updated-at "<reviewed updatedAt>" --json
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
A successful send removes the draft. Handle other outcomes as follows.
|
|
158
|
+
|
|
159
|
+
- If you receive `draft_changed`, get the draft again and review the current version with the user before sending.
|
|
160
|
+
- After `send_failed`, the draft is retained. A failed attempt can advance `updatedAt`. Review it again and obtain approval before retrying.
|
|
161
|
+
- If you receive `draft_sending`, wait and check the owning inbox for the sent message and the saved draft before considering another send.
|
|
162
|
+
|
|
86
163
|
## Reading mail
|
|
87
164
|
|
|
88
165
|
```bash
|