@integrity-labs/agt-cli 0.28.1137 → 0.28.1139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/agt.js +5 -5
- package/dist/{chunk-LQCWKNFX.js → chunk-7U4VSBOE.js} +2 -2
- package/dist/{chunk-WIU4HUHD.js → chunk-DYFE224A.js} +33 -1
- package/dist/{chunk-WIU4HUHD.js.map → chunk-DYFE224A.js.map} +1 -1
- package/dist/{chunk-HZFUOGUV.js → chunk-PI2WUKWD.js} +4 -4
- package/dist/{claude-pair-runtime-OZLZFJZR.js → claude-pair-runtime-BOTE3DRW.js} +2 -2
- package/dist/lib/manager-worker.js +261 -16
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/augmented-admin.js +164 -54
- package/dist/mcp/augmented-help-kb.js +164 -54
- package/dist/mcp/augmented-support.js +164 -54
- package/dist/mcp/direct-chat-channel.js +121 -41
- package/dist/mcp/index.js +243 -59
- package/dist/mcp/origami.js +121 -41
- package/dist/mcp/slack-channel.js +121 -41
- package/dist/mcp/teams-channel.js +89 -41
- package/dist/mcp/telegram-channel.js +121 -41
- package/dist/mcp/whatsapp-channel.js +5447 -4340
- package/dist/mcp/whatsapp-link.js +5442 -4383
- package/dist/mcp/xero.js +6048 -2067
- package/dist/{persistent-session-2X3BCGV5.js → persistent-session-6O66QEI4.js} +3 -3
- package/dist/{responsiveness-probe-QFLFS5QX.js → responsiveness-probe-WGD3NDWG.js} +3 -3
- package/dist/{session-auth-dead-QE7GT5Y5.js → session-auth-dead-6N2AEFKX.js} +2 -2
- package/package.json +2 -2
- /package/dist/{chunk-LQCWKNFX.js.map → chunk-7U4VSBOE.js.map} +0 -0
- /package/dist/{chunk-HZFUOGUV.js.map → chunk-PI2WUKWD.js.map} +0 -0
- /package/dist/{claude-pair-runtime-OZLZFJZR.js.map → claude-pair-runtime-BOTE3DRW.js.map} +0 -0
- /package/dist/{persistent-session-2X3BCGV5.js.map → persistent-session-6O66QEI4.js.map} +0 -0
- /package/dist/{responsiveness-probe-QFLFS5QX.js.map → responsiveness-probe-WGD3NDWG.js.map} +0 -0
- /package/dist/{session-auth-dead-QE7GT5Y5.js.map → session-auth-dead-6N2AEFKX.js.map} +0 -0
|
@@ -9834,7 +9834,7 @@ function _refine(Class2, fn, _params) {
|
|
|
9834
9834
|
return schema;
|
|
9835
9835
|
}
|
|
9836
9836
|
|
|
9837
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
9837
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
9838
9838
|
function isZ4Schema(s) {
|
|
9839
9839
|
const schema = s;
|
|
9840
9840
|
return !!schema._zod;
|
|
@@ -10592,7 +10592,7 @@ function preprocess(fn, schema) {
|
|
|
10592
10592
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/external.js
|
|
10593
10593
|
config(en_default());
|
|
10594
10594
|
|
|
10595
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
10595
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
10596
10596
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
10597
10597
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
10598
10598
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
@@ -10602,10 +10602,9 @@ var ProgressTokenSchema = union([string2(), number2().int()]);
|
|
|
10602
10602
|
var CursorSchema = string2();
|
|
10603
10603
|
var TaskCreationParamsSchema = looseObject({
|
|
10604
10604
|
/**
|
|
10605
|
-
*
|
|
10606
|
-
* If null, the task has unlimited lifetime until manually cleaned up.
|
|
10605
|
+
* Requested duration in milliseconds to retain task from creation.
|
|
10607
10606
|
*/
|
|
10608
|
-
ttl:
|
|
10607
|
+
ttl: number2().optional(),
|
|
10609
10608
|
/**
|
|
10610
10609
|
* Time in milliseconds to wait between task status requests.
|
|
10611
10610
|
*/
|
|
@@ -10905,7 +10904,11 @@ var ClientCapabilitiesSchema = object2({
|
|
|
10905
10904
|
/**
|
|
10906
10905
|
* Present if the client supports task creation.
|
|
10907
10906
|
*/
|
|
10908
|
-
tasks: ClientTasksCapabilitySchema.optional()
|
|
10907
|
+
tasks: ClientTasksCapabilitySchema.optional(),
|
|
10908
|
+
/**
|
|
10909
|
+
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
10910
|
+
*/
|
|
10911
|
+
extensions: record(string2(), AssertObjectSchema).optional()
|
|
10909
10912
|
});
|
|
10910
10913
|
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
10911
10914
|
/**
|
|
@@ -10966,7 +10969,11 @@ var ServerCapabilitiesSchema = object2({
|
|
|
10966
10969
|
/**
|
|
10967
10970
|
* Present if the server supports task creation.
|
|
10968
10971
|
*/
|
|
10969
|
-
tasks: ServerTasksCapabilitySchema.optional()
|
|
10972
|
+
tasks: ServerTasksCapabilitySchema.optional(),
|
|
10973
|
+
/**
|
|
10974
|
+
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
10975
|
+
*/
|
|
10976
|
+
extensions: record(string2(), AssertObjectSchema).optional()
|
|
10970
10977
|
});
|
|
10971
10978
|
var InitializeResultSchema = ResultSchema.extend({
|
|
10972
10979
|
/**
|
|
@@ -11158,6 +11165,12 @@ var ResourceSchema = object2({
|
|
|
11158
11165
|
* The MIME type of this resource, if known.
|
|
11159
11166
|
*/
|
|
11160
11167
|
mimeType: optional(string2()),
|
|
11168
|
+
/**
|
|
11169
|
+
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
|
|
11170
|
+
*
|
|
11171
|
+
* This can be used by Hosts to display file sizes and estimate context window usage.
|
|
11172
|
+
*/
|
|
11173
|
+
size: optional(number2()),
|
|
11161
11174
|
/**
|
|
11162
11175
|
* Optional annotations for the client.
|
|
11163
11176
|
*/
|
|
@@ -12098,7 +12111,7 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
12098
12111
|
}
|
|
12099
12112
|
};
|
|
12100
12113
|
|
|
12101
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12114
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
12102
12115
|
function isTerminal(status) {
|
|
12103
12116
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
12104
12117
|
}
|
|
@@ -12106,7 +12119,7 @@ function isTerminal(status) {
|
|
|
12106
12119
|
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
12107
12120
|
var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
12108
12121
|
|
|
12109
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12122
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
12110
12123
|
function getMethodLiteral(schema) {
|
|
12111
12124
|
const shape = getObjectShape(schema);
|
|
12112
12125
|
const methodSchema = shape?.method;
|
|
@@ -12127,7 +12140,7 @@ function parseWithCompat(schema, data) {
|
|
|
12127
12140
|
return result.data;
|
|
12128
12141
|
}
|
|
12129
12142
|
|
|
12130
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12143
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
12131
12144
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
12132
12145
|
var Protocol = class {
|
|
12133
12146
|
constructor(_options) {
|
|
@@ -12168,6 +12181,9 @@ var Protocol = class {
|
|
|
12168
12181
|
this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
|
|
12169
12182
|
const handleTaskResult = async () => {
|
|
12170
12183
|
const taskId = request.params.taskId;
|
|
12184
|
+
if (!await this._taskStore.getTask(taskId, extra.sessionId)) {
|
|
12185
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
12186
|
+
}
|
|
12171
12187
|
if (this._taskMessageQueue) {
|
|
12172
12188
|
let queuedMessage;
|
|
12173
12189
|
while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
|
|
@@ -12198,12 +12214,12 @@ var Protocol = class {
|
|
|
12198
12214
|
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
12199
12215
|
}
|
|
12200
12216
|
if (!isTerminal(task.status)) {
|
|
12201
|
-
await this._waitForTaskUpdate(taskId, extra.signal);
|
|
12217
|
+
await this._waitForTaskUpdate(taskId, extra.signal, extra.sessionId);
|
|
12202
12218
|
return await handleTaskResult();
|
|
12203
12219
|
}
|
|
12204
12220
|
if (isTerminal(task.status)) {
|
|
12205
12221
|
const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
|
|
12206
|
-
this._clearTaskQueue(taskId);
|
|
12222
|
+
this._clearTaskQueue(taskId, extra.sessionId);
|
|
12207
12223
|
return {
|
|
12208
12224
|
...result,
|
|
12209
12225
|
_meta: {
|
|
@@ -12240,7 +12256,7 @@ var Protocol = class {
|
|
|
12240
12256
|
throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
|
|
12241
12257
|
}
|
|
12242
12258
|
await this._taskStore.updateTaskStatus(request.params.taskId, "cancelled", "Client cancelled task execution.", extra.sessionId);
|
|
12243
|
-
this._clearTaskQueue(request.params.taskId);
|
|
12259
|
+
this._clearTaskQueue(request.params.taskId, extra.sessionId);
|
|
12244
12260
|
const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
|
|
12245
12261
|
if (!cancelledTask) {
|
|
12246
12262
|
throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
|
|
@@ -12339,6 +12355,10 @@ var Protocol = class {
|
|
|
12339
12355
|
this._progressHandlers.clear();
|
|
12340
12356
|
this._taskProgressTokens.clear();
|
|
12341
12357
|
this._pendingDebouncedNotifications.clear();
|
|
12358
|
+
for (const info of this._timeoutInfo.values()) {
|
|
12359
|
+
clearTimeout(info.timeoutId);
|
|
12360
|
+
}
|
|
12361
|
+
this._timeoutInfo.clear();
|
|
12342
12362
|
for (const controller of this._requestHandlerAbortControllers.values()) {
|
|
12343
12363
|
controller.abort();
|
|
12344
12364
|
}
|
|
@@ -12364,6 +12384,19 @@ var Protocol = class {
|
|
|
12364
12384
|
const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
|
|
12365
12385
|
const capturedTransport = this._transport;
|
|
12366
12386
|
const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
|
|
12387
|
+
const sessionId = capturedTransport?.sessionId;
|
|
12388
|
+
const store = this._taskStore;
|
|
12389
|
+
let relatedTaskFound = true;
|
|
12390
|
+
let relatedTaskLookup;
|
|
12391
|
+
if (relatedTaskId && store && this._taskMessageQueue && sessionId !== void 0) {
|
|
12392
|
+
relatedTaskFound = false;
|
|
12393
|
+
relatedTaskLookup = (async () => {
|
|
12394
|
+
if (!await store.getTask(relatedTaskId, sessionId)) {
|
|
12395
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${relatedTaskId}`);
|
|
12396
|
+
}
|
|
12397
|
+
relatedTaskFound = true;
|
|
12398
|
+
})();
|
|
12399
|
+
}
|
|
12367
12400
|
if (handler === void 0) {
|
|
12368
12401
|
const errorResponse = {
|
|
12369
12402
|
jsonrpc: "2.0",
|
|
@@ -12373,7 +12406,10 @@ var Protocol = class {
|
|
|
12373
12406
|
message: "Method not found"
|
|
12374
12407
|
}
|
|
12375
12408
|
};
|
|
12376
|
-
if (relatedTaskId &&
|
|
12409
|
+
if (relatedTaskId && relatedTaskLookup) {
|
|
12410
|
+
const queuedError = { type: "error", message: errorResponse, timestamp: Date.now() };
|
|
12411
|
+
relatedTaskLookup.then(() => this._enqueueTaskMessage(relatedTaskId, queuedError, sessionId), () => capturedTransport?.send(errorResponse)).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
|
|
12412
|
+
} else if (relatedTaskId && this._taskMessageQueue) {
|
|
12377
12413
|
this._enqueueTaskMessage(relatedTaskId, {
|
|
12378
12414
|
type: "error",
|
|
12379
12415
|
message: errorResponse,
|
|
@@ -12424,7 +12460,10 @@ var Protocol = class {
|
|
|
12424
12460
|
closeSSEStream: extra?.closeSSEStream,
|
|
12425
12461
|
closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
|
|
12426
12462
|
};
|
|
12427
|
-
Promise.resolve().then(() => {
|
|
12463
|
+
(relatedTaskLookup ?? Promise.resolve()).then(() => {
|
|
12464
|
+
if (relatedTaskLookup && abortController.signal.aborted) {
|
|
12465
|
+
throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
|
|
12466
|
+
}
|
|
12428
12467
|
if (taskCreationParams) {
|
|
12429
12468
|
this.assertTaskHandlerCapability(request.method);
|
|
12430
12469
|
}
|
|
@@ -12459,7 +12498,7 @@ var Protocol = class {
|
|
|
12459
12498
|
...error2["data"] !== void 0 && { data: error2["data"] }
|
|
12460
12499
|
}
|
|
12461
12500
|
};
|
|
12462
|
-
if (relatedTaskId && this._taskMessageQueue) {
|
|
12501
|
+
if (relatedTaskId && this._taskMessageQueue && relatedTaskFound) {
|
|
12463
12502
|
await this._enqueueTaskMessage(relatedTaskId, {
|
|
12464
12503
|
type: "error",
|
|
12465
12504
|
message: errorResponse,
|
|
@@ -12469,7 +12508,9 @@ var Protocol = class {
|
|
|
12469
12508
|
await capturedTransport?.send(errorResponse);
|
|
12470
12509
|
}
|
|
12471
12510
|
}).catch((error2) => this._onerror(new Error(`Failed to send response: ${error2}`))).finally(() => {
|
|
12472
|
-
this._requestHandlerAbortControllers.
|
|
12511
|
+
if (this._requestHandlerAbortControllers.get(request.id) === abortController) {
|
|
12512
|
+
this._requestHandlerAbortControllers.delete(request.id);
|
|
12513
|
+
}
|
|
12473
12514
|
});
|
|
12474
12515
|
}
|
|
12475
12516
|
_onprogress(notification) {
|
|
@@ -12937,7 +12978,7 @@ var Protocol = class {
|
|
|
12937
12978
|
throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
|
|
12938
12979
|
}
|
|
12939
12980
|
const maxQueueSize = this._options?.maxTaskQueueSize;
|
|
12940
|
-
await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
|
|
12981
|
+
await this._taskMessageQueue.enqueue(taskId, message, sessionId ?? this._transport?.sessionId, maxQueueSize);
|
|
12941
12982
|
}
|
|
12942
12983
|
/**
|
|
12943
12984
|
* Clears the message queue for a task and rejects any pending request resolvers.
|
|
@@ -12966,12 +13007,13 @@ var Protocol = class {
|
|
|
12966
13007
|
* Uses polling to check for updates at the task's configured poll interval.
|
|
12967
13008
|
* @param taskId The task ID to wait for
|
|
12968
13009
|
* @param signal Abort signal to cancel the wait
|
|
13010
|
+
* @param sessionId Session of the request that waits, passed to the task store
|
|
12969
13011
|
* @returns Promise that resolves when an update occurs or rejects if aborted
|
|
12970
13012
|
*/
|
|
12971
|
-
async _waitForTaskUpdate(taskId, signal) {
|
|
13013
|
+
async _waitForTaskUpdate(taskId, signal, sessionId) {
|
|
12972
13014
|
let interval = this._options?.defaultTaskPollInterval ?? 1e3;
|
|
12973
13015
|
try {
|
|
12974
|
-
const task = await this._taskStore?.getTask(taskId);
|
|
13016
|
+
const task = await this._taskStore?.getTask(taskId, sessionId);
|
|
12975
13017
|
if (task?.pollInterval) {
|
|
12976
13018
|
interval = task.pollInterval;
|
|
12977
13019
|
}
|
|
@@ -13075,7 +13117,7 @@ function mergeCapabilities(base, additional) {
|
|
|
13075
13117
|
return result;
|
|
13076
13118
|
}
|
|
13077
13119
|
|
|
13078
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
13120
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
13079
13121
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
13080
13122
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
13081
13123
|
function createDefaultAjvInstance() {
|
|
@@ -13143,7 +13185,7 @@ var AjvJsonSchemaValidator = class {
|
|
|
13143
13185
|
}
|
|
13144
13186
|
};
|
|
13145
13187
|
|
|
13146
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
13188
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
13147
13189
|
var ExperimentalServerTasks = class {
|
|
13148
13190
|
constructor(_server) {
|
|
13149
13191
|
this._server = _server;
|
|
@@ -13356,7 +13398,7 @@ var ExperimentalServerTasks = class {
|
|
|
13356
13398
|
}
|
|
13357
13399
|
};
|
|
13358
13400
|
|
|
13359
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
13401
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
13360
13402
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
13361
13403
|
if (!requests) {
|
|
13362
13404
|
throw new Error(`${entityName} does not support task creation (required for ${method})`);
|
|
@@ -13391,7 +13433,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
13391
13433
|
}
|
|
13392
13434
|
}
|
|
13393
13435
|
|
|
13394
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
13436
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
13395
13437
|
var Server = class extends Protocol {
|
|
13396
13438
|
/**
|
|
13397
13439
|
* Initializes this server with the given name and version information.
|
|
@@ -13457,16 +13499,7 @@ var Server = class extends Protocol {
|
|
|
13457
13499
|
if (!methodSchema) {
|
|
13458
13500
|
throw new Error("Schema is missing a method literal");
|
|
13459
13501
|
}
|
|
13460
|
-
|
|
13461
|
-
if (isZ4Schema(methodSchema)) {
|
|
13462
|
-
const v4Schema = methodSchema;
|
|
13463
|
-
const v4Def = v4Schema._zod?.def;
|
|
13464
|
-
methodValue = v4Def?.value ?? v4Schema.value;
|
|
13465
|
-
} else {
|
|
13466
|
-
const v3Schema = methodSchema;
|
|
13467
|
-
const legacyDef = v3Schema._def;
|
|
13468
|
-
methodValue = legacyDef?.value ?? v3Schema.value;
|
|
13469
|
-
}
|
|
13502
|
+
const methodValue = getLiteralValue(methodSchema);
|
|
13470
13503
|
if (typeof methodValue !== "string") {
|
|
13471
13504
|
throw new Error("Schema method literal must be a string");
|
|
13472
13505
|
}
|
|
@@ -13771,12 +13804,21 @@ var Server = class extends Protocol {
|
|
|
13771
13804
|
}
|
|
13772
13805
|
};
|
|
13773
13806
|
|
|
13774
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
13807
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
13775
13808
|
import process2 from "process";
|
|
13776
13809
|
|
|
13777
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
13810
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
13811
|
+
var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
|
|
13778
13812
|
var ReadBuffer = class {
|
|
13813
|
+
constructor(options) {
|
|
13814
|
+
this._maxBufferSize = options?.maxBufferSize ?? STDIO_DEFAULT_MAX_BUFFER_SIZE;
|
|
13815
|
+
}
|
|
13779
13816
|
append(chunk) {
|
|
13817
|
+
const newSize = (this._buffer?.length ?? 0) + chunk.length;
|
|
13818
|
+
if (newSize > this._maxBufferSize) {
|
|
13819
|
+
this.clear();
|
|
13820
|
+
throw new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);
|
|
13821
|
+
}
|
|
13780
13822
|
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
|
13781
13823
|
}
|
|
13782
13824
|
readMessage() {
|
|
@@ -13802,20 +13844,26 @@ function serializeMessage(message) {
|
|
|
13802
13844
|
return JSON.stringify(message) + "\n";
|
|
13803
13845
|
}
|
|
13804
13846
|
|
|
13805
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
13847
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
13806
13848
|
var StdioServerTransport = class {
|
|
13807
|
-
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
|
|
13849
|
+
constructor(_stdin = process2.stdin, _stdout = process2.stdout, options) {
|
|
13808
13850
|
this._stdin = _stdin;
|
|
13809
13851
|
this._stdout = _stdout;
|
|
13810
|
-
this._readBuffer = new ReadBuffer();
|
|
13811
13852
|
this._started = false;
|
|
13812
13853
|
this._ondata = (chunk) => {
|
|
13813
|
-
|
|
13814
|
-
|
|
13854
|
+
try {
|
|
13855
|
+
this._readBuffer.append(chunk);
|
|
13856
|
+
this.processReadBuffer();
|
|
13857
|
+
} catch (error2) {
|
|
13858
|
+
this.onerror?.(error2);
|
|
13859
|
+
this.close().catch(() => {
|
|
13860
|
+
});
|
|
13861
|
+
}
|
|
13815
13862
|
};
|
|
13816
13863
|
this._onerror = (error2) => {
|
|
13817
13864
|
this.onerror?.(error2);
|
|
13818
13865
|
};
|
|
13866
|
+
this._readBuffer = new ReadBuffer({ maxBufferSize: options?.maxBufferSize });
|
|
13819
13867
|
}
|
|
13820
13868
|
/**
|
|
13821
13869
|
* Starts listening for messages on stdin.
|