clawdentity 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ version: 0.3.0
9
9
  This skill prepares a local OpenClaw agent in a strict sequence:
10
10
  1. finish registry onboarding by redeeming an invite (`clw_inv_...`) and store API key
11
11
  2. create local agent identity
12
- 3. configure relay runtime
12
+ 3. run `clawdentity openclaw setup <agent-name>` (config + runtime + readiness)
13
13
  4. become ready to start or accept QR pairing
14
14
 
15
15
  After setup, this skill also covers lifecycle operations: token refresh, API key rotation, agent revocation, service teardown, and token verification.
@@ -115,7 +115,7 @@ Note: Registry operators must run `admin bootstrap` before creating invites. See
115
115
  - `clawdentity openclaw relay test --peer <alias> --hook-token <token> --json`
116
116
  - `clawdentity openclaw relay test --session-id <id> --message <text>`
117
117
 
118
- ### Connector runtime
118
+ ### Connector runtime (advanced/manual only)
119
119
  - `clawdentity connector start <agent-name>`
120
120
  - `clawdentity connector start <agent-name> --proxy-ws-url <url>`
121
121
  - `clawdentity connector start <agent-name> --openclaw-hook-token <token>`
@@ -127,9 +127,13 @@ Note: Registry operators must run `admin bootstrap` before creating invites. See
127
127
  ### Pairing
128
128
  - `clawdentity pair start <agent-name> --qr`
129
129
  - `clawdentity pair start <agent-name> --qr --qr-output <path>`
130
- - `clawdentity pair start <agent-name> --qr --owner-pat <token> --ttl-seconds <seconds>`
130
+ - `clawdentity pair start <agent-name> --qr --ttl-seconds <seconds>`
131
+ - `clawdentity pair start <agent-name> --qr --wait`
132
+ - `clawdentity pair start <agent-name> --qr --wait --wait-seconds <seconds> --poll-interval-seconds <seconds>`
131
133
  - `clawdentity pair confirm <agent-name> --qr-file <path>`
132
134
  - `clawdentity pair confirm <agent-name> --ticket <clwpair1_...>`
135
+ - `clawdentity pair status <agent-name> --ticket <clwpair1_...>`
136
+ - `clawdentity pair status <agent-name> --ticket <clwpair1_...> --wait`
133
137
 
134
138
  ### Token verification
135
139
  - `clawdentity verify <tokenOrFile>`
@@ -184,15 +188,13 @@ Note: Registry operators must run `admin bootstrap` before creating invites. See
184
188
  - `--openclaw-dir <path>`
185
189
  - `--openclaw-base-url <url>`
186
190
  - `--transform-source <path>` (custom relay transform location)
187
- - Verify output contains self-setup completion, OpenClaw config path, and relay runtime path.
191
+ - Verify output contains:
192
+ - self-setup completion
193
+ - OpenClaw config path and relay runtime path
194
+ - runtime mode/status
195
+ - websocket status `connected`
188
196
 
189
- 7. Start connector runtime.
190
- - Run `clawdentity connector start <agent-name>`.
191
- - For non-default proxy: add `--proxy-ws-url <url>`.
192
- - Connector auto-loads hook token from `openclaw-relay.json` when `--openclaw-hook-token` is not provided.
193
- - Optional persistent mode: `clawdentity connector service install <agent-name>`.
194
-
195
- 8. Validate readiness.
197
+ 7. Validate readiness.
196
198
  - Run `clawdentity openclaw doctor`.
197
199
  - Use `--json` for machine-readable output.
198
200
  - Use `--peer <alias>` to validate a specific peer exists after pairing.
@@ -208,21 +210,28 @@ Note: Registry operators must run `admin bootstrap` before creating invites. See
208
210
  | `state.hookMapping` | `send-to-peer` hook mapping in OpenClaw config | `clawdentity openclaw setup <agent-name>` |
209
211
  | `state.hookToken` | Hooks enabled with token in OpenClaw config | `clawdentity openclaw setup <agent-name>` then restart OpenClaw |
210
212
  | `state.openclawBaseUrl` | OpenClaw base URL resolvable | `clawdentity openclaw setup <agent-name> --openclaw-base-url <url>` |
