ai-hist-native 0.4.3 → 0.8.2

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/index.d.ts CHANGED
@@ -3,16 +3,200 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- /** Result of one in-process sync+push. */
6
+ /** Contract version implemented by this native addon. */
7
+ export declare function nativeContractVersion(): number
8
+ /**
9
+ * Optimization profile this addon was compiled with: `release` or `debug`.
10
+ * Performance measurements are only meaningful against `release`.
11
+ */
12
+ export declare function nativeBuildProfile(): string
13
+ export interface HistoryQueryOptions {
14
+ dbPath?: string
15
+ source?: string
16
+ project?: string
17
+ tag?: string
18
+ beforeMs?: number
19
+ limit?: number
20
+ }
21
+ export interface SearchOptions {
22
+ dbPath?: string
23
+ source?: string
24
+ project?: string
25
+ tag?: string
26
+ beforeMs?: number
27
+ limit?: number
28
+ rawFts?: boolean
29
+ }
30
+ export interface SessionOptions {
31
+ dbPath?: string
32
+ source?: string
33
+ tag?: string
34
+ }
35
+ export interface NativeHistoryEntry {
36
+ id: number
37
+ source: string
38
+ sessionId?: string
39
+ project?: string
40
+ prompt: string
41
+ timestampMs: number
42
+ }
43
+ export interface NativeSessionEvent {
44
+ id: number
45
+ source: string
46
+ sessionId: string
47
+ project?: string
48
+ cwd?: string
49
+ gitBranch?: string
50
+ messageId?: string
51
+ parentId?: string
52
+ tsMs: number
53
+ role: string
54
+ kind: string
55
+ text?: string
56
+ model?: string
57
+ tokenJson?: string
58
+ eventUid: string
59
+ }
60
+ export interface EventCursor {
61
+ tsMs: number
62
+ id: number
63
+ }
64
+ export interface EventsPageOptions {
65
+ dbPath?: string
66
+ source?: string
67
+ limit?: number
68
+ after?: EventCursor
69
+ }
70
+ export interface SessionEventsPage {
71
+ events: Array<NativeSessionEvent>
72
+ nextCursor?: EventCursor
73
+ }
74
+ export interface SourceCount {
75
+ source: string
76
+ count: number
77
+ }
78
+ export interface ProjectCount {
79
+ project: string
80
+ count: number
81
+ }
82
+ export interface NativeStats {
83
+ total: number
84
+ bySource: Array<SourceCount>
85
+ byProject: Array<ProjectCount>
86
+ firstTimestampMs?: number
87
+ lastTimestampMs?: number
88
+ }
89
+ export interface StatsOptions {
90
+ dbPath?: string
91
+ tag?: string
92
+ }
93
+ /** Full-text search of indexed history. Never discovers or syncs implicitly. */
94
+ export declare function search(query: string, options?: SearchOptions | undefined | null): Promise<Array<NativeHistoryEntry>>
95
+ /** Recent indexed history. Never discovers or syncs implicitly. */
96
+ export declare function recent(options?: HistoryQueryOptions | undefined | null): Promise<Array<NativeHistoryEntry>>
97
+ /** Indexed prompts for one session. Event payloads are separately paginated. */
98
+ export declare function getSession(sessionId: string, options?: SessionOptions | undefined | null): Promise<Array<NativeHistoryEntry>>
99
+ /** One bounded page of normalized events for a session. */
100
+ export declare function getSessionEventsPage(sessionId: string, options?: EventsPageOptions | undefined | null): Promise<SessionEventsPage>
101
+ /** Database statistics over already-indexed data. */
102
+ export declare function stats(options?: StatsOptions | undefined | null): Promise<NativeStats>
103
+ export interface CatalogSession {
104
+ source: string
105
+ sessionId: string
106
+ cwd?: string
107
+ gitBranch?: string
108
+ firstActivityMs?: number
109
+ lastActivityMs?: number
110
+ firstPrompt?: string
111
+ lastAssistantText?: string
112
+ models: Array<string>
113
+ originator?: string
114
+ agentVersion?: string
115
+ repoUrl?: string
116
+ initialCommit?: string
117
+ workspaceRoots: Array<string>
118
+ rawPath?: string
119
+ sourceStamp?: string
120
+ discoveryState: string
121
+ fromCache: boolean
122
+ }
123
+ export interface CatalogCursor {
124
+ lastActivityMs?: number
125
+ source: string
126
+ sessionId: string
127
+ }
128
+ export interface ListCatalogOptions {
129
+ dbPath?: string
130
+ sources?: Array<string>
131
+ limit?: number
132
+ beforeMs?: number
133
+ after?: CatalogCursor
134
+ }
135
+ export interface SessionCatalogPage {
136
+ contractVersion: number
137
+ sessions: Array<CatalogSession>
138
+ nextCursor?: CatalogCursor
139
+ }
140
+ /** Cache-only indexed catalog query. Missing databases return an empty page. */
141
+ export declare function listSessionCatalogPage(options?: ListCatalogOptions | undefined | null): Promise<SessionCatalogPage>
142
+ /** Convenience first-page catalog listing with identical cache-only semantics. */
143
+ export declare function listSessionCatalog(options?: ListCatalogOptions | undefined | null): Promise<Array<CatalogSession>>
144
+ export interface DiscoverOptions {
145
+ dbPath?: string
146
+ sources?: Array<string>
147
+ limit?: number
148
+ }
149
+ export interface DiscoveryDiagnostic {
150
+ source: string
151
+ locator?: string
152
+ error: string
153
+ }
154
+ export interface ProviderSummary {
155
+ source: string
156
+ candidates: number
157
+ discovered: number
158
+ skippedUnchanged: number
159
+ failed: boolean
160
+ }
161
+ export interface DiscoveryCounters {
162
+ candidatesEnumerated: number
163
+ shallowReads: number
164
+ skippedUnchanged: number
165
+ filesOpened: number
166
+ bytesRead: number
167
+ }
168
+ export interface SourceExemption {
169
+ source: string
170
+ reason: string
171
+ }
172
+ export interface DiscoverResult {
173
+ contractVersion: number
174
+ sessions: Array<CatalogSession>
175
+ discovered: number
176
+ skippedUnchanged: number
177
+ providers: Array<ProviderSummary>
178
+ exemptSources: Array<SourceExemption>
179
+ diagnostics: Array<DiscoveryDiagnostic>
180
+ counters: DiscoveryCounters
181
+ }
182
+ /** Explicit bounded provider discovery. It updates only the session catalog. */
183
+ export declare function discoverSessions(options?: DiscoverOptions | undefined | null): Promise<DiscoverResult>
184
+ export interface SyncOptions {
185
+ dbPath?: string
186
+ }
187
+ export interface SyncResult {
188
+ databasePath: string
189
+ completed: boolean
190
+ }
191
+ /** Explicit full ingestion. A read operation never calls this implicitly. */
192
+ export declare function sync(options?: SyncOptions | undefined | null): Promise<SyncResult>
193
+ /** Backward-compatible internal capture entry point; not used by the SDK. */
194
+ export declare function syncLocal(): Promise<void>
7
195
  export interface SyncPushResult {
8
196
  sent: number
9
197
  accepted: number
10
- /** `false` when there's no stored relayhistory auth yet (a no-op, not an error). */
11
198
  authenticated: boolean
199
+ syncSkipped: boolean
12
200
  }
