@waiaas/skills 2.7.0 → 2.8.0-rc

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waiaas/skills",
3
- "version": "2.7.0",
3
+ "version": "2.8.0-rc",
4
4
  "description": "WAIaaS skill files for AI agents - install via npx @waiaas/skills add <name>",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -3,7 +3,7 @@ name: "WAIaaS Actions"
3
3
  description: "Action Provider framework: list providers, execute DeFi actions through the 6-stage transaction pipeline"
4
4
  category: "api"
5
5
  tags: [wallet, blockchain, defi, actions, waiass, jupiter, 0x, swap, lifi, bridge, cross-chain, lido, jito, staking, liquid-staking]
6
- version: "2.7.0"
6
+ version: "2.8.0-rc"
7
7
  dispatch:
8
8
  kind: "tool"
9
9
  allowedCommands: ["curl"]
@@ -3,7 +3,7 @@ name: "WAIaaS Admin"
3
3
  description: "Admin API: daemon status, kill switch, notifications, settings management, JWT rotation, shutdown, oracle status, API key management"
4
4
  category: "api"
5
5
  tags: [wallet, blockchain, admin, security, oracle, defi, waiass]
6
- version: "2.7.0"
6
+ version: "2.8.0-rc"
7
7
  dispatch:
8
8
  kind: "tool"
9
9
  allowedCommands: ["curl"]
@@ -3,7 +3,7 @@ name: "WAIaaS Policies"
3
3
  description: "Policy engine CRUD: 12 policy types for spending limits, whitelists, time restrictions, rate limits, token/contract/approve controls, network restrictions, x402 domain controls"
4
4
  category: "api"
5
5
  tags: [wallet, blockchain, policies, security, waiass]
6
- version: "2.7.0"
6
+ version: "2.8.0-rc"
7
7
  dispatch:
8
8
  kind: "tool"
9
9
  allowedCommands: ["curl"]
@@ -3,7 +3,7 @@ name: "WAIaaS Quickset"
3
3
  description: "End-to-end quickset: create wallet, session, check balance, send first transfer"
4
4
  category: "api"
5
5
  tags: [wallet, blockchain, solana, ethereum, quickset, quickstart, waiass]
6
- version: "2.7.0"
6
+ version: "2.8.0-rc"
7
7
  dispatch:
8
8
  kind: "tool"
