@layervai/qurl-mcp 0.4.1 → 0.5.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 (169) hide show
  1. package/README.md +742 -50
  2. package/assets/fonts/NotoSansSC-Regular.ttf +0 -0
  3. package/assets/fonts/OFL.txt +93 -0
  4. package/assets/fonts/README.md +18 -0
  5. package/dist/auth/request-context.d.ts +13 -0
  6. package/dist/auth/request-context.d.ts.map +1 -0
  7. package/dist/auth/request-context.js +21 -0
  8. package/dist/auth/request-context.js.map +1 -0
  9. package/dist/auth/static-bearer.d.ts +12 -0
  10. package/dist/auth/static-bearer.d.ts.map +1 -0
  11. package/dist/auth/static-bearer.js +47 -0
  12. package/dist/auth/static-bearer.js.map +1 -0
  13. package/dist/client.d.ts +1 -1
  14. package/dist/client.d.ts.map +1 -1
  15. package/dist/client.js +15 -4
  16. package/dist/client.js.map +1 -1
  17. package/dist/config.d.ts +98 -0
  18. package/dist/config.d.ts.map +1 -0
  19. package/dist/config.js +543 -0
  20. package/dist/config.js.map +1 -0
  21. package/dist/credential-rate-limit-store.d.ts +38 -0
  22. package/dist/credential-rate-limit-store.d.ts.map +1 -0
  23. package/dist/credential-rate-limit-store.js +135 -0
  24. package/dist/credential-rate-limit-store.js.map +1 -0
  25. package/dist/email-addresses.d.ts +7 -0
  26. package/dist/email-addresses.d.ts.map +1 -0
  27. package/dist/email-addresses.js +36 -0
  28. package/dist/email-addresses.js.map +1 -0
  29. package/dist/email-types.d.ts +33 -0
  30. package/dist/email-types.d.ts.map +1 -0
  31. package/dist/email-types.js +28 -0
  32. package/dist/email-types.js.map +1 -0
  33. package/dist/emf-metrics.d.ts +25 -0
  34. package/dist/emf-metrics.d.ts.map +1 -0
  35. package/dist/emf-metrics.js +87 -0
  36. package/dist/emf-metrics.js.map +1 -0
  37. package/dist/http-config.d.ts +38 -0
  38. package/dist/http-config.d.ts.map +1 -0
  39. package/dist/http-config.js +243 -0
  40. package/dist/http-config.js.map +1 -0
  41. package/dist/http-routes.d.ts +5 -0
  42. package/dist/http-routes.d.ts.map +1 -0
  43. package/dist/http-routes.js +12 -0
  44. package/dist/http-routes.js.map +1 -0
  45. package/dist/http.d.ts +33 -0
  46. package/dist/http.d.ts.map +1 -0
  47. package/dist/http.js +1116 -0
  48. package/dist/http.js.map +1 -0
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +42 -26
  52. package/dist/index.js.map +1 -1
  53. package/dist/logging.d.ts +7 -0
  54. package/dist/logging.d.ts.map +1 -0
  55. package/dist/logging.js +110 -0
  56. package/dist/logging.js.map +1 -0
  57. package/dist/server.d.ts +12 -4
  58. package/dist/server.d.ts.map +1 -1
  59. package/dist/server.js +33 -8
  60. package/dist/server.js.map +1 -1
  61. package/dist/services/email.d.ts +17 -0
  62. package/dist/services/email.d.ts.map +1 -0
  63. package/dist/services/email.js +351 -0
  64. package/dist/services/email.js.map +1 -0
  65. package/dist/services/html.d.ts +5 -0
  66. package/dist/services/html.d.ts.map +1 -0
  67. package/dist/services/html.js +28 -0
  68. package/dist/services/html.js.map +1 -0
  69. package/dist/services/legal-pages.d.ts +12 -0
  70. package/dist/services/legal-pages.d.ts.map +1 -0
  71. package/dist/services/legal-pages.js +588 -0
  72. package/dist/services/legal-pages.js.map +1 -0
  73. package/dist/services/text-pdf.d.ts +16 -0
  74. package/dist/services/text-pdf.d.ts.map +1 -0
  75. package/dist/services/text-pdf.js +141 -0
  76. package/dist/services/text-pdf.js.map +1 -0
  77. package/dist/services/video-page.d.ts +4 -0
  78. package/dist/services/video-page.d.ts.map +1 -0
  79. package/dist/services/video-page.js +311 -0
  80. package/dist/services/video-page.js.map +1 -0
  81. package/dist/text.d.ts +4 -0
  82. package/dist/text.d.ts.map +1 -0
  83. package/dist/text.js +16 -0
  84. package/dist/text.js.map +1 -0
  85. package/dist/tools/_shared.d.ts +9 -1
  86. package/dist/tools/_shared.d.ts.map +1 -1
  87. package/dist/tools/_shared.js +20 -8
  88. package/dist/tools/_shared.js.map +1 -1
  89. package/dist/tools/batch-create.d.ts +12 -11
  90. package/dist/tools/batch-create.d.ts.map +1 -1
  91. package/dist/tools/batch-create.js +6 -4
  92. package/dist/tools/batch-create.js.map +1 -1
  93. package/dist/tools/create-qurl.d.ts +43 -4
  94. package/dist/tools/create-qurl.d.ts.map +1 -1
  95. package/dist/tools/create-qurl.js +63 -30
  96. package/dist/tools/create-qurl.js.map +1 -1
  97. package/dist/tools/delete-qurl.d.ts +3 -2
  98. package/dist/tools/delete-qurl.d.ts.map +1 -1
  99. package/dist/tools/delete-qurl.js +3 -10
  100. package/dist/tools/delete-qurl.js.map +1 -1
  101. package/dist/tools/email-delivery.d.ts +37 -0
  102. package/dist/tools/email-delivery.d.ts.map +1 -0
  103. package/dist/tools/email-delivery.js +115 -0
  104. package/dist/tools/email-delivery.js.map +1 -0
  105. package/dist/tools/extend-qurl.d.ts +6 -5
  106. package/dist/tools/extend-qurl.d.ts.map +1 -1
  107. package/dist/tools/extend-qurl.js +3 -3
  108. package/dist/tools/extend-qurl.js.map +1 -1
  109. package/dist/tools/get-qurl.d.ts +6 -5
  110. package/dist/tools/get-qurl.d.ts.map +1 -1
  111. package/dist/tools/get-qurl.js +5 -3
  112. package/dist/tools/get-qurl.js.map +1 -1
  113. package/dist/tools/list-qurl-sessions.d.ts +5 -4
  114. package/dist/tools/list-qurl-sessions.d.ts.map +1 -1
  115. package/dist/tools/list-qurl-sessions.js +2 -2
  116. package/dist/tools/list-qurl-sessions.js.map +1 -1
  117. package/dist/tools/list-qurls.d.ts +8 -7
  118. package/dist/tools/list-qurls.d.ts.map +1 -1
  119. package/dist/tools/list-qurls.js +9 -7
  120. package/dist/tools/list-qurls.js.map +1 -1
  121. package/dist/tools/mint-link.d.ts +39 -3
  122. package/dist/tools/mint-link.d.ts.map +1 -1
  123. package/dist/tools/mint-link.js +24 -13
  124. package/dist/tools/mint-link.js.map +1 -1
  125. package/dist/tools/output-schemas.d.ts +102 -45
  126. package/dist/tools/output-schemas.d.ts.map +1 -1
  127. package/dist/tools/output-schemas.js +54 -29
  128. package/dist/tools/output-schemas.js.map +1 -1
  129. package/dist/tools/resolve-qurl.d.ts +4 -3
  130. package/dist/tools/resolve-qurl.d.ts.map +1 -1
  131. package/dist/tools/resolve-qurl.js +3 -3
  132. package/dist/tools/resolve-qurl.js.map +1 -1
  133. package/dist/tools/revoke-qurl-token.d.ts +3 -2
  134. package/dist/tools/revoke-qurl-token.d.ts.map +1 -1
  135. package/dist/tools/revoke-qurl-token.js +2 -2
  136. package/dist/tools/revoke-qurl-token.js.map +1 -1
  137. package/dist/tools/terminate-qurl-sessions.d.ts +3 -2
  138. package/dist/tools/terminate-qurl-sessions.d.ts.map +1 -1
  139. package/dist/tools/terminate-qurl-sessions.js +7 -3
  140. package/dist/tools/terminate-qurl-sessions.js.map +1 -1
  141. package/dist/tools/update-qurl-token.d.ts +5 -4
  142. package/dist/tools/update-qurl-token.d.ts.map +1 -1
  143. package/dist/tools/update-qurl-token.js +2 -2
  144. package/dist/tools/update-qurl-token.js.map +1 -1
  145. package/dist/tools/update-qurl.d.ts +6 -5
  146. package/dist/tools/update-qurl.d.ts.map +1 -1
  147. package/dist/tools/update-qurl.js +4 -4
  148. package/dist/tools/update-qurl.js.map +1 -1
  149. package/dist/tools/upload-file-data-qurl.d.ts +182 -0
  150. package/dist/tools/upload-file-data-qurl.d.ts.map +1 -0
  151. package/dist/tools/upload-file-data-qurl.js +200 -0
  152. package/dist/tools/upload-file-data-qurl.js.map +1 -0
  153. package/dist/tools/upload-file-qurl.d.ts +162 -0
  154. package/dist/tools/upload-file-qurl.d.ts.map +1 -0
  155. package/dist/tools/upload-file-qurl.js +167 -0
  156. package/dist/tools/upload-file-qurl.js.map +1 -0
  157. package/dist/tools/upload-file-shared.d.ts +36 -0
  158. package/dist/tools/upload-file-shared.d.ts.map +1 -0
  159. package/dist/tools/upload-file-shared.js +347 -0
  160. package/dist/tools/upload-file-shared.js.map +1 -0
  161. package/dist/tools/upload-mint-options.d.ts +22 -0
  162. package/dist/tools/upload-mint-options.d.ts.map +1 -0
  163. package/dist/tools/upload-mint-options.js +29 -0
  164. package/dist/tools/upload-mint-options.js.map +1 -0
  165. package/dist/tools/upload-text-qurl.d.ts +144 -0
  166. package/dist/tools/upload-text-qurl.d.ts.map +1 -0
  167. package/dist/tools/upload-text-qurl.js +102 -0
  168. package/dist/tools/upload-text-qurl.js.map +1 -0
  169. package/package.json +25 -7
