@tasksai/install 0.1.10 → 0.1.11
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/package.json +1 -1
- package/src/index.js +9 -5
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -180,7 +180,7 @@ async function install(options, { updateOnly = false } = {}) {
|
|
|
180
180
|
|
|
181
181
|
await writeJson(path.join(installDir, "agent-install.json"), manifest);
|
|
182
182
|
await writeJson(path.join(installDir, "vertical.json"), vertical);
|
|
183
|
-
await downloadRuntime(source, runtimeDir);
|
|
183
|
+
await downloadRuntime(source, runtimeDir, manifest);
|
|
184
184
|
|
|
185
185
|
const licenseKey = await resolveLicenseKey(options, vertical, installDir);
|
|
186
186
|
|
|
@@ -568,14 +568,18 @@ async function checkWritable({ label, targetPath, kind }) {
|
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
|
|
571
|
-
async function downloadRuntime(source, runtimeDir) {
|
|
572
|
-
const
|
|
573
|
-
const
|
|
571
|
+
async function downloadRuntime(source, runtimeDir, manifest = {}) {
|
|
572
|
+
const useBundledRuntime = manifest.runtime?.source === "shared_installer";
|
|
573
|
+
const serverText = await loadRuntimeText(source, "server.py", { useBundledRuntime });
|
|
574
|
+
const requirementsText = await loadRuntimeText(source, "requirements.txt", { useBundledRuntime });
|
|
574
575
|
await fsp.writeFile(path.join(runtimeDir, "server.py"), serverText, "utf8");
|
|
575
576
|
await fsp.writeFile(path.join(runtimeDir, "requirements.txt"), requirementsText, "utf8");
|
|
576
577
|
}
|
|
577
578
|
|
|
578
|
-
async function loadRuntimeText(source, filePath) {
|
|
579
|
+
async function loadRuntimeText(source, filePath, { useBundledRuntime = false } = {}) {
|
|
580
|
+
if (useBundledRuntime) {
|
|
581
|
+
return fsp.readFile(path.join(BUNDLED_RUNTIME_DIR, filePath), "utf8");
|
|
582
|
+
}
|
|
579
583
|
try {
|
|
580
584
|
return await loadText(source, filePath);
|
|
581
585
|
} catch (error) {
|