@agent-finops/core 0.8.1 → 0.9.1
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/agentDraftToken.d.ts +80 -0
- package/dist/agentDraftToken.js +188 -0
- package/dist/agentEconomicsReceipt.d.ts +74 -74
- package/dist/agentLoopContract.d.ts +27 -0
- package/dist/agentLoopContract.js +36 -0
- package/dist/glance.d.ts +27 -1
- package/dist/glance.js +151 -12
- package/dist/guidedAnswer.d.ts +51 -0
- package/dist/guidedAnswer.js +352 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +13 -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 +161 -1
- package/dist/providerConnectors.js +406 -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 +36 -0
- package/dist/runtimeCommands.js +50 -0
- package/dist/scanGuard.d.ts +3 -1
- package/dist/scanGuard.js +164 -4
- package/dist/schema.d.ts +33 -31
- package/dist/schema.js +9 -1
- 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,494 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { LocalAgentQualitativeIndexAdapter, LocalAgentQualitativeIndexValue } from "./localAgentLogs.js";
|
|
3
|
+
export declare const qualitativeIndexCacheEnvironmentVariable = "AIBILL_CACHE_DIR";
|
|
4
|
+
export declare const qualitativeIndexCacheFileName = "qualitative-index-v1.json";
|
|
5
|
+
export declare const qualitativeIndexCacheLockFileName = ".qualitative-index-v1.lock";
|
|
6
|
+
export declare const qualitativeIndexCacheMaxBytes: number;
|
|
7
|
+
export declare const qualitativeIndexCacheMaxEntryBytes: number;
|
|
8
|
+
export declare const qualitativeIndexCacheMaxEntries = 256;
|
|
9
|
+
/**
|
|
10
|
+
* Storage options for the private warm index. The limit overrides exist for
|
|
11
|
+
* tests and constrained embeddings and can only make the fixed production
|
|
12
|
+
* bounds smaller.
|
|
13
|
+
*/
|
|
14
|
+
export type QualitativeIndexCacheOptions = {
|
|
15
|
+
cacheDirectory?: string;
|
|
16
|
+
homeDirectory?: string;
|
|
17
|
+
lockTimeoutMs?: number;
|
|
18
|
+
maxBytes?: number;
|
|
19
|
+
maxEntryBytes?: number;
|
|
20
|
+
maxEntries?: number;
|
|
21
|
+
};
|
|
22
|
+
export declare class QualitativeIndexCacheError extends Error {
|
|
23
|
+
readonly code: "unsafe_directory" | "unsafe_file" | "oversized" | "malformed" | "unsupported_version" | "permission" | "lock_timeout" | "invalid_key" | "invalid_value" | "io";
|
|
24
|
+
constructor(code: QualitativeIndexCacheError["code"], message: string);
|
|
25
|
+
}
|
|
26
|
+
declare const keySchema: z.ZodObject<{
|
|
27
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
28
|
+
parserVersion: z.ZodLiteral<4>;
|
|
29
|
+
agent: z.ZodEnum<{
|
|
30
|
+
"claude-code": "claude-code";
|
|
31
|
+
codex: "codex";
|
|
32
|
+
"gemini-cli": "gemini-cli";
|
|
33
|
+
}>;
|
|
34
|
+
pathHash: z.ZodString;
|
|
35
|
+
fileIdentity: z.ZodString;
|
|
36
|
+
sinceIso: z.ZodNullable<z.ZodString>;
|
|
37
|
+
collectInvocationEvidence: z.ZodBoolean;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
declare const valueSchema: z.ZodObject<{
|
|
40
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
41
|
+
agent: z.ZodEnum<{
|
|
42
|
+
"claude-code": "claude-code";
|
|
43
|
+
codex: "codex";
|
|
44
|
+
"gemini-cli": "gemini-cli";
|
|
45
|
+
}>;
|
|
46
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
47
|
+
model: z.ZodString;
|
|
48
|
+
timestamp: z.ZodString;
|
|
49
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
50
|
+
project: z.ZodOptional<z.ZodString>;
|
|
51
|
+
workingDirectoryRef: z.ZodOptional<z.ZodString>;
|
|
52
|
+
latestTurnUsage: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
inputTokens: z.ZodNumber;
|
|
54
|
+
outputTokens: z.ZodNumber;
|
|
55
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
cacheWrite5mTokens: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
cacheWrite1hTokens: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
thoughtTokens: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
toolTokens: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
contextTokens: z.ZodNumber;
|
|
61
|
+
totalTokens: z.ZodNumber;
|
|
62
|
+
source: z.ZodEnum<{
|
|
63
|
+
assistant_message_usage: "assistant_message_usage";
|
|
64
|
+
transcript_last_token_usage: "transcript_last_token_usage";
|
|
65
|
+
call_usage: "call_usage";
|
|
66
|
+
}>;
|
|
67
|
+
}, z.core.$strict>>;
|
|
68
|
+
usageScope: z.ZodOptional<z.ZodEnum<{
|
|
69
|
+
turn: "turn";
|
|
70
|
+
session_cumulative: "session_cumulative";
|
|
71
|
+
}>>;
|
|
72
|
+
usageSupport: z.ZodOptional<z.ZodEnum<{
|
|
73
|
+
complete: "complete";
|
|
74
|
+
unsupported_token_shape: "unsupported_token_shape";
|
|
75
|
+
}>>;
|
|
76
|
+
reportedTotalTokens: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
tokenComponentEvidence: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
inputTokens: z.ZodLiteral<"observed">;
|
|
79
|
+
outputTokens: z.ZodLiteral<"observed">;
|
|
80
|
+
cacheReadTokens: z.ZodEnum<{
|
|
81
|
+
observed: "observed";
|
|
82
|
+
not_separately_reported: "not_separately_reported";
|
|
83
|
+
}>;
|
|
84
|
+
cacheWriteTokens: z.ZodEnum<{
|
|
85
|
+
observed: "observed";
|
|
86
|
+
not_separately_reported: "not_separately_reported";
|
|
87
|
+
partial: "partial";
|
|
88
|
+
}>;
|
|
89
|
+
thoughtTokens: z.ZodEnum<{
|
|
90
|
+
observed: "observed";
|
|
91
|
+
not_separately_reported: "not_separately_reported";
|
|
92
|
+
}>;
|
|
93
|
+
toolTokens: z.ZodEnum<{
|
|
94
|
+
observed: "observed";
|
|
95
|
+
not_separately_reported: "not_separately_reported";
|
|
96
|
+
}>;
|
|
97
|
+
calculatedTotalTokens: z.ZodEnum<{
|
|
98
|
+
calculated_complete: "calculated_complete";
|
|
99
|
+
calculated_partial: "calculated_partial";
|
|
100
|
+
}>;
|
|
101
|
+
reportedTotalTokens: z.ZodEnum<{
|
|
102
|
+
provider_reported: "provider_reported";
|
|
103
|
+
not_reported: "not_reported";
|
|
104
|
+
}>;
|
|
105
|
+
}, z.core.$strict>>;
|
|
106
|
+
sourceVersion: z.ZodOptional<z.ZodString>;
|
|
107
|
+
completion: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
status: z.ZodLiteral<"completed">;
|
|
109
|
+
evidence: z.ZodEnum<{
|
|
110
|
+
claude_turn_duration: "claude_turn_duration";
|
|
111
|
+
codex_task_complete: "codex_task_complete";
|
|
112
|
+
}>;
|
|
113
|
+
observedAt: z.ZodString;
|
|
114
|
+
}, z.core.$strict>>;
|
|
115
|
+
geminiTokenEvidence: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
input: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
output: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
cached: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
thoughts: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
tool: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
cacheAccounting: z.ZodEnum<{
|
|
123
|
+
unknown: "unknown";
|
|
124
|
+
included: "included";
|
|
125
|
+
none: "none";
|
|
126
|
+
}>;
|
|
127
|
+
}, z.core.$strict>>;
|
|
128
|
+
usage: z.ZodObject<{
|
|
129
|
+
inputTokens: z.ZodNumber;
|
|
130
|
+
outputTokens: z.ZodNumber;
|
|
131
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
cacheWrite5mTokens: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
cacheWrite1hTokens: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
thoughtTokens: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
toolTokens: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
}, z.core.$strict>;
|
|
137
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
138
|
+
subagentId: z.ZodOptional<z.ZodString>;
|
|
139
|
+
subagentCompletions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
140
|
+
subagentId: z.ZodString;
|
|
141
|
+
observedAt: z.ZodString;
|
|
142
|
+
}, z.core.$strict>>>;
|
|
143
|
+
rateLimits: z.ZodOptional<z.ZodObject<{
|
|
144
|
+
observedAt: z.ZodString;
|
|
145
|
+
limitId: z.ZodOptional<z.ZodString>;
|
|
146
|
+
planType: z.ZodOptional<z.ZodString>;
|
|
147
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
148
|
+
kind: z.ZodEnum<{
|
|
149
|
+
custom: "custom";
|
|
150
|
+
"five-hour": "five-hour";
|
|
151
|
+
weekly: "weekly";
|
|
152
|
+
}>;
|
|
153
|
+
name: z.ZodString;
|
|
154
|
+
usedPercent: z.ZodNumber;
|
|
155
|
+
windowMinutes: z.ZodNumber;
|
|
156
|
+
resetsAt: z.ZodString;
|
|
157
|
+
}, z.core.$strict>>;
|
|
158
|
+
}, z.core.$strict>>;
|
|
159
|
+
activity: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
summary: z.ZodString;
|
|
161
|
+
kind: z.ZodEnum<{
|
|
162
|
+
project: "project";
|
|
163
|
+
agent: "agent";
|
|
164
|
+
file: "file";
|
|
165
|
+
task: "task";
|
|
166
|
+
automation: "automation";
|
|
167
|
+
}>;
|
|
168
|
+
action: z.ZodEnum<{
|
|
169
|
+
building: "building";
|
|
170
|
+
refining: "refining";
|
|
171
|
+
fixing: "fixing";
|
|
172
|
+
testing: "testing";
|
|
173
|
+
auditing: "auditing";
|
|
174
|
+
researching: "researching";
|
|
175
|
+
configuring: "configuring";
|
|
176
|
+
publishing: "publishing";
|
|
177
|
+
running: "running";
|
|
178
|
+
working: "working";
|
|
179
|
+
}>;
|
|
180
|
+
source: z.ZodEnum<{
|
|
181
|
+
project: "project";
|
|
182
|
+
agent_title: "agent_title";
|
|
183
|
+
user_prompts: "user_prompts";
|
|
184
|
+
file_activity: "file_activity";
|
|
185
|
+
}>;
|
|
186
|
+
promptCount: z.ZodNumber;
|
|
187
|
+
toolCallCount: z.ZodNumber;
|
|
188
|
+
files: z.ZodArray<z.ZodString>;
|
|
189
|
+
isSubagent: z.ZodBoolean;
|
|
190
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strict>>;
|
|
192
|
+
}, z.core.$strict>>;
|
|
193
|
+
invocationFile: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
invocations: z.ZodArray<z.ZodObject<{
|
|
195
|
+
name: z.ZodString;
|
|
196
|
+
count: z.ZodNumber;
|
|
197
|
+
}, z.core.$strict>>;
|
|
198
|
+
invokedMcpTools: z.ZodArray<z.ZodString>;
|
|
199
|
+
invokedSkills: z.ZodArray<z.ZodString>;
|
|
200
|
+
invokedSubagents: z.ZodArray<z.ZodString>;
|
|
201
|
+
invokedCommands: z.ZodArray<z.ZodString>;
|
|
202
|
+
assistantTurns: z.ZodNumber;
|
|
203
|
+
contextSignal: z.ZodObject<{
|
|
204
|
+
agent: z.ZodEnum<{
|
|
205
|
+
"claude-code": "claude-code";
|
|
206
|
+
codex: "codex";
|
|
207
|
+
}>;
|
|
208
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
209
|
+
lastActivityAt: z.ZodOptional<z.ZodString>;
|
|
210
|
+
compactionEvents: z.ZodNumber;
|
|
211
|
+
fileReads: z.ZodArray<z.ZodObject<{
|
|
212
|
+
name: z.ZodString;
|
|
213
|
+
count: z.ZodNumber;
|
|
214
|
+
}, z.core.$strict>>;
|
|
215
|
+
repeatedFileReads: z.ZodArray<z.ZodObject<{
|
|
216
|
+
name: z.ZodString;
|
|
217
|
+
count: z.ZodNumber;
|
|
218
|
+
}, z.core.$strict>>;
|
|
219
|
+
isSubagent: z.ZodBoolean;
|
|
220
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
221
|
+
nestedSessions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
222
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
223
|
+
isSubagent: z.ZodBoolean;
|
|
224
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, z.core.$strict>>>;
|
|
226
|
+
readCoverage: z.ZodLiteral<"explicit_read_tools_only">;
|
|
227
|
+
}, z.core.$strict>;
|
|
228
|
+
}, z.core.$strict>>;
|
|
229
|
+
invocationWindowProof: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
earliestCountedAt: z.ZodOptional<z.ZodString>;
|
|
231
|
+
allCountedEventsTimestamped: z.ZodBoolean;
|
|
232
|
+
}, z.core.$strict>>;
|
|
233
|
+
diagnostics: z.ZodArray<z.ZodObject<{
|
|
234
|
+
code: z.ZodEnum<{
|
|
235
|
+
unsupported_token_shape: "unsupported_token_shape";
|
|
236
|
+
malformed_jsonl: "malformed_jsonl";
|
|
237
|
+
malformed_session_file: "malformed_session_file";
|
|
238
|
+
}>;
|
|
239
|
+
count: z.ZodNumber;
|
|
240
|
+
}, z.core.$strict>>;
|
|
241
|
+
}, z.core.$strict>;
|
|
242
|
+
export type PersistedQualitativeKey = z.infer<typeof keySchema>;
|
|
243
|
+
export type PersistedQualitativeValue = z.infer<typeof valueSchema>;
|
|
244
|
+
type PersistedKey = PersistedQualitativeKey;
|
|
245
|
+
type PersistedValue = PersistedQualitativeValue;
|
|
246
|
+
/**
|
|
247
|
+
* Strict v1 entry contracts, exported for the v2 sharded project-index store.
|
|
248
|
+
* The v2 store persists the same privacy-reduced shapes under a different
|
|
249
|
+
* layout; sharing the schemas keeps the two stores provably consistent.
|
|
250
|
+
*/
|
|
251
|
+
export declare const qualitativeEntryKeySchema: z.ZodObject<{
|
|
252
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
253
|
+
parserVersion: z.ZodLiteral<4>;
|
|
254
|
+
agent: z.ZodEnum<{
|
|
255
|
+
"claude-code": "claude-code";
|
|
256
|
+
codex: "codex";
|
|
257
|
+
"gemini-cli": "gemini-cli";
|
|
258
|
+
}>;
|
|
259
|
+
pathHash: z.ZodString;
|
|
260
|
+
fileIdentity: z.ZodString;
|
|
261
|
+
sinceIso: z.ZodNullable<z.ZodString>;
|
|
262
|
+
collectInvocationEvidence: z.ZodBoolean;
|
|
263
|
+
}, z.core.$strict>;
|
|
264
|
+
export declare const qualitativeEntryValueSchema: z.ZodObject<{
|
|
265
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
266
|
+
agent: z.ZodEnum<{
|
|
267
|
+
"claude-code": "claude-code";
|
|
268
|
+
codex: "codex";
|
|
269
|
+
"gemini-cli": "gemini-cli";
|
|
270
|
+
}>;
|
|
271
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
272
|
+
model: z.ZodString;
|
|
273
|
+
timestamp: z.ZodString;
|
|
274
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
275
|
+
project: z.ZodOptional<z.ZodString>;
|
|
276
|
+
workingDirectoryRef: z.ZodOptional<z.ZodString>;
|
|
277
|
+
latestTurnUsage: z.ZodOptional<z.ZodObject<{
|
|
278
|
+
inputTokens: z.ZodNumber;
|
|
279
|
+
outputTokens: z.ZodNumber;
|
|
280
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
cacheWrite5mTokens: z.ZodOptional<z.ZodNumber>;
|
|
282
|
+
cacheWrite1hTokens: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
thoughtTokens: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
toolTokens: z.ZodOptional<z.ZodNumber>;
|
|
285
|
+
contextTokens: z.ZodNumber;
|
|
286
|
+
totalTokens: z.ZodNumber;
|
|
287
|
+
source: z.ZodEnum<{
|
|
288
|
+
assistant_message_usage: "assistant_message_usage";
|
|
289
|
+
transcript_last_token_usage: "transcript_last_token_usage";
|
|
290
|
+
call_usage: "call_usage";
|
|
291
|
+
}>;
|
|
292
|
+
}, z.core.$strict>>;
|
|
293
|
+
usageScope: z.ZodOptional<z.ZodEnum<{
|
|
294
|
+
turn: "turn";
|
|
295
|
+
session_cumulative: "session_cumulative";
|
|
296
|
+
}>>;
|
|
297
|
+
usageSupport: z.ZodOptional<z.ZodEnum<{
|
|
298
|
+
complete: "complete";
|
|
299
|
+
unsupported_token_shape: "unsupported_token_shape";
|
|
300
|
+
}>>;
|
|
301
|
+
reportedTotalTokens: z.ZodOptional<z.ZodNumber>;
|
|
302
|
+
tokenComponentEvidence: z.ZodOptional<z.ZodObject<{
|
|
303
|
+
inputTokens: z.ZodLiteral<"observed">;
|
|
304
|
+
outputTokens: z.ZodLiteral<"observed">;
|
|
305
|
+
cacheReadTokens: z.ZodEnum<{
|
|
306
|
+
observed: "observed";
|
|
307
|
+
not_separately_reported: "not_separately_reported";
|
|
308
|
+
}>;
|
|
309
|
+
cacheWriteTokens: z.ZodEnum<{
|
|
310
|
+
observed: "observed";
|
|
311
|
+
not_separately_reported: "not_separately_reported";
|
|
312
|
+
partial: "partial";
|
|
313
|
+
}>;
|
|
314
|
+
thoughtTokens: z.ZodEnum<{
|
|
315
|
+
observed: "observed";
|
|
316
|
+
not_separately_reported: "not_separately_reported";
|
|
317
|
+
}>;
|
|
318
|
+
toolTokens: z.ZodEnum<{
|
|
319
|
+
observed: "observed";
|
|
320
|
+
not_separately_reported: "not_separately_reported";
|
|
321
|
+
}>;
|
|
322
|
+
calculatedTotalTokens: z.ZodEnum<{
|
|
323
|
+
calculated_complete: "calculated_complete";
|
|
324
|
+
calculated_partial: "calculated_partial";
|
|
325
|
+
}>;
|
|
326
|
+
reportedTotalTokens: z.ZodEnum<{
|
|
327
|
+
provider_reported: "provider_reported";
|
|
328
|
+
not_reported: "not_reported";
|
|
329
|
+
}>;
|
|
330
|
+
}, z.core.$strict>>;
|
|
331
|
+
sourceVersion: z.ZodOptional<z.ZodString>;
|
|
332
|
+
completion: z.ZodOptional<z.ZodObject<{
|
|
333
|
+
status: z.ZodLiteral<"completed">;
|
|
334
|
+
evidence: z.ZodEnum<{
|
|
335
|
+
claude_turn_duration: "claude_turn_duration";
|
|
336
|
+
codex_task_complete: "codex_task_complete";
|
|
337
|
+
}>;
|
|
338
|
+
observedAt: z.ZodString;
|
|
339
|
+
}, z.core.$strict>>;
|
|
340
|
+
geminiTokenEvidence: z.ZodOptional<z.ZodObject<{
|
|
341
|
+
input: z.ZodOptional<z.ZodNumber>;
|
|
342
|
+
output: z.ZodOptional<z.ZodNumber>;
|
|
343
|
+
cached: z.ZodOptional<z.ZodNumber>;
|
|
344
|
+
thoughts: z.ZodOptional<z.ZodNumber>;
|
|
345
|
+
tool: z.ZodOptional<z.ZodNumber>;
|
|
346
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
347
|
+
cacheAccounting: z.ZodEnum<{
|
|
348
|
+
unknown: "unknown";
|
|
349
|
+
included: "included";
|
|
350
|
+
none: "none";
|
|
351
|
+
}>;
|
|
352
|
+
}, z.core.$strict>>;
|
|
353
|
+
usage: z.ZodObject<{
|
|
354
|
+
inputTokens: z.ZodNumber;
|
|
355
|
+
outputTokens: z.ZodNumber;
|
|
356
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
357
|
+
cacheWrite5mTokens: z.ZodOptional<z.ZodNumber>;
|
|
358
|
+
cacheWrite1hTokens: z.ZodOptional<z.ZodNumber>;
|
|
359
|
+
thoughtTokens: z.ZodOptional<z.ZodNumber>;
|
|
360
|
+
toolTokens: z.ZodOptional<z.ZodNumber>;
|
|
361
|
+
}, z.core.$strict>;
|
|
362
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
363
|
+
subagentId: z.ZodOptional<z.ZodString>;
|
|
364
|
+
subagentCompletions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
365
|
+
subagentId: z.ZodString;
|
|
366
|
+
observedAt: z.ZodString;
|
|
367
|
+
}, z.core.$strict>>>;
|
|
368
|
+
rateLimits: z.ZodOptional<z.ZodObject<{
|
|
369
|
+
observedAt: z.ZodString;
|
|
370
|
+
limitId: z.ZodOptional<z.ZodString>;
|
|
371
|
+
planType: z.ZodOptional<z.ZodString>;
|
|
372
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
373
|
+
kind: z.ZodEnum<{
|
|
374
|
+
custom: "custom";
|
|
375
|
+
"five-hour": "five-hour";
|
|
376
|
+
weekly: "weekly";
|
|
377
|
+
}>;
|
|
378
|
+
name: z.ZodString;
|
|
379
|
+
usedPercent: z.ZodNumber;
|
|
380
|
+
windowMinutes: z.ZodNumber;
|
|
381
|
+
resetsAt: z.ZodString;
|
|
382
|
+
}, z.core.$strict>>;
|
|
383
|
+
}, z.core.$strict>>;
|
|
384
|
+
activity: z.ZodOptional<z.ZodObject<{
|
|
385
|
+
summary: z.ZodString;
|
|
386
|
+
kind: z.ZodEnum<{
|
|
387
|
+
project: "project";
|
|
388
|
+
agent: "agent";
|
|
389
|
+
file: "file";
|
|
390
|
+
task: "task";
|
|
391
|
+
automation: "automation";
|
|
392
|
+
}>;
|
|
393
|
+
action: z.ZodEnum<{
|
|
394
|
+
building: "building";
|
|
395
|
+
refining: "refining";
|
|
396
|
+
fixing: "fixing";
|
|
397
|
+
testing: "testing";
|
|
398
|
+
auditing: "auditing";
|
|
399
|
+
researching: "researching";
|
|
400
|
+
configuring: "configuring";
|
|
401
|
+
publishing: "publishing";
|
|
402
|
+
running: "running";
|
|
403
|
+
working: "working";
|
|
404
|
+
}>;
|
|
405
|
+
source: z.ZodEnum<{
|
|
406
|
+
project: "project";
|
|
407
|
+
agent_title: "agent_title";
|
|
408
|
+
user_prompts: "user_prompts";
|
|
409
|
+
file_activity: "file_activity";
|
|
410
|
+
}>;
|
|
411
|
+
promptCount: z.ZodNumber;
|
|
412
|
+
toolCallCount: z.ZodNumber;
|
|
413
|
+
files: z.ZodArray<z.ZodString>;
|
|
414
|
+
isSubagent: z.ZodBoolean;
|
|
415
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
416
|
+
}, z.core.$strict>>;
|
|
417
|
+
}, z.core.$strict>>;
|
|
418
|
+
invocationFile: z.ZodOptional<z.ZodObject<{
|
|
419
|
+
invocations: z.ZodArray<z.ZodObject<{
|
|
420
|
+
name: z.ZodString;
|
|
421
|
+
count: z.ZodNumber;
|
|
422
|
+
}, z.core.$strict>>;
|
|
423
|
+
invokedMcpTools: z.ZodArray<z.ZodString>;
|
|
424
|
+
invokedSkills: z.ZodArray<z.ZodString>;
|
|
425
|
+
invokedSubagents: z.ZodArray<z.ZodString>;
|
|
426
|
+
invokedCommands: z.ZodArray<z.ZodString>;
|
|
427
|
+
assistantTurns: z.ZodNumber;
|
|
428
|
+
contextSignal: z.ZodObject<{
|
|
429
|
+
agent: z.ZodEnum<{
|
|
430
|
+
"claude-code": "claude-code";
|
|
431
|
+
codex: "codex";
|
|
432
|
+
}>;
|
|
433
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
434
|
+
lastActivityAt: z.ZodOptional<z.ZodString>;
|
|
435
|
+
compactionEvents: z.ZodNumber;
|
|
436
|
+
fileReads: z.ZodArray<z.ZodObject<{
|
|
437
|
+
name: z.ZodString;
|
|
438
|
+
count: z.ZodNumber;
|
|
439
|
+
}, z.core.$strict>>;
|
|
440
|
+
repeatedFileReads: z.ZodArray<z.ZodObject<{
|
|
441
|
+
name: z.ZodString;
|
|
442
|
+
count: z.ZodNumber;
|
|
443
|
+
}, z.core.$strict>>;
|
|
444
|
+
isSubagent: z.ZodBoolean;
|
|
445
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
446
|
+
nestedSessions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
447
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
448
|
+
isSubagent: z.ZodBoolean;
|
|
449
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
450
|
+
}, z.core.$strict>>>;
|
|
451
|
+
readCoverage: z.ZodLiteral<"explicit_read_tools_only">;
|
|
452
|
+
}, z.core.$strict>;
|
|
453
|
+
}, z.core.$strict>>;
|
|
454
|
+
invocationWindowProof: z.ZodOptional<z.ZodObject<{
|
|
455
|
+
earliestCountedAt: z.ZodOptional<z.ZodString>;
|
|
456
|
+
allCountedEventsTimestamped: z.ZodBoolean;
|
|
457
|
+
}, z.core.$strict>>;
|
|
458
|
+
diagnostics: z.ZodArray<z.ZodObject<{
|
|
459
|
+
code: z.ZodEnum<{
|
|
460
|
+
unsupported_token_shape: "unsupported_token_shape";
|
|
461
|
+
malformed_jsonl: "malformed_jsonl";
|
|
462
|
+
malformed_session_file: "malformed_session_file";
|
|
463
|
+
}>;
|
|
464
|
+
count: z.ZodNumber;
|
|
465
|
+
}, z.core.$strict>>;
|
|
466
|
+
}, z.core.$strict>;
|
|
467
|
+
/** Resolve the fixed warm-index path without trusting or creating it. */
|
|
468
|
+
export declare function qualitativeIndexCachePath(options?: QualitativeIndexCacheOptions): string;
|
|
469
|
+
/**
|
|
470
|
+
* Build the adapter consumed by `loadLocalAgentUsage({ qualitativeIndex })`.
|
|
471
|
+
* Reads fail closed and writes are serialized, atomic, private, and bounded.
|
|
472
|
+
*/
|
|
473
|
+
export declare function createQualitativeIndexCacheAdapter(options?: QualitativeIndexCacheOptions): LocalAgentQualitativeIndexAdapter;
|
|
474
|
+
export declare function withWriterLock<T>(options: QualitativeIndexCacheOptions, operation: (directory: string) => Promise<T>, lockFileName?: string): Promise<T>;
|
|
475
|
+
export declare function resolveCacheDirectory(create: boolean, options: QualitativeIndexCacheOptions): Promise<string>;
|
|
476
|
+
export declare function syncDirectory(directory: string): Promise<void>;
|
|
477
|
+
export declare function stripRawPaths(value: Readonly<LocalAgentQualitativeIndexValue>): unknown;
|
|
478
|
+
export declare function qualitativeKeyFingerprint(key: PersistedQualitativeKey): string;
|
|
479
|
+
export declare function sameQualitativeFileKey(left: PersistedKey, right: PersistedKey): boolean;
|
|
480
|
+
/** Whether the cached parser window is an exact superset of the request. */
|
|
481
|
+
export declare function cachedWindowCoversRequest(cachedSinceIso: string | null, requestedSinceIso: string | null): boolean;
|
|
482
|
+
/**
|
|
483
|
+
* Calls remain exact after the loader's timestamp filter. Aggregated Codex
|
|
484
|
+
* invocation evidence cannot generally be subtracted at a later cutoff, so a
|
|
485
|
+
* cross-window hit is allowed only when the root session started inside the
|
|
486
|
+
* requested window (all counted root events are therefore in-window), or the
|
|
487
|
+
* wider cached window observed no countable invocation evidence at all.
|
|
488
|
+
*/
|
|
489
|
+
export declare function invocationWindowCanBeNarrowedExactly(cachedKey: PersistedKey, value: PersistedValue, requestedKey: PersistedKey): boolean;
|
|
490
|
+
export declare function noFollowFlag(): number;
|
|
491
|
+
export declare function hasPrivatePermissions(mode: number): boolean;
|
|
492
|
+
export declare function isNodeError(error: unknown, code: string): error is NodeJS.ErrnoException;
|
|
493
|
+
export {};
|
|
494
|
+
//# sourceMappingURL=qualitativeIndexCache.d.ts.map
|