@agent-finops/core 0.8.1 → 0.9.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/README.md +5 -3
- package/dist/actionPlanner.d.ts +140 -0
- package/dist/actionPlanner.js +938 -0
- package/dist/actionVerification.d.ts +1240 -0
- package/dist/actionVerification.js +1028 -0
- package/dist/activitySnapshot.d.ts +142 -50
- package/dist/activitySnapshot.js +145 -6
- package/dist/activitySnapshotCache.d.ts +8 -1
- package/dist/activitySnapshotCache.js +103 -7
- package/dist/agentEconomicsReceipt.d.ts +74 -74
- package/dist/glance.d.ts +27 -1
- package/dist/glance.js +151 -12
- package/dist/index.d.ts +11 -2
- package/dist/index.js +10 -1
- package/dist/localAgentFormats/gemini.js +2 -2
- package/dist/localAgentFormats/registry.js +6 -2
- package/dist/localAgentFormats/runtimeRegistry.js +5 -2
- package/dist/localAgentFormats/types.d.ts +2 -1
- package/dist/localAgentLogs.d.ts +362 -3
- package/dist/localAgentLogs.js +1964 -165
- package/dist/modelPricing.d.ts +1 -1
- package/dist/modelPricing.js +1 -1
- package/dist/projectEconomics.d.ts +617 -0
- package/dist/projectEconomics.js +620 -0
- package/dist/projectEconomicsBuilder.d.ts +89 -0
- package/dist/projectEconomicsBuilder.js +473 -0
- package/dist/projectIndexStore.d.ts +545 -0
- package/dist/projectIndexStore.js +606 -0
- package/dist/providerConnectors.d.ts +59 -1
- package/dist/providerConnectors.js +175 -11
- package/dist/qualitativeIndexCache.d.ts +494 -0
- package/dist/qualitativeIndexCache.js +930 -0
- package/dist/resultCard.d.ts +350 -0
- package/dist/resultCard.js +604 -0
- package/dist/runtimeCommands.d.ts +21 -0
- package/dist/runtimeCommands.js +27 -0
- package/dist/scanGuard.d.ts +3 -1
- package/dist/scanGuard.js +164 -4
- package/dist/schema.d.ts +31 -31
- package/dist/sessionVitals.d.ts +145 -0
- package/dist/sessionVitals.js +521 -0
- package/dist/toolInvocations.d.ts +40 -1
- package/dist/toolInvocations.js +101 -20
- package/package.json +1 -1
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { LocalAgentFinancialIndexAdapter, LocalAgentQualitativeIndexAdapter, LocalAgentStreamCheckpointAdapter } from "./localAgentLogs.js";
|
|
3
|
+
import { type QualitativeIndexCacheOptions } from "./qualitativeIndexCache.js";
|
|
4
|
+
export declare const projectIndexStoreDirectoryName = "project-index-v2";
|
|
5
|
+
export declare const projectIndexStoreLockFileName = ".project-index-v2.lock";
|
|
6
|
+
/** One transcript's derived evidence, all windowed variants included. */
|
|
7
|
+
export declare const projectIndexMaxDocumentBytes: number;
|
|
8
|
+
/** Null-window variant plus the newest bounded windows (BLOCKER-2 option i). */
|
|
9
|
+
export declare const projectIndexMaxWindowedVariants = 4;
|
|
10
|
+
export declare const projectIndexFinancialParserVersion = 1;
|
|
11
|
+
declare const financialKeySchema: z.ZodObject<{
|
|
12
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
13
|
+
section: z.ZodLiteral<"financial">;
|
|
14
|
+
agent: z.ZodEnum<{
|
|
15
|
+
"claude-code": "claude-code";
|
|
16
|
+
codex: "codex";
|
|
17
|
+
"gemini-cli": "gemini-cli";
|
|
18
|
+
}>;
|
|
19
|
+
pathHash: z.ZodString;
|
|
20
|
+
fileIdentity: z.ZodString;
|
|
21
|
+
financialParserVersion: z.ZodLiteral<1>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
/**
|
|
24
|
+
* Header-pass ownership evidence (A4a consumer). "unknown" is a first-class
|
|
25
|
+
* state: ownership is never guessed from hashes, basenames, or absence.
|
|
26
|
+
*/
|
|
27
|
+
declare const ownershipSchema: z.ZodObject<{
|
|
28
|
+
status: z.ZodEnum<{
|
|
29
|
+
unknown: "unknown";
|
|
30
|
+
resolved: "resolved";
|
|
31
|
+
no_calls: "no_calls";
|
|
32
|
+
}>;
|
|
33
|
+
fileIdentity: z.ZodString;
|
|
34
|
+
projectRefs: z.ZodArray<z.ZodString>;
|
|
35
|
+
headerAttribution: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
status: z.ZodEnum<{
|
|
37
|
+
unknown: "unknown";
|
|
38
|
+
proven: "proven";
|
|
39
|
+
}>;
|
|
40
|
+
projectRef: z.ZodOptional<z.ZodString>;
|
|
41
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
}, z.core.$strict>>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
declare const documentSchema: z.ZodObject<{
|
|
45
|
+
kind: z.ZodLiteral<"aibill.project_index_file">;
|
|
46
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
47
|
+
agent: z.ZodEnum<{
|
|
48
|
+
"claude-code": "claude-code";
|
|
49
|
+
codex: "codex";
|
|
50
|
+
"gemini-cli": "gemini-cli";
|
|
51
|
+
}>;
|
|
52
|
+
pathHash: z.ZodString;
|
|
53
|
+
qualitative: z.ZodArray<z.ZodObject<{
|
|
54
|
+
key: z.ZodObject<{
|
|
55
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
56
|
+
parserVersion: z.ZodLiteral<4>;
|
|
57
|
+
agent: z.ZodEnum<{
|
|
58
|
+
"claude-code": "claude-code";
|
|
59
|
+
codex: "codex";
|
|
60
|
+
"gemini-cli": "gemini-cli";
|
|
61
|
+
}>;
|
|
62
|
+
pathHash: z.ZodString;
|
|
63
|
+
fileIdentity: z.ZodString;
|
|
64
|
+
sinceIso: z.ZodNullable<z.ZodString>;
|
|
65
|
+
collectInvocationEvidence: z.ZodBoolean;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
storedAt: z.ZodString;
|
|
68
|
+
value: z.ZodObject<{
|
|
69
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
70
|
+
agent: z.ZodEnum<{
|
|
71
|
+
"claude-code": "claude-code";
|
|
72
|
+
codex: "codex";
|
|
73
|
+
"gemini-cli": "gemini-cli";
|
|
74
|
+
}>;
|
|
75
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
76
|
+
model: z.ZodString;
|
|
77
|
+
timestamp: z.ZodString;
|
|
78
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
79
|
+
project: z.ZodOptional<z.ZodString>;
|
|
80
|
+
workingDirectoryRef: z.ZodOptional<z.ZodString>;
|
|
81
|
+
latestTurnUsage: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
inputTokens: z.ZodNumber;
|
|
83
|
+
outputTokens: z.ZodNumber;
|
|
84
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
cacheWrite5mTokens: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
cacheWrite1hTokens: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
thoughtTokens: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
toolTokens: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
contextTokens: z.ZodNumber;
|
|
90
|
+
totalTokens: z.ZodNumber;
|
|
91
|
+
source: z.ZodEnum<{
|
|
92
|
+
assistant_message_usage: "assistant_message_usage";
|
|
93
|
+
transcript_last_token_usage: "transcript_last_token_usage";
|
|
94
|
+
call_usage: "call_usage";
|
|
95
|
+
}>;
|
|
96
|
+
}, z.core.$strict>>;
|
|
97
|
+
usageScope: z.ZodOptional<z.ZodEnum<{
|
|
98
|
+
turn: "turn";
|
|
99
|
+
session_cumulative: "session_cumulative";
|
|
100
|
+
}>>;
|
|
101
|
+
usageSupport: z.ZodOptional<z.ZodEnum<{
|
|
102
|
+
complete: "complete";
|
|
103
|
+
unsupported_token_shape: "unsupported_token_shape";
|
|
104
|
+
}>>;
|
|
105
|
+
reportedTotalTokens: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
tokenComponentEvidence: z.ZodOptional<z.ZodObject<{
|
|
107
|
+
inputTokens: z.ZodLiteral<"observed">;
|
|
108
|
+
outputTokens: z.ZodLiteral<"observed">;
|
|
109
|
+
cacheReadTokens: z.ZodEnum<{
|
|
110
|
+
observed: "observed";
|
|
111
|
+
not_separately_reported: "not_separately_reported";
|
|
112
|
+
}>;
|
|
113
|
+
cacheWriteTokens: z.ZodEnum<{
|
|
114
|
+
observed: "observed";
|
|
115
|
+
not_separately_reported: "not_separately_reported";
|
|
116
|
+
partial: "partial";
|
|
117
|
+
}>;
|
|
118
|
+
thoughtTokens: z.ZodEnum<{
|
|
119
|
+
observed: "observed";
|
|
120
|
+
not_separately_reported: "not_separately_reported";
|
|
121
|
+
}>;
|
|
122
|
+
toolTokens: z.ZodEnum<{
|
|
123
|
+
observed: "observed";
|
|
124
|
+
not_separately_reported: "not_separately_reported";
|
|
125
|
+
}>;
|
|
126
|
+
calculatedTotalTokens: z.ZodEnum<{
|
|
127
|
+
calculated_complete: "calculated_complete";
|
|
128
|
+
calculated_partial: "calculated_partial";
|
|
129
|
+
}>;
|
|
130
|
+
reportedTotalTokens: z.ZodEnum<{
|
|
131
|
+
provider_reported: "provider_reported";
|
|
132
|
+
not_reported: "not_reported";
|
|
133
|
+
}>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
sourceVersion: z.ZodOptional<z.ZodString>;
|
|
136
|
+
completion: z.ZodOptional<z.ZodObject<{
|
|
137
|
+
status: z.ZodLiteral<"completed">;
|
|
138
|
+
evidence: z.ZodEnum<{
|
|
139
|
+
claude_turn_duration: "claude_turn_duration";
|
|
140
|
+
codex_task_complete: "codex_task_complete";
|
|
141
|
+
}>;
|
|
142
|
+
observedAt: z.ZodString;
|
|
143
|
+
}, z.core.$strict>>;
|
|
144
|
+
geminiTokenEvidence: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
input: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
output: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
cached: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
thoughts: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
tool: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
cacheAccounting: z.ZodEnum<{
|
|
152
|
+
unknown: "unknown";
|
|
153
|
+
included: "included";
|
|
154
|
+
none: "none";
|
|
155
|
+
}>;
|
|
156
|
+
}, z.core.$strict>>;
|
|
157
|
+
usage: z.ZodObject<{
|
|
158
|
+
inputTokens: z.ZodNumber;
|
|
159
|
+
outputTokens: z.ZodNumber;
|
|
160
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
cacheWrite5mTokens: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
cacheWrite1hTokens: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
thoughtTokens: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
toolTokens: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
167
|
+
subagentId: z.ZodOptional<z.ZodString>;
|
|
168
|
+
subagentCompletions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
169
|
+
subagentId: z.ZodString;
|
|
170
|
+
observedAt: z.ZodString;
|
|
171
|
+
}, z.core.$strict>>>;
|
|
172
|
+
rateLimits: z.ZodOptional<z.ZodObject<{
|
|
173
|
+
observedAt: z.ZodString;
|
|
174
|
+
limitId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
planType: z.ZodOptional<z.ZodString>;
|
|
176
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
177
|
+
kind: z.ZodEnum<{
|
|
178
|
+
custom: "custom";
|
|
179
|
+
"five-hour": "five-hour";
|
|
180
|
+
weekly: "weekly";
|
|
181
|
+
}>;
|
|
182
|
+
name: z.ZodString;
|
|
183
|
+
usedPercent: z.ZodNumber;
|
|
184
|
+
windowMinutes: z.ZodNumber;
|
|
185
|
+
resetsAt: z.ZodString;
|
|
186
|
+
}, z.core.$strict>>;
|
|
187
|
+
}, z.core.$strict>>;
|
|
188
|
+
activity: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
summary: z.ZodString;
|
|
190
|
+
kind: z.ZodEnum<{
|
|
191
|
+
project: "project";
|
|
192
|
+
agent: "agent";
|
|
193
|
+
file: "file";
|
|
194
|
+
task: "task";
|
|
195
|
+
automation: "automation";
|
|
196
|
+
}>;
|
|
197
|
+
action: z.ZodEnum<{
|
|
198
|
+
building: "building";
|
|
199
|
+
refining: "refining";
|
|
200
|
+
fixing: "fixing";
|
|
201
|
+
testing: "testing";
|
|
202
|
+
auditing: "auditing";
|
|
203
|
+
researching: "researching";
|
|
204
|
+
configuring: "configuring";
|
|
205
|
+
publishing: "publishing";
|
|
206
|
+
running: "running";
|
|
207
|
+
working: "working";
|
|
208
|
+
}>;
|
|
209
|
+
source: z.ZodEnum<{
|
|
210
|
+
project: "project";
|
|
211
|
+
agent_title: "agent_title";
|
|
212
|
+
user_prompts: "user_prompts";
|
|
213
|
+
file_activity: "file_activity";
|
|
214
|
+
}>;
|
|
215
|
+
promptCount: z.ZodNumber;
|
|
216
|
+
toolCallCount: z.ZodNumber;
|
|
217
|
+
files: z.ZodArray<z.ZodString>;
|
|
218
|
+
isSubagent: z.ZodBoolean;
|
|
219
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strict>>;
|
|
221
|
+
}, z.core.$strict>>;
|
|
222
|
+
invocationFile: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
invocations: z.ZodArray<z.ZodObject<{
|
|
224
|
+
name: z.ZodString;
|
|
225
|
+
count: z.ZodNumber;
|
|
226
|
+
}, z.core.$strict>>;
|
|
227
|
+
invokedMcpTools: z.ZodArray<z.ZodString>;
|
|
228
|
+
invokedSkills: z.ZodArray<z.ZodString>;
|
|
229
|
+
invokedSubagents: z.ZodArray<z.ZodString>;
|
|
230
|
+
invokedCommands: z.ZodArray<z.ZodString>;
|
|
231
|
+
assistantTurns: z.ZodNumber;
|
|
232
|
+
contextSignal: z.ZodObject<{
|
|
233
|
+
agent: z.ZodEnum<{
|
|
234
|
+
"claude-code": "claude-code";
|
|
235
|
+
codex: "codex";
|
|
236
|
+
}>;
|
|
237
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
238
|
+
lastActivityAt: z.ZodOptional<z.ZodString>;
|
|
239
|
+
compactionEvents: z.ZodNumber;
|
|
240
|
+
fileReads: z.ZodArray<z.ZodObject<{
|
|
241
|
+
name: z.ZodString;
|
|
242
|
+
count: z.ZodNumber;
|
|
243
|
+
}, z.core.$strict>>;
|
|
244
|
+
repeatedFileReads: z.ZodArray<z.ZodObject<{
|
|
245
|
+
name: z.ZodString;
|
|
246
|
+
count: z.ZodNumber;
|
|
247
|
+
}, z.core.$strict>>;
|
|
248
|
+
isSubagent: z.ZodBoolean;
|
|
249
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
250
|
+
nestedSessions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
251
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
252
|
+
isSubagent: z.ZodBoolean;
|
|
253
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
254
|
+
}, z.core.$strict>>>;
|
|
255
|
+
readCoverage: z.ZodLiteral<"explicit_read_tools_only">;
|
|
256
|
+
}, z.core.$strict>;
|
|
257
|
+
}, z.core.$strict>>;
|
|
258
|
+
invocationWindowProof: z.ZodOptional<z.ZodObject<{
|
|
259
|
+
earliestCountedAt: z.ZodOptional<z.ZodString>;
|
|
260
|
+
allCountedEventsTimestamped: z.ZodBoolean;
|
|
261
|
+
}, z.core.$strict>>;
|
|
262
|
+
diagnostics: z.ZodArray<z.ZodObject<{
|
|
263
|
+
code: z.ZodEnum<{
|
|
264
|
+
unsupported_token_shape: "unsupported_token_shape";
|
|
265
|
+
malformed_jsonl: "malformed_jsonl";
|
|
266
|
+
malformed_session_file: "malformed_session_file";
|
|
267
|
+
}>;
|
|
268
|
+
count: z.ZodNumber;
|
|
269
|
+
}, z.core.$strict>>;
|
|
270
|
+
}, z.core.$strict>;
|
|
271
|
+
}, z.core.$strict>>;
|
|
272
|
+
financial: z.ZodOptional<z.ZodObject<{
|
|
273
|
+
key: z.ZodObject<{
|
|
274
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
275
|
+
section: z.ZodLiteral<"financial">;
|
|
276
|
+
agent: z.ZodEnum<{
|
|
277
|
+
"claude-code": "claude-code";
|
|
278
|
+
codex: "codex";
|
|
279
|
+
"gemini-cli": "gemini-cli";
|
|
280
|
+
}>;
|
|
281
|
+
pathHash: z.ZodString;
|
|
282
|
+
fileIdentity: z.ZodString;
|
|
283
|
+
financialParserVersion: z.ZodLiteral<1>;
|
|
284
|
+
}, z.core.$strict>;
|
|
285
|
+
storedAt: z.ZodString;
|
|
286
|
+
value: z.ZodObject<{
|
|
287
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
288
|
+
agent: z.ZodEnum<{
|
|
289
|
+
"claude-code": "claude-code";
|
|
290
|
+
codex: "codex";
|
|
291
|
+
"gemini-cli": "gemini-cli";
|
|
292
|
+
}>;
|
|
293
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
294
|
+
model: z.ZodString;
|
|
295
|
+
timestamp: z.ZodString;
|
|
296
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
297
|
+
project: z.ZodOptional<z.ZodString>;
|
|
298
|
+
workingDirectoryRef: z.ZodOptional<z.ZodString>;
|
|
299
|
+
latestTurnUsage: z.ZodOptional<z.ZodObject<{
|
|
300
|
+
inputTokens: z.ZodNumber;
|
|
301
|
+
outputTokens: z.ZodNumber;
|
|
302
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
303
|
+
cacheWrite5mTokens: z.ZodOptional<z.ZodNumber>;
|
|
304
|
+
cacheWrite1hTokens: z.ZodOptional<z.ZodNumber>;
|
|
305
|
+
thoughtTokens: z.ZodOptional<z.ZodNumber>;
|
|
306
|
+
toolTokens: z.ZodOptional<z.ZodNumber>;
|
|
307
|
+
contextTokens: z.ZodNumber;
|
|
308
|
+
totalTokens: z.ZodNumber;
|
|
309
|
+
source: z.ZodEnum<{
|
|
310
|
+
assistant_message_usage: "assistant_message_usage";
|
|
311
|
+
transcript_last_token_usage: "transcript_last_token_usage";
|
|
312
|
+
call_usage: "call_usage";
|
|
313
|
+
}>;
|
|
314
|
+
}, z.core.$strict>>;
|
|
315
|
+
usageScope: z.ZodOptional<z.ZodEnum<{
|
|
316
|
+
turn: "turn";
|
|
317
|
+
session_cumulative: "session_cumulative";
|
|
318
|
+
}>>;
|
|
319
|
+
usageSupport: z.ZodOptional<z.ZodEnum<{
|
|
320
|
+
complete: "complete";
|
|
321
|
+
unsupported_token_shape: "unsupported_token_shape";
|
|
322
|
+
}>>;
|
|
323
|
+
reportedTotalTokens: z.ZodOptional<z.ZodNumber>;
|
|
324
|
+
tokenComponentEvidence: z.ZodOptional<z.ZodObject<{
|
|
325
|
+
inputTokens: z.ZodLiteral<"observed">;
|
|
326
|
+
outputTokens: z.ZodLiteral<"observed">;
|
|
327
|
+
cacheReadTokens: z.ZodEnum<{
|
|
328
|
+
observed: "observed";
|
|
329
|
+
not_separately_reported: "not_separately_reported";
|
|
330
|
+
}>;
|
|
331
|
+
cacheWriteTokens: z.ZodEnum<{
|
|
332
|
+
observed: "observed";
|
|
333
|
+
not_separately_reported: "not_separately_reported";
|
|
334
|
+
partial: "partial";
|
|
335
|
+
}>;
|
|
336
|
+
thoughtTokens: z.ZodEnum<{
|
|
337
|
+
observed: "observed";
|
|
338
|
+
not_separately_reported: "not_separately_reported";
|
|
339
|
+
}>;
|
|
340
|
+
toolTokens: z.ZodEnum<{
|
|
341
|
+
observed: "observed";
|
|
342
|
+
not_separately_reported: "not_separately_reported";
|
|
343
|
+
}>;
|
|
344
|
+
calculatedTotalTokens: z.ZodEnum<{
|
|
345
|
+
calculated_complete: "calculated_complete";
|
|
346
|
+
calculated_partial: "calculated_partial";
|
|
347
|
+
}>;
|
|
348
|
+
reportedTotalTokens: z.ZodEnum<{
|
|
349
|
+
provider_reported: "provider_reported";
|
|
350
|
+
not_reported: "not_reported";
|
|
351
|
+
}>;
|
|
352
|
+
}, z.core.$strict>>;
|
|
353
|
+
sourceVersion: z.ZodOptional<z.ZodString>;
|
|
354
|
+
completion: z.ZodOptional<z.ZodObject<{
|
|
355
|
+
status: z.ZodLiteral<"completed">;
|
|
356
|
+
evidence: z.ZodEnum<{
|
|
357
|
+
claude_turn_duration: "claude_turn_duration";
|
|
358
|
+
codex_task_complete: "codex_task_complete";
|
|
359
|
+
}>;
|
|
360
|
+
observedAt: z.ZodString;
|
|
361
|
+
}, z.core.$strict>>;
|
|
362
|
+
geminiTokenEvidence: z.ZodOptional<z.ZodObject<{
|
|
363
|
+
input: z.ZodOptional<z.ZodNumber>;
|
|
364
|
+
output: z.ZodOptional<z.ZodNumber>;
|
|
365
|
+
cached: z.ZodOptional<z.ZodNumber>;
|
|
366
|
+
thoughts: z.ZodOptional<z.ZodNumber>;
|
|
367
|
+
tool: z.ZodOptional<z.ZodNumber>;
|
|
368
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
369
|
+
cacheAccounting: z.ZodEnum<{
|
|
370
|
+
unknown: "unknown";
|
|
371
|
+
included: "included";
|
|
372
|
+
none: "none";
|
|
373
|
+
}>;
|
|
374
|
+
}, z.core.$strict>>;
|
|
375
|
+
usage: z.ZodObject<{
|
|
376
|
+
inputTokens: z.ZodNumber;
|
|
377
|
+
outputTokens: z.ZodNumber;
|
|
378
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
379
|
+
cacheWrite5mTokens: z.ZodOptional<z.ZodNumber>;
|
|
380
|
+
cacheWrite1hTokens: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
thoughtTokens: z.ZodOptional<z.ZodNumber>;
|
|
382
|
+
toolTokens: z.ZodOptional<z.ZodNumber>;
|
|
383
|
+
}, z.core.$strict>;
|
|
384
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
385
|
+
subagentId: z.ZodOptional<z.ZodString>;
|
|
386
|
+
subagentCompletions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
387
|
+
subagentId: z.ZodString;
|
|
388
|
+
observedAt: z.ZodString;
|
|
389
|
+
}, z.core.$strict>>>;
|
|
390
|
+
rateLimits: z.ZodOptional<z.ZodObject<{
|
|
391
|
+
observedAt: z.ZodString;
|
|
392
|
+
limitId: z.ZodOptional<z.ZodString>;
|
|
393
|
+
planType: z.ZodOptional<z.ZodString>;
|
|
394
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
395
|
+
kind: z.ZodEnum<{
|
|
396
|
+
custom: "custom";
|
|
397
|
+
"five-hour": "five-hour";
|
|
398
|
+
weekly: "weekly";
|
|
399
|
+
}>;
|
|
400
|
+
name: z.ZodString;
|
|
401
|
+
usedPercent: z.ZodNumber;
|
|
402
|
+
windowMinutes: z.ZodNumber;
|
|
403
|
+
resetsAt: z.ZodString;
|
|
404
|
+
}, z.core.$strict>>;
|
|
405
|
+
}, z.core.$strict>>;
|
|
406
|
+
activity: z.ZodOptional<z.ZodObject<{
|
|
407
|
+
summary: z.ZodString;
|
|
408
|
+
kind: z.ZodEnum<{
|
|
409
|
+
project: "project";
|
|
410
|
+
agent: "agent";
|
|
411
|
+
file: "file";
|
|
412
|
+
task: "task";
|
|
413
|
+
automation: "automation";
|
|
414
|
+
}>;
|
|
415
|
+
action: z.ZodEnum<{
|
|
416
|
+
building: "building";
|
|
417
|
+
refining: "refining";
|
|
418
|
+
fixing: "fixing";
|
|
419
|
+
testing: "testing";
|
|
420
|
+
auditing: "auditing";
|
|
421
|
+
researching: "researching";
|
|
422
|
+
configuring: "configuring";
|
|
423
|
+
publishing: "publishing";
|
|
424
|
+
running: "running";
|
|
425
|
+
working: "working";
|
|
426
|
+
}>;
|
|
427
|
+
source: z.ZodEnum<{
|
|
428
|
+
project: "project";
|
|
429
|
+
agent_title: "agent_title";
|
|
430
|
+
user_prompts: "user_prompts";
|
|
431
|
+
file_activity: "file_activity";
|
|
432
|
+
}>;
|
|
433
|
+
promptCount: z.ZodNumber;
|
|
434
|
+
toolCallCount: z.ZodNumber;
|
|
435
|
+
files: z.ZodArray<z.ZodString>;
|
|
436
|
+
isSubagent: z.ZodBoolean;
|
|
437
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
438
|
+
}, z.core.$strict>>;
|
|
439
|
+
}, z.core.$strict>>;
|
|
440
|
+
invocationFile: z.ZodOptional<z.ZodObject<{
|
|
441
|
+
invocations: z.ZodArray<z.ZodObject<{
|
|
442
|
+
name: z.ZodString;
|
|
443
|
+
count: z.ZodNumber;
|
|
444
|
+
}, z.core.$strict>>;
|
|
445
|
+
invokedMcpTools: z.ZodArray<z.ZodString>;
|
|
446
|
+
invokedSkills: z.ZodArray<z.ZodString>;
|
|
447
|
+
invokedSubagents: z.ZodArray<z.ZodString>;
|
|
448
|
+
invokedCommands: z.ZodArray<z.ZodString>;
|
|
449
|
+
assistantTurns: z.ZodNumber;
|
|
450
|
+
contextSignal: z.ZodObject<{
|
|
451
|
+
agent: z.ZodEnum<{
|
|
452
|
+
"claude-code": "claude-code";
|
|
453
|
+
codex: "codex";
|
|
454
|
+
}>;
|
|
455
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
456
|
+
lastActivityAt: z.ZodOptional<z.ZodString>;
|
|
457
|
+
compactionEvents: z.ZodNumber;
|
|
458
|
+
fileReads: z.ZodArray<z.ZodObject<{
|
|
459
|
+
name: z.ZodString;
|
|
460
|
+
count: z.ZodNumber;
|
|
461
|
+
}, z.core.$strict>>;
|
|
462
|
+
repeatedFileReads: z.ZodArray<z.ZodObject<{
|
|
463
|
+
name: z.ZodString;
|
|
464
|
+
count: z.ZodNumber;
|
|
465
|
+
}, z.core.$strict>>;
|
|
466
|
+
isSubagent: z.ZodBoolean;
|
|
467
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
468
|
+
nestedSessions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
469
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
470
|
+
isSubagent: z.ZodBoolean;
|
|
471
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
472
|
+
}, z.core.$strict>>>;
|
|
473
|
+
readCoverage: z.ZodLiteral<"explicit_read_tools_only">;
|
|
474
|
+
}, z.core.$strict>;
|
|
475
|
+
}, z.core.$strict>>;
|
|
476
|
+
invocationWindowProof: z.ZodOptional<z.ZodObject<{
|
|
477
|
+
earliestCountedAt: z.ZodOptional<z.ZodString>;
|
|
478
|
+
allCountedEventsTimestamped: z.ZodBoolean;
|
|
479
|
+
}, z.core.$strict>>;
|
|
480
|
+
diagnostics: z.ZodArray<z.ZodObject<{
|
|
481
|
+
code: z.ZodEnum<{
|
|
482
|
+
unsupported_token_shape: "unsupported_token_shape";
|
|
483
|
+
malformed_jsonl: "malformed_jsonl";
|
|
484
|
+
malformed_session_file: "malformed_session_file";
|
|
485
|
+
}>;
|
|
486
|
+
count: z.ZodNumber;
|
|
487
|
+
}, z.core.$strict>>;
|
|
488
|
+
}, z.core.$strict>;
|
|
489
|
+
}, z.core.$strict>>;
|
|
490
|
+
ownership: z.ZodOptional<z.ZodObject<{
|
|
491
|
+
status: z.ZodEnum<{
|
|
492
|
+
unknown: "unknown";
|
|
493
|
+
resolved: "resolved";
|
|
494
|
+
no_calls: "no_calls";
|
|
495
|
+
}>;
|
|
496
|
+
fileIdentity: z.ZodString;
|
|
497
|
+
projectRefs: z.ZodArray<z.ZodString>;
|
|
498
|
+
headerAttribution: z.ZodOptional<z.ZodObject<{
|
|
499
|
+
status: z.ZodEnum<{
|
|
500
|
+
unknown: "unknown";
|
|
501
|
+
proven: "proven";
|
|
502
|
+
}>;
|
|
503
|
+
projectRef: z.ZodOptional<z.ZodString>;
|
|
504
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
505
|
+
}, z.core.$strict>>;
|
|
506
|
+
}, z.core.$strict>>;
|
|
507
|
+
}, z.core.$strict>;
|
|
508
|
+
export type ProjectIndexDocument = z.infer<typeof documentSchema>;
|
|
509
|
+
export type ProjectIndexFinancialKey = z.infer<typeof financialKeySchema>;
|
|
510
|
+
export type ProjectIndexOwnership = z.infer<typeof ownershipSchema>;
|
|
511
|
+
export type ProjectIndexFinancialAdapter = LocalAgentFinancialIndexAdapter;
|
|
512
|
+
export type ProjectIndexAdapters = LocalAgentStreamCheckpointAdapter & {
|
|
513
|
+
qualitative: LocalAgentQualitativeIndexAdapter;
|
|
514
|
+
financial: ProjectIndexFinancialAdapter;
|
|
515
|
+
readOwnership: (agent: ProjectIndexDocument["agent"], pathHash: string) => Promise<ProjectIndexOwnership | undefined>;
|
|
516
|
+
writeOwnership: (agent: ProjectIndexDocument["agent"], pathHash: string, ownership: Readonly<ProjectIndexOwnership>) => Promise<void>;
|
|
517
|
+
/**
|
|
518
|
+
* Orphan sweep with a freshness grace window. Full liveness-aware GC
|
|
519
|
+
* priorities arrive with the coverage ledger.
|
|
520
|
+
*/
|
|
521
|
+
collectGarbage: (options?: {
|
|
522
|
+
retainPathHashes?: ReadonlySet<string>;
|
|
523
|
+
graceMs?: number;
|
|
524
|
+
}) => Promise<{
|
|
525
|
+
removed: number;
|
|
526
|
+
}>;
|
|
527
|
+
};
|
|
528
|
+
export declare const projectIndexGcGraceMs: number;
|
|
529
|
+
/**
|
|
530
|
+
* Sharded per-transcript store. Entry documents are lock-free: writes are
|
|
531
|
+
* private O_EXCL temp files atomically renamed over the shard path, so readers
|
|
532
|
+
* observe either complete version and concurrent same-key writers converge on
|
|
533
|
+
* semantically identical content (storedAt may differ; last writer wins).
|
|
534
|
+
* The writer lock guards only cross-document operations (GC).
|
|
535
|
+
*/
|
|
536
|
+
export declare function createProjectIndexAdapters(options?: QualitativeIndexCacheOptions & {
|
|
537
|
+
/**
|
|
538
|
+
* Long-lived read-only consumers (the MCP server) must disable the
|
|
539
|
+
* in-process document memo: they never write, so nothing would ever
|
|
540
|
+
* invalidate a stale memoized document.
|
|
541
|
+
*/
|
|
542
|
+
memoizeDocuments?: boolean;
|
|
543
|
+
}): ProjectIndexAdapters;
|
|
544
|
+
export {};
|
|
545
|
+
//# sourceMappingURL=projectIndexStore.d.ts.map
|