@layervai/qurl-mcp 0.4.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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -0
  3. package/dist/client.d.ts +278 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +156 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +34 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/prompts/audit-links.d.ts +7 -0
  12. package/dist/prompts/audit-links.d.ts.map +1 -0
  13. package/dist/prompts/audit-links.js +31 -0
  14. package/dist/prompts/audit-links.js.map +1 -0
  15. package/dist/prompts/rotate-access.d.ts +18 -0
  16. package/dist/prompts/rotate-access.d.ts.map +1 -0
  17. package/dist/prompts/rotate-access.js +41 -0
  18. package/dist/prompts/rotate-access.js.map +1 -0
  19. package/dist/prompts/secure-a-service.d.ts +38 -0
  20. package/dist/prompts/secure-a-service.d.ts.map +1 -0
  21. package/dist/prompts/secure-a-service.js +141 -0
  22. package/dist/prompts/secure-a-service.js.map +1 -0
  23. package/dist/resources/_shared.d.ts +31 -0
  24. package/dist/resources/_shared.d.ts.map +1 -0
  25. package/dist/resources/_shared.js +42 -0
  26. package/dist/resources/_shared.js.map +1 -0
  27. package/dist/resources/links.d.ts +15 -0
  28. package/dist/resources/links.d.ts.map +1 -0
  29. package/dist/resources/links.js +22 -0
  30. package/dist/resources/links.js.map +1 -0
  31. package/dist/resources/usage.d.ts +15 -0
  32. package/dist/resources/usage.d.ts.map +1 -0
  33. package/dist/resources/usage.js +18 -0
  34. package/dist/resources/usage.js.map +1 -0
  35. package/dist/server.d.ts +37 -0
  36. package/dist/server.d.ts.map +1 -0
  37. package/dist/server.js +58 -0
  38. package/dist/server.js.map +1 -0
  39. package/dist/tools/_shared.d.ts +78 -0
  40. package/dist/tools/_shared.d.ts.map +1 -0
  41. package/dist/tools/_shared.js +80 -0
  42. package/dist/tools/_shared.js.map +1 -0
  43. package/dist/tools/batch-create.d.ts +426 -0
  44. package/dist/tools/batch-create.d.ts.map +1 -0
  45. package/dist/tools/batch-create.js +81 -0
  46. package/dist/tools/batch-create.js.map +1 -0
  47. package/dist/tools/create-qurl.d.ts +316 -0
  48. package/dist/tools/create-qurl.d.ts.map +1 -0
  49. package/dist/tools/create-qurl.js +106 -0
  50. package/dist/tools/create-qurl.js.map +1 -0
  51. package/dist/tools/delete-qurl.d.ts +55 -0
  52. package/dist/tools/delete-qurl.d.ts.map +1 -0
  53. package/dist/tools/delete-qurl.js +76 -0
  54. package/dist/tools/delete-qurl.js.map +1 -0
  55. package/dist/tools/extend-qurl.d.ts +238 -0
  56. package/dist/tools/extend-qurl.d.ts.map +1 -0
  57. package/dist/tools/extend-qurl.js +45 -0
  58. package/dist/tools/extend-qurl.js.map +1 -0
  59. package/dist/tools/get-qurl.d.ts +231 -0
  60. package/dist/tools/get-qurl.d.ts.map +1 -0
  61. package/dist/tools/get-qurl.js +39 -0
  62. package/dist/tools/get-qurl.js.map +1 -0
  63. package/dist/tools/list-qurls.d.ts +395 -0
  64. package/dist/tools/list-qurls.d.ts.map +1 -0
  65. package/dist/tools/list-qurls.js +72 -0
  66. package/dist/tools/list-qurls.js.map +1 -0
  67. package/dist/tools/mint-link.d.ts +384 -0
  68. package/dist/tools/mint-link.d.ts.map +1 -0
  69. package/dist/tools/mint-link.js +75 -0
  70. package/dist/tools/mint-link.js.map +1 -0
  71. package/dist/tools/output-schemas.d.ts +1261 -0
  72. package/dist/tools/output-schemas.d.ts.map +1 -0
  73. package/dist/tools/output-schemas.js +173 -0
  74. package/dist/tools/output-schemas.js.map +1 -0
  75. package/dist/tools/resolve-qurl.d.ts +72 -0
  76. package/dist/tools/resolve-qurl.d.ts.map +1 -0
  77. package/dist/tools/resolve-qurl.js +42 -0
  78. package/dist/tools/resolve-qurl.js.map +1 -0
  79. package/dist/tools/update-qurl.d.ts +330 -0
  80. package/dist/tools/update-qurl.d.ts.map +1 -0
  81. package/dist/tools/update-qurl.js +96 -0
  82. package/dist/tools/update-qurl.js.map +1 -0
  83. package/package.json +58 -0
