@synkro-sh/cli 1.7.38 → 1.7.41

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
@@ -146,7 +146,15 @@ function installCCHooks(settingsPath, config) {
146
146
  type: "command",
147
147
  command: config.bashJudgeScriptPath,
148
148
  timeout: 50
149
- }
149
+ },
150
+ // skill-judge shares this entry so CC runs it in parallel and waits for it
151
+ // before processing denies — its verdict is its OWN system-message block,
152
+ // separate from bashGuard. No-ops on pure reads (empty command).
153
+ ...config.skillJudgeScriptPath ? [{
154
+ type: "command",
155
+ command: config.skillJudgeScriptPath,
156
+ timeout: 50
157
+ }] : []
150
158
  ],
151
159
  [SYNKRO_MARKER]: true
152
160
  });
@@ -167,7 +175,13 @@ function installCCHooks(settingsPath, config) {
167
175
  type: "command",
168
176
  command: config.cvePrecheckScriptPath,
169
177
  timeout: 10
170
- }
178
+ },
179
+ // skill-judge — its OWN system-message block, parallel with edit-precheck.
180
+ ...config.skillJudgeScriptPath ? [{
181
+ type: "command",
182
+ command: config.skillJudgeScriptPath,
183
+ timeout: 50
184
+ }] : []
171
185
  ],
172
186
  [SYNKRO_MARKER]: true
173
187
  });
@@ -395,6 +409,12 @@ function installCursorHooks(hooksJsonPath, config) {
395
409
  failClosed: false,
396
410
  [SYNKRO_MARKER2]: true
397
411
  });
412
+ if (config.skillJudgeScriptPath) h.beforeShellExecution.push({
413
+ command: bunRunCmd(config.skillJudgeScriptPath),
414
+ timeout: 30,
415
+ failClosed: false,
416
+ [SYNKRO_MARKER2]: true
417
+ });
398
418
  pushCcHook(h, "afterShellExecution", config.bashFollowupScriptPath, { timeout: 10 });
399
419
  h.preToolUse = h.preToolUse ?? [];
