@skilder-ai/runtime 0.9.20 → 0.9.23

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.
@@ -30,7 +30,10 @@ __export(index_exports, {
30
30
  execute: () => execute,
31
31
  executeJson: () => executeJson,
32
32
  executeText: () => executeText,
33
- output: () => output
33
+ getSkillContent: () => getSkillContent,
34
+ listSkillContent: () => listSkillContent,
35
+ output: () => output,
36
+ updateSkillContent: () => updateSkillContent
34
37
  });
35
38
  module.exports = __toCommonJS(index_exports);
36
39
 
@@ -180,6 +183,33 @@ async function executeJson(path, args) {
180
183
  throw new Error(`Script "${path}" returned invalid JSON: ${text.slice(0, 200)}`);
181
184
  }
182
185
  }
186
+ function refToParams(ref) {
187
+ if (typeof ref === "string") return { id: ref };
188
+ return ref;
189
+ }
190
+ function assertSkillContent(result, method) {
191
+ if (!result || typeof result !== "object" || typeof result.id !== "string" || typeof result.contentType !== "string") {
192
+ throw new Error(`Invalid ${method} response received from host: ${JSON.stringify(result).slice(0, 200)}`);
193
+ }
194
+ return result;
195
+ }
196
+ async function getSkillContent(ref) {
197
+ const result = await sendRequest("skillContent/get", refToParams(ref));
198
+ return assertSkillContent(result, "skillContent/get");
199
+ }
200
+ async function listSkillContent(opts = {}) {
201
+ const result = await sendRequest("skillContent/list", opts);
202
+ if (!Array.isArray(result)) {
203
+ throw new Error(
204
+ `Invalid skillContent/list response received from host: ${JSON.stringify(result).slice(0, 200)}`
205
+ );
206
+ }
207
+ return result;
208
+ }
209
+ async function updateSkillContent(ref, patch) {
210
+ const result = await sendRequest("skillContent/update", { ...refToParams(ref), patch });
211
+ return assertSkillContent(result, "skillContent/update");
212
+ }
183
213
  async function downloadAsset(path) {
184
214
  const result = await sendRequest("assets/download", { path });
185
215
  if (!result || typeof result !== "object" || typeof result.assetPath !== "string") {
@@ -201,5 +231,8 @@ async function downloadAsset(path) {
201
231
  execute,
202
232
  executeJson,
203
233
  executeText,
204
- output
234
+ getSkillContent,
235
+ listSkillContent,
236
+ output,
237
+ updateSkillContent
205
238
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skilder-ai/runtime",
3
- "version": "0.9.20",
3
+ "version": "0.9.23",
4
4
  "description": "Skilder Runtime - NodeJS processes for edge execution connected to backend orchestrator via NATS",
5
5
  "author": "Skilder AI",
6
6
  "license": "See license in LICENSE",
@@ -62,7 +62,8 @@
62
62
  "esbuild-plugin-tsc": "^0.5.0",
63
63
  "inversify": "^7.0.0-alpha.5",
64
64
  "reflect-metadata": "^0.2.2",
65
- "@skilder-ai/common": "0.9.20"
65
+ "@skilder-ai/common": "0.9.23",
66
+ "@skilder-ai/mcp-servers": "0.9.23"
66
67
  },
67
68
  "scripts": {
68
69
  "build": "tsx tooling/esbuild.build.ts",