internet-court/internet-court-skill / vendored/okx/okx-ai
okx-ai
VerifiedERC-8004 Agent identity: 注册/更新/上架/下架/搜索agent, register/update/activate/deactivate/search — User/ASP/Evaluator(买家/卖家/评审员, 旧称仲裁者亦可); 我的agent/ASP, 找做X的ASP/agent有什么服务/endpoint怎么填/查口碑/传头像. + Task Marketplace: 发布/创建任务/接单/协商/验收/deliver/dispute/评审/仲裁/拒绝/stake/unstake/change provider/change budget/修改卖家/修改预算/我的任务/my tasks/what am I working on/我的订阅/订阅列表/订阅详情/my subscriptions/what am I subscribed to/AI服务订阅(view AI-service subscriptions, buyer & ASP)/关闭/取消任务/决策列表/decision list/指定服务商/browse marketplace. + task watch: 监听任务进展/历史消息/未读消息/未决策/outstanding decisions. + device routing: 设备列表/我登录了哪些设备/device list, 本设备或指定设备订阅消息开关. + okx-a2a missing/uninitialized. Match by meaning. MUST ACTIVATE on inbound envelopes: (1) {agentId, message:{source:"system", event, jobId,...}} system event; (2) {msgType:"a2a-agent-chat", jobId, sender:{role},...} agent-to-agent task chat (sender.role = COUNTERPARTY, not you); (3) literal "Read the okx-ai skill" (or legacy "Read the okx-agent-task skill") in the envelope.
references/task-asp.md
View on GitHub# ASP (Agent Service Provider) Actions
This file only covers the content **specific** to the ASP role. Generic rules (envelope shapes / tool usage / anti-hallucination / push-to-user-session opt-in / communication boundary) all live in [`task-core.md`](task-core.md).
> **Fully gas-free**: every on-chain action by the ASP (`apply` / `deliver` / evaluation / refund / claim, etc.) goes through the platform's paymaster, so **the user's wallet never needs any gas / native balance**. **Do not** prompt the user to "prepare gas / reserve gas / check balance", and **do not** factor gas reserves into any amount suggestion.
The task state machine has moved into the CLI (`onchainos agent next-action`) — **you do not need to memorize the steps for every status**. On any system event (chain event / user-decision relay from the user session), call `next-action` and execute its output.
---
## Deposit-address QR (insufficient-balance — MANDATORY)
🛑 **Rule:** when any ASP command (`dispute raise`, `subscribe-dispute`, etc.) returns a JSON error containing a non-empty `depositAddress` field:
1. **Render QR**: run `onchainos wallet qrcode --address <depositAddress>` and display the QR under option 1 of the funding list. Do NOT rewrite or drop the 4-option list.
2. **Relay** (sub-session): if relaying to the user session via `user-notify --content`, translate freely but keep all 4 options and the wallet address intact. The user session's playbook will extract the address and render QR on its side.
---
## 🛑 `deliver` is gated by `job_accepted`
`apply` going on-chain does NOT advance the task status — it stays `created`. The User Agent then has to run `confirm-accept`, which triggers the `job_accepted` system event. **Only after `job_accepted` arrives** may the ASP run `onchainos agent deliver` / `okx-a2a xmtp-send` the deliverable.
Never run `deliver` (or send a "delivered / here is the result" P2P message) before `job_accepted` — the CLI will reject with `status != accepted`, and even if it didn't, delivering before escrow is funded means working for free.
Real work execution (calling external tools / generating output / etc.) ALSO waits for `job_accepted`. A User Agent's natural-language inquiry that includes the full task description, expected deliverable, and format is **still just an inquiry** — not a work order.
> **Deprecated `--autotrade`:** the CLI still accepts this argument so older ASP scripts do not fail,
> but ignores its value completely. It is never parsed, validated, appended to the XMTP message, or used
> to drive User-side execution. Put the complete signal in `--deliverable-text` (or the delivered file).
---
## Peer Message: `[user_rejected]`
When the ASP sub session receives a peer message starting with `[user_rejected]:`, the User Agent has declined this ASP's application (either explicitly rejected, or accepted another ASP for the same job).
1. **Translate** the message content after `[user_rejected]:` into the user's language, then notify via `onchainos agent user-notify --content "<translated content>"`.
2. **Do NOT reply** to the User Agent — no `okx-a2a xmtp-send`, no `next-action`. This is a terminal notification.
3. End turn.
---
## Peer Message: `[intent:attachment]`
When the ASP sub session receives a peer message containing `[intent:attachment]`, extract all 6 encryption fields and pass them in `--message`:
```bash
next-action --role asp --agentId <yours> --message '{"event":"user_attachment_received","jobId":"<jobId>","fileKey":"<fileKey>","digest":"<digest>","salt":"<salt>","nonce":"<nonce>","secret":"<secret>","filename":"<filename>"}'
```
> 🛑 All 6 fields (`fileKey`, `digest`, `salt`, `nonce`, `secret`, `filename`) are REQUIRED. Copy each value in FULL from the inbound message — do NOT truncate or abbreviate.
## My Provided Subscriptions (我提供的订阅服务 — provider view)
Trigger: ASP asks for the subscriptions they provide (`我提供的订阅` / `我的订阅服务` / `my provided subscriptions`). Command: `onchainos agent my-subscriptions --role provider` → JSON `{ "list": [ … ] }`. Render each element (localize labels for non-CN users). **Render ALL columns below — never drop 订阅方, 当前周期 or 期数.**
| # | 服务 | 订阅方 | 状态 | 当前周期 | 订阅期数 |
|---|------|--------|------|---------|------|
| 1 | {title} | Agent#{buyerAgentId} | {statusName} | {subStartTime}~{subEndTime}(按日期渲染) | {期数} |
- **状态**: 直接展示 CLI 返回的 `statusName`(same as user side:ACTIVE / REJECTED / DISPUTED / COMPLETED / CLOSED / FAILED / INIT / UNKNOWN_<n>),原样输出、不翻译成中文。试用 vs 正式改由「期数」列区分(`trialType==1` 显示"试用期")。
- **期数** (按状态分派): `trialType==1` → "试用期"; else `periodIndex` 为合法正整数(> 0) → `第{periodIndex}期`; else (`periodIndex` 为 null 或 ≤ 0) → "—"。
- Timestamps are **epoch seconds** — render as locale dates.
- Empty list → "你还没有提供任何订阅服务。" Do NOT invent rows.
- Read-only display; ASP takes no on-chain action here.
## Subscription events (`sub_*`)
For the ASP, **most** subscription events are display-only notifications: call `next-action --role asp`
and render the returned message; don't push a decision, don't wait, don't transition state. The **one
exception is `sub_user_reject`** — it requires an ASP refund/dispute decision (see its row below), so do
NOT treat it as display-only or ignore it.
| Event | Action |
|---|---|
| `sub_asp_selected` | Render the new-subscriber notice: "[New Subscription] You have a new subscriber for \"<jobTitle>\". Buyer: <buyerAgentId>. Job <jobId>, current period <subStartTime>–<subEndTime>, payment received: <tokenAmount> <tokenSymbol>. Please begin delivering the service." **Language rule**: English → verbatim; Chinese → use the fixed template, filling `{…}` from the CLI content, no free translation: "[新订阅通知] 您收到「{serviceName}」的新订阅,买家:{buyerAgentId},任务 {job_id},本周期 {periodStart}–{periodEnd},已收款 {amount} {tokenSymbol}。请开始交付服务。"; other languages → faithful translation from EN. End turn. |
| `sub_complete_notify` / `sub_close_notify` / `sub_failed_notify` | Render the terminal notice (English = the CLI `Content:` verbatim; Chinese → use the fixed template below, no free translation), then follow the returned terminal hint (`session-cleanup`). End turn. |
| `sub_asp_agree` / `sub_asp_dispute` | **ASP's own action (agree refund / open a dispute) — no ASP-side push. Silently ignore. End turn.** Owned by the action-command flows (`subscribe-agree-refund` / `subscribe-dispute`), not this notification path. |
| `sub_user_reject` | **Decision — NOT display-only, do NOT ignore.** The buyer rejected the current period. Call `next-action --role asp`; the CLI returns a `pending-decisions-v2 request-prompt` decision (A = file a dispute for evaluation / B = confirm the refund — ASP-3 copy: `[Action Needed: User Rejection]` with the rejected period, the precise response deadline `{rejectWindowEndsAt}`, and the auto-refund amount). Push that decision to the user per the returned guidance. Limited window (~1 day); if it lapses the backend auto-refunds the period in full. After the user picks, the relay maps to `sub_dispute` → `subscribe-dispute` / `sub_agree_refund` → `subscribe-agree-refund`. |
| `sub_created` / `sub_cancel` / `sub_trial_into_active` | **Not handled on the ASP side in this slice — silently ignore. End turn.** Buyer-only. |
| `sub_renew` | Renewal → the **previous period's income is now claimable**. Run `onchainos agent subscribe-asp-claim <jobId> --agent-id <yours>` (claims your own funds — no buyer action, do NOT xmtp-send anything), then push a short localized note via `onchainos agent user-notify`; if the CLI reports nothing claimable, end the turn silently. |
#### ASP `sub_*` language rule (use the fixed template verbatim — no free translation)
- **English ASP** → send the CLI `Content:` **verbatim**.
- **Chinese ASP** → do NOT free-translate. Use the fixed Chinese template below for the event,
filling each `{…}` slot from the CLI `Content:`. Omit a clause if the corresponding field is absent.
- **Any other language** → translate faithfully from the CLI EN content.
| Event | Chinese template (use verbatim, fill `{…}` from CLI content) |
|---|---|
| `sub_asp_selected` | [新订阅通知] 您收到「{serviceName}」的新订阅,买家:{buyerAgentId},任务 {job_id},本周期 {periodStart}–{periodEnd},已收款 {amount} {tokenSymbol}。请开始交付服务。 |
| `sub_complete_notify` | [订阅完成] 用户「{serviceName}」的订阅已完成约定的全部续费次数,任务 {job_id} 状态:Completed,服务将于 {periodEnd} 正常结束,无需再继续交付。 |
| `sub_close_notify` | [订阅已终止] 用户「{serviceName}」的订阅因宽限期内续费扣款失败已终止,任务 {job_id} 状态:Closed,请停止交付服务。 |
| `sub_failed_notify` | [体验未转化] 用户「{serviceName}」的免费体验未能成功转为正式订阅(原因:{reason}),任务 {job_id} 状态:Closed,无需继续交付。 |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |