@synkro-sh/cli 1.6.18 → 1.6.19

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
@@ -1641,6 +1641,10 @@ export function dispatchCapture(
1641
1641
  const body: Record<string, any> = {
1642
1642
  capture_type: 'local_verdict',
1643
1643
  event_id: eventId,
1644
+ // Source-time of the action. The ingest handler uses this for created_at
1645
+ // \u2014 without it, the spool drain stamps every event with NOW() and a batch
1646
+ // of actions taken minutes apart all collapse to the drain instant.
1647
+ _ts: new Date().toISOString(),
1644
1648
  hook_type: hookType,
1645
1649
  verdict: verdictStr,
1646
1650
  severity,
@@ -3172,13 +3176,14 @@ async function main() {
3172
3176
  if (!input.trim()) { outputEmpty(); return; }
3173
3177
 
3174
3178
  const payload = JSON.parse(input);
3175
- const toolName = payload.tool_name || '';
3176
- if (!isShellTool(toolName)) { outputEmpty(); return; }
3177
-
3178
3179
  const toolInput = payload.tool_input || {};
3179
3180
  const command = typeof payload.command === 'string' ? payload.command : (toolInput.command || '');
3180
3181
  if (!command) { outputEmpty(); return; }
3181
3182
 
3183
+ const toolName = payload.tool_name || '';
3184
+ // beforeShellExecution supplies command directly; preToolUse uses tool_name + tool_input.
3185
+ if (!isShellTool(toolName) && typeof payload.command !== 'string') { outputEmpty(); return; }
3186
+
3182
3187
  let jwt = loadJwt();
3183
3188
  if (!jwt) { outputEmpty(); return; }
3184
3189
  jwt = await ensureFreshJwt(jwt);
@@ -3231,11 +3236,7 @@ async function main() {
3231
3236
  hookSpecificOutput: { hookEventName: 'PreToolUse', additionalContext: '[synkro:installScan] ' + scan.summary },
3232
3237
  });
3233
3238
  } else {
3234
- const label = scan.scannedLabel || command.slice(0, 80);
3235
- outputJson({
3236
- systemMessage: '[synkro:installScan] ' + label + ' \\u2192 clean',
3237
- hookSpecificOutput: { hookEventName: 'PreToolUse', additionalContext: '[synkro:installScan] ' + label + ' \\u2192 clean' },
3238
- });
3239
+ outputEmpty();
3239
3240
  }
3240
3241
  } catch (err) {
3241
3242
  process.stderr.write('[synkro] installScan error: ' + String(err) + '\\n');
@@ -6650,7 +6651,7 @@ function writeConfigEnv(opts) {
6650
6651
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
6651
6652
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
6652
6653
  `SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
6653
- `SYNKRO_VERSION=${shellQuoteSingle("1.6.18")}`
6654
+ `SYNKRO_VERSION=${shellQuoteSingle("1.6.19")}`
6654
6655
  ];
6655
6656
  if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
6656
6657
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
@@ -6688,7 +6689,7 @@ function collectLocalMetadata() {
6688
6689
  } catch {
6689
6690
  }
6690
6691
  try {
6691
- const remote = execSync5("git remote get-url origin", { encoding: "utf-8", timeout: 3e3 }).trim();
6692
+ const remote = execSync5("git remote get-url origin", { encoding: "utf-8", timeout: 3e3, stdio: ["pipe", "pipe", "pipe"] }).trim();
6692
6693
  const sshMatch = remote.match(/^git@[^:]+:(.+?)(?:\.git)?$/);
6693
6694
  const httpMatch = remote.match(/^https?:\/\/[^/]+\/(.+?)(?:\.git)?$/);
6694
6695
  const m = sshMatch || httpMatch;
@@ -6781,7 +6782,7 @@ function assertGatewayAllowed(gatewayUrl) {
6781
6782
  async function installCommand(opts = {}) {
6782
6783
  if (!detectGitRepo2()) {
6783
6784
  console.error("Synkro must be installed inside a git repository.");
6784
- console.error(" `cd` into your project \u2014 a git repo with an `origin` remote \u2014 and re-run `synkro install`.");
6785
+ console.error(" `cd` into your project and re-run `synkro install`.");
6785
6786
  process.exit(1);
6786
6787
  }
6787
6788
  const gatewayUrl = opts.gatewayUrl || sanitizeGatewayCandidate(process.env.SYNKRO_GATEWAY_URL) || "https://api.synkro.sh";
@@ -9317,7 +9318,7 @@ var args = process.argv.slice(2);
9317
9318
  var cmd = args[0] || "";
9318
9319
  var subArgs = args.slice(1);
9319
9320
  function printVersion() {
9320
- console.log("1.6.18");
9321
+ console.log("1.6.19");
9321
9322
  }
9322
9323
  function printHelp2() {
9323
9324
  console.log(`Synkro CLI \u2014 runtime safety for AI coding agents