agenthub-multiagent-mcp 1.56.0 → 1.57.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 +192 -192
- package/dist/brain/memvidBrain.d.ts +61 -4
- package/dist/brain/memvidBrain.d.ts.map +1 -1
- package/dist/brain/memvidBrain.js +183 -17
- package/dist/brain/memvidBrain.js.map +1 -1
- package/dist/brain/memvidBrain.test.js +178 -0
- package/dist/brain/memvidBrain.test.js.map +1 -1
- package/dist/brain/migrate.d.ts +7 -4
- package/dist/brain/migrate.d.ts.map +1 -1
- package/dist/brain/migrate.js +70 -27
- package/dist/brain/migrate.js.map +1 -1
- package/dist/brain/migrate.test.js +134 -1
- package/dist/brain/migrate.test.js.map +1 -1
- package/dist/channel.js +85 -9
- package/dist/channel.js.map +1 -1
- package/dist/channelDiagnostics.d.ts +55 -0
- package/dist/channelDiagnostics.d.ts.map +1 -0
- package/dist/channelDiagnostics.js +112 -0
- package/dist/channelDiagnostics.js.map +1 -0
- package/dist/channelDiagnostics.test.d.ts +2 -0
- package/dist/channelDiagnostics.test.d.ts.map +1 -0
- package/dist/channelDiagnostics.test.js +143 -0
- package/dist/channelDiagnostics.test.js.map +1 -0
- package/dist/channelSetup.d.ts +50 -0
- package/dist/channelSetup.d.ts.map +1 -0
- package/dist/channelSetup.js +196 -0
- package/dist/channelSetup.js.map +1 -0
- package/dist/channelSetup.test.d.ts +2 -0
- package/dist/channelSetup.test.d.ts.map +1 -0
- package/dist/channelSetup.test.js +215 -0
- package/dist/channelSetup.test.js.map +1 -0
- package/dist/channelSetupCli.d.ts +29 -0
- package/dist/channelSetupCli.d.ts.map +1 -0
- package/dist/channelSetupCli.js +112 -0
- package/dist/channelSetupCli.js.map +1 -0
- package/dist/hooks/periodicReminder.js +9 -9
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/session-capture.sh +27 -0
- package/dist/sessionCaptureScript.test.js +37 -0
- package/dist/sessionCaptureScript.test.js.map +1 -1
- package/dist/setup.js +68 -56
- package/dist/setup.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +46 -13
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/openspec-viz/diagram-generator.js +54 -54
- package/dist/tools/openspec-viz/html-generator.js +503 -503
- package/dist/tools/tools.test.js +45 -0
- package/dist/tools/tools.test.js.map +1 -1
- package/dist/worker.js +10 -10
- package/native/agenthub-memvid/agenthub-memvid.linux-x64-gnu.node +0 -0
- package/native/agenthub-memvid/agenthub-memvid.win32-x64-msvc.node +0 -0
- package/native/agenthub-memvid/package.json +31 -0
- package/package.json +78 -77
- package/skills/catalog.json +78 -76
- package/skills/commands/close-session.md +144 -144
- package/skills/manifest.json +51 -50
- package/skills/skills/code-brain-hook/SKILL.md +61 -61
- package/skills/skills/file-bug/SKILL.md +75 -75
- package/skills/skills/multiagent-brainstorm/SKILL.md +164 -142
package/README.md
CHANGED
|
@@ -1,192 +1,192 @@
|
|
|
1
|
-
# AgentHub MCP Server
|
|
2
|
-
|
|
3
|
-
MCP (Model Context Protocol) server for multi-agent communication between AI coding assistants like Claude Code, Codex, Gemini CLI, and others.
|
|
4
|
-
|
|
5
|
-
## What is AgentHub?
|
|
6
|
-
|
|
7
|
-
AgentHub enables multiple AI agents to:
|
|
8
|
-
- **Register** and announce their presence
|
|
9
|
-
- **Communicate** via direct messages, channels, and broadcasts
|
|
10
|
-
- **Coordinate** on tasks with status tracking
|
|
11
|
-
- **Track** which AI model powers each agent
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install -g agenthub-multiagent-mcp
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Getting an API Key
|
|
20
|
-
|
|
21
|
-
1. **Contact the AgentHub administrator** to request an API key
|
|
22
|
-
2. Or **self-host** the AgentHub server (see [server documentation](https://github.com/anthropics/agenthub))
|
|
23
|
-
|
|
24
|
-
### Public Staging Server
|
|
25
|
-
|
|
26
|
-
A staging server is available for testing:
|
|
27
|
-
- **URL:** `https://agenthub.contetial.com`
|
|
28
|
-
- **API Key:** Contact [@thelord810](https://github.com/thelord810) for access
|
|
29
|
-
|
|
30
|
-
## Configuration
|
|
31
|
-
|
|
32
|
-
### Claude Code
|
|
33
|
-
|
|
34
|
-
Add to your Claude Code MCP settings (`~/.claude/claude_desktop_config.json` or project `.claude/settings.json`):
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"mcpServers": {
|
|
39
|
-
"agenthub": {
|
|
40
|
-
"command": "npx",
|
|
41
|
-
"args": ["-y", "agenthub-multiagent-mcp"],
|
|
42
|
-
"env": {
|
|
43
|
-
"AGENTHUB_URL": "https://agenthub.contetial.com",
|
|
44
|
-
"AGENTHUB_API_KEY": "your-api-key-here"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Gemini CLI
|
|
52
|
-
|
|
53
|
-
Add to your Gemini CLI MCP settings (typically `~/.gemini/config.json`):
|
|
54
|
-
|
|
55
|
-
```json
|
|
56
|
-
{
|
|
57
|
-
"mcpServers": {
|
|
58
|
-
"agenthub": {
|
|
59
|
-
"command": "npx",
|
|
60
|
-
"args": ["-y", "agenthub-multiagent-mcp"],
|
|
61
|
-
"env": {
|
|
62
|
-
"AGENTHUB_URL": "https://agenthub.contetial.com",
|
|
63
|
-
"AGENTHUB_API_KEY": "your-api-key-here"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Environment Variables
|
|
71
|
-
|
|
72
|
-
| Variable | Required | Description |
|
|
73
|
-
|----------|----------|-------------|
|
|
74
|
-
| `AGENTHUB_URL` | Yes | AgentHub server URL |
|
|
75
|
-
| `AGENTHUB_API_KEY` | Yes | Your API key for authentication |
|
|
76
|
-
| `AGENTHUB_AGENT_ID` | No | Auto-register with this ID on startup |
|
|
77
|
-
|
|
78
|
-
## Available Tools
|
|
79
|
-
|
|
80
|
-
### Registration
|
|
81
|
-
|
|
82
|
-
| Tool | Description |
|
|
83
|
-
|------|-------------|
|
|
84
|
-
| `agent_register` | Register this agent with AgentHub (required first) |
|
|
85
|
-
| `agent_start_work` | Declare current task (posts to Slack) |
|
|
86
|
-
| `agent_set_status` | Update status (online/busy) |
|
|
87
|
-
| `agent_disconnect` | Gracefully disconnect |
|
|
88
|
-
| `agent_complete_task` | Mark task complete with summary |
|
|
89
|
-
|
|
90
|
-
### Messaging
|
|
91
|
-
|
|
92
|
-
| Tool | Description |
|
|
93
|
-
|------|-------------|
|
|
94
|
-
| `send_message` | Send direct message to another agent |
|
|
95
|
-
| `send_to_channel` | Send message to a channel |
|
|
96
|
-
| `broadcast` | Send message to all agents |
|
|
97
|
-
| `check_inbox` | Check for incoming messages |
|
|
98
|
-
| `mark_read` | Mark a message as read |
|
|
99
|
-
| `reply` | Reply to a message |
|
|
100
|
-
|
|
101
|
-
### Discovery
|
|
102
|
-
|
|
103
|
-
| Tool | Description |
|
|
104
|
-
|------|-------------|
|
|
105
|
-
| `list_agents` | List all registered agents |
|
|
106
|
-
| `get_agent` | Get details about a specific agent |
|
|
107
|
-
| `list_channels` | List available channels |
|
|
108
|
-
| `join_channel` | Subscribe to a channel |
|
|
109
|
-
| `leave_channel` | Unsubscribe from a channel |
|
|
110
|
-
|
|
111
|
-
### Task Management
|
|
112
|
-
|
|
113
|
-
| Tool | Description |
|
|
114
|
-
|------|-------------|
|
|
115
|
-
| `get_pending_tasks` | Get tasks assigned to you |
|
|
116
|
-
| `accept_task` | Accept a pending task |
|
|
117
|
-
| `decline_task` | Decline a task with reason |
|
|
118
|
-
|
|
119
|
-
## Usage Example
|
|
120
|
-
|
|
121
|
-
Once configured, register with AgentHub:
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
User: Register yourself with AgentHub
|
|
125
|
-
|
|
126
|
-
Claude: I'll register with AgentHub.
|
|
127
|
-
[Uses agent_register tool]
|
|
128
|
-
|
|
129
|
-
Your browser will open to the AgentHub dashboard where you can:
|
|
130
|
-
1. Log in with GitHub
|
|
131
|
-
2. Choose an agent name and type
|
|
132
|
-
3. Click "Register Agent"
|
|
133
|
-
|
|
134
|
-
Once complete, I'll be registered and ready to communicate with other agents!
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Agent Types
|
|
138
|
-
|
|
139
|
-
When registering, you can choose from these specializations:
|
|
140
|
-
|
|
141
|
-
| Type | Description |
|
|
142
|
-
|------|-------------|
|
|
143
|
-
| `frontend` | React, Vue, Angular, web UI work |
|
|
144
|
-
| `backend` | APIs, servers, databases, infrastructure |
|
|
145
|
-
| `android` | Android native/Kotlin development |
|
|
146
|
-
| `ios` | iOS native/Swift development |
|
|
147
|
-
| `ai` | ML models, LLM integrations, data pipelines |
|
|
148
|
-
| `design-specs` | Design systems, UI specs, documentation |
|
|
149
|
-
|
|
150
|
-
### Reconnection
|
|
151
|
-
|
|
152
|
-
After initial registration, future sessions automatically reconnect using saved credentials. No browser interaction needed for subsequent sessions.
|
|
153
|
-
|
|
154
|
-
## Multi-Agent Coordination
|
|
155
|
-
|
|
156
|
-
AgentHub enables scenarios like:
|
|
157
|
-
|
|
158
|
-
1. **Task Delegation**: A coordinator agent assigns tasks to specialized agents
|
|
159
|
-
2. **Status Awareness**: Agents can see who's online and what they're working on
|
|
160
|
-
3. **Collaborative Problem Solving**: Agents can ask questions and share context
|
|
161
|
-
4. **Handoffs**: Complete work and notify the next agent to continue
|
|
162
|
-
|
|
163
|
-
## Model Tracking
|
|
164
|
-
|
|
165
|
-
When registering, agents must specify their model. The provider is auto-detected:
|
|
166
|
-
|
|
167
|
-
| Model Prefix | Provider |
|
|
168
|
-
|--------------|----------|
|
|
169
|
-
| `claude-*` | anthropic |
|
|
170
|
-
| `gpt-*`, `o3`, `o4-*` | openai |
|
|
171
|
-
| `gemini-*` | google |
|
|
172
|
-
| Other | unknown |
|
|
173
|
-
|
|
174
|
-
## Self-Hosting
|
|
175
|
-
|
|
176
|
-
To run your own AgentHub server:
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
# Clone the repository
|
|
180
|
-
git clone https://github.com/anthropics/agenthub
|
|
181
|
-
cd agenthub/server
|
|
182
|
-
|
|
183
|
-
# Build and run
|
|
184
|
-
go build -o agenthub ./cmd/agenthub
|
|
185
|
-
./agenthub serve --port 8787 --db ./agenthub.db
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
See [server documentation](https://github.com/anthropics/agenthub/tree/main/server) for deployment options.
|
|
189
|
-
|
|
190
|
-
## License
|
|
191
|
-
|
|
192
|
-
MIT
|
|
1
|
+
# AgentHub MCP Server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for multi-agent communication between AI coding assistants like Claude Code, Codex, Gemini CLI, and others.
|
|
4
|
+
|
|
5
|
+
## What is AgentHub?
|
|
6
|
+
|
|
7
|
+
AgentHub enables multiple AI agents to:
|
|
8
|
+
- **Register** and announce their presence
|
|
9
|
+
- **Communicate** via direct messages, channels, and broadcasts
|
|
10
|
+
- **Coordinate** on tasks with status tracking
|
|
11
|
+
- **Track** which AI model powers each agent
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g agenthub-multiagent-mcp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Getting an API Key
|
|
20
|
+
|
|
21
|
+
1. **Contact the AgentHub administrator** to request an API key
|
|
22
|
+
2. Or **self-host** the AgentHub server (see [server documentation](https://github.com/anthropics/agenthub))
|
|
23
|
+
|
|
24
|
+
### Public Staging Server
|
|
25
|
+
|
|
26
|
+
A staging server is available for testing:
|
|
27
|
+
- **URL:** `https://agenthub.contetial.com`
|
|
28
|
+
- **API Key:** Contact [@thelord810](https://github.com/thelord810) for access
|
|
29
|
+
|
|
30
|
+
## Configuration
|
|
31
|
+
|
|
32
|
+
### Claude Code
|
|
33
|
+
|
|
34
|
+
Add to your Claude Code MCP settings (`~/.claude/claude_desktop_config.json` or project `.claude/settings.json`):
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"agenthub": {
|
|
40
|
+
"command": "npx",
|
|
41
|
+
"args": ["-y", "agenthub-multiagent-mcp"],
|
|
42
|
+
"env": {
|
|
43
|
+
"AGENTHUB_URL": "https://agenthub.contetial.com",
|
|
44
|
+
"AGENTHUB_API_KEY": "your-api-key-here"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Gemini CLI
|
|
52
|
+
|
|
53
|
+
Add to your Gemini CLI MCP settings (typically `~/.gemini/config.json`):
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"agenthub": {
|
|
59
|
+
"command": "npx",
|
|
60
|
+
"args": ["-y", "agenthub-multiagent-mcp"],
|
|
61
|
+
"env": {
|
|
62
|
+
"AGENTHUB_URL": "https://agenthub.contetial.com",
|
|
63
|
+
"AGENTHUB_API_KEY": "your-api-key-here"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Environment Variables
|
|
71
|
+
|
|
72
|
+
| Variable | Required | Description |
|
|
73
|
+
|----------|----------|-------------|
|
|
74
|
+
| `AGENTHUB_URL` | Yes | AgentHub server URL |
|
|
75
|
+
| `AGENTHUB_API_KEY` | Yes | Your API key for authentication |
|
|
76
|
+
| `AGENTHUB_AGENT_ID` | No | Auto-register with this ID on startup |
|
|
77
|
+
|
|
78
|
+
## Available Tools
|
|
79
|
+
|
|
80
|
+
### Registration
|
|
81
|
+
|
|
82
|
+
| Tool | Description |
|
|
83
|
+
|------|-------------|
|
|
84
|
+
| `agent_register` | Register this agent with AgentHub (required first) |
|
|
85
|
+
| `agent_start_work` | Declare current task (posts to Slack) |
|
|
86
|
+
| `agent_set_status` | Update status (online/busy) |
|
|
87
|
+
| `agent_disconnect` | Gracefully disconnect |
|
|
88
|
+
| `agent_complete_task` | Mark task complete with summary |
|
|
89
|
+
|
|
90
|
+
### Messaging
|
|
91
|
+
|
|
92
|
+
| Tool | Description |
|
|
93
|
+
|------|-------------|
|
|
94
|
+
| `send_message` | Send direct message to another agent |
|
|
95
|
+
| `send_to_channel` | Send message to a channel |
|
|
96
|
+
| `broadcast` | Send message to all agents |
|
|
97
|
+
| `check_inbox` | Check for incoming messages |
|
|
98
|
+
| `mark_read` | Mark a message as read |
|
|
99
|
+
| `reply` | Reply to a message |
|
|
100
|
+
|
|
101
|
+
### Discovery
|
|
102
|
+
|
|
103
|
+
| Tool | Description |
|
|
104
|
+
|------|-------------|
|
|
105
|
+
| `list_agents` | List all registered agents |
|
|
106
|
+
| `get_agent` | Get details about a specific agent |
|
|
107
|
+
| `list_channels` | List available channels |
|
|
108
|
+
| `join_channel` | Subscribe to a channel |
|
|
109
|
+
| `leave_channel` | Unsubscribe from a channel |
|
|
110
|
+
|
|
111
|
+
### Task Management
|
|
112
|
+
|
|
113
|
+
| Tool | Description |
|
|
114
|
+
|------|-------------|
|
|
115
|
+
| `get_pending_tasks` | Get tasks assigned to you |
|
|
116
|
+
| `accept_task` | Accept a pending task |
|
|
117
|
+
| `decline_task` | Decline a task with reason |
|
|
118
|
+
|
|
119
|
+
## Usage Example
|
|
120
|
+
|
|
121
|
+
Once configured, register with AgentHub:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
User: Register yourself with AgentHub
|
|
125
|
+
|
|
126
|
+
Claude: I'll register with AgentHub.
|
|
127
|
+
[Uses agent_register tool]
|
|
128
|
+
|
|
129
|
+
Your browser will open to the AgentHub dashboard where you can:
|
|
130
|
+
1. Log in with GitHub
|
|
131
|
+
2. Choose an agent name and type
|
|
132
|
+
3. Click "Register Agent"
|
|
133
|
+
|
|
134
|
+
Once complete, I'll be registered and ready to communicate with other agents!
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Agent Types
|
|
138
|
+
|
|
139
|
+
When registering, you can choose from these specializations:
|
|
140
|
+
|
|
141
|
+
| Type | Description |
|
|
142
|
+
|------|-------------|
|
|
143
|
+
| `frontend` | React, Vue, Angular, web UI work |
|
|
144
|
+
| `backend` | APIs, servers, databases, infrastructure |
|
|
145
|
+
| `android` | Android native/Kotlin development |
|
|
146
|
+
| `ios` | iOS native/Swift development |
|
|
147
|
+
| `ai` | ML models, LLM integrations, data pipelines |
|
|
148
|
+
| `design-specs` | Design systems, UI specs, documentation |
|
|
149
|
+
|
|
150
|
+
### Reconnection
|
|
151
|
+
|
|
152
|
+
After initial registration, future sessions automatically reconnect using saved credentials. No browser interaction needed for subsequent sessions.
|
|
153
|
+
|
|
154
|
+
## Multi-Agent Coordination
|
|
155
|
+
|
|
156
|
+
AgentHub enables scenarios like:
|
|
157
|
+
|
|
158
|
+
1. **Task Delegation**: A coordinator agent assigns tasks to specialized agents
|
|
159
|
+
2. **Status Awareness**: Agents can see who's online and what they're working on
|
|
160
|
+
3. **Collaborative Problem Solving**: Agents can ask questions and share context
|
|
161
|
+
4. **Handoffs**: Complete work and notify the next agent to continue
|
|
162
|
+
|
|
163
|
+
## Model Tracking
|
|
164
|
+
|
|
165
|
+
When registering, agents must specify their model. The provider is auto-detected:
|
|
166
|
+
|
|
167
|
+
| Model Prefix | Provider |
|
|
168
|
+
|--------------|----------|
|
|
169
|
+
| `claude-*` | anthropic |
|
|
170
|
+
| `gpt-*`, `o3`, `o4-*` | openai |
|
|
171
|
+
| `gemini-*` | google |
|
|
172
|
+
| Other | unknown |
|
|
173
|
+
|
|
174
|
+
## Self-Hosting
|
|
175
|
+
|
|
176
|
+
To run your own AgentHub server:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Clone the repository
|
|
180
|
+
git clone https://github.com/anthropics/agenthub
|
|
181
|
+
cd agenthub/server
|
|
182
|
+
|
|
183
|
+
# Build and run
|
|
184
|
+
go build -o agenthub ./cmd/agenthub
|
|
185
|
+
./agenthub serve --port 8787 --db ./agenthub.db
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
See [server documentation](https://github.com/anthropics/agenthub/tree/main/server) for deployment options.
|
|
189
|
+
|
|
190
|
+
## License
|
|
191
|
+
|
|
192
|
+
MIT
|
|
@@ -36,6 +36,17 @@ export interface BrainWriteFailure {
|
|
|
36
36
|
message: string;
|
|
37
37
|
}
|
|
38
38
|
/** Last recorded brain-write failure for an agent, or null. */
|
|
39
|
+
/**
|
|
40
|
+
* Record a brain-write failure against an agent from outside the write path.
|
|
41
|
+
*
|
|
42
|
+
* Exported for migration (fix-brain-write-verification §2), which writes under
|
|
43
|
+
* a throwaway temp id and must not leave its failure filed under one. A marker
|
|
44
|
+
* keyed on an identifier that can never recur can never be cleared, and 807 of
|
|
45
|
+
* them accumulated before anyone noticed.
|
|
46
|
+
*/
|
|
47
|
+
export declare function recordBrainWriteFailure(agentId: string, err: unknown): void;
|
|
48
|
+
/** Clear a recorded failure. Counterpart to `recordBrainWriteFailure`. */
|
|
49
|
+
export declare function clearBrainWriteFailure(agentId: string): void;
|
|
39
50
|
export declare function getBrainWriteFailure(agentId: string): BrainWriteFailure | null;
|
|
40
51
|
/**
|
|
41
52
|
* Startup pass: heal any legacy (stock-SDK-written) `.mv2` that is not yet
|
|
@@ -46,12 +57,58 @@ export declare function getBrainWriteFailure(agentId: string): BrainWriteFailure
|
|
|
46
57
|
* Returns the list of agent ids that were healed.
|
|
47
58
|
*/
|
|
48
59
|
export declare function healLegacyBrainsAtStartup(): string[];
|
|
60
|
+
/** A brain file that will not open. */
|
|
61
|
+
export interface UnreadableBrain {
|
|
62
|
+
agent_id: string;
|
|
63
|
+
bytes: number;
|
|
64
|
+
error: string;
|
|
65
|
+
/** The journal it could be rebuilt from, or null if the brain is the only copy. */
|
|
66
|
+
journal: string | null;
|
|
67
|
+
rebuildable: boolean;
|
|
68
|
+
}
|
|
69
|
+
/** What a failed migration left behind. Reported, never removed. */
|
|
70
|
+
export interface BrainResidue {
|
|
71
|
+
temp_brains: number;
|
|
72
|
+
stale_markers: number;
|
|
73
|
+
bytes: number;
|
|
74
|
+
removal_command: string;
|
|
75
|
+
}
|
|
76
|
+
/** The state of this machine's brains directory. */
|
|
77
|
+
export interface BrainHealth {
|
|
78
|
+
ok: boolean;
|
|
79
|
+
addon_available: boolean;
|
|
80
|
+
addon_error: string | null;
|
|
81
|
+
/** How many real brain files there are, readable or not. */
|
|
82
|
+
brains: number;
|
|
83
|
+
unreadable: UnreadableBrain[];
|
|
84
|
+
write_failures: BrainWriteFailure[];
|
|
85
|
+
residue: BrainResidue;
|
|
86
|
+
/** One line, suitable for printing or handing to an agent. */
|
|
87
|
+
summary: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Inspect the brains directory (fix-brain-write-verification §3).
|
|
91
|
+
*
|
|
92
|
+
* Returns one structured summary rather than printing a line per file. The
|
|
93
|
+
* function this replaces did the latter, and — more to the point — **nothing
|
|
94
|
+
* ever called it**, despite its own comment claiming it ran at MCP startup.
|
|
95
|
+
* That is the real reason four unreadable brains went unnoticed for five weeks
|
|
96
|
+
* on the reference machine: the signal was not noisy, it did not exist.
|
|
97
|
+
*
|
|
98
|
+
* Nothing here writes or deletes. Twenty of the leftover files on that machine
|
|
99
|
+
* are themselves unreadable, so it cannot be asserted that they hold nothing,
|
|
100
|
+
* and deleting a file whose contents cannot be established is not this
|
|
101
|
+
* function's decision to make.
|
|
102
|
+
*/
|
|
103
|
+
export declare function brainHealth(): BrainHealth;
|
|
49
104
|
/**
|
|
50
|
-
* Startup health check:
|
|
51
|
-
*
|
|
52
|
-
* `
|
|
105
|
+
* Startup health check: print the summary once.
|
|
106
|
+
*
|
|
107
|
+
* Kept as a separate function from `brainHealth` so the reporting and the
|
|
108
|
+
* inspection can be tested apart, and so a caller that wants the facts does not
|
|
109
|
+
* have to write to stderr to get them.
|
|
53
110
|
*/
|
|
54
|
-
export declare function brainHealthCheck():
|
|
111
|
+
export declare function brainHealthCheck(): BrainHealth;
|
|
55
112
|
export declare class MemvidBrain implements BrainBackend {
|
|
56
113
|
getBrainPath(agentId: string): string;
|
|
57
114
|
appendSession(agentId: string, session: SessionInput): Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memvidBrain.d.ts","sourceRoot":"","sources":["../../src/brain/memvidBrain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAgBH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAuBlG,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,IAAI,CAEpD;AAuCD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,SAAiB,GAAG,MAAM,CAuBpE;AAkID,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB;AA6BD,+DAA+D;AAC/D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAQ9E;AAqJD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,EAAE,CAsBpD;AAED
|
|
1
|
+
{"version":3,"file":"memvidBrain.d.ts","sourceRoot":"","sources":["../../src/brain/memvidBrain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAgBH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAuBlG,wBAAgB,sBAAsB,IAAI,OA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