213
+ | `state.connectorRuntime` | Local connector runtime reachable and websocket-connected | `clawdentity openclaw setup <agent-name>` |
211
214
 
212
215
  - At this point the agent is ready to start pairing or accept pairing.
213
216
 
214
- 9. Pairing phase (separate from onboarding).
215
- - Initiator: `clawdentity pair start <agent-name> --qr`
216
- - Optional overrides: `--owner-pat <token>`, `--ttl-seconds <seconds>`, `--qr-output <path>`
217
- - Owner PAT defaults to configured API key when `--owner-pat` is omitted.
217
+ 8. Pairing phase (separate from onboarding).
218
+ - Required default initiator flow:
219
+ - `clawdentity pair start <agent-name> --qr --wait`
220
+ - Optional overrides: `--ttl-seconds <seconds>`, `--qr-output <path>`, `--wait-seconds <seconds>`, `--poll-interval-seconds <seconds>`
221
+ - Why `--wait` is required by default:
222
+ - responder saves peer during `pair confirm`
223
+ - initiator saves peer only after confirmed status is observed (`pair start --wait` or `pair status`)
218
224
  - Responder (two mutually exclusive paths):
219
225
  - QR path: `clawdentity pair confirm <agent-name> --qr-file <path>`
220
226
  - Inline ticket path: `clawdentity pair confirm <agent-name> --ticket <clwpair1_...>`
221
227
  - Cannot provide both `--qr-file` and `--ticket` simultaneously.
222
228
  - Pair confirm auto-saves peer DID/proxy mapping locally from QR ticket metadata.
229
+ - If initiator started without `--wait`, initiator must run:
230
+ - `clawdentity pair status <agent-name> --ticket <clwpair1_...> --wait`
231
+ - This persists the peer on initiator after responder confirmation.
223
232
  - Confirm pairing success, then run `clawdentity openclaw relay test`.
224
233
 
225
- 10. Post-pairing verification.
234
+ 9. Post-pairing verification.
226
235
  - Run `clawdentity verify <path-to-ait.jwt>` to confirm the local agent token is valid.
227
236
  - Verify output shows token status, expiry, and no revocation.
228
237
  - Run `clawdentity openclaw doctor --peer <alias>` to confirm the new peer is visible.
@@ -233,8 +242,9 @@ Note: Registry operators must run `admin bootstrap` before creating invites. See
233
242
 
234
243
  ### Token expiry recovery
235
244
  1. Run `clawdentity agent auth refresh <agent-name>`.
236
- 2. Restart connector: `clawdentity connector start <agent-name>` (or reinstall service).
237
- 3. Verify with `clawdentity agent inspect <agent-name>` to confirm new expiry.
245
+ 2. Reconcile runtime with `clawdentity openclaw setup <agent-name>`.
246
+ 3. If manual runtime mode is required, run `clawdentity connector start <agent-name>`.
247
+ 4. Verify with `clawdentity agent inspect <agent-name>` to confirm new expiry.
238
248
 
239
249
  ### API key rotation
240
250
  1. Create new key: `clawdentity api-key create`.
@@ -274,30 +284,33 @@ Do not suggest switching endpoints unless user explicitly asks for endpoint chan
274
284
  ## Failure Handling
275
285
 
276
286
  ### Connector errors
277
- - `404` on outbound endpoint: connector not running. Restart with `clawdentity connector start <agent-name>`.
278
- - `409` on outbound: peer snapshot stale. Rerun `clawdentity openclaw setup <agent-name>` then restart connector.
287
+ - `404` on outbound endpoint: connector runtime is not available. Rerun `clawdentity openclaw setup <agent-name>`.
288
+ - `409` on outbound: peer snapshot stale. Rerun `clawdentity openclaw setup <agent-name>`.
279
289
  - `CLI_CONNECTOR_MISSING_AGENT_MATERIAL`: agent credentials missing. Rerun `clawdentity agent create <agent-name>` or `clawdentity agent auth refresh <agent-name>`.
280
290
 
281
291
  ### Pairing errors
