@warmio/contracts 3.0.3 → 3.0.4

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