@valiron/sdk 0.12.0 → 1.0.1

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/docs/llms.txt CHANGED
@@ -17,9 +17,12 @@ GET /operator/wallet/{wallet}?chain={chain}
17
17
  ### Resolve wallet to agent
18
18
  GET /operator/resolve-wallet/{wallet}?chain={chain}
19
19
 
20
- ### Run sandbox test
20
+ ### Run sandbox test (on-chain agent)
21
21
  POST /operator/trigger-sandbox/{agentId}
22
22
 
23
+ ### Run sandbox test (key-based agent)
24
+ POST /operator/trigger-sandbox-key/{agentAddress}
25
+
23
26
  ### Trust gate (allow/deny)
24
27
  POST /operator/gate/{agentId}
25
28
  Body: { "ttlMs": 86400000 }
@@ -37,24 +40,6 @@ Body: { "event": "evaluation_complete", "url": "https://your-endpoint.com/hooks"
37
40
  ### Health check
38
41
  GET /operator/health
39
42
 
40
- ### Payment Channels (Solana — USDC credit lines)
41
- POST /channel/preflight/{agentId}
42
- Body: { "walletAddress": "SolanaWalletPubkey" }
43
-
44
- POST /channel/open/{agentId}
45
- Body: { "walletAddress": "...", "depositSignature": "SolanaTxSig" }
46
-
47
- POST /channel/consume/{sessionId}
48
- Headers: Authorization: Bearer {sessionId}
49
- Body: { "cost": 0.50, "description": "API call" }
50
-
51
- GET /channel/status/{sessionId}
52
-
53
- POST /channel/settle/{sessionId}
54
- Body: {}
55
-
56
- GET /channel/health
57
-
58
43
  ## SDK
59
44
 
60
45
  Install: npm install @valiron/sdk
@@ -79,14 +64,13 @@ const snapshot = await valiron.getAgentSnapshot("AGENT_ID");
79
64
  console.log(snapshot.snapshotHash); // "0xabc..."
80
65
  console.log(snapshot.previousHash); // "0x0" (genesis)
81
66
 
82
- // Payment channels (Solana) — trust-adaptive USDC credit lines
83
- const preflight = await valiron.channelPreflight("1226", "SolanaWallet...");
84
- const channel = await valiron.channelOpen("1226", "SolanaWallet...", "depositTxSig");
85
- const usage = await valiron.channelConsume(channel.sessionId, 0.50, "GPT-4o call");
86
- const status = await valiron.channelStatus(channel.sessionId);
87
- const settlement = await valiron.channelSettle(channel.sessionId);
67
+ // Sandbox evaluation for key-based agent
68
+ const keyResult = await valiron.triggerKeyAgentSandbox("0x1234...abcd");
69
+ console.log(keyResult.tier); // "A"
88
70
  ```
89
71
 
72
+ Auto-sandbox: Middleware automatically triggers sandbox evaluation for new agents (on-chain with totalFeedback=0, or key-based with no score). Returns 403 with { error: "Agent pending evaluation", retryAfterMs: 30000 }.
73
+
90
74
  ## Trust Tiers
91
75
 
92
76
  Valiron assigns Moody's-style credit tiers: AAA (highest trust) through C (lowest trust). Higher tiers route to production, lower tiers are sandboxed or blocked. Exact score ranges are not disclosed.
@@ -145,6 +129,7 @@ ethereum, monad, arbitrum, base, avalanche, celo, polygon, linea, abstract, bsc,
145
129
  - [Full documentation (llms-full.txt)](https://valiron.co/llms-full.txt) — Complete AI-optimized documentation in a single file
146
130
  - docs/agents/README.md — Index
147
131
  - docs/agents/QUICKSTART.md — Get started
132
+ - docs/agents/DASHBOARD.md — Operator Dashboard (manage endpoints, keys, analytics, playground)
148
133
  - docs/agents/API-REFERENCE.md — HTTP API reference
149
134
  - docs/agents/SDK-REFERENCE.md — TypeScript SDK reference
150
135
  - docs/agents/TRUST-MODEL.md — Trust evaluation and behavioral factors
@@ -152,3 +137,56 @@ ethereum, monad, arbitrum, base, avalanche, celo, polygon, linea, abstract, bsc,
152
137
  - docs/agents/SANDBOX.md — Sandbox testing environment
153
138
  - docs/agents/CHAINS.md — Supported blockchains
154
139
  - docs/agents/ERRORS.md — Error handling and troubleshooting
140
+
141
+ ## Operator Dashboard
142
+
143
+ Dashboard URL: https://valiron.co/dashboard (JWT-authenticated)
144
+
145
+ ### Dashboard Features
146
+ - Overview: revenue, calls, agents, latency stats + quick start guide
147
+ - Agents: view every agent that called your API, drill into per-agent detail
148
+ - Analytics: revenue charts (7/30/90 days), top endpoints, today's stats
149
+ - Call Logs: paginated log with time/agent/chain/endpoint/status/cost/latency filters
150
+ - API Keys: generate, copy, and revoke operator API keys (val_op_ prefix)
151
+ - Endpoints: register API paths with method, price per call, rate limit, description
152
+ - Playground: test how agents at different trust levels are evaluated (dry-run or live)
153
+ - Settings: update name, view plan and fee rate
154
+ - Admin (admin-only): platform stats, all operators
155
+
156
+ ### Dashboard API Endpoints (JWT-authenticated)
157
+
158
+ POST /operator/register
159
+ Body: { "email": "...", "password": "...", "name": "..." }
160
+
161
+ POST /operator/login
162
+ Body: { "email": "...", "password": "..." }
163
+
164
+ GET /operator/me
165
+ PATCH /operator/me
166
+ Body: { "name": "..." }
167
+
168
+ GET /operator/keys
169
+ POST /operator/keys/rotate
170
+ Body: { "label": "..." }
171
+ DELETE /operator/keys/{keyId}
172
+
173
+ GET /operator/endpoints
174
+ POST /operator/endpoints
175
+ Body: { "path": "/api/v1/weather", "method": "GET", "pricePerCall": 0.05, "description": "...", "rateLimit": 60, "targetUrl": "https://myapi.com" }
176
+ DELETE /operator/endpoints/{endpointId}
177
+
178
+ GET /operator/analytics/stats
179
+ GET /operator/analytics/revenue?days=30
180
+ GET /operator/analytics/top-endpoints?limit=10
181
+ GET /operator/analytics/agents?sortBy=lastSeen&limit=50&offset=0
182
+ GET /operator/analytics/agents/{agentId}
183
+ GET /operator/analytics/logs?limit=50&offset=0&days=7
184
+
185
+ POST /operator/playground
186
+ Body: { "method": "GET", "path": "/api/test", "agentId": "25459", "chain": "ethereum", "dryRun": false, "headers": {}, "body": null }
187
+
188
+ ### Admin Endpoints (require role: "admin")
189
+ GET /operator/admin/stats
190
+ GET /operator/admin/operators
191
+ GET /operator/admin/operators/{id}
192
+ GET /operator/admin/operators/{id}/logs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valiron/sdk",
3
- "version": "0.12.0",
3
+ "version": "1.0.1",
4
4
  "description": "Official TypeScript SDK for Valiron — Trust & Reputation Middleware for API Protection",
5
5
  "repository": {
6
6
  "type": "git",