deepagents-cli 0.0.12 → 0.0.13
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/dist/cli.d.ts +1 -0
- package/dist/src-CVD1UvZG.js +142 -0
- package/package.json +5 -10
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
//#region src/index.ts
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
/**
|
|
10
|
+
* Map of supported platforms to their configuration
|
|
11
|
+
*/
|
|
12
|
+
const PLATFORM_MAP = {
|
|
13
|
+
"linux-x64": {
|
|
14
|
+
packageName: "@deepagents-cli/linux-x64",
|
|
15
|
+
binaryName: "deepagents",
|
|
16
|
+
os: "linux",
|
|
17
|
+
cpu: "x64"
|
|
18
|
+
},
|
|
19
|
+
"linux-arm64": {
|
|
20
|
+
packageName: "@deepagents-cli/linux-arm64",
|
|
21
|
+
binaryName: "deepagents",
|
|
22
|
+
os: "linux",
|
|
23
|
+
cpu: "arm64"
|
|
24
|
+
},
|
|
25
|
+
"darwin-x64": {
|
|
26
|
+
packageName: "@deepagents-cli/darwin-x64",
|
|
27
|
+
binaryName: "deepagents",
|
|
28
|
+
os: "darwin",
|
|
29
|
+
cpu: "x64"
|
|
30
|
+
},
|
|
31
|
+
"darwin-arm64": {
|
|
32
|
+
packageName: "@deepagents-cli/darwin-arm64",
|
|
33
|
+
binaryName: "deepagents",
|
|
34
|
+
os: "darwin",
|
|
35
|
+
cpu: "arm64"
|
|
36
|
+
},
|
|
37
|
+
"win32-x64": {
|
|
38
|
+
packageName: "@deepagents-cli/win32-x64",
|
|
39
|
+
binaryName: "deepagents.exe",
|
|
40
|
+
os: "win32",
|
|
41
|
+
cpu: "x64"
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Get the current platform key (e.g., "darwin-arm64")
|
|
46
|
+
*/
|
|
47
|
+
function getPlatformKey() {
|
|
48
|
+
return `${process.platform}-${process.arch}`;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get the platform-specific package info for the current system
|
|
52
|
+
* @returns Platform info or null if the platform is not supported
|
|
53
|
+
*/
|
|
54
|
+
function getPlatformInfo() {
|
|
55
|
+
return PLATFORM_MAP[getPlatformKey()] ?? null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get all supported platforms
|
|
59
|
+
*/
|
|
60
|
+
function getSupportedPlatforms() {
|
|
61
|
+
return Object.keys(PLATFORM_MAP);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Try to resolve the binary path using various strategies
|
|
65
|
+
*/
|
|
66
|
+
function tryResolveBinaryPath(platformInfo) {
|
|
67
|
+
const { packageName, binaryName } = platformInfo;
|
|
68
|
+
const searchPaths = [
|
|
69
|
+
path.join(__dirname, "..", "node_modules", packageName, "bin", binaryName),
|
|
70
|
+
path.join(__dirname, "..", "..", "..", packageName, "bin", binaryName),
|
|
71
|
+
path.join(__dirname, "..", "..", packageName, "bin", binaryName),
|
|
72
|
+
path.join(__dirname, "..", "platforms", getPlatformKey(), "bin", binaryName)
|
|
73
|
+
];
|
|
74
|
+
for (const searchPath of searchPaths) try {
|
|
75
|
+
const resolvedPath = path.resolve(searchPath);
|
|
76
|
+
if (fs.existsSync(resolvedPath)) return resolvedPath;
|
|
77
|
+
} catch {}
|
|
78
|
+
try {
|
|
79
|
+
const packagePath = createRequire(import.meta.url).resolve(`${packageName}/package.json`);
|
|
80
|
+
const binPath = path.join(path.dirname(packagePath), "bin", binaryName);
|
|
81
|
+
if (fs.existsSync(binPath)) return binPath;
|
|
82
|
+
} catch {}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get the path to the deepagents binary for the current platform
|
|
87
|
+
* @returns Absolute path to the binary, or null if not found/unsupported
|
|
88
|
+
*/
|
|
89
|
+
function getBinaryPath() {
|
|
90
|
+
const platformInfo = getPlatformInfo();
|
|
91
|
+
if (!platformInfo) return null;
|
|
92
|
+
return tryResolveBinaryPath(platformInfo);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Check if the CLI is available for the current platform
|
|
96
|
+
* @returns true if the binary exists and is accessible
|
|
97
|
+
*/
|
|
98
|
+
function isAvailable() {
|
|
99
|
+
return getBinaryPath() !== null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get the version of the installed CLI package
|
|
103
|
+
* @returns Version string or null if unable to determine
|
|
104
|
+
*/
|
|
105
|
+
function getVersion() {
|
|
106
|
+
try {
|
|
107
|
+
const packageJsonPath = path.join(__dirname, "..", "package.json");
|
|
108
|
+
const packageJsonContent = fs.readFileSync(packageJsonPath, "utf-8");
|
|
109
|
+
return JSON.parse(packageJsonContent).version ?? null;
|
|
110
|
+
} catch {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get detailed error message for unsupported/missing platforms
|
|
116
|
+
*/
|
|
117
|
+
function getUnsupportedPlatformMessage() {
|
|
118
|
+
const platformKey = getPlatformKey();
|
|
119
|
+
const platformInfo = getPlatformInfo();
|
|
120
|
+
const supported = getSupportedPlatforms();
|
|
121
|
+
if (!platformInfo) return `Platform "${platformKey}" is not supported.
|
|
122
|
+
|
|
123
|
+
Supported platforms:
|
|
124
|
+
${supported.map((p) => ` - ${p}`).join("\n")}
|
|
125
|
+
|
|
126
|
+
Please report this issue at:
|
|
127
|
+
https://github.com/langchain-ai/deepagentsjs/issues`;
|
|
128
|
+
return `DeepAgents CLI binary not found for ${platformKey}.
|
|
129
|
+
|
|
130
|
+
This usually means the platform-specific package failed to install.
|
|
131
|
+
Try reinstalling:
|
|
132
|
+
|
|
133
|
+
npm uninstall -g deepagents-cli
|
|
134
|
+
npm install -g deepagents-cli
|
|
135
|
+
|
|
136
|
+
If the problem persists, please report at:
|
|
137
|
+
https://github.com/langchain-ai/deepagentsjs/issues`;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
//#endregion
|
|
141
|
+
export { getUnsupportedPlatformMessage as a, getSupportedPlatforms as i, getPlatformInfo as n, getVersion as o, getPlatformKey as r, isAvailable as s, getBinaryPath as t };
|
|
142
|
+
//# sourceMappingURL=src-CVD1UvZG.js.map
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deepagents-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "DeepAgents CLI - AI Coding Assistant for your terminal",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"bin": {
|
|
10
|
-
"deepagents": "
|
|
10
|
+
"deepagents": "dist/cli.js"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
@@ -19,9 +19,8 @@
|
|
|
19
19
|
"./package.json": "./package.json"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
|
-
"dist
|
|
23
|
-
"dist
|
|
24
|
-
"dist/cli.js",
|
|
22
|
+
"dist/*.js",
|
|
23
|
+
"dist/*.d.ts",
|
|
25
24
|
"README.md"
|
|
26
25
|
],
|
|
27
26
|
"scripts": {
|
|
@@ -62,11 +61,7 @@
|
|
|
62
61
|
"node": ">=18"
|
|
63
62
|
},
|
|
64
63
|
"optionalDependencies": {
|
|
65
|
-
"@deepagents-cli/
|
|
66
|
-
"@deepagents-cli/linux-arm64": "0.0.12",
|
|
67
|
-
"@deepagents-cli/darwin-x64": "0.0.12",
|
|
68
|
-
"@deepagents-cli/darwin-arm64": "0.0.12",
|
|
69
|
-
"@deepagents-cli/win32-x64": "0.0.12"
|
|
64
|
+
"@deepagents-cli/darwin-arm64": "0.0.12"
|
|
70
65
|
},
|
|
71
66
|
"devDependencies": {
|
|
72
67
|
"@types/fs-extra": "^11.0.4",
|