feat(sync): add gitignore-aware drawer prune (#1252)
Add `mempalace sync` CLI command and `mempalace_sync` MCP tool that prune drawers whose source files are gitignored, deleted, or moved out of the project. Reuses the existing GitignoreMatcher infrastructure in mempalace/miner.py so the same gitignore rules that block ingest also drive the corresponding cleanup. Closes #1252.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# MCP Tools Reference
|
||||
|
||||
Detailed parameter schemas for all 29 MCP tools.
|
||||
Detailed parameter schemas for all 30 MCP tools.
|
||||
|
||||
## Palace — Read Tools
|
||||
|
||||
@@ -114,6 +114,20 @@ Delete a drawer by ID. Irreversible.
|
||||
|
||||
---
|
||||
|
||||
### `mempalace_sync`
|
||||
|
||||
Prune drawers whose source files are gitignored, deleted, or moved. Returns a dry-run report by default; pass `apply=true` to commit deletions.
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `project_dir` | string | No | Project root to scope the sync (auto-detected from drawer metadata if omitted) |
|
||||
| `wing` | string | No | Limit to one wing |
|
||||
| `apply` | boolean | No | Actually delete drawers; default is dry-run preview |
|
||||
|
||||
**Returns:** `{ scanned, kept, gitignored, missing, no_source, out_of_scope, removed_drawers, removed_closets, dry_run, by_source }`
|
||||
|
||||
---
|
||||
|
||||
### `mempalace_get_drawer`
|
||||
|
||||
Fetch a single drawer by ID — returns full content and metadata.
|
||||
|
||||
Reference in New Issue
Block a user