@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.
- package/LICENSE +34 -0
- package/README.md +209 -0
- package/dist/client.d.ts +46 -0
- package/dist/client.js +68 -0
- package/dist/errors.d.ts +64 -0
- package/dist/errors.js +114 -0
- package/dist/http.d.ts +47 -0
- package/dist/http.js +272 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +12 -0
- package/dist/resources/a2a.d.ts +22 -0
- package/dist/resources/a2a.js +33 -0
- package/dist/resources/admin.d.ts +39 -0
- package/dist/resources/admin.js +57 -0
- package/dist/resources/capabilities.d.ts +23 -0
- package/dist/resources/capabilities.js +21 -0
- package/dist/resources/compliance.d.ts +34 -0
- package/dist/resources/compliance.js +54 -0
- package/dist/resources/dashboard.d.ts +14 -0
- package/dist/resources/dashboard.js +20 -0
- package/dist/resources/disputes.d.ts +16 -0
- package/dist/resources/disputes.js +26 -0
- package/dist/resources/events.d.ts +21 -0
- package/dist/resources/events.js +22 -0
- package/dist/resources/health.d.ts +15 -0
- package/dist/resources/health.js +21 -0
- package/dist/resources/mandates.d.ts +48 -0
- package/dist/resources/mandates.js +89 -0
- package/dist/resources/notarize.d.ts +20 -0
- package/dist/resources/notarize.js +44 -0
- package/dist/resources/proxy.d.ts +74 -0
- package/dist/resources/proxy.js +149 -0
- package/dist/resources/receipts.d.ts +28 -0
- package/dist/resources/receipts.js +27 -0
- package/dist/resources/registration.d.ts +30 -0
- package/dist/resources/registration.js +39 -0
- package/dist/resources/reputation.d.ts +16 -0
- package/dist/resources/reputation.js +17 -0
- package/dist/resources/schemas.d.ts +20 -0
- package/dist/resources/schemas.js +24 -0
- package/dist/resources/verification.d.ts +13 -0
- package/dist/resources/verification.js +17 -0
- package/dist/resources/webhooks.d.ts +25 -0
- package/dist/resources/webhooks.js +37 -0
- package/dist/types.d.ts +1134 -0
- package/dist/types.js +6 -0
- package/dist/webhooks/verify.d.ts +37 -0
- package/dist/webhooks/verify.js +86 -0
- package/package.json +74 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Disputes Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
export class DisputesResource {
|
|
6
|
+
http;
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
async create(mandateId, params, options) {
|
|
11
|
+
return this.http.post(`/v1/mandates/${mandateId}/dispute`, params, options);
|
|
12
|
+
}
|
|
13
|
+
async get(mandateId, options) {
|
|
14
|
+
return this.http.get(`/v1/mandates/${mandateId}/dispute`, undefined, options);
|
|
15
|
+
}
|
|
16
|
+
async escalate(mandateId, reason, options) {
|
|
17
|
+
return this.http.post(`/v1/mandates/${mandateId}/dispute/escalate`, { reason }, options);
|
|
18
|
+
}
|
|
19
|
+
async submitEvidence(mandateId, evidence, options) {
|
|
20
|
+
return this.http.post(`/v1/mandates/${mandateId}/dispute/evidence`, evidence, options);
|
|
21
|
+
}
|
|
22
|
+
async resolve(mandateId, params, options) {
|
|
23
|
+
return this.http.post(`/v1/mandates/${mandateId}/dispute/resolve`, params, options);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=disputes.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Events & Audit Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import type { HttpClient } from '../http.js';
|
|
6
|
+
import type { AgledgerEvent, AuditChain, Page, ListParams, RequestOptions } from '../types.js';
|
|
7
|
+
export declare class EventsResource {
|
|
8
|
+
private readonly http;
|
|
9
|
+
constructor(http: HttpClient);
|
|
10
|
+
/**
|
|
11
|
+
* List events globally. Requires `since` parameter (ISO timestamp).
|
|
12
|
+
* GET /v1/events?since=...&order=asc|desc
|
|
13
|
+
*/
|
|
14
|
+
list(params: {
|
|
15
|
+
since: string;
|
|
16
|
+
order?: 'asc' | 'desc';
|
|
17
|
+
} & ListParams, options?: RequestOptions): Promise<Page<AgledgerEvent>>;
|
|
18
|
+
/** Get the hash-chained audit trail for a mandate. */
|
|
19
|
+
getAuditChain(mandateId: string, options?: RequestOptions): Promise<AuditChain>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Events & Audit Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
export class EventsResource {
|
|
6
|
+
http;
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List events globally. Requires `since` parameter (ISO timestamp).
|
|
12
|
+
* GET /v1/events?since=...&order=asc|desc
|
|
13
|
+
*/
|
|
14
|
+
async list(params, options) {
|
|
15
|
+
return this.http.getPage('/v1/events', params, options);
|
|
16
|
+
}
|
|
17
|
+
/** Get the hash-chained audit trail for a mandate. */
|
|
18
|
+
async getAuditChain(mandateId, options) {
|
|
19
|
+
return this.http.get(`/v1/mandates/${mandateId}/audit`, undefined, options);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Health & Conformance Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import type { HttpClient } from '../http.js';
|
|
6
|
+
import type { HealthResponse, StatusResponse, ConformanceResponse, RequestOptions } from '../types.js';
|
|
7
|
+
export declare class HealthResource {
|
|
8
|
+
private readonly http;
|
|
9
|
+
constructor(http: HttpClient);
|
|
10
|
+
check(options?: RequestOptions): Promise<HealthResponse>;
|
|
11
|
+
status(options?: RequestOptions): Promise<StatusResponse>;
|
|
12
|
+
/** Get platform conformance info (protocol version, features, limits). */
|
|
13
|
+
conformance(options?: RequestOptions): Promise<ConformanceResponse>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Health & Conformance Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
export class HealthResource {
|
|
6
|
+
http;
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
async check(options) {
|
|
11
|
+
return this.http.get('/health', undefined, options);
|
|
12
|
+
}
|
|
13
|
+
async status(options) {
|
|
14
|
+
return this.http.get('/status', undefined, options);
|
|
15
|
+
}
|
|
16
|
+
/** Get platform conformance info (protocol version, features, limits). */
|
|
17
|
+
async conformance(options) {
|
|
18
|
+
return this.http.get('/v1/conformance', undefined, options);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Mandates Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import type { HttpClient } from '../http.js';
|
|
6
|
+
import type { Mandate, CreateMandateParams, UpdateMandateParams, ListMandatesParams, SearchMandatesParams, DelegateMandateParams, CreateAgentMandateParams, RespondToMandateParams, Page, BulkCreateResult, MandateTransitionAction, RequestOptions, AutoPaginateOptions, TypedCreateMandateParams } from '../types.js';
|
|
7
|
+
export declare class MandatesResource {
|
|
8
|
+
private readonly http;
|
|
9
|
+
constructor(http: HttpClient);
|
|
10
|
+
/**
|
|
11
|
+
* Create a mandate. When `contractType` is a known Agentic Contract
|
|
12
|
+
* Specification type, `criteria` is typed to that contract's schema.
|
|
13
|
+
*/
|
|
14
|
+
create<T extends string>(params: TypedCreateMandateParams<T>, options?: RequestOptions): Promise<Mandate>;
|
|
15
|
+
create(params: CreateMandateParams, options?: RequestOptions): Promise<Mandate>;
|
|
16
|
+
/** Create a mandate via agent auth (POST /v1/mandates/agent). */
|
|
17
|
+
createAgent(params: CreateAgentMandateParams, options?: RequestOptions): Promise<Mandate>;
|
|
18
|
+
get(id: string, options?: RequestOptions): Promise<Mandate>;
|
|
19
|
+
list(params: ListMandatesParams, options?: RequestOptions): Promise<Page<Mandate>>;
|
|
20
|
+
/** Auto-paginating iterator. Yields individual mandates across all pages. */
|
|
21
|
+
listAll(params: ListMandatesParams, options?: RequestOptions & AutoPaginateOptions): AsyncGenerator<Mandate>;
|
|
22
|
+
search(params: SearchMandatesParams, options?: RequestOptions): Promise<Page<Mandate>>;
|
|
23
|
+
update(id: string, params: UpdateMandateParams, options?: RequestOptions): Promise<Mandate>;
|
|
24
|
+
transition(id: string, action: MandateTransitionAction, reason?: string, options?: RequestOptions): Promise<Mandate>;
|
|
25
|
+
cancel(id: string, reason?: string, options?: RequestOptions): Promise<Mandate>;
|
|
26
|
+
/** Accept a PROPOSED mandate (as performer). */
|
|
27
|
+
accept(id: string, options?: RequestOptions): Promise<Mandate>;
|
|
28
|
+
/** Reject a PROPOSED mandate (as performer). */
|
|
29
|
+
reject(id: string, reason?: string, options?: RequestOptions): Promise<Mandate>;
|
|
30
|
+
/** Respond to a PROPOSED mandate (accept, reject, or counter). */
|
|
31
|
+
respond(id: string, params: RespondToMandateParams, options?: RequestOptions): Promise<Mandate>;
|
|
32
|
+
/** Accept a counter-proposal on a mandate. */
|
|
33
|
+
acceptCounter(id: string, options?: RequestOptions): Promise<Mandate>;
|
|
34
|
+
/** Get the full delegation chain for a mandate. */
|
|
35
|
+
getChain(id: string, options?: RequestOptions): Promise<Mandate[]>;
|
|
36
|
+
/** Get direct sub-mandates of a mandate. */
|
|
37
|
+
getSubMandates(id: string, options?: RequestOptions): Promise<Page<Mandate>>;
|
|
38
|
+
/** Delegate a mandate by creating a child mandate via agent auth. */
|
|
39
|
+
delegate(id: string, params: DelegateMandateParams, options?: RequestOptions): Promise<Mandate>;
|
|
40
|
+
bulkCreate(mandates: CreateMandateParams[], options?: RequestOptions): Promise<BulkCreateResult>;
|
|
41
|
+
/** Get audit trail for a mandate. */
|
|
42
|
+
getAudit(id: string, options?: RequestOptions): Promise<Record<string, unknown>>;
|
|
43
|
+
/** List mandates where the authenticated agent is principal. */
|
|
44
|
+
listAsPrincipal(options?: RequestOptions): Promise<Page<Mandate>>;
|
|
45
|
+
/** List mandates proposed to the authenticated agent. */
|
|
46
|
+
listProposals(options?: RequestOptions): Promise<Page<Mandate>>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=mandates.d.ts.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Mandates Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
export class MandatesResource {
|
|
6
|
+
http;
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
async create(params, options) {
|
|
11
|
+
return this.http.post('/v1/mandates', params, options);
|
|
12
|
+
}
|
|
13
|
+
/** Create a mandate via agent auth (POST /v1/mandates/agent). */
|
|
14
|
+
async createAgent(params, options) {
|
|
15
|
+
return this.http.post('/v1/mandates/agent', params, options);
|
|
16
|
+
}
|
|
17
|
+
async get(id, options) {
|
|
18
|
+
return this.http.get(`/v1/mandates/${id}`, undefined, options);
|
|
19
|
+
}
|
|
20
|
+
async list(params, options) {
|
|
21
|
+
return this.http.getPage('/v1/mandates', params, options);
|
|
22
|
+
}
|
|
23
|
+
/** Auto-paginating iterator. Yields individual mandates across all pages. */
|
|
24
|
+
listAll(params, options) {
|
|
25
|
+
return this.http.paginate('/v1/mandates', params, options);
|
|
26
|
+
}
|
|
27
|
+
async search(params, options) {
|
|
28
|
+
return this.http.getPage('/v1/mandates/search', params, options);
|
|
29
|
+
}
|
|
30
|
+
async update(id, params, options) {
|
|
31
|
+
return this.http.patch(`/v1/mandates/${id}`, params, options);
|
|
32
|
+
}
|
|
33
|
+
async transition(id, action, reason, options) {
|
|
34
|
+
const body = { action };
|
|
35
|
+
if (reason)
|
|
36
|
+
body.reason = reason;
|
|
37
|
+
return this.http.post(`/v1/mandates/${id}/transition`, body, options);
|
|
38
|
+
}
|
|
39
|
+
async cancel(id, reason, options) {
|
|
40
|
+
return this.transition(id, 'cancel', reason, options);
|
|
41
|
+
}
|
|
42
|
+
/** Accept a PROPOSED mandate (as performer). */
|
|
43
|
+
async accept(id, options) {
|
|
44
|
+
return this.http.post(`/v1/mandates/${id}/accept`, undefined, options);
|
|
45
|
+
}
|
|
46
|
+
/** Reject a PROPOSED mandate (as performer). */
|
|
47
|
+
async reject(id, reason, options) {
|
|
48
|
+
return this.http.post(`/v1/mandates/${id}/reject`, reason ? { reason } : undefined, options);
|
|
49
|
+
}
|
|
50
|
+
/** Respond to a PROPOSED mandate (accept, reject, or counter). */
|
|
51
|
+
async respond(id, params, options) {
|
|
52
|
+
return this.http.post(`/v1/mandates/${id}/respond`, params, options);
|
|
53
|
+
}
|
|
54
|
+
/** Accept a counter-proposal on a mandate. */
|
|
55
|
+
async acceptCounter(id, options) {
|
|
56
|
+
return this.http.post(`/v1/mandates/${id}/accept-counter`, undefined, options);
|
|
57
|
+
}
|
|
58
|
+
/** Get the full delegation chain for a mandate. */
|
|
59
|
+
async getChain(id, options) {
|
|
60
|
+
return this.http.get(`/v1/mandates/${id}/chain`, undefined, options);
|
|
61
|
+
}
|
|
62
|
+
/** Get direct sub-mandates of a mandate. */
|
|
63
|
+
async getSubMandates(id, options) {
|
|
64
|
+
return this.http.getPage(`/v1/mandates/${id}/sub-mandates`, undefined, options);
|
|
65
|
+
}
|
|
66
|
+
/** Delegate a mandate by creating a child mandate via agent auth. */
|
|
67
|
+
async delegate(id, params, options) {
|
|
68
|
+
return this.createAgent({
|
|
69
|
+
...params,
|
|
70
|
+
parentMandateId: id,
|
|
71
|
+
}, options);
|
|
72
|
+
}
|
|
73
|
+
async bulkCreate(mandates, options) {
|
|
74
|
+
return this.http.post('/v1/mandates/bulk', { mandates }, options);
|
|
75
|
+
}
|
|
76
|
+
/** Get audit trail for a mandate. */
|
|
77
|
+
async getAudit(id, options) {
|
|
78
|
+
return this.http.get(`/v1/mandates/${id}/audit`, undefined, options);
|
|
79
|
+
}
|
|
80
|
+
/** List mandates where the authenticated agent is principal. */
|
|
81
|
+
async listAsPrincipal(options) {
|
|
82
|
+
return this.http.getPage('/v1/mandates/agent/principal', undefined, options);
|
|
83
|
+
}
|
|
84
|
+
/** List mandates proposed to the authenticated agent. */
|
|
85
|
+
async listProposals(options) {
|
|
86
|
+
return this.http.getPage('/v1/mandates/agent/proposals', undefined, options);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=mandates.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Notarize Resource
|
|
3
|
+
* Agent-to-agent agreement notarization (OpenClaw flow).
|
|
4
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
5
|
+
*/
|
|
6
|
+
import type { HttpClient } from '../http.js';
|
|
7
|
+
import type { NotarizedMandate, NotarizeMandateParams, NotarizeMandateResult, NotarizeCounterProposeParams, NotarizeReceiptParams, NotarizeReceiptResult, NotarizeVerdictParams, NotarizeVerifyParams, NotarizeVerifyResult, NotarizeHistory, RequestOptions } from '../types.js';
|
|
8
|
+
export declare class NotarizeResource {
|
|
9
|
+
private readonly http;
|
|
10
|
+
constructor(http: HttpClient);
|
|
11
|
+
createMandate(params: NotarizeMandateParams, options?: RequestOptions): Promise<NotarizeMandateResult>;
|
|
12
|
+
getMandate(id: string, options?: RequestOptions): Promise<NotarizedMandate>;
|
|
13
|
+
getHistory(id: string, options?: RequestOptions): Promise<NotarizeHistory>;
|
|
14
|
+
acceptMandate(id: string, options?: RequestOptions): Promise<NotarizedMandate>;
|
|
15
|
+
counterPropose(id: string, params: NotarizeCounterProposeParams, options?: RequestOptions): Promise<NotarizeMandateResult>;
|
|
16
|
+
submitReceipt(id: string, params: NotarizeReceiptParams, options?: RequestOptions): Promise<NotarizeReceiptResult>;
|
|
17
|
+
renderVerdict(id: string, params: NotarizeVerdictParams, options?: RequestOptions): Promise<NotarizedMandate>;
|
|
18
|
+
verify(params: NotarizeVerifyParams, options?: RequestOptions): Promise<NotarizeVerifyResult>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=notarize.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Notarize Resource
|
|
3
|
+
* Agent-to-agent agreement notarization (OpenClaw flow).
|
|
4
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
5
|
+
*/
|
|
6
|
+
export class NotarizeResource {
|
|
7
|
+
http;
|
|
8
|
+
constructor(http) {
|
|
9
|
+
this.http = http;
|
|
10
|
+
}
|
|
11
|
+
// --- Principal: create a notarized mandate ---
|
|
12
|
+
async createMandate(params, options) {
|
|
13
|
+
return this.http.post('/v1/notarize/mandates', params, options);
|
|
14
|
+
}
|
|
15
|
+
// --- Either party: get mandate metadata ---
|
|
16
|
+
async getMandate(id, options) {
|
|
17
|
+
return this.http.get(`/v1/notarize/mandates/${id}`, undefined, options);
|
|
18
|
+
}
|
|
19
|
+
// --- Either party: get transition history ---
|
|
20
|
+
async getHistory(id, options) {
|
|
21
|
+
return this.http.get(`/v1/notarize/mandates/${id}/history`, undefined, options);
|
|
22
|
+
}
|
|
23
|
+
// --- Performer: accept mandate ---
|
|
24
|
+
async acceptMandate(id, options) {
|
|
25
|
+
return this.http.post(`/v1/notarize/mandates/${id}/accept`, undefined, options);
|
|
26
|
+
}
|
|
27
|
+
// --- Performer: counter-propose ---
|
|
28
|
+
async counterPropose(id, params, options) {
|
|
29
|
+
return this.http.post(`/v1/notarize/mandates/${id}/counter-propose`, params, options);
|
|
30
|
+
}
|
|
31
|
+
// --- Performer: submit receipt ---
|
|
32
|
+
async submitReceipt(id, params, options) {
|
|
33
|
+
return this.http.post(`/v1/notarize/mandates/${id}/receipts`, params, options);
|
|
34
|
+
}
|
|
35
|
+
// --- Principal: render verdict ---
|
|
36
|
+
async renderVerdict(id, params, options) {
|
|
37
|
+
return this.http.post(`/v1/notarize/mandates/${id}/verdict`, params, options);
|
|
38
|
+
}
|
|
39
|
+
// --- Any party: verify a local copy matches the notarized hash ---
|
|
40
|
+
async verify(params, options) {
|
|
41
|
+
return this.http.post('/v1/notarize/verify', params, options);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=notarize.js.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Governance Sidecar Proxy Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Decomposed into sub-resources for sessions, tool calls, sidecar mandates,
|
|
6
|
+
* sidecar receipts, tool catalog, and analytics.
|
|
7
|
+
*/
|
|
8
|
+
import type { HttpClient } from '../http.js';
|
|
9
|
+
import type { ProxySession, CreateSessionParams, SyncSessionParams, SyncSessionResult, ToolCallBatchItem, SidecarMandateBatchItem, SidecarReceiptBatchItem, ToolCatalogBatchItem, ProxySidecarMandate, ProxySidecarReceipt, ProxyToolCall, ProxyToolCatalogEntry, UpdateSidecarMandateParams, SessionAnalytics, AnalyticsSummary, MandateSummary, AlignmentAnalysis, BatchResult, Page, ListParams, RequestOptions } from '../types.js';
|
|
10
|
+
export declare class ProxySessionsResource {
|
|
11
|
+
private readonly http;
|
|
12
|
+
constructor(http: HttpClient);
|
|
13
|
+
create(params: CreateSessionParams, options?: RequestOptions): Promise<ProxySession>;
|
|
14
|
+
get(sessionId: string, options?: RequestOptions): Promise<ProxySession>;
|
|
15
|
+
list(params?: ListParams, options?: RequestOptions): Promise<Page<ProxySession>>;
|
|
16
|
+
/**
|
|
17
|
+
* Unified sync: session + tool calls + sidecar mandates + sidecar receipts + tool catalog
|
|
18
|
+
* in a single request. Returns mandateIdMap mapping local SM-xxx IDs to backend UUIDs.
|
|
19
|
+
*/
|
|
20
|
+
sync(params: SyncSessionParams, options?: RequestOptions): Promise<SyncSessionResult>;
|
|
21
|
+
}
|
|
22
|
+
export declare class ProxyToolCallsResource {
|
|
23
|
+
private readonly http;
|
|
24
|
+
constructor(http: HttpClient);
|
|
25
|
+
ingest(sessionId: string, items: ToolCallBatchItem[], options?: RequestOptions): Promise<BatchResult<ProxyToolCall>>;
|
|
26
|
+
list(sessionId: string, params?: ListParams, options?: RequestOptions): Promise<Page<ProxyToolCall>>;
|
|
27
|
+
}
|
|
28
|
+
export declare class ProxySidecarMandatesResource {
|
|
29
|
+
private readonly http;
|
|
30
|
+
constructor(http: HttpClient);
|
|
31
|
+
ingest(sessionId: string, items: SidecarMandateBatchItem[], options?: RequestOptions): Promise<BatchResult<ProxySidecarMandate>>;
|
|
32
|
+
list(params?: ListParams & {
|
|
33
|
+
sessionId?: string;
|
|
34
|
+
}, options?: RequestOptions): Promise<Page<ProxySidecarMandate>>;
|
|
35
|
+
listBySession(sessionId: string, params?: ListParams, options?: RequestOptions): Promise<Page<ProxySidecarMandate>>;
|
|
36
|
+
update(id: string, params: UpdateSidecarMandateParams, options?: RequestOptions): Promise<ProxySidecarMandate>;
|
|
37
|
+
formalize(id: string, formalizedMandateId: string, options?: RequestOptions): Promise<ProxySidecarMandate>;
|
|
38
|
+
dismiss(id: string, options?: RequestOptions): Promise<ProxySidecarMandate>;
|
|
39
|
+
}
|
|
40
|
+
export declare class ProxySidecarReceiptsResource {
|
|
41
|
+
private readonly http;
|
|
42
|
+
constructor(http: HttpClient);
|
|
43
|
+
ingest(sessionId: string, items: SidecarReceiptBatchItem[], options?: RequestOptions): Promise<BatchResult<ProxySidecarReceipt>>;
|
|
44
|
+
listBySession(sessionId: string, params?: ListParams, options?: RequestOptions): Promise<Page<ProxySidecarReceipt>>;
|
|
45
|
+
}
|
|
46
|
+
export declare class ProxyToolCatalogResource {
|
|
47
|
+
private readonly http;
|
|
48
|
+
constructor(http: HttpClient);
|
|
49
|
+
ingest(sessionId: string, items: ToolCatalogBatchItem[], options?: RequestOptions): Promise<BatchResult<ProxyToolCatalogEntry>>;
|
|
50
|
+
list(sessionId: string, options?: RequestOptions): Promise<Page<ProxyToolCatalogEntry>>;
|
|
51
|
+
}
|
|
52
|
+
export declare class ProxyAnalyticsResource {
|
|
53
|
+
private readonly http;
|
|
54
|
+
constructor(http: HttpClient);
|
|
55
|
+
getSession(sessionId: string, options?: RequestOptions): Promise<SessionAnalytics>;
|
|
56
|
+
getSummary(params?: {
|
|
57
|
+
from?: string;
|
|
58
|
+
to?: string;
|
|
59
|
+
}, options?: RequestOptions): Promise<AnalyticsSummary>;
|
|
60
|
+
getMandateSummary(sessionId: string, options?: RequestOptions): Promise<MandateSummary>;
|
|
61
|
+
getAlignment(sessionId: string, options?: RequestOptions): Promise<AlignmentAnalysis>;
|
|
62
|
+
}
|
|
63
|
+
export declare class ProxyResource {
|
|
64
|
+
readonly sessions: ProxySessionsResource;
|
|
65
|
+
readonly toolCalls: ProxyToolCallsResource;
|
|
66
|
+
readonly sidecarMandates: ProxySidecarMandatesResource;
|
|
67
|
+
readonly sidecarReceipts: ProxySidecarReceiptsResource;
|
|
68
|
+
readonly toolCatalog: ProxyToolCatalogResource;
|
|
69
|
+
readonly analytics: ProxyAnalyticsResource;
|
|
70
|
+
constructor(http: HttpClient);
|
|
71
|
+
/** Convenience: unified sync (delegates to sessions.sync). */
|
|
72
|
+
syncSession(params: SyncSessionParams, options?: RequestOptions): Promise<SyncSessionResult>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=proxy.d.ts.map
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Governance Sidecar Proxy Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Decomposed into sub-resources for sessions, tool calls, sidecar mandates,
|
|
6
|
+
* sidecar receipts, tool catalog, and analytics.
|
|
7
|
+
*/
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Sessions
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
export class ProxySessionsResource {
|
|
12
|
+
http;
|
|
13
|
+
constructor(http) {
|
|
14
|
+
this.http = http;
|
|
15
|
+
}
|
|
16
|
+
async create(params, options) {
|
|
17
|
+
return this.http.post('/v1/proxy/sessions', params, options);
|
|
18
|
+
}
|
|
19
|
+
async get(sessionId, options) {
|
|
20
|
+
return this.http.get(`/v1/proxy/sessions/${sessionId}`, undefined, options);
|
|
21
|
+
}
|
|
22
|
+
async list(params, options) {
|
|
23
|
+
return this.http.getPage('/v1/proxy/sessions', params, options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Unified sync: session + tool calls + sidecar mandates + sidecar receipts + tool catalog
|
|
27
|
+
* in a single request. Returns mandateIdMap mapping local SM-xxx IDs to backend UUIDs.
|
|
28
|
+
*/
|
|
29
|
+
async sync(params, options) {
|
|
30
|
+
return this.http.post('/v1/proxy/sync', params, { ...options, timeout: options?.timeout ?? 60_000 });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// Tool Calls
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
export class ProxyToolCallsResource {
|
|
37
|
+
http;
|
|
38
|
+
constructor(http) {
|
|
39
|
+
this.http = http;
|
|
40
|
+
}
|
|
41
|
+
async ingest(sessionId, items, options) {
|
|
42
|
+
return this.http.post(`/v1/proxy/sessions/${sessionId}/tool-calls`, { items }, options);
|
|
43
|
+
}
|
|
44
|
+
async list(sessionId, params, options) {
|
|
45
|
+
return this.http.getPage(`/v1/proxy/sessions/${sessionId}/tool-calls`, params, options);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
// Sidecar Mandates
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
export class ProxySidecarMandatesResource {
|
|
52
|
+
http;
|
|
53
|
+
constructor(http) {
|
|
54
|
+
this.http = http;
|
|
55
|
+
}
|
|
56
|
+
async ingest(sessionId, items, options) {
|
|
57
|
+
return this.http.post(`/v1/proxy/sessions/${sessionId}/sidecar-mandates`, { items }, options);
|
|
58
|
+
}
|
|
59
|
+
async list(params, options) {
|
|
60
|
+
return this.http.getPage('/v1/proxy/sidecar-mandates', params, options);
|
|
61
|
+
}
|
|
62
|
+
async listBySession(sessionId, params, options) {
|
|
63
|
+
return this.http.getPage(`/v1/proxy/sessions/${sessionId}/sidecar-mandates`, params, options);
|
|
64
|
+
}
|
|
65
|
+
async update(id, params, options) {
|
|
66
|
+
return this.http.patch(`/v1/proxy/sidecar-mandates/${id}`, params, options);
|
|
67
|
+
}
|
|
68
|
+
async formalize(id, formalizedMandateId, options) {
|
|
69
|
+
return this.update(id, { status: 'FORMALIZED', formalizedMandateId }, options);
|
|
70
|
+
}
|
|
71
|
+
async dismiss(id, options) {
|
|
72
|
+
return this.update(id, { status: 'DISMISSED' }, options);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// Sidecar Receipts
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
export class ProxySidecarReceiptsResource {
|
|
79
|
+
http;
|
|
80
|
+
constructor(http) {
|
|
81
|
+
this.http = http;
|
|
82
|
+
}
|
|
83
|
+
async ingest(sessionId, items, options) {
|
|
84
|
+
return this.http.post(`/v1/proxy/sessions/${sessionId}/sidecar-receipts`, { items }, options);
|
|
85
|
+
}
|
|
86
|
+
async listBySession(sessionId, params, options) {
|
|
87
|
+
return this.http.getPage(`/v1/proxy/sessions/${sessionId}/sidecar-receipts`, params, options);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// Tool Catalog
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
export class ProxyToolCatalogResource {
|
|
94
|
+
http;
|
|
95
|
+
constructor(http) {
|
|
96
|
+
this.http = http;
|
|
97
|
+
}
|
|
98
|
+
async ingest(sessionId, items, options) {
|
|
99
|
+
return this.http.post(`/v1/proxy/sessions/${sessionId}/tool-catalog`, { items }, options);
|
|
100
|
+
}
|
|
101
|
+
async list(sessionId, options) {
|
|
102
|
+
return this.http.getPage(`/v1/proxy/sessions/${sessionId}/tool-catalog`, undefined, options);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// Analytics
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
export class ProxyAnalyticsResource {
|
|
109
|
+
http;
|
|
110
|
+
constructor(http) {
|
|
111
|
+
this.http = http;
|
|
112
|
+
}
|
|
113
|
+
async getSession(sessionId, options) {
|
|
114
|
+
return this.http.get(`/v1/proxy/sessions/${sessionId}/analytics`, undefined, options);
|
|
115
|
+
}
|
|
116
|
+
async getSummary(params, options) {
|
|
117
|
+
return this.http.get('/v1/proxy/analytics', params, options);
|
|
118
|
+
}
|
|
119
|
+
async getMandateSummary(sessionId, options) {
|
|
120
|
+
return this.http.get(`/v1/proxy/sessions/${sessionId}/mandate-summary`, undefined, options);
|
|
121
|
+
}
|
|
122
|
+
async getAlignment(sessionId, options) {
|
|
123
|
+
return this.http.get(`/v1/proxy/sessions/${sessionId}/alignment`, undefined, options);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// Unified Proxy Resource
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
export class ProxyResource {
|
|
130
|
+
sessions;
|
|
131
|
+
toolCalls;
|
|
132
|
+
sidecarMandates;
|
|
133
|
+
sidecarReceipts;
|
|
134
|
+
toolCatalog;
|
|
135
|
+
analytics;
|
|
136
|
+
constructor(http) {
|
|
137
|
+
this.sessions = new ProxySessionsResource(http);
|
|
138
|
+
this.toolCalls = new ProxyToolCallsResource(http);
|
|
139
|
+
this.sidecarMandates = new ProxySidecarMandatesResource(http);
|
|
140
|
+
this.sidecarReceipts = new ProxySidecarReceiptsResource(http);
|
|
141
|
+
this.toolCatalog = new ProxyToolCatalogResource(http);
|
|
142
|
+
this.analytics = new ProxyAnalyticsResource(http);
|
|
143
|
+
}
|
|
144
|
+
/** Convenience: unified sync (delegates to sessions.sync). */
|
|
145
|
+
async syncSession(params, options) {
|
|
146
|
+
return this.sessions.sync(params, options);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=proxy.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Receipts Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import type { HttpClient } from '../http.js';
|
|
6
|
+
import type { Receipt, SubmitReceiptParams, UpdateReceiptParams, Page, ListParams, RequestOptions, AutoPaginateOptions, TypedSubmitReceiptParams } from '../types.js';
|
|
7
|
+
export declare class ReceiptsResource {
|
|
8
|
+
private readonly http;
|
|
9
|
+
constructor(http: HttpClient);
|
|
10
|
+
/**
|
|
11
|
+
* Submit a receipt. When the mandate's contract type is known,
|
|
12
|
+
* pass a generic to get typed `evidence` fields.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* client.receipts.submit<'ACH-DATA-v1'>(mandateId, {
|
|
16
|
+
* agentId: 'agent-1',
|
|
17
|
+
* evidence: { deliverable: '/out.parquet', deliverable_type: 'file_ref', row_count: 50000 },
|
|
18
|
+
* });
|
|
19
|
+
*/
|
|
20
|
+
submit<T extends string>(mandateId: string, params: TypedSubmitReceiptParams<T>, options?: RequestOptions): Promise<Receipt>;
|
|
21
|
+
submit(mandateId: string, params: SubmitReceiptParams, options?: RequestOptions): Promise<Receipt>;
|
|
22
|
+
get(mandateId: string, receiptId: string, options?: RequestOptions): Promise<Receipt>;
|
|
23
|
+
list(mandateId: string, params?: ListParams, options?: RequestOptions): Promise<Page<Receipt>>;
|
|
24
|
+
/** Auto-paginating iterator. Yields individual receipts. */
|
|
25
|
+
listAll(mandateId: string, params?: ListParams, options?: RequestOptions & AutoPaginateOptions): AsyncGenerator<Receipt>;
|
|
26
|
+
update(mandateId: string, receiptId: string, params: UpdateReceiptParams, options?: RequestOptions): Promise<Receipt>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=receipts.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Receipts Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
export class ReceiptsResource {
|
|
6
|
+
http;
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
async submit(mandateId, params, options) {
|
|
11
|
+
return this.http.post(`/v1/mandates/${mandateId}/receipts`, params, options);
|
|
12
|
+
}
|
|
13
|
+
async get(mandateId, receiptId, options) {
|
|
14
|
+
return this.http.get(`/v1/mandates/${mandateId}/receipts/${receiptId}`, undefined, options);
|
|
15
|
+
}
|
|
16
|
+
async list(mandateId, params, options) {
|
|
17
|
+
return this.http.getPage(`/v1/mandates/${mandateId}/receipts`, params, options);
|
|
18
|
+
}
|
|
19
|
+
/** Auto-paginating iterator. Yields individual receipts. */
|
|
20
|
+
listAll(mandateId, params, options) {
|
|
21
|
+
return this.http.paginate(`/v1/mandates/${mandateId}/receipts`, params, options);
|
|
22
|
+
}
|
|
23
|
+
async update(mandateId, receiptId, params, options) {
|
|
24
|
+
return this.http.patch(`/v1/mandates/${mandateId}/receipts/${receiptId}`, params, options);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=receipts.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Registration & Auth Resource
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import type { HttpClient } from '../http.js';
|
|
6
|
+
import type { RegisterParams, RegisterResult, AccountProfile, RequestOptions } from '../types.js';
|
|
7
|
+
export declare class RegistrationResource {
|
|
8
|
+
private readonly http;
|
|
9
|
+
constructor(http: HttpClient);
|
|
10
|
+
/** Get the authenticated account profile. */
|
|
11
|
+
getMe(options?: RequestOptions): Promise<AccountProfile>;
|
|
12
|
+
/** Register a new account (enterprise or agent). */
|
|
13
|
+
register(params: RegisterParams, options?: RequestOptions): Promise<RegisterResult>;
|
|
14
|
+
/** Register an enterprise account. */
|
|
15
|
+
registerEnterprise(params: Record<string, unknown>, options?: RequestOptions): Promise<RegisterResult>;
|
|
16
|
+
/** Register an agent account. */
|
|
17
|
+
registerAgent(params: Record<string, unknown>, options?: RequestOptions): Promise<RegisterResult>;
|
|
18
|
+
/** Verify an agent via A2A AgentCard URL. */
|
|
19
|
+
verifyAgentCard(agentCardUrl: string, options?: RequestOptions): Promise<Record<string, unknown>>;
|
|
20
|
+
/** Rotate the current API key. Old key is immediately revoked. */
|
|
21
|
+
rotateApiKey(options?: RequestOptions): Promise<{
|
|
22
|
+
apiKey: string;
|
|
23
|
+
}>;
|
|
24
|
+
/** Verify email address with token. */
|
|
25
|
+
verifyEmail(token: string, options?: RequestOptions): Promise<{
|
|
26
|
+
sandboxMode: boolean;
|
|
27
|
+
status: string;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=registration.d.ts.map
|