@agledger/sdk 1.1.0 → 2.0.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/dist/client.d.ts +2 -0
- package/dist/client.js +3 -0
- package/dist/errors.d.ts +14 -0
- package/dist/errors.js +26 -0
- package/dist/http.d.ts +2 -1
- package/dist/http.js +7 -3
- package/dist/index.d.ts +5 -1
- package/dist/index.js +6 -0
- package/dist/mandate-lifecycle.d.ts +23 -0
- package/dist/mandate-lifecycle.js +54 -0
- package/dist/prompt-context.d.ts +16 -0
- package/dist/prompt-context.js +47 -0
- package/dist/resources/admin.d.ts +15 -8
- package/dist/resources/admin.js +13 -5
- package/dist/resources/compliance.d.ts +7 -0
- package/dist/resources/compliance.js +7 -3
- package/dist/resources/dashboard.d.ts +3 -0
- package/dist/resources/dashboard.js +3 -0
- package/dist/resources/disputes.d.ts +5 -0
- package/dist/resources/disputes.js +5 -0
- package/dist/resources/enterprises.d.ts +27 -0
- package/dist/resources/enterprises.js +43 -0
- package/dist/resources/events.d.ts +6 -1
- package/dist/resources/events.js +4 -0
- package/dist/resources/health.d.ts +2 -0
- package/dist/resources/health.js +2 -0
- package/dist/resources/mandates.d.ts +13 -0
- package/dist/resources/mandates.js +25 -3
- package/dist/resources/notarize.d.ts +8 -0
- package/dist/resources/notarize.js +8 -8
- package/dist/resources/proxy.d.ts +20 -4
- package/dist/resources/proxy.js +20 -4
- package/dist/resources/reputation.d.ts +2 -0
- package/dist/resources/reputation.js +2 -0
- package/dist/resources/schemas.d.ts +3 -0
- package/dist/resources/schemas.js +3 -0
- package/dist/resources/verification.d.ts +2 -0
- package/dist/resources/verification.js +2 -0
- package/dist/resources/webhooks.d.ts +6 -0
- package/dist/resources/webhooks.js +7 -1
- package/dist/scopes.d.ts +41 -0
- package/dist/scopes.js +67 -0
- package/dist/types.d.ts +186 -3
- package/dist/webhooks/verify.d.ts +33 -0
- package/dist/webhooks/verify.js +32 -0
- package/package.json +5 -3
package/dist/client.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { AdminResource } from './resources/admin.js';
|
|
|
20
20
|
import { A2aResource } from './resources/a2a.js';
|
|
21
21
|
import { CapabilitiesResource } from './resources/capabilities.js';
|
|
22
22
|
import { NotarizeResource } from './resources/notarize.js';
|
|
23
|
+
import { EnterprisesResource } from './resources/enterprises.js';
|
|
23
24
|
export declare class AgledgerClient {
|
|
24
25
|
private readonly http;
|
|
25
26
|
readonly mandates: MandatesResource;
|
|
@@ -39,6 +40,7 @@ export declare class AgledgerClient {
|
|
|
39
40
|
readonly a2a: A2aResource;
|
|
40
41
|
readonly capabilities: CapabilitiesResource;
|
|
41
42
|
readonly notarize: NotarizeResource;
|
|
43
|
+
readonly enterprises: EnterprisesResource;
|
|
42
44
|
/** Rate limit info from the most recent API response. Null if headers not present. */
|
|
43
45
|
get rateLimitInfo(): RateLimitInfo | null;
|
|
44
46
|
constructor(options: AgledgerClientOptions);
|
package/dist/client.js
CHANGED
|
@@ -20,6 +20,7 @@ import { AdminResource } from './resources/admin.js';
|
|
|
20
20
|
import { A2aResource } from './resources/a2a.js';
|
|
21
21
|
import { CapabilitiesResource } from './resources/capabilities.js';
|
|
22
22
|
import { NotarizeResource } from './resources/notarize.js';
|
|
23
|
+
import { EnterprisesResource } from './resources/enterprises.js';
|
|
23
24
|
export class AgledgerClient {
|
|
24
25
|
http;
|
|
25
26
|
mandates;
|
|
@@ -39,6 +40,7 @@ export class AgledgerClient {
|
|
|
39
40
|
a2a;
|
|
40
41
|
capabilities;
|
|
41
42
|
notarize;
|
|
43
|
+
enterprises;
|
|
42
44
|
/** Rate limit info from the most recent API response. Null if headers not present. */
|
|
43
45
|
get rateLimitInfo() {
|
|
44
46
|
return this.http.rateLimitInfo;
|
|
@@ -63,6 +65,7 @@ export class AgledgerClient {
|
|
|
63
65
|
this.a2a = new A2aResource(http);
|
|
64
66
|
this.capabilities = new CapabilitiesResource(http);
|
|
65
67
|
this.notarize = new NotarizeResource(http);
|
|
68
|
+
this.enterprises = new EnterprisesResource(http);
|
|
66
69
|
}
|
|
67
70
|
}
|
|
68
71
|
//# sourceMappingURL=client.js.map
|
package/dist/errors.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export declare class AgledgerApiError extends AgledgerError {
|
|
|
25
25
|
readonly code: string;
|
|
26
26
|
readonly requestId?: string;
|
|
27
27
|
readonly details?: ValidationErrorDetail[] | Record<string, unknown>;
|
|
28
|
+
/** Link to documentation for this error code. */
|
|
29
|
+
readonly docUrl: string;
|
|
28
30
|
/**
|
|
29
31
|
* Whether this error is retryable.
|
|
30
32
|
* - Uses the API's `retryable` field if present
|
|
@@ -32,6 +34,14 @@ export declare class AgledgerApiError extends AgledgerError {
|
|
|
32
34
|
*/
|
|
33
35
|
readonly retryable: boolean;
|
|
34
36
|
constructor(status: number, body: ApiErrorResponse);
|
|
37
|
+
/** Whether this error is retryable (429, 5xx, network errors). Delegates to the `retryable` property. */
|
|
38
|
+
isRetryable(): boolean;
|
|
39
|
+
/** Whether this is an input error (400) — the request itself is malformed; fix it and retry. */
|
|
40
|
+
isInputError(): boolean;
|
|
41
|
+
/** Whether this is a state error (422) — the resource is in the wrong state; do not retry the same request. */
|
|
42
|
+
isStateError(): boolean;
|
|
43
|
+
/** Whether this is an auth error (401/403) — check credentials or scopes. */
|
|
44
|
+
isAuthError(): boolean;
|
|
35
45
|
/** Field-level validation errors, normalized from various API formats. */
|
|
36
46
|
get validationErrors(): ValidationErrorDetail[];
|
|
37
47
|
}
|
|
@@ -39,6 +49,10 @@ export declare class AuthenticationError extends AgledgerApiError {
|
|
|
39
49
|
constructor(body: ApiErrorResponse);
|
|
40
50
|
}
|
|
41
51
|
export declare class PermissionError extends AgledgerApiError {
|
|
52
|
+
/** Scopes required by the endpoint but missing from the key. Empty if not a scope error. */
|
|
53
|
+
readonly missingScopes: string[];
|
|
54
|
+
/** Scopes the key has. Null if not included in the response. */
|
|
55
|
+
readonly keyScopes: string[] | null;
|
|
42
56
|
constructor(body: ApiErrorResponse);
|
|
43
57
|
}
|
|
44
58
|
export declare class NotFoundError extends AgledgerApiError {
|
package/dist/errors.js
CHANGED
|
@@ -27,6 +27,8 @@ export class AgledgerApiError extends AgledgerError {
|
|
|
27
27
|
code;
|
|
28
28
|
requestId;
|
|
29
29
|
details;
|
|
30
|
+
/** Link to documentation for this error code. */
|
|
31
|
+
docUrl;
|
|
30
32
|
/**
|
|
31
33
|
* Whether this error is retryable.
|
|
32
34
|
* - Uses the API's `retryable` field if present
|
|
@@ -41,6 +43,23 @@ export class AgledgerApiError extends AgledgerError {
|
|
|
41
43
|
this.requestId = body.requestId;
|
|
42
44
|
this.details = body.details;
|
|
43
45
|
this.retryable = body.retryable ?? (status === 429 || status >= 500);
|
|
46
|
+
this.docUrl = `https://docs.agledger.ai/errors/${this.code}`;
|
|
47
|
+
}
|
|
48
|
+
/** Whether this error is retryable (429, 5xx, network errors). Delegates to the `retryable` property. */
|
|
49
|
+
isRetryable() {
|
|
50
|
+
return this.retryable;
|
|
51
|
+
}
|
|
52
|
+
/** Whether this is an input error (400) — the request itself is malformed; fix it and retry. */
|
|
53
|
+
isInputError() {
|
|
54
|
+
return this.status === 400;
|
|
55
|
+
}
|
|
56
|
+
/** Whether this is a state error (422) — the resource is in the wrong state; do not retry the same request. */
|
|
57
|
+
isStateError() {
|
|
58
|
+
return this.status === 422;
|
|
59
|
+
}
|
|
60
|
+
/** Whether this is an auth error (401/403) — check credentials or scopes. */
|
|
61
|
+
isAuthError() {
|
|
62
|
+
return this.status === 401 || this.status === 403;
|
|
44
63
|
}
|
|
45
64
|
/** Field-level validation errors, normalized from various API formats. */
|
|
46
65
|
get validationErrors() {
|
|
@@ -66,9 +85,16 @@ export class AuthenticationError extends AgledgerApiError {
|
|
|
66
85
|
}
|
|
67
86
|
}
|
|
68
87
|
export class PermissionError extends AgledgerApiError {
|
|
88
|
+
/** Scopes required by the endpoint but missing from the key. Empty if not a scope error. */
|
|
89
|
+
missingScopes;
|
|
90
|
+
/** Scopes the key has. Null if not included in the response. */
|
|
91
|
+
keyScopes;
|
|
69
92
|
constructor(body) {
|
|
70
93
|
super(403, body);
|
|
71
94
|
this.name = 'PermissionError';
|
|
95
|
+
const details = body.details;
|
|
96
|
+
this.missingScopes = Array.isArray(details?.missingScopes) ? details.missingScopes : [];
|
|
97
|
+
this.keyScopes = Array.isArray(details?.keyScopes) ? details.keyScopes : null;
|
|
72
98
|
}
|
|
73
99
|
}
|
|
74
100
|
export class NotFoundError extends AgledgerApiError {
|
package/dist/http.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ export declare class HttpClient {
|
|
|
18
18
|
constructor(options: AgledgerClientOptions);
|
|
19
19
|
get<T>(path: string, params?: Record<string, unknown>, options?: RequestOptions): Promise<T>;
|
|
20
20
|
post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
21
|
+
put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
21
22
|
patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
22
|
-
delete<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
23
|
+
delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
23
24
|
/**
|
|
24
25
|
* Fetch a list endpoint and normalize the response into Page<T>.
|
|
25
26
|
* Handles both current inconsistent responses (bare arrays, various envelope shapes)
|
package/dist/http.js
CHANGED
|
@@ -42,13 +42,17 @@ export class HttpClient {
|
|
|
42
42
|
const url = this.buildUrl(path);
|
|
43
43
|
return this.request('POST', url, body, options);
|
|
44
44
|
}
|
|
45
|
+
async put(path, body, options) {
|
|
46
|
+
const url = this.buildUrl(path);
|
|
47
|
+
return this.request('PUT', url, body, options);
|
|
48
|
+
}
|
|
45
49
|
async patch(path, body, options) {
|
|
46
50
|
const url = this.buildUrl(path);
|
|
47
51
|
return this.request('PATCH', url, body, options);
|
|
48
52
|
}
|
|
49
|
-
async delete(path, options) {
|
|
53
|
+
async delete(path, body, options) {
|
|
50
54
|
const url = this.buildUrl(path);
|
|
51
|
-
return this.request('DELETE', url,
|
|
55
|
+
return this.request('DELETE', url, body, options);
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
54
58
|
* Fetch a list endpoint and normalize the response into Page<T>.
|
|
@@ -101,7 +105,7 @@ export class HttpClient {
|
|
|
101
105
|
}
|
|
102
106
|
async request(method, url, body, options) {
|
|
103
107
|
// Idempotency keys for all mutating methods
|
|
104
|
-
const needsIdempotencyKey = method === 'POST' || method === 'PATCH' || method === 'DELETE';
|
|
108
|
+
const needsIdempotencyKey = method === 'POST' || method === 'PUT' || method === 'PATCH' || method === 'DELETE';
|
|
105
109
|
const idempotencyKey = options?.idempotencyKey ??
|
|
106
110
|
(needsIdempotencyKey
|
|
107
111
|
? `${this.idempotencyKeyPrefix}${crypto.randomUUID()}`
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
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,
|
|
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, VerificationMode, 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, CreateApiKeyParams, CreateApiKeyResult, 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, EnterpriseAgentStatus, EnterpriseAgentRecord, ApprovalConfig, ApproveAgentParams, RevokeAgentParams, UpdateAgentStatusParams, BulkApproveAgentParams, BulkApproveResult, ListEnterpriseAgentsParams, ApiErrorResponse, ValidationErrorDetail,
|
|
10
10
|
/** @deprecated Use `ListParams` */
|
|
11
11
|
PaginationParams,
|
|
12
12
|
/** @deprecated Use `Page<T>` */
|
|
@@ -16,4 +16,8 @@ CursorPaginatedResponse,
|
|
|
16
16
|
/** @deprecated Use `AgledgerEvent` */
|
|
17
17
|
AuditEvent, } from './types.js';
|
|
18
18
|
export { AgledgerError, AgledgerApiError, AuthenticationError, PermissionError, NotFoundError, ValidationError, UnprocessableError, RateLimitError, ConnectionError, TimeoutError, } from './errors.js';
|
|
19
|
+
export { Scopes, ScopeProfiles } from './scopes.js';
|
|
20
|
+
export type { Scope, ScopeProfile, ScopeProfileName } from './scopes.js';
|
|
21
|
+
export { MANDATE_TRANSITIONS, TERMINAL_STATUSES, canTransitionTo, getValidTransitions, isTerminalStatus, } from './mandate-lifecycle.js';
|
|
22
|
+
export { mandateToContext, receiptToContext, errorToContext } from './prompt-context.js';
|
|
19
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -9,4 +9,10 @@
|
|
|
9
9
|
export { AgledgerClient } from './client.js';
|
|
10
10
|
// Error classes
|
|
11
11
|
export { AgledgerError, AgledgerApiError, AuthenticationError, PermissionError, NotFoundError, ValidationError, UnprocessableError, RateLimitError, ConnectionError, TimeoutError, } from './errors.js';
|
|
12
|
+
// Scopes
|
|
13
|
+
export { Scopes, ScopeProfiles } from './scopes.js';
|
|
14
|
+
// Mandate State Machine
|
|
15
|
+
export { MANDATE_TRANSITIONS, TERMINAL_STATUSES, canTransitionTo, getValidTransitions, isTerminalStatus, } from './mandate-lifecycle.js';
|
|
16
|
+
// Prompt Context Builders
|
|
17
|
+
export { mandateToContext, receiptToContext, errorToContext } from './prompt-context.js';
|
|
12
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Mandate State Machine
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Pure logic, zero dependencies. Mirrors the API's state machine.
|
|
6
|
+
*/
|
|
7
|
+
import type { MandateStatus } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Valid state transitions for mandates. Each key is a status, and its value
|
|
10
|
+
* is the list of statuses it can transition to.
|
|
11
|
+
*
|
|
12
|
+
* Unknown statuses return empty arrays for forward compatibility.
|
|
13
|
+
*/
|
|
14
|
+
export declare const MANDATE_TRANSITIONS: Record<string, readonly string[]>;
|
|
15
|
+
/** Statuses with no outbound transitions. */
|
|
16
|
+
export declare const TERMINAL_STATUSES: readonly string[];
|
|
17
|
+
/** Check whether a transition from `current` to `target` is valid. Unknown statuses return false. */
|
|
18
|
+
export declare function canTransitionTo(current: MandateStatus, target: MandateStatus): boolean;
|
|
19
|
+
/** Get valid next statuses for a given status. Unknown statuses return []. */
|
|
20
|
+
export declare function getValidTransitions(status: MandateStatus): readonly string[];
|
|
21
|
+
/** Check whether a status is terminal (no outbound transitions). Unknown statuses return false. */
|
|
22
|
+
export declare function isTerminalStatus(status: MandateStatus): boolean;
|
|
23
|
+
//# sourceMappingURL=mandate-lifecycle.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Mandate State Machine
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Pure logic, zero dependencies. Mirrors the API's state machine.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Valid state transitions for mandates. Each key is a status, and its value
|
|
9
|
+
* is the list of statuses it can transition to.
|
|
10
|
+
*
|
|
11
|
+
* Unknown statuses return empty arrays for forward compatibility.
|
|
12
|
+
*/
|
|
13
|
+
export const MANDATE_TRANSITIONS = {
|
|
14
|
+
DRAFT: ['REGISTERED', 'PROPOSED', 'CANCELLED_DRAFT'],
|
|
15
|
+
PROPOSED: ['REGISTERED', 'REJECTED', 'CANCELLED_DRAFT', 'PROPOSED'],
|
|
16
|
+
REGISTERED: ['ACTIVE', 'CANCELLED_PRE_WORK'],
|
|
17
|
+
ACTIVE: ['RECEIPT_ACCEPTED', 'RECEIPT_INVALID', 'EXPIRED', 'CANCELLED_PRE_WORK', 'CANCELLED_IN_PROGRESS'],
|
|
18
|
+
RECEIPT_INVALID: ['RECEIPT_ACCEPTED', 'RECEIPT_INVALID', 'EXPIRED', 'CANCELLED_IN_PROGRESS'],
|
|
19
|
+
RECEIPT_ACCEPTED: ['VERIFYING'],
|
|
20
|
+
VERIFYING: ['VERIFIED_PASS', 'VERIFIED_FAIL'],
|
|
21
|
+
VERIFIED_PASS: ['FULFILLED', 'VERIFIED_FAIL'],
|
|
22
|
+
VERIFIED_FAIL: ['REMEDIATED', 'VERIFIED_PASS', 'REVISION_REQUESTED'],
|
|
23
|
+
REVISION_REQUESTED: ['RECEIPT_ACCEPTED', 'RECEIPT_INVALID', 'EXPIRED', 'CANCELLED_IN_PROGRESS'],
|
|
24
|
+
FULFILLED: [],
|
|
25
|
+
REMEDIATED: [],
|
|
26
|
+
EXPIRED: [],
|
|
27
|
+
CANCELLED_DRAFT: [],
|
|
28
|
+
CANCELLED_PRE_WORK: [],
|
|
29
|
+
CANCELLED_IN_PROGRESS: [],
|
|
30
|
+
REJECTED: [],
|
|
31
|
+
};
|
|
32
|
+
/** Statuses with no outbound transitions. */
|
|
33
|
+
export const TERMINAL_STATUSES = Object.entries(MANDATE_TRANSITIONS)
|
|
34
|
+
.filter(([, targets]) => targets.length === 0)
|
|
35
|
+
.map(([status]) => status);
|
|
36
|
+
/** Check whether a transition from `current` to `target` is valid. Unknown statuses return false. */
|
|
37
|
+
export function canTransitionTo(current, target) {
|
|
38
|
+
const targets = MANDATE_TRANSITIONS[current];
|
|
39
|
+
if (!targets)
|
|
40
|
+
return false;
|
|
41
|
+
return targets.includes(target);
|
|
42
|
+
}
|
|
43
|
+
/** Get valid next statuses for a given status. Unknown statuses return []. */
|
|
44
|
+
export function getValidTransitions(status) {
|
|
45
|
+
return MANDATE_TRANSITIONS[status] ?? [];
|
|
46
|
+
}
|
|
47
|
+
/** Check whether a status is terminal (no outbound transitions). Unknown statuses return false. */
|
|
48
|
+
export function isTerminalStatus(status) {
|
|
49
|
+
const targets = MANDATE_TRANSITIONS[status];
|
|
50
|
+
if (!targets)
|
|
51
|
+
return false;
|
|
52
|
+
return targets.length === 0;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=mandate-lifecycle.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Prompt Context Builders
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* LLM-friendly compact summaries for mandates, receipts, and errors.
|
|
6
|
+
* Zero dependencies beyond types.
|
|
7
|
+
*/
|
|
8
|
+
import type { Mandate, Receipt } from './types.js';
|
|
9
|
+
import type { AgledgerApiError } from './errors.js';
|
|
10
|
+
/** Compact one-line summary of a mandate for LLM context injection. */
|
|
11
|
+
export declare function mandateToContext(m: Mandate): string;
|
|
12
|
+
/** Compact one-line summary of a receipt for LLM context injection. */
|
|
13
|
+
export declare function receiptToContext(r: Receipt): string;
|
|
14
|
+
/** Compact error summary with actionable guidance for LLM agents. */
|
|
15
|
+
export declare function errorToContext(e: AgledgerApiError): string;
|
|
16
|
+
//# sourceMappingURL=prompt-context.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Prompt Context Builders
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* LLM-friendly compact summaries for mandates, receipts, and errors.
|
|
6
|
+
* Zero dependencies beyond types.
|
|
7
|
+
*/
|
|
8
|
+
import { RateLimitError } from './errors.js';
|
|
9
|
+
/** Compact one-line summary of a mandate for LLM context injection. */
|
|
10
|
+
export function mandateToContext(m) {
|
|
11
|
+
const parts = [`Mandate ${m.id} [${m.contractType}] status=${m.status}`];
|
|
12
|
+
if (m.agentId)
|
|
13
|
+
parts.push(`agent=${m.agentId}`);
|
|
14
|
+
if (m.deadline)
|
|
15
|
+
parts.push(`deadline=${m.deadline}`);
|
|
16
|
+
if (m.parentMandateId)
|
|
17
|
+
parts.push(`parent=${m.parentMandateId}`);
|
|
18
|
+
return parts.join(' ');
|
|
19
|
+
}
|
|
20
|
+
/** Compact one-line summary of a receipt for LLM context injection. */
|
|
21
|
+
export function receiptToContext(r) {
|
|
22
|
+
const parts = [`Receipt ${r.id} for mandate ${r.mandateId} status=${r.status}`];
|
|
23
|
+
if (r.verificationOutcome)
|
|
24
|
+
parts.push(`outcome=${r.verificationOutcome}`);
|
|
25
|
+
if (r.agentId)
|
|
26
|
+
parts.push(`agent=${r.agentId}`);
|
|
27
|
+
return parts.join(' ');
|
|
28
|
+
}
|
|
29
|
+
/** Compact error summary with actionable guidance for LLM agents. */
|
|
30
|
+
export function errorToContext(e) {
|
|
31
|
+
const code = e.code !== 'unknown' ? ` [${e.code}]` : '';
|
|
32
|
+
const base = `Error ${e.status}${code}: ${e.message}`;
|
|
33
|
+
if (e.isRetryable()) {
|
|
34
|
+
if (e instanceof RateLimitError && e.retryAfter != null) {
|
|
35
|
+
return base + ` Retry after ${e.retryAfter}s.`;
|
|
36
|
+
}
|
|
37
|
+
return base + ' Retryable.';
|
|
38
|
+
}
|
|
39
|
+
if (e.isStateError())
|
|
40
|
+
return base + ' Do not retry.';
|
|
41
|
+
if (e.isAuthError())
|
|
42
|
+
return base + ' Check credentials/scopes.';
|
|
43
|
+
if (e.isInputError())
|
|
44
|
+
return base + ' Fix the request and retry.';
|
|
45
|
+
return base;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=prompt-context.js.map
|
|
@@ -5,35 +5,42 @@
|
|
|
5
5
|
* Platform-only operations. Requires platform-level API key.
|
|
6
6
|
*/
|
|
7
7
|
import type { HttpClient } from '../http.js';
|
|
8
|
-
import type { AdminEnterprise, AdminAgent, AdminApiKey, WebhookDlqEntry, SystemHealth, UpdateTrustLevelParams, SetCapabilitiesParams, Page, ListParams, RequestOptions, ContractType } from '../types.js';
|
|
8
|
+
import type { AdminEnterprise, AdminAgent, AdminApiKey, WebhookDlqEntry, SystemHealth, UpdateTrustLevelParams, SetCapabilitiesParams, Page, ListParams, RequestOptions, ContractType, CreateApiKeyParams, CreateApiKeyResult } from '../types.js';
|
|
9
9
|
export declare class AdminResource {
|
|
10
10
|
private readonly http;
|
|
11
11
|
constructor(http: HttpClient);
|
|
12
|
+
/** List all enterprises on the platform. */
|
|
12
13
|
listEnterprises(params?: ListParams, options?: RequestOptions): Promise<Page<AdminEnterprise>>;
|
|
14
|
+
/** List all registered agents on the platform. */
|
|
13
15
|
listAgents(params?: ListParams, options?: RequestOptions): Promise<Page<AdminAgent>>;
|
|
16
|
+
/** Update an account's trust level (sandbox, active, verified). */
|
|
14
17
|
updateTrustLevel(accountId: string, params: UpdateTrustLevelParams, options?: RequestOptions): Promise<Record<string, unknown>>;
|
|
18
|
+
/** Set an agent's contract type capabilities. */
|
|
15
19
|
setCapabilities(agentId: string, params: SetCapabilitiesParams, options?: RequestOptions): Promise<Record<string, unknown>>;
|
|
20
|
+
/** Get capabilities of all agents in the fleet. */
|
|
16
21
|
getFleetCapabilities(options?: RequestOptions): Promise<Page<{
|
|
17
22
|
agentId: string;
|
|
18
23
|
capabilities: ContractType[];
|
|
19
24
|
}>>;
|
|
25
|
+
/** List all API keys on the platform. */
|
|
20
26
|
listApiKeys(params?: ListParams, options?: RequestOptions): Promise<Page<AdminApiKey>>;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, options?: RequestOptions): Promise<{
|
|
25
|
-
apiKey: string;
|
|
26
|
-
keyId: string;
|
|
27
|
-
}>;
|
|
27
|
+
/** Create a new API key with optional scopes or scope profile. */
|
|
28
|
+
createApiKey(params: CreateApiKeyParams, options?: RequestOptions): Promise<CreateApiKeyResult>;
|
|
29
|
+
/** Enable or disable an API key. */
|
|
28
30
|
toggleApiKey(keyId: string, active: boolean, options?: RequestOptions): Promise<AdminApiKey>;
|
|
31
|
+
/** Revoke multiple API keys at once. */
|
|
29
32
|
bulkRevokeApiKeys(keyIds: string[], options?: RequestOptions): Promise<{
|
|
30
33
|
revoked: number;
|
|
31
34
|
}>;
|
|
35
|
+
/** List webhook dead-letter queue entries. */
|
|
32
36
|
listDlq(params?: ListParams, options?: RequestOptions): Promise<Page<WebhookDlqEntry>>;
|
|
37
|
+
/** Retry a single dead-letter queue entry. */
|
|
33
38
|
retryDlq(dlqId: string, options?: RequestOptions): Promise<Record<string, unknown>>;
|
|
39
|
+
/** Retry all dead-letter queue entries. */
|
|
34
40
|
retryAllDlq(options?: RequestOptions): Promise<{
|
|
35
41
|
retried: number;
|
|
36
42
|
}>;
|
|
43
|
+
/** Get system health metrics (platform admin). */
|
|
37
44
|
getSystemHealth(options?: RequestOptions): Promise<SystemHealth>;
|
|
38
45
|
}
|
|
39
46
|
//# sourceMappingURL=admin.d.ts.map
|
package/dist/resources/admin.js
CHANGED
|
@@ -9,47 +9,55 @@ export class AdminResource {
|
|
|
9
9
|
constructor(http) {
|
|
10
10
|
this.http = http;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
/** List all enterprises on the platform. */
|
|
13
13
|
async listEnterprises(params, options) {
|
|
14
14
|
return this.http.getPage('/v1/admin/enterprises', params, options);
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
/** List all registered agents on the platform. */
|
|
17
17
|
async listAgents(params, options) {
|
|
18
18
|
return this.http.getPage('/v1/admin/agents', params, options);
|
|
19
19
|
}
|
|
20
|
+
/** Update an account's trust level (sandbox, active, verified). */
|
|
20
21
|
async updateTrustLevel(accountId, params, options) {
|
|
21
22
|
return this.http.patch(`/v1/admin/accounts/${accountId}/trust-level`, params, options);
|
|
22
23
|
}
|
|
24
|
+
/** Set an agent's contract type capabilities. */
|
|
23
25
|
async setCapabilities(agentId, params, options) {
|
|
24
26
|
return this.http.patch(`/v1/admin/agents/${agentId}/capabilities`, params, options);
|
|
25
27
|
}
|
|
28
|
+
/** Get capabilities of all agents in the fleet. */
|
|
26
29
|
async getFleetCapabilities(options) {
|
|
27
30
|
return this.http.getPage('/v1/admin/agents/capabilities', undefined, options);
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
/** List all API keys on the platform. */
|
|
30
33
|
async listApiKeys(params, options) {
|
|
31
34
|
return this.http.getPage('/v1/admin/api-keys', params, options);
|
|
32
35
|
}
|
|
36
|
+
/** Create a new API key with optional scopes or scope profile. */
|
|
33
37
|
async createApiKey(params, options) {
|
|
34
38
|
return this.http.post('/v1/admin/api-keys', params, options);
|
|
35
39
|
}
|
|
40
|
+
/** Enable or disable an API key. */
|
|
36
41
|
async toggleApiKey(keyId, active, options) {
|
|
37
42
|
return this.http.patch(`/v1/admin/api-keys/${keyId}`, { active }, options);
|
|
38
43
|
}
|
|
44
|
+
/** Revoke multiple API keys at once. */
|
|
39
45
|
async bulkRevokeApiKeys(keyIds, options) {
|
|
40
46
|
return this.http.post('/v1/admin/api-keys/bulk-revoke', { keyIds }, options);
|
|
41
47
|
}
|
|
42
|
-
|
|
48
|
+
/** List webhook dead-letter queue entries. */
|
|
43
49
|
async listDlq(params, options) {
|
|
44
50
|
return this.http.getPage('/v1/admin/webhook-dlq', params, options);
|
|
45
51
|
}
|
|
52
|
+
/** Retry a single dead-letter queue entry. */
|
|
46
53
|
async retryDlq(dlqId, options) {
|
|
47
54
|
return this.http.post(`/v1/admin/webhook-dlq/${dlqId}/retry`, undefined, options);
|
|
48
55
|
}
|
|
56
|
+
/** Retry all dead-letter queue entries. */
|
|
49
57
|
async retryAllDlq(options) {
|
|
50
58
|
return this.http.post('/v1/admin/webhook-dlq/retry-all', undefined, options);
|
|
51
59
|
}
|
|
52
|
-
|
|
60
|
+
/** Get system health metrics (platform admin). */
|
|
53
61
|
async getSystemHealth(options) {
|
|
54
62
|
return this.http.get('/v1/admin/system-health', undefined, options);
|
|
55
63
|
}
|
|
@@ -7,7 +7,9 @@ import type { ComplianceExport, ExportComplianceParams, AiImpactAssessment, Crea
|
|
|
7
7
|
export declare class ComplianceResource {
|
|
8
8
|
private readonly http;
|
|
9
9
|
constructor(http: HttpClient);
|
|
10
|
+
/** Start a compliance data export. */
|
|
10
11
|
export(params: ExportComplianceParams, options?: RequestOptions): Promise<ComplianceExport>;
|
|
12
|
+
/** Check the status of a compliance export. */
|
|
11
13
|
getExportStatus(exportId: string, options?: RequestOptions): Promise<ComplianceExport>;
|
|
12
14
|
/**
|
|
13
15
|
* Poll until a compliance export is ready or timeout.
|
|
@@ -18,17 +20,22 @@ export declare class ComplianceResource {
|
|
|
18
20
|
timeoutMs?: number;
|
|
19
21
|
signal?: AbortSignal;
|
|
20
22
|
}): Promise<ComplianceExport>;
|
|
23
|
+
/** Create an AI impact assessment for a mandate (EU AI Act). */
|
|
21
24
|
createAssessment(mandateId: string, params: CreateAiImpactAssessmentParams, options?: RequestOptions): Promise<AiImpactAssessment>;
|
|
25
|
+
/** Get the AI impact assessment for a mandate. */
|
|
22
26
|
getAssessment(mandateId: string, options?: RequestOptions): Promise<AiImpactAssessment>;
|
|
27
|
+
/** Get the EU AI Act compliance report for the enterprise. */
|
|
23
28
|
getEuAiActReport(params?: {
|
|
24
29
|
from?: string;
|
|
25
30
|
to?: string;
|
|
26
31
|
}, options?: RequestOptions): Promise<EuAiActReport>;
|
|
32
|
+
/** Get the enterprise audit report. */
|
|
27
33
|
getEnterpriseReport(params?: {
|
|
28
34
|
from?: string;
|
|
29
35
|
to?: string;
|
|
30
36
|
format?: string;
|
|
31
37
|
}, options?: RequestOptions): Promise<Record<string, unknown>>;
|
|
38
|
+
/** Trigger LLM-powered audit analysis for a mandate. */
|
|
32
39
|
analyzeAudit(mandateId: string, options?: RequestOptions): Promise<Record<string, unknown>>;
|
|
33
40
|
}
|
|
34
41
|
//# sourceMappingURL=compliance.d.ts.map
|
|
@@ -7,10 +7,11 @@ export class ComplianceResource {
|
|
|
7
7
|
constructor(http) {
|
|
8
8
|
this.http = http;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
/** Start a compliance data export. */
|
|
11
11
|
async export(params, options) {
|
|
12
12
|
return this.http.post('/v1/compliance/export', params, options);
|
|
13
13
|
}
|
|
14
|
+
/** Check the status of a compliance export. */
|
|
14
15
|
async getExportStatus(exportId, options) {
|
|
15
16
|
return this.http.get(`/v1/compliance/export/${exportId}`, undefined, options);
|
|
16
17
|
}
|
|
@@ -33,20 +34,23 @@ export class ComplianceResource {
|
|
|
33
34
|
}
|
|
34
35
|
throw new Error(`Export ${exportId} did not complete within ${timeout}ms`);
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
+
/** Create an AI impact assessment for a mandate (EU AI Act). */
|
|
37
38
|
async createAssessment(mandateId, params, options) {
|
|
38
39
|
return this.http.post(`/v1/mandates/${mandateId}/ai-impact-assessment`, params, options);
|
|
39
40
|
}
|
|
41
|
+
/** Get the AI impact assessment for a mandate. */
|
|
40
42
|
async getAssessment(mandateId, options) {
|
|
41
43
|
return this.http.get(`/v1/mandates/${mandateId}/ai-impact-assessment`, undefined, options);
|
|
42
44
|
}
|
|
45
|
+
/** Get the EU AI Act compliance report for the enterprise. */
|
|
43
46
|
async getEuAiActReport(params, options) {
|
|
44
47
|
return this.http.get('/v1/compliance/eu-ai-act/report', params, options);
|
|
45
48
|
}
|
|
46
|
-
|
|
49
|
+
/** Get the enterprise audit report. */
|
|
47
50
|
async getEnterpriseReport(params, options) {
|
|
48
51
|
return this.http.get('/v1/audit/enterprise-report', params, options);
|
|
49
52
|
}
|
|
53
|
+
/** Trigger LLM-powered audit analysis for a mandate. */
|
|
50
54
|
async analyzeAudit(mandateId, options) {
|
|
51
55
|
return this.http.post('/v1/audit/enterprise-report/analyze', { mandateId }, options);
|
|
52
56
|
}
|
|
@@ -7,8 +7,11 @@ import type { DashboardSummary, DashboardMetrics, DashboardMetricsParams, Dashbo
|
|
|
7
7
|
export declare class DashboardResource {
|
|
8
8
|
private readonly http;
|
|
9
9
|
constructor(http: HttpClient);
|
|
10
|
+
/** Get a high-level dashboard summary (mandate counts, active agents, etc.). */
|
|
10
11
|
getSummary(options?: RequestOptions): Promise<DashboardSummary>;
|
|
12
|
+
/** Get dashboard metrics over a time range. */
|
|
11
13
|
getMetrics(params?: DashboardMetricsParams, options?: RequestOptions): Promise<DashboardMetrics>;
|
|
14
|
+
/** List agents with dashboard-level activity stats. */
|
|
12
15
|
listAgents(params?: DashboardAgentParams, options?: RequestOptions): Promise<Page<DashboardAgent>>;
|
|
13
16
|
}
|
|
14
17
|
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -7,12 +7,15 @@ export class DashboardResource {
|
|
|
7
7
|
constructor(http) {
|
|
8
8
|
this.http = http;
|
|
9
9
|
}
|
|
10
|
+
/** Get a high-level dashboard summary (mandate counts, active agents, etc.). */
|
|
10
11
|
async getSummary(options) {
|
|
11
12
|
return this.http.get('/v1/dashboard/summary', undefined, options);
|
|
12
13
|
}
|
|
14
|
+
/** Get dashboard metrics over a time range. */
|
|
13
15
|
async getMetrics(params, options) {
|
|
14
16
|
return this.http.get('/v1/dashboard/metrics', params, options);
|
|
15
17
|
}
|
|
18
|
+
/** List agents with dashboard-level activity stats. */
|
|
16
19
|
async listAgents(params, options) {
|
|
17
20
|
return this.http.getPage('/v1/dashboard/agents', params, options);
|
|
18
21
|
}
|
|
@@ -7,10 +7,15 @@ import type { Dispute, CreateDisputeParams, ResolveDisputeParams, RequestOptions
|
|
|
7
7
|
export declare class DisputesResource {
|
|
8
8
|
private readonly http;
|
|
9
9
|
constructor(http: HttpClient);
|
|
10
|
+
/** Create a dispute on a mandate. */
|
|
10
11
|
create(mandateId: string, params: CreateDisputeParams, options?: RequestOptions): Promise<Dispute>;
|
|
12
|
+
/** Get the dispute for a mandate. */
|
|
11
13
|
get(mandateId: string, options?: RequestOptions): Promise<Dispute>;
|
|
14
|
+
/** Escalate a dispute to the next review tier. */
|
|
12
15
|
escalate(mandateId: string, reason: string, options?: RequestOptions): Promise<Dispute>;
|
|
16
|
+
/** Submit additional evidence for a dispute. */
|
|
13
17
|
submitEvidence(mandateId: string, evidence: Record<string, unknown>, options?: RequestOptions): Promise<Dispute>;
|
|
18
|
+
/** Resolve a dispute with a resolution and optional amount. */
|
|
14
19
|
resolve(mandateId: string, params: ResolveDisputeParams, options?: RequestOptions): Promise<Dispute>;
|
|
15
20
|
}
|
|
16
21
|
//# sourceMappingURL=disputes.d.ts.map
|
|
@@ -7,18 +7,23 @@ export class DisputesResource {
|
|
|
7
7
|
constructor(http) {
|
|
8
8
|
this.http = http;
|
|
9
9
|
}
|
|
10
|
+
/** Create a dispute on a mandate. */
|
|
10
11
|
async create(mandateId, params, options) {
|
|
11
12
|
return this.http.post(`/v1/mandates/${mandateId}/dispute`, params, options);
|
|
12
13
|
}
|
|
14
|
+
/** Get the dispute for a mandate. */
|
|
13
15
|
async get(mandateId, options) {
|
|
14
16
|
return this.http.get(`/v1/mandates/${mandateId}/dispute`, undefined, options);
|
|
15
17
|
}
|
|
18
|
+
/** Escalate a dispute to the next review tier. */
|
|
16
19
|
async escalate(mandateId, reason, options) {
|
|
17
20
|
return this.http.post(`/v1/mandates/${mandateId}/dispute/escalate`, { reason }, options);
|
|
18
21
|
}
|
|
22
|
+
/** Submit additional evidence for a dispute. */
|
|
19
23
|
async submitEvidence(mandateId, evidence, options) {
|
|
20
24
|
return this.http.post(`/v1/mandates/${mandateId}/dispute/evidence`, evidence, options);
|
|
21
25
|
}
|
|
26
|
+
/** Resolve a dispute with a resolution and optional amount. */
|
|
22
27
|
async resolve(mandateId, params, options) {
|
|
23
28
|
return this.http.post(`/v1/mandates/${mandateId}/dispute/resolve`, params, options);
|
|
24
29
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Enterprises Resource (Agent Approval Registry)
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import type { HttpClient } from '../http.js';
|
|
6
|
+
import type { EnterpriseAgentRecord, ApprovalConfig, ApproveAgentParams, RevokeAgentParams, UpdateAgentStatusParams, BulkApproveAgentParams, BulkApproveResult, ListEnterpriseAgentsParams, Page, RequestOptions } from '../types.js';
|
|
7
|
+
export declare class EnterprisesResource {
|
|
8
|
+
private readonly http;
|
|
9
|
+
constructor(http: HttpClient);
|
|
10
|
+
/** Approve an agent for an enterprise (idempotent PUT). */
|
|
11
|
+
approveAgent(enterpriseId: string, agentId: string, params?: ApproveAgentParams, options?: RequestOptions): Promise<EnterpriseAgentRecord>;
|
|
12
|
+
/** Revoke an agent's approval for an enterprise. */
|
|
13
|
+
revokeAgent(enterpriseId: string, agentId: string, params?: RevokeAgentParams, options?: RequestOptions): Promise<void>;
|
|
14
|
+
/** Update an agent's status (e.g., suspend or reactivate). */
|
|
15
|
+
updateAgentStatus(enterpriseId: string, agentId: string, params: UpdateAgentStatusParams, options?: RequestOptions): Promise<EnterpriseAgentRecord>;
|
|
16
|
+
/** Approve multiple agents at once. */
|
|
17
|
+
bulkApprove(enterpriseId: string, params: BulkApproveAgentParams, options?: RequestOptions): Promise<BulkApproveResult>;
|
|
18
|
+
/** List agents for an enterprise, optionally filtered by status. */
|
|
19
|
+
listAgents(enterpriseId: string, params?: ListEnterpriseAgentsParams, options?: RequestOptions): Promise<Page<EnterpriseAgentRecord>>;
|
|
20
|
+
/** Get a single agent's approval record. */
|
|
21
|
+
getAgent(enterpriseId: string, agentId: string, options?: RequestOptions): Promise<EnterpriseAgentRecord>;
|
|
22
|
+
/** Get the enterprise's agent approval configuration. */
|
|
23
|
+
getApprovalConfig(enterpriseId: string, options?: RequestOptions): Promise<ApprovalConfig>;
|
|
24
|
+
/** Set the enterprise's agent approval configuration. */
|
|
25
|
+
setApprovalConfig(enterpriseId: string, params: ApprovalConfig, options?: RequestOptions): Promise<ApprovalConfig>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=enterprises.d.ts.map
|