@@ -1,15 +1,15 @@
1
1
  import { z } from "zod";
2
2
  import type { IQURLClient } from "../client.js";
3
+ import { type ToolRuntimeOptions } from "./_shared.js";
3
4
  export declare const batchCreateSchema: z.ZodObject<{
4
5
  items: z.ZodArray<z.ZodObject<{
5
6
  type: z.ZodOptional<z.ZodString>;
6
7
  target_url: z.ZodString;
8
+ custom_domain: z.ZodOptional<z.ZodString>;
7
9
  label: z.ZodOptional<z.ZodString>;
8
- expires_in: z.ZodOptional<z.ZodString>;
9
10
  one_time_use: z.ZodOptional<z.ZodBoolean>;
10
11
  max_sessions: z.ZodOptional<z.ZodNumber>;
11
12
  session_duration: z.ZodOptional<z.ZodString>;
12
- custom_domain: z.ZodOptional<z.ZodString>;
13
13
  access_policy: z.ZodOptional<z.ZodObject<{
14
14
  ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
15
  ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -23,9 +23,10 @@ export declare const batchCreateSchema: z.ZodObject<{
23
23
  allow_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
24
  }, z.core.$strip>>;
25
25
  }, z.core.$strip>>;
26
+ expires_in: z.ZodOptional<z.ZodString>;
26
27
  }, z.core.$strip>>;
27
28
  }, z.core.$strip>;
