@norescan/ecosystems 0.0.0-stage → 0.1.2

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.
Files changed (70) hide show
  1. package/README.md +40 -2
  2. package/dist/adapters/cpp.d.ts +14 -0
  3. package/dist/adapters/cpp.d.ts.map +1 -0
  4. package/dist/adapters/cpp.js +148 -0
  5. package/dist/adapters/cpp.js.map +1 -0
  6. package/dist/adapters/dart.d.ts +14 -0
  7. package/dist/adapters/dart.d.ts.map +1 -0
  8. package/dist/adapters/dart.js +99 -0
  9. package/dist/adapters/dart.js.map +1 -0
  10. package/dist/adapters/dotnet.d.ts +14 -0
  11. package/dist/adapters/dotnet.d.ts.map +1 -0
  12. package/dist/adapters/dotnet.js +90 -0
  13. package/dist/adapters/dotnet.js.map +1 -0
  14. package/dist/adapters/golang.d.ts +14 -0
  15. package/dist/adapters/golang.d.ts.map +1 -0
  16. package/dist/adapters/golang.js +140 -0
  17. package/dist/adapters/golang.js.map +1 -0
  18. package/dist/adapters/java.d.ts +14 -0
  19. package/dist/adapters/java.d.ts.map +1 -0
  20. package/dist/adapters/java.js +179 -0
  21. package/dist/adapters/java.js.map +1 -0
  22. package/dist/adapters/javascript.d.ts +15 -0
  23. package/dist/adapters/javascript.d.ts.map +1 -0
  24. package/dist/adapters/javascript.js +200 -0
  25. package/dist/adapters/javascript.js.map +1 -0
  26. package/dist/adapters/php.d.ts +14 -0
  27. package/dist/adapters/php.d.ts.map +1 -0
  28. package/dist/adapters/php.js +88 -0
  29. package/dist/adapters/php.js.map +1 -0
  30. package/dist/adapters/polyglot.d.ts +38 -0
  31. package/dist/adapters/polyglot.d.ts.map +1 -0
  32. package/dist/adapters/polyglot.js +176 -0
  33. package/dist/adapters/polyglot.js.map +1 -0
  34. package/dist/adapters/python.d.ts +14 -0
  35. package/dist/adapters/python.d.ts.map +1 -0
  36. package/dist/adapters/python.js +219 -0
  37. package/dist/adapters/python.js.map +1 -0
  38. package/dist/adapters/ruby.d.ts +14 -0
  39. package/dist/adapters/ruby.d.ts.map +1 -0
  40. package/dist/adapters/ruby.js +86 -0
  41. package/dist/adapters/ruby.js.map +1 -0
  42. package/dist/adapters/rust.d.ts +14 -0
  43. package/dist/adapters/rust.d.ts.map +1 -0
  44. package/dist/adapters/rust.js +167 -0
  45. package/dist/adapters/rust.js.map +1 -0
  46. package/dist/detector.d.ts +20 -0
  47. package/dist/detector.d.ts.map +1 -0
  48. package/dist/detector.js +306 -0
  49. package/dist/detector.js.map +1 -0
  50. package/dist/environment.d.ts +18 -0
  51. package/dist/environment.d.ts.map +1 -0
  52. package/dist/environment.js +119 -0
  53. package/dist/environment.js.map +1 -0
  54. package/dist/index.d.ts +17 -0
  55. package/dist/index.d.ts.map +1 -0
  56. package/dist/index.js +33 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/registry.d.ts +25 -0
  59. package/dist/registry.d.ts.map +1 -0
  60. package/dist/registry.js +103 -0
  61. package/dist/registry.js.map +1 -0
  62. package/dist/runner.d.ts +23 -0
  63. package/dist/runner.d.ts.map +1 -0
  64. package/dist/runner.js +68 -0
  65. package/dist/runner.js.map +1 -0
  66. package/dist/types.d.ts +84 -0
  67. package/dist/types.d.ts.map +1 -0
  68. package/dist/types.js +3 -0
  69. package/dist/types.js.map +1 -0
  70. package/package.json +42 -3
