@nolrm/contextkit 0.7.3

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.
@@ -0,0 +1,137 @@
1
+ const fs = require('fs-extra');
2
+ const { execSync } = require('child_process');
3
+
4
+ class ToolDetector {
5
+ constructor() {
6
+ this.detectedTools = null;
7
+ }
8
+
9
+ /**
10
+ * Detect all available AI tools in the environment
11
+ * @returns {Promise<Object>} Object with detected tools and their status
12
+ */
13
+ async detectAll() {
14
+ if (this.detectedTools) {
15
+ return this.detectedTools;
16
+ }
17
+
18
+ this.detectedTools = {
19
+ // Editor integrations (check for directories/config files)
20
+ cursor: await this.detectCursor(),
21
+ continue: await this.detectContinue(),
22
+ aider: await this.detectAider(),
23
+ vscode: await this.detectVSCode(),
24
+ jetbrains: await this.detectJetBrains(),
25
+ windsurf: await this.detectWindsurf(),
26
+
27
+ // CLI tools (check if command exists in PATH)
28
+ aider_cli: await this.detectCLITool('aider'),
29
+ claude_cli: await this.detectCLITool('claude'),
30
+ gemini_cli: await this.detectCLITool('gemini'),
31
+ codex_cli: await this.detectCLITool('codex'),
32
+ };
33
+
34
+ return this.detectedTools;
35
+ }
36
+
37
+ /**
38
+ * Get summary of detected tools
39
+ */
40
+ getSummary() {
41
+ if (!this.detectedTools) return null;
42
+
43
+ const detected = Object.entries(this.detectedTools)
44
+ .filter(([_, isDetected]) => isDetected)
45
+ .map(([tool, _]) => tool);
46
+
47
+ const editors = detected.filter(t => ['cursor', 'continue', 'aider', 'vscode', 'jetbrains', 'windsurf'].includes(t));
48
+ const cli = detected.filter(t => t.endsWith('_cli'));
49
+
50
+ return {
51
+ all: detected,
52
+ editors,
53
+ cli,
54
+ count: detected.length
55
+ };
56
+ }
57
+
58
+ async detectCursor() {
59
+ // Check for Cursor in multiple locations
60
+ const paths = [
61
+ '.cursor/rules',
62
+ '.cursor',
63
+ `${process.env.HOME}/.cursor`,
64
+ ];
65
+
66
+ for (const path of paths) {
67
+ if (await fs.pathExists(path)) {
68
+ return true;
69
+ }
70
+ }
71
+ return false;
72
+ }
73
+
74
+ async detectContinue() {
75
+ return await fs.pathExists('.continue');
76
+ }
77
+
78
+ async detectAider() {
79
+ // Check if .aider directory exists or if aider is in PATH
80
+ return await fs.pathExists('.aider') || await this.detectCLITool('aider');
81
+ }
82
+
83
+ async detectVSCode() {
84
+ return await fs.pathExists('.vscode');
85
+ }
86
+
87
+ async detectJetBrains() {
88
+ return await fs.pathExists('.idea');
89
+ }
90
+
91
+ async detectWindsurf() {
92
+ return await fs.pathExists('.windsurf') || await fs.pathExists('.windsurfrules');
93
+ }
94
+
95
+ /**
96
+ * Detect if a CLI tool is available in PATH
97
+ */
98
+ async detectCLITool(toolName) {
99
+ try {
100
+ execSync(`which ${toolName}`, { stdio: 'ignore' });
101
+ return true;
102
+ } catch {
103
+ return false;
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Get recommended integration priority
109
+ */
110
+ getRecommendedOrder(detected) {
111
+ // Prioritize: Editors with good integration, then CLI tools
112
+ const priority = [
113
+ 'cursor', // Already fully supported
114
+ 'continue', // Great integration, multi-editor
115
+ 'aider', // Agentic, powerful
116
+ 'windsurf', // New, promising
117
+ 'vscode', // Widely used
118
+ 'jetbrains', // Enterprise
119
+ 'aider_cli', // CLI with auto-rules
120
+ 'claude_cli', // Good CLI
121
+ 'gemini_cli', // Alternative CLI
122
+ 'codex_cli', // OpenAI Codex CLI
123
+ ];
124
+
125
+ return priority.filter(tool => detected[tool]);
126
+ }
127
+
128
+ /**
129
+ * Check if specific tool is detected
130
+ */
131
+ async isDetected(toolName) {
132
+ const detected = await this.detectAll();
133
+ return detected[toolName] || false;
134
+ }
135
+ }
136
+
137
+ module.exports = ToolDetector;
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@nolrm/contextkit",
3
+ "version": "0.7.3",
4
+ "description": "ContextKit - Context Engineering for AI Development. Provide rich context to AI through structured MD files with standards, code guides, and documentation. Works with Cursor, Claude, Aider, VS Code Copilot, and more.",
5
+ "main": "lib/index.js",
6
+ "bin": {
7
+ "contextkit": "bin/contextkit.js",
8
+ "ck": "bin/contextkit.js",
9
+ "vibe-kit": "bin/vibe-kit.js",
10
+ "vk": "bin/vibe-kit.js"
11
+ },
12
+ "scripts": {
13
+ "test": "jest",
14
+ "test:watch": "jest --watch",
15
+ "test:coverage": "jest --coverage"
16
+ },
17
+ "keywords": [
18
+ "contextkit",
19
+ "vibe-kit",
20
+ "context-engineering",
21
+ "ai-context",
22
+ "ai-development",
23
+ "ai",
24
+ "development",
25
+ "toolkit",
26
+ "standards",
27
+ "typescript",
28
+ "testing",
29
+ "quality",
30
+ "workflow",
31
+ "cli",
32
+ "code-quality",
33
+ "ai-guidelines",
34
+ "cursor",
35
+ "cursor-ai",
36
+ "claude",
37
+ "aider",
38
+ "continodev",
39
+ "vscode-copilot",
40
+ "ai-assistant",
41
+ "context-engineering-for-ai",
42
+ "structured-context",
43
+ "markdown-standards",
44
+ "project-standards",
45
+ "code-patterns"
46
+ ],
47
+ "author": {
48
+ "name": "Marlon Maniti",
49
+ "email": "lonmaniti@gmail.com",
50
+ "url": "https://github.com/nolrm"
51
+ },
52
+ "license": "MIT",
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/nolrm/contextkit.git"
56
+ },
57
+ "homepage": "https://github.com/nolrm/contextkit#readme",
58
+ "bugs": {
59
+ "url": "https://github.com/nolrm/contextkit/issues"
60
+ },
61
+ "engines": {
62
+ "node": ">=14.0.0"
63
+ },
64
+ "dependencies": {
65
+ "axios": "^1.6.0",
66
+ "chalk": "^4.1.2",
67
+ "commander": "^11.0.0",
68
+ "fs-extra": "^11.1.1",
69
+ "inquirer": "^8.2.6",
70
+ "js-yaml": "^4.1.0",
71
+ "ora": "^5.4.1"
72
+ },
73
+ "files": [
74
+ "bin/",
75
+ "lib/",
76
+ "README.md",
77
+ "LICENSE",
78
+ "install-fallback.sh"
79
+ ],
80
+ "preferGlobal": true,
81
+ "devDependencies": {
82
+ "@types/jest": "^30.0.0",
83
+ "jest": "^30.2.0"
84
+ }
85
+ }