-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·58 lines (53 loc) · 1.7 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·58 lines (53 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
# Invoke a test payload against the local MCP and pretty-print the result.
#
# Usage:
# ./scripts/test.sh # default: berlin_hack_night
# ./scripts/test.sh launch_party
# ./scripts/test.sh wedding_after_party
# ./scripts/test.sh berlin_hack_night raw # full JSON, no summary
#
# Override target URL with LINEUP_URL=https://<tunnel>.alpic.dev
set -euo pipefail
source "$(dirname "$0")/_common.sh"
require_cmd jq curl
key="${1:-berlin_hack_night}"
mode="${2:-summary}"
target="${LINEUP_URL:-$LOCAL_URL}"
body="$(payload "$key")"
if [[ "$body" == "null" || -z "$body" ]]; then
err "no payload named '$key' in $PAYLOADS"
echo "Available:" >&2
jq -r 'keys[]' "$PAYLOADS" | sed 's/^/ - /' >&2
exit 2
fi
info "POST $target/mcp — payload: $key"
resp="$(mcp_post_url "$target" "$body")"
if echo "$resp" | jq -e '.error' >/dev/null 2>&1; then
err "MCP error:"
echo "$resp" | jq '.error'
exit 1
fi
case "$mode" in
raw)
echo "$resp" | jq .
;;
*)
echo "$resp" | jq '{
summary: .result.content[0].text,
event: {
title: .result.structuredContent.event.title,
date: .result.structuredContent.event.dateISO,
venue: .result.structuredContent.event.venue,
accent: .result.structuredContent.event.accentHex,
rsvpUrl: .result.structuredContent.event.rsvpUrl
},
attendees: [.result.structuredContent.badges[] | {name, role}],
svgSizes: {
eventQrBytes: (.result.structuredContent.event.qrSvg | length),
firstAvatarBytes: (.result.structuredContent.badges[0].avatarSvg | length),
firstVcardQrBytes: (.result.structuredContent.badges[0].vcardQrSvg | length)
}
}'
;;
esac