@synkro-sh/cli 1.6.67 → 1.6.69
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 +42 -9
- package/dist/bootstrap.js.map +1 -1
- package/package.json +2 -2
package/dist/bootstrap.js
CHANGED
|
@@ -1622,7 +1622,12 @@ export function tag(rt: string, config: HookConfig, grader?: string): string {
|
|
|
1622
1622
|
if (config.silent) return '[synkro:silent]';
|
|
1623
1623
|
const rs = config.policyName || 'all';
|
|
1624
1624
|
const g = grader ? ':' + (grader === 'claude_code' ? 'claude' : grader) : '';
|
|
1625
|
-
|
|
1625
|
+
// route() collapses cloud-container to 'local' for BRANCH selection (the local
|
|
1626
|
+
// path emits the rich systemMessage), but the grade actually ran on the hosted
|
|
1627
|
+
// container. Surface the real location so a cloud grade reads [synkro:cloud:\u2026],
|
|
1628
|
+
// and 'local' is reserved for an actual on-device channel grade.
|
|
1629
|
+
const loc = (rt === 'local' && process.env.SYNKRO_DEPLOY_LOCATION === 'cloud') ? 'cloud' : rt;
|
|
1630
|
+
return '[synkro:' + loc + ':' + rs + g + ']';
|
|
1626
1631
|
}
|
|
1627
1632
|
|
|
1628
1633
|
// \u2500\u2500\u2500 Local Grading (direct channel call) \u2500\u2500\u2500
|
|
@@ -9638,12 +9643,25 @@ function captureClaudeSetupToken() {
|
|
|
9638
9643
|
let yellow = "";
|
|
9639
9644
|
let m;
|
|
9640
9645
|
while ((m = yellowRe.exec(raw)) !== null) yellow += m[1];
|
|
9641
|
-
const
|
|
9642
|
-
|
|
9646
|
+
const yMatch = yellow.replace(/\s/g, "").match(/sk-ant-oat01-[A-Za-z0-9_-]+/);
|
|
9647
|
+
let lineMatch = "";
|
|
9648
|
+
const clean = raw.replace(/\x1B\[[0-9;?]*[a-zA-Z]/g, "").replace(/\x1B\][^\x07]*\x07/g, "");
|
|
9649
|
+
const lines = clean.split("\n").map((l) => l.trim());
|
|
9650
|
+
for (let i = 0; i < lines.length; i++) {
|
|
9651
|
+
const idx = lines[i].indexOf("sk-ant-oat01-");
|
|
9652
|
+
if (idx < 0) continue;
|
|
9653
|
+
let tok = (lines[i].slice(idx).match(/^sk-ant-oat01-[A-Za-z0-9_-]*/) || [""])[0];
|
|
9654
|
+
for (let j = i + 1; j < lines.length && /^[A-Za-z0-9_-]+$/.test(lines[j]); j++) tok += lines[j];
|
|
9655
|
+
lineMatch = tok;
|
|
9656
|
+
break;
|
|
9657
|
+
}
|
|
9658
|
+
const candidates = [yMatch ? yMatch[0] : "", lineMatch].filter((t) => /^sk-ant-oat01-[A-Za-z0-9_-]{20,}$/.test(t));
|
|
9659
|
+
const best = candidates.sort((a, b) => b.length - a.length)[0];
|
|
9660
|
+
if (!best) {
|
|
9643
9661
|
reject(new Error(`Could not find token in claude setup-token output (file=${raw.length}b, yellow=${yellow.length}b)`));
|
|
9644
9662
|
return;
|
|
9645
9663
|
}
|
|
9646
|
-
resolve4(
|
|
9664
|
+
resolve4(best);
|
|
9647
9665
|
});
|
|
9648
9666
|
});
|
|
9649
9667
|
}
|
|
@@ -10318,7 +10336,7 @@ function writeConfigEnv(opts) {
|
|
|
10318
10336
|
`SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
|
|
10319
10337
|
`SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
|
|
10320
10338
|
`SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
|
|
10321
|
-
`SYNKRO_VERSION=${shellQuoteSingle("1.6.
|
|
10339
|
+
`SYNKRO_VERSION=${shellQuoteSingle("1.6.69")}`
|
|
10322
10340
|
];
|
|
10323
10341
|
if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
|
|
10324
10342
|
if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
|
|
@@ -10867,7 +10885,13 @@ async function installCommand(opts = {}) {
|
|
|
10867
10885
|
}
|
|
10868
10886
|
const transcriptConsent = transcriptCC || transcriptCursor;
|
|
10869
10887
|
ensureSynkroDir();
|
|
10870
|
-
|
|
10888
|
+
let hookMode = opts.hookMode || resolvePersistedHookMode();
|
|
10889
|
+
if (target === "cloud-container" && hookMode === "stub") {
|
|
10890
|
+
if (opts.hookMode === "stub") {
|
|
10891
|
+
console.log(" \u24D8 Cloud mode needs full hooks (stub hooks require a local container) \u2014 using full.\n");
|
|
10892
|
+
}
|
|
10893
|
+
hookMode = "full";
|
|
10894
|
+
}
|
|
10871
10895
|
const scripts = writeHookScripts(hookMode);
|
|
10872
10896
|
console.log("Wrote hook scripts to ~/.synkro/hooks/\n");
|
|
10873
10897
|
for (const mode of ["edit", "bash"]) {
|
|
@@ -11057,6 +11081,7 @@ async function installCommand(opts = {}) {
|
|
|
11057
11081
|
}
|
|
11058
11082
|
writeSynkroFileIfMissing({ hasClaudeCode, hasCursor, gradingMode, deployLocation });
|
|
11059
11083
|
console.log();
|
|
11084
|
+
let cloudGradeOk = null;
|
|
11060
11085
|
if (useLocalMcp) {
|
|
11061
11086
|
const { assertDockerAvailable: assertDockerAvailable2 } = await Promise.resolve().then(() => (init_dockerInstall(), dockerInstall_exports));
|
|
11062
11087
|
try {
|
|
@@ -11139,7 +11164,7 @@ async function installCommand(opts = {}) {
|
|
|
11139
11164
|
} else if (target === "cloud-container") {
|
|
11140
11165
|
if (hasCursor) await promptCursorApiKey(opts);
|
|
11141
11166
|
await provisionCloudContainer({ gatewayUrl, jwt: token, orgId, userId, email, hasClaudeCode, hasCursor });
|
|
11142
|
-
await verifyCloudGrader(token);
|
|
11167
|
+
cloudGradeOk = await verifyCloudGrader(token);
|
|
11143
11168
|
}
|
|
11144
11169
|
if (transcriptConsent) {
|
|
11145
11170
|
const repo = detectGitRepo2();
|
|
@@ -11228,7 +11253,15 @@ async function installCommand(opts = {}) {
|
|
|
11228
11253
|
const { setupGithubCommand: setupGithubCommand2 } = await Promise.resolve().then(() => (init_setupGithub(), setupGithub_exports));
|
|
11229
11254
|
await setupGithubCommand2({ nonInteractive: true, githubToken: ghToken });
|
|
11230
11255
|
}
|
|
11231
|
-
|
|
11256
|
+
if (cloudGradeOk === false) {
|
|
11257
|
+
console.error("");
|
|
11258
|
+
console.error("\u2717 Synkro installed, but the cloud grader is NOT working \u2014 grading will fail on your edits.");
|
|
11259
|
+
console.error(" The smoke grade above shows why (most often a bad/incomplete Claude setup-token \u2192 401).");
|
|
11260
|
+
console.error(" Re-run `synkro install` \u2192 cloud to re-authorize with a fresh token.");
|
|
11261
|
+
process.exitCode = 1;
|
|
11262
|
+
} else {
|
|
11263
|
+
console.log("\u2713 Synkro installed.");
|
|
11264
|
+
}
|
|
11232
11265
|
if (process.stdin.isTTY && claudeDesktopInstalled()) {
|
|
11233
11266
|
console.log("\n Claude Desktop detected \u2014 to monitor its conversations in your dashboard, run: synkro claude-desktop");
|
|
11234
11267
|
}
|
|
@@ -13897,7 +13930,7 @@ var args = process.argv.slice(2);
|
|
|
13897
13930
|
var cmd = args[0] || "";
|
|
13898
13931
|
var subArgs = args.slice(1);
|
|
13899
13932
|
function printVersion() {
|
|
13900
|
-
console.log("1.6.
|
|
13933
|
+
console.log("1.6.69");
|
|
13901
13934
|
}
|
|
13902
13935
|
function printHelp2() {
|
|
13903
13936
|
console.log(`Synkro CLI \u2014 runtime safety for AI coding agents
|