@layervai/qurl-mcp 0.4.1 → 0.6.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.
- package/README.md +798 -50
- package/assets/fonts/NotoSansSC-Regular.ttf +0 -0
- package/assets/fonts/OFL.txt +93 -0
- package/assets/fonts/README.md +18 -0
- package/dist/auth/request-context.d.ts +13 -0
- package/dist/auth/request-context.d.ts.map +1 -0
- package/dist/auth/request-context.js +21 -0
- package/dist/auth/request-context.js.map +1 -0
- package/dist/auth/static-bearer.d.ts +12 -0
- package/dist/auth/static-bearer.d.ts.map +1 -0
- package/dist/auth/static-bearer.js +47 -0
- package/dist/auth/static-bearer.js.map +1 -0
- package/dist/client.d.ts +66 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +116 -7
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +98 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +543 -0
- package/dist/config.js.map +1 -0
- package/dist/credential-rate-limit-store.d.ts +38 -0
- package/dist/credential-rate-limit-store.d.ts.map +1 -0
- package/dist/credential-rate-limit-store.js +135 -0
- package/dist/credential-rate-limit-store.js.map +1 -0
- package/dist/email-addresses.d.ts +7 -0
- package/dist/email-addresses.d.ts.map +1 -0
- package/dist/email-addresses.js +36 -0
- package/dist/email-addresses.js.map +1 -0
- package/dist/email-types.d.ts +33 -0
- package/dist/email-types.d.ts.map +1 -0
- package/dist/email-types.js +28 -0
- package/dist/email-types.js.map +1 -0
- package/dist/emf-metrics.d.ts +25 -0
- package/dist/emf-metrics.d.ts.map +1 -0
- package/dist/emf-metrics.js +87 -0
- package/dist/emf-metrics.js.map +1 -0
- package/dist/http-config.d.ts +38 -0
- package/dist/http-config.d.ts.map +1 -0
- package/dist/http-config.js +243 -0
- package/dist/http-config.js.map +1 -0
- package/dist/http-routes.d.ts +5 -0
- package/dist/http-routes.d.ts.map +1 -0
- package/dist/http-routes.js +12 -0
- package/dist/http-routes.js.map +1 -0
- package/dist/http.d.ts +33 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +1116 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -26
- package/dist/index.js.map +1 -1
- package/dist/logging.d.ts +7 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +110 -0
- package/dist/logging.js.map +1 -0
- package/dist/prompts/audit-links.js +1 -1
- package/dist/prompts/audit-links.js.map +1 -1
- package/dist/server.d.ts +14 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +38 -8
- package/dist/server.js.map +1 -1
- package/dist/services/email.d.ts +17 -0
- package/dist/services/email.d.ts.map +1 -0
- package/dist/services/email.js +351 -0
- package/dist/services/email.js.map +1 -0
- package/dist/services/html.d.ts +5 -0
- package/dist/services/html.d.ts.map +1 -0
- package/dist/services/html.js +28 -0
- package/dist/services/html.js.map +1 -0
- package/dist/services/legal-pages.d.ts +12 -0
- package/dist/services/legal-pages.d.ts.map +1 -0
- package/dist/services/legal-pages.js +588 -0
- package/dist/services/legal-pages.js.map +1 -0
- package/dist/services/text-pdf.d.ts +16 -0
- package/dist/services/text-pdf.d.ts.map +1 -0
- package/dist/services/text-pdf.js +141 -0
- package/dist/services/text-pdf.js.map +1 -0
- package/dist/services/video-page.d.ts +4 -0
- package/dist/services/video-page.d.ts.map +1 -0
- package/dist/services/video-page.js +311 -0
- package/dist/services/video-page.js.map +1 -0
- package/dist/text.d.ts +4 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +16 -0
- package/dist/text.js.map +1 -0
- package/dist/tools/_shared.d.ts +10 -1
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/_shared.js +25 -8
- package/dist/tools/_shared.js.map +1 -1
- package/dist/tools/batch-create.d.ts +12 -11
- package/dist/tools/batch-create.d.ts.map +1 -1
- package/dist/tools/batch-create.js +6 -4
- package/dist/tools/batch-create.js.map +1 -1
- package/dist/tools/consumer-access.d.ts +235 -0
- package/dist/tools/consumer-access.d.ts.map +1 -0
- package/dist/tools/consumer-access.js +231 -0
- package/dist/tools/consumer-access.js.map +1 -0
- package/dist/tools/create-qurl.d.ts +43 -4
- package/dist/tools/create-qurl.d.ts.map +1 -1
- package/dist/tools/create-qurl.js +69 -32
- package/dist/tools/create-qurl.js.map +1 -1
- package/dist/tools/delete-qurl.d.ts +3 -2
- package/dist/tools/delete-qurl.d.ts.map +1 -1
- package/dist/tools/delete-qurl.js +9 -13
- package/dist/tools/delete-qurl.js.map +1 -1
- package/dist/tools/duration.d.ts +13 -0
- package/dist/tools/duration.d.ts.map +1 -0
- package/dist/tools/duration.js +71 -0
- package/dist/tools/duration.js.map +1 -0
- package/dist/tools/email-delivery.d.ts +36 -0
- package/dist/tools/email-delivery.d.ts.map +1 -0
- package/dist/tools/email-delivery.js +114 -0
- package/dist/tools/email-delivery.js.map +1 -0
- package/dist/tools/extend-qurl.d.ts +20 -6
- package/dist/tools/extend-qurl.d.ts.map +1 -1
- package/dist/tools/extend-qurl.js +180 -19
- package/dist/tools/extend-qurl.js.map +1 -1
- package/dist/tools/get-qurl.d.ts +13 -5
- package/dist/tools/get-qurl.d.ts.map +1 -1
- package/dist/tools/get-qurl.js +5 -3
- package/dist/tools/get-qurl.js.map +1 -1
- package/dist/tools/list-qurl-sessions.d.ts +5 -4
- package/dist/tools/list-qurl-sessions.d.ts.map +1 -1
- package/dist/tools/list-qurl-sessions.js +2 -2
- package/dist/tools/list-qurl-sessions.js.map +1 -1
- package/dist/tools/list-qurls.d.ts +15 -7
- package/dist/tools/list-qurls.d.ts.map +1 -1
- package/dist/tools/list-qurls.js +9 -7
- package/dist/tools/list-qurls.js.map +1 -1
- package/dist/tools/mint-link.d.ts +39 -3
- package/dist/tools/mint-link.d.ts.map +1 -1
- package/dist/tools/mint-link.js +26 -14
- package/dist/tools/mint-link.js.map +1 -1
- package/dist/tools/output-schemas.d.ts +154 -45
- package/dist/tools/output-schemas.d.ts.map +1 -1
- package/dist/tools/output-schemas.js +106 -30
- package/dist/tools/output-schemas.js.map +1 -1
- package/dist/tools/resolve-qurl.d.ts +4 -3
- package/dist/tools/resolve-qurl.d.ts.map +1 -1
- package/dist/tools/resolve-qurl.js +3 -3
- package/dist/tools/resolve-qurl.js.map +1 -1
- package/dist/tools/revoke-qurl-token.d.ts +3 -2
- package/dist/tools/revoke-qurl-token.d.ts.map +1 -1
- package/dist/tools/revoke-qurl-token.js +2 -2
- package/dist/tools/revoke-qurl-token.js.map +1 -1
- package/dist/tools/share-by-crid.d.ts +50 -0
- package/dist/tools/share-by-crid.d.ts.map +1 -0
- package/dist/tools/share-by-crid.js +114 -0
- package/dist/tools/share-by-crid.js.map +1 -0
- package/dist/tools/terminate-qurl-sessions.d.ts +3 -2
- package/dist/tools/terminate-qurl-sessions.d.ts.map +1 -1
- package/dist/tools/terminate-qurl-sessions.js +7 -3
- package/dist/tools/terminate-qurl-sessions.js.map +1 -1
- package/dist/tools/update-qurl-token.d.ts +5 -4
- package/dist/tools/update-qurl-token.d.ts.map +1 -1
- package/dist/tools/update-qurl-token.js +8 -9
- package/dist/tools/update-qurl-token.js.map +1 -1
- package/dist/tools/update-qurl.d.ts +13 -5
- package/dist/tools/update-qurl.d.ts.map +1 -1
- package/dist/tools/update-qurl.js +10 -11
- package/dist/tools/update-qurl.js.map +1 -1
- package/dist/tools/upload-file-data-qurl.d.ts +138 -0
- package/dist/tools/upload-file-data-qurl.d.ts.map +1 -0
- package/dist/tools/upload-file-data-qurl.js +207 -0
- package/dist/tools/upload-file-data-qurl.js.map +1 -0
- package/dist/tools/upload-file-qurl.d.ts +134 -0
- package/dist/tools/upload-file-qurl.d.ts.map +1 -0
- package/dist/tools/upload-file-qurl.js +174 -0
- package/dist/tools/upload-file-qurl.js.map +1 -0
- package/dist/tools/upload-file-shared.d.ts +53 -0
- package/dist/tools/upload-file-shared.d.ts.map +1 -0
- package/dist/tools/upload-file-shared.js +617 -0
- package/dist/tools/upload-file-shared.js.map +1 -0
- package/dist/tools/upload-mint-options.d.ts +22 -0
- package/dist/tools/upload-mint-options.d.ts.map +1 -0
- package/dist/tools/upload-mint-options.js +47 -0
- package/dist/tools/upload-mint-options.js.map +1 -0
- package/dist/tools/upload-text-qurl.d.ts +112 -0
- package/dist/tools/upload-text-qurl.d.ts.map +1 -0
- package/dist/tools/upload-text-qurl.js +106 -0
- package/dist/tools/upload-text-qurl.js.map +1 -0
- package/package.json +26 -8
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { emailDeliveryResultSchema } from "../email-types.js";
|
|
2
3
|
/**
|
|
3
4
|
* Output schemas for MCP tools.
|
|
4
5
|
*
|
|
@@ -22,7 +23,7 @@ import { z } from "zod";
|
|
|
22
23
|
* an existence/typeof check.
|
|
23
24
|
*/
|
|
24
25
|
const accessPolicy = z
|
|
25
|
-
.
|
|
26
|
+
.looseObject({
|
|
26
27
|
ip_allowlist: z.array(z.string()).optional(),
|
|
27
28
|
ip_denylist: z.array(z.string()).optional(),
|
|
28
29
|
geo_allowlist: z.array(z.string()).optional(),
|
|
@@ -30,7 +31,7 @@ const accessPolicy = z
|
|
|
30
31
|
user_agent_allow_regex: z.string().optional(),
|
|
31
32
|
user_agent_deny_regex: z.string().optional(),
|
|
32
33
|
ai_agent_policy: z
|
|
33
|
-
.
|
|
34
|
+
.looseObject({
|
|
34
35
|
block_all: z.boolean().optional(),
|
|
35
36
|
deny_categories: z.array(z.string()).optional(),
|
|
36
37
|
allow_categories: z.array(z.string()).optional(),
|
|
@@ -39,7 +40,7 @@ const accessPolicy = z
|
|
|
39
40
|
})
|
|
40
41
|
.describe("Access control policy snapshot for this token");
|
|
41
42
|
export const accessTokenOutputSchema = z
|
|
42
|
-
.
|
|
43
|
+
.looseObject({
|
|
43
44
|
qurl_id: z.string(),
|
|
44
45
|
label: z.string().optional(),
|
|
45
46
|
// Same drift-tolerance rationale as qurlSchema.status — token-level
|
|
@@ -66,8 +67,17 @@ export const accessTokenOutputSchema = z
|
|
|
66
67
|
})
|
|
67
68
|
.describe("Single access token belonging to a qURL resource");
|
|
68
69
|
/** Stable QURL resource shape returned by get/list/update/extend. */
|
|
69
|
-
export const qurlSchema = z.
|
|
70
|
-
|
|
70
|
+
export const qurlSchema = z.looseObject({
|
|
71
|
+
crid: z.string().optional(),
|
|
72
|
+
private: z.boolean().optional(),
|
|
73
|
+
consumer_access: z
|
|
74
|
+
.object({
|
|
75
|
+
mode: z.string(),
|
|
76
|
+
version: z.number().optional(),
|
|
77
|
+
contract_id: z.string().optional(),
|
|
78
|
+
})
|
|
79
|
+
.optional(),
|
|
80
|
+
resource_id: z.string().describe("Stable resource identifier (public key or legacy r_ ID)"),
|
|
71
81
|
qurl_site: z.string().optional(),
|
|
72
82
|
target_url: z
|
|
73
83
|
.string()
|
|
@@ -77,10 +87,9 @@ export const qurlSchema = z.object({
|
|
|
77
87
|
tags: z.array(z.string()).optional(),
|
|
78
88
|
expires_at: z.string(),
|
|
79
89
|
created_at: z.string(),
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
// `[active, revoked]`). `"unknown"` is the fail-soft drift sentinel
|
|
90
|
+
// Resources are active/revoked; tolerate "expired" from older responses.
|
|
91
|
+
// The snapshot's expiration prose is stale; its enum is authoritative.
|
|
92
|
+
// "unknown" is the fail-soft drift sentinel
|
|
84
93
|
// emitted by `.catch()` for any parse failure (unknown enum value,
|
|
85
94
|
// null, wrong type, missing field) — see fail-soft-scope tests in
|
|
86
95
|
// output-schemas.types.test.ts and #101 for operator-visibility.
|
|
@@ -105,9 +114,9 @@ export const qurlSchema = z.object({
|
|
|
105
114
|
qurls: z.array(accessTokenOutputSchema).optional(),
|
|
106
115
|
});
|
|
107
116
|
/** Ephemeral create-time payload — note `qurl_link` is one-shot. */
|
|
108
|
-
export const createQurlOutputSchema = z.
|
|
117
|
+
export const createQurlOutputSchema = z.looseObject({
|
|
109
118
|
qurl_id: z.string().describe("Display-friendly qURL ID (q_ prefix)"),
|
|
110
|
-
resource_id: z.string().describe("Stable resource identifier (r_
|
|
119
|
+
resource_id: z.string().describe("Stable resource identifier (public key or legacy r_ ID)"),
|
|
111
120
|
qurl_link: z
|
|
112
121
|
.string()
|
|
113
122
|
.describe("One-shot display access link — shown ONCE on creation, never returned again. Share immediately."),
|
|
@@ -115,21 +124,32 @@ export const createQurlOutputSchema = z.object({
|
|
|
115
124
|
.string()
|
|
116
125
|
.optional()
|
|
117
126
|
.describe("Bare branded hostname for anchor text when the resource has a usable custom domain"),
|
|
118
|
-
qurl_site: z.string(),
|
|
119
|
-
expires_at: z.string(),
|
|
127
|
+
qurl_site: z.string().optional(),
|
|
128
|
+
expires_at: z.string().optional(),
|
|
120
129
|
label: z.string().optional(),
|
|
121
130
|
type: z.string().optional().describe("Resource type echoed from the create request"),
|
|
131
|
+
email_delivery: emailDeliveryResultSchema.optional(),
|
|
122
132
|
});
|
|
123
133
|
export const getQurlOutputSchema = qurlSchema;
|
|
124
134
|
export const updateQurlOutputSchema = qurlSchema;
|
|
125
|
-
export const extendQurlOutputSchema = qurlSchema
|
|
135
|
+
export const extendQurlOutputSchema = qurlSchema.extend({
|
|
136
|
+
extended_qurl_id: z.string().optional().describe("The link that was extended"),
|
|
137
|
+
extended_link_expires_at: z
|
|
138
|
+
.string()
|
|
139
|
+
.optional()
|
|
140
|
+
.describe("The extended link's new expiry; report this, not the resource's own expires_at"),
|
|
141
|
+
extend_warning: z
|
|
142
|
+
.string()
|
|
143
|
+
.optional()
|
|
144
|
+
.describe("Present when the resource's expiry cuts the extended link short; tell the user"),
|
|
145
|
+
});
|
|
126
146
|
/**
|
|
127
147
|
* Paginated list response. When `meta.has_more` is true, pass
|
|
128
148
|
* `meta.next_cursor` as the `cursor` argument on the next call.
|
|
129
149
|
*/
|
|
130
|
-
export const listQurlsOutputSchema = z.
|
|
150
|
+
export const listQurlsOutputSchema = z.looseObject({
|
|
131
151
|
data: z.array(qurlSchema),
|
|
132
|
-
meta: z.
|
|
152
|
+
meta: z.looseObject({
|
|
133
153
|
next_cursor: z
|
|
134
154
|
.string()
|
|
135
155
|
.optional()
|
|
@@ -140,11 +160,11 @@ export const listQurlsOutputSchema = z.object({
|
|
|
140
160
|
}),
|
|
141
161
|
});
|
|
142
162
|
/** Resolve response: target_url + the access_grant that grants network access. */
|
|
143
|
-
export const resolveQurlOutputSchema = z.
|
|
163
|
+
export const resolveQurlOutputSchema = z.looseObject({
|
|
144
164
|
target_url: z.string().describe("Underlying URL revealed by the resolve"),
|
|
145
165
|
resource_id: z.string(),
|
|
146
166
|
access_grant: z
|
|
147
|
-
.
|
|
167
|
+
.looseObject({
|
|
148
168
|
expires_in: z
|
|
149
169
|
.number()
|
|
150
170
|
.describe("Seconds the network grant permits access from `src_ip` before re-resolution is required"),
|
|
@@ -154,7 +174,7 @@ export const resolveQurlOutputSchema = z.object({
|
|
|
154
174
|
.describe("Time-bound, IP-bound network access grant"),
|
|
155
175
|
});
|
|
156
176
|
/** Mint response: a fresh `qurl_link` for an existing resource. One-shot, like create_qurl. */
|
|
157
|
-
export const mintLinkOutputSchema = z.
|
|
177
|
+
export const mintLinkOutputSchema = z.looseObject({
|
|
158
178
|
qurl_id: z.string().describe("Display-friendly qURL ID (q_ prefix) for the minted token"),
|
|
159
179
|
qurl_link: z
|
|
160
180
|
.string()
|
|
@@ -163,18 +183,74 @@ export const mintLinkOutputSchema = z.object({
|
|
|
163
183
|
.string()
|
|
164
184
|
.optional()
|
|
165
185
|
.describe("Bare branded hostname for anchor text when the resource has a usable custom domain"),
|
|
166
|
-
expires_at: z.string(),
|
|
186
|
+
expires_at: z.string().optional(),
|
|
167
187
|
type: z.string().optional().describe("Resource type echoed from the underlying resource"),
|
|
188
|
+
email_delivery: emailDeliveryResultSchema.optional(),
|
|
189
|
+
});
|
|
190
|
+
/** Response from the resource share endpoint. */
|
|
191
|
+
export const shareByCRIDOutputSchema = z.looseObject({
|
|
192
|
+
qurl: z.string().describe("Temporary qURL access link for the supplied CRID"),
|
|
193
|
+
qurl_id: z.string().optional().describe("Display-friendly ID for the minted access token"),
|
|
194
|
+
crid: z.string().optional().describe("CRID associated with the generated link, when available"),
|
|
195
|
+
type: z.string().describe("qURL link type"),
|
|
196
|
+
expires_at: z.string().optional().describe("Link expiration timestamp, when returned"),
|
|
197
|
+
expires_in_seconds: z.number().describe("Link lifetime in seconds"),
|
|
198
|
+
single_use: z.boolean().describe("Whether the link can be used only once"),
|
|
199
|
+
});
|
|
200
|
+
export const uploadFileQurlOutputSchema = z.looseObject({
|
|
201
|
+
resource_id: z
|
|
202
|
+
.string()
|
|
203
|
+
.describe("Stable resource identifier (public key or legacy r_ ID) returned by the connector. Do not pass it to mint_link for another link; run the upload tool again."),
|
|
204
|
+
qurl_id: z
|
|
205
|
+
.string()
|
|
206
|
+
.optional()
|
|
207
|
+
.describe("The minted link's ID as the connector reports it (usually a q_ display ID, but not guaranteed), when it reports one. The link is minted by the connector and may belong to a different resource than resource_id, so do not pair them in revoke_qurl_token, update_qurl_token, or extend_qurl."),
|
|
208
|
+
qurl_link: z
|
|
209
|
+
.string()
|
|
210
|
+
.describe("One-shot display access link for the uploaded file — share immediately"),
|
|
211
|
+
expires_at: z.string().optional().describe("Link expiry as confirmed by the connector"),
|
|
212
|
+
requested_expires_at: z
|
|
213
|
+
.string()
|
|
214
|
+
.optional()
|
|
215
|
+
.describe("The expiry this server requested from expires_in; compare with expires_at, which is what the connector confirmed"),
|
|
216
|
+
expires_at_differs_from_request: z
|
|
217
|
+
.boolean()
|
|
218
|
+
.optional()
|
|
219
|
+
.describe("Present when the connector's confirmed expiry differs from the requested expires_in by more than 5 seconds (clamped or clock skew); tell the user the actual expires_at"),
|
|
220
|
+
expires_at_later_than_requested: z
|
|
221
|
+
.boolean()
|
|
222
|
+
.optional()
|
|
223
|
+
.describe("Present when the confirmed expiry is later than requested: the link lives longer than asked and cannot be revoked from this server, so tell the user when it actually expires"),
|
|
224
|
+
expires_at_already_past: z
|
|
225
|
+
.boolean()
|
|
226
|
+
.optional()
|
|
227
|
+
.describe("Present when the confirmed expiry is already past by this server's clock (the connector clamped it, or this host's clock runs ahead); the link may not work, so tell the user and check the time"),
|
|
228
|
+
expires_at_unconfirmed: z
|
|
229
|
+
.boolean()
|
|
230
|
+
.optional()
|
|
231
|
+
.describe("Present when the connector confirmed no expiry, whether or not expires_in was given; tell the user the link's lifetime is unknown"),
|
|
232
|
+
unexpected_extra_link_count: z
|
|
233
|
+
.number()
|
|
234
|
+
.optional()
|
|
235
|
+
.describe("Present only if the connector minted more links than the one requested; those links may be live and should be reported to the user"),
|
|
236
|
+
unexpected_extra_qurl_ids: z
|
|
237
|
+
.array(z.string())
|
|
238
|
+
.optional()
|
|
239
|
+
.describe("Up to 10 identifiers the connector reported for those extra links (not necessarily q_ display IDs); may be fewer than unexpected_extra_link_count"),
|
|
240
|
+
file_name: z.string().describe("Filename registered with the connector"),
|
|
241
|
+
content_type: z.string().describe("MIME type used for the uploaded file"),
|
|
242
|
+
size_bytes: z.number().describe("Uploaded file size in bytes"),
|
|
243
|
+
email_delivery: emailDeliveryResultSchema.optional(),
|
|
168
244
|
});
|
|
169
245
|
export const updateQurlTokenOutputSchema = accessTokenOutputSchema;
|
|
170
|
-
export const revokeQurlTokenOutputSchema = z.
|
|
246
|
+
export const revokeQurlTokenOutputSchema = z.looseObject({
|
|
171
247
|
resource_id: z.string(),
|
|
172
248
|
qurl_id: z.string(),
|
|
173
249
|
revoked: z.literal(true),
|
|
174
250
|
message: z.string(),
|
|
175
251
|
});
|
|
176
|
-
export const listQurlSessionsOutputSchema = z.
|
|
177
|
-
data: z.array(z.
|
|
252
|
+
export const listQurlSessionsOutputSchema = z.looseObject({
|
|
253
|
+
data: z.array(z.looseObject({
|
|
178
254
|
session_id: z.string(),
|
|
179
255
|
qurl_id: z.string().optional(),
|
|
180
256
|
src_ip: z.string().optional(),
|
|
@@ -183,12 +259,12 @@ export const listQurlSessionsOutputSchema = z.object({
|
|
|
183
259
|
last_seen_at: z.string().optional(),
|
|
184
260
|
})),
|
|
185
261
|
meta: z
|
|
186
|
-
.
|
|
262
|
+
.looseObject({
|
|
187
263
|
request_id: z.string().optional(),
|
|
188
264
|
})
|
|
189
265
|
.optional(),
|
|
190
266
|
});
|
|
191
|
-
export const terminateQurlSessionsOutputSchema = z.
|
|
267
|
+
export const terminateQurlSessionsOutputSchema = z.looseObject({
|
|
192
268
|
resource_id: z.string(),
|
|
193
269
|
session_id: z.string().optional(),
|
|
194
270
|
terminated: z.number(),
|
|
@@ -198,7 +274,7 @@ export const terminateQurlSessionsOutputSchema = z.object({
|
|
|
198
274
|
// mutual-exclusivity contract — a host or planner generating UI from
|
|
199
275
|
// the schema will only show success-fields under `success: true` and
|
|
200
276
|
// the `error` block under `success: false`, never both.
|
|
201
|
-
const batchItemSuccessSchema = z.
|
|
277
|
+
const batchItemSuccessSchema = z.looseObject({
|
|
202
278
|
index: z.number().describe("Index of the corresponding item in the input `items` array"),
|
|
203
279
|
success: z.literal(true),
|
|
204
280
|
resource_id: z.string(),
|
|
@@ -210,10 +286,10 @@ const batchItemSuccessSchema = z.object({
|
|
|
210
286
|
qurl_site: z.string(),
|
|
211
287
|
expires_at: z.string(),
|
|
212
288
|
});
|
|
213
|
-
const batchItemFailureSchema = z.
|
|
289
|
+
const batchItemFailureSchema = z.looseObject({
|
|
214
290
|
index: z.number().describe("Index of the corresponding item in the input `items` array"),
|
|
215
291
|
success: z.literal(false),
|
|
216
|
-
error: z.
|
|
292
|
+
error: z.looseObject({
|
|
217
293
|
code: z.string(),
|
|
218
294
|
message: z.string(),
|
|
219
295
|
}),
|
|
@@ -230,14 +306,14 @@ const batchItemResultSchema = z
|
|
|
230
306
|
* `output-schemas.types.test.ts` asserts the flattened shape against the
|
|
231
307
|
* client interface so drift on either side fails compilation.
|
|
232
308
|
*/
|
|
233
|
-
export const batchCreateOutputSchema = z.
|
|
309
|
+
export const batchCreateOutputSchema = z.looseObject({
|
|
234
310
|
succeeded: z.number(),
|
|
235
311
|
failed: z.number(),
|
|
236
312
|
results: z.array(batchItemResultSchema),
|
|
237
313
|
request_id: z.string().optional(),
|
|
238
314
|
});
|
|
239
315
|
/** Delete confirmation. The qURL is in a revoked state after this call. */
|
|
240
|
-
export const deleteQurlOutputSchema = z.
|
|
316
|
+
export const deleteQurlOutputSchema = z.looseObject({
|
|
241
317
|
resource_id: z.string(),
|
|
242
318
|
revoked: z.literal(true),
|
|
243
319
|
was_already_revoked: z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-schemas.js","sourceRoot":"","sources":["../../src/tools/output-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"output-schemas.js","sourceRoot":"","sources":["../../src/tools/output-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,YAAY,GAAG,CAAC;KACnB,WAAW,CAAC;IACX,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC3C,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC7C,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7C,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5C,eAA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M,EAAE;QAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,CAAC;KAC5B,kBAAkB,CAAC,SAAS,EAAE,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;KAC/E,QAAQ,CAAC,8CAA8C,CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAAC;IACnD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC;IACvC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,WAAW,CAAC;IAClD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,mBAAmB,EAAE,CAAC;SACnB,OAAO,EAAE;SACT,QAAQ,CACP,mFAAmF;QACjF,kGAAkG,CACrG;IACH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;CACpE,CAAC,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 resolveQurlSchema: z.ZodObject<{
|
|
4
5
|
access_token: z.ZodString;
|
|
5
6
|
}, z.core.$strip>;
|
|
6
|
-
export declare function resolveQurlTool(client: IQURLClient): {
|
|
7
|
+
export declare function resolveQurlTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
|
|
7
8
|
name: string;
|
|
8
9
|
title: string;
|
|
9
10
|
description: string;
|
|
@@ -17,8 +18,8 @@ export declare function resolveQurlTool(client: IQURLClient): {
|
|
|
17
18
|
expires_in: z.ZodNumber;
|
|
18
19
|
granted_at: z.ZodString;
|
|
19
20
|
src_ip: z.ZodString;
|
|
20
|
-
}, z.core.$
|
|
21
|
-
}, z.core.$
|
|
21
|
+
}, z.core.$loose>;
|
|
22
|
+
}, z.core.$loose>;
|
|
22
23
|
annotations: {
|
|
23
24
|
title: string;
|
|
24
25
|
readOnlyHint: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-qurl.d.ts","sourceRoot":"","sources":["../../src/tools/resolve-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve-qurl.d.ts","sourceRoot":"","sources":["../../src/tools/resolve-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;AAGtB,eAAO,MAAM,iBAAiB;;iBAK5B,CAAC;AAEH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,kBAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCjD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { toStructuredContent, withMissingApiKeyHandler } from "./_shared.js";
|
|
2
|
+
import { toStructuredContent, withMissingApiKeyHandler, } from "./_shared.js";
|
|
3
3
|
import { resolveQurlOutputSchema } from "./output-schemas.js";
|
|
4
4
|
export const resolveQurlSchema = z.object({
|
|
5
5
|
access_token: z
|
|
@@ -7,13 +7,13 @@ export const resolveQurlSchema = z.object({
|
|
|
7
7
|
.min(1)
|
|
8
8
|
.describe("The access token from a qURL link (e.g., at_k8xqp9h2sj9lx7r4a)"),
|
|
9
9
|
});
|
|
10
|
-
export function resolveQurlTool(client) {
|
|
10
|
+
export function resolveQurlTool(client, _runtime = { mode: "stdio" }) {
|
|
11
11
|
return {
|
|
12
12
|
name: "resolve_qurl",
|
|
13
13
|
title: "Resolve qURL Access Token",
|
|
14
14
|
description: "Redeem a qURL access token (the `at_` prefix you pulled out of a `qurl_link`) to reveal the underlying URL and obtain a time-bound, IP-bound network access grant. " +
|
|
15
15
|
"Use this when an agent has been handed an access token and needs to fetch the protected resource — after a successful resolve, requests from `access_grant.src_ip` are permitted to the `target_url` for `access_grant.expires_in` seconds. " +
|
|
16
|
-
"Use `get_qurl` instead when you have a resource
|
|
16
|
+
"Use `get_qurl` instead when you have a resource identifier (public key, CRID, or legacy `r_` ID) or qURL display ID (`q_`) and want admin-side details rather than end-user redemption. " +
|
|
17
17
|
"**Side-effects:** consumes one use on `one_time_use` tokens, decrements `max_sessions`, and may trip access policies (IP/geo/UA/AI-agent denylists). " +
|
|
18
18
|
"**`idempotentHint: false`** because one-time-use tokens consume on each call; for non-one-time tokens within an active grant window, repeats are effectively no-ops, but the conservative annotation reflects worst-case behavior.",
|
|
19
19
|
inputSchema: resolveQurlSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-qurl.js","sourceRoot":"","sources":["../../src/tools/resolve-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"resolve-qurl.js","sourceRoot":"","sources":["../../src/tools/resolve-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,GAEzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,gEAAgE,CAAC;CAC9E,CAAC,CAAC;AAEH,MAAM,UAAU,eAAe,CAC7B,MAAmB,EACnB,WAA+B,EAAE,IAAI,EAAE,OAAO,EAAE;IAEhD,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,2BAA2B;QAClC,WAAW,EACT,qKAAqK;YACrK,8OAA8O;YAC9O,0LAA0L;YAC1L,uJAAuJ;YACvJ,oOAAoO;QACtO,WAAW,EAAE,iBAAiB;QAC9B,YAAY,EAAE,uBAAuB;QACrC,WAAW,EAAE;YACX,KAAK,EAAE,2BAA2B;YAClC,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,KAAK;YACrB,aAAa,EAAE,IAAI;SACpB;QACD,OAAO,EAAE,wBAAwB,CAAC,KAAK,EAAE,KAAwC,EAAE,EAAE;YACnF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAC/C,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;qBAClC;iBACF;gBACD,iBAAiB,EAAE,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC;aACpD,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
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 revokeQurlTokenSchema: z.ZodObject<{
|
|
4
5
|
resource_id: z.ZodString;
|
|
5
6
|
qurl_id: z.ZodString;
|
|
6
7
|
}, z.core.$strip>;
|
|
7
|
-
export declare function revokeQurlTokenTool(client: IQURLClient): {
|
|
8
|
+
export declare function revokeQurlTokenTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
|
|
8
9
|
name: string;
|
|
9
10
|
title: string;
|
|
10
11
|
description: string;
|
|
@@ -17,7 +18,7 @@ export declare function revokeQurlTokenTool(client: IQURLClient): {
|
|
|
17
18
|
qurl_id: z.ZodString;
|
|
18
19
|
revoked: z.ZodLiteral<true>;
|
|
19
20
|
message: z.ZodString;
|
|
20
|
-
}, z.core.$
|
|
21
|
+
}, z.core.$loose>;
|
|
21
22
|
annotations: {
|
|
22
23
|
title: string;
|
|
23
24
|
readOnlyHint: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revoke-qurl-token.d.ts","sourceRoot":"","sources":["../../src/tools/revoke-qurl-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"revoke-qurl-token.d.ts","sourceRoot":"","sources":["../../src/tools/revoke-qurl-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAGtB,eAAO,MAAM,qBAAqB;;;iBAGhC,CAAC;AAEH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,kBAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCjD"}
|
|
@@ -5,14 +5,14 @@ export const revokeQurlTokenSchema = z.object({
|
|
|
5
5
|
resource_id: resourceOnlyIdSchema("revoke a specific qURL token from"),
|
|
6
6
|
qurl_id: qurlDisplayIdSchema("revoke"),
|
|
7
7
|
});
|
|
8
|
-
export function revokeQurlTokenTool(client) {
|
|
8
|
+
export function revokeQurlTokenTool(client, _runtime = { mode: "stdio" }) {
|
|
9
9
|
return {
|
|
10
10
|
name: "revoke_qurl_token",
|
|
11
11
|
title: "Revoke qURL Token",
|
|
12
12
|
description: "Revoke one qURL token under a resource without revoking the whole resource. " +
|
|
13
13
|
"Use this when a single recipient/link should stop working but sibling qURLs on the same `resource_id` must remain active. " +
|
|
14
14
|
"Use `delete_qurl` instead when you want to revoke the resource and every token under it. " +
|
|
15
|
-
"**Constraints:** requires the parent `resource_id` (`r_
|
|
15
|
+
"**Constraints:** requires the parent `resource_id` (public key, CRID, or legacy `r_` ID) and the token display ID (`q_…`). Re-revoking an inactive token returns an API error rather than being treated as idempotent.",
|
|
16
16
|
inputSchema: revokeQurlTokenSchema,
|
|
17
17
|
outputSchema: revokeQurlTokenOutputSchema,
|
|
18
18
|
annotations: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revoke-qurl-token.js","sourceRoot":"","sources":["../../src/tools/revoke-qurl-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"revoke-qurl-token.js","sourceRoot":"","sources":["../../src/tools/revoke-qurl-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,GAEzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,WAAW,EAAE,oBAAoB,CAAC,mCAAmC,CAAC;IACtE,OAAO,EAAE,mBAAmB,CAAC,QAAQ,CAAC;CACvC,CAAC,CAAC;AAEH,MAAM,UAAU,mBAAmB,CACjC,MAAmB,EACnB,WAA+B,EAAE,IAAI,EAAE,OAAO,EAAE;IAEhD,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACT,8EAA8E;YAC9E,4HAA4H;YAC5H,2FAA2F;YAC3F,wNAAwN;QAC1N,WAAW,EAAE,qBAAqB;QAClC,YAAY,EAAE,2BAA2B;QACzC,WAAW,EAAE;YACX,KAAK,EAAE,mBAAmB;YAC1B,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,KAAK;YACrB,aAAa,EAAE,IAAI;SACpB;QACD,OAAO,EAAE,wBAAwB,CAAC,KAAK,EAAE,KAA4C,EAAE,EAAE;YACvF,MAAM,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YAC/D,MAAM,OAAO,GAAG;gBACd,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE,IAAa;gBACtB,OAAO,EAAE,cAAc,KAAK,CAAC,OAAO,cAAc;aACnD,CAAC;YACF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;gBACnE,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,CAAC;aAChD,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { IQURLClient } from "../client.js";
|
|
3
|
+
import { type ToolRuntimeOptions } from "./_shared.js";
|
|
4
|
+
export declare const shareByCRIDSchema: z.ZodObject<{
|
|
5
|
+
crid: z.ZodString;
|
|
6
|
+
ttl: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
/**
|
|
9
|
+
* Request a temporary qURL link for a resource by CRID.
|
|
10
|
+
*
|
|
11
|
+
* The API performs CRID validation and link binding. This tool intentionally
|
|
12
|
+
* does not duplicate the CLI's environment, format, or signature checks.
|
|
13
|
+
*/
|
|
14
|
+
export declare function shareByCRIDTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
|
|
15
|
+
name: string;
|
|
16
|
+
title: string;
|
|
17
|
+
description: string;
|
|
18
|
+
inputSchema: z.ZodObject<{
|
|
19
|
+
crid: z.ZodString;
|
|
20
|
+
ttl: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
outputSchema: z.ZodObject<{
|
|
23
|
+
qurl: z.ZodString;
|
|
24
|
+
qurl_id: z.ZodOptional<z.ZodString>;
|
|
25
|
+
crid: z.ZodOptional<z.ZodString>;
|
|
26
|
+
type: z.ZodString;
|
|
27
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
28
|
+
expires_in_seconds: z.ZodNumber;
|
|
29
|
+
single_use: z.ZodBoolean;
|
|
30
|
+
}, z.core.$loose>;
|
|
31
|
+
annotations: {
|
|
32
|
+
title: string;
|
|
33
|
+
readOnlyHint: boolean;
|
|
34
|
+
destructiveHint: boolean;
|
|
35
|
+
idempotentHint: boolean;
|
|
36
|
+
openWorldHint: boolean;
|
|
37
|
+
};
|
|
38
|
+
handler: (input: {
|
|
39
|
+
crid: string;
|
|
40
|
+
ttl?: string | undefined;
|
|
41
|
+
}) => Promise<{
|
|
42
|
+
content: Array<{
|
|
43
|
+
type: "text";
|
|
44
|
+
text: string;
|
|
45
|
+
}>;
|
|
46
|
+
structuredContent?: Record<string, unknown>;
|
|
47
|
+
isError?: boolean;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=share-by-crid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-by-crid.d.ts","sourceRoot":"","sources":["../../src/tools/share-by-crid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAGtB,eAAO,MAAM,iBAAiB;;;iBAgB5B,CAAC;AA2CH;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,kBAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDjD"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { toStructuredContent, withMissingApiKeyHandler, zodErrorToToolResult, } from "./_shared.js";
|
|
3
|
+
import { shareByCRIDOutputSchema } from "./output-schemas.js";
|
|
4
|
+
export const shareByCRIDSchema = z.object({
|
|
5
|
+
crid: z
|
|
6
|
+
.string()
|
|
7
|
+
.min(1)
|
|
8
|
+
.max(512)
|
|
9
|
+
.describe('CRID of the resource to turn into a temporary qURL link. Accepts either the bare CRID or the user-facing "$<CRID>" form.'),
|
|
10
|
+
ttl: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.max(64)
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Requested link lifetime in Go duration format, such as "90s", "5m", or "1h30m". The total must be a positive whole number of seconds. The service may adjust the lifetime.'),
|
|
16
|
+
});
|
|
17
|
+
const DURATION_PART = /(\d+(?:\.\d*)?|\.\d+)(ms|us|µs|μs|ns|h|m|s)/gy;
|
|
18
|
+
const UNIT_NANOSECONDS = {
|
|
19
|
+
h: 3600000000000n,
|
|
20
|
+
m: 60000000000n,
|
|
21
|
+
s: 1000000000n,
|
|
22
|
+
ms: 1000000n,
|
|
23
|
+
us: 1000n,
|
|
24
|
+
µs: 1000n,
|
|
25
|
+
μs: 1000n,
|
|
26
|
+
ns: 1n,
|
|
27
|
+
};
|
|
28
|
+
function parseTTLSeconds(ttl) {
|
|
29
|
+
let offset = ttl.startsWith("+") ? 1 : 0;
|
|
30
|
+
let nanoseconds = 0n;
|
|
31
|
+
while (offset < ttl.length) {
|
|
32
|
+
DURATION_PART.lastIndex = offset;
|
|
33
|
+
const part = DURATION_PART.exec(ttl);
|
|
34
|
+
if (!part)
|
|
35
|
+
return undefined;
|
|
36
|
+
const [whole, fraction = ""] = part[1].split(".");
|
|
37
|
+
// Go durations truncate each component to nanoseconds. Integer arithmetic
|
|
38
|
+
// avoids rejecting whole-second sums because of floating-point rounding.
|
|
39
|
+
nanoseconds +=
|
|
40
|
+
(BigInt(whole + fraction) * UNIT_NANOSECONDS[part[2]]) / 10n ** BigInt(fraction.length);
|
|
41
|
+
offset = DURATION_PART.lastIndex;
|
|
42
|
+
}
|
|
43
|
+
return nanoseconds > 0n &&
|
|
44
|
+
nanoseconds <= 9223372036854775807n &&
|
|
45
|
+
nanoseconds % 1000000000n === 0n
|
|
46
|
+
? Number(nanoseconds / 1000000000n)
|
|
47
|
+
: undefined;
|
|
48
|
+
}
|
|
49
|
+
function normalizeCRID(crid) {
|
|
50
|
+
const trimmed = crid.trim();
|
|
51
|
+
const normalized = trimmed.startsWith("$") ? trimmed.slice(1).trim() : trimmed;
|
|
52
|
+
return normalized || undefined;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Request a temporary qURL link for a resource by CRID.
|
|
56
|
+
*
|
|
57
|
+
* The API performs CRID validation and link binding. This tool intentionally
|
|
58
|
+
* does not duplicate the CLI's environment, format, or signature checks.
|
|
59
|
+
*/
|
|
60
|
+
export function shareByCRIDTool(client, _runtime = { mode: "stdio" }) {
|
|
61
|
+
return {
|
|
62
|
+
name: "share_by_crid",
|
|
63
|
+
title: "Share qURL by CRID",
|
|
64
|
+
description: "Request a temporary qURL access link for a resource identified by its CRID. " +
|
|
65
|
+
"When the user supplies a resource CRID with a leading `$` marker, remove the marker and use this tool. " +
|
|
66
|
+
"Set `ttl` to request a lifetime using Go duration syntax; the total must be a positive whole number of seconds. The service may adjust the lifetime. " +
|
|
67
|
+
"The link is minted by the qURL API and includes its expiration and single-use metadata.",
|
|
68
|
+
inputSchema: shareByCRIDSchema,
|
|
69
|
+
outputSchema: shareByCRIDOutputSchema,
|
|
70
|
+
annotations: {
|
|
71
|
+
title: "Share qURL by CRID",
|
|
72
|
+
readOnlyHint: false,
|
|
73
|
+
destructiveHint: false,
|
|
74
|
+
idempotentHint: false,
|
|
75
|
+
openWorldHint: true,
|
|
76
|
+
},
|
|
77
|
+
handler: withMissingApiKeyHandler(async (raw) => {
|
|
78
|
+
const parsed = shareByCRIDSchema.safeParse(raw);
|
|
79
|
+
if (!parsed.success)
|
|
80
|
+
return zodErrorToToolResult(parsed.error);
|
|
81
|
+
const input = parsed.data;
|
|
82
|
+
const crid = normalizeCRID(input.crid);
|
|
83
|
+
if (crid === undefined) {
|
|
84
|
+
return {
|
|
85
|
+
isError: true,
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
type: "text",
|
|
89
|
+
text: 'crid must contain a value, either as a bare CRID or in the "$<CRID>" form.',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const ttlSeconds = input.ttl === undefined ? undefined : parseTTLSeconds(input.ttl);
|
|
95
|
+
if (input.ttl !== undefined && ttlSeconds === undefined) {
|
|
96
|
+
return {
|
|
97
|
+
isError: true,
|
|
98
|
+
content: [
|
|
99
|
+
{
|
|
100
|
+
type: "text",
|
|
101
|
+
text: "ttl must be a positive Go duration that resolves to whole seconds (for example, 90s, 5m, or 1h30m).",
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const result = await client.shareByCRID(crid, ttlSeconds);
|
|
107
|
+
return {
|
|
108
|
+
content: [{ type: "text", text: JSON.stringify(result.data) }],
|
|
109
|
+
structuredContent: toStructuredContent(result.data),
|
|
110
|
+
};
|
|
111
|
+
}),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=share-by-crid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-by-crid.js","sourceRoot":"","sources":["../../src/tools/share-by-crid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,GAErB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,CACP,0HAA0H,CAC3H;IACH,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,QAAQ,CACP,4KAA4K,CAC7K;CACJ,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,+CAA+C,CAAC;AACtE,MAAM,gBAAgB,GAA2B;IAC/C,CAAC,EAAE,cAAkB;IACrB,CAAC,EAAE,YAAe;IAClB,CAAC,EAAE,WAAc;IACjB,EAAE,EAAE,QAAU;IACd,EAAE,EAAE,KAAM;IACV,EAAE,EAAE,KAAM;IACV,EAAE,EAAE,KAAM;IACV,EAAE,EAAE,EAAE;CACP,CAAC;AAEF,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAA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AC;YACJ,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YAC1D,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvE,iBAAiB,EAAE,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC;aACpD,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
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 terminateQurlSessionsSchema: z.ZodObject<{
|
|
4
5
|
resource_id: z.ZodString;
|
|
5
6
|
session_id: z.ZodOptional<z.ZodString>;
|
|
6
7
|
}, z.core.$strip>;
|
|
7
|
-
export declare function terminateQurlSessionsTool(client: IQURLClient): {
|
|
8
|
+
export declare function terminateQurlSessionsTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
|
|
8
9
|
name: string;
|
|
9
10
|
title: string;
|
|
10
11
|
description: string;
|
|
@@ -17,7 +18,7 @@ export declare function terminateQurlSessionsTool(client: IQURLClient): {
|
|
|
17
18
|
session_id: z.ZodOptional<z.ZodString>;
|
|
18
19
|
terminated: z.ZodNumber;
|
|
19
20
|
message: z.ZodString;
|
|
20
|
-
}, z.core.$
|
|
21
|
+
}, z.core.$loose>;
|
|
21
22
|
annotations: {
|
|
22
23
|
title: string;
|
|
23
24
|
readOnlyHint: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminate-qurl-sessions.d.ts","sourceRoot":"","sources":["../../src/tools/terminate-qurl-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"terminate-qurl-sessions.d.ts","sourceRoot":"","sources":["../../src/tools/terminate-qurl-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAGtB,eAAO,MAAM,2BAA2B;;;iBAStC,CAAC;AAEH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,kBAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgEjD"}
|