convex 1.45.0-alpha.0 → 1.45.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/CHANGELOG.md +8 -1
- package/dist/browser.bundle.js +1 -1
- package/dist/browser.bundle.js.map +1 -1
- package/dist/cjs/cli/lib/indexes.js +1 -1
- package/dist/cjs/cli/lib/indexes.js.map +1 -1
- package/dist/cjs/cli/mcp.js +16 -6
- package/dist/cjs/cli/mcp.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/server/impl/actions_impl.js.map +2 -2
- package/dist/cjs/server/index.js.map +2 -2
- package/dist/cjs-types/cli/mcp.d.ts.map +1 -1
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cjs-types/index.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/actions_impl.d.ts +14 -0
- package/dist/cjs-types/server/impl/actions_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/index.d.ts +1 -0
- package/dist/cjs-types/server/index.d.ts.map +1 -1
- package/dist/cli.bundle.cjs +1407 -8
- package/dist/cli.bundle.cjs.map +4 -4
- package/dist/esm/cli/lib/indexes.js +1 -1
- package/dist/esm/cli/lib/indexes.js.map +1 -1
- package/dist/esm/cli/mcp.js +17 -7
- package/dist/esm/cli/mcp.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/server/impl/actions_impl.js.map +2 -2
- package/dist/esm/server/index.js.map +2 -2
- package/dist/esm-types/cli/mcp.d.ts.map +1 -1
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/esm-types/index.d.ts.map +1 -1
- package/dist/esm-types/server/impl/actions_impl.d.ts +14 -0
- package/dist/esm-types/server/impl/actions_impl.d.ts.map +1 -1
- package/dist/esm-types/server/index.d.ts +1 -0
- package/dist/esm-types/server/index.d.ts.map +1 -1
- package/dist/react.bundle.js +1 -1
- package/dist/react.bundle.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/lib/indexes.ts +1 -1
- package/src/cli/mcp.ts +29 -7
- package/src/index.ts +1 -1
- package/src/server/impl/actions_impl.ts +3 -1
- package/src/server/index.ts +0 -3
|
@@ -28,7 +28,7 @@ function addProgressLinkIfSlow(msg, deploymentName, start) {
|
|
|
28
28
|
if (Date.now() - start > 1e4) {
|
|
29
29
|
const dashboardUrl = (0, import_dashboard.deploymentDashboardUrlPage)(
|
|
30
30
|
deploymentName,
|
|
31
|
-
`/
|
|
31
|
+
`/schema?showSchema=true`
|
|
32
32
|
);
|
|
33
33
|
msg = msg.concat(`
|
|
34
34
|
See progress here: ${dashboardUrl}`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/lib/indexes.ts"],
|
|
4
|
-
"sourcesContent": ["import { chalkStderr } from \"chalk\";\nimport { deploymentDashboardUrlPage } from \"./dashboard.js\";\nimport { DeveloperIndexConfig } from \"./deployApi/finishPush.js\";\n\nexport type IndexMetadata = {\n table: string;\n name: string;\n fields:\n | string[]\n | {\n searchField: string;\n filterFields: string[];\n }\n | {\n dimensions: number;\n vectorField: string;\n filterFields: string[];\n };\n backfill: {\n state: \"in_progress\" | \"done\";\n };\n staged: boolean;\n};\n\nexport type LargeIndexDeletionCheck =\n // Don\u2019t verify whether large indexes have been deleted\n | \"no verification\"\n // If large indexes are being deleted, ask for confirmation (and fail in non-interactive envs)\n | \"ask for confirmation\"\n // If large indexes are being deleted, confirm (the user has used --allow-deleting-large-indexes)\n | \"has confirmation\";\n\nexport function addProgressLinkIfSlow(\n msg: string,\n deploymentName: string | null,\n start: number,\n): string {\n if (Date.now() - start > 10_000) {\n const dashboardUrl = deploymentDashboardUrlPage(\n deploymentName,\n `/
|
|
4
|
+
"sourcesContent": ["import { chalkStderr } from \"chalk\";\nimport { deploymentDashboardUrlPage } from \"./dashboard.js\";\nimport { DeveloperIndexConfig } from \"./deployApi/finishPush.js\";\n\nexport type IndexMetadata = {\n table: string;\n name: string;\n fields:\n | string[]\n | {\n searchField: string;\n filterFields: string[];\n }\n | {\n dimensions: number;\n vectorField: string;\n filterFields: string[];\n };\n backfill: {\n state: \"in_progress\" | \"done\";\n };\n staged: boolean;\n};\n\nexport type LargeIndexDeletionCheck =\n // Don\u2019t verify whether large indexes have been deleted\n | \"no verification\"\n // If large indexes are being deleted, ask for confirmation (and fail in non-interactive envs)\n | \"ask for confirmation\"\n // If large indexes are being deleted, confirm (the user has used --allow-deleting-large-indexes)\n | \"has confirmation\";\n\nexport function addProgressLinkIfSlow(\n msg: string,\n deploymentName: string | null,\n start: number,\n): string {\n if (Date.now() - start > 10_000) {\n const dashboardUrl = deploymentDashboardUrlPage(\n deploymentName,\n `/schema?showSchema=true`,\n );\n msg = msg.concat(`\\nSee progress here: ${dashboardUrl}`);\n }\n return msg;\n}\n\nexport function formatIndex(index: DeveloperIndexConfig) {\n const [tableName, indexName] = index.name.split(\".\");\n return `${tableName}.${chalkStderr.bold(indexName)} ${chalkStderr.gray(formatIndexFields(index))}${index.staged ? chalkStderr.blue(\" (staged)\") : \"\"}`;\n}\n\nfunction formatIndexFields(index: DeveloperIndexConfig) {\n switch (index.type) {\n case \"database\":\n return (\n \" \" + index.fields.map((f) => chalkStderr.underline(f)).join(\", \")\n );\n case \"search\":\n return `${chalkStderr.cyan(\"(text)\")} ${chalkStderr.underline(index.searchField)}${formatFilterFields(index.filterFields)}`;\n case \"vector\":\n return `${chalkStderr.cyan(\"(vector)\")} ${chalkStderr.underline(index.vectorField)} (${index.dimensions} dimensions)${formatFilterFields(index.filterFields)}`;\n default:\n index satisfies never;\n return \"\";\n }\n}\n\nfunction formatFilterFields(filterFields: string[]) {\n if (filterFields.length === 0) {\n return \"\";\n }\n return `, filter${filterFields.length === 1 ? \"\" : \"s\"} on ${filterFields.map((f) => chalkStderr.underline(f)).join(\", \")}`;\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;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
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/cli/mcp.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(mcp_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(mcp_exports);
|
|
25
25
|
var import_extra_typings = require("@commander-js/extra-typings");
|
|
26
26
|
var import_context = require("../bundler/context.js");
|
|
27
|
+
var import_log = require("../bundler/log.js");
|
|
27
28
|
var import_server = require("@modelcontextprotocol/server");
|
|
28
29
|
var import_stdio = require("@modelcontextprotocol/server/stdio");
|
|
29
30
|
var import_command = require("./lib/command.js");
|
|
@@ -57,11 +58,7 @@ mcp.command("start").summary("Start the MCP server").description(
|
|
|
57
58
|
).addDeploymentSelectionOptions((0, import_command.actionDescription)("Run the MCP server on")).action(async (options) => {
|
|
58
59
|
const ctx = await (0, import_context.oneoffContext)(options);
|
|
59
60
|
try {
|
|
60
|
-
|
|
61
|
-
const transport = new import_stdio.StdioServerTransport();
|
|
62
|
-
await server.connect(transport);
|
|
63
|
-
await new Promise(() => {
|
|
64
|
-
});
|
|
61
|
+
enabledTools(options);
|
|
65
62
|
} catch (error) {
|
|
66
63
|
await ctx.crash({
|
|
67
64
|
exitCode: 1,
|
|
@@ -70,8 +67,17 @@ mcp.command("start").summary("Start the MCP server").description(
|
|
|
70
67
|
printedMessage: `Failed to start MCP server: ${error}`
|
|
71
68
|
});
|
|
72
69
|
}
|
|
70
|
+
(0, import_stdio.serveStdio)(() => makeServer(options), {
|
|
71
|
+
legacy: "serve",
|
|
72
|
+
// The only channel for out-of-band failures (transport errors, dropped
|
|
73
|
+
// malformed notifications). stdout carries the protocol, so they go to
|
|
74
|
+
// stderr.
|
|
75
|
+
onerror: (error) => (0, import_log.logError)(`MCP server error: ${error.message}`)
|
|
76
|
+
});
|
|
77
|
+
await new Promise(() => {
|
|
78
|
+
});
|
|
73
79
|
});
|
|
74
|
-
function
|
|
80
|
+
function enabledTools(options) {
|
|
75
81
|
const disabledToolNames = /* @__PURE__ */ new Set();
|
|
76
82
|
for (const toolName of options.disableTools?.split(",") ?? []) {
|
|
77
83
|
const name = toolName.trim();
|
|
@@ -88,6 +94,10 @@ function makeServer(options) {
|
|
|
88
94
|
enabledToolsByName[tool.name] = tool;
|
|
89
95
|
}
|
|
90
96
|
}
|
|
97
|
+
return enabledToolsByName;
|
|
98
|
+
}
|
|
99
|
+
function makeServer(options) {
|
|
100
|
+
const enabledToolsByName = enabledTools(options);
|
|
91
101
|
const mutex = new import_mutex.Mutex();
|
|
92
102
|
const server = new import_server.Server(
|
|
93
103
|
{
|
package/dist/cjs/cli/mcp.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/mcp.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command, Option } from \"@commander-js/extra-typings\";\nimport { oneoffContext } from \"../bundler/context.js\";\nimport { CallToolRequest, Server } from \"@modelcontextprotocol/server\";\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAgC;AAChC,qBAA8B;AAC9B,oBAAwC;AACxC,
|
|
4
|
+
"sourcesContent": ["import { Command, Option } from \"@commander-js/extra-typings\";\nimport { oneoffContext } from \"../bundler/context.js\";\nimport { logError } from \"../bundler/log.js\";\nimport { CallToolRequest, Server } from \"@modelcontextprotocol/server\";\nimport { serveStdio } from \"@modelcontextprotocol/server/stdio\";\nimport { actionDescription } from \"./lib/command.js\";\nimport { checkAuthorization } from \"./lib/login.js\";\nimport {\n McpOptions,\n RequestContext,\n RequestCrash,\n} from \"./lib/mcp/requestContext.js\";\nimport { mcpTool, convexTools, ConvexTool } from \"./lib/mcp/tools/index.js\";\nimport { Mutex } from \"./lib/utils/mutex.js\";\nimport { initializeBigBrainAuth } from \"./lib/deploymentSelection.js\";\n\nconst allToolNames = convexTools.map((t) => t.name).sort();\n\nexport const mcp = new Command(\"mcp\")\n .summary(\"Manage the Model Context Protocol server for Convex [BETA]\")\n .description(\n \"Commands to initialize and run a Model Context Protocol server for Convex that can be used with AI tools.\\n\" +\n \"This server exposes your Convex codebase to AI tools in a structured way.\",\n )\n .allowExcessArguments(false);\n\nmcp\n .command(\"start\")\n .summary(\"Start the MCP server\")\n .description(\n \"Start the Model Context Protocol server for Convex that can be used with AI tools.\",\n )\n .option(\n \"--project-dir <project-dir>\",\n \"Run the MCP server for a single project. By default, the MCP server can run for multiple projects, and each tool call specifies its project directory.\",\n )\n .option(\n \"--disable-tools <tool-names>\",\n `Comma separated list of tool names to disable (options: ${allToolNames.join(\", \")})`,\n )\n .option(\n \"--cautiously-allow-production-pii\",\n \"Allow read-only tools (data, logs, queries) on production deployments. These tools may expose PII. Defaults to false.\",\n false,\n )\n .option(\n \"--dangerously-enable-production-deployments\",\n \"DANGEROUSLY allow the MCP server to access production deployments, including mutating tools. Defaults to false.\",\n false,\n )\n // Deprecated option, we swapped the default. no-op.\n .addOption(\n new Option(\"--disable-production-deployments\")\n .conflicts(\"--dangerously-enable-production-deployments\")\n .hideHelp(),\n )\n .addDeploymentSelectionOptions(actionDescription(\"Run the MCP server on\"))\n .action(async (options) => {\n const ctx = await oneoffContext(options);\n try {\n // `serveStdio` only calls the factory once a client connects, and answers\n // a factory throw with an opaque `-32603`, so reject a bad\n // `--disable-tools` here instead.\n enabledTools(options);\n } catch (error: any) {\n await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n errForSentry: `Failed to start MCP server: ${error}`,\n printedMessage: `Failed to start MCP server: ${error}`,\n });\n }\n // The SDK picks the era from the client's opening message: a request\n // carrying the 2026-07-28 `_meta` envelope pins a stateless connection,\n // while an `initialize` is still served by the same factory over the legacy\n // protocol.\n // The returned handle's `close()` is intentionally never called: the\n // server lives until the client kills the process, and process exit tears\n // the transport down.\n serveStdio(() => makeServer(options), {\n legacy: \"serve\",\n // The only channel for out-of-band failures (transport errors, dropped\n // malformed notifications). stdout carries the protocol, so they go to\n // stderr.\n onerror: (error) => logError(`MCP server error: ${error.message}`),\n });\n // Keep the process running\n await new Promise(() => {});\n });\n\nfunction enabledTools(\n options: McpOptions,\n): Record<string, ConvexTool<any, any>> {\n const disabledToolNames = new Set<string>();\n for (const toolName of options.disableTools?.split(\",\") ?? []) {\n const name = toolName.trim();\n if (!allToolNames.includes(name)) {\n // eslint-disable-next-line no-restricted-syntax\n throw new Error(\n `Disabled tool ${name} not found (valid tools: ${allToolNames.join(\", \")})`,\n );\n }\n disabledToolNames.add(name);\n }\n\n const enabledToolsByName: Record<string, ConvexTool<any, any>> = {};\n for (const tool of convexTools) {\n if (!disabledToolNames.has(tool.name)) {\n enabledToolsByName[tool.name] = tool;\n }\n }\n return enabledToolsByName;\n}\n\nexport function makeServer(options: McpOptions) {\n const enabledToolsByName = enabledTools(options);\n const mutex = new Mutex();\n const server = new Server(\n {\n name: \"Convex MCP Server\",\n version: \"0.0.1\",\n },\n {\n capabilities: {\n tools: {},\n },\n },\n );\n server.setRequestHandler(\"tools/call\", async (request: CallToolRequest) => {\n const ctx = new RequestContext(options);\n await initializeBigBrainAuth(ctx, options);\n try {\n const authorized = await checkAuthorization(ctx, false);\n if (!authorized) {\n await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage:\n \"Not Authorized: Run `npx convex dev` to login to your Convex project.\",\n });\n }\n if (!request.params.arguments) {\n await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage: \"No arguments provided\",\n });\n }\n const convexTool = enabledToolsByName[request.params.name];\n if (!convexTool) {\n await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage: `Tool ${request.params.name} not found`,\n });\n }\n const input = convexTool.inputSchema.parse(request.params.arguments);\n\n // Serialize tool handlers since they're mutating the current working directory.\n const result = await mutex.runExclusive(async () => {\n return await convexTool.handler(ctx, input);\n });\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(result),\n },\n ],\n };\n } catch (error: any) {\n let message: string;\n if (error instanceof RequestCrash) {\n message = error.printedMessage;\n } else if (error instanceof Error) {\n message = error.message;\n } else {\n message = String(error);\n }\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify({ error: message }),\n },\n ],\n isError: true,\n };\n }\n });\n server.setRequestHandler(\"tools/list\", async () => {\n return {\n tools: Object.values(enabledToolsByName).map(mcpTool),\n };\n });\n return server;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAgC;AAChC,qBAA8B;AAC9B,iBAAyB;AACzB,oBAAwC;AACxC,mBAA2B;AAC3B,qBAAkC;AAClC,mBAAmC;AACnC,4BAIO;AACP,mBAAiD;AACjD,mBAAsB;AACtB,iCAAuC;AAEvC,MAAM,eAAe,yBAAY,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK;AAElD,MAAM,MAAM,IAAI,6BAAQ,KAAK,EACjC,QAAQ,4DAA4D,EACpE;AAAA,EACC;AAEF,EACC,qBAAqB,KAAK;AAE7B,IACG,QAAQ,OAAO,EACf,QAAQ,sBAAsB,EAC9B;AAAA,EACC;AACF,EACC;AAAA,EACC;AAAA,EACA;AACF,EACC;AAAA,EACC;AAAA,EACA,2DAA2D,aAAa,KAAK,IAAI,CAAC;AACpF,EACC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACF,EACC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACF,EAEC;AAAA,EACC,IAAI,4BAAO,kCAAkC,EAC1C,UAAU,6CAA6C,EACvD,SAAS;AACd,EACC,kCAA8B,kCAAkB,uBAAuB,CAAC,EACxE,OAAO,OAAO,YAAY;AACzB,QAAM,MAAM,UAAM,8BAAc,OAAO;AACvC,MAAI;AAIF,iBAAa,OAAO;AAAA,EACtB,SAAS,OAAY;AACnB,UAAM,IAAI,MAAM;AAAA,MACd,UAAU;AAAA,MACV,WAAW;AAAA,MACX,cAAc,+BAA+B,KAAK;AAAA,MAClD,gBAAg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;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export const version = \"1.45.0
|
|
4
|
+
"sourcesContent": ["export const version = \"1.45.0\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,UAAU;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/server/impl/actions_impl.ts"],
|
|
4
|
-
"sourcesContent": ["import { convexToJson, jsonToConvex, Value } from \"../../values/index.js\";\nimport { version } from \"../../index.js\";\nimport { performAsyncSyscall } from \"./syscall.js\";\nimport { parseArgs } from \"../../common/index.js\";\nimport { FunctionReference } from \"../../server/api.js\";\nimport { getFunctionAddress } from \"../components/paths.js\";\nimport { validateArg } from \"./validate.js\";\n\nfunction syscallArgs(\n requestId: string,\n functionReference: any,\n args?: Record<string, Value>,\n) {\n const address = getFunctionAddress(functionReference);\n return {\n ...address,\n args: convexToJson(parseArgs(args)),\n version,\n requestId,\n };\n}\n\nexport function setupActionCalls(requestId: string) {\n return {\n runQuery: async (\n query: FunctionReference<\"query\", \"public\" | \"internal\">,\n args?: Record<string, Value>,\n ): Promise<any> => {\n const result = await performAsyncSyscall(\n \"1.0/actions/query\",\n syscallArgs(requestId, query, args),\n );\n return jsonToConvex(result);\n },\n runMutation: async (\n mutation: FunctionReference<\"mutation\", \"public\" | \"internal\">,\n args?: Record<string, Value>,\n ): Promise<any> => {\n const result = await performAsyncSyscall(\n \"1.0/actions/mutation\",\n syscallArgs(requestId, mutation, args),\n );\n return jsonToConvex(result);\n },\n runAction: async (\n action: FunctionReference<\"action\", \"public\" | \"internal\">,\n args?: Record<string, Value>,\n ): Promise<any> => {\n const result = await performAsyncSyscall(\n \"1.0/actions/action\",\n syscallArgs(requestId, action, args),\n );\n return jsonToConvex(result);\n },\n };\n}\n\n/**\n * Get a short-lived credential for calling a Convex-managed service.\n *\n * This function can only be called while an action is running. The credential\n * is scoped to the current deployment and should be sent as a bearer token.\n * Repeated calls in the same action reuse one token; a failed mint is not\n * cached, so a later call retries.\n *\n * @param service - The service the credential may access.\n * @
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAkD;AAClD,eAAwB;AACxB,qBAAoC;AACpC,oBAA0B;AAE1B,mBAAmC;AACnC,sBAA4B;AAE5B,SAAS,YACP,WACA,mBACA,MACA;AACA,QAAM,cAAU,iCAAmB,iBAAiB;AACpD,SAAO;AAAA,IACL,GAAG;AAAA,IACH,UAAM,gCAAa,yBAAU,IAAI,CAAC;AAAA,IAClC;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,iBAAiB,WAAmB;AAClD,SAAO;AAAA,IACL,UAAU,OACR,OACA,SACiB;AACjB,YAAM,SAAS,UAAM;AAAA,QACnB;AAAA,QACA,YAAY,WAAW,OAAO,IAAI;AAAA,MACpC;AACA,iBAAO,4BAAa,MAAM;AAAA,IAC5B;AAAA,IACA,aAAa,OACX,UACA,SACiB;AACjB,YAAM,SAAS,UAAM;AAAA,QACnB;AAAA,QACA,YAAY,WAAW,UAAU,IAAI;AAAA,MACvC;AACA,iBAAO,4BAAa,MAAM;AAAA,IAC5B;AAAA,IACA,WAAW,OACT,QACA,SACiB;AACjB,YAAM,SAAS,UAAM;AAAA,QACnB;AAAA,QACA,YAAY,WAAW,QAAQ,IAAI;AAAA,MACrC;AACA,iBAAO,4BAAa,MAAM;AAAA,IAC5B;AAAA,EACF;AACF;
|
|
4
|
+
"sourcesContent": ["import { convexToJson, jsonToConvex, Value } from \"../../values/index.js\";\nimport { version } from \"../../index.js\";\nimport { performAsyncSyscall } from \"./syscall.js\";\nimport { parseArgs } from \"../../common/index.js\";\nimport { FunctionReference } from \"../../server/api.js\";\nimport { getFunctionAddress } from \"../components/paths.js\";\nimport { validateArg } from \"./validate.js\";\n\nfunction syscallArgs(\n requestId: string,\n functionReference: any,\n args?: Record<string, Value>,\n) {\n const address = getFunctionAddress(functionReference);\n return {\n ...address,\n args: convexToJson(parseArgs(args)),\n version,\n requestId,\n };\n}\n\nexport function setupActionCalls(requestId: string) {\n return {\n runQuery: async (\n query: FunctionReference<\"query\", \"public\" | \"internal\">,\n args?: Record<string, Value>,\n ): Promise<any> => {\n const result = await performAsyncSyscall(\n \"1.0/actions/query\",\n syscallArgs(requestId, query, args),\n );\n return jsonToConvex(result);\n },\n runMutation: async (\n mutation: FunctionReference<\"mutation\", \"public\" | \"internal\">,\n args?: Record<string, Value>,\n ): Promise<any> => {\n const result = await performAsyncSyscall(\n \"1.0/actions/mutation\",\n syscallArgs(requestId, mutation, args),\n );\n return jsonToConvex(result);\n },\n runAction: async (\n action: FunctionReference<\"action\", \"public\" | \"internal\">,\n args?: Record<string, Value>,\n ): Promise<any> => {\n const result = await performAsyncSyscall(\n \"1.0/actions/action\",\n syscallArgs(requestId, action, args),\n );\n return jsonToConvex(result);\n },\n };\n}\n\n/**\n * Get a short-lived credential for calling a Convex-managed service.\n *\n * This function can only be called while an action is running. The credential\n * is scoped to the current deployment and should be sent as a bearer token.\n * Repeated calls in the same action reuse one token; a failed mint is not\n * cached, so a later call retries.\n *\n * @param service - The service the credential may access.\n * @returns A JWT to send as `Authorization: Bearer <token>`. Keep it inside\n * the action: don't return it to clients or store it in environment\n * variables.\n */\nexport async function getServiceToken(service: \"ai-gateway\"): Promise<string> {\n validateArg(service, 1, \"getServiceToken\", \"service\");\n if (service !== \"ai-gateway\") {\n throw new Error(`Unsupported service \"${String(service)}\"`);\n }\n return await performAsyncSyscall(\"1.0/createServiceToken\", {\n service,\n version,\n });\n}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/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Utilities for implementing server-side Convex query and mutation functions.\n *\n * ## Usage\n *\n * ### Code Generation\n *\n * This module is typically used alongside generated server code.\n *\n * To generate the server code, run `npx convex dev` in your Convex project.\n * This will create a `convex/_generated/server.js` file with the following\n * functions, typed for your schema:\n * - [query](https://docs.convex.dev/generated-api/server#query)\n * - [mutation](https://docs.convex.dev/generated-api/server#mutation)\n *\n * If you aren't using TypeScript and code generation, you can use these untyped\n * functions instead:\n * - {@link queryGeneric}\n * - {@link mutationGeneric}\n *\n * ### Example\n *\n * Convex functions are defined by using either the `query` or\n * `mutation` wrappers.\n *\n * Queries receive a `db` that implements the {@link GenericDatabaseReader} interface.\n *\n * ```js\n * import { query } from \"./_generated/server\";\n *\n * export default query({\n * handler: async ({ db }, { arg1, arg2 }) => {\n * // Your (read-only) code here!\n * },\n * });\n * ```\n *\n * If your function needs to write to the database, such as inserting, updating,\n * or deleting documents, use `mutation` instead which provides a `db` that\n * implements the {@link GenericDatabaseWriter} interface.\n *\n * ```js\n * import { mutation } from \"./_generated/server\";\n *\n * export default mutation({\n * handler: async ({ db }, { arg1, arg2 }) => {\n * // Your mutation code here!\n * },\n * });\n * ```\n * @module\n */\n\nexport type {\n Auth,\n AuthConfig,\n AuthProvider,\n UserIdentity,\n UserIdentityAttributes,\n} from \"./authentication.js\";\nexport * from \"./database.js\";\nexport type {\n GenericDocument,\n GenericFieldPaths,\n GenericIndexFields,\n GenericTableIndexes,\n GenericSearchIndexConfig,\n GenericTableSearchIndexes,\n GenericVectorIndexConfig,\n GenericTableVectorIndexes,\n FieldTypeFromFieldPath,\n FieldTypeFromFieldPathInner,\n GenericTableInfo,\n DocumentByInfo,\n FieldPaths,\n Indexes,\n IndexNames,\n NamedIndex,\n SearchIndexes,\n SearchIndexNames,\n NamedSearchIndex,\n VectorIndexes,\n VectorIndexNames,\n NamedVectorIndex,\n GenericDataModel,\n AnyDataModel,\n TableNamesInDataModel,\n NamedTableInfo,\n DocumentByName,\n} from \"./data_model.js\";\n\nexport type {\n Expression,\n ExpressionOrValue,\n FilterBuilder,\n} from \"./filter_builder.js\";\nexport {\n actionGeneric,\n httpActionGeneric,\n mutationGeneric,\n queryGeneric,\n internalActionGeneric,\n internalMutationGeneric,\n internalQueryGeneric,\n} from \"./impl/registration_impl.js\";\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4DA,2BAAc,0BA5Dd;AAgGA,+BAQO;
|
|
4
|
+
"sourcesContent": ["/**\n * Utilities for implementing server-side Convex query and mutation functions.\n *\n * ## Usage\n *\n * ### Code Generation\n *\n * This module is typically used alongside generated server code.\n *\n * To generate the server code, run `npx convex dev` in your Convex project.\n * This will create a `convex/_generated/server.js` file with the following\n * functions, typed for your schema:\n * - [query](https://docs.convex.dev/generated-api/server#query)\n * - [mutation](https://docs.convex.dev/generated-api/server#mutation)\n *\n * If you aren't using TypeScript and code generation, you can use these untyped\n * functions instead:\n * - {@link queryGeneric}\n * - {@link mutationGeneric}\n *\n * ### Example\n *\n * Convex functions are defined by using either the `query` or\n * `mutation` wrappers.\n *\n * Queries receive a `db` that implements the {@link GenericDatabaseReader} interface.\n *\n * ```js\n * import { query } from \"./_generated/server\";\n *\n * export default query({\n * handler: async ({ db }, { arg1, arg2 }) => {\n * // Your (read-only) code here!\n * },\n * });\n * ```\n *\n * If your function needs to write to the database, such as inserting, updating,\n * or deleting documents, use `mutation` instead which provides a `db` that\n * implements the {@link GenericDatabaseWriter} interface.\n *\n * ```js\n * import { mutation } from \"./_generated/server\";\n *\n * export default mutation({\n * handler: async ({ db }, { arg1, arg2 }) => {\n * // Your mutation code here!\n * },\n * });\n * ```\n * @module\n */\n\nexport type {\n Auth,\n AuthConfig,\n AuthProvider,\n UserIdentity,\n UserIdentityAttributes,\n} from \"./authentication.js\";\nexport * from \"./database.js\";\nexport type {\n GenericDocument,\n GenericFieldPaths,\n GenericIndexFields,\n GenericTableIndexes,\n GenericSearchIndexConfig,\n GenericTableSearchIndexes,\n GenericVectorIndexConfig,\n GenericTableVectorIndexes,\n FieldTypeFromFieldPath,\n FieldTypeFromFieldPathInner,\n GenericTableInfo,\n DocumentByInfo,\n FieldPaths,\n Indexes,\n IndexNames,\n NamedIndex,\n SearchIndexes,\n SearchIndexNames,\n NamedSearchIndex,\n VectorIndexes,\n VectorIndexNames,\n NamedVectorIndex,\n GenericDataModel,\n AnyDataModel,\n TableNamesInDataModel,\n NamedTableInfo,\n DocumentByName,\n} from \"./data_model.js\";\n\nexport type {\n Expression,\n ExpressionOrValue,\n FilterBuilder,\n} from \"./filter_builder.js\";\nexport {\n actionGeneric,\n httpActionGeneric,\n mutationGeneric,\n queryGeneric,\n internalActionGeneric,\n internalMutationGeneric,\n internalQueryGeneric,\n} from \"./impl/registration_impl.js\";\nexport { getServiceToken } from \"./impl/actions_impl.js\";\nexport type {\n TransactionMetric,\n TransactionMetrics,\n TransactionLimits,\n FunctionMetadata,\n DeploymentMetadata,\n RequestMetadata,\n QueryMeta,\n MutationMeta,\n ActionMeta,\n} from \"./meta.js\";\nexport type { IndexRange, IndexRangeBuilder } from \"./index_range_builder.js\";\nexport * from \"./pagination.js\";\nexport type { OrderedQuery, Query, QueryInitializer } from \"./query.js\";\nexport type {\n AdvancedRunQueryOptions,\n ArgsArray,\n DefaultFunctionArgs,\n FunctionVisibility,\n ActionBuilder,\n MutationBuilder,\n MutationBuilderWithTable,\n QueryBuilder,\n QueryBuilderWithTable,\n HttpActionBuilder,\n GenericActionCtx,\n GenericMutationCtx,\n GenericMutationCtxWithTable,\n GenericQueryCtx,\n GenericQueryCtxWithTable,\n RegisteredAction,\n RegisteredMutation,\n RegisteredQuery,\n PublicHttpAction,\n UnvalidatedFunction,\n ValidatedFunction,\n ReturnValueForOptionalValidator,\n ArgsArrayForOptionalValidator,\n ArgsArrayToObject,\n DefaultArgsForOptionalValidator,\n} from \"./registration.js\";\nexport * from \"./search_filter_builder.js\";\nexport * from \"./storage.js\";\nexport type { Scheduler, SchedulableFunctionReference } from \"./scheduler.js\";\nexport { cronJobs } from \"./cron.js\";\nexport type { CronJob, Crons } from \"./cron.js\";\nexport type {\n SystemFields,\n IdField,\n WithoutSystemFields,\n WithOptionalSystemFields,\n SystemIndexes,\n IndexTiebreakerField,\n} from \"./system_fields.js\";\nexport { httpRouter, HttpRouter, ROUTABLE_HTTP_METHODS } from \"./router.js\";\nexport type {\n RoutableMethod,\n RouteSpec,\n RouteSpecWithPath,\n RouteSpecWithPathPrefix,\n} from \"./router.js\";\nexport {\n anyApi,\n getFunctionName,\n makeFunctionReference,\n filterApi,\n} from \"./api.js\";\nexport type {\n ApiFromModules,\n AnyApi,\n FilterApi,\n FunctionType,\n FunctionReference,\n FunctionArgs,\n OptionalRestArgs,\n PartialApi,\n ArgsAndOptions,\n FunctionReturnType,\n ValidatorTypeToReturnType,\n} from \"./api.js\";\nexport {\n defineApp,\n defineComponent,\n componentsGeneric,\n createFunctionHandle,\n type AnyChildComponents,\n type EnvDefinition,\n type EnvFromDefinition,\n type EnvFromAppDefinition,\n type AppDefinition,\n} from \"./components/index.js\";\n/**\n * @internal\n */\nexport { currentSystemUdfInComponent } from \"./components/index.js\";\nexport { getFunctionAddress } from \"./components/index.js\";\nexport type {\n ComponentDefinition,\n AnyComponents,\n FunctionHandle,\n} from \"./components/index.js\";\n\n/**\n * @internal\n */\nexport type { Index, SearchIndex, VectorIndex } from \"./schema.js\";\n\nexport { log } from \"./log.js\";\nexport type { AuditLogBody, AuditLogValue } from \"./audit_logging.js\";\n\nexport type {\n SearchIndexConfig,\n VectorIndexConfig,\n TableDefinition,\n SchemaDefinition,\n DefineSchemaOptions,\n GenericSchema,\n DataModelFromSchemaDefinition,\n SystemDataModel,\n SystemTableNames,\n DocValidator,\n SystemFieldValidators,\n} from \"./schema.js\";\nexport { defineTable, defineSchema, docValidator } from \"./schema.js\";\n\nexport type {\n VectorSearch,\n VectorSearchQuery,\n VectorFilterBuilder,\n FilterExpression,\n} from \"./vector_search.js\";\n\n/**\n * @public\n */\nexport type { BetterOmit, Expand } from \"../type_utils.js\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4DA,2BAAc,0BA5Dd;AAgGA,+BAQO;AACP,0BAAgC;AAahC,2BAAc,4BAtHd;AAmJA,2BAAc,uCAnJd;AAoJA,2BAAc,yBApJd;AAsJA,kBAAyB;AAUzB,oBAA8D;AAO9D,iBAKO;AAcP,wBAUO;AAIP,IAAAA,qBAA4C;AAC5C,IAAAA,qBAAmC;AAYnC,iBAAoB;AAgBpB,oBAAwD;",
|
|
6
6
|
"names": ["import_components"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAmB,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAIvE,OAAO,EACL,UAAU,EAGX,MAAM,6BAA6B,CAAC;AAOrC,eAAO,MAAM,GAAG,qBAMc,CAAC;AA0F/B,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,UAkF7C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.45.0
|
|
1
|
+
export declare const version = "1.45.0";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
|
|
@@ -5,4 +5,18 @@ export declare function setupActionCalls(requestId: string): {
|
|
|
5
5
|
runMutation: (mutation: FunctionReference<"mutation", "public" | "internal">, args?: Record<string, Value>) => Promise<any>;
|
|
6
6
|
runAction: (action: FunctionReference<"action", "public" | "internal">, args?: Record<string, Value>) => Promise<any>;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Get a short-lived credential for calling a Convex-managed service.
|
|
10
|
+
*
|
|
11
|
+
* This function can only be called while an action is running. The credential
|
|
12
|
+
* is scoped to the current deployment and should be sent as a bearer token.
|
|
13
|
+
* Repeated calls in the same action reuse one token; a failed mint is not
|
|
14
|
+
* cached, so a later call retries.
|
|
15
|
+
*
|
|
16
|
+
* @param service - The service the credential may access.
|
|
17
|
+
* @returns A JWT to send as `Authorization: Bearer <token>`. Keep it inside
|
|
18
|
+
* the action: don't return it to clients or store it in environment
|
|
19
|
+
* variables.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getServiceToken(service: "ai-gateway"): Promise<string>;
|
|
8
22
|
//# sourceMappingURL=actions_impl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions_impl.d.ts","sourceRoot":"","sources":["../../../../src/server/impl/actions_impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAI1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAkBxD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM;sBAGrC,kBAAkB,OAAO,EAAE,QAAQ,GAAG,UAAU,CAAC,SACjD,OAAO,MAAM,EAAE,KAAK,CAAC,KAC3B,QAAQ,GAAG,CAAC;4BAQH,kBAAkB,UAAU,EAAE,QAAQ,GAAG,UAAU,CAAC,SACvD,OAAO,MAAM,EAAE,KAAK,CAAC,KAC3B,QAAQ,GAAG,CAAC;wBAQL,kBAAkB,QAAQ,EAAE,QAAQ,GAAG,UAAU,CAAC,SACnD,OAAO,MAAM,EAAE,KAAK,CAAC,KAC3B,QAAQ,GAAG,CAAC;EAQlB"}
|
|
1
|
+
{"version":3,"file":"actions_impl.d.ts","sourceRoot":"","sources":["../../../../src/server/impl/actions_impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAI1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAkBxD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM;sBAGrC,kBAAkB,OAAO,EAAE,QAAQ,GAAG,UAAU,CAAC,SACjD,OAAO,MAAM,EAAE,KAAK,CAAC,KAC3B,QAAQ,GAAG,CAAC;4BAQH,kBAAkB,UAAU,EAAE,QAAQ,GAAG,UAAU,CAAC,SACvD,OAAO,MAAM,EAAE,KAAK,CAAC,KAC3B,QAAQ,GAAG,CAAC;wBAQL,kBAAkB,QAAQ,EAAE,QAAQ,GAAG,UAAU,CAAC,SACnD,OAAO,MAAM,EAAE,KAAK,CAAC,KAC3B,QAAQ,GAAG,CAAC;EAQlB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAS5E"}
|
|
@@ -55,6 +55,7 @@ export * from "./database.js";
|
|
|
55
55
|
export type { GenericDocument, GenericFieldPaths, GenericIndexFields, GenericTableIndexes, GenericSearchIndexConfig, GenericTableSearchIndexes, GenericVectorIndexConfig, GenericTableVectorIndexes, FieldTypeFromFieldPath, FieldTypeFromFieldPathInner, GenericTableInfo, DocumentByInfo, FieldPaths, Indexes, IndexNames, NamedIndex, SearchIndexes, SearchIndexNames, NamedSearchIndex, VectorIndexes, VectorIndexNames, NamedVectorIndex, GenericDataModel, AnyDataModel, TableNamesInDataModel, NamedTableInfo, DocumentByName, } from "./data_model.js";
|
|
56
56
|
export type { Expression, ExpressionOrValue, FilterBuilder, } from "./filter_builder.js";
|
|
57
57
|
export { actionGeneric, httpActionGeneric, mutationGeneric, queryGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, } from "./impl/registration_impl.js";
|
|
58
|
+
export { getServiceToken } from "./impl/actions_impl.js";
|
|
58
59
|
export type { TransactionMetric, TransactionMetrics, TransactionLimits, FunctionMetadata, DeploymentMetadata, RequestMetadata, QueryMeta, MutationMeta, ActionMeta, } from "./meta.js";
|
|
59
60
|
export type { IndexRange, IndexRangeBuilder } from "./index_range_builder.js";
|
|
60
61
|
export * from "./pagination.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,YAAY,EACV,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,YAAY,EACV,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,e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