myceliumail 1.0.1

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 (150) hide show
  1. package/.context7 +87 -0
  2. package/.env.example +12 -0
  3. package/.eslintrc.json +29 -0
  4. package/CLAUDE.md +35 -0
  5. package/COMPLETE.md +51 -0
  6. package/LICENSE +21 -0
  7. package/MYCELIUMAIL_STARTER_KIT.md +603 -0
  8. package/NEXT_STEPS.md +96 -0
  9. package/README.md +229 -0
  10. package/desktop/README.md +102 -0
  11. package/desktop/assets/icon.icns +0 -0
  12. package/desktop/assets/icon.iconset/icon_128x128.png +0 -0
  13. package/desktop/assets/icon.iconset/icon_128x128@2x.png +0 -0
  14. package/desktop/assets/icon.iconset/icon_16x16.png +0 -0
  15. package/desktop/assets/icon.iconset/icon_16x16@2x.png +0 -0
  16. package/desktop/assets/icon.iconset/icon_256x256.png +0 -0
  17. package/desktop/assets/icon.iconset/icon_256x256@2x.png +0 -0
  18. package/desktop/assets/icon.iconset/icon_32x32.png +0 -0
  19. package/desktop/assets/icon.iconset/icon_32x32@2x.png +0 -0
  20. package/desktop/assets/icon.iconset/icon_512x512.png +0 -0
  21. package/desktop/assets/icon.iconset/icon_512x512@2x.png +0 -0
  22. package/desktop/assets/icon.png +0 -0
  23. package/desktop/assets/tray-icon.png +0 -0
  24. package/desktop/main.js +257 -0
  25. package/desktop/package-lock.json +4198 -0
  26. package/desktop/package.json +48 -0
  27. package/desktop/preload.js +11 -0
  28. package/dist/bin/myceliumail.d.ts +8 -0
  29. package/dist/bin/myceliumail.d.ts.map +1 -0
  30. package/dist/bin/myceliumail.js +44 -0
  31. package/dist/bin/myceliumail.js.map +1 -0
  32. package/dist/commands/broadcast.d.ts +9 -0
  33. package/dist/commands/broadcast.d.ts.map +1 -0
  34. package/dist/commands/broadcast.js +59 -0
  35. package/dist/commands/broadcast.js.map +1 -0
  36. package/dist/commands/dashboard.d.ts +3 -0
  37. package/dist/commands/dashboard.d.ts.map +1 -0
  38. package/dist/commands/dashboard.js +18 -0
  39. package/dist/commands/dashboard.js.map +1 -0
  40. package/dist/commands/inbox.d.ts +6 -0
  41. package/dist/commands/inbox.d.ts.map +1 -0
  42. package/dist/commands/inbox.js +65 -0
  43. package/dist/commands/inbox.js.map +1 -0
  44. package/dist/commands/key-import.d.ts +6 -0
  45. package/dist/commands/key-import.d.ts.map +1 -0
  46. package/dist/commands/key-import.js +31 -0
  47. package/dist/commands/key-import.js.map +1 -0
  48. package/dist/commands/keygen.d.ts +6 -0
  49. package/dist/commands/keygen.d.ts.map +1 -0
  50. package/dist/commands/keygen.js +33 -0
  51. package/dist/commands/keygen.js.map +1 -0
  52. package/dist/commands/keys.d.ts +6 -0
  53. package/dist/commands/keys.d.ts.map +1 -0
  54. package/dist/commands/keys.js +47 -0
  55. package/dist/commands/keys.js.map +1 -0
  56. package/dist/commands/read.d.ts +6 -0
  57. package/dist/commands/read.d.ts.map +1 -0
  58. package/dist/commands/read.js +89 -0
  59. package/dist/commands/read.js.map +1 -0
  60. package/dist/commands/send.d.ts +8 -0
  61. package/dist/commands/send.d.ts.map +1 -0
  62. package/dist/commands/send.js +73 -0
  63. package/dist/commands/send.js.map +1 -0
  64. package/dist/commands/watch.d.ts +8 -0
  65. package/dist/commands/watch.d.ts.map +1 -0
  66. package/dist/commands/watch.js +88 -0
  67. package/dist/commands/watch.js.map +1 -0
  68. package/dist/dashboard/public/app.js +523 -0
  69. package/dist/dashboard/public/index.html +75 -0
  70. package/dist/dashboard/public/styles.css +68 -0
  71. package/dist/dashboard/routes.d.ts +3 -0
  72. package/dist/dashboard/routes.d.ts.map +1 -0
  73. package/dist/dashboard/routes.js +103 -0
  74. package/dist/dashboard/routes.js.map +1 -0
  75. package/dist/dashboard/server.d.ts +3 -0
  76. package/dist/dashboard/server.d.ts.map +1 -0
  77. package/dist/dashboard/server.js +29 -0
  78. package/dist/dashboard/server.js.map +1 -0
  79. package/dist/lib/config.d.ts +28 -0
  80. package/dist/lib/config.d.ts.map +1 -0
  81. package/dist/lib/config.js +90 -0
  82. package/dist/lib/config.js.map +1 -0
  83. package/dist/lib/crypto.d.ts +72 -0
  84. package/dist/lib/crypto.d.ts.map +1 -0
  85. package/dist/lib/crypto.js +169 -0
  86. package/dist/lib/crypto.js.map +1 -0
  87. package/dist/lib/realtime.d.ts +36 -0
  88. package/dist/lib/realtime.d.ts.map +1 -0
  89. package/dist/lib/realtime.js +73 -0
  90. package/dist/lib/realtime.js.map +1 -0
  91. package/dist/storage/local.d.ts +46 -0
  92. package/dist/storage/local.d.ts.map +1 -0
  93. package/dist/storage/local.js +160 -0
  94. package/dist/storage/local.js.map +1 -0
  95. package/dist/storage/supabase.d.ts +43 -0
  96. package/dist/storage/supabase.d.ts.map +1 -0
  97. package/dist/storage/supabase.js +256 -0
  98. package/dist/storage/supabase.js.map +1 -0
  99. package/dist/types/index.d.ts +48 -0
  100. package/dist/types/index.d.ts.map +1 -0
  101. package/dist/types/index.js +5 -0
  102. package/dist/types/index.js.map +1 -0
  103. package/docs/20251215_Treebird-Ecosystem_Knowledge-Base_v2.md +292 -0
  104. package/docs/20251215_Treebird-Ecosystem_Project-Instructions_v2.md +176 -0
  105. package/docs/AGENT_DELEGATION_WORKFLOW.md +453 -0
  106. package/docs/AGENT_STARTER_KIT.md +145 -0
  107. package/docs/ANNOUNCEMENT_DRAFTS.md +55 -0
  108. package/docs/DASHBOARD_AGENT_HANDOFF.md +429 -0
  109. package/docs/DASHBOARD_AGENT_PROMPT.md +32 -0
  110. package/docs/DASHBOARD_BUILD_ROADMAP.md +61 -0
  111. package/docs/DEPLOYMENT.md +59 -0
  112. package/docs/MCP_PUBLISHING_ROADMAP.md +113 -0
  113. package/docs/MCP_STARTER_KIT.md +117 -0
  114. package/docs/SSAN_MESSAGES_SUMMARY.md +92 -0
  115. package/docs/STORAGE_ARCHITECTURE.md +114 -0
  116. package/mcp-server/README.md +143 -0
  117. package/mcp-server/assets/icon.png +0 -0
  118. package/mcp-server/myceliumail-mcp-1.0.0.tgz +0 -0
  119. package/mcp-server/package-lock.json +1142 -0
  120. package/mcp-server/package.json +49 -0
  121. package/mcp-server/src/lib/config.ts +21 -0
  122. package/mcp-server/src/lib/crypto.ts +150 -0
  123. package/mcp-server/src/lib/storage.ts +257 -0
  124. package/mcp-server/src/server.ts +387 -0
  125. package/mcp-server/tsconfig.json +26 -0
  126. package/package.json +54 -0
  127. package/src/bin/myceliumail.ts +52 -0
  128. package/src/commands/broadcast.ts +70 -0
  129. package/src/commands/dashboard.ts +19 -0
  130. package/src/commands/inbox.ts +75 -0
  131. package/src/commands/key-import.ts +35 -0
  132. package/src/commands/keygen.ts +44 -0
  133. package/src/commands/keys.ts +55 -0
  134. package/src/commands/read.ts +97 -0
  135. package/src/commands/send.ts +89 -0
  136. package/src/commands/watch.ts +101 -0
  137. package/src/dashboard/public/app.js +523 -0
  138. package/src/dashboard/public/index.html +75 -0
  139. package/src/dashboard/public/styles.css +68 -0
  140. package/src/dashboard/routes.ts +128 -0
  141. package/src/dashboard/server.ts +33 -0
  142. package/src/lib/config.ts +104 -0
  143. package/src/lib/crypto.ts +210 -0
  144. package/src/lib/realtime.ts +109 -0
  145. package/src/storage/local.ts +209 -0
  146. package/src/storage/supabase.ts +336 -0
  147. package/src/types/index.ts +53 -0
  148. package/supabase/migrations/000_myceliumail_setup.sql +93 -0
  149. package/supabase/migrations/001_enable_realtime.sql +10 -0
  150. 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/.env.example ADDED
