agentacta 2026.4.8 → 2026.4.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.
@@ -0,0 +1,361 @@
1
+ import type Database from 'better-sqlite3';
2
+ export interface AgentActaConfig {
3
+ port: number;
4
+ storage: string;
5
+ sessionsPath: string | string[] | null;
6
+ dbPath: string;
7
+ projectAliases: Record<string, string>;
8
+ }
9
+ export interface SessionRow {
10
+ id: string;
11
+ start_time: string;
12
+ end_time: string | null;
13
+ message_count: number;
14
+ tool_count: number;
15
+ model: string | null;
16
+ summary: string | null;
17
+ agent: string | null;
18
+ session_type: string | null;
19
+ total_cost: number;
20
+ total_tokens: number;
21
+ input_tokens: number;
22
+ output_tokens: number;
23
+ cache_read_tokens: number;
24
+ cache_write_tokens: number;
25
+ initial_prompt: string | null;
26
+ first_message_id: string | null;
27
+ first_message_timestamp: string | null;
28
+ models: string | null;
29
+ projects: string | null;
30
+ }
31
+ export interface EventRow {
32
+ id: string;
33
+ session_id: string;
34
+ timestamp: string;
35
+ type: string;
36
+ role: string | null;
37
+ content: string | null;
38
+ tool_name: string | null;
39
+ tool_args: string | null;
40
+ tool_result: string | null;
41
+ }
42
+ export interface FileActivityRow {
43
+ id: number;
44
+ session_id: string;
45
+ file_path: string;
46
+ operation: string;
47
+ timestamp: string | null;
48
+ }
49
+ export interface IndexStateRow {
50
+ file_path: string;
51
+ last_offset: number;
52
+ last_modified: string | null;
53
+ }
54
+ export interface ArchiveRow {
55
+ id: number;
56
+ session_id: string;
57
+ line_number: number;
58
+ raw_json: string;
59
+ }
60
+ export interface SessionInsightRow {
61
+ session_id: string;
62
+ signals: string;
63
+ confusion_score: number;
64
+ flagged: number;
65
+ computed_at: string | null;
66
+ }
67
+ export interface SessionInsightJoinedRow extends SessionInsightRow {
68
+ summary: string | null;
69
+ model: string | null;
70
+ agent: string | null;
71
+ start_time: string;
72
+ tool_count: number;
73
+ message_count: number;
74
+ }
75
+ export interface PreparedStatements {
76
+ getState: Database.Statement;
77
+ getSession: Database.Statement;
78
+ deleteEvents: Database.Statement;
79
+ deleteSession: Database.Statement;
80
+ deleteFileActivity: Database.Statement;
81
+ insertEvent: Database.Statement;
82
+ upsertSession: Database.Statement;
83
+ upsertState: Database.Statement;
84
+ insertFileActivity: Database.Statement;
85
+ deleteArchive: Database.Statement;
86
+ insertArchive: Database.Statement;
87
+ }
88
+ export interface SessionDir {
89
+ path: string;
90
+ agent: string;
91
+ recursive?: boolean;
92
+ sourceType?: string;
93
+ }
94
+ export interface IndexResult {
95
+ skipped?: boolean;
96
+ sessionId?: string;
97
+ msgCount?: number;
98
+ toolCount?: number;
99
+ synthetic?: boolean;
100
+ preferredTranscript?: boolean;
101
+ }
102
+ export interface IndexAllResult {
103
+ sessions: number;
104
+ events: number;
105
+ newSessions: number;
106
+ }
107
+ export interface ExtractedToolCall {
108
+ id: string;
109
+ name: string;
110
+ args: string;
111
+ }
112
+ export interface ExtractedToolResult {
113
+ toolCallId: string;
114
+ toolName: string;
115
+ content: string;
116
+ }
117
+ export interface JsonlLine {
118
+ type?: string;
119
+ id?: string;
120
+ uuid?: string;
121
+ sessionId?: string;
122
+ timestamp?: string;
123
+ message?: MessagePayload;
124
+ agent?: string;
125
+ sessionType?: string;
126
+ cwd?: string;
127
+ modelId?: string;
128
+ payload?: Record<string, unknown>;
129
+ content?: unknown;
130
+ role?: string;
131
+ }
132
+ export interface MessagePayload {
133
+ role?: string;
134
+ content?: string | ContentBlock[];
135
+ model?: string;
136
+ usage?: UsageInfo;
137
+ toolCallId?: string;
138
+ toolName?: string;
139
+ }
140
+ export interface ContentBlock {
141
+ type?: string;
142
+ text?: string;
143
+ id?: string;
144
+ toolCallId?: string;
145
+ name?: string;
146
+ input?: Record<string, unknown>;
147
+ arguments?: Record<string, unknown> | string;
148
+ output_text?: string;
149
+ input_text?: string;
150
+ }
151
+ export interface UsageInfo {
152
+ cost?: {
153
+ total?: number;
154
+ };
155
+ totalTokens?: number;
156
+ input?: number;
157
+ output?: number;
158
+ cacheRead?: number;
159
+ cacheWrite?: number;
160
+ input_tokens?: number;
161
+ output_tokens?: number;
162
+ cache_read_input_tokens?: number;
163
+ cache_creation_input_tokens?: number;
164
+ total_tokens?: number;
165
+ }
166
+ export interface ToolRetryLoopSignal {
167
+ type: 'tool_retry_loop';
168
+ tool: string;
169
+ count: number;
170
+ }
171
+ export interface SessionBailSignal {
172
+ type: 'session_bail';
173
+ tool_calls: number;
174
+ }
175
+ export interface HighErrorRateSignal {
176
+ type: 'high_error_rate';
177
+ error_count: number;
178
+ total: number;
179
+ rate: number;
180
+ }
181
+ export interface LongPromptShortSessionSignal {
182
+ type: 'long_prompt_short_session';
183
+ prompt_words: number;
184
+ tool_calls: number;
185
+ }
186
+ export interface NoCompletionSignal {
187
+ type: 'no_completion';
188
+ last_event_type: string;
189
+ last_tool: string | null;
190
+ }
191
+ export type InsightSignal = ToolRetryLoopSignal | SessionBailSignal | HighErrorRateSignal | LongPromptShortSessionSignal | NoCompletionSignal;
192
+ export type SignalType = InsightSignal['type'];
193
+ export declare const SIGNAL_WEIGHTS: Record<SignalType, number>;
194
+ export interface InsightResult {
195
+ session_id: string;
196
+ signals: InsightSignal[];
197
+ confusion_score: number;
198
+ flagged: boolean;
199
+ computed_at: string;
200
+ }
201
+ export interface AgentInsights {
202
+ count: number;
203
+ flagged: number;
204
+ total_score: number;
205
+ avg_score?: number;
206
+ }
207
+ export interface TopFlaggedSession {
208
+ session_id: string;
209
+ summary: string | null;
210
+ model: string | null;
211
+ agent: string | null;
212
+ start_time: string;
213
+ tool_count: number;
214
+ message_count: number;
215
+ confusion_score: number;
216
+ signals: InsightSignal[];
217
+ }
218
+ export interface InsightsSummary {
219
+ total_sessions: number;
220
+ flagged_count: number;
221
+ flagged_percentage: number;
222
+ avg_confusion_score: number;
223
+ signal_counts: Record<string, number>;
224
+ by_agent: Record<string, AgentInsights>;
225
+ top_flagged: TopFlaggedSession[];
226
+ }
227
+ export interface AttributedEvent extends EventRow {
228
+ project: string | null;
229
+ project_confidence: number;
230
+ }
231
+ export interface ProjectFilter {
232
+ project: string;
233
+ eventCount: number;
234
+ }
235
+ export interface AttributionResult {
236
+ events: AttributedEvent[];
237
+ projectFilters: ProjectFilter[];
238
+ }
239
+ export interface ProjectScore {
240
+ project: string | null;
241
+ score: number;
242
+ }
243
+ export interface DbSize {
244
+ bytes: number;
245
+ display: string;
246
+ }
247
+ export interface HealthResponse {
248
+ status: string;
249
+ version: string;
250
+ uptime: number;
251
+ sessions: number;
252
+ dbSizeBytes: number;
253
+ node: string;
254
+ }
255
+ export interface StatsResponse {
256
+ sessions: number;
257
+ events: number;
258
+ messages: number;
259
+ toolCalls: number;
260
+ uniqueTools: number;
261
+ tools: string[];
262
+ dateRange: {
263
+ earliest: string | null;
264
+ latest: string | null;
265
+ };
266
+ totalCost: number;
267
+ totalTokens: number;
268
+ agents: string[];
269
+ storageMode: string;
270
+ dbSize: DbSize;
271
+ sessionDirs: Array<{
272
+ path: string;
273
+ agent: string;
274
+ }>;
275
+ }
276
+ export interface SearchEventRow extends EventRow {
277
+ session_start: string;
278
+ session_summary: string | null;
279
+ }
280
+ export interface TimelineEventRow extends EventRow {
281
+ session_summary: string | null;
282
+ }
283
+ export interface ParsedQuery {
284
+ pathname: string;
285
+ query: Record<string, string>;
286
+ }
287
+ export interface CronMetadata {
288
+ sessionId?: string;
289
+ ts?: number;
290
+ runAtMs?: number;
291
+ durationMs?: number;
292
+ summary?: string;
293
+ sessionKey?: string;
294
+ model?: string;
295
+ provider?: string;
296
+ usage?: {
297
+ input_tokens?: number;
298
+ output_tokens?: number;
299
+ total_tokens?: number;
300
+ };
301
+ }
302
+ export interface CodexSessionMeta {
303
+ id?: string;
304
+ timestamp?: string;
305
+ model?: string;
306
+ model_provider?: string;
307
+ source?: string;
308
+ originator?: string;
309
+ cwd?: string;
310
+ }
311
+ export interface CodexResponsePayload {
312
+ type?: string;
313
+ name?: string;
314
+ tool_name?: string;
315
+ arguments?: string | Record<string, unknown>;
316
+ call_id?: string;
317
+ id?: string;
318
+ output?: string | unknown;
319
+ role?: string;
320
+ content?: unknown;
321
+ message?: string;
322
+ }
323
+ export interface CodexEventPayload {
324
+ type?: string;
325
+ message?: string;
326
+ }
327
+ export interface FileActivityAggRow {
328
+ file_path: string;
329
+ touch_count: number;
330
+ session_count: number;
331
+ last_touched: string | null;
332
+ operations: string;
333
+ }
334
+ export interface FileSessionRow extends SessionRow {
335
+ operation: string;
336
+ touch_time: string;
337
+ }
338
+ export interface RelatedFile {
339
+ path: string;
340
+ count: number;
341
+ }
342
+ export interface ToolCount {
343
+ tool: string;
344
+ count: number;
345
+ }
346
+ export interface RecentSession {
347
+ id: string;
348
+ summary: string | null;
349
+ agent: string | null;
350
+ timestamp: string;
351
+ status: string;
352
+ }
353
+ export interface CountRow {
354
+ c: number;
355
+ }
356
+ export interface PragmaColumnRow {
357
+ name: string;
358
+ }
359
+ export interface HasEventsRow {
360
+ has_events: number;
361
+ }
package/dist/types.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SIGNAL_WEIGHTS = void 0;
4
+ exports.SIGNAL_WEIGHTS = {
5
+ tool_retry_loop: 30,
6
+ session_bail: 25,
7
+ high_error_rate: 20,
8
+ long_prompt_short_session: 15,
9
+ no_completion: 10
10
+ };
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAmOa,QAAA,cAAc,GAA+B;IACxD,eAAe,EAAE,EAAE;IACnB,YAAY,EAAE,EAAE;IAChB,eAAe,EAAE,EAAE;IACnB,yBAAyB,EAAE,EAAE;IAC7B,aAAa,EAAE,EAAE;CAClB,CAAC"}