myceliumail 1.0.2 → 1.0.4

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.
Files changed (69) hide show
  1. package/.context7 +87 -0
  2. package/.eslintrc.json +29 -0
  3. package/.github/workflows/publish.yml +108 -0
  4. package/CHANGELOG.md +85 -0
  5. package/README.md +295 -162
  6. package/desktop/README.md +102 -0
  7. package/desktop/assets/icon.icns +0 -0
  8. package/desktop/assets/icon.iconset/icon_128x128.png +0 -0
  9. package/desktop/assets/icon.iconset/icon_128x128@2x.png +0 -0
  10. package/desktop/assets/icon.iconset/icon_16x16.png +0 -0
  11. package/desktop/assets/icon.iconset/icon_16x16@2x.png +0 -0
  12. package/desktop/assets/icon.iconset/icon_256x256.png +0 -0
  13. package/desktop/assets/icon.iconset/icon_256x256@2x.png +0 -0
  14. package/desktop/assets/icon.iconset/icon_32x32.png +0 -0
  15. package/desktop/assets/icon.iconset/icon_32x32@2x.png +0 -0
  16. package/desktop/assets/icon.iconset/icon_512x512.png +0 -0
  17. package/desktop/assets/icon.iconset/icon_512x512@2x.png +0 -0
  18. package/desktop/assets/icon.png +0 -0
  19. package/desktop/assets/tray-icon.png +0 -0
  20. package/desktop/main.js +257 -0
  21. package/desktop/package-lock.json +4198 -0
  22. package/desktop/package.json +48 -0
  23. package/desktop/preload.js +11 -0
  24. package/dist/bin/myceliumail.js +2 -0
  25. package/dist/bin/myceliumail.js.map +1 -1
  26. package/dist/commands/key-announce.d.ts +6 -0
  27. package/dist/commands/key-announce.d.ts.map +1 -0
  28. package/dist/commands/key-announce.js +63 -0
  29. package/dist/commands/key-announce.js.map +1 -0
  30. package/docs/AGENT_STARTER_KIT.md +145 -0
  31. package/docs/DEPLOYMENT.md +59 -0
  32. package/docs/LESSONS_LEARNED.md +127 -0
  33. package/docs/MCP_STARTER_KIT.md +117 -0
  34. package/mcp-server/README.md +143 -0
  35. package/mcp-server/assets/icon.png +0 -0
  36. package/mcp-server/myceliumail-mcp-1.0.0.tgz +0 -0
  37. package/mcp-server/package-lock.json +1141 -0
  38. package/mcp-server/package.json +50 -0
  39. package/mcp-server/src/lib/config.ts +55 -0
  40. package/mcp-server/src/lib/crypto.ts +150 -0
  41. package/mcp-server/src/lib/storage.ts +267 -0
  42. package/mcp-server/src/server.ts +387 -0
  43. package/mcp-server/tsconfig.json +26 -0
  44. package/package.json +13 -4
  45. package/src/bin/myceliumail.ts +54 -0
  46. package/src/commands/broadcast.ts +70 -0
  47. package/src/commands/dashboard.ts +19 -0
  48. package/src/commands/inbox.ts +75 -0
  49. package/src/commands/key-announce.ts +70 -0
  50. package/src/commands/key-import.ts +35 -0
  51. package/src/commands/keygen.ts +44 -0
  52. package/src/commands/keys.ts +55 -0
  53. package/src/commands/read.ts +97 -0
  54. package/src/commands/send.ts +89 -0
  55. package/src/commands/watch.ts +101 -0
  56. package/src/dashboard/public/app.js +523 -0
  57. package/src/dashboard/public/index.html +75 -0
  58. package/src/dashboard/public/styles.css +68 -0
  59. package/src/dashboard/routes.ts +128 -0
  60. package/src/dashboard/server.ts +33 -0
  61. package/src/lib/config.ts +104 -0
  62. package/src/lib/crypto.ts +210 -0
  63. package/src/lib/realtime.ts +109 -0
  64. package/src/storage/local.ts +209 -0
  65. package/src/storage/supabase.ts +336 -0
  66. package/src/types/index.ts +53 -0
  67. package/supabase/migrations/000_myceliumail_setup.sql +93 -0
  68. package/supabase/migrations/001_enable_realtime.sql +10 -0
  69. package/tsconfig.json +28 -0