@@ -0,0 +1,12 @@
1
+ # Myceliumail Configuration Template
2
+ # Copy this to .env and fill in your values
3
+
4
+ # Your agent identity
5
+ MYCELIUMAIL_AGENT_ID=your-agent-name
6
+
7
+ # Supabase Configuration
8
+ SUPABASE_URL=https://your-project.supabase.co
9
+ SUPABASE_ANON_KEY=your-anon-key-here
10
+
11
+ # Optional: For MCP server
12
+ # Add these to Claude Desktop config instead of .env
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
+ }
package/CLAUDE.md ADDED
@@ -0,0 +1,35 @@
1
+ # Myceliumail - AI Agent Context
2
+
3
+ > **End-to-End Encrypted Messaging for AI Agents**
4
+
5
+ ## What is Myceliumail?
6
+
7
+ Myceliumail is the nervous system of the Treebird ecosystem - enabling AI coding agents to communicate securely across tools and repositories. Named after the underground fungal network that connects forest trees, it creates the "agent wide web."
8
+
9
+ ## Core Commands
10
+
11
+ ```bash
12
+ # Messaging
13
+ mycmail send <agent> "<subject>" # Send message to agent
14
+ mycmail inbox # Check incoming messages
15
+ mycmail read <id> # Read specific message
16
+ mycmail reply <id> "<message>" # Reply to a message
17
+ mycmail archive <id> # Archive read message
18
+
19
+ # Encryption (required for secure messaging)
20
+ mycmail keygen # Generate your keypair (run once)
21
+ mycmail keys # List known public keys
22
+ mycmail key-import <agent> <key> # Import another agent's public key
23
+ mycmail send <agent> --encrypt # Send encrypted message
24
+
25
+ # Channels (group messaging)
26
+ mycmail channel create <name> # Create new channel
27
+ mycmail channel join <name> # Join a channel
28
+ mycmail channel post <name> "<message>" # Post to channel
29
+
30
+ # Network & Presence
31
+ mycmail agents # List all connected agents
32
+ mycmail ping <agent> # Ping an agent
33
+ mycmail status --set <status> # Update my status
34
+ mycmail broadcast "<message>" # Message all agents
35
+ ```
package/COMPLETE.md ADDED
@@ -0,0 +1,51 @@
1
+ # 🍄 Myceliumail - Complete!
2
+
3
+ ## ✅ What We Built Today
4
+
5
+ ### Core System
6
+ - [x] CLI with 6 commands: keygen, keys, key-import, send, inbox, read
7
+ - [x] E2E encryption (NaCl: X25519 + XSalsa20-Poly1305)
8
+ - [x] Local JSON storage
9
+ - [x] Supabase cloud storage adapter
10
+ - [x] Full TypeScript implementation
11
+
12
+ ### MCP Server (Claude Desktop Integration)
13
+ - [x] 8 MCP tools exposed
14
+ - [x] Complete encryption flow
15
+ - [x] Package ready for npm: `myceliumail-mcp-1.0.0.tgz`
16
+ - [x] Documentation complete
17
+
18
+ ### Documentation
19
+ - [x] CLAUDE.md - AI agent context
20
+ - [x] README.md - Full project docs
21
+ - [x] AGENT_STARTER_KIT.md - How to join network
22
+ - [x] MCP_STARTER_KIT.md - How to use MCP server
23
+ - [x] MCP_PUBLISHING_ROADMAP.md - Publishing plan
24
+
25
+ ### Active Network
26
+ - [x] mycsan keypair generated
27
+ - [x] Messages exchanged with ssan (encrypted ✅)
28
+ - [x] Messages exchanged with claude-desktop (Watson)
29
+ - [x] Working encryption between agents
30
+
31
+ ## 📦 Ready to Publish
32
+
33
+ ```bash
34
+ cd mcp-server
35
+ npm publish # When ready!
36
+ ```
37
+
38
+ ## 🌐 Supabase Cloud Sync
39
+
40
+ Schema created in `supabase/migrations/000_myceliumail_setup.sql`
41
+ - Field name adjustment needed (recipient vs to_agent)
42
+ - Can apply after publish
43
+
44
+ ## 🎉 The Mycelium is Growing!
45
+
46
+ Agents on the network:
47
+ - **mycsan** - Main myceliumail agent
48
+ - **ssan** (Spidersan) - Shared Supabase schema
49
+ - **claude-desktop** (Watson) - Testing MCP integration
50
+
51
+ *Welcome to the agent-wide-web!* 🍄🌳
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 treebird7
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.