@agentwonderland/mcp 0.1.49 → 0.1.50
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/core/__tests__/payments.test.js +5 -5
- package/dist/core/payments.js +2 -2
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/package.json +1 -1
- package/src/core/__tests__/payments.test.ts +5 -5
- package/src/core/payments.ts +2 -2
- package/src/core/version.ts +1 -1
|
@@ -124,16 +124,16 @@ describe("payment method initialization", () => {
|
|
|
124
124
|
networkId: "profile_test",
|
|
125
125
|
});
|
|
126
126
|
expect(mockCreateLinkSharedPaymentToken).toHaveBeenCalledWith(expect.objectContaining({
|
|
127
|
-
amount: "
|
|
127
|
+
amount: "2000",
|
|
128
128
|
currency: "usd",
|
|
129
129
|
networkId: "profile_test",
|
|
130
130
|
paymentMethodId: "csmrpd_link_123",
|
|
131
131
|
}));
|
|
132
132
|
const linkTokenRequest = mockCreateLinkSharedPaymentToken.mock.calls[0]?.[0];
|
|
133
|
-
expect(linkTokenRequest?.context).toContain("up to USD
|
|
133
|
+
expect(linkTokenRequest?.context).toContain("up to USD 20.00");
|
|
134
134
|
expect(linkTokenRequest?.context).toContain("quoted at USD 0.25");
|
|
135
135
|
});
|
|
136
|
-
it("
|
|
136
|
+
it("allows a low env override while never approving below the quoted amount", async () => {
|
|
137
137
|
process.env.AGENTWONDERLAND_LINK_APPROVAL_LIMIT_CENTS = "10";
|
|
138
138
|
currentLink = {
|
|
139
139
|
paymentMethodId: "csmrpd_link_123",
|
|
@@ -143,13 +143,13 @@ describe("payment method initialization", () => {
|
|
|
143
143
|
await getPaymentFetch("link");
|
|
144
144
|
const stripeConfig = mockStripe.mock.calls[0]?.[0];
|
|
145
145
|
await stripeConfig.createToken({
|
|
146
|
-
amount: "
|
|
146
|
+
amount: "25",
|
|
147
147
|
currency: "usd",
|
|
148
148
|
expiresAt: 1778290000,
|
|
149
149
|
networkId: "profile_test",
|
|
150
150
|
});
|
|
151
151
|
expect(mockCreateLinkSharedPaymentToken).toHaveBeenCalledWith(expect.objectContaining({
|
|
152
|
-
amount: "
|
|
152
|
+
amount: "25",
|
|
153
153
|
}));
|
|
154
154
|
});
|
|
155
155
|
it("advertises Link as Stripe SPT compatibility", async () => {
|
package/dist/core/payments.js
CHANGED
|
@@ -26,7 +26,7 @@ const REGISTRY_METHOD_MAP = {
|
|
|
26
26
|
card: "stripe_card",
|
|
27
27
|
link: "stripe_card",
|
|
28
28
|
};
|
|
29
|
-
const DEFAULT_LINK_APPROVAL_LIMIT_CENTS =
|
|
29
|
+
const DEFAULT_LINK_APPROVAL_LIMIT_CENTS = 2_000;
|
|
30
30
|
const ACCEPTED_PAYMENT_ALIASES = {
|
|
31
31
|
tempo: ["tempo_usdc", "tempo"],
|
|
32
32
|
base: ["base_usdc", "base"],
|
|
@@ -165,7 +165,7 @@ function getLinkApprovalLimitAmount(actualAmount) {
|
|
|
165
165
|
const actualAmountCents = Number(actualAmount);
|
|
166
166
|
const configuredLimit = Number(process.env.AGENTWONDERLAND_LINK_APPROVAL_LIMIT_CENTS);
|
|
167
167
|
const defaultLimit = Number.isFinite(configuredLimit) && configuredLimit > 0
|
|
168
|
-
? Math.
|
|
168
|
+
? Math.floor(configuredLimit)
|
|
169
169
|
: DEFAULT_LINK_APPROVAL_LIMIT_CENTS;
|
|
170
170
|
return String(Math.max(actualAmountCents, defaultLimit));
|
|
171
171
|
}
|
package/dist/core/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MCP_PACKAGE_VERSION = "0.1.
|
|
1
|
+
export declare const MCP_PACKAGE_VERSION = "0.1.50";
|
package/dist/core/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const MCP_PACKAGE_VERSION = "0.1.
|
|
1
|
+
export const MCP_PACKAGE_VERSION = "0.1.50";
|
package/package.json
CHANGED
|
@@ -166,18 +166,18 @@ describe("payment method initialization", () => {
|
|
|
166
166
|
|
|
167
167
|
expect(mockCreateLinkSharedPaymentToken).toHaveBeenCalledWith(
|
|
168
168
|
expect.objectContaining({
|
|
169
|
-
amount: "
|
|
169
|
+
amount: "2000",
|
|
170
170
|
currency: "usd",
|
|
171
171
|
networkId: "profile_test",
|
|
172
172
|
paymentMethodId: "csmrpd_link_123",
|
|
173
173
|
}),
|
|
174
174
|
);
|
|
175
175
|
const linkTokenRequest = mockCreateLinkSharedPaymentToken.mock.calls[0]?.[0] as { context: string } | undefined;
|
|
176
|
-
expect(linkTokenRequest?.context).toContain("up to USD
|
|
176
|
+
expect(linkTokenRequest?.context).toContain("up to USD 20.00");
|
|
177
177
|
expect(linkTokenRequest?.context).toContain("quoted at USD 0.25");
|
|
178
178
|
});
|
|
179
179
|
|
|
180
|
-
it("
|
|
180
|
+
it("allows a low env override while never approving below the quoted amount", async () => {
|
|
181
181
|
process.env.AGENTWONDERLAND_LINK_APPROVAL_LIMIT_CENTS = "10";
|
|
182
182
|
currentLink = {
|
|
183
183
|
paymentMethodId: "csmrpd_link_123",
|
|
@@ -196,7 +196,7 @@ describe("payment method initialization", () => {
|
|
|
196
196
|
}) => Promise<string>;
|
|
197
197
|
};
|
|
198
198
|
await stripeConfig.createToken({
|
|
199
|
-
amount: "
|
|
199
|
+
amount: "25",
|
|
200
200
|
currency: "usd",
|
|
201
201
|
expiresAt: 1778290000,
|
|
202
202
|
networkId: "profile_test",
|
|
@@ -204,7 +204,7 @@ describe("payment method initialization", () => {
|
|
|
204
204
|
|
|
205
205
|
expect(mockCreateLinkSharedPaymentToken).toHaveBeenCalledWith(
|
|
206
206
|
expect.objectContaining({
|
|
207
|
-
amount: "
|
|
207
|
+
amount: "25",
|
|
208
208
|
}),
|
|
209
209
|
);
|
|
210
210
|
});
|
package/src/core/payments.ts
CHANGED
|
@@ -41,7 +41,7 @@ const REGISTRY_METHOD_MAP: Record<string, string> = {
|
|
|
41
41
|
link: "stripe_card",
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const DEFAULT_LINK_APPROVAL_LIMIT_CENTS =
|
|
44
|
+
const DEFAULT_LINK_APPROVAL_LIMIT_CENTS = 2_000;
|
|
45
45
|
|
|
46
46
|
const ACCEPTED_PAYMENT_ALIASES: Record<string, string[]> = {
|
|
47
47
|
tempo: ["tempo_usdc", "tempo"],
|
|
@@ -201,7 +201,7 @@ function getLinkApprovalLimitAmount(actualAmount: string): string {
|
|
|
201
201
|
const actualAmountCents = Number(actualAmount);
|
|
202
202
|
const configuredLimit = Number(process.env.AGENTWONDERLAND_LINK_APPROVAL_LIMIT_CENTS);
|
|
203
203
|
const defaultLimit = Number.isFinite(configuredLimit) && configuredLimit > 0
|
|
204
|
-
? Math.
|
|
204
|
+
? Math.floor(configuredLimit)
|
|
205
205
|
: DEFAULT_LINK_APPROVAL_LIMIT_CENTS;
|
|
206
206
|
return String(Math.max(actualAmountCents, defaultLimit));
|
|
207
207
|
}
|
package/src/core/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const MCP_PACKAGE_VERSION = "0.1.
|
|
1
|
+
export const MCP_PACKAGE_VERSION = "0.1.50";
|