feat: default the data directory to ~/.waggle-community (P1.3c)

The community edition defaulted to ~/.waggle, the data directory of the
commercial Waggle, so both editions would open the same config, vault,
waggle.db, marketplace catalog and skills. Default to
~/.waggle-community instead (ADR-0011). WAGGLE_DATA_DIR still overrides
it wherever it did; nothing is migrated from ~/.waggle.

The name is defined once as DEFAULT_DATA_DIR_NAME and
DEFAULT_DATA_DIR_LABEL in @waggle/shared, with defaultDataDir() in
@waggle/core for the sidecar, the CLI, the agent and the model caches.
The marketplace installs on its own without workspace packages, so it
keeps a copy in its data-dir.ts; the CLI help, which loads no
dependency, spells the path out and its runtime test checks it.

The marketplace security scan also flags skills that reference the new
skills folder. Tests that asserted the old default now use the
constant, and comments name the new directory.
This commit is contained in:
shumeiko.it
2026-11-04 10:31:20 +01:00
parent 120640780c
commit b275f0bf89
72 changed files with 217 additions and 170 deletions

View File

@@ -2,11 +2,11 @@
* In-process embedder using @huggingface/transformers (ONNX Runtime).
* Default provider for ALL desktop users — zero config, works offline.
* Model: Xenova/all-MiniLM-L6-v2 (384 native dims, normalized to target dims).
* Downloads ~90MB fp32 model on first use, cached in ~/.waggle/models/.
* Downloads ~90MB fp32 model on first use, cached in <data dir>/models/.
*/
import path from 'node:path';
import os from 'node:os';
import { defaultDataDir } from '../config.js';
import { createLazyEmbedder, type Embedder } from './embeddings.js';
import { createCoreLogger } from '../logger.js';
import { withTransformersModelLoad } from './transformers-model-load.js';
@@ -32,7 +32,7 @@ export function normalizeDimensions(embedding: Float32Array, targetDims: number)
export async function createInProcessEmbedder(config?: Partial<InProcessEmbedderConfig>): Promise<Embedder> {
const model = config?.model ?? DEFAULT_MODEL;
const cacheDir = config?.cacheDir ?? path.join(os.homedir(), '.waggle', 'models');
const cacheDir = config?.cacheDir ?? path.join(defaultDataDir(), 'models');
const targetDims = config?.targetDimensions ?? 1024;
log.info(`Loading in-process embedding model: ${model} (~90MB fp32 first download)`);