The /client/imessage/send-queue/pending endpoint released up to 50 queued sends per poll, so an enqueued burst all fired at once. Add a configurable release cap: the endpoint now returns at most (maxSends − sent-in-window) queued items, so a burst queues and drips out at the configured rate. - macsync.send_rate_config single-row table, default max_sends=10, window_seconds=300 (10 per 5 min). - entities/send-queue repo: getSendRateConfig / setSendRateConfig / countSentWithin. - Admin control: GET/PUT /admin/send-rate-limit (service-token auth) so the cap is adjustable at runtime (wired to MCP via quinn.api separately). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
53 lines
1.5 KiB
Bash
Executable file
53 lines
1.5 KiB
Bash
Executable file
#!/bin/zsh
|
|
#
|
|
# ./run - convenient dev command for mac-sync
|
|
#
|
|
# Builds the web UI (so localhost:8765 gets fresh assets)
|
|
# then builds + launches the Mac agent.
|
|
#
|
|
# Usage:
|
|
# ./run # full build + launch
|
|
# ./run web # only rebuild web UI (then hard-refresh 8765)
|
|
# ./run swift # only rebuild the Swift app
|
|
#
|
|
# Before running:
|
|
# - Quit any existing "Mac Sync" menu bar agent first.
|
|
# - This launches the dev binary from .build/debug/, which
|
|
# serves http://localhost:8765 using the just-built web/dist/.
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
cmd=${1:-all}
|
|
|
|
case "$cmd" in
|
|
web)
|
|
echo "→ Building web UI only (skipping typecheck for quick release)..."
|
|
(cd web && bunx vite build)
|
|
echo "✅ web/dist/ updated with latest assets."
|
|
echo " Hard-refresh http://localhost:8765 (Cmd+Shift+R) or restart the agent to pick up new dist/."
|
|
;;
|
|
|
|
swift)
|
|
echo "→ Building MacSyncApp (Swift) only..."
|
|
swift build --product MacSyncApp
|
|
echo "✅ .build/debug/MacSyncApp updated."
|
|
;;
|
|
|
|
all|*)
|
|
echo "→ Building web UI (skipping typecheck for quick release)..."
|
|
(cd web && bunx vite build)
|
|
|
|
echo "→ Building MacSyncApp..."
|
|
swift build --product MacSyncApp
|
|
|
|
echo ""
|
|
echo "→ Launching dev MacSyncApp"
|
|
echo " (serves http://localhost:8765 using the fresh web/dist/)"
|
|
echo " Quit any previous 'Mac Sync' agent first if it's still running."
|
|
echo ""
|
|
|
|
exec ./.build/debug/MacSyncApp
|
|
;;
|
|
esac
|