delimit-cli 3.11.4 → 3.11.6
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-cli.js +8 -0
- package/bin/delimit-setup.js +15 -2
- package/lib/api-engine.js +48 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/bin/delimit-cli.js
CHANGED
|
@@ -1277,6 +1277,14 @@ program
|
|
|
1277
1277
|
console.log(chalk.dim('Tier: pro'));
|
|
1278
1278
|
});
|
|
1279
1279
|
|
|
1280
|
+
// Version subcommand alias (users type 'delimit version' not 'delimit -V')
|
|
1281
|
+
program
|
|
1282
|
+
.command('version')
|
|
1283
|
+
.description('Show version')
|
|
1284
|
+
.action(() => {
|
|
1285
|
+
console.log(require('../package.json').version);
|
|
1286
|
+
});
|
|
1287
|
+
|
|
1280
1288
|
// Hide legacy/internal commands from --help
|
|
1281
1289
|
['install', 'mode', 'status', 'policy', 'auth', 'audit',
|
|
1282
1290
|
'explain-decision', 'uninstall', 'proxy', 'hook'].forEach(name => {
|
package/bin/delimit-setup.js
CHANGED
|
@@ -504,8 +504,21 @@ echo "[Delimit] ${toolName} not found" >&2; exit 127
|
|
|
504
504
|
}
|
|
505
505
|
log('');
|
|
506
506
|
|
|
507
|
-
// Step 7:
|
|
508
|
-
step(7, '
|
|
507
|
+
// Step 7: Local dashboard API server
|
|
508
|
+
step(7, 'Local dashboard API...');
|
|
509
|
+
|
|
510
|
+
const localServerPath = path.join(DELIMIT_HOME, 'server', 'ai', 'local_server.py');
|
|
511
|
+
if (fs.existsSync(localServerPath)) {
|
|
512
|
+
log(` ${green('✓')} Local API server available on port 7823`);
|
|
513
|
+
log(` ${dim(' Start it: python3 ' + localServerPath)}`);
|
|
514
|
+
log(` ${dim(' Dashboard connects to localhost:7823 automatically')}`);
|
|
515
|
+
} else {
|
|
516
|
+
log(` ${dim(' Local API server not found — dashboard will use cloud sync')}`);
|
|
517
|
+
}
|
|
518
|
+
log('');
|
|
519
|
+
|
|
520
|
+
// Step 8: Done
|
|
521
|
+
step(8, 'Done!');
|
|
509
522
|
log('');
|
|
510
523
|
log(` ${green('Delimit is installed.')} Your AI now has persistent memory and governance.`);
|
|
511
524
|
log('');
|
package/lib/api-engine.js
CHANGED
|
@@ -17,13 +17,34 @@ const fs = require('fs');
|
|
|
17
17
|
const os = require('os');
|
|
18
18
|
|
|
19
19
|
// Gateway root — the Python engine lives here
|
|
20
|
+
// Resolution order: env var > ~/.delimit/server > ~/.delimit/gateway > bundled gateway
|
|
20
21
|
const DELIMIT_HOME = process.env.DELIMIT_HOME || path.join(os.homedir(), '.delimit');
|
|
21
|
-
const GATEWAY_ROOT =
|
|
22
|
+
const GATEWAY_ROOT = (() => {
|
|
23
|
+
if (process.env.DELIMIT_GATEWAY_ROOT) return process.env.DELIMIT_GATEWAY_ROOT;
|
|
24
|
+
// Check ~/.delimit/server (where `delimit setup` installs)
|
|
25
|
+
const serverPath = path.join(DELIMIT_HOME, 'server');
|
|
26
|
+
if (fs.existsSync(path.join(serverPath, 'core'))) return serverPath;
|
|
27
|
+
// Check ~/.delimit/gateway (legacy path)
|
|
28
|
+
const gatewayPath = path.join(DELIMIT_HOME, 'gateway');
|
|
29
|
+
if (fs.existsSync(path.join(gatewayPath, 'core'))) return gatewayPath;
|
|
30
|
+
// Check bundled gateway inside the npm package
|
|
31
|
+
const bundledPath = path.join(__dirname, '..', 'gateway');
|
|
32
|
+
if (fs.existsSync(path.join(bundledPath, 'core'))) return bundledPath;
|
|
33
|
+
// Fallback — will fail with a clear error in runGateway()
|
|
34
|
+
return gatewayPath;
|
|
35
|
+
})();
|
|
22
36
|
|
|
23
37
|
// Python executable — prefer venv if available
|
|
24
38
|
const PYTHON = (() => {
|
|
25
39
|
const venvPy = path.join(DELIMIT_HOME, 'venv', 'bin', 'python');
|
|
26
40
|
if (fs.existsSync(venvPy)) return venvPy;
|
|
41
|
+
// Check common python locations
|
|
42
|
+
for (const cmd of ['python3', 'python']) {
|
|
43
|
+
try {
|
|
44
|
+
execSync(`${cmd} --version`, { stdio: 'pipe' });
|
|
45
|
+
return cmd;
|
|
46
|
+
} catch {}
|
|
47
|
+
}
|
|
27
48
|
return 'python3';
|
|
28
49
|
})();
|
|
29
50
|
|
|
@@ -33,6 +54,20 @@ const PYTHON = (() => {
|
|
|
33
54
|
* Returns parsed JSON or throws.
|
|
34
55
|
*/
|
|
35
56
|
function runGateway(pythonCode, timeoutMs = 30000) {
|
|
57
|
+
// Check that the gateway core exists before trying to run
|
|
58
|
+
if (!fs.existsSync(path.join(GATEWAY_ROOT, 'core'))) {
|
|
59
|
+
const msg = [
|
|
60
|
+
'Delimit gateway engine not found.',
|
|
61
|
+
'',
|
|
62
|
+
'Run one of:',
|
|
63
|
+
' npx delimit-cli setup # full install with MCP server',
|
|
64
|
+
' delimit setup # if globally installed',
|
|
65
|
+
'',
|
|
66
|
+
'Or set DELIMIT_GATEWAY_ROOT to your gateway directory.',
|
|
67
|
+
].join('\n');
|
|
68
|
+
throw new Error(msg);
|
|
69
|
+
}
|
|
70
|
+
|
|
36
71
|
const tmpFile = path.join(os.tmpdir(), `delimit_${process.pid}_${Date.now()}.py`);
|
|
37
72
|
try {
|
|
38
73
|
fs.writeFileSync(tmpFile, pythonCode);
|
|
@@ -50,6 +85,18 @@ function runGateway(pythonCode, timeoutMs = 30000) {
|
|
|
50
85
|
if (err.stdout) {
|
|
51
86
|
try { return JSON.parse(err.stdout.trim()); } catch (_) {}
|
|
52
87
|
}
|
|
88
|
+
// Improve error messages for common failures
|
|
89
|
+
const stderr = err.stderr || '';
|
|
90
|
+
if (stderr.includes('No module named') || stderr.includes('ModuleNotFoundError')) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
`Python dependency missing. Run: npx delimit-cli setup\n\nDetails: ${stderr.trim()}`
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (err.message && err.message.includes('ENOENT')) {
|
|
96
|
+
throw new Error(
|
|
97
|
+
`Python not found. Install Python 3.9+ and try again.\n\nDetails: ${err.message}`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
53
100
|
throw new Error(err.stderr || err.message || 'Gateway execution failed');
|
|
54
101
|
} finally {
|
|
55
102
|
try { fs.unlinkSync(tmpFile); } catch (_) {}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "delimit-cli",
|
|
3
3
|
"mcpName": "io.github.delimit-ai/delimit",
|
|
4
|
-
"version": "3.11.
|
|
4
|
+
"version": "3.11.6",
|
|
5
5
|
"description": "One workspace for every AI coding assistant. Tasks, memory, and governance carry between Claude Code, Codex, and Gemini CLI.",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
package/server.json
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"url": "https://github.com/delimit-ai/delimit",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "3.11.
|
|
10
|
+
"version": "3.11.6",
|
|
11
11
|
"websiteUrl": "https://delimit.ai",
|
|
12
12
|
"packages": [
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "delimit-cli",
|
|
16
|
-
"version": "3.11.
|
|
16
|
+
"version": "3.11.6",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
}
|