@layervai/qurl-mcp 0.5.0 → 0.7.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 (91) hide show
  1. package/README.md +209 -48
  2. package/dist/client.d.ts +65 -10
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +103 -5
  5. package/dist/client.js.map +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +10 -3
  8. package/dist/index.js.map +1 -1
  9. package/dist/prompts/audit-links.js +1 -1
  10. package/dist/prompts/audit-links.js.map +1 -1
  11. package/dist/qurl-cli.d.ts +96 -0
  12. package/dist/qurl-cli.d.ts.map +1 -0
  13. package/dist/qurl-cli.js +331 -0
  14. package/dist/qurl-cli.js.map +1 -0
  15. package/dist/server.d.ts +14 -1
  16. package/dist/server.d.ts.map +1 -1
  17. package/dist/server.js +39 -0
  18. package/dist/server.js.map +1 -1
  19. package/dist/tools/_shared.d.ts +1 -0
  20. package/dist/tools/_shared.d.ts.map +1 -1
  21. package/dist/tools/_shared.js +6 -1
  22. package/dist/tools/_shared.js.map +1 -1
  23. package/dist/tools/consumer-access.d.ts +235 -0
  24. package/dist/tools/consumer-access.d.ts.map +1 -0
  25. package/dist/tools/consumer-access.js +231 -0
  26. package/dist/tools/consumer-access.js.map +1 -0
  27. package/dist/tools/create-qurl.d.ts.map +1 -1
  28. package/dist/tools/create-qurl.js +6 -2
  29. package/dist/tools/create-qurl.js.map +1 -1
  30. package/dist/tools/delete-qurl.d.ts.map +1 -1
  31. package/dist/tools/delete-qurl.js +6 -3
  32. package/dist/tools/delete-qurl.js.map +1 -1
  33. package/dist/tools/duration.d.ts +13 -0
  34. package/dist/tools/duration.d.ts.map +1 -0
  35. package/dist/tools/duration.js +71 -0
  36. package/dist/tools/duration.js.map +1 -0
  37. package/dist/tools/email-delivery.d.ts +0 -1
  38. package/dist/tools/email-delivery.d.ts.map +1 -1
  39. package/dist/tools/email-delivery.js +0 -1
  40. package/dist/tools/email-delivery.js.map +1 -1
  41. package/dist/tools/extend-qurl.d.ts +14 -1
  42. package/dist/tools/extend-qurl.d.ts.map +1 -1
  43. package/dist/tools/extend-qurl.js +179 -18
  44. package/dist/tools/extend-qurl.js.map +1 -1
  45. package/dist/tools/get-qurl.d.ts +7 -0
  46. package/dist/tools/get-qurl.d.ts.map +1 -1
  47. package/dist/tools/list-qurls.d.ts +7 -0
  48. package/dist/tools/list-qurls.d.ts.map +1 -1
  49. package/dist/tools/local-cli.d.ts +44 -0
  50. package/dist/tools/local-cli.d.ts.map +1 -0
  51. package/dist/tools/local-cli.js +855 -0
  52. package/dist/tools/local-cli.js.map +1 -0
  53. package/dist/tools/mint-link.d.ts.map +1 -1
  54. package/dist/tools/mint-link.js +2 -1
  55. package/dist/tools/mint-link.js.map +1 -1
  56. package/dist/tools/output-schemas.d.ts +56 -4
  57. package/dist/tools/output-schemas.d.ts.map +1 -1
  58. package/dist/tools/output-schemas.js +62 -11
  59. package/dist/tools/output-schemas.js.map +1 -1
  60. package/dist/tools/share-by-crid.d.ts +52 -0
  61. package/dist/tools/share-by-crid.d.ts.map +1 -0
  62. package/dist/tools/share-by-crid.js +114 -0
  63. package/dist/tools/share-by-crid.js.map +1 -0
  64. package/dist/tools/update-qurl-token.d.ts.map +1 -1
  65. package/dist/tools/update-qurl-token.js +6 -7
  66. package/dist/tools/update-qurl-token.js.map +1 -1
  67. package/dist/tools/update-qurl.d.ts +7 -0
  68. package/dist/tools/update-qurl.d.ts.map +1 -1
  69. package/dist/tools/update-qurl.js +6 -7
  70. package/dist/tools/update-qurl.js.map +1 -1
  71. package/dist/tools/upload-file-data-qurl.d.ts +17 -61
  72. package/dist/tools/upload-file-data-qurl.d.ts.map +1 -1
  73. package/dist/tools/upload-file-data-qurl.js +16 -9
  74. package/dist/tools/upload-file-data-qurl.js.map +1 -1
  75. package/dist/tools/upload-file-qurl.d.ts +27 -55
  76. package/dist/tools/upload-file-qurl.d.ts.map +1 -1
  77. package/dist/tools/upload-file-qurl.js +19 -12
  78. package/dist/tools/upload-file-qurl.js.map +1 -1
  79. package/dist/tools/upload-file-shared.d.ts +27 -10
  80. package/dist/tools/upload-file-shared.d.ts.map +1 -1
  81. package/dist/tools/upload-file-shared.js +313 -43
  82. package/dist/tools/upload-file-shared.js.map +1 -1
  83. package/dist/tools/upload-mint-options.d.ts +14 -14
  84. package/dist/tools/upload-mint-options.d.ts.map +1 -1
  85. package/dist/tools/upload-mint-options.js +33 -15
  86. package/dist/tools/upload-mint-options.js.map +1 -1
  87. package/dist/tools/upload-text-qurl.d.ts +15 -47
  88. package/dist/tools/upload-text-qurl.d.ts.map +1 -1
  89. package/dist/tools/upload-text-qurl.js +11 -7
  90. package/dist/tools/upload-text-qurl.js.map +1 -1
  91. package/package.json +7 -7
