@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.cjs.js
CHANGED
|
@@ -17,7 +17,7 @@ function _class_call_check$5(instance, Constructor) {
|
|
|
17
17
|
throw new TypeError("Cannot call a class as a function");
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function _define_property$
|
|
20
|
+
function _define_property$9(obj, key, value) {
|
|
21
21
|
if (key in obj) {
|
|
22
22
|
Object.defineProperty(obj, key, {
|
|
23
23
|
value: value,
|
|
@@ -47,6 +47,23 @@ function _define_property$8(obj, key, value) {
|
|
|
47
47
|
* Default `instructions` string advertised by the MCP server on the JSON-RPC `initialize`
|
|
48
48
|
* handshake. Apps may override this via {@link McpModuleConfig.serverInstructions}.
|
|
49
49
|
*/ var DEFAULT_MCP_SERVER_INSTRUCTIONS = 'A set of call-model tools generated automatically.';
|
|
50
|
+
/**
|
|
51
|
+
* Default name of the auto-injected reason parameter added to every advertised MCP tool's input
|
|
52
|
+
* schema. See {@link McpReasonParameterConfig.parameterName}.
|
|
53
|
+
*/ var DEFAULT_MCP_REASON_PARAMETER_NAME = 'reason';
|
|
54
|
+
/**
|
|
55
|
+
* Default maximum length (in characters) of the auto-injected reason parameter. Values longer than
|
|
56
|
+
* this are clamped server-side before being forwarded to analytics. See
|
|
57
|
+
* {@link McpReasonParameterConfig.maxLength}.
|
|
58
|
+
*/ var DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH = 250;
|
|
59
|
+
/**
|
|
60
|
+
* Default required-ness of the auto-injected reason parameter. See
|
|
61
|
+
* {@link McpReasonParameterConfig.required}.
|
|
62
|
+
*/ var DEFAULT_MCP_REASON_PARAMETER_REQUIRED = true;
|
|
63
|
+
/**
|
|
64
|
+
* Default description advertised for the auto-injected reason parameter on every tool's input schema.
|
|
65
|
+
* See {@link McpReasonParameterConfig.description}.
|
|
66
|
+
*/ 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.';
|
|
50
67
|
/**
|
|
51
68
|
* Configuration for the firebase-server/mcp module.
|
|
52
69
|
*
|
|
@@ -71,7 +88,7 @@ function _define_property$8(obj, key, value) {
|
|
|
71
88
|
* discovery document. Claude custom-connector reads this to discover the OIDC issuer.
|
|
72
89
|
*
|
|
73
90
|
* @example 'https://api.example.com/oidc'
|
|
74
|
-
*/ _define_property$
|
|
91
|
+
*/ _define_property$9(this, "oidcIssuer", void 0);
|
|
75
92
|
/**
|
|
76
93
|
* The canonical resource URL of the MCP endpoint.
|
|
77
94
|
*
|
|
@@ -79,19 +96,19 @@ function _define_property$8(obj, key, value) {
|
|
|
79
96
|
* and used as the audience the access token's `aud` claim should match.
|
|
80
97
|
*
|
|
81
98
|
* @example 'https://api.example.com/mcp'
|
|
82
|
-
*/ _define_property$
|
|
99
|
+
*/ _define_property$9(this, "mcpUrl", void 0);
|
|
83
100
|
/**
|
|
84
101
|
* Optional name advertised on the MCP `initialize` handshake. Defaults to
|
|
85
102
|
* {@link DEFAULT_MCP_SERVER_NAME}.
|
|
86
|
-
*/ _define_property$
|
|
103
|
+
*/ _define_property$9(this, "serverName", void 0);
|
|
87
104
|
/**
|
|
88
105
|
* Optional version advertised on the MCP `initialize` handshake.
|
|
89
|
-
*/ _define_property$
|
|
106
|
+
*/ _define_property$9(this, "serverVersion", void 0);
|
|
90
107
|
/**
|
|
91
108
|
* Optional override for the `instructions` string passed to `new McpServer(...)` and
|
|
92
109
|
* advertised on the JSON-RPC `initialize` handshake. Defaults to
|
|
93
110
|
* {@link DEFAULT_MCP_SERVER_INSTRUCTIONS}.
|
|
94
|
-
*/ _define_property$
|
|
111
|
+
*/ _define_property$9(this, "serverInstructions", void 0);
|
|
95
112
|
/**
|
|
96
113
|
* Absolute path to a pre-rendered MCP manifest JSON file produced by
|
|
97
114
|
* `dbx-cli-generate-mcp-manifest`. When set, the runtime reads it once at
|
|
@@ -101,7 +118,7 @@ function _define_property$8(obj, key, value) {
|
|
|
101
118
|
* Optional. When unset or the file is missing, the runtime falls back to
|
|
102
119
|
* today's behavior (auto-generated descriptions, ArkType-derived input
|
|
103
120
|
* schemas, no output schemas) and emits a single boot warning.
|
|
104
|
-
*/ _define_property$
|
|
121
|
+
*/ _define_property$9(this, "mcpManifestPath", void 0);
|
|
105
122
|
/**
|
|
106
123
|
* Absolute path to a pre-rendered route manifest JSON file produced by
|
|
107
124
|
* `dbx-cli-generate-route-manifest`. When set, the runtime reads it once at
|
|
@@ -111,7 +128,7 @@ function _define_property$8(obj, key, value) {
|
|
|
111
128
|
* Optional. When unset or the file is missing, the runtime skips registering
|
|
112
129
|
* `url-models` and emits a single boot warning when the path was set but
|
|
113
130
|
* unreadable.
|
|
114
|
-
*/ _define_property$
|
|
131
|
+
*/ _define_property$9(this, "mcpRouteManifestPath", void 0);
|
|
115
132
|
/**
|
|
116
133
|
* When `true`, the MCP server only advertises tools whose effective read-only classification is `true`.
|
|
117
134
|
*
|
|
@@ -121,19 +138,29 @@ function _define_property$8(obj, key, value) {
|
|
|
121
138
|
*
|
|
122
139
|
* The advertised `serverName` on the JSON-RPC `initialize` handshake is suffixed with
|
|
123
140
|
* ` (read-only)` so the client surface reflects the mode.
|
|
124
|
-
*/ _define_property$
|
|
141
|
+
*/ _define_property$9(this, "readOnly", void 0);
|
|
142
|
+
/**
|
|
143
|
+
* Controls the auto-injected `reason` parameter added to every advertised tool's input schema.
|
|
144
|
+
*
|
|
145
|
+
* Enabled by default (unset / `true` = defaults on). Pass a {@link McpReasonParameterConfig} object
|
|
146
|
+
* to tune `required`, `maxLength`, `description`, or `parameterName`, or `false` to disable it.
|
|
147
|
+
*
|
|
148
|
+
* When enabled, every advertised tool's `inputSchema` carries a required `reason` string the model
|
|
149
|
+
* fills with a short justification for the call. The value is forwarded to analytics and stripped
|
|
150
|
+
* from the dispatched handler body. See {@link McpReasonParameterConfig}.
|
|
151
|
+
*/ _define_property$9(this, "reasonParameter", void 0);
|
|
125
152
|
};
|
|
126
153
|
/**
|
|
127
154
|
* NestJS injection token for the optional {@link McpAuthRoleReader} provider.
|
|
128
155
|
*/ var MCP_AUTH_ROLE_READER = 'MCP_AUTH_ROLE_READER';
|
|
129
156
|
|
|
130
|
-
function _type_of$
|
|
157
|
+
function _type_of$5(obj) {
|
|
131
158
|
"@swc/helpers - typeof";
|
|
132
159
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
133
160
|
}
|
|
134
161
|
function __decorate(decorators, target, key, desc) {
|
|
135
162
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
136
|
-
if ((typeof Reflect === "undefined" ? "undefined" : _type_of$
|
|
163
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _type_of$5(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
137
164
|
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;
|
|
138
165
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
139
166
|
}
|
|
@@ -147,6 +174,206 @@ typeof SuppressedError === "function" ? SuppressedError : function(error, suppre
|
|
|
147
174
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
148
175
|
};
|
|
149
176
|
|
|
177
|
+
function _array_like_to_array$a(arr, len) {
|
|
178
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
179
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
180
|
+
return arr2;
|
|
181
|
+
}
|
|
182
|
+
function _array_without_holes$7(arr) {
|
|
183
|
+
if (Array.isArray(arr)) return _array_like_to_array$a(arr);
|
|
184
|
+
}
|
|
185
|
+
function _define_property$8(obj, key, value) {
|
|
186
|
+
if (key in obj) {
|
|
187
|
+
Object.defineProperty(obj, key, {
|
|
188
|
+
value: value,
|
|
189
|
+
enumerable: true,
|
|
190
|
+
configurable: true,
|
|
191
|
+
writable: true
|
|
192
|
+
});
|
|
193
|
+
} else {
|
|
194
|
+
obj[key] = value;
|
|
195
|
+
}
|
|
196
|
+
return obj;
|
|
197
|
+
}
|
|
198
|
+
function _iterable_to_array$7(iter) {
|
|
199
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
200
|
+
}
|
|
201
|
+
function _non_iterable_spread$7() {
|
|
202
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
203
|
+
}
|
|
204
|
+
function _object_spread$5(target) {
|
|
205
|
+
for(var i = 1; i < arguments.length; i++){
|
|
206
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
207
|
+
var ownKeys = Object.keys(source);
|
|
208
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
209
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
210
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
ownKeys.forEach(function(key) {
|
|
214
|
+
_define_property$8(target, key, source[key]);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return target;
|
|
218
|
+
}
|
|
219
|
+
function ownKeys$3(object, enumerableOnly) {
|
|
220
|
+
var keys = Object.keys(object);
|
|
221
|
+
if (Object.getOwnPropertySymbols) {
|
|
222
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
223
|
+
keys.push.apply(keys, symbols);
|
|
224
|
+
}
|
|
225
|
+
return keys;
|
|
226
|
+
}
|
|
227
|
+
function _object_spread_props$3(target, source) {
|
|
228
|
+
source = source != null ? source : {};
|
|
229
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
230
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
231
|
+
} else {
|
|
232
|
+
ownKeys$3(Object(source)).forEach(function(key) {
|
|
233
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
return target;
|
|
237
|
+
}
|
|
238
|
+
function _to_consumable_array$7(arr) {
|
|
239
|
+
return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$7();
|
|
240
|
+
}
|
|
241
|
+
function _type_of$4(obj) {
|
|
242
|
+
"@swc/helpers - typeof";
|
|
243
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
244
|
+
}
|
|
245
|
+
function _unsupported_iterable_to_array$a(o, minLen) {
|
|
246
|
+
if (!o) return;
|
|
247
|
+
if (typeof o === "string") return _array_like_to_array$a(o, minLen);
|
|
248
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
249
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
250
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
251
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Normalizes the app-supplied {@link McpModuleConfig.reasonParameter} value (object / boolean /
|
|
255
|
+
* undefined) into a fully-resolved {@link ResolvedMcpReasonParameterConfig} with the package defaults
|
|
256
|
+
* applied.
|
|
257
|
+
*
|
|
258
|
+
* - `undefined` / `true` → defaults, enabled.
|
|
259
|
+
* - `false` → defaults, but `enabled: false`.
|
|
260
|
+
* - object → per-field overrides on top of the defaults (`enabled` defaults to `true`).
|
|
261
|
+
*
|
|
262
|
+
* @param config - The raw config from {@link McpModuleConfig.reasonParameter}.
|
|
263
|
+
* @returns The resolved config with all defaults applied.
|
|
264
|
+
*/ function resolveMcpReasonParameterConfig(config) {
|
|
265
|
+
var result;
|
|
266
|
+
if (config === false) {
|
|
267
|
+
result = {
|
|
268
|
+
enabled: false,
|
|
269
|
+
required: DEFAULT_MCP_REASON_PARAMETER_REQUIRED,
|
|
270
|
+
maxLength: DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH,
|
|
271
|
+
description: DEFAULT_MCP_REASON_PARAMETER_DESCRIPTION,
|
|
272
|
+
parameterName: DEFAULT_MCP_REASON_PARAMETER_NAME
|
|
273
|
+
};
|
|
274
|
+
} else if (config == null || config === true) {
|
|
275
|
+
result = {
|
|
276
|
+
enabled: true,
|
|
277
|
+
required: DEFAULT_MCP_REASON_PARAMETER_REQUIRED,
|
|
278
|
+
maxLength: DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH,
|
|
279
|
+
description: DEFAULT_MCP_REASON_PARAMETER_DESCRIPTION,
|
|
280
|
+
parameterName: DEFAULT_MCP_REASON_PARAMETER_NAME
|
|
281
|
+
};
|
|
282
|
+
} else {
|
|
283
|
+
var _config_enabled, _config_required, _config_maxLength, _config_description, _config_parameterName;
|
|
284
|
+
result = {
|
|
285
|
+
enabled: (_config_enabled = config.enabled) !== null && _config_enabled !== void 0 ? _config_enabled : true,
|
|
286
|
+
required: (_config_required = config.required) !== null && _config_required !== void 0 ? _config_required : DEFAULT_MCP_REASON_PARAMETER_REQUIRED,
|
|
287
|
+
maxLength: (_config_maxLength = config.maxLength) !== null && _config_maxLength !== void 0 ? _config_maxLength : DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH,
|
|
288
|
+
description: (_config_description = config.description) !== null && _config_description !== void 0 ? _config_description : DEFAULT_MCP_REASON_PARAMETER_DESCRIPTION,
|
|
289
|
+
parameterName: (_config_parameterName = config.parameterName) !== null && _config_parameterName !== void 0 ? _config_parameterName : DEFAULT_MCP_REASON_PARAMETER_NAME
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Returns `true` when the JSON schema already declares a property named `name` under `properties`.
|
|
296
|
+
*
|
|
297
|
+
* Used as the collision guard so a handler that legitimately consumes its own field of the same name
|
|
298
|
+
* is never double-declared (schema injection) or stripped (arg extraction).
|
|
299
|
+
*
|
|
300
|
+
* @param schema - The candidate JSON schema object (may be `undefined`).
|
|
301
|
+
* @param name - The property name to look for.
|
|
302
|
+
* @returns Whether the schema's `properties` already contains `name`.
|
|
303
|
+
*/ function mcpSchemaDeclaresProperty(schema, name) {
|
|
304
|
+
var properties = schema === null || schema === void 0 ? void 0 : schema.properties;
|
|
305
|
+
return properties != null && (typeof properties === "undefined" ? "undefined" : _type_of$4(properties)) === 'object' && Object.prototype.hasOwnProperty.call(properties, name);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Returns a NEW JSON schema object with the reason parameter property merged into `properties` (and
|
|
309
|
+
* appended to `required` when configured). Never mutates the input — the static wire schemas are
|
|
310
|
+
* shared module-level constants reused across requests.
|
|
311
|
+
*
|
|
312
|
+
* Self-skips (returns the input schema unchanged) when the config is disabled or the schema already
|
|
313
|
+
* declares the parameter name. Defensive against a non-object / missing-`properties` input.
|
|
314
|
+
*
|
|
315
|
+
* @param inputSchema - The tool's resolved input schema.
|
|
316
|
+
* @param resolved - The resolved reason-parameter config.
|
|
317
|
+
* @returns A new schema carrying the reason property, or the original schema when skipped.
|
|
318
|
+
*/ function applyMcpReasonParameterToSchema(inputSchema, resolved) {
|
|
319
|
+
var result = inputSchema;
|
|
320
|
+
if (resolved.enabled && !mcpSchemaDeclaresProperty(inputSchema, resolved.parameterName)) {
|
|
321
|
+
var _base_type;
|
|
322
|
+
var base = (typeof inputSchema === "undefined" ? "undefined" : _type_of$4(inputSchema)) === 'object' && inputSchema != null ? inputSchema : {};
|
|
323
|
+
var existingProperties = _type_of$4(base.properties) === 'object' && base.properties != null ? base.properties : {};
|
|
324
|
+
var next = _object_spread_props$3(_object_spread$5({}, base), {
|
|
325
|
+
type: (_base_type = base.type) !== null && _base_type !== void 0 ? _base_type : 'object',
|
|
326
|
+
properties: _object_spread_props$3(_object_spread$5({}, existingProperties), _define_property$8({}, resolved.parameterName, {
|
|
327
|
+
type: 'string',
|
|
328
|
+
maxLength: resolved.maxLength,
|
|
329
|
+
description: resolved.description
|
|
330
|
+
}))
|
|
331
|
+
});
|
|
332
|
+
if (resolved.required) {
|
|
333
|
+
var existingRequired = Array.isArray(base.required) ? base.required : [];
|
|
334
|
+
next.required = existingRequired.includes(resolved.parameterName) ? _to_consumable_array$7(existingRequired) : _to_consumable_array$7(existingRequired).concat([
|
|
335
|
+
resolved.parameterName
|
|
336
|
+
]);
|
|
337
|
+
}
|
|
338
|
+
result = next;
|
|
339
|
+
}
|
|
340
|
+
return result;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Splits the auto-injected reason value out of a tool call's raw arguments.
|
|
344
|
+
*
|
|
345
|
+
* When enabled and the tool did NOT declare its own field of the same name: shallow-copies the args,
|
|
346
|
+
* deletes the parameter key, and coerces + clamps the value to `maxLength` (the client is not trusted).
|
|
347
|
+
* An empty / absent value yields `reason: undefined`.
|
|
348
|
+
*
|
|
349
|
+
* Otherwise (disabled, or the handler legitimately owns the field) returns the args unchanged so a
|
|
350
|
+
* field the handler actually consumes is never stripped.
|
|
351
|
+
*
|
|
352
|
+
* @param args - The raw `tools/call` arguments.
|
|
353
|
+
* @param resolved - The resolved reason-parameter config.
|
|
354
|
+
* @param toolDeclaresOwnReason - Whether the tool's own input schema already declares the parameter.
|
|
355
|
+
* @returns The extracted reason plus the (possibly stripped) args to dispatch.
|
|
356
|
+
*/ function extractMcpReasonFromArgs(args, resolved, toolDeclaresOwnReason) {
|
|
357
|
+
var result;
|
|
358
|
+
if (resolved.enabled && !toolDeclaresOwnReason && Object.prototype.hasOwnProperty.call(args, resolved.parameterName)) {
|
|
359
|
+
var rawValue = args[resolved.parameterName];
|
|
360
|
+
var nextArgs = _object_spread$5({}, args);
|
|
361
|
+
delete nextArgs[resolved.parameterName];
|
|
362
|
+
var stringValue = rawValue == null ? '' : String(rawValue);
|
|
363
|
+
var clamped = stringValue.length > resolved.maxLength ? stringValue.slice(0, resolved.maxLength) : stringValue;
|
|
364
|
+
result = {
|
|
365
|
+
reason: clamped.length > 0 ? clamped : undefined,
|
|
366
|
+
args: nextArgs
|
|
367
|
+
};
|
|
368
|
+
} else {
|
|
369
|
+
result = {
|
|
370
|
+
reason: undefined,
|
|
371
|
+
args: args
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
return result;
|
|
375
|
+
}
|
|
376
|
+
|
|
150
377
|
function _class_call_check$4(instance, Constructor) {
|
|
151
378
|
if (!(instance instanceof Constructor)) {
|
|
152
379
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -949,6 +1176,46 @@ function _unsupported_iterable_to_array$8(o, minLen) {
|
|
|
949
1176
|
*/ function applyWriteMarker(description, annotations) {
|
|
950
1177
|
return annotations.readOnlyHint === false ? "".concat(MCP_WRITE_TOOL_DESCRIPTION_PREFIX).concat(description) : description;
|
|
951
1178
|
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Assembles a statically-registered {@link McpToolDefinition} with consistent MCP annotations.
|
|
1181
|
+
*
|
|
1182
|
+
* Built-in tools (e.g. `whoami`, `model-get`, `batch-execute`) don't flow through
|
|
1183
|
+
* {@link buildToolFromCandidate}, so this is their analogous single source of truth: it derives the
|
|
1184
|
+
* read/write annotations from {@link BuildStaticToolDefinitionInput.effectiveReadOnly} via
|
|
1185
|
+
* {@link resolveMcpToolAnnotations}, applies the {@link MCP_WRITE_TOOL_DESCRIPTION_PREFIX} write
|
|
1186
|
+
* marker to the description, then mirrors the annotations onto both the definition's `annotations`
|
|
1187
|
+
* field and the frozen {@link McpToolDefinition.staticWireEntry}. Centralizing this guarantees no
|
|
1188
|
+
* built-in tool reaches `tools/list` un-annotated (which would surface as an uncategorized "other"
|
|
1189
|
+
* tool in clients that bucket by `readOnlyHint`).
|
|
1190
|
+
*
|
|
1191
|
+
* @param input - The tool identity, schemas, dispatch target, static handler, and read-only classification.
|
|
1192
|
+
* @returns A statically-registered {@link McpToolDefinition} to append to the MCP server factory's tool registry.
|
|
1193
|
+
*/ function buildStaticToolDefinition(input) {
|
|
1194
|
+
var name = input.name, inputSchema = input.inputSchema, outputSchema = input.outputSchema, dispatch = input.dispatch, staticHandler = input.staticHandler, effectiveReadOnly = input.effectiveReadOnly, rule = input.rule;
|
|
1195
|
+
var annotations = resolveMcpToolAnnotations(effectiveReadOnly);
|
|
1196
|
+
var description = applyWriteMarker(input.description, annotations);
|
|
1197
|
+
return {
|
|
1198
|
+
name: name,
|
|
1199
|
+
description: description,
|
|
1200
|
+
inputSchema: inputSchema,
|
|
1201
|
+
outputSchema: outputSchema,
|
|
1202
|
+
annotations: annotations,
|
|
1203
|
+
dispatch: dispatch,
|
|
1204
|
+
staticHandler: staticHandler,
|
|
1205
|
+
filterMetadata: {
|
|
1206
|
+
visibilityKind: 'declarative',
|
|
1207
|
+
rule: rule !== null && rule !== void 0 ? rule : {},
|
|
1208
|
+
effectiveReadOnly: effectiveReadOnly
|
|
1209
|
+
},
|
|
1210
|
+
staticWireEntry: buildStaticWireEntry({
|
|
1211
|
+
name: name,
|
|
1212
|
+
description: description,
|
|
1213
|
+
inputSchema: inputSchema,
|
|
1214
|
+
outputSchema: outputSchema,
|
|
1215
|
+
annotations: annotations
|
|
1216
|
+
})
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
952
1219
|
// MARK: Naming
|
|
953
1220
|
/**
|
|
954
1221
|
* The default specifier key used when a handler is not behind a specifier router.
|
|
@@ -1646,7 +1913,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
1646
1913
|
};
|
|
1647
1914
|
var name = MODEL_GET_TOOL_NAME;
|
|
1648
1915
|
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.';
|
|
1649
|
-
return {
|
|
1916
|
+
return buildStaticToolDefinition({
|
|
1650
1917
|
name: name,
|
|
1651
1918
|
description: description,
|
|
1652
1919
|
inputSchema: MODEL_GET_INPUT_SCHEMA,
|
|
@@ -1656,20 +1923,11 @@ function _ts_generator$5(thisArg, body) {
|
|
|
1656
1923
|
modelType: MODEL_GET_DISPATCH_MODEL_TYPE
|
|
1657
1924
|
},
|
|
1658
1925
|
staticHandler: handler,
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
effectiveReadOnly: true
|
|
1665
|
-
},
|
|
1666
|
-
staticWireEntry: buildStaticWireEntry({
|
|
1667
|
-
name: name,
|
|
1668
|
-
description: description,
|
|
1669
|
-
inputSchema: MODEL_GET_INPUT_SCHEMA,
|
|
1670
|
-
outputSchema: MODEL_GET_OUTPUT_SCHEMA
|
|
1671
|
-
})
|
|
1672
|
-
};
|
|
1926
|
+
effectiveReadOnly: true,
|
|
1927
|
+
rule: {
|
|
1928
|
+
requireAuthenticated: true
|
|
1929
|
+
}
|
|
1930
|
+
});
|
|
1673
1931
|
}
|
|
1674
1932
|
// MARK: Handler
|
|
1675
1933
|
function modelGetToolHandler(args, ctx, deps) {
|
|
@@ -1940,7 +2198,7 @@ function _object_spread$4(target) {
|
|
|
1940
2198
|
}
|
|
1941
2199
|
return target;
|
|
1942
2200
|
}
|
|
1943
|
-
function ownKeys$
|
|
2201
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
1944
2202
|
var keys = Object.keys(object);
|
|
1945
2203
|
if (Object.getOwnPropertySymbols) {
|
|
1946
2204
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -1948,12 +2206,12 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
1948
2206
|
}
|
|
1949
2207
|
return keys;
|
|
1950
2208
|
}
|
|
1951
|
-
function _object_spread_props$
|
|
2209
|
+
function _object_spread_props$2(target, source) {
|
|
1952
2210
|
source = source != null ? source : {};
|
|
1953
2211
|
if (Object.getOwnPropertyDescriptors) {
|
|
1954
2212
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1955
2213
|
} else {
|
|
1956
|
-
ownKeys$
|
|
2214
|
+
ownKeys$2(Object(source)).forEach(function(key) {
|
|
1957
2215
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1958
2216
|
});
|
|
1959
2217
|
}
|
|
@@ -2017,7 +2275,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
2017
2275
|
var name = MODEL_INFO_TOOL_NAME;
|
|
2018
2276
|
var count = deps.manifest.length;
|
|
2019
2277
|
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.';
|
|
2020
|
-
return {
|
|
2278
|
+
return buildStaticToolDefinition({
|
|
2021
2279
|
name: name,
|
|
2022
2280
|
description: description,
|
|
2023
2281
|
inputSchema: MODEL_INFO_INPUT_SCHEMA,
|
|
@@ -2027,20 +2285,11 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
2027
2285
|
modelType: MODEL_INFO_DISPATCH_MODEL_TYPE
|
|
2028
2286
|
},
|
|
2029
2287
|
staticHandler: handler,
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
effectiveReadOnly: true
|
|
2036
|
-
},
|
|
2037
|
-
staticWireEntry: buildStaticWireEntry({
|
|
2038
|
-
name: name,
|
|
2039
|
-
description: description,
|
|
2040
|
-
inputSchema: MODEL_INFO_INPUT_SCHEMA,
|
|
2041
|
-
outputSchema: MODEL_INFO_OUTPUT_SCHEMA
|
|
2042
|
-
})
|
|
2043
|
-
};
|
|
2288
|
+
effectiveReadOnly: true,
|
|
2289
|
+
rule: {
|
|
2290
|
+
requireAuthenticated: true
|
|
2291
|
+
}
|
|
2292
|
+
});
|
|
2044
2293
|
}
|
|
2045
2294
|
// MARK: Handler
|
|
2046
2295
|
function modelInfoToolHandler(args, _ctx, deps) {
|
|
@@ -2144,7 +2393,7 @@ function resolveModelInfoOutput(input, manifest) {
|
|
|
2144
2393
|
}
|
|
2145
2394
|
}
|
|
2146
2395
|
if (tables.length > 0) {
|
|
2147
|
-
result = _object_spread_props$
|
|
2396
|
+
result = _object_spread_props$2(_object_spread$4({}, output), {
|
|
2148
2397
|
enums: tables
|
|
2149
2398
|
});
|
|
2150
2399
|
}
|
|
@@ -2198,7 +2447,7 @@ function parseModelInfoInput(args) {
|
|
|
2198
2447
|
var modelGroup = parseModelGroupArg(args['modelGroup']);
|
|
2199
2448
|
var all = parseBooleanArg(args['all'], 'all');
|
|
2200
2449
|
var fields = parseBooleanArg(args['fields'], 'fields');
|
|
2201
|
-
return _object_spread$4(_object_spread_props$
|
|
2450
|
+
return _object_spread$4(_object_spread_props$2(_object_spread$4(_object_spread_props$2(_object_spread$4({}, modelQueries == null ? {} : {
|
|
2202
2451
|
modelQueries: modelQueries
|
|
2203
2452
|
}), {
|
|
2204
2453
|
modelIsArray: Array.isArray(args['model'])
|
|
@@ -2696,7 +2945,7 @@ var MODEL_INFO_OUTPUT_SCHEMA = {
|
|
|
2696
2945
|
type: 'string',
|
|
2697
2946
|
description: 'Present when `mode` is `"list"` from a `modelGroup` filter. The canonical group name.'
|
|
2698
2947
|
},
|
|
2699
|
-
model: _object_spread_props$
|
|
2948
|
+
model: _object_spread_props$2(_object_spread$4({}, MODEL_ROW_SCHEMA), {
|
|
2700
2949
|
description: 'Present when `mode` is `"single"`. The matched model entry (full detail unless `fields:false`).'
|
|
2701
2950
|
}),
|
|
2702
2951
|
notFound: {
|
|
@@ -2831,7 +3080,7 @@ function _object_spread$3(target) {
|
|
|
2831
3080
|
};
|
|
2832
3081
|
var name = MODEL_DECODE_TOOL_NAME;
|
|
2833
3082
|
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', ").");
|
|
2834
|
-
return {
|
|
3083
|
+
return buildStaticToolDefinition({
|
|
2835
3084
|
name: name,
|
|
2836
3085
|
description: description,
|
|
2837
3086
|
inputSchema: MODEL_DECODE_INPUT_SCHEMA,
|
|
@@ -2841,20 +3090,11 @@ function _object_spread$3(target) {
|
|
|
2841
3090
|
modelType: MODEL_DECODE_DISPATCH_MODEL_TYPE
|
|
2842
3091
|
},
|
|
2843
3092
|
staticHandler: handler,
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
effectiveReadOnly: true
|
|
2850
|
-
},
|
|
2851
|
-
staticWireEntry: buildStaticWireEntry({
|
|
2852
|
-
name: name,
|
|
2853
|
-
description: description,
|
|
2854
|
-
inputSchema: MODEL_DECODE_INPUT_SCHEMA,
|
|
2855
|
-
outputSchema: MODEL_DECODE_OUTPUT_SCHEMA
|
|
2856
|
-
})
|
|
2857
|
-
};
|
|
3093
|
+
effectiveReadOnly: true,
|
|
3094
|
+
rule: {
|
|
3095
|
+
requireAuthenticated: true
|
|
3096
|
+
}
|
|
3097
|
+
});
|
|
2858
3098
|
}
|
|
2859
3099
|
// MARK: Handler
|
|
2860
3100
|
function modelDecodeToolHandler(args, _ctx, deps) {
|
|
@@ -3061,7 +3301,7 @@ var MODEL_DECODE_OUTPUT_SCHEMA = {
|
|
|
3061
3301
|
var name = ENUM_INFO_TOOL_NAME;
|
|
3062
3302
|
var count = Object.keys(deps.enums).length;
|
|
3063
3303
|
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`.');
|
|
3064
|
-
return {
|
|
3304
|
+
return buildStaticToolDefinition({
|
|
3065
3305
|
name: name,
|
|
3066
3306
|
description: description,
|
|
3067
3307
|
inputSchema: ENUM_INFO_INPUT_SCHEMA,
|
|
@@ -3071,20 +3311,11 @@ var MODEL_DECODE_OUTPUT_SCHEMA = {
|
|
|
3071
3311
|
modelType: ENUM_INFO_DISPATCH_MODEL_TYPE
|
|
3072
3312
|
},
|
|
3073
3313
|
staticHandler: handler,
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
effectiveReadOnly: true
|
|
3080
|
-
},
|
|
3081
|
-
staticWireEntry: buildStaticWireEntry({
|
|
3082
|
-
name: name,
|
|
3083
|
-
description: description,
|
|
3084
|
-
inputSchema: ENUM_INFO_INPUT_SCHEMA,
|
|
3085
|
-
outputSchema: ENUM_INFO_OUTPUT_SCHEMA
|
|
3086
|
-
})
|
|
3087
|
-
};
|
|
3314
|
+
effectiveReadOnly: true,
|
|
3315
|
+
rule: {
|
|
3316
|
+
requireAuthenticated: true
|
|
3317
|
+
}
|
|
3318
|
+
});
|
|
3088
3319
|
}
|
|
3089
3320
|
// MARK: Handler
|
|
3090
3321
|
function enumInfoToolHandler(args, _ctx, deps) {
|
|
@@ -3341,13 +3572,13 @@ function _unsupported_iterable_to_array$5(o, minLen) {
|
|
|
3341
3572
|
*/ function createWhoamiTool(deps) {
|
|
3342
3573
|
var _ref;
|
|
3343
3574
|
var _deps_auth_app;
|
|
3344
|
-
var handler = function handler(
|
|
3345
|
-
return Promise.resolve(whoamiToolHandler(ctx, deps));
|
|
3575
|
+
var handler = function handler(args, ctx) {
|
|
3576
|
+
return Promise.resolve(whoamiToolHandler(args, ctx, deps));
|
|
3346
3577
|
};
|
|
3347
3578
|
var name = WHOAMI_TOOL_NAME;
|
|
3348
3579
|
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';
|
|
3349
|
-
var description = "Reports the authenticated caller's
|
|
3350
|
-
return {
|
|
3580
|
+
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.');
|
|
3581
|
+
return buildStaticToolDefinition({
|
|
3351
3582
|
name: name,
|
|
3352
3583
|
description: description,
|
|
3353
3584
|
inputSchema: WHOAMI_INPUT_SCHEMA,
|
|
@@ -3357,38 +3588,25 @@ function _unsupported_iterable_to_array$5(o, minLen) {
|
|
|
3357
3588
|
modelType: WHOAMI_DISPATCH_MODEL_TYPE
|
|
3358
3589
|
},
|
|
3359
3590
|
staticHandler: handler,
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
effectiveReadOnly: true
|
|
3364
|
-
},
|
|
3365
|
-
staticWireEntry: buildStaticWireEntry({
|
|
3366
|
-
name: name,
|
|
3367
|
-
description: description,
|
|
3368
|
-
inputSchema: WHOAMI_INPUT_SCHEMA,
|
|
3369
|
-
outputSchema: WHOAMI_OUTPUT_SCHEMA
|
|
3370
|
-
})
|
|
3371
|
-
};
|
|
3591
|
+
effectiveReadOnly: true,
|
|
3592
|
+
rule: {}
|
|
3593
|
+
});
|
|
3372
3594
|
}
|
|
3373
3595
|
// MARK: Handler
|
|
3374
|
-
function whoamiToolHandler(ctx, deps) {
|
|
3596
|
+
function whoamiToolHandler(args, ctx, deps) {
|
|
3375
3597
|
var _auth_token;
|
|
3376
3598
|
var _deps_auth_app;
|
|
3377
3599
|
var auth = ctx.auth;
|
|
3378
3600
|
if ((auth === null || auth === void 0 ? void 0 : auth.uid) == null) {
|
|
3379
|
-
|
|
3380
|
-
authenticated: false
|
|
3381
|
-
|
|
3382
|
-
roles: [],
|
|
3383
|
-
claimDetails: [],
|
|
3384
|
-
unknownClaimKeys: []
|
|
3385
|
-
};
|
|
3386
|
-
return buildResult(output, '# whoami\n\nUnauthenticated.');
|
|
3601
|
+
return buildResult({
|
|
3602
|
+
authenticated: false
|
|
3603
|
+
}, '# whoami\n\nNot authenticated (anonymous caller).');
|
|
3387
3604
|
}
|
|
3605
|
+
var detail = parseDetailLevel(args);
|
|
3388
3606
|
var token = (_auth_token = auth.token) !== null && _auth_token !== void 0 ? _auth_token : {};
|
|
3389
|
-
var
|
|
3390
|
-
var _param = _sliced_to_array$3(param, 2), value = _param[1];
|
|
3391
|
-
return value !== undefined;
|
|
3607
|
+
var claimKeys = Object.entries(token).filter(function(param) {
|
|
3608
|
+
var _param = _sliced_to_array$3(param, 2), key = _param[0], value = _param[1];
|
|
3609
|
+
return value !== undefined && key !== 'email' && key !== 'email_verified';
|
|
3392
3610
|
}).map(function(param) {
|
|
3393
3611
|
var _param = _sliced_to_array$3(param, 1), key = _param[0];
|
|
3394
3612
|
return key;
|
|
@@ -3422,11 +3640,8 @@ function whoamiToolHandler(ctx, deps) {
|
|
|
3422
3640
|
var unknownClaimKeys = [];
|
|
3423
3641
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
3424
3642
|
try {
|
|
3425
|
-
for(var _iterator1 =
|
|
3643
|
+
for(var _iterator1 = claimKeys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
3426
3644
|
var key = _step1.value;
|
|
3427
|
-
if (key === 'email' || key === 'email_verified') {
|
|
3428
|
-
continue;
|
|
3429
|
-
}
|
|
3430
3645
|
var claim1 = claimsByKey.get(key);
|
|
3431
3646
|
if (claim1 == null) {
|
|
3432
3647
|
unknownClaimKeys.push(key);
|
|
@@ -3456,22 +3671,30 @@ function whoamiToolHandler(ctx, deps) {
|
|
|
3456
3671
|
}
|
|
3457
3672
|
}
|
|
3458
3673
|
}
|
|
3459
|
-
var
|
|
3674
|
+
var output = _object_spread$2({
|
|
3460
3675
|
authenticated: true,
|
|
3461
3676
|
uid: auth.uid,
|
|
3462
|
-
claims: _object_spread$2({}, token),
|
|
3463
3677
|
roles: roles,
|
|
3464
|
-
|
|
3465
|
-
unknownClaimKeys: unknownClaimKeys
|
|
3678
|
+
claimCount: claimKeys.length
|
|
3466
3679
|
}, ((_deps_auth_app = deps.auth.app) === null || _deps_auth_app === void 0 ? void 0 : _deps_auth_app.app) == null ? {} : {
|
|
3467
3680
|
app: deps.auth.app.app
|
|
3468
3681
|
}, token.email == null ? {} : {
|
|
3469
3682
|
email: token.email
|
|
3470
3683
|
}, token.email_verified == null ? {} : {
|
|
3471
3684
|
emailVerified: token.email_verified
|
|
3472
|
-
}
|
|
3473
|
-
|
|
3474
|
-
|
|
3685
|
+
}, detail === 'summary' ? {} : {
|
|
3686
|
+
claims: _object_spread$2({}, token)
|
|
3687
|
+
}, detail === 'full' ? {
|
|
3688
|
+
claimDetails: claimDetails,
|
|
3689
|
+
unknownClaimKeys: unknownClaimKeys
|
|
3690
|
+
} : {});
|
|
3691
|
+
var text = renderText(output, detail);
|
|
3692
|
+
return buildResult(output, text);
|
|
3693
|
+
}
|
|
3694
|
+
// Coerces the `detail` input into a WhoamiDetailLevel, defaulting unknown or absent values to `summary`.
|
|
3695
|
+
function parseDetailLevel(args) {
|
|
3696
|
+
var value = args.detail;
|
|
3697
|
+
return value === 'claims' || value === 'full' ? value : 'summary';
|
|
3475
3698
|
}
|
|
3476
3699
|
function buildResult(output, text) {
|
|
3477
3700
|
return {
|
|
@@ -3484,34 +3707,51 @@ function buildResult(output, text) {
|
|
|
3484
3707
|
structuredContent: output
|
|
3485
3708
|
};
|
|
3486
3709
|
}
|
|
3487
|
-
function renderText(output) {
|
|
3710
|
+
function renderText(output, detail) {
|
|
3488
3711
|
var lines = [
|
|
3489
3712
|
'# whoami',
|
|
3490
3713
|
''
|
|
3491
3714
|
];
|
|
3492
3715
|
appendHeaderLines(lines, output);
|
|
3493
|
-
|
|
3494
|
-
|
|
3716
|
+
if (detail === 'full') {
|
|
3717
|
+
var _output_claimDetails, _output_unknownClaimKeys;
|
|
3718
|
+
appendClaimDetailLines(lines, (_output_claimDetails = output.claimDetails) !== null && _output_claimDetails !== void 0 ? _output_claimDetails : []);
|
|
3719
|
+
appendUnknownClaimLines(lines, (_output_unknownClaimKeys = output.unknownClaimKeys) !== null && _output_unknownClaimKeys !== void 0 ? _output_unknownClaimKeys : []);
|
|
3720
|
+
}
|
|
3721
|
+
if (detail !== 'summary') {
|
|
3722
|
+
var _output_claims;
|
|
3723
|
+
appendRawClaimsLines(lines, (_output_claims = output.claims) !== null && _output_claims !== void 0 ? _output_claims : {});
|
|
3724
|
+
}
|
|
3725
|
+
appendDetailHint(lines, detail);
|
|
3495
3726
|
return lines.join('\n');
|
|
3496
3727
|
}
|
|
3497
3728
|
function appendHeaderLines(lines, output) {
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
if (output.app != null) {
|
|
3502
|
-
lines.push("- **app:** `".concat(output.app, "`"));
|
|
3503
|
-
}
|
|
3729
|
+
var _output_roles, _output_claimCount;
|
|
3730
|
+
var appPart = output.app == null ? '' : " on `".concat(output.app, "`");
|
|
3731
|
+
lines.push("Authenticated as `".concat(output.uid, "`").concat(appPart, "."), '');
|
|
3504
3732
|
if (output.email != null) {
|
|
3505
|
-
lines.push("- **email:** `".concat(output.email, "`"));
|
|
3733
|
+
lines.push("- **email:** `".concat(output.email, "`").concat(formatEmailVerified(output.emailVerified)));
|
|
3506
3734
|
}
|
|
3507
|
-
|
|
3508
|
-
|
|
3735
|
+
var roles = (_output_roles = output.roles) !== null && _output_roles !== void 0 ? _output_roles : [];
|
|
3736
|
+
if (roles.length > 0) {
|
|
3737
|
+
var rolesText = roles.map(function(role) {
|
|
3509
3738
|
return "`".concat(role, "`");
|
|
3510
3739
|
}).join(', ');
|
|
3511
3740
|
lines.push("- **roles:** ".concat(rolesText));
|
|
3512
3741
|
} else {
|
|
3513
3742
|
lines.push('- **roles:** _(none)_');
|
|
3514
3743
|
}
|
|
3744
|
+
lines.push("- **claims:** ".concat((_output_claimCount = output.claimCount) !== null && _output_claimCount !== void 0 ? _output_claimCount : 0, " present"));
|
|
3745
|
+
}
|
|
3746
|
+
// Renders the parenthetical verification suffix for the email line, or an empty string when the token carries no `email_verified` claim.
|
|
3747
|
+
function formatEmailVerified(emailVerified) {
|
|
3748
|
+
if (emailVerified === true) {
|
|
3749
|
+
return ' (verified)';
|
|
3750
|
+
}
|
|
3751
|
+
if (emailVerified === false) {
|
|
3752
|
+
return ' (unverified)';
|
|
3753
|
+
}
|
|
3754
|
+
return '';
|
|
3515
3755
|
}
|
|
3516
3756
|
function appendClaimDetailLines(lines, claimDetails) {
|
|
3517
3757
|
if (claimDetails.length === 0) {
|
|
@@ -3573,22 +3813,40 @@ function appendUnknownClaimLines(lines, unknownClaimKeys) {
|
|
|
3573
3813
|
}
|
|
3574
3814
|
}
|
|
3575
3815
|
}
|
|
3816
|
+
// 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.
|
|
3817
|
+
function appendRawClaimsLines(lines, claims) {
|
|
3818
|
+
lines.push('', '## Raw claims', '```json', JSON.stringify(claims, null, 2), '```');
|
|
3819
|
+
}
|
|
3820
|
+
// Appends a hint pointing at the next, more detailed level. Omitted at `full`, which is already the most detailed level.
|
|
3821
|
+
function appendDetailHint(lines, detail) {
|
|
3822
|
+
if (detail === 'summary') {
|
|
3823
|
+
lines.push('', '_Call again with `detail: "claims"` for the raw claim values, or `detail: "full"` for values plus per-claim descriptions._');
|
|
3824
|
+
} else if (detail === 'claims') {
|
|
3825
|
+
lines.push('', '_Call again with `detail: "full"` for per-claim descriptions and unknown claim keys._');
|
|
3826
|
+
}
|
|
3827
|
+
}
|
|
3576
3828
|
// MARK: Schemas
|
|
3577
3829
|
var WHOAMI_INPUT_SCHEMA = {
|
|
3578
3830
|
type: 'object',
|
|
3579
|
-
properties: {
|
|
3831
|
+
properties: {
|
|
3832
|
+
detail: {
|
|
3833
|
+
type: 'string',
|
|
3834
|
+
enum: [
|
|
3835
|
+
'summary',
|
|
3836
|
+
'claims',
|
|
3837
|
+
'full'
|
|
3838
|
+
],
|
|
3839
|
+
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.'
|
|
3840
|
+
}
|
|
3841
|
+
},
|
|
3580
3842
|
additionalProperties: false
|
|
3581
3843
|
};
|
|
3582
3844
|
var WHOAMI_OUTPUT_SCHEMA = {
|
|
3583
3845
|
type: 'object',
|
|
3584
3846
|
required: [
|
|
3585
|
-
'authenticated'
|
|
3586
|
-
'claims',
|
|
3587
|
-
'roles',
|
|
3588
|
-
'claimDetails',
|
|
3589
|
-
'unknownClaimKeys'
|
|
3847
|
+
'authenticated'
|
|
3590
3848
|
],
|
|
3591
|
-
description: 'Caller identity
|
|
3849
|
+
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.',
|
|
3592
3850
|
properties: {
|
|
3593
3851
|
authenticated: {
|
|
3594
3852
|
type: 'boolean'
|
|
@@ -3605,16 +3863,19 @@ var WHOAMI_OUTPUT_SCHEMA = {
|
|
|
3605
3863
|
app: {
|
|
3606
3864
|
type: 'string'
|
|
3607
3865
|
},
|
|
3608
|
-
claims: {
|
|
3609
|
-
type: 'object',
|
|
3610
|
-
additionalProperties: true
|
|
3611
|
-
},
|
|
3612
3866
|
roles: {
|
|
3613
3867
|
type: 'array',
|
|
3614
3868
|
items: {
|
|
3615
3869
|
type: 'string'
|
|
3616
3870
|
}
|
|
3617
3871
|
},
|
|
3872
|
+
claimCount: {
|
|
3873
|
+
type: 'integer'
|
|
3874
|
+
},
|
|
3875
|
+
claims: {
|
|
3876
|
+
type: 'object',
|
|
3877
|
+
additionalProperties: true
|
|
3878
|
+
},
|
|
3618
3879
|
claimDetails: {
|
|
3619
3880
|
type: 'array',
|
|
3620
3881
|
items: {
|
|
@@ -3764,7 +4025,7 @@ function _object_spread$1(target) {
|
|
|
3764
4025
|
}
|
|
3765
4026
|
return target;
|
|
3766
4027
|
}
|
|
3767
|
-
function ownKeys(object, enumerableOnly) {
|
|
4028
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
3768
4029
|
var keys = Object.keys(object);
|
|
3769
4030
|
if (Object.getOwnPropertySymbols) {
|
|
3770
4031
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -3772,12 +4033,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
3772
4033
|
}
|
|
3773
4034
|
return keys;
|
|
3774
4035
|
}
|
|
3775
|
-
function _object_spread_props(target, source) {
|
|
4036
|
+
function _object_spread_props$1(target, source) {
|
|
3776
4037
|
source = source != null ? source : {};
|
|
3777
4038
|
if (Object.getOwnPropertyDescriptors) {
|
|
3778
4039
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3779
4040
|
} else {
|
|
3780
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
4041
|
+
ownKeys$1(Object(source)).forEach(function(key) {
|
|
3781
4042
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3782
4043
|
});
|
|
3783
4044
|
}
|
|
@@ -3931,7 +4192,7 @@ function _ts_generator$4(thisArg, body) {
|
|
|
3931
4192
|
};
|
|
3932
4193
|
var name = URL_MODELS_TOOL_NAME;
|
|
3933
4194
|
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`).';
|
|
3934
|
-
return {
|
|
4195
|
+
return buildStaticToolDefinition({
|
|
3935
4196
|
name: name,
|
|
3936
4197
|
description: description,
|
|
3937
4198
|
inputSchema: URL_MODELS_INPUT_SCHEMA,
|
|
@@ -3941,20 +4202,11 @@ function _ts_generator$4(thisArg, body) {
|
|
|
3941
4202
|
modelType: URL_MODELS_DISPATCH_MODEL_TYPE
|
|
3942
4203
|
},
|
|
3943
4204
|
staticHandler: handler,
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
effectiveReadOnly: true
|
|
3950
|
-
},
|
|
3951
|
-
staticWireEntry: buildStaticWireEntry({
|
|
3952
|
-
name: name,
|
|
3953
|
-
description: description,
|
|
3954
|
-
inputSchema: URL_MODELS_INPUT_SCHEMA,
|
|
3955
|
-
outputSchema: URL_MODELS_OUTPUT_SCHEMA
|
|
3956
|
-
})
|
|
3957
|
-
};
|
|
4205
|
+
effectiveReadOnly: true,
|
|
4206
|
+
rule: {
|
|
4207
|
+
requireAuthenticated: true
|
|
4208
|
+
}
|
|
4209
|
+
});
|
|
3958
4210
|
}
|
|
3959
4211
|
// MARK: Handler
|
|
3960
4212
|
function urlModelsToolHandler(args, ctx, deps) {
|
|
@@ -4031,7 +4283,7 @@ function parseUrlModelsInput(args) {
|
|
|
4031
4283
|
}
|
|
4032
4284
|
currentUserUid = args.currentUserUid;
|
|
4033
4285
|
}
|
|
4034
|
-
return _object_spread$1(_object_spread_props(_object_spread$1({
|
|
4286
|
+
return _object_spread$1(_object_spread_props$1(_object_spread$1({
|
|
4035
4287
|
url: url
|
|
4036
4288
|
}, models === undefined ? {} : {
|
|
4037
4289
|
models: models
|
|
@@ -4811,7 +5063,7 @@ function _ts_generator$3(thisArg, body) {
|
|
|
4811
5063
|
};
|
|
4812
5064
|
var name = BATCH_EXECUTE_TOOL_NAME;
|
|
4813
5065
|
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.';
|
|
4814
|
-
return {
|
|
5066
|
+
return buildStaticToolDefinition({
|
|
4815
5067
|
name: name,
|
|
4816
5068
|
description: description,
|
|
4817
5069
|
inputSchema: BATCH_EXECUTE_INPUT_SCHEMA,
|
|
@@ -4821,20 +5073,11 @@ function _ts_generator$3(thisArg, body) {
|
|
|
4821
5073
|
modelType: BATCH_EXECUTE_DISPATCH_MODEL_TYPE
|
|
4822
5074
|
},
|
|
4823
5075
|
staticHandler: handler,
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
effectiveReadOnly: false
|
|
4830
|
-
},
|
|
4831
|
-
staticWireEntry: buildStaticWireEntry({
|
|
4832
|
-
name: name,
|
|
4833
|
-
description: description,
|
|
4834
|
-
inputSchema: BATCH_EXECUTE_INPUT_SCHEMA,
|
|
4835
|
-
outputSchema: BATCH_EXECUTE_OUTPUT_SCHEMA
|
|
4836
|
-
})
|
|
4837
|
-
};
|
|
5076
|
+
effectiveReadOnly: false,
|
|
5077
|
+
rule: {
|
|
5078
|
+
requireAuthenticated: true
|
|
5079
|
+
}
|
|
5080
|
+
});
|
|
4838
5081
|
}
|
|
4839
5082
|
// MARK: Handler
|
|
4840
5083
|
function batchExecuteToolHandler(args, ctx, deps) {
|
|
@@ -5538,6 +5781,25 @@ function _object_spread(target) {
|
|
|
5538
5781
|
}
|
|
5539
5782
|
return target;
|
|
5540
5783
|
}
|
|
5784
|
+
function ownKeys(object, enumerableOnly) {
|
|
5785
|
+
var keys = Object.keys(object);
|
|
5786
|
+
if (Object.getOwnPropertySymbols) {
|
|
5787
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
5788
|
+
keys.push.apply(keys, symbols);
|
|
5789
|
+
}
|
|
5790
|
+
return keys;
|
|
5791
|
+
}
|
|
5792
|
+
function _object_spread_props(target, source) {
|
|
5793
|
+
source = source != null ? source : {};
|
|
5794
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
5795
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
5796
|
+
} else {
|
|
5797
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
5798
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
5799
|
+
});
|
|
5800
|
+
}
|
|
5801
|
+
return target;
|
|
5802
|
+
}
|
|
5541
5803
|
function _sliced_to_array(arr, i) {
|
|
5542
5804
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest();
|
|
5543
5805
|
}
|
|
@@ -5683,6 +5945,7 @@ var McpServerFactoryService_1;
|
|
|
5683
5945
|
_define_property$3(this, "_manifestLoaded", false);
|
|
5684
5946
|
_define_property$3(this, "_loggedSkips", false);
|
|
5685
5947
|
_define_property$3(this, "_warnedMissingRoleReader", false);
|
|
5948
|
+
_define_property$3(this, "_resolvedReasonConfig", void 0);
|
|
5686
5949
|
_define_property$3(this, "_analyticsService", void 0);
|
|
5687
5950
|
this.mcpConfig = mcpConfig;
|
|
5688
5951
|
this.dispatchService = dispatchService;
|
|
@@ -6385,11 +6648,32 @@ var McpServerFactoryService_1;
|
|
|
6385
6648
|
},
|
|
6386
6649
|
{
|
|
6387
6650
|
/**
|
|
6651
|
+
* Resolves the app's reason-parameter config once and caches it for the process lifetime.
|
|
6652
|
+
*
|
|
6653
|
+
* The underlying {@link McpModuleConfig.reasonParameter} value is fixed at boot, so the normalized
|
|
6654
|
+
* form is safe to memoize and reuse across every `tools/list` and `tools/call`.
|
|
6655
|
+
*
|
|
6656
|
+
* @returns The resolved reason-parameter config (defaults applied).
|
|
6657
|
+
*/ key: "_resolveReasonConfig",
|
|
6658
|
+
value: function _resolveReasonConfig() {
|
|
6659
|
+
var result = this._resolvedReasonConfig;
|
|
6660
|
+
if (result == null) {
|
|
6661
|
+
result = resolveMcpReasonParameterConfig(this.mcpConfig.reasonParameter);
|
|
6662
|
+
this._resolvedReasonConfig = result;
|
|
6663
|
+
}
|
|
6664
|
+
return result;
|
|
6665
|
+
}
|
|
6666
|
+
},
|
|
6667
|
+
{
|
|
6668
|
+
/**
|
|
6388
6669
|
* Resolves the wire-shape `tools/list` entry for a single tool.
|
|
6389
6670
|
*
|
|
6390
6671
|
* Hot-path short-circuit: tools without a `toolDetailsBuilder` reuse the precomputed,
|
|
6391
6672
|
* frozen {@link McpToolDefinition.staticWireEntry} verbatim — zero allocations per
|
|
6392
|
-
* request for the common case.
|
|
6673
|
+
* request for the common case. When the auto-injected reason parameter is enabled (the
|
|
6674
|
+
* default), the entry is no longer returned frozen-verbatim: its `inputSchema` is wrapped
|
|
6675
|
+
* with the reason property per request (`tools/list` is low-frequency, so the allocation is
|
|
6676
|
+
* acceptable). Tools that already declare the parameter name are still reused verbatim.
|
|
6393
6677
|
*
|
|
6394
6678
|
* Tools that opted in to {@link McpToolDetailsBuilder} get a fresh wire entry built
|
|
6395
6679
|
* from the builder's overrides. If the builder throws, the framework falls back to
|
|
@@ -6401,9 +6685,20 @@ var McpServerFactoryService_1;
|
|
|
6401
6685
|
* @returns The wire-shape entry to emit for this tool on `tools/list`.
|
|
6402
6686
|
*/ key: "_buildToolListEntry",
|
|
6403
6687
|
value: function _buildToolListEntry(tool, ctx, scopes) {
|
|
6688
|
+
var reasonConfig = this._resolveReasonConfig();
|
|
6404
6689
|
var result;
|
|
6405
6690
|
if (tool.toolDetailsBuilder == null) {
|
|
6406
6691
|
result = tool.staticWireEntry;
|
|
6692
|
+
if (reasonConfig.enabled) {
|
|
6693
|
+
var reasoned = applyMcpReasonParameterToSchema(tool.staticWireEntry.inputSchema, reasonConfig);
|
|
6694
|
+
// applyMcpReasonParameterToSchema self-skips (returns the same reference) on collision, so the
|
|
6695
|
+
// frozen-verbatim hot path still holds for tools that already declare the parameter name.
|
|
6696
|
+
if (reasoned !== tool.staticWireEntry.inputSchema) {
|
|
6697
|
+
result = _object_spread_props(_object_spread({}, tool.staticWireEntry), {
|
|
6698
|
+
inputSchema: reasoned
|
|
6699
|
+
});
|
|
6700
|
+
}
|
|
6701
|
+
}
|
|
6407
6702
|
} else {
|
|
6408
6703
|
var description = tool.description;
|
|
6409
6704
|
var inputSchema = tool.inputSchema;
|
|
@@ -6424,12 +6719,16 @@ var McpServerFactoryService_1;
|
|
|
6424
6719
|
} catch (error) {
|
|
6425
6720
|
this._logger.warn("MCP tool ".concat(tool.name, " toolDetails builder threw; falling back to defaults: ").concat(error.message));
|
|
6426
6721
|
}
|
|
6722
|
+
var resolvedInputSchema = inputSchema !== null && inputSchema !== void 0 ? inputSchema : {
|
|
6723
|
+
type: 'object'
|
|
6724
|
+
};
|
|
6725
|
+
if (reasonConfig.enabled) {
|
|
6726
|
+
resolvedInputSchema = applyMcpReasonParameterToSchema(resolvedInputSchema, reasonConfig);
|
|
6727
|
+
}
|
|
6427
6728
|
var wire = {
|
|
6428
6729
|
name: tool.name,
|
|
6429
6730
|
description: description,
|
|
6430
|
-
inputSchema:
|
|
6431
|
-
type: 'object'
|
|
6432
|
-
}
|
|
6731
|
+
inputSchema: resolvedInputSchema
|
|
6433
6732
|
};
|
|
6434
6733
|
if (tool.outputSchema != null) {
|
|
6435
6734
|
wire.outputSchema = tool.outputSchema;
|
|
@@ -6459,14 +6758,20 @@ var McpServerFactoryService_1;
|
|
|
6459
6758
|
* @returns The MCP tool response.
|
|
6460
6759
|
*/ function _handleToolCall(request, definitionsByName, ctx) {
|
|
6461
6760
|
return _async_to_generator$2(function() {
|
|
6462
|
-
var _request_params_arguments, _ctx_auth, toolName, definition,
|
|
6761
|
+
var _request_params_arguments, _ctx_auth, toolName, definition, rawArgs, startedAt, reasonConfig, declaresOwn, _extractMcpReasonFromArgs, reason, args, outcome, isSuccessful, toolKind;
|
|
6463
6762
|
return _ts_generator$2(this, function(_state) {
|
|
6464
6763
|
switch(_state.label){
|
|
6465
6764
|
case 0:
|
|
6466
6765
|
toolName = request.params.name;
|
|
6467
6766
|
definition = definitionsByName.get(toolName);
|
|
6468
|
-
|
|
6767
|
+
rawArgs = (_request_params_arguments = request.params.arguments) !== null && _request_params_arguments !== void 0 ? _request_params_arguments : {};
|
|
6469
6768
|
startedAt = Date.now();
|
|
6769
|
+
// Split the auto-injected reason out of the args: forward it to analytics, but never let it reach
|
|
6770
|
+
// the underlying handler. Tools that declare their own field of the same name keep it (driven by
|
|
6771
|
+
// the tool's own resolved inputSchema, not the reason-augmented wire schema).
|
|
6772
|
+
reasonConfig = this._resolveReasonConfig();
|
|
6773
|
+
declaresOwn = mcpSchemaDeclaresProperty(definition === null || definition === void 0 ? void 0 : definition.inputSchema, reasonConfig.parameterName);
|
|
6774
|
+
_extractMcpReasonFromArgs = extractMcpReasonFromArgs(rawArgs, reasonConfig, declaresOwn), reason = _extractMcpReasonFromArgs.reason, args = _extractMcpReasonFromArgs.args;
|
|
6470
6775
|
if (!(definition == null)) return [
|
|
6471
6776
|
3,
|
|
6472
6777
|
1
|
|
@@ -6516,6 +6821,7 @@ var McpServerFactoryService_1;
|
|
|
6516
6821
|
auth: ctx.auth,
|
|
6517
6822
|
readOnly: this.mcpConfig.readOnly === true,
|
|
6518
6823
|
args: args,
|
|
6824
|
+
reason: reason,
|
|
6519
6825
|
isSuccessful: isSuccessful,
|
|
6520
6826
|
error: outcome.error,
|
|
6521
6827
|
durationMs: Date.now() - startedAt
|
|
@@ -7357,18 +7663,20 @@ var FirebaseServerMcpAnalyticsService_1;
|
|
|
7357
7663
|
if (this._logEvents) {
|
|
7358
7664
|
var uidSuffix = event.uid ? " uid=".concat(event.uid) : '';
|
|
7359
7665
|
var durationSuffix = event.durationMs == null ? '' : " (".concat(event.durationMs, "ms)");
|
|
7666
|
+
var reasonSuffix = event.reason ? ' reason="'.concat(event.reason, '"') : '';
|
|
7360
7667
|
var outcome = event.isSuccessful ? 'Succeeded' : 'Failed';
|
|
7361
|
-
this._logger.log("MCP ".concat(event.toolName, " [").concat(event.toolKind, "] ").concat(outcome).concat(uidSuffix).concat(durationSuffix));
|
|
7668
|
+
this._logger.log("MCP ".concat(event.toolName, " [").concat(event.toolKind, "] ").concat(outcome).concat(uidSuffix).concat(durationSuffix).concat(reasonSuffix));
|
|
7362
7669
|
}
|
|
7363
7670
|
if (this.analyticsService != null) {
|
|
7364
|
-
var _event_call, _event_modelType, _event_specifier;
|
|
7671
|
+
var _event_call, _event_modelType, _event_specifier, _event_reason;
|
|
7365
7672
|
this.analyticsService.sendEventData(event.uid, this._eventName, {
|
|
7366
7673
|
tool: event.toolName,
|
|
7367
7674
|
toolKind: event.toolKind,
|
|
7368
7675
|
call: (_event_call = event.call) !== null && _event_call !== void 0 ? _event_call : '',
|
|
7369
7676
|
modelType: (_event_modelType = event.modelType) !== null && _event_modelType !== void 0 ? _event_modelType : '',
|
|
7370
7677
|
specifier: (_event_specifier = event.specifier) !== null && _event_specifier !== void 0 ? _event_specifier : '',
|
|
7371
|
-
success: event.isSuccessful
|
|
7678
|
+
success: event.isSuccessful,
|
|
7679
|
+
reason: (_event_reason = event.reason) !== null && _event_reason !== void 0 ? _event_reason : ''
|
|
7372
7680
|
});
|
|
7373
7681
|
}
|
|
7374
7682
|
}
|
|
@@ -7462,6 +7770,10 @@ exports.DEFAULT_BATCH_EXECUTE_MAX_PARALLEL = DEFAULT_BATCH_EXECUTE_MAX_PARALLEL;
|
|
|
7462
7770
|
exports.DEFAULT_JSON_SCHEMA_GENERATION_OPTIONS = DEFAULT_JSON_SCHEMA_GENERATION_OPTIONS;
|
|
7463
7771
|
exports.DEFAULT_MCP_ANALYTICS_EVENT_NAME = DEFAULT_MCP_ANALYTICS_EVENT_NAME;
|
|
7464
7772
|
exports.DEFAULT_MCP_PATH = DEFAULT_MCP_PATH;
|
|
7773
|
+
exports.DEFAULT_MCP_REASON_PARAMETER_DESCRIPTION = DEFAULT_MCP_REASON_PARAMETER_DESCRIPTION;
|
|
7774
|
+
exports.DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH = DEFAULT_MCP_REASON_PARAMETER_MAX_LENGTH;
|
|
7775
|
+
exports.DEFAULT_MCP_REASON_PARAMETER_NAME = DEFAULT_MCP_REASON_PARAMETER_NAME;
|
|
7776
|
+
exports.DEFAULT_MCP_REASON_PARAMETER_REQUIRED = DEFAULT_MCP_REASON_PARAMETER_REQUIRED;
|
|
7465
7777
|
exports.DEFAULT_MCP_SERVER_INSTRUCTIONS = DEFAULT_MCP_SERVER_INSTRUCTIONS;
|
|
7466
7778
|
exports.DEFAULT_MCP_SERVER_NAME = DEFAULT_MCP_SERVER_NAME;
|
|
7467
7779
|
exports.DEFAULT_SPECIFIER_KEY = DEFAULT_SPECIFIER_KEY;
|
|
@@ -7501,11 +7813,13 @@ exports.URL_MODELS_DISPATCH_MODEL_TYPE = URL_MODELS_DISPATCH_MODEL_TYPE;
|
|
|
7501
7813
|
exports.URL_MODELS_TOOL_NAME = URL_MODELS_TOOL_NAME;
|
|
7502
7814
|
exports.abbreviateMcpCallType = abbreviateMcpCallType;
|
|
7503
7815
|
exports.appMcpAnalyticsModuleMetadata = appMcpAnalyticsModuleMetadata;
|
|
7816
|
+
exports.applyMcpReasonParameterToSchema = applyMcpReasonParameterToSchema;
|
|
7504
7817
|
exports.applyWriteMarker = applyWriteMarker;
|
|
7505
7818
|
exports.batchOperationCoordKey = batchOperationCoordKey;
|
|
7506
7819
|
exports.buildDefaultMcpToolDescription = buildDefaultMcpToolDescription;
|
|
7507
7820
|
exports.buildDisambiguatedMcpToolName = buildDisambiguatedMcpToolName;
|
|
7508
7821
|
exports.buildMcpToolName = buildMcpToolName;
|
|
7822
|
+
exports.buildStaticToolDefinition = buildStaticToolDefinition;
|
|
7509
7823
|
exports.buildStaticWireEntry = buildStaticWireEntry;
|
|
7510
7824
|
exports.classifyVisibility = classifyVisibility;
|
|
7511
7825
|
exports.createBatchExecuteTool = createBatchExecuteTool;
|
|
@@ -7515,6 +7829,7 @@ exports.createModelGetTool = createModelGetTool;
|
|
|
7515
7829
|
exports.createModelInfoTool = createModelInfoTool;
|
|
7516
7830
|
exports.createUrlModelsTool = createUrlModelsTool;
|
|
7517
7831
|
exports.decodeFirestoreModelKey = decodeFirestoreModelKey;
|
|
7832
|
+
exports.extractMcpReasonFromArgs = extractMcpReasonFromArgs;
|
|
7518
7833
|
exports.findModelEntry = findModelEntry;
|
|
7519
7834
|
exports.formatMcpToolErrorResponse = formatMcpToolErrorResponse;
|
|
7520
7835
|
exports.formatMcpToolResponse = formatMcpToolResponse;
|
|
@@ -7523,10 +7838,12 @@ exports.handleStreamableHttpMcpRequest = handleStreamableHttpMcpRequest;
|
|
|
7523
7838
|
exports.matchRouteManifestUrl = matchRouteManifestUrl;
|
|
7524
7839
|
exports.mcpManifestKey = mcpManifestKey;
|
|
7525
7840
|
exports.mcpModuleMetadata = mcpModuleMetadata;
|
|
7841
|
+
exports.mcpSchemaDeclaresProperty = mcpSchemaDeclaresProperty;
|
|
7526
7842
|
exports.noopMcpAnalyticsService = noopMcpAnalyticsService;
|
|
7527
7843
|
exports.parseUrlModelsPathname = parseUrlModelsPathname;
|
|
7528
7844
|
exports.resolveEffectiveReadOnly = resolveEffectiveReadOnly;
|
|
7529
7845
|
exports.resolveEnumInfoOutput = resolveEnumInfoOutput;
|
|
7846
|
+
exports.resolveMcpReasonParameterConfig = resolveMcpReasonParameterConfig;
|
|
7530
7847
|
exports.resolveMcpToolAnnotations = resolveMcpToolAnnotations;
|
|
7531
7848
|
exports.resolveRequiredScope = resolveRequiredScope;
|
|
7532
7849
|
exports.validateMcpToolName = validateMcpToolName;
|