@sezzlee/sdk-nestjs 0.1.0 → 0.2.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/README.md CHANGED
@@ -4,7 +4,7 @@ An MCP layer that embeds into your existing NestJS backend. It exposes your endp
4
4
  a search-first tool catalog and replays each call through **your own** pipeline, so your guards,
5
5
  pipes and interceptors keep running unchanged. Not a gateway, not duplicated business logic.
6
6
 
7
- > Status: `0.1.0`, alpha; breaking changes are possible. [samples/demo-api](samples/demo-api) is
7
+ > Status: `0.2.0`, alpha; breaking changes are possible. [samples/demo-api](samples/demo-api) is
8
8
  > the reference wiring.
9
9
 
10
10
  ## Requirements
@@ -1,4 +1,4 @@
1
- import { catalogGenerationMetaKey, compose, createDetail, emitGuarded as emitWithin, errorResult, invokeArgumentsDescription, invokeDescription, isInvokeError, knownFields, loadDescription, missingArgument, narrowingArguments, normalizeInvokeArguments, notInvocable, operationNameDescription, refuseTimedOutInvoke, refuseUnresolvedFile, resolveDeferred as resolveDeferredWith, searchCatalog, searchDescription, searchDetailDescription, searchLimitDescription, searchQueryDescription, searchTagsDescription, SezzleeArgumentError, SezzleeDispatchAborted, textResult, unknownTool, vocabularyOf, wrongArgumentType, defaultSearchLimit, describeRankerEvent, } from "@sezzlee/core";
1
+ import { catalogGenerationMetaKey, checkPinnedVersion, compose, createLoadedTool, emitGuarded as emitWithin, errorResult, invokeArgumentsDescription, invokeDescription, invokeVersionDescription, isInvokeError, knownFields, loadDescription, missingArgument, narrowingArguments, normalizeInvokeArguments, notInvocable, operationNameDescription, refuseTimedOutInvoke, refuseUnresolvedFile, resolveDeferred as resolveDeferredWith, searchCatalog, searchDescription, searchDetailDescription, searchLimitDescription, searchQueryDescription, searchTagsDescription, SezzleeArgumentError, SezzleeDispatchAborted, textResult, unknownTool, vocabularyOf, wrongArgumentType, defaultSearchLimit, describeRankerEvent, } from "@sezzlee/core";
2
2
  import { Logger } from "@nestjs/common";
3
3
  import { z } from "zod";
4
4
  import { SezzleeFileRefused } from "./files.js";
@@ -186,7 +186,7 @@ export function registerSezzleeTools(server, deps) {
186
186
  if (!deps.visibility.visible(decision)) {
187
187
  return unknownTool(name);
188
188
  }
189
- return textResult(createDetail(entry.tool, decision), false);
189
+ return textResult(createLoadedTool(entry.tool, decision), false);
190
190
  }));
191
191
  server.registerTool("invoke_tool", {
192
192
  description: invokeDescription,
@@ -203,9 +203,20 @@ export function registerSezzleeTools(server, deps) {
203
203
  arguments: z.unknown().optional().meta({
204
204
  description: invokeArgumentsDescription,
205
205
  }),
206
+ /**
207
+ * Guard: `meta` publishes the `default: null` the ASP.NET SDK emits for this optional
208
+ * string and cannot omit, the same trap `tags` has. It binds as `unknown` so a value that
209
+ * is not a string reaches checkPinnedVersion and leaves as an envelope. Pinned by T18 and
210
+ * by test/meta-tools.spec.ts.
211
+ */
212
+ version: z.unknown().optional().meta({
213
+ type: "string",
214
+ description: invokeVersionDescription,
215
+ default: null,
216
+ }),
206
217
  })
207
218
  .meta({ required: ["name", "arguments"] }),
208
- }, async ({ name, arguments: args }, ctx) => emitGuarded(deps, async () => {
219
+ }, async ({ name, arguments: args, version }, ctx) => emitGuarded(deps, async () => {
209
220
  if (name === undefined) {
210
221
  return missingArgument("invoke_tool", "name");
211
222
  }
@@ -217,6 +228,10 @@ export function registerSezzleeTools(server, deps) {
217
228
  if (entry === undefined) {
218
229
  return unknownTool(name);
219
230
  }
231
+ const stale = checkPinnedVersion(entry.tool, version);
232
+ if (stale !== undefined) {
233
+ return stale;
234
+ }
220
235
  if (entry.template === undefined) {
221
236
  return notInvocable(name);
222
237
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sezzlee/sdk-nestjs",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Embeds an MCP layer into an existing NestJS backend: search-first tool discovery over your real endpoints, dispatched through your own guards, pipes and interceptors.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -41,7 +41,7 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "@sezzlee/core": "^0.1.0"
44
+ "@sezzlee/core": "^0.2.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@modelcontextprotocol/express": ">=2.0.0",