@layervai/qurl-mcp 0.4.0 → 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.
- package/README.md +742 -46
- 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 +112 -23
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +173 -78
- 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 -25
- 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/secure-a-service.d.ts +16 -4
- package/dist/prompts/secure-a-service.d.ts.map +1 -1
- package/dist/prompts/secure-a-service.js +7 -15
- package/dist/prompts/secure-a-service.js.map +1 -1
- package/dist/server.d.ts +18 -6
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +41 -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 +13 -3
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/_shared.js +31 -7
- package/dist/tools/_shared.js.map +1 -1
- package/dist/tools/batch-create.d.ts +36 -343
- package/dist/tools/batch-create.d.ts.map +1 -1
- package/dist/tools/batch-create.js +7 -4
- package/dist/tools/batch-create.js.map +1 -1
- package/dist/tools/create-qurl.d.ts +79 -237
- package/dist/tools/create-qurl.d.ts.map +1 -1
- package/dist/tools/create-qurl.js +77 -47
- package/dist/tools/create-qurl.js.map +1 -1
- package/dist/tools/delete-qurl.d.ts +5 -22
- package/dist/tools/delete-qurl.d.ts.map +1 -1
- package/dist/tools/delete-qurl.js +19 -13
- package/dist/tools/delete-qurl.js.map +1 -1
- package/dist/tools/email-delivery.d.ts +37 -0
- package/dist/tools/email-delivery.d.ts.map +1 -0
- package/dist/tools/email-delivery.js +115 -0
- package/dist/tools/email-delivery.js.map +1 -0
- package/dist/tools/extend-qurl.d.ts +36 -189
- package/dist/tools/extend-qurl.d.ts.map +1 -1
- package/dist/tools/extend-qurl.js +3 -3
- package/dist/tools/extend-qurl.js.map +1 -1
- package/dist/tools/get-qurl.d.ts +36 -185
- package/dist/tools/get-qurl.d.ts.map +1 -1
- package/dist/tools/get-qurl.js +8 -5
- package/dist/tools/get-qurl.js.map +1 -1
- package/dist/tools/list-qurl-sessions.d.ts +45 -0
- package/dist/tools/list-qurl-sessions.d.ts.map +1 -0
- package/dist/tools/list-qurl-sessions.js +33 -0
- package/dist/tools/list-qurl-sessions.js.map +1 -0
- package/dist/tools/list-qurls.d.ts +38 -319
- package/dist/tools/list-qurls.d.ts.map +1 -1
- package/dist/tools/list-qurls.js +45 -20
- package/dist/tools/list-qurls.js.map +1 -1
- package/dist/tools/mint-link.d.ts +72 -303
- package/dist/tools/mint-link.d.ts.map +1 -1
- package/dist/tools/mint-link.js +35 -21
- package/dist/tools/mint-link.js.map +1 -1
- package/dist/tools/output-schemas.d.ts +326 -1112
- package/dist/tools/output-schemas.d.ts.map +1 -1
- package/dist/tools/output-schemas.js +141 -40
- package/dist/tools/output-schemas.js.map +1 -1
- package/dist/tools/resolve-qurl.d.ts +6 -37
- package/dist/tools/resolve-qurl.d.ts.map +1 -1
- package/dist/tools/resolve-qurl.js +5 -5
- package/dist/tools/resolve-qurl.js.map +1 -1
- package/dist/tools/revoke-qurl-token.d.ts +41 -0
- package/dist/tools/revoke-qurl-token.d.ts.map +1 -0
- package/dist/tools/revoke-qurl-token.js +40 -0
- package/dist/tools/revoke-qurl-token.js.map +1 -0
- package/dist/tools/terminate-qurl-sessions.d.ts +41 -0
- package/dist/tools/terminate-qurl-sessions.d.ts.map +1 -0
- package/dist/tools/terminate-qurl-sessions.js +68 -0
- package/dist/tools/terminate-qurl-sessions.js.map +1 -0
- package/dist/tools/update-qurl-token.d.ts +142 -0
- package/dist/tools/update-qurl-token.d.ts.map +1 -0
- package/dist/tools/update-qurl-token.js +75 -0
- package/dist/tools/update-qurl-token.js.map +1 -0
- package/dist/tools/update-qurl.d.ts +43 -264
- package/dist/tools/update-qurl.d.ts.map +1 -1
- package/dist/tools/update-qurl.js +57 -8
- package/dist/tools/update-qurl.js.map +1 -1
- package/dist/tools/upload-file-data-qurl.d.ts +182 -0
- package/dist/tools/upload-file-data-qurl.d.ts.map +1 -0
- package/dist/tools/upload-file-data-qurl.js +200 -0
- package/dist/tools/upload-file-data-qurl.js.map +1 -0
- package/dist/tools/upload-file-qurl.d.ts +162 -0
- package/dist/tools/upload-file-qurl.d.ts.map +1 -0
- package/dist/tools/upload-file-qurl.js +167 -0
- package/dist/tools/upload-file-qurl.js.map +1 -0
- package/dist/tools/upload-file-shared.d.ts +36 -0
- package/dist/tools/upload-file-shared.d.ts.map +1 -0
- package/dist/tools/upload-file-shared.js +347 -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 +29 -0
- package/dist/tools/upload-mint-options.js.map +1 -0
- package/dist/tools/upload-text-qurl.d.ts +144 -0
- package/dist/tools/upload-text-qurl.d.ts.map +1 -0
- package/dist/tools/upload-text-qurl.js +102 -0
- package/dist/tools/upload-text-qurl.js.map +1 -0
- package/package.json +27 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-schemas.d.ts","sourceRoot":"","sources":["../../src/tools/output-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"output-schemas.d.ts","sourceRoot":"","sources":["../../src/tools/output-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4CxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4B2B,CAAC;AAEhE,qEAAqE;AACrE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCrB,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;iBAiBjC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAa,CAAC;AAC9C,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAa,CAAC;AACjD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAa,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWhC,CAAC;AAEH,kFAAkF;AAClF,eAAO,MAAM,uBAAuB;;;;;;;;iBAclC,CAAC;AAEH,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;iBAY/B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsBrC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA0B,CAAC;AAEnE,eAAO,MAAM,2BAA2B;;;;;iBAKtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;iBAgBvC,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;iBAK5C,CAAC;AAgCH;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;iBAKlC,CAAC;AAEH,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB;;;;;iBAUjC,CAAC"}
|
|
@@ -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(),
|
|
@@ -38,54 +39,87 @@ const accessPolicy = z
|
|
|
38
39
|
.optional(),
|
|
39
40
|
})
|
|
40
41
|
.describe("Access control policy snapshot for this token");
|
|
41
|
-
const
|
|
42
|
-
.
|
|
42
|
+
export const accessTokenOutputSchema = z
|
|
43
|
+
.looseObject({
|
|
43
44
|
qurl_id: z.string(),
|
|
44
45
|
label: z.string().optional(),
|
|
46
|
+
// Same drift-tolerance rationale as qurlSchema.status — token-level
|
|
47
|
+
// status is wider and just as exposed to a new server-side value
|
|
48
|
+
// reaching a host between weekly snapshot runs.
|
|
45
49
|
status: z
|
|
46
|
-
.enum(["active", "consumed", "expired", "revoked"])
|
|
50
|
+
.enum(["active", "consumed", "expired", "revoked", "unknown"])
|
|
51
|
+
.catch("unknown")
|
|
47
52
|
.describe("Per-token status (wider than resource status — tokens may be consumed/expired independently)"),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
// QurlSummary in api-spec/qurls.yaml intentionally has no `required`
|
|
54
|
+
// list, so these server-owned details are optional even though most
|
|
55
|
+
// responses include them.
|
|
56
|
+
one_time_use: z.boolean().optional(),
|
|
57
|
+
max_sessions: z.number().optional(),
|
|
58
|
+
session_duration: z
|
|
59
|
+
.number()
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Seconds of access granted after a successful resolve"),
|
|
62
|
+
use_count: z.number().optional(),
|
|
52
63
|
qurl_site: z.string().optional(),
|
|
53
64
|
access_policy: accessPolicy.optional(),
|
|
54
|
-
created_at: z.string(),
|
|
55
|
-
expires_at: z.string(),
|
|
65
|
+
created_at: z.string().optional(),
|
|
66
|
+
expires_at: z.string().optional(),
|
|
56
67
|
})
|
|
57
68
|
.describe("Single access token belonging to a qURL resource");
|
|
58
69
|
/** Stable QURL resource shape returned by get/list/update/extend. */
|
|
59
|
-
export const qurlSchema = z.
|
|
60
|
-
resource_id: z.string().describe("Stable resource identifier (r_
|
|
70
|
+
export const qurlSchema = z.looseObject({
|
|
71
|
+
resource_id: z.string().describe("Stable resource identifier (public key or legacy r_ ID)"),
|
|
61
72
|
qurl_site: z.string().optional(),
|
|
62
|
-
target_url: z
|
|
73
|
+
target_url: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Underlying URL the qURL protects; omitted on connector-owned resources"),
|
|
63
77
|
description: z.string().optional(),
|
|
64
78
|
tags: z.array(z.string()).optional(),
|
|
65
79
|
expires_at: z.string(),
|
|
66
80
|
created_at: z.string(),
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
|
|
81
|
+
// Resources are active/revoked; tolerate "expired" from older responses.
|
|
82
|
+
// The snapshot's expiration prose is stale; its enum is authoritative.
|
|
83
|
+
// "unknown" is the fail-soft drift sentinel
|
|
84
|
+
// emitted by `.catch()` for any parse failure (unknown enum value,
|
|
85
|
+
// null, wrong type, missing field) — see fail-soft-scope tests in
|
|
86
|
+
// output-schemas.types.test.ts and #101 for operator-visibility.
|
|
87
|
+
//
|
|
88
|
+
// Hypothetical-collision: if the API ever introduces a real
|
|
89
|
+
// `"unknown"` lifecycle value, it would be indistinguishable from a
|
|
90
|
+
// .catch() coercion. Accepted as low-probability vs. the cost of a
|
|
91
|
+
// synthetic-name sentinel; #101's telemetry will need to log the
|
|
92
|
+
// raw-input value (not just the coerced output) to disambiguate.
|
|
93
|
+
status: z.enum(["active", "revoked", "expired", "unknown"]).catch("unknown"),
|
|
70
94
|
custom_domain: z.string().nullable().optional(),
|
|
95
|
+
slug: z
|
|
96
|
+
.string()
|
|
97
|
+
.optional()
|
|
98
|
+
.describe("Immutable per-owner resource identity, when one was supplied at create time"),
|
|
71
99
|
preserve_host: z
|
|
72
100
|
.boolean()
|
|
73
101
|
.optional()
|
|
74
102
|
.describe("When true, the original Host header is preserved when proxying via the custom domain. " +
|
|
75
103
|
"Only meaningful when custom_domain is set; defaults to false on the API side."),
|
|
76
104
|
qurl_count: z.number().optional().describe("Number of access tokens minted for this resource"),
|
|
77
|
-
qurls: z.array(
|
|
105
|
+
qurls: z.array(accessTokenOutputSchema).optional(),
|
|
78
106
|
});
|
|
79
107
|
/** Ephemeral create-time payload — note `qurl_link` is one-shot. */
|
|
80
|
-
export const createQurlOutputSchema = z.
|
|
108
|
+
export const createQurlOutputSchema = z.looseObject({
|
|
81
109
|
qurl_id: z.string().describe("Display-friendly qURL ID (q_ prefix)"),
|
|
82
|
-
resource_id: z.string().describe("Stable resource identifier (r_
|
|
110
|
+
resource_id: z.string().describe("Stable resource identifier (public key or legacy r_ ID)"),
|
|
83
111
|
qurl_link: z
|
|
84
112
|
.string()
|
|
85
|
-
.describe("
|
|
86
|
-
|
|
87
|
-
|
|
113
|
+
.describe("One-shot display access link — shown ONCE on creation, never returned again. Share immediately."),
|
|
114
|
+
branded_domain: z
|
|
115
|
+
.string()
|
|
116
|
+
.optional()
|
|
117
|
+
.describe("Bare branded hostname for anchor text when the resource has a usable custom domain"),
|
|
118
|
+
qurl_site: z.string().optional(),
|
|
119
|
+
expires_at: z.string().optional(),
|
|
88
120
|
label: z.string().optional(),
|
|
121
|
+
type: z.string().optional().describe("Resource type echoed from the create request"),
|
|
122
|
+
email_delivery: emailDeliveryResultSchema.optional(),
|
|
89
123
|
});
|
|
90
124
|
export const getQurlOutputSchema = qurlSchema;
|
|
91
125
|
export const updateQurlOutputSchema = qurlSchema;
|
|
@@ -94,50 +128,117 @@ export const extendQurlOutputSchema = qurlSchema;
|
|
|
94
128
|
* Paginated list response. When `meta.has_more` is true, pass
|
|
95
129
|
* `meta.next_cursor` as the `cursor` argument on the next call.
|
|
96
130
|
*/
|
|
97
|
-
export const listQurlsOutputSchema = z.
|
|
131
|
+
export const listQurlsOutputSchema = z.looseObject({
|
|
98
132
|
data: z.array(qurlSchema),
|
|
99
|
-
meta: z.
|
|
100
|
-
next_cursor: z
|
|
133
|
+
meta: z.looseObject({
|
|
134
|
+
next_cursor: z
|
|
135
|
+
.string()
|
|
136
|
+
.optional()
|
|
137
|
+
.describe("Pass to a subsequent list_qurls call to fetch the next page"),
|
|
101
138
|
has_more: z.boolean().describe("True if more pages are available beyond this response"),
|
|
102
139
|
page_size: z.number().optional(),
|
|
103
140
|
request_id: z.string().optional(),
|
|
104
141
|
}),
|
|
105
142
|
});
|
|
106
|
-
/** Resolve response: target_url + the access_grant that
|
|
107
|
-
export const resolveQurlOutputSchema = z.
|
|
143
|
+
/** Resolve response: target_url + the access_grant that grants network access. */
|
|
144
|
+
export const resolveQurlOutputSchema = z.looseObject({
|
|
108
145
|
target_url: z.string().describe("Underlying URL revealed by the resolve"),
|
|
109
146
|
resource_id: z.string(),
|
|
110
147
|
access_grant: z
|
|
111
|
-
.
|
|
148
|
+
.looseObject({
|
|
112
149
|
expires_in: z
|
|
113
150
|
.number()
|
|
114
|
-
.describe("Seconds the
|
|
151
|
+
.describe("Seconds the network grant permits access from `src_ip` before re-resolution is required"),
|
|
115
152
|
granted_at: z.string(),
|
|
116
153
|
src_ip: z.string().describe("Caller IP that the access grant is bound to"),
|
|
117
154
|
})
|
|
118
|
-
.describe("Time-bound, IP-bound access grant
|
|
155
|
+
.describe("Time-bound, IP-bound network access grant"),
|
|
119
156
|
});
|
|
120
157
|
/** Mint response: a fresh `qurl_link` for an existing resource. One-shot, like create_qurl. */
|
|
121
|
-
export const mintLinkOutputSchema = z.
|
|
122
|
-
|
|
123
|
-
|
|
158
|
+
export const mintLinkOutputSchema = z.looseObject({
|
|
159
|
+
qurl_id: z.string().describe("Display-friendly qURL ID (q_ prefix) for the minted token"),
|
|
160
|
+
qurl_link: z
|
|
161
|
+
.string()
|
|
162
|
+
.describe("Newly minted access link with one-shot display semantics, like create_qurl"),
|
|
163
|
+
branded_domain: z
|
|
164
|
+
.string()
|
|
165
|
+
.optional()
|
|
166
|
+
.describe("Bare branded hostname for anchor text when the resource has a usable custom domain"),
|
|
167
|
+
expires_at: z.string().optional(),
|
|
168
|
+
type: z.string().optional().describe("Resource type echoed from the underlying resource"),
|
|
169
|
+
email_delivery: emailDeliveryResultSchema.optional(),
|
|
170
|
+
});
|
|
171
|
+
export const uploadFileQurlOutputSchema = z.looseObject({
|
|
172
|
+
resource_id: z
|
|
173
|
+
.string()
|
|
174
|
+
.describe("Stable resource identifier (public key or legacy r_ ID) returned by the connector"),
|
|
175
|
+
qurl_id: z.string().describe("Display-friendly qURL ID (q_ prefix) for the minted token"),
|
|
176
|
+
qurl_link: z
|
|
177
|
+
.string()
|
|
178
|
+
.describe("One-shot display access link for the uploaded file — share immediately"),
|
|
179
|
+
qurl_site: z
|
|
180
|
+
.string()
|
|
181
|
+
.optional()
|
|
182
|
+
.describe("Resource site URL when it could be read back from get_qurl"),
|
|
183
|
+
expires_at: z.string().optional(),
|
|
184
|
+
file_name: z.string().describe("Filename registered with the connector"),
|
|
185
|
+
content_type: z.string().describe("MIME type used for the uploaded file"),
|
|
186
|
+
size_bytes: z.number().describe("Uploaded file size in bytes"),
|
|
187
|
+
branded_domain: z
|
|
188
|
+
.string()
|
|
189
|
+
.optional()
|
|
190
|
+
.describe("Bare branded hostname for anchor text when the resource has a usable custom domain"),
|
|
191
|
+
type: z.string().optional().describe("Resource type echoed from the minted token"),
|
|
192
|
+
email_delivery: emailDeliveryResultSchema.optional(),
|
|
193
|
+
});
|
|
194
|
+
export const updateQurlTokenOutputSchema = accessTokenOutputSchema;
|
|
195
|
+
export const revokeQurlTokenOutputSchema = z.looseObject({
|
|
196
|
+
resource_id: z.string(),
|
|
197
|
+
qurl_id: z.string(),
|
|
198
|
+
revoked: z.literal(true),
|
|
199
|
+
message: z.string(),
|
|
200
|
+
});
|
|
201
|
+
export const listQurlSessionsOutputSchema = z.looseObject({
|
|
202
|
+
data: z.array(z.looseObject({
|
|
203
|
+
session_id: z.string(),
|
|
204
|
+
qurl_id: z.string().optional(),
|
|
205
|
+
src_ip: z.string().optional(),
|
|
206
|
+
user_agent: z.string().optional(),
|
|
207
|
+
created_at: z.string().optional(),
|
|
208
|
+
last_seen_at: z.string().optional(),
|
|
209
|
+
})),
|
|
210
|
+
meta: z
|
|
211
|
+
.looseObject({
|
|
212
|
+
request_id: z.string().optional(),
|
|
213
|
+
})
|
|
214
|
+
.optional(),
|
|
215
|
+
});
|
|
216
|
+
export const terminateQurlSessionsOutputSchema = z.looseObject({
|
|
217
|
+
resource_id: z.string(),
|
|
218
|
+
session_id: z.string().optional(),
|
|
219
|
+
terminated: z.number(),
|
|
220
|
+
message: z.string(),
|
|
124
221
|
});
|
|
125
222
|
// Discriminated on `success` so the schema enforces the API's
|
|
126
223
|
// mutual-exclusivity contract — a host or planner generating UI from
|
|
127
224
|
// the schema will only show success-fields under `success: true` and
|
|
128
225
|
// the `error` block under `success: false`, never both.
|
|
129
|
-
const batchItemSuccessSchema = z.
|
|
226
|
+
const batchItemSuccessSchema = z.looseObject({
|
|
130
227
|
index: z.number().describe("Index of the corresponding item in the input `items` array"),
|
|
131
228
|
success: z.literal(true),
|
|
132
229
|
resource_id: z.string(),
|
|
133
|
-
qurl_link: z.string().describe("One-shot access link — shown ONCE on creation"),
|
|
230
|
+
qurl_link: z.string().describe("One-shot display access link — shown ONCE on creation"),
|
|
231
|
+
branded_domain: z
|
|
232
|
+
.string()
|
|
233
|
+
.optional()
|
|
234
|
+
.describe("Bare branded hostname for anchor text when the resource has a usable custom domain"),
|
|
134
235
|
qurl_site: z.string(),
|
|
135
236
|
expires_at: z.string(),
|
|
136
237
|
});
|
|
137
|
-
const batchItemFailureSchema = z.
|
|
238
|
+
const batchItemFailureSchema = z.looseObject({
|
|
138
239
|
index: z.number().describe("Index of the corresponding item in the input `items` array"),
|
|
139
240
|
success: z.literal(false),
|
|
140
|
-
error: z.
|
|
241
|
+
error: z.looseObject({
|
|
141
242
|
code: z.string(),
|
|
142
243
|
message: z.string(),
|
|
143
244
|
}),
|
|
@@ -154,14 +255,14 @@ const batchItemResultSchema = z
|
|
|
154
255
|
* `output-schemas.types.test.ts` asserts the flattened shape against the
|
|
155
256
|
* client interface so drift on either side fails compilation.
|
|
156
257
|
*/
|
|
157
|
-
export const batchCreateOutputSchema = z.
|
|
258
|
+
export const batchCreateOutputSchema = z.looseObject({
|
|
158
259
|
succeeded: z.number(),
|
|
159
260
|
failed: z.number(),
|
|
160
261
|
results: z.array(batchItemResultSchema),
|
|
161
262
|
request_id: z.string().optional(),
|
|
162
263
|
});
|
|
163
264
|
/** Delete confirmation. The qURL is in a revoked state after this call. */
|
|
164
|
-
export const deleteQurlOutputSchema = z.
|
|
265
|
+
export const deleteQurlOutputSchema = z.looseObject({
|
|
165
266
|
resource_id: z.string(),
|
|
166
267
|
revoked: z.literal(true),
|
|
167
268
|
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,eAAe,EAAE,CAAC;SACf,WAAW,CAAC;QACX,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QACjC,eAAe,EAAE,CAAC,CAA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,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,23 +1,16 @@
|
|
|
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
|
-
|
|
7
|
-
}, {
|
|
8
|
-
access_token: string;
|
|
9
|
-
}>;
|
|
10
|
-
export declare function resolveQurlTool(client: IQURLClient): {
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare function resolveQurlTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
|
|
11
8
|
name: string;
|
|
12
9
|
title: string;
|
|
13
10
|
description: string;
|
|
14
11
|
inputSchema: z.ZodObject<{
|
|
15
12
|
access_token: z.ZodString;
|
|
16
|
-
},
|
|
17
|
-
access_token: string;
|
|
18
|
-
}, {
|
|
19
|
-
access_token: string;
|
|
20
|
-
}>;
|
|
13
|
+
}, z.core.$strip>;
|
|
21
14
|
outputSchema: z.ZodObject<{
|
|
22
15
|
target_url: z.ZodString;
|
|
23
16
|
resource_id: z.ZodString;
|
|
@@ -25,32 +18,8 @@ export declare function resolveQurlTool(client: IQURLClient): {
|
|
|
25
18
|
expires_in: z.ZodNumber;
|
|
26
19
|
granted_at: z.ZodString;
|
|
27
20
|
src_ip: z.ZodString;
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
granted_at: string;
|
|
31
|
-
src_ip: string;
|
|
32
|
-
}, {
|
|
33
|
-
expires_in: number;
|
|
34
|
-
granted_at: string;
|
|
35
|
-
src_ip: string;
|
|
36
|
-
}>;
|
|
37
|
-
}, "strip", z.ZodTypeAny, {
|
|
38
|
-
resource_id: string;
|
|
39
|
-
target_url: string;
|
|
40
|
-
access_grant: {
|
|
41
|
-
expires_in: number;
|
|
42
|
-
granted_at: string;
|
|
43
|
-
src_ip: string;
|
|
44
|
-
};
|
|
45
|
-
}, {
|
|
46
|
-
resource_id: string;
|
|
47
|
-
target_url: string;
|
|
48
|
-
access_grant: {
|
|
49
|
-
expires_in: number;
|
|
50
|
-
granted_at: string;
|
|
51
|
-
src_ip: string;
|
|
52
|
-
};
|
|
53
|
-
}>;
|
|
21
|
+
}, z.core.$loose>;
|
|
22
|
+
}, z.core.$loose>;
|
|
54
23
|
annotations: {
|
|
55
24
|
title: string;
|
|
56
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
|
-
description: "Redeem a qURL access token (the `at_` prefix you pulled out of a `qurl_link`) to reveal the underlying URL and
|
|
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`
|
|
16
|
-
"Use `get_qurl` instead when you have a resource
|
|
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
|
+
"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 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,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,CAAC,IAAI,CAAC;aACpD,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { IQURLClient } from "../client.js";
|
|
3
|
+
import { type ToolRuntimeOptions } from "./_shared.js";
|
|
4
|
+
export declare const revokeQurlTokenSchema: z.ZodObject<{
|
|
5
|
+
resource_id: z.ZodString;
|
|
6
|
+
qurl_id: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare function revokeQurlTokenTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
|
|
9
|
+
name: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
inputSchema: z.ZodObject<{
|
|
13
|
+
resource_id: z.ZodString;
|
|
14
|
+
qurl_id: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
outputSchema: z.ZodObject<{
|
|
17
|
+
resource_id: z.ZodString;
|
|
18
|
+
qurl_id: z.ZodString;
|
|
19
|
+
revoked: z.ZodLiteral<true>;
|
|
20
|
+
message: z.ZodString;
|
|
21
|
+
}, z.core.$loose>;
|
|
22
|
+
annotations: {
|
|
23
|
+
title: string;
|
|
24
|
+
readOnlyHint: boolean;
|
|
25
|
+
destructiveHint: boolean;
|
|
26
|
+
idempotentHint: boolean;
|
|
27
|
+
openWorldHint: boolean;
|
|
28
|
+
};
|
|
29
|
+
handler: (input: {
|
|
30
|
+
resource_id: string;
|
|
31
|
+
qurl_id: string;
|
|
32
|
+
}) => Promise<{
|
|
33
|
+
content: Array<{
|
|
34
|
+
type: "text";
|
|
35
|
+
text: string;
|
|
36
|
+
}>;
|
|
37
|
+
structuredContent?: Record<string, unknown>;
|
|
38
|
+
isError?: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=revoke-qurl-token.d.ts.map
|
|
@@ -0,0 +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;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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { qurlDisplayIdSchema, resourceOnlyIdSchema, toStructuredContent, withMissingApiKeyHandler, } from "./_shared.js";
|
|
3
|
+
import { revokeQurlTokenOutputSchema } from "./output-schemas.js";
|
|
4
|
+
export const revokeQurlTokenSchema = z.object({
|
|
5
|
+
resource_id: resourceOnlyIdSchema("revoke a specific qURL token from"),
|
|
6
|
+
qurl_id: qurlDisplayIdSchema("revoke"),
|
|
7
|
+
});
|
|
8
|
+
export function revokeQurlTokenTool(client, _runtime = { mode: "stdio" }) {
|
|
9
|
+
return {
|
|
10
|
+
name: "revoke_qurl_token",
|
|
11
|
+
title: "Revoke qURL Token",
|
|
12
|
+
description: "Revoke one qURL token under a resource without revoking the whole resource. " +
|
|
13
|
+
"Use this when a single recipient/link should stop working but sibling qURLs on the same `resource_id` must remain active. " +
|
|
14
|
+
"Use `delete_qurl` instead when you want to revoke the resource and every token under it. " +
|
|
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
|
+
inputSchema: revokeQurlTokenSchema,
|
|
17
|
+
outputSchema: revokeQurlTokenOutputSchema,
|
|
18
|
+
annotations: {
|
|
19
|
+
title: "Revoke qURL Token",
|
|
20
|
+
readOnlyHint: false,
|
|
21
|
+
destructiveHint: true,
|
|
22
|
+
idempotentHint: false,
|
|
23
|
+
openWorldHint: true,
|
|
24
|
+
},
|
|
25
|
+
handler: withMissingApiKeyHandler(async (input) => {
|
|
26
|
+
await client.revokeQurlToken(input.resource_id, input.qurl_id);
|
|
27
|
+
const payload = {
|
|
28
|
+
resource_id: input.resource_id,
|
|
29
|
+
qurl_id: input.qurl_id,
|
|
30
|
+
revoked: true,
|
|
31
|
+
message: `qURL token ${input.qurl_id} is revoked.`,
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
35
|
+
structuredContent: toStructuredContent(payload),
|
|
36
|
+
};
|
|
37
|
+
}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=revoke-qurl-token.js.map
|
|
@@ -0,0 +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,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,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type IQURLClient } from "../client.js";
|
|
3
|
+
import { type ToolRuntimeOptions } from "./_shared.js";
|
|
4
|
+
export declare const terminateQurlSessionsSchema: z.ZodObject<{
|
|
5
|
+
resource_id: z.ZodString;
|
|
6
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare function terminateQurlSessionsTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
|
|
9
|
+
name: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
inputSchema: z.ZodObject<{
|
|
13
|
+
resource_id: z.ZodString;
|
|
14
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
outputSchema: z.ZodObject<{
|
|
17
|
+
resource_id: z.ZodString;
|
|
18
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
19
|
+
terminated: z.ZodNumber;
|
|
20
|
+
message: z.ZodString;
|
|
21
|
+
}, z.core.$loose>;
|
|
22
|
+
annotations: {
|
|
23
|
+
title: string;
|
|
24
|
+
readOnlyHint: boolean;
|
|
25
|
+
destructiveHint: boolean;
|
|
26
|
+
idempotentHint: boolean;
|
|
27
|
+
openWorldHint: boolean;
|
|
28
|
+
};
|
|
29
|
+
handler: (input: {
|
|
30
|
+
resource_id: string;
|
|
31
|
+
session_id?: string | undefined;
|
|
32
|
+
}) => Promise<{
|
|
33
|
+
content: Array<{
|
|
34
|
+
type: "text";
|
|
35
|
+
text: string;
|
|
36
|
+
}>;
|
|
37
|
+
structuredContent?: Record<string, unknown>;
|
|
38
|
+
isError?: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=terminate-qurl-sessions.d.ts.map
|
|
@@ -0,0 +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;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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { QURLAPIError } from "../client.js";
|
|
3
|
+
import { resourceOnlyIdSchema, toStructuredContent, withMissingApiKeyHandler, } from "./_shared.js";
|
|
4
|
+
import { terminateQurlSessionsOutputSchema } from "./output-schemas.js";
|
|
5
|
+
export const terminateQurlSessionsSchema = z.object({
|
|
6
|
+
resource_id: resourceOnlyIdSchema("terminate sessions for"),
|
|
7
|
+
session_id: z
|
|
8
|
+
.string()
|
|
9
|
+
.min(1)
|
|
10
|
+
.optional()
|
|
11
|
+
.describe("Specific session ID to terminate. Omit to terminate all active sessions for the resource."),
|
|
12
|
+
});
|
|
13
|
+
export function terminateQurlSessionsTool(client, _runtime = { mode: "stdio" }) {
|
|
14
|
+
return {
|
|
15
|
+
name: "terminate_qurl_sessions",
|
|
16
|
+
title: "Terminate qURL Sessions",
|
|
17
|
+
description: "Terminate active access sessions for a qURL resource. " +
|
|
18
|
+
"Use this after shortening access, rotating a link, or responding to a suspected leak when already-open sessions should end immediately. " +
|
|
19
|
+
"Pass `session_id` to terminate one active session; omit it to terminate all active sessions for the resource. " +
|
|
20
|
+
"Use `list_qurl_sessions` first when you need to inspect current sessions before taking action. " +
|
|
21
|
+
"**Side-effects:** existing access sessions are closed; qURL tokens themselves are not revoked.",
|
|
22
|
+
inputSchema: terminateQurlSessionsSchema,
|
|
23
|
+
outputSchema: terminateQurlSessionsOutputSchema,
|
|
24
|
+
annotations: {
|
|
25
|
+
title: "Terminate qURL Sessions",
|
|
26
|
+
readOnlyHint: false,
|
|
27
|
+
destructiveHint: true,
|
|
28
|
+
idempotentHint: false,
|
|
29
|
+
openWorldHint: true,
|
|
30
|
+
},
|
|
31
|
+
handler: withMissingApiKeyHandler(async (input) => {
|
|
32
|
+
if (input.session_id) {
|
|
33
|
+
await client.terminateResourceSession(input.resource_id, input.session_id);
|
|
34
|
+
const payload = {
|
|
35
|
+
resource_id: input.resource_id,
|
|
36
|
+
session_id: input.session_id,
|
|
37
|
+
// The API returns 204 for a single session delete, so the tool
|
|
38
|
+
// synthesizes the count from the successful operation. This means
|
|
39
|
+
// `terminated: 1` confirms accepted idempotent deletion semantics;
|
|
40
|
+
// it cannot prove that the session still existed at request time.
|
|
41
|
+
terminated: 1,
|
|
42
|
+
message: `qURL session ${input.session_id} is terminated.`,
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
46
|
+
structuredContent: toStructuredContent(payload),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const result = await client.terminateAllResourceSessions(input.resource_id);
|
|
50
|
+
// The typed client contract requires this count; retain a runtime guard
|
|
51
|
+
// because the SDK response is untrusted at the wire boundary.
|
|
52
|
+
const terminated = result.data?.terminated;
|
|
53
|
+
if (typeof terminated !== "number") {
|
|
54
|
+
throw new QURLAPIError(502, "invalid_response", "qURL API returned an invalid session termination response.");
|
|
55
|
+
}
|
|
56
|
+
const payload = {
|
|
57
|
+
resource_id: input.resource_id,
|
|
58
|
+
terminated,
|
|
59
|
+
message: `Terminated ${terminated} qURL session(s).`,
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
63
|
+
structuredContent: toStructuredContent(payload),
|
|
64
|
+
};
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=terminate-qurl-sessions.js.map
|