@agledger/sdk 1.1.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.
Files changed (49) hide show
  1. package/LICENSE +34 -0
  2. package/README.md +209 -0
  3. package/dist/client.d.ts +46 -0
  4. package/dist/client.js +68 -0
  5. package/dist/errors.d.ts +64 -0
  6. package/dist/errors.js +114 -0
  7. package/dist/http.d.ts +47 -0
  8. package/dist/http.js +272 -0
  9. package/dist/index.d.ts +19 -0
  10. package/dist/index.js +12 -0
  11. package/dist/resources/a2a.d.ts +22 -0
  12. package/dist/resources/a2a.js +33 -0
  13. package/dist/resources/admin.d.ts +39 -0
  14. package/dist/resources/admin.js +57 -0
  15. package/dist/resources/capabilities.d.ts +23 -0
  16. package/dist/resources/capabilities.js +21 -0
  17. package/dist/resources/compliance.d.ts +34 -0
  18. package/dist/resources/compliance.js +54 -0
  19. package/dist/resources/dashboard.d.ts +14 -0
  20. package/dist/resources/dashboard.js +20 -0
  21. package/dist/resources/disputes.d.ts +16 -0
  22. package/dist/resources/disputes.js +26 -0
  23. package/dist/resources/events.d.ts +21 -0
  24. package/dist/resources/events.js +22 -0
  25. package/dist/resources/health.d.ts +15 -0
  26. package/dist/resources/health.js +21 -0
  27. package/dist/resources/mandates.d.ts +48 -0
  28. package/dist/resources/mandates.js +89 -0
  29. package/dist/resources/notarize.d.ts +20 -0
  30. package/dist/resources/notarize.js +44 -0
  31. package/dist/resources/proxy.d.ts +74 -0
  32. package/dist/resources/proxy.js +149 -0
  33. package/dist/resources/receipts.d.ts +28 -0
  34. package/dist/resources/receipts.js +27 -0
  35. package/dist/resources/registration.d.ts +30 -0
  36. package/dist/resources/registration.js +39 -0
  37. package/dist/resources/reputation.d.ts +16 -0
  38. package/dist/resources/reputation.js +17 -0
  39. package/dist/resources/schemas.d.ts +20 -0
  40. package/dist/resources/schemas.js +24 -0
  41. package/dist/resources/verification.d.ts +13 -0
  42. package/dist/resources/verification.js +17 -0
  43. package/dist/resources/webhooks.d.ts +25 -0
  44. package/dist/resources/webhooks.js +37 -0
  45. package/dist/types.d.ts +1134 -0
  46. package/dist/types.js +6 -0
  47. package/dist/webhooks/verify.d.ts +37 -0
  48. package/dist/webhooks/verify.js +86 -0
  49. package/package.json +74 -0
