v2: cf workers fix (#1843)
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
This commit is contained in:
parent
df4b6cc88d
commit
7ba58dac51
4 changed files with 48 additions and 31 deletions
|
|
@ -24,6 +24,10 @@
|
|||
"types": "./dist/index.d.mts",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./validators/cf-worker": {
|
||||
"types": "./dist/validators/cfWorker.d.mts",
|
||||
"import": "./dist/validators/cfWorker.mjs"
|
||||
},
|
||||
"./_shims": {
|
||||
"workerd": {
|
||||
"types": "./dist/shimsWorkerd.d.mts",
|
||||
|
|
@ -67,14 +71,6 @@
|
|||
"pkce-challenge": "catalog:runtimeShared",
|
||||
"zod": "catalog:runtimeShared"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cfworker/json-schema": "catalog:runtimeShared"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@cfworker/json-schema": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@modelcontextprotocol/core": "workspace:^",
|
||||
"@modelcontextprotocol/tsconfig": "workspace:^",
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ export type ClientOptions = ProtocolOptions & {
|
|||
* The validator is used to validate structured content returned by tools
|
||||
* against their declared output schemas.
|
||||
*
|
||||
* @default {@linkcode DefaultJsonSchemaValidator} ({@linkcode index.AjvJsonSchemaValidator | AjvJsonSchemaValidator} on Node.js, {@linkcode index.CfWorkerJsonSchemaValidator | CfWorkerJsonSchemaValidator} on Cloudflare Workers)
|
||||
* @default {@linkcode DefaultJsonSchemaValidator} ({@linkcode index.AjvJsonSchemaValidator | AjvJsonSchemaValidator} on Node.js, `CfWorkerJsonSchemaValidator` on Cloudflare Workers)
|
||||
*/
|
||||
jsonSchemaValidator?: jsonSchemaValidator;
|
||||
|
||||
|
|
|
|||
10
packages/client/src/validators/cfWorker.ts
Normal file
10
packages/client/src/validators/cfWorker.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Cloudflare Workers JSON Schema validator, available as a sub-path export.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/client/validators/cf-worker';
|
||||
* ```
|
||||
*/
|
||||
export { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/core';
|
||||
export type { CfWorkerSchemaDraft } from '@modelcontextprotocol/core';
|
||||
|
|
@ -4,7 +4,7 @@ export default defineConfig({
|
|||
failOnWarn: 'ci-only',
|
||||
// 1. Entry Points
|
||||
// Directly matches package.json include/exclude globs
|
||||
entry: ['src/index.ts', 'src/shimsNode.ts', 'src/shimsWorkerd.ts', 'src/shimsBrowser.ts'],
|
||||
entry: ['src/index.ts', 'src/shimsNode.ts', 'src/shimsWorkerd.ts', 'src/shimsBrowser.ts', 'src/validators/cfWorker.ts'],
|
||||
|
||||
// 2. Output Configuration
|
||||
format: ['esm'],
|
||||
|
|
|
|||
Loading…
Reference in a new issue