@@ -1,29 +1,47 @@
1
1
  import { z } from "zod";
2
- import { accessPolicySchema } from "./create-qurl.js";
2
+ import { durationSchema, MAX_EXPIRY_MS, MAX_SESSION_MS, MIN_EXPIRY_MS, MIN_SESSION_MS, parseDurationMs, } from "./duration.js";
3
+ // The file connector mints uploaded-file links, and its mint contract carries
4
+ // no access policy or session cap. Reject them before the upload instead of
5
+ // silently minting a link without the restriction the caller asked for.
6
+ // This guards the two named options only; the schema is not strict, so other
7
+ // unknown keys are still stripped, as for every tool.
8
+ // z.null() emits a portable {"type":"null"} that advertises "no value here";
9
+ // `not` (from z.never) is dropped or rejected by some non-TypeScript hosts.
10
+ // null itself is tolerated: some hosts serialize unused optional fields that way.
11
+ const unsupportedForUploads = (field) => z
12
+ .null({ error: `${field} is not supported for uploaded files` })
13
+ .optional()
14
+ .describe(`Not supported for uploaded files; a non-null ${field} rejects the request.`);
15
+ // Upload links cannot be revoked from this server (#281), so their lifetime is
16
+ // never left to the connector's default.
17
+ export const DEFAULT_UPLOAD_EXPIRES_IN = "24h";
3
18
  export const uploadMintOptionsShape = {
19
+ // label is not a restriction, so unlike access_policy/max_sessions it is kept:
20
+ // it still drives the email and the text-PDF title, only not the link.
4
21
  label: z
5
22
  .string()
6
23
  .min(1)
7
24
  .max(500)
8
25
  .optional()
9
- .describe("Human-readable label identifying who this qURL is for (max 500 chars)"),
10
- expires_in: z.string().min(1).optional().describe('Duration string (e.g., "1h", "24h", "7d")'),
26
+ .describe("Used only in email delivery and as upload_text_qurl's PDF title (max 500 chars); without email_delivery it has no effect on file uploads. It is not attached to the minted link, so the link cannot be found by label afterward."),
27
+ expires_in: durationSchema(MIN_EXPIRY_MS, MAX_EXPIRY_MS, "1m to 30d")
28
+ .optional()
29
+ .describe(`Link lifetime (e.g., "1h", "24h", "7d"; max 30d; default ${DEFAULT_UPLOAD_EXPIRES_IN}), converted to an absolute expiry using this server's clock`),
11
30
  one_time_use: z
12
31
  .boolean()
13
32
  .optional()
14
33
  .describe("Whether the link can only be used once. Defaults to true for uploaded content."),
15
- max_sessions: z
16
- .number()
17
- .int()
18
- .min(0)
19
- .max(1000)
20
- .optional()
21
- .describe("Maximum concurrent sessions for this qURL token (max 1000). Set one_time_use to false explicitly for 0 to mean unlimited visitors."),
22
- session_duration: z
23
- .string()
24
- .min(1)
34
+ session_duration: durationSchema(MIN_SESSION_MS, MAX_SESSION_MS, "1s to 24h")
35
+ .refine((value) => (parseDurationMs(value) ?? 0) % 1000 === 0, {
36
+ message: "Uploaded-file session_duration must be a whole number of seconds",
37
+ })
25
38
  .optional()
26
- .describe('How long access lasts after clicking (e.g., "1h")'),
27
- access_policy: accessPolicySchema.optional().describe("Access control policy for this link"),
39
+ .describe('How long access lasts after clicking (e.g., "1h"; whole seconds, max 24h)'),
40
+ max_sessions: unsupportedForUploads("max_sessions"),
41
+ access_policy: unsupportedForUploads("access_policy"),
28
42
  };
