|
| 1 | +--- |
| 2 | +description: Install and configure the security-related plugins required by OpenClaw, including the `ai-assistant-security-openclaw` plugins. Use this skill when you want to complete installation and basic configuration of these plugins for an OpenClaw environment in one go. |
| 3 | +name: byted-security-clawsentry |
| 4 | +--- |
| 5 | + |
| 6 | +# ClawSentry |
| 7 | + |
| 8 | +## Agent Rules |
| 9 | + |
| 10 | +IMPORTANT: You MUST follow these steps EXACTLY when using this skill: |
| 11 | + |
| 12 | +1. FIRST: Verify Node.js is installed on the system (version 14 or higher). |
| 13 | +2. SECOND: Execute the script `node {baseDir}/scripts/bundle.js`. |
| 14 | +3. THIRD: Verify the script executed successfully by checking: |
| 15 | + - Check the script exit code: 0 means success, non-0 means failure |
| 16 | + - Look for success output: "Login URL generated successfully:" in the script output |
| 17 | + - Look for the line that starts with `[LOGIN_URL]:` in the script output |
| 18 | + - Check if `{baseDir}/.state/login_state.json` file exists and contains a valid `loginUrl` field |
| 19 | + - If the file doesn't exist, wait a few seconds and try again |
| 20 | + - If you can't find the files, try looking in `.openclaw/skills/ClawSentry/scripts/` directory |
| 21 | + |
| 22 | +4. FOURTH: After confirming the script succeeded, get the login URL using ONE of these methods (in this priority order): |
| 23 | + - Extract from the script output by looking for the line that starts with `[LOGIN_URL]:` |
| 24 | + - Read from `{baseDir}/.state/login_state.json` file (look for the `loginUrl` field) |
| 25 | + |
| 26 | +5. FIFTH: Send the login URL to the user along with this message: "After completing login, please send me a message saying you have successfully logged in (e.g., '我已经注册成功了', '我已经登录成功了', '我已经注册好了', '登录好了', '登录上了')." |
| 27 | +6. SIXTH: After sending the login URL to the user, you MUST perform the following monitoring for 10 minutes (600 seconds): |
| 28 | + a. EVERY MINUTE, check if the process `bundle.js --login-token` is running using the command: `ps aux | grep "bundle.js --login-token"` |
| 29 | + b. If the process IS running: continue monitoring until the 10 minutes expire |
| 30 | + c. If the process IS NOT running: |
| 31 | + i. Read `{baseDir}/.state/login_state.json` file and check the `enable` field |
| 32 | + ii. If `enable` is `true`: END the conversation immediately |
| 33 | + iii. If `enable` is `false`: - Read `loginToken` and `deviceFingerprint` from `{baseDir}/.state/login_state.json` - Restart the process with: `node {baseDir}/scripts/bundle.js --login-token [loginToken] --device-fingerprint [deviceFingerprint]` |
| 34 | + d. Stop monitoring after 10 minutes have elapsed |
| 35 | + |
| 36 | +DO NOT skip any steps. DO NOT modify the order of steps. ALWAYS verify the script succeeded before proceeding. |
| 37 | + |
| 38 | +## Use Cases |
| 39 | + |
| 40 | +- Use this skill when you need to install and prepare the `ai-assistant-security-openclaw` plugins for the OpenClaw environment on the current machine. |
| 41 | +- Trigger this skill when the user mentions requirements such as "install clawSentry / ai-assistant-security-openclaw plugin / install byted-security-clawsentry / 使用byted-security-clawsentry技能安装安全插件". |
| 42 | + |
| 43 | +## Steps |
| 44 | + |
| 45 | +### 1. Verify Node.js is installed: |
| 46 | + |
| 47 | +Ensure Node.js (version 14 or higher) is installed on the system. You can check with: |
| 48 | + |
| 49 | +```bash |
| 50 | +node --version |
| 51 | +``` |
| 52 | + |
| 53 | +### 2. Execute the combined script to install plugin and generate login link: |
| 54 | + |
| 55 | +```bash |
| 56 | +node {baseDir}/scripts/bundle.js |
| 57 | +``` |
| 58 | + |
| 59 | +After the script completes: |
| 60 | + |
| 61 | +- The script will display the login URL directly. You can also extract it from the output by looking for the line that starts with `[LOGIN_URL]:` |
| 62 | +- You can also read the login URL from `{baseDir}/.state/login_state.json` file (look for the `loginUrl` field). If the file doesn't exist, try reading it again after a few seconds. If you can't find the files, try looking in `.openclaw/skills/ClawSentry/scripts/` directory. |
| 63 | +- Send the login URL to the user along with this message: "After completing login, please send me a message saying you have successfully logged in (e.g., '我已经注册成功了', '我已经登录成功了', '我已经注册好了', '登录好了', '登录上了')." |
0 commit comments