@vedtechsolutions/engram-mcp 1.0.22 → 1.0.24

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.
Files changed (2) hide show
  1. package/dist/hook.js +27 -9
  2. package/package.json +1 -1
package/dist/hook.js CHANGED
@@ -3331,15 +3331,8 @@ function sanitizeCognitiveState(state) {
3331
3331
  return path.split(/[/\\]/).pop() ?? path;
3332
3332
  });
3333
3333
  const uniqueFiles = [...new Set(editedFiles)].slice(-5);
3334
- if (uniqueFiles.length > 0) {
3335
- if (cog.current_approach && cog.current_approach.length >= 10) {
3336
- state.active_task = cog.current_approach.slice(0, 150);
3337
- } else {
3338
- state.active_task = `Working on ${uniqueFiles.join(", ")}`;
3339
- }
3340
- }
3341
- if (!state.active_task && state.recent_prompts && state.recent_prompts.length > 0) {
3342
- const taskVerbs = /^(fix|add|create|update|implement|remove|refactor|build|change|move|write|make|set|run|deploy|test|commit|push|install|configure|debug|solve|enable|disable|start|stop|check|verify|analyze|review|audit|optimize|clean|delete|migrate|upgrade|publish|get|do|finish)/i;
3334
+ const taskVerbs = /^(fix|add|create|update|implement|remove|refactor|build|change|move|write|make|set|run|deploy|test|commit|push|install|configure|debug|solve|enable|disable|start|stop|check|verify|analyze|review|audit|optimize|clean|delete|migrate|upgrade|publish|get|do|finish)/i;
3335
+ if (state.recent_prompts && state.recent_prompts.length > 0) {
3343
3336
  for (let i = state.recent_prompts.length - 1; i >= 0; i--) {
3344
3337
  const prompt = state.recent_prompts[i];
3345
3338
  const first = prompt.split(/[.!?\n]/)[0]?.trim();
@@ -3349,6 +3342,15 @@ function sanitizeCognitiveState(state) {
3349
3342
  }
3350
3343
  }
3351
3344
  }
3345
+ if (!state.active_task && cog.current_approach && cog.current_approach.length >= 10) {
3346
+ const firstSentence = cog.current_approach.split(/[.!?\n]/)[0]?.trim();
3347
+ if (firstSentence && firstSentence.length >= 10 && firstSentence.length <= 150) {
3348
+ state.active_task = firstSentence;
3349
+ }
3350
+ }
3351
+ if (!state.active_task && uniqueFiles.length > 0) {
3352
+ state.active_task = `Working on ${uniqueFiles.join(", ")}`;
3353
+ }
3352
3354
  }
3353
3355
  if (state.session_files.length > 0) {
3354
3356
  state.session_files = state.session_files.filter((f) => {
@@ -3768,6 +3770,12 @@ Output: ${truncate(toolOutput, 500)}`,
3768
3770
  if (state.recent_tool_names.length > 10) {
3769
3771
  state.recent_tool_names = state.recent_tool_names.slice(-10);
3770
3772
  }
3773
+ state.cognitive_state = updateCognitiveState(
3774
+ state.cognitive_state,
3775
+ { type: "tool_call", toolName: "Bash", inputSummary: truncate(cmd, 100) },
3776
+ state.recent_tool_names,
3777
+ state.recent_errors
3778
+ );
3771
3779
  state.recent_actions.push({
3772
3780
  tool: "Bash",
3773
3781
  target: truncate(cmd, 120),
@@ -4259,6 +4267,16 @@ function handlePostWrite(toolInput, argFallback) {
4259
4267
  const filePath = input?.file_path ?? input?.path ?? "";
4260
4268
  if (!filePath) return;
4261
4269
  const state = loadWatcherState();
4270
+ state.recent_tool_names.push("Edit");
4271
+ if (state.recent_tool_names.length > 10) {
4272
+ state.recent_tool_names = state.recent_tool_names.slice(-10);
4273
+ }
4274
+ state.cognitive_state = updateCognitiveState(
4275
+ state.cognitive_state,
4276
+ { type: "tool_call", toolName: "Edit", inputSummary: filePath },
4277
+ state.recent_tool_names,
4278
+ state.recent_errors
4279
+ );
4262
4280
  {
4263
4281
  const newStr = input?.new_string ?? "";
4264
4282
  const firstNewLine = newStr.split("\n").find((l) => l.trim().length > 0) ?? "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vedtechsolutions/engram-mcp",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Cognitive memory system for AI — persistent, cross-session learning via MCP",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",