28
- export declare function batchCreateTool(client: IQURLClient): {
29
+ export declare function batchCreateTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
29
30
  name: string;
30
31
  title: string;
31
32
  description: string;
@@ -33,12 +34,11 @@ export declare function batchCreateTool(client: IQURLClient): {
33
34
  items: z.ZodArray<z.ZodObject<{
34
35
  type: z.ZodOptional<z.ZodString>;
35
36
  target_url: z.ZodString;
37
+ custom_domain: z.ZodOptional<z.ZodString>;
36
38
  label: z.ZodOptional<z.ZodString>;
37
- expires_in: z.ZodOptional<z.ZodString>;
38
39
  one_time_use: z.ZodOptional<z.ZodBoolean>;
39
40
  max_sessions: z.ZodOptional<z.ZodNumber>;
40
41
  session_duration: z.ZodOptional<z.ZodString>;
41
- custom_domain: z.ZodOptional<z.ZodString>;
42
42
  access_policy: z.ZodOptional<z.ZodObject<{
43
43
  ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
44
44
  ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -52,6 +52,7 @@ export declare function batchCreateTool(client: IQURLClient): {
52
52
  allow_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
53
  }, z.core.$strip>>;
54
54
  }, z.core.$strip>>;
55
+ expires_in: z.ZodOptional<z.ZodString>;
55
56
  }, z.core.$strip>>;
56
57
  }, z.core.$strip>;
57
58
  outputSchema: z.ZodObject<{
@@ -65,16 +66,16 @@ export declare function batchCreateTool(client: IQURLClient): {
65
66
  branded_domain: z.ZodOptional<z.ZodString>;
66
67
  qurl_site: z.ZodString;
67
68
  expires_at: z.ZodString;
68
- }, z.core.$strip>, z.ZodObject<{
69
+ }, z.core.$loose>, z.ZodObject<{
69
70
  index: z.ZodNumber;
70
71
  success: z.ZodLiteral<false>;
71
72
  error: z.ZodObject<{
72
73
  code: z.ZodString;
73
74
  message: z.ZodString;
74
- }, z.core.$strip>;
75
- }, z.core.$strip>], "success">>;
75
+ }, z.core.$loose>;
76
+ }, z.core.$loose>], "success">>;
76
77
  request_id: z.ZodOptional<z.ZodString>;