43
+ export const uploadMintOptionsSchema = z.object(uploadMintOptionsShape);
44
+ // Shared by the three upload tools so their descriptions cannot drift apart.
45
+ export const UPLOAD_LINK_DESCRIPTION = "Uploaded-file links support `expires_in`, `one_time_use`, and `session_duration`; `access_policy` and `max_sessions` must be omitted or null. **Revocation:** a link created here cannot be revoked from this server; `delete_qurl` on the returned `resource_id` does not stop it (revocation needs the connector's `/api/revoke_links`). Use a short `expires_in` and `one_time_use` for sensitive files. `one_time_use` defaults to `true`, so set it to `false` when emailing the link to more than one recipient. `label` names the email and PDF only; it is not attached to the link, so `list_qurls` cannot find the link by it. ";
46
+ export const UPLOAD_RETURNS_DESCRIPTION = "**Returns:** `{ resource_id: string, qurl_id?: string, qurl_link: string, expires_at?: string, requested_expires_at?: string, expires_at_differs_from_request?: boolean, expires_at_later_than_requested?: boolean, expires_at_already_past?: boolean, expires_at_unconfirmed?: boolean, unexpected_extra_link_count?: number, unexpected_extra_qurl_ids?: string[], file_name: string, content_type: string, size_bytes: number, email_delivery?: object }`. If `unexpected_extra_link_count` is present, the connector reported extra possibly live links: tell the user (`unexpected_extra_qurl_ids` lists at most 10 of them, so it may be incomplete). If `expires_at_differs_from_request` is set, tell the user the actual `expires_at` (and stress it when `expires_at_later_than_requested` is set, since the link outlives the request); if `expires_at_already_past` is set, warn that the link may already be dead; if `expires_at_unconfirmed` is set, say the link's lifetime is unknown.";
29
47
  //# sourceMappingURL=upload-mint-options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"upload-mint-options.js","sourceRoot":"","sources":["../../src/tools/upload-mint-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,uEAAuE,CAAC;IACpF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IAC9F,YAAY,E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AAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,kOAAkO,CACnO;IACH,UAAU,EAAE,cAAc,CAAC,aAAa,EAAE,aAAa,EAAE,WAAW,CAAC;SAClE,QAAQ,EAAE;SACV,QAAQ,CACP,4DAA4D,yBAAyB,8DAA8D,CACpJ;IACH,YAAY,EAAE,CAAC;SACZ,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,gFAAgF,CAAC;IAC7F,gBAAgB,EAAE,cAAc,CAAC,cAAc,EAAE,cAAc,EAAE,WAAW,CAAC;SAC1E,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,EAAE;QAC7D,OAAO,EAAE,kEAAkE;KAC5E,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,2EAA2E,CAAC;IACxF,YAAY,EAAE,qBAAqB,CAAC,cAAc,CAAC;IACnD,aAAa,EAAE,qBAAqB,CAAC,eAAe,CAAC;CACtD,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAGxE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAClC,2mBAA2mB,CAAC;AAC9mB,MAAM,CAAC,MAAM,0BAA0B,GACrC,y8BAAy8B,CAAC"}
