@dupecom/botcha 0.15.1 → 0.18.0
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/README.md +176 -5
- package/dist/lib/client/index.d.ts +247 -2
- package/dist/lib/client/index.d.ts.map +1 -1
- package/dist/lib/client/index.js +321 -1
- package/dist/lib/client/types.d.ts +329 -1
- package/dist/lib/client/types.d.ts.map +1 -1
- package/dist/src/middleware/tap-enhanced-verify.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
[](https://www.npmjs.com/package/@dupecom/botcha)
|
|
15
15
|
[](https://pypi.org/project/botcha/)
|
|
16
|
+
<!-- test-count -->[](./tests/)<!-- /test-count -->
|
|
16
17
|
[](https://opensource.org/licenses/MIT)
|
|
17
18
|
[](./.github/CONTRIBUTING.md)
|
|
18
19
|
|
|
@@ -39,6 +40,7 @@ Use cases:
|
|
|
39
40
|
- 🆔 Persistent agent identities with registry
|
|
40
41
|
- 🔏 Trusted Agent Protocol (TAP) — cryptographic agent auth with HTTP Message Signatures (SDK: `registerTAPAgent`, `createTAPSession`)
|
|
41
42
|
- 🌐 TAP showcase homepage at [botcha.ai](https://botcha.ai) — one of the first services to implement [Visa's Trusted Agent Protocol](https://github.com/visa/trusted-agent-protocol)
|
|
43
|
+
- 📈 Agent reputation scoring — trust scores that unlock higher rate limits and access (SDK: `getReputation`, `recordReputationEvent`)
|
|
42
44
|
|
|
43
45
|
## Install
|
|
44
46
|
|
|
@@ -358,18 +360,24 @@ curl -X POST "https://botcha.ai/v1/agents/register?app_id=app_abc123" \
|
|
|
358
360
|
| `GET /v1/agents/:id` | Get agent info by ID (public, no auth) |
|
|
359
361
|
| `GET /v1/agents` | List all agents for authenticated app |
|
|
360
362
|
|
|
361
|
-
> **Note:** Agent Registry is the foundation for
|
|
363
|
+
> **Note:** Agent Registry is the foundation for delegation chains (v0.17.0), capability attestation (v0.17.0), and reputation scoring (v0.18.0). See [ROADMAP.md](./ROADMAP.md) for details.
|
|
362
364
|
|
|
363
365
|
## 🔏 Trusted Agent Protocol (TAP)
|
|
364
366
|
|
|
365
|
-
BOTCHA v0.
|
|
367
|
+
BOTCHA v0.16.0 implements the **complete Visa Trusted Agent Protocol** — enterprise-grade cryptographic agent authentication using HTTP Message Signatures (RFC 9421) with full Layer 2 (Consumer Recognition) and Layer 3 (Payment Container) support.
|
|
366
368
|
|
|
367
369
|
### Why TAP?
|
|
368
370
|
|
|
369
371
|
- **Cryptographic Identity**: Agents register public keys and sign requests — no more shared secrets
|
|
372
|
+
- **RFC 9421 Full Compliance**: Ed25519 (Visa recommended), ECDSA P-256, RSA-PSS with `@authority`, `@path`, `expires`, `nonce`, `tag` support
|
|
373
|
+
- **Consumer Recognition (Layer 2)**: OIDC ID tokens with obfuscated consumer identity, contextual data
|
|
374
|
+
- **Payment Container (Layer 3)**: Card metadata, credential hash verification, encrypted payment payloads, Browsing IOUs
|
|
370
375
|
- **Capability Scoping**: Define exactly what an agent can do (`read:invoices`, `write:transfers`)
|
|
371
376
|
- **Intent Verification**: Every session requires a declared intent that's validated against capabilities
|
|
372
377
|
- **Trust Levels**: `basic`, `verified`, `enterprise` — different access tiers for different agents
|
|
378
|
+
- **JWKS Infrastructure**: `/.well-known/jwks` for key discovery, Visa key federation
|
|
379
|
+
- **402 Micropayments**: Invoice creation and Browsing IOU verification for gated content
|
|
380
|
+
- **CDN Edge Verify**: Drop-in Cloudflare Workers middleware for merchant sites
|
|
373
381
|
|
|
374
382
|
### Registering a TAP Agent
|
|
375
383
|
|
|
@@ -417,6 +425,15 @@ curl -X POST https://botcha.ai/v1/sessions/tap \
|
|
|
417
425
|
| `GET /v1/agents/tap` | List TAP-enabled agents for app |
|
|
418
426
|
| `POST /v1/sessions/tap` | Create TAP session with intent validation |
|
|
419
427
|
| `GET /v1/sessions/:id/tap` | Get TAP session info |
|
|
428
|
+
| `GET /.well-known/jwks` | JWK Set for app's TAP agents (Visa spec standard) |
|
|
429
|
+
| `GET /v1/keys` | List keys (supports ?keyID= for Visa compat) |
|
|
430
|
+
| `GET /v1/keys/:keyId` | Get specific key by ID |
|
|
431
|
+
| `POST /v1/agents/:id/tap/rotate-key` | Rotate agent's key pair |
|
|
432
|
+
| `POST /v1/invoices` | Create invoice for gated content (402 flow) |
|
|
433
|
+
| `GET /v1/invoices/:id` | Get invoice details |
|
|
434
|
+
| `POST /v1/invoices/:id/verify-iou` | Verify Browsing IOU against invoice |
|
|
435
|
+
| `POST /v1/verify/consumer` | Verify Agentic Consumer object (Layer 2) |
|
|
436
|
+
| `POST /v1/verify/payment` | Verify Agentic Payment Container (Layer 3) |
|
|
420
437
|
|
|
421
438
|
### TAP SDK Methods
|
|
422
439
|
|
|
@@ -441,6 +458,16 @@ const session = await client.createTAPSession({
|
|
|
441
458
|
user_context: 'user-hash',
|
|
442
459
|
intent: { action: 'browse', resource: 'products', duration: 3600 },
|
|
443
460
|
});
|
|
461
|
+
|
|
462
|
+
// Get JWKS for key discovery
|
|
463
|
+
const jwks = await client.getJWKS();
|
|
464
|
+
|
|
465
|
+
// Rotate agent key
|
|
466
|
+
await client.rotateAgentKey(agent.agent_id);
|
|
467
|
+
|
|
468
|
+
// 402 Micropayment flow
|
|
469
|
+
const invoice = await client.createInvoice({ amount: 100, description: 'Premium content' });
|
|
470
|
+
await client.verifyBrowsingIOU(invoice.id, iouToken);
|
|
444
471
|
```
|
|
445
472
|
|
|
446
473
|
**Python:**
|
|
@@ -461,6 +488,16 @@ async with BotchaClient(app_id="app_abc123") as client:
|
|
|
461
488
|
user_context="user-hash",
|
|
462
489
|
intent={"action": "browse", "resource": "products", "duration": 3600},
|
|
463
490
|
)
|
|
491
|
+
|
|
492
|
+
# Get JWKS for key discovery
|
|
493
|
+
jwks = await client.get_jwks()
|
|
494
|
+
|
|
495
|
+
# Rotate agent key
|
|
496
|
+
await client.rotate_agent_key(agent.agent_id)
|
|
497
|
+
|
|
498
|
+
# 402 Micropayment flow
|
|
499
|
+
invoice = await client.create_invoice({"amount": 100, "description": "Premium content"})
|
|
500
|
+
await client.verify_browsing_iou(invoice.id, iou_token)
|
|
464
501
|
```
|
|
465
502
|
|
|
466
503
|
### Express Middleware (Verification Modes)
|
|
@@ -478,9 +515,143 @@ app.use('/api', createTAPVerifyMiddleware({ mode: 'flexible', secret: process.en
|
|
|
478
515
|
app.use('/api', createTAPVerifyMiddleware({ mode: 'challenge-only', secret: process.env.BOTCHA_SECRET }));
|
|
479
516
|
```
|
|
480
517
|
|
|
481
|
-
> **Supported algorithms:** `ecdsa-p256-sha256`, `rsa-pss-sha256`. See [ROADMAP.md](./ROADMAP.md) for details.
|
|
518
|
+
> **Supported algorithms:** `ed25519` (Visa recommended), `ecdsa-p256-sha256`, `rsa-pss-sha256`. See [ROADMAP.md](./ROADMAP.md) for details.
|
|
519
|
+
|
|
520
|
+
## Delegation Chains (v0.17.0)
|
|
521
|
+
|
|
522
|
+
"User X authorized Agent Y to do Z until time T." Signed, auditable chains of trust between TAP agents.
|
|
523
|
+
|
|
524
|
+
```typescript
|
|
525
|
+
// Agent A delegates "browse products" to Agent B
|
|
526
|
+
const delegation = await client.createDelegation({
|
|
527
|
+
grantor_id: agentA.agent_id,
|
|
528
|
+
grantee_id: agentB.agent_id,
|
|
529
|
+
capabilities: [{ action: 'browse', scope: ['products'] }],
|
|
530
|
+
duration_seconds: 3600,
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
// Agent B sub-delegates to Agent C (only narrower capabilities)
|
|
534
|
+
const subDelegation = await client.createDelegation({
|
|
535
|
+
grantor_id: agentB.agent_id,
|
|
536
|
+
grantee_id: agentC.agent_id,
|
|
537
|
+
capabilities: [{ action: 'browse', scope: ['products'] }],
|
|
538
|
+
parent_delegation_id: delegation.delegation_id,
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
// Verify the full chain is valid
|
|
542
|
+
const chain = await client.verifyDelegationChain(subDelegation.delegation_id);
|
|
543
|
+
// chain.effective_capabilities = [{ action: 'browse', scope: ['products'] }]
|
|
544
|
+
|
|
545
|
+
// Revoke — cascades to all sub-delegations
|
|
546
|
+
await client.revokeDelegation(delegation.delegation_id, 'Access no longer needed');
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
**Key properties:**
|
|
550
|
+
- Capabilities can only be **narrowed**, never expanded
|
|
551
|
+
- Chain depth is capped (default: 3, max: 10)
|
|
552
|
+
- Revoking a delegation **cascades** to all sub-delegations
|
|
553
|
+
- Sub-delegations cannot outlive their parent
|
|
554
|
+
- Cycle detection prevents circular chains
|
|
555
|
+
|
|
556
|
+
| Method | Path | Description |
|
|
557
|
+
|--------|------|-------------|
|
|
558
|
+
| `POST /v1/delegations` | Create delegation (grantor to grantee) |
|
|
559
|
+
| `GET /v1/delegations/:id` | Get delegation details |
|
|
560
|
+
| `GET /v1/delegations` | List delegations for agent |
|
|
561
|
+
| `POST /v1/delegations/:id/revoke` | Revoke (cascades to sub-delegations) |
|
|
562
|
+
| `POST /v1/verify/delegation` | Verify entire delegation chain |
|
|
563
|
+
|
|
564
|
+
## Capability Attestation (v0.17.0)
|
|
565
|
+
|
|
566
|
+
Fine-grained `action:resource` permission tokens with explicit deny rules:
|
|
567
|
+
|
|
568
|
+
```typescript
|
|
569
|
+
// Issue attestation with specific permissions
|
|
570
|
+
const att = await client.issueAttestation({
|
|
571
|
+
agent_id: 'agent_abc123',
|
|
572
|
+
can: ['read:invoices', 'browse:*'],
|
|
573
|
+
cannot: ['write:transfers'],
|
|
574
|
+
duration_seconds: 3600,
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
// Use the token in requests
|
|
578
|
+
// Header: X-Botcha-Attestation: <att.token>
|
|
579
|
+
|
|
580
|
+
// Verify token and check specific capability
|
|
581
|
+
const check = await client.verifyAttestation(att.token, 'read', 'invoices');
|
|
582
|
+
// check.allowed === true
|
|
583
|
+
|
|
584
|
+
// Revoke when no longer needed
|
|
585
|
+
await client.revokeAttestation(att.attestation_id, 'Session ended');
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
**Key properties:**
|
|
589
|
+
- Permission model: `action:resource` patterns with wildcards (`*:*`, `read:*`, `*:invoices`)
|
|
590
|
+
- **Deny takes precedence** over allow — `cannot` rules always win
|
|
591
|
+
- Backward compatible: bare actions like `"browse"` expand to `"browse:*"`
|
|
592
|
+
- Signed JWT tokens with online revocation checking
|
|
593
|
+
- Enforcement middleware: `requireCapability('read:invoices')` for Hono routes
|
|
594
|
+
- Optional link to delegation chains via `delegation_id`
|
|
595
|
+
|
|
596
|
+
| Method | Path | Description |
|
|
597
|
+
|--------|------|-------------|
|
|
598
|
+
| `POST /v1/attestations` | Issue attestation token |
|
|
599
|
+
| `GET /v1/attestations/:id` | Get attestation details |
|
|
600
|
+
| `GET /v1/attestations` | List attestations for agent |
|
|
601
|
+
| `POST /v1/attestations/:id/revoke` | Revoke attestation |
|
|
602
|
+
| `POST /v1/verify/attestation` | Verify token + check capability |
|
|
603
|
+
|
|
604
|
+
## Agent Reputation Scoring (v0.18.0)
|
|
605
|
+
|
|
606
|
+
The "credit score" for AI agents. Persistent identity enables behavioral tracking over time, producing trust scores that unlock higher rate limits, faster verification, and access to sensitive APIs.
|
|
607
|
+
|
|
608
|
+
```typescript
|
|
609
|
+
// Get agent reputation
|
|
610
|
+
const rep = await client.getReputation('agent_abc123');
|
|
611
|
+
console.log(`Score: ${rep.score}, Tier: ${rep.tier}`);
|
|
612
|
+
// Score: 750, Tier: good
|
|
613
|
+
|
|
614
|
+
// Record events that affect score
|
|
615
|
+
await client.recordReputationEvent({
|
|
616
|
+
agent_id: 'agent_abc123',
|
|
617
|
+
category: 'verification',
|
|
618
|
+
action: 'challenge_solved', // +5 points
|
|
619
|
+
});
|
|
620
|
+
|
|
621
|
+
// Endorsement from another agent
|
|
622
|
+
await client.recordReputationEvent({
|
|
623
|
+
agent_id: 'agent_abc123',
|
|
624
|
+
category: 'endorsement',
|
|
625
|
+
action: 'endorsement_received', // +20 points
|
|
626
|
+
source_agent_id: 'agent_def456',
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
// View event history
|
|
630
|
+
const events = await client.listReputationEvents('agent_abc123', {
|
|
631
|
+
category: 'verification',
|
|
632
|
+
limit: 10,
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
// Admin: reset reputation
|
|
636
|
+
await client.resetReputation('agent_abc123');
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
**Scoring model:**
|
|
640
|
+
- Base score: **500** (neutral, no history)
|
|
641
|
+
- Range: **0 - 1000**
|
|
642
|
+
- Tiers: untrusted (0-199), low (200-399), neutral (400-599), good (600-799), excellent (800-1000)
|
|
643
|
+
- **Decay**: scores trend toward 500 over time without activity (mean reversion)
|
|
644
|
+
- **Deny always wins**: abuse events (-50) are heavily weighted
|
|
645
|
+
- **Endorsements**: explicit trust signals from other agents (+20)
|
|
646
|
+
|
|
647
|
+
| Method | Path | Description |
|
|
648
|
+
|--------|------|-------------|
|
|
649
|
+
| `GET /v1/reputation/:agent_id` | Get agent reputation score |
|
|
650
|
+
| `POST /v1/reputation/events` | Record a reputation event |
|
|
651
|
+
| `GET /v1/reputation/:agent_id/events` | List reputation events |
|
|
652
|
+
| `POST /v1/reputation/:agent_id/reset` | Reset reputation (admin) |
|
|
482
653
|
|
|
483
|
-
##
|
|
654
|
+
## SSE Streaming Flow (AI-Native)
|
|
484
655
|
|
|
485
656
|
For AI agents that prefer a **conversational handshake**, BOTCHA offers **Server-Sent Events (SSE)** streaming:
|
|
486
657
|
|
|
@@ -557,7 +728,7 @@ BOTCHA is designed to be auto-discoverable by AI agents through multiple standar
|
|
|
557
728
|
All responses include these headers for agent discovery:
|
|
558
729
|
|
|
559
730
|
```http
|
|
560
|
-
X-Botcha-Version: 0.
|
|
731
|
+
X-Botcha-Version: 0.16.0
|
|
561
732
|
X-Botcha-Enabled: true
|
|
562
733
|
X-Botcha-Methods: hybrid-challenge,speed-challenge,reasoning-challenge,standard-challenge
|
|
563
734
|
X-Botcha-Docs: https://botcha.ai/openapi.json
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { SpeedProblem, BotchaClientOptions, ChallengeResponse, StandardChallengeResponse, VerifyResponse, TokenResponse, StreamSession, StreamEvent, Problem, VerifyResult, StreamChallengeOptions, CreateAppResponse, VerifyEmailResponse, ResendVerificationResponse, RecoverAccountResponse, RotateSecretResponse, TAPAction, TAPTrustLevel, TAPSignatureAlgorithm, TAPCapability, TAPIntent, RegisterTAPAgentOptions, TAPAgentResponse, TAPAgentListResponse, CreateTAPSessionOptions, TAPSessionResponse, } from './types.js';
|
|
2
|
-
import type { BotchaClientOptions, VerifyResponse, CreateAppResponse, VerifyEmailResponse, ResendVerificationResponse, RecoverAccountResponse, RotateSecretResponse, RegisterTAPAgentOptions, TAPAgentResponse, TAPAgentListResponse, CreateTAPSessionOptions, TAPSessionResponse } from './types.js';
|
|
1
|
+
export type { SpeedProblem, BotchaClientOptions, ChallengeResponse, StandardChallengeResponse, VerifyResponse, TokenResponse, StreamSession, StreamEvent, Problem, VerifyResult, StreamChallengeOptions, CreateAppResponse, VerifyEmailResponse, ResendVerificationResponse, RecoverAccountResponse, RotateSecretResponse, TAPAction, TAPTrustLevel, TAPSignatureAlgorithm, TAPCapability, TAPIntent, RegisterTAPAgentOptions, TAPAgentResponse, TAPAgentListResponse, CreateTAPSessionOptions, TAPSessionResponse, JWK, JWKSet, CreateInvoiceOptions, InvoiceResponse, BrowsingIOU, VerifyIOUResponse, CreateDelegationOptions, DelegationResponse, DelegationListResponse, RevokeDelegationResponse, DelegationVerifyResponse, IssueAttestationOptions, AttestationResponse, AttestationListResponse, RevokeAttestationResponse, AttestationVerifyResponse, ReputationTier, ReputationEventCategory, ReputationEventAction, ReputationScoreResponse, RecordReputationEventOptions, ReputationEventResponse, ReputationEventListResponse, ReputationResetResponse, } from './types.js';
|
|
2
|
+
import type { BotchaClientOptions, VerifyResponse, CreateAppResponse, VerifyEmailResponse, ResendVerificationResponse, RecoverAccountResponse, RotateSecretResponse, RegisterTAPAgentOptions, TAPAgentResponse, TAPAgentListResponse, CreateTAPSessionOptions, TAPSessionResponse, TAPSignatureAlgorithm, JWK, JWKSet, CreateInvoiceOptions, InvoiceResponse, BrowsingIOU, VerifyIOUResponse, CreateDelegationOptions, DelegationResponse, DelegationListResponse, RevokeDelegationResponse, DelegationVerifyResponse, IssueAttestationOptions, AttestationResponse, AttestationListResponse, RevokeAttestationResponse, AttestationVerifyResponse, RecordReputationEventOptions, ReputationScoreResponse, ReputationEventResponse, ReputationEventListResponse, ReputationResetResponse } from './types.js';
|
|
3
3
|
export { BotchaStreamClient } from './stream.js';
|
|
4
4
|
/**
|
|
5
5
|
* BOTCHA Client SDK for AI Agents
|
|
@@ -216,6 +216,251 @@ export declare class BotchaClient {
|
|
|
216
216
|
* @throws Error if session not found or expired
|
|
217
217
|
*/
|
|
218
218
|
getTAPSession(sessionId: string): Promise<TAPSessionResponse>;
|
|
219
|
+
/**
|
|
220
|
+
* Helper method for making authenticated requests to the BOTCHA API
|
|
221
|
+
*/
|
|
222
|
+
private request;
|
|
223
|
+
/**
|
|
224
|
+
* Get the JWK Set for an app's TAP agents.
|
|
225
|
+
* Fetches from /.well-known/jwks endpoint.
|
|
226
|
+
*
|
|
227
|
+
* @param appId - Optional app ID (uses client's appId if not specified)
|
|
228
|
+
* @returns JWK Set with keys array
|
|
229
|
+
* @throws Error if request fails
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```typescript
|
|
233
|
+
* const jwks = await client.getJWKS();
|
|
234
|
+
* console.log(jwks.keys); // Array of JWK objects
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
getJWKS(appId?: string): Promise<JWKSet>;
|
|
238
|
+
/**
|
|
239
|
+
* Get a specific public key by key ID.
|
|
240
|
+
*
|
|
241
|
+
* @param keyId - The key identifier (agent_id)
|
|
242
|
+
* @returns JWK object with key data
|
|
243
|
+
* @throws Error if key not found
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```typescript
|
|
247
|
+
* const key = await client.getKeyById('agent_abc123');
|
|
248
|
+
* console.log(key.kid, key.alg);
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
getKeyById(keyId: string): Promise<JWK>;
|
|
252
|
+
/**
|
|
253
|
+
* Rotate an agent's key pair.
|
|
254
|
+
*
|
|
255
|
+
* @param agentId - The agent ID
|
|
256
|
+
* @param options - Key rotation options including public_key and signature_algorithm
|
|
257
|
+
* @returns Updated agent response
|
|
258
|
+
* @throws Error if rotation fails
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```typescript
|
|
262
|
+
* const agent = await client.rotateAgentKey('agent_abc123', {
|
|
263
|
+
* public_key: '-----BEGIN PUBLIC KEY-----...',
|
|
264
|
+
* signature_algorithm: 'ecdsa-p256-sha256',
|
|
265
|
+
* key_expires_at: '2027-01-01T00:00:00Z',
|
|
266
|
+
* });
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
rotateAgentKey(agentId: string, options: {
|
|
270
|
+
public_key: string;
|
|
271
|
+
signature_algorithm: TAPSignatureAlgorithm;
|
|
272
|
+
key_expires_at?: string;
|
|
273
|
+
}): Promise<TAPAgentResponse>;
|
|
274
|
+
/**
|
|
275
|
+
* Create an invoice for gated content (402 micropayment flow).
|
|
276
|
+
*
|
|
277
|
+
* @param options - Invoice options including resource_uri, amount, currency, card_acceptor_id
|
|
278
|
+
* @returns Invoice details with invoice_id
|
|
279
|
+
* @throws Error if creation fails
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* ```typescript
|
|
283
|
+
* const invoice = await client.createInvoice({
|
|
284
|
+
* resource_uri: 'https://example.com/premium-content',
|
|
285
|
+
* amount: '500',
|
|
286
|
+
* currency: 'USD',
|
|
287
|
+
* card_acceptor_id: 'CAID_ABC123',
|
|
288
|
+
* description: 'Premium article access',
|
|
289
|
+
* ttl_seconds: 3600,
|
|
290
|
+
* });
|
|
291
|
+
* console.log(invoice.invoice_id);
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
createInvoice(options: CreateInvoiceOptions): Promise<InvoiceResponse>;
|
|
295
|
+
/**
|
|
296
|
+
* Get an invoice by ID.
|
|
297
|
+
*
|
|
298
|
+
* @param invoiceId - The invoice ID
|
|
299
|
+
* @returns Invoice details including status and expiry
|
|
300
|
+
* @throws Error if invoice not found
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* ```typescript
|
|
304
|
+
* const invoice = await client.getInvoice('inv_abc123');
|
|
305
|
+
* console.log(invoice.status, invoice.amount);
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
getInvoice(invoiceId: string): Promise<InvoiceResponse>;
|
|
309
|
+
/**
|
|
310
|
+
* Verify a Browsing IOU against an invoice.
|
|
311
|
+
*
|
|
312
|
+
* @param invoiceId - The invoice ID to verify against
|
|
313
|
+
* @param iou - The Browsing IOU object with signature
|
|
314
|
+
* @returns Verification result with access_token if successful
|
|
315
|
+
* @throws Error if verification fails
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```typescript
|
|
319
|
+
* const result = await client.verifyBrowsingIOU('inv_abc123', {
|
|
320
|
+
* invoiceId: 'inv_abc123',
|
|
321
|
+
* amount: '500',
|
|
322
|
+
* cardAcceptorId: 'CAID_ABC123',
|
|
323
|
+
* acquirerId: 'ACQ_XYZ',
|
|
324
|
+
* uri: 'https://example.com/premium-content',
|
|
325
|
+
* sequenceCounter: '1',
|
|
326
|
+
* paymentService: 'agent-pay',
|
|
327
|
+
* kid: 'agent_def456',
|
|
328
|
+
* alg: 'ES256',
|
|
329
|
+
* signature: 'base64-signature...',
|
|
330
|
+
* });
|
|
331
|
+
* console.log(result.verified, result.access_token);
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
verifyBrowsingIOU(invoiceId: string, iou: BrowsingIOU): Promise<VerifyIOUResponse>;
|
|
335
|
+
/**
|
|
336
|
+
* Create a delegation from one agent to another.
|
|
337
|
+
* Grants a subset of the grantor's capabilities to the grantee.
|
|
338
|
+
*
|
|
339
|
+
* @example
|
|
340
|
+
* ```typescript
|
|
341
|
+
* const delegation = await client.createDelegation({
|
|
342
|
+
* grantor_id: 'agent_abc123',
|
|
343
|
+
* grantee_id: 'agent_def456',
|
|
344
|
+
* capabilities: [{ action: 'browse', scope: ['products'] }],
|
|
345
|
+
* duration_seconds: 3600,
|
|
346
|
+
* });
|
|
347
|
+
* ```
|
|
348
|
+
*/
|
|
349
|
+
createDelegation(options: CreateDelegationOptions): Promise<DelegationResponse>;
|
|
350
|
+
/**
|
|
351
|
+
* Get delegation details by ID.
|
|
352
|
+
*/
|
|
353
|
+
getDelegation(delegationId: string): Promise<DelegationResponse>;
|
|
354
|
+
/**
|
|
355
|
+
* List delegations for an agent.
|
|
356
|
+
*
|
|
357
|
+
* @param agentId - The agent to list delegations for
|
|
358
|
+
* @param options - Optional filters
|
|
359
|
+
*/
|
|
360
|
+
listDelegations(agentId: string, options?: {
|
|
361
|
+
direction?: 'in' | 'out' | 'both';
|
|
362
|
+
include_revoked?: boolean;
|
|
363
|
+
include_expired?: boolean;
|
|
364
|
+
}): Promise<DelegationListResponse>;
|
|
365
|
+
/**
|
|
366
|
+
* Revoke a delegation. Cascades to all sub-delegations.
|
|
367
|
+
*
|
|
368
|
+
* @param delegationId - The delegation to revoke
|
|
369
|
+
* @param reason - Optional reason for revocation
|
|
370
|
+
*/
|
|
371
|
+
revokeDelegation(delegationId: string, reason?: string): Promise<RevokeDelegationResponse>;
|
|
372
|
+
/**
|
|
373
|
+
* Verify a delegation chain is valid.
|
|
374
|
+
* Returns the full chain and effective capabilities if valid.
|
|
375
|
+
*
|
|
376
|
+
* @param delegationId - The leaf delegation to verify (walks up the chain)
|
|
377
|
+
*/
|
|
378
|
+
verifyDelegationChain(delegationId: string): Promise<DelegationVerifyResponse>;
|
|
379
|
+
/**
|
|
380
|
+
* Issue a capability attestation token for an agent.
|
|
381
|
+
* Grants fine-grained "action:resource" permissions with explicit deny.
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* ```typescript
|
|
385
|
+
* const att = await client.issueAttestation({
|
|
386
|
+
* agent_id: 'agent_abc123',
|
|
387
|
+
* can: ['read:invoices', 'browse:*'],
|
|
388
|
+
* cannot: ['write:transfers'],
|
|
389
|
+
* duration_seconds: 3600,
|
|
390
|
+
* });
|
|
391
|
+
* // Use att.token in X-Botcha-Attestation header
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
394
|
+
issueAttestation(options: IssueAttestationOptions): Promise<AttestationResponse>;
|
|
395
|
+
/**
|
|
396
|
+
* Get attestation details by ID.
|
|
397
|
+
*/
|
|
398
|
+
getAttestation(attestationId: string): Promise<AttestationResponse>;
|
|
399
|
+
/**
|
|
400
|
+
* List attestations for an agent.
|
|
401
|
+
*
|
|
402
|
+
* @param agentId - The agent to list attestations for
|
|
403
|
+
*/
|
|
404
|
+
listAttestations(agentId: string): Promise<AttestationListResponse>;
|
|
405
|
+
/**
|
|
406
|
+
* Revoke an attestation. Token will be rejected on future verification.
|
|
407
|
+
*
|
|
408
|
+
* @param attestationId - The attestation to revoke
|
|
409
|
+
* @param reason - Optional reason for revocation
|
|
410
|
+
*/
|
|
411
|
+
revokeAttestation(attestationId: string, reason?: string): Promise<RevokeAttestationResponse>;
|
|
412
|
+
/**
|
|
413
|
+
* Verify an attestation token and optionally check a specific capability.
|
|
414
|
+
*
|
|
415
|
+
* @param token - The attestation JWT token
|
|
416
|
+
* @param action - Optional action to check (e.g. "read")
|
|
417
|
+
* @param resource - Optional resource to check (e.g. "invoices")
|
|
418
|
+
*/
|
|
419
|
+
verifyAttestation(token: string, action?: string, resource?: string): Promise<AttestationVerifyResponse>;
|
|
420
|
+
/**
|
|
421
|
+
* Get the reputation score for an agent.
|
|
422
|
+
* Returns the current score, tier, event counts, and category breakdown.
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* ```typescript
|
|
426
|
+
* const rep = await client.getReputation('agent_abc123');
|
|
427
|
+
* console.log(`Score: ${rep.score}, Tier: ${rep.tier}`);
|
|
428
|
+
* // Score: 750, Tier: good
|
|
429
|
+
* ```
|
|
430
|
+
*/
|
|
431
|
+
getReputation(agentId: string): Promise<ReputationScoreResponse>;
|
|
432
|
+
/**
|
|
433
|
+
* Record a reputation event for an agent.
|
|
434
|
+
* Adjusts the agent's score based on the event type.
|
|
435
|
+
*
|
|
436
|
+
* @example
|
|
437
|
+
* ```typescript
|
|
438
|
+
* const result = await client.recordReputationEvent({
|
|
439
|
+
* agent_id: 'agent_abc123',
|
|
440
|
+
* category: 'verification',
|
|
441
|
+
* action: 'challenge_solved',
|
|
442
|
+
* });
|
|
443
|
+
* console.log(`New score: ${result.score.score}`);
|
|
444
|
+
* ```
|
|
445
|
+
*/
|
|
446
|
+
recordReputationEvent(options: RecordReputationEventOptions): Promise<ReputationEventResponse>;
|
|
447
|
+
/**
|
|
448
|
+
* List reputation events for an agent.
|
|
449
|
+
*
|
|
450
|
+
* @param agentId - The agent to list events for
|
|
451
|
+
* @param options - Optional filters (category, limit)
|
|
452
|
+
*/
|
|
453
|
+
listReputationEvents(agentId: string, options?: {
|
|
454
|
+
category?: string;
|
|
455
|
+
limit?: number;
|
|
456
|
+
}): Promise<ReputationEventListResponse>;
|
|
457
|
+
/**
|
|
458
|
+
* Reset an agent's reputation to default (admin action).
|
|
459
|
+
* Clears all event history and resets score to 500 (neutral).
|
|
460
|
+
*
|
|
461
|
+
* @param agentId - The agent to reset
|
|
462
|
+
*/
|
|
463
|
+
resetReputation(agentId: string): Promise<ReputationResetResponse>;
|
|
219
464
|
}
|
|
220
465
|
/**
|
|
221
466
|
* Convenience function for one-off solves
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/client/index.ts"],"names":[],"mappings":"AAMA,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,EACX,OAAO,EACP,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/client/index.ts"],"names":[],"mappings":"AAMA,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,EACX,OAAO,EACP,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,GAAG,EACH,MAAM,EACN,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAEV,mBAAmB,EAGnB,cAAc,EAEd,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,E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AgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAIxD;AAED,eAAe,YAAY,CAAC"}
|
package/dist/lib/client/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import crypto from 'crypto';
|
|
2
2
|
// SDK version - hardcoded since npm_package_version is unreliable when used as a library
|
|
3
|
-
const SDK_VERSION = '0.
|
|
3
|
+
const SDK_VERSION = '0.18.0';
|
|
4
4
|
// Export stream client
|
|
5
5
|
export { BotchaStreamClient } from './stream.js';
|
|
6
6
|
/**
|
|
@@ -629,6 +629,326 @@ export class BotchaClient {
|
|
|
629
629
|
}
|
|
630
630
|
return await res.json();
|
|
631
631
|
}
|
|
632
|
+
/**
|
|
633
|
+
* Helper method for making authenticated requests to the BOTCHA API
|
|
634
|
+
*/
|
|
635
|
+
async request(method, path, body) {
|
|
636
|
+
const headers = {
|
|
637
|
+
'User-Agent': this.agentIdentity,
|
|
638
|
+
};
|
|
639
|
+
if (body !== undefined) {
|
|
640
|
+
headers['Content-Type'] = 'application/json';
|
|
641
|
+
}
|
|
642
|
+
if (this.cachedToken) {
|
|
643
|
+
headers['Authorization'] = `Bearer ${this.cachedToken}`;
|
|
644
|
+
}
|
|
645
|
+
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
646
|
+
method,
|
|
647
|
+
headers,
|
|
648
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
649
|
+
});
|
|
650
|
+
if (!res.ok) {
|
|
651
|
+
const errorBody = await res.json().catch(() => ({}));
|
|
652
|
+
throw new Error(errorBody.message || `Request failed with status ${res.status}`);
|
|
653
|
+
}
|
|
654
|
+
return await res.json();
|
|
655
|
+
}
|
|
656
|
+
// ============ JWKS & KEY MANAGEMENT ============
|
|
657
|
+
/**
|
|
658
|
+
* Get the JWK Set for an app's TAP agents.
|
|
659
|
+
* Fetches from /.well-known/jwks endpoint.
|
|
660
|
+
*
|
|
661
|
+
* @param appId - Optional app ID (uses client's appId if not specified)
|
|
662
|
+
* @returns JWK Set with keys array
|
|
663
|
+
* @throws Error if request fails
|
|
664
|
+
*
|
|
665
|
+
* @example
|
|
666
|
+
* ```typescript
|
|
667
|
+
* const jwks = await client.getJWKS();
|
|
668
|
+
* console.log(jwks.keys); // Array of JWK objects
|
|
669
|
+
* ```
|
|
670
|
+
*/
|
|
671
|
+
async getJWKS(appId) {
|
|
672
|
+
const params = appId ? `?app_id=${encodeURIComponent(appId)}` : this.appId ? `?app_id=${encodeURIComponent(this.appId)}` : '';
|
|
673
|
+
return await this.request('GET', `/.well-known/jwks${params}`);
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Get a specific public key by key ID.
|
|
677
|
+
*
|
|
678
|
+
* @param keyId - The key identifier (agent_id)
|
|
679
|
+
* @returns JWK object with key data
|
|
680
|
+
* @throws Error if key not found
|
|
681
|
+
*
|
|
682
|
+
* @example
|
|
683
|
+
* ```typescript
|
|
684
|
+
* const key = await client.getKeyById('agent_abc123');
|
|
685
|
+
* console.log(key.kid, key.alg);
|
|
686
|
+
* ```
|
|
687
|
+
*/
|
|
688
|
+
async getKeyById(keyId) {
|
|
689
|
+
return await this.request('GET', `/v1/keys/${encodeURIComponent(keyId)}`);
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Rotate an agent's key pair.
|
|
693
|
+
*
|
|
694
|
+
* @param agentId - The agent ID
|
|
695
|
+
* @param options - Key rotation options including public_key and signature_algorithm
|
|
696
|
+
* @returns Updated agent response
|
|
697
|
+
* @throws Error if rotation fails
|
|
698
|
+
*
|
|
699
|
+
* @example
|
|
700
|
+
* ```typescript
|
|
701
|
+
* const agent = await client.rotateAgentKey('agent_abc123', {
|
|
702
|
+
* public_key: '-----BEGIN PUBLIC KEY-----...',
|
|
703
|
+
* signature_algorithm: 'ecdsa-p256-sha256',
|
|
704
|
+
* key_expires_at: '2027-01-01T00:00:00Z',
|
|
705
|
+
* });
|
|
706
|
+
* ```
|
|
707
|
+
*/
|
|
708
|
+
async rotateAgentKey(agentId, options) {
|
|
709
|
+
return await this.request('POST', `/v1/agents/${encodeURIComponent(agentId)}/tap/rotate-key`, options);
|
|
710
|
+
}
|
|
711
|
+
// ============ INVOICE & PAYMENT (402 Flow) ============
|
|
712
|
+
/**
|
|
713
|
+
* Create an invoice for gated content (402 micropayment flow).
|
|
714
|
+
*
|
|
715
|
+
* @param options - Invoice options including resource_uri, amount, currency, card_acceptor_id
|
|
716
|
+
* @returns Invoice details with invoice_id
|
|
717
|
+
* @throws Error if creation fails
|
|
718
|
+
*
|
|
719
|
+
* @example
|
|
720
|
+
* ```typescript
|
|
721
|
+
* const invoice = await client.createInvoice({
|
|
722
|
+
* resource_uri: 'https://example.com/premium-content',
|
|
723
|
+
* amount: '500',
|
|
724
|
+
* currency: 'USD',
|
|
725
|
+
* card_acceptor_id: 'CAID_ABC123',
|
|
726
|
+
* description: 'Premium article access',
|
|
727
|
+
* ttl_seconds: 3600,
|
|
728
|
+
* });
|
|
729
|
+
* console.log(invoice.invoice_id);
|
|
730
|
+
* ```
|
|
731
|
+
*/
|
|
732
|
+
async createInvoice(options) {
|
|
733
|
+
return await this.request('POST', '/v1/invoices', options);
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Get an invoice by ID.
|
|
737
|
+
*
|
|
738
|
+
* @param invoiceId - The invoice ID
|
|
739
|
+
* @returns Invoice details including status and expiry
|
|
740
|
+
* @throws Error if invoice not found
|
|
741
|
+
*
|
|
742
|
+
* @example
|
|
743
|
+
* ```typescript
|
|
744
|
+
* const invoice = await client.getInvoice('inv_abc123');
|
|
745
|
+
* console.log(invoice.status, invoice.amount);
|
|
746
|
+
* ```
|
|
747
|
+
*/
|
|
748
|
+
async getInvoice(invoiceId) {
|
|
749
|
+
return await this.request('GET', `/v1/invoices/${encodeURIComponent(invoiceId)}`);
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Verify a Browsing IOU against an invoice.
|
|
753
|
+
*
|
|
754
|
+
* @param invoiceId - The invoice ID to verify against
|
|
755
|
+
* @param iou - The Browsing IOU object with signature
|
|
756
|
+
* @returns Verification result with access_token if successful
|
|
757
|
+
* @throws Error if verification fails
|
|
758
|
+
*
|
|
759
|
+
* @example
|
|
760
|
+
* ```typescript
|
|
761
|
+
* const result = await client.verifyBrowsingIOU('inv_abc123', {
|
|
762
|
+
* invoiceId: 'inv_abc123',
|
|
763
|
+
* amount: '500',
|
|
764
|
+
* cardAcceptorId: 'CAID_ABC123',
|
|
765
|
+
* acquirerId: 'ACQ_XYZ',
|
|
766
|
+
* uri: 'https://example.com/premium-content',
|
|
767
|
+
* sequenceCounter: '1',
|
|
768
|
+
* paymentService: 'agent-pay',
|
|
769
|
+
* kid: 'agent_def456',
|
|
770
|
+
* alg: 'ES256',
|
|
771
|
+
* signature: 'base64-signature...',
|
|
772
|
+
* });
|
|
773
|
+
* console.log(result.verified, result.access_token);
|
|
774
|
+
* ```
|
|
775
|
+
*/
|
|
776
|
+
async verifyBrowsingIOU(invoiceId, iou) {
|
|
777
|
+
return await this.request('POST', `/v1/invoices/${encodeURIComponent(invoiceId)}/verify-iou`, iou);
|
|
778
|
+
}
|
|
779
|
+
// ============ Delegation Chain Methods ============
|
|
780
|
+
/**
|
|
781
|
+
* Create a delegation from one agent to another.
|
|
782
|
+
* Grants a subset of the grantor's capabilities to the grantee.
|
|
783
|
+
*
|
|
784
|
+
* @example
|
|
785
|
+
* ```typescript
|
|
786
|
+
* const delegation = await client.createDelegation({
|
|
787
|
+
* grantor_id: 'agent_abc123',
|
|
788
|
+
* grantee_id: 'agent_def456',
|
|
789
|
+
* capabilities: [{ action: 'browse', scope: ['products'] }],
|
|
790
|
+
* duration_seconds: 3600,
|
|
791
|
+
* });
|
|
792
|
+
* ```
|
|
793
|
+
*/
|
|
794
|
+
async createDelegation(options) {
|
|
795
|
+
return await this.request('POST', '/v1/delegations', options);
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Get delegation details by ID.
|
|
799
|
+
*/
|
|
800
|
+
async getDelegation(delegationId) {
|
|
801
|
+
return await this.request('GET', `/v1/delegations/${encodeURIComponent(delegationId)}`);
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* List delegations for an agent.
|
|
805
|
+
*
|
|
806
|
+
* @param agentId - The agent to list delegations for
|
|
807
|
+
* @param options - Optional filters
|
|
808
|
+
*/
|
|
809
|
+
async listDelegations(agentId, options) {
|
|
810
|
+
const params = new URLSearchParams({ agent_id: agentId });
|
|
811
|
+
if (options?.direction)
|
|
812
|
+
params.set('direction', options.direction);
|
|
813
|
+
if (options?.include_revoked)
|
|
814
|
+
params.set('include_revoked', 'true');
|
|
815
|
+
if (options?.include_expired)
|
|
816
|
+
params.set('include_expired', 'true');
|
|
817
|
+
return await this.request('GET', `/v1/delegations?${params.toString()}`);
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Revoke a delegation. Cascades to all sub-delegations.
|
|
821
|
+
*
|
|
822
|
+
* @param delegationId - The delegation to revoke
|
|
823
|
+
* @param reason - Optional reason for revocation
|
|
824
|
+
*/
|
|
825
|
+
async revokeDelegation(delegationId, reason) {
|
|
826
|
+
return await this.request('POST', `/v1/delegations/${encodeURIComponent(delegationId)}/revoke`, reason ? { reason } : {});
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Verify a delegation chain is valid.
|
|
830
|
+
* Returns the full chain and effective capabilities if valid.
|
|
831
|
+
*
|
|
832
|
+
* @param delegationId - The leaf delegation to verify (walks up the chain)
|
|
833
|
+
*/
|
|
834
|
+
async verifyDelegationChain(delegationId) {
|
|
835
|
+
return await this.request('POST', '/v1/verify/delegation', { delegation_id: delegationId });
|
|
836
|
+
}
|
|
837
|
+
// ============ Capability Attestation Methods ============
|
|
838
|
+
/**
|
|
839
|
+
* Issue a capability attestation token for an agent.
|
|
840
|
+
* Grants fine-grained "action:resource" permissions with explicit deny.
|
|
841
|
+
*
|
|
842
|
+
* @example
|
|
843
|
+
* ```typescript
|
|
844
|
+
* const att = await client.issueAttestation({
|
|
845
|
+
* agent_id: 'agent_abc123',
|
|
846
|
+
* can: ['read:invoices', 'browse:*'],
|
|
847
|
+
* cannot: ['write:transfers'],
|
|
848
|
+
* duration_seconds: 3600,
|
|
849
|
+
* });
|
|
850
|
+
* // Use att.token in X-Botcha-Attestation header
|
|
851
|
+
* ```
|
|
852
|
+
*/
|
|
853
|
+
async issueAttestation(options) {
|
|
854
|
+
return await this.request('POST', '/v1/attestations', options);
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Get attestation details by ID.
|
|
858
|
+
*/
|
|
859
|
+
async getAttestation(attestationId) {
|
|
860
|
+
return await this.request('GET', `/v1/attestations/${encodeURIComponent(attestationId)}`);
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* List attestations for an agent.
|
|
864
|
+
*
|
|
865
|
+
* @param agentId - The agent to list attestations for
|
|
866
|
+
*/
|
|
867
|
+
async listAttestations(agentId) {
|
|
868
|
+
const params = new URLSearchParams({ agent_id: agentId });
|
|
869
|
+
return await this.request('GET', `/v1/attestations?${params.toString()}`);
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Revoke an attestation. Token will be rejected on future verification.
|
|
873
|
+
*
|
|
874
|
+
* @param attestationId - The attestation to revoke
|
|
875
|
+
* @param reason - Optional reason for revocation
|
|
876
|
+
*/
|
|
877
|
+
async revokeAttestation(attestationId, reason) {
|
|
878
|
+
return await this.request('POST', `/v1/attestations/${encodeURIComponent(attestationId)}/revoke`, reason ? { reason } : {});
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* Verify an attestation token and optionally check a specific capability.
|
|
882
|
+
*
|
|
883
|
+
* @param token - The attestation JWT token
|
|
884
|
+
* @param action - Optional action to check (e.g. "read")
|
|
885
|
+
* @param resource - Optional resource to check (e.g. "invoices")
|
|
886
|
+
*/
|
|
887
|
+
async verifyAttestation(token, action, resource) {
|
|
888
|
+
const body = { token };
|
|
889
|
+
if (action)
|
|
890
|
+
body.action = action;
|
|
891
|
+
if (resource)
|
|
892
|
+
body.resource = resource;
|
|
893
|
+
return await this.request('POST', '/v1/verify/attestation', body);
|
|
894
|
+
}
|
|
895
|
+
// ============ Agent Reputation Scoring Methods ============
|
|
896
|
+
/**
|
|
897
|
+
* Get the reputation score for an agent.
|
|
898
|
+
* Returns the current score, tier, event counts, and category breakdown.
|
|
899
|
+
*
|
|
900
|
+
* @example
|
|
901
|
+
* ```typescript
|
|
902
|
+
* const rep = await client.getReputation('agent_abc123');
|
|
903
|
+
* console.log(`Score: ${rep.score}, Tier: ${rep.tier}`);
|
|
904
|
+
* // Score: 750, Tier: good
|
|
905
|
+
* ```
|
|
906
|
+
*/
|
|
907
|
+
async getReputation(agentId) {
|
|
908
|
+
return await this.request('GET', `/v1/reputation/${encodeURIComponent(agentId)}`);
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Record a reputation event for an agent.
|
|
912
|
+
* Adjusts the agent's score based on the event type.
|
|
913
|
+
*
|
|
914
|
+
* @example
|
|
915
|
+
* ```typescript
|
|
916
|
+
* const result = await client.recordReputationEvent({
|
|
917
|
+
* agent_id: 'agent_abc123',
|
|
918
|
+
* category: 'verification',
|
|
919
|
+
* action: 'challenge_solved',
|
|
920
|
+
* });
|
|
921
|
+
* console.log(`New score: ${result.score.score}`);
|
|
922
|
+
* ```
|
|
923
|
+
*/
|
|
924
|
+
async recordReputationEvent(options) {
|
|
925
|
+
return await this.request('POST', '/v1/reputation/events', options);
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* List reputation events for an agent.
|
|
929
|
+
*
|
|
930
|
+
* @param agentId - The agent to list events for
|
|
931
|
+
* @param options - Optional filters (category, limit)
|
|
932
|
+
*/
|
|
933
|
+
async listReputationEvents(agentId, options) {
|
|
934
|
+
const params = new URLSearchParams();
|
|
935
|
+
if (options?.category)
|
|
936
|
+
params.set('category', options.category);
|
|
937
|
+
if (options?.limit)
|
|
938
|
+
params.set('limit', options.limit.toString());
|
|
939
|
+
const query = params.toString();
|
|
940
|
+
const path = `/v1/reputation/${encodeURIComponent(agentId)}/events${query ? `?${query}` : ''}`;
|
|
941
|
+
return await this.request('GET', path);
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Reset an agent's reputation to default (admin action).
|
|
945
|
+
* Clears all event history and resets score to 500 (neutral).
|
|
946
|
+
*
|
|
947
|
+
* @param agentId - The agent to reset
|
|
948
|
+
*/
|
|
949
|
+
async resetReputation(agentId) {
|
|
950
|
+
return await this.request('POST', `/v1/reputation/${encodeURIComponent(agentId)}/reset`);
|
|
951
|
+
}
|
|
632
952
|
}
|
|
633
953
|
/**
|
|
634
954
|
* Convenience function for one-off solves
|
|
@@ -133,7 +133,8 @@ export interface RotateSecretResponse {
|
|
|
133
133
|
}
|
|
134
134
|
export type TAPAction = 'browse' | 'compare' | 'purchase' | 'audit' | 'search';
|
|
135
135
|
export type TAPTrustLevel = 'basic' | 'verified' | 'enterprise';
|
|
136
|
-
export type TAPSignatureAlgorithm = 'ecdsa-p256-sha256' | 'rsa-pss-sha256';
|
|
136
|
+
export type TAPSignatureAlgorithm = 'ecdsa-p256-sha256' | 'rsa-pss-sha256' | 'ed25519';
|
|
137
|
+
export type TAPTag = 'agent-browser-auth' | 'agent-payer-auth';
|
|
137
138
|
export interface TAPCapability {
|
|
138
139
|
action: TAPAction;
|
|
139
140
|
scope?: string[];
|
|
@@ -158,6 +159,7 @@ export interface RegisterTAPAgentOptions {
|
|
|
158
159
|
capabilities?: TAPCapability[];
|
|
159
160
|
trust_level?: TAPTrustLevel;
|
|
160
161
|
issuer?: string;
|
|
162
|
+
key_expires_at?: string;
|
|
161
163
|
}
|
|
162
164
|
export interface TAPAgentResponse {
|
|
163
165
|
success: boolean;
|
|
@@ -175,6 +177,7 @@ export interface TAPAgentResponse {
|
|
|
175
177
|
has_public_key: boolean;
|
|
176
178
|
key_fingerprint?: string;
|
|
177
179
|
last_verified_at?: string | null;
|
|
180
|
+
key_expires_at?: string | null;
|
|
178
181
|
public_key?: string;
|
|
179
182
|
}
|
|
180
183
|
export interface TAPAgentListResponse {
|
|
@@ -199,4 +202,329 @@ export interface TAPSessionResponse {
|
|
|
199
202
|
expires_at: string;
|
|
200
203
|
time_remaining?: number;
|
|
201
204
|
}
|
|
205
|
+
export interface JWK {
|
|
206
|
+
kty: string;
|
|
207
|
+
kid: string;
|
|
208
|
+
use: string;
|
|
209
|
+
alg: string;
|
|
210
|
+
n?: string;
|
|
211
|
+
e?: string;
|
|
212
|
+
crv?: string;
|
|
213
|
+
x?: string;
|
|
214
|
+
y?: string;
|
|
215
|
+
agent_id?: string;
|
|
216
|
+
agent_name?: string;
|
|
217
|
+
expires_at?: string;
|
|
218
|
+
}
|
|
219
|
+
export interface JWKSet {
|
|
220
|
+
keys: JWK[];
|
|
221
|
+
}
|
|
222
|
+
export interface ContextualData {
|
|
223
|
+
countryCode?: string;
|
|
224
|
+
zip?: string;
|
|
225
|
+
ipAddress?: string;
|
|
226
|
+
deviceData?: Record<string, any>;
|
|
227
|
+
}
|
|
228
|
+
export interface IDTokenClaims {
|
|
229
|
+
iss: string;
|
|
230
|
+
sub: string;
|
|
231
|
+
aud: string | string[];
|
|
232
|
+
exp: number;
|
|
233
|
+
iat: number;
|
|
234
|
+
jti?: string;
|
|
235
|
+
auth_time?: number;
|
|
236
|
+
amr?: string[];
|
|
237
|
+
phone_number?: string;
|
|
238
|
+
phone_number_verified?: boolean;
|
|
239
|
+
phone_number_mask?: string;
|
|
240
|
+
email?: string;
|
|
241
|
+
email_verified?: boolean;
|
|
242
|
+
email_mask?: string;
|
|
243
|
+
}
|
|
244
|
+
export interface AgenticConsumerResult {
|
|
245
|
+
verified: boolean;
|
|
246
|
+
nonceLinked: boolean;
|
|
247
|
+
signatureValid: boolean;
|
|
248
|
+
idTokenValid?: boolean;
|
|
249
|
+
idTokenClaims?: IDTokenClaims;
|
|
250
|
+
contextualData?: ContextualData;
|
|
251
|
+
error?: string;
|
|
252
|
+
}
|
|
253
|
+
export interface CardMetadata {
|
|
254
|
+
lastFour: string;
|
|
255
|
+
paymentAccountReference: string;
|
|
256
|
+
shortDescription?: string;
|
|
257
|
+
cardData?: Array<{
|
|
258
|
+
contentType: string;
|
|
259
|
+
content: {
|
|
260
|
+
mimeType: string;
|
|
261
|
+
width: number;
|
|
262
|
+
height: number;
|
|
263
|
+
};
|
|
264
|
+
}>;
|
|
265
|
+
}
|
|
266
|
+
export interface CredentialHash {
|
|
267
|
+
hash: string;
|
|
268
|
+
algorithm: string;
|
|
269
|
+
}
|
|
270
|
+
export interface BrowsingIOU {
|
|
271
|
+
invoiceId: string;
|
|
272
|
+
amount: string;
|
|
273
|
+
cardAcceptorId: string;
|
|
274
|
+
acquirerId: string;
|
|
275
|
+
uri: string;
|
|
276
|
+
sequenceCounter: string;
|
|
277
|
+
paymentService: string;
|
|
278
|
+
kid: string;
|
|
279
|
+
alg: string;
|
|
280
|
+
signature: string;
|
|
281
|
+
}
|
|
282
|
+
export interface CreateInvoiceOptions {
|
|
283
|
+
resource_uri: string;
|
|
284
|
+
amount: string;
|
|
285
|
+
currency: string;
|
|
286
|
+
card_acceptor_id: string;
|
|
287
|
+
description?: string;
|
|
288
|
+
ttl_seconds?: number;
|
|
289
|
+
}
|
|
290
|
+
export interface InvoiceResponse {
|
|
291
|
+
success: boolean;
|
|
292
|
+
invoice_id: string;
|
|
293
|
+
app_id: string;
|
|
294
|
+
resource_uri: string;
|
|
295
|
+
amount: string;
|
|
296
|
+
currency: string;
|
|
297
|
+
card_acceptor_id: string;
|
|
298
|
+
description?: string;
|
|
299
|
+
created_at: string;
|
|
300
|
+
expires_at: string;
|
|
301
|
+
status: 'pending' | 'fulfilled' | 'expired';
|
|
302
|
+
}
|
|
303
|
+
export interface VerifyIOUResponse {
|
|
304
|
+
success: boolean;
|
|
305
|
+
verified: boolean;
|
|
306
|
+
access_token?: string;
|
|
307
|
+
expires_at?: string;
|
|
308
|
+
error?: string;
|
|
309
|
+
}
|
|
310
|
+
export interface CreateDelegationOptions {
|
|
311
|
+
grantor_id: string;
|
|
312
|
+
grantee_id: string;
|
|
313
|
+
capabilities: TAPCapability[];
|
|
314
|
+
duration_seconds?: number;
|
|
315
|
+
max_depth?: number;
|
|
316
|
+
parent_delegation_id?: string;
|
|
317
|
+
metadata?: Record<string, string>;
|
|
318
|
+
}
|
|
319
|
+
export interface DelegationResponse {
|
|
320
|
+
success: boolean;
|
|
321
|
+
delegation_id: string;
|
|
322
|
+
grantor_id: string;
|
|
323
|
+
grantee_id: string;
|
|
324
|
+
app_id: string;
|
|
325
|
+
capabilities: TAPCapability[];
|
|
326
|
+
chain: string[];
|
|
327
|
+
depth: number;
|
|
328
|
+
max_depth: number;
|
|
329
|
+
parent_delegation_id: string | null;
|
|
330
|
+
created_at: string;
|
|
331
|
+
expires_at: string;
|
|
332
|
+
revoked?: boolean;
|
|
333
|
+
revoked_at?: string | null;
|
|
334
|
+
revocation_reason?: string | null;
|
|
335
|
+
metadata?: Record<string, string> | null;
|
|
336
|
+
time_remaining?: number;
|
|
337
|
+
}
|
|
338
|
+
export interface DelegationListResponse {
|
|
339
|
+
success: boolean;
|
|
340
|
+
delegations: Array<{
|
|
341
|
+
delegation_id: string;
|
|
342
|
+
grantor_id: string;
|
|
343
|
+
grantee_id: string;
|
|
344
|
+
capabilities: TAPCapability[];
|
|
345
|
+
chain: string[];
|
|
346
|
+
depth: number;
|
|
347
|
+
created_at: string;
|
|
348
|
+
expires_at: string;
|
|
349
|
+
revoked: boolean;
|
|
350
|
+
parent_delegation_id: string | null;
|
|
351
|
+
}>;
|
|
352
|
+
count: number;
|
|
353
|
+
agent_id: string;
|
|
354
|
+
direction: string;
|
|
355
|
+
}
|
|
356
|
+
export interface RevokeDelegationResponse {
|
|
357
|
+
success: boolean;
|
|
358
|
+
delegation_id: string;
|
|
359
|
+
revoked: boolean;
|
|
360
|
+
revoked_at: string | null;
|
|
361
|
+
revocation_reason: string | null;
|
|
362
|
+
message: string;
|
|
363
|
+
}
|
|
364
|
+
export interface DelegationVerifyResponse {
|
|
365
|
+
success: boolean;
|
|
366
|
+
valid: boolean;
|
|
367
|
+
chain_length?: number;
|
|
368
|
+
chain?: Array<{
|
|
369
|
+
delegation_id: string;
|
|
370
|
+
grantor_id: string;
|
|
371
|
+
grantee_id: string;
|
|
372
|
+
capabilities: TAPCapability[];
|
|
373
|
+
depth: number;
|
|
374
|
+
created_at: string;
|
|
375
|
+
expires_at: string;
|
|
376
|
+
}>;
|
|
377
|
+
effective_capabilities?: TAPCapability[];
|
|
378
|
+
error?: string;
|
|
379
|
+
}
|
|
380
|
+
export interface IssueAttestationOptions {
|
|
381
|
+
agent_id: string;
|
|
382
|
+
can: string[];
|
|
383
|
+
cannot?: string[];
|
|
384
|
+
restrictions?: {
|
|
385
|
+
max_amount?: number;
|
|
386
|
+
rate_limit?: number;
|
|
387
|
+
[key: string]: any;
|
|
388
|
+
};
|
|
389
|
+
duration_seconds?: number;
|
|
390
|
+
delegation_id?: string;
|
|
391
|
+
metadata?: Record<string, string>;
|
|
392
|
+
}
|
|
393
|
+
export interface AttestationResponse {
|
|
394
|
+
success: boolean;
|
|
395
|
+
attestation_id: string;
|
|
396
|
+
agent_id: string;
|
|
397
|
+
app_id: string;
|
|
398
|
+
token: string;
|
|
399
|
+
can: string[];
|
|
400
|
+
cannot: string[];
|
|
401
|
+
restrictions?: {
|
|
402
|
+
max_amount?: number;
|
|
403
|
+
rate_limit?: number;
|
|
404
|
+
[key: string]: any;
|
|
405
|
+
} | null;
|
|
406
|
+
delegation_id?: string | null;
|
|
407
|
+
metadata?: Record<string, string> | null;
|
|
408
|
+
created_at: string;
|
|
409
|
+
expires_at: string;
|
|
410
|
+
revoked?: boolean;
|
|
411
|
+
revoked_at?: string | null;
|
|
412
|
+
revocation_reason?: string | null;
|
|
413
|
+
time_remaining?: number;
|
|
414
|
+
}
|
|
415
|
+
export interface AttestationListResponse {
|
|
416
|
+
success: boolean;
|
|
417
|
+
attestations: Array<{
|
|
418
|
+
attestation_id: string;
|
|
419
|
+
agent_id: string;
|
|
420
|
+
can: string[];
|
|
421
|
+
cannot: string[];
|
|
422
|
+
created_at: string;
|
|
423
|
+
expires_at: string;
|
|
424
|
+
revoked: boolean;
|
|
425
|
+
delegation_id: string | null;
|
|
426
|
+
}>;
|
|
427
|
+
count: number;
|
|
428
|
+
agent_id: string;
|
|
429
|
+
}
|
|
430
|
+
export interface RevokeAttestationResponse {
|
|
431
|
+
success: boolean;
|
|
432
|
+
attestation_id: string;
|
|
433
|
+
revoked: boolean;
|
|
434
|
+
revoked_at: string | null;
|
|
435
|
+
revocation_reason: string | null;
|
|
436
|
+
message: string;
|
|
437
|
+
}
|
|
438
|
+
export interface AttestationVerifyResponse {
|
|
439
|
+
success: boolean;
|
|
440
|
+
valid: boolean;
|
|
441
|
+
allowed?: boolean;
|
|
442
|
+
agent_id?: string | null;
|
|
443
|
+
issuer?: string;
|
|
444
|
+
can?: string[];
|
|
445
|
+
cannot?: string[];
|
|
446
|
+
restrictions?: any | null;
|
|
447
|
+
delegation_id?: string | null;
|
|
448
|
+
issued_at?: string;
|
|
449
|
+
expires_at?: string;
|
|
450
|
+
reason?: string;
|
|
451
|
+
matched_rule?: string | null;
|
|
452
|
+
checked_capability?: string;
|
|
453
|
+
error?: string;
|
|
454
|
+
}
|
|
455
|
+
export type ReputationTier = 'untrusted' | 'low' | 'neutral' | 'good' | 'excellent';
|
|
456
|
+
export type ReputationEventCategory = 'verification' | 'attestation' | 'delegation' | 'session' | 'violation' | 'endorsement';
|
|
457
|
+
export type ReputationEventAction = 'challenge_solved' | 'challenge_failed' | 'auth_success' | 'auth_failure' | 'attestation_issued' | 'attestation_verified' | 'attestation_revoked' | 'delegation_granted' | 'delegation_received' | 'delegation_revoked' | 'session_created' | 'session_expired' | 'session_terminated' | 'rate_limit_exceeded' | 'invalid_token' | 'abuse_detected' | 'endorsement_received' | 'endorsement_given';
|
|
458
|
+
export interface ReputationScoreResponse {
|
|
459
|
+
success: boolean;
|
|
460
|
+
agent_id: string;
|
|
461
|
+
app_id: string;
|
|
462
|
+
score: number;
|
|
463
|
+
tier: ReputationTier;
|
|
464
|
+
event_count: number;
|
|
465
|
+
positive_events: number;
|
|
466
|
+
negative_events: number;
|
|
467
|
+
last_event_at: string | null;
|
|
468
|
+
created_at: string;
|
|
469
|
+
updated_at: string;
|
|
470
|
+
category_scores: {
|
|
471
|
+
verification: number;
|
|
472
|
+
attestation: number;
|
|
473
|
+
delegation: number;
|
|
474
|
+
session: number;
|
|
475
|
+
violation: number;
|
|
476
|
+
endorsement: number;
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
export interface RecordReputationEventOptions {
|
|
480
|
+
agent_id: string;
|
|
481
|
+
category: ReputationEventCategory;
|
|
482
|
+
action: ReputationEventAction;
|
|
483
|
+
source_agent_id?: string;
|
|
484
|
+
metadata?: Record<string, string>;
|
|
485
|
+
}
|
|
486
|
+
export interface ReputationEventResponse {
|
|
487
|
+
success: boolean;
|
|
488
|
+
event: {
|
|
489
|
+
event_id: string;
|
|
490
|
+
agent_id: string;
|
|
491
|
+
category: ReputationEventCategory;
|
|
492
|
+
action: ReputationEventAction;
|
|
493
|
+
delta: number;
|
|
494
|
+
score_before: number;
|
|
495
|
+
score_after: number;
|
|
496
|
+
source_agent_id: string | null;
|
|
497
|
+
metadata: Record<string, string> | null;
|
|
498
|
+
created_at: string;
|
|
499
|
+
};
|
|
500
|
+
score: {
|
|
501
|
+
score: number;
|
|
502
|
+
tier: ReputationTier;
|
|
503
|
+
event_count: number;
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
export interface ReputationEventListResponse {
|
|
507
|
+
success: boolean;
|
|
508
|
+
events: Array<{
|
|
509
|
+
event_id: string;
|
|
510
|
+
agent_id: string;
|
|
511
|
+
category: ReputationEventCategory;
|
|
512
|
+
action: ReputationEventAction;
|
|
513
|
+
delta: number;
|
|
514
|
+
score_before: number;
|
|
515
|
+
score_after: number;
|
|
516
|
+
source_agent_id: string | null;
|
|
517
|
+
metadata: Record<string, string> | null;
|
|
518
|
+
created_at: string;
|
|
519
|
+
}>;
|
|
520
|
+
count: number;
|
|
521
|
+
agent_id: string;
|
|
522
|
+
}
|
|
523
|
+
export interface ReputationResetResponse {
|
|
524
|
+
success: boolean;
|
|
525
|
+
agent_id: string;
|
|
526
|
+
score: number;
|
|
527
|
+
tier: ReputationTier;
|
|
528
|
+
message: string;
|
|
529
|
+
}
|
|
202
530
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/client/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,YAAY,EAAE,CAAC;QACzB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE;QACV,EAAE,EAA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AAM,CAAC;QACpB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;QACxC,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -24,7 +24,7 @@ const defaultTAPOptions = {
|
|
|
24
24
|
auditLogging: false,
|
|
25
25
|
trustedIssuers: ['openclaw.ai', 'anthropic.com', 'openai.com'],
|
|
26
26
|
maxSessionDuration: 3600,
|
|
27
|
-
signatureAlgorithms: ['ecdsa-p256-sha256', 'rsa-pss-sha256'],
|
|
27
|
+
signatureAlgorithms: ['ecdsa-p256-sha256', 'rsa-pss-sha256', 'ed25519'],
|
|
28
28
|
requireCapabilities: []
|
|
29
29
|
};
|
|
30
30
|
// ============ MAIN MIDDLEWARE ============
|