autodocs-engine 0.5.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 +185 -0
- package/dist/analysis-builder.d.ts +13 -0
- package/dist/analysis-builder.js +268 -0
- package/dist/analysis-builder.js.map +1 -0
- package/dist/anti-pattern-detector.d.ts +9 -0
- package/dist/anti-pattern-detector.js +58 -0
- package/dist/anti-pattern-detector.js.map +1 -0
- package/dist/architecture-detector.d.ts +7 -0
- package/dist/architecture-detector.js +212 -0
- package/dist/architecture-detector.js.map +1 -0
- package/dist/ast-parser.d.ts +5 -0
- package/dist/ast-parser.js +635 -0
- package/dist/ast-parser.js.map +1 -0
- package/dist/benchmark/code-generator.d.ts +20 -0
- package/dist/benchmark/code-generator.js +206 -0
- package/dist/benchmark/code-generator.js.map +1 -0
- package/dist/benchmark/pr-miner.d.ts +61 -0
- package/dist/benchmark/pr-miner.js +304 -0
- package/dist/benchmark/pr-miner.js.map +1 -0
- package/dist/benchmark/pr-runner.d.ts +58 -0
- package/dist/benchmark/pr-runner.js +346 -0
- package/dist/benchmark/pr-runner.js.map +1 -0
- package/dist/benchmark/pr-scorer.d.ts +48 -0
- package/dist/benchmark/pr-scorer.js +222 -0
- package/dist/benchmark/pr-scorer.js.map +1 -0
- package/dist/benchmark/pr-task-gen.d.ts +16 -0
- package/dist/benchmark/pr-task-gen.js +129 -0
- package/dist/benchmark/pr-task-gen.js.map +1 -0
- package/dist/benchmark/report.d.ts +9 -0
- package/dist/benchmark/report.js +131 -0
- package/dist/benchmark/report.js.map +1 -0
- package/dist/benchmark/runner.d.ts +6 -0
- package/dist/benchmark/runner.js +183 -0
- package/dist/benchmark/runner.js.map +1 -0
- package/dist/benchmark/scorer.d.ts +6 -0
- package/dist/benchmark/scorer.js +549 -0
- package/dist/benchmark/scorer.js.map +1 -0
- package/dist/benchmark/shuffler.d.ts +5 -0
- package/dist/benchmark/shuffler.js +70 -0
- package/dist/benchmark/shuffler.js.map +1 -0
- package/dist/benchmark/statistics.d.ts +36 -0
- package/dist/benchmark/statistics.js +159 -0
- package/dist/benchmark/statistics.js.map +1 -0
- package/dist/benchmark/task-generator.d.ts +20 -0
- package/dist/benchmark/task-generator.js +388 -0
- package/dist/benchmark/task-generator.js.map +1 -0
- package/dist/benchmark/types.d.ts +111 -0
- package/dist/benchmark/types.js +3 -0
- package/dist/benchmark/types.js.map +1 -0
- package/dist/bin/autodocs-engine.d.ts +2 -0
- package/dist/bin/autodocs-engine.js +296 -0
- package/dist/bin/autodocs-engine.js.map +1 -0
- package/dist/bin/benchmark.d.ts +14 -0
- package/dist/bin/benchmark.js +172 -0
- package/dist/bin/benchmark.js.map +1 -0
- package/dist/bin/check.d.ts +13 -0
- package/dist/bin/check.js +79 -0
- package/dist/bin/check.js.map +1 -0
- package/dist/bin/init.d.ts +11 -0
- package/dist/bin/init.js +268 -0
- package/dist/bin/init.js.map +1 -0
- package/dist/bin/serve.d.ts +4 -0
- package/dist/bin/serve.js +29 -0
- package/dist/bin/serve.js.map +1 -0
- package/dist/budget-validator.d.ts +22 -0
- package/dist/budget-validator.js +119 -0
- package/dist/budget-validator.js.map +1 -0
- package/dist/command-extractor.d.ts +10 -0
- package/dist/command-extractor.js +276 -0
- package/dist/command-extractor.js.map +1 -0
- package/dist/config-analyzer.d.ts +5 -0
- package/dist/config-analyzer.js +364 -0
- package/dist/config-analyzer.js.map +1 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.js +172 -0
- package/dist/config.js.map +1 -0
- package/dist/contribution-patterns.d.ts +6 -0
- package/dist/contribution-patterns.js +263 -0
- package/dist/contribution-patterns.js.map +1 -0
- package/dist/convention-extractor.d.ts +17 -0
- package/dist/convention-extractor.js +90 -0
- package/dist/convention-extractor.js.map +1 -0
- package/dist/cross-package.d.ts +5 -0
- package/dist/cross-package.js +71 -0
- package/dist/cross-package.js.map +1 -0
- package/dist/dependency-analyzer.d.ts +5 -0
- package/dist/dependency-analyzer.js +233 -0
- package/dist/dependency-analyzer.js.map +1 -0
- package/dist/detectors/build-tool.d.ts +2 -0
- package/dist/detectors/build-tool.js +67 -0
- package/dist/detectors/build-tool.js.map +1 -0
- package/dist/detectors/component-patterns.d.ts +2 -0
- package/dist/detectors/component-patterns.js +49 -0
- package/dist/detectors/component-patterns.js.map +1 -0
- package/dist/detectors/data-fetching.d.ts +2 -0
- package/dist/detectors/data-fetching.js +127 -0
- package/dist/detectors/data-fetching.js.map +1 -0
- package/dist/detectors/database.d.ts +2 -0
- package/dist/detectors/database.js +54 -0
- package/dist/detectors/database.js.map +1 -0
- package/dist/detectors/error-handling.d.ts +2 -0
- package/dist/detectors/error-handling.js +47 -0
- package/dist/detectors/error-handling.js.map +1 -0
- package/dist/detectors/export-patterns.d.ts +2 -0
- package/dist/detectors/export-patterns.js +64 -0
- package/dist/detectors/export-patterns.js.map +1 -0
- package/dist/detectors/file-naming.d.ts +2 -0
- package/dist/detectors/file-naming.js +74 -0
- package/dist/detectors/file-naming.js.map +1 -0
- package/dist/detectors/graphql-patterns.d.ts +2 -0
- package/dist/detectors/graphql-patterns.js +47 -0
- package/dist/detectors/graphql-patterns.js.map +1 -0
- package/dist/detectors/hook-patterns.d.ts +2 -0
- package/dist/detectors/hook-patterns.js +105 -0
- package/dist/detectors/hook-patterns.js.map +1 -0
- package/dist/detectors/import-patterns.d.ts +2 -0
- package/dist/detectors/import-patterns.js +88 -0
- package/dist/detectors/import-patterns.js.map +1 -0
- package/dist/detectors/telemetry-patterns.d.ts +2 -0
- package/dist/detectors/telemetry-patterns.js +42 -0
- package/dist/detectors/telemetry-patterns.js.map +1 -0
- package/dist/detectors/test-framework-ecosystem.d.ts +2 -0
- package/dist/detectors/test-framework-ecosystem.js +95 -0
- package/dist/detectors/test-framework-ecosystem.js.map +1 -0
- package/dist/detectors/test-patterns.d.ts +2 -0
- package/dist/detectors/test-patterns.js +60 -0
- package/dist/detectors/test-patterns.js.map +1 -0
- package/dist/detectors/web-framework.d.ts +2 -0
- package/dist/detectors/web-framework.js +51 -0
- package/dist/detectors/web-framework.js.map +1 -0
- package/dist/deterministic-formatter.d.ts +54 -0
- package/dist/deterministic-formatter.js +922 -0
- package/dist/deterministic-formatter.js.map +1 -0
- package/dist/diff-analyzer.d.ts +7 -0
- package/dist/diff-analyzer.js +126 -0
- package/dist/diff-analyzer.js.map +1 -0
- package/dist/example-extractor.d.ts +6 -0
- package/dist/example-extractor.js +115 -0
- package/dist/example-extractor.js.map +1 -0
- package/dist/existing-docs.d.ts +36 -0
- package/dist/existing-docs.js +257 -0
- package/dist/existing-docs.js.map +1 -0
- package/dist/file-discovery.d.ts +6 -0
- package/dist/file-discovery.js +154 -0
- package/dist/file-discovery.js.map +1 -0
- package/dist/git-history.d.ts +41 -0
- package/dist/git-history.js +401 -0
- package/dist/git-history.js.map +1 -0
- package/dist/impact-classifier.d.ts +22 -0
- package/dist/impact-classifier.js +87 -0
- package/dist/impact-classifier.js.map +1 -0
- package/dist/impact-radius.d.ts +23 -0
- package/dist/impact-radius.js +130 -0
- package/dist/impact-radius.js.map +1 -0
- package/dist/import-chain.d.ts +12 -0
- package/dist/import-chain.js +93 -0
- package/dist/import-chain.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -0
- package/dist/inferability.d.ts +16 -0
- package/dist/inferability.js +142 -0
- package/dist/inferability.js.map +1 -0
- package/dist/llm/adapter.d.ts +33 -0
- package/dist/llm/adapter.js +202 -0
- package/dist/llm/adapter.js.map +1 -0
- package/dist/llm/client.d.ts +5 -0
- package/dist/llm/client.js +68 -0
- package/dist/llm/client.js.map +1 -0
- package/dist/llm/hierarchical.d.ts +23 -0
- package/dist/llm/hierarchical.js +126 -0
- package/dist/llm/hierarchical.js.map +1 -0
- package/dist/llm/serializer.d.ts +19 -0
- package/dist/llm/serializer.js +363 -0
- package/dist/llm/serializer.js.map +1 -0
- package/dist/llm/template-selector.d.ts +7 -0
- package/dist/llm/template-selector.js +21 -0
- package/dist/llm/template-selector.js.map +1 -0
- package/dist/llm-adapter.d.ts +2 -0
- package/dist/llm-adapter.js +5 -0
- package/dist/llm-adapter.js.map +1 -0
- package/dist/mcp/cache.d.ts +30 -0
- package/dist/mcp/cache.js +112 -0
- package/dist/mcp/cache.js.map +1 -0
- package/dist/mcp/errors.d.ts +21 -0
- package/dist/mcp/errors.js +27 -0
- package/dist/mcp/errors.js.map +1 -0
- package/dist/mcp/queries.d.ts +27 -0
- package/dist/mcp/queries.js +121 -0
- package/dist/mcp/queries.js.map +1 -0
- package/dist/mcp/server.d.ts +14 -0
- package/dist/mcp/server.js +131 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +39 -0
- package/dist/mcp/tools.js +249 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mermaid-generator.d.ts +6 -0
- package/dist/mermaid-generator.js +59 -0
- package/dist/mermaid-generator.js.map +1 -0
- package/dist/meta-tool-detector.d.ts +23 -0
- package/dist/meta-tool-detector.js +177 -0
- package/dist/meta-tool-detector.js.map +1 -0
- package/dist/output-validator.d.ts +6 -0
- package/dist/output-validator.js +471 -0
- package/dist/output-validator.js.map +1 -0
- package/dist/pattern-fingerprinter.d.ts +7 -0
- package/dist/pattern-fingerprinter.js +241 -0
- package/dist/pattern-fingerprinter.js.map +1 -0
- package/dist/pipeline.d.ts +5 -0
- package/dist/pipeline.js +374 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/plugin-loader.d.ts +19 -0
- package/dist/plugin-loader.js +124 -0
- package/dist/plugin-loader.js.map +1 -0
- package/dist/role-inferrer.d.ts +5 -0
- package/dist/role-inferrer.js +159 -0
- package/dist/role-inferrer.js.map +1 -0
- package/dist/symbol-graph.d.ts +11 -0
- package/dist/symbol-graph.js +613 -0
- package/dist/symbol-graph.js.map +1 -0
- package/dist/templates/agents-md.d.ts +20 -0
- package/dist/templates/agents-md.js +346 -0
- package/dist/templates/agents-md.js.map +1 -0
- package/dist/templates/claude-md.d.ts +4 -0
- package/dist/templates/claude-md.js +23 -0
- package/dist/templates/claude-md.js.map +1 -0
- package/dist/templates/cursorrules.d.ts +4 -0
- package/dist/templates/cursorrules.js +18 -0
- package/dist/templates/cursorrules.js.map +1 -0
- package/dist/tier-classifier.d.ts +7 -0
- package/dist/tier-classifier.js +32 -0
- package/dist/tier-classifier.js.map +1 -0
- package/dist/types.d.ts +428 -0
- package/dist/types.js +42 -0
- package/dist/types.js.map +1 -0
- package/dist/workflow-rules.d.ts +18 -0
- package/dist/workflow-rules.js +131 -0
- package/dist/workflow-rules.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
// src/symbol-graph.ts — Module 3: Symbol Graph Builder
|
|
2
|
+
// Errata applied: E-22 (exports field resolution), E-23 (cycle detection),
|
|
3
|
+
// E-24 (star re-export expansion), E-25 (aliased exports),
|
|
4
|
+
// E-9 (barrelFile field), E-20 (.js→.ts mapping), E-21 (path boundary)
|
|
5
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
6
|
+
import { resolve, relative, dirname, join } from "node:path";
|
|
7
|
+
/**
|
|
8
|
+
* Build a package-level symbol graph from parsed files.
|
|
9
|
+
* Resolves barrel re-exports to their source definitions.
|
|
10
|
+
*/
|
|
11
|
+
export function buildSymbolGraph(parsedFiles, packageDir, warnings = []) {
|
|
12
|
+
const absPackageDir = resolve(packageDir);
|
|
13
|
+
// Build lookups
|
|
14
|
+
const fileMap = new Map();
|
|
15
|
+
const allExports = new Map();
|
|
16
|
+
const importGraph = new Map();
|
|
17
|
+
for (const pf of parsedFiles) {
|
|
18
|
+
fileMap.set(pf.relativePath, pf);
|
|
19
|
+
allExports.set(pf.relativePath, pf.exports);
|
|
20
|
+
importGraph.set(pf.relativePath, pf.imports);
|
|
21
|
+
}
|
|
22
|
+
// Find barrel file (E-9, E-22)
|
|
23
|
+
const barrelFile = findBarrelFile(absPackageDir, fileMap, warnings);
|
|
24
|
+
if (!barrelFile) {
|
|
25
|
+
// Fix A: Try bin entry files as alternative entry points for CLI packages
|
|
26
|
+
const binExports = extractBinEntryExports(absPackageDir, fileMap, allExports, importGraph, warnings);
|
|
27
|
+
if (binExports.length > 0) {
|
|
28
|
+
const binSourceFiles = new Set();
|
|
29
|
+
for (const exp of binExports) {
|
|
30
|
+
binSourceFiles.add(exp.definedIn);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
barrelFile: undefined,
|
|
34
|
+
barrelExports: binExports,
|
|
35
|
+
allExports,
|
|
36
|
+
importGraph,
|
|
37
|
+
barrelSourceFiles: binSourceFiles,
|
|
38
|
+
callGraph: buildCallGraph(parsedFiles, absPackageDir, warnings),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
warnings.push({
|
|
42
|
+
level: "info",
|
|
43
|
+
module: "symbol-graph",
|
|
44
|
+
message: "No barrel file found — publicAPI will be empty.",
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
barrelFile: undefined,
|
|
48
|
+
barrelExports: [],
|
|
49
|
+
allExports,
|
|
50
|
+
importGraph,
|
|
51
|
+
barrelSourceFiles: new Set(),
|
|
52
|
+
callGraph: buildCallGraph(parsedFiles, absPackageDir, warnings),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const barrelParsed = fileMap.get(barrelFile);
|
|
56
|
+
if (!barrelParsed) {
|
|
57
|
+
warnings.push({
|
|
58
|
+
level: "warn",
|
|
59
|
+
module: "symbol-graph",
|
|
60
|
+
message: `Barrel file ${barrelFile} found but not in parsed files.`,
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
barrelFile,
|
|
64
|
+
barrelExports: [],
|
|
65
|
+
allExports,
|
|
66
|
+
importGraph,
|
|
67
|
+
barrelSourceFiles: new Set(),
|
|
68
|
+
callGraph: buildCallGraph(parsedFiles, absPackageDir, warnings),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// Resolve barrel exports
|
|
72
|
+
const barrelSourceFiles = new Set();
|
|
73
|
+
barrelSourceFiles.add(barrelFile);
|
|
74
|
+
const barrelExports = [];
|
|
75
|
+
for (const exp of barrelParsed.exports) {
|
|
76
|
+
if (exp.name === "*" && exp.isReExport && exp.reExportSource) {
|
|
77
|
+
// E-24: Star re-export expansion
|
|
78
|
+
const targetRelPath = resolveModuleSpecifier(exp.reExportSource, dirname(resolve(absPackageDir, barrelFile)), absPackageDir, warnings);
|
|
79
|
+
if (targetRelPath) {
|
|
80
|
+
barrelSourceFiles.add(targetRelPath);
|
|
81
|
+
expandStarExport(targetRelPath, fileMap, absPackageDir, barrelExports, barrelSourceFiles, warnings, new Set([barrelFile]), exp.isTypeOnly);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
warnings.push({
|
|
85
|
+
level: "warn",
|
|
86
|
+
module: "symbol-graph",
|
|
87
|
+
message: `Unresolved star re-export from "${exp.reExportSource}" in ${barrelFile}`,
|
|
88
|
+
file: barrelFile,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else if (exp.isReExport && exp.reExportSource) {
|
|
93
|
+
// Named re-export
|
|
94
|
+
const resolved = resolveReExportChain(exp, barrelFile, fileMap, absPackageDir, barrelSourceFiles, warnings, new Set());
|
|
95
|
+
barrelExports.push(resolved);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// Direct export from barrel
|
|
99
|
+
barrelExports.push({ ...exp, definedIn: barrelFile });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Fix A: If barrel was found but exports nothing, try bin detection or barrel-as-script fallback
|
|
103
|
+
if (barrelExports.length === 0) {
|
|
104
|
+
// First try bin entry points
|
|
105
|
+
const binExports = extractBinEntryExports(absPackageDir, fileMap, allExports, importGraph, warnings);
|
|
106
|
+
if (binExports.length > 0) {
|
|
107
|
+
for (const exp of binExports) {
|
|
108
|
+
barrelSourceFiles.add(exp.definedIn);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
barrelFile,
|
|
112
|
+
barrelExports: binExports,
|
|
113
|
+
allExports,
|
|
114
|
+
importGraph,
|
|
115
|
+
barrelSourceFiles,
|
|
116
|
+
callGraph: buildCallGraph(parsedFiles, absPackageDir, warnings),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// Fallback: barrel is a script (no exports) — extract from its imports one level deep
|
|
120
|
+
const scriptExports = extractScriptEntryExports(barrelFile, fileMap, absPackageDir, warnings);
|
|
121
|
+
if (scriptExports.length > 0) {
|
|
122
|
+
for (const exp of scriptExports) {
|
|
123
|
+
barrelSourceFiles.add(exp.definedIn);
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
barrelFile,
|
|
127
|
+
barrelExports: scriptExports,
|
|
128
|
+
allExports,
|
|
129
|
+
importGraph,
|
|
130
|
+
barrelSourceFiles,
|
|
131
|
+
callGraph: buildCallGraph(parsedFiles, absPackageDir, warnings),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
barrelFile,
|
|
137
|
+
barrelExports,
|
|
138
|
+
allExports,
|
|
139
|
+
importGraph,
|
|
140
|
+
barrelSourceFiles,
|
|
141
|
+
callGraph: buildCallGraph(parsedFiles, absPackageDir, warnings),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Find the barrel file. Search order per E-22:
|
|
146
|
+
* 1. index.ts at package root
|
|
147
|
+
* 2. index.tsx at package root
|
|
148
|
+
* 3. package.json exports field (E-22)
|
|
149
|
+
* 4. package.json main field
|
|
150
|
+
* 5. package.json module field
|
|
151
|
+
* 6. src/index.ts
|
|
152
|
+
* 7. src/index.tsx
|
|
153
|
+
*/
|
|
154
|
+
function findBarrelFile(packageDir, fileMap, warnings) {
|
|
155
|
+
// 1-2: index.ts/tsx at root
|
|
156
|
+
if (fileMap.has("index.ts"))
|
|
157
|
+
return "index.ts";
|
|
158
|
+
if (fileMap.has("index.tsx"))
|
|
159
|
+
return "index.tsx";
|
|
160
|
+
// 3-5: package.json fields
|
|
161
|
+
const pkgJsonPath = join(packageDir, "package.json");
|
|
162
|
+
if (existsSync(pkgJsonPath)) {
|
|
163
|
+
try {
|
|
164
|
+
const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
|
|
165
|
+
// E-22: exports field resolution
|
|
166
|
+
const exportsEntry = resolveExportsField(pkgJson.exports, packageDir);
|
|
167
|
+
if (exportsEntry) {
|
|
168
|
+
const rel = relative(packageDir, exportsEntry);
|
|
169
|
+
if (fileMap.has(rel))
|
|
170
|
+
return rel;
|
|
171
|
+
}
|
|
172
|
+
// main field
|
|
173
|
+
if (pkgJson.main) {
|
|
174
|
+
const mainRel = resolveToSource(pkgJson.main, packageDir);
|
|
175
|
+
if (mainRel && fileMap.has(mainRel))
|
|
176
|
+
return mainRel;
|
|
177
|
+
}
|
|
178
|
+
// module field
|
|
179
|
+
if (pkgJson.module) {
|
|
180
|
+
const moduleRel = resolveToSource(pkgJson.module, packageDir);
|
|
181
|
+
if (moduleRel && fileMap.has(moduleRel))
|
|
182
|
+
return moduleRel;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
// Invalid package.json — skip
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// 6-7: src/index.ts/tsx
|
|
190
|
+
if (fileMap.has("src/index.ts"))
|
|
191
|
+
return "src/index.ts";
|
|
192
|
+
if (fileMap.has("src/index.tsx"))
|
|
193
|
+
return "src/index.tsx";
|
|
194
|
+
return undefined;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* E-22: Resolve package.json exports field to a source file path.
|
|
198
|
+
*/
|
|
199
|
+
function resolveExportsField(exports, packageDir) {
|
|
200
|
+
if (!exports)
|
|
201
|
+
return undefined;
|
|
202
|
+
// String shorthand: "exports": "./src/index.ts"
|
|
203
|
+
if (typeof exports === "string") {
|
|
204
|
+
return resolveExportPath(exports, packageDir);
|
|
205
|
+
}
|
|
206
|
+
if (typeof exports !== "object" || exports === null)
|
|
207
|
+
return undefined;
|
|
208
|
+
const exportsObj = exports;
|
|
209
|
+
// Subpath "." entry
|
|
210
|
+
const dotEntry = exportsObj["."];
|
|
211
|
+
if (dotEntry) {
|
|
212
|
+
if (typeof dotEntry === "string") {
|
|
213
|
+
return resolveExportPath(dotEntry, packageDir);
|
|
214
|
+
}
|
|
215
|
+
// Conditional map
|
|
216
|
+
if (typeof dotEntry === "object" && dotEntry !== null) {
|
|
217
|
+
const conditions = dotEntry;
|
|
218
|
+
// Prefer types, then import, then require
|
|
219
|
+
for (const key of ["types", "import", "require", "default"]) {
|
|
220
|
+
if (typeof conditions[key] === "string") {
|
|
221
|
+
return resolveExportPath(conditions[key], packageDir);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
function resolveExportPath(exportPath, packageDir) {
|
|
229
|
+
const absPath = resolve(packageDir, exportPath);
|
|
230
|
+
// E-20: If it points to .js, try .ts/.tsx
|
|
231
|
+
if (existsSync(absPath))
|
|
232
|
+
return absPath;
|
|
233
|
+
if (exportPath.endsWith(".js")) {
|
|
234
|
+
const tsPath = resolve(packageDir, exportPath.replace(/\.js$/, ".ts"));
|
|
235
|
+
if (existsSync(tsPath))
|
|
236
|
+
return tsPath;
|
|
237
|
+
const tsxPath = resolve(packageDir, exportPath.replace(/\.js$/, ".tsx"));
|
|
238
|
+
if (existsSync(tsxPath))
|
|
239
|
+
return tsxPath;
|
|
240
|
+
}
|
|
241
|
+
if (exportPath.endsWith(".jsx")) {
|
|
242
|
+
const tsxPath = resolve(packageDir, exportPath.replace(/\.jsx$/, ".tsx"));
|
|
243
|
+
if (existsSync(tsxPath))
|
|
244
|
+
return tsxPath;
|
|
245
|
+
}
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Resolve a relative source path (from main/module fields) to a real source file.
|
|
250
|
+
*/
|
|
251
|
+
function resolveToSource(filePath, packageDir) {
|
|
252
|
+
const resolved = resolveExportPath(filePath, packageDir);
|
|
253
|
+
if (resolved)
|
|
254
|
+
return relative(packageDir, resolved);
|
|
255
|
+
// Try with extensions
|
|
256
|
+
for (const ext of [".ts", ".tsx", "/index.ts", "/index.tsx"]) {
|
|
257
|
+
const candidate = resolve(packageDir, filePath.replace(/\.[jt]sx?$/, "") + ext);
|
|
258
|
+
if (existsSync(candidate))
|
|
259
|
+
return relative(packageDir, candidate);
|
|
260
|
+
}
|
|
261
|
+
// Try extensionless
|
|
262
|
+
for (const ext of [".ts", ".tsx", "/index.ts", "/index.tsx"]) {
|
|
263
|
+
const candidate = resolve(packageDir, filePath + ext);
|
|
264
|
+
if (existsSync(candidate))
|
|
265
|
+
return relative(packageDir, candidate);
|
|
266
|
+
}
|
|
267
|
+
return undefined;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Resolve a module specifier (relative path) to a relative file path within the package.
|
|
271
|
+
* E-20: Handles .js→.ts mapping. E-21: Checks path boundary.
|
|
272
|
+
*/
|
|
273
|
+
export function resolveModuleSpecifier(specifier, fromDir, packageDir, warnings) {
|
|
274
|
+
if (!specifier.startsWith("."))
|
|
275
|
+
return undefined; // External module
|
|
276
|
+
// E-20: .js → .ts mapping
|
|
277
|
+
const candidates = [];
|
|
278
|
+
if (specifier.endsWith(".js")) {
|
|
279
|
+
candidates.push(specifier.replace(/\.js$/, ".ts"));
|
|
280
|
+
candidates.push(specifier.replace(/\.js$/, ".tsx"));
|
|
281
|
+
candidates.push(specifier); // try original .js
|
|
282
|
+
}
|
|
283
|
+
else if (specifier.endsWith(".jsx")) {
|
|
284
|
+
candidates.push(specifier.replace(/\.jsx$/, ".tsx"));
|
|
285
|
+
candidates.push(specifier); // try original .jsx
|
|
286
|
+
}
|
|
287
|
+
else if (specifier.endsWith(".ts") || specifier.endsWith(".tsx")) {
|
|
288
|
+
candidates.push(specifier);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
// Extensionless — try adding extensions
|
|
292
|
+
candidates.push(specifier + ".ts");
|
|
293
|
+
candidates.push(specifier + ".tsx");
|
|
294
|
+
candidates.push(specifier + "/index.ts");
|
|
295
|
+
candidates.push(specifier + "/index.tsx");
|
|
296
|
+
candidates.push(specifier + ".js");
|
|
297
|
+
candidates.push(specifier + ".jsx");
|
|
298
|
+
}
|
|
299
|
+
for (const candidate of candidates) {
|
|
300
|
+
const absPath = resolve(fromDir, candidate);
|
|
301
|
+
// E-21: Path traversal boundary check — use relative() to avoid prefix collision
|
|
302
|
+
// (startsWith("/foo/bar") would wrongly match "/foo/barroom/baz")
|
|
303
|
+
const relToPackage = relative(resolve(packageDir), absPath);
|
|
304
|
+
if (relToPackage.startsWith("..")) {
|
|
305
|
+
warnings.push({
|
|
306
|
+
level: "warn",
|
|
307
|
+
module: "symbol-graph",
|
|
308
|
+
message: `Import "${specifier}" resolves outside package boundary — skipped`,
|
|
309
|
+
});
|
|
310
|
+
return undefined;
|
|
311
|
+
}
|
|
312
|
+
if (existsSync(absPath)) {
|
|
313
|
+
return relative(packageDir, absPath);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return undefined;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* E-24: Expand a star re-export by enumerating all named exports from target file.
|
|
320
|
+
*/
|
|
321
|
+
function expandStarExport(targetRelPath, fileMap, packageDir, results, barrelSourceFiles, warnings, visited, isTypeOnly) {
|
|
322
|
+
if (visited.has(targetRelPath)) {
|
|
323
|
+
warnings.push({
|
|
324
|
+
level: "warn",
|
|
325
|
+
module: "symbol-graph",
|
|
326
|
+
message: `Circular re-export detected involving ${targetRelPath}`,
|
|
327
|
+
file: targetRelPath,
|
|
328
|
+
});
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
visited.add(targetRelPath);
|
|
332
|
+
const targetParsed = fileMap.get(targetRelPath);
|
|
333
|
+
if (!targetParsed)
|
|
334
|
+
return;
|
|
335
|
+
for (const exp of targetParsed.exports) {
|
|
336
|
+
if (exp.name === "default")
|
|
337
|
+
continue; // Star re-export excludes default
|
|
338
|
+
if (exp.name === "*" && exp.isReExport && exp.reExportSource) {
|
|
339
|
+
// Nested star re-export — recurse
|
|
340
|
+
const nestedTarget = resolveModuleSpecifier(exp.reExportSource, dirname(resolve(packageDir, targetRelPath)), packageDir, warnings);
|
|
341
|
+
if (nestedTarget) {
|
|
342
|
+
barrelSourceFiles.add(nestedTarget);
|
|
343
|
+
expandStarExport(nestedTarget, fileMap, packageDir, results, barrelSourceFiles, warnings, visited, isTypeOnly || exp.isTypeOnly);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
else if (exp.isReExport && exp.reExportSource) {
|
|
347
|
+
// Named re-export from target — resolve further
|
|
348
|
+
const resolved = resolveReExportChain(exp, targetRelPath, fileMap, packageDir, barrelSourceFiles, warnings, new Set(visited));
|
|
349
|
+
results.push({
|
|
350
|
+
...resolved,
|
|
351
|
+
isTypeOnly: isTypeOnly || resolved.isTypeOnly,
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
// Direct export from target file
|
|
356
|
+
results.push({
|
|
357
|
+
...exp,
|
|
358
|
+
isTypeOnly: isTypeOnly || exp.isTypeOnly,
|
|
359
|
+
definedIn: targetRelPath,
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* E-23: Resolve a named re-export chain with cycle detection.
|
|
366
|
+
* E-25: Handles aliased exports (localName).
|
|
367
|
+
*/
|
|
368
|
+
function resolveReExportChain(exp, fromFile, fileMap, packageDir, barrelSourceFiles, warnings, visited) {
|
|
369
|
+
if (!exp.reExportSource) {
|
|
370
|
+
return { ...exp, definedIn: fromFile };
|
|
371
|
+
}
|
|
372
|
+
// E-23: Cycle detection
|
|
373
|
+
const key = `${fromFile}::${exp.name}`;
|
|
374
|
+
if (visited.has(key)) {
|
|
375
|
+
warnings.push({
|
|
376
|
+
level: "warn",
|
|
377
|
+
module: "symbol-graph",
|
|
378
|
+
message: `Circular re-export chain detected for "${exp.name}" at ${fromFile}`,
|
|
379
|
+
file: fromFile,
|
|
380
|
+
});
|
|
381
|
+
return { ...exp, definedIn: "circular", kind: "unknown" };
|
|
382
|
+
}
|
|
383
|
+
visited.add(key);
|
|
384
|
+
const fromDir = dirname(resolve(packageDir, fromFile));
|
|
385
|
+
const targetRelPath = resolveModuleSpecifier(exp.reExportSource, fromDir, packageDir, warnings);
|
|
386
|
+
if (!targetRelPath) {
|
|
387
|
+
warnings.push({
|
|
388
|
+
level: "warn",
|
|
389
|
+
module: "symbol-graph",
|
|
390
|
+
message: `Unresolved re-export "${exp.name}" from "${exp.reExportSource}" in ${fromFile}`,
|
|
391
|
+
file: fromFile,
|
|
392
|
+
});
|
|
393
|
+
return { ...exp, definedIn: "unresolved", kind: "unknown" };
|
|
394
|
+
}
|
|
395
|
+
barrelSourceFiles.add(targetRelPath);
|
|
396
|
+
const targetParsed = fileMap.get(targetRelPath);
|
|
397
|
+
if (!targetParsed) {
|
|
398
|
+
return { ...exp, definedIn: "unresolved", kind: "unknown" };
|
|
399
|
+
}
|
|
400
|
+
// E-25: Look up using localName if available (aliased export)
|
|
401
|
+
const lookupName = exp.localName ?? exp.name;
|
|
402
|
+
// Find matching export in target file
|
|
403
|
+
const targetExport = targetParsed.exports.find((e) => e.name === lookupName || e.name === exp.name);
|
|
404
|
+
if (!targetExport) {
|
|
405
|
+
// Maybe the target re-exports it further — check star exports
|
|
406
|
+
const starReExport = targetParsed.exports.find((e) => e.name === "*" && e.isReExport);
|
|
407
|
+
if (starReExport && starReExport.reExportSource) {
|
|
408
|
+
// Follow the star re-export
|
|
409
|
+
return resolveReExportChain({ ...exp, reExportSource: starReExport.reExportSource }, targetRelPath, fileMap, packageDir, barrelSourceFiles, warnings, visited);
|
|
410
|
+
}
|
|
411
|
+
return { ...exp, definedIn: targetRelPath, kind: "unknown" };
|
|
412
|
+
}
|
|
413
|
+
// If target also re-exports, follow the chain
|
|
414
|
+
if (targetExport.isReExport && targetExport.reExportSource) {
|
|
415
|
+
return resolveReExportChain({ ...exp, ...targetExport, name: exp.name, localName: exp.localName }, targetRelPath, fileMap, packageDir, barrelSourceFiles, warnings, visited);
|
|
416
|
+
}
|
|
417
|
+
// Found the definition — merge kind, signature, JSDoc
|
|
418
|
+
return {
|
|
419
|
+
name: exp.name,
|
|
420
|
+
localName: exp.localName,
|
|
421
|
+
kind: targetExport.kind,
|
|
422
|
+
isReExport: true,
|
|
423
|
+
isTypeOnly: exp.isTypeOnly || targetExport.isTypeOnly,
|
|
424
|
+
signature: targetExport.signature,
|
|
425
|
+
jsDocComment: targetExport.jsDocComment,
|
|
426
|
+
definedIn: targetRelPath,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Fix A: Extract exports from a script-style entry point (barrel with no exports).
|
|
431
|
+
* Follows the script's internal imports one level deep to find the real API.
|
|
432
|
+
*/
|
|
433
|
+
function extractScriptEntryExports(entryFile, fileMap, packageDir, warnings) {
|
|
434
|
+
const entryParsed = fileMap.get(entryFile);
|
|
435
|
+
if (!entryParsed)
|
|
436
|
+
return [];
|
|
437
|
+
const results = [];
|
|
438
|
+
const seen = new Set();
|
|
439
|
+
for (const imp of entryParsed.imports) {
|
|
440
|
+
if (!imp.moduleSpecifier.startsWith("."))
|
|
441
|
+
continue;
|
|
442
|
+
const targetRelPath = resolveModuleSpecifier(imp.moduleSpecifier, dirname(resolve(packageDir, entryFile)), packageDir, warnings);
|
|
443
|
+
if (!targetRelPath)
|
|
444
|
+
continue;
|
|
445
|
+
const targetFile = fileMap.get(targetRelPath);
|
|
446
|
+
if (!targetFile)
|
|
447
|
+
continue;
|
|
448
|
+
for (const exp of targetFile.exports) {
|
|
449
|
+
if (exp.name === "*" || exp.name === "default" || seen.has(exp.name))
|
|
450
|
+
continue;
|
|
451
|
+
if (exp.isTypeOnly)
|
|
452
|
+
continue;
|
|
453
|
+
seen.add(exp.name);
|
|
454
|
+
results.push({ ...exp, definedIn: targetRelPath });
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
if (results.length > 0) {
|
|
458
|
+
warnings.push({
|
|
459
|
+
level: "info",
|
|
460
|
+
module: "symbol-graph",
|
|
461
|
+
message: `Barrel file has no exports — extracted ${results.length} API symbols from its internal imports.`,
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
return results;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Fix A: Extract exports from bin entry files when no barrel exists.
|
|
468
|
+
* For CLI packages, the bin field in package.json points to the real entry point(s).
|
|
469
|
+
* We collect exports from the bin file AND functions it imports from internal modules (one level deep).
|
|
470
|
+
*/
|
|
471
|
+
function extractBinEntryExports(packageDir, fileMap, allExports, importGraph, warnings) {
|
|
472
|
+
const pkgJsonPath = join(packageDir, "package.json");
|
|
473
|
+
if (!existsSync(pkgJsonPath))
|
|
474
|
+
return [];
|
|
475
|
+
let pkgJson;
|
|
476
|
+
try {
|
|
477
|
+
pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
|
|
478
|
+
}
|
|
479
|
+
catch {
|
|
480
|
+
return [];
|
|
481
|
+
}
|
|
482
|
+
if (!pkgJson.bin)
|
|
483
|
+
return [];
|
|
484
|
+
// Collect bin entry file paths
|
|
485
|
+
const binPaths = [];
|
|
486
|
+
if (typeof pkgJson.bin === "string") {
|
|
487
|
+
binPaths.push(pkgJson.bin);
|
|
488
|
+
}
|
|
489
|
+
else if (typeof pkgJson.bin === "object") {
|
|
490
|
+
for (const val of Object.values(pkgJson.bin)) {
|
|
491
|
+
if (typeof val === "string")
|
|
492
|
+
binPaths.push(val);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
const results = [];
|
|
496
|
+
const seen = new Set();
|
|
497
|
+
for (const binPath of binPaths) {
|
|
498
|
+
// Resolve bin path to a source file in the parsed file map
|
|
499
|
+
const binRelPath = resolveBinToSource(binPath, packageDir, fileMap, warnings);
|
|
500
|
+
if (!binRelPath)
|
|
501
|
+
continue;
|
|
502
|
+
const binFile = fileMap.get(binRelPath);
|
|
503
|
+
if (!binFile)
|
|
504
|
+
continue;
|
|
505
|
+
// Collect direct exports from the bin file
|
|
506
|
+
for (const exp of binFile.exports) {
|
|
507
|
+
if (exp.name === "*" || seen.has(exp.name))
|
|
508
|
+
continue;
|
|
509
|
+
seen.add(exp.name);
|
|
510
|
+
results.push({ ...exp, definedIn: binRelPath });
|
|
511
|
+
}
|
|
512
|
+
// One level deep: collect exports from internal modules the bin file imports
|
|
513
|
+
for (const imp of binFile.imports) {
|
|
514
|
+
if (!imp.moduleSpecifier.startsWith("."))
|
|
515
|
+
continue; // only relative imports
|
|
516
|
+
const targetRelPath = resolveModuleSpecifier(imp.moduleSpecifier, dirname(resolve(packageDir, binRelPath)), packageDir, warnings);
|
|
517
|
+
if (!targetRelPath)
|
|
518
|
+
continue;
|
|
519
|
+
const targetFile = fileMap.get(targetRelPath);
|
|
520
|
+
if (!targetFile)
|
|
521
|
+
continue;
|
|
522
|
+
for (const exp of targetFile.exports) {
|
|
523
|
+
if (exp.name === "*" || exp.name === "default" || seen.has(exp.name))
|
|
524
|
+
continue;
|
|
525
|
+
if (exp.isTypeOnly)
|
|
526
|
+
continue; // Skip types for CLI API
|
|
527
|
+
seen.add(exp.name);
|
|
528
|
+
results.push({ ...exp, definedIn: targetRelPath });
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
if (results.length > 0) {
|
|
533
|
+
warnings.push({
|
|
534
|
+
level: "info",
|
|
535
|
+
module: "symbol-graph",
|
|
536
|
+
message: `No barrel file — used bin entry point(s) to extract ${results.length} API symbols.`,
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
return results;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Resolve a bin path (possibly pointing to dist/) to a source file.
|
|
543
|
+
*/
|
|
544
|
+
function resolveBinToSource(binPath, packageDir, fileMap, warnings) {
|
|
545
|
+
// Try direct resolution first
|
|
546
|
+
const rel = relative(packageDir, resolve(packageDir, binPath));
|
|
547
|
+
if (fileMap.has(rel))
|
|
548
|
+
return rel;
|
|
549
|
+
// Common pattern: bin points to dist/bin/cli.js — map to src/bin/cli.ts
|
|
550
|
+
const srcPath = rel
|
|
551
|
+
.replace(/^dist\//, "src/")
|
|
552
|
+
.replace(/^lib\//, "src/")
|
|
553
|
+
.replace(/^build\//, "src/");
|
|
554
|
+
// Try .js → .ts
|
|
555
|
+
for (const candidate of [
|
|
556
|
+
srcPath.replace(/\.js$/, ".ts"),
|
|
557
|
+
srcPath.replace(/\.js$/, ".tsx"),
|
|
558
|
+
srcPath,
|
|
559
|
+
]) {
|
|
560
|
+
if (fileMap.has(candidate))
|
|
561
|
+
return candidate;
|
|
562
|
+
}
|
|
563
|
+
// Try without extension
|
|
564
|
+
const noExt = srcPath.replace(/\.[jt]sx?$/, "");
|
|
565
|
+
for (const ext of [".ts", ".tsx", ".js", ".jsx"]) {
|
|
566
|
+
if (fileMap.has(noExt + ext))
|
|
567
|
+
return noExt + ext;
|
|
568
|
+
}
|
|
569
|
+
return undefined;
|
|
570
|
+
}
|
|
571
|
+
// ─── Call Graph Builder (Improvement 3) ─────────────────────────────────────
|
|
572
|
+
/**
|
|
573
|
+
* Build a cross-file call graph from per-file call references.
|
|
574
|
+
* Resolves internal module specifiers to actual file paths within the package.
|
|
575
|
+
*/
|
|
576
|
+
function buildCallGraph(parsedFiles, packageDir, _warnings) {
|
|
577
|
+
const edges = [];
|
|
578
|
+
const seen = new Set();
|
|
579
|
+
// Build a map: exported name → file path (for resolving call targets)
|
|
580
|
+
const exportNameToFile = new Map();
|
|
581
|
+
for (const pf of parsedFiles) {
|
|
582
|
+
for (const exp of pf.exports) {
|
|
583
|
+
if (!exp.isTypeOnly && exp.name !== "*" && exp.name !== "default") {
|
|
584
|
+
// First definition wins (closest to barrel)
|
|
585
|
+
if (!exportNameToFile.has(exp.name)) {
|
|
586
|
+
exportNameToFile.set(exp.name, pf.relativePath);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
for (const pf of parsedFiles) {
|
|
592
|
+
for (const ref of pf.callReferences) {
|
|
593
|
+
if (!ref.isInternal)
|
|
594
|
+
continue; // Only track internal calls
|
|
595
|
+
// Resolve the callee to a file
|
|
596
|
+
const toFile = exportNameToFile.get(ref.calleeName);
|
|
597
|
+
if (!toFile || toFile === pf.relativePath)
|
|
598
|
+
continue; // Skip self-references
|
|
599
|
+
const key = `${ref.callerName}:${pf.relativePath}->${ref.calleeName}:${toFile}`;
|
|
600
|
+
if (seen.has(key))
|
|
601
|
+
continue;
|
|
602
|
+
seen.add(key);
|
|
603
|
+
edges.push({
|
|
604
|
+
from: ref.callerName,
|
|
605
|
+
to: ref.calleeName,
|
|
606
|
+
fromFile: pf.relativePath,
|
|
607
|
+
toFile,
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
return edges;
|
|
612
|
+
}
|
|
613
|
+
//# sourceMappingURL=symbol-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol-graph.js","sourceRoot":"","sources":["../src/symbol-graph.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,2EAA2E;AAC3E,2EAA2E;AAC3E,uFAAuF;AAEvF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAW7D;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,WAAyB,EACzB,UAAkB,EAClB,WAAsB,EAAE;IAExB,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE1C,gBAAgB;IAChB,MA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,GAAG,CAAC,UAAU;gBAClB,QAAQ,EAAE,EAAE,CAAC,YAAY;gBACzB,MAAM;aACP,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const agentsMdSingleTemplate: {
|
|
2
|
+
systemPrompt: string;
|
|
3
|
+
formatInstructions: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const agentsMdMultiRootTemplate: {
|
|
6
|
+
systemPrompt: string;
|
|
7
|
+
formatInstructions: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const agentsMdPackageDetailTemplate: {
|
|
10
|
+
systemPrompt: string;
|
|
11
|
+
formatInstructions: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const agentsMdMultiTemplate: {
|
|
14
|
+
systemPrompt: string;
|
|
15
|
+
formatInstructions: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const agentsMdTemplate: {
|
|
18
|
+
systemPrompt: string;
|
|
19
|
+
formatInstructions: string;
|
|
20
|
+
};
|