@larkup/cli 0.2.13 → 0.2.15
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.
|
@@ -70,6 +70,81 @@ async function getInstalledTool(toolId) {
|
|
|
70
70
|
const tools = await getInstalledTools();
|
|
71
71
|
return tools.find((t) => t.id === toolId);
|
|
72
72
|
}
|
|
73
|
+
var INSTALL_HINTS = {
|
|
74
|
+
ffmpeg: {
|
|
75
|
+
macos: "brew install ffmpeg",
|
|
76
|
+
linux_apt: "sudo apt-get install -y ffmpeg",
|
|
77
|
+
linux_dnf: "sudo dnf install -y ffmpeg",
|
|
78
|
+
linux_pacman: "sudo pacman -S --noconfirm ffmpeg",
|
|
79
|
+
linux_apk: "sudo apk add --no-cache ffmpeg"
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
function detectPlatform() {
|
|
83
|
+
if (process.platform === "darwin") return "macos";
|
|
84
|
+
return "linux";
|
|
85
|
+
}
|
|
86
|
+
async function tryAutoInstallDep(dep, onProgress) {
|
|
87
|
+
const hints = INSTALL_HINTS[dep];
|
|
88
|
+
if (!hints) return false;
|
|
89
|
+
const platform = detectPlatform();
|
|
90
|
+
let installCmd;
|
|
91
|
+
if (platform === "macos") {
|
|
92
|
+
try {
|
|
93
|
+
await execAsync("which brew");
|
|
94
|
+
installCmd = hints.macos;
|
|
95
|
+
} catch {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
const managers = [
|
|
100
|
+
{ cmd: "apt-get", key: "linux_apt" },
|
|
101
|
+
{ cmd: "dnf", key: "linux_dnf" },
|
|
102
|
+
{ cmd: "pacman", key: "linux_pacman" },
|
|
103
|
+
{ cmd: "apk", key: "linux_apk" }
|
|
104
|
+
];
|
|
105
|
+
for (const { cmd, key } of managers) {
|
|
106
|
+
try {
|
|
107
|
+
await execAsync(`which ${cmd}`);
|
|
108
|
+
installCmd = hints[key];
|
|
109
|
+
break;
|
|
110
|
+
} catch {
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (!installCmd) return false;
|
|
115
|
+
onProgress?.(`Auto-installing ${dep}\u2026`);
|
|
116
|
+
try {
|
|
117
|
+
await execAsync(installCmd, { timeout: 12e4 });
|
|
118
|
+
} catch {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
await execAsync(`which ${dep}`);
|
|
123
|
+
return true;
|
|
124
|
+
} catch {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function buildMissingDepsMessage(deps) {
|
|
129
|
+
const platform = detectPlatform();
|
|
130
|
+
const lines = [`Missing system dependencies: ${deps.join(", ")}.`];
|
|
131
|
+
for (const dep of deps) {
|
|
132
|
+
const hints = INSTALL_HINTS[dep];
|
|
133
|
+
if (!hints) {
|
|
134
|
+
lines.push(` \u2022 ${dep}: Please install it manually.`);
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (platform === "macos" && hints.macos) {
|
|
138
|
+
lines.push(` \u2022 ${dep}: Run \`${hints.macos}\``);
|
|
139
|
+
} else if (platform === "linux") {
|
|
140
|
+
const linuxHint = hints.linux_apt || hints.linux_dnf || hints.linux_pacman || hints.linux_apk;
|
|
141
|
+
if (linuxHint) {
|
|
142
|
+
lines.push(` \u2022 ${dep}: Run \`${linuxHint}\``);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return lines.join("\n");
|
|
147
|
+
}
|
|
73
148
|
async function checkSystemDeps(toolId) {
|
|
74
149
|
const descriptor = await getToolById(toolId);
|
|
75
150
|
if (!descriptor?.systemDeps?.length) return [];
|
|
@@ -241,9 +316,22 @@ async function installTool(toolId, onProgress) {
|
|
|
241
316
|
throw new Error(`${descriptor.name} is coming soon.`);
|
|
242
317
|
}
|
|
243
318
|
report("checking-deps", 15, "Checking system dependencies\u2026");
|
|
244
|
-
|
|
319
|
+
let missing = (await checkSystemDeps(toolId)).filter((dependency) => dependency !== "docker");
|
|
320
|
+
if (missing.length > 0) {
|
|
321
|
+
const stillMissing = [];
|
|
322
|
+
for (const dep of missing) {
|
|
323
|
+
report("checking-deps", 18, `Attempting to install ${dep}\u2026`);
|
|
324
|
+
const installed = await tryAutoInstallDep(dep, (msg) => report("checking-deps", 20, msg));
|
|
325
|
+
if (installed) {
|
|
326
|
+
report("checking-deps", 22, `${dep} installed successfully.`);
|
|
327
|
+
} else {
|
|
328
|
+
stillMissing.push(dep);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
missing = stillMissing;
|
|
332
|
+
}
|
|
245
333
|
if (missing.length > 0) {
|
|
246
|
-
const msg =
|
|
334
|
+
const msg = buildMissingDepsMessage(missing);
|
|
247
335
|
report("failed", 0, msg);
|
|
248
336
|
throw new Error(msg);
|
|
249
337
|
}
|
|
@@ -323,7 +411,7 @@ async function uninstallTool(toolId) {
|
|
|
323
411
|
}
|
|
324
412
|
}
|
|
325
413
|
invalidateRegistryCache();
|
|
326
|
-
const { unloadTool: unloadTool2 } = await import("./tool-loader-
|
|
414
|
+
const { unloadTool: unloadTool2 } = await import("./tool-loader-KJILSS2J.js");
|
|
327
415
|
unloadTool2(toolId);
|
|
328
416
|
}
|
|
329
417
|
async function notifyHubInstall(toolId) {
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isToolInstalled,
|
|
20
20
|
loadTool,
|
|
21
21
|
uninstallTool
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-C37WLM2M.js";
|
|
23
23
|
import {
|
|
24
24
|
getAllTools,
|
|
25
25
|
getToolById
|
|
@@ -34,7 +34,7 @@ import { Command } from "commander";
|
|
|
34
34
|
// package.json
|
|
35
35
|
var package_default = {
|
|
36
36
|
name: "@larkup/cli",
|
|
37
|
-
version: "0.2.
|
|
37
|
+
version: "0.2.15",
|
|
38
38
|
publishConfig: {
|
|
39
39
|
access: "public"
|
|
40
40
|
},
|
|
@@ -65,6 +65,7 @@ var package_default = {
|
|
|
65
65
|
"@larkup/vector-stores": "workspace:*",
|
|
66
66
|
"@pinecone-database/pinecone": "^8.1.0",
|
|
67
67
|
ai: "^7.0.37",
|
|
68
|
+
"apache-arrow": "^18.1.0",
|
|
68
69
|
chalk: "^5.6.2",
|
|
69
70
|
chromadb: "^3.5.0",
|
|
70
71
|
"cli-table3": "^0.6.5",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@larkup/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,14 +23,15 @@
|
|
|
23
23
|
"@lancedb/lancedb": "^0.31.0",
|
|
24
24
|
"@pinecone-database/pinecone": "^8.1.0",
|
|
25
25
|
"ai": "^7.0.37",
|
|
26
|
+
"apache-arrow": "^18.1.0",
|
|
26
27
|
"chalk": "^5.6.2",
|
|
27
28
|
"chromadb": "^3.5.0",
|
|
28
29
|
"cli-table3": "^0.6.5",
|
|
29
30
|
"commander": "^15.0.0",
|
|
30
31
|
"zod": "^4.4.3",
|
|
31
|
-
"@larkup/
|
|
32
|
-
"@larkup/
|
|
33
|
-
"@larkup/vector-stores": "0.1.
|
|
32
|
+
"@larkup/marketplace": "0.1.15",
|
|
33
|
+
"@larkup/core": "0.3.1",
|
|
34
|
+
"@larkup/vector-stores": "0.1.24"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"tsup": "^8.0.0",
|