@soleur/opencode 3.393.3 → 3.393.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soleur/opencode",
3
- "version": "3.393.3",
3
+ "version": "3.393.4",
4
4
  "description": "Soleur AI organization plugin for OpenCode",
5
5
  "type": "module",
6
6
  "bin": {
@@ -116,14 +116,14 @@ session() {
116
116
  }
117
117
  fact() { python3 "$FACTS" "$@" 2>/dev/null || printf 'ERR'; }
118
118
  rcof() { cat "$1/rc" 2>/dev/null || printf 'none'; }
119
- stderr_has() { [[ -f "$1/stderr.txt" ]] && grep -qF -- "$2" "$1/stderr.txt"; } # file, never a pipe
120
- stdout_has() { [[ -f "$1/stdout.bin" ]] && grep -qaF -- "$2" "$1/stdout.bin"; }
119
+ stderr_has() { [[ -f "$1/stderr.txt" ]] || return 1; grep -qF -- "$2" "$1/stderr.txt"; } # file, never a pipe
120
+ stdout_has() { [[ -f "$1/stdout.bin" ]] || return 1; grep -qaF -- "$2" "$1/stdout.bin"; }
121
121
  # leaks <out> <id> — a response for <id> was DELIVERED and carries the sentinel
122
122
  leaks() { [[ "$(fact "$1" "$2" found)" == "1" && "$(fact "$1" "$2" sentinel)" != "0" ]]; }
123
123
  # delivered_ok <out> <id> — a RESULT for <id> was delivered: not a JSON-RPC error, not an isError result
124
124
  delivered_ok() { [[ "$(fact "$1" "$2" found)" == "1" && "$(fact "$1" "$2" jsonrpc_error)" == "0" && "$(fact "$1" "$2" isError)" != "true" ]]; }
125
125
  # started <out> — the proxy got past startup: not a refusal, and it logged the child
126
- started() { [[ "$(rcof "$1")" != "2" && "$(rcof "$1")" != "none" ]] && stderr_has "$1" 'child pgid'; }
126
+ started() { [[ "$(rcof "$1")" != "2" && "$(rcof "$1")" != "none" ]] || return 1; stderr_has "$1" 'child pgid'; }
127
127
  text_has() { [[ "$(fact "$1" "$2" text)" == *"$3"* ]]; }
128
128
  # `A && B` as a function's last list trips `set -e` when B fails, and pkill on an already-empty group fails
129
129
  reap_group() { local pg; pg="$(cat "$1/child_pgid" 2>/dev/null || true)"; if [[ -n "$pg" ]]; then pkill -KILL -g "$pg" 2>/dev/null || true; fi; }
@@ -98,7 +98,7 @@ LINES=0
98
98
 
99
99
  if [[ -s "$SHORTSTAT_TMP" ]]; then
100
100
  LINES=$(grep -oE '[0-9]+ (insertion|deletion)' "$SHORTSTAT_TMP" \
101
- | grep -oE '[0-9]+' | awk '{s+=$1} END {print s+0}')
101
+ | grep -oE '[0-9]+' | awk '{s+=$1} END {print s+0}') || true
102
102
  fi
103
103
 
104
104
  if (( LINES < SKIP_LINES_THRESHOLD )); then
@@ -100,7 +100,7 @@ esac
100
100
  # on founder hosts where `realpath -m` does not exist (BSD/macOS). Prints nothing on a missing dir.
101
101
  physdir() { ( cd -- "$1" 2>/dev/null && pwd -P ); }
102
102
  # physpath <path>: physical path of a file that may not exist yet, via its (existing) parent.
103
- physpath() { local d; d="$(physdir "$(dirname -- "$1")")" || return 1; [[ -n "$d" ]] && printf '%s/%s' "$d" "$(basename -- "$1")"; }
103
+ physpath() { local d; d="$(physdir "$(dirname -- "$1")")" || return 1; [[ -n "$d" ]] || return 1; printf '%s/%s' "$d" "$(basename -- "$1")"; }
104
104
  # assert_fixture_dir: the CANONICAL copy (byte-for-byte; fixture-dir-operand-assert.test.sh pins every copy). It refuses an
105
105
  # empty, relative, `..`-bearing or filesystem-root operand; the stage-a refresh calls it before each write.