package/README.md CHANGED
@@ -1,3 +1,41 @@
1
- # Temporary Holding Version
1
+ # @norescan/ecosystems
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > Universal polyglot runtime and toolchain intelligence across Node, Python, Rust, Go, Java, Docker.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@norescan/ecosystems.svg)](https://www.npmjs.com/package/@norescan/ecosystems)
6
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7
+ [![GitHub](https://img.shields.io/badge/GitHub-th3karn%2FNoReScan-brightgreen)](https://github.com/th3karn/NoReScan)
8
+
9
+ Part of the **[NoReScan](https://github.com/th3karn/NoReScan)** persistent codebase memory infrastructure for AI coding agents.
10
+
11
+ ---
12
+
13
+ ### Installation
14
+ ```bash
15
+ npm install @norescan/ecosystems
16
+ ```
17
+
18
+ ### Usage
19
+ ```typescript
20
+ import { EcosystemRegistry, EnvironmentProbe } from '@norescan/ecosystems';
21
+
22
+ const registry = new EcosystemRegistry();
23
+ const detected = await registry.discoverActive(process.cwd());
24
+ console.log('Active ecosystems:', detected.map(e => e.id));
25
+
26
+ const probe = new EnvironmentProbe();
27
+ const envSummary = await probe.probeAll();
28
+ console.log('Installed runtime tools:', envSummary);
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Part of NoReScan
34
+
35
+ This package is part of the **NoReScan monorepo**. Learn more at:
36
+ - **GitHub Repository**: [https://github.com/th3karn/NoReScan](https://github.com/th3karn/NoReScan)
37
+ - **Main CLI**: [`@norescan/cli`](https://www.npmjs.com/package/@norescan/cli)
38
+
39
+ ## License
40
+
41
+ Apache-2.0 © LostGit Solutions
@@ -0,0 +1,14 @@
1
+ import { EcosystemAdapter, SupportedLanguage, PackageDependency, ProjectCommand, WorkspaceMember } from '../types.js';
2
+ export declare class CppAdapter implements EcosystemAdapter {
3
+ readonly id = "native";
4
+ readonly displayName = "C & C++ (CMake / vcpkg / Conan / Make)";
5
+ readonly supportedLanguages: SupportedLanguage[];
6
+ readonly manifestFiles: string[];
7
+ readonly lockFiles: string[];
8
+ detect(projectRoot: string): Promise<boolean>;
9
+ extractDependencies(projectRoot: string): Promise<PackageDependency[]>;
10
+ extractCommands(projectRoot: string): Promise<ProjectCommand[]>;
11
+ detectWorkspaces(projectRoot: string): Promise<WorkspaceMember[]>;
12
+ suggestCommands(projectRoot: string): Promise<ProjectCommand[]>;
13
+ }
14
+ //# sourceMappingURL=cpp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpp.d.ts","sourceRoot":"","sources":["../../src/adapters/cpp.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,qBAAa,UAAW,YAAW,gBAAgB;IACjD,SAAgB,EAAE,YAAY;IAC9B,SAAgB,WAAW,4CAA4C;IACvE,SAAgB,kBAAkB,EAAE,iBAAiB,EAAE,CAAgB;IACvE,SAAgB,aAAa,WAAiE;IAC9F,SAAgB,SAAS,WAA8C;IAE1D,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAU7C,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IA6CtE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IA0E/D,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIjE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAG7E"}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CppAdapter = void 0;
7
+ const promises_1 = __importDefault(require("node:fs/promises"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ class CppAdapter {
10
+ id = 'native';
11
+ displayName = 'C & C++ (CMake / vcpkg / Conan / Make)';
12
+ supportedLanguages = ['c', 'cpp'];
13
+ manifestFiles = ['CMakeLists.txt', 'vcpkg.json', 'conanfile.txt', 'Makefile'];
14
+ lockFiles = ['vcpkg-configuration.json', 'conan.lock'];
15
+ async detect(projectRoot) {
16
+ for (const f of this.manifestFiles) {
17
+ try {
18
+ await promises_1.default.access(node_path_1.default.join(projectRoot, f));
19
+ return true;
20
+ }
21
+ catch { }
22
+ }
23
+ return false;
24
+ }
25
+ async extractDependencies(projectRoot) {
26
+ const deps = [];
27
+ // Check vcpkg.json
28
+ try {
29
+ const content = await promises_1.default.readFile(node_path_1.default.join(projectRoot, 'vcpkg.json'), 'utf8');
30
+ const parsed = JSON.parse(content);
31
+ const list = parsed.dependencies || [];
32
+ for (const item of list) {
33
+ const name = typeof item === 'string' ? item : item.name;
34
+ deps.push({
35
+ name,
36
+ declaredVersion: typeof item === 'object' && item.version ? item.version : 'latest',
37
+ versionConstraint: typeof item === 'object' && item.version ? item.version : '*',
38
+ dependencyType: 'production',
39
+ isDirect: true,
40
+ isOptional: false,
41
+ manifestPath: 'vcpkg.json',
42
+ registry: 'vcpkg',
43
+ });
44
+ }
45
+ }
46
+ catch { }
47
+ // Check CMakeLists.txt find_package calls
48
+ try {
49
+ const content = await promises_1.default.readFile(node_path_1.default.join(projectRoot, 'CMakeLists.txt'), 'utf8');
50
+ const fpRegex = /find_package\s*\(\s*([a-zA-Z0-9_\-]+)(?:\s+([0-9\.]+))?/g;
51
+ let match;
52
+ while ((match = fpRegex.exec(content)) !== null) {
53
+ deps.push({
54
+ name: match[1],
55
+ declaredVersion: match[2] || 'system',
56
+ versionConstraint: match[2] || '*',
57
+ dependencyType: 'build',
58
+ isDirect: true,
59
+ isOptional: false,
60
+ manifestPath: 'CMakeLists.txt',
61
+ registry: 'cmake-find-package',
62
+ });
63
+ }
64
+ }
65
+ catch { }
66
+ return deps;
67
+ }
68
+ async extractCommands(projectRoot) {
69
+ let hasCMake = false;
70
+ let hasMake = false;
71
+ try {
72
+ await promises_1.default.access(node_path_1.default.join(projectRoot, 'CMakeLists.txt'));
73
+ hasCMake = true;
74
+ }
75
+ catch { }
76
+ try {
77
+ await promises_1.default.access(node_path_1.default.join(projectRoot, 'Makefile'));
78
+ hasMake = true;
79
+ }
80
+ catch { }
81
+ const commands = [];
82
+ if (hasCMake) {
83
+ commands.push({
84
+ name: 'cmake-configure',
85
+ rawCommand: 'cmake -S . -B build',
86
+ category: 'setup',
87
+ sourceFile: 'CMakeLists.txt',
88
+ workingDir: '.',
89
+ description: 'Generate native build system files in build/ directory',
90
+ safeToRun: true,
91
+ requiresNetwork: false,
92
+ ecosystemId: this.id,
93
+ }, {
94
+ name: 'cmake-build',
95
+ rawCommand: 'cmake --build build',
96
+ category: 'build',
97
+ sourceFile: 'CMakeLists.txt',
98
+ workingDir: '.',
99
+ description: 'Compile native binary targets',
100
+ safeToRun: true,
101
+ requiresNetwork: false,
102
+ ecosystemId: this.id,
103
+ }, {
104
+ name: 'cmake-test',
105
+ rawCommand: 'ctest --test-dir build --output-on-failure',
106
+ category: 'test',
107
+ sourceFile: 'CMakeLists.txt',
108
+ workingDir: '.',
109
+ description: 'Execute CTest suite',
110
+ safeToRun: true,
111
+ requiresNetwork: false,
112
+ ecosystemId: this.id,
113
+ });
114
+ }
115
+ else if (hasMake) {
116
+ commands.push({
117
+ name: 'make-all',
118
+ rawCommand: 'make',
119
+ category: 'build',
120
+ sourceFile: 'Makefile',
121
+ workingDir: '.',
122
+ description: 'Build default targets defined in Makefile',
123
+ safeToRun: true,
124
+ requiresNetwork: false,
125
+ ecosystemId: this.id,
126
+ }, {
127
+ name: 'make-test',
128
+ rawCommand: 'make test',
129
+ category: 'test',
130
+ sourceFile: 'Makefile',
131
+ workingDir: '.',
132
+ description: 'Run test target in Makefile',
133
+ safeToRun: true,
134
+ requiresNetwork: false,
135
+ ecosystemId: this.id,
136
+ });
137
+ }
138
+ return commands;
139
+ }
140
+ async detectWorkspaces(projectRoot) {
141
+ return [];
142
+ }
143
+ async suggestCommands(projectRoot) {
144
+ return this.extractCommands(projectRoot);
145
+ }
146
+ }
147
+ exports.CppAdapter = CppAdapter;
148
+ //# sourceMappingURL=cpp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpp.js","sourceRoot":"","sources":["../../src/adapters/cpp.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAkC;AAClC,0DAA6B;AAS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AE,KAAK;gBACtB,WAAW,EAAE,IAAI,CAAC,EAAE;aACrB,CACF,CAAC;QACJ,CAAC;aAAM,IAAI,OAAO,EAAE,CAAC;YACnB,QAAQ,CAAC,IAAI,CACX;gBACE,IAAI,EAAE,UAAU;gBAChB,UAAU,EAAE,MAAM;gBAClB,QAAQ,EAAE,OAAO;gBACjB,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,GAAG;gBACf,WAAW,EAAE,2CAA2C;gBACxD,SAAS,EAAE,IAAI;gBACf,eAAe,EAAE,KAAK;gBACtB,WAAW,EAAE,IAAI,CAAC,EAAE;aACrB,EACD;gBACE,IAAI,EAAE,WAAW;gBACjB,UAAU,EAAE,WAAW;gBACvB,QAAQ,EAAE,MAAM;gBAChB,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,GAAG;gBACf,WAAW,EAAE,6BAA6B;gBAC1C,SAAS,EAAE,IAAI;gBACf,eAAe,EAAE,KAAK;gBACtB,WAAW,EAAE,IAAI,CAAC,EAAE;aACrB,CACF,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,WAAmB;QAC/C,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,WAAmB;QAC9C,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;CACF;AA/ID,gCA+IC"}
@@ -0,0 +1,14 @@
1
+ import { EcosystemAdapter, SupportedLanguage, PackageDependency, ProjectCommand, WorkspaceMember } from '../types.js';
2
+ export declare class DartAdapter implements EcosystemAdapter {
3
+ readonly id = "pub";
4
+ readonly displayName = "Dart & Flutter (pub / pubspec)";
5
+ readonly supportedLanguages: SupportedLanguage[];
6
+ readonly manifestFiles: string[];
7
+ readonly lockFiles: string[];
8
+ detect(projectRoot: string): Promise<boolean>;
9
+ extractDependencies(projectRoot: string): Promise<PackageDependency[]>;
10
+ extractCommands(projectRoot: string): Promise<ProjectCommand[]>;
11
+ detectWorkspaces(projectRoot: string): Promise<WorkspaceMember[]>;
12
+ suggestCommands(projectRoot: string): Promise<ProjectCommand[]>;
13
+ }
14
+ //# sourceMappingURL=dart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dart.d.ts","sourceRoot":"","sources":["../../src/adapters/dart.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,qBAAa,WAAY,YAAW,gBAAgB;IAClD,SAAgB,EAAE,SAAS;IAC3B,SAAgB,WAAW,oCAAoC;IAC/D,SAAgB,kBAAkB,EAAE,iBAAiB,EAAE,CAAuB;IAC9E,SAAgB,aAAa,WAAoB;IACjD,SAAgB,SAAS,WAAoB;IAEhC,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS7C,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAqCtE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAmC/D,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIjE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAG7E"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DartAdapter = void 0;
7
+ const promises_1 = __importDefault(require("node:fs/promises"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ class DartAdapter {
10
+ id = 'pub';
11
+ displayName = 'Dart & Flutter (pub / pubspec)';
12
+ supportedLanguages = ['dart', 'flutter'];
13
+ manifestFiles = ['pubspec.yaml'];
14
+ lockFiles = ['pubspec.lock'];
15
+ async detect(projectRoot) {
16
+ try {
17
+ await promises_1.default.access(node_path_1.default.join(projectRoot, 'pubspec.yaml'));
18
+ return true;
19
+ }
20
+ catch {
21
+ return false;
22
+ }
23
+ }
24
+ async extractDependencies(projectRoot) {
25
+ const deps = [];
26
+ const pubPath = node_path_1.default.join(projectRoot, 'pubspec.yaml');
27
+ try {
28
+ const content = await promises_1.default.readFile(pubPath, 'utf8');
29
+ const parseSection = (sectionName, type) => {
30
+ const regex = new RegExp(`^${sectionName}:([\\s\\S]*?)(^\\w|$)`, 'm');
31
+ const match = content.match(regex);
32
+ if (match) {
33
+ const lines = match[1].split('\n');
34
+ for (const l of lines) {
35
+ const m = l.match(/^\s+([a-zA-Z0-9_\-]+):\s*([^\s#]+)?/);
36
+ if (m && m[1] !== 'flutter' && m[1] !== 'sdk') {
37
+ deps.push({
38
+ name: m[1],
39
+ declaredVersion: m[2] || 'any',
40
+ versionConstraint: m[2] || 'any',
41
+ dependencyType: type,
42
+ isDirect: true,
43
+ isOptional: false,
44
+ manifestPath: 'pubspec.yaml',
45
+ registry: 'pub.dev',
46
+ });
47
+ }
48
+ }
49
+ }
50
+ };
51
+ parseSection('dependencies', 'production');
52
+ parseSection('dev_dependencies', 'development');
53
+ }
54
+ catch { }
55
+ return deps;
56
+ }
57
+ async extractCommands(projectRoot) {
58
+ let isFlutter = false;
59
+ try {
60
+ const content = await promises_1.default.readFile(node_path_1.default.join(projectRoot, 'pubspec.yaml'), 'utf8');
61
+ if (content.includes('flutter:'))
62
+ isFlutter = true;
63
+ }
64
+ catch { }
65
+ const cli = isFlutter ? 'flutter' : 'dart';
66
+ return [
67
+ {
68
+ name: `${cli}-get`,
69
+ rawCommand: `${cli} pub get`,
70
+ category: 'install',
71
+ sourceFile: 'pubspec.yaml',
72
+ workingDir: '.',
73
+ description: `Install package dependencies via ${cli}`,
74
+ safeToRun: true,
75
+ requiresNetwork: true,
76
+ ecosystemId: this.id,
77
+ },
78
+ {
79
+ name: `${cli}-test`,
80
+ rawCommand: `${cli} test`,
81
+ category: 'test',
82
+ sourceFile: 'pubspec.yaml',
83
+ workingDir: '.',
84
+ description: `Run unit and widget tests via ${cli}`,
85
+ safeToRun: true,
86
+ requiresNetwork: false,
87
+ ecosystemId: this.id,
88
+ },
89
+ ];
90
+ }
91
+ async detectWorkspaces(projectRoot) {
92
+ return [];
93
+ }
94
+ async suggestCommands(projectRoot) {
95
+ return this.extractCommands(projectRoot);
96
+ }
97
+ }
98
+ exports.DartAdapter = DartAdapter;
99
+ //# sourceMappingURL=dart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dart.js","sourceRoot":"","sources":["../../src/adapters/dart.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAkC;AAClC,0DAA6B;AAS7B,MAAa,WAAW;IACN,EAAE,GAAG,KAAK,CAAC;IACX,WAAW,GAAG,gCAAgC,CAAC;IAC/C,kBAAkB,GAAwB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC9D,aAAa,GAAG,CAAC,cAAc,CAAC,CAAC;IACjC,SAAS,GAAG,CAAC,cAAc,CAAC,CAAC;IAEtC,KAAK,CAAC,MAAM,CAAC,WAAmB;QACrC,IAAI,CAAC;YACH,MAAM,kBAAE,CAAC,MAAM,CAAC,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;YACxD,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAAC,WAAmB;QAClD,MAAM,IAAI,GAAwB,EAAE,CAAC;QACrC,MAAM,OAAO,GAAG,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAEvD,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,kBAAE,CAAC,QAAQ,CA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PackageDependency, ProjectCommand, WorkspaceMember } from '../types.js';
2
+ export declare class DotnetAdapter implements EcosystemAdapter {
3
+ readonly id = "dotnet";
4
+ readonly displayName = ".NET / C# (NuGet / dotnet CLI)";
5
+ readonly supportedLanguages: SupportedLanguage[];
6
+ readonly manifestFiles: string[];
7
+ readonly lockFiles: string[];
8
+ detect(projectRoot: string): Promise<boolean>;
9
+ extractDependencies(projectRoot: string): Promise<PackageDependency[]>;
10
+ extractCommands(projectRoot: string): Promise<ProjectCommand[]>;
11
+ detectWorkspaces(projectRoot: string): Promise<WorkspaceMember[]>;
12
+ suggestCommands(projectRoot: string): Promise<ProjectCommand[]>;
13
+ }
14
+ //# sourceMappingURL=dotnet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dotnet.d.ts","sourceRoot":"","sources":["../../src/adapters/dotnet.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,qBAAa,aAAc,YAAW,gBAAgB;IACpD,SAAgB,EAAE,YAAY;IAC9B,SAAgB,WAAW,oCAAoC;IAC/D,SAAgB,kBAAkB,EAAE,iBAAiB,EAAE,CAAc;IACrE,SAAgB,aAAa,WAA8D;IAC3F,SAAgB,SAAS,WAA0B;IAEtC,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK7C,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IA4BtE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAsC/D,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIjE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAG7E"}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DotnetAdapter = void 0;
7
+ const promises_1 = __importDefault(require("node:fs/promises"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ class DotnetAdapter {
10
+ id = 'dotnet';
11
+ displayName = '.NET / C# (NuGet / dotnet CLI)';
12
+ supportedLanguages = ['csharp'];
13
+ manifestFiles = ['*.csproj', '*.fsproj', '*.sln', 'Directory.Build.props'];
14
+ lockFiles = ['packages.lock.json'];
15
+ async detect(projectRoot) {
16
+ const files = await promises_1.default.readdir(projectRoot).catch(() => []);
17
+ return files.some((f) => f.endsWith('.csproj') || f.endsWith('.sln') || f.endsWith('.fsproj'));
18
+ }
19
+ async extractDependencies(projectRoot) {
20
+ const deps = [];
21
+ const files = await promises_1.default.readdir(projectRoot).catch(() => []);
22
+ const projFiles = files.filter((f) => f.endsWith('.csproj'));
23
+ for (const pf of projFiles) {
24
+ try {
25
+ const content = await promises_1.default.readFile(node_path_1.default.join(projectRoot, pf), 'utf8');
26
+ const refRegex = /<PackageReference\s+Include=["']([^"']+)["']\s+Version=["']([^"']+)["']/g;
27
+ let match;
28
+ while ((match = refRegex.exec(content)) !== null) {
29
+ deps.push({
30
+ name: match[1],
31
+ declaredVersion: match[2],
32
+ versionConstraint: match[2],
33
+ dependencyType: 'production',
34
+ isDirect: true,
35
+ isOptional: false,
36
+ manifestPath: pf,
37
+ registry: 'nuget.org',
38
+ });
39
+ }
40
+ }
41
+ catch { }
42
+ }
43
+ return deps;
44
+ }
45
+ async extractCommands(projectRoot) {
46
+ return [
47
+ {
48
+ name: 'dotnet-build',
49
+ rawCommand: 'dotnet build',
50
+ category: 'build',
51
+ sourceFile: '*.csproj',
52
+ workingDir: '.',
53
+ description: 'Build .NET project and dependencies',
54
+ safeToRun: true,
55
+ requiresNetwork: false,
56
+ ecosystemId: this.id,
57
+ },
58
+ {
59
+ name: 'dotnet-test',
60
+ rawCommand: 'dotnet test',
61
+ category: 'test',
62
+ sourceFile: '*.csproj',
63
+ workingDir: '.',
64
+ description: 'Execute unit tests using VSTest / xUnit / NUnit',
65
+ safeToRun: true,
66
+ requiresNetwork: false,
67
+ ecosystemId: this.id,
68
+ },
69
+ {
70
+ name: 'dotnet-restore',
71
+ rawCommand: 'dotnet restore',
72
+ category: 'install',
73
+ sourceFile: '*.csproj',
74
+ workingDir: '.',
75
+ description: 'Restore NuGet package dependencies',
76
+ safeToRun: true,
77
+ requiresNetwork: true,
78
+ ecosystemId: this.id,
79
+ },
80
+ ];
81
+ }
82
+ async detectWorkspaces(projectRoot) {
83
+ return [];
84
+ }
85
+ async suggestCommands(projectRoot) {
86
+ return this.extractCommands(projectRoot);
87
+ }
88
+ }
89
+ exports.DotnetAdapter = DotnetAdapter;
90
+ //# sourceMappingURL=dotnet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dotnet.js","sourceRoot":"","sources":["../../src/adapters/dotnet.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAkC;AAClC,0DAA6B;AAS7B,MAAa,aAAa;IACR,EAAE,GAAG,QAAQ,CAAC;IACd,WAAW,GAAG,gCAAgC,CAAC;IAC/C,kBAAkB,GAAwB,CAAC,QAAQ,CAAC,CAAC;IACrD,aAAa,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,uBAAuB,CAAC,CAAC;IAC3E,SAAS,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAE5C,KAAK,CAAC,MAAM,CAAC,WAAmB;QACrC,MAAM,KAAK,GAAG,MAAM,kBAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAC5D,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,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e,CAAC,WAAmB;QAC9C,OAAO;YACL;gBACE,IAAI,EAAE,cAAc;gBACpB,UAAU,EAAE,cAAc;gBAC1B,QAAQ,EAAE,OAAO;gBACjB,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,GAAG;gBACf,WAAW,EAAE,qCAAqC;gBAClD,SAAS,EAAE,IAAI;gBACf,eAAe,EAAE,KAAK;gBACtB,WAAW,EAAE,IAAI,CAAC,EAAE;aACrB;YACD;gBACE,IAAI,EAAE,aAAa;gBACnB,UAAU,EAAE,aAAa;gBACzB,QAAQ,EAAE,MAAM;gBAChB,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,GAAG;gBACf,WAAW,EAAE,iDAAiD;gBAC9D,SAAS,EAAE,IAAI;gBACf,eAAe,EAAE,KAAK;gBACtB,WAAW,EAAE,IAAI,CAAC,EAAE;aACrB;YACD;gBACE,IAAI,EAAE,gBAAgB;gBACtB,UAAU,EAAE,gBAAgB;gBAC5B,QAAQ,EAAE,SAAS;gBACnB,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,GAAG;gBACf,WAAW,EAAE,oCAAoC;gBACjD,SAAS,EAAE,IAAI;gBACf,eAAe,EAAE,IAAI;gBACrB,WAAW,EAAE,IAAI,CAAC,EAAE;aACrB;SACF,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,WAAmB;QAC/C,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,WAAmB;QAC9C,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;CACF;AArFD,sCAqFC"}
@@ -0,0 +1,14 @@
1
+ import { EcosystemAdapter, SupportedLanguage, PackageDependency, ProjectCommand, WorkspaceMember } from '../types.js';
2
+ export declare class GoAdapter implements EcosystemAdapter {
3
+ readonly id = "golang";
4
+ readonly displayName = "Go (Go Modules)";
5
+ readonly supportedLanguages: SupportedLanguage[];
6
+ readonly manifestFiles: string[];
7
+ readonly lockFiles: string[];
8
+ detect(projectRoot: string): Promise<boolean>;
9
+ extractDependencies(projectRoot: string): Promise<PackageDependency[]>;
10
+ extractCommands(projectRoot: string): Promise<ProjectCommand[]>;
11
+ detectWorkspaces(projectRoot: string): Promise<WorkspaceMember[]>;
12
+ suggestCommands(projectRoot: string): Promise<ProjectCommand[]>;
13
+ }
14
+ //# sourceMappingURL=golang.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"golang.d.ts","sourceRoot":"","sources":["../../src/adapters/golang.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,qBAAa,SAAU,YAAW,gBAAgB;IAChD,SAAgB,EAAE,YAAY;IAC9B,SAAgB,WAAW,qBAAqB;IAChD,SAAgB,kBAAkB,EAAE,iBAAiB,EAAE,CAAc;IACrE,SAAgB,aAAa,WAAyB;IACtD,SAAgB,SAAS,WAAc;IAE1B,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS7C,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IA6CtE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAiD/D,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAwBjE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAG7E"}
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.GoAdapter = void 0;
7
+ const promises_1 = __importDefault(require("node:fs/promises"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ class GoAdapter {
10
+ id = 'golang';
11
+ displayName = 'Go (Go Modules)';
12
+ supportedLanguages = ['golang'];
13
+ manifestFiles = ['go.mod', 'go.work'];
14
+ lockFiles = ['go.sum'];
15
+ async detect(projectRoot) {
16
+ try {
17
+ await promises_1.default.access(node_path_1.default.join(projectRoot, 'go.mod'));
18
+ return true;
19
+ }
20
+ catch {
21
+ return false;
22
+ }
23
+ }
24
+ async extractDependencies(projectRoot) {
25
+ const deps = [];
26
+ const modPath = node_path_1.default.join(projectRoot, 'go.mod');
27
+ try {
28
+ const content = await promises_1.default.readFile(modPath, 'utf8');
29
+ const lines = content.split('\n');
30
+ let inRequireBlock = false;
31
+ for (const line of lines) {
32
+ const trimmed = line.trim();
33
+ if (trimmed.startsWith('require (')) {
34
+ inRequireBlock = true;
35
+ continue;
36
+ }
37
+ if (inRequireBlock && trimmed === ')') {
38
+ inRequireBlock = false;
39
+ continue;
40
+ }
41
+ if (inRequireBlock || trimmed.startsWith('require ')) {
42
+ const cleanLine = trimmed.replace(/^require\s+/, '');
43
+ const parts = cleanLine.split(/\s+/);
44
+ if (parts.length >= 2) {
45
+ const name = parts[0];
46
+ const version = parts[1];
47
+ const isIndirect = cleanLine.includes('// indirect');
48
+ deps.push({
49
+ name,
50
+ declaredVersion: version,
51
+ versionConstraint: version,
52
+ dependencyType: 'production',
53
+ isDirect: !isIndirect,
54
+ isOptional: false,
55
+ manifestPath: 'go.mod',
56
+ registry: 'proxy.golang.org',
57
+ });
58
+ }
59
+ }
60
+ }
61
+ }
62
+ catch { }
63
+ return deps;
64
+ }
65
+ async extractCommands(projectRoot) {
66
+ return [
67
+ {
68
+ name: 'go-build',
69
+ rawCommand: 'go build ./...',
70
+ category: 'build',
71
+ sourceFile: 'go.mod',
72
+ workingDir: '.',
73
+ description: 'Compile Go packages and dependencies',
74
+ safeToRun: true,
75
+ requiresNetwork: false,
76
+ ecosystemId: this.id,
77
+ },
78
+ {
79
+ name: 'go-test',
80
+ rawCommand: 'go test -v ./...',
81
+ category: 'test',
82
+ sourceFile: 'go.mod',
83
+ workingDir: '.',
84
+ description: 'Execute unit and integration tests across all packages',
85
+ safeToRun: true,
86
+ requiresNetwork: false,
87
+ ecosystemId: this.id,
88
+ },
89
+ {
90
+ name: 'go-vet',
91
+ rawCommand: 'go vet ./...',
92
+ category: 'lint',
93
+ sourceFile: 'go.mod',
94
+ workingDir: '.',
95
+ description: 'Examine Go source code and report suspicious constructs',
96
+ safeToRun: true,
97
+ requiresNetwork: false,
98
+ ecosystemId: this.id,
99
+ },
100
+ {
101
+ name: 'go-tidy',
102
+ rawCommand: 'go mod tidy',
103
+ category: 'cleanup',
104
+ sourceFile: 'go.mod',
105
+ workingDir: '.',
106
+ description: 'Add missing and remove unused modules',
107
+ safeToRun: true,
108
+ requiresNetwork: true,
109
+ ecosystemId: this.id,
110
+ },
111
+ ];
112
+ }
113
+ async detectWorkspaces(projectRoot) {
114
+ const members = [];
115
+ const workPath = node_path_1.default.join(projectRoot, 'go.work');
116
+ try {
117
+ const content = await promises_1.default.readFile(workPath, 'utf8');
118
+ const useMatch = content.match(/use\s*\(([\s\S]*?)\)/);
119
+ if (useMatch) {
120
+ const dirs = useMatch[1].split('\n').map((d) => d.trim()).filter((d) => d && !d.startsWith('//'));
121
+ for (const dir of dirs) {
122
+ members.push({
123
+ name: node_path_1.default.basename(dir),
124
+ relativePath: dir.replace(/\\/g, '/'),
125
+ ecosystemId: this.id,
126
+ manifestPath: node_path_1.default.join(dir, 'go.mod').replace(/\\/g, '/'),
127
+ dependencies: [],
128
+ });
129
+ }
130
+ }
131
+ }
132
+ catch { }
133
+ return members;
134
+ }
135
+ async suggestCommands(projectRoot) {
136
+ return this.extractCommands(projectRoot);
137
+ }
138
+ }
139
+ exports.GoAdapter = GoAdapter;
140
+ //# sourceMappingURL=golang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"golang.js","sourceRoot":"","sources":["../../src/adapters/golang.ts"],"names":[],"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C,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;gBAClG,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;oBACvB,OAAO,CAAC,IAAI,CAAC;wBACX,IAAI,EAAE,mBAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;wBACxB,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;wBACrC,WAAW,EAAE,IAAI,CAAC,EAAE;wBACpB,YAAY,EAAE,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;wBAC1D,YAAY,EAAE,EAAE;qBACjB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QAEV,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,WAAmB;QAC9C,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;CACF;AAzID,8BAyIC"}
@@ -0,0 +1,14 @@
1
+ import { EcosystemAdapter, SupportedLanguage, PackageDependency, ProjectCommand, WorkspaceMember } from '../types.js';
2
+ export declare class JavaAdapter implements EcosystemAdapter {
3
+ readonly id = "jvm";
4
+ readonly displayName = "Java & Kotlin (Maven / Gradle)";
5
+ readonly supportedLanguages: SupportedLanguage[];
6
+ readonly manifestFiles: string[];
7
+ readonly lockFiles: string[];
8
+ detect(projectRoot: string): Promise<boolean>;
9
+ extractDependencies(projectRoot: string): Promise<PackageDependency[]>;
10
+ extractCommands(projectRoot: string): Promise<ProjectCommand[]>;
11
+ detectWorkspaces(projectRoot: string): Promise<WorkspaceMember[]>;
12
+ suggestCommands(projectRoot: string): Promise<ProjectCommand[]>;
13
+ }
14
+ //# sourceMappingURL=java.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"java.d.ts","sourceRoot":"","sources":["../../src/adapters/java.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,qBAAa,WAAY,YAAW,gBAAgB;IAClD,SAAgB,EAAE,SAAS;IAC3B,SAAgB,WAAW,oCAAoC;IAC/D,SAAgB,kBAAkB,EAAE,iBAAiB,EAAE,CAAsB;IAC7E,SAAgB,aAAa,WAA6F;IAC1H,SAAgB,SAAS,WAAuB;IAEnC,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAU7C,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAyDtE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAoF/D,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIjE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAG7E"}