13
- /**
14
- * Sync local agent history into the ai-hist DB, then push new records to
15
- * relayhistory-cloud. The blocking work (file/SQLite/HTTP) runs on a worker
16
- * thread so the Node event loop is never blocked.
17
- */
201
+ /** Cloud capture hook retained for Agent Relay integration. */
18
202
  export declare function syncAndPush(): Promise<SyncPushResult>
package/index.js CHANGED
@@ -310,6 +310,18 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { syncAndPush } = nativeBinding
313
+ const { nativeContractVersion, nativeBuildProfile, search, recent, getSession, getSessionEventsPage, stats, listSessionCatalogPage, listSessionCatalog, discoverSessions, sync, syncLocal, syncAndPush } = nativeBinding
314
314
 
315
+ module.exports.nativeContractVersion = nativeContractVersion
316
+ module.exports.nativeBuildProfile = nativeBuildProfile
317
+ module.exports.search = search
318
+ module.exports.recent = recent
319
+ module.exports.getSession = getSession
320
+ module.exports.getSessionEventsPage = getSessionEventsPage
321
+ module.exports.stats = stats
322
+ module.exports.listSessionCatalogPage = listSessionCatalogPage
323
+ module.exports.listSessionCatalog = listSessionCatalog
324
+ module.exports.discoverSessions = discoverSessions
325
+ module.exports.sync = sync
326
+ module.exports.syncLocal = syncLocal
315
327
  module.exports.syncAndPush = syncAndPush
