@claude-sessions/core 0.3.5 → 0.3.7

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as MessagePayload, a as Message, P as Project, T as TodoItem, F as FileChange, b as MoveSessionResult, S as SearchResult, c as SummaryInfo, A as AgentInfo } from './types-C2fzbmg9.js';
2
- export { i as CleanupPreview, h as ClearSessionsResult, C as ContentItem, D as DeleteSessionResult, k as ProjectTreeData, R as RenameSessionResult, l as ResumeSessionOptions, m as ResumeSessionResult, f as SessionFilesSummary, d as SessionMeta, e as SessionTodos, j as SessionTreeData, g as SplitSessionResult } from './types-C2fzbmg9.js';
1
+ import { M as MessagePayload, a as Message, P as Project, T as TodoItem, F as FileChange, C as CompressSessionOptions, S as SummarizeSessionOptions, b as ConversationLine, c as MoveSessionResult, d as SearchResult, e as SummaryInfo, A as AgentInfo } from './types-Cz8chaYQ.js';
2
+ export { l as CleanupPreview, k as ClearSessionsResult, s as CompressSessionResult, f as ContentItem, D as DeleteSessionResult, t as ProjectKnowledge, n as ProjectTreeData, R as RenameSessionResult, o as ResumeSessionOptions, p as ResumeSessionResult, r as SessionAnalysis, i as SessionFilesSummary, g as SessionMeta, h as SessionTodos, m as SessionTreeData, j as SplitSessionResult, u as SummarizeSessionResult, q as ToolUsageStats } from './types-Cz8chaYQ.js';
3
3
  import * as effect_Cause from 'effect/Cause';
4
4
  import { Effect } from 'effect';
5
5
 
@@ -11,7 +11,9 @@ interface FileSystem {
11
11
  readFileSync: (path: string, encoding: 'utf-8') => string;
12
12
  readdirSync: (path: string) => string[];
13
13
  }
14
- /** Get Claude sessions directory (~/.claude/projects) */
14
+ /** Get Claude sessions directory (~/.claude/projects)
15
+ * Can be overridden with CLAUDE_SESSIONS_DIR environment variable for testing
16
+ */
15
17
  declare const getSessionsDir: () => string;
16
18
  /** Get Claude todos directory (~/.claude/todos) */
17
19
  declare const getTodosDir: () => string;
