@dereekb/firebase-server 13.17.0 → 13.19.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/mailgun/package.json +9 -9
- package/mcp/index.cjs.js +499 -182
- package/mcp/index.esm.js +491 -183
- package/mcp/package.json +11 -11
- package/mcp/src/lib/mcp.config.d.ts +71 -0
- package/mcp/src/lib/service/analytics/mcp.analytics.handler.d.ts +8 -1
- package/mcp/src/lib/service/index.d.ts +1 -0
- package/mcp/src/lib/service/mcp.reason.d.ts +80 -0
- package/mcp/src/lib/service/mcp.server.factory.d.ts +14 -1
- package/mcp/src/lib/service/mcp.tool-generator.d.ts +37 -1
- package/mcp/src/lib/service/tools/mcp.tool.whoami.d.ts +35 -5
- package/model/package.json +9 -9
- package/oidc/package.json +10 -10
- package/package.json +10 -10
- package/test/package.json +11 -11
- package/twilio/package.json +8 -8
- package/zoho/package.json +9 -9
package/mcp/index.esm.js
CHANGED
|
@@ -15,7 +15,7 @@ function _class_call_check$5(instance, Constructor) {
|
|
|
15
15
|
throw new TypeError("Cannot call a class as a function");
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
function _define_property$
|
|
18
|
+
function _define_property$9(obj, key, value) {
|
|
19
19
|
if (key in obj) {
|
|
20
20
|
Object.defineProperty(obj, key, {
|
|
21
21
|
value: value,
|
|
@@ -45,6 +45,23 @@ function _define_property$8(obj, key, value) {
|
|
|
45
45
|
* Default `instructions` string advertised by the MCP server on the JSON-RPC `initialize`
|
|
46
46
|
* handshake. Apps may override this via {@link McpModuleConfig.serverInstructions}.
|
|
47
47
|
*/ var DEFAULT_MCP_SERVER_INSTRUCTIONS = 'A set of call-model tools generated automatically.';
|
|
48
|
+
/**
|
|
49
|
+
* Default name of the auto-injected reason parameter added to every advertised MCP tool's input
|
|
50
|
+
* schema. See {@link McpReasonParameterConfig.parameterName}.
|
|
51
|
+
*/ var DEFAULT_MCP_REASON_PARAMETER_NAME = 'reason';
|
|
52
|
+
/**
|
|
53
|
+
* Default maximum length (in characters) of the auto-injected reason parameter. Values longer than
|
|
54
|
+
* this are clamped server-side before being forwarded to analytics. See
|
|
55
|
+
* {@link McpReasonParameterConfig.maxLength}.
|
|
56
|
+
*/ var DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH = 250;
|
|
57
|
+
/**
|
|
58
|
+
* Default required-ness of the auto-injected reason parameter. See
|
|
59
|
+
* {@link McpReasonParameterConfig.required}.
|
|
60
|
+
*/ var DEFAULT_MCP_REASON_PARAMETER_REQUIRED = true;
|
|
61
|
+
/**
|
|
62
|
+
* Default description advertised for the auto-injected reason parameter on every tool's input schema.
|
|
63
|
+
* See {@link McpReasonParameterConfig.description}.
|
|
64
|
+
*/ var DEFAULT_MCP_REASON_PARAMETER_DESCRIPTION = 'A brief human-readable reason (≤250 chars) explaining why this tool is being called. Recorded for analytics/audit only; not part of the operation.';
|
|
48
65
|
/**
|
|
49
66
|
* Configuration for the firebase-server/mcp module.
|
|
50
67
|
*
|
|
@@ -69,7 +86,7 @@ function _define_property$8(obj, key, value) {
|
|
|
69
86
|
* discovery document. Claude custom-connector reads this to discover the OIDC issuer.
|
|
70
87
|
*
|
|
71
88
|
* @example 'https://api.example.com/oidc'
|
|
72
|
-
*/ _define_property$
|
|
89
|
+
*/ _define_property$9(this, "oidcIssuer", void 0);
|
|
73
90
|
/**
|
|
74
91
|
* The canonical resource URL of the MCP endpoint.
|
|
75
92
|
*
|
|
@@ -77,19 +94,19 @@ function _define_property$8(obj, key, value) {
|
|
|
77
94
|
* and used as the audience the access token's `aud` claim should match.
|
|
78
95
|
*
|
|
79
96
|
* @example 'https://api.example.com/mcp'
|
|
80
|
-
*/ _define_property$
|
|
97
|
+
*/ _define_property$9(this, "mcpUrl", void 0);
|
|
81
98
|
/**
|
|
82
99
|
* Optional name advertised on the MCP `initialize` handshake. Defaults to
|
|
83
100
|
* {@link DEFAULT_MCP_SERVER_NAME}.
|
|
84
|
-
*/ _define_property$
|
|
101
|
+
*/ _define_property$9(this, "serverName", void 0);
|
|
85
102
|
/**
|
|
86
103
|
* Optional version advertised on the MCP `initialize` handshake.
|
|
87
|
-
*/ _define_property$
|
|
104
|
+
*/ _define_property$9(this, "serverVersion", void 0);
|
|
88
105
|
/**
|
|
89
106
|
* Optional override for the `instructions` string passed to `new McpServer(...)` and
|
|
90
107
|
* advertised on the JSON-RPC `initialize` handshake. Defaults to
|
|
91
108
|
* {@link DEFAULT_MCP_SERVER_INSTRUCTIONS}.
|
|
92
|
-
*/ _define_property$
|
|
109
|
+
*/ _define_property$9(this, "serverInstructions", void 0);
|
|
93
110
|
/**
|
|
94
111
|
* Absolute path to a pre-rendered MCP manifest JSON file produced by
|
|
95
112
|
* `dbx-cli-generate-mcp-manifest`. When set, the runtime reads it once at
|
|
@@ -99,7 +116,7 @@ function _define_property$8(obj, key, value) {
|
|
|
99
116
|
* Optional. When unset or the file is missing, the runtime falls back to
|
|
100
117
|
* today's behavior (auto-generated descriptions, ArkType-derived input
|
|
101
118
|
* schemas, no output schemas) and emits a single boot warning.
|
|
102
|
-
*/ _define_property$
|
|
119
|
+
*/ _define_property$9(this, "mcpManifestPath", void 0);
|
|
103
120
|
/**
|
|
104
121
|
* Absolute path to a pre-rendered route manifest JSON file produced by
|
|
105
122
|
* `dbx-cli-generate-route-manifest`. When set, the runtime reads it once at
|
|
@@ -109,7 +126,7 @@ function _define_property$8(obj, key, value) {
|
|
|
109
126
|
* Optional. When unset or the file is missing, the runtime skips registering
|
|
110
127
|
* `url-models` and emits a single boot warning when the path was set but
|
|
111
128
|
* unreadable.
|
|
112
|
-
*/ _define_property$
|
|
129
|
+
*/ _define_property$9(this, "mcpRouteManifestPath", void 0);
|
|
113
130
|
/**
|
|
114
131
|
* When `true`, the MCP server only advertises tools whose effective read-only classification is `true`.
|
|
115
132
|
*
|
|
@@ -119,19 +136,29 @@ function _define_property$8(obj, key, value) {
|
|
|
119
136
|
*
|
|
120
137
|
* The advertised `serverName` on the JSON-RPC `initialize` handshake is suffixed with
|
|
121
138
|
* ` (read-only)` so the client surface reflects the mode.
|
|
122
|
-
*/ _define_property$
|
|
139
|
+
*/ _define_property$9(this, "readOnly", void 0);
|
|
140
|
+
/**
|
|
141
|
+
* Controls the auto-injected `reason` parameter added to every advertised tool's input schema.
|
|
142
|
+
*
|
|
143
|
+
* Enabled by default (unset / `true` = defaults on). Pass a {@link McpReasonParameterConfig} object
|
|
144
|
+
* to tune `required`, `maxLength`, `description`, or `parameterName`, or `false` to disable it.
|
|
145
|
+
*
|
|
146
|
+
* When enabled, every advertised tool's `inputSchema` carries a required `reason` string the model
|
|
147
|
+
* fills with a short justification for the call. The value is forwarded to analytics and stripped
|
|
148
|
+
* from the dispatched handler body. See {@link McpReasonParameterConfig}.
|
|
149
|
+
*/ _define_property$9(this, "reasonParameter", void 0);
|
|
123
150
|
};
|
|
124
151
|
/**
|
|
125
152
|
* NestJS injection token for the optional {@link McpAuthRoleReader} provider.
|
|
126
153
|
*/ var MCP_AUTH_ROLE_READER = 'MCP_AUTH_ROLE_READER';
|
|
127
154
|
|
|
128
|
-
function _type_of$
|
|
155
|
+
function _type_of$5(obj) {
|
|
129
156
|
"@swc/helpers - typeof";
|
|
130
157
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
131
158
|
}
|
|
132
159
|
function __decorate(decorators, target, key, desc) {
|
|
133
160
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
134
|
-
if ((typeof Reflect === "undefined" ? "undefined" : _type_of$
|
|
161
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _type_of$5(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
135
162
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
136
163
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
137
164
|
}
|
|
@@ -145,6 +172,206 @@ typeof SuppressedError === "function" ? SuppressedError : function(error, suppre
|
|
|
145
172
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
146
173
|
};
|
|
147
174
|
|
|
175
|
+
function _array_like_to_array$a(arr, len) {
|
|
176
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
177
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
178
|
+
return arr2;
|
|
179
|
+
}
|
|
180
|
+
function _array_without_holes$7(arr) {
|
|
181
|
+
if (Array.isArray(arr)) return _array_like_to_array$a(arr);
|
|
182
|
+
}
|
|
183
|
+
function _define_property$8(obj, key, value) {
|
|
184
|
+
if (key in obj) {
|
|
185
|
+
Object.defineProperty(obj, key, {
|
|
186
|
+
value: value,
|
|
187
|
+
enumerable: true,
|
|
188
|
+
configurable: true,
|
|
189
|
+
writable: true
|
|
190
|
+
});
|
|
191
|
+
} else {
|
|
192
|
+
obj[key] = value;
|
|
193
|
+
}
|
|
194
|
+
return obj;
|
|
195
|
+
}
|
|
196
|
+
function _iterable_to_array$7(iter) {
|
|
197
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
198
|
+
}
|
|
199
|
+
function _non_iterable_spread$7() {
|
|
200
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
201
|
+
}
|
|
202
|
+
function _object_spread$5(target) {
|
|
203
|
+
for(var i = 1; i < arguments.length; i++){
|
|
204
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
205
|
+
var ownKeys = Object.keys(source);
|
|
206
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
207
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
208
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
ownKeys.forEach(function(key) {
|
|
212
|
+
_define_property$8(target, key, source[key]);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
return target;
|
|
216
|
+
}
|
|
217
|
+
function ownKeys$3(object, enumerableOnly) {
|
|
218
|
+
var keys = Object.keys(object);
|
|
219
|
+
if (Object.getOwnPropertySymbols) {
|
|
220
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
221
|
+
keys.push.apply(keys, symbols);
|
|
222
|
+
}
|
|
223
|
+
return keys;
|
|
224
|
+
}
|
|
225
|
+
function _object_spread_props$3(target, source) {
|
|
226
|
+
source = source != null ? source : {};
|
|
227
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
228
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
229
|
+
} else {
|
|
230
|
+
ownKeys$3(Object(source)).forEach(function(key) {
|
|
231
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
return target;
|
|
235
|
+
}
|
|
236
|
+
function _to_consumable_array$7(arr) {
|
|
237
|
+
return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$7();
|
|
238
|
+
}
|
|
239
|
+
function _type_of$4(obj) {
|
|
240
|
+
"@swc/helpers - typeof";
|
|
241
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
242
|
+
}
|
|
243
|
+
function _unsupported_iterable_to_array$a(o, minLen) {
|
|
244
|
+
if (!o) return;
|
|
245
|
+
if (typeof o === "string") return _array_like_to_array$a(o, minLen);
|
|
246
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
247
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
248
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
249
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Normalizes the app-supplied {@link McpModuleConfig.reasonParameter} value (object / boolean /
|
|
253
|
+
* undefined) into a fully-resolved {@link ResolvedMcpReasonParameterConfig} with the package defaults
|
|
254
|
+
* applied.
|
|
255
|
+
*
|
|
256
|
+
* - `undefined` / `true` → defaults, enabled.
|
|
257
|
+
* - `false` → defaults, but `enabled: false`.
|
|
258
|
+
* - object → per-field overrides on top of the defaults (`enabled` defaults to `true`).
|
|
259
|
+
*
|
|
260
|
+
* @param config - The raw config from {@link McpModuleConfig.reasonParameter}.
|
|
261
|
+
* @returns The resolved config with all defaults applied.
|
|
262
|
+
*/ function resolveMcpReasonParameterConfig(config) {
|
|
263
|
+
var result;
|
|
264
|
+
if (config === false) {
|
|
265
|
+
result = {
|
|
266
|
+
enabled: false,
|
|
267
|
+
required: DEFAULT_MCP_REASON_PARAMETER_REQUIRED,
|
|
268
|
+
maxLength: DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH,
|
|
269
|
+
description: DEFAULT_MCP_REASON_PARAMETER_DESCRIPTION,
|
|
270
|
+
parameterName: DEFAULT_MCP_REASON_PARAMETER_NAME
|
|
271
|
+
};
|
|
272
|
+
} else if (config == null || config === true) {
|
|
273
|
+
result = {
|
|
274
|
+
enabled: true,
|
|
275
|
+
required: DEFAULT_MCP_REASON_PARAMETER_REQUIRED,
|
|
276
|
+
maxLength: DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH,
|
|
277
|
+
description: DEFAULT_MCP_REASON_PARAMETER_DESCRIPTION,
|
|
278
|
+
parameterName: DEFAULT_MCP_REASON_PARAMETER_NAME
|
|
279
|
+
};
|
|
280
|
+
} else {
|
|
281
|
+
var _config_enabled, _config_required, _config_maxLength, _config_description, _config_parameterName;
|
|
282
|
+
result = {
|
|
283
|
+
enabled: (_config_enabled = config.enabled) !== null && _config_enabled !== void 0 ? _config_enabled : true,
|
|
284
|
+
required: (_config_required = config.required) !== null && _config_required !== void 0 ? _config_required : DEFAULT_MCP_REASON_PARAMETER_REQUIRED,
|
|
285
|
+
maxLength: (_config_maxLength = config.maxLength) !== null && _config_maxLength !== void 0 ? _config_maxLength : DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH,
|
|
286
|
+
description: (_config_description = config.description) !== null && _config_description !== void 0 ? _config_description : DEFAULT_MCP_REASON_PARAMETER_DESCRIPTION,
|
|
287
|
+
parameterName: (_config_parameterName = config.parameterName) !== null && _config_parameterName !== void 0 ? _config_parameterName : DEFAULT_MCP_REASON_PARAMETER_NAME
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
return result;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Returns `true` when the JSON schema already declares a property named `name` under `properties`.
|
|
294
|
+
*
|
|
295
|
+
* Used as the collision guard so a handler that legitimately consumes its own field of the same name
|
|
296
|
+
* is never double-declared (schema injection) or stripped (arg extraction).
|
|
297
|
+
*
|
|
298
|
+
* @param schema - The candidate JSON schema object (may be `undefined`).
|
|
299
|
+
* @param name - The property name to look for.
|
|
300
|
+
* @returns Whether the schema's `properties` already contains `name`.
|
|
301
|
+
*/ function mcpSchemaDeclaresProperty(schema, name) {
|
|
302
|
+
var properties = schema === null || schema === void 0 ? void 0 : schema.properties;
|
|
303
|
+
return properties != null && (typeof properties === "undefined" ? "undefined" : _type_of$4(properties)) === 'object' && Object.prototype.hasOwnProperty.call(properties, name);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Returns a NEW JSON schema object with the reason parameter property merged into `properties` (and
|
|
307
|
+
* appended to `required` when configured). Never mutates the input — the static wire schemas are
|
|
308
|
+
* shared module-level constants reused across requests.
|
|
309
|
+
*
|
|
310
|
+
* Self-skips (returns the input schema unchanged) when the config is disabled or the schema already
|
|
311
|
+
* declares the parameter name. Defensive against a non-object / missing-`properties` input.
|
|
312
|
+
*
|
|
313
|
+
* @param inputSchema - The tool's resolved input schema.
|
|
314
|
+
* @param resolved - The resolved reason-parameter config.
|
|
315
|
+
* @returns A new schema carrying the reason property, or the original schema when skipped.
|
|
316
|
+
*/ function applyMcpReasonParameterToSchema(inputSchema, resolved) {
|
|
317
|
+
var result = inputSchema;
|
|
318
|
+
if (resolved.enabled && !mcpSchemaDeclaresProperty(inputSchema, resolved.parameterName)) {
|
|
319
|
+
var _base_type;
|
|
320
|
+
var base = (typeof inputSchema === "undefined" ? "undefined" : _type_of$4(inputSchema)) === 'object' && inputSchema != null ? inputSchema : {};
|
|
321
|
+
var existingProperties = _type_of$4(base.properties) === 'object' && base.properties != null ? base.properties : {};
|
|
322
|
+
var next = _object_spread_props$3(_object_spread$5({}, base), {
|
|
323
|
+
type: (_base_type = base.type) !== null && _base_type !== void 0 ? _base_type : 'object',
|
|
324
|
+
properties: _object_spread_props$3(_object_spread$5({}, existingProperties), _define_property$8({}, resolved.parameterName, {
|
|
325
|
+
type: 'string',
|
|
326
|
+
maxLength: resolved.maxLength,
|
|
327
|
+
description: resolved.description
|
|
328
|
+
}))
|
|
329
|
+
});
|
|
330
|
+
if (resolved.required) {
|
|
331
|
+
var existingRequired = Array.isArray(base.required) ? base.required : [];
|
|
332
|
+
next.required = existingRequired.includes(resolved.parameterName) ? _to_consumable_array$7(existingRequired) : _to_consumable_array$7(existingRequired).concat([
|
|
333
|
+
resolved.parameterName
|
|
334
|
+
]);
|
|
335
|
+
}
|
|
336
|
+
result = next;
|
|
337
|
+
}
|
|
338
|
+
return result;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Splits the auto-injected reason value out of a tool call's raw arguments.
|
|
342
|
+
*
|
|
343
|
+
* When enabled and the tool did NOT declare its own field of the same name: shallow-copies the args,
|
|
344
|
+
* deletes the parameter key, and coerces + clamps the value to `maxLength` (the client is not trusted).
|
|
345
|
+
* An empty / absent value yields `reason: undefined`.
|
|
346
|
+
*
|
|
347
|
+
* Otherwise (disabled, or the handler legitimately owns the field) returns the args unchanged so a
|
|
348
|
+
* field the handler actually consumes is never stripped.
|
|
349
|
+
*
|
|
350
|
+
* @param args - The raw `tools/call` arguments.
|
|
351
|
+
* @param resolved - The resolved reason-parameter config.
|
|
352
|
+
* @param toolDeclaresOwnReason - Whether the tool's own input schema already declares the parameter.
|
|
353
|
+
* @returns The extracted reason plus the (possibly stripped) args to dispatch.
|
|
354
|
+
*/ function extractMcpReasonFromArgs(args, resolved, toolDeclaresOwnReason) {
|
|
355
|
+
var result;
|
|
356
|
+
if (resolved.enabled && !toolDeclaresOwnReason && Object.prototype.hasOwnProperty.call(args, resolved.parameterName)) {
|
|
357
|
+
var rawValue = args[resolved.parameterName];
|
|
358
|
+
var nextArgs = _object_spread$5({}, args);
|
|
359
|
+
delete nextArgs[resolved.parameterName];
|
|
360
|
+
var stringValue = rawValue == null ? '' : String(rawValue);
|
|
361
|
+
var clamped = stringValue.length > resolved.maxLength ? stringValue.slice(0, resolved.maxLength) : stringValue;
|
|
362
|
+
result = {
|
|
363
|
+
reason: clamped.length > 0 ? clamped : undefined,
|
|
364
|
+
args: nextArgs
|
|
365
|
+
};
|
|
366
|
+
} else {
|
|
367
|
+
result = {
|
|
368
|
+
reason: undefined,
|
|
369
|
+
args: args
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
return result;
|
|
373
|
+
}
|
|
374
|
+
|
|
148
375
|
function _class_call_check$4(instance, Constructor) {
|
|
149
376
|
if (!(instance instanceof Constructor)) {
|
|
150
377
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -947,6 +1174,46 @@ function _unsupported_iterable_to_array$8(o, minLen) {
|
|
|
947
1174
|
*/ function applyWriteMarker(description, annotations) {
|
|
948
1175
|
return annotations.readOnlyHint === false ? "".concat(MCP_WRITE_TOOL_DESCRIPTION_PREFIX).concat(description) : description;
|
|
949
1176
|
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Assembles a statically-registered {@link McpToolDefinition} with consistent MCP annotations.
|
|
1179
|
+
*
|
|
1180
|
+
* Built-in tools (e.g. `whoami`, `model-get`, `batch-execute`) don't flow through
|
|
1181
|
+
* {@link buildToolFromCandidate}, so this is their analogous single source of truth: it derives the
|
|
1182
|
+
* read/write annotations from {@link BuildStaticToolDefinitionInput.effectiveReadOnly} via
|
|
1183
|
+
* {@link resolveMcpToolAnnotations}, applies the {@link MCP_WRITE_TOOL_DESCRIPTION_PREFIX} write
|
|
1184
|
+
* marker to the description, then mirrors the annotations onto both the definition's `annotations`
|
|
1185
|
+
* field and the frozen {@link McpToolDefinition.staticWireEntry}. Centralizing this guarantees no
|
|
1186
|
+
* built-in tool reaches `tools/list` un-annotated (which would surface as an uncategorized "other"
|
|
1187
|
+
* tool in clients that bucket by `readOnlyHint`).
|
|
1188
|
+
*
|
|
1189
|
+
* @param input - The tool identity, schemas, dispatch target, static handler, and read-only classification.
|
|
1190
|
+
* @returns A statically-registered {@link McpToolDefinition} to append to the MCP server factory's tool registry.
|
|
1191
|
+
*/ function buildStaticToolDefinition(input) {
|
|
1192
|
+
var name = input.name, inputSchema = input.inputSchema, outputSchema = input.outputSchema, dispatch = input.dispatch, staticHandler = input.staticHandler, effectiveReadOnly = input.effectiveReadOnly, rule = input.rule;
|
|
1193
|
+
var annotations = resolveMcpToolAnnotations(effectiveReadOnly);
|
|
1194
|
+
var description = applyWriteMarker(input.description, annotations);
|
|
1195
|
+
return {
|
|
1196
|
+
name: name,
|
|
1197
|
+
description: description,
|
|
1198
|
+
inputSchema: inputSchema,
|
|
1199
|
+
outputSchema: outputSchema,
|
|
1200
|
+
annotations: annotations,
|
|
1201
|
+
dispatch: dispatch,
|
|
1202
|
+
staticHandler: staticHandler,
|
|
1203
|
+
filterMetadata: {
|
|
1204
|
+
visibilityKind: 'declarative',
|
|
1205
|
+
rule: rule !== null && rule !== void 0 ? rule : {},
|
|
1206
|
+
effectiveReadOnly: effectiveReadOnly
|
|
1207
|
+
},
|
|
1208
|
+
staticWireEntry: buildStaticWireEntry({
|
|
1209
|
+
name: name,
|
|
1210
|
+
description: description,
|
|
1211
|
+
inputSchema: inputSchema,
|
|
1212
|
+
outputSchema: outputSchema,
|
|
1213
|
+
annotations: annotations
|
|
1214
|
+
})
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
950
1217
|
// MARK: Naming
|
|
951
1218
|
/**
|
|
952
1219
|
* The default specifier key used when a handler is not behind a specifier router.
|
|
@@ -1644,7 +1911,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
1644
1911
|
};
|
|
1645
1912
|
var name = MODEL_GET_TOOL_NAME;
|
|
1646
1913
|
var description = 'Fetch one or more Firestore model documents by key or bare id. Values containing `/` are treated as full keys; bare ids are auto-promoted to `<collectionName>/<id>` for root models. Subcollection models require full keys.';
|
|
1647
|
-
return {
|
|
1914
|
+
return buildStaticToolDefinition({
|
|
1648
1915
|
name: name,
|
|
1649
1916
|
description: description,
|
|
1650
1917
|
inputSchema: MODEL_GET_INPUT_SCHEMA,
|
|
@@ -1654,20 +1921,11 @@ function _ts_generator$5(thisArg, body) {
|
|
|
1654
1921
|
modelType: MODEL_GET_DISPATCH_MODEL_TYPE
|
|
1655
1922
|
},
|
|
1656
1923
|
staticHandler: handler,
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
effectiveReadOnly: true
|
|
1663
|
-
},
|
|
1664
|
-
staticWireEntry: buildStaticWireEntry({
|
|
1665
|
-
name: name,
|
|
1666
|
-
description: description,
|
|
1667
|
-
inputSchema: MODEL_GET_INPUT_SCHEMA,
|
|
1668
|
-
outputSchema: MODEL_GET_OUTPUT_SCHEMA
|
|
1669
|
-
})
|
|
1670
|
-
};
|
|
1924
|
+
effectiveReadOnly: true,
|
|
1925
|
+
rule: {
|
|
1926
|
+
requireAuthenticated: true
|
|
1927
|
+
}
|
|
1928
|
+
});
|
|
1671
1929
|
}
|
|
1672
1930
|
// MARK: Handler
|
|
1673
1931
|
function modelGetToolHandler(args, ctx, deps) {
|
|
@@ -1938,7 +2196,7 @@ function _object_spread$4(target) {
|
|
|
1938
2196
|
}
|
|
1939
2197
|
return target;
|
|
1940
2198
|
}
|
|
1941
|
-
function ownKeys$
|
|
2199
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
1942
2200
|
var keys = Object.keys(object);
|
|
1943
2201
|
if (Object.getOwnPropertySymbols) {
|
|
1944
2202
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -1946,12 +2204,12 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
1946
2204
|
}
|
|
1947
2205
|
return keys;
|
|
1948
2206
|
}
|
|
1949
|
-
function _object_spread_props$
|
|
2207
|
+
function _object_spread_props$2(target, source) {
|
|
1950
2208
|
source = source != null ? source : {};
|
|
1951
2209
|
if (Object.getOwnPropertyDescriptors) {
|
|
1952
2210
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1953
2211
|
} else {
|
|
1954
|
-
ownKeys$
|
|
2212
|
+
ownKeys$2(Object(source)).forEach(function(key) {
|
|
1955
2213
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1956
2214
|
});
|
|
1957
2215
|
}
|
|
@@ -2015,7 +2273,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
2015
2273
|
var name = MODEL_INFO_TOOL_NAME;
|
|
2016
2274
|
var count = deps.manifest.length;
|
|
2017
2275
|
var description = "Browse the Firestore model catalog (".concat(count, " model").concat(count === 1 ? '' : 's', "). No args returns model groups + counts (start here). ") + '`model` (a modelType/identityConst/collectionPrefix string, or an array of them) returns full detail per match — misses are reported in `notFound`. ' + '`modelGroup` returns the summary list for that group. `all:true` returns the full catalog summary. ' + '`fields` (boolean) forces or suppresses persisted-field detail in list/multiple modes.';
|
|
2018
|
-
return {
|
|
2276
|
+
return buildStaticToolDefinition({
|
|
2019
2277
|
name: name,
|
|
2020
2278
|
description: description,
|
|
2021
2279
|
inputSchema: MODEL_INFO_INPUT_SCHEMA,
|
|
@@ -2025,20 +2283,11 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
2025
2283
|
modelType: MODEL_INFO_DISPATCH_MODEL_TYPE
|
|
2026
2284
|
},
|
|
2027
2285
|
staticHandler: handler,
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
effectiveReadOnly: true
|
|
2034
|
-
},
|
|
2035
|
-
staticWireEntry: buildStaticWireEntry({
|
|
2036
|
-
name: name,
|
|
2037
|
-
description: description,
|
|
2038
|
-
inputSchema: MODEL_INFO_INPUT_SCHEMA,
|
|
2039
|
-
outputSchema: MODEL_INFO_OUTPUT_SCHEMA
|
|
2040
|
-
})
|
|
2041
|
-
};
|
|
2286
|
+
effectiveReadOnly: true,
|
|
2287
|
+
rule: {
|
|
2288
|
+
requireAuthenticated: true
|
|
2289
|
+
}
|
|
2290
|
+
});
|
|
2042
2291
|
}
|
|
2043
2292
|
// MARK: Handler
|
|
2044
2293
|
function modelInfoToolHandler(args, _ctx, deps) {
|
|
@@ -2142,7 +2391,7 @@ function resolveModelInfoOutput(input, manifest) {
|
|
|
2142
2391
|
}
|
|
2143
2392
|
}
|
|
2144
2393
|
if (tables.length > 0) {
|
|
2145
|
-
result = _object_spread_props$
|
|
2394
|
+
result = _object_spread_props$2(_object_spread$4({}, output), {
|
|
2146
2395
|
enums: tables
|
|
2147
2396
|
});
|
|
2148
2397
|
}
|
|
@@ -2196,7 +2445,7 @@ function parseModelInfoInput(args) {
|
|
|
2196
2445
|
var modelGroup = parseModelGroupArg(args['modelGroup']);
|
|
2197
2446
|
var all = parseBooleanArg(args['all'], 'all');
|
|
2198
2447
|
var fields = parseBooleanArg(args['fields'], 'fields');
|
|
2199
|
-
return _object_spread$4(_object_spread_props$
|
|
2448
|
+
return _object_spread$4(_object_spread_props$2(_object_spread$4(_object_spread_props$2(_object_spread$4({}, modelQueries == null ? {} : {
|
|
2200
2449
|
modelQueries: modelQueries
|
|
2201
2450
|
}), {
|
|
2202
2451
|
modelIsArray: Array.isArray(args['model'])
|
|
@@ -2694,7 +2943,7 @@ var MODEL_INFO_OUTPUT_SCHEMA = {
|
|
|
2694
2943
|
type: 'string',
|
|
2695
2944
|
description: 'Present when `mode` is `"list"` from a `modelGroup` filter. The canonical group name.'
|
|
2696
2945
|
},
|
|
2697
|
-
model: _object_spread_props$
|
|
2946
|
+
model: _object_spread_props$2(_object_spread$4({}, MODEL_ROW_SCHEMA), {
|
|
2698
2947
|
description: 'Present when `mode` is `"single"`. The matched model entry (full detail unless `fields:false`).'
|
|
2699
2948
|
}),
|
|
2700
2949
|
notFound: {
|
|
@@ -2829,7 +3078,7 @@ function _object_spread$3(target) {
|
|
|
2829
3078
|
};
|
|
2830
3079
|
var name = MODEL_DECODE_TOOL_NAME;
|
|
2831
3080
|
var description = 'Decode a Firestore model key ("prefix/id", or subcollection path "parentPrefix/parentId/childPrefix/childId") into { leaf, ancestors, unresolvedPrefixes } using the registered manifest ('.concat(deps.manifest.length, " model").concat(deps.manifest.length === 1 ? '' : 's', ").");
|
|
2832
|
-
return {
|
|
3081
|
+
return buildStaticToolDefinition({
|
|
2833
3082
|
name: name,
|
|
2834
3083
|
description: description,
|
|
2835
3084
|
inputSchema: MODEL_DECODE_INPUT_SCHEMA,
|
|
@@ -2839,20 +3088,11 @@ function _object_spread$3(target) {
|
|
|
2839
3088
|
modelType: MODEL_DECODE_DISPATCH_MODEL_TYPE
|
|
2840
3089
|
},
|
|
2841
3090
|
staticHandler: handler,
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
effectiveReadOnly: true
|
|
2848
|
-
},
|
|
2849
|
-
staticWireEntry: buildStaticWireEntry({
|
|
2850
|
-
name: name,
|
|
2851
|
-
description: description,
|
|
2852
|
-
inputSchema: MODEL_DECODE_INPUT_SCHEMA,
|
|
2853
|
-
outputSchema: MODEL_DECODE_OUTPUT_SCHEMA
|
|
2854
|
-
})
|
|
2855
|
-
};
|
|
3091
|
+
effectiveReadOnly: true,
|
|
3092
|
+
rule: {
|
|
3093
|
+
requireAuthenticated: true
|
|
3094
|
+
}
|
|
3095
|
+
});
|
|
2856
3096
|
}
|
|
2857
3097
|
// MARK: Handler
|
|
2858
3098
|
function modelDecodeToolHandler(args, _ctx, deps) {
|
|
@@ -3059,7 +3299,7 @@ var MODEL_DECODE_OUTPUT_SCHEMA = {
|
|
|
3059
3299
|
var name = ENUM_INFO_TOOL_NAME;
|
|
3060
3300
|
var count = Object.keys(deps.enums).length;
|
|
3061
3301
|
var description = "Look up enum value→label tables by name (".concat(count, " enum").concat(count === 1 ? '' : 's', ' registered). Pass `enum` (a string or array of enum declaration names, e.g. "JobWorkerTimesheetState") to decode the raw persisted integer/string values a model field stores. Misses are reported in `notFound`.');
|
|
3062
|
-
return {
|
|
3302
|
+
return buildStaticToolDefinition({
|
|
3063
3303
|
name: name,
|
|
3064
3304
|
description: description,
|
|
3065
3305
|
inputSchema: ENUM_INFO_INPUT_SCHEMA,
|
|
@@ -3069,20 +3309,11 @@ var MODEL_DECODE_OUTPUT_SCHEMA = {
|
|
|
3069
3309
|
modelType: ENUM_INFO_DISPATCH_MODEL_TYPE
|
|
3070
3310
|
},
|
|
3071
3311
|
staticHandler: handler,
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
effectiveReadOnly: true
|
|
3078
|
-
},
|
|
3079
|
-
staticWireEntry: buildStaticWireEntry({
|
|
3080
|
-
name: name,
|
|
3081
|
-
description: description,
|
|
3082
|
-
inputSchema: ENUM_INFO_INPUT_SCHEMA,
|
|
3083
|
-
outputSchema: ENUM_INFO_OUTPUT_SCHEMA
|
|
3084
|
-
})
|
|
3085
|
-
};
|
|
3312
|
+
effectiveReadOnly: true,
|
|
3313
|
+
rule: {
|
|
3314
|
+
requireAuthenticated: true
|
|
3315
|
+
}
|
|
3316
|
+
});
|
|
3086
3317
|
}
|
|
3087
3318
|
// MARK: Handler
|
|
3088
3319
|
function enumInfoToolHandler(args, _ctx, deps) {
|
|
@@ -3339,13 +3570,13 @@ function _unsupported_iterable_to_array$5(o, minLen) {
|
|
|
3339
3570
|
*/ function createWhoamiTool(deps) {
|
|
3340
3571
|
var _ref;
|
|
3341
3572
|
var _deps_auth_app;
|
|
3342
|
-
var handler = function handler(
|
|
3343
|
-
return Promise.resolve(whoamiToolHandler(ctx, deps));
|
|
3573
|
+
var handler = function handler(args, ctx) {
|
|
3574
|
+
return Promise.resolve(whoamiToolHandler(args, ctx, deps));
|
|
3344
3575
|
};
|
|
3345
3576
|
var name = WHOAMI_TOOL_NAME;
|
|
3346
3577
|
var appLabel = (_ref = (_deps_auth_app = deps.auth.app) === null || _deps_auth_app === void 0 ? void 0 : _deps_auth_app.app) !== null && _ref !== void 0 ? _ref : 'this server';
|
|
3347
|
-
var description = "Reports the authenticated caller's
|
|
3348
|
-
return {
|
|
3578
|
+
var description = "Reports the authenticated caller's identity and decoded role set for `".concat(appLabel, '`. Returns `authenticated: false` for anonymous callers. Defaults to a concise summary (uid + roles only); pass `detail: "claims"` to also include the raw claims object, or `detail: "full"` to additionally include per-claim descriptions (drawn from the build-time auth manifest) and any unknown claim keys.');
|
|
3579
|
+
return buildStaticToolDefinition({
|
|
3349
3580
|
name: name,
|
|
3350
3581
|
description: description,
|
|
3351
3582
|
inputSchema: WHOAMI_INPUT_SCHEMA,
|
|
@@ -3355,38 +3586,25 @@ function _unsupported_iterable_to_array$5(o, minLen) {
|
|
|
3355
3586
|
modelType: WHOAMI_DISPATCH_MODEL_TYPE
|
|
3356
3587
|
},
|
|
3357
3588
|
staticHandler: handler,
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
effectiveReadOnly: true
|
|
3362
|
-
},
|
|
3363
|
-
staticWireEntry: buildStaticWireEntry({
|
|
3364
|
-
name: name,
|
|
3365
|
-
description: description,
|
|
3366
|
-
inputSchema: WHOAMI_INPUT_SCHEMA,
|
|
3367
|
-
outputSchema: WHOAMI_OUTPUT_SCHEMA
|
|
3368
|
-
})
|
|
3369
|
-
};
|
|
3589
|
+
effectiveReadOnly: true,
|
|
3590
|
+
rule: {}
|
|
3591
|
+
});
|
|
3370
3592
|
}
|
|
3371
3593
|
// MARK: Handler
|
|
3372
|
-
function whoamiToolHandler(ctx, deps) {
|
|
3594
|
+
function whoamiToolHandler(args, ctx, deps) {
|
|
3373
3595
|
var _auth_token;
|
|
3374
3596
|
var _deps_auth_app;
|
|
3375
3597
|
var auth = ctx.auth;
|
|
3376
3598
|
if ((auth === null || auth === void 0 ? void 0 : auth.uid) == null) {
|
|
3377
|
-
|
|
3378
|
-
authenticated: false
|
|
3379
|
-
|
|
3380
|
-
roles: [],
|
|
3381
|
-
claimDetails: [],
|
|
3382
|
-
unknownClaimKeys: []
|
|
3383
|
-
};
|
|
3384
|
-
return buildResult(output, '# whoami\n\nUnauthenticated.');
|
|
3599
|
+
return buildResult({
|
|
3600
|
+
authenticated: false
|
|
3601
|
+
}, '# whoami\n\nNot authenticated (anonymous caller).');
|
|
3385
3602
|
}
|
|
3603
|
+
var detail = parseDetailLevel(args);
|
|
3386
3604
|
var token = (_auth_token = auth.token) !== null && _auth_token !== void 0 ? _auth_token : {};
|
|
3387
|
-
var
|
|
3388
|
-
var _param = _sliced_to_array$3(param, 2), value = _param[1];
|
|
3389
|
-
return value !== undefined;
|
|
3605
|
+
var claimKeys = Object.entries(token).filter(function(param) {
|
|
3606
|
+
var _param = _sliced_to_array$3(param, 2), key = _param[0], value = _param[1];
|
|
3607
|
+
return value !== undefined && key !== 'email' && key !== 'email_verified';
|
|
3390
3608
|
}).map(function(param) {
|
|
3391
3609
|
var _param = _sliced_to_array$3(param, 1), key = _param[0];
|
|
3392
3610
|
return key;
|
|
@@ -3420,11 +3638,8 @@ function whoamiToolHandler(ctx, deps) {
|
|
|
3420
3638
|
var unknownClaimKeys = [];
|
|
3421
3639
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
3422
3640
|
try {
|
|
3423
|
-
for(var _iterator1 =
|
|
3641
|
+
for(var _iterator1 = claimKeys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
3424
3642
|
var key = _step1.value;
|
|
3425
|
-
if (key === 'email' || key === 'email_verified') {
|
|
3426
|
-
continue;
|
|
3427
|
-
}
|
|
3428
3643
|
var claim1 = claimsByKey.get(key);
|
|
3429
3644
|
if (claim1 == null) {
|
|
3430
3645
|
unknownClaimKeys.push(key);
|
|
@@ -3454,22 +3669,30 @@ function whoamiToolHandler(ctx, deps) {
|
|
|
3454
3669
|
}
|
|
3455
3670
|
}
|
|
3456
3671
|
}
|
|
3457
|
-
var
|
|
3672
|
+
var output = _object_spread$2({
|
|
3458
3673
|
authenticated: true,
|
|
3459
3674
|
uid: auth.uid,
|
|
3460
|
-
claims: _object_spread$2({}, token),
|
|
3461
3675
|
roles: roles,
|
|
3462
|
-
|
|
3463
|
-
unknownClaimKeys: unknownClaimKeys
|
|
3676
|
+
claimCount: claimKeys.length
|
|
3464
3677
|
}, ((_deps_auth_app = deps.auth.app) === null || _deps_auth_app === void 0 ? void 0 : _deps_auth_app.app) == null ? {} : {
|
|
3465
3678
|
app: deps.auth.app.app
|
|
3466
3679
|
}, token.email == null ? {} : {
|
|
3467
3680
|
email: token.email
|
|
3468
3681
|
}, token.email_verified == null ? {} : {
|
|
3469
3682
|
emailVerified: token.email_verified
|
|
3470
|
-
}
|
|
3471
|
-
|
|
3472
|
-
|
|
3683
|
+
}, detail === 'summary' ? {} : {
|
|
3684
|
+
claims: _object_spread$2({}, token)
|
|
3685
|
+
}, detail === 'full' ? {
|
|
3686
|
+
claimDetails: claimDetails,
|
|
3687
|
+
unknownClaimKeys: unknownClaimKeys
|
|
3688
|
+
} : {});
|
|
3689
|
+
var text = renderText(output, detail);
|
|
3690
|
+
return buildResult(output, text);
|
|
3691
|
+
}
|
|
3692
|
+
// Coerces the `detail` input into a WhoamiDetailLevel, defaulting unknown or absent values to `summary`.
|
|
3693
|
+
function parseDetailLevel(args) {
|
|
3694
|
+
var value = args.detail;
|
|
3695
|
+
return value === 'claims' || value === 'full' ? value : 'summary';
|
|
3473
3696
|
}
|
|
3474
3697
|
function buildResult(output, text) {
|
|
3475
3698
|
return {
|
|
@@ -3482,34 +3705,51 @@ function buildResult(output, text) {
|
|
|
3482
3705
|
structuredContent: output
|
|
3483
3706
|
};
|
|
3484
3707
|
}
|
|
3485
|
-
function renderText(output) {
|
|
3708
|
+
function renderText(output, detail) {
|
|
3486
3709
|
var lines = [
|
|
3487
3710
|
'# whoami',
|
|
3488
3711
|
''
|
|
3489
3712
|
];
|
|
3490
3713
|
appendHeaderLines(lines, output);
|
|
3491
|
-
|
|
3492
|
-
|
|
3714
|
+
if (detail === 'full') {
|
|
3715
|
+
var _output_claimDetails, _output_unknownClaimKeys;
|
|
3716
|
+
appendClaimDetailLines(lines, (_output_claimDetails = output.claimDetails) !== null && _output_claimDetails !== void 0 ? _output_claimDetails : []);
|
|
3717
|
+
appendUnknownClaimLines(lines, (_output_unknownClaimKeys = output.unknownClaimKeys) !== null && _output_unknownClaimKeys !== void 0 ? _output_unknownClaimKeys : []);
|
|
3718
|
+
}
|
|
3719
|
+
if (detail !== 'summary') {
|
|
3720
|
+
var _output_claims;
|
|
3721
|
+
appendRawClaimsLines(lines, (_output_claims = output.claims) !== null && _output_claims !== void 0 ? _output_claims : {});
|
|
3722
|
+
}
|
|
3723
|
+
appendDetailHint(lines, detail);
|
|
3493
3724
|
return lines.join('\n');
|
|
3494
3725
|
}
|
|
3495
3726
|
function appendHeaderLines(lines, output) {
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
if (output.app != null) {
|
|
3500
|
-
lines.push("- **app:** `".concat(output.app, "`"));
|
|
3501
|
-
}
|
|
3727
|
+
var _output_roles, _output_claimCount;
|
|
3728
|
+
var appPart = output.app == null ? '' : " on `".concat(output.app, "`");
|
|
3729
|
+
lines.push("Authenticated as `".concat(output.uid, "`").concat(appPart, "."), '');
|
|
3502
3730
|
if (output.email != null) {
|
|
3503
|
-
lines.push("- **email:** `".concat(output.email, "`"));
|
|
3731
|
+
lines.push("- **email:** `".concat(output.email, "`").concat(formatEmailVerified(output.emailVerified)));
|
|
3504
3732
|
}
|
|
3505
|
-
|
|
3506
|
-
|
|
3733
|
+
var roles = (_output_roles = output.roles) !== null && _output_roles !== void 0 ? _output_roles : [];
|
|
3734
|
+
if (roles.length > 0) {
|
|
3735
|
+
var rolesText = roles.map(function(role) {
|
|
3507
3736
|
return "`".concat(role, "`");
|
|
3508
3737
|
}).join(', ');
|
|
3509
3738
|
lines.push("- **roles:** ".concat(rolesText));
|
|
3510
3739
|
} else {
|
|
3511
3740
|
lines.push('- **roles:** _(none)_');
|
|
3512
3741
|
}
|
|
3742
|
+
lines.push("- **claims:** ".concat((_output_claimCount = output.claimCount) !== null && _output_claimCount !== void 0 ? _output_claimCount : 0, " present"));
|
|
3743
|
+
}
|
|
3744
|
+
// Renders the parenthetical verification suffix for the email line, or an empty string when the token carries no `email_verified` claim.
|
|
3745
|
+
function formatEmailVerified(emailVerified) {
|
|
3746
|
+
if (emailVerified === true) {
|
|
3747
|
+
return ' (verified)';
|
|
3748
|
+
}
|
|
3749
|
+
if (emailVerified === false) {
|
|
3750
|
+
return ' (unverified)';
|
|
3751
|
+
}
|
|
3752
|
+
return '';
|
|
3513
3753
|
}
|
|
3514
3754
|
function appendClaimDetailLines(lines, claimDetails) {
|
|
3515
3755
|
if (claimDetails.length === 0) {
|
|
@@ -3571,22 +3811,40 @@ function appendUnknownClaimLines(lines, unknownClaimKeys) {
|
|
|
3571
3811
|
}
|
|
3572
3812
|
}
|
|
3573
3813
|
}
|
|
3814
|
+
// Renders the raw claims object as a fenced JSON block — the one place the tool emits raw JSON, since claims are an arbitrary key → value bag.
|
|
3815
|
+
function appendRawClaimsLines(lines, claims) {
|
|
3816
|
+
lines.push('', '## Raw claims', '```json', JSON.stringify(claims, null, 2), '```');
|
|
3817
|
+
}
|
|
3818
|
+
// Appends a hint pointing at the next, more detailed level. Omitted at `full`, which is already the most detailed level.
|
|
3819
|
+
function appendDetailHint(lines, detail) {
|
|
3820
|
+
if (detail === 'summary') {
|
|
3821
|
+
lines.push('', '_Call again with `detail: "claims"` for the raw claim values, or `detail: "full"` for values plus per-claim descriptions._');
|
|
3822
|
+
} else if (detail === 'claims') {
|
|
3823
|
+
lines.push('', '_Call again with `detail: "full"` for per-claim descriptions and unknown claim keys._');
|
|
3824
|
+
}
|
|
3825
|
+
}
|
|
3574
3826
|
// MARK: Schemas
|
|
3575
3827
|
var WHOAMI_INPUT_SCHEMA = {
|
|
3576
3828
|
type: 'object',
|
|
3577
|
-
properties: {
|
|
3829
|
+
properties: {
|
|
3830
|
+
detail: {
|
|
3831
|
+
type: 'string',
|
|
3832
|
+
enum: [
|
|
3833
|
+
'summary',
|
|
3834
|
+
'claims',
|
|
3835
|
+
'full'
|
|
3836
|
+
],
|
|
3837
|
+
description: 'Level of detail. "summary" (default): identity + decoded roles only. "claims": adds the raw claims object (key → value). "full": adds per-claim descriptions, granted/revoked roles, tags, and unknown claim keys.'
|
|
3838
|
+
}
|
|
3839
|
+
},
|
|
3578
3840
|
additionalProperties: false
|
|
3579
3841
|
};
|
|
3580
3842
|
var WHOAMI_OUTPUT_SCHEMA = {
|
|
3581
3843
|
type: 'object',
|
|
3582
3844
|
required: [
|
|
3583
|
-
'authenticated'
|
|
3584
|
-
'claims',
|
|
3585
|
-
'roles',
|
|
3586
|
-
'claimDetails',
|
|
3587
|
-
'unknownClaimKeys'
|
|
3845
|
+
'authenticated'
|
|
3588
3846
|
],
|
|
3589
|
-
description: 'Caller identity
|
|
3847
|
+
description: 'Caller identity and decoded role set. Claim-bearing fields (claims, claimDetails, unknownClaimKeys) are present only at the detail level that requests them via the `detail` input.',
|
|
3590
3848
|
properties: {
|
|
3591
3849
|
authenticated: {
|
|
3592
3850
|
type: 'boolean'
|
|
@@ -3603,16 +3861,19 @@ var WHOAMI_OUTPUT_SCHEMA = {
|
|
|
3603
3861
|
app: {
|
|
3604
3862
|
type: 'string'
|
|
3605
3863
|
},
|
|
3606
|
-
claims: {
|
|
3607
|
-
type: 'object',
|
|
3608
|
-
additionalProperties: true
|
|
3609
|
-
},
|
|
3610
3864
|
roles: {
|
|
3611
3865
|
type: 'array',
|
|
3612
3866
|
items: {
|
|
3613
3867
|
type: 'string'
|
|
3614
3868
|
}
|
|
3615
3869
|
},
|
|
3870
|
+
claimCount: {
|
|
3871
|
+
type: 'integer'
|
|
3872
|
+
},
|
|
3873
|
+
claims: {
|
|
3874
|
+
type: 'object',
|
|
3875
|
+
additionalProperties: true
|
|
3876
|
+
},
|
|
3616
3877
|
claimDetails: {
|
|
3617
3878
|
type: 'array',
|
|
3618
3879
|
items: {
|
|
@@ -3762,7 +4023,7 @@ function _object_spread$1(target) {
|
|
|
3762
4023
|
}
|
|
3763
4024
|
return target;
|
|
3764
4025
|
}
|
|
3765
|
-
function ownKeys(object, enumerableOnly) {
|
|
4026
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
3766
4027
|
var keys = Object.keys(object);
|
|
3767
4028
|
if (Object.getOwnPropertySymbols) {
|
|
3768
4029
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -3770,12 +4031,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
3770
4031
|
}
|
|
3771
4032
|
return keys;
|
|
3772
4033
|
}
|
|
3773
|
-
function _object_spread_props(target, source) {
|
|
4034
|
+
function _object_spread_props$1(target, source) {
|
|
3774
4035
|
source = source != null ? source : {};
|
|
3775
4036
|
if (Object.getOwnPropertyDescriptors) {
|
|
3776
4037
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3777
4038
|
} else {
|
|
3778
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
4039
|
+
ownKeys$1(Object(source)).forEach(function(key) {
|
|
3779
4040
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3780
4041
|
});
|
|
3781
4042
|
}
|
|
@@ -3929,7 +4190,7 @@ function _ts_generator$4(thisArg, body) {
|
|
|
3929
4190
|
};
|
|
3930
4191
|
var name = URL_MODELS_TOOL_NAME;
|
|
3931
4192
|
var description = 'Decode an app URL (or path) into the Firestore models its page renders. Pass a URL like `https://app.example.co/worker/abc/timesheets/list`; the tool matches it against the build-time route manifest and returns each model type plus the concrete key (route params + `{authUid}` substituted). Use `models` to filter to specific types, `keysOnly` for just the resolved keys, or `load: true` to fetch the documents via the same permission-checked path as `model-get` (cannot combine `load` with `keysOnly`).';
|
|
3932
|
-
return {
|
|
4193
|
+
return buildStaticToolDefinition({
|
|
3933
4194
|
name: name,
|
|
3934
4195
|
description: description,
|
|
3935
4196
|
inputSchema: URL_MODELS_INPUT_SCHEMA,
|
|
@@ -3939,20 +4200,11 @@ function _ts_generator$4(thisArg, body) {
|
|
|
3939
4200
|
modelType: URL_MODELS_DISPATCH_MODEL_TYPE
|
|
3940
4201
|
},
|
|
3941
4202
|
staticHandler: handler,
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
effectiveReadOnly: true
|
|
3948
|
-
},
|
|
3949
|
-
staticWireEntry: buildStaticWireEntry({
|
|
3950
|
-
name: name,
|
|
3951
|
-
description: description,
|
|
3952
|
-
inputSchema: URL_MODELS_INPUT_SCHEMA,
|
|
3953
|
-
outputSchema: URL_MODELS_OUTPUT_SCHEMA
|
|
3954
|
-
})
|
|
3955
|
-
};
|
|
4203
|
+
effectiveReadOnly: true,
|
|
4204
|
+
rule: {
|
|
4205
|
+
requireAuthenticated: true
|
|
4206
|
+
}
|
|
4207
|
+
});
|
|
3956
4208
|
}
|
|
3957
4209
|
// MARK: Handler
|
|
3958
4210
|
function urlModelsToolHandler(args, ctx, deps) {
|
|
@@ -4029,7 +4281,7 @@ function parseUrlModelsInput(args) {
|
|
|
4029
4281
|
}
|
|
4030
4282
|
currentUserUid = args.currentUserUid;
|
|
4031
4283
|
}
|
|
4032
|
-
return _object_spread$1(_object_spread_props(_object_spread$1({
|
|
4284
|
+
return _object_spread$1(_object_spread_props$1(_object_spread$1({
|
|
4033
4285
|
url: url
|
|
4034
4286
|
}, models === undefined ? {} : {
|
|
4035
4287
|
models: models
|
|
@@ -4809,7 +5061,7 @@ function _ts_generator$3(thisArg, body) {
|
|
|
4809
5061
|
};
|
|
4810
5062
|
var name = BATCH_EXECUTE_TOOL_NAME;
|
|
4811
5063
|
var description = 'Execute a batch of MCP operations server-side from an uploaded JSON/NDJSON file, returning a success/failure summary. Each line/element is an operation `{ call, modelType, specifier?, data }` matching any other write tool you could call individually. Generate the file with a script and upload it instead of invoking a per-record tool many times. Every operation is authorized against your visible tools before any run; a forbidden or malformed operation aborts the whole batch with nothing executed.';
|
|
4812
|
-
return {
|
|
5064
|
+
return buildStaticToolDefinition({
|
|
4813
5065
|
name: name,
|
|
4814
5066
|
description: description,
|
|
4815
5067
|
inputSchema: BATCH_EXECUTE_INPUT_SCHEMA,
|
|
@@ -4819,20 +5071,11 @@ function _ts_generator$3(thisArg, body) {
|
|
|
4819
5071
|
modelType: BATCH_EXECUTE_DISPATCH_MODEL_TYPE
|
|
4820
5072
|
},
|
|
4821
5073
|
staticHandler: handler,
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
effectiveReadOnly: false
|
|
4828
|
-
},
|
|
4829
|
-
staticWireEntry: buildStaticWireEntry({
|
|
4830
|
-
name: name,
|
|
4831
|
-
description: description,
|
|
4832
|
-
inputSchema: BATCH_EXECUTE_INPUT_SCHEMA,
|
|
4833
|
-
outputSchema: BATCH_EXECUTE_OUTPUT_SCHEMA
|
|
4834
|
-
})
|
|
4835
|
-
};
|
|
5074
|
+
effectiveReadOnly: false,
|
|
5075
|
+
rule: {
|
|
5076
|
+
requireAuthenticated: true
|
|
5077
|
+
}
|
|
5078
|
+
});
|
|
4836
5079
|
}
|
|
4837
5080
|
// MARK: Handler
|
|
4838
5081
|
function batchExecuteToolHandler(args, ctx, deps) {
|
|
@@ -5536,6 +5779,25 @@ function _object_spread(target) {
|
|
|
5536
5779
|
}
|
|
5537
5780
|
return target;
|
|
5538
5781
|
}
|
|
5782
|
+
function ownKeys(object, enumerableOnly) {
|
|
5783
|
+
var keys = Object.keys(object);
|
|
5784
|
+
if (Object.getOwnPropertySymbols) {
|
|
5785
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
5786
|
+
keys.push.apply(keys, symbols);
|
|
5787
|
+
}
|
|
5788
|
+
return keys;
|
|
5789
|
+
}
|
|
5790
|
+
function _object_spread_props(target, source) {
|
|
5791
|
+
source = source != null ? source : {};
|
|
5792
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
5793
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
5794
|
+
} else {
|
|
5795
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
5796
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
5797
|
+
});
|
|
5798
|
+
}
|
|
5799
|
+
return target;
|
|
5800
|
+
}
|
|
5539
5801
|
function _sliced_to_array(arr, i) {
|
|
5540
5802
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest();
|
|
5541
5803
|
}
|
|
@@ -5681,6 +5943,7 @@ var McpServerFactoryService_1;
|
|
|
5681
5943
|
_define_property$3(this, "_manifestLoaded", false);
|
|
5682
5944
|
_define_property$3(this, "_loggedSkips", false);
|
|
5683
5945
|
_define_property$3(this, "_warnedMissingRoleReader", false);
|
|
5946
|
+
_define_property$3(this, "_resolvedReasonConfig", void 0);
|
|
5684
5947
|
_define_property$3(this, "_analyticsService", void 0);
|
|
5685
5948
|
this.mcpConfig = mcpConfig;
|
|
5686
5949
|
this.dispatchService = dispatchService;
|
|
@@ -6383,11 +6646,32 @@ var McpServerFactoryService_1;
|
|
|
6383
6646
|
},
|
|
6384
6647
|
{
|
|
6385
6648
|
/**
|
|
6649
|
+
* Resolves the app's reason-parameter config once and caches it for the process lifetime.
|
|
6650
|
+
*
|
|
6651
|
+
* The underlying {@link McpModuleConfig.reasonParameter} value is fixed at boot, so the normalized
|
|
6652
|
+
* form is safe to memoize and reuse across every `tools/list` and `tools/call`.
|
|
6653
|
+
*
|
|
6654
|
+
* @returns The resolved reason-parameter config (defaults applied).
|
|
6655
|
+
*/ key: "_resolveReasonConfig",
|
|
6656
|
+
value: function _resolveReasonConfig() {
|
|
6657
|
+
var result = this._resolvedReasonConfig;
|
|
6658
|
+
if (result == null) {
|
|
6659
|
+
result = resolveMcpReasonParameterConfig(this.mcpConfig.reasonParameter);
|
|
6660
|
+
this._resolvedReasonConfig = result;
|
|
6661
|
+
}
|
|
6662
|
+
return result;
|
|
6663
|
+
}
|
|
6664
|
+
},
|
|
6665
|
+
{
|
|
6666
|
+
/**
|
|
6386
6667
|
* Resolves the wire-shape `tools/list` entry for a single tool.
|
|
6387
6668
|
*
|
|
6388
6669
|
* Hot-path short-circuit: tools without a `toolDetailsBuilder` reuse the precomputed,
|
|
6389
6670
|
* frozen {@link McpToolDefinition.staticWireEntry} verbatim — zero allocations per
|
|
6390
|
-
* request for the common case.
|
|
6671
|
+
* request for the common case. When the auto-injected reason parameter is enabled (the
|
|
6672
|
+
* default), the entry is no longer returned frozen-verbatim: its `inputSchema` is wrapped
|
|
6673
|
+
* with the reason property per request (`tools/list` is low-frequency, so the allocation is
|
|
6674
|
+
* acceptable). Tools that already declare the parameter name are still reused verbatim.
|
|
6391
6675
|
*
|
|
6392
6676
|
* Tools that opted in to {@link McpToolDetailsBuilder} get a fresh wire entry built
|
|
6393
6677
|
* from the builder's overrides. If the builder throws, the framework falls back to
|
|
@@ -6399,9 +6683,20 @@ var McpServerFactoryService_1;
|
|
|
6399
6683
|
* @returns The wire-shape entry to emit for this tool on `tools/list`.
|
|
6400
6684
|
*/ key: "_buildToolListEntry",
|
|
6401
6685
|
value: function _buildToolListEntry(tool, ctx, scopes) {
|
|
6686
|
+
var reasonConfig = this._resolveReasonConfig();
|
|
6402
6687
|
var result;
|
|
6403
6688
|
if (tool.toolDetailsBuilder == null) {
|
|
6404
6689
|
result = tool.staticWireEntry;
|
|
6690
|
+
if (reasonConfig.enabled) {
|
|
6691
|
+
var reasoned = applyMcpReasonParameterToSchema(tool.staticWireEntry.inputSchema, reasonConfig);
|
|
6692
|
+
// applyMcpReasonParameterToSchema self-skips (returns the same reference) on collision, so the
|
|
6693
|
+
// frozen-verbatim hot path still holds for tools that already declare the parameter name.
|
|
6694
|
+
if (reasoned !== tool.staticWireEntry.inputSchema) {
|
|
6695
|
+
result = _object_spread_props(_object_spread({}, tool.staticWireEntry), {
|
|
6696
|
+
inputSchema: reasoned
|
|
6697
|
+
});
|
|
6698
|
+
}
|
|
6699
|
+
}
|
|
6405
6700
|
} else {
|
|
6406
6701
|
var description = tool.description;
|
|
6407
6702
|
var inputSchema = tool.inputSchema;
|
|
@@ -6422,12 +6717,16 @@ var McpServerFactoryService_1;
|
|
|
6422
6717
|
} catch (error) {
|
|
6423
6718
|
this._logger.warn("MCP tool ".concat(tool.name, " toolDetails builder threw; falling back to defaults: ").concat(error.message));
|
|
6424
6719
|
}
|
|
6720
|
+
var resolvedInputSchema = inputSchema !== null && inputSchema !== void 0 ? inputSchema : {
|
|
6721
|
+
type: 'object'
|
|
6722
|
+
};
|
|
6723
|
+
if (reasonConfig.enabled) {
|
|
6724
|
+
resolvedInputSchema = applyMcpReasonParameterToSchema(resolvedInputSchema, reasonConfig);
|
|
6725
|
+
}
|
|
6425
6726
|
var wire = {
|
|
6426
6727
|
name: tool.name,
|
|
6427
6728
|
description: description,
|
|
6428
|
-
inputSchema:
|
|
6429
|
-
type: 'object'
|
|
6430
|
-
}
|
|
6729
|
+
inputSchema: resolvedInputSchema
|
|
6431
6730
|
};
|
|
6432
6731
|
if (tool.outputSchema != null) {
|
|
6433
6732
|
wire.outputSchema = tool.outputSchema;
|
|
@@ -6457,14 +6756,20 @@ var McpServerFactoryService_1;
|
|
|
6457
6756
|
* @returns The MCP tool response.
|
|
6458
6757
|
*/ function _handleToolCall(request, definitionsByName, ctx) {
|
|
6459
6758
|
return _async_to_generator$2(function() {
|
|
6460
|
-
var _request_params_arguments, _ctx_auth, toolName, definition,
|
|
6759
|
+
var _request_params_arguments, _ctx_auth, toolName, definition, rawArgs, startedAt, reasonConfig, declaresOwn, _extractMcpReasonFromArgs, reason, args, outcome, isSuccessful, toolKind;
|
|
6461
6760
|
return _ts_generator$2(this, function(_state) {
|
|
6462
6761
|
switch(_state.label){
|
|
6463
6762
|
case 0:
|
|
6464
6763
|
toolName = request.params.name;
|
|
6465
6764
|
definition = definitionsByName.get(toolName);
|
|
6466
|
-
|
|
6765
|
+
rawArgs = (_request_params_arguments = request.params.arguments) !== null && _request_params_arguments !== void 0 ? _request_params_arguments : {};
|
|
6467
6766
|
startedAt = Date.now();
|
|
6767
|
+
// Split the auto-injected reason out of the args: forward it to analytics, but never let it reach
|
|
6768
|
+
// the underlying handler. Tools that declare their own field of the same name keep it (driven by
|
|
6769
|
+
// the tool's own resolved inputSchema, not the reason-augmented wire schema).
|
|
6770
|
+
reasonConfig = this._resolveReasonConfig();
|
|
6771
|
+
declaresOwn = mcpSchemaDeclaresProperty(definition === null || definition === void 0 ? void 0 : definition.inputSchema, reasonConfig.parameterName);
|
|
6772
|
+
_extractMcpReasonFromArgs = extractMcpReasonFromArgs(rawArgs, reasonConfig, declaresOwn), reason = _extractMcpReasonFromArgs.reason, args = _extractMcpReasonFromArgs.args;
|
|
6468
6773
|
if (!(definition == null)) return [
|
|
6469
6774
|
3,
|
|
6470
6775
|
1
|
|
@@ -6514,6 +6819,7 @@ var McpServerFactoryService_1;
|
|
|
6514
6819
|
auth: ctx.auth,
|
|
6515
6820
|
readOnly: this.mcpConfig.readOnly === true,
|
|
6516
6821
|
args: args,
|
|
6822
|
+
reason: reason,
|
|
6517
6823
|
isSuccessful: isSuccessful,
|
|
6518
6824
|
error: outcome.error,
|
|
6519
6825
|
durationMs: Date.now() - startedAt
|
|
@@ -7355,18 +7661,20 @@ var FirebaseServerMcpAnalyticsService_1;
|
|
|
7355
7661
|
if (this._logEvents) {
|
|
7356
7662
|
var uidSuffix = event.uid ? " uid=".concat(event.uid) : '';
|
|
7357
7663
|
var durationSuffix = event.durationMs == null ? '' : " (".concat(event.durationMs, "ms)");
|
|
7664
|
+
var reasonSuffix = event.reason ? ' reason="'.concat(event.reason, '"') : '';
|
|
7358
7665
|
var outcome = event.isSuccessful ? 'Succeeded' : 'Failed';
|
|
7359
|
-
this._logger.log("MCP ".concat(event.toolName, " [").concat(event.toolKind, "] ").concat(outcome).concat(uidSuffix).concat(durationSuffix));
|
|
7666
|
+
this._logger.log("MCP ".concat(event.toolName, " [").concat(event.toolKind, "] ").concat(outcome).concat(uidSuffix).concat(durationSuffix).concat(reasonSuffix));
|
|
7360
7667
|
}
|
|
7361
7668
|
if (this.analyticsService != null) {
|
|
7362
|
-
var _event_call, _event_modelType, _event_specifier;
|
|
7669
|
+
var _event_call, _event_modelType, _event_specifier, _event_reason;
|
|
7363
7670
|
this.analyticsService.sendEventData(event.uid, this._eventName, {
|
|
7364
7671
|
tool: event.toolName,
|
|
7365
7672
|
toolKind: event.toolKind,
|
|
7366
7673
|
call: (_event_call = event.call) !== null && _event_call !== void 0 ? _event_call : '',
|
|
7367
7674
|
modelType: (_event_modelType = event.modelType) !== null && _event_modelType !== void 0 ? _event_modelType : '',
|
|
7368
7675
|
specifier: (_event_specifier = event.specifier) !== null && _event_specifier !== void 0 ? _event_specifier : '',
|
|
7369
|
-
success: event.isSuccessful
|
|
7676
|
+
success: event.isSuccessful,
|
|
7677
|
+
reason: (_event_reason = event.reason) !== null && _event_reason !== void 0 ? _event_reason : ''
|
|
7370
7678
|
});
|
|
7371
7679
|
}
|
|
7372
7680
|
}
|
|
@@ -7453,4 +7761,4 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
7453
7761
|
};
|
|
7454
7762
|
}
|
|
7455
7763
|
|
|
7456
|
-
export { BATCH_EXECUTE_DISPATCH_CALL, BATCH_EXECUTE_DISPATCH_MODEL_TYPE, BATCH_EXECUTE_TOOL_NAME, DEFAULT_BATCH_EXECUTE_MAX_PARALLEL, DEFAULT_JSON_SCHEMA_GENERATION_OPTIONS, DEFAULT_MCP_ANALYTICS_EVENT_NAME, DEFAULT_MCP_PATH, DEFAULT_MCP_SERVER_INSTRUCTIONS, DEFAULT_MCP_SERVER_NAME, DEFAULT_SPECIFIER_KEY, DEFAULT_VOID_MCP_SUCCESS_VALUE, ENUM_INFO_DISPATCH_CALL, ENUM_INFO_DISPATCH_MODEL_TYPE, ENUM_INFO_TOOL_NAME, ENUM_TABLE_SCHEMA, FIREBASE_SERVER_MCP_ANALYTICS_CONFIG, FIREBASE_SERVER_MCP_ROUTES_FOR_GLOBAL_ROUTE_EXCLUDE, FirebaseServerMcpAnalyticsService, MAX_BATCH_EXECUTE_FILE_BYTES, MAX_BATCH_EXECUTE_OPERATIONS, MCP_ANALYTICS_SERVICE, MCP_AUTH_ROLE_READER, MCP_CALL_TYPE_ABBREVIATIONS, MCP_MANIFEST_VERSION, MCP_MODEL_GET_BATCH_SIZE, MCP_TOOL_NAME_MAX_LENGTH, MCP_TOOL_NAME_WARN_LENGTH, MCP_WRITE_TOOL_DESCRIPTION_PREFIX, MODEL_DECODE_DISPATCH_CALL, MODEL_DECODE_DISPATCH_MODEL_TYPE, MODEL_DECODE_TOOL_NAME, MODEL_GET_DISPATCH_CALL, MODEL_GET_DISPATCH_MODEL_TYPE, MODEL_GET_TOOL_NAME, MODEL_INFO_DISPATCH_CALL, MODEL_INFO_DISPATCH_MODEL_TYPE, MODEL_INFO_GROUPS_HINT, MODEL_INFO_TOOL_NAME, MODEL_INFO_UNGROUPED_LABEL, McpAnalyticsService, McpController, McpModuleConfig, McpServerFactoryService, McpWellKnownController, ROUTE_MANIFEST_VERSION, URL_MODELS_DISPATCH_CALL, URL_MODELS_DISPATCH_MODEL_TYPE, URL_MODELS_TOOL_NAME, abbreviateMcpCallType, appMcpAnalyticsModuleMetadata, applyWriteMarker, batchOperationCoordKey, buildDefaultMcpToolDescription, buildDisambiguatedMcpToolName, buildMcpToolName, buildStaticWireEntry, classifyVisibility, createBatchExecuteTool, createEnumInfoTool, createModelDecodeTool, createModelGetTool, createModelInfoTool, createUrlModelsTool, decodeFirestoreModelKey, findModelEntry, formatMcpToolErrorResponse, formatMcpToolResponse, generateMcpToolDefinitions, handleStreamableHttpMcpRequest, matchRouteManifestUrl, mcpManifestKey, mcpModuleMetadata, noopMcpAnalyticsService, parseUrlModelsPathname, resolveEffectiveReadOnly, resolveEnumInfoOutput, resolveMcpToolAnnotations, resolveRequiredScope, validateMcpToolName };
|
|
7764
|
+
export { BATCH_EXECUTE_DISPATCH_CALL, BATCH_EXECUTE_DISPATCH_MODEL_TYPE, BATCH_EXECUTE_TOOL_NAME, DEFAULT_BATCH_EXECUTE_MAX_PARALLEL, DEFAULT_JSON_SCHEMA_GENERATION_OPTIONS, DEFAULT_MCP_ANALYTICS_EVENT_NAME, DEFAULT_MCP_PATH, DEFAULT_MCP_REASON_PARAMETER_DESCRIPTION, DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH, DEFAULT_MCP_REASON_PARAMETER_NAME, DEFAULT_MCP_REASON_PARAMETER_REQUIRED, DEFAULT_MCP_SERVER_INSTRUCTIONS, DEFAULT_MCP_SERVER_NAME, DEFAULT_SPECIFIER_KEY, DEFAULT_VOID_MCP_SUCCESS_VALUE, ENUM_INFO_DISPATCH_CALL, ENUM_INFO_DISPATCH_MODEL_TYPE, ENUM_INFO_TOOL_NAME, ENUM_TABLE_SCHEMA, FIREBASE_SERVER_MCP_ANALYTICS_CONFIG, FIREBASE_SERVER_MCP_ROUTES_FOR_GLOBAL_ROUTE_EXCLUDE, FirebaseServerMcpAnalyticsService, MAX_BATCH_EXECUTE_FILE_BYTES, MAX_BATCH_EXECUTE_OPERATIONS, MCP_ANALYTICS_SERVICE, MCP_AUTH_ROLE_READER, MCP_CALL_TYPE_ABBREVIATIONS, MCP_MANIFEST_VERSION, MCP_MODEL_GET_BATCH_SIZE, MCP_TOOL_NAME_MAX_LENGTH, MCP_TOOL_NAME_WARN_LENGTH, MCP_WRITE_TOOL_DESCRIPTION_PREFIX, MODEL_DECODE_DISPATCH_CALL, MODEL_DECODE_DISPATCH_MODEL_TYPE, MODEL_DECODE_TOOL_NAME, MODEL_GET_DISPATCH_CALL, MODEL_GET_DISPATCH_MODEL_TYPE, MODEL_GET_TOOL_NAME, MODEL_INFO_DISPATCH_CALL, MODEL_INFO_DISPATCH_MODEL_TYPE, MODEL_INFO_GROUPS_HINT, MODEL_INFO_TOOL_NAME, MODEL_INFO_UNGROUPED_LABEL, McpAnalyticsService, McpController, McpModuleConfig, McpServerFactoryService, McpWellKnownController, ROUTE_MANIFEST_VERSION, URL_MODELS_DISPATCH_CALL, URL_MODELS_DISPATCH_MODEL_TYPE, URL_MODELS_TOOL_NAME, abbreviateMcpCallType, appMcpAnalyticsModuleMetadata, applyMcpReasonParameterToSchema, applyWriteMarker, batchOperationCoordKey, buildDefaultMcpToolDescription, buildDisambiguatedMcpToolName, buildMcpToolName, buildStaticToolDefinition, buildStaticWireEntry, classifyVisibility, createBatchExecuteTool, createEnumInfoTool, createModelDecodeTool, createModelGetTool, createModelInfoTool, createUrlModelsTool, decodeFirestoreModelKey, extractMcpReasonFromArgs, findModelEntry, formatMcpToolErrorResponse, formatMcpToolResponse, generateMcpToolDefinitions, handleStreamableHttpMcpRequest, matchRouteManifestUrl, mcpManifestKey, mcpModuleMetadata, mcpSchemaDeclaresProperty, noopMcpAnalyticsService, parseUrlModelsPathname, resolveEffectiveReadOnly, resolveEnumInfoOutput, resolveMcpReasonParameterConfig, resolveMcpToolAnnotations, resolveRequiredScope, validateMcpToolName };
|