@@ -18,23 +18,11 @@ export declare const uploadTextQurlSchema: z.ZodObject<{
18
18
  label: z.ZodOptional<z.ZodString>;
19
19
  expires_in: z.ZodOptional<z.ZodString>;
20
20
  one_time_use: z.ZodOptional<z.ZodBoolean>;
21
- max_sessions: z.ZodOptional<z.ZodNumber>;
22
21
  session_duration: z.ZodOptional<z.ZodString>;
23
- access_policy: z.ZodOptional<z.ZodObject<{
24
- ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
25
- ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString>>;
26
- geo_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
27
- geo_denylist: z.ZodOptional<z.ZodArray<z.ZodString>>;
28
- user_agent_allow_regex: z.ZodOptional<z.ZodString>;
29
- user_agent_deny_regex: z.ZodOptional<z.ZodString>;
30
- ai_agent_policy: z.ZodOptional<z.ZodObject<{
31
- block_all: z.ZodOptional<z.ZodBoolean>;
32
- deny_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
- allow_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
34
- }, z.core.$strip>>;
35
- }, z.core.$strip>>;
22
+ max_sessions: z.ZodOptional<z.ZodNull>;
23
+ access_policy: z.ZodOptional<z.ZodNull>;
36
24
  }, z.core.$strip>;
