@aventara/nest 1.0.0-rc.1 → 1.0.0-rc.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @aventara/nest
2
2
 
3
+ ## 1.0.0-rc.2
4
+
5
+ ### Patch Changes
6
+
7
+ - `AventaraModule.forRoot({ config })` reports a Pick layer that names what its parent hid with the sentence first, as
8
+ `createFramework` does: an inline `client: { exposed: false, exemptions: { resources: { Comment: true } } }` whose
9
+ root hid `Comment` fails at the key with
10
+ `Type 'true' is not assignable to type 'true & (readonly ["Error: client cannot expose 'Comment': hidden by root"] & …)'`.
11
+ - 9366e16: MCP endpoint polish:
12
+
13
+ - A request with no bearer credentials (no `Authorization` header, or another scheme such as `Basic`) is answered
14
+ `401` with `WWW-Authenticate: Bearer resource_metadata="…"` and no error code, as RFC 6750 §3.1 asks; its body no
15
+ longer says "Missing Authorization header". A bad bearer token keeps `error="invalid_token"`.
16
+ - A `mcp.authorization.verify` that throws is still answered `401`, and is now reported to the `diagnostics` sink as
17
+ an `AvMcpDiagnostic` holding the error.
18
+ - With `mcp` configured and `@aventara/mcp` missing, the startup error names the command that installs it at the
19
+ installed `@aventara/core`'s exact version: `npm install --save-exact @aventara/mcp@<version>`.
20
+
21
+ - Updated dependencies [9366e16]
22
+ - Updated dependencies [9366e16]
23
+ - Updated dependencies [9366e16]
24
+ - Updated dependencies [9366e16]
25
+ - @aventara/core@1.0.0-rc.2
26
+ - @aventara/mcp@1.0.0-rc.2
27
+
3
28
  ## 1.0.0-rc.1
4
29
 
5
30
  ### Patch Changes
@@ -65,7 +90,6 @@
65
90
  nullable: false,
66
91
  list: false,
67
92
  lifecycle: ["VIRTUAL"],
68
- format: "url",
69
93
  },
70
94
  pipelines: {
71
95
  compute: {
package/README.md CHANGED
@@ -229,15 +229,20 @@ const signedIn: AvGuard = (ctx) => ctx.$state.user !== undefined;
229
229
  ## The MCP endpoint
230
230
 
231
231
  With `mcp` in the configuration, the module also mounts the MCP server of `@aventara/mcp` at that path, on Express and
232
- Fastify alike, and logs `Aventara mounted the MCP endpoint at /mcp (…)`. Install it beside this package, at the same
233
- version:
232
+ Fastify alike, and logs `Aventara mounted the MCP endpoint at /mcp (…)`. Install it beside this package, at
233
+ `@aventara/core`'s exact version:
234
234
 
235
235
  ```bash
236
- npm install @aventara/mcp@rc
236
+ npm install --save-exact @aventara/mcp@<your @aventara/core version>
237
237
  ```
238
238
 
239
239
  It is an optional peer dependency: an application without `mcp` does not need it, and one with `mcp` and without the
240
- package refuses to start, naming it. As for the protocol's routes, the module only mounts: the endpoint's body is read
240
+ package refuses to start, naming it and the command, with the version filled in:
241
+
242
+ ```text
243
+ AventaraModule: the configuration has `mcp`, and the package that serves it, @aventara/mcp, is not installed. Install it at @aventara/core's exact version (npm install --save-exact @aventara/mcp@1.0.0-rc.2), or remove `mcp` from the configuration.
244
+ ```
245
+ As for the protocol's routes, the module only mounts: the endpoint's body is read
241
246
  raw, the request's URL comes from the platform's `protocol` and `host` (set `trust proxy` on Express or `trustProxy` on
242
247
  Fastify behind a proxy), and every answer is `@aventara/mcp`'s. The `state` option seeds each tool call's `ctx.$state`.
243
248
  See `@aventara/mcp`'s README for the tools, the contract resource and authorization.
@@ -11,7 +11,7 @@ export type AventaraModuleOptions<M extends AvAdapterModel = AvAdapterModel, Cfg
11
11
  readonly framework: AvFramework;
12
12
  readonly config?: never;
13
13
  } | {
14
- readonly config: Cfg & AvConfig<M, Cfg> & AvConfigExact<M, Cfg>;
14
+ readonly config: Cfg & AvConfigExact<M, Cfg> & AvConfig<M, Cfg>;
15
15
  readonly framework?: never;
16
16
  }) & {
17
17
  /**
@@ -1,5 +1,19 @@
1
1
  const MCP_PACKAGE = "@aventara/mcp";
2
- const missing = (specifier) => `AventaraModule: the configuration has \`mcp\`, and the package that serves it, ${specifier}, is not installed. Install it beside @aventara/nest, at the same version (npm install ${specifier}), or remove \`mcp\` from the configuration.`;
2
+ const missing = (specifier, coreVersion) => `AventaraModule: the configuration has \`mcp\`, and the package that serves it, ${specifier}, is not installed. Install it at @aventara/core's exact version (npm install --save-exact ${specifier}@${coreVersion ?? "<your @aventara/core version>"}), or remove \`mcp\` from the configuration.`;
3
+ async function installedCoreVersion() {
4
+ try {
5
+ const manifest = new URL("../package.json", import.meta.resolve("@aventara/core"));
6
+ const { default: read } = (await import(manifest.href, {
7
+ with: { type: "json" },
8
+ }));
9
+ return read.name === "@aventara/core" && typeof read.version === "string"
10
+ ? read.version
11
+ : undefined;
12
+ }
13
+ catch {
14
+ return undefined;
15
+ }
16
+ }
3
17
  function isMissing(error, specifier) {
4
18
  const { code, message } = (error ?? {});
5
19
  return ((code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND") &&
@@ -16,7 +30,7 @@ export async function loadMcpBinding(framework, specifier = MCP_PACKAGE) {
16
30
  }
17
31
  catch (error) {
18
32
  if (isMissing(error, specifier)) {
19
- throw new Error(missing(specifier));
33
+ throw new Error(missing(specifier, await installedCoreVersion()));
20
34
  }
21
35
  throw error;
22
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aventara/nest",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0-rc.2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "NestJS host integration for Aventara.",
6
6
  "type": "module",
@@ -22,10 +22,10 @@
22
22
  "CHANGELOG.md"
23
23
  ],
24
24
  "dependencies": {
25
- "@aventara/core": "1.0.0-rc.1"
25
+ "@aventara/core": "1.0.0-rc.2"
26
26
  },
27
27
  "peerDependencies": {
28
- "@aventara/mcp": "1.0.0-rc.1",
28
+ "@aventara/mcp": "1.0.0-rc.2",
29
29
  "@nestjs/common": "^12.0.0",
30
30
  "@nestjs/core": "^12.0.0"
31
31
  },
@@ -38,9 +38,9 @@
38
38
  "access": "public"
39
39
  },
40
40
  "devDependencies": {
41
- "@aventara/mcp": "1.0.0-rc.1",
42
- "@aventara/prisma7-adapter": "1.0.0-rc.1",
43
- "@aventara/testing": "1.0.0-rc.1",
41
+ "@aventara/mcp": "1.0.0-rc.2",
42
+ "@aventara/prisma7-adapter": "1.0.0-rc.2",
43
+ "@aventara/testing": "1.0.0-rc.2",
44
44
  "@modelcontextprotocol/sdk": "1.30.1",
45
45
  "@nestjs/common": "^12.1.2",
46
46
  "@nestjs/core": "^12.1.2",