@@ -94,6 +96,11 @@ declare const findOrphanAgents: (projectName: string) => Effect.Effect<{
94
96
  declare const deleteOrphanAgents: (projectName: string) => Effect.Effect<{
95
97
  success: boolean;
96
98
  deletedAgents: string[];
99
+ backedUpAgents: string[];
100
+ cleanedFolders: string[];
101
+ deletedCount: number;
102
+ backedUpCount: number;
103
+ cleanedFolderCount: number;
97
104
  count: number;
98
105
  }, effect_Cause.UnknownException, never>;
99
106
  declare const loadAgentMessages: (projectName: string, _sessionId: string, // Reserved for future validation
@@ -168,6 +175,34 @@ declare const getSessionFiles: (projectName: string, sessionId: string) => Effec
168
175
  files: FileChange[];
169
176
  totalChanges: number;
170
177
  }, effect_Cause.UnknownException, never>;
178
+ declare const analyzeSession: (projectName: string, sessionId: string) => Effect.Effect<{
179
+ sessionId: string;
180
+ projectName: string;
181
+ durationMinutes: number;
182
+ stats: {
183
+ totalMessages: number;
184
+ userMessages: number;
185
+ assistantMessages: number;
186
+ summaryCount: number;
187
+ snapshotCount: number;
188
+ };
189
+ toolUsage: {
190
+ name: string;
191
+ count: number;
192
+ errorCount: number;
193
+ }[];
194
+ filesChanged: string[];
195
+ patterns: {
196
+ type: string;
197
+ description: string;
198
+ count: number;
199
+ }[];
200
+ milestones: {
201
+ timestamp?: string;
202
+ description: string;
203
+ messageUuid?: string;
204
+ }[];
205
+ }, effect_Cause.UnknownException, never>;
171
206
  declare const moveSession: (sourceProject: string, sessionId: string, targetProject: string) => Effect.Effect<MoveSessionResult, Error>;
172
207
  declare const splitSession: (projectName: string, sessionId: string, splitAtMessageUuid: string) => Effect.Effect<{
173
208
  success: false;
@@ -277,6 +312,37 @@ declare const loadProjectTreeData: (projectName: string) => Effect.Effect<{
277
312
  declare const updateSessionSummary: (projectName: string, sessionId: string, newSummary: string) => Effect.Effect<{
278
313
  success: boolean;
279
314
  }, effect_Cause.UnknownException, never>;
315
+ declare const compressSession: (projectName: string, sessionId: string, options?: CompressSessionOptions) => Effect.Effect<{
316
+ success: true;
317
+ originalSize: number;
318
+ compressedSize: number;
319
+ removedSnapshots: number;
320
+ truncatedOutputs: number;
321
+ }, effect_Cause.UnknownException, never>;
322
+ declare const extractProjectKnowledge: (projectName: string, sessionIds?: string[]) => Effect.Effect<{
323
+ projectName: string;
324
+ patterns: never[];
325
+ hotFiles: {
326
+ path: string;
327
+ modifyCount: number;
328
+ lastModified: string | undefined;
329
+ }[];
330
+ workflows: {
331
+ sequence: string[];
332
+ count: number;
333
+ }[];
334
+ decisions: {
335
+ context: string;
336
+ decision: string;
337
+ sessionId: string;
338
+ }[];
339
+ }, effect_Cause.UnknownException, never>;
340
+ declare const summarizeSession: (projectName: string, sessionId: string, options?: SummarizeSessionOptions) => Effect.Effect<{
341
+ sessionId: string;
342
+ projectName: string;
343
+ lines: ConversationLine[];
344
+ formatted: string;
345
+ }, effect_Cause.UnknownException, never>;
280
346
 
281
347
  /**
282
348
  * Simple logger abstraction for Claude Sessions
@@ -312,4 +378,4 @@ declare const getLogger: () => Logger;
312
378
  */
313
379
  declare const createLogger: (namespace: string) => Logger;
314
380
 
315
- export { AgentInfo, FileChange, type Logger, Message, MessagePayload, MoveSessionResult, Project, SearchResult, SummaryInfo, TodoItem, clearSessions, createLogger, deleteLinkedTodos, deleteMessage, deleteOrphanAgents, deleteOrphanTodos, deleteSession, displayPathToFolderName, extractTextContent, extractTitle, findLinkedAgents, findLinkedTodos, findOrphanAgents, findOrphanTodos, findProjectByWorkspacePath, folderNameToDisplayPath, folderNameToPath, getDisplayTitle, getLogger, getRealPathFromSession, getSessionFiles, getSessionsDir, getTodosDir, isContinuationSummary, isInvalidApiKeyMessage, listProjects, listSessions, loadAgentMessages, loadProjectTreeData, loadSessionTreeData, maskHomePath, moveSession, pathToFolderName, previewCleanup, readSession, renameSession, restoreMessage, searchSessions, sessionHasTodos, setLogger, sortProjects, splitSession, updateSessionSummary };
381
+ export { AgentInfo, CompressSessionOptions, ConversationLine, FileChange, type Logger, Message, MessagePayload, MoveSessionResult, Project, SearchResult, SummarizeSessionOptions, SummaryInfo, TodoItem, analyzeSession, clearSessions, compressSession, createLogger, deleteLinkedTodos, deleteMessage, deleteOrphanAgents, deleteOrphanTodos, deleteSession, displayPathToFolderName, extractProjectKnowledge, extractTextContent, extractTitle, findLinkedAgents, findLinkedTodos, findOrphanAgents, findOrphanTodos, findProjectByWorkspacePath, folderNameToDisplayPath, folderNameToPath, getDisplayTitle, getLogger, getRealPathFromSession, getSessionFiles, getSessionsDir, getTodosDir, isContinuationSummary, isInvalidApiKeyMessage, listProjects, listSessions, loadAgentMessages, loadProjectTreeData, loadSessionTreeData, maskHomePath, moveSession, pathToFolderName, previewCleanup, readSession, renameSession, restoreMessage, searchSessions, sessionHasTodos, setLogger, sortProjects, splitSession, summarizeSession, updateSessionSummary };