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:
@@ -40,7 +40,7 @@ The Waggle Marketplace is a **unified package catalog and installer** that aggre
|
||||
│ MarketplaceInstaller
|
||||
▼
|
||||
┌──────────────────────────────────────────────────────────────────────┐
|
||||
│ ~/.waggle/ (Runtime) │
|
||||
│ ~/.waggle-community/ (Runtime) │
|
||||
│ │
|
||||
│ skills/ plugins/ .mcp.json │
|
||||
│ ├── code-review.md ├── registry.json mcpServers: │
|
||||
@@ -149,7 +149,7 @@ No installation needed. The SecurityGate calls Gen's free API endpoint at `https
|
||||
```bash
|
||||
# The marketplace DB ships pre-populated with 120 seed packages.
|
||||
# Copy it to Waggle's runtime directory:
|
||||
cp marketplace.db ~/.waggle/marketplace.db
|
||||
cp marketplace.db ~/.waggle-community/marketplace.db
|
||||
|
||||
# Or build from scratch:
|
||||
python3 build_waggle_marketplace_db.py
|
||||
@@ -190,7 +190,7 @@ Skills, plugins, and MCP servers run inside the agent's trust boundary. A malici
|
||||
|
||||
### 2.2 Security Gate — Multi-Layer Defense
|
||||
|
||||
The SecurityGate sits between content download and filesystem write. Nothing touches `~/.waggle/` without passing through it.
|
||||
The SecurityGate sits between content download and filesystem write. Nothing touches `~/.waggle-community/` without passing through it.
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────┐
|
||||
@@ -363,7 +363,7 @@ waggle-market audit
|
||||
| Property | Value |
|
||||
|----------|-------|
|
||||
| File format | Markdown (`.md`) |
|
||||
| Install path | `~/.waggle/skills/{name}.md` |
|
||||
| Install path | `~/.waggle-community/skills/{name}.md` |
|
||||
| How loaded | `loadSkills()` reads all `*.md` from skills dir |
|
||||
| Where used | Appended to agent system prompt |
|
||||
| API endpoint | `PUT /api/skills/{name}` |
|
||||
@@ -373,7 +373,7 @@ waggle-market audit
|
||||
1. Resolve content (URL, GitHub raw, inline, or stub)
|
||||
2. SECURITY GATE → scan content
|
||||
3. If blocked → reject, record in DB
|
||||
4. If passed → write ~/.waggle/skills/{name}.md
|
||||
4. If passed → write ~/.waggle-community/skills/{name}.md
|
||||
5. Notify server: PUT /api/skills/{name}
|
||||
6. Record installation + scan results in DB
|
||||
```
|
||||
@@ -383,8 +383,8 @@ waggle-market audit
|
||||
| Property | Value |
|
||||
|----------|-------|
|
||||
| File format | Directory with `plugin.json` |
|
||||
| Install path | `~/.waggle/plugins/{name}/` |
|
||||
| Registry | `~/.waggle/plugins/registry.json` |
|
||||
| Install path | `~/.waggle-community/plugins/{name}/` |
|
||||
| Registry | `~/.waggle-community/plugins/registry.json` |
|
||||
| Manager | `@waggle/sdk` `PluginManager` class |
|
||||
| API endpoint | `POST /api/plugins/install` |
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* waggle-market info <name|id> Show package details
|
||||
*/
|
||||
|
||||
import { DATA_DIR_NAME } from './data-dir.js';
|
||||
import { MarketplaceDB } from './db.js';
|
||||
import { MarketplaceInstaller } from './installer.js';
|
||||
import { MarketplaceSync } from './sync.js';
|
||||
@@ -412,7 +413,7 @@ async function main() {
|
||||
// Show current config
|
||||
const gate = new SecurityGate();
|
||||
console.log('\n🔧 Security Configuration:');
|
||||
console.log(' (edit ~/.waggle/security-config.json or use waggle-market security-config <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
|
||||
} else if (positionals.length >= 2) {
|
||||
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 { join } from 'path';
|
||||
import { homedir } from 'os';
|
||||
import { DATA_DIR_NAME } from './data-dir.js';
|
||||
import { seedMcpServers } from './mcp-registry.js';
|
||||
import type {
|
||||
MarketplacePackage,
|
||||
@@ -21,7 +22,7 @@ import type {
|
||||
SearchSort,
|
||||
} from './types.js';
|
||||
|
||||
const DEFAULT_DB_PATH = join(homedir(), '.waggle', 'marketplace.db');
|
||||
const DEFAULT_DB_PATH = join(homedir(), DATA_DIR_NAME, 'marketplace.db');
|
||||
|
||||
export class MarketplaceDB {
|
||||
private db: Database.Database;
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
* Waggle Marketplace — Package Installer
|
||||
*
|
||||
* Handles installation of skills, plugins, and MCP servers from the
|
||||
* marketplace database into the user's ~/.waggle/ directory.
|
||||
* marketplace database into the user's data directory (~/.waggle-community/).
|
||||
*
|
||||
* Installation strategies per type:
|
||||
*
|
||||
* SKILL: Download/copy markdown file → ~/.waggle/skills/{name}.md
|
||||
* SKILL: Download/copy markdown file → ~/.waggle-community/skills/{name}.md
|
||||
* Then call PUT /api/skills/{name} if server is running.
|
||||
*
|
||||
* PLUGIN: Clone/download plugin dir → ~/.waggle/plugins/{name}/
|
||||
* PLUGIN: Clone/download plugin dir → ~/.waggle-community/plugins/{name}/
|
||||
* Write plugin.json manifest, copy skill files, register in registry.json.
|
||||
* Then call POST /api/plugins/install if server is running.
|
||||
*
|
||||
@@ -19,6 +19,7 @@
|
||||
import { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, rmSync } from 'fs';
|
||||
import { join, dirname, resolve } from 'path';
|
||||
import { homedir } from 'os';
|
||||
import { DATA_DIR_NAME } from './data-dir.js';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { MarketplaceDB } from './db.js';
|
||||
import { SecurityGate, type ScanResult, type SecurityGateConfig } from './security.js';
|
||||
@@ -44,7 +45,7 @@ import type {
|
||||
PluginManifest,
|
||||
} from './types.js';
|
||||
|
||||
const WAGGLE_DIR = join(homedir(), '.waggle');
|
||||
const WAGGLE_DIR = join(homedir(), DATA_DIR_NAME);
|
||||
const SKILLS_DIR = join(WAGGLE_DIR, 'skills');
|
||||
const PLUGINS_DIR = join(WAGGLE_DIR, 'plugins');
|
||||
const REGISTRY_PATH = join(PLUGINS_DIR, 'registry.json');
|
||||
@@ -82,7 +83,7 @@ function isPluginRegistryPath(candidate: string): boolean {
|
||||
}
|
||||
|
||||
// UX-Refactor Phase 4 (C4): the sidecar boot loader reads <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.
|
||||
// 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.
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from 'fs';
|
||||
import { join, dirname } from 'path';
|
||||
import { homedir } from 'os';
|
||||
import { DATA_DIR_NAME } from './data-dir.js';
|
||||
import { execFileSync } from 'child_process';
|
||||
import { createHash } from 'crypto';
|
||||
import type { MarketplacePackage, InstallManifest, McpServerConfig } from './types.js';
|
||||
@@ -180,7 +181,7 @@ const DEFAULT_CONFIG: SecurityGateConfig = {
|
||||
allow_force_bypass: false,
|
||||
gen_trust_hub_url: 'https://ai.gendigital.com/api/scan/lookup',
|
||||
cisco_scanner_args: ['--use-behavioral', '--format', 'json'],
|
||||
cache_dir: join(homedir(), '.waggle', 'security-cache'),
|
||||
cache_dir: join(homedir(), DATA_DIR_NAME, 'security-cache'),
|
||||
cache_ttl_hours: 24,
|
||||
};
|
||||
|
||||
@@ -1108,6 +1109,7 @@ export class SecurityGate {
|
||||
const crossOrigin = [
|
||||
/~\/\.claude\/(?:skills|plugins|hooks|commands)/i,
|
||||
/~\/\.waggle\/skills/i,
|
||||
new RegExp(`~/${DATA_DIR_NAME.replace(/\./g, '\\.')}/skills`, 'i'),
|
||||
/CLAUDE\.md/i,
|
||||
/\.cursorrules/i,
|
||||
/write.*(?:CLAUDE\.md|\.cursorrules|settings\.json|hooks\/)/i,
|
||||
|
||||
@@ -3,6 +3,7 @@ import fs from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { DATA_DIR_NAME } from '../src/data-dir.js';
|
||||
|
||||
const ROOT = path.resolve(import.meta.dirname, '..', '..', '..');
|
||||
const MARKETPLACE_DIR = path.join(ROOT, 'packages', 'marketplace');
|
||||
@@ -50,7 +51,7 @@ function run(
|
||||
}
|
||||
|
||||
function marketplaceDbExists(home: string): boolean {
|
||||
return fs.existsSync(path.join(home, '.waggle', 'marketplace.db'));
|
||||
return fs.existsSync(path.join(home, DATA_DIR_NAME, 'marketplace.db'));
|
||||
}
|
||||
|
||||
function readPackageJson(): {
|
||||
|
||||
@@ -3,6 +3,7 @@ import { homedir, tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { createHash, randomUUID } from 'node:crypto';
|
||||
import { afterAll, afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { DATA_DIR_NAME } from '../src/data-dir.js';
|
||||
import { MarketplaceInstaller } from '../src/installer.js';
|
||||
import {
|
||||
assertSafeGitUrl,
|
||||
@@ -188,8 +189,8 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
|
||||
it('rejects a caller-selected skill path inside the managed directory without overwriting it', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const managedPath = join(isolatedHome, '.waggle', 'skills', 'existing.md');
|
||||
mkdirSync(join(isolatedHome, '.waggle', 'skills'), { recursive: true });
|
||||
const managedPath = join(isolatedHome, DATA_DIR_NAME, 'skills', 'existing.md');
|
||||
mkdirSync(join(isolatedHome, DATA_DIR_NAME, 'skills'), { recursive: true });
|
||||
writeFileSync(managedPath, '# keep', 'utf8');
|
||||
const { installer, recordInstallation } = installerFor(packageFixture());
|
||||
|
||||
@@ -203,7 +204,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('does not clean up a pre-existing plugin directory when a forced reinstall fails', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const name = `existing-plugin-${randomUUID()}`;
|
||||
const pluginDir = join(isolatedHome, '.waggle', 'plugins', name);
|
||||
const pluginDir = join(isolatedHome, DATA_DIR_NAME, 'plugins', name);
|
||||
const sentinel = join(pluginDir, 'keep.txt');
|
||||
mkdirSync(pluginDir, { recursive: true });
|
||||
writeFileSync(sentinel, 'keep', 'utf8');
|
||||
@@ -226,8 +227,8 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
|
||||
it('does not delete the plugin registry when a package name collides with it', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const registryPath = join(isolatedHome, '.waggle', 'plugins', 'registry.json');
|
||||
mkdirSync(join(isolatedHome, '.waggle', 'plugins'), { recursive: true });
|
||||
const registryPath = join(isolatedHome, DATA_DIR_NAME, 'plugins', 'registry.json');
|
||||
mkdirSync(join(isolatedHome, DATA_DIR_NAME, 'plugins'), { recursive: true });
|
||||
writeFileSync(registryPath, '{"keep":true}', 'utf8');
|
||||
const { installer, recordInstallation } = installerFor(packageFixture({
|
||||
name: 'registry.json',
|
||||
@@ -245,8 +246,8 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
|
||||
it('rejects a case-insensitive alias of the reserved plugin registry path', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const registryPath = join(isolatedHome, '.waggle', 'plugins', 'registry.json');
|
||||
mkdirSync(join(isolatedHome, '.waggle', 'plugins'), { recursive: true });
|
||||
const registryPath = join(isolatedHome, DATA_DIR_NAME, 'plugins', 'registry.json');
|
||||
mkdirSync(join(isolatedHome, DATA_DIR_NAME, 'plugins'), { recursive: true });
|
||||
writeFileSync(registryPath, '{"keep":true}', 'utf8');
|
||||
const { installer, recordInstallation } = installerFor(packageFixture({
|
||||
name: 'REGISTRY.JSON',
|
||||
@@ -266,7 +267,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('rejects a traversal identifier before a plugin can escape the plugins directory', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const escapedName = `escaped-${randomUUID()}`;
|
||||
const escapedPath = join(homedir(), '.waggle', escapedName);
|
||||
const escapedPath = join(homedir(), DATA_DIR_NAME, escapedName);
|
||||
cleanupPaths.push(escapedPath);
|
||||
const { installer, recordInstallation } = installerFor(packageFixture({
|
||||
name: `../${escapedName}`,
|
||||
@@ -285,7 +286,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('rejects an uncurated plugin git selector before clone execution', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const name = `git-plugin-${randomUUID()}`;
|
||||
cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name));
|
||||
cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name));
|
||||
const { installer } = installerFor(packageFixture({
|
||||
name,
|
||||
package_type: 'plugin',
|
||||
@@ -303,7 +304,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('rejects a plugin git URL containing shell syntax before process launch', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const name = `git-injection-${randomUUID()}`;
|
||||
cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name));
|
||||
cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name));
|
||||
const { installer } = installerFor(packageFixture({
|
||||
name,
|
||||
package_type: 'plugin',
|
||||
@@ -321,7 +322,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('rejects an uncurated plugin npm selector before lifecycle-script execution', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const name = `npm-plugin-${randomUUID()}`;
|
||||
cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name));
|
||||
cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name));
|
||||
const { installer } = installerFor(packageFixture({
|
||||
name,
|
||||
package_type: 'plugin',
|
||||
@@ -345,7 +346,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
});
|
||||
vi.stubGlobal('fetch', fetchMock);
|
||||
const name = `bundled-skill-${randomUUID()}`;
|
||||
const pluginDir = join(homedir(), '.waggle', 'plugins', name);
|
||||
const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name);
|
||||
cleanupPaths.push(pluginDir);
|
||||
const { installer, getPackageByName, recordInstallation } = installerFor(packageFixture({
|
||||
name,
|
||||
@@ -378,7 +379,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('preserves installation of inline skill content', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const name = `inline-skill-${randomUUID()}`;
|
||||
const skillPath = join(homedir(), '.waggle', 'skills', `${name}.md`);
|
||||
const skillPath = join(homedir(), DATA_DIR_NAME, 'skills', `${name}.md`);
|
||||
cleanupPaths.push(skillPath);
|
||||
const { installer } = installerFor(packageFixture({
|
||||
name,
|
||||
@@ -394,7 +395,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
|
||||
it('installs the exact remote skill bytes that passed the security scan', async () => {
|
||||
const name = `remote-skill-${randomUUID()}`;
|
||||
const skillPath = join(homedir(), '.waggle', 'skills', `${name}.md`);
|
||||
const skillPath = join(homedir(), DATA_DIR_NAME, 'skills', `${name}.md`);
|
||||
cleanupPaths.push(skillPath);
|
||||
const fetchMock = vi.fn()
|
||||
.mockResolvedValueOnce(new Response('# Benign scanned skill'))
|
||||
@@ -419,7 +420,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('rejects plugin npm package shell syntax before process launch', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const name = `npm-injection-${randomUUID()}`;
|
||||
cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name));
|
||||
cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name));
|
||||
const { installer } = installerFor(packageFixture({
|
||||
name,
|
||||
package_type: 'plugin',
|
||||
@@ -458,7 +459,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('rejects custom npm_args instead of treating catalog metadata as npm options', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const name = `npm-args-${randomUUID()}`;
|
||||
cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name));
|
||||
cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name));
|
||||
const { installer } = installerFor(packageFixture({
|
||||
name,
|
||||
package_type: 'plugin',
|
||||
@@ -479,7 +480,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
])('rejects a non-empty $type post-install array before any side effect', async hook => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const name = `post-install-${randomUUID()}`;
|
||||
const pluginDir = join(homedir(), '.waggle', 'plugins', name);
|
||||
const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name);
|
||||
cleanupPaths.push(pluginDir);
|
||||
const { installer, recordInstallation } = installerFor(packageFixture({
|
||||
name,
|
||||
@@ -503,7 +504,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('preserves a plugin manifest containing an exact curated MCP profile', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const name = `curated-mcp-plugin-${randomUUID()}`;
|
||||
const pluginDir = join(homedir(), '.waggle', 'plugins', name);
|
||||
const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name);
|
||||
cleanupPaths.push(pluginDir);
|
||||
const curatedMcp = MCP_SERVERS.find(server => server.name === 'memory')!
|
||||
.install_manifest!.mcp_config!;
|
||||
@@ -532,7 +533,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('maps an embedded plugin MCP setting only to its matching blank environment key', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const name = `brave-plugin-${randomUUID()}`;
|
||||
const pluginDir = join(homedir(), '.waggle', 'plugins', name);
|
||||
const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name);
|
||||
cleanupPaths.push(pluginDir);
|
||||
const braveConfig = MCP_SERVERS.find(server => server.name === 'brave-search')!
|
||||
.install_manifest!.mcp_config!;
|
||||
@@ -570,7 +571,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
|
||||
it('rejects undeclared plugin executable capabilities before writing plugin files', async () => {
|
||||
const name = `plugin-tools-${randomUUID()}`;
|
||||
const pluginDir = join(homedir(), '.waggle', 'plugins', name);
|
||||
const pluginDir = join(homedir(), DATA_DIR_NAME, 'plugins', name);
|
||||
cleanupPaths.push(pluginDir);
|
||||
const pluginManifest = {
|
||||
name,
|
||||
@@ -723,7 +724,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
|
||||
it('rejects an arbitrary launcher embedded in a marketplace plugin manifest', async () => {
|
||||
const name = `plugin-mcp-${randomUUID()}`;
|
||||
cleanupPaths.push(join(homedir(), '.waggle', 'plugins', name));
|
||||
cleanupPaths.push(join(homedir(), DATA_DIR_NAME, 'plugins', name));
|
||||
const { installer, recordInstallation } = installerFor(packageFixture({
|
||||
name,
|
||||
package_type: 'plugin',
|
||||
@@ -829,13 +830,13 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
|
||||
it('rejects an approved MCP manifest cloned under a noncanonical source', async () => {
|
||||
const brave = MCP_SERVERS.find(server => server.name === 'brave-search')!;
|
||||
const configPath = join(isolatedHome, '.waggle', '.mcp.json');
|
||||
const configPath = join(isolatedHome, DATA_DIR_NAME, '.mcp.json');
|
||||
const originalConfig = JSON.stringify({
|
||||
mcpServers: {
|
||||
existing: { command: 'existing-command', args: ['existing-arg'] },
|
||||
},
|
||||
});
|
||||
mkdirSync(join(isolatedHome, '.waggle'), { recursive: true });
|
||||
mkdirSync(join(isolatedHome, DATA_DIR_NAME), { recursive: true });
|
||||
writeFileSync(configPath, originalConfig, 'utf8');
|
||||
const customSource = sourceFixture({
|
||||
id: 77,
|
||||
@@ -983,7 +984,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
const scan = await installer.scanOnly(pkg.id);
|
||||
expect(scan).not.toBeNull();
|
||||
const expectedApprovalIdentity = MarketplaceInstaller.createApprovalIdentity(pkg, scan!);
|
||||
cleanupPaths.push(join(isolatedHome, '.waggle', 'skills', `${name}.md`));
|
||||
cleanupPaths.push(join(isolatedHome, DATA_DIR_NAME, 'skills', `${name}.md`));
|
||||
|
||||
const result = await installer.install({ packageId: pkg.id, expectedApprovalIdentity });
|
||||
|
||||
@@ -1102,7 +1103,7 @@ describe('MarketplaceInstaller security boundaries', () => {
|
||||
it('does not delete outside the plugins directory when uninstalling a traversal identifier', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('server offline')));
|
||||
const escapedName = `uninstall-sentinel-${randomUUID()}`;
|
||||
const escapedPath = join(homedir(), '.waggle', escapedName);
|
||||
const escapedPath = join(homedir(), DATA_DIR_NAME, escapedName);
|
||||
const sentinel = join(escapedPath, 'keep.txt');
|
||||
cleanupPaths.push(escapedPath);
|
||||
mkdirSync(escapedPath, { recursive: true });
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* sources are populated, URLs are well-formed, and sync results have
|
||||
* the correct shape.
|
||||
*
|
||||
* Uses a temporary SQLite database (not the real ~/.waggle/marketplace.db)
|
||||
* Uses a temporary SQLite database (not the real ~/.waggle-community/marketplace.db)
|
||||
* and mocks global fetch to avoid real network calls.
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user