Skip to content

v0.1.0 — Encrypted file vault with CLI and MCP server#3

Merged
jfomhover merged 23 commits into
mainfrom
feat/mvp-scaffold
Apr 23, 2026
Merged

v0.1.0 — Encrypted file vault with CLI and MCP server#3
jfomhover merged 23 commits into
mainfrom
feat/mvp-scaffold

Conversation

@jfomhover

Copy link
Copy Markdown
Contributor

What

Complete MVP implementation of workspace-vault — an encrypted file vault that gives AI agents controlled access to private files via CLI and MCP server.

Highlights

  • CLI — full command suite: init, unlock/lock, read/write/delete, search/grep, key management, audit log
  • MCP server — 5 tools for AI agents (read, create, list, search, grep), gated by user-controlled unlock
  • age encryption — all files encrypted at rest, no custom crypto
  • Multi-key access — multiple passphrases, revoke without re-encrypting
  • Session-based unlock — 30-minute TTL, session file model (no daemon)
  • Audit logging — every operation recorded (never content)
  • Cross-platform — macOS, Linux, Windows

Test coverage

  • 154 tests across 10 test files (unit + integration)
  • CI running on all 3 platforms

Documentation

  • README with quickstart
  • docs/quickstart.md — full setup walkthrough
  • docs/cli.md — CLI reference
  • docs/mcp.md — MCP tools reference
  • spec/security.md — security model
  • CHANGELOG.md for v0.1.0

jfomhover and others added 16 commits April 21, 2026 21:56
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- package.json with dependencies (age-encryption, MCP SDK, commander, better-sqlite3, zod)
- TypeScript strict config targeting ES2022/Node16
- ESLint flat config with typescript-eslint strict
- Vitest for testing with v8 coverage
- Directory structure for all modules
- Placeholder barrel exports

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Matrix: ubuntu-latest, macos-latest, windows-latest
- Node.js 20
- Steps: install, build, lint, test, format check

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- VaultError hierarchy with typed error codes
- OperationType enum for audit trail
- FileMetadata, KeyRecord, AuditEntry, VaultConfig interfaces
- Zod schemas for all CLI/MCP input validation
- DaemonCommand/Request/Response protocol types

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- VaultError hierarchy with typed error codes (session-file model, no daemon)
- OperationType enum for audit trail
- FileMetadata, KeyRecord, AuditEntry, VaultConfig, SessionData interfaces
- Zod schemas for all CLI/MCP input validation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Path traversal prevention with symlink detection
- Windows-specific checks (ADS, reserved names, case-insensitive)
- ANSI/control character stripping for terminal output
- Restrictive file permissions (POSIX 0600/0700)
- Comprehensive unit tests for all security utilities

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- ConfigManager class with load/save/initialize
- Platform-aware config dir (XDG, AppData, Library)
- Restrictive file permissions on config
- 10 unit tests covering initialization, round-trip, overwrite

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- SessionManager: write/read/clear session file with TTL
- Atomic writes via temp file + rename
- Best-effort zero-fill on session clear
- Expiry checking with automatic cleanup
- Session info query (without exposing master key)
- Comprehensive unit tests for full lifecycle

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- VaultEngine: init, writeFile, readFile, deleteFile, listFiles
- MetadataStore: SQLite metadata with WAL mode
- File search (filename/tag match) and content grep
- Multi-key management: add, revoke, list
- Unlock via passphrase-based key matching
- Audit logging integrated into all operations
- Comprehensive unit tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Commands: init, unlock, lock, status, write, read, delete, list, search, grep
- Key management: key add, key list, key revoke
- Audit log viewer
- Interactive passphrase prompting (no echo)
- MCP config snippet on init
- Proper error handling with user-friendly messages
- Unit tests for command registration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Tools: vault_read_file, vault_create_file, vault_list_dir, vault_grep_search, vault_file_search
- Unlock-gated access: content tools require active session
- Metadata tools (list, file_search) work while locked
- Clear error messages guiding user to run vault unlock
- Output sanitization for terminal safety
- Unit tests for all tool behaviors

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rewrote README.md with quickstart, CLI overview, MCP tools table
- Created docs/quickstart.md with full setup walkthrough
- Created docs/cli.md with all commands and options
- Created docs/mcp.md with tool reference and locked/unlocked behavior
- Fixed init command to suggest 'vault mcp' instead of 'npx'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the v0.1.0 MVP of workspace-vault: a Node/TypeScript encrypted file vault with a full-featured CLI plus an MCP server for controlled AI-agent access, backed by age encryption, SQLite metadata/audit logging, and session-based unlock.

Changes:

  • Added core vault engine (init, encrypt/write, decrypt/read, delete, list/search/grep) with SQLite metadata store and audit logger.
  • Added session + config managers, CLI commands (commander) and MCP server tools (stdio transport).
  • Added comprehensive unit + integration tests, CI workflow, and end-user documentation (README + docs + changelog).

Reviewed changes

