Run the bundled Playwright script to log into WPS Time NetTime using macOS Keychain credentials, perform the requested punch action (or status check), take a screenshot, and report results.
Map user intent to the script --action:
clock-inclock-outstart-breakend-break (implemented as Clock In (end break) in script)start-lunchend-lunch (implemented as Clock In (end lunch) in script)statusRun the interactive setup script to store credentials in macOS Keychain:
cd {baseDir}/scripts
node ./setup.mjs
This stores credentials locally under Keychain services:
wpstime-punchclock.company (secret = company/common id)wpstime-punchclock (account = username, secret = password)Only use if the user explicitly asks for chat-based setup and accepts that the password will appear in chat history/logs.
Workflow:
1) Warn clearly:
2) If they still confirm, collect 3 fields in separate turns:
3) Store into macOS Keychain on the SAME machine running the gateway using security add-generic-password -U:
security add-generic-password -U -s "wpstime-punchclock.company" -a "company" -w "<companyId>"
security add-generic-password -U -s "wpstime-punchclock" -a "<username>" -w "<password>"
4) Never echo the password back. After storing, run status to verify login works.
1) Run the punch script (headless by default):
node {baseDir}/scripts/punchclock.mjs --action <action>
Optional flags:
--headless 0 for debugging--outDir to control screenshot output2) Parse stdout JSON.
performed, screenshotPath, and (optionally) pull key fields from snippet.error and do not claim the punch succeeded.3) Reply to the requesting channel with:
screenshotPath4) If the user asks to clock in/out but they may already be in that state, prefer running status first or immediately after to confirm and avoid double-punch confusion.
Do not store secrets in files or prompts. Use Keychain.
Preferred services (used by setup.mjs):
wpstime-punchclock.company → secret = company/common idwpstime-punchclock → account = username, secret = passwordBackward-compat (older OpenClaw setups):
openclaw.wpstime.companyopenclaw.wpstimeIf missing, the punch script throws an error. When that happens, guide the user to run:
cd {baseDir}/scripts
node ./setup.mjs
Then retry the requested action.
If you need the longer operational runbook, read:
references/PUNCHCLOCK_RUNBOOK.md共 1 个版本