deepseek-tui 0.3.28 → 0.3.29
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/README.md +23 -12
- package/package.json +7 -1
- package/scripts/artifacts.js +19 -5
- package/scripts/install.js +7 -2
- package/scripts/verify-release-assets.js +78 -0
package/README.md
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
# deepseek-tui
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`DeepSeek-TUI` GitHub release artifacts and exposes them as Node-compatible
|
|
5
|
-
console entry points.
|
|
3
|
+
Install and run the `deepseek` and `deepseek-tui` binaries from GitHub release artifacts.
|
|
6
4
|
|
|
7
5
|
## Install
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
|
-
npm install deepseek-tui
|
|
8
|
+
npm install -g deepseek-tui
|
|
11
9
|
# or
|
|
12
|
-
pnpm add deepseek-tui
|
|
10
|
+
pnpm add -g deepseek-tui
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
For project-local usage:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install deepseek-tui
|
|
17
|
+
npx deepseek-tui --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`postinstall` downloads platform binaries into `bin/downloads/` and exposes
|
|
21
|
+
`deepseek` and `deepseek-tui` commands.
|
|
17
22
|
|
|
18
23
|
## Supported platforms
|
|
19
24
|
|
|
@@ -21,11 +26,17 @@ This runs `postinstall`, downloads the platform-specific binaries for version
|
|
|
21
26
|
- macOS x64 / arm64
|
|
22
27
|
- Windows x64
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
Other platform/architecture combinations are not supported and will fail during install.
|
|
30
|
+
|
|
31
|
+
## Configuration
|
|
25
32
|
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
- Set `
|
|
29
|
-
- Set `DEEPSEEK_GITHUB_REPO` to override the repo source (defaults to `Hmbown/DeepSeek-TUI`).
|
|
33
|
+
- Default binary version comes from `deepseekBinaryVersion` in `package.json`.
|
|
34
|
+
- Set `DEEPSEEK_TUI_VERSION` or `DEEPSEEK_VERSION` to override the release version.
|
|
35
|
+
- Set `DEEPSEEK_TUI_GITHUB_REPO` or `DEEPSEEK_GITHUB_REPO` to override the source repo (defaults to `Hmbown/DeepSeek-TUI`).
|
|
30
36
|
- Set `DEEPSEEK_TUI_FORCE_DOWNLOAD=1` to force download even when the cached binary is already present.
|
|
31
37
|
- Set `DEEPSEEK_TUI_DISABLE_INSTALL=1` to skip install-time download.
|
|
38
|
+
|
|
39
|
+
## Release integrity
|
|
40
|
+
|
|
41
|
+
- `npm publish` runs a release-asset check to ensure all required binary assets
|
|
42
|
+
exist for the target GitHub release before publishing.
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deepseek-tui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.29",
|
|
4
|
+
"deepseekBinaryVersion": "0.3.28",
|
|
4
5
|
"description": "Install and run deepseek and deepseek-tui binaries from GitHub release artifacts.",
|
|
5
6
|
"author": "Hmbown",
|
|
6
7
|
"license": "MIT",
|
|
@@ -26,12 +27,17 @@
|
|
|
26
27
|
"deepseek-tui": "bin/deepseek-tui.js"
|
|
27
28
|
},
|
|
28
29
|
"scripts": {
|
|
30
|
+
"release:check": "node scripts/verify-release-assets.js",
|
|
29
31
|
"postinstall": "node scripts/install.js",
|
|
32
|
+
"prepublishOnly": "node scripts/verify-release-assets.js",
|
|
30
33
|
"prepack": "node scripts/install.js"
|
|
31
34
|
},
|
|
32
35
|
"engines": {
|
|
33
36
|
"node": ">=18"
|
|
34
37
|
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
35
41
|
"preferGlobal": true,
|
|
36
42
|
"files": [
|
|
37
43
|
"bin/*.js",
|
package/scripts/artifacts.js
CHANGED
|
@@ -4,16 +4,14 @@ const os = require("os");
|
|
|
4
4
|
const ASSET_MATRIX = {
|
|
5
5
|
linux: {
|
|
6
6
|
x64: ["deepseek-linux-x64", "deepseek-tui-linux-x64"],
|
|
7
|
-
|
|
7
|
+
// arm64: ["deepseek-linux-arm64", "deepseek-tui-linux-arm64"], // Uncomment when binaries are available
|
|
8
8
|
},
|
|
9
9
|
darwin: {
|
|
10
10
|
x64: ["deepseek-macos-x64", "deepseek-tui-macos-x64"],
|
|
11
11
|
arm64: ["deepseek-macos-arm64", "deepseek-tui-macos-arm64"],
|
|
12
|
-
default: ["deepseek-macos-x64", "deepseek-tui-macos-x64"],
|
|
13
12
|
},
|
|
14
13
|
win32: {
|
|
15
14
|
x64: ["deepseek-windows-x64.exe", "deepseek-tui-windows-x64.exe"],
|
|
16
|
-
default: ["deepseek-windows-x64.exe", "deepseek-tui-windows-x64.exe"],
|
|
17
15
|
},
|
|
18
16
|
};
|
|
19
17
|
|
|
@@ -22,9 +20,14 @@ function detectBinaryNames() {
|
|
|
22
20
|
const arch = os.arch();
|
|
23
21
|
const defaults = ASSET_MATRIX[platform];
|
|
24
22
|
if (!defaults) {
|
|
25
|
-
|
|
23
|
+
const supported = Object.keys(ASSET_MATRIX).map(p => `'${p}'`).join(', ');
|
|
24
|
+
throw new Error(`Unsupported platform: ${platform}. Supported platforms: ${supported}`);
|
|
25
|
+
}
|
|
26
|
+
const pair = defaults[arch];
|
|
27
|
+
if (!pair) {
|
|
28
|
+
const supported = Object.keys(defaults).map(a => `'${a}'`).join(', ');
|
|
29
|
+
throw new Error(`Unsupported architecture: ${arch} on platform ${platform}. Supported architectures: ${supported}`);
|
|
26
30
|
}
|
|
27
|
-
const pair = defaults[arch] || defaults.default;
|
|
28
31
|
return {
|
|
29
32
|
platform,
|
|
30
33
|
arch,
|
|
@@ -45,7 +48,18 @@ function releaseBinaryDirectory() {
|
|
|
45
48
|
return path.join(__dirname, "..", "bin", "downloads");
|
|
46
49
|
}
|
|
47
50
|
|
|
51
|
+
function allAssetNames() {
|
|
52
|
+
const names = [];
|
|
53
|
+
for (const platformAssets of Object.values(ASSET_MATRIX)) {
|
|
54
|
+
for (const pair of Object.values(platformAssets)) {
|
|
55
|
+
names.push(pair[0], pair[1]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return Array.from(new Set(names));
|
|
59
|
+
}
|
|
60
|
+
|
|
48
61
|
module.exports = {
|
|
62
|
+
allAssetNames,
|
|
49
63
|
detectBinaryNames,
|
|
50
64
|
executableName,
|
|
51
65
|
releaseAssetUrl,
|
package/scripts/install.js
CHANGED
|
@@ -11,10 +11,15 @@ const {
|
|
|
11
11
|
releaseAssetUrl,
|
|
12
12
|
releaseBinaryDirectory,
|
|
13
13
|
} = require("./artifacts");
|
|
14
|
+
const pkg = require("../package.json");
|
|
14
15
|
|
|
15
16
|
function resolvePackageVersion() {
|
|
16
|
-
const
|
|
17
|
-
|
|
17
|
+
const configuredVersion =
|
|
18
|
+
process.env.DEEPSEEK_TUI_VERSION ||
|
|
19
|
+
process.env.DEEPSEEK_VERSION ||
|
|
20
|
+
pkg.deepseekBinaryVersion ||
|
|
21
|
+
pkg.version;
|
|
22
|
+
return String(configuredVersion).trim();
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
function resolveRepo() {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const https = require("https");
|
|
2
|
+
const http = require("http");
|
|
3
|
+
const { allAssetNames, releaseAssetUrl } = require("./artifacts");
|
|
4
|
+
|
|
5
|
+
const pkg = require("../package.json");
|
|
6
|
+
|
|
7
|
+
function resolveBinaryVersion() {
|
|
8
|
+
const configuredVersion =
|
|
9
|
+
process.env.DEEPSEEK_TUI_VERSION ||
|
|
10
|
+
process.env.DEEPSEEK_VERSION ||
|
|
11
|
+
pkg.deepseekBinaryVersion ||
|
|
12
|
+
pkg.version;
|
|
13
|
+
return String(configuredVersion).trim();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function resolveRepo() {
|
|
17
|
+
return process.env.DEEPSEEK_TUI_GITHUB_REPO || process.env.DEEPSEEK_GITHUB_REPO || "Hmbown/DeepSeek-TUI";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function requestStatus(url, method = "HEAD", redirects = 0) {
|
|
21
|
+
if (redirects > 10) {
|
|
22
|
+
throw new Error(`Too many redirects while checking ${url}`);
|
|
23
|
+
}
|
|
24
|
+
const client = url.startsWith("https:") ? https : http;
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
const req = client.request(
|
|
27
|
+
url,
|
|
28
|
+
{
|
|
29
|
+
method,
|
|
30
|
+
headers: {
|
|
31
|
+
"User-Agent": "deepseek-tui-npm-release-check",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
(res) => {
|
|
35
|
+
const status = res.statusCode || 0;
|
|
36
|
+
const location = res.headers.location;
|
|
37
|
+
res.resume();
|
|
38
|
+
if (status >= 300 && status < 400 && location) {
|
|
39
|
+
const next = new URL(location, url).toString();
|
|
40
|
+
resolve(requestStatus(next, method, redirects + 1));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
resolve(status);
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
req.on("error", reject);
|
|
47
|
+
req.end();
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function verifyAsset(url, label) {
|
|
52
|
+
let status = await requestStatus(url, "HEAD");
|
|
53
|
+
if (status === 403 || status === 405) {
|
|
54
|
+
status = await requestStatus(url, "GET");
|
|
55
|
+
}
|
|
56
|
+
if (status < 200 || status >= 400) {
|
|
57
|
+
throw new Error(`${label} returned HTTP ${status} (${url})`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function run() {
|
|
62
|
+
const version = resolveBinaryVersion();
|
|
63
|
+
const repo = resolveRepo();
|
|
64
|
+
const assets = allAssetNames();
|
|
65
|
+
|
|
66
|
+
console.log(`Verifying ${assets.length} release assets for ${repo}@v${version}...`);
|
|
67
|
+
for (const asset of assets) {
|
|
68
|
+
const url = releaseAssetUrl(asset, version, repo);
|
|
69
|
+
await verifyAsset(url, asset);
|
|
70
|
+
console.log(` ok ${asset}`);
|
|
71
|
+
}
|
|
72
|
+
console.log("Release assets verified.");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
run().catch((error) => {
|
|
76
|
+
console.error("Release asset verification failed:", error.message);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
});
|