@archmind26/plugin-lang-ts 0.1.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 +9 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts.d.ts +27 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +79 -0
- package/dist/prompts.js.map +1 -0
- package/dist/scanner.d.ts +11 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +89 -0
- package/dist/scanner.js.map +1 -0
- package/dist/typescript-plugin.d.ts +18 -0
- package/dist/typescript-plugin.d.ts.map +1 -0
- package/dist/typescript-plugin.js +183 -0
- package/dist/typescript-plugin.js.map +1 -0
- package/package.json +39 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
UNLICENSED
|
|
2
|
+
|
|
3
|
+
This software is proprietary. All rights reserved.
|
|
4
|
+
|
|
5
|
+
No part of this software may be reproduced, distributed, or transmitted
|
|
6
|
+
in any form or by any means without the prior written permission of the
|
|
7
|
+
owner.
|
|
8
|
+
|
|
9
|
+
For licensing inquiries, please contact the repository owner.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ParsedFile } from "@archmind26/schema";
|
|
2
|
+
/**
|
|
3
|
+
* Build a structured prompt for LLM-assisted symbol extraction.
|
|
4
|
+
* Feeds the raw file content and the deterministic parse results so the
|
|
5
|
+
* model only needs to enrich, not re-discover.
|
|
6
|
+
*/
|
|
7
|
+
export declare function symbolExtractionPrompt(input: {
|
|
8
|
+
file: string;
|
|
9
|
+
content: string;
|
|
10
|
+
parsed: ParsedFile;
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function dependencyExtractionPrompt(input: {
|
|
13
|
+
file: string;
|
|
14
|
+
content: string;
|
|
15
|
+
parsed: ParsedFile;
|
|
16
|
+
}): string;
|
|
17
|
+
export declare function routeExtractionPrompt(input: {
|
|
18
|
+
file: string;
|
|
19
|
+
content: string;
|
|
20
|
+
parsed: ParsedFile;
|
|
21
|
+
}): string;
|
|
22
|
+
export declare function entityExtractionPrompt(input: {
|
|
23
|
+
file: string;
|
|
24
|
+
content: string;
|
|
25
|
+
parsed: ParsedFile;
|
|
26
|
+
}): string;
|
|
27
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,MAAM,CA0B3G;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,MAAM,CAe/G;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,MAAM,CAc1G;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,MAAM,CAc3G"}
|
package/dist/prompts.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a structured prompt for LLM-assisted symbol extraction.
|
|
3
|
+
* Feeds the raw file content and the deterministic parse results so the
|
|
4
|
+
* model only needs to enrich, not re-discover.
|
|
5
|
+
*/
|
|
6
|
+
export function symbolExtractionPrompt(input) {
|
|
7
|
+
return `You are analyzing a TypeScript source file for architecture intelligence. Extract the following information as JSON:
|
|
8
|
+
|
|
9
|
+
1. **Modules** — path and exported names
|
|
10
|
+
2. **Classes** — FQN, module, superclass, interfaces, member names
|
|
11
|
+
3. **Functions** — FQN, module, async/export status, parameter names, return type
|
|
12
|
+
4. **Services** — FQN, module, decorators (e.g. @Injectable, @Service)
|
|
13
|
+
|
|
14
|
+
Rules:
|
|
15
|
+
- Use the exact file path as the module identifier.
|
|
16
|
+
- FQN should be the fully qualified name (e.g. "src/users/UserService" or "UserService").
|
|
17
|
+
- Return ONLY a valid JSON object matching this schema: { "modules": [{ "path": string, "language": string, "exportedNames": string[] }], "classes": [{ "fqn": string, "moduleId": string, "superClass"?: string, "interfaces"?: string[], "members"?: string[] }], "functions": [{ "fqn": string, "moduleId": string, "isAsync"?: boolean, "isExported"?: boolean, "parameters"?: string[], "returnType"?: string }], "services": [{ "fqn": string, "moduleId": string, "decorators"?: string[] }] }
|
|
18
|
+
|
|
19
|
+
File: ${input.file}
|
|
20
|
+
|
|
21
|
+
Deterministic parse hints:
|
|
22
|
+
Imports: ${JSON.stringify(input.parsed.imports)}
|
|
23
|
+
Exports: ${JSON.stringify(input.parsed.exports)}
|
|
24
|
+
Declared symbols: ${JSON.stringify(input.parsed.declaredSymbols)}
|
|
25
|
+
|
|
26
|
+
Content:
|
|
27
|
+
\`\`\`${input.parsed.language}
|
|
28
|
+
${input.content}
|
|
29
|
+
\`\`\`
|
|
30
|
+
|
|
31
|
+
Return the JSON object now.`;
|
|
32
|
+
}
|
|
33
|
+
export function dependencyExtractionPrompt(input) {
|
|
34
|
+
return `Analyze dependencies for this TypeScript file. Extract all cross-file dependencies as JSON.
|
|
35
|
+
|
|
36
|
+
Rules:
|
|
37
|
+
- Dependencies are references from THIS file to other files or modules.
|
|
38
|
+
- "kind" can be: "import", "reference", or "call"
|
|
39
|
+
- "isExternal" is true for npm packages, false for local imports
|
|
40
|
+
- Return ONLY a valid JSON object matching: { "dependencies": [{ "fromFile": string, "toSpecifier": string, "kind": "import" | "reference" | "call", "isExternal"?: boolean }] }
|
|
41
|
+
|
|
42
|
+
File: ${input.file}
|
|
43
|
+
|
|
44
|
+
Deterministic imports already found: ${JSON.stringify(input.parsed.imports)}
|
|
45
|
+
Add any additional dynamic or inferred dependencies.
|
|
46
|
+
|
|
47
|
+
Return the JSON object now.`;
|
|
48
|
+
}
|
|
49
|
+
export function routeExtractionPrompt(input) {
|
|
50
|
+
return `Extract HTTP routes from this TypeScript file (Express, NestJS, Fastify, Hono, Next.js API routes, etc.). Return JSON.
|
|
51
|
+
|
|
52
|
+
Rules:
|
|
53
|
+
- "method": GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
|
|
54
|
+
- "path": the route path template (e.g. "/users/:id")
|
|
55
|
+
- "handler": the function/controller method name
|
|
56
|
+
- "module": the file path
|
|
57
|
+
- "framework" is optional ("express", "nestjs", "nextjs", "fastify", etc.)
|
|
58
|
+
- Return ONLY valid JSON matching: { "routes": [{ "method": string, "path": string, "handler": string, "module": string, "middleware"?: string[], "framework"?: string }] }
|
|
59
|
+
|
|
60
|
+
File: ${input.file}
|
|
61
|
+
|
|
62
|
+
Return the JSON object now.`;
|
|
63
|
+
}
|
|
64
|
+
export function entityExtractionPrompt(input) {
|
|
65
|
+
return `Extract data model entities (database models, DTOs, type definitions) from this TypeScript file. Return JSON.
|
|
66
|
+
|
|
67
|
+
Rules:
|
|
68
|
+
- "fqn": model name (e.g. "User")
|
|
69
|
+
- "moduleId": the file path
|
|
70
|
+
- "table" is the optional database table name
|
|
71
|
+
- "fields": each field with name, type, nullable, primaryKey
|
|
72
|
+
- "decorators" are ORM decorators (@Entity, @Column, etc.)
|
|
73
|
+
- Return ONLY valid JSON matching: { "entities": [{ "fqn": string, "moduleId": string, "table"?: string, "fields": [{ "name": string, "type": string, "nullable"?: boolean, "primaryKey"?: boolean }], "decorators"?: string[] }] }
|
|
74
|
+
|
|
75
|
+
File: ${input.file}
|
|
76
|
+
|
|
77
|
+
Return the JSON object now.`;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAA4D;IACjG,OAAO;;;;;;;;;;;;QAYD,KAAK,CAAC,IAAI;;;WAGP,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;WACpC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;oBAC3B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC;;;QAGxD,KAAK,CAAC,MAAM,CAAC,QAAQ;EAC3B,KAAK,CAAC,OAAO;;;4BAGa,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,KAA4D;IACrG,OAAO;;;;;;;;QAQD,KAAK,CAAC,IAAI;;uCAEqB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;;;4BAG/C,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAA4D;IAChG,OAAO;;;;;;;;;;QAUD,KAAK,CAAC,IAAI;;4BAEU,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAA4D;IACjG,OAAO;;;;;;;;;;QAUD,KAAK,CAAC,IAAI;;4BAEU,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ParseFileInput, ParsedFile } from "@archmind26/schema";
|
|
2
|
+
/**
|
|
3
|
+
* Deterministic surface scan of a TypeScript/TSX file.
|
|
4
|
+
* Uses regex-based extraction — NO AI, NO full AST parse.
|
|
5
|
+
*
|
|
6
|
+
* This provides the "compiler builds context" baseline that the AI-assisted
|
|
7
|
+
* methods enrich. Every parsing result feeds into the LLM prompt so the
|
|
8
|
+
* model doesn't need to re-discover basic facts.
|
|
9
|
+
*/
|
|
10
|
+
export declare function scanTypeScript(input: ParseFileInput): ParsedFile;
|
|
11
|
+
//# sourceMappingURL=scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../src/scanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAA8C,MAAM,oBAAoB,CAAC;AAEjH;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAShE"}
|
package/dist/scanner.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic surface scan of a TypeScript/TSX file.
|
|
3
|
+
* Uses regex-based extraction — NO AI, NO full AST parse.
|
|
4
|
+
*
|
|
5
|
+
* This provides the "compiler builds context" baseline that the AI-assisted
|
|
6
|
+
* methods enrich. Every parsing result feeds into the LLM prompt so the
|
|
7
|
+
* model doesn't need to re-discover basic facts.
|
|
8
|
+
*/
|
|
9
|
+
export function scanTypeScript(input) {
|
|
10
|
+
const { file, content } = input;
|
|
11
|
+
const language = file.endsWith(".tsx") || file.endsWith(".tsx") ? "tsx" : "typescript";
|
|
12
|
+
const imports = extractImports(content);
|
|
13
|
+
const exports = extractExports(content);
|
|
14
|
+
const declaredSymbols = extractDeclarations(content);
|
|
15
|
+
return { file, language, imports, exports, declaredSymbols };
|
|
16
|
+
}
|
|
17
|
+
const IMPORT_RE = /^import\s+(?:(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)\s*(?:,\s*\{[^}]*\})?\s+from\s+)?['"]([^'"]+)['"]\s*;?$/gm;
|
|
18
|
+
const DYNAMIC_IMPORT_RE = /import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
19
|
+
const EXPORT_RE = /^export\s+(?:(?<isDefault>default)\s+(?:class|function)\s+(?<name1>\w+)|(?<keyword>const|let|var|function|class|interface|type|enum)\s+(?<name2>\w+))/gm;
|
|
20
|
+
const CLASS_RE = /^(?:export\s+)?(?:abstract\s+)?class\s+(\w+)/gm;
|
|
21
|
+
const FUNCTION_DECL_RE = /^(?:export\s+)?(?:async\s+)?function\s+(?:\*?\s*)(\w+)/gm;
|
|
22
|
+
const INTERFACE_RE = /^(?:export\s+)?interface\s+(\w+)/gm;
|
|
23
|
+
const TYPE_RE = /^(?:export\s+)?type\s+(\w+)/gm;
|
|
24
|
+
const ENUM_RE = /^(?:export\s+)?enum\s+(\w+)/gm;
|
|
25
|
+
const CONST_EXPORT_RE = /^(?:export\s+)?(?:const|let|var)\s+(\w+)/gm;
|
|
26
|
+
function extractImports(content) {
|
|
27
|
+
const imports = [];
|
|
28
|
+
let match;
|
|
29
|
+
const norm = content.replace(/\\\n/g, " ");
|
|
30
|
+
IMPORT_RE.lastIndex = 0;
|
|
31
|
+
while ((match = IMPORT_RE.exec(norm)) !== null) {
|
|
32
|
+
const spec = match[1];
|
|
33
|
+
if (spec) {
|
|
34
|
+
imports.push({
|
|
35
|
+
source: spec,
|
|
36
|
+
isDynamic: false,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
DYNAMIC_IMPORT_RE.lastIndex = 0;
|
|
41
|
+
while ((match = DYNAMIC_IMPORT_RE.exec(norm)) !== null) {
|
|
42
|
+
imports.push({
|
|
43
|
+
source: match[1],
|
|
44
|
+
isDynamic: true,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return imports;
|
|
48
|
+
}
|
|
49
|
+
function extractExports(content) {
|
|
50
|
+
const exports = [];
|
|
51
|
+
let match;
|
|
52
|
+
EXPORT_RE.lastIndex = 0;
|
|
53
|
+
while ((match = EXPORT_RE.exec(content)) !== null) {
|
|
54
|
+
const groups = match.groups;
|
|
55
|
+
const name = groups.name1 ?? groups.name2;
|
|
56
|
+
const isDefault = groups.isDefault === "default";
|
|
57
|
+
if (name) {
|
|
58
|
+
exports.push({ name, isDefault });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return exports;
|
|
62
|
+
}
|
|
63
|
+
function extractDeclarations(content) {
|
|
64
|
+
const symbols = [];
|
|
65
|
+
let match;
|
|
66
|
+
const patterns = [
|
|
67
|
+
[CLASS_RE, "class"],
|
|
68
|
+
[FUNCTION_DECL_RE, "function"],
|
|
69
|
+
[INTERFACE_RE, "interface"],
|
|
70
|
+
[TYPE_RE, "type"],
|
|
71
|
+
[ENUM_RE, "enum"],
|
|
72
|
+
[CONST_EXPORT_RE, "variable"],
|
|
73
|
+
];
|
|
74
|
+
for (const [re, kind] of patterns) {
|
|
75
|
+
re.lastIndex = 0;
|
|
76
|
+
while ((match = re.exec(content)) !== null) {
|
|
77
|
+
const name = match[1];
|
|
78
|
+
if (name && !symbols.some((s) => s.name === name && s.kind === kind)) {
|
|
79
|
+
symbols.push({
|
|
80
|
+
name,
|
|
81
|
+
kind,
|
|
82
|
+
exported: content.lastIndexOf("export", match.index) <= match.index,
|
|
83
|
+
});
|
|
84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AAO,CAAC;AACjB,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAe;IAC1C,MAAM,OAAO,GAAqB,EAAE,CAAC;IACrC,IAAI,KAA6B,CAAC;IAElC,MAAM,QAAQ,GAAuC;QACnD,CAAC,QAAQ,EAAE,OAAO,CAAC;QACnB,CAAC,gBAAgB,EAAE,UAAU,CAAC;QAC9B,CAAC,YAAY,EAAE,WAAW,CAAC;QAC3B,CAAC,OAAO,EAAE,MAAM,CAAC;QACjB,CAAC,OAAO,EAAE,MAAM,CAAC;QACjB,CAAC,eAAe,EAAE,UAAU,CAAC;KAC9B,CAAC;IAEF,KAAK,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC;QAClC,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC;QACjB,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;YACvB,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;gBACrE,OAAO,CAAC,IAAI,CAAC;oBACX,IAAI;oBACJ,IAAI;oBACJ,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK;iBACpE,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LanguagePlugin, LanguageDiscovery, ParseFileInput, ParsedFile, ExtractInput, ExtractedSymbols, ExtractedDependencies, ExtractedRoutes, ExtractedEntities, CompilerContextHandle } from "@archmind26/schema";
|
|
2
|
+
export declare class TypeScriptPlugin implements LanguagePlugin {
|
|
3
|
+
readonly id = "typescript";
|
|
4
|
+
readonly name = "TypeScript";
|
|
5
|
+
readonly extensions: string[];
|
|
6
|
+
discover(manifest: {
|
|
7
|
+
files: readonly {
|
|
8
|
+
path: string;
|
|
9
|
+
language?: string;
|
|
10
|
+
}[];
|
|
11
|
+
}): Promise<LanguageDiscovery>;
|
|
12
|
+
parseFile(input: ParseFileInput): Promise<ParsedFile>;
|
|
13
|
+
extractSymbols(input: ExtractInput, ctx: CompilerContextHandle): Promise<ExtractedSymbols>;
|
|
14
|
+
extractDependencies(input: ExtractInput, ctx: CompilerContextHandle): Promise<ExtractedDependencies>;
|
|
15
|
+
extractRoutes(input: ExtractInput, ctx: CompilerContextHandle): Promise<ExtractedRoutes>;
|
|
16
|
+
extractEntities(input: ExtractInput, ctx: CompilerContextHandle): Promise<ExtractedEntities>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=typescript-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-plugin.d.ts","sourceRoot":"","sources":["../src/typescript-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAsD5B,qBAAa,gBAAiB,YAAW,cAAc;IACrD,QAAQ,CAAC,EAAE,gBAAgB;IAC3B,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,UAAU,EAA+B,MAAM,EAAE,CAAC;IAErD,QAAQ,CAAC,QAAQ,EAAE;QAAE,KAAK,EAAE,SAAS;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOzG,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAIrD,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAkE1F,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAoBpG,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC;IAsBxF,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAyBnG"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { scanTypeScript } from "./scanner.js";
|
|
2
|
+
import { deepNullToUndefined } from "@archmind26/schema";
|
|
3
|
+
import { symbolExtractionPrompt, dependencyExtractionPrompt, routeExtractionPrompt, entityExtractionPrompt, } from "./prompts.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
const TS_EXTENSIONS = [".ts", ".tsx", ".cts", ".mts", ".js", ".jsx", ".mjs", ".cjs"];
|
|
6
|
+
const paramSchema = z.union([
|
|
7
|
+
z.string(),
|
|
8
|
+
z.object({ name: z.string(), type: z.string().optional() }).transform((p) => p.type ? `${p.name}: ${p.type}` : p.name),
|
|
9
|
+
]);
|
|
10
|
+
const symbolsResponseSchema = z
|
|
11
|
+
.object({
|
|
12
|
+
modules: z.array(z.object({ path: z.string(), language: z.string(), exportedNames: z.array(z.string()) }).partial().catch({})).catch([]),
|
|
13
|
+
classes: z.array(z.object({ fqn: z.string().optional(), moduleId: z.string().optional(), superClass: z.string().optional(), interfaces: z.array(z.string()).optional(), members: z.array(z.string()).optional() }).catch({})).catch([]),
|
|
14
|
+
functions: z.array(z.object({ fqn: z.string().optional(), moduleId: z.string().optional(), isAsync: z.boolean().optional(), isExported: z.boolean().optional(), parameters: z.array(paramSchema).optional(), returnType: z.string().optional() }).catch({})).catch([]),
|
|
15
|
+
services: z.array(z.object({ fqn: z.string().optional(), moduleId: z.string().optional(), decorators: z.array(z.string()).optional() }).catch({})).catch([]),
|
|
16
|
+
})
|
|
17
|
+
.partial()
|
|
18
|
+
.catch({});
|
|
19
|
+
const dependenciesResponseSchema = z.object({
|
|
20
|
+
dependencies: z.array(z.object({ fromFile: z.string(), toSpecifier: z.string(), kind: z.enum(["import", "reference", "call"]), isExternal: z.boolean().optional() })),
|
|
21
|
+
}).partial().default({ dependencies: [] });
|
|
22
|
+
const routesResponseSchema = z.object({
|
|
23
|
+
routes: z.array(z.object({ method: z.string().optional(), path: z.string().optional(), handler: z.string().optional(), module: z.string().optional(), middleware: z.array(z.string()).optional(), framework: z.string().optional() }).catch({})).catch([]),
|
|
24
|
+
}).partial().catch({}).default({ routes: [] });
|
|
25
|
+
const entitiesResponseSchema = z.object({
|
|
26
|
+
entities: z.array(z.object({ fqn: z.string().optional(), moduleId: z.string().optional(), table: z.string().optional(), fields: z.array(z.object({ name: z.string().optional(), type: z.string().optional(), nullable: z.boolean().optional(), primaryKey: z.boolean().optional() }).catch({})).optional(), decorators: z.array(z.string()).optional() }).catch({})).catch([]),
|
|
27
|
+
}).partial().catch({}).default({ entities: [] });
|
|
28
|
+
export class TypeScriptPlugin {
|
|
29
|
+
id = "typescript";
|
|
30
|
+
name = "TypeScript";
|
|
31
|
+
extensions = TS_EXTENSIONS;
|
|
32
|
+
async discover(manifest) {
|
|
33
|
+
const files = manifest.files
|
|
34
|
+
.filter((f) => this.extensions.some((ext) => f.path.endsWith(ext)))
|
|
35
|
+
.map((f) => f.path);
|
|
36
|
+
return { language: "typescript", files, frameworks: [] };
|
|
37
|
+
}
|
|
38
|
+
async parseFile(input) {
|
|
39
|
+
return scanTypeScript(input);
|
|
40
|
+
}
|
|
41
|
+
async extractSymbols(input, ctx) {
|
|
42
|
+
// Always produce at least a module entry from the file path (deterministic)
|
|
43
|
+
const baseModule = {
|
|
44
|
+
path: input.file,
|
|
45
|
+
language: "typescript",
|
|
46
|
+
exportedNames: input.parsed.exports.map((e) => e.name),
|
|
47
|
+
};
|
|
48
|
+
if (!ctx.ai) {
|
|
49
|
+
return {
|
|
50
|
+
modules: [baseModule],
|
|
51
|
+
classes: [],
|
|
52
|
+
functions: [],
|
|
53
|
+
services: [],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const prompt = symbolExtractionPrompt(input);
|
|
57
|
+
const res = await ctx.ai.generate({ prompt, format: "json", temperature: 0, seed: 1 });
|
|
58
|
+
if (!res.ok) {
|
|
59
|
+
return {
|
|
60
|
+
modules: [baseModule],
|
|
61
|
+
classes: [],
|
|
62
|
+
functions: [],
|
|
63
|
+
services: [],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const parsed = symbolsResponseSchema.safeParse(tryParseJSON(res.text));
|
|
67
|
+
if (!parsed.success) {
|
|
68
|
+
ctx.log.warn(`Symbol extraction validation failed for ${input.file}`, { error: parsed.error.message });
|
|
69
|
+
return {
|
|
70
|
+
modules: [baseModule],
|
|
71
|
+
classes: [],
|
|
72
|
+
functions: [],
|
|
73
|
+
services: [],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
modules: parsed.data.modules?.map(() => ({
|
|
78
|
+
path: input.file,
|
|
79
|
+
language: "typescript",
|
|
80
|
+
exportedNames: baseModule.exportedNames,
|
|
81
|
+
})) ?? [baseModule],
|
|
82
|
+
classes: parsed.data.classes?.map((c) => ({
|
|
83
|
+
fqn: c.fqn ?? `${input.file}:${c.fqn ?? "class"}`,
|
|
84
|
+
moduleId: input.file,
|
|
85
|
+
superClass: c.superClass,
|
|
86
|
+
interfaces: c.interfaces,
|
|
87
|
+
members: c.members,
|
|
88
|
+
})) ?? [],
|
|
89
|
+
functions: parsed.data.functions?.map((f) => ({
|
|
90
|
+
fqn: f.fqn ?? `${input.file}:${f.fqn ?? "fn"}`,
|
|
91
|
+
moduleId: input.file,
|
|
92
|
+
isAsync: f.isAsync,
|
|
93
|
+
isExported: f.isExported,
|
|
94
|
+
parameters: f.parameters,
|
|
95
|
+
returnType: f.returnType,
|
|
96
|
+
})) ?? [],
|
|
97
|
+
services: parsed.data.services?.map((s) => ({
|
|
98
|
+
fqn: s.fqn ?? `${input.file}:${s.fqn ?? "service"}`,
|
|
99
|
+
moduleId: input.file,
|
|
100
|
+
decorators: s.decorators,
|
|
101
|
+
})) ?? [],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
async extractDependencies(input, ctx) {
|
|
105
|
+
if (!ctx.ai) {
|
|
106
|
+
return { dependencies: input.parsed.imports.map((i) => ({ fromFile: input.file, toSpecifier: i.source, kind: "import", isExternal: !i.source.startsWith(".") && !i.source.startsWith("/") })) };
|
|
107
|
+
}
|
|
108
|
+
const prompt = dependencyExtractionPrompt(input);
|
|
109
|
+
const res = await ctx.ai.generate({ prompt, format: "json", temperature: 0, seed: 1 });
|
|
110
|
+
if (!res.ok) {
|
|
111
|
+
return { dependencies: [] };
|
|
112
|
+
}
|
|
113
|
+
const parsed = dependenciesResponseSchema.safeParse(tryParseJSON(res.text));
|
|
114
|
+
return {
|
|
115
|
+
dependencies: parsed.data?.dependencies?.map((d) => ({
|
|
116
|
+
fromFile: input.file,
|
|
117
|
+
toSpecifier: d.toSpecifier,
|
|
118
|
+
kind: d.kind ?? "import",
|
|
119
|
+
isExternal: d.isExternal,
|
|
120
|
+
})) ?? [],
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
async extractRoutes(input, ctx) {
|
|
124
|
+
if (!ctx.ai) {
|
|
125
|
+
return { routes: [] };
|
|
126
|
+
}
|
|
127
|
+
const prompt = routeExtractionPrompt(input);
|
|
128
|
+
const res = await ctx.ai.generate({ prompt, format: "json", temperature: 0, seed: 1 });
|
|
129
|
+
if (!res.ok) {
|
|
130
|
+
return { routes: [] };
|
|
131
|
+
}
|
|
132
|
+
const parsed = routesResponseSchema.safeParse(tryParseJSON(res.text));
|
|
133
|
+
return {
|
|
134
|
+
routes: parsed.data?.routes?.map((r) => ({
|
|
135
|
+
method: r.method ?? "GET",
|
|
136
|
+
path: r.path ?? "/",
|
|
137
|
+
handler: r.handler ?? "unknown",
|
|
138
|
+
module: input.file,
|
|
139
|
+
middleware: r.middleware,
|
|
140
|
+
framework: r.framework,
|
|
141
|
+
})) ?? [],
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
async extractEntities(input, ctx) {
|
|
145
|
+
if (!ctx.ai) {
|
|
146
|
+
return { entities: [] };
|
|
147
|
+
}
|
|
148
|
+
const prompt = entityExtractionPrompt(input);
|
|
149
|
+
const res = await ctx.ai.generate({ prompt, format: "json", temperature: 0, seed: 1 });
|
|
150
|
+
if (!res.ok) {
|
|
151
|
+
return { entities: [] };
|
|
152
|
+
}
|
|
153
|
+
const parsed = entitiesResponseSchema.safeParse(tryParseJSON(res.text));
|
|
154
|
+
return {
|
|
155
|
+
entities: parsed.data?.entities?.map((e) => ({
|
|
156
|
+
fqn: e.fqn ?? `${input.file}:${e.fqn ?? "entity"}`,
|
|
157
|
+
moduleId: input.file,
|
|
158
|
+
table: e.table,
|
|
159
|
+
fields: (e.fields ?? []).map((f) => ({
|
|
160
|
+
name: f.name ?? "unknown",
|
|
161
|
+
type: f.type ?? "any",
|
|
162
|
+
nullable: f.nullable,
|
|
163
|
+
primaryKey: f.primaryKey,
|
|
164
|
+
})),
|
|
165
|
+
decorators: e.decorators,
|
|
166
|
+
})) ?? [],
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/** Safely parse JSON from LLM output (the model sometimes wraps in markdown blocks). */
|
|
171
|
+
function tryParseJSON(text) {
|
|
172
|
+
const cleaned = text
|
|
173
|
+
.replace(/^```(?:json)?\s*/i, "")
|
|
174
|
+
.replace(/\s*```$/i, "")
|
|
175
|
+
.trim();
|
|
176
|
+
try {
|
|
177
|
+
return deepNullToUndefined(JSON.parse(cleaned));
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
return {};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=typescript-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-plugin.js","sourceRoot":"","sources":["../src/typescript-plugin.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAE9F,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC;IAC1B,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;CACvH,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,CAAC;KAC5B,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,KAAK,CACd,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,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C;IACZ,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@archmind26/plugin-lang-ts",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"zod": "^3.24.1",
|
|
22
|
+
"@archmind26/schema": "0.1.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^22.10.0",
|
|
26
|
+
"rimraf": "^6.0.1",
|
|
27
|
+
"tsx": "^4.19.2",
|
|
28
|
+
"typescript": "^5.7.2",
|
|
29
|
+
"vitest": "^2.1.8"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc -p tsconfig.json",
|
|
33
|
+
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
|
|
34
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"test:watch": "vitest",
|
|
37
|
+
"clean": "rimraf dist .tsbuildinfo"
|
|
38
|
+
}
|
|
39
|
+
}
|