@synkro-sh/cli 1.3.47 → 1.3.48
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 +13 -7
- package/dist/bootstrap.js.map +1 -1
- package/package.json +1 -1
package/dist/bootstrap.js
CHANGED
|
@@ -787,8 +787,8 @@ case "$SEVERITY" in
|
|
|
787
787
|
;;
|
|
788
788
|
esac
|
|
789
789
|
|
|
790
|
-
# Fire-and-forget
|
|
791
|
-
if [ "$
|
|
790
|
+
# Fire-and-forget telemetry for locally-judged checks
|
|
791
|
+
if [ "$USE_LOCAL" = "true" ] && [ -n "$VERDICT_KIND" ]; then
|
|
792
792
|
(
|
|
793
793
|
MECH_CAT=""
|
|
794
794
|
BIZ_CAT=""
|
|
@@ -810,7 +810,7 @@ if [ "$SYNKRO_CAPTURE_DEPTH" = "local_only" ] && [ -n "$VERDICT_KIND" ]; then
|
|
|
810
810
|
BIZ_CAT=$(echo "$CLASS_RESP" | grep -oE '<business>[^<]+</business>' | sed 's/<[^>]*>//g')
|
|
811
811
|
fi
|
|
812
812
|
fi
|
|
813
|
-
|
|
813
|
+
TEL_BODY=$(jq -n \\
|
|
814
814
|
--arg event_id "$(uuidgen 2>/dev/null || echo "evt_$(date +%s)_$$")" \\
|
|
815
815
|
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \\
|
|
816
816
|
--arg hook_type "bash" \\
|
|
@@ -824,6 +824,10 @@ if [ "$SYNKRO_CAPTURE_DEPTH" = "local_only" ] && [ -n "$VERDICT_KIND" ]; then
|
|
|
824
824
|
--arg session_id "$SESSION_ID" \\
|
|
825
825
|
--arg mech_cat "$MECH_CAT" \\
|
|
826
826
|
--arg biz_cat "$BIZ_CAT" \\
|
|
827
|
+
--arg capture_depth "$SYNKRO_CAPTURE_DEPTH" \\
|
|
828
|
+
--arg command "$COMMAND" \\
|
|
829
|
+
--arg reasoning "$REASONING" \\
|
|
830
|
+
--arg alternative "$ALTERNATIVE" \\
|
|
827
831
|
'{
|
|
828
832
|
event_id: $event_id,
|
|
829
833
|
timestamp: $timestamp,
|
|
@@ -833,15 +837,17 @@ 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
|
|
837
842
|
} + (if $repo != "" then {repo: $repo} else {} end)
|
|
838
843
|
+ (if $session_id != "" then {session_id: $session_id} else {} end)
|
|
839
844
|
+ (if $mech_cat != "" then {mechanism_category: $mech_cat} else {} end)
|
|
840
|
-
+ (if $biz_cat != "" then {business_category: $biz_cat} else {} end)
|
|
845
|
+
+ (if $biz_cat != "" then {business_category: $biz_cat} else {} end)
|
|
846
|
+
+ (if $capture_depth != "local_only" then {command: $command, reasoning: $reasoning} + (if $alternative != "" then {alternative: $alternative} else {} end) else {} end)')
|
|
841
847
|
curl -sS -X POST "\${GATEWAY_URL}/api/v1/events/local-verdict" \\
|
|
842
848
|
-H "Content-Type: application/json" \\
|
|
843
849
|
-H "Authorization: Bearer $JWT" \\
|
|
844
|
-
-d "$
|
|
850
|
+
-d "$TEL_BODY" \\
|
|
845
851
|
--max-time 2 >/dev/null 2>&1
|
|
846
852
|
) &
|
|
847
853
|
fi
|
|
@@ -3854,7 +3860,7 @@ function writeConfigEnv(opts) {
|
|
|
3854
3860
|
`SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
|
|
3855
3861
|
`SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
|
|
3856
3862
|
`SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
|
|
3857
|
-
`SYNKRO_VERSION=${shellQuoteSingle("1.3.
|
|
3863
|
+
`SYNKRO_VERSION=${shellQuoteSingle("1.3.48")}`
|
|
3858
3864
|
];
|
|
3859
3865
|
if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
|
|
3860
3866
|
if (safeOrgId) lines.push(`SYNKRO_ORG_ID=${shellQuoteSingle(safeOrgId)}`);
|