watercooler 0.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.
- package/LICENSE +21 -0
- package/README.md +72 -0
- package/bin/watercooler.js +18 -0
- package/package.json +51 -0
- package/public/app.js +707 -0
- package/public/index.html +516 -0
- package/server.ts +192 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 OpenCode Community
|
|
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,72 @@
|
|
|
1
|
+
# Watercooler Village
|
|
2
|
+
|
|
3
|
+
A beautiful 3D visualization of your mailbox messages as a village of coworkers.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g watercooler
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or use with npx:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx watercooler --user <name> --mailbox <path> [--coworkers <path>]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
watercooler --user <name> --mailbox <path> [--coworkers <path>]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Required Arguments
|
|
24
|
+
- `--user` / `-u`: Your agent name (e.g., `richard`)
|
|
25
|
+
- `--mailbox` / `-m`: Path to your mailbox.db file
|
|
26
|
+
|
|
27
|
+
### Optional Arguments
|
|
28
|
+
- `--coworkers` / `-c`: Path to coworker.db for full coworker list
|
|
29
|
+
|
|
30
|
+
### Examples
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# With coworker database (shows all coworkers, even without messages)
|
|
34
|
+
watercooler --user richard --mailbox ~/.config/opencode/mailbox.db --coworkers ~/.config/opencode/coworkers.db
|
|
35
|
+
|
|
36
|
+
# Without coworker database (shows only coworkers with messages)
|
|
37
|
+
watercooler --user richard --mailbox ~/.config/opencode/mailbox.db
|
|
38
|
+
|
|
39
|
+
# Development mode (from source)
|
|
40
|
+
git clone <repository>
|
|
41
|
+
cd watercooler
|
|
42
|
+
npm install
|
|
43
|
+
npm start -- --user richard --mailbox ~/.config/opencode/mailbox.db
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Features
|
|
47
|
+
|
|
48
|
+
- **3D Village**: Each coworker appears as a colorful house in a circle
|
|
49
|
+
- **Message Flow**: Animated particles show messages traveling between houses
|
|
50
|
+
- **Visual Status**:
|
|
51
|
+
- Green lines = read messages
|
|
52
|
+
- Red lines = unread messages
|
|
53
|
+
- Gold particles = messages in transit
|
|
54
|
+
- **Send Panel**: Collapsible panel in top-left for sending messages
|
|
55
|
+
- **Message History**: Slide-out panel from right showing all messages
|
|
56
|
+
- **Real-time**: Auto-refreshes every 5 seconds
|
|
57
|
+
|
|
58
|
+
## Architecture
|
|
59
|
+
|
|
60
|
+
- **Backend**: Express server with SQLite
|
|
61
|
+
- **Frontend**: Vanilla JavaScript + Three.js (from CDN)
|
|
62
|
+
- **TypeScript**: Runs directly with tsx (included as a dependency)
|
|
63
|
+
|
|
64
|
+
## Database Integration
|
|
65
|
+
|
|
66
|
+
### Mailbox DB (required)
|
|
67
|
+
Contains messages table with: id, recipient, sender, message, timestamp, read
|
|
68
|
+
|
|
69
|
+
### Coworker DB (optional)
|
|
70
|
+
Contains coworkers table with: name, session_id, agent_type, created_at, parent_id
|
|
71
|
+
|
|
72
|
+
When provided, watercooler shows ALL coworkers from the database, regardless of whether they have sent/received messages yet.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from 'child_process';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { dirname, join } from 'path';
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
|
|
9
|
+
const serverPath = join(__dirname, '..', 'server.ts');
|
|
10
|
+
|
|
11
|
+
const child = spawn('tsx', [serverPath, ...process.argv.slice(2)], {
|
|
12
|
+
stdio: 'inherit',
|
|
13
|
+
shell: false
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
child.on('exit', (code) => {
|
|
17
|
+
process.exit(code ?? 0);
|
|
18
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "watercooler",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A beautiful 3D visualization of your mailbox messages as a village of coworkers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "server.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"watercooler": "./bin/watercooler.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/",
|
|
12
|
+
"public/",
|
|
13
|
+
"server.ts",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"start": "tsx --watch server.ts"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"watercooler",
|
|
22
|
+
"mailbox",
|
|
23
|
+
"visualization",
|
|
24
|
+
"3d",
|
|
25
|
+
"village",
|
|
26
|
+
"chat",
|
|
27
|
+
"messages",
|
|
28
|
+
"three.js",
|
|
29
|
+
"sqlite"
|
|
30
|
+
],
|
|
31
|
+
"author": "",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": ""
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"better-sqlite3": "^11.8.1",
|
|
39
|
+
"express": "^4.21.2",
|
|
40
|
+
"tsx": "^4.19.2"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/better-sqlite3": "^7.6.12",
|
|
44
|
+
"@types/express": "^5.0.0",
|
|
45
|
+
"@types/node": "^22.13.4",
|
|
46
|
+
"typescript": "^5.7.3"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18.0.0"
|
|
50
|
+
}
|
|
51
|
+
}
|