@blackms/aistack 1.5.2 → 1.5.4
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 +61 -11
- package/dist/cli/commands/init.js +1 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +22 -12
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +5 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/task-tools.d.ts +241 -1
- package/dist/mcp/tools/task-tools.d.ts.map +1 -1
- package/dist/mcp/tools/task-tools.js +308 -3
- package/dist/mcp/tools/task-tools.js.map +1 -1
- package/dist/memory/index.d.ts +6 -1
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +2 -2
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/sqlite-store.d.ts +68 -2
- package/dist/memory/sqlite-store.d.ts.map +1 -1
- package/dist/memory/sqlite-store.js +244 -6
- package/dist/memory/sqlite-store.js.map +1 -1
- package/dist/tasks/consensus-service.d.ts +146 -0
- package/dist/tasks/consensus-service.d.ts.map +1 -0
- package/dist/tasks/consensus-service.js +405 -0
- package/dist/tasks/consensus-service.js.map +1 -0
- package/dist/types.d.ts +49 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +34 -0
- package/dist/utils/config.js.map +1 -1
- package/dist/web/routes/consensus.d.ts +7 -0
- package/dist/web/routes/consensus.d.ts.map +1 -0
- package/dist/web/routes/consensus.js +218 -0
- package/dist/web/routes/consensus.js.map +1 -0
- package/dist/web/routes/index.d.ts +1 -0
- package/dist/web/routes/index.d.ts.map +1 -1
- package/dist/web/routes/index.js +1 -0
- package/dist/web/routes/index.js.map +1 -1
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +3 -1
- package/dist/web/server.js.map +1 -1
- package/dist/web/websocket/event-bridge.d.ts +19 -1
- package/dist/web/websocket/event-bridge.d.ts.map +1 -1
- package/dist/web/websocket/event-bridge.js +4 -0
- package/dist/web/websocket/event-bridge.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<br/>
|
|
22
22
|
|
|
23
23
|
```
|
|
24
|
-
11 agents ·
|
|
24
|
+
11 agents · 46 MCP tools · 6 LLM providers · SQLite + FTS5 · Web dashboard · Agent Identity · Drift Detection · Consensus Checkpoints · Resource Monitoring
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
</div>
|
|
@@ -201,13 +201,24 @@ Detect and prevent runaway agents consuming excessive resources:
|
|
|
201
201
|
- **Deliverable Checkpoints** - Reset time-based tracking when agents produce results
|
|
202
202
|
- **Slack Notifications** - Alert on warnings, interventions, and terminations
|
|
203
203
|
|
|
204
|
-
###
|
|
204
|
+
### 🤝 Consensus Checkpoints
|
|
205
|
+
|
|
206
|
+
Require validation before high-risk tasks can spawn subtasks:
|
|
207
|
+
|
|
208
|
+
- **Risk-Based Gating** - Configure which risk levels (high, medium, low) require consensus
|
|
209
|
+
- **Reviewer Strategies** - Choose from `adversarial`, `different-model`, or `human` reviewers
|
|
210
|
+
- **Configurable Risk Estimation** - Define high/medium risk agent types and keyword patterns
|
|
211
|
+
- **Task Depth Tracking** - Prevent unbounded task recursion with `maxDepth` limits
|
|
212
|
+
- **Checkpoint Lifecycle** - `pending` → `approved`/`rejected`/`expired` with audit trail
|
|
213
|
+
- **Timeout & Auto-Expiry** - Checkpoints expire after configurable timeout
|
|
214
|
+
|
|
215
|
+
### 🎯 46 MCP Tools for Claude Code
|
|
205
216
|
|
|
206
217
|
Control aistack directly from Claude Code IDE:
|
|
207
218
|
- 6 agent tools (spawn, list, stop, status, types, update)
|
|
208
219
|
- 8 identity tools (create, get, list, update, activate, deactivate, retire, audit)
|
|
209
220
|
- 5 memory tools (store, search, get, list, delete) — with agent-scoped memory support
|
|
210
|
-
-
|
|
221
|
+
- 13 task tools (create, assign, complete, list, get, check_drift, get_relationships, drift_metrics, + 5 consensus tools)
|
|
211
222
|
- 4 session tools (start, end, status, active)
|
|
212
223
|
- 3 system tools (status, health, config)
|
|
213
224
|
- 7 GitHub tools (issues, PRs, repo info)
|
|
@@ -240,6 +251,15 @@ Production-ready security:
|
|
|
240
251
|
- Role-based access control (Admin, Developer, Viewer)
|
|
241
252
|
- Security Auditor agent for code review
|
|
242
253
|
|
|
254
|
+
### 📢 Slack Integration
|
|
255
|
+
|
|
256
|
+
Real-time notifications to your team:
|
|
257
|
+
- **Agent Events** - Spawning, stopping, errors
|
|
258
|
+
- **Workflow Updates** - Start, completion, failures
|
|
259
|
+
- **Review Loop Progress** - Iteration updates
|
|
260
|
+
- **Resource Alerts** - Warnings, interventions, terminations
|
|
261
|
+
- **Customizable** - Choose which events to notify
|
|
262
|
+
|
|
243
263
|
---
|
|
244
264
|
|
|
245
265
|
## 📚 Documentation
|
|
@@ -297,7 +317,7 @@ Create `aistack.config.json` in your project root:
|
|
|
297
317
|
|
|
298
318
|
```json
|
|
299
319
|
{
|
|
300
|
-
"version": "1.5.
|
|
320
|
+
"version": "1.5.3",
|
|
301
321
|
"providers": {
|
|
302
322
|
"default": "anthropic",
|
|
303
323
|
"anthropic": {
|
|
@@ -340,11 +360,31 @@ Create `aistack.config.json` in your project root:
|
|
|
340
360
|
"warningThresholdPercent": 0.7,
|
|
341
361
|
"checkIntervalMs": 10000,
|
|
342
362
|
"autoTerminate": false,
|
|
363
|
+
"requireConfirmationOnIntervention": true,
|
|
343
364
|
"pauseOnIntervention": true
|
|
344
365
|
},
|
|
345
|
-
"
|
|
346
|
-
"enabled":
|
|
347
|
-
"
|
|
366
|
+
"slack": {
|
|
367
|
+
"enabled": false,
|
|
368
|
+
"webhookUrl": "${SLACK_WEBHOOK_URL}",
|
|
369
|
+
"channel": "#aistack-notifications",
|
|
370
|
+
"notifyOnAgentSpawn": false,
|
|
371
|
+
"notifyOnWorkflowComplete": true,
|
|
372
|
+
"notifyOnErrors": true,
|
|
373
|
+
"notifyOnReviewLoop": true,
|
|
374
|
+
"notifyOnResourceWarning": true,
|
|
375
|
+
"notifyOnResourceIntervention": true
|
|
376
|
+
},
|
|
377
|
+
"consensus": {
|
|
378
|
+
"enabled": false,
|
|
379
|
+
"requireForRiskLevels": ["high", "medium"],
|
|
380
|
+
"reviewerStrategy": "adversarial",
|
|
381
|
+
"timeout": 300000,
|
|
382
|
+
"maxDepth": 5,
|
|
383
|
+
"autoReject": false,
|
|
384
|
+
"highRiskAgentTypes": ["coder", "devops", "security-auditor"],
|
|
385
|
+
"mediumRiskAgentTypes": ["architect", "coordinator", "analyst"],
|
|
386
|
+
"highRiskPatterns": ["delete", "remove", "drop", "deploy", "production", "credentials", "secret", "password", "token", "api key"],
|
|
387
|
+
"mediumRiskPatterns": ["modify", "update", "change", "configure", "install"]
|
|
348
388
|
}
|
|
349
389
|
}
|
|
350
390
|
```
|
|
@@ -554,7 +594,7 @@ Then open http://localhost:3001 to:
|
|
|
554
594
|
|
|
555
595
|
| Tool | Description | Input | Code |
|
|
556
596
|
|------|-------------|-------|------|
|
|
557
|
-
| `task_create` | Create task with drift detection | `{ agentType, input?, sessionId?, parentTaskId? }` | `/src/mcp/tools/task-tools.ts:50` |
|
|
597
|
+
| `task_create` | Create task with drift detection | `{ agentType, input?, sessionId?, parentTaskId?, riskLevel? }` | `/src/mcp/tools/task-tools.ts:50` |
|
|
558
598
|
| `task_assign` | Assign task to agent | `{ taskId, agentId }` | `/src/mcp/tools/task-tools.ts:138` |
|
|
559
599
|
| `task_complete` | Mark task complete | `{ taskId, output?, status? }` | `/src/mcp/tools/task-tools.ts:169` |
|
|
560
600
|
| `task_list` | List tasks | `{ sessionId?, status? }` | `/src/mcp/tools/task-tools.ts:206` |
|
|
@@ -563,6 +603,16 @@ Then open http://localhost:3001 to:
|
|
|
563
603
|
| `task_get_relationships` | Get task relationships | `{ taskId, direction? }` | `/src/mcp/tools/task-tools.ts:328` |
|
|
564
604
|
| `task_drift_metrics` | Get drift detection metrics | `{ since? }` | `/src/mcp/tools/task-tools.ts:376` |
|
|
565
605
|
|
|
606
|
+
### Consensus Tools (5)
|
|
607
|
+
|
|
608
|
+
| Tool | Description | Input | Code |
|
|
609
|
+
|------|-------------|-------|------|
|
|
610
|
+
| `consensus_check` | Check if consensus required | `{ agentType, input?, parentTaskId?, riskLevel? }` | `/src/mcp/tools/task-tools.ts:504` |
|
|
611
|
+
| `consensus_list_pending` | List pending checkpoints | `{ limit?, offset? }` | `/src/mcp/tools/task-tools.ts:560` |
|
|
612
|
+
| `consensus_get` | Get checkpoint details | `{ checkpointId }` | `/src/mcp/tools/task-tools.ts:610` |
|
|
613
|
+
| `consensus_approve` | Approve a checkpoint | `{ checkpointId, reviewedBy, feedback? }` | `/src/mcp/tools/task-tools.ts:670` |
|
|
614
|
+
| `consensus_reject` | Reject a checkpoint | `{ checkpointId, reviewedBy, feedback?, rejectedSubtaskIds? }` | `/src/mcp/tools/task-tools.ts:720` |
|
|
615
|
+
|
|
566
616
|
### Session Tools (4)
|
|
567
617
|
|
|
568
618
|
| Tool | Description | Input | Code |
|
|
@@ -592,7 +642,7 @@ Then open http://localhost:3001 to:
|
|
|
592
642
|
| `github_pr_get` | Get PR | `{ owner, repo, number }` | `/src/mcp/tools/github-tools.ts:273` |
|
|
593
643
|
| `github_repo_info` | Get repo info | `{ owner, repo }` | `/src/mcp/tools/github-tools.ts:301` |
|
|
594
644
|
|
|
595
|
-
**Total:
|
|
645
|
+
**Total: 46 MCP Tools**
|
|
596
646
|
|
|
597
647
|
> **Note:** Review loop functionality is available via the programmatic API (`createReviewLoop`) and CLI, but not exposed as MCP tools.
|
|
598
648
|
|
|
@@ -739,7 +789,7 @@ To set accurate expectations, here are features **explicitly not implemented**:
|
|
|
739
789
|
- ❌ **Cloud-specific deployments** (AWS, GCP, Azure templates)
|
|
740
790
|
- ❌ **GraphQL API** (REST + WebSocket only)
|
|
741
791
|
- ❌ **Multi-tenancy** (single SQLite instance per deployment)
|
|
742
|
-
-
|
|
792
|
+
- ⚠️ **Limited observability** - Built-in health checks and Prometheus-style metrics, but no Grafana dashboards
|
|
743
793
|
- ❌ **Message queue systems** (no Kafka, RabbitMQ, Redis Streams)
|
|
744
794
|
- ❌ **Distributed tracing** (no OpenTelemetry integration)
|
|
745
795
|
|
|
@@ -798,6 +848,6 @@ aistack is designed as a **local-first, NPM-distributed package** for developer
|
|
|
798
848
|
|
|
799
849
|
<br/>
|
|
800
850
|
|
|
801
|
-
<sub>✅ **README verified against codebase v1.5.
|
|
851
|
+
<sub>✅ **README verified against codebase v1.5.3** - All claims backed by implemented code with file:line references (includes Consensus Checkpoints, Resource Exhaustion Monitoring, and Session-based Memory Isolation)</sub>
|
|
802
852
|
|
|
803
853
|
</div>
|
|
@@ -41,7 +41,7 @@ export function createInitCommand() {
|
|
|
41
41
|
console.log('\nProject initialized successfully!\n');
|
|
42
42
|
console.log('Next steps:');
|
|
43
43
|
console.log(' 1. Configure providers in aistack.config.json');
|
|
44
|
-
console.log(' 2. Add MCP server: claude mcp add aistack -- npx aistack mcp start');
|
|
44
|
+
console.log(' 2. Add MCP server: claude mcp add aistack -- npx @blackms/aistack mcp start');
|
|
45
45
|
console.log(' 3. Start using aistack commands\n');
|
|
46
46
|
log.info('Project initialized', { directory });
|
|
47
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,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,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;QAC7F,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QAEnD,GAAG,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mcp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,gBAAgB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mcp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,gBAAgB,IAAI,OAAO,CA2F1C"}
|
package/dist/cli/commands/mcp.js
CHANGED
|
@@ -47,33 +47,43 @@ export function createMcpCommand() {
|
|
|
47
47
|
.action(() => {
|
|
48
48
|
// List tools without starting server
|
|
49
49
|
const tools = [
|
|
50
|
-
// Agent tools
|
|
50
|
+
// Agent tools (6)
|
|
51
51
|
'agent_spawn', 'agent_list', 'agent_stop', 'agent_status', 'agent_types', 'agent_update_status',
|
|
52
|
-
//
|
|
52
|
+
// Identity tools (8)
|
|
53
|
+
'identity_create', 'identity_get', 'identity_list', 'identity_update',
|
|
54
|
+
'identity_activate', 'identity_deactivate', 'identity_retire', 'identity_audit',
|
|
55
|
+
// Memory tools (5)
|
|
53
56
|
'memory_store', 'memory_search', 'memory_get', 'memory_list', 'memory_delete',
|
|
54
|
-
// Task tools
|
|
57
|
+
// Task tools (8)
|
|
55
58
|
'task_create', 'task_assign', 'task_complete', 'task_list', 'task_get',
|
|
56
|
-
|
|
59
|
+
'task_check_drift', 'task_get_relationships', 'task_drift_metrics',
|
|
60
|
+
// Consensus tools (5)
|
|
61
|
+
'consensus_check', 'consensus_list_pending', 'consensus_get', 'consensus_approve', 'consensus_reject',
|
|
62
|
+
// Session tools (4)
|
|
57
63
|
'session_start', 'session_end', 'session_status', 'session_active',
|
|
58
|
-
// System tools
|
|
64
|
+
// System tools (3)
|
|
59
65
|
'system_status', 'system_health', 'system_config',
|
|
60
|
-
// GitHub tools
|
|
66
|
+
// GitHub tools (7)
|
|
61
67
|
'github_issue_create', 'github_issue_list', 'github_issue_get',
|
|
62
68
|
'github_pr_create', 'github_pr_list', 'github_pr_get',
|
|
63
69
|
'github_repo_info',
|
|
64
70
|
];
|
|
65
71
|
console.log('Available MCP tools:\n');
|
|
66
|
-
console.log('Agent Tools:');
|
|
72
|
+
console.log('Agent Tools (6):');
|
|
67
73
|
tools.filter(t => t.startsWith('agent_')).forEach(t => console.log(` - ${t}`));
|
|
68
|
-
console.log('\
|
|
74
|
+
console.log('\nIdentity Tools (8):');
|
|
75
|
+
tools.filter(t => t.startsWith('identity_')).forEach(t => console.log(` - ${t}`));
|
|
76
|
+
console.log('\nMemory Tools (5):');
|
|
69
77
|
tools.filter(t => t.startsWith('memory_')).forEach(t => console.log(` - ${t}`));
|
|
70
|
-
console.log('\nTask Tools:');
|
|
78
|
+
console.log('\nTask Tools (8):');
|
|
71
79
|
tools.filter(t => t.startsWith('task_')).forEach(t => console.log(` - ${t}`));
|
|
72
|
-
console.log('\
|
|
80
|
+
console.log('\nConsensus Tools (5):');
|
|
81
|
+
tools.filter(t => t.startsWith('consensus_')).forEach(t => console.log(` - ${t}`));
|
|
82
|
+
console.log('\nSession Tools (4):');
|
|
73
83
|
tools.filter(t => t.startsWith('session_')).forEach(t => console.log(` - ${t}`));
|
|
74
|
-
console.log('\nSystem Tools:');
|
|
84
|
+
console.log('\nSystem Tools (3):');
|
|
75
85
|
tools.filter(t => t.startsWith('system_')).forEach(t => console.log(` - ${t}`));
|
|
76
|
-
console.log('\nGitHub Tools:');
|
|
86
|
+
console.log('\nGitHub Tools (7):');
|
|
77
87
|
tools.filter(t => t.startsWith('github_')).forEach(t => console.log(` - ${t}`));
|
|
78
88
|
console.log(`\nTotal: ${tools.length} tools`);
|
|
79
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/cli/commands/mcp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAEhC,MAAM,UAAU,gBAAgB;IAC9B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC;SAC/B,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAExC,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,sBAAsB,CAAC;SACnC,MAAM,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,OAAO,CAAC;SAC/D,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,MAAM,EAAE,SAAS,EAAE,GAAG,OAAgC,CAAC;QAEvD,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;YAC1B,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;YAE5C,GAAG,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,KAAK,E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{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAwBpD,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAmC;IAChD,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,MAAM,EAAE,gBAAgB;IAsBpC,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,aAAa;IA8Df,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3B,YAAY,IAAI,MAAM;IAItB,YAAY,IAAI,MAAM,EAAE;CAGzB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAIjF"}
|
package/dist/mcp/server.js
CHANGED
|
@@ -8,6 +8,7 @@ import { MemoryManager } from '../memory/index.js';
|
|
|
8
8
|
import { logger } from '../utils/logger.js';
|
|
9
9
|
import { createAgentTools, createIdentityTools, createMemoryTools, createTaskTools, createSessionTools, createSystemTools, createGitHubTools, } from './tools/index.js';
|
|
10
10
|
import { DriftDetectionService } from '../tasks/drift-detection-service.js';
|
|
11
|
+
import { ConsensusService } from '../tasks/consensus-service.js';
|
|
11
12
|
const log = logger.child('mcp');
|
|
12
13
|
export class MCPServer {
|
|
13
14
|
server;
|
|
@@ -15,10 +16,12 @@ export class MCPServer {
|
|
|
15
16
|
memory;
|
|
16
17
|
config;
|
|
17
18
|
driftService;
|
|
19
|
+
consensusService;
|
|
18
20
|
constructor(config) {
|
|
19
21
|
this.config = config;
|
|
20
22
|
this.memory = new MemoryManager(config);
|
|
21
23
|
this.driftService = new DriftDetectionService(this.memory.getStore(), config);
|
|
24
|
+
this.consensusService = new ConsensusService(this.memory.getStore(), config);
|
|
22
25
|
this.server = new Server({
|
|
23
26
|
name: 'agentstack',
|
|
24
27
|
version: config.version,
|
|
@@ -36,7 +39,7 @@ export class MCPServer {
|
|
|
36
39
|
createAgentTools(this.config),
|
|
37
40
|
createIdentityTools(this.config),
|
|
38
41
|
createMemoryTools(this.memory),
|
|
39
|
-
createTaskTools(this.memory, this.driftService),
|
|
42
|
+
createTaskTools(this.memory, this.driftService, this.consensusService),
|
|
40
43
|
createSessionTools(this.memory),
|
|
41
44
|
createSystemTools(this.memory, this.config),
|
|
42
45
|
createGitHubTools(this.config),
|
|
@@ -111,6 +114,7 @@ export class MCPServer {
|
|
|
111
114
|
}
|
|
112
115
|
async stop() {
|
|
113
116
|
await this.server.close();
|
|
117
|
+
this.consensusService.destroy();
|
|
114
118
|
this.memory.close();
|
|
115
119
|
log.info('MCP server stopped');
|
|
116
120
|
}
|
package/dist/mcp/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js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K,EAAE,CAAC;IACrB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { MemoryManager } from '../../memory/index.js';
|
|
5
5
|
import type { DriftDetectionService } from '../../tasks/drift-detection-service.js';
|
|
6
|
-
|
|
6
|
+
import type { ConsensusService } from '../../tasks/consensus-service.js';
|
|
7
|
+
import type { TaskRiskLevel, ProposedSubtask } from '../../types.js';
|
|
8
|
+
export declare function createTaskTools(memory: MemoryManager, driftService?: DriftDetectionService, consensusService?: ConsensusService): {
|
|
7
9
|
task_create: {
|
|
8
10
|
name: string;
|
|
9
11
|
description: string;
|
|
@@ -26,6 +28,11 @@ export declare function createTaskTools(memory: MemoryManager, driftService?: Dr
|
|
|
26
28
|
type: string;
|
|
27
29
|
description: string;
|
|
28
30
|
};
|
|
31
|
+
riskLevel: {
|
|
32
|
+
type: string;
|
|
33
|
+
enum: string[];
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
29
36
|
};
|
|
30
37
|
required: string[];
|
|
31
38
|
};
|
|
@@ -39,6 +46,27 @@ export declare function createTaskTools(memory: MemoryManager, driftService?: Dr
|
|
|
39
46
|
mostSimilarTaskInput: string | undefined;
|
|
40
47
|
action: "prevented";
|
|
41
48
|
};
|
|
49
|
+
consensusRequired?: undefined;
|
|
50
|
+
checkpointId?: undefined;
|
|
51
|
+
status?: undefined;
|
|
52
|
+
reason?: undefined;
|
|
53
|
+
checkpoint?: undefined;
|
|
54
|
+
task?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
success: boolean;
|
|
57
|
+
consensusRequired: boolean;
|
|
58
|
+
checkpointId: string;
|
|
59
|
+
status: string;
|
|
60
|
+
reason: string | undefined;
|
|
61
|
+
checkpoint: {
|
|
62
|
+
id: string;
|
|
63
|
+
taskId: string;
|
|
64
|
+
riskLevel: TaskRiskLevel;
|
|
65
|
+
status: import("../../types.js").ConsensusStatus;
|
|
66
|
+
expiresAt: string;
|
|
67
|
+
};
|
|
68
|
+
error?: undefined;
|
|
69
|
+
drift?: undefined;
|
|
42
70
|
task?: undefined;
|
|
43
71
|
} | {
|
|
44
72
|
success: boolean;
|
|
@@ -49,6 +77,8 @@ export declare function createTaskTools(memory: MemoryManager, driftService?: Dr
|
|
|
49
77
|
createdAt: string;
|
|
50
78
|
sessionId: string | undefined;
|
|
51
79
|
parentTaskId: string | undefined;
|
|
80
|
+
riskLevel: TaskRiskLevel | undefined;
|
|
81
|
+
depth: number | undefined;
|
|
52
82
|
};
|
|
53
83
|
drift: {
|
|
54
84
|
isDrift: boolean;
|
|
@@ -58,10 +88,20 @@ export declare function createTaskTools(memory: MemoryManager, driftService?: Dr
|
|
|
58
88
|
mostSimilarTaskInput?: undefined;
|
|
59
89
|
} | undefined;
|
|
60
90
|
error?: undefined;
|
|
91
|
+
consensusRequired?: undefined;
|
|
92
|
+
checkpointId?: undefined;
|
|
93
|
+
status?: undefined;
|
|
94
|
+
reason?: undefined;
|
|
95
|
+
checkpoint?: undefined;
|
|
61
96
|
} | {
|
|
62
97
|
success: boolean;
|
|
63
98
|
error: string;
|
|
64
99
|
drift?: undefined;
|
|
100
|
+
consensusRequired?: undefined;
|
|
101
|
+
checkpointId?: undefined;
|
|
102
|
+
status?: undefined;
|
|
103
|
+
reason?: undefined;
|
|
104
|
+
checkpoint?: undefined;
|
|
65
105
|
task?: undefined;
|
|
66
106
|
}>;
|
|
67
107
|
};
|
|
@@ -319,5 +359,205 @@ export declare function createTaskTools(memory: MemoryManager, driftService?: Dr
|
|
|
319
359
|
error?: undefined;
|
|
320
360
|
}>;
|
|
321
361
|
};
|
|
362
|
+
consensus_check: {
|
|
363
|
+
name: string;
|
|
364
|
+
description: string;
|
|
365
|
+
inputSchema: {
|
|
366
|
+
type: string;
|
|
367
|
+
properties: {
|
|
368
|
+
agentType: {
|
|
369
|
+
type: string;
|
|
370
|
+
description: string;
|
|
371
|
+
};
|
|
372
|
+
input: {
|
|
373
|
+
type: string;
|
|
374
|
+
description: string;
|
|
375
|
+
};
|
|
376
|
+
parentTaskId: {
|
|
377
|
+
type: string;
|
|
378
|
+
description: string;
|
|
379
|
+
};
|
|
380
|
+
riskLevel: {
|
|
381
|
+
type: string;
|
|
382
|
+
enum: string[];
|
|
383
|
+
description: string;
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
required: string[];
|
|
387
|
+
};
|
|
388
|
+
handler: (params: Record<string, unknown>) => Promise<{
|
|
389
|
+
success: boolean;
|
|
390
|
+
error: string;
|
|
391
|
+
requiresConsensus?: undefined;
|
|
392
|
+
reason?: undefined;
|
|
393
|
+
riskLevel?: undefined;
|
|
394
|
+
depth?: undefined;
|
|
395
|
+
config?: undefined;
|
|
396
|
+
} | {
|
|
397
|
+
success: boolean;
|
|
398
|
+
requiresConsensus: boolean;
|
|
399
|
+
reason: string | undefined;
|
|
400
|
+
riskLevel: TaskRiskLevel;
|
|
401
|
+
depth: number;
|
|
402
|
+
config: {
|
|
403
|
+
enabled: boolean;
|
|
404
|
+
requireForRiskLevels: TaskRiskLevel[];
|
|
405
|
+
maxDepth: number;
|
|
406
|
+
};
|
|
407
|
+
error?: undefined;
|
|
408
|
+
}>;
|
|
409
|
+
};
|
|
410
|
+
consensus_list_pending: {
|
|
411
|
+
name: string;
|
|
412
|
+
description: string;
|
|
413
|
+
inputSchema: {
|
|
414
|
+
type: string;
|
|
415
|
+
properties: {
|
|
416
|
+
limit: {
|
|
417
|
+
type: string;
|
|
418
|
+
description: string;
|
|
419
|
+
};
|
|
420
|
+
offset: {
|
|
421
|
+
type: string;
|
|
422
|
+
description: string;
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
handler: (params: Record<string, unknown>) => Promise<{
|
|
427
|
+
success: boolean;
|
|
428
|
+
error: string;
|
|
429
|
+
count?: undefined;
|
|
430
|
+
checkpoints?: undefined;
|
|
431
|
+
} | {
|
|
432
|
+
success: boolean;
|
|
433
|
+
count: number;
|
|
434
|
+
checkpoints: {
|
|
435
|
+
id: string;
|
|
436
|
+
taskId: string;
|
|
437
|
+
parentTaskId: string | undefined;
|
|
438
|
+
riskLevel: TaskRiskLevel;
|
|
439
|
+
status: import("../../types.js").ConsensusStatus;
|
|
440
|
+
reviewerStrategy: import("../../types.js").ReviewerStrategy;
|
|
441
|
+
subtaskCount: number;
|
|
442
|
+
createdAt: string;
|
|
443
|
+
expiresAt: string;
|
|
444
|
+
}[];
|
|
445
|
+
error?: undefined;
|
|
446
|
+
}>;
|
|
447
|
+
};
|
|
448
|
+
consensus_get: {
|
|
449
|
+
name: string;
|
|
450
|
+
description: string;
|
|
451
|
+
inputSchema: {
|
|
452
|
+
type: string;
|
|
453
|
+
properties: {
|
|
454
|
+
checkpointId: {
|
|
455
|
+
type: string;
|
|
456
|
+
description: string;
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
required: string[];
|
|
460
|
+
};
|
|
461
|
+
handler: (params: Record<string, unknown>) => Promise<{
|
|
462
|
+
success: boolean;
|
|
463
|
+
error: string;
|
|
464
|
+
checkpoint?: undefined;
|
|
465
|
+
} | {
|
|
466
|
+
success: boolean;
|
|
467
|
+
checkpoint: {
|
|
468
|
+
id: string;
|
|
469
|
+
taskId: string;
|
|
470
|
+
parentTaskId: string | undefined;
|
|
471
|
+
proposedSubtasks: ProposedSubtask[];
|
|
472
|
+
riskLevel: TaskRiskLevel;
|
|
473
|
+
status: import("../../types.js").ConsensusStatus;
|
|
474
|
+
reviewerStrategy: import("../../types.js").ReviewerStrategy;
|
|
475
|
+
reviewerId: string | undefined;
|
|
476
|
+
reviewerType: "human" | "agent" | undefined;
|
|
477
|
+
decision: import("../../types.js").ConsensusDecision | undefined;
|
|
478
|
+
createdAt: string;
|
|
479
|
+
expiresAt: string;
|
|
480
|
+
decidedAt: string | undefined;
|
|
481
|
+
};
|
|
482
|
+
error?: undefined;
|
|
483
|
+
}>;
|
|
484
|
+
};
|
|
485
|
+
consensus_approve: {
|
|
486
|
+
name: string;
|
|
487
|
+
description: string;
|
|
488
|
+
inputSchema: {
|
|
489
|
+
type: string;
|
|
490
|
+
properties: {
|
|
491
|
+
checkpointId: {
|
|
492
|
+
type: string;
|
|
493
|
+
description: string;
|
|
494
|
+
};
|
|
495
|
+
reviewedBy: {
|
|
496
|
+
type: string;
|
|
497
|
+
description: string;
|
|
498
|
+
};
|
|
499
|
+
feedback: {
|
|
500
|
+
type: string;
|
|
501
|
+
description: string;
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
required: string[];
|
|
505
|
+
};
|
|
506
|
+
handler: (params: Record<string, unknown>) => Promise<{
|
|
507
|
+
success: boolean;
|
|
508
|
+
error: string | undefined;
|
|
509
|
+
checkpoint?: undefined;
|
|
510
|
+
} | {
|
|
511
|
+
success: boolean;
|
|
512
|
+
checkpoint: {
|
|
513
|
+
id: string;
|
|
514
|
+
status: import("../../types.js").ConsensusStatus;
|
|
515
|
+
decidedAt: string | undefined;
|
|
516
|
+
} | undefined;
|
|
517
|
+
error?: undefined;
|
|
518
|
+
}>;
|
|
519
|
+
};
|
|
520
|
+
consensus_reject: {
|
|
521
|
+
name: string;
|
|
522
|
+
description: string;
|
|
523
|
+
inputSchema: {
|
|
524
|
+
type: string;
|
|
525
|
+
properties: {
|
|
526
|
+
checkpointId: {
|
|
527
|
+
type: string;
|
|
528
|
+
description: string;
|
|
529
|
+
};
|
|
530
|
+
reviewedBy: {
|
|
531
|
+
type: string;
|
|
532
|
+
description: string;
|
|
533
|
+
};
|
|
534
|
+
feedback: {
|
|
535
|
+
type: string;
|
|
536
|
+
description: string;
|
|
537
|
+
};
|
|
538
|
+
rejectedSubtaskIds: {
|
|
539
|
+
type: string;
|
|
540
|
+
items: {
|
|
541
|
+
type: string;
|
|
542
|
+
};
|
|
543
|
+
description: string;
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
required: string[];
|
|
547
|
+
};
|
|
548
|
+
handler: (params: Record<string, unknown>) => Promise<{
|
|
549
|
+
success: boolean;
|
|
550
|
+
error: string | undefined;
|
|
551
|
+
checkpoint?: undefined;
|
|
552
|
+
} | {
|
|
553
|
+
success: boolean;
|
|
554
|
+
checkpoint: {
|
|
555
|
+
id: string;
|
|
556
|
+
status: import("../../types.js").ConsensusStatus;
|
|
557
|
+
decidedAt: string | undefined;
|
|
558
|
+
} | undefined;
|
|
559
|
+
error?: undefined;
|
|
560
|
+
}>;
|
|
561
|
+
};
|
|
322
562
|
};
|
|
323
563
|
//# sourceMappingURL=task-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/task-tools.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"task-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/task-tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AA0CrE,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,EACrB,YAAY,CAAC,EAAE,qBAAqB,EACpC,gBAAgB,CAAC,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAiBP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAwJvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAgCvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;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