vibecodepilot 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +174 -2
- package/apps/dashboard/dist/assets/index-CqhDXwBX.css +1 -0
- package/apps/dashboard/dist/assets/index-DB7dE_Nn.js +493 -0
- package/apps/dashboard/dist/index.html +31 -0
- package/apps/dashboard/dist-server/serve-dashboard.cjs +99 -0
- package/apps/dashboard/package.json +23 -0
- package/apps/server/dist/db/database.d.ts +91 -0
- package/apps/server/dist/db/database.d.ts.map +1 -0
- package/apps/server/dist/db/database.js +902 -0
- package/apps/server/dist/db/database.js.map +1 -0
- package/apps/server/dist/index.d.ts +2 -0
- package/apps/server/dist/index.d.ts.map +1 -0
- package/apps/server/dist/index.js +2262 -0
- package/apps/server/dist/index.js.map +1 -0
- package/apps/server/dist/services/agentWorkspaceService.d.ts +89 -0
- package/apps/server/dist/services/agentWorkspaceService.d.ts.map +1 -0
- package/apps/server/dist/services/agentWorkspaceService.js +243 -0
- package/apps/server/dist/services/agentWorkspaceService.js.map +1 -0
- package/apps/server/dist/services/monitorService.d.ts +118 -0
- package/apps/server/dist/services/monitorService.d.ts.map +1 -0
- package/apps/server/dist/services/monitorService.js +497 -0
- package/apps/server/dist/services/monitorService.js.map +1 -0
- package/apps/server/dist/services/projectFlowGraph.d.ts +70 -0
- package/apps/server/dist/services/projectFlowGraph.d.ts.map +1 -0
- package/apps/server/dist/services/projectFlowGraph.js +254 -0
- package/apps/server/dist/services/projectFlowGraph.js.map +1 -0
- package/apps/server/dist/tech-detector.d.ts +2 -0
- package/apps/server/dist/tech-detector.d.ts.map +1 -0
- package/apps/server/dist/tech-detector.js +154 -0
- package/apps/server/dist/tech-detector.js.map +1 -0
- package/apps/server/dist/workspace-tools.d.ts +43 -0
- package/apps/server/dist/workspace-tools.d.ts.map +1 -0
- package/apps/server/dist/workspace-tools.js +160 -0
- package/apps/server/dist/workspace-tools.js.map +1 -0
- package/apps/server/package.json +24 -0
- package/node_modules/@VibeCodePilot/agent-registry/dist/index.d.ts +21 -0
- package/node_modules/@VibeCodePilot/agent-registry/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/agent-registry/dist/index.js +194 -0
- package/node_modules/@VibeCodePilot/agent-registry/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/agent-registry/package.json +18 -0
- package/node_modules/@VibeCodePilot/git-worktrees/dist/index.d.ts +48 -0
- package/node_modules/@VibeCodePilot/git-worktrees/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/git-worktrees/dist/index.js +121 -0
- package/node_modules/@VibeCodePilot/git-worktrees/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/git-worktrees/package.json +18 -0
- package/node_modules/@VibeCodePilot/inference-gateway/dist/index.d.ts +54 -0
- package/node_modules/@VibeCodePilot/inference-gateway/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/inference-gateway/dist/index.js +157 -0
- package/node_modules/@VibeCodePilot/inference-gateway/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/inference-gateway/package.json +19 -0
- package/node_modules/@VibeCodePilot/integration/dist/index.d.ts +13 -0
- package/node_modules/@VibeCodePilot/integration/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/integration/dist/index.js +83 -0
- package/node_modules/@VibeCodePilot/integration/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/integration/package.json +20 -0
- package/node_modules/@VibeCodePilot/model-manager/dist/index.d.ts +44 -0
- package/node_modules/@VibeCodePilot/model-manager/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/model-manager/dist/index.js +192 -0
- package/node_modules/@VibeCodePilot/model-manager/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/model-manager/package.json +19 -0
- package/node_modules/@VibeCodePilot/permissions/dist/engine.d.ts +95 -0
- package/node_modules/@VibeCodePilot/permissions/dist/engine.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/permissions/dist/engine.js +294 -0
- package/node_modules/@VibeCodePilot/permissions/dist/engine.js.map +1 -0
- package/node_modules/@VibeCodePilot/permissions/dist/index.d.ts +4 -0
- package/node_modules/@VibeCodePilot/permissions/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/permissions/dist/index.js +20 -0
- package/node_modules/@VibeCodePilot/permissions/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/permissions/dist/security.d.ts +31 -0
- package/node_modules/@VibeCodePilot/permissions/dist/security.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/permissions/dist/security.js +129 -0
- package/node_modules/@VibeCodePilot/permissions/dist/security.js.map +1 -0
- package/node_modules/@VibeCodePilot/permissions/dist/types.d.ts +108 -0
- package/node_modules/@VibeCodePilot/permissions/dist/types.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/permissions/dist/types.js +3 -0
- package/node_modules/@VibeCodePilot/permissions/dist/types.js.map +1 -0
- package/node_modules/@VibeCodePilot/permissions/package.json +20 -0
- package/node_modules/@VibeCodePilot/planner/dist/index.d.ts +35 -0
- package/node_modules/@VibeCodePilot/planner/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/planner/dist/index.js +592 -0
- package/node_modules/@VibeCodePilot/planner/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/planner/package.json +19 -0
- package/node_modules/@VibeCodePilot/promoter/dist/index.d.ts +11 -0
- package/node_modules/@VibeCodePilot/promoter/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/promoter/dist/index.js +117 -0
- package/node_modules/@VibeCodePilot/promoter/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/promoter/package.json +19 -0
- package/node_modules/@VibeCodePilot/prompter/dist/index.d.ts +17 -0
- package/node_modules/@VibeCodePilot/prompter/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/prompter/dist/index.js +216 -0
- package/node_modules/@VibeCodePilot/prompter/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/prompter/package.json +20 -0
- package/node_modules/@VibeCodePilot/provider-ollama/dist/index.d.ts +58 -0
- package/node_modules/@VibeCodePilot/provider-ollama/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/provider-ollama/dist/index.js +384 -0
- package/node_modules/@VibeCodePilot/provider-ollama/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/provider-ollama/package.json +18 -0
- package/node_modules/@VibeCodePilot/shared/dist/index.d.ts +595 -0
- package/node_modules/@VibeCodePilot/shared/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/shared/dist/index.js +24 -0
- package/node_modules/@VibeCodePilot/shared/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/shared/dist/version.d.ts +14 -0
- package/node_modules/@VibeCodePilot/shared/dist/version.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/shared/dist/version.js +17 -0
- package/node_modules/@VibeCodePilot/shared/dist/version.js.map +1 -0
- package/node_modules/@VibeCodePilot/shared/package.json +24 -0
- package/node_modules/@VibeCodePilot/skill-registry/dist/index.d.ts +15 -0
- package/node_modules/@VibeCodePilot/skill-registry/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/skill-registry/dist/index.js +126 -0
- package/node_modules/@VibeCodePilot/skill-registry/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/skill-registry/package.json +18 -0
- package/node_modules/@VibeCodePilot/supervisor/dist/index.d.ts +31 -0
- package/node_modules/@VibeCodePilot/supervisor/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/supervisor/dist/index.js +219 -0
- package/node_modules/@VibeCodePilot/supervisor/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/supervisor/package.json +19 -0
- package/node_modules/@VibeCodePilot/task-scheduler/dist/index.d.ts +29 -0
- package/node_modules/@VibeCodePilot/task-scheduler/dist/index.d.ts.map +1 -0
- package/node_modules/@VibeCodePilot/task-scheduler/dist/index.js +128 -0
- package/node_modules/@VibeCodePilot/task-scheduler/dist/index.js.map +1 -0
- package/node_modules/@VibeCodePilot/task-scheduler/package.json +20 -0
- package/package.json +114 -4
- package/packages/agent-registry/package.json +18 -0
- package/packages/cli/bin/vibepilot.js +28 -0
- package/packages/cli/dist/config.js +143 -0
- package/packages/cli/dist/doctor.js +64 -0
- package/packages/cli/dist/index.js +260 -0
- package/packages/cli/dist/ollama.js +39 -0
- package/packages/cli/dist/pidmanager.js +153 -0
- package/packages/cli/dist/runtime.js +97 -0
- package/packages/cli/dist/servicemanager.js +227 -0
- package/packages/cli/package.json +25 -0
- package/packages/git-worktrees/package.json +18 -0
- package/packages/inference-gateway/package.json +19 -0
- package/packages/integration/package.json +20 -0
- package/packages/model-manager/package.json +19 -0
- package/packages/permissions/package.json +20 -0
- package/packages/planner/package.json +19 -0
- package/packages/promoter/package.json +19 -0
- package/packages/prompter/package.json +20 -0
- package/packages/providers/ollama/package.json +18 -0
- package/packages/shared/package.json +24 -0
- package/packages/skill-registry/package.json +18 -0
- package/packages/supervisor/package.json +19 -0
- package/packages/task-scheduler/package.json +20 -0
- package/skills/ai-ml/aiml-planning.json +22 -0
- package/skills/ai-ml/backend-planning.json +31 -0
- package/skills/ai-ml/frontend-planning.json +19 -0
- package/skills/ai-ml/ollama-local.json +11 -0
- package/skills/ai-ml/prompt-engineering.json +31 -0
- package/skills/ai-ml/task-planning.json +30 -0
- package/skills/backend/python-fastapi.json +11 -0
- package/skills/backend/ruby-rails.json +11 -0
- package/skills/backend/typescript-nodejs.json +11 -0
- package/skills/frontend/react-typescript.json +11 -0
- package/tsconfig.base.json +16 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProjectFlowGraph — builds a compact, machine-readable "what relates to what"
|
|
3
|
+
* map of the current project so agents don't have to re-read the whole repo
|
|
4
|
+
* on every task.
|
|
5
|
+
*
|
|
6
|
+
* Output is a deterministic markdown context file containing:
|
|
7
|
+
* - directory/entry-point summary (stack detected from package.json)
|
|
8
|
+
* - node list: files with role (entry/component/service/config/test/style)
|
|
9
|
+
* - edges: real import/require connections between files
|
|
10
|
+
* - active tasks from the board, with affected-file links into the graph
|
|
11
|
+
*
|
|
12
|
+
* The file is regenerated on demand and stored at .VibeCodePilot/FLOWGRAPH.md
|
|
13
|
+
* in the project root; agents get it injected as context, humans can read it.
|
|
14
|
+
*/
|
|
15
|
+
export interface FlowGraphNode {
|
|
16
|
+
id: string;
|
|
17
|
+
role: string;
|
|
18
|
+
ext: string;
|
|
19
|
+
imports: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface FlowGraphTaskLink {
|
|
22
|
+
id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
status: string;
|
|
25
|
+
agent: string;
|
|
26
|
+
files: string[];
|
|
27
|
+
deps: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface FlowGraph {
|
|
30
|
+
generatedAt: string;
|
|
31
|
+
root: string;
|
|
32
|
+
stack: string[];
|
|
33
|
+
entryPoints: string[];
|
|
34
|
+
nodes: FlowGraphNode[];
|
|
35
|
+
edges: Array<{
|
|
36
|
+
from: string;
|
|
37
|
+
to: string;
|
|
38
|
+
}>;
|
|
39
|
+
tasks: FlowGraphTaskLink[];
|
|
40
|
+
hubs: string[];
|
|
41
|
+
}
|
|
42
|
+
/** Build the flow graph from the project on disk + current board tasks. */
|
|
43
|
+
export declare function buildProjectFlowGraph(projectRoot: string, tasks: Array<{
|
|
44
|
+
id: string;
|
|
45
|
+
title: string;
|
|
46
|
+
status: string;
|
|
47
|
+
assignedAgentId: string;
|
|
48
|
+
scope: {
|
|
49
|
+
affectedFiles: string[];
|
|
50
|
+
};
|
|
51
|
+
dependencies?: string[];
|
|
52
|
+
archived?: boolean;
|
|
53
|
+
}>): FlowGraph;
|
|
54
|
+
/** Render the graph as a compact markdown context file for agent consumption. */
|
|
55
|
+
export declare function renderFlowGraphMarkdown(g: FlowGraph): string;
|
|
56
|
+
/** Default on-disk location of the generated context file. */
|
|
57
|
+
export declare function flowGraphPath(projectRoot: string): string;
|
|
58
|
+
/** Build + write the context file. Returns the path written. */
|
|
59
|
+
export declare function generateFlowGraphFile(projectRoot: string, tasks: Array<{
|
|
60
|
+
id: string;
|
|
61
|
+
title: string;
|
|
62
|
+
status: string;
|
|
63
|
+
assignedAgentId: string;
|
|
64
|
+
scope: {
|
|
65
|
+
affectedFiles: string[];
|
|
66
|
+
};
|
|
67
|
+
dependencies?: string[];
|
|
68
|
+
archived?: boolean;
|
|
69
|
+
}>): Promise<string>;
|
|
70
|
+
//# sourceMappingURL=projectFlowGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectFlowGraph.d.ts","sourceRoot":"","sources":["../../src/services/projectFlowGraph.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3C,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AA0ED,2EAA2E;AAC3E,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE;QAAE,aAAa,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,SAAS,CAoE3O;AAED,iFAAiF;AACjF,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAuC5D;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,gEAAgE;AAChE,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE;QAAE,aAAa,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,GACpK,OAAO,CAAC,MAAM,CAAC,CAOjB"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.buildProjectFlowGraph = buildProjectFlowGraph;
|
|
37
|
+
exports.renderFlowGraphMarkdown = renderFlowGraphMarkdown;
|
|
38
|
+
exports.flowGraphPath = flowGraphPath;
|
|
39
|
+
exports.generateFlowGraphFile = generateFlowGraphFile;
|
|
40
|
+
const fs = __importStar(require("node:fs"));
|
|
41
|
+
const path = __importStar(require("node:path"));
|
|
42
|
+
const CODE_EXT = new Set(['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs', '.py', '.go', '.rs']);
|
|
43
|
+
const SKIP_DIRS = new Set(['node_modules', '.git', 'dist', 'dist-server', 'build', 'out', '.next', '.cache', 'coverage', 'data', '.VibeCodePilot', 'demo-lab', 'plan_ui']);
|
|
44
|
+
/** Import/require extractor for TS/JS. Falls back to raw string match for other languages. */
|
|
45
|
+
function extractImports(file, content) {
|
|
46
|
+
const out = [];
|
|
47
|
+
const re = /(?:import[^'"]*['"]([^'"]+)['"]|require\(\s*['"]([^'"]+)['"]\s*\)|from\s+['"]([^'"]+)['"]|import\s+['"]([^'"]+)['"])/g;
|
|
48
|
+
let m;
|
|
49
|
+
while ((m = re.exec(content)) !== null) {
|
|
50
|
+
const spec = m[1] || m[2] || m[3] || m[4];
|
|
51
|
+
if (spec)
|
|
52
|
+
out.push(spec);
|
|
53
|
+
}
|
|
54
|
+
// Python: `import x`, `from x import y`
|
|
55
|
+
if (file.endsWith('.py')) {
|
|
56
|
+
const py = /(?:^|\n)\s*(?:from\s+([\w.]+)\s+import|import\s+([\w.,\s]+))/g;
|
|
57
|
+
while ((m = py.exec(content)) !== null) {
|
|
58
|
+
const spec = m[1] || m[2];
|
|
59
|
+
if (spec)
|
|
60
|
+
out.push(...spec.split(',').map(s => s.trim()).filter(Boolean));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
/** Resolve a relative import specifier to a project file path, if it points inside the project. */
|
|
66
|
+
function resolveImport(fromDir, spec, allFiles) {
|
|
67
|
+
if (!spec.startsWith('.') && !spec.startsWith('#'))
|
|
68
|
+
return null; // node_modules / alias — external
|
|
69
|
+
let base = spec.replace(/^#/, '').split('?')[0];
|
|
70
|
+
const candidates = [
|
|
71
|
+
base,
|
|
72
|
+
`${base}.ts`, `${base}.tsx`, `${base}.js`, `${base}.jsx`, `${base}.mjs`, `${base}.cjs`,
|
|
73
|
+
`${base}.py`,
|
|
74
|
+
path.join(base, 'index.ts'), path.join(base, 'index.tsx'), path.join(base, 'index.js'),
|
|
75
|
+
path.join(base, '__init__.py')
|
|
76
|
+
];
|
|
77
|
+
for (const c of candidates) {
|
|
78
|
+
const norm = path.normalize(path.join(fromDir, c)).replace(/\\/g, '/');
|
|
79
|
+
if (allFiles.has(norm))
|
|
80
|
+
return norm;
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
function detectRole(relPath, content) {
|
|
85
|
+
const lower = relPath.toLowerCase();
|
|
86
|
+
if (/(^|\/)(main|index|server|app|cli)\.(ts|tsx|js|py)$/.test(lower))
|
|
87
|
+
return 'entry';
|
|
88
|
+
if (/(server|api|route|middleware|controller)/.test(lower))
|
|
89
|
+
return 'server';
|
|
90
|
+
if (/(test|spec)\./.test(lower) || /(__tests__|__mocks__)\//.test(lower))
|
|
91
|
+
return 'test';
|
|
92
|
+
if (/\.(css|scss|less|sass)$/.test(lower))
|
|
93
|
+
return 'style';
|
|
94
|
+
if (/(package\.json|tsconfig|vite\.config|next\.config|webpack|rollup|tailwind\.config|pyproject|cargo\.toml|go\.mod)$/.test(lower))
|
|
95
|
+
return 'config';
|
|
96
|
+
if (/\.md$/.test(lower))
|
|
97
|
+
return 'doc';
|
|
98
|
+
if (/(component|view|page|modal|panel|widget|\.tsx?$)/.test(lower))
|
|
99
|
+
return 'component';
|
|
100
|
+
return 'other';
|
|
101
|
+
}
|
|
102
|
+
function walk(root) {
|
|
103
|
+
const files = [];
|
|
104
|
+
const visit = (dir) => {
|
|
105
|
+
let entries;
|
|
106
|
+
try {
|
|
107
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
for (const e of entries) {
|
|
113
|
+
if (e.name.startsWith('.') && e.name !== '.github')
|
|
114
|
+
continue;
|
|
115
|
+
if (e.isDirectory()) {
|
|
116
|
+
if (SKIP_DIRS.has(e.name))
|
|
117
|
+
continue;
|
|
118
|
+
visit(path.join(dir, e.name));
|
|
119
|
+
}
|
|
120
|
+
else if (e.isFile()) {
|
|
121
|
+
files.push(path.relative(root, path.join(dir, e.name)).replace(/\\/g, '/'));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
visit(root);
|
|
126
|
+
return files;
|
|
127
|
+
}
|
|
128
|
+
/** Build the flow graph from the project on disk + current board tasks. */
|
|
129
|
+
function buildProjectFlowGraph(projectRoot, tasks) {
|
|
130
|
+
const allFiles = walk(projectRoot);
|
|
131
|
+
const fileSet = new Set(allFiles);
|
|
132
|
+
const nodes = [];
|
|
133
|
+
const edges = [];
|
|
134
|
+
const inbound = new Map();
|
|
135
|
+
const pkgPath = path.join(projectRoot, 'package.json');
|
|
136
|
+
let stack = [];
|
|
137
|
+
if (fs.existsSync(pkgPath)) {
|
|
138
|
+
try {
|
|
139
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
140
|
+
const deps = Object.keys({ ...(pkg.dependencies || {}), ...(pkg.devDependencies || {}) });
|
|
141
|
+
const known = ['react', 'vue', 'svelte', 'next', 'vite', 'express', 'fastify', 'typescript', 'electron', 'tailwindcss', 'prisma', 'jest', 'vitest', 'eslint', 'node-fetch', 'socket.io'];
|
|
142
|
+
stack = known.filter(k => deps.some(d => d === k || d.startsWith(`@${k}/`) || d.startsWith(`${k}-`) || d.endsWith(`-${k}`)));
|
|
143
|
+
if (pkg.type === 'module')
|
|
144
|
+
stack.push('ESM');
|
|
145
|
+
}
|
|
146
|
+
catch { /* ignore */ }
|
|
147
|
+
}
|
|
148
|
+
const entryPoints = [];
|
|
149
|
+
for (const rel of allFiles) {
|
|
150
|
+
const ext = path.extname(rel);
|
|
151
|
+
const abs = path.join(projectRoot, rel);
|
|
152
|
+
let content = '';
|
|
153
|
+
try {
|
|
154
|
+
content = fs.readFileSync(abs, 'utf8');
|
|
155
|
+
}
|
|
156
|
+
catch { /* skip unreadable */ }
|
|
157
|
+
const role = detectRole(rel, content);
|
|
158
|
+
if (role === 'entry')
|
|
159
|
+
entryPoints.push(rel);
|
|
160
|
+
const imports = [];
|
|
161
|
+
if (CODE_EXT.has(ext)) {
|
|
162
|
+
for (const spec of extractImports(rel, content)) {
|
|
163
|
+
const resolved = resolveImport(path.dirname(rel), spec, fileSet);
|
|
164
|
+
if (resolved && resolved !== rel) {
|
|
165
|
+
imports.push(resolved);
|
|
166
|
+
edges.push({ from: rel, to: resolved });
|
|
167
|
+
inbound.set(resolved, (inbound.get(resolved) || 0) + 1);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
nodes.push({ id: rel, role, ext: ext || '(none)', imports });
|
|
172
|
+
}
|
|
173
|
+
// Hubs = most imported project files (top 8)
|
|
174
|
+
const hubs = [...inbound.entries()]
|
|
175
|
+
.sort((a, b) => b[1] - a[1])
|
|
176
|
+
.slice(0, 8)
|
|
177
|
+
.map(([f]) => f);
|
|
178
|
+
const taskLinks = tasks
|
|
179
|
+
.filter(t => !t.archived)
|
|
180
|
+
.map(t => ({
|
|
181
|
+
id: t.id,
|
|
182
|
+
title: t.title,
|
|
183
|
+
status: t.status,
|
|
184
|
+
agent: t.assignedAgentId,
|
|
185
|
+
files: t.scope?.affectedFiles || [],
|
|
186
|
+
deps: t.dependencies || []
|
|
187
|
+
}));
|
|
188
|
+
return {
|
|
189
|
+
generatedAt: new Date().toISOString(),
|
|
190
|
+
root: projectRoot,
|
|
191
|
+
stack,
|
|
192
|
+
entryPoints,
|
|
193
|
+
nodes,
|
|
194
|
+
edges,
|
|
195
|
+
hubs,
|
|
196
|
+
tasks: taskLinks
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
/** Render the graph as a compact markdown context file for agent consumption. */
|
|
200
|
+
function renderFlowGraphMarkdown(g) {
|
|
201
|
+
const lines = [];
|
|
202
|
+
lines.push(`# Project Flow Graph`);
|
|
203
|
+
lines.push(`> Auto-generated map of what relates to what. Generated: ${g.generatedAt}`);
|
|
204
|
+
lines.push(`> Root: ${g.root}`);
|
|
205
|
+
lines.push('');
|
|
206
|
+
lines.push(`## Stack`);
|
|
207
|
+
lines.push(g.stack.length ? g.stack.join(', ') : '(not detected)');
|
|
208
|
+
lines.push('');
|
|
209
|
+
lines.push(`## Entry points`);
|
|
210
|
+
lines.push(g.entryPoints.length ? g.entryPoints.map(e => `- ${e}`).join('\n') : '(none found)');
|
|
211
|
+
lines.push('');
|
|
212
|
+
lines.push(`## Hub files (most depended-upon — read these first when touching shared code)`);
|
|
213
|
+
lines.push(g.hubs.length ? g.hubs.map(h => `- ${h}`).join('\n') : '(none)');
|
|
214
|
+
lines.push('');
|
|
215
|
+
lines.push(`## File roles`);
|
|
216
|
+
lines.push('| role | files |');
|
|
217
|
+
lines.push('|------|-------|');
|
|
218
|
+
const byRole = new Map();
|
|
219
|
+
for (const n of g.nodes) {
|
|
220
|
+
if (!byRole.has(n.role))
|
|
221
|
+
byRole.set(n.role, []);
|
|
222
|
+
byRole.get(n.role).push(n.id);
|
|
223
|
+
}
|
|
224
|
+
for (const [role, files] of [...byRole.entries()].sort((a, b) => b[1].length - a[1].length)) {
|
|
225
|
+
lines.push(`| ${role} | ${files.join('<br>')} |`);
|
|
226
|
+
}
|
|
227
|
+
lines.push('');
|
|
228
|
+
lines.push(`## Connections (file -> imported project files)`);
|
|
229
|
+
const withImports = g.nodes.filter(n => n.imports.length > 0);
|
|
230
|
+
lines.push(withImports.length
|
|
231
|
+
? withImports.map(n => `- **${n.id}** -> ${n.imports.join(', ')}`).join('\n')
|
|
232
|
+
: '(no intra-project imports detected)');
|
|
233
|
+
lines.push('');
|
|
234
|
+
lines.push(`## Active tasks (board)`);
|
|
235
|
+
lines.push(g.tasks.length
|
|
236
|
+
? g.tasks.map(t => `- **[${t.status}]** ${t.title} (${t.id}) — agent: ${t.agent}; files: ${t.files.join(', ') || '—'}; deps: ${t.deps.join(', ') || 'none'}`).join('\n')
|
|
237
|
+
: '(no active tasks)');
|
|
238
|
+
lines.push('');
|
|
239
|
+
return lines.join('\n');
|
|
240
|
+
}
|
|
241
|
+
/** Default on-disk location of the generated context file. */
|
|
242
|
+
function flowGraphPath(projectRoot) {
|
|
243
|
+
return path.join(projectRoot, '.VibeCodePilot', 'FLOWGRAPH.md');
|
|
244
|
+
}
|
|
245
|
+
/** Build + write the context file. Returns the path written. */
|
|
246
|
+
async function generateFlowGraphFile(projectRoot, tasks) {
|
|
247
|
+
const graph = buildProjectFlowGraph(projectRoot, tasks);
|
|
248
|
+
const md = renderFlowGraphMarkdown(graph);
|
|
249
|
+
const outPath = flowGraphPath(projectRoot);
|
|
250
|
+
fs.mkdirSync(path.dirname(outPath), { recursive: true });
|
|
251
|
+
fs.writeFileSync(outPath, md, 'utf8');
|
|
252
|
+
return outPath;
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=projectFlowGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectFlowGraph.js","sourceRoot":"","sources":["../../src/services/projectFlowGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsHA,sDAoEC;AAGD,0DAuCC;AAGD,sCAEC;AAGD,sDAUC;AAtPD,4CAA8B;AAC9B,gDAAkC;AA4ClC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAC9F,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;AAE3K,8FAA8F;AAC9F,SAAS,cAAc,CAAC,IAAY,EA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K,UAAU,qBAAqB,CACzC,WAAmB,EACnB,KAAqK;IAErK,MAAM,KAAK,GAAG,qBAAqB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACxD,MAAM,EAAE,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IAC3C,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tech-detector.d.ts","sourceRoot":"","sources":["../src/tech-detector.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAuG/D"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.detectTechnologies = detectTechnologies;
|
|
37
|
+
const fs = __importStar(require("node:fs"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
function detectTechnologies(projectDir) {
|
|
40
|
+
const detected = new Set();
|
|
41
|
+
if (!fs.existsSync(projectDir)) {
|
|
42
|
+
return ['TypeScript', 'Node.js'];
|
|
43
|
+
}
|
|
44
|
+
// Check Node / JavaScript / TypeScript
|
|
45
|
+
const pkgPath = path.join(projectDir, 'package.json');
|
|
46
|
+
if (fs.existsSync(pkgPath)) {
|
|
47
|
+
detected.add('Node.js');
|
|
48
|
+
try {
|
|
49
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
50
|
+
const allDeps = {
|
|
51
|
+
...(pkg.dependencies || {}),
|
|
52
|
+
...(pkg.devDependencies || {})
|
|
53
|
+
};
|
|
54
|
+
if (allDeps.typescript || fs.existsSync(path.join(projectDir, 'tsconfig.json'))) {
|
|
55
|
+
detected.add('TypeScript');
|
|
56
|
+
}
|
|
57
|
+
if (allDeps.react)
|
|
58
|
+
detected.add('React');
|
|
59
|
+
if (allDeps.next)
|
|
60
|
+
detected.add('Next.js');
|
|
61
|
+
if (allDeps.vue)
|
|
62
|
+
detected.add('Vue 3');
|
|
63
|
+
if (allDeps.svelte)
|
|
64
|
+
detected.add('Svelte');
|
|
65
|
+
if (allDeps.fastify)
|
|
66
|
+
detected.add('Fastify');
|
|
67
|
+
if (allDeps.express || fs.existsSync(path.join(projectDir, 'node_modules', 'express')))
|
|
68
|
+
detected.add('Express');
|
|
69
|
+
if (allDeps.tailwindcss)
|
|
70
|
+
detected.add('Tailwind CSS');
|
|
71
|
+
if (allDeps['@prisma/client'] || allDeps.prisma)
|
|
72
|
+
detected.add('Prisma');
|
|
73
|
+
if (allDeps['drizzle-orm'])
|
|
74
|
+
detected.add('Drizzle');
|
|
75
|
+
if (allDeps.pg)
|
|
76
|
+
detected.add('PostgreSQL');
|
|
77
|
+
if (allDeps.sqlite3 || allDeps['better-sqlite3'])
|
|
78
|
+
detected.add('SQLite');
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// Ignore JSON parse errors
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Check Ruby / Rails
|
|
85
|
+
if (fs.existsSync(path.join(projectDir, 'Gemfile'))) {
|
|
86
|
+
detected.add('Ruby');
|
|
87
|
+
try {
|
|
88
|
+
const gemfile = fs.readFileSync(path.join(projectDir, 'Gemfile'), 'utf8');
|
|
89
|
+
if (gemfile.includes('rails'))
|
|
90
|
+
detected.add('Ruby on Rails');
|
|
91
|
+
if (gemfile.includes('rspec'))
|
|
92
|
+
detected.add('RSpec');
|
|
93
|
+
if (gemfile.includes('sidekiq'))
|
|
94
|
+
detected.add('Sidekiq');
|
|
95
|
+
if (gemfile.includes('pg'))
|
|
96
|
+
detected.add('PostgreSQL');
|
|
97
|
+
}
|
|
98
|
+
catch { }
|
|
99
|
+
}
|
|
100
|
+
// Check Python
|
|
101
|
+
if (fs.existsSync(path.join(projectDir, 'pyproject.toml')) ||
|
|
102
|
+
fs.existsSync(path.join(projectDir, 'requirements.txt')) ||
|
|
103
|
+
fs.existsSync(path.join(projectDir, 'Pipfile'))) {
|
|
104
|
+
detected.add('Python');
|
|
105
|
+
try {
|
|
106
|
+
const reqs = fs.existsSync(path.join(projectDir, 'requirements.txt'))
|
|
107
|
+
? fs.readFileSync(path.join(projectDir, 'requirements.txt'), 'utf8')
|
|
108
|
+
: '';
|
|
109
|
+
if (reqs.includes('fastapi'))
|
|
110
|
+
detected.add('FastAPI');
|
|
111
|
+
if (reqs.includes('django'))
|
|
112
|
+
detected.add('Django');
|
|
113
|
+
if (reqs.includes('flask'))
|
|
114
|
+
detected.add('Flask');
|
|
115
|
+
if (reqs.includes('sqlalchemy'))
|
|
116
|
+
detected.add('SQLAlchemy');
|
|
117
|
+
if (reqs.includes('torch'))
|
|
118
|
+
detected.add('PyTorch');
|
|
119
|
+
}
|
|
120
|
+
catch { }
|
|
121
|
+
}
|
|
122
|
+
// Check Go
|
|
123
|
+
if (fs.existsSync(path.join(projectDir, 'go.mod'))) {
|
|
124
|
+
detected.add('Go');
|
|
125
|
+
try {
|
|
126
|
+
const mod = fs.readFileSync(path.join(projectDir, 'go.mod'), 'utf8');
|
|
127
|
+
if (mod.includes('gin-gonic'))
|
|
128
|
+
detected.add('Gin');
|
|
129
|
+
if (mod.includes('gofiber'))
|
|
130
|
+
detected.add('Fiber');
|
|
131
|
+
}
|
|
132
|
+
catch { }
|
|
133
|
+
}
|
|
134
|
+
// Check Java
|
|
135
|
+
if (fs.existsSync(path.join(projectDir, 'pom.xml')) || fs.existsSync(path.join(projectDir, 'build.gradle'))) {
|
|
136
|
+
detected.add('Java');
|
|
137
|
+
detected.add('Spring Boot');
|
|
138
|
+
}
|
|
139
|
+
// Check Docker
|
|
140
|
+
if (fs.existsSync(path.join(projectDir, 'Dockerfile')) ||
|
|
141
|
+
fs.existsSync(path.join(projectDir, 'docker-compose.yml')) ||
|
|
142
|
+
fs.existsSync(path.join(projectDir, 'docker-compose.yaml'))) {
|
|
143
|
+
detected.add('Docker');
|
|
144
|
+
}
|
|
145
|
+
// Check Git
|
|
146
|
+
if (fs.existsSync(path.join(projectDir, '.git'))) {
|
|
147
|
+
detected.add('Git');
|
|
148
|
+
}
|
|
149
|
+
if (detected.size === 0) {
|
|
150
|
+
return ['TypeScript', 'Node.js'];
|
|
151
|
+
}
|
|
152
|
+
return Array.from(detected);
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=tech-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tech-detector.js","sourceRoot":"","sources":["../src/tech-detector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,gDAuGC;AA1GD,4CAA8B;AAC9B,gDAAkC;AAElC,SAAgB,kBAAkB,CAAC,UAAkB;IACnD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAEnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACnC,CAAC;IAED,uCAAuC;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACtD,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;YACzD,MAAM,OAAO,GAAG;gBACd,GAAG,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;gBAC3B,GAAG,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;aAC/B,CAAC;YAEF,IAAI,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,UAAU,CA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dir';
|
|
8
|
+
path: string;
|
|
9
|
+
};
|
|
10
|
+
export interface FileOperationResult {
|
|
11
|
+
op: FileOperation['op'];
|
|
12
|
+
path: string;
|
|
13
|
+
success: boolean;
|
|
14
|
+
detail: string;
|
|
15
|
+
}
|
|
16
|
+
/** Applies a deliberately small, auditable set of model-requested file changes. */
|
|
17
|
+
export declare class WorkspaceTools {
|
|
18
|
+
private readonly workspaceRoot;
|
|
19
|
+
constructor(workspaceRoot: string);
|
|
20
|
+
private resolve;
|
|
21
|
+
apply(operation: FileOperation): FileOperationResult;
|
|
22
|
+
}
|
|
23
|
+
export interface TestRunResult {
|
|
24
|
+
command: string;
|
|
25
|
+
success: boolean;
|
|
26
|
+
exitCode: number | null;
|
|
27
|
+
stdout: string;
|
|
28
|
+
stderr: string;
|
|
29
|
+
durationMs: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Executes the project's real test command (npm test, pytest, go test …)
|
|
33
|
+
* inside the project root. Used by the Validation layer (Layer 6) after an
|
|
34
|
+
* agent implements a task, so completion claims are backed by executed tests.
|
|
35
|
+
*/
|
|
36
|
+
export declare class TestRunner {
|
|
37
|
+
private readonly projectRoot;
|
|
38
|
+
constructor(projectRoot: string);
|
|
39
|
+
detectTestCommand(): string | null;
|
|
40
|
+
run(command?: string, timeoutMs?: number): Promise<TestRunResult>;
|
|
41
|
+
}
|
|
42
|
+
export declare function parseFileOperations(response: string): FileOperation[];
|
|
43
|
+
//# sourceMappingURL=workspace-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-tools.d.ts","sourceRoot":"","sources":["../src/workspace-tools.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GACrB;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAA;CAA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