@synkro-sh/cli 1.4.48 → 1.4.50

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
@@ -1864,11 +1864,10 @@ async function main() {
1864
1864
  return;
1865
1865
  }
1866
1866
 
1867
- const proposedShort = proposed.slice(0, 4000);
1868
1867
  const graderPrompt = [
1869
1868
  'File: ' + filePath,
1870
- 'Content (first 4000 chars):',
1871
- proposedShort,
1869
+ 'Content:',
1870
+ proposed,
1872
1871
  '',
1873
1872
  'CWE rules to check against:',
1874
1873
  JSON.stringify(cweRules),
@@ -4467,9 +4466,14 @@ function startTask(opts = {}) {
4467
4466
  const cwd = opts.cwd ?? ch.sessionDir;
4468
4467
  let existing = findTask(ch);
4469
4468
  while (existing) {
4470
- if (existing.status === "Running") {
4469
+ if (existing.status === "Running" || existing.status === "Queued") {
4471
4470
  spawnSync2("tmux", ["kill-session", "-t", ch.tmuxSession], { encoding: "utf-8" });
4472
4471
  spawnSync2("pueue", ["kill", String(existing.id)], { encoding: "utf-8" });
4472
+ for (let i = 0; i < 10; i++) {
4473
+ const check = findTask(ch);
4474
+ if (!check || check.id !== existing.id || check.status !== "Running" && check.status !== "Queued") break;
4475
+ spawnSync2("sleep", ["0.5"], { encoding: "utf-8" });
4476
+ }
4473
4477
  }
4474
4478
  spawnSync2("pueue", ["remove", String(existing.id)], { encoding: "utf-8" });
4475
4479
  existing = findTask(ch);
@@ -4497,10 +4501,19 @@ function startTask(opts = {}) {
4497
4501
  }
4498
4502
  function stopTask(channel = CHANNEL_PRIMARY) {
4499
4503
  spawnSync2("tmux", ["kill-session", "-t", channel.tmuxSession], { encoding: "utf-8" });
4500
- const t = findTask(channel);
4501
- if (!t) return;
4502
- spawnSync2("pueue", ["kill", String(t.id)], { encoding: "utf-8" });
4503
- spawnSync2("pueue", ["remove", String(t.id)], { encoding: "utf-8" });
4504
+ let t = findTask(channel);
4505
+ while (t) {
4506
+ if (t.status === "Running" || t.status === "Queued") {
4507
+ spawnSync2("pueue", ["kill", String(t.id)], { encoding: "utf-8" });
4508
+ for (let i = 0; i < 10; i++) {
4509
+ const check = findTask(channel);
4510
+ if (!check || check.id !== t.id || check.status !== "Running" && check.status !== "Queued") break;
4511
+ spawnSync2("sleep", ["0.5"], { encoding: "utf-8" });
4512
+ }
4513
+ }
4514
+ spawnSync2("pueue", ["remove", String(t.id)], { encoding: "utf-8" });
4515
+ t = findTask(channel);
4516
+ }
4504
4517
  }
4505
4518
  function tailLogs(lines = 80, channel = CHANNEL_PRIMARY) {
4506
4519
  const t = findTask(channel);
@@ -5036,7 +5049,7 @@ function writeConfigEnv(opts) {
5036
5049
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
5037
5050
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
5038
5051
  `SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
5039
- `SYNKRO_VERSION=${shellQuoteSingle("1.4.48")}`
5052
+ `SYNKRO_VERSION=${shellQuoteSingle("1.4.50")}`
5040
5053
  ];
5041
5054
  if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
5042
5055
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
@@ -5253,9 +5266,11 @@ async function installCommand(opts = {}) {
5253
5266
  assertClaudeInstalled();
5254
5267
  assertPueueInstalled();
5255
5268
  assertTmuxInstalled();
5269
+ stopTask();
5270
+ stopTask(CHANNEL_SECONDARY);
5256
5271
  installLocalCC();
5257
- const t1 = ensureRunning();
5258
- const t2 = ensureRunning({ channel: CHANNEL_SECONDARY });
5272
+ const t1 = startTask();
5273
+ const t2 = startTask({ channel: CHANNEL_SECONDARY });
5259
5274
  console.log(` channel 1: pueue id=${t1.id} channel 2: pueue id=${t2.id}`);
5260
5275
  console.log(" Waiting for both channels...");
5261
5276
  const [ready1, ready2] = await Promise.all([
@@ -5483,10 +5498,12 @@ async function installCommand(opts = {}) {
5483
5498
  })();
5484
5499
  if (profile.localInference || priorLocalFlag && localCcDeps.length === 3) {
5485
5500
  try {
5501
+ stopTask();
5502
+ stopTask(CHANNEL_SECONDARY);
5486
5503
  const r = installLocalCC();
5487
5504
  console.log(`Installed local-CC channel plugin at ${r.pluginPath}`);
5488
- const t1 = ensureRunning();
5489
- const t2 = ensureRunning({ channel: CHANNEL_SECONDARY });
5505
+ const t1 = startTask();
5506
+ const t2 = startTask({ channel: CHANNEL_SECONDARY });
5490
5507
  console.log(`Channel 1 (org rules): pueue id=${t1.id} status=${t1.status}`);
5491
5508
  console.log(`Channel 2 (CWE scan): pueue id=${t2.id} status=${t2.status}`);
5492
5509
  console.log("Waiting for both channels (up to 60s)...");