spindb 0.35.4 → 0.36.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.
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Shared Weaviate CLI utilities
3
+ *
4
+ * Provides common functions for locating Weaviate binaries,
5
+ * used by both backup.ts and restore.ts to avoid duplication.
6
+ */
7
+
8
+ import { existsSync } from 'fs'
9
+ import { configManager } from '../../core/config-manager'
10
+ import { platformService } from '../../core/platform-service'
11
+
12
+ /**
13
+ * Get the path to weaviate binary
14
+ *
15
+ * Lookup order:
16
+ * 1. configManager cache (bundled/downloaded binaries from hostdb)
17
+ * 2. System PATH (fallback for system-installed weaviate)
18
+ *
19
+ * @returns Path to weaviate or null if not found
20
+ */
21
+ export async function getWeaviatePath(): Promise<string | null> {
22
+ // Check if we have a cached/bundled weaviate from hostdb
23
+ const cachedPath = await configManager.getBinaryPath('weaviate')
24
+ if (cachedPath && existsSync(cachedPath)) {
25
+ return cachedPath
26
+ }
27
+
28
+ // Fallback to system PATH
29
+ return platformService.findToolPath('weaviate')
30
+ }
31
+
32
+ /**
33
+ * Error message for missing weaviate binary
34
+ * Directs users to download via hostdb (preferred) or system package manager (fallback)
35
+ */
36
+ export const WEAVIATE_NOT_FOUND_ERROR =
37
+ 'weaviate not found. Download Weaviate binaries:\n' +
38
+ ' spindb engines download weaviate\n' +
39
+ '\n' +
40
+ 'Or run via Docker:\n' +
41
+ ' docker run -p 8080:8080 semitechnologies/weaviate\n' +
42
+ '\n' +
43
+ 'See: https://weaviate.io/developers/weaviate/installation'
@@ -0,0 +1,23 @@
1
+ /**
2
+ * hostdb Releases Module for Weaviate
3
+ *
4
+ * Fetches Weaviate binary information from the hostdb repository at
5
+ * https://github.com/robertjbass/hostdb
6
+ */
7
+
8
+ import { createHostdbReleases } from '../../core/hostdb-releases-factory'
9
+ import { WEAVIATE_VERSION_MAP, SUPPORTED_MAJOR_VERSIONS } from './version-maps'
10
+ import { weaviateBinaryManager } from './binary-manager'
11
+ import { Engine } from '../../types'
12
+
13
+ const hostdbReleases = createHostdbReleases({
14
+ engine: Engine.Weaviate,
15
+ displayName: 'Weaviate',
16
+ versionMap: WEAVIATE_VERSION_MAP,
17
+ supportedMajorVersions: SUPPORTED_MAJOR_VERSIONS,
18
+ groupingStrategy: 'single-digit',
19
+ listInstalled: () => weaviateBinaryManager.listInstalled(),
20
+ })
21
+
22
+ export const fetchAvailableVersions = hostdbReleases.fetchAvailableVersions
23
+ export const getLatestVersion = hostdbReleases.getLatestVersion