@synkro-sh/cli 1.6.66 → 1.6.68

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 CHANGED
@@ -9638,12 +9638,25 @@ function captureClaudeSetupToken() {
9638
9638
  let yellow = "";
9639
9639
  let m;
9640
9640
  while ((m = yellowRe.exec(raw)) !== null) yellow += m[1];
9641
- const token = yellow.replace(/\s/g, "").match(/sk-ant-oat01-[A-Za-z0-9_-]+/);
9642
- if (!token) {
9641
+ const yMatch = yellow.replace(/\s/g, "").match(/sk-ant-oat01-[A-Za-z0-9_-]+/);
9642
+ let lineMatch = "";
9643
+ const clean = raw.replace(/\x1B\[[0-9;?]*[a-zA-Z]/g, "").replace(/\x1B\][^\x07]*\x07/g, "");
9644
+ const lines = clean.split("\n").map((l) => l.trim());
9645
+ for (let i = 0; i < lines.length; i++) {
9646
+ const idx = lines[i].indexOf("sk-ant-oat01-");
9647
+ if (idx < 0) continue;
9648
+ let tok = (lines[i].slice(idx).match(/^sk-ant-oat01-[A-Za-z0-9_-]*/) || [""])[0];
9649
+ for (let j = i + 1; j < lines.length && /^[A-Za-z0-9_-]+$/.test(lines[j]); j++) tok += lines[j];
9650
+ lineMatch = tok;
9651
+ break;
9652
+ }
9653
+ const candidates = [yMatch ? yMatch[0] : "", lineMatch].filter((t) => /^sk-ant-oat01-[A-Za-z0-9_-]{20,}$/.test(t));
9654
+ const best = candidates.sort((a, b) => b.length - a.length)[0];
9655
+ if (!best) {
9643
9656
  reject(new Error(`Could not find token in claude setup-token output (file=${raw.length}b, yellow=${yellow.length}b)`));
9644
9657
  return;
9645
9658
  }
9646
- resolve4(token[0]);
9659
+ resolve4(best);
9647
9660
  });
9648
9661
  });
9649
9662
  }
@@ -10318,7 +10331,7 @@ function writeConfigEnv(opts) {
10318
10331
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
10319
10332
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
10320
10333
  `SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
10321
- `SYNKRO_VERSION=${shellQuoteSingle("1.6.66")}`
10334
+ `SYNKRO_VERSION=${shellQuoteSingle("1.6.68")}`
10322
10335
  ];
10323
10336
  if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
10324
10337
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
@@ -10408,12 +10421,18 @@ async function printWorkerDebug(base, jwt2) {
10408
10421
  `);
10409
10422
  return;
10410
10423
  }
10411
- for (const w of d.workers) {
10412
- console.warn(` [${w.worker}] log:`);
10413
- for (const l of String(w.logTail || "").split("\n").filter((l2) => l2.trim()).slice(-10)) console.warn(" " + l.slice(0, 240));
10414
- if (w.pane && !w.pane.startsWith("(no pane")) {
10424
+ for (const w of d.workers.slice(0, 2)) {
10425
+ console.warn(` [${w.worker}] launcher log:`);
10426
+ for (const l of String(w.logTail || "").split("\n").filter((l2) => l2.trim()).slice(-6)) console.warn(" " + l.slice(0, 240));
10427
+ if (w.channelLog && !w.channelLog.startsWith("(no channel")) {
10428
+ console.warn(` [${w.worker}] channel flow (token + grade delivery):`);
10429
+ for (const l of String(w.channelLog).split("\n").filter((l2) => l2.trim()).slice(-12)) console.warn(" " + l.slice(0, 240));
10430
+ } else {
10431
+ console.warn(` [${w.worker}] channel: ${w.channelLog}`);
10432
+ }
10433
+ if (w.pane && !w.pane.startsWith("(")) {
10415
10434
  console.warn(` [${w.worker}] claude screen:`);
10416
- for (const l of String(w.pane).split("\n").filter((l2) => l2.trim()).slice(-14)) console.warn(" " + l.slice(0, 240));
10435
+ for (const l of String(w.pane).split("\n").filter((l2) => l2.trim()).slice(-12)) console.warn(" " + l.slice(0, 240));
10417
10436
  }
10418
10437
  }
10419
10438
  if (Array.isArray(d.sick_pool) && d.sick_pool.length) {
@@ -11051,6 +11070,7 @@ async function installCommand(opts = {}) {
11051
11070
  }
11052
11071
  writeSynkroFileIfMissing({ hasClaudeCode, hasCursor, gradingMode, deployLocation });
11053
11072
  console.log();
11073
+ let cloudGradeOk = null;
11054
11074
  if (useLocalMcp) {
11055
11075
  const { assertDockerAvailable: assertDockerAvailable2 } = await Promise.resolve().then(() => (init_dockerInstall(), dockerInstall_exports));
11056
11076
  try {
@@ -11133,7 +11153,7 @@ async function installCommand(opts = {}) {
11133
11153
  } else if (target === "cloud-container") {
11134
11154
  if (hasCursor) await promptCursorApiKey(opts);
11135
11155
  await provisionCloudContainer({ gatewayUrl, jwt: token, orgId, userId, email, hasClaudeCode, hasCursor });
11136
- await verifyCloudGrader(token);
11156
+ cloudGradeOk = await verifyCloudGrader(token);
11137
11157
  }
11138
11158
  if (transcriptConsent) {
11139
11159
  const repo = detectGitRepo2();
@@ -11222,7 +11242,15 @@ async function installCommand(opts = {}) {
11222
11242
  const { setupGithubCommand: setupGithubCommand2 } = await Promise.resolve().then(() => (init_setupGithub(), setupGithub_exports));
11223
11243
  await setupGithubCommand2({ nonInteractive: true, githubToken: ghToken });
11224
11244
  }
11225
- console.log("\u2713 Synkro installed.");
11245
+ if (cloudGradeOk === false) {
11246
+ console.error("");
11247
+ console.error("\u2717 Synkro installed, but the cloud grader is NOT working \u2014 grading will fail on your edits.");
11248
+ console.error(" The smoke grade above shows why (most often a bad/incomplete Claude setup-token \u2192 401).");
11249
+ console.error(" Re-run `synkro install` \u2192 cloud to re-authorize with a fresh token.");
11250
+ process.exitCode = 1;
11251
+ } else {
11252
+ console.log("\u2713 Synkro installed.");
11253
+ }
11226
11254
  if (process.stdin.isTTY && claudeDesktopInstalled()) {
11227
11255
  console.log("\n Claude Desktop detected \u2014 to monitor its conversations in your dashboard, run: synkro claude-desktop");
11228
11256
  }
@@ -13891,7 +13919,7 @@ var args = process.argv.slice(2);
13891
13919
  var cmd = args[0] || "";
13892
13920
  var subArgs = args.slice(1);
13893
13921
  function printVersion() {
13894
- console.log("1.6.66");
13922
+ console.log("1.6.68");
13895
13923
  }
13896
13924
  function printHelp2() {
13897
13925
  console.log(`Synkro CLI \u2014 runtime safety for AI coding agents