@larkup/cli 0.2.19 → 0.2.20
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/{chunk-RNY5632E.js → chunk-ALVK7HAU.js} +3 -3
- package/dist/{chunk-RM2IB56F.js → chunk-YQWW6GKP.js} +31 -4
- package/dist/index.js +3 -3
- package/dist/{tool-loader-JW7XXTCM.js → tool-loader-6ZGWHPOC.js} +2 -2
- package/dist/{tool-registry-WNSCTC3Y.js → tool-registry-6S4KFYSU.js} +5 -3
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getToolById,
|
|
3
3
|
invalidateRegistryCache
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQWW6GKP.js";
|
|
5
5
|
import {
|
|
6
6
|
__require
|
|
7
7
|
} from "./chunk-3RG5ZIWI.js";
|
|
@@ -415,7 +415,7 @@ async function uninstallTool(toolId) {
|
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
invalidateRegistryCache();
|
|
418
|
-
const { unloadTool: unloadTool2 } = await import("./tool-loader-
|
|
418
|
+
const { unloadTool: unloadTool2 } = await import("./tool-loader-6ZGWHPOC.js");
|
|
419
419
|
unloadTool2(toolId);
|
|
420
420
|
}
|
|
421
421
|
async function notifyHubInstall(toolId) {
|
|
@@ -486,7 +486,7 @@ function unloadTool(toolId) {
|
|
|
486
486
|
moduleCache.delete(toolId);
|
|
487
487
|
}
|
|
488
488
|
async function hasCapability(capability) {
|
|
489
|
-
const { getToolsWithCapability } = await import("./tool-registry-
|
|
489
|
+
const { getToolsWithCapability } = await import("./tool-registry-6S4KFYSU.js");
|
|
490
490
|
const tools = await getToolsWithCapability(capability);
|
|
491
491
|
for (const t of tools) {
|
|
492
492
|
const installed = await getInstalledTool(t.id);
|
|
@@ -15,6 +15,32 @@ var STORAGE_WARNING_THRESHOLDS = [
|
|
|
15
15
|
|
|
16
16
|
// ../../packages/marketplace/src/tool-registry.ts
|
|
17
17
|
var cachedRegistry = null;
|
|
18
|
+
function compareToolVersions(left, right) {
|
|
19
|
+
const parse = (version) => {
|
|
20
|
+
const [core, suffix = ""] = version.split("-", 2);
|
|
21
|
+
const parts = core.split(".").map((part) => Number.parseInt(part, 10) || 0);
|
|
22
|
+
return { parts, stable: suffix.length === 0 };
|
|
23
|
+
};
|
|
24
|
+
const a = parse(left);
|
|
25
|
+
const b = parse(right);
|
|
26
|
+
const length = Math.max(a.parts.length, b.parts.length);
|
|
27
|
+
for (let index = 0; index < length; index += 1) {
|
|
28
|
+
const difference = (a.parts[index] ?? 0) - (b.parts[index] ?? 0);
|
|
29
|
+
if (difference !== 0) return difference;
|
|
30
|
+
}
|
|
31
|
+
if (a.stable === b.stable) return 0;
|
|
32
|
+
return a.stable ? 1 : -1;
|
|
33
|
+
}
|
|
34
|
+
function mergeToolDescriptors(current, incoming) {
|
|
35
|
+
const merged = { ...current };
|
|
36
|
+
for (const [id, descriptor] of Object.entries(incoming)) {
|
|
37
|
+
const existing = merged[id];
|
|
38
|
+
if (!existing || compareToolVersions(descriptor.version, existing.version) >= 0) {
|
|
39
|
+
merged[id] = descriptor;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return merged;
|
|
43
|
+
}
|
|
18
44
|
async function discoverLocalManifests() {
|
|
19
45
|
const registry = {};
|
|
20
46
|
const searchPaths = [
|
|
@@ -90,7 +116,7 @@ var FALLBACK_REGISTRY = {
|
|
|
90
116
|
name: "Video & Audio",
|
|
91
117
|
description: "Index video and audio files with transcription and frame analysis.",
|
|
92
118
|
category: "media",
|
|
93
|
-
version: "0.3.
|
|
119
|
+
version: "0.3.4",
|
|
94
120
|
pricing: "free",
|
|
95
121
|
emoji: "\u{1F3AC}",
|
|
96
122
|
icon: "Film",
|
|
@@ -188,13 +214,13 @@ var FALLBACK_REGISTRY = {
|
|
|
188
214
|
};
|
|
189
215
|
async function buildRegistry(opts) {
|
|
190
216
|
if (cachedRegistry) return cachedRegistry;
|
|
191
|
-
|
|
217
|
+
let registry = { ...FALLBACK_REGISTRY };
|
|
192
218
|
if (!opts?.skipHub) {
|
|
193
219
|
const hubCatalog = await fetchHubCatalog(opts?.hubUrl);
|
|
194
|
-
|
|
220
|
+
registry = mergeToolDescriptors(registry, hubCatalog);
|
|
195
221
|
}
|
|
196
222
|
const localManifests = await discoverLocalManifests();
|
|
197
|
-
|
|
223
|
+
registry = mergeToolDescriptors(registry, localManifests);
|
|
198
224
|
cachedRegistry = registry;
|
|
199
225
|
return registry;
|
|
200
226
|
}
|
|
@@ -220,6 +246,7 @@ async function getAllCategories() {
|
|
|
220
246
|
}
|
|
221
247
|
|
|
222
248
|
export {
|
|
249
|
+
mergeToolDescriptors,
|
|
223
250
|
fetchToolFromHub,
|
|
224
251
|
buildRegistry,
|
|
225
252
|
invalidateRegistryCache,
|
package/dist/index.js
CHANGED
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
isToolInstalled,
|
|
20
20
|
loadTool,
|
|
21
21
|
uninstallTool
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ALVK7HAU.js";
|
|
23
23
|
import {
|
|
24
24
|
getAllTools,
|
|
25
25
|
getToolById
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YQWW6GKP.js";
|
|
27
27
|
import {
|
|
28
28
|
__require
|
|
29
29
|
} from "./chunk-3RG5ZIWI.js";
|
|
@@ -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.20",
|
|
38
38
|
publishConfig: {
|
|
39
39
|
access: "public"
|
|
40
40
|
},
|
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
getAllTools,
|
|
6
6
|
getToolById,
|
|
7
7
|
getToolsWithCapability,
|
|
8
|
-
invalidateRegistryCache
|
|
9
|
-
|
|
8
|
+
invalidateRegistryCache,
|
|
9
|
+
mergeToolDescriptors
|
|
10
|
+
} from "./chunk-YQWW6GKP.js";
|
|
10
11
|
import "./chunk-3RG5ZIWI.js";
|
|
11
12
|
export {
|
|
12
13
|
buildRegistry,
|
|
@@ -15,5 +16,6 @@ export {
|
|
|
15
16
|
getAllTools,
|
|
16
17
|
getToolById,
|
|
17
18
|
getToolsWithCapability,
|
|
18
|
-
invalidateRegistryCache
|
|
19
|
+
invalidateRegistryCache,
|
|
20
|
+
mergeToolDescriptors
|
|
19
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@larkup/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"commander": "^15.0.0",
|
|
31
31
|
"zod": "^4.4.3",
|
|
32
32
|
"@larkup/vector-stores": "0.1.24",
|
|
33
|
-
"@larkup/
|
|
34
|
-
"@larkup/
|
|
33
|
+
"@larkup/marketplace": "0.1.20",
|
|
34
|
+
"@larkup/core": "0.3.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"tsup": "^8.0.0",
|