@memnexus-ai/cli 1.7.61 → 1.7.62
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/dist/commands/commit-context.d.ts +9 -0
- package/dist/commands/commit-context.d.ts.map +1 -0
- package/dist/commands/commit-context.js +210 -0
- package/dist/commands/commit-context.js.map +1 -0
- package/dist/commands/hook.d.ts +12 -0
- package/dist/commands/hook.d.ts.map +1 -0
- package/dist/commands/hook.js +128 -0
- package/dist/commands/hook.js.map +1 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +42 -0
- package/dist/commands/setup.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-help.d.ts.map +1 -1
- package/dist/lib/agent-help.js +18 -0
- package/dist/lib/agent-help.js.map +1 -1
- package/dist/lib/commit-context/git-reader.d.ts +14 -0
- package/dist/lib/commit-context/git-reader.d.ts.map +1 -0
- package/dist/lib/commit-context/git-reader.js +84 -0
- package/dist/lib/commit-context/git-reader.js.map +1 -0
- package/dist/lib/commit-context/heuristic-summarizer.d.ts +18 -0
- package/dist/lib/commit-context/heuristic-summarizer.d.ts.map +1 -0
- package/dist/lib/commit-context/heuristic-summarizer.js +124 -0
- package/dist/lib/commit-context/heuristic-summarizer.js.map +1 -0
- package/dist/lib/commit-context/hook-installer.d.ts +18 -0
- package/dist/lib/commit-context/hook-installer.d.ts.map +1 -0
- package/dist/lib/commit-context/hook-installer.js +140 -0
- package/dist/lib/commit-context/hook-installer.js.map +1 -0
- package/dist/lib/commit-context/index.d.ts +12 -0
- package/dist/lib/commit-context/index.d.ts.map +1 -0
- package/dist/lib/commit-context/index.js +47 -0
- package/dist/lib/commit-context/index.js.map +1 -0
- package/dist/lib/commit-context/local-cache.d.ts +35 -0
- package/dist/lib/commit-context/local-cache.d.ts.map +1 -0
- package/dist/lib/commit-context/local-cache.js +161 -0
- package/dist/lib/commit-context/local-cache.js.map +1 -0
- package/dist/lib/commit-context/session-reader.d.ts +27 -0
- package/dist/lib/commit-context/session-reader.d.ts.map +1 -0
- package/dist/lib/commit-context/session-reader.js +208 -0
- package/dist/lib/commit-context/session-reader.js.map +1 -0
- package/dist/lib/commit-context/types.d.ts +61 -0
- package/dist/lib/commit-context/types.d.ts.map +1 -0
- package/dist/lib/commit-context/types.js +6 -0
- package/dist/lib/commit-context/types.js.map +1 -0
- package/dist/lib/setup/rules-templates.d.ts.map +1 -1
- package/dist/lib/setup/rules-templates.js +2 -0
- package/dist/lib/setup/rules-templates.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getCacheDir = getCacheDir;
|
|
37
|
+
exports.writeCache = writeCache;
|
|
38
|
+
exports.readCache = readCache;
|
|
39
|
+
exports.listCache = listCache;
|
|
40
|
+
exports.markSynced = markSynced;
|
|
41
|
+
exports.markSyncError = markSyncError;
|
|
42
|
+
exports.findProjectRoot = findProjectRoot;
|
|
43
|
+
/**
|
|
44
|
+
* Local Cache — stores commit context entries at .mx/commit-context/<short-sha>.json
|
|
45
|
+
* for offline resilience and batch sync.
|
|
46
|
+
*/
|
|
47
|
+
const fs = __importStar(require("fs"));
|
|
48
|
+
const path = __importStar(require("path"));
|
|
49
|
+
const CACHE_DIR_NAME = '.mx/commit-context';
|
|
50
|
+
/**
|
|
51
|
+
* Get the cache directory path for a project root.
|
|
52
|
+
*/
|
|
53
|
+
function getCacheDir(projectRoot) {
|
|
54
|
+
return path.join(projectRoot, CACHE_DIR_NAME);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Ensure the cache directory exists.
|
|
58
|
+
*/
|
|
59
|
+
function ensureCacheDir(projectRoot) {
|
|
60
|
+
const dir = getCacheDir(projectRoot);
|
|
61
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
62
|
+
return dir;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get the cache file path for a given short SHA.
|
|
66
|
+
*/
|
|
67
|
+
function getCachePath(projectRoot, shortSha) {
|
|
68
|
+
return path.join(getCacheDir(projectRoot), `${shortSha}.json`);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Write a cache entry to disk.
|
|
72
|
+
*/
|
|
73
|
+
function writeCache(projectRoot, entry) {
|
|
74
|
+
ensureCacheDir(projectRoot);
|
|
75
|
+
const filePath = getCachePath(projectRoot, entry.shortSha);
|
|
76
|
+
fs.writeFileSync(filePath, JSON.stringify(entry, null, 2), 'utf8');
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Read a cache entry by short SHA.
|
|
80
|
+
* Returns undefined if not found.
|
|
81
|
+
*/
|
|
82
|
+
function readCache(projectRoot, shortSha) {
|
|
83
|
+
const filePath = getCachePath(projectRoot, shortSha);
|
|
84
|
+
try {
|
|
85
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
86
|
+
return JSON.parse(content);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* List all cached entries, optionally filtered by sync status.
|
|
94
|
+
* Returns entries sorted by timestamp (newest first).
|
|
95
|
+
*/
|
|
96
|
+
function listCache(projectRoot, options) {
|
|
97
|
+
const dir = getCacheDir(projectRoot);
|
|
98
|
+
let files;
|
|
99
|
+
try {
|
|
100
|
+
files = fs.readdirSync(dir).filter((f) => f.endsWith('.json'));
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
const entries = [];
|
|
106
|
+
for (const file of files) {
|
|
107
|
+
try {
|
|
108
|
+
const content = fs.readFileSync(path.join(dir, file), 'utf8');
|
|
109
|
+
const entry = JSON.parse(content);
|
|
110
|
+
if (options?.unsynced && entry.synced)
|
|
111
|
+
continue;
|
|
112
|
+
entries.push(entry);
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
// Skip corrupt files
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Sort newest first
|
|
119
|
+
entries.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
|
|
120
|
+
if (options?.limit) {
|
|
121
|
+
return entries.slice(0, options.limit);
|
|
122
|
+
}
|
|
123
|
+
return entries;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Mark a cache entry as synced with a memory ID.
|
|
127
|
+
*/
|
|
128
|
+
function markSynced(projectRoot, shortSha, memoryId) {
|
|
129
|
+
const entry = readCache(projectRoot, shortSha);
|
|
130
|
+
if (!entry)
|
|
131
|
+
return;
|
|
132
|
+
entry.synced = true;
|
|
133
|
+
entry.memoryId = memoryId;
|
|
134
|
+
delete entry.syncError;
|
|
135
|
+
writeCache(projectRoot, entry);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Mark a cache entry with a sync error.
|
|
139
|
+
*/
|
|
140
|
+
function markSyncError(projectRoot, shortSha, error) {
|
|
141
|
+
const entry = readCache(projectRoot, shortSha);
|
|
142
|
+
if (!entry)
|
|
143
|
+
return;
|
|
144
|
+
entry.synced = false;
|
|
145
|
+
entry.syncError = error;
|
|
146
|
+
writeCache(projectRoot, entry);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Find the git project root by looking for .git directory.
|
|
150
|
+
*/
|
|
151
|
+
function findProjectRoot(cwd = process.cwd()) {
|
|
152
|
+
let dir = path.resolve(cwd);
|
|
153
|
+
while (dir !== path.dirname(dir)) {
|
|
154
|
+
if (fs.existsSync(path.join(dir, '.git'))) {
|
|
155
|
+
return dir;
|
|
156
|
+
}
|
|
157
|
+
dir = path.dirname(dir);
|
|
158
|
+
}
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=local-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-cache.js","sourceRoot":"","sources":["../../../src/lib/commit-context/local-cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,kCAEC;AAqBD,gCAIC;AAMD,8BAQC;AAMD,8BA+BC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1
|
+
import type { SessionContext } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Derive the Claude Code project directory name from a CWD path.
|
|
4
|
+
* Slashes become dashes, leading dash removed.
|
|
5
|
+
*/
|
|
6
|
+
export declare function deriveProjectDirName(cwd: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Find the Claude Code project directory for a given CWD.
|
|
9
|
+
* Returns the path if it exists, undefined otherwise.
|
|
10
|
+
*/
|
|
11
|
+
export declare function findClaudeProjectDir(cwd: string): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Find the most recently modified .jsonl session file in a project directory.
|
|
14
|
+
*/
|
|
15
|
+
export declare function findLatestSession(projectDir: string): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Parse the tail of a session JSONL file, extracting tool calls, prompts, and errors.
|
|
18
|
+
* @param filePath - Path to the .jsonl file
|
|
19
|
+
* @param maxLines - Max lines to read from the end (default 200)
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseSessionTail(filePath: string, maxLines?: number): SessionContext;
|
|
22
|
+
/**
|
|
23
|
+
* Read Claude Code session context for a given working directory.
|
|
24
|
+
* Returns undefined if no session is found.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readSessionContext(cwd?: string): SessionContext | undefined;
|
|
27
|
+
//# sourceMappingURL=session-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-reader.d.ts","sourceRoot":"","sources":["../../../src/lib/commit-context/session-reader.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,SAAS,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAapE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAiBxE;AAaD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY,GAAG,cAAc,CA6EzF;AAqBD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAsB,GAAG,cAAc,GAAG,SAAS,CAQ1F"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.deriveProjectDirName = deriveProjectDirName;
|
|
37
|
+
exports.findClaudeProjectDir = findClaudeProjectDir;
|
|
38
|
+
exports.findLatestSession = findLatestSession;
|
|
39
|
+
exports.parseSessionTail = parseSessionTail;
|
|
40
|
+
exports.readSessionContext = readSessionContext;
|
|
41
|
+
/**
|
|
42
|
+
* Session Reader — finds and parses Claude Code session transcripts.
|
|
43
|
+
*
|
|
44
|
+
* Claude Code stores session data as JSONL files at:
|
|
45
|
+
* ~/.claude/projects/<derived-name>/<session-uuid>.jsonl
|
|
46
|
+
*
|
|
47
|
+
* The derived name is the absolute CWD path with slashes replaced by dashes,
|
|
48
|
+
* leading dash removed. E.g. /home/user/myproject → home-user-myproject
|
|
49
|
+
*/
|
|
50
|
+
const fs = __importStar(require("fs"));
|
|
51
|
+
const path = __importStar(require("path"));
|
|
52
|
+
const os = __importStar(require("os"));
|
|
53
|
+
/**
|
|
54
|
+
* Derive the Claude Code project directory name from a CWD path.
|
|
55
|
+
* Slashes become dashes, leading dash removed.
|
|
56
|
+
*/
|
|
57
|
+
function deriveProjectDirName(cwd) {
|
|
58
|
+
// Normalize and remove trailing slash
|
|
59
|
+
const normalized = path.resolve(cwd);
|
|
60
|
+
// Replace path separators with dashes
|
|
61
|
+
return normalized.replace(/^\//, '').replace(/[/\\]/g, '-');
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Find the Claude Code project directory for a given CWD.
|
|
65
|
+
* Returns the path if it exists, undefined otherwise.
|
|
66
|
+
*/
|
|
67
|
+
function findClaudeProjectDir(cwd) {
|
|
68
|
+
const derived = deriveProjectDirName(cwd);
|
|
69
|
+
const projectDir = path.join(os.homedir(), '.claude', 'projects', derived);
|
|
70
|
+
try {
|
|
71
|
+
const stat = fs.statSync(projectDir);
|
|
72
|
+
if (stat.isDirectory()) {
|
|
73
|
+
return projectDir;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Directory doesn't exist
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Find the most recently modified .jsonl session file in a project directory.
|
|
83
|
+
*/
|
|
84
|
+
function findLatestSession(projectDir) {
|
|
85
|
+
try {
|
|
86
|
+
const files = fs.readdirSync(projectDir).filter((f) => f.endsWith('.jsonl'));
|
|
87
|
+
if (files.length === 0)
|
|
88
|
+
return undefined;
|
|
89
|
+
let latest;
|
|
90
|
+
for (const file of files) {
|
|
91
|
+
const fullPath = path.join(projectDir, file);
|
|
92
|
+
const stat = fs.statSync(fullPath);
|
|
93
|
+
if (!latest || stat.mtimeMs > latest.mtime) {
|
|
94
|
+
latest = { path: fullPath, mtime: stat.mtimeMs };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return latest?.path;
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Parse the tail of a session JSONL file, extracting tool calls, prompts, and errors.
|
|
105
|
+
* @param filePath - Path to the .jsonl file
|
|
106
|
+
* @param maxLines - Max lines to read from the end (default 200)
|
|
107
|
+
*/
|
|
108
|
+
function parseSessionTail(filePath, maxLines = 200) {
|
|
109
|
+
const toolCallMap = new Map();
|
|
110
|
+
const recentPrompts = [];
|
|
111
|
+
const errors = [];
|
|
112
|
+
let model;
|
|
113
|
+
let sessionId;
|
|
114
|
+
try {
|
|
115
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
116
|
+
const lines = content.split('\n').filter(Boolean);
|
|
117
|
+
const tail = lines.slice(-maxLines);
|
|
118
|
+
for (const line of tail) {
|
|
119
|
+
let parsed;
|
|
120
|
+
try {
|
|
121
|
+
parsed = JSON.parse(line);
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
continue; // Skip malformed lines
|
|
125
|
+
}
|
|
126
|
+
// Capture session ID
|
|
127
|
+
if (parsed.sessionId && !sessionId) {
|
|
128
|
+
sessionId = parsed.sessionId;
|
|
129
|
+
}
|
|
130
|
+
// User messages → recent prompts
|
|
131
|
+
if (parsed.type === 'user' && parsed.message?.role === 'user') {
|
|
132
|
+
const userContent = typeof parsed.message.content === 'string'
|
|
133
|
+
? parsed.message.content
|
|
134
|
+
: parsed.message.content
|
|
135
|
+
?.filter((b) => b.type === 'text')
|
|
136
|
+
.map((b) => b.text)
|
|
137
|
+
.join(' ') || '';
|
|
138
|
+
if (userContent.trim()) {
|
|
139
|
+
recentPrompts.push(userContent.trim().slice(0, 200));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// Assistant messages → tool calls and model
|
|
143
|
+
if (parsed.message?.role === 'assistant') {
|
|
144
|
+
if (parsed.message.model) {
|
|
145
|
+
model = parsed.message.model;
|
|
146
|
+
}
|
|
147
|
+
if (Array.isArray(parsed.message.content)) {
|
|
148
|
+
for (const block of parsed.message.content) {
|
|
149
|
+
if (block.type === 'tool_use' && block.name) {
|
|
150
|
+
toolCallMap.set(block.name, (toolCallMap.get(block.name) || 0) + 1);
|
|
151
|
+
}
|
|
152
|
+
// Look for error patterns in text blocks
|
|
153
|
+
if (block.type === 'text' && block.text) {
|
|
154
|
+
extractErrors(block.text, errors);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
// File read error — return empty context
|
|
163
|
+
}
|
|
164
|
+
const toolCalls = Array.from(toolCallMap.entries())
|
|
165
|
+
.map(([name, count]) => ({ name, count }))
|
|
166
|
+
.sort((a, b) => b.count - a.count);
|
|
167
|
+
const totalToolCalls = toolCalls.reduce((sum, tc) => sum + tc.count, 0);
|
|
168
|
+
return {
|
|
169
|
+
agent: 'claude-code',
|
|
170
|
+
model,
|
|
171
|
+
sessionId,
|
|
172
|
+
toolCalls,
|
|
173
|
+
totalToolCalls,
|
|
174
|
+
recentPrompts: recentPrompts.slice(-3), // Last 3 only
|
|
175
|
+
errors: [...new Set(errors)].slice(0, 5), // Deduplicated, max 5
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/** Extract common error patterns from text */
|
|
179
|
+
function extractErrors(text, errors) {
|
|
180
|
+
const patterns = [
|
|
181
|
+
/(?:Error|TypeError|ReferenceError|SyntaxError):\s*(.{10,100})/g,
|
|
182
|
+
/(?:FAIL|FAILED):\s*(.{10,80})/g,
|
|
183
|
+
/(?:error\[)([A-Z]\d+)\]:\s*(.{10,80})/g,
|
|
184
|
+
];
|
|
185
|
+
for (const pattern of patterns) {
|
|
186
|
+
let match;
|
|
187
|
+
while ((match = pattern.exec(text)) !== null) {
|
|
188
|
+
const errMsg = match[0].trim().slice(0, 120);
|
|
189
|
+
if (!errors.includes(errMsg)) {
|
|
190
|
+
errors.push(errMsg);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Read Claude Code session context for a given working directory.
|
|
197
|
+
* Returns undefined if no session is found.
|
|
198
|
+
*/
|
|
199
|
+
function readSessionContext(cwd = process.cwd()) {
|
|
200
|
+
const projectDir = findClaudeProjectDir(cwd);
|
|
201
|
+
if (!projectDir)
|
|
202
|
+
return undefined;
|
|
203
|
+
const sessionFile = findLatestSession(projectDir);
|
|
204
|
+
if (!sessionFile)
|
|
205
|
+
return undefined;
|
|
206
|
+
return parseSessionTail(sessionFile);
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=session-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-reader.js","sourceRoot":"","sources":["../../../src/lib/commit-context/session-reader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;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;AAC9C,SAAS,aAAa,CAAC,IAAY,EAAE,MAAgB;IACnD,MAAM,QAAQ,GAAG;QACf,gEAAgE;QAChE,gCAAgC;QAChC,wCAAwC;KACzC,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,KAAK,CAAC;QACV,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAC7C,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC7B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE;IAC5D,MAAM,UAAU,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,CAAC,UAAU;QAAE,OAAO,SAAS,CAAC;IAElC,MAAM,WAAW,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAC;IAEnC,OAAO,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CommitContext types — interfaces for automatic commit context capture.
|
|
3
|
+
*/
|
|
4
|
+
/** Git state at the time of a commit */
|
|
5
|
+
export interface GitContext {
|
|
6
|
+
sha: string;
|
|
7
|
+
shortSha: string;
|
|
8
|
+
branch: string;
|
|
9
|
+
message: string;
|
|
10
|
+
author: string;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
filesChanged: string[];
|
|
13
|
+
insertions: number;
|
|
14
|
+
deletions: number;
|
|
15
|
+
isMergeCommit: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Parsed info from a single tool call in a session transcript */
|
|
18
|
+
export interface ToolCallInfo {
|
|
19
|
+
name: string;
|
|
20
|
+
count: number;
|
|
21
|
+
}
|
|
22
|
+
/** Context extracted from an AI agent session transcript */
|
|
23
|
+
export interface SessionContext {
|
|
24
|
+
agent: string;
|
|
25
|
+
model?: string;
|
|
26
|
+
sessionId?: string;
|
|
27
|
+
toolCalls: ToolCallInfo[];
|
|
28
|
+
totalToolCalls: number;
|
|
29
|
+
recentPrompts: string[];
|
|
30
|
+
errors: string[];
|
|
31
|
+
}
|
|
32
|
+
/** Combined data for a commit context entry */
|
|
33
|
+
export interface CommitContextData {
|
|
34
|
+
git: GitContext;
|
|
35
|
+
session?: SessionContext;
|
|
36
|
+
content: string;
|
|
37
|
+
contextField: string;
|
|
38
|
+
topics: string[];
|
|
39
|
+
skipped: boolean;
|
|
40
|
+
skipReason?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Fields sent to the MemNexus API for memory creation */
|
|
43
|
+
export interface CommitContextMemoryFields {
|
|
44
|
+
content: string;
|
|
45
|
+
context: string;
|
|
46
|
+
topics: string[];
|
|
47
|
+
conversationId?: string;
|
|
48
|
+
}
|
|
49
|
+
/** Local cache entry stored at .mx/commit-context/<short-sha>.json */
|
|
50
|
+
export interface CacheEntry {
|
|
51
|
+
sha: string;
|
|
52
|
+
shortSha: string;
|
|
53
|
+
branch: string;
|
|
54
|
+
agent: string;
|
|
55
|
+
timestamp: string;
|
|
56
|
+
content: string;
|
|
57
|
+
memoryId?: string;
|
|
58
|
+
synced: boolean;
|
|
59
|
+
syncError?: string;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/commit-context/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,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AG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/commit-context/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-templates.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,QAAA,MAAM,YAAY,wFACgE,CAAC;AACnF,QAAA,MAAM,UAAU,gCAAgC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"rules-templates.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,QAAA,MAAM,YAAY,wFACgE,CAAC;AACnF,QAAA,MAAM,UAAU,gCAAgC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AAoNpC;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,oBAAoB,GACjC,MAAM,CAkBR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGnE"}
|
|
@@ -163,6 +163,8 @@ The \`mx\` CLI provides additional workflows beyond MCP tools:
|
|
|
163
163
|
| Graph health | \`mx entities health\` |
|
|
164
164
|
| Explore topics | \`mx topics discover-related --topic "..."\` |
|
|
165
165
|
| Detect patterns | \`mx patterns detect\` |
|
|
166
|
+
| List commit contexts | \`mx commit-context list --recent 7d\` |
|
|
167
|
+
| Show commit context | \`mx commit-context show <sha>\` |
|
|
166
168
|
| Full CLI help | \`mx agent-help\` |
|
|
167
169
|
|
|
168
170
|
Run \`mx agent-help\` for full AI-optimized documentation of all commands.`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-templates.js","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"rules-templates.js","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA+NH,oCAsBC;AAMD,oDAGC;AA1PD,MAAM,YAAY,GAChB,gFAAgF,CAAC;AAG1E,oCAAY;AAFrB,MAAM,UAAU,GAAG,6BAA6B,CAAC;AAE1B,gCAAU;AAEjC,oEAAoE;AAEpE,SAAS,eAAe;IACtB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EA4HmE,CAAC;AAC7E,CAAC;AAED,oEAAoE;AAEpE,SAAS,aAAa;IACpB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;2EA0BkE,CAAC;AAC5E,CAAC;AAED,oEAAoE;AAEpE,MAAM,WAAW,GAA2B;IAC1C,aAAa,EAAE;;;;;;mEAMkD;IAEjE,MAAM,EAAE;;;;;;mEAMyD;IAEjE,OAAO,EAAE;;;;;;mEAMwD;IAEjE,KAAK,EAAE;;;;;;mDAM0C;IAEjD,gBAAg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