package/dist/http.js ADDED
@@ -0,0 +1,272 @@
1
+ /**
2
+ * AGLedger™ SDK — HTTP Client
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ *
5
+ * Zero runtime dependencies. Uses native fetch + crypto.
6
+ */
7
+ import { AgledgerApiError, AuthenticationError, PermissionError, NotFoundError, ValidationError, UnprocessableError, RateLimitError, ConnectionError, TimeoutError, } from './errors.js';
8
+ const BASE_URLS = {
9
+ production: 'https://api.agledger.ai',
10
+ sandbox: 'https://sandbox.api.agledger.ai',
11
+ };
12
+ const DEFAULT_BASE_URL = BASE_URLS.production;
13
+ const DEFAULT_TIMEOUT = 30_000;
14
+ const DEFAULT_MAX_RETRIES = 3;
15
+ const MAX_BACKOFF = 30_000;
16
+ export class HttpClient {
17
+ apiKey;
18
+ baseUrl;
19
+ maxRetries;
20
+ timeout;
21
+ fetchFn;
22
+ idempotencyKeyPrefix;
23
+ _rateLimitInfo = null;
24
+ /** Rate limit info from the most recent response. Null if headers not present. */
25
+ get rateLimitInfo() {
26
+ return this._rateLimitInfo;
27
+ }
28
+ constructor(options) {
29
+ this.apiKey = options.apiKey;
30
+ const envUrl = options.environment ? BASE_URLS[options.environment] : undefined;
31
+ this.baseUrl = (options.baseUrl || envUrl || DEFAULT_BASE_URL).replace(/\/+$/, '');
32
+ this.maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
33
+ this.timeout = options.timeout ?? DEFAULT_TIMEOUT;
34
+ this.fetchFn = options.fetch ?? globalThis.fetch.bind(globalThis);
35
+ this.idempotencyKeyPrefix = options.idempotencyKeyPrefix ?? '';
36
+ }
37
+ async get(path, params, options) {
38
+ const url = this.buildUrl(path, params);
39
+ return this.request('GET', url, undefined, options);
40
+ }
41
+ async post(path, body, options) {
42
+ const url = this.buildUrl(path);
43
+ return this.request('POST', url, body, options);
44
+ }
45
+ async patch(path, body, options) {
46
+ const url = this.buildUrl(path);
47
+ return this.request('PATCH', url, body, options);
48
+ }
49
+ async delete(path, options) {
50
+ const url = this.buildUrl(path);
51
+ return this.request('DELETE', url, undefined, options);
52
+ }
53
+ /**
54
+ * Fetch a list endpoint and normalize the response into Page<T>.
55
+ * Handles both current inconsistent responses (bare arrays, various envelope shapes)
56
+ * and the target format ({ data, hasMore, nextCursor, total }).
57
+ */
58
+ async getPage(path, params, options) {
59
+ const raw = await this.get(path, params, options);
60
+ return this.normalizePage(raw);
61
+ }
62
+ /**
63
+ * Async iterator for auto-paginating through all pages.
64
+ * Yields individual items. Stops after maxPages (default: 100) as a safety ceiling.
65
+ */
66
+ async *paginate(path, params, options) {
67
+ const maxPages = options?.maxPages ?? 100;
68
+ const maxItems = options?.maxItems;
69
+ let cursor;
70
+ let pagesRead = 0;
71
+ let itemsYielded = 0;
72
+ while (pagesRead < maxPages) {
73
+ const pageParams = { ...params, ...(cursor ? { cursor } : {}) };
74
+ const page = await this.getPage(path, pageParams, options);
75
+ pagesRead++;
76
+ for (const item of page.data) {
77
+ yield item;
78
+ itemsYielded++;
79
+ if (maxItems && itemsYielded >= maxItems)
80
+ return;
81
+ }
82
+ if (!page.hasMore || !page.nextCursor)
83
+ return;
84
+ cursor = page.nextCursor;
85
+ }
86
+ }
87
+ // ---------------------------------------------------------------------------
88
+ // Internal
89
+ // ---------------------------------------------------------------------------
90
+ buildUrl(path, params) {
91
+ const raw = path.startsWith('/') ? `${this.baseUrl}${path}` : `${this.baseUrl}/${path}`;
92
+ const url = new URL(raw);
93
+ if (params) {
94
+ for (const [key, value] of Object.entries(params)) {
95
+ if (value !== undefined && value !== null) {
96
+ url.searchParams.set(key, String(value));
97
+ }
98
+ }
99
+ }
100
+ return url.toString();
101
+ }
102
+ async request(method, url, body, options) {
103
+ // Idempotency keys for all mutating methods
104
+ const needsIdempotencyKey = method === 'POST' || method === 'PATCH' || method === 'DELETE';
105
+ const idempotencyKey = options?.idempotencyKey ??
106
+ (needsIdempotencyKey
107
+ ? `${this.idempotencyKeyPrefix}${crypto.randomUUID()}`
108
+ : undefined);
109
+ let lastError;
110
+ for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
111
+ if (attempt > 0) {
112
+ await this.sleep(this.backoff(attempt, lastError));
113
+ }
114
+ const timeout = options?.timeout ?? this.timeout;
115
+ const controller = new AbortController();
116
+ const timer = setTimeout(() => controller.abort(), timeout);
117
+ if (options?.signal) {
118
+ if (options.signal.aborted) {
119
+ clearTimeout(timer);
120
+ throw new ConnectionError('Request aborted', new Error('AbortError'));
121
+ }
122
+ options.signal.addEventListener('abort', () => controller.abort(), { once: true });
123
+ }
124
+ const headers = {
125
+ Authorization: `Bearer ${this.apiKey}`,
126
+ Accept: 'application/json',
127
+ };
128
+ if (body !== undefined) {
129
+ headers['Content-Type'] = 'application/json';
130
+ }
131
+ if (idempotencyKey) {
132
+ headers['Idempotency-Key'] = idempotencyKey;
133
+ }
134
+ try {
135
+ const response = await this.fetchFn(url, {
136
+ method,
137
+ headers,
138
+ body: body !== undefined ? JSON.stringify(body) : undefined,
139
+ signal: controller.signal,
140
+ });
141
+ clearTimeout(timer);
142
+ if (response.status === 204) {
143
+ return undefined;
144
+ }
145
+ this.parseRateLimitHeaders(response.headers);
146
+ if (response.ok) {
147
+ return (await response.json());
148
+ }
149
+ // Parse error body
150
+ let errorBody;
151
+ try {
152
+ errorBody = (await response.json());
153
+ }
154
+ catch {
155
+ errorBody = {
156
+ error: 'unknown',
157
+ message: response.statusText || `HTTP ${response.status}`,
158
+ };
159
+ }
160
+ const error = this.mapError(response.status, errorBody, response.headers);
161
+ // Retry on 429 and 5xx
162
+ if (response.status === 429 || response.status >= 500) {
163
+ lastError = error;
164
+ continue;
165
+ }
166
+ throw error;
167
+ }
168
+ catch (err) {
169
+ clearTimeout(timer);
170
+ if (err instanceof AgledgerApiError) {
171
+ throw err;
172
+ }
173
+ const cause = err;
174
+ if (cause.name === 'AbortError') {
175
+ lastError = new TimeoutError(method, url, timeout, cause);
176
+ }
177
+ else {
178
+ lastError = new ConnectionError(`Network error: ${cause.message}`, cause);
179
+ }
180
+ // Retry network errors
181
+ continue;
182
+ }
183
+ }
184
+ throw lastError;
185
+ }
186
+ mapError(status, body, headers) {
187
+ const errorBody = {
188
+ error: body.error || 'unknown',
189
+ message: body.message || `HTTP ${status}`,
190
+ requestId: body.requestId,
191
+ code: body.code,
192
+ retryable: body.retryable,
193
+ details: body.details,
194
+ };
195
+ switch (status) {
196
+ case 400:
197
+ return new ValidationError(errorBody);
198
+ case 401:
199
+ return new AuthenticationError(errorBody);
200
+ case 403:
201
+ return new PermissionError(errorBody);
202
+ case 404:
203
+ return new NotFoundError(errorBody);
204
+ case 422:
205
+ return new UnprocessableError(errorBody);
206
+ case 429: {
207
+ const retryAfterHeader = headers.get('Retry-After');
208
+ const retryAfter = retryAfterHeader
209
+ ? parseInt(retryAfterHeader, 10) * 1000
210
+ : null;
211
+ return new RateLimitError(errorBody, retryAfter);
212
+ }
213
+ default:
214
+ return new AgledgerApiError(status, errorBody);
215
+ }
216
+ }
217
+ backoff(attempt, lastError) {
218
+ let delay = Math.min(1000 * Math.pow(2, attempt - 1), MAX_BACKOFF);
219
+ // Honor Retry-After from rate limit errors
220
+ if (lastError instanceof RateLimitError && lastError.retryAfter) {
221
+ delay = Math.max(delay, lastError.retryAfter);
222
+ }
223
+ // Add 0–25% jitter
224
+ const jitter = delay * Math.random() * 0.25;
225
+ return delay + jitter;
226
+ }
227
+ parseRateLimitHeaders(headers) {
228
+ const limit = headers.get('x-ratelimit-limit');
229
+ const remaining = headers.get('x-ratelimit-remaining');
230
+ const reset = headers.get('x-ratelimit-reset');
231
+ if (limit !== null && remaining !== null && reset !== null) {
232
+ this._rateLimitInfo = {
233
+ limit: parseInt(limit, 10),
234
+ remaining: parseInt(remaining, 10),
235
+ reset: parseInt(reset, 10),
236
+ };
237
+ }
238
+ }
239
+ /**
240
+ * Normalize any list response shape into Page<T>.
241
+ * Handles: bare array, { data }, { data, hasMore, nextCursor, total },
242
+ * { data, total, limit, offset }, { data, next_cursor }.
243
+ */
244
+ normalizePage(raw) {
245
+ // Bare array
246
+ if (Array.isArray(raw)) {
247
+ return { data: raw, hasMore: false };
248
+ }
249
+ const obj = raw;
250
+ const data = (Array.isArray(obj.data) ? obj.data : []);
251
+ const nextCursor = (obj.nextCursor || obj.next_cursor || null);
252
+ // Explicit hasMore from API
253
+ if (typeof obj.hasMore === 'boolean') {
254
+ return { data, hasMore: obj.hasMore, nextCursor, total: obj.total };
255
+ }
256
+ // Offset-based: infer hasMore from total/limit/offset
257
+ if (typeof obj.total === 'number' && typeof obj.limit === 'number' && typeof obj.offset === 'number') {
258
+ return {
259
+ data,
260
+ hasMore: obj.offset + obj.limit < obj.total,
261
+ nextCursor,
262
+ total: obj.total,
263
+ };
264
+ }
265
+ // Cursor-based: hasMore if cursor present
266
+ return { data, hasMore: !!nextCursor, nextCursor, total: obj.total };
267
+ }
268
+ sleep(ms) {
269
+ return new Promise((resolve) => setTimeout(resolve, ms));
270
+ }
271
+ }
272
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * AGLedger™ SDK v1.0.0
3
+ * Accountability and audit infrastructure for agentic systems.
4
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ export { AgledgerClient } from './client.js';
9
+ export type { AgledgerClientOptions, RequestOptions, ListParams, Page, AutoPaginateOptions, BatchResult, BulkCreateResult, ContractType, ContractSchema, SchemaValidationResult, Denomination, ProcurementCriteria, DeliverableCriteria, DataProcessingCriteria, TransactionCriteria, OrchestrationCriteria, CommunicationCriteria, AuthorizationCriteria, InfrastructureCriteria, DestructiveCriteria, ProcurementEvidence, DeliverableEvidence, DataProcessingEvidence, TransactionEvidence, OrchestrationEvidence, CommunicationEvidence, AuthorizationEvidence, InfrastructureEvidence, DestructiveEvidence, CriteriaMap, EvidenceMap, CriteriaFor, EvidenceFor, TypedCreateMandateParams, TypedSubmitReceiptParams, MandateStatus, MandateTransitionAction, OperatingMode, RiskClassification, Mandate, CreateMandateParams, UpdateMandateParams, ListMandatesParams, SearchMandatesParams, DelegateMandateParams, CreateAgentMandateParams, RespondToMandateParams, ReceiptStatus, Receipt, SubmitReceiptParams, UpdateReceiptParams, VerificationOutcome, SettlementSignal, VerificationResult, VerificationStatus, DisputeStatus, Dispute, CreateDisputeParams, ResolveDisputeParams, WebhookEventType, Webhook, CreateWebhookParams, UpdateWebhookParams, WebhookDelivery, WebhookTestResult, ReputationTier, ReputationScore, ReputationHistoryEntry, AgledgerEvent, AuditChain, RateLimitInfo, DashboardSummary, DashboardMetrics, DashboardMetricsParams, DashboardAgent, DashboardAgentParams, ComplianceExport, ExportComplianceParams, AiImpactAssessment, CreateAiImpactAssessmentParams, EuAiActReport, AccountType, AccountProfile, RegisterParams, RegisterResult, HealthResponse, StatusComponent, StatusResponse, ConformanceResponse, AdminEnterprise, AdminAgent, AdminApiKey, WebhookDlqEntry, SystemHealth, UpdateTrustLevelParams, SetCapabilitiesParams, AgentCard, JsonRpcRequest, JsonRpcResponse, ProxyMode, InterceptorAction, ConfidenceLevel, SidecarMandateStatus, SessionOutcome, ProxySession, CreateSessionParams, ToolCallBatchItem, SidecarMandateBatchItem, SidecarReceiptBatchItem, ToolCatalogBatchItem, SyncSessionParams, SyncSessionResult, ProxySidecarMandate, ProxySidecarReceipt, ProxyToolCall, ProxyToolCatalogEntry, UpdateSidecarMandateParams, SessionAnalytics, AnalyticsSummary, MandateSummary, AlignmentAnalysis, NotarizeStatus, NotarizedMandate, NotarizeTransition, NotarizeMandateParams, NotarizeMandateResult, NotarizeCounterProposeParams, NotarizeReceiptParams, NotarizeReceiptResult, NotarizeVerdictParams, NotarizeVerifyParams, NotarizeVerifyResult, NotarizeHistory, ApiErrorResponse, ValidationErrorDetail,
10
+ /** @deprecated Use `ListParams` */
11
+ PaginationParams,
12
+ /** @deprecated Use `Page<T>` */
13
+ PaginatedResponse,
14
+ /** @deprecated Use `Page<T>` */
15
+ CursorPaginatedResponse,
16
+ /** @deprecated Use `AgledgerEvent` */
17
+ AuditEvent, } from './types.js';
18
+ export { AgledgerError, AgledgerApiError, AuthenticationError, PermissionError, NotFoundError, ValidationError, UnprocessableError, RateLimitError, ConnectionError, TimeoutError, } from './errors.js';
19
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * AGLedger™ SDK v1.0.0
3
+ * Accountability and audit infrastructure for agentic systems.
4
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ // Client
9
+ export { AgledgerClient } from './client.js';
10
+ // Error classes
11
+ export { AgledgerError, AgledgerApiError, AuthenticationError, PermissionError, NotFoundError, ValidationError, UnprocessableError, RateLimitError, ConnectionError, TimeoutError, } from './errors.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * AGLedger™ SDK — A2A Protocol Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ *
5
+ * Agent-to-Agent protocol support (agent discovery + JSON-RPC 2.0).
6
+ */
7
+ import type { HttpClient } from '../http.js';
8
+ import type { AgentCard, JsonRpcRequest, JsonRpcResponse, RequestOptions } from '../types.js';
9
+ export declare class A2aResource {
10
+ private readonly http;
11
+ constructor(http: HttpClient);
12
+ /** Fetch the platform's AgentCard for A2A discovery. */
13
+ getAgentCard(options?: RequestOptions): Promise<AgentCard>;
14
+ /** Dispatch a JSON-RPC 2.0 request to the A2A endpoint. */
15
+ dispatch(request: JsonRpcRequest, options?: RequestOptions): Promise<JsonRpcResponse>;
16
+ /**
17
+ * Convenience: call a named A2A method with params.
18
+ * Auto-generates JSON-RPC envelope with id.
19
+ */
20
+ call(method: string, params?: Record<string, unknown>, options?: RequestOptions): Promise<JsonRpcResponse>;
21
+ }
22
+ //# sourceMappingURL=a2a.d.ts.map
@@ -0,0 +1,33 @@
1
+ /**
2
+ * AGLedger™ SDK — A2A Protocol Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ *
5
+ * Agent-to-Agent protocol support (agent discovery + JSON-RPC 2.0).
6
+ */
7
+ export class A2aResource {
8
+ http;
9
+ constructor(http) {
10
+ this.http = http;
11
+ }
12
+ /** Fetch the platform's AgentCard for A2A discovery. */
13
+ async getAgentCard(options) {
14
+ return this.http.get('/.well-known/agent-card.json', undefined, options);
15
+ }
16
+ /** Dispatch a JSON-RPC 2.0 request to the A2A endpoint. */
17
+ async dispatch(request, options) {
18
+ return this.http.post('/a2a', request, options);
19
+ }
20
+ /**
21
+ * Convenience: call a named A2A method with params.
22
+ * Auto-generates JSON-RPC envelope with id.
23
+ */
24
+ async call(method, params, options) {
25
+ return this.dispatch({
26
+ jsonrpc: '2.0',
27
+ method,
28
+ params,
29
+ id: crypto.randomUUID(),
30
+ }, options);
31
+ }
32
+ }
33
+ //# sourceMappingURL=a2a.js.map
@@ -0,0 +1,39 @@
1
+ /**
2
+ * AGLedger™ SDK — Admin Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ *
5
+ * Platform-only operations. Requires platform-level API key.
6
+ */
7
+ import type { HttpClient } from '../http.js';
8
+ import type { AdminEnterprise, AdminAgent, AdminApiKey, WebhookDlqEntry, SystemHealth, UpdateTrustLevelParams, SetCapabilitiesParams, Page, ListParams, RequestOptions, ContractType } from '../types.js';
9
+ export declare class AdminResource {
10
+ private readonly http;
11
+ constructor(http: HttpClient);
12
+ listEnterprises(params?: ListParams, options?: RequestOptions): Promise<Page<AdminEnterprise>>;
13
+ listAgents(params?: ListParams, options?: RequestOptions): Promise<Page<AdminAgent>>;
14
+ updateTrustLevel(accountId: string, params: UpdateTrustLevelParams, options?: RequestOptions): Promise<Record<string, unknown>>;
15
+ setCapabilities(agentId: string, params: SetCapabilitiesParams, options?: RequestOptions): Promise<Record<string, unknown>>;
16
+ getFleetCapabilities(options?: RequestOptions): Promise<Page<{
17
+ agentId: string;
18
+ capabilities: ContractType[];
19
+ }>>;
20
+ listApiKeys(params?: ListParams, options?: RequestOptions): Promise<Page<AdminApiKey>>;
21
+ createApiKey(params: {
22
+ ownerId: string;
23
+ ownerType: string;
24
+ }, options?: RequestOptions): Promise<{
25
+ apiKey: string;
26
+ keyId: string;
27
+ }>;
28
+ toggleApiKey(keyId: string, active: boolean, options?: RequestOptions): Promise<AdminApiKey>;
29
+ bulkRevokeApiKeys(keyIds: string[], options?: RequestOptions): Promise<{
30
+ revoked: number;
31
+ }>;
32
+ listDlq(params?: ListParams, options?: RequestOptions): Promise<Page<WebhookDlqEntry>>;
33
+ retryDlq(dlqId: string, options?: RequestOptions): Promise<Record<string, unknown>>;
34
+ retryAllDlq(options?: RequestOptions): Promise<{
35
+ retried: number;
36
+ }>;
37
+ getSystemHealth(options?: RequestOptions): Promise<SystemHealth>;
38
+ }
39
+ //# sourceMappingURL=admin.d.ts.map
@@ -0,0 +1,57 @@
1
+ /**
2
+ * AGLedger™ SDK — Admin Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ *
5
+ * Platform-only operations. Requires platform-level API key.
6
+ */
7
+ export class AdminResource {
8
+ http;
9
+ constructor(http) {
10
+ this.http = http;
11
+ }
12
+ // --- Enterprises ---
13
+ async listEnterprises(params, options) {
14
+ return this.http.getPage('/v1/admin/enterprises', params, options);
15
+ }
16
+ // --- Agents ---
17
+ async listAgents(params, options) {
18
+ return this.http.getPage('/v1/admin/agents', params, options);
19
+ }
20
+ async updateTrustLevel(accountId, params, options) {
21
+ return this.http.patch(`/v1/admin/accounts/${accountId}/trust-level`, params, options);
22
+ }
23
+ async setCapabilities(agentId, params, options) {
24
+ return this.http.patch(`/v1/admin/agents/${agentId}/capabilities`, params, options);
25
+ }
26
+ async getFleetCapabilities(options) {
27
+ return this.http.getPage('/v1/admin/agents/capabilities', undefined, options);
28
+ }
29
+ // --- API Keys ---
30
+ async listApiKeys(params, options) {
31
+ return this.http.getPage('/v1/admin/api-keys', params, options);
32
+ }
33
+ async createApiKey(params, options) {
34
+ return this.http.post('/v1/admin/api-keys', params, options);
35
+ }
36
+ async toggleApiKey(keyId, active, options) {
37
+ return this.http.patch(`/v1/admin/api-keys/${keyId}`, { active }, options);
38
+ }
39
+ async bulkRevokeApiKeys(keyIds, options) {
40
+ return this.http.post('/v1/admin/api-keys/bulk-revoke', { keyIds }, options);
41
+ }
42
+ // --- Webhook DLQ ---
43
+ async listDlq(params, options) {
44
+ return this.http.getPage('/v1/admin/webhook-dlq', params, options);
45
+ }
46
+ async retryDlq(dlqId, options) {
47
+ return this.http.post(`/v1/admin/webhook-dlq/${dlqId}/retry`, undefined, options);
48
+ }
49
+ async retryAllDlq(options) {
50
+ return this.http.post('/v1/admin/webhook-dlq/retry-all', undefined, options);
51
+ }
52
+ // --- System Health ---
53
+ async getSystemHealth(options) {
54
+ return this.http.get('/v1/admin/system-health', undefined, options);
55
+ }
56
+ }
57
+ //# sourceMappingURL=admin.js.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * AGLedger™ SDK — Capabilities Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ *
5
+ * Manage agent contract type capabilities.
6
+ */
7
+ import type { HttpClient } from '../http.js';
8
+ import type { ContractType, SetCapabilitiesParams, RequestOptions } from '../types.js';
9
+ export declare class CapabilitiesResource {
10
+ private readonly http;
11
+ constructor(http: HttpClient);
12
+ /** Get an agent's registered contract type capabilities. */
13
+ get(agentId: string, options?: RequestOptions): Promise<{
14
+ agentId: string;
15
+ capabilities: ContractType[];
16
+ }>;
17
+ /** Set the authenticated agent's own capabilities. */
18
+ set(agentId: string, params: SetCapabilitiesParams, options?: RequestOptions): Promise<{
19
+ agentId: string;
20
+ capabilities: ContractType[];
21
+ }>;
22
+ }
23
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1,21 @@
1
+ /**
2
+ * AGLedger™ SDK — Capabilities Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ *
5
+ * Manage agent contract type capabilities.
6
+ */
7
+ export class CapabilitiesResource {
8
+ http;
9
+ constructor(http) {
10
+ this.http = http;
11
+ }
12
+ /** Get an agent's registered contract type capabilities. */
13
+ async get(agentId, options) {
14
+ return this.http.get(`/v1/agents/${agentId}/capabilities`, undefined, options);
15
+ }
16
+ /** Set the authenticated agent's own capabilities. */
17
+ async set(agentId, params, options) {
18
+ return this.http.patch(`/v1/agents/${agentId}/capabilities`, params, options);
19
+ }
20
+ }
21
+ //# sourceMappingURL=capabilities.js.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * AGLedger™ SDK — Compliance & EU AI Act Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ import type { HttpClient } from '../http.js';
6
+ import type { ComplianceExport, ExportComplianceParams, AiImpactAssessment, CreateAiImpactAssessmentParams, EuAiActReport, RequestOptions } from '../types.js';
7
+ export declare class ComplianceResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ export(params: ExportComplianceParams, options?: RequestOptions): Promise<ComplianceExport>;
11
+ getExportStatus(exportId: string, options?: RequestOptions): Promise<ComplianceExport>;
12
+ /**
13
+ * Poll until a compliance export is ready or timeout.
14
+ * Returns the completed export, or throws if it times out.
15
+ */
16
+ waitForExport(exportId: string, opts?: {
17
+ pollIntervalMs?: number;
18
+ timeoutMs?: number;
19
+ signal?: AbortSignal;
20
+ }): Promise<ComplianceExport>;
21
+ createAssessment(mandateId: string, params: CreateAiImpactAssessmentParams, options?: RequestOptions): Promise<AiImpactAssessment>;
22
+ getAssessment(mandateId: string, options?: RequestOptions): Promise<AiImpactAssessment>;
23
+ getEuAiActReport(params?: {
24
+ from?: string;
25
+ to?: string;
26
+ }, options?: RequestOptions): Promise<EuAiActReport>;
27
+ getEnterpriseReport(params?: {
28
+ from?: string;
29
+ to?: string;
30
+ format?: string;
31
+ }, options?: RequestOptions): Promise<Record<string, unknown>>;
32
+ analyzeAudit(mandateId: string, options?: RequestOptions): Promise<Record<string, unknown>>;
33
+ }
34
+ //# sourceMappingURL=compliance.d.ts.map
@@ -0,0 +1,54 @@
1
+ /**
2
+ * AGLedger™ SDK — Compliance & EU AI Act Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ export class ComplianceResource {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ // --- Compliance Export ---
11
+ async export(params, options) {
12
+ return this.http.post('/v1/compliance/export', params, options);
13
+ }
14
+ async getExportStatus(exportId, options) {
15
+ return this.http.get(`/v1/compliance/export/${exportId}`, undefined, options);
16
+ }
17
+ /**
18
+ * Poll until a compliance export is ready or timeout.
19
+ * Returns the completed export, or throws if it times out.
20
+ */
21
+ async waitForExport(exportId, opts) {
22
+ const interval = opts?.pollIntervalMs ?? 2_000;
23
+ const timeout = opts?.timeoutMs ?? 120_000;
24
+ const deadline = Date.now() + timeout;
25
+ while (Date.now() < deadline) {
26
+ if (opts?.signal?.aborted) {
27
+ throw new Error('Export wait cancelled');
28
+ }
29
+ const result = await this.getExportStatus(exportId);
30
+ if (result.status === 'ready')
31
+ return result;
32
+ await new Promise((r) => setTimeout(r, interval));
33
+ }
34
+ throw new Error(`Export ${exportId} did not complete within ${timeout}ms`);
35
+ }
36
+ // --- EU AI Act ---
37
+ async createAssessment(mandateId, params, options) {
38
+ return this.http.post(`/v1/mandates/${mandateId}/ai-impact-assessment`, params, options);
39
+ }
40
+ async getAssessment(mandateId, options) {
41
+ return this.http.get(`/v1/mandates/${mandateId}/ai-impact-assessment`, undefined, options);
42
+ }
43
+ async getEuAiActReport(params, options) {
44
+ return this.http.get('/v1/compliance/eu-ai-act/report', params, options);
45
+ }
46
+ // --- Audit Reports ---
47
+ async getEnterpriseReport(params, options) {
48
+ return this.http.get('/v1/audit/enterprise-report', params, options);
49
+ }
50
+ async analyzeAudit(mandateId, options) {
51
+ return this.http.post('/v1/audit/enterprise-report/analyze', { mandateId }, options);
52
+ }
53
+ }
54
+ //# sourceMappingURL=compliance.js.map
@@ -0,0 +1,14 @@
1
+ /**
2
+ * AGLedger™ SDK — Dashboard Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ import type { HttpClient } from '../http.js';
6
+ import type { DashboardSummary, DashboardMetrics, DashboardMetricsParams, DashboardAgent, DashboardAgentParams, Page, RequestOptions } from '../types.js';
7
+ export declare class DashboardResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ getSummary(options?: RequestOptions): Promise<DashboardSummary>;
11
+ getMetrics(params?: DashboardMetricsParams, options?: RequestOptions): Promise<DashboardMetrics>;
12
+ listAgents(params?: DashboardAgentParams, options?: RequestOptions): Promise<Page<DashboardAgent>>;
13
+ }
14
+ //# sourceMappingURL=dashboard.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * AGLedger™ SDK — Dashboard Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ export class DashboardResource {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ async getSummary(options) {
11
+ return this.http.get('/v1/dashboard/summary', undefined, options);
12
+ }
13
+ async getMetrics(params, options) {
14
+ return this.http.get('/v1/dashboard/metrics', params, options);
15
+ }
16
+ async listAgents(params, options) {
17
+ return this.http.getPage('/v1/dashboard/agents', params, options);
18
+ }
19
+ }
20
+ //# sourceMappingURL=dashboard.js.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * AGLedger™ SDK — Disputes Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ import type { HttpClient } from '../http.js';
6
+ import type { Dispute, CreateDisputeParams, ResolveDisputeParams, RequestOptions } from '../types.js';
7
+ export declare class DisputesResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ create(mandateId: string, params: CreateDisputeParams, options?: RequestOptions): Promise<Dispute>;
11
+ get(mandateId: string, options?: RequestOptions): Promise<Dispute>;
12
+ escalate(mandateId: string, reason: string, options?: RequestOptions): Promise<Dispute>;
13
+ submitEvidence(mandateId: string, evidence: Record<string, unknown>, options?: RequestOptions): Promise<Dispute>;
14
+ resolve(mandateId: string, params: ResolveDisputeParams, options?: RequestOptions): Promise<Dispute>;
15
+ }
16
+ //# sourceMappingURL=disputes.d.ts.map