memorix 0.9.8 → 0.9.9
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 +7 -0
- package/dist/cli/index.js +34 -13
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.9.9] — 2026-02-25
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **Cursor hooks config format invalid** — Generated config was missing required `version` field and used objects instead of arrays for hook scripts. Cursor requires `{ version: 1, hooks: { eventName: [{ command: "..." }] } }` format. Added `sessionStart`, `beforeShellExecution`, `afterMCPExecution`, `preCompact` events.
|
|
9
|
+
- **Cursor agent detection failed** — Cursor does NOT send `hook_event_name` like Claude Code. Detection now uses Cursor-specific fields (`workspace_roots`, `is_background_agent`, `composer_mode`). Event type inferred from payload structure (e.g., `old_content`/`new_content` → `afterFileEdit`).
|
|
10
|
+
- **Cursor `session_id` field not read** — Normalizer expected `conversation_id` but Cursor sends `session_id`. Now reads both with fallback.
|
|
11
|
+
|
|
5
12
|
## [0.9.8] — 2026-02-25
|
|
6
13
|
|
|
7
14
|
### Fixed
|
package/dist/cli/index.js
CHANGED
|
@@ -3791,17 +3791,17 @@ function generateWindsurfConfig() {
|
|
|
3791
3791
|
}
|
|
3792
3792
|
function generateCursorConfig() {
|
|
3793
3793
|
const cmd = `${resolveHookCommand()} hook`;
|
|
3794
|
+
const hookScript = { command: cmd };
|
|
3794
3795
|
return {
|
|
3796
|
+
version: 1,
|
|
3795
3797
|
hooks: {
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
stop:
|
|
3803
|
-
command: cmd
|
|
3804
|
-
}
|
|
3798
|
+
sessionStart: [hookScript],
|
|
3799
|
+
beforeSubmitPrompt: [hookScript],
|
|
3800
|
+
afterFileEdit: [hookScript],
|
|
3801
|
+
beforeShellExecution: [hookScript],
|
|
3802
|
+
afterMCPExecution: [hookScript],
|
|
3803
|
+
preCompact: [hookScript],
|
|
3804
|
+
stop: [hookScript]
|
|
3805
3805
|
}
|
|
3806
3806
|
};
|
|
3807
3807
|
}
|
|
@@ -6896,7 +6896,7 @@ var init_sync = __esm({
|
|
|
6896
6896
|
// src/hooks/normalizer.ts
|
|
6897
6897
|
function detectAgent(payload) {
|
|
6898
6898
|
if ("agent_action_name" in payload) return "windsurf";
|
|
6899
|
-
if ("
|
|
6899
|
+
if ("workspace_roots" in payload || "is_background_agent" in payload || "composer_mode" in payload) return "cursor";
|
|
6900
6900
|
if ("hook_event_name" in payload) return "claude";
|
|
6901
6901
|
if ("hookEventName" in payload) return "copilot";
|
|
6902
6902
|
if ("event_type" in payload) return "kiro";
|
|
@@ -6908,7 +6908,7 @@ function extractEventName(payload, agent) {
|
|
|
6908
6908
|
case "windsurf":
|
|
6909
6909
|
return payload.agent_action_name ?? "";
|
|
6910
6910
|
case "cursor":
|
|
6911
|
-
return payload
|
|
6911
|
+
return inferCursorEvent(payload);
|
|
6912
6912
|
case "claude":
|
|
6913
6913
|
return payload.hook_event_name ?? payload.hookEventName ?? "";
|
|
6914
6914
|
case "copilot":
|
|
@@ -6984,9 +6984,20 @@ function normalizeWindsurf(payload, event) {
|
|
|
6984
6984
|
}
|
|
6985
6985
|
return result;
|
|
6986
6986
|
}
|
|
6987
|
+
function inferCursorEvent(payload) {
|
|
6988
|
+
if ("composer_mode" in payload) return "sessionStart";
|
|
6989
|
+
if ("prompt" in payload) return "beforeSubmitPrompt";
|
|
6990
|
+
if ("old_content" in payload || "new_content" in payload) return "afterFileEdit";
|
|
6991
|
+
if ("command" in payload && "cwd" in payload) return "beforeShellExecution";
|
|
6992
|
+
if ("trigger" in payload && "context_usage_percent" in payload) return "preCompact";
|
|
6993
|
+
if ("reason" in payload && "duration_ms" in payload) return "sessionEnd";
|
|
6994
|
+
if ("mcp_server_name" in payload) return "afterMCPExecution";
|
|
6995
|
+
if ("reason" in payload) return "stop";
|
|
6996
|
+
return "";
|
|
6997
|
+
}
|
|
6987
6998
|
function normalizeCursor(payload, event) {
|
|
6988
6999
|
const result = {
|
|
6989
|
-
sessionId: payload.conversation_id ?? "",
|
|
7000
|
+
sessionId: payload.session_id ?? payload.conversation_id ?? "",
|
|
6990
7001
|
cwd: payload.cwd ?? ""
|
|
6991
7002
|
};
|
|
6992
7003
|
const roots = payload.workspace_roots;
|
|
@@ -7003,6 +7014,11 @@ function normalizeCursor(payload, event) {
|
|
|
7003
7014
|
case "post_edit":
|
|
7004
7015
|
result.filePath = payload.file_path ?? "";
|
|
7005
7016
|
break;
|
|
7017
|
+
case "post_tool":
|
|
7018
|
+
result.toolName = payload.mcp_server_name ?? "";
|
|
7019
|
+
result.toolInput = payload.mcp_tool_input;
|
|
7020
|
+
result.toolResult = payload.mcp_tool_output;
|
|
7021
|
+
break;
|
|
7006
7022
|
}
|
|
7007
7023
|
return result;
|
|
7008
7024
|
}
|
|
@@ -7069,11 +7085,16 @@ var init_normalizer = __esm({
|
|
|
7069
7085
|
pre_mcp_tool_use: "post_tool",
|
|
7070
7086
|
post_mcp_tool_use: "post_tool",
|
|
7071
7087
|
post_cascade_response: "post_response",
|
|
7072
|
-
// Cursor
|
|
7088
|
+
// Cursor (camelCase event names)
|
|
7089
|
+
sessionStart: "session_start",
|
|
7090
|
+
sessionEnd: "session_end",
|
|
7073
7091
|
beforeSubmitPrompt: "user_prompt",
|
|
7074
7092
|
beforeShellExecution: "post_command",
|
|
7093
|
+
afterShellExecution: "post_command",
|
|
7075
7094
|
beforeMCPExecution: "post_tool",
|
|
7095
|
+
afterMCPExecution: "post_tool",
|
|
7076
7096
|
afterFileEdit: "post_edit",
|
|
7097
|
+
preCompact: "pre_compact",
|
|
7077
7098
|
stop: "session_end"
|
|
7078
7099
|
};
|
|
7079
7100
|
}
|