@synkro-sh/cli 1.2.0 → 1.2.1

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
@@ -513,7 +513,7 @@ if [ "$SYNKRO_INFERENCE_TIER" = "free" ] && command -v claude >/dev/null 2>&1; t
513
513
  V_INNER=$(printf '%s' "$CC_RESP" | tr '\\n' ' ' | grep -oE '<synkro-verdict>[^<]*</synkro-verdict>' | tail -1 | sed -E 's|^<synkro-verdict>||; s|</synkro-verdict>$||')
514
514
  if [ -z "$V_INNER" ] || ! echo "$V_INNER" | jq -e '.severity' >/dev/null 2>&1; then
515
515
  synkro_log "bashGuard $CMD_SHORT \u2192 error (no verdict)"
516
- echo '{}'
516
+ jq -n --arg m "[synkro] bashGuard \u2192 error (no verdict)" '{systemMessage: $m}'
517
517
  exit 0
518
518
  fi
519
519
  VERDICT="$V_INNER"
@@ -540,7 +540,7 @@ fi
540
540
 
541
541
  if [ -z "$VERDICT" ]; then
542
542
  synkro_log "bashGuard $CMD_SHORT \u2192 error (timeout)"
543
- echo '{}'
543
+ jq -n --arg m "[synkro] bashGuard \u2192 error (timeout)" '{systemMessage: $m}'
544
544
  exit 0
545
545
  fi
546
546
 
@@ -621,9 +621,9 @@ case "$SEVERITY" in
621
621
  }'
622
622
  ;;
623
623
  *)
624
- # low / medium / anything else \u2192 silent allow
624
+ # low / medium / anything else \u2192 allow
625
625
  synkro_log "bashGuard $CMD_SHORT \u2192 pass"
626
- echo '{}'
626
+ jq -n --arg m "[synkro] bashGuard \u2192 pass" '{systemMessage: $m}'
627
627
  ;;
628
628
  esac
629
629
 
@@ -962,13 +962,13 @@ fi
962
962
 
963
963
  if [ -z "$RESP" ]; then
964
964
  synkro_log "editGuard $FILE_SHORT \u2192 error (timeout)"
965
- echo '{}'
965
+ jq -n --arg m "[synkro] editGuard $FILE_SHORT \u2192 error (timeout)" '{systemMessage: $m}'
966
966
  exit 0
967
967
  fi
968
968
 
969
969
  if ! echo "$RESP" | jq -e 'type == "object"' >/dev/null 2>&1; then
970
970
  synkro_log "editGuard $FILE_SHORT \u2192 error (bad response)"
971
- echo '{}'
971
+ jq -n --arg m "[synkro] editGuard $FILE_SHORT \u2192 error (bad response)" '{systemMessage: $m}'
972
972
  exit 0
973
973
  fi
974
974
 
@@ -976,11 +976,13 @@ DECISION=$(echo "$RESP" | jq -r '.hookSpecificOutput.permissionDecision // "allo
976
976
  if [ "$DECISION" = "deny" ]; then
977
977
  DENY_REASON=$(echo "$RESP" | jq -r '.hookSpecificOutput.permissionDecisionReason // ""' 2>/dev/null)
978
978
  synkro_log "editGuard $FILE_SHORT \u2192 BLOCKED: $DENY_REASON"
979
+ echo "$RESP"
979
980
  else
980
981
  synkro_log "editGuard $FILE_SHORT \u2192 pass"
982
+ RESP_WITH_MSG=$(echo "$RESP" | jq --arg m "[synkro] editGuard $FILE_SHORT \u2192 pass" '. + {systemMessage: $m}')
983
+ echo "$RESP_WITH_MSG"
981
984
  fi
982
985
 
983
- echo "$RESP"
984
986
  exit 0
985
987
  `;
986
988
  CC_EDIT_CAPTURE_SCRIPT = `#!/bin/bash
@@ -1193,12 +1195,7 @@ fi
1193
1195
 
1194
1196
  if [ -z "$RESP" ] || ! echo "$RESP" | jq -e 'type == "object"' >/dev/null 2>&1; then
1195
1197
  synkro_log "editScan $BASENAME \u2192 error (no response)"
1196
- if [ "\${SYNKRO_VERBOSE:-0}" = "1" ]; then
1197
- SYS_MSG="[synkro] afterFileEdit \u2192 scanned \${BASENAME} (grader unavailable)"
1198
- jq -n --arg sys_msg "$SYS_MSG" '{ systemMessage: $sys_msg }'
1199
- exit 0
1200
- fi
1201
- echo '{}'
1198
+ jq -n --arg m "[synkro] editScan $BASENAME \u2192 error (no response)" '{systemMessage: $m}'
1202
1199
  exit 0
1203
1200
  fi
1204
1201
 
@@ -1209,7 +1206,7 @@ REASON=$(echo "$RESP" | jq -r '.reason // ""' 2>/dev/null)
1209
1206
 
1210
1207
  if [ "$OK" = "false" ] && [ -n "$REASON" ]; then
1211
1208
  synkro_log "editScan $BASENAME \u2192 FAIL ($CATEGORY): $REASON"
1212
- SYS_MSG="[synkro] afterFileEdit \u2192 Finding in \${BASENAME}: \${REASON}"
1209
+ SYS_MSG="[synkro] editScan $BASENAME \u2192 FAIL: \${REASON}"
1213
1210
  ADDITIONAL_CTX="Synkro post-edit grader flagged \${BASENAME} (severity: \${SEVERITY}, category: \${CATEGORY}). Re-edit the file applying the retry guidance: \${REASON}"
1214
1211
  jq -n \\
1215
1212
  --arg sys_msg "$SYS_MSG" \\
@@ -1225,14 +1222,7 @@ if [ "$OK" = "false" ] && [ -n "$REASON" ]; then
1225
1222
  fi
1226
1223
 
1227
1224
  synkro_log "editScan $BASENAME \u2192 pass"
1228
-
1229
- if [ "\${SYNKRO_VERBOSE:-0}" = "1" ]; then
1230
- SYS_MSG="[synkro] afterFileEdit \u2192 no issues in \${BASENAME}"
1231
- jq -n --arg sys_msg "$SYS_MSG" '{ systemMessage: $sys_msg }'
1232
- exit 0
1233
- fi
1234
-
1235
- echo '{}'
1225
+ jq -n --arg m "[synkro] editScan $BASENAME \u2192 pass" '{systemMessage: $m}'
1236
1226
  exit 0
1237
1227
  `;
1238
1228
  CC_STOP_SUMMARY_SCRIPT = `#!/bin/bash
@@ -2222,7 +2212,7 @@ function writeConfigEnv(opts) {
2222
2212
  `SYNKRO_GATEWAY_URL=${shellQuoteSingle(safeGateway)}`,
2223
2213
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
2224
2214
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
2225
- `SYNKRO_VERSION=${shellQuoteSingle("1.2.0")}`
2215
+ `SYNKRO_VERSION=${shellQuoteSingle("1.2.1")}`
2226
2216
  ];
2227
2217
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
2228
2218
  if (safeOrgId) lines.push(`SYNKRO_ORG_ID=${shellQuoteSingle(safeOrgId)}`);