@synkro-sh/cli 1.7.65 → 1.7.66

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
@@ -132,7 +132,7 @@ function getIdentity() {
132
132
  if (cached2) return cached2;
133
133
  let cliVersion = "0.0.0";
134
134
  try {
135
- cliVersion = "1.7.65";
135
+ cliVersion = "1.7.66";
136
136
  } catch {
137
137
  }
138
138
  const creds = loadCredentialsIdentity();
@@ -6467,7 +6467,7 @@ function writeConfigEnv(opts) {
6467
6467
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle2(credsPath)}`,
6468
6468
  `SYNKRO_TIER=${shellQuoteSingle2(safeTier)}`,
6469
6469
  `SYNKRO_INFERENCE=${shellQuoteSingle2(safeInference)}`,
6470
- `SYNKRO_VERSION=${shellQuoteSingle2("1.7.65")}`
6470
+ `SYNKRO_VERSION=${shellQuoteSingle2("1.7.66")}`
6471
6471
  ];
6472
6472
  if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle2(safeSynkroBin)}`);
6473
6473
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle2(safeUserId)}`);
@@ -6531,23 +6531,39 @@ async function provisionCloudContainer(opts) {
6531
6531
  process.exit(1);
6532
6532
  }
6533
6533
  console.log(" Validating Claude token...");
6534
- try {
6535
- const out = execSync6('claude --print --output-format json "say ok"', {
6536
- env: { ...process.env, CLAUDE_CODE_OAUTH_TOKEN: setupToken },
6537
- encoding: "utf-8",
6538
- timeout: 3e4,
6539
- stdio: ["ignore", "pipe", "pipe"]
6540
- });
6541
- const result = JSON.parse(out);
6542
- if (result.is_error) throw new Error(result.result || "auth failed");
6543
- console.log(" \u2713 Claude token validated.\n");
6544
- } catch (err) {
6545
- const msg = err instanceof Error ? err.message : String(err);
6546
- console.error(` \u2717 Claude token failed validation: ${msg}`);
6547
- console.error(" The captured token can't authenticate (truncated capture, wrong account, or no API credits).");
6548
- console.error(" Re-run install to re-authorize \u2014 nothing was stored.");
6534
+ let validated = false;
6535
+ let authRejected = null;
6536
+ let lastErr = "";
6537
+ for (let attempt = 1; attempt <= 2 && !validated; attempt++) {
6538
+ try {
6539
+ const out = execSync6('claude --print --output-format json "say ok"', {
6540
+ env: { ...process.env, CLAUDE_CODE_OAUTH_TOKEN: setupToken },
6541
+ encoding: "utf-8",
6542
+ timeout: 6e4,
6543
+ stdio: ["ignore", "pipe", "pipe"]
6544
+ });
6545
+ const result = JSON.parse(out);
6546
+ if (result.is_error) {
6547
+ authRejected = result.result || "auth failed";
6548
+ break;
6549
+ }
6550
+ validated = true;
6551
+ } catch (err) {
6552
+ lastErr = err instanceof Error ? err.message : String(err);
6553
+ if (attempt < 2) console.log(` \u23F3 validation slow (${lastErr.slice(0, 30)}\u2026) \u2014 retrying once...`);
6554
+ }
6555
+ }
6556
+ if (authRejected) {
6557
+ console.error(` \u2717 Claude token rejected: ${authRejected}`);
6558
+ console.error(" Re-run install to re-authorize (wrong account or no API credits) \u2014 nothing was stored.");
6549
6559
  process.exit(1);
6550
6560
  }
6561
+ if (validated) {
6562
+ console.log(" \u2713 Claude token validated.\n");
6563
+ } else {
6564
+ console.warn(` \u26A0 Couldn't confirm the token locally in time (${lastErr.slice(0, 50)}).`);
6565
+ console.warn(" Proceeding \u2014 the cloud smoke-grade below verifies it end-to-end in the container.\n");
6566
+ }
6551
6567
  const repo = detectGitRepo2() || void 0;
6552
6568
  const sf = readFullSynkroFile();
6553
6569
  const harness = [];
@@ -7111,7 +7127,7 @@ async function installCommand(opts = {}) {
7111
7127
  await setTelemetryState({ enabled: true, remoteFlushEnabled: telemetryConsent });
7112
7128
  emit("install", {
7113
7129
  phase: "started",
7114
- cli_version_to: "1.7.65",
7130
+ cli_version_to: "1.7.66",
7115
7131
  agents_detected: agents.map((a) => a.kind),
7116
7132
  with_github: false,
7117
7133
  with_local_cc: false,
@@ -11000,7 +11016,7 @@ var subArgs = args.slice(1);
11000
11016
  var isDetachedChild = process.env.SYNKRO_TELEMETRY_DETACHED === "1";
11001
11017
  var FLUSH_SKIP = /* @__PURE__ */ new Set(["grade", "version", "--version", "-v", "help", "--help", "-h", ""]);
11002
11018
  function printVersion() {
11003
- console.log("1.7.65");
11019
+ console.log("1.7.66");
11004
11020
  }
11005
11021
  function printHelp2() {
11006
11022
  console.log(`Synkro CLI \u2014 runtime safety for AI coding agents