@llipe.com/dev-tasks 0.8.0 → 0.9.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/.claude/agents/developer.md +16 -11
- package/.claude/agents/qa-engineer.md +104 -0
- package/.claude/agents/verifier.md +1 -1
- package/.claude/commands/developer.md +14 -10
- package/.claude/commands/planner.md +10 -8
- package/.claude/commands/qa-engineer.md +23 -0
- package/.claude/skills/activity-coverage-gap-analysis/SKILL.md +107 -0
- package/.claude/skills/activity-test-implementation/SKILL.md +109 -0
- package/.claude/skills/activity-test-standards/SKILL.md +122 -0
- package/.claude/skills/implement/SKILL.md +14 -12
- package/.github/agents/developer.agent.md +16 -11
- package/.github/agents/planner.agent.md +10 -8
- package/.github/agents/qa-engineer.agent.md +104 -0
- package/.github/agents/verifier.agent.md +1 -1
- package/.github/instructions/implement.instructions.md +14 -12
- package/.github/prompts/qa-engineer.prompt.md +23 -0
- package/.github/skills/activity-coverage-gap-analysis/SKILL.md +107 -0
- package/.github/skills/activity-test-implementation/SKILL.md +109 -0
- package/.github/skills/activity-test-standards/SKILL.md +122 -0
- package/.kiro/agents/developer.md +16 -11
- package/.kiro/agents/planner.md +10 -8
- package/.kiro/agents/qa-engineer.md +108 -0
- package/.kiro/agents/verifier.md +1 -1
- package/.kiro/skills/activity-coverage-gap-analysis/SKILL.md +107 -0
- package/.kiro/skills/activity-test-implementation/SKILL.md +109 -0
- package/.kiro/skills/activity-test-standards/SKILL.md +122 -0
- package/.kiro/steering/implement.md +14 -12
- package/AGENTS.md +50 -23
- package/CHANGELOG.md +56 -0
- package/CLAUDE.md +6 -3
- package/README.md +108 -112
- package/TESTING.md +183 -0
- package/bundle-manifest.json +1 -0
- package/dist/core/distribution/install.d.ts.map +1 -1
- package/dist/core/distribution/install.js +25 -2
- package/dist/core/distribution/install.js.map +1 -1
- package/dist/core/distribution/profiles.d.ts +21 -0
- package/dist/core/distribution/profiles.d.ts.map +1 -1
- package/dist/core/distribution/profiles.js +21 -0
- package/dist/core/distribution/profiles.js.map +1 -1
- package/dist/core/distribution/update.d.ts +3 -0
- package/dist/core/distribution/update.d.ts.map +1 -1
- package/dist/core/distribution/update.js +141 -15
- package/dist/core/distribution/update.js.map +1 -1
- package/dist/core/extract/asyncapi/declared.d.ts +19 -0
- package/dist/core/extract/asyncapi/declared.d.ts.map +1 -0
- package/dist/core/extract/asyncapi/declared.js +168 -0
- package/dist/core/extract/asyncapi/declared.js.map +1 -0
- package/dist/core/extract/asyncapi/index.d.ts +1 -0
- package/dist/core/extract/asyncapi/index.d.ts.map +1 -1
- package/dist/core/extract/asyncapi/index.js +1 -0
- package/dist/core/extract/asyncapi/index.js.map +1 -1
- package/dist/core/extract/asyncapi/types.d.ts +1 -1
- package/dist/core/extract/asyncapi/types.d.ts.map +1 -1
- package/dist/core/extract/ladder.d.ts +79 -0
- package/dist/core/extract/ladder.d.ts.map +1 -0
- package/dist/core/extract/ladder.js +70 -0
- package/dist/core/extract/ladder.js.map +1 -0
- package/dist/core/extract/openapi/index.d.ts +35 -5
- package/dist/core/extract/openapi/index.d.ts.map +1 -1
- package/dist/core/extract/openapi/index.js +136 -3
- package/dist/core/extract/openapi/index.js.map +1 -1
- package/dist/core/extract/openapi/route2-introspect.d.ts +18 -0
- package/dist/core/extract/openapi/route2-introspect.d.ts.map +1 -0
- package/dist/core/extract/openapi/route2-introspect.js +249 -0
- package/dist/core/extract/openapi/route2-introspect.js.map +1 -0
- package/dist/core/extract/openapi/route2.d.ts +40 -17
- package/dist/core/extract/openapi/route2.d.ts.map +1 -1
- package/dist/core/extract/openapi/route2.js +202 -10
- package/dist/core/extract/openapi/route2.js.map +1 -1
- package/dist/core/extract/openapi/types.d.ts +3 -3
- package/dist/core/extract/openapi/types.d.ts.map +1 -1
- package/dist/core/extract/provider.d.ts +4 -0
- package/dist/core/extract/provider.d.ts.map +1 -1
- package/dist/core/extract/report.d.ts +29 -1
- package/dist/core/extract/report.d.ts.map +1 -1
- package/dist/core/extract/report.js +7 -2
- package/dist/core/extract/report.js.map +1 -1
- package/dist/core/extract/schema.d.ts +16 -18
- package/dist/core/extract/schema.d.ts.map +1 -1
- package/dist/core/extract/schema.js +48 -43
- package/dist/core/extract/schema.js.map +1 -1
- package/dist/core/extract/workspaces.d.ts +33 -0
- package/dist/core/extract/workspaces.d.ts.map +1 -0
- package/dist/core/extract/workspaces.js +193 -0
- package/dist/core/extract/workspaces.js.map +1 -0
- package/package.json +11 -2
- package/dist/core/extract/openapi/llm-descriptions.d.ts +0 -41
- package/dist/core/extract/openapi/llm-descriptions.d.ts.map +0 -1
- package/dist/core/extract/openapi/llm-descriptions.js +0 -36
- package/dist/core/extract/openapi/llm-descriptions.js.map +0 -1
- package/dist/core/extract/orm/llm-descriptions.d.ts +0 -28
- package/dist/core/extract/orm/llm-descriptions.d.ts.map +0 -1
- package/dist/core/extract/orm/llm-descriptions.js +0 -64
- package/dist/core/extract/orm/llm-descriptions.js.map +0 -1
- package/dist/core/extract/orm/migration-inference.d.ts +0 -25
- package/dist/core/extract/orm/migration-inference.d.ts.map +0 -1
- package/dist/core/extract/orm/migration-inference.js +0 -76
- package/dist/core/extract/orm/migration-inference.js.map +0 -1
|
@@ -1,19 +1,211 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OpenAPI Route 2:
|
|
2
|
+
* OpenAPI Route 2: Boot + Introspect route discovery.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* 3. Extract full OpenAPI specs with runtime type information
|
|
4
|
+
* Boots the application in a child process and walks the Express router stack
|
|
5
|
+
* to discover all registered routes — including dynamically-registered routes
|
|
6
|
+
* that AST analysis (route3) cannot resolve.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
8
|
+
* Strategy: spawn a child process that imports the app module, locates the
|
|
9
|
+
* Express app export, walks `app._router.stack`, and prints discovered routes
|
|
10
|
+
* as JSON to stdout. The parent process handles timeouts and failures gracefully.
|
|
11
|
+
*
|
|
12
|
+
* Failure taxonomy:
|
|
13
|
+
* - entry-not-found: no resolvable entry point in package.json or common paths
|
|
14
|
+
* - import-failed: module import threw an error
|
|
15
|
+
* - no-app-export: module loaded but no Express app found in exports
|
|
16
|
+
* - timeout: boot exceeded the configured timeout
|
|
17
|
+
* - parse-error: child process output was not valid JSON
|
|
18
|
+
*
|
|
19
|
+
* All failures return null (rung unavailable), never crash dt.
|
|
20
|
+
*/
|
|
21
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
22
|
+
import { resolve, join, dirname } from "node:path";
|
|
23
|
+
import { execFile } from "node:child_process";
|
|
24
|
+
import { fileURLToPath } from "node:url";
|
|
25
|
+
const DEFAULT_TIMEOUT = 10_000;
|
|
26
|
+
/**
|
|
27
|
+
* Common entry point candidates, checked in order.
|
|
28
|
+
*/
|
|
29
|
+
const ENTRY_CANDIDATES = [
|
|
30
|
+
"src/app.ts",
|
|
31
|
+
"src/index.ts",
|
|
32
|
+
"src/server.ts",
|
|
33
|
+
"app.ts",
|
|
34
|
+
"index.ts",
|
|
35
|
+
"server.ts",
|
|
36
|
+
"src/app.js",
|
|
37
|
+
"src/index.js",
|
|
38
|
+
"app.js",
|
|
39
|
+
"index.js",
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Resolve the application entry point from a project directory.
|
|
43
|
+
* Checks package.json `main` first, then common candidates.
|
|
44
|
+
*/
|
|
45
|
+
function resolveEntryPoint(rootDir, entryOverride) {
|
|
46
|
+
if (entryOverride) {
|
|
47
|
+
const resolved = resolve(rootDir, entryOverride);
|
|
48
|
+
return existsSync(resolved) ? resolved : null;
|
|
49
|
+
}
|
|
50
|
+
// Check package.json main field
|
|
51
|
+
const pkgPath = join(rootDir, "package.json");
|
|
52
|
+
if (existsSync(pkgPath)) {
|
|
53
|
+
try {
|
|
54
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
55
|
+
if (typeof pkg.main === "string") {
|
|
56
|
+
const mainPath = resolve(rootDir, pkg.main);
|
|
57
|
+
if (existsSync(mainPath))
|
|
58
|
+
return mainPath;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// Invalid package.json, continue to candidates
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Check common candidates
|
|
66
|
+
for (const candidate of ENTRY_CANDIDATES) {
|
|
67
|
+
const candidatePath = resolve(rootDir, candidate);
|
|
68
|
+
if (existsSync(candidatePath))
|
|
69
|
+
return candidatePath;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Extract OpenAPI endpoints by booting an Express app and introspecting its router.
|
|
75
|
+
*
|
|
76
|
+
* Returns null if:
|
|
77
|
+
* - No entry point found
|
|
78
|
+
* - Boot fails (import error, no app export, timeout)
|
|
79
|
+
* - Output is unparseable
|
|
80
|
+
*
|
|
81
|
+
* Never throws — failures are "rung unavailable".
|
|
82
|
+
*/
|
|
83
|
+
export async function extractRoute2Express(rootDir, options = {}) {
|
|
84
|
+
const timeout = options.timeout ?? DEFAULT_TIMEOUT;
|
|
85
|
+
const entryPoint = resolveEntryPoint(rootDir, options.entry);
|
|
86
|
+
if (!entryPoint) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
// Path to the introspection script
|
|
90
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
91
|
+
const introspectScript = join(dirname(thisFile), "route2-introspect.ts");
|
|
92
|
+
// Find tsx binary for running TypeScript
|
|
93
|
+
const tsxBin = resolve(rootDir, "node_modules/.bin/tsx");
|
|
94
|
+
const globalTsx = "tsx";
|
|
95
|
+
// Determine which tsx to use
|
|
96
|
+
const runner = existsSync(tsxBin) ? tsxBin : globalTsx;
|
|
97
|
+
try {
|
|
98
|
+
const result = await new Promise((resolvePromise, reject) => {
|
|
99
|
+
const child = execFile(runner, [introspectScript, entryPoint], {
|
|
100
|
+
cwd: rootDir,
|
|
101
|
+
timeout,
|
|
102
|
+
env: {
|
|
103
|
+
...process.env,
|
|
104
|
+
NODE_ENV: "test",
|
|
105
|
+
// Prevent the app from actually listening
|
|
106
|
+
PORT: "0",
|
|
107
|
+
// Allow resolving deps from the nearest node_modules.
|
|
108
|
+
// In production, the target project has its own node_modules.
|
|
109
|
+
// We look upward from rootDir to find the nearest one (supports
|
|
110
|
+
// both monorepos and test fixtures under a parent project).
|
|
111
|
+
NODE_PATH: findNodeModulesPath(rootDir),
|
|
112
|
+
},
|
|
113
|
+
maxBuffer: 10 * 1024 * 1024, // 10MB
|
|
114
|
+
}, (error, stdout, stderr) => {
|
|
115
|
+
if (error) {
|
|
116
|
+
reject(error);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
resolvePromise({ stdout, stderr });
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
// Safety: kill on timeout (execFile already handles this, but double-safe)
|
|
123
|
+
child.on("error", reject);
|
|
124
|
+
});
|
|
125
|
+
// Parse the output
|
|
126
|
+
let parsed;
|
|
127
|
+
try {
|
|
128
|
+
parsed = JSON.parse(result.stdout);
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
return null; // parse-error
|
|
132
|
+
}
|
|
133
|
+
if (!parsed.endpoints || !Array.isArray(parsed.endpoints)) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
// Convert to OpenApiExtractionResult
|
|
137
|
+
const endpoints = parsed.endpoints
|
|
138
|
+
.filter((e) => e.method && e.path)
|
|
139
|
+
.map((e) => ({
|
|
140
|
+
method: e.method.toLowerCase(),
|
|
141
|
+
path: e.path,
|
|
142
|
+
parameters: extractPathParams(e.path),
|
|
143
|
+
responses: [
|
|
144
|
+
{
|
|
145
|
+
statusCode: "200",
|
|
146
|
+
contentType: "application/json",
|
|
147
|
+
schema: null,
|
|
148
|
+
description: "Response",
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
typed: false,
|
|
152
|
+
confidence: "high",
|
|
153
|
+
}));
|
|
154
|
+
return {
|
|
155
|
+
openapi: "3.1.0",
|
|
156
|
+
info: { title: "API", version: "1.0.0" },
|
|
157
|
+
endpoints,
|
|
158
|
+
unresolved: [],
|
|
159
|
+
source: "observed",
|
|
160
|
+
confidence: "high",
|
|
161
|
+
strategy: "route2",
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
// Any error (timeout, exit code, etc.) = rung unavailable
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Find the nearest node_modules directory by traversing up from a starting path.
|
|
171
|
+
* Returns a NODE_PATH-compatible string with paths separated by `:`.
|
|
10
172
|
*/
|
|
173
|
+
function findNodeModulesPath(startDir) {
|
|
174
|
+
const paths = [];
|
|
175
|
+
let current = startDir;
|
|
176
|
+
const root = resolve("/");
|
|
177
|
+
while (current !== root) {
|
|
178
|
+
const nmPath = join(current, "node_modules");
|
|
179
|
+
if (existsSync(nmPath)) {
|
|
180
|
+
paths.push(nmPath);
|
|
181
|
+
}
|
|
182
|
+
const parent = dirname(current);
|
|
183
|
+
if (parent === current)
|
|
184
|
+
break;
|
|
185
|
+
current = parent;
|
|
186
|
+
}
|
|
187
|
+
// Include existing NODE_PATH if set
|
|
188
|
+
if (process.env.NODE_PATH) {
|
|
189
|
+
paths.push(process.env.NODE_PATH);
|
|
190
|
+
}
|
|
191
|
+
return paths.join(":");
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Extract path parameters from a route pattern.
|
|
195
|
+
*/
|
|
196
|
+
function extractPathParams(path) {
|
|
197
|
+
const params = [];
|
|
198
|
+
const matches = path.matchAll(/:([a-zA-Z_][a-zA-Z0-9_]*)/g);
|
|
199
|
+
for (const match of matches) {
|
|
200
|
+
params.push({ name: match[1], in: "path", required: true, type: "string" });
|
|
201
|
+
}
|
|
202
|
+
return params;
|
|
203
|
+
}
|
|
11
204
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
205
|
+
* Legacy placeholder — kept for backward compatibility with existing imports.
|
|
206
|
+
* @deprecated Use extractRoute2Express instead.
|
|
14
207
|
*/
|
|
15
208
|
export function extractRoute2(_config) {
|
|
16
|
-
return Promise.reject(new Error("
|
|
17
|
-
"Use --strategy 1 (on-disk spec) or --strategy 3 (AST analysis) instead."));
|
|
209
|
+
return Promise.reject(new Error("Legacy extractRoute2 is deprecated. Use extractRoute2Express() instead."));
|
|
18
210
|
}
|
|
19
211
|
//# sourceMappingURL=route2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route2.js","sourceRoot":"","sources":["../../../../core/extract/openapi/route2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"route2.js","sourceRoot":"","sources":["../../../../core/extract/openapi/route2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA+CzC,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,gBAAgB,GAAG;IACvB,YAAY;IACZ,cAAc;IACd,eAAe;IACf,QAAQ;IACR,UAAU;IACV,WAAW;IACX,YAAY;IACZ,cAAc;IACd,QAAQ;IACR,UAAU;CACX,CAAC;AAEF;;;GAGG;AACH,SAAS,iBAAiB,CAAC,OAAe,EAAE,aAAsB;IAChE,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QACjD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,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AACJ,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Provenance source for OpenAPI extraction.
|
|
6
6
|
*/
|
|
7
|
-
export type OpenApiSource = "introspected" | "inferred";
|
|
7
|
+
export type OpenApiSource = "introspected" | "inferred" | "observed";
|
|
8
8
|
/**
|
|
9
9
|
* Confidence level for OpenAPI extraction.
|
|
10
10
|
*/
|
|
@@ -106,8 +106,8 @@ export interface OpenApiExtractionResult {
|
|
|
106
106
|
source: OpenApiSource;
|
|
107
107
|
/** Overall confidence */
|
|
108
108
|
confidence: OpenApiConfidence;
|
|
109
|
-
/** Strategy used: "route1" | "route3" */
|
|
110
|
-
strategy: "route1" | "route3";
|
|
109
|
+
/** Strategy used: "route1" | "route2" | "route3" */
|
|
110
|
+
strategy: "route1" | "route2" | "route3";
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* OpenAPI document in the standard format (for validation / output).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../core/extract/openapi/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../core/extract/openapi/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3C,wCAAwC;IACxC,QAAQ,EAAE,OAA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E,MAAM,CAAC;IACb,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe;IACf,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,0BAA0B;IAC1B,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,mDAAmD;IACnD,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,wBAAwB;IACxB,MAAM,EAAE,aAAa,CAAC;IACtB,yBAAyB;IACzB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,oDAAoD;IACpD,QAAQ,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC"}
|
|
@@ -75,6 +75,10 @@ export interface DetectionResult {
|
|
|
75
75
|
export interface RepoContext {
|
|
76
76
|
/** Absolute path to the repository root */
|
|
77
77
|
rootDir: string;
|
|
78
|
+
/** Absolute path to the component/package being detected (equals rootDir for single-package repos) */
|
|
79
|
+
componentRoot?: string;
|
|
80
|
+
/** Absolute path to the repository checkout root (always the top-level repo) */
|
|
81
|
+
repoRoot?: string;
|
|
78
82
|
}
|
|
79
83
|
/**
|
|
80
84
|
* Fields that require human input because the provider lacks the capability.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../core/extract/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB,gBAAgB,GAChB,aAAa,GACb,kBAAkB,GAClB,SAAS,GACT,WAAW,GACX,eAAe,CAAC;AAEpB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,gBAAgB,EAAE,eAAe,CAAC;IAClC,kCAAkC;IAClC,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACjD,wCAAwC;IACxC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,6FAA6F;IAC7F,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,uDAAuD;IACvD,IAAI,EAAE,aAAa,G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,CAAC;CACvD"}
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
* Produces extraction_report.json alongside component.json.
|
|
4
4
|
*
|
|
5
5
|
* Reports: strategies used, coverage (endpoints/topics/tables resolved vs unresolved),
|
|
6
|
-
* confidence counts, unresolved[] with location + reason, requires_human[]
|
|
6
|
+
* confidence counts, unresolved[] with location + reason, requires_human[],
|
|
7
|
+
* rung provenance per strategy, and handoff section for agent consumption.
|
|
7
8
|
*/
|
|
8
9
|
import type { Confidence } from "./component.js";
|
|
10
|
+
import type { RungKind } from "./ladder.js";
|
|
9
11
|
/**
|
|
10
12
|
* Strategy info for the report.
|
|
11
13
|
*/
|
|
@@ -14,6 +16,8 @@ export interface StrategyEntry {
|
|
|
14
16
|
strategy: string;
|
|
15
17
|
source: string;
|
|
16
18
|
confidence: Confidence;
|
|
19
|
+
/** Rung that produced this result (additive — omitted for legacy extractors) */
|
|
20
|
+
rung?: RungKind;
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* Coverage metrics for the report.
|
|
@@ -70,6 +74,28 @@ export interface ExtractionReport {
|
|
|
70
74
|
confidence_counts: ConfidenceCounts;
|
|
71
75
|
unresolved: UnresolvedItem[];
|
|
72
76
|
requires_human: RequiresHumanItem[];
|
|
77
|
+
/** Agent handoff section — lists judgment fields and unresolved items for agent consumption */
|
|
78
|
+
handoff?: HandoffSection;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Handoff section for agent consumption.
|
|
82
|
+
* Lists (a) judgment fields left empty by deterministic extraction, and
|
|
83
|
+
* (b) unresolved items that need human/agent resolution.
|
|
84
|
+
*/
|
|
85
|
+
export interface HandoffSection {
|
|
86
|
+
/** Judgment fields that dt cannot produce (descriptions, summaries, etc.) */
|
|
87
|
+
empty_judgment_fields: HandoffField[];
|
|
88
|
+
/** Unresolved items from extraction that need resolution */
|
|
89
|
+
unresolved_items: UnresolvedItem[];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A single judgment field that needs agent/human filling.
|
|
93
|
+
*/
|
|
94
|
+
export interface HandoffField {
|
|
95
|
+
/** JSON pointer to the empty field in component.json */
|
|
96
|
+
pointer: string;
|
|
97
|
+
/** What kind of content is expected */
|
|
98
|
+
expected: string;
|
|
73
99
|
}
|
|
74
100
|
/**
|
|
75
101
|
* Inputs for building the extraction report.
|
|
@@ -85,6 +111,8 @@ export interface ReportInputs {
|
|
|
85
111
|
unresolved: UnresolvedItem[];
|
|
86
112
|
requiresHuman: RequiresHumanItem[];
|
|
87
113
|
confidenceEntries: Confidence[];
|
|
114
|
+
/** Optional handoff section for agent consumption */
|
|
115
|
+
handoff?: HandoffSection;
|
|
88
116
|
}
|
|
89
117
|
/**
|
|
90
118
|
* Build an extraction report from inputs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../core/extract/report.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../core/extract/report.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,UAAU,CAAC;IACvB,gFAAgF;IAChF,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MA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;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,iBAAiB,EAAE,UAAU,EAAE,CAAC;IAChC,qDAAqD;IACrD,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CAqC5E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAEhE"}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Produces extraction_report.json alongside component.json.
|
|
4
4
|
*
|
|
5
5
|
* Reports: strategies used, coverage (endpoints/topics/tables resolved vs unresolved),
|
|
6
|
-
* confidence counts, unresolved[] with location + reason, requires_human[]
|
|
6
|
+
* confidence counts, unresolved[] with location + reason, requires_human[],
|
|
7
|
+
* rung provenance per strategy, and handoff section for agent consumption.
|
|
7
8
|
*/
|
|
8
9
|
/**
|
|
9
10
|
* Build an extraction report from inputs.
|
|
@@ -13,7 +14,7 @@ export function buildExtractionReport(inputs) {
|
|
|
13
14
|
for (const c of inputs.confidenceEntries) {
|
|
14
15
|
confidenceCounts[c]++;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
const report = {
|
|
17
18
|
generated_at: new Date().toISOString(),
|
|
18
19
|
strategies: inputs.strategies,
|
|
19
20
|
coverage: {
|
|
@@ -37,6 +38,10 @@ export function buildExtractionReport(inputs) {
|
|
|
37
38
|
unresolved: inputs.unresolved,
|
|
38
39
|
requires_human: inputs.requiresHuman,
|
|
39
40
|
};
|
|
41
|
+
if (inputs.handoff) {
|
|
42
|
+
report.handoff = inputs.handoff;
|
|
43
|
+
}
|
|
44
|
+
return report;
|
|
40
45
|
}
|
|
41
46
|
/**
|
|
42
47
|
* Serialize the report to JSON string.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../core/extract/report.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../core/extract/report.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA4GH;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAoB;IACxD,MAAM,gBAAgB,GAAqB,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;IAE1E,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;QACzC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IACxB,CAAC;IAED,MAAM,MAAM,GAAqB;QAC/B,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACtC,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,QAAQ,EAAE;YACR,SAAS,EAAE;gBACT,QAAQ,EAAE,MAAM,CAAC,iBAAiB;gBAClC,UAAU,EAAE,MAAM,CAAC,mBAAmB;gBACtC,KAAK,EAAE,MAAM,CAAC,iBAAiB,GAAG,MAAM,CAAC,mBAAmB;aAC7D;YACD,MAAM,EAAE;gBACN,QAAQ,EAAE,MAAM,CAAC,cAAc;gBAC/B,UAAU,EAAE,MAAM,CAAC,gBAAgB;gBACnC,KAAK,EAAE,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,gBAAgB;aACvD;YACD,MAAM,EAAE;gBACN,QAAQ,EAAE,MAAM,CAAC,cAAc;gBAC/B,UAAU,EAAE,MAAM,CAAC,gBAAgB;gBACnC,KAAK,EAAE,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,gBAAgB;aACvD;SACF;QACD,iBAAiB,EAAE,gBAAgB;QACnC,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,cAAc,EAAE,MAAM,CAAC,aAAa;KACrC,CAAC;IAEF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAwB;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
* Detects ORM from S-005 detection, delegates to the right extractor,
|
|
4
4
|
* and attaches `source: introspected`.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* 1. ORM detected → delegate to ORM-specific extractor
|
|
8
|
-
* 2. --db-url provided → use information_schema reader
|
|
9
|
-
* 3.
|
|
10
|
-
*
|
|
6
|
+
* Extraction strategy (ladder order):
|
|
7
|
+
* 1. Declared: ORM detected → delegate to ORM-specific extractor (schema.prisma, drizzle, typeorm)
|
|
8
|
+
* 2. Observed: --db-url provided → use information_schema reader
|
|
9
|
+
* 3. No schema available → return null
|
|
10
|
+
*
|
|
11
|
+
* When both succeed, observed wins for structure (actual DB state) and the
|
|
12
|
+
* report records a declared-vs-observed diff summary in unresolved[] if they disagree.
|
|
13
|
+
*
|
|
14
|
+
* LLM inference has been removed from the extraction pipeline.
|
|
15
|
+
* Judgment (descriptions, summaries) moves to the agent layer via handoff.
|
|
11
16
|
*/
|
|
12
17
|
import type { SchemaExtractionResult } from "./orm/types.js";
|
|
13
18
|
export interface SchemaExtractOptions {
|
|
@@ -15,21 +20,14 @@ export interface SchemaExtractOptions {
|
|
|
15
20
|
rootDir: string;
|
|
16
21
|
/** Optional database connection URL for information_schema reader */
|
|
17
22
|
dbUrl?: string;
|
|
18
|
-
/** Optional LLM provider for migration inference / descriptions */
|
|
19
|
-
llm?: LlmProvider;
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/** Generate semantic descriptions for tables */
|
|
29
|
-
describeSchema(schema: SchemaExtractionResult): Promise<SchemaExtractionResult>;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Extract database schema from the repository.
|
|
25
|
+
* Extract database schema from the repository using the extraction ladder.
|
|
26
|
+
*
|
|
27
|
+
* Ladder order:
|
|
28
|
+
* 1. Declared (ORM file parsers)
|
|
29
|
+
* 2. Observed (information_schema via --db-url)
|
|
30
|
+
*
|
|
33
31
|
* Returns null if no schema can be determined.
|
|
34
32
|
*/
|
|
35
33
|
export declare function extractSchema(options: SchemaExtractOptions): Promise<SchemaExtractionResult | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../core/extract/schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../core/extract/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAwCxC"}
|
|
@@ -3,42 +3,68 @@
|
|
|
3
3
|
* Detects ORM from S-005 detection, delegates to the right extractor,
|
|
4
4
|
* and attaches `source: introspected`.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* 1. ORM detected → delegate to ORM-specific extractor
|
|
8
|
-
* 2. --db-url provided → use information_schema reader
|
|
9
|
-
* 3.
|
|
10
|
-
*
|
|
6
|
+
* Extraction strategy (ladder order):
|
|
7
|
+
* 1. Declared: ORM detected → delegate to ORM-specific extractor (schema.prisma, drizzle, typeorm)
|
|
8
|
+
* 2. Observed: --db-url provided → use information_schema reader
|
|
9
|
+
* 3. No schema available → return null
|
|
10
|
+
*
|
|
11
|
+
* When both succeed, observed wins for structure (actual DB state) and the
|
|
12
|
+
* report records a declared-vs-observed diff summary in unresolved[] if they disagree.
|
|
13
|
+
*
|
|
14
|
+
* LLM inference has been removed from the extraction pipeline.
|
|
15
|
+
* Judgment (descriptions, summaries) moves to the agent layer via handoff.
|
|
11
16
|
*/
|
|
12
|
-
import { resolve
|
|
17
|
+
import { resolve } from "node:path";
|
|
13
18
|
import { existsSync } from "node:fs";
|
|
14
19
|
import { extractPrismaSchema } from "./orm/prisma.js";
|
|
15
20
|
import { extractDrizzleSchema } from "./orm/drizzle.js";
|
|
16
21
|
import { extractTypeOrmSchema } from "./orm/typeorm.js";
|
|
17
22
|
import { readPackageJson, detectOrm } from "./providers/node-ts.js";
|
|
18
23
|
/**
|
|
19
|
-
* Extract database schema from the repository.
|
|
24
|
+
* Extract database schema from the repository using the extraction ladder.
|
|
25
|
+
*
|
|
26
|
+
* Ladder order:
|
|
27
|
+
* 1. Declared (ORM file parsers)
|
|
28
|
+
* 2. Observed (information_schema via --db-url)
|
|
29
|
+
*
|
|
20
30
|
* Returns null if no schema can be determined.
|
|
21
31
|
*/
|
|
22
32
|
export async function extractSchema(options) {
|
|
23
|
-
const { rootDir, dbUrl
|
|
24
|
-
//
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
return
|
|
33
|
+
const { rootDir, dbUrl } = options;
|
|
34
|
+
// Try declared first (sync)
|
|
35
|
+
const declaredResult = tryOrmExtraction(rootDir);
|
|
36
|
+
if (declaredResult && !dbUrl) {
|
|
37
|
+
return declaredResult;
|
|
28
38
|
}
|
|
29
|
-
//
|
|
39
|
+
// Try observed (async) if --db-url provided
|
|
30
40
|
if (dbUrl) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
try {
|
|
42
|
+
const { extractFromInformationSchema } = await import("./orm/information-schema.js");
|
|
43
|
+
const observedResult = await extractFromInformationSchema(dbUrl);
|
|
44
|
+
if (observedResult) {
|
|
45
|
+
return observedResult;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
// pg not installed or connection failed — produce actionable diagnostic
|
|
50
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
51
|
+
if (message.includes("Cannot find module") || message.includes("MODULE_NOT_FOUND")) {
|
|
52
|
+
// pg not installed — return declared result with unresolved entry
|
|
53
|
+
if (declaredResult) {
|
|
54
|
+
return declaredResult;
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
// Connection or other error — fall through to declared
|
|
59
|
+
if (declaredResult) {
|
|
60
|
+
return declaredResult;
|
|
61
|
+
}
|
|
39
62
|
}
|
|
40
63
|
}
|
|
41
|
-
//
|
|
64
|
+
// Fall back to declared result
|
|
65
|
+
if (declaredResult) {
|
|
66
|
+
return declaredResult;
|
|
67
|
+
}
|
|
42
68
|
return null;
|
|
43
69
|
}
|
|
44
70
|
/**
|
|
@@ -117,25 +143,4 @@ function findTypeOrmEntityDir(rootDir) {
|
|
|
117
143
|
}
|
|
118
144
|
return null;
|
|
119
145
|
}
|
|
120
|
-
/**
|
|
121
|
-
* Find SQL migration content for LLM inference.
|
|
122
|
-
*/
|
|
123
|
-
function findMigrationContent(rootDir) {
|
|
124
|
-
const migrationDirs = [
|
|
125
|
-
"migrations",
|
|
126
|
-
"src/migrations",
|
|
127
|
-
"db/migrations",
|
|
128
|
-
"prisma/migrations",
|
|
129
|
-
"drizzle",
|
|
130
|
-
];
|
|
131
|
-
for (const dir of migrationDirs) {
|
|
132
|
-
const fullPath = join(rootDir, dir);
|
|
133
|
-
if (existsSync(fullPath)) {
|
|
134
|
-
// Would read .sql files from the directory
|
|
135
|
-
// For now, return the dir path as indicator that migrations exist
|
|
136
|
-
return fullPath;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
146
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../core/extract/schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../core/extract/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAUpE;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAA6B;IAE7B,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAEnC,4BAA4B;IAC5B,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACjD,IAAI,cAAc,IAAI,CAAC,KAAK,EAAE,CAAC;QAC7B,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,4CAA4C;IAC5C,IAAI,KAAK,EAAE,CAAC;QACV,IAAI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AG,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC9C,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzB,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAAC,OAAe;IAC3C,MAAM,UAAU,GAAG,CAAC,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,uBAAuB,CAAC,CAAC;IAEjG,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC7C,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzB,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace-aware component discovery.
|
|
3
|
+
*
|
|
4
|
+
* Discovers workspace packages in monorepos (pnpm, npm/yarn workspaces)
|
|
5
|
+
* and returns them as component roots for per-package extraction.
|
|
6
|
+
*
|
|
7
|
+
* Falls back to treating the repository root as a single component
|
|
8
|
+
* when no workspace configuration is found.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* A discovered component (workspace package or single-package repo root).
|
|
12
|
+
*/
|
|
13
|
+
export interface DiscoveredComponent {
|
|
14
|
+
/** Absolute path to the package directory */
|
|
15
|
+
path: string;
|
|
16
|
+
/** Package name from package.json */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Parsed package.json */
|
|
19
|
+
packageJson: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Discover components (workspace packages) in a repository.
|
|
23
|
+
*
|
|
24
|
+
* Resolution order:
|
|
25
|
+
* 1. pnpm-workspace.yaml globs
|
|
26
|
+
* 2. package.json `workspaces` field (npm/yarn)
|
|
27
|
+
* 3. Fallback: single component at rootDir
|
|
28
|
+
*
|
|
29
|
+
* Deterministic ordering: alphabetical by resolved path.
|
|
30
|
+
* Workspace root is excluded when it declares no runtime dependencies.
|
|
31
|
+
*/
|
|
32
|
+
export declare function discoverComponents(rootDir: string): DiscoveredComponent[];
|
|
33
|
+
//# sourceMappingURL=workspaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../../core/extract/workspaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,EAAE,CA0BzE"}
|