agentmesh-ai 0.2.1 → 0.3.0
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/README.md +127 -144
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +41 -22
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/join.d.ts +1 -5
- package/dist/cli/commands/join.d.ts.map +1 -1
- package/dist/cli/commands/join.js +99 -76
- package/dist/cli/commands/join.js.map +1 -1
- package/dist/cli/commands/serve.d.ts.map +1 -1
- package/dist/cli/commands/serve.js +8 -1
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +31 -10
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +15 -0
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/index.js +3 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cloud/cloud-conversation.d.ts +83 -0
- package/dist/cloud/cloud-conversation.d.ts.map +1 -0
- package/dist/cloud/cloud-conversation.js +357 -0
- package/dist/cloud/cloud-conversation.js.map +1 -0
- package/dist/cloud/index.d.ts +4 -0
- package/dist/cloud/index.d.ts.map +1 -0
- package/dist/cloud/index.js +3 -0
- package/dist/cloud/index.js.map +1 -0
- package/dist/cloud/supabase-client.d.ts +29 -0
- package/dist/cloud/supabase-client.d.ts.map +1 -0
- package/dist/cloud/supabase-client.js +135 -0
- package/dist/cloud/supabase-client.js.map +1 -0
- package/dist/conversation/server.d.ts.map +1 -1
- package/dist/conversation/server.js +6 -0
- package/dist/conversation/server.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/conversation-tools.d.ts +5 -1
- package/dist/mcp/conversation-tools.d.ts.map +1 -1
- package/dist/mcp/conversation-tools.js +202 -149
- package/dist/mcp/conversation-tools.js.map +1 -1
- package/dist/mcp/index.js +94 -36
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/memory-tools.d.ts +20 -2
- package/dist/mcp/memory-tools.d.ts.map +1 -1
- package/dist/mcp/memory-tools.js +88 -44
- package/dist/mcp/memory-tools.js.map +1 -1
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +1 -0
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/merge-view.d.ts.map +1 -1
- package/dist/memory/merge-view.js +5 -4
- package/dist/memory/merge-view.js.map +1 -1
- package/dist/memory/reader.js +2 -2
- package/dist/memory/reader.js.map +1 -1
- package/dist/memory/schema.d.ts +3 -0
- package/dist/memory/schema.d.ts.map +1 -1
- package/dist/memory/schema.js +1 -0
- package/dist/memory/schema.js.map +1 -1
- package/dist/memory/types.d.ts +1 -0
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/memory/write-utils.d.ts +30 -0
- package/dist/memory/write-utils.d.ts.map +1 -0
- package/dist/memory/write-utils.js +98 -0
- package/dist/memory/write-utils.js.map +1 -0
- package/dist/memory/writer.d.ts.map +1 -1
- package/dist/memory/writer.js +21 -84
- package/dist/memory/writer.js.map +1 -1
- package/dist/utils/id.d.ts +2 -0
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +4 -0
- package/dist/utils/id.js.map +1 -1
- package/dist/utils/notify.d.ts +2 -0
- package/dist/utils/notify.d.ts.map +1 -0
- package/dist/utils/notify.js +50 -0
- package/dist/utils/notify.js.map +1 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,24 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AgentMesh
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Let your AI agents share knowledge and talk to each other.**
|
|
4
4
|
|
|
5
|
-
You use Claude Code. Your teammate uses Cursor. Another uses Copilot. Your AIs have no idea what each other is doing.
|
|
5
|
+
You use Claude Code. Your teammate uses Cursor. Another uses Copilot. Your AIs have no idea what each other is doing. AgentMesh fixes that.
|
|
6
6
|
|
|
7
|
+
```bash
|
|
8
|
+
npx agentmesh-ai init # Get a Team ID
|
|
9
|
+
npx agentmesh-ai setup # Configure your AI tool
|
|
7
10
|
```
|
|
8
|
-
|
|
11
|
+
|
|
12
|
+
Share your Team ID with teammates. They run:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx agentmesh-ai join team-a1b2c3d4
|
|
9
16
|
```
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
Done. Your AIs now share knowledge and can discuss in real time.
|
|
12
19
|
|
|
13
20
|
---
|
|
14
21
|
|
|
15
22
|
## What It Does
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
### Shared Memory
|
|
18
25
|
|
|
19
|
-
|
|
26
|
+
Your AI records what it learns — APIs, architecture decisions, gotchas, conventions. Every other AI on the team can read it instantly.
|
|
20
27
|
|
|
21
|
-
|
|
28
|
+
```
|
|
29
|
+
You: "Build the user authentication API"
|
|
30
|
+
|
|
31
|
+
Your AI writes code, then automatically records:
|
|
32
|
+
- "User API: POST /api/users, POST /api/auth/login (JWT)"
|
|
33
|
+
- "Using bcrypt for password hashing, 12 rounds"
|
|
34
|
+
|
|
35
|
+
Teammate's AI starts frontend work, reads memory:
|
|
36
|
+
- Sees the exact API paths, auth flow, data formats
|
|
37
|
+
- No Slack messages, no documentation, no meetings needed
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Real-time Discussion
|
|
41
|
+
|
|
42
|
+
When AIs need to align on something, they discuss directly:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
You: "Go discuss the API response format with the frontend AI, wait 10 min"
|
|
46
|
+
|
|
47
|
+
Your AI sends a message → teammate gets a desktop notification
|
|
48
|
+
Teammate tells their AI: "Go join the API discussion"
|
|
49
|
+
→ Multi-round back-and-forth, fully automatic
|
|
50
|
+
→ Conclusion saved to shared memory
|
|
51
|
+
Your AI comes back: "We agreed on paginated JSON, 20 items per page."
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
You say one sentence. The AIs handle the rest.
|
|
55
|
+
|
|
56
|
+
### Team Voting
|
|
57
|
+
|
|
58
|
+
For important decisions, every human must approve:
|
|
59
|
+
|
|
60
|
+
1. AI presents options via an interactive form
|
|
61
|
+
2. Each team member's AI asks their human to vote
|
|
62
|
+
3. All approve -> decision becomes protected (locked)
|
|
63
|
+
4. Anyone rejects -> discussion restarts with their feedback
|
|
22
64
|
|
|
23
65
|
---
|
|
24
66
|
|
|
@@ -27,160 +69,100 @@ That's it. Your AI now shares knowledge with every other AI on the team.
|
|
|
27
69
|
### 1. Initialize (30 seconds)
|
|
28
70
|
|
|
29
71
|
```bash
|
|
72
|
+
cd your-project
|
|
30
73
|
npx agentmesh-ai init
|
|
31
74
|
```
|
|
32
75
|
|
|
33
|
-
|
|
76
|
+
You'll get a **Team ID** like `team-a1b2c3d4`. This is your team's cloud identifier.
|
|
34
77
|
|
|
35
|
-
### 2. Configure your AI tool
|
|
78
|
+
### 2. Configure your AI tool
|
|
36
79
|
|
|
37
80
|
```bash
|
|
38
81
|
npx agentmesh-ai setup
|
|
39
82
|
```
|
|
40
83
|
|
|
41
|
-
Auto-detects Claude Code, Cursor, Windsurf and
|
|
84
|
+
Auto-detects Claude Code, Cursor, Windsurf and configures MCP.
|
|
42
85
|
|
|
43
86
|
### 3. Invite teammates
|
|
44
87
|
|
|
45
|
-
|
|
46
|
-
|
|
88
|
+
Send them your Team ID. They run:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npx agentmesh-ai join team-a1b2c3d4
|
|
47
92
|
```
|
|
48
93
|
|
|
49
|
-
|
|
94
|
+
One command — creates config, registers in cloud, configures MCP. Done.
|
|
50
95
|
|
|
51
96
|
### 4. Start coding
|
|
52
97
|
|
|
53
98
|
Your AI now automatically:
|
|
54
|
-
- Reads shared memory
|
|
99
|
+
- Reads shared memory when starting a new task
|
|
55
100
|
- Records important knowledge after completing work
|
|
56
|
-
-
|
|
101
|
+
- Can discuss with other AIs when you ask it to
|
|
57
102
|
|
|
58
103
|
---
|
|
59
104
|
|
|
60
105
|
## How It Works
|
|
61
106
|
|
|
62
|
-
###
|
|
107
|
+
### Cloud-First Architecture
|
|
63
108
|
|
|
64
|
-
|
|
109
|
+
All data lives in the cloud. No Git sync, no local servers, no port forwarding.
|
|
65
110
|
|
|
66
111
|
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
112
|
+
Your AI (Claude Code) Teammate's AI (Cursor)
|
|
113
|
+
| |
|
|
114
|
+
| AgentMesh Cloud |
|
|
115
|
+
| +-------------------+ |
|
|
116
|
+
+-->| Shared Memory |<-----+ Read/write knowledge
|
|
117
|
+
| | (team_memories) | |
|
|
118
|
+
| +-------------------+ |
|
|
119
|
+
| | Realtime Channel | |
|
|
120
|
+
+-->| (Supabase RT) |<-----+ Instant message push
|
|
121
|
+
+-------------------+
|
|
78
122
|
```
|
|
79
|
-
## User Service API 🔒
|
|
80
|
-
Agent: alice-claude-code (Backend Developer)
|
|
81
|
-
Status: protected
|
|
82
123
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## UI Design System 📋
|
|
90
|
-
Agent: bob-cursor (Frontend Developer)
|
|
91
|
-
Status: proposal
|
|
92
|
-
|
|
93
|
-
shadcn/ui, Indigo primary, 8px radius, 4px spacing
|
|
94
|
-
```
|
|
124
|
+
- **Cloud is the source of truth** — memories and conversations persist in Supabase
|
|
125
|
+
- **Local files are just cache** — for offline fallback, automatically managed
|
|
126
|
+
- **No Git tracking needed** — `.agenthub/` is gitignored by default
|
|
127
|
+
- **No AI API calls** — AgentMesh is a protocol layer, not a model provider
|
|
95
128
|
|
|
96
129
|
### Three Levels of Knowledge
|
|
97
130
|
|
|
98
131
|
| Status | Meaning | Icon |
|
|
99
132
|
|--------|---------|------|
|
|
100
|
-
| `auto` | Routine facts (APIs, models) — recorded automatically | (none) |
|
|
101
|
-
| `proposal` | Important decision, needs team
|
|
102
|
-
| `protected` | Team consensus — cannot be overridden | 🔒 |
|
|
133
|
+
| `auto` | Routine facts (APIs, models, gotchas) — recorded automatically | (none) |
|
|
134
|
+
| `proposal` | Important decision, needs team discussion | 📋 |
|
|
135
|
+
| `protected` | Team consensus — locked, cannot be overridden | 🔒 |
|
|
103
136
|
|
|
104
|
-
###
|
|
105
|
-
|
|
106
|
-
When your AI needs to discuss something with the team:
|
|
137
|
+
### Desktop Notifications
|
|
107
138
|
|
|
108
|
-
|
|
109
|
-
# You start the conversation space
|
|
110
|
-
npx agentmesh-ai serve
|
|
111
|
-
|
|
112
|
-
# It outputs a command — send it to your teammates
|
|
113
|
-
# Teammates run it to join:
|
|
114
|
-
npx agentmesh-ai join ws://192.168.31.66:4800 --key abc123
|
|
115
|
-
```
|
|
139
|
+
When someone starts a discussion, teammates get a native desktop notification — no extra app, no extra terminal window. Just tell your AI to join.
|
|
116
140
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
The AI handles multi-round discussion automatically — you only trigger it once.
|
|
120
|
-
|
|
121
|
-
### Team Voting
|
|
122
|
-
|
|
123
|
-
For important decisions, every human must approve:
|
|
124
|
-
|
|
125
|
-
1. AI presents options via an interactive form
|
|
126
|
-
2. Each team member's AI asks their human to vote
|
|
127
|
-
3. **All approve** → decision becomes protected
|
|
128
|
-
4. **Anyone rejects** → discussion restarts with feedback
|
|
141
|
+
If you're busy, tell your AI "tell them to wait" — the other side automatically extends the timeout.
|
|
129
142
|
|
|
130
143
|
---
|
|
131
144
|
|
|
132
145
|
## Works With Everything
|
|
133
146
|
|
|
134
|
-
| Tool | Integration |
|
|
135
|
-
|
|
136
|
-
| Claude Code | MCP (native) |
|
|
137
|
-
| Cursor | MCP (native) |
|
|
138
|
-
| Windsurf | MCP (native) |
|
|
139
|
-
| GitHub Copilot | Instructions
|
|
140
|
-
| Any
|
|
141
|
-
|
|
142
|
-
AgentHub doesn't call any AI API. It's a pure protocol layer — each tool uses its own intelligence.
|
|
147
|
+
| Tool | Integration | Status |
|
|
148
|
+
|------|-------------|--------|
|
|
149
|
+
| Claude Code | MCP (native) | Full support |
|
|
150
|
+
| Cursor | MCP (native) | Full support |
|
|
151
|
+
| Windsurf | MCP (native) | Full support |
|
|
152
|
+
| GitHub Copilot | MCP / Instructions | Partial |
|
|
153
|
+
| Any MCP-compatible tool | MCP | Full support |
|
|
143
154
|
|
|
144
155
|
---
|
|
145
156
|
|
|
146
157
|
## Use Cases
|
|
147
158
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
Your AI forgets everything between sessions. With AgentHub, it reads `.agenthub/memory/` and instantly recovers context.
|
|
151
|
-
|
|
152
|
-
### Team Collaboration (Zero Communication Overhead)
|
|
153
|
-
|
|
154
|
-
Alice writes the backend. Bob clones the repo — his AI already knows every API, every data model, every convention Alice established.
|
|
155
|
-
|
|
156
|
-
### Handover (Better Than Any Document)
|
|
157
|
-
|
|
158
|
-
Alice leaves the project. Her AI's memory file contains every decision, every gotcha, every "don't change this because..." — automatically accumulated over months.
|
|
159
|
-
|
|
160
|
-
### New Project (AI-First Planning)
|
|
161
|
-
|
|
162
|
-
Three people start a new project. They open a conversation space, their AIs discuss tech stack, architecture, conventions. Conclusions become protected memories. Everyone starts coding in sync.
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
## Safety
|
|
167
|
-
|
|
168
|
-
### Secret Scanner
|
|
169
|
-
|
|
170
|
-
Before any knowledge is shared, AgentHub scans for:
|
|
171
|
-
- API keys (OpenAI, AWS, GitHub, Stripe)
|
|
172
|
-
- Passwords and tokens
|
|
173
|
-
- Private keys
|
|
174
|
-
- Database connection strings
|
|
175
|
-
- Internal URLs
|
|
159
|
+
**Solo Developer** — Your AI forgets everything between sessions. With AgentMesh, it reads shared memory and instantly recovers all context.
|
|
176
160
|
|
|
177
|
-
|
|
161
|
+
**Team Collaboration** — Alice builds the backend. Bob starts the frontend — his AI already knows every API, every model, every convention. Zero communication overhead.
|
|
178
162
|
|
|
179
|
-
|
|
163
|
+
**AI-First Planning** — Three people start a project. Their AIs discuss tech stack, architecture, conventions. Conclusions become protected memories. Everyone codes in sync.
|
|
180
164
|
|
|
181
|
-
|
|
182
|
-
- Important proposals: AI asks human first
|
|
183
|
-
- Team constraints: requires unanimous vote
|
|
165
|
+
**Handover** — Someone leaves the project. Their AI's memory contains every decision, every gotcha, every "don't touch this because..." — automatically accumulated.
|
|
184
166
|
|
|
185
167
|
---
|
|
186
168
|
|
|
@@ -188,62 +170,63 @@ High-risk content is **blocked**. Medium-risk gets a **warning**.
|
|
|
188
170
|
|
|
189
171
|
| Command | Description |
|
|
190
172
|
|---------|-------------|
|
|
191
|
-
| `npx agentmesh-ai init` |
|
|
173
|
+
| `npx agentmesh-ai init` | Initialize project, get a Team ID |
|
|
192
174
|
| `npx agentmesh-ai setup` | Auto-configure MCP for your AI tools |
|
|
193
|
-
| `npx agentmesh-ai
|
|
194
|
-
| `npx agentmesh-ai
|
|
195
|
-
| `npx agentmesh-ai status` | Show project memory status |
|
|
175
|
+
| `npx agentmesh-ai join <team-id>` | Join a team (one command does everything) |
|
|
176
|
+
| `npx agentmesh-ai status` | Show cloud connection and memory stats |
|
|
196
177
|
| `npx agentmesh-ai memory` | View/search shared memory |
|
|
197
178
|
| `npx agentmesh-ai memory -s "database"` | Search for specific info |
|
|
198
179
|
|
|
199
180
|
---
|
|
200
181
|
|
|
201
|
-
## MCP Tools (
|
|
182
|
+
## MCP Tools (used by AI automatically)
|
|
202
183
|
|
|
203
184
|
| Tool | What It Does |
|
|
204
185
|
|------|-------------|
|
|
205
|
-
| `read_memory` | Read all shared knowledge |
|
|
206
|
-
| `write_memory` | Record new knowledge |
|
|
186
|
+
| `read_memory` | Read all shared knowledge from the team |
|
|
187
|
+
| `write_memory` | Record new knowledge to cloud |
|
|
207
188
|
| `search_memory` | Search by keyword |
|
|
208
|
-
| `discuss` | Multi-round team discussion |
|
|
209
|
-
| `start_meeting` | Check attendance
|
|
210
|
-
| `
|
|
211
|
-
| `vote_on_decision` | Cast vote on pending decision |
|
|
212
|
-
| `send_message` | Send single message |
|
|
189
|
+
| `discuss` | Multi-round team discussion (up to 30 min) |
|
|
190
|
+
| `start_meeting` | Check attendance before discussion |
|
|
191
|
+
| `send_message` | Send a single message |
|
|
213
192
|
| `get_messages` | Read messages on a topic |
|
|
214
193
|
| `save_to_memory` | Save discussion conclusion |
|
|
194
|
+
| `escalate_to_human` | Team-wide vote on important decisions |
|
|
195
|
+
| `vote_on_decision` | Cast vote on pending decision |
|
|
215
196
|
| `list_conversations` | See who's online, what's being discussed |
|
|
216
197
|
| `list_pending_decisions` | See what needs voting |
|
|
217
198
|
|
|
218
199
|
---
|
|
219
200
|
|
|
220
|
-
##
|
|
201
|
+
## Safety
|
|
202
|
+
|
|
203
|
+
### Secret Scanner
|
|
221
204
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
```
|
|
205
|
+
Before any knowledge is shared, AgentMesh scans for:
|
|
206
|
+
- API keys (OpenAI, AWS, GitHub, Stripe, etc.)
|
|
207
|
+
- Passwords and tokens
|
|
208
|
+
- Private keys and certificates
|
|
209
|
+
- Database connection strings
|
|
210
|
+
|
|
211
|
+
High-risk content is **blocked**. Medium-risk gets a **warning**.
|
|
212
|
+
|
|
213
|
+
### Human-in-the-Loop
|
|
232
214
|
|
|
233
|
-
-
|
|
234
|
-
-
|
|
235
|
-
-
|
|
215
|
+
- `auto` — AI records routine knowledge without asking
|
|
216
|
+
- `proposal` — AI asks human before recording important decisions
|
|
217
|
+
- `protected` — requires unanimous team vote to establish
|
|
236
218
|
|
|
237
219
|
---
|
|
238
220
|
|
|
239
|
-
##
|
|
221
|
+
## Configuration
|
|
240
222
|
|
|
241
|
-
|
|
223
|
+
### Environment Variables
|
|
242
224
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
225
|
+
| Variable | Description |
|
|
226
|
+
|----------|-------------|
|
|
227
|
+
| `AGENTHUB_TEAM_ID` | Cloud team identifier (set automatically by setup) |
|
|
228
|
+
| `AGENTHUB_AGENT_ID` | This agent's unique ID (set automatically by setup) |
|
|
229
|
+
| `AGENTHUB_NOTIFY` | Set to `false` to disable desktop notifications |
|
|
247
230
|
|
|
248
231
|
---
|
|
249
232
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAcA,wBAAsB,WAAW,kBA0IhC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agenthub init — Initialize .agenthub/ in the current project.
|
|
3
3
|
*/
|
|
4
|
-
import { join } from 'node:path';
|
|
5
|
-
import { mkdir } from 'node:fs/promises';
|
|
4
|
+
import { join, basename } from 'node:path';
|
|
5
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
6
6
|
import { existsSync } from 'node:fs';
|
|
7
7
|
import inquirer from 'inquirer';
|
|
8
8
|
import chalk from 'chalk';
|
|
9
9
|
import { writeYaml } from '../../utils/yaml.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { generateAgentId, generateTeamId } from '../../utils/id.js';
|
|
11
|
+
import { cloudWriteMemory } from '../../cloud/supabase-client.js';
|
|
12
12
|
export async function initCommand() {
|
|
13
13
|
const cwd = process.cwd();
|
|
14
14
|
const agentHubDir = join(cwd, '.agenthub');
|
|
@@ -25,14 +25,6 @@ export async function initCommand() {
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
console.log('');
|
|
28
|
-
// Check for git
|
|
29
|
-
const hasGit = isGitRepo(cwd);
|
|
30
|
-
if (hasGit) {
|
|
31
|
-
console.log(chalk.dim(' Git repository detected ✓'));
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
console.log(chalk.dim(' No Git repo detected (memory sync requires Git)'));
|
|
35
|
-
}
|
|
36
28
|
console.log('');
|
|
37
29
|
// Ask questions
|
|
38
30
|
const answers = await inquirer.prompt([
|
|
@@ -40,7 +32,7 @@ export async function initCommand() {
|
|
|
40
32
|
type: 'input',
|
|
41
33
|
name: 'project',
|
|
42
34
|
message: 'Project name?',
|
|
43
|
-
default: getDefaultProjectName(cwd),
|
|
35
|
+
default: await getDefaultProjectName(cwd),
|
|
44
36
|
},
|
|
45
37
|
{
|
|
46
38
|
type: 'input',
|
|
@@ -76,15 +68,22 @@ export async function initCommand() {
|
|
|
76
68
|
},
|
|
77
69
|
]);
|
|
78
70
|
const agentId = generateAgentId(answers.displayName, answers.tool);
|
|
71
|
+
const teamId = generateTeamId();
|
|
79
72
|
const now = new Date().toISOString();
|
|
80
73
|
// Create directories
|
|
81
74
|
await mkdir(join(agentHubDir, 'memory'), { recursive: true });
|
|
82
75
|
await mkdir(join(agentHubDir, 'conversations'), { recursive: true });
|
|
83
|
-
// Create
|
|
76
|
+
// Create .gitignore — everything syncs via cloud, nothing needs Git
|
|
77
|
+
const gitignorePath = join(agentHubDir, '.gitignore');
|
|
78
|
+
if (!existsSync(gitignorePath)) {
|
|
79
|
+
await writeFile(gitignorePath, '# AgentMesh syncs via cloud — nothing needs Git tracking\n*\n', 'utf-8');
|
|
80
|
+
}
|
|
81
|
+
// Create hub.yaml (with cloud team_id)
|
|
84
82
|
const hub = {
|
|
85
83
|
project: answers.project,
|
|
86
84
|
created: now,
|
|
87
85
|
version: '1.0',
|
|
86
|
+
team_id: teamId,
|
|
88
87
|
agents: [{
|
|
89
88
|
id: agentId,
|
|
90
89
|
display_name: answers.displayName,
|
|
@@ -93,6 +92,19 @@ export async function initCommand() {
|
|
|
93
92
|
}],
|
|
94
93
|
};
|
|
95
94
|
await writeYaml(join(agentHubDir, 'hub.yaml'), hub);
|
|
95
|
+
// Register agent in cloud
|
|
96
|
+
let cloudOk = false;
|
|
97
|
+
try {
|
|
98
|
+
await cloudWriteMemory(teamId, agentId, answers.role, answers.tool, {
|
|
99
|
+
topic: 'Agent Registered',
|
|
100
|
+
content: `${answers.displayName} joined the team using ${answers.tool}.`,
|
|
101
|
+
tags: ['system', 'registration'],
|
|
102
|
+
});
|
|
103
|
+
cloudOk = true;
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// Cloud registration failed — will show warning below
|
|
107
|
+
}
|
|
96
108
|
// Create agent memory file (empty, ready to be written to)
|
|
97
109
|
const memoryFile = {
|
|
98
110
|
agent: agentId,
|
|
@@ -113,22 +125,29 @@ export async function initCommand() {
|
|
|
113
125
|
console.log(chalk.dim(' └── conversations/'));
|
|
114
126
|
console.log('');
|
|
115
127
|
console.log(` Your Agent ID: ${chalk.cyan(agentId)}`);
|
|
128
|
+
console.log(` Team ID: ${chalk.cyan(teamId)}`);
|
|
129
|
+
console.log('');
|
|
130
|
+
if (cloudOk) {
|
|
131
|
+
console.log(chalk.green(' ☁️ Cloud sync enabled — memories live in the cloud, no Git needed.'));
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
console.log(chalk.yellow(' ⚠️ Cloud unavailable (check network). Memories saved locally for now.'));
|
|
135
|
+
}
|
|
116
136
|
console.log('');
|
|
117
137
|
console.log(chalk.dim(' Next steps:'));
|
|
118
138
|
console.log(` 1. Run ${chalk.cyan('npx agentmesh-ai setup')} to configure your AI tool`);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
console.log(` 3. Tell your teammates: ${chalk.cyan('"clone and run npx agentmesh-ai setup"')}`);
|
|
122
|
-
}
|
|
139
|
+
console.log(` 2. Share your Team ID with teammates:`);
|
|
140
|
+
console.log(` ${chalk.cyan(`npx agentmesh-ai join ${teamId}`)}`);
|
|
123
141
|
console.log('');
|
|
124
142
|
}
|
|
125
|
-
function getDefaultProjectName(cwd) {
|
|
143
|
+
async function getDefaultProjectName(cwd) {
|
|
126
144
|
try {
|
|
127
|
-
const
|
|
128
|
-
|
|
145
|
+
const raw = await readFile(join(cwd, 'package.json'), 'utf-8');
|
|
146
|
+
const pkg = JSON.parse(raw);
|
|
147
|
+
return pkg.name || basename(cwd) || 'my-project';
|
|
129
148
|
}
|
|
130
149
|
catch {
|
|
131
|
-
return cwd
|
|
150
|
+
return basename(cwd) || 'my-project';
|
|
132
151
|
}
|
|
133
152
|
}
|
|
134
153
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,MAAM,GAAG,GAAG,OA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AC,GAAW;IAC9C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;QAC/D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,GAAG,CAAC,IAAI,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC;IACvC,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/join.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/join.ts"],"names":[],"mappings":"AAmBA,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,iBAoL/C"}
|