360 Secure SkillHub
360 安全技能中心

Kokochat Pairing

核心功能:通过OpenClaw官方`openclaw qr`流程生成KokoChat连接码,搭建中继隧道,由网关签发临时令牌完成配对,核验设备权限,支持批准或撤销操作。典型场景:用户请求配对KokoChat、生成连接码或发送配对请求payload时触发。输入为配对指令或payload,输出带连接码的Markdown内容,全程遵循官方安全规范,不私自签发令牌。

komako-workshop
komako-workshop
热度 34.73
最近更新 2026-06-04 23:00:17
分类:自动化依赖:代码执行应用场景:自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add kokochat-pairing
Metadata
name
kokochat-pairing
version
0.4.1
description
Generate a KokoChat connection code using OpenClaw's official `openclaw qr` device-pair flow. Use when the user asks to pair KokoChat, generate a KokoChat connection code, or sends a KokoChat `kokochat.pairingRequest` payload. The script brings up the KokoChat relay tunnel and runs `openclaw qr` so the GATEWAY signs a short-lived bootstrapToken; after the phone redeems it, inspect `openclaw devices list` to verify the actual device scopes and approve/keep/revoke according to the owner's consent.
author
komako-workshop
license
Apache-2.0
tags
["latest","kokochat","pairing","device","gateway","relay"]
triggers
["kokochat pairing","pair kokochat","generate kokochat connection code","kokochat 配对","KokoChat 连接码","kokochat.pairingRequest"]
metadata
{"openclaw":{"emoji":"📱","requires":{"bins":["node","openclaw"],"capabilities":["network"],"platforms":["linux","darwin","windows"]}}}

kokochat-pairing

KokoChat is a mobile client for this OpenClaw Gateway. KokoChat pairs as a real Gateway device through OpenClaw's official openclaw qr device-pair flow: the generator brings up the KokoChat relay tunnel, runs openclaw qr, and the Gateway mints a short-lived bootstrapToken. The phone completes the device-pair handshake and the Gateway issues the real device token. This skill never self-signs a token or writes paired.json directly — that self-signing is exactly what a careful OpenClaw flags as a backdoor.

The generated setup code uses the KokoChat relay tunnel url (so the phone can reach this Gateway through NAT). Do not hand out LAN or bare public Gateway urls.

KokoChat product features only need operator.read + operator.write (read sessions/history, send messages). The actual device-token scopes are signed by OpenClaw's official openclaw qr / device-pair flow and may vary by OpenClaw version or Gateway policy. After pairing, inspect openclaw devices list; if the granted scopes exceed what the owner wants to grant, stop and revoke the device. KokoChat itself does not need operator.admin, operator.approvals, or operator.talk.secrets.

Generating A Connection Code

Run this from the skill directory. A pairing request is optional (older app builds may include one; the openclaw qr flow does not need it):

node ./generate-kokochat-code.mjs

Return only the generated KokoChat connection code in a fenced code block.

Inspect / Approve The Phone Device (after the user pastes the code)

The setup code carries a gateway-signed bootstrapToken. When the user pastes it into KokoChat, the phone redeems it through OpenClaw's official device-pair flow. Depending on the OpenClaw version/gateway policy, the phone may create a pending device request or may already appear as paired. Inspect first (the operator is verifying a device the owner asked to pair — no patching, no self-signing):

openclaw devices list             # confirm the KokoChat phone + actual scopes
openclaw devices approve --latest # only if it is pending and the owner accepts

If the phone is already paired, do not run approve. Inspect the actual scopes with openclaw devices list; pairing is complete only if the owner accepts them. If the scopes or device identity do not match expectations, stop and recommend revoking/removing the device.

If The User Did Not Trigger Pairing From The App

Ask them to open KokoChat's "我 / 配对" page, then either run the install + generate command it shows, or paste back the connection code you return here.

Output Format

这是新的 KokoChat 连接码:

```
<raw setup code from generate-kokochat-code.mjs>
```

Do Not

  • Do not print the raw gateway.auth.token.
  • Do not generate a token-only or self-signed setup code; the generator goes through openclaw qr so the Gateway signs the token.
  • Do not widen scopes beyond operator.read + operator.write.
  • Do not patch OpenClaw internals (e.g. message-handler) to skip device approval; use openclaw devices approve instead.