@lostgradient/mcp 0.2.5 → 0.3.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/LICENSE +1 -1
- package/README.md +15 -173
- package/dist/http.d.ts +35 -0
- package/dist/http.js +251 -0
- package/dist/internal/cryptography/encryption.d.ts +108 -0
- package/dist/internal/cryptography/encryption.js +241 -0
- package/dist/internal/cryptography/hash.d.ts +72 -0
- package/dist/internal/cryptography/hash.js +233 -0
- package/dist/internal/cryptography/index.d.ts +4 -0
- package/dist/internal/cryptography/index.js +2 -0
- package/dist/oauth/canonicalize-ip-address.d.ts +0 -6
- package/dist/oauth/canonicalize-ip-address.js +113 -0
- package/dist/oauth/client-metadata-documents.d.ts +2 -22
- package/dist/oauth/client-metadata-documents.js +205 -19
- package/dist/oauth/index.d.ts +9 -213
- package/dist/oauth/index.js +6 -69
- package/dist/oauth/issuer.d.ts +103 -0
- package/dist/oauth/issuer.js +564 -0
- package/dist/oauth/postgres.d.ts +12 -0
- package/dist/oauth/postgres.js +76 -0
- package/dist/oauth/safe-public-https-fetch.d.ts +3 -5
- package/dist/oauth/safe-public-https-fetch.js +114 -0
- package/dist/oauth/security-utilities.d.ts +0 -3
- package/dist/oauth/security-utilities.js +93 -0
- package/dist/oauth-store.d.ts +108 -0
- package/dist/oauth-store.js +321 -0
- package/package.json +50 -124
- package/dist/chunk-3ek3knfm.js +0 -73
- package/dist/chunk-3rr24vhh.js +0 -28
- package/dist/chunk-6ekjtvcq.js +0 -273
- package/dist/chunk-88nhf6xt.js +0 -449
- package/dist/chunk-en76akaq.js +0 -1107
- package/dist/chunk-k6fm3cmk.js +0 -132
- package/dist/chunk-qxwd8est.js +0 -916
- package/dist/chunk-rxnyn7tf.js +0 -19
- package/dist/chunk-taxyscge.js +0 -67
- package/dist/chunk-wsnfttyg.js +0 -4
- package/dist/chunk-xcf742mf.js +0 -14
- package/dist/conformance-fixture-registration.d.ts +0 -30
- package/dist/conformance-server.d.ts +0 -1
- package/dist/conformance.d.ts +0 -43
- package/dist/env.d.ts +0 -59
- package/dist/env.js +0 -9
- package/dist/environment-schema.d.ts +0 -29
- package/dist/environment-schema.js +0 -6
- package/dist/golden-prompts.d.ts +0 -42
- package/dist/handler-context.d.ts +0 -16
- package/dist/http/authenticate.d.ts +0 -35
- package/dist/http/authorization-header.d.ts +0 -5
- package/dist/http/grant-revocation-channel.d.ts +0 -24
- package/dist/http/handler.d.ts +0 -32
- package/dist/http/index.d.ts +0 -27
- package/dist/http/index.js +0 -870
- package/dist/http/listen-inspection.d.ts +0 -11
- package/dist/http/request-context.d.ts +0 -17
- package/dist/http/responses.d.ts +0 -13
- package/dist/http/serving-layer.d.ts +0 -25
- package/dist/http/user-handler-cache.d.ts +0 -37
- package/dist/http/user-server-event-bus.d.ts +0 -35
- package/dist/index.d.ts +0 -29
- package/dist/index.js +0 -616
- package/dist/localhost-request-validation.d.ts +0 -2
- package/dist/logger.d.ts +0 -59
- package/dist/logger.js +0 -18
- package/dist/long-running-operation-support.d.ts +0 -34
- package/dist/metrics.d.ts +0 -64
- package/dist/metrics.js +0 -6
- package/dist/oauth/authorize-endpoint.d.ts +0 -5
- package/dist/oauth/client-authentication.d.ts +0 -10
- package/dist/oauth/discovery-metadata.d.ts +0 -19
- package/dist/oauth/endpoint-rate-limits.d.ts +0 -10
- package/dist/oauth/endpoint-responses.d.ts +0 -10
- package/dist/oauth/network-identity.d.ts +0 -32
- package/dist/oauth/pkce-validation.d.ts +0 -2
- package/dist/oauth/postgres/client-store.d.ts +0 -12
- package/dist/oauth/postgres/code-store.d.ts +0 -14
- package/dist/oauth/postgres/database.d.ts +0 -59
- package/dist/oauth/postgres/index.d.ts +0 -11
- package/dist/oauth/postgres/index.js +0 -616
- package/dist/oauth/postgres/schema.d.ts +0 -1476
- package/dist/oauth/postgres/token-store.d.ts +0 -16
- package/dist/oauth/postgres/transaction-store.d.ts +0 -14
- package/dist/oauth/redirect-uri-matching.d.ts +0 -2
- package/dist/oauth/registration-endpoint.d.ts +0 -2
- package/dist/oauth/request-body.d.ts +0 -14
- package/dist/oauth/revocation-endpoint.d.ts +0 -2
- package/dist/oauth/scope-utilities.d.ts +0 -15
- package/dist/oauth/stores.d.ts +0 -225
- package/dist/oauth/stores.js +0 -0
- package/dist/oauth/testing/contract-fixtures.d.ts +0 -134
- package/dist/oauth/testing/index.d.ts +0 -56
- package/dist/oauth/testing/index.js +0 -330
- package/dist/oauth/token-endpoint.d.ts +0 -2
- package/dist/oauth-scope-configuration.d.ts +0 -3
- package/dist/prompts/index.d.ts +0 -5
- package/dist/prompts/summarize.d.ts +0 -4
- package/dist/rate-limit/in-memory-sliding-window-store.d.ts +0 -3
- package/dist/rate-limit/index.d.ts +0 -23
- package/dist/rate-limit/index.js +0 -29
- package/dist/rate-limit/mcp-concurrency-limiter.d.ts +0 -26
- package/dist/rate-limit/rate-limit-response.d.ts +0 -1
- package/dist/rate-limit/redis-sliding-window-store.d.ts +0 -2
- package/dist/rate-limit/request-rate-limiter.d.ts +0 -10
- package/dist/rate-limit/sliding-window-rate-limiter.d.ts +0 -16
- package/dist/resources/index.d.ts +0 -4
- package/dist/resources/user-profile.d.ts +0 -1
- package/dist/scope-vocabulary.d.ts +0 -127
- package/dist/scopes.d.ts +0 -49
- package/dist/server.d.ts +0 -113
- package/dist/supported-scopes.d.ts +0 -25
- package/dist/sveltekit-mount-state.d.ts +0 -4
- package/dist/sveltekit-mount.d.ts +0 -43
- package/dist/sveltekit-mount.js +0 -344
- package/dist/template-registry.d.ts +0 -16
- package/dist/tool-response.d.ts +0 -100
- package/dist/tools/get-user-profile.d.ts +0 -8
- package/dist/tools/index.d.ts +0 -16
- package/dist/tools/list-audit-events.d.ts +0 -11
- package/dist/type-assertions.d.ts +0 -1
- package/dist/types/primitives.d.ts +0 -130
- package/dist/ui-extension-support.d.ts +0 -20
- package/dist/version.d.ts +0 -23
- package/dist/version.js +0 -6
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
// src/oauth/testing/index.ts
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
|
-
function hash(value) {
|
|
4
|
-
return createHash("sha256").update(value).digest("hex");
|
|
5
|
-
}
|
|
6
|
-
function cloneDate(date) {
|
|
7
|
-
return new Date(date);
|
|
8
|
-
}
|
|
9
|
-
function cloneTransaction(record) {
|
|
10
|
-
return {
|
|
11
|
-
...record,
|
|
12
|
-
expiresAt: cloneDate(record.expiresAt),
|
|
13
|
-
consumedAt: record.consumedAt && cloneDate(record.consumedAt),
|
|
14
|
-
createdAt: cloneDate(record.createdAt)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function cloneCode(record) {
|
|
18
|
-
return {
|
|
19
|
-
...record,
|
|
20
|
-
expiresAt: cloneDate(record.expiresAt),
|
|
21
|
-
usedAt: record.usedAt && cloneDate(record.usedAt),
|
|
22
|
-
createdAt: cloneDate(record.createdAt)
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function cloneAccessToken(record) {
|
|
26
|
-
return {
|
|
27
|
-
...record,
|
|
28
|
-
expiresAt: cloneDate(record.expiresAt),
|
|
29
|
-
revokedAt: record.revokedAt && cloneDate(record.revokedAt),
|
|
30
|
-
createdAt: cloneDate(record.createdAt)
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function cloneRefreshToken(record) {
|
|
34
|
-
return {
|
|
35
|
-
...record,
|
|
36
|
-
expiresAt: cloneDate(record.expiresAt),
|
|
37
|
-
revokedAt: record.revokedAt && cloneDate(record.revokedAt),
|
|
38
|
-
createdAt: cloneDate(record.createdAt)
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
class InMemoryTransactionStore {
|
|
43
|
-
#records = new Map;
|
|
44
|
-
create(input) {
|
|
45
|
-
const transactionIdHash = hash(input.transactionId);
|
|
46
|
-
this.#records.set(transactionIdHash, {
|
|
47
|
-
record: cloneTransaction({ ...input.record, transactionIdHash }),
|
|
48
|
-
csrfTokenHash: hash(input.csrfToken),
|
|
49
|
-
consentBinding: input.consentBinding
|
|
50
|
-
});
|
|
51
|
-
return Promise.resolve();
|
|
52
|
-
}
|
|
53
|
-
consume(transactionId, csrfToken, binding, subjectId) {
|
|
54
|
-
const entry = this.#records.get(hash(transactionId));
|
|
55
|
-
const now = new Date;
|
|
56
|
-
if (!entry || entry.record.consumedAt || entry.record.expiresAt <= now || entry.csrfTokenHash !== hash(csrfToken) || entry.consentBinding !== binding || entry.record.userId !== subjectId)
|
|
57
|
-
return Promise.resolve(null);
|
|
58
|
-
entry.record.consumedAt = now;
|
|
59
|
-
return Promise.resolve(cloneTransaction(entry.record));
|
|
60
|
-
}
|
|
61
|
-
unconsume(transactionId, consumedAt) {
|
|
62
|
-
const entry = this.#records.get(hash(transactionId));
|
|
63
|
-
if (!entry?.record.consumedAt || entry.record.consumedAt.getTime() !== consumedAt.getTime())
|
|
64
|
-
return Promise.resolve(false);
|
|
65
|
-
entry.record.consumedAt = null;
|
|
66
|
-
return Promise.resolve(true);
|
|
67
|
-
}
|
|
68
|
-
deleteByBinding(value) {
|
|
69
|
-
return Promise.resolve(this.#deleteWhere((entry) => entry.consentBinding === value));
|
|
70
|
-
}
|
|
71
|
-
deleteAllForUser(userId) {
|
|
72
|
-
return Promise.resolve(this.#deleteWhere((entry) => entry.record.userId === userId));
|
|
73
|
-
}
|
|
74
|
-
purgeExpired(now) {
|
|
75
|
-
return Promise.resolve(this.#deleteWhere((entry) => entry.record.expiresAt <= now));
|
|
76
|
-
}
|
|
77
|
-
#deleteWhere(predicate) {
|
|
78
|
-
let deleted = 0;
|
|
79
|
-
for (const [key, entry] of this.#records)
|
|
80
|
-
if (predicate(entry)) {
|
|
81
|
-
this.#records.delete(key);
|
|
82
|
-
deleted += 1;
|
|
83
|
-
}
|
|
84
|
-
return deleted;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
class InMemoryCodeStore {
|
|
89
|
-
#records = new Map;
|
|
90
|
-
issue(record) {
|
|
91
|
-
this.#records.set(record.codeHash, cloneCode(record));
|
|
92
|
-
return Promise.resolve();
|
|
93
|
-
}
|
|
94
|
-
findByHash(codeHash) {
|
|
95
|
-
const record = this.#records.get(codeHash);
|
|
96
|
-
return Promise.resolve(record ? cloneCode(record) : null);
|
|
97
|
-
}
|
|
98
|
-
consume(codeHash, now) {
|
|
99
|
-
const record = this.#records.get(codeHash);
|
|
100
|
-
if (!record || record.usedAt || record.expiresAt <= now)
|
|
101
|
-
return Promise.resolve(null);
|
|
102
|
-
record.usedAt = cloneDate(now);
|
|
103
|
-
return Promise.resolve(cloneCode(record));
|
|
104
|
-
}
|
|
105
|
-
unconsume(codeHash, usedAt) {
|
|
106
|
-
const record = this.#records.get(codeHash);
|
|
107
|
-
if (!record?.usedAt || record.usedAt.getTime() !== usedAt.getTime())
|
|
108
|
-
return Promise.resolve(false);
|
|
109
|
-
record.usedAt = null;
|
|
110
|
-
return Promise.resolve(true);
|
|
111
|
-
}
|
|
112
|
-
deleteAllForUser(userId) {
|
|
113
|
-
return Promise.resolve(this.#deleteWhere((record) => record.userId === userId));
|
|
114
|
-
}
|
|
115
|
-
purgeExpired(now) {
|
|
116
|
-
return Promise.resolve(this.#deleteWhere((record) => record.expiresAt <= now));
|
|
117
|
-
}
|
|
118
|
-
#deleteWhere(predicate) {
|
|
119
|
-
let deleted = 0;
|
|
120
|
-
for (const [key, record] of this.#records)
|
|
121
|
-
if (predicate(record)) {
|
|
122
|
-
this.#records.delete(key);
|
|
123
|
-
deleted += 1;
|
|
124
|
-
}
|
|
125
|
-
return deleted;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
class InMemoryTokenStore {
|
|
130
|
-
#accessTokens = new Map;
|
|
131
|
-
#refreshTokens = new Map;
|
|
132
|
-
issueAuthorizationGrant(input) {
|
|
133
|
-
this.#accessTokens.set(input.accessToken.accessTokenHash, cloneAccessToken(input.accessToken));
|
|
134
|
-
if (input.refreshToken)
|
|
135
|
-
this.#refreshTokens.set(input.refreshToken.refreshTokenHash, cloneRefreshToken(input.refreshToken));
|
|
136
|
-
return Promise.resolve();
|
|
137
|
-
}
|
|
138
|
-
findByHash(tokenHash) {
|
|
139
|
-
const record = this.#accessTokens.get(tokenHash);
|
|
140
|
-
return Promise.resolve(record ? cloneAccessToken(record) : null);
|
|
141
|
-
}
|
|
142
|
-
rotateRefreshToken(input) {
|
|
143
|
-
const prior = this.#refreshTokens.get(input.priorHash);
|
|
144
|
-
if (!prior || prior.clientId !== input.clientId || prior.resource !== input.resource)
|
|
145
|
-
return Promise.resolve({ status: "invalid" });
|
|
146
|
-
if (prior.revokedAt) {
|
|
147
|
-
this.#revokeFamily(prior.familyId, input.createdAt);
|
|
148
|
-
return Promise.resolve({
|
|
149
|
-
status: "replay_revoked",
|
|
150
|
-
userId: prior.userId,
|
|
151
|
-
familyId: prior.familyId
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
if (prior.expiresAt <= input.createdAt)
|
|
155
|
-
return Promise.resolve({ status: "invalid" });
|
|
156
|
-
if (input.requestedScope && !isScopeSubset(input.requestedScope, prior.scope))
|
|
157
|
-
return Promise.resolve({ status: "scope_rejected" });
|
|
158
|
-
prior.revokedAt = cloneDate(input.createdAt);
|
|
159
|
-
const pairedAccessToken = this.#accessTokens.get(prior.accessTokenHash);
|
|
160
|
-
if (pairedAccessToken)
|
|
161
|
-
pairedAccessToken.revokedAt = cloneDate(input.createdAt);
|
|
162
|
-
const scope = input.requestedScope ?? prior.scope;
|
|
163
|
-
const accessToken = {
|
|
164
|
-
accessTokenHash: input.nextAccessTokenHash,
|
|
165
|
-
clientId: prior.clientId,
|
|
166
|
-
userId: prior.userId,
|
|
167
|
-
scope,
|
|
168
|
-
resource: prior.resource,
|
|
169
|
-
expiresAt: cloneDate(input.accessTokenExpiresAt),
|
|
170
|
-
revokedAt: null,
|
|
171
|
-
createdAt: cloneDate(input.createdAt)
|
|
172
|
-
};
|
|
173
|
-
const refreshToken = {
|
|
174
|
-
refreshTokenHash: input.nextRefreshTokenHash,
|
|
175
|
-
clientId: prior.clientId,
|
|
176
|
-
userId: prior.userId,
|
|
177
|
-
scope,
|
|
178
|
-
resource: prior.resource,
|
|
179
|
-
accessTokenHash: accessToken.accessTokenHash,
|
|
180
|
-
familyId: prior.familyId,
|
|
181
|
-
expiresAt: cloneDate(input.refreshTokenExpiresAt),
|
|
182
|
-
revokedAt: null,
|
|
183
|
-
createdAt: cloneDate(input.createdAt)
|
|
184
|
-
};
|
|
185
|
-
this.#accessTokens.set(accessToken.accessTokenHash, accessToken);
|
|
186
|
-
this.#refreshTokens.set(refreshToken.refreshTokenHash, refreshToken);
|
|
187
|
-
return Promise.resolve({
|
|
188
|
-
status: "rotated",
|
|
189
|
-
accessToken: cloneAccessToken(accessToken),
|
|
190
|
-
refreshToken: cloneRefreshToken(refreshToken)
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
revokeAccessToken(tokenHash, clientId) {
|
|
194
|
-
const token = this.#accessTokens.get(tokenHash);
|
|
195
|
-
if (!token || token.clientId !== clientId)
|
|
196
|
-
return Promise.resolve(false);
|
|
197
|
-
const now = new Date;
|
|
198
|
-
token.revokedAt ??= now;
|
|
199
|
-
for (const refresh of this.#refreshTokens.values())
|
|
200
|
-
if (refresh.accessTokenHash === tokenHash)
|
|
201
|
-
refresh.revokedAt ??= now;
|
|
202
|
-
return Promise.resolve(true);
|
|
203
|
-
}
|
|
204
|
-
revokeRefreshToken(tokenHash, clientId) {
|
|
205
|
-
const token = this.#refreshTokens.get(tokenHash);
|
|
206
|
-
if (!token || token.clientId !== clientId)
|
|
207
|
-
return Promise.resolve({ status: "invalid" });
|
|
208
|
-
const now = new Date;
|
|
209
|
-
if (token.revokedAt) {
|
|
210
|
-
this.#revokeFamily(token.familyId, now);
|
|
211
|
-
return Promise.resolve({
|
|
212
|
-
status: "replay_revoked",
|
|
213
|
-
userId: token.userId,
|
|
214
|
-
familyId: token.familyId
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
token.revokedAt = now;
|
|
218
|
-
const access = this.#accessTokens.get(token.accessTokenHash);
|
|
219
|
-
if (access)
|
|
220
|
-
access.revokedAt ??= now;
|
|
221
|
-
return Promise.resolve({ status: "revoked", userId: token.userId, familyId: token.familyId });
|
|
222
|
-
}
|
|
223
|
-
revokeFamily(familyId) {
|
|
224
|
-
return Promise.resolve(this.#revokeFamily(familyId, new Date));
|
|
225
|
-
}
|
|
226
|
-
deleteAllForUser(userId) {
|
|
227
|
-
let deleted = 0;
|
|
228
|
-
for (const [key, token] of this.#accessTokens)
|
|
229
|
-
if (token.userId === userId) {
|
|
230
|
-
this.#accessTokens.delete(key);
|
|
231
|
-
deleted += 1;
|
|
232
|
-
}
|
|
233
|
-
for (const [key, token] of this.#refreshTokens)
|
|
234
|
-
if (token.userId === userId) {
|
|
235
|
-
this.#refreshTokens.delete(key);
|
|
236
|
-
deleted += 1;
|
|
237
|
-
}
|
|
238
|
-
return Promise.resolve(deleted);
|
|
239
|
-
}
|
|
240
|
-
purgeExpired(now) {
|
|
241
|
-
let deleted = 0;
|
|
242
|
-
for (const [key, token] of this.#accessTokens)
|
|
243
|
-
if (token.expiresAt <= now) {
|
|
244
|
-
this.#accessTokens.delete(key);
|
|
245
|
-
deleted += 1;
|
|
246
|
-
}
|
|
247
|
-
for (const [key, token] of this.#refreshTokens)
|
|
248
|
-
if (token.expiresAt <= now) {
|
|
249
|
-
this.#refreshTokens.delete(key);
|
|
250
|
-
deleted += 1;
|
|
251
|
-
}
|
|
252
|
-
return Promise.resolve(deleted);
|
|
253
|
-
}
|
|
254
|
-
#revokeFamily(familyId, now) {
|
|
255
|
-
let revoked = 0;
|
|
256
|
-
const accessHashes = new Set;
|
|
257
|
-
for (const token of this.#refreshTokens.values())
|
|
258
|
-
if (token.familyId === familyId) {
|
|
259
|
-
if (!token.revokedAt) {
|
|
260
|
-
token.revokedAt = cloneDate(now);
|
|
261
|
-
revoked += 1;
|
|
262
|
-
}
|
|
263
|
-
accessHashes.add(token.accessTokenHash);
|
|
264
|
-
}
|
|
265
|
-
for (const hash2 of accessHashes) {
|
|
266
|
-
const token = this.#accessTokens.get(hash2);
|
|
267
|
-
if (token && !token.revokedAt) {
|
|
268
|
-
token.revokedAt = cloneDate(now);
|
|
269
|
-
revoked += 1;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return revoked;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
function isScopeSubset(requested, granted) {
|
|
276
|
-
const grantedScopes = new Set((granted ?? "").split(/\s+/).filter(Boolean));
|
|
277
|
-
return requested.split(/\s+/).filter(Boolean).every((scope) => grantedScopes.has(scope));
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
class InMemoryClientStore {
|
|
281
|
-
#records = new Map;
|
|
282
|
-
register(record) {
|
|
283
|
-
if (this.#records.has(record.clientId))
|
|
284
|
-
return Promise.reject(new Error(`Client already registered: ${record.clientId}`));
|
|
285
|
-
this.#records.set(record.clientId, structuredClone(record));
|
|
286
|
-
return Promise.resolve();
|
|
287
|
-
}
|
|
288
|
-
upsert(record) {
|
|
289
|
-
this.#records.set(record.clientId, structuredClone(record));
|
|
290
|
-
return Promise.resolve();
|
|
291
|
-
}
|
|
292
|
-
findById(clientId) {
|
|
293
|
-
const record = this.#records.get(clientId);
|
|
294
|
-
return Promise.resolve(record ? structuredClone(record) : null);
|
|
295
|
-
}
|
|
296
|
-
update(clientId, patch) {
|
|
297
|
-
const record = this.#records.get(clientId);
|
|
298
|
-
if (!record)
|
|
299
|
-
return Promise.resolve();
|
|
300
|
-
this.#records.set(clientId, structuredClone({ ...record, ...patch, clientId }));
|
|
301
|
-
return Promise.resolve();
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
function createInMemoryOAuthStores() {
|
|
305
|
-
const transactions = new InMemoryTransactionStore;
|
|
306
|
-
const codes = new InMemoryCodeStore;
|
|
307
|
-
const tokens = new InMemoryTokenStore;
|
|
308
|
-
const clients = new InMemoryClientStore;
|
|
309
|
-
return {
|
|
310
|
-
transactions,
|
|
311
|
-
codes,
|
|
312
|
-
tokens,
|
|
313
|
-
clients,
|
|
314
|
-
async deleteAllForUser(userId) {
|
|
315
|
-
const [transactionCount, codeCount, tokenCount] = await Promise.all([
|
|
316
|
-
transactions.deleteAllForUser(userId),
|
|
317
|
-
codes.deleteAllForUser(userId),
|
|
318
|
-
tokens.deleteAllForUser(userId)
|
|
319
|
-
]);
|
|
320
|
-
return { transactions: transactionCount, codes: codeCount, tokens: tokenCount };
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
export {
|
|
325
|
-
InMemoryClientStore,
|
|
326
|
-
InMemoryCodeStore,
|
|
327
|
-
InMemoryTokenStore,
|
|
328
|
-
InMemoryTransactionStore,
|
|
329
|
-
createInMemoryOAuthStores
|
|
330
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { OAuthScopeConfiguration } from './oauth/index.js';
|
|
2
|
-
/** Binds an OAuth supported-scope subset to its vocabulary. */
|
|
3
|
-
export declare function defineOAuthScopeConfiguration<Scope extends string>(configuration: OAuthScopeConfiguration<Scope>): OAuthScopeConfiguration<Scope>;
|
package/dist/prompts/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
import type { McpPromptDefinition } from '../types/primitives.js';
|
|
3
|
-
import type { McpScope } from '../scopes.js';
|
|
4
|
-
export { summarizePrompt } from './summarize.js';
|
|
5
|
-
export declare const allPrompts: McpPromptDefinition<Record<string, z.ZodType> | undefined, McpScope>[];
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as inMemoryStoreModule from './in-memory-sliding-window-store.js';
|
|
2
|
-
import * as concurrencyModule from './mcp-concurrency-limiter.js';
|
|
3
|
-
import * as responseModule from './rate-limit-response.js';
|
|
4
|
-
import * as redisStoreModule from './redis-sliding-window-store.js';
|
|
5
|
-
import * as requestLimiterModule from './request-rate-limiter.js';
|
|
6
|
-
import * as slidingWindowModule from './sliding-window-rate-limiter.js';
|
|
7
|
-
export declare const attachConcurrencySlotToResponseLifetime: typeof concurrencyModule.attachConcurrencySlotToResponseLifetime;
|
|
8
|
-
export declare const createInMemoryConcurrencySlotStore: typeof concurrencyModule.createInMemoryConcurrencySlotStore;
|
|
9
|
-
export declare const createInMemorySlidingWindowStore: typeof inMemoryStoreModule.createInMemorySlidingWindowStore;
|
|
10
|
-
export declare const createRateLimitedResponse: typeof responseModule.createRateLimitedResponse;
|
|
11
|
-
export declare const createRedisConcurrencySlotStore: typeof concurrencyModule.createRedisConcurrencySlotStore;
|
|
12
|
-
export declare const createRedisSlidingWindowStore: typeof redisStoreModule.createRedisSlidingWindowStore;
|
|
13
|
-
export declare const DEFAULT_CONCURRENCY_SLOT_RENEWAL_INTERVAL_MILLISECONDS = 20000;
|
|
14
|
-
export declare const DEFAULT_CONCURRENCY_SLOT_TTL_MILLISECONDS = 60000;
|
|
15
|
-
export declare const inMemorySlidingWindowStore: import("../oauth/index.js").AtomicSlidingWindowStore;
|
|
16
|
-
export declare const McpConcurrencyLimiter: typeof concurrencyModule.McpConcurrencyLimiter;
|
|
17
|
-
export declare const RequestRateLimiter: typeof requestLimiterModule.RequestRateLimiter;
|
|
18
|
-
export declare const SlidingWindowRateLimiter: typeof slidingWindowModule.SlidingWindowRateLimiter;
|
|
19
|
-
export type McpConcurrencyLimiter = InstanceType<typeof concurrencyModule.McpConcurrencyLimiter>;
|
|
20
|
-
export type RequestRateLimiter = InstanceType<typeof requestLimiterModule.RequestRateLimiter>;
|
|
21
|
-
export type SlidingWindowRateLimiter = InstanceType<typeof slidingWindowModule.SlidingWindowRateLimiter>;
|
|
22
|
-
export type { McpConcurrencySlot } from './mcp-concurrency-limiter.js';
|
|
23
|
-
export type { AtomicSlidingWindowStore, ConcurrencySlot, ConcurrencySlotStore, MinimalRedisClient, OAuthRateLimitCategory, RateLimitCategoryConfiguration, RateLimitConfiguration, SlidingWindowRateLimiterResult, } from '../oauth/index.js';
|
package/dist/rate-limit/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_CONCURRENCY_SLOT_RENEWAL_INTERVAL_MILLISECONDS,
|
|
3
|
-
DEFAULT_CONCURRENCY_SLOT_TTL_MILLISECONDS,
|
|
4
|
-
McpConcurrencyLimiter,
|
|
5
|
-
RequestRateLimiter,
|
|
6
|
-
SlidingWindowRateLimiter,
|
|
7
|
-
attachConcurrencySlotToResponseLifetime,
|
|
8
|
-
createInMemoryConcurrencySlotStore,
|
|
9
|
-
createInMemorySlidingWindowStore,
|
|
10
|
-
createRateLimitedResponse,
|
|
11
|
-
createRedisConcurrencySlotStore,
|
|
12
|
-
createRedisSlidingWindowStore,
|
|
13
|
-
inMemorySlidingWindowStore
|
|
14
|
-
} from "../chunk-6ekjtvcq.js";
|
|
15
|
-
import"../chunk-3ek3knfm.js";
|
|
16
|
-
export {
|
|
17
|
-
DEFAULT_CONCURRENCY_SLOT_RENEWAL_INTERVAL_MILLISECONDS,
|
|
18
|
-
DEFAULT_CONCURRENCY_SLOT_TTL_MILLISECONDS,
|
|
19
|
-
McpConcurrencyLimiter,
|
|
20
|
-
RequestRateLimiter,
|
|
21
|
-
SlidingWindowRateLimiter,
|
|
22
|
-
attachConcurrencySlotToResponseLifetime,
|
|
23
|
-
createInMemoryConcurrencySlotStore,
|
|
24
|
-
createInMemorySlidingWindowStore,
|
|
25
|
-
createRateLimitedResponse,
|
|
26
|
-
createRedisConcurrencySlotStore,
|
|
27
|
-
createRedisSlidingWindowStore,
|
|
28
|
-
inMemorySlidingWindowStore
|
|
29
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ConcurrencySlotStore, MinimalRedisClient } from '../oauth/index.js';
|
|
2
|
-
export declare const DEFAULT_CONCURRENCY_SLOT_TTL_MILLISECONDS = 60000;
|
|
3
|
-
export declare const DEFAULT_CONCURRENCY_SLOT_RENEWAL_INTERVAL_MILLISECONDS = 20000;
|
|
4
|
-
export declare function createRedisConcurrencySlotStore(redisClient: MinimalRedisClient, providers?: {
|
|
5
|
-
now?: () => number;
|
|
6
|
-
createId?: () => string;
|
|
7
|
-
}): ConcurrencySlotStore;
|
|
8
|
-
export declare function createInMemoryConcurrencySlotStore(): ConcurrencySlotStore;
|
|
9
|
-
export type McpConcurrencySlot = {
|
|
10
|
-
allowed: boolean;
|
|
11
|
-
/** Renewal cadence derived from the acquired slot's TTL. */
|
|
12
|
-
renewalIntervalMilliseconds: number;
|
|
13
|
-
release(): Promise<void>;
|
|
14
|
-
renew(): Promise<void>;
|
|
15
|
-
};
|
|
16
|
-
export declare class McpConcurrencyLimiter {
|
|
17
|
-
private readonly store;
|
|
18
|
-
private readonly maximumConcurrent;
|
|
19
|
-
private readonly ttlMilliseconds;
|
|
20
|
-
private readonly onStoreError;
|
|
21
|
-
constructor(store: ConcurrencySlotStore, maximumConcurrent: number, ttlMilliseconds?: number, onStoreError?: (error: unknown, operation: 'release' | 'renew') => void);
|
|
22
|
-
acquire(key: string): Promise<McpConcurrencySlot>;
|
|
23
|
-
}
|
|
24
|
-
export declare function attachConcurrencySlotToResponseLifetime(response: Response, slot: Omit<McpConcurrencySlot, 'renewalIntervalMilliseconds'> & {
|
|
25
|
-
renewalIntervalMilliseconds?: number;
|
|
26
|
-
}, renewalIntervalMilliseconds?: number): Response;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function createRateLimitedResponse(retryAfterSeconds: number, headers?: Record<string, string>): Response;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AtomicSlidingWindowStore, OAuthRateLimitCategory, RateLimitConfiguration, SlidingWindowRateLimiterResult } from '../oauth/index.js';
|
|
2
|
-
export declare class RequestRateLimiter {
|
|
3
|
-
#private;
|
|
4
|
-
private readonly configuration;
|
|
5
|
-
private readonly storeProvider;
|
|
6
|
-
constructor(configuration: RateLimitConfiguration, storeProvider: () => AtomicSlidingWindowStore | Promise<AtomicSlidingWindowStore>, nowProvider?: () => number);
|
|
7
|
-
consume(category: OAuthRateLimitCategory, identifier: string): Promise<SlidingWindowRateLimiterResult>;
|
|
8
|
-
peek(category: OAuthRateLimitCategory, identifier: string): Promise<number>;
|
|
9
|
-
private buildKey;
|
|
10
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AtomicSlidingWindowStore, SlidingWindowRateLimiterResult } from '../oauth/index.js';
|
|
2
|
-
export declare class SlidingWindowRateLimiter {
|
|
3
|
-
private readonly nowProvider;
|
|
4
|
-
constructor(nowProvider?: () => number);
|
|
5
|
-
consume(input: {
|
|
6
|
-
key: string;
|
|
7
|
-
maximumRequests: number;
|
|
8
|
-
windowSeconds: number;
|
|
9
|
-
atomicStore: AtomicSlidingWindowStore;
|
|
10
|
-
}): Promise<SlidingWindowRateLimiterResult>;
|
|
11
|
-
peek(input: {
|
|
12
|
-
key: string;
|
|
13
|
-
windowSeconds: number;
|
|
14
|
-
atomicStore: AtomicSlidingWindowStore;
|
|
15
|
-
}): Promise<number>;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const userProfileResource: import("../index.js").McpResourceDefinition<"profile:read" | "audit:read" | "prompts:read">;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
import type { McpPromptDefinition, McpResourceDefinition, McpToolDefinition } from './types/primitives.js';
|
|
3
|
-
/**
|
|
4
|
-
* AUTHZ-001: a consumer's OAuth scope vocabulary, closed per consumer rather
|
|
5
|
-
* than closed to one set globally. The properties the original fixed
|
|
6
|
-
* vocabulary carried are the ones that have to survive being opened:
|
|
7
|
-
*
|
|
8
|
-
* - Every primitive declares **exactly one** scope from this set. Opening the
|
|
9
|
-
* vocabulary must not open that, so `requiredScope` stays a single value of
|
|
10
|
-
* `Scope` — never an array, never optional.
|
|
11
|
-
* - There is no generic all-access scope, and none can be expressed. The
|
|
12
|
-
* authorization check is exact membership (`grantedScopes.includes(...)`),
|
|
13
|
-
* so a token granted `'*'` authorizes nothing. Widening happens only on the
|
|
14
|
-
* declaration side; the granted side stays `readonly string[]`.
|
|
15
|
-
* - Conformance-only scopes are excluded from `getSupportedScopes()`
|
|
16
|
-
* structurally, by walking the production registries alone, not by a second
|
|
17
|
-
* exclusion list somebody has to remember to update.
|
|
18
|
-
*/
|
|
19
|
-
export type McpScopeVocabulary<Scope extends string> = {
|
|
20
|
-
/** Every scope in the vocabulary, in declaration order. */
|
|
21
|
-
readonly scopes: readonly Scope[];
|
|
22
|
-
/** Consent-screen text, shown verbatim on the authorize page. */
|
|
23
|
-
readonly descriptions: Readonly<Record<Scope, string>>;
|
|
24
|
-
/** Narrowing check against this vocabulary rather than a fixed list. */
|
|
25
|
-
isScope(value: string): value is Scope;
|
|
26
|
-
/**
|
|
27
|
-
* Definers bound to this vocabulary. Using these rather than the bare
|
|
28
|
-
* ones from `types/primitives.js` is what puts a mistyped scope on the
|
|
29
|
-
* primitive's own line: an unbound `defineTool` infers `Scope` from
|
|
30
|
-
* whatever literal it is given, so `'reposotories:read'` type-checks
|
|
31
|
-
* there and only fails later at registry assignment, far from the
|
|
32
|
-
* mistake. Same reasoning as `META-001` requiring `title` and
|
|
33
|
-
* `annotations` — a compile error on the file you are editing beats one
|
|
34
|
-
* a reviewer has to trace.
|
|
35
|
-
*/
|
|
36
|
-
defineTool<InputSchema extends z.ZodType, OutputSchema extends z.ZodType | undefined = undefined>(definition: McpToolDefinition<InputSchema, OutputSchema, Scope>): McpToolDefinition<InputSchema, OutputSchema, Scope>;
|
|
37
|
-
defineResource(definition: McpResourceDefinition<Scope>): McpResourceDefinition<Scope>;
|
|
38
|
-
definePrompt<Arguments extends Record<string, z.ZodType> | undefined>(definition: McpPromptDefinition<Arguments, Scope>): McpPromptDefinition<Arguments, Scope>;
|
|
39
|
-
/**
|
|
40
|
-
* Builds a registry pinned to this vocabulary.
|
|
41
|
-
*
|
|
42
|
-
* Use this rather than writing an object literal and letting `McpRegistry`
|
|
43
|
-
* default `Scope` to `string`. An inferred registry accepts a primitive
|
|
44
|
-
* from an unbound definer or from a *different* vocabulary with no type
|
|
45
|
-
* error, and `getSupportedScopes()` then advertises a scope this
|
|
46
|
-
* vocabulary has no description for and whose `isScope()` returns false —
|
|
47
|
-
* so the authorization layer cannot issue the scope the served primitive
|
|
48
|
-
* requires. Annotating the registry by hand also prevents that, but only
|
|
49
|
-
* if the author remembers to; this makes the binding the default path.
|
|
50
|
-
*/
|
|
51
|
-
defineRegistry(registry: McpRegistry<Scope>): McpRegistry<Scope>;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* The scope names a descriptions object actually yields at runtime.
|
|
55
|
-
*
|
|
56
|
-
* `Object.keys()` stringifies every key, so `{ 123: '...' }` produces the
|
|
57
|
-
* scope `'123'`. Taking only `Extract<keyof D, string>` would discard that
|
|
58
|
-
* numeric literal and type the vocabulary as `McpScopeVocabulary<never>` —
|
|
59
|
-
* its bound definers would reject `requiredScope: '123'` even though
|
|
60
|
-
* `isScope('123')` returns true at runtime. Templating the numeric keys back
|
|
61
|
-
* to strings keeps the type and the runtime describing the same set.
|
|
62
|
-
*/
|
|
63
|
-
type ScopeOf<Descriptions> = Extract<keyof Descriptions, string> | `${Extract<keyof Descriptions, number>}`;
|
|
64
|
-
export declare function defineScopes<const Descriptions extends Record<string, string> & {
|
|
65
|
-
/**
|
|
66
|
-
* `__proto__` cannot be a scope name, and this rejects it where it is
|
|
67
|
-
* written rather than letting it vanish. In an object literal the key
|
|
68
|
-
* is special: it never becomes an own property, so `Object.keys()`
|
|
69
|
-
* would return nothing while TypeScript still infers it as a member of
|
|
70
|
-
* `Scope`. The bound definers would then accept primitives requiring a
|
|
71
|
-
* scope that `scopes` omits and `isScope()` rejects — unauthorizable,
|
|
72
|
-
* with no error anywhere. No runtime read can recover the key, so the
|
|
73
|
-
* type is the only place this can be caught.
|
|
74
|
-
*/
|
|
75
|
-
__proto__?: never;
|
|
76
|
-
}>(descriptions: Descriptions): McpScopeVocabulary<ScopeOf<Descriptions>>;
|
|
77
|
-
/**
|
|
78
|
-
* The primitives a server serves, supplied by whoever is building it.
|
|
79
|
-
*
|
|
80
|
-
* `conformanceOnlyTools` is separate rather than a flag on a tool because the
|
|
81
|
-
* separation is what `getSupportedScopes()` reads: it walks the production
|
|
82
|
-
* three and never this one, so a scope declared only by a conformance fixture
|
|
83
|
-
* cannot reach a real OAuth client. Collapsing them into one list with a
|
|
84
|
-
* boolean would move that guarantee from the shape of the data into a filter
|
|
85
|
-
* somebody can forget.
|
|
86
|
-
*
|
|
87
|
-
* Note there is no conformance-only slot for resources or prompts, and that
|
|
88
|
-
* is not an oversight: the protocol conformance fixtures registered by
|
|
89
|
-
* `registerConformanceFixtures()` are imperative and declare no
|
|
90
|
-
* `requiredScope`, so they never participate in the scope vocabulary at all.
|
|
91
|
-
*/
|
|
92
|
-
export type McpRegistry<Scope extends string = string> = {
|
|
93
|
-
/**
|
|
94
|
-
* Natural-language server instructions, handed to the MCP client and fed
|
|
95
|
-
* straight to a model. Optional only so this repository's own registry can
|
|
96
|
-
* keep using the bundled `instructions.md`; **a consumer should always set
|
|
97
|
-
* it.**
|
|
98
|
-
*
|
|
99
|
-
* Serving one registry's instructions alongside another's primitives is
|
|
100
|
-
* worse than unhelpful. The bundled text names `get_user_profile`,
|
|
101
|
-
* `user://profile`, and `summarize`, points at this template's OAuth
|
|
102
|
-
* endpoints, and states that no operation is destructive. A consumer that
|
|
103
|
-
* inherits it hands a model a description of tools that do not exist — and,
|
|
104
|
-
* far more seriously, an assurance that its own mutating tools are
|
|
105
|
-
* read-only.
|
|
106
|
-
*/
|
|
107
|
-
readonly instructions?: string;
|
|
108
|
-
/**
|
|
109
|
-
* The implementation identity reported in the `initialize` response.
|
|
110
|
-
*
|
|
111
|
-
* Optional only so this repository's own registry keeps deriving its name
|
|
112
|
-
* from `MCP_SERVER_NAME`; **a consumer should always set it.** Without it a
|
|
113
|
-
* consumer's server reports this package's name and version, so clients and
|
|
114
|
-
* operators misattribute it in diagnostics, and any client behaviour keyed
|
|
115
|
-
* to `serverInfo` — compatibility shims, version gates — reads the wrong
|
|
116
|
-
* implementation entirely.
|
|
117
|
-
*/
|
|
118
|
-
readonly serverInfo?: {
|
|
119
|
-
readonly name: string;
|
|
120
|
-
readonly version: string;
|
|
121
|
-
};
|
|
122
|
-
readonly tools: readonly McpToolDefinition<z.ZodType, z.ZodType | undefined, Scope>[];
|
|
123
|
-
readonly resources: readonly McpResourceDefinition<Scope>[];
|
|
124
|
-
readonly prompts: readonly McpPromptDefinition<Record<string, z.ZodType> | undefined, Scope>[];
|
|
125
|
-
readonly conformanceOnlyTools?: readonly McpToolDefinition<z.ZodType, z.ZodType | undefined, Scope>[];
|
|
126
|
-
};
|
|
127
|
-
export {};
|
package/dist/scopes.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AUTHZ-001: this server's own OAuth scope vocabulary. It is now one
|
|
3
|
-
* vocabulary among possibly several — `scope-vocabulary.ts` holds the
|
|
4
|
-
* mechanism, and records which properties had to survive being opened to
|
|
5
|
-
* consumers — but the reasoning behind these three is unchanged.
|
|
6
|
-
*
|
|
7
|
-
* The set is deliberately small and drawn straight from what the production
|
|
8
|
-
* registries actually do; a "generic all-access scope" is exactly what the
|
|
9
|
-
* roadmap says not to build. Every tool, resource, and prompt declares a
|
|
10
|
-
* `requiredScope` from this set (`McpToolDefinition`/`McpResourceDefinition`/
|
|
11
|
-
* `McpPromptDefinition` in `types/primitives.ts`), which is what turns "a
|
|
12
|
-
* scope exists" into "every operation is gated by one."
|
|
13
|
-
*
|
|
14
|
-
* `audit:read` gates `list_audit_events`, a conformance-only fixture
|
|
15
|
-
* (`CONTENT-001`/`META-001`) that is never registered in a production
|
|
16
|
-
* deployment. It stays in the vocabulary — the tool still needs a real
|
|
17
|
-
* `requiredScope` to satisfy the metadata contract and to be enforceable at
|
|
18
|
-
* all when conformance mode is on — but `getSupportedScopes()` deliberately
|
|
19
|
-
* excludes it from what a real OAuth client can ever request or see
|
|
20
|
-
* advertised, because advertising a scope that only unlocks a fixture no
|
|
21
|
-
* production deployment serves is exactly the "claims a capability it does
|
|
22
|
-
* not implement" overclaiming this branch (`S-20`) exists to remove.
|
|
23
|
-
*
|
|
24
|
-
* The strings below are the consent-screen-facing descriptions, shown
|
|
25
|
-
* verbatim on the authorize page so "the exact requested scopes" (the
|
|
26
|
-
* roadmap's own phrase) is something a user can read rather than a raw
|
|
27
|
-
* token. They are also what *declares* the vocabulary — a scope with no
|
|
28
|
-
* description cannot be written here at all.
|
|
29
|
-
*/
|
|
30
|
-
export declare const templateScopeVocabulary: import("./scope-vocabulary.js").McpScopeVocabulary<"profile:read" | "audit:read" | "prompts:read">;
|
|
31
|
-
export type McpScope = (typeof templateScopeVocabulary.scopes)[number];
|
|
32
|
-
/**
|
|
33
|
-
* The three exports below keep the exact shape every existing caller already
|
|
34
|
-
* imports — `applications/web`'s authorize page renders
|
|
35
|
-
* `mcpScopeDescriptions`, the OAuth scope configuration narrows with its injected vocabulary, and
|
|
36
|
-
* `request-limits.ts` sizes a bound against `mcpScopes`. Opening the
|
|
37
|
-
* vocabulary changed how these are derived, not what they are.
|
|
38
|
-
*/
|
|
39
|
-
export declare const mcpScopes: readonly McpScope[];
|
|
40
|
-
export declare const mcpScopeDescriptions: Readonly<Record<McpScope, string>>;
|
|
41
|
-
export declare function isMcpScope(value: string): value is McpScope;
|
|
42
|
-
/**
|
|
43
|
-
* Definers bound to this server's own vocabulary. The primitive files import
|
|
44
|
-
* these rather than the unbound helpers in `types/primitives.js`, so a
|
|
45
|
-
* mistyped scope fails on the primitive's own line — the same protection a
|
|
46
|
-
* consumer gets from its own `defineScopes()` call, and the same philosophy
|
|
47
|
-
* as `META-001` requiring `title` and `annotations` up front.
|
|
48
|
-
*/
|
|
49
|
-
export declare const defineTool: <InputSchema extends import("zod").ZodType, OutputSchema extends import("zod").ZodType | undefined = undefined>(definition: import("./index.js").McpToolDefinition<InputSchema, OutputSchema, "profile:read" | "audit:read" | "prompts:read">) => import("./index.js").McpToolDefinition<InputSchema, OutputSchema, "profile:read" | "audit:read" | "prompts:read">, defineResource: (definition: import("./index.js").McpResourceDefinition<"profile:read" | "audit:read" | "prompts:read">) => import("./index.js").McpResourceDefinition<"profile:read" | "audit:read" | "prompts:read">, definePrompt: <Arguments extends Record<string, import("zod").ZodType> | undefined>(definition: import("./index.js").McpPromptDefinition<Arguments, "profile:read" | "audit:read" | "prompts:read">) => import("./index.js").McpPromptDefinition<Arguments, "profile:read" | "audit:read" | "prompts:read">;
|