@agent-finops/core 0.9.5 → 0.9.6

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.
@@ -7,7 +7,7 @@ export declare const projectIndexStoreLockFileName = ".project-index-v2.lock";
7
7
  export declare const projectIndexMaxDocumentBytes: number;
8
8
  /** Null-window variant plus the newest bounded windows (BLOCKER-2 option i). */
9
9
  export declare const projectIndexMaxWindowedVariants = 4;
10
- export declare const projectIndexFinancialParserVersion = 1;
10
+ export declare const projectIndexFinancialParserVersion = 3;
11
11
  declare const financialKeySchema: z.ZodObject<{
12
12
  schemaVersion: z.ZodLiteral<2>;
13
13
  section: z.ZodLiteral<"financial">;
@@ -18,7 +18,7 @@ declare const financialKeySchema: z.ZodObject<{
18
18
  }>;
19
19
  pathHash: z.ZodString;
20
20
  fileIdentity: z.ZodString;
21
- financialParserVersion: z.ZodLiteral<1>;
21
+ financialParserVersion: z.ZodLiteral<3>;
22
22
  }, z.core.$strict>;
23
23
  /**
24
24
  * Header-pass ownership evidence (A4a consumer). "unknown" is a first-class
@@ -53,7 +53,7 @@ declare const documentSchema: z.ZodObject<{
53
53
  qualitative: z.ZodArray<z.ZodObject<{
54
54
  key: z.ZodObject<{
55
55
  schemaVersion: z.ZodLiteral<1>;
56
- parserVersion: z.ZodLiteral<4>;
56
+ parserVersion: z.ZodLiteral<6>;
57
57
  agent: z.ZodEnum<{
58
58
  "claude-code": "claude-code";
59
59
  codex: "codex";
@@ -102,6 +102,7 @@ declare const documentSchema: z.ZodObject<{
102
102
  complete: "complete";
103
103
  unsupported_token_shape: "unsupported_token_shape";
104
104
  }>>;
105
+ maxRequestPromptTokens: z.ZodOptional<z.ZodNumber>;
105
106
  reportedTotalTokens: z.ZodOptional<z.ZodNumber>;
106
107
  tokenComponentEvidence: z.ZodOptional<z.ZodObject<{
107
108
  inputTokens: z.ZodLiteral<"observed">;
@@ -111,9 +112,9 @@ declare const documentSchema: z.ZodObject<{
111
112
  not_separately_reported: "not_separately_reported";
112
113
  }>;
113
114
  cacheWriteTokens: z.ZodEnum<{
115
+ partial: "partial";
114
116
  observed: "observed";
115
117
  not_separately_reported: "not_separately_reported";
116
- partial: "partial";
117
118
  }>;
118
119
  thoughtTokens: z.ZodEnum<{
119
120
  observed: "observed";
@@ -128,8 +129,8 @@ declare const documentSchema: z.ZodObject<{
128
129
  calculated_partial: "calculated_partial";
129
130
  }>;
130
131
  reportedTotalTokens: z.ZodEnum<{
131
- provider_reported: "provider_reported";
132
132
  not_reported: "not_reported";
133
+ provider_reported: "provider_reported";
133
134
  }>;
134
135
  }, z.core.$strict>>;
135
136
  sourceVersion: z.ZodOptional<z.ZodString>;
@@ -188,9 +189,9 @@ declare const documentSchema: z.ZodObject<{
188
189
  activity: z.ZodOptional<z.ZodObject<{
189
190
  summary: z.ZodString;
190
191
  kind: z.ZodEnum<{
191
- project: "project";
192
- agent: "agent";
193
192
  file: "file";
193
+ agent: "agent";
194
+ project: "project";
194
195
  task: "task";
195
196
  automation: "automation";
196
197
  }>;
@@ -280,7 +281,7 @@ declare const documentSchema: z.ZodObject<{
280
281
  }>;
281
282
  pathHash: z.ZodString;
282
283
  fileIdentity: z.ZodString;
283
- financialParserVersion: z.ZodLiteral<1>;
284
+ financialParserVersion: z.ZodLiteral<3>;
284
285
  }, z.core.$strict>;
285
286
  storedAt: z.ZodString;
286
287
  value: z.ZodObject<{
@@ -320,6 +321,7 @@ declare const documentSchema: z.ZodObject<{
320
321
  complete: "complete";
321
322
  unsupported_token_shape: "unsupported_token_shape";
322
323
  }>>;
324
+ maxRequestPromptTokens: z.ZodOptional<z.ZodNumber>;
323
325
  reportedTotalTokens: z.ZodOptional<z.ZodNumber>;
324
326
  tokenComponentEvidence: z.ZodOptional<z.ZodObject<{
325
327
  inputTokens: z.ZodLiteral<"observed">;
@@ -329,9 +331,9 @@ declare const documentSchema: z.ZodObject<{
329
331
  not_separately_reported: "not_separately_reported";
330
332
  }>;
331
333
  cacheWriteTokens: z.ZodEnum<{
334
+ partial: "partial";
332
335
  observed: "observed";
333
336
  not_separately_reported: "not_separately_reported";
334
- partial: "partial";
335
337
  }>;
336
338
  thoughtTokens: z.ZodEnum<{
337
339
  observed: "observed";
@@ -346,8 +348,8 @@ declare const documentSchema: z.ZodObject<{
346
348
  calculated_partial: "calculated_partial";
347
349
  }>;
348
350
  reportedTotalTokens: z.ZodEnum<{
349
- provider_reported: "provider_reported";
350
351
  not_reported: "not_reported";
352
+ provider_reported: "provider_reported";
351
353
  }>;
352
354
  }, z.core.$strict>>;
353
355
  sourceVersion: z.ZodOptional<z.ZodString>;
@@ -406,9 +408,9 @@ declare const documentSchema: z.ZodObject<{
406
408
  activity: z.ZodOptional<z.ZodObject<{
407
409
  summary: z.ZodString;
408
410
  kind: z.ZodEnum<{
409
- project: "project";
410
- agent: "agent";
411
411
  file: "file";
412
+ agent: "agent";
413
+ project: "project";
412
414
  task: "task";
413
415
  automation: "automation";
414
416
  }>;
@@ -25,7 +25,7 @@ export declare class QualitativeIndexCacheError extends Error {
25
25
  }
26
26
  declare const keySchema: z.ZodObject<{
27
27
  schemaVersion: z.ZodLiteral<1>;
28
- parserVersion: z.ZodLiteral<4>;
28
+ parserVersion: z.ZodLiteral<6>;
29
29
  agent: z.ZodEnum<{
30
30
  "claude-code": "claude-code";
31
31
  codex: "codex";
@@ -73,6 +73,7 @@ declare const valueSchema: z.ZodObject<{
73
73
  complete: "complete";
74
74
  unsupported_token_shape: "unsupported_token_shape";
75
75
  }>>;
76
+ maxRequestPromptTokens: z.ZodOptional<z.ZodNumber>;
76
77
  reportedTotalTokens: z.ZodOptional<z.ZodNumber>;
77
78
  tokenComponentEvidence: z.ZodOptional<z.ZodObject<{
78
79
  inputTokens: z.ZodLiteral<"observed">;
@@ -82,9 +83,9 @@ declare const valueSchema: z.ZodObject<{
82
83
  not_separately_reported: "not_separately_reported";
83
84
  }>;
84
85
  cacheWriteTokens: z.ZodEnum<{
86
+ partial: "partial";
85
87
  observed: "observed";
86
88
  not_separately_reported: "not_separately_reported";
87
- partial: "partial";
88
89
  }>;
89
90
  thoughtTokens: z.ZodEnum<{
90
91
  observed: "observed";
@@ -99,8 +100,8 @@ declare const valueSchema: z.ZodObject<{
99
100
  calculated_partial: "calculated_partial";
100
101
  }>;
101
102
  reportedTotalTokens: z.ZodEnum<{
102
- provider_reported: "provider_reported";
103
103
  not_reported: "not_reported";
104
+ provider_reported: "provider_reported";
104
105
  }>;
105
106
  }, z.core.$strict>>;
106
107
  sourceVersion: z.ZodOptional<z.ZodString>;
@@ -159,9 +160,9 @@ declare const valueSchema: z.ZodObject<{
159
160
  activity: z.ZodOptional<z.ZodObject<{
160
161
  summary: z.ZodString;
161
162
  kind: z.ZodEnum<{
162
- project: "project";
163
- agent: "agent";
164
163
  file: "file";
164
+ agent: "agent";
165
+ project: "project";
165
166
  task: "task";
166
167
  automation: "automation";
167
168
  }>;
@@ -250,7 +251,7 @@ type PersistedValue = PersistedQualitativeValue;
250
251
  */