106
106
  assert_fixture_dir() {
@@ -45,7 +45,7 @@ fi
45
45
 
46
46
  # Pattern 1: Linear issue identifier shape.
47
47
  if grep -qE '\b[A-Z]{2,}-[0-9]+\b' <<<"$input"; then
48
- match=$(printf '%s' "$input" | grep -oE '\b[A-Z]{2,}-[0-9]+\b' | head -n 1)
48
+ match=$(printf '%s' "$input" | grep -oE '\b[A-Z]{2,}-[0-9]+\b' | head -n 1) || true
49
49
  echo "FAIL: telemetry payload contains Linear identifier shape: $match" >&2
50
50
  exit 1
51
51
  fi
@@ -58,7 +58,7 @@ fi
58
58
 
59
59
  # Pattern 3: UUID-style ID (Linear's internal issue UUIDs).
60
60
  if grep -qE '\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b' <<<"$input"; then
61
- match=$(printf '%s' "$input" | grep -oE '\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b' | head -n 1)
61
+ match=$(printf '%s' "$input" | grep -oE '\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b' | head -n 1) || true
62
62
  echo "FAIL: telemetry payload contains UUID-style identifier: $match" >&2
63
63
  exit 1
64
64
  fi
@@ -43,7 +43,7 @@ input=$(cat -)
43
43
  count=0
44
44
  output="$input"
45
45
  for pattern in "${LINEAR_CDN_PATTERNS[@]}"; do
46
- matches=$(printf '%s' "$output" | grep -oE "$pattern" | wc -l | tr -d '[:space:]')
46
+ matches=$(printf '%s' "$output" | grep -oE "$pattern" | wc -l | tr -d '[:space:]') || true
47
47
  count=$((count + matches))
48
48
  output=$(printf '%s' "$output" | sed -E "s#$pattern#[linear-image: REDACTED]#g")
49
49
  done
@@ -341,7 +341,7 @@ if [[ ${#pins[@]} -gt 0 ]]; then
341
341
  # UNKNOWN — never as "the pin is fresh".
342
342
  if command -v gh >/dev/null 2>&1; then
343
343
  _tip="$(gh api repos/anthropics/claude-code-action/releases --jq '.[0].tag_name' 2>/dev/null || true)"
344
- _pin_sha="$(grep -ohE 'claude-code-action@[a-f0-9]{40}' "${pins[@]}" 2>/dev/null | head -1 | cut -d@ -f2)"
344
+ _pin_sha="$(grep -ohE 'claude-code-action@[a-f0-9]{40}' "${pins[@]}" 2>/dev/null | head -1 | cut -d@ -f2)" || true
345
345
  # These pins are annotated TAG objects, so git/tags resolves them. A pin
346
346
  # produced by pin-github-action/Dependabot is a plain COMMIT sha, where
347
347
  # git/tags 404s and commits/<sha> is the correct call — try both.
@@ -354,7 +354,8 @@ read_account() {
354
354
  example_resource_exists() {
355
355
  # REPLACE with the vendor read. The stand-in consults the local record only
356
356
  # because this template has no vendor to ask.
357
- [[ -f "$ENV_FILE" ]] && grep -aq '^EXAMPLE_PROVISIONED=' "$ENV_FILE"
357
+ [[ -f "$ENV_FILE" ]] || return 1
358
+ grep -aq '^EXAMPLE_PROVISIONED=' "$ENV_FILE"
358
359
  }
359
360
 
360
361
  plan_provision() {
@@ -58,7 +58,7 @@ extract_phase_counts() {
58
58
  | while IFS= read -r line; do
59
59
  grep -qE '[0-9]+ open, [0-9]+ closed' <<<"$line" || continue
60
60
  num="$(printf '%s\n' "$line" | sed -E 's/^\| Phase ([0-9]+).*/\1/')"
61
- counts="$(printf '%s\n' "$line" | grep -oE '[0-9]+ open, [0-9]+ closed' | head -1)"
61
+ counts="$(printf '%s\n' "$line" | grep -oE '[0-9]+ open, [0-9]+ closed' | head -1)" || true
62
62
  open="$(printf '%s\n' "$counts" | sed -E 's/^([0-9]+) open.*/\1/')"
63
63
  closed="$(printf '%s\n' "$counts" | sed -E 's/^[0-9]+ open, ([0-9]+) closed/\1/')"
64
64
  printf '%s|%s|%s\n' "$num" "$open" "$closed"
@@ -259,7 +259,7 @@ VERIFY_RESULT=$(
259
259
 
260
260
  CREATED_RESOURCES+=("cd ${PROVISIONING_DIR} && terraform destroy")
261
261
 
262
- TOKEN_STATUS=$(echo "$VERIFY_RESULT" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
262
+ TOKEN_STATUS=$(echo "$VERIFY_RESULT" | grep -o '"status":"[^"]*"' | cut -d'"' -f4) || true
263
263
  if [[ "$TOKEN_STATUS" == "active" ]]; then
264
264
  echo "Smoke-test passed: scoped token is active."
265
265
  else
@@ -279,7 +279,7 @@ echo ""
279
279
  -d "$SA_PAYLOAD"
280
280
  )
281
281
 
282
- SA_SLUG=$(echo "$SA_RESPONSE" | grep -o '"slug":"[^"]*"' | head -1 | cut -d'"' -f4)
282
+ SA_SLUG=$(echo "$SA_RESPONSE" | grep -o '"slug":"[^"]*"' | head -1 | cut -d'"' -f4) || true
283
283
  if [[ -z "$SA_SLUG" ]]; then
284
284
  echo "Error: Failed to create service account. Response:" >&2
285
285
  echo "$SA_RESPONSE" >&2
@@ -277,8 +277,8 @@ read -p "App installed? Type 'yes': " ACK
277
277
  # --- Verify App install ---
278
278
 
279
279
  INSTALL_JSON=$(gh api "/repos/${TENANT_ORG}/${SLUG}/installation" 2>/dev/null) || true
280
- INSTALL_CHECK=$(echo "$INSTALL_JSON" | grep -o '"actions":"[^"]*"' | head -1 | cut -d'"' -f4)
281
- REPO_SELECTION=$(echo "$INSTALL_JSON" | grep -o '"repository_selection":"[^"]*"' | head -1 | cut -d'"' -f4)
280
+ INSTALL_CHECK=$(echo "$INSTALL_JSON" | grep -o '"actions":"[^"]*"' | head -1 | cut -d'"' -f4) || true
281
+ REPO_SELECTION=$(echo "$INSTALL_JSON" | grep -o '"repository_selection":"[^"]*"' | head -1 | cut -d'"' -f4) || true
282
282
 
283
283
  if [[ "$REPO_SELECTION" == "all" ]]; then
284
284
  echo "ERROR: App installed org-wide (repository_selection=all). Must be 'selected' (single repo)." >&2
@@ -287,7 +287,7 @@ if [[ "$REPO_SELECTION" == "all" ]]; then
287
287
  fi
288
288
 
289
289
  if [[ "$INSTALL_CHECK" == "write" ]]; then
290
- INSTALL_ID=$(echo "$INSTALL_JSON" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
290
+ INSTALL_ID=$(echo "$INSTALL_JSON" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) || true
291
291
  CREATED_RESOURCES+=("gh api -X DELETE /app/installations/${INSTALL_ID}")
292
292
  echo "Verified: Soleur App installed with actions:write permission (repository_selection=${REPO_SELECTION:-selected})."
293
293
  else
@@ -112,7 +112,7 @@ if [[ -f "$SITE_DIR/sitemap.xml" ]]; then
112
112
  # check above; production robots.txt always has the line.
113
113
  if [[ -f "$SITE_DIR/robots.txt" ]] && grep -qiE '^Sitemap:' "$SITE_DIR/robots.txt"; then
114
114
  ROBOTS_HOST=$(grep -iE '^Sitemap:' "$SITE_DIR/robots.txt" \
115
- | sed -E 's|^[Ss]itemap:[[:space:]]*(https?://[^/]+).*|\1|' | head -1)
115
+ | sed -E 's|^[Ss]itemap:[[:space:]]*(https?://[^/]+).*|\1|' | head -1) || true
116
116
  if [[ "$SITEMAP_HOSTS" != "$ROBOTS_HOST" ]]; then
117
117
  fail "sitemap host ($SITEMAP_HOSTS) does not match robots.txt Sitemap line ($ROBOTS_HOST)"
118
118
  else
@@ -73,7 +73,7 @@ while IFS=':' read -r line rest; do
73
73
  host="${host,,}" # lowercase
74
74
  # Detect utm tag
75
75
  if grep -qE 'utm_(source|medium|campaign|term|content)=' <<<"$url"; then
76
- camp="$(echo "$url" | grep -oE 'utm_campaign=[^&[:space:]]+' | head -1 | cut -d'=' -f2)"
76
+ camp="$(echo "$url" | grep -oE 'utm_campaign=[^&[:space:]]+' | head -1 | cut -d'=' -f2)" || true
77
77
  if is_allowlisted_host "$host"; then
78
78
  # First-party + allowlisted campaign → LOW-RISK; non-allowlisted campaign on first-party host still REVIEW
79
79
  if [ -n "$camp" ] && ! is_allowed_campaign "$camp"; then
@@ -112,7 +112,7 @@ done < <(grep -niE -- "$brand_re" "$tmp" 2>/dev/null || true)
112
112
  # Simplified: any `fetch(...)` or `axios.post(...)` whose URL host is not allowlisted → HIGH-RISK.
113
113
  fetch_re='\b(fetch|axios\.post|axios\.put|http\.post)[[:space:]]*\([[:space:]]*["'"'"'`](https?://[^"'"'"'`)[:space:]]+)'
114
114
  while IFS= read -r match; do
115
- url="$(echo "$match" | grep -oE "$url_re" | head -1)"
115
+ url="$(echo "$match" | grep -oE "$url_re" | head -1)" || true
116
116
  [ -z "$url" ] && continue
117
117
  nh="${url#http://}"; nh="${nh#https://}"; host="${nh%%[/?#]*}"; host="${host,,}"
118
118
  if ! is_allowlisted_host "$host"; then