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

@@ -21,7 +21,7 @@
*
* Embedders:
* inprocess Xenova/all-MiniLM-L6-v2 padded to 1024 dimensions, as in the
* sidecar, loaded from WAGGLE_MODELS_DIR (default ~/.waggle/models).
* sidecar, loaded from WAGGLE_MODELS_DIR (default ~/.waggle-community/models).
* ollama OLLAMA_HOST (default http://localhost:11434) and
* OLLAMA_EMBED_MODEL (default nomic-embed-text). Ollama must
* already be running with the model pulled.
@@ -41,6 +41,7 @@ import path from 'node:path';
import { performance } from 'node:perf_hooks';
import { fileURLToPath } from 'node:url';
import type { MemoryImportance, MemoryKind } from '@waggle/memory-contract';
import { DEFAULT_DATA_DIR_NAME } from '@waggle/shared';
// The adapter sets this too; setting it first keeps telemetry off even if
// something loads mem0 earlier than the adapter.
@@ -431,7 +432,7 @@ function packageVersion(fromDir: string, name: string): string {
async function main(): Promise<void> {
const options = parseArgs(process.argv.slice(2));
const set = JSON.parse(fs.readFileSync(path.join(BENCH_DIR, 'reference-set.json'), 'utf8')) as ReferenceSet;
const modelsDir = process.env.WAGGLE_MODELS_DIR ?? path.join(os.homedir(), '.waggle', 'models');
const modelsDir = process.env.WAGGLE_MODELS_DIR ?? path.join(os.homedir(), DEFAULT_DATA_DIR_NAME, 'models');
const plan = planEmbedder(options.embedder, modelsDir);
guardNetwork(plan.remoteHost);