From 120640780cc659984f10d892c8c65e130f0fe33c Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Wed, 4 Nov 2026 10:04:02 +0100 Subject: [PATCH 1/5] refactor(web): remove the Benchmarks page The page showed LoCoMo scores of the old hive-mind memory engine, which the community edition does not run, so its numbers misled. Remove the page and its test, the /benchmarks route, the command palette entry, the route announcement label and the color-guard baseline entry. The e2e route check now expects /benchmarks to show the not-found page. --- AGENTS.md | 3 +- CHANGELOG.md | 2 + apps/web/src/App.tsx | 4 +- .../components/os/apps/BenchmarkApp.test.tsx | 73 ---- .../src/components/os/apps/BenchmarkApp.tsx | 409 ------------------ apps/web/src/components/os/apps/RoomApp.tsx | 2 +- apps/web/src/lib/command-catalog.ts | 3 +- apps/web/src/lib/motion/route-transition.ts | 1 - apps/web/src/routes/BenchmarkRoute.tsx | 11 - apps/web/src/routes/index.ts | 3 +- scripts/ux-gates/color-guard-baseline.json | 6 - tests/e2e/runtime-a11y.spec.ts | 1 - tests/e2e/user-journeys.spec.ts | 7 +- 13 files changed, 10 insertions(+), 515 deletions(-) delete mode 100644 apps/web/src/components/os/apps/BenchmarkApp.test.tsx delete mode 100644 apps/web/src/components/os/apps/BenchmarkApp.tsx delete mode 100644 apps/web/src/routes/BenchmarkRoute.tsx diff --git a/AGENTS.md b/AGENTS.md index 027901f..e464a8f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -100,7 +100,8 @@ WaggleDance routes in the sidecar and `team-sync` in core, with the team server `packages/team-server` (P1.1); the single-mind to multi-mind migration in core (P1.2); Waggle Room tasks for external coding agents (`POST /api/tools/run`, the headless task contract in tool manifests, run tokens and the hook settings a launch used to set) and the router's -external executors. The Tool Launcher keeps detect, launch, live output and stop; the Room canvas +external executors; the Benchmarks page (`/benchmarks`), which showed LoCoMo scores of the old +memory engine. The Tool Launcher keeps detect, launch, live output and stop; the Room canvas (`/room`) still shows Waggle agents, groups and launched tools. The install audit trail moved from core to the server (`packages/server/src/local/install-audit.ts`, P1.2); other packages write to it through `InstallAuditRecorder` from `@waggle/shared`. diff --git a/CHANGELOG.md b/CHANGELOG.md index e908596..43565ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ lists what changed for users compared with that product. The reasons are recorde Launcher still detects these tools, opens them in the active workspace, shows their live output and stops them. "Best fit" in chat now proposes Waggle personas only, so no workspace memories are sent to an external agent. +- **The Benchmarks page** (`/benchmarks`, opened from the command palette). It showed LoCoMo + scores of the old memory engine, which this edition does not run. - **`install.sh`** and `scripts/waggle-server.sh`, replaced by the server installer. - The automatic start of a LiteLLM proxy, which needed Python. It is now opt-in (see Changed). diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index a4db485..b5ad724 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -34,7 +34,6 @@ const MissionControlRoute = lazy(() => import("@/routes/MissionControlRoute")); const TimelineRoute = lazy(() => import("@/routes/TimelineRoute")); const EventsRoute = lazy(() => import("@/routes/EventsRoute")); const UsageRoute = lazy(() => import("@/routes/UsageRoute")); -const BenchmarkRoute = lazy(() => import("@/routes/BenchmarkRoute")); const PlatformRoute = lazy(() => import("@/routes/PlatformRoute")); const WorkspacesRoute = lazy(() => import("@/routes/WorkspacesRoute")); const AuthRoute = lazy(() => import("@/routes/AuthRoute")); @@ -157,8 +156,7 @@ const App = () => ( )} /> )} /> )} /> - {/* ── PR6a: ⌘K-only static surfaces ── */} - )} /> + {/* ── PR6a: ⌘K-only static surface ── */} )} /> {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */} } /> diff --git a/apps/web/src/components/os/apps/BenchmarkApp.test.tsx b/apps/web/src/components/os/apps/BenchmarkApp.test.tsx deleted file mode 100644 index cc7e955..0000000 --- a/apps/web/src/components/os/apps/BenchmarkApp.test.tsx +++ /dev/null @@ -1,73 +0,0 @@ -/** - * BenchmarkApp — screen 17. Pure-UI static showcase. The test renders the - * component, asserts the Capabilities view's framing + matrix, toggles to the - * Memory SOTA view, and asserts the LoCoMo numbers + stat chips. No mocks - * needed — the component has zero props and makes no calls. - */ -import { describe, it, expect, afterEach } from 'vitest'; -import { render, screen, cleanup, fireEvent, within } from '@testing-library/react'; - -import BenchmarkApp from './BenchmarkApp'; - -afterEach(() => cleanup()); - -describe('BenchmarkApp', () => { - it('renders the Capabilities view by default with the positioning framing', () => { - render(); - // Tablist toggle present, Capabilities tab selected. - expect(screen.getByRole('tab', { name: /vs competitors/i })).toHaveAttribute('aria-selected', 'true'); - expect(screen.getByRole('tab', { name: /memory sota/i })).toHaveAttribute('aria-selected', 'false'); - // Headline + the two framing cards. - expect(screen.getByText(/waggle remembers you/i)).toBeInTheDocument(); - expect(screen.getByRole('heading', { name: /task agents/i })).toBeInTheDocument(); - expect(screen.getByRole('heading', { name: /a memory layer \+ workspace/i })).toBeInTheDocument(); - // Honest disclaimer label. - expect(screen.getByText(/positioning view, not a lab benchmark/i)).toBeInTheDocument(); - }); - - it('renders the full 11-row capability matrix with the deliberate competitor win on deep coding', () => { - render(); - // Waggle column header + first/last capability rows. - expect(screen.getByRole('columnheader', { name: /^waggle$/i })).toBeInTheDocument(); - expect(screen.getByRole('rowheader', { name: /persistent memory across sessions/i })).toBeInTheDocument(); - const lastRow = screen.getByRole('rowheader', { name: /deep coding in the terminal/i }); - expect(lastRow).toBeInTheDocument(); - // 11 capability rows = 11 row headers. - expect(screen.getAllByRole('rowheader')).toHaveLength(11); - // The last row is honest: Waggle is only Partial on deep terminal coding. - const row = lastRow.closest('tr'); - expect(row).not.toBeNull(); - const cells = within(row as HTMLElement).getAllByRole('cell'); - expect(cells[0]).toHaveAttribute('aria-label', 'Partial'); // Waggle column - expect(cells[1]).toHaveAttribute('aria-label', 'Yes'); // Claude Code column - }); - - it('toggles to the Memory SOTA view and shows the LoCoMo numbers + stat chips', () => { - render(); - fireEvent.click(screen.getByRole('tab', { name: /memory sota/i })); - - // View switched. - expect(screen.getByRole('tab', { name: /memory sota/i })).toHaveAttribute('aria-selected', 'true'); - expect(screen.queryByRole('rowheader', { name: /persistent memory across sessions/i })).not.toBeInTheDocument(); - - // SOTA headline + the four LoCoMo bar values. - expect(screen.getByText(/best long-term memory/i)).toBeInTheDocument(); - expect(screen.getByText('86.49')).toBeInTheDocument(); - expect(screen.getByText('81.95')).toBeInTheDocument(); - expect(screen.getByText('78.05')).toBeInTheDocument(); - expect(screen.getByText('62.47')).toBeInTheDocument(); - - // Stat chips. - expect(screen.getByText('+4.54')).toBeInTheDocument(); - expect(screen.getByText('92.27%')).toBeInTheDocument(); - expect(screen.getByText('100%')).toBeInTheDocument(); - }); - - it('toggles back to Capabilities', () => { - render(); - fireEvent.click(screen.getByRole('tab', { name: /memory sota/i })); - fireEvent.click(screen.getByRole('tab', { name: /vs competitors/i })); - expect(screen.getByRole('tab', { name: /vs competitors/i })).toHaveAttribute('aria-selected', 'true'); - expect(screen.getByRole('rowheader', { name: /persistent memory across sessions/i })).toBeInTheDocument(); - }); -}); diff --git a/apps/web/src/components/os/apps/BenchmarkApp.tsx b/apps/web/src/components/os/apps/BenchmarkApp.tsx deleted file mode 100644 index 71a8b2b..0000000 --- a/apps/web/src/components/os/apps/BenchmarkApp.tsx +++ /dev/null @@ -1,409 +0,0 @@ -/** - * BenchmarkApp — Warm-Hive Benchmarks surface (screen 17). A pure-UI, ⌘K-only - * showcase with two views behind a segmented toggle: - * - * 1) Capabilities — honest positioning vs the field (task agents vs Waggle's - * memory layer), an 11-row capability matrix with the Waggle column - * honey-highlighted. Deliberately credits competitors on "deep terminal - * coding" — it's a positioning view, not a lab benchmark. - * 2) Memory SOTA — the one real head-to-head lab result: LoCoMo bars + stats. - * - * Static data only — no backend, no API, no props (default-export, zero-prop). - * Source fidelity: docs/design_handoff_waggle_app/design-files/screens/benchmark.html - */ -import { useState } from 'react'; -import { BarChart3, Info } from 'lucide-react'; - -// ─────────────────────────────────────────────────────────────────────────── -// Benchmark figures — manually refreshed from the hive-mind benchmark, -// 2026-06-18 — do not fabricate. Numbers MUST match benchmark.html exactly. -// ─────────────────────────────────────────────────────────────────────────── - -/** A capability mark: yes (●) / partial (◐) / no (○). */ -type Mark = 'Y' | 'P' | 'N'; - -/** Competitor columns, in matrix order after the honey Waggle column. */ -const COMPETITORS = [ - { name: 'Claude Code', sub: 'CLI' }, - { name: 'Codex', sub: 'CLI' }, - { name: 'Cowork', sub: 'Anthropic' }, - { name: 'Hermes', sub: 'agent' }, - { name: 'Odysseus', sub: 'agent' }, -] as const; - -/** 11-row capability matrix. marks order: Waggle, then the 5 COMPETITORS. */ -const CAPABILITY_MATRIX: ReadonlyArray<{ capability: string; marks: readonly Mark[] }> = [ - { capability: 'Persistent memory across sessions', marks: ['Y', 'P', 'N', 'P', 'P', 'P'] }, - { capability: 'Local-first & private by default', marks: ['Y', 'N', 'N', 'N', 'P', 'P'] }, - { capability: 'Any model (incl. small local models)', marks: ['Y', 'N', 'N', 'N', 'P', 'P'] }, - { capability: 'Built for non-technical experts', marks: ['Y', 'N', 'N', 'P', 'N', 'N'] }, - { capability: 'Runs your existing coding agents', marks: ['Y', 'N', 'N', 'N', 'N', 'N'] }, - { capability: 'Self-evolving skills', marks: ['Y', 'N', 'N', 'N', 'P', 'N'] }, - { capability: 'Skills shared across agents/workspaces', marks: ['Y', 'P', 'P', 'N', 'P', 'N'] }, - { capability: 'Multi-agent swarm', marks: ['Y', 'P', 'N', 'P', 'P', 'Y'] }, - { capability: 'Native desktop app · Windows, macOS, Linux', marks: ['Y', 'N', 'N', 'P', 'N', 'N'] }, - { capability: 'Audit-ready / EU AI Act', marks: ['Y', 'P', 'P', 'P', 'N', 'N'] }, - { capability: 'Deep coding in the terminal', marks: ['P', 'Y', 'Y', 'P', 'P', 'Y'] }, -]; - -/** LoCoMo memory bars — value drives both the label and the bar width. */ -const MEMORY_BARS: ReadonlyArray<{ name: string; note: string; value: number; us?: boolean }> = [ - { name: 'Waggle · Hive Mind', note: 'ours · local', value: 86.49, us: true }, - { name: 'Memori', note: 'prev. SOTA', value: 81.95 }, - { name: 'LangMem', note: 'corrected', value: 78.05 }, - { name: 'Mem0', note: 'baseline', value: 62.47 }, -]; - -/** Stat chips beneath the bars. */ -const MEMORY_STATS: ReadonlyArray<{ value: string; label: React.ReactNode }> = [ - { value: '+4.54', label: <>points over the prior best · z = 4.64, p < 10⁻⁵ }, - { value: '92.27%', label: <>single-hop recall, ~1pt off the full-context ceiling }, - { value: '100%', label: <>local: warm recalls in 58–83 ms, on-device }, -]; - -// ─────────────────────────────────────────────────────────────────────────── - -type View = 'caps' | 'memory'; - -const VIEW_LABELS: Record = { - caps: <>Capabilities: where Waggle sits vs the field, - memory: <>Memory SOTA: the one head-to-head lab result, -}; - -const MARK_GLYPH: Record = { Y: '●', P: '◐', N: '○' }; - -/** Colour a mark by kind. The Waggle (first) column reads honey. */ -function markClass(mark: Mark, isUs: boolean): string { - if (isUs && mark === 'Y') return 'font-bold'; - if (mark === 'Y') return ''; - if (mark === 'P') return ''; - return 'opacity-60'; -} - -function markStyle(mark: Mark, isUs: boolean): React.CSSProperties { - if (isUs) return { color: 'var(--honey)' }; - if (mark === 'Y') return { color: 'var(--healthy)' }; - if (mark === 'P') return { color: 'var(--attention)' }; - return { color: 'var(--text-2)' }; -} - -/** One disclaimer/caveat block — shared between the two views. */ -function Disclaimer({ children }: { children: React.ReactNode }) { - return ( -
- -

{children}

-
- ); -} - -const BenchmarkApp = () => { - const [view, setView] = useState('caps'); - - return ( -
- {/* Controls bar — segmented toggle + live view label */} -
- - - Benchmarks · view - -
- {(['caps', 'memory'] as View[]).map(v => ( - - ))} -
- {VIEW_LABELS[view]} -
- - {/* Stage */} -
-
- {view === 'caps' ? : } -
-
-
- ); -}; - -function CapabilitiesView() { - return ( -
-
-
-
-

- They automate tasks. Waggle remembers you. -

-

- The strong agents today are terminal coding tools for engineers. - Waggle plays a different game: a persistent, local-first memory layer for - knowledge workers that even runs those agents inside it. Here's the - honest lay of the land. -

-
- - {/* Two framing cards */} -
-
-
The field
-

Task agents

-

- Powerful, mostly terminal-based, model-locked, and built for developers. Each session starts fresh; the - intelligence lives in the model, not in a memory of you. -

-
- Claude Code · Codex · Claude Cowork · Hermes · Odysseus -
-
- -
-
- Our category -
-

- A memory layer + workspace -

-

- Knows you and your work across every session, runs on any model (even local), is built for non-technical - experts, and can launch the task agents into its shared memory. -

-
- Waggle: complements them, doesn't compete head-on -
-
-
- - {/* Capability matrix */} -
- - - - - - - {COMPETITORS.map(c => ( - - ))} - - - - {CAPABILITY_MATRIX.map((row, rowIdx) => { - const isLast = rowIdx === CAPABILITY_MATRIX.length - 1; - return ( - - - {row.marks.map((mark, colIdx) => { - const isUs = colIdx === 0; - return ( - - ); - })} - - ); - })} - -
Capability comparison: Waggle versus task agents
- Capability - - Waggle - - {c.name} - {c.sub} -
- {row.capability} - - - {MARK_GLYPH[mark]} - -
-
- - {/* Legend */} -
- - ●Yes - - - ◐Partial / limited - - - ○No / not the focus - -
- - - This is a positioning view, not a lab benchmark: capabilities as - understood June 2026, focused on the dimensions Waggle is built around. Coding agents are genuinely excellent at - deep code work (the last row), which is exactly why Waggle launches them{' '} - rather than replacing them. The one head-to-head lab result is the memory benchmark → see “Memory SOTA”. - -
- ); -} - -function MemorySotaView() { - const maxValue = Math.max(...MEMORY_BARS.map(b => b.value)); - - return ( -
-
-
-
-

- The best long-term memory on record. -

-

- On LoCoMo (the standard test for long-term conversational memory), - Waggle's open-source substrate scores 86.49%, a new state of the - art, measured under the prior leader's own protocol and judge. -

-
- - {/* LoCoMo bars */} -
- {MEMORY_BARS.map(bar => ( -
-
- {bar.name} - {bar.note} -
-
-
-
-
- {bar.value} -
-
- ))} -
- - {/* Stat chips */} -
- {MEMORY_STATS.map((stat, i) => ( -
-
- {stat.value} -
-
{stat.label}
-
- ))} -
- - - LoCoMo, N = 1,540, GPT-4.1-mini as answerer & judge: the prior - SOTA's exact published protocol, reproduced in-harness to 0.03 points before comparison. The intelligence lives in - the memory layer, not the model, so it travels onto a small local - model too. Honest caveat: higher token use per question than the leanest systems; efficiency work underway. - -
- ); -} - -export default BenchmarkApp; diff --git a/apps/web/src/components/os/apps/RoomApp.tsx b/apps/web/src/components/os/apps/RoomApp.tsx index f560bf6..738f58f 100644 --- a/apps/web/src/components/os/apps/RoomApp.tsx +++ b/apps/web/src/components/os/apps/RoomApp.tsx @@ -40,7 +40,7 @@ interface RoomAppProps { // Warm-token status styling (D21): the live SSE roster maps to semantic vars, // not raw emerald/sky/violet. Inline style is the project convention for the -// --work/--intel/--healthy/--risk semantic palette (see BenchmarkApp). +// --work/--intel/--healthy/--risk semantic palette. const STATUS_DOT_STYLE: Record = { pending: { background: 'var(--text-dim)' }, running: { background: 'var(--honey)' }, diff --git a/apps/web/src/lib/command-catalog.ts b/apps/web/src/lib/command-catalog.ts index 619b6e8..7c14fe4 100644 --- a/apps/web/src/lib/command-catalog.ts +++ b/apps/web/src/lib/command-catalog.ts @@ -4,7 +4,7 @@ import { Plus, Rocket, Settings, Server, Plug, Store, Package, Shield, Clock, FolderOpen, Lock, Activity, History, BarChart3, Users, Radio, - Gauge, Monitor, LayoutGrid, Eye, + Monitor, LayoutGrid, Eye, } from "lucide-react"; /** @@ -85,7 +85,6 @@ export function buildCommandCatalog(ctx: CatalogContext): CatalogGroup[] { { id: "timeline", group: "power", name: "Timeline", subtitle: "activity history", icon: History, to: "/settings/timeline" }, { id: "events", group: "power", name: "Events & logs", subtitle: "live activity feed", icon: Radio, to: "/settings/events" }, { id: "usage", group: "power", name: "Usage & cost", subtitle: "tokens · spend", icon: BarChart3, to: "/settings/usage" }, - { id: "benchmarks", group: "power", name: "Benchmarks", subtitle: "capabilities · memory SOTA", icon: Gauge, to: "/benchmarks" }, { id: "platform", group: "power", name: "Platform & roadmap", subtitle: "desktop · what's coming", icon: Monitor, to: "/platform" }, ]; diff --git a/apps/web/src/lib/motion/route-transition.ts b/apps/web/src/lib/motion/route-transition.ts index ff14824..5ea1f6f 100644 --- a/apps/web/src/lib/motion/route-transition.ts +++ b/apps/web/src/lib/motion/route-transition.ts @@ -45,7 +45,6 @@ const ROUTE_LABELS: Record = { marketplace: 'Marketplace', launcher: 'Launcher', settings: 'Settings', - benchmarks: 'Benchmarks', platform: 'Platform', }; diff --git a/apps/web/src/routes/BenchmarkRoute.tsx b/apps/web/src/routes/BenchmarkRoute.tsx deleted file mode 100644 index bee0ea2..0000000 --- a/apps/web/src/routes/BenchmarkRoute.tsx +++ /dev/null @@ -1,11 +0,0 @@ -/** PR6a route wrapper — `/benchmarks` → BenchmarkApp (static, ⌘K-only surface). */ -import BenchmarkApp from '@/components/os/apps/BenchmarkApp'; -import SurfaceBoundary from './SurfaceBoundary'; - -const BenchmarkRoute = () => ( - - - -); - -export default BenchmarkRoute; diff --git a/apps/web/src/routes/index.ts b/apps/web/src/routes/index.ts index 80cd683..f4d0f12 100644 --- a/apps/web/src/routes/index.ts +++ b/apps/web/src/routes/index.ts @@ -49,8 +49,7 @@ export { default as MissionControlRoute } from './MissionControlRoute'; export { default as TimelineRoute } from './TimelineRoute'; export { default as EventsRoute } from './EventsRoute'; export { default as UsageRoute } from './UsageRoute'; -// PR6a — ⌘K-only static surfaces (Benchmarks · Platform) -export { default as BenchmarkRoute } from './BenchmarkRoute'; +// PR6a — ⌘K-only static surface (Platform) export { default as PlatformRoute } from './PlatformRoute'; export { default as WorkspacesRoute } from './WorkspacesRoute'; // PR7b — pre-shell /auth route (sibling outside AppShell) diff --git a/scripts/ux-gates/color-guard-baseline.json b/scripts/ux-gates/color-guard-baseline.json index 7d85f35..1f9e6ec 100644 --- a/scripts/ux-gates/color-guard-baseline.json +++ b/scripts/ux-gates/color-guard-baseline.json @@ -87,12 +87,6 @@ "snippet": "text-muted-foreground/30", "kind": "low-opacity-token" }, - { - "file": "apps/web/src/components/os/apps/BenchmarkApp.tsx", - "line": 129, - "kind": "inline-hex", - "snippet": "color:#1a1407" - }, { "file": "apps/web/src/components/os/apps/CapabilitiesApp.tsx", "line": 497, diff --git a/tests/e2e/runtime-a11y.spec.ts b/tests/e2e/runtime-a11y.spec.ts index ef94b82..2020b93 100644 --- a/tests/e2e/runtime-a11y.spec.ts +++ b/tests/e2e/runtime-a11y.spec.ts @@ -42,7 +42,6 @@ const ROUTES = [ '/files', '/approvals', '/artifacts', - '/benchmarks', '/platform', ] as const; diff --git a/tests/e2e/user-journeys.spec.ts b/tests/e2e/user-journeys.spec.ts index 0085750..bc615a5 100644 --- a/tests/e2e/user-journeys.spec.ts +++ b/tests/e2e/user-journeys.spec.ts @@ -842,14 +842,11 @@ test.describe('User Journey Tests', () => { }); test('J-route-coverage: thin utility routes render or redirect clearly', async ({ page }) => { - await gotoApp(page, '/benchmarks'); - await expect(page.locator('body')).toContainText(/benchmark|capability|score|memory/i); - await gotoApp(page, '/platform'); await expect(page.locator('body')).toContainText(/platform|local|governance|memory|agent/i); - // Payment pages are gone in the community edition (ADR-0001). - for (const route of ['/payment-cancelled', '/payment-success']) { + // Payment pages (ADR-0001) and the Benchmarks page are gone in the community edition. + for (const route of ['/payment-cancelled', '/payment-success', '/benchmarks']) { await gotoApp(page, route); await expect(page.locator('body')).toContainText(/page you.re after doesn.t exist/i); } From b275f0bf8932673b48c3f954d9fedd732775a55e Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Wed, 4 Nov 2026 10:31:20 +0100 Subject: [PATCH 2/5] 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. --- packages/agent/src/custom-personas.ts | 2 +- packages/agent/src/custom-workflows.ts | 2 +- packages/agent/src/hook-loader.ts | 2 +- packages/agent/src/skill-audit-store.ts | 2 +- packages/agent/src/skill-hygiene-store.ts | 2 +- packages/agent/src/skill-redaction.ts | 2 +- packages/agent/src/skill-retirement.ts | 2 +- packages/agent/src/skill-tools.ts | 12 ++--- packages/agent/src/skill-usage.ts | 2 +- packages/agent/src/skill-write-service.ts | 2 +- packages/agent/src/tool-detection.ts | 2 +- packages/agent/src/tool-manifest-loader.ts | 6 +-- .../tests/eval/hermes-skill-reuse-eval.ts | 6 +-- .../agent/tests/eval/prompt-assembler-eval.ts | 6 +-- .../tests/eval/prompt-assembler-v5-eval.ts | 6 +-- .../agent/tests/marketplace-commands.test.ts | 2 +- packages/cli/src/index.ts | 4 +- packages/cli/src/repl.ts | 17 +++---- packages/cli/tests/cli-runtime.test.ts | 18 ++++--- packages/core/src/config.ts | 14 ++++- .../core/src/embeddings/inprocess-embedder.ts | 6 +-- packages/core/src/file-store.ts | 2 +- packages/core/src/index.ts | 3 +- .../core/src/recall/inprocess-reranker.ts | 4 +- packages/core/src/telemetry.ts | 2 +- packages/marketplace/ARCHITECTURE.md | 14 ++--- packages/marketplace/src/cli.ts | 3 +- packages/marketplace/src/data-dir.ts | 8 +++ packages/marketplace/src/db.ts | 3 +- packages/marketplace/src/installer.ts | 11 ++-- packages/marketplace/src/security.ts | 4 +- .../marketplace/tests/cli-runtime.test.ts | 3 +- .../tests/installer-security.test.ts | 51 ++++++++++--------- .../tests/sync-verification.test.ts | 2 +- packages/memory-mem0/bench/search-quality.ts | 5 +- packages/sdk/src/plugin-runtime.ts | 2 +- packages/sdk/src/starter-skills/index.ts | 2 +- packages/server/src/local/index.ts | 12 ++--- packages/server/src/local/mcp-config.ts | 6 +-- packages/server/src/local/offline-manager.ts | 2 +- .../src/local/routes/anthropic-proxy.ts | 2 +- packages/server/src/local/routes/backup.ts | 2 +- packages/server/src/local/routes/chat.ts | 2 +- packages/server/src/local/routes/command.ts | 4 +- packages/server/src/local/routes/documents.ts | 4 +- .../src/local/routes/local-inference.ts | 4 +- .../src/local/routes/marketplace-dev.ts | 3 +- .../server/src/local/routes/marketplace.ts | 8 +-- packages/server/src/local/routes/mcps.ts | 2 +- .../server/src/local/routes/onboarding.ts | 2 +- packages/server/src/local/routes/pins.ts | 4 +- packages/server/src/local/routes/profile.ts | 2 +- .../server/src/local/routes/skills-audit.ts | 5 +- .../server/src/local/routes/skills-hygiene.ts | 4 +- packages/server/src/local/routes/skills.ts | 11 ++-- packages/server/src/local/routes/tasks.ts | 2 +- packages/server/src/local/routes/workflows.ts | 2 +- .../server/src/local/routes/workspaces.ts | 5 +- packages/server/src/local/service.ts | 9 ++-- .../server/src/local/storage/fs-provider.ts | 2 +- packages/server/src/local/storage/index.ts | 2 +- packages/server/tests/backup-restore.test.ts | 2 +- packages/server/tests/d11-datadir.test.ts | 12 +++-- .../server/tests/local/mcp-config.test.ts | 5 +- packages/server/tests/local/mcps.test.ts | 6 +-- .../local/pins-documents-data-dir.test.ts | 2 +- packages/server/tests/plugin-autoload.test.ts | 2 +- packages/shared/src/data-dir.ts | 12 +++++ packages/shared/src/index.ts | 1 + packages/shared/src/tool-detection.ts | 2 +- tests/agent-behavior-audit.ts | 3 +- vitest.setup.ts | 3 +- 72 files changed, 217 insertions(+), 170 deletions(-) create mode 100644 packages/marketplace/src/data-dir.ts create mode 100644 packages/shared/src/data-dir.ts diff --git a/packages/agent/src/custom-personas.ts b/packages/agent/src/custom-personas.ts index d0b0315..132a630 100644 --- a/packages/agent/src/custom-personas.ts +++ b/packages/agent/src/custom-personas.ts @@ -1,5 +1,5 @@ /** - * Custom Personas — user-created personas stored as JSON in ~/.waggle/personas/ + * Custom Personas — user-created personas stored as JSON in ~/.waggle-community/personas/ * Loaded at startup and merged with built-in PERSONAS. */ diff --git a/packages/agent/src/custom-workflows.ts b/packages/agent/src/custom-workflows.ts index 768feac..1fff559 100644 --- a/packages/agent/src/custom-workflows.ts +++ b/packages/agent/src/custom-workflows.ts @@ -1,5 +1,5 @@ /** - * Custom Workflows — user-created workflow templates stored as JSON in ~/.waggle/workflows/ + * Custom Workflows — user-created workflow templates stored as JSON in ~/.waggle-community/workflows/ */ import fs from 'node:fs'; diff --git a/packages/agent/src/hook-loader.ts b/packages/agent/src/hook-loader.ts index 042cd22..91b052b 100644 --- a/packages/agent/src/hook-loader.ts +++ b/packages/agent/src/hook-loader.ts @@ -14,7 +14,7 @@ interface HooksConfig { } /** - * Load user-configurable hooks from a JSON config file (e.g. ~/.waggle/hooks.json). + * Load user-configurable hooks from a JSON config file (e.g. ~/.waggle-community/hooks.json). * If the file doesn't exist, returns silently — no error. * * Config format: diff --git a/packages/agent/src/skill-audit-store.ts b/packages/agent/src/skill-audit-store.ts index b075c3f..04efdc2 100644 --- a/packages/agent/src/skill-audit-store.ts +++ b/packages/agent/src/skill-audit-store.ts @@ -1,7 +1,7 @@ /** * Skill-audit sidecar (Odysseus §D2). * - * ~/.waggle/skill-audit.json records the run-and-grade "verified" badge per + * ~/.waggle-community/skill-audit.json records the run-and-grade "verified" badge per * skill — the sellable PRO artifact of the autonomous skill-audit loop * (skill-audit.ts). DISTINCT from skill-hygiene.json (active|draft status): * a skill can be active AND unverified, or active AND verified. The audit diff --git a/packages/agent/src/skill-hygiene-store.ts b/packages/agent/src/skill-hygiene-store.ts index 72dafd9..1551272 100644 --- a/packages/agent/src/skill-hygiene-store.ts +++ b/packages/agent/src/skill-hygiene-store.ts @@ -1,7 +1,7 @@ /** * Skill hygiene sidecar (Odysseus §D1). * - * ~/.waggle/skill-hygiene.json records each skill's hygiene status + advisory. + * ~/.waggle-community/skill-hygiene.json records each skill's hygiene status + advisory. * The single-LLM-call judge (skill-hygiene.ts) writes here when a skill is found * redundant-with-peers or too-generic, DEMOTING it to 'draft'. It never edits or * deletes the SKILL.md, so the proven content and its change-detection hash never diff --git a/packages/agent/src/skill-redaction.ts b/packages/agent/src/skill-redaction.ts index 92782b2..6c95c4d 100644 --- a/packages/agent/src/skill-redaction.ts +++ b/packages/agent/src/skill-redaction.ts @@ -2,7 +2,7 @@ * Pre-write redaction for authored skill content. * * The closed-learning-loop (create_skill / auto_extract_skills) and the UI both - * persist skill markdown to disk (~/.waggle/skills). That content can carry + * persist skill markdown to disk (~/.waggle-community/skills). That content can carry * secrets (API keys / tokens) or machine-specific filesystem paths pulled from * the model's context or the user's input. The loop's "strip secrets/paths" * instruction was model-advisory only — this enforces it deterministically diff --git a/packages/agent/src/skill-retirement.ts b/packages/agent/src/skill-retirement.ts index 64af910..0e6b65a 100644 --- a/packages/agent/src/skill-retirement.ts +++ b/packages/agent/src/skill-retirement.ts @@ -3,7 +3,7 @@ * * Walks the personal-scope skill directory and moves any SKILL.md file * whose last-used timestamp (from skill-usage.json sidecar) is older than - * maxIdleDays into ~/.waggle/skills-archive/. Parallels the existing + * maxIdleDays into ~/.waggle-community/skills-archive/. Parallels the existing * decayFrames() behavior in packages/weaver/src/consolidation.ts. * * Retirement rules: diff --git a/packages/agent/src/skill-tools.ts b/packages/agent/src/skill-tools.ts index a85939e..2303365 100644 --- a/packages/agent/src/skill-tools.ts +++ b/packages/agent/src/skill-tools.ts @@ -39,7 +39,7 @@ import { autoExtractAndCreateSkill, type AutoExtractMessage } from './skill-auto import { retireStaleSkills } from './skill-retirement.js'; export interface SkillToolsDeps { - /** Path to ~/.waggle directory */ + /** Path to ~/.waggle-community directory */ waggleHome: string; /** Callback to reload skills into agent state after changes */ onSkillsChanged?: () => void; @@ -69,10 +69,10 @@ export interface SkillToolsDeps { /** * Skills 2.0 gap E: resolve the on-disk directory for a given scope. - * - personal: ~/.waggle/skills/ - * - workspace: ~/.waggle/workspaces/{workspaceId}/skills/ - * - team: ~/.waggle/teams/{teamId}/skills/ - * - enterprise: ~/.waggle/enterprise/skills/ + * - personal: ~/.waggle-community/skills/ + * - workspace: ~/.waggle-community/workspaces/{workspaceId}/skills/ + * - team: ~/.waggle-community/teams/{teamId}/skills/ + * - enterprise: ~/.waggle-community/enterprise/skills/ * * Returns null when the required context (workspaceId, teamId) is missing. */ @@ -849,7 +849,7 @@ Only use this after acquire_capability has identified a specific installable can name: 'retire_skills', description: 'Archive personal-scope skills that have not been used within the idle window. ' - + 'Moves stale SKILL.md files to ~/.waggle/skills-archive/ (recoverable — no deletion). ' + + 'Moves stale SKILL.md files to ~/.waggle-community/skills-archive/ (recoverable — no deletion). ' + 'Default max_idle_days is 90. Default dry_run is true — call with dry_run: false to ' + 'actually move the files.', parameters: { diff --git a/packages/agent/src/skill-usage.ts b/packages/agent/src/skill-usage.ts index ac43cf4..1e15641 100644 --- a/packages/agent/src/skill-usage.ts +++ b/packages/agent/src/skill-usage.ts @@ -1,7 +1,7 @@ /** * Skills 2.0 gap F — skill usage tracking. * - * Sidecar JSON store at ~/.waggle/skill-usage.json that tracks when each + * Sidecar JSON store at ~/.waggle-community/skill-usage.json that tracks when each * installed skill was last referenced and how many times. Consumed by * retireStaleSkills to decide which SKILL.md files to archive. * diff --git a/packages/agent/src/skill-write-service.ts b/packages/agent/src/skill-write-service.ts index 61546a8..ba367a8 100644 --- a/packages/agent/src/skill-write-service.ts +++ b/packages/agent/src/skill-write-service.ts @@ -21,7 +21,7 @@ import type { InstallAuditRecorder } from '@waggle/shared'; /** Shared deps for every skill-write op. auditStore/onChange degrade gracefully. */ export interface SkillWriteDeps { - /** Directory holding personal-scope SKILL.md files (~/.waggle/skills). */ + /** Directory holding personal-scope SKILL.md files (~/.waggle-community/skills). */ skillsDir: string; /** Audit store — when present, every op records an install_audit row. */ auditStore?: InstallAuditRecorder; diff --git a/packages/agent/src/tool-detection.ts b/packages/agent/src/tool-detection.ts index 35f6a11..8432f45 100644 --- a/packages/agent/src/tool-detection.ts +++ b/packages/agent/src/tool-detection.ts @@ -617,7 +617,7 @@ async function detectFromManifest(m: ToolManifest, deps: ResolvedDeps): Promise< /** * Run every registered tool's detector in parallel and assemble the envelope. * The registry = built-in manifests (source of truth in @waggle/shared) + - * validated third-party adapters from ~/.waggle/adapters/*.json (#5). Order is + * validated third-party adapters from ~/.waggle-community/adapters/*.json (#5). Order is * deterministic (registry order) so the UI doesn't shuffle between calls. */ export async function detectInstalledTools( diff --git a/packages/agent/src/tool-manifest-loader.ts b/packages/agent/src/tool-manifest-loader.ts index db5a5d3..7be8369 100644 --- a/packages/agent/src/tool-manifest-loader.ts +++ b/packages/agent/src/tool-manifest-loader.ts @@ -1,13 +1,13 @@ /** * AI-OS #5 — declarative loader for third-party tool adapters from - * ~/.waggle/adapters/*.json. Data only: hand-validated + safe-string-refined, + * ~/.waggle-community/adapters/*.json. Data only: hand-validated + safe-string-refined, * PATH-detection only, never require()/eval. Never throws into detection. * * Validation is hand-rolled (not zod) to avoid adding a dependency to the agent * package for one small flat schema; the safe-string refinement is the boundary * defense against shell-metachar / path-traversal injection in adapter fields. */ -import os from 'node:os'; +import { defaultDataDir } from '@waggle/core'; import path from 'node:path'; import fs from 'node:fs'; import type { ToolManifest } from '@waggle/shared'; @@ -58,7 +58,7 @@ export interface ManifestLoaderDeps { } export function loadThirdPartyManifests(deps: ManifestLoaderDeps = {}): ToolManifest[] { - const dir = deps.dir ?? path.join(os.homedir(), '.waggle', 'adapters'); + const dir = deps.dir ?? path.join(defaultDataDir(), 'adapters'); const readDir = deps.readDir ?? ((d) => fs.readdirSync(d)); const readFile = deps.readFile ?? ((p) => fs.readFileSync(p, 'utf8')); let names: string[]; diff --git a/packages/agent/tests/eval/hermes-skill-reuse-eval.ts b/packages/agent/tests/eval/hermes-skill-reuse-eval.ts index d8b3642..608bbdd 100644 --- a/packages/agent/tests/eval/hermes-skill-reuse-eval.ts +++ b/packages/agent/tests/eval/hermes-skill-reuse-eval.ts @@ -6,7 +6,7 @@ * in tool-calls, within-model paired, graded on correctness. * * Usage: tsx packages/agent/tests/eval/hermes-skill-reuse-eval.ts - * Env: WAGGLE_DATA_DIR (vault location; default ~/.waggle) + * Env: WAGGLE_DATA_DIR (vault location; default ~/.waggle-community) * HERMES_EVAL_N (override pair count; default = pilot 3) * Output: tmp_hermes-skill-reuse.json (gitignored) + console verdict. * @@ -16,7 +16,7 @@ import { runAgentLoop } from '../../src/agent-loop.js'; import type { ToolDefinition } from '../../src/tools.js'; import { planSkillDistillation } from '../../src/skill-distillation.js'; import { CostTracker, BudgetExceededError } from '../../src/cost-tracker.js'; -import { VaultStore } from '@waggle/core'; +import { VaultStore, defaultDataDir } from '@waggle/core'; import * as fs from 'node:fs'; import * as os from 'node:os'; import * as path from 'node:path'; @@ -49,7 +49,7 @@ const COST_SAFETY = 1.3; // manifest §9.3 // the $5 pilot / $40 hard cap are enforced against this. const MODEL_PRICING = { [MODEL]: { inputPer1k: 0.003, outputPer1k: 0.015 } }; -const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR || path.join(os.homedir(), '.waggle'); +const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR || defaultDataDir(); // ── Forcing corpus (manifest §7 + Amendment 3) ─────────────────────── // Fictional, project-specific "Floruxa" subsystem. Facts are scattered diff --git a/packages/agent/tests/eval/prompt-assembler-eval.ts b/packages/agent/tests/eval/prompt-assembler-eval.ts index 4b200a5..fb7aa18 100644 --- a/packages/agent/tests/eval/prompt-assembler-eval.ts +++ b/packages/agent/tests/eval/prompt-assembler-eval.ts @@ -6,7 +6,7 @@ * tsx packages/agent/tests/eval/prompt-assembler-eval.ts * * Environment: - * WAGGLE_DATA_DIR — override ~/.waggle (for non-default installs) + * WAGGLE_DATA_DIR — override ~/.waggle-community (for non-default installs) * WAGGLE_EVAL_SKIP_SECONDARY=1 — skip Gemma 4 26B MoE + Qwen3 secondary suites * WAGGLE_EVAL_SEEDS — number of seeds per condition (default 3) * @@ -23,7 +23,7 @@ * EVAL-RESULTS.md — human-readable summary (committed) */ -import { VaultStore } from '@waggle/core'; +import { VaultStore, defaultDataDir } from '@waggle/core'; import { createInMemoryMemoryStore, PERSONAL_SCOPE, @@ -43,7 +43,7 @@ import { execFileSync } from 'node:child_process'; // ── Config ────────────────────────────────────────────────────────── -const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR ?? path.join(os.homedir(), '.waggle'); +const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR ?? defaultDataDir(); // Use fileURLToPath to handle Windows file:// URLs correctly (avoids // `/D:/...` leading-slash bug that produced `D:\D:\...` double-drive paths). const HARNESS_DIR = path.dirname(fileURLToPath(import.meta.url)); diff --git a/packages/agent/tests/eval/prompt-assembler-v5-eval.ts b/packages/agent/tests/eval/prompt-assembler-v5-eval.ts index 4cec79e..9132ca9 100644 --- a/packages/agent/tests/eval/prompt-assembler-v5-eval.ts +++ b/packages/agent/tests/eval/prompt-assembler-v5-eval.ts @@ -16,7 +16,7 @@ * tsx packages/agent/tests/eval/prompt-assembler-v5-eval.ts * * Environment: - * WAGGLE_DATA_DIR — override ~/.waggle (for non-default installs) + * WAGGLE_DATA_DIR — override ~/.waggle-community (for non-default installs) * WAGGLE_EVAL_SKIP_SECONDARY=1 — skip Gemma 4 26B MoE + Qwen thinking * WAGGLE_EVAL_SEEDS — base seeds per condition (default 3) * WAGGLE_EVAL_SKIP_SLUG_PROBE=1 — skip the pre-eval slug probe @@ -32,7 +32,7 @@ * judges are reachable, the eval halts and reports partial state. */ -import { VaultStore } from '@waggle/core'; +import { VaultStore, defaultDataDir } from '@waggle/core'; import { createInMemoryMemoryStore, PERSONAL_SCOPE, @@ -57,7 +57,7 @@ process.env.WAGGLE_EVAL_MODE = '1'; // ── Config ────────────────────────────────────────────────────────── -const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR ?? path.join(os.homedir(), '.waggle'); +const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR ?? defaultDataDir(); const HARNESS_DIR = path.dirname(fileURLToPath(import.meta.url)); const REPO_ROOT = path.resolve(path.join(HARNESS_DIR, '..', '..', '..', '..')); const RESULTS_JSON = path.join(REPO_ROOT, 'tmp_bench_results-v5.json'); diff --git a/packages/agent/tests/marketplace-commands.test.ts b/packages/agent/tests/marketplace-commands.test.ts index 432adc2..415d0c3 100644 --- a/packages/agent/tests/marketplace-commands.test.ts +++ b/packages/agent/tests/marketplace-commands.test.ts @@ -162,7 +162,7 @@ describe('Marketplace Commands', () => { // Mock install response fetchSpy.mockResolvedValueOnce(new Response(JSON.stringify({ success: true, - message: 'Installed to ~/.waggle/skills/', + message: 'Installed to ~/.waggle-community/skills/', }), { status: 200 })); const ctx = mockContext(); diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 9dceca1..287a717 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -7,6 +7,8 @@ * waggle --help Show help */ +// Help loads no dependency (see cli-runtime.test.ts), so the default data +// directory is spelled out here; that test checks it matches DEFAULT_DATA_DIR_LABEL. function printHelp(): void { console.log(` Waggle CLI — interactive AI agent with persistent memory @@ -17,7 +19,7 @@ Usage: waggle --help Show this help message Configuration: - Edit ~/.waggle/config.json to set up providers and API keys. + Edit ~/.waggle-community/config.json to set up providers and API keys. Commands (inside REPL): /model Switch model diff --git a/packages/cli/src/repl.ts b/packages/cli/src/repl.ts index a7951f2..140bf77 100644 --- a/packages/cli/src/repl.ts +++ b/packages/cli/src/repl.ts @@ -7,10 +7,9 @@ */ import readline from 'node:readline'; -import os from 'node:os'; import path from 'node:path'; import chalk from 'chalk'; -import { WaggleConfig, WaggleDB, createMemoryEmbedder } from '@waggle/core'; +import { WaggleConfig, WaggleDB, createMemoryEmbedder, defaultDataDir, DEFAULT_DATA_DIR_LABEL } from '@waggle/core'; import { PERSONAL_SCOPE } from '@waggle/memory-contract'; import { createMem0MemoryStore } from '@waggle/memory-mem0'; import { Orchestrator, ModelRouter, runAgentLoop, createSystemTools, createPlanTools, createGitTools, Workspace, ensureIdentity, loadSystemPromptWithOverrides, loadSkills, CostTracker, HookRegistry, loadHooksFromConfig, needsConfirmation } from '@waggle/agent'; @@ -44,20 +43,20 @@ export async function startRepl(options: ReplOptions = {}): Promise { const workspace = new Workspace(process.cwd()); workspace.init(); - // Load user customizations from ~/.waggle/. - const waggleHome = path.join(os.homedir(), '.waggle'); + // Load user customizations from the data directory. + const waggleHome = defaultDataDir(); const composedPrompt = loadSystemPromptWithOverrides(waggleHome); const userSystemPrompt = composedPrompt.userPromptMd; const skills = loadSkills(waggleHome); - // Load user-configurable hooks from ~/.waggle/hooks.json + // Load user-configurable hooks from /hooks.json const hookRegistry = new HookRegistry(); await loadHooksFromConfig(path.join(waggleHome, 'hooks.json'), hookRegistry); // The proxy for non-local models; local ollama/* models skip it (model-endpoint.ts). const wsConfig = workspace.getConfig(); - // Memory: the same store the desktop app uses (ADR-0007), in ~/.waggle/memory. + // Memory: the same store the desktop app uses (ADR-0007), in /memory. const memory = await createMem0MemoryStore({ directory: path.join(waggleHome, 'memory'), embedder: createMemoryEmbedder({ cacheDir: path.join(waggleHome, 'models') }), @@ -176,7 +175,7 @@ export async function startRepl(options: ReplOptions = {}): Promise { console.log(chalk.dim(' ') + chalk.cyan(m) + marker); } if (models.length === 0) { - console.log(chalk.dim(' No models configured. Edit ~/.waggle/config.json')); + console.log(chalk.dim(` No models configured. Edit ${DEFAULT_DATA_DIR_LABEL}/config.json`)); } console.log(''); break; @@ -333,9 +332,9 @@ When asked about current events, products, releases, docs, or anything you're no const errMsg = (err as Error).message; if (errMsg.includes('Unknown model')) { console.log(chalk.red(`Model "${currentModel}" is not configured.`)); - console.log(chalk.dim('Run /models to see available models, or edit ~/.waggle/config.json')); + console.log(chalk.dim(`Run /models to see available models, or edit ${DEFAULT_DATA_DIR_LABEL}/config.json`)); } else if (errMsg.includes('API key') || errMsg.includes('authentication') || errMsg.includes('401')) { - console.log(chalk.red('Authentication failed. Check your API key in ~/.waggle/config.json')); + console.log(chalk.red(`Authentication failed. Check your API key in ${DEFAULT_DATA_DIR_LABEL}/config.json`)); } else { console.log(chalk.red(`Error: ${errMsg}`)); } diff --git a/packages/cli/tests/cli-runtime.test.ts b/packages/cli/tests/cli-runtime.test.ts index 49209f4..747c36b 100644 --- a/packages/cli/tests/cli-runtime.test.ts +++ b/packages/cli/tests/cli-runtime.test.ts @@ -8,6 +8,7 @@ import type { AddressInfo } from 'node:net'; import os from 'node:os'; import path from 'node:path'; import { describe, expect, it } from 'vitest'; +import { DEFAULT_DATA_DIR_LABEL, DEFAULT_DATA_DIR_NAME } from '@waggle/shared'; const ROOT = path.resolve(import.meta.dirname, '..', '..', '..'); const CLI_DIR = path.join(ROOT, 'packages', 'cli'); @@ -242,8 +243,9 @@ describe('@waggle/cli runtime UX', () => { expect(result.status).toBe(0); expect(result.stdout).toContain('Waggle CLI'); expect(result.stdout).toContain('Usage:'); + expect(result.stdout).toContain(`${DEFAULT_DATA_DIR_LABEL}/config.json`); expect(result.stderr).toBe(''); - expect(fs.existsSync(path.join(home, '.waggle'))).toBe(false); + expect(fs.existsSync(path.join(home, DEFAULT_DATA_DIR_NAME))).toBe(false); } finally { fs.rmSync(home, { recursive: true, force: true }); } @@ -281,7 +283,7 @@ describe('@waggle/cli runtime UX', () => { expect(result.stdout).toContain('Waggle CLI'); expect(result.stdout).toContain('Usage:'); expect(result.stderr).toBe(''); - expect(fs.existsSync(path.join(home, '.waggle'))).toBe(false); + expect(fs.existsSync(path.join(home, DEFAULT_DATA_DIR_NAME))).toBe(false); } finally { fs.rmSync(home, { recursive: true, force: true }); } @@ -399,7 +401,7 @@ describe('@waggle/cli runtime UX', () => { expect(result.stdout).toContain('Waggle CLI'); expect(result.stdout).toContain('Usage:'); expect(result.stderr).toBe(''); - expect(fs.existsSync(path.join(home, '.waggle'))).toBe(false); + expect(fs.existsSync(path.join(home, DEFAULT_DATA_DIR_NAME))).toBe(false); } finally { fs.rmSync(home, { recursive: true, force: true }); } @@ -505,9 +507,11 @@ describe('@waggle/cli runtime UX', () => { expect(stdout).toContain('Goodbye!'); expect(stderr).not.toContain('Fatal error'); // Memory (mem0) and Waggle's own database live in the data directory (ADR-0007). - expect(fs.existsSync(path.join(home, '.waggle', 'memory', 'waggle-memory.json'))).toBe(true); - expect(fs.existsSync(path.join(home, '.waggle', 'waggle.db'))).toBe(true); - expect(fs.existsSync(path.join(home, '.waggle', 'default.mind'))).toBe(false); + expect(fs.existsSync(path.join(home, DEFAULT_DATA_DIR_NAME, 'memory', 'waggle-memory.json'))).toBe(true); + expect(fs.existsSync(path.join(home, DEFAULT_DATA_DIR_NAME, 'waggle.db'))).toBe(true); + expect(fs.existsSync(path.join(home, DEFAULT_DATA_DIR_NAME, 'default.mind'))).toBe(false); + // ADR-0011: the commercial edition's directory stays untouched. + expect(fs.existsSync(path.join(home, '.waggle'))).toBe(false); } finally { if (child) await stopProcess(child); fs.rmSync(home, { recursive: true, force: true }); @@ -564,7 +568,7 @@ describe('@waggle/cli runtime UX', () => { } mockLiteLlm = await startMockLiteLlm(); - const waggleHome = path.join(home, '.waggle'); + const waggleHome = path.join(home, DEFAULT_DATA_DIR_NAME); const workspaceConfigDir = path.join(projectDir, '.waggle'); fs.mkdirSync(waggleHome, { recursive: true }); fs.mkdirSync(workspaceConfigDir, { recursive: true }); diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index 2ca20e1..9e14158 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -1,6 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import os from 'node:os'; +import { DEFAULT_DATA_DIR_NAME } from '@waggle/shared'; import type { EmbeddingProviderConfig, EmbeddingProviderType } from './embeddings/embedding-provider.js'; export interface ProviderEntry { @@ -14,7 +15,8 @@ export interface CliConfig { } // Keys the commercial edition writes (tier, trialStartedAt, teamServer) are not -// read here but stay in config.json on save: both editions may share ~/.waggle. +// read here but stay in config.json on save, in case a user points both +// editions at one data directory with WAGGLE_DATA_DIR. interface ConfigData { defaultModel: string; providers: Record; @@ -72,9 +74,17 @@ function getNonBlankEnv(name: string): string | undefined { return process.env[name]?.trim() || undefined; } +/** + * The default data directory, `~/.waggle-community` (ADR-0011). Callers that + * honor WAGGLE_DATA_DIR check it before falling back to this. + */ +export function defaultDataDir(): string { + return path.join(os.homedir(), DEFAULT_DATA_DIR_NAME); +} + function getDefaultConfigDir(): string { const home = process.env.HOME || process.env.USERPROFILE || os.homedir(); - return path.join(home, '.waggle'); + return path.join(home, DEFAULT_DATA_DIR_NAME); } export class WaggleConfig { diff --git a/packages/core/src/embeddings/inprocess-embedder.ts b/packages/core/src/embeddings/inprocess-embedder.ts index 128a2d3..1d7d7af 100644 --- a/packages/core/src/embeddings/inprocess-embedder.ts +++ b/packages/core/src/embeddings/inprocess-embedder.ts @@ -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 /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): Promise { 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)`); diff --git a/packages/core/src/file-store.ts b/packages/core/src/file-store.ts index 6ad51f4..3f9103a 100644 --- a/packages/core/src/file-store.ts +++ b/packages/core/src/file-store.ts @@ -4,7 +4,7 @@ * Provides a clean interface for reading/writing workspace files that abstracts * over the underlying storage backend. Two implementations: * - * - LocalFileStore: manages files in ~/.waggle/workspaces/{id}/files/ (virtual storage) + * - LocalFileStore: manages files in ~/.waggle-community/workspaces/{id}/files/ (virtual storage) * - LinkedDirStore: reads/writes to workspace.directory (linked to external folder) * * All operations enforce path traversal protection — files cannot escape diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index e05d882..b746eab 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -54,7 +54,8 @@ export { } from './execution-traces.js'; // ── Waggle-specific orchestration ── -export { WaggleConfig, type ProviderEntry } from './config.js'; +export { WaggleConfig, defaultDataDir, type ProviderEntry } from './config.js'; +export { DEFAULT_DATA_DIR_NAME, DEFAULT_DATA_DIR_LABEL } from '@waggle/shared'; export { CronStore, CRON_SCHEDULES_TABLE_SQL, CRON_RUN_LEASES_TABLE_SQL, VALID_JOB_TYPES, cronExprError, type CronSchedule, type CreateScheduleInput, type CronJobType, diff --git a/packages/core/src/recall/inprocess-reranker.ts b/packages/core/src/recall/inprocess-reranker.ts index c63297d..d447f70 100644 --- a/packages/core/src/recall/inprocess-reranker.ts +++ b/packages/core/src/recall/inprocess-reranker.ts @@ -19,7 +19,7 @@ */ import path from 'node:path'; -import os from 'node:os'; +import { defaultDataDir } from '../config.js'; import { createCoreLogger } from '../logger.js'; import { withTransformersModelLoad } from '../embeddings/transformers-model-load.js'; @@ -53,7 +53,7 @@ export async function createInProcessReranker( config?: Partial, ): Promise { const model = config?.model ?? 'Xenova/ms-marco-MiniLM-L-6-v2'; - const cacheDir = config?.cacheDir ?? path.join(os.homedir(), '.waggle', 'models'); + const cacheDir = config?.cacheDir ?? path.join(defaultDataDir(), 'models'); log.info(`Loading in-process reranker: ${model} (~22MB first download)`); diff --git a/packages/core/src/telemetry.ts b/packages/core/src/telemetry.ts index 920413f..4432210 100644 --- a/packages/core/src/telemetry.ts +++ b/packages/core/src/telemetry.ts @@ -1,7 +1,7 @@ /** * TelemetryStore — local, privacy-first event tracking. * - * All data stays in ~/.waggle/telemetry.db (SQLite). + * All data stays in ~/.waggle-community/telemetry.db (SQLite). * Default: OFF. User opts in via Settings toggle. * No cloud reporting in M2 — data is queryable via local API only. * diff --git a/packages/marketplace/ARCHITECTURE.md b/packages/marketplace/ARCHITECTURE.md index 0056e9b..60bab70 100644 --- a/packages/marketplace/ARCHITECTURE.md +++ b/packages/marketplace/ARCHITECTURE.md @@ -40,7 +40,7 @@ The Waggle Marketplace is a **unified package catalog and installer** that aggre │ MarketplaceInstaller ▼ ┌──────────────────────────────────────────────────────────────────────┐ -│ ~/.waggle/ (Runtime) │ +│ ~/.waggle-community/ (Runtime) │ │ │ │ skills/ plugins/ .mcp.json │ │ ├── code-review.md ├── registry.json mcpServers: │ @@ -149,7 +149,7 @@ No installation needed. The SecurityGate calls Gen's free API endpoint at `https ```bash # The marketplace DB ships pre-populated with 120 seed packages. # Copy it to Waggle's runtime directory: -cp marketplace.db ~/.waggle/marketplace.db +cp marketplace.db ~/.waggle-community/marketplace.db # Or build from scratch: python3 build_waggle_marketplace_db.py @@ -190,7 +190,7 @@ Skills, plugins, and MCP servers run inside the agent's trust boundary. A malici ### 2.2 Security Gate — Multi-Layer Defense -The SecurityGate sits between content download and filesystem write. Nothing touches `~/.waggle/` without passing through it. +The SecurityGate sits between content download and filesystem write. Nothing touches `~/.waggle-community/` without passing through it. ``` ┌─────────────────────────────────────────────────────────┐ @@ -363,7 +363,7 @@ waggle-market audit | Property | Value | |----------|-------| | File format | Markdown (`.md`) | -| Install path | `~/.waggle/skills/{name}.md` | +| Install path | `~/.waggle-community/skills/{name}.md` | | How loaded | `loadSkills()` reads all `*.md` from skills dir | | Where used | Appended to agent system prompt | | API endpoint | `PUT /api/skills/{name}` | @@ -373,7 +373,7 @@ waggle-market audit 1. Resolve content (URL, GitHub raw, inline, or stub) 2. SECURITY GATE → scan content 3. If blocked → reject, record in DB -4. If passed → write ~/.waggle/skills/{name}.md +4. If passed → write ~/.waggle-community/skills/{name}.md 5. Notify server: PUT /api/skills/{name} 6. Record installation + scan results in DB ``` @@ -383,8 +383,8 @@ waggle-market audit | Property | Value | |----------|-------| | File format | Directory with `plugin.json` | -| Install path | `~/.waggle/plugins/{name}/` | -| Registry | `~/.waggle/plugins/registry.json` | +| Install path | `~/.waggle-community/plugins/{name}/` | +| Registry | `~/.waggle-community/plugins/registry.json` | | Manager | `@waggle/sdk` `PluginManager` class | | API endpoint | `POST /api/plugins/install` | diff --git a/packages/marketplace/src/cli.ts b/packages/marketplace/src/cli.ts index f249d7a..de1670c 100644 --- a/packages/marketplace/src/cli.ts +++ b/packages/marketplace/src/cli.ts @@ -14,6 +14,7 @@ * waggle-market info Show package details */ +import { DATA_DIR_NAME } from './data-dir.js'; import { MarketplaceDB } from './db.js'; import { MarketplaceInstaller } from './installer.js'; import { MarketplaceSync } from './sync.js'; @@ -412,7 +413,7 @@ async function main() { // Show current config const gate = new SecurityGate(); console.log('\n🔧 Security Configuration:'); - console.log(' (edit ~/.waggle/security-config.json or use waggle-market security-config )'); + console.log(` (edit ~/${DATA_DIR_NAME}/security-config.json or use waggle-market security-config )`); // Would read from security_config table } else if (positionals.length >= 2) { console.log(` Set ${positionals[0]} = ${positionals[1]}`); diff --git a/packages/marketplace/src/data-dir.ts b/packages/marketplace/src/data-dir.ts new file mode 100644 index 0000000..a5e4795 --- /dev/null +++ b/packages/marketplace/src/data-dir.ts @@ -0,0 +1,8 @@ +/** + * The default data directory under the home directory, kept apart from the + * commercial Waggle's `~/.waggle` (ADR-0011). A temporary name: the final one + * follows the product-name decision (Q8). The marketplace installs on its own, + * without the workspace packages, so this copies `DEFAULT_DATA_DIR_NAME` from + * `@waggle/shared`; `packages/shared/tests/data-dir.test.ts` checks they match. + */ +export const DATA_DIR_NAME = '.waggle-community'; diff --git a/packages/marketplace/src/db.ts b/packages/marketplace/src/db.ts index 0a8c637..2ed9b79 100644 --- a/packages/marketplace/src/db.ts +++ b/packages/marketplace/src/db.ts @@ -8,6 +8,7 @@ import Database from 'better-sqlite3'; import { join } from 'path'; import { homedir } from 'os'; +import { DATA_DIR_NAME } from './data-dir.js'; import { seedMcpServers } from './mcp-registry.js'; import type { MarketplacePackage, @@ -21,7 +22,7 @@ import type { SearchSort, } from './types.js'; -const DEFAULT_DB_PATH = join(homedir(), '.waggle', 'marketplace.db'); +const DEFAULT_DB_PATH = join(homedir(), DATA_DIR_NAME, 'marketplace.db'); export class MarketplaceDB { private db: Database.Database; diff --git a/packages/marketplace/src/installer.ts b/packages/marketplace/src/installer.ts index a28c4bc..1c5b39d 100644 --- a/packages/marketplace/src/installer.ts +++ b/packages/marketplace/src/installer.ts @@ -2,14 +2,14 @@ * Waggle Marketplace — Package Installer * * Handles installation of skills, plugins, and MCP servers from the - * marketplace database into the user's ~/.waggle/ directory. + * marketplace database into the user's data directory (~/.waggle-community/). * * Installation strategies per type: * - * SKILL: Download/copy markdown file → ~/.waggle/skills/{name}.md + * SKILL: Download/copy markdown file → ~/.waggle-community/skills/{name}.md * Then call PUT /api/skills/{name} if server is running. * - * PLUGIN: Clone/download plugin dir → ~/.waggle/plugins/{name}/ + * PLUGIN: Clone/download plugin dir → ~/.waggle-community/plugins/{name}/ * Write plugin.json manifest, copy skill files, register in registry.json. * Then call POST /api/plugins/install if server is running. * @@ -19,6 +19,7 @@ import { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, rmSync } from 'fs'; import { join, dirname, resolve } from 'path'; import { homedir } from 'os'; +import { DATA_DIR_NAME } from './data-dir.js'; import { createHash } from 'node:crypto'; import { MarketplaceDB } from './db.js'; import { SecurityGate, type ScanResult, type SecurityGateConfig } from './security.js'; @@ -44,7 +45,7 @@ import type { PluginManifest, } from './types.js'; -const WAGGLE_DIR = join(homedir(), '.waggle'); +const WAGGLE_DIR = join(homedir(), DATA_DIR_NAME); const SKILLS_DIR = join(WAGGLE_DIR, 'skills'); const PLUGINS_DIR = join(WAGGLE_DIR, 'plugins'); const REGISTRY_PATH = join(PLUGINS_DIR, 'registry.json'); @@ -82,7 +83,7 @@ function isPluginRegistryPath(candidate: string): boolean { } // UX-Refactor Phase 4 (C4): the sidecar boot loader reads /.mcp.json -// (dataDir = WAGGLE_DATA_DIR or ~/.waggle — see server local/mcp-config.ts). +// (dataDir = WAGGLE_DATA_DIR or ~/.waggle-community — see server local/mcp-config.ts). // This previously wrote to process.cwd(), a file nothing ever read. // Resolved at CALL time (not module import) so a host that sets // WAGGLE_DATA_DIR after this module loads still writes to the right place. diff --git a/packages/marketplace/src/security.ts b/packages/marketplace/src/security.ts index 4306dbf..d6565f1 100644 --- a/packages/marketplace/src/security.ts +++ b/packages/marketplace/src/security.ts @@ -21,6 +21,7 @@ import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from 'fs'; import { join, dirname } from 'path'; import { homedir } from 'os'; +import { DATA_DIR_NAME } from './data-dir.js'; import { execFileSync } from 'child_process'; import { createHash } from 'crypto'; import type { MarketplacePackage, InstallManifest, McpServerConfig } from './types.js'; @@ -180,7 +181,7 @@ const DEFAULT_CONFIG: SecurityGateConfig = { allow_force_bypass: false, gen_trust_hub_url: 'https://ai.gendigital.com/api/scan/lookup', cisco_scanner_args: ['--use-behavioral', '--format', 'json'], - cache_dir: join(homedir(), '.waggle', 'security-cache'), + cache_dir: join(homedir(), DATA_DIR_NAME, 'security-cache'), cache_ttl_hours: 24, }; @@ -1108,6 +1109,7 @@ export class SecurityGate { const crossOrigin = [ /~\/\.claude\/(?:skills|plugins|hooks|commands)/i, /~\/\.waggle\/skills/i, + new RegExp(`~/${DATA_DIR_NAME.replace(/\./g, '\\.')}/skills`, 'i'), /CLAUDE\.md/i, /\.cursorrules/i, /write.*(?:CLAUDE\.md|\.cursorrules|settings\.json|hooks\/)/i, diff --git a/packages/marketplace/tests/cli-runtime.test.ts b/packages/marketplace/tests/cli-runtime.test.ts index 2fd5cdf..0ee4993 100644 --- a/packages/marketplace/tests/cli-runtime.test.ts +++ b/packages/marketplace/tests/cli-runtime.test.ts @@ -3,6 +3,7 @@ import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import { describe, expect, it } from 'vitest'; +import { DATA_DIR_NAME } from '../src/data-dir.js'; const ROOT = path.resolve(import.meta.dirname, '..', '..', '..'); const MARKETPLACE_DIR = path.join(ROOT, 'packages', 'marketplace'); @@ -50,7 +51,7 @@ function run( } function marketplaceDbExists(home: string): boolean { - return fs.existsSync(path.join(home, '.waggle', 'marketplace.db')); + return fs.existsSync(path.join(home, DATA_DIR_NAME, 'marketplace.db')); } function readPackageJson(): { diff --git a/packages/marketplace/tests/installer-security.test.ts b/packages/marketplace/tests/installer-security.test.ts index 3562db1..23e78cc 100644 --- a/packages/marketplace/tests/installer-security.test.ts +++ b/packages/marketplace/tests/installer-security.test.ts @@ -3,6 +3,7 @@ import { homedir, tmpdir } from 'node:os'; import { join } from 'node:path'; import { createHash, randomUUID } from 'node:crypto'; import { afterAll, afterEach, describe, expect, it, vi } from 'vitest'; +import { DATA_DIR_NAME } from '../src/data-dir.js'; import { MarketplaceInstaller } from '../src/installer.js'; import { assertSafeGitUrl, @@ -188,8 +189,8 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects a caller-selected skill path inside the managed directory without overwriting it', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); - const managedPath = join(isolatedHome, '.waggle', 'skills', 'existing.md'); - mkdirSync(join(isolatedHome, '.waggle', 'skills'), { recursive: true }); + const managedPath = join(isolatedHome, DATA_DIR_NAME, 'skills', 'existing.md'); + mkdirSync(join(isolatedHome, DATA_DIR_NAME, 'skills'), { recursive: true }); writeFileSync(managedPath, '# keep', 'utf8'); const { installer, recordInstallation } = installerFor(packageFixture()); @@ -203,7 +204,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('does not clean up a pre-existing plugin directory when a forced reinstall fails', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const name = `existing-plugin-${randomUUID()}`; - const pluginDir = join(isolatedHome, '.waggle', 'plugins', name); + const pluginDir = join(isolatedHome, DATA_DIR_NAME, 'plugins', name); const sentinel = join(pluginDir, 'keep.txt'); mkdirSync(pluginDir, { recursive: true }); writeFileSync(sentinel, 'keep', 'utf8'); @@ -226,8 +227,8 @@ describe('MarketplaceInstaller security boundaries', () => { it('does not delete the plugin registry when a package name collides with it', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); - const registryPath = join(isolatedHome, '.waggle', 'plugins', 'registry.json'); - mkdirSync(join(isolatedHome, '.waggle', 'plugins'), { recursive: true }); + const registryPath = join(isolatedHome, DATA_DIR_NAME, 'plugins', 'registry.json'); + mkdirSync(join(isolatedHome, DATA_DIR_NAME, 'plugins'), { recursive: true }); writeFileSync(registryPath, '{"keep":true}', 'utf8'); const { installer, recordInstallation } = installerFor(packageFixture({ name: 'registry.json', @@ -245,8 +246,8 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects a case-insensitive alias of the reserved plugin registry path', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); - const registryPath = join(isolatedHome, '.waggle', 'plugins', 'registry.json'); - mkdirSync(join(isolatedHome, '.waggle', 'plugins'), { recursive: true }); + const registryPath = join(isolatedHome, DATA_DIR_NAME, 'plugins', 'registry.json'); + mkdirSync(join(isolatedHome, DATA_DIR_NAME, 'plugins'), { recursive: true }); writeFileSync(registryPath, '{"keep":true}', 'utf8'); const { installer, recordInstallation } = installerFor(packageFixture({ name: 'REGISTRY.JSON', @@ -266,7 +267,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects a traversal identifier before a plugin can escape the plugins directory', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const escapedName = `escaped-${randomUUID()}`; - const escapedPath = join(homedir(), '.waggle', escapedName); + const escapedPath = join(homedir(), DATA_DIR_NAME, escapedName); cleanupPaths.push(escapedPath); const { installer, recordInstallation } = installerFor(packageFixture({ name: `../${escapedName}`, @@ -285,7 +286,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects an uncurated plugin git selector before clone execution', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const name = `git-plugin-${randomUUID()}`; - cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name)); + cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name)); const { installer } = installerFor(packageFixture({ name, package_type: 'plugin', @@ -303,7 +304,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects a plugin git URL containing shell syntax before process launch', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const name = `git-injection-${randomUUID()}`; - cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name)); + cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name)); const { installer } = installerFor(packageFixture({ name, package_type: 'plugin', @@ -321,7 +322,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects an uncurated plugin npm selector before lifecycle-script execution', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const name = `npm-plugin-${randomUUID()}`; - cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name)); + cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name)); const { installer } = installerFor(packageFixture({ name, package_type: 'plugin', @@ -345,7 +346,7 @@ describe('MarketplaceInstaller security boundaries', () => { }); vi.stubGlobal('fetch', fetchMock); const name = `bundled-skill-${randomUUID()}`; - const pluginDir = join(homedir(), '.waggle', 'plugins', name); + const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name); cleanupPaths.push(pluginDir); const { installer, getPackageByName, recordInstallation } = installerFor(packageFixture({ name, @@ -378,7 +379,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('preserves installation of inline skill content', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const name = `inline-skill-${randomUUID()}`; - const skillPath = join(homedir(), '.waggle', 'skills', `${name}.md`); + const skillPath = join(homedir(), DATA_DIR_NAME, 'skills', `${name}.md`); cleanupPaths.push(skillPath); const { installer } = installerFor(packageFixture({ name, @@ -394,7 +395,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('installs the exact remote skill bytes that passed the security scan', async () => { const name = `remote-skill-${randomUUID()}`; - const skillPath = join(homedir(), '.waggle', 'skills', `${name}.md`); + const skillPath = join(homedir(), DATA_DIR_NAME, 'skills', `${name}.md`); cleanupPaths.push(skillPath); const fetchMock = vi.fn() .mockResolvedValueOnce(new Response('# Benign scanned skill')) @@ -419,7 +420,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects plugin npm package shell syntax before process launch', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const name = `npm-injection-${randomUUID()}`; - cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name)); + cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name)); const { installer } = installerFor(packageFixture({ name, package_type: 'plugin', @@ -458,7 +459,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects custom npm_args instead of treating catalog metadata as npm options', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const name = `npm-args-${randomUUID()}`; - cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name)); + cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name)); const { installer } = installerFor(packageFixture({ name, package_type: 'plugin', @@ -479,7 +480,7 @@ describe('MarketplaceInstaller security boundaries', () => { ])('rejects a non-empty $type post-install array before any side effect', async hook => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const name = `post-install-${randomUUID()}`; - const pluginDir = join(homedir(), '.waggle', 'plugins', name); + const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name); cleanupPaths.push(pluginDir); const { installer, recordInstallation } = installerFor(packageFixture({ name, @@ -503,7 +504,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('preserves a plugin manifest containing an exact curated MCP profile', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const name = `curated-mcp-plugin-${randomUUID()}`; - const pluginDir = join(homedir(), '.waggle', 'plugins', name); + const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name); cleanupPaths.push(pluginDir); const curatedMcp = MCP_SERVERS.find(server => server.name === 'memory')! .install_manifest!.mcp_config!; @@ -532,7 +533,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('maps an embedded plugin MCP setting only to its matching blank environment key', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const name = `brave-plugin-${randomUUID()}`; - const pluginDir = join(homedir(), '.waggle', 'plugins', name); + const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name); cleanupPaths.push(pluginDir); const braveConfig = MCP_SERVERS.find(server => server.name === 'brave-search')! .install_manifest!.mcp_config!; @@ -570,7 +571,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects undeclared plugin executable capabilities before writing plugin files', async () => { const name = `plugin-tools-${randomUUID()}`; - const pluginDir = join(homedir(), '.waggle', 'plugins', name); + const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name); cleanupPaths.push(pluginDir); const pluginManifest = { name, @@ -723,7 +724,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects an arbitrary launcher embedded in a marketplace plugin manifest', async () => { const name = `plugin-mcp-${randomUUID()}`; - cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name)); + cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name)); const { installer, recordInstallation } = installerFor(packageFixture({ name, package_type: 'plugin', @@ -829,13 +830,13 @@ describe('MarketplaceInstaller security boundaries', () => { it('rejects an approved MCP manifest cloned under a noncanonical source', async () => { const brave = MCP_SERVERS.find(server => server.name === 'brave-search')!; - const configPath = join(isolatedHome, '.waggle', '.mcp.json'); + const configPath = join(isolatedHome, DATA_DIR_NAME, '.mcp.json'); const originalConfig = JSON.stringify({ mcpServers: { existing: { command: 'existing-command', args: ['existing-arg'] }, }, }); - mkdirSync(join(isolatedHome, '.waggle'), { recursive: true }); + mkdirSync(join(isolatedHome, DATA_DIR_NAME), { recursive: true }); writeFileSync(configPath, originalConfig, 'utf8'); const customSource = sourceFixture({ id: 77, @@ -983,7 +984,7 @@ describe('MarketplaceInstaller security boundaries', () => { const scan = await installer.scanOnly(pkg.id); expect(scan).not.toBeNull(); const expectedApprovalIdentity = MarketplaceInstaller.createApprovalIdentity(pkg, scan!); - cleanupPaths.push(join(isolatedHome, '.waggle', 'skills', `${name}.md`)); + cleanupPaths.push(join(isolatedHome, DATA_DIR_NAME, 'skills', `${name}.md`)); const result = await installer.install({ packageId: pkg.id, expectedApprovalIdentity }); @@ -1102,7 +1103,7 @@ describe('MarketplaceInstaller security boundaries', () => { it('does not delete outside the plugins directory when uninstalling a traversal identifier', async () => { vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline'))); const escapedName = `uninstall-sentinel-${randomUUID()}`; - const escapedPath = join(homedir(), '.waggle', escapedName); + const escapedPath = join(homedir(), DATA_DIR_NAME, escapedName); const sentinel = join(escapedPath, 'keep.txt'); cleanupPaths.push(escapedPath); mkdirSync(escapedPath, { recursive: true }); diff --git a/packages/marketplace/tests/sync-verification.test.ts b/packages/marketplace/tests/sync-verification.test.ts index 7484249..7dd3216 100644 --- a/packages/marketplace/tests/sync-verification.test.ts +++ b/packages/marketplace/tests/sync-verification.test.ts @@ -5,7 +5,7 @@ * sources are populated, URLs are well-formed, and sync results have * the correct shape. * - * Uses a temporary SQLite database (not the real ~/.waggle/marketplace.db) + * Uses a temporary SQLite database (not the real ~/.waggle-community/marketplace.db) * and mocks global fetch to avoid real network calls. */ diff --git a/packages/memory-mem0/bench/search-quality.ts b/packages/memory-mem0/bench/search-quality.ts index 1175e5f..532cac5 100644 --- a/packages/memory-mem0/bench/search-quality.ts +++ b/packages/memory-mem0/bench/search-quality.ts @@ -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 { 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); diff --git a/packages/sdk/src/plugin-runtime.ts b/packages/sdk/src/plugin-runtime.ts index 0f0421f..c877481 100644 --- a/packages/sdk/src/plugin-runtime.ts +++ b/packages/sdk/src/plugin-runtime.ts @@ -57,7 +57,7 @@ export interface ActivationDependencies { requiredCapabilities?: string[]; /** Capabilities available in the current environment */ availableCapabilities?: string[]; - /** Path to the plugin directory (e.g., ~/.waggle/plugins//) for resolving tool implementations */ + /** Path to the plugin directory (e.g., ~/.waggle-community/plugins//) for resolving tool implementations */ pluginDir?: string; } diff --git a/packages/sdk/src/starter-skills/index.ts b/packages/sdk/src/starter-skills/index.ts index 6263961..2dd1350 100644 --- a/packages/sdk/src/starter-skills/index.ts +++ b/packages/sdk/src/starter-skills/index.ts @@ -36,7 +36,7 @@ export function listStarterSkills(): string[] { } /** - * Install starter skills into a target directory (e.g., ~/.waggle/skills/). + * Install starter skills into a target directory (e.g., ~/.waggle-community/skills/). * Only installs skills that don't already exist (no overwrite). * Returns list of installed skill names. */ diff --git a/packages/server/src/local/index.ts b/packages/server/src/local/index.ts index dd3243e..6a2bf09 100644 --- a/packages/server/src/local/index.ts +++ b/packages/server/src/local/index.ts @@ -10,7 +10,7 @@ import Fastify, { type FastifyInstance, type FastifyRequest } from 'fastify'; import cors from '@fastify/cors'; import fastifyStatic from '@fastify/static'; import websocket from '@fastify/websocket'; -import { WaggleDB, workspaceDataScope, WorkspaceManager, WaggleConfig, createEmbeddingProvider, type EmbeddingProviderConfig, type EmbeddingProviderInstance, CronStore, AwarenessLayer, VaultStore, SkillHashStore, TelemetryStore, TELEMETRY_EVENTS, ExecutionTraceStore } from '@waggle/core'; +import { WaggleDB, workspaceDataScope, WorkspaceManager, WaggleConfig, createEmbeddingProvider, type EmbeddingProviderConfig, type EmbeddingProviderInstance, CronStore, AwarenessLayer, VaultStore, SkillHashStore, TelemetryStore, TELEMETRY_EVENTS, ExecutionTraceStore, defaultDataDir } from '@waggle/core'; import { corsOriginAllowed } from './cors-config.js'; import { InstallAuditStore } from './install-audit.js'; import { selfBaseUrl, selfRequestHeaders } from './self-request.js'; @@ -185,7 +185,7 @@ import { copyProviderKeysToVault, hydrateProviderEnvFromVault } from './provider export interface LocalConfig { port: number; host: string; - dataDir: string; // ~/.waggle + dataDir: string; // ~/.waggle-community litellmUrl: string; // http://localhost:4000 /** Immutable desktop-launch identity used to prove sidecar ownership. */ instanceId?: string; @@ -470,7 +470,7 @@ export async function buildLocalServer(config: Partial = {}) { // Decorate with local config server.decorate('localConfig', fullConfig); - // Set data dir for custom personas (loaded from ~/.waggle/personas/) + // Set data dir for custom personas (loaded from ~/.waggle-community/personas/) setPersonaDataDir(fullConfig.dataDir); // Event bus (replaces Redis pub/sub) @@ -667,7 +667,7 @@ export async function buildLocalServer(config: Partial = {}) { // Decorate server with embedding provider for status endpoints server.decorate('embeddingProvider', embeddingProvider); - const waggleHome = fullConfig.dataDir || path.join(os.homedir(), '.waggle'); + const waggleHome = fullConfig.dataDir || defaultDataDir(); const rerankerCacheDir = path.join(waggleHome, 'models', 'reranker'); // Memory (ADR-0007): one mem0 store in /memory/, embedded by the @@ -893,7 +893,7 @@ export async function buildLocalServer(config: Partial = {}) { const allTools = [...baseTools, ...subAgentTools, ...workflowTools]; - // Load user customizations from ~/.waggle/ + // Load user customizations from ~/.waggle-community/ const userSystemPrompt = loadSystemPrompt(waggleHome); const skills = loadSkills(waggleHome); @@ -954,7 +954,7 @@ export async function buildLocalServer(config: Partial = {}) { // Plugin runtime manager — lifecycle, tools, skills from plugins const pluginRuntimeManager = new PluginRuntimeManager(); - // Auto-load installed plugins from ~/.waggle/plugins/ + // Auto-load installed plugins from ~/.waggle-community/plugins/ const pluginsDir = path.join(waggleHome, 'plugins'); if (fs.existsSync(pluginsDir)) { try { diff --git a/packages/server/src/local/mcp-config.ts b/packages/server/src/local/mcp-config.ts index b21aa83..ed6013e 100644 --- a/packages/server/src/local/mcp-config.ts +++ b/packages/server/src/local/mcp-config.ts @@ -27,7 +27,7 @@ import fs from 'node:fs'; import * as path from 'node:path'; -import * as os from 'node:os'; +import { defaultDataDir } from '@waggle/core'; import { randomUUID, createHash } from 'node:crypto'; import type { McpRuntime, McpServerConfig } from '@waggle/agent'; import { @@ -51,9 +51,9 @@ export interface McpConfigFile { mcpServers: Record; } -/** Same fallback as local/index.ts `waggleHome`: empty dataDir → ~/.waggle. */ +/** Same fallback as local/index.ts `waggleHome`: empty dataDir → ~/.waggle-community. */ export function mcpConfigPath(dataDir: string): string { - const home = dataDir || path.join(os.homedir(), '.waggle'); + const home = dataDir || defaultDataDir(); return path.join(home, '.mcp.json'); } diff --git a/packages/server/src/local/offline-manager.ts b/packages/server/src/local/offline-manager.ts index d53cc1f..f6272ba 100644 --- a/packages/server/src/local/offline-manager.ts +++ b/packages/server/src/local/offline-manager.ts @@ -24,7 +24,7 @@ export interface QueuedMessage { } export interface OfflineManagerConfig { - /** Directory for persistent storage (e.g. ~/.waggle) */ + /** Directory for persistent storage (e.g. ~/.waggle-community) */ dataDir: string; /** How often to check LLM health, in ms (default: 30000) */ checkIntervalMs?: number; diff --git a/packages/server/src/local/routes/anthropic-proxy.ts b/packages/server/src/local/routes/anthropic-proxy.ts index b9e2ca4..ac74187 100644 --- a/packages/server/src/local/routes/anthropic-proxy.ts +++ b/packages/server/src/local/routes/anthropic-proxy.ts @@ -1407,7 +1407,7 @@ function getAnthropicKey(server: FastifyInstance): string | null { // Legacy fallback: env var (for test harnesses / dev loops) if (process.env.ANTHROPIC_API_KEY) return process.env.ANTHROPIC_API_KEY; - // Legacy fallback: ~/.waggle/config.json + // Legacy fallback: ~/.waggle-community/config.json try { const configPath = path.join(server.localConfig.dataDir, 'config.json'); const raw = fs.readFileSync(configPath, 'utf-8'); diff --git a/packages/server/src/local/routes/backup.ts b/packages/server/src/local/routes/backup.ts index d439dca..91eda18 100644 --- a/packages/server/src/local/routes/backup.ts +++ b/packages/server/src/local/routes/backup.ts @@ -1,5 +1,5 @@ /** - * Backup & Restore Routes — encrypted ZIP-style archive of ~/.waggle/ for machine migration. + * Backup & Restore Routes — encrypted ZIP-style archive of ~/.waggle-community/ for machine migration. * * Endpoints: * POST /api/backup — create and stream an encrypted backup archive diff --git a/packages/server/src/local/routes/chat.ts b/packages/server/src/local/routes/chat.ts index 3c90bd0..5291d7d 100644 --- a/packages/server/src/local/routes/chat.ts +++ b/packages/server/src/local/routes/chat.ts @@ -28,7 +28,7 @@ const NON_RETAINED_TURN_CONTENT = '[Not retained: memory disabled for this turn] /** * Persona resolver that includes built-ins AND on-disk custom personas * (Faza 1 evolved variants like `claude::gen1-v1`, `qwen-thinking::gen1-v1`, - * plus user-saved customs in `~/.waggle/personas/`). + * plus user-saved customs in `~/.waggle-community/personas/`). * * Previously `getPersona(id)` was used here, which only consulted the static * built-in PERSONAS array — `listPersonas()` adds the custom ones from disk diff --git a/packages/server/src/local/routes/command.ts b/packages/server/src/local/routes/command.ts index a7cc26f..188eb95 100644 --- a/packages/server/src/local/routes/command.ts +++ b/packages/server/src/local/routes/command.ts @@ -24,7 +24,7 @@ * later phases. The CommandResultType union carries them so the contract is stable. */ -import os from 'node:os'; +import { defaultDataDir } from '@waggle/core'; import path from 'node:path'; import fs from 'node:fs'; import type { FastifyPluginAsync } from 'fastify'; @@ -79,7 +79,7 @@ function toSubtitle(content: string, max = 120): string { } export const commandRoutes: FastifyPluginAsync = async (server) => { - const waggleHome = server.localConfig.dataDir || path.join(os.homedir(), '.waggle'); + const waggleHome = server.localConfig.dataDir || defaultDataDir(); // ── GET /api/command/search ─────────────────────────────────────────── // Federated read over memory + workspaces + skills + sessions + commands. diff --git a/packages/server/src/local/routes/documents.ts b/packages/server/src/local/routes/documents.ts index 221fb57..bdeabf3 100644 --- a/packages/server/src/local/routes/documents.ts +++ b/packages/server/src/local/routes/documents.ts @@ -13,7 +13,7 @@ import type { FastifyPluginAsync } from 'fastify'; import fs from 'node:fs'; import path from 'node:path'; -import os from 'node:os'; +import { defaultDataDir } from '@waggle/core'; import { assertSafeSegment } from './validate.js'; export interface DocumentVersion { @@ -62,7 +62,7 @@ function writeRegistry(dataDir: string, workspaceId: string, registry: Documents } export const documentRoutes: FastifyPluginAsync = async (server) => { - const dataDir = server.localConfig?.dataDir || process.env.WAGGLE_DATA_DIR || path.join(os.homedir(), '.waggle'); + const dataDir = server.localConfig?.dataDir || process.env.WAGGLE_DATA_DIR || defaultDataDir(); // GET /api/workspaces/:id/documents — list all tracked documents server.get<{ diff --git a/packages/server/src/local/routes/local-inference.ts b/packages/server/src/local/routes/local-inference.ts index 071d4c7..9383924 100644 --- a/packages/server/src/local/routes/local-inference.ts +++ b/packages/server/src/local/routes/local-inference.ts @@ -13,7 +13,7 @@ */ import type { FastifyInstance } from 'fastify'; -import os from 'node:os'; +import { defaultDataDir } from '@waggle/core'; import path from 'node:path'; import { rankModels, OLLAMA_CATALOG } from '@waggle/agent'; import { detectHardware } from '../hardware-detect.js'; @@ -196,7 +196,7 @@ export async function localInferenceRoutes( const VLLM_URL = process.env.VLLM_HOST ?? 'http://localhost:8000'; const dataDir = fastify.localConfig?.dataDir || process.env.WAGGLE_DATA_DIR - || path.join(os.homedir(), '.waggle'); + || defaultDataDir(); const runtime = options.runtimeFactory?.(dataDir, OLLAMA_URL) ?? new ManagedOllamaRuntime(dataDir, OLLAMA_URL); const probeOllama = options.ollamaProbe ?? checkOllama; diff --git a/packages/server/src/local/routes/marketplace-dev.ts b/packages/server/src/local/routes/marketplace-dev.ts index 1cd8dcf..bcc2e09 100644 --- a/packages/server/src/local/routes/marketplace-dev.ts +++ b/packages/server/src/local/routes/marketplace-dev.ts @@ -18,6 +18,7 @@ import { createLogger } from '../logger.js'; const log = createLogger('marketplace-dev'); import fs from 'node:fs'; import { MarketplaceDB, SecurityGate } from '@waggle/marketplace'; +import { DEFAULT_DATA_DIR_NAME } from '@waggle/shared'; import type { InstallationType, MarketplacePack, MarketplacePackage } from '@waggle/marketplace'; export async function marketplaceDevRoutes(fastify: FastifyInstance) { @@ -26,7 +27,7 @@ export async function marketplaceDevRoutes(fastify: FastifyInstance) { const dataDir = fastify.localConfig?.dataDir ?? path.join( process.env.HOME ?? process.env.USERPROFILE ?? '.', - '.waggle', + DEFAULT_DATA_DIR_NAME, ); // Lazy-instantiate marketplace handles on first use. diff --git a/packages/server/src/local/routes/marketplace.ts b/packages/server/src/local/routes/marketplace.ts index 8b6db13..d900dae 100644 --- a/packages/server/src/local/routes/marketplace.ts +++ b/packages/server/src/local/routes/marketplace.ts @@ -11,7 +11,7 @@ import type { FastifyInstance, FastifyReply } from 'fastify'; import { existsSync, readFileSync } from 'fs'; import { join } from 'path'; -import { homedir } from 'os'; +import { defaultDataDir } from '@waggle/core'; import { MarketplaceDB, MarketplaceInstaller, MarketplaceSync, SecurityGate, PACKAGE_CATEGORIES, recategorizeAll, isCiscoScannerAvailable, resolveSkillSource, SkillSourceError, createMarketplaceMcpProvenance } from '@waggle/marketplace'; import type { InstallationType, SearchSort, ScanResult, MarketplacePackage, MarketplaceMcpProvenance, MarketplaceApprovalIdentity, FetchFn } from '@waggle/marketplace'; import { validateSkillMd } from '@waggle/sdk'; @@ -971,7 +971,7 @@ export async function marketplaceRoutes(fastify: FastifyInstance) { // ── POST /api/marketplace/publish ───────────────────────────────── // Publish a local skill to the marketplace catalog. - // Reads the skill from ~/.waggle/skills/, validates frontmatter, + // Reads the skill from ~/.waggle-community/skills/, validates frontmatter, // runs SecurityGate scan, then upserts into the marketplace DB. fastify.post('/api/marketplace/publish', async (request, reply) => { @@ -991,8 +991,8 @@ export async function marketplaceRoutes(fastify: FastifyInstance) { return reply.code(400).send({ error: 'Invalid skill name' }); } - // Read the skill file from ~/.waggle/skills/ - const waggleHome = fastify.localConfig?.dataDir || join(homedir(), '.waggle'); + // Read the skill file from ~/.waggle-community/skills/ + const waggleHome = fastify.localConfig?.dataDir || defaultDataDir(); const skillPath = join(waggleHome, 'skills', `${skillName}.md`); if (!existsSync(skillPath)) { diff --git a/packages/server/src/local/routes/mcps.ts b/packages/server/src/local/routes/mcps.ts index 73cd462..04124bb 100644 --- a/packages/server/src/local/routes/mcps.ts +++ b/packages/server/src/local/routes/mcps.ts @@ -373,7 +373,7 @@ export async function mcpRoutes(fastify: FastifyInstance) { }); } // Persist at the server's dataDir too — the installer writes to - // WAGGLE_DATA_DIR/~/.waggle, which may differ from a custom dataDir. + // WAGGLE_DATA_DIR/~/.waggle-community, which may differ from a custom dataDir. saveMcpServerEntry(dataDir(), configured.name, entry); const runtime = getRuntime(); diff --git a/packages/server/src/local/routes/onboarding.ts b/packages/server/src/local/routes/onboarding.ts index f5f83ad..f2aa84f 100644 --- a/packages/server/src/local/routes/onboarding.ts +++ b/packages/server/src/local/routes/onboarding.ts @@ -71,7 +71,7 @@ export const onboardingRoutes: FastifyPluginAsync = async (server) => { }); // Idempotent completion stamp. The wizard's complete() fires this alongside - // the Tauri filesystem flag (which only covers default ~/.waggle installs). + // the Tauri filesystem flag (which only covers default ~/.waggle-community installs). server.post('/api/onboarding/complete', async () => { fs.mkdirSync(server.localConfig.dataDir, { recursive: true }); fs.writeFileSync(flagPath(), new Date().toISOString()); diff --git a/packages/server/src/local/routes/pins.ts b/packages/server/src/local/routes/pins.ts index 896434b..72b9a2a 100644 --- a/packages/server/src/local/routes/pins.ts +++ b/packages/server/src/local/routes/pins.ts @@ -13,7 +13,7 @@ import type { FastifyPluginAsync } from 'fastify'; import fs from 'node:fs'; import path from 'node:path'; -import os from 'node:os'; +import { defaultDataDir } from '@waggle/core'; import crypto from 'node:crypto'; export interface PinnedItem { @@ -57,7 +57,7 @@ function writePins(dataDir: string, workspaceId: string, pins: PinnedItem[]): vo } export const pinRoutes: FastifyPluginAsync = async (server) => { - const dataDir = server.localConfig?.dataDir || process.env.WAGGLE_DATA_DIR || path.join(os.homedir(), '.waggle'); + const dataDir = server.localConfig?.dataDir || process.env.WAGGLE_DATA_DIR || defaultDataDir(); // GET /api/workspaces/:id/pins — list pins for workspace server.get<{ diff --git a/packages/server/src/local/routes/profile.ts b/packages/server/src/local/routes/profile.ts index 99c1f42..a92e65d 100644 --- a/packages/server/src/local/routes/profile.ts +++ b/packages/server/src/local/routes/profile.ts @@ -1,7 +1,7 @@ /** * User Profile API — identity, writing style, brand, and preferences. * - * Profile data is stored in a JSON file at ~/.waggle/profile.json and + * Profile data is stored in a JSON file at ~/.waggle-community/profile.json and * key fields are also saved to personal memory for agent access. * * Endpoints: diff --git a/packages/server/src/local/routes/skills-audit.ts b/packages/server/src/local/routes/skills-audit.ts index a15d24d..3c032ed 100644 --- a/packages/server/src/local/routes/skills-audit.ts +++ b/packages/server/src/local/routes/skills-audit.ts @@ -1,8 +1,7 @@ -import os from 'node:os'; import path from 'node:path'; import fs from 'node:fs'; import type { FastifyPluginAsync } from 'fastify'; -import { computeSkillHash } from '@waggle/core'; +import { computeSkillHash, defaultDataDir } from '@waggle/core'; import { loadActiveSkills, loadSkillAudit, @@ -44,7 +43,7 @@ async function buildAuditLLM(apiKey: string): Promise { * first, then redacted/provenance-stamped/audited + the change-hash refreshed). */ export const skillsAuditRoutes: FastifyPluginAsync = async (server) => { - const waggleHome = server.localConfig.dataDir || path.join(os.homedir(), '.waggle'); + const waggleHome = server.localConfig.dataDir || defaultDataDir(); const skillsDir = path.join(waggleHome, 'skills'); // GET /api/skills/audit — badge index (Skills Hub card source for the verified badge). diff --git a/packages/server/src/local/routes/skills-hygiene.ts b/packages/server/src/local/routes/skills-hygiene.ts index d7ac441..7f9a356 100644 --- a/packages/server/src/local/routes/skills-hygiene.ts +++ b/packages/server/src/local/routes/skills-hygiene.ts @@ -1,4 +1,4 @@ -import os from 'node:os'; +import { defaultDataDir } from '@waggle/core'; import path from 'node:path'; import type { FastifyPluginAsync } from 'fastify'; import { @@ -17,7 +17,7 @@ import { * Waggle proxy cost — mirroring the evolution route's key gate. */ export const skillsHygieneRoutes: FastifyPluginAsync = async (server) => { - const waggleHome = server.localConfig.dataDir || path.join(os.homedir(), '.waggle'); + const waggleHome = server.localConfig.dataDir || defaultDataDir(); // GET /api/skills/hygiene — current hygiene index (Skills Hub badges) server.get('/api/skills/hygiene', async () => { diff --git a/packages/server/src/local/routes/skills.ts b/packages/server/src/local/routes/skills.ts index 4d3e9c5..22ec159 100644 --- a/packages/server/src/local/routes/skills.ts +++ b/packages/server/src/local/routes/skills.ts @@ -1,4 +1,3 @@ -import os from 'node:os'; import path from 'node:path'; import fs from 'node:fs'; import { createLogger } from '../logger.js'; @@ -7,7 +6,7 @@ import type { FastifyPluginAsync } from 'fastify'; const log = createLogger('skills'); import { PluginManager, getStarterSkillsDir, listStarterSkills, listCapabilityPacks, getPackManifest } from '@waggle/sdk'; import { loadSkills, loadSkillHygiene, loadSkillAudit, clearAuditBadge, SkillRecommender, assessTrust, generateSkillMarkdown, writeSkill, deleteSkill as deleteSkillWrite, parseSkillFrontmatter, extractSkillRequirements, checkSkillRequirements, type SkillTemplate, type SkillRequirements, type SkillRequirementsStatus } from '@waggle/agent'; -import { computeSkillHash } from '@waggle/core'; +import { computeSkillHash, defaultDataDir } from '@waggle/core'; /** Capability family definitions — user-job-first grouping */ const SKILL_FAMILIES: Record = { @@ -36,11 +35,11 @@ const WORKFLOW_SKILLS = new Set(['research-team', 'review-pair', 'plan-execute'] /** * Skills & plugins routes — manage agent extensions. - * Skills: markdown files in ~/.waggle/skills/ that extend the system prompt. - * Plugins: structured packages in ~/.waggle/plugins/ with manifests. + * Skills: markdown files in ~/.waggle-community/skills/ that extend the system prompt. + * Plugins: structured packages in ~/.waggle-community/plugins/ with manifests. */ export const skillRoutes: FastifyPluginAsync = async (server) => { - const waggleHome = server.localConfig.dataDir || path.join(os.homedir(), '.waggle'); + const waggleHome = server.localConfig.dataDir || defaultDataDir(); const skillsDir = path.join(waggleHome, 'skills'); const pluginsDir = path.join(waggleHome, 'plugins'); @@ -83,7 +82,7 @@ export const skillRoutes: FastifyPluginAsync = async (server) => { const starterDir = getStarterSkillsDir(); const starterNames = listStarterSkills(); // returns sorted array of names without .md - // Determine installed skill names (files in ~/.waggle/skills/) + // Determine installed skill names (files in ~/.waggle-community/skills/) const installedNames = new Set(); if (fs.existsSync(skillsDir)) { for (const f of fs.readdirSync(skillsDir)) { diff --git a/packages/server/src/local/routes/tasks.ts b/packages/server/src/local/routes/tasks.ts index 06e927f..b4eb25b 100644 --- a/packages/server/src/local/routes/tasks.ts +++ b/packages/server/src/local/routes/tasks.ts @@ -1,7 +1,7 @@ /** * Task routes — workspace-scoped task board. * - * JSONL-based storage in `~/.waggle/workspaces/{id}/tasks.jsonl`. + * JSONL-based storage in `~/.waggle-community/workspaces/{id}/tasks.jsonl`. * Each task: id, title, status (open|in_progress|done), assignee, creator, timestamps. */ diff --git a/packages/server/src/local/routes/workflows.ts b/packages/server/src/local/routes/workflows.ts index e4cc1ef..250c63c 100644 --- a/packages/server/src/local/routes/workflows.ts +++ b/packages/server/src/local/routes/workflows.ts @@ -4,7 +4,7 @@ import type { WorkflowTemplate } from '@waggle/agent'; /** * Workflow routes — CRUD for custom workflow templates. - * Built-in templates are read-only; custom ones are stored as JSON in ~/.waggle/workflows/. + * Built-in templates are read-only; custom ones are stored as JSON in ~/.waggle-community/workflows/. */ export const workflowRoutes: FastifyPluginAsync = async (fastify) => { const dataDir = fastify.localConfig.dataDir; diff --git a/packages/server/src/local/routes/workspaces.ts b/packages/server/src/local/routes/workspaces.ts index 3d07ee7..f9045b0 100644 --- a/packages/server/src/local/routes/workspaces.ts +++ b/packages/server/src/local/routes/workspaces.ts @@ -1,9 +1,8 @@ import fs from 'node:fs'; -import os from 'node:os'; import path from 'node:path'; import type { FastifyPluginAsync } from 'fastify'; import { z } from 'zod'; -import { AwarenessLayer, createFileStore, workspaceDataScope } from '@waggle/core'; +import { AwarenessLayer, createFileStore, workspaceDataScope, defaultDataDir } from '@waggle/core'; import { workspaceScope, type MemoryRecord, type MemoryStore } from '@waggle/memory-contract'; import { assertSafeSegment } from './validate.js'; import { validateBody } from '../../validate-body.js'; @@ -438,7 +437,7 @@ export const workspaceRoutes: FastifyPluginAsync = async (server) => { // Auto-install starter skills on first workspace creation try { - const waggleHome = server.localConfig.dataDir || path.join(os.homedir(), '.waggle'); + const waggleHome = server.localConfig.dataDir || defaultDataDir(); const skillsDir = path.join(waggleHome, 'skills'); const existingSkills = fs.existsSync(skillsDir) ? fs.readdirSync(skillsDir).filter(f => f.endsWith('.md')) diff --git a/packages/server/src/local/service.ts b/packages/server/src/local/service.ts index 564a5a7..642b339 100644 --- a/packages/server/src/local/service.ts +++ b/packages/server/src/local/service.ts @@ -2,9 +2,8 @@ import fs from 'node:fs'; import { randomUUID } from 'node:crypto'; import net from 'node:net'; import path from 'node:path'; -import os from 'node:os'; import type { FastifyInstance } from 'fastify'; -import { VaultStore, WaggleConfig, WAGGLE_DB_FILE } from '@waggle/core'; +import { VaultStore, WaggleConfig, WAGGLE_DB_FILE, defaultDataDir } from '@waggle/core'; import { buildLocalServer } from './index.js'; import type { LlmHealthStatus } from './index.js'; import { startLiteLLM, stopLiteLLM, type LiteLLMStatus } from './lifecycle.js'; @@ -93,7 +92,7 @@ function removeOwnedDesktopReadyFile(filePath: string, instanceId: string): void /** * Resolve the service data directory: explicit option > WAGGLE_DATA_DIR env > - * ~/.waggle. D11 — the installer/launcher set WAGGLE_DATA_DIR; before this, + * ~/.waggle-community. D11 — the installer/launcher set WAGGLE_DATA_DIR; before this, * startService ignored it while other modules (local/index.ts config, * marketplace installer) honored it, splitting state across two * directories on custom installs. @@ -101,7 +100,7 @@ function removeOwnedDesktopReadyFile(filePath: string, instanceId: string): void export function resolveDataDir(optionDataDir?: string): string { // `||` on the env leg: WAGGLE_DATA_DIR set-but-empty must fall through to // the default, not yield '' (mkdirSync('') throws / resolves to cwd). - return optionDataDir ?? (process.env.WAGGLE_DATA_DIR || path.join(os.homedir(), '.waggle')); + return optionDataDir ?? (process.env.WAGGLE_DATA_DIR || defaultDataDir()); } /** Resolve the listen port: explicit option > validated WAGGLE_PORT > 3333. */ @@ -171,7 +170,7 @@ function getConfiguredProviderIds(dataDir: string, server?: FastifyInstance): st /** * Start the Waggle agent service. * - * 1. Resolves/creates dataDir (option > WAGGLE_DATA_DIR > ~/.waggle) + * 1. Resolves/creates dataDir (option > WAGGLE_DATA_DIR > ~/.waggle-community) * 2. Starts the LiteLLM proxy when config.json enables it and it is not skipped * 3. Builds & starts local Fastify server * 4. Registers graceful shutdown handlers diff --git a/packages/server/src/local/storage/fs-provider.ts b/packages/server/src/local/storage/fs-provider.ts index 6d08e4d..b109295 100644 --- a/packages/server/src/local/storage/fs-provider.ts +++ b/packages/server/src/local/storage/fs-provider.ts @@ -7,7 +7,7 @@ import { STANDARD_DIRS } from './types.js'; /** * Filesystem-backed StorageProvider. - * Used by both "virtual" storage (data in ~/.waggle/workspaces/{id}/files/) + * Used by both "virtual" storage (data in ~/.waggle-community/workspaces/{id}/files/) * and "local" storage (data at a user-specified path). */ export class FsStorageProvider implements StorageProvider { diff --git a/packages/server/src/local/storage/index.ts b/packages/server/src/local/storage/index.ts index a5abbaa..cb2e0fa 100644 --- a/packages/server/src/local/storage/index.ts +++ b/packages/server/src/local/storage/index.ts @@ -17,7 +17,7 @@ interface WorkspaceLike { /** * Resolve the correct StorageProvider for a workspace. * - * - virtual: files in ~/.waggle/workspaces/{id}/files/ (app-managed) + * - virtual: files in ~/.waggle-community/workspaces/{id}/files/ (app-managed) * - local: user-specified directory on their machine (like Claude Code) * - team: shared team storage is part of team mode, which the community * edition does not ship (ADR-0003); such workspaces use virtual storage diff --git a/packages/server/tests/backup-restore.test.ts b/packages/server/tests/backup-restore.test.ts index 20638a3..6a6b915 100644 --- a/packages/server/tests/backup-restore.test.ts +++ b/packages/server/tests/backup-restore.test.ts @@ -1,5 +1,5 @@ /** - * Backup & Restore Tests — PM-5: encrypted backup/restore of ~/.waggle/ + * Backup & Restore Tests — PM-5: encrypted backup/restore of ~/.waggle-community/ * * Tests: * 1. POST /api/backup returns an octet-stream file diff --git a/packages/server/tests/d11-datadir.test.ts b/packages/server/tests/d11-datadir.test.ts index 93fd28d..1a91f68 100644 --- a/packages/server/tests/d11-datadir.test.ts +++ b/packages/server/tests/d11-datadir.test.ts @@ -1,7 +1,7 @@ /** * D11 (UX-Refactor P4) — dataDir resolution. * - * - resolveDataDir: explicit option > WAGGLE_DATA_DIR env > ~/.waggle. Before + * - resolveDataDir: explicit option > WAGGLE_DATA_DIR env > ~/.waggle-community. Before * D11, startService ignored the env var while local/index.ts and the * marketplace installer honored it — a custom install split * its state across two directories. @@ -10,6 +10,7 @@ import { describe, it, expect, afterEach, vi } from 'vitest'; import fs from 'node:fs'; import path from 'node:path'; import os from 'node:os'; +import { DEFAULT_DATA_DIR_NAME } from '@waggle/shared'; import { startService, resolveDataDir } from '../src/local/service.js'; import type { FastifyInstance } from 'fastify'; @@ -36,14 +37,15 @@ describe('resolveDataDir (D11)', () => { expect(resolveDataDir()).toBe('D:/from-env'); }); - it('defaults to ~/.waggle with neither', () => { + it('defaults to ~/.waggle-community with neither, never the commercial ~/.waggle (ADR-0011)', () => { delete process.env[ENV_KEY]; - expect(resolveDataDir()).toBe(path.join(os.homedir(), '.waggle')); + expect(resolveDataDir()).toBe(path.join(os.homedir(), DEFAULT_DATA_DIR_NAME)); + expect(resolveDataDir()).not.toBe(path.join(os.homedir(), '.waggle')); }); it('a set-but-EMPTY env var falls through to the default (never an empty dataDir)', () => { process.env[ENV_KEY] = ''; - expect(resolveDataDir()).toBe(path.join(os.homedir(), '.waggle')); + expect(resolveDataDir()).toBe(path.join(os.homedir(), DEFAULT_DATA_DIR_NAME)); }); }); @@ -72,7 +74,7 @@ describe('startService honors WAGGLE_DATA_DIR (D11 integration)', () => { const result = await startService({ port, skipLiteLLM: true }); server = result.server; - // The env-pointed dir got the install, ~/.waggle got nothing new from us. + // The env-pointed dir got the install, ~/.waggle-community got nothing new from us. expect(fs.existsSync(path.join(envDir, 'waggle.db'))).toBe(true); expect(server.localConfig.dataDir).toBe(envDir); diff --git a/packages/server/tests/local/mcp-config.test.ts b/packages/server/tests/local/mcp-config.test.ts index 9c87f42..044667e 100644 --- a/packages/server/tests/local/mcp-config.test.ts +++ b/packages/server/tests/local/mcp-config.test.ts @@ -11,6 +11,7 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import fs from 'node:fs'; import * as path from 'node:path'; import * as os from 'node:os'; +import { DEFAULT_DATA_DIR_NAME } from '@waggle/shared'; import { McpRuntime } from '@waggle/agent'; import { MCP_SERVERS, createMarketplaceMcpProvenance } from '@waggle/marketplace'; import { @@ -283,8 +284,8 @@ describe('mcp-config store', () => { for (const variant of variants) expect(validateMcpEntry('brave-search', variant)).not.toBeNull(); }); - it('uses ~/.waggle when dataDir is empty (same fallback as index.ts)', () => { - expect(mcpConfigPath('')).toBe(path.join(os.homedir(), '.waggle', '.mcp.json')); + it('uses ~/.waggle-community when dataDir is empty (same fallback as index.ts)', () => { + expect(mcpConfigPath('')).toBe(path.join(os.homedir(), DEFAULT_DATA_DIR_NAME, '.mcp.json')); }); }); diff --git a/packages/server/tests/local/mcps.test.ts b/packages/server/tests/local/mcps.test.ts index 851824b..292f840 100644 --- a/packages/server/tests/local/mcps.test.ts +++ b/packages/server/tests/local/mcps.test.ts @@ -21,7 +21,7 @@ import { PassThrough } from 'node:stream'; import Database from 'better-sqlite3'; import { WaggleDB } from '@waggle/core'; import { InstallAuditStore } from '../../src/local/install-audit.js'; -import { MCP_CATALOG } from '@waggle/shared'; +import { DEFAULT_DATA_DIR_NAME, MCP_CATALOG } from '@waggle/shared'; import { SecurityGate } from '@waggle/marketplace'; import { McpRuntime, type McpProcess, type SpawnFn } from '@waggle/agent'; import { terminateProcessTree } from '../../../agent/src/system-tools-helpers.js'; @@ -61,7 +61,7 @@ vi.mock('../../src/local/mcp-config.js', async importOriginal => { }); // Redirect the marketplace installer's module-level MCP_CONFIG_PATH away from -// the real ~/.waggle BEFORE the installer module loads (it reads the env at +// the real ~/.waggle-community BEFORE the installer module loads (it reads the env at // import time) — marketplace routes are therefore imported dynamically below. const installerTmp = fs.mkdtempSync(path.join(os.tmpdir(), 'waggle-mcps-installer-')); fs.mkdirSync(isolatedHome, { recursive: true }); @@ -766,7 +766,7 @@ describe('MCP Hub routes (Phase 4)', () => { skill_content: '# Safe helper\n\nSummarize a document.', }, }; - const swappedSkillPath = path.join(isolatedHome, '.waggle', 'skills', `${swappedSkillName}.md`); + const swappedSkillPath = path.join(isolatedHome, DEFAULT_DATA_DIR_NAME, 'skills', `${swappedSkillName}.md`); expect(fs.existsSync(swappedSkillPath)).toBe(false); let calls = 0; diff --git a/packages/server/tests/local/pins-documents-data-dir.test.ts b/packages/server/tests/local/pins-documents-data-dir.test.ts index 6f0f94b..08dfbff 100644 --- a/packages/server/tests/local/pins-documents-data-dir.test.ts +++ b/packages/server/tests/local/pins-documents-data-dir.test.ts @@ -6,7 +6,7 @@ import path from 'node:path'; import { documentRoutes } from '../../src/local/routes/documents.js'; import { pinRoutes } from '../../src/local/routes/pins.js'; -/** UF-064: pins and documents follow the server's data directory, not ~/.waggle. */ +/** UF-064: pins and documents follow the server's data directory, not ~/.waggle-community. */ describe('pins and documents storage', () => { let server: FastifyInstance; let dataDir: string; diff --git a/packages/server/tests/plugin-autoload.test.ts b/packages/server/tests/plugin-autoload.test.ts index 0bcb9bb..19b11cd 100644 --- a/packages/server/tests/plugin-autoload.test.ts +++ b/packages/server/tests/plugin-autoload.test.ts @@ -8,7 +8,7 @@ import type { FastifyInstance } from 'fastify'; /** * Plugin auto-load on startup tests. * - * Verifies that the server scans ~/.waggle/plugins/ at boot and loads + * Verifies that the server scans ~/.waggle-community/plugins/ at boot and loads * plugins with valid plugin.json manifests into the PluginRuntimeManager. */ diff --git a/packages/shared/src/data-dir.ts b/packages/shared/src/data-dir.ts new file mode 100644 index 0000000..0bbc13c --- /dev/null +++ b/packages/shared/src/data-dir.ts @@ -0,0 +1,12 @@ +/** + * The community edition's default data directory, under the user's home + * directory. It is separate from the commercial Waggle's `~/.waggle`, so the + * two editions never open the same databases (ADR-0011). `WAGGLE_DATA_DIR` + * overrides it. The name is temporary: the final one follows the product-name + * decision (Q8). The Rust shell, the launcher, the marketplace and the CLI + * help text keep their own copy; tests check that they match. + */ +export const DEFAULT_DATA_DIR_NAME = '.waggle-community'; + +/** The default data directory as users see it in UI copy and messages. */ +export const DEFAULT_DATA_DIR_LABEL = `~/${DEFAULT_DATA_DIR_NAME}`; diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index d87baaf..bb3ce33 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -2,6 +2,7 @@ export * from './types.js'; export * from './schemas.js'; export * from './constants.js'; +export * from './data-dir.js'; export * from './mcp-catalog.js'; export * from './connector-recommendations.js'; export * from './tool-detection.js'; diff --git a/packages/shared/src/tool-detection.ts b/packages/shared/src/tool-detection.ts index 45a6dc9..f25a1a2 100644 --- a/packages/shared/src/tool-detection.ts +++ b/packages/shared/src/tool-detection.ts @@ -47,7 +47,7 @@ export type ToolReleaseStatus = 'supported' | 'roadmap'; * AI-OS #5 — declarative descriptor for one external tool. The single source of * truth for the per-tool facts that used to be duplicated across SUPPORTED_TOOLS * / LAUNCH_COHORT / TOOL_DISPLAY_NAMES / the per-tool detectors. Built-ins live in BUILTIN_TOOL_MANIFESTS; third-party - * adapters are loaded (data-only) from ~/.waggle/adapters/*.json. + * adapters are loaded (data-only) from ~/.waggle-community/adapters/*.json. */ export interface ToolManifest { id: string; diff --git a/tests/agent-behavior-audit.ts b/tests/agent-behavior-audit.ts index cd98cd7..3a3ad3f 100644 --- a/tests/agent-behavior-audit.ts +++ b/tests/agent-behavior-audit.ts @@ -14,9 +14,10 @@ import * as sqliteVec from 'sqlite-vec'; import os from 'node:os'; import path from 'node:path'; import fs from 'node:fs'; +import { DEFAULT_DATA_DIR_NAME } from '@waggle/shared'; const API = 'http://127.0.0.1:3333'; -const WAGGLE_DIR = path.join(os.homedir(), '.waggle'); +const WAGGLE_DIR = path.join(os.homedir(), DEFAULT_DATA_DIR_NAME); interface SSEEventData { content?: string; diff --git a/vitest.setup.ts b/vitest.setup.ts index d2d5a00..304be00 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -7,7 +7,8 @@ import { mkdtempSync, readFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join, resolve } from 'node:path'; -// Tests must never write to the developer's real ~/.waggle or ~/.claude. Some +// Tests must never write to the developer's real data directories +// (~/.waggle-community, or the commercial edition's ~/.waggle) or ~/.claude. Some // modules resolve paths from os.homedir() at import time (the marketplace // installer's plugin registry and the skill security cache), so point HOME and // USERPROFILE at one temporary directory per worker before any test module loads. From 4fabed70c0f38c2a95572e5972b05faa7b38ff72 Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Wed, 4 Nov 2026 10:31:32 +0100 Subject: [PATCH 3/5] feat(desktop,launcher): default to ~/.waggle-community (P1.3c) The Tauri shell's bundled npm environment and its first-launch flag, the server installer's --data-dir default and the NSIS installer config fell back to ~/.waggle. Use ~/.waggle-community (ADR-0011). The Rust shell keeps the name in DEFAULT_DATA_DIR_NAME in lib.rs and the launcher, which uses only Node built-ins, in DATA_DIR_NAME. packages/shared/tests/data-dir.test.ts fails when either copy, or the marketplace's, differs from @waggle/shared. --- app/scripts/installer-config.test.ts | 14 +++++------ app/scripts/installer-config.ts | 4 ++-- app/src-tauri/src/commands/onboarding.rs | 29 ++++++++++++----------- app/src-tauri/src/lib.rs | 7 ++++++ app/src-tauri/src/service.rs | 17 +++++-------- packages/launcher/README.md | 3 ++- packages/launcher/src/args.ts | 4 ++-- packages/launcher/src/platform.ts | 12 ++++++++-- packages/launcher/tests/installer.test.ts | 9 +++---- packages/shared/tests/data-dir.test.ts | 24 +++++++++++++++++++ 10 files changed, 80 insertions(+), 43 deletions(-) create mode 100644 packages/shared/tests/data-dir.test.ts diff --git a/app/scripts/installer-config.test.ts b/app/scripts/installer-config.test.ts index 872353b..321f3e5 100644 --- a/app/scripts/installer-config.test.ts +++ b/app/scripts/installer-config.test.ts @@ -20,7 +20,7 @@ describe('getDefaultInstallerConfig', () => { expect(config.version).toBe('0.1.0'); expect(config.publisher).toBe('Waggle'); expect(config.defaultInstallDir).toBe('C:\\Program Files\\Waggle'); - expect(config.dataDir).toBe('~/.waggle'); + expect(config.dataDir).toBe('~/.waggle-community'); expect(config.autostart).toBe(true); expect(config.desktopShortcut).toBe(true); expect(config.startMenuEntry).toBe(true); @@ -46,7 +46,7 @@ describe('generateNsisDefines', () => { expect(defines.PRODUCT_VERSION).toBe('0.1.0'); expect(defines.PRODUCT_PUBLISHER).toBe('Waggle'); expect(defines.DEFAULT_INSTALL_DIR).toBe('C:\\Program Files\\Waggle'); - expect(defines.DATA_DIR).toBe('~/.waggle'); + expect(defines.DATA_DIR).toBe('~/.waggle-community'); expect(defines.AUTOSTART).toBe('1'); expect(defines.DESKTOP_SHORTCUT).toBe('1'); expect(defines.START_MENU_ENTRY).toBe('1'); @@ -188,22 +188,22 @@ describe('isSystemPath', () => { describe('getUninstallPrompt', () => { it('includes the data directory in the prompt', () => { - const prompt = getUninstallPrompt('~/.waggle'); - expect(prompt).toContain('~/.waggle'); + const prompt = getUninstallPrompt('~/.waggle-community'); + expect(prompt).toContain('~/.waggle-community'); }); it('mentions keeping data for future use', () => { - const prompt = getUninstallPrompt('C:\\Users\\test\\.waggle'); + const prompt = getUninstallPrompt('C:\\Users\\test\\.waggle-community'); expect(prompt).toContain('keep it for future use'); }); it('mentions deleting all data option', () => { - const prompt = getUninstallPrompt('~/.waggle'); + const prompt = getUninstallPrompt('~/.waggle-community'); expect(prompt).toContain('delete all data'); }); it('mentions agents and memories', () => { - const prompt = getUninstallPrompt('~/.waggle'); + const prompt = getUninstallPrompt('~/.waggle-community'); expect(prompt).toContain('agents'); expect(prompt).toContain('memories'); }); diff --git a/app/scripts/installer-config.ts b/app/scripts/installer-config.ts index bec1432..f7da61d 100644 --- a/app/scripts/installer-config.ts +++ b/app/scripts/installer-config.ts @@ -12,7 +12,7 @@ export interface InstallerConfig { version: string; publisher: string; defaultInstallDir: string; - dataDir: string; // ~/.waggle + dataDir: string; // ~/.waggle-community (ADR-0011) autostart: boolean; desktopShortcut: boolean; startMenuEntry: boolean; @@ -27,7 +27,7 @@ export function getDefaultInstallerConfig(): InstallerConfig { version: '0.1.0', publisher: 'Waggle', defaultInstallDir: 'C:\\Program Files\\Waggle', - dataDir: '~/.waggle', + dataDir: '~/.waggle-community', autostart: true, desktopShortcut: true, startMenuEntry: true, diff --git a/app/src-tauri/src/commands/onboarding.rs b/app/src-tauri/src/commands/onboarding.rs index 09005b0..80954b0 100644 --- a/app/src-tauri/src/commands/onboarding.rs +++ b/app/src-tauri/src/commands/onboarding.rs @@ -2,7 +2,7 @@ // // Brief: briefs/2026-04-30-cc-sesija-A-waggle-apps-web-integration.md §2.3 Task A10 // -// Persists a flag file at `~/.waggle/first-launch.flag` so the onboarding wizard +// Persists a flag file at `~/.waggle-community/first-launch.flag` so the onboarding wizard // state survives across app reinstalls (browser localStorage doesn't, since // Tauri builds may use a fresh WebView profile per install). The web `npm run // dev` path continues to use localStorage via useOnboarding — these commands @@ -13,7 +13,8 @@ use std::path::PathBuf; -const FLAG_DIR: &str = ".waggle"; +use crate::DEFAULT_DATA_DIR_NAME; + const FLAG_FILE: &str = "first-launch.flag"; fn home_dir() -> Option { @@ -23,10 +24,10 @@ fn home_dir() -> Option { } /// Resolve the flag location: `WAGGLE_DATA_DIR` (when set and non-empty) else -/// `~/.waggle` — the SAME resolution order the sidecar's resolveDataDir uses +/// `~/.waggle-community` — the SAME resolution order the sidecar's resolveDataDir uses /// (UX-Refactor P4/D11). Without this, a custom-data-dir install reads/writes -/// the flag in `~/.waggle` while the server's completion stamp lives in the -/// data dir — and a stale `~/.waggle` flag from a prior default install would +/// the flag in the default directory while the server's completion stamp lives in the +/// data dir — and a stale default-directory flag from a prior default install would /// auto-skip onboarding against a brand-new data dir (P4 review, 5 findings). fn flag_path() -> Result { if let Some(dir) = std::env::var_os("WAGGLE_DATA_DIR") { @@ -37,7 +38,7 @@ fn flag_path() -> Result { let home = home_dir().ok_or_else(|| { "could not resolve user home directory (USERPROFILE/HOME unset)".to_string() })?; - Ok(home.join(FLAG_DIR).join(FLAG_FILE)) + Ok(home.join(DEFAULT_DATA_DIR_NAME).join(FLAG_FILE)) } /// Returns true if the user has not yet completed onboarding. @@ -54,7 +55,7 @@ pub async fn is_first_launch() -> Result { } /// Marks onboarding as complete by creating the flag file. Idempotent. -/// Creates the parent `~/.waggle/` directory if needed. +/// Creates the parent data directory if needed. #[tauri::command] pub async fn mark_first_launch_complete() -> Result<(), String> { let path = flag_path()?; @@ -91,12 +92,12 @@ mod tests { std::env::set_var("USERPROFILE", &tmp); std::env::set_var("HOME", &tmp); - // Default: ~/.waggle. + // Default: ~/.waggle-community, never the commercial edition's ~/.waggle. std::env::remove_var("WAGGLE_DATA_DIR"); let path = flag_path().expect("flag_path resolves with USERPROFILE/HOME set"); - assert!( - path.ends_with(".waggle/first-launch.flag") - || path.ends_with(".waggle\\first-launch.flag") + assert_eq!( + path, + tmp.join(".waggle-community").join("first-launch.flag") ); // P4/D11: a custom data dir keeps the flag NEXT TO the server's stamp. @@ -110,9 +111,9 @@ mod tests { // Empty env value falls through to the home default (matches resolveDataDir). std::env::set_var("WAGGLE_DATA_DIR", ""); let fallback = flag_path().expect("flag_path resolves with empty WAGGLE_DATA_DIR"); - assert!( - fallback.ends_with(".waggle/first-launch.flag") - || fallback.ends_with(".waggle\\first-launch.flag") + assert_eq!( + fallback, + tmp.join(".waggle-community").join("first-launch.flag") ); std::env::remove_var("WAGGLE_DATA_DIR"); diff --git a/app/src-tauri/src/lib.rs b/app/src-tauri/src/lib.rs index 29dd040..d24a2b8 100644 --- a/app/src-tauri/src/lib.rs +++ b/app/src-tauri/src/lib.rs @@ -8,6 +8,13 @@ mod tray; use service::ServiceState; use tauri::Manager; +/// Default data directory under the user's home directory, used when +/// `WAGGLE_DATA_DIR` is unset. It is separate from the commercial Waggle's +/// `~/.waggle` so the two editions never open the same databases (ADR-0011). +/// The name is temporary: the final one follows the product-name decision (Q8). +/// `packages/shared/tests/data-dir.test.ts` checks it matches `@waggle/shared`. +pub(crate) const DEFAULT_DATA_DIR_NAME: &str = ".waggle-community"; + #[tauri::command] async fn show_notification( app: tauri::AppHandle, diff --git a/app/src-tauri/src/service.rs b/app/src-tauri/src/service.rs index c7aa486..cb2b6f9 100644 --- a/app/src-tauri/src/service.rs +++ b/app/src-tauri/src/service.rs @@ -414,7 +414,7 @@ fn bundled_npm_environment( home_dir .filter(|value| !value.is_empty()) .map(PathBuf::from) - .map(|home| home.join(".waggle")) + .map(|home| home.join(crate::DEFAULT_DATA_DIR_NAME)) }) .ok_or_else(|| "Unable to resolve writable npm data directory".to_string())?; let runtime_dir = resources_dir @@ -1138,7 +1138,7 @@ mod tests { } #[test] - fn bundled_npm_environment_falls_back_to_waggle_home() { + fn bundled_npm_environment_falls_back_to_the_default_data_dir() { let resources = Path::new("resources"); let home = Path::new("home"); let environment = bundled_npm_environment( @@ -1149,15 +1149,10 @@ mod tests { ) .expect("fallback npm environment resolves"); - assert_eq!( - environment.npm_prefix, - home.join(".waggle").join("npm").join("prefix") - ); - assert_eq!( - environment.npm_cache, - home.join(".waggle").join("npm").join("cache") - ); - assert_eq!(environment.data_dir, home.join(".waggle")); + let data_dir = home.join(".waggle-community"); + assert_eq!(environment.npm_prefix, data_dir.join("npm").join("prefix")); + assert_eq!(environment.npm_cache, data_dir.join("npm").join("cache")); + assert_eq!(environment.data_dir, data_dir); } #[test] diff --git a/packages/launcher/README.md b/packages/launcher/README.md index a88e02d..4f17883 100644 --- a/packages/launcher/README.md +++ b/packages/launcher/README.md @@ -26,7 +26,8 @@ Run `waggle-server --help` for the full list. Supported systems: Windows x64, macOS (Apple silicon and Intel), Linux x64. You need Node.js 20 or newer only for the first `npx` call. -Your data lives in `~/.waggle` (or `WAGGLE_DATA_DIR`). `uninstall` does not touch it. +Your data lives in `~/.waggle-community` (or `WAGGLE_DATA_DIR`), apart from the commercial +Waggle's `~/.waggle`. `uninstall` does not touch it. The package and command names are temporary until the product name is decided, and until the release location is set, install from an archive with `--from`. diff --git a/packages/launcher/src/args.ts b/packages/launcher/src/args.ts index 8e50012..de6ffec 100644 --- a/packages/launcher/src/args.ts +++ b/packages/launcher/src/args.ts @@ -1,4 +1,4 @@ -import { COMMAND_NAME } from './platform.js'; +import { COMMAND_NAME, DATA_DIR_NAME } from './platform.js'; export type Command = 'install' | 'update' | 'run' | 'doctor' | 'uninstall' | 'help' | 'version'; @@ -97,7 +97,7 @@ export function formatHelp(version: string): string { --sha256 Expected SHA-256 of the archive --dir Install directory --bin-dir Where to put the ${COMMAND_NAME} command - --data-dir Data directory (default: $WAGGLE_DATA_DIR or ~/.waggle) + --data-dir Data directory (default: $WAGGLE_DATA_DIR or ~/${DATA_DIR_NAME}) --port, -p Server port (default: ${DEFAULT_PORT}) --no-open Do not open the browser --force Reinstall even when this version is installed diff --git a/packages/launcher/src/platform.ts b/packages/launcher/src/platform.ts index c1214e6..3eb577d 100644 --- a/packages/launcher/src/platform.ts +++ b/packages/launcher/src/platform.ts @@ -9,6 +9,14 @@ import path from 'node:path'; /** The command the installer puts on the PATH. A working name until the product name is decided. */ export const COMMAND_NAME = 'waggle-server'; +/** + * The default data directory under the home directory, kept apart from the + * commercial Waggle's `~/.waggle` (ADR-0011). A temporary name: the final one + * follows the product-name decision (Q8). The launcher uses only Node's + * built-in modules, so this copies `DEFAULT_DATA_DIR_NAME` from `@waggle/shared`. + */ +export const DATA_DIR_NAME = '.waggle-community'; + export interface Host { platform: NodeJS.Platform; arch: string; @@ -63,9 +71,9 @@ export function defaultBinDir(host: Host, installDir: string): string { return host.platform === 'win32' ? p.join(installDir, 'bin') : p.join(host.homedir, '.local', 'bin'); } -/** Same rule as the sidecar's resolveDataDir: WAGGLE_DATA_DIR, else ~/.waggle. */ +/** Same rule as the sidecar's resolveDataDir: WAGGLE_DATA_DIR, else ~/.waggle-community. */ export function defaultDataDir(host: Host): string { - return host.env.WAGGLE_DATA_DIR || pathApi(host.platform).join(host.homedir, '.waggle'); + return host.env.WAGGLE_DATA_DIR || pathApi(host.platform).join(host.homedir, DATA_DIR_NAME); } export function isOnPath(host: Host, dir: string): boolean { diff --git a/packages/launcher/tests/installer.test.ts b/packages/launcher/tests/installer.test.ts index 539b36f..37a5056 100644 --- a/packages/launcher/tests/installer.test.ts +++ b/packages/launcher/tests/installer.test.ts @@ -92,7 +92,8 @@ describe('platform paths', () => { }); it('follows the sidecar data directory rule', () => { - expect(defaultDataDir(host('linux'))).toBe('/home/ana/.waggle'); + expect(defaultDataDir(host('linux'))).toBe('/home/ana/.waggle-community'); + expect(defaultDataDir(host('win32'))).toBe('C:\\Users\\ana\\.waggle-community'); expect(defaultDataDir(host('linux', { WAGGLE_DATA_DIR: '/srv/waggle' }))).toBe('/srv/waggle'); }); @@ -107,7 +108,7 @@ describe('payload helpers', () => { it('gives the server the environment the desktop shell gives it', () => { const env = serviceEnvironment({ appDir: '/opt/w/app', - dataDir: '/home/ana/.waggle', + dataDir: '/home/ana/.waggle-community', port: 4000, platform: 'linux', baseEnv: { PATH: '/usr/bin', WAGGLE_DATA_DIR: '/stale' }, @@ -119,8 +120,8 @@ describe('payload helpers', () => { WAGGLE_FRONTEND_DIR: '/opt/w/app/web', NODE_PATH: '/opt/w/app/node_modules:/opt/w/app/native', PATH: '/opt/w/app/node_modules/waggle-node-runtime/bin:/opt/w/app:/usr/bin', - NPM_CONFIG_PREFIX: '/home/ana/.waggle/npm/prefix', - NPM_CONFIG_CACHE: '/home/ana/.waggle/npm/cache', + NPM_CONFIG_PREFIX: '/home/ana/.waggle-community/npm/prefix', + NPM_CONFIG_CACHE: '/home/ana/.waggle-community/npm/cache', }); expect(env.WAGGLE_DATA_DIR).toBeUndefined(); diff --git a/packages/shared/tests/data-dir.test.ts b/packages/shared/tests/data-dir.test.ts new file mode 100644 index 0000000..079aa11 --- /dev/null +++ b/packages/shared/tests/data-dir.test.ts @@ -0,0 +1,24 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { describe, it, expect } from 'vitest'; +import { DEFAULT_DATA_DIR_LABEL, DEFAULT_DATA_DIR_NAME } from '../src/data-dir.js'; +import { DATA_DIR_NAME as LAUNCHER_DATA_DIR_NAME } from '../../launcher/src/platform.js'; +import { DATA_DIR_NAME as MARKETPLACE_DATA_DIR_NAME } from '../../marketplace/src/data-dir.js'; + +const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../..'); + +// ADR-0011: the community edition never defaults to the commercial ~/.waggle. +describe('default data directory', () => { + it('is separate from the commercial edition', () => { + expect(DEFAULT_DATA_DIR_NAME).toBe('.waggle-community'); + expect(DEFAULT_DATA_DIR_LABEL).toBe('~/.waggle-community'); + }); + + it('has the same name in the launcher, the marketplace and the Rust shell', () => { + expect(LAUNCHER_DATA_DIR_NAME).toBe(DEFAULT_DATA_DIR_NAME); + expect(MARKETPLACE_DATA_DIR_NAME).toBe(DEFAULT_DATA_DIR_NAME); + const lib = fs.readFileSync(path.join(ROOT, 'app/src-tauri/src/lib.rs'), 'utf8'); + expect(lib).toContain(`const DEFAULT_DATA_DIR_NAME: &str = "${DEFAULT_DATA_DIR_NAME}";`); + }); +}); From ad222e8bf33df4732fdc06592e5b189fc79d74f2 Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Wed, 4 Nov 2026 10:31:38 +0100 Subject: [PATCH 4/5] feat(web): name ~/.waggle-community as the data directory (P1.3c) Settings > Advanced and the Vault notice showed ~/.waggle. Take the path from DEFAULT_DATA_DIR_LABEL in @waggle/shared (ADR-0011) and update the comments that describe the first-launch flag and skill locations. --- apps/web/src/components/os/apps/SettingsApp.tsx | 3 ++- apps/web/src/components/os/apps/VaultApp.tsx | 3 ++- apps/web/src/components/os/apps/skills/SkillBuilder.tsx | 2 +- apps/web/src/hooks/useOnboarding.ts | 4 ++-- apps/web/src/lib/tauri-bindings.ts | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/web/src/components/os/apps/SettingsApp.tsx b/apps/web/src/components/os/apps/SettingsApp.tsx index 7139915..b34b7ab 100644 --- a/apps/web/src/components/os/apps/SettingsApp.tsx +++ b/apps/web/src/components/os/apps/SettingsApp.tsx @@ -1,5 +1,6 @@ import { useEffect, useRef, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; +import { DEFAULT_DATA_DIR_LABEL } from '@waggle/shared'; import { Cpu, Shield, Palette, Save, Loader2, Database, Download, Upload, Wrench, DollarSign, Key, Lock, BarChart3, Trash2, @@ -916,7 +917,7 @@ const SettingsApp = () => {

Data Directory

-

~/.waggle/

+

{DEFAULT_DATA_DIR_LABEL}/

All workspaces, memory, vault, and config live here.

diff --git a/apps/web/src/components/os/apps/VaultApp.tsx b/apps/web/src/components/os/apps/VaultApp.tsx index b76c675..8a6c17d 100644 --- a/apps/web/src/components/os/apps/VaultApp.tsx +++ b/apps/web/src/components/os/apps/VaultApp.tsx @@ -1,4 +1,5 @@ import { useState, useEffect, useRef } from 'react'; +import { DEFAULT_DATA_DIR_LABEL } from '@waggle/shared'; import { Lock, Plus, Trash2, Eye, EyeOff, Loader2, Key, Plug, ExternalLink, Shield, ChevronDown, ChevronRight, RefreshCw, CheckCircle2, User, Pencil, @@ -264,7 +265,7 @@ const VaultApp = () => {

The Vault is the single source for API keys. {' '}Values are encrypted with AES-256-GCM and stored locally at{' '} - ~/.waggle/vault. + {DEFAULT_DATA_DIR_LABEL}/vault.

Keys never leave your machine, never appear in logs, and are only decrypted in-memory when the LLM SDK needs them. Clicking Reveal shows the value for 10 seconds, then auto-hides. diff --git a/apps/web/src/components/os/apps/skills/SkillBuilder.tsx b/apps/web/src/components/os/apps/skills/SkillBuilder.tsx index 29765c1..0cf2043 100644 --- a/apps/web/src/components/os/apps/skills/SkillBuilder.tsx +++ b/apps/web/src/components/os/apps/skills/SkillBuilder.tsx @@ -13,7 +13,7 @@ import { adapter } from '@/lib/adapter'; * Contracts honoured: * - C13: create-to-local only (POST /api/skills/create — marketplace publish * lives in the Hub). Create == installed: the file lands in - * ~/.waggle/skills and appears under My Skills immediately. + * ~/.waggle-community/skills and appears under My Skills immediately. * - C14: inputs/outputs serialize into the markdown BODY ("## Inputs" / * "## Outputs") — no frontmatter extension. The create route only accepts * name/description/steps/category, so the sections are appended with a diff --git a/apps/web/src/hooks/useOnboarding.ts b/apps/web/src/hooks/useOnboarding.ts index ee7ca03..1a395d7 100644 --- a/apps/web/src/hooks/useOnboarding.ts +++ b/apps/web/src/hooks/useOnboarding.ts @@ -171,7 +171,7 @@ export const useOnboarding = () => { }, []); // CC Sesija A §2.3 A11: Tauri filesystem-flag fast-path for returning users. - // Runs in Tauri mode only; if ~/.waggle/first-launch.flag exists the user + // Runs in Tauri mode only; if ~/.waggle-community/first-launch.flag exists the user // has completed onboarding before (even if this WebView profile is fresh). // Auto-completes the wizard in that case. Complementary to the workspaces- // check below — flag is faster + doesn't need sidecar; either trigger is @@ -285,7 +285,7 @@ export const useOnboarding = () => { adapter.markOnboardingComplete().catch((err) => { console.warn('[useOnboarding] markOnboardingComplete failed:', err); }); - // CC Sesija A §2.3 A11: Tauri filesystem flag too (default ~/.waggle + // CC Sesija A §2.3 A11: Tauri filesystem flag too (default ~/.waggle-community // installs share the same file; the IPC path works even when the // sidecar is mid-restart). if (isTauri()) { diff --git a/apps/web/src/lib/tauri-bindings.ts b/apps/web/src/lib/tauri-bindings.ts index b78ad48..2a89b4b 100644 --- a/apps/web/src/lib/tauri-bindings.ts +++ b/apps/web/src/lib/tauri-bindings.ts @@ -234,7 +234,7 @@ export function listenAgentEnd( // ─── onboarding (A10) ────────────────────────────────────────────────────── // CC Sesija A §2.3 Task A10. First-launch detection via Rust-managed -// filesystem flag at `~/.waggle/first-launch.flag` (durable across reinstalls, +// filesystem flag at `~/.waggle-community/first-launch.flag` (durable across reinstalls, // unlike browser localStorage). useOnboarding still uses localStorage for the // per-step state shape; these commands gate the initial wizard show/hide // decision in Tauri builds. From e0836388f10632b8e9be5ab94727f748291789cc Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Wed, 4 Nov 2026 10:31:47 +0100 Subject: [PATCH 5/5] docs: record the separate data directory (ADR-0011) Add ADR-0011: the community edition defaults to ~/.waggle-community, a temporary name that follows the product-name decision (Q8), and copies nothing from the commercial ~/.waggle. It supersedes point 4 of ADR-0009 and closes the pending "separate data directory" decision. Update the install guide, troubleshooting, capabilities, memory, architecture, the Windows build notes, THREAT_MODEL, README, .env.example and the changelog. Log UF-068 (Open): marketplace skills and plugins ignore a custom data directory. --- .env.example | 7 +-- AGENTS.md | 4 ++ CHANGELOG.md | 5 +- README.md | 3 +- THREAT_MODEL.md | 5 +- docs/ARCHITECTURE.md | 3 +- docs/guides/capabilities.md | 2 +- docs/guides/troubleshooting.md | 3 +- docs/install.md | 17 +++++-- docs/memory.md | 2 +- docs/oss/adr/0009-installer-server-archive.md | 2 +- docs/oss/adr/0011-separate-data-directory.md | 47 +++++++++++++++++++ docs/oss/adr/README.md | 4 +- docs/oss/build-windows.md | 4 +- docs/oss/research/memory-search-quality.md | 2 +- docs/oss/upstream-fixes.md | 10 ++++ 16 files changed, 99 insertions(+), 21 deletions(-) create mode 100644 docs/oss/adr/0011-separate-data-directory.md diff --git a/.env.example b/.env.example index 94f4f8e..ad7b971 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ # Optional settings for running the sidecar from source. A basic local run # needs none of them: keys are entered in the app and kept in the encrypted -# vault (~/.waggle/vault.json). +# vault (~/.waggle-community/vault.json). # ── Provider API keys ────────────────────────────────────────────── # Set keys in the app under Settings > Models (Provider Keys) or in the Vault @@ -15,7 +15,8 @@ # VOYAGE_API_KEY= # embeddings only (EMBEDDING_PROVIDER=voyage) # ── Data directory and port ──────────────────────────────────────── -# WAGGLE_DATA_DIR=~/.waggle +# Default: ~/.waggle-community, kept apart from the commercial Waggle's ~/.waggle. +# WAGGLE_DATA_DIR=~/.waggle-community # WAGGLE_PORT=3333 # ── LiteLLM (optional) ───────────────────────────────────────────── @@ -30,7 +31,7 @@ # EMBEDDING_PROVIDER=auto # In-process model: downloads about 23 MB on first use, cached in -# ~/.waggle/models/, then works offline. +# ~/.waggle-community/models/, then works offline. # EMBEDDING_MODEL=Xenova/all-MiniLM-L6-v2 # Ollama: needs Ollama running (https://ollama.com). diff --git a/AGENTS.md b/AGENTS.md index e464a8f..cb12e6a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -37,6 +37,10 @@ The community edition: packages, without Python, Docker or a compiler on the user's machine; - has no monetization: no tiers, trials, payments, license checks or upsell (ADR-0001); - keeps memory on the user's machine through a memory contract backed by local mem0 (ADR-0002); +- keeps its data in `~/.waggle-community` or `WAGGLE_DATA_DIR`, apart from the commercial + edition's `~/.waggle` (ADR-0011). The name is temporary; code takes it from + `DEFAULT_DATA_DIR_NAME` in `@waggle/shared` (the Rust shell, the launcher and the + marketplace keep a checked copy); - sends analytics only after the user opts in (ADR-0006). ### Stack (verified 2026-10-15) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43565ab..f2e2780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,11 +39,14 @@ lists what changed for users compared with that product. The reasons are recorde ### Changed - **Memory runs on local mem0** behind a memory contract (ADR-0002, ADR-0007). Memories are kept - in `~/.waggle/memory/`, embedded by a model that runs on your computer, and searched with + in `~/.waggle-community/memory/`, embedded by a model that runs on your computer, and searched with mem0's combined vector and keyword search. Nothing goes to a cloud memory service. Memories from the old `.mind` files are not carried over. See [docs/memory.md](docs/memory.md). - **Waggle's own data** (automations, notifications, cost tracking, your profile card and task list) moved to a separate `waggle.db`, apart from memory. +- **The data directory is `~/.waggle-community`** (ADR-0011), so the community edition never + opens the databases of the commercial Waggle in `~/.waggle`. Nothing is copied from + `~/.waggle`; set `WAGGLE_DATA_DIR` to use another directory. The name is temporary. - **Analytics are opt-in** (ADR-0006). Waggle asks once; nothing is sent until you choose **Allow**, and Settings → General → Privacy & Telemetry turns it off again. When allowed, Waggle sends one event at the end of setup with the template, persona and model you chose. diff --git a/README.md b/README.md index c72f281..0a23707 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,8 @@ sidecar: it registers the files in `dist/` when it starts. The Vite dev server (`npm run dev:web`) cannot sign in to the sidecar yet. Workspace packages are resolved from their TypeScript source, so no package build is needed -before running or testing. Data goes to `~/.waggle` unless you set `WAGGLE_DATA_DIR`. +before running or testing. Data goes to `~/.waggle-community` unless you set `WAGGLE_DATA_DIR`; +the commercial Waggle's `~/.waggle` is not used. Add a model in the app (Settings → Models). `.env.example` lists optional environment variables; a basic local run needs none of them. diff --git a/THREAT_MODEL.md b/THREAT_MODEL.md index afc3ea6..a034d74 100644 --- a/THREAT_MODEL.md +++ b/THREAT_MODEL.md @@ -80,7 +80,10 @@ when, why, and by whom. machine-local key file; each entry is independently encrypted. Runtime API keys belong in the vault or a local `.env` (never committed). `.env.example` contains names plus non-secret development defaults, never live credentials. Callers must -not persist secret values into prompts, logs, or memory frames. +not persist secret values into prompts, logs, or memory frames. The vault and its +key file live in the data directory, `~/.waggle-community` by default, which is +separate from the commercial edition's `~/.waggle` (ADR-0011): neither edition +opens the other's vault. ### 6. MCP tool scope gate (removed) The memory MCP servers this gate protected are not part of the community edition diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 0c42cd1..32aec32 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -128,7 +128,8 @@ loads the `apps/web` build. The shell: ## Data -One data directory per user: `WAGGLE_DATA_DIR`, or `~/.waggle`. [install.md](install.md#where-your-data-lives) +One data directory per user: `WAGGLE_DATA_DIR`, or `~/.waggle-community`, separate from the +commercial edition's `~/.waggle` (ADR-0011). [install.md](install.md#where-your-data-lives) lists what it contains. - **Memory** goes only through `MemoryStore` (`@waggle/memory-contract`). The shipped store keeps diff --git a/docs/guides/capabilities.md b/docs/guides/capabilities.md index 22b2823..73769f2 100644 --- a/docs/guides/capabilities.md +++ b/docs/guides/capabilities.md @@ -34,7 +34,7 @@ set of skills for working with other people; it does not need team mode. ## Writing your own skill -A skill is a Markdown file in `/skills/` (by default `~/.waggle/skills/`). Optional YAML +A skill is a Markdown file in `/skills/` (by default `~/.waggle-community/skills/`). Optional YAML frontmatter gives it a name and other metadata: ```markdown diff --git a/docs/guides/troubleshooting.md b/docs/guides/troubleshooting.md index 2255eb3..15bac55 100644 --- a/docs/guides/troubleshooting.md +++ b/docs/guides/troubleshooting.md @@ -1,7 +1,8 @@ # Troubleshooting Common problems and what to do about them. Paths use `` for the data directory: -`~/.waggle` by default (`%USERPROFILE%\.waggle` on Windows), or `WAGGLE_DATA_DIR`. +`~/.waggle-community` by default (`%USERPROFILE%\.waggle-community` on Windows), or +`WAGGLE_DATA_DIR`. ## Installing diff --git a/docs/install.md b/docs/install.md index 4af2d83..bdfdf7e 100644 --- a/docs/install.md +++ b/docs/install.md @@ -87,7 +87,8 @@ sha256sum Waggle__amd64.deb The window shows "Starting Waggle…" while the app starts its own server in the background. The server listens on `127.0.0.1` port 3333, or on another free port if 3333 is taken. Its log is in -`~/.waggle/logs/service.log` (on Windows `%USERPROFILE%\.waggle\logs\service.log`). +`~/.waggle-community/logs/service.log` (on Windows +`%USERPROFILE%\.waggle-community\logs\service.log`). ### Update the desktop app @@ -168,7 +169,7 @@ it. It listens on this computer only (`127.0.0.1`). |---|---| | `--port `, `-p` | Use another port (default 3333) | | `--no-open` | Do not open the browser | -| `--data-dir ` | Keep data in another directory (default `$WAGGLE_DATA_DIR` or `~/.waggle`) | +| `--data-dir ` | Keep data in another directory (default `$WAGGLE_DATA_DIR` or `~/.waggle-community`) | | `--dir ` | Use a program directory other than the default | If Waggle already runs on the port, `waggle-server` only opens the browser. @@ -244,9 +245,15 @@ send. ## Where your data lives -Both ways of installing use one data directory: `~/.waggle` (on Windows -`%USERPROFILE%\.waggle`). Set `WAGGLE_DATA_DIR` to use another directory; the server installer -also takes `--data-dir`. +Both ways of installing use one data directory: `~/.waggle-community` (on Windows +`%USERPROFILE%\.waggle-community`). Set `WAGGLE_DATA_DIR` to use another directory; the server +installer also takes `--data-dir`. + +The community edition does not touch `~/.waggle`, the data directory of the commercial Waggle, +unless you point `WAGGLE_DATA_DIR` at it, so the two editions do not read or write each other's +databases. Nothing is copied from +`~/.waggle`: the community edition starts with an empty data directory. The directory name is +temporary until the product name is decided. | Path in the data directory | What it holds | |---|---| diff --git a/docs/memory.md b/docs/memory.md index f48d141..39a5180 100644 --- a/docs/memory.md +++ b/docs/memory.md @@ -77,7 +77,7 @@ A store reports what it can do, and the web UI hides what it cannot: ## Where mem0 keeps its data -Everything is in `memory/` inside the data directory (`~/.waggle/memory/` by default): +Everything is in `memory/` inside the data directory (`~/.waggle-community/memory/` by default): | File | Content | |---|---| diff --git a/docs/oss/adr/0009-installer-server-archive.md b/docs/oss/adr/0009-installer-server-archive.md index 7390709..9ac59fb 100644 --- a/docs/oss/adr/0009-installer-server-archive.md +++ b/docs/oss/adr/0009-installer-server-archive.md @@ -1,6 +1,6 @@ # ADR-0009: The installer delivers a prebuilt server archive -- Status: Accepted +- Status: Accepted; point 4 superseded by ADR-0011 - Date: 2026-11-01 ## Context diff --git a/docs/oss/adr/0011-separate-data-directory.md b/docs/oss/adr/0011-separate-data-directory.md new file mode 100644 index 0000000..9bc00ec --- /dev/null +++ b/docs/oss/adr/0011-separate-data-directory.md @@ -0,0 +1,47 @@ +# ADR-0011: The community edition has its own data directory + +- Status: Accepted +- Date: 2026-11-04 +- Supersedes: point 4 of ADR-0009 + +## Context + +The community edition was made from the commercial Waggle and kept its default data directory, +`~/.waggle` (`%USERPROFILE%\.waggle` on Windows). On a computer with both editions, the two +would open the same `config.json`, vault, `waggle.db`, marketplace catalog, skills and logs. Their +schemas and features have diverged: the community edition ignores the commercial keys in +`config.json` (ADR-0001) and the commercial `.mind` memory files (ADR-0007), and the commercial +edition does not know the mem0 store. Sharing one directory risks one edition changing data the +other relies on. + +## Decision + +1. **The default data directory is `~/.waggle-community`** (`%USERPROFILE%\.waggle-community` on + Windows) for the sidecar, the CLI, the marketplace, the desktop shell and the server + installer. The project owner chose this on 2026-11-04. +2. **`WAGGLE_DATA_DIR` still overrides the default** wherever it did before. +3. **Nothing is migrated.** The community edition does not read, copy or move anything from + `~/.waggle`. The owner explicitly does not want a migration: the product is still in + development and nobody has data to bring over. +4. **The name is temporary.** The final name follows the product-name decision (Q8). It is defined + once per runtime so that the rename is one change in each: + - TypeScript: `DEFAULT_DATA_DIR_NAME` and `DEFAULT_DATA_DIR_LABEL` in `@waggle/shared`, with + `defaultDataDir()` in `@waggle/core` for Node code; + - the Tauri shell: `DEFAULT_DATA_DIR_NAME` in `app/src-tauri/src/lib.rs`; + - the server installer, which uses only Node's built-in modules: `DATA_DIR_NAME` in + `packages/launcher/src/platform.ts`; + - the marketplace, which installs on its own without the workspace packages: + `DATA_DIR_NAME` in `packages/marketplace/src/data-dir.ts`. + + `packages/shared/tests/data-dir.test.ts` fails when these copies differ. The CLI help text, + which loads no dependency, spells the path out and `packages/cli/tests/cli-runtime.test.ts` + checks it. + +## Consequences + +- A user who ran an earlier build of the community edition finds an empty data directory and + sets Waggle up again. +- The commercial keys stay untouched in `config.json` (ADR-0001), which still matters when a user + points `WAGGLE_DATA_DIR` at `~/.waggle`. +- The marketplace security scan flags skills that reference the skills folder of either + directory. diff --git a/docs/oss/adr/README.md b/docs/oss/adr/README.md index 1743a52..14f3d07 100644 --- a/docs/oss/adr/README.md +++ b/docs/oss/adr/README.md @@ -14,8 +14,9 @@ decision, add a new record that supersedes the old one. | [0006](0006-opt-in-analytics.md) | Analytics are opt-in | Accepted, one open item | | [0007](0007-memory-contract.md) | The memory contract and how it maps onto mem0 | Accepted | | [0008](0008-native-modules.md) | Native modules ship with a pinned Node runtime | Accepted | -| [0009](0009-installer-server-archive.md) | The installer delivers a prebuilt server archive | Accepted | +| [0009](0009-installer-server-archive.md) | The installer delivers a prebuilt server archive | Accepted, point 4 superseded by ADR-0011 | | [0010](0010-marketplace-catalog-in-repo.md) | The marketplace catalog stays in the repository | Accepted | +| [0011](0011-separate-data-directory.md) | The community edition has its own data directory | Accepted | ## Pending decisions @@ -28,5 +29,4 @@ work packages wait for the answer. | Product name and system identifiers | Temporary names | P1.3d, P2.6 | | Location of the public repository | `release.yml` is ready but has not run; the installer has no default download location (`--from`) | P2.6, P2.7 | | Installer signing | First release may ship unsigned with launch instructions | P2.5 | -| Separate data directory from the commercial edition | Not separated yet | P1.3c | | PostHog project for the community edition | See ADR-0006 | P1.3a | diff --git a/docs/oss/build-windows.md b/docs/oss/build-windows.md index e5de1b2..92300ed 100644 --- a/docs/oss/build-windows.md +++ b/docs/oss/build-windows.md @@ -113,10 +113,10 @@ node scripts/release-smoke.mjs desktop --app "$env:LOCALAPPDATA\Waggle\waggle.ex 2. Start Waggle from the Start menu. The window should move past "Starting Waggle…" to the Home screen. 3. If it stays on "Starting Waggle…", close it and take the log from - `%USERPROFILE%\.waggle\logs\service.log`. + `%USERPROFILE%\.waggle-community\logs\service.log`. 4. Chat needs a model: an API key in Settings → Models (Provider Keys), or a running Ollama. -Waggle keeps its data in `%USERPROFILE%\.waggle`. +Waggle keeps its data in `%USERPROFILE%\.waggle-community`. ## Troubleshooting diff --git a/docs/oss/research/memory-search-quality.md b/docs/oss/research/memory-search-quality.md index f4883da..9ec8cc0 100644 --- a/docs/oss/research/memory-search-quality.md +++ b/docs/oss/research/memory-search-quality.md @@ -329,7 +329,7 @@ npx tsx packages/memory-mem0/bench/search-quality.ts --engines mem0,cosine npx tsx packages/memory-mem0/bench/search-quality.ts --out /tmp/search-quality.json ``` -The in-process model must be in `~/.waggle/models` (the sidecar downloads it on first start) +The in-process model must be in `~/.waggle-community/models` (the sidecar downloads it on first start) or in the directory named by `WAGGLE_MODELS_DIR`; the bench refuses network access and does not download it. diff --git a/docs/oss/upstream-fixes.md b/docs/oss/upstream-fixes.md index 04a4579..1857583 100644 --- a/docs/oss/upstream-fixes.md +++ b/docs/oss/upstream-fixes.md @@ -96,6 +96,7 @@ Baseline: commit `b20b138` of the main Waggle repository. | UF-065 | The Windows uninstaller names a "Data & Privacy" settings page that does not exist | Fixed | Desktop, Windows installer | | UF-066 | Installed builds have no capability packs and no starter skills | Fixed | Sidecar bundle, SDK | | UF-067 | The status bar names a default model that chats cannot use | Fixed | Sidecar, Web UI | +| UF-068 | Marketplace skills and plugins ignore the configured data directory | Open | Marketplace, sidecar | ## Entries @@ -675,3 +676,12 @@ Entries UF-010 to UF-019 come from the UI audit `anti-slop/audit-001-2026-10-14. - Cause: the chat route resolves the configured model to a usable one (`resolveUsableModel`), but the status endpoint returns the configured model as is. - What we did: the status endpoint resolves the model the same way, without changing the configured one. A test covers it. - Recommendation: same change in the main project. + +### UF-068. Marketplace skills and plugins ignore the configured data directory +- Status: Open +- Found: 2026-11-04 +- Where: at commit `b20b138`, `packages/marketplace/src/installer.ts:47-50` (`SKILLS_DIR`, `PLUGINS_DIR`, `REGISTRY_PATH`); the sidecar reads `/skills` and `/plugins` (`packages/server/src/local/routes/skills.ts:43`) +- Symptom: with `WAGGLE_DATA_DIR` or a custom data directory, a skill or plugin installed from the Marketplace is written to the default directory in the home folder, so the sidecar does not list or load it. +- Cause: the installer builds these paths from `os.homedir()` when its module loads. Only `.mcp.json` honors `WAGGLE_DATA_DIR`, and the MCP route also saves the entry in the server's data directory to make up for it. +- What we did: nothing yet. The community edition changed the default directory name only (ADR-0011). +- Recommendation: pass the server's data directory to `MarketplaceInstaller`, or resolve the paths at call time from `WAGGLE_DATA_DIR` like `mcpConfigPath()`.