ai-hist-native 0.10.0 → 0.12.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/index.d.ts CHANGED
@@ -74,6 +74,70 @@ export interface SessionEventsPage {
74
74
  events: Array<NativeSessionEvent>
75
75
  nextCursor?: EventCursor
76
76
  }
77
+ export interface NativeSessionToolCall {
78
+ id: number
79
+ source: string
80
+ sessionId: string
81
+ messageId?: string
82
+ toolUseId: string
83
+ name: string
84
+ target?: string
85
+ /**
86
+ * Stored provider arguments, unparsed. The SDK owns JSON parsing so an
87
+ * unreadable value cannot fail a whole page at the boundary.
88
+ */
89
+ argsJson?: string
90
+ isError?: boolean
91
+ tsMs?: number
92
+ }
93
+ export interface NativeSessionFileEdit {
94
+ id: number
95
+ source: string
96
+ sessionId: string
97
+ messageId?: string
98
+ toolUseId: string
99
+ filePath: string
100
+ toolName?: string
101
+ linesAdded?: number
102
+ linesRemoved?: number
103
+ /** Stored provider patch, unparsed, for the same reason as `args_json`. */
104
+ structuredPatchJson?: string
105
+ userModified?: boolean
106
+ tsMs?: number
107
+ gitBranch?: string
108
+ cwd?: string
109
+ }
110
+ /**
111
+ * Continuation for tool call and file edit pages. `tsMs` is optional because
112
+ * both tables order their undated rows last.
113
+ *
114
+ * Absent-or-`undefined` is how a caller says "inside the undated tail": an
115
+ * explicit JavaScript `null` cannot be converted to `i64` and fails at the
116
+ * boundary, so the SDK normalizes `null` to `undefined` before calling in.
117
+ */
118
+ export interface EvidenceCursor {
119
+ tsMs?: number
120
+ id: number
121
+ }
122
+ export interface EvidencePageOptions {
123
+ dbPath?: string
124
+ limit?: number
125
+ after?: EvidenceCursor
126
+ }
127
+ export interface SessionToolCallsPage {
128
+ contractVersion: number
129
+ source: string
130
+ sessionId: string
131
+ toolCalls: Array<NativeSessionToolCall>
132
+ nextCursor?: EvidenceCursor
133
+ }
134
+ export interface SessionFileEditsPage {
135
+ contractVersion: number
136
+ source: string
137
+ sessionId: string
138
+ fileEdits: Array<NativeSessionFileEdit>
139
+ nextCursor?: EvidenceCursor
140
+ }
77
141
  export interface SourceCount {
78
142
  source: string
79
143
  count: number
@@ -103,6 +167,15 @@ export declare function recent(options?: HistoryQueryOptions | undefined | null)
103
167
  export declare function getSession(sessionId: string, options?: SessionOptions | undefined | null): Promise<Array<NativeHistoryEntry>>
104
168
  /** One bounded page of normalized events for a session. */
105
169
  export declare function getSessionEventsPage(sessionId: string, options?: EventsPageOptions | undefined | null): Promise<SessionEventsPage>
170
+ /**
171
+ * One bounded page of recorded tool calls for one session.
172
+ *
173
+ * Both `source` and `sessionId` are required: provider session ids are not
174
+ * globally unique, so an id-only lookup could interleave two sessions.
175
+ */
176
+ export declare function getSessionToolCallsPage(source: string, sessionId: string, options?: EvidencePageOptions | undefined | null): Promise<SessionToolCallsPage>
177
+ /** One bounded page of recorded file edits for one session. */
178
+ export declare function getSessionFileEditsPage(source: string, sessionId: string, options?: EvidencePageOptions | undefined | null): Promise<SessionFileEditsPage>
106
179
  /** Database statistics over already-indexed data. */
107
180
  export declare function stats(options?: StatsOptions | undefined | null): Promise<NativeStats>
108
181
  export interface CatalogSession {
@@ -181,6 +254,7 @@ export interface SourceExemption {
181
254
  export interface DiscoverResult {
182
255
  contractVersion: number
183
256
  scope: string
257
+ locationsRun: Array<string>
184
258
  sessions: Array<CatalogSession>
185
259
  discovered: number
186
260
  skippedUnchanged: number
package/index.js CHANGED
@@ -310,7 +310,7 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { nativeContractVersion, nativeBuildProfile, search, recent, getSession, getSessionEventsPage, stats, listSessionCatalogPage, listSessionCatalog, discoverSessions, hydrateSession, sync, syncLocal, syncAndPush } = nativeBinding
313
+ const { nativeContractVersion, nativeBuildProfile, search, recent, getSession, getSessionEventsPage, getSessionToolCallsPage, getSessionFileEditsPage, stats, listSessionCatalogPage, listSessionCatalog, discoverSessions, hydrateSession, sync, syncLocal, syncAndPush } = nativeBinding
314
314
 
315
315
  module.exports.nativeContractVersion = nativeContractVersion
316
316
  module.exports.nativeBuildProfile = nativeBuildProfile
@@ -318,6 +318,8 @@ module.exports.search = search
318
318
  module.exports.recent = recent
319
319
  module.exports.getSession = getSession
320
320
  module.exports.getSessionEventsPage = getSessionEventsPage
321
+ module.exports.getSessionToolCallsPage = getSessionToolCallsPage
322
+ module.exports.getSessionFileEditsPage = getSessionFileEditsPage
321
323
  module.exports.stats = stats
322
324
  module.exports.listSessionCatalogPage = listSessionCatalogPage
323
325
  module.exports.listSessionCatalog = listSessionCatalog
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-hist-native-darwin-arm64",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "os": [
5
5
  "darwin"
6
6
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-hist-native-darwin-x64",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "os": [
5
5
  "darwin"
6
6
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-hist-native-linux-arm64-gnu",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "os": [
5
5
  "linux"
6
6
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-hist-native-linux-arm64-musl",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "os": [
5
5
  "linux"
6
6
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-hist-native-linux-x64-gnu",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "os": [
5
5
  "linux"
6
6
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-hist-native-linux-x64-musl",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "os": [
5
5
  "linux"
6
6
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-hist-native-win32-x64-msvc",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "os": [
5
5
  "win32"
6
6
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-hist-native",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Mandatory Node-API engine for RelayHistory.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -44,12 +44,12 @@
44
44
  "@napi-rs/cli": "^2.18.4"
45
45
  },
46
46
  "optionalDependencies": {
47
- "ai-hist-native-darwin-arm64": "0.10.0",
48
- "ai-hist-native-darwin-x64": "0.10.0",
49
- "ai-hist-native-linux-x64-gnu": "0.10.0",
50
- "ai-hist-native-linux-arm64-gnu": "0.10.0",
51
- "ai-hist-native-linux-x64-musl": "0.10.0",
52
- "ai-hist-native-linux-arm64-musl": "0.10.0",
53
- "ai-hist-native-win32-x64-msvc": "0.10.0"
47
+ "ai-hist-native-darwin-arm64": "0.12.0",
48
+ "ai-hist-native-darwin-x64": "0.12.0",
49
+ "ai-hist-native-linux-x64-gnu": "0.12.0",
50
+ "ai-hist-native-linux-arm64-gnu": "0.12.0",
51
+ "ai-hist-native-linux-x64-musl": "0.12.0",
52
+ "ai-hist-native-linux-arm64-musl": "0.12.0",
53
+ "ai-hist-native-win32-x64-msvc": "0.12.0"
54
54
  }
55
55
  }