recoder-code 2.0.0 → 2.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/.devcontainer/devcontainer.json +1 -1
- package/cli/debug-logger.js +3 -1
- package/cli/interactive.js +5 -44
- package/config.js +2 -1
- package/package.json +4 -2
- package/setup-global-npm.js +99 -0
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"OPENROUTER_SITE_URL": "https://recoder.xyz",
|
|
83
83
|
"RECODER_DEBUG": "true",
|
|
84
84
|
"RECODER_LITE_MODE": "false",
|
|
85
|
-
"PATH": "/usr/local/
|
|
85
|
+
"PATH": "/usr/local/share/npm-global/bin:/usr/local/bin:${containerEnv:PATH}",
|
|
86
86
|
"SHELL": "/bin/zsh"
|
|
87
87
|
},
|
|
88
88
|
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
|
package/cli/debug-logger.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
|
-
|
|
3
|
+
// Handle chalk properly
|
|
4
|
+
const chalkModule = require('chalk');
|
|
5
|
+
const chalk = chalkModule.default || chalkModule;
|
|
4
6
|
const util = require('util');
|
|
5
7
|
|
|
6
8
|
class DebugLogger {
|
package/cli/interactive.js
CHANGED
|
@@ -972,54 +972,15 @@ class InteractiveRecoderChat {
|
|
|
972
972
|
|
|
973
973
|
displayWelcome() {
|
|
974
974
|
console.clear();
|
|
975
|
-
const currentConv = this.getCurrentConversation();
|
|
976
|
-
|
|
977
|
-
// ASCII Art Banner like Claude Code
|
|
978
|
-
console.log(chalk.bold.blue('██████╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗ '));
|
|
979
|
-
console.log(chalk.bold.blue('██╔══██╗██╔════╝██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗'));
|
|
980
|
-
console.log(chalk.bold.blue('██████╔╝█████╗ ██║ ██║ ██║██║ ██║█████╗ ██████╔╝'));
|
|
981
|
-
console.log(chalk.bold.blue('██╔══██╗██╔══╝ ██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗'));
|
|
982
|
-
console.log(chalk.bold.blue('██║ ██║███████╗╚██████╗╚██████╔╝██████╔╝███████╗██║ ██║'));
|
|
983
|
-
console.log(chalk.bold.blue('╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝'));
|
|
984
|
-
console.log(chalk.gray(' ████████████████████████████████████████████████████████ '));
|
|
985
|
-
console.log(chalk.bold.green('🚀 Welcome to Recoder Interactive Chat'));
|
|
986
|
-
console.log(chalk.gray('═══════════════════════════════════════'));
|
|
987
|
-
console.log(chalk.yellow(`📡 Connected to: ${currentConv.model}`));
|
|
988
|
-
console.log(chalk.gray(`🔑 Session ID: ${this.sessionId}`));
|
|
989
|
-
console.log(chalk.cyan(`💬 Current Chat: ${currentConv.name} (${this.conversations.size} total)`));
|
|
990
|
-
|
|
991
|
-
// Show voice status
|
|
992
|
-
const voiceStatus = this.voiceManager.getStatus();
|
|
993
|
-
if (voiceStatus.textToSpeechEnabled || voiceStatus.speechToTextEnabled) {
|
|
994
|
-
const sttStatus = voiceStatus.speechToTextEnabled ? chalk.green('STT') : chalk.gray('STT');
|
|
995
|
-
const ttsStatus = voiceStatus.textToSpeechEnabled ? chalk.green('TTS') : chalk.gray('TTS');
|
|
996
|
-
console.log(chalk.gray(`🎤 Voice: ${sttStatus} | ${ttsStatus}`));
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
// Show IDE integration status
|
|
1000
|
-
const ideContext = this.ideIntegration.getCurrentContext();
|
|
1001
|
-
if (ideContext.ide !== 'terminal') {
|
|
1002
|
-
console.log(chalk.gray(`🔧 IDE: ${chalk.cyan(ideContext.ide)} | Workspace: ${path.basename(ideContext.workspaceRoot)}`));
|
|
1003
|
-
}
|
|
1004
975
|
|
|
976
|
+
// Simple welcome message like Claude Code
|
|
977
|
+
console.log('');
|
|
978
|
+
console.log(chalk.bold('✱ Welcome to Recoder-Code!'));
|
|
1005
979
|
console.log('');
|
|
1006
|
-
console.log(chalk.gray('
|
|
1007
|
-
console.log(chalk.gray(' /help - Show help'));
|
|
1008
|
-
console.log(chalk.gray(' /clear - Clear conversation'));
|
|
1009
|
-
console.log(chalk.gray(' /model - Switch model'));
|
|
1010
|
-
console.log(chalk.gray(' /stats - Show usage stats'));
|
|
1011
|
-
console.log(chalk.gray(' /save - Save conversation'));
|
|
1012
|
-
console.log(chalk.gray(' /load - Load conversation'));
|
|
1013
|
-
console.log(chalk.gray(' /chats - Manage conversations'));
|
|
1014
|
-
console.log(chalk.gray(' /exit - Exit chat'));
|
|
980
|
+
console.log(chalk.gray('/help for help, /status for your current setup'));
|
|
1015
981
|
console.log('');
|
|
1016
|
-
console.log(chalk.gray(
|
|
1017
|
-
console.log(chalk.gray(' ``` - Start/end multi-line mode'));
|
|
982
|
+
console.log(chalk.gray(`cwd: ${process.cwd()}`));
|
|
1018
983
|
console.log('');
|
|
1019
|
-
console.log(chalk.gray('Quick shortcuts:'));
|
|
1020
|
-
console.log(chalk.gray(' Ctrl+L - Clear screen'));
|
|
1021
|
-
console.log(chalk.gray(' Ctrl+S - Quick save'));
|
|
1022
|
-
console.log(chalk.gray(' Tab - Autocomplete'));
|
|
1023
984
|
console.log('');
|
|
1024
985
|
// Show session suggestions if available
|
|
1025
986
|
this.showSessionSuggestions();
|
package/config.js
CHANGED
|
@@ -4,10 +4,11 @@ module.exports = {
|
|
|
4
4
|
maxTokens: 4096,
|
|
5
5
|
temperature: 0.7,
|
|
6
6
|
apiKey: process.env.OPENROUTER_API_KEY,
|
|
7
|
-
model: process.env.OPENROUTER_MODEL || '
|
|
7
|
+
model: process.env.OPENROUTER_MODEL || 'deepseek/deepseek-chat-v3.1:free',
|
|
8
8
|
fallbackModels: process.env.OPENROUTER_FALLBACK_MODELS ?
|
|
9
9
|
process.env.OPENROUTER_FALLBACK_MODELS.split(',') :
|
|
10
10
|
[
|
|
11
|
+
'deepseek/deepseek-chat-v3.1:free',
|
|
11
12
|
'anthropic/claude-3.5-sonnet'
|
|
12
13
|
],
|
|
13
14
|
baseURL: 'https://openrouter.ai/api/v1',
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recoder-code",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Complete AI-powered development platform with ML model training, plugin registry, real-time collaboration, monitoring, infrastructure automation, and enterprise deployment capabilities",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "node cli/run.js",
|
|
8
8
|
"cli": "node cli/run.js",
|
|
9
9
|
"setup": "node setup.js",
|
|
10
|
+
"setup:global": "node setup-global-npm.js",
|
|
10
11
|
"setup:enterprise": "node setup.js --enterprise",
|
|
11
12
|
"validate": "node validate.js",
|
|
12
13
|
"build": "tsc",
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
"security:audit": "npm audit --audit-level moderate",
|
|
28
29
|
"optimize": "node scripts/optimize-package.js",
|
|
29
30
|
"health-check": "node scripts/health-check.js",
|
|
30
|
-
"postinstall": "
|
|
31
|
+
"postinstall": "node -e \"console.log('\\n🚀 Recoder-Code installed successfully!\\n\\n✅ Quick Start:\\n recoder-code\\n\\n💡 If command not found, run setup:\\n npx recoder-code setup:global\\n\\nOr add npm global bin to PATH manually:\\n echo \\\"export PATH=\\\\\\\"$(npm config get prefix)/bin:$PATH\\\\\\\"\\\" >> ~/.zshrc\\n source ~/.zshrc\\n\\n🎉 Then try: recoder-code --help\\n')\"",
|
|
31
32
|
"prepare": "echo 'Package prepared for distribution'",
|
|
32
33
|
"prepublishOnly": "npm run prepare && npm run security:audit"
|
|
33
34
|
},
|
|
@@ -148,6 +149,7 @@
|
|
|
148
149
|
"config.js",
|
|
149
150
|
"index.js",
|
|
150
151
|
"setup.js",
|
|
152
|
+
"setup-global-npm.js",
|
|
151
153
|
"validate.js",
|
|
152
154
|
"README.md",
|
|
153
155
|
"LICENSE.md",
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
|
|
8
|
+
console.log('🔧 Setting up recoder-code for global usage...\n');
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
// Check if running on macOS with Homebrew
|
|
12
|
+
if (process.platform === 'darwin') {
|
|
13
|
+
try {
|
|
14
|
+
execSync('which brew', { stdio: 'ignore' });
|
|
15
|
+
console.log('✅ Homebrew detected on macOS');
|
|
16
|
+
|
|
17
|
+
// Set npm prefix to homebrew
|
|
18
|
+
const homebrewPrefix = execSync('brew --prefix', { encoding: 'utf8' }).trim();
|
|
19
|
+
console.log(`📍 Setting npm prefix to: ${homebrewPrefix}`);
|
|
20
|
+
|
|
21
|
+
execSync(`npm config set prefix ${homebrewPrefix}`);
|
|
22
|
+
console.log('✅ npm prefix configured');
|
|
23
|
+
|
|
24
|
+
// Verify the bin directory is in PATH
|
|
25
|
+
const globalBinPath = path.join(homebrewPrefix, 'bin');
|
|
26
|
+
const currentPath = process.env.PATH || '';
|
|
27
|
+
|
|
28
|
+
if (currentPath.includes(globalBinPath)) {
|
|
29
|
+
console.log('✅ Homebrew bin directory already in PATH');
|
|
30
|
+
} else {
|
|
31
|
+
console.log('⚠️ Adding Homebrew bin to PATH...');
|
|
32
|
+
|
|
33
|
+
// Determine shell config file
|
|
34
|
+
const shell = process.env.SHELL || '';
|
|
35
|
+
let configFile = '.bashrc';
|
|
36
|
+
|
|
37
|
+
if (shell.includes('zsh')) {
|
|
38
|
+
configFile = '.zshrc';
|
|
39
|
+
} else if (shell.includes('fish')) {
|
|
40
|
+
configFile = '.config/fish/config.fish';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const configPath = path.join(os.homedir(), configFile);
|
|
44
|
+
const exportLine = `export PATH="${globalBinPath}:$PATH"`;
|
|
45
|
+
|
|
46
|
+
// Check if line already exists
|
|
47
|
+
if (fs.existsSync(configPath)) {
|
|
48
|
+
const content = fs.readFileSync(configPath, 'utf8');
|
|
49
|
+
if (!content.includes(exportLine) && !content.includes(globalBinPath)) {
|
|
50
|
+
fs.appendFileSync(configPath, `\n# Added by recoder-code setup\n${exportLine}\n`);
|
|
51
|
+
console.log(`✅ Added PATH export to ${configFile}`);
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
fs.writeFileSync(configPath, `# Added by recoder-code setup\n${exportLine}\n`);
|
|
55
|
+
console.log(`✅ Created ${configFile} with PATH export`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.log('⚠️ Homebrew not found, using default npm configuration');
|
|
61
|
+
setupDefault();
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
setupDefault();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
console.log('\n🚀 Installing recoder-code globally...');
|
|
68
|
+
execSync('npm install -g recoder-code@latest', { stdio: 'inherit' });
|
|
69
|
+
|
|
70
|
+
console.log('\n✅ Setup complete!');
|
|
71
|
+
console.log('\n🎉 Test it now:');
|
|
72
|
+
console.log(' recoder-code --help');
|
|
73
|
+
console.log(' recoder-code "Hello world"');
|
|
74
|
+
console.log('\n💡 If command not found, restart your terminal or run:');
|
|
75
|
+
console.log(' source ~/.zshrc # or your shell config file');
|
|
76
|
+
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error('❌ Setup failed:', error.message);
|
|
79
|
+
console.log('\n💡 Manual setup:');
|
|
80
|
+
console.log('1. npm config set prefix $(brew --prefix) # macOS with Homebrew');
|
|
81
|
+
console.log('2. npm install -g recoder-code');
|
|
82
|
+
console.log('3. Restart terminal');
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function setupDefault() {
|
|
87
|
+
console.log('📍 Using default npm configuration');
|
|
88
|
+
const npmPrefix = execSync('npm config get prefix', { encoding: 'utf8' }).trim();
|
|
89
|
+
const globalBinPath = path.join(npmPrefix, 'bin');
|
|
90
|
+
|
|
91
|
+
console.log(`📍 Global bin directory: ${globalBinPath}`);
|
|
92
|
+
|
|
93
|
+
// Check if in PATH
|
|
94
|
+
const currentPath = process.env.PATH || '';
|
|
95
|
+
if (!currentPath.includes(globalBinPath)) {
|
|
96
|
+
console.log('⚠️ Global bin directory not in PATH');
|
|
97
|
+
console.log(`💡 Add this to your shell config: export PATH="${globalBinPath}:$PATH"`);
|
|
98
|
+
}
|
|
99
|
+
}
|