@danielmarbach/mnemonic-mcp 0.11.3 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +1 -0
- package/build/git.d.ts +17 -0
- package/build/git.d.ts.map +1 -1
- package/build/git.js +83 -6
- package/build/git.js.map +1 -1
- package/build/index.js +130 -4
- package/build/index.js.map +1 -1
- package/build/structured-content.d.ts +64 -0
- package/build/structured-content.d.ts.map +1 -1
- package/build/structured-content.js +22 -0
- package/build/structured-content.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ All notable changes to `mnemonic` will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is loosely based on Keep a Changelog and uses semver-style version headings.
|
|
6
6
|
|
|
7
|
+
## [0.12.1] - 2026-03-18
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- `sync` now surfaces git failures as structured per-phase errors (`fetch`, `pull`, `push`) instead of silently swallowing them — merge conflicts include conflicted file paths and an actionable resolution hint.
|
|
12
|
+
- `SyncResult` structured output gains a `gitError` field per vault so callers can distinguish a clean no-op from a failed sync.
|
|
13
|
+
|
|
14
|
+
## [0.12.0] - 2026-03-15
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `discover_tags` MCP tool: lists existing tags with usage counts, example note titles, lifecycle distribution, and `isTemporaryOnly` flags for consistent tag terminology across sessions.
|
|
19
|
+
|
|
7
20
|
## [0.11.3] - 2026-03-15
|
|
8
21
|
|
|
9
22
|
### Fixed
|
package/README.md
CHANGED
|
@@ -410,6 +410,7 @@ Imported notes are written to the main vault with `lifecycle: permanent` and `sc
|
|
|
410
410
|
|-----------------------------|--------------------------------------------------------------------------|
|
|
411
411
|
| `consolidate` | Merge multiple notes into one with relationship to sources |
|
|
412
412
|
| `detect_project` | Resolve `cwd` to stable project id via git remote URL |
|
|
413
|
+
| `discover_tags` | List existing tags with usage counts and examples for consistent terminology |
|
|
413
414
|
| `execute_migration` | Execute a named migration (supports dry-run) |
|
|
414
415
|
| `forget` | Delete note + embedding, git commit + push, cleanup relationships |
|
|
415
416
|
| `get` | Fetch one or more notes by exact id |
|
package/build/git.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export declare class GitOperationError extends Error {
|
|
2
2
|
constructor(operation: "add" | "commit" | "push", cause: unknown);
|
|
3
3
|
}
|
|
4
|
+
export interface SyncGitError {
|
|
5
|
+
/** Which git operation failed */
|
|
6
|
+
phase: "fetch" | "pull" | "push";
|
|
7
|
+
message: string;
|
|
8
|
+
/** True when the failure is a merge/rebase conflict requiring manual resolution */
|
|
9
|
+
isConflict: boolean;
|
|
10
|
+
/** Files with conflict markers, when detectable */
|
|
11
|
+
conflictFiles?: string[];
|
|
12
|
+
}
|
|
4
13
|
export interface SyncResult {
|
|
5
14
|
hasRemote: boolean;
|
|
6
15
|
/** Note ids that arrived or changed during pull (need re-embedding) */
|
|
@@ -9,6 +18,8 @@ export interface SyncResult {
|
|
|
9
18
|
deletedNoteIds: string[];
|
|
10
19
|
/** Number of local commits pushed to remote */
|
|
11
20
|
pushedCommits: number;
|
|
21
|
+
/** Set when any git operation in the sync sequence failed */
|
|
22
|
+
gitError?: SyncGitError;
|
|
12
23
|
}
|
|
13
24
|
export interface CommitResult {
|
|
14
25
|
status: "committed" | "skipped" | "failed";
|
|
@@ -65,6 +76,12 @@ export declare class GitOps {
|
|
|
65
76
|
* re-embedding for notes that arrived from the remote.
|
|
66
77
|
*/
|
|
67
78
|
sync(): Promise<SyncResult>;
|
|
79
|
+
private getConflictFiles;
|
|
80
|
+
/**
|
|
81
|
+
* Checks git's internal state files to detect an in-progress rebase or merge conflict.
|
|
82
|
+
* Language-independent: these paths are git internals, not localized error messages.
|
|
83
|
+
*/
|
|
84
|
+
private isConflictInProgress;
|
|
68
85
|
/** Push only — used after individual remember/update/forget commits */
|
|
69
86
|
push(): Promise<void>;
|
|
70
87
|
pushWithStatus(): Promise<PushResult>;
|
package/build/git.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAIA,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO;CAKjE;AAED,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,UAAU,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,2CAA2C;IAC3C,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC3C,MAAM,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,OAAO,CAAC;IACjD,sDAAsD;IACtD,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACxC,MAAM,CAAC,EAAE,cAAc,GAAG,WAAW,GAAG,oBAAoB,GAAG,eAAe,CAAC;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,OAAO,CAAU;gBAEb,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,MAAgB;IAMpD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3B;;;;;;;;;;;;;;;;;;OAkBG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQzE,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAmC9F;;;OAGG;YACW,YAAY;IA4B1B;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;YA6EnB,gBAAgB;IAS9B;;;OAGG;YACW,oBAAoB;IAkBlC,uEAAuE;IACjE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC;YAiB7B,WAAW;YASX,oBAAoB;IASlC;;;OAGG;YACW,cAAc;CAuC7B"}
|
package/build/git.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { access } from "fs/promises";
|
|
2
|
+
import path from "path";
|
|
1
3
|
import { simpleGit } from "simple-git";
|
|
2
4
|
export class GitOperationError extends Error {
|
|
3
5
|
constructor(operation, cause) {
|
|
@@ -135,21 +137,96 @@ export class GitOps {
|
|
|
135
137
|
const remotes = await this.git.getRemotes();
|
|
136
138
|
if (remotes.length === 0)
|
|
137
139
|
return empty;
|
|
140
|
+
const withRemote = {
|
|
141
|
+
hasRemote: true,
|
|
142
|
+
pulledNoteIds: [],
|
|
143
|
+
deletedNoteIds: [],
|
|
144
|
+
pushedCommits: 0,
|
|
145
|
+
};
|
|
146
|
+
// Phase 1: fetch
|
|
138
147
|
try {
|
|
139
148
|
await this.git.fetch();
|
|
140
|
-
|
|
141
|
-
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
152
|
+
console.error(`[git] Sync fetch failed: ${message}`);
|
|
153
|
+
return { ...withRemote, gitError: { phase: "fetch", message, isConflict: false } };
|
|
154
|
+
}
|
|
155
|
+
const unpushed = await this.countUnpushedCommits();
|
|
156
|
+
const localHead = await this.currentHead();
|
|
157
|
+
// Phase 2: pull (rebase)
|
|
158
|
+
try {
|
|
142
159
|
await this.git.pull(["--rebase"]);
|
|
143
160
|
console.error("[git] Pulled (rebase)");
|
|
144
|
-
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
164
|
+
console.error(`[git] Sync pull failed: ${message}`);
|
|
165
|
+
// Use language-independent checks: conflicted files from git status (porcelain codes,
|
|
166
|
+
// not localized) and git internal state files (.git/rebase-merge, .git/rebase-apply,
|
|
167
|
+
// .git/MERGE_HEAD) rather than error message keywords.
|
|
168
|
+
const conflictFiles = await this.getConflictFiles();
|
|
169
|
+
const isConflict = conflictFiles.length > 0 || await this.isConflictInProgress();
|
|
170
|
+
return {
|
|
171
|
+
...withRemote,
|
|
172
|
+
gitError: {
|
|
173
|
+
phase: "pull",
|
|
174
|
+
message,
|
|
175
|
+
isConflict,
|
|
176
|
+
conflictFiles: conflictFiles.length > 0 ? conflictFiles : undefined,
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
const { pulledNoteIds, deletedNoteIds } = await this.diffNotesSince(localHead);
|
|
181
|
+
// Phase 3: push
|
|
182
|
+
try {
|
|
145
183
|
await this.git.push();
|
|
146
184
|
console.error(`[git] Pushed ${unpushed} local commit(s)`);
|
|
147
|
-
return { hasRemote: true, pulledNoteIds, deletedNoteIds, pushedCommits: unpushed };
|
|
148
185
|
}
|
|
149
186
|
catch (err) {
|
|
150
|
-
|
|
151
|
-
|
|
187
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
188
|
+
console.error(`[git] Sync push failed: ${message}`);
|
|
189
|
+
// Pull succeeded — return partial success with the pulled notes and the push error
|
|
190
|
+
return {
|
|
191
|
+
hasRemote: true,
|
|
192
|
+
pulledNoteIds,
|
|
193
|
+
deletedNoteIds,
|
|
194
|
+
pushedCommits: 0,
|
|
195
|
+
gitError: { phase: "push", message, isConflict: false },
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
return { hasRemote: true, pulledNoteIds, deletedNoteIds, pushedCommits: unpushed };
|
|
199
|
+
}
|
|
200
|
+
async getConflictFiles() {
|
|
201
|
+
try {
|
|
202
|
+
const status = await this.git.status();
|
|
203
|
+
return status.conflicted;
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
return [];
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Checks git's internal state files to detect an in-progress rebase or merge conflict.
|
|
211
|
+
* Language-independent: these paths are git internals, not localized error messages.
|
|
212
|
+
*/
|
|
213
|
+
async isConflictInProgress() {
|
|
214
|
+
const gitDir = path.join(this.gitRoot, ".git");
|
|
215
|
+
const statePaths = [
|
|
216
|
+
path.join(gitDir, "rebase-merge"), // interactive / --merge rebase
|
|
217
|
+
path.join(gitDir, "rebase-apply"), // --apply strategy rebase
|
|
218
|
+
path.join(gitDir, "MERGE_HEAD"), // plain merge conflict
|
|
219
|
+
];
|
|
220
|
+
for (const p of statePaths) {
|
|
221
|
+
try {
|
|
222
|
+
await access(p);
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
// not present — try next
|
|
227
|
+
}
|
|
152
228
|
}
|
|
229
|
+
return false;
|
|
153
230
|
}
|
|
154
231
|
/** Push only — used after individual remember/update/forget commits */
|
|
155
232
|
async push() {
|
package/build/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAElD,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,SAAoC,EAAE,KAAc;QAC9D,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,KAAK,CAAC,OAAO,SAAS,YAAY,MAAM,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAElD,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,SAAoC,EAAE,KAAc;QAC9D,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,KAAK,CAAC,OAAO,SAAS,YAAY,MAAM,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAsCD,MAAM,OAAO,MAAM;IACT,GAAG,CAAa;IACP,OAAO,CAAS;IACjC;;;OAGG;IACc,WAAW,CAAS;IAC7B,OAAO,CAAU;IAEzB,YAAY,OAAe,E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AC,GAAG,KAAyB,CAAC;gBACrD,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC;oBAAE,SAAS;gBAEzC,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAE7D,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnB,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC1B,CAAC;qBAAM,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBACtE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;YAED,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;QAC3C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;QACnD,CAAC;IACH,CAAC;CACF"}
|
package/build/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import { checkBranchChange } from "./branch-tracker.js";
|
|
|
19
19
|
import { Migrator } from "./migration.js";
|
|
20
20
|
import { parseMemorySections } from "./import.js";
|
|
21
21
|
import { defaultClaudeHome, defaultVaultPath, resolveUserPath } from "./paths.js";
|
|
22
|
-
import { RememberResultSchema, RecallResultSchema, ListResultSchema, GetResultSchema, UpdateResultSchema, ForgetResultSchema, MoveResultSchema, RelateResultSchema, RecentResultSchema, MemoryGraphResultSchema, ProjectSummaryResultSchema, SyncResultSchema, WhereIsResultSchema, ConsolidateResultSchema, ProjectIdentityResultSchema, MigrationListResultSchema, MigrationExecuteResultSchema, PolicyResultSchema, } from "./structured-content.js";
|
|
22
|
+
import { RememberResultSchema, RecallResultSchema, ListResultSchema, GetResultSchema, UpdateResultSchema, ForgetResultSchema, MoveResultSchema, RelateResultSchema, RecentResultSchema, MemoryGraphResultSchema, ProjectSummaryResultSchema, SyncResultSchema, WhereIsResultSchema, ConsolidateResultSchema, ProjectIdentityResultSchema, MigrationListResultSchema, MigrationExecuteResultSchema, PolicyResultSchema, DiscoverTagsResultSchema, } from "./structured-content.js";
|
|
23
23
|
// ── CLI Migration Command ─────────────────────────────────────────────────────
|
|
24
24
|
if (process.argv[2] === "migrate") {
|
|
25
25
|
const VAULT_PATH = process.env["VAULT_PATH"]
|
|
@@ -580,10 +580,28 @@ async function removeStaleEmbeddings(storage, noteIds) {
|
|
|
580
580
|
catch { /* already gone */ }
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
|
-
function formatSyncResult(result, label) {
|
|
583
|
+
function formatSyncResult(result, label, vaultPath) {
|
|
584
584
|
if (!result.hasRemote)
|
|
585
585
|
return [`${label}: no remote configured — git sync skipped.`];
|
|
586
586
|
const lines = [];
|
|
587
|
+
if (result.gitError) {
|
|
588
|
+
const { phase, message, isConflict, conflictFiles } = result.gitError;
|
|
589
|
+
if (isConflict) {
|
|
590
|
+
lines.push(`${label}: ✗ merge conflict during ${phase}.`);
|
|
591
|
+
if (conflictFiles && conflictFiles.length > 0) {
|
|
592
|
+
lines.push(`${label}: conflicted files: ${conflictFiles.join(", ")}`);
|
|
593
|
+
}
|
|
594
|
+
const where = vaultPath ?? label;
|
|
595
|
+
lines.push(`${label}: resolve conflicts in ${where}, then run sync again.`);
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
lines.push(`${label}: ✗ git ${phase} failed: ${message}`);
|
|
599
|
+
}
|
|
600
|
+
// Still report any partial pull results that came through before the failure
|
|
601
|
+
if (result.pulledNoteIds.length > 0)
|
|
602
|
+
lines.push(`${label}: ↓ ${result.pulledNoteIds.length} note(s) pulled before failure.`);
|
|
603
|
+
return lines;
|
|
604
|
+
}
|
|
587
605
|
lines.push(result.pushedCommits > 0
|
|
588
606
|
? `${label}: ↑ pushed ${result.pushedCommits} commit(s).`
|
|
589
607
|
: `${label}: ↑ nothing to push.`);
|
|
@@ -2169,6 +2187,106 @@ server.registerTool("list", {
|
|
|
2169
2187
|
};
|
|
2170
2188
|
return { content: [{ type: "text", text: textContent }], structuredContent };
|
|
2171
2189
|
});
|
|
2190
|
+
// ── discover_tags ───────────────────────────────────────────────────────────
|
|
2191
|
+
server.registerTool("discover_tags", {
|
|
2192
|
+
title: "Discover Tags",
|
|
2193
|
+
description: "Discover existing tags across vaults with usage statistics and examples.\n\n" +
|
|
2194
|
+
"Use this when:\n" +
|
|
2195
|
+
"- Before `remember` to find canonical tag names for consistent terminology\n" +
|
|
2196
|
+
"- Starting a new topic and unsure which tags exist (e.g., 'bug' vs 'bugs')\n" +
|
|
2197
|
+
"- Identifying tags only on temporary notes (cleanup candidates)\n\n" +
|
|
2198
|
+
"Do not use this when:\n" +
|
|
2199
|
+
"- You need to browse notes by tag; use `list` with `tags` filter instead\n" +
|
|
2200
|
+
"- You already know the exact tags you want to use\n\n" +
|
|
2201
|
+
"Returns:\n" +
|
|
2202
|
+
"- Tags sorted by usageCount (canonical tags first)\n" +
|
|
2203
|
+
"- Example note titles (up to 3 per tag) showing usage context\n" +
|
|
2204
|
+
"- lifecycleTypes showing temporary vs permanent distribution\n" +
|
|
2205
|
+
"- isTemporaryOnly flag identifying cleanup candidates\n\n" +
|
|
2206
|
+
"Typical next step:\n" +
|
|
2207
|
+
"- Use canonical tags from discover_tags when appropriate, or create new tags when genuinely novel.\n\n" +
|
|
2208
|
+
"Performance: O(n) where n = total notes scanned. Expect 100-200ms for 500 notes.\n\n" +
|
|
2209
|
+
"Read-only.",
|
|
2210
|
+
annotations: {
|
|
2211
|
+
readOnlyHint: true,
|
|
2212
|
+
idempotentHint: true,
|
|
2213
|
+
openWorldHint: false,
|
|
2214
|
+
},
|
|
2215
|
+
inputSchema: z.object({
|
|
2216
|
+
cwd: projectParam,
|
|
2217
|
+
scope: z
|
|
2218
|
+
.enum(["project", "global", "all"])
|
|
2219
|
+
.optional()
|
|
2220
|
+
.default("all")
|
|
2221
|
+
.describe("'project' = only this project's memories; " +
|
|
2222
|
+
"'global' = only unscoped memories; " +
|
|
2223
|
+
"'all' = everything visible (default)"),
|
|
2224
|
+
storedIn: z
|
|
2225
|
+
.enum(["project-vault", "main-vault", "any"])
|
|
2226
|
+
.optional()
|
|
2227
|
+
.default("any")
|
|
2228
|
+
.describe("Filter by vault storage label like list tool."),
|
|
2229
|
+
}),
|
|
2230
|
+
outputSchema: DiscoverTagsResultSchema,
|
|
2231
|
+
}, async ({ cwd, scope, storedIn }) => {
|
|
2232
|
+
await ensureBranchSynced(cwd);
|
|
2233
|
+
const startTime = Date.now();
|
|
2234
|
+
const { project, entries } = await collectVisibleNotes(cwd, scope, undefined, storedIn);
|
|
2235
|
+
const tagStats = new Map();
|
|
2236
|
+
for (const { note } of entries) {
|
|
2237
|
+
for (const tag of note.tags) {
|
|
2238
|
+
const stats = tagStats.get(tag) || { count: 0, examples: [], lifecycles: new Set() };
|
|
2239
|
+
stats.count++;
|
|
2240
|
+
if (stats.examples.length < 3) {
|
|
2241
|
+
stats.examples.push(note.title);
|
|
2242
|
+
}
|
|
2243
|
+
stats.lifecycles.add(note.lifecycle);
|
|
2244
|
+
tagStats.set(tag, stats);
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
const tags = Array.from(tagStats.entries())
|
|
2248
|
+
.map(([tag, stats]) => ({
|
|
2249
|
+
tag,
|
|
2250
|
+
usageCount: stats.count,
|
|
2251
|
+
examples: stats.examples,
|
|
2252
|
+
lifecycleTypes: Array.from(stats.lifecycles),
|
|
2253
|
+
isTemporaryOnly: stats.lifecycles.size === 1 && stats.lifecycles.has("temporary"),
|
|
2254
|
+
}))
|
|
2255
|
+
.sort((a, b) => b.usageCount - a.usageCount);
|
|
2256
|
+
const durationMs = Date.now() - startTime;
|
|
2257
|
+
const lines = [];
|
|
2258
|
+
if (project && scope !== "global") {
|
|
2259
|
+
lines.push(`Tags for ${project.name} (scope: ${scope}):`);
|
|
2260
|
+
}
|
|
2261
|
+
else {
|
|
2262
|
+
lines.push(`Tags (scope: ${scope}):`);
|
|
2263
|
+
}
|
|
2264
|
+
lines.push("");
|
|
2265
|
+
lines.push(`Total: ${tags.length} unique tags across ${entries.length} notes (${durationMs}ms)`);
|
|
2266
|
+
lines.push("");
|
|
2267
|
+
lines.push("Tags sorted by usage:");
|
|
2268
|
+
for (const t of tags.slice(0, 20)) {
|
|
2269
|
+
const lifecycleMark = t.isTemporaryOnly ? " [temp-only]" : "";
|
|
2270
|
+
lines.push(` ${t.tag} (${t.usageCount})${lifecycleMark}`);
|
|
2271
|
+
if (t.examples.length > 0) {
|
|
2272
|
+
lines.push(` Example: "${t.examples[0]}"`);
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
if (tags.length > 20) {
|
|
2276
|
+
lines.push(` ... and ${tags.length - 20} more`);
|
|
2277
|
+
}
|
|
2278
|
+
const structuredContent = {
|
|
2279
|
+
action: "tags_discovered",
|
|
2280
|
+
project: project ? { id: project.id, name: project.name } : undefined,
|
|
2281
|
+
scope: scope || "all",
|
|
2282
|
+
tags,
|
|
2283
|
+
totalTags: tags.length,
|
|
2284
|
+
totalNotes: entries.length,
|
|
2285
|
+
vaultsSearched: new Set(entries.map(e => storageLabel(e.vault))).size,
|
|
2286
|
+
durationMs,
|
|
2287
|
+
};
|
|
2288
|
+
return { content: [{ type: "text", text: lines.join("\n") }], structuredContent };
|
|
2289
|
+
});
|
|
2172
2290
|
// ── recent_memories ───────────────────────────────────────────────────────────
|
|
2173
2291
|
server.registerTool("recent_memories", {
|
|
2174
2292
|
title: "Recent Memories",
|
|
@@ -2443,8 +2561,9 @@ server.registerTool("sync", {
|
|
|
2443
2561
|
const lines = [];
|
|
2444
2562
|
const vaultResults = [];
|
|
2445
2563
|
// Always sync main vault
|
|
2564
|
+
const mainVaultPath = vaultManager.main.storage.vaultPath;
|
|
2446
2565
|
const mainResult = await vaultManager.main.git.sync();
|
|
2447
|
-
lines.push(...formatSyncResult(mainResult, "main vault"));
|
|
2566
|
+
lines.push(...formatSyncResult(mainResult, "main vault", mainVaultPath));
|
|
2448
2567
|
let mainEmbedded = 0;
|
|
2449
2568
|
let mainFailed = [];
|
|
2450
2569
|
const mainBackfill = await backfillEmbeddingsAfterSync(vaultManager.main.storage, "main vault", lines, force);
|
|
@@ -2461,13 +2580,15 @@ server.registerTool("sync", {
|
|
|
2461
2580
|
pushed: mainResult.pushedCommits,
|
|
2462
2581
|
embedded: mainEmbedded,
|
|
2463
2582
|
failed: mainFailed,
|
|
2583
|
+
gitError: mainResult.gitError,
|
|
2464
2584
|
});
|
|
2465
2585
|
// Optionally sync project vault
|
|
2466
2586
|
if (cwd) {
|
|
2467
2587
|
const projectVault = await vaultManager.getProjectVaultIfExists(cwd);
|
|
2468
2588
|
if (projectVault) {
|
|
2589
|
+
const projectVaultPath = projectVault.storage.vaultPath;
|
|
2469
2590
|
const projectResult = await projectVault.git.sync();
|
|
2470
|
-
lines.push(...formatSyncResult(projectResult, "project vault"));
|
|
2591
|
+
lines.push(...formatSyncResult(projectResult, "project vault", projectVaultPath));
|
|
2471
2592
|
let projEmbedded = 0;
|
|
2472
2593
|
let projFailed = [];
|
|
2473
2594
|
const projectBackfill = await backfillEmbeddingsAfterSync(projectVault.storage, "project vault", lines, force);
|
|
@@ -2484,6 +2605,7 @@ server.registerTool("sync", {
|
|
|
2484
2605
|
pushed: projectResult.pushedCommits,
|
|
2485
2606
|
embedded: projEmbedded,
|
|
2486
2607
|
failed: projFailed,
|
|
2608
|
+
gitError: projectResult.gitError,
|
|
2487
2609
|
});
|
|
2488
2610
|
}
|
|
2489
2611
|
else {
|
|
@@ -3751,6 +3873,10 @@ server.registerPrompt("mnemonic-workflow-hint", {
|
|
|
3751
3873
|
" Use `relate` to connect related memories.\n" +
|
|
3752
3874
|
" Use `consolidate` when several memories overlap.\n" +
|
|
3753
3875
|
" Use `move` when a memory is stored in the wrong place.\n\n" +
|
|
3876
|
+
"### Consistent tag terminology\n\n" +
|
|
3877
|
+
"Before `remember`, call `discover_tags` to find canonical tag names already in use.\n" +
|
|
3878
|
+
"This keeps terminology consistent across sessions (e.g., preferring 'bug' over 'bugs').\n" +
|
|
3879
|
+
"Use high-usage tags as the canonical forms, and avoid tags marked `isTemporaryOnly`.\n\n" +
|
|
3754
3880
|
"### Storage model\n\n" +
|
|
3755
3881
|
"Memories can live in:\n" +
|
|
3756
3882
|
"- `main-vault` for global knowledge\n" +
|