@skilder-ai/runtime 0.6.0 → 0.6.1
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/index.js +25 -8
- package/dist/index.js.map +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -84584,7 +84584,10 @@ var NatsMessage = class {
|
|
|
84584
84584
|
}
|
|
84585
84585
|
constructor(data, originalMsg = void 0) {
|
|
84586
84586
|
try {
|
|
84587
|
-
this.validate(data);
|
|
84587
|
+
const isValid2 = this.validate(data);
|
|
84588
|
+
if (!isValid2) {
|
|
84589
|
+
throw new Error(`validation failed for type '${this.constructor.type}'`);
|
|
84590
|
+
}
|
|
84588
84591
|
} catch (error48) {
|
|
84589
84592
|
throw new Error(`Invalid message data: ${error48}`);
|
|
84590
84593
|
}
|
|
@@ -84632,7 +84635,11 @@ var NatsMessage = class {
|
|
|
84632
84635
|
}
|
|
84633
84636
|
return message;
|
|
84634
84637
|
} catch (error48) {
|
|
84635
|
-
|
|
84638
|
+
try {
|
|
84639
|
+
return this.getError(`Invalid message ${data.type}: ${error48}`);
|
|
84640
|
+
} catch {
|
|
84641
|
+
throw new Error(`Invalid message ${data.type}: ${error48}`);
|
|
84642
|
+
}
|
|
84636
84643
|
}
|
|
84637
84644
|
}
|
|
84638
84645
|
/**
|
|
@@ -84653,7 +84660,11 @@ var NatsMessage = class {
|
|
|
84653
84660
|
}
|
|
84654
84661
|
return message;
|
|
84655
84662
|
} catch (error48) {
|
|
84656
|
-
|
|
84663
|
+
try {
|
|
84664
|
+
return this.getError(`Invalid message ${rawData.type}: ${error48}`);
|
|
84665
|
+
} catch {
|
|
84666
|
+
throw new Error(`Invalid message ${rawData.type}: ${error48}`);
|
|
84667
|
+
}
|
|
84657
84668
|
}
|
|
84658
84669
|
}
|
|
84659
84670
|
static getError(message) {
|
|
@@ -115601,15 +115612,15 @@ NatsMessage.register(RuntimeSmartSkillsPublish);
|
|
|
115601
115612
|
// ../common/src/messages/skill.call-tool.request.ts
|
|
115602
115613
|
var type10 = "call-tool";
|
|
115603
115614
|
var SkillCallToolRequest = class extends NatsRequest {
|
|
115604
|
-
constructor() {
|
|
115605
|
-
|
|
115615
|
+
constructor(data, originalMsg) {
|
|
115616
|
+
data.isTest ??= false;
|
|
115617
|
+
super(data, originalMsg);
|
|
115606
115618
|
this.type = type10;
|
|
115607
115619
|
}
|
|
115608
115620
|
static {
|
|
115609
115621
|
this.type = type10;
|
|
115610
115622
|
}
|
|
115611
115623
|
validate(data) {
|
|
115612
|
-
data.isTest ??= false;
|
|
115613
115624
|
if (data.workspaceId === void 0 || data.arguments === void 0) {
|
|
115614
115625
|
return false;
|
|
115615
115626
|
}
|
|
@@ -126827,7 +126838,10 @@ var ToolService = class ToolService2 extends Service {
|
|
|
126827
126838
|
if (event.operation !== "PUT" || !event.value)
|
|
126828
126839
|
continue;
|
|
126829
126840
|
const msg = NatsMessage.fromRawData(event.value);
|
|
126830
|
-
if (msg instanceof
|
|
126841
|
+
if (msg instanceof ErrorResponse) {
|
|
126842
|
+
this.logger.error(`Failed to parse MCP servers update: ${msg.data.error}`);
|
|
126843
|
+
continue;
|
|
126844
|
+
} else if (msg instanceof RuntimeMCPServersPublish) {
|
|
126831
126845
|
this.logger.debug(`Processing MCP Servers update with ${msg.data.mcpServers.length} MCP Servers`);
|
|
126832
126846
|
this.roots = msg.data.roots;
|
|
126833
126847
|
const mcpServerIds = msg.data.mcpServers.map((mcpServer) => mcpServer.id);
|
|
@@ -127230,7 +127244,10 @@ ${errorOutput}` }],
|
|
|
127230
127244
|
if (event.operation !== "PUT" || !event.value)
|
|
127231
127245
|
continue;
|
|
127232
127246
|
const msg = NatsMessage.fromRawData(event.value);
|
|
127233
|
-
if (msg instanceof
|
|
127247
|
+
if (msg instanceof ErrorResponse) {
|
|
127248
|
+
this.logger.error(`Failed to parse smart skills update: ${msg.data.error}`);
|
|
127249
|
+
continue;
|
|
127250
|
+
} else if (msg instanceof RuntimeSmartSkillsPublish) {
|
|
127234
127251
|
this.logger.debug(`Received smart skills update: ${msg.data.smartSkills.map((skill) => skill.name).join(", ")}`);
|
|
127235
127252
|
const skillIds = msg.data.smartSkills.map((skill) => skill.id);
|
|
127236
127253
|
const skillsToStop = Array.from(this.smartSkills.keys()).filter((skillId) => !skillIds.includes(skillId));
|