gitmem-mcp 1.2.0 → 1.2.2
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 +5 -0
- package/bin/init-wizard.js +11 -0
- package/dist/schemas/analyze.d.ts +2 -2
- package/dist/server.js +7 -0
- package/dist/services/metrics.d.ts +1 -1
- package/dist/services/metrics.js +1 -0
- package/dist/services/session-state.d.ts +12 -2
- package/dist/services/session-state.js +28 -0
- package/dist/tools/definitions.d.ts +460 -0
- package/dist/tools/definitions.js +81 -2
- package/dist/tools/reflect-scars.d.ts +20 -0
- package/dist/tools/reflect-scars.js +219 -0
- package/dist/tools/session-close.js +28 -3
- package/dist/types/index.d.ts +24 -0
- package/hooks/scripts/auto-retrieve-hook.sh +31 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.1] - 2026-02-21
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **MCP Registry metadata**: Added `mcpName` field to package.json and `server.json` for official MCP Registry listing.
|
|
14
|
+
|
|
10
15
|
## [1.2.0] - 2026-02-20
|
|
11
16
|
|
|
12
17
|
### Added
|
package/bin/init-wizard.js
CHANGED
|
@@ -253,6 +253,17 @@ function buildClaudeHooks() {
|
|
|
253
253
|
],
|
|
254
254
|
},
|
|
255
255
|
],
|
|
256
|
+
UserPromptSubmit: [
|
|
257
|
+
{
|
|
258
|
+
hooks: [
|
|
259
|
+
{
|
|
260
|
+
type: "command",
|
|
261
|
+
command: `bash ${relScripts}/auto-retrieve-hook.sh`,
|
|
262
|
+
timeout: 3000,
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
],
|
|
256
267
|
PreToolUse: [
|
|
257
268
|
{
|
|
258
269
|
matcher: "Bash",
|
|
@@ -18,12 +18,12 @@ export declare const AnalyzeParamsSchema: z.ZodObject<{
|
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
19
|
project?: string | undefined;
|
|
20
20
|
agent?: string | undefined;
|
|
21
|
-
lens?: "
|
|
21
|
+
lens?: "reflections" | "summary" | "blindspots" | undefined;
|
|
22
22
|
days?: number | undefined;
|
|
23
23
|
}, {
|
|
24
24
|
project?: string | undefined;
|
|
25
25
|
agent?: string | undefined;
|
|
26
|
-
lens?: "
|
|
26
|
+
lens?: "reflections" | "summary" | "blindspots" | undefined;
|
|
27
27
|
days?: number | undefined;
|
|
28
28
|
}>;
|
|
29
29
|
export type AnalyzeParams = z.infer<typeof AnalyzeParamsSchema>;
|
package/dist/server.js
CHANGED
|
@@ -18,6 +18,7 @@ import { recordScarUsage } from "./tools/record-scar-usage.js";
|
|
|
18
18
|
import { recordScarUsageBatch } from "./tools/record-scar-usage-batch.js";
|
|
19
19
|
import { recall } from "./tools/recall.js";
|
|
20
20
|
import { confirmScars } from "./tools/confirm-scars.js";
|
|
21
|
+
import { reflectScars } from "./tools/reflect-scars.js";
|
|
21
22
|
import { saveTranscript } from "./tools/save-transcript.js";
|
|
22
23
|
import { getTranscript } from "./tools/get-transcript.js";
|
|
23
24
|
import { searchTranscripts } from "./tools/search-transcripts.js";
|
|
@@ -103,6 +104,11 @@ export function createServer() {
|
|
|
103
104
|
case "gm-confirm":
|
|
104
105
|
result = await confirmScars(toolArgs);
|
|
105
106
|
break;
|
|
107
|
+
case "reflect_scars":
|
|
108
|
+
case "gitmem-rf":
|
|
109
|
+
case "gm-reflect":
|
|
110
|
+
result = await reflectScars(toolArgs);
|
|
111
|
+
break;
|
|
106
112
|
case "session_start":
|
|
107
113
|
case "gitmem-ss":
|
|
108
114
|
case "gm-open":
|
|
@@ -213,6 +219,7 @@ export function createServer() {
|
|
|
213
219
|
const commands = [
|
|
214
220
|
{ alias: "gitmem-r", full: "recall", description: "Check scars before taking action" },
|
|
215
221
|
{ alias: "gitmem-cs", full: "confirm_scars", description: "Confirm recalled scars (APPLYING/N_A/REFUTED)" },
|
|
222
|
+
{ alias: "gitmem-rf", full: "reflect_scars", description: "End-of-session scar reflection (OBEYED/REFUTED)" },
|
|
216
223
|
{ alias: "gitmem-ss", full: "session_start", description: "Initialize session with context" },
|
|
217
224
|
{ alias: "gitmem-sr", full: "session_refresh", description: "Refresh context for active session" },
|
|
218
225
|
{ alias: "gitmem-sc", full: "session_close", description: "Close session with compliance validation" },
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Tool names that can be tracked
|
|
9
9
|
*/
|
|
10
|
-
export type ToolName = "recall" | "search" | "log" | "session_start" | "session_refresh" | "session_close" | "create_learning" | "create_decision" | "record_scar_usage" | "record_scar_usage_batch" | "save_transcript" | "get_transcript" | "search_transcripts" | "analyze" | "graph_traverse" | "prepare_context" | "absorb_observations" | "list_threads" | "resolve_thread" | "create_thread" | "confirm_scars" | "cleanup_threads" | "health";
|
|
10
|
+
export type ToolName = "recall" | "search" | "log" | "session_start" | "session_refresh" | "session_close" | "create_learning" | "create_decision" | "record_scar_usage" | "record_scar_usage_batch" | "save_transcript" | "get_transcript" | "search_transcripts" | "analyze" | "graph_traverse" | "prepare_context" | "absorb_observations" | "list_threads" | "resolve_thread" | "create_thread" | "confirm_scars" | "reflect_scars" | "cleanup_threads" | "health";
|
|
11
11
|
/**
|
|
12
12
|
* Phase tags for context
|
|
13
13
|
*/
|
package/dist/services/metrics.js
CHANGED
|
@@ -33,6 +33,7 @@ export const PERFORMANCE_TARGETS = {
|
|
|
33
33
|
resolve_thread: 100, // In-memory mutation + file write
|
|
34
34
|
create_thread: 100, // In-memory mutation + file write
|
|
35
35
|
confirm_scars: 500, // In-memory validation + file write
|
|
36
|
+
reflect_scars: 500, // In-memory validation + file write
|
|
36
37
|
cleanup_threads: 2000, // Fetch all threads + lifecycle computation
|
|
37
38
|
health: 100, // In-memory read from EffectTracker
|
|
38
39
|
};
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* This allows recall() to always assign variants even without explicit parameters.
|
|
13
13
|
*/
|
|
14
|
-
import type { SurfacedScar, ScarConfirmation, Observation, SessionChild, ThreadObject } from "../types/index.js";
|
|
14
|
+
import type { SurfacedScar, ScarConfirmation, ScarReflection, Observation, SessionChild, ThreadObject } from "../types/index.js";
|
|
15
15
|
interface SessionContext {
|
|
16
16
|
sessionId: string;
|
|
17
17
|
linearIssue?: string;
|
|
@@ -20,6 +20,7 @@ interface SessionContext {
|
|
|
20
20
|
startedAt: Date;
|
|
21
21
|
surfacedScars: SurfacedScar[];
|
|
22
22
|
confirmations: ScarConfirmation[];
|
|
23
|
+
reflections: ScarReflection[];
|
|
23
24
|
observations: Observation[];
|
|
24
25
|
children: SessionChild[];
|
|
25
26
|
threads: ThreadObject[];
|
|
@@ -28,7 +29,7 @@ interface SessionContext {
|
|
|
28
29
|
* Set the current active session
|
|
29
30
|
* Called by session_start
|
|
30
31
|
*/
|
|
31
|
-
export declare function setCurrentSession(context: Omit<SessionContext, 'surfacedScars' | 'confirmations' | 'observations' | 'children' | 'threads'> & {
|
|
32
|
+
export declare function setCurrentSession(context: Omit<SessionContext, 'surfacedScars' | 'confirmations' | 'reflections' | 'observations' | 'children' | 'threads'> & {
|
|
32
33
|
surfacedScars?: SurfacedScar[];
|
|
33
34
|
observations?: Observation[];
|
|
34
35
|
children?: SessionChild[];
|
|
@@ -71,6 +72,15 @@ export declare function addConfirmations(confirmations: ScarConfirmation[]): voi
|
|
|
71
72
|
* Get all scar confirmations for the current session.
|
|
72
73
|
*/
|
|
73
74
|
export declare function getConfirmations(): ScarConfirmation[];
|
|
75
|
+
/**
|
|
76
|
+
* Add end-of-session scar reflections (OBEYED/REFUTED) to the current session.
|
|
77
|
+
* Called by reflect_scars tool after validation.
|
|
78
|
+
*/
|
|
79
|
+
export declare function addReflections(reflections: ScarReflection[]): void;
|
|
80
|
+
/**
|
|
81
|
+
* Get all end-of-session scar reflections for the current session.
|
|
82
|
+
*/
|
|
83
|
+
export declare function getReflections(): ScarReflection[];
|
|
74
84
|
/**
|
|
75
85
|
* Check if there are recall-surfaced scars that haven't been confirmed.
|
|
76
86
|
* Only checks scars with source "recall" — session_start scars don't require confirmation.
|
|
@@ -22,6 +22,7 @@ export function setCurrentSession(context) {
|
|
|
22
22
|
...context,
|
|
23
23
|
surfacedScars: context.surfacedScars || [],
|
|
24
24
|
confirmations: [],
|
|
25
|
+
reflections: [],
|
|
25
26
|
observations: context.observations || [],
|
|
26
27
|
children: context.children || [],
|
|
27
28
|
threads: context.threads || [],
|
|
@@ -108,6 +109,33 @@ export function addConfirmations(confirmations) {
|
|
|
108
109
|
export function getConfirmations() {
|
|
109
110
|
return currentSession?.confirmations || [];
|
|
110
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Add end-of-session scar reflections (OBEYED/REFUTED) to the current session.
|
|
114
|
+
* Called by reflect_scars tool after validation.
|
|
115
|
+
*/
|
|
116
|
+
export function addReflections(reflections) {
|
|
117
|
+
if (!currentSession) {
|
|
118
|
+
console.warn("[session-state] Cannot add reflections: no active session");
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
for (const ref of reflections) {
|
|
122
|
+
// Replace existing reflection for same scar_id (allow re-reflection)
|
|
123
|
+
const idx = currentSession.reflections.findIndex(r => r.scar_id === ref.scar_id);
|
|
124
|
+
if (idx >= 0) {
|
|
125
|
+
currentSession.reflections[idx] = ref;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
currentSession.reflections.push(ref);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
console.error(`[session-state] Reflections tracked: ${currentSession.reflections.length} total`);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get all end-of-session scar reflections for the current session.
|
|
135
|
+
*/
|
|
136
|
+
export function getReflections() {
|
|
137
|
+
return currentSession?.reflections || [];
|
|
138
|
+
}
|
|
111
139
|
/**
|
|
112
140
|
* Check if there are recall-surfaced scars that haven't been confirmed.
|
|
113
141
|
* Only checks scars with source "recall" — session_start scars don't require confirmation.
|