@kodus/cli 0.4.5 → 0.4.8
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/agents/claude-code.agent.d.ts.map +1 -1
- package/dist/agents/claude-code.agent.js +4 -1
- package/dist/agents/claude-code.agent.js.map +1 -1
- package/dist/agents/codex.agent.d.ts +14 -0
- package/dist/agents/codex.agent.d.ts.map +1 -0
- package/dist/agents/codex.agent.js +77 -0
- package/dist/agents/codex.agent.js.map +1 -0
- package/dist/agents/cursor.agent.d.ts +29 -0
- package/dist/agents/cursor.agent.d.ts.map +1 -0
- package/dist/agents/cursor.agent.js +85 -0
- package/dist/agents/cursor.agent.js.map +1 -0
- package/dist/commands/memory/disable.d.ts.map +1 -1
- package/dist/commands/memory/disable.js +10 -5
- package/dist/commands/memory/disable.js.map +1 -1
- package/dist/commands/memory/enable.d.ts.map +1 -1
- package/dist/commands/memory/enable.js +24 -7
- package/dist/commands/memory/enable.js.map +1 -1
- package/dist/commands/memory/session-hooks/claude-code.d.ts.map +1 -1
- package/dist/commands/memory/session-hooks/claude-code.js +4 -1
- package/dist/commands/memory/session-hooks/claude-code.js.map +1 -1
- package/dist/commands/memory/session-hooks/codex.d.ts +2 -0
- package/dist/commands/memory/session-hooks/codex.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks/codex.js +16 -0
- package/dist/commands/memory/session-hooks/codex.js.map +1 -0
- package/dist/commands/memory/session-hooks/cursor.d.ts.map +1 -1
- package/dist/commands/memory/session-hooks/cursor.js +7 -12
- package/dist/commands/memory/session-hooks/cursor.js.map +1 -1
- package/dist/commands/memory/session-hooks/index.d.ts.map +1 -1
- package/dist/commands/memory/session-hooks/index.js +7 -1
- package/dist/commands/memory/session-hooks/index.js.map +1 -1
- package/dist/commands/memory/session-hooks-install-codex.d.ts +19 -0
- package/dist/commands/memory/session-hooks-install-codex.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks-install-codex.js +91 -0
- package/dist/commands/memory/session-hooks-install-codex.js.map +1 -0
- package/dist/commands/memory/session-hooks-install-cursor.d.ts +9 -0
- package/dist/commands/memory/session-hooks-install-cursor.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks-install-cursor.js +119 -0
- package/dist/commands/memory/session-hooks-install-cursor.js.map +1 -0
- package/dist/commands/memory/session-hooks-install.d.ts.map +1 -1
- package/dist/commands/memory/session-hooks-install.js +3 -2
- package/dist/commands/memory/session-hooks-install.js.map +1 -1
- package/dist/services/lifecycle.service.d.ts +1 -0
- package/dist/services/lifecycle.service.d.ts.map +1 -1
- package/dist/services/lifecycle.service.js +76 -2
- package/dist/services/lifecycle.service.js.map +1 -1
- package/dist/services/session-local.service.d.ts +16 -0
- package/dist/services/session-local.service.d.ts.map +1 -1
- package/dist/services/session-local.service.js +49 -0
- package/dist/services/session-local.service.js.map +1 -1
- package/dist/types/session.d.ts +3 -1
- package/dist/types/session.d.ts.map +1 -1
- package/dist/utils/skills-sync.d.ts.map +1 -1
- package/dist/utils/skills-sync.js +12 -0
- package/dist/utils/skills-sync.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.agent.d.ts","sourceRoot":"","sources":["../../src/agents/claude-code.agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EACR,SAAS,EACT,cAAc,EAEd,UAAU,EACV,qBAAqB,EAExB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-code.agent.d.ts","sourceRoot":"","sources":["../../src/agents/claude-code.agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EACR,SAAS,EACT,cAAc,EAEd,UAAU,EACV,qBAAqB,EAExB,MAAM,qBAAqB,CAAC;AAe7B,qBAAa,eAAgB,YAAW,YAAY;IAChD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAiB;IAE9C,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI;IAgDnE,cAAc,CAChB,cAAc,EAAE,MAAM,EACtB,UAAU,SAAI,GACf,OAAO,CAAC,qBAAqB,CAAC;IAI3B,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIzD,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvD,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/D,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIhE,sBAAsB,CACxB,cAAc,EAAE,MAAM,EACtB,SAAS,SAAO,GACjB,OAAO,CAAC,OAAO,CAAC;CAGtB;AAmBD,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
|
|
@@ -4,9 +4,12 @@ const HOOK_TO_EVENT_TYPE = {
|
|
|
4
4
|
'session-end': 'SessionEnd',
|
|
5
5
|
'stop': 'TurnEnd',
|
|
6
6
|
'user-prompt-submit': 'TurnStart',
|
|
7
|
+
'subagent-start': 'SubagentStart',
|
|
8
|
+
'subagent-stop': 'SubagentEnd',
|
|
9
|
+
'post-todo': 'TurnEnd',
|
|
10
|
+
// Legacy aliases — old installations used PreToolUse(Task)/PostToolUse(Task)
|
|
7
11
|
'pre-task': 'SubagentStart',
|
|
8
12
|
'post-task': 'SubagentEnd',
|
|
9
|
-
'post-todo': 'TurnEnd',
|
|
10
13
|
};
|
|
11
14
|
export class ClaudeCodeAgent {
|
|
12
15
|
agentType = 'claude-code';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.agent.js","sourceRoot":"","sources":["../../src/agents/claude-code.agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE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AAC;IAED,KAAK,CAAC,oBAAoB,CAAC,cAAsB;QAC7C,OAAO,iBAAiB,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,cAAsB;QAC5C,OAAO,iBAAiB,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,sBAAsB,CACxB,cAAsB,EACtB,SAAS,GAAG,IAAI;QAEhB,OAAO,iBAAiB,CAAC,YAAY,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IACrE,CAAC;CACJ;AAED,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAS,UAAU,CACf,GAA4B,EAC5B,IAAc;IAEd,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5C,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentAdapter } from './agent.interface.js';
|
|
2
|
+
import type { AgentType, LifecycleEvent, TokenUsage, TranscriptParseResult } from '../types/session.js';
|
|
3
|
+
export declare class CodexAgent implements AgentAdapter {
|
|
4
|
+
readonly agentType: AgentType;
|
|
5
|
+
parseHookEvent(hookName: string, payload: unknown): LifecycleEvent | null;
|
|
6
|
+
readTranscript(transcriptPath: string, fromOffset?: number): Promise<TranscriptParseResult>;
|
|
7
|
+
extractPrompts(transcriptPath: string): Promise<string[]>;
|
|
8
|
+
extractSummary(transcriptPath: string): Promise<string>;
|
|
9
|
+
extractModifiedFiles(transcriptPath: string): Promise<string[]>;
|
|
10
|
+
calculateTokenUsage(transcriptPath: string): Promise<TokenUsage>;
|
|
11
|
+
waitForTranscriptFlush(transcriptPath: string, timeoutMs?: number): Promise<boolean>;
|
|
12
|
+
}
|
|
13
|
+
export declare const codexAgent: CodexAgent;
|
|
14
|
+
//# sourceMappingURL=codex.agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.agent.d.ts","sourceRoot":"","sources":["../../src/agents/codex.agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EACR,SAAS,EACT,cAAc,EAEd,UAAU,EACV,qBAAqB,EAExB,MAAM,qBAAqB,CAAC;AAqB7B,qBAAa,UAAW,YAAW,YAAY;IAC3C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAW;IAExC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI;IAgCnE,cAAc,CAChB,cAAc,EAAE,MAAM,EACtB,UAAU,SAAI,GACf,OAAO,CAAC,qBAAqB,CAAC;IAI3B,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIzD,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvD,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/D,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIhE,sBAAsB,CACxB,cAAc,EAAE,MAAM,EACtB,SAAS,SAAO,GACjB,OAAO,CAAC,OAAO,CAAC;CAGtB;AAeD,eAAO,MAAM,UAAU,YAAmB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { transcriptService } from '../services/transcript.service.js';
|
|
2
|
+
/**
|
|
3
|
+
* Codex CLI hook-to-event mapping.
|
|
4
|
+
*
|
|
5
|
+
* As of v0.100, Codex only supports two hooks:
|
|
6
|
+
* - AfterAgent (v0.99+) — fires after the agent completes a full turn
|
|
7
|
+
* - AfterToolUse (v0.100+) — fires after each individual tool call
|
|
8
|
+
*
|
|
9
|
+
* Missing hooks (confirmed in development by OpenAI):
|
|
10
|
+
* - SessionStart / SessionEnd
|
|
11
|
+
* - UserPromptSubmit (turn_start)
|
|
12
|
+
* - PreToolUse (blocking)
|
|
13
|
+
*
|
|
14
|
+
* We map AfterAgent → TurnEnd. AfterToolUse is observed but not mapped
|
|
15
|
+
* to a lifecycle event (could be used for analytics later).
|
|
16
|
+
*/
|
|
17
|
+
const HOOK_TO_EVENT_TYPE = {
|
|
18
|
+
AfterAgent: 'TurnEnd',
|
|
19
|
+
};
|
|
20
|
+
export class CodexAgent {
|
|
21
|
+
agentType = 'codex';
|
|
22
|
+
parseHookEvent(hookName, payload) {
|
|
23
|
+
const eventType = HOOK_TO_EVENT_TYPE[hookName];
|
|
24
|
+
if (!eventType) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const obj = payload && typeof payload === 'object' && !Array.isArray(payload)
|
|
28
|
+
? payload
|
|
29
|
+
: {};
|
|
30
|
+
// Codex doesn't provide session_id in hook payloads yet.
|
|
31
|
+
// We use the thread_id or conversation_id if available, otherwise
|
|
32
|
+
// fall back to a generated ID that will be consistent within a session
|
|
33
|
+
// via the local state file.
|
|
34
|
+
const sessionId = pickString(obj, [
|
|
35
|
+
'session_id',
|
|
36
|
+
'sessionId',
|
|
37
|
+
'thread_id',
|
|
38
|
+
'threadId',
|
|
39
|
+
'conversation_id',
|
|
40
|
+
]) ?? '';
|
|
41
|
+
return {
|
|
42
|
+
type: eventType,
|
|
43
|
+
sessionId,
|
|
44
|
+
sessionRef: '',
|
|
45
|
+
timestamp: new Date().toISOString(),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
async readTranscript(transcriptPath, fromOffset = 0) {
|
|
49
|
+
return transcriptService.parse(transcriptPath, fromOffset);
|
|
50
|
+
}
|
|
51
|
+
async extractPrompts(transcriptPath) {
|
|
52
|
+
return transcriptService.extractPrompts(transcriptPath);
|
|
53
|
+
}
|
|
54
|
+
async extractSummary(transcriptPath) {
|
|
55
|
+
return transcriptService.extractSummary(transcriptPath);
|
|
56
|
+
}
|
|
57
|
+
async extractModifiedFiles(transcriptPath) {
|
|
58
|
+
return transcriptService.extractModifiedFiles(transcriptPath);
|
|
59
|
+
}
|
|
60
|
+
async calculateTokenUsage(transcriptPath) {
|
|
61
|
+
return transcriptService.calculateTokenUsage(transcriptPath);
|
|
62
|
+
}
|
|
63
|
+
async waitForTranscriptFlush(transcriptPath, timeoutMs = 3000) {
|
|
64
|
+
return transcriptService.waitForFlush(transcriptPath, timeoutMs);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function pickString(obj, keys) {
|
|
68
|
+
for (const key of keys) {
|
|
69
|
+
const value = obj[key];
|
|
70
|
+
if (typeof value === 'string' && value.trim()) {
|
|
71
|
+
return value.trim();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
export const codexAgent = new CodexAgent();
|
|
77
|
+
//# sourceMappingURL=codex.agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.agent.js","sourceRoot":"","sources":["../../src/agents/codex.agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAUtE;;;;;;;;;;;;;;GAcG;AACH,MAAM,kBAAkB,GAA+C;IACnE,UAAU,EAAE,SAAS;CACxB,CAAC;AAEF,MAAM,OAAO,UAAU;IACV,SAAS,GAAc,OAAO,CAAC;IAExC,cAAc,CAAC,QAAgB,EAAE,OAAgB;QAC7C,MAAM,SAAS,GAAG,kBAAkB,CAAC,QAA0B,CAAC,CAAC;QACjE,IAAI,CAAC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C,cAAc,EAAE,SAAS,CAAC,CAAC;IACrE,CAAC;CACJ;AAED,SAAS,UAAU,CACf,GAA4B,EAC5B,IAAc;IAEd,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5C,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AgentAdapter } from './agent.interface.js';
|
|
2
|
+
import type { AgentType, LifecycleEvent, TokenUsage, TranscriptParseResult } from '../types/session.js';
|
|
3
|
+
/**
|
|
4
|
+
* Cursor agent adapter.
|
|
5
|
+
*
|
|
6
|
+
* Cursor has its own hooks system (.cursor/hooks.json) with payloads that
|
|
7
|
+
* differ from Claude Code. This adapter normalizes Cursor-specific payloads
|
|
8
|
+
* into the shared LifecycleEvent format.
|
|
9
|
+
*
|
|
10
|
+
* Cursor hook payloads (from docs):
|
|
11
|
+
* sessionStart: { session_id, is_background_agent, composer_mode }
|
|
12
|
+
* sessionEnd: { session_id, reason, duration_ms, error }
|
|
13
|
+
* beforeSubmitPrompt: { session_id, prompt, attachments }
|
|
14
|
+
* stop: { session_id, status, loop_count }
|
|
15
|
+
* subagentStart: { session_id, subagent_id, subagent_type, task_description, ... }
|
|
16
|
+
* subagentStop: { session_id, subagent_id, subagent_type, status, summary, duration_ms, modified_files, ... }
|
|
17
|
+
*/
|
|
18
|
+
export declare class CursorAgent implements AgentAdapter {
|
|
19
|
+
readonly agentType: AgentType;
|
|
20
|
+
parseHookEvent(hookName: string, payload: unknown): LifecycleEvent | null;
|
|
21
|
+
readTranscript(transcriptPath: string, fromOffset?: number): Promise<TranscriptParseResult>;
|
|
22
|
+
extractPrompts(transcriptPath: string): Promise<string[]>;
|
|
23
|
+
extractSummary(transcriptPath: string): Promise<string>;
|
|
24
|
+
extractModifiedFiles(transcriptPath: string): Promise<string[]>;
|
|
25
|
+
calculateTokenUsage(transcriptPath: string): Promise<TokenUsage>;
|
|
26
|
+
waitForTranscriptFlush(transcriptPath: string, timeoutMs?: number): Promise<boolean>;
|
|
27
|
+
}
|
|
28
|
+
export declare const cursorAgent: CursorAgent;
|
|
29
|
+
//# sourceMappingURL=cursor.agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.agent.d.ts","sourceRoot":"","sources":["../../src/agents/cursor.agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EACR,SAAS,EACT,cAAc,EAEd,UAAU,EACV,qBAAqB,EAExB,MAAM,qBAAqB,CAAC;AAW7B;;;;;;;;;;;;;;GAcG;AACH,qBAAa,WAAY,YAAW,YAAY;IAC5C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAY;IAEzC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI;IAkCnE,cAAc,CAChB,cAAc,EAAE,MAAM,EACtB,UAAU,SAAI,GACf,OAAO,CAAC,qBAAqB,CAAC;IAI3B,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIzD,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvD,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/D,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIhE,sBAAsB,CACxB,cAAc,EAAE,MAAM,EACtB,SAAS,SAAO,GACjB,OAAO,CAAC,OAAO,CAAC;CAGtB;AAeD,eAAO,MAAM,WAAW,aAAoB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { transcriptService } from '../services/transcript.service.js';
|
|
2
|
+
const HOOK_TO_EVENT_TYPE = {
|
|
3
|
+
sessionStart: 'SessionStart',
|
|
4
|
+
sessionEnd: 'SessionEnd',
|
|
5
|
+
stop: 'TurnEnd',
|
|
6
|
+
beforeSubmitPrompt: 'TurnStart',
|
|
7
|
+
subagentStart: 'SubagentStart',
|
|
8
|
+
subagentStop: 'SubagentEnd',
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Cursor agent adapter.
|
|
12
|
+
*
|
|
13
|
+
* Cursor has its own hooks system (.cursor/hooks.json) with payloads that
|
|
14
|
+
* differ from Claude Code. This adapter normalizes Cursor-specific payloads
|
|
15
|
+
* into the shared LifecycleEvent format.
|
|
16
|
+
*
|
|
17
|
+
* Cursor hook payloads (from docs):
|
|
18
|
+
* sessionStart: { session_id, is_background_agent, composer_mode }
|
|
19
|
+
* sessionEnd: { session_id, reason, duration_ms, error }
|
|
20
|
+
* beforeSubmitPrompt: { session_id, prompt, attachments }
|
|
21
|
+
* stop: { session_id, status, loop_count }
|
|
22
|
+
* subagentStart: { session_id, subagent_id, subagent_type, task_description, ... }
|
|
23
|
+
* subagentStop: { session_id, subagent_id, subagent_type, status, summary, duration_ms, modified_files, ... }
|
|
24
|
+
*/
|
|
25
|
+
export class CursorAgent {
|
|
26
|
+
agentType = 'cursor';
|
|
27
|
+
parseHookEvent(hookName, payload) {
|
|
28
|
+
const eventType = HOOK_TO_EVENT_TYPE[hookName];
|
|
29
|
+
if (!eventType) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const obj = payload && typeof payload === 'object' && !Array.isArray(payload)
|
|
33
|
+
? payload
|
|
34
|
+
: {};
|
|
35
|
+
const sessionId = pickString(obj, ['session_id', 'sessionId']) ?? '';
|
|
36
|
+
const prompt = pickString(obj, ['prompt']);
|
|
37
|
+
const subagentId = pickString(obj, ['subagent_id', 'subagentId']);
|
|
38
|
+
const subagentType = pickString(obj, ['subagent_type', 'subagentType']);
|
|
39
|
+
const taskDescription = pickString(obj, [
|
|
40
|
+
'task_description',
|
|
41
|
+
'taskDescription',
|
|
42
|
+
'task',
|
|
43
|
+
]);
|
|
44
|
+
return {
|
|
45
|
+
type: eventType,
|
|
46
|
+
sessionId,
|
|
47
|
+
sessionRef: '',
|
|
48
|
+
prompt,
|
|
49
|
+
timestamp: new Date().toISOString(),
|
|
50
|
+
toolUseId: subagentId,
|
|
51
|
+
subagentId,
|
|
52
|
+
subagentType,
|
|
53
|
+
taskDescription,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
async readTranscript(transcriptPath, fromOffset = 0) {
|
|
57
|
+
return transcriptService.parse(transcriptPath, fromOffset);
|
|
58
|
+
}
|
|
59
|
+
async extractPrompts(transcriptPath) {
|
|
60
|
+
return transcriptService.extractPrompts(transcriptPath);
|
|
61
|
+
}
|
|
62
|
+
async extractSummary(transcriptPath) {
|
|
63
|
+
return transcriptService.extractSummary(transcriptPath);
|
|
64
|
+
}
|
|
65
|
+
async extractModifiedFiles(transcriptPath) {
|
|
66
|
+
return transcriptService.extractModifiedFiles(transcriptPath);
|
|
67
|
+
}
|
|
68
|
+
async calculateTokenUsage(transcriptPath) {
|
|
69
|
+
return transcriptService.calculateTokenUsage(transcriptPath);
|
|
70
|
+
}
|
|
71
|
+
async waitForTranscriptFlush(transcriptPath, timeoutMs = 3000) {
|
|
72
|
+
return transcriptService.waitForFlush(transcriptPath, timeoutMs);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function pickString(obj, keys) {
|
|
76
|
+
for (const key of keys) {
|
|
77
|
+
const value = obj[key];
|
|
78
|
+
if (typeof value === 'string' && value.trim()) {
|
|
79
|
+
return value.trim();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
export const cursorAgent = new CursorAgent();
|
|
85
|
+
//# sourceMappingURL=cursor.agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.agent.js","sourceRoot":"","sources":["../../src/agents/cursor.agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAUtE,MAAM,kBAAkB,GAAuC;IAC3D,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,SAAS;IACf,kBAAkB,EAAE,WAAW;IAC/B,aAAa,EAAE,eAAe;IAC9B,YAAY,EAAE,aAAa;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,WAAW;IACX,SAAS,GAAc,QAAQ,CAAC;IAEzC,cAAc,CAAC,QAAgB,EAAE,OAAgB;QAC7C,MAAM,SAAS,GAAG,kBAAkB,CAAC,QAA2B,CAAC,CAAC;QAClE,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,GAAG,GACL,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;YAC7D,CAAC,CAAE,OAAmC;YACtC,CAAC,CAAC,EAAE,CAAC;QAEb,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;QACrE,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC3C,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;QAClE,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC;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,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5C,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/disable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/disable.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAY1D,wBAAsB,aAAa,CAC/B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,EAClC,UAAU,CAAC,EAAE,aAAa,GAC3B,OAAO,CAAC,IAAI,CAAC,CAkFf"}
|
|
@@ -2,6 +2,8 @@ import chalk from 'chalk';
|
|
|
2
2
|
import { gitService } from '../../services/git.service.js';
|
|
3
3
|
import { removeClaudeCompatibleHooks, removeCodexNotify, resolveCodexConfigPath, } from './hooks.js';
|
|
4
4
|
import { removeSessionHooks } from './session-hooks-install.js';
|
|
5
|
+
import { removeCursorSessionHooks } from './session-hooks-install-cursor.js';
|
|
6
|
+
import { removeCodexSessionHooks } from './session-hooks-install-codex.js';
|
|
5
7
|
import { exitWithCode } from '../../utils/cli-exit.js';
|
|
6
8
|
import { cliError, cliInfo } from '../../utils/logger.js';
|
|
7
9
|
import { createCommandContext } from '../../utils/command-context.js';
|
|
@@ -41,13 +43,16 @@ export async function disableAction(options = {}, globalOpts) {
|
|
|
41
43
|
}
|
|
42
44
|
const claudeResult = await removeClaudeCompatibleHooks(gitRoot);
|
|
43
45
|
const sessionResult = await removeSessionHooks(gitRoot);
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
46
|
+
const cursorResult = await removeCursorSessionHooks(gitRoot);
|
|
47
|
+
const codexConfigPath = resolveCodexConfigPath();
|
|
48
|
+
const codexResult = await removeCodexNotify(codexConfigPath);
|
|
49
|
+
const codexSessionResult = await removeCodexSessionHooks(codexConfigPath);
|
|
47
50
|
cliInfo(chalk.green('\u2713 Decision hooks removed.'));
|
|
48
|
-
cliInfo(` Decision capture hooks: ${
|
|
49
|
-
cliInfo(`
|
|
51
|
+
cliInfo(` Decision capture hooks: ${claudeResult.removed ? 'removed' : 'not found'}`);
|
|
52
|
+
cliInfo(` Claude Code session hooks: ${sessionResult.removed ? 'removed' : 'not found'}`);
|
|
53
|
+
cliInfo(` Cursor session hooks: ${cursorResult.removed ? 'removed' : 'not found'}`);
|
|
50
54
|
cliInfo(` Codex notify: ${codexResult.removed ? 'removed' : 'not found'}`);
|
|
55
|
+
cliInfo(` Codex session hooks: ${codexSessionResult.removed ? 'removed' : 'not found'}`);
|
|
51
56
|
}
|
|
52
57
|
catch (error) {
|
|
53
58
|
const normalized = normalizeCommandError(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disable.js","sourceRoot":"","sources":["../../../src/commands/memory/disable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EACH,2BAA2B,EAC3B,iBAAiB,EACjB,sBAAsB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACH,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,YAAY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QACpD,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/enable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/enable.ts"],"names":[],"mappings":"AAcA,UAAU,aAAa;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAuExE"}
|
|
@@ -2,6 +2,8 @@ import chalk from 'chalk';
|
|
|
2
2
|
import { gitService } from '../../services/git.service.js';
|
|
3
3
|
import { parseAgents, installClaudeCompatibleHooks, installCodexNotify, resolveCodexConfigPath, } from './hooks.js';
|
|
4
4
|
import { installSessionHooks } from './session-hooks-install.js';
|
|
5
|
+
import { installCursorSessionHooks } from './session-hooks-install-cursor.js';
|
|
6
|
+
import { installCodexSessionHooks } from './session-hooks-install-codex.js';
|
|
5
7
|
import { exitWithCode } from '../../utils/cli-exit.js';
|
|
6
8
|
import { cliError, cliInfo } from '../../utils/logger.js';
|
|
7
9
|
export async function enableAction(options) {
|
|
@@ -27,31 +29,46 @@ export async function enableAction(options) {
|
|
|
27
29
|
const result = await installClaudeCompatibleHooks(gitRoot);
|
|
28
30
|
captureStatus = result.changed ? 'installed' : 'already configured';
|
|
29
31
|
}
|
|
30
|
-
// 2. Session tracking hooks (Claude Code
|
|
32
|
+
// 2. Session tracking hooks (Claude Code)
|
|
31
33
|
let sessionStatus = 'skipped';
|
|
32
|
-
if (
|
|
34
|
+
if (agents.has('claude')) {
|
|
33
35
|
const result = await installSessionHooks(gitRoot, 'claude-code');
|
|
34
36
|
sessionStatus = result.changed ? 'installed' : 'already configured';
|
|
35
37
|
}
|
|
36
|
-
// 3.
|
|
38
|
+
// 3. Session tracking hooks (Cursor — native .cursor/hooks.json)
|
|
39
|
+
let cursorSessionStatus = 'skipped';
|
|
40
|
+
if (agents.has('cursor')) {
|
|
41
|
+
const result = await installCursorSessionHooks(gitRoot);
|
|
42
|
+
cursorSessionStatus = result.changed
|
|
43
|
+
? 'installed'
|
|
44
|
+
: 'already configured';
|
|
45
|
+
}
|
|
46
|
+
// 4. Codex notify + session hooks
|
|
37
47
|
let codexStatus = 'skipped';
|
|
48
|
+
let codexSessionStatus = 'skipped';
|
|
38
49
|
if (installCodex) {
|
|
39
50
|
const codexConfigPath = resolveCodexConfigPath(options.codexConfig);
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
51
|
+
const notifyResult = await installCodexNotify(codexConfigPath);
|
|
52
|
+
if (notifyResult.changed) {
|
|
42
53
|
codexStatus = 'installed';
|
|
43
54
|
}
|
|
44
|
-
else if (
|
|
55
|
+
else if (notifyResult.skipped) {
|
|
45
56
|
codexStatus = 'skipped (existing notify entry)';
|
|
46
57
|
}
|
|
47
58
|
else {
|
|
48
59
|
codexStatus = 'already configured';
|
|
49
60
|
}
|
|
61
|
+
const sessionResult = await installCodexSessionHooks(codexConfigPath);
|
|
62
|
+
codexSessionStatus = sessionResult.changed
|
|
63
|
+
? 'installed'
|
|
64
|
+
: 'already configured';
|
|
50
65
|
}
|
|
51
66
|
// Summary
|
|
52
67
|
cliInfo(chalk.green('\u2713 Decisions enabled for this repository.'));
|
|
53
68
|
cliInfo(` Decision capture hooks: ${captureStatus}`);
|
|
54
|
-
cliInfo(`
|
|
69
|
+
cliInfo(` Claude Code session hooks: ${sessionStatus}`);
|
|
70
|
+
cliInfo(` Cursor session hooks: ${cursorSessionStatus}`);
|
|
55
71
|
cliInfo(` Codex notify: ${codexStatus}`);
|
|
72
|
+
cliInfo(` Codex session hooks: ${codexSessionStatus}`);
|
|
56
73
|
}
|
|
57
74
|
//# sourceMappingURL=enable.js.map
|
|
@@ -1 +1 @@
|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AAkC;IAClC,IAAI,WAAW,GAAG,SAAS,CAAC;IAC5B,IAAI,kBAAkB,GAAG,SAAS,CAAC;IACnC,IAAI,YAAY,EAAE,CAAC;QACf,MAAM,eAAe,GAAG,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACpE,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC,eAAe,CAAC,CAAC;QAC/D,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YACvB,WAAW,GAAG,WAAW,CAAC;QAC9B,CAAC;aAAM,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YAC9B,WAAW,GAAG,iCAAiC,CAAC;QACpD,CAAC;aAAM,CAAC;YACJ,WAAW,GAAG,oBAAoB,CAAC;QACvC,CAAC;QAED,MAAM,aAAa,GACf,MAAM,wBAAwB,CAAC,eAAe,CAAC,CAAC;QACpD,kBAAkB,GAAG,aAAa,CAAC,OAAO;YACtC,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,oBAAoB,CAAC;IAC/B,CAAC;IAED,UAAU;IACV,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,6BAA6B,aAAa,EAAE,CAAC,CAAC;IACtD,OAAO,CAAC,gCAAgC,aAAa,EAAE,CAAC,CAAC;IACzD,OAAO,CAAC,2BAA2B,mBAAmB,EAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,mBAAmB,WAAW,EAAE,CAAC,CAAC;IAC1C,OAAO,CAAC,0BAA0B,kBAAkB,EAAE,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/claude-code.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/claude-code.ts"],"names":[],"mappings":"AAiBA,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAS1E"}
|
|
@@ -5,9 +5,12 @@ const VALID_HOOKS = new Set([
|
|
|
5
5
|
'session-end',
|
|
6
6
|
'stop',
|
|
7
7
|
'user-prompt-submit',
|
|
8
|
+
'subagent-start',
|
|
9
|
+
'subagent-stop',
|
|
10
|
+
'post-todo',
|
|
11
|
+
// Legacy aliases
|
|
8
12
|
'pre-task',
|
|
9
13
|
'post-task',
|
|
10
|
-
'post-todo',
|
|
11
14
|
]);
|
|
12
15
|
export async function claudeCodeHookAction(hookName) {
|
|
13
16
|
if (!VALID_HOOKS.has(hookName)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,WAAW,GAA6B,IAAI,GAAG,CAAC;IAClD,eAAe;IACf,aAAa;IACb,MAAM;IACN,oBAAoB;IACpB,
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,WAAW,GAA6B,IAAI,GAAG,CAAC;IAClD,eAAe;IACf,aAAa;IACb,MAAM;IACN,oBAAoB;IACpB,gBAAgB;IAChB,eAAe;IACf,WAAW;IACX,iBAAiB;IACjB,UAAU;IACV,WAAW;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,QAAgB;IACvD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAA+B,CAAC,EAAE,CAAC;QACpD,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM,EAAE,CAAC;YACvC,OAAO,CAAC,KAAK,CAAC,yCAAyC,QAAQ,EAAE,CAAC,CAAC;QACvE,CAAC;QACD,OAAO;IACX,CAAC;IAED,MAAM,UAAU,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/codex.ts"],"names":[],"mappings":"AASA,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASrE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { codexAgent } from '../../../agents/codex.agent.js';
|
|
2
|
+
import { handleHook } from './shared.js';
|
|
3
|
+
const VALID_HOOKS = new Set([
|
|
4
|
+
'AfterAgent',
|
|
5
|
+
'AfterToolUse',
|
|
6
|
+
]);
|
|
7
|
+
export async function codexHookAction(hookName) {
|
|
8
|
+
if (!VALID_HOOKS.has(hookName)) {
|
|
9
|
+
if (process.env.KODUS_VERBOSE === 'true') {
|
|
10
|
+
console.error(`[decisions] unknown Codex hook: ${hookName}`);
|
|
11
|
+
}
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
await handleHook(codexAgent, hookName);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=codex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC;IAC7C,YAAY;IACZ,cAAc;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB;IAClD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAA0B,CAAC,EAAE,CAAC;QAC/C,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM,EAAE,CAAC;YACvC,OAAO,CAAC,KAAK,CAAC,mCAAmC,QAAQ,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,OAAO;IACX,CAAC;IAED,MAAM,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/cursor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/cursor.ts"],"names":[],"mappings":"AAaA,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAStE"}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cursorAgent } from '../../../agents/cursor.agent.js';
|
|
2
2
|
import { handleHook } from './shared.js';
|
|
3
|
-
/**
|
|
4
|
-
* Cursor uses the same Claude Code hooks format (same settings.json schema),
|
|
5
|
-
* so we reuse the Claude Code agent adapter.
|
|
6
|
-
*/
|
|
7
3
|
const VALID_HOOKS = new Set([
|
|
8
|
-
'
|
|
9
|
-
'
|
|
4
|
+
'sessionStart',
|
|
5
|
+
'sessionEnd',
|
|
10
6
|
'stop',
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'post-todo',
|
|
7
|
+
'beforeSubmitPrompt',
|
|
8
|
+
'subagentStart',
|
|
9
|
+
'subagentStop',
|
|
15
10
|
]);
|
|
16
11
|
export async function cursorHookAction(hookName) {
|
|
17
12
|
if (!VALID_HOOKS.has(hookName)) {
|
|
@@ -20,6 +15,6 @@ export async function cursorHookAction(hookName) {
|
|
|
20
15
|
}
|
|
21
16
|
return;
|
|
22
17
|
}
|
|
23
|
-
await handleHook(
|
|
18
|
+
await handleHook(cursorAgent, hookName);
|
|
24
19
|
}
|
|
25
20
|
//# sourceMappingURL=cursor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,WAAW,GAAyB,IAAI,GAAG,CAAC;IAC9C,cAAc;IACd,YAAY;IACZ,MAAM;IACN,oBAAoB;IACpB,eAAe;IACf,cAAc;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IACnD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAA2B,CAAC,EAAE,CAAC;QAChD,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM,EAAE,CAAC;YACvC,OAAO,CAAC,KAAK,CAAC,oCAAoC,QAAQ,EAAE,CAAC,CAAC;QAClE,CAAC;QACD,OAAO;IACX,CAAC;IAED,MAAM,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,mBAAmB,SAE/B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { claudeCodeHookAction } from './claude-code.js';
|
|
3
3
|
import { cursorHookAction } from './cursor.js';
|
|
4
|
+
import { codexHookAction } from './codex.js';
|
|
4
5
|
export const sessionHooksCommand = new Command('hooks').description('Internal session lifecycle hook handlers');
|
|
5
6
|
sessionHooksCommand
|
|
6
7
|
.command('claude-code')
|
|
@@ -10,6 +11,11 @@ sessionHooksCommand
|
|
|
10
11
|
sessionHooksCommand
|
|
11
12
|
.command('cursor')
|
|
12
13
|
.description('Handle Cursor lifecycle hooks')
|
|
13
|
-
.argument('<hook-name>', 'Hook event name (
|
|
14
|
+
.argument('<hook-name>', 'Hook event name (sessionStart, sessionEnd, stop, beforeSubmitPrompt, subagentStart, subagentStop)')
|
|
14
15
|
.action(cursorHookAction);
|
|
16
|
+
sessionHooksCommand
|
|
17
|
+
.command('codex')
|
|
18
|
+
.description('Handle Codex CLI lifecycle hooks')
|
|
19
|
+
.argument('<hook-name>', 'Hook event name (AfterAgent, AfterToolUse)')
|
|
20
|
+
.action(codexHookAction);
|
|
15
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/memory/session-hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAC/D,0CAA0C,CAC7C,CAAC;AAEF,mBAAmB;KACd,OAAO,CAAC,aAAa,CAAC;KACtB,WAAW,CAAC,oCAAoC,CAAC;KACjD,QAAQ,CACL,aAAa,EACb,wGAAwG,CAC3G;KACA,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAElC,mBAAmB;KACd,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,+BAA+B,CAAC;KAC5C,QAAQ,CACL,aAAa,EACb,mGAAmG,CACtG;KACA,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE9B,mBAAmB;KACd,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,kCAAkC,CAAC;KAC/C,QAAQ,CACL,aAAa,EACb,4CAA4C,CAC/C;KACA,MAAM,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Installs Codex session tracking hooks into ~/.codex/config.toml.
|
|
3
|
+
*
|
|
4
|
+
* Codex uses TOML [[hooks]] arrays:
|
|
5
|
+
* [[hooks]]
|
|
6
|
+
* event = "AfterAgent"
|
|
7
|
+
* command = "kodus decisions hooks codex AfterAgent"
|
|
8
|
+
*
|
|
9
|
+
* Currently only AfterAgent is useful (maps to TurnEnd).
|
|
10
|
+
*/
|
|
11
|
+
export declare function installCodexSessionHooks(configPath: string): Promise<{
|
|
12
|
+
configPath: string;
|
|
13
|
+
changed: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function removeCodexSessionHooks(configPath: string): Promise<{
|
|
16
|
+
configPath: string;
|
|
17
|
+
removed: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=session-hooks-install-codex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-hooks-install-codex.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/session-hooks-install-codex.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAC1C,UAAU,EAAE,MAAM,GACnB,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAgCnD;AAED,wBAAsB,uBAAuB,CACzC,UAAU,EAAE,MAAM,GACnB,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAgDnD"}
|