@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.
- package/LICENSE +21 -0
- package/README.md +77 -0
- package/esm/_dnt.polyfills.d.ts +101 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -0
- package/esm/_dnt.polyfills.js +127 -0
- package/esm/langchain/mod.d.ts +23 -0
- package/esm/langchain/mod.d.ts.map +1 -0
- package/esm/langchain/mod.js +157 -0
- package/esm/lib/agent/auth/agent-auth-http.d.ts +26 -0
- package/esm/lib/agent/auth/agent-auth-http.d.ts.map +1 -0
- package/esm/lib/agent/auth/agent-auth-http.js +85 -0
- package/esm/lib/agent/auth/agent-jwt.d.ts +12 -0
- package/esm/lib/agent/auth/agent-jwt.d.ts.map +1 -0
- package/esm/lib/agent/auth/agent-jwt.js +27 -0
- package/esm/lib/agent/auth/agent-pow.d.ts +5 -0
- package/esm/lib/agent/auth/agent-pow.d.ts.map +1 -0
- package/esm/lib/agent/auth/agent-pow.js +49 -0
- package/esm/lib/agent/jmap/agent-help-content.d.ts +2 -0
- package/esm/lib/agent/jmap/agent-help-content.d.ts.map +1 -0
- package/esm/lib/agent/jmap/agent-help-content.js +2 -0
- package/esm/lib/agent/jmap/agent-jmap-blob-limits.d.ts +27 -0
- package/esm/lib/agent/jmap/agent-jmap-blob-limits.d.ts.map +1 -0
- package/esm/lib/agent/jmap/agent-jmap-blob-limits.js +166 -0
- package/esm/lib/agent/jmap/agent-jmap-blob-upload.d.ts +24 -0
- package/esm/lib/agent/jmap/agent-jmap-blob-upload.d.ts.map +1 -0
- package/esm/lib/agent/jmap/agent-jmap-blob-upload.js +104 -0
- package/esm/lib/agent/jmap/agent-jmap-email-charset.d.ts +8 -0
- package/esm/lib/agent/jmap/agent-jmap-email-charset.d.ts.map +1 -0
- package/esm/lib/agent/jmap/agent-jmap-email-charset.js +61 -0
- package/esm/lib/agent/jmap/agent-jmap-verify.d.ts +9 -0
- package/esm/lib/agent/jmap/agent-jmap-verify.d.ts.map +1 -0
- package/esm/lib/agent/jmap/agent-jmap-verify.js +50 -0
- package/esm/lib/agent/jmap/agent-jmap.d.ts +89 -0
- package/esm/lib/agent/jmap/agent-jmap.d.ts.map +1 -0
- package/esm/lib/agent/jmap/agent-jmap.js +373 -0
- package/esm/lib/agent/jmap/agent-vars.d.ts +30 -0
- package/esm/lib/agent/jmap/agent-vars.d.ts.map +1 -0
- package/esm/lib/agent/jmap/agent-vars.js +96 -0
- package/esm/lib/agent/jmap/help-content/auth.d.ts +2 -0
- package/esm/lib/agent/jmap/help-content/auth.d.ts.map +1 -0
- package/esm/lib/agent/jmap/help-content/auth.js +33 -0
- package/esm/lib/agent/jmap/help-content/cron.d.ts +6 -0
- package/esm/lib/agent/jmap/help-content/cron.d.ts.map +1 -0
- package/esm/lib/agent/jmap/help-content/cron.js +159 -0
- package/esm/lib/agent/jmap/help-content/index.d.ts +6 -0
- package/esm/lib/agent/jmap/help-content/index.d.ts.map +1 -0
- package/esm/lib/agent/jmap/help-content/index.js +61 -0
- package/esm/lib/agent/jmap/help-content/installation.d.ts +2 -0
- package/esm/lib/agent/jmap/help-content/installation.d.ts.map +1 -0
- package/esm/lib/agent/jmap/help-content/installation.js +47 -0
- package/esm/lib/agent/jmap/help-content/jmap-cheatsheet.d.ts +2 -0
- package/esm/lib/agent/jmap/help-content/jmap-cheatsheet.d.ts.map +1 -0
- package/esm/lib/agent/jmap/help-content/jmap-cheatsheet.js +230 -0
- package/esm/lib/agent/jmap/help-content/multi-account.d.ts +2 -0
- package/esm/lib/agent/jmap/help-content/multi-account.d.ts.map +1 -0
- package/esm/lib/agent/jmap/help-content/multi-account.js +49 -0
- package/esm/lib/agent/jmap/help-content/overview.d.ts +2 -0
- package/esm/lib/agent/jmap/help-content/overview.d.ts.map +1 -0
- package/esm/lib/agent/jmap/help-content/overview.js +49 -0
- package/esm/lib/agent/jmap/help-content/presets.d.ts +2 -0
- package/esm/lib/agent/jmap/help-content/presets.d.ts.map +1 -0
- package/esm/lib/agent/jmap/help-content/presets.js +51 -0
- package/esm/lib/agent/jmap/help-content/tools.d.ts +2 -0
- package/esm/lib/agent/jmap/help-content/tools.d.ts.map +1 -0
- package/esm/lib/agent/jmap/help-content/tools.js +49 -0
- package/esm/lib/agent/jmap/help-content/troubleshooting.d.ts +2 -0
- package/esm/lib/agent/jmap/help-content/troubleshooting.d.ts.map +1 -0
- package/esm/lib/agent/jmap/help-content/troubleshooting.js +65 -0
- package/esm/lib/agent/session/agent-credentials-store.d.ts +45 -0
- package/esm/lib/agent/session/agent-credentials-store.d.ts.map +1 -0
- package/esm/lib/agent/session/agent-credentials-store.js +121 -0
- package/esm/lib/agent/session/agent-resolve-config.d.ts +29 -0
- package/esm/lib/agent/session/agent-resolve-config.d.ts.map +1 -0
- package/esm/lib/agent/session/agent-resolve-config.js +71 -0
- package/esm/lib/agent/session/agent-session-for-dir.d.ts +8 -0
- package/esm/lib/agent/session/agent-session-for-dir.d.ts.map +1 -0
- package/esm/lib/agent/session/agent-session-for-dir.js +33 -0
- package/esm/lib/agent/session/agent-session.d.ts +89 -0
- package/esm/lib/agent/session/agent-session.d.ts.map +1 -0
- package/esm/lib/agent/session/agent-session.js +320 -0
- package/esm/lib/agent/session/inbox-id-to-mailbox-email.d.ts +6 -0
- package/esm/lib/agent/session/inbox-id-to-mailbox-email.d.ts.map +1 -0
- package/esm/lib/agent/session/inbox-id-to-mailbox-email.js +24 -0
- package/esm/lib/core/consts.d.ts +17 -0
- package/esm/lib/core/consts.d.ts.map +1 -0
- package/esm/lib/core/consts.js +28 -0
- package/esm/lib/core/messages.d.ts +6 -0
- package/esm/lib/core/messages.d.ts.map +1 -0
- package/esm/lib/core/messages.js +19 -0
- package/esm/lib/core/read-npm-package-readme.d.ts +6 -0
- package/esm/lib/core/read-npm-package-readme.d.ts.map +1 -0
- package/esm/lib/core/read-npm-package-readme.js +81 -0
- package/esm/lib/core/shared-assets.d.ts +6 -0
- package/esm/lib/core/shared-assets.d.ts.map +1 -0
- package/esm/lib/core/shared-assets.js +46 -0
- package/esm/lib/core/types.d.ts +2 -0
- package/esm/lib/core/types.d.ts.map +1 -0
- package/esm/lib/core/types.js +2 -0
- package/esm/lib/core/utils.d.ts +12 -0
- package/esm/lib/core/utils.d.ts.map +1 -0
- package/esm/lib/core/utils.js +29 -0
- package/esm/lib/mod.d.ts +20 -0
- package/esm/lib/mod.d.ts.map +1 -0
- package/esm/lib/mod.js +19 -0
- package/esm/lib/network/auth-client.d.ts +57 -0
- package/esm/lib/network/auth-client.d.ts.map +1 -0
- package/esm/lib/network/auth-client.js +210 -0
- package/esm/package.json +3 -0
- package/package.json +51 -0
- package/presets/list_inbox.json +46 -0
- package/presets/reply.json +97 -0
- package/presets/send_mail.json +70 -0
- package/presets/send_mail_attachment.json +92 -0
- package/presets/send_mail_blob_attachment.json +74 -0
- package/shared/consts.json +11 -0
- package/shared/fixtures/pow_vectors.json +32 -0
- package/shared/help/fragments/inbox_cron_agent_prompt.md +1 -0
- package/shared/help/fragments/post_register_cron_reminder.md +5 -0
- package/shared/help/readme_stub.md +3 -0
- package/shared/help/topics/auth.md +8 -0
- package/shared/help/topics/cron.md +217 -0
- package/shared/help/topics/installation.md +35 -0
- package/shared/help/topics/jmap_cheatsheet.md +19 -0
- package/shared/help/topics/multi_account.md +9 -0
- package/shared/help/topics/overview.md +27 -0
- package/shared/help/topics/presets.md +12 -0
- package/shared/help/topics/tools.md +16 -0
- package/shared/help/topics/troubleshooting.md +6 -0
- package/shared/manifest.json +31 -0
- package/shared/messages/errors.json +68 -0
- package/shared/messages/hints.json +8 -0
- package/shared/presets/list_inbox.json +46 -0
- package/shared/presets/reply.json +97 -0
- package/shared/presets/send_mail.json +70 -0
- package/shared/presets/send_mail_attachment.json +92 -0
- package/shared/presets/send_mail_blob_attachment.json +74 -0
- package/shared/skill/SKILL.template.md +202 -0
- package/shared/skill/manifest.json +89 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"using": [
|
|
3
|
+
"urn:ietf:params:jmap:core",
|
|
4
|
+
"urn:ietf:params:jmap:mail",
|
|
5
|
+
"urn:ietf:params:jmap:submission"
|
|
6
|
+
],
|
|
7
|
+
"methodCalls": [
|
|
8
|
+
[
|
|
9
|
+
"Email/set",
|
|
10
|
+
{
|
|
11
|
+
"accountId": "$ACCOUNT_ID",
|
|
12
|
+
"create": {
|
|
13
|
+
"d1": {
|
|
14
|
+
"mailboxIds": {
|
|
15
|
+
"$INBOX_MAILBOX_ID": true
|
|
16
|
+
},
|
|
17
|
+
"from": [
|
|
18
|
+
{
|
|
19
|
+
"email": "$INBOX"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"to": [
|
|
23
|
+
{
|
|
24
|
+
"email": "$TO"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"subject": "$SUBJECT",
|
|
28
|
+
"textBody": [
|
|
29
|
+
{
|
|
30
|
+
"partId": "b",
|
|
31
|
+
"type": "text/plain"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"bodyValues": {
|
|
35
|
+
"b": {
|
|
36
|
+
"value": "$BODY"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"keywords": {
|
|
40
|
+
"$draft": true
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"c0"
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"EmailSubmission/set",
|
|
49
|
+
{
|
|
50
|
+
"accountId": "$ACCOUNT_ID",
|
|
51
|
+
"create": {
|
|
52
|
+
"s1": {
|
|
53
|
+
"emailId": "#d1",
|
|
54
|
+
"envelope": {
|
|
55
|
+
"mailFrom": {
|
|
56
|
+
"email": "$INBOX"
|
|
57
|
+
},
|
|
58
|
+
"rcptTo": [
|
|
59
|
+
{
|
|
60
|
+
"email": "$TO"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"c1"
|
|
68
|
+
]
|
|
69
|
+
]
|
|
70
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"using": [
|
|
3
|
+
"urn:ietf:params:jmap:core",
|
|
4
|
+
"urn:ietf:params:jmap:mail",
|
|
5
|
+
"urn:ietf:params:jmap:submission",
|
|
6
|
+
"urn:ietf:params:jmap:blob"
|
|
7
|
+
],
|
|
8
|
+
"methodCalls": [
|
|
9
|
+
[
|
|
10
|
+
"Blob/upload",
|
|
11
|
+
{
|
|
12
|
+
"accountId": "$ACCOUNT_ID",
|
|
13
|
+
"create": {
|
|
14
|
+
"b1": {
|
|
15
|
+
"data": [
|
|
16
|
+
{
|
|
17
|
+
"data:asBase64": "$ATTACHMENT_BASE64"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"type": "$ATTACHMENT_TYPE"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"b0"
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"Email/set",
|
|
28
|
+
{
|
|
29
|
+
"accountId": "$ACCOUNT_ID",
|
|
30
|
+
"create": {
|
|
31
|
+
"m1": {
|
|
32
|
+
"mailboxIds": {
|
|
33
|
+
"$INBOX_MAILBOX_ID": true
|
|
34
|
+
},
|
|
35
|
+
"from": [
|
|
36
|
+
{
|
|
37
|
+
"email": "$INBOX"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"to": [
|
|
41
|
+
{
|
|
42
|
+
"email": "$TO"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"subject": "$SUBJECT",
|
|
46
|
+
"bodyValues": {
|
|
47
|
+
"body1": {
|
|
48
|
+
"value": "$BODY"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"textBody": [
|
|
52
|
+
{
|
|
53
|
+
"partId": "body1",
|
|
54
|
+
"type": "text/plain"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"attachments": [
|
|
58
|
+
{
|
|
59
|
+
"blobId": "#b1",
|
|
60
|
+
"type": "$ATTACHMENT_TYPE",
|
|
61
|
+
"name": "$ATTACHMENT_NAME"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"m0"
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
"EmailSubmission/set",
|
|
71
|
+
{
|
|
72
|
+
"accountId": "$ACCOUNT_ID",
|
|
73
|
+
"create": {
|
|
74
|
+
"s1": {
|
|
75
|
+
"emailId": "#m1",
|
|
76
|
+
"envelope": {
|
|
77
|
+
"mailFrom": {
|
|
78
|
+
"email": "$INBOX"
|
|
79
|
+
},
|
|
80
|
+
"rcptTo": [
|
|
81
|
+
{
|
|
82
|
+
"email": "$TO"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"s0"
|
|
90
|
+
]
|
|
91
|
+
]
|
|
92
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"using": [
|
|
3
|
+
"urn:ietf:params:jmap:core",
|
|
4
|
+
"urn:ietf:params:jmap:mail",
|
|
5
|
+
"urn:ietf:params:jmap:submission"
|
|
6
|
+
],
|
|
7
|
+
"methodCalls": [
|
|
8
|
+
[
|
|
9
|
+
"Email/set",
|
|
10
|
+
{
|
|
11
|
+
"accountId": "$ACCOUNT_ID",
|
|
12
|
+
"create": {
|
|
13
|
+
"m1": {
|
|
14
|
+
"mailboxIds": {
|
|
15
|
+
"$INBOX_MAILBOX_ID": true
|
|
16
|
+
},
|
|
17
|
+
"from": [
|
|
18
|
+
{
|
|
19
|
+
"email": "$INBOX"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"to": [
|
|
23
|
+
{
|
|
24
|
+
"email": "$TO"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"subject": "$SUBJECT",
|
|
28
|
+
"bodyValues": {
|
|
29
|
+
"body1": {
|
|
30
|
+
"value": "$BODY"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"textBody": [
|
|
34
|
+
{
|
|
35
|
+
"partId": "body1",
|
|
36
|
+
"type": "text/plain"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"attachments": [
|
|
40
|
+
{
|
|
41
|
+
"blobId": "$ATTACHMENT_0_BLOB_ID",
|
|
42
|
+
"type": "$ATTACHMENT_0_TYPE",
|
|
43
|
+
"name": "$ATTACHMENT_0_NAME"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"m0"
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"EmailSubmission/set",
|
|
53
|
+
{
|
|
54
|
+
"accountId": "$ACCOUNT_ID",
|
|
55
|
+
"create": {
|
|
56
|
+
"s1": {
|
|
57
|
+
"emailId": "#m1",
|
|
58
|
+
"envelope": {
|
|
59
|
+
"mailFrom": {
|
|
60
|
+
"email": "$INBOX"
|
|
61
|
+
},
|
|
62
|
+
"rcptTo": [
|
|
63
|
+
{
|
|
64
|
+
"email": "$TO"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"s0"
|
|
72
|
+
]
|
|
73
|
+
]
|
|
74
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"DEFAULT_POW_SCRYPT_SALT_HEX": "0b980734412c292d6549110276b604ab1dea4883bd460d77d1b984adf8bca083",
|
|
3
|
+
"DEFAULT_AUTH_URL": "https://auth.atomicmail.ai",
|
|
4
|
+
"DEFAULT_API_URL": "https://api.atomicmail.ai",
|
|
5
|
+
"ONE_SEC_MS": 1000,
|
|
6
|
+
"ONE_MIN_MS": 60000,
|
|
7
|
+
"ONE_HOUR_MS": 3600000,
|
|
8
|
+
"ONE_DAY_MS": 86400000,
|
|
9
|
+
"ONE_MONTH_MS": 2592000000,
|
|
10
|
+
"ONE_YEAR_MS": 31536000000
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generated_by": "ts/generate_pow_vectors.ts",
|
|
3
|
+
"scrypt": {
|
|
4
|
+
"N": 16384,
|
|
5
|
+
"r": 8,
|
|
6
|
+
"p": 1,
|
|
7
|
+
"dklen": 64
|
|
8
|
+
},
|
|
9
|
+
"vectors": [
|
|
10
|
+
{
|
|
11
|
+
"challenge": "fixture-alpha",
|
|
12
|
+
"difficulty": 4,
|
|
13
|
+
"nonce": "4",
|
|
14
|
+
"powHex": "0e365cf9d7a9a9d515b5362da1ed60b3c287d6b5de7f5f0e55b15bd8a34dd3605695e20f01fb60fbfd64f21dfafe151dcf22ba6b85bbd932fb569f89150c7c50",
|
|
15
|
+
"salt": "0b980734412c292d6549110276b604ab1dea4883bd460d77d1b984adf8bca083"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"challenge": "fixture-beta",
|
|
19
|
+
"difficulty": 6,
|
|
20
|
+
"nonce": "51",
|
|
21
|
+
"powHex": "0326f14661b1f70377aafd19280fcf8f6f21a0aec4ef3af4bd3c37493cc9b306ddaadce199044c03dbc013de84be945ef22e87675af65398de37b64a8cfedf38",
|
|
22
|
+
"salt": "0b980734412c292d6549110276b604ab1dea4883bd460d77d1b984adf8bca083"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"challenge": "fixture-gamma",
|
|
26
|
+
"difficulty": 8,
|
|
27
|
+
"nonce": "80",
|
|
28
|
+
"powHex": "004f0f2b137a745d72ff9ba1cacda12d8a8c8c309060abd918d78116e4f3e7b60dbe9f2653d1c357e6835e552523f132baaf39877deb2b14f36b3f0c3cd41748",
|
|
29
|
+
"salt": "0b980734412c292d6549110276b604ab1dea4883bd460d77d1b984adf8bca083"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Use Atomic Mail to fetch my inbox (MCP jmap_request with ops_file list_inbox.json, or atomicmail jmap_request --ops-file list_inbox.json). Summarize new messages, highlight what needs a reply, and stay available — I may ask you to reply, forward, search, or dig into something important.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
AFTER REGISTER — INBOX POLLING
|
|
2
|
+
Choose the path that matches your runtime (help topic "cron"):
|
|
3
|
+
• 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.
|
|
4
|
+
• 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.
|
|
5
|
+
• Forbidden: register in one runtime and schedule the cron job on another.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Atomic Mail — Auth flow
|
|
2
|
+
|
|
3
|
+
1. `POST /api/v1/challenge` to get challenge JWT from `Authorization` header.
|
|
4
|
+
2. Solve PoW with scrypt (`N=16384,r=8,p=1,dklen=64`).
|
|
5
|
+
3. `POST /api/v1/session` with challenge JWT + PoW fields in JSON body.
|
|
6
|
+
4. `POST /api/v1/capability` with session JWT to get capability JWT.
|
|
7
|
+
|
|
8
|
+
JWTs are refreshed automatically and persisted to disk.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Inbox polling (after register)
|
|
2
|
+
|
|
3
|
+
Registration only creates credentials. For a useful inbox integration, inbound
|
|
4
|
+
mail should be fetched and triaged about once per hour between interactive
|
|
5
|
+
sessions.
|
|
6
|
+
|
|
7
|
+
**Choose the path that matches your runtime — do not mix platforms.**
|
|
8
|
+
|
|
9
|
+
## If your host supports scheduled jobs
|
|
10
|
+
|
|
11
|
+
If you have a **native** way to enable cron or recurring agent turns (OpenClaw,
|
|
12
|
+
Hermes, atomic-agent, and similar hosts), set up an hourly **agent** job after
|
|
13
|
+
the first successful `register`. The job must **invoke an AI agent** (not just the
|
|
14
|
+
Atomic Mail CLI) to fetch and triage mail. Wire Atomic Mail MCP or AgentSkill
|
|
15
|
+
into that agent before scheduling.
|
|
16
|
+
|
|
17
|
+
The scheduled turn should call preset `list_inbox.json` (`Email/query` +
|
|
18
|
+
`Email/get`, latest 50; built-ins `$ACCOUNT_ID`, `$INBOX_MAILBOX_ID` — no extra
|
|
19
|
+
`vars`).
|
|
20
|
+
|
|
21
|
+
## If your host does **not** support scheduled jobs
|
|
22
|
+
|
|
23
|
+
Examples: Claude, Pi, Cursor, and other chat or terminal agents without a cron
|
|
24
|
+
API.
|
|
25
|
+
|
|
26
|
+
**Do not spend tokens trying to work around this** — no wrapper scripts, OS
|
|
27
|
+
crontab/LaunchAgent setup, or scheduling on a different platform on the agent's
|
|
28
|
+
behalf.
|
|
29
|
+
|
|
30
|
+
After a successful `register`, do one of the following:
|
|
31
|
+
|
|
32
|
+
1. **Ask your operator** to set up hourly inbox polling on a host that supports
|
|
33
|
+
it (share the examples below), **or**
|
|
34
|
+
2. **Remind your operator** to fetch mail manually when they need updates
|
|
35
|
+
(`jmap_request` with `list_inbox.json`, or `atomicmail jmap_request
|
|
36
|
+
--ops-file list_inbox.json`).
|
|
37
|
+
|
|
38
|
+
## Forbidden: cross-platform scheduling
|
|
39
|
+
|
|
40
|
+
Do **not** register in one runtime and schedule the cron job on another. Example
|
|
41
|
+
of forbidden behavior: Pi runs `register`, then creates an OpenClaw cron job.
|
|
42
|
+
Either the same runtime that registered schedules polling, or the operator
|
|
43
|
+
schedules it themselves on a capable host.
|
|
44
|
+
|
|
45
|
+
## What not to do (any runtime)
|
|
46
|
+
|
|
47
|
+
- **Raw CLI in crontab** — `atomicmail jmap_request --ops-file list_inbox.json`
|
|
48
|
+
alone only fetches JSON; no agent runs and nothing prompts the operator to
|
|
49
|
+
reply.
|
|
50
|
+
- **Headless one-shot CLIs** — `claude -p`, `pi -p`, `agent -p`, `codex exec`,
|
|
51
|
+
`gemini -p` print and exit; the operator cannot continue the thread to reply
|
|
52
|
+
or forward.
|
|
53
|
+
|
|
54
|
+
## Agent prompt (use in scheduled jobs or manual fetches)
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
Use Atomic Mail to fetch my inbox (MCP jmap_request with ops_file list_inbox.json, or atomicmail jmap_request --ops-file list_inbox.json). Summarize new messages, highlight what needs a reply, and stay available — I may ask you to reply, forward, search, or dig into something important.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Scheduling examples (for capable hosts or operators)
|
|
61
|
+
|
|
62
|
+
| Your setup | Recommended approach |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| OpenClaw gateway | Built-in `openclaw cron` |
|
|
65
|
+
| Hermes Agent | Install Atomic Mail skill → `/suggestions` blueprint after `register` (or manual `hermes cron`) |
|
|
66
|
+
| Atomic Bot (atomicbot.ai) | Same as OpenClaw or Hermes host |
|
|
67
|
+
| atomic-agent | Built-in `atomic-agent task create` |
|
|
68
|
+
| No native cron (Claude, Pi, Cursor, …) | Ask operator to schedule on a capable host, or remind them to fetch manually |
|
|
69
|
+
|
|
70
|
+
These examples run a full agent turn and deliver the summary to a chat or file so
|
|
71
|
+
the operator can reply, forward, or ask follow-ups in the same thread.
|
|
72
|
+
|
|
73
|
+
### OpenClaw
|
|
74
|
+
|
|
75
|
+
Docs: https://docs.openclaw.ai/automation/cron-jobs
|
|
76
|
+
|
|
77
|
+
- Schedule: `--cron "0 * * * *"` or `--every 1h`
|
|
78
|
+
- Session: `--session isolated` (fresh turn each run)
|
|
79
|
+
- Delivery: `--announce` (posts to your configured channel)
|
|
80
|
+
- Prompt: `--message` with the agent prompt above
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
openclaw cron add \
|
|
84
|
+
--name "atomicmail-inbox" \
|
|
85
|
+
--cron "0 * * * *" \
|
|
86
|
+
--session isolated \
|
|
87
|
+
--message "Use Atomic Mail to fetch my inbox (MCP jmap_request with ops_file list_inbox.json, or atomicmail jmap_request --ops-file list_inbox.json). Summarize new messages, highlight what needs a reply, and stay available — I may ask you to reply, forward, search, or dig into something important." \
|
|
88
|
+
--announce
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Manage: `openclaw cron list` · test: `openclaw cron run <job-id>`
|
|
92
|
+
|
|
93
|
+
### Hermes Agent
|
|
94
|
+
|
|
95
|
+
Skill blueprints: https://hermes-agent.nousresearch.com/docs/developer-guide/creating-skills
|
|
96
|
+
|
|
97
|
+
Cron (manual fallback): https://hermes-agent.nousresearch.com/docs/user-guide/features/cron
|
|
98
|
+
|
|
99
|
+
#### Recommended: skill + blueprint
|
|
100
|
+
|
|
101
|
+
1. Install the **Atomic Mail** skill from the unified in-repo tap
|
|
102
|
+
(`hermes skills install Atomic-Mail/atomic-mail-agentic/integrations/skill/atomicmail`).
|
|
103
|
+
2. After the first successful `register`, accept the hourly inbox **blueprint**
|
|
104
|
+
via `/suggestions`.
|
|
105
|
+
|
|
106
|
+
The blueprint schedules a full **agent** turn (`no_agent: false`) with
|
|
107
|
+
`list_inbox.json` and delivers to `origin`. Do **not** skip this step. Do **not**
|
|
108
|
+
schedule raw `jmap_request` cron jobs or use `--no-agent` (script-only; no LLM).
|
|
109
|
+
|
|
110
|
+
#### Credentials on Hermes
|
|
111
|
+
|
|
112
|
+
- Default directory: `~/.hermes/atomicmail` (not `~/.atomicmail`).
|
|
113
|
+
- The skill launcher sets `ATOMIC_MAIL_CREDENTIALS_DIR` to
|
|
114
|
+
`$HOME/.hermes/atomicmail` when that variable is **not** already set — operator
|
|
115
|
+
overrides are preserved.
|
|
116
|
+
- Override explicitly with `ATOMIC_MAIL_CREDENTIALS_DIR` or
|
|
117
|
+
`atomicmail.credentials_dir` in Hermes config.
|
|
118
|
+
|
|
119
|
+
#### Multi-account only
|
|
120
|
+
|
|
121
|
+
Operating multiple inboxes at once: pass `--credentials-dir` (skill) or
|
|
122
|
+
`credentials_dir` (MCP) on `register` / `jmap_request` with a separate directory
|
|
123
|
+
per account. Not needed for the default single-inbox flow.
|
|
124
|
+
|
|
125
|
+
#### Manual fallback: `hermes cron`
|
|
126
|
+
|
|
127
|
+
If you are not using the skill blueprint, create the job manually:
|
|
128
|
+
|
|
129
|
+
- Schedule: cron expression (`0 * * * *`) or natural language (`every 1h`)
|
|
130
|
+
- Delivery: `--deliver origin` (or `telegram`, `discord`, `slack`, `email`,
|
|
131
|
+
`local`, etc.)
|
|
132
|
+
- **Do not** use `--no-agent`
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
hermes cron create "0 * * * *" \
|
|
136
|
+
"Use Atomic Mail to fetch my inbox (MCP jmap_request with ops_file list_inbox.json, or atomicmail jmap_request --ops-file list_inbox.json). Summarize new messages, highlight what needs a reply, and stay available — I may ask you to reply, forward, search, or dig into something important." \
|
|
137
|
+
--name "atomicmail-inbox" \
|
|
138
|
+
--deliver origin
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
In chat: `/cron add "0 * * * *" "<prompt>" --deliver origin`. Manage:
|
|
142
|
+
`hermes cron list` · test: `hermes cron run <job-id>`
|
|
143
|
+
|
|
144
|
+
### Atomic Bot (atomicbot.ai)
|
|
145
|
+
|
|
146
|
+
Runs OpenClaw or Hermes — use the matching block above.
|
|
147
|
+
|
|
148
|
+
### atomic-agent
|
|
149
|
+
|
|
150
|
+
Docs: https://github.com/AtomicBot-ai/atomic-agent
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
atomic-agent task create \
|
|
154
|
+
--cron "0 * * * *" \
|
|
155
|
+
--message "Use Atomic Mail to fetch my inbox (MCP jmap_request with ops_file list_inbox.json, or atomicmail jmap_request --ops-file list_inbox.json). Summarize new messages, highlight what needs a reply, and stay available — I may ask you to reply, forward, search, or dig into something important."
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Manage: `atomic-agent task list`
|
|
159
|
+
|
|
160
|
+
## Verify setup
|
|
161
|
+
|
|
162
|
+
After scheduling (or after asking your operator to schedule):
|
|
163
|
+
|
|
164
|
+
1. `register` succeeded; Atomic Mail MCP or AgentSkill is available to the agent.
|
|
165
|
+
2. Run the agent prompt **once manually**; confirm inbox fetch and follow-up work.
|
|
166
|
+
3. Confirm the job is registered (`openclaw cron list`, `hermes cron list`,
|
|
167
|
+
`atomic-agent task list`).
|
|
168
|
+
|
|
169
|
+
## For operators: OS scheduling on terminal hosts
|
|
170
|
+
|
|
171
|
+
This section is **operator documentation**, not an agent obligation. Chat agents
|
|
172
|
+
without native cron (Claude, Pi, Cursor, …) should **not** attempt OS scheduling
|
|
173
|
+
themselves — ask the operator to set up polling on a capable host or fetch mail
|
|
174
|
+
manually.
|
|
175
|
+
|
|
176
|
+
If you (the operator) run a **terminal CLI agent** and want hourly inbox checks
|
|
177
|
+
without OpenClaw, Hermes, or similar, the scheduler must **start an interactive
|
|
178
|
+
session** with the agent prompt — not call `atomicmail` directly.
|
|
179
|
+
|
|
180
|
+
### Terminal agents (interactive invocation)
|
|
181
|
+
|
|
182
|
+
| Agent | Start interactively | Avoid for inbox polling |
|
|
183
|
+
| --- | --- | --- |
|
|
184
|
+
| Claude Code | `claude "prompt"` | `claude -p` |
|
|
185
|
+
| Pi | `pi "prompt"` | `pi -p` |
|
|
186
|
+
| Cursor CLI | `agent "prompt"` | `agent -p` |
|
|
187
|
+
| Gemini CLI | `gemini -i "prompt"` | `gemini -p` |
|
|
188
|
+
| Codex CLI | `codex` (TUI) | `codex exec` |
|
|
189
|
+
|
|
190
|
+
Resolve the binary on **your** machine (`command -v claude`, `command -v pi`,
|
|
191
|
+
etc.) and use that path in scripts.
|
|
192
|
+
|
|
193
|
+
### OS scheduling approaches
|
|
194
|
+
|
|
195
|
+
Pick what fits your OS and how you work:
|
|
196
|
+
|
|
197
|
+
**A. Wrapper script + user crontab**
|
|
198
|
+
|
|
199
|
+
Write a small script that (1) sets any API keys the agent needs, (2) launches
|
|
200
|
+
your terminal emulator or GUI session, (3) runs the agent **interactively** with
|
|
201
|
+
the prompt. Point crontab at the script. Cron does not load shell startup
|
|
202
|
+
files — export env vars inside the script.
|
|
203
|
+
|
|
204
|
+
**B. macOS LaunchAgent**
|
|
205
|
+
|
|
206
|
+
A `LaunchAgents` plist on a calendar interval often works better than crontab
|
|
207
|
+
for opening Terminal or iTerm and starting an interactive agent in the logged-in
|
|
208
|
+
GUI session.
|
|
209
|
+
|
|
210
|
+
**C. Linux graphical session**
|
|
211
|
+
|
|
212
|
+
Schedule via user crontab or a **systemd user timer**, launching a terminal
|
|
213
|
+
emulator only when a graphical session is active (`DISPLAY`,
|
|
214
|
+
`DBUS_SESSION_BUS_ADDRESS` for your session).
|
|
215
|
+
|
|
216
|
+
Test manually before automating: run the same command you intend to schedule and
|
|
217
|
+
confirm the agent can call `list_inbox.json` and wait for your replies.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Atomic Mail — Installation
|
|
2
|
+
|
|
3
|
+
## MCP (stdio)
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"mcpServers": {
|
|
8
|
+
"atomicmail": {
|
|
9
|
+
"command": "npx",
|
|
10
|
+
"args": ["-y", "@atomicmail/mcp"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## AgentSkill (shell)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx --package=@atomicmail/agent-skill atomicmail register --username "myagent"
|
|
20
|
+
npx --package=@atomicmail/agent-skill atomicmail jmap_request --ops-file list_inbox.json
|
|
21
|
+
npx --package=@atomicmail/agent-skill atomicmail help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## After register: hourly inbox polling
|
|
25
|
+
|
|
26
|
+
Registration only creates credentials. Arrange hourly inbox polling per your
|
|
27
|
+
runtime (see **cron** topic):
|
|
28
|
+
|
|
29
|
+
- **Native cron host** (OpenClaw, Hermes, atomic-agent, …): schedule an hourly
|
|
30
|
+
**agent** turn with `list_inbox.json` inside the prompt.
|
|
31
|
+
- **No native cron** (Claude, Pi, Cursor, …): ask your operator to set up
|
|
32
|
+
polling on a capable host, or remind them to fetch mail manually when needed.
|
|
33
|
+
Do not work around this with wrapper scripts or OS schedulers.
|
|
34
|
+
|
|
35
|
+
Do not cron `atomicmail jmap_request` alone.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# JMAP cheatsheet
|
|
2
|
+
|
|
3
|
+
## Capabilities (`using`)
|
|
4
|
+
|
|
5
|
+
- `urn:ietf:params:jmap:core`
|
|
6
|
+
- `urn:ietf:params:jmap:mail`
|
|
7
|
+
- `urn:ietf:params:jmap:submission`
|
|
8
|
+
- `urn:ietf:params:jmap:blob`
|
|
9
|
+
|
|
10
|
+
## Placeholders
|
|
11
|
+
|
|
12
|
+
- `$ACCOUNT_ID`, `$INBOX`, `$INBOX_MAILBOX_ID`, `$UPLOAD_URL`, `$DOWNLOAD_URL`
|
|
13
|
+
- Any other `$NAME` must come from `vars` / `--vars`.
|
|
14
|
+
|
|
15
|
+
## Notes
|
|
16
|
+
|
|
17
|
+
- Bare methodCalls arrays default to core+mail only.
|
|
18
|
+
- For submission/blob methods use a full envelope with `using`.
|
|
19
|
+
- `inMailbox` expects mailbox id (`$INBOX_MAILBOX_ID`), not email address.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Atomic Mail — Overview
|
|
2
|
+
|
|
3
|
+
Atomic Mail is an email service provider (ESP) designed for AI agents. You manage
|
|
4
|
+
mail over JMAP (RFC 8620 + RFC 8621).
|
|
5
|
+
|
|
6
|
+
## Public surface
|
|
7
|
+
|
|
8
|
+
Three operations only:
|
|
9
|
+
|
|
10
|
+
1. **register** — proof-of-work signup with optional idempotent replay.
|
|
11
|
+
2. **jmap_request** — run JMAP method-call batches with auth + JWT rotation.
|
|
12
|
+
3. **help** — read built-in docs and package README.
|
|
13
|
+
|
|
14
|
+
## Typical workflow
|
|
15
|
+
|
|
16
|
+
1. Register with a username (5–21 chars).
|
|
17
|
+
2. After register, arrange hourly inbox polling per your runtime (see **cron**
|
|
18
|
+
topic — native scheduler if available; otherwise ask your operator or remind
|
|
19
|
+
manual fetch). Do not cron `atomicmail jmap_request` alone.
|
|
20
|
+
3. Use `jmap_request` with `ops` or `ops_file`; supply `vars` as needed.
|
|
21
|
+
4. Use `help` topics before guessing protocol details.
|
|
22
|
+
|
|
23
|
+
AFTER REGISTER — INBOX POLLING
|
|
24
|
+
Choose the path that matches your runtime (help topic "cron"):
|
|
25
|
+
• 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.
|
|
26
|
+
• 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.
|
|
27
|
+
• Forbidden: register in one runtime and schedule the cron job on another.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# JMAP presets
|
|
2
|
+
|
|
3
|
+
Bundled presets:
|
|
4
|
+
|
|
5
|
+
- `send_mail.json`
|
|
6
|
+
- `list_inbox.json`
|
|
7
|
+
- `reply.json`
|
|
8
|
+
- `send_mail_attachment.json`
|
|
9
|
+
- `send_mail_blob_attachment.json`
|
|
10
|
+
|
|
11
|
+
Relative `ops_file` paths resolve from credentials directory first, then bundled
|
|
12
|
+
presets shipped with the package.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Tool / CLI reference
|
|
2
|
+
|
|
3
|
+
## register
|
|
4
|
+
|
|
5
|
+
- MCP: `{ "username": string, "credentials_dir"?: string, "forced"?: boolean }`
|
|
6
|
+
- Skill: `register --username NAME [--credentials-dir DIR] [--forced]`
|
|
7
|
+
|
|
8
|
+
## jmap_request
|
|
9
|
+
|
|
10
|
+
- MCP: one of `ops` or `ops_file`, optional `vars`, optional `attachments`.
|
|
11
|
+
- Skill: one of `--ops` or `--ops-file`, optional `--vars`, `--attachment`.
|
|
12
|
+
|
|
13
|
+
## help
|
|
14
|
+
|
|
15
|
+
- MCP: `{ "topic"?: string }`
|
|
16
|
+
- Skill: `help [--topic TOPIC]`
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
- Missing API key: run `register` or provide valid credentials.
|
|
4
|
+
- Wrong `inMailbox`: use `$INBOX_MAILBOX_ID` (mailbox id), not inbox email.
|
|
5
|
+
- Blob/upload shape errors: `data` must be an array of datasource objects.
|
|
6
|
+
- Missing variables (`$TO`, etc.): provide them via `vars` / `--vars`.
|