@synkro-sh/cli 1.3.37 → 1.3.39

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/README.md CHANGED
@@ -41,13 +41,17 @@ synkro disconnect
41
41
  npm uninstall -g @synkro-sh/cli
42
42
  ```
43
43
 
44
+ ## How it works
45
+
46
+ Synkro installs Claude Code hooks that intercept every Bash command and file edit your agent proposes. Each one runs through a safety judge before it executes. On a violation, the agent is told what's wrong and how to fix it — so it self-corrects on retry instead of asking you to babysit.
47
+
44
48
  ## Requirements
45
49
 
46
50
  Node 20+, [Claude Code](https://claude.com/claude-code), `jq`, `python3`.
47
51
 
48
52
  ## Help
49
53
 
50
- [synkro.sh](https://synkro.sh) · [Issues](https://github.com/synkro-sh/cli/issues)
54
+ [synkro.sh](https://synkro.sh) · [Issues](https://github.com/synkro-sh/synkro-cli/issues)
51
55
 
52
56
  ## License
53
57
 
package/dist/bootstrap.js CHANGED
@@ -1508,7 +1508,11 @@ if [ "$USE_LOCAL" = "true" ]; then
1508
1508
  if [ -n "$V_INNER" ]; then
1509
1509
  LOCAL_OK=$(printf '%s' "$V_INNER" | sed -nE 's|.*<ok>(.*)</ok>.*|\\1|p' | head -1)
1510
1510
  LOCAL_OK="\${LOCAL_OK:-true}"
1511
- # Extract first <violation>...</violation> block, then fields from it.
1511
+ # Top-level <reason> (clean diff). Skip text inside <violation>...</violation>
1512
+ # by stripping those blocks first so the regex doesn't grab a violation reason.
1513
+ OUTER_V=$(printf '%s' "$V_INNER" | sed -E 's|<violation>[^<]*(<[^/]+>[^<]*</[^>]+>[^<]*)*</violation>||g')
1514
+ OUTER_REASON=$(printf '%s' "$OUTER_V" | sed -nE 's|.*<reason>(.*)</reason>.*|\\1|p' | head -1)
1515
+ # First violation block fields (when ok=false).
1512
1516
  FIRST_V=$(printf '%s' "$V_INNER" | awk -v RS='</violation>' '/<violation>/{print; exit}')
1513
1517
  LOCAL_SEV=$(printf '%s' "$FIRST_V" | sed -nE 's|.*<severity>(.*)</severity>.*|\\1|p' | head -1)
1514
1518
  LOCAL_CAT=$(printf '%s' "$FIRST_V" | sed -nE 's|.*<category>(.*)</category>.*|\\1|p' | head -1)
@@ -1519,10 +1523,11 @@ if [ "$USE_LOCAL" = "true" ]; then
1519
1523
  --arg sev "\${LOCAL_SEV:-low}" \\
1520
1524
  --arg cat "\${LOCAL_CAT:-unspecified}" \\
1521
1525
  --arg reason "$LOCAL_REASON" \\
1526
+ --arg outer_reason "$OUTER_REASON" \\
1522
1527
  'if $ok == "false" then
1523
1528
  {ok: false, severity: $sev, category: $cat, reason: $reason}
1524
1529
  else
1525
- {ok: true, severity: "low", category: "clean", reason: ""}
1530
+ {ok: true, severity: "low", category: "clean", reason: $outer_reason}
1526
1531
  end')
1527
1532
  else
1528
1533
  RESP=""
@@ -1950,10 +1955,10 @@ Zero context bloat: 1 grade per process, system prompt via --system-prompt flag
1950
1955
  Warm steady-state: ~2-3s per grade. Cold fallback: ~5-6s if pre-warm not ready.
1951
1956
 
1952
1957
  Commands:
1953
- start [primer-path] - bring up daemon if not running
1954
- grade [primer-path] - read prompt from stdin, write verdict text to stdout
1955
- stop - terminate daemon
1956
- status - print "running"/"stopped"
1958
+ start - bring up daemon if not running (fetches primer from server)
1959
+ grade - read prompt from stdin, write verdict text to stdout
1960
+ stop - terminate daemon
1961
+ status - print "running"/"stopped"
1957
1962
  """
1958
1963
 
1959
1964
  import os, sys, json, socket, time, signal, fcntl, re, select
@@ -2429,7 +2434,7 @@ def main():
2429
2434
  args = args[2:]
2430
2435
 
2431
2436
  if len(args) < 1:
2432
- print("usage: grader_daemon.py [--mode <name>] {start|grade|stop|status} [primer-path]", file=sys.stderr)
2437
+ print("usage: grader_daemon.py [--mode <name>] {start|grade|stop|status}", file=sys.stderr)
2433
2438
  sys.exit(1)
2434
2439
  cmd = args[0]
2435
2440
  primer_path = args[1] if len(args) > 1 else None
@@ -3718,7 +3723,7 @@ function writeConfigEnv(opts) {
3718
3723
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
3719
3724
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
3720
3725
  `SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
3721
- `SYNKRO_VERSION=${shellQuoteSingle("1.3.37")}`
3726
+ `SYNKRO_VERSION=${shellQuoteSingle("1.3.39")}`
3722
3727
  ];
3723
3728
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
3724
3729
  if (safeOrgId) lines.push(`SYNKRO_ORG_ID=${shellQuoteSingle(safeOrgId)}`);