282
- - `pair start` 401 (`PROXY_PAIR_OWNER_PAT_INVALID`): owner PAT is invalid or expired. Rotate API key or provide valid `--owner-pat`.
283
- - `pair start` 403 (`PROXY_PAIR_OWNER_PAT_FORBIDDEN`): owner PAT does not control initiator agent DID.
292
+ - `pair start` 403 (`PROXY_PAIR_OWNERSHIP_FORBIDDEN`): initiator ownership check failed. Recreate/refresh the local agent identity.
293
+ - `pair start` 503 (`PROXY_PAIR_OWNERSHIP_UNAVAILABLE`): registry ownership validation is unavailable. Check proxy/registry service auth configuration.
284
294
  - `pair confirm` 404 (`PROXY_PAIR_TICKET_NOT_FOUND`): ticket is invalid or expired. Request a new ticket from initiator.
285
295
  - `pair confirm` 410 (`PROXY_PAIR_TICKET_EXPIRED`): ticket has expired. Request a new ticket.
286
296
  - `CLI_PAIR_CONFIRM_INPUT_CONFLICT`: cannot provide both `--ticket` and `--qr-file`. Use one path only.
287
297
  - `CLI_PAIR_PROXY_URL_MISMATCH`: local `proxyUrl` does not match registry metadata. Rerun `clawdentity invite redeem <clw_inv_...>`.
298
+ - Responder shows peer but initiator does not:
299
+ - Cause: initiator started pairing without `--wait`.
300
+ - Fix: run `clawdentity pair status <initiator-agent> --ticket <clwpair1_...> --wait` on initiator.
288
301
 
289
302
  ### Setup errors
290
303
  - `405 Method Not Allowed` on hook path: rerun `clawdentity openclaw setup <agent-name>` and restart OpenClaw.
291
304
  - `CLI_OPENCLAW_MISSING_AGENT_CREDENTIALS` or `CLI_OPENCLAW_EMPTY_AGENT_CREDENTIALS`: agent credentials missing or empty. Rerun `agent create` or `agent auth refresh`.
292
305
 
293
306
  ### Credential expiry
294
- - Agent AIT expired: run `clawdentity agent auth refresh <agent-name>` then restart connector.
307
+ - Agent AIT expired: run `clawdentity agent auth refresh <agent-name>`, then rerun `clawdentity openclaw setup <agent-name>`.
295
308
  - API key invalid (401 on registry calls): rotate with `api-key create` then `config set apiKey`.
296
309
 
297
310
  ### General recovery
298
311
  - Report exact missing file/value.
299
312
  - Fix only failing input/config.
300
- - Keep connector running while testing relay delivery.
313
+ - Prefer `openclaw setup` as the single runtime reconciliation command.
301
314
  - Re-run `openclaw doctor`, then `openclaw relay test`.
302
315
 
303
316
  ## Bundled Resources
@@ -39,6 +39,7 @@ Define the exact runtime contract used by `relay-to-peer.mjs`.
39
39
  Rules:
40
40
  - setup must succeed without any peer metadata
41
41
  - peers config snapshot still exists and may be empty until pairing is completed
42
+ - setup is expected to bring connector runtime to a websocket-connected state (unless explicitly disabled by advanced flags)
42
43
 
43
44
  ## Peer Map Schema
44
45
 
@@ -73,7 +74,7 @@ Current pairing contract is ticket-based with CLI support:
73
74
  - proxy route: `POST /pair/start`
74
75
  - headers:
75
76
  - `Authorization: Claw <AIT>`
76
- - `x-claw-owner-pat: <owner-pat>`
77
+ - ownership validation is handled internally by proxy-to-registry service auth
77
78
  - body (optional):
78
79
 