9
9
  allowedCommands: ["curl"]
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: "WAIaaS Session Recovery"
3
+ description: "Recover from expired or permanently expired session tokens"
4
+ category: "api"
5
+ tags: [wallet, blockchain, session, recovery, token, expired, waiass]
6
+ version: "2.8.0-rc"
7
+ dispatch:
8
+ kind: "tool"
9
+ allowedCommands: ["curl"]
10
+ ---
11
+
12
+ # WAIaaS Session Recovery
13
+
14
+ This skill guides you through recovering from an expired session token. Follow the appropriate path based on your error type.
15
+
16
+ > AI agents must NEVER request the master password. Use only your session token.
17
+
18
+ ## Diagnosing the Problem
19
+
20
+ When you receive a `401` response with one of these error codes, your session needs attention:
21
+
22
+ | Error Code | Meaning | Recovery Path |
23
+ |-----------|---------|---------------|
24
+ | `TOKEN_EXPIRED` | Session TTL elapsed | Try renewal first |
25
+ | `RENEWAL_LIMIT_REACHED` | Max renewals exceeded (default 12) | Request new session |
26
+ | `SESSION_REVOKED` | Session manually revoked by operator | Request new session |
27
+ | `SESSION_NOT_FOUND` | Session deleted or invalid | Request new session |
28
+
29
+ ## Path A: Session Renewal (Self-Service)
30
+
31
+ If your session is expired but not permanently, try renewing it first:
32
+
33
+ ```bash
34
+ curl -s -X PUT http://localhost:3100/v1/sessions/{sessionId}/renew \
35
+ -H "Authorization: Bearer wai_sess_..." | jq .
36
+ ```
37
+
38
+ **Success response:**
39
+ ```json
40
+ {
41
+ "token": "wai_sess_<new-token>",
42
+ "expiresAt": 1740000000,
43
+ "renewalCount": 1
44
+ }
45
+ ```
46
+
47
+ Update your session token with the new value and continue operating.
48
+
49
+ **Safety checks that may block renewal:**
50
+ - Less than 50% of TTL has elapsed (too early)
51
+ - Renewal count exceeds max (default 12)
52
+ - Absolute session lifetime exceeded (default 1 year)
53
+ - Token hash mismatch (concurrent renewal detected)
54
+
55
+ ## Path B: Request New Session from Operator
56
+
57
+ When renewal is not possible (RENEWAL_LIMIT_REACHED, SESSION_REVOKED, SESSION_NOT_FOUND), you cannot self-recover. Follow these steps:
58
+
59
+ ### Step 1: Inform the User
60
+
61
+ Tell the user clearly:
62
+
63
+ > My WAIaaS session token has permanently expired and cannot be renewed. I need a new session token to continue operating.
64
+
65
+ ### Step 2: Guide the Operator
66
+
67
+ The operator (human user) should create a new session via one of these methods:
68
+
69
+ **Option A: CLI (recommended)**
70
+ ```bash
71
+ waiaas session prompt
72
+ ```
73
+ This generates a new session with an AI-ready connection prompt.
74
+
75
+ **Option B: Admin UI**
76
+ 1. Open Admin UI (http://localhost:3100/admin)
77
+ 2. Navigate to Sessions page
78
+ 3. Click "Create Session" and select the wallets
79
+ 4. Copy the generated token
80
+
81
+ **Option C: REST API**
82
+ ```bash
83
+ curl -s -X POST http://localhost:3100/v1/sessions \
84
+ -H "Content-Type: application/json" \
85
+ -H "X-Master-Password: <operator-enters-password>" \
86
+ -d '{"walletIds": ["<wallet-id>"], "ttl": 2592000}' | jq .
87
+ ```
88
+
89
+ ### Step 3: Apply the New Token
90
+
91
+ Once the operator provides the new token:
92
+
93
+ **For MCP agents:** The operator updates the token file at `DATA_DIR/mcp-token`. The MCP recovery loop polls this file every 60 seconds and will automatically pick up the new token.
94
+
95
+ **For REST API agents:** Update the `Authorization: Bearer wai_sess_...` header with the new token value.
96
+
97
+ ### Step 4: Verify Recovery
98
+
99
+ After applying the new token, call connect-info to verify:
100
+
101
+ ```bash
102
+ curl -s http://localhost:3100/v1/connect-info \
103
+ -H "Authorization: Bearer wai_sess_<new-token>" | jq .session
104
+ ```
105
+
106
+ Expected: 200 OK with session info including new `expiresAt`.
107
+
108
+ ## Prevention Tips
109
+
110
+ - **Check session expiry proactively**: The `connect-info` response includes `session.expiresAt` (Unix timestamp). Monitor this to renew before expiration.
111
+ - **Renew early**: Call `PUT /v1/sessions/{id}/renew` when 60% of TTL has elapsed (MCP agents do this automatically).
112
+ - **Use long TTL**: Default session TTL is 30 days. The operator can configure up to 1 year via Admin Settings.
@@ -3,7 +3,7 @@ name: "WAIaaS Setup"
3
3
  description: "Zero-state daemon setup: install CLI, initialize, start daemon, create wallet, configure session"
4
4
  category: "api"
5
5
  tags: [wallet, blockchain, solana, ethereum, setup, install, waiass]
6
- version: "2.7.0"
6
+ version: "2.8.0-rc"
7
7
  dispatch:
8
8
  kind: "tool"
9
9
  allowedCommands: ["curl", "npm", "npx", "waiaas", "which"]
@@ -3,7 +3,7 @@ name: "WAIaaS Transactions"
3
3
  description: "All 5 transaction types (TRANSFER, TOKEN_TRANSFER, CONTRACT_CALL, APPROVE, BATCH) with lifecycle management"
4
4
  category: "api"
5
5
  tags: [wallet, blockchain, solana, ethereum, transactions, waiass]
6
- version: "2.7.0"
6
+ version: "2.8.0-rc"
7
7
  dispatch:
8
8
  kind: "tool"
9
9
  allowedCommands: ["curl"]
@@ -3,7 +3,7 @@ name: "WAIaaS Wallet Management"
3
3
  description: "Wallet CRUD, asset queries, session management, token registry, MCP provisioning, owner management"
4
4
  category: "api"
5
5
  tags: [wallet, blockchain, solana, ethereum, sessions, tokens, mcp, waiass]
6
- version: "2.7.0"
6
+ version: "2.8.0-rc"
7
7
  dispatch:
8
8
  kind: "tool"
9
9
  allowedCommands: ["curl"]
@@ -176,6 +176,15 @@ curl -s -X PUT http://localhost:3100/v1/wallets/01958f3a-1234-7000-8000-abcdef12
176
176
  Parameters:
177
177
  - `owner_address` (required): blockchain address (Solana base58 or Ethereum 0x-prefixed, EIP-55 normalized)
178
178
  - `approval_method` (optional): Owner approval method override for this wallet. Valid values: `"sdk_ntfy"`, `"sdk_telegram"`, `"walletconnect"`, `"telegram_bot"`, `"rest"`, or `null` (auto-detect). Set to `null` to clear and use automatic channel detection.
179
+ - `wallet_type` (optional): Built-in wallet preset type. Valid values: `"dcent"`. When specified, the preset's approval_method and preferred_wallet override manual settings.
180
+
181
+ ```bash
182
+ # With wallet preset:
183
+ curl -s -X PUT http://localhost:3100/v1/wallets/01958f3a-1234-7000-8000-abcdef123456/owner \
184
+ -H 'Content-Type: application/json' \
185
+ -H 'X-Master-Password: your-master-password' \
186
+ -d '{"owner_address": "0x1234...abcd", "wallet_type": "dcent"}'
187
+ ```
179
188
 
180
189
  Response (200):
181
190
  ```json
@@ -190,10 +199,14 @@ Response (200):
190
199
  "ownerAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
191
200
  "ownerVerified": false,
192
201
  "approvalMethod": null,
202
+ "walletType": null,
203
+ "warning": null,
193
204
  "updatedAt": 1707000100
194
205
  }
195
206
  ```
196
207
 
208
+ When both `wallet_type` and `approval_method` are provided, the preset's approval_method takes precedence and a `warning` field is included in the response.
209
+
197
210
  Error: `OWNER_ALREADY_CONNECTED` (409) if wallet is in LOCKED state -- use ownerAuth to change owner.
198
211
 
199
212
  ### POST /v1/wallets/{id}/owner/verify -- Verify Owner Signature (masterAuth + ownerAuth)
@@ -3,7 +3,7 @@ name: "WAIaaS x402"
3
3
  description: "x402 auto-payment protocol: fetch URLs with automatic cryptocurrency payments"
4
4
  category: "api"
5
5
  tags: [wallet, blockchain, x402, payments, waiass]
6
- version: "2.7.0"
6
+ version: "2.8.0-rc"
7
7
  dispatch:
8
8
  kind: "tool"
9
9
  allowedCommands: ["curl"]