specmem-hardwicksoftware 3.5.22 → 3.5.24
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.
Potentially problematic release.
This version of specmem-hardwicksoftware might be problematic. Click here for more details.
package/package.json
CHANGED
|
@@ -120,6 +120,51 @@ function checkPython() {
|
|
|
120
120
|
function installPythonDeps() {
|
|
121
121
|
console.log(`\n${YELLOW}${BOLD}═══ Installing Python Dependencies ═══${RESET}\n`);
|
|
122
122
|
|
|
123
|
+
// First, ensure pip is installed
|
|
124
|
+
console.log(`${DIM}Checking for pip...${RESET}`);
|
|
125
|
+
try {
|
|
126
|
+
execSync('pip3 --version', { stdio: 'pipe' });
|
|
127
|
+
console.log(`${GREEN}✓${RESET} pip3 found`);
|
|
128
|
+
} catch (e) {
|
|
129
|
+
console.log(`${YELLOW}pip3 not found - installing...${RESET}`);
|
|
130
|
+
try {
|
|
131
|
+
// Try to install pip based on OS
|
|
132
|
+
if (process.platform === 'linux') {
|
|
133
|
+
try {
|
|
134
|
+
execSync('apt-get update -qq && apt-get install -y python3-pip python3-venv', {
|
|
135
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
136
|
+
timeout: 120000
|
|
137
|
+
});
|
|
138
|
+
console.log(`${GREEN}✓${RESET} pip3 installed via apt`);
|
|
139
|
+
} catch (aptErr) {
|
|
140
|
+
try {
|
|
141
|
+
execSync('dnf install -y python3-pip || yum install -y python3-pip', {
|
|
142
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
143
|
+
timeout: 120000
|
|
144
|
+
});
|
|
145
|
+
console.log(`${GREEN}✓${RESET} pip3 installed via dnf/yum`);
|
|
146
|
+
} catch (dnfErr) {
|
|
147
|
+
console.log(`${RED}✗${RESET} Could not install pip3 - try: sudo apt install python3-pip`);
|
|
148
|
+
console.log(`${YELLOW}Skipping Python deps - SpecMem will use fallback embeddings${RESET}`);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
} else if (process.platform === 'darwin') {
|
|
153
|
+
try {
|
|
154
|
+
execSync('brew install python3', { stdio: 'pipe', timeout: 120000 });
|
|
155
|
+
console.log(`${GREEN}✓${RESET} Python3 (with pip) installed via brew`);
|
|
156
|
+
} catch (brewErr) {
|
|
157
|
+
console.log(`${RED}✗${RESET} Could not install pip3 - try: brew install python3`);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
} catch (installErr) {
|
|
162
|
+
console.log(`${RED}✗${RESET} pip3 installation failed`);
|
|
163
|
+
console.log(`${YELLOW}Skipping Python deps - SpecMem will use fallback embeddings${RESET}`);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
123
168
|
const deps = [
|
|
124
169
|
'torch --index-url https://download.pytorch.org/whl/cpu',
|
|
125
170
|
'sentence-transformers',
|
|
@@ -132,7 +177,8 @@ function installPythonDeps() {
|
|
|
132
177
|
try {
|
|
133
178
|
console.log(`${DIM}Installing ${dep.split(' ')[0]}...${RESET}`);
|
|
134
179
|
execSync(`pip3 install ${dep} --break-system-packages -q 2>/dev/null || pip install ${dep} --break-system-packages -q 2>/dev/null || pip3 install ${dep} -q 2>/dev/null || pip install ${dep} -q 2>/dev/null`, {
|
|
135
|
-
stdio: ['pipe', 'pipe', 'pipe']
|
|
180
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
181
|
+
timeout: 300000 // 5 min timeout for torch
|
|
136
182
|
});
|
|
137
183
|
console.log(`${GREEN}✓${RESET} ${dep.split(' ')[0]} installed`);
|
|
138
184
|
} catch (e) {
|
|
@@ -178,6 +178,73 @@ function ensureDir(dir) {
|
|
|
178
178
|
// CLAUDE CODE INSTALLATION
|
|
179
179
|
// ============================================================================
|
|
180
180
|
|
|
181
|
+
// ============================================================================
|
|
182
|
+
// CORE SYSTEM DEPENDENCIES - Install EVERYTHING if missing
|
|
183
|
+
// ============================================================================
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Install ALL core system dependencies before anything else
|
|
187
|
+
*/
|
|
188
|
+
function installCoreDeps() {
|
|
189
|
+
log.header('Installing Core System Dependencies');
|
|
190
|
+
|
|
191
|
+
const packages = [];
|
|
192
|
+
|
|
193
|
+
// Check what's missing
|
|
194
|
+
if (!commandExists('python3')) packages.push('python3');
|
|
195
|
+
if (!commandExists('pip3') && !commandExists('pip')) packages.push('python3-pip');
|
|
196
|
+
if (!commandExists('screen')) packages.push('screen');
|
|
197
|
+
if (!commandExists('curl')) packages.push('curl');
|
|
198
|
+
if (!commandExists('git')) packages.push('git');
|
|
199
|
+
if (!commandExists('sudo')) packages.push('sudo');
|
|
200
|
+
|
|
201
|
+
if (packages.length === 0) {
|
|
202
|
+
log.success('All core dependencies already installed');
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
log.info(`Missing packages: ${packages.join(', ')}`);
|
|
207
|
+
log.info('Installing via package manager...');
|
|
208
|
+
|
|
209
|
+
if (IS_LINUX) {
|
|
210
|
+
if (commandExists('apt-get')) {
|
|
211
|
+
// Debian/Ubuntu/Mint
|
|
212
|
+
const result = run(`apt-get update -qq && apt-get install -y ${packages.join(' ')} python3-venv build-essential`, { timeout: 300000 });
|
|
213
|
+
if (!result.success) {
|
|
214
|
+
// Try with sudo
|
|
215
|
+
run(`sudo apt-get update -qq && sudo apt-get install -y ${packages.join(' ')} python3-venv build-essential`, { timeout: 300000 });
|
|
216
|
+
}
|
|
217
|
+
} else if (commandExists('dnf')) {
|
|
218
|
+
run(`sudo dnf install -y ${packages.join(' ').replace('python3-pip', 'python3-pip python3-devel')} gcc make`, { timeout: 300000 });
|
|
219
|
+
} else if (commandExists('yum')) {
|
|
220
|
+
run(`sudo yum install -y ${packages.join(' ').replace('python3-pip', 'python3-pip python3-devel')} gcc make`, { timeout: 300000 });
|
|
221
|
+
} else if (commandExists('pacman')) {
|
|
222
|
+
run(`sudo pacman -Sy --noconfirm ${packages.join(' ').replace('python3-pip', 'python-pip')}`, { timeout: 300000 });
|
|
223
|
+
}
|
|
224
|
+
} else if (IS_MAC) {
|
|
225
|
+
if (commandExists('brew')) {
|
|
226
|
+
run(`brew install ${packages.join(' ').replace('python3-pip', 'python3')}`, { timeout: 300000 });
|
|
227
|
+
} else {
|
|
228
|
+
log.warn('Homebrew not found - install from https://brew.sh');
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Verify critical ones
|
|
233
|
+
const missing = [];
|
|
234
|
+
if (!commandExists('python3')) missing.push('python3');
|
|
235
|
+
if (!commandExists('pip3') && !commandExists('pip')) missing.push('pip');
|
|
236
|
+
if (!commandExists('screen')) missing.push('screen');
|
|
237
|
+
|
|
238
|
+
if (missing.length > 0) {
|
|
239
|
+
log.warn(`Still missing: ${missing.join(', ')}`);
|
|
240
|
+
log.info('Some features may not work without these dependencies');
|
|
241
|
+
} else {
|
|
242
|
+
log.success('All core dependencies installed');
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
|
|
181
248
|
/**
|
|
182
249
|
* Check if Claude Code is installed, install if missing
|
|
183
250
|
*/
|
|
@@ -1656,14 +1723,17 @@ ${c.reset}
|
|
|
1656
1723
|
};
|
|
1657
1724
|
|
|
1658
1725
|
try {
|
|
1659
|
-
// Step
|
|
1726
|
+
// Step 0: Install ALL core system deps FIRST (python3, pip, screen, curl, git)
|
|
1727
|
+
installCoreDeps();
|
|
1728
|
+
|
|
1729
|
+
// Step 0a: Claude Code (REQUIRED)
|
|
1660
1730
|
results.claudeCode = ensureClaudeCode();
|
|
1661
1731
|
if (!results.claudeCode) {
|
|
1662
1732
|
log.warn('Claude Code not installed - SpecMem requires Claude Code to function');
|
|
1663
1733
|
log.info('Install manually: npm install -g @anthropic-ai/claude-code');
|
|
1664
1734
|
}
|
|
1665
1735
|
|
|
1666
|
-
// Step 0b: screen (needed for team members)
|
|
1736
|
+
// Step 0b: screen (needed for team members) - should already be installed by installCoreDeps
|
|
1667
1737
|
results.screen = ensureScreen();
|
|
1668
1738
|
|
|
1669
1739
|
// Step 1: PostgreSQL
|