Merge P1.3c: separate data directory and the Benchmarks page removal
The community edition defaults to ~/.waggle-community and copies nothing from the commercial ~/.waggle (ADR-0011). The Benchmarks page, which showed scores of a memory engine the community edition does not run, is removed. Logs UF-068.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Optional settings for running the sidecar from source. A basic local run
|
# 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
|
# 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 ──────────────────────────────────────────────
|
# ── Provider API keys ──────────────────────────────────────────────
|
||||||
# Set keys in the app under Settings > Models (Provider Keys) or in the Vault
|
# 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)
|
# VOYAGE_API_KEY= # embeddings only (EMBEDDING_PROVIDER=voyage)
|
||||||
|
|
||||||
# ── Data directory and port ────────────────────────────────────────
|
# ── 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
|
# WAGGLE_PORT=3333
|
||||||
|
|
||||||
# ── LiteLLM (optional) ─────────────────────────────────────────────
|
# ── LiteLLM (optional) ─────────────────────────────────────────────
|
||||||
@@ -30,7 +31,7 @@
|
|||||||
# EMBEDDING_PROVIDER=auto
|
# EMBEDDING_PROVIDER=auto
|
||||||
|
|
||||||
# In-process model: downloads about 23 MB on first use, cached in
|
# 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
|
# EMBEDDING_MODEL=Xenova/all-MiniLM-L6-v2
|
||||||
|
|
||||||
# Ollama: needs Ollama running (https://ollama.com).
|
# Ollama: needs Ollama running (https://ollama.com).
|
||||||
|
|||||||
@@ -31,17 +31,22 @@ 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
|
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
|
and stops them. "Best fit" in chat now proposes Waggle personas only, so no workspace memories
|
||||||
are sent to an external agent.
|
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.
|
- **`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).
|
- The automatic start of a LiteLLM proxy, which needed Python. It is now opt-in (see Changed).
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- **Memory runs on local mem0** behind a memory contract (ADR-0002, ADR-0007). Memories are kept
|
- **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
|
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).
|
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
|
- **Waggle's own data** (automations, notifications, cost tracking, your profile card and task
|
||||||
list) moved to a separate `waggle.db`, apart from memory.
|
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
|
- **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,
|
**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.
|
Waggle sends one event at the end of setup with the template, persona and model you chose.
|
||||||
|
|||||||
@@ -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.
|
(`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
|
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
|
Add a model in the app (Settings → Models). `.env.example` lists optional environment
|
||||||
variables; a basic local run needs none of them.
|
variables; a basic local run needs none of them.
|
||||||
|
|||||||
@@ -80,7 +80,10 @@ when, why, and by whom.
|
|||||||
machine-local key file; each entry is independently encrypted. Runtime API keys
|
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
|
belong in the vault or a local `.env` (never committed). `.env.example` contains
|
||||||
names plus non-secret development defaults, never live credentials. Callers must
|
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)
|
### 6. MCP tool scope gate (removed)
|
||||||
The memory MCP servers this gate protected are not part of the community edition
|
The memory MCP servers this gate protected are not part of the community edition
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ describe('getDefaultInstallerConfig', () => {
|
|||||||
expect(config.version).toBe('0.1.0');
|
expect(config.version).toBe('0.1.0');
|
||||||
expect(config.publisher).toBe('Waggle');
|
expect(config.publisher).toBe('Waggle');
|
||||||
expect(config.defaultInstallDir).toBe('C:\\Program Files\\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.autostart).toBe(true);
|
||||||
expect(config.desktopShortcut).toBe(true);
|
expect(config.desktopShortcut).toBe(true);
|
||||||
expect(config.startMenuEntry).toBe(true);
|
expect(config.startMenuEntry).toBe(true);
|
||||||
@@ -46,7 +46,7 @@ describe('generateNsisDefines', () => {
|
|||||||
expect(defines.PRODUCT_VERSION).toBe('0.1.0');
|
expect(defines.PRODUCT_VERSION).toBe('0.1.0');
|
||||||
expect(defines.PRODUCT_PUBLISHER).toBe('Waggle');
|
expect(defines.PRODUCT_PUBLISHER).toBe('Waggle');
|
||||||
expect(defines.DEFAULT_INSTALL_DIR).toBe('C:\\Program Files\\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.AUTOSTART).toBe('1');
|
||||||
expect(defines.DESKTOP_SHORTCUT).toBe('1');
|
expect(defines.DESKTOP_SHORTCUT).toBe('1');
|
||||||
expect(defines.START_MENU_ENTRY).toBe('1');
|
expect(defines.START_MENU_ENTRY).toBe('1');
|
||||||
@@ -188,22 +188,22 @@ describe('isSystemPath', () => {
|
|||||||
|
|
||||||
describe('getUninstallPrompt', () => {
|
describe('getUninstallPrompt', () => {
|
||||||
it('includes the data directory in the prompt', () => {
|
it('includes the data directory in the prompt', () => {
|
||||||
const prompt = getUninstallPrompt('~/.waggle');
|
const prompt = getUninstallPrompt('~/.waggle-community');
|
||||||
expect(prompt).toContain('~/.waggle');
|
expect(prompt).toContain('~/.waggle-community');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('mentions keeping data for future use', () => {
|
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');
|
expect(prompt).toContain('keep it for future use');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('mentions deleting all data option', () => {
|
it('mentions deleting all data option', () => {
|
||||||
const prompt = getUninstallPrompt('~/.waggle');
|
const prompt = getUninstallPrompt('~/.waggle-community');
|
||||||
expect(prompt).toContain('delete all data');
|
expect(prompt).toContain('delete all data');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('mentions agents and memories', () => {
|
it('mentions agents and memories', () => {
|
||||||
const prompt = getUninstallPrompt('~/.waggle');
|
const prompt = getUninstallPrompt('~/.waggle-community');
|
||||||
expect(prompt).toContain('agents');
|
expect(prompt).toContain('agents');
|
||||||
expect(prompt).toContain('memories');
|
expect(prompt).toContain('memories');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export interface InstallerConfig {
|
|||||||
version: string;
|
version: string;
|
||||||
publisher: string;
|
publisher: string;
|
||||||
defaultInstallDir: string;
|
defaultInstallDir: string;
|
||||||
dataDir: string; // ~/.waggle
|
dataDir: string; // ~/.waggle-community (ADR-0011)
|
||||||
autostart: boolean;
|
autostart: boolean;
|
||||||
desktopShortcut: boolean;
|
desktopShortcut: boolean;
|
||||||
startMenuEntry: boolean;
|
startMenuEntry: boolean;
|
||||||
@@ -27,7 +27,7 @@ export function getDefaultInstallerConfig(): InstallerConfig {
|
|||||||
version: '0.1.0',
|
version: '0.1.0',
|
||||||
publisher: 'Waggle',
|
publisher: 'Waggle',
|
||||||
defaultInstallDir: 'C:\\Program Files\\Waggle',
|
defaultInstallDir: 'C:\\Program Files\\Waggle',
|
||||||
dataDir: '~/.waggle',
|
dataDir: '~/.waggle-community',
|
||||||
autostart: true,
|
autostart: true,
|
||||||
desktopShortcut: true,
|
desktopShortcut: true,
|
||||||
startMenuEntry: true,
|
startMenuEntry: true,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Brief: briefs/2026-04-30-cc-sesija-A-waggle-apps-web-integration.md §2.3 Task A10
|
// 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
|
// state survives across app reinstalls (browser localStorage doesn't, since
|
||||||
// Tauri builds may use a fresh WebView profile per install). The web `npm run
|
// Tauri builds may use a fresh WebView profile per install). The web `npm run
|
||||||
// dev` path continues to use localStorage via useOnboarding — these commands
|
// dev` path continues to use localStorage via useOnboarding — these commands
|
||||||
@@ -13,7 +13,8 @@
|
|||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
const FLAG_DIR: &str = ".waggle";
|
use crate::DEFAULT_DATA_DIR_NAME;
|
||||||
|
|
||||||
const FLAG_FILE: &str = "first-launch.flag";
|
const FLAG_FILE: &str = "first-launch.flag";
|
||||||
|
|
||||||
fn home_dir() -> Option<PathBuf> {
|
fn home_dir() -> Option<PathBuf> {
|
||||||
@@ -23,10 +24,10 @@ fn home_dir() -> Option<PathBuf> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Resolve the flag location: `WAGGLE_DATA_DIR` (when set and non-empty) else
|
/// 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
|
/// (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
|
/// the flag in the default directory while the server's completion stamp lives in the
|
||||||
/// data dir — and a stale `~/.waggle` flag from a prior default install would
|
/// 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).
|
/// auto-skip onboarding against a brand-new data dir (P4 review, 5 findings).
|
||||||
fn flag_path() -> Result<PathBuf, String> {
|
fn flag_path() -> Result<PathBuf, String> {
|
||||||
if let Some(dir) = std::env::var_os("WAGGLE_DATA_DIR") {
|
if let Some(dir) = std::env::var_os("WAGGLE_DATA_DIR") {
|
||||||
@@ -37,7 +38,7 @@ fn flag_path() -> Result<PathBuf, String> {
|
|||||||
let home = home_dir().ok_or_else(|| {
|
let home = home_dir().ok_or_else(|| {
|
||||||
"could not resolve user home directory (USERPROFILE/HOME unset)".to_string()
|
"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.
|
/// Returns true if the user has not yet completed onboarding.
|
||||||
@@ -54,7 +55,7 @@ pub async fn is_first_launch() -> Result<bool, String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Marks onboarding as complete by creating the flag file. Idempotent.
|
/// 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]
|
#[tauri::command]
|
||||||
pub async fn mark_first_launch_complete() -> Result<(), String> {
|
pub async fn mark_first_launch_complete() -> Result<(), String> {
|
||||||
let path = flag_path()?;
|
let path = flag_path()?;
|
||||||
@@ -91,12 +92,12 @@ mod tests {
|
|||||||
std::env::set_var("USERPROFILE", &tmp);
|
std::env::set_var("USERPROFILE", &tmp);
|
||||||
std::env::set_var("HOME", &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");
|
std::env::remove_var("WAGGLE_DATA_DIR");
|
||||||
let path = flag_path().expect("flag_path resolves with USERPROFILE/HOME set");
|
let path = flag_path().expect("flag_path resolves with USERPROFILE/HOME set");
|
||||||
assert!(
|
assert_eq!(
|
||||||
path.ends_with(".waggle/first-launch.flag")
|
path,
|
||||||
|| path.ends_with(".waggle\\first-launch.flag")
|
tmp.join(".waggle-community").join("first-launch.flag")
|
||||||
);
|
);
|
||||||
|
|
||||||
// P4/D11: a custom data dir keeps the flag NEXT TO the server's stamp.
|
// 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).
|
// Empty env value falls through to the home default (matches resolveDataDir).
|
||||||
std::env::set_var("WAGGLE_DATA_DIR", "");
|
std::env::set_var("WAGGLE_DATA_DIR", "");
|
||||||
let fallback = flag_path().expect("flag_path resolves with empty WAGGLE_DATA_DIR");
|
let fallback = flag_path().expect("flag_path resolves with empty WAGGLE_DATA_DIR");
|
||||||
assert!(
|
assert_eq!(
|
||||||
fallback.ends_with(".waggle/first-launch.flag")
|
fallback,
|
||||||
|| fallback.ends_with(".waggle\\first-launch.flag")
|
tmp.join(".waggle-community").join("first-launch.flag")
|
||||||
);
|
);
|
||||||
|
|
||||||
std::env::remove_var("WAGGLE_DATA_DIR");
|
std::env::remove_var("WAGGLE_DATA_DIR");
|
||||||
|
|||||||
@@ -8,6 +8,13 @@ mod tray;
|
|||||||
use service::ServiceState;
|
use service::ServiceState;
|
||||||
use tauri::Manager;
|
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]
|
#[tauri::command]
|
||||||
async fn show_notification(
|
async fn show_notification(
|
||||||
app: tauri::AppHandle,
|
app: tauri::AppHandle,
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ fn bundled_npm_environment(
|
|||||||
home_dir
|
home_dir
|
||||||
.filter(|value| !value.is_empty())
|
.filter(|value| !value.is_empty())
|
||||||
.map(PathBuf::from)
|
.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())?;
|
.ok_or_else(|| "Unable to resolve writable npm data directory".to_string())?;
|
||||||
let runtime_dir = resources_dir
|
let runtime_dir = resources_dir
|
||||||
@@ -1138,7 +1138,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[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 resources = Path::new("resources");
|
||||||
let home = Path::new("home");
|
let home = Path::new("home");
|
||||||
let environment = bundled_npm_environment(
|
let environment = bundled_npm_environment(
|
||||||
@@ -1149,15 +1149,10 @@ mod tests {
|
|||||||
)
|
)
|
||||||
.expect("fallback npm environment resolves");
|
.expect("fallback npm environment resolves");
|
||||||
|
|
||||||
assert_eq!(
|
let data_dir = home.join(".waggle-community");
|
||||||
environment.npm_prefix,
|
assert_eq!(environment.npm_prefix, data_dir.join("npm").join("prefix"));
|
||||||
home.join(".waggle").join("npm").join("prefix")
|
assert_eq!(environment.npm_cache, data_dir.join("npm").join("cache"));
|
||||||
);
|
assert_eq!(environment.data_dir, data_dir);
|
||||||
assert_eq!(
|
|
||||||
environment.npm_cache,
|
|
||||||
home.join(".waggle").join("npm").join("cache")
|
|
||||||
);
|
|
||||||
assert_eq!(environment.data_dir, home.join(".waggle"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ const MissionControlRoute = lazy(() => import("@/routes/MissionControlRoute"));
|
|||||||
const TimelineRoute = lazy(() => import("@/routes/TimelineRoute"));
|
const TimelineRoute = lazy(() => import("@/routes/TimelineRoute"));
|
||||||
const EventsRoute = lazy(() => import("@/routes/EventsRoute"));
|
const EventsRoute = lazy(() => import("@/routes/EventsRoute"));
|
||||||
const UsageRoute = lazy(() => import("@/routes/UsageRoute"));
|
const UsageRoute = lazy(() => import("@/routes/UsageRoute"));
|
||||||
const BenchmarkRoute = lazy(() => import("@/routes/BenchmarkRoute"));
|
|
||||||
const PlatformRoute = lazy(() => import("@/routes/PlatformRoute"));
|
const PlatformRoute = lazy(() => import("@/routes/PlatformRoute"));
|
||||||
const WorkspacesRoute = lazy(() => import("@/routes/WorkspacesRoute"));
|
const WorkspacesRoute = lazy(() => import("@/routes/WorkspacesRoute"));
|
||||||
const AuthRoute = lazy(() => import("@/routes/AuthRoute"));
|
const AuthRoute = lazy(() => import("@/routes/AuthRoute"));
|
||||||
@@ -157,8 +156,7 @@ const App = () => (
|
|||||||
<Route path="settings/timeline" element={routeElement(<TimelineRoute />)} />
|
<Route path="settings/timeline" element={routeElement(<TimelineRoute />)} />
|
||||||
<Route path="settings/events" element={routeElement(<EventsRoute />)} />
|
<Route path="settings/events" element={routeElement(<EventsRoute />)} />
|
||||||
<Route path="settings/usage" element={routeElement(<UsageRoute />)} />
|
<Route path="settings/usage" element={routeElement(<UsageRoute />)} />
|
||||||
{/* ── PR6a: ⌘K-only static surfaces ── */}
|
{/* ── PR6a: ⌘K-only static surface ── */}
|
||||||
<Route path="benchmarks" element={routeElement(<BenchmarkRoute />)} />
|
|
||||||
<Route path="platform" element={routeElement(<PlatformRoute />)} />
|
<Route path="platform" element={routeElement(<PlatformRoute />)} />
|
||||||
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
|
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
|
||||||
<Route path="*" element={<NotFound />} />
|
<Route path="*" element={<NotFound />} />
|
||||||
|
|||||||
@@ -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(<BenchmarkApp />);
|
|
||||||
// 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(<BenchmarkApp />);
|
|
||||||
// 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(<BenchmarkApp />);
|
|
||||||
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(<BenchmarkApp />);
|
|
||||||
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();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -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 · <b className="text-foreground font-semibold">z = 4.64, p < 10⁻⁵</b></> },
|
|
||||||
{ value: '92.27%', label: <>single-hop recall, <b className="text-foreground font-semibold">~1pt off the full-context ceiling</b></> },
|
|
||||||
{ value: '100%', label: <>local: warm recalls in <b className="text-foreground font-semibold">58–83 ms</b>, on-device</> },
|
|
||||||
];
|
|
||||||
|
|
||||||
// ───────────────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
type View = 'caps' | 'memory';
|
|
||||||
|
|
||||||
const VIEW_LABELS: Record<View, React.ReactNode> = {
|
|
||||||
caps: <><b className="text-foreground font-semibold">Capabilities</b>: where Waggle sits vs the field</>,
|
|
||||||
memory: <><b className="text-foreground font-semibold">Memory SOTA</b>: the one head-to-head lab result</>,
|
|
||||||
};
|
|
||||||
|
|
||||||
const MARK_GLYPH: Record<Mark, string> = { 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 (
|
|
||||||
<div
|
|
||||||
className="mt-4 flex items-start gap-3 rounded-xl px-4 py-3.5"
|
|
||||||
style={{ background: 'var(--bg-2)', border: '1px solid var(--line-soft)' }}
|
|
||||||
>
|
|
||||||
<Info className="w-4 h-4 mt-0.5 shrink-0" style={{ color: 'var(--text-muted, hsl(var(--muted-foreground)))' }} />
|
|
||||||
<p className="text-xs leading-relaxed text-muted-foreground m-0">{children}</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const BenchmarkApp = () => {
|
|
||||||
const [view, setView] = useState<View>('caps');
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="flex flex-col h-full">
|
|
||||||
{/* Controls bar — segmented toggle + live view label */}
|
|
||||||
<div className="flex items-center gap-3 px-5 py-3 border-b border-border/40 shrink-0">
|
|
||||||
<BarChart3 className="w-5 h-5" style={{ color: 'var(--honey)' }} />
|
|
||||||
<span className="font-mono text-[10.5px] uppercase tracking-[0.12em] text-muted-foreground hidden sm:inline">
|
|
||||||
Benchmarks · view
|
|
||||||
</span>
|
|
||||||
<div
|
|
||||||
role="tablist"
|
|
||||||
aria-label="Benchmark view"
|
|
||||||
className="inline-flex gap-1 p-[3px] rounded-[10px]"
|
|
||||||
style={{ background: 'var(--secondary, hsl(var(--secondary)))', border: '1px solid var(--line-soft)' }}
|
|
||||||
>
|
|
||||||
{(['caps', 'memory'] as View[]).map(v => (
|
|
||||||
<button
|
|
||||||
key={v}
|
|
||||||
role="tab"
|
|
||||||
aria-selected={view === v}
|
|
||||||
onClick={() => setView(v)}
|
|
||||||
className={`text-[12.5px] font-display font-semibold px-3 py-1.5 rounded-md transition-colors whitespace-nowrap ${
|
|
||||||
view === v ? '' : 'text-muted-foreground hover:text-foreground'
|
|
||||||
}`}
|
|
||||||
style={view === v ? { background: 'var(--honey)', color: '#1a1407' } : undefined}
|
|
||||||
>
|
|
||||||
{v === 'caps' ? 'vs competitors' : 'Memory SOTA'}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<span className="text-[12.5px] text-muted-foreground ml-1 hidden md:inline">{VIEW_LABELS[view]}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Stage */}
|
|
||||||
<div className="flex-1 min-h-0 overflow-auto" tabIndex={0} role="region" aria-label="Benchmark content">
|
|
||||||
<div className="max-w-[1000px] mx-auto px-8 py-7 pb-16">
|
|
||||||
{view === 'caps' ? <CapabilitiesView /> : <MemorySotaView />}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
function CapabilitiesView() {
|
|
||||||
return (
|
|
||||||
<div role="tabpanel" aria-label="Capabilities">
|
|
||||||
<header className="mb-6">
|
|
||||||
<div
|
|
||||||
className="font-mono text-[11px] uppercase tracking-[0.14em] mb-3 flex items-center gap-2.5"
|
|
||||||
style={{ color: 'var(--honey)' }}
|
|
||||||
>
|
|
||||||
<span className="inline-block w-5 h-px" style={{ background: 'var(--honey-line)' }} aria-hidden="true" />
|
|
||||||
How we're different
|
|
||||||
</div>
|
|
||||||
<h1 className="text-[28px] font-display font-semibold tracking-tight leading-tight m-0 mb-2.5 text-foreground">
|
|
||||||
They automate tasks. <em className="not-italic" style={{ color: 'var(--honey)' }}>Waggle remembers you.</em>
|
|
||||||
</h1>
|
|
||||||
<p className="text-[15px] text-muted-foreground leading-relaxed m-0 max-w-[64ch]">
|
|
||||||
The strong agents today are <b className="text-foreground font-medium">terminal coding tools</b> for engineers.
|
|
||||||
Waggle plays a different game: a <b className="text-foreground font-medium">persistent, local-first memory layer</b> for
|
|
||||||
knowledge workers that even <b className="text-foreground font-medium">runs those agents inside it</b>. Here's the
|
|
||||||
honest lay of the land.
|
|
||||||
</p>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
{/* Two framing cards */}
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mb-7">
|
|
||||||
<article
|
|
||||||
className="p-5 rounded-2xl"
|
|
||||||
style={{ background: 'var(--card, hsl(var(--card)))', border: '1px solid var(--line-soft)' }}
|
|
||||||
>
|
|
||||||
<div className="font-mono text-[10px] uppercase tracking-[0.1em] mb-2.5 text-muted-foreground">The field</div>
|
|
||||||
<h2 className="text-lg font-display font-semibold tracking-tight m-0 mb-2 text-foreground">Task agents</h2>
|
|
||||||
<p className="m-0 text-[13px] text-muted-foreground leading-relaxed">
|
|
||||||
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.
|
|
||||||
</p>
|
|
||||||
<div className="mt-3 text-[11.5px] text-muted-foreground/80">
|
|
||||||
<b className="text-foreground/90 font-medium">Claude Code · Codex · Claude Cowork · Hermes · Odysseus</b>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
<article
|
|
||||||
className="p-5 rounded-2xl"
|
|
||||||
style={{
|
|
||||||
border: '1px solid var(--honey-line)',
|
|
||||||
background: 'linear-gradient(155deg, var(--secondary, hsl(var(--secondary))), var(--card, hsl(var(--card))))',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="font-mono text-[10px] uppercase tracking-[0.1em] mb-2.5" style={{ color: 'var(--honey)' }}>
|
|
||||||
Our category
|
|
||||||
</div>
|
|
||||||
<h2 className="text-lg font-display font-semibold tracking-tight m-0 mb-2 text-foreground">
|
|
||||||
A memory layer + workspace
|
|
||||||
</h2>
|
|
||||||
<p className="m-0 text-[13px] text-muted-foreground leading-relaxed">
|
|
||||||
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.
|
|
||||||
</p>
|
|
||||||
<div className="mt-3 text-[11.5px] text-muted-foreground/80">
|
|
||||||
<b className="text-foreground/90 font-medium">Waggle</b>: complements them, doesn't compete head-on
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Capability matrix */}
|
|
||||||
<div
|
|
||||||
className="rounded-2xl overflow-hidden"
|
|
||||||
style={{ background: 'var(--card, hsl(var(--card)))', border: '1px solid var(--line-soft)' }}
|
|
||||||
>
|
|
||||||
<table className="w-full border-collapse">
|
|
||||||
<caption className="sr-only">Capability comparison: Waggle versus task agents</caption>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th
|
|
||||||
scope="col"
|
|
||||||
className="text-left text-[13px] font-semibold p-3 w-[32%] text-foreground"
|
|
||||||
style={{ borderBottom: '1px solid var(--line-soft)', background: 'var(--secondary, hsl(var(--secondary)))' }}
|
|
||||||
>
|
|
||||||
Capability
|
|
||||||
</th>
|
|
||||||
<th
|
|
||||||
scope="col"
|
|
||||||
className="text-center text-[11.5px] font-semibold p-3"
|
|
||||||
style={{
|
|
||||||
color: 'var(--honey)',
|
|
||||||
borderBottom: '1px solid var(--line-soft)',
|
|
||||||
background: 'color-mix(in srgb, var(--honey) 7%, transparent)',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Waggle
|
|
||||||
</th>
|
|
||||||
{COMPETITORS.map(c => (
|
|
||||||
<th
|
|
||||||
key={c.name}
|
|
||||||
scope="col"
|
|
||||||
className="text-center text-[11.5px] font-semibold p-3 text-foreground/90"
|
|
||||||
style={{ borderBottom: '1px solid var(--line-soft)', background: 'var(--secondary, hsl(var(--secondary)))' }}
|
|
||||||
>
|
|
||||||
<span className="whitespace-nowrap">{c.name}</span>
|
|
||||||
<span className="block font-mono font-normal text-[9.5px] mt-0.5 text-muted-foreground/70">{c.sub}</span>
|
|
||||||
</th>
|
|
||||||
))}
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{CAPABILITY_MATRIX.map((row, rowIdx) => {
|
|
||||||
const isLast = rowIdx === CAPABILITY_MATRIX.length - 1;
|
|
||||||
return (
|
|
||||||
<tr key={row.capability}>
|
|
||||||
<th
|
|
||||||
scope="row"
|
|
||||||
className="text-left text-[13px] font-normal p-3 w-[32%]"
|
|
||||||
style={{ borderBottom: '1px solid var(--line-soft)', color: 'var(--text-2)' }}
|
|
||||||
>
|
|
||||||
{row.capability}
|
|
||||||
</th>
|
|
||||||
{row.marks.map((mark, colIdx) => {
|
|
||||||
const isUs = colIdx === 0;
|
|
||||||
return (
|
|
||||||
<td
|
|
||||||
key={colIdx}
|
|
||||||
className="text-center p-3"
|
|
||||||
aria-label={mark === 'Y' ? 'Yes' : mark === 'P' ? 'Partial' : 'No'}
|
|
||||||
style={{
|
|
||||||
borderBottom: isUs && isLast ? '1px solid var(--honey-line)' : '1px solid var(--line-soft)',
|
|
||||||
...(isUs
|
|
||||||
? {
|
|
||||||
background: 'color-mix(in srgb, var(--honey) 7%, transparent)',
|
|
||||||
borderLeft: '1px solid var(--honey-line)',
|
|
||||||
borderRight: '1px solid var(--honey-line)',
|
|
||||||
}
|
|
||||||
: {}),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
className={`inline-grid place-items-center w-[22px] h-[22px] text-[13px] ${markClass(mark, isUs)}`}
|
|
||||||
style={markStyle(mark, isUs)}
|
|
||||||
>
|
|
||||||
{MARK_GLYPH[mark]}
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Legend */}
|
|
||||||
<div className="flex flex-wrap gap-4 mt-4 text-[12.5px] text-muted-foreground">
|
|
||||||
<span className="inline-flex items-center gap-1.5">
|
|
||||||
<span style={{ color: 'var(--healthy)' }}>●</span>Yes
|
|
||||||
</span>
|
|
||||||
<span className="inline-flex items-center gap-1.5">
|
|
||||||
<span style={{ color: 'var(--attention)' }}>◐</span>Partial / limited
|
|
||||||
</span>
|
|
||||||
<span className="inline-flex items-center gap-1.5">
|
|
||||||
<span style={{ color: 'var(--text-2)' }}>○</span>No / not the focus
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Disclaimer>
|
|
||||||
<b className="text-foreground/90 font-medium">This is a positioning view, not a lab benchmark</b>: 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 <b className="text-foreground/90 font-medium">launches them</b>{' '}
|
|
||||||
rather than replacing them. The one head-to-head lab result is the memory benchmark → see “Memory SOTA”.
|
|
||||||
</Disclaimer>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function MemorySotaView() {
|
|
||||||
const maxValue = Math.max(...MEMORY_BARS.map(b => b.value));
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div role="tabpanel" aria-label="Memory SOTA">
|
|
||||||
<header className="mb-6">
|
|
||||||
<div
|
|
||||||
className="font-mono text-[11px] uppercase tracking-[0.14em] mb-3 flex items-center gap-2.5"
|
|
||||||
style={{ color: 'var(--honey)' }}
|
|
||||||
>
|
|
||||||
<span className="inline-block w-5 h-px" style={{ background: 'var(--honey-line)' }} aria-hidden="true" />
|
|
||||||
State of the art · LoCoMo · June 2026
|
|
||||||
</div>
|
|
||||||
<h1 className="text-[28px] font-display font-semibold tracking-tight leading-tight m-0 mb-2.5 text-foreground">
|
|
||||||
The best long-term memory <em className="not-italic" style={{ color: 'var(--honey)' }}>on record.</em>
|
|
||||||
</h1>
|
|
||||||
<p className="text-[15px] text-muted-foreground leading-relaxed m-0 max-w-[64ch]">
|
|
||||||
On <b className="text-foreground font-medium">LoCoMo</b> (the standard test for long-term conversational memory),
|
|
||||||
Waggle's open-source substrate scores <b className="text-foreground font-medium">86.49%</b>, a new state of the
|
|
||||||
art, measured under the prior leader's own protocol and judge.
|
|
||||||
</p>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
{/* LoCoMo bars */}
|
|
||||||
<div className="grid gap-3 mt-2">
|
|
||||||
{MEMORY_BARS.map(bar => (
|
|
||||||
<div
|
|
||||||
key={bar.name}
|
|
||||||
className="grid items-center gap-4"
|
|
||||||
style={{ gridTemplateColumns: '180px 1fr 64px' }}
|
|
||||||
>
|
|
||||||
<div className="text-[13.5px] font-semibold text-right leading-tight text-foreground">
|
|
||||||
{bar.name}
|
|
||||||
<small className="block font-normal font-mono text-[10.5px] mt-0.5 text-muted-foreground/70">{bar.note}</small>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="h-[34px] rounded-[9px] overflow-hidden"
|
|
||||||
role="img"
|
|
||||||
aria-label={`${bar.name}: ${bar.value} percent`}
|
|
||||||
style={{ background: 'var(--card, hsl(var(--card)))', border: '1px solid var(--line-soft)' }}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="h-full rounded-l-lg"
|
|
||||||
style={{
|
|
||||||
width: `${(bar.value / maxValue) * 100}%`,
|
|
||||||
...(bar.us
|
|
||||||
? {
|
|
||||||
background: 'linear-gradient(90deg, var(--honey-deep), var(--honey-bright))',
|
|
||||||
boxShadow: 'var(--shadow-honey)',
|
|
||||||
}
|
|
||||||
: { background: 'var(--muted, hsl(var(--muted)))' }),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="font-mono text-sm font-semibold"
|
|
||||||
style={{ color: bar.us ? 'var(--honey)' : 'var(--text-2)' }}
|
|
||||||
>
|
|
||||||
{bar.value}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Stat chips */}
|
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-3 gap-3.5 my-6">
|
|
||||||
{MEMORY_STATS.map((stat, i) => (
|
|
||||||
<div
|
|
||||||
key={i}
|
|
||||||
className="p-5 rounded-2xl"
|
|
||||||
style={{ background: 'var(--card, hsl(var(--card)))', border: '1px solid var(--line-soft)' }}
|
|
||||||
>
|
|
||||||
<div className="text-[32px] font-display font-extrabold tracking-tight" style={{ color: 'var(--honey)' }}>
|
|
||||||
{stat.value}
|
|
||||||
</div>
|
|
||||||
<div className="text-[13px] text-muted-foreground mt-1.5">{stat.label}</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Disclaimer>
|
|
||||||
<b className="text-foreground/90 font-medium">LoCoMo</b>, 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 <b className="text-foreground/90 font-medium">memory layer, not the model</b>, so it travels onto a small local
|
|
||||||
model too. Honest caveat: higher token use per question than the leanest systems; efficiency work underway.
|
|
||||||
</Disclaimer>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default BenchmarkApp;
|
|
||||||
@@ -40,7 +40,7 @@ interface RoomAppProps {
|
|||||||
|
|
||||||
// Warm-token status styling (D21): the live SSE roster maps to semantic vars,
|
// 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
|
// 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<RoomAgent['status'], { background: string }> = {
|
const STATUS_DOT_STYLE: Record<RoomAgent['status'], { background: string }> = {
|
||||||
pending: { background: 'var(--text-dim)' },
|
pending: { background: 'var(--text-dim)' },
|
||||||
running: { background: 'var(--honey)' },
|
running: { background: 'var(--honey)' },
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
import { useSearchParams } from 'react-router-dom';
|
import { useSearchParams } from 'react-router-dom';
|
||||||
|
import { DEFAULT_DATA_DIR_LABEL } from '@waggle/shared';
|
||||||
import {
|
import {
|
||||||
Cpu, Shield, Palette, Save, Loader2, Database,
|
Cpu, Shield, Palette, Save, Loader2, Database,
|
||||||
Download, Upload, Wrench, DollarSign, Key, Lock, BarChart3, Trash2,
|
Download, Upload, Wrench, DollarSign, Key, Lock, BarChart3, Trash2,
|
||||||
@@ -916,7 +917,7 @@ const SettingsApp = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="p-3 rounded-xl bg-secondary/30 border border-border/30">
|
<div className="p-3 rounded-xl bg-secondary/30 border border-border/30">
|
||||||
<p className="text-xs font-display font-medium text-foreground mb-1">Data Directory</p>
|
<p className="text-xs font-display font-medium text-foreground mb-1">Data Directory</p>
|
||||||
<p className="text-[11px] text-muted-foreground font-mono">~/.waggle/</p>
|
<p className="text-[11px] text-muted-foreground font-mono">{DEFAULT_DATA_DIR_LABEL}/</p>
|
||||||
<p className="text-[11px] text-muted-foreground mt-1">All workspaces, memory, vault, and config live here.</p>
|
<p className="text-[11px] text-muted-foreground mt-1">All workspaces, memory, vault, and config live here.</p>
|
||||||
</div>
|
</div>
|
||||||
<BrowserCompanionSettings />
|
<BrowserCompanionSettings />
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useState, useEffect, useRef } from 'react';
|
import { useState, useEffect, useRef } from 'react';
|
||||||
|
import { DEFAULT_DATA_DIR_LABEL } from '@waggle/shared';
|
||||||
import {
|
import {
|
||||||
Lock, Plus, Trash2, Eye, EyeOff, Loader2, Key, Plug, ExternalLink,
|
Lock, Plus, Trash2, Eye, EyeOff, Loader2, Key, Plug, ExternalLink,
|
||||||
Shield, ChevronDown, ChevronRight, RefreshCw, CheckCircle2, User, Pencil,
|
Shield, ChevronDown, ChevronRight, RefreshCw, CheckCircle2, User, Pencil,
|
||||||
@@ -264,7 +265,7 @@ const VaultApp = () => {
|
|||||||
<p>
|
<p>
|
||||||
<strong className="text-honey">The Vault is the single source for API keys.</strong>
|
<strong className="text-honey">The Vault is the single source for API keys.</strong>
|
||||||
{' '}Values are encrypted with <strong>AES-256-GCM</strong> and stored locally at{' '}
|
{' '}Values are encrypted with <strong>AES-256-GCM</strong> and stored locally at{' '}
|
||||||
<code className="px-1 py-0.5 rounded bg-muted text-[10px] text-honey">~/.waggle/vault</code>.
|
<code className="px-1 py-0.5 rounded bg-muted text-[10px] text-honey">{DEFAULT_DATA_DIR_LABEL}/vault</code>.
|
||||||
</p>
|
</p>
|
||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
Keys never leave your machine, never appear in logs, and are only decrypted in-memory when the LLM SDK needs them. Clicking <strong>Reveal</strong> shows the value for 10 seconds, then auto-hides.
|
Keys never leave your machine, never appear in logs, and are only decrypted in-memory when the LLM SDK needs them. Clicking <strong>Reveal</strong> shows the value for 10 seconds, then auto-hides.
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { adapter } from '@/lib/adapter';
|
|||||||
* Contracts honoured:
|
* Contracts honoured:
|
||||||
* - C13: create-to-local only (POST /api/skills/create — marketplace publish
|
* - C13: create-to-local only (POST /api/skills/create — marketplace publish
|
||||||
* lives in the Hub). Create == installed: the file lands in
|
* 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" /
|
* - C14: inputs/outputs serialize into the markdown BODY ("## Inputs" /
|
||||||
* "## Outputs") — no frontmatter extension. The create route only accepts
|
* "## Outputs") — no frontmatter extension. The create route only accepts
|
||||||
* name/description/steps/category, so the sections are appended with a
|
* name/description/steps/category, so the sections are appended with a
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ export const useOnboarding = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// CC Sesija A §2.3 A11: Tauri filesystem-flag fast-path for returning users.
|
// 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).
|
// has completed onboarding before (even if this WebView profile is fresh).
|
||||||
// Auto-completes the wizard in that case. Complementary to the workspaces-
|
// Auto-completes the wizard in that case. Complementary to the workspaces-
|
||||||
// check below — flag is faster + doesn't need sidecar; either trigger is
|
// check below — flag is faster + doesn't need sidecar; either trigger is
|
||||||
@@ -285,7 +285,7 @@ export const useOnboarding = () => {
|
|||||||
adapter.markOnboardingComplete().catch((err) => {
|
adapter.markOnboardingComplete().catch((err) => {
|
||||||
console.warn('[useOnboarding] markOnboardingComplete failed:', 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
|
// installs share the same file; the IPC path works even when the
|
||||||
// sidecar is mid-restart).
|
// sidecar is mid-restart).
|
||||||
if (isTauri()) {
|
if (isTauri()) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
Plus, Rocket, Settings,
|
Plus, Rocket, Settings,
|
||||||
Server, Plug, Store, Package, Shield, Clock, FolderOpen,
|
Server, Plug, Store, Package, Shield, Clock, FolderOpen,
|
||||||
Lock, Activity, History, BarChart3, Users, Radio,
|
Lock, Activity, History, BarChart3, Users, Radio,
|
||||||
Gauge, Monitor, LayoutGrid, Eye,
|
Monitor, LayoutGrid, Eye,
|
||||||
} from "lucide-react";
|
} 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: "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: "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: "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" },
|
{ id: "platform", group: "power", name: "Platform & roadmap", subtitle: "desktop · what's coming", icon: Monitor, to: "/platform" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ const ROUTE_LABELS: Record<string, string> = {
|
|||||||
marketplace: 'Marketplace',
|
marketplace: 'Marketplace',
|
||||||
launcher: 'Launcher',
|
launcher: 'Launcher',
|
||||||
settings: 'Settings',
|
settings: 'Settings',
|
||||||
benchmarks: 'Benchmarks',
|
|
||||||
platform: 'Platform',
|
platform: 'Platform',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ export function listenAgentEnd(
|
|||||||
|
|
||||||
// ─── onboarding (A10) ──────────────────────────────────────────────────────
|
// ─── onboarding (A10) ──────────────────────────────────────────────────────
|
||||||
// CC Sesija A §2.3 Task A10. First-launch detection via Rust-managed
|
// 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
|
// unlike browser localStorage). useOnboarding still uses localStorage for the
|
||||||
// per-step state shape; these commands gate the initial wizard show/hide
|
// per-step state shape; these commands gate the initial wizard show/hide
|
||||||
// decision in Tauri builds.
|
// decision in Tauri builds.
|
||||||
|
|||||||
@@ -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 = () => (
|
|
||||||
<SurfaceBoundary appName="Benchmarks">
|
|
||||||
<BenchmarkApp />
|
|
||||||
</SurfaceBoundary>
|
|
||||||
);
|
|
||||||
|
|
||||||
export default BenchmarkRoute;
|
|
||||||
@@ -49,8 +49,7 @@ export { default as MissionControlRoute } from './MissionControlRoute';
|
|||||||
export { default as TimelineRoute } from './TimelineRoute';
|
export { default as TimelineRoute } from './TimelineRoute';
|
||||||
export { default as EventsRoute } from './EventsRoute';
|
export { default as EventsRoute } from './EventsRoute';
|
||||||
export { default as UsageRoute } from './UsageRoute';
|
export { default as UsageRoute } from './UsageRoute';
|
||||||
// PR6a — ⌘K-only static surfaces (Benchmarks · Platform)
|
// PR6a — ⌘K-only static surface (Platform)
|
||||||
export { default as BenchmarkRoute } from './BenchmarkRoute';
|
|
||||||
export { default as PlatformRoute } from './PlatformRoute';
|
export { default as PlatformRoute } from './PlatformRoute';
|
||||||
export { default as WorkspacesRoute } from './WorkspacesRoute';
|
export { default as WorkspacesRoute } from './WorkspacesRoute';
|
||||||
// PR7b — pre-shell /auth route (sibling outside AppShell)
|
// PR7b — pre-shell /auth route (sibling outside AppShell)
|
||||||
|
|||||||
@@ -127,7 +127,8 @@ loads the `apps/web` build. The shell:
|
|||||||
|
|
||||||
## Data
|
## 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.
|
lists what it contains.
|
||||||
|
|
||||||
- **Memory** goes only through `MemoryStore` (`@waggle/memory-contract`). The shipped store keeps
|
- **Memory** goes only through `MemoryStore` (`@waggle/memory-contract`). The shipped store keeps
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ set of skills for working with other people; it does not need team mode.
|
|||||||
|
|
||||||
## Writing your own skill
|
## Writing your own skill
|
||||||
|
|
||||||
A skill is a Markdown file in `<data>/skills/` (by default `~/.waggle/skills/`). Optional YAML
|
A skill is a Markdown file in `<data>/skills/` (by default `~/.waggle-community/skills/`). Optional YAML
|
||||||
frontmatter gives it a name and other metadata:
|
frontmatter gives it a name and other metadata:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
# Troubleshooting
|
# Troubleshooting
|
||||||
|
|
||||||
Common problems and what to do about them. Paths use `<data>` for the data directory:
|
Common problems and what to do about them. Paths use `<data>` 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
|
## Installing
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ sha256sum Waggle_<version>_amd64.deb
|
|||||||
|
|
||||||
The window shows "Starting Waggle…" while the app starts its own server in the background. The
|
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
|
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
|
### Update the desktop app
|
||||||
|
|
||||||
@@ -168,7 +169,7 @@ it. It listens on this computer only (`127.0.0.1`).
|
|||||||
|---|---|
|
|---|---|
|
||||||
| `--port <number>`, `-p` | Use another port (default 3333) |
|
| `--port <number>`, `-p` | Use another port (default 3333) |
|
||||||
| `--no-open` | Do not open the browser |
|
| `--no-open` | Do not open the browser |
|
||||||
| `--data-dir <path>` | Keep data in another directory (default `$WAGGLE_DATA_DIR` or `~/.waggle`) |
|
| `--data-dir <path>` | Keep data in another directory (default `$WAGGLE_DATA_DIR` or `~/.waggle-community`) |
|
||||||
| `--dir <path>` | Use a program directory other than the default |
|
| `--dir <path>` | Use a program directory other than the default |
|
||||||
|
|
||||||
If Waggle already runs on the port, `waggle-server` only opens the browser.
|
If Waggle already runs on the port, `waggle-server` only opens the browser.
|
||||||
@@ -244,9 +245,15 @@ send.
|
|||||||
|
|
||||||
## Where your data lives
|
## Where your data lives
|
||||||
|
|
||||||
Both ways of installing use one data directory: `~/.waggle` (on Windows
|
Both ways of installing use one data directory: `~/.waggle-community` (on Windows
|
||||||
`%USERPROFILE%\.waggle`). Set `WAGGLE_DATA_DIR` to use another directory; the server installer
|
`%USERPROFILE%\.waggle-community`). Set `WAGGLE_DATA_DIR` to use another directory; the server
|
||||||
also takes `--data-dir`.
|
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 |
|
| Path in the data directory | What it holds |
|
||||||
|---|---|
|
|---|---|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ A store reports what it can do, and the web UI hides what it cannot:
|
|||||||
|
|
||||||
## Where mem0 keeps its data
|
## 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 |
|
| File | Content |
|
||||||
|---|---|
|
|---|---|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# ADR-0009: The installer delivers a prebuilt server archive
|
# ADR-0009: The installer delivers a prebuilt server archive
|
||||||
|
|
||||||
- Status: Accepted
|
- Status: Accepted; point 4 superseded by ADR-0011
|
||||||
- Date: 2026-11-01
|
- Date: 2026-11-01
|
||||||
|
|
||||||
## Context
|
## Context
|
||||||
|
|||||||
47
docs/oss/adr/0011-separate-data-directory.md
Normal file
47
docs/oss/adr/0011-separate-data-directory.md
Normal file
@@ -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.
|
||||||
@@ -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 |
|
| [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 |
|
| [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 |
|
| [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 |
|
| [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
|
## Pending decisions
|
||||||
|
|
||||||
@@ -28,5 +29,4 @@ work packages wait for the answer.
|
|||||||
| Product name and system identifiers | Temporary names | P1.3d, P2.6 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| PostHog project for the community edition | See ADR-0006 | P1.3a |
|
||||||
|
|||||||
@@ -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
|
2. Start Waggle from the Start menu. The window should move past "Starting Waggle…" to the
|
||||||
Home screen.
|
Home screen.
|
||||||
3. If it stays on "Starting Waggle…", close it and take the log from
|
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.
|
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
|
## Troubleshooting
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
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
|
or in the directory named by `WAGGLE_MODELS_DIR`; the bench refuses network access and does
|
||||||
not download it.
|
not download it.
|
||||||
|
|
||||||
|
|||||||
@@ -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-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-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-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
|
## 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.
|
- 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.
|
- 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.
|
- 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 `<dataDir>/skills` and `<dataDir>/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()`.
|
||||||
|
|||||||
@@ -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.
|
* Loaded at startup and merged with built-in PERSONAS.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -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';
|
import fs from 'node:fs';
|
||||||
|
|||||||
@@ -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.
|
* If the file doesn't exist, returns silently — no error.
|
||||||
*
|
*
|
||||||
* Config format:
|
* Config format:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Skill-audit sidecar (Odysseus §D2).
|
* 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 — the sellable PRO artifact of the autonomous skill-audit loop
|
||||||
* (skill-audit.ts). DISTINCT from skill-hygiene.json (active|draft status):
|
* (skill-audit.ts). DISTINCT from skill-hygiene.json (active|draft status):
|
||||||
* a skill can be active AND unverified, or active AND verified. The audit
|
* a skill can be active AND unverified, or active AND verified. The audit
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Skill hygiene sidecar (Odysseus §D1).
|
* 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
|
* 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
|
* 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
|
* deletes the SKILL.md, so the proven content and its change-detection hash never
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* Pre-write redaction for authored skill content.
|
* Pre-write redaction for authored skill content.
|
||||||
*
|
*
|
||||||
* The closed-learning-loop (create_skill / auto_extract_skills) and the UI both
|
* 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
|
* 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"
|
* the model's context or the user's input. The loop's "strip secrets/paths"
|
||||||
* instruction was model-advisory only — this enforces it deterministically
|
* instruction was model-advisory only — this enforces it deterministically
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Walks the personal-scope skill directory and moves any SKILL.md file
|
* Walks the personal-scope skill directory and moves any SKILL.md file
|
||||||
* whose last-used timestamp (from skill-usage.json sidecar) is older than
|
* 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.
|
* decayFrames() behavior in packages/weaver/src/consolidation.ts.
|
||||||
*
|
*
|
||||||
* Retirement rules:
|
* Retirement rules:
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import { autoExtractAndCreateSkill, type AutoExtractMessage } from './skill-auto
|
|||||||
import { retireStaleSkills } from './skill-retirement.js';
|
import { retireStaleSkills } from './skill-retirement.js';
|
||||||
|
|
||||||
export interface SkillToolsDeps {
|
export interface SkillToolsDeps {
|
||||||
/** Path to ~/.waggle directory */
|
/** Path to ~/.waggle-community directory */
|
||||||
waggleHome: string;
|
waggleHome: string;
|
||||||
/** Callback to reload skills into agent state after changes */
|
/** Callback to reload skills into agent state after changes */
|
||||||
onSkillsChanged?: () => void;
|
onSkillsChanged?: () => void;
|
||||||
@@ -69,10 +69,10 @@ export interface SkillToolsDeps {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Skills 2.0 gap E: resolve the on-disk directory for a given scope.
|
* Skills 2.0 gap E: resolve the on-disk directory for a given scope.
|
||||||
* - personal: ~/.waggle/skills/
|
* - personal: ~/.waggle-community/skills/
|
||||||
* - workspace: ~/.waggle/workspaces/{workspaceId}/skills/
|
* - workspace: ~/.waggle-community/workspaces/{workspaceId}/skills/
|
||||||
* - team: ~/.waggle/teams/{teamId}/skills/
|
* - team: ~/.waggle-community/teams/{teamId}/skills/
|
||||||
* - enterprise: ~/.waggle/enterprise/skills/
|
* - enterprise: ~/.waggle-community/enterprise/skills/
|
||||||
*
|
*
|
||||||
* Returns null when the required context (workspaceId, teamId) is missing.
|
* 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',
|
name: 'retire_skills',
|
||||||
description:
|
description:
|
||||||
'Archive personal-scope skills that have not been used within the idle window. '
|
'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 '
|
+ 'Default max_idle_days is 90. Default dry_run is true — call with dry_run: false to '
|
||||||
+ 'actually move the files.',
|
+ 'actually move the files.',
|
||||||
parameters: {
|
parameters: {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Skills 2.0 gap F — skill usage tracking.
|
* 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
|
* installed skill was last referenced and how many times. Consumed by
|
||||||
* retireStaleSkills to decide which SKILL.md files to archive.
|
* retireStaleSkills to decide which SKILL.md files to archive.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import type { InstallAuditRecorder } from '@waggle/shared';
|
|||||||
|
|
||||||
/** Shared deps for every skill-write op. auditStore/onChange degrade gracefully. */
|
/** Shared deps for every skill-write op. auditStore/onChange degrade gracefully. */
|
||||||
export interface SkillWriteDeps {
|
export interface SkillWriteDeps {
|
||||||
/** Directory holding personal-scope SKILL.md files (~/.waggle/skills). */
|
/** Directory holding personal-scope SKILL.md files (~/.waggle-community/skills). */
|
||||||
skillsDir: string;
|
skillsDir: string;
|
||||||
/** Audit store — when present, every op records an install_audit row. */
|
/** Audit store — when present, every op records an install_audit row. */
|
||||||
auditStore?: InstallAuditRecorder;
|
auditStore?: InstallAuditRecorder;
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ async function detectFromManifest(m: ToolManifest, deps: ResolvedDeps): Promise<
|
|||||||
/**
|
/**
|
||||||
* Run every registered tool's detector in parallel and assemble the envelope.
|
* Run every registered tool's detector in parallel and assemble the envelope.
|
||||||
* The registry = built-in manifests (source of truth in @waggle/shared) +
|
* 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.
|
* deterministic (registry order) so the UI doesn't shuffle between calls.
|
||||||
*/
|
*/
|
||||||
export async function detectInstalledTools(
|
export async function detectInstalledTools(
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
* AI-OS #5 — declarative loader for third-party tool adapters from
|
* 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.
|
* PATH-detection only, never require()/eval. Never throws into detection.
|
||||||
*
|
*
|
||||||
* Validation is hand-rolled (not zod) to avoid adding a dependency to the agent
|
* 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
|
* package for one small flat schema; the safe-string refinement is the boundary
|
||||||
* defense against shell-metachar / path-traversal injection in adapter fields.
|
* 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 path from 'node:path';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import type { ToolManifest } from '@waggle/shared';
|
import type { ToolManifest } from '@waggle/shared';
|
||||||
@@ -58,7 +58,7 @@ export interface ManifestLoaderDeps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function loadThirdPartyManifests(deps: ManifestLoaderDeps = {}): ToolManifest[] {
|
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 readDir = deps.readDir ?? ((d) => fs.readdirSync(d));
|
||||||
const readFile = deps.readFile ?? ((p) => fs.readFileSync(p, 'utf8'));
|
const readFile = deps.readFile ?? ((p) => fs.readFileSync(p, 'utf8'));
|
||||||
let names: string[];
|
let names: string[];
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* in tool-calls, within-model paired, graded on correctness.
|
* in tool-calls, within-model paired, graded on correctness.
|
||||||
*
|
*
|
||||||
* Usage: tsx packages/agent/tests/eval/hermes-skill-reuse-eval.ts
|
* 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)
|
* HERMES_EVAL_N (override pair count; default = pilot 3)
|
||||||
* Output: tmp_hermes-skill-reuse.json (gitignored) + console verdict.
|
* 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 type { ToolDefinition } from '../../src/tools.js';
|
||||||
import { planSkillDistillation } from '../../src/skill-distillation.js';
|
import { planSkillDistillation } from '../../src/skill-distillation.js';
|
||||||
import { CostTracker, BudgetExceededError } from '../../src/cost-tracker.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 fs from 'node:fs';
|
||||||
import * as os from 'node:os';
|
import * as os from 'node:os';
|
||||||
import * as path from 'node:path';
|
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.
|
// the $5 pilot / $40 hard cap are enforced against this.
|
||||||
const MODEL_PRICING = { [MODEL]: { inputPer1k: 0.003, outputPer1k: 0.015 } };
|
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) ───────────────────────
|
// ── Forcing corpus (manifest §7 + Amendment 3) ───────────────────────
|
||||||
// Fictional, project-specific "Floruxa" subsystem. Facts are scattered
|
// Fictional, project-specific "Floruxa" subsystem. Facts are scattered
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* tsx packages/agent/tests/eval/prompt-assembler-eval.ts
|
* tsx packages/agent/tests/eval/prompt-assembler-eval.ts
|
||||||
*
|
*
|
||||||
* Environment:
|
* 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_SKIP_SECONDARY=1 — skip Gemma 4 26B MoE + Qwen3 secondary suites
|
||||||
* WAGGLE_EVAL_SEEDS — number of seeds per condition (default 3)
|
* WAGGLE_EVAL_SEEDS — number of seeds per condition (default 3)
|
||||||
*
|
*
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
* EVAL-RESULTS.md — human-readable summary (committed)
|
* EVAL-RESULTS.md — human-readable summary (committed)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { VaultStore } from '@waggle/core';
|
import { VaultStore, defaultDataDir } from '@waggle/core';
|
||||||
import {
|
import {
|
||||||
createInMemoryMemoryStore,
|
createInMemoryMemoryStore,
|
||||||
PERSONAL_SCOPE,
|
PERSONAL_SCOPE,
|
||||||
@@ -43,7 +43,7 @@ import { execFileSync } from 'node:child_process';
|
|||||||
|
|
||||||
// ── Config ──────────────────────────────────────────────────────────
|
// ── 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
|
// Use fileURLToPath to handle Windows file:// URLs correctly (avoids
|
||||||
// `/D:/...` leading-slash bug that produced `D:\D:\...` double-drive paths).
|
// `/D:/...` leading-slash bug that produced `D:\D:\...` double-drive paths).
|
||||||
const HARNESS_DIR = path.dirname(fileURLToPath(import.meta.url));
|
const HARNESS_DIR = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
* tsx packages/agent/tests/eval/prompt-assembler-v5-eval.ts
|
* tsx packages/agent/tests/eval/prompt-assembler-v5-eval.ts
|
||||||
*
|
*
|
||||||
* Environment:
|
* 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_SKIP_SECONDARY=1 — skip Gemma 4 26B MoE + Qwen thinking
|
||||||
* WAGGLE_EVAL_SEEDS — base seeds per condition (default 3)
|
* WAGGLE_EVAL_SEEDS — base seeds per condition (default 3)
|
||||||
* WAGGLE_EVAL_SKIP_SLUG_PROBE=1 — skip the pre-eval slug probe
|
* 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.
|
* judges are reachable, the eval halts and reports partial state.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { VaultStore } from '@waggle/core';
|
import { VaultStore, defaultDataDir } from '@waggle/core';
|
||||||
import {
|
import {
|
||||||
createInMemoryMemoryStore,
|
createInMemoryMemoryStore,
|
||||||
PERSONAL_SCOPE,
|
PERSONAL_SCOPE,
|
||||||
@@ -57,7 +57,7 @@ process.env.WAGGLE_EVAL_MODE = '1';
|
|||||||
|
|
||||||
// ── Config ──────────────────────────────────────────────────────────
|
// ── 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 HARNESS_DIR = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const REPO_ROOT = path.resolve(path.join(HARNESS_DIR, '..', '..', '..', '..'));
|
const REPO_ROOT = path.resolve(path.join(HARNESS_DIR, '..', '..', '..', '..'));
|
||||||
const RESULTS_JSON = path.join(REPO_ROOT, 'tmp_bench_results-v5.json');
|
const RESULTS_JSON = path.join(REPO_ROOT, 'tmp_bench_results-v5.json');
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ describe('Marketplace Commands', () => {
|
|||||||
// Mock install response
|
// Mock install response
|
||||||
fetchSpy.mockResolvedValueOnce(new Response(JSON.stringify({
|
fetchSpy.mockResolvedValueOnce(new Response(JSON.stringify({
|
||||||
success: true,
|
success: true,
|
||||||
message: 'Installed to ~/.waggle/skills/',
|
message: 'Installed to ~/.waggle-community/skills/',
|
||||||
}), { status: 200 }));
|
}), { status: 200 }));
|
||||||
|
|
||||||
const ctx = mockContext();
|
const ctx = mockContext();
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
* waggle --help Show help
|
* 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 {
|
function printHelp(): void {
|
||||||
console.log(`
|
console.log(`
|
||||||
Waggle CLI — interactive AI agent with persistent memory
|
Waggle CLI — interactive AI agent with persistent memory
|
||||||
@@ -17,7 +19,7 @@ Usage:
|
|||||||
waggle --help Show this help message
|
waggle --help Show this help message
|
||||||
|
|
||||||
Configuration:
|
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):
|
Commands (inside REPL):
|
||||||
/model <name> Switch model
|
/model <name> Switch model
|
||||||
|
|||||||
@@ -7,10 +7,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import readline from 'node:readline';
|
import readline from 'node:readline';
|
||||||
import os from 'node:os';
|
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import chalk from 'chalk';
|
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 { PERSONAL_SCOPE } from '@waggle/memory-contract';
|
||||||
import { createMem0MemoryStore } from '@waggle/memory-mem0';
|
import { createMem0MemoryStore } from '@waggle/memory-mem0';
|
||||||
import { Orchestrator, ModelRouter, runAgentLoop, createSystemTools, createPlanTools, createGitTools, Workspace, ensureIdentity, loadSystemPromptWithOverrides, loadSkills, CostTracker, HookRegistry, loadHooksFromConfig, needsConfirmation } from '@waggle/agent';
|
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<void> {
|
|||||||
const workspace = new Workspace(process.cwd());
|
const workspace = new Workspace(process.cwd());
|
||||||
workspace.init();
|
workspace.init();
|
||||||
|
|
||||||
// Load user customizations from ~/.waggle/.
|
// Load user customizations from the data directory.
|
||||||
const waggleHome = path.join(os.homedir(), '.waggle');
|
const waggleHome = defaultDataDir();
|
||||||
const composedPrompt = loadSystemPromptWithOverrides(waggleHome);
|
const composedPrompt = loadSystemPromptWithOverrides(waggleHome);
|
||||||
const userSystemPrompt = composedPrompt.userPromptMd;
|
const userSystemPrompt = composedPrompt.userPromptMd;
|
||||||
const skills = loadSkills(waggleHome);
|
const skills = loadSkills(waggleHome);
|
||||||
|
|
||||||
// Load user-configurable hooks from ~/.waggle/hooks.json
|
// Load user-configurable hooks from <data dir>/hooks.json
|
||||||
const hookRegistry = new HookRegistry();
|
const hookRegistry = new HookRegistry();
|
||||||
await loadHooksFromConfig(path.join(waggleHome, 'hooks.json'), hookRegistry);
|
await loadHooksFromConfig(path.join(waggleHome, 'hooks.json'), hookRegistry);
|
||||||
|
|
||||||
// The proxy for non-local models; local ollama/* models skip it (model-endpoint.ts).
|
// The proxy for non-local models; local ollama/* models skip it (model-endpoint.ts).
|
||||||
const wsConfig = workspace.getConfig();
|
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 <data dir>/memory.
|
||||||
const memory = await createMem0MemoryStore({
|
const memory = await createMem0MemoryStore({
|
||||||
directory: path.join(waggleHome, 'memory'),
|
directory: path.join(waggleHome, 'memory'),
|
||||||
embedder: createMemoryEmbedder({ cacheDir: path.join(waggleHome, 'models') }),
|
embedder: createMemoryEmbedder({ cacheDir: path.join(waggleHome, 'models') }),
|
||||||
@@ -176,7 +175,7 @@ export async function startRepl(options: ReplOptions = {}): Promise<void> {
|
|||||||
console.log(chalk.dim(' ') + chalk.cyan(m) + marker);
|
console.log(chalk.dim(' ') + chalk.cyan(m) + marker);
|
||||||
}
|
}
|
||||||
if (models.length === 0) {
|
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('');
|
console.log('');
|
||||||
break;
|
break;
|
||||||
@@ -333,9 +332,9 @@ When asked about current events, products, releases, docs, or anything you're no
|
|||||||
const errMsg = (err as Error).message;
|
const errMsg = (err as Error).message;
|
||||||
if (errMsg.includes('Unknown model')) {
|
if (errMsg.includes('Unknown model')) {
|
||||||
console.log(chalk.red(`Model "${currentModel}" is not configured.`));
|
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')) {
|
} 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 {
|
} else {
|
||||||
console.log(chalk.red(`Error: ${errMsg}`));
|
console.log(chalk.red(`Error: ${errMsg}`));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import type { AddressInfo } from 'node:net';
|
|||||||
import os from 'node:os';
|
import os from 'node:os';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { describe, expect, it } from 'vitest';
|
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 ROOT = path.resolve(import.meta.dirname, '..', '..', '..');
|
||||||
const CLI_DIR = path.join(ROOT, 'packages', 'cli');
|
const CLI_DIR = path.join(ROOT, 'packages', 'cli');
|
||||||
@@ -242,8 +243,9 @@ describe('@waggle/cli runtime UX', () => {
|
|||||||
expect(result.status).toBe(0);
|
expect(result.status).toBe(0);
|
||||||
expect(result.stdout).toContain('Waggle CLI');
|
expect(result.stdout).toContain('Waggle CLI');
|
||||||
expect(result.stdout).toContain('Usage:');
|
expect(result.stdout).toContain('Usage:');
|
||||||
|
expect(result.stdout).toContain(`${DEFAULT_DATA_DIR_LABEL}/config.json`);
|
||||||
expect(result.stderr).toBe('');
|
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 {
|
} finally {
|
||||||
fs.rmSync(home, { recursive: true, force: true });
|
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('Waggle CLI');
|
||||||
expect(result.stdout).toContain('Usage:');
|
expect(result.stdout).toContain('Usage:');
|
||||||
expect(result.stderr).toBe('');
|
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 {
|
} finally {
|
||||||
fs.rmSync(home, { recursive: true, force: true });
|
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('Waggle CLI');
|
||||||
expect(result.stdout).toContain('Usage:');
|
expect(result.stdout).toContain('Usage:');
|
||||||
expect(result.stderr).toBe('');
|
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 {
|
} finally {
|
||||||
fs.rmSync(home, { recursive: true, force: true });
|
fs.rmSync(home, { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
@@ -505,9 +507,11 @@ describe('@waggle/cli runtime UX', () => {
|
|||||||
expect(stdout).toContain('Goodbye!');
|
expect(stdout).toContain('Goodbye!');
|
||||||
expect(stderr).not.toContain('Fatal error');
|
expect(stderr).not.toContain('Fatal error');
|
||||||
// Memory (mem0) and Waggle's own database live in the data directory (ADR-0007).
|
// 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, DEFAULT_DATA_DIR_NAME, 'memory', 'waggle-memory.json'))).toBe(true);
|
||||||
expect(fs.existsSync(path.join(home, '.waggle', 'waggle.db'))).toBe(true);
|
expect(fs.existsSync(path.join(home, DEFAULT_DATA_DIR_NAME, '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, 'default.mind'))).toBe(false);
|
||||||
|
// ADR-0011: the commercial edition's directory stays untouched.
|
||||||
|
expect(fs.existsSync(path.join(home, '.waggle'))).toBe(false);
|
||||||
} finally {
|
} finally {
|
||||||
if (child) await stopProcess(child);
|
if (child) await stopProcess(child);
|
||||||
fs.rmSync(home, { recursive: true, force: true });
|
fs.rmSync(home, { recursive: true, force: true });
|
||||||
@@ -564,7 +568,7 @@ describe('@waggle/cli runtime UX', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mockLiteLlm = await startMockLiteLlm();
|
mockLiteLlm = await startMockLiteLlm();
|
||||||
const waggleHome = path.join(home, '.waggle');
|
const waggleHome = path.join(home, DEFAULT_DATA_DIR_NAME);
|
||||||
const workspaceConfigDir = path.join(projectDir, '.waggle');
|
const workspaceConfigDir = path.join(projectDir, '.waggle');
|
||||||
fs.mkdirSync(waggleHome, { recursive: true });
|
fs.mkdirSync(waggleHome, { recursive: true });
|
||||||
fs.mkdirSync(workspaceConfigDir, { recursive: true });
|
fs.mkdirSync(workspaceConfigDir, { recursive: true });
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import os from 'node:os';
|
import os from 'node:os';
|
||||||
|
import { DEFAULT_DATA_DIR_NAME } from '@waggle/shared';
|
||||||
import type { EmbeddingProviderConfig, EmbeddingProviderType } from './embeddings/embedding-provider.js';
|
import type { EmbeddingProviderConfig, EmbeddingProviderType } from './embeddings/embedding-provider.js';
|
||||||
|
|
||||||
export interface ProviderEntry {
|
export interface ProviderEntry {
|
||||||
@@ -14,7 +15,8 @@ export interface CliConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Keys the commercial edition writes (tier, trialStartedAt, teamServer) are not
|
// 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 {
|
interface ConfigData {
|
||||||
defaultModel: string;
|
defaultModel: string;
|
||||||
providers: Record<string, ProviderEntry>;
|
providers: Record<string, ProviderEntry>;
|
||||||
@@ -72,9 +74,17 @@ function getNonBlankEnv(name: string): string | undefined {
|
|||||||
return process.env[name]?.trim() || 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 {
|
function getDefaultConfigDir(): string {
|
||||||
const home = process.env.HOME || process.env.USERPROFILE || os.homedir();
|
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 {
|
export class WaggleConfig {
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
* In-process embedder using @huggingface/transformers (ONNX Runtime).
|
* In-process embedder using @huggingface/transformers (ONNX Runtime).
|
||||||
* Default provider for ALL desktop users — zero config, works offline.
|
* Default provider for ALL desktop users — zero config, works offline.
|
||||||
* Model: Xenova/all-MiniLM-L6-v2 (384 native dims, normalized to target dims).
|
* Model: Xenova/all-MiniLM-L6-v2 (384 native dims, normalized to target dims).
|
||||||
* Downloads ~90MB fp32 model on first use, cached in ~/.waggle/models/.
|
* Downloads ~90MB fp32 model on first use, cached in <data dir>/models/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import os from 'node:os';
|
import { defaultDataDir } from '../config.js';
|
||||||
import { createLazyEmbedder, type Embedder } from './embeddings.js';
|
import { createLazyEmbedder, type Embedder } from './embeddings.js';
|
||||||
import { createCoreLogger } from '../logger.js';
|
import { createCoreLogger } from '../logger.js';
|
||||||
import { withTransformersModelLoad } from './transformers-model-load.js';
|
import { withTransformersModelLoad } from './transformers-model-load.js';
|
||||||
@@ -32,7 +32,7 @@ export function normalizeDimensions(embedding: Float32Array, targetDims: number)
|
|||||||
|
|
||||||
export async function createInProcessEmbedder(config?: Partial<InProcessEmbedderConfig>): Promise<Embedder> {
|
export async function createInProcessEmbedder(config?: Partial<InProcessEmbedderConfig>): Promise<Embedder> {
|
||||||
const model = config?.model ?? DEFAULT_MODEL;
|
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;
|
const targetDims = config?.targetDimensions ?? 1024;
|
||||||
|
|
||||||
log.info(`Loading in-process embedding model: ${model} (~90MB fp32 first download)`);
|
log.info(`Loading in-process embedding model: ${model} (~90MB fp32 first download)`);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* Provides a clean interface for reading/writing workspace files that abstracts
|
* Provides a clean interface for reading/writing workspace files that abstracts
|
||||||
* over the underlying storage backend. Two implementations:
|
* 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)
|
* - LinkedDirStore: reads/writes to workspace.directory (linked to external folder)
|
||||||
*
|
*
|
||||||
* All operations enforce path traversal protection — files cannot escape
|
* All operations enforce path traversal protection — files cannot escape
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ export {
|
|||||||
} from './execution-traces.js';
|
} from './execution-traces.js';
|
||||||
|
|
||||||
// ── Waggle-specific orchestration ──
|
// ── 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 {
|
export {
|
||||||
CronStore, CRON_SCHEDULES_TABLE_SQL, CRON_RUN_LEASES_TABLE_SQL, VALID_JOB_TYPES, cronExprError,
|
CronStore, CRON_SCHEDULES_TABLE_SQL, CRON_RUN_LEASES_TABLE_SQL, VALID_JOB_TYPES, cronExprError,
|
||||||
type CronSchedule, type CreateScheduleInput, type CronJobType,
|
type CronSchedule, type CreateScheduleInput, type CronJobType,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import os from 'node:os';
|
import { defaultDataDir } from '../config.js';
|
||||||
import { createCoreLogger } from '../logger.js';
|
import { createCoreLogger } from '../logger.js';
|
||||||
import { withTransformersModelLoad } from '../embeddings/transformers-model-load.js';
|
import { withTransformersModelLoad } from '../embeddings/transformers-model-load.js';
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ export async function createInProcessReranker(
|
|||||||
config?: Partial<InProcessRerankerConfig>,
|
config?: Partial<InProcessRerankerConfig>,
|
||||||
): Promise<Reranker> {
|
): Promise<Reranker> {
|
||||||
const model = config?.model ?? 'Xenova/ms-marco-MiniLM-L-6-v2';
|
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)`);
|
log.info(`Loading in-process reranker: ${model} (~22MB first download)`);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TelemetryStore — local, privacy-first event tracking.
|
* 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.
|
* Default: OFF. User opts in via Settings toggle.
|
||||||
* No cloud reporting in M2 — data is queryable via local API only.
|
* No cloud reporting in M2 — data is queryable via local API only.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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
|
Supported systems: Windows x64, macOS (Apple silicon and Intel), Linux x64. You need Node.js
|
||||||
20 or newer only for the first `npx` call.
|
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 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`.
|
the release location is set, install from an archive with `--from`.
|
||||||
|
|||||||
@@ -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';
|
export type Command = 'install' | 'update' | 'run' | 'doctor' | 'uninstall' | 'help' | 'version';
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ export function formatHelp(version: string): string {
|
|||||||
--sha256 <hex> Expected SHA-256 of the archive
|
--sha256 <hex> Expected SHA-256 of the archive
|
||||||
--dir <path> Install directory
|
--dir <path> Install directory
|
||||||
--bin-dir <path> Where to put the ${COMMAND_NAME} command
|
--bin-dir <path> Where to put the ${COMMAND_NAME} command
|
||||||
--data-dir <path> Data directory (default: $WAGGLE_DATA_DIR or ~/.waggle)
|
--data-dir <path> Data directory (default: $WAGGLE_DATA_DIR or ~/${DATA_DIR_NAME})
|
||||||
--port, -p <number> Server port (default: ${DEFAULT_PORT})
|
--port, -p <number> Server port (default: ${DEFAULT_PORT})
|
||||||
--no-open Do not open the browser
|
--no-open Do not open the browser
|
||||||
--force Reinstall even when this version is installed
|
--force Reinstall even when this version is installed
|
||||||
|
|||||||
@@ -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. */
|
/** The command the installer puts on the PATH. A working name until the product name is decided. */
|
||||||
export const COMMAND_NAME = 'waggle-server';
|
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 {
|
export interface Host {
|
||||||
platform: NodeJS.Platform;
|
platform: NodeJS.Platform;
|
||||||
arch: string;
|
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');
|
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 {
|
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 {
|
export function isOnPath(host: Host, dir: string): boolean {
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ describe('platform paths', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('follows the sidecar data directory rule', () => {
|
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');
|
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', () => {
|
it('gives the server the environment the desktop shell gives it', () => {
|
||||||
const env = serviceEnvironment({
|
const env = serviceEnvironment({
|
||||||
appDir: '/opt/w/app',
|
appDir: '/opt/w/app',
|
||||||
dataDir: '/home/ana/.waggle',
|
dataDir: '/home/ana/.waggle-community',
|
||||||
port: 4000,
|
port: 4000,
|
||||||
platform: 'linux',
|
platform: 'linux',
|
||||||
baseEnv: { PATH: '/usr/bin', WAGGLE_DATA_DIR: '/stale' },
|
baseEnv: { PATH: '/usr/bin', WAGGLE_DATA_DIR: '/stale' },
|
||||||
@@ -119,8 +120,8 @@ describe('payload helpers', () => {
|
|||||||
WAGGLE_FRONTEND_DIR: '/opt/w/app/web',
|
WAGGLE_FRONTEND_DIR: '/opt/w/app/web',
|
||||||
NODE_PATH: '/opt/w/app/node_modules:/opt/w/app/native',
|
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',
|
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_PREFIX: '/home/ana/.waggle-community/npm/prefix',
|
||||||
NPM_CONFIG_CACHE: '/home/ana/.waggle/npm/cache',
|
NPM_CONFIG_CACHE: '/home/ana/.waggle-community/npm/cache',
|
||||||
});
|
});
|
||||||
expect(env.WAGGLE_DATA_DIR).toBeUndefined();
|
expect(env.WAGGLE_DATA_DIR).toBeUndefined();
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ The Waggle Marketplace is a **unified package catalog and installer** that aggre
|
|||||||
│ MarketplaceInstaller
|
│ MarketplaceInstaller
|
||||||
▼
|
▼
|
||||||
┌──────────────────────────────────────────────────────────────────────┐
|
┌──────────────────────────────────────────────────────────────────────┐
|
||||||
│ ~/.waggle/ (Runtime) │
|
│ ~/.waggle-community/ (Runtime) │
|
||||||
│ │
|
│ │
|
||||||
│ skills/ plugins/ .mcp.json │
|
│ skills/ plugins/ .mcp.json │
|
||||||
│ ├── code-review.md ├── registry.json mcpServers: │
|
│ ├── code-review.md ├── registry.json mcpServers: │
|
||||||
@@ -149,7 +149,7 @@ No installation needed. The SecurityGate calls Gen's free API endpoint at `https
|
|||||||
```bash
|
```bash
|
||||||
# The marketplace DB ships pre-populated with 120 seed packages.
|
# The marketplace DB ships pre-populated with 120 seed packages.
|
||||||
# Copy it to Waggle's runtime directory:
|
# Copy it to Waggle's runtime directory:
|
||||||
cp marketplace.db ~/.waggle/marketplace.db
|
cp marketplace.db ~/.waggle-community/marketplace.db
|
||||||
|
|
||||||
# Or build from scratch:
|
# Or build from scratch:
|
||||||
python3 build_waggle_marketplace_db.py
|
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
|
### 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 |
|
| Property | Value |
|
||||||
|----------|-------|
|
|----------|-------|
|
||||||
| File format | Markdown (`.md`) |
|
| 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 |
|
| How loaded | `loadSkills()` reads all `*.md` from skills dir |
|
||||||
| Where used | Appended to agent system prompt |
|
| Where used | Appended to agent system prompt |
|
||||||
| API endpoint | `PUT /api/skills/{name}` |
|
| API endpoint | `PUT /api/skills/{name}` |
|
||||||
@@ -373,7 +373,7 @@ waggle-market audit
|
|||||||
1. Resolve content (URL, GitHub raw, inline, or stub)
|
1. Resolve content (URL, GitHub raw, inline, or stub)
|
||||||
2. SECURITY GATE → scan content
|
2. SECURITY GATE → scan content
|
||||||
3. If blocked → reject, record in DB
|
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}
|
5. Notify server: PUT /api/skills/{name}
|
||||||
6. Record installation + scan results in DB
|
6. Record installation + scan results in DB
|
||||||
```
|
```
|
||||||
@@ -383,8 +383,8 @@ waggle-market audit
|
|||||||
| Property | Value |
|
| Property | Value |
|
||||||
|----------|-------|
|
|----------|-------|
|
||||||
| File format | Directory with `plugin.json` |
|
| File format | Directory with `plugin.json` |
|
||||||
| Install path | `~/.waggle/plugins/{name}/` |
|
| Install path | `~/.waggle-community/plugins/{name}/` |
|
||||||
| Registry | `~/.waggle/plugins/registry.json` |
|
| Registry | `~/.waggle-community/plugins/registry.json` |
|
||||||
| Manager | `@waggle/sdk` `PluginManager` class |
|
| Manager | `@waggle/sdk` `PluginManager` class |
|
||||||
| API endpoint | `POST /api/plugins/install` |
|
| API endpoint | `POST /api/plugins/install` |
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
* waggle-market info <name|id> Show package details
|
* waggle-market info <name|id> Show package details
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { DATA_DIR_NAME } from './data-dir.js';
|
||||||
import { MarketplaceDB } from './db.js';
|
import { MarketplaceDB } from './db.js';
|
||||||
import { MarketplaceInstaller } from './installer.js';
|
import { MarketplaceInstaller } from './installer.js';
|
||||||
import { MarketplaceSync } from './sync.js';
|
import { MarketplaceSync } from './sync.js';
|
||||||
@@ -412,7 +413,7 @@ async function main() {
|
|||||||
// Show current config
|
// Show current config
|
||||||
const gate = new SecurityGate();
|
const gate = new SecurityGate();
|
||||||
console.log('\n🔧 Security Configuration:');
|
console.log('\n🔧 Security Configuration:');
|
||||||
console.log(' (edit ~/.waggle/security-config.json or use waggle-market security-config <key> <value>)');
|
console.log(` (edit ~/${DATA_DIR_NAME}/security-config.json or use waggle-market security-config <key> <value>)`);
|
||||||
// Would read from security_config table
|
// Would read from security_config table
|
||||||
} else if (positionals.length >= 2) {
|
} else if (positionals.length >= 2) {
|
||||||
console.log(` Set ${positionals[0]} = ${positionals[1]}`);
|
console.log(` Set ${positionals[0]} = ${positionals[1]}`);
|
||||||
|
|||||||
8
packages/marketplace/src/data-dir.ts
Normal file
8
packages/marketplace/src/data-dir.ts
Normal file
@@ -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';
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
import Database from 'better-sqlite3';
|
import Database from 'better-sqlite3';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { homedir } from 'os';
|
import { homedir } from 'os';
|
||||||
|
import { DATA_DIR_NAME } from './data-dir.js';
|
||||||
import { seedMcpServers } from './mcp-registry.js';
|
import { seedMcpServers } from './mcp-registry.js';
|
||||||
import type {
|
import type {
|
||||||
MarketplacePackage,
|
MarketplacePackage,
|
||||||
@@ -21,7 +22,7 @@ import type {
|
|||||||
SearchSort,
|
SearchSort,
|
||||||
} from './types.js';
|
} 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 {
|
export class MarketplaceDB {
|
||||||
private db: Database.Database;
|
private db: Database.Database;
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
* Waggle Marketplace — Package Installer
|
* Waggle Marketplace — Package Installer
|
||||||
*
|
*
|
||||||
* Handles installation of skills, plugins, and MCP servers from the
|
* 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:
|
* 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.
|
* 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.
|
* Write plugin.json manifest, copy skill files, register in registry.json.
|
||||||
* Then call POST /api/plugins/install if server is running.
|
* Then call POST /api/plugins/install if server is running.
|
||||||
*
|
*
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
import { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, rmSync } from 'fs';
|
import { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, rmSync } from 'fs';
|
||||||
import { join, dirname, resolve } from 'path';
|
import { join, dirname, resolve } from 'path';
|
||||||
import { homedir } from 'os';
|
import { homedir } from 'os';
|
||||||
|
import { DATA_DIR_NAME } from './data-dir.js';
|
||||||
import { createHash } from 'node:crypto';
|
import { createHash } from 'node:crypto';
|
||||||
import { MarketplaceDB } from './db.js';
|
import { MarketplaceDB } from './db.js';
|
||||||
import { SecurityGate, type ScanResult, type SecurityGateConfig } from './security.js';
|
import { SecurityGate, type ScanResult, type SecurityGateConfig } from './security.js';
|
||||||
@@ -44,7 +45,7 @@ import type {
|
|||||||
PluginManifest,
|
PluginManifest,
|
||||||
} from './types.js';
|
} 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 SKILLS_DIR = join(WAGGLE_DIR, 'skills');
|
||||||
const PLUGINS_DIR = join(WAGGLE_DIR, 'plugins');
|
const PLUGINS_DIR = join(WAGGLE_DIR, 'plugins');
|
||||||
const REGISTRY_PATH = join(PLUGINS_DIR, 'registry.json');
|
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 <dataDir>/.mcp.json
|
// UX-Refactor Phase 4 (C4): the sidecar boot loader reads <dataDir>/.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.
|
// This previously wrote to process.cwd(), a file nothing ever read.
|
||||||
// Resolved at CALL time (not module import) so a host that sets
|
// 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.
|
// WAGGLE_DATA_DIR after this module loads still writes to the right place.
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from 'fs';
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from 'fs';
|
||||||
import { join, dirname } from 'path';
|
import { join, dirname } from 'path';
|
||||||
import { homedir } from 'os';
|
import { homedir } from 'os';
|
||||||
|
import { DATA_DIR_NAME } from './data-dir.js';
|
||||||
import { execFileSync } from 'child_process';
|
import { execFileSync } from 'child_process';
|
||||||
import { createHash } from 'crypto';
|
import { createHash } from 'crypto';
|
||||||
import type { MarketplacePackage, InstallManifest, McpServerConfig } from './types.js';
|
import type { MarketplacePackage, InstallManifest, McpServerConfig } from './types.js';
|
||||||
@@ -180,7 +181,7 @@ const DEFAULT_CONFIG: SecurityGateConfig = {
|
|||||||
allow_force_bypass: false,
|
allow_force_bypass: false,
|
||||||
gen_trust_hub_url: 'https://ai.gendigital.com/api/scan/lookup',
|
gen_trust_hub_url: 'https://ai.gendigital.com/api/scan/lookup',
|
||||||
cisco_scanner_args: ['--use-behavioral', '--format', 'json'],
|
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,
|
cache_ttl_hours: 24,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1108,6 +1109,7 @@ export class SecurityGate {
|
|||||||
const crossOrigin = [
|
const crossOrigin = [
|
||||||
/~\/\.claude\/(?:skills|plugins|hooks|commands)/i,
|
/~\/\.claude\/(?:skills|plugins|hooks|commands)/i,
|
||||||
/~\/\.waggle\/skills/i,
|
/~\/\.waggle\/skills/i,
|
||||||
|
new RegExp(`~/${DATA_DIR_NAME.replace(/\./g, '\\.')}/skills`, 'i'),
|
||||||
/CLAUDE\.md/i,
|
/CLAUDE\.md/i,
|
||||||
/\.cursorrules/i,
|
/\.cursorrules/i,
|
||||||
/write.*(?:CLAUDE\.md|\.cursorrules|settings\.json|hooks\/)/i,
|
/write.*(?:CLAUDE\.md|\.cursorrules|settings\.json|hooks\/)/i,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import fs from 'node:fs';
|
|||||||
import os from 'node:os';
|
import os from 'node:os';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { DATA_DIR_NAME } from '../src/data-dir.js';
|
||||||
|
|
||||||
const ROOT = path.resolve(import.meta.dirname, '..', '..', '..');
|
const ROOT = path.resolve(import.meta.dirname, '..', '..', '..');
|
||||||
const MARKETPLACE_DIR = path.join(ROOT, 'packages', 'marketplace');
|
const MARKETPLACE_DIR = path.join(ROOT, 'packages', 'marketplace');
|
||||||
@@ -50,7 +51,7 @@ function run(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function marketplaceDbExists(home: string): boolean {
|
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(): {
|
function readPackageJson(): {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { homedir, tmpdir } from 'node:os';
|
|||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
import { createHash, randomUUID } from 'node:crypto';
|
import { createHash, randomUUID } from 'node:crypto';
|
||||||
import { afterAll, afterEach, describe, expect, it, vi } from 'vitest';
|
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 { MarketplaceInstaller } from '../src/installer.js';
|
||||||
import {
|
import {
|
||||||
assertSafeGitUrl,
|
assertSafeGitUrl,
|
||||||
@@ -188,8 +189,8 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
|
|
||||||
it('rejects a caller-selected skill path inside the managed directory without overwriting it', async () => {
|
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')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const managedPath = join(isolatedHome, '.waggle', 'skills', 'existing.md');
|
const managedPath = join(isolatedHome, DATA_DIR_NAME, 'skills', 'existing.md');
|
||||||
mkdirSync(join(isolatedHome, '.waggle', 'skills'), { recursive: true });
|
mkdirSync(join(isolatedHome, DATA_DIR_NAME, 'skills'), { recursive: true });
|
||||||
writeFileSync(managedPath, '# keep', 'utf8');
|
writeFileSync(managedPath, '# keep', 'utf8');
|
||||||
const { installer, recordInstallation } = installerFor(packageFixture());
|
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 () => {
|
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')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const name = `existing-plugin-${randomUUID()}`;
|
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');
|
const sentinel = join(pluginDir, 'keep.txt');
|
||||||
mkdirSync(pluginDir, { recursive: true });
|
mkdirSync(pluginDir, { recursive: true });
|
||||||
writeFileSync(sentinel, 'keep', 'utf8');
|
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 () => {
|
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')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const registryPath = join(isolatedHome, '.waggle', 'plugins', 'registry.json');
|
const registryPath = join(isolatedHome, DATA_DIR_NAME, 'plugins', 'registry.json');
|
||||||
mkdirSync(join(isolatedHome, '.waggle', 'plugins'), { recursive: true });
|
mkdirSync(join(isolatedHome, DATA_DIR_NAME, 'plugins'), { recursive: true });
|
||||||
writeFileSync(registryPath, '{"keep":true}', 'utf8');
|
writeFileSync(registryPath, '{"keep":true}', 'utf8');
|
||||||
const { installer, recordInstallation } = installerFor(packageFixture({
|
const { installer, recordInstallation } = installerFor(packageFixture({
|
||||||
name: 'registry.json',
|
name: 'registry.json',
|
||||||
@@ -245,8 +246,8 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
|
|
||||||
it('rejects a case-insensitive alias of the reserved plugin registry path', async () => {
|
it('rejects a case-insensitive alias of the reserved plugin registry path', async () => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const registryPath = join(isolatedHome, '.waggle', 'plugins', 'registry.json');
|
const registryPath = join(isolatedHome, DATA_DIR_NAME, 'plugins', 'registry.json');
|
||||||
mkdirSync(join(isolatedHome, '.waggle', 'plugins'), { recursive: true });
|
mkdirSync(join(isolatedHome, DATA_DIR_NAME, 'plugins'), { recursive: true });
|
||||||
writeFileSync(registryPath, '{"keep":true}', 'utf8');
|
writeFileSync(registryPath, '{"keep":true}', 'utf8');
|
||||||
const { installer, recordInstallation } = installerFor(packageFixture({
|
const { installer, recordInstallation } = installerFor(packageFixture({
|
||||||
name: 'REGISTRY.JSON',
|
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 () => {
|
it('rejects a traversal identifier before a plugin can escape the plugins directory', async () => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const escapedName = `escaped-${randomUUID()}`;
|
const escapedName = `escaped-${randomUUID()}`;
|
||||||
const escapedPath = join(homedir(), '.waggle', escapedName);
|
const escapedPath = join(homedir(), DATA_DIR_NAME, escapedName);
|
||||||
cleanupPaths.push(escapedPath);
|
cleanupPaths.push(escapedPath);
|
||||||
const { installer, recordInstallation } = installerFor(packageFixture({
|
const { installer, recordInstallation } = installerFor(packageFixture({
|
||||||
name: `../${escapedName}`,
|
name: `../${escapedName}`,
|
||||||
@@ -285,7 +286,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
it('rejects an uncurated plugin git selector before clone execution', async () => {
|
it('rejects an uncurated plugin git selector before clone execution', async () => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const name = `git-plugin-${randomUUID()}`;
|
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({
|
const { installer } = installerFor(packageFixture({
|
||||||
name,
|
name,
|
||||||
package_type: 'plugin',
|
package_type: 'plugin',
|
||||||
@@ -303,7 +304,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
it('rejects a plugin git URL containing shell syntax before process launch', async () => {
|
it('rejects a plugin git URL containing shell syntax before process launch', async () => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const name = `git-injection-${randomUUID()}`;
|
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({
|
const { installer } = installerFor(packageFixture({
|
||||||
name,
|
name,
|
||||||
package_type: 'plugin',
|
package_type: 'plugin',
|
||||||
@@ -321,7 +322,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
it('rejects an uncurated plugin npm selector before lifecycle-script execution', async () => {
|
it('rejects an uncurated plugin npm selector before lifecycle-script execution', async () => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const name = `npm-plugin-${randomUUID()}`;
|
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({
|
const { installer } = installerFor(packageFixture({
|
||||||
name,
|
name,
|
||||||
package_type: 'plugin',
|
package_type: 'plugin',
|
||||||
@@ -345,7 +346,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
});
|
});
|
||||||
vi.stubGlobal('fetch', fetchMock);
|
vi.stubGlobal('fetch', fetchMock);
|
||||||
const name = `bundled-skill-${randomUUID()}`;
|
const name = `bundled-skill-${randomUUID()}`;
|
||||||
const pluginDir = join(homedir(), '.waggle', 'plugins', name);
|
const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name);
|
||||||
cleanupPaths.push(pluginDir);
|
cleanupPaths.push(pluginDir);
|
||||||
const { installer, getPackageByName, recordInstallation } = installerFor(packageFixture({
|
const { installer, getPackageByName, recordInstallation } = installerFor(packageFixture({
|
||||||
name,
|
name,
|
||||||
@@ -378,7 +379,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
it('preserves installation of inline skill content', async () => {
|
it('preserves installation of inline skill content', async () => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const name = `inline-skill-${randomUUID()}`;
|
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);
|
cleanupPaths.push(skillPath);
|
||||||
const { installer } = installerFor(packageFixture({
|
const { installer } = installerFor(packageFixture({
|
||||||
name,
|
name,
|
||||||
@@ -394,7 +395,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
|
|
||||||
it('installs the exact remote skill bytes that passed the security scan', async () => {
|
it('installs the exact remote skill bytes that passed the security scan', async () => {
|
||||||
const name = `remote-skill-${randomUUID()}`;
|
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);
|
cleanupPaths.push(skillPath);
|
||||||
const fetchMock = vi.fn()
|
const fetchMock = vi.fn()
|
||||||
.mockResolvedValueOnce(new Response('# Benign scanned skill'))
|
.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 () => {
|
it('rejects plugin npm package shell syntax before process launch', async () => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const name = `npm-injection-${randomUUID()}`;
|
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({
|
const { installer } = installerFor(packageFixture({
|
||||||
name,
|
name,
|
||||||
package_type: 'plugin',
|
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 () => {
|
it('rejects custom npm_args instead of treating catalog metadata as npm options', async () => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const name = `npm-args-${randomUUID()}`;
|
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({
|
const { installer } = installerFor(packageFixture({
|
||||||
name,
|
name,
|
||||||
package_type: 'plugin',
|
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 => {
|
])('rejects a non-empty $type post-install array before any side effect', async hook => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const name = `post-install-${randomUUID()}`;
|
const name = `post-install-${randomUUID()}`;
|
||||||
const pluginDir = join(homedir(), '.waggle', 'plugins', name);
|
const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name);
|
||||||
cleanupPaths.push(pluginDir);
|
cleanupPaths.push(pluginDir);
|
||||||
const { installer, recordInstallation } = installerFor(packageFixture({
|
const { installer, recordInstallation } = installerFor(packageFixture({
|
||||||
name,
|
name,
|
||||||
@@ -503,7 +504,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
it('preserves a plugin manifest containing an exact curated MCP profile', async () => {
|
it('preserves a plugin manifest containing an exact curated MCP profile', async () => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const name = `curated-mcp-plugin-${randomUUID()}`;
|
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);
|
cleanupPaths.push(pluginDir);
|
||||||
const curatedMcp = MCP_SERVERS.find(server => server.name === 'memory')!
|
const curatedMcp = MCP_SERVERS.find(server => server.name === 'memory')!
|
||||||
.install_manifest!.mcp_config!;
|
.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 () => {
|
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')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const name = `brave-plugin-${randomUUID()}`;
|
const name = `brave-plugin-${randomUUID()}`;
|
||||||
const pluginDir = join(homedir(), '.waggle', 'plugins', name);
|
const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name);
|
||||||
cleanupPaths.push(pluginDir);
|
cleanupPaths.push(pluginDir);
|
||||||
const braveConfig = MCP_SERVERS.find(server => server.name === 'brave-search')!
|
const braveConfig = MCP_SERVERS.find(server => server.name === 'brave-search')!
|
||||||
.install_manifest!.mcp_config!;
|
.install_manifest!.mcp_config!;
|
||||||
@@ -570,7 +571,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
|
|
||||||
it('rejects undeclared plugin executable capabilities before writing plugin files', async () => {
|
it('rejects undeclared plugin executable capabilities before writing plugin files', async () => {
|
||||||
const name = `plugin-tools-${randomUUID()}`;
|
const name = `plugin-tools-${randomUUID()}`;
|
||||||
const pluginDir = join(homedir(), '.waggle', 'plugins', name);
|
const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name);
|
||||||
cleanupPaths.push(pluginDir);
|
cleanupPaths.push(pluginDir);
|
||||||
const pluginManifest = {
|
const pluginManifest = {
|
||||||
name,
|
name,
|
||||||
@@ -723,7 +724,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
|
|
||||||
it('rejects an arbitrary launcher embedded in a marketplace plugin manifest', async () => {
|
it('rejects an arbitrary launcher embedded in a marketplace plugin manifest', async () => {
|
||||||
const name = `plugin-mcp-${randomUUID()}`;
|
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({
|
const { installer, recordInstallation } = installerFor(packageFixture({
|
||||||
name,
|
name,
|
||||||
package_type: 'plugin',
|
package_type: 'plugin',
|
||||||
@@ -829,13 +830,13 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
|
|
||||||
it('rejects an approved MCP manifest cloned under a noncanonical source', async () => {
|
it('rejects an approved MCP manifest cloned under a noncanonical source', async () => {
|
||||||
const brave = MCP_SERVERS.find(server => server.name === 'brave-search')!;
|
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({
|
const originalConfig = JSON.stringify({
|
||||||
mcpServers: {
|
mcpServers: {
|
||||||
existing: { command: 'existing-command', args: ['existing-arg'] },
|
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');
|
writeFileSync(configPath, originalConfig, 'utf8');
|
||||||
const customSource = sourceFixture({
|
const customSource = sourceFixture({
|
||||||
id: 77,
|
id: 77,
|
||||||
@@ -983,7 +984,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
|||||||
const scan = await installer.scanOnly(pkg.id);
|
const scan = await installer.scanOnly(pkg.id);
|
||||||
expect(scan).not.toBeNull();
|
expect(scan).not.toBeNull();
|
||||||
const expectedApprovalIdentity = MarketplaceInstaller.createApprovalIdentity(pkg, scan!);
|
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 });
|
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 () => {
|
it('does not delete outside the plugins directory when uninstalling a traversal identifier', async () => {
|
||||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||||
const escapedName = `uninstall-sentinel-${randomUUID()}`;
|
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');
|
const sentinel = join(escapedPath, 'keep.txt');
|
||||||
cleanupPaths.push(escapedPath);
|
cleanupPaths.push(escapedPath);
|
||||||
mkdirSync(escapedPath, { recursive: true });
|
mkdirSync(escapedPath, { recursive: true });
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* sources are populated, URLs are well-formed, and sync results have
|
* sources are populated, URLs are well-formed, and sync results have
|
||||||
* the correct shape.
|
* 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.
|
* and mocks global fetch to avoid real network calls.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
*
|
*
|
||||||
* Embedders:
|
* Embedders:
|
||||||
* inprocess Xenova/all-MiniLM-L6-v2 padded to 1024 dimensions, as in the
|
* 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 OLLAMA_HOST (default http://localhost:11434) and
|
||||||
* OLLAMA_EMBED_MODEL (default nomic-embed-text). Ollama must
|
* OLLAMA_EMBED_MODEL (default nomic-embed-text). Ollama must
|
||||||
* already be running with the model pulled.
|
* already be running with the model pulled.
|
||||||
@@ -41,6 +41,7 @@ import path from 'node:path';
|
|||||||
import { performance } from 'node:perf_hooks';
|
import { performance } from 'node:perf_hooks';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import type { MemoryImportance, MemoryKind } from '@waggle/memory-contract';
|
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
|
// The adapter sets this too; setting it first keeps telemetry off even if
|
||||||
// something loads mem0 earlier than the adapter.
|
// something loads mem0 earlier than the adapter.
|
||||||
@@ -431,7 +432,7 @@ function packageVersion(fromDir: string, name: string): string {
|
|||||||
async function main(): Promise<void> {
|
async function main(): Promise<void> {
|
||||||
const options = parseArgs(process.argv.slice(2));
|
const options = parseArgs(process.argv.slice(2));
|
||||||
const set = JSON.parse(fs.readFileSync(path.join(BENCH_DIR, 'reference-set.json'), 'utf8')) as ReferenceSet;
|
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);
|
const plan = planEmbedder(options.embedder, modelsDir);
|
||||||
guardNetwork(plan.remoteHost);
|
guardNetwork(plan.remoteHost);
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export interface ActivationDependencies {
|
|||||||
requiredCapabilities?: string[];
|
requiredCapabilities?: string[];
|
||||||
/** Capabilities available in the current environment */
|
/** Capabilities available in the current environment */
|
||||||
availableCapabilities?: string[];
|
availableCapabilities?: string[];
|
||||||
/** Path to the plugin directory (e.g., ~/.waggle/plugins/<name>/) for resolving tool implementations */
|
/** Path to the plugin directory (e.g., ~/.waggle-community/plugins/<name>/) for resolving tool implementations */
|
||||||
pluginDir?: string;
|
pluginDir?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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).
|
* Only installs skills that don't already exist (no overwrite).
|
||||||
* Returns list of installed skill names.
|
* Returns list of installed skill names.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Fastify, { type FastifyInstance, type FastifyRequest } from 'fastify';
|
|||||||
import cors from '@fastify/cors';
|
import cors from '@fastify/cors';
|
||||||
import fastifyStatic from '@fastify/static';
|
import fastifyStatic from '@fastify/static';
|
||||||
import websocket from '@fastify/websocket';
|
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 { corsOriginAllowed } from './cors-config.js';
|
||||||
import { InstallAuditStore } from './install-audit.js';
|
import { InstallAuditStore } from './install-audit.js';
|
||||||
import { selfBaseUrl, selfRequestHeaders } from './self-request.js';
|
import { selfBaseUrl, selfRequestHeaders } from './self-request.js';
|
||||||
@@ -185,7 +185,7 @@ import { copyProviderKeysToVault, hydrateProviderEnvFromVault } from './provider
|
|||||||
export interface LocalConfig {
|
export interface LocalConfig {
|
||||||
port: number;
|
port: number;
|
||||||
host: string;
|
host: string;
|
||||||
dataDir: string; // ~/.waggle
|
dataDir: string; // ~/.waggle-community
|
||||||
litellmUrl: string; // http://localhost:4000
|
litellmUrl: string; // http://localhost:4000
|
||||||
/** Immutable desktop-launch identity used to prove sidecar ownership. */
|
/** Immutable desktop-launch identity used to prove sidecar ownership. */
|
||||||
instanceId?: string;
|
instanceId?: string;
|
||||||
@@ -470,7 +470,7 @@ export async function buildLocalServer(config: Partial<LocalConfig> = {}) {
|
|||||||
// Decorate with local config
|
// Decorate with local config
|
||||||
server.decorate('localConfig', fullConfig);
|
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);
|
setPersonaDataDir(fullConfig.dataDir);
|
||||||
|
|
||||||
// Event bus (replaces Redis pub/sub)
|
// Event bus (replaces Redis pub/sub)
|
||||||
@@ -667,7 +667,7 @@ export async function buildLocalServer(config: Partial<LocalConfig> = {}) {
|
|||||||
// Decorate server with embedding provider for status endpoints
|
// Decorate server with embedding provider for status endpoints
|
||||||
server.decorate('embeddingProvider', embeddingProvider);
|
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');
|
const rerankerCacheDir = path.join(waggleHome, 'models', 'reranker');
|
||||||
|
|
||||||
// Memory (ADR-0007): one mem0 store in <dataDir>/memory/, embedded by the
|
// Memory (ADR-0007): one mem0 store in <dataDir>/memory/, embedded by the
|
||||||
@@ -893,7 +893,7 @@ export async function buildLocalServer(config: Partial<LocalConfig> = {}) {
|
|||||||
|
|
||||||
const allTools = [...baseTools, ...subAgentTools, ...workflowTools];
|
const allTools = [...baseTools, ...subAgentTools, ...workflowTools];
|
||||||
|
|
||||||
// Load user customizations from ~/.waggle/
|
// Load user customizations from ~/.waggle-community/
|
||||||
const userSystemPrompt = loadSystemPrompt(waggleHome);
|
const userSystemPrompt = loadSystemPrompt(waggleHome);
|
||||||
const skills = loadSkills(waggleHome);
|
const skills = loadSkills(waggleHome);
|
||||||
|
|
||||||
@@ -954,7 +954,7 @@ export async function buildLocalServer(config: Partial<LocalConfig> = {}) {
|
|||||||
// Plugin runtime manager — lifecycle, tools, skills from plugins
|
// Plugin runtime manager — lifecycle, tools, skills from plugins
|
||||||
const pluginRuntimeManager = new PluginRuntimeManager();
|
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');
|
const pluginsDir = path.join(waggleHome, 'plugins');
|
||||||
if (fs.existsSync(pluginsDir)) {
|
if (fs.existsSync(pluginsDir)) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import * as os from 'node:os';
|
import { defaultDataDir } from '@waggle/core';
|
||||||
import { randomUUID, createHash } from 'node:crypto';
|
import { randomUUID, createHash } from 'node:crypto';
|
||||||
import type { McpRuntime, McpServerConfig } from '@waggle/agent';
|
import type { McpRuntime, McpServerConfig } from '@waggle/agent';
|
||||||
import {
|
import {
|
||||||
@@ -51,9 +51,9 @@ export interface McpConfigFile {
|
|||||||
mcpServers: Record<string, PersistedMcpEntry>;
|
mcpServers: Record<string, PersistedMcpEntry>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 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 {
|
export function mcpConfigPath(dataDir: string): string {
|
||||||
const home = dataDir || path.join(os.homedir(), '.waggle');
|
const home = dataDir || defaultDataDir();
|
||||||
return path.join(home, '.mcp.json');
|
return path.join(home, '.mcp.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export interface QueuedMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface OfflineManagerConfig {
|
export interface OfflineManagerConfig {
|
||||||
/** Directory for persistent storage (e.g. ~/.waggle) */
|
/** Directory for persistent storage (e.g. ~/.waggle-community) */
|
||||||
dataDir: string;
|
dataDir: string;
|
||||||
/** How often to check LLM health, in ms (default: 30000) */
|
/** How often to check LLM health, in ms (default: 30000) */
|
||||||
checkIntervalMs?: number;
|
checkIntervalMs?: number;
|
||||||
|
|||||||
@@ -1407,7 +1407,7 @@ function getAnthropicKey(server: FastifyInstance): string | null {
|
|||||||
// Legacy fallback: env var (for test harnesses / dev loops)
|
// Legacy fallback: env var (for test harnesses / dev loops)
|
||||||
if (process.env.ANTHROPIC_API_KEY) return process.env.ANTHROPIC_API_KEY;
|
if (process.env.ANTHROPIC_API_KEY) return process.env.ANTHROPIC_API_KEY;
|
||||||
|
|
||||||
// Legacy fallback: ~/.waggle/config.json
|
// Legacy fallback: ~/.waggle-community/config.json
|
||||||
try {
|
try {
|
||||||
const configPath = path.join(server.localConfig.dataDir, 'config.json');
|
const configPath = path.join(server.localConfig.dataDir, 'config.json');
|
||||||
const raw = fs.readFileSync(configPath, 'utf-8');
|
const raw = fs.readFileSync(configPath, 'utf-8');
|
||||||
|
|||||||
@@ -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:
|
* Endpoints:
|
||||||
* POST /api/backup — create and stream an encrypted backup archive
|
* POST /api/backup — create and stream an encrypted backup archive
|
||||||
|
|||||||
@@ -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
|
* Persona resolver that includes built-ins AND on-disk custom personas
|
||||||
* (Faza 1 evolved variants like `claude::gen1-v1`, `qwen-thinking::gen1-v1`,
|
* (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
|
* Previously `getPersona(id)` was used here, which only consulted the static
|
||||||
* built-in PERSONAS array — `listPersonas()` adds the custom ones from disk
|
* built-in PERSONAS array — `listPersonas()` adds the custom ones from disk
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
* later phases. The CommandResultType union carries them so the contract is stable.
|
* 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 path from 'node:path';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import type { FastifyPluginAsync } from 'fastify';
|
import type { FastifyPluginAsync } from 'fastify';
|
||||||
@@ -79,7 +79,7 @@ function toSubtitle(content: string, max = 120): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const commandRoutes: FastifyPluginAsync = async (server) => {
|
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 ───────────────────────────────────────────
|
// ── GET /api/command/search ───────────────────────────────────────────
|
||||||
// Federated read over memory + workspaces + skills + sessions + commands.
|
// Federated read over memory + workspaces + skills + sessions + commands.
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
import type { FastifyPluginAsync } from 'fastify';
|
import type { FastifyPluginAsync } from 'fastify';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import os from 'node:os';
|
import { defaultDataDir } from '@waggle/core';
|
||||||
import { assertSafeSegment } from './validate.js';
|
import { assertSafeSegment } from './validate.js';
|
||||||
|
|
||||||
export interface DocumentVersion {
|
export interface DocumentVersion {
|
||||||
@@ -62,7 +62,7 @@ function writeRegistry(dataDir: string, workspaceId: string, registry: Documents
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const documentRoutes: FastifyPluginAsync = async (server) => {
|
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
|
// GET /api/workspaces/:id/documents — list all tracked documents
|
||||||
server.get<{
|
server.get<{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { FastifyInstance } from 'fastify';
|
import type { FastifyInstance } from 'fastify';
|
||||||
import os from 'node:os';
|
import { defaultDataDir } from '@waggle/core';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { rankModels, OLLAMA_CATALOG } from '@waggle/agent';
|
import { rankModels, OLLAMA_CATALOG } from '@waggle/agent';
|
||||||
import { detectHardware } from '../hardware-detect.js';
|
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 VLLM_URL = process.env.VLLM_HOST ?? 'http://localhost:8000';
|
||||||
const dataDir = fastify.localConfig?.dataDir
|
const dataDir = fastify.localConfig?.dataDir
|
||||||
|| process.env.WAGGLE_DATA_DIR
|
|| process.env.WAGGLE_DATA_DIR
|
||||||
|| path.join(os.homedir(), '.waggle');
|
|| defaultDataDir();
|
||||||
const runtime = options.runtimeFactory?.(dataDir, OLLAMA_URL)
|
const runtime = options.runtimeFactory?.(dataDir, OLLAMA_URL)
|
||||||
?? new ManagedOllamaRuntime(dataDir, OLLAMA_URL);
|
?? new ManagedOllamaRuntime(dataDir, OLLAMA_URL);
|
||||||
const probeOllama = options.ollamaProbe ?? checkOllama;
|
const probeOllama = options.ollamaProbe ?? checkOllama;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { createLogger } from '../logger.js';
|
|||||||
const log = createLogger('marketplace-dev');
|
const log = createLogger('marketplace-dev');
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import { MarketplaceDB, SecurityGate } from '@waggle/marketplace';
|
import { MarketplaceDB, SecurityGate } from '@waggle/marketplace';
|
||||||
|
import { DEFAULT_DATA_DIR_NAME } from '@waggle/shared';
|
||||||
import type { InstallationType, MarketplacePack, MarketplacePackage } from '@waggle/marketplace';
|
import type { InstallationType, MarketplacePack, MarketplacePackage } from '@waggle/marketplace';
|
||||||
|
|
||||||
export async function marketplaceDevRoutes(fastify: FastifyInstance) {
|
export async function marketplaceDevRoutes(fastify: FastifyInstance) {
|
||||||
@@ -26,7 +27,7 @@ export async function marketplaceDevRoutes(fastify: FastifyInstance) {
|
|||||||
|
|
||||||
const dataDir = fastify.localConfig?.dataDir ?? path.join(
|
const dataDir = fastify.localConfig?.dataDir ?? path.join(
|
||||||
process.env.HOME ?? process.env.USERPROFILE ?? '.',
|
process.env.HOME ?? process.env.USERPROFILE ?? '.',
|
||||||
'.waggle',
|
DEFAULT_DATA_DIR_NAME,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Lazy-instantiate marketplace handles on first use.
|
// Lazy-instantiate marketplace handles on first use.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
import type { FastifyInstance, FastifyReply } from 'fastify';
|
import type { FastifyInstance, FastifyReply } from 'fastify';
|
||||||
import { existsSync, readFileSync } from 'fs';
|
import { existsSync, readFileSync } from 'fs';
|
||||||
import { join } from 'path';
|
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 { 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 type { InstallationType, SearchSort, ScanResult, MarketplacePackage, MarketplaceMcpProvenance, MarketplaceApprovalIdentity, FetchFn } from '@waggle/marketplace';
|
||||||
import { validateSkillMd } from '@waggle/sdk';
|
import { validateSkillMd } from '@waggle/sdk';
|
||||||
@@ -971,7 +971,7 @@ export async function marketplaceRoutes(fastify: FastifyInstance) {
|
|||||||
|
|
||||||
// ── POST /api/marketplace/publish ─────────────────────────────────
|
// ── POST /api/marketplace/publish ─────────────────────────────────
|
||||||
// Publish a local skill to the marketplace catalog.
|
// 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.
|
// runs SecurityGate scan, then upserts into the marketplace DB.
|
||||||
|
|
||||||
fastify.post('/api/marketplace/publish', async (request, reply) => {
|
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' });
|
return reply.code(400).send({ error: 'Invalid skill name' });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the skill file from ~/.waggle/skills/
|
// Read the skill file from ~/.waggle-community/skills/
|
||||||
const waggleHome = fastify.localConfig?.dataDir || join(homedir(), '.waggle');
|
const waggleHome = fastify.localConfig?.dataDir || defaultDataDir();
|
||||||
const skillPath = join(waggleHome, 'skills', `${skillName}.md`);
|
const skillPath = join(waggleHome, 'skills', `${skillName}.md`);
|
||||||
|
|
||||||
if (!existsSync(skillPath)) {
|
if (!existsSync(skillPath)) {
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ export async function mcpRoutes(fastify: FastifyInstance) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Persist at the server's dataDir too — the installer writes to
|
// 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);
|
saveMcpServerEntry(dataDir(), configured.name, entry);
|
||||||
|
|
||||||
const runtime = getRuntime();
|
const runtime = getRuntime();
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export const onboardingRoutes: FastifyPluginAsync = async (server) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Idempotent completion stamp. The wizard's complete() fires this alongside
|
// 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 () => {
|
server.post('/api/onboarding/complete', async () => {
|
||||||
fs.mkdirSync(server.localConfig.dataDir, { recursive: true });
|
fs.mkdirSync(server.localConfig.dataDir, { recursive: true });
|
||||||
fs.writeFileSync(flagPath(), new Date().toISOString());
|
fs.writeFileSync(flagPath(), new Date().toISOString());
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
import type { FastifyPluginAsync } from 'fastify';
|
import type { FastifyPluginAsync } from 'fastify';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import os from 'node:os';
|
import { defaultDataDir } from '@waggle/core';
|
||||||
import crypto from 'node:crypto';
|
import crypto from 'node:crypto';
|
||||||
|
|
||||||
export interface PinnedItem {
|
export interface PinnedItem {
|
||||||
@@ -57,7 +57,7 @@ function writePins(dataDir: string, workspaceId: string, pins: PinnedItem[]): vo
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const pinRoutes: FastifyPluginAsync = async (server) => {
|
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
|
// GET /api/workspaces/:id/pins — list pins for workspace
|
||||||
server.get<{
|
server.get<{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* User Profile API — identity, writing style, brand, and preferences.
|
* 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.
|
* key fields are also saved to personal memory for agent access.
|
||||||
*
|
*
|
||||||
* Endpoints:
|
* Endpoints:
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import os from 'node:os';
|
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import type { FastifyPluginAsync } from 'fastify';
|
import type { FastifyPluginAsync } from 'fastify';
|
||||||
import { computeSkillHash } from '@waggle/core';
|
import { computeSkillHash, defaultDataDir } from '@waggle/core';
|
||||||
import {
|
import {
|
||||||
loadActiveSkills,
|
loadActiveSkills,
|
||||||
loadSkillAudit,
|
loadSkillAudit,
|
||||||
@@ -44,7 +43,7 @@ async function buildAuditLLM(apiKey: string): Promise<EvolutionLLM | null> {
|
|||||||
* first, then redacted/provenance-stamped/audited + the change-hash refreshed).
|
* first, then redacted/provenance-stamped/audited + the change-hash refreshed).
|
||||||
*/
|
*/
|
||||||
export const skillsAuditRoutes: FastifyPluginAsync = async (server) => {
|
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');
|
const skillsDir = path.join(waggleHome, 'skills');
|
||||||
|
|
||||||
// GET /api/skills/audit — badge index (Skills Hub card source for the verified badge).
|
// GET /api/skills/audit — badge index (Skills Hub card source for the verified badge).
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import os from 'node:os';
|
import { defaultDataDir } from '@waggle/core';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import type { FastifyPluginAsync } from 'fastify';
|
import type { FastifyPluginAsync } from 'fastify';
|
||||||
import {
|
import {
|
||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
* Waggle proxy cost — mirroring the evolution route's key gate.
|
* Waggle proxy cost — mirroring the evolution route's key gate.
|
||||||
*/
|
*/
|
||||||
export const skillsHygieneRoutes: FastifyPluginAsync = async (server) => {
|
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)
|
// GET /api/skills/hygiene — current hygiene index (Skills Hub badges)
|
||||||
server.get('/api/skills/hygiene', async () => {
|
server.get('/api/skills/hygiene', async () => {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import os from 'node:os';
|
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import { createLogger } from '../logger.js';
|
import { createLogger } from '../logger.js';
|
||||||
@@ -7,7 +6,7 @@ import type { FastifyPluginAsync } from 'fastify';
|
|||||||
const log = createLogger('skills');
|
const log = createLogger('skills');
|
||||||
import { PluginManager, getStarterSkillsDir, listStarterSkills, listCapabilityPacks, getPackManifest } from '@waggle/sdk';
|
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 { 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 */
|
/** Capability family definitions — user-job-first grouping */
|
||||||
const SKILL_FAMILIES: Record<string, { family: string; label: string }> = {
|
const SKILL_FAMILIES: Record<string, { family: string; label: string }> = {
|
||||||
@@ -36,11 +35,11 @@ const WORKFLOW_SKILLS = new Set(['research-team', 'review-pair', 'plan-execute']
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Skills & plugins routes — manage agent extensions.
|
* Skills & plugins routes — manage agent extensions.
|
||||||
* Skills: markdown files in ~/.waggle/skills/ that extend the system prompt.
|
* Skills: markdown files in ~/.waggle-community/skills/ that extend the system prompt.
|
||||||
* Plugins: structured packages in ~/.waggle/plugins/ with manifests.
|
* Plugins: structured packages in ~/.waggle-community/plugins/ with manifests.
|
||||||
*/
|
*/
|
||||||
export const skillRoutes: FastifyPluginAsync = async (server) => {
|
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 skillsDir = path.join(waggleHome, 'skills');
|
||||||
const pluginsDir = path.join(waggleHome, 'plugins');
|
const pluginsDir = path.join(waggleHome, 'plugins');
|
||||||
|
|
||||||
@@ -83,7 +82,7 @@ export const skillRoutes: FastifyPluginAsync = async (server) => {
|
|||||||
const starterDir = getStarterSkillsDir();
|
const starterDir = getStarterSkillsDir();
|
||||||
const starterNames = listStarterSkills(); // returns sorted array of names without .md
|
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<string>();
|
const installedNames = new Set<string>();
|
||||||
if (fs.existsSync(skillsDir)) {
|
if (fs.existsSync(skillsDir)) {
|
||||||
for (const f of fs.readdirSync(skillsDir)) {
|
for (const f of fs.readdirSync(skillsDir)) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Task routes — workspace-scoped task board.
|
* 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.
|
* Each task: id, title, status (open|in_progress|done), assignee, creator, timestamps.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { WorkflowTemplate } from '@waggle/agent';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Workflow routes — CRUD for custom workflow templates.
|
* 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) => {
|
export const workflowRoutes: FastifyPluginAsync = async (fastify) => {
|
||||||
const dataDir = fastify.localConfig.dataDir;
|
const dataDir = fastify.localConfig.dataDir;
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import os from 'node:os';
|
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import type { FastifyPluginAsync } from 'fastify';
|
import type { FastifyPluginAsync } from 'fastify';
|
||||||
import { z } from 'zod';
|
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 { workspaceScope, type MemoryRecord, type MemoryStore } from '@waggle/memory-contract';
|
||||||
import { assertSafeSegment } from './validate.js';
|
import { assertSafeSegment } from './validate.js';
|
||||||
import { validateBody } from '../../validate-body.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
|
// Auto-install starter skills on first workspace creation
|
||||||
try {
|
try {
|
||||||
const waggleHome = server.localConfig.dataDir || path.join(os.homedir(), '.waggle');
|
const waggleHome = server.localConfig.dataDir || defaultDataDir();
|
||||||
const skillsDir = path.join(waggleHome, 'skills');
|
const skillsDir = path.join(waggleHome, 'skills');
|
||||||
const existingSkills = fs.existsSync(skillsDir)
|
const existingSkills = fs.existsSync(skillsDir)
|
||||||
? fs.readdirSync(skillsDir).filter(f => f.endsWith('.md'))
|
? fs.readdirSync(skillsDir).filter(f => f.endsWith('.md'))
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ import fs from 'node:fs';
|
|||||||
import { randomUUID } from 'node:crypto';
|
import { randomUUID } from 'node:crypto';
|
||||||
import net from 'node:net';
|
import net from 'node:net';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import os from 'node:os';
|
|
||||||
import type { FastifyInstance } from 'fastify';
|
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 { buildLocalServer } from './index.js';
|
||||||
import type { LlmHealthStatus } from './index.js';
|
import type { LlmHealthStatus } from './index.js';
|
||||||
import { startLiteLLM, stopLiteLLM, type LiteLLMStatus } from './lifecycle.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 >
|
* 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,
|
* startService ignored it while other modules (local/index.ts config,
|
||||||
* marketplace installer) honored it, splitting state across two
|
* marketplace installer) honored it, splitting state across two
|
||||||
* directories on custom installs.
|
* directories on custom installs.
|
||||||
@@ -101,7 +100,7 @@ function removeOwnedDesktopReadyFile(filePath: string, instanceId: string): void
|
|||||||
export function resolveDataDir(optionDataDir?: string): string {
|
export function resolveDataDir(optionDataDir?: string): string {
|
||||||
// `||` on the env leg: WAGGLE_DATA_DIR set-but-empty must fall through to
|
// `||` on the env leg: WAGGLE_DATA_DIR set-but-empty must fall through to
|
||||||
// the default, not yield '' (mkdirSync('') throws / resolves to cwd).
|
// 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. */
|
/** 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.
|
* 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
|
* 2. Starts the LiteLLM proxy when config.json enables it and it is not skipped
|
||||||
* 3. Builds & starts local Fastify server
|
* 3. Builds & starts local Fastify server
|
||||||
* 4. Registers graceful shutdown handlers
|
* 4. Registers graceful shutdown handlers
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { STANDARD_DIRS } from './types.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Filesystem-backed StorageProvider.
|
* 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).
|
* and "local" storage (data at a user-specified path).
|
||||||
*/
|
*/
|
||||||
export class FsStorageProvider implements StorageProvider {
|
export class FsStorageProvider implements StorageProvider {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ interface WorkspaceLike {
|
|||||||
/**
|
/**
|
||||||
* Resolve the correct StorageProvider for a workspace.
|
* 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)
|
* - local: user-specified directory on their machine (like Claude Code)
|
||||||
* - team: shared team storage is part of team mode, which the community
|
* - team: shared team storage is part of team mode, which the community
|
||||||
* edition does not ship (ADR-0003); such workspaces use virtual storage
|
* edition does not ship (ADR-0003); such workspaces use virtual storage
|
||||||
|
|||||||
@@ -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:
|
* Tests:
|
||||||
* 1. POST /api/backup returns an octet-stream file
|
* 1. POST /api/backup returns an octet-stream file
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* D11 (UX-Refactor P4) — dataDir resolution.
|
* 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
|
* D11, startService ignored the env var while local/index.ts and the
|
||||||
* marketplace installer honored it — a custom install split
|
* marketplace installer honored it — a custom install split
|
||||||
* its state across two directories.
|
* its state across two directories.
|
||||||
@@ -10,6 +10,7 @@ import { describe, it, expect, afterEach, vi } from 'vitest';
|
|||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import os from 'node:os';
|
import os from 'node:os';
|
||||||
|
import { DEFAULT_DATA_DIR_NAME } from '@waggle/shared';
|
||||||
import { startService, resolveDataDir } from '../src/local/service.js';
|
import { startService, resolveDataDir } from '../src/local/service.js';
|
||||||
import type { FastifyInstance } from 'fastify';
|
import type { FastifyInstance } from 'fastify';
|
||||||
|
|
||||||
@@ -36,14 +37,15 @@ describe('resolveDataDir (D11)', () => {
|
|||||||
expect(resolveDataDir()).toBe('D:/from-env');
|
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];
|
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)', () => {
|
it('a set-but-EMPTY env var falls through to the default (never an empty dataDir)', () => {
|
||||||
process.env[ENV_KEY] = '';
|
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 });
|
const result = await startService({ port, skipLiteLLM: true });
|
||||||
server = result.server;
|
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(fs.existsSync(path.join(envDir, 'waggle.db'))).toBe(true);
|
||||||
expect(server.localConfig.dataDir).toBe(envDir);
|
expect(server.localConfig.dataDir).toBe(envDir);
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user