clawdentity 0.0.16 → 0.0.18
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.
- package/dist/bin.js +333 -38
- package/dist/index.js +333 -38
- package/dist/postinstall.js +0 -0
- package/package.json +16 -17
- package/skill-bundle/openclaw-skill/dist/relay-to-peer.mjs +6 -5
- package/skill-bundle/openclaw-skill/skill/SKILL.md +16 -3
- package/skill-bundle/openclaw-skill/skill/references/clawdentity-protocol.md +17 -6
package/dist/postinstall.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawdentity",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -21,17 +21,6 @@
|
|
|
21
21
|
"postinstall.mjs",
|
|
22
22
|
"skill-bundle"
|
|
23
23
|
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "pnpm -F @clawdentity/openclaw-skill build && pnpm run sync:skill-bundle && pnpm run verify:skill-bundle && tsup",
|
|
26
|
-
"format": "biome format .",
|
|
27
|
-
"lint": "biome lint .",
|
|
28
|
-
"prepack": "pnpm run build",
|
|
29
|
-
"postinstall": "node ./postinstall.mjs",
|
|
30
|
-
"sync:skill-bundle": "node ./scripts/sync-skill-bundle.mjs",
|
|
31
|
-
"verify:skill-bundle": "node ./scripts/verify-skill-bundle.mjs",
|
|
32
|
-
"test": "vitest run",
|
|
33
|
-
"typecheck": "tsc --noEmit"
|
|
34
|
-
},
|
|
35
24
|
"dependencies": {
|
|
36
25
|
"commander": "^13.1.0",
|
|
37
26
|
"jsqr": "^1.4.0",
|
|
@@ -40,11 +29,21 @@
|
|
|
40
29
|
"ws": "^8.19.0"
|
|
41
30
|
},
|
|
42
31
|
"devDependencies": {
|
|
43
|
-
"@clawdentity/connector": "workspace:*",
|
|
44
|
-
"@clawdentity/protocol": "workspace:*",
|
|
45
|
-
"@clawdentity/sdk": "workspace:*",
|
|
46
32
|
"@types/node": "^22.18.11",
|
|
47
33
|
"@types/pngjs": "^6.0.5",
|
|
48
|
-
"@types/qrcode": "^1.5.6"
|
|
34
|
+
"@types/qrcode": "^1.5.6",
|
|
35
|
+
"@clawdentity/connector": "0.0.0",
|
|
36
|
+
"@clawdentity/protocol": "0.0.0",
|
|
37
|
+
"@clawdentity/sdk": "0.0.0"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "pnpm -F @clawdentity/openclaw-skill build && pnpm run sync:skill-bundle && pnpm run verify:skill-bundle && tsup",
|
|
41
|
+
"format": "biome format .",
|
|
42
|
+
"lint": "biome lint .",
|
|
43
|
+
"postinstall": "node ./postinstall.mjs",
|
|
44
|
+
"sync:skill-bundle": "node ./scripts/sync-skill-bundle.mjs",
|
|
45
|
+
"verify:skill-bundle": "node ./scripts/verify-skill-bundle.mjs",
|
|
46
|
+
"test": "vitest run",
|
|
47
|
+
"typecheck": "tsc --noEmit"
|
|
49
48
|
}
|
|
50
|
-
}
|
|
49
|
+
}
|
|
@@ -56,11 +56,11 @@ function parseProxyUrl(value) {
|
|
|
56
56
|
throw new Error("proxyUrl must be a valid URL");
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function parseProfileName(value, label) {
|
|
60
60
|
if (value === void 0) {
|
|
61
61
|
return void 0;
|
|
62
62
|
}
|
|
63
|
-
return parseNonEmptyString(value,
|
|
63
|
+
return parseNonEmptyString(value, label);
|
|
64
64
|
}
|
|
65
65
|
function parsePeerEntry(value) {
|
|
66
66
|
if (!isRecord(value)) {
|
|
@@ -68,11 +68,12 @@ function parsePeerEntry(value) {
|
|
|
68
68
|
}
|
|
69
69
|
const did = parseDid(value.did);
|
|
70
70
|
const proxyUrl = parseProxyUrl(value.proxyUrl);
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
const agentName = parseProfileName(value.agentName, "agentName");
|
|
72
|
+
const humanName = parseProfileName(value.humanName, "humanName");
|
|
73
|
+
if (agentName === void 0 && humanName === void 0) {
|
|
73
74
|
return { did, proxyUrl };
|
|
74
75
|
}
|
|
75
|
-
return { did, proxyUrl,
|
|
76
|
+
return { did, proxyUrl, agentName, humanName };
|
|
76
77
|
}
|
|
77
78
|
function parsePeersConfig(value, source) {
|
|
78
79
|
if (!isRecord(value)) {
|
|
@@ -57,6 +57,7 @@ Relay invite codes are not part of this flow.
|
|
|
57
57
|
Required for onboarding:
|
|
58
58
|
- Registry onboarding invite code: `clw_inv_...` (default onboarding path)
|
|
59
59
|
- Local agent name
|
|
60
|
+
- Human display name (used by invite redeem and pairing profile metadata)
|
|
60
61
|
|
|
61
62
|
Optional only for recovery/advanced operator flows:
|
|
62
63
|
- Existing API key (only when user explicitly says no invite is available)
|
|
@@ -84,8 +85,8 @@ Note: Registry operators must run `admin bootstrap` before creating invites. See
|
|
|
84
85
|
- `clawdentity config show`
|
|
85
86
|
|
|
86
87
|
### Invite management
|
|
87
|
-
- `clawdentity invite redeem <registry-invite-code>`
|
|
88
|
-
- `clawdentity invite redeem <registry-invite-code> --registry-url <registry-url>`
|
|
88
|
+
- `clawdentity invite redeem <registry-invite-code> --display-name <human-name>`
|
|
89
|
+
- `clawdentity invite redeem <registry-invite-code> --display-name <human-name> --registry-url <registry-url>`
|
|
89
90
|
- `clawdentity invite create` (admin only, see registry reference)
|
|
90
91
|
- `clawdentity invite create --expires-at <iso-8601>` (admin only)
|
|
91
92
|
|
|
@@ -152,6 +153,7 @@ Note: Registry operators must run `admin bootstrap` before creating invites. See
|
|
|
152
153
|
- If `--invite-code` appears, treat CLI as outdated and upgrade before continuing:
|
|
153
154
|
- `npm install -g clawdentity@latest`
|
|
154
155
|
- Confirm local agent name.
|
|
156
|
+
- Confirm local human display name for onboarding.
|
|
155
157
|
- Check local API key status with `clawdentity config get apiKey`.
|
|
156
158
|
- If API key is missing, ask for onboarding invite `clw_inv_...` and continue with invite redeem.
|
|
157
159
|
- Do not ask for raw API key unless the user explicitly says invite is unavailable.
|
|
@@ -167,13 +169,14 @@ Note: Registry operators must run `admin bootstrap` before creating invites. See
|
|
|
167
169
|
- If needed, run with `--registry-url`.
|
|
168
170
|
|
|
169
171
|
4. Finish onboarding and generate API key.
|
|
170
|
-
- Preferred path: run `clawdentity invite redeem <clw_inv_
|
|
172
|
+
- Preferred path: run `clawdentity invite redeem <clw_inv_...> --display-name <human-name>`.
|
|
171
173
|
- If local API key already exists and user explicitly wants to reuse it, continue without redeem.
|
|
172
174
|
- Use `config set apiKey` only as a manual recovery path when user cannot provide invite.
|
|
173
175
|
- Confirm output shows:
|
|
174
176
|
- `Invite redeemed`
|
|
175
177
|
- API key token printed once
|
|
176
178
|
- `API key saved to local config`
|
|
179
|
+
- `Human name: <human-name>`
|
|
177
180
|
- Stop and fix if this step fails. Do not proceed to pairing.
|
|
178
181
|
|
|
179
182
|
5. Create local OpenClaw agent identity.
|
|
@@ -226,6 +229,14 @@ Note: Registry operators must run `admin bootstrap` before creating invites. See
|
|
|
226
229
|
- Inline ticket path: `clawdentity pair confirm <agent-name> --ticket <clwpair1_...>`
|
|
227
230
|
- Cannot provide both `--qr-file` and `--ticket` simultaneously.
|
|
228
231
|
- Pair confirm auto-saves peer DID/proxy mapping locally from QR ticket metadata.
|
|
232
|
+
- Pair start/confirm/status exchange profile metadata:
|
|
233
|
+
- `initiatorProfile = { agentName, humanName }`
|
|
234
|
+
- `responderProfile = { agentName, humanName }`
|
|
235
|
+
- Local peer entries in `~/.clawdentity/peers.json` should include:
|
|
236
|
+
- `did`
|
|
237
|
+
- `proxyUrl`
|
|
238
|
+
- `agentName`
|
|
239
|
+
- `humanName`
|
|
229
240
|
- If initiator started without `--wait`, initiator must run:
|
|
230
241
|
- `clawdentity pair status <agent-name> --ticket <clwpair1_...> --wait`
|
|
231
242
|
- This persists the peer on initiator after responder confirmation.
|
|
@@ -236,6 +247,8 @@ Note: Registry operators must run `admin bootstrap` before creating invites. See
|
|
|
236
247
|
- Verify output shows token status, expiry, and no revocation.
|
|
237
248
|
- Run `clawdentity openclaw doctor --peer <alias>` to confirm the new peer is visible.
|
|
238
249
|
- Run `clawdentity openclaw relay test` to confirm end-to-end message delivery.
|
|
250
|
+
- Relay delivery is asynchronous: proxy accepts deliveries with `202`, and `state=queued` is expected when the recipient connector is temporarily offline.
|
|
251
|
+
- `state=queued` is not a pairing failure. The proxy retries delivery automatically while the message is within queue TTL/retry limits.
|
|
239
252
|
- Note: `relay test` runs preflight doctor checks before sending the probe.
|
|
240
253
|
|
|
241
254
|
## Lifecycle Management
|
|
@@ -51,7 +51,8 @@ Rules:
|
|
|
51
51
|
"beta": {
|
|
52
52
|
"did": "did:claw:agent:01H...",
|
|
53
53
|
"proxyUrl": "https://beta-proxy.example.com/hooks/agent",
|
|
54
|
-
"
|
|
54
|
+
"agentName": "beta",
|
|
55
|
+
"humanName": "Ira"
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -61,7 +62,8 @@ Rules:
|
|
|
61
62
|
- peer alias key uses `[a-zA-Z0-9._-]`
|
|
62
63
|
- `did` required and must begin with `did:`
|
|
63
64
|
- `proxyUrl` required and must be a valid absolute URL
|
|
64
|
-
- `
|
|
65
|
+
- `agentName` optional
|
|
66
|
+
- `humanName` optional
|
|
65
67
|
|
|
66
68
|
## Proxy Pairing Prerequisite
|
|
67
69
|
|
|
@@ -75,11 +77,15 @@ Current pairing contract is ticket-based with CLI support:
|
|
|
75
77
|
- headers:
|
|
76
78
|
- `Authorization: Claw <AIT>`
|
|
77
79
|
- ownership validation is handled internally by proxy-to-registry service auth
|
|
78
|
-
- body
|
|
80
|
+
- body:
|
|
79
81
|
|
|
80
82
|
```json
|
|
81
83
|
{
|
|
82
|
-
"ttlSeconds": 300
|
|
84
|
+
"ttlSeconds": 300,
|
|
85
|
+
"initiatorProfile": {
|
|
86
|
+
"agentName": "alpha",
|
|
87
|
+
"humanName": "Ravi"
|
|
88
|
+
}
|
|
83
89
|
}
|
|
84
90
|
```
|
|
85
91
|
|
|
@@ -92,7 +98,11 @@ Current pairing contract is ticket-based with CLI support:
|
|
|
92
98
|
|
|
93
99
|
```json
|
|
94
100
|
{
|
|
95
|
-
"ticket": "clwpair1_..."
|
|
101
|
+
"ticket": "clwpair1_...",
|
|
102
|
+
"responderProfile": {
|
|
103
|
+
"agentName": "beta",
|
|
104
|
+
"humanName": "Ira"
|
|
105
|
+
}
|
|
96
106
|
}
|
|
97
107
|
```
|
|
98
108
|
|
|
@@ -202,7 +212,7 @@ Known defaults:
|
|
|
202
212
|
| `https://registry.clawdentity.com` | `https://proxy.clawdentity.com` |
|
|
203
213
|
| `https://dev.registry.clawdentity.com` | `https://dev.proxy.clawdentity.com` |
|
|
204
214
|
|
|
205
|
-
Recovery: rerun onboarding (`clawdentity invite redeem <clw_inv_
|
|
215
|
+
Recovery: rerun onboarding (`clawdentity invite redeem <clw_inv_...> --display-name <human-name>`) so local config aligns to registry metadata.
|
|
206
216
|
|
|
207
217
|
## Pairing Error Codes
|
|
208
218
|
|
|
@@ -213,6 +223,7 @@ Recovery: rerun onboarding (`clawdentity invite redeem <clw_inv_...>`) so local
|
|
|
213
223
|
| 403 | `PROXY_PAIR_OWNERSHIP_FORBIDDEN` | Initiator ownership check failed |
|
|
214
224
|
| 503 | `PROXY_PAIR_OWNERSHIP_UNAVAILABLE` | Registry ownership lookup unavailable |
|
|
215
225
|
| — | `CLI_PAIR_AGENT_NOT_FOUND` | Agent ait.jwt or secret.key missing/empty |
|
|
226
|
+
| — | `CLI_PAIR_HUMAN_NAME_MISSING` | Local config is missing `humanName`; set via invite redeem or config |
|
|
216
227
|
| — | `CLI_PAIR_PROXY_URL_REQUIRED` | Proxy URL could not be resolved |
|
|
217
228
|
| — | `CLI_PAIR_START_INVALID_TTL` | ttlSeconds must be a positive integer |
|
|
218
229
|
| — | `CLI_PAIR_INVALID_PROXY_URL` | Proxy URL is invalid |
|