yams-blackboard 1.1.1 → 1.2.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 +62 -134
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
# YAMS Blackboard Plugin for OpenCode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared blackboard for multi-agent coordination. Agents post findings, claim tasks, and discover each other's work through [YAMS](https://github.com/trvon/yams).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> [!WARNING]
|
|
6
|
+
> **Experimental Software**
|
|
7
|
+
>
|
|
8
|
+
> Under active development. APIs may change without notice. Requires YAMS v0.8.1+.
|
|
6
9
|
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
## Features
|
|
11
|
+
- [Blackboard pattern](https://en.wikipedia.org/wiki/Blackboard_system) for agent-to-agent communication via shared memory
|
|
12
|
+
- Findings with severity, confidence, topics, and lifecycle states (draft/published/acknowledged/resolved)
|
|
13
|
+
- Task coordination with claim-based assignment, dependencies, and priority
|
|
14
|
+
- Context grouping for related findings and tasks
|
|
15
|
+
- Automatic compaction hooks — blackboard state survives session compression
|
|
16
|
+
- All writes tagged `owner=opencode` for cross-agent discovery
|
|
10
17
|
|
|
11
18
|
```
|
|
12
19
|
┌─────────────────────────────────────────────────────┐
|
|
@@ -24,29 +31,17 @@ This plugin implements the classic [blackboard pattern](https://en.wikipedia.org
|
|
|
24
31
|
└─────────┘ └─────────┘ └────────────┘
|
|
25
32
|
```
|
|
26
33
|
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
### 1. Install YAMS
|
|
34
|
+
## Install
|
|
30
35
|
|
|
31
|
-
|
|
36
|
+
### 1. YAMS daemon
|
|
32
37
|
|
|
33
38
|
```bash
|
|
34
|
-
# macOS
|
|
35
39
|
brew install trvon/tap/yams
|
|
36
|
-
|
|
37
|
-
# Or build from source (see YAMS repo for instructions)
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Start the daemon:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
40
|
yams daemon start
|
|
44
41
|
yams status # Should show "running"
|
|
45
42
|
```
|
|
46
43
|
|
|
47
|
-
### 2.
|
|
48
|
-
|
|
49
|
-
Add to your `opencode.json`:
|
|
44
|
+
### 2. OpenCode config
|
|
50
45
|
|
|
51
46
|
```json
|
|
52
47
|
{
|
|
@@ -55,91 +50,66 @@ Add to your `opencode.json`:
|
|
|
55
50
|
}
|
|
56
51
|
```
|
|
57
52
|
|
|
58
|
-
OpenCode
|
|
53
|
+
OpenCode installs npm plugins automatically at startup.
|
|
59
54
|
|
|
60
55
|
## Tools
|
|
61
56
|
|
|
62
|
-
###
|
|
63
|
-
|
|
57
|
+
### Agents
|
|
64
58
|
| Tool | Description |
|
|
65
59
|
|------|-------------|
|
|
66
|
-
| `bb_register_agent` | Register
|
|
67
|
-
| `bb_list_agents` | List
|
|
60
|
+
| `bb_register_agent` | Register identity and capabilities |
|
|
61
|
+
| `bb_list_agents` | List registered agents |
|
|
68
62
|
|
|
69
63
|
### Findings
|
|
70
|
-
|
|
71
64
|
| Tool | Description |
|
|
72
65
|
|------|-------------|
|
|
73
|
-
| `bb_post_finding` | Post
|
|
74
|
-
| `bb_query_findings` | Query
|
|
66
|
+
| `bb_post_finding` | Post finding to blackboard |
|
|
67
|
+
| `bb_query_findings` | Query by topic, agent, severity, context |
|
|
75
68
|
| `bb_search_findings` | Semantic search across findings |
|
|
76
|
-
| `bb_get_finding` | Get full details
|
|
77
|
-
| `bb_acknowledge_finding` | Mark
|
|
78
|
-
| `bb_resolve_finding` | Mark
|
|
69
|
+
| `bb_get_finding` | Get full finding details |
|
|
70
|
+
| `bb_acknowledge_finding` | Mark as acknowledged |
|
|
71
|
+
| `bb_resolve_finding` | Mark as resolved with explanation |
|
|
79
72
|
|
|
80
73
|
### Tasks
|
|
81
|
-
|
|
82
74
|
| Tool | Description |
|
|
83
75
|
|------|-------------|
|
|
84
|
-
| `bb_create_task` | Create
|
|
85
|
-
| `bb_get_ready_tasks` | Get tasks
|
|
76
|
+
| `bb_create_task` | Create task for agents to claim |
|
|
77
|
+
| `bb_get_ready_tasks` | Get pending tasks with met dependencies |
|
|
86
78
|
| `bb_claim_task` | Claim a pending task |
|
|
87
79
|
| `bb_update_task` | Update task status |
|
|
88
|
-
| `bb_complete_task` | Mark
|
|
89
|
-
| `bb_fail_task` | Mark
|
|
90
|
-
| `bb_query_tasks` | Query
|
|
80
|
+
| `bb_complete_task` | Mark completed with findings/artifacts |
|
|
81
|
+
| `bb_fail_task` | Mark failed with error |
|
|
82
|
+
| `bb_query_tasks` | Query by type, status, assignee |
|
|
91
83
|
|
|
92
84
|
### Context & Utility
|
|
93
|
-
|
|
94
85
|
| Tool | Description |
|
|
95
86
|
|------|-------------|
|
|
96
|
-
| `bb_create_context` |
|
|
97
|
-
| `bb_get_context_summary` |
|
|
87
|
+
| `bb_create_context` | Group related findings/tasks |
|
|
88
|
+
| `bb_get_context_summary` | Summary of context state |
|
|
98
89
|
| `bb_set_context` | Set current working context |
|
|
99
|
-
| `bb_recent_activity` |
|
|
100
|
-
| `bb_stats` |
|
|
90
|
+
| `bb_recent_activity` | Recent findings and task updates |
|
|
91
|
+
| `bb_stats` | Blackboard statistics |
|
|
101
92
|
| `bb_connections` | Explore graph connections |
|
|
102
93
|
|
|
103
|
-
##
|
|
94
|
+
## Quick Start
|
|
104
95
|
|
|
105
96
|
```typescript
|
|
106
|
-
//
|
|
107
|
-
bb_register_agent({
|
|
108
|
-
id: "scanner",
|
|
109
|
-
name: "Security Scanner",
|
|
110
|
-
capabilities: ["security", "code-review"]
|
|
111
|
-
})
|
|
97
|
+
// Scanner registers and posts finding
|
|
98
|
+
bb_register_agent({ id: "scanner", name: "Scanner", capabilities: ["security"] })
|
|
112
99
|
|
|
113
100
|
bb_post_finding({
|
|
114
|
-
agent_id: "scanner",
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
severity: "high",
|
|
118
|
-
confidence: 0.92,
|
|
119
|
-
content: "Found unsanitized user input passed directly to SQL query...",
|
|
101
|
+
agent_id: "scanner", topic: "security",
|
|
102
|
+
title: "SQL Injection in auth.ts:42", severity: "high", confidence: 0.92,
|
|
103
|
+
content: "Unsanitized user input in SQL query...",
|
|
120
104
|
references: [{ type: "file", target: "src/auth.ts", line_start: 42 }]
|
|
121
105
|
})
|
|
122
106
|
|
|
123
|
-
//
|
|
107
|
+
// Fixer discovers, claims task, resolves
|
|
124
108
|
bb_search_findings({ query: "SQL injection" })
|
|
125
|
-
|
|
126
|
-
// Coordinator creates a task
|
|
127
|
-
bb_create_task({
|
|
128
|
-
title: "Fix SQL injection vulnerability",
|
|
129
|
-
type: "fix",
|
|
130
|
-
created_by: "coordinator",
|
|
131
|
-
priority: 1
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
// Fixer claims and works
|
|
135
109
|
bb_claim_task({ task_id: "t-xxx", agent_id: "fixer" })
|
|
136
|
-
bb_update_task({ task_id: "t-xxx", status: "working" })
|
|
137
|
-
|
|
138
|
-
// Fixer completes and resolves
|
|
139
110
|
bb_complete_task({ task_id: "t-xxx", findings: ["f-fix-001"] })
|
|
140
111
|
bb_resolve_finding({
|
|
141
|
-
finding_id: "f-original",
|
|
142
|
-
agent_id: "fixer",
|
|
112
|
+
finding_id: "f-original", agent_id: "fixer",
|
|
143
113
|
resolution: "Parameterized queries added in PR #123"
|
|
144
114
|
})
|
|
145
115
|
```
|
|
@@ -147,25 +117,23 @@ bb_resolve_finding({
|
|
|
147
117
|
## Schemas
|
|
148
118
|
|
|
149
119
|
### Finding
|
|
150
|
-
|
|
151
120
|
```typescript
|
|
152
121
|
interface Finding {
|
|
153
122
|
id: string
|
|
154
123
|
agent_id: string
|
|
155
|
-
topic: "security" | "performance" | "bug" | "architecture" |
|
|
124
|
+
topic: "security" | "performance" | "bug" | "architecture" | "refactor" | "test" | "doc" | "dependency" | "accessibility" | "other"
|
|
156
125
|
title: string
|
|
157
|
-
content: string
|
|
158
|
-
confidence: number // 0.0
|
|
126
|
+
content: string // markdown
|
|
127
|
+
confidence: number // 0.0–1.0
|
|
159
128
|
severity?: "info" | "low" | "medium" | "high" | "critical"
|
|
160
129
|
status: "draft" | "published" | "acknowledged" | "resolved" | "rejected"
|
|
161
|
-
scope: "session" | "persistent"
|
|
130
|
+
scope: "session" | "persistent"
|
|
162
131
|
context_id?: string
|
|
163
132
|
references?: Reference[]
|
|
164
133
|
}
|
|
165
134
|
```
|
|
166
135
|
|
|
167
136
|
### Task
|
|
168
|
-
|
|
169
137
|
```typescript
|
|
170
138
|
interface Task {
|
|
171
139
|
id: string
|
|
@@ -176,7 +144,6 @@ interface Task {
|
|
|
176
144
|
created_by: string
|
|
177
145
|
assigned_to?: string
|
|
178
146
|
depends_on?: string[]
|
|
179
|
-
findings?: string[]
|
|
180
147
|
}
|
|
181
148
|
```
|
|
182
149
|
|
|
@@ -184,86 +151,47 @@ See [DESIGN.md](./DESIGN.md) for complete schema documentation.
|
|
|
184
151
|
|
|
185
152
|
## Lifecycle Hooks
|
|
186
153
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
- **`session.created`**: Starts a YAMS session for the conversation
|
|
191
|
-
- **`session.compacted`**: Injects blackboard summary into compaction context
|
|
154
|
+
- `session.created` — starts a YAMS session for the conversation
|
|
155
|
+
- `experimental.session.compacting` — injects blackboard summary before compaction prompt
|
|
156
|
+
- `session.compacted` — injects blackboard summary into compaction context
|
|
192
157
|
|
|
193
|
-
## Compaction
|
|
158
|
+
## Compaction
|
|
194
159
|
|
|
195
|
-
|
|
196
|
-
- To pull recent YAMS memory after compaction, use `yams list` filters (the old `yams hook` command was removed): `yams list --owner opencode --since 24h --limit 20 --format markdown` with optional `--pbi`, `--task`, `--phase`, `--metadata key=value` (repeatable), and `--match-any-metadata`.
|
|
197
|
-
|
|
198
|
-
Example:
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
yams list --owner opencode --since 24h --limit 20 --format markdown --metadata phase=checkpoint
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### Owner / multi-agent convention
|
|
205
|
-
|
|
206
|
-
- When registering agents or posting findings/tasks with this plugin, set `owner=opencode` so multiple agents share the same YAMS ownership namespace. The plugin writes with `--metadata owner=opencode` by default. Use `yams list --owner opencode ...` to retrieve shared context.
|
|
207
|
-
- Recommended coordinator agent for shared runs:
|
|
160
|
+
Blackboard state is automatically pushed into `output.context` during compaction. To manually retrieve shared context:
|
|
208
161
|
|
|
209
162
|
```bash
|
|
210
|
-
|
|
163
|
+
yams list --owner opencode --since 24h --limit 20 --format json --match-all-tags
|
|
211
164
|
```
|
|
212
165
|
|
|
213
166
|
## Persistence
|
|
214
167
|
|
|
215
|
-
|
|
168
|
+
Findings are persistent by default (survive across sessions). Use `scope: "session"` for temporary data:
|
|
216
169
|
|
|
217
170
|
```typescript
|
|
218
|
-
bb_post_finding({
|
|
219
|
-
// ...
|
|
220
|
-
scope: "session",
|
|
221
|
-
ttl: 3600 // Optional: auto-delete after 1 hour
|
|
222
|
-
})
|
|
171
|
+
bb_post_finding({ ..., scope: "session", ttl: 3600 })
|
|
223
172
|
```
|
|
224
173
|
|
|
225
|
-
##
|
|
226
|
-
|
|
227
|
-
Based on research into multi-agent communication patterns:
|
|
228
|
-
|
|
229
|
-
- **Blackboard Pattern**: Shared memory over direct messaging for loose coupling
|
|
230
|
-
- **A2A Protocol Concepts**: Structured findings with lifecycle states
|
|
231
|
-
- **Task Coordination**: Claim-based work distribution with dependencies
|
|
232
|
-
|
|
233
|
-
## Development (Contributors Only)
|
|
234
|
-
|
|
235
|
-
This section is for contributors developing the plugin itself. Users should install via npm as described above.
|
|
174
|
+
## Development
|
|
236
175
|
|
|
237
176
|
```bash
|
|
238
177
|
bun install # Install dependencies
|
|
239
|
-
bun run build # Compile
|
|
178
|
+
bun run build # Compile to index.js
|
|
240
179
|
bun run typecheck # Type check
|
|
241
|
-
bun test #
|
|
180
|
+
bun test # Unit tests
|
|
181
|
+
bun run test:integration # Integration tests (requires YAMS daemon)
|
|
242
182
|
```
|
|
243
183
|
|
|
244
184
|
## Troubleshooting
|
|
245
185
|
|
|
246
|
-
### "YAMS daemon not running"
|
|
247
|
-
|
|
248
186
|
```bash
|
|
249
|
-
yams daemon start
|
|
250
|
-
yams status
|
|
187
|
+
yams daemon start # "YAMS daemon not running"
|
|
188
|
+
yams status # Verify daemon is up
|
|
251
189
|
```
|
|
252
190
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
YAMS must be installed and in your PATH. See [Installation](#installation).
|
|
256
|
-
|
|
257
|
-
### Plugin not loading
|
|
258
|
-
|
|
259
|
-
1. Verify `opencode.json` has `"plugin": ["yams-blackboard"]`
|
|
260
|
-
2. Restart OpenCode to load the plugin
|
|
261
|
-
3. Check OpenCode logs for plugin errors
|
|
262
|
-
|
|
263
|
-
### Tools not appearing
|
|
191
|
+
**Plugin not loading:** Check `opencode.json` has `"plugin": ["yams-blackboard"]`, restart OpenCode.
|
|
264
192
|
|
|
265
|
-
Start a new session
|
|
193
|
+
**Tools not appearing:** Start a new session — tools register on `session.created`.
|
|
266
194
|
|
|
267
195
|
## License
|
|
268
196
|
|
|
269
|
-
|
|
197
|
+
GPL-3.0-only — see [LICENSE](LICENSE).
|