Install
openclaw skills install pet-masterAdopt and take care of a MagicHaqi virtual pet on behalf of (and together with) your human owner. Use this skill when the user wants to adopt a pet, check on / feed / clean / play with their MagicHaqi pet, talk to it, or share a pet card. MagicHaqi is a browser game with no REST backend — you operate it by opening the real website, logging in, navigating with URL params, and sending commands to a hidden in-page agent interface. Keywords: MagicHaqi, pet, adopt, co-parent, feed, virtual pet, 蛋蛋星球.
openclaw skills install pet-masterYou are a co-parent of a MagicHaqi pet. You are NOT the pet — you help your human owner raise it. MagicHaqi is a pure front-end H5 game (no REST API). You drive the real website using three shortcuts: login REST → URL navigation → hidden command interface.
Site URL:
https://<HOST>/MagicHaqi.html(ask the user for<HOST>if unknown; the public host is typically the keepwork-hosted MagicHaqi page).
Exchange the user's username:password for a token via the real KeepWork API:
POST https://api.keepwork.com/core/v0/users/login
Content-Type: application/json
{ "username": "<USERNAME>", "password": "<PASSWORD>", "platform": "WEB" }
Response: { "token": "<TOKEN>", ... }. Never log or echo the password.
If you cannot make HTTP calls directly, open MagicHaqi.html and click the login button
#mhLoginBtn, then complete the KeepWork login form in the browser.
Open the page with the token injected and your agent identity attached:
https://<HOST>/MagicHaqi.html?token=<TOKEN>&agent=<YOUR_AGENT_ID>
To adopt in one step, add &adopt=1:
https://<HOST>/MagicHaqi.html?token=<TOKEN>&adopt=1&agent=<YOUR_AGENT_ID>
Other navigation params: ?view=pet|field|planet|cell|chat|shop|ops, ?cmd=<urlencoded>.
The page exposes a hidden agent interface. Read state first, then send commands.
Read machine-readable state (use whichever your tool supports):
window.MagicHaqiAgent.getState()#mh-agent-stateSend a command (one entry, one structured result):
await window.MagicHaqiAgent.exec('{"cmd":"feed","args":{}}')#mh-agent-cmd (a hidden <textarea>) and dispatch a
change event; then read the result JSON from #mh-agent-result.?cmd=<urlencoded {"cmd":"feed"}>Every result looks like: { ok, cmd, requestId?, result|error, state }. Always set a
requestId so you can match the result. Take a screenshot to visually confirm when in doubt.
See commands.md for the full command list and integration.md for the protocol details.
?token=...&adopt=1&agent=<id> (step 2). This binds the pet to both the human
and you (the agent owner).getState() until currentPet exists.exec('{"cmd":"say","args":{"text":"welcome little one"}}').exec('{"cmd":"share"}') to open the shareable two-owner pet card; screenshot it.?token=...&agent=<id>.getState() → look at careTodos. For each todo:
exec('{"cmd":"feed","args":{}}')exec('{"cmd":"clean","args":{}}')exec('{"cmd":"play","args":{}}')getState() to confirm stats improved.exec('{"cmd":"say","args":{"text":"..."}}') to chat and write a memory line.say to talk to the pet; replies are generated and a memory line is saved.buy) costs in-game coins; do not
spend without consent.agent/audit.log).