400
420
  h.preToolUse.push({
@@ -418,10 +438,21 @@ function installCursorHooks(hooksJsonPath, config) {
418
438
  matcher: "Shell|Bash|Read|ReadFile|Grep|Glob|terminal|run_terminal_cmd|execute_command|read_file|grep_search|file_search|list_dir|codebase_search|delete_file",
419
439
  [SYNKRO_MARKER2]: true
420
440
  });
441
+ if (config.skillJudgeScriptPath) h.preToolUse.push({
442
+ command: bunRunCmd(config.skillJudgeScriptPath),
443
+ timeout: 30,
444
+ failClosed: false,
445
+ matcher: "Shell|Bash|terminal|run_terminal_cmd|execute_command",
446
+ [SYNKRO_MARKER2]: true
447
+ });
421
448
  pushCcHook(h, "preToolUse", config.editPrecheckScriptPath, {
422
449
  timeout: 30,
423
450
  matcher: "Write|Edit|StrReplace|MultiEdit|NotebookEdit|edit_file|reapply|edit_notebook|ApplyPatch|apply_patch"
424
451
  });
452
+ if (config.skillJudgeScriptPath) pushCcHook(h, "preToolUse", config.skillJudgeScriptPath, {
453
+ timeout: 30,
454
+ matcher: "Write|Edit|StrReplace|MultiEdit|NotebookEdit|edit_file|reapply|edit_notebook|ApplyPatch|apply_patch"
455
+ });
425
456
  pushCcHook(h, "preToolUse", config.cwePrecheckScriptPath, {
426
457
  timeout: 30,
427
458
  matcher: "Write|Edit|StrReplace|MultiEdit|NotebookEdit|edit_file|reapply|edit_notebook|ApplyPatch|apply_patch"
@@ -738,7 +769,7 @@ var init_skillParser = __esm({
738
769
  function stubHook(surface, optsLiteral) {
739
770
  return "#!/usr/bin/env bun\nimport { runStub } from './_synkro-stub-common.ts';\nrunStub(" + JSON.stringify(surface) + ", " + optsLiteral + ");\n";
740
771
  }
741
- var STUB_COMMON_TS, STUB_EDIT_PRECHECK_TS, STUB_CWE_PRECHECK_TS, STUB_CVE_PRECHECK_TS, STUB_BASH_JUDGE_TS, STUB_INSTALL_SCAN_TS, STUB_AGENT_JUDGE_TS, STUB_MCP_GATE_TS, STUB_PLAN_JUDGE_TS, STUB_STOP_SUMMARY_TS, STUB_SESSION_START_TS, STUB_TRANSCRIPT_SYNC_TS, STUB_USER_PROMPT_SUBMIT_TS, STUB_BASH_FOLLOWUP_TS, STUB_TASK_ACTIVATE_INTENT_TS, STUB_CURSOR_BASH_JUDGE_TS, STUB_CURSOR_EDIT_CAPTURE_TS, STUB_CURSOR_AGENT_CAPTURE_TS;
772
+ var STUB_COMMON_TS, STUB_EDIT_PRECHECK_TS, STUB_CWE_PRECHECK_TS, STUB_CVE_PRECHECK_TS, STUB_BASH_JUDGE_TS, STUB_SKILL_JUDGE_TS, STUB_INSTALL_SCAN_TS, STUB_AGENT_JUDGE_TS, STUB_MCP_GATE_TS, STUB_PLAN_JUDGE_TS, STUB_STOP_SUMMARY_TS, STUB_SESSION_START_TS, STUB_TRANSCRIPT_SYNC_TS, STUB_USER_PROMPT_SUBMIT_TS, STUB_BASH_FOLLOWUP_TS, STUB_TASK_ACTIVATE_INTENT_TS, STUB_CURSOR_BASH_JUDGE_TS, STUB_CURSOR_SKILL_JUDGE_TS, STUB_CURSOR_EDIT_CAPTURE_TS, STUB_CURSOR_AGENT_CAPTURE_TS;
742
773
  var init_hookScriptsTs = __esm({
743
774
  "cli/installer/hookScriptsTs.ts"() {
744
775
  "use strict";
@@ -964,6 +995,7 @@ export async function runStub(surface: string, opts: StubOpts = {}): Promise<voi
964
995
  STUB_CWE_PRECHECK_TS = stubHook("cwe-precheck", "{ needsFile: true, needsTranscript: true }");
965
996
  STUB_CVE_PRECHECK_TS = stubHook("cve-precheck", "{ needsFile: true, needsTranscript: true }");
966
997
  STUB_BASH_JUDGE_TS = stubHook("bash-judge", "{ needsTranscript: true }");
998
+ STUB_SKILL_JUDGE_TS = stubHook("skill-judge", "{ needsFile: true, needsTranscript: true }");
967
999
  STUB_INSTALL_SCAN_TS = stubHook("install-scan", "{ needsTranscript: true }");
968
1000
  STUB_AGENT_JUDGE_TS = stubHook("agent-judge", "{ needsTranscript: true }");
969
1001
  STUB_MCP_GATE_TS = stubHook("mcp-gate", "{ needsTranscript: true }");
@@ -993,6 +1025,7 @@ try {
993
1025
  process.stdout.write('{}\\n');
994
1026
  `;
995
1027
  STUB_CURSOR_BASH_JUDGE_TS = stubHook("bash-judge", "{ needsTranscript: true, harness: 'cursor' }");
1028
+ STUB_CURSOR_SKILL_JUDGE_TS = stubHook("skill-judge", "{ needsFile: true, needsTranscript: true, harness: 'cursor' }");
996
1029
  STUB_CURSOR_EDIT_CAPTURE_TS = stubHook("edit-precheck", "{ needsFile: true, needsTranscript: true, harness: 'cursor' }");
997
1030
  STUB_CURSOR_AGENT_CAPTURE_TS = stubHook("agent-judge", "{ needsTranscript: true, harness: 'cursor' }");
998
1031
  }
@@ -3773,10 +3806,6 @@ async function dockerInstall(opts = {}) {
3773
3806
  // interactive AskUserQuestion poll and fall through to generate-the-fix. Only
3774
3807
  // passed when the operator set it; otherwise the image default (1) applies.
3775
3808
  ...process.env.SYNKRO_FIX_POLL ? ["-e", `SYNKRO_FIX_POLL=${process.env.SYNKRO_FIX_POLL}`] : [],
3776
- // Route CWE grades to the cloud /api/v1/cwe-scan endpoint (arm-C: full-catalog
3777
- // retrieval + ensemble) instead of the local single-prompt path. Grading stays
3778
- // local for every other surface. Benchmark lever; default off.
3779
- ...process.env.SYNKRO_CWE_VIA_ENDPOINT ? ["-e", `SYNKRO_CWE_VIA_ENDPOINT=${process.env.SYNKRO_CWE_VIA_ENDPOINT}`] : [],
3780
3809
  // Connected repo — the server seeds the local app + ruleset named after it.
3781
3810
  ...opts.connectedRepo ? ["-e", `SYNKRO_CONNECTED_REPO=${opts.connectedRepo}`] : [],
3782
3811
  // Real account identity (from config.env via process.env) — telemetry is
@@ -4690,6 +4719,8 @@ function ensureSynkroDir() {
4690
4719
  function writeHookScripts() {
4691
4720
  const installExtractCorePath = join11(HOOKS_DIR, "installExtractCore.ts");
4692
4721
  const bashScriptPath = join11(HOOKS_DIR, "cc-bash-judge.ts");
4722
+ const skillJudgeScriptPath = join11(HOOKS_DIR, "cc-skill-judge.ts");
4723
+ const cursorSkillJudgePath = join11(HOOKS_DIR, "cursor-skill-judge.ts");
4693
4724
  const bashFollowupScriptPath = join11(HOOKS_DIR, "cc-bash-followup.ts");
4694
4725
  const editPrecheckScriptPath = join11(HOOKS_DIR, "cc-edit-precheck.ts");
4695
4726
  const cwePrecheckScriptPath = join11(HOOKS_DIR, "cc-cwe-precheck.ts");
@@ -4713,6 +4744,8 @@ function writeHookScripts() {
4713
4744
  const stubFiles = [
4714
4745
  [stubCommonPath, STUB_COMMON_TS],
4715
4746
  [bashScriptPath, STUB_BASH_JUDGE_TS],
4747
+ [skillJudgeScriptPath, STUB_SKILL_JUDGE_TS],
4748
+ [cursorSkillJudgePath, STUB_CURSOR_SKILL_JUDGE_TS],
4716
4749
  [bashFollowupScriptPath, STUB_BASH_FOLLOWUP_TS],
4717
4750
  [editPrecheckScriptPath, STUB_EDIT_PRECHECK_TS],
4718
4751
  [cwePrecheckScriptPath, STUB_CWE_PRECHECK_TS],
@@ -4744,6 +4777,8 @@ function writeHookScripts() {
4744
4777
  }
4745
4778
  return {
4746
4779
  bashScript: bashScriptPath,
4780
+ skillJudgeScript: skillJudgeScriptPath,
4781
+ cursorSkillJudgeScript: cursorSkillJudgePath,
4747
4782
  bashFollowupScript: bashFollowupScriptPath,
4748
4783
  editPrecheckScript: editPrecheckScriptPath,
4749
4784
  cwePrecheckScript: cwePrecheckScriptPath,
@@ -4791,7 +4826,7 @@ function writeConfigEnv(opts) {
4791
4826
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
4792
4827
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
4793
4828
  `SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
4794
- `SYNKRO_VERSION=${shellQuoteSingle("1.7.38")}`
4829
+ `SYNKRO_VERSION=${shellQuoteSingle("1.7.41")}`
4795
4830
  ];
4796
4831
  if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
4797
4832
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
@@ -5434,6 +5469,7 @@ async function installCommand(opts = {}) {
5434
5469
  hasClaudeCode = true;
5435
5470
  installCCHooks(agent.settingsPath, {
5436
5471
  bashJudgeScriptPath: scripts.bashScript,
5472
+ skillJudgeScriptPath: scripts.skillJudgeScript,
5437
5473
  bashFollowupScriptPath: scripts.bashFollowupScript,
5438
5474
  editPrecheckScriptPath: scripts.editPrecheckScript,
5439
5475
  cwePrecheckScriptPath: scripts.cwePrecheckScript,
@@ -5454,6 +5490,7 @@ async function installCommand(opts = {}) {
5454
5490
  hasCursor = true;
5455
5491
  installCursorHooks(agent.settingsPath, {
5456
5492
  bashJudgeScriptPath: scripts.cursorBashJudgeScript,
5493
+ skillJudgeScriptPath: scripts.cursorSkillJudgeScript,
5457
5494
  editCaptureScriptPath: scripts.cursorEditCaptureScript,
5458
5495
  agentCaptureScriptPath: scripts.cursorAgentCaptureScript,
5459
5496
  bashFollowupScriptPath: scripts.bashFollowupScript,
@@ -5932,6 +5969,7 @@ function reconcileHarness() {
5932
5969
  if (wantCC) {
5933
5970
  installCCHooks(ccSettings, {
5934
5971
  bashJudgeScriptPath: scripts.bashScript,
5972
+ skillJudgeScriptPath: scripts.skillJudgeScript,
5935
5973
  bashFollowupScriptPath: scripts.bashFollowupScript,
5936
5974
  editPrecheckScriptPath: scripts.editPrecheckScript,
5937
5975
  cwePrecheckScriptPath: scripts.cwePrecheckScript,
@@ -5964,6 +6002,7 @@ function reconcileHarness() {
5964
6002
  if (wantCursor) {
5965
6003
  installCursorHooks(cursorHooks, {
5966
6004
  bashJudgeScriptPath: scripts.cursorBashJudgeScript,
6005
+ skillJudgeScriptPath: scripts.cursorSkillJudgeScript,
5967
6006
  editCaptureScriptPath: scripts.cursorEditCaptureScript,
5968
6007
  agentCaptureScriptPath: scripts.cursorAgentCaptureScript,
5969
6008
  bashFollowupScriptPath: scripts.bashFollowupScript,
@@ -8989,7 +9028,7 @@ var args = process.argv.slice(2);
8989
9028
  var cmd = args[0] || "";
8990
9029
  var subArgs = args.slice(1);
8991
9030
  function printVersion() {
8992
- console.log("1.7.38");
9031
+ console.log("1.7.41");
8993
9032
  }
8994
9033
  function printHelp2() {
8995
9034
  console.log(`Synkro CLI \u2014 runtime safety for AI coding agents