@synkro-sh/cli 1.7.38 → 1.7.39

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
  }
@@ -4690,6 +4723,8 @@ function ensureSynkroDir() {
4690
4723
  function writeHookScripts() {
4691
4724
  const installExtractCorePath = join11(HOOKS_DIR, "installExtractCore.ts");
4692
4725
  const bashScriptPath = join11(HOOKS_DIR, "cc-bash-judge.ts");
4726
+ const skillJudgeScriptPath = join11(HOOKS_DIR, "cc-skill-judge.ts");
4727
+ const cursorSkillJudgePath = join11(HOOKS_DIR, "cursor-skill-judge.ts");
4693
4728
  const bashFollowupScriptPath = join11(HOOKS_DIR, "cc-bash-followup.ts");
4694
4729
  const editPrecheckScriptPath = join11(HOOKS_DIR, "cc-edit-precheck.ts");
4695
4730
  const cwePrecheckScriptPath = join11(HOOKS_DIR, "cc-cwe-precheck.ts");
@@ -4713,6 +4748,8 @@ function writeHookScripts() {
4713
4748
  const stubFiles = [
4714
4749
  [stubCommonPath, STUB_COMMON_TS],
4715
4750
  [bashScriptPath, STUB_BASH_JUDGE_TS],
4751
+ [skillJudgeScriptPath, STUB_SKILL_JUDGE_TS],
4752
+ [cursorSkillJudgePath, STUB_CURSOR_SKILL_JUDGE_TS],
4716
4753
  [bashFollowupScriptPath, STUB_BASH_FOLLOWUP_TS],
4717
4754
  [editPrecheckScriptPath, STUB_EDIT_PRECHECK_TS],
4718
4755
  [cwePrecheckScriptPath, STUB_CWE_PRECHECK_TS],
@@ -4744,6 +4781,8 @@ function writeHookScripts() {
4744
4781
  }
4745
4782
  return {
4746
4783
  bashScript: bashScriptPath,
4784
+ skillJudgeScript: skillJudgeScriptPath,
4785
+ cursorSkillJudgeScript: cursorSkillJudgePath,
4747
4786
  bashFollowupScript: bashFollowupScriptPath,
4748
4787
  editPrecheckScript: editPrecheckScriptPath,
4749
4788
  cwePrecheckScript: cwePrecheckScriptPath,
@@ -4791,7 +4830,7 @@ function writeConfigEnv(opts) {
4791
4830
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
4792
4831
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
4793
4832
  `SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
4794
- `SYNKRO_VERSION=${shellQuoteSingle("1.7.38")}`
4833
+ `SYNKRO_VERSION=${shellQuoteSingle("1.7.39")}`
4795
4834
  ];
4796
4835
  if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
4797
4836
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
@@ -5434,6 +5473,7 @@ async function installCommand(opts = {}) {
5434
5473
  hasClaudeCode = true;
5435
5474
  installCCHooks(agent.settingsPath, {
5436
5475
  bashJudgeScriptPath: scripts.bashScript,
5476
+ skillJudgeScriptPath: scripts.skillJudgeScript,
5437
5477
  bashFollowupScriptPath: scripts.bashFollowupScript,
5438
5478
  editPrecheckScriptPath: scripts.editPrecheckScript,
5439
5479
  cwePrecheckScriptPath: scripts.cwePrecheckScript,
@@ -5454,6 +5494,7 @@ async function installCommand(opts = {}) {
5454
5494
  hasCursor = true;
5455
5495
  installCursorHooks(agent.settingsPath, {
5456
5496
  bashJudgeScriptPath: scripts.cursorBashJudgeScript,
5497
+ skillJudgeScriptPath: scripts.cursorSkillJudgeScript,
5457
5498
  editCaptureScriptPath: scripts.cursorEditCaptureScript,
5458
5499
  agentCaptureScriptPath: scripts.cursorAgentCaptureScript,
5459
5500
  bashFollowupScriptPath: scripts.bashFollowupScript,
@@ -5932,6 +5973,7 @@ function reconcileHarness() {
5932
5973
  if (wantCC) {
5933
5974
  installCCHooks(ccSettings, {
5934
5975
  bashJudgeScriptPath: scripts.bashScript,
5976
+ skillJudgeScriptPath: scripts.skillJudgeScript,
5935
5977
  bashFollowupScriptPath: scripts.bashFollowupScript,
5936
5978
  editPrecheckScriptPath: scripts.editPrecheckScript,
5937
5979
  cwePrecheckScriptPath: scripts.cwePrecheckScript,
@@ -5964,6 +6006,7 @@ function reconcileHarness() {
5964
6006
  if (wantCursor) {
5965
6007
  installCursorHooks(cursorHooks, {
5966
6008
  bashJudgeScriptPath: scripts.cursorBashJudgeScript,
6009
+ skillJudgeScriptPath: scripts.cursorSkillJudgeScript,
5967
6010
  editCaptureScriptPath: scripts.cursorEditCaptureScript,
5968
6011
  agentCaptureScriptPath: scripts.cursorAgentCaptureScript,
5969
6012
  bashFollowupScriptPath: scripts.bashFollowupScript,
@@ -8989,7 +9032,7 @@ var args = process.argv.slice(2);
8989
9032
  var cmd = args[0] || "";
8990
9033
  var subArgs = args.slice(1);
8991
9034
  function printVersion() {
8992
- console.log("1.7.38");
9035
+ console.log("1.7.39");
8993
9036
  }
8994
9037
  function printHelp2() {
8995
9038
  console.log(`Synkro CLI \u2014 runtime safety for AI coding agents