77
- }, z.core.$strip>;
78
+ }, z.core.$loose>;
78
79
  annotations: {
79
80
  title: string;
80
81
  readOnlyHint: boolean;
@@ -86,12 +87,11 @@ export declare function batchCreateTool(client: IQURLClient): {
86
87
  items: {
87
88
  target_url: string;
88
89
  type?: string | undefined;
90
+ custom_domain?: string | undefined;
89
91
  label?: string | undefined;
90
- expires_in?: string | undefined;
91
92
  one_time_use?: boolean | undefined;
92
93
  max_sessions?: number | undefined;
93
94
  session_duration?: string | undefined;
94
- custom_domain?: string | undefined;
95
95
  access_policy?: {
96
96
  ip_allowlist?: string[] | undefined;
97
97
  ip_denylist?: string[] | undefined;
@@ -105,6 +105,7 @@ export declare function batchCreateTool(client: IQURLClient): {
105
105
  allow_categories?: string[] | undefined;
106
106
  } | undefined;
107
107
  } | undefined;
108
+ expires_in?: string | undefined;
108
109
  }[];
109
110
  }) => Promise<{
110
111
  content: Array<{
@@ -1 +1 @@
1
- {"version":3,"file":"batch-create.d.ts","sourceRoot":"","sources":["../../src/tools/batch-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,cAAc,CAAC;AAanE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;iBAM5B,CAAC;AAEH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgElD"}
1
+ {"version":3,"file":"batch-create.d.ts","sourceRoot":"","sources":["../../src/tools/batch-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAWtB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;iBAM5B,CAAC;AAEH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,kBAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEjD"}
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { createQurlSchema } from "./create-qurl.js";
3
- import { toStructuredContent, withMissingApiKeyHandler } from "./_shared.js";
3
+ import { toStructuredContent, withMissingApiKeyHandler, } from "./_shared.js";
4
4
  import { batchCreateOutputSchema } from "./output-schemas.js";
5
5
  function isBatchPayload(value) {
6
6
  if (typeof value !== "object" || value === null)
@@ -10,16 +10,18 @@ function isBatchPayload(value) {
10
10
  }
11
11
  export const batchCreateSchema = z.object({
12
12
  items: z
13
- .array(createQurlSchema)
13
+ .array(createQurlSchema.omit({ email_delivery: true }))
14
14
  .min(1)
15
15
  .max(100)
16
16
  .describe("Array of qURL creation requests (1-100 items)"),
17
17
  });
18
- export function batchCreateTool(client) {
18
+ export function batchCreateTool(client, _runtime = { mode: "stdio" }) {
19
19
  return {
20
20
  name: "batch_create_qurls",
21
21
  title: "Batch Create qURLs",
22
22
  description: "Create up to 100 qURLs in a single request. The single-call alternative to looping `create_qurl` — saves round trips and returns a single envelope of per-item results. " +
23
+ "Only use this when the user explicitly wants multiple qURLs in one request. Never use it for a single URL, a single file, a single image, or a single attachment. " +
24
+ "Do not use this tool for uploaded files, image attachments, PDFs, or base64 file content — use `upload_file_data_qurl` (HTTP mode) or `upload_file_qurl` (stdio mode) instead. " +
23
25
  "**Not transactional:** items succeed or fail independently (see `succeeded`/`failed` counts and per-item `error`). " +
24
26
  "Use this when you need to mint many qURLs at once (e.g. provisioning a vendor list, distributing per-customer share links). " +
25
27
  "Use `create_qurl` for a single resource. " +
@@ -37,7 +39,7 @@ export function batchCreateTool(client) {
37
39
  openWorldHint: true,
38
40
  },
39
41
  handler: withMissingApiKeyHandler(async (input) => {
40
- const result = await client.batchCreate(input);
42
+ const result = await client.batchCreate(batchCreateSchema.parse(input));
41
43
  // Defense-in-depth: batchCreate passes through HTTP 400, which is
42
44
  // contracted to carry a BatchCreateResponse body with per-item errors.
43
45
  // If the API ever returns 400 with a different shape (e.g., a
@@ -1 +1 @@
1
- {"version":3,"file":"batch-create.js","sourceRoot":"","sources":["../../src/tools/batch-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,CAAC,GAAG,KAA2E,CAAC;IACtF,OAAO,CACL,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAC5F,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,CAAC;SACL,KAAK,CAAC,gBAAgB,CAAC;SACvB,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,CAAC,+CAA+C,CAAC;CAC7D,CAAC,CAAC;AAEH,MAAM,UAAU,eAAe,CAAC,MAAmB;IACjD,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,0KAA0K;YAC1K,qHAAqH;YACrH,8HAA8H;YAC9H,2CAA2C;YAC3C,oTAAoT;YACpT,kFAAkF;YAClF,wRAAwR;YACxR,2GAA2G;Q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I,CAAC,SAAS,CAAC,OAAO,CAAC;qBAC9B;iBACF;gBACD,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,CAAC;gBAC/C,OAAO,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC;aACzB,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -1,10 +1,19 @@
1
1
  import { z } from "zod";
2
2
  import type { IQURLClient } from "../client.js";
3
+ import { type ToolRuntimeOptions } from "./_shared.js";
4
+ export declare const MAX_ACCESS_POLICY_IP_ITEMS = 100;
5
+ export declare const MAX_ACCESS_POLICY_GEO_ITEMS = 50;
6
+ export declare const MAX_AI_AGENT_CATEGORY_ITEMS = 20;
7
+ export declare const MAX_ACCESS_POLICY_IP_CHARACTERS = 64;
8
+ export declare const MAX_ACCESS_POLICY_GEO_CHARACTERS = 8;
9
+ export declare const MAX_AI_AGENT_CATEGORY_CHARACTERS = 128;
10
+ export declare const MAX_RESOURCE_TYPE_CHARACTERS = 64;
3
11
  export declare const aiAgentPolicySchema: z.ZodObject<{
4
12
  block_all: z.ZodOptional<z.ZodBoolean>;
5
13
  deny_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
14
  allow_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
15
  }, z.core.$strip>;
16
+ export declare const MAX_USER_AGENT_REGEX_CHARACTERS = 256;
8
17
  export declare const accessPolicySchema: z.ZodObject<{
9
18
  ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
10
19
  ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -40,8 +49,13 @@ export declare const createQurlSchema: z.ZodObject<{
40
49
  allow_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
50
  }, z.core.$strip>>;
42
51
  }, z.core.$strip>>;
52
+ email_delivery: z.ZodOptional<z.ZodObject<{
53
+ to: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEmail>>;
54
+ subject: z.ZodOptional<z.ZodString>;
55
+ message: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>>;
43
57
  }, z.core.$strip>;
44
- export declare function createQurlTool(client: IQURLClient): {
58
+ export declare function createQurlTool(client: IQURLClient, runtime: ToolRuntimeOptions): {
45
59
  name: string;
46
60
  title: string;
47
61
  description: string;
@@ -67,17 +81,37 @@ export declare function createQurlTool(client: IQURLClient): {
67
81
  allow_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
82
  }, z.core.$strip>>;
69
83
  }, z.core.$strip>>;
84
+ email_delivery: z.ZodOptional<z.ZodObject<{
85
+ to: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEmail>>;
86
+ subject: z.ZodOptional<z.ZodString>;
87
+ message: z.ZodOptional<z.ZodString>;
88
+ }, z.core.$strip>>;
70
89
  }, z.core.$strip>;
71
90
  outputSchema: z.ZodObject<{
72
91
  qurl_id: z.ZodString;
73
92
  resource_id: z.ZodString;
74
93
  qurl_link: z.ZodString;
75
94
  branded_domain: z.ZodOptional<z.ZodString>;
76
- qurl_site: z.ZodString;
77
- expires_at: z.ZodString;
95
+ qurl_site: z.ZodOptional<z.ZodString>;
96
+ expires_at: z.ZodOptional<z.ZodString>;
78
97
  label: z.ZodOptional<z.ZodString>;
79
98
  type: z.ZodOptional<z.ZodString>;
80
- }, z.core.$strip>;
99
+ email_delivery: z.ZodOptional<z.ZodObject<{
100
+ attempted: z.ZodBoolean;
101
+ enabled: z.ZodBoolean;
102
+ recipients: z.ZodArray<z.ZodString>;
103
+ sent: z.ZodNumber;
104
+ failed: z.ZodNumber;
105
+ skipped_reason: z.ZodOptional<z.ZodString>;
106
+ results: z.ZodArray<z.ZodObject<{
107
+ email: z.ZodString;
108
+ success: z.ZodBoolean;
109
+ skipped: z.ZodBoolean;
110
+ error: z.ZodOptional<z.ZodString>;
111
+ message_id: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strip>>;
113
+ }, z.core.$strip>>;
114
+ }, z.core.$loose>;
81
115
  annotations: {
82
116
  title: string;
83
117
  readOnlyHint: boolean;
@@ -107,6 +141,11 @@ export declare function createQurlTool(client: IQURLClient): {
107
141
  allow_categories?: string[] | undefined;
108
142
  } | undefined;
109
143
  } | undefined;
144
+ email_delivery?: {
145
+ to: string[];
146
+ subject?: string | undefined;
147
+ message?: string | undefined;
148
+ } | undefined;
110
149
  }) => Promise<{
111
150
  content: Array<{
112
151
  type: "text";
@@ -1 +1 @@
1
- {"version":3,"file":"create-qurl.d.ts","sourceRoot":"","sources":["../../src/tools/create-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,eAAO,MAAM,mBAAmB;;;;iBAU9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;iBAc7B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;iBAsC3B,CAAC;AAEH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCjD"}
1
+ {"version":3,"file":"create-qurl.d.ts","sourceRoot":"","sources":["../../src/tools/create-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAStB,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAC9C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAClD,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD,eAAO,MAAM,gCAAgC,MAAM,CAAC;AACpD,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAI/C,eAAO,MAAM,mBAAmB;;;;iBAkB9B,CAAC;AAEH,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAGnD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;iBAgC7B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8C3B,CAAC;AAEH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsD9E"}
@@ -1,37 +1,53 @@
1
1
  import { z } from "zod";
2
- import { toStructuredContent, withMissingApiKeyHandler } from "./_shared.js";
2
+ import { allowsServerApiKeyFallback, withMissingApiKeyHandler, } from "./_shared.js";
3
+ import { emailDeliveryInputSchema, maybeDeliverToolEmail, singleLineEmailDetail, toEmailAugmentedResult, } from "./email-delivery.js";
3
4
  import { createQurlOutputSchema } from "./output-schemas.js";
5
+ export const MAX_ACCESS_POLICY_IP_ITEMS = 100;
6
+ export const MAX_ACCESS_POLICY_GEO_ITEMS = 50;
7
+ export const MAX_AI_AGENT_CATEGORY_ITEMS = 20;
8
+ export const MAX_ACCESS_POLICY_IP_CHARACTERS = 64;
9
+ export const MAX_ACCESS_POLICY_GEO_CHARACTERS = 8;
10
+ export const MAX_AI_AGENT_CATEGORY_CHARACTERS = 128;
11
+ export const MAX_RESOURCE_TYPE_CHARACTERS = 64;
12
+ const boundedPolicyList = (item, limit) => z.array(item).max(limit);
4
13
  export const aiAgentPolicySchema = z.object({
5
14
  block_all: z.boolean().optional().describe("Block all recognized AI agents"),
6
- deny_categories: z
7
- .array(z.string())
15
+ deny_categories: boundedPolicyList(z.string().min(1).max(MAX_AI_AGENT_CATEGORY_CHARACTERS), MAX_AI_AGENT_CATEGORY_ITEMS)
8
16
  .optional()
9
- .describe("AI agent categories to block (e.g., gptbot, commoncrawl)"),
10
- allow_categories: z
11
- .array(z.string())
17
+ .describe(`AI agent categories to block (e.g., gptbot, commoncrawl; max ${MAX_AI_AGENT_CATEGORY_ITEMS} entries, ${MAX_AI_AGENT_CATEGORY_CHARACTERS} chars each)`),
18
+ allow_categories: boundedPolicyList(z.string().min(1).max(MAX_AI_AGENT_CATEGORY_CHARACTERS), MAX_AI_AGENT_CATEGORY_ITEMS)
12
19
  .optional()
13
- .describe("AI agent categories to permit (all others blocked)"),
20
+ .describe(`AI agent categories to permit (all others blocked; max ${MAX_AI_AGENT_CATEGORY_ITEMS} entries, ${MAX_AI_AGENT_CATEGORY_CHARACTERS} chars each)`),
14
21
  });
22
+ export const MAX_USER_AGENT_REGEX_CHARACTERS = 256;
23
+ const userAgentRegexSchema = z.string().max(MAX_USER_AGENT_REGEX_CHARACTERS);
15
24
  export const accessPolicySchema = z.object({
16
- ip_allowlist: z.array(z.string()).optional().describe("Allowed IP addresses or CIDR ranges"),
17
- ip_denylist: z.array(z.string()).optional().describe("Denied IP addresses or CIDR ranges"),
18
- geo_allowlist: z
19
- .array(z.string())
25
+ ip_allowlist: boundedPolicyList(z.string().min(1).max(MAX_ACCESS_POLICY_IP_CHARACTERS), MAX_ACCESS_POLICY_IP_ITEMS)
20
26
  .optional()
21
- .describe("Allowed country codes (ISO 3166-1 alpha-2)"),
22
- geo_denylist: z
23
- .array(z.string())
27
+ .describe("Allowed IP addresses or CIDR ranges (max 100 entries, 64 chars each)"),
28
+ ip_denylist: boundedPolicyList(z.string().min(1).max(MAX_ACCESS_POLICY_IP_CHARACTERS), MAX_ACCESS_POLICY_IP_ITEMS)
24
29
  .optional()
25
- .describe("Denied country codes (ISO 3166-1 alpha-2)"),
26
- user_agent_allow_regex: z.string().optional().describe("Regex to allow matching user agents"),
27
- user_agent_deny_regex: z.string().optional().describe("Regex to deny matching user agents"),
30
+ .describe("Denied IP addresses or CIDR ranges (max 100 entries, 64 chars each)"),
31
+ geo_allowlist: boundedPolicyList(z.string().min(1).max(MAX_ACCESS_POLICY_GEO_CHARACTERS), MAX_ACCESS_POLICY_GEO_ITEMS)
32
+ .optional()
33
+ .describe("Allowed country codes (ISO 3166-1 alpha-2; max 50 entries, 8 chars each)"),
34
+ geo_denylist: boundedPolicyList(z.string().min(1).max(MAX_ACCESS_POLICY_GEO_CHARACTERS), MAX_ACCESS_POLICY_GEO_ITEMS)
35
+ .optional()
36
+ .describe("Denied country codes (ISO 3166-1 alpha-2; max 50 entries, 8 chars each)"),
37
+ user_agent_allow_regex: userAgentRegexSchema
38
+ .optional()
39
+ .describe(`Regex to allow matching user agents (max ${MAX_USER_AGENT_REGEX_CHARACTERS} chars)`),
40
+ user_agent_deny_regex: userAgentRegexSchema
41
+ .optional()
42
+ .describe(`Regex to deny matching user agents (max ${MAX_USER_AGENT_REGEX_CHARACTERS} chars)`),
28
43
  ai_agent_policy: aiAgentPolicySchema.optional().describe("Structured AI agent access control"),
29
44
  });
30
45
  export const createQurlSchema = z.object({
31
46
  type: z
32
47
  .string()
48
+ .max(MAX_RESOURCE_TYPE_CHARACTERS)
33
49
  .optional()
34
- .describe("Resource type for integrations allowed to mint non-url qURLs. Defaults to url."),
50
+ .describe(`Resource type for integrations allowed to mint non-url qURLs (max ${MAX_RESOURCE_TYPE_CHARACTERS} chars). Defaults to url.`),
35
51
  target_url: z.string().url().describe("The URL to protect with qURL"),
36
52
  label: z
37
53
  .string()
@@ -59,22 +75,27 @@ export const createQurlSchema = z.object({
59
75
  .optional()
60
76
  .describe("Custom domain to assign to the auto-created resource (max 253 chars, must be registered/active/owned)."),
61
77
  access_policy: accessPolicySchema.optional().describe("Access control policy for the qURL"),
78
+ email_delivery: emailDeliveryInputSchema
79
+ .optional()
80
+ .describe("Optional email notification settings for sending the generated qURL to one or more recipients."),
62
81
  });
63
- export function createQurlTool(client) {
82
+ export function createQurlTool(client, runtime) {
64
83
  return {
65
84
  name: "create_qurl",
66
85
  title: "Create qURL",
67
86
  description: "Create a qURL — a policy-bound, expiring access link that gates a target URL with optional IP/geo/UA/AI-agent filters and time or session limits. " +
68
87
  "**When to use:** minting a fresh protected access link for share-once or time-limited access (e.g. send a customer a 24-hour download link, gate a doc behind an IP allowlist, distribute a one-time-use credential to a contractor). " +
69
- "**When NOT to use:** use `mint_link` when you already have a resource (`r_…`) and just need an additional access token under it — `create_qurl` identifies the resource by target URL and may return an existing same-type resource grouping. " +
88
+ "**Do NOT use this for chat-uploaded images, PDFs, screenshots, or file attachments.** In HTTP MCP mode, those should go through `upload_file_data_qurl`; in stdio mode, use `upload_file_qurl`. " +
89
+ "**When NOT to use:** use `mint_link` when you already have a resource identifier and just need an additional access token under it — `create_qurl` identifies the resource by target URL and may return an existing same-type resource grouping. " +
70
90
  "Use `batch_create_qurls` to create many in one round-trip. " +
71
91
  "Use `update_qurl` to retag or extend an existing resource without minting a new one. " +
92
+ "If the user says 'give me the qURL of this image/file' and the content was uploaded in chat, this is the wrong tool. " +
72
93
  "**Behavior:** not idempotent — calling twice produces two distinct qURL tokens, though both may share the same `resource_id` when the target URL groups to an existing same-type resource (this tool doesn't surface the underlying API's `Idempotency-Key` header). " +
73
94
  "The returned `qurl_link` is shown ONCE in this response and is never recoverable through `get_qurl` or `list_qurls`; persist or share it immediately. " +
74
95
  "A returned resource is in `active` status with the policy and per-token limits applied. " +
75
96
  "If `expires_in` is omitted the API defaults to **24h** — do not assume the link is permanent. " +
76
97
  "`max_sessions` is per minted qURL, not resource-wide; set `one_time_use: false` explicitly when you need `max_sessions: 0` to mean unlimited visitors. " +
77
- "**Returns:** `{ qurl_id: string (q_…), resource_id: string (r_…), qurl_link: string (shown once), branded_domain?: string, qurl_site: string, expires_at: string (RFC 3339), label?: string, type?: string }`. " +
98
+ "**Returns:** `{ qurl_id: string (q_…), resource_id: string, qurl_link: string (shown once), branded_domain?: string, qurl_site: string, expires_at: string (RFC 3339), label?: string, type?: string }`. " +
78
99
  "`qurl_id` is the only `q_…` display ID an agent gets in this response — keep it if you plan a follow-up against `get_qurl`/`update_qurl`/`mint_link` (which accept either prefix). " +
79
100
  "Example: `create_qurl({ target_url: 'https://example.com/private', expires_in: '24h', one_time_use: true, access_policy: { geo_allowlist: ['US'] } })`.",
80
101
  inputSchema: createQurlSchema,
@@ -87,16 +108,28 @@ export function createQurlTool(client) {
87
108
  openWorldHint: true,
88
109
  },
89
110
  handler: withMissingApiKeyHandler(async (input) => {
90
- const result = await client.createQURL(input);
91
- return {
92
- content: [
93
- {
94
- type: "text",
95
- text: JSON.stringify(result.data),
96
- },
111
+ const { email_delivery, ...createInput } = input;
112
+ const result = await client.createQURL(createInput);
113
+ const emailResult = await maybeDeliverToolEmail({
114
+ allowServerApiKeyFallback: allowsServerApiKeyFallback(runtime),
115
+ delivery: email_delivery,
116
+ defaultSubject: "Your secure qURL link is ready",
117
+ detailLines: [
118
+ "A secure qURL link has been created for you.",
119
+ `Secure Link: ${singleLineEmailDetail(result.data.qurl_link)}`,
120
+ // The SDK type requires expires_at; keep the guard so upstream
121
+ // response drift cannot render "undefined" into a customer email.
122
+ ...(result.data.expires_at
123
+ ? [`Expires At: ${singleLineEmailDetail(result.data.expires_at)}`]
124
+ : []),
125
+ ...(result.data.qurl_site
126
+ ? [`qURL Site: ${singleLineEmailDetail(result.data.qurl_site)}`]
127
+ : []),
128
+ ...(result.data.label ? [`Label: ${singleLineEmailDetail(result.data.label)}`] : []),
129
+ ...(result.data.type ? [`Type: ${singleLineEmailDetail(result.data.type)}`] : []),
97
130
  ],
98
- structuredContent: toStructuredContent(result.data),
99
- };
131
+ });
132
+ return toEmailAugmentedResult(result.data, emailResult);
100
133
  }),
101
134
  };
102
135
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create-qurl.js","sourceRoot":"","sources":["../../src/tools/create-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,C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AAI,CAAC,SAAS;wBACvB,CAAC,CAAC,CAAC,cAAc,qBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;wBAChE,CAAC,CAAC,EAAE,CAAC;oBACP,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,qBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACpF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,qBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;iBAClF;aACF,CAAC,CAAC;YACH,OAAO,sBAAsB,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC1D,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import { z } from "zod";
2
2
  import { type IQURLClient } from "../client.js";
3
+ import { type ToolRuntimeOptions } from "./_shared.js";
3
4
  export declare const deleteQurlSchema: z.ZodObject<{
4
5
  resource_id: z.ZodString;
5
6
  }, z.core.$strip>;
6
- export declare function deleteQurlTool(client: IQURLClient): {
7
+ export declare function deleteQurlTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
7
8
  name: string;
8
9
  title: string;
9
10
  description: string;
@@ -15,7 +16,7 @@ export declare function deleteQurlTool(client: IQURLClient): {
15
16
  revoked: z.ZodLiteral<true>;
16
17
  was_already_revoked: z.ZodBoolean;
17
18
  message: z.ZodString;
18
- }, z.core.$strip>;
19
+ }, z.core.$loose>;
19
20
  annotations: {
20
21
  title: string;
21
22
  readOnlyHint: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"delete-qurl.d.ts","sourceRoot":"","sources":["../../src/tools/delete-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,cAAc,CAAC;AAI9D,eAAO,MAAM,gBAAgB;;iBAY3B,CAAC;AAEH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwEjD"}
1
+ {"version":3,"file":"delete-qurl.d.ts","sourceRoot":"","sources":["../../src/tools/delete-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAGtB,eAAO,MAAM,gBAAgB;;iBAE3B,CAAC;AAEH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,kBAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyEjD"}
@@ -1,18 +1,11 @@
1
1
  import { z } from "zod";
2
2
  import { QURLAPIError } from "../client.js";
3
- import { withMissingApiKeyHandler } from "./_shared.js";
3
+ import { resourceOnlyIdSchema, withMissingApiKeyHandler, } from "./_shared.js";
4
4
  import { deleteQurlOutputSchema } from "./output-schemas.js";
5
5
  export const deleteQurlSchema = z.object({
6
- // DELETE only accepts r_ (resource) IDs per the API spec — unlike
7
- // get/update/extend/mint_link which also accept q_ prefixes. Reject
8
- // non-r_ IDs at the schema boundary so agents get a clear error
9
- // instead of a confusing API-side rejection.
10
- resource_id: z
11
- .string()
12
- .regex(/^r_[a-z0-9_-]{11}$/, "delete_qurl only accepts resource IDs (r_ prefix). Use update_qurl or mint_link for q_ IDs.")
13
- .describe("The resource ID (r_ prefix). delete_qurl does not accept q_ (qURL display) IDs."),
6
+ resource_id: resourceOnlyIdSchema("revoke (all tokens; q_ display IDs are not accepted)"),
14
7
  });
15
- export function deleteQurlTool(client) {
8
+ export function deleteQurlTool(client, _runtime = { mode: "stdio" }) {
16
9
  return {
17
10
  name: "delete_qurl",
18
11
  title: "Delete qURL",
@@ -1 +1 @@
1
- {"version":3,"file":"delete-qurl.js","sourceRoot":"","sources":["../../src/tools/delete-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,kEAAkE;IAClE,oEAAoE;IACpE,gEAAgE;IAChE,6CAA6C;IAC7C,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,KAAK,CACJ,oBAAoB,EACpB,6FAA6F,CAC9F;SACA,QAAQ,CAAC,iFAAiF,CAAC;CAC/F,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc,CAAC,MAAmB;IAChD,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,aAAa;QACpB,WAAW,EACT,iGAAiG;YACjG,2IAA2I;YAC3I,+IAA+I;YAC/I,mEAAmE;YACnE,oOAAoO;YACpO,uGAAuG;YACvG,oKAAoK;YACpK,4HAA4H;QAC9H,WAAW,EAAE,gBAAgB;QAC7B,YAAY,EAAE,sBAAsB;QACpC,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;QACD,OAAO,EAAE,wBAAwB,CAAC,KAAK,EAAE,KAAuC,EAAE,EAAE;YAClF,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAC9B,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,C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DAAwD;gBACxD,+DAA+D;gBAC/D,2DAA2D;gBAC3D,8BAA8B;gBAC9B,IAAI,CAAC,CAAC,GAAG,YAAY,YAAY,CAAC,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG;oBAAE,MAAM,GAAG,CAAC;gBACxE,iBAAiB,GAAG,IAAI,CAAC;YAC3B,CAAC;YACD,MAAM,OAAO,GAAG;gBACd,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,OAAO,EAAE,IAAa;gBACtB,mBAAmB,EAAE,iBAAiB;gBACtC,OAAO,EAAE,QAAQ,KAAK,CAAC,WAAW,cAAc;aACjD,CAAC;YACF,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,OAAO,CAAC,OAAO;qBACtB;iBACF;gBACD,iBAAiB,EAAE,OAAO;aAC3B,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ import type { EmailDeliveryResult } from "../email-types.js";
3
+ export declare const emailDeliveryInputSchema: z.ZodObject<{
4
+ to: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEmail>>;
5
+ subject: z.ZodOptional<z.ZodString>;
6
+ message: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export type EmailDeliveryInput = z.infer<typeof emailDeliveryInputSchema>;
9
+ export interface ToolEmailInput {
10
+ allowServerApiKeyFallback: boolean;
11
+ delivery?: EmailDeliveryInput;
12
+ defaultSubject: string;
13
+ detailLines: string[];
14
+ }
15
+ export interface UploadEmailDetails {
16
+ intro: string;
17
+ fileName: string;
18
+ contentType: string;
19
+ qurlLink: string;
20
+ expiresAt?: string;
21
+ qurlSite?: string;
22
+ label?: string;
23
+ extraLines?: string[];
24
+ }
25
+ export declare function singleLineEmailDetail(value: string): string;
26
+ export declare function uploadEmailDetailLines(details: UploadEmailDetails): string[];
27
+ export declare function toEmailAugmentedResult<T extends object & {
28
+ length?: never;
29
+ }>(base: T, emailResult: EmailDeliveryResult | undefined): {
30
+ content: {
31
+ type: "text";
32
+ text: string;
33
+ }[];
34
+ structuredContent: Record<string, unknown>;
35
+ };
36
+ export declare function maybeDeliverToolEmail(input: ToolEmailInput): Promise<EmailDeliveryResult | undefined>;
37
+ //# sourceMappingURL=email-delivery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-delivery.d.ts","sourceRoot":"","sources":["../../src/tools/email-delivery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAM7D,eAAO,MAAM,wBAAwB;;;;iBAuBnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,MAAM,WAAW,cAAc;IAC7B,yBAAyB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAW5E;AAID,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,EAC1E,IAAI,EAAE,CAAC,EACP,WAAW,EAAE,mBAAmB,GAAG,SAAS;;;;;;EAO7C;AAiCD,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CA2C1C"}
@@ -0,0 +1,115 @@
1
+ import { z } from "zod";
2
+ import { normalizedEmailAddressSchema, uniqueRecipients } from "../email-addresses.js";
3
+ import { EmailDeliverySetupError, MAX_EMAIL_SUBJECT_CHARACTERS, MAX_EMAIL_TEXT_CHARACTERS, } from "../email-types.js";
4
+ import { formatErrorForLog } from "../logging.js";
5
+ import { sendEmailMessage } from "../services/email.js";
6
+ import { flattenControlCharacters } from "../text.js";
7
+ import { toStructuredContent } from "./_shared.js";
8
+ export const emailDeliveryInputSchema = z.object({
9
+ to: z
10
+ .array(normalizedEmailAddressSchema)
11
+ .min(1)
12
+ .max(100)
13
+ .describe("One or more recipient email addresses. The server's SMTP recipient policy may enforce a lower limit."),
14
+ subject: z
15
+ .string()
16
+ .max(MAX_EMAIL_SUBJECT_CHARACTERS)
17
+ .refine((subject) => !/[\r\n]/.test(subject), "Subject must be a single line.")
18
+ .optional()
19
+ .describe("Optional single-line email subject. Defaults to a tool-specific subject when omitted."),
20
+ message: z
21
+ .string()
22
+ .max(5000)
23
+ .optional()
24
+ .describe(`Optional plain-text message to prepend above generated qURL details. The final assembled email is limited to ${MAX_EMAIL_TEXT_CHARACTERS.toLocaleString("en-US")} characters.`),
25
+ });
26
+ export function singleLineEmailDetail(value) {
27
+ return flattenControlCharacters(value);
28
+ }
29
+ export function uploadEmailDetailLines(details) {
30
+ return [
31
+ details.intro,
32
+ `File Name: ${singleLineEmailDetail(details.fileName)}`,
33
+ `Content Type: ${singleLineEmailDetail(details.contentType)}`,
34
+ `Secure Link: ${singleLineEmailDetail(details.qurlLink)}`,
35
+ ...(details.expiresAt ? [`Expires At: ${singleLineEmailDetail(details.expiresAt)}`] : []),
36
+ ...(details.qurlSite ? [`qURL Site: ${singleLineEmailDetail(details.qurlSite)}`] : []),
37
+ ...(details.label ? [`Label: ${singleLineEmailDetail(details.label)}`] : []),
38
+ ...(details.extraLines ?? []),
39
+ ];
40
+ }
41
+ // Match toStructuredContent's plain-object boundary; `length?: never` keeps
42
+ // arrays from being silently spread into numeric object keys.
43
+ export function toEmailAugmentedResult(base, emailResult) {
44
+ const payload = emailResult ? { ...base, email_delivery: emailResult } : base;
45
+ return {
46
+ content: [{ type: "text", text: JSON.stringify(payload) }],
47
+ structuredContent: toStructuredContent(payload),
48
+ };
49
+ }
50
+ function getSanitizedDeliveryFailureReason(error) {
51
+ if (error instanceof EmailDeliverySetupError) {
52
+ switch (error.kind) {
53
+ case "authorization":
54
+ return "Email delivery authorization context was unavailable.";
55
+ case "smtp":
56
+ return "Email delivery was not attempted because SMTP configuration or connection failed.";
57
+ case "input":
58
+ return "Email delivery was not attempted because recipient or message validation failed.";
59
+ }
60
+ }
61
+ return "Email delivery was not attempted because delivery setup failed.";
62
+ }
63
+ function skippedDeliveryResult(recipients, skippedReason) {
64
+ return {
65
+ attempted: false,
66
+ enabled: true,
67
+ recipients,
68
+ sent: 0,
69
+ failed: recipients.length,
70
+ results: recipients.map((email) => ({
71
+ email,
72
+ success: false,
73
+ skipped: true,
74
+ error: skippedReason,
75
+ })),
76
+ skipped_reason: skippedReason,
77
+ };
78
+ }
79
+ export async function maybeDeliverToolEmail(input) {
80
+ if (!input.delivery)
81
+ return undefined;
82
+ const subject = flattenControlCharacters(input.delivery.subject?.trim() || input.defaultSubject.trim());
83
+ // Preserve formatting in the caller-authored message because it is sent only
84
+ // as the plain-text body. Generated detail fields are flattened separately
85
+ // so an untrusted value cannot visually create another structured detail row.
86
+ const sections = [
87
+ input.delivery.message?.trim(),
88
+ input.detailLines.join("\n"),
89
+ "Sent by qURL.",
90
+ ].filter((section) => typeof section === "string" && section.length > 0);
91
+ const text = sections.join("\n\n");
92
+ const recipients = uniqueRecipients(input.delivery.to);
93
+ // Fail with a structured skipped result here for tool callers. The service
94
+ // repeats this boundary check because it is also exported for direct use.
95
+ // Match Zod's UTF-16-unit maxLength semantics for caller-provided sections.
96
+ if (text.length > MAX_EMAIL_TEXT_CHARACTERS) {
97
+ return skippedDeliveryResult(recipients, `Email delivery was not attempted because the assembled message exceeds ${MAX_EMAIL_TEXT_CHARACTERS.toLocaleString("en-US")} characters.`);
98
+ }
99
+ try {
100
+ return await sendEmailMessage({
101
+ to: recipients,
102
+ subject,
103
+ text,
104
+ }, { allowServerApiKeyFallback: input.allowServerApiKeyFallback });
105
+ }
106
+ catch (error) {
107
+ // Link creation has already succeeded when this helper runs. Never turn a
108
+ // delivery failure into a failed tool call because qurl_link is one-shot
109
+ // output that cannot be recovered later.
110
+ console.error(`Email delivery failed after qURL creation (${formatErrorForLog(error)})`);
111
+ const skippedReason = getSanitizedDeliveryFailureReason(error);
112
+ return skippedDeliveryResult(recipients, skippedReason);
113
+ }
114
+ }
115
+ //# sourceMappingURL=email-delivery.js.map