@principal-ai/codebase-composition 0.2.24 → 0.2.27

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 (43) hide show
  1. package/dist/helpers/QualityMetricsCalculator.d.ts +26 -7
  2. package/dist/helpers/QualityMetricsCalculator.d.ts.map +1 -1
  3. package/dist/helpers/QualityMetricsCalculator.js +129 -131
  4. package/dist/helpers/QualityMetricsCalculator.js.map +1 -1
  5. package/dist/helpers/WorkspaceCommandHelper.d.ts +140 -0
  6. package/dist/helpers/WorkspaceCommandHelper.d.ts.map +1 -0
  7. package/dist/helpers/WorkspaceCommandHelper.js +298 -0
  8. package/dist/helpers/WorkspaceCommandHelper.js.map +1 -0
  9. package/dist/helpers/packageLayerHelpers.d.ts.map +1 -1
  10. package/dist/helpers/packageLayerHelpers.js +50 -24
  11. package/dist/helpers/packageLayerHelpers.js.map +1 -1
  12. package/dist/index.d.ts +5 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +3 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/modules/PackageLayerModule.d.ts.map +1 -1
  17. package/dist/modules/PackageLayerModule.js +169 -3
  18. package/dist/modules/PackageLayerModule.js.map +1 -1
  19. package/dist/strategies/go-tools.d.ts +27 -0
  20. package/dist/strategies/go-tools.d.ts.map +1 -0
  21. package/dist/strategies/go-tools.js +185 -0
  22. package/dist/strategies/go-tools.js.map +1 -0
  23. package/dist/strategies/index.d.ts +37 -0
  24. package/dist/strategies/index.d.ts.map +1 -0
  25. package/dist/strategies/index.js +73 -0
  26. package/dist/strategies/index.js.map +1 -0
  27. package/dist/strategies/node-tools.d.ts +21 -0
  28. package/dist/strategies/node-tools.d.ts.map +1 -0
  29. package/dist/strategies/node-tools.js +142 -0
  30. package/dist/strategies/node-tools.js.map +1 -0
  31. package/dist/strategies/python-tools.d.ts +25 -0
  32. package/dist/strategies/python-tools.d.ts.map +1 -0
  33. package/dist/strategies/python-tools.js +192 -0
  34. package/dist/strategies/python-tools.js.map +1 -0
  35. package/dist/strategies/rust-tools.d.ts +23 -0
  36. package/dist/strategies/rust-tools.d.ts.map +1 -0
  37. package/dist/strategies/rust-tools.js +177 -0
  38. package/dist/strategies/rust-tools.js.map +1 -0
  39. package/dist/strategies/tool-detection.d.ts +137 -0
  40. package/dist/strategies/tool-detection.d.ts.map +1 -0
  41. package/dist/strategies/tool-detection.js +13 -0
  42. package/dist/strategies/tool-detection.js.map +1 -0
  43. package/package.json +2 -1
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Tool Detection Strategies
3
+ *
4
+ * This module provides ecosystem-specific tool detection for:
5
+ * - Node.js/npm
6
+ * - Python (pip, poetry, uv)
7
+ * - Go
8
+ * - Rust (cargo, rustup)
9
+ *
10
+ * Each strategy knows how to:
11
+ * - Detect if a tool is available in a package
12
+ * - Generate appropriate install instructions
13
+ * - Provide default commands to run tools
14
+ */
15
+ export * from './tool-detection';
16
+ export { NodeToolDetection, nodeToolDetection } from './node-tools';
17
+ export { PythonToolDetection, pythonToolDetection } from './python-tools';
18
+ export { GoToolDetection, goToolDetection } from './go-tools';
19
+ export { RustToolDetection, rustToolDetection } from './rust-tools';
20
+ import type { Ecosystem, ToolDetectionStrategy } from './tool-detection';
21
+ /**
22
+ * Get the tool detection strategy for an ecosystem
23
+ */
24
+ export declare function getToolDetectionStrategy(ecosystem: Ecosystem): ToolDetectionStrategy;
25
+ /**
26
+ * Get all registered tool detection strategies
27
+ */
28
+ export declare function getAllStrategies(): ToolDetectionStrategy[];
29
+ /**
30
+ * Check if an ecosystem is supported
31
+ */
32
+ export declare function isEcosystemSupported(ecosystem: string): ecosystem is Ecosystem;
33
+ /**
34
+ * Map package layer types to ecosystems
35
+ */
36
+ export declare function packageTypeToEcosystem(packageType: 'package' | 'node' | 'python' | 'cargo' | 'go'): Ecosystem;
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/strategies/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAgBzE;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,GAAG,qBAAqB,CAMpF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,EAAE,CAE1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,IAAI,SAAS,CAE9E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,GAC1D,SAAS,CAcX"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Tool Detection Strategies
3
+ *
4
+ * This module provides ecosystem-specific tool detection for:
5
+ * - Node.js/npm
6
+ * - Python (pip, poetry, uv)
7
+ * - Go
8
+ * - Rust (cargo, rustup)
9
+ *
10
+ * Each strategy knows how to:
11
+ * - Detect if a tool is available in a package
12
+ * - Generate appropriate install instructions
13
+ * - Provide default commands to run tools
14
+ */
15
+ export * from './tool-detection.js';
16
+ export { NodeToolDetection, nodeToolDetection } from './node-tools.js';
17
+ export { PythonToolDetection, pythonToolDetection } from './python-tools.js';
18
+ export { GoToolDetection, goToolDetection } from './go-tools.js';
19
+ export { RustToolDetection, rustToolDetection } from './rust-tools.js';
20
+ import { nodeToolDetection } from './node-tools.js';
21
+ import { pythonToolDetection } from './python-tools.js';
22
+ import { goToolDetection } from './go-tools.js';
23
+ import { rustToolDetection } from './rust-tools.js';
24
+ /**
25
+ * Registry of all available tool detection strategies
26
+ */
27
+ const strategyRegistry = {
28
+ node: nodeToolDetection,
29
+ python: pythonToolDetection,
30
+ go: goToolDetection,
31
+ rust: rustToolDetection,
32
+ };
33
+ /**
34
+ * Get the tool detection strategy for an ecosystem
35
+ */
36
+ export function getToolDetectionStrategy(ecosystem) {
37
+ const strategy = strategyRegistry[ecosystem];
38
+ if (!strategy) {
39
+ throw new Error(`No tool detection strategy found for ecosystem: ${ecosystem}`);
40
+ }
41
+ return strategy;
42
+ }
43
+ /**
44
+ * Get all registered tool detection strategies
45
+ */
46
+ export function getAllStrategies() {
47
+ return Object.values(strategyRegistry);
48
+ }
49
+ /**
50
+ * Check if an ecosystem is supported
51
+ */
52
+ export function isEcosystemSupported(ecosystem) {
53
+ return ecosystem in strategyRegistry;
54
+ }
55
+ /**
56
+ * Map package layer types to ecosystems
57
+ */
58
+ export function packageTypeToEcosystem(packageType) {
59
+ switch (packageType) {
60
+ case 'node':
61
+ case 'package':
62
+ return 'node';
63
+ case 'python':
64
+ return 'python';
65
+ case 'cargo':
66
+ return 'rust';
67
+ case 'go':
68
+ return 'go';
69
+ default:
70
+ return 'node'; // Default to node for unknown types
71
+ }
72
+ }
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/strategies/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,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 @@
1
+ /**
2
+ * Node.js/npm Tool Detection Strategy
3
+ *
4
+ * Handles detection for the Node.js ecosystem:
5
+ * - Tools are installed as devDependencies in package.json
6
+ * - Scripts are defined in package.json "scripts" field
7
+ * - Config files are standalone or inline in package.json
8
+ */
9
+ import type { ConfigFile } from '../types/layer-types';
10
+ import type { ToolDetectionStrategy, PackageData, ToolAvailability, InstallInstruction } from './tool-detection';
11
+ export declare class NodeToolDetection implements ToolDetectionStrategy {
12
+ ecosystem: "node";
13
+ displayName: string;
14
+ detectToolAvailability(toolId: string, packageData: PackageData, configFiles: Record<string, ConfigFile | undefined>): ToolAvailability;
15
+ getInstallInstructions(toolId: string, packageManager?: string): InstallInstruction;
16
+ getDefaultCommand(toolId: string): string;
17
+ isToolchainTool(_toolId: string): boolean;
18
+ getToolIdFromPackage(packageName: string): string[];
19
+ }
20
+ export declare const nodeToolDetection: NodeToolDetection;
21
+ //# sourceMappingURL=node-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-tools.d.ts","sourceRoot":"","sources":["../../src/strategies/node-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AAsF1B,qBAAa,iBAAkB,YAAW,qBAAqB;IAC7D,SAAS,EAAG,MAAM,CAAU;IAC5B,WAAW,SAAa;IAExB,sBAAsB,CACpB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC,GAClD,gBAAgB;IA2BnB,sBAAsB,CACpB,MAAM,EAAE,MAAM,EACd,cAAc,GAAE,MAAc,GAC7B,kBAAkB;IAkBrB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAKzC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAKzC,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE;CAGpD;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Node.js/npm Tool Detection Strategy
3
+ *
4
+ * Handles detection for the Node.js ecosystem:
5
+ * - Tools are installed as devDependencies in package.json
6
+ * - Scripts are defined in package.json "scripts" field
7
+ * - Config files are standalone or inline in package.json
8
+ */
9
+ import { getLensDisplayName } from '@principal-ai/quality-lens-registry';
10
+ /**
11
+ * Tool metadata for Node.js ecosystem
12
+ */
13
+ const NODE_TOOLS = {
14
+ eslint: {
15
+ toolId: 'eslint',
16
+ displayName: getLensDisplayName('eslint'),
17
+ packageName: 'eslint',
18
+ configPatterns: ['eslint.config.js', 'eslint.config.mjs', 'eslint.config.cjs', '.eslintrc.*'],
19
+ defaultCommand: 'eslint .',
20
+ minVersion: '9.0.0',
21
+ },
22
+ typescript: {
23
+ toolId: 'typescript',
24
+ displayName: getLensDisplayName('typescript'),
25
+ packageName: 'typescript',
26
+ configPatterns: ['tsconfig.json', 'tsconfig.*.json'],
27
+ defaultCommand: 'tsc --noEmit',
28
+ minVersion: '5.0.0',
29
+ },
30
+ prettier: {
31
+ toolId: 'prettier',
32
+ displayName: getLensDisplayName('prettier'),
33
+ packageName: 'prettier',
34
+ configPatterns: ['.prettierrc', '.prettierrc.*', 'prettier.config.*'],
35
+ defaultCommand: 'prettier --check .',
36
+ minVersion: '3.0.0',
37
+ },
38
+ jest: {
39
+ toolId: 'jest',
40
+ displayName: getLensDisplayName('jest'),
41
+ packageName: 'jest',
42
+ configPatterns: ['jest.config.*'],
43
+ defaultCommand: 'jest',
44
+ minVersion: '29.0.0',
45
+ },
46
+ vitest: {
47
+ toolId: 'vitest',
48
+ displayName: getLensDisplayName('vitest'),
49
+ packageName: 'vitest',
50
+ configPatterns: ['vitest.config.*', 'vite.config.*'],
51
+ defaultCommand: 'vitest run',
52
+ minVersion: '1.0.0',
53
+ },
54
+ 'bun-test': {
55
+ toolId: 'bun-test',
56
+ displayName: getLensDisplayName('bun-test'),
57
+ packageName: 'bun', // Part of bun itself
58
+ configPatterns: ['bunfig.toml'],
59
+ defaultCommand: 'bun test',
60
+ },
61
+ knip: {
62
+ toolId: 'knip',
63
+ displayName: getLensDisplayName('knip'),
64
+ packageName: 'knip',
65
+ configPatterns: ['knip.json', 'knip.jsonc', 'knip.ts', 'knip.config.ts'],
66
+ defaultCommand: 'knip',
67
+ minVersion: '5.0.0',
68
+ },
69
+ biome: {
70
+ toolId: 'biome',
71
+ displayName: getLensDisplayName('biome-lint'),
72
+ packageName: '@biomejs/biome',
73
+ configPatterns: ['biome.json', 'biome.jsonc'],
74
+ defaultCommand: 'biome check .',
75
+ minVersion: '1.0.0',
76
+ },
77
+ };
78
+ /**
79
+ * Package name to tool ID mapping (for when package name differs)
80
+ */
81
+ const PACKAGE_TO_TOOL = {
82
+ '@biomejs/biome': ['biome', 'biome-lint', 'biome-format'],
83
+ 'typescript': ['typescript'],
84
+ 'eslint': ['eslint'],
85
+ 'prettier': ['prettier'],
86
+ 'jest': ['jest'],
87
+ 'vitest': ['vitest'],
88
+ 'knip': ['knip'],
89
+ 'bun': ['bun-test'],
90
+ };
91
+ export class NodeToolDetection {
92
+ ecosystem = 'node';
93
+ displayName = 'Node.js';
94
+ detectToolAvailability(toolId, packageData, configFiles) {
95
+ const tool = NODE_TOOLS[toolId];
96
+ // Check if package is in dependencies
97
+ const allDeps = { ...packageData.dependencies, ...packageData.devDependencies };
98
+ const packageName = tool?.packageName ?? toolId;
99
+ const version = allDeps[packageName];
100
+ const installed = !!version;
101
+ // Check if config exists
102
+ const configFile = configFiles[toolId];
103
+ const configured = configFile?.exists ?? false;
104
+ // Check if there's a script to run this tool
105
+ const hasRunCommand = packageData.commands.some(cmd => cmd.lensId === toolId || cmd.name === toolId);
106
+ return {
107
+ installed,
108
+ configured,
109
+ hasRunCommand,
110
+ source: 'dependency',
111
+ version,
112
+ };
113
+ }
114
+ getInstallInstructions(toolId, packageManager = 'npm') {
115
+ const tool = NODE_TOOLS[toolId];
116
+ const packageName = tool?.packageName ?? toolId;
117
+ const version = tool?.minVersion ? `@${tool.minVersion}` : '';
118
+ const commands = {
119
+ npm: `npm install -D ${packageName}${version}`,
120
+ yarn: `yarn add -D ${packageName}${version}`,
121
+ pnpm: `pnpm add -D ${packageName}${version}`,
122
+ bun: `bun add -d ${packageName}${version}`,
123
+ };
124
+ return {
125
+ command: commands[packageManager] ?? commands.npm,
126
+ alternatives: commands,
127
+ };
128
+ }
129
+ getDefaultCommand(toolId) {
130
+ const tool = NODE_TOOLS[toolId];
131
+ return tool?.defaultCommand ?? toolId;
132
+ }
133
+ isToolchainTool(_toolId) {
134
+ // Node doesn't have built-in toolchain tools like Go or Rust
135
+ return false;
136
+ }
137
+ getToolIdFromPackage(packageName) {
138
+ return PACKAGE_TO_TOOL[packageName] ?? [packageName];
139
+ }
140
+ }
141
+ export const nodeToolDetection = new NodeToolDetection();
142
+ //# sourceMappingURL=node-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-tools.js","sourceRoot":"","sources":["../../src/strategies/node-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;GAEG;AACH,MAAM,UAAU,GAAiC;IAC/C,MAAM,EAAE;QACN,MAAM,EAAE,QAAQ;QAChB,WAAW,EAAE,kBAAkB,CAAC,QAAQ,CAAE;QAC1C,WAAW,EAAE,QAAQ;QACrB,cAAc,EAAE,CAAC,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,aAAa,CAAC;QAC7F,cAAc,EAAE,UAAU;QAC1B,UAAU,EAAE,OAAO;KACpB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;QACpB,WAAW,EAAE,kBAAkB,CAAC,YAAY,C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AiB,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Python Tool Detection Strategy
3
+ *
4
+ * Handles detection for the Python ecosystem:
5
+ * - Tools can be in various dependency locations:
6
+ * - [tool.poetry.dev-dependencies] (Poetry)
7
+ * - [project.optional-dependencies] (PEP 621)
8
+ * - [tool.uv.dev-dependencies] (uv)
9
+ * - [dependency-groups] (PEP 735)
10
+ * - No standard script system (often uses Makefile or just CLI tools)
11
+ * - Config in pyproject.toml [tool.*] sections or standalone files
12
+ */
13
+ import type { ConfigFile } from '../types/layer-types';
14
+ import type { ToolDetectionStrategy, PackageData, ToolAvailability, InstallInstruction } from './tool-detection';
15
+ export declare class PythonToolDetection implements ToolDetectionStrategy {
16
+ ecosystem: "python";
17
+ displayName: string;
18
+ detectToolAvailability(toolId: string, packageData: PackageData, configFiles: Record<string, ConfigFile | undefined>): ToolAvailability;
19
+ getInstallInstructions(toolId: string, packageManager?: string): InstallInstruction;
20
+ getDefaultCommand(toolId: string): string;
21
+ isToolchainTool(_toolId: string): boolean;
22
+ getToolIdFromPackage(packageName: string): string[];
23
+ }
24
+ export declare const pythonToolDetection: PythonToolDetection;
25
+ //# sourceMappingURL=python-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-tools.d.ts","sourceRoot":"","sources":["../../src/strategies/python-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AA2G1B,qBAAa,mBAAoB,YAAW,qBAAqB;IAC/D,SAAS,EAAG,QAAQ,CAAU;IAC9B,WAAW,SAAY;IAEvB,sBAAsB,CACpB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC,GAClD,gBAAgB;IAqDnB,sBAAsB,CACpB,MAAM,EAAE,MAAM,EACd,cAAc,GAAE,MAAc,GAC7B,kBAAkB;IAkBrB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAKzC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAMzC,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE;CAGpD;AAED,eAAO,MAAM,mBAAmB,qBAA4B,CAAC"}
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Python Tool Detection Strategy
3
+ *
4
+ * Handles detection for the Python ecosystem:
5
+ * - Tools can be in various dependency locations:
6
+ * - [tool.poetry.dev-dependencies] (Poetry)
7
+ * - [project.optional-dependencies] (PEP 621)
8
+ * - [tool.uv.dev-dependencies] (uv)
9
+ * - [dependency-groups] (PEP 735)
10
+ * - No standard script system (often uses Makefile or just CLI tools)
11
+ * - Config in pyproject.toml [tool.*] sections or standalone files
12
+ */
13
+ import { getLensDisplayName } from '@principal-ai/quality-lens-registry';
14
+ /**
15
+ * Tool metadata for Python ecosystem
16
+ */
17
+ const PYTHON_TOOLS = {
18
+ ruff: {
19
+ toolId: 'ruff',
20
+ displayName: getLensDisplayName('ruff'),
21
+ packageName: 'ruff',
22
+ configPatterns: ['ruff.toml', '.ruff.toml'],
23
+ configAlternatives: ['pyproject.toml [tool.ruff]'],
24
+ defaultCommand: 'ruff check .',
25
+ minVersion: '0.8.0',
26
+ },
27
+ 'ruff-format': {
28
+ toolId: 'ruff-format',
29
+ displayName: getLensDisplayName('ruff-format'),
30
+ packageName: 'ruff',
31
+ configPatterns: ['ruff.toml', '.ruff.toml'],
32
+ configAlternatives: ['pyproject.toml [tool.ruff]'],
33
+ defaultCommand: 'ruff format .',
34
+ minVersion: '0.8.0',
35
+ },
36
+ mypy: {
37
+ toolId: 'mypy',
38
+ displayName: getLensDisplayName('mypy'),
39
+ packageName: 'mypy',
40
+ configPatterns: ['mypy.ini', '.mypy.ini'],
41
+ configAlternatives: ['pyproject.toml [tool.mypy]', 'setup.cfg [mypy]'],
42
+ defaultCommand: 'mypy .',
43
+ minVersion: '1.0.0',
44
+ },
45
+ pyright: {
46
+ toolId: 'pyright',
47
+ displayName: getLensDisplayName('pyright'),
48
+ packageName: 'pyright',
49
+ configPatterns: ['pyrightconfig.json'],
50
+ configAlternatives: ['pyproject.toml [tool.pyright]'],
51
+ defaultCommand: 'pyright',
52
+ minVersion: '1.1.0',
53
+ },
54
+ pytest: {
55
+ toolId: 'pytest',
56
+ displayName: getLensDisplayName('pytest'),
57
+ packageName: 'pytest',
58
+ configPatterns: ['pytest.ini', 'conftest.py'],
59
+ configAlternatives: ['pyproject.toml [tool.pytest]', 'setup.cfg [tool:pytest]'],
60
+ defaultCommand: 'pytest',
61
+ minVersion: '8.0.0',
62
+ },
63
+ black: {
64
+ toolId: 'black',
65
+ displayName: getLensDisplayName('black'),
66
+ packageName: 'black',
67
+ configPatterns: ['.black', 'black.toml'],
68
+ configAlternatives: ['pyproject.toml [tool.black]'],
69
+ defaultCommand: 'black --check .',
70
+ minVersion: '24.0.0',
71
+ },
72
+ isort: {
73
+ toolId: 'isort',
74
+ displayName: 'isort', // Not in registry yet
75
+ packageName: 'isort',
76
+ configPatterns: ['.isort.cfg', 'isort.cfg'],
77
+ configAlternatives: ['pyproject.toml [tool.isort]', 'setup.cfg [isort]'],
78
+ defaultCommand: 'isort --check .',
79
+ minVersion: '5.0.0',
80
+ },
81
+ flake8: {
82
+ toolId: 'flake8',
83
+ displayName: 'Flake8', // Not in registry yet
84
+ packageName: 'flake8',
85
+ configPatterns: ['.flake8', 'flake8.ini'],
86
+ configAlternatives: ['setup.cfg [flake8]'],
87
+ defaultCommand: 'flake8 .',
88
+ },
89
+ pylint: {
90
+ toolId: 'pylint',
91
+ displayName: getLensDisplayName('pylint'),
92
+ packageName: 'pylint',
93
+ configPatterns: ['.pylintrc', 'pylintrc', 'pylint.toml'],
94
+ configAlternatives: ['pyproject.toml [tool.pylint]'],
95
+ defaultCommand: 'pylint .',
96
+ },
97
+ };
98
+ /**
99
+ * Package name to tool ID mapping
100
+ */
101
+ const PACKAGE_TO_TOOL = {
102
+ ruff: ['ruff', 'ruff-format'],
103
+ mypy: ['mypy'],
104
+ pyright: ['pyright'],
105
+ pytest: ['pytest'],
106
+ black: ['black'],
107
+ isort: ['isort'],
108
+ flake8: ['flake8'],
109
+ pylint: ['pylint'],
110
+ };
111
+ /**
112
+ * Common dev dependency group names in Python projects
113
+ */
114
+ const DEV_GROUP_NAMES = ['dev', 'development', 'test', 'testing', 'lint', 'linting', 'dev-dependencies'];
115
+ export class PythonToolDetection {
116
+ ecosystem = 'python';
117
+ displayName = 'Python';
118
+ detectToolAvailability(toolId, packageData, configFiles) {
119
+ const tool = PYTHON_TOOLS[toolId];
120
+ const packageName = tool?.packageName ?? toolId;
121
+ // Check all possible dependency locations
122
+ let installed = false;
123
+ let version;
124
+ let source = 'dependency';
125
+ // Check main dependencies
126
+ if (packageData.dependencies[packageName]) {
127
+ installed = true;
128
+ version = packageData.dependencies[packageName];
129
+ }
130
+ // Check dev dependencies (populated by Poetry dev-dependencies)
131
+ if (!installed && packageData.devDependencies[packageName]) {
132
+ installed = true;
133
+ version = packageData.devDependencies[packageName];
134
+ source = 'dev-group';
135
+ }
136
+ // Check dependency groups (PEP 621 optional-dependencies, uv dev-dependencies)
137
+ if (!installed && packageData.dependencyGroups) {
138
+ for (const groupName of DEV_GROUP_NAMES) {
139
+ const group = packageData.dependencyGroups[groupName];
140
+ if (group && group[packageName]) {
141
+ installed = true;
142
+ version = group[packageName];
143
+ source = 'dev-group';
144
+ break;
145
+ }
146
+ }
147
+ }
148
+ // Check if config exists
149
+ const configFile = configFiles[toolId];
150
+ const configured = configFile?.exists ?? false;
151
+ // Python tools typically don't need explicit scripts - they're just CLI commands
152
+ // If installed, they can be run directly
153
+ const hasRunCommand = installed;
154
+ return {
155
+ installed,
156
+ configured,
157
+ hasRunCommand,
158
+ source,
159
+ version,
160
+ details: source === 'dev-group' ? 'Found in dev dependency group' : undefined,
161
+ };
162
+ }
163
+ getInstallInstructions(toolId, packageManager = 'pip') {
164
+ const tool = PYTHON_TOOLS[toolId];
165
+ const packageName = tool?.packageName ?? toolId;
166
+ const commands = {
167
+ pip: `pip install ${packageName}`,
168
+ uv: `uv add --dev ${packageName}`,
169
+ poetry: `poetry add --group dev ${packageName}`,
170
+ pipenv: `pipenv install --dev ${packageName}`,
171
+ };
172
+ return {
173
+ command: commands[packageManager] ?? commands.pip,
174
+ alternatives: commands,
175
+ notes: 'Install in your virtual environment or use a tool like uv for isolated installs',
176
+ };
177
+ }
178
+ getDefaultCommand(toolId) {
179
+ const tool = PYTHON_TOOLS[toolId];
180
+ return tool?.defaultCommand ?? toolId;
181
+ }
182
+ isToolchainTool(_toolId) {
183
+ // Python doesn't have built-in quality tools like Go or Rust
184
+ // (unless you count the ast module, but that's not a standalone tool)
185
+ return false;
186
+ }
187
+ getToolIdFromPackage(packageName) {
188
+ return PACKAGE_TO_TOOL[packageName] ?? [packageName];
189
+ }
190
+ }
191
+ export const pythonToolDetection = new PythonToolDetection();
192
+ //# sourceMappingURL=python-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-tools.js","sourceRoot":"","sources":["../../src/strategies/python-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;GAEG;AACH,MAAM,YAAY,GAAiC;IACjD,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,WAAW,EAAE,kBAAkB,CAAC,MAAM,CAAE;QACxC,WAAW,EAAE,MAAM;QACnB,cAAc,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;QAC3C,kBAAkB,EAAE,CAAC,4BAA4B,CAAC;QAClD,cAAc,EAAE,cAAc;QAC9B,UAAU,EAAE,OAAO;KACpB;IACD,a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IACvD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Rust Tool Detection Strategy
3
+ *
4
+ * Handles detection for the Rust ecosystem:
5
+ * - clippy and rustfmt are rustup components (part of toolchain)
6
+ * - cargo test is built into Cargo
7
+ * - Some tools are cargo-installed binaries (cargo-nextest, cargo-llvm-cov)
8
+ * - Some are dev-dependencies in Cargo.toml [dev-dependencies]
9
+ * - Config in rustfmt.toml, clippy.toml, or Cargo.toml sections
10
+ */
11
+ import type { ConfigFile } from '../types/layer-types';
12
+ import type { ToolDetectionStrategy, PackageData, ToolAvailability, InstallInstruction } from './tool-detection';
13
+ export declare class RustToolDetection implements ToolDetectionStrategy {
14
+ ecosystem: "rust";
15
+ displayName: string;
16
+ detectToolAvailability(toolId: string, packageData: PackageData, configFiles: Record<string, ConfigFile | undefined>): ToolAvailability;
17
+ getInstallInstructions(toolId: string, _packageManager?: string): InstallInstruction;
18
+ getDefaultCommand(toolId: string): string;
19
+ isToolchainTool(toolId: string): boolean;
20
+ getToolIdFromPackage(packageName: string): string[];
21
+ }
22
+ export declare const rustToolDetection: RustToolDetection;
23
+ //# sourceMappingURL=rust-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rust-tools.d.ts","sourceRoot":"","sources":["../../src/strategies/rust-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AA8E1B,qBAAa,iBAAkB,YAAW,qBAAqB;IAC7D,SAAS,EAAG,MAAM,CAAU;IAC5B,WAAW,SAAU;IAErB,sBAAsB,CACpB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC,GAClD,gBAAgB;IA0DnB,sBAAsB,CACpB,MAAM,EAAE,MAAM,EACd,eAAe,CAAC,EAAE,MAAM,GACvB,kBAAkB;IA4BrB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAKzC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIxC,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE;CASpD;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}