deepseek-tui 0.8.35 → 0.8.37

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "deepseek-tui",
3
- "version": "0.8.35",
4
- "deepseekBinaryVersion": "0.8.35",
3
+ "version": "0.8.37",
4
+ "deepseekBinaryVersion": "0.8.37",
5
5
  "description": "Install and run deepseek and deepseek-tui binaries from GitHub release artifacts.",
6
6
  "author": "Hmbown",
7
7
  "license": "MIT",
@@ -103,6 +103,18 @@ function isInstallContext(context) {
103
103
  return context === "install";
104
104
  }
105
105
 
106
+ function isPnpmUserAgent(env = process.env) {
107
+ return String(env.npm_config_user_agent || "").toLowerCase().includes("pnpm/");
108
+ }
109
+
110
+ function shouldSkipOptionalPostinstall(
111
+ context,
112
+ argv = process.argv.slice(2),
113
+ env = process.env,
114
+ ) {
115
+ return isInstallContext(context) && isOptionalInstall(argv, env) && isPnpmUserAgent(env);
116
+ }
117
+
106
118
  // Optional install only relaxes npm postinstall behavior. Runtime downloads
107
119
  // keep the normal retry/timeout budget so first-run recovery stays resilient.
108
120
  function defaultTimeoutMs(context = "runtime", env = process.env) {
@@ -1089,6 +1101,12 @@ async function run(options = {}) {
1089
1101
  if (process.env.DEEPSEEK_TUI_DISABLE_INSTALL === "1" || process.env.DEEPSEEK_DISABLE_INSTALL === "1") {
1090
1102
  return;
1091
1103
  }
1104
+ if (shouldSkipOptionalPostinstall(context)) {
1105
+ logInfo(
1106
+ "pnpm optional postinstall detected; skipping install-time download. The binary will be checked on first run.",
1107
+ );
1108
+ return;
1109
+ }
1092
1110
  const version = resolvePackageVersion();
1093
1111
  const repo = resolveRepo();
1094
1112
  const paths = binaryPaths();
@@ -1129,6 +1147,7 @@ module.exports = {
1129
1147
  isOptionalInstall,
1130
1148
  adoptExistingBinaryIfValid,
1131
1149
  shouldIgnoreInstallFailure,
1150
+ shouldSkipOptionalPostinstall,
1132
1151
  defaultTimeoutMs,
1133
1152
  defaultStallMs,
1134
1153
  ensureBinary,
@@ -24,6 +24,33 @@ test("optional mode only changes install-time defaults", () => {
24
24
  assert.equal(_internal.defaultStallMs("runtime", { DEEPSEEK_TUI_OPTIONAL_INSTALL: "1" }), 30_000);
25
25
  });
26
26
 
27
+ test("pnpm optional postinstall skips install-time download", () => {
28
+ assert.equal(
29
+ _internal.shouldSkipOptionalPostinstall("install", ["--optional"], {
30
+ npm_config_user_agent: "pnpm/10.11.0 npm/? node/v22.15.0 win32 x64",
31
+ }),
32
+ true,
33
+ );
34
+ assert.equal(
35
+ _internal.shouldSkipOptionalPostinstall("runtime", ["--optional"], {
36
+ npm_config_user_agent: "pnpm/10.11.0 npm/? node/v22.15.0 win32 x64",
37
+ }),
38
+ false,
39
+ );
40
+ assert.equal(
41
+ _internal.shouldSkipOptionalPostinstall("install", [], {
42
+ npm_config_user_agent: "pnpm/10.11.0 npm/? node/v22.15.0 win32 x64",
43
+ }),
44
+ false,
45
+ );
46
+ assert.equal(
47
+ _internal.shouldSkipOptionalPostinstall("install", ["--optional"], {
48
+ npm_config_user_agent: "npm/11.3.0 node/v22.15.0 win32 x64",
49
+ }),
50
+ false,
51
+ );
52
+ });
53
+
27
54
  test("optional install only swallows retryable download failures", () => {
28
55
  const socketHangUp = new Error("socket hang up");
29
56
  assert.equal(