@mmerterden/multi-agent-pipeline 23.7.0 → 24.0.0
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/CHANGELOG.md +38 -1
- package/README.md +57 -24
- package/README.tr.md +41 -8
- package/SECURITY.md +3 -3
- package/docs/architecture.md +41 -4
- package/docs/ecosystem.md +15 -13
- package/docs/facts.json +5 -4
- package/docs/features.md +59 -15
- package/install/_codex-agents.mjs +13 -8
- package/install/_common.mjs +24 -0
- package/install/_dev-only-files.mjs +4 -0
- package/install/_mcp-register.mjs +6 -2
- package/install/_rewrite-tree.mjs +197 -0
- package/install/codex.mjs +96 -180
- package/install/copilot.mjs +24 -54
- package/install/index.mjs +29 -11
- package/install/templates/codex-instructions.md +21 -5
- package/install/templates/copilot-instructions.md +21 -14
- package/manifest.json +2082 -0
- package/package.json +6 -2
- package/pipeline/commands/multi-agent/SKILL.md +5 -4
- package/pipeline/commands/multi-agent/analysis/SKILL.md +4 -0
- package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +31 -3
- package/pipeline/commands/multi-agent/autopilot-status/SKILL.md +5 -1
- package/pipeline/commands/multi-agent/channels/SKILL.md +16 -8
- package/pipeline/commands/multi-agent/log/SKILL.md +2 -0
- package/pipeline/commands/multi-agent/stack/SKILL.md +1 -1
- package/pipeline/contract/manifest.json +1 -1
- package/pipeline/contract/types/index.d.ts +1 -0
- package/pipeline/lib/_jira-auth.sh +50 -78
- package/pipeline/lib/_service-account.sh +191 -0
- package/pipeline/lib/credential-inventory.sh +49 -37
- package/pipeline/lib/credential-store.sh +48 -3
- package/pipeline/lib/fetch-confluence.sh +76 -92
- package/pipeline/lib/fetch-crashlytics.sh +30 -59
- package/pipeline/lib/fetch-figma-annotations.sh +9 -9
- package/pipeline/lib/fetch-fortify.sh +77 -81
- package/pipeline/lib/fetch-graylog.sh +38 -77
- package/pipeline/lib/figma-mcp-refresh.sh +23 -4
- package/pipeline/lib/figma-screenshot.sh +7 -8
- package/pipeline/lib/figma-token.sh +39 -46
- package/pipeline/lib/host.mjs +138 -0
- package/pipeline/lib/host.sh +48 -0
- package/pipeline/lib/issue-fetcher.sh +25 -41
- package/pipeline/lib/jira-publish.sh +23 -21
- package/pipeline/lib/local-model.mjs +93 -0
- package/pipeline/lib/md2confluence-v3.py +37 -30
- package/pipeline/lib/model-dispatch.sh +41 -4
- package/pipeline/lib/model-resolve.mjs +58 -0
- package/pipeline/lib/post-pr-review.sh +38 -53
- package/pipeline/lib/reviewer-families.mjs +70 -0
- package/pipeline/lib/service-account.mjs +2131 -0
- package/pipeline/lib/service-account.sh +35 -0
- package/pipeline/lib/usage-token.mjs +64 -24
- package/pipeline/lib/usage-vocab.mjs +1 -1
- package/pipeline/lib/user-facing.mjs +11 -3
- package/pipeline/lib/vercel-deploy.sh +17 -26
- package/pipeline/multi-agent-refs/_entry-picker.md +62 -0
- package/pipeline/multi-agent-refs/analysis/intake.md +2 -0
- package/pipeline/multi-agent-refs/analysis/reusable-refs.md +1 -0
- package/pipeline/multi-agent-refs/analysis/unattended.md +135 -0
- package/pipeline/multi-agent-refs/autopilot-on/details.md +16 -0
- package/pipeline/multi-agent-refs/channels/generator.md +10 -2
- package/pipeline/multi-agent-refs/channels/menu.md +3 -1
- package/pipeline/multi-agent-refs/channels/preview.md +3 -1
- package/pipeline/multi-agent-refs/channels/reference.md +16 -2
- package/pipeline/multi-agent-refs/channels/report-file.md +188 -0
- package/pipeline/multi-agent-refs/cross-cli-contract.md +35 -27
- package/pipeline/multi-agent-refs/features/doctor.md +37 -11
- package/pipeline/multi-agent-refs/features/free-models.md +3 -3
- package/pipeline/multi-agent-refs/features/local-model.md +87 -0
- package/pipeline/multi-agent-refs/features/model-fallback.md +25 -10
- package/pipeline/multi-agent-refs/features/product-context.md +6 -5
- package/pipeline/multi-agent-refs/features/service-accounts.md +233 -0
- package/pipeline/multi-agent-refs/features/unattended-security.md +10 -1
- package/pipeline/multi-agent-refs/help/en.md +28 -1
- package/pipeline/multi-agent-refs/help/tr.md +28 -1
- package/pipeline/multi-agent-refs/orchestrator/copilot-pipeline.md +2 -1
- package/pipeline/multi-agent-refs/orchestrator/dispatcher.md +2 -1
- package/pipeline/multi-agent-refs/phases/modes.md +20 -1
- package/pipeline/multi-agent-refs/phases/phase-5-report.md +12 -10
- package/pipeline/multi-agent-refs/phases.md +4 -3
- package/pipeline/multi-agent-refs/review/panel.md +30 -18
- package/pipeline/multi-agent-refs/setup/discovery.md +17 -5
- package/pipeline/multi-agent-refs/setup/token-save-flow.md +21 -2
- package/pipeline/multi-agent-refs/sync/overview.md +11 -5
- package/pipeline/multi-agent-refs/tracker-contract.md +28 -10
- package/pipeline/office/index.html +3 -3
- package/pipeline/schemas/autopilot-config.schema.json +29 -4
- package/pipeline/schemas/hosts.json +512 -0
- package/pipeline/schemas/hosts.schema.json +310 -0
- package/pipeline/schemas/launch.json +22 -2
- package/pipeline/schemas/launch.schema.json +2 -1
- package/pipeline/schemas/phases.json +19 -1
- package/pipeline/schemas/phases.schema.json +8 -0
- package/pipeline/schemas/prefs.schema.json +331 -4
- package/pipeline/scripts/.doctor-mut.47076.mjs +2253 -0
- package/pipeline/scripts/_autopilot-config.mjs +67 -4
- package/pipeline/scripts/_autopilot-item.mjs +67 -0
- package/pipeline/scripts/_autopilot-outcomes.mjs +6 -0
- package/pipeline/scripts/_cost.mjs +75 -3
- package/pipeline/scripts/analysis-sources.mjs +22 -5
- package/pipeline/scripts/analysis-unattended.mjs +360 -0
- package/pipeline/scripts/anonymize-findings.mjs +3 -7
- package/pipeline/scripts/autopilot-arming.mjs +19 -10
- package/pipeline/scripts/autopilot-intake.mjs +124 -27
- package/pipeline/scripts/autopilot-menubar.swift +7 -0
- package/pipeline/scripts/autopilot-runner.mjs +77 -48
- package/pipeline/scripts/autopilot-status.sh +32 -9
- package/pipeline/scripts/bulk-read.sh +37 -5
- package/pipeline/scripts/confluence-readback.mjs +15 -7
- package/pipeline/scripts/cost-table.json +65 -25
- package/pipeline/scripts/doctor.mjs +119 -32
- package/pipeline/scripts/entry-mode.mjs +101 -0
- package/pipeline/scripts/estimate.mjs +30 -16
- package/pipeline/scripts/feedback-send.mjs +11 -8
- package/pipeline/scripts/gen-facts.mjs +7 -9
- package/pipeline/scripts/jira-attach.sh +23 -28
- package/pipeline/scripts/jira-search.sh +5 -21
- package/pipeline/scripts/launch-request.mjs +15 -9
- package/pipeline/scripts/migrate-prefs.mjs +56 -0
- package/pipeline/scripts/phase-tracker.sh +146 -38
- package/pipeline/scripts/priority-review.mjs +14 -7
- package/pipeline/scripts/product-context.mjs +26 -7
- package/pipeline/scripts/prune-logs.sh +4 -2
- package/pipeline/scripts/report-file.mjs +285 -0
- package/pipeline/scripts/rework-escalation.mjs +19 -4
- package/pipeline/scripts/service-read.mjs +19 -17
- package/pipeline/scripts/skill-siblings.mjs +17 -1
- package/pipeline/scripts/status-overview.mjs +20 -10
- package/pipeline/scripts/uninstall.mjs +145 -57
- package/pipeline/scripts/usage-register.mjs +34 -11
- package/pipeline/scripts/usage-report.mjs +31 -26
- package/pipeline/scripts/validate-triage.mjs +11 -1
- package/pipeline/scripts/work-items.mjs +25 -28
- package/pipeline/scripts/write-store-config.mjs +37 -11
- package/pipeline/skills/.skill-manifest.json +4 -4
- package/pipeline/skills/.skills-index.json +1 -1
- package/pipeline/skills/shared/core/multi-agent/SKILL.md +11 -3
- package/pipeline/skills/shared/core/multi-agent-analysis/SKILL.md +2 -0
- package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +11 -8
- package/pipeline/lib/credential-resolve.mjs +0 -75
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
# Credential resolution, in order:
|
|
20
20
|
# 1. FIREBASE_TOKEN_KEY (env override)
|
|
21
21
|
# 2. prefs.global.firebase.accounts[] entry whose projectId matches the URL
|
|
22
|
-
# 3.
|
|
22
|
+
# 3. the sole Firebase account (single-project setups)
|
|
23
23
|
# 4. "${USER}_Firebase_Access_Json"
|
|
24
24
|
#
|
|
25
25
|
# Output (stdout, single JSON object):
|
|
@@ -148,71 +148,42 @@ if [ "$PROBE" -eq 0 ] \
|
|
|
148
148
|
exit 4
|
|
149
149
|
fi
|
|
150
150
|
|
|
151
|
-
# Resolve the Firebase
|
|
151
|
+
# Resolve the Firebase service-account key for this project.
|
|
152
152
|
#
|
|
153
153
|
# One team routinely owns several Firebase projects - a legacy app and its
|
|
154
|
-
# redesign, or staging next to production -
|
|
155
|
-
# key.
|
|
156
|
-
#
|
|
157
|
-
#
|
|
158
|
-
|
|
159
|
-
#
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
import json, os
|
|
166
|
-
want = os.environ.get('WANT_PROJECT') or ''
|
|
167
|
-
try:
|
|
168
|
-
g = json.load(open('$PREFS')).get('global', {})
|
|
169
|
-
except Exception:
|
|
170
|
-
g = {}
|
|
171
|
-
for a in (g.get('firebase', {}) or {}).get('accounts') or []:
|
|
172
|
-
if isinstance(a, dict) and str(a.get('projectId') or '') == want and a.get('keychainKey'):
|
|
173
|
-
print('%s\t%s' % (a['keychainKey'], a.get('label') or a['projectId']))
|
|
174
|
-
break
|
|
175
|
-
else:
|
|
176
|
-
print('%s\t' % ((g.get('keychainMapping', {}) or {}).get('firebase') or ''))
|
|
177
|
-
" 2>/dev/null || printf '\t')
|
|
178
|
-
TOKEN_KEY=$(printf '%s' "$ACCOUNT_HIT" | cut -f1)
|
|
179
|
-
FIREBASE_ACCOUNT_LABEL=$(printf '%s' "$ACCOUNT_HIT" | cut -f2)
|
|
180
|
-
fi
|
|
181
|
-
[ -z "$TOKEN_KEY" ] && TOKEN_KEY="${USER}_Firebase_Access_Json"
|
|
182
|
-
|
|
183
|
-
# Locate the resolver with an existence check, not a `.`-chain.
|
|
184
|
-
#
|
|
185
|
-
# Sourcing a file that does not exist aborts the shell under `set -e` - `||` included -
|
|
186
|
-
# so `. <candidate> || . <candidate> || { error }` reaches neither its later candidates
|
|
187
|
-
# nor its error branch. Every fetcher used that shape starting from `$HOME/.claude/...`,
|
|
188
|
-
# so on a Copilot-only or Codex-only install they all died with a bare exit 1 and no
|
|
189
|
-
# message. Reordering does not help: whichever candidate is absent aborts at that point.
|
|
190
|
-
# Checking for the file before sourcing it is the only safe form.
|
|
191
|
-
for _cred_resolver in \
|
|
192
|
-
"$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)/credential-store-resolver.sh" \
|
|
193
|
-
"$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")/../lib" 2>/dev/null && pwd)/credential-store-resolver.sh" \
|
|
194
|
-
"$HOME/.claude/lib/credential-store-resolver.sh" \
|
|
195
|
-
"$HOME/.copilot/lib/credential-store-resolver.sh" \
|
|
196
|
-
"$HOME/.codex/lib/credential-store-resolver.sh"; do
|
|
197
|
-
[ -f "$_cred_resolver" ] || continue
|
|
198
|
-
# shellcheck source=/dev/null
|
|
199
|
-
. "$_cred_resolver" 2>/dev/null || true
|
|
200
|
-
# `if`, not `[ ... ] && break`: the latter is the loop body's last command and returns
|
|
201
|
-
# 1 when CRED_STORE is still empty, which under `set -e` kills the loop on the first
|
|
202
|
-
# candidate that does not resolve - the very case the loop exists to survive.
|
|
203
|
-
if [ -n "${CRED_STORE:-}" ]; then break; fi
|
|
204
|
-
done
|
|
205
|
-
unset _cred_resolver
|
|
206
|
-
if [ -z "${CRED_STORE:-}" ]; then
|
|
154
|
+
# redesign, or staging next to production - each with its own service-account
|
|
155
|
+
# key. The project id in the crash URL picks the account, so a URL from the
|
|
156
|
+
# other project resolves that project's key instead of failing the project_id
|
|
157
|
+
# check as if it were a configuration error.
|
|
158
|
+
_MA_FC_HERE="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
159
|
+
# shellcheck source=/dev/null
|
|
160
|
+
if [ -f "$_MA_FC_HERE/_service-account.sh" ]; then
|
|
161
|
+
. "$_MA_FC_HERE/_service-account.sh"
|
|
162
|
+
elif [ -f "$HOME/.claude/lib/_service-account.sh" ]; then
|
|
163
|
+
. "$HOME/.claude/lib/_service-account.sh"
|
|
164
|
+
else
|
|
207
165
|
[ "$PROBE" -eq 1 ] && probe_out unreachable no-credential-helper "$PROJECT_ID"
|
|
208
|
-
printf '%s\n' '{"status":"blocked","reason":"missing-credential-helper","service":"firebase"
|
|
166
|
+
printf '%s\n' '{"status":"blocked","reason":"missing-credential-helper","service":"firebase"}' >&2
|
|
209
167
|
exit 2
|
|
210
168
|
fi
|
|
211
169
|
|
|
212
|
-
|
|
170
|
+
FIREBASE_PICK=()
|
|
171
|
+
if [ -n "${FIREBASE_TOKEN_KEY:-}" ]; then
|
|
172
|
+
FIREBASE_PICK+=(--item "$FIREBASE_TOKEN_KEY")
|
|
173
|
+
elif [ -n "${PROJECT_ID:-}" ]; then
|
|
174
|
+
FIREBASE_PICK+=(--project-id "$PROJECT_ID")
|
|
175
|
+
fi
|
|
176
|
+
|
|
177
|
+
FIREBASE_ACCOUNT_LABEL=$(sa_run select --service firebase "${FIREBASE_PICK[@]+"${FIREBASE_PICK[@]}"}" |
|
|
178
|
+
node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{process.stdout.write(JSON.parse(s).account.label||"")}catch{process.stdout.write("")}})' 2>/dev/null || true)
|
|
179
|
+
|
|
180
|
+
# The key is a service-account JSON handed to a Google client, not a header we
|
|
181
|
+
# write, so the value is produced rather than a curl config.
|
|
182
|
+
SA_JSON_RAW=$(sa_token firebase "https://oauth2.googleapis.com/token" \
|
|
183
|
+
"${FIREBASE_PICK[@]+"${FIREBASE_PICK[@]}"}" 2>/dev/null || true)
|
|
213
184
|
if [ -z "$SA_JSON_RAW" ]; then
|
|
214
185
|
[ "$PROBE" -eq 1 ] && probe_out no-credential nothing-stored "$PROJECT_ID"
|
|
215
|
-
printf '%s\n' '{"status":"blocked","reason":"missing-token","service":"firebase","
|
|
186
|
+
printf '%s\n' '{"status":"blocked","reason":"missing-token","service":"firebase","projectId":"'"$PROJECT_ID"'"}' >&2
|
|
216
187
|
exit 2
|
|
217
188
|
fi
|
|
218
189
|
|
|
@@ -252,7 +223,7 @@ if [ -n "$SA_PROJECT" ] && [ "$SA_PROJECT" != "$PROJECT_ID" ]; then
|
|
|
252
223
|
# with several Firebase projects in play, "project mismatch" alone does not
|
|
253
224
|
# tell you whether the URL is wrong or the mapping is missing an account.
|
|
254
225
|
echo "ERR: SA project_id ($SA_PROJECT) != URL project ($PROJECT_ID)" >&2
|
|
255
|
-
echo "
|
|
226
|
+
echo " account used: ${FIREBASE_ACCOUNT_LABEL:-firebase}" >&2
|
|
256
227
|
echo " map this project: prefs.global.firebase.accounts[] += {\"projectId\":\"$PROJECT_ID\",\"keychainKey\":\"<keychain-key>\"}" >&2
|
|
257
228
|
exit 5
|
|
258
229
|
fi
|
|
@@ -69,12 +69,12 @@ for _figma_token_lib in \
|
|
|
69
69
|
[ -f "$_figma_token_lib" ] || continue
|
|
70
70
|
# shellcheck source=/dev/null
|
|
71
71
|
. "$_figma_token_lib" 2>/dev/null || true
|
|
72
|
-
if command -v
|
|
72
|
+
if command -v figma_cfg >/dev/null 2>&1; then break; fi
|
|
73
73
|
done
|
|
74
74
|
unset _figma_token_lib
|
|
75
|
-
if ! command -v
|
|
76
|
-
|
|
77
|
-
figma_token_remediation() { printf 'figma-token.sh not found - reinstall the pipeline
|
|
75
|
+
if ! command -v figma_cfg >/dev/null 2>&1; then
|
|
76
|
+
figma_cfg() { return 2; }
|
|
77
|
+
figma_token_remediation() { printf 'figma-token.sh not found - reinstall the pipeline.'; }
|
|
78
78
|
fi
|
|
79
79
|
|
|
80
80
|
FIGMA_API="https://api.figma.com/v1"
|
|
@@ -114,8 +114,7 @@ fi
|
|
|
114
114
|
[ -z "$FILE_KEY" ] && die 1 "missing --file-key (or a --url to parse it from)"
|
|
115
115
|
[ -z "$NODE_IDS" ] && die 1 "missing --node-id (or a --url to parse it from)"
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
if [ -z "$FIGMA_TOKEN" ]; then
|
|
117
|
+
if ! figma_cfg "$FIGMA_API/files/$FILE_KEY"; then
|
|
119
118
|
printf '{"ok":false,"reason":"missing-token","source":"figma-rest","fileKey":"%s"}\n' "$FILE_KEY"
|
|
120
119
|
die 2 "$(figma_token_remediation)"
|
|
121
120
|
fi
|
|
@@ -123,9 +122,11 @@ fi
|
|
|
123
122
|
TMPDIR_A=$(mktemp -d "${TMPDIR:-/tmp}/figma-annot.XXXXXX")
|
|
124
123
|
trap 'rm -rf "$TMPDIR_A"' EXIT INT TERM
|
|
125
124
|
|
|
126
|
-
# curl one /nodes batch
|
|
125
|
+
# curl one /nodes batch. The config carries the URL as well as the credential,
|
|
126
|
+
# so the two cannot be separated and a redirect is refused, not followed.
|
|
127
127
|
curl_nodes() {
|
|
128
128
|
local out="$1" ids="$2" code
|
|
129
|
+
figma_cfg "$FIGMA_API/files/$FILE_KEY/nodes?ids=$ids" || { printf '000'; return 0; }
|
|
129
130
|
# curl already writes "000" via -w on a total connection failure (and
|
|
130
131
|
# still exits non-zero for it, which the inner `|| echo "000"` used to
|
|
131
132
|
# catch too - so `code` became the literal string "000000", never
|
|
@@ -134,8 +135,7 @@ curl_nodes() {
|
|
|
134
135
|
# into $code; `:-000` only fills in when curl fails before -w ever runs.
|
|
135
136
|
code=$(curl -sS -o "$out" -w '%{http_code}' \
|
|
136
137
|
--max-time "$HTTP_TIMEOUT" --connect-timeout 5 \
|
|
137
|
-
|
|
138
|
-
"$FIGMA_API/files/$FILE_KEY/nodes?ids=$ids") || true
|
|
138
|
+
--config "$FIGMA_CFG") || true
|
|
139
139
|
code="${code:-000}"
|
|
140
140
|
printf '%s' "$code"
|
|
141
141
|
}
|
|
@@ -15,14 +15,17 @@
|
|
|
15
15
|
# the person reading the ticket never needed the URL.
|
|
16
16
|
#
|
|
17
17
|
# Required configuration:
|
|
18
|
-
#
|
|
19
|
-
#
|
|
18
|
+
# a Fortify account - its host is the SSC, its token slot
|
|
19
|
+
# holds the API token; add one with
|
|
20
|
+
# /multi-agent:setup
|
|
20
21
|
# prefs.global.fortify.versionIds[] - project versions searched, in order,
|
|
21
22
|
# when only an instance id is known
|
|
22
23
|
#
|
|
23
24
|
# Optional env:
|
|
24
25
|
# FORTIFY_TIMEOUT_SECONDS default 25
|
|
25
|
-
# FORTIFY_HOST_OVERRIDE
|
|
26
|
+
# FORTIFY_HOST_OVERRIDE names which account to use, when more than one is
|
|
27
|
+
# configured. It still has to be a host an account
|
|
28
|
+
# covers: an override picks, it does not excuse.
|
|
26
29
|
# FORTIFY_AUTH_SCHEME auto|bearer|fortifytoken (default: auto)
|
|
27
30
|
#
|
|
28
31
|
# Output (stdout, single JSON object):
|
|
@@ -46,8 +49,9 @@
|
|
|
46
49
|
# 2 missing/expired credential (orchestrator handles the Save Flow)
|
|
47
50
|
# 3 network/auth failure
|
|
48
51
|
# 4 bad usage
|
|
49
|
-
# 6 not configured (
|
|
50
|
-
# lookup with no prefs.global.fortify.versionIds
|
|
52
|
+
# 6 not configured (no Fortify account, no account covering the host asked
|
|
53
|
+
# for, or an instance-id-only lookup with no prefs.global.fortify.versionIds
|
|
54
|
+
# to search)
|
|
51
55
|
#
|
|
52
56
|
# Phase 3 review gate contract:
|
|
53
57
|
# Critical > 0 → blocking=true, reason="critical-findings"
|
|
@@ -79,24 +83,51 @@ while [ $# -gt 0 ]; do
|
|
|
79
83
|
esac
|
|
80
84
|
done
|
|
81
85
|
|
|
82
|
-
#
|
|
86
|
+
# Which SSC this run talks to, and with which credential, is one decision: the
|
|
87
|
+
# account resolver makes it, and writes the credential only into a config
|
|
88
|
+
# pinned to the URL it checked.
|
|
83
89
|
PREFS="$HOME/.claude/multi-agent-preferences.json"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
")
|
|
90
|
+
_MA_FF_HERE="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
91
|
+
# shellcheck source=/dev/null
|
|
92
|
+
if [ -f "$_MA_FF_HERE/_service-account.sh" ]; then
|
|
93
|
+
. "$_MA_FF_HERE/_service-account.sh"
|
|
94
|
+
elif [ -f "$HOME/.claude/lib/_service-account.sh" ]; then
|
|
95
|
+
. "$HOME/.claude/lib/_service-account.sh"
|
|
96
|
+
else
|
|
97
|
+
printf '%s\n' '{"status":"blocked","reason":"missing-credential-helper","service":"fortify"}' >&2
|
|
98
|
+
exit 2
|
|
94
99
|
fi
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
|
|
101
|
+
SA_PICK=()
|
|
102
|
+
if [ -n "${FORTIFY_HOST_OVERRIDE:-}" ]; then
|
|
103
|
+
SA_PICK+=(--host "${FORTIFY_HOST_OVERRIDE%/}")
|
|
98
104
|
fi
|
|
99
|
-
|
|
105
|
+
|
|
106
|
+
fortify_blocked() {
|
|
107
|
+
local reason code
|
|
108
|
+
case "$(sa_code)" in
|
|
109
|
+
host-mismatch|no-account-for-target|identity-mismatch|insecure-url)
|
|
110
|
+
reason="host-not-allowed"; code=6 ;;
|
|
111
|
+
not-configured|unknown-account)
|
|
112
|
+
# No account exists. That is a credential still to be saved when
|
|
113
|
+
# something says where this SSC is - the file, or the caller's own
|
|
114
|
+
# override - and a missing configuration when nothing does.
|
|
115
|
+
if [ -n "${FORTIFY_HOST_OVERRIDE:-}" ] || [ "$(sa_field hostKnown)" = "true" ]; then
|
|
116
|
+
reason="missing-token"; code=2
|
|
117
|
+
else
|
|
118
|
+
reason="host-not-configured"; code=6
|
|
119
|
+
fi ;;
|
|
120
|
+
prefs-unreadable|invalid-config)
|
|
121
|
+
reason="host-not-configured"; code=6 ;;
|
|
122
|
+
store-unavailable)
|
|
123
|
+
reason="missing-credential-helper"; code=2 ;;
|
|
124
|
+
*)
|
|
125
|
+
reason="missing-token"; code=2 ;;
|
|
126
|
+
esac
|
|
127
|
+
printf '%s\n' '{"status":"blocked","reason":"'"$reason"'","service":"fortify","expected_pref":"global.hosts.fortify"}' >&2
|
|
128
|
+
exit "$code"
|
|
129
|
+
}
|
|
130
|
+
|
|
100
131
|
|
|
101
132
|
# Parse URL components when present.
|
|
102
133
|
if [ -n "$URL" ] && [ -z "$VERSION_ID" ]; then
|
|
@@ -144,78 +175,43 @@ if [ -z "$VERSION_ID" ] && [ -z "$VERSION_CANDIDATES" ]; then
|
|
|
144
175
|
exit 6
|
|
145
176
|
fi
|
|
146
177
|
|
|
147
|
-
#
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
p = json.load(open('$PREFS'))
|
|
154
|
-
print(p.get('global', {}).get('keychainMapping', {}).get('fortify') or '')
|
|
155
|
-
except Exception:
|
|
156
|
-
print('')
|
|
157
|
-
")
|
|
158
|
-
fi
|
|
159
|
-
[ -z "$TOKEN_KEY" ] && TOKEN_KEY="${USER}_Fortify_Access_Token"
|
|
160
|
-
|
|
161
|
-
# Locate the resolver with an existence check, not a `.`-chain.
|
|
162
|
-
#
|
|
163
|
-
# Sourcing a file that does not exist aborts the shell under `set -e` - `||` included -
|
|
164
|
-
# so `. <candidate> || . <candidate> || { error }` reaches neither its later candidates
|
|
165
|
-
# nor its error branch. Every fetcher used that shape starting from `$HOME/.claude/...`,
|
|
166
|
-
# so on a Copilot-only or Codex-only install they all died with a bare exit 1 and no
|
|
167
|
-
# message. Reordering does not help: whichever candidate is absent aborts at that point.
|
|
168
|
-
# Checking for the file before sourcing it is the only safe form.
|
|
169
|
-
for _cred_resolver in \
|
|
170
|
-
"$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)/credential-store-resolver.sh" \
|
|
171
|
-
"$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")/../lib" 2>/dev/null && pwd)/credential-store-resolver.sh" \
|
|
172
|
-
"$HOME/.claude/lib/credential-store-resolver.sh" \
|
|
173
|
-
"$HOME/.copilot/lib/credential-store-resolver.sh" \
|
|
174
|
-
"$HOME/.codex/lib/credential-store-resolver.sh"; do
|
|
175
|
-
[ -f "$_cred_resolver" ] || continue
|
|
176
|
-
# shellcheck source=/dev/null
|
|
177
|
-
. "$_cred_resolver" 2>/dev/null || true
|
|
178
|
-
# `if`, not `[ ... ] && break`: the latter is the loop body's last command and returns
|
|
179
|
-
# 1 when CRED_STORE is still empty, which under `set -e` kills the loop on the first
|
|
180
|
-
# candidate that does not resolve - the very case the loop exists to survive.
|
|
181
|
-
if [ -n "${CRED_STORE:-}" ]; then break; fi
|
|
182
|
-
done
|
|
183
|
-
unset _cred_resolver
|
|
184
|
-
if [ -z "${CRED_STORE:-}" ]; then
|
|
185
|
-
printf '%s\n' '{"status":"blocked","reason":"missing-credential-helper","service":"fortify","expected_key":"'"$TOKEN_KEY"'"}' >&2
|
|
186
|
-
exit 2
|
|
187
|
-
fi
|
|
188
|
-
|
|
189
|
-
TOKEN=$("$CRED_STORE" get "$TOKEN_KEY" 2>/dev/null || true)
|
|
190
|
-
if [ -z "$TOKEN" ]; then
|
|
191
|
-
printf '%s\n' '{"status":"blocked","reason":"missing-token","service":"fortify","expected_key":"'"$TOKEN_KEY"'"}' >&2
|
|
192
|
-
exit 2
|
|
178
|
+
# Settled after the invocation is known to be well formed, so a usage error is
|
|
179
|
+
# reported as one rather than as a credential problem.
|
|
180
|
+
HOST="$(sa_host fortify "${SA_PICK[@]+"${SA_PICK[@]}"}")" || fortify_blocked
|
|
181
|
+
if [ -z "$HOST" ]; then
|
|
182
|
+
printf '%s\n' '{"status":"blocked","reason":"host-not-configured","service":"fortify","expected_pref":"global.hosts.fortify"}' >&2
|
|
183
|
+
exit 6
|
|
193
184
|
fi
|
|
194
185
|
|
|
195
186
|
API_BASE="https://$HOST/ssc/api/v1"
|
|
196
187
|
|
|
188
|
+
# Settled before the first request, outside any command substitution, so a
|
|
189
|
+
# missing credential exits with the contract's own status rather than reading
|
|
190
|
+
# as an authentication failure later.
|
|
191
|
+
sa_cfg fortify "$API_BASE/projectVersions" bearer "${SA_PICK[@]+"${SA_PICK[@]}"}" >/dev/null || fortify_blocked
|
|
192
|
+
|
|
197
193
|
fortify_get() {
|
|
198
194
|
# Usage: fortify_get <path-relative-to-API_BASE>
|
|
199
195
|
local path="$1"
|
|
200
196
|
local url="$API_BASE/$path"
|
|
201
|
-
local resp http
|
|
197
|
+
local resp http cfg
|
|
198
|
+
local -a schemes
|
|
202
199
|
case "$AUTH_SCHEME" in
|
|
203
|
-
bearer) schemes=
|
|
204
|
-
fortifytoken) schemes=
|
|
205
|
-
*) schemes=
|
|
200
|
+
bearer) schemes=(bearer) ;;
|
|
201
|
+
fortifytoken) schemes=(fortify-token) ;;
|
|
202
|
+
*) schemes=(bearer fortify-token) ;;
|
|
206
203
|
esac
|
|
207
|
-
for s in $schemes; do
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
# token never appears in argv (argv is visible to ps).
|
|
204
|
+
for s in "${schemes[@]}"; do
|
|
205
|
+
# A refusal here cannot exit: this function is called from a command
|
|
206
|
+
# substitution, where an exit ends only the subshell. The account was
|
|
207
|
+
# already settled before the first request, so this reads as auth failure.
|
|
208
|
+
cfg="$(sa_cfg fortify "$url" "$s" "${SA_PICK[@]+"${SA_PICK[@]}"}")" || {
|
|
209
|
+
printf 'HTTP_AUTH_FAILED'
|
|
210
|
+
return 1
|
|
211
|
+
}
|
|
216
212
|
resp=$(curl -sS --max-time "$TIMEOUT" --connect-timeout 5 -w "\n%{http_code}" \
|
|
217
|
-
|
|
218
|
-
-H "Accept: application/json"
|
|
213
|
+
--config "$cfg" \
|
|
214
|
+
-H "Accept: application/json" 2>/dev/null || true)
|
|
219
215
|
http=$(printf '%s' "$resp" | tail -n1)
|
|
220
216
|
if [ "$http" = "200" ]; then
|
|
221
217
|
printf '%s' "$resp" | sed '$d'
|
|
@@ -22,12 +22,14 @@
|
|
|
22
22
|
# `--env prod` / `--env test` pin a single instance.
|
|
23
23
|
#
|
|
24
24
|
# Required configuration:
|
|
25
|
-
#
|
|
26
|
-
#
|
|
25
|
+
# the prod account's host - production instance (e.g. logs.example.com)
|
|
26
|
+
# a graylog account scoped to prod - its token slot holds the API token
|
|
27
27
|
# Optional (test environment):
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
28
|
+
# the test account's host - test instance; without one, test is skipped
|
|
29
|
+
# a graylog account scoped to test - its own token. A deployment that
|
|
30
|
+
# issues one token for both names
|
|
31
|
+
# the same store item in both
|
|
32
|
+
# accounts
|
|
31
33
|
#
|
|
32
34
|
# Optional env:
|
|
33
35
|
# GRAYLOG_TIMEOUT_SECONDS default 25
|
|
@@ -93,36 +95,21 @@ case "$ENVIRONMENT" in
|
|
|
93
95
|
*) echo "ERR: --env must be auto, prod or test (got '$ENVIRONMENT')" >&2; exit 4 ;;
|
|
94
96
|
esac
|
|
95
97
|
|
|
96
|
-
|
|
97
|
-
#
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
node = json.load(open('$PREFS')).get('global', {})
|
|
107
|
-
for part in os.environ['PREF_PATH'].split('.'):
|
|
108
|
-
node = node.get(part, {}) if isinstance(node, dict) else {}
|
|
109
|
-
print(node if isinstance(node, str) else '')
|
|
110
|
-
except Exception:
|
|
111
|
-
print('')
|
|
112
|
-
" 2>/dev/null || printf ''
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
HOST_PROD=$(pref_str hosts.graylog)
|
|
116
|
-
HOST_TEST=$(pref_str hosts.graylogTest)
|
|
117
|
-
HOST_PROD=${HOST_PROD%/}
|
|
118
|
-
HOST_TEST=${HOST_TEST%/}
|
|
98
|
+
_MA_GL_HERE="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
99
|
+
# shellcheck source=/dev/null
|
|
100
|
+
if [ -f "$_MA_GL_HERE/_service-account.sh" ]; then
|
|
101
|
+
. "$_MA_GL_HERE/_service-account.sh"
|
|
102
|
+
elif [ -f "$HOME/.claude/lib/_service-account.sh" ]; then
|
|
103
|
+
. "$HOME/.claude/lib/_service-account.sh"
|
|
104
|
+
else
|
|
105
|
+
printf '%s\n' '{"status":"blocked","reason":"missing-credential-helper","service":"graylog"}' >&2
|
|
106
|
+
exit 2
|
|
107
|
+
fi
|
|
119
108
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
KEY_TEST=$(pref_str keychainMapping.graylog_test)
|
|
125
|
-
[ -z "$KEY_TEST" ] && KEY_TEST="$KEY_PROD"
|
|
109
|
+
# Each instance is an account of its own, scoped to its environment, so a test
|
|
110
|
+
# token can never be sent to production and the other way round.
|
|
111
|
+
HOST_PROD="$(sa_host graylog --environment production 2>/dev/null || true)"
|
|
112
|
+
HOST_TEST="$(sa_host graylog --environment test 2>/dev/null || true)"
|
|
126
113
|
|
|
127
114
|
if [ -z "$TRX_ID" ] && [ -z "$CONV_ID" ]; then
|
|
128
115
|
echo "ERR: no id (pass --trx <transaction-id> and/or --conv <conversation-id>)" >&2
|
|
@@ -143,33 +130,6 @@ if [ -n "$CONV_ID" ]; then
|
|
|
143
130
|
fi
|
|
144
131
|
|
|
145
132
|
# Locate the resolver with an existence check, not a `.`-chain.
|
|
146
|
-
#
|
|
147
|
-
# Sourcing a file that does not exist aborts the shell under `set -e` - `||` included -
|
|
148
|
-
# so `. <candidate> || . <candidate> || { error }` reaches neither its later candidates
|
|
149
|
-
# nor its error branch. Every fetcher used that shape starting from `$HOME/.claude/...`,
|
|
150
|
-
# so on a Copilot-only or Codex-only install they all died with a bare exit 1 and no
|
|
151
|
-
# message. Reordering does not help: whichever candidate is absent aborts at that point.
|
|
152
|
-
# Checking for the file before sourcing it is the only safe form.
|
|
153
|
-
for _cred_resolver in \
|
|
154
|
-
"$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)/credential-store-resolver.sh" \
|
|
155
|
-
"$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")/../lib" 2>/dev/null && pwd)/credential-store-resolver.sh" \
|
|
156
|
-
"$HOME/.claude/lib/credential-store-resolver.sh" \
|
|
157
|
-
"$HOME/.copilot/lib/credential-store-resolver.sh" \
|
|
158
|
-
"$HOME/.codex/lib/credential-store-resolver.sh"; do
|
|
159
|
-
[ -f "$_cred_resolver" ] || continue
|
|
160
|
-
# shellcheck source=/dev/null
|
|
161
|
-
. "$_cred_resolver" 2>/dev/null || true
|
|
162
|
-
# `if`, not `[ ... ] && break`: the latter is the loop body's last command and returns
|
|
163
|
-
# 1 when CRED_STORE is still empty, which under `set -e` kills the loop on the first
|
|
164
|
-
# candidate that does not resolve - the very case the loop exists to survive.
|
|
165
|
-
if [ -n "${CRED_STORE:-}" ]; then break; fi
|
|
166
|
-
done
|
|
167
|
-
unset _cred_resolver
|
|
168
|
-
if [ -z "${CRED_STORE:-}" ]; then
|
|
169
|
-
printf '%s\n' '{"status":"blocked","reason":"missing-credential-helper","service":"graylog","expected_key":"'"$KEY_PROD"'"}' >&2
|
|
170
|
-
exit 2
|
|
171
|
-
fi
|
|
172
|
-
|
|
173
133
|
# Graylog relative universal search, built once and reused per environment.
|
|
174
134
|
ENC_QUERY=$(QUERY_IN="$QUERY" python3 -c "
|
|
175
135
|
import os, urllib.parse as up
|
|
@@ -183,22 +143,20 @@ RUN_BODY=""
|
|
|
183
143
|
RUN_HITS=0
|
|
184
144
|
|
|
185
145
|
run_search() {
|
|
186
|
-
# Usage: run_search <host> <
|
|
187
|
-
local host="$1"
|
|
188
|
-
|
|
189
|
-
|
|
146
|
+
# Usage: run_search <host> <environment>
|
|
147
|
+
local host="$1" environment="$2" url resp cfg
|
|
148
|
+
url="https://$host/api/$SEARCH_PATH"
|
|
149
|
+
# The config carries the URL as well as the credential, so this instance's
|
|
150
|
+
# token cannot travel to the other one, and a redirect is refused outright.
|
|
151
|
+
cfg=$(sa_cfg graylog "$url" graylog-pat --environment "$environment") || {
|
|
190
152
|
RUN_HTTP="no-token"; RUN_BODY=""; RUN_HITS=0
|
|
191
153
|
return 0
|
|
192
|
-
|
|
193
|
-
url="https://$host/api/$SEARCH_PATH"
|
|
194
|
-
# PAT basic auth: username=<token>, password=literal "token". The credential
|
|
195
|
-
# goes through a curl config via process substitution so it never lands in
|
|
196
|
-
# argv (argv is visible to ps).
|
|
154
|
+
}
|
|
197
155
|
resp=$(curl -sS --max-time "$TIMEOUT" --connect-timeout 5 -w "\n%{http_code}" \
|
|
198
|
-
|
|
156
|
+
--config "$cfg" \
|
|
199
157
|
-H "Accept: application/json" \
|
|
200
158
|
-H "X-Requested-By: multi-agent-pipeline" \
|
|
201
|
-
|
|
159
|
+
2>/dev/null || true)
|
|
202
160
|
RUN_HTTP=$(printf '%s' "$resp" | tail -n1)
|
|
203
161
|
RUN_BODY=$(printf '%s' "$resp" | sed '$d')
|
|
204
162
|
RUN_HITS=0
|
|
@@ -235,10 +193,13 @@ host_for() {
|
|
|
235
193
|
*) printf '%s' "$HOST_PROD" ;;
|
|
236
194
|
esac
|
|
237
195
|
}
|
|
238
|
-
|
|
196
|
+
# The accounts use the schema's vocabulary, which spells production in full;
|
|
197
|
+
# the flag and the reported environment stay the short form this script has
|
|
198
|
+
# always printed.
|
|
199
|
+
env_for() {
|
|
239
200
|
case "$1" in
|
|
240
|
-
test) printf '
|
|
241
|
-
*) printf '
|
|
201
|
+
test) printf 'test' ;;
|
|
202
|
+
*) printf 'production' ;;
|
|
242
203
|
esac
|
|
243
204
|
}
|
|
244
205
|
|
|
@@ -263,7 +224,7 @@ BODY=""
|
|
|
263
224
|
LAST_CANDIDATE="${CANDIDATES##* }"
|
|
264
225
|
for _env in $CANDIDATES; do
|
|
265
226
|
SEARCHED="${SEARCHED:+$SEARCHED }$_env"
|
|
266
|
-
run_search "$(host_for "$_env")" "$(
|
|
227
|
+
run_search "$(host_for "$_env")" "$(env_for "$_env")"
|
|
267
228
|
HOST=$(host_for "$_env")
|
|
268
229
|
ENV_USED="$_env"
|
|
269
230
|
HTTP="$RUN_HTTP"
|
|
@@ -282,7 +243,7 @@ for _env in $CANDIDATES; do
|
|
|
282
243
|
done
|
|
283
244
|
|
|
284
245
|
if [ "$HTTP" = "no-token" ]; then
|
|
285
|
-
printf '%s\n' '{"status":"blocked","reason":"missing-token","service":"graylog","
|
|
246
|
+
printf '%s\n' '{"status":"blocked","reason":"missing-token","service":"graylog","environment":"'"$(env_for "$ENV_USED")"'"}' >&2
|
|
286
247
|
exit 2
|
|
287
248
|
fi
|
|
288
249
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# expired-token decision (refs/keychain.md). Never prints token values - status lines only.
|
|
6
6
|
#
|
|
7
7
|
# Flow:
|
|
8
|
-
# 1.
|
|
8
|
+
# 1. Ask the account resolver which store item each slot lives in.
|
|
9
9
|
# 2. Read the refresh token from "<name>_Refresh" (written by the user's generation script).
|
|
10
10
|
# 3. Read client credentials from .figma-oauth.json next to prefs.global.tokenScripts.figma_mcp.
|
|
11
11
|
# 4. POST grant_type=refresh_token to the Figma token endpoint.
|
|
@@ -43,10 +43,29 @@ say() { printf '%s\n' "$*"; }
|
|
|
43
43
|
|
|
44
44
|
[ -f "$PREFS_FILE" ] || { say "figma-mcp-refresh: prefs file missing ($PREFS_FILE)"; exit 2; }
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
# The store item each slot lives in, named by the account rather than derived
|
|
47
|
+
# from a key here: a second place that builds the name is a second place that
|
|
48
|
+
# can be renamed out from under the first.
|
|
49
|
+
sa_item() {
|
|
50
|
+
local slot="$1" script
|
|
51
|
+
for script in \
|
|
52
|
+
"$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)/service-account.sh" \
|
|
53
|
+
"$HOME/.claude/lib/service-account.sh" \
|
|
54
|
+
"$HOME/.copilot/lib/service-account.sh" \
|
|
55
|
+
"$HOME/.codex/lib/service-account.sh"; do
|
|
56
|
+
[ -x "$script" ] || continue
|
|
57
|
+
bash "$script" item-ref --service figma_mcp --slot "$slot" 2>/dev/null |
|
|
58
|
+
jq -r '.itemName // empty'
|
|
59
|
+
return 0
|
|
60
|
+
done
|
|
61
|
+
return 0
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
KEY_NAME=$(sa_item token)
|
|
65
|
+
[ -n "$KEY_NAME" ] || { say "figma-mcp-refresh: no Figma MCP account is configured"; exit 2; }
|
|
48
66
|
|
|
49
|
-
REFRESH_KEY
|
|
67
|
+
REFRESH_KEY=$(sa_item refresh_token)
|
|
68
|
+
[ -n "$REFRESH_KEY" ] || REFRESH_KEY="${KEY_NAME}_Refresh"
|
|
50
69
|
|
|
51
70
|
# Locate the resolver with an existence check, not a `.`-chain.
|
|
52
71
|
#
|
|
@@ -90,12 +90,12 @@ for _figma_token_lib in \
|
|
|
90
90
|
[ -f "$_figma_token_lib" ] || continue
|
|
91
91
|
# shellcheck source=/dev/null
|
|
92
92
|
. "$_figma_token_lib" 2>/dev/null || true
|
|
93
|
-
if command -v
|
|
93
|
+
if command -v figma_cfg >/dev/null 2>&1; then break; fi
|
|
94
94
|
done
|
|
95
95
|
unset _figma_token_lib
|
|
96
|
-
if ! command -v
|
|
97
|
-
|
|
98
|
-
figma_token_remediation() { printf 'figma-token.sh not found - reinstall the pipeline
|
|
96
|
+
if ! command -v figma_cfg >/dev/null 2>&1; then
|
|
97
|
+
figma_cfg() { return 2; }
|
|
98
|
+
figma_token_remediation() { printf 'figma-token.sh not found - reinstall the pipeline.'; }
|
|
99
99
|
fi
|
|
100
100
|
|
|
101
101
|
FIGMA_API="https://api.figma.com/v1"
|
|
@@ -206,6 +206,7 @@ PY
|
|
|
206
206
|
curl_figma() {
|
|
207
207
|
local out="$1" url="$2"
|
|
208
208
|
local code attempt sleep_s
|
|
209
|
+
figma_cfg "$url" || { printf '000'; return 0; }
|
|
209
210
|
for attempt in 1 2 3; do
|
|
210
211
|
# Token header goes through a curl config via process substitution so it
|
|
211
212
|
# never appears in argv (argv is visible to ps).
|
|
@@ -220,8 +221,7 @@ curl_figma() {
|
|
|
220
221
|
# genuinely empty.
|
|
221
222
|
code=$(curl -sS -o "$out" -w '%{http_code}' \
|
|
222
223
|
--max-time "$HTTP_TIMEOUT" --connect-timeout 5 \
|
|
223
|
-
|
|
224
|
-
"$url") || true
|
|
224
|
+
--config "$FIGMA_CFG") || true
|
|
225
225
|
code="${code:-000}"
|
|
226
226
|
case "$code" in
|
|
227
227
|
2*) printf '%s' "$code"; return 0 ;;
|
|
@@ -446,8 +446,7 @@ require_cmd python3
|
|
|
446
446
|
# Tier 1 (Figma MCP) is not reachable from a bash script. Stay on Tier 2 (REST).
|
|
447
447
|
log "INFO: Tier 1 (Figma MCP) not available from shell; using Tier 2 (REST)."
|
|
448
448
|
|
|
449
|
-
|
|
450
|
-
if [ -z "${FIGMA_TOKEN:-}" ]; then
|
|
449
|
+
if ! figma_cfg "$FIGMA_API/files/${FILE_KEY:-x}"; then
|
|
451
450
|
log "Tier 3 (user-provided screenshot required): no PAT resolved."
|
|
452
451
|
log "Hint: $(figma_token_remediation)"
|
|
453
452
|
exit 3
|