@tablation/crew 0.130.4 → 0.130.5
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/dist/cli.js +30 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1267,9 +1267,13 @@ function inferenceHeaders(inf) {
|
|
|
1267
1267
|
];
|
|
1268
1268
|
return lines2.length > 0 ? lines2.join("\n") : void 0;
|
|
1269
1269
|
}
|
|
1270
|
-
function workspaceSettings(baseUrl) {
|
|
1270
|
+
function workspaceSettings(baseUrl, headers) {
|
|
1271
1271
|
const blank = BILLING_VARS_TO_UNSET.filter((v) => v !== "ANTHROPIC_AUTH_TOKEN");
|
|
1272
|
-
return JSON.stringify({ env: {
|
|
1272
|
+
return JSON.stringify({ env: {
|
|
1273
|
+
...Object.fromEntries(blank.map((v) => [v, ""])),
|
|
1274
|
+
ANTHROPIC_BASE_URL: baseUrl,
|
|
1275
|
+
...headers ? { ANTHROPIC_CUSTOM_HEADERS: headers } : {}
|
|
1276
|
+
} });
|
|
1273
1277
|
}
|
|
1274
1278
|
function subscriptionSettings() {
|
|
1275
1279
|
return JSON.stringify({ env: Object.fromEntries(BILLING_VARS_TO_UNSET.map((v) => [v, ""])) });
|
|
@@ -1355,7 +1359,7 @@ var claudeAdapter = {
|
|
|
1355
1359
|
// which denies the LSP tool above.
|
|
1356
1360
|
...isOmlxLauncher(spec) ? [] : (o.pluginDirs ?? []).flatMap((d) => ["--plugin-dir", d]),
|
|
1357
1361
|
...spec.auth === "subscription" ? ["--settings", subscriptionSettings()] : [],
|
|
1358
|
-
...spec.auth === "workspace" && spec.inference ? ["--settings", workspaceSettings(spec.inference.baseUrl)] : [],
|
|
1362
|
+
...spec.auth === "workspace" && spec.inference ? ["--settings", workspaceSettings(spec.inference.baseUrl, inferenceHeaders(spec.inference))] : [],
|
|
1359
1363
|
...spec.args
|
|
1360
1364
|
];
|
|
1361
1365
|
return wrapInvocation(spec, { model: o.model, args });
|
|
@@ -1372,8 +1376,7 @@ var claudeAdapter = {
|
|
|
1372
1376
|
...spec.auth === "workspace" ? withoutProviderVars(spec.env) : spec.env,
|
|
1373
1377
|
...spec.auth === "workspace" && spec.inference ? {
|
|
1374
1378
|
ANTHROPIC_BASE_URL: spec.inference.baseUrl,
|
|
1375
|
-
ANTHROPIC_AUTH_TOKEN: spec.inference.token
|
|
1376
|
-
...inferenceHeaders(spec.inference) ? { ANTHROPIC_CUSTOM_HEADERS: inferenceHeaders(spec.inference) } : {}
|
|
1379
|
+
ANTHROPIC_AUTH_TOKEN: spec.inference.token
|
|
1377
1380
|
} : {}
|
|
1378
1381
|
};
|
|
1379
1382
|
},
|
|
@@ -2427,8 +2430,14 @@ function gitCredentialEnv(o, base = process.env) {
|
|
|
2427
2430
|
return out;
|
|
2428
2431
|
}
|
|
2429
2432
|
var shq = (v) => `'${v.replace(/'/g, `'\\''`)}'`;
|
|
2430
|
-
function
|
|
2431
|
-
|
|
2433
|
+
function isCompiledCrew(p) {
|
|
2434
|
+
const entry = p.argv[1];
|
|
2435
|
+
if (entry === void 0) return true;
|
|
2436
|
+
return entry.startsWith("/$bunfs/") || entry.includes("/~BUN/") || entry === p.execPath;
|
|
2437
|
+
}
|
|
2438
|
+
function crewCommandLine(p = process) {
|
|
2439
|
+
const parts = isCompiledCrew(p) ? [p.execPath] : [p.execPath, ...p.execArgv, p.argv[1]];
|
|
2440
|
+
return parts.map(shq).join(" ");
|
|
2432
2441
|
}
|
|
2433
2442
|
function tokenEnvFor(host, token) {
|
|
2434
2443
|
const out = { CREW_FORGE_TOKEN: token };
|
|
@@ -11662,6 +11671,9 @@ var SandboxRunner = class {
|
|
|
11662
11671
|
const { cfg } = this;
|
|
11663
11672
|
const secretKeys = Object.keys(plan.setEnv);
|
|
11664
11673
|
if (cfg.forgeTokenVar && o.env[cfg.forgeTokenVar] !== void 0 && !secretKeys.includes(cfg.forgeTokenVar)) secretKeys.push(cfg.forgeTokenVar);
|
|
11674
|
+
for (const [k, v] of Object.entries(plan.setEnv)) {
|
|
11675
|
+
if (/[\r\n]/.test(v)) throw new Error(`the sandbox environment variable ${k} contains a newline, which the sandbox gateway refuses`);
|
|
11676
|
+
}
|
|
11665
11677
|
const createEnv = { ...process.env, ...plan.setEnv };
|
|
11666
11678
|
if (cfg.forgeTokenVar && o.env[cfg.forgeTokenVar] !== void 0) createEnv[cfg.forgeTokenVar] = o.env[cfg.forgeTokenVar];
|
|
11667
11679
|
let policyFile = cfg.policy;
|
|
@@ -13972,6 +13984,16 @@ function formatToolCheck(t) {
|
|
|
13972
13984
|
return `${label}${t.need === "required" ? "NOT FOUND" : "not found"} [${t.need}] \u2014 ${t.hint}
|
|
13973
13985
|
`;
|
|
13974
13986
|
}
|
|
13987
|
+
function probeCredentialHelper(command2, run3 = realHelperRun) {
|
|
13988
|
+
const r = run3(`${command2} credential get --no-miss`, "protocol=https\nhost=crew-probe.invalid\n\n");
|
|
13989
|
+
if (r.status === 0 && !/unknown command|usage:/i.test(r.stderr)) return { state: "ok" };
|
|
13990
|
+
const why = r.stderr.trim().split("\n")[0] || `exit ${r.status}`;
|
|
13991
|
+
return { state: "failed", detail: `the git credential helper command does not run: ${why}`, hint: "reinstall crew; git cannot authenticate to a private repository until this works" };
|
|
13992
|
+
}
|
|
13993
|
+
var realHelperRun = (cmd, input) => {
|
|
13994
|
+
const r = spawnSync8("sh", ["-c", cmd], { input, encoding: "utf8", timeout: 15e3 });
|
|
13995
|
+
return { status: r.status, stderr: r.stderr ?? (r.error ? String(r.error) : "") };
|
|
13996
|
+
};
|
|
13975
13997
|
function formatPushAuth(repo, r) {
|
|
13976
13998
|
const label = `push auth ${repo}:`.padEnd(19);
|
|
13977
13999
|
if (r.state === "ok") return `${label}ok
|
|
@@ -31684,6 +31706,7 @@ crew manifest: ${seats2.length ? seats2.map((c) => c.name).join(", ") : "non
|
|
|
31684
31706
|
if (ov.toolchain) process.stdout.write(`repo toolchain: ${repoName} \u2192 ${ov.toolchain} (binary and MCP checked above, as for every ship toolchain)
|
|
31685
31707
|
`);
|
|
31686
31708
|
}
|
|
31709
|
+
if (cfg.ship.forges) process.stdout.write(formatPushAuth("credential helper", probeCredentialHelper(crewCommandLine())).replace("push auth credential helper:", "credential helper:".padEnd(19)));
|
|
31687
31710
|
for (const p of pushAuth) process.stdout.write(formatPushAuth(`${p.repo}`, p.result));
|
|
31688
31711
|
for (const t of toolRows) process.stdout.write(formatToolCheck(t));
|
|
31689
31712
|
process.stdout.write(`git: ${gitPath ? `OK (${gitPath})` : "NOT FOUND on the scheduler PATH"}
|
package/package.json
CHANGED