@conto_finance/sdk 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/index.d.mts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +10 -2
- package/dist/index.mjs +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Conto is a buyer-side control layer. Integrate it in the agent owner's runtime or payment tools;
|
|
4
4
|
the owner or budget holder sets policy before the agent pays.
|
|
5
|
-
See [buyer-side control](https://conto.finance/docs/
|
|
5
|
+
See [buyer-side control](https://conto.finance/docs/introduction/concepts) for the authorization
|
|
6
6
|
and execution boundary.
|
|
7
7
|
|
|
8
8
|
TypeScript SDK for Conto. Use it when you control the agent runtime and want typed access to
|
|
@@ -99,9 +99,9 @@ await admin.cards.resumeForAgent('agent_id', card.id);
|
|
|
99
99
|
await admin.cards.revokeFromAgent('agent_id', card.id);
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
The policy overlay stops at approval, claiming, and reconciliation. For
|
|
103
|
-
|
|
104
|
-
[
|
|
102
|
+
The policy overlay stops at approval, claiming, and reconciliation. For
|
|
103
|
+
connected cards, see
|
|
104
|
+
[Connected cards](https://conto.finance/docs/guides/connected-cards).
|
|
105
105
|
The legacy `conto.cards.controlled()` helper remains available for compatibility. Use
|
|
106
106
|
`admin.cards.listRequests({ status: 'EXECUTING' })` for reconciliation and
|
|
107
107
|
`admin.cards.pause(card.id)` to revoke unclaimed grants and stop new approvals
|
|
@@ -251,7 +251,7 @@ requirements.
|
|
|
251
251
|
For browser checkouts on supported rails (Link, card, Shop Pay, or PayPal), use
|
|
252
252
|
`runGuardedCheckout` with `executionMethod: 'BROWSER_CHECKOUT'`. Other rails and checkout flows are
|
|
253
253
|
not covered. It binds and atomically authorizes one exact Link, card,
|
|
254
|
-
Shop Pay, or PayPal browser action without requiring
|
|
254
|
+
Shop Pay, or PayPal browser action without requiring private provider integration. The
|
|
255
255
|
privileged browser executor must be available only through this wrapper; an unrestricted click or
|
|
256
256
|
payment tool would bypass the control. Persist its stable dispatch attempt before calling the helper; it owns authorization,
|
|
257
257
|
one-use claim, the privileged callback, and finalization. See `docs/AGENT_CHECKOUT_GUARD.md` for the
|
package/dist/index.d.mts
CHANGED
|
@@ -1872,8 +1872,7 @@ interface ProtocolPreAuthorizeResult {
|
|
|
1872
1872
|
/**
|
|
1873
1873
|
* Present when authorized. Pass grantId and grantSignature to record(). A
|
|
1874
1874
|
* record without a valid, unexpired grant is accepted but treated as a policy
|
|
1875
|
-
* bypass: the payment is flagged and the owner is alerted.
|
|
1876
|
-
* can also have the agent frozen automatically.
|
|
1875
|
+
* bypass: the payment is flagged and the owner is alerted.
|
|
1877
1876
|
*/
|
|
1878
1877
|
grantId?: string;
|
|
1879
1878
|
grantSignature?: string;
|
|
@@ -2048,6 +2047,11 @@ interface MppRecordInput extends ProtocolRecordGrant {
|
|
|
2048
2047
|
resourceUrl: string;
|
|
2049
2048
|
credentialId: string;
|
|
2050
2049
|
}>;
|
|
2050
|
+
/**
|
|
2051
|
+
* Send true on the final record of a session (`intent: 'session'`). Conto
|
|
2052
|
+
* closes the session and releases the unused part of its grant.
|
|
2053
|
+
*/
|
|
2054
|
+
closeSession?: boolean;
|
|
2051
2055
|
}
|
|
2052
2056
|
interface MppRecordResult extends ProtocolRecordGrantResult {
|
|
2053
2057
|
recorded: true;
|
|
@@ -2279,7 +2283,7 @@ declare class ControlledExternalCardPaymentTool<TReceipt = unknown> {
|
|
|
2279
2283
|
pay(input: ExternalCardApprovalInput): Promise<ControlledExternalCardPaymentResult<TReceipt>>;
|
|
2280
2284
|
}
|
|
2281
2285
|
/**
|
|
2282
|
-
* Agent client for connected cards (
|
|
2286
|
+
* Agent client for connected cards (Builder and Enterprise plans).
|
|
2283
2287
|
*
|
|
2284
2288
|
* A connected card is a customer card enrolled through the provider and
|
|
2285
2289
|
* delegated to this agent. `draw` mints one single-use credential against a
|
|
@@ -2287,7 +2291,7 @@ declare class ControlledExternalCardPaymentTool<TReceipt = unknown> {
|
|
|
2287
2291
|
* draw against. This is a separate rail from {@link CardsClient}: it does not
|
|
2288
2292
|
* share endpoints, scopes, or types with the external-card policy overlay.
|
|
2289
2293
|
*
|
|
2290
|
-
*
|
|
2294
|
+
* On plans without connected cards, these methods return an upgrade error.
|
|
2291
2295
|
*/
|
|
2292
2296
|
declare class ConnectedCardsClient {
|
|
2293
2297
|
private client;
|
package/dist/index.d.ts
CHANGED
|
@@ -1872,8 +1872,7 @@ interface ProtocolPreAuthorizeResult {
|
|
|
1872
1872
|
/**
|
|
1873
1873
|
* Present when authorized. Pass grantId and grantSignature to record(). A
|
|
1874
1874
|
* record without a valid, unexpired grant is accepted but treated as a policy
|
|
1875
|
-
* bypass: the payment is flagged and the owner is alerted.
|
|
1876
|
-
* can also have the agent frozen automatically.
|
|
1875
|
+
* bypass: the payment is flagged and the owner is alerted.
|
|
1877
1876
|
*/
|
|
1878
1877
|
grantId?: string;
|
|
1879
1878
|
grantSignature?: string;
|
|
@@ -2048,6 +2047,11 @@ interface MppRecordInput extends ProtocolRecordGrant {
|
|
|
2048
2047
|
resourceUrl: string;
|
|
2049
2048
|
credentialId: string;
|
|
2050
2049
|
}>;
|
|
2050
|
+
/**
|
|
2051
|
+
* Send true on the final record of a session (`intent: 'session'`). Conto
|
|
2052
|
+
* closes the session and releases the unused part of its grant.
|
|
2053
|
+
*/
|
|
2054
|
+
closeSession?: boolean;
|
|
2051
2055
|
}
|
|
2052
2056
|
interface MppRecordResult extends ProtocolRecordGrantResult {
|
|
2053
2057
|
recorded: true;
|
|
@@ -2279,7 +2283,7 @@ declare class ControlledExternalCardPaymentTool<TReceipt = unknown> {
|
|
|
2279
2283
|
pay(input: ExternalCardApprovalInput): Promise<ControlledExternalCardPaymentResult<TReceipt>>;
|
|
2280
2284
|
}
|
|
2281
2285
|
/**
|
|
2282
|
-
* Agent client for connected cards (
|
|
2286
|
+
* Agent client for connected cards (Builder and Enterprise plans).
|
|
2283
2287
|
*
|
|
2284
2288
|
* A connected card is a customer card enrolled through the provider and
|
|
2285
2289
|
* delegated to this agent. `draw` mints one single-use credential against a
|
|
@@ -2287,7 +2291,7 @@ declare class ControlledExternalCardPaymentTool<TReceipt = unknown> {
|
|
|
2287
2291
|
* draw against. This is a separate rail from {@link CardsClient}: it does not
|
|
2288
2292
|
* share endpoints, scopes, or types with the external-card policy overlay.
|
|
2289
2293
|
*
|
|
2290
|
-
*
|
|
2294
|
+
* On plans without connected cards, these methods return an upgrade error.
|
|
2291
2295
|
*/
|
|
2292
2296
|
declare class ConnectedCardsClient {
|
|
2293
2297
|
private client;
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var require_package = __commonJS({
|
|
|
39
39
|
"package.json"(exports2, module2) {
|
|
40
40
|
module2.exports = {
|
|
41
41
|
name: "@conto_finance/sdk",
|
|
42
|
-
version: "0.5.
|
|
42
|
+
version: "0.5.3",
|
|
43
43
|
description: "Conto SDK for AI agent payment authorization",
|
|
44
44
|
main: "./dist/index.js",
|
|
45
45
|
module: "./dist/index.mjs",
|
|
@@ -175,7 +175,15 @@ var PUBLIC_PAYMENT_REASONS = /* @__PURE__ */ new Set([
|
|
|
175
175
|
"This payment requires approval before it can proceed.",
|
|
176
176
|
"No usable wallet is linked to this agent.",
|
|
177
177
|
"This payee needs review before payments to it can proceed automatically.",
|
|
178
|
-
"A reviewer declined this payment."
|
|
178
|
+
"A reviewer declined this payment.",
|
|
179
|
+
"This payment is missing a category, which a payment control requires.",
|
|
180
|
+
"This payment is missing the recipient country, which a payment control requires.",
|
|
181
|
+
"This payment is missing the target contract address, which a payment control requires.",
|
|
182
|
+
"This payment is missing the service URL, which a payment control requires.",
|
|
183
|
+
"This payment is missing a session ID, which a payment control requires.",
|
|
184
|
+
"This payment is missing the x402 facilitator, which a payment control requires.",
|
|
185
|
+
"This payment is missing the MPP intent, which a payment control requires.",
|
|
186
|
+
"This payment is missing the MPP payment method, which a payment control requires."
|
|
179
187
|
]);
|
|
180
188
|
function customerPaymentReasons(value) {
|
|
181
189
|
return Array.isArray(value) ? [
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ var require_package = __commonJS({
|
|
|
14
14
|
"package.json"(exports, module) {
|
|
15
15
|
module.exports = {
|
|
16
16
|
name: "@conto_finance/sdk",
|
|
17
|
-
version: "0.5.
|
|
17
|
+
version: "0.5.3",
|
|
18
18
|
description: "Conto SDK for AI agent payment authorization",
|
|
19
19
|
main: "./dist/index.js",
|
|
20
20
|
module: "./dist/index.mjs",
|
|
@@ -131,7 +131,15 @@ var PUBLIC_PAYMENT_REASONS = /* @__PURE__ */ new Set([
|
|
|
131
131
|
"This payment requires approval before it can proceed.",
|
|
132
132
|
"No usable wallet is linked to this agent.",
|
|
133
133
|
"This payee needs review before payments to it can proceed automatically.",
|
|
134
|
-
"A reviewer declined this payment."
|
|
134
|
+
"A reviewer declined this payment.",
|
|
135
|
+
"This payment is missing a category, which a payment control requires.",
|
|
136
|
+
"This payment is missing the recipient country, which a payment control requires.",
|
|
137
|
+
"This payment is missing the target contract address, which a payment control requires.",
|
|
138
|
+
"This payment is missing the service URL, which a payment control requires.",
|
|
139
|
+
"This payment is missing a session ID, which a payment control requires.",
|
|
140
|
+
"This payment is missing the x402 facilitator, which a payment control requires.",
|
|
141
|
+
"This payment is missing the MPP intent, which a payment control requires.",
|
|
142
|
+
"This payment is missing the MPP payment method, which a payment control requires."
|
|
135
143
|
]);
|
|
136
144
|
function customerPaymentReasons(value) {
|
|
137
145
|
return Array.isArray(value) ? [
|