@@ -0,0 +1,384 @@
1
+ import { z } from "zod";
2
+ import type { IQURLClient } from "../client.js";
3
+ export declare const mintLinkBaseSchema: z.ZodObject<{
4
+ resource_id: z.ZodString;
5
+ label: z.ZodOptional<z.ZodString>;
6
+ expires_in: z.ZodOptional<z.ZodString>;
7
+ expires_at: z.ZodOptional<z.ZodString>;
8
+ one_time_use: z.ZodOptional<z.ZodBoolean>;
9
+ max_sessions: z.ZodOptional<z.ZodNumber>;
10
+ session_duration: z.ZodOptional<z.ZodString>;
11
+ access_policy: z.ZodOptional<z.ZodObject<{
12
+ ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
+ ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
14
+ geo_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
15
+ geo_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
+ user_agent_allow_regex: z.ZodOptional<z.ZodString>;
17
+ user_agent_deny_regex: z.ZodOptional<z.ZodString>;
18
+ ai_agent_policy: z.ZodOptional<z.ZodObject<{
19
+ block_all: z.ZodOptional<z.ZodBoolean>;
20
+ deny_categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
21
+ allow_categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ block_all?: boolean | undefined;
24
+ deny_categories?: string[] | undefined;
25
+ allow_categories?: string[] | undefined;
26
+ }, {
27
+ block_all?: boolean | undefined;
28
+ deny_categories?: string[] | undefined;
29
+ allow_categories?: string[] | undefined;
30
+ }>>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ ip_allowlist?: string[] | undefined;
33
+ ip_denylist?: string[] | undefined;
34
+ geo_allowlist?: string[] | undefined;
35
+ geo_denylist?: string[] | undefined;
36
+ user_agent_allow_regex?: string | undefined;
37
+ user_agent_deny_regex?: string | undefined;
38
+ ai_agent_policy?: {
39
+ block_all?: boolean | undefined;
40
+ deny_categories?: string[] | undefined;
41
+ allow_categories?: string[] | undefined;
42
+ } | undefined;
43
+ }, {
44
+ ip_allowlist?: string[] | undefined;
45
+ ip_denylist?: string[] | undefined;
46
+ geo_allowlist?: string[] | undefined;
47
+ geo_denylist?: string[] | undefined;
48
+ user_agent_allow_regex?: string | undefined;
49
+ user_agent_deny_regex?: string | undefined;
50
+ ai_agent_policy?: {
51
+ block_all?: boolean | undefined;
52
+ deny_categories?: string[] | undefined;
53
+ allow_categories?: string[] | undefined;
54
+ } | undefined;
55
+ }>>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ resource_id: string;
58
+ label?: string | undefined;
59
+ one_time_use?: boolean | undefined;
60
+ max_sessions?: number | undefined;
61
+ session_duration?: string | undefined;
62
+ access_policy?: {
63
+ ip_allowlist?: string[] | undefined;
64
+ ip_denylist?: string[] | undefined;
65
+ geo_allowlist?: string[] | undefined;
66
+ geo_denylist?: string[] | undefined;
67
+ user_agent_allow_regex?: string | undefined;
68
+ user_agent_deny_regex?: string | undefined;
69
+ ai_agent_policy?: {
70
+ block_all?: boolean | undefined;
71
+ deny_categories?: string[] | undefined;
72
+ allow_categories?: string[] | undefined;
73
+ } | undefined;
74
+ } | undefined;
75
+ expires_at?: string | undefined;
76
+ expires_in?: string | undefined;
77
+ }, {
78
+ resource_id: string;
79
+ label?: string | undefined;
80
+ one_time_use?: boolean | undefined;
81
+ max_sessions?: number | undefined;
82
+ session_duration?: string | undefined;
83
+ access_policy?: {
84
+ ip_allowlist?: string[] | undefined;
85
+ ip_denylist?: string[] | undefined;
86
+ geo_allowlist?: string[] | undefined;
87
+ geo_denylist?: string[] | undefined;
88
+ user_agent_allow_regex?: string | undefined;
89
+ user_agent_deny_regex?: string | undefined;
90
+ ai_agent_policy?: {
91
+ block_all?: boolean | undefined;
92
+ deny_categories?: string[] | undefined;
93
+ allow_categories?: string[] | undefined;
94
+ } | undefined;
95
+ } | undefined;
96
+ expires_at?: string | undefined;
97
+ expires_in?: string | undefined;
98
+ }>;
99
+ export declare const mintLinkSchema: z.ZodEffects<z.ZodObject<{
100
+ resource_id: z.ZodString;
101
+ label: z.ZodOptional<z.ZodString>;
102
+ expires_in: z.ZodOptional<z.ZodString>;
103
+ expires_at: z.ZodOptional<z.ZodString>;
104
+ one_time_use: z.ZodOptional<z.ZodBoolean>;
105
+ max_sessions: z.ZodOptional<z.ZodNumber>;
106
+ session_duration: z.ZodOptional<z.ZodString>;
107
+ access_policy: z.ZodOptional<z.ZodObject<{
108
+ ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
109
+ ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
110
+ geo_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
111
+ geo_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
112
+ user_agent_allow_regex: z.ZodOptional<z.ZodString>;
113
+ user_agent_deny_regex: z.ZodOptional<z.ZodString>;
114
+ ai_agent_policy: z.ZodOptional<z.ZodObject<{
115
+ block_all: z.ZodOptional<z.ZodBoolean>;
116
+ deny_categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
117
+ allow_categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ block_all?: boolean | undefined;
120
+ deny_categories?: string[] | undefined;
121
+ allow_categories?: string[] | undefined;
122
+ }, {
123
+ block_all?: boolean | undefined;
124
+ deny_categories?: string[] | undefined;
125
+ allow_categories?: string[] | undefined;
126
+ }>>;
127
+ }, "strip", z.ZodTypeAny, {
128
+ ip_allowlist?: string[] | undefined;
129
+ ip_denylist?: string[] | undefined;
130
+ geo_allowlist?: string[] | undefined;
131
+ geo_denylist?: string[] | undefined;
132
+ user_agent_allow_regex?: string | undefined;
133
+ user_agent_deny_regex?: string | undefined;
134
+ ai_agent_policy?: {
135
+ block_all?: boolean | undefined;
136
+ deny_categories?: string[] | undefined;
137
+ allow_categories?: string[] | undefined;
138
+ } | undefined;
139
+ }, {
140
+ ip_allowlist?: string[] | undefined;
141
+ ip_denylist?: string[] | undefined;
142
+ geo_allowlist?: string[] | undefined;
143
+ geo_denylist?: string[] | undefined;
144
+ user_agent_allow_regex?: string | undefined;
145
+ user_agent_deny_regex?: string | undefined;
146
+ ai_agent_policy?: {
147
+ block_all?: boolean | undefined;
148
+ deny_categories?: string[] | undefined;
149
+ allow_categories?: string[] | undefined;
150
+ } | undefined;
151
+ }>>;
152
+ }, "strip", z.ZodTypeAny, {
153
+ resource_id: string;
154
+ label?: string | undefined;
155
+ one_time_use?: boolean | undefined;
156
+ max_sessions?: number | undefined;
157
+ session_duration?: string | undefined;
158
+ access_policy?: {
159
+ ip_allowlist?: string[] | undefined;
160
+ ip_denylist?: string[] | undefined;
161
+ geo_allowlist?: string[] | undefined;
162
+ geo_denylist?: string[] | undefined;
163
+ user_agent_allow_regex?: string | undefined;
164
+ user_agent_deny_regex?: string | undefined;
165
+ ai_agent_policy?: {
166
+ block_all?: boolean | undefined;
167
+ deny_categories?: string[] | undefined;
168
+ allow_categories?: string[] | undefined;
169
+ } | undefined;
170
+ } | undefined;
171
+ expires_at?: string | undefined;
172
+ expires_in?: string | undefined;
173
+ }, {
174
+ resource_id: string;
175
+ label?: string | undefined;
176
+ one_time_use?: boolean | undefined;
177
+ max_sessions?: number | undefined;
178
+ session_duration?: string | undefined;
179
+ access_policy?: {
180
+ ip_allowlist?: string[] | undefined;
181
+ ip_denylist?: string[] | undefined;
182
+ geo_allowlist?: string[] | undefined;
183
+ geo_denylist?: string[] | undefined;
184
+ user_agent_allow_regex?: string | undefined;
185
+ user_agent_deny_regex?: string | undefined;
186
+ ai_agent_policy?: {
187
+ block_all?: boolean | undefined;
188
+ deny_categories?: string[] | undefined;
189
+ allow_categories?: string[] | undefined;
190
+ } | undefined;
191
+ } | undefined;
192
+ expires_at?: string | undefined;
193
+ expires_in?: string | undefined;
194
+ }>, {
195
+ resource_id: string;
196
+ label?: string | undefined;
197
+ one_time_use?: boolean | undefined;
198
+ max_sessions?: number | undefined;
199
+ session_duration?: string | undefined;
200
+ access_policy?: {
201
+ ip_allowlist?: string[] | undefined;
202
+ ip_denylist?: string[] | undefined;
203
+ geo_allowlist?: string[] | undefined;
204
+ geo_denylist?: string[] | undefined;
205
+ user_agent_allow_regex?: string | undefined;
206
+ user_agent_deny_regex?: string | undefined;
207
+ ai_agent_policy?: {
208
+ block_all?: boolean | undefined;
209
+ deny_categories?: string[] | undefined;
210
+ allow_categories?: string[] | undefined;
211
+ } | undefined;
212
+ } | undefined;
213
+ expires_at?: string | undefined;
214
+ expires_in?: string | undefined;
215
+ }, {
216
+ resource_id: string;
217
+ label?: string | undefined;
218
+ one_time_use?: boolean | undefined;
219
+ max_sessions?: number | undefined;
220
+ session_duration?: string | undefined;
221
+ access_policy?: {
222
+ ip_allowlist?: string[] | undefined;
223
+ ip_denylist?: string[] | undefined;
224
+ geo_allowlist?: string[] | undefined;
225
+ geo_denylist?: string[] | undefined;
226
+ user_agent_allow_regex?: string | undefined;
227
+ user_agent_deny_regex?: string | undefined;
228
+ ai_agent_policy?: {
229
+ block_all?: boolean | undefined;
230
+ deny_categories?: string[] | undefined;
231
+ allow_categories?: string[] | undefined;
232
+ } | undefined;
233
+ } | undefined;
234
+ expires_at?: string | undefined;
235
+ expires_in?: string | undefined;
236
+ }>;
237
+ export declare function mintLinkTool(client: IQURLClient): {
238
+ name: string;
239
+ title: string;
240
+ description: string;
241
+ inputSchema: z.ZodObject<{
242
+ resource_id: z.ZodString;
243
+ label: z.ZodOptional<z.ZodString>;
244
+ expires_in: z.ZodOptional<z.ZodString>;
245
+ expires_at: z.ZodOptional<z.ZodString>;
246
+ one_time_use: z.ZodOptional<z.ZodBoolean>;
247
+ max_sessions: z.ZodOptional<z.ZodNumber>;
248
+ session_duration: z.ZodOptional<z.ZodString>;
249
+ access_policy: z.ZodOptional<z.ZodObject<{
250
+ ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
251
+ ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
252
+ geo_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
253
+ geo_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
254
+ user_agent_allow_regex: z.ZodOptional<z.ZodString>;
255
+ user_agent_deny_regex: z.ZodOptional<z.ZodString>;
256
+ ai_agent_policy: z.ZodOptional<z.ZodObject<{
257
+ block_all: z.ZodOptional<z.ZodBoolean>;
258
+ deny_categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
259
+ allow_categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
260
+ }, "strip", z.ZodTypeAny, {
261
+ block_all?: boolean | undefined;
262
+ deny_categories?: string[] | undefined;
263
+ allow_categories?: string[] | undefined;
264
+ }, {
265
+ block_all?: boolean | undefined;
266
+ deny_categories?: string[] | undefined;
267
+ allow_categories?: string[] | undefined;
268
+ }>>;
269
+ }, "strip", z.ZodTypeAny, {
270
+ ip_allowlist?: string[] | undefined;
271
+ ip_denylist?: string[] | undefined;
272
+ geo_allowlist?: string[] | undefined;
273
+ geo_denylist?: string[] | undefined;
274
+ user_agent_allow_regex?: string | undefined;
275
+ user_agent_deny_regex?: string | undefined;
276
+ ai_agent_policy?: {
277
+ block_all?: boolean | undefined;
278
+ deny_categories?: string[] | undefined;
279
+ allow_categories?: string[] | undefined;
280
+ } | undefined;
281
+ }, {
282
+ ip_allowlist?: string[] | undefined;
283
+ ip_denylist?: string[] | undefined;
284
+ geo_allowlist?: string[] | undefined;
285
+ geo_denylist?: string[] | undefined;
286
+ user_agent_allow_regex?: string | undefined;
287
+ user_agent_deny_regex?: string | undefined;
288
+ ai_agent_policy?: {
289
+ block_all?: boolean | undefined;
290
+ deny_categories?: string[] | undefined;
291
+ allow_categories?: string[] | undefined;
292
+ } | undefined;
293
+ }>>;
294
+ }, "strip", z.ZodTypeAny, {
295
+ resource_id: string;
296
+ label?: string | undefined;
297
+ one_time_use?: boolean | undefined;
298
+ max_sessions?: number | undefined;
299
+ session_duration?: string | undefined;
300
+ access_policy?: {
301
+ ip_allowlist?: string[] | undefined;
302
+ ip_denylist?: string[] | undefined;
303
+ geo_allowlist?: string[] | undefined;
304
+ geo_denylist?: string[] | undefined;
305
+ user_agent_allow_regex?: string | undefined;
306
+ user_agent_deny_regex?: string | undefined;
307
+ ai_agent_policy?: {
308
+ block_all?: boolean | undefined;
309
+ deny_categories?: string[] | undefined;
310
+ allow_categories?: string[] | undefined;
311
+ } | undefined;
312
+ } | undefined;
313
+ expires_at?: string | undefined;
314
+ expires_in?: string | undefined;
315
+ }, {
316
+ resource_id: string;
317
+ label?: string | undefined;
318
+ one_time_use?: boolean | undefined;
319
+ max_sessions?: number | undefined;
320
+ session_duration?: string | undefined;
321
+ access_policy?: {
322
+ ip_allowlist?: string[] | undefined;
323
+ ip_denylist?: string[] | undefined;
324
+ geo_allowlist?: string[] | undefined;
325
+ geo_denylist?: string[] | undefined;
326
+ user_agent_allow_regex?: string | undefined;
327
+ user_agent_deny_regex?: string | undefined;
328
+ ai_agent_policy?: {
329
+ block_all?: boolean | undefined;
330
+ deny_categories?: string[] | undefined;
331
+ allow_categories?: string[] | undefined;
332
+ } | undefined;
333
+ } | undefined;
334
+ expires_at?: string | undefined;
335
+ expires_in?: string | undefined;
336
+ }>;
337
+ outputSchema: z.ZodObject<{
338
+ qurl_link: z.ZodString;
339
+ expires_at: z.ZodString;
340
+ }, "strip", z.ZodTypeAny, {
341
+ expires_at: string;
342
+ qurl_link: string;
343
+ }, {
344
+ expires_at: string;
345
+ qurl_link: string;
346
+ }>;
347
+ annotations: {
348
+ title: string;
349
+ readOnlyHint: boolean;
350
+ destructiveHint: boolean;
351
+ idempotentHint: boolean;
352
+ openWorldHint: boolean;
353
+ };
354
+ handler: (input: {
355
+ resource_id: string;
356
+ label?: string | undefined;
357
+ one_time_use?: boolean | undefined;
358
+ max_sessions?: number | undefined;
359
+ session_duration?: string | undefined;
360
+ access_policy?: {
361
+ ip_allowlist?: string[] | undefined;
362
+ ip_denylist?: string[] | undefined;
363
+ geo_allowlist?: string[] | undefined;
364
+ geo_denylist?: string[] | undefined;
365
+ user_agent_allow_regex?: string | undefined;
366
+ user_agent_deny_regex?: string | undefined;
367
+ ai_agent_policy?: {
368
+ block_all?: boolean | undefined;
369
+ deny_categories?: string[] | undefined;
370
+ allow_categories?: string[] | undefined;
371
+ } | undefined;
372
+ } | undefined;
373
+ expires_at?: string | undefined;
374
+ expires_in?: string | undefined;
375
+ }) => Promise<{
376
+ content: Array<{
377
+ type: "text";
378
+ text: string;
379
+ }>;
380
+ structuredContent?: Record<string, unknown>;
381
+ isError?: boolean;
382
+ }>;
383
+ };
384
+ //# sourceMappingURL=mint-link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mint-link.d.ts","sourceRoot":"","sources":["../../src/tools/mint-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAUhD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2B7B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG1B,CAAC;AAEF,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwC/C"}
@@ -0,0 +1,75 @@
1
+ import { z } from "zod";
2
+ import { accessPolicySchema } from "./create-qurl.js";
3
+ import { resourceIdSchema, toStructuredContent, withMissingApiKeyHandler, zodErrorToToolResult, } from "./_shared.js";
4
+ import { mintLinkOutputSchema } from "./output-schemas.js";
5
+ export const mintLinkBaseSchema = z.object({
6
+ resource_id: resourceIdSchema("mint a new access link for"),
7
+ label: z
8
+ .string()
9
+ .max(500)
10
+ .optional()
11
+ .describe("Human-readable label identifying who this link is for (max 500 chars)"),
12
+ expires_in: z
13
+ .string()
14
+ .min(1)
15
+ .optional()
16
+ .describe('Relative duration until expiration (e.g., "5m", "24h", "7d"). Mutually exclusive with expires_at'),
17
+ expires_at: z.string().datetime().optional().describe("Absolute expiration timestamp (RFC 3339). Mutually exclusive with expires_in"),
18
+ one_time_use: z.boolean().optional().describe("Whether this link can only be used once"),
19
+ max_sessions: z
20
+ .number()
21
+ .int()
22
+ .min(0)
23
+ .max(1000)
24
+ .optional()
25
+ .describe("Maximum concurrent sessions (0 = unlimited, max 1000)"),
26
+ session_duration: z
27
+ .string()
28
+ .min(1)
29
+ .optional()
30
+ .describe('How long access lasts after clicking (e.g., "1h")'),
31
+ access_policy: accessPolicySchema.optional().describe("Access control policy for this link"),
32
+ });
33
+ export const mintLinkSchema = mintLinkBaseSchema.refine((data) => !(data.expires_in && data.expires_at), { message: "Provide either expires_in or expires_at, not both" });
34
+ export function mintLinkTool(client) {
35
+ return {
36
+ name: "mint_link",
37
+ title: "Mint Access Link",
38
+ description: "Mint a fresh single-use access link for an existing qURL resource — same one-shot semantics as `create_qurl.qurl_link`. " +
39
+ "Use this to issue additional access links to a resource without creating a brand-new qURL (e.g. a second recipient, a replacement after the original was lost). " +
40
+ "Use `create_qurl` instead when you want a brand-new resource with its own target_url and policy. " +
41
+ "Use `update_qurl` when you only want to change expiration/tags/description on the existing resource. " +
42
+ "Accepts both `r_` and `q_` IDs. " +
43
+ "**Constraints:** `expires_in` and `expires_at` are mutually exclusive (handler returns an `isError: true` content block before any API call if both are set). " +
44
+ "**Output:** the new `qurl_link` is shown ONCE — no subsequent call returns it. Save it immediately.",
45
+ inputSchema: mintLinkBaseSchema,
46
+ outputSchema: mintLinkOutputSchema,
47
+ annotations: {
48
+ title: "Mint Access Link",
49
+ readOnlyHint: false,
50
+ destructiveHint: false,
51
+ idempotentHint: false,
52
+ openWorldHint: true,
53
+ },
54
+ handler: withMissingApiKeyHandler(async (raw) => {
55
+ const parsed = mintLinkSchema.safeParse(raw);
56
+ if (!parsed.success)
57
+ return zodErrorToToolResult(parsed.error);
58
+ const { resource_id, ...body } = parsed.data;
59
+ // When only resource_id is provided, forward undefined so the client
60
+ // sends no body (and no Content-Type header) rather than an empty {}.
61
+ const hasBody = Object.keys(body).length > 0;
62
+ const result = await client.mintLink(resource_id, hasBody ? body : undefined);
63
+ return {
64
+ content: [
65
+ {
66
+ type: "text",
67
+ text: JSON.stringify(result.data),
68
+ },
69
+ ],
70
+ structuredContent: toStructuredContent(result.data),
71
+ };
72
+ }),
73
+ };
74
+ }
75
+ //# sourceMappingURL=mint-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mint-link.js","sourceRoot":"","sources":["../../src/tools/mint-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,WAAW,EAAE,gBAAgB,CAA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