nightshift-mcp 2.0.1 → 2.1.1
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 +46 -15
- package/dist/agent-spawner.d.ts +9 -0
- package/dist/agent-spawner.d.ts.map +1 -1
- package/dist/agent-spawner.js +88 -5
- package/dist/agent-spawner.js.map +1 -1
- package/dist/daemon.d.ts +19 -5
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +220 -36
- package/dist/daemon.js.map +1 -1
- package/dist/database.d.ts +2 -2
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +4 -4
- package/dist/database.js.map +1 -1
- package/dist/index.js +219 -1146
- package/dist/index.js.map +1 -1
- package/dist/orchestrator.d.ts +12 -1
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +245 -15
- package/dist/orchestrator.js.map +1 -1
- package/dist/pipeline.d.ts +61 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +227 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/project-context.d.ts +28 -0
- package/dist/project-context.d.ts.map +1 -0
- package/dist/project-context.js +45 -0
- package/dist/project-context.js.map +1 -0
- package/dist/run-logger.d.ts +61 -0
- package/dist/run-logger.d.ts.map +1 -0
- package/dist/run-logger.js +219 -0
- package/dist/run-logger.js.map +1 -0
- package/dist/tools/agents.d.ts +3 -0
- package/dist/tools/agents.d.ts.map +1 -1
- package/dist/tools/agents.js +148 -5
- package/dist/tools/agents.js.map +1 -1
- package/dist/tools/bugs.d.ts.map +1 -1
- package/dist/tools/bugs.js +48 -22
- package/dist/tools/bugs.js.map +1 -1
- package/dist/tools/chat.d.ts.map +1 -1
- package/dist/tools/chat.js +47 -20
- package/dist/tools/chat.js.map +1 -1
- package/dist/tools/prd.d.ts.map +1 -1
- package/dist/tools/prd.js +67 -31
- package/dist/tools/prd.js.map +1 -1
- package/dist/tools/progress.d.ts.map +1 -1
- package/dist/tools/progress.js +22 -7
- package/dist/tools/progress.js.map +1 -1
- package/dist/tools/utility.js +2 -2
- package/dist/tools/utility.js.map +1 -1
- package/package.json +1 -1
package/dist/pipeline.js
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NightShift Pipeline Configuration
|
|
3
|
+
*
|
|
4
|
+
* Defines agent pipelines for story execution.
|
|
5
|
+
* Zero config required — auto-detects available agents and uses smart defaults.
|
|
6
|
+
* Users can customize via set_pipeline tool or nightshift.config.json.
|
|
7
|
+
*/
|
|
8
|
+
import * as fs from "fs";
|
|
9
|
+
import * as path from "path";
|
|
10
|
+
import { canAgentRun } from "./agent-spawner.js";
|
|
11
|
+
// ============================================
|
|
12
|
+
// Built-in Defaults
|
|
13
|
+
// ============================================
|
|
14
|
+
const DEFAULT_PIPELINES = {
|
|
15
|
+
pipelines: {
|
|
16
|
+
default: [
|
|
17
|
+
{ agent: "gemini", role: "planner", optional: true, timeout: 600 },
|
|
18
|
+
{ agent: "codex", role: "implementer", optional: false, timeout: 900 },
|
|
19
|
+
{ agent: "claude", role: "verifier", optional: true, timeout: 120 },
|
|
20
|
+
],
|
|
21
|
+
frontend: [
|
|
22
|
+
{ agent: "gemini", role: "planner", optional: true, timeout: 600 },
|
|
23
|
+
{ agent: "codex", role: "implementer", optional: false, timeout: 900 },
|
|
24
|
+
{ agent: "claude", role: "verifier", optional: true, timeout: 120 },
|
|
25
|
+
],
|
|
26
|
+
backend: [
|
|
27
|
+
{ agent: "ollama", role: "drafter", optional: true, timeout: 300 },
|
|
28
|
+
{ agent: "codex", role: "implementer", optional: false, timeout: 900 },
|
|
29
|
+
{ agent: "claude", role: "verifier", optional: true, timeout: 120 },
|
|
30
|
+
],
|
|
31
|
+
research: [
|
|
32
|
+
{ agent: "gemini", role: "researcher", optional: false, timeout: 600 },
|
|
33
|
+
],
|
|
34
|
+
quick: [
|
|
35
|
+
{ agent: "codex", role: "implementer", optional: false, timeout: 600 },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
tagRouting: {
|
|
39
|
+
frontend: "frontend",
|
|
40
|
+
ui: "frontend",
|
|
41
|
+
react: "frontend",
|
|
42
|
+
css: "frontend",
|
|
43
|
+
api: "backend",
|
|
44
|
+
backend: "backend",
|
|
45
|
+
database: "backend",
|
|
46
|
+
db: "backend",
|
|
47
|
+
research: "research",
|
|
48
|
+
analysis: "research",
|
|
49
|
+
quick: "quick",
|
|
50
|
+
hotfix: "quick",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
// ============================================
|
|
54
|
+
// Config File Management
|
|
55
|
+
// ============================================
|
|
56
|
+
const CONFIG_FILENAME = "nightshift.config.json";
|
|
57
|
+
/**
|
|
58
|
+
* Load pipeline config. Merges: defaults → config file → runtime overrides.
|
|
59
|
+
*/
|
|
60
|
+
export function loadPipelineConfig(projectPath) {
|
|
61
|
+
const configFile = path.join(projectPath, CONFIG_FILENAME);
|
|
62
|
+
// Start with defaults
|
|
63
|
+
let config = JSON.parse(JSON.stringify(DEFAULT_PIPELINES));
|
|
64
|
+
// Merge config file if it exists
|
|
65
|
+
if (fs.existsSync(configFile)) {
|
|
66
|
+
try {
|
|
67
|
+
const fileConfig = JSON.parse(fs.readFileSync(configFile, "utf-8"));
|
|
68
|
+
// Merge pipelines (file overrides defaults, doesn't replace all)
|
|
69
|
+
if (fileConfig.pipelines) {
|
|
70
|
+
config.pipelines = { ...config.pipelines, ...fileConfig.pipelines };
|
|
71
|
+
}
|
|
72
|
+
if (fileConfig.tagRouting) {
|
|
73
|
+
config.tagRouting = { ...config.tagRouting, ...fileConfig.tagRouting };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Bad config file — use defaults silently
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Check for runtime override in .robot-chat
|
|
81
|
+
const runtimeFile = path.join(projectPath, ".robot-chat", "pipeline-override.json");
|
|
82
|
+
if (fs.existsSync(runtimeFile)) {
|
|
83
|
+
try {
|
|
84
|
+
const runtimeConfig = JSON.parse(fs.readFileSync(runtimeFile, "utf-8"));
|
|
85
|
+
if (runtimeConfig.pipelines) {
|
|
86
|
+
config.pipelines = { ...config.pipelines, ...runtimeConfig.pipelines };
|
|
87
|
+
}
|
|
88
|
+
if (runtimeConfig.tagRouting) {
|
|
89
|
+
config.tagRouting = { ...config.tagRouting, ...runtimeConfig.tagRouting };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// Bad runtime file — ignore
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return config;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Save a runtime pipeline override (persists across tool calls but not across projects).
|
|
100
|
+
*/
|
|
101
|
+
export function savePipelineOverride(projectPath, overrides) {
|
|
102
|
+
const dir = path.join(projectPath, ".robot-chat");
|
|
103
|
+
if (!fs.existsSync(dir)) {
|
|
104
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
105
|
+
}
|
|
106
|
+
const runtimeFile = path.join(dir, "pipeline-override.json");
|
|
107
|
+
// Load existing overrides and merge
|
|
108
|
+
let existing = {};
|
|
109
|
+
if (fs.existsSync(runtimeFile)) {
|
|
110
|
+
try {
|
|
111
|
+
existing = JSON.parse(fs.readFileSync(runtimeFile, "utf-8"));
|
|
112
|
+
}
|
|
113
|
+
catch { /* ignore */ }
|
|
114
|
+
}
|
|
115
|
+
const merged = {
|
|
116
|
+
pipelines: { ...existing.pipelines, ...overrides.pipelines },
|
|
117
|
+
tagRouting: { ...existing.tagRouting, ...overrides.tagRouting },
|
|
118
|
+
};
|
|
119
|
+
fs.writeFileSync(runtimeFile, JSON.stringify(merged, null, 2), "utf-8");
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Clear runtime pipeline overrides (revert to defaults + config file).
|
|
123
|
+
*/
|
|
124
|
+
export function clearPipelineOverride(projectPath) {
|
|
125
|
+
const runtimeFile = path.join(projectPath, ".robot-chat", "pipeline-override.json");
|
|
126
|
+
if (fs.existsSync(runtimeFile)) {
|
|
127
|
+
fs.unlinkSync(runtimeFile);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// ============================================
|
|
131
|
+
// Pipeline Resolution
|
|
132
|
+
// ============================================
|
|
133
|
+
/**
|
|
134
|
+
* Pick the right pipeline for a story based on its tags.
|
|
135
|
+
* Falls back to "default" if no tags match.
|
|
136
|
+
*/
|
|
137
|
+
export function resolvePipelineName(config, storyTags) {
|
|
138
|
+
if (!storyTags || storyTags.length === 0 || !config.tagRouting) {
|
|
139
|
+
return "default";
|
|
140
|
+
}
|
|
141
|
+
// Check each tag against routing rules
|
|
142
|
+
for (const tag of storyTags) {
|
|
143
|
+
const normalizedTag = tag.toLowerCase().trim();
|
|
144
|
+
const pipelineName = config.tagRouting[normalizedTag];
|
|
145
|
+
if (pipelineName && config.pipelines[pipelineName]) {
|
|
146
|
+
return pipelineName;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return "default";
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get the executable pipeline for a story — filters out unavailable agents.
|
|
153
|
+
* Returns only steps that can actually run right now.
|
|
154
|
+
*/
|
|
155
|
+
export async function resolveExecutablePipeline(projectPath, storyTags, pipelineName) {
|
|
156
|
+
const config = loadPipelineConfig(projectPath);
|
|
157
|
+
// Resolve which pipeline to use
|
|
158
|
+
const name = pipelineName || resolvePipelineName(config, storyTags);
|
|
159
|
+
const pipeline = config.pipelines[name] || config.pipelines["default"];
|
|
160
|
+
if (!pipeline) {
|
|
161
|
+
return { name, steps: [], skipped: [] };
|
|
162
|
+
}
|
|
163
|
+
// Check agent availability
|
|
164
|
+
const steps = [];
|
|
165
|
+
const skipped = [];
|
|
166
|
+
for (const step of pipeline) {
|
|
167
|
+
const status = await canAgentRun(step.agent);
|
|
168
|
+
if (status.canRun) {
|
|
169
|
+
steps.push(step);
|
|
170
|
+
}
|
|
171
|
+
else if (step.optional !== false) {
|
|
172
|
+
// Optional step, skip silently
|
|
173
|
+
skipped.push({ agent: step.agent, role: step.role, reason: status.reason || "not available" });
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
// Required step not available — try to find a substitute
|
|
177
|
+
const substitute = await findSubstitute(step);
|
|
178
|
+
if (substitute) {
|
|
179
|
+
steps.push({ ...step, agent: substitute });
|
|
180
|
+
skipped.push({ agent: step.agent, role: step.role, reason: `substituted with ${substitute}` });
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
skipped.push({ agent: step.agent, role: step.role, reason: status.reason || "not available (required, no substitute)" });
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return { name, steps, skipped };
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Find a substitute agent for a required step that can't run.
|
|
191
|
+
*/
|
|
192
|
+
async function findSubstitute(step) {
|
|
193
|
+
// Substitution preferences by role
|
|
194
|
+
const substitutions = {
|
|
195
|
+
planner: ["claude", "ollama"],
|
|
196
|
+
drafter: ["gemini", "claude"],
|
|
197
|
+
implementer: ["claude", "vibe", "ollama"],
|
|
198
|
+
verifier: ["codex", "gemini"],
|
|
199
|
+
reviewer: ["claude", "gemini"],
|
|
200
|
+
researcher: ["claude", "ollama"],
|
|
201
|
+
fixer: ["claude", "codex"],
|
|
202
|
+
};
|
|
203
|
+
const candidates = substitutions[step.role] || ["claude", "codex", "gemini"];
|
|
204
|
+
for (const candidate of candidates) {
|
|
205
|
+
if (candidate === step.agent)
|
|
206
|
+
continue; // already failed
|
|
207
|
+
const status = await canAgentRun(candidate);
|
|
208
|
+
if (status.canRun)
|
|
209
|
+
return candidate;
|
|
210
|
+
}
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Get all available pipeline names and their steps.
|
|
215
|
+
*/
|
|
216
|
+
export function listPipelines(projectPath) {
|
|
217
|
+
const config = loadPipelineConfig(projectPath);
|
|
218
|
+
return config.pipelines;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Get the tag routing rules.
|
|
222
|
+
*/
|
|
223
|
+
export function getTagRouting(projectPath) {
|
|
224
|
+
const config = loadPipelineConfig(projectPath);
|
|
225
|
+
return config.tagRouting || {};
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAsB,WAAW,EAAkB,MAAM,oBAAoB,CAAC;AAsBrF,+CAA+C;AAC/C,oBAAoB;AACpB,+CAA+C;AAE/C,MAAM,iBAAiB,GAAmB;IACxC,SAAS,EAAE;QACT,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE;YAClE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE;YACtE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE;SACpE;QACD,QAAQ,EAAE;YACR,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE;YAClE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE;YACtE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE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,WAAW,CAAC,CAAC;IAC/C,OAAO,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ChatManager } from "./chat-manager.js";
|
|
2
|
+
import { RalphManager } from "./ralph-manager.js";
|
|
3
|
+
import { WorkflowManager } from "./workflow-manager.js";
|
|
4
|
+
import { ContextStore } from "./context-store.js";
|
|
5
|
+
import { TraceManager } from "./trace-manager.js";
|
|
6
|
+
export interface ProjectManagers {
|
|
7
|
+
projectPath: string;
|
|
8
|
+
chatManager: ChatManager;
|
|
9
|
+
ralphManager: RalphManager;
|
|
10
|
+
workflowManager: WorkflowManager;
|
|
11
|
+
contextStore: ContextStore;
|
|
12
|
+
traceManager: TraceManager;
|
|
13
|
+
}
|
|
14
|
+
export interface ProjectFilesReport {
|
|
15
|
+
prdJson: boolean;
|
|
16
|
+
progressTxt: boolean;
|
|
17
|
+
bugsJson: boolean;
|
|
18
|
+
gitignore: boolean;
|
|
19
|
+
robotChatDir: boolean;
|
|
20
|
+
chatTxt: boolean;
|
|
21
|
+
workflowJson: boolean;
|
|
22
|
+
contextDir: boolean;
|
|
23
|
+
traceJson: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function validateProjectPath(projectPath: string): string;
|
|
26
|
+
export declare function getProjectFilesReport(projectPath: string): ProjectFilesReport;
|
|
27
|
+
export declare function createProjectManagers(projectPath: string): ProjectManagers;
|
|
28
|
+
//# sourceMappingURL=project-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-context.d.ts","sourceRoot":"","sources":["../src/project-context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,eAAe,CAAC;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAa/D;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,CAe7E;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAW1E"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { ChatManager } from "./chat-manager.js";
|
|
4
|
+
import { RalphManager } from "./ralph-manager.js";
|
|
5
|
+
import { WorkflowManager } from "./workflow-manager.js";
|
|
6
|
+
import { ContextStore } from "./context-store.js";
|
|
7
|
+
import { TraceManager } from "./trace-manager.js";
|
|
8
|
+
export function validateProjectPath(projectPath) {
|
|
9
|
+
const resolvedPath = path.resolve(projectPath);
|
|
10
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
11
|
+
throw new Error(`Project path does not exist: ${resolvedPath}`);
|
|
12
|
+
}
|
|
13
|
+
const stat = fs.statSync(resolvedPath);
|
|
14
|
+
if (!stat.isDirectory()) {
|
|
15
|
+
throw new Error(`Project path is not a directory: ${resolvedPath}`);
|
|
16
|
+
}
|
|
17
|
+
return resolvedPath;
|
|
18
|
+
}
|
|
19
|
+
export function getProjectFilesReport(projectPath) {
|
|
20
|
+
const resolvedPath = validateProjectPath(projectPath);
|
|
21
|
+
const robotChatDir = path.join(resolvedPath, ".robot-chat");
|
|
22
|
+
return {
|
|
23
|
+
prdJson: fs.existsSync(path.join(resolvedPath, "prd.json")),
|
|
24
|
+
progressTxt: fs.existsSync(path.join(resolvedPath, "progress.txt")),
|
|
25
|
+
bugsJson: fs.existsSync(path.join(resolvedPath, "bugs.json")),
|
|
26
|
+
gitignore: fs.existsSync(path.join(resolvedPath, ".gitignore")),
|
|
27
|
+
robotChatDir: fs.existsSync(robotChatDir),
|
|
28
|
+
chatTxt: fs.existsSync(path.join(robotChatDir, "chat.txt")),
|
|
29
|
+
workflowJson: fs.existsSync(path.join(robotChatDir, "workflow.json")),
|
|
30
|
+
contextDir: fs.existsSync(path.join(robotChatDir, "context")),
|
|
31
|
+
traceJson: fs.existsSync(path.join(robotChatDir, "trace.json")),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function createProjectManagers(projectPath) {
|
|
35
|
+
const resolvedPath = validateProjectPath(projectPath);
|
|
36
|
+
return {
|
|
37
|
+
projectPath: resolvedPath,
|
|
38
|
+
chatManager: new ChatManager(resolvedPath),
|
|
39
|
+
ralphManager: new RalphManager(resolvedPath),
|
|
40
|
+
workflowManager: new WorkflowManager(resolvedPath),
|
|
41
|
+
contextStore: new ContextStore(resolvedPath),
|
|
42
|
+
traceManager: new TraceManager(resolvedPath),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=project-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-context.js","sourceRoot":"","sources":["../src/project-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,I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,YAAY,EAAE,WAAW,CAAC,CAAC;QAC7D,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAC/D,YAAY,EAAE,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;QACzC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAC3D,YAAY,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;QACrE,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QAC7D,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;KAChE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,WAAmB;IACvD,MAAM,YAAY,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAEtD,OAAO;QACL,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,IAAI,WAAW,CAAC,YAAY,CAAC;QAC1C,YAAY,EAAE,IAAI,YAAY,CAAC,YAAY,CAAC;QAC5C,eAAe,EAAE,IAAI,eAAe,CAAC,YAAY,CAAC;QAClD,YAAY,EAAE,IAAI,YAAY,CAAC,YAAY,CAAC;QAC5C,YAAY,EAAE,IAAI,YAAY,CAAC,YAAY,CAAC;KAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { AgentType } from "./agent-spawner.js";
|
|
2
|
+
export interface RunLogEntry {
|
|
3
|
+
timestamp: string;
|
|
4
|
+
agent: AgentType;
|
|
5
|
+
role?: string;
|
|
6
|
+
storyId?: string;
|
|
7
|
+
duration_seconds: number;
|
|
8
|
+
status: "completed" | "failed" | "rate_limited" | "timeout";
|
|
9
|
+
exitCode: number | null;
|
|
10
|
+
tokens?: TokenUsage;
|
|
11
|
+
rateLimitInfo?: RateLimitInfo;
|
|
12
|
+
toolsUsed?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface TokenUsage {
|
|
15
|
+
input?: number;
|
|
16
|
+
output?: number;
|
|
17
|
+
total?: number;
|
|
18
|
+
model?: string;
|
|
19
|
+
cost_estimate_usd?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface RateLimitInfo {
|
|
22
|
+
detected: boolean;
|
|
23
|
+
retryAfter?: number;
|
|
24
|
+
provider?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parse token usage from agent output. Each agent reports differently.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseTokensFromOutput(agent: AgentType, output: string): TokenUsage | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Detect rate limiting from agent output.
|
|
32
|
+
*/
|
|
33
|
+
export declare function detectRateLimit(output: string): RateLimitInfo | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Parse tool/command usage from agent output.
|
|
36
|
+
* Detects MCP tool calls, shell commands, file operations, etc.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseToolsUsed(output: string): string[] | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Append a run log entry to the project's runs.jsonl file.
|
|
41
|
+
*/
|
|
42
|
+
export declare function appendRunLog(projectPath: string, entry: RunLogEntry): void;
|
|
43
|
+
/**
|
|
44
|
+
* Read all run log entries from the project's runs.jsonl file.
|
|
45
|
+
*/
|
|
46
|
+
export declare function readRunLog(projectPath: string, limit?: number): RunLogEntry[];
|
|
47
|
+
/**
|
|
48
|
+
* Get aggregate stats from the run log.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getRunStats(projectPath: string): {
|
|
51
|
+
totalRuns: number;
|
|
52
|
+
byAgent: Record<string, {
|
|
53
|
+
runs: number;
|
|
54
|
+
totalTokens: number;
|
|
55
|
+
avgDuration: number;
|
|
56
|
+
}>;
|
|
57
|
+
totalTokens: number;
|
|
58
|
+
totalDuration: number;
|
|
59
|
+
rateLimitCount: number;
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=run-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-logger.d.ts","sourceRoot":"","sources":["../src/run-logger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAMpD,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAC;IAC5D,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CA6D9F;AAMD;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CA0BzE;AAMD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAwCnE;AAMD;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAc1E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,CAY7E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpF,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB,CAuCA"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
// ============================================
|
|
4
|
+
// Token Parsing
|
|
5
|
+
// ============================================
|
|
6
|
+
/**
|
|
7
|
+
* Parse token usage from agent output. Each agent reports differently.
|
|
8
|
+
*/
|
|
9
|
+
export function parseTokensFromOutput(agent, output) {
|
|
10
|
+
if (!output)
|
|
11
|
+
return undefined;
|
|
12
|
+
switch (agent) {
|
|
13
|
+
case "codex": {
|
|
14
|
+
// Codex reports tokens at the end of output, e.g. "108,712" or "tokens used: 14079"
|
|
15
|
+
// Also: "tokens used**" pattern seen in logs
|
|
16
|
+
const tokensUsedMatch = output.match(/tokens?\s*used[*:]*\s*([\d,]+)/i);
|
|
17
|
+
if (tokensUsedMatch) {
|
|
18
|
+
const total = parseInt(tokensUsedMatch[1].replace(/,/g, ""), 10);
|
|
19
|
+
if (!isNaN(total))
|
|
20
|
+
return { total, model: "gpt-5.4" };
|
|
21
|
+
}
|
|
22
|
+
// Bare large number at end of output (Codex sometimes just prints the count)
|
|
23
|
+
const bareNumberMatch = output.match(/\n([\d,]{4,})\s*$/);
|
|
24
|
+
if (bareNumberMatch) {
|
|
25
|
+
const total = parseInt(bareNumberMatch[1].replace(/,/g, ""), 10);
|
|
26
|
+
if (!isNaN(total) && total > 100)
|
|
27
|
+
return { total, model: "gpt-5.4" };
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
case "ollama": {
|
|
32
|
+
// Ollama API returns: prompt_eval_count, eval_count in JSON responses
|
|
33
|
+
const promptEvalMatch = output.match(/"prompt_eval_count"\s*:\s*(\d+)/);
|
|
34
|
+
const evalMatch = output.match(/"eval_count"\s*:\s*(\d+)/);
|
|
35
|
+
if (promptEvalMatch || evalMatch) {
|
|
36
|
+
const input = promptEvalMatch ? parseInt(promptEvalMatch[1], 10) : undefined;
|
|
37
|
+
const outputTokens = evalMatch ? parseInt(evalMatch[1], 10) : undefined;
|
|
38
|
+
const total = (input || 0) + (outputTokens || 0);
|
|
39
|
+
const model = process.env.NIGHTSHIFT_OLLAMA_MODEL || "qwen3:8b";
|
|
40
|
+
return { input, output: outputTokens, total: total || undefined, model };
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
case "gemini": {
|
|
45
|
+
// Gemini CLI may report: "Token count: N" or usage stats
|
|
46
|
+
const tokenCountMatch = output.match(/token[s]?\s*(?:count|usage|used)[:\s]*([\d,]+)/i);
|
|
47
|
+
if (tokenCountMatch) {
|
|
48
|
+
const total = parseInt(tokenCountMatch[1].replace(/,/g, ""), 10);
|
|
49
|
+
if (!isNaN(total))
|
|
50
|
+
return { total };
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
case "claude": {
|
|
55
|
+
// Claude Code --print mode may report token usage
|
|
56
|
+
const inputMatch = output.match(/input[_ ]tokens?[:\s]*([\d,]+)/i);
|
|
57
|
+
const outputMatch = output.match(/output[_ ]tokens?[:\s]*([\d,]+)/i);
|
|
58
|
+
if (inputMatch || outputMatch) {
|
|
59
|
+
const input = inputMatch ? parseInt(inputMatch[1].replace(/,/g, ""), 10) : undefined;
|
|
60
|
+
const outputTokens = outputMatch ? parseInt(outputMatch[1].replace(/,/g, ""), 10) : undefined;
|
|
61
|
+
const total = (input || 0) + (outputTokens || 0);
|
|
62
|
+
return { input, output: outputTokens, total: total || undefined };
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
default:
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// ============================================
|
|
71
|
+
// Rate Limit Detection
|
|
72
|
+
// ============================================
|
|
73
|
+
/**
|
|
74
|
+
* Detect rate limiting from agent output.
|
|
75
|
+
*/
|
|
76
|
+
export function detectRateLimit(output) {
|
|
77
|
+
if (!output)
|
|
78
|
+
return undefined;
|
|
79
|
+
// HTTP 429
|
|
80
|
+
const has429 = /\b429\b/.test(output) && /rate|limit|quota|capacity|exhausted/i.test(output);
|
|
81
|
+
// Explicit rate limit messages
|
|
82
|
+
const hasRateLimit = /(?:error|failed|rejected|denied|exceeded).*(?:rate.?limit|quota.?exceeded|too many requests|capacity.*exhausted|exhausted.*capacity|throttl)|(?:rate.?limit|quota.?exceeded|too many requests|capacity.*exhausted|exhausted.*capacity|throttl).*(?:error|failed|rejected|denied|exceeded)/i.test(output);
|
|
83
|
+
// Retry-after header or message
|
|
84
|
+
const retryMatch = output.match(/retry.?after[:\s]*(\d+)/i)
|
|
85
|
+
|| output.match(/reset after (\d+)s/i)
|
|
86
|
+
|| output.match(/wait (\d+)\s*s/i);
|
|
87
|
+
if (!has429 && !hasRateLimit)
|
|
88
|
+
return undefined;
|
|
89
|
+
const retryAfter = retryMatch ? parseInt(retryMatch[1], 10) : undefined;
|
|
90
|
+
// Try to identify provider
|
|
91
|
+
let provider;
|
|
92
|
+
if (/openai|gpt/i.test(output))
|
|
93
|
+
provider = "openai";
|
|
94
|
+
else if (/anthropic|claude/i.test(output))
|
|
95
|
+
provider = "anthropic";
|
|
96
|
+
else if (/google|gemini/i.test(output))
|
|
97
|
+
provider = "google";
|
|
98
|
+
else if (/ollama/i.test(output))
|
|
99
|
+
provider = "ollama";
|
|
100
|
+
return { detected: true, retryAfter, provider };
|
|
101
|
+
}
|
|
102
|
+
// ============================================
|
|
103
|
+
// Tool Usage Parsing
|
|
104
|
+
// ============================================
|
|
105
|
+
/**
|
|
106
|
+
* Parse tool/command usage from agent output.
|
|
107
|
+
* Detects MCP tool calls, shell commands, file operations, etc.
|
|
108
|
+
*/
|
|
109
|
+
export function parseToolsUsed(output) {
|
|
110
|
+
if (!output)
|
|
111
|
+
return undefined;
|
|
112
|
+
const tools = new Set();
|
|
113
|
+
// MCP tool calls (e.g., "nightshift - read_prd", "Tool: read_file")
|
|
114
|
+
const mcpToolMatches = output.matchAll(/(?:Tool|tool_use|nightshift)\s*[-:]?\s*(\w+)/g);
|
|
115
|
+
for (const match of mcpToolMatches) {
|
|
116
|
+
const toolName = match[1];
|
|
117
|
+
// Filter out noise words
|
|
118
|
+
if (toolName && toolName.length > 2 && !/^(the|and|for|was|use|has)$/i.test(toolName)) {
|
|
119
|
+
tools.add(toolName);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Claude Code tool patterns: "Read(file)", "Edit(file)", "Bash(cmd)", "Write(file)"
|
|
123
|
+
const claudeToolMatches = output.matchAll(/\b(Read|Edit|Write|Bash|Glob|Grep|Agent|WebSearch|WebFetch)\s*\(/g);
|
|
124
|
+
for (const match of claudeToolMatches) {
|
|
125
|
+
tools.add(match[1]);
|
|
126
|
+
}
|
|
127
|
+
// Codex tool patterns: "exec", "read_file", "write_file", "shell"
|
|
128
|
+
const codexToolMatches = output.matchAll(/\b(exec|read_file|write_file|shell|list_dir|patch_file)\b/g);
|
|
129
|
+
for (const match of codexToolMatches) {
|
|
130
|
+
tools.add(match[1]);
|
|
131
|
+
}
|
|
132
|
+
// Gemini tool patterns: "ReadFile", "WriteFile", "ExecuteCommand"
|
|
133
|
+
const geminiToolMatches = output.matchAll(/\b(ReadFile|WriteFile|ExecuteCommand|SearchFiles|ListDirectory)\b/g);
|
|
134
|
+
for (const match of geminiToolMatches) {
|
|
135
|
+
tools.add(match[1]);
|
|
136
|
+
}
|
|
137
|
+
// Shell commands (common patterns)
|
|
138
|
+
const shellMatches = output.matchAll(/(?:^|\n)\s*\$?\s*(npm|npx|git|tsc|vitest|eslint|prettier|node)\b/gm);
|
|
139
|
+
for (const match of shellMatches) {
|
|
140
|
+
tools.add(`shell:${match[1]}`);
|
|
141
|
+
}
|
|
142
|
+
return tools.size > 0 ? Array.from(tools) : undefined;
|
|
143
|
+
}
|
|
144
|
+
// ============================================
|
|
145
|
+
// Run Logger
|
|
146
|
+
// ============================================
|
|
147
|
+
/**
|
|
148
|
+
* Append a run log entry to the project's runs.jsonl file.
|
|
149
|
+
*/
|
|
150
|
+
export function appendRunLog(projectPath, entry) {
|
|
151
|
+
const robotChatDir = path.join(projectPath, ".robot-chat");
|
|
152
|
+
if (!fs.existsSync(robotChatDir)) {
|
|
153
|
+
fs.mkdirSync(robotChatDir, { recursive: true });
|
|
154
|
+
}
|
|
155
|
+
const logFile = path.join(robotChatDir, "runs.jsonl");
|
|
156
|
+
const line = JSON.stringify(entry) + "\n";
|
|
157
|
+
try {
|
|
158
|
+
fs.appendFileSync(logFile, line, "utf-8");
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
// Non-critical — best effort logging
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Read all run log entries from the project's runs.jsonl file.
|
|
166
|
+
*/
|
|
167
|
+
export function readRunLog(projectPath, limit) {
|
|
168
|
+
const logFile = path.join(projectPath, ".robot-chat", "runs.jsonl");
|
|
169
|
+
if (!fs.existsSync(logFile))
|
|
170
|
+
return [];
|
|
171
|
+
try {
|
|
172
|
+
const content = fs.readFileSync(logFile, "utf-8");
|
|
173
|
+
const lines = content.trim().split("\n").filter(Boolean);
|
|
174
|
+
const entries = lines.map((line) => JSON.parse(line));
|
|
175
|
+
return limit ? entries.slice(-limit) : entries;
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
return [];
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Get aggregate stats from the run log.
|
|
183
|
+
*/
|
|
184
|
+
export function getRunStats(projectPath) {
|
|
185
|
+
const entries = readRunLog(projectPath);
|
|
186
|
+
const byAgent = {};
|
|
187
|
+
let totalTokens = 0;
|
|
188
|
+
let totalDuration = 0;
|
|
189
|
+
let rateLimitCount = 0;
|
|
190
|
+
for (const entry of entries) {
|
|
191
|
+
if (!byAgent[entry.agent]) {
|
|
192
|
+
byAgent[entry.agent] = { runs: 0, totalTokens: 0, avgDuration: 0, totalDuration: 0 };
|
|
193
|
+
}
|
|
194
|
+
const agentStats = byAgent[entry.agent];
|
|
195
|
+
agentStats.runs++;
|
|
196
|
+
agentStats.totalDuration += entry.duration_seconds;
|
|
197
|
+
agentStats.avgDuration = Math.round(agentStats.totalDuration / agentStats.runs);
|
|
198
|
+
if (entry.tokens?.total) {
|
|
199
|
+
agentStats.totalTokens += entry.tokens.total;
|
|
200
|
+
totalTokens += entry.tokens.total;
|
|
201
|
+
}
|
|
202
|
+
totalDuration += entry.duration_seconds;
|
|
203
|
+
if (entry.status === "rate_limited")
|
|
204
|
+
rateLimitCount++;
|
|
205
|
+
}
|
|
206
|
+
// Clean up totalDuration from output
|
|
207
|
+
const result = {};
|
|
208
|
+
for (const [agent, stats] of Object.entries(byAgent)) {
|
|
209
|
+
result[agent] = { runs: stats.runs, totalTokens: stats.totalTokens, avgDuration: stats.avgDuration };
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
totalRuns: entries.length,
|
|
213
|
+
byAgent: result,
|
|
214
|
+
totalTokens,
|
|
215
|
+
totalDuration,
|
|
216
|
+
rateLimitCount,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=run-logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-logger.js","sourceRoot":"","sources":["../src/run-logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAkC7B,+CAA+C;AAC/C,gBAAgB;AAChB,+CAA+C;AAE/C;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAgB,EAAE,MAAc;IACpE,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAE9B,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,oFAAoF;YACpF,6CAA6C;YAC7C,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YACxE,IAAI,eAAe,EAAE,CAAC;gBACpB,MAAM,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;gBACjE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;oBAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;YACxD,CAAC;YACD,6EAA6E;YAC7E,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YAC1D,IAAI,eAAe,EAAE,CAAC;gBACpB,MAAM,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;gBACjE,IAAI,CAAC,KAAK,CAAC,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C,MAAM,CAAC,KAAK,CAAC;QACpC,CAAC;QAED,aAAa,IAAI,KAAK,CAAC,gBAAgB,CAAC;QAExC,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc;YAAE,cAAc,EAAE,CAAC;IACxD,CAAC;IAED,qCAAqC;IACrC,MAAM,MAAM,GAA+E,EAAE,CAAC;IAC9F,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACrD,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC;IACvG,CAAC;IAED,OAAO;QACL,SAAS,EAAE,OAAO,CAAC,MAAM;QACzB,OAAO,EAAE,MAAM;QACf,WAAW;QACX,aAAa;QACb,cAAc;KACf,CAAC;AACJ,CAAC"}
|
package/dist/tools/agents.d.ts
CHANGED
|
@@ -8,5 +8,8 @@ export declare const getAgentStatusTool: import("../tool-registry.js").ToolDefin
|
|
|
8
8
|
export declare const listRunningAgentsTool: import("../tool-registry.js").ToolDefinition;
|
|
9
9
|
export declare const getDaemonStatusTool: import("../tool-registry.js").ToolDefinition;
|
|
10
10
|
export declare const stopDaemonTool: import("../tool-registry.js").ToolDefinition;
|
|
11
|
+
export declare const getRunStatsTool: import("../tool-registry.js").ToolDefinition;
|
|
12
|
+
export declare const getPipelineTool: import("../tool-registry.js").ToolDefinition;
|
|
13
|
+
export declare const setPipelineTool: import("../tool-registry.js").ToolDefinition;
|
|
11
14
|
export declare const agentTools: import("../tool-registry.js").ToolDefinition[];
|
|
12
15
|
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/tools/agents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/tools/agents.ts"],"names":[],"mappings":"AA0EA,eAAO,MAAM,mBAAmB,8CAsC9B,CAAC;AAEH,eAAO,MAAM,cAAc,8CAiGzB,CAAC;AAEH,eAAO,MAAM,wBAAwB,8CAuDnC,CAAC;AAEH,eAAO,MAAM,aAAa,8CA6LxB,CAAC;AAEH,eAAO,MAAM,gBAAgB,8CAoK3B,CAAC;AAEH,eAAO,MAAM,WAAW,8CAsJtB,CAAC;AAEH,eAAO,MAAM,kBAAkB,8CAyC7B,CAAC;AAEH,eAAO,MAAM,qBAAqB,8CAyChC,CAAC;AAEH,eAAO,MAAM,mBAAmB,8CAsB9B,CAAC;AAEH,eAAO,MAAM,cAAc,8CA4CzB,CAAC;AAEH,eAAO,MAAM,eAAe,8CAgC1B,CAAC;AAEH,eAAO,MAAM,eAAe,8CA8B1B,CAAC;AAEH,eAAO,MAAM,eAAe,8CA0D1B,CAAC;AAGH,eAAO,MAAM,UAAU,gDActB,CAAC"}
|