Copilot reviewed 44 out of 48 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
vitest.config.ts Adds Vitest configuration and coverage settings.
tsconfig.json Adds TS compiler configuration for Node16 ESM build output.
package.json Defines package metadata, CLI bin entry, dependencies, and scripts.
eslint.config.js Adds ESLint + typescript-eslint strict configuration.
.prettierrc Adds Prettier formatting configuration.
.github/workflows/ci.yml Adds cross-platform CI (build/lint/test/format).
src/index.ts Exposes public API exports.
src/types.ts Defines shared errors, enums, types, and Zod schemas.
src/crypto/age.ts Implements age encrypt/decrypt and passphrase mode.
src/crypto/keys.ts Implements keypair generation, passphrase identity derivation, wrap/unwrap helpers.
src/crypto/index.ts Barrel exports for crypto module.
src/security/paths.ts Adds vault path validation and Windows-specific checks.
src/security/sanitize.ts Adds output sanitization + search pattern validation helper.
src/security/permissions.ts Adds best-effort restrictive permission setter.
src/security/index.ts Barrel exports for security module.
src/vault/metadata.ts Implements SQLite metadata/key store.
src/vault/engine.ts Implements VaultEngine operations and audit integration.
src/vault/index.ts Barrel exports for vault module.
src/audit/logger.ts Implements SQLite-based audit logger.
src/audit/index.ts Barrel exports for audit module.
src/session/manager.ts Implements session file write/read/clear with TTL.
src/session/index.ts Barrel exports for session module.
src/config/index.ts Implements config file persistence and OS-specific config paths.
src/cli/prompt.ts Implements interactive passphrase prompting (no-echo).
src/cli/commands.ts Implements CLI command handlers for vault operations + MCP server start.
src/cli/index.ts CLI entrypoint wiring with commander and global error handling.
src/mcp/server.ts Implements MCP tools for list/search/read/create/grep with lock gating.
src/mcp/index.ts Barrel export for MCP server factory.
test/unit/smoke.test.ts Adds trivial smoke test scaffold.
test/unit/vault.test.ts Unit tests for VaultEngine + MetadataStore behaviors.
test/unit/session.test.ts Unit tests for session TTL, read/write/clear, and info display.
test/unit/security.test.ts Unit tests for path validation, sanitization, and permissions.
test/unit/crypto.test.ts Unit tests for crypto primitives and key wrapping/unwrapping.
test/unit/config.test.ts Unit tests for config initialization and load/save.
test/unit/mcp.test.ts Unit tests for MCP tool behaviors (locked vs unlocked).
test/unit/audit.test.ts Unit tests for audit logging correctness and schema constraints.
test/unit/cli.test.ts CLI command registration and basic error handling tests.
test/unit/.gitkeep Keeps unit test directory in repo.
test/integration/vault.integration.test.ts End-to-end integration tests for lifecycle, MCP, audit, and security cases.
test/integration/.gitkeep Keeps integration test directory in repo.
docs/quickstart.md Adds end-user quickstart guide.
docs/cli.md Adds CLI reference documentation.
docs/mcp.md Adds MCP tools reference documentation.
spec/plan.md Captures MVP implementation plan/architecture notes.
README.md Adds full project README with setup and usage overview.
CHANGELOG.md Adds v0.1.0 changelog entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/security/paths.ts Outdated
Comment thread test/unit/cli.test.ts
Comment thread README.md Outdated
Comment thread src/vault/engine.ts
Comment thread src/crypto/keys.ts Outdated
Comment thread src/session/manager.ts Outdated
Comment thread src/vault/engine.ts
Comment thread src/vault/engine.ts
jfomhover and others added 6 commits April 22, 2026 20:37
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add .gitattributes with eol=lf and set Prettier endOfLine to lf.
Fixes Prettier check failing on Windows CI due to CRLF mismatch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removes native addon dependency and deprecated prebuild-install.
Pure WASM SQLite — no platform-specific compilation needed.

- Replace better-sqlite3 with sql.js and @types/sql.js
- Convert AuditLogger and MetadataStore to async factory pattern (static create())
- Add VaultEngine.open() static async factory for opening existing vaults
- Persist database to disk after every write operation
- Remove WAL mode pragmas (not applicable to sql.js)
- Convert sync CLI commands to async where needed
- Update all tests for async construction

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Reject absolute paths in validateVaultPath
- Use masterKey to derive public key in writeFile instead of ignoring it
- Fix unwrapMasterKey detection: check AGE-SECRET-KEY- prefix first
- Windows-safe session file rename with pre-delete fallback
- Distinguish filename vs tag matches in searchFiles
- Validate regex pattern in grepFiles, reject null bytes and long patterns
- Fix CLI test to capture stderr properly using spawnSync

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jfomhover
jfomhover merged commit eccf343 into main Apr 23, 2026
6 checks passed
@jfomhover
jfomhover deleted the feat/mvp-scaffold branch April 23, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants