cogpit-memory 0.1.9 → 0.1.10
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/README.md +26 -5
- package/dist/cli.d.ts +30 -0
- package/dist/cli.js +1114 -178
- package/dist/commands/context.d.ts +20 -0
- package/dist/commands/index-cmd.d.ts +15 -0
- package/dist/commands/install-skill.d.ts +4 -0
- package/dist/commands/search.d.ts +39 -0
- package/dist/commands/sessions.d.ts +41 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +1117 -180
- package/dist/lib/codex-patches.d.ts +9 -0
- package/dist/lib/codex-tool-normalization.d.ts +8 -0
- package/dist/lib/codex.d.ts +30 -0
- package/dist/lib/dirs.d.ts +8 -0
- package/dist/lib/helpers.d.ts +11 -0
- package/dist/lib/interactiveState.d.ts +35 -0
- package/dist/lib/messageTypeGuards.d.ts +17 -0
- package/dist/lib/metadata.d.ts +31 -0
- package/dist/lib/parser.d.ts +14 -0
- package/dist/lib/pricingTiers.d.ts +30 -0
- package/dist/lib/response.d.ts +2 -0
- package/dist/lib/search-index.d.ts +154 -0
- package/dist/lib/sessionStats.d.ts +6 -0
- package/dist/lib/sessionStatus.d.ts +36 -0
- package/dist/lib/token-costs.d.ts +48 -0
- package/dist/lib/turnBuilder.d.ts +5 -0
- package/dist/lib/types.d.ts +401 -0
- package/package.json +13 -7
- package/skill/SKILL.md +4 -4
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
export interface TextBlock {
|
|
2
|
+
type: "text";
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ThinkingBlock {
|
|
6
|
+
type: "thinking";
|
|
7
|
+
thinking: string;
|
|
8
|
+
signature: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ToolUseBlock {
|
|
11
|
+
type: "tool_use";
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
input: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export interface ToolResultBlock {
|
|
17
|
+
type: "tool_result";
|
|
18
|
+
tool_use_id: string;
|
|
19
|
+
content: string | ContentBlock[];
|
|
20
|
+
is_error?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface Base64MediaSource {
|
|
23
|
+
type: "base64";
|
|
24
|
+
media_type: string;
|
|
25
|
+
data: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ImageBlock {
|
|
28
|
+
type: "image";
|
|
29
|
+
source: Base64MediaSource;
|
|
30
|
+
}
|
|
31
|
+
export interface DocumentBlock {
|
|
32
|
+
type: "document";
|
|
33
|
+
source: Base64MediaSource;
|
|
34
|
+
}
|
|
35
|
+
export interface AudioBlock {
|
|
36
|
+
type: "audio";
|
|
37
|
+
source: Base64MediaSource;
|
|
38
|
+
}
|
|
39
|
+
/** Claude emits this when an API request falls back from one model to another. */
|
|
40
|
+
export interface FallbackBlock {
|
|
41
|
+
type: "fallback";
|
|
42
|
+
from: {
|
|
43
|
+
model: string;
|
|
44
|
+
};
|
|
45
|
+
to: {
|
|
46
|
+
model: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export type ContentBlock = TextBlock | ThinkingBlock | ToolUseBlock | ToolResultBlock | ImageBlock | DocumentBlock | AudioBlock | FallbackBlock;
|
|
50
|
+
export type UserContent = string | ContentBlock[];
|
|
51
|
+
interface BaseMessage {
|
|
52
|
+
type: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
parentUuid?: string | null;
|
|
55
|
+
isSidechain?: boolean;
|
|
56
|
+
cwd?: string;
|
|
57
|
+
sessionId?: string;
|
|
58
|
+
version?: string;
|
|
59
|
+
gitBranch?: string;
|
|
60
|
+
uuid?: string;
|
|
61
|
+
timestamp?: string;
|
|
62
|
+
userType?: string;
|
|
63
|
+
slug?: string;
|
|
64
|
+
}
|
|
65
|
+
/** Summary result from an Agent/Task tool call (new format, v2.1.63+) */
|
|
66
|
+
export interface AgentToolUseResult {
|
|
67
|
+
status: string;
|
|
68
|
+
prompt: string;
|
|
69
|
+
agentId: string;
|
|
70
|
+
content: ContentBlock[];
|
|
71
|
+
totalDurationMs?: number;
|
|
72
|
+
totalTokens?: number;
|
|
73
|
+
totalToolUseCount?: number;
|
|
74
|
+
usage?: TokenUsage;
|
|
75
|
+
}
|
|
76
|
+
export interface UserMessage extends BaseMessage {
|
|
77
|
+
type: "user";
|
|
78
|
+
message: {
|
|
79
|
+
role: "user";
|
|
80
|
+
content: UserContent;
|
|
81
|
+
};
|
|
82
|
+
isMeta?: boolean;
|
|
83
|
+
permissionMode?: string;
|
|
84
|
+
thinkingMetadata?: {
|
|
85
|
+
maxThinkingTokens: number;
|
|
86
|
+
};
|
|
87
|
+
toolUseResult?: AgentToolUseResult;
|
|
88
|
+
sourceToolAssistantUUID?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface TokenUsage {
|
|
91
|
+
input_tokens: number;
|
|
92
|
+
output_tokens: number;
|
|
93
|
+
cache_creation_input_tokens?: number;
|
|
94
|
+
cache_read_input_tokens?: number;
|
|
95
|
+
/** "fast" when the turn ran in fast mode (billed at a higher tier on Opus 4.6/4.7) */
|
|
96
|
+
speed?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface AssistantMessage extends BaseMessage {
|
|
99
|
+
type: "assistant";
|
|
100
|
+
message: {
|
|
101
|
+
model: string;
|
|
102
|
+
id: string;
|
|
103
|
+
role: "assistant";
|
|
104
|
+
content: ContentBlock[];
|
|
105
|
+
stop_reason: string | null;
|
|
106
|
+
usage: TokenUsage;
|
|
107
|
+
};
|
|
108
|
+
requestId?: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @deprecated Claude Code v2.1.63+ no longer emits inline agent_progress messages.
|
|
112
|
+
* Subagent results now come as `toolUseResult` on the tool_result UserMessage.
|
|
113
|
+
* This interface is kept for backward compat with old sessions and for
|
|
114
|
+
* subagentWatcher.ts which synthesizes these for live progress display.
|
|
115
|
+
* New features should use AgentToolUseResult instead.
|
|
116
|
+
*/
|
|
117
|
+
export interface AgentProgressData {
|
|
118
|
+
type: "agent_progress";
|
|
119
|
+
message: {
|
|
120
|
+
type: "user" | "assistant";
|
|
121
|
+
message: {
|
|
122
|
+
role: string;
|
|
123
|
+
content: unknown;
|
|
124
|
+
};
|
|
125
|
+
uuid?: string;
|
|
126
|
+
timestamp?: string;
|
|
127
|
+
};
|
|
128
|
+
prompt: string;
|
|
129
|
+
agentId: string;
|
|
130
|
+
}
|
|
131
|
+
export type HookEventName = "PreToolUse" | "PostToolUse" | "PostToolUseFailure" | "UserPromptSubmit" | "SessionStart" | "SessionEnd" | "Stop" | "StopFailure" | "SubagentStop" | "PreCompact" | "PostCompact" | "PermissionDenied" | "TaskCreated" | "WorktreeCreate" | "CwdChanged" | "FileChanged" | "Elicitation" | "ElicitationResult" | "Notification";
|
|
132
|
+
export interface HookProgressData {
|
|
133
|
+
type: "hook_progress";
|
|
134
|
+
/** Event name (newer SDK: hook_event_name; older SDK: hookEvent) */
|
|
135
|
+
hook_event_name?: HookEventName | string;
|
|
136
|
+
/** Older SDK field for event name (e.g. "PostToolUse") */
|
|
137
|
+
hookEvent?: HookEventName | string;
|
|
138
|
+
/** Human-readable hook name like "PostToolUse:Read" (older SDK) */
|
|
139
|
+
hookName?: string;
|
|
140
|
+
/** Source of the hook configuration: "settings" | "plugin" | "skill" */
|
|
141
|
+
source?: string;
|
|
142
|
+
/** Tool call this hook is associated with (for Pre/PostToolUse) */
|
|
143
|
+
tool_use_id?: string;
|
|
144
|
+
/** Tool name (Pre/PostToolUse) */
|
|
145
|
+
tool_name?: string;
|
|
146
|
+
/** Hook command line that ran */
|
|
147
|
+
command?: string;
|
|
148
|
+
/** stdout/stderr from the hook command */
|
|
149
|
+
output?: string;
|
|
150
|
+
stderr?: string;
|
|
151
|
+
/** Exit code */
|
|
152
|
+
exit_code?: number;
|
|
153
|
+
/** Decision returned by hook (allow/deny/block/ask/defer) */
|
|
154
|
+
decision?: string;
|
|
155
|
+
/** Duration in milliseconds (PostToolUse, 2.1.119+) */
|
|
156
|
+
duration_ms?: number;
|
|
157
|
+
/** Hook-specific output (e.g., updatedToolOutput, sessionTitle) */
|
|
158
|
+
hookSpecificOutput?: Record<string, unknown>;
|
|
159
|
+
/** Permits arbitrary additional fields without coupling */
|
|
160
|
+
[key: string]: unknown;
|
|
161
|
+
}
|
|
162
|
+
export interface ParsedHookEvent {
|
|
163
|
+
/** Event name like "PreToolUse" */
|
|
164
|
+
eventName: string;
|
|
165
|
+
/** Source: settings/plugin/skill */
|
|
166
|
+
source?: string;
|
|
167
|
+
/** Tool the hook is gated on (for Pre/PostToolUse) */
|
|
168
|
+
toolName?: string;
|
|
169
|
+
toolUseId?: string;
|
|
170
|
+
/** Command that ran */
|
|
171
|
+
command?: string;
|
|
172
|
+
output?: string;
|
|
173
|
+
stderr?: string;
|
|
174
|
+
exitCode?: number;
|
|
175
|
+
decision?: string;
|
|
176
|
+
/** Duration in ms */
|
|
177
|
+
durationMs?: number;
|
|
178
|
+
/** PostToolUse hooks (2.1.121) can replace tool output via updatedToolOutput */
|
|
179
|
+
updatedToolOutput?: string;
|
|
180
|
+
/** UserPromptSubmit hooks (2.1.94) can set sessionTitle */
|
|
181
|
+
sessionTitle?: string;
|
|
182
|
+
/** WorktreeCreate hooks (2.1.84) return worktreePath */
|
|
183
|
+
worktreePath?: string;
|
|
184
|
+
timestamp: string;
|
|
185
|
+
}
|
|
186
|
+
export interface ProgressMessage extends BaseMessage {
|
|
187
|
+
type: "progress";
|
|
188
|
+
data: AgentProgressData | HookProgressData;
|
|
189
|
+
parentToolUseID?: string;
|
|
190
|
+
toolUseID?: string;
|
|
191
|
+
}
|
|
192
|
+
export interface SystemMessage extends BaseMessage {
|
|
193
|
+
type: "system";
|
|
194
|
+
subtype?: string;
|
|
195
|
+
durationMs?: number;
|
|
196
|
+
isMeta?: boolean;
|
|
197
|
+
content?: string;
|
|
198
|
+
compactMetadata?: {
|
|
199
|
+
trigger: "auto" | "manual";
|
|
200
|
+
preTokens: number;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
export interface FileHistorySnapshotMessage extends BaseMessage {
|
|
204
|
+
type: "file-history-snapshot";
|
|
205
|
+
messageId?: string;
|
|
206
|
+
snapshot?: {
|
|
207
|
+
messageId: string;
|
|
208
|
+
trackedFileBackups: Record<string, unknown>;
|
|
209
|
+
timestamp: string;
|
|
210
|
+
};
|
|
211
|
+
isSnapshotUpdate?: boolean;
|
|
212
|
+
}
|
|
213
|
+
export interface SummaryMessage extends BaseMessage {
|
|
214
|
+
type: "summary";
|
|
215
|
+
leafUuid?: string;
|
|
216
|
+
summary?: string;
|
|
217
|
+
}
|
|
218
|
+
/** Claude Code persists prompts submitted during an active turn as queue operations. */
|
|
219
|
+
export interface QueueOperationMessage extends BaseMessage {
|
|
220
|
+
type: "queue-operation";
|
|
221
|
+
operation: "enqueue" | "dequeue" | "remove" | string;
|
|
222
|
+
content?: string | null;
|
|
223
|
+
}
|
|
224
|
+
export type RawMessage = UserMessage | AssistantMessage | ProgressMessage | SystemMessage | FileHistorySnapshotMessage | SummaryMessage | QueueOperationMessage;
|
|
225
|
+
export interface ToolCall {
|
|
226
|
+
id: string;
|
|
227
|
+
name: string;
|
|
228
|
+
input: Record<string, unknown>;
|
|
229
|
+
result: string | null;
|
|
230
|
+
isError: boolean;
|
|
231
|
+
timestamp: string;
|
|
232
|
+
/** Set by parser when a PostToolUse hook replaced this tool's output */
|
|
233
|
+
outputReplacedByHook?: boolean;
|
|
234
|
+
/** Total duration of PostToolUse hooks attached to this call, summed in ms */
|
|
235
|
+
hookDurationMs?: number;
|
|
236
|
+
}
|
|
237
|
+
export interface SubAgentMessage {
|
|
238
|
+
agentId: string;
|
|
239
|
+
/** The Task/Agent tool_use id this agent belongs to (streaming overlay key) */
|
|
240
|
+
parentToolUseId?: string;
|
|
241
|
+
agentName: string | null;
|
|
242
|
+
subagentType: string | null;
|
|
243
|
+
type: "user" | "assistant";
|
|
244
|
+
content: unknown;
|
|
245
|
+
toolCalls: ToolCall[];
|
|
246
|
+
thinking: string[];
|
|
247
|
+
text: string[];
|
|
248
|
+
timestamp: string;
|
|
249
|
+
tokenUsage: TokenUsage | null;
|
|
250
|
+
model: string | null;
|
|
251
|
+
isBackground: boolean;
|
|
252
|
+
/** Summary fields from toolUseResult (new format, v2.1.63+) */
|
|
253
|
+
prompt?: string;
|
|
254
|
+
status?: string;
|
|
255
|
+
durationMs?: number;
|
|
256
|
+
toolUseCount?: number;
|
|
257
|
+
}
|
|
258
|
+
/** Ordered content block within a turn – preserves chronological order */
|
|
259
|
+
export type TurnContentBlock = {
|
|
260
|
+
kind: "thinking";
|
|
261
|
+
blocks: ThinkingBlock[];
|
|
262
|
+
timestamp?: string;
|
|
263
|
+
} | {
|
|
264
|
+
kind: "text";
|
|
265
|
+
text: string[];
|
|
266
|
+
timestamp?: string;
|
|
267
|
+
} | {
|
|
268
|
+
kind: "tool_calls";
|
|
269
|
+
toolCalls: ToolCall[];
|
|
270
|
+
timestamp?: string;
|
|
271
|
+
} | {
|
|
272
|
+
kind: "queued_prompt";
|
|
273
|
+
content: string;
|
|
274
|
+
timestamp?: string;
|
|
275
|
+
} | {
|
|
276
|
+
kind: "sub_agent";
|
|
277
|
+
messages: SubAgentMessage[];
|
|
278
|
+
timestamp?: string;
|
|
279
|
+
} | {
|
|
280
|
+
kind: "background_agent";
|
|
281
|
+
messages: SubAgentMessage[];
|
|
282
|
+
timestamp?: string;
|
|
283
|
+
} | {
|
|
284
|
+
kind: "hook_event";
|
|
285
|
+
events: ParsedHookEvent[];
|
|
286
|
+
timestamp?: string;
|
|
287
|
+
} | {
|
|
288
|
+
kind: "plan_mode";
|
|
289
|
+
plan: string;
|
|
290
|
+
planFilePath?: string;
|
|
291
|
+
status: "pending" | "approved" | "rejected";
|
|
292
|
+
toolCalls: ToolCall[];
|
|
293
|
+
timestamp?: string;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Away summary / recap block — emitted as a system message with
|
|
297
|
+
* subtype "away_summary" (Claude Code v2.1.108+, observed in production
|
|
298
|
+
* JSONL as of 2026-04). The /recap command produces the same shape.
|
|
299
|
+
* Content is plain text (may be long-form prose, not always markdown).
|
|
300
|
+
*/
|
|
301
|
+
| {
|
|
302
|
+
kind: "recap";
|
|
303
|
+
content: string;
|
|
304
|
+
timestamp?: string;
|
|
305
|
+
};
|
|
306
|
+
export interface Turn {
|
|
307
|
+
id: string;
|
|
308
|
+
userMessage: UserContent | null;
|
|
309
|
+
/** Chronologically ordered content blocks for rendering */
|
|
310
|
+
contentBlocks: TurnContentBlock[];
|
|
311
|
+
thinking: ThinkingBlock[];
|
|
312
|
+
assistantText: string[];
|
|
313
|
+
toolCalls: ToolCall[];
|
|
314
|
+
subAgentActivity: SubAgentMessage[];
|
|
315
|
+
timestamp: string;
|
|
316
|
+
durationMs: number | null;
|
|
317
|
+
tokenUsage: TokenUsage | null;
|
|
318
|
+
model: string | null;
|
|
319
|
+
/** Set when a compaction happened before this turn */
|
|
320
|
+
compactionSummary?: string;
|
|
321
|
+
}
|
|
322
|
+
export interface SessionStats {
|
|
323
|
+
totalInputTokens: number;
|
|
324
|
+
totalOutputTokens: number;
|
|
325
|
+
totalCacheCreationTokens: number;
|
|
326
|
+
totalCacheReadTokens: number;
|
|
327
|
+
totalCostUSD: number;
|
|
328
|
+
toolCallCounts: Record<string, number>;
|
|
329
|
+
errorCount: number;
|
|
330
|
+
totalDurationMs: number;
|
|
331
|
+
turnCount: number;
|
|
332
|
+
}
|
|
333
|
+
export interface ParseSessionOptions {
|
|
334
|
+
/** Skip aggregate cost/token work and raw-message retention for index-only consumers. */
|
|
335
|
+
skipStats?: boolean;
|
|
336
|
+
}
|
|
337
|
+
export interface ParsedSession {
|
|
338
|
+
sessionId: string;
|
|
339
|
+
version: string;
|
|
340
|
+
gitBranch: string;
|
|
341
|
+
cwd: string;
|
|
342
|
+
slug: string;
|
|
343
|
+
/** Session display name set via `--name` CLI flag. */
|
|
344
|
+
name: string;
|
|
345
|
+
model: string;
|
|
346
|
+
turns: Turn[];
|
|
347
|
+
stats: SessionStats;
|
|
348
|
+
/**
|
|
349
|
+
* Raw JSONL message objects. Widened from `RawMessage[]` to support multiple
|
|
350
|
+
* provider formats (Claude Code and Codex) without a discriminated union at
|
|
351
|
+
* every call site. Use `agentKind` to distinguish formats when needed.
|
|
352
|
+
*/
|
|
353
|
+
rawMessages: Array<{
|
|
354
|
+
type: string;
|
|
355
|
+
[key: string]: unknown;
|
|
356
|
+
}>;
|
|
357
|
+
branchedFrom?: {
|
|
358
|
+
sessionId: string;
|
|
359
|
+
turnIndex?: number | null;
|
|
360
|
+
};
|
|
361
|
+
/**
|
|
362
|
+
* The provider that produced this session. Set by the parser when the
|
|
363
|
+
* format is known. Consumers can use this instead of inspecting rawMessages.
|
|
364
|
+
*/
|
|
365
|
+
agentKind?: "claude" | "codex";
|
|
366
|
+
}
|
|
367
|
+
export interface ArchivedToolCall {
|
|
368
|
+
type: "Edit" | "Write";
|
|
369
|
+
filePath: string;
|
|
370
|
+
oldString?: string;
|
|
371
|
+
newString?: string;
|
|
372
|
+
replaceAll?: boolean;
|
|
373
|
+
content?: string;
|
|
374
|
+
}
|
|
375
|
+
export interface ArchivedTurn {
|
|
376
|
+
index: number;
|
|
377
|
+
userMessage: string | null;
|
|
378
|
+
toolCalls: ArchivedToolCall[];
|
|
379
|
+
thinkingBlocks: string[];
|
|
380
|
+
assistantText: string[];
|
|
381
|
+
timestamp: string;
|
|
382
|
+
model: string | null;
|
|
383
|
+
}
|
|
384
|
+
export interface Branch {
|
|
385
|
+
id: string;
|
|
386
|
+
createdAt: string;
|
|
387
|
+
branchPointTurnIndex: number;
|
|
388
|
+
label: string;
|
|
389
|
+
turns: ArchivedTurn[];
|
|
390
|
+
jsonlLines: string[];
|
|
391
|
+
/** Branches that were nested within the archived range, preserved for restore */
|
|
392
|
+
childBranches?: Branch[];
|
|
393
|
+
}
|
|
394
|
+
export interface UndoState {
|
|
395
|
+
sessionId: string;
|
|
396
|
+
currentTurnIndex: number;
|
|
397
|
+
totalTurns: number;
|
|
398
|
+
branches: Branch[];
|
|
399
|
+
activeBranchId: string | null;
|
|
400
|
+
}
|
|
401
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cogpit-memory",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "CLI tool for Claude Code
|
|
3
|
+
"version": "0.1.10",
|
|
4
|
+
"description": "CLI tool for Claude Code and Codex session introspection",
|
|
5
|
+
"packageManager": "bun@1.3.14",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
|
-
"types": "./
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
7
8
|
"bin": {
|
|
8
|
-
"cogpit-memory": "
|
|
9
|
+
"cogpit-memory": "dist/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=20"
|
|
9
13
|
},
|
|
10
14
|
"files": [
|
|
11
15
|
"dist/",
|
|
@@ -13,9 +17,10 @@
|
|
|
13
17
|
],
|
|
14
18
|
"scripts": {
|
|
15
19
|
"test": "bun test",
|
|
20
|
+
"test:contracts": "bun run build:npm && node scripts/test-package-contract.mjs",
|
|
16
21
|
"build": "bun build --compile src/cli.ts --outfile cogpit-memory",
|
|
17
|
-
"build:npm": "node scripts/build-npm.mjs",
|
|
18
|
-
"prepublishOnly": "
|
|
22
|
+
"build:npm": "node scripts/build-npm.mjs && tsc --pretty false -p tsconfig.build.json",
|
|
23
|
+
"prepublishOnly": "bun run build:npm"
|
|
19
24
|
},
|
|
20
25
|
"dependencies": {
|
|
21
26
|
"better-sqlite3": "^12.6.2"
|
|
@@ -23,6 +28,7 @@
|
|
|
23
28
|
"devDependencies": {
|
|
24
29
|
"@types/better-sqlite3": "^7.6.13",
|
|
25
30
|
"bun-types": "latest",
|
|
26
|
-
"esbuild": "^0.27.3"
|
|
31
|
+
"esbuild": "^0.27.3",
|
|
32
|
+
"typescript": "~5.6.2"
|
|
27
33
|
}
|
|
28
34
|
}
|
package/skill/SKILL.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cogpit-memory
|
|
3
|
-
description: CLI tool for Claude Code session introspection -- retrieves conversation history, tool calls, thinking, sub-agent/team activity, full-text search, and session discovery. All output is JSON to stdout.
|
|
3
|
+
description: CLI tool for Claude Code and Codex session introspection -- retrieves conversation history, tool calls, thinking, sub-agent/team activity, full-text search, and session discovery. All output is JSON to stdout.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Cogpit Memory -- Session Context CLI
|
|
7
7
|
|
|
8
|
-
CLI tool that gives any AI assistant memory of past Claude Code sessions. Retrieve conversation history, tool usage, thinking, and sub-agent activity via a layered command structure.
|
|
8
|
+
CLI tool that gives any AI assistant memory of past Claude Code and Codex sessions. Retrieve conversation history, tool usage, thinking, and sub-agent activity via a layered command structure. Session discovery and layered context support both providers; cross-session full-text indexing currently covers Claude Code history, while `search --session` supports either provider.
|
|
9
9
|
|
|
10
10
|
Always start with session discovery or the overview (Layer 1), and drill into specific turns or sub-agents only as needed. Use search when you need to **find** content rather than browse known sessions.
|
|
11
11
|
|
|
@@ -105,7 +105,7 @@ Response shape:
|
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
Key fields:
|
|
108
|
-
- `userMessage` -- the human's full prompt text (`null` for synthetic turns
|
|
108
|
+
- `userMessage` -- the human's full prompt text (`null` for synthetic turns; images, documents, and audio are shown as attachment placeholders)
|
|
109
109
|
- `assistantMessage` -- the AI's full text response (`null` if only tools ran)
|
|
110
110
|
- `toolSummary` -- tool name to count (e.g., `{"Read": 5, "Edit": 2}`)
|
|
111
111
|
- `subAgents` -- summary of sub-agents that ran in this turn. Fields `status`, `durationMs`, `toolUseCount` may be `null` for older sessions
|
|
@@ -151,7 +151,7 @@ Response shape:
|
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
Key details:
|
|
154
|
-
- `contentBlocks` kinds: `thinking`, `text`, `tool_calls`, `sub_agent`, `background_agent`
|
|
154
|
+
- `contentBlocks` kinds: `thinking`, `text`, `tool_calls`, `sub_agent`, `background_agent`, `queued_prompt`, `hook_event`, `plan_mode`, `recap`
|
|
155
155
|
- Tool call `result` is truncated at 10,000 chars -- check `resultTruncated: true`
|
|
156
156
|
- Tool call `result` may be `null` if the tool hasn't returned yet
|
|
157
157
|
- Sub-agent blocks show prompt + result text. For full sub-agent conversation, use Layer 3
|