@warmio/contracts 3.0.3 → 3.0.5

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.
Files changed (47) hide show
  1. package/dist/api/endpoints.d.ts +4 -2
  2. package/dist/api/endpoints.d.ts.map +1 -1
  3. package/dist/api/endpoints.js +7 -2
  4. package/dist/api/endpoints.js.map +1 -1
  5. package/dist/financial-context-artifact-protocol.d.ts +1509 -0
  6. package/dist/financial-context-artifact-protocol.d.ts.map +1 -0
  7. package/dist/financial-context-artifact-protocol.js +290 -0
  8. package/dist/financial-context-artifact-protocol.js.map +1 -0
  9. package/dist/generated/mcp-package-release-metadata.d.ts +1 -1
  10. package/dist/generated/mcp-package-release-metadata.js +1 -1
  11. package/dist/generated/private-mcp-tool-descriptors.d.ts +4 -1
  12. package/dist/generated/private-mcp-tool-descriptors.d.ts.map +1 -1
  13. package/dist/generated/private-mcp-tool-descriptors.js +5 -1
  14. package/dist/generated/private-mcp-tool-descriptors.js.map +1 -1
  15. package/dist/generated/protected-crawler-paths.d.ts +1 -1
  16. package/dist/generated/protected-crawler-paths.d.ts.map +1 -1
  17. package/dist/generated/protected-crawler-paths.js +1 -0
  18. package/dist/generated/protected-crawler-paths.js.map +1 -1
  19. package/dist/generated/warm-app-api-manifest.d.ts +9 -6
  20. package/dist/generated/warm-app-api-manifest.d.ts.map +1 -1
  21. package/dist/generated/warm-app-api-manifest.js +10 -6
  22. package/dist/generated/warm-app-api-manifest.js.map +1 -1
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +1 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/mcp/index.d.ts +2 -0
  28. package/dist/mcp/index.d.ts.map +1 -1
  29. package/dist/mcp/index.js +2 -0
  30. package/dist/mcp/index.js.map +1 -1
  31. package/dist/mcp/public-output.d.ts +705 -0
  32. package/dist/mcp/public-output.d.ts.map +1 -0
  33. package/dist/mcp/public-output.js +47 -0
  34. package/dist/mcp/public-output.js.map +1 -0
  35. package/dist/mcp/public-tools.d.ts +690 -0
  36. package/dist/mcp/public-tools.d.ts.map +1 -0
  37. package/dist/mcp/public-tools.js +44 -0
  38. package/dist/mcp/public-tools.js.map +1 -0
  39. package/dist/mcp/tools.d.ts +12 -7
  40. package/dist/mcp/tools.d.ts.map +1 -1
  41. package/dist/schemas/financial-context.d.ts +25 -16
  42. package/dist/schemas/financial-context.d.ts.map +1 -1
  43. package/dist/schemas/financial-context.js +9 -2
  44. package/dist/schemas/financial-context.js.map +1 -1
  45. package/dist/types.d.ts +2 -4
  46. package/dist/types.d.ts.map +1 -1
  47. package/package.json +4 -4
