feat: default the data directory to ~/.waggle-community (P1.3c)
The community edition defaulted to ~/.waggle, the data directory of the commercial Waggle, so both editions would open the same config, vault, waggle.db, marketplace catalog and skills. Default to ~/.waggle-community instead (ADR-0011). WAGGLE_DATA_DIR still overrides it wherever it did; nothing is migrated from ~/.waggle. The name is defined once as DEFAULT_DATA_DIR_NAME and DEFAULT_DATA_DIR_LABEL in @waggle/shared, with defaultDataDir() in @waggle/core for the sidecar, the CLI, the agent and the model caches. The marketplace installs on its own without workspace packages, so it keeps a copy in its data-dir.ts; the CLI help, which loads no dependency, spells the path out and its runtime test checks it. The marketplace security scan also flags skills that reference the new skills folder. Tests that asserted the old default now use the constant, and comments name the new directory.
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -14,7 +14,7 @@ interface HooksConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load user-configurable hooks from a JSON config file (e.g. ~/.waggle/hooks.json).
|
||||
* Load user-configurable hooks from a JSON config file (e.g. ~/.waggle-community/hooks.json).
|
||||
* If the file doesn't exist, returns silently — no error.
|
||||
*
|
||||
* Config format:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Skill-audit sidecar (Odysseus §D2).
|
||||
*
|
||||
* ~/.waggle/skill-audit.json records the run-and-grade "verified" badge per
|
||||
* ~/.waggle-community/skill-audit.json records the run-and-grade "verified" badge per
|
||||
* skill — the sellable PRO artifact of the autonomous skill-audit loop
|
||||
* (skill-audit.ts). DISTINCT from skill-hygiene.json (active|draft status):
|
||||
* a skill can be active AND unverified, or active AND verified. The audit
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Skill hygiene sidecar (Odysseus §D1).
|
||||
*
|
||||
* ~/.waggle/skill-hygiene.json records each skill's hygiene status + advisory.
|
||||
* ~/.waggle-community/skill-hygiene.json records each skill's hygiene status + advisory.
|
||||
* The single-LLM-call judge (skill-hygiene.ts) writes here when a skill is found
|
||||
* redundant-with-peers or too-generic, DEMOTING it to 'draft'. It never edits or
|
||||
* deletes the SKILL.md, so the proven content and its change-detection hash never
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Pre-write redaction for authored skill content.
|
||||
*
|
||||
* The closed-learning-loop (create_skill / auto_extract_skills) and the UI both
|
||||
* persist skill markdown to disk (~/.waggle/skills). That content can carry
|
||||
* persist skill markdown to disk (~/.waggle-community/skills). That content can carry
|
||||
* secrets (API keys / tokens) or machine-specific filesystem paths pulled from
|
||||
* the model's context or the user's input. The loop's "strip secrets/paths"
|
||||
* instruction was model-advisory only — this enforces it deterministically
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Walks the personal-scope skill directory and moves any SKILL.md file
|
||||
* whose last-used timestamp (from skill-usage.json sidecar) is older than
|
||||
* maxIdleDays into ~/.waggle/skills-archive/. Parallels the existing
|
||||
* maxIdleDays into ~/.waggle-community/skills-archive/. Parallels the existing
|
||||
* decayFrames() behavior in packages/weaver/src/consolidation.ts.
|
||||
*
|
||||
* Retirement rules:
|
||||
|
||||
@@ -39,7 +39,7 @@ import { autoExtractAndCreateSkill, type AutoExtractMessage } from './skill-auto
|
||||
import { retireStaleSkills } from './skill-retirement.js';
|
||||
|
||||
export interface SkillToolsDeps {
|
||||
/** Path to ~/.waggle directory */
|
||||
/** Path to ~/.waggle-community directory */
|
||||
waggleHome: string;
|
||||
/** Callback to reload skills into agent state after changes */
|
||||
onSkillsChanged?: () => void;
|
||||
@@ -69,10 +69,10 @@ export interface SkillToolsDeps {
|
||||
|
||||
/**
|
||||
* Skills 2.0 gap E: resolve the on-disk directory for a given scope.
|
||||
* - personal: ~/.waggle/skills/
|
||||
* - workspace: ~/.waggle/workspaces/{workspaceId}/skills/
|
||||
* - team: ~/.waggle/teams/{teamId}/skills/
|
||||
* - enterprise: ~/.waggle/enterprise/skills/
|
||||
* - personal: ~/.waggle-community/skills/
|
||||
* - workspace: ~/.waggle-community/workspaces/{workspaceId}/skills/
|
||||
* - team: ~/.waggle-community/teams/{teamId}/skills/
|
||||
* - enterprise: ~/.waggle-community/enterprise/skills/
|
||||
*
|
||||
* Returns null when the required context (workspaceId, teamId) is missing.
|
||||
*/
|
||||
@@ -849,7 +849,7 @@ Only use this after acquire_capability has identified a specific installable can
|
||||
name: 'retire_skills',
|
||||
description:
|
||||
'Archive personal-scope skills that have not been used within the idle window. '
|
||||
+ 'Moves stale SKILL.md files to ~/.waggle/skills-archive/ (recoverable — no deletion). '
|
||||
+ 'Moves stale SKILL.md files to ~/.waggle-community/skills-archive/ (recoverable — no deletion). '
|
||||
+ 'Default max_idle_days is 90. Default dry_run is true — call with dry_run: false to '
|
||||
+ 'actually move the files.',
|
||||
parameters: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Skills 2.0 gap F — skill usage tracking.
|
||||
*
|
||||
* Sidecar JSON store at ~/.waggle/skill-usage.json that tracks when each
|
||||
* Sidecar JSON store at ~/.waggle-community/skill-usage.json that tracks when each
|
||||
* installed skill was last referenced and how many times. Consumed by
|
||||
* retireStaleSkills to decide which SKILL.md files to archive.
|
||||
*
|
||||
|
||||
@@ -21,7 +21,7 @@ import type { InstallAuditRecorder } from '@waggle/shared';
|
||||
|
||||
/** Shared deps for every skill-write op. auditStore/onChange degrade gracefully. */
|
||||
export interface SkillWriteDeps {
|
||||
/** Directory holding personal-scope SKILL.md files (~/.waggle/skills). */
|
||||
/** Directory holding personal-scope SKILL.md files (~/.waggle-community/skills). */
|
||||
skillsDir: string;
|
||||
/** Audit store — when present, every op records an install_audit row. */
|
||||
auditStore?: InstallAuditRecorder;
|
||||
|
||||
@@ -617,7 +617,7 @@ async function detectFromManifest(m: ToolManifest, deps: ResolvedDeps): Promise<
|
||||
/**
|
||||
* Run every registered tool's detector in parallel and assemble the envelope.
|
||||
* The registry = built-in manifests (source of truth in @waggle/shared) +
|
||||
* validated third-party adapters from ~/.waggle/adapters/*.json (#5). Order is
|
||||
* validated third-party adapters from ~/.waggle-community/adapters/*.json (#5). Order is
|
||||
* deterministic (registry order) so the UI doesn't shuffle between calls.
|
||||
*/
|
||||
export async function detectInstalledTools(
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* AI-OS #5 — declarative loader for third-party tool adapters from
|
||||
* ~/.waggle/adapters/*.json. Data only: hand-validated + safe-string-refined,
|
||||
* ~/.waggle-community/adapters/*.json. Data only: hand-validated + safe-string-refined,
|
||||
* PATH-detection only, never require()/eval. Never throws into detection.
|
||||
*
|
||||
* Validation is hand-rolled (not zod) to avoid adding a dependency to the agent
|
||||
* package for one small flat schema; the safe-string refinement is the boundary
|
||||
* defense against shell-metachar / path-traversal injection in adapter fields.
|
||||
*/
|
||||
import os from 'node:os';
|
||||
import { defaultDataDir } from '@waggle/core';
|
||||
import path from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
import type { ToolManifest } from '@waggle/shared';
|
||||
@@ -58,7 +58,7 @@ export interface ManifestLoaderDeps {
|
||||
}
|
||||
|
||||
export function loadThirdPartyManifests(deps: ManifestLoaderDeps = {}): ToolManifest[] {
|
||||
const dir = deps.dir ?? path.join(os.homedir(), '.waggle', 'adapters');
|
||||
const dir = deps.dir ?? path.join(defaultDataDir(), 'adapters');
|
||||
const readDir = deps.readDir ?? ((d) => fs.readdirSync(d));
|
||||
const readFile = deps.readFile ?? ((p) => fs.readFileSync(p, 'utf8'));
|
||||
let names: string[];
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* in tool-calls, within-model paired, graded on correctness.
|
||||
*
|
||||
* Usage: tsx packages/agent/tests/eval/hermes-skill-reuse-eval.ts
|
||||
* Env: WAGGLE_DATA_DIR (vault location; default ~/.waggle)
|
||||
* Env: WAGGLE_DATA_DIR (vault location; default ~/.waggle-community)
|
||||
* HERMES_EVAL_N (override pair count; default = pilot 3)
|
||||
* Output: tmp_hermes-skill-reuse.json (gitignored) + console verdict.
|
||||
*
|
||||
@@ -16,7 +16,7 @@ import { runAgentLoop } from '../../src/agent-loop.js';
|
||||
import type { ToolDefinition } from '../../src/tools.js';
|
||||
import { planSkillDistillation } from '../../src/skill-distillation.js';
|
||||
import { CostTracker, BudgetExceededError } from '../../src/cost-tracker.js';
|
||||
import { VaultStore } from '@waggle/core';
|
||||
import { VaultStore, defaultDataDir } from '@waggle/core';
|
||||
import * as fs from 'node:fs';
|
||||
import * as os from 'node:os';
|
||||
import * as path from 'node:path';
|
||||
@@ -49,7 +49,7 @@ const COST_SAFETY = 1.3; // manifest §9.3
|
||||
// the $5 pilot / $40 hard cap are enforced against this.
|
||||
const MODEL_PRICING = { [MODEL]: { inputPer1k: 0.003, outputPer1k: 0.015 } };
|
||||
|
||||
const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR || path.join(os.homedir(), '.waggle');
|
||||
const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR || defaultDataDir();
|
||||
|
||||
// ── Forcing corpus (manifest §7 + Amendment 3) ───────────────────────
|
||||
// Fictional, project-specific "Floruxa" subsystem. Facts are scattered
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* tsx packages/agent/tests/eval/prompt-assembler-eval.ts
|
||||
*
|
||||
* Environment:
|
||||
* WAGGLE_DATA_DIR — override ~/.waggle (for non-default installs)
|
||||
* WAGGLE_DATA_DIR — override ~/.waggle-community (for non-default installs)
|
||||
* WAGGLE_EVAL_SKIP_SECONDARY=1 — skip Gemma 4 26B MoE + Qwen3 secondary suites
|
||||
* WAGGLE_EVAL_SEEDS — number of seeds per condition (default 3)
|
||||
*
|
||||
@@ -23,7 +23,7 @@
|
||||
* EVAL-RESULTS.md — human-readable summary (committed)
|
||||
*/
|
||||
|
||||
import { VaultStore } from '@waggle/core';
|
||||
import { VaultStore, defaultDataDir } from '@waggle/core';
|
||||
import {
|
||||
createInMemoryMemoryStore,
|
||||
PERSONAL_SCOPE,
|
||||
@@ -43,7 +43,7 @@ import { execFileSync } from 'node:child_process';
|
||||
|
||||
// ── Config ──────────────────────────────────────────────────────────
|
||||
|
||||
const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR ?? path.join(os.homedir(), '.waggle');
|
||||
const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR ?? defaultDataDir();
|
||||
// Use fileURLToPath to handle Windows file:// URLs correctly (avoids
|
||||
// `/D:/...` leading-slash bug that produced `D:\D:\...` double-drive paths).
|
||||
const HARNESS_DIR = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* tsx packages/agent/tests/eval/prompt-assembler-v5-eval.ts
|
||||
*
|
||||
* Environment:
|
||||
* WAGGLE_DATA_DIR — override ~/.waggle (for non-default installs)
|
||||
* WAGGLE_DATA_DIR — override ~/.waggle-community (for non-default installs)
|
||||
* WAGGLE_EVAL_SKIP_SECONDARY=1 — skip Gemma 4 26B MoE + Qwen thinking
|
||||
* WAGGLE_EVAL_SEEDS — base seeds per condition (default 3)
|
||||
* WAGGLE_EVAL_SKIP_SLUG_PROBE=1 — skip the pre-eval slug probe
|
||||
@@ -32,7 +32,7 @@
|
||||
* judges are reachable, the eval halts and reports partial state.
|
||||
*/
|
||||
|
||||
import { VaultStore } from '@waggle/core';
|
||||
import { VaultStore, defaultDataDir } from '@waggle/core';
|
||||
import {
|
||||
createInMemoryMemoryStore,
|
||||
PERSONAL_SCOPE,
|
||||
@@ -57,7 +57,7 @@ process.env.WAGGLE_EVAL_MODE = '1';
|
||||
|
||||
// ── Config ──────────────────────────────────────────────────────────
|
||||
|
||||
const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR ?? path.join(os.homedir(), '.waggle');
|
||||
const WAGGLE_DATA_DIR = process.env.WAGGLE_DATA_DIR ?? defaultDataDir();
|
||||
const HARNESS_DIR = path.dirname(fileURLToPath(import.meta.url));
|
||||
const REPO_ROOT = path.resolve(path.join(HARNESS_DIR, '..', '..', '..', '..'));
|
||||
const RESULTS_JSON = path.join(REPO_ROOT, 'tmp_bench_results-v5.json');
|
||||
|
||||
@@ -162,7 +162,7 @@ describe('Marketplace Commands', () => {
|
||||
// Mock install response
|
||||
fetchSpy.mockResolvedValueOnce(new Response(JSON.stringify({
|
||||
success: true,
|
||||
message: 'Installed to ~/.waggle/skills/',
|
||||
message: 'Installed to ~/.waggle-community/skills/',
|
||||
}), { status: 200 }));
|
||||
|
||||
const ctx = mockContext();
|
||||
|
||||
Reference in New Issue
Block a user