@lovable.dev/mcp-js 3.2.2 → 3.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/README.md +15 -1
- package/dist/{authorize-DUEaDXjU.d.ts → authorize-DxnyFNHv.d.ts} +1 -1
- package/dist/{authorize-bDiUiJco.d.cts → authorize-r6jB-Gl2.d.cts} +1 -1
- package/dist/{base-D2d7lJY5.d.cts → base-CzPzbI3q.d.cts} +1 -1
- package/dist/{base-CLO7XsxC.d.ts → base-ff0LwIA2.d.ts} +1 -1
- package/dist/cli/extract-manifest.cjs +1 -1
- package/dist/cli/extract-manifest.js +1 -1
- package/dist/{cors-NkrVgCH-.cjs → cors-Bjo6NPjV.cjs} +1 -1
- package/dist/{cors-Bgfa7_s1.js → cors-COjc9O73.js} +1 -1
- package/dist/{errors-CljrUVby.js → errors-D0UPHnG3.js} +13 -1
- package/dist/{errors-CLfxIB-l.cjs → errors-DSHt3Jqs.cjs} +13 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{io-CFyHLyvs.d.ts → io-CQ60Nc2J.d.ts} +1 -1
- package/dist/{io-CKX89yXp.js → io-DTz7efSK.js} +1 -1
- package/dist/{io-DfUvQ-SV.d.cts → io-DnRCu_HX.d.cts} +1 -1
- package/dist/{io-BCqgMODc.cjs → io-Dzy5Bu6h.cjs} +1 -1
- package/dist/{mcp-CdFFC4U3.cjs → mcp-Buu1riaY.cjs} +24 -9
- package/dist/{mcp-Dml0oUFG.js → mcp-DIR9MCwQ.js} +24 -9
- package/dist/{package-dsaGuWL2.cjs → package-DL4uNmL0.cjs} +1 -1
- package/dist/{package-00F1cYGw.js → package-DV8zBoEy.js} +1 -1
- package/dist/protocols/mcp/index.cjs +1 -1
- package/dist/protocols/mcp/index.d.cts +3 -3
- package/dist/protocols/mcp/index.d.ts +3 -3
- package/dist/protocols/mcp/index.js +1 -1
- package/dist/protocols/oauth-metadata.cjs +1 -1
- package/dist/protocols/oauth-metadata.d.cts +3 -3
- package/dist/protocols/oauth-metadata.d.ts +3 -3
- package/dist/protocols/oauth-metadata.js +1 -1
- package/dist/stacks/supabase/index.cjs +2 -2
- package/dist/stacks/supabase/index.d.cts +1 -1
- package/dist/stacks/supabase/index.d.ts +1 -1
- package/dist/stacks/supabase/index.js +2 -2
- package/dist/stacks/supabase/vite.cjs +1 -1
- package/dist/stacks/supabase/vite.d.cts +1 -1
- package/dist/stacks/supabase/vite.d.ts +1 -1
- package/dist/stacks/supabase/vite.js +1 -1
- package/dist/stacks/tanstack/index.cjs +2 -2
- package/dist/stacks/tanstack/index.d.cts +2 -2
- package/dist/stacks/tanstack/index.d.ts +2 -2
- package/dist/stacks/tanstack/index.js +2 -2
- package/dist/stacks/tanstack/vite.d.cts +1 -1
- package/dist/stacks/tanstack/vite.d.ts +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/{types-CAFCH0yK.d.cts → types-BtoYHhdt.d.cts} +9 -3
- package/dist/{types-CAFCH0yK.d.ts → types-BtoYHhdt.d.ts} +9 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ import refunds from "./skills/refunds?allowHidden=templates/.prettierrc&allowHid
|
|
|
66
66
|
|
|
67
67
|
Repeat `allowHidden` for each exact, case-sensitive file path relative to the skill directory. Directory-wide grants, globs, traversal paths, duplicate entries and entries that do not name an existing file are rejected. A hidden directory is traversed only for listed descendants; every file beneath it needs its own entry. An empty hidden directory fails too. Allowed files still pass the text-only and symlink checks. Combine `allowHidden` with `path` in either order, keeping `skill` last; percent-encode reserved characters in values (for example `%26` for `&` and `%25` for `%`).
|
|
68
68
|
|
|
69
|
-
Use dedicated publication directories without credentials or private documents. The allowlist prevents accidental hidden-file publication, not secrets in ordinary or explicitly approved files. Files use the same server-level OAuth and origin policy as tools;
|
|
69
|
+
Use dedicated publication directories without credentials or private documents. The allowlist prevents accidental hidden-file publication, not secrets in ordinary or explicitly approved files. Files use the same server-level OAuth and origin policy as tools. Tool visibility does not control Skill visibility; use a conditional Skill registration when callers need different procedures.
|
|
70
70
|
|
|
71
71
|
By default, `./skills/refunds?skill` publishes `skill://refunds/SKILL.md` and its supporting files. Use root-relative file references such as `references/rules.md` inside a skill. Reference a different skill with its complete URI; the host resolves it through `skills/get` and its skill-loading path. Reading `SKILL.md` as an ordinary resource does not activate it.
|
|
72
72
|
|
|
@@ -88,6 +88,20 @@ The server advertises the [Skills extension](https://modelcontextprotocol.io/ext
|
|
|
88
88
|
|
|
89
89
|
Fallback is reference text, not installation, execution or a permission grant. It preserves source text rather than summarizing it or rewriting links. A capable client that omits the declaration can receive both representations, even if its native skill loader is disabled. Host context limits still apply: the SDK does not truncate instructions or guarantee that a host will retain them. Build output lists published file sizes; the standard recommends at most 512 files and 16 MiB per skill, and fallback instructions should be substantially smaller for practical model context. Omit `skills` to retain existing tools-only behavior.
|
|
90
90
|
|
|
91
|
+
### Caller-specific skills
|
|
92
|
+
|
|
93
|
+
With SDK 3.3.0, mix unconditional imports with conditional registrations:
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
skills: [memberGuide, { skill: adminGuide, enabled: ({ appContext }) => appContext.isAdmin }],
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Use `defineMcp<AppContext>` and an authenticated `createAppContext`, as in [caller-dependent tool catalogs](#caller-dependent-tool-catalogs). Derive permissions from verified `auth`, not client metadata. `enabled` receives only `{ appContext }` and must be a pure synchronous boolean predicate. The SDK creates context once per protocol request that builds a server, shared with tools, including discovery, resource reads and static tool calls when conditional Skills are configured. A context or predicate failure fails the request with a redacted 500; asynchronous and non-boolean predicates are rejected. Unconditional-only servers retain their existing context-loading behavior.
|
|
100
|
+
|
|
101
|
+
Disabled registrations are absent from `skills/list` and unavailable through `skills/get`. Resources and fallback contain exactly the union of enabled bundles. Each enabled registration grants its entire recursive directory: an enabled parent still publishes a disabled child's files, including its `SKILL.md`, without registering that child as a Skill. Disabling a registration does not revoke copies independently published by another registration, another URI, or authored `instructions`. Keep restricted content outside directories granted to other callers. A reference requiring `skills/get` for a disabled registration cannot activate it, even if its text remains readable through a parent.
|
|
102
|
+
|
|
103
|
+
This selects static authored content; it does not generate personalized Skill text. Keep handler/service/RLS authorization independent. ChatGPT currently imports submission-time snapshots: do not rely on these predicates for per-user ChatGPT delivery or submit admin-only content assuming it will be filtered for later users.
|
|
104
|
+
|
|
91
105
|
## What the plugin emits
|
|
92
106
|
|
|
93
107
|
| URL | File | Purpose |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as McpProtocolEra } from "./types-BtoYHhdt.cjs";
|
|
2
2
|
//#region src/metrics/impl/base.d.ts
|
|
3
3
|
type InvocationOutcome = "ok" | "tool_error" | "handler_error" | "transport_error" | "app_context_error" | "auth_challenge" | "auth_token_expired" | "auth_token_invalid" | "auth_insufficient_scope" | "auth_unexpected_error" | "origin_rejected" | "auth_discovery_config_error" | "auth_discovery_unreachable" | "auth_jwks_config_error" | "auth_jwks_unreachable";
|
|
4
4
|
/** One recorded MCP call. Carries no arguments or response payloads — only the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as McpProtocolEra } from "./types-BtoYHhdt.js";
|
|
2
2
|
//#region src/metrics/impl/base.d.ts
|
|
3
3
|
type InvocationOutcome = "ok" | "tool_error" | "handler_error" | "transport_error" | "app_context_error" | "auth_challenge" | "auth_token_expired" | "auth_token_invalid" | "auth_insufficient_scope" | "auth_unexpected_error" | "origin_rejected" | "auth_discovery_config_error" | "auth_discovery_unreachable" | "auth_jwks_config_error" | "auth_jwks_unreachable";
|
|
4
4
|
/** One recorded MCP call. Carries no arguments or response payloads — only the
|
|
@@ -7,7 +7,7 @@ import("zod/v3").catch((err) => {
|
|
|
7
7
|
}).then(() => import("vite").catch((err) => {
|
|
8
8
|
const message = err instanceof Error ? err.message : String(err);
|
|
9
9
|
throw new Error(`@lovable.dev/mcp-js requires vite >=5.0.0 <9.0.0 for manifest extraction. Install a compatible Vite version in the project (for example, npm install -D vite@^7) and include dev dependencies when running this command. Underlying error: ${message}`);
|
|
10
|
-
})).then(() => Promise.resolve().then(() => require("../io-
|
|
10
|
+
})).then(() => Promise.resolve().then(() => require("../io-Dzy5Bu6h.cjs"))).then(({ runExtract }) => runExtract(projectRoot)).catch((err) => {
|
|
11
11
|
console.error(err instanceof Error ? err.message : String(err));
|
|
12
12
|
process.exit(1);
|
|
13
13
|
});
|
|
@@ -7,7 +7,7 @@ import("zod/v3").catch((err) => {
|
|
|
7
7
|
}).then(() => import("vite").catch((err) => {
|
|
8
8
|
const message = err instanceof Error ? err.message : String(err);
|
|
9
9
|
throw new Error(`@lovable.dev/mcp-js requires vite >=5.0.0 <9.0.0 for manifest extraction. Install a compatible Vite version in the project (for example, npm install -D vite@^7) and include dev dependencies when running this command. Underlying error: ${message}`);
|
|
10
|
-
})).then(() => import("../io-
|
|
10
|
+
})).then(() => import("../io-DTz7efSK.js")).then(({ runExtract }) => runExtract(projectRoot)).catch((err) => {
|
|
11
11
|
console.error(err instanceof Error ? err.message : String(err));
|
|
12
12
|
process.exit(1);
|
|
13
13
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_logger = require("./logger-C-Hdu57K.cjs");
|
|
2
|
-
const require_package = require("./package-
|
|
2
|
+
const require_package = require("./package-DL4uNmL0.cjs");
|
|
3
3
|
require("./metadata-path-zd7NSNoa.cjs");
|
|
4
4
|
let jose = require("jose");
|
|
5
5
|
//#region src/core/http.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as log, n as applyLogLevelFromEnv, o as parseSafeUrl, r as describeError, s as trimTrailingSlash, t as LOG_LEVEL_ENV_VAR, u as resolveMetricsConfig } from "./logger-CpLgYbCG.js";
|
|
2
|
-
import { t as version } from "./package-
|
|
2
|
+
import { t as version } from "./package-DV8zBoEy.js";
|
|
3
3
|
import "./metadata-path-CAkNcfyY.js";
|
|
4
4
|
import { createLocalJWKSet, decodeProtectedHeader, errors, jwtVerify } from "jose";
|
|
5
5
|
//#region src/core/http.ts
|
|
@@ -147,7 +147,19 @@ function defineMcp(def) {
|
|
|
147
147
|
if (Array.isArray(def.allowedOrigins)) Object.freeze(def.allowedOrigins);
|
|
148
148
|
Object.freeze(def.tools);
|
|
149
149
|
for (const tool of def.tools) Object.freeze(tool);
|
|
150
|
-
if (def.skills !== void 0)
|
|
150
|
+
if (def.skills !== void 0) {
|
|
151
|
+
if (!Array.isArray(def.skills)) throw new TypeError("@lovable.dev/mcp-js: skills must be an array of ?skill imports");
|
|
152
|
+
validateSkills(def.skills.map((entry) => {
|
|
153
|
+
if (entry && "skill" in entry) {
|
|
154
|
+
if (typeof entry.enabled !== "function") throw new TypeError("@lovable.dev/mcp-js: conditional skills require an enabled predicate");
|
|
155
|
+
if (!def.createAppContext) throw new Error("@lovable.dev/mcp-js: conditional skills require createAppContext");
|
|
156
|
+
Object.freeze(entry);
|
|
157
|
+
return entry.skill;
|
|
158
|
+
}
|
|
159
|
+
return entry;
|
|
160
|
+
}));
|
|
161
|
+
Object.freeze(def.skills);
|
|
162
|
+
}
|
|
151
163
|
return def;
|
|
152
164
|
}
|
|
153
165
|
//#endregion
|
|
@@ -147,7 +147,19 @@ function defineMcp(def) {
|
|
|
147
147
|
if (Array.isArray(def.allowedOrigins)) Object.freeze(def.allowedOrigins);
|
|
148
148
|
Object.freeze(def.tools);
|
|
149
149
|
for (const tool of def.tools) Object.freeze(tool);
|
|
150
|
-
if (def.skills !== void 0)
|
|
150
|
+
if (def.skills !== void 0) {
|
|
151
|
+
if (!Array.isArray(def.skills)) throw new TypeError("@lovable.dev/mcp-js: skills must be an array of ?skill imports");
|
|
152
|
+
require_format.validateSkills(def.skills.map((entry) => {
|
|
153
|
+
if (entry && "skill" in entry) {
|
|
154
|
+
if (typeof entry.enabled !== "function") throw new TypeError("@lovable.dev/mcp-js: conditional skills require an enabled predicate");
|
|
155
|
+
if (!def.createAppContext) throw new Error("@lovable.dev/mcp-js: conditional skills require createAppContext");
|
|
156
|
+
Object.freeze(entry);
|
|
157
|
+
return entry.skill;
|
|
158
|
+
}
|
|
159
|
+
return entry;
|
|
160
|
+
}));
|
|
161
|
+
Object.freeze(def.skills);
|
|
162
|
+
}
|
|
151
163
|
return def;
|
|
152
164
|
}
|
|
153
165
|
//#endregion
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_logger = require("./logger-C-Hdu57K.cjs");
|
|
3
|
-
const require_errors = require("./errors-
|
|
3
|
+
const require_errors = require("./errors-DSHt3Jqs.cjs");
|
|
4
4
|
//#region src/auth/config.ts
|
|
5
5
|
function frozenArray(value) {
|
|
6
6
|
return value === void 0 ? void 0 : Object.freeze([...value]);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as MetricsOptions, C as ToolHandlerResult, D as ZodSchema, E as ZodRawShape, F as ToolContext, I as JwtClaims, L as McpAuthConfig, M as McpClientInfo, N as McpProtocolEra, O as Skill, P as ProgressUpdate, S as ToolDefinition, T as ZodOutputSchema, _ as ResourceLink, a as ContentAnnotations, b as ToolAnnotations, c as EmbeddedBlobResource, d as ImageContent, f as JsonValue, g as McpDefinitionInput, h as McpDefinition, i as ConditionalSkill, j as AuthContext, k as MetricsConfig, l as EmbeddedResource, m as McpAllowedOrigins, n as AppContextToolDefinitionInput, o as ContentBlock, p as JsonValueInput, r as AudioContent, s as CreateAppContextInput, t as AppContextToolDefinition, u as EmbeddedTextResource, v as ResourceLinkIcon, w as ToolVisibilityContext, x as ToolContent, y as TextContent } from "./types-BtoYHhdt.cjs";
|
|
2
2
|
//#region src/core/define.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Declare a single MCP tool. Import the result into your MCP definition's
|
|
@@ -76,4 +76,4 @@ type LogLevel = "silent" | "error" | "warn" | "info" | "debug";
|
|
|
76
76
|
*/
|
|
77
77
|
declare function setLogLevel(level: LogLevel): LogLevel;
|
|
78
78
|
//#endregion
|
|
79
|
-
export { type AppContextToolDefinition, type AppContextToolDefinitionInput, type AudioContent, AuthContext, type ContentAnnotations, type ContentBlock, type CreateAppContextInput, type EmbeddedBlobResource, type EmbeddedResource, type EmbeddedTextResource, type ImageContent, type IssuerOAuthOptions, type JsonValue, type JsonValueInput, type JwtClaims, type LogLevel, type McpAllowedOrigins, type McpClientInfo, type McpDefinitionInput, type McpProtocolEra, type MetricsConfig, type MetricsOptions, type ProgressUpdate, type ResourceLink, type ResourceLinkIcon, type Skill, type TextContent, type ToolAnnotations, type ToolContent, ToolContext, type ToolDefinition, ToolError, type ToolHandlerResult, type ToolVisibilityContext, type ZodOutputSchema, type ZodRawShape, type ZodSchema, auth, defineMcp, defineTool, setLogLevel };
|
|
79
|
+
export { type AppContextToolDefinition, type AppContextToolDefinitionInput, type AudioContent, AuthContext, type ConditionalSkill, type ContentAnnotations, type ContentBlock, type CreateAppContextInput, type EmbeddedBlobResource, type EmbeddedResource, type EmbeddedTextResource, type ImageContent, type IssuerOAuthOptions, type JsonValue, type JsonValueInput, type JwtClaims, type LogLevel, type McpAllowedOrigins, type McpClientInfo, type McpDefinitionInput, type McpProtocolEra, type MetricsConfig, type MetricsOptions, type ProgressUpdate, type ResourceLink, type ResourceLinkIcon, type Skill, type TextContent, type ToolAnnotations, type ToolContent, ToolContext, type ToolDefinition, ToolError, type ToolHandlerResult, type ToolVisibilityContext, type ZodOutputSchema, type ZodRawShape, type ZodSchema, auth, defineMcp, defineTool, setLogLevel };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as MetricsOptions, C as ToolHandlerResult, D as ZodSchema, E as ZodRawShape, F as ToolContext, I as JwtClaims, L as McpAuthConfig, M as McpClientInfo, N as McpProtocolEra, O as Skill, P as ProgressUpdate, S as ToolDefinition, T as ZodOutputSchema, _ as ResourceLink, a as ContentAnnotations, b as ToolAnnotations, c as EmbeddedBlobResource, d as ImageContent, f as JsonValue, g as McpDefinitionInput, h as McpDefinition, i as ConditionalSkill, j as AuthContext, k as MetricsConfig, l as EmbeddedResource, m as McpAllowedOrigins, n as AppContextToolDefinitionInput, o as ContentBlock, p as JsonValueInput, r as AudioContent, s as CreateAppContextInput, t as AppContextToolDefinition, u as EmbeddedTextResource, v as ResourceLinkIcon, w as ToolVisibilityContext, x as ToolContent, y as TextContent } from "./types-BtoYHhdt.js";
|
|
2
2
|
//#region src/core/define.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Declare a single MCP tool. Import the result into your MCP definition's
|
|
@@ -76,4 +76,4 @@ type LogLevel = "silent" | "error" | "warn" | "info" | "debug";
|
|
|
76
76
|
*/
|
|
77
77
|
declare function setLogLevel(level: LogLevel): LogLevel;
|
|
78
78
|
//#endregion
|
|
79
|
-
export { type AppContextToolDefinition, type AppContextToolDefinitionInput, type AudioContent, AuthContext, type ContentAnnotations, type ContentBlock, type CreateAppContextInput, type EmbeddedBlobResource, type EmbeddedResource, type EmbeddedTextResource, type ImageContent, type IssuerOAuthOptions, type JsonValue, type JsonValueInput, type JwtClaims, type LogLevel, type McpAllowedOrigins, type McpClientInfo, type McpDefinitionInput, type McpProtocolEra, type MetricsConfig, type MetricsOptions, type ProgressUpdate, type ResourceLink, type ResourceLinkIcon, type Skill, type TextContent, type ToolAnnotations, type ToolContent, ToolContext, type ToolDefinition, ToolError, type ToolHandlerResult, type ToolVisibilityContext, type ZodOutputSchema, type ZodRawShape, type ZodSchema, auth, defineMcp, defineTool, setLogLevel };
|
|
79
|
+
export { type AppContextToolDefinition, type AppContextToolDefinitionInput, type AudioContent, AuthContext, type ConditionalSkill, type ContentAnnotations, type ContentBlock, type CreateAppContextInput, type EmbeddedBlobResource, type EmbeddedResource, type EmbeddedTextResource, type ImageContent, type IssuerOAuthOptions, type JsonValue, type JsonValueInput, type JwtClaims, type LogLevel, type McpAllowedOrigins, type McpClientInfo, type McpDefinitionInput, type McpProtocolEra, type MetricsConfig, type MetricsOptions, type ProgressUpdate, type ResourceLink, type ResourceLinkIcon, type Skill, type TextContent, type ToolAnnotations, type ToolContent, ToolContext, type ToolDefinition, ToolError, type ToolHandlerResult, type ToolVisibilityContext, type ZodOutputSchema, type ZodRawShape, type ZodSchema, auth, defineMcp, defineTool, setLogLevel };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as setLogLevel } from "./logger-CpLgYbCG.js";
|
|
2
|
-
import { a as ToolContext, i as AuthContext, o as defineMcp, s as defineTool, t as ToolError } from "./errors-
|
|
2
|
+
import { a as ToolContext, i as AuthContext, o as defineMcp, s as defineTool, t as ToolError } from "./errors-D0UPHnG3.js";
|
|
3
3
|
//#region src/auth/config.ts
|
|
4
4
|
function frozenArray(value) {
|
|
5
5
|
return value === void 0 ? void 0 : Object.freeze([...value]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as jsonSchemaFromDefinition } from "./schema-JK_1KkOa.js";
|
|
2
|
-
import { t as version } from "./package-
|
|
2
|
+
import { t as version } from "./package-DV8zBoEy.js";
|
|
3
3
|
import { a as isFileMissing, i as readSupabaseProjectRef, r as skillImportVitePlugin } from "./hooks-BOdDe251.js";
|
|
4
4
|
import { lstatSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { dirname, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_schema = require("./schema-DNMsvJwE.cjs");
|
|
2
|
-
const require_package = require("./package-
|
|
2
|
+
const require_package = require("./package-DL4uNmL0.cjs");
|
|
3
3
|
const require_hooks = require("./hooks-xQl3EkDa.cjs");
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
let node_path = require("node:path");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_schema = require("./schema-DNMsvJwE.cjs");
|
|
2
2
|
const require_logger = require("./logger-C-Hdu57K.cjs");
|
|
3
|
-
const require_errors = require("./errors-
|
|
4
|
-
const require_cors = require("./cors-
|
|
3
|
+
const require_errors = require("./errors-DSHt3Jqs.cjs");
|
|
4
|
+
const require_cors = require("./cors-Bjo6NPjV.cjs");
|
|
5
5
|
const require_tool_result = require("./tool-result-rU-PpNNi.cjs");
|
|
6
6
|
let _modelcontextprotocol_sdk_server_zod_compat_js = require("@modelcontextprotocol/sdk/server/zod-compat.js");
|
|
7
7
|
let _modelcontextprotocol_server = require("@modelcontextprotocol/server");
|
|
@@ -74,6 +74,7 @@ function prepareSkills(serverName, importedSkills) {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
function composeInstructions(authored, prepared, declared) {
|
|
77
|
+
if (prepared.skills.length === 0) return authored;
|
|
77
78
|
const addition = declared ? prepared.indexText : prepared.fallbackText;
|
|
78
79
|
return authored.length > 0 ? `${authored}\n\n${addition}` : addition;
|
|
79
80
|
}
|
|
@@ -388,19 +389,32 @@ async function buildServer(mcp, auth, recorder, era, signal, operations, skills)
|
|
|
388
389
|
const calledTools = operations ? mcp.tools.filter((tool) => operations.calledTools.has(tool.name)) : mcp.tools;
|
|
389
390
|
const selectedTools = !operations || operations.listTools ? mcp.tools : calledTools;
|
|
390
391
|
const hasConditionalTools = mcp.tools.some((tool) => tool.enabled !== void 0);
|
|
391
|
-
const needsAppContext = operations?.listTools === true && hasConditionalTools || calledTools.some((tool) => tool.enabled !== void 0 || require_errors.toolRequiresAppContext(tool));
|
|
392
|
+
const needsAppContext = skills !== void 0 && skills.prepared === void 0 || operations?.listTools === true && hasConditionalTools || calledTools.some((tool) => tool.enabled !== void 0 || require_errors.toolRequiresAppContext(tool));
|
|
392
393
|
const { createAppContext } = mcp;
|
|
393
394
|
const appContext = needsAppContext && createAppContext ? await withAppContextError(() => createAppContext({
|
|
394
395
|
auth: new require_errors.AuthContext(auth),
|
|
395
396
|
signal
|
|
396
397
|
})) : void 0;
|
|
397
398
|
const visibilityContext = Object.freeze({ appContext });
|
|
399
|
+
let preparedSkills = skills?.prepared;
|
|
400
|
+
if (skills && !preparedSkills) {
|
|
401
|
+
const enabledSkills = await withAppContextError(() => mcp.skills.flatMap((entry) => {
|
|
402
|
+
if (!("skill" in entry)) return [entry];
|
|
403
|
+
const enabled = entry.enabled(visibilityContext);
|
|
404
|
+
if (typeof enabled !== "boolean") {
|
|
405
|
+
Promise.resolve(enabled).catch(() => {});
|
|
406
|
+
throw new TypeError("@lovable.dev/mcp-js: skill enabled must return a boolean synchronously");
|
|
407
|
+
}
|
|
408
|
+
return enabled ? [entry.skill] : [];
|
|
409
|
+
}));
|
|
410
|
+
preparedSkills = prepareSkills(mcp.name, enabledSkills);
|
|
411
|
+
}
|
|
398
412
|
const server = new _modelcontextprotocol_server.McpServer({
|
|
399
413
|
name: mcp.name,
|
|
400
414
|
version: mcp.version,
|
|
401
415
|
title: mcp.title
|
|
402
416
|
}, {
|
|
403
|
-
instructions:
|
|
417
|
+
instructions: preparedSkills ? composeInstructions(mcp.instructions, preparedSkills, skills.declared) : mcp.instructions,
|
|
404
418
|
capabilities: skills ? {
|
|
405
419
|
tools: { listChanged: false },
|
|
406
420
|
resources: {
|
|
@@ -424,7 +438,7 @@ async function buildServer(mcp, auth, recorder, era, signal, operations, skills)
|
|
|
424
438
|
} : {}
|
|
425
439
|
}
|
|
426
440
|
});
|
|
427
|
-
if (
|
|
441
|
+
if (preparedSkills) registerSkills(server, preparedSkills, era);
|
|
428
442
|
for (const tool of selectedTools) {
|
|
429
443
|
if (tool.enabled) {
|
|
430
444
|
const { enabled } = tool;
|
|
@@ -458,7 +472,8 @@ async function buildServer(mcp, auth, recorder, era, signal, operations, skills)
|
|
|
458
472
|
*/
|
|
459
473
|
function createMcpProtocolHandler(mcp, options = {}) {
|
|
460
474
|
const authorizer = require_cors.createRequestAuthorizer(mcp, options);
|
|
461
|
-
const
|
|
475
|
+
const hasSkills = mcp.skills !== void 0 && mcp.skills.length > 0;
|
|
476
|
+
const preparedSkills = mcp.skills?.length && mcp.skills.every((entry) => !("skill" in entry)) ? prepareSkills(mcp.name, mcp.skills) : void 0;
|
|
462
477
|
const handle = async (request, authResult, recorder) => {
|
|
463
478
|
let protocolError;
|
|
464
479
|
const reportTransportError = async (error) => {
|
|
@@ -476,11 +491,11 @@ function createMcpProtocolHandler(mcp, options = {}) {
|
|
|
476
491
|
});
|
|
477
492
|
};
|
|
478
493
|
try {
|
|
479
|
-
const classified = mcp.createAppContext ||
|
|
494
|
+
const classified = mcp.createAppContext || hasSkills ? await classifyRequest(request) : void 0;
|
|
480
495
|
const operations = mcp.createAppContext ? classified?.operations : void 0;
|
|
481
|
-
const skills =
|
|
496
|
+
const skills = hasSkills ? {
|
|
482
497
|
prepared: preparedSkills,
|
|
483
|
-
|
|
498
|
+
declared: declaresSkillsSupport(classified?.parsedBody)
|
|
484
499
|
} : void 0;
|
|
485
500
|
const response = await (0, _modelcontextprotocol_server.createMcpHandler)(({ era, requestInfo }) => buildServer(mcp, authResult.auth, recorder, era, requestInfo?.signal ?? request.signal, operations, skills), {
|
|
486
501
|
legacy: "stateless",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as log, r as describeError } from "./logger-CpLgYbCG.js";
|
|
2
2
|
import { n as schemaFromDefinition, t as jsonSchemaFromDefinition } from "./schema-JK_1KkOa.js";
|
|
3
|
-
import { a as ToolContext, c as toolRequiresAppContext, i as AuthContext, n as errorSummary, r as resolveToolErrorMessage } from "./errors-
|
|
4
|
-
import { d as nowMs, i as normalizeHttpMethod, l as emitBeforeResponse, n as createRequestAuthorizer, p as finalizeWireResponse, t as evaluateCors, u as createNoopRecorder } from "./cors-
|
|
3
|
+
import { a as ToolContext, c as toolRequiresAppContext, i as AuthContext, n as errorSummary, r as resolveToolErrorMessage } from "./errors-D0UPHnG3.js";
|
|
4
|
+
import { d as nowMs, i as normalizeHttpMethod, l as emitBeforeResponse, n as createRequestAuthorizer, p as finalizeWireResponse, t as evaluateCors, u as createNoopRecorder } from "./cors-COjc9O73.js";
|
|
5
5
|
import { t as finalizeToolResult } from "./tool-result-DcNioyiI.js";
|
|
6
6
|
import { safeParseAsync } from "@modelcontextprotocol/sdk/server/zod-compat.js";
|
|
7
7
|
import { CLIENT_CAPABILITIES_META_KEY, CLIENT_INFO_META_KEY, McpServer, ProtocolError, ProtocolErrorCode, createMcpHandler } from "@modelcontextprotocol/server";
|
|
@@ -74,6 +74,7 @@ function prepareSkills(serverName, importedSkills) {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
function composeInstructions(authored, prepared, declared) {
|
|
77
|
+
if (prepared.skills.length === 0) return authored;
|
|
77
78
|
const addition = declared ? prepared.indexText : prepared.fallbackText;
|
|
78
79
|
return authored.length > 0 ? `${authored}\n\n${addition}` : addition;
|
|
79
80
|
}
|
|
@@ -388,19 +389,32 @@ async function buildServer(mcp, auth, recorder, era, signal, operations, skills)
|
|
|
388
389
|
const calledTools = operations ? mcp.tools.filter((tool) => operations.calledTools.has(tool.name)) : mcp.tools;
|
|
389
390
|
const selectedTools = !operations || operations.listTools ? mcp.tools : calledTools;
|
|
390
391
|
const hasConditionalTools = mcp.tools.some((tool) => tool.enabled !== void 0);
|
|
391
|
-
const needsAppContext = operations?.listTools === true && hasConditionalTools || calledTools.some((tool) => tool.enabled !== void 0 || toolRequiresAppContext(tool));
|
|
392
|
+
const needsAppContext = skills !== void 0 && skills.prepared === void 0 || operations?.listTools === true && hasConditionalTools || calledTools.some((tool) => tool.enabled !== void 0 || toolRequiresAppContext(tool));
|
|
392
393
|
const { createAppContext } = mcp;
|
|
393
394
|
const appContext = needsAppContext && createAppContext ? await withAppContextError(() => createAppContext({
|
|
394
395
|
auth: new AuthContext(auth),
|
|
395
396
|
signal
|
|
396
397
|
})) : void 0;
|
|
397
398
|
const visibilityContext = Object.freeze({ appContext });
|
|
399
|
+
let preparedSkills = skills?.prepared;
|
|
400
|
+
if (skills && !preparedSkills) {
|
|
401
|
+
const enabledSkills = await withAppContextError(() => mcp.skills.flatMap((entry) => {
|
|
402
|
+
if (!("skill" in entry)) return [entry];
|
|
403
|
+
const enabled = entry.enabled(visibilityContext);
|
|
404
|
+
if (typeof enabled !== "boolean") {
|
|
405
|
+
Promise.resolve(enabled).catch(() => {});
|
|
406
|
+
throw new TypeError("@lovable.dev/mcp-js: skill enabled must return a boolean synchronously");
|
|
407
|
+
}
|
|
408
|
+
return enabled ? [entry.skill] : [];
|
|
409
|
+
}));
|
|
410
|
+
preparedSkills = prepareSkills(mcp.name, enabledSkills);
|
|
411
|
+
}
|
|
398
412
|
const server = new McpServer({
|
|
399
413
|
name: mcp.name,
|
|
400
414
|
version: mcp.version,
|
|
401
415
|
title: mcp.title
|
|
402
416
|
}, {
|
|
403
|
-
instructions:
|
|
417
|
+
instructions: preparedSkills ? composeInstructions(mcp.instructions, preparedSkills, skills.declared) : mcp.instructions,
|
|
404
418
|
capabilities: skills ? {
|
|
405
419
|
tools: { listChanged: false },
|
|
406
420
|
resources: {
|
|
@@ -424,7 +438,7 @@ async function buildServer(mcp, auth, recorder, era, signal, operations, skills)
|
|
|
424
438
|
} : {}
|
|
425
439
|
}
|
|
426
440
|
});
|
|
427
|
-
if (
|
|
441
|
+
if (preparedSkills) registerSkills(server, preparedSkills, era);
|
|
428
442
|
for (const tool of selectedTools) {
|
|
429
443
|
if (tool.enabled) {
|
|
430
444
|
const { enabled } = tool;
|
|
@@ -458,7 +472,8 @@ async function buildServer(mcp, auth, recorder, era, signal, operations, skills)
|
|
|
458
472
|
*/
|
|
459
473
|
function createMcpProtocolHandler(mcp, options = {}) {
|
|
460
474
|
const authorizer = createRequestAuthorizer(mcp, options);
|
|
461
|
-
const
|
|
475
|
+
const hasSkills = mcp.skills !== void 0 && mcp.skills.length > 0;
|
|
476
|
+
const preparedSkills = mcp.skills?.length && mcp.skills.every((entry) => !("skill" in entry)) ? prepareSkills(mcp.name, mcp.skills) : void 0;
|
|
462
477
|
const handle = async (request, authResult, recorder) => {
|
|
463
478
|
let protocolError;
|
|
464
479
|
const reportTransportError = async (error) => {
|
|
@@ -476,11 +491,11 @@ function createMcpProtocolHandler(mcp, options = {}) {
|
|
|
476
491
|
});
|
|
477
492
|
};
|
|
478
493
|
try {
|
|
479
|
-
const classified = mcp.createAppContext ||
|
|
494
|
+
const classified = mcp.createAppContext || hasSkills ? await classifyRequest(request) : void 0;
|
|
480
495
|
const operations = mcp.createAppContext ? classified?.operations : void 0;
|
|
481
|
-
const skills =
|
|
496
|
+
const skills = hasSkills ? {
|
|
482
497
|
prepared: preparedSkills,
|
|
483
|
-
|
|
498
|
+
declared: declaresSkillsSupport(classified?.parsedBody)
|
|
484
499
|
} : void 0;
|
|
485
500
|
const response = await createMcpHandler(({ era, requestInfo }) => buildServer(mcp, authResult.auth, recorder, era, requestInfo?.signal ?? request.signal, operations, skills), {
|
|
486
501
|
legacy: "stateless",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as MetricsRecorder } from "../../base-
|
|
3
|
-
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../../authorize-
|
|
1
|
+
import { h as McpDefinition } from "../../types-BtoYHhdt.cjs";
|
|
2
|
+
import { t as MetricsRecorder } from "../../base-CzPzbI3q.cjs";
|
|
3
|
+
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../../authorize-r6jB-Gl2.cjs";
|
|
4
4
|
//#region src/protocols/mcp/protocol.d.ts
|
|
5
5
|
type McpProtocolHandler = (request: Request, recorder?: MetricsRecorder, scheduleBackground?: ScheduleBackground) => Promise<Response>;
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as MetricsRecorder } from "../../base-
|
|
3
|
-
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../../authorize-
|
|
1
|
+
import { h as McpDefinition } from "../../types-BtoYHhdt.js";
|
|
2
|
+
import { t as MetricsRecorder } from "../../base-ff0LwIA2.js";
|
|
3
|
+
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../../authorize-DxnyFNHv.js";
|
|
4
4
|
//#region src/protocols/mcp/protocol.d.ts
|
|
5
5
|
type McpProtocolHandler = (request: Request, recorder?: MetricsRecorder, scheduleBackground?: ScheduleBackground) => Promise<Response>;
|
|
6
6
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createMcpProtocolHandler } from "../../mcp-
|
|
1
|
+
import { t as createMcpProtocolHandler } from "../../mcp-DIR9MCwQ.js";
|
|
2
2
|
export { createMcpProtocolHandler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_logger = require("../logger-C-Hdu57K.cjs");
|
|
3
|
-
const require_cors = require("../cors-
|
|
3
|
+
const require_cors = require("../cors-Bjo6NPjV.cjs");
|
|
4
4
|
//#region src/protocols/oauth-metadata.ts
|
|
5
5
|
function notFound() {
|
|
6
6
|
return new Response(JSON.stringify({ error: "not found" }), {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as MetricsRecorder } from "../base-
|
|
3
|
-
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../authorize-
|
|
1
|
+
import { h as McpDefinition } from "../types-BtoYHhdt.cjs";
|
|
2
|
+
import { t as MetricsRecorder } from "../base-CzPzbI3q.cjs";
|
|
3
|
+
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../authorize-r6jB-Gl2.cjs";
|
|
4
4
|
//#region src/protocols/oauth-metadata.d.ts
|
|
5
5
|
type OAuthProtectedResourceMetadataHandler = (request: Request, recorder?: MetricsRecorder, scheduleBackground?: ScheduleBackground) => Promise<Response>;
|
|
6
6
|
declare function createOAuthProtectedResourceMetadataHandler(mcp: McpDefinition, options?: McpRuntimeOptions): OAuthProtectedResourceMetadataHandler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as MetricsRecorder } from "../base-
|
|
3
|
-
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../authorize-
|
|
1
|
+
import { h as McpDefinition } from "../types-BtoYHhdt.js";
|
|
2
|
+
import { t as MetricsRecorder } from "../base-ff0LwIA2.js";
|
|
3
|
+
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../authorize-DxnyFNHv.js";
|
|
4
4
|
//#region src/protocols/oauth-metadata.d.ts
|
|
5
5
|
type OAuthProtectedResourceMetadataHandler = (request: Request, recorder?: MetricsRecorder, scheduleBackground?: ScheduleBackground) => Promise<Response>;
|
|
6
6
|
declare function createOAuthProtectedResourceMetadataHandler(mcp: McpDefinition, options?: McpRuntimeOptions): OAuthProtectedResourceMetadataHandler;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as log, r as describeError } from "../logger-CpLgYbCG.js";
|
|
2
|
-
import { a as oauthConfigurationErrorResponse, f as JSON_HEADERS, i as normalizeHttpMethod, l as emitBeforeResponse, m as methodNotAllowed, p as finalizeWireResponse, r as getOAuthRuntime, s as resolveProtectedResource, t as evaluateCors, u as createNoopRecorder } from "../cors-
|
|
2
|
+
import { a as oauthConfigurationErrorResponse, f as JSON_HEADERS, i as normalizeHttpMethod, l as emitBeforeResponse, m as methodNotAllowed, p as finalizeWireResponse, r as getOAuthRuntime, s as resolveProtectedResource, t as evaluateCors, u as createNoopRecorder } from "../cors-COjc9O73.js";
|
|
3
3
|
//#region src/protocols/oauth-metadata.ts
|
|
4
4
|
function notFound() {
|
|
5
5
|
return new Response(JSON.stringify({ error: "not found" }), {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_logger = require("../../logger-C-Hdu57K.cjs");
|
|
3
|
-
const require_cors = require("../../cors-
|
|
3
|
+
const require_cors = require("../../cors-Bjo6NPjV.cjs");
|
|
4
4
|
const require_metadata_path = require("../../metadata-path-zd7NSNoa.cjs");
|
|
5
|
-
const require_mcp = require("../../mcp-
|
|
5
|
+
const require_mcp = require("../../mcp-Buu1riaY.cjs");
|
|
6
6
|
const require_protocols_oauth_metadata = require("../../protocols/oauth-metadata.cjs");
|
|
7
7
|
const require_forwarded = require("../../forwarded-B37IdmMX.cjs");
|
|
8
8
|
const require_paths = require("../../paths-OP318a6c.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as McpDefinition } from "../../types-BtoYHhdt.cjs";
|
|
2
2
|
//#region src/stacks/supabase/handler.d.ts
|
|
3
3
|
type SupabaseHandler = (request: Request) => Promise<Response>;
|
|
4
4
|
interface SupabaseHandlerOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as McpDefinition } from "../../types-BtoYHhdt.js";
|
|
2
2
|
//#region src/stacks/supabase/handler.d.ts
|
|
3
3
|
type SupabaseHandler = (request: Request) => Promise<Response>;
|
|
4
4
|
interface SupabaseHandlerOptions {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as trimTrailingSlash } from "../../logger-CpLgYbCG.js";
|
|
2
|
-
import { c as createRecorderForRuntime, o as assertResourcePathShape } from "../../cors-
|
|
2
|
+
import { c as createRecorderForRuntime, o as assertResourcePathShape } from "../../cors-COjc9O73.js";
|
|
3
3
|
import { t as OAUTH_PROTECTED_RESOURCE_METADATA_PATH } from "../../metadata-path-CAkNcfyY.js";
|
|
4
|
-
import { t as createMcpProtocolHandler } from "../../mcp-
|
|
4
|
+
import { t as createMcpProtocolHandler } from "../../mcp-DIR9MCwQ.js";
|
|
5
5
|
import { createOAuthProtectedResourceMetadataHandler } from "../../protocols/oauth-metadata.js";
|
|
6
6
|
import { t as applyForwardedOrigin } from "../../forwarded-BBXvFeh6.js";
|
|
7
7
|
import { n as assertFunctionName, t as FUNCTIONS_MOUNT_PREFIX } from "../../paths-IS65L6TA.js";
|
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_package = require("../../package-
|
|
5
|
+
const require_package = require("../../package-DL4uNmL0.cjs");
|
|
6
6
|
const require_hooks = require("../../hooks-xQl3EkDa.cjs");
|
|
7
7
|
const require_paths = require("../../paths-OP318a6c.cjs");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as version } from "../../package-
|
|
1
|
+
import { t as version } from "../../package-DV8zBoEy.js";
|
|
2
2
|
import { a as isFileMissing, i as readSupabaseProjectRef, n as skillImportEsbuildPlugin, t as isSkillImportInput } from "../../hooks-BOdDe251.js";
|
|
3
3
|
import { n as assertFunctionName, t as FUNCTIONS_MOUNT_PREFIX } from "../../paths-IS65L6TA.js";
|
|
4
4
|
import { lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_cors = require("../../cors-
|
|
3
|
-
const require_mcp = require("../../mcp-
|
|
2
|
+
const require_cors = require("../../cors-Bjo6NPjV.cjs");
|
|
3
|
+
const require_mcp = require("../../mcp-Buu1riaY.cjs");
|
|
4
4
|
const require_protocols_oauth_metadata = require("../../protocols/oauth-metadata.cjs");
|
|
5
5
|
const require_forwarded = require("../../forwarded-B37IdmMX.cjs");
|
|
6
6
|
//#region src/stacks/tanstack/handlers.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../../authorize-
|
|
1
|
+
import { h as McpDefinition } from "../../types-BtoYHhdt.cjs";
|
|
2
|
+
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../../authorize-r6jB-Gl2.cjs";
|
|
3
3
|
//#region src/stacks/tanstack/handlers.d.ts
|
|
4
4
|
interface TanStackRequest extends Request {
|
|
5
5
|
waitUntil?: ScheduleBackground;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../../authorize-
|
|
1
|
+
import { h as McpDefinition } from "../../types-BtoYHhdt.js";
|
|
2
|
+
import { n as ScheduleBackground, t as McpRuntimeOptions } from "../../authorize-DxnyFNHv.js";
|
|
3
3
|
//#region src/stacks/tanstack/handlers.d.ts
|
|
4
4
|
interface TanStackRequest extends Request {
|
|
5
5
|
waitUntil?: ScheduleBackground;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createRecorderForRuntime } from "../../cors-
|
|
2
|
-
import { t as createMcpProtocolHandler } from "../../mcp-
|
|
1
|
+
import { c as createRecorderForRuntime } from "../../cors-COjc9O73.js";
|
|
2
|
+
import { t as createMcpProtocolHandler } from "../../mcp-DIR9MCwQ.js";
|
|
3
3
|
import { createOAuthProtectedResourceMetadataHandler } from "../../protocols/oauth-metadata.js";
|
|
4
4
|
import { t as applyForwardedOrigin } from "../../forwarded-BBXvFeh6.js";
|
|
5
5
|
//#region src/stacks/tanstack/handlers.ts
|
package/dist/testing/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as ZodOutputSchema } from "../types-BtoYHhdt.cjs";
|
|
2
2
|
import { n as McpCheckError, t as Diagnostic } from "../diagnostic-DRKjgCsW.cjs";
|
|
3
3
|
//#region src/testing/result.d.ts
|
|
4
4
|
interface ToolResultExpectation {
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as ZodOutputSchema } from "../types-BtoYHhdt.js";
|
|
2
2
|
import { n as McpCheckError, t as Diagnostic } from "../diagnostic-DRKjgCsW.js";
|
|
3
3
|
//#region src/testing/result.d.ts
|
|
4
4
|
interface ToolResultExpectation {
|
|
@@ -328,6 +328,11 @@ interface CreateAppContextInput {
|
|
|
328
328
|
interface ToolVisibilityContext<TAppContext> {
|
|
329
329
|
readonly appContext: TAppContext;
|
|
330
330
|
}
|
|
331
|
+
/** Publishes a static skill bundle only when the caller's app context permits it. */
|
|
332
|
+
interface ConditionalSkill<TAppContext> {
|
|
333
|
+
readonly skill: Skill;
|
|
334
|
+
readonly enabled: (ctx: ToolVisibilityContext<TAppContext>) => boolean;
|
|
335
|
+
}
|
|
331
336
|
interface ToolDefinitionBase<TInput extends ZodRawShape$1 | undefined = ZodRawShape$1 | undefined, TOutput extends ZodOutputSchema | undefined = ZodOutputSchema | undefined> {
|
|
332
337
|
readonly name: string;
|
|
333
338
|
/** Human-readable display name shown to the user in MCP clients. Required. */
|
|
@@ -401,7 +406,7 @@ type McpDefinitionInput<TAppContext = undefined> = {
|
|
|
401
406
|
*/
|
|
402
407
|
readonly instructions: string;
|
|
403
408
|
readonly tools: readonly (AnyAppContextToolDefinition<TAppContext> | StaticToolDefinition)[];
|
|
404
|
-
readonly skills?: readonly Skill[];
|
|
409
|
+
readonly skills?: readonly (Skill | ConditionalSkill<TAppContext>)[];
|
|
405
410
|
/**
|
|
406
411
|
* Usage-metrics emission (runtime telemetry), on by default. `false` opts out;
|
|
407
412
|
* `{ endpoint, headers }` sends to your own OTLP collector. Self-disables at
|
|
@@ -410,10 +415,11 @@ type McpDefinitionInput<TAppContext = undefined> = {
|
|
|
410
415
|
readonly metrics?: MetricsConfig;
|
|
411
416
|
} & AppContextConfiguration<TAppContext>;
|
|
412
417
|
declare const McpDefinitionBrand: unique symbol;
|
|
413
|
-
type McpDefinition<TAppContext = unknown> = Omit<McpDefinitionInput<TAppContext>, "createAppContext" | "tools"> & {
|
|
418
|
+
type McpDefinition<TAppContext = unknown> = Omit<McpDefinitionInput<TAppContext>, "createAppContext" | "tools" | "skills"> & {
|
|
414
419
|
readonly createAppContext?: (input: CreateAppContextInput) => TAppContext | Promise<TAppContext>;
|
|
415
420
|
readonly tools: readonly AnyToolDefinition[];
|
|
421
|
+
readonly skills?: readonly (Skill | ConditionalSkill<never>)[];
|
|
416
422
|
readonly [McpDefinitionBrand]: never;
|
|
417
423
|
};
|
|
418
424
|
//#endregion
|
|
419
|
-
export {
|
|
425
|
+
export { MetricsOptions as A, ToolHandlerResult as C, ZodSchema as D, ZodRawShape$1 as E, ToolContext as F, JwtClaims as I, McpAuthConfig as L, McpClientInfo as M, McpProtocolEra as N, Skill as O, ProgressUpdate as P, ToolDefinition as S, ZodOutputSchema as T, ResourceLink as _, ContentAnnotations as a, ToolAnnotations as b, EmbeddedBlobResource as c, ImageContent as d, JsonValue as f, McpDefinitionInput as g, McpDefinition as h, ConditionalSkill as i, AuthContext as j, MetricsConfig as k, EmbeddedResource as l, McpAllowedOrigins as m, AppContextToolDefinitionInput as n, ContentBlock as o, JsonValueInput as p, AudioContent as r, CreateAppContextInput as s, AppContextToolDefinition as t, EmbeddedTextResource as u, ResourceLinkIcon as v, ToolVisibilityContext as w, ToolContent as x, TextContent as y };
|
|
@@ -328,6 +328,11 @@ interface CreateAppContextInput {
|
|
|
328
328
|
interface ToolVisibilityContext<TAppContext> {
|
|
329
329
|
readonly appContext: TAppContext;
|
|
330
330
|
}
|
|
331
|
+
/** Publishes a static skill bundle only when the caller's app context permits it. */
|
|
332
|
+
interface ConditionalSkill<TAppContext> {
|
|
333
|
+
readonly skill: Skill;
|
|
334
|
+
readonly enabled: (ctx: ToolVisibilityContext<TAppContext>) => boolean;
|
|
335
|
+
}
|
|
331
336
|
interface ToolDefinitionBase<TInput extends ZodRawShape$1 | undefined = ZodRawShape$1 | undefined, TOutput extends ZodOutputSchema | undefined = ZodOutputSchema | undefined> {
|
|
332
337
|
readonly name: string;
|
|
333
338
|
/** Human-readable display name shown to the user in MCP clients. Required. */
|
|
@@ -401,7 +406,7 @@ type McpDefinitionInput<TAppContext = undefined> = {
|
|
|
401
406
|
*/
|
|
402
407
|
readonly instructions: string;
|
|
403
408
|
readonly tools: readonly (AnyAppContextToolDefinition<TAppContext> | StaticToolDefinition)[];
|
|
404
|
-
readonly skills?: readonly Skill[];
|
|
409
|
+
readonly skills?: readonly (Skill | ConditionalSkill<TAppContext>)[];
|
|
405
410
|
/**
|
|
406
411
|
* Usage-metrics emission (runtime telemetry), on by default. `false` opts out;
|
|
407
412
|
* `{ endpoint, headers }` sends to your own OTLP collector. Self-disables at
|
|
@@ -410,10 +415,11 @@ type McpDefinitionInput<TAppContext = undefined> = {
|
|
|
410
415
|
readonly metrics?: MetricsConfig;
|
|
411
416
|
} & AppContextConfiguration<TAppContext>;
|
|
412
417
|
declare const McpDefinitionBrand: unique symbol;
|
|
413
|
-
type McpDefinition<TAppContext = unknown> = Omit<McpDefinitionInput<TAppContext>, "createAppContext" | "tools"> & {
|
|
418
|
+
type McpDefinition<TAppContext = unknown> = Omit<McpDefinitionInput<TAppContext>, "createAppContext" | "tools" | "skills"> & {
|
|
414
419
|
readonly createAppContext?: (input: CreateAppContextInput) => TAppContext | Promise<TAppContext>;
|
|
415
420
|
readonly tools: readonly AnyToolDefinition[];
|
|
421
|
+
readonly skills?: readonly (Skill | ConditionalSkill<never>)[];
|
|
416
422
|
readonly [McpDefinitionBrand]: never;
|
|
417
423
|
};
|
|
418
424
|
//#endregion
|
|
419
|
-
export {
|
|
425
|
+
export { MetricsOptions as A, ToolHandlerResult as C, ZodSchema as D, ZodRawShape$1 as E, ToolContext as F, JwtClaims as I, McpAuthConfig as L, McpClientInfo as M, McpProtocolEra as N, Skill as O, ProgressUpdate as P, ToolDefinition as S, ZodOutputSchema as T, ResourceLink as _, ContentAnnotations as a, ToolAnnotations as b, EmbeddedBlobResource as c, ImageContent as d, JsonValue as f, McpDefinitionInput as g, McpDefinition as h, ConditionalSkill as i, AuthContext as j, MetricsConfig as k, EmbeddedResource as l, McpAllowedOrigins as m, AppContextToolDefinitionInput as n, ContentBlock as o, JsonValueInput as p, AudioContent as r, CreateAppContextInput as s, AppContextToolDefinition as t, EmbeddedTextResource as u, ResourceLinkIcon as v, ToolVisibilityContext as w, ToolContent as x, TextContent as y };
|