@larkup/marketplace 0.1.18 → 0.1.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/CHANGELOG.md +14 -0
- package/package.json +2 -2
- package/src/tool-installer.ts +4 -0
- package/src/tool-registry.ts +50 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @larkup/marketplace
|
|
2
2
|
|
|
3
|
+
## 0.1.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7601d83: Update Video & Audio from the Media page when an installed tool is stale, and prefer the newest marketplace catalog version so packaged ffmpeg helpers load correctly after installation.
|
|
8
|
+
|
|
9
|
+
## 0.1.19
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- d7d293c: Make Chat retrieval-only, reliably parse PDFs in Next deployments, simplify website entry, and prevent stale Video & Audio metadata from requiring a host ffmpeg installation.
|
|
14
|
+
- Updated dependencies [d7d293c]
|
|
15
|
+
- @larkup/core@0.3.4
|
|
16
|
+
|
|
3
17
|
## 0.1.18
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@larkup/marketplace",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"./manifest": "./src/tool-manifest.schema.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@larkup/core": "0.3.
|
|
17
|
+
"@larkup/core": "0.3.4"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/node": "^26",
|
package/src/tool-installer.ts
CHANGED
|
@@ -253,6 +253,10 @@ export async function checkSystemDeps(toolId: string): Promise<string[]> {
|
|
|
253
253
|
|
|
254
254
|
const missing: string[] = [];
|
|
255
255
|
for (const dep of descriptor.systemDeps) {
|
|
256
|
+
// Video & Audio ships a platform binary via @ffmpeg-installer/ffmpeg.
|
|
257
|
+
// Older Hub manifests still advertise ffmpeg as a host prerequisite; do
|
|
258
|
+
// not let that stale metadata block installation.
|
|
259
|
+
if (toolId === 'video-audio' && dep === 'ffmpeg') continue;
|
|
256
260
|
// A container cannot normally talk to the host Docker daemon. Do not block
|
|
257
261
|
// installation of tools that use Docker only for optional capabilities
|
|
258
262
|
// (for example DOCX/PPTX editing); those capabilities report their own
|
package/src/tool-registry.ts
CHANGED
|
@@ -23,6 +23,46 @@ import { DEFAULT_HUB_URL } from './types';
|
|
|
23
23
|
/** Cached registry — populated on first access. */
|
|
24
24
|
let cachedRegistry: Record<string, ToolDescriptor> | null = null;
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Compare the numeric portions of two semver versions. Marketplace manifests
|
|
28
|
+
* use stable releases, but accepting a suffix keeps a pre-release catalog
|
|
29
|
+
* entry from incorrectly outranking its corresponding stable release.
|
|
30
|
+
*/
|
|
31
|
+
function compareToolVersions(left: string, right: string): number {
|
|
32
|
+
const parse = (version: string) => {
|
|
33
|
+
const [core, suffix = ''] = version.split('-', 2);
|
|
34
|
+
const parts = core.split('.').map((part) => Number.parseInt(part, 10) || 0);
|
|
35
|
+
return { parts, stable: suffix.length === 0 };
|
|
36
|
+
};
|
|
37
|
+
const a = parse(left);
|
|
38
|
+
const b = parse(right);
|
|
39
|
+
const length = Math.max(a.parts.length, b.parts.length);
|
|
40
|
+
for (let index = 0; index < length; index += 1) {
|
|
41
|
+
const difference = (a.parts[index] ?? 0) - (b.parts[index] ?? 0);
|
|
42
|
+
if (difference !== 0) return difference;
|
|
43
|
+
}
|
|
44
|
+
if (a.stable === b.stable) return 0;
|
|
45
|
+
return a.stable ? 1 : -1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Merge catalog entries without allowing an older Hub response or an already
|
|
50
|
+
* installed package to downgrade the version users are offered.
|
|
51
|
+
*/
|
|
52
|
+
export function mergeToolDescriptors(
|
|
53
|
+
current: Record<string, ToolDescriptor>,
|
|
54
|
+
incoming: Record<string, ToolDescriptor>,
|
|
55
|
+
): Record<string, ToolDescriptor> {
|
|
56
|
+
const merged = { ...current };
|
|
57
|
+
for (const [id, descriptor] of Object.entries(incoming)) {
|
|
58
|
+
const existing = merged[id];
|
|
59
|
+
if (!existing || compareToolVersions(descriptor.version, existing.version) >= 0) {
|
|
60
|
+
merged[id] = descriptor;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return merged;
|
|
64
|
+
}
|
|
65
|
+
|
|
26
66
|
/**
|
|
27
67
|
* Scan workspace tool directories for `tool.manifest.json` files.
|
|
28
68
|
* This is used in monorepo development and in Docker builds where
|
|
@@ -143,7 +183,7 @@ const FALLBACK_REGISTRY: Record<string, ToolDescriptor> = {
|
|
|
143
183
|
name: 'Video & Audio',
|
|
144
184
|
description: 'Index video and audio files with transcription and frame analysis.',
|
|
145
185
|
category: 'media',
|
|
146
|
-
version: '0.3.
|
|
186
|
+
version: '0.3.4',
|
|
147
187
|
pricing: 'free',
|
|
148
188
|
emoji: '🎬',
|
|
149
189
|
icon: 'Film',
|
|
@@ -257,19 +297,20 @@ export async function buildRegistry(opts?: {
|
|
|
257
297
|
}): Promise<Record<string, ToolDescriptor>> {
|
|
258
298
|
if (cachedRegistry) return cachedRegistry;
|
|
259
299
|
|
|
260
|
-
// Start with hardcoded fallback
|
|
261
|
-
|
|
300
|
+
// Start with hardcoded fallback.
|
|
301
|
+
let registry = { ...FALLBACK_REGISTRY };
|
|
262
302
|
|
|
263
|
-
// Layer
|
|
264
|
-
const localManifests = await discoverLocalManifests();
|
|
265
|
-
Object.assign(registry, localManifests);
|
|
266
|
-
|
|
267
|
-
// Layer Hub API catalog on top (newest published versions)
|
|
303
|
+
// Layer Hub API catalog over the offline fallback.
|
|
268
304
|
if (!opts?.skipHub) {
|
|
269
305
|
const hubCatalog = await fetchHubCatalog(opts?.hubUrl);
|
|
270
|
-
|
|
306
|
+
registry = mergeToolDescriptors(registry, hubCatalog);
|
|
271
307
|
}
|
|
272
308
|
|
|
309
|
+
// A local workspace manifest wins on equal versions, while an older
|
|
310
|
+
// installed package cannot hide a newer catalog release that repairs it.
|
|
311
|
+
const localManifests = await discoverLocalManifests();
|
|
312
|
+
registry = mergeToolDescriptors(registry, localManifests);
|
|
313
|
+
|
|
273
314
|
cachedRegistry = registry;
|
|
274
315
|
return registry;
|
|
275
316
|
}
|