@@ -0,0 +1,3 @@
1
+ # `ai-hist-native-darwin-arm64`
2
+
3
+ This is the **aarch64-apple-darwin** binary for `ai-hist-native`
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "ai-hist-native-darwin-arm64",
3
+ "version": "0.8.2",
4
+ "os": [
5
+ "darwin"
6
+ ],
7
+ "cpu": [
8
+ "arm64"
9
+ ],
10
+ "main": "ai-hist-native.darwin-arm64.node",
11
+ "files": [
12
+ "ai-hist-native.darwin-arm64.node"
13
+ ],
14
+ "description": "Mandatory Node-API engine for RelayHistory.",
15
+ "license": "MIT",
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/AgentWorkforce/relayhistory.git",
25
+ "directory": "crates/ai-hist-napi"
26
+ }
27
+ }
@@ -0,0 +1,3 @@
1
+ # `ai-hist-native-darwin-x64`
2
+
3
+ This is the **x86_64-apple-darwin** binary for `ai-hist-native`
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "ai-hist-native-darwin-x64",
3
+ "version": "0.8.2",
4
+ "os": [
5
+ "darwin"
6
+ ],
7
+ "cpu": [
8
+ "x64"
9
+ ],
10
+ "main": "ai-hist-native.darwin-x64.node",
11
+ "files": [
12
+ "ai-hist-native.darwin-x64.node"
13
+ ],
14
+ "description": "Mandatory Node-API engine for RelayHistory.",
15
+ "license": "MIT",
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/AgentWorkforce/relayhistory.git",
25
+ "directory": "crates/ai-hist-napi"
26
+ }
27
+ }
@@ -0,0 +1,3 @@
1
+ # `ai-hist-native-linux-arm64-gnu`
2
+
3
+ This is the **aarch64-unknown-linux-gnu** binary for `ai-hist-native`
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "ai-hist-native-linux-arm64-gnu",
3
+ "version": "0.8.2",
4
+ "os": [
5
+ "linux"
6
+ ],
7
+ "cpu": [
8
+ "arm64"
9
+ ],
10
+ "main": "ai-hist-native.linux-arm64-gnu.node",
11
+ "files": [
12
+ "ai-hist-native.linux-arm64-gnu.node"
13
+ ],
14
+ "description": "Mandatory Node-API engine for RelayHistory.",
15
+ "license": "MIT",
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/AgentWorkforce/relayhistory.git",
25
+ "directory": "crates/ai-hist-napi"
26
+ },
27
+ "libc": [
28
+ "glibc"
29
+ ]
30
+ }
@@ -0,0 +1,3 @@
1
+ # `ai-hist-native-linux-arm64-musl`
2
+
3
+ This is the **aarch64-unknown-linux-musl** binary for `ai-hist-native`
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "ai-hist-native-linux-arm64-musl",
3
+ "version": "0.8.2",
4
+ "os": [
5
+ "linux"
6
+ ],
7
+ "cpu": [
8
+ "arm64"
9
+ ],
10
+ "main": "ai-hist-native.linux-arm64-musl.node",
11
+ "files": [
12
+ "ai-hist-native.linux-arm64-musl.node"
13
+ ],
14
+ "description": "Mandatory Node-API engine for RelayHistory.",
15
+ "license": "MIT",
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/AgentWorkforce/relayhistory.git",
25
+ "directory": "crates/ai-hist-napi"
26
+ },
27
+ "libc": [
28
+ "musl"
29
+ ]
30
+ }
@@ -0,0 +1,3 @@
1
+ # `ai-hist-native-linux-x64-gnu`
2
+
3
+ This is the **x86_64-unknown-linux-gnu** binary for `ai-hist-native`
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "ai-hist-native-linux-x64-gnu",
3
+ "version": "0.8.2",
4
+ "os": [
5
+ "linux"
6
+ ],
7
+ "cpu": [
8
+ "x64"
9
+ ],
10
+ "main": "ai-hist-native.linux-x64-gnu.node",
11
+ "files": [
12
+ "ai-hist-native.linux-x64-gnu.node"
13
+ ],
14
+ "description": "Mandatory Node-API engine for RelayHistory.",
15
+ "license": "MIT",
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/AgentWorkforce/relayhistory.git",
25
+ "directory": "crates/ai-hist-napi"
26
+ },
27
+ "libc": [
28
+ "glibc"
29
+ ]
30
+ }
@@ -0,0 +1,3 @@
1
+ # `ai-hist-native-linux-x64-musl`
2
+
3
+ This is the **x86_64-unknown-linux-musl** binary for `ai-hist-native`
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "ai-hist-native-linux-x64-musl",
3
+ "version": "0.8.2",
4
+ "os": [
5
+ "linux"
6
+ ],
7
+ "cpu": [
8
+ "x64"
9
+ ],
10
+ "main": "ai-hist-native.linux-x64-musl.node",
11
+ "files": [
12
+ "ai-hist-native.linux-x64-musl.node"
13
+ ],
14
+ "description": "Mandatory Node-API engine for RelayHistory.",
15
+ "license": "MIT",
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/AgentWorkforce/relayhistory.git",
25
+ "directory": "crates/ai-hist-napi"
26
+ },
27
+ "libc": [
28
+ "musl"
29
+ ]
30
+ }
@@ -0,0 +1,3 @@
1
+ # `ai-hist-native-win32-x64-msvc`
2
+
3
+ This is the **x86_64-pc-windows-msvc** binary for `ai-hist-native`
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "ai-hist-native-win32-x64-msvc",
3
+ "version": "0.8.2",
4
+ "os": [
5
+ "win32"
6
+ ],
7
+ "cpu": [
8
+ "x64"
9
+ ],
10
+ "main": "ai-hist-native.win32-x64-msvc.node",
11
+ "files": [
12
+ "ai-hist-native.win32-x64-msvc.node"
13
+ ],
14
+ "description": "Mandatory Node-API engine for RelayHistory.",
15
+ "license": "MIT",
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/AgentWorkforce/relayhistory.git",
25
+ "directory": "crates/ai-hist-napi"
26
+ }
27
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-hist-native",
3
- "version": "0.4.3",
4
- "description": "Native (napi) binding for ai-hist — in-process sync + cloud push.",
3
+ "version": "0.8.2",
4
+ "description": "Mandatory Node-API engine for RelayHistory.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "license": "MIT",
@@ -20,16 +20,18 @@
20
20
  "x86_64-unknown-linux-gnu",
