@skilder-ai/runtime 0.8.0 → 0.8.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.
@@ -26,6 +26,7 @@ __export(index_exports, {
26
26
  delegate: () => delegate,
27
27
  delegateJson: () => delegateJson,
28
28
  delegateText: () => delegateText,
29
+ downloadAsset: () => downloadAsset,
29
30
  execute: () => execute,
30
31
  executeJson: () => executeJson,
31
32
  executeText: () => executeText
@@ -156,6 +157,15 @@ async function executeJson(path, args) {
156
157
  throw new Error(`Script "${path}" returned invalid JSON: ${text.slice(0, 200)}`);
157
158
  }
158
159
  }
160
+ async function downloadAsset(path) {
161
+ const result = await sendRequest("assets/download", { path });
162
+ if (!result || typeof result !== "object" || typeof result.assetPath !== "string") {
163
+ throw new Error(
164
+ `Invalid assets/download response received from host: ${JSON.stringify(result).slice(0, 200)}`
165
+ );
166
+ }
167
+ return result.assetPath;
168
+ }
159
169
  // Annotate the CommonJS export names for ESM import in node:
160
170
  0 && (module.exports = {
161
171
  callTool,
@@ -164,6 +174,7 @@ async function executeJson(path, args) {
164
174
  delegate,
165
175
  delegateJson,
166
176
  delegateText,
177
+ downloadAsset,
167
178
  execute,
168
179
  executeJson,
169
180
  executeText
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skilder-ai/runtime",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
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",
@@ -61,7 +61,7 @@
61
61
  "esbuild-plugin-tsc": "^0.5.0",
62
62
  "inversify": "^7.0.0-alpha.5",
63
63
  "reflect-metadata": "^0.2.2",
64
- "@skilder-ai/common": "0.8.0"
64
+ "@skilder-ai/common": "0.8.1"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "tsx tooling/esbuild.build.ts",