delimit-cli 3.6.8 → 3.6.9
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/bin/delimit-setup.js +85 -3
- package/package.json +1 -1
package/bin/delimit-setup.js
CHANGED
|
@@ -166,7 +166,8 @@ async function main() {
|
|
|
166
166
|
if (toml.includes('[mcp_servers.delimit]')) {
|
|
167
167
|
log(` ${green('✓')} Delimit already in Codex config`);
|
|
168
168
|
} else {
|
|
169
|
-
const
|
|
169
|
+
const serverDir = path.join(DELIMIT_HOME, 'server');
|
|
170
|
+
const codexEntry = `\n[mcp_servers.delimit]\ncommand = "${python}"\nargs = ["${actualServer}"]\ncwd = "${serverDir}"\n\n[mcp_servers.delimit.env]\nPYTHONPATH = "${serverDir}:${path.join(serverDir, 'ai')}"\n`;
|
|
170
171
|
toml += codexEntry;
|
|
171
172
|
fs.writeFileSync(CODEX_CONFIG, toml);
|
|
172
173
|
log(` ${green('✓')} Added delimit to Codex (${CODEX_CONFIG})`);
|
|
@@ -326,8 +327,78 @@ Run full governance compliance checks. Verify security, policy compliance, evide
|
|
|
326
327
|
}
|
|
327
328
|
}
|
|
328
329
|
|
|
329
|
-
// Step 6:
|
|
330
|
-
step(6, '
|
|
330
|
+
// Step 6: Auto-detect API keys for multi-model deliberation
|
|
331
|
+
step(6, 'Detecting AI model API keys...');
|
|
332
|
+
|
|
333
|
+
const modelsPath = path.join(DELIMIT_HOME, 'models.json');
|
|
334
|
+
const keyDetection = {
|
|
335
|
+
grok: { env: 'XAI_API_KEY', name: 'Grok (xAI)', found: false },
|
|
336
|
+
gemini: { env: 'GOOGLE_APPLICATION_CREDENTIALS', name: 'Gemini (Vertex AI)', found: false },
|
|
337
|
+
codex: { env: 'OPENAI_API_KEY', name: 'Codex (OpenAI)', found: false },
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
// Check which keys exist in environment
|
|
341
|
+
for (const [id, info] of Object.entries(keyDetection)) {
|
|
342
|
+
if (process.env[info.env]) {
|
|
343
|
+
info.found = true;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
const foundKeys = Object.entries(keyDetection).filter(([, v]) => v.found);
|
|
348
|
+
const missingKeys = Object.entries(keyDetection).filter(([, v]) => !v.found);
|
|
349
|
+
|
|
350
|
+
if (foundKeys.length > 0 && !fs.existsSync(modelsPath)) {
|
|
351
|
+
// Auto-generate models.json from detected keys
|
|
352
|
+
const models = {};
|
|
353
|
+
if (keyDetection.grok.found) {
|
|
354
|
+
models.grok = {
|
|
355
|
+
name: 'Grok 4',
|
|
356
|
+
api_url: 'https://api.x.ai/v1/chat/completions',
|
|
357
|
+
model: 'grok-4-0709',
|
|
358
|
+
env_key: 'XAI_API_KEY',
|
|
359
|
+
enabled: true,
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
if (keyDetection.gemini.found) {
|
|
363
|
+
const project = process.env.GOOGLE_CLOUD_PROJECT || 'default';
|
|
364
|
+
models.gemini = {
|
|
365
|
+
name: 'Gemini 2.5 Flash',
|
|
366
|
+
api_url: `https://us-central1-aiplatform.googleapis.com/v1/projects/{project}/locations/us-central1/publishers/google/models/gemini-2.5-flash:generateContent`,
|
|
367
|
+
model: 'gemini-2.5-flash',
|
|
368
|
+
format: 'vertex_ai',
|
|
369
|
+
enabled: true,
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
if (keyDetection.codex.found) {
|
|
373
|
+
models.codex = {
|
|
374
|
+
name: 'Codex (GPT-5.4)',
|
|
375
|
+
format: 'codex_cli',
|
|
376
|
+
model: 'gpt-5.4',
|
|
377
|
+
enabled: true,
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
fs.writeFileSync(modelsPath, JSON.stringify(models, null, 2));
|
|
381
|
+
log(` ${green('✓')} Auto-configured ${foundKeys.length} model(s) for deliberation:`);
|
|
382
|
+
foundKeys.forEach(([, v]) => log(` ${green('✓')} ${v.name}`));
|
|
383
|
+
} else if (fs.existsSync(modelsPath)) {
|
|
384
|
+
try {
|
|
385
|
+
const existing = JSON.parse(fs.readFileSync(modelsPath, 'utf-8'));
|
|
386
|
+
const enabled = Object.values(existing).filter(m => m.enabled);
|
|
387
|
+
log(` ${green('✓')} ${enabled.length} model(s) already configured for deliberation`);
|
|
388
|
+
} catch {
|
|
389
|
+
log(` ${yellow('!')} models.json exists but could not be read`);
|
|
390
|
+
}
|
|
391
|
+
} else {
|
|
392
|
+
log(` ${dim(' No AI API keys detected in environment')}`);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
if (missingKeys.length > 0 && foundKeys.length < 2 && !fs.existsSync(modelsPath)) {
|
|
396
|
+
log(` ${dim(' For multi-model deliberation, set 2+ of:')}`);
|
|
397
|
+
missingKeys.forEach(([, v]) => log(` ${dim(`export ${v.env}=your-key`)}`));
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// Step 7: Done
|
|
401
|
+
step(7, 'Done!');
|
|
331
402
|
log('');
|
|
332
403
|
log(` ${green('Delimit is installed.')} Your AI now has persistent memory and governance.`);
|
|
333
404
|
log('');
|
|
@@ -337,6 +408,17 @@ Run full governance compliance checks. Verify security, policy compliance, evide
|
|
|
337
408
|
if (fs.existsSync(path.join(os.homedir(), '.cursor'))) tools.push('Cursor');
|
|
338
409
|
if (fs.existsSync(GEMINI_DIR)) tools.push('Gemini CLI');
|
|
339
410
|
log(` ${green('✓')} ${tools.join(', ')}`);
|
|
411
|
+
|
|
412
|
+
// Show deliberation status
|
|
413
|
+
if (foundKeys.length >= 2) {
|
|
414
|
+
log(` ${green('✓')} Multi-model deliberation: ${foundKeys.map(([,v]) => v.name).join(' + ')}`);
|
|
415
|
+
} else if (foundKeys.length === 1) {
|
|
416
|
+
log(` ${yellow('!')} Deliberation: needs 1 more API key (${missingKeys.slice(0,2).map(([,v]) => v.env).join(' or ')})`);
|
|
417
|
+
} else if (fs.existsSync(modelsPath)) {
|
|
418
|
+
log(` ${green('✓')} Deliberation: configured via ~/.delimit/models.json`);
|
|
419
|
+
} else {
|
|
420
|
+
log(` ${dim(' Deliberation: not configured (optional — set API keys to enable)')}`);
|
|
421
|
+
}
|
|
340
422
|
log('');
|
|
341
423
|
log(' Try it now:');
|
|
342
424
|
log(` ${bold('$ claude')}`);
|