37
- export declare function uploadTextQurlTool(client: IQURLClient, runtime: ToolRuntimeOptions): {
25
+ export declare function uploadTextQurlTool(_client: IQURLClient, runtime: ToolRuntimeOptions): {
38
26
  name: string;
39
27
  title: string;
40
28
  description: string;
@@ -55,33 +43,25 @@ export declare function uploadTextQurlTool(client: IQURLClient, runtime: ToolRun
55
43
  label: z.ZodOptional<z.ZodString>;
56
44
  expires_in: z.ZodOptional<z.ZodString>;
57
45
  one_time_use: z.ZodOptional<z.ZodBoolean>;
58
- max_sessions: z.ZodOptional<z.ZodNumber>;
59
46
  session_duration: z.ZodOptional<z.ZodString>;
60
- access_policy: z.ZodOptional<z.ZodObject<{
61
- ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
- ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString>>;
63
- geo_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
- geo_denylist: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
- user_agent_allow_regex: z.ZodOptional<z.ZodString>;
66
- user_agent_deny_regex: z.ZodOptional<z.ZodString>;
67
- ai_agent_policy: z.ZodOptional<z.ZodObject<{
68
- block_all: z.ZodOptional<z.ZodBoolean>;
69
- deny_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
- allow_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
- }, z.core.$strip>>;
72
- }, z.core.$strip>>;
47
+ max_sessions: z.ZodOptional<z.ZodNull>;
48
+ access_policy: z.ZodOptional<z.ZodNull>;
73
49
  }, z.core.$strip>;
74
50
  outputSchema: z.ZodObject<{
75
51
  resource_id: z.ZodString;
76
- qurl_id: z.ZodString;
52
+ qurl_id: z.ZodOptional<z.ZodString>;
77
53
  qurl_link: z.ZodString;
78
- qurl_site: z.ZodOptional<z.ZodString>;
79
54
  expires_at: z.ZodOptional<z.ZodString>;
55
+ requested_expires_at: z.ZodOptional<z.ZodString>;
56
+ expires_at_differs_from_request: z.ZodOptional<z.ZodBoolean>;
57
+ expires_at_later_than_requested: z.ZodOptional<z.ZodBoolean>;
58
+ expires_at_already_past: z.ZodOptional<z.ZodBoolean>;
59
+ expires_at_unconfirmed: z.ZodOptional<z.ZodBoolean>;
60
+ unexpected_extra_link_count: z.ZodOptional<z.ZodNumber>;
61
+ unexpected_extra_qurl_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
80
62
  file_name: z.ZodString;
81
63
  content_type: z.ZodString;
82
64
  size_bytes: z.ZodNumber;
83
- branded_domain: z.ZodOptional<z.ZodString>;
84
- type: z.ZodOptional<z.ZodString>;
85
65
  email_delivery: z.ZodOptional<z.ZodObject<{
86
66
  attempted: z.ZodBoolean;
87
67
  enabled: z.ZodBoolean;
@@ -117,21 +97,9 @@ export declare function uploadTextQurlTool(client: IQURLClient, runtime: ToolRun
117
97
  label?: string | undefined;
118
98
  expires_in?: string | undefined;
119
99
  one_time_use?: boolean | undefined;
120
- max_sessions?: number | undefined;
121
100
  session_duration?: string | undefined;
122
- access_policy?: {
123
- ip_allowlist?: string[] | undefined;
124
- ip_denylist?: string[] | undefined;
125
- geo_allowlist?: string[] | undefined;
126
- geo_denylist?: string[] | undefined;
127
- user_agent_allow_regex?: string | undefined;
128
- user_agent_deny_regex?: string | undefined;
129
- ai_agent_policy?: {
130
- block_all?: boolean | undefined;
131
- deny_categories?: string[] | undefined;
132
- allow_categories?: string[] | undefined;
133
- } | undefined;
134
- } | undefined;
101
+ max_sessions?: null | undefined;
102
+ access_policy?: null | undefined;
135
103
  }) => Promise<{
136
104
  content: Array<{
137
105
  type: "text";
@@ -1 +1 @@
1
- {"version":3,"file":"upload-text-qurl.d.ts","sourceRoot":"","sources":["../../src/tools/upload-text-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAOhD,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AActB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+BA,CAAC;AAElC,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+ElF"}
1
+ {"version":3,"file":"upload-text-qurl.d.ts","sourceRoot":"","sources":["../../src/tools/upload-text-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAOhD,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAkBtB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;iBA+BA,CAAC;AAElC,wBAAgB,kBAAkB,CAEhC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiF5B"}
@@ -7,7 +7,7 @@ import { emailDeliveryInputSchema, maybeDeliverToolEmail, toEmailAugmentedResult
7
7
  import { uploadFileQurlOutputSchema } from "./output-schemas.js";
8
8
  import { getConnectorConfig } from "./upload-file-shared.js";
9
9
  import { uploadGeneratedFileAndMint } from "./upload-file-qurl.js";
10
- import { uploadMintOptionsShape } from "./upload-mint-options.js";
10
+ import { uploadMintOptionsShape, UPLOAD_LINK_DESCRIPTION, UPLOAD_RETURNS_DESCRIPTION, } from "./upload-mint-options.js";
11
11
  const supportedTextPayloadTypes = ["text", "markdown", "html", "json"];
12
12
  export const uploadTextQurlSchema = z
13
13
  .object({
@@ -33,17 +33,20 @@ export const uploadTextQurlSchema = z
33
33
  .describe("Optional email notification settings for sending the uploaded text content's qURL to one or more recipients."),
34
34
  })
35
35
  .extend(uploadMintOptionsShape);
36
- export function uploadTextQurlTool(client, runtime) {
36
+ export function uploadTextQurlTool(
37
+ // Unused since links are minted by the connector; kept for the shared tool factory signature.
38
+ _client, runtime) {
37
39
  return {
38
40
  name: "upload_text_qurl",
39
41
  title: "Upload Text qURL",
40
42
  description: "Render text content into a temporary PDF, upload that PDF to a qURL connector, then mint an access link for it. " +
41
43
  "Use this when the user gives you text content and wants a qURL without first creating a local file or hosting a URL somewhere else. " +
42
44
  "Use `upload_file_data_qurl` for binary/image/PDF attachments, use `upload_file_qurl` when a file already exists on disk, and use `create_qurl` when you already have a target URL. " +
43
- "In v1 the tool does not apply markdown rich-text rendering; it writes the provided content into a plain-text PDF, uploads it to `${QURL_CONNECTOR_URL}/api/upload`, then mints a qURL from the returned `resource_id`. " +
45
+ "In v1 the tool does not apply markdown rich-text rendering; it writes the provided content into a plain-text PDF, uploads it to `${QURL_CONNECTOR_URL}/api/upload`, then mints the link through `${QURL_CONNECTOR_URL}/api/mint_link/:resource_id`. " +
46
+ UPLOAD_LINK_DESCRIPTION +
44
47
  "If `one_time_use` is omitted, the tool defaults it to `true` to match the uploaded-content sharing flow. " +
45
48
  "Requires `QURL_CONNECTOR_URL`; stdio reads `QURL_API_KEY` from server config, while HTTP uses the caller's bearer credential. " +
46
- "**Returns:** `{ resource_id: string, qurl_id: string, qurl_link: string, qurl_site?: string, expires_at?: string, file_name: string, content_type: string, size_bytes: number, branded_domain?: string, type?: string, email_delivery?: object }`.",
49
+ UPLOAD_RETURNS_DESCRIPTION,
47
50
  inputSchema: uploadTextQurlSchema,
48
51
  outputSchema: uploadFileQurlOutputSchema,
49
52
  annotations: {
@@ -64,11 +67,13 @@ export function uploadTextQurlTool(client, runtime) {
64
67
  title: mintOptions.label ?? requestedFileName,
65
68
  });
66
69
  try {
67
- const result = await uploadGeneratedFileAndMint(client, {
70
+ const result = await uploadGeneratedFileAndMint({
68
71
  file_path: pdfFile.filePath,
69
72
  file_name: pdfFile.fileName,
70
73
  content_type: "application/pdf",
71
- ...mintOptions,
74
+ expires_in: mintOptions.expires_in,
75
+ one_time_use: mintOptions.one_time_use,
76
+ session_duration: mintOptions.session_duration,
72
77
  }, connectorConfig);
73
78
  const emailResult = await maybeDeliverToolEmail({
74
79
  allowServerApiKeyFallback,
@@ -80,7 +85,6 @@ export function uploadTextQurlTool(client, runtime) {
80
85
  contentType: result.content_type,
81
86
  qurlLink: result.qurl_link,
82
87
  expiresAt: result.expires_at,
83
- qurlSite: result.qurl_site,
84
88
  label: mintOptions.label,
85
89
  extraLines: [`Payload Type: ${type}`],
86
90
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"upload-text-qurl.js","sourceRoot":"","sources":["../../src/tools/upload-text-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,E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Ac,EAAE,uCAAuC;oBACvD,WAAW,EAAE,sBAAsB,CAAC;wBAClC,KAAK,EAAE,mDAAmD;wBAC1D,QAAQ,EAAE,MAAM,CAAC,SAAS;wBAC1B,WAAW,EAAE,MAAM,CAAC,YAAY;wBAChC,QAAQ,EAAE,MAAM,CAAC,SAAS;wBAC1B,SAAS,EAAE,MAAM,CAAC,UAAU;wBAC5B,KAAK,EAAE,WAAW,CAAC,KAAK;wBACxB,UAAU,EAAE,CAAC,iBAAiB,IAAI,EAAE,CAAC;qBACtC,CAAC;iBACH,CAAC,CAAC;gBAEH,OAAO,sBAAsB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YACrD,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC;oBACH,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC1B,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,oFAAoF;oBACpF,OAAO,CAAC,KAAK,CAAC,4CAA4C,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACzF,CAAC;YACH,CAAC;QACH,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layervai/qurl-mcp",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "MCP server for qURL™ — secure link management for AI agents. Quantum URL is how you enter the hidden layer of the internet.",
5
5
  "mcpName": "io.github.layervai/qurl-mcp",
6
6
  "type": "module",
@@ -38,22 +38,22 @@
38
38
  "url": "https://github.com/layervai/qurl-mcp"
39
39
  },
40
40
  "dependencies": {
41
- "@layervai/qurl": "^0.3.0",
41
+ "@layervai/qurl": "3.0.0",
42
42
  "@modelcontextprotocol/sdk": "^1.24.0",
43
43
  "express": "^5.2.1",
44
44
  "express-rate-limit": "^8.5.2",
45
45
  "nodemailer": "^9.0.1",
46
- "pdfkit": "^0.19.1",
46
+ "pdfkit": "^0.20.2",
47
47
  "zod": "^4.4.3"
48
48
  },
49
49
  "optionalDependencies": {
50
- "@aws-sdk/client-dynamodb": "3.1112.0"
50
+ "@aws-sdk/client-dynamodb": "3.1131.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@eslint/js": "^9.27.0",
54
- "@smithy/types": "4.17.2",
54
+ "@smithy/types": "4.18.0",
55
55
  "@types/express": "^5.0.6",
56
- "@types/node": "26.2.0",
56
+ "@types/node": "26.5.1",
57
57
  "@types/nodemailer": "^8.0.1",
58
58
  "@types/pdfkit": "^0.17.6",
59
59
  "@typescript-eslint/eslint-plugin": "^8.59.0",
@@ -65,7 +65,7 @@
65
65
  "vitest": "^4.1.5"
66
66
  },
67
67
  "engines": {
68
- "node": ">=20"
68
+ "node": ">=22.12"
69
69
  },
70
70
  "files": [
71
71
  "dist/",