@synkro-sh/cli 1.7.36 → 1.7.38

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
@@ -910,7 +910,12 @@ export async function runStub(surface: string, opts: StubOpts = {}): Promise<voi
910
910
  // result (the server waits up to 30s for the completion grade), so it needs a
911
911
  // wait above that budget — not the 6s telemetry default — or the stub abandons
912
912
  // the request before the result lands and the completion shows up a hook late.
913
- const timeoutMs = surface === 'bash-followup' ? 32000 : (opts.telemetry ? 6000 : 28000);
913
+ // prompt-submit is the opposite: it's INTERACTIVE (blocks the user's prompt from
914
+ // being sent) under a short 5s hook timeout, so it gets ONE short attempt (below)
915
+ // and a tight per-attempt budget that fits inside 5s — never the 6s×3 telemetry path.
916
+ const timeoutMs = surface === 'bash-followup' ? 32000
917
+ : surface === 'prompt-submit' ? 3500
918
+ : (opts.telemetry ? 6000 : 28000);
914
919
  // Cloud has no local container to reach. Post the SAME envelope to the org's grader
915
920
  // via the gateway's /grade/submit as role 'scan:<surface>'; the container runs
916
921
  // scanRouter (runScan) server-side and returns the SAME shaped decision — so cloud
@@ -936,7 +941,11 @@ export async function runStub(surface: string, opts: StubOpts = {}): Promise<voi
936
941
  // — the server side is idempotent-ish (completion in-flight guard, dup evidence
937
942
  // is harmless). Blocking hooks make ONE attempt: their response IS the verdict
938
943
  // and a retry would double-grade. Normal case: first attempt wins, no delay.
939
- const attempts = opts.telemetry ? 3 : 1;
944
+ // prompt-submit is EXCLUDED from the retry: it runs on the interactive prompt
945
+ // path under a 5s hook timeout, and 3×6s+backoff (19.5s) blew that budget and
946
+ // fired "hook timed out after 5s" on every prompt whenever the server was slow.
947
+ // Dropping an occasional prompt tick is harmless; stalling the user is not.
948
+ const attempts = (opts.telemetry && surface !== 'prompt-submit') ? 3 : 1;
940
949
  let text = '';
941
950
  for (let i = 0; i < attempts; i++) {
942
951
  try {
@@ -3764,6 +3773,10 @@ async function dockerInstall(opts = {}) {
3764
3773
  // interactive AskUserQuestion poll and fall through to generate-the-fix. Only
3765
3774
  // passed when the operator set it; otherwise the image default (1) applies.
3766
3775
  ...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}`] : [],
3767
3780
  // Connected repo — the server seeds the local app + ruleset named after it.
3768
3781
  ...opts.connectedRepo ? ["-e", `SYNKRO_CONNECTED_REPO=${opts.connectedRepo}`] : [],
3769
3782
  // Real account identity (from config.env via process.env) — telemetry is
@@ -4778,7 +4791,7 @@ function writeConfigEnv(opts) {
4778
4791
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
4779
4792
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
4780
4793
  `SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
4781
- `SYNKRO_VERSION=${shellQuoteSingle("1.7.36")}`
4794
+ `SYNKRO_VERSION=${shellQuoteSingle("1.7.38")}`
4782
4795
  ];
4783
4796
  if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
4784
4797
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
@@ -8976,7 +8989,7 @@ var args = process.argv.slice(2);
8976
8989
  var cmd = args[0] || "";
8977
8990
  var subArgs = args.slice(1);
8978
8991
  function printVersion() {
8979
- console.log("1.7.36");
8992
+ console.log("1.7.38");
8980
8993
  }
8981
8994
  function printHelp2() {
8982
8995
  console.log(`Synkro CLI \u2014 runtime safety for AI coding agents