@synkro-sh/cli 1.6.62 → 1.6.64
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/bootstrap.js +37 -11
- package/dist/bootstrap.js.map +1 -1
- package/package.json +1 -1
package/dist/bootstrap.js
CHANGED
|
@@ -10318,7 +10318,7 @@ function writeConfigEnv(opts) {
|
|
|
10318
10318
|
`SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
|
|
10319
10319
|
`SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
|
|
10320
10320
|
`SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
|
|
10321
|
-
`SYNKRO_VERSION=${shellQuoteSingle("1.6.
|
|
10321
|
+
`SYNKRO_VERSION=${shellQuoteSingle("1.6.64")}`
|
|
10322
10322
|
];
|
|
10323
10323
|
if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
|
|
10324
10324
|
if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
|
|
@@ -10350,10 +10350,20 @@ async function provisionCloudContainer(opts) {
|
|
|
10350
10350
|
process.exit(1);
|
|
10351
10351
|
}
|
|
10352
10352
|
const repo = detectGitRepo2() || void 0;
|
|
10353
|
+
const sf = readFullSynkroFile();
|
|
10353
10354
|
const harness = [];
|
|
10354
10355
|
if (opts.hasClaudeCode) harness.push("claude-code");
|
|
10355
10356
|
if (opts.hasCursor) harness.push("cursor");
|
|
10356
|
-
const
|
|
10357
|
+
const envWorkers = parseInt(process.env.SYNKRO_WORKERS_PER_POOL || "", 10);
|
|
10358
|
+
const total = sf?.workers?.claude && sf.workers.claude > 0 ? sf.workers.claude : Number.isFinite(envWorkers) && envWorkers > 0 ? envWorkers : 4;
|
|
10359
|
+
const cursorTotal = sf?.workers?.cursor && sf.workers.cursor > 0 ? sf.workers.cursor : 0;
|
|
10360
|
+
let cursorApiKey = "";
|
|
10361
|
+
if (cursorTotal > 0) {
|
|
10362
|
+
try {
|
|
10363
|
+
cursorApiKey = readFileSync10(join10(SYNKRO_DIR5, "cursor-creds", "api-key"), "utf-8").trim();
|
|
10364
|
+
} catch {
|
|
10365
|
+
}
|
|
10366
|
+
}
|
|
10357
10367
|
try {
|
|
10358
10368
|
const resp = await fetch(`${opts.gatewayUrl}/api/v1/cli/cloud-provision`, {
|
|
10359
10369
|
method: "POST",
|
|
@@ -10364,7 +10374,9 @@ async function provisionCloudContainer(opts) {
|
|
|
10364
10374
|
email: opts.email,
|
|
10365
10375
|
harness,
|
|
10366
10376
|
claude_workers: total,
|
|
10367
|
-
cursor_workers:
|
|
10377
|
+
cursor_workers: cursorTotal,
|
|
10378
|
+
cursor_api_key: cursorApiKey,
|
|
10379
|
+
// never logged; gateway stores it as the org secret
|
|
10368
10380
|
connected_repo: repo,
|
|
10369
10381
|
ruleset: readFullSynkroFile()?.ruleset || "default",
|
|
10370
10382
|
setup_token: setupToken
|
|
@@ -10417,18 +10429,31 @@ async function verifyCloudGrader(jwt2) {
|
|
|
10417
10429
|
body: JSON.stringify({ role: "grade-edit", payload: probe, content: probe, agent_kind: "claude_code" }),
|
|
10418
10430
|
signal: AbortSignal.timeout(12e4)
|
|
10419
10431
|
});
|
|
10420
|
-
const
|
|
10432
|
+
const raw = await r.text();
|
|
10433
|
+
let body = {};
|
|
10434
|
+
try {
|
|
10435
|
+
body = JSON.parse(raw);
|
|
10436
|
+
} catch {
|
|
10437
|
+
}
|
|
10421
10438
|
if (r.ok && typeof body.result === "string" && body.result.includes("<synkro-verdict>")) {
|
|
10422
10439
|
console.log(" \u2713 smoke grade passed \u2014 cloud grading is live\n");
|
|
10423
10440
|
return true;
|
|
10424
10441
|
}
|
|
10425
|
-
|
|
10426
|
-
console.warn(
|
|
10427
|
-
|
|
10442
|
+
const detail = (body.error || raw || "").trim().slice(0, 300) || "(empty response)";
|
|
10443
|
+
console.warn(` \u2717 smoke grade FAILED (HTTP ${r.status}): ${detail}`);
|
|
10444
|
+
if (/no grader worker ready/i.test(detail)) {
|
|
10445
|
+
console.warn(" \u2192 the worker pool never registered (cold-start, or the pool failed to boot).");
|
|
10446
|
+
} else if (/connection lost|network|502/i.test(detail)) {
|
|
10447
|
+
console.warn(" \u2192 the container dropped the connection mid-grade \u2014 the claude worker crashed or hung (most often a bad/expired setup-token).");
|
|
10448
|
+
} else {
|
|
10449
|
+
console.warn(" \u2192 the worker returned an error; most often a bad/expired Claude setup-token.");
|
|
10450
|
+
}
|
|
10451
|
+
console.warn(" Re-run `synkro install` \u2192 cloud to re-authorize the hosted worker.\n");
|
|
10428
10452
|
return false;
|
|
10429
|
-
} catch {
|
|
10430
|
-
|
|
10431
|
-
console.warn(
|
|
10453
|
+
} catch (e) {
|
|
10454
|
+
const reason = e?.name === "TimeoutError" ? "the grade never returned within 120s (worker hung \u2014 usually claude auth)" : `the request failed (${e?.message || "network"})`;
|
|
10455
|
+
console.warn(` \u2717 smoke grade FAILED: ${reason}.`);
|
|
10456
|
+
console.warn(" The container is provisioned but a grade does not complete; re-run `synkro install` \u2192 cloud.\n");
|
|
10432
10457
|
return false;
|
|
10433
10458
|
}
|
|
10434
10459
|
}
|
|
@@ -11077,6 +11102,7 @@ async function installCommand(opts = {}) {
|
|
|
11077
11102
|
}
|
|
11078
11103
|
console.log();
|
|
11079
11104
|
} else if (target === "cloud-container") {
|
|
11105
|
+
if (hasCursor) await promptCursorApiKey(opts);
|
|
11080
11106
|
await provisionCloudContainer({ gatewayUrl, jwt: token, orgId, userId, email, hasClaudeCode, hasCursor });
|
|
11081
11107
|
await verifyCloudGrader(token);
|
|
11082
11108
|
}
|
|
@@ -13836,7 +13862,7 @@ var args = process.argv.slice(2);
|
|
|
13836
13862
|
var cmd = args[0] || "";
|
|
13837
13863
|
var subArgs = args.slice(1);
|
|
13838
13864
|
function printVersion() {
|
|
13839
|
-
console.log("1.6.
|
|
13865
|
+
console.log("1.6.64");
|
|
13840
13866
|
}
|
|
13841
13867
|
function printHelp2() {
|
|
13842
13868
|
console.log(`Synkro CLI \u2014 runtime safety for AI coding agents
|