@testgorilla/tgo-ui 11.19.0 → 11.20.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/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +106 -5
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +43 -4
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
- package/mcp/catalog.json +1 -1
- package/mcp/server.mjs +147 -37
- package/package.json +1 -1
- package/types/testgorilla-tgo-ui-components-prompt.d.ts +53 -5
- package/types/testgorilla-tgo-ui-components-slider.d.ts +14 -0
package/mcp/server.mjs
CHANGED
|
@@ -15172,17 +15172,33 @@ function normalizeObjectSchema(schema) {
|
|
|
15172
15172
|
}
|
|
15173
15173
|
return void 0;
|
|
15174
15174
|
}
|
|
15175
|
+
function getDotPath(path3) {
|
|
15176
|
+
if (path3.length === 0) {
|
|
15177
|
+
return "object root";
|
|
15178
|
+
}
|
|
15179
|
+
return path3.reduce((acc, seg, index) => {
|
|
15180
|
+
if (index === 0) {
|
|
15181
|
+
return String(seg);
|
|
15182
|
+
}
|
|
15183
|
+
if (typeof seg === "number") {
|
|
15184
|
+
return `${acc}[${seg}]`;
|
|
15185
|
+
}
|
|
15186
|
+
return `${acc}.${seg}`;
|
|
15187
|
+
}, "");
|
|
15188
|
+
}
|
|
15175
15189
|
function getParseErrorMessage(error2) {
|
|
15176
15190
|
if (error2 && typeof error2 === "object") {
|
|
15191
|
+
if ("issues" in error2 && Array.isArray(error2.issues) && error2.issues.length > 0) {
|
|
15192
|
+
return error2.issues.map((i) => {
|
|
15193
|
+
if (!i.path?.length) {
|
|
15194
|
+
return i.message;
|
|
15195
|
+
}
|
|
15196
|
+
return `${i.message} at ${getDotPath(i.path)}`;
|
|
15197
|
+
}).join("\n");
|
|
15198
|
+
}
|
|
15177
15199
|
if ("message" in error2 && typeof error2.message === "string") {
|
|
15178
15200
|
return error2.message;
|
|
15179
15201
|
}
|
|
15180
|
-
if ("issues" in error2 && Array.isArray(error2.issues) && error2.issues.length > 0) {
|
|
15181
|
-
const firstIssue = error2.issues[0];
|
|
15182
|
-
if (firstIssue && typeof firstIssue === "object" && "message" in firstIssue) {
|
|
15183
|
-
return String(firstIssue.message);
|
|
15184
|
-
}
|
|
15185
|
-
}
|
|
15186
15202
|
try {
|
|
15187
15203
|
return JSON.stringify(error2);
|
|
15188
15204
|
} catch {
|
|
@@ -15937,10 +15953,9 @@ var ProgressTokenSchema = union([string2(), number2().int()]);
|
|
|
15937
15953
|
var CursorSchema = string2();
|
|
15938
15954
|
var TaskCreationParamsSchema = looseObject({
|
|
15939
15955
|
/**
|
|
15940
|
-
*
|
|
15941
|
-
* If null, the task has unlimited lifetime until manually cleaned up.
|
|
15956
|
+
* Requested duration in milliseconds to retain task from creation.
|
|
15942
15957
|
*/
|
|
15943
|
-
ttl:
|
|
15958
|
+
ttl: number2().optional(),
|
|
15944
15959
|
/**
|
|
15945
15960
|
* Time in milliseconds to wait between task status requests.
|
|
15946
15961
|
*/
|
|
@@ -16240,7 +16255,11 @@ var ClientCapabilitiesSchema = object2({
|
|
|
16240
16255
|
/**
|
|
16241
16256
|
* Present if the client supports task creation.
|
|
16242
16257
|
*/
|
|
16243
|
-
tasks: ClientTasksCapabilitySchema.optional()
|
|
16258
|
+
tasks: ClientTasksCapabilitySchema.optional(),
|
|
16259
|
+
/**
|
|
16260
|
+
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
16261
|
+
*/
|
|
16262
|
+
extensions: record(string2(), AssertObjectSchema).optional()
|
|
16244
16263
|
});
|
|
16245
16264
|
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
16246
16265
|
/**
|
|
@@ -16301,7 +16320,11 @@ var ServerCapabilitiesSchema = object2({
|
|
|
16301
16320
|
/**
|
|
16302
16321
|
* Present if the server supports task creation.
|
|
16303
16322
|
*/
|
|
16304
|
-
tasks: ServerTasksCapabilitySchema.optional()
|
|
16323
|
+
tasks: ServerTasksCapabilitySchema.optional(),
|
|
16324
|
+
/**
|
|
16325
|
+
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
16326
|
+
*/
|
|
16327
|
+
extensions: record(string2(), AssertObjectSchema).optional()
|
|
16305
16328
|
});
|
|
16306
16329
|
var InitializeResultSchema = ResultSchema.extend({
|
|
16307
16330
|
/**
|
|
@@ -16493,6 +16516,12 @@ var ResourceSchema = object2({
|
|
|
16493
16516
|
* The MIME type of this resource, if known.
|
|
16494
16517
|
*/
|
|
16495
16518
|
mimeType: optional(string2()),
|
|
16519
|
+
/**
|
|
16520
|
+
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
|
|
16521
|
+
*
|
|
16522
|
+
* This can be used by Hosts to display file sizes and estimate context window usage.
|
|
16523
|
+
*/
|
|
16524
|
+
size: optional(number2()),
|
|
16496
16525
|
/**
|
|
16497
16526
|
* Optional annotations for the client.
|
|
16498
16527
|
*/
|
|
@@ -18817,6 +18846,9 @@ var Protocol = class {
|
|
|
18817
18846
|
this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
|
|
18818
18847
|
const handleTaskResult = async () => {
|
|
18819
18848
|
const taskId = request.params.taskId;
|
|
18849
|
+
if (!await this._taskStore.getTask(taskId, extra.sessionId)) {
|
|
18850
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
18851
|
+
}
|
|
18820
18852
|
if (this._taskMessageQueue) {
|
|
18821
18853
|
let queuedMessage;
|
|
18822
18854
|
while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
|
|
@@ -18847,12 +18879,12 @@ var Protocol = class {
|
|
|
18847
18879
|
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
18848
18880
|
}
|
|
18849
18881
|
if (!isTerminal(task.status)) {
|
|
18850
|
-
await this._waitForTaskUpdate(taskId, extra.signal);
|
|
18882
|
+
await this._waitForTaskUpdate(taskId, extra.signal, extra.sessionId);
|
|
18851
18883
|
return await handleTaskResult();
|
|
18852
18884
|
}
|
|
18853
18885
|
if (isTerminal(task.status)) {
|
|
18854
18886
|
const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
|
|
18855
|
-
this._clearTaskQueue(taskId);
|
|
18887
|
+
this._clearTaskQueue(taskId, extra.sessionId);
|
|
18856
18888
|
return {
|
|
18857
18889
|
...result,
|
|
18858
18890
|
_meta: {
|
|
@@ -18889,7 +18921,7 @@ var Protocol = class {
|
|
|
18889
18921
|
throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
|
|
18890
18922
|
}
|
|
18891
18923
|
await this._taskStore.updateTaskStatus(request.params.taskId, "cancelled", "Client cancelled task execution.", extra.sessionId);
|
|
18892
|
-
this._clearTaskQueue(request.params.taskId);
|
|
18924
|
+
this._clearTaskQueue(request.params.taskId, extra.sessionId);
|
|
18893
18925
|
const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
|
|
18894
18926
|
if (!cancelledTask) {
|
|
18895
18927
|
throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
|
|
@@ -18988,6 +19020,10 @@ var Protocol = class {
|
|
|
18988
19020
|
this._progressHandlers.clear();
|
|
18989
19021
|
this._taskProgressTokens.clear();
|
|
18990
19022
|
this._pendingDebouncedNotifications.clear();
|
|
19023
|
+
for (const info of this._timeoutInfo.values()) {
|
|
19024
|
+
clearTimeout(info.timeoutId);
|
|
19025
|
+
}
|
|
19026
|
+
this._timeoutInfo.clear();
|
|
18991
19027
|
for (const controller of this._requestHandlerAbortControllers.values()) {
|
|
18992
19028
|
controller.abort();
|
|
18993
19029
|
}
|
|
@@ -19013,6 +19049,19 @@ var Protocol = class {
|
|
|
19013
19049
|
const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
|
|
19014
19050
|
const capturedTransport = this._transport;
|
|
19015
19051
|
const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
|
|
19052
|
+
const sessionId = capturedTransport?.sessionId;
|
|
19053
|
+
const store = this._taskStore;
|
|
19054
|
+
let relatedTaskFound = true;
|
|
19055
|
+
let relatedTaskLookup;
|
|
19056
|
+
if (relatedTaskId && store && this._taskMessageQueue && sessionId !== void 0) {
|
|
19057
|
+
relatedTaskFound = false;
|
|
19058
|
+
relatedTaskLookup = (async () => {
|
|
19059
|
+
if (!await store.getTask(relatedTaskId, sessionId)) {
|
|
19060
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${relatedTaskId}`);
|
|
19061
|
+
}
|
|
19062
|
+
relatedTaskFound = true;
|
|
19063
|
+
})();
|
|
19064
|
+
}
|
|
19016
19065
|
if (handler === void 0) {
|
|
19017
19066
|
const errorResponse = {
|
|
19018
19067
|
jsonrpc: "2.0",
|
|
@@ -19022,7 +19071,10 @@ var Protocol = class {
|
|
|
19022
19071
|
message: "Method not found"
|
|
19023
19072
|
}
|
|
19024
19073
|
};
|
|
19025
|
-
if (relatedTaskId &&
|
|
19074
|
+
if (relatedTaskId && relatedTaskLookup) {
|
|
19075
|
+
const queuedError = { type: "error", message: errorResponse, timestamp: Date.now() };
|
|
19076
|
+
relatedTaskLookup.then(() => this._enqueueTaskMessage(relatedTaskId, queuedError, sessionId), () => capturedTransport?.send(errorResponse)).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
|
|
19077
|
+
} else if (relatedTaskId && this._taskMessageQueue) {
|
|
19026
19078
|
this._enqueueTaskMessage(relatedTaskId, {
|
|
19027
19079
|
type: "error",
|
|
19028
19080
|
message: errorResponse,
|
|
@@ -19073,7 +19125,10 @@ var Protocol = class {
|
|
|
19073
19125
|
closeSSEStream: extra?.closeSSEStream,
|
|
19074
19126
|
closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
|
|
19075
19127
|
};
|
|
19076
|
-
Promise.resolve().then(() => {
|
|
19128
|
+
(relatedTaskLookup ?? Promise.resolve()).then(() => {
|
|
19129
|
+
if (relatedTaskLookup && abortController.signal.aborted) {
|
|
19130
|
+
throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
|
|
19131
|
+
}
|
|
19077
19132
|
if (taskCreationParams) {
|
|
19078
19133
|
this.assertTaskHandlerCapability(request.method);
|
|
19079
19134
|
}
|
|
@@ -19108,7 +19163,7 @@ var Protocol = class {
|
|
|
19108
19163
|
...error2["data"] !== void 0 && { data: error2["data"] }
|
|
19109
19164
|
}
|
|
19110
19165
|
};
|
|
19111
|
-
if (relatedTaskId && this._taskMessageQueue) {
|
|
19166
|
+
if (relatedTaskId && this._taskMessageQueue && relatedTaskFound) {
|
|
19112
19167
|
await this._enqueueTaskMessage(relatedTaskId, {
|
|
19113
19168
|
type: "error",
|
|
19114
19169
|
message: errorResponse,
|
|
@@ -19118,7 +19173,9 @@ var Protocol = class {
|
|
|
19118
19173
|
await capturedTransport?.send(errorResponse);
|
|
19119
19174
|
}
|
|
19120
19175
|
}).catch((error2) => this._onerror(new Error(`Failed to send response: ${error2}`))).finally(() => {
|
|
19121
|
-
this._requestHandlerAbortControllers.
|
|
19176
|
+
if (this._requestHandlerAbortControllers.get(request.id) === abortController) {
|
|
19177
|
+
this._requestHandlerAbortControllers.delete(request.id);
|
|
19178
|
+
}
|
|
19122
19179
|
});
|
|
19123
19180
|
}
|
|
19124
19181
|
_onprogress(notification) {
|
|
@@ -19586,7 +19643,7 @@ var Protocol = class {
|
|
|
19586
19643
|
throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
|
|
19587
19644
|
}
|
|
19588
19645
|
const maxQueueSize = this._options?.maxTaskQueueSize;
|
|
19589
|
-
await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
|
|
19646
|
+
await this._taskMessageQueue.enqueue(taskId, message, sessionId ?? this._transport?.sessionId, maxQueueSize);
|
|
19590
19647
|
}
|
|
19591
19648
|
/**
|
|
19592
19649
|
* Clears the message queue for a task and rejects any pending request resolvers.
|
|
@@ -19615,12 +19672,13 @@ var Protocol = class {
|
|
|
19615
19672
|
* Uses polling to check for updates at the task's configured poll interval.
|
|
19616
19673
|
* @param taskId The task ID to wait for
|
|
19617
19674
|
* @param signal Abort signal to cancel the wait
|
|
19675
|
+
* @param sessionId Session of the request that waits, passed to the task store
|
|
19618
19676
|
* @returns Promise that resolves when an update occurs or rejects if aborted
|
|
19619
19677
|
*/
|
|
19620
|
-
async _waitForTaskUpdate(taskId, signal) {
|
|
19678
|
+
async _waitForTaskUpdate(taskId, signal, sessionId) {
|
|
19621
19679
|
let interval = this._options?.defaultTaskPollInterval ?? 1e3;
|
|
19622
19680
|
try {
|
|
19623
|
-
const task = await this._taskStore?.getTask(taskId);
|
|
19681
|
+
const task = await this._taskStore?.getTask(taskId, sessionId);
|
|
19624
19682
|
if (task?.pollInterval) {
|
|
19625
19683
|
interval = task.pollInterval;
|
|
19626
19684
|
}
|
|
@@ -20106,16 +20164,7 @@ var Server = class extends Protocol {
|
|
|
20106
20164
|
if (!methodSchema) {
|
|
20107
20165
|
throw new Error("Schema is missing a method literal");
|
|
20108
20166
|
}
|
|
20109
|
-
|
|
20110
|
-
if (isZ4Schema(methodSchema)) {
|
|
20111
|
-
const v4Schema = methodSchema;
|
|
20112
|
-
const v4Def = v4Schema._zod?.def;
|
|
20113
|
-
methodValue = v4Def?.value ?? v4Schema.value;
|
|
20114
|
-
} else {
|
|
20115
|
-
const v3Schema = methodSchema;
|
|
20116
|
-
const legacyDef = v3Schema._def;
|
|
20117
|
-
methodValue = legacyDef?.value ?? v3Schema.value;
|
|
20118
|
-
}
|
|
20167
|
+
const methodValue = getLiteralValue(methodSchema);
|
|
20119
20168
|
if (typeof methodValue !== "string") {
|
|
20120
20169
|
throw new Error("Schema method literal must be a string");
|
|
20121
20170
|
}
|
|
@@ -20508,6 +20557,42 @@ var ExperimentalMcpServerTasks = class {
|
|
|
20508
20557
|
};
|
|
20509
20558
|
|
|
20510
20559
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
20560
|
+
function toolInputElementCount(value, max) {
|
|
20561
|
+
let count = 0;
|
|
20562
|
+
const stack = [value];
|
|
20563
|
+
while (stack.length > 0) {
|
|
20564
|
+
const node = stack.pop();
|
|
20565
|
+
if (node === null || typeof node !== "object")
|
|
20566
|
+
continue;
|
|
20567
|
+
if (Array.isArray(node)) {
|
|
20568
|
+
for (const child of node) {
|
|
20569
|
+
if (++count > max)
|
|
20570
|
+
return count;
|
|
20571
|
+
if (child !== null && typeof child === "object")
|
|
20572
|
+
stack.push(child);
|
|
20573
|
+
}
|
|
20574
|
+
} else {
|
|
20575
|
+
for (const key in node) {
|
|
20576
|
+
if (!Object.prototype.hasOwnProperty.call(node, key))
|
|
20577
|
+
continue;
|
|
20578
|
+
if (++count > max)
|
|
20579
|
+
return count;
|
|
20580
|
+
const child = node[key];
|
|
20581
|
+
if (child !== null && typeof child === "object")
|
|
20582
|
+
stack.push(child);
|
|
20583
|
+
}
|
|
20584
|
+
}
|
|
20585
|
+
}
|
|
20586
|
+
return count;
|
|
20587
|
+
}
|
|
20588
|
+
function resolveMaxToolInputElements(value) {
|
|
20589
|
+
if (value === void 0 || value === Infinity)
|
|
20590
|
+
return void 0;
|
|
20591
|
+
if (typeof value !== "number" || Number.isNaN(value) || value < 1) {
|
|
20592
|
+
throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
|
|
20593
|
+
}
|
|
20594
|
+
return value;
|
|
20595
|
+
}
|
|
20511
20596
|
var McpServer = class {
|
|
20512
20597
|
constructor(serverInfo, options) {
|
|
20513
20598
|
this._registeredResources = {};
|
|
@@ -20519,6 +20604,7 @@ var McpServer = class {
|
|
|
20519
20604
|
this._resourceHandlersInitialized = false;
|
|
20520
20605
|
this._promptHandlersInitialized = false;
|
|
20521
20606
|
this.server = new Server(serverInfo, options);
|
|
20607
|
+
this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
|
|
20522
20608
|
}
|
|
20523
20609
|
/**
|
|
20524
20610
|
* Access experimental features.
|
|
@@ -20649,12 +20735,15 @@ var McpServer = class {
|
|
|
20649
20735
|
* Validates tool input arguments against the tool's input schema.
|
|
20650
20736
|
*/
|
|
20651
20737
|
async validateToolInput(tool, args, toolName) {
|
|
20738
|
+
if (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) {
|
|
20739
|
+
throw new McpError(ErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
|
|
20740
|
+
}
|
|
20652
20741
|
if (!tool.inputSchema) {
|
|
20653
20742
|
return void 0;
|
|
20654
20743
|
}
|
|
20655
20744
|
const inputObj = normalizeObjectSchema(tool.inputSchema);
|
|
20656
20745
|
const schemaToParse = inputObj ?? tool.inputSchema;
|
|
20657
|
-
const parseResult = await safeParseAsync2(schemaToParse, args);
|
|
20746
|
+
const parseResult = await safeParseAsync2(schemaToParse, args ?? {});
|
|
20658
20747
|
if (!parseResult.success) {
|
|
20659
20748
|
const error2 = "error" in parseResult ? parseResult.error : "Unknown error";
|
|
20660
20749
|
const errorMessage = getParseErrorMessage(error2);
|
|
@@ -20892,7 +20981,7 @@ var McpServer = class {
|
|
|
20892
20981
|
}
|
|
20893
20982
|
if (prompt.argsSchema) {
|
|
20894
20983
|
const argsObj = normalizeObjectSchema(prompt.argsSchema);
|
|
20895
|
-
const parseResult = await safeParseAsync2(argsObj, request.params.arguments);
|
|
20984
|
+
const parseResult = await safeParseAsync2(argsObj, request.params.arguments ?? {});
|
|
20896
20985
|
if (!parseResult.success) {
|
|
20897
20986
|
const error2 = "error" in parseResult ? parseResult.error : "Unknown error";
|
|
20898
20987
|
const errorMessage = getParseErrorMessage(error2);
|
|
@@ -21131,6 +21220,9 @@ var McpServer = class {
|
|
|
21131
21220
|
annotations = rest.shift();
|
|
21132
21221
|
}
|
|
21133
21222
|
} else if (typeof firstArg === "object" && firstArg !== null) {
|
|
21223
|
+
if (Object.values(firstArg).some((v) => typeof v === "object" && v !== null)) {
|
|
21224
|
+
throw new Error(`Tool ${name} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);
|
|
21225
|
+
}
|
|
21134
21226
|
annotations = rest.shift();
|
|
21135
21227
|
}
|
|
21136
21228
|
}
|
|
@@ -21249,6 +21341,9 @@ function getZodSchemaObject(schema) {
|
|
|
21249
21341
|
if (isZodRawShapeCompat(schema)) {
|
|
21250
21342
|
return objectFromShape(schema);
|
|
21251
21343
|
}
|
|
21344
|
+
if (!isZodSchemaInstance(schema)) {
|
|
21345
|
+
throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");
|
|
21346
|
+
}
|
|
21252
21347
|
return schema;
|
|
21253
21348
|
}
|
|
21254
21349
|
function promptArgumentsFromSchema(schema) {
|
|
@@ -21297,8 +21392,17 @@ var EMPTY_COMPLETION_RESULT = {
|
|
|
21297
21392
|
import process2 from "node:process";
|
|
21298
21393
|
|
|
21299
21394
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
21395
|
+
var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
|
|
21300
21396
|
var ReadBuffer = class {
|
|
21397
|
+
constructor(options) {
|
|
21398
|
+
this._maxBufferSize = options?.maxBufferSize ?? STDIO_DEFAULT_MAX_BUFFER_SIZE;
|
|
21399
|
+
}
|
|
21301
21400
|
append(chunk) {
|
|
21401
|
+
const newSize = (this._buffer?.length ?? 0) + chunk.length;
|
|
21402
|
+
if (newSize > this._maxBufferSize) {
|
|
21403
|
+
this.clear();
|
|
21404
|
+
throw new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);
|
|
21405
|
+
}
|
|
21302
21406
|
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
|
21303
21407
|
}
|
|
21304
21408
|
readMessage() {
|
|
@@ -21326,18 +21430,24 @@ function serializeMessage(message) {
|
|
|
21326
21430
|
|
|
21327
21431
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
21328
21432
|
var StdioServerTransport = class {
|
|
21329
|
-
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
|
|
21433
|
+
constructor(_stdin = process2.stdin, _stdout = process2.stdout, options) {
|
|
21330
21434
|
this._stdin = _stdin;
|
|
21331
21435
|
this._stdout = _stdout;
|
|
21332
|
-
this._readBuffer = new ReadBuffer();
|
|
21333
21436
|
this._started = false;
|
|
21334
21437
|
this._ondata = (chunk) => {
|
|
21335
|
-
|
|
21336
|
-
|
|
21438
|
+
try {
|
|
21439
|
+
this._readBuffer.append(chunk);
|
|
21440
|
+
this.processReadBuffer();
|
|
21441
|
+
} catch (error2) {
|
|
21442
|
+
this.onerror?.(error2);
|
|
21443
|
+
this.close().catch(() => {
|
|
21444
|
+
});
|
|
21445
|
+
}
|
|
21337
21446
|
};
|
|
21338
21447
|
this._onerror = (error2) => {
|
|
21339
21448
|
this.onerror?.(error2);
|
|
21340
21449
|
};
|
|
21450
|
+
this._readBuffer = new ReadBuffer({ maxBufferSize: options?.maxBufferSize });
|
|
21341
21451
|
}
|
|
21342
21452
|
/**
|
|
21343
21453
|
* Starts listening for messages on stdin.
|
package/package.json
CHANGED
|
@@ -5,10 +5,10 @@ import { ConnectedPosition } from '@angular/cdk/overlay';
|
|
|
5
5
|
import { ControlValueAccessor } from '@angular/forms';
|
|
6
6
|
import * as i2 from '@testgorilla/tgo-ui/components/field';
|
|
7
7
|
import { FieldComponent } from '@testgorilla/tgo-ui/components/field';
|
|
8
|
-
import * as i4 from '@testgorilla/tgo-ui/components/overflow-menu';
|
|
9
|
-
import { OverflowMenuButtonsType } from '@testgorilla/tgo-ui/components/overflow-menu';
|
|
10
8
|
import * as i13 from '@testgorilla/tgo-ui/components/icon';
|
|
11
9
|
import { IconName } from '@testgorilla/tgo-ui/components/icon';
|
|
10
|
+
import * as i4 from '@testgorilla/tgo-ui/components/overflow-menu';
|
|
11
|
+
import { OverflowMenuButtonsType } from '@testgorilla/tgo-ui/components/overflow-menu';
|
|
12
12
|
import * as i1 from '@angular/common';
|
|
13
13
|
import * as i3 from '@testgorilla/tgo-ui/components/button';
|
|
14
14
|
import * as i5 from '@testgorilla/tgo-ui/components/tag';
|
|
@@ -32,11 +32,33 @@ interface PromptData {
|
|
|
32
32
|
}
|
|
33
33
|
interface PromptActionTag {
|
|
34
34
|
label: string;
|
|
35
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Leading icon, on the tag and on its menu item when `collapseActionTags` is set. Omitted, the
|
|
37
|
+
* action tag shows `Plus` and the menu item shows none; `null` shows no icon anywhere.
|
|
38
|
+
*/
|
|
39
|
+
icon?: IconName | null;
|
|
40
|
+
/**
|
|
41
|
+
* Trailing icon on the menu item when `collapseActionTags` is set. Omitted, it defaults to `Plus`
|
|
42
|
+
* for the action tag and `Arrow-chevron-right-in-line` for the secondary action tag; `null` hides it.
|
|
43
|
+
*/
|
|
44
|
+
menuTrailingIcon?: IconName | null;
|
|
45
|
+
/**
|
|
46
|
+
* Position of the menu item when `collapseActionTags` is set; lower comes first. Items without one
|
|
47
|
+
* go after those that have one, in the default order: secondary action tag, then action tag.
|
|
48
|
+
*/
|
|
49
|
+
menuOrder?: number;
|
|
36
50
|
ariaLabel?: string;
|
|
37
51
|
disabled?: boolean;
|
|
38
52
|
acceptedFileTypes?: string;
|
|
39
53
|
}
|
|
54
|
+
/** A tag rendered next to the action tag that only emits a press; it never opens a file picker. */
|
|
55
|
+
type PromptSecondaryActionTag = Omit<PromptActionTag, 'acceptedFileTypes'>;
|
|
56
|
+
/** One item of the collapsed actions menu. */
|
|
57
|
+
interface PromptActionsMenuEntry {
|
|
58
|
+
kind: 'action' | 'secondary';
|
|
59
|
+
tag: PromptSecondaryActionTag;
|
|
60
|
+
trailingIcon: IconName;
|
|
61
|
+
}
|
|
40
62
|
interface PromptDropdownItem {
|
|
41
63
|
/** Unique id; used as the dropdown @for track key. */
|
|
42
64
|
id: number;
|
|
@@ -48,6 +70,13 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
|
|
|
48
70
|
private readonly disabledState;
|
|
49
71
|
tags: _angular_core.InputSignal<PromptTag[]>;
|
|
50
72
|
actionTag: _angular_core.InputSignal<PromptActionTag | null>;
|
|
73
|
+
/** Tag rendered next to the action tag or file upload button, e.g. "Find similar profile". */
|
|
74
|
+
secondaryActionTag: _angular_core.InputSignal<PromptSecondaryActionTag | null>;
|
|
75
|
+
/**
|
|
76
|
+
* Collapses `actionTag` and `secondaryActionTag` behind a Plus button that opens a menu listing
|
|
77
|
+
* them; the button turns into a Close button while the menu is open.
|
|
78
|
+
*/
|
|
79
|
+
collapseActionTags: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
51
80
|
maxCharacters: _angular_core.InputSignal<number>;
|
|
52
81
|
supportedFileTypes: _angular_core.InputSignal<string>;
|
|
53
82
|
autoClear: _angular_core.InputSignal<boolean>;
|
|
@@ -80,6 +109,7 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
|
|
|
80
109
|
set disabled(value: boolean);
|
|
81
110
|
promptData: _angular_core.OutputEmitterRef<PromptData>;
|
|
82
111
|
actionTagFileSelected: _angular_core.OutputEmitterRef<File>;
|
|
112
|
+
secondaryActionTagPress: _angular_core.OutputEmitterRef<void>;
|
|
83
113
|
dropdownItemSelected: _angular_core.OutputEmitterRef<PromptDropdownItem>;
|
|
84
114
|
dropdownClosed: _angular_core.OutputEmitterRef<void>;
|
|
85
115
|
promptFilesList: _angular_core.WritableSignal<File[]>;
|
|
@@ -89,6 +119,7 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
|
|
|
89
119
|
tagsInDropdown: _angular_core.WritableSignal<PromptTag[]>;
|
|
90
120
|
autocompleteSuggestion: _angular_core.WritableSignal<string>;
|
|
91
121
|
isDropdownOpened: _angular_core.WritableSignal<boolean>;
|
|
122
|
+
readonly actionsMenuId: string;
|
|
92
123
|
private readonly keepDropdownClosed;
|
|
93
124
|
isFieldHovered: _angular_core.WritableSignal<boolean>;
|
|
94
125
|
isFieldFocused: _angular_core.WritableSignal<boolean>;
|
|
@@ -103,6 +134,13 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
|
|
|
103
134
|
readonly showFocusRing: _angular_core.Signal<boolean>;
|
|
104
135
|
fileInputAccept: _angular_core.Signal<string>;
|
|
105
136
|
isLocked: _angular_core.Signal<boolean>;
|
|
137
|
+
readonly actionTagIcon: _angular_core.Signal<IconName>;
|
|
138
|
+
readonly actionTagMenuTrailingIcon: _angular_core.Signal<IconName>;
|
|
139
|
+
readonly secondaryActionTagMenuTrailingIcon: _angular_core.Signal<IconName>;
|
|
140
|
+
/** Menu items sorted by `menuOrder`; a stable sort keeps the default order for ties and omissions. */
|
|
141
|
+
readonly actionsMenuEntries: _angular_core.Signal<PromptActionsMenuEntry[]>;
|
|
142
|
+
readonly isActionsMenuOpen: _angular_core.Signal<boolean>;
|
|
143
|
+
readonly showActionsMenuTrigger: _angular_core.Signal<boolean>;
|
|
106
144
|
private readonly hasContent;
|
|
107
145
|
/**
|
|
108
146
|
* Shared by the Send button's disabled state and the Enter shortcut, so they cannot disagree.
|
|
@@ -125,6 +163,8 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
|
|
|
125
163
|
tagDropdown: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
126
164
|
fieldComponentRef: _angular_core.Signal<FieldComponent>;
|
|
127
165
|
private readonly promptContainer;
|
|
166
|
+
private readonly actionsPopover;
|
|
167
|
+
private readonly actionsMenu;
|
|
128
168
|
readonly dropdownPositions: ConnectedPosition[];
|
|
129
169
|
ngOnInit(): void;
|
|
130
170
|
ngAfterViewInit(): void;
|
|
@@ -156,10 +196,18 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
|
|
|
156
196
|
setDisabledState(isDisabled: boolean): void;
|
|
157
197
|
onFileSelected(event: Event): Promise<void>;
|
|
158
198
|
onActionTagPress(): void;
|
|
199
|
+
onSecondaryActionTagPress(): void;
|
|
200
|
+
/** The popover's focus trap hands focus back to the Plus button when the menu closes. */
|
|
201
|
+
closeActionsMenu(): void;
|
|
202
|
+
onActionsMenuKeydown(event: KeyboardEvent): void;
|
|
203
|
+
selectActionsMenuEntry(entry: PromptActionsMenuEntry, event: Event): void;
|
|
204
|
+
private selectActionTagFromMenu;
|
|
205
|
+
private selectSecondaryActionTagFromMenu;
|
|
206
|
+
private actionsMenuItems;
|
|
159
207
|
private handleActionTagFile;
|
|
160
208
|
private emitValue;
|
|
161
209
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PromptComponent, never>;
|
|
162
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PromptComponent, "ui-prompt", never, { "tags": { "alias": "tags"; "required": false; "isSignal": true; }; "actionTag": { "alias": "actionTag"; "required": false; "isSignal": true; }; "maxCharacters": { "alias": "maxCharacters"; "required": false; "isSignal": true; }; "supportedFileTypes": { "alias": "supportedFileTypes"; "required": false; "isSignal": true; }; "autoClear": { "alias": "autoClear"; "required": false; "isSignal": true; }; "showSendButton": { "alias": "showSendButton"; "required": false; "isSignal": true; }; "sendButtonDisabled": { "alias": "sendButtonDisabled"; "required": false; "isSignal": true; }; "enableFileUpload": { "alias": "enableFileUpload"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "dropdownItems": { "alias": "dropdownItems"; "required": false; "isSignal": true; }; "dropdownHeading": { "alias": "dropdownHeading"; "required": false; "isSignal": true; }; "showDropdownClose": { "alias": "showDropdownClose"; "required": false; "isSignal": true; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "promptData": "promptData"; "actionTagFileSelected": "actionTagFileSelected"; "dropdownItemSelected": "dropdownItemSelected"; "dropdownClosed": "dropdownClosed"; }, never, ["[promptFooter]"], true, never>;
|
|
210
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PromptComponent, "ui-prompt", never, { "tags": { "alias": "tags"; "required": false; "isSignal": true; }; "actionTag": { "alias": "actionTag"; "required": false; "isSignal": true; }; "secondaryActionTag": { "alias": "secondaryActionTag"; "required": false; "isSignal": true; }; "collapseActionTags": { "alias": "collapseActionTags"; "required": false; "isSignal": true; }; "maxCharacters": { "alias": "maxCharacters"; "required": false; "isSignal": true; }; "supportedFileTypes": { "alias": "supportedFileTypes"; "required": false; "isSignal": true; }; "autoClear": { "alias": "autoClear"; "required": false; "isSignal": true; }; "showSendButton": { "alias": "showSendButton"; "required": false; "isSignal": true; }; "sendButtonDisabled": { "alias": "sendButtonDisabled"; "required": false; "isSignal": true; }; "enableFileUpload": { "alias": "enableFileUpload"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "dropdownItems": { "alias": "dropdownItems"; "required": false; "isSignal": true; }; "dropdownHeading": { "alias": "dropdownHeading"; "required": false; "isSignal": true; }; "showDropdownClose": { "alias": "showDropdownClose"; "required": false; "isSignal": true; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "promptData": "promptData"; "actionTagFileSelected": "actionTagFileSelected"; "secondaryActionTagPress": "secondaryActionTagPress"; "dropdownItemSelected": "dropdownItemSelected"; "dropdownClosed": "dropdownClosed"; }, never, ["[promptFooter]"], true, never>;
|
|
163
211
|
static ngAcceptInputType_disabled: unknown;
|
|
164
212
|
}
|
|
165
213
|
|
|
@@ -170,4 +218,4 @@ declare class PromptModule {
|
|
|
170
218
|
}
|
|
171
219
|
|
|
172
220
|
export { PromptComponent, PromptModule };
|
|
173
|
-
export type { PromptActionTag, PromptData, PromptDropdownItem, PromptTag };
|
|
221
|
+
export type { PromptActionTag, PromptActionsMenuEntry, PromptData, PromptDropdownItem, PromptSecondaryActionTag, PromptTag };
|
|
@@ -151,7 +151,21 @@ declare class SliderComponent implements Validator {
|
|
|
151
151
|
cdr: ChangeDetectorRef;
|
|
152
152
|
decimalPipe: DecimalPipe;
|
|
153
153
|
private control?;
|
|
154
|
+
private readonly destroyRef;
|
|
155
|
+
private readonly ngZone;
|
|
156
|
+
private readonly matSlider;
|
|
157
|
+
private readonly matSliderElement;
|
|
154
158
|
constructor(defaultAppTheme: ApplicationTheme);
|
|
159
|
+
/**
|
|
160
|
+
* Works around MatSlider's resize handling for the range variant. On a resize, `_onResize()`
|
|
161
|
+
* repositions the end thumb before the start thumb, and clamps the end thumb so it cannot sit
|
|
162
|
+
* left of the start thumb's position — which at that point is still the pre-resize one. When the
|
|
163
|
+
* slider shrinks to under about half its width, the end thumb is clamped to that stale position
|
|
164
|
+
* and stays there, because nothing repositions it afterwards. Running the resize step once more,
|
|
165
|
+
* after Material's own observer, places the end thumb against the start thumb's new position.
|
|
166
|
+
* Growing the slider never clamps, so the extra pass is a no-op there.
|
|
167
|
+
*/
|
|
168
|
+
private observeRangeResize;
|
|
155
169
|
private value;
|
|
156
170
|
protected translationContext: string;
|
|
157
171
|
protected touchedControlName: string;
|