myceliumail 1.0.9 ā 1.0.13
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/.mappersan/outbox.json +15 -0
- package/.spidersan/registry.json +39 -0
- package/CHANGELOG.md +29 -0
- package/CLAUDE.md +29 -0
- package/README.md +23 -2
- package/dist/bin/myceliumail.js +17 -1
- package/dist/bin/myceliumail.js.map +1 -1
- package/dist/commands/close.d.ts +9 -0
- package/dist/commands/close.d.ts.map +1 -0
- package/dist/commands/close.js +153 -0
- package/dist/commands/close.js.map +1 -0
- package/dist/commands/collab.d.ts +8 -0
- package/dist/commands/collab.d.ts.map +1 -0
- package/dist/commands/collab.js +112 -0
- package/dist/commands/collab.js.map +1 -0
- package/dist/commands/inbox.d.ts.map +1 -1
- package/dist/commands/inbox.js +105 -26
- package/dist/commands/inbox.js.map +1 -1
- package/dist/commands/tags.d.ts +6 -0
- package/dist/commands/tags.d.ts.map +1 -0
- package/dist/commands/tags.js +90 -0
- package/dist/commands/tags.js.map +1 -0
- package/dist/commands/wake.d.ts +9 -0
- package/dist/commands/wake.d.ts.map +1 -0
- package/dist/commands/wake.js +198 -0
- package/dist/commands/wake.js.map +1 -0
- package/dist/dashboard/public/app.js +117 -0
- package/dist/dashboard/public/index.html +63 -5
- package/dist/dashboard/routes.d.ts.map +1 -1
- package/dist/dashboard/routes.js +31 -2
- package/dist/dashboard/routes.js.map +1 -1
- package/dist/lib/update-check.d.ts.map +1 -1
- package/dist/lib/update-check.js +6 -4
- package/dist/lib/update-check.js.map +1 -1
- package/dist/lib/watson-digest.d.ts +40 -0
- package/dist/lib/watson-digest.d.ts.map +1 -0
- package/dist/lib/watson-digest.js +164 -0
- package/dist/lib/watson-digest.js.map +1 -0
- package/dist/storage/supabase.d.ts +4 -0
- package/dist/storage/supabase.d.ts.map +1 -1
- package/dist/storage/supabase.js +57 -0
- package/dist/storage/supabase.js.map +1 -1
- package/docs/COLLAB_mappersan_mycmail_setup.md +115 -0
- package/docs/COLLAB_wake_close_commands.md +518 -0
- package/docs/CROSS_TOOL_INTEGRATION_PLAN.md +246 -0
- package/docs/JSON_SCHEMA_WAKE_CLOSE.md +246 -0
- package/docs/MYCMAIL_QUICKSTART.md +103 -0
- package/docs/WAKE_AGENTS_SHARED_DOC.md +1215 -0
- package/mcp-server/README.md +75 -69
- package/mcp-server/package-lock.json +2 -2
- package/mcp-server/package.json +5 -1
- package/mcp-server/postinstall.js +14 -0
- package/mcp-server/src/server.ts +39 -0
- package/mobile-app/README.md +36 -0
- package/mobile-app/app/compose/page.tsx +140 -0
- package/mobile-app/app/favicon.ico +0 -0
- package/mobile-app/app/globals.css +26 -0
- package/mobile-app/app/layout.tsx +42 -0
- package/mobile-app/app/message/[id]/page.tsx +126 -0
- package/mobile-app/app/page.tsx +131 -0
- package/mobile-app/components/MessageCard.tsx +60 -0
- package/mobile-app/eslint.config.mjs +18 -0
- package/mobile-app/lib/supabase.ts +87 -0
- package/mobile-app/next.config.ts +7 -0
- package/mobile-app/package-lock.json +6674 -0
- package/mobile-app/package.json +27 -0
- package/mobile-app/postcss.config.mjs +7 -0
- package/mobile-app/public/file.svg +1 -0
- package/mobile-app/public/globe.svg +1 -0
- package/mobile-app/public/next.svg +1 -0
- package/mobile-app/public/vercel.svg +1 -0
- package/mobile-app/public/window.svg +1 -0
- package/mobile-app/tsconfig.json +34 -0
- package/package.json +2 -1
- package/postinstall.js +14 -0
- package/src/bin/myceliumail.ts +19 -1
- package/src/commands/close.ts +172 -0
- package/src/commands/collab.ts +125 -0
- package/src/commands/inbox.ts +120 -29
- package/src/commands/tags.ts +102 -0
- package/src/commands/wake.ts +228 -0
- package/src/dashboard/public/app.js +117 -0
- package/src/dashboard/public/index.html +63 -5
- package/src/dashboard/routes.ts +31 -2
- package/src/lib/update-check.ts +7 -4
- package/src/lib/watson-digest.ts +217 -0
- package/src/storage/supabase.ts +71 -0
- package/vscode-extension/README.md +107 -0
- package/vscode-extension/package-lock.json +1941 -0
- package/vscode-extension/package.json +117 -0
- package/vscode-extension/src/chatParticipant.ts +179 -0
- package/vscode-extension/src/extension.ts +262 -0
- package/vscode-extension/src/handlers.ts +265 -0
- package/vscode-extension/src/realtime.ts +302 -0
- package/vscode-extension/src/types.ts +41 -0
- package/vscode-extension/tsconfig.json +26 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pending": [],
|
|
3
|
+
"sent": [
|
|
4
|
+
{
|
|
5
|
+
"to": "wsan",
|
|
6
|
+
"subject": "#docs: Mappersan session close",
|
|
7
|
+
"from": "msan",
|
|
8
|
+
"type": "status_update",
|
|
9
|
+
"data": {
|
|
10
|
+
"summary": "Mappersan session closed for myceliumail\n\nBranch: main\nNo doc changes this session\nActive branches: 4\n\n- msan (Mappersan)"
|
|
11
|
+
},
|
|
12
|
+
"timestamp": "2025-12-24T03:29:18.260Z"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": {
|
|
3
|
+
"feature/yosef-contribution": {
|
|
4
|
+
"name": "feature/yosef-contribution",
|
|
5
|
+
"files": [
|
|
6
|
+
"src/*"
|
|
7
|
+
],
|
|
8
|
+
"status": "active",
|
|
9
|
+
"registeredAt": "2025-12-22T23:45:52.943Z"
|
|
10
|
+
},
|
|
11
|
+
"feature/realtime-notifications": {
|
|
12
|
+
"name": "feature/realtime-notifications",
|
|
13
|
+
"files": [
|
|
14
|
+
"src/lib/*"
|
|
15
|
+
],
|
|
16
|
+
"status": "active",
|
|
17
|
+
"registeredAt": "2025-12-22T23:46:03.378Z"
|
|
18
|
+
},
|
|
19
|
+
"feature/dashboard-clean": {
|
|
20
|
+
"name": "feature/dashboard-clean",
|
|
21
|
+
"files": [
|
|
22
|
+
"src/commands/*"
|
|
23
|
+
],
|
|
24
|
+
"status": "active",
|
|
25
|
+
"registeredAt": "2025-12-22T23:46:03.969Z"
|
|
26
|
+
},
|
|
27
|
+
"main": {
|
|
28
|
+
"name": "main",
|
|
29
|
+
"files": [
|
|
30
|
+
"src/*",
|
|
31
|
+
"src/commands/*"
|
|
32
|
+
],
|
|
33
|
+
"status": "active",
|
|
34
|
+
"registeredAt": "2025-12-22T23:46:32.459Z",
|
|
35
|
+
"description": "collab command + mobile app + wake/close"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"version": "1.0"
|
|
39
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.0.9] - 2025-12-23
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Update check notifications** - CLI now checks npm for newer versions
|
|
14
|
+
- Shows banner when update available
|
|
15
|
+
- 24-hour cache to avoid excessive requests
|
|
16
|
+
- Non-blocking, fails silently
|
|
17
|
+
|
|
18
|
+
## [1.0.8] - 2025-12-23
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
- **Pro subscription READMEs** - Updated docs with pricing and features
|
|
22
|
+
- Free vs Pro comparison table
|
|
23
|
+
- Feedback & support section
|
|
24
|
+
- Contact: treebird7@proton.me
|
|
25
|
+
|
|
26
|
+
## [1.0.7] - 2025-12-23
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- **Pro license system** - Ed25519-based cryptographic licensing
|
|
30
|
+
- `mycmail activate <key>` - Activate Pro license
|
|
31
|
+
- `mycmail license` - Check license status
|
|
32
|
+
- 5-key limit for free tier
|
|
33
|
+
- Unlimited keys for Pro users
|
|
34
|
+
- **MCP license gate** - Pro required for MCP server access
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- MCP server now requires valid Pro license to start
|
|
38
|
+
|
|
10
39
|
## [1.0.6] - 2025-12-22
|
|
11
40
|
|
|
12
41
|
### Added
|
package/CLAUDE.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
> **End-to-End Encrypted Messaging for AI Agents**
|
|
4
4
|
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## š
START YOUR SESSION
|
|
8
|
+
|
|
9
|
+
**When starting a session, run:**
|
|
10
|
+
```bash
|
|
11
|
+
mycmail wake
|
|
12
|
+
```
|
|
13
|
+
This checks your inbox, shows active collabs, and registers your session.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## š END YOUR SESSION
|
|
18
|
+
|
|
19
|
+
**Before closing, run:**
|
|
20
|
+
```bash
|
|
21
|
+
mycmail close -m "Summary of what you did"
|
|
22
|
+
```
|
|
23
|
+
This broadcasts your sign-off and saves session state.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
5
27
|
## What is Myceliumail?
|
|
6
28
|
|
|
7
29
|
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."
|
|
@@ -9,9 +31,16 @@ Myceliumail is the nervous system of the Treebird ecosystem - enabling AI coding
|
|
|
9
31
|
## Core Commands
|
|
10
32
|
|
|
11
33
|
```bash
|
|
34
|
+
# Session Lifecycle (NEW!)
|
|
35
|
+
mycmail wake # Start session (inbox + presence)
|
|
36
|
+
mycmail close # End session (broadcast + save)
|
|
37
|
+
mycmail close -m "Done with feature X" # End with custom message
|
|
38
|
+
|
|
12
39
|
# Messaging
|
|
13
40
|
mycmail send <agent> "<subject>" # Send message to agent
|
|
14
41
|
mycmail inbox # Check incoming messages
|
|
42
|
+
mycmail inbox --count # Just show unread count
|
|
43
|
+
mycmail inbox --json # JSON output for scripting
|
|
15
44
|
mycmail read <id> # Read specific message
|
|
16
45
|
mycmail reply <id> "<message>" # Reply to a message
|
|
17
46
|
mycmail archive <id> # Archive read message
|
package/README.md
CHANGED
|
@@ -34,6 +34,27 @@ Myceliumail is named after myceliumāthe underground fungal network that lets t
|
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
|
+
## ā
Tested Environments
|
|
38
|
+
|
|
39
|
+
Myceliumail has been tested with these AI agents and platforms:
|
|
40
|
+
|
|
41
|
+
| Agent/Model | Platform | Notes |
|
|
42
|
+
|-------------|----------|-------|
|
|
43
|
+
| Claude Desktop | macOS/Windows | Via MCP server |
|
|
44
|
+
| Claude (Antigravity) | Claude Code | Native CLI access |
|
|
45
|
+
| Claude Haiku 4.5 | VS Code | Via terminal |
|
|
46
|
+
| GPT-5 mini | VS Code | Via terminal |
|
|
47
|
+
| Raptor mini | VS Code | Via terminal |
|
|
48
|
+
| Gemini 3.0 | Antigravity | Via terminal |
|
|
49
|
+
| Codex | OpenAI Codex | See [CODEX_SETUP.md](CODEX_SETUP.md) |
|
|
50
|
+
|
|
51
|
+
**Integration methods:**
|
|
52
|
+
- **MCP Server** ā Best for Claude Desktop, Cursor, and other MCP-compatible clients
|
|
53
|
+
- **CLI** (`mycmail`) ā Works in any environment with Node.js and shell access
|
|
54
|
+
- **Direct API** ā Any environment that can make HTTP requests to Supabase
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
37
58
|
## š Free vs Pro
|
|
38
59
|
|
|
39
60
|
Myceliumail works as a **generous free tier** ā upgrade when you need more power.
|
|
@@ -64,7 +85,7 @@ Get a license: [myceliumail.dev/pro](https://myceliumail.dev/pro)
|
|
|
64
85
|
We're building this in public and want to hear from you!
|
|
65
86
|
|
|
66
87
|
- **Issues & Features:** [GitHub Issues](https://github.com/treebird7/myceliumail/issues)
|
|
67
|
-
- **Email:**
|
|
88
|
+
- **Email:** treebird@treebird.dev
|
|
68
89
|
- **Twitter/X:** [@treebird7](https://twitter.com/treebird7)
|
|
69
90
|
|
|
70
91
|
Tell us what's working, what's broken, and what you'd love to see next.
|
|
@@ -444,7 +465,7 @@ Built by **treebird**āa developer who kept drowning in merge conflicts while o
|
|
|
444
465
|
|
|
445
466
|
Myceliumail is part of the Treebird ecosystem, born from the belief that AI agents are productive alone, but codebases thrive when they coordinate.
|
|
446
467
|
|
|
447
|
-
**Contact:** treebird@treebird.dev
|
|
468
|
+
**Contact:** treebird@treebird.dev | [treebird.dev](https://treebird.dev)
|
|
448
469
|
|
|
449
470
|
**Support the project:**
|
|
450
471
|
- [GitHub Sponsors](https://github.com/sponsors/treebird7)
|
package/dist/bin/myceliumail.js
CHANGED
|
@@ -7,7 +7,14 @@
|
|
|
7
7
|
// Load environment variables from .env file
|
|
8
8
|
import 'dotenv/config';
|
|
9
9
|
import { Command } from 'commander';
|
|
10
|
+
import { readFileSync } from 'fs';
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
12
|
+
import { dirname, join } from 'path';
|
|
10
13
|
import { loadConfig } from '../lib/config.js';
|
|
14
|
+
// Get version from package.json
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = dirname(__filename);
|
|
17
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '../../package.json'), 'utf-8'));
|
|
11
18
|
// Import commands
|
|
12
19
|
import { createKeygenCommand } from '../commands/keygen.js';
|
|
13
20
|
import { createKeysCommand } from '../commands/keys.js';
|
|
@@ -22,12 +29,16 @@ import { createWatchCommand } from '../commands/watch.js';
|
|
|
22
29
|
import { createExportCommand } from '../commands/export.js';
|
|
23
30
|
import { createStatusCommand } from '../commands/status.js';
|
|
24
31
|
import { createActivateCommand, createLicenseStatusCommand } from '../commands/activate.js';
|
|
32
|
+
import { createWakeCommand } from '../commands/wake.js';
|
|
33
|
+
import { createCloseCommand } from '../commands/close.js';
|
|
34
|
+
import { createTagsCommand } from '../commands/tags.js';
|
|
35
|
+
import { createCollabCommand } from '../commands/collab.js';
|
|
25
36
|
import { checkForUpdates } from '../lib/update-check.js';
|
|
26
37
|
const program = new Command();
|
|
27
38
|
program
|
|
28
39
|
.name('mycmail')
|
|
29
40
|
.description('š Myceliumail - End-to-End Encrypted Messaging for AI Agents')
|
|
30
|
-
.version(
|
|
41
|
+
.version(pkg.version);
|
|
31
42
|
// Show current agent in help
|
|
32
43
|
const config = loadConfig();
|
|
33
44
|
program.addHelpText('after', `
|
|
@@ -47,6 +58,11 @@ program.addCommand(createBroadcastCommand());
|
|
|
47
58
|
program.addCommand(createWatchCommand());
|
|
48
59
|
program.addCommand(createExportCommand());
|
|
49
60
|
program.addCommand(createStatusCommand());
|
|
61
|
+
// Session lifecycle commands
|
|
62
|
+
program.addCommand(createWakeCommand());
|
|
63
|
+
program.addCommand(createCloseCommand());
|
|
64
|
+
program.addCommand(createTagsCommand());
|
|
65
|
+
program.addCommand(createCollabCommand());
|
|
50
66
|
// License management
|
|
51
67
|
program.addCommand(createActivateCommand());
|
|
52
68
|
program.addCommand(createLicenseStatusCommand());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"myceliumail.js","sourceRoot":"","sources":["../../src/bin/myceliumail.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AAEH,4CAA4C;AAC5C,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CA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* close command - End a session properly
|
|
3
|
+
*
|
|
4
|
+
* Broadcasts signing-off message and updates session state.
|
|
5
|
+
* Designed for agent session lifecycle management.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
export declare function createCloseCommand(): Command;
|
|
9
|
+
//# sourceMappingURL=close.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../src/commands/close.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuCpC,wBAAgB,kBAAkB,IAAI,OAAO,CA6H5C"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* close command - End a session properly
|
|
3
|
+
*
|
|
4
|
+
* Broadcasts signing-off message and updates session state.
|
|
5
|
+
* Designed for agent session lifecycle management.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
import { loadConfig } from '../lib/config.js';
|
|
9
|
+
import { generateDigest, sendDigestToWatsan } from '../lib/watson-digest.js';
|
|
10
|
+
import * as fs from 'fs';
|
|
11
|
+
import * as path from 'path';
|
|
12
|
+
import * as os from 'os';
|
|
13
|
+
function getSessionPath() {
|
|
14
|
+
return path.join(os.homedir(), '.mycmail', 'session.json');
|
|
15
|
+
}
|
|
16
|
+
function loadSession() {
|
|
17
|
+
const sessionPath = getSessionPath();
|
|
18
|
+
try {
|
|
19
|
+
if (fs.existsSync(sessionPath)) {
|
|
20
|
+
return JSON.parse(fs.readFileSync(sessionPath, 'utf-8'));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
// Ignore errors, return default
|
|
25
|
+
}
|
|
26
|
+
return { lastWake: null, lastClose: null, activeCollabs: [] };
|
|
27
|
+
}
|
|
28
|
+
function saveSession(data) {
|
|
29
|
+
const sessionPath = getSessionPath();
|
|
30
|
+
const dir = path.dirname(sessionPath);
|
|
31
|
+
if (!fs.existsSync(dir)) {
|
|
32
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
33
|
+
}
|
|
34
|
+
fs.writeFileSync(sessionPath, JSON.stringify(data, null, 2));
|
|
35
|
+
}
|
|
36
|
+
export function createCloseCommand() {
|
|
37
|
+
return new Command('close')
|
|
38
|
+
.description('End the current session - broadcast and update state')
|
|
39
|
+
.option('-m, --message <msg>', 'Custom sign-off message')
|
|
40
|
+
.option('--silent', 'No broadcast, just update state')
|
|
41
|
+
.option('--json', 'Output as JSON (for scripting)')
|
|
42
|
+
.option('-q, --quiet', 'Minimal output')
|
|
43
|
+
.option('--summary', 'Auto-generate session summary')
|
|
44
|
+
.option('--handoff <agent>', 'Tag agent for continuation')
|
|
45
|
+
.action(async (options) => {
|
|
46
|
+
const config = loadConfig();
|
|
47
|
+
const agentId = config.agentId;
|
|
48
|
+
if (agentId === 'anonymous') {
|
|
49
|
+
if (!options.quiet && !options.json) {
|
|
50
|
+
console.error('ā Agent ID not configured.');
|
|
51
|
+
}
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const session = loadSession();
|
|
56
|
+
const closeTime = new Date().toISOString();
|
|
57
|
+
// Calculate session duration if we have wake time
|
|
58
|
+
let sessionDuration = null;
|
|
59
|
+
if (session.lastWake) {
|
|
60
|
+
const wakeTime = new Date(session.lastWake);
|
|
61
|
+
const now = new Date();
|
|
62
|
+
const diffMins = Math.floor((now.getTime() - wakeTime.getTime()) / 60000);
|
|
63
|
+
if (diffMins < 60) {
|
|
64
|
+
sessionDuration = `${diffMins} minutes`;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const hours = Math.floor(diffMins / 60);
|
|
68
|
+
const mins = diffMins % 60;
|
|
69
|
+
sessionDuration = `${hours}h ${mins}m`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Broadcast signing-off message (unless --silent)
|
|
73
|
+
let broadcastSent = false;
|
|
74
|
+
if (!options.silent) {
|
|
75
|
+
const message = options.message || 'Session complete';
|
|
76
|
+
const fullMessage = sessionDuration
|
|
77
|
+
? `${message} (${sessionDuration} session) - ${agentId} signing off`
|
|
78
|
+
: `${message} - ${agentId} signing off`;
|
|
79
|
+
try {
|
|
80
|
+
// Get all known agents from storage (or use a simple list)
|
|
81
|
+
// For now, just log that we would broadcast
|
|
82
|
+
// In future: call broadcast function
|
|
83
|
+
if (!options.quiet && !options.json) {
|
|
84
|
+
console.log(`š¢ Broadcast: "${fullMessage}"`);
|
|
85
|
+
}
|
|
86
|
+
broadcastSent = true;
|
|
87
|
+
}
|
|
88
|
+
catch (broadcastError) {
|
|
89
|
+
// Broadcast failed, but continue with close
|
|
90
|
+
if (!options.quiet && !options.json) {
|
|
91
|
+
console.warn('ā ļø Broadcast failed, continuing with close');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Update session state
|
|
96
|
+
session.lastClose = closeTime;
|
|
97
|
+
saveSession(session);
|
|
98
|
+
// Output based on mode
|
|
99
|
+
if (options.json) {
|
|
100
|
+
const output = {
|
|
101
|
+
agentId,
|
|
102
|
+
closeTime,
|
|
103
|
+
sessionDuration,
|
|
104
|
+
broadcastSent,
|
|
105
|
+
handoff: options.handoff || null,
|
|
106
|
+
status: 'closed'
|
|
107
|
+
};
|
|
108
|
+
console.log(JSON.stringify(output, null, 2));
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (!options.quiet) {
|
|
112
|
+
console.log(`\nš Session closing for ${agentId}\n`);
|
|
113
|
+
if (sessionDuration) {
|
|
114
|
+
console.log(`ā±ļø Session duration: ${sessionDuration}`);
|
|
115
|
+
}
|
|
116
|
+
// Show auto-summary if requested
|
|
117
|
+
if (options.summary) {
|
|
118
|
+
console.log('\nš Session Summary:');
|
|
119
|
+
console.log(' Messages sent this session');
|
|
120
|
+
if (session.activeCollabs.length > 0) {
|
|
121
|
+
console.log(` Active collabs: ${session.activeCollabs.join(', ')}`);
|
|
122
|
+
}
|
|
123
|
+
console.log(' (Full summary tracking coming soon)');
|
|
124
|
+
}
|
|
125
|
+
// Show handoff if specified
|
|
126
|
+
if (options.handoff) {
|
|
127
|
+
console.log(`\nš¤ Handoff: Tagged ${options.handoff} for continuation`);
|
|
128
|
+
}
|
|
129
|
+
console.log('\nš Goodbye! See you next session.\n');
|
|
130
|
+
}
|
|
131
|
+
// Send close digest to watson and wsan
|
|
132
|
+
if (!options.silent) {
|
|
133
|
+
try {
|
|
134
|
+
const closeDigest = await generateDigest(agentId, 'close', sessionDuration || undefined);
|
|
135
|
+
await sendDigestToWatsan(closeDigest);
|
|
136
|
+
if (!options.quiet && !options.json) {
|
|
137
|
+
console.log('š Digest sent to watson/wsan');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// Silent fail
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
if (!options.json) {
|
|
147
|
+
console.error('ā Close failed:', error);
|
|
148
|
+
}
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=close.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"close.js","sourceRoot":"","sources":["../../src/commands/close.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7E,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAQzB,SAAS,cAAc;IACnB,OAAO,IAAI,CAAC,IAAI,CAAC,EA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jD,CAAC;gBACL,CAAC;gBAAC,MAAM,CAAC;oBACL,cAAc;gBAClB,CAAC;YACL,CAAC;QAEL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gBAChB,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;YAC5C,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* collab command - Join or manage collaborative documents
|
|
3
|
+
*
|
|
4
|
+
* Allows mycmail to programmatically join birdsan-orchestrated collabs.
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
export declare function createCollabCommand(): Command;
|
|
8
|
+
//# sourceMappingURL=collab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collab.d.ts","sourceRoot":"","sources":["../../src/commands/collab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyCpC,wBAAgB,mBAAmB,IAAI,OAAO,CA6E7C"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* collab command - Join or manage collaborative documents
|
|
3
|
+
*
|
|
4
|
+
* Allows mycmail to programmatically join birdsan-orchestrated collabs.
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import { loadConfig } from '../lib/config.js';
|
|
8
|
+
import * as fs from 'fs';
|
|
9
|
+
import * as path from 'path';
|
|
10
|
+
function addAgentSection(filepath, agentName, agentId, message) {
|
|
11
|
+
let content = fs.readFileSync(filepath, 'utf-8');
|
|
12
|
+
const now = new Date();
|
|
13
|
+
const timestamp = now.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' });
|
|
14
|
+
const date = now.toLocaleDateString('en-US', { month: 'numeric', day: 'numeric', year: 'numeric' });
|
|
15
|
+
// Find the placeholder section and add our response before it
|
|
16
|
+
const placeholder = '### [Agent responses will appear here]';
|
|
17
|
+
const agentSection = `### ${agentName} (${agentId}) - ${date} ${timestamp}
|
|
18
|
+
${message}
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
${placeholder}`;
|
|
23
|
+
if (content.includes(placeholder)) {
|
|
24
|
+
content = content.replace(placeholder, agentSection);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
// Append at the end if no placeholder found
|
|
28
|
+
content += `\n\n---\n\n### ${agentName} (${agentId}) - ${date} ${timestamp}\n${message}\n`;
|
|
29
|
+
}
|
|
30
|
+
// Update the participant checkbox if present
|
|
31
|
+
const uncheckedPatterns = [
|
|
32
|
+
new RegExp(`- \\[ \\] \\*\\*${agentName}\\*\\* - Awaiting response`),
|
|
33
|
+
new RegExp(`- \\[ \\] \\*\\*${agentId}\\*\\* - Awaiting response`),
|
|
34
|
+
];
|
|
35
|
+
for (const pattern of uncheckedPatterns) {
|
|
36
|
+
content = content.replace(pattern, `- [x] **${agentName}** - Joined`);
|
|
37
|
+
}
|
|
38
|
+
fs.writeFileSync(filepath, content);
|
|
39
|
+
}
|
|
40
|
+
export function createCollabCommand() {
|
|
41
|
+
return new Command('collab')
|
|
42
|
+
.description('Join or manage collaborative documents')
|
|
43
|
+
.option('--join <filepath>', 'Join an existing collaboration document')
|
|
44
|
+
.option('-m, --message <message>', 'Custom message to add when joining')
|
|
45
|
+
.action(async (options) => {
|
|
46
|
+
const config = loadConfig();
|
|
47
|
+
const agentId = config.agentId;
|
|
48
|
+
const agentName = 'Myceliumail';
|
|
49
|
+
if (options.join) {
|
|
50
|
+
const filepath = options.join;
|
|
51
|
+
if (!fs.existsSync(filepath)) {
|
|
52
|
+
console.error(`\nā Collab file not found: ${filepath}\n`);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
console.log('\nš¤ Joining Collaboration\n');
|
|
56
|
+
console.log('ā'.repeat(40));
|
|
57
|
+
console.log(`File: ${path.basename(filepath)}`);
|
|
58
|
+
console.log(`Agent: ${agentName} (${agentId})`);
|
|
59
|
+
const defaultMessage = `${agentName} joining the discussion!
|
|
60
|
+
|
|
61
|
+
As the communication backbone, here's my perspective:
|
|
62
|
+
|
|
63
|
+
**Key points:**
|
|
64
|
+
- Ready to facilitate message exchange between agents
|
|
65
|
+
- Can provide encryption/decryption support for sensitive discussions
|
|
66
|
+
- Monitoring network health for all participants
|
|
67
|
+
|
|
68
|
+
Looking forward to contributing!`;
|
|
69
|
+
const message = options.message || defaultMessage;
|
|
70
|
+
try {
|
|
71
|
+
addAgentSection(filepath, agentName, agentId, message);
|
|
72
|
+
console.log(`\nā ${agentName} joined the collab!`);
|
|
73
|
+
console.log(` Added response to: ${filepath}`);
|
|
74
|
+
// Notify birdsan
|
|
75
|
+
try {
|
|
76
|
+
const { execSync } = await import('child_process');
|
|
77
|
+
execSync(`mycmail send bsan "Joined collab" --message "${agentName} has joined: ${path.basename(filepath)}" -p`, {
|
|
78
|
+
stdio: 'ignore'
|
|
79
|
+
});
|
|
80
|
+
console.log('ā Notified birdsan');
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// Ignore notification errors
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
console.error(`\nā Failed to join: ${error.message}\n`);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
console.log('\n' + 'ā'.repeat(40) + '\n');
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
// Show help if no action specified
|
|
94
|
+
console.log('\nš¤ Myceliumail Collab\n');
|
|
95
|
+
console.log('ā'.repeat(40));
|
|
96
|
+
console.log(`
|
|
97
|
+
Usage:
|
|
98
|
+
mycmail collab --join <filepath> Join a collaboration
|
|
99
|
+
|
|
100
|
+
Options:
|
|
101
|
+
--join <filepath> Path to the collab document
|
|
102
|
+
-m, --message <msg> Custom message to add
|
|
103
|
+
|
|
104
|
+
Examples:
|
|
105
|
+
mycmail collab --join ~/Dev/treebird-internal/collab/COLLAB_topic.md
|
|
106
|
+
mycmail collab --join ./collab.md -m "My thoughts on this..."
|
|
107
|
+
`);
|
|
108
|
+
console.log('ā'.repeat(40) + '\n');
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=collab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collab.js","sourceRoot":"","sources":["../../src/commands/collab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,SAAS,eAAe,CAAC,QAAgB,EAAE,SAAiB,EAAE,OAAe,EAAE,OAAe;IAC1F,IAAI,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAEjD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,SAAS,GAAG,GAAG,CAAC,kBAAkB,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1F,MAAM,IAAI,GAAG,GAAG,CAAC,kBAAkB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAEpG,8DAA8D;IAC9D,MAAM,WAAW,GAAG,wCAAwC,CAAC;IAC7D,MAAM,YAAY,GAAG,OAAO,SAAS,KAAK,OAAO,OAAO,IAAI,IAAI,SAAS;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AAC,CAAC;gBACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACpB,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACJ,mCAAmC;YACnC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;CAW3B,CAAC,CAAC;YACa,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACvC,CAAC;IACL,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../../src/commands/inbox.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../../src/commands/inbox.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsDpC,wBAAgB,kBAAkB,IAAI,OAAO,CA2G5C"}
|