@stripe/link-sdk 0.8.0 → 0.9.1

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tools.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/tools.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,299 @@
1
+ import type { z } from 'zod';
2
+ import type { Link } from '../client';
3
+ export { linkToolSchemas } from './schemas';
4
+ /**
5
+ * Standard Schema tools with no agent-framework dependency. A resolver runs
6
+ * for each execution, so a shared catalog can safely serve multiple users.
7
+ * Credentials are never resolved during tool discovery.
8
+ */
9
+ export declare function createLinkTools<Context = unknown>(client: Link | ((context: Context) => Link | Promise<Link>)): {
10
+ retrieve_user_info: {
11
+ description: string;
12
+ inputSchema: z.ZodObject<{}, z.core.$strict>;
13
+ execute(input: Record<string, never>, context: Context): Promise<import("..").UserInfo>;
14
+ };
15
+ list_payment_methods: {
16
+ description: string;
17
+ inputSchema: z.ZodObject<{}, z.core.$strict>;
18
+ execute(input: Record<string, never>, context: Context): Promise<import("..").PaymentMethod[]>;
19
+ };
20
+ list_shipping_addresses: {
21
+ description: string;
22
+ inputSchema: z.ZodObject<{}, z.core.$strict>;
23
+ execute(input: Record<string, never>, context: Context): Promise<import("..").ShippingAddressRecord[]>;
24
+ };
25
+ list_spend_requests: {
26
+ description: string;
27
+ inputSchema: z.ZodObject<{
28
+ include_history: z.ZodOptional<z.ZodBoolean>;
29
+ }, z.core.$strict>;
30
+ execute(input: {
31
+ include_history?: boolean | undefined;
32
+ }, context: Context): Promise<import("..").SpendRequest[]>;
33
+ };
34
+ create_spend_request: {
35
+ description: string;
36
+ inputSchema: z.ZodObject<{
37
+ idempotency_key: z.ZodOptional<z.ZodString>;
38
+ payment_details: z.ZodOptional<z.ZodString>;
39
+ credential_type: z.ZodDefault<z.ZodEnum<{
40
+ card: "card";
41
+ shared_payment_token: "shared_payment_token";
42
+ }>>;
43
+ network_id: z.ZodOptional<z.ZodString>;
44
+ execution_method: z.ZodOptional<z.ZodLiteral<"link_pay_token">>;
45
+ merchant_account_id: z.ZodOptional<z.ZodString>;
46
+ amount: z.ZodNumber;
47
+ currency: z.ZodDefault<z.ZodString>;
48
+ merchant_name: z.ZodOptional<z.ZodString>;
49
+ merchant_url: z.ZodOptional<z.ZodURL>;
50
+ context: z.ZodString;
51
+ line_items: z.ZodOptional<z.ZodArray<z.ZodObject<{
52
+ name: z.ZodString;
53
+ quantity: z.ZodOptional<z.ZodNumber>;
54
+ unit_amount: z.ZodOptional<z.ZodNumber>;
55
+ description: z.ZodOptional<z.ZodString>;
56
+ sku: z.ZodOptional<z.ZodString>;
57
+ url: z.ZodOptional<z.ZodString>;
58
+ image_url: z.ZodOptional<z.ZodString>;
59
+ product_url: z.ZodOptional<z.ZodString>;
60
+ totals: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
+ type: z.ZodString;
62
+ display_text: z.ZodString;
63
+ amount: z.ZodNumber;
64
+ }, z.core.$strict>>>;
65
+ }, z.core.$strict>>>;
66
+ totals: z.ZodOptional<z.ZodArray<z.ZodObject<{
67
+ type: z.ZodString;
68
+ display_text: z.ZodString;
69
+ amount: z.ZodNumber;
70
+ }, z.core.$strict>>>;
71
+ request_approval: z.ZodDefault<z.ZodBoolean>;
72
+ test: z.ZodDefault<z.ZodBoolean>;
73
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
74
+ }, z.core.$strict>;
75
+ execute(input: {
76
+ idempotency_key?: string | undefined;
77
+ payment_details?: string | undefined;
78
+ credential_type?: "card" | "shared_payment_token" | undefined;
79
+ network_id?: string | undefined;
80
+ execution_method?: "link_pay_token" | undefined;
81
+ merchant_account_id?: string | undefined;
82
+ amount: number;
83
+ currency?: string | undefined;
84
+ merchant_name?: string | undefined;
85
+ merchant_url?: string | undefined;
86
+ context: string;
87
+ line_items?: {
88
+ name: string;
89
+ quantity?: number | undefined;
90
+ unit_amount?: number | undefined;
91
+ description?: string | undefined;
92
+ sku?: string | undefined;
93
+ url?: string | undefined;
94
+ image_url?: string | undefined;
95
+ product_url?: string | undefined;
96
+ totals?: {
97
+ type: string;
98
+ display_text: string;
99
+ amount: number;
100
+ }[] | undefined;
101
+ }[] | undefined;
102
+ totals?: {
103
+ type: string;
104
+ display_text: string;
105
+ amount: number;
106
+ }[] | undefined;
107
+ request_approval?: boolean | undefined;
108
+ test?: boolean | undefined;
109
+ metadata?: Record<string, string> | undefined;
110
+ }, context: Context): Promise<import("..").SpendRequest>;
111
+ };
112
+ retrieve_spend_request: {
113
+ description: string;
114
+ inputSchema: z.ZodObject<{
115
+ id: z.ZodString;
116
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
+ }, z.core.$strict>;
118
+ execute(input: {
119
+ id: string;
120
+ include?: string[] | undefined;
121
+ }, context: Context): Promise<import("..").SpendRequest | null>;
122
+ };
123
+ update_spend_request: {
124
+ description: string;
125
+ inputSchema: z.ZodObject<{
126
+ id: z.ZodString;
127
+ payment_details: z.ZodOptional<z.ZodString>;
128
+ amount: z.ZodOptional<z.ZodNumber>;
129
+ currency: z.ZodOptional<z.ZodString>;
130
+ merchant_url: z.ZodOptional<z.ZodURL>;
131
+ profile_id: z.ZodOptional<z.ZodString>;
132
+ merchant_id: z.ZodOptional<z.ZodString>;
133
+ line_items: z.ZodOptional<z.ZodArray<z.ZodObject<{
134
+ name: z.ZodString;
135
+ quantity: z.ZodOptional<z.ZodNumber>;
136
+ unit_amount: z.ZodOptional<z.ZodNumber>;
137
+ description: z.ZodOptional<z.ZodString>;
138
+ sku: z.ZodOptional<z.ZodString>;
139
+ url: z.ZodOptional<z.ZodString>;
140
+ image_url: z.ZodOptional<z.ZodString>;
141
+ product_url: z.ZodOptional<z.ZodString>;
142
+ totals: z.ZodOptional<z.ZodArray<z.ZodObject<{
143
+ type: z.ZodString;
144
+ display_text: z.ZodString;
145
+ amount: z.ZodNumber;
146
+ }, z.core.$strict>>>;
147
+ }, z.core.$strict>>>;
148
+ totals: z.ZodOptional<z.ZodArray<z.ZodObject<{
149
+ type: z.ZodString;
150
+ display_text: z.ZodString;
151
+ amount: z.ZodNumber;
152
+ }, z.core.$strict>>>;
153
+ }, z.core.$strict>;
154
+ execute(input: {
155
+ id: string;
156
+ payment_details?: string | undefined;
157
+ amount?: number | undefined;
158
+ currency?: string | undefined;
159
+ merchant_url?: string | undefined;
160
+ profile_id?: string | undefined;
161
+ merchant_id?: string | undefined;
162
+ line_items?: {
163
+ name: string;
164
+ quantity?: number | undefined;
165
+ unit_amount?: number | undefined;
166
+ description?: string | undefined;
167
+ sku?: string | undefined;
168
+ url?: string | undefined;
169
+ image_url?: string | undefined;
170
+ product_url?: string | undefined;
171
+ totals?: {
172
+ type: string;
173
+ display_text: string;
174
+ amount: number;
175
+ }[] | undefined;
176
+ }[] | undefined;
177
+ totals?: {
178
+ type: string;
179
+ display_text: string;
180
+ amount: number;
181
+ }[] | undefined;
182
+ }, context: Context): Promise<import("..").SpendRequest>;
183
+ };
184
+ request_spend_approval: {
185
+ description: string;
186
+ inputSchema: z.ZodObject<{
187
+ id: z.ZodString;
188
+ }, z.core.$strict>;
189
+ execute(input: {
190
+ id: string;
191
+ }, context: Context): Promise<import("..").RequestApprovalResponse>;
192
+ };
193
+ cancel_spend_request: {
194
+ description: string;
195
+ inputSchema: z.ZodObject<{
196
+ id: z.ZodString;
197
+ }, z.core.$strict>;
198
+ execute(input: {
199
+ id: string;
200
+ }, context: Context): Promise<import("..").SpendRequest>;
201
+ };
202
+ list_transactions: {
203
+ description: string;
204
+ inputSchema: z.ZodObject<{
205
+ limit: z.ZodOptional<z.ZodNumber>;
206
+ starting_after: z.ZodOptional<z.ZodString>;
207
+ ending_before: z.ZodOptional<z.ZodString>;
208
+ start_date: z.ZodOptional<z.ZodISODate>;
209
+ end_date: z.ZodOptional<z.ZodISODate>;
210
+ category: z.ZodOptional<z.ZodString>;
211
+ origin: z.ZodOptional<z.ZodEnum<{
212
+ external_connection: "external_connection";
213
+ link: "link";
214
+ }>>;
215
+ sources: z.ZodOptional<z.ZodArray<z.ZodString>>;
216
+ }, z.core.$strict>;
217
+ execute(input: {
218
+ limit?: number | undefined;
219
+ starting_after?: string | undefined;
220
+ ending_before?: string | undefined;
221
+ start_date?: string | undefined;
222
+ end_date?: string | undefined;
223
+ category?: string | undefined;
224
+ origin?: "external_connection" | "link" | undefined;
225
+ sources?: string[] | undefined;
226
+ }, context: Context): Promise<import("..").TransactionsPage>;
227
+ };
228
+ list_sources: {
229
+ description: string;
230
+ inputSchema: z.ZodObject<{
231
+ limit: z.ZodOptional<z.ZodNumber>;
232
+ starting_after: z.ZodOptional<z.ZodString>;
233
+ ending_before: z.ZodOptional<z.ZodString>;
234
+ }, z.core.$strict>;
235
+ execute(input: {
236
+ limit?: number | undefined;
237
+ starting_after?: string | undefined;
238
+ ending_before?: string | undefined;
239
+ }, context: Context): Promise<import("..").SourcesPage>;
240
+ };
241
+ list_balances: {
242
+ description: string;
243
+ inputSchema: z.ZodObject<{
244
+ limit: z.ZodOptional<z.ZodNumber>;
245
+ starting_after: z.ZodOptional<z.ZodString>;
246
+ ending_before: z.ZodOptional<z.ZodString>;
247
+ sources: z.ZodOptional<z.ZodArray<z.ZodString>>;
248
+ }, z.core.$strict>;
249
+ execute(input: {
250
+ limit?: number | undefined;
251
+ starting_after?: string | undefined;
252
+ ending_before?: string | undefined;
253
+ sources?: string[] | undefined;
254
+ }, context: Context): Promise<import("..").BalancesPage>;
255
+ };
256
+ create_report: {
257
+ description: string;
258
+ inputSchema: z.ZodObject<{
259
+ domain: z.ZodString;
260
+ outcome: z.ZodEnum<{
261
+ abandoned: "abandoned";
262
+ blocked: "blocked";
263
+ success: "success";
264
+ }>;
265
+ spend_request_id: z.ZodString;
266
+ tags: z.ZodOptional<z.ZodArray<z.ZodEnum<{
267
+ "3ds_challenge": "3ds_challenge";
268
+ anti_bot_script: "anti_bot_script";
269
+ captcha: "captcha";
270
+ cdn_block: "cdn_block";
271
+ dns_block: "dns_block";
272
+ login_required: "login_required";
273
+ other: "other";
274
+ page_inaccessible: "page_inaccessible";
275
+ payment_declined: "payment_declined";
276
+ rate_limited: "rate_limited";
277
+ site_error: "site_error";
278
+ stripe_checkout: "stripe_checkout";
279
+ timeout: "timeout";
280
+ waf_block: "waf_block";
281
+ }>>>;
282
+ step: z.ZodOptional<z.ZodString>;
283
+ freeform_context: z.ZodOptional<z.ZodString>;
284
+ attempt_trace: z.ZodOptional<z.ZodString>;
285
+ }, z.core.$strict>;
286
+ execute(input: {
287
+ domain: string;
288
+ outcome: "abandoned" | "blocked" | "success";
289
+ spend_request_id: string;
290
+ tags?: ("3ds_challenge" | "anti_bot_script" | "captcha" | "cdn_block" | "dns_block" | "login_required" | "other" | "page_inaccessible" | "payment_declined" | "rate_limited" | "site_error" | "stripe_checkout" | "timeout" | "waf_block")[] | undefined;
291
+ step?: string | undefined;
292
+ freeform_context?: string | undefined;
293
+ attempt_trace?: string | undefined;
294
+ }, context: Context): Promise<import("..").ReportRecord>;
295
+ };
296
+ };
297
+ export type LinkTools<Context = unknown> = ReturnType<typeof createLinkTools<Context>>;
298
+ export type LinkToolName = keyof LinkTools;
299
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAqB5C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAG,OAAO,EAC/C,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAoBzD,kBAAkB;;;uDAV+B,OAAO;;IAexD,oBAAoB;;;uDAf6B,OAAO;;IAoBxD,uBAAuB;;;uDApB0B,OAAO;;IAyBxD,mBAAmB;;;;;;;oBAzB8B,OAAO;;IAmCxD,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAnC6B,OAAO;;IAwCxD,sBAAsB;;;;;;;;;oBAxC2B,OAAO;;IA6CxD,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA7C6B,OAAO;;IAkDxD,sBAAsB;;;;;;;oBAlD2B,OAAO;;IAuDxD,oBAAoB;;;;;;;oBAvD6B,OAAO;;IA4DxD,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;oBA5DgC,OAAO;;IAiExD,YAAY;;;;;;;;;;;oBAjEqC,OAAO;;IAsExD,aAAa;;;;;;;;;;;;;oBAtEoC,OAAO;;IA2ExD,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA3EoC,OAAO;;EAiF3D;AAED,MAAM,MAAM,SAAS,CAAC,OAAO,GAAG,OAAO,IAAI,UAAU,CACnD,OAAO,eAAe,CAAC,OAAO,CAAC,CAChC,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC"}
@@ -0,0 +1,233 @@
1
+ import {
2
+ REPORT_OUTCOMES,
3
+ REPORT_TAGS
4
+ } from "../chunk-TYOT25QK.js";
5
+
6
+ // src/tools/schemas.ts
7
+ import { z } from "zod";
8
+ var id = z.string().min(1);
9
+ var money = z.number().int();
10
+ var total = z.strictObject({
11
+ type: z.string(),
12
+ display_text: z.string(),
13
+ amount: money
14
+ });
15
+ var lineItem = z.strictObject({
16
+ name: z.string(),
17
+ quantity: z.number().int().positive().optional(),
18
+ unit_amount: money.optional(),
19
+ description: z.string().optional(),
20
+ sku: z.string().optional(),
21
+ url: z.string().optional(),
22
+ image_url: z.string().optional(),
23
+ product_url: z.string().optional(),
24
+ totals: z.array(total).optional()
25
+ });
26
+ var pagination = {
27
+ limit: z.number().int().min(1).max(100).optional(),
28
+ starting_after: id.optional(),
29
+ ending_before: id.optional()
30
+ };
31
+ var linkToolSchemas = {
32
+ empty: z.strictObject({}),
33
+ spendRequestId: z.strictObject({ id: id.describe("Link spend request ID") }),
34
+ listSpendRequests: z.strictObject({
35
+ include_history: z.boolean().optional().describe("Include expired and terminal requests")
36
+ }),
37
+ retrieveSpendRequest: z.strictObject({
38
+ id: id.describe("Link spend request ID"),
39
+ include: z.array(z.string()).optional().describe(
40
+ "Extra data to return, such as card credentials. Request only when needed for checkout."
41
+ )
42
+ }),
43
+ createSpendRequest: z.strictObject({
44
+ idempotency_key: id.refine(
45
+ (key) => new TextEncoder().encode(key).length <= 255,
46
+ "At most 255 UTF-8 bytes"
47
+ ).optional().describe("Reuse only when retrying the same logical creation."),
48
+ payment_details: id.optional().describe("Payment method ID; omit to use the default."),
49
+ credential_type: z.enum(["card", "shared_payment_token"]).default("card"),
50
+ network_id: id.optional().describe("Required for shared payment tokens."),
51
+ execution_method: z.literal("link_pay_token").optional(),
52
+ merchant_account_id: id.optional().describe(
53
+ "For link_pay_token, read data-stripe-merchant-account from the checkout DOM."
54
+ ),
55
+ amount: money.positive().max(5e5).describe("Amount in cents."),
56
+ currency: z.string().length(3).default("usd"),
57
+ merchant_name: z.string().min(1).optional(),
58
+ merchant_url: z.url().optional(),
59
+ context: z.string().min(100).describe(
60
+ "Describe the purchase and rationale. The user reads this when approving."
61
+ ),
62
+ line_items: z.array(lineItem).optional(),
63
+ totals: z.array(total).optional(),
64
+ request_approval: z.boolean().default(true).describe(
65
+ "Ask Link for user approval; return the approval URL without polling."
66
+ ),
67
+ test: z.boolean().default(false).describe("Create test credentials instead of live credentials."),
68
+ metadata: z.record(z.string().max(40), z.string().max(500)).refine(
69
+ (value) => Object.keys(value).length <= 50,
70
+ "At most 50 metadata entries"
71
+ ).optional()
72
+ }).superRefine((value, ctx) => {
73
+ if (value.execution_method === "link_pay_token") {
74
+ if (!value.merchant_account_id || value.credential_type !== "card" || value.test || value.network_id || value.merchant_name || value.merchant_url) {
75
+ ctx.addIssue({
76
+ code: "custom",
77
+ message: "link_pay_token requires merchant_account_id and card credentials; omit merchant_name, merchant_url, network_id, and test mode."
78
+ });
79
+ }
80
+ } else if (value.merchant_account_id) {
81
+ ctx.addIssue({
82
+ code: "custom",
83
+ path: ["merchant_account_id"],
84
+ message: "Requires execution_method: link_pay_token."
85
+ });
86
+ } else if (value.credential_type === "shared_payment_token") {
87
+ if (!value.network_id)
88
+ ctx.addIssue({
89
+ code: "custom",
90
+ path: ["network_id"],
91
+ message: "Required for shared payment tokens."
92
+ });
93
+ } else if (!value.merchant_name || !value.merchant_url) {
94
+ ctx.addIssue({
95
+ code: "custom",
96
+ message: "Card requests require merchant_name and merchant_url."
97
+ });
98
+ }
99
+ }),
100
+ updateSpendRequest: z.strictObject({
101
+ id,
102
+ payment_details: id.optional(),
103
+ amount: money.positive().max(5e5).optional(),
104
+ currency: z.string().length(3).optional(),
105
+ merchant_url: z.url().optional(),
106
+ profile_id: id.optional(),
107
+ merchant_id: id.optional(),
108
+ line_items: z.array(lineItem).optional(),
109
+ totals: z.array(total).optional()
110
+ }),
111
+ listTransactions: z.strictObject({
112
+ ...pagination,
113
+ start_date: z.iso.date().optional(),
114
+ end_date: z.iso.date().optional(),
115
+ category: z.string().optional(),
116
+ origin: z.enum(["link", "external_connection"]).optional(),
117
+ sources: z.array(id).optional()
118
+ }),
119
+ listSources: z.strictObject(pagination),
120
+ listBalances: z.strictObject({
121
+ ...pagination,
122
+ sources: z.array(id).optional()
123
+ }),
124
+ createReport: z.strictObject({
125
+ domain: z.string().min(1),
126
+ outcome: z.enum(REPORT_OUTCOMES),
127
+ spend_request_id: id,
128
+ tags: z.array(z.enum(REPORT_TAGS)).optional(),
129
+ step: z.string().max(500).optional(),
130
+ freeform_context: z.string().max(500).optional(),
131
+ attempt_trace: z.string().optional().describe(
132
+ "Ordered account of the attempt. The API truncates long traces."
133
+ )
134
+ })
135
+ };
136
+
137
+ // src/tools/index.ts
138
+ function defined(value) {
139
+ if (Array.isArray(value)) return value.map(defined);
140
+ if (value !== null && typeof value === "object") {
141
+ return Object.fromEntries(
142
+ Object.entries(value).filter(([, item]) => item !== void 0).map(([key, item]) => [key, defined(item)])
143
+ );
144
+ }
145
+ return value;
146
+ }
147
+ function createLinkTools(client) {
148
+ function tool(description, inputSchema, execute) {
149
+ return {
150
+ description,
151
+ inputSchema,
152
+ async execute(input, context) {
153
+ const params = defined(inputSchema.parse(input));
154
+ const link = typeof client === "function" ? await client(context) : client;
155
+ return execute(link, params);
156
+ }
157
+ };
158
+ }
159
+ return {
160
+ retrieve_user_info: tool(
161
+ "Retrieve the connected Link user profile, wallet limits, and verification requirements.",
162
+ linkToolSchemas.empty,
163
+ (link) => link.userInfo.retrieve()
164
+ ),
165
+ list_payment_methods: tool(
166
+ "List saved Link payment methods and identify the default method.",
167
+ linkToolSchemas.empty,
168
+ (link) => link.paymentMethods.list()
169
+ ),
170
+ list_shipping_addresses: tool(
171
+ "List the connected Link user\u2019s saved shipping addresses.",
172
+ linkToolSchemas.empty,
173
+ (link) => link.shippingAddresses.list()
174
+ ),
175
+ list_spend_requests: tool(
176
+ "List Link spend requests and their current statuses.",
177
+ linkToolSchemas.listSpendRequests,
178
+ (link, input) => link.spendRequests.list(
179
+ input.include_history === void 0 ? {} : { includeHistory: input.include_history }
180
+ )
181
+ ),
182
+ create_spend_request: tool(
183
+ "Create a Link spend request for a purchase. Show approval_url to the user; creating a request does not establish approval. Retrieve the same request after approval or required actions.",
184
+ linkToolSchemas.createSpendRequest,
185
+ (link, input) => link.spendRequests.create(input)
186
+ ),
187
+ retrieve_spend_request: tool(
188
+ "Retrieve a Link spend request, its approval status, and requested credentials. Follow status_details.requires_action instructions; never assume approval from an earlier status.",
189
+ linkToolSchemas.retrieveSpendRequest,
190
+ (link, { id: id2, ...options }) => link.spendRequests.retrieve(id2, options)
191
+ ),
192
+ update_spend_request: tool(
193
+ "Update an existing Link spend request. Check the returned approval status before using credentials.",
194
+ linkToolSchemas.updateSpendRequest,
195
+ (link, { id: id2, ...params }) => link.spendRequests.update(id2, params)
196
+ ),
197
+ request_spend_approval: tool(
198
+ "Request human approval for a Link spend request. Show the returned approval URL to the user.",
199
+ linkToolSchemas.spendRequestId,
200
+ (link, { id: id2 }) => link.spendRequests.requestApproval(id2)
201
+ ),
202
+ cancel_spend_request: tool(
203
+ "Cancel a Link spend request.",
204
+ linkToolSchemas.spendRequestId,
205
+ (link, { id: id2 }) => link.spendRequests.cancel(id2)
206
+ ),
207
+ list_transactions: tool(
208
+ "List Link transactions. Requires the user\u2019s grant to include access to the requested sources.",
209
+ linkToolSchemas.listTransactions,
210
+ (link, input) => link.transactions.list(input)
211
+ ),
212
+ list_sources: tool(
213
+ "List connected financial sources available to the Link grant.",
214
+ linkToolSchemas.listSources,
215
+ (link, input) => link.sources.list(input)
216
+ ),
217
+ list_balances: tool(
218
+ "List balances for financial sources available to the Link grant.",
219
+ linkToolSchemas.listBalances,
220
+ (link, input) => link.balances.list(input)
221
+ ),
222
+ create_report: tool(
223
+ "Report the outcome of a purchase attempt associated with a Link spend request.",
224
+ linkToolSchemas.createReport,
225
+ (link, input) => link.reports.create(input)
226
+ )
227
+ };
228
+ }
229
+ export {
230
+ createLinkTools,
231
+ linkToolSchemas
232
+ };
233
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/tools/schemas.ts","../../src/tools/index.ts"],"sourcesContent":["import { z } from 'zod';\nimport { REPORT_OUTCOMES, REPORT_TAGS } from '../resources/interfaces';\n\nconst id = z.string().min(1);\nconst money = z.number().int();\nconst total = z.strictObject({\n type: z.string(),\n display_text: z.string(),\n amount: money,\n});\nconst lineItem = z.strictObject({\n name: z.string(),\n quantity: z.number().int().positive().optional(),\n unit_amount: money.optional(),\n description: z.string().optional(),\n sku: z.string().optional(),\n url: z.string().optional(),\n image_url: z.string().optional(),\n product_url: z.string().optional(),\n totals: z.array(total).optional(),\n});\nconst pagination = {\n limit: z.number().int().min(1).max(100).optional(),\n starting_after: id.optional(),\n ending_before: id.optional(),\n};\n\n/** API inputs, independent of CLI flags and framework execution context. */\nexport const linkToolSchemas = {\n empty: z.strictObject({}),\n spendRequestId: z.strictObject({ id: id.describe('Link spend request ID') }),\n listSpendRequests: z.strictObject({\n include_history: z\n .boolean()\n .optional()\n .describe('Include expired and terminal requests'),\n }),\n retrieveSpendRequest: z.strictObject({\n id: id.describe('Link spend request ID'),\n include: z\n .array(z.string())\n .optional()\n .describe(\n 'Extra data to return, such as card credentials. Request only when needed for checkout.',\n ),\n }),\n createSpendRequest: z\n .strictObject({\n idempotency_key: id\n .refine(\n (key) => new TextEncoder().encode(key).length <= 255,\n 'At most 255 UTF-8 bytes',\n )\n .optional()\n .describe('Reuse only when retrying the same logical creation.'),\n payment_details: id\n .optional()\n .describe('Payment method ID; omit to use the default.'),\n credential_type: z.enum(['card', 'shared_payment_token']).default('card'),\n network_id: id.optional().describe('Required for shared payment tokens.'),\n execution_method: z.literal('link_pay_token').optional(),\n merchant_account_id: id\n .optional()\n .describe(\n 'For link_pay_token, read data-stripe-merchant-account from the checkout DOM.',\n ),\n amount: money.positive().max(500000).describe('Amount in cents.'),\n currency: z.string().length(3).default('usd'),\n merchant_name: z.string().min(1).optional(),\n merchant_url: z.url().optional(),\n context: z\n .string()\n .min(100)\n .describe(\n 'Describe the purchase and rationale. The user reads this when approving.',\n ),\n line_items: z.array(lineItem).optional(),\n totals: z.array(total).optional(),\n request_approval: z\n .boolean()\n .default(true)\n .describe(\n 'Ask Link for user approval; return the approval URL without polling.',\n ),\n test: z\n .boolean()\n .default(false)\n .describe('Create test credentials instead of live credentials.'),\n metadata: z\n .record(z.string().max(40), z.string().max(500))\n .refine(\n (value) => Object.keys(value).length <= 50,\n 'At most 50 metadata entries',\n )\n .optional(),\n })\n .superRefine((value, ctx) => {\n if (value.execution_method === 'link_pay_token') {\n if (\n !value.merchant_account_id ||\n value.credential_type !== 'card' ||\n value.test ||\n value.network_id ||\n value.merchant_name ||\n value.merchant_url\n ) {\n ctx.addIssue({\n code: 'custom',\n message:\n 'link_pay_token requires merchant_account_id and card credentials; omit merchant_name, merchant_url, network_id, and test mode.',\n });\n }\n } else if (value.merchant_account_id) {\n ctx.addIssue({\n code: 'custom',\n path: ['merchant_account_id'],\n message: 'Requires execution_method: link_pay_token.',\n });\n } else if (value.credential_type === 'shared_payment_token') {\n if (!value.network_id)\n ctx.addIssue({\n code: 'custom',\n path: ['network_id'],\n message: 'Required for shared payment tokens.',\n });\n } else if (!value.merchant_name || !value.merchant_url) {\n ctx.addIssue({\n code: 'custom',\n message: 'Card requests require merchant_name and merchant_url.',\n });\n }\n }),\n updateSpendRequest: z.strictObject({\n id,\n payment_details: id.optional(),\n amount: money.positive().max(500000).optional(),\n currency: z.string().length(3).optional(),\n merchant_url: z.url().optional(),\n profile_id: id.optional(),\n merchant_id: id.optional(),\n line_items: z.array(lineItem).optional(),\n totals: z.array(total).optional(),\n }),\n listTransactions: z.strictObject({\n ...pagination,\n start_date: z.iso.date().optional(),\n end_date: z.iso.date().optional(),\n category: z.string().optional(),\n origin: z.enum(['link', 'external_connection']).optional(),\n sources: z.array(id).optional(),\n }),\n listSources: z.strictObject(pagination),\n listBalances: z.strictObject({\n ...pagination,\n sources: z.array(id).optional(),\n }),\n createReport: z.strictObject({\n domain: z.string().min(1),\n outcome: z.enum(REPORT_OUTCOMES),\n spend_request_id: id,\n tags: z.array(z.enum(REPORT_TAGS)).optional(),\n step: z.string().max(500).optional(),\n freeform_context: z.string().max(500).optional(),\n attempt_trace: z\n .string()\n .optional()\n .describe(\n 'Ordered account of the attempt. The API truncates long traces.',\n ),\n }),\n};\n","import type { z } from 'zod';\nimport type { Link } from '../client';\nimport { linkToolSchemas as schemas } from './schemas';\n\nexport { linkToolSchemas } from './schemas';\n\ntype Defined<T> = T extends readonly (infer Item)[]\n ? Defined<Item>[]\n : T extends object\n ? { [Key in keyof T]: Defined<Exclude<T[Key], undefined>> }\n : T;\n\n// Zod permits explicit undefined on optional inputs; API parameter types do not.\nfunction defined<T>(value: T): Defined<T> {\n if (Array.isArray(value)) return value.map(defined) as Defined<T>;\n if (value !== null && typeof value === 'object') {\n return Object.fromEntries(\n Object.entries(value)\n .filter(([, item]) => item !== undefined)\n .map(([key, item]) => [key, defined(item)]),\n ) as Defined<T>;\n }\n return value as Defined<T>;\n}\n\n/**\n * Standard Schema tools with no agent-framework dependency. A resolver runs\n * for each execution, so a shared catalog can safely serve multiple users.\n * Credentials are never resolved during tool discovery.\n */\nexport function createLinkTools<Context = unknown>(\n client: Link | ((context: Context) => Link | Promise<Link>),\n) {\n function tool<Schema extends z.ZodType, Output>(\n description: string,\n inputSchema: Schema,\n execute: (link: Link, input: Defined<z.output<Schema>>) => Promise<Output>,\n ) {\n return {\n description,\n inputSchema,\n async execute(input: z.input<Schema>, context: Context): Promise<Output> {\n const params = defined(inputSchema.parse(input));\n const link =\n typeof client === 'function' ? await client(context) : client;\n return execute(link, params);\n },\n };\n }\n\n return {\n retrieve_user_info: tool(\n 'Retrieve the connected Link user profile, wallet limits, and verification requirements.',\n schemas.empty,\n (link) => link.userInfo.retrieve(),\n ),\n list_payment_methods: tool(\n 'List saved Link payment methods and identify the default method.',\n schemas.empty,\n (link) => link.paymentMethods.list(),\n ),\n list_shipping_addresses: tool(\n 'List the connected Link user’s saved shipping addresses.',\n schemas.empty,\n (link) => link.shippingAddresses.list(),\n ),\n list_spend_requests: tool(\n 'List Link spend requests and their current statuses.',\n schemas.listSpendRequests,\n (link, input) =>\n link.spendRequests.list(\n input.include_history === undefined\n ? {}\n : { includeHistory: input.include_history },\n ),\n ),\n create_spend_request: tool(\n 'Create a Link spend request for a purchase. Show approval_url to the user; creating a request does not establish approval. Retrieve the same request after approval or required actions.',\n schemas.createSpendRequest,\n (link, input) => link.spendRequests.create(input),\n ),\n retrieve_spend_request: tool(\n 'Retrieve a Link spend request, its approval status, and requested credentials. Follow status_details.requires_action instructions; never assume approval from an earlier status.',\n schemas.retrieveSpendRequest,\n (link, { id, ...options }) => link.spendRequests.retrieve(id, options),\n ),\n update_spend_request: tool(\n 'Update an existing Link spend request. Check the returned approval status before using credentials.',\n schemas.updateSpendRequest,\n (link, { id, ...params }) => link.spendRequests.update(id, params),\n ),\n request_spend_approval: tool(\n 'Request human approval for a Link spend request. Show the returned approval URL to the user.',\n schemas.spendRequestId,\n (link, { id }) => link.spendRequests.requestApproval(id),\n ),\n cancel_spend_request: tool(\n 'Cancel a Link spend request.',\n schemas.spendRequestId,\n (link, { id }) => link.spendRequests.cancel(id),\n ),\n list_transactions: tool(\n 'List Link transactions. Requires the user’s grant to include access to the requested sources.',\n schemas.listTransactions,\n (link, input) => link.transactions.list(input),\n ),\n list_sources: tool(\n 'List connected financial sources available to the Link grant.',\n schemas.listSources,\n (link, input) => link.sources.list(input),\n ),\n list_balances: tool(\n 'List balances for financial sources available to the Link grant.',\n schemas.listBalances,\n (link, input) => link.balances.list(input),\n ),\n create_report: tool(\n 'Report the outcome of a purchase attempt associated with a Link spend request.',\n schemas.createReport,\n (link, input) => link.reports.create(input),\n ),\n };\n}\n\nexport type LinkTools<Context = unknown> = ReturnType<\n typeof createLinkTools<Context>\n>;\nexport type LinkToolName = keyof LinkTools;\n"],"mappings":";;;;;;AAAA,SAAS,SAAS;AAGlB,IAAM,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC;AAC3B,IAAM,QAAQ,EAAE,OAAO,EAAE,IAAI;AAC7B,IAAM,QAAQ,EAAE,aAAa;AAAA,EAC3B,MAAM,EAAE,OAAO;AAAA,EACf,cAAc,EAAE,OAAO;AAAA,EACvB,QAAQ;AACV,CAAC;AACD,IAAM,WAAW,EAAE,aAAa;AAAA,EAC9B,MAAM,EAAE,OAAO;A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