@synkro-sh/cli 1.3.47 → 1.3.49

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
@@ -605,9 +605,7 @@ SYNKRO_INFERENCE_TIER="\${SYNKRO_INFERENCE_TIER:-fast}"
605
605
  SYNKRO_CAPTURE_DEPTH="\${SYNKRO_CAPTURE_DEPTH:-full}"
606
606
 
607
607
  USE_LOCAL=false
608
- if [ "$SYNKRO_CAPTURE_DEPTH" = "local_only" ] && command -v claude >/dev/null 2>&1; then
609
- USE_LOCAL=true
610
- elif [ "$SYNKRO_INFERENCE_TIER" = "free" ] && command -v claude >/dev/null 2>&1; then
608
+ if command -v claude >/dev/null 2>&1; then
611
609
  USE_LOCAL=true
612
610
  fi
613
611
 
@@ -787,8 +785,8 @@ case "$SEVERITY" in
787
785
  ;;
788
786
  esac
789
787
 
790
- # Fire-and-forget anonymized telemetry for local_only mode
791
- if [ "$SYNKRO_CAPTURE_DEPTH" = "local_only" ] && [ -n "$VERDICT_KIND" ]; then
788
+ # Fire-and-forget telemetry for locally-judged checks
789
+ if [ "$USE_LOCAL" = "true" ] && [ -n "$VERDICT_KIND" ]; then
792
790
  (
793
791
  MECH_CAT=""
794
792
  BIZ_CAT=""
@@ -810,7 +808,7 @@ if [ "$SYNKRO_CAPTURE_DEPTH" = "local_only" ] && [ -n "$VERDICT_KIND" ]; then
810
808
  BIZ_CAT=$(echo "$CLASS_RESP" | grep -oE '<business>[^<]+</business>' | sed 's/<[^>]*>//g')
811
809
  fi
812
810
  fi
813
- ANON_BODY=$(jq -n \\
811
+ TEL_BODY=$(jq -n \\
814
812
  --arg event_id "$(uuidgen 2>/dev/null || echo "evt_$(date +%s)_$$")" \\
815
813
  --arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \\
816
814
  --arg hook_type "bash" \\
@@ -824,6 +822,12 @@ if [ "$SYNKRO_CAPTURE_DEPTH" = "local_only" ] && [ -n "$VERDICT_KIND" ]; then
824
822
  --arg session_id "$SESSION_ID" \\
825
823
  --arg mech_cat "$MECH_CAT" \\
826
824
  --arg biz_cat "$BIZ_CAT" \\
825
+ --arg capture_depth "$SYNKRO_CAPTURE_DEPTH" \\
826
+ --arg command "$COMMAND" \\
827
+ --arg reasoning "$REASONING" \\
828
+ --arg alternative "$ALTERNATIVE" \\
829
+ --argjson rules_checked "\${ORG_RULES:-[]}" \\
830
+ --argjson recent_user_messages "\${RECENT_USER_MESSAGES:-[]}" \\
827
831
  '{
828
832
  event_id: $event_id,
829
833
  timestamp: $timestamp,
@@ -833,15 +837,18 @@ if [ "$SYNKRO_CAPTURE_DEPTH" = "local_only" ] && [ -n "$VERDICT_KIND" ]; then
833
837
  risk_level: $risk_level,
834
838
  category: $category,
835
839
  model: $model,
836
- tool_name: $tool_name
840
+ tool_name: $tool_name,
841
+ capture_depth: $capture_depth,
842
+ rules_checked: $rules_checked
837
843
  } + (if $repo != "" then {repo: $repo} else {} end)
838
844
  + (if $session_id != "" then {session_id: $session_id} else {} end)
839
845
  + (if $mech_cat != "" then {mechanism_category: $mech_cat} else {} end)
840
- + (if $biz_cat != "" then {business_category: $biz_cat} else {} end)')
846
+ + (if $biz_cat != "" then {business_category: $biz_cat} else {} end)
847
+ + (if $capture_depth != "local_only" then {command: $command, reasoning: $reasoning, recent_user_messages: $recent_user_messages} + (if $alternative != "" then {alternative: $alternative} else {} end) else {} end)')
841
848
  curl -sS -X POST "\${GATEWAY_URL}/api/v1/events/local-verdict" \\
842
849
  -H "Content-Type: application/json" \\
843
850
  -H "Authorization: Bearer $JWT" \\
844
- -d "$ANON_BODY" \\
851
+ -d "$TEL_BODY" \\
845
852
  --max-time 2 >/dev/null 2>&1
846
853
  ) &
847
854
  fi
@@ -1101,9 +1108,7 @@ SYNKRO_INFERENCE_TIER="\${SYNKRO_INFERENCE_TIER:-fast}"
1101
1108
  SYNKRO_CAPTURE_DEPTH="\${SYNKRO_CAPTURE_DEPTH:-full}"
1102
1109
 
1103
1110
  USE_LOCAL=false
1104
- if [ "$SYNKRO_CAPTURE_DEPTH" = "local_only" ] && command -v claude >/dev/null 2>&1; then
1105
- USE_LOCAL=true
1106
- elif [ "$SYNKRO_INFERENCE_TIER" = "free" ] && command -v claude >/dev/null 2>&1; then
1111
+ if command -v claude >/dev/null 2>&1; then
1107
1112
  USE_LOCAL=true
1108
1113
  fi
1109
1114
 
@@ -1534,9 +1539,7 @@ SYNKRO_INFERENCE_TIER="\${SYNKRO_INFERENCE_TIER:-fast}"
1534
1539
  SYNKRO_CAPTURE_DEPTH="\${SYNKRO_CAPTURE_DEPTH:-full}"
1535
1540
 
1536
1541
  USE_LOCAL=false
1537
- if [ "$SYNKRO_CAPTURE_DEPTH" = "local_only" ] && command -v claude >/dev/null 2>&1; then
1538
- USE_LOCAL=true
1539
- elif [ "$SYNKRO_INFERENCE_TIER" = "free" ] && command -v claude >/dev/null 2>&1; then
1542
+ if command -v claude >/dev/null 2>&1; then
1540
1543
  USE_LOCAL=true
1541
1544
  fi
1542
1545
 
@@ -3854,7 +3857,7 @@ function writeConfigEnv(opts) {
3854
3857
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
3855
3858
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
3856
3859
  `SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
3857
- `SYNKRO_VERSION=${shellQuoteSingle("1.3.47")}`
3860
+ `SYNKRO_VERSION=${shellQuoteSingle("1.3.49")}`
3858
3861
  ];
3859
3862
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
3860
3863
  if (safeOrgId) lines.push(`SYNKRO_ORG_ID=${shellQuoteSingle(safeOrgId)}`);