pi-protonmail 0.1.0
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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/biome.json +25 -0
- package/package.json +63 -0
- package/src/constants.ts +1 -0
- package/src/hub.ts +559 -0
- package/src/index.ts +7 -0
- package/src/proton-bridge.ts +444 -0
- package/src/protonmail.ts +624 -0
- package/src/secret-refs.ts +81 -0
- package/src/types.ts +90 -0
- package/src/workspace.ts +96 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- Kept `/protonmail` as the single config command and moved Bridge/status/message handling into `protonmail_*` tools.
|
|
6
|
+
- Replaced the Python Bridge helper with a native TypeScript module and kept attachment import staging under profile-specific workspaces.
|
|
7
|
+
- Aligned the package metadata and docs with the Proton Mail workflow.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Serhii Khalymon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# pi-protonmail
|
|
2
|
+
|
|
3
|
+
Proton Mail Bridge Pi extension for mailbox discovery, message previews, attachment imports, and profile-based setup.
|
|
4
|
+
|
|
5
|
+
## Use cases
|
|
6
|
+
|
|
7
|
+
- `/protonmail` — open the interactive setup hub for profile defaults.
|
|
8
|
+
- `protonmail_*` tools — check Bridge status, list mailboxes, preview messages, and import attachments.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pi install npm:pi-protonmail
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
For local development:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pi install /absolute/path/to/this/repo
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Environment
|
|
23
|
+
|
|
24
|
+
Set the Proton Bridge connection variables in your Pi environment:
|
|
25
|
+
|
|
26
|
+
- `PROTON_BRIDGE_HOST`
|
|
27
|
+
- `PROTON_BRIDGE_IMAP_PORT`
|
|
28
|
+
- `PROTON_BRIDGE_SMTP_PORT`
|
|
29
|
+
- `PROTON_BRIDGE_IMAP_SECURITY`
|
|
30
|
+
- `PROTON_BRIDGE_USERNAME`
|
|
31
|
+
- `PROTON_BRIDGE_PASSWORD`
|
|
32
|
+
- `PROTON_BRIDGE_DEFAULT_MAILBOX` (optional)
|
|
33
|
+
|
|
34
|
+
These values may be raw strings or 1Password references resolved by the extension.
|
|
35
|
+
|
|
36
|
+
## Profiles and workspace
|
|
37
|
+
|
|
38
|
+
Profile settings are stored under `.pi/protonmail/`:
|
|
39
|
+
|
|
40
|
+
- `config.json` — workspace-level config
|
|
41
|
+
- `profiles/<name>/policy.json` — per-profile defaults
|
|
42
|
+
|
|
43
|
+
Profile defaults control the mailbox selection, mailbox filter, period, and optional import workspace override used by LLM-driven mail workflows. Attachment imports default to `.pi/protonmail/imports/<profile>/...`.
|
|
44
|
+
|
|
45
|
+
## Workflow
|
|
46
|
+
|
|
47
|
+
1. Configure Proton Bridge credentials.
|
|
48
|
+
2. Open `/protonmail` to choose or edit a profile.
|
|
49
|
+
3. Use `protonmail_*` tools for Bridge status, mailbox lookup, message previews, or staged attachment imports.
|
|
50
|
+
|
|
51
|
+
## Publishing
|
|
52
|
+
|
|
53
|
+
Tagged pushes like `v0.1.0` publish to npm through GitHub Actions. The release workflow validates the tag version, runs checks, and publishes with `NPM_TOKEN` when the version is not already on npm.
|
|
54
|
+
|
|
55
|
+
## Repository notes
|
|
56
|
+
|
|
57
|
+
- Entry point: `src/index.ts`
|
|
58
|
+
- Main extension logic: `src/protonmail.ts`
|
|
59
|
+
- Native Bridge implementation: `src/proton-bridge.ts`
|
|
60
|
+
- Setup hub: `src/hub.ts`
|
|
61
|
+
- Secret resolution: `src/secret-refs.ts`
|
|
62
|
+
|
|
63
|
+
## Troubleshooting
|
|
64
|
+
|
|
65
|
+
- If Bridge status fails, confirm the host, ports, and credentials are correct.
|
|
66
|
+
- If list or import commands return nothing, verify the default mailbox and active profile policy.
|
|
67
|
+
- If imports fail, check that the target period is set and matches `YYYY-MM`.
|
package/biome.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.1/schema.json",
|
|
3
|
+
"files": {
|
|
4
|
+
"includes": ["**", "!!**/.pi"]
|
|
5
|
+
},
|
|
6
|
+
"formatter": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"indentStyle": "tab",
|
|
9
|
+
"lineWidth": 100
|
|
10
|
+
},
|
|
11
|
+
"linter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"rules": {
|
|
14
|
+
"preset": "recommended"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"assist": {
|
|
18
|
+
"enabled": true,
|
|
19
|
+
"actions": {
|
|
20
|
+
"source": {
|
|
21
|
+
"organizeImports": "on"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-protonmail",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Proton Mail Bridge Pi extension for mailbox discovery and attachment imports.",
|
|
6
|
+
"homepage": "https://github.com/eirenik0/pi-protonmail#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/eirenik0/pi-protonmail.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/eirenik0/pi-protonmail/issues"
|
|
13
|
+
},
|
|
14
|
+
"author": "Serhii Khalymon <serhii.khalymon@pm.me>",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"pi-package",
|
|
18
|
+
"pi-extension",
|
|
19
|
+
"protonmail",
|
|
20
|
+
"proton-bridge"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=24"
|
|
27
|
+
},
|
|
28
|
+
"pi": {
|
|
29
|
+
"extensions": [
|
|
30
|
+
"./src/index.ts"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"src",
|
|
35
|
+
"README.md",
|
|
36
|
+
"CHANGELOG.md",
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"package.json",
|
|
39
|
+
"biome.json"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"lint": "biome lint .",
|
|
43
|
+
"format": "biome format --write .",
|
|
44
|
+
"format:check": "biome format .",
|
|
45
|
+
"check": "biome check .",
|
|
46
|
+
"check:docs": "lat check",
|
|
47
|
+
"prepublishOnly": "npm run check",
|
|
48
|
+
"fix": "biome check --write ."
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"effect": "^3.0.0",
|
|
52
|
+
"imapflow": "^1.1.1",
|
|
53
|
+
"mailparser": "^3.9.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@biomejs/biome": "^2.5.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
60
|
+
"@earendil-works/pi-tui": "*",
|
|
61
|
+
"typebox": "*"
|
|
62
|
+
}
|
|
63
|
+
}
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PREVIEW_LINES = 8;
|