21
21
  "aarch64-unknown-linux-gnu",
22
22
  "x86_64-unknown-linux-musl",
23
- "aarch64-unknown-linux-musl"
23
+ "aarch64-unknown-linux-musl",
24
+ "x86_64-pc-windows-msvc"
24
25
  ]
25
26
  }
26
27
  },
27
28
  "files": [
28
29
  "index.js",
29
- "index.d.ts"
30
+ "index.d.ts",
31
+ "npm"
30
32
  ],
31
33
  "engines": {
32
- "node": ">= 18"
34
+ "node": ">=20"
33
35
  },
34
36
  "publishConfig": {
35
37
  "access": "public"
@@ -42,11 +44,12 @@
42
44
  "@napi-rs/cli": "^2.18.4"
43
45
  },
44
46
  "optionalDependencies": {
45
- "ai-hist-native-darwin-arm64": "0.4.3",
46
- "ai-hist-native-darwin-x64": "0.4.3",
47
- "ai-hist-native-linux-x64-gnu": "0.4.3",
48
- "ai-hist-native-linux-arm64-gnu": "0.4.3",
49
- "ai-hist-native-linux-x64-musl": "0.4.3",
50
- "ai-hist-native-linux-arm64-musl": "0.4.3"
47
+ "ai-hist-native-darwin-arm64": "0.8.2",
48
+ "ai-hist-native-darwin-x64": "0.8.2",
49
+ "ai-hist-native-linux-x64-gnu": "0.8.2",
50
+ "ai-hist-native-linux-arm64-gnu": "0.8.2",
51
+ "ai-hist-native-linux-x64-musl": "0.8.2",
52
+ "ai-hist-native-linux-arm64-musl": "0.8.2",
53
+ "ai-hist-native-win32-x64-msvc": "0.8.2"
51
54
  }
52
55
  }