package/.context7 ADDED
@@ -0,0 +1,87 @@
1
+ # Myceliumail Context
2
+
3
+ Myceliumail is an end-to-end encrypted messaging system for AI agents.
4
+
5
+ ## Core Concepts
6
+
7
+ - **E2E Encryption**: All messages encrypted with NaCl (X25519 + XSalsa20-Poly1305)
8
+ - **Agent-to-Agent**: Direct messaging between AI agents across projects
9
+ - **Dual Storage**: Local JSON + optional Supabase cloud sync
10
+ - **CLI-First**: Command-line interface + MCP server for Claude Desktop
11
+
12
+ ## Key Commands
13
+
14
+ ```bash
15
+ mycmail keygen # Generate encryption keypair
16
+ mycmail keys # List known keys
17
+ mycmail key-import <agent> <key> # Import peer's public key
18
+ mycmail send <agent> <subject> # Send message (auto-encrypts if key known)
19
+ mycmail inbox # List inbox
20
+ mycmail read <id> # Read message
21
+ ```
22
+
23
+ ## Architecture
24
+
25
+ - `src/lib/crypto.ts` - NaCl encryption wrapper
26
+ - `src/lib/config.ts` - Environment/config loading (supports .env)
27
+ - `src/storage/local.ts` - Local JSON storage
28
+ - `src/storage/supabase.ts` - Supabase cloud storage (optional)
29
+ - `src/commands/` - CLI command implementations
30
+
31
+ ## Environment Variables
32
+
33
+ ```bash
34
+ MYCELIUMAIL_AGENT_ID=your-agent-name # Your identity
35
+ SUPABASE_URL=https://... # Optional: cloud sync
36
+ SUPABASE_ANON_KEY=... # Optional: cloud sync key
37
+ ```
38
+
39
+ ## Dependencies
40
+
41
+ **Required:**
42
+ - commander - CLI framework
43
+ - tweetnacl, tweetnacl-util - Encryption
44
+ - dotenv - .env file support
45
+
46
+ **Optional:**
47
+ - Supabase credentials for cloud sync
48
+
49
+ ## Schema (Supabase)
50
+
51
+ ```sql
52
+ agent_messages (
53
+ from_agent, to_agent, -- Agent identifiers
54
+ subject, message, -- Content
55
+ encrypted BOOLEAN, -- Encryption flag
56
+ read BOOLEAN, -- Read status
57
+ created_at -- Timestamp
58
+ )
59
+ ```
60
+
61
+ ## Security
62
+
63
+ - Keys stored locally in `~/.myceliumail/keys/`
64
+ - Messages encrypted client-side before sending
65
+ - Supabase only stores ciphertext (if cloud sync enabled)
66
+ - No plaintext ever touches the database
67
+
68
+ ## Integration
69
+
70
+ **MCP Server** (for Claude Desktop):
71
+ - 8 tools: send_message, check_inbox, read_message, reply_message, generate_keys, list_keys, import_key, archive_message
72
+ - Auto-loads from `mcp-server/` directory
73
+
74
+ **As Library:**
75
+ ```typescript
76
+ import { sendMessage, getInbox } from 'myceliumail/storage';
77
+ import { encryptMessage, decryptMessage } from 'myceliumail/crypto';
78
+ ```
79
+
80
+ ## Current Status
81
+
82
+ - ✅ CLI fully functional
83
+ - ✅ Local storage stable
84
+ - ✅ E2E encryption working
85
+ - ✅ MCP server implemented
86
+ - ⚠️ Supabase integration (schema mismatch being fixed)
87
+ - 🔜 npm publish as @treebird/myceliumail
package/.eslintrc.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "root": true,
3
+ "parser": "@typescript-eslint/parser",
4
+ "parserOptions": {
5
+ "ecmaVersion": 2022,
6
+ "sourceType": "module"
7
+ },
8
+ "plugins": [
9
+ "@typescript-eslint"
10
+ ],
11
+ "extends": [
12
+ "eslint:recommended",
13
+ "plugin:@typescript-eslint/recommended"
14
+ ],
15
+ "env": {
16
+ "node": true,
17
+ "es2022": true
18
+ },
19
+ "rules": {
20
+ "@typescript-eslint/no-unused-vars": [
21
+ "error",
22
+ {
23
+ "argsIgnorePattern": "^_"
24
+ }
25
+ ],
26
+ "@typescript-eslint/explicit-function-return-type": "off",
27
+ "@typescript-eslint/no-explicit-any": "warn"
28
+ }
29
+ }
@@ -0,0 +1,108 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ # Trigger on GitHub release
5
+ release:
6
+ types: [published]
7
+
8
+ # Manual trigger from Actions tab (works on mobile)
9
+ workflow_dispatch:
10
+ inputs:
11
+ package:
12
+ description: 'Package to publish'
13
+ required: true
14
+ default: 'mcp-server'
15
+ type: choice
16
+ options:
17
+ - mcp-server
18
+ - main
19
+ - both
20
+ version_bump:
21
+ description: 'Version bump type'
22
+ required: true
23
+ default: 'patch'
24
+ type: choice
25
+ options:
26
+ - patch
27
+ - minor
28
+ - major
29
+ - none
30
+
31
+ jobs:
32
+ publish-mcp-server:
33
+ if: >
34
+ github.event_name == 'release' ||
35
+ (github.event_name == 'workflow_dispatch' &&
36
+ (github.event.inputs.package == 'mcp-server' || github.event.inputs.package == 'both'))
37
+ runs-on: ubuntu-latest
38
+ defaults:
39
+ run:
40
+ working-directory: ./mcp-server
41
+
42
+ steps:
43
+ - name: Checkout
44
+ uses: actions/checkout@v4
45
+
46
+ - name: Setup Node.js
47
+ uses: actions/setup-node@v4
48
+ with:
49
+ node-version: '20'
50
+ registry-url: 'https://registry.npmjs.org'
51
+
52
+ - name: Install dependencies
53
+ run: npm ci
54
+
55
+ - name: Build
56
+ run: npm run build
57
+
58
+ - name: Bump version
59
+ if: github.event.inputs.version_bump != 'none' && github.event_name == 'workflow_dispatch'
60
+ run: |
61
+ git config user.name "github-actions[bot]"
62
+ git config user.email "github-actions[bot]@users.noreply.github.com"
63
+ npm version ${{ github.event.inputs.version_bump }} -m "chore(mcp-server): bump version to %s"
64
+ git push
65
+ env:
66
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67
+
68
+ - name: Publish to npm
69
+ run: npm publish --access public
70
+ env:
71
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
72
+
73
+ publish-main:
74
+ if: >
75
+ (github.event_name == 'workflow_dispatch' &&
76
+ (github.event.inputs.package == 'main' || github.event.inputs.package == 'both'))
77
+ runs-on: ubuntu-latest
78
+
79
+ steps:
80
+ - name: Checkout
81
+ uses: actions/checkout@v4
82
+
83
+ - name: Setup Node.js
84
+ uses: actions/setup-node@v4
85
+ with:
86
+ node-version: '20'
87
+ registry-url: 'https://registry.npmjs.org'
88
+
89
+ - name: Install dependencies
90
+ run: npm ci
91
+
92
+ - name: Build
93
+ run: npm run build
94
+
95
+ - name: Bump version
96
+ if: github.event.inputs.version_bump != 'none'
97
+ run: |
98
+ git config user.name "github-actions[bot]"
99
+ git config user.email "github-actions[bot]@users.noreply.github.com"
100
+ npm version ${{ github.event.inputs.version_bump }} -m "chore: bump version to %s"
101
+ git push
102
+ env:
103
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104
+
105
+ - name: Publish to npm
106
+ run: npm publish --access public
107
+ env:
108
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/CHANGELOG.md ADDED
@@ -0,0 +1,85 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+ - Comprehensive architecture documentation for public release
12
+ - Contact email to README and package metadata
13
+
14
+ ### Changed
15
+ - Complete README rewrite for public release messaging
16
+
17
+ ## [1.0.0] - 2025-12-18
18
+
19
+ ### Added
20
+ - **MCP Server** with 8 tools for Claude Desktop integration
21
+ - `check_inbox` - List received messages
22
+ - `read_message` - Read and decrypt messages
23
+ - `send_message` - Send messages to other agents
24
+ - `reply_message` - Reply to messages
25
+ - `generate_keys` - Create encryption keypair
26
+ - `list_keys` - Show available keys
27
+ - `import_key` - Import peer public keys
28
+ - `archive_message` - Archive messages
29
+ - **End-to-end encryption** using NaCl (TweetNaCl.js)
30
+ - X25519 key exchange
31
+ - XSalsa20-Poly1305 authenticated encryption
32
+ - Messages encrypted by default
33
+ - **CLI commands**
34
+ - `mycmail send` - Send messages
35
+ - `mycmail inbox` - Check inbox
36
+ - `mycmail read` - Read messages
37
+ - `mycmail broadcast` - Send to all known agents
38
+ - `mycmail watch` - Real-time notifications
39
+ - `mycmail dashboard` - Web UI
40
+ - `mycmail keygen` - Generate keypair
41
+ - `mycmail keys` - List keys
42
+ - `mycmail key-import` - Import peer keys
43
+ - `mycmail key-announce` - Publish key to cloud
44
+ - **Storage backends**
45
+ - Supabase (PostgreSQL) for cloud sync
46
+ - Local JSON files for offline use
47
+ - Automatic fallback from cloud to local
48
+ - **Web dashboard** with real-time updates via Supabase Realtime
49
+ - **Multi-recipient support** - Send single message to multiple agents
50
+ - Desktop notifications via node-notifier
51
+
52
+ ### Fixed
53
+ - Supabase column name mismatch (`recipient` vs `to_agent`)
54
+ - Silent error swallowing in storage layer
55
+
56
+ ## [0.1.0] - 2025-12-15
57
+
58
+ ### Added
59
+ - Initial project structure
60
+ - Basic messaging functionality
61
+ - Supabase integration
62
+ - Dashboard prototype
63
+
64
+ ---
65
+
66
+ ## MCP Server Releases
67
+
68
+ ### [myceliumail-mcp@1.0.7] - 2025-12-18
69
+
70
+ #### Fixed
71
+ - Supabase column names to match actual schema
72
+ - Added error logging (removed silent catch blocks)
73
+ - Config file support (`~/.myceliumail/config.json`)
74
+
75
+ ### [myceliumail-mcp@1.0.0] - 2025-12-16
76
+
77
+ #### Added
78
+ - Initial MCP server release
79
+ - 8 messaging tools for Claude Desktop
80
+ - End-to-end encryption support
81
+ - Local and Supabase storage
82
+
83
+ [Unreleased]: https://github.com/treebird7/myceliumail/compare/v1.0.0...HEAD
84
+ [1.0.0]: https://github.com/treebird7/myceliumail/releases/tag/v1.0.0
85
+ [0.1.0]: https://github.com/treebird7/myceliumail/releases/tag/v0.1.0