@mcphero/fastify 1.1.6 → 1.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/.turbo/turbo-build.log +17 -18
- package/.turbo/turbo-check.log +3 -3
- package/.turbo/turbo-lint.log +5 -0
- package/.turbo/turbo-prepack.log +8 -8
- package/README.md +60 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +63 -2
- package/build/index.js.map +1 -1
- package/package.json +4 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
DTS Build
|
|
17
|
-
DTS
|
|
18
|
-
DTS build/index.d.ts 384.00 B
|
|
1
|
+
|
|
2
|
+
> @mcphero/fastify@1.2.0 build /Users/atomic/projects/ai/mcphero/packages/fastify
|
|
3
|
+
> tsup
|
|
4
|
+
|
|
5
|
+
CLI Building entry: src/index.ts
|
|
6
|
+
CLI Using tsconfig: tsconfig.json
|
|
7
|
+
CLI tsup v8.5.1
|
|
8
|
+
CLI Using tsup config: /Users/atomic/projects/ai/mcphero/packages/fastify/tsup.config.ts
|
|
9
|
+
CLI Target: es2022
|
|
10
|
+
CLI Cleaning output folder
|
|
11
|
+
ESM Build start
|
|
12
|
+
ESM build/index.js 4.95 KB
|
|
13
|
+
ESM build/index.js.map 8.97 KB
|
|
14
|
+
ESM ⚡️ Build success in 8ms
|
|
15
|
+
DTS Build start
|
|
16
|
+
DTS ⚡️ Build success in 979ms
|
|
17
|
+
DTS build/index.d.ts 451.00 B
|
package/.turbo/turbo-check.log
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
> @mcphero/fastify@1.
|
|
2
|
+
> @mcphero/fastify@1.2.0 check /Users/atomic/projects/ai/mcphero/packages/fastify
|
|
3
3
|
> pnpm lint && pnpm typecheck
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @mcphero/fastify@1.
|
|
6
|
+
> @mcphero/fastify@1.2.0 lint /Users/atomic/projects/ai/mcphero/packages/fastify
|
|
7
7
|
> eslint
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @mcphero/fastify@1.
|
|
10
|
+
> @mcphero/fastify@1.2.0 typecheck /Users/atomic/projects/ai/mcphero/packages/fastify
|
|
11
11
|
> tsc --noEmit
|
|
12
12
|
|
package/.turbo/turbo-prepack.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @mcphero/fastify@1.
|
|
3
|
+
> @mcphero/fastify@1.2.0 prepack /Users/atomic/projects/ai/mcphero/packages/fastify
|
|
4
4
|
> pnpm clean && pnpm build
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
> @mcphero/fastify@1.
|
|
7
|
+
> @mcphero/fastify@1.2.0 clean /Users/atomic/projects/ai/mcphero/packages/fastify
|
|
8
8
|
> rimraf build
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
> @mcphero/fastify@1.
|
|
11
|
+
> @mcphero/fastify@1.2.0 build /Users/atomic/projects/ai/mcphero/packages/fastify
|
|
12
12
|
> tsup
|
|
13
13
|
|
|
14
14
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
[34mCLI[39m Target: es2022
|
|
19
19
|
[34mCLI[39m Cleaning output folder
|
|
20
20
|
[34mESM[39m Build start
|
|
21
|
-
[32mESM[39m [1mbuild/index.js [22m[
|
|
22
|
-
[32mESM[39m [1mbuild/index.js.map [22m[
|
|
23
|
-
[32mESM[39m ⚡️ Build success in
|
|
21
|
+
[32mESM[39m [1mbuild/index.js [22m[32m4.95 KB[39m
|
|
22
|
+
[32mESM[39m [1mbuild/index.js.map [22m[32m8.97 KB[39m
|
|
23
|
+
[32mESM[39m ⚡️ Build success in 14ms
|
|
24
24
|
DTS Build start
|
|
25
|
-
DTS ⚡️ Build success in
|
|
26
|
-
DTS build/index.d.ts
|
|
25
|
+
DTS ⚡️ Build success in 1148ms
|
|
26
|
+
DTS build/index.d.ts 451.00 B
|
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @mcphero/fastify
|
|
2
|
+
|
|
3
|
+
Fastify REST adapter for [MCPHero](https://github.com/atomicbi/mcphero) — expose your actions as a REST API with auto-generated OpenAPI/Swagger documentation.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @mcphero/core @mcphero/fastify
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { mcphero } from '@mcphero/core'
|
|
15
|
+
import { fastify } from '@mcphero/fastify'
|
|
16
|
+
import { SearchAction } from './actions/search.js'
|
|
17
|
+
|
|
18
|
+
await mcphero({ name: 'my-api', description: 'My REST API', version: '1.0.0' })
|
|
19
|
+
.adapter(fastify({ host: 'localhost', port: 8080, logger: true }))
|
|
20
|
+
.action(SearchAction)
|
|
21
|
+
.start()
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Visit `http://localhost:8080/` for the interactive Scalar API reference.
|
|
25
|
+
|
|
26
|
+
## Route Mapping
|
|
27
|
+
|
|
28
|
+
Each action becomes a `POST /{action.name}` route. Zod schemas are converted to JSON Schema for request body validation and OpenAPI documentation.
|
|
29
|
+
|
|
30
|
+
| Action | Route | Body |
|
|
31
|
+
|--------|-------|------|
|
|
32
|
+
| `name: 'search'` | `POST /search` | `{ "query": "...", "limit": 10 }` |
|
|
33
|
+
| `name: 'greet'` | `POST /greet` | `{ "name": "World" }` |
|
|
34
|
+
|
|
35
|
+
## Options
|
|
36
|
+
|
|
37
|
+
`FastifyAdapterOptions` extends Fastify's native `FastifyHttpOptions`, so any Fastify config is supported:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
fastify({
|
|
41
|
+
host: 'localhost',
|
|
42
|
+
port: 8080,
|
|
43
|
+
logger: {
|
|
44
|
+
level: 'debug',
|
|
45
|
+
transport: { target: 'pino-pretty' }
|
|
46
|
+
},
|
|
47
|
+
connectionTimeout: 30000
|
|
48
|
+
})
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
| Option | Type | Default | Description |
|
|
52
|
+
|--------|------|---------|-------------|
|
|
53
|
+
| `host` | `string` | `undefined` | Bind address |
|
|
54
|
+
| `port` | `number` | `undefined` | Listen port |
|
|
55
|
+
| *...* | | | Any `FastifyHttpOptions` |
|
|
56
|
+
|
|
57
|
+
## See Also
|
|
58
|
+
|
|
59
|
+
- [MCPHero README](https://github.com/atomicbi/mcphero) — Full documentation
|
|
60
|
+
- [`@mcphero/core`](https://www.npmjs.com/package/@mcphero/core) — Core library
|
package/build/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AuthConfig } from '@mcphero/auth';
|
|
1
2
|
import { AdapterFactory } from '@mcphero/core';
|
|
2
3
|
import { FastifyHttpOptions, FastifyBaseLogger } from 'fastify';
|
|
3
4
|
import { Server } from 'http';
|
|
@@ -5,6 +6,7 @@ import { Server } from 'http';
|
|
|
5
6
|
interface FastifyAdapterOptions extends FastifyHttpOptions<Server, FastifyBaseLogger> {
|
|
6
7
|
host?: string;
|
|
7
8
|
port?: number;
|
|
9
|
+
auth?: AuthConfig;
|
|
8
10
|
}
|
|
9
11
|
declare const fastify: AdapterFactory<FastifyAdapterOptions>;
|
|
10
12
|
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/adapter/fastify.ts
|
|
2
|
+
import { generateProtectedResourceMetadata, validateToken } from "@mcphero/auth";
|
|
2
3
|
import { buildLogLevels } from "@mcphero/logger";
|
|
3
4
|
import { fastify as fastifyInstance } from "fastify";
|
|
4
5
|
var PINO_LEVEL_MAP = {
|
|
@@ -11,7 +12,7 @@ var PINO_LEVEL_MAP = {
|
|
|
11
12
|
info: "info",
|
|
12
13
|
debug: "debug"
|
|
13
14
|
};
|
|
14
|
-
var fastify = ({ host, port, ...fastifyOptions }) => {
|
|
15
|
+
var fastify = ({ host, port, auth, ...fastifyOptions }) => {
|
|
15
16
|
const instance = fastifyInstance(fastifyOptions);
|
|
16
17
|
return (options, baseContext) => {
|
|
17
18
|
const context = baseContext.fork({ adapter: "fastify" });
|
|
@@ -28,6 +29,65 @@ var fastify = ({ host, port, ...fastifyOptions }) => {
|
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
await instance.register(import("@scalar/fastify-api-reference"), { routePrefix: "/" });
|
|
32
|
+
if (auth?.authorizationServers?.length && auth.resourceUrl) {
|
|
33
|
+
instance.get("/.well-known/oauth-protected-resource", async () => {
|
|
34
|
+
return generateProtectedResourceMetadata(auth.resourceUrl, auth.authorizationServers);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const oauthPaths = /* @__PURE__ */ new Set();
|
|
38
|
+
if (auth?.provider) {
|
|
39
|
+
const provider = auth.provider;
|
|
40
|
+
const toOAuthReq = (request) => ({
|
|
41
|
+
method: request.method,
|
|
42
|
+
url: new URL(request.url, `http://${request.hostname}`),
|
|
43
|
+
headers: Object.fromEntries(Object.entries(request.headers).map(([k, v]) => [k, Array.isArray(v) ? v[0] : v])),
|
|
44
|
+
body: request.body
|
|
45
|
+
});
|
|
46
|
+
const sendOAuth = (reply, oauthRes) => {
|
|
47
|
+
for (const [key, value] of Object.entries(oauthRes.headers)) {
|
|
48
|
+
reply.header(key, value);
|
|
49
|
+
}
|
|
50
|
+
return reply.status(oauthRes.status).send(oauthRes.body);
|
|
51
|
+
};
|
|
52
|
+
oauthPaths.add("/.well-known/oauth-authorization-server");
|
|
53
|
+
oauthPaths.add("/authorize");
|
|
54
|
+
oauthPaths.add("/auth/callback");
|
|
55
|
+
oauthPaths.add("/token");
|
|
56
|
+
oauthPaths.add("/register");
|
|
57
|
+
instance.get("/.well-known/oauth-authorization-server", async (_req, reply) => {
|
|
58
|
+
return sendOAuth(reply, provider.metadata());
|
|
59
|
+
});
|
|
60
|
+
instance.get("/authorize", async (req, reply) => {
|
|
61
|
+
return sendOAuth(reply, await provider.authorize(toOAuthReq(req)));
|
|
62
|
+
});
|
|
63
|
+
instance.get("/auth/callback", async (req, reply) => {
|
|
64
|
+
return sendOAuth(reply, await provider.callback(toOAuthReq(req)));
|
|
65
|
+
});
|
|
66
|
+
instance.post("/token", async (req, reply) => {
|
|
67
|
+
return sendOAuth(reply, await provider.token(toOAuthReq(req)));
|
|
68
|
+
});
|
|
69
|
+
instance.post("/register", async (req, reply) => {
|
|
70
|
+
return sendOAuth(reply, await provider.register(toOAuthReq(req)));
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (auth) {
|
|
74
|
+
instance.decorateRequest("__mcphero_auth", void 0);
|
|
75
|
+
instance.addHook("onRequest", async (request, reply) => {
|
|
76
|
+
if (request.url.startsWith("/.well-known/") || oauthPaths.has(request.url.split("?")[0])) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const result = await validateToken(request.headers.authorization, auth);
|
|
80
|
+
if (result.error) {
|
|
81
|
+
for (const [key, value] of Object.entries(result.error.headers)) {
|
|
82
|
+
reply.header(key, value);
|
|
83
|
+
}
|
|
84
|
+
return reply.status(result.error.statusCode).send(result.error.body);
|
|
85
|
+
}
|
|
86
|
+
if (result.auth) {
|
|
87
|
+
request.__mcphero_auth = result.auth;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
31
91
|
for (const action of actions) {
|
|
32
92
|
const schema = action.input.toJSONSchema();
|
|
33
93
|
instance.post(`/${action.name}`, {
|
|
@@ -52,7 +112,8 @@ var fastify = ({ host, port, ...fastifyOptions }) => {
|
|
|
52
112
|
instance.log.trace({ progress, total }, message);
|
|
53
113
|
}
|
|
54
114
|
};
|
|
55
|
-
|
|
115
|
+
const authInfo = auth ? request.__mcphero_auth : void 0;
|
|
116
|
+
return action.run(request.body, context.fork({ logger, request, ...authInfo ? { auth: authInfo } : {} }));
|
|
56
117
|
});
|
|
57
118
|
}
|
|
58
119
|
await instance.listen({ host, port });
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/adapter/fastify.ts"],"sourcesContent":["import { AdapterFactory } from '@mcphero/core'\nimport { buildLogLevels, Logger, LogLevel } from '@mcphero/logger'\nimport { FastifyBaseLogger, FastifyHttpOptions, fastify as fastifyInstance } from 'fastify'\nimport { Server } from 'http'\n\ntype FastifyLogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace'\n\nconst PINO_LEVEL_MAP: Record<LogLevel, FastifyLogLevel> = {\n emergency: 'fatal',\n alert: 'fatal',\n critical: 'fatal',\n error: 'error',\n warning: 'warn',\n notice: 'debug',\n info: 'info',\n debug: 'debug'\n}\n\nexport interface FastifyAdapterOptions extends FastifyHttpOptions<Server, FastifyBaseLogger> {\n host?: string\n port?: number\n}\n\nexport const fastify: AdapterFactory<FastifyAdapterOptions> = ({ host, port, ...fastifyOptions }) => {\n const instance = fastifyInstance(fastifyOptions)\n return (options, baseContext) => {\n const context = baseContext.fork({ adapter: 'fastify' })\n return {\n context,\n start: async (actions) => {\n await instance.register(import('@fastify/swagger'), {\n openapi: {\n info: {\n title: options.name,\n description: options.description,\n version: options.version\n }\n }\n })\n await instance.register(import('@scalar/fastify-api-reference'), { routePrefix: '/' as `/${string}` })\n for (const action of actions) {\n const schema = action.input.toJSONSchema()\n instance.post(`/${action.name}`, {\n schema: {\n description: action.description,\n body: {\n type: 'object',\n properties: schema.properties,\n required: schema.required\n },\n response: {\n 200: { description: 'Successful response' }\n }\n }\n }, (request) => {\n const logger: Logger = {\n ...buildLogLevels((level, data) => {\n const pinoLevel = PINO_LEVEL_MAP[level] ?? 'info'\n instance.log[pinoLevel](data)\n }),\n progress: ({ progress, total, message }) => { instance.log.trace({ progress, total }, message) }\n }\n return action.run(request.body, context.fork({ logger, request }))\n })\n }\n await instance.listen({ host, port })\n },\n stop: async () => { await instance.close() }\n }\n }\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../src/adapter/fastify.ts"],"sourcesContent":["import { AuthConfig, AuthInfo, generateProtectedResourceMetadata, OAuthRequest, OAuthResponse, validateToken } from '@mcphero/auth'\nimport { AdapterFactory } from '@mcphero/core'\nimport { buildLogLevels, Logger, LogLevel } from '@mcphero/logger'\nimport { FastifyBaseLogger, FastifyHttpOptions, FastifyReply, FastifyRequest, fastify as fastifyInstance } from 'fastify'\nimport { Server } from 'http'\n\ntype FastifyLogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace'\n\nconst PINO_LEVEL_MAP: Record<LogLevel, FastifyLogLevel> = {\n emergency: 'fatal',\n alert: 'fatal',\n critical: 'fatal',\n error: 'error',\n warning: 'warn',\n notice: 'debug',\n info: 'info',\n debug: 'debug'\n}\n\nexport interface FastifyAdapterOptions extends FastifyHttpOptions<Server, FastifyBaseLogger> {\n host?: string\n port?: number\n auth?: AuthConfig\n}\n\nexport const fastify: AdapterFactory<FastifyAdapterOptions> = ({ host, port, auth, ...fastifyOptions }) => {\n const instance = fastifyInstance(fastifyOptions)\n return (options, baseContext) => {\n const context = baseContext.fork({ adapter: 'fastify' })\n return {\n context,\n start: async (actions) => {\n await instance.register(import('@fastify/swagger'), {\n openapi: {\n info: {\n title: options.name,\n description: options.description,\n version: options.version\n }\n }\n })\n await instance.register(import('@scalar/fastify-api-reference'), { routePrefix: '/' as `/${string}` })\n\n if (auth?.authorizationServers?.length && auth.resourceUrl) {\n instance.get('/.well-known/oauth-protected-resource', async () => {\n return generateProtectedResourceMetadata(auth.resourceUrl!, auth.authorizationServers!)\n })\n }\n\n const oauthPaths = new Set<string>()\n if (auth?.provider) {\n const provider = auth.provider\n const toOAuthReq = (request: FastifyRequest): OAuthRequest => ({\n method: request.method,\n url: new URL(request.url, `http://${request.hostname}`),\n headers: Object.fromEntries(Object.entries(request.headers).map(([k, v]) => [k, Array.isArray(v) ? v[0] : v])),\n body: request.body as Record<string, string> | undefined\n })\n const sendOAuth = (reply: FastifyReply, oauthRes: OAuthResponse) => {\n for (const [key, value] of Object.entries(oauthRes.headers)) { reply.header(key, value) }\n return reply.status(oauthRes.status).send(oauthRes.body)\n }\n\n oauthPaths.add('/.well-known/oauth-authorization-server')\n oauthPaths.add('/authorize')\n oauthPaths.add('/auth/callback')\n oauthPaths.add('/token')\n oauthPaths.add('/register')\n\n instance.get('/.well-known/oauth-authorization-server', async (_req, reply) => {\n return sendOAuth(reply, provider.metadata())\n })\n instance.get('/authorize', async (req, reply) => {\n return sendOAuth(reply, await provider.authorize(toOAuthReq(req)))\n })\n instance.get('/auth/callback', async (req, reply) => {\n return sendOAuth(reply, await provider.callback(toOAuthReq(req)))\n })\n instance.post('/token', async (req, reply) => {\n return sendOAuth(reply, await provider.token(toOAuthReq(req)))\n })\n instance.post('/register', async (req, reply) => {\n return sendOAuth(reply, await provider.register(toOAuthReq(req)))\n })\n }\n\n if (auth) {\n instance.decorateRequest('__mcphero_auth', undefined)\n instance.addHook('onRequest', async (request: FastifyRequest, reply: FastifyReply) => {\n if (request.url.startsWith('/.well-known/') || oauthPaths.has(request.url.split('?')[0])) { return }\n const result = await validateToken(request.headers.authorization, auth)\n if (result.error) {\n for (const [key, value] of Object.entries(result.error.headers)) {\n reply.header(key, value)\n }\n return reply.status(result.error.statusCode).send(result.error.body)\n }\n if (result.auth) {\n (request as FastifyRequest & { __mcphero_auth?: AuthInfo }).__mcphero_auth = result.auth\n }\n })\n }\n\n for (const action of actions) {\n const schema = action.input.toJSONSchema()\n instance.post(`/${action.name}`, {\n schema: {\n description: action.description,\n body: {\n type: 'object',\n properties: schema.properties,\n required: schema.required\n },\n response: {\n 200: { description: 'Successful response' }\n }\n }\n }, (request) => {\n const logger: Logger = {\n ...buildLogLevels((level, data) => {\n const pinoLevel = PINO_LEVEL_MAP[level] ?? 'info'\n instance.log[pinoLevel](data)\n }),\n progress: ({ progress, total, message }) => { instance.log.trace({ progress, total }, message) }\n }\n const authInfo = auth ? (request as FastifyRequest & { __mcphero_auth?: AuthInfo }).__mcphero_auth : undefined\n return action.run(request.body, context.fork({ logger, request, ...(authInfo ? { auth: authInfo } : {}) }))\n })\n }\n await instance.listen({ host, port })\n },\n stop: async () => { await instance.close() }\n }\n }\n}\n"],"mappings":";AAAA,SAA+B,mCAAgE,qBAAqB;AAEpH,SAAS,sBAAwC;AACjD,SAA8E,WAAW,uBAAuB;AAKhH,IAAM,iBAAoD;AAAA,EACxD,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AACT;AAQO,IAAM,UAAiD,CAAC,EAAE,MAAM,MAAM,MAAM,GAAG,eAAe,MAAM;AACzG,QAAM,WAAW,gBAAgB,cAAc;AAC/C,SAAO,CAAC,SAAS,gBAAgB;AAC/B,UAAM,UAAU,YAAY,KAAK,EAAE,SAAS,UAAU,CAAC;AACvD,WAAO;AAAA,MACL;AAAA,MACA,OAAO,OAAO,YAAY;AACxB,cAAM,SAAS,SAAS,OAAO,kBAAkB,GAAG;AAAA,UAClD,SAAS;AAAA,YACP,MAAM;AAAA,cACJ,OAAO,QAAQ;AAAA,cACf,aAAa,QAAQ;AAAA,cACrB,SAAS,QAAQ;AAAA,YACnB;AAAA,UACF;AAAA,QACF,CAAC;AACD,cAAM,SAAS,SAAS,OAAO,+BAA+B,GAAG,EAAE,aAAa,IAAoB,CAAC;AAErG,YAAI,MAAM,sBAAsB,UAAU,KAAK,aAAa;AAC1D,mBAAS,IAAI,yCAAyC,YAAY;AAChE,mBAAO,kCAAkC,KAAK,aAAc,KAAK,oBAAqB;AAAA,UACxF,CAAC;AAAA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AAY,eAAe,KAAK,KAAK;AAC3C,yBAAS,IAAI,SAAS,EAAE,IAAI;AAAA,cAC9B,CAAC;AAAA,cACD,UAAU,CAAC,EAAE,UAAU,OAAO,QAAQ,MAAM;AAAE,yBAAS,IAAI,MAAM,EAAE,UAAU,MAAM,GAAG,OAAO;AAAA,cAAE;AAAA,YACjG;AACA,kBAAM,WAAW,OAAQ,QAA2D,iBAAiB;AACrG,mBAAO,OAAO,IAAI,QAAQ,MAAM,QAAQ,KAAK,EAAE,QAAQ,SAAS,GAAI,WAAW,EAAE,MAAM,SAAS,IAAI,CAAC,EAAG,CAAC,CAAC;AAAA,UAC5G,CAAC;AAAA,QACH;AACA,cAAM,SAAS,OAAO,EAAE,MAAM,KAAK,CAAC;AAAA,MACtC;AAAA,MACA,MAAM,YAAY;AAAE,cAAM,SAAS,MAAM;AAAA,MAAE;AAAA,IAC7C;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcphero/fastify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "MCP Hero Fastify REST Adapter",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
"@scalar/fastify-api-reference": "^1.49.0",
|
|
16
16
|
"fastify": "^5.8.2",
|
|
17
17
|
"zod": "^4.3.6",
|
|
18
|
-
"@mcphero/
|
|
19
|
-
"@mcphero/logger": "1.
|
|
18
|
+
"@mcphero/auth": "1.3.0",
|
|
19
|
+
"@mcphero/logger": "1.3.0",
|
|
20
|
+
"@mcphero/core": "1.3.0"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"@eslint/js": "^10.0.1",
|