@brickkit/core 0.16.0-beta.2 → 0.16.0-beta.3
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/dist/chunks/client.d.ts +1 -1
- package/dist/chunks/server.d.ts +28 -2
- package/dist/chunks/server.js +229 -10
- package/dist/chunks/server.js.map +1 -1
- package/dist/chunks/types.d.ts +11 -1
- package/dist/client.d.ts +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +2 -137
- package/dist/index.js.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/workflow.d.ts +1 -1
- package/package.json +1 -1
package/dist/chunks/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as BrickSocketClient,
|
|
1
|
+
import { $ as BrickSocketClient, Q as BrickClientSocket, Rt as StandardErrorCode, ai as HttpMethod, c as ActionExecutionError, s as ActionErrorDefinition, t as Action, tt as BrickSocketConnectOptions } from "./types.js";
|
|
2
2
|
import { Static, TSchema } from "@sinclair/typebox";
|
|
3
3
|
/**
|
|
4
4
|
* The URL segment for a declared name: `orderBilling` becomes `order-billing`,
|
package/dist/chunks/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fn as ServicePort, Mt as DashboardUser, O as Logger, Qr as SecretSource, Ut as Sensitivity, V as Service, Z as ValidationErrorItem, _t as EventsDefinition, ai as HttpMethod, gn as InstalledPlugin, lt as SocketBroker, ot as BrickSocketSchema, qt as DatabaseHandle, rr as PluginInstance, t as Action, vt as EventsHub, wt as ClientIp, xr as EventsOptions } from "./types.js";
|
|
2
2
|
import { Elysia } from "elysia";
|
|
3
3
|
type RouteMethod = HttpMethod;
|
|
4
4
|
/** How a string from a query or form field becomes the schema's type; objects travel as JSON. */
|
|
@@ -164,7 +164,33 @@ interface DashboardOptions {
|
|
|
164
164
|
* in (by token, or by `authorize` returning `true`) can only look.
|
|
165
165
|
*/
|
|
166
166
|
inspector?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Let a coding agent (Claude Code, Cursor, Codex) read the dashboard's data
|
|
169
|
+
* over MCP at `/mcp`, while it debugs: requests, traces, logs, errors and the
|
|
170
|
+
* app's architecture. Default false; `brick dev` always has it, since it only
|
|
171
|
+
* listens on this machine. Its own tools only read, even for a signed-in
|
|
172
|
+
* user, and it passes the same checks as the rest of the dashboard: the agent sends
|
|
173
|
+
* `Authorization: Bearer <token>` with one of `auth.token`.
|
|
174
|
+
*
|
|
175
|
+
* What the agent reads goes to its model provider: request paths and
|
|
176
|
+
* messages, log lines (which can hold what your users typed), error stacks,
|
|
177
|
+
* and span attributes such as SQL text. Turn it on only for a dashboard
|
|
178
|
+
* whose data you are willing to send there.
|
|
179
|
+
*
|
|
180
|
+
* It also serves the app's own tools marked `dashboard: true` (see
|
|
181
|
+
* `service.tool`), next to the dashboard's. A tool that is not marked
|
|
182
|
+
* `readOnlyHint: true` can change data, and is offered only to a signed-in
|
|
183
|
+
* user (one `auth.authorize` returned as `{ user }`).
|
|
184
|
+
*/
|
|
185
|
+
mcp?: boolean;
|
|
167
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Where the app answers MCP for the dashboard's `/mcp`: its tools marked
|
|
189
|
+
* `dashboard: true`. Only a request signed by the dashboard gets in.
|
|
190
|
+
*/
|
|
191
|
+
declare const DASHBOARD_MCP_ROUTE = "/_brick/dashboard/mcp";
|
|
192
|
+
/** The dashboard's own MCP tools. A `dashboard: true` tool may not take one of these names. */
|
|
193
|
+
declare const DASHBOARD_MCP_TOOLS: readonly ["summary", "list_requests", "get_trace", "list_errors", "app_overview", "search_logs", "list_reloads", "list_schedules", "list_runs", "get_run", "get_openapi", "list_docs", "read_doc"];
|
|
168
194
|
type EndpointMethod = HttpMethod;
|
|
169
195
|
/** The logger handed to endpoint handlers (the same one actions get). */
|
|
170
196
|
type EndpointLogger = Logger;
|
|
@@ -473,4 +499,4 @@ interface CreateServerOptions {
|
|
|
473
499
|
* });
|
|
474
500
|
*/
|
|
475
501
|
declare function brick(options?: CreateServerOptions): BrickApp;
|
|
476
|
-
export {
|
|
502
|
+
export { referencePlugin as A, DashboardAuth as C, OpenApiDocument as D, DocumentationOptions as E, RouteMethod as F, scalarDocsHTML as M, BrickIR as N, ReferenceDocument as O, RouteIR as P, DASHBOARD_MCP_TOOLS as S, ApiDocument as T, EndpointContext as _, RequestLoggingOptions as a, EndpointMethod as b, CompiledRoute as c, loadCompiledBrickApp as d, CompiledHandler as f, BrickApp as g, deny as h, CorsOrigin as i, registerReferenceRoute as j, ReferenceOptions as k, bindCompiledApplication as l, HandlerFactory as m, brick as n, requestLoggingPlugin as o, CompiledRoutePlan as p, CorsOptions as r, CompiledApplication as s, CreateServerOptions as t, compileBrickApplication as u, EndpointDefinition as v, DashboardOptions as w, DASHBOARD_MCP_ROUTE as x, EndpointLogger as y };
|
package/dist/chunks/server.js
CHANGED
|
@@ -983,15 +983,18 @@ function markDashboardArrival(request) {
|
|
|
983
983
|
arrivedAt.set(request, Date.now());
|
|
984
984
|
}
|
|
985
985
|
const mac$1 = (payload) => createHmac("sha256", dashboardKey()).update(payload).digest();
|
|
986
|
-
|
|
987
|
-
function signDashboardIdentity(identity, now = Date.now()) {
|
|
986
|
+
const sign = (claims, now) => {
|
|
988
987
|
const payload = Buffer.from(JSON.stringify({
|
|
989
|
-
|
|
988
|
+
...claims,
|
|
990
989
|
exp: now + SIGNATURE_TTL_MS
|
|
991
990
|
})).toString("base64url");
|
|
992
991
|
return `${payload}.${mac$1(payload).toString("base64url")}`;
|
|
992
|
+
};
|
|
993
|
+
/** The header value for an identity: `<base64url(json)>.<hmac>`. */
|
|
994
|
+
function signDashboardIdentity(identity, now = Date.now()) {
|
|
995
|
+
return sign({ user: identity.user }, now);
|
|
993
996
|
}
|
|
994
|
-
function
|
|
997
|
+
function verifiedClaims(request) {
|
|
995
998
|
const header = request?.headers.get(DASHBOARD_IDENTITY_HEADER);
|
|
996
999
|
if (!header) return void 0;
|
|
997
1000
|
const dot = header.indexOf(".");
|
|
@@ -1001,14 +1004,40 @@ function dashboardIdentity(request) {
|
|
|
1001
1004
|
const expected = mac$1(payload);
|
|
1002
1005
|
if (given.length !== expected.length || !timingSafeEqual(given, expected)) return void 0;
|
|
1003
1006
|
try {
|
|
1004
|
-
const
|
|
1007
|
+
const claims = JSON.parse(Buffer.from(payload, "base64url").toString("utf8"));
|
|
1005
1008
|
const now = (request && arrivedAt.get(request)) ?? Date.now();
|
|
1006
|
-
if (typeof exp !== "number" || exp < now) return void 0;
|
|
1007
|
-
return
|
|
1009
|
+
if (typeof claims?.exp !== "number" || claims.exp < now) return void 0;
|
|
1010
|
+
return claims;
|
|
1008
1011
|
} catch {
|
|
1009
1012
|
return;
|
|
1010
1013
|
}
|
|
1011
1014
|
}
|
|
1015
|
+
/** A signature made for the MCP route carries a `scope`, and is not an identity here. */
|
|
1016
|
+
function dashboardIdentity(request) {
|
|
1017
|
+
const claims = verifiedClaims(request);
|
|
1018
|
+
if (!claims || claims.scope !== void 0) return void 0;
|
|
1019
|
+
return claims.user === void 0 ? {} : { user: claims.user };
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* The header value for a call the dashboard's `/mcp` forwards to the app. It is
|
|
1023
|
+
* scoped to the MCP route: the `/app` proxy never signs one, and a signature
|
|
1024
|
+
* made for `/app` is not accepted there.
|
|
1025
|
+
*/
|
|
1026
|
+
function signDashboardMcp(caller, now = Date.now()) {
|
|
1027
|
+
return sign({
|
|
1028
|
+
user: caller.user,
|
|
1029
|
+
scope: "mcp",
|
|
1030
|
+
write: caller.write
|
|
1031
|
+
}, now);
|
|
1032
|
+
}
|
|
1033
|
+
function dashboardMcpCaller(request) {
|
|
1034
|
+
const claims = verifiedClaims(request);
|
|
1035
|
+
if (claims?.scope !== "mcp") return void 0;
|
|
1036
|
+
return {
|
|
1037
|
+
...claims.user === void 0 ? {} : { user: claims.user },
|
|
1038
|
+
write: claims.write === true
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1012
1041
|
/**
|
|
1013
1042
|
* The dashboard user a request came from, for an endpoint: the person
|
|
1014
1043
|
* `dashboard.auth.authorize` let in, when the request arrived through the
|
|
@@ -4753,6 +4782,27 @@ function swaggerDocsHTML(specUrl, title) {
|
|
|
4753
4782
|
</html>`;
|
|
4754
4783
|
}
|
|
4755
4784
|
// src/dashboard.ts
|
|
4785
|
+
/**
|
|
4786
|
+
* Where the app answers MCP for the dashboard's `/mcp`: its tools marked
|
|
4787
|
+
* `dashboard: true`. Only a request signed by the dashboard gets in.
|
|
4788
|
+
*/
|
|
4789
|
+
const DASHBOARD_MCP_ROUTE = "/_brick/dashboard/mcp";
|
|
4790
|
+
/** The dashboard's own MCP tools. A `dashboard: true` tool may not take one of these names. */
|
|
4791
|
+
const DASHBOARD_MCP_TOOLS = [
|
|
4792
|
+
"summary",
|
|
4793
|
+
"list_requests",
|
|
4794
|
+
"get_trace",
|
|
4795
|
+
"list_errors",
|
|
4796
|
+
"app_overview",
|
|
4797
|
+
"search_logs",
|
|
4798
|
+
"list_reloads",
|
|
4799
|
+
"list_schedules",
|
|
4800
|
+
"list_runs",
|
|
4801
|
+
"get_run",
|
|
4802
|
+
"get_openapi",
|
|
4803
|
+
"list_docs",
|
|
4804
|
+
"read_doc"
|
|
4805
|
+
];
|
|
4756
4806
|
const MIN_TOKEN_LENGTH = 16;
|
|
4757
4807
|
/**
|
|
4758
4808
|
* Check what `brick()` was given, and freeze it. The secrets sit behind a getter
|
|
@@ -4761,16 +4811,18 @@ const MIN_TOKEN_LENGTH = 16;
|
|
|
4761
4811
|
*/
|
|
4762
4812
|
function normalizeDashboard(options) {
|
|
4763
4813
|
if (options === void 0) return void 0;
|
|
4764
|
-
const { port, host, auth, historyDays, inspector } = options;
|
|
4814
|
+
const { port, host, auth, historyDays, inspector, mcp } = options;
|
|
4765
4815
|
if (port !== void 0 && (!Number.isInteger(port) || port < 1 || port > 65535)) throw new Error(`Brick: dashboard port must be an integer from 1 to 65535, not ${String(port)}.`);
|
|
4766
4816
|
if (host !== void 0 && (typeof host !== "string" || host.trim() === "")) throw new Error("Brick: dashboard host must be an address, such as '0.0.0.0'.");
|
|
4767
4817
|
if (historyDays !== void 0 && (!Number.isInteger(historyDays) || historyDays < 0)) throw new Error(`Brick: dashboard historyDays must be a whole number of days, not ${String(historyDays)}.`);
|
|
4768
4818
|
if (inspector !== void 0 && typeof inspector !== "boolean") throw new Error("Brick: dashboard inspector must be true or false.");
|
|
4819
|
+
if (mcp !== void 0 && typeof mcp !== "boolean") throw new Error("Brick: dashboard mcp must be true or false.");
|
|
4769
4820
|
const normalized = {
|
|
4770
4821
|
...port !== void 0 ? { port } : {},
|
|
4771
4822
|
...host !== void 0 ? { host: host.trim() } : {},
|
|
4772
4823
|
...historyDays !== void 0 ? { historyDays } : {},
|
|
4773
|
-
...inspector !== void 0 ? { inspector } : {}
|
|
4824
|
+
...inspector !== void 0 ? { inspector } : {},
|
|
4825
|
+
...mcp !== void 0 ? { mcp } : {}
|
|
4774
4826
|
};
|
|
4775
4827
|
if (auth !== void 0) {
|
|
4776
4828
|
const tokens = auth.token === void 0 ? void 0 : typeof auth.token === "string" ? [auth.token] : [...auth.token];
|
|
@@ -4788,6 +4840,141 @@ function normalizeDashboard(options) {
|
|
|
4788
4840
|
}
|
|
4789
4841
|
return Object.freeze(normalized);
|
|
4790
4842
|
}
|
|
4843
|
+
// src/mcp.ts
|
|
4844
|
+
var UnknownToolError = class extends Error {
|
|
4845
|
+
constructor(name) {
|
|
4846
|
+
super(`unknown tool: ${name}`);
|
|
4847
|
+
this.name = "UnknownToolError";
|
|
4848
|
+
}
|
|
4849
|
+
};
|
|
4850
|
+
/** Collect only explicitly defined tools, without exposing ordinary actions. */
|
|
4851
|
+
function createMcpRegistry(options) {
|
|
4852
|
+
function toolsByName() {
|
|
4853
|
+
const tools = /* @__PURE__ */ new Map();
|
|
4854
|
+
for (const tool of [...options.tools ?? [], ...(options.services ?? []).flatMap((service) => service.listTools())]) {
|
|
4855
|
+
const existing = tools.get(tool.name);
|
|
4856
|
+
if (existing && existing !== tool) throw new DuplicateNameError(`Duplicate MCP tool: ${tool.name}`);
|
|
4857
|
+
tools.set(tool.name, tool);
|
|
4858
|
+
}
|
|
4859
|
+
return tools;
|
|
4860
|
+
}
|
|
4861
|
+
toolsByName();
|
|
4862
|
+
return {
|
|
4863
|
+
listTools: () => Array.from(toolsByName().values(), (tool) => ({
|
|
4864
|
+
name: tool.name,
|
|
4865
|
+
...tool.config.title ?? tool.config.annotations?.title ? { title: tool.config.title ?? tool.config.annotations?.title } : {},
|
|
4866
|
+
description: tool.config.description ?? "",
|
|
4867
|
+
inputSchema: tool.config.input ?? {
|
|
4868
|
+
type: "object",
|
|
4869
|
+
properties: {},
|
|
4870
|
+
additionalProperties: false
|
|
4871
|
+
},
|
|
4872
|
+
...tool.config.output ? { outputSchema: outputSchema(tool.config.output) } : {},
|
|
4873
|
+
annotations: tool.config.annotations ?? {}
|
|
4874
|
+
})),
|
|
4875
|
+
async callTool(name, args = {}, ctx) {
|
|
4876
|
+
const tool = toolsByName().get(name);
|
|
4877
|
+
if (!tool) throw new UnknownToolError(name);
|
|
4878
|
+
return tool({
|
|
4879
|
+
input: args,
|
|
4880
|
+
ctx
|
|
4881
|
+
});
|
|
4882
|
+
}
|
|
4883
|
+
};
|
|
4884
|
+
}
|
|
4885
|
+
const WRAP_RESULT = "x-brick-wrap-result";
|
|
4886
|
+
function outputSchema(schema) {
|
|
4887
|
+
return schema.type === "object" ? schema : {
|
|
4888
|
+
type: "object",
|
|
4889
|
+
properties: { result: schema },
|
|
4890
|
+
required: ["result"],
|
|
4891
|
+
[WRAP_RESULT]: true
|
|
4892
|
+
};
|
|
4893
|
+
}
|
|
4894
|
+
function result(id, value) {
|
|
4895
|
+
return Response.json({
|
|
4896
|
+
jsonrpc: "2.0",
|
|
4897
|
+
id,
|
|
4898
|
+
result: value
|
|
4899
|
+
});
|
|
4900
|
+
}
|
|
4901
|
+
function rpcError(id, code, message) {
|
|
4902
|
+
return Response.json({
|
|
4903
|
+
jsonrpc: "2.0",
|
|
4904
|
+
id,
|
|
4905
|
+
error: {
|
|
4906
|
+
code,
|
|
4907
|
+
message
|
|
4908
|
+
}
|
|
4909
|
+
});
|
|
4910
|
+
}
|
|
4911
|
+
function isRecord(value) {
|
|
4912
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
4913
|
+
}
|
|
4914
|
+
/** Stateless MCP JSON-RPC POST handler. Wrap with the app's authentication. */
|
|
4915
|
+
function createMcpHandler(options) {
|
|
4916
|
+
const versions = options.protocolVersions ?? ["2025-06-18"];
|
|
4917
|
+
if (!versions.length) throw new Error("At least one MCP protocol version is required");
|
|
4918
|
+
return async (request, ctx) => {
|
|
4919
|
+
if (request.method !== "POST") return new Response(null, {
|
|
4920
|
+
status: 405,
|
|
4921
|
+
headers: { Allow: "POST" }
|
|
4922
|
+
});
|
|
4923
|
+
if (options.clientIp) withClientIp(request, options.clientIp);
|
|
4924
|
+
let body;
|
|
4925
|
+
try {
|
|
4926
|
+
body = await request.json();
|
|
4927
|
+
} catch {
|
|
4928
|
+
return rpcError(null, -32700, "parse error");
|
|
4929
|
+
}
|
|
4930
|
+
if (!isRecord(body) || body.jsonrpc !== "2.0" || typeof body.method !== "string" || body.id !== void 0 && body.id !== null && typeof body.id !== "string" && typeof body.id !== "number" || body.params !== void 0 && !isRecord(body.params)) return rpcError(null, -32600, "invalid request");
|
|
4931
|
+
if (body.id === void 0) return new Response(null, { status: 202 });
|
|
4932
|
+
const { id, method } = body;
|
|
4933
|
+
const params = body.params;
|
|
4934
|
+
switch (method) {
|
|
4935
|
+
case "initialize": {
|
|
4936
|
+
const requested = params?.protocolVersion;
|
|
4937
|
+
return result(id, {
|
|
4938
|
+
capabilities: { tools: {} },
|
|
4939
|
+
protocolVersion: typeof requested === "string" && versions.includes(requested) ? requested : versions[0],
|
|
4940
|
+
serverInfo: options.serverInfo
|
|
4941
|
+
});
|
|
4942
|
+
}
|
|
4943
|
+
case "ping": return result(id, {});
|
|
4944
|
+
case "tools/list": try {
|
|
4945
|
+
return result(id, { tools: options.registry.listTools() });
|
|
4946
|
+
} catch {
|
|
4947
|
+
return rpcError(id, -32603, "internal error");
|
|
4948
|
+
}
|
|
4949
|
+
case "tools/call":
|
|
4950
|
+
if (typeof params?.name !== "string" || params.arguments !== void 0 && !isRecord(params.arguments)) return rpcError(id, -32602, "invalid tool parameters");
|
|
4951
|
+
try {
|
|
4952
|
+
const value = await options.registry.callTool(params.name, params.arguments, {
|
|
4953
|
+
...ctx,
|
|
4954
|
+
request
|
|
4955
|
+
});
|
|
4956
|
+
const schema = options.registry.listTools().find((tool) => tool.name === params.name)?.outputSchema;
|
|
4957
|
+
return result(id, {
|
|
4958
|
+
content: [{
|
|
4959
|
+
type: "text",
|
|
4960
|
+
text: typeof value === "string" ? value : JSON.stringify(value, null, 2) ?? "null"
|
|
4961
|
+
}],
|
|
4962
|
+
...schema ? { structuredContent: schema["x-brick-wrap-result"] ? { result: value } : value } : {}
|
|
4963
|
+
});
|
|
4964
|
+
} catch (error) {
|
|
4965
|
+
if (error instanceof UnknownToolError) return rpcError(id, -32602, error.message);
|
|
4966
|
+
return result(id, {
|
|
4967
|
+
content: [{
|
|
4968
|
+
type: "text",
|
|
4969
|
+
text: error instanceof Error ? error.message : String(error)
|
|
4970
|
+
}],
|
|
4971
|
+
isError: true
|
|
4972
|
+
});
|
|
4973
|
+
}
|
|
4974
|
+
default: return rpcError(id, -32601, `method not found: ${method}`);
|
|
4975
|
+
}
|
|
4976
|
+
};
|
|
4977
|
+
}
|
|
4791
4978
|
// src/endpoints.ts
|
|
4792
4979
|
/** Resolve the db for an endpoint: explicit service first, else first service holding one. */
|
|
4793
4980
|
function resolveEndpointDb(service, services) {
|
|
@@ -6722,6 +6909,38 @@ function brick(options = {}) {
|
|
|
6722
6909
|
builtIn(swaggerPath, htmlResponse(swaggerDocsHTML(openApiPath, title)));
|
|
6723
6910
|
}
|
|
6724
6911
|
builtIn("/_brick/services", (context) => architecture(context));
|
|
6912
|
+
const dashboardTools = [];
|
|
6913
|
+
const dashboardToolService = /* @__PURE__ */ new Map();
|
|
6914
|
+
for (const service of services) for (const tool of service.listTools()) {
|
|
6915
|
+
if (tool.config.dashboard !== true) continue;
|
|
6916
|
+
if (DASHBOARD_MCP_TOOLS.includes(tool.name)) throw new DuplicateNameError(`Brick: the tool '${tool.name}' is marked dashboard: true, but the dashboard's MCP endpoint has a tool of that name. Rename yours.`);
|
|
6917
|
+
const other = dashboardToolService.get(tool.name);
|
|
6918
|
+
if (other !== void 0) throw new DuplicateNameError(`Brick: the services '${other}' and '${service.name}' both have a tool '${tool.name}' marked dashboard: true. The dashboard's MCP endpoint needs one name per tool, so rename one of them.`);
|
|
6919
|
+
dashboardToolService.set(tool.name, service.name);
|
|
6920
|
+
dashboardTools.push(tool);
|
|
6921
|
+
}
|
|
6922
|
+
const toolRegistry = createMcpRegistry({ tools: dashboardTools });
|
|
6923
|
+
const readsOnly = (tool) => tool.annotations.readOnlyHint === true;
|
|
6924
|
+
const forCaller = (write) => ({
|
|
6925
|
+
listTools: () => toolRegistry.listTools().filter((tool) => write || readsOnly(tool)),
|
|
6926
|
+
callTool(name, args, ctx) {
|
|
6927
|
+
const tool = toolRegistry.listTools().find((item) => item.name === name);
|
|
6928
|
+
if (tool && !write && !readsOnly(tool)) throw new Error(`${name} can change data, so only a signed-in user may call it: dashboard.auth.authorize must return { user }. A token, or authorize returning true, can only read.`);
|
|
6929
|
+
return toolRegistry.callTool(name, args, ctx);
|
|
6930
|
+
}
|
|
6931
|
+
});
|
|
6932
|
+
const mcpHandlers = [false, true].map((write) => createMcpHandler({
|
|
6933
|
+
registry: forCaller(write),
|
|
6934
|
+
serverInfo: {
|
|
6935
|
+
name: title,
|
|
6936
|
+
version
|
|
6937
|
+
}
|
|
6938
|
+
}));
|
|
6939
|
+
app.post(DASHBOARD_MCP_ROUTE, ({ request }) => {
|
|
6940
|
+
const caller = dashboardMcpCaller(request);
|
|
6941
|
+
return caller ? mcpHandlers[caller.write ? 1 : 0](request, { dashboard: caller.user ? { user: caller.user } : {} }) : new Response("Unauthorized", { status: 401 });
|
|
6942
|
+
});
|
|
6943
|
+
registeredRoutes.set(routeKey("POST", DASHBOARD_MCP_ROUTE), false);
|
|
6725
6944
|
const sockets = services.flatMap((service) => service.listSockets().map((definition) => ({
|
|
6726
6945
|
service: service.name,
|
|
6727
6946
|
path: socketPath(prefix, service.name, definition),
|
|
@@ -6883,6 +7102,6 @@ function cachedJsonRoute(build, revision) {
|
|
|
6883
7102
|
return json;
|
|
6884
7103
|
};
|
|
6885
7104
|
}
|
|
6886
|
-
export {
|
|
7105
|
+
export { auditStage as $, hasSensitive as $t, defineListener as A, listSecrets as At, INTERNALS as B, hasIdentity as Bt, getGlobalRegistry as C, redisBroker as Ct, loadCompiledBrickApp as D, SecretRef as Dt, compileBrickApplication as E, scopeFiles as Et, eventRefs as F, definitionSite as Ft, installPlugin as G, signDashboardIdentity as Gt, defineServicePlugin as H, DASHBOARD_KEY_ENV as Ht, isCrudEvent as I, depsOverride as It, validateName as J, fileFields as Jt, isInstallingPlugin as K, signDashboardMcp as Kt, isBrickApp as L, freezeAsBuiltDeps as Lt, checkPayload as M, resetSecrets as Mt, crudEventName as N, resolveSecrets as Nt, WORKFLOW_BUNDLE as O, defineSecret as Ot, crudEventSource as P, claimName as Pt, deny as Q, Sensitive as Qt, requireBrickApp as R, useDeps as Rt, setActionAudit as S, redis as St, bindCompiledApplication as T, s3 as Tt, getPluginEndpoints as U, dashboardKey as Ut, defineResourcePlugin as V, DASHBOARD_IDENTITY_HEADER as Vt, hasPlugin as W, dashboardUser as Wt, defineAction as X, traceRoute as Xt, buildErrorHelpers as Y, validateWithSchema as Yt, errorsOf as Z, withCallSpan as Zt, scalarDocsHTML as _, clientAddress as _t, defineSchedule as a, recordInline as at, getActionAccess as b, defineStorage as bt, outboxTable as c, checkWebhook as ct, createMcpHandler as d, webhookOf as dt, isSensitive as en, auditTable as et, createMcpRegistry as f, baseContext as ft, registerReferenceRoute as g, checkRateLimits as gt, referencePlugin as h, resolvedDeps as ht, stopAllEvents as i, PLUGIN_KIND as in, recordAudit as it, checkEvent as j, overrideSecret as jt, resolveWorkflowPaths as k, envSource as kt, UnknownToolError as l, defineWebhookMeta as lt, DASHBOARD_MCP_TOOLS as m, pickContextEnvelope as mt, defineServiceSocket as n, sensitivity as nn, inlineAudit as nt, Dispatcher as o, onTransactionCommit as ot, DASHBOARD_MCP_ROUTE as p, markResolved as pt, segmentClaimant as q, Type as qt, recordingServices as r, PLUGIN_COMMIT as rn, isAuditTable as rt, isOutboxTable as s, runInTransaction as st, brick as t, redact as tn, entryOf as tt, WRAP_RESULT as u, isWebhook as ut, requestLoggingPlugin as v, rateLimitsOf as vt, resetGlobalRegistry as w, hasFilesView as wt, setActionAccess as x, memory as xt, generateOpenApiSpec as y, StorageUnavailableError as yt, createActionHandler as z, portOf as zt };
|
|
6887
7106
|
|
|
6888
7107
|
//# sourceMappingURL=server.js.map
|