@neuro.corp/dash 1.0.4 → 1.0.7
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/dash.js +117 -61
- package/package.json +13 -29
- package/dist/dash.exe +0 -4
package/bin/dash.js
CHANGED
|
@@ -1,61 +1,117 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const pkgPath = path.resolve(__dirname, "..", "package.json");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
const pkgPath = path.resolve(__dirname, "..", "package.json");
|
|
9
|
+
|
|
10
|
+
let version = "0.0.0";
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
14
|
+
version = pkg.version || version;
|
|
15
|
+
} catch {
|
|
16
|
+
// Continue with fallback version.
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Detect operating system and architecture
|
|
20
|
+
const platform = process.platform;
|
|
21
|
+
const arch = process.arch;
|
|
22
|
+
|
|
23
|
+
// Map platform and architecture to the correct platform package and executable.
|
|
24
|
+
// Supports all five: win32-x64, darwin-x64, darwin-arm64, linux-x64, linux-arm64
|
|
25
|
+
const platformMap = {
|
|
26
|
+
win32: {
|
|
27
|
+
packageName: "@neuro.corp/dash-win32-x64",
|
|
28
|
+
executable: "dist/dash.exe"
|
|
29
|
+
},
|
|
30
|
+
darwin: {
|
|
31
|
+
packageName: arch === "arm64"
|
|
32
|
+
? "@neuro.corp/dash-darwin-arm64"
|
|
33
|
+
: "@neuro.corp/dash-darwin-x64",
|
|
34
|
+
executable: "dist/dash"
|
|
35
|
+
},
|
|
36
|
+
linux: {
|
|
37
|
+
packageName: arch === "arm64"
|
|
38
|
+
? "@neuro.corp/dash-linux-arm64"
|
|
39
|
+
: "@neuro.corp/dash-linux-x64",
|
|
40
|
+
executable: "dist/dash"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// Determine the platform info; if platform is not supported, error out
|
|
45
|
+
let platformInfo;
|
|
46
|
+
if (platform in platformMap) {
|
|
47
|
+
platformInfo = platformMap[platform];
|
|
48
|
+
} else {
|
|
49
|
+
console.error(
|
|
50
|
+
`Dash does not currently support ${platform} ${arch}.`
|
|
51
|
+
);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Robust resolution of the platform package.
|
|
56
|
+
// Walk up from the script's directory to find the platform package in node_modules.
|
|
57
|
+
// This works whether Dash is installed globally or as a project dependency.
|
|
58
|
+
const packageName = platformInfo.packageName;
|
|
59
|
+
let packageDir = null;
|
|
60
|
+
|
|
61
|
+
let searchDir = __dirname;
|
|
62
|
+
for (let i = 0; i < 10; i++) {
|
|
63
|
+
const candidate = path.join(searchDir, "node_modules", packageName);
|
|
64
|
+
if (fs.existsSync(candidate)) {
|
|
65
|
+
packageDir = candidate;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
searchDir = path.dirname(searchDir);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (!packageDir) {
|
|
72
|
+
console.error(
|
|
73
|
+
`Could not find the Dash platform package: ${packageName}\n` +
|
|
74
|
+
`Try reinstalling Dash: npm install -g @neuro.corp/dash`
|
|
75
|
+
);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Resolve the executable path inside the platform package
|
|
80
|
+
const executablePath = path.join(packageDir, platformInfo.executable);
|
|
81
|
+
|
|
82
|
+
// Verify executable exists and is a file
|
|
83
|
+
if (!fs.existsSync(executablePath)) {
|
|
84
|
+
console.error(`Dash executable not found: ${executablePath}`);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const stat = fs.statSync(executablePath);
|
|
89
|
+
|
|
90
|
+
if (!stat.isFile()) {
|
|
91
|
+
console.error(`Expected an executable file: ${executablePath}`);
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// On Unix platforms, verify the executable has execute permissions
|
|
96
|
+
if (platform !== "win32" && (stat.mode & 0o111) === 0) {
|
|
97
|
+
console.error(
|
|
98
|
+
`Dash executable does not have executable permissions: ${executablePath}`
|
|
99
|
+
);
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Execute the binary, forwarding all CLI arguments,
|
|
104
|
+
// preserving terminal input/output, and propagating exit code
|
|
105
|
+
const { spawn } = require("node:child_process");
|
|
106
|
+
const child = spawn(executablePath, args, {
|
|
107
|
+
stdio: "inherit"
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
child.on("error", (error) => {
|
|
111
|
+
console.error(`Could not start Dash: ${error.message}`);
|
|
112
|
+
process.exitCode = 1;
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
child.on("exit", (code, signal) => {
|
|
116
|
+
process.exitCode = code ?? (signal ? 1 : 0);
|
|
117
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neuro.corp/dash",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "AI-powered terminal coding agent for developers",
|
|
5
5
|
"license": "PROPRIETARY",
|
|
6
6
|
"type": "module",
|
|
@@ -9,43 +9,27 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"bin/",
|
|
12
|
-
"dist/dash.exe",
|
|
13
12
|
"LICENSE",
|
|
14
13
|
"README.md"
|
|
15
14
|
],
|
|
16
|
-
"homepage": "https://github.com/neuro
|
|
15
|
+
"homepage": "https://github.com/neuro.corp/DASH",
|
|
17
16
|
"repository": {
|
|
18
17
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/neuro
|
|
18
|
+
"url": "git+https://github.com/neuro.corp/DASH.git"
|
|
20
19
|
},
|
|
21
20
|
"bugs": {
|
|
22
|
-
"url": "https://github.com/neuro
|
|
21
|
+
"url": "https://github.com/neuro.corp/DASH/issues"
|
|
23
22
|
},
|
|
24
|
-
"
|
|
25
|
-
"@
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@types/react": "^19.3.0",
|
|
31
|
-
"chalk": "^6.0.1",
|
|
32
|
-
"cli-highlight": "^2.1.11",
|
|
33
|
-
"figures": "^6.1.0",
|
|
34
|
-
"ink": "^8.0.0",
|
|
35
|
-
"ink-spinner": "^5.0.0",
|
|
36
|
-
"ink-text-input": "^6.0.0",
|
|
37
|
-
"marked": "^15.0.12",
|
|
38
|
-
"marked-terminal": "^7.3.0",
|
|
39
|
-
"react": "^19.3.1",
|
|
40
|
-
"react-dom": "^19.3.1",
|
|
41
|
-
"string-width": "^8.3.0",
|
|
42
|
-
"wrap-ansi": "^10.0.2"
|
|
43
|
-
},
|
|
44
|
-
"scripts": {
|
|
45
|
-
"dev": "bun run src/index.tsx",
|
|
46
|
-
"start": "bun run src/index.tsx"
|
|
23
|
+
"optionalDependencies": {
|
|
24
|
+
"@neuro.corp/dash-win32-x64": "1.0.7",
|
|
25
|
+
"@neuro.corp/dash-darwin-x64": "1.0.7",
|
|
26
|
+
"@neuro.corp/dash-darwin-arm64": "1.0.7",
|
|
27
|
+
"@neuro.corp/dash-linux-x64": "1.0.7",
|
|
28
|
+
"@neuro.corp/dash-linux-arm64": "1.0.7"
|
|
47
29
|
},
|
|
30
|
+
"os": ["win32", "darwin", "linux"],
|
|
31
|
+
"cpu": ["x64", "arm64"],
|
|
48
32
|
"engines": {
|
|
49
33
|
"node": ">=20"
|
|
50
34
|
}
|
|
51
|
-
}
|
|
35
|
+
}
|
package/dist/dash.exe
DELETED