nightshift-mcp 1.0.8 → 1.0.9
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 +106 -31
- package/dist/context-store.d.ts +24 -0
- package/dist/context-store.d.ts.map +1 -0
- package/dist/context-store.js +118 -0
- package/dist/context-store.js.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/tool-registry.d.ts +3 -1
- package/dist/tool-registry.d.ts.map +1 -1
- package/dist/tool-registry.js +2 -0
- package/dist/tool-registry.js.map +1 -1
- package/dist/tools/agents.d.ts.map +1 -1
- package/dist/tools/agents.js +88 -8
- package/dist/tools/agents.js.map +1 -1
- package/dist/tools/context.d.ts +5 -0
- package/dist/tools/context.d.ts.map +1 -0
- package/dist/tools/context.js +138 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/trace.d.ts +4 -0
- package/dist/tools/trace.d.ts.map +1 -0
- package/dist/tools/trace.js +98 -0
- package/dist/tools/trace.js.map +1 -0
- package/dist/trace-manager.d.ts +65 -0
- package/dist/trace-manager.d.ts.map +1 -0
- package/dist/trace-manager.js +143 -0
- package/dist/trace-manager.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,8 @@ An MCP (Model Context Protocol) server for agent teams and multi-agent orchestra
|
|
|
14
14
|
- **Failover handling**: Seamless handoffs when an agent hits limits or context windows fill up
|
|
15
15
|
- **PRD-driven task management**: Work through user stories in prd.json with Zod-validated schemas and helpful error messages
|
|
16
16
|
- **Progress tracking**: Shared learnings via progress.txt
|
|
17
|
+
- **Selective context retrieval**: Topic-based context store lets agents query relevant context instead of prompt-stuffing
|
|
18
|
+
- **Execution tracing**: Structured trace of agent spawns, completions, and failures with parent-child tree visualization
|
|
17
19
|
- **Agent spawning & orchestration**: Spawn Claude, Codex, Gemini, or Vibe as subprocesses with full lifecycle tracking
|
|
18
20
|
- **Autonomous orchestration**: Single `orchestrate` tool runs a claim→implement→complete loop until all stories pass
|
|
19
21
|
- **Agent status tracking**: Monitor spawned agents by PID, check exit codes, and tail output in real-time
|
|
@@ -23,7 +25,7 @@ An MCP (Model Context Protocol) server for agent teams and multi-agent orchestra
|
|
|
23
25
|
- **Auto-archiving**: Archive old messages to keep the chat file manageable
|
|
24
26
|
- **Cross-platform**: Works on Windows, Linux, and macOS (uses cross-spawn and platform-safe process management)
|
|
25
27
|
- **Heterogeneous agent teams**: Mix different AI models — use each for what it's best at
|
|
26
|
-
- **Universal compatibility**: Works with any MCP-supporting tool (
|
|
28
|
+
- **Universal compatibility**: Works with any MCP-supporting tool (49 tools across 10 categories)
|
|
27
29
|
- **Simple file-based storage**: No external services required
|
|
28
30
|
|
|
29
31
|
## Installation
|
|
@@ -374,36 +376,107 @@ Add a reusable pattern to the Codebase Patterns section.
|
|
|
374
376
|
**Parameters:**
|
|
375
377
|
- `pattern` (required): The pattern (e.g., "Use sql<number> for aggregations")
|
|
376
378
|
|
|
379
|
+
### Context Store
|
|
380
|
+
|
|
381
|
+
NightShift includes a selective context retrieval system that replaces prompt-stuffing with topic-based queries. Instead of truncating progress.txt to fit the context window, agents can store and retrieve relevant context on demand.
|
|
382
|
+
|
|
383
|
+
Context entries are stored as individual JSON files in `.robot-chat/context/` for concurrent-safe multi-agent access.
|
|
384
|
+
|
|
385
|
+
#### `store_context`
|
|
386
|
+
Store a context entry for other agents to query later.
|
|
387
|
+
|
|
388
|
+
**Parameters:**
|
|
389
|
+
- `topic` (required): Topic/category (e.g., "authentication", "database-schema")
|
|
390
|
+
- `content` (required): The context to store (learnings, decisions, findings)
|
|
391
|
+
- `agent` (required): Your agent name
|
|
392
|
+
- `tags` (optional): Tags for better searchability (e.g., ["auth", "jwt"])
|
|
393
|
+
|
|
394
|
+
**Example:**
|
|
395
|
+
```
|
|
396
|
+
store_context(topic: "authentication", content: "Using JWT with RS256. Refresh tokens stored in httpOnly cookies.", agent: "Claude", tags: ["jwt", "cookies"])
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
#### `query_context`
|
|
400
|
+
Search stored context entries by topic.
|
|
401
|
+
|
|
402
|
+
**Parameters:**
|
|
403
|
+
- `topic` (required): Search term (case-insensitive match on topic and tags)
|
|
404
|
+
- `limit` (optional): Max entries to return (default: 10)
|
|
405
|
+
|
|
406
|
+
**Example:**
|
|
407
|
+
```
|
|
408
|
+
query_context(topic: "auth")
|
|
409
|
+
# Returns all entries matching "auth" in topic or tags, sorted by recency
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
#### `list_context`
|
|
413
|
+
List all topics in the context store with entry counts.
|
|
414
|
+
|
|
415
|
+
**How delegation uses context:**
|
|
416
|
+
|
|
417
|
+
When `delegate_story` or `delegate_research` spawns an agent, it queries the context store for entries relevant to the task and includes them in the prompt — instead of blindly truncating progress.txt. Agents are also instructed to use `store_context` to save their learnings, creating a self-enriching context loop.
|
|
418
|
+
|
|
419
|
+
### Execution Tracing
|
|
420
|
+
|
|
421
|
+
NightShift automatically traces all agent spawns, completions, and failures into a structured execution log at `.robot-chat/trace.json`. Each trace event has parent-child relationships that can be reconstructed as a tree for debugging multi-agent runs.
|
|
422
|
+
|
|
423
|
+
#### `get_trace`
|
|
424
|
+
View the execution trace as a flat list or tree.
|
|
425
|
+
|
|
426
|
+
**Parameters:**
|
|
427
|
+
- `tree` (optional): Return as tree with parent-child relationships (default: false)
|
|
428
|
+
- `taskId` (optional): Filter by story/task ID
|
|
429
|
+
|
|
430
|
+
**Example:**
|
|
431
|
+
```
|
|
432
|
+
get_trace(tree: true)
|
|
433
|
+
# Returns tree showing: orchestrator → spawned claude (US-001) → completed
|
|
434
|
+
# orchestrator → spawned codex (US-002) → failed → retried with gemini → completed
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
#### `clear_trace`
|
|
438
|
+
Reset the trace for a fresh orchestration run.
|
|
439
|
+
|
|
440
|
+
**What gets traced automatically:**
|
|
441
|
+
- `spawn_agent` and `spawn_agent_background` calls
|
|
442
|
+
- `delegate_story` and `delegate_research` delegations
|
|
443
|
+
- `orchestrate` decisions (inline mode)
|
|
444
|
+
- Agent completions with exit codes
|
|
445
|
+
- Agent failures with error details
|
|
446
|
+
|
|
447
|
+
Each trace event includes metadata: agent type, story ID, prompt length, exit code, and timing.
|
|
448
|
+
|
|
377
449
|
### Autonomous Workflow
|
|
378
450
|
|
|
379
451
|
With multiple agents working together:
|
|
380
452
|
|
|
381
453
|
```
|
|
382
|
-
|
|
383
|
-
│
|
|
384
|
-
|
|
385
|
-
│
|
|
386
|
-
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐
|
|
387
|
-
│ │ Claude │ │ Codex │ │ Gemini │ │ Vibe │
|
|
388
|
-
│ └───┬────┘ └───┬────┘ └───┬────┘ └───┬────┘
|
|
389
|
-
│ │ │ │ │
|
|
390
|
-
│ └───────────┴─────┬─────┴───────────┘
|
|
391
|
-
│
|
|
392
|
-
│
|
|
393
|
-
│
|
|
394
|
-
│ │
|
|
395
|
-
│ │
|
|
396
|
-
│
|
|
397
|
-
│
|
|
398
|
-
│
|
|
399
|
-
│ │
|
|
400
|
-
│ ▼
|
|
401
|
-
│
|
|
402
|
-
│
|
|
403
|
-
│
|
|
404
|
-
│
|
|
405
|
-
│
|
|
406
|
-
|
|
454
|
+
┌──────────────────────────────────────────────────────────────────┐
|
|
455
|
+
│ NightShift Workflow │
|
|
456
|
+
├──────────────────────────────────────────────────────────────────┤
|
|
457
|
+
│ │
|
|
458
|
+
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │
|
|
459
|
+
│ │ Claude │ │ Codex │ │ Gemini │ │ Vibe │ │
|
|
460
|
+
│ └───┬────┘ └───┬────┘ └───┬────┘ └───┬────┘ │
|
|
461
|
+
│ │ │ │ │ │
|
|
462
|
+
│ └───────────┴─────┬─────┴───────────┘ │
|
|
463
|
+
│ │ │
|
|
464
|
+
│ ▼ │
|
|
465
|
+
│ ┌──────────────────┐ │
|
|
466
|
+
│ │ .robot-chat/ │ ◄── Agent coordination │
|
|
467
|
+
│ │ chat.txt │ │
|
|
468
|
+
│ └──────────────────┘ │
|
|
469
|
+
│ │ │
|
|
470
|
+
│ ┌──────────┬────────┼────────┬──────────┐ │
|
|
471
|
+
│ │ │ │ │ │ │
|
|
472
|
+
│ ▼ ▼ ▼ ▼ ▼ │
|
|
473
|
+
│ ┌────────┐ ┌────────┐ ┌────┐ ┌──────────┐ ┌──────────┐ │
|
|
474
|
+
│ │prd.json│ │progress│ │Code│ │ context/ │ │trace.json│ │
|
|
475
|
+
│ │(tasks) │ │ .txt │ │ │ │(per-topic│ │(execution│ │
|
|
476
|
+
│ │ │ │ │ │ │ │ queries) │ │ tree) │ │
|
|
477
|
+
│ └────────┘ └────────┘ └────┘ └──────────┘ └──────────┘ │
|
|
478
|
+
│ │
|
|
479
|
+
└──────────────────────────────────────────────────────────────────┘
|
|
407
480
|
```
|
|
408
481
|
|
|
409
482
|
Each agent:
|
|
@@ -639,15 +712,16 @@ delegate_story(agent: "gemini", storyId: "US-003", background: true)
|
|
|
639
712
|
|
|
640
713
|
The spawned agent receives:
|
|
641
714
|
- Full story description and acceptance criteria
|
|
642
|
-
-
|
|
715
|
+
- Relevant context from the context store (or progress.txt as fallback)
|
|
643
716
|
- Recent chat messages for context
|
|
644
|
-
- Instructions to use nightshift tools for coordination
|
|
717
|
+
- Instructions to use nightshift tools for coordination (including `store_context` and `query_context`)
|
|
645
718
|
|
|
646
719
|
#### `delegate_research`
|
|
647
|
-
Delegate a research or planning task to Gemini. Ideal for read-only tasks like codebase analysis, architecture planning, code review, and documentation.
|
|
720
|
+
Delegate a research or planning task to an agent (default: Gemini). Ideal for read-only tasks like codebase analysis, architecture planning, code review, and documentation. Queries the context store for relevant prior findings.
|
|
648
721
|
|
|
649
722
|
**Parameters:**
|
|
650
723
|
- `task` (required): The research/planning task description
|
|
724
|
+
- `agent` (optional): Which agent to use (default: gemini)
|
|
651
725
|
- `context` (optional): Additional context to provide
|
|
652
726
|
- `background` (optional): Run in background (default: false)
|
|
653
727
|
|
|
@@ -788,12 +862,13 @@ The daemon provides hands-off multi-agent orchestration:
|
|
|
788
862
|
1. **Same directory**: All agents must run in the same project directory to share chat
|
|
789
863
|
2. **Claim before working**: Always claim stories to prevent duplicate work
|
|
790
864
|
3. **Post status updates**: Keep other agents informed of progress
|
|
791
|
-
4. **
|
|
865
|
+
4. **Store context, not just progress**: Use `store_context` to share learnings by topic — other agents can query for exactly what they need instead of reading a giant progress file
|
|
792
866
|
5. **Handle failovers**: Check for and claim failovers at the start of each session
|
|
793
867
|
6. **Use delegation**: One orchestrating agent can spawn others for parallel work
|
|
794
868
|
7. **Monitor background agents**: Use `get_agent_status` and `list_running_agents` to track spawned agents
|
|
795
869
|
8. **Use `orchestrate` for full autonomy**: The `orchestrate` tool handles the entire claim→implement→complete loop
|
|
796
|
-
9. **
|
|
870
|
+
9. **Review traces after runs**: Use `get_trace(tree: true)` to understand what happened during orchestration
|
|
871
|
+
10. **Add `.robot-chat/` to your project's `.gitignore`**: Chat logs, context, and traces are ephemeral and shouldn't be committed
|
|
797
872
|
|
|
798
873
|
## License
|
|
799
874
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ContextEntry {
|
|
2
|
+
id: string;
|
|
3
|
+
topic: string;
|
|
4
|
+
content: string;
|
|
5
|
+
agent: string;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
tags: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare class ContextStore {
|
|
10
|
+
private readonly contextDir;
|
|
11
|
+
constructor(projectPath: string);
|
|
12
|
+
private ensureContextDir;
|
|
13
|
+
private getEntryPath;
|
|
14
|
+
private readAllEntries;
|
|
15
|
+
write(topic: string, content: string, agent: string, tags?: string[]): ContextEntry;
|
|
16
|
+
query(topic: string, limit?: number): ContextEntry[];
|
|
17
|
+
list(): Array<{
|
|
18
|
+
topic: string;
|
|
19
|
+
count: number;
|
|
20
|
+
lastUpdated: string;
|
|
21
|
+
}>;
|
|
22
|
+
delete(id: string): boolean;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=context-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-store.d.ts","sourceRoot":"","sources":["../src/context-store.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,WAAW,EAAE,MAAM;IAK/B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,cAAc;IAqCtB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,EAAO,GAAG,YAAY;IAkBvF,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,YAAY,EAAE;IAoBxD,IAAI,IAAI,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAuBpE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;CAY5B"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { randomUUID } from "crypto";
|
|
4
|
+
export class ContextStore {
|
|
5
|
+
contextDir;
|
|
6
|
+
constructor(projectPath) {
|
|
7
|
+
this.contextDir = path.join(projectPath, ".robot-chat", "context");
|
|
8
|
+
this.ensureContextDir();
|
|
9
|
+
}
|
|
10
|
+
ensureContextDir() {
|
|
11
|
+
if (!fs.existsSync(this.contextDir)) {
|
|
12
|
+
fs.mkdirSync(this.contextDir, { recursive: true });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
getEntryPath(id) {
|
|
16
|
+
return path.join(this.contextDir, `${id}.json`);
|
|
17
|
+
}
|
|
18
|
+
readAllEntries() {
|
|
19
|
+
this.ensureContextDir();
|
|
20
|
+
let files = [];
|
|
21
|
+
try {
|
|
22
|
+
files = fs
|
|
23
|
+
.readdirSync(this.contextDir, { withFileTypes: true })
|
|
24
|
+
.filter((d) => d.isFile() && d.name.endsWith(".json"))
|
|
25
|
+
.map((d) => path.join(this.contextDir, d.name));
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
const entries = [];
|
|
31
|
+
for (const file of files) {
|
|
32
|
+
try {
|
|
33
|
+
const raw = fs.readFileSync(file, "utf-8");
|
|
34
|
+
const data = JSON.parse(raw);
|
|
35
|
+
// Basic shape validation
|
|
36
|
+
if (data &&
|
|
37
|
+
typeof data.id === "string" &&
|
|
38
|
+
typeof data.topic === "string" &&
|
|
39
|
+
typeof data.content === "string" &&
|
|
40
|
+
typeof data.agent === "string" &&
|
|
41
|
+
typeof data.timestamp === "string" &&
|
|
42
|
+
Array.isArray(data.tags)) {
|
|
43
|
+
entries.push(data);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Skip malformed files
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return entries;
|
|
52
|
+
}
|
|
53
|
+
write(topic, content, agent, tags = []) {
|
|
54
|
+
this.ensureContextDir();
|
|
55
|
+
const id = randomUUID();
|
|
56
|
+
const timestamp = new Date().toISOString();
|
|
57
|
+
const entry = {
|
|
58
|
+
id,
|
|
59
|
+
topic,
|
|
60
|
+
content,
|
|
61
|
+
agent,
|
|
62
|
+
timestamp,
|
|
63
|
+
tags: Array.isArray(tags) ? tags : [],
|
|
64
|
+
};
|
|
65
|
+
const filePath = this.getEntryPath(id);
|
|
66
|
+
fs.writeFileSync(filePath, JSON.stringify(entry, null, 2), "utf-8");
|
|
67
|
+
return entry;
|
|
68
|
+
}
|
|
69
|
+
query(topic, limit = 10) {
|
|
70
|
+
const q = (topic || "").toLowerCase();
|
|
71
|
+
if (!q) {
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
const entries = this.readAllEntries();
|
|
75
|
+
const matches = entries.filter((e) => {
|
|
76
|
+
const inTopic = e.topic.toLowerCase().includes(q);
|
|
77
|
+
const inTags = (e.tags || []).some((t) => t.toLowerCase().includes(q));
|
|
78
|
+
return inTopic || inTags;
|
|
79
|
+
});
|
|
80
|
+
matches.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
|
|
81
|
+
return matches.slice(0, Math.max(0, limit));
|
|
82
|
+
}
|
|
83
|
+
list() {
|
|
84
|
+
const entries = this.readAllEntries();
|
|
85
|
+
const map = new Map();
|
|
86
|
+
for (const e of entries) {
|
|
87
|
+
const existing = map.get(e.topic);
|
|
88
|
+
if (!existing) {
|
|
89
|
+
map.set(e.topic, { count: 1, lastUpdated: e.timestamp });
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
existing.count += 1;
|
|
93
|
+
if (new Date(e.timestamp).getTime() > new Date(existing.lastUpdated).getTime()) {
|
|
94
|
+
existing.lastUpdated = e.timestamp;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return Array.from(map.entries()).map(([topic, v]) => ({
|
|
99
|
+
topic,
|
|
100
|
+
count: v.count,
|
|
101
|
+
lastUpdated: v.lastUpdated,
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
delete(id) {
|
|
105
|
+
const filePath = this.getEntryPath(id);
|
|
106
|
+
if (fs.existsSync(filePath)) {
|
|
107
|
+
try {
|
|
108
|
+
fs.unlinkSync(filePath);
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=context-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-store.js","sourceRoot":"","sources":["../src/context-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAWpC,MAAM,OAAO,YAAY;IACN,UAAU,CAAS;IAEpC,YAAY,WAAmB;QAC7B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;QACnE,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YACpC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAEO,YAAY,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAEO,cAAc;QACpB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,KAAK,GAAa,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,KAAK,GAAG,EAAE;iBACP,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,E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CAAC;IACN,CAAC;IAED,MAAM,CAAC,EAAU;QACf,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACvC,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,IAAI,CAAC;gBACH,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;gBACxB,OAAO,IAAI,CAAC;YACd,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,8 @@ import * as path from "path";
|
|
|
7
7
|
import { ChatManager } from "./chat-manager.js";
|
|
8
8
|
import { RalphManager } from "./ralph-manager.js";
|
|
9
9
|
import { WorkflowManager } from "./workflow-manager.js";
|
|
10
|
+
import { ContextStore } from "./context-store.js";
|
|
11
|
+
import { TraceManager } from "./trace-manager.js";
|
|
10
12
|
import { spawnAgent, spawnAgentBackground, getAvailableAgents, getAgentStatus, } from "./agent-spawner.js";
|
|
11
13
|
import { toolRegistry } from "./tool-registry.js";
|
|
12
14
|
import { allTools, toolCounts } from "./tools/index.js";
|
|
@@ -22,11 +24,15 @@ const REGISTRATION_MODE = (process.env.NIGHTSHIFT_TOOLS || "hybrid");
|
|
|
22
24
|
const chatManager = new ChatManager(PROJECT_PATH);
|
|
23
25
|
const ralphManager = new RalphManager(PROJECT_PATH);
|
|
24
26
|
const workflowManager = new WorkflowManager(PROJECT_PATH);
|
|
27
|
+
const contextStore = new ContextStore(PROJECT_PATH);
|
|
28
|
+
const traceManager = new TraceManager(PROJECT_PATH);
|
|
25
29
|
// Tool execution context
|
|
26
30
|
const toolContext = {
|
|
27
31
|
chatManager,
|
|
28
32
|
ralphManager,
|
|
29
33
|
workflowManager,
|
|
34
|
+
contextStore,
|
|
35
|
+
traceManager,
|
|
30
36
|
projectPath: PROJECT_PATH,
|
|
31
37
|
};
|
|
32
38
|
// Register all tools with the registry
|