helpofai 0.8.68 → 0.8.69
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 +2 -2
- package/scripts/artifacts.js +3 -2
- package/scripts/install.js +14 -14
- package/scripts/preflight-glibc.js +2 -1
- package/scripts/run.js +1 -0
- package/scripts/verify-release-assets.js +3 -2
- package/test/artifacts.test.js +1 -0
- package/test/install.test.js +19 -18
- package/test/postinstall.test.js +12 -11
- package/test/run.test.js +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "helpofai",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"helpofaiBinaryVersion": "0.8.
|
|
3
|
+
"version": "0.8.69",
|
|
4
|
+
"helpofaiBinaryVersion": "0.8.69",
|
|
5
5
|
"description": "Install and run HelpOfAi, the agentic terminal for open-source and open-weight coding models, from GitHub release artifacts.",
|
|
6
6
|
"author": "helpofai",
|
|
7
7
|
"license": "MIT",
|
package/scripts/artifacts.js
CHANGED
|
@@ -80,10 +80,10 @@ function executableName(base, platform) {
|
|
|
80
80
|
|
|
81
81
|
function releaseBaseUrl(version, repo = "helpofai/HelpOfAi-Cli") {
|
|
82
82
|
// HELPOFAI_RELEASE_BASE_URL is the canonical override.
|
|
83
|
-
//
|
|
83
|
+
// HELPOFAI_RELEASE_BASE_URL / DEEPSEEK_RELEASE_BASE_URL are legacy aliases.
|
|
84
84
|
const override =
|
|
85
85
|
process.env.HELPOFAI_RELEASE_BASE_URL ||
|
|
86
|
-
process.env.
|
|
86
|
+
process.env.HELPOFAI_RELEASE_BASE_URL ||
|
|
87
87
|
process.env.DEEPSEEK_RELEASE_BASE_URL;
|
|
88
88
|
if (override) {
|
|
89
89
|
const trimmed = String(override).trim();
|
|
@@ -134,3 +134,4 @@ module.exports = {
|
|
|
134
134
|
releaseBaseUrl,
|
|
135
135
|
releaseBinaryDirectory,
|
|
136
136
|
};
|
|
137
|
+
|
package/scripts/install.js
CHANGED
|
@@ -80,7 +80,7 @@ class DownloadTimeoutError extends Error {
|
|
|
80
80
|
|
|
81
81
|
function resolvePackageVersion() {
|
|
82
82
|
const configuredVersion =
|
|
83
|
-
process.env.
|
|
83
|
+
process.env.HELPOFAI_VERSION ||
|
|
84
84
|
process.env.DEEPSEEK_VERSION ||
|
|
85
85
|
pkg.deepseekBinaryVersion ||
|
|
86
86
|
pkg.version;
|
|
@@ -88,13 +88,13 @@ function resolvePackageVersion() {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
function resolveRepo() {
|
|
91
|
-
return process.env.
|
|
91
|
+
return process.env.HELPOFAI_GITHUB_REPO || process.env.DEEPSEEK_GITHUB_REPO || "helpofai/HelpOfAi-Cli";
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
function isOptionalInstall(argv = process.argv.slice(2), env = process.env) {
|
|
95
95
|
return (
|
|
96
96
|
argv.includes("--optional") ||
|
|
97
|
-
env.
|
|
97
|
+
env.HELPOFAI_OPTIONAL_INSTALL === "1" ||
|
|
98
98
|
env.DEEPSEEK_OPTIONAL_INSTALL === "1"
|
|
99
99
|
);
|
|
100
100
|
}
|
|
@@ -155,7 +155,7 @@ function binaryPaths() {
|
|
|
155
155
|
// ────────────────────────────────────────────────────────────────────────────
|
|
156
156
|
|
|
157
157
|
function isQuietInstall() {
|
|
158
|
-
if (process.env.
|
|
158
|
+
if (process.env.HELPOFAI_QUIET_INSTALL === "1") {
|
|
159
159
|
return true;
|
|
160
160
|
}
|
|
161
161
|
const level = (process.env.npm_config_loglevel || "").toLowerCase();
|
|
@@ -173,7 +173,7 @@ function installFailureHint(error) {
|
|
|
173
173
|
const message = error && error.message ? String(error.message) : "";
|
|
174
174
|
const code = error && error.code ? String(error.code) : "";
|
|
175
175
|
const releaseBase =
|
|
176
|
-
process.env.
|
|
176
|
+
process.env.HELPOFAI_RELEASE_BASE_URL ||
|
|
177
177
|
process.env.DEEPSEEK_RELEASE_BASE_URL;
|
|
178
178
|
const networkMarkers = [
|
|
179
179
|
"github.com",
|
|
@@ -195,7 +195,7 @@ function installFailureHint(error) {
|
|
|
195
195
|
if (releaseBase) {
|
|
196
196
|
return [
|
|
197
197
|
"helpofai install hint:",
|
|
198
|
-
`
|
|
198
|
+
` HELPOFAI_RELEASE_BASE_URL is set to ${releaseBase}`,
|
|
199
199
|
" Verify that this directory contains helpofai-artifacts-sha256.txt",
|
|
200
200
|
" plus the helpofai/helpofai-tui binary assets for your platform.",
|
|
201
201
|
].join("\n");
|
|
@@ -205,7 +205,7 @@ function installFailureHint(error) {
|
|
|
205
205
|
"helpofai install hint:",
|
|
206
206
|
" The npm package downloads prebuilt binaries from GitHub Releases.",
|
|
207
207
|
" If GitHub is unavailable on this network, mirror the release assets and set:",
|
|
208
|
-
"
|
|
208
|
+
" HELPOFAI_RELEASE_BASE_URL=https://<mirror>/<release-asset-directory>/",
|
|
209
209
|
" The directory must contain helpofai-artifacts-sha256.txt and the platform binaries.",
|
|
210
210
|
" See docs/INSTALL.md#npm-binary-download-times-out.",
|
|
211
211
|
].join("\n");
|
|
@@ -225,14 +225,14 @@ function envInt(name, fallback) {
|
|
|
225
225
|
|
|
226
226
|
function downloadTimeoutMs(context = "runtime") {
|
|
227
227
|
return envInt(
|
|
228
|
-
"
|
|
228
|
+
"HELPOFAI_DOWNLOAD_TIMEOUT_MS",
|
|
229
229
|
envInt("DEEPSEEK_DOWNLOAD_TIMEOUT_MS", defaultTimeoutMs(context)),
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
function downloadStallMs(context = "runtime") {
|
|
234
234
|
return envInt(
|
|
235
|
-
"
|
|
235
|
+
"HELPOFAI_DOWNLOAD_STALL_MS",
|
|
236
236
|
envInt("DEEPSEEK_DOWNLOAD_STALL_MS", defaultStallMs(context)),
|
|
237
237
|
);
|
|
238
238
|
}
|
|
@@ -531,7 +531,7 @@ function httpRequest(rawUrl, opts = {}) {
|
|
|
531
531
|
totalTimer = setTimeout(() => {
|
|
532
532
|
fail(new DownloadTimeoutError(
|
|
533
533
|
`download exceeded total timeout of ${totalTimeoutMs} ms ` +
|
|
534
|
-
`(set
|
|
534
|
+
`(set HELPOFAI_DOWNLOAD_TIMEOUT_MS to raise it; current stall budget is ${stallMs} ms)`,
|
|
535
535
|
));
|
|
536
536
|
}, totalTimeoutMs);
|
|
537
537
|
}
|
|
@@ -542,7 +542,7 @@ function httpRequest(rawUrl, opts = {}) {
|
|
|
542
542
|
stallTimer = setTimeout(() => {
|
|
543
543
|
fail(new DownloadTimeoutError(
|
|
544
544
|
`download stalled — no bytes received for ${stallMs} ms ` +
|
|
545
|
-
`(set
|
|
545
|
+
`(set HELPOFAI_DOWNLOAD_STALL_MS to raise it; total budget is ${totalTimeoutMs} ms)`,
|
|
546
546
|
));
|
|
547
547
|
}, stallMs);
|
|
548
548
|
};
|
|
@@ -1055,7 +1055,7 @@ async function adoptExistingBinaryIfValid(targetPath, assetName, version, getChe
|
|
|
1055
1055
|
async function ensureBinary(targetPath, assetName, version, repo, getChecksums, options = {}) {
|
|
1056
1056
|
const marker = `${targetPath}.version`;
|
|
1057
1057
|
const downloadIfNeeded =
|
|
1058
|
-
process.env.
|
|
1058
|
+
process.env.HELPOFAI_FORCE_DOWNLOAD === "1" || process.env.DEEPSEEK_FORCE_DOWNLOAD === "1";
|
|
1059
1059
|
if (!downloadIfNeeded) {
|
|
1060
1060
|
const existing = await fileExists(targetPath);
|
|
1061
1061
|
if (existing) {
|
|
@@ -1106,7 +1106,7 @@ function shouldIgnoreInstallFailure(
|
|
|
1106
1106
|
async function run(options = {}) {
|
|
1107
1107
|
const context =
|
|
1108
1108
|
options.context === undefined || options.context === null ? "runtime" : options.context;
|
|
1109
|
-
if (process.env.
|
|
1109
|
+
if (process.env.HELPOFAI_DISABLE_INSTALL === "1" || process.env.DEEPSEEK_DISABLE_INSTALL === "1") {
|
|
1110
1110
|
return;
|
|
1111
1111
|
}
|
|
1112
1112
|
if (shouldSkipOptionalPostinstall(context)) {
|
|
@@ -1179,4 +1179,4 @@ if (require.main === module) {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
process.exit(1);
|
|
1181
1181
|
});
|
|
1182
|
-
}
|
|
1182
|
+
}
|
|
@@ -86,7 +86,6 @@ function buildFromSourceHint() {
|
|
|
86
86
|
function skipGlibcCheck() {
|
|
87
87
|
return (
|
|
88
88
|
process.env.HELPOFAI_SKIP_GLIBC_CHECK === "1" ||
|
|
89
|
-
process.env.DEEPSEEK_TUI_SKIP_GLIBC_CHECK === "1" ||
|
|
90
89
|
process.env.DEEPSEEK_SKIP_GLIBC_CHECK === "1"
|
|
91
90
|
);
|
|
92
91
|
}
|
|
@@ -145,3 +144,5 @@ module.exports = {
|
|
|
145
144
|
skipGlibcCheck,
|
|
146
145
|
},
|
|
147
146
|
};
|
|
147
|
+
|
|
148
|
+
|
package/scripts/run.js
CHANGED
|
@@ -11,7 +11,7 @@ const pkg = require("../package.json");
|
|
|
11
11
|
|
|
12
12
|
function resolveBinaryVersion() {
|
|
13
13
|
const configuredVersion =
|
|
14
|
-
process.env.
|
|
14
|
+
process.env.HELPOFAI_VERSION ||
|
|
15
15
|
process.env.DEEPSEEK_VERSION ||
|
|
16
16
|
pkg.helpofaiBinaryVersion || pkg.deepseekBinaryVersion ||
|
|
17
17
|
pkg.version;
|
|
@@ -19,7 +19,7 @@ function resolveBinaryVersion() {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function resolveRepo() {
|
|
22
|
-
return process.env.
|
|
22
|
+
return process.env.HELPOFAI_GITHUB_REPO || process.env.DEEPSEEK_GITHUB_REPO || "helpofai/HelpOfAi-Cli";
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
function requestStatus(url, method = "HEAD", redirects = 0) {
|
|
@@ -138,3 +138,4 @@ run().catch((error) => {
|
|
|
138
138
|
console.error("Release asset verification failed:", error.message);
|
|
139
139
|
process.exit(1);
|
|
140
140
|
});
|
|
141
|
+
|
package/test/artifacts.test.js
CHANGED
package/test/install.test.js
CHANGED
|
@@ -30,17 +30,17 @@ async function exists(file) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
async function withoutForcedDownload(callback) {
|
|
33
|
-
const previousTui = process.env.
|
|
33
|
+
const previousTui = process.env.HELPOFAI_FORCE_DOWNLOAD;
|
|
34
34
|
const previousLegacy = process.env.DEEPSEEK_FORCE_DOWNLOAD;
|
|
35
|
-
delete process.env.
|
|
35
|
+
delete process.env.HELPOFAI_FORCE_DOWNLOAD;
|
|
36
36
|
delete process.env.DEEPSEEK_FORCE_DOWNLOAD;
|
|
37
37
|
try {
|
|
38
38
|
return await callback();
|
|
39
39
|
} finally {
|
|
40
40
|
if (previousTui === undefined) {
|
|
41
|
-
delete process.env.
|
|
41
|
+
delete process.env.HELPOFAI_FORCE_DOWNLOAD;
|
|
42
42
|
} else {
|
|
43
|
-
process.env.
|
|
43
|
+
process.env.HELPOFAI_FORCE_DOWNLOAD = previousTui;
|
|
44
44
|
}
|
|
45
45
|
if (previousLegacy === undefined) {
|
|
46
46
|
delete process.env.DEEPSEEK_FORCE_DOWNLOAD;
|
|
@@ -65,8 +65,8 @@ test("install script remains parseable before the Node support guard runs", () =
|
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
test("install failure hint explains release base override for blocked GitHub downloads", () => {
|
|
68
|
-
const previous = process.env.
|
|
69
|
-
delete process.env.
|
|
68
|
+
const previous = process.env.HELPOFAI_RELEASE_BASE_URL;
|
|
69
|
+
delete process.env.HELPOFAI_RELEASE_BASE_URL;
|
|
70
70
|
try {
|
|
71
71
|
const error = Object.assign(
|
|
72
72
|
new Error(
|
|
@@ -77,22 +77,22 @@ test("install failure hint explains release base override for blocked GitHub dow
|
|
|
77
77
|
|
|
78
78
|
const hint = installFailureHint(error);
|
|
79
79
|
|
|
80
|
-
assert.match(hint, /
|
|
80
|
+
assert.match(hint, /HELPOFAI_RELEASE_BASE_URL/);
|
|
81
81
|
assert.match(hint, /helpofai-artifacts-sha256\.txt/);
|
|
82
82
|
assert.match(hint, /platform binaries/);
|
|
83
83
|
assert.match(hint, /#npm-binary-download-times-out/);
|
|
84
84
|
} finally {
|
|
85
85
|
if (previous === undefined) {
|
|
86
|
-
delete process.env.
|
|
86
|
+
delete process.env.HELPOFAI_RELEASE_BASE_URL;
|
|
87
87
|
} else {
|
|
88
|
-
process.env.
|
|
88
|
+
process.env.HELPOFAI_RELEASE_BASE_URL = previous;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
test("install failure hint checks configured release base when override is already set", () => {
|
|
94
|
-
const previous = process.env.
|
|
95
|
-
process.env.
|
|
94
|
+
const previous = process.env.HELPOFAI_RELEASE_BASE_URL;
|
|
95
|
+
process.env.HELPOFAI_RELEASE_BASE_URL = "https://mirror.example/deepseek/";
|
|
96
96
|
try {
|
|
97
97
|
const error = Object.assign(new Error("download stalled"), {
|
|
98
98
|
code: "EDOWNLOADTIMEOUT",
|
|
@@ -105,9 +105,9 @@ test("install failure hint checks configured release base when override is alrea
|
|
|
105
105
|
assert.doesNotMatch(hint, /If GitHub is unavailable/);
|
|
106
106
|
} finally {
|
|
107
107
|
if (previous === undefined) {
|
|
108
|
-
delete process.env.
|
|
108
|
+
delete process.env.HELPOFAI_RELEASE_BASE_URL;
|
|
109
109
|
} else {
|
|
110
|
-
process.env.
|
|
110
|
+
process.env.HELPOFAI_RELEASE_BASE_URL = previous;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
});
|
|
@@ -124,17 +124,17 @@ test("glibc preflight message is HelpOfAi-branded and actionable", () => {
|
|
|
124
124
|
|
|
125
125
|
test("glibc preflight accepts canonical and legacy skip env vars", () => {
|
|
126
126
|
const previousCodewhale = process.env.HELPOFAI_SKIP_GLIBC_CHECK;
|
|
127
|
-
const previousTui = process.env.
|
|
127
|
+
const previousTui = process.env.HELPOFAI_SKIP_GLIBC_CHECK;
|
|
128
128
|
const previousLegacy = process.env.DEEPSEEK_SKIP_GLIBC_CHECK;
|
|
129
129
|
delete process.env.HELPOFAI_SKIP_GLIBC_CHECK;
|
|
130
|
-
delete process.env.
|
|
130
|
+
delete process.env.HELPOFAI_SKIP_GLIBC_CHECK;
|
|
131
131
|
delete process.env.DEEPSEEK_SKIP_GLIBC_CHECK;
|
|
132
132
|
try {
|
|
133
133
|
assert.equal(glibcInternal.skipGlibcCheck(), false);
|
|
134
134
|
process.env.HELPOFAI_SKIP_GLIBC_CHECK = "1";
|
|
135
135
|
assert.equal(glibcInternal.skipGlibcCheck(), true);
|
|
136
136
|
delete process.env.HELPOFAI_SKIP_GLIBC_CHECK;
|
|
137
|
-
process.env.
|
|
137
|
+
process.env.HELPOFAI_SKIP_GLIBC_CHECK = "1";
|
|
138
138
|
assert.equal(glibcInternal.skipGlibcCheck(), true);
|
|
139
139
|
} finally {
|
|
140
140
|
if (previousCodewhale === undefined) {
|
|
@@ -143,9 +143,9 @@ test("glibc preflight accepts canonical and legacy skip env vars", () => {
|
|
|
143
143
|
process.env.HELPOFAI_SKIP_GLIBC_CHECK = previousCodewhale;
|
|
144
144
|
}
|
|
145
145
|
if (previousTui === undefined) {
|
|
146
|
-
delete process.env.
|
|
146
|
+
delete process.env.HELPOFAI_SKIP_GLIBC_CHECK;
|
|
147
147
|
} else {
|
|
148
|
-
process.env.
|
|
148
|
+
process.env.HELPOFAI_SKIP_GLIBC_CHECK = previousTui;
|
|
149
149
|
}
|
|
150
150
|
if (previousLegacy === undefined) {
|
|
151
151
|
delete process.env.DEEPSEEK_SKIP_GLIBC_CHECK;
|
|
@@ -222,3 +222,4 @@ test("manual binaries with mismatched checksums are not adopted", async (t) => {
|
|
|
222
222
|
assert.equal(adopted, false);
|
|
223
223
|
assert.equal(await exists(`${target}.version`), false);
|
|
224
224
|
});
|
|
225
|
+
|
package/test/postinstall.test.js
CHANGED
|
@@ -11,17 +11,17 @@ test("postinstall opts into optional install mode", () => {
|
|
|
11
11
|
test("optional install can be enabled by command-line flag or env", () => {
|
|
12
12
|
assert.equal(_internal.isOptionalInstall(["--optional"], {}), true);
|
|
13
13
|
assert.equal(_internal.isOptionalInstall([], {}), false);
|
|
14
|
-
assert.equal(_internal.isOptionalInstall([], {
|
|
14
|
+
assert.equal(_internal.isOptionalInstall([], { HELPOFAI_OPTIONAL_INSTALL: "1" }), true);
|
|
15
15
|
assert.equal(_internal.isOptionalInstall([], { DEEPSEEK_OPTIONAL_INSTALL: "1" }), true);
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
test("optional mode only changes install-time defaults", () => {
|
|
19
|
-
assert.equal(_internal.maxAttempts("install", {
|
|
20
|
-
assert.equal(_internal.maxAttempts("runtime", {
|
|
21
|
-
assert.equal(_internal.defaultTimeoutMs("install", {
|
|
22
|
-
assert.equal(_internal.defaultTimeoutMs("runtime", {
|
|
23
|
-
assert.equal(_internal.defaultStallMs("install", {
|
|
24
|
-
assert.equal(_internal.defaultStallMs("runtime", {
|
|
19
|
+
assert.equal(_internal.maxAttempts("install", { HELPOFAI_OPTIONAL_INSTALL: "1" }), 1);
|
|
20
|
+
assert.equal(_internal.maxAttempts("runtime", { HELPOFAI_OPTIONAL_INSTALL: "1" }), 5);
|
|
21
|
+
assert.equal(_internal.defaultTimeoutMs("install", { HELPOFAI_OPTIONAL_INSTALL: "1" }), 15_000);
|
|
22
|
+
assert.equal(_internal.defaultTimeoutMs("runtime", { HELPOFAI_OPTIONAL_INSTALL: "1" }), 300_000);
|
|
23
|
+
assert.equal(_internal.defaultStallMs("install", { HELPOFAI_OPTIONAL_INSTALL: "1" }), 5_000);
|
|
24
|
+
assert.equal(_internal.defaultStallMs("runtime", { HELPOFAI_OPTIONAL_INSTALL: "1" }), 30_000);
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
test("pnpm optional postinstall skips install-time download", () => {
|
|
@@ -87,8 +87,8 @@ test("optional install only swallows retryable download failures", () => {
|
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
test("optional install still swallows wrapped http 5xx failures", async () => {
|
|
90
|
-
const previous = process.env.
|
|
91
|
-
process.env.
|
|
90
|
+
const previous = process.env.HELPOFAI_OPTIONAL_INSTALL;
|
|
91
|
+
process.env.HELPOFAI_OPTIONAL_INSTALL = "1";
|
|
92
92
|
const http5xx = new Error("Request failed with status 502: https://example.invalid");
|
|
93
93
|
http5xx.name = "HttpStatusError";
|
|
94
94
|
http5xx.status = 502;
|
|
@@ -110,9 +110,9 @@ test("optional install still swallows wrapped http 5xx failures", async () => {
|
|
|
110
110
|
);
|
|
111
111
|
} finally {
|
|
112
112
|
if (previous === undefined) {
|
|
113
|
-
delete process.env.
|
|
113
|
+
delete process.env.HELPOFAI_OPTIONAL_INSTALL;
|
|
114
114
|
} else {
|
|
115
|
-
process.env.
|
|
115
|
+
process.env.HELPOFAI_OPTIONAL_INSTALL = previous;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
});
|
|
@@ -155,3 +155,4 @@ test("withRetry prints install hint on first retryable failure", async () => {
|
|
|
155
155
|
global.setTimeout = previousSetTimeout;
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
|
+
|
package/test/run.test.js
CHANGED