@ebowwa/claudecodehistory 1.6.0 → 1.8.0
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 +74 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -21
- package/rust/Cargo.lock +0 -1955
- package/rust/Cargo.toml +0 -90
- package/rust/build.rs +0 -4
- package/rust/index.d.ts +0 -0
- package/rust/package.json +0 -69
- package/rust/src/lib.rs +0 -800
- package/rust/src/parser.rs +0 -261
- package/rust/src/search/index.rs +0 -206
- package/rust/src/search/mod.rs +0 -291
- package/rust/src/search/query.rs +0 -458
- package/rust/src/search/schema.rs +0 -115
- package/rust/src/types.rs +0 -248
- package/rust/src/utils.rs +0 -210
- package/typescript/dist/history-service.d.ts +0 -187
- package/typescript/dist/history-service.d.ts.map +0 -1
- package/typescript/dist/history-service.js +0 -739
- package/typescript/dist/history-service.js.map +0 -1
- package/typescript/dist/index.d.ts +0 -3
- package/typescript/dist/index.d.ts.map +0 -1
- package/typescript/dist/index.js +0 -2
- package/typescript/dist/index.js.map +0 -1
- /package/{rust/claudecodehistory.darwin-arm64.node → claudecodehistory.darwin-arm64.node} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,60 @@
|
|
|
15
15
|
export type { ClaudeCodeMessage, ConversationEntry, PaginatedConversationResponse, HistoryQueryOptions, SessionListOptions, ProjectInfo, SessionInfo, SearchOptions, CurrentSessionInfo, SessionProcessInfo, RecentActivityOptions, RecentActivityItem, } from './history-service.js';
|
|
16
16
|
export { ClaudeCodeHistoryService } from './history-service.js';
|
|
17
17
|
export { parseDir, CLAUDE_CODE_FIELDS, type GenericEntry } from '@ebowwa/jsonl-hft';
|
|
18
|
+
export interface NativeSearchOptions {
|
|
19
|
+
limit?: number;
|
|
20
|
+
offset?: number;
|
|
21
|
+
session_id?: string;
|
|
22
|
+
project_path?: string;
|
|
23
|
+
message_types?: string[];
|
|
24
|
+
timezone?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface NativeAdvancedSearchOptions {
|
|
27
|
+
query?: string;
|
|
28
|
+
limit?: number;
|
|
29
|
+
offset?: number;
|
|
30
|
+
session_id?: string;
|
|
31
|
+
project_path?: string;
|
|
32
|
+
message_types?: string[];
|
|
33
|
+
start_date?: string;
|
|
34
|
+
end_date?: string;
|
|
35
|
+
fields?: string[];
|
|
36
|
+
fuzzy?: boolean;
|
|
37
|
+
min_score?: number;
|
|
38
|
+
timezone?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface NativeSearchResult {
|
|
41
|
+
entry: {
|
|
42
|
+
uuid: string;
|
|
43
|
+
session_id: string;
|
|
44
|
+
timestamp: string;
|
|
45
|
+
entry_type: string;
|
|
46
|
+
content: string;
|
|
47
|
+
project_path: string;
|
|
48
|
+
formatted_time?: string;
|
|
49
|
+
time_ago?: string;
|
|
50
|
+
local_date?: string;
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
project_name?: string;
|
|
53
|
+
};
|
|
54
|
+
score: number;
|
|
55
|
+
highlights: string[];
|
|
56
|
+
}
|
|
57
|
+
export interface NativeSearchResults {
|
|
58
|
+
entries: NativeSearchResult[];
|
|
59
|
+
total: number;
|
|
60
|
+
query: string;
|
|
61
|
+
took_ms: number;
|
|
62
|
+
index_size_bytes: number;
|
|
63
|
+
}
|
|
64
|
+
export interface NativeIndexStats {
|
|
65
|
+
total_docs: number;
|
|
66
|
+
user_messages: number;
|
|
67
|
+
assistant_messages: number;
|
|
68
|
+
unique_sessions: number;
|
|
69
|
+
unique_projects: number;
|
|
70
|
+
index_size_bytes: number;
|
|
71
|
+
}
|
|
18
72
|
/**
|
|
19
73
|
* Get the implementation type currently in use
|
|
20
74
|
*/
|
|
@@ -24,4 +78,24 @@ export declare function getImplementation(): 'rust' | 'typescript';
|
|
|
24
78
|
* Uses Rust implementation if available, otherwise TypeScript
|
|
25
79
|
*/
|
|
26
80
|
export declare function createHistoryService(claudeDir?: string): Promise<import('./history-service.js').ClaudeCodeHistoryService>;
|
|
81
|
+
/**
|
|
82
|
+
* Check if native search module is available
|
|
83
|
+
*/
|
|
84
|
+
export declare function isNativeSearchAvailable(): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Get native HistorySearchIndex class if available
|
|
87
|
+
* Returns null if native module is not available
|
|
88
|
+
*
|
|
89
|
+
* The returned class has these methods:
|
|
90
|
+
* - new(indexPath: string) - Create/open index at path
|
|
91
|
+
* - search(query: string, options?) - Full-text search with BM25
|
|
92
|
+
* - advancedSearch(options) - Advanced search with filters
|
|
93
|
+
* - indexEntry(entry) - Index a single entry
|
|
94
|
+
* - indexEntries(entries) - Bulk index entries
|
|
95
|
+
* - deleteSession(sessionId) - Remove session from index
|
|
96
|
+
* - clear() - Clear entire index
|
|
97
|
+
* - optimize() - Optimize index for faster searches
|
|
98
|
+
* - stats() - Get index statistics
|
|
99
|
+
*/
|
|
100
|
+
export declare function getNativeSearchIndex(): any | null;
|
|
27
101
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA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ClB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACnC,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,YAAY,CASzD;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,sBAAsB,EAAE,wBAAwB,CAAC,CAK/H;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAQjD;AAED;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,oBAAoB,IAAI,GAAG,GAAG,IAAI,CA6BjD"}
|
package/dist/index.js
CHANGED
|
@@ -40,4 +40,63 @@ export async function createHistoryService(claudeDir) {
|
|
|
40
40
|
const { ClaudeCodeHistoryService } = await import('./history-service.js');
|
|
41
41
|
return new ClaudeCodeHistoryService(claudeDir);
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if native search module is available
|
|
45
|
+
*/
|
|
46
|
+
export function isNativeSearchAvailable() {
|
|
47
|
+
try {
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
49
|
+
const native = require('@ebowwa/claudecodehistory-rs');
|
|
50
|
+
return !!native?.HistorySearchIndex;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get native HistorySearchIndex class if available
|
|
58
|
+
* Returns null if native module is not available
|
|
59
|
+
*
|
|
60
|
+
* The returned class has these methods:
|
|
61
|
+
* - new(indexPath: string) - Create/open index at path
|
|
62
|
+
* - search(query: string, options?) - Full-text search with BM25
|
|
63
|
+
* - advancedSearch(options) - Advanced search with filters
|
|
64
|
+
* - indexEntry(entry) - Index a single entry
|
|
65
|
+
* - indexEntries(entries) - Bulk index entries
|
|
66
|
+
* - deleteSession(sessionId) - Remove session from index
|
|
67
|
+
* - clear() - Clear entire index
|
|
68
|
+
* - optimize() - Optimize index for faster searches
|
|
69
|
+
* - stats() - Get index statistics
|
|
70
|
+
*/
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
export function getNativeSearchIndex() {
|
|
73
|
+
// Try npm package first
|
|
74
|
+
try {
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
76
|
+
const native = require('@ebowwa/claudecodehistory-rs');
|
|
77
|
+
if (native?.HistorySearchIndex) {
|
|
78
|
+
return native.HistorySearchIndex;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch { /* ignore */ }
|
|
82
|
+
// Try local development path (relative to this module)
|
|
83
|
+
try {
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
85
|
+
const native = require('../../../../rust/index.js');
|
|
86
|
+
if (native?.HistorySearchIndex) {
|
|
87
|
+
return native.HistorySearchIndex;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch { /* ignore */ }
|
|
91
|
+
// Try direct .node file load
|
|
92
|
+
try {
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
94
|
+
const native = require('../../../../rust/claudecodehistory.darwin-arm64.node');
|
|
95
|
+
if (native?.HistorySearchIndex) {
|
|
96
|
+
return native.HistorySearchIndex;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch { /* ignore */ }
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
43
102
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAkBH,0CAA0C;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,oDAAoD;AACpD,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAqB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAkBH,0CAA0C;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,oDAAoD;AACpD,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAqB,MAAM,mBAAmB,CAAC;AA8DpF;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,2CAA2C;IAC3C,IAAI,CAAC;QACH,8DAA8D;QAC9D,OAAO,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,YAAY,CAAC;IACtB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,C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AAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;IAExB,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebowwa/claudecodehistory",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "High-performance Claude Code conversation history parser with TypeScript and Rust implementations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,32 +9,20 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts"
|
|
12
|
-
},
|
|
13
|
-
"./rust": {
|
|
14
|
-
"import": "./rust/index.js",
|
|
15
|
-
"types": "./rust/index.d.ts",
|
|
16
|
-
"node": "./rust/index.node"
|
|
17
|
-
},
|
|
18
|
-
"./typescript": {
|
|
19
|
-
"import": "./typescript/dist/index.js",
|
|
20
|
-
"types": "./typescript/dist/index.d.ts"
|
|
21
12
|
}
|
|
22
13
|
},
|
|
23
14
|
"files": [
|
|
24
15
|
"dist/",
|
|
25
|
-
"
|
|
26
|
-
"typescript/dist/",
|
|
16
|
+
"*.node",
|
|
27
17
|
"README.md",
|
|
28
18
|
"LICENSE"
|
|
29
19
|
],
|
|
30
20
|
"scripts": {
|
|
31
21
|
"build": "tsc",
|
|
32
|
-
"build:rust": "cd rust && npm run build",
|
|
33
|
-
"build:
|
|
34
|
-
"build:all": "npm run build && npm run build:rust && npm run build:typescript",
|
|
22
|
+
"build:rust": "cd rust && npm run build && cp *.node ..",
|
|
23
|
+
"build:all": "npm run build && npm run build:rust",
|
|
35
24
|
"typecheck": "tsc --noEmit",
|
|
36
25
|
"bench": "bun run benchmark.ts",
|
|
37
|
-
"bench:compare": "bun run benchmark-compare.ts",
|
|
38
26
|
"test": "bun test",
|
|
39
27
|
"prepublishOnly": "npm run build:all"
|
|
40
28
|
},
|
|
@@ -53,11 +41,11 @@
|
|
|
53
41
|
],
|
|
54
42
|
"author": "Ebowwa Labs <labs@ebowwa.com>",
|
|
55
43
|
"license": "MIT",
|
|
56
|
-
"homepage": "https://github.com/ebowwa/codespaces/tree/main/packages/src/
|
|
44
|
+
"homepage": "https://github.com/ebowwa/codespaces/tree/main/packages/src/api-clients/claudecode/claudecodehistory#readme",
|
|
57
45
|
"repository": {
|
|
58
46
|
"type": "git",
|
|
59
47
|
"url": "https://github.com/ebowwa/codespaces.git",
|
|
60
|
-
"directory": "packages/src/
|
|
48
|
+
"directory": "packages/src/api-clients/claudecode/claudecodehistory"
|
|
61
49
|
},
|
|
62
50
|
"bugs": {
|
|
63
51
|
"url": "https://github.com/ebowwa/codespaces/issues"
|
|
@@ -68,9 +56,6 @@
|
|
|
68
56
|
"dependencies": {
|
|
69
57
|
"@ebowwa/jsonl-hft": "^1.3.1"
|
|
70
58
|
},
|
|
71
|
-
"optionalDependencies": {
|
|
72
|
-
"@ebowwa/claudecodehistory-rs": "1.5.1"
|
|
73
|
-
},
|
|
74
59
|
"devDependencies": {
|
|
75
60
|
"@types/node": "^24.0.4",
|
|
76
61
|
"typescript": "^5.8.3",
|