labgate 0.5.45 → 0.5.47
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/README.md +2 -0
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/lib/config.d.ts +1 -1
- package/dist/lib/config.js +1 -1
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/container.d.ts +4 -0
- package/dist/lib/container.js +157 -16
- package/dist/lib/container.js.map +1 -1
- package/dist/lib/init.js +1 -1
- package/dist/lib/ui.html +1 -12
- package/dist/lib/ui.js +3 -0
- package/dist/lib/ui.js.map +1 -1
- package/dist/mcp-bundles/cluster-mcp.bundle.mjs +185 -10
- package/dist/mcp-bundles/dataset-mcp.bundle.mjs +186 -11
- package/dist/mcp-bundles/display-mcp.bundle.mjs +186 -11
- package/dist/mcp-bundles/explorer-mcp.bundle.mjs +419 -11
- package/dist/mcp-bundles/results-mcp.bundle.mjs +186 -11
- package/dist/mcp-bundles/slurm-mcp.bundle.mjs +186 -11
- package/package.json +12 -1
|
@@ -3943,7 +3943,7 @@ var require_core = __commonJS({
|
|
|
3943
3943
|
constructor(opts = {}) {
|
|
3944
3944
|
this.schemas = {};
|
|
3945
3945
|
this.refs = {};
|
|
3946
|
-
this.formats =
|
|
3946
|
+
this.formats = /* @__PURE__ */ Object.create(null);
|
|
3947
3947
|
this._compilations = /* @__PURE__ */ new Set();
|
|
3948
3948
|
this._loading = {};
|
|
3949
3949
|
this._cache = /* @__PURE__ */ new Map();
|
|
@@ -4724,6 +4724,7 @@ var require_pattern = __commonJS({
|
|
|
4724
4724
|
"use strict";
|
|
4725
4725
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4726
4726
|
var code_1 = require_code2();
|
|
4727
|
+
var util_1 = require_util();
|
|
4727
4728
|
var codegen_1 = require_codegen();
|
|
4728
4729
|
var error48 = {
|
|
4729
4730
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
@@ -4736,10 +4737,18 @@ var require_pattern = __commonJS({
|
|
|
4736
4737
|
$data: true,
|
|
4737
4738
|
error: error48,
|
|
4738
4739
|
code(cxt) {
|
|
4739
|
-
const { data, $data, schema, schemaCode, it } = cxt;
|
|
4740
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
4740
4741
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
4741
|
-
|
|
4742
|
-
|
|
4742
|
+
if ($data) {
|
|
4743
|
+
const { regExp } = it.opts.code;
|
|
4744
|
+
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
4745
|
+
const valid = gen.let("valid");
|
|
4746
|
+
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
4747
|
+
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
4748
|
+
} else {
|
|
4749
|
+
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
4750
|
+
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
4751
|
+
}
|
|
4743
4752
|
}
|
|
4744
4753
|
};
|
|
4745
4754
|
exports.default = def;
|
|
@@ -24631,10 +24640,9 @@ var ProgressTokenSchema = union([string2(), number2().int()]);
|
|
|
24631
24640
|
var CursorSchema = string2();
|
|
24632
24641
|
var TaskCreationParamsSchema = looseObject({
|
|
24633
24642
|
/**
|
|
24634
|
-
*
|
|
24635
|
-
* If null, the task has unlimited lifetime until manually cleaned up.
|
|
24643
|
+
* Requested duration in milliseconds to retain task from creation.
|
|
24636
24644
|
*/
|
|
24637
|
-
ttl:
|
|
24645
|
+
ttl: number2().optional(),
|
|
24638
24646
|
/**
|
|
24639
24647
|
* Time in milliseconds to wait between task status requests.
|
|
24640
24648
|
*/
|
|
@@ -24934,7 +24942,11 @@ var ClientCapabilitiesSchema = object2({
|
|
|
24934
24942
|
/**
|
|
24935
24943
|
* Present if the client supports task creation.
|
|
24936
24944
|
*/
|
|
24937
|
-
tasks: ClientTasksCapabilitySchema.optional()
|
|
24945
|
+
tasks: ClientTasksCapabilitySchema.optional(),
|
|
24946
|
+
/**
|
|
24947
|
+
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
24948
|
+
*/
|
|
24949
|
+
extensions: record(string2(), AssertObjectSchema).optional()
|
|
24938
24950
|
});
|
|
24939
24951
|
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
24940
24952
|
/**
|
|
@@ -24995,7 +25007,11 @@ var ServerCapabilitiesSchema = object2({
|
|
|
24995
25007
|
/**
|
|
24996
25008
|
* Present if the server supports task creation.
|
|
24997
25009
|
*/
|
|
24998
|
-
tasks: ServerTasksCapabilitySchema.optional()
|
|
25010
|
+
tasks: ServerTasksCapabilitySchema.optional(),
|
|
25011
|
+
/**
|
|
25012
|
+
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
25013
|
+
*/
|
|
25014
|
+
extensions: record(string2(), AssertObjectSchema).optional()
|
|
24999
25015
|
});
|
|
25000
25016
|
var InitializeResultSchema = ResultSchema.extend({
|
|
25001
25017
|
/**
|
|
@@ -25187,6 +25203,12 @@ var ResourceSchema = object2({
|
|
|
25187
25203
|
* The MIME type of this resource, if known.
|
|
25188
25204
|
*/
|
|
25189
25205
|
mimeType: optional(string2()),
|
|
25206
|
+
/**
|
|
25207
|
+
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
|
|
25208
|
+
*
|
|
25209
|
+
* This can be used by Hosts to display file sizes and estimate context window usage.
|
|
25210
|
+
*/
|
|
25211
|
+
size: optional(number2()),
|
|
25190
25212
|
/**
|
|
25191
25213
|
* Optional annotations for the client.
|
|
25192
25214
|
*/
|
|
@@ -27682,6 +27704,10 @@ var Protocol = class {
|
|
|
27682
27704
|
this._progressHandlers.clear();
|
|
27683
27705
|
this._taskProgressTokens.clear();
|
|
27684
27706
|
this._pendingDebouncedNotifications.clear();
|
|
27707
|
+
for (const info of this._timeoutInfo.values()) {
|
|
27708
|
+
clearTimeout(info.timeoutId);
|
|
27709
|
+
}
|
|
27710
|
+
this._timeoutInfo.clear();
|
|
27685
27711
|
for (const controller of this._requestHandlerAbortControllers.values()) {
|
|
27686
27712
|
controller.abort();
|
|
27687
27713
|
}
|
|
@@ -27812,7 +27838,9 @@ var Protocol = class {
|
|
|
27812
27838
|
await capturedTransport?.send(errorResponse);
|
|
27813
27839
|
}
|
|
27814
27840
|
}).catch((error48) => this._onerror(new Error(`Failed to send response: ${error48}`))).finally(() => {
|
|
27815
|
-
this._requestHandlerAbortControllers.
|
|
27841
|
+
if (this._requestHandlerAbortControllers.get(request.id) === abortController) {
|
|
27842
|
+
this._requestHandlerAbortControllers.delete(request.id);
|
|
27843
|
+
}
|
|
27816
27844
|
});
|
|
27817
27845
|
}
|
|
27818
27846
|
_onprogress(notification) {
|
|
@@ -28508,6 +28536,147 @@ var ExperimentalServerTasks = class {
|
|
|
28508
28536
|
requestStream(request, resultSchema, options) {
|
|
28509
28537
|
return this._server.requestStream(request, resultSchema, options);
|
|
28510
28538
|
}
|
|
28539
|
+
/**
|
|
28540
|
+
* Sends a sampling request and returns an AsyncGenerator that yields response messages.
|
|
28541
|
+
* The generator is guaranteed to end with either a 'result' or 'error' message.
|
|
28542
|
+
*
|
|
28543
|
+
* For task-augmented requests, yields 'taskCreated' and 'taskStatus' messages
|
|
28544
|
+
* before the final result.
|
|
28545
|
+
*
|
|
28546
|
+
* @example
|
|
28547
|
+
* ```typescript
|
|
28548
|
+
* const stream = server.experimental.tasks.createMessageStream({
|
|
28549
|
+
* messages: [{ role: 'user', content: { type: 'text', text: 'Hello' } }],
|
|
28550
|
+
* maxTokens: 100
|
|
28551
|
+
* }, {
|
|
28552
|
+
* onprogress: (progress) => {
|
|
28553
|
+
* // Handle streaming tokens via progress notifications
|
|
28554
|
+
* console.log('Progress:', progress.message);
|
|
28555
|
+
* }
|
|
28556
|
+
* });
|
|
28557
|
+
*
|
|
28558
|
+
* for await (const message of stream) {
|
|
28559
|
+
* switch (message.type) {
|
|
28560
|
+
* case 'taskCreated':
|
|
28561
|
+
* console.log('Task created:', message.task.taskId);
|
|
28562
|
+
* break;
|
|
28563
|
+
* case 'taskStatus':
|
|
28564
|
+
* console.log('Task status:', message.task.status);
|
|
28565
|
+
* break;
|
|
28566
|
+
* case 'result':
|
|
28567
|
+
* console.log('Final result:', message.result);
|
|
28568
|
+
* break;
|
|
28569
|
+
* case 'error':
|
|
28570
|
+
* console.error('Error:', message.error);
|
|
28571
|
+
* break;
|
|
28572
|
+
* }
|
|
28573
|
+
* }
|
|
28574
|
+
* ```
|
|
28575
|
+
*
|
|
28576
|
+
* @param params - The sampling request parameters
|
|
28577
|
+
* @param options - Optional request options (timeout, signal, task creation params, onprogress, etc.)
|
|
28578
|
+
* @returns AsyncGenerator that yields ResponseMessage objects
|
|
28579
|
+
*
|
|
28580
|
+
* @experimental
|
|
28581
|
+
*/
|
|
28582
|
+
createMessageStream(params, options) {
|
|
28583
|
+
const clientCapabilities = this._server.getClientCapabilities();
|
|
28584
|
+
if ((params.tools || params.toolChoice) && !clientCapabilities?.sampling?.tools) {
|
|
28585
|
+
throw new Error("Client does not support sampling tools capability.");
|
|
28586
|
+
}
|
|
28587
|
+
if (params.messages.length > 0) {
|
|
28588
|
+
const lastMessage = params.messages[params.messages.length - 1];
|
|
28589
|
+
const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
|
|
28590
|
+
const hasToolResults = lastContent.some((c) => c.type === "tool_result");
|
|
28591
|
+
const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : void 0;
|
|
28592
|
+
const previousContent = previousMessage ? Array.isArray(previousMessage.content) ? previousMessage.content : [previousMessage.content] : [];
|
|
28593
|
+
const hasPreviousToolUse = previousContent.some((c) => c.type === "tool_use");
|
|
28594
|
+
if (hasToolResults) {
|
|
28595
|
+
if (lastContent.some((c) => c.type !== "tool_result")) {
|
|
28596
|
+
throw new Error("The last message must contain only tool_result content if any is present");
|
|
28597
|
+
}
|
|
28598
|
+
if (!hasPreviousToolUse) {
|
|
28599
|
+
throw new Error("tool_result blocks are not matching any tool_use from the previous message");
|
|
28600
|
+
}
|
|
28601
|
+
}
|
|
28602
|
+
if (hasPreviousToolUse) {
|
|
28603
|
+
const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
|
|
28604
|
+
const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
|
|
28605
|
+
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id) => toolResultIds.has(id))) {
|
|
28606
|
+
throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match");
|
|
28607
|
+
}
|
|
28608
|
+
}
|
|
28609
|
+
}
|
|
28610
|
+
return this.requestStream({
|
|
28611
|
+
method: "sampling/createMessage",
|
|
28612
|
+
params
|
|
28613
|
+
}, CreateMessageResultSchema, options);
|
|
28614
|
+
}
|
|
28615
|
+
/**
|
|
28616
|
+
* Sends an elicitation request and returns an AsyncGenerator that yields response messages.
|
|
28617
|
+
* The generator is guaranteed to end with either a 'result' or 'error' message.
|
|
28618
|
+
*
|
|
28619
|
+
* For task-augmented requests (especially URL-based elicitation), yields 'taskCreated'
|
|
28620
|
+
* and 'taskStatus' messages before the final result.
|
|
28621
|
+
*
|
|
28622
|
+
* @example
|
|
28623
|
+
* ```typescript
|
|
28624
|
+
* const stream = server.experimental.tasks.elicitInputStream({
|
|
28625
|
+
* mode: 'url',
|
|
28626
|
+
* message: 'Please authenticate',
|
|
28627
|
+
* elicitationId: 'auth-123',
|
|
28628
|
+
* url: 'https://example.com/auth'
|
|
28629
|
+
* }, {
|
|
28630
|
+
* task: { ttl: 300000 } // Task-augmented for long-running auth flow
|
|
28631
|
+
* });
|
|
28632
|
+
*
|
|
28633
|
+
* for await (const message of stream) {
|
|
28634
|
+
* switch (message.type) {
|
|
28635
|
+
* case 'taskCreated':
|
|
28636
|
+
* console.log('Task created:', message.task.taskId);
|
|
28637
|
+
* break;
|
|
28638
|
+
* case 'taskStatus':
|
|
28639
|
+
* console.log('Task status:', message.task.status);
|
|
28640
|
+
* break;
|
|
28641
|
+
* case 'result':
|
|
28642
|
+
* console.log('User action:', message.result.action);
|
|
28643
|
+
* break;
|
|
28644
|
+
* case 'error':
|
|
28645
|
+
* console.error('Error:', message.error);
|
|
28646
|
+
* break;
|
|
28647
|
+
* }
|
|
28648
|
+
* }
|
|
28649
|
+
* ```
|
|
28650
|
+
*
|
|
28651
|
+
* @param params - The elicitation request parameters
|
|
28652
|
+
* @param options - Optional request options (timeout, signal, task creation params, etc.)
|
|
28653
|
+
* @returns AsyncGenerator that yields ResponseMessage objects
|
|
28654
|
+
*
|
|
28655
|
+
* @experimental
|
|
28656
|
+
*/
|
|
28657
|
+
elicitInputStream(params, options) {
|
|
28658
|
+
const clientCapabilities = this._server.getClientCapabilities();
|
|
28659
|
+
const mode = params.mode ?? "form";
|
|
28660
|
+
switch (mode) {
|
|
28661
|
+
case "url": {
|
|
28662
|
+
if (!clientCapabilities?.elicitation?.url) {
|
|
28663
|
+
throw new Error("Client does not support url elicitation.");
|
|
28664
|
+
}
|
|
28665
|
+
break;
|
|
28666
|
+
}
|
|
28667
|
+
case "form": {
|
|
28668
|
+
if (!clientCapabilities?.elicitation?.form) {
|
|
28669
|
+
throw new Error("Client does not support form elicitation.");
|
|
28670
|
+
}
|
|
28671
|
+
break;
|
|
28672
|
+
}
|
|
28673
|
+
}
|
|
28674
|
+
const normalizedParams = mode === "form" && params.mode === void 0 ? { ...params, mode: "form" } : params;
|
|
28675
|
+
return this.requestStream({
|
|
28676
|
+
method: "elicitation/create",
|
|
28677
|
+
params: normalizedParams
|
|
28678
|
+
}, ElicitResultSchema, options);
|
|
28679
|
+
}
|
|
28511
28680
|
/**
|
|
28512
28681
|
* Gets the current status of a task.
|
|
28513
28682
|
*
|
|
@@ -29684,6 +29853,9 @@ var McpServer = class {
|
|
|
29684
29853
|
annotations = rest.shift();
|
|
29685
29854
|
}
|
|
29686
29855
|
} else if (typeof firstArg === "object" && firstArg !== null) {
|
|
29856
|
+
if (Object.values(firstArg).some((v) => typeof v === "object" && v !== null)) {
|
|
29857
|
+
throw new Error(`Tool ${name} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);
|
|
29858
|
+
}
|
|
29687
29859
|
annotations = rest.shift();
|
|
29688
29860
|
}
|
|
29689
29861
|
}
|
|
@@ -29802,6 +29974,9 @@ function getZodSchemaObject(schema) {
|
|
|
29802
29974
|
if (isZodRawShapeCompat(schema)) {
|
|
29803
29975
|
return objectFromShape(schema);
|
|
29804
29976
|
}
|
|
29977
|
+
if (!isZodSchemaInstance(schema)) {
|
|
29978
|
+
throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");
|
|
29979
|
+
}
|
|
29805
29980
|
return schema;
|
|
29806
29981
|
}
|
|
29807
29982
|
function promptArgumentsFromSchema(schema) {
|
|
@@ -29950,7 +30125,7 @@ import { homedir } from "os";
|
|
|
29950
30125
|
var DEFAULT_CONFIG = {
|
|
29951
30126
|
runtime: "auto",
|
|
29952
30127
|
images_dir: "",
|
|
29953
|
-
// Default sandbox image
|
|
30128
|
+
// Default sandbox image is expected to include python3 + basic build tools (git/make/g++).
|
|
29954
30129
|
// Note: pip/venv are not included by default in Debian; users may still need a
|
|
29955
30130
|
// custom image for richer Python workflows.
|
|
29956
30131
|
image: "docker.io/library/node:20-bookworm",
|