aspectcode 0.2.2 → 0.3.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/dist/cli.d.ts +15 -47
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +18 -17
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +14 -24
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -60
- package/dist/config.js.map +1 -1
- package/dist/kbBuilder.d.ts +14 -0
- package/dist/kbBuilder.d.ts.map +1 -0
- package/dist/kbBuilder.js +106 -0
- package/dist/kbBuilder.js.map +1 -0
- package/dist/main.d.ts +4 -5
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +45 -124
- package/dist/main.js.map +1 -1
- package/dist/optimize.d.ts +14 -0
- package/dist/optimize.d.ts.map +1 -0
- package/dist/optimize.js +131 -0
- package/dist/optimize.js.map +1 -0
- package/dist/pipeline.d.ts +15 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +212 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/toolIngestion.d.ts +15 -0
- package/dist/toolIngestion.d.ts.map +1 -0
- package/dist/toolIngestion.js +47 -0
- package/dist/toolIngestion.js.map +1 -0
- package/dist/writer.d.ts +17 -0
- package/dist/writer.d.ts.map +1 -0
- package/dist/writer.js +26 -0
- package/dist/writer.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/analyzer.d.ts +34 -0
- package/node_modules/@aspectcode/core/dist/analysis/analyzer.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/analyzer.js +240 -0
- package/node_modules/@aspectcode/core/dist/analysis/analyzer.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.d.ts +32 -0
- package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.js +133 -0
- package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/importParsers.d.ts +30 -0
- package/node_modules/@aspectcode/core/dist/analysis/importParsers.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/importParsers.js +92 -0
- package/node_modules/@aspectcode/core/dist/analysis/importParsers.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/index.d.ts +9 -0
- package/node_modules/@aspectcode/core/dist/analysis/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/index.js +9 -0
- package/node_modules/@aspectcode/core/dist/analysis/index.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.d.ts +34 -0
- package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.js +240 -0
- package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/repo.d.ts +33 -0
- package/node_modules/@aspectcode/core/dist/analysis/repo.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/analysis/repo.js +246 -0
- package/node_modules/@aspectcode/core/dist/analysis/repo.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/classifiers.d.ts +24 -0
- package/node_modules/@aspectcode/core/dist/classifiers.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/classifiers.js +119 -0
- package/node_modules/@aspectcode/core/dist/classifiers.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/fs/exclusions.d.ts +26 -0
- package/node_modules/@aspectcode/core/dist/fs/exclusions.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/fs/exclusions.js +130 -0
- package/node_modules/@aspectcode/core/dist/fs/exclusions.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/fs/fingerprint.d.ts +42 -0
- package/node_modules/@aspectcode/core/dist/fs/fingerprint.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/fs/fingerprint.js +125 -0
- package/node_modules/@aspectcode/core/dist/fs/fingerprint.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/fs/index.d.ts +9 -0
- package/node_modules/@aspectcode/core/dist/fs/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/fs/index.js +26 -0
- package/node_modules/@aspectcode/core/dist/fs/index.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/fs/walker.d.ts +23 -0
- package/node_modules/@aspectcode/core/dist/fs/walker.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/fs/walker.js +94 -0
- package/node_modules/@aspectcode/core/dist/fs/walker.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/host.d.ts +38 -0
- package/node_modules/@aspectcode/core/dist/host.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/host.js +110 -0
- package/node_modules/@aspectcode/core/dist/host.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/index.d.ts +23 -0
- package/node_modules/@aspectcode/core/dist/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/index.js +59 -0
- package/node_modules/@aspectcode/core/dist/index.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/model.d.ts +90 -0
- package/node_modules/@aspectcode/core/dist/model.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/model.js +9 -0
- package/node_modules/@aspectcode/core/dist/model.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.d.ts +17 -0
- package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.js +225 -0
- package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.d.ts +30 -0
- package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.js +71 -0
- package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/index.d.ts +13 -0
- package/node_modules/@aspectcode/core/dist/parsers/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/index.js +32 -0
- package/node_modules/@aspectcode/core/dist/parsers/index.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.d.ts +17 -0
- package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.js +182 -0
- package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts +44 -0
- package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/languages.js +64 -0
- package/node_modules/@aspectcode/core/dist/parsers/languages.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.d.ts +18 -0
- package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.js +139 -0
- package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.d.ts +22 -0
- package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js +240 -0
- package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/utils.d.ts +7 -0
- package/node_modules/@aspectcode/core/dist/parsers/utils.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/utils.js +11 -0
- package/node_modules/@aspectcode/core/dist/parsers/utils.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/paths.d.ts +27 -0
- package/node_modules/@aspectcode/core/dist/paths.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/paths.js +45 -0
- package/node_modules/@aspectcode/core/dist/paths.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/stats.d.ts +41 -0
- package/node_modules/@aspectcode/core/dist/stats.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/stats.js +88 -0
- package/node_modules/@aspectcode/core/dist/stats.js.map +1 -0
- package/node_modules/@aspectcode/core/package.json +41 -0
- package/node_modules/@aspectcode/core/parsers/c_sharp.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/java.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/javascript.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/python.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/tree-sitter.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/tsx.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/typescript.wasm +0 -0
- package/node_modules/@aspectcode/emitters/dist/emitter.d.ts +72 -0
- package/node_modules/@aspectcode/emitters/dist/emitter.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/emitter.js +10 -0
- package/node_modules/@aspectcode/emitters/dist/emitter.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/host.d.ts +31 -0
- package/node_modules/@aspectcode/emitters/dist/host.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/host.js +86 -0
- package/node_modules/@aspectcode/emitters/dist/host.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/index.d.ts +27 -0
- package/node_modules/@aspectcode/emitters/dist/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/index.js +116 -0
- package/node_modules/@aspectcode/emitters/dist/index.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts +15 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/content.js +289 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/content.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts +13 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.js +55 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/formats.d.ts +17 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/formats.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/formats.js +23 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/formats.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts +5 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/index.js +12 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/index.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts +9 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js +30 -0
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts +64 -0
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js +504 -0
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.d.ts +24 -0
- package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.js +238 -0
- package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/classifiers.d.ts +8 -0
- package/node_modules/@aspectcode/emitters/dist/kb/classifiers.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/classifiers.js +14 -0
- package/node_modules/@aspectcode/emitters/dist/kb/classifiers.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/constants.d.ts +35 -0
- package/node_modules/@aspectcode/emitters/dist/kb/constants.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/constants.js +38 -0
- package/node_modules/@aspectcode/emitters/dist/kb/constants.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.d.ts +20 -0
- package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.js +155 -0
- package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts +52 -0
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.js +391 -0
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/depData.d.ts +18 -0
- package/node_modules/@aspectcode/emitters/dist/kb/depData.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/depData.js +31 -0
- package/node_modules/@aspectcode/emitters/dist/kb/depData.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/detectors.d.ts +18 -0
- package/node_modules/@aspectcode/emitters/dist/kb/detectors.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/detectors.js +317 -0
- package/node_modules/@aspectcode/emitters/dist/kb/detectors.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.d.ts +33 -0
- package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.js +323 -0
- package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/helpers.d.ts +27 -0
- package/node_modules/@aspectcode/emitters/dist/kb/helpers.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/helpers.js +63 -0
- package/node_modules/@aspectcode/emitters/dist/kb/helpers.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts +27 -0
- package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/index.js +72 -0
- package/node_modules/@aspectcode/emitters/dist/kb/index.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts +21 -0
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js +125 -0
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.d.ts +26 -0
- package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.js +255 -0
- package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/policy.d.ts +12 -0
- package/node_modules/@aspectcode/emitters/dist/kb/policy.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/policy.js +29 -0
- package/node_modules/@aspectcode/emitters/dist/kb/policy.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/symbols.d.ts +43 -0
- package/node_modules/@aspectcode/emitters/dist/kb/symbols.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/kb/symbols.js +343 -0
- package/node_modules/@aspectcode/emitters/dist/kb/symbols.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/manifest.d.ts +37 -0
- package/node_modules/@aspectcode/emitters/dist/manifest.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/manifest.js +50 -0
- package/node_modules/@aspectcode/emitters/dist/manifest.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/report.d.ts +22 -0
- package/node_modules/@aspectcode/emitters/dist/report.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/report.js +3 -0
- package/node_modules/@aspectcode/emitters/dist/report.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts +14 -0
- package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/stableJson.js +40 -0
- package/node_modules/@aspectcode/emitters/dist/stableJson.js.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/transaction.d.ts +29 -0
- package/node_modules/@aspectcode/emitters/dist/transaction.d.ts.map +1 -0
- package/node_modules/@aspectcode/emitters/dist/transaction.js +104 -0
- package/node_modules/@aspectcode/emitters/dist/transaction.js.map +1 -0
- package/node_modules/@aspectcode/emitters/package.json +39 -0
- package/node_modules/@aspectcode/optimizer/dist/agent.d.ts +18 -0
- package/node_modules/@aspectcode/optimizer/dist/agent.d.ts.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/agent.js +123 -0
- package/node_modules/@aspectcode/optimizer/dist/agent.js.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/index.d.ts +15 -0
- package/node_modules/@aspectcode/optimizer/dist/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/index.js +31 -0
- package/node_modules/@aspectcode/optimizer/dist/index.js.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/prompts.d.ts +39 -0
- package/node_modules/@aspectcode/optimizer/dist/prompts.d.ts.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/prompts.js +156 -0
- package/node_modules/@aspectcode/optimizer/dist/prompts.js.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.d.ts +20 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.d.ts.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js +126 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts +28 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/index.js +142 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/index.js.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.d.ts +19 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.d.ts.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.js +98 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.js.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts +19 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.js +87 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.js.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/types.d.ts +93 -0
- package/node_modules/@aspectcode/optimizer/dist/types.d.ts.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/types.js +20 -0
- package/node_modules/@aspectcode/optimizer/dist/types.js.map +1 -0
- package/node_modules/@aspectcode/optimizer/package.json +41 -0
- package/package.json +11 -3
- package/dist/commands/deps.d.ts +0 -11
- package/dist/commands/deps.d.ts.map +0 -1
- package/dist/commands/deps.js +0 -197
- package/dist/commands/deps.js.map +0 -1
- package/dist/commands/generate.d.ts +0 -8
- package/dist/commands/generate.d.ts.map +0 -1
- package/dist/commands/generate.js +0 -162
- package/dist/commands/generate.js.map +0 -1
- package/dist/commands/settings.d.ts +0 -9
- package/dist/commands/settings.d.ts.map +0 -1
- package/dist/commands/settings.js +0 -165
- package/dist/commands/settings.js.map +0 -1
- package/dist/commands/watch.d.ts +0 -6
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/watch.js +0 -180
- package/dist/commands/watch.js.map +0 -1
- package/dist/connections.d.ts +0 -24
- package/dist/connections.d.ts.map +0 -1
- package/dist/connections.js +0 -89
- package/dist/connections.js.map +0 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* KB Emitter — orchestrates generation of a single `kb.md` file.
|
|
4
|
+
*
|
|
5
|
+
* Implements the Emitter interface. Consumes an AnalysisModel and writes
|
|
6
|
+
* a combined KB file via the EmitterHost abstraction.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.KB_FILENAME = void 0;
|
|
10
|
+
exports.createKBEmitter = createKBEmitter;
|
|
11
|
+
const depData_1 = require("./depData");
|
|
12
|
+
const architectureEmitter_1 = require("./architectureEmitter");
|
|
13
|
+
const mapEmitter_1 = require("./mapEmitter");
|
|
14
|
+
const contextEmitter_1 = require("./contextEmitter");
|
|
15
|
+
const manifest_1 = require("../manifest");
|
|
16
|
+
const stableJson_1 = require("../stableJson");
|
|
17
|
+
/** The default KB output filename. */
|
|
18
|
+
exports.KB_FILENAME = 'kb.md';
|
|
19
|
+
/**
|
|
20
|
+
* Create a KB emitter that generates a single `kb.md` knowledge base file.
|
|
21
|
+
*
|
|
22
|
+
* @param kbOptions Optional KB-specific options (e.g. tree-sitter grammars).
|
|
23
|
+
*/
|
|
24
|
+
function createKBEmitter(kbOptions) {
|
|
25
|
+
return {
|
|
26
|
+
name: 'aspect-kb',
|
|
27
|
+
async emit(model, host, options) {
|
|
28
|
+
const generatedAt = options.generatedAt ?? new Date().toISOString();
|
|
29
|
+
const workspaceRoot = options.workspaceRoot;
|
|
30
|
+
const outDir = options.outDir ?? workspaceRoot;
|
|
31
|
+
// ── Derive shared data from the AnalysisModel ────────
|
|
32
|
+
// Absolute file paths
|
|
33
|
+
const files = model.files.map((f) => host.join(workspaceRoot, f.relativePath));
|
|
34
|
+
// Build file content cache from options or empty.
|
|
35
|
+
// Normalize keys so both CLI (relative paths) and extension (absolute paths)
|
|
36
|
+
// resolve consistently in downstream KB builders.
|
|
37
|
+
const fileContentCache = normalizeFileContentCache(options.fileContents, workspaceRoot, model.files.map((f) => f.relativePath), host);
|
|
38
|
+
// Build dependency links (absolute paths)
|
|
39
|
+
const allLinks = model.graph.edges.map((e) => ({
|
|
40
|
+
...e,
|
|
41
|
+
source: host.join(workspaceRoot, e.source),
|
|
42
|
+
target: host.join(workspaceRoot, e.target),
|
|
43
|
+
}));
|
|
44
|
+
// Per-file in/out degree stats
|
|
45
|
+
const depData = (0, depData_1.buildDepStats)(files, allLinks);
|
|
46
|
+
const grammars = kbOptions?.grammars ?? null;
|
|
47
|
+
// ── Generate all three files in parallel ─────────────
|
|
48
|
+
const [archContent, mapContent, ctxContent] = await Promise.all([
|
|
49
|
+
Promise.resolve((0, architectureEmitter_1.buildArchitectureContent)({
|
|
50
|
+
files,
|
|
51
|
+
depData,
|
|
52
|
+
allLinks,
|
|
53
|
+
fileContentCache,
|
|
54
|
+
workspaceRoot,
|
|
55
|
+
generatedAt,
|
|
56
|
+
})),
|
|
57
|
+
Promise.resolve((0, mapEmitter_1.buildMapContent)({
|
|
58
|
+
files,
|
|
59
|
+
depData,
|
|
60
|
+
allLinks,
|
|
61
|
+
grammars,
|
|
62
|
+
fileContentCache,
|
|
63
|
+
workspaceRoot,
|
|
64
|
+
generatedAt,
|
|
65
|
+
})),
|
|
66
|
+
Promise.resolve((0, contextEmitter_1.buildContextContent)({
|
|
67
|
+
files,
|
|
68
|
+
allLinks,
|
|
69
|
+
fileContentCache,
|
|
70
|
+
workspaceRoot,
|
|
71
|
+
generatedAt,
|
|
72
|
+
})),
|
|
73
|
+
]);
|
|
74
|
+
// ── Build manifest metadata as HTML comment ─────────
|
|
75
|
+
const manifest = (0, manifest_1.buildManifest)(model, generatedAt);
|
|
76
|
+
const manifestComment = `<!-- aspectcode: ${(0, stableJson_1.stableStringify)(manifest)} -->\n`;
|
|
77
|
+
// ── Combine into single kb.md ────────────────────────
|
|
78
|
+
const combined = [
|
|
79
|
+
archContent,
|
|
80
|
+
'\n---\n\n',
|
|
81
|
+
mapContent,
|
|
82
|
+
'\n---\n\n',
|
|
83
|
+
ctxContent,
|
|
84
|
+
'\n',
|
|
85
|
+
manifestComment,
|
|
86
|
+
].join('');
|
|
87
|
+
const kbPath = host.join(outDir, exports.KB_FILENAME);
|
|
88
|
+
await host.writeFile(kbPath, combined);
|
|
89
|
+
return {
|
|
90
|
+
filesWritten: [kbPath],
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function normalizeFileContentCache(source, workspaceRoot, relativePaths, host) {
|
|
96
|
+
const normalized = new Map();
|
|
97
|
+
if (!source || source.size === 0)
|
|
98
|
+
return normalized;
|
|
99
|
+
for (const [key, value] of source.entries()) {
|
|
100
|
+
normalized.set(key, value);
|
|
101
|
+
}
|
|
102
|
+
for (const relPath of relativePaths) {
|
|
103
|
+
const relPosix = relPath.replace(/\\/g, '/');
|
|
104
|
+
const relWindows = relPath.replace(/\//g, '\\');
|
|
105
|
+
const absPath = host.join(workspaceRoot, relPath);
|
|
106
|
+
const absPosix = absPath.replace(/\\/g, '/');
|
|
107
|
+
const absWindows = absPath.replace(/\//g, '\\');
|
|
108
|
+
const content = normalized.get(absPath) ??
|
|
109
|
+
normalized.get(absPosix) ??
|
|
110
|
+
normalized.get(absWindows) ??
|
|
111
|
+
normalized.get(relPath) ??
|
|
112
|
+
normalized.get(relPosix) ??
|
|
113
|
+
normalized.get(relWindows);
|
|
114
|
+
if (content === undefined)
|
|
115
|
+
continue;
|
|
116
|
+
normalized.set(absPath, content);
|
|
117
|
+
normalized.set(absPosix, content);
|
|
118
|
+
normalized.set(absWindows, content);
|
|
119
|
+
normalized.set(relPath, content);
|
|
120
|
+
normalized.set(relPosix, content);
|
|
121
|
+
normalized.set(relWindows, content);
|
|
122
|
+
}
|
|
123
|
+
return normalized;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMapp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,CAAC,OAAO,CAAC;YACvB,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;YACxB,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAE7B,IAAI,OAAO,KAAK,SAAS;YAAE,SAAS;QAEpC,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClC,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACpC,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClC,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map emitter — generates `map.md` content.
|
|
3
|
+
*
|
|
4
|
+
* Pure function: takes data, returns a markdown string.
|
|
5
|
+
* No I/O, no vscode.
|
|
6
|
+
*/
|
|
7
|
+
import type { DependencyLink } from '@aspectcode/core';
|
|
8
|
+
import type { LoadedGrammars } from './symbols';
|
|
9
|
+
export interface MapEmitterInput {
|
|
10
|
+
files: string[];
|
|
11
|
+
depData: Map<string, {
|
|
12
|
+
inDegree: number;
|
|
13
|
+
outDegree: number;
|
|
14
|
+
}>;
|
|
15
|
+
allLinks: DependencyLink[];
|
|
16
|
+
grammars: LoadedGrammars | null | undefined;
|
|
17
|
+
fileContentCache: Map<string, string>;
|
|
18
|
+
workspaceRoot: string;
|
|
19
|
+
generatedAt: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Build the full `map.md` content string.
|
|
23
|
+
* Deterministic for the same inputs.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildMapContent(input: MapEmitterInput): string;
|
|
26
|
+
//# sourceMappingURL=mapEmitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapEmitter.d.ts","sourceRoot":"","sources":["../../src/kb/mapEmitter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,QAAQ,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5C,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CA6P9D"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Map emitter — generates `map.md` content.
|
|
4
|
+
*
|
|
5
|
+
* Pure function: takes data, returns a markdown string.
|
|
6
|
+
* No I/O, no vscode.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.buildMapContent = buildMapContent;
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const constants_1 = require("./constants");
|
|
45
|
+
const helpers_1 = require("./helpers");
|
|
46
|
+
const classifiers_1 = require("./classifiers");
|
|
47
|
+
const entryPoints_1 = require("./entryPoints");
|
|
48
|
+
const detectors_1 = require("./detectors");
|
|
49
|
+
const symbols_1 = require("./symbols");
|
|
50
|
+
const conventions_1 = require("./conventions");
|
|
51
|
+
/**
|
|
52
|
+
* Build the full `map.md` content string.
|
|
53
|
+
* Deterministic for the same inputs.
|
|
54
|
+
*/
|
|
55
|
+
function buildMapContent(input) {
|
|
56
|
+
const { files, depData: _depData, allLinks, grammars, fileContentCache, workspaceRoot, generatedAt } = input;
|
|
57
|
+
let content = '# Map\n\n';
|
|
58
|
+
content +=
|
|
59
|
+
'_Symbol index with signatures and conventions. Use to find types, functions, and coding patterns._\n\n';
|
|
60
|
+
const appFiles = files.filter((f) => (0, classifiers_1.classifyFile)(f, workspaceRoot) === 'app');
|
|
61
|
+
// ── DATA MODELS ──────────────────────────────────────────
|
|
62
|
+
const dataModels = (0, detectors_1.getKBEnrichments)('DATA_MODEL', appFiles, workspaceRoot, fileContentCache);
|
|
63
|
+
if (dataModels.length > 0) {
|
|
64
|
+
content += '## Data Models\n\n';
|
|
65
|
+
content += '_Core data structures. Check these before modifying data handling._\n\n';
|
|
66
|
+
// Group by type
|
|
67
|
+
const ormModels = dataModels.filter((f) => f.message.includes('ORM') || f.message.includes('Entity') || f.message.includes('SQLModel'));
|
|
68
|
+
const dataClasses = dataModels.filter((f) => f.message.includes('Data Class') ||
|
|
69
|
+
f.message.includes('dataclass') ||
|
|
70
|
+
f.message.includes('Pydantic') ||
|
|
71
|
+
f.message.includes('BaseModel'));
|
|
72
|
+
const interfaces = dataModels.filter((f) => f.message.includes('Interface') ||
|
|
73
|
+
f.message.includes('Type Alias') ||
|
|
74
|
+
f.message.includes('type '));
|
|
75
|
+
const other = dataModels.filter((f) => !ormModels.includes(f) && !dataClasses.includes(f) && !interfaces.includes(f));
|
|
76
|
+
// Pre-extract model signatures
|
|
77
|
+
const allModelsToExtract = [
|
|
78
|
+
...ormModels.slice(0, 15).map((m) => ({ model: m, type: 'orm' })),
|
|
79
|
+
...dataClasses.slice(0, 15).map((m) => ({ model: m, type: 'dataclass' })),
|
|
80
|
+
...interfaces.slice(0, 15).map((m) => ({ model: m, type: 'interface' })),
|
|
81
|
+
];
|
|
82
|
+
const signatureMap = new Map();
|
|
83
|
+
for (const { model } of allModelsToExtract) {
|
|
84
|
+
const modelInfo = model.message.replace('Data model: ', '').replace('ORM model: ', '');
|
|
85
|
+
const signature = (0, symbols_1.extractModelSignature)(model.file, modelInfo, fileContentCache);
|
|
86
|
+
signatureMap.set(model.file, { modelInfo, signature });
|
|
87
|
+
}
|
|
88
|
+
if (ormModels.length > 0) {
|
|
89
|
+
content += '### ORM / Database Models\n\n';
|
|
90
|
+
for (const model of ormModels.slice(0, 15)) {
|
|
91
|
+
const relPath = (0, helpers_1.makeRelativePath)(model.file, workspaceRoot);
|
|
92
|
+
const data = signatureMap.get(model.file);
|
|
93
|
+
if (data?.signature) {
|
|
94
|
+
content += `**\`${relPath}\`**: \`${data.signature}\`\n\n`;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
const modelInfo = model.message.replace('Data model: ', '').replace('ORM model: ', '');
|
|
98
|
+
content += `**\`${relPath}\`**: ${modelInfo}\n\n`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (dataClasses.length > 0) {
|
|
103
|
+
content += '### Pydantic / Data Classes\n\n';
|
|
104
|
+
for (const model of dataClasses.slice(0, 15)) {
|
|
105
|
+
const relPath = (0, helpers_1.makeRelativePath)(model.file, workspaceRoot);
|
|
106
|
+
const data = signatureMap.get(model.file);
|
|
107
|
+
if (data?.signature) {
|
|
108
|
+
content += `**\`${relPath}\`**: \`${data.signature}\`\n\n`;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
let modelInfo = model.message.replace('Data model: ', '');
|
|
112
|
+
modelInfo = modelInfo.replace(/\s*\([^)]+\)\s*-\s*\w+\s*$/, '');
|
|
113
|
+
content += `**\`${relPath}\`**: ${modelInfo}\n\n`;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (interfaces.length > 0) {
|
|
118
|
+
content += '### TypeScript Interfaces & Types\n\n';
|
|
119
|
+
for (const model of interfaces.slice(0, 15)) {
|
|
120
|
+
const relPath = (0, helpers_1.makeRelativePath)(model.file, workspaceRoot);
|
|
121
|
+
const data = signatureMap.get(model.file);
|
|
122
|
+
if (data?.signature) {
|
|
123
|
+
content += `**\`${relPath}\`**: \`${data.signature}\`\n\n`;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
const modelInfo = model.message.replace('Data model: ', '');
|
|
127
|
+
content += `**\`${relPath}\`**: ${modelInfo}\n\n`;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (other.length > 0) {
|
|
132
|
+
content += '### Other Data Structures\n\n';
|
|
133
|
+
for (const model of other.slice(0, 10)) {
|
|
134
|
+
const relPath = (0, helpers_1.makeRelativePath)(model.file, workspaceRoot);
|
|
135
|
+
content += `- \`${relPath}\`: ${model.message}\n`;
|
|
136
|
+
}
|
|
137
|
+
content += '\n';
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// ── SYMBOL INDEX ─────────────────────────────────────────
|
|
141
|
+
const relevantFiles = new Set();
|
|
142
|
+
for (const link of allLinks) {
|
|
143
|
+
relevantFiles.add(link.source);
|
|
144
|
+
relevantFiles.add(link.target);
|
|
145
|
+
}
|
|
146
|
+
if (relevantFiles.size > 0) {
|
|
147
|
+
content += '## Symbol Index\n\n';
|
|
148
|
+
content += '_Functions, classes, and exports with call relationships._\n\n';
|
|
149
|
+
// Build set of architecturally important files
|
|
150
|
+
const archFiles = new Set();
|
|
151
|
+
for (const model of dataModels) {
|
|
152
|
+
if ((0, classifiers_1.classifyFile)(model.file, workspaceRoot) === 'app') {
|
|
153
|
+
archFiles.add(model.file);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const entryPointFindings = (0, entryPoints_1.detectEntryPointsWithContent)(appFiles, workspaceRoot, fileContentCache).map((e) => ({ file: path.join(workspaceRoot, e.path), message: e.reason }));
|
|
157
|
+
const integrationFindings = (0, detectors_1.getKBEnrichments)('EXTERNAL_INTEGRATION', appFiles, workspaceRoot, fileContentCache);
|
|
158
|
+
for (const f of entryPointFindings) {
|
|
159
|
+
if ((0, classifiers_1.classifyFile)(f.file, workspaceRoot) === 'app')
|
|
160
|
+
archFiles.add(f.file);
|
|
161
|
+
}
|
|
162
|
+
for (const f of integrationFindings) {
|
|
163
|
+
if ((0, classifiers_1.classifyFile)(f.file, workspaceRoot) === 'app')
|
|
164
|
+
archFiles.add(f.file);
|
|
165
|
+
}
|
|
166
|
+
// Score files by importance
|
|
167
|
+
const fileScores = new Map();
|
|
168
|
+
for (const file of relevantFiles) {
|
|
169
|
+
const kind = (0, classifiers_1.classifyFile)(file, workspaceRoot);
|
|
170
|
+
if (kind === 'third_party')
|
|
171
|
+
continue;
|
|
172
|
+
const base = kind === 'test' ? -10 : 0;
|
|
173
|
+
const archBoost = archFiles.has(file) ? 25 : 0;
|
|
174
|
+
const outLinks = allLinks.filter((l) => l.source === file).length;
|
|
175
|
+
const inLinks = allLinks.filter((l) => l.target === file).length;
|
|
176
|
+
const score = base + archBoost + inLinks * 2 + outLinks;
|
|
177
|
+
fileScores.set(file, score);
|
|
178
|
+
}
|
|
179
|
+
const sortedFiles = Array.from(fileScores.entries())
|
|
180
|
+
.sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]))
|
|
181
|
+
.slice(0, 40)
|
|
182
|
+
.map(([file]) => file);
|
|
183
|
+
// Extract symbols
|
|
184
|
+
const symbolExtractionResults = [];
|
|
185
|
+
for (const file of sortedFiles) {
|
|
186
|
+
const symbols = (0, symbols_1.extractFileSymbolsWithSignatures)(file, allLinks, workspaceRoot, grammars, fileContentCache);
|
|
187
|
+
symbolExtractionResults.push({ file, symbols });
|
|
188
|
+
}
|
|
189
|
+
for (const { file, symbols } of symbolExtractionResults) {
|
|
190
|
+
if (symbols.length === 0)
|
|
191
|
+
continue;
|
|
192
|
+
const relPath = (0, helpers_1.makeRelativePath)(file, workspaceRoot);
|
|
193
|
+
content += `### \`${relPath}\`\n\n`;
|
|
194
|
+
content += '| Symbol | Kind | Signature | Used In (files) |\n';
|
|
195
|
+
content += '|--------|------|-----------|----------------|\n';
|
|
196
|
+
for (const symbol of symbols.slice(0, 12)) {
|
|
197
|
+
const sig = symbol.signature ? `\`${symbol.signature}\`` : '—';
|
|
198
|
+
const sortedCallers = [...symbol.calledBy].sort();
|
|
199
|
+
const usedIn = sortedCallers
|
|
200
|
+
.slice(0, 2)
|
|
201
|
+
.map((c) => `\`${c}\``)
|
|
202
|
+
.join(', ') || '—';
|
|
203
|
+
content += `| \`${symbol.name}\` | ${symbol.kind} | ${sig} | ${usedIn} |\n`;
|
|
204
|
+
}
|
|
205
|
+
if (symbols.length > 12) {
|
|
206
|
+
content += `\n_+${symbols.length - 12} more symbols_\n`;
|
|
207
|
+
}
|
|
208
|
+
content += '\n';
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// ── CONVENTIONS ──────────────────────────────────────────
|
|
212
|
+
if (appFiles.length > 0) {
|
|
213
|
+
content += '---\n\n';
|
|
214
|
+
content += '## Conventions\n\n';
|
|
215
|
+
content += '_Naming patterns and styles. Follow these for consistency._\n\n';
|
|
216
|
+
// File naming
|
|
217
|
+
const fileNaming = (0, conventions_1.analyzeFileNaming)(appFiles, workspaceRoot);
|
|
218
|
+
if (fileNaming.patterns.length > 0) {
|
|
219
|
+
content += '### File Naming\n\n';
|
|
220
|
+
content += '| Pattern | Example | Count |\n';
|
|
221
|
+
content += '|---------|---------|-------|\n';
|
|
222
|
+
for (const pattern of fileNaming.patterns.slice(0, 4)) {
|
|
223
|
+
content += `| ${pattern.style} | \`${pattern.example}\` | ${pattern.count} |\n`;
|
|
224
|
+
}
|
|
225
|
+
content += '\n';
|
|
226
|
+
if (fileNaming.dominant) {
|
|
227
|
+
content += `**Use:** ${fileNaming.dominant} for new files.\n\n`;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// Function naming patterns
|
|
231
|
+
const funcNaming = (0, conventions_1.analyzeFunctionNaming)(appFiles, fileContentCache);
|
|
232
|
+
if (funcNaming.patterns.length > 0) {
|
|
233
|
+
content += '### Function Naming\n\n';
|
|
234
|
+
for (const pattern of funcNaming.patterns.slice(0, 5)) {
|
|
235
|
+
content += `- \`${pattern.pattern}\` → \`${pattern.example}\` (${pattern.usage})\n`;
|
|
236
|
+
}
|
|
237
|
+
content += '\n';
|
|
238
|
+
}
|
|
239
|
+
// Framework patterns
|
|
240
|
+
const frameworkPatterns = (0, conventions_1.detectFrameworkPatterns)(appFiles, workspaceRoot);
|
|
241
|
+
if (frameworkPatterns.length > 0) {
|
|
242
|
+
content += '### Framework Patterns\n\n';
|
|
243
|
+
for (const fw of frameworkPatterns) {
|
|
244
|
+
content += `**${fw.name}:**\n`;
|
|
245
|
+
for (const pattern of fw.patterns.slice(0, 3)) {
|
|
246
|
+
content += `- ${pattern}\n`;
|
|
247
|
+
}
|
|
248
|
+
content += '\n';
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
content += `\n_Generated: ${generatedAt}_\n`;
|
|
253
|
+
return (0, helpers_1.enforceLineBudget)(content, constants_1.KB_SIZE_LIMITS.map, 'map.md', generatedAt);
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=mapEmitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapEmitter.js","sourceRoot":"","sources":["../../src/kb/mapEmitter.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BH,0CA6PC;AAxRD,2CAA6B;AAE7B,2CAA6C;AAC7C,uCAAgE;AAChE,+CAA6C;AAC7C,+CAA6D;AAC7D,2CAA+C;AAC/C,uCAAoF;AAEpF,+CAAkG;AAclG;;;GAGG;AACH,SAAgB,eAAe,CAAC,KAAsB;IACpD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,GAClG,KAAK,CAAC;IAER,IAAI,OAAO,GAAG,WAAW,CAAC;IAC1B,OAAO;QACL,wGAAw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AC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared KB output policy.
|
|
3
|
+
*
|
|
4
|
+
* Centralizes:
|
|
5
|
+
* - newline normalization
|
|
6
|
+
* - line counting
|
|
7
|
+
* - truncation footer wording
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeNewlines(text: string): string;
|
|
10
|
+
export declare function splitLines(text: string): string[];
|
|
11
|
+
export declare function truncationFooter(maxLines: number, omittedLines: number, generatedAt: string): string[];
|
|
12
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/kb/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAEjD;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAOtG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared KB output policy.
|
|
4
|
+
*
|
|
5
|
+
* Centralizes:
|
|
6
|
+
* - newline normalization
|
|
7
|
+
* - line counting
|
|
8
|
+
* - truncation footer wording
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.normalizeNewlines = normalizeNewlines;
|
|
12
|
+
exports.splitLines = splitLines;
|
|
13
|
+
exports.truncationFooter = truncationFooter;
|
|
14
|
+
function normalizeNewlines(text) {
|
|
15
|
+
// Normalize CRLF and CR-only to LF for stable line counting.
|
|
16
|
+
return text.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
17
|
+
}
|
|
18
|
+
function splitLines(text) {
|
|
19
|
+
return normalizeNewlines(text).split('\n');
|
|
20
|
+
}
|
|
21
|
+
function truncationFooter(maxLines, omittedLines, generatedAt) {
|
|
22
|
+
return [
|
|
23
|
+
'',
|
|
24
|
+
`_[Content truncated at ${maxLines} lines. ${omittedLines} lines omitted.]_`,
|
|
25
|
+
'',
|
|
26
|
+
`_Generated: ${generatedAt}_`,
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/kb/policy.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAEH,8CAGC;AAED,gCAEC;AAED,4CAOC;AAhBD,SAAgB,iBAAiB,CAAC,IAAY;IAC5C,6DAA6D;IAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED,SAAgB,UAAU,CAAC,IAAY;IACrC,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,SAAgB,gBAAgB,CAAC,QAAgB,EAAE,YAAoB,EAAE,WAAmB;IAC1F,OAAO;QACL,EAAE;QACF,0BAA0B,QAAQ,WAAW,YAAY,mBAAmB;QAC5E,EAAE;QACF,eAAe,WAAW,GAAG;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symbol-extraction helpers for the KB emitter.
|
|
3
|
+
*
|
|
4
|
+
* - extractModelSignature – one-line model signature from content
|
|
5
|
+
* - extractFileSymbolsWithSignatures – all exported symbols in a file
|
|
6
|
+
*
|
|
7
|
+
* Regex-based fallback; tree-sitter support is injected via `grammars`
|
|
8
|
+
* parameter following the existing kb.ts contract.
|
|
9
|
+
*
|
|
10
|
+
* All functions are pure (no I/O, no vscode).
|
|
11
|
+
*/
|
|
12
|
+
import { DependencyLink, ExtractedSymbol } from '@aspectcode/core';
|
|
13
|
+
export interface LoadedGrammars {
|
|
14
|
+
python?: unknown;
|
|
15
|
+
typescript?: unknown;
|
|
16
|
+
tsx?: unknown;
|
|
17
|
+
javascript?: unknown;
|
|
18
|
+
java?: unknown;
|
|
19
|
+
csharp?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export type SymbolExtractor = (grammar: unknown, text: string) => ExtractedSymbol[];
|
|
22
|
+
export interface SymbolExtractors {
|
|
23
|
+
extractPythonSymbols?: SymbolExtractor;
|
|
24
|
+
extractTSJSSymbols?: SymbolExtractor;
|
|
25
|
+
extractJavaSymbols?: SymbolExtractor;
|
|
26
|
+
extractCSharpSymbols?: SymbolExtractor;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Extract a one-line signature for a named model/class/interface
|
|
30
|
+
* from the file content cache.
|
|
31
|
+
*/
|
|
32
|
+
export declare function extractModelSignature(filePath: string, modelName: string, fileContentCache: Map<string, string>): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Extract all exported symbols from a file with optional tree-sitter support.
|
|
35
|
+
* Falls back to regex-based extraction when grammars are not available.
|
|
36
|
+
*/
|
|
37
|
+
export declare function extractFileSymbolsWithSignatures(filePath: string, allLinks: DependencyLink[], workspaceRoot: string, grammars: LoadedGrammars | null | undefined, fileContentCache: Map<string, string>, extractors?: SymbolExtractors): Array<{
|
|
38
|
+
name: string;
|
|
39
|
+
kind: string;
|
|
40
|
+
signature: string | null;
|
|
41
|
+
calledBy: string[];
|
|
42
|
+
}>;
|
|
43
|
+
//# sourceMappingURL=symbols.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../src/kb/symbols.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAW,cAAc,EAAE,eAAe,EAAE,MAA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