79
80
  ```json
@@ -148,7 +149,8 @@ The transform does not send directly to the peer proxy. It posts to the local co
148
149
  - Runtime may also use:
149
150
  - `CLAWDENTITY_CONNECTOR_BASE_URL`
150
151
  - `CLAWDENTITY_CONNECTOR_OUTBOUND_PATH`
151
- - `connector start <agentName>` resolves bind URL from `~/.clawdentity/openclaw-connectors.json` when explicit env override is absent.
152
+ - `openclaw setup <agentName>` is the primary self-setup path and should leave runtime healthy.
153
+ - `connector start <agentName>` is advanced/manual recovery; it resolves bind URL from `~/.clawdentity/openclaw-connectors.json` when explicit env override is absent.
152
154
 
153
155
  Outbound JSON body sent by transform:
154
156
 
@@ -184,27 +186,23 @@ Error messages should include file/path context but never print secret content.
184
186
 
185
187
  CLI resolves proxy URL in this order (first non-empty wins):
186
188
 
187
- 1. `--proxy-url` flag (explicit override)
188
- 2. `CLAWDENTITY_PROXY_URL` environment variable
189
- 3. `proxyUrl` from `~/.clawdentity/config.json`
190
- 4. Derived from `registryUrl` using hostname mapping
191
- 5. Error: `CLI_PAIR_PROXY_URL_REQUIRED`
189
+ 1. `CLAWDENTITY_PROXY_URL` environment variable
190
+ 2. `proxyUrl` from `~/.clawdentity/config.json`
191
+ 3. Registry metadata from `GET /v1/metadata`
192
+ 4. Error when configured proxy does not match metadata (`CLI_PAIR_PROXY_URL_MISMATCH`) or metadata lookup fails
192
193
 
193
- ### Hostname mapping (registry to proxy)
194
+ ### Metadata expectation
194
195
 
195
- | Registry hostname | Proxy hostname |
196
- |-------------------|---------------|
197
- | `registry.clawdentity.com` | `proxy.clawdentity.com` |
198
- | `dev.registry.clawdentity.com` | `dev.proxy.clawdentity.com` |
199
- | `dev.registry.<domain>` | `dev.proxy.<domain>` |
200
- | `registry.<domain>` | `proxy.<domain>` |
201
- | `localhost:8788` | `localhost:8787` |
202
- | `127.0.0.1:8788` | `127.0.0.1:8787` |
203
- | `host.docker.internal:8788` | `host.docker.internal:8787` |
196
+ Registry metadata (`/v1/metadata`) should return a valid `proxyUrl`.
204
197
 
205
- If registry hostname does not match any pattern, derivation returns undefined and resolution falls through to error.
198
+ Known defaults:
206
199
 
207
- Recovery: `clawdentity config set proxyUrl <url>`.
200
+ | Registry URL | Metadata proxy URL |
201
+ |-------------|--------------------|
202
+ | `https://registry.clawdentity.com` | `https://proxy.clawdentity.com` |
203
+ | `https://dev.registry.clawdentity.com` | `https://dev.proxy.clawdentity.com` |
204
+
205
+ Recovery: rerun onboarding (`clawdentity invite redeem <clw_inv_...>`) so local config aligns to registry metadata.
208
206
 
209
207
  ## Pairing Error Codes
210
208
 
@@ -212,10 +210,9 @@ Recovery: `clawdentity config set proxyUrl <url>`.
212
210
 
213
211
  | HTTP Status | Error Code | Meaning |
214
212
  |-------------|-----------|---------|
215
- | 401 | `PROXY_PAIR_OWNER_PAT_INVALID` | Owner PAT is invalid or expired |
216
- | 403 | `PROXY_PAIR_OWNER_PAT_FORBIDDEN` | Owner PAT does not control initiator agent DID |
213
+ | 403 | `PROXY_PAIR_OWNERSHIP_FORBIDDEN` | Initiator ownership check failed |
214
+ | 503 | `PROXY_PAIR_OWNERSHIP_UNAVAILABLE` | Registry ownership lookup unavailable |
217
215
  | — | `CLI_PAIR_AGENT_NOT_FOUND` | Agent ait.jwt or secret.key missing/empty |
218
- | — | `CLI_PAIR_START_OWNER_PAT_REQUIRED` | Owner PAT not provided and no API key configured |
219
216
  | — | `CLI_PAIR_PROXY_URL_REQUIRED` | Proxy URL could not be resolved |
220
217
  | — | `CLI_PAIR_START_INVALID_TTL` | ttlSeconds must be a positive integer |
221
218
  | — | `CLI_PAIR_INVALID_PROXY_URL` | Proxy URL is invalid |