@@ -0,0 +1,1509 @@
1
+ import { z } from 'zod';
2
+ import { financialContextSchema, transactionMonthSchema } from './schemas/financial-context.js';
3
+ export declare const FINANCIAL_CONTEXT_PROTOCOL_VERSION: 2;
4
+ export declare const financialContextAccessEpochSchema: z.ZodObject<{
5
+ user_revision: z.ZodString;
6
+ household: z.ZodNullable<z.ZodObject<{
7
+ id: z.ZodEffects<z.ZodString, string, string>;
8
+ revision: z.ZodString;
9
+ }, "strict", z.ZodTypeAny, {
10
+ id: string;
11
+ revision: string;
12
+ }, {
13
+ id: string;
14
+ revision: string;
15
+ }>>;
16
+ }, "strict", z.ZodTypeAny, {
17
+ user_revision: string;
18
+ household: {
19
+ id: string;
20
+ revision: string;
21
+ } | null;
22
+ }, {
23
+ user_revision: string;
24
+ household: {
25
+ id: string;
26
+ revision: string;
27
+ } | null;
28
+ }>;
29
+ export type FinancialContextAccessEpoch = z.infer<typeof financialContextAccessEpochSchema>;
30
+ export type FinancialContextAccessEpochComparison = -1 | 0 | 1 | 'incomparable';
31
+ export declare const financialContextAdmissionSchema: z.ZodObject<{
32
+ protocol_version: z.ZodLiteral<2>;
33
+ user_id: z.ZodString;
34
+ access_epoch: z.ZodObject<{
35
+ user_revision: z.ZodString;
36
+ household: z.ZodNullable<z.ZodObject<{
37
+ id: z.ZodEffects<z.ZodString, string, string>;
38
+ revision: z.ZodString;
39
+ }, "strict", z.ZodTypeAny, {
40
+ id: string;
41
+ revision: string;
42
+ }, {
43
+ id: string;
44
+ revision: string;
45
+ }>>;
46
+ }, "strict", z.ZodTypeAny, {
47
+ user_revision: string;
48
+ household: {
49
+ id: string;
50
+ revision: string;
51
+ } | null;
52
+ }, {
53
+ user_revision: string;
54
+ household: {
55
+ id: string;
56
+ revision: string;
57
+ } | null;
58
+ }>;
59
+ }, "strict", z.ZodTypeAny, {
60
+ protocol_version: 2;
61
+ user_id: string;
62
+ access_epoch: {
63
+ user_revision: string;
64
+ household: {
65
+ id: string;
66
+ revision: string;
67
+ } | null;
68
+ };
69
+ }, {
70
+ protocol_version: 2;
71
+ user_id: string;
72
+ access_epoch: {
73
+ user_revision: string;
74
+ household: {
75
+ id: string;
76
+ revision: string;
77
+ } | null;
78
+ };
79
+ }>;
80
+ export type FinancialContextAdmission = z.infer<typeof financialContextAdmissionSchema>;
81
+ type FinancialContextArtifactHashContent = {
82
+ user_id: string;
83
+ access_epoch: FinancialContextAccessEpoch;
84
+ context: z.infer<typeof financialContextSchema>;
85
+ months: Array<z.infer<typeof transactionMonthSchema>>;
86
+ };
87
+ export declare const financialContextArtifactEnvelopeSchema: z.ZodEffects<z.ZodObject<{
88
+ protocol_version: z.ZodLiteral<2>;
89
+ user_id: z.ZodString;
90
+ access_epoch: z.ZodObject<{
91
+ user_revision: z.ZodString;
92
+ household: z.ZodNullable<z.ZodObject<{
93
+ id: z.ZodEffects<z.ZodString, string, string>;
94
+ revision: z.ZodString;
95
+ }, "strict", z.ZodTypeAny, {
96
+ id: string;
97
+ revision: string;
98
+ }, {
99
+ id: string;
100
+ revision: string;
101
+ }>>;
102
+ }, "strict", z.ZodTypeAny, {
103
+ user_revision: string;
104
+ household: {
105
+ id: string;
106
+ revision: string;
107
+ } | null;
108
+ }, {
109
+ user_revision: string;
110
+ household: {
111
+ id: string;
112
+ revision: string;
113
+ } | null;
114
+ }>;
115
+ context: z.ZodObject<{
116
+ version: z.ZodEnum<["v1"]>;
117
+ updated_at: z.ZodString;
118
+ currency: z.ZodEnum<["USD"]>;
119
+ status: z.ZodObject<{
120
+ position: z.ZodNullable<z.ZodObject<{
121
+ date: z.ZodNullable<z.ZodString>;
122
+ net_worth: z.ZodNullable<z.ZodNumber>;
123
+ cash: z.ZodNullable<z.ZodNumber>;
124
+ debt: z.ZodNullable<z.ZodNumber>;
125
+ investments: z.ZodNullable<z.ZodNumber>;
126
+ other_assets: z.ZodNullable<z.ZodNumber>;
127
+ total_assets: z.ZodNullable<z.ZodNumber>;
128
+ }, "strict", z.ZodTypeAny, {
129
+ date: string | null;
130
+ net_worth: number | null;
131
+ cash: number | null;
132
+ debt: number | null;
133
+ investments: number | null;
134
+ other_assets: number | null;
135
+ total_assets: number | null;
136
+ }, {
137
+ date: string | null;
138
+ net_worth: number | null;
139
+ cash: number | null;
140
+ debt: number | null;
141
+ investments: number | null;
142
+ other_assets: number | null;
143
+ total_assets: number | null;
144
+ }>>;
145
+ accounts: z.ZodArray<z.ZodObject<{
146
+ id: z.ZodString;
147
+ name: z.ZodString;
148
+ source: z.ZodNullable<z.ZodEnum<["plaid", "manual", "csv_import"]>>;
149
+ type: z.ZodEnum<["depository", "credit", "loan", "investment", "brokerage", "other"]>;
150
+ subtype: z.ZodNullable<z.ZodString>;
151
+ group: z.ZodNullable<z.ZodEnum<["cash", "debt", "investments", "other"]>>;
152
+ institution: z.ZodNullable<z.ZodString>;
153
+ mask: z.ZodNullable<z.ZodString>;
154
+ balance: z.ZodNullable<z.ZodNumber>;
155
+ available: z.ZodNullable<z.ZodNumber>;
156
+ currency: z.ZodNullable<z.ZodString>;
157
+ updated_at: z.ZodNullable<z.ZodString>;
158
+ }, "strict", z.ZodTypeAny, {
159
+ id: string;
160
+ name: string;
161
+ source: "csv_import" | "manual" | "plaid" | null;
162
+ type: "brokerage" | "credit" | "depository" | "investment" | "loan" | "other";
163
+ subtype: string | null;
164
+ group: "cash" | "debt" | "investments" | "other" | null;
165
+ institution: string | null;
166
+ mask: string | null;
167
+ balance: number | null;
168
+ available: number | null;
169
+ currency: string | null;
170
+ updated_at: string | null;
171
+ }, {
172
+ id: string;
173
+ name: string;
174
+ source: "csv_import" | "manual" | "plaid" | null;
175
+ type: "brokerage" | "credit" | "depository" | "investment" | "loan" | "other";
176
+ subtype: string | null;
177
+ group: "cash" | "debt" | "investments" | "other" | null;
178
+ institution: string | null;
179
+ mask: string | null;
180
+ balance: number | null;
181
+ available: number | null;
182
+ currency: string | null;
183
+ updated_at: string | null;
184
+ }>, "many">;
185
+ }, "strict", z.ZodTypeAny, {
186
+ position: {
187
+ date: string | null;
188
+ net_worth: number | null;
189
+ cash: number | null;
190
+ debt: number | null;
191
+ investments: number | null;
192
+ other_assets: number | null;
193
+ total_assets: number | null;
194
+ } | null;
195
+ accounts: {
196
+ id: string;
197
+ name: string;
198
+ source: "csv_import" | "manual" | "plaid" | null;
199
+ type: "brokerage" | "credit" | "depository" | "investment" | "loan" | "other";
200
+ subtype: string | null;
201
+ group: "cash" | "debt" | "investments" | "other" | null;
202
+ institution: string | null;
203
+ mask: string | null;
204
+ balance: number | null;
205
+ available: number | null;
206
+ currency: string | null;
207
+ updated_at: string | null;
208
+ }[];
209
+ }, {
210
+ position: {
211
+ date: string | null;
212
+ net_worth: number | null;
213
+ cash: number | null;
214
+ debt: number | null;
215
+ investments: number | null;
216
+ other_assets: number | null;
217
+ total_assets: number | null;
218
+ } | null;
219
+ accounts: {
220
+ id: string;
221
+ name: string;
222
+ source: "csv_import" | "manual" | "plaid" | null;
223
+ type: "brokerage" | "credit" | "depository" | "investment" | "loan" | "other";
224
+ subtype: string | null;
225
+ group: "cash" | "debt" | "investments" | "other" | null;
226
+ institution: string | null;
227
+ mask: string | null;
228
+ balance: number | null;
229
+ available: number | null;
230
+ currency: string | null;
231
+ updated_at: string | null;
232
+ }[];
233
+ }>;
234
+ transactions: z.ZodObject<{
235
+ total: z.ZodNumber;
236
+ months: z.ZodArray<z.ZodObject<{
237
+ month: z.ZodString;
238
+ count: z.ZodNumber;
239
+ }, "strict", z.ZodTypeAny, {
240
+ month: string;
241
+ count: number;
242
+ }, {
243
+ month: string;
244
+ count: number;
245
+ }>, "many">;
246
+ }, "strict", z.ZodTypeAny, {
247
+ total: number;
248
+ months: {
249
+ month: string;
250
+ count: number;
251
+ }[];
252
+ }, {
253
+ total: number;
254
+ months: {
255
+ month: string;
256
+ count: number;
257
+ }[];
258
+ }>;
259
+ recurring: z.ZodArray<z.ZodObject<{
260
+ id: z.ZodString;
261
+ account_id: z.ZodNullable<z.ZodString>;
262
+ direction: z.ZodNullable<z.ZodEnum<["inflow", "outflow"]>>;
263
+ frequency: z.ZodNullable<z.ZodEnum<["WEEKLY", "BIWEEKLY", "MONTHLY", "QUARTERLY", "SEMI_ANNUALLY", "ANNUALLY"]>>;
264
+ status: z.ZodNullable<z.ZodEnum<["active", "inactive", "dismissed"]>>;
265
+ merchant: z.ZodNullable<z.ZodString>;
266
+ amount: z.ZodNullable<z.ZodNumber>;
267
+ next_date: z.ZodNullable<z.ZodString>;
268
+ excluded_from_subscriptions: z.ZodOptional<z.ZodBoolean>;
269
+ }, "strict", z.ZodTypeAny, {
270
+ id: string;
271
+ account_id: string | null;
272
+ direction: "inflow" | "outflow" | null;
273
+ frequency: "ANNUALLY" | "BIWEEKLY" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUALLY" | "WEEKLY" | null;
274
+ status: "active" | "dismissed" | "inactive" | null;
275
+ merchant: string | null;
276
+ amount: number | null;
277
+ next_date: string | null;
278
+ excluded_from_subscriptions?: boolean | undefined;
279
+ }, {
280
+ id: string;
281
+ account_id: string | null;
282
+ direction: "inflow" | "outflow" | null;
283
+ frequency: "ANNUALLY" | "BIWEEKLY" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUALLY" | "WEEKLY" | null;
284
+ status: "active" | "dismissed" | "inactive" | null;
285
+ merchant: string | null;
286
+ amount: number | null;
287
+ next_date: string | null;
288
+ excluded_from_subscriptions?: boolean | undefined;
289
+ }>, "many">;
290
+ budgets: z.ZodArray<z.ZodObject<{
291
+ id: z.ZodString;
292
+ name: z.ZodString;
293
+ type: z.ZodEnum<["category", "merchant"]>;
294
+ period: z.ZodEnum<["weekly", "biweekly", "monthly"]>;
295
+ status: z.ZodEnum<["under", "warning", "over"]>;
296
+ amount: z.ZodNumber;
297
+ spent: z.ZodNumber;
298
+ remaining: z.ZodNumber;
299
+ used_percent: z.ZodNumber;
300
+ }, "strict", z.ZodTypeAny, {
301
+ id: string;
302
+ name: string;
303
+ type: "category" | "merchant";
304
+ period: "biweekly" | "monthly" | "weekly";
305
+ status: "over" | "under" | "warning";
306
+ amount: number;
307
+ spent: number;
308
+ remaining: number;
309
+ used_percent: number;
310
+ }, {
311
+ id: string;
312
+ name: string;
313
+ type: "category" | "merchant";
314
+ period: "biweekly" | "monthly" | "weekly";
315
+ status: "over" | "under" | "warning";
316
+ amount: number;
317
+ spent: number;
318
+ remaining: number;
319
+ used_percent: number;
320
+ }>, "many">;
321
+ goals: z.ZodArray<z.ZodObject<{
322
+ id: z.ZodString;
323
+ name: z.ZodString;
324
+ category: z.ZodString;
325
+ status: z.ZodEnum<["not_started", "in_progress", "on_track", "behind", "completed"]>;
326
+ target: z.ZodNumber;
327
+ current: z.ZodNumber;
328
+ progress_percent: z.ZodNumber;
329
+ target_date: z.ZodNullable<z.ZodString>;
330
+ }, "strict", z.ZodTypeAny, {
331
+ id: string;
332
+ name: string;
333
+ category: string;
334
+ status: "behind" | "completed" | "in_progress" | "not_started" | "on_track";
335
+ target: number;
336
+ current: number;
337
+ progress_percent: number;
338
+ target_date: string | null;
339
+ }, {
340
+ id: string;
341
+ name: string;
342
+ category: string;
343
+ status: "behind" | "completed" | "in_progress" | "not_started" | "on_track";
344
+ target: number;
345
+ current: number;
346
+ progress_percent: number;
347
+ target_date: string | null;
348
+ }>, "many">;
349
+ snapshots: z.ZodArray<z.ZodObject<{
350
+ date: z.ZodString;
351
+ net_worth: z.ZodNullable<z.ZodNumber>;
352
+ cash: z.ZodNullable<z.ZodNumber>;
353
+ debt: z.ZodNullable<z.ZodNumber>;
354
+ income: z.ZodNullable<z.ZodNumber>;
355
+ expenses: z.ZodNullable<z.ZodNumber>;
356
+ cash_flow: z.ZodNullable<z.ZodNumber>;
357
+ savings_rate: z.ZodNullable<z.ZodNumber>;
358
+ investments: z.ZodNullable<z.ZodNumber>;
359
+ assets: z.ZodNullable<z.ZodNumber>;
360
+ health_score: z.ZodNullable<z.ZodNumber>;
361
+ health_score_model_version: z.ZodNullable<z.ZodLiteral<3>>;
362
+ }, "strict", z.ZodTypeAny, {
363
+ date: string;
364
+ net_worth: number | null;
365
+ cash: number | null;
366
+ debt: number | null;
367
+ income: number | null;
368
+ expenses: number | null;
369
+ cash_flow: number | null;
370
+ savings_rate: number | null;
371
+ investments: number | null;
372
+ assets: number | null;
373
+ health_score: number | null;
374
+ health_score_model_version: 3 | null;
375
+ }, {
376
+ date: string;
377
+ net_worth: number | null;
378
+ cash: number | null;
379
+ debt: number | null;
380
+ income: number | null;
381
+ expenses: number | null;
382
+ cash_flow: number | null;
383
+ savings_rate: number | null;
384
+ investments: number | null;
385
+ assets: number | null;
386
+ health_score: number | null;
387
+ health_score_model_version: 3 | null;
388
+ }>, "many">;
389
+ liabilities: z.ZodArray<z.ZodObject<{
390
+ account_id: z.ZodNullable<z.ZodString>;
391
+ type: z.ZodNullable<z.ZodEnum<["credit", "student", "mortgage", "other"]>>;
392
+ balance: z.ZodNullable<z.ZodNumber>;
393
+ minimum_payment: z.ZodNullable<z.ZodNumber>;
394
+ due_date: z.ZodNullable<z.ZodString>;
395
+ interest_rate: z.ZodNullable<z.ZodNumber>;
396
+ rate_type: z.ZodNullable<z.ZodEnum<["fixed", "variable"]>>;
397
+ overdue: z.ZodNullable<z.ZodBoolean>;
398
+ }, "strict", z.ZodTypeAny, {
399
+ account_id: string | null;
400
+ type: "credit" | "mortgage" | "other" | "student" | null;
401
+ balance: number | null;
402
+ minimum_payment: number | null;
403
+ due_date: string | null;
404
+ interest_rate: number | null;
405
+ rate_type: "fixed" | "variable" | null;
406
+ overdue: boolean | null;
407
+ }, {
408
+ account_id: string | null;
409
+ type: "credit" | "mortgage" | "other" | "student" | null;
410
+ balance: number | null;
411
+ minimum_payment: number | null;
412
+ due_date: string | null;
413
+ interest_rate: number | null;
414
+ rate_type: "fixed" | "variable" | null;
415
+ overdue: boolean | null;
416
+ }>, "many">;
417
+ holdings: z.ZodArray<z.ZodObject<{
418
+ account_id: z.ZodNullable<z.ZodString>;
419
+ symbol: z.ZodNullable<z.ZodString>;
420
+ name: z.ZodNullable<z.ZodString>;
421
+ type: z.ZodNullable<z.ZodEnum<["cash", "derivative", "equity", "etf", "fixed_income", "mutual_fund", "other"]>>;
422
+ quantity: z.ZodNullable<z.ZodNumber>;
423
+ value: z.ZodNullable<z.ZodNumber>;
424
+ cost_basis: z.ZodNullable<z.ZodNumber>;
425
+ }, "strict", z.ZodTypeAny, {
426
+ account_id: string | null;
427
+ symbol: string | null;
428
+ name: string | null;
429
+ type: "cash" | "derivative" | "equity" | "etf" | "fixed_income" | "mutual_fund" | "other" | null;
430
+ quantity: number | null;
431
+ value: number | null;
432
+ cost_basis: number | null;
433
+ }, {
434
+ account_id: string | null;
435
+ symbol: string | null;
436
+ name: string | null;
437
+ type: "cash" | "derivative" | "equity" | "etf" | "fixed_income" | "mutual_fund" | "other" | null;
438
+ quantity: number | null;
439
+ value: number | null;
440
+ cost_basis: number | null;
441
+ }>, "many">;
442
+ health: z.ZodNullable<z.ZodObject<{
443
+ score: z.ZodNumber;
444
+ model_version: z.ZodLiteral<3>;
445
+ record_count: z.ZodNumber;
446
+ label: z.ZodEnum<["Needs Attention", "Good", "Strong"]>;
447
+ level: z.ZodEnum<["strong", "good", "fair", "poor", "critical"]>;
448
+ summary: z.ZodString;
449
+ data_completeness: z.ZodNumber;
450
+ pillars: z.ZodNullable<z.ZodObject<{
451
+ spend: z.ZodNullable<z.ZodNumber>;
452
+ save: z.ZodNullable<z.ZodNumber>;
453
+ borrow: z.ZodNullable<z.ZodNumber>;
454
+ build: z.ZodNullable<z.ZodNumber>;
455
+ }, "strict", z.ZodTypeAny, {
456
+ spend: number | null;
457
+ save: number | null;
458
+ borrow: number | null;
459
+ build: number | null;
460
+ }, {
461
+ spend: number | null;
462
+ save: number | null;
463
+ borrow: number | null;
464
+ build: number | null;
465
+ }>>;
466
+ }, "strict", z.ZodTypeAny, {
467
+ score: number;
468
+ model_version: 3;
469
+ record_count: number;
470
+ label: "Good" | "Needs Attention" | "Strong";
471
+ level: "critical" | "fair" | "good" | "poor" | "strong";
472
+ summary: string;
473
+ data_completeness: number;
474
+ pillars: {
475
+ spend: number | null;
476
+ save: number | null;
477
+ borrow: number | null;
478
+ build: number | null;
479
+ } | null;
480
+ }, {
481
+ score: number;
482
+ model_version: 3;
483
+ record_count: number;
484
+ label: "Good" | "Needs Attention" | "Strong";
485
+ level: "critical" | "fair" | "good" | "poor" | "strong";
486
+ summary: string;
487
+ data_completeness: number;
488
+ pillars: {
489
+ spend: number | null;
490
+ save: number | null;
491
+ borrow: number | null;
492
+ build: number | null;
493
+ } | null;
494
+ }>>;
495
+ }, "strict", z.ZodTypeAny, {
496
+ version: "v1";
497
+ updated_at: string;
498
+ currency: "USD";
499
+ status: {
500
+ position: {
501
+ date: string | null;
502
+ net_worth: number | null;
503
+ cash: number | null;
504
+ debt: number | null;
505
+ investments: number | null;
506
+ other_assets: number | null;
507
+ total_assets: number | null;
508
+ } | null;
509
+ accounts: {
510
+ id: string;
511
+ name: string;
512
+ source: "csv_import" | "manual" | "plaid" | null;
513
+ type: "brokerage" | "credit" | "depository" | "investment" | "loan" | "other";
514
+ subtype: string | null;
515
+ group: "cash" | "debt" | "investments" | "other" | null;
516
+ institution: string | null;
517
+ mask: string | null;
518
+ balance: number | null;
519
+ available: number | null;
520
+ currency: string | null;
521
+ updated_at: string | null;
522
+ }[];
523
+ };
524
+ transactions: {
525
+ total: number;
526
+ months: {
527
+ month: string;
528
+ count: number;
529
+ }[];
530
+ };
531
+ recurring: {
532
+ id: string;
533
+ account_id: string | null;
534
+ direction: "inflow" | "outflow" | null;
535
+ frequency: "ANNUALLY" | "BIWEEKLY" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUALLY" | "WEEKLY" | null;
536
+ status: "active" | "dismissed" | "inactive" | null;
537
+ merchant: string | null;
538
+ amount: number | null;
539
+ next_date: string | null;
540
+ excluded_from_subscriptions?: boolean | undefined;
541
+ }[];
542
+ budgets: {
543
+ id: string;
544
+ name: string;
545
+ type: "category" | "merchant";
546
+ period: "biweekly" | "monthly" | "weekly";
547
+ status: "over" | "under" | "warning";
548
+ amount: number;
549
+ spent: number;
550
+ remaining: number;
551
+ used_percent: number;
552
+ }[];
553
+ goals: {
554
+ id: string;
555
+ name: string;
556
+ category: string;
557
+ status: "behind" | "completed" | "in_progress" | "not_started" | "on_track";
558
+ target: number;
559
+ current: number;
560
+ progress_percent: number;
561
+ target_date: string | null;
562
+ }[];
563
+ snapshots: {
564
+ date: string;
565
+ net_worth: number | null;
566
+ cash: number | null;
567
+ debt: number | null;
568
+ income: number | null;
569
+ expenses: number | null;
570
+ cash_flow: number | null;
571
+ savings_rate: number | null;
572
+ investments: number | null;
573
+ assets: number | null;
574
+ health_score: number | null;
575
+ health_score_model_version: 3 | null;
576
+ }[];
577
+ liabilities: {
578
+ account_id: string | null;
579
+ type: "credit" | "mortgage" | "other" | "student" | null;
580
+ balance: number | null;
581
+ minimum_payment: number | null;
582
+ due_date: string | null;
583
+ interest_rate: number | null;
584
+ rate_type: "fixed" | "variable" | null;
585
+ overdue: boolean | null;
586
+ }[];
587
+ holdings: {
588
+ account_id: string | null;
589
+ symbol: string | null;
590
+ name: string | null;
591
+ type: "cash" | "derivative" | "equity" | "etf" | "fixed_income" | "mutual_fund" | "other" | null;
592
+ quantity: number | null;
593
+ value: number | null;
594
+ cost_basis: number | null;
595
+ }[];
596
+ health: {
597
+ score: number;
598
+ model_version: 3;
599
+ record_count: number;
600
+ label: "Good" | "Needs Attention" | "Strong";
601
+ level: "critical" | "fair" | "good" | "poor" | "strong";
602
+ summary: string;
603
+ data_completeness: number;
604
+ pillars: {
605
+ spend: number | null;
606
+ save: number | null;
607
+ borrow: number | null;
608
+ build: number | null;
609
+ } | null;
610
+ } | null;
611
+ }, {
612
+ version: "v1";
613
+ updated_at: string;
614
+ currency: "USD";
615
+ status: {
616
+ position: {
617
+ date: string | null;
618
+ net_worth: number | null;
619
+ cash: number | null;
620
+ debt: number | null;
621
+ investments: number | null;
622
+ other_assets: number | null;
623
+ total_assets: number | null;
624
+ } | null;
625
+ accounts: {
626
+ id: string;
627
+ name: string;
628
+ source: "csv_import" | "manual" | "plaid" | null;
629
+ type: "brokerage" | "credit" | "depository" | "investment" | "loan" | "other";
630
+ subtype: string | null;
631
+ group: "cash" | "debt" | "investments" | "other" | null;
632
+ institution: string | null;
633
+ mask: string | null;
634
+ balance: number | null;
635
+ available: number | null;
636
+ currency: string | null;
637
+ updated_at: string | null;
638
+ }[];
639
+ };
640
+ transactions: {
641
+ total: number;
642
+ months: {
643
+ month: string;
644
+ count: number;
645
+ }[];
646
+ };
647
+ recurring: {
648
+ id: string;
649
+ account_id: string | null;
650
+ direction: "inflow" | "outflow" | null;
651
+ frequency: "ANNUALLY" | "BIWEEKLY" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUALLY" | "WEEKLY" | null;
652
+ status: "active" | "dismissed" | "inactive" | null;
653
+ merchant: string | null;
654
+ amount: number | null;
655
+ next_date: string | null;
656
+ excluded_from_subscriptions?: boolean | undefined;
657
+ }[];
658
+ budgets: {
659
+ id: string;
660
+ name: string;
661
+ type: "category" | "merchant";
662
+ period: "biweekly" | "monthly" | "weekly";
663
+ status: "over" | "under" | "warning";
664
+ amount: number;
665
+ spent: number;
666
+ remaining: number;
667
+ used_percent: number;
668
+ }[];
669
+ goals: {
670
+ id: string;
671
+ name: string;
672
+ category: string;
673
+ status: "behind" | "completed" | "in_progress" | "not_started" | "on_track";
674
+ target: number;
675
+ current: number;
676
+ progress_percent: number;
677
+ target_date: string | null;
678
+ }[];
679
+ snapshots: {
680
+ date: string;
681
+ net_worth: number | null;
682
+ cash: number | null;
683
+ debt: number | null;
684
+ income: number | null;
685
+ expenses: number | null;
686
+ cash_flow: number | null;
687
+ savings_rate: number | null;
688
+ investments: number | null;
689
+ assets: number | null;
690
+ health_score: number | null;
691
+ health_score_model_version: 3 | null;
692
+ }[];
693
+ liabilities: {
694
+ account_id: string | null;
695
+ type: "credit" | "mortgage" | "other" | "student" | null;
696
+ balance: number | null;
697
+ minimum_payment: number | null;
698
+ due_date: string | null;
699
+ interest_rate: number | null;
700
+ rate_type: "fixed" | "variable" | null;
701
+ overdue: boolean | null;
702
+ }[];
703
+ holdings: {
704
+ account_id: string | null;
705
+ symbol: string | null;
706
+ name: string | null;
707
+ type: "cash" | "derivative" | "equity" | "etf" | "fixed_income" | "mutual_fund" | "other" | null;
708
+ quantity: number | null;
709
+ value: number | null;
710
+ cost_basis: number | null;
711
+ }[];
712
+ health: {
713
+ score: number;
714
+ model_version: 3;
715
+ record_count: number;
716
+ label: "Good" | "Needs Attention" | "Strong";
717
+ level: "critical" | "fair" | "good" | "poor" | "strong";
718
+ summary: string;
719
+ data_completeness: number;
720
+ pillars: {
721
+ spend: number | null;
722
+ save: number | null;
723
+ borrow: number | null;
724
+ build: number | null;
725
+ } | null;
726
+ } | null;
727
+ }>;
728
+ months: z.ZodArray<z.ZodObject<{
729
+ month: z.ZodString;
730
+ start_date: z.ZodString;
731
+ end_date: z.ZodString;
732
+ count: z.ZodNumber;
733
+ items: z.ZodArray<z.ZodObject<{
734
+ id: z.ZodString;
735
+ account_id: z.ZodNullable<z.ZodString>;
736
+ date: z.ZodNullable<z.ZodString>;
737
+ amount: z.ZodNumber;
738
+ merchant: z.ZodNullable<z.ZodString>;
739
+ name: z.ZodNullable<z.ZodString>;
740
+ category: z.ZodNullable<z.ZodString>;
741
+ subcategory: z.ZodNullable<z.ZodString>;
742
+ pending: z.ZodNullable<z.ZodBoolean>;
743
+ currency: z.ZodNullable<z.ZodString>;
744
+ }, "strict", z.ZodTypeAny, {
745
+ id: string;
746
+ account_id: string | null;
747
+ date: string | null;
748
+ amount: number;
749
+ merchant: string | null;
750
+ name: string | null;
751
+ category: string | null;
752
+ subcategory: string | null;
753
+ pending: boolean | null;
754
+ currency: string | null;
755
+ }, {
756
+ id: string;
757
+ account_id: string | null;
758
+ date: string | null;
759
+ amount: number;
760
+ merchant: string | null;
761
+ name: string | null;
762
+ category: string | null;
763
+ subcategory: string | null;
764
+ pending: boolean | null;
765
+ currency: string | null;
766
+ }>, "many">;
767
+ }, "strict", z.ZodTypeAny, {
768
+ month: string;
769
+ start_date: string;
770
+ end_date: string;
771
+ count: number;
772
+ items: {
773
+ id: string;
774
+ account_id: string | null;
775
+ date: string | null;
776
+ amount: number;
777
+ merchant: string | null;
778
+ name: string | null;
779
+ category: string | null;
780
+ subcategory: string | null;
781
+ pending: boolean | null;
782
+ currency: string | null;
783
+ }[];
784
+ }, {
785
+ month: string;
786
+ start_date: string;
787
+ end_date: string;
788
+ count: number;
789
+ items: {
790
+ id: string;
791
+ account_id: string | null;
792
+ date: string | null;
793
+ amount: number;
794
+ merchant: string | null;
795
+ name: string | null;
796
+ category: string | null;
797
+ subcategory: string | null;
798
+ pending: boolean | null;
799
+ currency: string | null;
800
+ }[];
801
+ }>, "many">;
802
+ meta: z.ZodObject<{
803
+ version: z.ZodEnum<["v1"]>;
804
+ user_id: z.ZodString;
805
+ context_id: z.ZodString;
806
+ generated_at: z.ZodString;
807
+ updated_at: z.ZodString;
808
+ content_hash: z.ZodString;
809
+ byte_length: z.ZodNumber;
810
+ counts: z.ZodObject<{
811
+ accounts: z.ZodNumber;
812
+ transaction_months: z.ZodNumber;
813
+ transactions: z.ZodNumber;
814
+ snapshots: z.ZodNumber;
815
+ }, "strict", z.ZodTypeAny, {
816
+ accounts: number;
817
+ transaction_months: number;
818
+ transactions: number;
819
+ snapshots: number;
820
+ }, {
821
+ accounts: number;
822
+ transaction_months: number;
823
+ transactions: number;
824
+ snapshots: number;
825
+ }>;
826
+ }, "strict", z.ZodTypeAny, {
827
+ version: "v1";
828
+ user_id: string;
829
+ context_id: string;
830
+ generated_at: string;
831
+ updated_at: string;
832
+ content_hash: string;
833
+ byte_length: number;
834
+ counts: {
835
+ accounts: number;
836
+ transaction_months: number;
837
+ transactions: number;
838
+ snapshots: number;
839
+ };
840
+ }, {
841
+ version: "v1";
842
+ user_id: string;
843
+ context_id: string;
844
+ generated_at: string;
845
+ updated_at: string;
846
+ content_hash: string;
847
+ byte_length: number;
848
+ counts: {
849
+ accounts: number;
850
+ transaction_months: number;
851
+ transactions: number;
852
+ snapshots: number;
853
+ };
854
+ }>;
855
+ status: z.ZodOptional<z.ZodLiteral<"rebuilt">>;
856
+ }, "strict", z.ZodTypeAny, {
857
+ protocol_version: 2;
858
+ user_id: string;
859
+ access_epoch: {
860
+ user_revision: string;
861
+ household: {
862
+ id: string;
863
+ revision: string;
864
+ } | null;
865
+ };
866
+ context: {
867
+ version: "v1";
868
+ updated_at: string;
869
+ currency: "USD";
870
+ status: {
871
+ position: {
872
+ date: string | null;
873
+ net_worth: number | null;
874
+ cash: number | null;
875
+ debt: number | null;
876
+ investments: number | null;
877
+ other_assets: number | null;
878
+ total_assets: number | null;
879
+ } | null;
880
+ accounts: {
881
+ id: string;
882
+ name: string;
883
+ source: "csv_import" | "manual" | "plaid" | null;
884
+ type: "brokerage" | "credit" | "depository" | "investment" | "loan" | "other";
885
+ subtype: string | null;
886
+ group: "cash" | "debt" | "investments" | "other" | null;
887
+ institution: string | null;
888
+ mask: string | null;
889
+ balance: number | null;
890
+ available: number | null;
891
+ currency: string | null;
892
+ updated_at: string | null;
893
+ }[];
894
+ };
895
+ transactions: {
896
+ total: number;
897
+ months: {
898
+ month: string;
899
+ count: number;
900
+ }[];
901
+ };
902
+ recurring: {
903
+ id: string;
904
+ account_id: string | null;
905
+ direction: "inflow" | "outflow" | null;
906
+ frequency: "ANNUALLY" | "BIWEEKLY" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUALLY" | "WEEKLY" | null;
907
+ status: "active" | "dismissed" | "inactive" | null;
908
+ merchant: string | null;
909
+ amount: number | null;
910
+ next_date: string | null;
911
+ excluded_from_subscriptions?: boolean | undefined;
912
+ }[];
913
+ budgets: {
914
+ id: string;
915
+ name: string;
916
+ type: "category" | "merchant";
917
+ period: "biweekly" | "monthly" | "weekly";
918
+ status: "over" | "under" | "warning";
919
+ amount: number;
920
+ spent: number;
921
+ remaining: number;
922
+ used_percent: number;
923
+ }[];
924
+ goals: {
925
+ id: string;
926
+ name: string;
927
+ category: string;
928
+ status: "behind" | "completed" | "in_progress" | "not_started" | "on_track";
929
+ target: number;
930
+ current: number;
931
+ progress_percent: number;
932
+ target_date: string | null;
933
+ }[];
934
+ snapshots: {
935
+ date: string;
936
+ net_worth: number | null;
937
+ cash: number | null;
938
+ debt: number | null;
939
+ income: number | null;
940
+ expenses: number | null;
941
+ cash_flow: number | null;
942
+ savings_rate: number | null;
943
+ investments: number | null;
944
+ assets: number | null;
945
+ health_score: number | null;
946
+ health_score_model_version: 3 | null;
947
+ }[];
948
+ liabilities: {
949
+ account_id: string | null;
950
+ type: "credit" | "mortgage" | "other" | "student" | null;
951
+ balance: number | null;
952
+ minimum_payment: number | null;
953
+ due_date: string | null;
954
+ interest_rate: number | null;
955
+ rate_type: "fixed" | "variable" | null;
956
+ overdue: boolean | null;
957
+ }[];
958
+ holdings: {
959
+ account_id: string | null;
960
+ symbol: string | null;
961
+ name: string | null;
962
+ type: "cash" | "derivative" | "equity" | "etf" | "fixed_income" | "mutual_fund" | "other" | null;
963
+ quantity: number | null;
964
+ value: number | null;
965
+ cost_basis: number | null;
966
+ }[];
967
+ health: {
968
+ score: number;
969
+ model_version: 3;
970
+ record_count: number;
971
+ label: "Good" | "Needs Attention" | "Strong";
972
+ level: "critical" | "fair" | "good" | "poor" | "strong";
973
+ summary: string;
974
+ data_completeness: number;
975
+ pillars: {
976
+ spend: number | null;
977
+ save: number | null;
978
+ borrow: number | null;
979
+ build: number | null;
980
+ } | null;
981
+ } | null;
982
+ };
983
+ months: {
984
+ month: string;
985
+ start_date: string;
986
+ end_date: string;
987
+ count: number;
988
+ items: {
989
+ id: string;
990
+ account_id: string | null;
991
+ date: string | null;
992
+ amount: number;
993
+ merchant: string | null;
994
+ name: string | null;
995
+ category: string | null;
996
+ subcategory: string | null;
997
+ pending: boolean | null;
998
+ currency: string | null;
999
+ }[];
1000
+ }[];
1001
+ meta: {
1002
+ version: "v1";
1003
+ user_id: string;
1004
+ context_id: string;
1005
+ generated_at: string;
1006
+ updated_at: string;
1007
+ content_hash: string;
1008
+ byte_length: number;
1009
+ counts: {
1010
+ accounts: number;
1011
+ transaction_months: number;
1012
+ transactions: number;
1013
+ snapshots: number;
1014
+ };
1015
+ };
1016
+ status?: "rebuilt" | undefined;
1017
+ }, {
1018
+ protocol_version: 2;
1019
+ user_id: string;
1020
+ access_epoch: {
1021
+ user_revision: string;
1022
+ household: {
1023
+ id: string;
1024
+ revision: string;
1025
+ } | null;
1026
+ };
1027
+ context: {
1028
+ version: "v1";
1029
+ updated_at: string;
1030
+ currency: "USD";
1031
+ status: {
1032
+ position: {
1033
+ date: string | null;
1034
+ net_worth: number | null;
1035
+ cash: number | null;
1036
+ debt: number | null;
1037
+ investments: number | null;
1038
+ other_assets: number | null;
1039
+ total_assets: number | null;
1040
+ } | null;
1041
+ accounts: {
1042
+ id: string;
1043
+ name: string;
1044
+ source: "csv_import" | "manual" | "plaid" | null;
1045
+ type: "brokerage" | "credit" | "depository" | "investment" | "loan" | "other";
1046
+ subtype: string | null;
1047
+ group: "cash" | "debt" | "investments" | "other" | null;
1048
+ institution: string | null;
1049
+ mask: string | null;
1050
+ balance: number | null;
1051
+ available: number | null;
1052
+ currency: string | null;
1053
+ updated_at: string | null;
1054
+ }[];
1055
+ };
1056
+ transactions: {
1057
+ total: number;
1058
+ months: {
1059
+ month: string;
1060
+ count: number;
1061
+ }[];
1062
+ };
1063
+ recurring: {
1064
+ id: string;
1065
+ account_id: string | null;
1066
+ direction: "inflow" | "outflow" | null;
1067
+ frequency: "ANNUALLY" | "BIWEEKLY" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUALLY" | "WEEKLY" | null;
1068
+ status: "active" | "dismissed" | "inactive" | null;
1069
+ merchant: string | null;
1070
+ amount: number | null;
1071
+ next_date: string | null;
1072
+ excluded_from_subscriptions?: boolean | undefined;
1073
+ }[];
1074
+ budgets: {
1075
+ id: string;
1076
+ name: string;
1077
+ type: "category" | "merchant";
1078
+ period: "biweekly" | "monthly" | "weekly";
1079
+ status: "over" | "under" | "warning";
1080
+ amount: number;
1081
+ spent: number;
1082
+ remaining: number;
1083
+ used_percent: number;
1084
+ }[];
1085
+ goals: {
1086
+ id: string;
1087
+ name: string;
1088
+ category: string;
1089
+ status: "behind" | "completed" | "in_progress" | "not_started" | "on_track";
1090
+ target: number;
1091
+ current: number;
1092
+ progress_percent: number;
1093
+ target_date: string | null;
1094
+ }[];
1095
+ snapshots: {
1096
+ date: string;
1097
+ net_worth: number | null;
1098
+ cash: number | null;
1099
+ debt: number | null;
1100
+ income: number | null;
1101
+ expenses: number | null;
1102
+ cash_flow: number | null;
1103
+ savings_rate: number | null;
1104
+ investments: number | null;
1105
+ assets: number | null;
1106
+ health_score: number | null;
1107
+ health_score_model_version: 3 | null;
1108
+ }[];
1109
+ liabilities: {
1110
+ account_id: string | null;
1111
+ type: "credit" | "mortgage" | "other" | "student" | null;
1112
+ balance: number | null;
1113
+ minimum_payment: number | null;
1114
+ due_date: string | null;
1115
+ interest_rate: number | null;
1116
+ rate_type: "fixed" | "variable" | null;
1117
+ overdue: boolean | null;
1118
+ }[];
1119
+ holdings: {
1120
+ account_id: string | null;
1121
+ symbol: string | null;
1122
+ name: string | null;
1123
+ type: "cash" | "derivative" | "equity" | "etf" | "fixed_income" | "mutual_fund" | "other" | null;
1124
+ quantity: number | null;
1125
+ value: number | null;
1126
+ cost_basis: number | null;
1127
+ }[];
1128
+ health: {
1129
+ score: number;
1130
+ model_version: 3;
1131
+ record_count: number;
1132
+ label: "Good" | "Needs Attention" | "Strong";
1133
+ level: "critical" | "fair" | "good" | "poor" | "strong";
1134
+ summary: string;
1135
+ data_completeness: number;
1136
+ pillars: {
1137
+ spend: number | null;
1138
+ save: number | null;
1139
+ borrow: number | null;
1140
+ build: number | null;
1141
+ } | null;
1142
+ } | null;
1143
+ };
1144
+ months: {
1145
+ month: string;
1146
+ start_date: string;
1147
+ end_date: string;
1148
+ count: number;
1149
+ items: {
1150
+ id: string;
1151
+ account_id: string | null;
1152
+ date: string | null;
1153
+ amount: number;
1154
+ merchant: string | null;
1155
+ name: string | null;
1156
+ category: string | null;
1157
+ subcategory: string | null;
1158
+ pending: boolean | null;
1159
+ currency: string | null;
1160
+ }[];
1161
+ }[];
1162
+ meta: {
1163
+ version: "v1";
1164
+ user_id: string;
1165
+ context_id: string;
1166
+ generated_at: string;
1167
+ updated_at: string;
1168
+ content_hash: string;
1169
+ byte_length: number;
1170
+ counts: {
1171
+ accounts: number;
1172
+ transaction_months: number;
1173
+ transactions: number;
1174
+ snapshots: number;
1175
+ };
1176
+ };
1177
+ status?: "rebuilt" | undefined;
1178
+ }>, {
1179
+ protocol_version: 2;
1180
+ user_id: string;
1181
+ access_epoch: {
1182
+ user_revision: string;
1183
+ household: {
1184
+ id: string;
1185
+ revision: string;
1186
+ } | null;
1187
+ };
1188
+ context: {
1189
+ version: "v1";
1190
+ updated_at: string;
1191
+ currency: "USD";
1192
+ status: {
1193
+ position: {
1194
+ date: string | null;
1195
+ net_worth: number | null;
1196
+ cash: number | null;
1197
+ debt: number | null;
1198
+ investments: number | null;
1199
+ other_assets: number | null;
1200
+ total_assets: number | null;
1201
+ } | null;
1202
+ accounts: {
1203
+ id: string;
1204
+ name: string;
1205
+ source: "csv_import" | "manual" | "plaid" | null;
1206
+ type: "brokerage" | "credit" | "depository" | "investment" | "loan" | "other";
1207
+ subtype: string | null;
1208
+ group: "cash" | "debt" | "investments" | "other" | null;
1209
+ institution: string | null;
1210
+ mask: string | null;
1211
+ balance: number | null;
1212
+ available: number | null;
1213
+ currency: string | null;
1214
+ updated_at: string | null;
1215
+ }[];
1216
+ };
1217
+ transactions: {
1218
+ total: number;
1219
+ months: {
1220
+ month: string;
1221
+ count: number;
1222
+ }[];
1223
+ };
1224
+ recurring: {
1225
+ id: string;
1226
+ account_id: string | null;
1227
+ direction: "inflow" | "outflow" | null;
1228
+ frequency: "ANNUALLY" | "BIWEEKLY" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUALLY" | "WEEKLY" | null;
1229
+ status: "active" | "dismissed" | "inactive" | null;
1230
+ merchant: string | null;
1231
+ amount: number | null;
1232
+ next_date: string | null;
1233
+ excluded_from_subscriptions?: boolean | undefined;
1234
+ }[];
1235
+ budgets: {
1236
+ id: string;
1237
+ name: string;
1238
+ type: "category" | "merchant";
1239
+ period: "biweekly" | "monthly" | "weekly";
1240
+ status: "over" | "under" | "warning";
1241
+ amount: number;
1242
+ spent: number;
1243
+ remaining: number;
1244
+ used_percent: number;
1245
+ }[];
1246
+ goals: {
1247
+ id: string;
1248
+ name: string;
1249
+ category: string;
1250
+ status: "behind" | "completed" | "in_progress" | "not_started" | "on_track";
1251
+ target: number;
1252
+ current: number;
1253
+ progress_percent: number;
1254
+ target_date: string | null;
1255
+ }[];
1256
+ snapshots: {
1257
+ date: string;
1258
+ net_worth: number | null;
1259
+ cash: number | null;
1260
+ debt: number | null;
1261
+ income: number | null;
1262
+ expenses: number | null;
1263
+ cash_flow: number | null;
1264
+ savings_rate: number | null;
1265
+ investments: number | null;
1266
+ assets: number | null;
1267
+ health_score: number | null;
1268
+ health_score_model_version: 3 | null;
1269
+ }[];
1270
+ liabilities: {
1271
+ account_id: string | null;
1272
+ type: "credit" | "mortgage" | "other" | "student" | null;
1273
+ balance: number | null;
1274
+ minimum_payment: number | null;
1275
+ due_date: string | null;
1276
+ interest_rate: number | null;
1277
+ rate_type: "fixed" | "variable" | null;
1278
+ overdue: boolean | null;
1279
+ }[];
1280
+ holdings: {
1281
+ account_id: string | null;
1282
+ symbol: string | null;
1283
+ name: string | null;
1284
+ type: "cash" | "derivative" | "equity" | "etf" | "fixed_income" | "mutual_fund" | "other" | null;
1285
+ quantity: number | null;
1286
+ value: number | null;
1287
+ cost_basis: number | null;
1288
+ }[];
1289
+ health: {
1290
+ score: number;
1291
+ model_version: 3;
1292
+ record_count: number;
1293
+ label: "Good" | "Needs Attention" | "Strong";
1294
+ level: "critical" | "fair" | "good" | "poor" | "strong";
1295
+ summary: string;
1296
+ data_completeness: number;
1297
+ pillars: {
1298
+ spend: number | null;
1299
+ save: number | null;
1300
+ borrow: number | null;
1301
+ build: number | null;
1302
+ } | null;
1303
+ } | null;
1304
+ };
1305
+ months: {
1306
+ month: string;
1307
+ start_date: string;
1308
+ end_date: string;
1309
+ count: number;
1310
+ items: {
1311
+ id: string;
1312
+ account_id: string | null;
1313
+ date: string | null;
1314
+ amount: number;
1315
+ merchant: string | null;
1316
+ name: string | null;
1317
+ category: string | null;
1318
+ subcategory: string | null;
1319
+ pending: boolean | null;
1320
+ currency: string | null;
1321
+ }[];
1322
+ }[];
1323
+ meta: {
1324
+ version: "v1";
1325
+ user_id: string;
1326
+ context_id: string;
1327
+ generated_at: string;
1328
+ updated_at: string;
1329
+ content_hash: string;
1330
+ byte_length: number;
1331
+ counts: {
1332
+ accounts: number;
1333
+ transaction_months: number;
1334
+ transactions: number;
1335
+ snapshots: number;
1336
+ };
1337
+ };
1338
+ status?: "rebuilt" | undefined;
1339
+ }, {
1340
+ protocol_version: 2;
1341
+ user_id: string;
1342
+ access_epoch: {
1343
+ user_revision: string;
1344
+ household: {
1345
+ id: string;
1346
+ revision: string;
1347
+ } | null;
1348
+ };
1349
+ context: {
1350
+ version: "v1";
1351
+ updated_at: string;
1352
+ currency: "USD";
1353
+ status: {
1354
+ position: {
1355
+ date: string | null;
1356
+ net_worth: number | null;
1357
+ cash: number | null;
1358
+ debt: number | null;
1359
+ investments: number | null;
1360
+ other_assets: number | null;
1361
+ total_assets: number | null;
1362
+ } | null;
1363
+ accounts: {
1364
+ id: string;
1365
+ name: string;
1366
+ source: "csv_import" | "manual" | "plaid" | null;
1367
+ type: "brokerage" | "credit" | "depository" | "investment" | "loan" | "other";
1368
+ subtype: string | null;
1369
+ group: "cash" | "debt" | "investments" | "other" | null;
1370
+ institution: string | null;
1371
+ mask: string | null;
1372
+ balance: number | null;
1373
+ available: number | null;
1374
+ currency: string | null;
1375
+ updated_at: string | null;
1376
+ }[];
1377
+ };
1378
+ transactions: {
1379
+ total: number;
1380
+ months: {
1381
+ month: string;
1382
+ count: number;
1383
+ }[];
1384
+ };
1385
+ recurring: {
1386
+ id: string;
1387
+ account_id: string | null;
1388
+ direction: "inflow" | "outflow" | null;
1389
+ frequency: "ANNUALLY" | "BIWEEKLY" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUALLY" | "WEEKLY" | null;
1390
+ status: "active" | "dismissed" | "inactive" | null;
1391
+ merchant: string | null;
1392
+ amount: number | null;
1393
+ next_date: string | null;
1394
+ excluded_from_subscriptions?: boolean | undefined;
1395
+ }[];
1396
+ budgets: {
1397
+ id: string;
1398
+ name: string;
1399
+ type: "category" | "merchant";
1400
+ period: "biweekly" | "monthly" | "weekly";
1401
+ status: "over" | "under" | "warning";
1402
+ amount: number;
1403
+ spent: number;
1404
+ remaining: number;
1405
+ used_percent: number;
1406
+ }[];
1407
+ goals: {
1408
+ id: string;
1409
+ name: string;
1410
+ category: string;
1411
+ status: "behind" | "completed" | "in_progress" | "not_started" | "on_track";
1412
+ target: number;
1413
+ current: number;
1414
+ progress_percent: number;
1415
+ target_date: string | null;
1416
+ }[];
1417
+ snapshots: {
1418
+ date: string;
1419
+ net_worth: number | null;
1420
+ cash: number | null;
1421
+ debt: number | null;
1422
+ income: number | null;
1423
+ expenses: number | null;
1424
+ cash_flow: number | null;
1425
+ savings_rate: number | null;
1426
+ investments: number | null;
1427
+ assets: number | null;
1428
+ health_score: number | null;
1429
+ health_score_model_version: 3 | null;
1430
+ }[];
1431
+ liabilities: {
1432
+ account_id: string | null;
1433
+ type: "credit" | "mortgage" | "other" | "student" | null;
1434
+ balance: number | null;
1435
+ minimum_payment: number | null;
1436
+ due_date: string | null;
1437
+ interest_rate: number | null;
1438
+ rate_type: "fixed" | "variable" | null;
1439
+ overdue: boolean | null;
1440
+ }[];
1441
+ holdings: {
1442
+ account_id: string | null;
1443
+ symbol: string | null;
1444
+ name: string | null;
1445
+ type: "cash" | "derivative" | "equity" | "etf" | "fixed_income" | "mutual_fund" | "other" | null;
1446
+ quantity: number | null;
1447
+ value: number | null;
1448
+ cost_basis: number | null;
1449
+ }[];
1450
+ health: {
1451
+ score: number;
1452
+ model_version: 3;
1453
+ record_count: number;
1454
+ label: "Good" | "Needs Attention" | "Strong";
1455
+ level: "critical" | "fair" | "good" | "poor" | "strong";
1456
+ summary: string;
1457
+ data_completeness: number;
1458
+ pillars: {
1459
+ spend: number | null;
1460
+ save: number | null;
1461
+ borrow: number | null;
1462
+ build: number | null;
1463
+ } | null;
1464
+ } | null;
1465
+ };
1466
+ months: {
1467
+ month: string;
1468
+ start_date: string;
1469
+ end_date: string;
1470
+ count: number;
1471
+ items: {
1472
+ id: string;
1473
+ account_id: string | null;
1474
+ date: string | null;
1475
+ amount: number;
1476
+ merchant: string | null;
1477
+ name: string | null;
1478
+ category: string | null;
1479
+ subcategory: string | null;
1480
+ pending: boolean | null;
1481
+ currency: string | null;
1482
+ }[];
1483
+ }[];
1484
+ meta: {
1485
+ version: "v1";
1486
+ user_id: string;
1487
+ context_id: string;
1488
+ generated_at: string;
1489
+ updated_at: string;
1490
+ content_hash: string;
1491
+ byte_length: number;
1492
+ counts: {
1493
+ accounts: number;
1494
+ transaction_months: number;
1495
+ transactions: number;
1496
+ snapshots: number;
1497
+ };
1498
+ };
1499
+ status?: "rebuilt" | undefined;
1500
+ }>;
1501
+ export type FinancialContextArtifactEnvelope = z.infer<typeof financialContextArtifactEnvelopeSchema>;
1502
+ export type FinancialContextArtifactHashInput = FinancialContextArtifactHashContent;
1503
+ export declare function compareFinancialContextAccessEpochs(left: FinancialContextAccessEpoch, right: FinancialContextAccessEpoch): FinancialContextAccessEpochComparison;
1504
+ export declare function financialContextAccessEpochsEqual(left: FinancialContextAccessEpoch, right: FinancialContextAccessEpoch): boolean;
1505
+ export declare function canonicalFinancialContextArtifactJson(input: FinancialContextArtifactHashInput): string;
1506
+ export declare function hashFinancialContextArtifact(input: FinancialContextArtifactHashInput): Promise<string>;
1507
+ export declare function hashCanonicalFinancialContextArtifactJson(canonicalJson: string): Promise<string>;
1508
+ export {};
1509
+ //# sourceMappingURL=financial-context-artifact-protocol.d.ts.map