Skip to content

t1k:marketing:store:vps-health

FieldValue
Modulestore
Version0.14.9
Effortlow
Tools—
/t1k:marketing:store:vps-health
[--dry-run] [--only <machine name>] [--keep-shots]

Every day at 09:00 (UTC+7) the timer visits each store VPS on vps.the1studio.org, opens the Google Play Console home in that machine’s already signed-in browser, reads it with the vision role, and posts one status message to the user’s own Discord channel. The message says “no issues” or names each problem: suspended, removed, rejected, policy issues, warnings, deadlines.

Read-only in every console. The only input is opening the console URL through the OS run dialog (a new tab in the signed-in profile), plus screenshots. Nothing is clicked inside a console page. The run dialog is verified by a screenshot before any text is typed, so keystrokes never reach a live console. A machine whose dialog cannot be verified is reported unchecked and nothing is typed.

Terminal window
set -a; . ~/.config/t1k/ads.env; set +a # DISCORD_WEBHOOK_URL (never printed)
bun .claude/skills/t1k-marketing-store-vps-health/scripts/store-vps-health.mjs --dry-run
bun .claude/skills/t1k-marketing-store-vps-health/scripts/store-vps-health.mjs --dry-run --only "S.H. ONG PRIVATE LIMITED"
FlagUse
--dry-runprint the Discord text, post nothing
--only <name>one machine by displayName (smoke runs)
--config <file>another selection/timing config (default store-vps-health.config.json)
--keep-shotskeep the PNGs under ~/.cache/store-vps-health/ (default: deleted after reading)

Exit 0 = all clear posted, 10 = issues found and posted, 2 = the run failed (fleet API unreachable, no webhook). The installed timer wrapper is ~/.local/bin/store-vps-health.sh (source of truth: scripts/store-vps-health.sh); it sources ~/.config/t1k/ads.env.

Data, not code: store-vps-health.config.json. A machine is checked when its description contains an include substring (store account, Play Console, Google Play account) or its name matches ^Store , and its name does not match an exclude regex (^AdMob, ^USA_). That selects the nine store machines: S.H. ONG PRIVATE LIMITED, TC BONG AIRCON SERVICES, BOOUNG PTE.TLD., Retention Brands Alltrue LLC, ADAPT FOR SUCCESS LIMITED, Zenify Ltd., DoubleCat, Store VN, PartyUs.

Before touching a machine (preflight):

  • description contains not signed in → skipped, no screenshot, no input.
  • powerState is not running → off, reported. Never started here: a power action stays a manual step (vps.sh power ... --confirm with the user’s go-ahead). Geliyun (PartyUs) freezes when idle.
  1. vps-screen.mjs shot (from t1k-marketing-store-vps-management). A black or tiny capture (under 15 KB) is re-shot once; still black → unchecked.
  2. key Control+t: a new tab in the already signed-in Chrome window (same on Linux and Windows).
  3. Screenshot, then the vision role must answer {"newTab": true}. Anything else → unchecked, nothing typed. (The first design used the OS run dialog, Alt+F2 / Meta+r; it never showed a dialog on S.H. ONG, so it was replaced.)
  4. Type <consoleUrl> into the focused address bar, then key Enter.
  5. Wait waitAfterOpenMs, screenshot, vision reads strict JSON: account, apps (name, package, status), issues, truncated. vps-screen has no scroll, so truncated: true is reported.
  6. Malformed JSON → unchecked: console reply unreadable (never a silent “no issues”). Vision unavailable (exit 4/5) → unchecked: vision role unavailable.
  7. Every capture is deleted afterwards unless --keep-shots.

Vision runs through bun ~/.claude/scripts/mr-role.cjs call --role vision --file <png> --prompt ....

One header line (date, UTC+7, machines checked, machines with issues), then one line per machine, then fleet errors if any. Plain text, no em or en dashes (sanitized in code), no file paths, no tokens, no webhook URL, no screenshot content beyond the account and app names. Chunked under 1900 characters per message.

Terminal window
install -m 0755 scripts/store-vps-health.sh ~/.local/bin/store-vps-health.sh
# write the two units below to ~/.config/systemd/user/, then:
systemctl --user daemon-reload && systemctl --user enable --now store-vps-health.timer
systemctl --user list-timers | grep store

store-vps-health.service:

[Unit]
Description=Daily store-health check of the store VPS fleet (read-only; Discord post)
After=network-online.target
[Service]
Type=oneshot
ExecStart=%h/.local/bin/store-vps-health.sh
# 9 machines x several shots + vision calls: give the run room.
TimeoutStartSec=45min
# 10 = issues found and posted, not a failure
SuccessExitStatus=10

store-vps-health.timer:

[Unit]
Description=Daily 09:00 (UTC+7, machine timezone) store-health check
[Timer]
OnCalendar=*-*-* 09:00:00
Persistent=true
[Install]
WantedBy=timers.target

The service sets TimeoutStartSec=45min for nine machines (several shots each). Exit 10 is success for the unit (SuccessExitStatus=10), as with max-network-watch. Before the release ships the skill to ~/.claude/skills/, run from a deploy copy: copy scripts/ and store-vps-health.config.json to ~/.local/share/store-vps-health/ and add Environment=STORE_VPS_HEALTH_HOME=%h/.local/share/store-vps-health under [Service] (the wrapper reads that variable; it defaults to the released skill path).

Terminal window
cd .claude/modules/store/skills/t1k-marketing-store-vps-health/scripts/tests
bun test health-core.test.mjs check-machine.test.mjs

check-machine.test.mjs pins the safety order (no typing before the verified run dialog, no interaction on skipped or stopped machines, every capture discarded). Removing the run-dialog guard turns both guard tests red.

  • RDP is single-session. A shot or input can evict a person working on that machine. The user accepted this for the daily run; --only lets a human pick the time.
  • Input lands in whatever is focused. That is why the run dialog is verified before typing.
  • Policy-status page not recorded yet. The daily run reads only the developer home. Discover the policy-status URL on one machine and set _policyStatusUrl in the config (rename to policyStatusUrl to activate it; the code does not read it until then).
  • A frozen remote desktop is unchecked, not a false clean. The run reports it instead of guessing; a human must reconnect that machine.
  • Ctrl+T is unverified on Windows and on a machine with a modal open. Confirm with one --only dry run on a Windows machine before trusting that path.
  • A session-lost console is a finding (type: session): the console says the user was disconnected.

Unattended: the systemd timer runs the script (no model tokens). Interpreting the Discord output and any console issue stays with the main session. Acting on an issue (a policy appeal, a release change) is a separate, user-approved step under the store-write rules, never from this skill.