@nuwax-ai/nuwax-harness 0.18.80 → 0.18.82
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/postinstall.js +4 -4
- package/bin/runtime.js +30 -0
- package/package.json +1 -1
package/bin/postinstall.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { installBundle } from "./runtime.js";
|
|
3
3
|
|
|
4
4
|
try {
|
|
5
|
-
const binaryPath = await
|
|
5
|
+
const binaryPath = await installBundle();
|
|
6
6
|
console.error(`nuwax-harness ready at ${binaryPath}`);
|
|
7
7
|
} catch (error) {
|
|
8
|
-
// Installation remains usable offline
|
|
9
|
-
//
|
|
8
|
+
// Installation remains usable offline, but the launcher no longer downloads
|
|
9
|
+
// on first use: it reports the missing files and how to restore them.
|
|
10
10
|
console.error(`nuwax-harness postinstall: ${error.message}`);
|
|
11
11
|
}
|
package/bin/runtime.js
CHANGED
|
@@ -158,7 +158,37 @@ function cacheRoot() {
|
|
|
158
158
|
return override;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Resolves the installed native bundle for a normal command.
|
|
163
|
+
*
|
|
164
|
+
* Fork (2026-12-01): this no longer downloads. Launching the CLI is not an
|
|
165
|
+
* approved egress point — an internal-gateway deployment must not reach the OSS
|
|
166
|
+
* CDN because a cache entry is missing or incomplete. Downloads happen in
|
|
167
|
+
* `installBundle`, which only `postinstall` calls.
|
|
168
|
+
*/
|
|
161
169
|
export async function ensureBinary() {
|
|
170
|
+
const target = getTargetTriple();
|
|
171
|
+
const directory = join(cacheRoot(), VERSION, target);
|
|
172
|
+
const binaryPath = join(directory, requiredBundleFiles()[0]);
|
|
173
|
+
const missing = missingBundleFiles(directory);
|
|
174
|
+
if (missing.length === 0) return binaryPath;
|
|
175
|
+
throw new Error(
|
|
176
|
+
`native bundle for ${VERSION} ${target} is incomplete` +
|
|
177
|
+
(missing.length > 0 ? ` (missing ${missing.join(", ")})` : "") +
|
|
178
|
+
`; cache: ${directory}. Reinstall or rebuild it without launching the CLI, e.g. ` +
|
|
179
|
+
`\`npm rebuild -g @nuwax-ai/nuwax-harness\` (online) or place the recovered ` +
|
|
180
|
+
`${VERSION} ${target} archive in that directory (offline).`,
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Downloads and installs the native bundle for this platform.
|
|
186
|
+
*
|
|
187
|
+
* Called by `postinstall` only: installation is the single approved point for
|
|
188
|
+
* fetching the archive.
|
|
189
|
+
*/
|
|
190
|
+
export async function installBundle() {
|
|
191
|
+
|
|
162
192
|
const target = getTargetTriple();
|
|
163
193
|
const directory = join(cacheRoot(), VERSION, target);
|
|
164
194
|
const binaryPath = join(directory, requiredBundleFiles()[0]);
|