@kya-os/mcp-i 0.1.0 → 1.2.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 +406 -71
- package/dist/149.js +1 -0
- package/dist/189.js +1 -0
- package/dist/261.js +1 -0
- package/dist/28.js +1 -0
- package/dist/295.js +1 -0
- package/dist/460.js +1 -0
- package/dist/570.js +1 -0
- package/dist/634.js +1 -0
- package/dist/647.js +1 -0
- package/dist/67.js +1 -0
- package/dist/739.js +1 -0
- package/dist/742.js +1 -0
- package/dist/904.js +1 -0
- package/dist/938.js +1 -0
- package/dist/auth/api-key.d.ts +16 -0
- package/dist/auth/api-key.js +82 -0
- package/dist/auth/jwt.d.ts +43 -0
- package/dist/auth/jwt.js +51 -0
- package/dist/auth/oauth/factory.d.ts +12 -0
- package/dist/auth/oauth/factory.js +36 -0
- package/dist/auth/oauth/index.d.ts +5 -0
- package/dist/auth/oauth/index.js +27 -0
- package/dist/auth/oauth/providers/proxy-provider.d.ts +13 -0
- package/dist/auth/oauth/providers/proxy-provider.js +159 -0
- package/dist/auth/oauth/router.d.ts +4 -0
- package/dist/auth/oauth/router.js +294 -0
- package/dist/auth/oauth/storage/memory-storage.d.ts +12 -0
- package/dist/auth/oauth/storage/memory-storage.js +40 -0
- package/dist/auth/oauth/types.d.ts +112 -0
- package/dist/auth/oauth/types.js +2 -0
- package/dist/cache/__tests__/cloudflare-kv-nonce-cache.test.d.ts +4 -0
- package/dist/cache/__tests__/cloudflare-kv-nonce-cache.test.js +176 -0
- package/dist/cache/__tests__/concurrency.test.d.ts +5 -0
- package/dist/cache/__tests__/concurrency.test.js +300 -0
- package/dist/cache/__tests__/dynamodb-nonce-cache.test.d.ts +4 -0
- package/dist/cache/__tests__/dynamodb-nonce-cache.test.js +176 -0
- package/dist/cache/__tests__/memory-nonce-cache.test.d.ts +4 -0
- package/dist/cache/__tests__/memory-nonce-cache.test.js +132 -0
- package/dist/cache/__tests__/nonce-cache-factory-simple.test.d.ts +4 -0
- package/dist/cache/__tests__/nonce-cache-factory-simple.test.js +133 -0
- package/dist/cache/__tests__/nonce-cache-factory.test.d.ts +4 -0
- package/dist/cache/__tests__/nonce-cache-factory.test.js +252 -0
- package/dist/cache/__tests__/redis-nonce-cache.test.d.ts +4 -0
- package/dist/cache/__tests__/redis-nonce-cache.test.js +95 -0
- package/dist/cache/cloudflare-kv-nonce-cache.d.ts +14 -0
- package/dist/cache/cloudflare-kv-nonce-cache.js +93 -0
- package/dist/cache/dynamodb-nonce-cache.d.ts +15 -0
- package/dist/cache/dynamodb-nonce-cache.js +92 -0
- package/dist/cache/index.d.ts +16 -0
- package/dist/cache/index.js +32 -0
- package/dist/cache/memory-nonce-cache.d.ts +44 -0
- package/dist/cache/memory-nonce-cache.js +105 -0
- package/dist/cache/nonce-cache-factory.d.ts +20 -0
- package/dist/cache/nonce-cache-factory.js +208 -0
- package/dist/cache/redis-nonce-cache.d.ts +14 -0
- package/dist/cache/redis-nonce-cache.js +53 -0
- package/dist/compiler/compiler-context.d.ts +23 -0
- package/dist/compiler/compiler-context.js +24 -0
- package/dist/compiler/config/constants.d.ts +41 -0
- package/dist/compiler/config/constants.js +45 -0
- package/dist/compiler/config/index.d.ts +252 -0
- package/dist/compiler/config/index.js +15 -0
- package/dist/compiler/config/injection.d.ts +26 -0
- package/dist/compiler/config/injection.js +58 -0
- package/dist/compiler/config/schemas/experimental/index.d.ts +91 -0
- package/dist/compiler/config/schemas/experimental/index.js +16 -0
- package/dist/compiler/config/schemas/experimental/oauth.d.ts +74 -0
- package/dist/compiler/config/schemas/experimental/oauth.js +25 -0
- package/dist/compiler/config/schemas/index.d.ts +6 -0
- package/dist/compiler/config/schemas/index.js +17 -0
- package/dist/compiler/config/schemas/paths.d.ts +9 -0
- package/dist/compiler/config/schemas/paths.js +12 -0
- package/dist/compiler/config/schemas/transport/http.d.ts +82 -0
- package/dist/compiler/config/schemas/transport/http.js +33 -0
- package/dist/compiler/config/schemas/transport/stdio.d.ts +9 -0
- package/dist/compiler/config/schemas/transport/stdio.js +15 -0
- package/dist/compiler/config/schemas/webpack.d.ts +3 -0
- package/dist/compiler/config/schemas/webpack.js +15 -0
- package/dist/compiler/config/types.d.ts +1 -0
- package/dist/compiler/config/types.js +2 -0
- package/dist/compiler/config/utils.d.ts +20 -0
- package/dist/compiler/config/utils.js +36 -0
- package/dist/compiler/generate-env-code.d.ts +1 -0
- package/dist/compiler/generate-env-code.js +8 -0
- package/dist/compiler/generate-import-code.d.ts +1 -0
- package/dist/compiler/generate-import-code.js +24 -0
- package/dist/compiler/get-webpack-config/get-entries.d.ts +3 -0
- package/dist/compiler/get-webpack-config/get-entries.js +29 -0
- package/dist/compiler/get-webpack-config/get-externals.d.ts +7 -0
- package/dist/compiler/get-webpack-config/get-externals.js +88 -0
- package/dist/compiler/get-webpack-config/get-injected-variables.d.ts +8 -0
- package/dist/compiler/get-webpack-config/get-injected-variables.js +25 -0
- package/dist/compiler/get-webpack-config/index.d.ts +4 -0
- package/dist/compiler/get-webpack-config/index.js +101 -0
- package/dist/compiler/get-webpack-config/plugins.d.ts +8 -0
- package/dist/compiler/get-webpack-config/plugins.js +132 -0
- package/dist/compiler/get-webpack-config/resolve-tsconfig-paths.d.ts +9 -0
- package/dist/compiler/get-webpack-config/resolve-tsconfig-paths.js +40 -0
- package/dist/compiler/index.d.ts +6 -0
- package/dist/compiler/index.js +194 -0
- package/dist/compiler/on-first-build.d.ts +3 -0
- package/dist/compiler/on-first-build.js +58 -0
- package/dist/compiler/parse-xmcp-config.d.ts +9 -0
- package/dist/compiler/parse-xmcp-config.js +155 -0
- package/dist/compiler/start-http-server.d.ts +1 -0
- package/dist/compiler/start-http-server.js +34 -0
- package/dist/index.d.ts +12 -54
- package/dist/index.js +22 -190
- package/dist/index.js.LICENSE.txt +49 -0
- package/dist/runtime/__tests__/audit.test.d.ts +4 -0
- package/dist/runtime/__tests__/audit.test.js +328 -0
- package/dist/runtime/__tests__/identity.test.d.ts +4 -0
- package/dist/runtime/__tests__/identity.test.js +164 -0
- package/dist/runtime/__tests__/mcpi-runtime.test.d.ts +4 -0
- package/dist/runtime/__tests__/mcpi-runtime.test.js +372 -0
- package/dist/runtime/__tests__/proof.test.d.ts +4 -0
- package/dist/runtime/__tests__/proof.test.js +302 -0
- package/dist/runtime/__tests__/session.test.d.ts +4 -0
- package/dist/runtime/__tests__/session.test.js +254 -0
- package/dist/runtime/__tests__/well-known.test.d.ts +4 -0
- package/dist/runtime/__tests__/well-known.test.js +312 -0
- package/dist/runtime/adapter-express.js +2 -0
- package/dist/runtime/adapter-express.js.LICENSE.txt +252 -0
- package/dist/runtime/adapter-nextjs.js +2 -0
- package/dist/runtime/adapter-nextjs.js.LICENSE.txt +53 -0
- package/dist/runtime/adapters/express/index.d.ts +2 -0
- package/dist/runtime/adapters/express/index.js +48 -0
- package/dist/runtime/adapters/nextjs/index.d.ts +8 -0
- package/dist/runtime/adapters/nextjs/index.js +18 -0
- package/dist/runtime/audit.d.ts +93 -0
- package/dist/runtime/audit.js +212 -0
- package/dist/runtime/debug.d.ts +118 -0
- package/dist/runtime/debug.js +612 -0
- package/dist/runtime/delegation-hooks.d.ts +85 -0
- package/dist/runtime/delegation-hooks.js +116 -0
- package/dist/runtime/demo.d.ts +71 -0
- package/dist/runtime/demo.js +135 -0
- package/dist/runtime/headers.d.ts +1 -0
- package/dist/runtime/headers.js +9 -0
- package/dist/runtime/http.js +2 -0
- package/dist/runtime/http.js.LICENSE.txt +252 -0
- package/dist/runtime/identity.d.ts +105 -0
- package/dist/runtime/identity.js +232 -0
- package/dist/runtime/index.d.ts +16 -0
- package/dist/runtime/index.js +56 -0
- package/dist/runtime/mcpi-runtime.d.ts +164 -0
- package/dist/runtime/mcpi-runtime.js +352 -0
- package/dist/runtime/proof.d.ts +87 -0
- package/dist/runtime/proof.js +223 -0
- package/dist/runtime/session.d.ts +88 -0
- package/dist/runtime/session.js +216 -0
- package/dist/runtime/stdio.js +2 -0
- package/dist/runtime/stdio.js.LICENSE.txt +1 -0
- package/dist/runtime/templates/home.d.ts +2 -0
- package/dist/runtime/templates/home.js +50 -0
- package/dist/runtime/transports/http/base-streamable-http.d.ts +25 -0
- package/dist/runtime/transports/http/base-streamable-http.js +16 -0
- package/dist/runtime/transports/http/http-context.d.ts +9 -0
- package/dist/runtime/transports/http/http-context.js +8 -0
- package/dist/runtime/transports/http/index.d.ts +1 -0
- package/dist/runtime/transports/http/index.js +55 -0
- package/dist/runtime/transports/http/setup-cors.d.ts +4 -0
- package/dist/runtime/transports/http/setup-cors.js +24 -0
- package/dist/runtime/transports/http/stateless-streamable-http.d.ts +39 -0
- package/dist/runtime/transports/http/stateless-streamable-http.js +331 -0
- package/dist/runtime/transports/stdio/index.d.ts +1 -0
- package/dist/runtime/transports/stdio/index.js +51 -0
- package/dist/runtime/utils/server.d.ts +42 -0
- package/dist/runtime/utils/server.js +39 -0
- package/dist/runtime/utils/tools.d.ts +8 -0
- package/dist/runtime/utils/tools.js +115 -0
- package/dist/runtime/verifier-middleware.d.ts +76 -0
- package/dist/runtime/verifier-middleware.js +322 -0
- package/dist/runtime/well-known.d.ts +151 -0
- package/dist/runtime/well-known.js +258 -0
- package/dist/storage/config.d.ts +28 -0
- package/dist/storage/config.js +79 -0
- package/dist/storage/delegation.d.ts +59 -0
- package/dist/storage/delegation.js +130 -0
- package/dist/storage/merkle-verifier.d.ts +84 -0
- package/dist/storage/merkle-verifier.js +261 -0
- package/dist/test/__tests__/nonce-cache-integration.test.d.ts +1 -0
- package/dist/test/__tests__/nonce-cache-integration.test.js +116 -0
- package/dist/test/__tests__/nonce-cache.test.d.ts +1 -0
- package/dist/test/__tests__/nonce-cache.test.js +122 -0
- package/dist/test/__tests__/runtime-integration.test.d.ts +4 -0
- package/dist/test/__tests__/runtime-integration.test.js +192 -0
- package/dist/test/__tests__/test-infrastructure.test.d.ts +4 -0
- package/dist/test/__tests__/test-infrastructure.test.js +178 -0
- package/dist/test/deterministic-keys.d.ts +31 -0
- package/dist/test/deterministic-keys.js +108 -0
- package/dist/test/examples/test-usage-example.d.ts +140 -0
- package/dist/test/examples/test-usage-example.js +175 -0
- package/dist/test/index.d.ts +11 -0
- package/dist/test/index.js +27 -0
- package/dist/test/local-verification.d.ts +28 -0
- package/dist/test/local-verification.js +342 -0
- package/dist/test/mock-identity-provider.d.ts +96 -0
- package/dist/test/mock-identity-provider.js +243 -0
- package/dist/test/runtime-integration.d.ts +63 -0
- package/dist/test/runtime-integration.js +140 -0
- package/dist/test/test-environment.d.ts +26 -0
- package/dist/test/test-environment.js +50 -0
- package/dist/types/declarations.d.ts +1 -0
- package/dist/types/declarations.js +6 -0
- package/dist/types/middleware.d.ts +2 -0
- package/dist/types/middleware.js +2 -0
- package/dist/types/tool.d.ts +80 -0
- package/dist/types/tool.js +2 -0
- package/dist/utils/cli-icons.d.ts +3 -0
- package/dist/utils/cli-icons.js +7 -0
- package/dist/utils/constants.d.ts +6 -0
- package/dist/utils/constants.js +13 -0
- package/dist/utils/context.d.ts +33 -0
- package/dist/utils/context.js +58 -0
- package/dist/utils/file-watcher.d.ts +19 -0
- package/dist/utils/file-watcher.js +49 -0
- package/dist/utils/fs-utils.d.ts +2 -0
- package/dist/utils/fs-utils.js +22 -0
- package/dist/utils/path-validation.d.ts +3 -0
- package/dist/utils/path-validation.js +56 -0
- package/dist/utils/spawn-process.d.ts +9 -0
- package/dist/utils/spawn-process.js +50 -0
- package/dist/utils/subscribable.d.ts +12 -0
- package/dist/utils/subscribable.js +44 -0
- package/package.json +99 -21
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisNonceCache = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Redis-based nonce cache implementation
|
|
6
|
+
* Suitable for multi-instance deployments
|
|
7
|
+
*/
|
|
8
|
+
class RedisNonceCache {
|
|
9
|
+
redis; // Redis client - type depends on redis library used
|
|
10
|
+
keyPrefix;
|
|
11
|
+
constructor(redis, keyPrefix = "mcpi:nonce:") {
|
|
12
|
+
this.redis = redis;
|
|
13
|
+
this.keyPrefix = keyPrefix;
|
|
14
|
+
}
|
|
15
|
+
getKey(nonce) {
|
|
16
|
+
return `${this.keyPrefix}${nonce}`;
|
|
17
|
+
}
|
|
18
|
+
async has(nonce) {
|
|
19
|
+
try {
|
|
20
|
+
const key = this.getKey(nonce);
|
|
21
|
+
const exists = await this.redis.exists(key);
|
|
22
|
+
return exists === 1;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.error("Redis has() operation failed:", error);
|
|
26
|
+
throw new Error(`Failed to check nonce existence: ${error}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async add(nonce, ttl) {
|
|
30
|
+
try {
|
|
31
|
+
const key = this.getKey(nonce);
|
|
32
|
+
// Use SET with NX (not exists) and EX (expiry) for atomic add-if-absent
|
|
33
|
+
// This is truly atomic in Redis
|
|
34
|
+
const result = await this.redis.set(key, "1", "EX", ttl, "NX");
|
|
35
|
+
if (result !== "OK") {
|
|
36
|
+
throw new Error(`Nonce ${nonce} already exists - potential replay attack`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
// Re-throw our own errors
|
|
41
|
+
if (error.message?.includes("already exists")) {
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
console.error("Redis add() operation failed:", error);
|
|
45
|
+
throw new Error(`Failed to add nonce to cache: ${error}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async cleanup() {
|
|
49
|
+
// Redis handles expiry automatically, so this is a no-op
|
|
50
|
+
// This method exists to satisfy the interface
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.RedisNonceCache = RedisNonceCache;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CompilerMode } from ".";
|
|
2
|
+
import { XmcpConfigOuputSchema } from "./config";
|
|
3
|
+
interface CompilerContext {
|
|
4
|
+
/** The mode of the compiler. */
|
|
5
|
+
mode: CompilerMode;
|
|
6
|
+
/** Whether the adapter is enabled. */
|
|
7
|
+
adapter?: boolean;
|
|
8
|
+
/** The platforms to build for. */
|
|
9
|
+
platforms: {
|
|
10
|
+
/** Generates a .vercel folder to deploy on Vercel */
|
|
11
|
+
vercel?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** The paths to the tools. */
|
|
14
|
+
toolPaths: Set<string>;
|
|
15
|
+
/** Whether the middleware is enabled. */
|
|
16
|
+
hasMiddleware: boolean;
|
|
17
|
+
/** The parsed config. */
|
|
18
|
+
xmcpConfig?: XmcpConfigOuputSchema;
|
|
19
|
+
}
|
|
20
|
+
export declare const compilerContext: import("../utils/context").Context<CompilerContext>;
|
|
21
|
+
export declare const compilerContextProvider: (initialValue: Omit<CompilerContext, "toolPaths" | "hasMiddleware">, callback: () => void) => void;
|
|
22
|
+
export declare const getXmcpConfig: () => XmcpConfigOuputSchema;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getXmcpConfig = exports.compilerContextProvider = exports.compilerContext = void 0;
|
|
4
|
+
const context_1 = require("../utils/context");
|
|
5
|
+
exports.compilerContext = (0, context_1.createContext)({
|
|
6
|
+
name: "xmcp-compiler",
|
|
7
|
+
});
|
|
8
|
+
// Preset some defaults for the compiler context
|
|
9
|
+
const compilerContextProvider = (initialValue, callback) => {
|
|
10
|
+
return exports.compilerContext.provider({
|
|
11
|
+
...initialValue,
|
|
12
|
+
toolPaths: new Set(),
|
|
13
|
+
hasMiddleware: false,
|
|
14
|
+
}, callback);
|
|
15
|
+
};
|
|
16
|
+
exports.compilerContextProvider = compilerContextProvider;
|
|
17
|
+
const getXmcpConfig = () => {
|
|
18
|
+
const { xmcpConfig } = exports.compilerContext.getContext();
|
|
19
|
+
if (!xmcpConfig) {
|
|
20
|
+
throw new Error("xmcp config not found");
|
|
21
|
+
}
|
|
22
|
+
return xmcpConfig;
|
|
23
|
+
};
|
|
24
|
+
exports.getXmcpConfig = getXmcpConfig;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default values for CORS config
|
|
3
|
+
*/
|
|
4
|
+
export declare const DEFAULT_CORS_CONFIG: {
|
|
5
|
+
origin: string;
|
|
6
|
+
methods: string[];
|
|
7
|
+
allowedHeaders: string[];
|
|
8
|
+
exposedHeaders: string[];
|
|
9
|
+
credentials: boolean;
|
|
10
|
+
maxAge: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Default values for the HTTP transport
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_HTTP_CONFIG: {
|
|
16
|
+
port: number;
|
|
17
|
+
host: string;
|
|
18
|
+
bodySizeLimit: number;
|
|
19
|
+
debug: boolean;
|
|
20
|
+
endpoint: string;
|
|
21
|
+
cors: {
|
|
22
|
+
origin: string;
|
|
23
|
+
methods: string[];
|
|
24
|
+
allowedHeaders: string[];
|
|
25
|
+
exposedHeaders: string[];
|
|
26
|
+
credentials: boolean;
|
|
27
|
+
maxAge: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Default values for the STDIO transport
|
|
32
|
+
*/
|
|
33
|
+
export declare const DEFAULT_STDIO_CONFIG: {
|
|
34
|
+
debug: boolean;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Default values for the tools directory
|
|
38
|
+
*/
|
|
39
|
+
export declare const DEFAULT_PATHS_CONFIG: {
|
|
40
|
+
tools: string;
|
|
41
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ------------------------------------------------------------
|
|
3
|
+
// Constants
|
|
4
|
+
// ------------------------------------------------------------
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DEFAULT_PATHS_CONFIG = exports.DEFAULT_STDIO_CONFIG = exports.DEFAULT_HTTP_CONFIG = exports.DEFAULT_CORS_CONFIG = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Default values for CORS config
|
|
9
|
+
*/
|
|
10
|
+
exports.DEFAULT_CORS_CONFIG = {
|
|
11
|
+
origin: "*",
|
|
12
|
+
methods: ["GET", "POST"],
|
|
13
|
+
allowedHeaders: [
|
|
14
|
+
"Content-Type",
|
|
15
|
+
"Authorization",
|
|
16
|
+
"mcp-session-id",
|
|
17
|
+
"mcp-protocol-version",
|
|
18
|
+
],
|
|
19
|
+
exposedHeaders: ["Content-Type", "Authorization", "mcp-session-id"],
|
|
20
|
+
credentials: false,
|
|
21
|
+
maxAge: 86400,
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Default values for the HTTP transport
|
|
25
|
+
*/
|
|
26
|
+
exports.DEFAULT_HTTP_CONFIG = {
|
|
27
|
+
port: 3000,
|
|
28
|
+
host: "127.0.0.1",
|
|
29
|
+
bodySizeLimit: 1024 * 1024 * 10, // 10MB
|
|
30
|
+
debug: false,
|
|
31
|
+
endpoint: "/mcp",
|
|
32
|
+
cors: exports.DEFAULT_CORS_CONFIG,
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Default values for the STDIO transport
|
|
36
|
+
*/
|
|
37
|
+
exports.DEFAULT_STDIO_CONFIG = {
|
|
38
|
+
debug: false,
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Default values for the tools directory
|
|
42
|
+
*/
|
|
43
|
+
exports.DEFAULT_PATHS_CONFIG = {
|
|
44
|
+
tools: "src/tools",
|
|
45
|
+
};
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Configuration } from "webpack";
|
|
3
|
+
/**
|
|
4
|
+
* xmcp Config schema
|
|
5
|
+
*/
|
|
6
|
+
export declare const configSchema: z.ZodObject<{
|
|
7
|
+
stdio: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
8
|
+
debug: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
debug: boolean;
|
|
11
|
+
}, {
|
|
12
|
+
debug?: boolean | undefined;
|
|
13
|
+
}>]>>>;
|
|
14
|
+
http: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
15
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
host: z.ZodOptional<z.ZodString>;
|
|
17
|
+
bodySizeLimit: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
debug: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
20
|
+
cors: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
origin: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodBoolean]>>;
|
|
22
|
+
methods: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
23
|
+
allowedHeaders: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
24
|
+
exposedHeaders: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
25
|
+
credentials: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
maxAge: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
origin?: string | boolean | string[] | undefined;
|
|
29
|
+
methods?: string | string[] | undefined;
|
|
30
|
+
allowedHeaders?: string | string[] | undefined;
|
|
31
|
+
exposedHeaders?: string | string[] | undefined;
|
|
32
|
+
credentials?: boolean | undefined;
|
|
33
|
+
maxAge?: number | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
origin?: string | boolean | string[] | undefined;
|
|
36
|
+
methods?: string | string[] | undefined;
|
|
37
|
+
allowedHeaders?: string | string[] | undefined;
|
|
38
|
+
exposedHeaders?: string | string[] | undefined;
|
|
39
|
+
credentials?: boolean | undefined;
|
|
40
|
+
maxAge?: number | undefined;
|
|
41
|
+
}>>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
port?: number | undefined;
|
|
44
|
+
host?: string | undefined;
|
|
45
|
+
bodySizeLimit?: number | undefined;
|
|
46
|
+
debug?: boolean | undefined;
|
|
47
|
+
endpoint?: string | undefined;
|
|
48
|
+
cors?: {
|
|
49
|
+
origin?: string | boolean | string[] | undefined;
|
|
50
|
+
methods?: string | string[] | undefined;
|
|
51
|
+
allowedHeaders?: string | string[] | undefined;
|
|
52
|
+
exposedHeaders?: string | string[] | undefined;
|
|
53
|
+
credentials?: boolean | undefined;
|
|
54
|
+
maxAge?: number | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
port?: number | undefined;
|
|
58
|
+
host?: string | undefined;
|
|
59
|
+
bodySizeLimit?: number | undefined;
|
|
60
|
+
debug?: boolean | undefined;
|
|
61
|
+
endpoint?: string | undefined;
|
|
62
|
+
cors?: {
|
|
63
|
+
origin?: string | boolean | string[] | undefined;
|
|
64
|
+
methods?: string | string[] | undefined;
|
|
65
|
+
allowedHeaders?: string | string[] | undefined;
|
|
66
|
+
exposedHeaders?: string | string[] | undefined;
|
|
67
|
+
credentials?: boolean | undefined;
|
|
68
|
+
maxAge?: number | undefined;
|
|
69
|
+
} | undefined;
|
|
70
|
+
}>>>]>>;
|
|
71
|
+
experimental: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
oauth: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
endpoints: z.ZodObject<{
|
|
74
|
+
authorizationUrl: z.ZodString;
|
|
75
|
+
tokenUrl: z.ZodString;
|
|
76
|
+
revocationUrl: z.ZodOptional<z.ZodString>;
|
|
77
|
+
userInfoUrl: z.ZodOptional<z.ZodString>;
|
|
78
|
+
registerUrl: z.ZodString;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
authorizationUrl: string;
|
|
81
|
+
tokenUrl: string;
|
|
82
|
+
registerUrl: string;
|
|
83
|
+
revocationUrl?: string | undefined;
|
|
84
|
+
userInfoUrl?: string | undefined;
|
|
85
|
+
}, {
|
|
86
|
+
authorizationUrl: string;
|
|
87
|
+
tokenUrl: string;
|
|
88
|
+
registerUrl: string;
|
|
89
|
+
revocationUrl?: string | undefined;
|
|
90
|
+
userInfoUrl?: string | undefined;
|
|
91
|
+
}>;
|
|
92
|
+
issuerUrl: z.ZodString;
|
|
93
|
+
baseUrl: z.ZodString;
|
|
94
|
+
serviceDocumentationUrl: z.ZodOptional<z.ZodString>;
|
|
95
|
+
pathPrefix: z.ZodDefault<z.ZodString>;
|
|
96
|
+
defaultScopes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
endpoints: {
|
|
99
|
+
authorizationUrl: string;
|
|
100
|
+
tokenUrl: string;
|
|
101
|
+
registerUrl: string;
|
|
102
|
+
revocationUrl?: string | undefined;
|
|
103
|
+
userInfoUrl?: string | undefined;
|
|
104
|
+
};
|
|
105
|
+
issuerUrl: string;
|
|
106
|
+
baseUrl: string;
|
|
107
|
+
pathPrefix: string;
|
|
108
|
+
defaultScopes: string[];
|
|
109
|
+
serviceDocumentationUrl?: string | undefined;
|
|
110
|
+
}, {
|
|
111
|
+
endpoints: {
|
|
112
|
+
authorizationUrl: string;
|
|
113
|
+
tokenUrl: string;
|
|
114
|
+
registerUrl: string;
|
|
115
|
+
revocationUrl?: string | undefined;
|
|
116
|
+
userInfoUrl?: string | undefined;
|
|
117
|
+
};
|
|
118
|
+
issuerUrl: string;
|
|
119
|
+
baseUrl: string;
|
|
120
|
+
serviceDocumentationUrl?: string | undefined;
|
|
121
|
+
pathPrefix?: string | undefined;
|
|
122
|
+
defaultScopes?: string[] | undefined;
|
|
123
|
+
}>>;
|
|
124
|
+
adapter: z.ZodOptional<z.ZodEnum<["express", "nextjs"]>>;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
oauth?: {
|
|
127
|
+
endpoints: {
|
|
128
|
+
authorizationUrl: string;
|
|
129
|
+
tokenUrl: string;
|
|
130
|
+
registerUrl: string;
|
|
131
|
+
revocationUrl?: string | undefined;
|
|
132
|
+
userInfoUrl?: string | undefined;
|
|
133
|
+
};
|
|
134
|
+
issuerUrl: string;
|
|
135
|
+
baseUrl: string;
|
|
136
|
+
pathPrefix: string;
|
|
137
|
+
defaultScopes: string[];
|
|
138
|
+
serviceDocumentationUrl?: string | undefined;
|
|
139
|
+
} | undefined;
|
|
140
|
+
adapter?: "express" | "nextjs" | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
oauth?: {
|
|
143
|
+
endpoints: {
|
|
144
|
+
authorizationUrl: string;
|
|
145
|
+
tokenUrl: string;
|
|
146
|
+
registerUrl: string;
|
|
147
|
+
revocationUrl?: string | undefined;
|
|
148
|
+
userInfoUrl?: string | undefined;
|
|
149
|
+
};
|
|
150
|
+
issuerUrl: string;
|
|
151
|
+
baseUrl: string;
|
|
152
|
+
serviceDocumentationUrl?: string | undefined;
|
|
153
|
+
pathPrefix?: string | undefined;
|
|
154
|
+
defaultScopes?: string[] | undefined;
|
|
155
|
+
} | undefined;
|
|
156
|
+
adapter?: "express" | "nextjs" | undefined;
|
|
157
|
+
}>>;
|
|
158
|
+
paths: z.ZodOptional<z.ZodObject<{
|
|
159
|
+
tools: z.ZodDefault<z.ZodString>;
|
|
160
|
+
}, "strip", z.ZodTypeAny, {
|
|
161
|
+
tools: string;
|
|
162
|
+
}, {
|
|
163
|
+
tools?: string | undefined;
|
|
164
|
+
}>>;
|
|
165
|
+
webpack: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodAny>>>;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
stdio?: boolean | {
|
|
168
|
+
debug: boolean;
|
|
169
|
+
} | undefined;
|
|
170
|
+
http?: boolean | {
|
|
171
|
+
port?: number | undefined;
|
|
172
|
+
host?: string | undefined;
|
|
173
|
+
bodySizeLimit?: number | undefined;
|
|
174
|
+
debug?: boolean | undefined;
|
|
175
|
+
endpoint?: string | undefined;
|
|
176
|
+
cors?: {
|
|
177
|
+
origin?: string | boolean | string[] | undefined;
|
|
178
|
+
methods?: string | string[] | undefined;
|
|
179
|
+
allowedHeaders?: string | string[] | undefined;
|
|
180
|
+
exposedHeaders?: string | string[] | undefined;
|
|
181
|
+
credentials?: boolean | undefined;
|
|
182
|
+
maxAge?: number | undefined;
|
|
183
|
+
} | undefined;
|
|
184
|
+
} | undefined;
|
|
185
|
+
experimental?: {
|
|
186
|
+
oauth?: {
|
|
187
|
+
endpoints: {
|
|
188
|
+
authorizationUrl: string;
|
|
189
|
+
tokenUrl: string;
|
|
190
|
+
registerUrl: string;
|
|
191
|
+
revocationUrl?: string | undefined;
|
|
192
|
+
userInfoUrl?: string | undefined;
|
|
193
|
+
};
|
|
194
|
+
issuerUrl: string;
|
|
195
|
+
baseUrl: string;
|
|
196
|
+
pathPrefix: string;
|
|
197
|
+
defaultScopes: string[];
|
|
198
|
+
serviceDocumentationUrl?: string | undefined;
|
|
199
|
+
} | undefined;
|
|
200
|
+
adapter?: "express" | "nextjs" | undefined;
|
|
201
|
+
} | undefined;
|
|
202
|
+
paths?: {
|
|
203
|
+
tools: string;
|
|
204
|
+
} | undefined;
|
|
205
|
+
webpack?: ((args_0: any, ...args: unknown[]) => any) | undefined;
|
|
206
|
+
}, {
|
|
207
|
+
stdio?: boolean | {
|
|
208
|
+
debug?: boolean | undefined;
|
|
209
|
+
} | undefined;
|
|
210
|
+
http?: boolean | {
|
|
211
|
+
port?: number | undefined;
|
|
212
|
+
host?: string | undefined;
|
|
213
|
+
bodySizeLimit?: number | undefined;
|
|
214
|
+
debug?: boolean | undefined;
|
|
215
|
+
endpoint?: string | undefined;
|
|
216
|
+
cors?: {
|
|
217
|
+
origin?: string | boolean | string[] | undefined;
|
|
218
|
+
methods?: string | string[] | undefined;
|
|
219
|
+
allowedHeaders?: string | string[] | undefined;
|
|
220
|
+
exposedHeaders?: string | string[] | undefined;
|
|
221
|
+
credentials?: boolean | undefined;
|
|
222
|
+
maxAge?: number | undefined;
|
|
223
|
+
} | undefined;
|
|
224
|
+
} | undefined;
|
|
225
|
+
experimental?: {
|
|
226
|
+
oauth?: {
|
|
227
|
+
endpoints: {
|
|
228
|
+
authorizationUrl: string;
|
|
229
|
+
tokenUrl: string;
|
|
230
|
+
registerUrl: string;
|
|
231
|
+
revocationUrl?: string | undefined;
|
|
232
|
+
userInfoUrl?: string | undefined;
|
|
233
|
+
};
|
|
234
|
+
issuerUrl: string;
|
|
235
|
+
baseUrl: string;
|
|
236
|
+
serviceDocumentationUrl?: string | undefined;
|
|
237
|
+
pathPrefix?: string | undefined;
|
|
238
|
+
defaultScopes?: string[] | undefined;
|
|
239
|
+
} | undefined;
|
|
240
|
+
adapter?: "express" | "nextjs" | undefined;
|
|
241
|
+
} | undefined;
|
|
242
|
+
paths?: {
|
|
243
|
+
tools?: string | undefined;
|
|
244
|
+
} | undefined;
|
|
245
|
+
webpack?: ((args_0: any, ...args: unknown[]) => any) | undefined;
|
|
246
|
+
}>;
|
|
247
|
+
type WebpackConfig = {
|
|
248
|
+
webpack?: (config: Configuration) => Configuration;
|
|
249
|
+
};
|
|
250
|
+
export type XmcpConfigInputSchema = Omit<z.input<typeof configSchema>, "webpack"> & WebpackConfig;
|
|
251
|
+
export type XmcpConfigOuputSchema = Omit<z.output<typeof configSchema>, "webpack"> & WebpackConfig;
|
|
252
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("./schemas");
|
|
6
|
+
/**
|
|
7
|
+
* xmcp Config schema
|
|
8
|
+
*/
|
|
9
|
+
exports.configSchema = zod_1.z.object({
|
|
10
|
+
stdio: schemas_1.stdioTransportConfigSchema.optional(),
|
|
11
|
+
http: schemas_1.httpTransportConfigSchema.optional(),
|
|
12
|
+
experimental: schemas_1.experimentalConfigSchema.optional(),
|
|
13
|
+
paths: schemas_1.pathsConfigSchema.optional(),
|
|
14
|
+
webpack: schemas_1.webpackConfigSchema.optional(),
|
|
15
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HttpTransportConfig } from "./schemas/transport/http";
|
|
2
|
+
export declare function injectHttpVariables(httpConfig: HttpTransportConfig | boolean, mode: string): {
|
|
3
|
+
HTTP_CONFIG?: undefined;
|
|
4
|
+
} | {
|
|
5
|
+
HTTP_CONFIG: string;
|
|
6
|
+
};
|
|
7
|
+
export type HttpVariables = ReturnType<typeof injectHttpVariables>;
|
|
8
|
+
export declare function injectCorsVariables(httpConfig: HttpTransportConfig | null): {
|
|
9
|
+
HTTP_CORS_CONFIG: string;
|
|
10
|
+
};
|
|
11
|
+
export type CorsVariables = ReturnType<typeof injectCorsVariables>;
|
|
12
|
+
export declare function injectOAuthVariables(userConfig: any): {
|
|
13
|
+
OAUTH_CONFIG: string;
|
|
14
|
+
};
|
|
15
|
+
export type OAuthVariables = ReturnType<typeof injectOAuthVariables>;
|
|
16
|
+
export declare function injectPathsVariables(userConfig: any): {
|
|
17
|
+
TOOLS_PATH: string;
|
|
18
|
+
};
|
|
19
|
+
export type PathsVariables = ReturnType<typeof injectPathsVariables>;
|
|
20
|
+
export declare function injectStdioVariables(stdioConfig: any): {
|
|
21
|
+
STDIO_CONFIG?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
STDIO_CONFIG: string;
|
|
24
|
+
};
|
|
25
|
+
export type StdioVariables = ReturnType<typeof injectStdioVariables>;
|
|
26
|
+
export type InjectedVariables = HttpVariables | CorsVariables | OAuthVariables | PathsVariables | StdioVariables;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.injectHttpVariables = injectHttpVariables;
|
|
4
|
+
exports.injectCorsVariables = injectCorsVariables;
|
|
5
|
+
exports.injectOAuthVariables = injectOAuthVariables;
|
|
6
|
+
exports.injectPathsVariables = injectPathsVariables;
|
|
7
|
+
exports.injectStdioVariables = injectStdioVariables;
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
function injectHttpVariables(httpConfig, mode) {
|
|
10
|
+
const resolvedConfig = (0, utils_1.getResolvedHttpConfig)(httpConfig);
|
|
11
|
+
if (!resolvedConfig)
|
|
12
|
+
return {};
|
|
13
|
+
return {
|
|
14
|
+
HTTP_CONFIG: JSON.stringify({
|
|
15
|
+
port: resolvedConfig.port,
|
|
16
|
+
host: resolvedConfig.host,
|
|
17
|
+
bodySizeLimit: resolvedConfig.bodySizeLimit,
|
|
18
|
+
endpoint: resolvedConfig.endpoint,
|
|
19
|
+
stateless: true,
|
|
20
|
+
debug: mode === "development",
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function injectCorsVariables(httpConfig) {
|
|
25
|
+
const corsConfig = (0, utils_1.getResolvedCorsConfig)(httpConfig);
|
|
26
|
+
return {
|
|
27
|
+
HTTP_CORS_CONFIG: JSON.stringify({
|
|
28
|
+
origin: corsConfig.origin ?? "",
|
|
29
|
+
methods: corsConfig.methods ?? "",
|
|
30
|
+
allowedHeaders: corsConfig.allowedHeaders ?? "",
|
|
31
|
+
exposedHeaders: corsConfig.exposedHeaders ?? "",
|
|
32
|
+
credentials: corsConfig.credentials ?? false,
|
|
33
|
+
maxAge: corsConfig.maxAge ?? 0,
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function injectOAuthVariables(userConfig) {
|
|
38
|
+
const oauthConfig = (0, utils_1.getResolvedOAuthConfig)(userConfig);
|
|
39
|
+
return {
|
|
40
|
+
OAUTH_CONFIG: JSON.stringify(oauthConfig),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function injectPathsVariables(userConfig) {
|
|
44
|
+
const pathsConfig = (0, utils_1.getResolvedPathsConfig)(userConfig);
|
|
45
|
+
return {
|
|
46
|
+
TOOLS_PATH: JSON.stringify(pathsConfig.tools),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function injectStdioVariables(stdioConfig) {
|
|
50
|
+
if (!stdioConfig)
|
|
51
|
+
return {};
|
|
52
|
+
const debug = typeof stdioConfig === "object" ? stdioConfig.debug : false;
|
|
53
|
+
return {
|
|
54
|
+
STDIO_CONFIG: JSON.stringify({
|
|
55
|
+
debug,
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const adapterConfigSchema: z.ZodEnum<["express", "nextjs"]>;
|
|
3
|
+
export type AdapterConfig = z.infer<typeof adapterConfigSchema>;
|
|
4
|
+
export declare const experimentalConfigSchema: z.ZodObject<{
|
|
5
|
+
oauth: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
endpoints: z.ZodObject<{
|
|
7
|
+
authorizationUrl: z.ZodString;
|
|
8
|
+
tokenUrl: z.ZodString;
|
|
9
|
+
revocationUrl: z.ZodOptional<z.ZodString>;
|
|
10
|
+
userInfoUrl: z.ZodOptional<z.ZodString>;
|
|
11
|
+
registerUrl: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
authorizationUrl: string;
|
|
14
|
+
tokenUrl: string;
|
|
15
|
+
registerUrl: string;
|
|
16
|
+
revocationUrl?: string | undefined;
|
|
17
|
+
userInfoUrl?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
authorizationUrl: string;
|
|
20
|
+
tokenUrl: string;
|
|
21
|
+
registerUrl: string;
|
|
22
|
+
revocationUrl?: string | undefined;
|
|
23
|
+
userInfoUrl?: string | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
issuerUrl: z.ZodString;
|
|
26
|
+
baseUrl: z.ZodString;
|
|
27
|
+
serviceDocumentationUrl: z.ZodOptional<z.ZodString>;
|
|
28
|
+
pathPrefix: z.ZodDefault<z.ZodString>;
|
|
29
|
+
defaultScopes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
endpoints: {
|
|
32
|
+
authorizationUrl: string;
|
|
33
|
+
tokenUrl: string;
|
|
34
|
+
registerUrl: string;
|
|
35
|
+
revocationUrl?: string | undefined;
|
|
36
|
+
userInfoUrl?: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
issuerUrl: string;
|
|
39
|
+
baseUrl: string;
|
|
40
|
+
pathPrefix: string;
|
|
41
|
+
defaultScopes: string[];
|
|
42
|
+
serviceDocumentationUrl?: string | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
endpoints: {
|
|
45
|
+
authorizationUrl: string;
|
|
46
|
+
tokenUrl: string;
|
|
47
|
+
registerUrl: string;
|
|
48
|
+
revocationUrl?: string | undefined;
|
|
49
|
+
userInfoUrl?: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
issuerUrl: string;
|
|
52
|
+
baseUrl: string;
|
|
53
|
+
serviceDocumentationUrl?: string | undefined;
|
|
54
|
+
pathPrefix?: string | undefined;
|
|
55
|
+
defaultScopes?: string[] | undefined;
|
|
56
|
+
}>>;
|
|
57
|
+
adapter: z.ZodOptional<z.ZodEnum<["express", "nextjs"]>>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
oauth?: {
|
|
60
|
+
endpoints: {
|
|
61
|
+
authorizationUrl: string;
|
|
62
|
+
tokenUrl: string;
|
|
63
|
+
registerUrl: string;
|
|
64
|
+
revocationUrl?: string | undefined;
|
|
65
|
+
userInfoUrl?: string | undefined;
|
|
66
|
+
};
|
|
67
|
+
issuerUrl: string;
|
|
68
|
+
baseUrl: string;
|
|
69
|
+
pathPrefix: string;
|
|
70
|
+
defaultScopes: string[];
|
|
71
|
+
serviceDocumentationUrl?: string | undefined;
|
|
72
|
+
} | undefined;
|
|
73
|
+
adapter?: "express" | "nextjs" | undefined;
|
|
74
|
+
}, {
|
|
75
|
+
oauth?: {
|
|
76
|
+
endpoints: {
|
|
77
|
+
authorizationUrl: string;
|
|
78
|
+
tokenUrl: string;
|
|
79
|
+
registerUrl: string;
|
|
80
|
+
revocationUrl?: string | undefined;
|
|
81
|
+
userInfoUrl?: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
issuerUrl: string;
|
|
84
|
+
baseUrl: string;
|
|
85
|
+
serviceDocumentationUrl?: string | undefined;
|
|
86
|
+
pathPrefix?: string | undefined;
|
|
87
|
+
defaultScopes?: string[] | undefined;
|
|
88
|
+
} | undefined;
|
|
89
|
+
adapter?: "express" | "nextjs" | undefined;
|
|
90
|
+
}>;
|
|
91
|
+
export type ExperimentalConfig = z.infer<typeof experimentalConfigSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.experimentalConfigSchema = exports.adapterConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const oauth_1 = require("./oauth");
|
|
6
|
+
// ------------------------------------------------------------
|
|
7
|
+
// Adapter config schema (perhaps a separate file but it's small yet)
|
|
8
|
+
// ------------------------------------------------------------
|
|
9
|
+
exports.adapterConfigSchema = zod_1.z.enum(["express", "nextjs"]);
|
|
10
|
+
// ------------------------------------------------------------
|
|
11
|
+
// Experimental features schema
|
|
12
|
+
// ------------------------------------------------------------
|
|
13
|
+
exports.experimentalConfigSchema = zod_1.z.object({
|
|
14
|
+
oauth: oauth_1.oauthConfigSchema.optional(),
|
|
15
|
+
adapter: exports.adapterConfigSchema.optional(),
|
|
16
|
+
});
|