@mgamil/mapx 0.2.4
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 +194 -0
- package/README.md +488 -0
- package/VERSION +1 -0
- package/dist/agents/generator.d.ts +74 -0
- package/dist/agents/generator.js +375 -0
- package/dist/agents/templates.d.ts +29 -0
- package/dist/agents/templates.js +459 -0
- package/dist/cli.d.ts +16 -0
- package/dist/cli.js +1835 -0
- package/dist/core/cluster-engine.d.ts +32 -0
- package/dist/core/cluster-engine.js +314 -0
- package/dist/core/config.d.ts +29 -0
- package/dist/core/config.js +178 -0
- package/dist/core/context-builder.d.ts +61 -0
- package/dist/core/context-builder.js +252 -0
- package/dist/core/flow-tracer.d.ts +63 -0
- package/dist/core/flow-tracer.js +366 -0
- package/dist/core/git-tracker.d.ts +20 -0
- package/dist/core/git-tracker.js +159 -0
- package/dist/core/graph.d.ts +42 -0
- package/dist/core/graph.js +186 -0
- package/dist/core/metrics.d.ts +24 -0
- package/dist/core/metrics.js +87 -0
- package/dist/core/scanner.d.ts +53 -0
- package/dist/core/scanner.js +949 -0
- package/dist/core/store-bun.d.ts +13 -0
- package/dist/core/store-bun.js +34 -0
- package/dist/core/store-interface.d.ts +15 -0
- package/dist/core/store-interface.js +7 -0
- package/dist/core/store-node.d.ts +13 -0
- package/dist/core/store-node.js +35 -0
- package/dist/core/store.d.ts +132 -0
- package/dist/core/store.js +614 -0
- package/dist/core/workspace-manager.d.ts +9 -0
- package/dist/core/workspace-manager.js +64 -0
- package/dist/exporters/dot-exporter.d.ts +16 -0
- package/dist/exporters/dot-exporter.js +179 -0
- package/dist/exporters/graph-exporter.d.ts +14 -0
- package/dist/exporters/graph-exporter.js +85 -0
- package/dist/exporters/index.d.ts +9 -0
- package/dist/exporters/index.js +12 -0
- package/dist/exporters/llm-exporter.d.ts +18 -0
- package/dist/exporters/llm-exporter.js +224 -0
- package/dist/exporters/svg-exporter.d.ts +19 -0
- package/dist/exporters/svg-exporter.js +319 -0
- package/dist/exporters/toon-exporter.d.ts +16 -0
- package/dist/exporters/toon-exporter.js +246 -0
- package/dist/frameworks/detectors/aspnet.d.ts +11 -0
- package/dist/frameworks/detectors/aspnet.js +52 -0
- package/dist/frameworks/detectors/django.d.ts +14 -0
- package/dist/frameworks/detectors/django.js +135 -0
- package/dist/frameworks/detectors/drupal.d.ts +13 -0
- package/dist/frameworks/detectors/drupal.js +94 -0
- package/dist/frameworks/detectors/express.d.ts +12 -0
- package/dist/frameworks/detectors/express.js +234 -0
- package/dist/frameworks/detectors/fastapi.d.ts +12 -0
- package/dist/frameworks/detectors/fastapi.js +203 -0
- package/dist/frameworks/detectors/flask.d.ts +12 -0
- package/dist/frameworks/detectors/flask.js +244 -0
- package/dist/frameworks/detectors/go.d.ts +11 -0
- package/dist/frameworks/detectors/go.js +75 -0
- package/dist/frameworks/detectors/laravel.d.ts +11 -0
- package/dist/frameworks/detectors/laravel.js +462 -0
- package/dist/frameworks/detectors/nestjs.d.ts +12 -0
- package/dist/frameworks/detectors/nestjs.js +155 -0
- package/dist/frameworks/detectors/nextjs.d.ts +11 -0
- package/dist/frameworks/detectors/nextjs.js +118 -0
- package/dist/frameworks/detectors/rails.d.ts +12 -0
- package/dist/frameworks/detectors/rails.js +76 -0
- package/dist/frameworks/detectors/react-router.d.ts +11 -0
- package/dist/frameworks/detectors/react-router.js +115 -0
- package/dist/frameworks/detectors/rust.d.ts +11 -0
- package/dist/frameworks/detectors/rust.js +59 -0
- package/dist/frameworks/detectors/spring.d.ts +11 -0
- package/dist/frameworks/detectors/spring.js +56 -0
- package/dist/frameworks/detectors/sveltekit.d.ts +11 -0
- package/dist/frameworks/detectors/sveltekit.js +154 -0
- package/dist/frameworks/detectors/symfony.d.ts +13 -0
- package/dist/frameworks/detectors/symfony.js +175 -0
- package/dist/frameworks/detectors/tanstack-router.d.ts +12 -0
- package/dist/frameworks/detectors/tanstack-router.js +80 -0
- package/dist/frameworks/detectors/vapor.d.ts +11 -0
- package/dist/frameworks/detectors/vapor.js +52 -0
- package/dist/frameworks/detectors/vue-router.d.ts +12 -0
- package/dist/frameworks/detectors/vue-router.js +237 -0
- package/dist/frameworks/detectors/wordpress.d.ts +13 -0
- package/dist/frameworks/detectors/wordpress.js +141 -0
- package/dist/frameworks/detectors/yii.d.ts +11 -0
- package/dist/frameworks/detectors/yii.js +131 -0
- package/dist/frameworks/framework-registry.d.ts +13 -0
- package/dist/frameworks/framework-registry.js +77 -0
- package/dist/frameworks/route-registry.d.ts +26 -0
- package/dist/frameworks/route-registry.js +102 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +30 -0
- package/dist/languages/index.d.ts +2 -0
- package/dist/languages/index.js +7 -0
- package/dist/languages/installer.d.ts +13 -0
- package/dist/languages/installer.js +103 -0
- package/dist/languages/registry.d.ts +19 -0
- package/dist/languages/registry.js +427 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +20 -0
- package/dist/mcp.d.ts +11 -0
- package/dist/mcp.js +1699 -0
- package/dist/parsers/common-methods.d.ts +3 -0
- package/dist/parsers/common-methods.js +33 -0
- package/dist/parsers/fallback-parser.d.ts +10 -0
- package/dist/parsers/fallback-parser.js +18 -0
- package/dist/parsers/generic-wasm-parser.d.ts +23 -0
- package/dist/parsers/generic-wasm-parser.js +168 -0
- package/dist/parsers/ignored-symbols.d.ts +26 -0
- package/dist/parsers/ignored-symbols.js +77 -0
- package/dist/parsers/index.d.ts +9 -0
- package/dist/parsers/index.js +13 -0
- package/dist/parsers/languages/javascript.d.ts +11 -0
- package/dist/parsers/languages/javascript.js +28 -0
- package/dist/parsers/languages/php.d.ts +15 -0
- package/dist/parsers/languages/php.js +648 -0
- package/dist/parsers/languages/typescript.d.ts +10 -0
- package/dist/parsers/languages/typescript.js +9 -0
- package/dist/parsers/languages/vue.d.ts +13 -0
- package/dist/parsers/languages/vue.js +63 -0
- package/dist/parsers/parse-worker.d.ts +2 -0
- package/dist/parsers/parse-worker.js +185 -0
- package/dist/parsers/parser-interface.d.ts +9 -0
- package/dist/parsers/parser-interface.js +0 -0
- package/dist/parsers/parser-registry.d.ts +8 -0
- package/dist/parsers/parser-registry.js +52 -0
- package/dist/parsers/wasm-parser.d.ts +16 -0
- package/dist/parsers/wasm-parser.js +110 -0
- package/dist/types.d.ts +172 -0
- package/dist/types.js +0 -0
- package/dist/ui/index.html +270 -0
- package/dist/ui/main.js +581 -0
- package/dist/ui/main.js.map +7 -0
- package/dist/ui/styles.css +573 -0
- package/dist/ui-events.d.ts +36 -0
- package/dist/ui-events.js +61 -0
- package/dist/ui-server.d.ts +12 -0
- package/dist/ui-server.js +504 -0
- package/package.json +179 -0
- package/queries/bash/references.scm +22 -0
- package/queries/bash/symbols.scm +15 -0
- package/queries/c/references.scm +14 -0
- package/queries/c/symbols.scm +30 -0
- package/queries/c-sharp/references.scm +26 -0
- package/queries/c-sharp/symbols.scm +57 -0
- package/queries/cpp/references.scm +21 -0
- package/queries/cpp/symbols.scm +44 -0
- package/queries/dart/references.scm +33 -0
- package/queries/dart/symbols.scm +38 -0
- package/queries/elixir/references.scm +45 -0
- package/queries/elixir/symbols.scm +41 -0
- package/queries/go/references.scm +22 -0
- package/queries/go/symbols.scm +53 -0
- package/queries/java/references.scm +32 -0
- package/queries/java/symbols.scm +41 -0
- package/queries/javascript/references.scm +14 -0
- package/queries/javascript/symbols.scm +23 -0
- package/queries/kotlin/references.scm +31 -0
- package/queries/kotlin/symbols.scm +24 -0
- package/queries/lua/references.scm +19 -0
- package/queries/lua/symbols.scm +29 -0
- package/queries/pascal/references.scm +29 -0
- package/queries/pascal/symbols.scm +45 -0
- package/queries/php/references.scm +109 -0
- package/queries/php/symbols.scm +33 -0
- package/queries/python/references.scm +50 -0
- package/queries/python/symbols.scm +21 -0
- package/queries/ruby/references.scm +48 -0
- package/queries/ruby/symbols.scm +24 -0
- package/queries/rust/references.scm +31 -0
- package/queries/rust/symbols.scm +35 -0
- package/queries/scala/references.scm +30 -0
- package/queries/scala/symbols.scm +35 -0
- package/queries/svelte/references.scm +20 -0
- package/queries/svelte/symbols.scm +30 -0
- package/queries/swift/references.scm +22 -0
- package/queries/swift/symbols.scm +37 -0
- package/queries/typescript/references.scm +25 -0
- package/queries/typescript/symbols.scm +35 -0
- package/queries/vue/references.scm +20 -0
- package/queries/vue/symbols.scm +28 -0
- package/queries/zig/references.scm +20 -0
- package/queries/zig/symbols.scm +22 -0
- package/wasm/tree-sitter-c.wasm +0 -0
- package/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/wasm/tree-sitter-cpp.wasm +0 -0
- package/wasm/tree-sitter-dart.wasm +0 -0
- package/wasm/tree-sitter-go.wasm +0 -0
- package/wasm/tree-sitter-java.wasm +0 -0
- package/wasm/tree-sitter-javascript.wasm +0 -0
- package/wasm/tree-sitter-kotlin.wasm +0 -0
- package/wasm/tree-sitter-php.wasm +0 -0
- package/wasm/tree-sitter-python.wasm +0 -0
- package/wasm/tree-sitter-ruby.wasm +0 -0
- package/wasm/tree-sitter-rust.wasm +0 -0
- package/wasm/tree-sitter-scala.wasm +0 -0
- package/wasm/tree-sitter-swift.wasm +0 -0
- package/wasm/tree-sitter-tsx.wasm +0 -0
- package/wasm/tree-sitter-typescript.wasm +0 -0
- package/wasm/tree-sitter-vue.wasm +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoreBackend, PreparedStmt } from './store-interface.js';
|
|
2
|
+
|
|
3
|
+
declare class BunStore implements StoreBackend {
|
|
4
|
+
private db;
|
|
5
|
+
constructor(dbPath: string);
|
|
6
|
+
exec(sql: string): void;
|
|
7
|
+
prepare(sql: string): PreparedStmt;
|
|
8
|
+
pragma(pragma: string): void;
|
|
9
|
+
inTransaction<T>(fn: () => T): T;
|
|
10
|
+
close(): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { BunStore };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
class BunStore {
|
|
2
|
+
db;
|
|
3
|
+
constructor(dbPath) {
|
|
4
|
+
const { Database } = require("bun:sqlite");
|
|
5
|
+
this.db = new Database(dbPath, { create: true });
|
|
6
|
+
this.pragma("journal_mode = WAL");
|
|
7
|
+
this.pragma("busy_timeout = 5000");
|
|
8
|
+
this.pragma("foreign_keys = ON");
|
|
9
|
+
}
|
|
10
|
+
exec(sql) {
|
|
11
|
+
this.db.exec(sql);
|
|
12
|
+
}
|
|
13
|
+
prepare(sql) {
|
|
14
|
+
const stmt = this.db.prepare(sql);
|
|
15
|
+
return {
|
|
16
|
+
run: (...args) => stmt.run(...args),
|
|
17
|
+
get: (...args) => stmt.get(...args),
|
|
18
|
+
all: (...args) => stmt.all(...args)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
pragma(pragma) {
|
|
22
|
+
this.db.exec(`PRAGMA ${pragma}`);
|
|
23
|
+
}
|
|
24
|
+
inTransaction(fn) {
|
|
25
|
+
const tx = this.db.transaction(fn);
|
|
26
|
+
return tx();
|
|
27
|
+
}
|
|
28
|
+
close() {
|
|
29
|
+
this.db.close();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
BunStore
|
|
34
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface StoreBackend {
|
|
2
|
+
exec(sql: string): void;
|
|
3
|
+
prepare(sql: string): PreparedStmt;
|
|
4
|
+
pragma(pragma: string): void;
|
|
5
|
+
close(): void;
|
|
6
|
+
inTransaction<T>(fn: () => T): T;
|
|
7
|
+
}
|
|
8
|
+
interface PreparedStmt {
|
|
9
|
+
run(...args: unknown[]): void;
|
|
10
|
+
get(...args: unknown[]): Record<string, unknown> | undefined;
|
|
11
|
+
all(...args: unknown[]): Record<string, unknown>[];
|
|
12
|
+
}
|
|
13
|
+
declare function createDatabasePath(workspaceRoot: string): string;
|
|
14
|
+
|
|
15
|
+
export { type PreparedStmt, type StoreBackend, createDatabasePath };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoreBackend, PreparedStmt } from './store-interface.js';
|
|
2
|
+
|
|
3
|
+
declare class NodeStore implements StoreBackend {
|
|
4
|
+
private db;
|
|
5
|
+
constructor(dbPath: string);
|
|
6
|
+
exec(sql: string): void;
|
|
7
|
+
prepare(sql: string): PreparedStmt;
|
|
8
|
+
pragma(pragma: string): void;
|
|
9
|
+
inTransaction<T>(fn: () => T): T;
|
|
10
|
+
close(): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { NodeStore };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
const _require = createRequire(import.meta.url);
|
|
3
|
+
class NodeStore {
|
|
4
|
+
db;
|
|
5
|
+
constructor(dbPath) {
|
|
6
|
+
const Database = _require("better-sqlite3");
|
|
7
|
+
this.db = new Database(dbPath);
|
|
8
|
+
this.pragma("journal_mode = WAL");
|
|
9
|
+
this.pragma("busy_timeout = 5000");
|
|
10
|
+
this.pragma("foreign_keys = ON");
|
|
11
|
+
}
|
|
12
|
+
exec(sql) {
|
|
13
|
+
this.db.exec(sql);
|
|
14
|
+
}
|
|
15
|
+
prepare(sql) {
|
|
16
|
+
const stmt = this.db.prepare(sql);
|
|
17
|
+
return {
|
|
18
|
+
run: (...args) => stmt.run(...args),
|
|
19
|
+
get: (...args) => stmt.get(...args),
|
|
20
|
+
all: (...args) => stmt.all(...args)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
pragma(pragma) {
|
|
24
|
+
this.db.pragma(pragma);
|
|
25
|
+
}
|
|
26
|
+
inTransaction(fn) {
|
|
27
|
+
return this.db.transaction(fn)();
|
|
28
|
+
}
|
|
29
|
+
close() {
|
|
30
|
+
this.db.close();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
NodeStore
|
|
35
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { StoreBackend } from './store-interface.js';
|
|
2
|
+
import { MapxGraph } from './graph.js';
|
|
3
|
+
import '../types.js';
|
|
4
|
+
|
|
5
|
+
declare class Store {
|
|
6
|
+
private backend;
|
|
7
|
+
constructor(dbPath: string);
|
|
8
|
+
private runMigrations;
|
|
9
|
+
private getSchemaVersion;
|
|
10
|
+
private columnExists;
|
|
11
|
+
get raw(): StoreBackend;
|
|
12
|
+
setMeta(key: string, value: string): void;
|
|
13
|
+
getMeta(key: string): string | null;
|
|
14
|
+
upsertFile(file: {
|
|
15
|
+
path: string;
|
|
16
|
+
repo: string;
|
|
17
|
+
language: string;
|
|
18
|
+
gitBlobHash: string | null;
|
|
19
|
+
contentHash: string | null;
|
|
20
|
+
lastScanned: string;
|
|
21
|
+
sizeBytes: number;
|
|
22
|
+
lines: number;
|
|
23
|
+
metadata?: Record<string, any>;
|
|
24
|
+
namespace?: string | null;
|
|
25
|
+
}): void;
|
|
26
|
+
updateFileMetadata(filePath: string, metadata: Record<string, any>): void;
|
|
27
|
+
deleteFile(filePath: string): void;
|
|
28
|
+
getFile(filePath: string): Record<string, unknown> | undefined;
|
|
29
|
+
getAllFiles(repo?: string): Record<string, unknown>[];
|
|
30
|
+
insertSymbol(sym: {
|
|
31
|
+
filePath: string;
|
|
32
|
+
repo: string;
|
|
33
|
+
name: string;
|
|
34
|
+
kind: string;
|
|
35
|
+
scope: string | null;
|
|
36
|
+
signature: string;
|
|
37
|
+
startLine: number;
|
|
38
|
+
endLine: number;
|
|
39
|
+
metadata: string;
|
|
40
|
+
}): void;
|
|
41
|
+
deleteSymbolsForFile(filePath: string): void;
|
|
42
|
+
searchSymbols(namePattern: string, repo?: string): Record<string, unknown>[];
|
|
43
|
+
getSymbolsForFile(filePath: string): Record<string, unknown>[];
|
|
44
|
+
getAllSymbols(repo?: string): Record<string, unknown>[];
|
|
45
|
+
insertEdge(edge: {
|
|
46
|
+
sourceFile: string;
|
|
47
|
+
targetFile: string;
|
|
48
|
+
sourceSymbol: string | null;
|
|
49
|
+
targetSymbol: string | null;
|
|
50
|
+
edgeType: string;
|
|
51
|
+
repo: string;
|
|
52
|
+
weight: number;
|
|
53
|
+
verifiability?: 'verified' | 'inferred';
|
|
54
|
+
metadata?: Record<string, any>;
|
|
55
|
+
targetRepo?: string | null;
|
|
56
|
+
}): void;
|
|
57
|
+
deleteEdgesForFile(filePath: string): void;
|
|
58
|
+
deleteFrameworkEdgesForRepo(repoName: string): void;
|
|
59
|
+
getEdgesForFile(filePath: string): Record<string, unknown>[];
|
|
60
|
+
getReverseEdges(filePath: string): Record<string, unknown>[];
|
|
61
|
+
getAllEdges(repo?: string): Record<string, unknown>[];
|
|
62
|
+
queryEdges(options: {
|
|
63
|
+
type?: string;
|
|
64
|
+
from?: string;
|
|
65
|
+
to?: string;
|
|
66
|
+
repo?: string;
|
|
67
|
+
}): Record<string, unknown>[];
|
|
68
|
+
getFileCount(repo?: string): number;
|
|
69
|
+
getSymbolCount(repo?: string): number;
|
|
70
|
+
getEdgeCount(repo?: string): number;
|
|
71
|
+
getLanguageBreakdown(repo?: string): Record<string, number>;
|
|
72
|
+
upsertSnapshot(snap: {
|
|
73
|
+
commitSha: string;
|
|
74
|
+
parentSha: string | null;
|
|
75
|
+
timestamp: string;
|
|
76
|
+
filesAdded: string;
|
|
77
|
+
filesModified: string;
|
|
78
|
+
filesRemoved: string;
|
|
79
|
+
symbolsDelta: string;
|
|
80
|
+
}): void;
|
|
81
|
+
getLatestSnapshot(): Record<string, unknown> | undefined;
|
|
82
|
+
clearClusters(repo: string): void;
|
|
83
|
+
insertCluster(cluster: {
|
|
84
|
+
repo: string;
|
|
85
|
+
name: string;
|
|
86
|
+
label: string;
|
|
87
|
+
source: string;
|
|
88
|
+
parentName: string | null;
|
|
89
|
+
depth: number;
|
|
90
|
+
fileCount: number;
|
|
91
|
+
}): void;
|
|
92
|
+
insertClusterMembership(membership: {
|
|
93
|
+
filePath: string;
|
|
94
|
+
clusterName: string;
|
|
95
|
+
repo: string;
|
|
96
|
+
isPrimary: number;
|
|
97
|
+
}): void;
|
|
98
|
+
getClusters(repo?: string): Record<string, unknown>[];
|
|
99
|
+
getClusterMemberships(repo?: string): Record<string, unknown>[];
|
|
100
|
+
getClusterFiles(clusterName: string, repo: string): string[];
|
|
101
|
+
getClusterEdges(clusterName: string, repo: string): {
|
|
102
|
+
sourceCluster: string;
|
|
103
|
+
targetCluster: string;
|
|
104
|
+
edgeCount: number;
|
|
105
|
+
dominantType: string;
|
|
106
|
+
}[];
|
|
107
|
+
deleteRepo(repoName: string): void;
|
|
108
|
+
searchSymbolsFiltered(options: {
|
|
109
|
+
term: string;
|
|
110
|
+
kind?: string;
|
|
111
|
+
filePrefix?: string;
|
|
112
|
+
exact?: boolean;
|
|
113
|
+
limit?: number;
|
|
114
|
+
repo?: string;
|
|
115
|
+
}): Record<string, any>[];
|
|
116
|
+
getSymbolByName(fullName: string, repo?: string): Record<string, any> | undefined;
|
|
117
|
+
getFilesFiltered(options: {
|
|
118
|
+
pathPrefix?: string;
|
|
119
|
+
lang?: string;
|
|
120
|
+
sort?: 'lines' | 'path';
|
|
121
|
+
limit?: number;
|
|
122
|
+
repo?: string;
|
|
123
|
+
}): Record<string, any>[];
|
|
124
|
+
getCallersOfSymbol(fullName: string, repo?: string): Record<string, any>[];
|
|
125
|
+
getCalleesOfSymbol(fullName: string, repo?: string): Record<string, any>[];
|
|
126
|
+
getTopFilesByPageRank(graph: MapxGraph, limit?: number): any[];
|
|
127
|
+
getTopSymbolsByPageRank(graph: MapxGraph, limit?: number): any[];
|
|
128
|
+
inTransaction<T>(fn: () => T): T;
|
|
129
|
+
close(): void;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export { Store };
|