@synkro-sh/cli 1.3.57 → 1.3.58

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
@@ -3594,7 +3594,9 @@ function captureClaudeSetupToken() {
3594
3594
  let raw = "";
3595
3595
  try {
3596
3596
  raw = readFileSync4(tmpFile, "utf-8");
3597
- } catch {
3597
+ } catch (e) {
3598
+ reject(new Error(`Could not read script output file: ${e.message}`));
3599
+ return;
3598
3600
  }
3599
3601
  try {
3600
3602
  unlinkSync3(tmpFile);
@@ -3604,20 +3606,16 @@ function captureClaudeSetupToken() {
3604
3606
  reject(new Error(`claude setup-token exited with code ${code}`));
3605
3607
  return;
3606
3608
  }
3607
- const stripped = raw.replace(/\x1B\[[0-9;]*[A-Za-z]|\x1B\][^\x07]*\x07/g, "");
3608
- const startIdx = stripped.indexOf("Your OAuth token");
3609
- const endIdx = stripped.indexOf("Store this token");
3610
- if (startIdx === -1 || endIdx === -1) {
3611
- reject(new Error("Could not find token in claude setup-token output"));
3612
- return;
3613
- }
3614
- const section = stripped.slice(startIdx, endIdx).replace(/\s/g, "");
3615
- const match = section.match(/sk-ant-oat01-[A-Za-z0-9_-]+/);
3616
- if (!match) {
3617
- reject(new Error("Could not find token in claude setup-token output"));
3609
+ const yellowRe = /\x1B\[38;2;255;193;7m([^\x1B]*)/g;
3610
+ let yellow = "";
3611
+ let m;
3612
+ while ((m = yellowRe.exec(raw)) !== null) yellow += m[1];
3613
+ const token = yellow.replace(/\s/g, "").match(/sk-ant-oat01-[A-Za-z0-9_-]+/);
3614
+ if (!token) {
3615
+ reject(new Error(`Could not find token in claude setup-token output (file=${raw.length}b, yellow=${yellow.length}b)`));
3618
3616
  return;
3619
3617
  }
3620
- resolve2(match[0]);
3618
+ resolve2(token[0]);
3621
3619
  });
3622
3620
  });
3623
3621
  }
@@ -3987,7 +3985,7 @@ function writeConfigEnv(opts) {
3987
3985
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
3988
3986
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
3989
3987
  `SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
3990
- `SYNKRO_VERSION=${shellQuoteSingle("1.3.57")}`
3988
+ `SYNKRO_VERSION=${shellQuoteSingle("1.3.58")}`
3991
3989
  ];
3992
3990
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
3993
3991
  if (safeOrgId) lines.push(`SYNKRO_ORG_ID=${shellQuoteSingle(safeOrgId)}`);