@nuwax-ai/nuwax-harness 0.18.66 → 0.18.67
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 +2 -1
- package/bin/runtime.js +15 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,8 @@ Anthropic 使用 `NUWAX_WIRE_API=anthropic`;原生 Responses 使用
|
|
|
26
26
|
|
|
27
27
|
默认数据目录为 `~/.nuwax-harness`;显式 `CODEX_HOME` 优先且须为已存在目录。
|
|
28
28
|
不读取或迁移旧数据目录。下载缓存为 `~/.nuwax-harness-cache`,包含同版本的配套辅助程序,
|
|
29
|
-
请勿只复制主二进制而丢弃 helper
|
|
29
|
+
请勿只复制主二进制而丢弃 helper。容器等运行期 `HOME` 与安装期不一致时,可用绝对路径
|
|
30
|
+
`NUWAX_HARNESS_CACHE_DIR` 覆盖缓存根目录(ACP 适配器读同一个变量)。
|
|
30
31
|
|
|
31
32
|
完整参数、ACP 启动、Linux/容器、Windows 与排查示例见
|
|
32
33
|
[环境变量启动指南](https://github.com/nuwax-ai/codex/tree/test#nuwax-harness)。
|
package/bin/runtime.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Shared native bundle installer for postinstall and both npm commands.
|
|
2
2
|
import { createWriteStream, existsSync, mkdirSync, mkdtempSync, renameSync, rmdirSync, rmSync, statSync } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
|
-
import { basename, dirname, join } from "node:path";
|
|
4
|
+
import { basename, dirname, isAbsolute, join } from "node:path";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { Readable } from "node:stream";
|
|
7
7
|
import { pipeline } from "node:stream/promises";
|
|
@@ -145,9 +145,22 @@ async function publishBundle(stagingDirectory, directory, stagingRoot) {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
// The cache root is shared with the ACP adapter: both read this variable and
|
|
149
|
+
// otherwise fall back to the same per-user directory. Blank counts as unset.
|
|
150
|
+
const CACHE_DIR_ENV = "NUWAX_HARNESS_CACHE_DIR";
|
|
151
|
+
|
|
152
|
+
function cacheRoot() {
|
|
153
|
+
const override = process.env[CACHE_DIR_ENV]?.trim();
|
|
154
|
+
if (!override) return join(homedir(), ".nuwax-harness-cache");
|
|
155
|
+
if (!isAbsolute(override)) {
|
|
156
|
+
throw new Error(`${CACHE_DIR_ENV} must be an absolute path, got "${override}".`);
|
|
157
|
+
}
|
|
158
|
+
return override;
|
|
159
|
+
}
|
|
160
|
+
|
|
148
161
|
export async function ensureBinary() {
|
|
149
162
|
const target = getTargetTriple();
|
|
150
|
-
const directory = join(
|
|
163
|
+
const directory = join(cacheRoot(), VERSION, target);
|
|
151
164
|
const binaryPath = join(directory, requiredBundleFiles()[0]);
|
|
152
165
|
if (missingBundleFiles(directory).length === 0) return binaryPath;
|
|
153
166
|
|