@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
package/dist/chunk-k6fm3cmk.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getEnvironment
|
|
3
|
-
} from "./chunk-3rr24vhh.js";
|
|
4
|
-
|
|
5
|
-
// src/logger.ts
|
|
6
|
-
import { createRequire } from "node:module";
|
|
7
|
-
import pino from "pino";
|
|
8
|
-
var redactionPaths = [
|
|
9
|
-
"authorization",
|
|
10
|
-
"cookie",
|
|
11
|
-
'["set-cookie"]',
|
|
12
|
-
"token",
|
|
13
|
-
"access_token",
|
|
14
|
-
"refresh_token",
|
|
15
|
-
"id_token",
|
|
16
|
-
"code",
|
|
17
|
-
"code_verifier",
|
|
18
|
-
"code_challenge",
|
|
19
|
-
"client_secret",
|
|
20
|
-
"password",
|
|
21
|
-
"state",
|
|
22
|
-
"topic",
|
|
23
|
-
"email",
|
|
24
|
-
"DATABASE_URL",
|
|
25
|
-
"REDIS_URL",
|
|
26
|
-
"databaseUrl",
|
|
27
|
-
"redisUrl",
|
|
28
|
-
"query",
|
|
29
|
-
"body",
|
|
30
|
-
"formData",
|
|
31
|
-
"headers.authorization",
|
|
32
|
-
"headers.cookie",
|
|
33
|
-
"*.authorization",
|
|
34
|
-
"*.cookie",
|
|
35
|
-
'*["set-cookie"]',
|
|
36
|
-
"*.token",
|
|
37
|
-
"*.access_token",
|
|
38
|
-
"*.refresh_token",
|
|
39
|
-
"*.id_token",
|
|
40
|
-
"*.code",
|
|
41
|
-
"*.code_verifier",
|
|
42
|
-
"*.code_challenge",
|
|
43
|
-
"*.client_secret",
|
|
44
|
-
"*.password",
|
|
45
|
-
"*.state",
|
|
46
|
-
"*.topic",
|
|
47
|
-
"*.email",
|
|
48
|
-
"*.DATABASE_URL",
|
|
49
|
-
"*.REDIS_URL",
|
|
50
|
-
"*.databaseUrl",
|
|
51
|
-
"*.redisUrl",
|
|
52
|
-
"*.query",
|
|
53
|
-
"*.body",
|
|
54
|
-
"*.formData",
|
|
55
|
-
"*.headers.authorization",
|
|
56
|
-
"*.headers.cookie"
|
|
57
|
-
];
|
|
58
|
-
var SECRET_VALUE_PATTERNS = [
|
|
59
|
-
/Bearer\s+[A-Za-z0-9\-._~+/]+=*/gi,
|
|
60
|
-
/eyJ[\w-]{5,}\.[\w-]{5,}\.[\w-]*/g,
|
|
61
|
-
/(?:postgres(?:ql)?|rediss?):\/\/[^:@/\s"]+:[^@/\s"]+@[^\s"]+/gi
|
|
62
|
-
];
|
|
63
|
-
function redactSecretValues(serialized) {
|
|
64
|
-
let result = serialized;
|
|
65
|
-
for (const pattern of SECRET_VALUE_PATTERNS) {
|
|
66
|
-
result = result.replace(pattern, "[REDACTED]");
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
function createLogger(options) {
|
|
71
|
-
const environment = getEnvironment();
|
|
72
|
-
const baseOptions = {
|
|
73
|
-
level: environment.LOG_LEVEL,
|
|
74
|
-
redact: { paths: [...redactionPaths], censor: "[REDACTED]" },
|
|
75
|
-
hooks: { streamWrite: redactSecretValues }
|
|
76
|
-
};
|
|
77
|
-
if (options?.destination) {
|
|
78
|
-
return pino(baseOptions, options.destination);
|
|
79
|
-
}
|
|
80
|
-
const prettyTransportAvailable = environment.NODE_ENV !== "production" && canResolvePrettyTransport();
|
|
81
|
-
const useWorkerTransport = prettyTransportAvailable && environment.NODE_ENV !== "test";
|
|
82
|
-
return pino({
|
|
83
|
-
...baseOptions,
|
|
84
|
-
...useWorkerTransport && { transport: { target: "pino-pretty" } }
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function canResolvePrettyTransport() {
|
|
88
|
-
try {
|
|
89
|
-
createRequire(import.meta.url).resolve("pino-pretty");
|
|
90
|
-
return true;
|
|
91
|
-
} catch {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
var cachedLogger;
|
|
96
|
-
var hostLogger;
|
|
97
|
-
function setLogger(nextLogger) {
|
|
98
|
-
hostLogger = nextLogger;
|
|
99
|
-
}
|
|
100
|
-
function getLogger() {
|
|
101
|
-
cachedLogger ??= createLogger();
|
|
102
|
-
return cachedLogger;
|
|
103
|
-
}
|
|
104
|
-
function getEngineLogger() {
|
|
105
|
-
return hostLogger ?? getLogger();
|
|
106
|
-
}
|
|
107
|
-
var engineLogger = {
|
|
108
|
-
info(bindingsOrMessage, message) {
|
|
109
|
-
getEngineLogger().info(bindingsOrMessage, message);
|
|
110
|
-
},
|
|
111
|
-
warn(bindingsOrMessage, message) {
|
|
112
|
-
getEngineLogger().warn(bindingsOrMessage, message);
|
|
113
|
-
},
|
|
114
|
-
error(bindingsOrMessage, message) {
|
|
115
|
-
getEngineLogger().error(bindingsOrMessage, message);
|
|
116
|
-
},
|
|
117
|
-
child(bindings) {
|
|
118
|
-
return getEngineLogger().child(bindings);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
var logger = new Proxy({}, {
|
|
122
|
-
get(_target, property, receiver) {
|
|
123
|
-
const real = getLogger();
|
|
124
|
-
return Reflect.get(real, property, receiver === logger ? real : receiver);
|
|
125
|
-
},
|
|
126
|
-
set(_target, property, value, receiver) {
|
|
127
|
-
const real = getLogger();
|
|
128
|
-
return Reflect.set(real, property, value, receiver === logger ? real : receiver);
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
export { redactionPaths, createLogger, setLogger, getLogger, engineLogger, logger };
|