251
252
  export declare const qualitativeEntryKeySchema: z.ZodObject<{
252
253
  schemaVersion: z.ZodLiteral<1>;
253
- parserVersion: z.ZodLiteral<4>;
254
+ parserVersion: z.ZodLiteral<6>;
254
255
  agent: z.ZodEnum<{
255
256
  "claude-code": "claude-code";
256
257
  codex: "codex";
@@ -298,6 +299,7 @@ export declare const qualitativeEntryValueSchema: z.ZodObject<{
298
299
  complete: "complete";
299
300
  unsupported_token_shape: "unsupported_token_shape";
300
301
  }>>;
302
+ maxRequestPromptTokens: z.ZodOptional<z.ZodNumber>;
301
303
  reportedTotalTokens: z.ZodOptional<z.ZodNumber>;
302
304
  tokenComponentEvidence: z.ZodOptional<z.ZodObject<{
303
305
  inputTokens: z.ZodLiteral<"observed">;
@@ -307,9 +309,9 @@ export declare const qualitativeEntryValueSchema: z.ZodObject<{
307
309
  not_separately_reported: "not_separately_reported";
308
310
  }>;
309
311
  cacheWriteTokens: z.ZodEnum<{
312
+ partial: "partial";
310
313
  observed: "observed";
311
314
  not_separately_reported: "not_separately_reported";
312
- partial: "partial";
313
315
  }>;
314
316
  thoughtTokens: z.ZodEnum<{
315
317
  observed: "observed";
@@ -324,8 +326,8 @@ export declare const qualitativeEntryValueSchema: z.ZodObject<{
324
326
  calculated_partial: "calculated_partial";
325
327
  }>;
326
328
  reportedTotalTokens: z.ZodEnum<{
327
- provider_reported: "provider_reported";
328
329
  not_reported: "not_reported";
330
+ provider_reported: "provider_reported";
329
331
  }>;
330
332
  }, z.core.$strict>>;
331
333
  sourceVersion: z.ZodOptional<z.ZodString>;
@@ -384,9 +386,9 @@ export declare const qualitativeEntryValueSchema: z.ZodObject<{
384
386
  activity: z.ZodOptional<z.ZodObject<{
385
387
  summary: z.ZodString;
386
388
  kind: z.ZodEnum<{
387
- project: "project";
388
- agent: "agent";
389
389
  file: "file";
390
+ agent: "agent";
391
+ project: "project";
390
392
  task: "task";
391
393
  automation: "automation";
392
394
  }>;
@@ -129,6 +129,11 @@ const callSchema = z.object({
129
129
  latestTurnUsage: turnUsageSchema.optional(),
130
130
  usageScope: z.enum(["turn", "session_cumulative"]).optional(),
131
131
  usageSupport: z.enum(["complete", "unsupported_token_shape"]).optional(),
132
+ // Per-request tier evidence for session-cumulative slices. The strict schema
133
+ // must carry it: without this key the entry fails validation on write, the
134
+ // failure is swallowed by the caller, and every run re-parses the whole
135
+ // corpus instead of reusing the cache.
136
+ maxRequestPromptTokens: finiteNonnegativeInteger.optional(),
132
137
  reportedTotalTokens: finiteNonnegativeInteger.optional(),
133
138
  tokenComponentEvidence: tokenComponentEvidenceSchema.optional(),
134
139
  sourceVersion: z.string().min(1).max(64).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-finops/core",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
4
4
  "funding": "https://asktilden.com",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",