@blackms/aistack 1.4.0 → 1.5.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 +69 -32
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +4 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/task-tools.d.ts +154 -1
- package/dist/mcp/tools/task-tools.d.ts.map +1 -1
- package/dist/mcp/tools/task-tools.js +192 -2
- package/dist/mcp/tools/task-tools.js.map +1 -1
- package/dist/memory/sqlite-store.d.ts.map +1 -1
- package/dist/memory/sqlite-store.js +46 -0
- package/dist/memory/sqlite-store.js.map +1 -1
- package/dist/tasks/drift-detection-service.d.ts +81 -0
- package/dist/tasks/drift-detection-service.d.ts.map +1 -0
- package/dist/tasks/drift-detection-service.js +401 -0
- package/dist/tasks/drift-detection-service.js.map +1 -0
- package/dist/tasks/index.d.ts +5 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +5 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/types.d.ts +46 -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 +12 -0
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/embeddings.d.ts +1 -0
- package/dist/utils/embeddings.d.ts.map +1 -1
- package/dist/utils/embeddings.js.map +1 -1
- package/dist/utils/validation.d.ts +2 -2
- 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 · 41 MCP tools · 6 LLM providers · SQLite + FTS5 · Web dashboard · Agent Identity · Drift Detection
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
</div>
|
|
@@ -170,16 +170,36 @@ Automatic code improvement through iterative feedback:
|
|
|
170
170
|
|
|
171
171
|
Result: More robust, secure code with fewer bugs.
|
|
172
172
|
|
|
173
|
-
###
|
|
173
|
+
### 🪪 Agent Identity v1
|
|
174
|
+
|
|
175
|
+
Persistent agent identities with lifecycle management:
|
|
176
|
+
|
|
177
|
+
- **Stable UUIDs** - Agents have persistent `agent_id` across executions
|
|
178
|
+
- **Lifecycle States** - `created` → `active` → `dormant` → `retired`
|
|
179
|
+
- **Capabilities Tracking** - Store and version agent capabilities
|
|
180
|
+
- **Full Audit Trail** - Every identity change is logged
|
|
181
|
+
- **Agent-Scoped Memory** - Memory namespaces owned by specific agents
|
|
182
|
+
|
|
183
|
+
### 🎯 Semantic Drift Detection
|
|
184
|
+
|
|
185
|
+
Detect when task descriptions are semantically similar to ancestors:
|
|
186
|
+
|
|
187
|
+
- **Embedding-based Similarity** - Uses OpenAI or Ollama embeddings
|
|
188
|
+
- **Configurable Thresholds** - `threshold` (block/warn) and `warningThreshold` (warn only)
|
|
189
|
+
- **Two Behaviors** - `warn` (log and allow) or `prevent` (block creation)
|
|
190
|
+
- **Task Relationships** - Track `parent_of`, `derived_from`, `depends_on`, `supersedes`
|
|
191
|
+
- **Metrics & Events** - Full logging for drift detection analysis
|
|
192
|
+
|
|
193
|
+
### 🎯 41 MCP Tools for Claude Code
|
|
174
194
|
|
|
175
195
|
Control aistack directly from Claude Code IDE:
|
|
176
196
|
- 6 agent tools (spawn, list, stop, status, types, update)
|
|
177
|
-
-
|
|
178
|
-
- 5
|
|
197
|
+
- 8 identity tools (create, get, list, update, activate, deactivate, retire, audit)
|
|
198
|
+
- 5 memory tools (store, search, get, list, delete) — with agent-scoped memory support
|
|
199
|
+
- 8 task tools (create, assign, complete, list, get, check_drift, get_relationships, drift_metrics)
|
|
179
200
|
- 4 session tools (start, end, status, active)
|
|
180
201
|
- 3 system tools (status, health, config)
|
|
181
202
|
- 7 GitHub tools (issues, PRs, repo info)
|
|
182
|
-
- 6 review loop tools (start, status, abort, issues, list, get code)
|
|
183
203
|
|
|
184
204
|
### 🌐 Web Dashboard
|
|
185
205
|
|
|
@@ -266,7 +286,7 @@ Create `aistack.config.json` in your project root:
|
|
|
266
286
|
|
|
267
287
|
```json
|
|
268
288
|
{
|
|
269
|
-
"version": "1.
|
|
289
|
+
"version": "1.5.0",
|
|
270
290
|
"providers": {
|
|
271
291
|
"default": "anthropic",
|
|
272
292
|
"anthropic": {
|
|
@@ -289,6 +309,14 @@ Create `aistack.config.json` in your project root:
|
|
|
289
309
|
"provider": "openai"
|
|
290
310
|
}
|
|
291
311
|
},
|
|
312
|
+
"driftDetection": {
|
|
313
|
+
"enabled": false,
|
|
314
|
+
"threshold": 0.95,
|
|
315
|
+
"warningThreshold": 0.8,
|
|
316
|
+
"ancestorDepth": 3,
|
|
317
|
+
"behavior": "warn",
|
|
318
|
+
"asyncEmbedding": true
|
|
319
|
+
},
|
|
292
320
|
"auth": {
|
|
293
321
|
"enabled": true,
|
|
294
322
|
"jwtSecret": "${JWT_SECRET}"
|
|
@@ -478,21 +506,37 @@ Then open http://localhost:3001 to:
|
|
|
478
506
|
|
|
479
507
|
| Tool | Description | Input | Code |
|
|
480
508
|
|------|-------------|-------|------|
|
|
481
|
-
| `memory_store` | Store memory entry | `{ key, content, namespace?, metadata? }` | `/src/mcp/tools/memory-tools.ts:
|
|
482
|
-
| `memory_search` | Search with FTS5 | `{ query, namespace?, limit? }` | `/src/mcp/tools/memory-tools.ts:
|
|
483
|
-
| `memory_get` | Get by key | `{ key, namespace? }` | `/src/mcp/tools/memory-tools.ts:
|
|
484
|
-
| `memory_list` | List all entries | `{ namespace?, limit?, offset? }` | `/src/mcp/tools/memory-tools.ts:
|
|
485
|
-
| `memory_delete` | Delete entry | `{ key, namespace? }` | `/src/mcp/tools/memory-tools.ts:
|
|
509
|
+
| `memory_store` | Store memory entry | `{ key, content, namespace?, metadata?, agentId? }` | `/src/mcp/tools/memory-tools.ts:48` |
|
|
510
|
+
| `memory_search` | Search with FTS5 | `{ query, namespace?, limit?, agentId?, includeShared? }` | `/src/mcp/tools/memory-tools.ts:94` |
|
|
511
|
+
| `memory_get` | Get by key | `{ key, namespace? }` | `/src/mcp/tools/memory-tools.ts:145` |
|
|
512
|
+
| `memory_list` | List all entries | `{ namespace?, limit?, offset?, agentId?, includeShared? }` | `/src/mcp/tools/memory-tools.ts:182` |
|
|
513
|
+
| `memory_delete` | Delete entry | `{ key, namespace? }` | `/src/mcp/tools/memory-tools.ts:221` |
|
|
486
514
|
|
|
487
|
-
###
|
|
515
|
+
### Identity Tools (8)
|
|
488
516
|
|
|
489
517
|
| Tool | Description | Input | Code |
|
|
490
518
|
|------|-------------|-------|------|
|
|
491
|
-
| `
|
|
492
|
-
| `
|
|
493
|
-
| `
|
|
494
|
-
| `
|
|
495
|
-
| `
|
|
519
|
+
| `identity_create` | Create agent identity | `{ agentType, displayName?, capabilities?, metadata? }` | `/src/mcp/tools/identity-tools.ts:98` |
|
|
520
|
+
| `identity_get` | Get identity by ID or name | `{ agentId?, displayName? }` | `/src/mcp/tools/identity-tools.ts:155` |
|
|
521
|
+
| `identity_list` | List identities | `{ status?, agentType?, limit?, offset? }` | `/src/mcp/tools/identity-tools.ts:205` |
|
|
522
|
+
| `identity_update` | Update identity metadata | `{ agentId, displayName?, metadata?, capabilities? }` | `/src/mcp/tools/identity-tools.ts:247` |
|
|
523
|
+
| `identity_activate` | Activate identity | `{ agentId, actorId? }` | `/src/mcp/tools/identity-tools.ts:311` |
|
|
524
|
+
| `identity_deactivate` | Deactivate identity | `{ agentId, reason?, actorId? }` | `/src/mcp/tools/identity-tools.ts:342` |
|
|
525
|
+
| `identity_retire` | Retire identity (permanent) | `{ agentId, reason?, actorId? }` | `/src/mcp/tools/identity-tools.ts:378` |
|
|
526
|
+
| `identity_audit` | Get audit trail | `{ agentId, limit? }` | `/src/mcp/tools/identity-tools.ts:414` |
|
|
527
|
+
|
|
528
|
+
### Task Tools (8)
|
|
529
|
+
|
|
530
|
+
| Tool | Description | Input | Code |
|
|
531
|
+
|------|-------------|-------|------|
|
|
532
|
+
| `task_create` | Create task with drift detection | `{ agentType, input?, sessionId?, parentTaskId? }` | `/src/mcp/tools/task-tools.ts:50` |
|
|
533
|
+
| `task_assign` | Assign task to agent | `{ taskId, agentId }` | `/src/mcp/tools/task-tools.ts:138` |
|
|
534
|
+
| `task_complete` | Mark task complete | `{ taskId, output?, status? }` | `/src/mcp/tools/task-tools.ts:169` |
|
|
535
|
+
| `task_list` | List tasks | `{ sessionId?, status? }` | `/src/mcp/tools/task-tools.ts:206` |
|
|
536
|
+
| `task_get` | Get task details | `{ taskId }` | `/src/mcp/tools/task-tools.ts:236` |
|
|
537
|
+
| `task_check_drift` | Check for semantic drift | `{ taskInput, taskType, parentTaskId? }` | `/src/mcp/tools/task-tools.ts:273` |
|
|
538
|
+
| `task_get_relationships` | Get task relationships | `{ taskId, direction? }` | `/src/mcp/tools/task-tools.ts:328` |
|
|
539
|
+
| `task_drift_metrics` | Get drift detection metrics | `{ since? }` | `/src/mcp/tools/task-tools.ts:376` |
|
|
496
540
|
|
|
497
541
|
### Session Tools (4)
|
|
498
542
|
|
|
@@ -523,18 +567,9 @@ Then open http://localhost:3001 to:
|
|
|
523
567
|
| `github_pr_get` | Get PR | `{ owner, repo, number }` | `/src/mcp/tools/github-tools.ts:273` |
|
|
524
568
|
| `github_repo_info` | Get repo info | `{ owner, repo }` | `/src/mcp/tools/github-tools.ts:301` |
|
|
525
569
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
| Tool | Description | Input | Code |
|
|
529
|
-
|------|-------------|-------|------|
|
|
530
|
-
| `review_loop_start` | Start adversarial review | `{ code, maxIterations?, sessionId? }` | `/src/mcp/tools/review-loop-tools.ts:46` |
|
|
531
|
-
| `review_loop_status` | Get loop status | `{ loopId }` | `/src/mcp/tools/review-loop-tools.ts:84` |
|
|
532
|
-
| `review_loop_abort` | Stop review loop | `{ loopId }` | `/src/mcp/tools/review-loop-tools.ts:121` |
|
|
533
|
-
| `review_loop_issues` | Get review issues | `{ loopId }` | `/src/mcp/tools/review-loop-tools.ts:142` |
|
|
534
|
-
| `review_loop_list` | List active loops | `{}` | `/src/mcp/tools/review-loop-tools.ts:188` |
|
|
535
|
-
| `review_loop_get_code` | Get loop code | `{ loopId }` | `/src/mcp/tools/review-loop-tools.ts:205` |
|
|
570
|
+
**Total: 41 MCP Tools**
|
|
536
571
|
|
|
537
|
-
**
|
|
572
|
+
> **Note:** Review loop functionality is available via the programmatic API (`createReviewLoop`) and CLI, but not exposed as MCP tools.
|
|
538
573
|
|
|
539
574
|
---
|
|
540
575
|
|
|
@@ -602,11 +637,12 @@ const agentTypes = listAgentTypes();
|
|
|
602
637
|
```
|
|
603
638
|
aistack/
|
|
604
639
|
├── src/
|
|
605
|
-
│ ├── agents/ # 11 agent types with system prompts
|
|
606
|
-
│ ├── mcp/ # MCP server +
|
|
640
|
+
│ ├── agents/ # 11 agent types with system prompts + identity service
|
|
641
|
+
│ ├── mcp/ # MCP server + 41 tools
|
|
607
642
|
│ ├── memory/ # SQLite + FTS5 + vector search
|
|
643
|
+
│ ├── tasks/ # Drift detection service
|
|
608
644
|
│ ├── coordination/ # Task queue, message bus, review loop
|
|
609
|
-
│ ├── web/ # REST API + WebSocket server
|
|
645
|
+
│ ├── web/ # REST API + WebSocket server + identity routes
|
|
610
646
|
│ ├── providers/ # 6 LLM provider integrations
|
|
611
647
|
│ ├── workflows/ # Multi-phase workflow engine
|
|
612
648
|
│ ├── auth/ # JWT + RBAC authentication
|
|
@@ -621,6 +657,7 @@ aistack/
|
|
|
621
657
|
│ ├── components/ # React components
|
|
622
658
|
│ └── stores/ # Zustand state management
|
|
623
659
|
│
|
|
660
|
+
├── migrations/ # Database migrations
|
|
624
661
|
├── tests/ # Unit + integration tests
|
|
625
662
|
├── docs/ # Technical documentation
|
|
626
663
|
└── .github/workflows/ # CI/CD pipeline
|
|
@@ -734,6 +771,6 @@ aistack is designed as a **local-first, NPM-distributed package** for developer
|
|
|
734
771
|
|
|
735
772
|
<br/>
|
|
736
773
|
|
|
737
|
-
<sub>✅ **README verified against codebase v1.
|
|
774
|
+
<sub>✅ **README verified against codebase v1.5.0** - All claims backed by implemented code with file:line references</sub>
|
|
738
775
|
|
|
739
776
|
</div>
|
package/dist/mcp/server.d.ts
CHANGED
package/dist/mcp/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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;
|
|
1
|
+
{"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;AAuBpD,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;gBAEhC,MAAM,EAAE,gBAAgB;IAqBpC,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,aAAa;IA8Df,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B,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
|
@@ -7,15 +7,18 @@ import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextpro
|
|
|
7
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
|
+
import { DriftDetectionService } from '../tasks/drift-detection-service.js';
|
|
10
11
|
const log = logger.child('mcp');
|
|
11
12
|
export class MCPServer {
|
|
12
13
|
server;
|
|
13
14
|
tools = new Map();
|
|
14
15
|
memory;
|
|
15
16
|
config;
|
|
17
|
+
driftService;
|
|
16
18
|
constructor(config) {
|
|
17
19
|
this.config = config;
|
|
18
20
|
this.memory = new MemoryManager(config);
|
|
21
|
+
this.driftService = new DriftDetectionService(this.memory.getStore(), config);
|
|
19
22
|
this.server = new Server({
|
|
20
23
|
name: 'agentstack',
|
|
21
24
|
version: config.version,
|
|
@@ -33,7 +36,7 @@ export class MCPServer {
|
|
|
33
36
|
createAgentTools(this.config),
|
|
34
37
|
createIdentityTools(this.config),
|
|
35
38
|
createMemoryTools(this.memory),
|
|
36
|
-
createTaskTools(this.memory),
|
|
39
|
+
createTaskTools(this.memory, this.driftService),
|
|
37
40
|
createSessionTools(this.memory),
|
|
38
41
|
createSystemTools(this.memory, this.config),
|
|
39
42
|
createGitHubTools(this.config),
|
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;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C,SAAS,CAAC;gCACnB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;6BAC9D,CAAC;yBACH;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,GAAG,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACjC,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,YAAY;QACV,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IACvC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAwB;IAC3D,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Task MCP tools - create, assign, complete, list
|
|
3
3
|
*/
|
|
4
4
|
import type { MemoryManager } from '../../memory/index.js';
|
|
5
|
-
|
|
5
|
+
import type { DriftDetectionService } from '../../tasks/drift-detection-service.js';
|
|
6
|
+
export declare function createTaskTools(memory: MemoryManager, driftService?: DriftDetectionService): {
|
|
6
7
|
task_create: {
|
|
7
8
|
name: string;
|
|
8
9
|
description: string;
|
|
@@ -21,10 +22,25 @@ export declare function createTaskTools(memory: MemoryManager): {
|
|
|
21
22
|
type: string;
|
|
22
23
|
description: string;
|
|
23
24
|
};
|
|
25
|
+
parentTaskId: {
|
|
26
|
+
type: string;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
24
29
|
};
|
|
25
30
|
required: string[];
|
|
26
31
|
};
|
|
27
32
|
handler: (params: Record<string, unknown>) => Promise<{
|
|
33
|
+
success: boolean;
|
|
34
|
+
error: string;
|
|
35
|
+
drift: {
|
|
36
|
+
isDrift: boolean;
|
|
37
|
+
highestSimilarity: number;
|
|
38
|
+
mostSimilarTaskId: string | undefined;
|
|
39
|
+
mostSimilarTaskInput: string | undefined;
|
|
40
|
+
action: "prevented";
|
|
41
|
+
};
|
|
42
|
+
task?: undefined;
|
|
43
|
+
} | {
|
|
28
44
|
success: boolean;
|
|
29
45
|
task: {
|
|
30
46
|
id: string;
|
|
@@ -32,11 +48,20 @@ export declare function createTaskTools(memory: MemoryManager): {
|
|
|
32
48
|
status: import("../../types.js").TaskStatus;
|
|
33
49
|
createdAt: string;
|
|
34
50
|
sessionId: string | undefined;
|
|
51
|
+
parentTaskId: string | undefined;
|
|
35
52
|
};
|
|
53
|
+
drift: {
|
|
54
|
+
isDrift: boolean;
|
|
55
|
+
highestSimilarity: number;
|
|
56
|
+
mostSimilarTaskId: string | undefined;
|
|
57
|
+
action: import("../../types.js").DriftDetectionAction;
|
|
58
|
+
mostSimilarTaskInput?: undefined;
|
|
59
|
+
} | undefined;
|
|
36
60
|
error?: undefined;
|
|
37
61
|
} | {
|
|
38
62
|
success: boolean;
|
|
39
63
|
error: string;
|
|
64
|
+
drift?: undefined;
|
|
40
65
|
task?: undefined;
|
|
41
66
|
}>;
|
|
42
67
|
};
|
|
@@ -166,5 +191,133 @@ export declare function createTaskTools(memory: MemoryManager): {
|
|
|
166
191
|
message?: undefined;
|
|
167
192
|
}>;
|
|
168
193
|
};
|
|
194
|
+
task_check_drift: {
|
|
195
|
+
name: string;
|
|
196
|
+
description: string;
|
|
197
|
+
inputSchema: {
|
|
198
|
+
type: string;
|
|
199
|
+
properties: {
|
|
200
|
+
taskInput: {
|
|
201
|
+
type: string;
|
|
202
|
+
description: string;
|
|
203
|
+
};
|
|
204
|
+
taskType: {
|
|
205
|
+
type: string;
|
|
206
|
+
description: string;
|
|
207
|
+
};
|
|
208
|
+
parentTaskId: {
|
|
209
|
+
type: string;
|
|
210
|
+
description: string;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
required: string[];
|
|
214
|
+
};
|
|
215
|
+
handler: (params: Record<string, unknown>) => Promise<{
|
|
216
|
+
success: boolean;
|
|
217
|
+
error: string;
|
|
218
|
+
result?: undefined;
|
|
219
|
+
config?: undefined;
|
|
220
|
+
} | {
|
|
221
|
+
success: boolean;
|
|
222
|
+
result: {
|
|
223
|
+
isDrift: boolean;
|
|
224
|
+
highestSimilarity: number;
|
|
225
|
+
mostSimilarTaskId: string | undefined;
|
|
226
|
+
mostSimilarTaskInput: string | undefined;
|
|
227
|
+
action: import("../../types.js").DriftDetectionAction;
|
|
228
|
+
checkedAncestors: number;
|
|
229
|
+
};
|
|
230
|
+
config: {
|
|
231
|
+
enabled: boolean;
|
|
232
|
+
threshold: number;
|
|
233
|
+
warningThreshold: number | undefined;
|
|
234
|
+
behavior: import("../../types.js").DriftDetectionBehavior;
|
|
235
|
+
};
|
|
236
|
+
error?: undefined;
|
|
237
|
+
}>;
|
|
238
|
+
};
|
|
239
|
+
task_get_relationships: {
|
|
240
|
+
name: string;
|
|
241
|
+
description: string;
|
|
242
|
+
inputSchema: {
|
|
243
|
+
type: string;
|
|
244
|
+
properties: {
|
|
245
|
+
taskId: {
|
|
246
|
+
type: string;
|
|
247
|
+
description: string;
|
|
248
|
+
};
|
|
249
|
+
direction: {
|
|
250
|
+
type: string;
|
|
251
|
+
enum: string[];
|
|
252
|
+
description: string;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
required: string[];
|
|
256
|
+
};
|
|
257
|
+
handler: (params: Record<string, unknown>) => Promise<{
|
|
258
|
+
success: boolean;
|
|
259
|
+
error: string;
|
|
260
|
+
count?: undefined;
|
|
261
|
+
relationships?: undefined;
|
|
262
|
+
} | {
|
|
263
|
+
success: boolean;
|
|
264
|
+
count: number;
|
|
265
|
+
relationships: {
|
|
266
|
+
id: string;
|
|
267
|
+
fromTaskId: string;
|
|
268
|
+
toTaskId: string;
|
|
269
|
+
relationshipType: import("../../types.js").TaskRelationshipType;
|
|
270
|
+
metadata: Record<string, unknown> | undefined;
|
|
271
|
+
createdAt: string;
|
|
272
|
+
}[];
|
|
273
|
+
error?: undefined;
|
|
274
|
+
}>;
|
|
275
|
+
};
|
|
276
|
+
task_drift_metrics: {
|
|
277
|
+
name: string;
|
|
278
|
+
description: string;
|
|
279
|
+
inputSchema: {
|
|
280
|
+
type: string;
|
|
281
|
+
properties: {
|
|
282
|
+
since: {
|
|
283
|
+
type: string;
|
|
284
|
+
description: string;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
handler: (params: Record<string, unknown>) => Promise<{
|
|
289
|
+
success: boolean;
|
|
290
|
+
error: string;
|
|
291
|
+
metrics?: undefined;
|
|
292
|
+
recentEvents?: undefined;
|
|
293
|
+
config?: undefined;
|
|
294
|
+
} | {
|
|
295
|
+
success: boolean;
|
|
296
|
+
metrics: {
|
|
297
|
+
totalEvents: number;
|
|
298
|
+
allowedCount: number;
|
|
299
|
+
warnedCount: number;
|
|
300
|
+
preventedCount: number;
|
|
301
|
+
averageSimilarity: number;
|
|
302
|
+
};
|
|
303
|
+
recentEvents: {
|
|
304
|
+
id: string;
|
|
305
|
+
taskId: string | undefined;
|
|
306
|
+
taskType: string;
|
|
307
|
+
ancestorTaskId: string;
|
|
308
|
+
similarityScore: number;
|
|
309
|
+
actionTaken: import("../../types.js").DriftDetectionAction;
|
|
310
|
+
createdAt: string;
|
|
311
|
+
}[];
|
|
312
|
+
config: {
|
|
313
|
+
enabled: boolean;
|
|
314
|
+
threshold: number;
|
|
315
|
+
warningThreshold: number | undefined;
|
|
316
|
+
ancestorDepth: number;
|
|
317
|
+
behavior: import("../../types.js").DriftDetectionBehavior;
|
|
318
|
+
};
|
|
319
|
+
error?: undefined;
|
|
320
|
+
}>;
|
|
321
|
+
};
|
|
169
322
|
};
|
|
170
323
|
//# 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;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"task-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/task-tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAyCpF,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,CAAC,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;0BAe7D,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAsFvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAgCvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAmCvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA8BvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAuCvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAsDvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA8CvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDpD"}
|