myaiforone 1.1.57 → 1.1.58
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/.claude/commands/setup.md +191 -2
- package/agents/platform/hub-lite/CLAUDE.md +99 -0
- package/config.lite.json +44 -0
- package/dist/channels/whatsapp.d.ts +17 -0
- package/dist/channels/whatsapp.d.ts.map +1 -1
- package/dist/channels/whatsapp.js +137 -10
- package/dist/channels/whatsapp.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/executor.js +2 -2
- package/dist/executor.js.map +1 -1
- package/dist/web-ui.d.ts.map +1 -1
- package/dist/web-ui.js +194 -2
- package/dist/web-ui.js.map +1 -1
- package/docs/agent-registry-site-build.md +625 -0
- package/docs/lite-build-checklist.md +134 -0
- package/docs/lite-build-report.md +158 -0
- package/docs/mobile-design.md +123 -0
- package/package.json +3 -2
- package/public/activity.html +1 -0
- package/public/admin.html +1 -0
- package/public/agent-dashboard.html +1 -0
- package/public/api-docs.html +1 -0
- package/public/automations.html +1 -0
- package/public/changelog.html +1 -0
- package/public/gym.html +1 -0
- package/public/home.html +1 -0
- package/public/home2.html +18 -106
- package/public/index.html +4 -3
- package/public/lab.html +1 -0
- package/public/library.html +1 -0
- package/public/lite-mode.js +85 -0
- package/public/m.html +1005 -0
- package/public/manifest-m.json +25 -0
- package/public/marketplace.html +1 -0
- package/public/mcp-docs.html +1 -0
- package/public/mini.html +1 -0
- package/public/mobile.css +40 -11
- package/public/monitor.html +1 -0
- package/public/org.html +35 -0
- package/public/projects.html +1 -0
- package/public/settings.html +1 -0
- package/public/tasks.html +1 -0
- package/public/user-guide.html +1 -0
- package/server/mcp-server/dist/index.js +21 -0
- package/server/mcp-server/dist/lib/api-client.d.ts +3 -0
- package/server/mcp-server/dist/lib/api-client.js +3 -0
- package/server/mcp-server/index.ts +25 -0
- package/server/mcp-server/lib/api-client.ts +6 -0
- package/server/mcp-server-lite/dist/index.d.ts +10 -0
- package/server/mcp-server-lite/dist/index.js +199 -0
- package/server/mcp-server-lite/dist/lib/api-client.d.ts +26 -0
- package/server/mcp-server-lite/dist/lib/api-client.js +80 -0
- package/server/mcp-server-lite/index.ts +234 -0
- package/server/mcp-server-lite/lib/api-client.ts +107 -0
- package/server/mcp-server-lite/tsconfig.json +14 -0
- package/src/channels/whatsapp.ts +155 -10
- package/src/config.ts +3 -0
- package/src/executor.ts +2 -2
- package/src/web-ui.ts +219 -2
|
@@ -1,11 +1,200 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: setup
|
|
3
|
-
description: First-time setup wizard for MyAgent. Detects platform, installs dependencies, generates minimal config, builds, starts the service, and opens the web UI.
|
|
3
|
+
description: First-time setup wizard for MyAgent. Detects platform, installs dependencies, generates minimal config, builds, starts the service, and opens the web UI. Edition-aware — detects Pro vs Lite and adjusts the flow accordingly.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# MyAgent Setup Wizard
|
|
7
7
|
|
|
8
|
-
Get the user to the web UI as fast as possible.
|
|
8
|
+
Get the user to the web UI as fast as possible.
|
|
9
|
+
|
|
10
|
+
## Edition Detection (do this FIRST, before showing the plan)
|
|
11
|
+
|
|
12
|
+
Determine which edition to set up:
|
|
13
|
+
|
|
14
|
+
1. If `config.json` already exists and contains `"edition": "lite"` — use the **Lite path**
|
|
15
|
+
2. If `config.lite.json` exists in the project root and no `config.json` exists — use the **Lite path** (will copy `config.lite.json` as the base)
|
|
16
|
+
3. Otherwise — use the **Pro path** (default)
|
|
17
|
+
|
|
18
|
+
Store the result as `EDITION` = `"lite"` or `"pro"` for all subsequent steps.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## If EDITION is "lite" → follow the LITE SETUP PATH below
|
|
23
|
+
|
|
24
|
+
## If EDITION is "pro" → follow the PRO SETUP PATH further below
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# ========================================
|
|
29
|
+
# LITE SETUP PATH
|
|
30
|
+
# ========================================
|
|
31
|
+
|
|
32
|
+
Lite setup is simpler and faster — no channels, no creator agents, just the hub-lite agent and the web UI.
|
|
33
|
+
|
|
34
|
+
## Before You Start (Lite) — Show the Plan
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Welcome to MyAIforOne Lite! Here's what we'll do:
|
|
38
|
+
|
|
39
|
+
□ 1. Check prerequisites (Node.js, npm)
|
|
40
|
+
□ 2. Create your MyAIforOne Drive folder
|
|
41
|
+
□ 3. Generate your config
|
|
42
|
+
□ 4. Register hub agent
|
|
43
|
+
□ 5. Build the project
|
|
44
|
+
□ 6. Start the service & open the web UI
|
|
45
|
+
|
|
46
|
+
This takes about a minute. Let's go!
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Lite Step 1: Prerequisites & Platform Detection
|
|
50
|
+
|
|
51
|
+
Same as Pro Step 1 (check Node.js 22+, npm dependencies, detect platform). But do NOT mention iMessage or channel-related notes — Lite has no channels.
|
|
52
|
+
|
|
53
|
+
After checks pass, print:
|
|
54
|
+
```
|
|
55
|
+
✅ 1. Check prerequisites — Node.js [version], [macOS/Windows/Linux]
|
|
56
|
+
→ 2. Create MyAIforOne Drive...
|
|
57
|
+
□ 3. Generate config
|
|
58
|
+
□ 4. Register hub agent
|
|
59
|
+
□ 5. Build the project
|
|
60
|
+
□ 6. Start the service & open the web UI
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Lite Step 2: Create MyAIforOne Drive
|
|
64
|
+
|
|
65
|
+
Create a MINIMAL folder structure — only what Lite needs:
|
|
66
|
+
|
|
67
|
+
### macOS / Linux
|
|
68
|
+
```bash
|
|
69
|
+
mkdir -p "$HOME/Desktop/MyAIforOne Drive/PersonalAgents"
|
|
70
|
+
mkdir -p "$HOME/Desktop/MyAIforOne Drive/PlatformUtilities/hub"/{memory,FileStorage/Temp,FileStorage/Permanent}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Windows
|
|
74
|
+
```powershell
|
|
75
|
+
@(
|
|
76
|
+
"$env:USERPROFILE\Desktop\MyAIforOne Drive\PersonalAgents",
|
|
77
|
+
"$env:USERPROFILE\Desktop\MyAIforOne Drive\PlatformUtilities\hub\memory",
|
|
78
|
+
"$env:USERPROFILE\Desktop\MyAIforOne Drive\PlatformUtilities\hub\FileStorage\Temp",
|
|
79
|
+
"$env:USERPROFILE\Desktop\MyAIforOne Drive\PlatformUtilities\hub\FileStorage\Permanent"
|
|
80
|
+
) | ForEach-Object { New-Item -ItemType Directory -Force -Path $_ | Out-Null }
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
No PersonalRegistry, no creator agent directories, no gym directory — Lite doesn't use them.
|
|
84
|
+
|
|
85
|
+
Print progress after completion.
|
|
86
|
+
|
|
87
|
+
## Lite Step 3: Generate config.json
|
|
88
|
+
|
|
89
|
+
If `config.json` already exists with `edition: "lite"`, **skip this step** — just generate a fresh webhook secret and update it in place.
|
|
90
|
+
|
|
91
|
+
If `config.json` does NOT exist, use `config.lite.json` as the base template:
|
|
92
|
+
|
|
93
|
+
1. Copy `config.lite.json` → `config.json`
|
|
94
|
+
2. Generate a random webhook secret: `node -e "console.log(require('crypto').randomBytes(16).toString('hex'))"`
|
|
95
|
+
3. Replace the `webhookSecret` value with the generated secret
|
|
96
|
+
4. Ensure these settings are set:
|
|
97
|
+
- `service.edition`: `"lite"`
|
|
98
|
+
- `service.webUI.enabled`: `true`, `port`: `4888`
|
|
99
|
+
- `service.maxAgents`: `5`
|
|
100
|
+
- `service.gymEnabled`: `false`
|
|
101
|
+
- `channels`: `{}` (empty — Lite has no channels)
|
|
102
|
+
- `defaultSkills`: `[]` (empty — Lite doesn't auto-assign skills)
|
|
103
|
+
- `defaultMcps`: `[]` (empty — Lite doesn't auto-assign MCPs)
|
|
104
|
+
5. Ensure the `myaiforone-lite` MCP entry is present:
|
|
105
|
+
```json
|
|
106
|
+
"myaiforone-lite": {
|
|
107
|
+
"type": "stdio",
|
|
108
|
+
"command": "node",
|
|
109
|
+
"args": ["./server/mcp-server-lite/dist/index.js"],
|
|
110
|
+
"env": {
|
|
111
|
+
"MYAGENT_API_URL": "http://localhost:4888",
|
|
112
|
+
"MYAGENT_REGISTRY_URL": "https://myaiforone.com"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
6. Do NOT add `myaiforone-local`, `aigym`, `aiforone_computeruse`, or any other Pro MCPs
|
|
117
|
+
7. Write to config.json
|
|
118
|
+
|
|
119
|
+
**Important:** config.json is in .gitignore — never commit it.
|
|
120
|
+
|
|
121
|
+
Print progress after completion.
|
|
122
|
+
|
|
123
|
+
## Lite Step 4: Register Hub-Lite Agent (silent — do NOT ask)
|
|
124
|
+
|
|
125
|
+
Register ONLY the hub-lite agent in config.json. No creator agents, no gym agent.
|
|
126
|
+
|
|
127
|
+
- `agentId`: `hub`
|
|
128
|
+
- `name`: `Hub`
|
|
129
|
+
- `description`: "Your AI assistant — chat, discover agents, and install from the Agent Registry."
|
|
130
|
+
- `agentHome`: `~/Desktop/MyAIforOne Drive/PlatformUtilities/hub`
|
|
131
|
+
- `claudeMd`: `agents/platform/hub-lite/CLAUDE.md` (NOTE: hub-**lite**, not hub)
|
|
132
|
+
- `memoryDir`: `~/Desktop/MyAIforOne Drive/PlatformUtilities/hub/memory`
|
|
133
|
+
- `workspace`: `<PROJECT_PATH>`
|
|
134
|
+
- `persistent`: true, `streaming`: true
|
|
135
|
+
- `subAgents`: `"*"` (routes to all agents)
|
|
136
|
+
- `mcps`: `["myaiforone-lite"]` (NOTE: myaiforone-**lite**, not myaiforone-local)
|
|
137
|
+
- `allowedTools`: all tools (Read, Edit, Write, Glob, Grep, Bash, WebFetch, WebSearch)
|
|
138
|
+
- `routes`: web route only
|
|
139
|
+
- `agentClass`: `"platform"`
|
|
140
|
+
|
|
141
|
+
Set `"defaultAgent": "hub"` at the top level of config.json.
|
|
142
|
+
|
|
143
|
+
Do NOT register agentcreator, skillcreator, appcreator, promptcreator, or gym agents — Lite doesn't use them. Users install agents from the Agent Registry instead.
|
|
144
|
+
|
|
145
|
+
Print progress after completion.
|
|
146
|
+
|
|
147
|
+
## Lite Step 5: Validate & Build
|
|
148
|
+
|
|
149
|
+
Build the lite MCP server first, then the main project:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
cd server/mcp-server-lite && npm install && npm run build && cd ../..
|
|
153
|
+
node -e "JSON.parse(require('fs').readFileSync('config.json','utf8')); console.log('Config OK')"
|
|
154
|
+
npm run build
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Print progress after completion.
|
|
158
|
+
|
|
159
|
+
## Lite Step 6: Start the Service & Open Browser
|
|
160
|
+
|
|
161
|
+
Same as Pro Step 6 (start service, create desktop shortcut, open browser), but the final output is different:
|
|
162
|
+
|
|
163
|
+
### Final Output (Lite)
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
✅ 1. Check prerequisites
|
|
167
|
+
✅ 2. Create MyAIforOne Drive
|
|
168
|
+
✅ 3. Generate config
|
|
169
|
+
✅ 4. Register hub agent
|
|
170
|
+
✅ 5. Build the project
|
|
171
|
+
✅ 6. Start the service & open the web UI
|
|
172
|
+
|
|
173
|
+
Setup complete! (Lite Edition)
|
|
174
|
+
|
|
175
|
+
Web UI: http://localhost:4888
|
|
176
|
+
Monitor: http://localhost:4888/monitor
|
|
177
|
+
|
|
178
|
+
The browser should have opened to the Monitor page.
|
|
179
|
+
Chat with the hub agent to discover and install agents
|
|
180
|
+
from the MyAIforOne Agent Registry.
|
|
181
|
+
|
|
182
|
+
Quick commands:
|
|
183
|
+
npm start — start manually
|
|
184
|
+
npm run dev — dev mode with auto-reload
|
|
185
|
+
http://localhost:4888 — web dashboard
|
|
186
|
+
|
|
187
|
+
To upgrade to Pro (channels, boards, automations, and more),
|
|
188
|
+
visit the Settings page: http://localhost:4888/admin
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
# ========================================
|
|
194
|
+
# PRO SETUP PATH (default)
|
|
195
|
+
# ========================================
|
|
196
|
+
|
|
197
|
+
Pro setup includes channels, creator agents, gym, and the full feature set. Channel setup and agent creation are handled by the hub agent in the browser — NOT in the terminal.
|
|
9
198
|
|
|
10
199
|
## Before You Start — Show the Plan
|
|
11
200
|
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Hub Agent (Lite)
|
|
2
|
+
|
|
3
|
+
You are **@hub** — the AI assistant for MyAIforOne Lite. You are the user's primary interface. When they message without mentioning a specific agent, they're talking to you.
|
|
4
|
+
|
|
5
|
+
You have two jobs:
|
|
6
|
+
1. **Chat** — Be a helpful, general-purpose assistant
|
|
7
|
+
2. **Agent Registry** — Help users discover, install, and configure agents from the MyAIforOne Agent Registry
|
|
8
|
+
|
|
9
|
+
## Core Rules
|
|
10
|
+
|
|
11
|
+
1. **Always use MCP tools** for agent operations — never edit config.json or create directories manually
|
|
12
|
+
2. **Be conversational** — you're the front door, make it easy
|
|
13
|
+
3. **When unsure what's available**, call `browse_agent_registry` to check the Registry
|
|
14
|
+
4. **After installing an agent**, check if it needs API keys and walk the user through setup
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Tool Cheat Sheet — Intent → Tools
|
|
19
|
+
|
|
20
|
+
**Status** → `health_check`
|
|
21
|
+
**Agents (local)** → `list_agents` · `get_agent` · `get_agent_instructions` · `uninstall_agent`
|
|
22
|
+
**Chat** → `send_message` · `start_stream` · `get_chat_job_raw` · `stop_chat_job` · `reset_session`
|
|
23
|
+
**Agent Registry** → `browse_agent_registry` · `get_agent_detail` · `get_agent_package` · `list_categories` · `install_agent`
|
|
24
|
+
**MCP Keys** → `list_mcps` · `save_mcp_key`
|
|
25
|
+
**Config** → `get_service_config`
|
|
26
|
+
**Templates** → `list_templates` · `deploy_template`
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Registry MCP Tools
|
|
31
|
+
|
|
32
|
+
The `myaiforone-registry` MCP connects to `https://myaiforone.com/mcp/registry` and provides these tools:
|
|
33
|
+
|
|
34
|
+
- `browse_agent_registry` — search/browse agents from the registry (query?, category?, tier?, page?, limit?)
|
|
35
|
+
- `get_agent_detail` — get full details of a specific agent by id or slug
|
|
36
|
+
- `get_agent_package` — get the installable package (CLAUDE.md, agent.json, skills) for an agent by id or slug
|
|
37
|
+
- `list_categories` — list all available agent categories
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Agent Registry Flow
|
|
42
|
+
|
|
43
|
+
When a user asks for a new agent or capability:
|
|
44
|
+
|
|
45
|
+
1. **Search the Registry**: Call `browse_agent_registry` with their request as the query
|
|
46
|
+
2. **Show options**: Present matching agents with name, description, and what they can do
|
|
47
|
+
3. **Install on request**: When the user picks one, call `install_agent` with the registry ID
|
|
48
|
+
4. **Handle MCP setup**: If the response includes `requiredMcpKeys`, tell the user which API keys are needed and use `save_mcp_key` to store them
|
|
49
|
+
5. **Confirm**: Let them know the agent is ready and how to use it (e.g., "@finance what's my balance?")
|
|
50
|
+
|
|
51
|
+
### Example conversation:
|
|
52
|
+
```
|
|
53
|
+
User: I need help managing my finances
|
|
54
|
+
Hub: Let me check the Agent Registry for finance agents...
|
|
55
|
+
[calls browse_agent_registry with query "finance"]
|
|
56
|
+
I found 3 options:
|
|
57
|
+
1. @finance — Personal finance tracker with Stripe + QuickBooks
|
|
58
|
+
2. @budget — Simple budgeting assistant
|
|
59
|
+
3. @invoicer — Invoice creation and tracking
|
|
60
|
+
Which would you like to install?
|
|
61
|
+
|
|
62
|
+
User: Let's go with @finance
|
|
63
|
+
Hub: Installing @finance from the Agent Registry...
|
|
64
|
+
[calls install_agent]
|
|
65
|
+
Done! @finance is installed. It uses Stripe and QuickBooks MCPs.
|
|
66
|
+
To connect Stripe, I'll need your API key. You can find it at
|
|
67
|
+
dashboard.stripe.com/apikeys. Ready to set it up?
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### When a user pastes a Registry install command:
|
|
71
|
+
Users may paste a message from the myaiforone.com website like:
|
|
72
|
+
> "Please install @finance from the Agent Registry, ID: mkt_finance_v2"
|
|
73
|
+
|
|
74
|
+
Parse the ID and call `install_agent` directly — no need to browse first.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Talking to Other Agents
|
|
79
|
+
|
|
80
|
+
You can send messages to any installed agent using `send_message`. For example:
|
|
81
|
+
- User asks: "Ask @finance what my monthly spend is"
|
|
82
|
+
- You call: `send_message` with agentId "finance" and the question
|
|
83
|
+
- You relay the response back
|
|
84
|
+
|
|
85
|
+
For long-running responses, use `start_stream` + poll with `get_chat_job_raw`.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## What You Don't Do (Lite Edition)
|
|
90
|
+
|
|
91
|
+
These features are available in MyAIforOne Pro:
|
|
92
|
+
- Boards (dashboard widgets)
|
|
93
|
+
- Projects (cross-agent initiatives)
|
|
94
|
+
- Automations (crons, goals)
|
|
95
|
+
- Organizations (agent hierarchies)
|
|
96
|
+
- Channel management (Telegram, Slack, Discord, WhatsApp, iMessage)
|
|
97
|
+
- Advanced memory & wiki sync
|
|
98
|
+
|
|
99
|
+
If a user asks about these, let them know they're available in the Pro version.
|
package/config.lite.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"service": {
|
|
3
|
+
"edition": "lite",
|
|
4
|
+
"logLevel": "debug",
|
|
5
|
+
"logFile": "./logs/service.log",
|
|
6
|
+
"personalAgentsDir": "~/Desktop/MyAIforOne Drive/PersonalAgents",
|
|
7
|
+
"webUI": {
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"port": 4888,
|
|
10
|
+
"webhookSecret": "CHANGE_ME_random_string"
|
|
11
|
+
},
|
|
12
|
+
"claudeAccounts": {
|
|
13
|
+
"main": "~/.claude"
|
|
14
|
+
},
|
|
15
|
+
"maxAgents": 5,
|
|
16
|
+
"multiModelEnabled": false,
|
|
17
|
+
"gymEnabled": false,
|
|
18
|
+
"gymOnlyMode": false,
|
|
19
|
+
"aibriefingEnabled": false,
|
|
20
|
+
"sharedAgentsEnabled": false
|
|
21
|
+
},
|
|
22
|
+
"channels": {},
|
|
23
|
+
"mcps": {
|
|
24
|
+
"myaiforone-lite": {
|
|
25
|
+
"type": "stdio",
|
|
26
|
+
"command": "node",
|
|
27
|
+
"args": [
|
|
28
|
+
"./server/mcp-server-lite/dist/index.js"
|
|
29
|
+
],
|
|
30
|
+
"env": {
|
|
31
|
+
"MYAGENT_API_URL": "http://localhost:4888",
|
|
32
|
+
"MYAGENT_REGISTRY_URL": "https://myaiforone.com"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"myaiforone-registry": {
|
|
36
|
+
"type": "http",
|
|
37
|
+
"url": "https://myaiforone.com/mcp/registry"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"agents": {},
|
|
41
|
+
"defaultAgent": null,
|
|
42
|
+
"defaultSkills": [],
|
|
43
|
+
"defaultMcps": []
|
|
44
|
+
}
|
|
@@ -10,8 +10,24 @@ export declare class WhatsAppDriver implements ChannelDriver {
|
|
|
10
10
|
private stopping;
|
|
11
11
|
/** Track message IDs sent by this socket so we don't echo agent replies */
|
|
12
12
|
private sentIds;
|
|
13
|
+
/**
|
|
14
|
+
* Per-group gallery upload config.
|
|
15
|
+
* New format: photoGroups: { "jid@g.us": { uploadUrl, secret } }
|
|
16
|
+
* Legacy compat: photoGroups: string[] + photoUploadUrl + photoUploadSecret
|
|
17
|
+
*/
|
|
18
|
+
private photoGroups;
|
|
13
19
|
constructor(config: Record<string, unknown>);
|
|
14
20
|
start(): Promise<void>;
|
|
21
|
+
/** Hot-reload photoGroups from updated config (called by API endpoints) */
|
|
22
|
+
updatePhotoGroups(groups: Record<string, {
|
|
23
|
+
uploadUrl: string;
|
|
24
|
+
secret: string;
|
|
25
|
+
}>): void;
|
|
26
|
+
/** Return current photoGroups for API reads */
|
|
27
|
+
getPhotoGroups(): Record<string, {
|
|
28
|
+
uploadUrl: string;
|
|
29
|
+
secret: string;
|
|
30
|
+
}>;
|
|
15
31
|
stop(): Promise<void>;
|
|
16
32
|
onMessage(handler: (msg: InboundMessage) => Promise<void>): void;
|
|
17
33
|
send(msg: OutboundMessage): Promise<void>;
|
|
@@ -19,5 +35,6 @@ export declare class WhatsAppDriver implements ChannelDriver {
|
|
|
19
35
|
private handleConnectionUpdate;
|
|
20
36
|
private reconnect;
|
|
21
37
|
private handleMessagesUpsert;
|
|
38
|
+
private uploadMediaToGallery;
|
|
22
39
|
}
|
|
23
40
|
//# sourceMappingURL=whatsapp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp.d.ts","sourceRoot":"","sources":["../../src/channels/whatsapp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"whatsapp.d.ts","sourceRoot":"","sources":["../../src/channels/whatsapp.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAejF,qBAAa,cAAe,YAAW,aAAa;IAClD,QAAQ,CAAC,SAAS,cAAc;IAEhC,OAAO,CAAC,IAAI,CAAyB;IACrC,OAAO,CAAC,cAAc,CAAyD;IAC/E,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,2EAA2E;IAC3E,OAAO,CAAC,OAAO,CAAqB;IAEpC;;;;OAIG;IACH,OAAO,CAAC,WAAW,CAAiE;gBAExE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IA0BrC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B,2EAA2E;IAC3E,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI;IAUtF,+CAA+C;IAC/C,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAQjE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAI1D,IAAI,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;YAMjC,OAAO;IA+BrB,OAAO,CAAC,sBAAsB;YA4ChB,SAAS;YAWT,oBAAoB;YA+GpB,oBAAoB;CAqDnC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { makeWASocket, useMultiFileAuthState, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, DisconnectReason, } from "@whiskeysockets/baileys";
|
|
2
|
-
import { mkdirSync } from "node:fs";
|
|
3
|
-
import { resolve } from "node:path";
|
|
1
|
+
import { makeWASocket, useMultiFileAuthState, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, DisconnectReason, downloadMediaMessage, } from "@whiskeysockets/baileys";
|
|
2
|
+
import { mkdirSync, writeFileSync, unlinkSync } from "node:fs";
|
|
3
|
+
import { resolve, join } from "node:path";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
4
5
|
import { log } from "../logger.js";
|
|
5
6
|
// Baileys is noisy — suppress its internal logger
|
|
6
7
|
const silentLogger = {
|
|
@@ -24,15 +25,59 @@ export class WhatsAppDriver {
|
|
|
24
25
|
stopping = false;
|
|
25
26
|
/** Track message IDs sent by this socket so we don't echo agent replies */
|
|
26
27
|
sentIds = new Set();
|
|
28
|
+
/**
|
|
29
|
+
* Per-group gallery upload config.
|
|
30
|
+
* New format: photoGroups: { "jid@g.us": { uploadUrl, secret } }
|
|
31
|
+
* Legacy compat: photoGroups: string[] + photoUploadUrl + photoUploadSecret
|
|
32
|
+
*/
|
|
33
|
+
photoGroups = new Map();
|
|
27
34
|
constructor(config) {
|
|
28
35
|
const baseAuthDir = config.authDir ?? "./data/whatsapp-auth";
|
|
29
36
|
this.authDir = resolve(baseAuthDir);
|
|
30
37
|
mkdirSync(this.authDir, { recursive: true });
|
|
38
|
+
// Build per-group gallery upload map
|
|
39
|
+
const rawGroups = config.photoGroups;
|
|
40
|
+
if (rawGroups && typeof rawGroups === "object" && !Array.isArray(rawGroups)) {
|
|
41
|
+
// New map format: { "jid": { uploadUrl, secret } }
|
|
42
|
+
for (const [jid, cfg] of Object.entries(rawGroups)) {
|
|
43
|
+
if (cfg?.uploadUrl && cfg?.secret) {
|
|
44
|
+
this.photoGroups.set(jid, { uploadUrl: cfg.uploadUrl, secret: cfg.secret });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (Array.isArray(rawGroups)) {
|
|
49
|
+
// Legacy array format — pair with top-level photoUploadUrl + photoUploadSecret
|
|
50
|
+
const url = config.photoUploadUrl ?? null;
|
|
51
|
+
const secret = config.photoUploadSecret ?? null;
|
|
52
|
+
if (url && secret) {
|
|
53
|
+
for (const jid of rawGroups) {
|
|
54
|
+
this.photoGroups.set(jid, { uploadUrl: url, secret });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
31
58
|
}
|
|
32
59
|
async start() {
|
|
33
60
|
this.stopping = false;
|
|
34
61
|
await this.connect();
|
|
35
62
|
}
|
|
63
|
+
/** Hot-reload photoGroups from updated config (called by API endpoints) */
|
|
64
|
+
updatePhotoGroups(groups) {
|
|
65
|
+
this.photoGroups.clear();
|
|
66
|
+
for (const [jid, cfg] of Object.entries(groups)) {
|
|
67
|
+
if (cfg?.uploadUrl && cfg?.secret) {
|
|
68
|
+
this.photoGroups.set(jid, { uploadUrl: cfg.uploadUrl, secret: cfg.secret });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
log.info(`[whatsapp] photoGroups reloaded: ${this.photoGroups.size} group(s)`);
|
|
72
|
+
}
|
|
73
|
+
/** Return current photoGroups for API reads */
|
|
74
|
+
getPhotoGroups() {
|
|
75
|
+
const result = {};
|
|
76
|
+
for (const [jid, cfg] of this.photoGroups) {
|
|
77
|
+
result[jid] = cfg;
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
36
81
|
async stop() {
|
|
37
82
|
this.stopping = true;
|
|
38
83
|
if (this.sock) {
|
|
@@ -124,7 +169,7 @@ export class WhatsAppDriver {
|
|
|
124
169
|
}
|
|
125
170
|
await this.connect();
|
|
126
171
|
}
|
|
127
|
-
handleMessagesUpsert(upsert) {
|
|
172
|
+
async handleMessagesUpsert(upsert) {
|
|
128
173
|
if (upsert.type !== "notify")
|
|
129
174
|
return;
|
|
130
175
|
for (const msg of upsert.messages) {
|
|
@@ -139,15 +184,29 @@ export class WhatsAppDriver {
|
|
|
139
184
|
this.sentIds.delete(msgId);
|
|
140
185
|
continue;
|
|
141
186
|
}
|
|
187
|
+
const remoteJid = msg.key.remoteJid;
|
|
188
|
+
const imageMsg = msg.message?.imageMessage;
|
|
189
|
+
const videoMsg = msg.message?.videoMessage;
|
|
190
|
+
// Gallery sidecar: upload media to configured gallery for this group (fire-and-forget)
|
|
191
|
+
if (imageMsg && this.photoGroups.has(remoteJid)) {
|
|
192
|
+
this.uploadMediaToGallery(msg, "image", this.photoGroups.get(remoteJid)).catch((err) => {
|
|
193
|
+
log.warn(`[gallery] Photo upload failed for ${remoteJid}: ${err}`);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
if (videoMsg && this.photoGroups.has(remoteJid)) {
|
|
197
|
+
this.uploadMediaToGallery(msg, "video", this.photoGroups.get(remoteJid)).catch((err) => {
|
|
198
|
+
log.warn(`[gallery] Video upload failed for ${remoteJid}: ${err}`);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
142
201
|
// Extract text from various message types
|
|
143
202
|
const text = msg.message?.conversation ||
|
|
144
203
|
msg.message?.extendedTextMessage?.text ||
|
|
145
|
-
|
|
204
|
+
imageMsg?.caption ||
|
|
146
205
|
msg.message?.videoMessage?.caption ||
|
|
147
206
|
null;
|
|
148
|
-
|
|
207
|
+
// Skip messages with no text AND no image
|
|
208
|
+
if (!text?.trim() && !imageMsg)
|
|
149
209
|
continue;
|
|
150
|
-
const remoteJid = msg.key.remoteJid;
|
|
151
210
|
const isGroup = remoteJid.endsWith("@g.us");
|
|
152
211
|
const sender = isGroup
|
|
153
212
|
? msg.key.participant || remoteJid
|
|
@@ -163,6 +222,23 @@ export class WhatsAppDriver {
|
|
|
163
222
|
sender: quotedMsg.participant || undefined,
|
|
164
223
|
}
|
|
165
224
|
: undefined;
|
|
225
|
+
// Download image to temp file so the executor can pass it to Claude as vision
|
|
226
|
+
let tempImagePath = null;
|
|
227
|
+
if (imageMsg && this.sock) {
|
|
228
|
+
try {
|
|
229
|
+
const buffer = await downloadMediaMessage(msg, "buffer", {}, { logger: silentLogger, reuploadRequest: this.sock.updateMediaMessage });
|
|
230
|
+
if (buffer && buffer.length > 0) {
|
|
231
|
+
const mime = imageMsg.mimetype || "image/jpeg";
|
|
232
|
+
const ext = mime.includes("png") ? ".png" : mime.includes("gif") ? ".gif" : mime.includes("webp") ? ".webp" : ".jpg";
|
|
233
|
+
tempImagePath = join(tmpdir(), `wa_img_${Date.now()}_${Math.random().toString(36).slice(2)}${ext}`);
|
|
234
|
+
writeFileSync(tempImagePath, buffer);
|
|
235
|
+
log.debug(`[whatsapp] Image saved to temp: ${tempImagePath} (${buffer.length} bytes)`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
catch (err) {
|
|
239
|
+
log.warn(`[whatsapp] Failed to download image for agent: ${err}`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
166
242
|
const inbound = {
|
|
167
243
|
id: msg.key.id || String(Date.now()),
|
|
168
244
|
channel: this.channelId,
|
|
@@ -170,20 +246,71 @@ export class WhatsAppDriver {
|
|
|
170
246
|
chatType: isGroup ? "group" : "dm",
|
|
171
247
|
sender,
|
|
172
248
|
senderName: msg.pushName || undefined,
|
|
173
|
-
text,
|
|
249
|
+
text: text?.trim() || "",
|
|
174
250
|
timestamp: msg.messageTimestamp * 1000,
|
|
175
251
|
isFromMe: false,
|
|
176
252
|
isGroup,
|
|
177
253
|
groupName: undefined,
|
|
178
254
|
replyTo,
|
|
255
|
+
...(tempImagePath ? { attachments: [{ path: tempImagePath, mimeType: imageMsg?.mimetype || "image/jpeg" }] } : {}),
|
|
179
256
|
raw: msg,
|
|
180
257
|
};
|
|
181
258
|
if (this.messageHandler) {
|
|
182
|
-
this.messageHandler(inbound)
|
|
183
|
-
log.error(`WhatsApp message handler error: ${err}`);
|
|
259
|
+
this.messageHandler(inbound)
|
|
260
|
+
.catch((err) => { log.error(`WhatsApp message handler error: ${err}`); })
|
|
261
|
+
.finally(() => {
|
|
262
|
+
// Clean up temp image after agent is done
|
|
263
|
+
if (tempImagePath) {
|
|
264
|
+
try {
|
|
265
|
+
unlinkSync(tempImagePath);
|
|
266
|
+
}
|
|
267
|
+
catch { }
|
|
268
|
+
}
|
|
184
269
|
});
|
|
185
270
|
}
|
|
186
271
|
}
|
|
187
272
|
}
|
|
273
|
+
async uploadMediaToGallery(msg, mediaType, galleryCfg) {
|
|
274
|
+
if (!this.sock)
|
|
275
|
+
return;
|
|
276
|
+
const mediaMsg = mediaType === "image"
|
|
277
|
+
? msg.message?.imageMessage
|
|
278
|
+
: msg.message?.videoMessage;
|
|
279
|
+
if (!mediaMsg)
|
|
280
|
+
return;
|
|
281
|
+
// Download media buffer from WhatsApp
|
|
282
|
+
const buffer = await downloadMediaMessage(msg, "buffer", {}, { logger: silentLogger, reuploadRequest: this.sock.updateMediaMessage });
|
|
283
|
+
if (!buffer || buffer.length === 0) {
|
|
284
|
+
log.warn(`[gallery] Downloaded ${mediaType} buffer is empty, skipping`);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
// Build multipart form
|
|
288
|
+
const mime = mediaMsg.mimetype || (mediaType === "video" ? "video/mp4" : "image/jpeg");
|
|
289
|
+
let ext;
|
|
290
|
+
if (mediaType === "video") {
|
|
291
|
+
ext = mime.includes("mov") ? ".mov" : ".mp4";
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
ext = mime.includes("png") ? ".png" : mime.includes("gif") ? ".gif" : mime.includes("webp") ? ".webp" : ".jpg";
|
|
295
|
+
}
|
|
296
|
+
const filename = `${mediaType}_${Date.now()}${ext}`;
|
|
297
|
+
const formData = new FormData();
|
|
298
|
+
const ab = new ArrayBuffer(buffer.byteLength);
|
|
299
|
+
new Uint8Array(ab).set(buffer);
|
|
300
|
+
formData.append("photo", new Blob([ab], { type: mime }), filename);
|
|
301
|
+
formData.append("sender", msg.pushName || msg.key.participant || "Guest");
|
|
302
|
+
if (mediaMsg.caption)
|
|
303
|
+
formData.append("caption", mediaMsg.caption);
|
|
304
|
+
const res = await fetch(galleryCfg.uploadUrl, {
|
|
305
|
+
method: "POST",
|
|
306
|
+
headers: { "x-upload-secret": galleryCfg.secret },
|
|
307
|
+
body: formData,
|
|
308
|
+
});
|
|
309
|
+
if (!res.ok) {
|
|
310
|
+
const body = await res.text();
|
|
311
|
+
throw new Error(`Gallery upload returned ${res.status}: ${body}`);
|
|
312
|
+
}
|
|
313
|
+
log.info(`[gallery] ${mediaType} forwarded: ${filename} from ${msg.pushName || "Guest"}`);
|
|
314
|
+
}
|
|
188
315
|
}
|
|
189
316
|
//# sourceMappingURL=whatsapp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp.js","sourceRoot":"","sources":["../../src/channels/whatsapp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,GAGjB,MAAM,yBAAyB,C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|
boardEnabled?: boolean;
|
|
98
98
|
boardLayout?: "small" | "medium" | "large";
|
|
99
99
|
deployedFrom?: string;
|
|
100
|
+
imageSupport?: boolean;
|
|
100
101
|
}
|
|
101
102
|
export interface ChannelConfig {
|
|
102
103
|
enabled: boolean;
|
|
@@ -109,6 +110,8 @@ export interface WebUIConfig {
|
|
|
109
110
|
webhookSecret?: string;
|
|
110
111
|
}
|
|
111
112
|
export interface ServiceConfig {
|
|
113
|
+
edition?: "lite" | "pro";
|
|
114
|
+
maxAgents?: number;
|
|
112
115
|
logLevel: LogLevel;
|
|
113
116
|
logFile?: string;
|
|
114
117
|
pairingCode?: string;
|