@llipe.com/dev-tasks 0.8.0 → 0.9.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/.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 +46 -0
- package/CLAUDE.md +6 -3
- package/README.md +108 -112
- 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/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 +10 -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
|
@@ -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/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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,EAA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-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"}
|
|
@@ -0,0 +1,193 @@
|
|
|
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
|
+
import { readFileSync, existsSync, readdirSync, statSync } from "node:fs";
|
|
11
|
+
import { resolve, join, relative } from "node:path";
|
|
12
|
+
/**
|
|
13
|
+
* Discover components (workspace packages) in a repository.
|
|
14
|
+
*
|
|
15
|
+
* Resolution order:
|
|
16
|
+
* 1. pnpm-workspace.yaml globs
|
|
17
|
+
* 2. package.json `workspaces` field (npm/yarn)
|
|
18
|
+
* 3. Fallback: single component at rootDir
|
|
19
|
+
*
|
|
20
|
+
* Deterministic ordering: alphabetical by resolved path.
|
|
21
|
+
* Workspace root is excluded when it declares no runtime dependencies.
|
|
22
|
+
*/
|
|
23
|
+
export function discoverComponents(rootDir) {
|
|
24
|
+
// Try pnpm workspace first
|
|
25
|
+
const pnpmWorkspaces = discoverPnpmWorkspaces(rootDir);
|
|
26
|
+
if (pnpmWorkspaces.length > 0) {
|
|
27
|
+
return filterAndSort(rootDir, pnpmWorkspaces);
|
|
28
|
+
}
|
|
29
|
+
// Try npm/yarn workspaces
|
|
30
|
+
const npmWorkspaces = discoverNpmWorkspaces(rootDir);
|
|
31
|
+
if (npmWorkspaces.length > 0) {
|
|
32
|
+
return filterAndSort(rootDir, npmWorkspaces);
|
|
33
|
+
}
|
|
34
|
+
// Fallback: single package at root
|
|
35
|
+
const rootPkg = readPackageJson(rootDir);
|
|
36
|
+
if (rootPkg) {
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
path: rootDir,
|
|
40
|
+
name: rootPkg.name || relative(resolve(rootDir, ".."), rootDir),
|
|
41
|
+
packageJson: rootPkg,
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
return [{ path: rootDir, name: "unknown", packageJson: {} }];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Discover packages from pnpm-workspace.yaml.
|
|
49
|
+
*/
|
|
50
|
+
function discoverPnpmWorkspaces(rootDir) {
|
|
51
|
+
const workspaceFile = join(rootDir, "pnpm-workspace.yaml");
|
|
52
|
+
if (!existsSync(workspaceFile))
|
|
53
|
+
return [];
|
|
54
|
+
const content = readFileSync(workspaceFile, "utf-8");
|
|
55
|
+
// Simple YAML parsing for the packages field
|
|
56
|
+
// Handles: packages:\n - "glob"\n - 'glob'\n - glob
|
|
57
|
+
const packagesMatch = content.match(/packages:\s*\n((?:\s+-\s+.+\n?)*)/);
|
|
58
|
+
if (!packagesMatch)
|
|
59
|
+
return [];
|
|
60
|
+
const globs = [];
|
|
61
|
+
const lines = packagesMatch[1].split("\n");
|
|
62
|
+
for (const line of lines) {
|
|
63
|
+
const match = line.match(/^\s+-\s+["']?([^"'\n]+?)["']?\s*$/);
|
|
64
|
+
if (match) {
|
|
65
|
+
globs.push(match[1]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return resolveGlobs(rootDir, globs);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Discover packages from package.json workspaces field.
|
|
72
|
+
*/
|
|
73
|
+
function discoverNpmWorkspaces(rootDir) {
|
|
74
|
+
const pkg = readPackageJson(rootDir);
|
|
75
|
+
if (!pkg)
|
|
76
|
+
return [];
|
|
77
|
+
const workspaces = pkg.workspaces;
|
|
78
|
+
if (!workspaces)
|
|
79
|
+
return [];
|
|
80
|
+
// workspaces can be an array of globs or an object with packages array
|
|
81
|
+
let globs;
|
|
82
|
+
if (Array.isArray(workspaces)) {
|
|
83
|
+
globs = workspaces;
|
|
84
|
+
}
|
|
85
|
+
else if (typeof workspaces === "object" &&
|
|
86
|
+
Array.isArray(workspaces.packages)) {
|
|
87
|
+
globs = workspaces.packages;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
return resolveGlobs(rootDir, globs);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Resolve workspace globs to actual package directories.
|
|
96
|
+
* Supports simple `dir/*` globs (one level of wildcard).
|
|
97
|
+
* Does not recurse into node_modules.
|
|
98
|
+
*/
|
|
99
|
+
function resolveGlobs(rootDir, globs) {
|
|
100
|
+
const components = [];
|
|
101
|
+
for (const glob of globs) {
|
|
102
|
+
if (glob.endsWith("/*") || glob.endsWith("/**")) {
|
|
103
|
+
// Directory wildcard: resolve all subdirectories
|
|
104
|
+
const baseDir = glob.replace(/\/\*\*?$/, "");
|
|
105
|
+
const resolvedBase = resolve(rootDir, baseDir);
|
|
106
|
+
if (!existsSync(resolvedBase))
|
|
107
|
+
continue;
|
|
108
|
+
let entries;
|
|
109
|
+
try {
|
|
110
|
+
entries = readdirSync(resolvedBase);
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
for (const entry of entries) {
|
|
116
|
+
if (entry === "node_modules" || entry.startsWith("."))
|
|
117
|
+
continue;
|
|
118
|
+
const entryPath = join(resolvedBase, entry);
|
|
119
|
+
try {
|
|
120
|
+
if (!statSync(entryPath).isDirectory())
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
const pkg = readPackageJson(entryPath);
|
|
127
|
+
if (pkg) {
|
|
128
|
+
components.push({
|
|
129
|
+
path: entryPath,
|
|
130
|
+
name: pkg.name || entry,
|
|
131
|
+
packageJson: pkg,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
// Exact path
|
|
138
|
+
const resolvedPath = resolve(rootDir, glob);
|
|
139
|
+
if (!existsSync(resolvedPath))
|
|
140
|
+
continue;
|
|
141
|
+
const pkg = readPackageJson(resolvedPath);
|
|
142
|
+
if (pkg) {
|
|
143
|
+
components.push({
|
|
144
|
+
path: resolvedPath,
|
|
145
|
+
name: pkg.name || glob,
|
|
146
|
+
packageJson: pkg,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return components;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Filter out workspace root (if no runtime deps) and sort alphabetically by path.
|
|
155
|
+
*/
|
|
156
|
+
function filterAndSort(rootDir, components) {
|
|
157
|
+
// Include workspace root only if it has runtime dependencies
|
|
158
|
+
const rootPkg = readPackageJson(rootDir);
|
|
159
|
+
if (rootPkg && hasRuntimeDeps(rootPkg)) {
|
|
160
|
+
const rootAlreadyIncluded = components.some((c) => c.path === rootDir);
|
|
161
|
+
if (!rootAlreadyIncluded) {
|
|
162
|
+
components.push({
|
|
163
|
+
path: rootDir,
|
|
164
|
+
name: rootPkg.name || "root",
|
|
165
|
+
packageJson: rootPkg,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Sort alphabetically by path
|
|
170
|
+
return components.sort((a, b) => a.path.localeCompare(b.path));
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Check if a package.json has runtime dependencies.
|
|
174
|
+
*/
|
|
175
|
+
function hasRuntimeDeps(pkg) {
|
|
176
|
+
const deps = pkg.dependencies;
|
|
177
|
+
return !!deps && Object.keys(deps).length > 0;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Read and parse a package.json from a directory. Returns null on failure.
|
|
181
|
+
*/
|
|
182
|
+
function readPackageJson(dir) {
|
|
183
|
+
const pkgPath = join(dir, "package.json");
|
|
184
|
+
if (!existsSync(pkgPath))
|
|
185
|
+
return null;
|
|
186
|
+
try {
|
|
187
|
+
return JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=workspaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../core/extract/workspaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAcpD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,2BAA2B;IAC3B,MAAM,cAAc,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACvD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,aAAa,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAChD,CAAC;IAED,0BAA0B;IAC1B,MAAM,aAAa,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACrD,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED,mCAAmC;IACnC,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO;YACL;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAG,OAAO,CAAC,IAAe,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC;gBAC3E,WAAW,EAAE,OAAO;aACrB;SACF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,E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rB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,8BAA8B;IAC9B,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,GAA4B;IAClD,MAAM,IAAI,GAAG,GAAG,CAAC,YAAmD,CAAC;IACrE,OAAO,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,GAAW;IAClC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAC1C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAA4B,CAAC;IAC/E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llipe.com/dev-tasks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Multi-repo context tooling for dev-tasks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"imports": {
|
|
@@ -73,12 +73,14 @@
|
|
|
73
73
|
"license": "ISC",
|
|
74
74
|
"packageManager": "pnpm@10.11.0",
|
|
75
75
|
"devDependencies": {
|
|
76
|
+
"@types/express": "^5.0.6",
|
|
76
77
|
"@types/node": "22.15.18",
|
|
77
78
|
"@typescript-eslint/eslint-plugin": "8.32.1",
|
|
78
79
|
"@typescript-eslint/parser": "8.32.1",
|
|
79
80
|
"eslint": "9.27.0",
|
|
80
81
|
"eslint-config-prettier": "10.1.5",
|
|
81
82
|
"eslint-plugin-import-x": "4.12.2",
|
|
83
|
+
"express": "^5.2.1",
|
|
82
84
|
"globals": "16.1.0",
|
|
83
85
|
"prettier": "3.5.3",
|
|
84
86
|
"tsx": "4.19.4",
|
|
@@ -92,7 +94,13 @@
|
|
|
92
94
|
"yaml": "2.8.3"
|
|
93
95
|
},
|
|
94
96
|
"peerDependencies": {
|
|
95
|
-
"typescript": ">=5.0.0"
|
|
97
|
+
"typescript": ">=5.0.0",
|
|
98
|
+
"pg": ">=8.0.0"
|
|
99
|
+
},
|
|
100
|
+
"peerDependenciesMeta": {
|
|
101
|
+
"pg": {
|
|
102
|
+
"optional": true
|
|
103
|
+
}
|
|
96
104
|
},
|
|
97
105
|
"pnpm": {
|
|
98
106
|
"overrides": {
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LLM description pass for OpenAPI endpoints.
|
|
3
|
-
* Writes only `summary`, `description`, `tags` per endpoint.
|
|
4
|
-
* Does NOT modify structural information (paths, methods, params, schemas).
|
|
5
|
-
*/
|
|
6
|
-
import type { OpenApiExtractionResult } from "./types.js";
|
|
7
|
-
/**
|
|
8
|
-
* LLM provider interface for OpenAPI description generation.
|
|
9
|
-
* Consumers provide an implementation; tests use stubs.
|
|
10
|
-
*/
|
|
11
|
-
export interface OpenApiLlmProvider {
|
|
12
|
-
/**
|
|
13
|
-
* Generate summary, description, and tags for a set of endpoints.
|
|
14
|
-
* Must NOT modify structural fields (method, path, parameters, requestBody, responses).
|
|
15
|
-
*/
|
|
16
|
-
describeEndpoints(endpoints: EndpointDescriptionInput[]): Promise<EndpointDescriptionOutput[]>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Input to the LLM for describing an endpoint.
|
|
20
|
-
*/
|
|
21
|
-
export interface EndpointDescriptionInput {
|
|
22
|
-
method: string;
|
|
23
|
-
path: string;
|
|
24
|
-
parameters: string[];
|
|
25
|
-
hasBody: boolean;
|
|
26
|
-
responseType: string | null;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* LLM output: only descriptive fields.
|
|
30
|
-
*/
|
|
31
|
-
export interface EndpointDescriptionOutput {
|
|
32
|
-
summary: string;
|
|
33
|
-
description: string;
|
|
34
|
-
tags: string[];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Apply LLM-generated descriptions to an extraction result.
|
|
38
|
-
* Only writes summary, description, and tags — nothing structural.
|
|
39
|
-
*/
|
|
40
|
-
export declare function applyLlmDescriptions(result: OpenApiExtractionResult, llm: OpenApiLlmProvider): Promise<OpenApiExtractionResult>;
|
|
41
|
-
//# sourceMappingURL=llm-descriptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"llm-descriptions.d.ts","sourceRoot":"","sources":["../../../../core/extract/openapi/llm-descriptions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAqB,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE7E;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,CAAC,SAAS,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAAC;CAChG;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,uBAAuB,EAC/B,GAAG,EAAE,kBAAkB,GACtB,OAAO,CAAC,uBAAuB,CAAC,CA2BlC"}
|