@synkro-sh/cli 1.4.39 → 1.4.40
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 +9 -11
- package/dist/bootstrap.js.map +1 -1
- package/package.json +1 -1
package/dist/bootstrap.js
CHANGED
|
@@ -763,7 +763,7 @@ if [ "$ROUTE" = "local" ]; then
|
|
|
763
763
|
# \u2500\u2500\u2500 Local grading (local_only privacy or local-cc channel) \u2500\u2500\u2500
|
|
764
764
|
GRADER_FILE=$(mktemp -t synkro-bash.XXXXXX)
|
|
765
765
|
trap "rm -f \\"$GRADER_FILE\\"" EXIT
|
|
766
|
-
printf 'Working directory: %s\\nRepo: %s\\nCommand: %s\\nUser intent: %s\\nOrg rules: %s\\n' "\${CWD:-.}" "\${GIT_REPO:-unknown}" "$COMMAND" "\${USER_INTENT:-none stated}" "\${SYNKRO_RULES:-[]}" > "$GRADER_FILE"
|
|
766
|
+
printf 'Working directory: %s\\nRepo: %s\\nCommand: %s\\nUser intent (last human message): %s\\nOrg rules: %s\\n' "\${CWD:-.}" "\${GIT_REPO:-unknown}" "$COMMAND" "\${USER_INTENT:-none stated}" "\${SYNKRO_RULES:-[]}" > "$GRADER_FILE"
|
|
767
767
|
|
|
768
768
|
CC_RESP=$(synkro_local_grade bash < "$GRADER_FILE" 2>&1)
|
|
769
769
|
if [ $? -ne 0 ]; then
|
|
@@ -784,10 +784,9 @@ if [ "$ROUTE" = "local" ]; then
|
|
|
784
784
|
synkro_dispatch_capture "bash" "warning" "\${LOCAL_SEV}" "\${LOCAL_CAT}" "$TOOL_NAME" "$GIT_REPO" "$SESSION_ID" \\
|
|
785
785
|
"$COMMAND" "$LOCAL_REASON" "\${SYNKRO_RULES:-[]}" "$VIOLATED_JSON" "\${RECENT_USER_MESSAGES:-[]}"
|
|
786
786
|
else
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
'{systemMessage:$reason,hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:$dec,permissionDecisionReason:$reason,additionalContext:$ctx}}'
|
|
787
|
+
REASON="$TAG bashGuard \u2192 blocked\${LOCAL_RULE_ID:+ ($LOCAL_RULE_ID)}: \${LOCAL_REASON:-policy violation}. Ask the user for explicit consent before retrying."
|
|
788
|
+
jq -n --arg reason "$REASON" \\
|
|
789
|
+
'{systemMessage:$reason,hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$reason,additionalContext:$reason}}'
|
|
791
790
|
synkro_dispatch_capture "bash" "block" "\${LOCAL_SEV}" "\${LOCAL_CAT}" "$TOOL_NAME" "$GIT_REPO" "$SESSION_ID" \\
|
|
792
791
|
"$COMMAND" "$LOCAL_REASON" "\${SYNKRO_RULES:-[]}" "$VIOLATED_JSON" "\${RECENT_USER_MESSAGES:-[]}"
|
|
793
792
|
fi
|
|
@@ -960,7 +959,7 @@ if [ "$ROUTE" = "local" ]; then
|
|
|
960
959
|
# \u2500\u2500\u2500 Local grading (local_only privacy or local-cc channel) \u2500\u2500\u2500
|
|
961
960
|
GRADER_FILE=$(mktemp -t synkro-edit.XXXXXX)
|
|
962
961
|
trap "rm -f \\"$GRADER_FILE\\"" EXIT
|
|
963
|
-
printf 'Working directory: %s\\nRepo: %s\\nFile: %s\\nProposed content (first 4000 chars):\\n%s\\nUser intent: %s\\nOrg rules: %s\\n' "\${CWD:-.}" "\${GIT_REPO:-unknown}" "$FILE_PATH" "$(printf '%s' "$PROPOSED" | head -c 4000)" "\${USER_INTENT:-none stated}" "\${SYNKRO_RULES:-[]}" > "$GRADER_FILE"
|
|
962
|
+
printf 'Working directory: %s\\nRepo: %s\\nFile: %s\\nProposed content (first 4000 chars):\\n%s\\nUser intent (last human message): %s\\nOrg rules: %s\\n' "\${CWD:-.}" "\${GIT_REPO:-unknown}" "$FILE_PATH" "$(printf '%s' "$PROPOSED" | head -c 4000)" "\${USER_INTENT:-none stated}" "\${SYNKRO_RULES:-[]}" > "$GRADER_FILE"
|
|
964
963
|
|
|
965
964
|
CC_RESP=$(synkro_local_grade edit < "$GRADER_FILE" 2>&1)
|
|
966
965
|
if [ $? -ne 0 ]; then
|
|
@@ -982,10 +981,9 @@ if [ "$ROUTE" = "local" ]; then
|
|
|
982
981
|
synkro_dispatch_capture "edit" "warning" "\${LOCAL_SEV}" "\${LOCAL_CAT}" "$TOOL_NAME" "$GIT_REPO" "$SESSION_ID" \\
|
|
983
982
|
"$EDIT_CONTENT" "$LOCAL_REASON" "\${SYNKRO_RULES:-[]}" "$VIOLATED_JSON" "[]"
|
|
984
983
|
else
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
'{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:$dec,permissionDecisionReason:$reason,additionalContext:$ctx}}'
|
|
984
|
+
REASON="$TAG editGuard $FILE_SHORT \u2192 blocked\${LOCAL_RULE_ID:+ ($LOCAL_RULE_ID)}: \${LOCAL_REASON:-policy violation}. Ask the user for explicit consent before retrying."
|
|
985
|
+
jq -n --arg reason "$REASON" \\
|
|
986
|
+
'{systemMessage:$reason,hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$reason,additionalContext:$reason}}'
|
|
989
987
|
synkro_dispatch_capture "edit" "block" "\${LOCAL_SEV}" "\${LOCAL_CAT}" "$TOOL_NAME" "$GIT_REPO" "$SESSION_ID" \\
|
|
990
988
|
"$EDIT_CONTENT" "$LOCAL_REASON" "\${SYNKRO_RULES:-[]}" "$VIOLATED_JSON" "[]"
|
|
991
989
|
fi
|
|
@@ -3987,7 +3985,7 @@ function writeConfigEnv(opts) {
|
|
|
3987
3985
|
`SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
|
|
3988
3986
|
`SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
|
|
3989
3987
|
`SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
|
|
3990
|
-
`SYNKRO_VERSION=${shellQuoteSingle("1.4.
|
|
3988
|
+
`SYNKRO_VERSION=${shellQuoteSingle("1.4.40")}`
|
|
3991
3989
|
];
|
|
3992
3990
|
if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
|
|
3993
3991
|
if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
|