@layervai/qurl-mcp 0.4.0 → 0.4.1
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 +5 -1
- package/dist/client.d.ts +111 -22
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +161 -77
- package/dist/client.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- 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 +7 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/_shared.d.ts +4 -2
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/_shared.js +15 -3
- package/dist/tools/_shared.js.map +1 -1
- package/dist/tools/batch-create.d.ts +31 -339
- package/dist/tools/batch-create.d.ts.map +1 -1
- package/dist/tools/batch-create.js +1 -0
- package/dist/tools/batch-create.js.map +1 -1
- package/dist/tools/create-qurl.d.ts +37 -234
- package/dist/tools/create-qurl.d.ts.map +1 -1
- package/dist/tools/create-qurl.js +25 -28
- package/dist/tools/create-qurl.js.map +1 -1
- package/dist/tools/delete-qurl.d.ts +3 -21
- package/dist/tools/delete-qurl.d.ts.map +1 -1
- package/dist/tools/delete-qurl.js +18 -5
- package/dist/tools/delete-qurl.js.map +1 -1
- package/dist/tools/extend-qurl.d.ts +34 -188
- package/dist/tools/extend-qurl.d.ts.map +1 -1
- package/dist/tools/get-qurl.d.ts +34 -184
- package/dist/tools/get-qurl.d.ts.map +1 -1
- package/dist/tools/get-qurl.js +3 -2
- package/dist/tools/get-qurl.js.map +1 -1
- package/dist/tools/list-qurl-sessions.d.ts +44 -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 +36 -318
- package/dist/tools/list-qurls.d.ts.map +1 -1
- package/dist/tools/list-qurls.js +41 -18
- package/dist/tools/list-qurls.js.map +1 -1
- package/dist/tools/mint-link.d.ts +34 -301
- package/dist/tools/mint-link.d.ts.map +1 -1
- package/dist/tools/mint-link.js +12 -9
- package/dist/tools/mint-link.js.map +1 -1
- package/dist/tools/output-schemas.d.ts +266 -1109
- package/dist/tools/output-schemas.d.ts.map +1 -1
- package/dist/tools/output-schemas.js +96 -20
- package/dist/tools/output-schemas.js.map +1 -1
- package/dist/tools/resolve-qurl.d.ts +4 -36
- package/dist/tools/resolve-qurl.d.ts.map +1 -1
- package/dist/tools/resolve-qurl.js +2 -2
- package/dist/tools/resolve-qurl.js.map +1 -1
- package/dist/tools/revoke-qurl-token.d.ts +40 -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 +40 -0
- package/dist/tools/terminate-qurl-sessions.d.ts.map +1 -0
- package/dist/tools/terminate-qurl-sessions.js +64 -0
- package/dist/tools/terminate-qurl-sessions.js.map +1 -0
- package/dist/tools/update-qurl-token.d.ts +141 -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 +41 -263
- package/dist/tools/update-qurl.d.ts.map +1 -1
- package/dist/tools/update-qurl.js +56 -7
- package/dist/tools/update-qurl.js.map +1 -1
- package/package.json +4 -3
|
@@ -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","source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AM,sBAAsB;;;;;iBAUjC,CAAC"}
|
|
@@ -38,43 +38,71 @@ const accessPolicy = z
|
|
|
38
38
|
.optional(),
|
|
39
39
|
})
|
|
40
40
|
.describe("Access control policy snapshot for this token");
|
|
41
|
-
const
|
|
41
|
+
export const accessTokenOutputSchema = z
|
|
42
42
|
.object({
|
|
43
43
|
qurl_id: z.string(),
|
|
44
44
|
label: z.string().optional(),
|
|
45
|
+
// Same drift-tolerance rationale as qurlSchema.status — token-level
|
|
46
|
+
// status is wider and just as exposed to a new server-side value
|
|
47
|
+
// reaching a host between weekly snapshot runs.
|
|
45
48
|
status: z
|
|
46
|
-
.enum(["active", "consumed", "expired", "revoked"])
|
|
49
|
+
.enum(["active", "consumed", "expired", "revoked", "unknown"])
|
|
50
|
+
.catch("unknown")
|
|
47
51
|
.describe("Per-token status (wider than resource status — tokens may be consumed/expired independently)"),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
// QurlSummary in api-spec/qurls.yaml intentionally has no `required`
|
|
53
|
+
// list, so these server-owned details are optional even though most
|
|
54
|
+
// responses include them.
|
|
55
|
+
one_time_use: z.boolean().optional(),
|
|
56
|
+
max_sessions: z.number().optional(),
|
|
57
|
+
session_duration: z
|
|
58
|
+
.number()
|
|
59
|
+
.optional()
|
|
60
|
+
.describe("Seconds of access granted after a successful resolve"),
|
|
61
|
+
use_count: z.number().optional(),
|
|
52
62
|
qurl_site: z.string().optional(),
|
|
53
63
|
access_policy: accessPolicy.optional(),
|
|
54
|
-
created_at: z.string(),
|
|
55
|
-
expires_at: z.string(),
|
|
64
|
+
created_at: z.string().optional(),
|
|
65
|
+
expires_at: z.string().optional(),
|
|
56
66
|
})
|
|
57
67
|
.describe("Single access token belonging to a qURL resource");
|
|
58
68
|
/** Stable QURL resource shape returned by get/list/update/extend. */
|
|
59
69
|
export const qurlSchema = z.object({
|
|
60
70
|
resource_id: z.string().describe("Stable resource identifier (r_ prefix)"),
|
|
61
71
|
qurl_site: z.string().optional(),
|
|
62
|
-
target_url: z
|
|
72
|
+
target_url: z
|
|
73
|
+
.string()
|
|
74
|
+
.optional()
|
|
75
|
+
.describe("Underlying URL the qURL protects; omitted on connector-owned resources"),
|
|
63
76
|
description: z.string().optional(),
|
|
64
77
|
tags: z.array(z.string()).optional(),
|
|
65
78
|
expires_at: z.string(),
|
|
66
79
|
created_at: z.string(),
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
|
|
80
|
+
// `"expired"` is first-class because api-spec/qurls.yaml's
|
|
81
|
+
// `QurlData.properties.status` description documents it as a real
|
|
82
|
+
// lifecycle value (despite the spec's `enum:` line listing only
|
|
83
|
+
// `[active, revoked]`). `"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
108
|
export const createQurlOutputSchema = z.object({
|
|
@@ -82,10 +110,15 @@ export const createQurlOutputSchema = z.object({
|
|
|
82
110
|
resource_id: z.string().describe("Stable resource identifier (r_ prefix)"),
|
|
83
111
|
qurl_link: z
|
|
84
112
|
.string()
|
|
85
|
-
.describe("
|
|
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"),
|
|
86
118
|
qurl_site: z.string(),
|
|
87
119
|
expires_at: z.string(),
|
|
88
120
|
label: z.string().optional(),
|
|
121
|
+
type: z.string().optional().describe("Resource type echoed from the create request"),
|
|
89
122
|
});
|
|
90
123
|
export const getQurlOutputSchema = qurlSchema;
|
|
91
124
|
export const updateQurlOutputSchema = qurlSchema;
|
|
@@ -97,13 +130,16 @@ export const extendQurlOutputSchema = qurlSchema;
|
|
|
97
130
|
export const listQurlsOutputSchema = z.object({
|
|
98
131
|
data: z.array(qurlSchema),
|
|
99
132
|
meta: z.object({
|
|
100
|
-
next_cursor: z
|
|
133
|
+
next_cursor: z
|
|
134
|
+
.string()
|
|
135
|
+
.optional()
|
|
136
|
+
.describe("Pass to a subsequent list_qurls call to fetch the next page"),
|
|
101
137
|
has_more: z.boolean().describe("True if more pages are available beyond this response"),
|
|
102
138
|
page_size: z.number().optional(),
|
|
103
139
|
request_id: z.string().optional(),
|
|
104
140
|
}),
|
|
105
141
|
});
|
|
106
|
-
/** Resolve response: target_url + the access_grant that
|
|
142
|
+
/** Resolve response: target_url + the access_grant that grants network access. */
|
|
107
143
|
export const resolveQurlOutputSchema = z.object({
|
|
108
144
|
target_url: z.string().describe("Underlying URL revealed by the resolve"),
|
|
109
145
|
resource_id: z.string(),
|
|
@@ -111,16 +147,52 @@ export const resolveQurlOutputSchema = z.object({
|
|
|
111
147
|
.object({
|
|
112
148
|
expires_in: z
|
|
113
149
|
.number()
|
|
114
|
-
.describe("Seconds the
|
|
150
|
+
.describe("Seconds the network grant permits access from `src_ip` before re-resolution is required"),
|
|
115
151
|
granted_at: z.string(),
|
|
116
152
|
src_ip: z.string().describe("Caller IP that the access grant is bound to"),
|
|
117
153
|
})
|
|
118
|
-
.describe("Time-bound, IP-bound access grant
|
|
154
|
+
.describe("Time-bound, IP-bound network access grant"),
|
|
119
155
|
});
|
|
120
156
|
/** Mint response: a fresh `qurl_link` for an existing resource. One-shot, like create_qurl. */
|
|
121
157
|
export const mintLinkOutputSchema = z.object({
|
|
122
|
-
|
|
158
|
+
qurl_id: z.string().describe("Display-friendly qURL ID (q_ prefix) for the minted token"),
|
|
159
|
+
qurl_link: z
|
|
160
|
+
.string()
|
|
161
|
+
.describe("Newly minted access link with one-shot display semantics, like create_qurl"),
|
|
162
|
+
branded_domain: z
|
|
163
|
+
.string()
|
|
164
|
+
.optional()
|
|
165
|
+
.describe("Bare branded hostname for anchor text when the resource has a usable custom domain"),
|
|
123
166
|
expires_at: z.string(),
|
|
167
|
+
type: z.string().optional().describe("Resource type echoed from the underlying resource"),
|
|
168
|
+
});
|
|
169
|
+
export const updateQurlTokenOutputSchema = accessTokenOutputSchema;
|
|
170
|
+
export const revokeQurlTokenOutputSchema = z.object({
|
|
171
|
+
resource_id: z.string(),
|
|
172
|
+
qurl_id: z.string(),
|
|
173
|
+
revoked: z.literal(true),
|
|
174
|
+
message: z.string(),
|
|
175
|
+
});
|
|
176
|
+
export const listQurlSessionsOutputSchema = z.object({
|
|
177
|
+
data: z.array(z.object({
|
|
178
|
+
session_id: z.string(),
|
|
179
|
+
qurl_id: z.string().optional(),
|
|
180
|
+
src_ip: z.string().optional(),
|
|
181
|
+
user_agent: z.string().optional(),
|
|
182
|
+
created_at: z.string().optional(),
|
|
183
|
+
last_seen_at: z.string().optional(),
|
|
184
|
+
})),
|
|
185
|
+
meta: z
|
|
186
|
+
.object({
|
|
187
|
+
request_id: z.string().optional(),
|
|
188
|
+
})
|
|
189
|
+
.optional(),
|
|
190
|
+
});
|
|
191
|
+
export const terminateQurlSessionsOutputSchema = z.object({
|
|
192
|
+
resource_id: z.string(),
|
|
193
|
+
session_id: z.string().optional(),
|
|
194
|
+
terminated: z.number(),
|
|
195
|
+
message: z.string(),
|
|
124
196
|
});
|
|
125
197
|
// Discriminated on `success` so the schema enforces the API's
|
|
126
198
|
// mutual-exclusivity contract — a host or planner generating UI from
|
|
@@ -130,7 +202,11 @@ const batchItemSuccessSchema = z.object({
|
|
|
130
202
|
index: z.number().describe("Index of the corresponding item in the input `items` array"),
|
|
131
203
|
success: z.literal(true),
|
|
132
204
|
resource_id: z.string(),
|
|
133
|
-
qurl_link: z.string().describe("One-shot access link — shown ONCE on creation"),
|
|
205
|
+
qurl_link: z.string().describe("One-shot display access link — shown ONCE on creation"),
|
|
206
|
+
branded_domain: z
|
|
207
|
+
.string()
|
|
208
|
+
.optional()
|
|
209
|
+
.describe("Bare branded hostname for anchor text when the resource has a usable custom domain"),
|
|
134
210
|
qurl_site: z.string(),
|
|
135
211
|
expires_at: z.string(),
|
|
136
212
|
});
|
|
@@ -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;AAExB;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,YAAY,GAAG,CAAC;KACnB,MAAM,CAAC;IACN,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,CA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;GAQG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,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,MAAM,CAAC;IAC7C,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"}
|
|
@@ -2,22 +2,14 @@ import { z } from "zod";
|
|
|
2
2
|
import type { IQURLClient } from "../client.js";
|
|
3
3
|
export declare const resolveQurlSchema: z.ZodObject<{
|
|
4
4
|
access_token: z.ZodString;
|
|
5
|
-
},
|
|
6
|
-
access_token: string;
|
|
7
|
-
}, {
|
|
8
|
-
access_token: string;
|
|
9
|
-
}>;
|
|
5
|
+
}, z.core.$strip>;
|
|
10
6
|
export declare function resolveQurlTool(client: IQURLClient): {
|
|
11
7
|
name: string;
|
|
12
8
|
title: string;
|
|
13
9
|
description: string;
|
|
14
10
|
inputSchema: z.ZodObject<{
|
|
15
11
|
access_token: z.ZodString;
|
|
16
|
-
},
|
|
17
|
-
access_token: string;
|
|
18
|
-
}, {
|
|
19
|
-
access_token: string;
|
|
20
|
-
}>;
|
|
12
|
+
}, z.core.$strip>;
|
|
21
13
|
outputSchema: z.ZodObject<{
|
|
22
14
|
target_url: z.ZodString;
|
|
23
15
|
resource_id: z.ZodString;
|
|
@@ -25,32 +17,8 @@ export declare function resolveQurlTool(client: IQURLClient): {
|
|
|
25
17
|
expires_in: z.ZodNumber;
|
|
26
18
|
granted_at: z.ZodString;
|
|
27
19
|
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
|
-
}>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
}, z.core.$strip>;
|
|
54
22
|
annotations: {
|
|
55
23
|
title: string;
|
|
56
24
|
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;AAIhD,eAAO,MAAM,iBAAiB
|
|
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;AAIhD,eAAO,MAAM,iBAAiB;;iBAK5B,CAAC;AAEH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgClD"}
|
|
@@ -11,8 +11,8 @@ export function resolveQurlTool(client) {
|
|
|
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`
|
|
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
16
|
"Use `get_qurl` instead when you have a resource ID (`r_`) 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.",
|
|
@@ -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,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAA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AAE;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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { IQURLClient } from "../client.js";
|
|
3
|
+
export declare const revokeQurlTokenSchema: z.ZodObject<{
|
|
4
|
+
resource_id: z.ZodString;
|
|
5
|
+
qurl_id: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare function revokeQurlTokenTool(client: IQURLClient): {
|
|
8
|
+
name: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
inputSchema: z.ZodObject<{
|
|
12
|
+
resource_id: z.ZodString;
|
|
13
|
+
qurl_id: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
outputSchema: z.ZodObject<{
|
|
16
|
+
resource_id: z.ZodString;
|
|
17
|
+
qurl_id: z.ZodString;
|
|
18
|
+
revoked: z.ZodLiteral<true>;
|
|
19
|
+
message: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
annotations: {
|
|
22
|
+
title: string;
|
|
23
|
+
readOnlyHint: boolean;
|
|
24
|
+
destructiveHint: boolean;
|
|
25
|
+
idempotentHint: boolean;
|
|
26
|
+
openWorldHint: boolean;
|
|
27
|
+
};
|
|
28
|
+
handler: (input: {
|
|
29
|
+
resource_id: string;
|
|
30
|
+
qurl_id: string;
|
|
31
|
+
}) => Promise<{
|
|
32
|
+
content: Array<{
|
|
33
|
+
type: "text";
|
|
34
|
+
text: string;
|
|
35
|
+
}>;
|
|
36
|
+
structuredContent?: Record<string, unknown>;
|
|
37
|
+
isError?: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
40
|
+
//# 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;AAShD,eAAO,MAAM,qBAAqB;;;iBAGhC,CAAC;AAEH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCtD"}
|
|
@@ -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) {
|
|
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` (`r_…`) 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,GACzB,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,CAAC,MAAmB;IACrD,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACT,8EAA8E;YAC9E,4HAA4H;YAC5H,2FAA2F;YAC3F,0LAA0L;QAC5L,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,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type IQURLClient } from "../client.js";
|
|
3
|
+
export declare const terminateQurlSessionsSchema: z.ZodObject<{
|
|
4
|
+
resource_id: z.ZodString;
|
|
5
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare function terminateQurlSessionsTool(client: IQURLClient): {
|
|
8
|
+
name: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
inputSchema: z.ZodObject<{
|
|
12
|
+
resource_id: z.ZodString;
|
|
13
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
outputSchema: z.ZodObject<{
|
|
16
|
+
resource_id: z.ZodString;
|
|
17
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
terminated: z.ZodNumber;
|
|
19
|
+
message: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
annotations: {
|
|
22
|
+
title: string;
|
|
23
|
+
readOnlyHint: boolean;
|
|
24
|
+
destructiveHint: boolean;
|
|
25
|
+
idempotentHint: boolean;
|
|
26
|
+
openWorldHint: boolean;
|
|
27
|
+
};
|
|
28
|
+
handler: (input: {
|
|
29
|
+
resource_id: string;
|
|
30
|
+
session_id?: string | undefined;
|
|
31
|
+
}) => Promise<{
|
|
32
|
+
content: Array<{
|
|
33
|
+
type: "text";
|
|
34
|
+
text: string;
|
|
35
|
+
}>;
|
|
36
|
+
structuredContent?: Record<string, unknown>;
|
|
37
|
+
isError?: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
40
|
+
//# 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;AAI9D,eAAO,MAAM,2BAA2B;;;iBAStC,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D5D"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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) {
|
|
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.
|
|
39
|
+
terminated: 1,
|
|
40
|
+
message: `qURL session ${input.session_id} is terminated.`,
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
44
|
+
structuredContent: toStructuredContent(payload),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const result = await client.terminateAllResourceSessions(input.resource_id);
|
|
48
|
+
const terminated = result.data?.terminated;
|
|
49
|
+
if (typeof terminated !== "number") {
|
|
50
|
+
throw new QURLAPIError(502, "invalid_response", "qURL API returned an invalid session termination response.");
|
|
51
|
+
}
|
|
52
|
+
const payload = {
|
|
53
|
+
resource_id: input.resource_id,
|
|
54
|
+
terminated,
|
|
55
|
+
message: `Terminated ${terminated} qURL session(s).`,
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
59
|
+
structuredContent: toStructuredContent(payload),
|
|
60
|
+
};
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=terminate-qurl-sessions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminate-qurl-sessions.js","sourceRoot":"","sources":["../../src/tools/terminate-qurl-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACnG,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAExE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,WAAW,EAAE,oBAAoB,CAAC,wBAAwB,CAAC;IAC3D,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,2FAA2F,CAC5F;CACJ,CAAC,CAAC;AAEH,MAAM,UAAU,yBAAyB,CAAC,MAAmB;IAC3D,OAAO;QACL,IAAI,EAAE,yBAAyB;QAC/B,KAAK,EAAE,yBAAyB;QAChC,WAAW,EACT,wDAAwD;YACxD,0IAA0I;YAC1I,gHAAgH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