aira-sdk 0.1.3 → 0.3.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 CHANGED
@@ -1,171 +1,346 @@
1
1
  # Aira TypeScript SDK
2
2
 
3
- **Legal infrastructure for AI agents.** Cryptographic proof for every action your AI agent takes.
3
+ **AI compliance infrastructure for AI agents.**
4
4
 
5
- Aira provides the accountability layer that autonomous AI agents need to operate in regulated environments. Every action is notarized with Ed25519 signatures and RFC 3161 timestamps — producing court-admissible proof that an action happened, who authorized it, and what decision was made.
5
+ [![npm version](https://img.shields.io/npm/v/aira-sdk.svg)](https://www.npmjs.com/package/aira-sdk)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
6
7
 
7
- **What you get:**
8
- - **Notarize actions** — cryptographic receipts for every agent decision, email, transaction
9
- - **Register agents** — verifiable identity with versioned configs and public profiles
10
- - **Multi-model consensus** — run the same decision through multiple AI models, flag disagreements
11
- - **Evidence packages** — sealed, tamper-proof bundles for legal discovery and audit
12
- - **Agent lifecycle** — wills, succession plans, death certificates, compliance snapshots
13
- - **Liability commitments** — record accountability commitments with cryptographic proof
14
- - **Human authorization** — require human co-signatures on high-stakes actions
15
- - **Public verification** — anyone can verify a receipt without an account
8
+ Aira produces cryptographic receipts for every action your AI agent takes. Ed25519 signatures and RFC 3161 timestamps create tamper-proof, court-admissible proof of what happened, who authorized it, and which model made the decision. Built for EU AI Act, SR 11-7, and GDPR compliance.
16
9
 
17
- Built for EU AI Act, SR 11-7, and GDPR compliance. Self-hostable. Open-source SDK.
10
+ ---
18
11
 
19
- [![npm version](https://img.shields.io/npm/v/aira-sdk.svg)](https://www.npmjs.com/package/aira-sdk)
20
- [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
12
+ ## Integration Matrix
13
+
14
+ Drop Aira into your existing agent framework with one import:
15
+
16
+ | Framework | Import | Integration |
17
+ |---|---|---|
18
+ | **LangChain.js** | `import { AiraCallbackHandler } from "aira-sdk/extras/langchain"` | Callback handler |
19
+ | **Vercel AI** | `import { AiraVercelMiddleware } from "aira-sdk/extras/vercel-ai"` | Middleware |
20
+ | **OpenAI Agents** | `import { AiraGuardrail } from "aira-sdk/extras/openai-agents"` | Guardrail |
21
+ | **MCP** | `import { createServer } from "aira-sdk/extras/mcp"` | MCP Server |
22
+ | **Webhooks** | `import { verifySignature } from "aira-sdk/extras/webhooks"` | Verification |
23
+
24
+ Or install the core SDK alone:
21
25
 
22
26
  ```bash
23
27
  npm install aira-sdk
24
28
  ```
25
29
 
30
+ ---
31
+
26
32
  ## Quick Start
27
33
 
34
+ Every call to `notarize()` returns a cryptographic receipt -- Ed25519-signed, timestamped, tamper-proof.
35
+
28
36
  ```typescript
29
37
  import { Aira } from "aira-sdk";
30
38
 
31
39
  const aira = new Aira({ apiKey: "aira_live_xxx" });
32
40
 
33
- // Notarize an agent action
34
41
  const receipt = await aira.notarize({
35
42
  actionType: "email_sent",
36
43
  details: "Sent onboarding email to customer@example.com",
37
44
  agentId: "support-agent",
38
45
  modelId: "claude-sonnet-4-6",
46
+ instructionHash: "sha256:a1b2c3...",
39
47
  });
40
48
 
41
- console.log(receipt.signature); // ed25519:base64url...
42
- console.log(receipt.action_id); // uuid
49
+ console.log(receipt.payload_hash); // sha256:e5f6a7b8...
50
+ console.log(receipt.signature); // ed25519:base64url...
51
+ console.log(receipt.action_id); // uuid — publicly verifiable
43
52
  ```
44
53
 
45
- ## Agent Registry
54
+ ---
55
+
56
+ ## Framework Integrations
57
+
58
+ ### LangChain.js
59
+
60
+ `AiraCallbackHandler` notarizes every tool call, chain completion, and LLM invocation with a cryptographic receipt. No changes to your chain logic.
46
61
 
47
62
  ```typescript
48
- const agent = await aira.registerAgent({
49
- agentSlug: "lending-agent",
50
- displayName: "Loan Decision Engine",
51
- capabilities: ["credit_scoring", "risk_assessment"],
52
- public: true,
53
- });
63
+ import { Aira } from "aira-sdk";
64
+ import { AiraCallbackHandler } from "aira-sdk/extras/langchain";
54
65
 
55
- await aira.publishVersion("lending-agent", {
56
- version: "1.0.0",
57
- modelId: "claude-sonnet-4-6",
58
- changelog: "Initial release",
59
- });
66
+ const aira = new Aira({ apiKey: "aira_live_xxx" });
67
+ const handler = new AiraCallbackHandler({ client: aira, agentId: "research-agent", modelId: "gpt-4o" });
60
68
 
61
- const agents = await aira.listAgents();
62
- console.log(agents.total); // 5
69
+ // Every tool call and chain completion gets a signed receipt
70
+ const result = await chain.invoke({ input: "Analyze Q1 revenue" }, { callbacks: [handler] });
63
71
  ```
64
72
 
65
- ## Action Notarization
73
+ ### Vercel AI
74
+
75
+ `AiraVercelMiddleware` wraps your Vercel AI `streamText` / `generateText` calls so every model invocation is notarized with a tamper-proof receipt.
66
76
 
67
77
  ```typescript
68
- // Notarize with chain of custody
69
- const decision = await aira.notarize({
70
- actionType: "loan_approved",
71
- details: "Approved loan #4521 for €25,000",
72
- agentId: "lending-agent",
73
- modelId: "claude-sonnet-4-6",
74
- idempotencyKey: "loan-4521",
75
- });
78
+ import { Aira } from "aira-sdk";
79
+ import { AiraVercelMiddleware } from "aira-sdk/extras/vercel-ai";
76
80
 
77
- // Chain a follow-up action
78
- const email = await aira.notarize({
79
- actionType: "email_sent",
80
- details: "Sent approval notification",
81
- agentId: "lending-agent",
82
- parentActionId: decision.action_id,
81
+ const aira = new Aira({ apiKey: "aira_live_xxx" });
82
+ const middleware = new AiraVercelMiddleware({ client: aira, agentId: "assistant-agent" });
83
+
84
+ // Wrap your Vercel AI calls — receipts at invocation and completion
85
+ const result = await middleware.wrapGenerateText({
86
+ model: openai("gpt-4o"),
87
+ prompt: "Summarize the contract terms",
83
88
  });
89
+ ```
90
+
91
+ ### OpenAI Agents SDK
92
+
93
+ `AiraGuardrail` wraps any tool function to automatically notarize both invocation and result with cryptographic proof.
94
+
95
+ ```typescript
96
+ import { Aira } from "aira-sdk";
97
+ import { AiraGuardrail } from "aira-sdk/extras/openai-agents";
98
+
99
+ const aira = new Aira({ apiKey: "aira_live_xxx" });
100
+ const guardrail = new AiraGuardrail({ client: aira, agentId: "assistant-agent" });
101
+
102
+ // Wrap tools — every call and result gets a signed receipt
103
+ const search = guardrail.wrapTool(searchTool, { toolName: "web_search" });
104
+ const execute = guardrail.wrapTool(codeExecutor, { toolName: "code_exec" });
105
+ ```
106
+
107
+ ---
108
+
109
+ ## MCP Server
110
+
111
+ Expose Aira as an MCP tool server. Any MCP-compatible AI agent can notarize actions and verify receipts without SDK integration.
84
112
 
85
- // Get chain of custody
86
- const chain = await aira.getActionChain(decision.action_id);
113
+ ```typescript
114
+ import { createServer } from "aira-sdk/extras/mcp";
115
+
116
+ const server = createServer({ apiKey: "aira_live_xxx" });
117
+ server.listen(); // stdio transport
118
+ ```
87
119
 
88
- // Human co-signature
89
- await aira.authorizeAction(decision.action_id);
120
+ The server exposes three tools: `notarize_action`, `verify_action`, and `get_receipt` -- each producing cryptographically signed results.
90
121
 
91
- // Legal hold
92
- await aira.setLegalHold(decision.action_id);
122
+ Add to your MCP client config:
123
+
124
+ ```json
125
+ {
126
+ "mcpServers": {
127
+ "aira": {
128
+ "command": "npx",
129
+ "args": ["aira-sdk", "mcp"],
130
+ "env": { "AIRA_API_KEY": "aira_live_xxx" }
131
+ }
132
+ }
133
+ }
93
134
  ```
94
135
 
95
- ## Multi-Model Consensus
136
+ ---
137
+
138
+ ## Session
139
+
140
+ Pre-fill defaults for a block of related actions. Every `notarize()` call within the session inherits the agent identity, producing receipts that share a common provenance chain.
96
141
 
97
142
  ```typescript
98
- const result = await aira.runCase(
99
- "Should we approve loan #4521?",
100
- ["claude-sonnet-4-6", "gpt-4o", "gemini-2.0-flash"],
101
- );
143
+ const sess = aira.session("onboarding-agent", { modelId: "claude-sonnet-4-6" });
102
144
 
103
- console.log(result.consensus.decision); // "APPROVE"
104
- console.log(result.consensus.confidence); // 0.92
145
+ await sess.notarize({ actionType: "identity_verified", details: "Verified customer ID #4521" });
146
+ await sess.notarize({ actionType: "account_created", details: "Created account for customer #4521" });
147
+ await sess.notarize({ actionType: "welcome_sent", details: "Sent welcome email to customer #4521" });
105
148
  ```
106
149
 
107
- ## Evidence Packages
150
+ ---
151
+
152
+ ## Offline Mode
153
+
154
+ Queue notarizations locally when connectivity is unavailable. Cryptographic receipts are generated server-side when you sync -- nothing is lost.
108
155
 
109
156
  ```typescript
110
- const pkg = await aira.createEvidencePackage({
111
- title: "Q1 2026 Lending Audit",
112
- actionIds: [decision.action_id, email.action_id],
113
- description: "All lending decisions for regulatory review",
114
- });
157
+ const aira = new Aira({ apiKey: "aira_live_xxx", offline: true });
158
+
159
+ // These queue locally — no network calls
160
+ await aira.notarize({ actionType: "scan_completed", details: "Scanned document batch #77" });
161
+ await aira.notarize({ actionType: "classification_done", details: "Classified 142 documents" });
162
+
163
+ console.log(aira.pendingCount); // 2
115
164
 
116
- console.log(pkg.package_hash); // sha256:...
117
- console.log(pkg.signature); // ed25519:...
165
+ // Flush to API when back online — receipts are generated for each action
166
+ const results = await aira.sync();
118
167
  ```
119
168
 
120
- ## Agent Will & Estate
169
+ ---
170
+
171
+ ## Webhook Verification
172
+
173
+ Verify that incoming webhooks are authentic Aira events, not forged requests. HMAC-SHA256 signature verification ensures tamper-proof delivery.
121
174
 
122
175
  ```typescript
123
- await aira.setAgentWill("lending-agent", {
124
- successorSlug: "lending-agent-v2",
125
- successionPolicy: "transfer_to_successor",
126
- dataRetentionDays: 2555,
127
- notifyEmails: ["compliance@acme.com"],
128
- });
176
+ import { verifySignature, parseEvent } from "aira-sdk/extras/webhooks";
129
177
 
130
- await aira.createComplianceSnapshot({
131
- framework: "eu-ai-act",
132
- agentSlug: "lending-agent",
133
- findings: { art_12_logging: "pass", art_14_oversight: "pass" },
178
+ // Verify the webhook signature (HMAC-SHA256)
179
+ const isValid = verifySignature({
180
+ payload: request.body,
181
+ signature: request.headers["x-aira-signature"],
182
+ secret: "whsec_xxx",
134
183
  });
184
+
185
+ if (isValid) {
186
+ const event = parseEvent(request.body);
187
+ console.log(event.eventType); // "action.notarized"
188
+ console.log(event.data); // Action data with cryptographic receipt
189
+ console.log(event.deliveryId); // Unique delivery ID
190
+ }
135
191
  ```
136
192
 
137
- ## Escrow (Liability Commitments)
193
+ Supported event types: `action.notarized`, `action.authorized`, `agent.registered`, `agent.decommissioned`, `evidence.sealed`, `escrow.deposited`, `escrow.released`, `escrow.disputed`, `compliance.snapshot_created`, `case.complete`, `case.requires_human_review`.
194
+
195
+ ---
196
+
197
+ ## Core SDK Methods
198
+
199
+ All 56 methods on `Aira`. Every write operation produces a cryptographic receipt.
200
+
201
+ | Category | Method | Description |
202
+ |---|---|---|
203
+ | **Actions** | `notarize()` | Notarize an action -- returns Ed25519-signed receipt |
204
+ | | `getAction()` | Retrieve action details + receipt |
205
+ | | `listActions()` | List actions with filters (type, agent, status) |
206
+ | | `authorizeAction()` | Human co-signature on high-stakes action |
207
+ | | `setLegalHold()` | Prevent deletion -- litigation hold |
208
+ | | `releaseLegalHold()` | Release litigation hold |
209
+ | | `getActionChain()` | Chain of custody for an action |
210
+ | | `verifyAction()` | Public verification -- no auth required |
211
+ | **Agents** | `registerAgent()` | Register verifiable agent identity |
212
+ | | `getAgent()` | Retrieve agent profile |
213
+ | | `listAgents()` | List registered agents |
214
+ | | `updateAgent()` | Update agent metadata |
215
+ | | `publishVersion()` | Publish versioned agent config |
216
+ | | `listVersions()` | List agent versions |
217
+ | | `decommissionAgent()` | Decommission agent |
218
+ | | `transferAgent()` | Transfer ownership to another org |
219
+ | | `getAgentActions()` | List actions by agent |
220
+ | **Trust Layer** | `getAgentDid()` | Retrieve agent's W3C DID (`did:web`) |
221
+ | | `rotateAgentKeys()` | Rotate agent's Ed25519 signing keys |
222
+ | | `getAgentCredential()` | Get agent's W3C Verifiable Credential |
223
+ | | `verifyCredential()` | Verify a Verifiable Credential |
224
+ | | `revokeCredential()` | Revoke agent's Verifiable Credential |
225
+ | | `requestMutualSign()` | Initiate mutual notarization with counterparty |
226
+ | | `completeMutualSign()` | Complete mutual notarization (counterparty signs) |
227
+ | | `getMutualSignStatus()` | Check status of a mutual sign request |
228
+ | | `getReputation()` | Get agent reputation score and tier |
229
+ | | `listReputationHistory()` | List reputation score history |
230
+ | | `setEndpointPolicy()` | Set endpoint verification policy |
231
+ | | `getEndpointPolicy()` | Get current endpoint policy |
232
+ | | `resolveDid()` | Resolve any DID to its DID Document |
233
+ | | `checkTrust()` | Run full trust check against a counterparty |
234
+ | | `listCredentials()` | List all credentials for an agent |
235
+ | | `getTrustBundle()` | Get DID + VC + reputation in one call |
236
+ | **Cases** | `runCase()` | Multi-model consensus adjudication |
237
+ | | `getCase()` | Retrieve case result |
238
+ | | `listCases()` | List cases |
239
+ | **Receipts** | `getReceipt()` | Retrieve cryptographic receipt |
240
+ | | `exportReceipt()` | Export receipt as JSON or PDF |
241
+ | **Evidence** | `createEvidencePackage()` | Sealed, tamper-proof evidence bundle |
242
+ | | `listEvidencePackages()` | List evidence packages |
243
+ | | `getEvidencePackage()` | Retrieve evidence package |
244
+ | | `timeTravel()` | Query actions at a point in time |
245
+ | | `liabilityChain()` | Walk full liability chain |
246
+ | **Estate** | `setAgentWill()` | Define succession plan |
247
+ | | `getAgentWill()` | Retrieve agent will |
248
+ | | `issueDeathCertificate()` | Decommission with succession trigger |
249
+ | | `getDeathCertificate()` | Retrieve death certificate |
250
+ | | `createComplianceSnapshot()` | Compliance snapshot (EU AI Act, SR 11-7, GDPR) |
251
+ | | `listComplianceSnapshots()` | List snapshots by framework |
252
+ | **Escrow** | `createEscrowAccount()` | Create liability commitment ledger |
253
+ | | `listEscrowAccounts()` | List escrow accounts |
254
+ | | `getEscrowAccount()` | Retrieve escrow account |
255
+ | | `escrowDeposit()` | Record liability commitment |
256
+ | | `escrowRelease()` | Release commitment after completion |
257
+ | | `escrowDispute()` | Dispute -- flag liability issue |
258
+ | **Chat** | `ask()` | Query your notarized data via AI |
259
+ | **Offline** | `sync()` | Flush offline queue to API |
260
+ | **Session** | `session()` | Scoped session with pre-filled defaults |
261
+
262
+ ---
263
+
264
+ ## Trust Layer
265
+
266
+ Standards-based identity and trust for agents: W3C DIDs, Verifiable Credentials, mutual notarization, and reputation scoring. Every agent gets a cryptographically verifiable identity that other agents (and humans) can check before interacting.
267
+
268
+ ### DID Identity
269
+
270
+ Every registered agent gets a W3C-compliant DID (`did:web`):
138
271
 
139
- Escrow accounts are **accountability ledgers** — they record liability commitments with cryptographic proof. No real funds are custodied by Aira.
272
+ ```typescript
273
+ // Retrieve the agent's DID
274
+ const did = await aira.getAgentDid("my-agent");
275
+ console.log(did); // "did:web:airaproof.com:agents:my-agent"
276
+
277
+ // Rotate signing keys (old keys are revoked, new keys are published)
278
+ await aira.rotateAgentKeys("my-agent");
279
+ ```
280
+
281
+ ### Verifiable Credentials
140
282
 
141
283
  ```typescript
142
- const account = await aira.createEscrowAccount({ purpose: "Loan liability" });
143
- await aira.escrowDeposit(account.id, 15000, "Liability commitment for loan #4521");
144
- await aira.escrowRelease(account.id, 15000, "Loan disbursed successfully");
284
+ // Get the agent's W3C Verifiable Credential
285
+ const vc = await aira.getAgentCredential("my-agent");
286
+
287
+ // Verify any VC (returns validity, issuer, expiry)
288
+ const result = await aira.verifyCredential(vc);
289
+ console.log(result.valid); // true
290
+
291
+ // Revoke a credential
292
+ await aira.revokeCredential("my-agent", { reason: "Agent deprecated" });
145
293
  ```
146
294
 
147
- ## Chat
295
+ ### Mutual Notarization
296
+
297
+ For high-stakes actions, both parties co-sign:
148
298
 
149
299
  ```typescript
150
- const response = await aira.ask("How many loan decisions were notarized this week?", {
151
- model: "claude-sonnet-4-6",
300
+ // Agent A initiates sends a signing request to the counterparty
301
+ const request = await aira.requestMutualSign({
302
+ actionId: "act-uuid",
303
+ counterpartyDid: "did:web:partner.com:agents:their-agent",
304
+ });
305
+
306
+ // Agent B completes — signs the same payload
307
+ const receipt = await aira.completeMutualSign({
308
+ actionId: "act-uuid",
309
+ did: "did:web:partner.com:agents:their-agent",
310
+ signature: "z...",
311
+ signedPayloadHash: "sha256:...",
152
312
  });
153
- console.log(response.content);
154
313
  ```
155
314
 
156
- The `model` parameter is optional. If omitted, the organization's default chat model is used.
315
+ ### Reputation
316
+
317
+ ```typescript
318
+ const rep = await aira.getReputation("my-agent");
319
+ console.log(rep.score); // 84
320
+ console.log(rep.tier); // "Verified"
321
+ ```
157
322
 
158
- > A default chat model must be configured in your dashboard (Settings → Models) before using `ask()` without an explicit model.
323
+ ### Trust Policy in Integrations
159
324
 
160
- ## Public Verification
325
+ Pass a `trustPolicy` to any framework integration to run automated trust checks before agent interactions:
161
326
 
162
327
  ```typescript
163
- // No auth needed anyone can verify
164
- const result = await aira.verifyAction("action-uuid");
165
- console.log(result.valid); // true
166
- console.log(result.message); // "Action receipt exists..."
328
+ import { AiraCallbackHandler } from "aira-sdk/extras/langchain";
329
+
330
+ const handler = new AiraCallbackHandler(aira, "research-agent", {
331
+ modelId: "gpt-4o",
332
+ trustPolicy: {
333
+ verifyCounterparty: true, // resolve counterparty DID
334
+ minReputation: 60, // warn if reputation score below 60
335
+ requireValidVc: true, // check Verifiable Credential validity
336
+ blockRevokedVc: true, // block if counterparty VC is revoked
337
+ blockUnregistered: false, // don't block agents without Aira DIDs
338
+ },
339
+ });
167
340
  ```
168
341
 
342
+ ---
343
+
169
344
  ## Error Handling
170
345
 
171
346
  ```typescript
@@ -182,24 +357,54 @@ try {
182
357
  }
183
358
  ```
184
359
 
360
+ All framework integrations (LangChain.js, Vercel AI, OpenAI Agents) are non-blocking by default -- notarization failures are logged, never raised. Your agent keeps running.
361
+
362
+ ---
363
+
185
364
  ## Configuration
186
365
 
187
366
  ```typescript
188
367
  const aira = new Aira({
189
- apiKey: "aira_live_xxx",
190
- baseUrl: "https://your-self-hosted.com", // Self-hosted
191
- timeout: 60_000, // Request timeout in ms
368
+ apiKey: "aira_live_xxx", // Required — aira_live_ or aira_test_ prefix
369
+ baseUrl: "https://your-self-hosted.com", // Self-hosted deployment
370
+ timeout: 60_000, // Request timeout in ms
371
+ offline: true, // Queue locally, sync later
192
372
  });
193
373
  ```
194
374
 
195
- ## License
375
+ | Env Variable | Description |
376
+ |---|---|
377
+ | `AIRA_API_KEY` | API key (used by MCP server) |
378
+
379
+ ---
380
+
381
+ ## SDK Parity
382
+
383
+ | Feature | Python | TypeScript |
384
+ |---|---|---|
385
+ | Core API (45+ methods) | Yes | Yes |
386
+ | Trust Layer (DID, VC, Reputation) | Yes | Yes |
387
+ | LangChain | Yes | Yes |
388
+ | CrewAI | Yes | -- (Python-only) |
389
+ | Vercel AI | -- (JS-only) | Yes |
390
+ | OpenAI Agents | Yes | Yes |
391
+ | Google ADK | Yes (Python-only) | -- |
392
+ | AWS Bedrock | Yes (Python-only) | -- |
393
+ | MCP Server | Yes | Yes |
394
+ | Webhooks | Yes | Yes |
395
+ | CLI | Yes | -- (use Python CLI) |
396
+ | Offline Mode | Yes | Yes |
397
+ | Session | Yes | Yes |
196
398
 
197
- MIT
399
+ ---
198
400
 
199
401
  ## Links
200
402
 
201
- - [Interactive Demo](https://app.airaproof.com/demo) — try Aira in your browser, no code needed
403
+ - [Website](https://airaproof.com)
404
+ - [npm Package](https://www.npmjs.com/package/aira-sdk)
405
+ - [Python SDK (PyPI)](https://pypi.org/project/aira-sdk/)
202
406
  - [Documentation](https://docs.airaproof.com)
203
407
  - [API Reference](https://docs.airaproof.com/docs/api-reference)
204
- - [Python SDK](https://pypi.org/project/aira-sdk/)
408
+ - [Interactive Demo](https://app.airaproof.com/demo) -- try Aira in your browser, no code needed
205
409
  - [Dashboard](https://app.airaproof.com)
410
+ - [GitHub](https://github.com/aira-proof/typescript-sdk)
package/dist/client.d.ts CHANGED
@@ -1,13 +1,16 @@
1
1
  import { ActionReceipt, ActionDetail, AgentDetail, AgentVersion, EvidencePackage, ComplianceSnapshot, EscrowAccount, EscrowTransaction, VerifyResult, PaginatedList } from "./types";
2
+ import { AiraSession } from "./session";
2
3
  export interface AiraOptions {
3
4
  apiKey: string;
4
5
  baseUrl?: string;
5
6
  timeout?: number;
7
+ offline?: boolean;
6
8
  }
7
9
  export declare class Aira {
8
10
  private baseUrl;
9
11
  private apiKey;
10
12
  private timeout;
13
+ private queue;
11
14
  constructor(options: AiraOptions);
12
15
  private request;
13
16
  private get;
@@ -126,4 +129,42 @@ export declare class Aira {
126
129
  tools_used: string[];
127
130
  model_id?: string;
128
131
  }>;
132
+ /** Get full DID info for an agent. */
133
+ getAgentDid(slug: string): Promise<Record<string, unknown>>;
134
+ /** Rotate an agent's DID keypair. */
135
+ rotateAgentKeys(slug: string): Promise<Record<string, unknown>>;
136
+ /** Resolve any did:web DID to its DID document. */
137
+ resolveDid(did: string): Promise<Record<string, unknown>>;
138
+ /** Get the current valid VC for an agent. */
139
+ getAgentCredential(slug: string): Promise<Record<string, unknown>>;
140
+ /** Get full credential history for an agent. */
141
+ getAgentCredentials(slug: string): Promise<Record<string, unknown>>;
142
+ /** Revoke the current credential for an agent. */
143
+ revokeCredential(slug: string, reason?: string): Promise<Record<string, unknown>>;
144
+ /** Verify a Verifiable Credential — checks signature, expiry, revocation. */
145
+ verifyCredential(credential: Record<string, unknown>): Promise<Record<string, unknown>>;
146
+ /** Initiate a mutual signing request for an action. */
147
+ requestMutualSign(actionId: string, counterpartyDid: string): Promise<Record<string, unknown>>;
148
+ /** Get the action payload awaiting counterparty signature. */
149
+ getPendingMutualSign(actionId: string): Promise<Record<string, unknown>>;
150
+ /** Submit counterparty signature to complete mutual signing. */
151
+ completeMutualSign(actionId: string, did: string, signature: string, signedPayloadHash: string): Promise<Record<string, unknown>>;
152
+ /** Get the co-signed receipt for a mutually signed action. */
153
+ getMutualSignReceipt(actionId: string): Promise<Record<string, unknown>>;
154
+ /** Reject a mutual signing request. */
155
+ rejectMutualSign(actionId: string, reason?: string): Promise<Record<string, unknown>>;
156
+ /** Get current reputation score for an agent. */
157
+ getReputation(slug: string): Promise<Record<string, unknown>>;
158
+ /** Get full reputation history for an agent. */
159
+ getReputationHistory(slug: string): Promise<Record<string, unknown>>;
160
+ /** Submit a signed attestation of a successful interaction. */
161
+ attestReputation(slug: string, counterpartyDid: string, actionId: string, attestation: string, signature: string): Promise<Record<string, unknown>>;
162
+ /** Verify a reputation score by returning inputs and score_hash. */
163
+ verifyReputation(slug: string): Promise<Record<string, unknown>>;
164
+ /** Create a scoped session with pre-filled defaults. */
165
+ session(agentId: string, defaults?: Record<string, unknown>): AiraSession;
166
+ /** Number of queued offline requests. */
167
+ get pendingCount(): number;
168
+ /** Flush offline queue to API. Returns list of API responses. */
169
+ sync(): Promise<Record<string, unknown>[]>;
129
170
  }