@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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGLedger™ SDK — Enterprises Resource (Agent Approval Registry)
|
|
3
|
+
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
export class EnterprisesResource {
|
|
6
|
+
http;
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
/** Approve an agent for an enterprise (idempotent PUT). */
|
|
11
|
+
async approveAgent(enterpriseId, agentId, params, options) {
|
|
12
|
+
return this.http.put(`/v1/enterprises/${enterpriseId}/agents/${agentId}`, params, options);
|
|
13
|
+
}
|
|
14
|
+
/** Revoke an agent's approval for an enterprise. */
|
|
15
|
+
async revokeAgent(enterpriseId, agentId, params, options) {
|
|
16
|
+
return this.http.delete(`/v1/enterprises/${enterpriseId}/agents/${agentId}`, params, options);
|
|
17
|
+
}
|
|
18
|
+
/** Update an agent's status (e.g., suspend or reactivate). */
|
|
19
|
+
async updateAgentStatus(enterpriseId, agentId, params, options) {
|
|
20
|
+
return this.http.patch(`/v1/enterprises/${enterpriseId}/agents/${agentId}`, params, options);
|
|
21
|
+
}
|
|
22
|
+
/** Approve multiple agents at once. */
|
|
23
|
+
async bulkApprove(enterpriseId, params, options) {
|
|
24
|
+
return this.http.post(`/v1/enterprises/${enterpriseId}/agents/bulk`, params, options);
|
|
25
|
+
}
|
|
26
|
+
/** List agents for an enterprise, optionally filtered by status. */
|
|
27
|
+
async listAgents(enterpriseId, params, options) {
|
|
28
|
+
return this.http.getPage(`/v1/enterprises/${enterpriseId}/agents`, params, options);
|
|
29
|
+
}
|
|
30
|
+
/** Get a single agent's approval record. */
|
|
31
|
+
async getAgent(enterpriseId, agentId, options) {
|
|
32
|
+
return this.http.get(`/v1/enterprises/${enterpriseId}/agents/${agentId}`, undefined, options);
|
|
33
|
+
}
|
|
34
|
+
/** Get the enterprise's agent approval configuration. */
|
|
35
|
+
async getApprovalConfig(enterpriseId, options) {
|
|
36
|
+
return this.http.get(`/v1/enterprises/${enterpriseId}/approval-config`, undefined, options);
|
|
37
|
+
}
|
|
38
|
+
/** Set the enterprise's agent approval configuration. */
|
|
39
|
+
async setApprovalConfig(enterpriseId, params, options) {
|
|
40
|
+
return this.http.put(`/v1/enterprises/${enterpriseId}/approval-config`, params, options);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=enterprises.js.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
import type { HttpClient } from '../http.js';
|
|
6
|
-
import type { AgledgerEvent, AuditChain, Page, ListParams, RequestOptions } from '../types.js';
|
|
6
|
+
import type { AgledgerEvent, AuditChain, Page, ListParams, RequestOptions, AutoPaginateOptions } from '../types.js';
|
|
7
7
|
export declare class EventsResource {
|
|
8
8
|
private readonly http;
|
|
9
9
|
constructor(http: HttpClient);
|
|
@@ -15,6 +15,11 @@ export declare class EventsResource {
|
|
|
15
15
|
since: string;
|
|
16
16
|
order?: 'asc' | 'desc';
|
|
17
17
|
} & ListParams, options?: RequestOptions): Promise<Page<AgledgerEvent>>;
|
|
18
|
+
/** Auto-paginating iterator. Yields individual events across all pages. */
|
|
19
|
+
listAll(params: {
|
|
20
|
+
since: string;
|
|
21
|
+
order?: 'asc' | 'desc';
|
|
22
|
+
} & ListParams, options?: RequestOptions & AutoPaginateOptions): AsyncGenerator<AgledgerEvent>;
|
|
18
23
|
/** Get the hash-chained audit trail for a mandate. */
|
|
19
24
|
getAuditChain(mandateId: string, options?: RequestOptions): Promise<AuditChain>;
|
|
20
25
|
}
|
package/dist/resources/events.js
CHANGED
|
@@ -14,6 +14,10 @@ export class EventsResource {
|
|
|
14
14
|
async list(params, options) {
|
|
15
15
|
return this.http.getPage('/v1/events', params, options);
|
|
16
16
|
}
|
|
17
|
+
/** Auto-paginating iterator. Yields individual events across all pages. */
|
|
18
|
+
listAll(params, options) {
|
|
19
|
+
return this.http.paginate('/v1/events', params, options);
|
|
20
|
+
}
|
|
17
21
|
/** Get the hash-chained audit trail for a mandate. */
|
|
18
22
|
async getAuditChain(mandateId, options) {
|
|
19
23
|
return this.http.get(`/v1/mandates/${mandateId}/audit`, undefined, options);
|
|
@@ -7,7 +7,9 @@ import type { HealthResponse, StatusResponse, ConformanceResponse, RequestOption
|
|
|
7
7
|
export declare class HealthResource {
|
|
8
8
|
private readonly http;
|
|
9
9
|
constructor(http: HttpClient);
|
|
10
|
+
/** Quick health check (GET /health). */
|
|
10
11
|
check(options?: RequestOptions): Promise<HealthResponse>;
|
|
12
|
+
/** Get detailed system status with component health (GET /status). */
|
|
11
13
|
status(options?: RequestOptions): Promise<StatusResponse>;
|
|
12
14
|
/** Get platform conformance info (protocol version, features, limits). */
|
|
13
15
|
conformance(options?: RequestOptions): Promise<ConformanceResponse>;
|
package/dist/resources/health.js
CHANGED
|
@@ -7,9 +7,11 @@ export class HealthResource {
|
|
|
7
7
|
constructor(http) {
|
|
8
8
|
this.http = http;
|
|
9
9
|
}
|
|
10
|
+
/** Quick health check (GET /health). */
|
|
10
11
|
async check(options) {
|
|
11
12
|
return this.http.get('/health', undefined, options);
|
|
12
13
|
}
|
|
14
|
+
/** Get detailed system status with component health (GET /status). */
|
|
13
15
|
async status(options) {
|
|
14
16
|
return this.http.get('/status', undefined, options);
|
|
15
17
|
}
|
|
@@ -15,13 +15,19 @@ export declare class MandatesResource {
|
|
|
15
15
|
create(params: CreateMandateParams, options?: RequestOptions): Promise<Mandate>;
|
|
16
16
|
/** Create a mandate via agent auth (POST /v1/mandates/agent). */
|
|
17
17
|
createAgent(params: CreateAgentMandateParams, options?: RequestOptions): Promise<Mandate>;
|
|
18
|
+
/** Get a mandate by ID. */
|
|
18
19
|
get(id: string, options?: RequestOptions): Promise<Mandate>;
|
|
20
|
+
/** List mandates with optional filters. */
|
|
19
21
|
list(params: ListMandatesParams, options?: RequestOptions): Promise<Page<Mandate>>;
|
|
20
22
|
/** Auto-paginating iterator. Yields individual mandates across all pages. */
|
|
21
23
|
listAll(params: ListMandatesParams, options?: RequestOptions & AutoPaginateOptions): AsyncGenerator<Mandate>;
|
|
24
|
+
/** Search mandates with advanced filters (status, contract type, date range). */
|
|
22
25
|
search(params: SearchMandatesParams, options?: RequestOptions): Promise<Page<Mandate>>;
|
|
26
|
+
/** Update a mandate's mutable fields. */
|
|
23
27
|
update(id: string, params: UpdateMandateParams, options?: RequestOptions): Promise<Mandate>;
|
|
28
|
+
/** Transition a mandate to a new state (register, activate, settle, cancel, refund). */
|
|
24
29
|
transition(id: string, action: MandateTransitionAction, reason?: string, options?: RequestOptions): Promise<Mandate>;
|
|
30
|
+
/** Cancel a mandate with an optional reason. */
|
|
25
31
|
cancel(id: string, reason?: string, options?: RequestOptions): Promise<Mandate>;
|
|
26
32
|
/** Accept a PROPOSED mandate (as performer). */
|
|
27
33
|
accept(id: string, options?: RequestOptions): Promise<Mandate>;
|
|
@@ -37,6 +43,7 @@ export declare class MandatesResource {
|
|
|
37
43
|
getSubMandates(id: string, options?: RequestOptions): Promise<Page<Mandate>>;
|
|
38
44
|
/** Delegate a mandate by creating a child mandate via agent auth. */
|
|
39
45
|
delegate(id: string, params: DelegateMandateParams, options?: RequestOptions): Promise<Mandate>;
|
|
46
|
+
/** Create multiple mandates in a single request. */
|
|
40
47
|
bulkCreate(mandates: CreateMandateParams[], options?: RequestOptions): Promise<BulkCreateResult>;
|
|
41
48
|
/** Get audit trail for a mandate. */
|
|
42
49
|
getAudit(id: string, options?: RequestOptions): Promise<Record<string, unknown>>;
|
|
@@ -44,5 +51,11 @@ export declare class MandatesResource {
|
|
|
44
51
|
listAsPrincipal(options?: RequestOptions): Promise<Page<Mandate>>;
|
|
45
52
|
/** List mandates proposed to the authenticated agent. */
|
|
46
53
|
listProposals(options?: RequestOptions): Promise<Page<Mandate>>;
|
|
54
|
+
/** Request revision after principal rejection (rework loop). Principal only. */
|
|
55
|
+
requestRevision(id: string, reason?: string, options?: RequestOptions): Promise<Mandate>;
|
|
56
|
+
/** Create a mandate and immediately activate it. Three API calls (create → register → activate) — if a step fails, the mandate ID is in the error. */
|
|
57
|
+
createAndActivate(params: CreateMandateParams, options?: RequestOptions): Promise<Mandate>;
|
|
58
|
+
/** Get valid transitions for a mandate's current status. Client-side lookup, no API call. */
|
|
59
|
+
getValidTransitions(mandate: Mandate): readonly string[];
|
|
47
60
|
}
|
|
48
61
|
//# sourceMappingURL=mandates.d.ts.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* AGLedger™ SDK — Mandates Resource
|
|
3
3
|
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
4
4
|
*/
|
|
5
|
+
import { getValidTransitions as getTransitions } from '../mandate-lifecycle.js';
|
|
5
6
|
export class MandatesResource {
|
|
6
7
|
http;
|
|
7
8
|
constructor(http) {
|
|
@@ -14,9 +15,11 @@ export class MandatesResource {
|
|
|
14
15
|
async createAgent(params, options) {
|
|
15
16
|
return this.http.post('/v1/mandates/agent', params, options);
|
|
16
17
|
}
|
|
18
|
+
/** Get a mandate by ID. */
|
|
17
19
|
async get(id, options) {
|
|
18
20
|
return this.http.get(`/v1/mandates/${id}`, undefined, options);
|
|
19
21
|
}
|
|
22
|
+
/** List mandates with optional filters. */
|
|
20
23
|
async list(params, options) {
|
|
21
24
|
return this.http.getPage('/v1/mandates', params, options);
|
|
22
25
|
}
|
|
@@ -24,28 +27,32 @@ export class MandatesResource {
|
|
|
24
27
|
listAll(params, options) {
|
|
25
28
|
return this.http.paginate('/v1/mandates', params, options);
|
|
26
29
|
}
|
|
30
|
+
/** Search mandates with advanced filters (status, contract type, date range). */
|
|
27
31
|
async search(params, options) {
|
|
28
32
|
return this.http.getPage('/v1/mandates/search', params, options);
|
|
29
33
|
}
|
|
34
|
+
/** Update a mandate's mutable fields. */
|
|
30
35
|
async update(id, params, options) {
|
|
31
36
|
return this.http.patch(`/v1/mandates/${id}`, params, options);
|
|
32
37
|
}
|
|
38
|
+
/** Transition a mandate to a new state (register, activate, settle, cancel, refund). */
|
|
33
39
|
async transition(id, action, reason, options) {
|
|
34
40
|
const body = { action };
|
|
35
41
|
if (reason)
|
|
36
42
|
body.reason = reason;
|
|
37
43
|
return this.http.post(`/v1/mandates/${id}/transition`, body, options);
|
|
38
44
|
}
|
|
45
|
+
/** Cancel a mandate with an optional reason. */
|
|
39
46
|
async cancel(id, reason, options) {
|
|
40
47
|
return this.transition(id, 'cancel', reason, options);
|
|
41
48
|
}
|
|
42
49
|
/** Accept a PROPOSED mandate (as performer). */
|
|
43
50
|
async accept(id, options) {
|
|
44
|
-
return this.http.post(`/v1/mandates/${id}/accept`,
|
|
51
|
+
return this.http.post(`/v1/mandates/${id}/accept`, {}, options);
|
|
45
52
|
}
|
|
46
53
|
/** Reject a PROPOSED mandate (as performer). */
|
|
47
54
|
async reject(id, reason, options) {
|
|
48
|
-
return this.http.post(`/v1/mandates/${id}/reject`, reason ? { reason } :
|
|
55
|
+
return this.http.post(`/v1/mandates/${id}/reject`, reason ? { reason } : {}, options);
|
|
49
56
|
}
|
|
50
57
|
/** Respond to a PROPOSED mandate (accept, reject, or counter). */
|
|
51
58
|
async respond(id, params, options) {
|
|
@@ -53,7 +60,7 @@ export class MandatesResource {
|
|
|
53
60
|
}
|
|
54
61
|
/** Accept a counter-proposal on a mandate. */
|
|
55
62
|
async acceptCounter(id, options) {
|
|
56
|
-
return this.http.post(`/v1/mandates/${id}/accept-counter`,
|
|
63
|
+
return this.http.post(`/v1/mandates/${id}/accept-counter`, {}, options);
|
|
57
64
|
}
|
|
58
65
|
/** Get the full delegation chain for a mandate. */
|
|
59
66
|
async getChain(id, options) {
|
|
@@ -70,6 +77,7 @@ export class MandatesResource {
|
|
|
70
77
|
parentMandateId: id,
|
|
71
78
|
}, options);
|
|
72
79
|
}
|
|
80
|
+
/** Create multiple mandates in a single request. */
|
|
73
81
|
async bulkCreate(mandates, options) {
|
|
74
82
|
return this.http.post('/v1/mandates/bulk', { mandates }, options);
|
|
75
83
|
}
|
|
@@ -85,5 +93,19 @@ export class MandatesResource {
|
|
|
85
93
|
async listProposals(options) {
|
|
86
94
|
return this.http.getPage('/v1/mandates/agent/proposals', undefined, options);
|
|
87
95
|
}
|
|
96
|
+
/** Request revision after principal rejection (rework loop). Principal only. */
|
|
97
|
+
async requestRevision(id, reason, options) {
|
|
98
|
+
return this.http.post(`/v1/mandates/${id}/revision`, reason ? { reason } : {}, options);
|
|
99
|
+
}
|
|
100
|
+
/** Create a mandate and immediately activate it. Three API calls (create → register → activate) — if a step fails, the mandate ID is in the error. */
|
|
101
|
+
async createAndActivate(params, options) {
|
|
102
|
+
const mandate = await this.create(params, options);
|
|
103
|
+
await this.transition(mandate.id, 'register', undefined, options);
|
|
104
|
+
return this.transition(mandate.id, 'activate', undefined, options);
|
|
105
|
+
}
|
|
106
|
+
/** Get valid transitions for a mandate's current status. Client-side lookup, no API call. */
|
|
107
|
+
getValidTransitions(mandate) {
|
|
108
|
+
return getTransitions(mandate.status);
|
|
109
|
+
}
|
|
88
110
|
}
|
|
89
111
|
//# sourceMappingURL=mandates.js.map
|
|
@@ -8,13 +8,21 @@ import type { NotarizedMandate, NotarizeMandateParams, NotarizeMandateResult, No
|
|
|
8
8
|
export declare class NotarizeResource {
|
|
9
9
|
private readonly http;
|
|
10
10
|
constructor(http: HttpClient);
|
|
11
|
+
/** Create a notarized mandate (principal action). */
|
|
11
12
|
createMandate(params: NotarizeMandateParams, options?: RequestOptions): Promise<NotarizeMandateResult>;
|
|
13
|
+
/** Get a notarized mandate by ID. */
|
|
12
14
|
getMandate(id: string, options?: RequestOptions): Promise<NotarizedMandate>;
|
|
15
|
+
/** Get the transition history for a notarized mandate. */
|
|
13
16
|
getHistory(id: string, options?: RequestOptions): Promise<NotarizeHistory>;
|
|
17
|
+
/** Accept a notarized mandate (performer action). */
|
|
14
18
|
acceptMandate(id: string, options?: RequestOptions): Promise<NotarizedMandate>;
|
|
19
|
+
/** Counter-propose new terms for a notarized mandate (performer action). */
|
|
15
20
|
counterPropose(id: string, params: NotarizeCounterProposeParams, options?: RequestOptions): Promise<NotarizeMandateResult>;
|
|
21
|
+
/** Submit a receipt against a notarized mandate (performer action). */
|
|
16
22
|
submitReceipt(id: string, params: NotarizeReceiptParams, options?: RequestOptions): Promise<NotarizeReceiptResult>;
|
|
23
|
+
/** Render a verdict on a notarized mandate (principal action). */
|
|
17
24
|
renderVerdict(id: string, params: NotarizeVerdictParams, options?: RequestOptions): Promise<NotarizedMandate>;
|
|
25
|
+
/** Verify that a local copy matches the notarized hash. */
|
|
18
26
|
verify(params: NotarizeVerifyParams, options?: RequestOptions): Promise<NotarizeVerifyResult>;
|
|
19
27
|
}
|
|
20
28
|
//# sourceMappingURL=notarize.d.ts.map
|
|
@@ -8,35 +8,35 @@ export class NotarizeResource {
|
|
|
8
8
|
constructor(http) {
|
|
9
9
|
this.http = http;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
/** Create a notarized mandate (principal action). */
|
|
12
12
|
async createMandate(params, options) {
|
|
13
13
|
return this.http.post('/v1/notarize/mandates', params, options);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
/** Get a notarized mandate by ID. */
|
|
16
16
|
async getMandate(id, options) {
|
|
17
17
|
return this.http.get(`/v1/notarize/mandates/${id}`, undefined, options);
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
/** Get the transition history for a notarized mandate. */
|
|
20
20
|
async getHistory(id, options) {
|
|
21
21
|
return this.http.get(`/v1/notarize/mandates/${id}/history`, undefined, options);
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
/** Accept a notarized mandate (performer action). */
|
|
24
24
|
async acceptMandate(id, options) {
|
|
25
25
|
return this.http.post(`/v1/notarize/mandates/${id}/accept`, undefined, options);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
/** Counter-propose new terms for a notarized mandate (performer action). */
|
|
28
28
|
async counterPropose(id, params, options) {
|
|
29
29
|
return this.http.post(`/v1/notarize/mandates/${id}/counter-propose`, params, options);
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
/** Submit a receipt against a notarized mandate (performer action). */
|
|
32
32
|
async submitReceipt(id, params, options) {
|
|
33
33
|
return this.http.post(`/v1/notarize/mandates/${id}/receipts`, params, options);
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
/** Render a verdict on a notarized mandate (principal action). */
|
|
36
36
|
async renderVerdict(id, params, options) {
|
|
37
37
|
return this.http.post(`/v1/notarize/mandates/${id}/verdict`, params, options);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
/** Verify that a local copy matches the notarized hash. */
|
|
40
40
|
async verify(params, options) {
|
|
41
41
|
return this.http.post('/v1/notarize/verify', params, options);
|
|
42
42
|
}
|
|
@@ -10,54 +10,70 @@ import type { ProxySession, CreateSessionParams, SyncSessionParams, SyncSessionR
|
|
|
10
10
|
export declare class ProxySessionsResource {
|
|
11
11
|
private readonly http;
|
|
12
12
|
constructor(http: HttpClient);
|
|
13
|
+
/** Create a new proxy session. */
|
|
13
14
|
create(params: CreateSessionParams, options?: RequestOptions): Promise<ProxySession>;
|
|
15
|
+
/** Get a proxy session by ID. */
|
|
14
16
|
get(sessionId: string, options?: RequestOptions): Promise<ProxySession>;
|
|
17
|
+
/** List proxy sessions. */
|
|
15
18
|
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
|
-
*/
|
|
19
|
+
/** Unified sync: session + tool calls + sidecar mandates + sidecar receipts + tool catalog in a single request. */
|
|
20
20
|
sync(params: SyncSessionParams, options?: RequestOptions): Promise<SyncSessionResult>;
|
|
21
21
|
}
|
|
22
22
|
export declare class ProxyToolCallsResource {
|
|
23
23
|
private readonly http;
|
|
24
24
|
constructor(http: HttpClient);
|
|
25
|
+
/** Ingest a batch of tool calls for a session. */
|
|
25
26
|
ingest(sessionId: string, items: ToolCallBatchItem[], options?: RequestOptions): Promise<BatchResult<ProxyToolCall>>;
|
|
27
|
+
/** List tool calls for a session. */
|
|
26
28
|
list(sessionId: string, params?: ListParams, options?: RequestOptions): Promise<Page<ProxyToolCall>>;
|
|
27
29
|
}
|
|
28
30
|
export declare class ProxySidecarMandatesResource {
|
|
29
31
|
private readonly http;
|
|
30
32
|
constructor(http: HttpClient);
|
|
33
|
+
/** Ingest a batch of sidecar mandates for a session. */
|
|
31
34
|
ingest(sessionId: string, items: SidecarMandateBatchItem[], options?: RequestOptions): Promise<BatchResult<ProxySidecarMandate>>;
|
|
35
|
+
/** List sidecar mandates across sessions, optionally filtered by sessionId. */
|
|
32
36
|
list(params?: ListParams & {
|
|
33
37
|
sessionId?: string;
|
|
34
38
|
}, options?: RequestOptions): Promise<Page<ProxySidecarMandate>>;
|
|
39
|
+
/** List sidecar mandates for a specific session. */
|
|
35
40
|
listBySession(sessionId: string, params?: ListParams, options?: RequestOptions): Promise<Page<ProxySidecarMandate>>;
|
|
41
|
+
/** Update a sidecar mandate (e.g., formalize or dismiss). */
|
|
36
42
|
update(id: string, params: UpdateSidecarMandateParams, options?: RequestOptions): Promise<ProxySidecarMandate>;
|
|
43
|
+
/** Formalize a sidecar mandate by linking it to a backend mandate ID. */
|
|
37
44
|
formalize(id: string, formalizedMandateId: string, options?: RequestOptions): Promise<ProxySidecarMandate>;
|
|
45
|
+
/** Dismiss a sidecar mandate (mark as not actionable). */
|
|
38
46
|
dismiss(id: string, options?: RequestOptions): Promise<ProxySidecarMandate>;
|
|
39
47
|
}
|
|
40
48
|
export declare class ProxySidecarReceiptsResource {
|
|
41
49
|
private readonly http;
|
|
42
50
|
constructor(http: HttpClient);
|
|
51
|
+
/** Ingest a batch of sidecar receipts for a session. */
|
|
43
52
|
ingest(sessionId: string, items: SidecarReceiptBatchItem[], options?: RequestOptions): Promise<BatchResult<ProxySidecarReceipt>>;
|
|
53
|
+
/** List sidecar receipts for a specific session. */
|
|
44
54
|
listBySession(sessionId: string, params?: ListParams, options?: RequestOptions): Promise<Page<ProxySidecarReceipt>>;
|
|
45
55
|
}
|
|
46
56
|
export declare class ProxyToolCatalogResource {
|
|
47
57
|
private readonly http;
|
|
48
58
|
constructor(http: HttpClient);
|
|
59
|
+
/** Ingest a batch of tool catalog entries for a session. */
|
|
49
60
|
ingest(sessionId: string, items: ToolCatalogBatchItem[], options?: RequestOptions): Promise<BatchResult<ProxyToolCatalogEntry>>;
|
|
61
|
+
/** List tool catalog entries for a session. */
|
|
50
62
|
list(sessionId: string, options?: RequestOptions): Promise<Page<ProxyToolCatalogEntry>>;
|
|
51
63
|
}
|
|
52
64
|
export declare class ProxyAnalyticsResource {
|
|
53
65
|
private readonly http;
|
|
54
66
|
constructor(http: HttpClient);
|
|
67
|
+
/** Get analytics for a specific session. */
|
|
55
68
|
getSession(sessionId: string, options?: RequestOptions): Promise<SessionAnalytics>;
|
|
69
|
+
/** Get aggregated analytics summary across sessions. */
|
|
56
70
|
getSummary(params?: {
|
|
57
71
|
from?: string;
|
|
58
72
|
to?: string;
|
|
59
73
|
}, options?: RequestOptions): Promise<AnalyticsSummary>;
|
|
74
|
+
/** Get mandate summary for a session (detected vs formalized counts). */
|
|
60
75
|
getMandateSummary(sessionId: string, options?: RequestOptions): Promise<MandateSummary>;
|
|
76
|
+
/** Get alignment analysis for a session (coverage gaps, missing categories). */
|
|
61
77
|
getAlignment(sessionId: string, options?: RequestOptions): Promise<AlignmentAnalysis>;
|
|
62
78
|
}
|
|
63
79
|
export declare class ProxyResource {
|
package/dist/resources/proxy.js
CHANGED
|
@@ -13,19 +13,19 @@ export class ProxySessionsResource {
|
|
|
13
13
|
constructor(http) {
|
|
14
14
|
this.http = http;
|
|
15
15
|
}
|
|
16
|
+
/** Create a new proxy session. */
|
|
16
17
|
async create(params, options) {
|
|
17
18
|
return this.http.post('/v1/proxy/sessions', params, options);
|
|
18
19
|
}
|
|
20
|
+
/** Get a proxy session by ID. */
|
|
19
21
|
async get(sessionId, options) {
|
|
20
22
|
return this.http.get(`/v1/proxy/sessions/${sessionId}`, undefined, options);
|
|
21
23
|
}
|
|
24
|
+
/** List proxy sessions. */
|
|
22
25
|
async list(params, options) {
|
|
23
26
|
return this.http.getPage('/v1/proxy/sessions', params, options);
|
|
24
27
|
}
|
|
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
|
-
*/
|
|
28
|
+
/** Unified sync: session + tool calls + sidecar mandates + sidecar receipts + tool catalog in a single request. */
|
|
29
29
|
async sync(params, options) {
|
|
30
30
|
return this.http.post('/v1/proxy/sync', params, { ...options, timeout: options?.timeout ?? 60_000 });
|
|
31
31
|
}
|
|
@@ -38,9 +38,11 @@ export class ProxyToolCallsResource {
|
|
|
38
38
|
constructor(http) {
|
|
39
39
|
this.http = http;
|
|
40
40
|
}
|
|
41
|
+
/** Ingest a batch of tool calls for a session. */
|
|
41
42
|
async ingest(sessionId, items, options) {
|
|
42
43
|
return this.http.post(`/v1/proxy/sessions/${sessionId}/tool-calls`, { items }, options);
|
|
43
44
|
}
|
|
45
|
+
/** List tool calls for a session. */
|
|
44
46
|
async list(sessionId, params, options) {
|
|
45
47
|
return this.http.getPage(`/v1/proxy/sessions/${sessionId}/tool-calls`, params, options);
|
|
46
48
|
}
|
|
@@ -53,21 +55,27 @@ export class ProxySidecarMandatesResource {
|
|
|
53
55
|
constructor(http) {
|
|
54
56
|
this.http = http;
|
|
55
57
|
}
|
|
58
|
+
/** Ingest a batch of sidecar mandates for a session. */
|
|
56
59
|
async ingest(sessionId, items, options) {
|
|
57
60
|
return this.http.post(`/v1/proxy/sessions/${sessionId}/sidecar-mandates`, { items }, options);
|
|
58
61
|
}
|
|
62
|
+
/** List sidecar mandates across sessions, optionally filtered by sessionId. */
|
|
59
63
|
async list(params, options) {
|
|
60
64
|
return this.http.getPage('/v1/proxy/sidecar-mandates', params, options);
|
|
61
65
|
}
|
|
66
|
+
/** List sidecar mandates for a specific session. */
|
|
62
67
|
async listBySession(sessionId, params, options) {
|
|
63
68
|
return this.http.getPage(`/v1/proxy/sessions/${sessionId}/sidecar-mandates`, params, options);
|
|
64
69
|
}
|
|
70
|
+
/** Update a sidecar mandate (e.g., formalize or dismiss). */
|
|
65
71
|
async update(id, params, options) {
|
|
66
72
|
return this.http.patch(`/v1/proxy/sidecar-mandates/${id}`, params, options);
|
|
67
73
|
}
|
|
74
|
+
/** Formalize a sidecar mandate by linking it to a backend mandate ID. */
|
|
68
75
|
async formalize(id, formalizedMandateId, options) {
|
|
69
76
|
return this.update(id, { status: 'FORMALIZED', formalizedMandateId }, options);
|
|
70
77
|
}
|
|
78
|
+
/** Dismiss a sidecar mandate (mark as not actionable). */
|
|
71
79
|
async dismiss(id, options) {
|
|
72
80
|
return this.update(id, { status: 'DISMISSED' }, options);
|
|
73
81
|
}
|
|
@@ -80,9 +88,11 @@ export class ProxySidecarReceiptsResource {
|
|
|
80
88
|
constructor(http) {
|
|
81
89
|
this.http = http;
|
|
82
90
|
}
|
|
91
|
+
/** Ingest a batch of sidecar receipts for a session. */
|
|
83
92
|
async ingest(sessionId, items, options) {
|
|
84
93
|
return this.http.post(`/v1/proxy/sessions/${sessionId}/sidecar-receipts`, { items }, options);
|
|
85
94
|
}
|
|
95
|
+
/** List sidecar receipts for a specific session. */
|
|
86
96
|
async listBySession(sessionId, params, options) {
|
|
87
97
|
return this.http.getPage(`/v1/proxy/sessions/${sessionId}/sidecar-receipts`, params, options);
|
|
88
98
|
}
|
|
@@ -95,9 +105,11 @@ export class ProxyToolCatalogResource {
|
|
|
95
105
|
constructor(http) {
|
|
96
106
|
this.http = http;
|
|
97
107
|
}
|
|
108
|
+
/** Ingest a batch of tool catalog entries for a session. */
|
|
98
109
|
async ingest(sessionId, items, options) {
|
|
99
110
|
return this.http.post(`/v1/proxy/sessions/${sessionId}/tool-catalog`, { items }, options);
|
|
100
111
|
}
|
|
112
|
+
/** List tool catalog entries for a session. */
|
|
101
113
|
async list(sessionId, options) {
|
|
102
114
|
return this.http.getPage(`/v1/proxy/sessions/${sessionId}/tool-catalog`, undefined, options);
|
|
103
115
|
}
|
|
@@ -110,15 +122,19 @@ export class ProxyAnalyticsResource {
|
|
|
110
122
|
constructor(http) {
|
|
111
123
|
this.http = http;
|
|
112
124
|
}
|
|
125
|
+
/** Get analytics for a specific session. */
|
|
113
126
|
async getSession(sessionId, options) {
|
|
114
127
|
return this.http.get(`/v1/proxy/sessions/${sessionId}/analytics`, undefined, options);
|
|
115
128
|
}
|
|
129
|
+
/** Get aggregated analytics summary across sessions. */
|
|
116
130
|
async getSummary(params, options) {
|
|
117
131
|
return this.http.get('/v1/proxy/analytics', params, options);
|
|
118
132
|
}
|
|
133
|
+
/** Get mandate summary for a session (detected vs formalized counts). */
|
|
119
134
|
async getMandateSummary(sessionId, options) {
|
|
120
135
|
return this.http.get(`/v1/proxy/sessions/${sessionId}/mandate-summary`, undefined, options);
|
|
121
136
|
}
|
|
137
|
+
/** Get alignment analysis for a session (coverage gaps, missing categories). */
|
|
122
138
|
async getAlignment(sessionId, options) {
|
|
123
139
|
return this.http.get(`/v1/proxy/sessions/${sessionId}/alignment`, undefined, options);
|
|
124
140
|
}
|
|
@@ -7,7 +7,9 @@ import type { ReputationScore, ReputationHistoryEntry, Page, ListParams, Request
|
|
|
7
7
|
export declare class ReputationResource {
|
|
8
8
|
private readonly http;
|
|
9
9
|
constructor(http: HttpClient);
|
|
10
|
+
/** Get the reputation score for an agent. */
|
|
10
11
|
getAgent(agentId: string, options?: RequestOptions): Promise<ReputationScore>;
|
|
12
|
+
/** Get reputation score history for an agent over a time range. */
|
|
11
13
|
getHistory(agentId: string, params?: ListParams & {
|
|
12
14
|
from?: string;
|
|
13
15
|
to?: string;
|
|
@@ -7,9 +7,11 @@ export class ReputationResource {
|
|
|
7
7
|
constructor(http) {
|
|
8
8
|
this.http = http;
|
|
9
9
|
}
|
|
10
|
+
/** Get the reputation score for an agent. */
|
|
10
11
|
async getAgent(agentId, options) {
|
|
11
12
|
return this.http.get(`/v1/agents/${agentId}/reputation`, undefined, options);
|
|
12
13
|
}
|
|
14
|
+
/** Get reputation score history for an agent over a time range. */
|
|
13
15
|
async getHistory(agentId, params, options) {
|
|
14
16
|
return this.http.getPage(`/v1/agents/${agentId}/reputation/history`, params, options);
|
|
15
17
|
}
|
|
@@ -7,8 +7,11 @@ import type { ContractType, ContractSchema, SchemaValidationResult, Page, Reques
|
|
|
7
7
|
export declare class SchemasResource {
|
|
8
8
|
private readonly http;
|
|
9
9
|
constructor(http: HttpClient);
|
|
10
|
+
/** List available contract type schemas. */
|
|
10
11
|
list(options?: RequestOptions): Promise<Page<ContractType>>;
|
|
12
|
+
/** Get the full JSON Schema for a contract type. */
|
|
11
13
|
get(contractType: ContractType, options?: RequestOptions): Promise<ContractSchema>;
|
|
14
|
+
/** Get the verification rules for a contract type. */
|
|
12
15
|
getRules(contractType: ContractType, options?: RequestOptions): Promise<{
|
|
13
16
|
contractType: ContractType;
|
|
14
17
|
syncRuleIds: string[];
|
|
@@ -7,12 +7,15 @@ export class SchemasResource {
|
|
|
7
7
|
constructor(http) {
|
|
8
8
|
this.http = http;
|
|
9
9
|
}
|
|
10
|
+
/** List available contract type schemas. */
|
|
10
11
|
async list(options) {
|
|
11
12
|
return this.http.getPage('/v1/schemas', undefined, options);
|
|
12
13
|
}
|
|
14
|
+
/** Get the full JSON Schema for a contract type. */
|
|
13
15
|
async get(contractType, options) {
|
|
14
16
|
return this.http.get(`/v1/schemas/${contractType}`, undefined, options);
|
|
15
17
|
}
|
|
18
|
+
/** Get the verification rules for a contract type. */
|
|
16
19
|
async getRules(contractType, options) {
|
|
17
20
|
return this.http.get(`/v1/schemas/${contractType}/rules`, undefined, options);
|
|
18
21
|
}
|
|
@@ -7,7 +7,9 @@ import type { VerificationResult, VerificationStatus, RequestOptions } from '../
|
|
|
7
7
|
export declare class VerificationResource {
|
|
8
8
|
private readonly http;
|
|
9
9
|
constructor(http: HttpClient);
|
|
10
|
+
/** Trigger verification for a mandate, optionally specifying receipt IDs. */
|
|
10
11
|
verify(mandateId: string, receiptIds?: string[], options?: RequestOptions): Promise<VerificationResult>;
|
|
12
|
+
/** Get the current verification status for a mandate. */
|
|
11
13
|
getStatus(mandateId: string, options?: RequestOptions): Promise<VerificationStatus>;
|
|
12
14
|
}
|
|
13
15
|
//# sourceMappingURL=verification.d.ts.map
|
|
@@ -7,9 +7,11 @@ export class VerificationResource {
|
|
|
7
7
|
constructor(http) {
|
|
8
8
|
this.http = http;
|
|
9
9
|
}
|
|
10
|
+
/** Trigger verification for a mandate, optionally specifying receipt IDs. */
|
|
10
11
|
async verify(mandateId, receiptIds, options) {
|
|
11
12
|
return this.http.post(`/v1/mandates/${mandateId}/verify`, receiptIds?.length ? { receiptIds } : undefined, options);
|
|
12
13
|
}
|
|
14
|
+
/** Get the current verification status for a mandate. */
|
|
13
15
|
async getStatus(mandateId, options) {
|
|
14
16
|
return this.http.get(`/v1/mandates/${mandateId}/verification-status`, undefined, options);
|
|
15
17
|
}
|
|
@@ -7,10 +7,15 @@ import type { Webhook, CreateWebhookParams, UpdateWebhookParams, WebhookDelivery
|
|
|
7
7
|
export declare class WebhooksResource {
|
|
8
8
|
private readonly http;
|
|
9
9
|
constructor(http: HttpClient);
|
|
10
|
+
/** Register a new webhook endpoint. */
|
|
10
11
|
create(params: CreateWebhookParams, options?: RequestOptions): Promise<Webhook>;
|
|
12
|
+
/** Get a webhook by ID. */
|
|
11
13
|
get(webhookId: string, options?: RequestOptions): Promise<Webhook>;
|
|
14
|
+
/** List all webhooks. */
|
|
12
15
|
list(options?: RequestOptions): Promise<Page<Webhook>>;
|
|
16
|
+
/** Update a webhook's URL or event subscriptions. */
|
|
13
17
|
update(webhookId: string, params: UpdateWebhookParams, options?: RequestOptions): Promise<Webhook>;
|
|
18
|
+
/** Delete a webhook. */
|
|
14
19
|
delete(webhookId: string, options?: RequestOptions): Promise<void>;
|
|
15
20
|
/** Rotate webhook secret. Returns new secret. */
|
|
16
21
|
rotate(webhookId: string, options?: RequestOptions): Promise<{
|
|
@@ -18,6 +23,7 @@ export declare class WebhooksResource {
|
|
|
18
23
|
}>;
|
|
19
24
|
/** Send a test ping to the webhook URL. */
|
|
20
25
|
ping(webhookId: string, options?: RequestOptions): Promise<WebhookTestResult>;
|
|
26
|
+
/** List delivery attempts for a webhook, optionally filtered by status. */
|
|
21
27
|
listDeliveries(webhookId: string, params?: ListParams & {
|
|
22
28
|
status?: string;
|
|
23
29
|
}, options?: RequestOptions): Promise<Page<WebhookDelivery>>;
|
|
@@ -7,20 +7,25 @@ export class WebhooksResource {
|
|
|
7
7
|
constructor(http) {
|
|
8
8
|
this.http = http;
|
|
9
9
|
}
|
|
10
|
+
/** Register a new webhook endpoint. */
|
|
10
11
|
async create(params, options) {
|
|
11
12
|
return this.http.post('/v1/webhooks', params, options);
|
|
12
13
|
}
|
|
14
|
+
/** Get a webhook by ID. */
|
|
13
15
|
async get(webhookId, options) {
|
|
14
16
|
return this.http.get(`/v1/webhooks/${webhookId}`, undefined, options);
|
|
15
17
|
}
|
|
18
|
+
/** List all webhooks. */
|
|
16
19
|
async list(options) {
|
|
17
20
|
return this.http.getPage('/v1/webhooks', undefined, options);
|
|
18
21
|
}
|
|
22
|
+
/** Update a webhook's URL or event subscriptions. */
|
|
19
23
|
async update(webhookId, params, options) {
|
|
20
24
|
return this.http.patch(`/v1/webhooks/${webhookId}`, params, options);
|
|
21
25
|
}
|
|
26
|
+
/** Delete a webhook. */
|
|
22
27
|
async delete(webhookId, options) {
|
|
23
|
-
return this.http.delete(`/v1/webhooks/${webhookId}`, options);
|
|
28
|
+
return this.http.delete(`/v1/webhooks/${webhookId}`, undefined, options);
|
|
24
29
|
}
|
|
25
30
|
/** Rotate webhook secret. Returns new secret. */
|
|
26
31
|
async rotate(webhookId, options) {
|
|
@@ -30,6 +35,7 @@ export class WebhooksResource {
|
|
|
30
35
|
async ping(webhookId, options) {
|
|
31
36
|
return this.http.post(`/v1/webhooks/${webhookId}/ping`, undefined, options);
|
|
32
37
|
}
|
|
38
|
+
/** List delivery attempts for a webhook, optionally filtered by status. */
|
|
33
39
|
async listDeliveries(webhookId, params, options) {
|
|
34
40
|
return this.http.getPage(`/v1/webhooks/${webhookId}/deliveries`, params, options);
|
|
35
41
|
}
|