shalomail 0.2.0 → 0.2.2
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 +13 -11
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +32 -32
- package/dist/shalom.mjs +60 -58
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Give your AI agents a real, end-to-end encrypted email address.
|
|
|
9
9
|
```sh
|
|
10
10
|
npm install -g shalomail # Node.js 20 or newer
|
|
11
11
|
shalom login # opens shalomail.com to connect this terminal
|
|
12
|
-
shalom agents create
|
|
12
|
+
shalom agents create yourname-bot # creates yourname-bot@shalomail.com
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
No global install? `npx shalomail <command>` works anywhere, for example `npx shalomail login`. The command answers to both `shalom` and `shalomail`.
|
|
@@ -47,7 +47,7 @@ Ids can be shortened to their first 8 characters. Text can also come from standa
|
|
|
47
47
|
shalom watch --exec "python agent.py" --mark-read
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
`watch` waits for new mail and runs your program once per message, with the message as JSON on standard input: `id`, `from`, `to`, `cc`, `subject`, `date`, `text`, `html`, `messageId`, `verifiedSender` and `attachments`. The environment also gets `SHALOM_MESSAGE_ID`, `SHALOM_FROM` and `SHALOM_SUBJECT`.
|
|
50
|
+
`watch` waits for new mail and runs your program once per message, with the message as JSON on standard input: `id`, `from`, `to`, `cc`, `subject`, `date`, `text`, `html`, `messageId`, `verifiedSender` and `attachments`. The environment also gets `SHALOM_MESSAGE_ID`, `SHALOM_FROM` and `SHALOM_SUBJECT`. With `--mark-read`, a message is marked read only after your program exits with 0, and messages still unread when `watch` restarts are handed to it again. In the SDK, `agent.watch({ includeUnread: true })` does the same.
|
|
51
51
|
|
|
52
52
|
```python
|
|
53
53
|
# agent.py
|
|
@@ -60,11 +60,11 @@ subprocess.run(["shalom", "reply", msg["id"], "--text", answer], check=True)
|
|
|
60
60
|
## Run it on a server
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
|
-
shalom agents export
|
|
63
|
+
shalom agents export yourname-bot@shalomail.com # prints SHALOM_AGENT_TOKEN
|
|
64
64
|
SHALOM_AGENT_TOKEN=shalom_agent_... shalom inbox --json
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
Store the token as a secret: it contains the mailbox's private key.
|
|
67
|
+
Store the token as a secret: it contains the mailbox's private key. On servers, prefer mounting it as a file and pointing `SHALOM_AGENT_TOKEN_FILE` to it; programs started by `watch --exec` never receive it.
|
|
68
68
|
|
|
69
69
|
## Commands
|
|
70
70
|
|
|
@@ -73,11 +73,11 @@ Store the token as a secret: it contains the mailbox's private key.
|
|
|
73
73
|
| `shalom login` | Connects this terminal to your account in the browser (`--no-browser`, `--key`) |
|
|
74
74
|
| `shalom agents list` | Lists your agent mailboxes and your plan |
|
|
75
75
|
| `shalom agents create <name>` | Creates `<name>@shalomail.com`, with the private key on this machine |
|
|
76
|
-
| `shalom agents delete <address>` | Deletes the mailbox and all its mail; the address stays reserved for you |
|
|
77
|
-
| `shalom agents rotate <address>` | Issues a new API key for the mailbox |
|
|
76
|
+
| `shalom agents delete <address>` | Deletes the mailbox and all its mail (needs the mailbox saved on this machine); the address stays reserved for you |
|
|
77
|
+
| `shalom agents rotate <address>` | Issues a new API key for the mailbox, sealed to its private key |
|
|
78
78
|
| `shalom agents export <address>` | Prints `SHALOM_AGENT_TOKEN` |
|
|
79
|
-
| `shalom agents import <token>` | Saves an exported mailbox on this machine |
|
|
80
|
-
| `shalom plan` / `shalom upgrade
|
|
79
|
+
| `shalom agents import <token>` | Saves an exported mailbox on this machine (`--yes` to replace one with other keys) |
|
|
80
|
+
| `shalom plan` / `shalom upgrade` | Shows your plan, or opens the plans page in the app |
|
|
81
81
|
| `shalom inbox` | Lists messages (`--folder`, `--limit`, `--unread`) |
|
|
82
82
|
| `shalom read <id>` | Opens a message (`--save-attachments <dir>`) |
|
|
83
83
|
| `shalom send` | Sends a message (`--to`, `--cc`, `--bcc`, `--subject`, `--text`, `--text-file`, `--html-file`, `--attach`) |
|
|
@@ -91,12 +91,14 @@ Every command accepts `--json`, `--as <address>` to pick the mailbox, and `--api
|
|
|
91
91
|
## Security
|
|
92
92
|
|
|
93
93
|
- Each mailbox's private key stays in `~/.config/shalom` (folder 700, files 600) or in your `SHALOM_AGENT_TOKEN`.
|
|
94
|
-
- Your account key
|
|
94
|
+
- Your account key creates agent mailboxes and shows your plan. It cannot read or send for a mailbox, cannot delete one without that mailbox's own key, and cannot touch billing: plans are changed in the app.
|
|
95
|
+
- The keys of shalomail.com are built into the package, so a swapped server or an intercepted connection cannot fake a verified sender.
|
|
95
96
|
- Between Shalom addresses, mail is sealed end to end and the sender is verified. To other providers it goes as regular email.
|
|
96
|
-
- The encryption keys of Shalom contacts are pinned on first use
|
|
97
|
+
- The encryption keys of Shalom contacts are pinned on first use, when you send to them or receive from them. If one changes, mail from that contact is no longer marked as verified (`verifiedSender: false`, `keyChanged: true`) and sending stops until you confirm with `--trust-new-key`.
|
|
98
|
+
- Text from emails (sender, subject, body, attachment names) is printed without terminal control characters, so a message cannot change your terminal.
|
|
97
99
|
|
|
98
100
|
## Plans
|
|
99
101
|
|
|
100
|
-
Free: 2 agent mailboxes. Agents 5: up to 5 for US$ 4.99 a month. Agents 12: up to 12 for US$ 9.99 a month. Unlimited: no mailbox limit, up to 250 new mailboxes a day, for US$ 49.90 a month. Subscribe on the AI agents page of the app
|
|
102
|
+
Free: 2 agent mailboxes. Agents 5: up to 5 for US$ 4.99 a month. Agents 12: up to 12 for US$ 9.99 a month. Unlimited: no mailbox limit, up to 250 new mailboxes a day, for US$ 49.90 a month. Subscribe on the AI agents page of the app (`shalom upgrade` opens it).
|
|
101
103
|
|
|
102
104
|
Docs: https://shalomail.com/en/agents/
|
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export declare class ApiError extends Error {
|
|
|
55
55
|
|
|
56
56
|
/** One agent mailbox. Opening, sealing and sending happen on your machine. */
|
|
57
57
|
export declare class Agent {
|
|
58
|
-
/** From SHALOM_AGENT_TOKEN (see `shalom agents export`). */
|
|
58
|
+
/** From SHALOM_AGENT_TOKEN or the file in SHALOM_AGENT_TOKEN_FILE (see `shalom agents export`). */
|
|
59
59
|
static fromToken(token?: string, opts?: { api?: string }): Agent;
|
|
60
60
|
/** From the file the CLI saved in ~/.config/shalom/agents. */
|
|
61
61
|
static fromFile(address: string, opts?: { api?: string }): Agent;
|
|
@@ -67,8 +67,8 @@ export declare class Agent {
|
|
|
67
67
|
reply(id: string, msg: { text: string; html?: string; all?: boolean; quote?: boolean; attachments?: Attachment[] }, opts?: { trustNewKey?: boolean }): Promise<SendResult>;
|
|
68
68
|
move(ids: string | string[], folder: 'inbox' | 'archive' | 'spam' | 'trash'): Promise<void>;
|
|
69
69
|
mark(ids: string | string[], change: { read?: boolean; starred?: boolean }): Promise<void>;
|
|
70
|
-
/** New inbox messages, one at a time, until the loop breaks or the signal aborts. */
|
|
71
|
-
watch(opts?: { interval?: number; signal?: AbortSignal; includeExisting?: boolean }): AsyncGenerator<Message>;
|
|
70
|
+
/** New inbox messages, one at a time, until the loop breaks or the signal aborts. includeUnread also yields the unread ones already there, to resume after a restart. */
|
|
71
|
+
watch(opts?: { interval?: number; signal?: AbortSignal; includeExisting?: boolean; includeUnread?: boolean }): AsyncGenerator<Message>;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/** Your account: creates and deletes agent mailboxes with the account API key. */
|
|
@@ -78,5 +78,6 @@ export declare class Account {
|
|
|
78
78
|
listAgents(): Promise<{ agents: { id: string; address: string; name: string; createdAt: number; paused: boolean }[]; plan: { plan: string; limit: number | null; used: number } }>;
|
|
79
79
|
/** The mailbox private key is created here. The returned token is the full credential: store it as a secret. */
|
|
80
80
|
createAgent(name: string, opts?: { displayName?: string; save?: boolean }): Promise<{ id: string; address: string; name: string; token: string }>;
|
|
81
|
-
|
|
81
|
+
/** Needs the mailbox's own credential: { token }, or the file the CLI saved. Or delete it in the app. */
|
|
82
|
+
deleteAgent(address: string, opts?: { token?: string }): Promise<void>;
|
|
82
83
|
}
|