@synkro-sh/cli 1.4.90 → 1.4.91
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 +36 -48
- package/dist/bootstrap.js.map +1 -1
- package/package.json +1 -1
package/dist/bootstrap.js
CHANGED
|
@@ -1273,10 +1273,10 @@ export function parseVerdict(resp: string): Verdict {
|
|
|
1273
1273
|
const okMatch = inner.match(/<ok>(.*?)<\\/ok>/);
|
|
1274
1274
|
if (okMatch) verdict.ok = okMatch[1].trim() !== 'false';
|
|
1275
1275
|
|
|
1276
|
-
const decisionMatch = inner.match(/<decision>(.*?)<\\/decision>/);
|
|
1276
|
+
const decisionMatch = inner.match(/<decision>(.*?)<\\/decision>/) || inner.match(/<overall>(.*?)<\\/overall>/);
|
|
1277
1277
|
if (decisionMatch) {
|
|
1278
1278
|
const d = decisionMatch[1].trim().toLowerCase();
|
|
1279
|
-
if (d === 'block' || d === 'deny' || d === 'fail') verdict.ok = false;
|
|
1279
|
+
if (d === 'block' || d === 'blocking' || d === 'deny' || d === 'fail') verdict.ok = false;
|
|
1280
1280
|
else if (d === 'allow' || d === 'pass' || d === 'approve') verdict.ok = true;
|
|
1281
1281
|
}
|
|
1282
1282
|
|
|
@@ -5282,6 +5282,7 @@ function writeRefreshAgent(synkroBinPath) {
|
|
|
5282
5282
|
throw new KeychainExportError("writeRefreshAgent is darwin-only");
|
|
5283
5283
|
}
|
|
5284
5284
|
mkdirSync6(join6(homedir6(), "Library", "LaunchAgents"), { recursive: true });
|
|
5285
|
+
const shellCmd = `export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" && "${synkroBinPath}" local-cc refresh-creds`;
|
|
5285
5286
|
const plist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
5286
5287
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
5287
5288
|
<plist version="1.0">
|
|
@@ -5290,9 +5291,9 @@ function writeRefreshAgent(synkroBinPath) {
|
|
|
5290
5291
|
<string>${LAUNCHD_LABEL}</string>
|
|
5291
5292
|
<key>ProgramArguments</key>
|
|
5292
5293
|
<array>
|
|
5293
|
-
<string
|
|
5294
|
-
<string
|
|
5295
|
-
<string
|
|
5294
|
+
<string>/bin/bash</string>
|
|
5295
|
+
<string>-c</string>
|
|
5296
|
+
<string>${shellCmd}</string>
|
|
5296
5297
|
</array>
|
|
5297
5298
|
<key>StartInterval</key>
|
|
5298
5299
|
<integer>${REFRESH_INTERVAL_SECONDS}</integer>
|
|
@@ -5347,7 +5348,7 @@ var init_macKeychain = __esm({
|
|
|
5347
5348
|
KEYCHAIN_SERVICE = "Claude Code-credentials";
|
|
5348
5349
|
LAUNCHD_LABEL = "com.synkro.cli.claude-creds-refresh";
|
|
5349
5350
|
LAUNCHD_PLIST = join6(homedir6(), "Library", "LaunchAgents", `${LAUNCHD_LABEL}.plist`);
|
|
5350
|
-
REFRESH_INTERVAL_SECONDS =
|
|
5351
|
+
REFRESH_INTERVAL_SECONDS = 45 * 60;
|
|
5351
5352
|
KeychainExportError = class extends Error {
|
|
5352
5353
|
constructor(message, cause) {
|
|
5353
5354
|
super(message);
|
|
@@ -5450,6 +5451,8 @@ async function dockerInstall(opts = {}) {
|
|
|
5450
5451
|
"-v",
|
|
5451
5452
|
`${MCP_JWT_PATH}:/data/.mcp-jwt:ro`,
|
|
5452
5453
|
"-v",
|
|
5454
|
+
`${SYNKRO_CREDS_PATH}:/data/credentials.json:ro`,
|
|
5455
|
+
"-v",
|
|
5453
5456
|
`${credsDir}:/home/synkro/.claude:rw`,
|
|
5454
5457
|
"-v",
|
|
5455
5458
|
`${join7(homedir7(), ".claude")}:/data/claude-host:ro`,
|
|
@@ -5499,13 +5502,14 @@ function dockerStatus() {
|
|
|
5499
5502
|
healthz: `http://127.0.0.1:${HOST_MCP_PORT}/`
|
|
5500
5503
|
};
|
|
5501
5504
|
}
|
|
5502
|
-
var SYNKRO_DIR3, MCP_JWT_PATH, PGDATA_PATH, HOST_MCP_PORT, HOST_GRADER_PORT, HOST_CWE_PORT, HOST_PG_PORT, CONTAINER_NAME, DEFAULT_IMAGE, DockerInstallError;
|
|
5505
|
+
var SYNKRO_DIR3, MCP_JWT_PATH, SYNKRO_CREDS_PATH, PGDATA_PATH, HOST_MCP_PORT, HOST_GRADER_PORT, HOST_CWE_PORT, HOST_PG_PORT, CONTAINER_NAME, DEFAULT_IMAGE, DockerInstallError;
|
|
5503
5506
|
var init_dockerInstall = __esm({
|
|
5504
5507
|
"cli/local-cc/dockerInstall.ts"() {
|
|
5505
5508
|
"use strict";
|
|
5506
5509
|
init_macKeychain();
|
|
5507
5510
|
SYNKRO_DIR3 = join7(homedir7(), ".synkro");
|
|
5508
5511
|
MCP_JWT_PATH = join7(SYNKRO_DIR3, ".mcp-jwt");
|
|
5512
|
+
SYNKRO_CREDS_PATH = join7(SYNKRO_DIR3, "credentials.json");
|
|
5509
5513
|
PGDATA_PATH = join7(SYNKRO_DIR3, "pgdata");
|
|
5510
5514
|
HOST_MCP_PORT = parseInt(process.env.SYNKRO_HOST_MCP_PORT || "18931", 10);
|
|
5511
5515
|
HOST_GRADER_PORT = parseInt(process.env.SYNKRO_HOST_GRADER_PORT || "18929", 10);
|
|
@@ -5555,19 +5559,6 @@ function parseArgs(argv) {
|
|
|
5555
5559
|
}
|
|
5556
5560
|
return opts;
|
|
5557
5561
|
}
|
|
5558
|
-
async function promptTranscriptConsent() {
|
|
5559
|
-
const rl = createInterface3({ input: process.stdin, output: process.stdout });
|
|
5560
|
-
return new Promise((resolve3) => {
|
|
5561
|
-
rl.question(
|
|
5562
|
-
"Would you like Synkro to use Claude Code session transcripts\nto generate guardrail rules and policies for your team? (Y/n) ",
|
|
5563
|
-
(answer) => {
|
|
5564
|
-
rl.close();
|
|
5565
|
-
const trimmed = answer.trim().toLowerCase();
|
|
5566
|
-
resolve3(trimmed === "" || trimmed === "y" || trimmed === "yes");
|
|
5567
|
-
}
|
|
5568
|
-
);
|
|
5569
|
-
});
|
|
5570
|
-
}
|
|
5571
5562
|
function ensureSynkroDir() {
|
|
5572
5563
|
mkdirSync8(SYNKRO_DIR4, { recursive: true });
|
|
5573
5564
|
mkdirSync8(HOOKS_DIR, { recursive: true });
|
|
@@ -5669,7 +5660,7 @@ function writeConfigEnv(opts) {
|
|
|
5669
5660
|
`SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
|
|
5670
5661
|
`SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
|
|
5671
5662
|
`SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
|
|
5672
|
-
`SYNKRO_VERSION=${shellQuoteSingle("1.4.
|
|
5663
|
+
`SYNKRO_VERSION=${shellQuoteSingle("1.4.91")}`
|
|
5673
5664
|
];
|
|
5674
5665
|
if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
|
|
5675
5666
|
if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
|
|
@@ -5885,16 +5876,29 @@ async function installCommand(opts = {}) {
|
|
|
5885
5876
|
console.error("No access token available after auth.");
|
|
5886
5877
|
process.exit(1);
|
|
5887
5878
|
}
|
|
5888
|
-
console.log("\nConnecting to GitHub (optional \u2014 for PR scanning)...");
|
|
5889
5879
|
let ghToken = null;
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5880
|
+
if (process.stdin.isTTY) {
|
|
5881
|
+
const rl = createInterface3({ input: process.stdin, output: process.stdout });
|
|
5882
|
+
const wantsPR = await new Promise((resolve3) => {
|
|
5883
|
+
rl.question("Would you like to enable GitHub PR scanning? (y/N) ", (answer) => {
|
|
5884
|
+
rl.close();
|
|
5885
|
+
const trimmed = answer.trim().toLowerCase();
|
|
5886
|
+
resolve3(trimmed === "y" || trimmed === "yes");
|
|
5887
|
+
});
|
|
5888
|
+
});
|
|
5889
|
+
if (wantsPR) {
|
|
5890
|
+
try {
|
|
5891
|
+
ghToken = await connectGitHub(gatewayUrl, token);
|
|
5892
|
+
} catch {
|
|
5893
|
+
}
|
|
5894
|
+
if (ghToken) {
|
|
5895
|
+
console.log();
|
|
5896
|
+
} else {
|
|
5897
|
+
console.log(" Skipped. Run `synkro install` again to enable PR scanning.\n");
|
|
5898
|
+
}
|
|
5899
|
+
} else {
|
|
5900
|
+
console.log(" Skipped PR scanning.\n");
|
|
5901
|
+
}
|
|
5898
5902
|
}
|
|
5899
5903
|
setApiBaseUrl(`${gatewayUrl}/api`);
|
|
5900
5904
|
await promptRepoConnection({ linkRepo: opts.linkRepo });
|
|
@@ -5933,15 +5937,7 @@ async function installCommand(opts = {}) {
|
|
|
5933
5937
|
} catch {
|
|
5934
5938
|
}
|
|
5935
5939
|
}
|
|
5936
|
-
|
|
5937
|
-
if (process.stdin.isTTY) {
|
|
5938
|
-
transcriptConsent = await promptTranscriptConsent();
|
|
5939
|
-
if (transcriptConsent) {
|
|
5940
|
-
console.log(" \u2713 Transcript collection enabled\n");
|
|
5941
|
-
} else {
|
|
5942
|
-
console.log(" \u2717 Transcript collection disabled \u2014 skipping transcript sync\n");
|
|
5943
|
-
}
|
|
5944
|
-
}
|
|
5940
|
+
const transcriptConsent = false;
|
|
5945
5941
|
let hasClaudeCode = false;
|
|
5946
5942
|
let hasCursor = false;
|
|
5947
5943
|
for (const agent of agents) {
|
|
@@ -6426,13 +6422,6 @@ rl.on('line', async (line) => {
|
|
|
6426
6422
|
}
|
|
6427
6423
|
});
|
|
6428
6424
|
|
|
6429
|
-
// cli/local-cc/channelSource.ts
|
|
6430
|
-
var init_channelSource = __esm({
|
|
6431
|
-
"cli/local-cc/channelSource.ts"() {
|
|
6432
|
-
"use strict";
|
|
6433
|
-
}
|
|
6434
|
-
});
|
|
6435
|
-
|
|
6436
6425
|
// cli/local-cc/install.ts
|
|
6437
6426
|
import { existsSync as existsSync10, mkdirSync as mkdirSync9, writeFileSync as writeFileSync8, readFileSync as readFileSync8, chmodSync as chmodSync3, copyFileSync, renameSync as renameSync4, unlinkSync as unlinkSync4, openSync, fsyncSync, closeSync } from "fs";
|
|
6438
6427
|
import { join as join9 } from "path";
|
|
@@ -6517,7 +6506,6 @@ var CLAUDE_JSON_BACKUP_PATH, SESSION_DIR, PLUGIN_PATH, PLUGIN_PKG_PATH, PLUGIN_S
|
|
|
6517
6506
|
var init_install2 = __esm({
|
|
6518
6507
|
"cli/local-cc/install.ts"() {
|
|
6519
6508
|
"use strict";
|
|
6520
|
-
init_channelSource();
|
|
6521
6509
|
CLAUDE_JSON_BACKUP_PATH = join9(homedir9(), ".claude.json.synkro-bak");
|
|
6522
6510
|
SESSION_DIR = join9(homedir9(), ".synkro", "cc_sessions");
|
|
6523
6511
|
PLUGIN_PATH = join9(SESSION_DIR, "synkro-channel.ts");
|
|
@@ -7107,7 +7095,7 @@ var args = process.argv.slice(2);
|
|
|
7107
7095
|
var cmd = args[0] || "";
|
|
7108
7096
|
var subArgs = args.slice(1);
|
|
7109
7097
|
function printVersion() {
|
|
7110
|
-
console.log("1.4.
|
|
7098
|
+
console.log("1.4.91");
|
|
7111
7099
|
}
|
|
7112
7100
|
function printHelp() {
|
|
7113
7101
|
console.log(`Synkro CLI \u2014 runtime safety for AI coding agents
|